Skip to content

Commit

Permalink
fix(@whook/example): fix the time mock handler
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Dec 6, 2024
1 parent 7313f1c commit 1cc3956
Show file tree
Hide file tree
Showing 16 changed files with 206 additions and 179 deletions.
315 changes: 170 additions & 145 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/whook-authorization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"homepage": "https://github.com/nfroidure/whook",
"dependencies": {
"@whook/whook": "^18.0.3",
"common-services": "^17.0.0",
"common-services": "^17.0.1",
"http-auth-utils": "^6.0.1",
"knifecycle": "^18.0.0",
"yerror": "^8.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/whook-aws-lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
"@whook/whook": "^18.0.3",
"ajv": "^8.17.1",
"ajv-formats": "^3.0.1",
"application-services": "^7.0.0",
"application-services": "^7.0.1",
"bytes": "^3.1.2",
"camelcase": "^8.0.0",
"common-services": "^17.0.0",
"common-services": "^17.0.1",
"cpr": "3.0.1",
"knifecycle": "^18.0.0",
"mkdirp": "^3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/whook-create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"dependencies": {
"@whook/example": "^18.0.3",
"axios": "^1.7.9",
"common-services": "^17.0.0",
"common-services": "^17.0.1",
"debug": "^4.3.7",
"fs-extra": "^11.2.0",
"inquirer": "^12.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ DEV_MODE=1
"@whook/http-transaction": "<current_version>",
"@whook/swagger-ui": "<current_version>",
"@whook/whook": "<current_version>",
"application-services": "^7.0.0",
"common-services": "^17.0.0",
"application-services": "^7.0.1",
"common-services": "^17.0.1",
"http-auth-utils": "^6.0.1",
"jwt-service": "^11.0.0",
"knifecycle": "^18.0.0",
Expand Down Expand Up @@ -440,8 +440,8 @@ DEV_MODE=1
"@whook/http-transaction": "<current_version>",
"@whook/swagger-ui": "<current_version>",
"@whook/whook": "<current_version>",
"application-services": "^7.0.0",
"common-services": "^17.0.0",
"application-services": "^7.0.1",
"common-services": "^17.0.1",
"http-auth-utils": "^6.0.1",
"jwt-service": "^11.0.0",
"knifecycle": "^18.0.0",
Expand Down Expand Up @@ -784,8 +784,8 @@ DEV_MODE=1
"@whook/http-transaction": "<current_version>",
"@whook/swagger-ui": "<current_version>",
"@whook/whook": "<current_version>",
"application-services": "^7.0.0",
"common-services": "^17.0.0",
"application-services": "^7.0.1",
"common-services": "^17.0.1",
"http-auth-utils": "^6.0.1",
"jwt-service": "^11.0.0",
"knifecycle": "^18.0.0",
Expand Down Expand Up @@ -1111,8 +1111,8 @@ DEV_MODE=1
"@whook/http-transaction": "<current_version>",
"@whook/swagger-ui": "<current_version>",
"@whook/whook": "<current_version>",
"application-services": "^7.0.0",
"common-services": "^17.0.0",
"application-services": "^7.0.1",
"common-services": "^17.0.1",
"http-auth-utils": "^6.0.1",
"jwt-service": "^11.0.0",
"knifecycle": "^18.0.0",
Expand Down
12 changes: 6 additions & 6 deletions packages/whook-create/src/services/createWhook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ describe('initCreateWhook', () => {
"@whook/http-transaction": "<current_version>",
"@whook/swagger-ui": "<current_version>",
"@whook/whook": "<current_version>",
"application-services": "^7.0.0",
"common-services": "^17.0.0",
"application-services": "^7.0.1",
"common-services": "^17.0.1",
"http-auth-utils": "^6.0.1",
"jwt-service": "^11.0.0",
"knifecycle": "^18.0.0",
Expand Down Expand Up @@ -360,8 +360,8 @@ describe('initCreateWhook', () => {
"@whook/http-transaction": "<current_version>",
"@whook/swagger-ui": "<current_version>",
"@whook/whook": "<current_version>",
"application-services": "^7.0.0",
"common-services": "^17.0.0",
"application-services": "^7.0.1",
"common-services": "^17.0.1",
"http-auth-utils": "^6.0.1",
"jwt-service": "^11.0.0",
"knifecycle": "^18.0.0",
Expand Down Expand Up @@ -539,8 +539,8 @@ describe('initCreateWhook', () => {
"@whook/http-transaction": "<current_version>",
"@whook/swagger-ui": "<current_version>",
"@whook/whook": "<current_version>",
"application-services": "^7.0.0",
"common-services": "^17.0.0",
"application-services": "^7.0.1",
"common-services": "^17.0.1",
"http-auth-utils": "^6.0.1",
"jwt-service": "^11.0.0",
"knifecycle": "^18.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/whook-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
"@whook/http-transaction": "^18.0.0",
"@whook/swagger-ui": "^18.0.3",
"@whook/whook": "^18.0.3",
"application-services": "^7.0.0",
"common-services": "^17.0.0",
"application-services": "^7.0.1",
"common-services": "^17.0.1",
"http-auth-utils": "^6.0.1",
"jwt-service": "^11.0.0",
"knifecycle": "^18.0.0",
Expand Down
10 changes: 6 additions & 4 deletions packages/whook-example/src/handlers/putTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
type WhookAPIHandlerDefinition,
type WhookResponse,
} from '@whook/whook';
import { type LogService } from 'common-services';
import { type TimeService, type LogService } from 'common-services';
import { type ClockMockService } from 'application-services';
import { autoHandler } from 'knifecycle';
import { YError } from 'yerror';
Expand Down Expand Up @@ -58,11 +58,13 @@ async function putTime(
APP_ENV,
CLOCK_MOCK,
time,
timeMock,
log,
}: {
APP_ENV: AppEnv;
CLOCK_MOCK: ClockMockService;
time: TimeMockService;
time: TimeService;
timeMock: TimeMockService;
log: LogService;
},
{ body }: { body: { time: number; isFixed: boolean } },
Expand All @@ -78,10 +80,10 @@ async function putTime(
CLOCK_MOCK.referenceTime = time();
}

log('warning', `⌚ - Set time to "${body.time}".`);
log('warning', `⌚ - Set time to "${new Date(body.time).toISOString()}".`);

return {
status: 201,
body: time(),
body: timeMock(),
};
}
4 changes: 2 additions & 2 deletions packages/whook-gcp-functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
"@whook/whook": "^18.0.3",
"ajv": "^8.17.1",
"ajv-formats": "^3.0.1",
"application-services": "^7.0.0",
"application-services": "^7.0.1",
"camelcase": "^8.0.0",
"common-services": "^17.0.0",
"common-services": "^17.0.1",
"cpr": "3.0.1",
"knifecycle": "^18.0.0",
"mkdirp": "^3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/whook-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@apollo/server": "^4.11.2",
"@whook/http-transaction": "^18.0.0",
"@whook/whook": "^18.0.3",
"common-services": "^17.0.0",
"common-services": "^17.0.1",
"knifecycle": "^18.0.0",
"openapi-types": "^12.1.3",
"type-fest": "^4.30.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/whook-http-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@whook/http-transaction": "^18.0.0",
"ajv": "^8.17.1",
"ajv-formats": "^3.0.1",
"application-services": "^7.0.0",
"application-services": "^7.0.1",
"bytes": "^3.1.2",
"camelcase": "^8.0.0",
"content-type": "^1.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/whook-http-transaction/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"homepage": "https://github.com/nfroidure/whook",
"dependencies": {
"common-services": "^17.0.0",
"common-services": "^17.0.1",
"knifecycle": "^18.0.0",
"ms": "^2.1.3",
"openapi-types": "^12.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/whook-method-override/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"dependencies": {
"@whook/http-transaction": "^18.0.0",
"@whook/whook": "^18.0.3",
"common-services": "^17.0.0",
"common-services": "^17.0.1",
"knifecycle": "^18.0.0",
"openapi-types": "^12.1.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/whook-oauth2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@whook/authorization": "^18.0.3",
"@whook/whook": "^18.0.3",
"camelcase": "^8.0.0",
"common-services": "^17.0.0",
"common-services": "^17.0.1",
"cookie": "^1.0.2",
"knifecycle": "^18.0.0",
"openapi-types": "^12.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/whook-versions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"homepage": "https://github.com/nfroidure/whook",
"dependencies": {
"@whook/whook": "^18.0.3",
"application-services": "^7.0.0",
"application-services": "^7.0.1",
"knifecycle": "^18.0.0",
"openapi-types": "^12.1.3",
"semver": "^7.6.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/whook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@
"@whook/http-transaction": "^18.0.0",
"ajv": "^8.17.1",
"ajv-formats": "^3.0.1",
"application-services": "^7.0.0",
"application-services": "^7.0.1",
"camelcase": "^8.0.0",
"chokidar": "^4.0.1",
"common-services": "^17.0.0",
"common-services": "^17.0.1",
"debug": "^4.3.7",
"fs-extra": "^11.2.0",
"ignore": "^5.3.1",
Expand Down

0 comments on commit 1cc3956

Please sign in to comment.