diff --git a/.github/workflows/lint_test_build.yml b/.github/workflows/lint_test_build.yml index cdf00b2a0a..ea564166d4 100644 --- a/.github/workflows/lint_test_build.yml +++ b/.github/workflows/lint_test_build.yml @@ -26,6 +26,7 @@ jobs: - uses: actions/checkout@v2 - uses: ./.github/workflows/rafiki/env-setup - run: pnpm --filter backend build:deps + - run: pnpm --filter backend fetch-schemas - run: pnpm --filter backend test frontend: @@ -53,7 +54,7 @@ jobs: echo "{\"extends\":[\"spectral:oas\",\"spectral:asyncapi\"]}" >> .spectral.json - name: Validate Open API specs run: | - npx @stoplight/spectral-cli lint ./packages/auth/openapi/id-provider.yaml ./packages/auth/openapi/resource-server.yaml + npx @stoplight/spectral-cli lint ./packages/auth/openapi/*.yaml openapi: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 8afa0838b8..7a2f663b5e 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,13 @@ pnpm clean # install dependencies pnpm i +# pull in latest openapi specs: +pnpm fetch-schemas +``` + +### Local Development + +```sh # build all the packages in the repo: pnpm -r build # build specific package (backend): @@ -81,9 +88,6 @@ pnpm --filter open-api test # run all tests pnpm -r --workspace-concurrency=1 test -# pull in latest openapi specs for auth server: -pnpm --filter auth fetch-schemas - # format and lint code: pnpm format @@ -97,29 +101,5 @@ pnpm check:format pnpm check:lint ``` -### Local Development - The [infrastructure/local](infrastructure/local) directory contains resources for setting up Rafiki in common configurations. - -```sh -# set up two instances of Rafiki -pnpm localenv up -d - -# seed the postgres databases with the auth data creating an admin token -pnpm localenv:seed:auth - -# tear down -pnpm localenv down - -# delete database volumes (containers must be removed first with e.g. pnpm localenv down) -pnpm localenv:dbvolumes:remove -``` - -The local environment consists of a primary Rafiki instance and a secondary Rafiki instance, each with -its own docker compose files ([primary](infrastructure/local/docker-compose.yml), [secondary](infrastructure/local/peer-docker-compose.yml)). -The primary `docker-compose.yml` includes the main Rafiki services `backend`, `auth`, and `rates`, as well -as the required data stores tigerbeetle, redis, and postgres, so it can be run on its own. -The `peer-docker-compose.yml` includes only the Rafiki services, not the data stores. It uses the -data stores created by the primary Rafiki instance so it can't be run by itself. -The `pnpm run localenv` command starts both the primary instance and the secondary. diff --git a/infrastructure/local/README.md b/infrastructure/local/README.md index d3267f4596..72dda3594e 100644 --- a/infrastructure/local/README.md +++ b/infrastructure/local/README.md @@ -5,6 +5,7 @@ admin GraphQL. Prerequisites: +- [Rafiki local environment setup](../../README.md#environment-setup) - [docker](https://docs.docker.com/get-docker/) - [compose plugin](https://docs.docker.com/compose/install/compose-plugin/) - [postman](https://www.postman.com/downloads/) @@ -21,8 +22,22 @@ pnpm localenv up -d --build // Seed auth tokens pnpm localenv:seed:auth + +// tear down +pnpm localenv down + +// delete database volumes (containers must be removed first with e.g. pnpm localenv down) +pnpm localenv:dbvolumes:remove ``` +The local environment consists of a primary Rafiki instance and a secondary Rafiki instance, each with +its own docker compose files ([primary](./docker-compose.yml), [secondary](./peer-docker-compose.yml)). +The primary `docker-compose.yml` includes the main Rafiki services `backend`, `auth`, and `rates`, as well +as the required data stores tigerbeetle, redis, and postgres, so it can be run on its own. +The `peer-docker-compose.yml` includes only the Rafiki services, not the data stores. It uses the +data stores created by the primary Rafiki instance so it can't be run by itself. +The `pnpm run localenv` command starts both the primary instance and the secondary. + ## P2P payment This will demonstrate a P2P payment from Grace Franklin (Fynbos account) to Philip Fry (local bank account) using diff --git a/package.json b/package.json index 07b0b7e635..9237946eba 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "check:prettier": "prettier --check .", "clean": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +", "build": "tsc --build", + "fetch-schemas": "pnpm --filter auth --filter backend fetch-schemas", "localenv": "docker compose -f ./infrastructure/local/docker-compose.yml -f ./infrastructure/local/peer-docker-compose.yml", "localenv:build": "docker compose -f ./infrastructure/local/docker-compose.yml -f ./infrastructure/local/peer-docker-compose.yml -f ./infrastructure/local/build-override.yml build", "localenv:seed:auth": "pnpm -C ./packages/auth knex seed:run --env=development && pnpm -C ./packages/auth knex seed:run --env=peerdevelopment", diff --git a/packages/auth/scripts/get-op-schema.sh b/packages/auth/scripts/get-op-schema.sh index 3e9938578d..882944dca1 100755 --- a/packages/auth/scripts/get-op-schema.sh +++ b/packages/auth/scripts/get-op-schema.sh @@ -9,5 +9,5 @@ while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli done OUTDIR=$( cd -P "$( dirname "$SOURCE" )/../src/openapi" >/dev/null 2>&1 && pwd ) -curl -o "$OUTDIR/schemas.yaml" https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml -curl -o "$OUTDIR/auth-server.yaml" https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/auth-server.yaml +curl -o "$OUTDIR/schemas.yaml" https://raw.githubusercontent.com/interledger/open-payments/ae0e924a56fe9f12834f65da109a1042760c1605/openapi/schemas.yaml +curl -o "$OUTDIR/auth-server.yaml" https://raw.githubusercontent.com/interledger/open-payments/ae0e924a56fe9f12834f65da109a1042760c1605/openapi/auth-server.yaml diff --git a/packages/auth/src/accessToken/routes.test.ts b/packages/auth/src/accessToken/routes.test.ts index eac38c86a2..7cfe504ffb 100644 --- a/packages/auth/src/accessToken/routes.test.ts +++ b/packages/auth/src/accessToken/routes.test.ts @@ -110,7 +110,7 @@ describe('Access Token Routes', (): void => { }) const openApi = await deps.use('openApi') - jestOpenAPI(openApi.resourceServerSpec) + jestOpenAPI(openApi.tokenIntrospectionSpec) }) test('Cannot introspect fake token', async (): Promise => { const ctx = createContext( diff --git a/packages/auth/src/app.ts b/packages/auth/src/app.ts index b40665dd82..85615112b1 100644 --- a/packages/auth/src/app.ts +++ b/packages/auth/src/app.ts @@ -248,7 +248,7 @@ export class App { // Token Introspection this.publicRouter.post( '/introspect', - createValidatorMiddleware(openApi.resourceServerSpec, { + createValidatorMiddleware(openApi.tokenIntrospectionSpec, { path: '/introspect', method: HttpMethod.POST }), diff --git a/packages/auth/src/index.ts b/packages/auth/src/index.ts index f1869bc0f7..78dfeca29a 100644 --- a/packages/auth/src/index.ts +++ b/packages/auth/src/index.ts @@ -111,20 +111,28 @@ export function initIocContainer( }) }) - container.singleton('openApi', async () => { - const authServerSpec = await createOpenAPI( - path.resolve(__dirname, './openapi/auth-server.yaml') - ) - const resourceServerSpec = await createOpenAPI( - path.resolve(__dirname, './openapi/resource-server.yaml') - ) - const idpSpec = await createOpenAPI( - path.resolve(__dirname, './openapi/id-provider.yaml') - ) - return { - authServerSpec, - resourceServerSpec, - idpSpec + container.singleton('openApi', async (deps: IocContract) => { + try { + const authServerSpec = await createOpenAPI( + path.resolve(__dirname, './openapi/auth-server.yaml') + ) + const idpSpec = await createOpenAPI( + path.resolve(__dirname, './openapi/id-provider.yaml') + ) + const tokenIntrospectionSpec = await createOpenAPI( + path.resolve(__dirname, './openapi/token-introspection.yaml') + ) + return { + authServerSpec, + idpSpec, + tokenIntrospectionSpec + } + } catch (err) { + const logger = await deps.use('logger') + logger.error({ err }, 'error while loading OpenAPI files') + throw new Error( + 'Could not load OpenAPI files. Did you run `pnpm fetch-schemas`?' + ) } }) diff --git a/packages/auth/src/openapi/resource-server.yaml b/packages/auth/src/openapi/token-introspection.yaml similarity index 100% rename from packages/auth/src/openapi/resource-server.yaml rename to packages/auth/src/openapi/token-introspection.yaml diff --git a/packages/backend/.gitignore b/packages/backend/.gitignore index bc01b5f4e6..0b14808cad 100644 --- a/packages/backend/.gitignore +++ b/packages/backend/.gitignore @@ -4,3 +4,5 @@ build .env src/coverage tmp +/src/openapi/resource-server.yaml +/src/openapi/schemas.yaml diff --git a/packages/backend/package.json b/packages/backend/package.json index dffb0542a5..7c4a42d4fa 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -8,6 +8,7 @@ "build": "pnpm build:deps && tsc --build tsconfig.json && pnpm copy-files", "clean": "rm -fr dist/", "copy-files": "cp src/graphql/schema.graphql dist/graphql/", + "fetch-schemas": "./scripts/get-op-schema.sh", "prepack": "pnpm build" }, "devDependencies": { diff --git a/packages/backend/scripts/get-op-schema.sh b/packages/backend/scripts/get-op-schema.sh new file mode 100755 index 0000000000..06cd80ace6 --- /dev/null +++ b/packages/backend/scripts/get-op-schema.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +## https://stackoverflow.com/questions/59895/how-do-i-get-the-directory-where-a-bash-script-is-located-from-within-the-script +SOURCE=${BASH_SOURCE[0]} +while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) + SOURCE=$(readlink "$SOURCE") + [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +OUTDIR=$( cd -P "$( dirname "$SOURCE" )/../src/openapi" >/dev/null 2>&1 && pwd ) + +curl -o "$OUTDIR/resource-server.yaml" https://raw.githubusercontent.com/interledger/open-payments/ae0e924a56fe9f12834f65da109a1042760c1605/openapi/resource-server.yaml +curl -o "$OUTDIR/schemas.yaml" https://raw.githubusercontent.com/interledger/open-payments/ae0e924a56fe9f12834f65da109a1042760c1605/openapi/schemas.yaml diff --git a/packages/backend/src/app.ts b/packages/backend/src/app.ts index 0dd564e7b8..1942be9ac1 100644 --- a/packages/backend/src/app.ts +++ b/packages/backend/src/app.ts @@ -257,7 +257,7 @@ export class App { ) const quoteRoutes = await this.container.use('quoteRoutes') const connectionRoutes = await this.container.use('connectionRoutes') - const openApi = await this.container.use('openApi') + const { resourceServerSpec } = await this.container.use('openApi') const toRouterPath = (path: string): string => path.replace(/{/g, ':').replace(/}/g, '') @@ -291,8 +291,8 @@ export class App { [AccessAction.ListAll]: 'list' } - for (const path in openApi.paths) { - for (const method in openApi.paths[path]) { + for (const path in resourceServerSpec.paths) { + for (const method in resourceServerSpec.paths[path]) { if (isHttpMethod(method)) { const action = toAction({ path, method }) assert.ok(action) @@ -313,10 +313,13 @@ export class App { route = connectionRoutes.get router[method]( toRouterPath(path), - createValidatorMiddleware>(openApi, { - path, - method - }), + createValidatorMiddleware>( + resourceServerSpec, + { + path, + method + } + ), route ) } else if (path !== '/' || method !== HttpMethod.GET) { @@ -328,10 +331,13 @@ export class App { router[method]( PAYMENT_POINTER_PATH + toRouterPath(path), createPaymentPointerMiddleware(), - createValidatorMiddleware>(openApi, { - path, - method - }), + createValidatorMiddleware>( + resourceServerSpec, + { + path, + method + } + ), createAuthMiddleware({ type, action @@ -347,7 +353,7 @@ export class App { router.get( PAYMENT_POINTER_PATH + '/jwks.json', createPaymentPointerMiddleware(), - createValidatorMiddleware(openApi, { + createValidatorMiddleware(resourceServerSpec, { path: '/jwks.json', method: HttpMethod.GET }), @@ -362,7 +368,7 @@ export class App { router.get( PAYMENT_POINTER_PATH, createPaymentPointerMiddleware(), - createValidatorMiddleware(openApi, { + createValidatorMiddleware(resourceServerSpec, { path: '/', method: HttpMethod.GET }), diff --git a/packages/backend/src/config/app.ts b/packages/backend/src/config/app.ts index a912c6dbd9..3aaafe4258 100644 --- a/packages/backend/src/config/app.ts +++ b/packages/backend/src/config/app.ts @@ -109,14 +109,6 @@ export const Config = { signatureVersion: envInt('SIGNATURE_VERSION', 1), bypassSignatureValidation: envBool('BYPASS_SIGNATURE_VALIDATION', false), - openPaymentsSpec: envString( - 'OPEN_PAYMENTS_SPEC', - 'https://raw.githubusercontent.com/interledger/open-payments/f365dbec4b9dec98b9f622bc49a92aea9ee01568/openapi/RS/openapi.yaml' - ), - authServerSpec: envString( - 'AUTH_SERVER_SPEC', - 'https://raw.githubusercontent.com/interledger/open-payments/77462cd0872be8d0fa487a4b233defe2897a7ee4/auth-server-open-api-spec.yaml' - ), keyId: envString('KEY_ID', 'rafiki'), privateKey: parseOrProvisionKey(envString('PRIVATE_KEY_FILE', undefined)), diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index dc363dea87..ffaa5f7c42 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -1,5 +1,6 @@ import { EventEmitter } from 'events' import { Server } from 'http' +import path from 'path' import createLogger from 'pino' import { knex } from 'knex' import { Model } from 'objection' @@ -108,13 +109,25 @@ export function initIocContainer( replica_addresses: config.tigerbeetleReplicaAddresses }) }) - container.singleton('openApi', async (deps) => { - const config = await deps.use('config') - return await createOpenAPI(config.openPaymentsSpec) - }) - container.singleton('authOpenApi', async (deps) => { - const config = await deps.use('config') - return await createOpenAPI(config.authServerSpec) + container.singleton('openApi', async (deps: IocContract) => { + try { + const tokenIntrospectionSpec = await createOpenAPI( + path.resolve(__dirname, './openapi/token-introspection.yaml') + ) + const resourceServerSpec = await createOpenAPI( + path.resolve(__dirname, './openapi/resource-server.yaml') + ) + return { + resourceServerSpec, + tokenIntrospectionSpec + } + } catch (err) { + const logger = await deps.use('logger') + logger.error({ err }, 'error while loading OpenAPI files') + throw new Error( + 'Could not load OpenAPI files. Did you run `pnpm fetch-schemas`?' + ) + } }) container.singleton('openPaymentsClient', async (deps) => { const config = await deps.use('config') @@ -169,10 +182,11 @@ export function initIocContainer( }) container.singleton('authService', async (deps) => { const config = await deps.use('config') + const { tokenIntrospectionSpec } = await deps.use('openApi') return await createAuthService({ logger: await deps.use('logger'), authServerIntrospectionUrl: config.authServerIntrospectionUrl, - authOpenApi: await deps.use('authOpenApi') + tokenIntrospectionSpec }) }) container.singleton('paymentPointerService', async (deps) => { diff --git a/packages/backend/src/open_payments/auth/middleware.test.ts b/packages/backend/src/open_payments/auth/middleware.test.ts index a4dc9a1447..390a0bb635 100644 --- a/packages/backend/src/open_payments/auth/middleware.test.ts +++ b/packages/backend/src/open_payments/auth/middleware.test.ts @@ -123,9 +123,9 @@ describe('Auth Middleware', (): void => { type: AccessType.IncomingPayment, action: AccessAction.Read }) - const authOpenApi = await deps.use('authOpenApi') + const { tokenIntrospectionSpec } = await deps.use('openApi') requestPath = '/introspect' - validateRequest = authOpenApi.createRequestValidator({ + validateRequest = tokenIntrospectionSpec.createRequestValidator({ path: requestPath, method: HttpMethod.POST }) diff --git a/packages/backend/src/open_payments/auth/service.ts b/packages/backend/src/open_payments/auth/service.ts index 21f90eaed1..ed8ee8d4ff 100644 --- a/packages/backend/src/open_payments/auth/service.ts +++ b/packages/backend/src/open_payments/auth/service.ts @@ -38,7 +38,7 @@ export interface AuthService { interface ServiceDependencies { authServerIntrospectionUrl: string - authOpenApi: OpenAPI + tokenIntrospectionSpec: OpenAPI logger: Logger validateResponse: ResponseValidator } @@ -50,7 +50,7 @@ export async function createAuthService( service: 'AuthService' }) const validateResponse = - deps_.authOpenApi.createResponseValidator({ + deps_.tokenIntrospectionSpec.createResponseValidator({ path: '/introspect', method: HttpMethod.POST }) diff --git a/packages/backend/src/open_payments/connection/routes.test.ts b/packages/backend/src/open_payments/connection/routes.test.ts index 7e88ad4ece..0b1084ee3a 100644 --- a/packages/backend/src/open_payments/connection/routes.test.ts +++ b/packages/backend/src/open_payments/connection/routes.test.ts @@ -32,7 +32,8 @@ describe('Connection Routes', (): void => { deps = await initIocContainer(config) appContainer = await createTestApp(deps) knex = await deps.use('knex') - jestOpenAPI(await deps.use('openApi')) + const { resourceServerSpec } = await deps.use('openApi') + jestOpenAPI(resourceServerSpec) }) const asset = { diff --git a/packages/backend/src/open_payments/payment/incoming/routes.test.ts b/packages/backend/src/open_payments/payment/incoming/routes.test.ts index 0ae0b1ab68..0df45d30fa 100644 --- a/packages/backend/src/open_payments/payment/incoming/routes.test.ts +++ b/packages/backend/src/open_payments/payment/incoming/routes.test.ts @@ -34,7 +34,8 @@ describe('Incoming Payment Routes', (): void => { deps = await initIocContainer(config) appContainer = await createTestApp(deps) knex = await deps.use('knex') - jestOpenAPI(await deps.use('openApi')) + const { resourceServerSpec } = await deps.use('openApi') + jestOpenAPI(resourceServerSpec) }) const asset = { diff --git a/packages/backend/src/open_payments/payment/outgoing/routes.test.ts b/packages/backend/src/open_payments/payment/outgoing/routes.test.ts index f17d274fb9..a38c86c3a9 100644 --- a/packages/backend/src/open_payments/payment/outgoing/routes.test.ts +++ b/packages/backend/src/open_payments/payment/outgoing/routes.test.ts @@ -61,7 +61,8 @@ describe('Outgoing Payment Routes', (): void => { config = await deps.use('config') outgoingPaymentRoutes = await deps.use('outgoingPaymentRoutes') outgoingPaymentService = await deps.use('outgoingPaymentService') - jestOpenAPI(await deps.use('openApi')) + const { resourceServerSpec } = await deps.use('openApi') + jestOpenAPI(resourceServerSpec) }) beforeEach(async (): Promise => { diff --git a/packages/backend/src/open_payments/payment_pointer/routes.test.ts b/packages/backend/src/open_payments/payment_pointer/routes.test.ts index 4a28d608fb..78c6e24d83 100644 --- a/packages/backend/src/open_payments/payment_pointer/routes.test.ts +++ b/packages/backend/src/open_payments/payment_pointer/routes.test.ts @@ -25,7 +25,8 @@ describe('Payment Pointer Routes', (): void => { deps = await initIocContainer(config) appContainer = await createTestApp(deps) knex = await deps.use('knex') - jestOpenAPI(await deps.use('openApi')) + const { resourceServerSpec } = await deps.use('openApi') + jestOpenAPI(resourceServerSpec) }) beforeEach(async (): Promise => { diff --git a/packages/backend/src/open_payments/quote/routes.test.ts b/packages/backend/src/open_payments/quote/routes.test.ts index aaf85b6e54..9f2eb3d87f 100644 --- a/packages/backend/src/open_payments/quote/routes.test.ts +++ b/packages/backend/src/open_payments/quote/routes.test.ts @@ -67,7 +67,8 @@ describe('Quote Routes', (): void => { config = await deps.use('config') quoteRoutes = await deps.use('quoteRoutes') quoteService = await deps.use('quoteService') - jestOpenAPI(await deps.use('openApi')) + const { resourceServerSpec } = await deps.use('openApi') + jestOpenAPI(resourceServerSpec) }) beforeEach(async (): Promise => { diff --git a/packages/backend/src/openapi/token-introspection.yaml b/packages/backend/src/openapi/token-introspection.yaml new file mode 120000 index 0000000000..6f7f54c1a2 --- /dev/null +++ b/packages/backend/src/openapi/token-introspection.yaml @@ -0,0 +1 @@ +../../../auth/src/openapi/token-introspection.yaml \ No newline at end of file diff --git a/packages/backend/src/paymentPointerKey/routes.test.ts b/packages/backend/src/paymentPointerKey/routes.test.ts index 6d57bce0fb..b940899472 100644 --- a/packages/backend/src/paymentPointerKey/routes.test.ts +++ b/packages/backend/src/paymentPointerKey/routes.test.ts @@ -38,7 +38,8 @@ describe('Payment Pointer Keys Routes', (): void => { deps.bind('messageProducer', async () => mockMessageProducer) appContainer = await createTestApp(deps) knex = await deps.use('knex') - jestOpenAPI(await deps.use('openApi')) + const { resourceServerSpec } = await deps.use('openApi') + jestOpenAPI(resourceServerSpec) paymentPointerKeyService = await deps.use('paymentPointerKeyService') }) diff --git a/packages/open-payments/src/config.ts b/packages/open-payments/src/config.ts index 3de5d5736b..576a8d9b60 100644 --- a/packages/open-payments/src/config.ts +++ b/packages/open-payments/src/config.ts @@ -1,7 +1,7 @@ export default { OPEN_PAYMENTS_RS_OPEN_API_URL: - 'https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/resource-server.yaml', + 'https://raw.githubusercontent.com/interledger/open-payments/ae0e924a56fe9f12834f65da109a1042760c1605/openapi/resource-server.yaml', OPEN_PAYMENTS_AS_OPEN_API_URL: - 'https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/auth-server.yaml', + 'https://raw.githubusercontent.com/interledger/open-payments/ae0e924a56fe9f12834f65da109a1042760c1605/openapi/auth-server.yaml', DEFAULT_REQUEST_TIMEOUT_MS: 5_000 } diff --git a/packages/open-payments/src/generated/auth-server-types.ts b/packages/open-payments/src/generated/auth-server-types.ts index f9c05e6218..954b7dbf29 100644 --- a/packages/open-payments/src/generated/auth-server-types.ts +++ b/packages/open-payments/src/generated/auth-server-types.ts @@ -107,7 +107,7 @@ export interface components { manage: string; /** @description The number of seconds in which the access will expire. The client instance MUST NOT use the access token past this time. An RS MUST NOT accept an access token past this time. */ expires_in?: number; - access: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["access"]; + access: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["access"]; }; }; } @@ -138,7 +138,7 @@ export interface operations { content: { "application/json": { access_token: { - access: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["access"]; + access: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["access"]; }; client: components["schemas"]["client"]; interact?: components["schemas"]["interact-request"]; @@ -235,17 +235,17 @@ export interface operations { } export interface external { - "https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml": { + "https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml": { paths: {}; components: { schemas: { /** @description A description of the rights associated with this access token. */ - access: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["access-item"][]; + access: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["access-item"][]; /** @description The access associated with the access token is described using objects that each contain multiple dimensions of access. */ "access-item": - | external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["access-incoming"] - | external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["access-outgoing"] - | external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["access-quote"]; + | external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["access-incoming"] + | external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["access-outgoing"] + | external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["access-quote"]; /** access-incoming */ "access-incoming": { /** @description The type of resource request as a string. This field defines which other fields are allowed in the request object. */ @@ -276,7 +276,7 @@ export interface external { * @description A string identifier indicating a specific resource at the RS. */ identifier: string; - limits?: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["limits-outgoing"]; + limits?: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["limits-outgoing"]; }; /** access-quote */ "access-quote": { @@ -295,8 +295,8 @@ export interface external { * @description The value is an unsigned 64-bit integer amount, represented as a string. */ value: string; - assetCode: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["assetCode"]; - assetScale: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["assetScale"]; + assetCode: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["assetCode"]; + assetScale: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["assetScale"]; }; /** * Asset code @@ -318,10 +318,10 @@ export interface external { * @description Open Payments specific property that defines the limits under which outgoing payments can be created. */ "limits-outgoing": Partial & { - receiver?: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["receiver"]; - sendAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; - receiveAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; - interval?: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["interval"]; + receiver?: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["receiver"]; + sendAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; + receiveAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; + interval?: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["interval"]; }; "list-actions": "list" | "list-all"; "read-actions": "read" | "read-all"; diff --git a/packages/open-payments/src/generated/resource-server-types.ts b/packages/open-payments/src/generated/resource-server-types.ts index 821760272a..2ce781ca55 100644 --- a/packages/open-payments/src/generated/resource-server-types.ts +++ b/packages/open-payments/src/generated/resource-server-types.ts @@ -113,13 +113,13 @@ export interface components { "payment-pointer": { /** * Format: uri - * @description The URL identifying the incoming payment. + * @description The URL identifying the payment pointer. */ id: string; /** @description A public name for the account. This should be set by the account holder with their provider to provide a hint to counterparties as to the identity of the account holder. */ publicName?: string; - assetCode: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["assetCode"]; - assetScale: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["assetScale"]; + assetCode: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["assetCode"]; + assetScale: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["assetScale"]; /** * Format: uri * @description The URL of the authorization server endpoint for getting grants and access tokens for this payment pointer. @@ -147,8 +147,8 @@ export interface components { ilpAddress: string; /** @description The base64 url-encoded shared secret to use when establishing a STREAM connection. */ sharedSecret: string; - assetCode: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["assetCode"]; - assetScale: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["assetScale"]; + assetCode: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["assetCode"]; + assetScale: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["assetScale"]; }; /** * Incoming Payment @@ -168,9 +168,9 @@ export interface components { /** @description Describes whether the incoming payment has completed receiving fund. */ completed: boolean; /** @description The maximum amount that should be paid into the payment pointer under this incoming payment. */ - incomingAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; + incomingAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; /** @description The total amount that has been paid into the payment pointer under this incoming payment. */ - receivedAmount: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; + receivedAmount: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; /** * Format: date-time * @description The date and time when payments under this incoming payment will no longer be accepted. @@ -232,13 +232,13 @@ export interface components { /** @description Describes whether the payment failed to send its full amount. */ failed?: boolean; /** @description The URL of the incoming payment or ILP STREAM Connection that is being paid. */ - receiver: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["receiver"]; + receiver: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["receiver"]; /** @description The total amount that should be received by the receiver when this outgoing payment has been paid. */ - receiveAmount: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; + receiveAmount: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; /** @description The total amount that should be sent when this outgoing payment has been paid. */ - sendAmount: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; + sendAmount: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; /** @description The total amount that has been sent under this outgoing payment. */ - sentAmount: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; + sentAmount: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; /** @description Human readable description of the outgoing payment that will be visible to the account holder and shared with the receiver. */ description?: string; /** @description A reference that can be used by external systems to reconcile this payment with their systems. E.g. An invoice number. (Optional) */ @@ -269,9 +269,9 @@ export interface components { * @description The URL of the payment pointer from which this quote's payment would be sent. */ paymentPointer: string; - receiver: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["receiver"]; - receiveAmount: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; - sendAmount: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; + receiver: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["receiver"]; + receiveAmount: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; + sendAmount: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; /** @description The date and time when the calculated `sendAmount` is no longer valid. */ expiresAt?: string; /** @@ -460,7 +460,7 @@ export interface operations { content: { "application/json": { /** @description The maximum amount that should be paid into the payment pointer under this incoming payment. */ - incomingAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; + incomingAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; /** * Format: date-time * @description The date and time when payments into the incoming payment must no longer be accepted. @@ -573,9 +573,9 @@ export interface operations { requestBody: { content: { "application/json": { - receiver: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["receiver"]; - receiveAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; - sendAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; + receiver: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["receiver"]; + receiveAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; + sendAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; }; }; }; @@ -695,17 +695,17 @@ export interface operations { } export interface external { - "https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml": { + "https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml": { paths: {}; components: { schemas: { /** @description A description of the rights associated with this access token. */ - access: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["access-item"][]; + access: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["access-item"][]; /** @description The access associated with the access token is described using objects that each contain multiple dimensions of access. */ "access-item": - | external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["access-incoming"] - | external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["access-outgoing"] - | external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["access-quote"]; + | external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["access-incoming"] + | external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["access-outgoing"] + | external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["access-quote"]; /** access-incoming */ "access-incoming": { /** @description The type of resource request as a string. This field defines which other fields are allowed in the request object. */ @@ -736,7 +736,7 @@ export interface external { * @description A string identifier indicating a specific resource at the RS. */ identifier: string; - limits?: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["limits-outgoing"]; + limits?: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["limits-outgoing"]; }; /** access-quote */ "access-quote": { @@ -755,8 +755,8 @@ export interface external { * @description The value is an unsigned 64-bit integer amount, represented as a string. */ value: string; - assetCode: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["assetCode"]; - assetScale: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["assetScale"]; + assetCode: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["assetCode"]; + assetScale: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["assetScale"]; }; /** * Asset code @@ -778,10 +778,10 @@ export interface external { * @description Open Payments specific property that defines the limits under which outgoing payments can be created. */ "limits-outgoing": Partial & { - receiver?: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["receiver"]; - sendAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; - receiveAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; - interval?: external["https://raw.githubusercontent.com/interledger/open-payments/b363d33038fe789e5388f04f80ddd06a4fa97093/openapi/schemas.yaml"]["components"]["schemas"]["interval"]; + receiver?: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["receiver"]; + sendAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; + receiveAmount?: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["amount"]; + interval?: external["https://raw.githubusercontent.com/interledger/open-payments/02a6d505d79124cce776054df89e28f02c8e5d59/openapi/schemas.yaml"]["components"]["schemas"]["interval"]; }; "list-actions": "list" | "list-all"; "read-actions": "read" | "read-all";