diff --git a/apps/api-server/src/authentication-handlers/api-key.test.ts b/apps/api-server/src/authentication-handlers/api-key.test.ts index 249beaea..00c3daba 100644 --- a/apps/api-server/src/authentication-handlers/api-key.test.ts +++ b/apps/api-server/src/authentication-handlers/api-key.test.ts @@ -16,14 +16,10 @@ test('api-key authentication', () => userId: userItem.id, }) - const result = await api.client.me( - { - contentType: null, - parameters: {}, - }, - { apiKey: apiKeyItem.token }, - { baseUrl }, - ) + const result = await api.client.me({ + apiKey: apiKeyItem.token, + baseUrl, + }) assert(result.status === 200) diff --git a/apps/api-server/src/authentication-handlers/open-id.test.ts b/apps/api-server/src/authentication-handlers/open-id.test.ts index 72f16b69..0666d195 100644 --- a/apps/api-server/src/authentication-handlers/open-id.test.ts +++ b/apps/api-server/src/authentication-handlers/open-id.test.ts @@ -28,14 +28,7 @@ test('open-id authentication', () => const token = sessionItem.access_token - const result = await api.client.me( - { - contentType: null, - parameters: {}, - }, - { openId: token }, - { baseUrl }, - ) + const result = await api.client.me({ openId: token, baseUrl }) assert(result.status === 200) diff --git a/apps/api-server/src/operation-handlers/curriculum.ts b/apps/api-server/src/operation-handlers/curriculum.ts index 04a398ce..ffc39aca 100644 --- a/apps/api-server/src/operation-handlers/curriculum.ts +++ b/apps/api-server/src/operation-handlers/curriculum.ts @@ -3,9 +3,7 @@ import * as application from '../application/index.js' export const retrieveCurriculaByDiscipline: api.server.RetrieveCurriculaByDisciplineOperationHandler< application.Authentication -> = async (incomingRequest, authentication) => { - // const { disciplineKey } = incomingRequest.parameters - +> = async ({ disciplineKey }) => { // // TODO get discipline type from core // let disciplineItem: Awaited< // ReturnType @@ -35,10 +33,5 @@ export const retrieveCurriculaByDiscipline: api.server.RetrieveCurriculaByDiscip // id: item.id, // })) - return { - parameters: {}, - status: 200, - contentType: 'application/json', - entity: () => [], - } + return [200, []] } diff --git a/apps/api-server/src/operation-handlers/discipline.ts b/apps/api-server/src/operation-handlers/discipline.ts index 9c0c2044..8fac8252 100644 --- a/apps/api-server/src/operation-handlers/discipline.ts +++ b/apps/api-server/src/operation-handlers/discipline.ts @@ -3,7 +3,7 @@ import * as application from '../application/index.js' export const listDisciplines: api.server.ListDisciplinesOperationHandler< application.Authentication -> = async (incomingRequest, authentication) => { +> = async () => { // const disciplineList = await core.Program.Discipline.list() // const responseEntity = disciplineList.map((item) => ({ @@ -11,19 +11,12 @@ export const listDisciplines: api.server.ListDisciplinesOperationHandler< // handle: item.handle, // })) - return { - parameters: {}, - status: 200, - contentType: 'application/json', - entity: () => [], - } + return [] } export const retrieveDiscipline: api.server.RetrieveDisciplineOperationHandler< application.Authentication -> = async (incomingRequest, authentication) => { - // const { disciplineKey } = incomingRequest.parameters - +> = async ({ disciplineKey }) => { // // TODO get discipline type from core // let disciplineItem: Awaited< // ReturnType @@ -57,9 +50,5 @@ export const retrieveDiscipline: api.server.RetrieveDisciplineOperationHandler< // entity: () => responseEntity, // } - return { - parameters: {}, - status: 404, - contentType: null, - } + return [404, undefined] } diff --git a/apps/api-server/src/operation-handlers/location-certificate.ts b/apps/api-server/src/operation-handlers/location-certificate.ts index 8e9f2d71..ed710d0b 100644 --- a/apps/api-server/src/operation-handlers/location-certificate.ts +++ b/apps/api-server/src/operation-handlers/location-certificate.ts @@ -4,9 +4,7 @@ import * as application from '../application/index.js' export const getLocationCertificates: api.server.GetLocationCertificatesOperationHandler< application.Authentication -> = async (incomingRequest, authentication) => { - const { locationKey } = incomingRequest.parameters - +> = async ({ locationKey }) => { // TODO get type from core let locationItem: Awaited> @@ -19,11 +17,7 @@ export const getLocationCertificates: api.server.GetLocationCertificatesOperatio } if (locationItem == null) { - return { - parameters: {}, - status: 404, - contentType: null, - } + return [404, undefined] } // TODO actually list certificates @@ -37,21 +31,13 @@ export const getLocationCertificates: api.server.GetLocationCertificatesOperatio title: item.title, })) - return { - status: 200, - parameters: {}, - contentType: 'application/json', - entity: () => responseEntity, - } + return [200, responseEntity] } export const createLocationCertificate: api.server.CreateLocationCertificateOperationHandler< application.Authentication -> = async (incomingRequest, authentication) => +> = async ({ locationKey }, requestEntity) => core.withTransaction(async () => { - const { locationKey } = incomingRequest.parameters - const requestEntity = await incomingRequest.entity() - // TODO get type from core let locationItem: Awaited> @@ -64,11 +50,7 @@ export const createLocationCertificate: api.server.CreateLocationCertificateOper } if (locationItem == null) { - return { - parameters: {}, - status: 404, - contentType: null, - } + return [404, undefined] } // TODO actually create a certificate @@ -82,10 +64,5 @@ export const createLocationCertificate: api.server.CreateLocationCertificateOper id: certificateItem.id, } - return { - status: 201, - parameters: {}, - contentType: 'application/json', - entity: () => responseItem, - } + return [201, responseItem] }) diff --git a/apps/api-server/src/operation-handlers/location-cohort.ts b/apps/api-server/src/operation-handlers/location-cohort.ts index 89e09523..194d254e 100644 --- a/apps/api-server/src/operation-handlers/location-cohort.ts +++ b/apps/api-server/src/operation-handlers/location-cohort.ts @@ -4,16 +4,12 @@ import * as application from '../application/index.js' export const getLocationCohorts: api.server.GetLocationCohortsOperationHandler< application.Authentication -> = async (incomingRequest, authentication) => { - const { locationKey } = incomingRequest.parameters - +> = async ({ locationKey }) => { // TODO list cohorts - return { - status: 200, - parameters: {}, - contentType: 'application/json', - entity: () => [ + return [ + 200, + [ { id: '', handle: '', @@ -25,24 +21,14 @@ export const getLocationCohorts: api.server.GetLocationCohortsOperationHandler< title: '', }, ], - } + ] } export const createLocationCohort: api.server.CreateLocationCohortOperationHandler< application.Authentication -> = async (incomingRequest, authentication) => +> = async ({ locationKey }, entity) => core.withTransaction(async () => { - const { locationKey } = incomingRequest.parameters - const entity = await incomingRequest.entity() - // TODO create cohort - return { - status: 201, - parameters: {}, - contentType: 'application/json', - entity: () => ({ - id: '', - }), - } + return [201, { id: '' }] }) diff --git a/apps/api-server/src/operation-handlers/location.ts b/apps/api-server/src/operation-handlers/location.ts index 1462d7c4..a22c3c58 100644 --- a/apps/api-server/src/operation-handlers/location.ts +++ b/apps/api-server/src/operation-handlers/location.ts @@ -4,7 +4,7 @@ import * as application from '../application/index.js' export const getLocations: api.server.GetLocationsOperationHandler< application.Authentication -> = async (incomingRequest, authentication) => { +> = async () => { const list = await core.Location.list() const listEntity = list.map((item) => ({ @@ -13,21 +13,13 @@ export const getLocations: api.server.GetLocationsOperationHandler< title: item.name, })) - // TODO this could be easier - return { - status: 200, - parameters: {}, - contentType: 'application/json', - entity: () => listEntity, - } + return listEntity } export const createLocation: api.server.CreateLocationOperationHandler< application.Authentication -> = async (incomingRequest, authentication) => +> = async (entity) => core.withTransaction(async () => { - const entity = await incomingRequest.entity() - const result = await core.Location.create({ name: entity.title, handle: entity.handle, @@ -38,10 +30,5 @@ export const createLocation: api.server.CreateLocationOperationHandler< id: result.id, } - return { - status: 201, - parameters: {}, - contentType: 'application/json', - entity: () => resultEntity, - } + return [201, resultEntity] }) diff --git a/apps/api-server/src/operation-handlers/me.ts b/apps/api-server/src/operation-handlers/me.ts index caf9898f..d0b225f2 100644 --- a/apps/api-server/src/operation-handlers/me.ts +++ b/apps/api-server/src/operation-handlers/me.ts @@ -4,7 +4,7 @@ import * as application from '../application/index.js' export const me: api.server.MeOperationHandler< application.Authentication -> = async (incomingRequest, authentication) => { +> = async (authentication) => { let id: string | undefined // TODO make this more ergonomic if ('apiKey' in authentication && authentication.apiKey != null) { @@ -19,12 +19,7 @@ export const me: api.server.MeOperationHandler< assert(id != null) return { - status: 200, - parameters: {}, - contentType: 'application/json', - entity: () => ({ - id, - handle: '', - }), + id, + handle: '', } } diff --git a/apps/api-server/src/operation-handlers/program.ts b/apps/api-server/src/operation-handlers/program.ts index 2060f43d..15aaff9a 100644 --- a/apps/api-server/src/operation-handlers/program.ts +++ b/apps/api-server/src/operation-handlers/program.ts @@ -3,7 +3,7 @@ import * as application from '../application/index.js' export const listPrograms: api.server.ListProgramsOperationHandler< application.Authentication -> = async (incomingRequest, authentication) => { +> = async () => { // const list = await core.Program.list() // const listEntity = list.map((item) => ({ @@ -16,10 +16,5 @@ export const listPrograms: api.server.ListProgramsOperationHandler< // disciplineTitle: item.discipline.title, // })) - return { - status: 200, - parameters: {}, - contentType: 'application/json', - entity: () => [], - } + return [] } diff --git a/package.json b/package.json index 784603cc..a0634301 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "formatting": "prettier --check *", "formatting:fix": "prettier --write *", "build:packages": "pnpm --recursive --filter './packages/**' build", - "initialize": "node ./scripts/initialize.js", + "initialize": "node ./scripts/initialize.mjs", "db:reset": "node ./scripts/reset-migrate-local-db.js", "db:seed": "node ./scripts/seed-local-db.js" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1beda454..731f8f96 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -347,11 +347,11 @@ importers: generated/api: dependencies: '@skiffa/lib': - specifier: ^0.10.6 - version: 0.10.6 + specifier: ^0.12.8 + version: 0.12.8 '@types/node': - specifier: ^18.19.39 - version: 18.19.43 + specifier: ^18.19.54 + version: 18.19.54 goodrouter: specifier: ^2.1.6 version: 2.1.6 @@ -360,11 +360,11 @@ importers: specifier: ^18.2.4 version: 18.2.4 rollup: - specifier: ^4.18.0 - version: 4.19.2 + specifier: ^4.24.0 + version: 4.24.0 typescript: - specifier: ^5.5.2 - version: 5.5.4 + specifier: ^5.6.2 + version: 5.6.2 packages/core: dependencies: @@ -4112,136 +4112,136 @@ packages: react: 18.3.1 dev: false - /@rollup/rollup-android-arm-eabi@4.19.2: - resolution: {integrity: sha512-OHflWINKtoCFSpm/WmuQaWW4jeX+3Qt3XQDepkkiFTsoxFc5BpF3Z5aDxFZgBqRjO6ATP5+b1iilp4kGIZVWlA==} + /@rollup/rollup-android-arm-eabi@4.24.0: + resolution: {integrity: sha512-Q6HJd7Y6xdB48x8ZNVDOqsbh2uByBhgK8PiQgPhwkIw/HC/YX5Ghq2mQY5sRMZWHb3VsFkWooUVOZHKr7DmDIA==} cpu: [arm] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-android-arm64@4.19.2: - resolution: {integrity: sha512-k0OC/b14rNzMLDOE6QMBCjDRm3fQOHAL8Ldc9bxEWvMo4Ty9RY6rWmGetNTWhPo+/+FNd1lsQYRd0/1OSix36A==} + /@rollup/rollup-android-arm64@4.24.0: + resolution: {integrity: sha512-ijLnS1qFId8xhKjT81uBHuuJp2lU4x2yxa4ctFPtG+MqEE6+C5f/+X/bStmxapgmwLwiL3ih122xv8kVARNAZA==} cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-arm64@4.19.2: - resolution: {integrity: sha512-IIARRgWCNWMTeQH+kr/gFTHJccKzwEaI0YSvtqkEBPj7AshElFq89TyreKNFAGh5frLfDCbodnq+Ye3dqGKPBw==} + /@rollup/rollup-darwin-arm64@4.24.0: + resolution: {integrity: sha512-bIv+X9xeSs1XCk6DVvkO+S/z8/2AMt/2lMqdQbMrmVpgFvXlmde9mLcbQpztXm1tajC3raFDqegsH18HQPMYtA==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-x64@4.19.2: - resolution: {integrity: sha512-52udDMFDv54BTAdnw+KXNF45QCvcJOcYGl3vQkp4vARyrcdI/cXH8VXTEv/8QWfd6Fru8QQuw1b2uNersXOL0g==} + /@rollup/rollup-darwin-x64@4.24.0: + resolution: {integrity: sha512-X6/nOwoFN7RT2svEQWUsW/5C/fYMBe4fnLK9DQk4SX4mgVBiTA9h64kjUYPvGQ0F/9xwJ5U5UfTbl6BEjaQdBQ==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.19.2: - resolution: {integrity: sha512-r+SI2t8srMPYZeoa1w0o/AfoVt9akI1ihgazGYPQGRilVAkuzMGiTtexNZkrPkQsyFrvqq/ni8f3zOnHw4hUbA==} + /@rollup/rollup-linux-arm-gnueabihf@4.24.0: + resolution: {integrity: sha512-0KXvIJQMOImLCVCz9uvvdPgfyWo93aHHp8ui3FrtOP57svqrF/roSSR5pjqL2hcMp0ljeGlU4q9o/rQaAQ3AYA==} cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm-musleabihf@4.19.2: - resolution: {integrity: sha512-+tYiL4QVjtI3KliKBGtUU7yhw0GMcJJuB9mLTCEauHEsqfk49gtUBXGtGP3h1LW8MbaTY6rSFIQV1XOBps1gBA==} + /@rollup/rollup-linux-arm-musleabihf@4.24.0: + resolution: {integrity: sha512-it2BW6kKFVh8xk/BnHfakEeoLPv8STIISekpoF+nBgWM4d55CZKc7T4Dx1pEbTnYm/xEKMgy1MNtYuoA8RFIWw==} cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.19.2: - resolution: {integrity: sha512-OR5DcvZiYN75mXDNQQxlQPTv4D+uNCUsmSCSY2FolLf9W5I4DSoJyg7z9Ea3TjKfhPSGgMJiey1aWvlWuBzMtg==} + /@rollup/rollup-linux-arm64-gnu@4.24.0: + resolution: {integrity: sha512-i0xTLXjqap2eRfulFVlSnM5dEbTVque/3Pi4g2y7cxrs7+a9De42z4XxKLYJ7+OhE3IgxvfQM7vQc43bwTgPwA==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-musl@4.19.2: - resolution: {integrity: sha512-Hw3jSfWdUSauEYFBSFIte6I8m6jOj+3vifLg8EU3lreWulAUpch4JBjDMtlKosrBzkr0kwKgL9iCfjA8L3geoA==} + /@rollup/rollup-linux-arm64-musl@4.24.0: + resolution: {integrity: sha512-9E6MKUJhDuDh604Qco5yP/3qn3y7SLXYuiC0Rpr89aMScS2UAmK1wHP2b7KAa1nSjWJc/f/Lc0Wl1L47qjiyQw==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-powerpc64le-gnu@4.19.2: - resolution: {integrity: sha512-rhjvoPBhBwVnJRq/+hi2Q3EMiVF538/o9dBuj9TVLclo9DuONqt5xfWSaE6MYiFKpo/lFPJ/iSI72rYWw5Hc7w==} + /@rollup/rollup-linux-powerpc64le-gnu@4.24.0: + resolution: {integrity: sha512-2XFFPJ2XMEiF5Zi2EBf4h73oR1V/lycirxZxHZNc93SqDN/IWhYYSYj8I9381ikUFXZrz2v7r2tOVk2NBwxrWw==} cpu: [ppc64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-riscv64-gnu@4.19.2: - resolution: {integrity: sha512-EAz6vjPwHHs2qOCnpQkw4xs14XJq84I81sDRGPEjKPFVPBw7fwvtwhVjcZR6SLydCv8zNK8YGFblKWd/vRmP8g==} + /@rollup/rollup-linux-riscv64-gnu@4.24.0: + resolution: {integrity: sha512-M3Dg4hlwuntUCdzU7KjYqbbd+BLq3JMAOhCKdBE3TcMGMZbKkDdJ5ivNdehOssMCIokNHFOsv7DO4rlEOfyKpg==} cpu: [riscv64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-s390x-gnu@4.19.2: - resolution: {integrity: sha512-IJSUX1xb8k/zN9j2I7B5Re6B0NNJDJ1+soezjNojhT8DEVeDNptq2jgycCOpRhyGj0+xBn7Cq+PK7Q+nd2hxLA==} + /@rollup/rollup-linux-s390x-gnu@4.24.0: + resolution: {integrity: sha512-mjBaoo4ocxJppTorZVKWFpy1bfFj9FeCMJqzlMQGjpNPY9JwQi7OuS1axzNIk0nMX6jSgy6ZURDZ2w0QW6D56g==} cpu: [s390x] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-gnu@4.19.2: - resolution: {integrity: sha512-OgaToJ8jSxTpgGkZSkwKE+JQGihdcaqnyHEFOSAU45utQ+yLruE1dkonB2SDI8t375wOKgNn8pQvaWY9kPzxDQ==} + /@rollup/rollup-linux-x64-gnu@4.21.3: + resolution: {integrity: sha512-kZPbX/NOPh0vhS5sI+dR8L1bU2cSO9FgxwM8r7wHzGydzfSjLRCFAT87GR5U9scj2rhzN3JPYVC7NoBbl4FZ0g==} cpu: [x64] os: [linux] requiresBuild: true - dev: true + dev: false optional: true - /@rollup/rollup-linux-x64-gnu@4.21.3: - resolution: {integrity: sha512-kZPbX/NOPh0vhS5sI+dR8L1bU2cSO9FgxwM8r7wHzGydzfSjLRCFAT87GR5U9scj2rhzN3JPYVC7NoBbl4FZ0g==} + /@rollup/rollup-linux-x64-gnu@4.24.0: + resolution: {integrity: sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==} cpu: [x64] os: [linux] requiresBuild: true - dev: false + dev: true optional: true - /@rollup/rollup-linux-x64-musl@4.19.2: - resolution: {integrity: sha512-5V3mPpWkB066XZZBgSd1lwozBk7tmOkKtquyCJ6T4LN3mzKENXyBwWNQn8d0Ci81hvlBw5RoFgleVpL6aScLYg==} + /@rollup/rollup-linux-x64-musl@4.24.0: + resolution: {integrity: sha512-w1i+L7kAXZNdYl+vFvzSZy8Y1arS7vMgIy8wusXJzRrPyof5LAb02KGr1PD2EkRcl73kHulIID0M501lN+vobQ==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.19.2: - resolution: {integrity: sha512-ayVstadfLeeXI9zUPiKRVT8qF55hm7hKa+0N1V6Vj+OTNFfKSoUxyZvzVvgtBxqSb5URQ8sK6fhwxr9/MLmxdA==} + /@rollup/rollup-win32-arm64-msvc@4.24.0: + resolution: {integrity: sha512-VXBrnPWgBpVDCVY6XF3LEW0pOU51KbaHhccHw6AS6vBWIC60eqsH19DAeeObl+g8nKAz04QFdl/Cefta0xQtUQ==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.19.2: - resolution: {integrity: sha512-Mda7iG4fOLHNsPqjWSjANvNZYoW034yxgrndof0DwCy0D3FvTjeNo+HGE6oGWgvcLZNLlcp0hLEFcRs+UGsMLg==} + /@rollup/rollup-win32-ia32-msvc@4.24.0: + resolution: {integrity: sha512-xrNcGDU0OxVcPTH/8n/ShH4UevZxKIO6HJFK0e15XItZP2UcaiLFd5kiX7hJnqCbSztUF8Qot+JWBC/QXRPYWQ==} cpu: [ia32] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-x64-msvc@4.19.2: - resolution: {integrity: sha512-DPi0ubYhSow/00YqmG1jWm3qt1F8aXziHc/UNy8bo9cpCacqhuWu+iSq/fp2SyEQK7iYTZ60fBU9cat3MXTjIQ==} + /@rollup/rollup-win32-x64-msvc@4.24.0: + resolution: {integrity: sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw==} cpu: [x64] os: [win32] requiresBuild: true @@ -4285,7 +4285,7 @@ packages: '@appsignal/nodejs': 3.4.8 '@opentelemetry/api': 1.9.0 '@skiffa/lib': 0.11.0 - '@types/node': 18.19.50 + '@types/node': 18.19.54 tslib: 2.6.3 type-fest: 4.23.0 transitivePeerDependencies: @@ -4293,26 +4293,26 @@ packages: - supports-color dev: false - /@skiffa/lib@0.10.6: - resolution: {integrity: sha512-8wyxO7AFLaO9F+nrAyGdeF7GT7xkLGI86G84bwMcnO/M0uxPoAjb/TMwOU2xjvjO2xFxERJ9bSFDZNBPuvnf+w==} + /@skiffa/lib@0.11.0: + resolution: {integrity: sha512-QUlWfrW1SbcRnUbj/1hC8axV/EhdmkkADzgiPu9lZM9SQIxr0SByM2UycTkCFxfzkotUnaOtEEjakGmtXQqzRw==} engines: {node: '>=18'} dependencies: - '@types/node': 18.19.43 + '@types/node': 18.19.54 js-base64: 3.7.7 msecs: 1.0.3 tslib: 2.6.3 type-fest: 4.23.0 dev: false - /@skiffa/lib@0.11.0: - resolution: {integrity: sha512-QUlWfrW1SbcRnUbj/1hC8axV/EhdmkkADzgiPu9lZM9SQIxr0SByM2UycTkCFxfzkotUnaOtEEjakGmtXQqzRw==} + /@skiffa/lib@0.12.8: + resolution: {integrity: sha512-Nywc3KvEWQO+spDVGj4mFlYby/0iTVJ5fX+r5LN/Yd5bw5Qud+nPwkXshYRBIXHtJmvaPD7zbFn8iHcaP17sHQ==} engines: {node: '>=18'} dependencies: - '@types/node': 18.19.50 + '@types/node': 18.19.54 js-base64: 3.7.7 - msecs: 1.0.3 - tslib: 2.6.3 - type-fest: 4.23.0 + msecs: 1.0.4 + tslib: 2.7.0 + type-fest: 4.26.1 dev: false /@socket.io/component-emitter@3.1.2: @@ -4545,7 +4545,7 @@ packages: /@types/accepts@1.3.7: resolution: {integrity: sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==} dependencies: - '@types/node': 20.14.14 + '@types/node': 20.16.5 dev: false /@types/acorn@4.0.6: @@ -4557,13 +4557,13 @@ packages: resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} dependencies: '@types/connect': 3.4.38 - '@types/node': 20.14.14 + '@types/node': 20.16.5 dev: false /@types/connect@3.4.38: resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} dependencies: - '@types/node': 20.14.14 + '@types/node': 20.16.5 dev: false /@types/content-disposition@0.5.8: @@ -4580,13 +4580,13 @@ packages: '@types/connect': 3.4.38 '@types/express': 4.17.21 '@types/keygrip': 1.0.6 - '@types/node': 20.14.14 + '@types/node': 20.16.5 dev: false /@types/cors@2.8.17: resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} dependencies: - '@types/node': 22.5.5 + '@types/node': 20.16.5 dev: true /@types/d3-array@3.2.1: @@ -4651,10 +4651,14 @@ packages: /@types/estree@1.0.5: resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + /@types/estree@1.0.6: + resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + dev: true + /@types/express-serve-static-core@4.19.5: resolution: {integrity: sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==} dependencies: - '@types/node': 20.14.14 + '@types/node': 20.16.5 '@types/qs': 6.9.15 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -4746,7 +4750,7 @@ packages: '@types/http-errors': 2.0.4 '@types/keygrip': 1.0.6 '@types/koa-compose': 3.2.8 - '@types/node': 20.14.14 + '@types/node': 20.16.5 dev: false /@types/koa__router@12.0.3: @@ -4789,7 +4793,7 @@ packages: /@types/mysql@2.15.22: resolution: {integrity: sha512-wK1pzsJVVAjYCSZWQoWHziQZbNggXFDUEIGf54g4ZM/ERuP86uGdWeKZWMYlqTPMZfHJJvLPyogXGvCOg87yLQ==} dependencies: - '@types/node': 20.14.14 + '@types/node': 20.16.5 dev: false /@types/nlcst@1.0.4: @@ -4798,14 +4802,8 @@ packages: '@types/unist': 2.0.10 dev: true - /@types/node@18.19.43: - resolution: {integrity: sha512-Mw/YlgXnyJdEwLoFv2dpuJaDFriX+Pc+0qOBJ57jC1H6cDxIj2xc5yUrdtArDVG0m+KV6622a4p2tenEqB3C/g==} - dependencies: - undici-types: 5.26.5 - dev: false - - /@types/node@18.19.50: - resolution: {integrity: sha512-xonK+NRrMBRtkL1hVCc3G+uXtjh1Al4opBLjqVmipe5ZAaBYWW6cNAiBVZ1BvmkBhep698rP3UM3aRAdSALuhg==} + /@types/node@18.19.54: + resolution: {integrity: sha512-+BRgt0G5gYjTvdLac9sIeE0iZcJxi4Jc4PV5EUzqi+88jmQLr+fRZdv2tCTV7IHKSGxM6SaLoOXQWWUiLUItMw==} dependencies: undici-types: 5.26.5 dev: false @@ -4825,7 +4823,7 @@ packages: resolution: {integrity: sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==} dependencies: undici-types: 6.19.8 - dev: true + dev: false /@types/parse5@6.0.3: resolution: {integrity: sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==} @@ -4846,7 +4844,7 @@ packages: /@types/pg@8.6.1: resolution: {integrity: sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==} dependencies: - '@types/node': 20.14.14 + '@types/node': 20.16.5 pg-protocol: 1.6.1 pg-types: 2.2.0 dev: false @@ -4897,14 +4895,14 @@ packages: resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==} dependencies: '@types/mime': 1.3.5 - '@types/node': 20.14.14 + '@types/node': 20.16.5 dev: false /@types/serve-static@1.15.7: resolution: {integrity: sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==} dependencies: '@types/http-errors': 2.0.4 - '@types/node': 20.14.14 + '@types/node': 20.16.5 '@types/send': 0.17.4 dev: false @@ -4921,7 +4919,7 @@ packages: /@types/through@0.0.33: resolution: {integrity: sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ==} dependencies: - '@types/node': 22.5.5 + '@types/node': 20.16.5 dev: true /@types/triple-beam@1.3.5: @@ -4954,7 +4952,7 @@ packages: resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} requiresBuild: true dependencies: - '@types/node': 22.5.5 + '@types/node': 20.16.5 dev: true optional: true @@ -7398,7 +7396,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.17 - '@types/node': 22.5.5 + '@types/node': 20.16.5 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -11321,6 +11319,13 @@ packages: '@types/node': 20.16.5 dev: false + /msecs@1.0.4: + resolution: {integrity: sha512-FQfJdMEIuky0eR3nOA0BedlqLzBQ/tyYKlxVJTLv3e2Mxsk8xIFki+JblROmjGtTXX/cxP7xNN92KdFY/QTFIg==} + engines: {node: '>=16'} + dependencies: + '@types/node': 22.5.5 + dev: false + /mute-stream@1.0.0: resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -12314,7 +12319,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 20.14.14 + '@types/node': 20.16.5 long: 5.2.3 dev: false @@ -12964,29 +12969,29 @@ packages: glob: 10.4.5 dev: true - /rollup@4.19.2: - resolution: {integrity: sha512-6/jgnN1svF9PjNYJ4ya3l+cqutg49vOZ4rVgsDKxdl+5gpGPnByFXWGyfH9YGx9i3nfBwSu1Iyu6vGwFFA0BdQ==} + /rollup@4.24.0: + resolution: {integrity: sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.19.2 - '@rollup/rollup-android-arm64': 4.19.2 - '@rollup/rollup-darwin-arm64': 4.19.2 - '@rollup/rollup-darwin-x64': 4.19.2 - '@rollup/rollup-linux-arm-gnueabihf': 4.19.2 - '@rollup/rollup-linux-arm-musleabihf': 4.19.2 - '@rollup/rollup-linux-arm64-gnu': 4.19.2 - '@rollup/rollup-linux-arm64-musl': 4.19.2 - '@rollup/rollup-linux-powerpc64le-gnu': 4.19.2 - '@rollup/rollup-linux-riscv64-gnu': 4.19.2 - '@rollup/rollup-linux-s390x-gnu': 4.19.2 - '@rollup/rollup-linux-x64-gnu': 4.19.2 - '@rollup/rollup-linux-x64-musl': 4.19.2 - '@rollup/rollup-win32-arm64-msvc': 4.19.2 - '@rollup/rollup-win32-ia32-msvc': 4.19.2 - '@rollup/rollup-win32-x64-msvc': 4.19.2 + '@rollup/rollup-android-arm-eabi': 4.24.0 + '@rollup/rollup-android-arm64': 4.24.0 + '@rollup/rollup-darwin-arm64': 4.24.0 + '@rollup/rollup-darwin-x64': 4.24.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.24.0 + '@rollup/rollup-linux-arm-musleabihf': 4.24.0 + '@rollup/rollup-linux-arm64-gnu': 4.24.0 + '@rollup/rollup-linux-arm64-musl': 4.24.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.24.0 + '@rollup/rollup-linux-riscv64-gnu': 4.24.0 + '@rollup/rollup-linux-s390x-gnu': 4.24.0 + '@rollup/rollup-linux-x64-gnu': 4.24.0 + '@rollup/rollup-linux-x64-musl': 4.24.0 + '@rollup/rollup-win32-arm64-msvc': 4.24.0 + '@rollup/rollup-win32-ia32-msvc': 4.24.0 + '@rollup/rollup-win32-x64-msvc': 4.24.0 fsevents: 2.3.3 dev: true @@ -13621,6 +13626,7 @@ packages: dependencies: pdfkit: 0.15.0 dev: false + bundledDependencies: false /swr@2.2.6-beta.4(react@18.3.1): resolution: {integrity: sha512-4lL96uZuTiggpWt9pv2Csdn7XWQ71BQR0ycGI1L6V9eUpfgsbP+A3Fzqu9o42ICNf6aBe7o/CYa76ff/ybWtMA==} @@ -13894,6 +13900,11 @@ packages: resolution: {integrity: sha512-ZiBujro2ohr5+Z/hZWHESLz3g08BBdrdLMieYFULJO+tWc437sn8kQsWLJoZErY8alNhxre9K4p3GURAG11n+w==} engines: {node: '>=16'} + /type-fest@4.26.1: + resolution: {integrity: sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==} + engines: {node: '>=16'} + dev: false + /type-is@1.6.18: resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} engines: {node: '>= 0.6'} @@ -13952,8 +13963,8 @@ packages: hasBin: true dev: true - /typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} + /typescript@5.6.2: + resolution: {integrity: sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==} engines: {node: '>=14.17'} hasBin: true dev: true diff --git a/scripts/initialize.js b/scripts/initialize.js deleted file mode 100755 index e85e8fc4..00000000 --- a/scripts/initialize.js +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env node - -const cp = require('child_process') -const path = require('path') - -const options = { shell: true, stdio: 'inherit' } - -cp.execFileSync( - 'pnpm', - [ - '--package', - '@skiffa/generator@0.11.1', - 'dlx', - 'skiffa-generator', - 'package', - path.resolve('specifications', 'api.yaml'), - '--package-directory', - path.resolve('generated', 'api'), - '--package-name', - '@nawadi/api', - '--package-version', - '0.0.0', - ], - options, -) - -cp.execFileSync('pnpm', ['--filter', '@nawadi/api', 'install'], options) -cp.execFileSync('pnpm', ['--filter', '@nawadi/api', 'build'], options) - -cp.execFileSync( - 'pnpm', - [ - '--package', - '@redocly/cli@1.11.0', - 'dlx', - 'redocly', - 'build-docs', - path.resolve('specifications', 'api.yaml'), - '--output', - path.resolve('generated', 'api-docs', 'index.html'), - ], - options, -) diff --git a/scripts/initialize.mjs b/scripts/initialize.mjs new file mode 100755 index 00000000..0e73c809 --- /dev/null +++ b/scripts/initialize.mjs @@ -0,0 +1,36 @@ +#!/usr/bin/env node + +import cp from 'child_process' +import path from 'path' + +const options = { shell: true, stdio: 'inherit' } + +cp.execFileSync( + process.env.npm_execpath, + [ + '--package', + '@skiffa/generator@0.13.20', + 'dlx', + 'skiffa-generator', + 'package', + path.resolve('specifications', 'api.yaml'), + '--package-directory', + path.resolve('generated', 'api'), + '--package-name', + '@nawadi/api', + '--package-version', + '0.0.0', + ], + options, +) + +cp.execFileSync( + process.env.npm_execpath, + ['--filter', '@nawadi/api', 'install'], + options, +) +cp.execFileSync( + process.env.npm_execpath, + ['--filter', '@nawadi/api', 'build'], + options, +)