diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d4d223..61c5016 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,8 +65,7 @@ jobs: - run: echo "DOCKER_API_TAG=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV - - run: - npx nx run cat-fostering-api:docker-push --skip-nx-cache --no-agents --platforms=linux/amd64 --load=true --push=false --tags='ghcr.io/getlarge/cat-fostering/cat-fostering-api:${{ env.DOCKER_API_TAG }}' + - run: npx nx run cat-fostering-api:docker-push --skip-nx-cache --no-agents --platforms=linux/amd64 --load=true --push=false --tags='ghcr.io/getlarge/cat-fostering/cat-fostering-api:${{ env.DOCKER_API_TAG }}' # can't use --wait --wait-timeout N options since Keto and Kratos migrate containers will exit before the Keto and Kratos services are ready - run: npx @dotenvx/dotenvx run -- docker compose --profile ci -p cat-fostering up -d diff --git a/.vscode/thunder-tests/collections/tc_col_cat-fostering.json b/.vscode/thunder-tests/collections/tc_col_cat-fostering.json index 378b0e8..706be1d 100644 --- a/.vscode/thunder-tests/collections/tc_col_cat-fostering.json +++ b/.vscode/thunder-tests/collections/tc_col_cat-fostering.json @@ -1,138 +1,138 @@ { - "_id": "68f2794f-94c6-4be1-847f-46cc09aef587", - "colName": "CatFostering", - "created": "2024-05-19T19:03:45.980Z", - "sortNum": 10000, - "folders": [], - "requests": [ + "_id": "68f2794f-94c6-4be1-847f-46cc09aef587", + "colName": "CatFostering", + "created": "2024-05-19T19:03:45.980Z", + "sortNum": 10000, + "folders": [], + "requests": [ + { + "_id": "75c7aff3-5a3e-4085-aa4f-e5fa78308a68", + "colId": "68f2794f-94c6-4be1-847f-46cc09aef587", + "containerId": "", + "name": "GET current-user", + "url": "/api/users/current-user", + "method": "GET", + "sortNum": 10000, + "created": "2024-05-19T19:05:21.811Z", + "modified": "2024-05-19T19:17:00.791Z", + "headers": [] + }, + { + "_id": "c92cb441-f570-45ab-8a46-e1be1c88b323", + "colId": "68f2794f-94c6-4be1-847f-46cc09aef587", + "containerId": "", + "name": "POST cat-profiles", + "url": "/api/cat-profiles", + "method": "POST", + "sortNum": 20000, + "created": "2024-05-19T19:07:50.514Z", + "modified": "2024-05-19T19:56:31.801Z", + "headers": [], + "body": { + "type": "json", + "raw": "{\n \"name\": \"Romeo\",\n \"description\": \"Romeo is a very playful cat, he loves to play with curtains and sleep on the couch.\",\n \"age\": 2\n}", + "form": [] + }, + "auth": { + "type": "bearer", + "bearer": "{{orySessionToken}}" + } + }, + { + "_id": "719143af-9033-4fb9-9e4d-d3f309ea4fde", + "colId": "68f2794f-94c6-4be1-847f-46cc09aef587", + "containerId": "", + "name": "PATCH cat-profiles/:id", + "url": "/api/cat-profiles/{catProfileId}", + "method": "PATCH", + "sortNum": 30000, + "created": "2024-05-19T19:10:10.851Z", + "modified": "2024-05-19T19:59:38.045Z", + "headers": [], + "params": [ { - "_id": "75c7aff3-5a3e-4085-aa4f-e5fa78308a68", - "colId": "68f2794f-94c6-4be1-847f-46cc09aef587", - "containerId": "", - "name": "GET current-user", - "url": "/api/users/current-user", - "method": "GET", - "sortNum": 10000, - "created": "2024-05-19T19:05:21.811Z", - "modified": "2024-05-19T19:17:00.791Z", - "headers": [] - }, - { - "_id": "c92cb441-f570-45ab-8a46-e1be1c88b323", - "colId": "68f2794f-94c6-4be1-847f-46cc09aef587", - "containerId": "", - "name": "POST cat-profiles", - "url": "/api/cat-profiles", - "method": "POST", - "sortNum": 20000, - "created": "2024-05-19T19:07:50.514Z", - "modified": "2024-05-19T19:56:31.801Z", - "headers": [], - "body": { - "type": "json", - "raw": "{\n \"name\": \"Romeo\",\n \"description\": \"Romeo is a very playful cat, he loves to play with curtains and sleep on the couch.\",\n \"age\": 2\n}", - "form": [] - }, - "auth": { - "type": "bearer", - "bearer": "{{orySessionToken}}" - } - }, - { - "_id": "719143af-9033-4fb9-9e4d-d3f309ea4fde", - "colId": "68f2794f-94c6-4be1-847f-46cc09aef587", - "containerId": "", - "name": "PATCH cat-profiles/:id", - "url": "/api/cat-profiles/{catProfileId}", - "method": "PATCH", - "sortNum": 30000, - "created": "2024-05-19T19:10:10.851Z", - "modified": "2024-05-19T19:59:38.045Z", - "headers": [], - "params": [ - { - "name": "catProfileId", - "value": "{{user1CatProfileId}}", - "isPath": true - } - ], - "body": { - "type": "json", - "raw": "{\n \"age\": 4\n}", - "form": [] - }, - "auth": { - "type": "bearer", - "bearer": "{{orySessionToken}}" - } - }, - { - "_id": "8360df1f-1907-47e6-9306-bf78eb2950be", - "colId": "68f2794f-94c6-4be1-847f-46cc09aef587", - "containerId": "", - "name": "POST fostering", - "url": "/api/fostering", - "method": "POST", - "sortNum": 40000, - "created": "2024-05-19T19:11:13.012Z", - "modified": "2024-05-19T19:24:11.344Z", - "headers": [], - "body": { - "type": "json", - "raw": "{\n \"catProfileId\": \"{{user1CatProfileId}}\",\n \"startDate\": \"2023-12-01\",\n \"endDate\": \"2023-12-07\"\n }", - "form": [] - }, - "auth": { - "type": "bearer", - "bearer": "{{orySessionToken}}" - } - }, - { - "_id": "733d1f15-2637-48a3-8f95-fb9bdbad2a6d", - "colId": "68f2794f-94c6-4be1-847f-46cc09aef587", - "containerId": "", - "name": "GET fostering/:id", - "url": "/api/fostering/{fosteringId}", - "method": "GET", - "sortNum": 50000, - "created": "2024-05-19T19:13:22.742Z", - "modified": "2024-05-19T19:25:16.059Z", - "headers": [], - "params": [ - { - "name": "fosteringId", - "value": "{{user2FosteringId}}", - "isPath": true - } - ] - }, + "name": "catProfileId", + "value": "{{user1CatProfileId}}", + "isPath": true + } + ], + "body": { + "type": "json", + "raw": "{\n \"age\": 4\n}", + "form": [] + }, + "auth": { + "type": "bearer", + "bearer": "{{orySessionToken}}" + } + }, + { + "_id": "8360df1f-1907-47e6-9306-bf78eb2950be", + "colId": "68f2794f-94c6-4be1-847f-46cc09aef587", + "containerId": "", + "name": "POST fostering", + "url": "/api/fostering", + "method": "POST", + "sortNum": 40000, + "created": "2024-05-19T19:11:13.012Z", + "modified": "2024-05-19T19:24:11.344Z", + "headers": [], + "body": { + "type": "json", + "raw": "{\n \"catProfileId\": \"{{user1CatProfileId}}\",\n \"startDate\": \"2023-12-01\",\n \"endDate\": \"2023-12-07\"\n }", + "form": [] + }, + "auth": { + "type": "bearer", + "bearer": "{{orySessionToken}}" + } + }, + { + "_id": "733d1f15-2637-48a3-8f95-fb9bdbad2a6d", + "colId": "68f2794f-94c6-4be1-847f-46cc09aef587", + "containerId": "", + "name": "GET fostering/:id", + "url": "/api/fostering/{fosteringId}", + "method": "GET", + "sortNum": 50000, + "created": "2024-05-19T19:13:22.742Z", + "modified": "2024-05-19T19:25:16.059Z", + "headers": [], + "params": [ { - "_id": "c80cd784-6357-4c55-84cd-69922d916146", - "colId": "68f2794f-94c6-4be1-847f-46cc09aef587", - "containerId": "", - "name": "PATCH approve fostering/:id", - "url": "/api/fostering/{fosteringId}/approve", - "method": "PATCH", - "sortNum": 60000, - "created": "2024-05-19T19:14:02.538Z", - "modified": "2024-05-19T19:27:01.544Z", - "headers": [], - "params": [ - { - "name": "fosteringId", - "value": "{{user2FosteringId}}", - "isPath": true - } - ] + "name": "fosteringId", + "value": "{{user2FosteringId}}", + "isPath": true } - ], - "settings": { - "auth": { - "type": "bearer", - "bearer": "{{orySessionToken}}" - }, - "options": { - "baseUrl": "{{baseUrl}}" + ] + }, + { + "_id": "c80cd784-6357-4c55-84cd-69922d916146", + "colId": "68f2794f-94c6-4be1-847f-46cc09aef587", + "containerId": "", + "name": "PATCH approve fostering/:id", + "url": "/api/fostering/{fosteringId}/approve", + "method": "PATCH", + "sortNum": 60000, + "created": "2024-05-19T19:14:02.538Z", + "modified": "2024-05-19T19:27:01.544Z", + "headers": [], + "params": [ + { + "name": "fosteringId", + "value": "{{user2FosteringId}}", + "isPath": true } + ] + } + ], + "settings": { + "auth": { + "type": "bearer", + "bearer": "{{orySessionToken}}" + }, + "options": { + "baseUrl": "{{baseUrl}}" } -} \ No newline at end of file + } +} diff --git a/.vscode/thunder-tests/environments/tc_env_cat-fostering-demo.json b/.vscode/thunder-tests/environments/tc_env_cat-fostering-demo.json index ee5bdba..010c1da 100644 --- a/.vscode/thunder-tests/environments/tc_env_cat-fostering-demo.json +++ b/.vscode/thunder-tests/environments/tc_env_cat-fostering-demo.json @@ -1,47 +1,47 @@ { - "_id": "11d9d233-af83-41c6-9dce-0afe40547244", - "name": "CatFostering Demo", - "default": true, - "sortNum": 20000, - "created": "2024-05-19T19:39:54.612Z", - "modified": "2024-05-19T19:39:54.612Z", - "data": [ - { - "name": "baseUrl", - "value": "http://localhost:3000" - }, - { - "name": "orySessionToken", - "value": "" - }, - { - "name": "user1Id", - "value": "" - }, - { - "name": "user1CatProfileId", - "value": "" - }, - { - "name": "user2Id", - "value": "" - }, - { - "name": "user2FosteringId", - "value": "" - }, - { - "name": "orySessionToken1", - "value": "" - }, - { - "name": "orySessionToken2", - "value": "" - }, - { - "name": "orySessionToken3", - "value": "" - } - ], - "envFile": "../../.env.demo.thunderclient" -} \ No newline at end of file + "_id": "11d9d233-af83-41c6-9dce-0afe40547244", + "name": "CatFostering Demo", + "default": false, + "sortNum": 20000, + "created": "2024-05-19T19:39:54.612Z", + "modified": "2024-05-19T19:39:54.612Z", + "data": [ + { + "name": "baseUrl", + "value": "http://localhost:3000" + }, + { + "name": "orySessionToken", + "value": "" + }, + { + "name": "user1Id", + "value": "" + }, + { + "name": "user1CatProfileId", + "value": "" + }, + { + "name": "user2Id", + "value": "" + }, + { + "name": "user2FosteringId", + "value": "" + }, + { + "name": "orySessionToken1", + "value": "" + }, + { + "name": "orySessionToken2", + "value": "" + }, + { + "name": "orySessionToken3", + "value": "" + } + ], + "envFile": "../../.env.demo.thunderclient" +} diff --git a/.vscode/thunder-tests/environments/tc_env_cat-fostering.json b/.vscode/thunder-tests/environments/tc_env_cat-fostering.json index a7db370..7da2f65 100644 --- a/.vscode/thunder-tests/environments/tc_env_cat-fostering.json +++ b/.vscode/thunder-tests/environments/tc_env_cat-fostering.json @@ -1,36 +1,35 @@ { - "_id": "361ba671-579f-4a65-86ec-00fd1a930b2d", - "name": "CatFostering", - "default": false, - "sortNum": 10000, - "created": "2024-05-19T19:05:50.272Z", - "modified": "2024-05-19T19:05:50.272Z", - "data": [ - { - "name": "baseUrl", - "value": "http://localhost:3000" - }, - { - "name": "orySessionToken", - "value": "", - "secret": true - }, - { - "name": "user1Id", - "value": "" - }, - { - "name": "user1CatProfileId", - "value": "" - }, - { - "name": "user2Id", - "value": "" - }, - { - "name": "user2FosteringId", - "value": "" - } - ], - "envFile": "../../.env.thunderclient" -} \ No newline at end of file + "_id": "361ba671-579f-4a65-86ec-00fd1a930b2d", + "name": "CatFostering", + "default": true, + "sortNum": 10000, + "created": "2024-05-19T19:05:50.272Z", + "modified": "2024-05-19T19:05:50.272Z", + "data": [ + { + "name": "baseUrl", + "value": "http://localhost:3000" + }, + { + "name": "sessionToken", + "value": "ory_st_aUFfSyTXnrTcbGbLffcxwVZ91yRdzuk1", + "secret": true + }, + { + "name": "user1Id", + "value": "" + }, + { + "name": "user1CatProfileId", + "value": "" + }, + { + "name": "user2Id", + "value": "" + }, + { + "name": "user2FosteringId", + "value": "" + } + ] +} diff --git a/.vscode/thunder-tests/environments/tc_env_local.json b/.vscode/thunder-tests/environments/tc_env_local.json index fddcd3d..a31a3f8 100644 --- a/.vscode/thunder-tests/environments/tc_env_local.json +++ b/.vscode/thunder-tests/environments/tc_env_local.json @@ -1,11 +1,11 @@ { - "_id": "3d0ba032-a98d-4a8e-925f-7f130c8f985c", - "name": "(Local Env)", - "default": false, - "global": true, - "local": true, - "sortNum": -1, - "created": "2024-05-19T19:05:35.856Z", - "modified": "2024-05-19T19:05:35.856Z", - "data": [] -} \ No newline at end of file + "_id": "3d0ba032-a98d-4a8e-925f-7f130c8f985c", + "name": "(Local Env)", + "default": false, + "global": true, + "local": true, + "sortNum": -1, + "created": "2024-05-19T19:05:35.856Z", + "modified": "2024-05-19T19:05:35.856Z", + "data": [] +} diff --git a/apps/cat-fostering-api/openapi.json b/apps/cat-fostering-api/openapi.json index c0f8677..8cb1168 100644 --- a/apps/cat-fostering-api/openapi.json +++ b/apps/cat-fostering-api/openapi.json @@ -38,9 +38,7 @@ } } }, - "tags": [ - "users" - ], + "tags": ["users"], "security": [ { "ory-action": [] @@ -74,9 +72,7 @@ } } }, - "tags": [ - "users" - ], + "tags": ["users"], "security": [ { "ory-action": [] @@ -100,9 +96,7 @@ } } }, - "tags": [ - "users" - ], + "tags": ["users"], "security": [ { "cookie": [] @@ -132,9 +126,7 @@ } } }, - "tags": [ - "cat-profiles" - ], + "tags": ["cat-profiles"], "security": [ { "cookie": [] @@ -169,9 +161,7 @@ } } }, - "tags": [ - "cat-profiles" - ], + "tags": ["cat-profiles"], "security": [ { "cookie": [] @@ -207,9 +197,7 @@ } } }, - "tags": [ - "cat-profiles" - ], + "tags": ["cat-profiles"], "security": [ { "cookie": [] @@ -253,9 +241,7 @@ } } }, - "tags": [ - "cat-profiles" - ], + "tags": ["cat-profiles"], "security": [ { "cookie": [] @@ -282,9 +268,7 @@ "description": "" } }, - "tags": [ - "cat-profiles" - ], + "tags": ["cat-profiles"], "security": [ { "cookie": [] @@ -314,9 +298,7 @@ } } }, - "tags": [ - "fostering" - ], + "tags": ["fostering"], "security": [ { "cookie": [] @@ -351,9 +333,7 @@ } } }, - "tags": [ - "fostering" - ], + "tags": ["fostering"], "security": [ { "cookie": [] @@ -389,9 +369,7 @@ } } }, - "tags": [ - "fostering" - ], + "tags": ["fostering"], "security": [ { "cookie": [] @@ -427,9 +405,7 @@ } } }, - "tags": [ - "fostering" - ], + "tags": ["fostering"], "security": [ { "cookie": [] @@ -458,9 +434,7 @@ "description": "" } }, - "tags": [ - "fostering" - ], + "tags": ["fostering"], "security": [ { "cookie": [] @@ -519,9 +493,7 @@ "type": "string" } }, - "required": [ - "email" - ] + "required": ["email"] }, "OryIdentityDto": { "type": "object", @@ -540,10 +512,7 @@ }, "state": { "type": "string", - "enum": [ - "active", - "inactive" - ] + "enum": ["active", "inactive"] }, "recovery_addresses": { "type": "array", @@ -597,9 +566,7 @@ "$ref": "#/components/schemas/OryIdentityDto" } }, - "required": [ - "identity" - ] + "required": ["identity"] }, "OnOrySignInDto": { "type": "object", @@ -608,9 +575,7 @@ "$ref": "#/components/schemas/OryIdentityDto" } }, - "required": [ - "identity" - ] + "required": ["identity"] }, "Fostering": { "type": "object", @@ -627,11 +592,7 @@ "type": "string" }, "status": { - "enum": [ - "PENDING", - "APPROVED", - "REJECTED" - ], + "enum": ["PENDING", "APPROVED", "REJECTED"], "type": "string" }, "catProfile": { @@ -677,11 +638,7 @@ } } }, - "required": [ - "id", - "name", - "email" - ] + "required": ["id", "name", "email"] }, "CatProfile": { "type": "object", @@ -718,14 +675,7 @@ } } }, - "required": [ - "id", - "name", - "age", - "description", - "photosUrls", - "owner" - ] + "required": ["id", "name", "age", "description", "photosUrls", "owner"] }, "CreateCatProfile": { "type": "object", @@ -744,11 +694,7 @@ "maxLength": 300 } }, - "required": [ - "name", - "age", - "description" - ] + "required": ["name", "age", "description"] }, "UpdateCatProfile": { "type": "object", @@ -783,12 +729,8 @@ "type": "string" } }, - "required": [ - "catProfileId", - "startDate", - "endDate" - ] + "required": ["catProfileId", "startDate", "endDate"] } } } -} \ No newline at end of file +} diff --git a/tools/tsconfig.json b/tools/tsconfig.json index 6db2d7c..cc297b8 100644 --- a/tools/tsconfig.json +++ b/tools/tsconfig.json @@ -3,9 +3,7 @@ "ts-node": { "transpileOnly": true, "files": true, - "require": [ - "tsconfig-paths/register" - ], + "require": ["tsconfig-paths/register"], "esm": false, "compilerOptions": { // compilerOptions specified here will override those declared below, @@ -13,21 +11,15 @@ // different options with a single tsconfig.json. "module": "CommonJS", "target": "es2021", - "lib": [ - "es2021" - ], + "lib": ["es2021"], "strict": true } }, "compilerOptions": { "module": "CommonJS", - "types": [ - "node" - ], + "types": ["node"], "target": "es2021", - "lib": [ - "es2021" - ], + "lib": ["es2021"], "noEmitHelpers": true, "importHelpers": true, "emitDecoratorMetadata": true, @@ -36,10 +28,6 @@ "esModuleInterop": true, "resolveJsonModule": true }, - "include": [ - "**/*.ts" - ], - "types": [ - "node" - ] + "include": ["**/*.ts"], + "types": ["node"] }