Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# Space indents
[*.{yml,yaml,dart}]
charset = utf-8
indent_size = 2
indent_style = space

# Since Makefiles need to have a tab
[Makefile]
indent_style = tab
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "pub"
directory: "/"
schedule:
interval: "monthly"
labels:
- "dependencies"
reviewers:
- "WoodenMaiden"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "monthly"
labels:
- "ci"
reviewers:
- "WoodenMaiden"
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CI
on: push

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
flutter-version: '3.27.3'
- name: Run tests
run: |
make ci
54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
ROOT := $(shell git rev-parse --show-toplevel)
FLUTTER := $(shell which flutter)
DART := $(shell which dart)
FLUTTER_BIN_DIR := $(shell dirname $(FLUTTER))
FLUTTER_DIR := $(FLUTTER_BIN_DIR:/bin=)
CLIENT_DIR := openapi

.PHONY: run
run:
$(FLUTTER) run

.PHONY: analyze
analyze:
$(FLUTTER) analyze

.PHONY: format
format:
$(DART) format .

.PHONY: check-format
check-format:
$(DART) format . --set-exit-if-changed


.PHONY: test
test:
$(FLUTTER) test

.PHONY: codegen
codegen:
openapi-generator generate \
-i https://raw.githubusercontent.com/TimeCopSync/timecopsync_projects_api/refs/heads/main/priv/static/swagger.json \
-g dart \
-o $(CLIENT_DIR) \
-pubName=$(CLIENT_DIR) \
-pubAuthor=timecopsync-project \
-pubAuthorEmail=yann.pomie@laposte.net \
-pubDescription="Api client to interact with a timecopsync endpoint (generated with openapi-generator)" \
-pubName=timecopsync_api \
--minimal-update
rm -v $(CLIENT_DIR)/.travis.yml
rm -v $(CLIENT_DIR)/git_push.sh
$(DART) format $(CLIENT_DIR)

.PHONY: setup
setup: codegen
$(DART) run tool/setup_git_hooks.dart

.PHONY: ci
ci:
$(FLUTTER) pub get
$(DART) format . -o none --set-exit-if-changed
$(FLUTTER) analyze
$(FLUTTER) test
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
api:
image: ghcr.io/timecopsync/project-api:1.0.1
environment:
SECRET_KEY_BASE: somesecretvaluethatshoudlntbepublic
DATABASE_URL: postgres://postgres:postgres@db:5432/sync
db:
image: bitnami/postgresql
environment:
- POSTGRESQL_USERNAME=postgres
- POSTGRESQL_PASSWORD=postgres
- POSTGRESQL_DATABASE=sync
ports:
- '5432:5432'
volumes:
- db_data:/bitnami/postgresql

volumes:
db_data:
19 changes: 19 additions & 0 deletions openapi/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# See https://dart.dev/guides/libraries/private-files

.dart_tool/
.packages
build/

# Except for application packages
pubspec.lock

doc/api/

# IntelliJ
*.iml
*.ipr
*.iws
.idea/

# Mac
.DS_Store
23 changes: 23 additions & 0 deletions openapi/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
41 changes: 41 additions & 0 deletions openapi/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.gitignore
.travis.yml
README.md
analysis_options.yaml
doc/Project.md
doc/ProjectApi.md
doc/ProjectInput.md
doc/ProjectInputProject.md
doc/ProjectResponse.md
doc/Projects.md
doc/ProjectsMetadata.md
doc/Timer.md
doc/TimerApi.md
doc/TimerInput.md
doc/TimerInputTimer.md
doc/TimerResponse.md
doc/Timers.md
git_push.sh
lib/api.dart
lib/api/project_api.dart
lib/api/timer_api.dart
lib/api_client.dart
lib/api_exception.dart
lib/api_helper.dart
lib/auth/api_key_auth.dart
lib/auth/authentication.dart
lib/auth/http_basic_auth.dart
lib/auth/http_bearer_auth.dart
lib/auth/oauth.dart
lib/model/project.dart
lib/model/project_input.dart
lib/model/project_input_project.dart
lib/model/project_response.dart
lib/model/projects.dart
lib/model/projects_metadata.dart
lib/model/timer.dart
lib/model/timer_input.dart
lib/model/timer_input_timer.dart
lib/model/timer_response.dart
lib/model/timers.dart
pubspec.yaml
1 change: 1 addition & 0 deletions openapi/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.10.0
97 changes: 97 additions & 0 deletions openapi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# openapi
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0
- Generator version: 7.10.0
- Build package: org.openapitools.codegen.languages.DartClientCodegen

## Requirements

Dart 2.12 or later

## Installation & Usage

### Github
If this Dart package is published to Github, add the following dependency to your pubspec.yaml
```
dependencies:
openapi:
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```

### Local
To use the package in your local drive, add the following dependency to your pubspec.yaml
```
dependencies:
openapi:
path: /path/to/openapi
```

## Tests

TODO

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```dart
import 'package:openapi/api.dart';


final api_instance = ProjectApi();
final body = ProjectInput(); // ProjectInput | Project to create

try {
final result = api_instance.timecopsyncProjectsApiWebProjectControllerCreate(body);
print(result);
} catch (e) {
print('Exception when calling ProjectApi->timecopsyncProjectsApiWebProjectControllerCreate: $e\n');
}

```

## Documentation for API Endpoints

All URIs are relative to */api/v1*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ProjectApi* | [**timecopsyncProjectsApiWebProjectControllerCreate**](doc//ProjectApi.md#timecopsyncprojectsapiwebprojectcontrollercreate) | **POST** /projects |
*ProjectApi* | [**timecopsyncProjectsApiWebProjectControllerDelete**](doc//ProjectApi.md#timecopsyncprojectsapiwebprojectcontrollerdelete) | **DELETE** /projects/{id} |
*ProjectApi* | [**timecopsyncProjectsApiWebProjectControllerIndex**](doc//ProjectApi.md#timecopsyncprojectsapiwebprojectcontrollerindex) | **GET** /projects |
*ProjectApi* | [**timecopsyncProjectsApiWebProjectControllerShow**](doc//ProjectApi.md#timecopsyncprojectsapiwebprojectcontrollershow) | **GET** /projects/{id} |
*ProjectApi* | [**timecopsyncProjectsApiWebProjectControllerUpdate**](doc//ProjectApi.md#timecopsyncprojectsapiwebprojectcontrollerupdate) | **PATCH** /projects/{id} |
*TimerApi* | [**timecopsyncProjectsApiWebTimerControllerCreate**](doc//TimerApi.md#timecopsyncprojectsapiwebtimercontrollercreate) | **POST** /timers |
*TimerApi* | [**timecopsyncProjectsApiWebTimerControllerDelete**](doc//TimerApi.md#timecopsyncprojectsapiwebtimercontrollerdelete) | **DELETE** /timers/{id} |
*TimerApi* | [**timecopsyncProjectsApiWebTimerControllerIndex**](doc//TimerApi.md#timecopsyncprojectsapiwebtimercontrollerindex) | **GET** /timers |
*TimerApi* | [**timecopsyncProjectsApiWebTimerControllerShow**](doc//TimerApi.md#timecopsyncprojectsapiwebtimercontrollershow) | **GET** /timers/{id} |
*TimerApi* | [**timecopsyncProjectsApiWebTimerControllerUpdate**](doc//TimerApi.md#timecopsyncprojectsapiwebtimercontrollerupdate) | **PATCH** /timers/{id} |


## Documentation For Models

- [Project](doc//Project.md)
- [ProjectInput](doc//ProjectInput.md)
- [ProjectInputProject](doc//ProjectInputProject.md)
- [ProjectResponse](doc//ProjectResponse.md)
- [Projects](doc//Projects.md)
- [ProjectsMetadata](doc//ProjectsMetadata.md)
- [Timer](doc//Timer.md)
- [TimerInput](doc//TimerInput.md)
- [TimerInputTimer](doc//TimerInputTimer.md)
- [TimerResponse](doc//TimerResponse.md)
- [Timers](doc//Timers.md)


## Documentation For Authorization

Endpoints do not require authorization.


## Author



Empty file added openapi/analysis_options.yaml
Empty file.
18 changes: 18 additions & 0 deletions openapi/doc/Project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# openapi.model.Project

## Load the model package
```dart
import 'package:openapi/api.dart';
```

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**archived** | **bool** | Archived status | [optional]
**colour** | **int** | Colour associated represented by hex values casted into integer | [optional]
**id** | **String** | Project ID | [optional]
**name** | **String** | Project name |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading