diff --git a/.changeset/moody-students-greet.md b/.changeset/moody-students-greet.md new file mode 100644 index 00000000..f2774d37 --- /dev/null +++ b/.changeset/moody-students-greet.md @@ -0,0 +1,5 @@ +--- +'@interledger/openapi': minor +--- + +Removed payment pointer/wallet address from resource urls diff --git a/README.md b/README.md index 5dc9b1e4..b0253a1c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
- +
--- diff --git a/openapi/resource-server.yaml b/openapi/resource-server.yaml index f053847d..c0ff4abc 100644 --- a/openapi/resource-server.yaml +++ b/openapi/resource-server.yaml @@ -32,16 +32,8 @@ info: contact: email: tech@interledger.org servers: - - url: '{walletAddress}' - description: 'Server for when Wallet Address has a pathname (ie https://openpayments.guide/alice)' - variables: - walletAddress: - default: https://openpayments.guide/alice - - url: '{walletAddress}/.well-known/pay' - description: 'Server for when Wallet Address has no pathname (ie https://openpayments.guide)' - variables: - walletAddress: - default: https://openpayments.guide + - url: '/' + description: 'Server for wallet address subresources or Connection resources (ie https://openpayments.guide/alice)' tags: - name: wallet-address description: wallet address operations @@ -119,7 +111,7 @@ paths: examples: New Incoming Payment for $25: value: - id: 'https://openpayments.guide/alice/incoming-payments/08394f02-7b7b-45e2-b645-51d04e7c330c' + id: 'https://openpayments.guide/incoming-payments/08394f02-7b7b-45e2-b645-51d04e7c330c' walletAddress: 'https://openpayments.guide/alice/' incomingAmount: value: '2500' @@ -216,7 +208,7 @@ paths: hasPreviousPage: false hasNextPage: true result: - - id: 'https://openpayments.guide/alice/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8' + - id: 'https://openpayments.guide/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8' walletAddress: 'https://openpayments.guide/alice/' incomingAmount: value: '250' @@ -226,14 +218,14 @@ paths: value: '250' assetCode: USD assetScale: 2 - expiresAt: '2022-04-12T23:20:50.52Z' - createdAt: '2022-03-12T23:20:50.52Z' - updatedAt: '2022-04-01T10:24:36.11Z' metadata: description: 'Hi Mo, this is for the cappuccino I bought for you the other day.' externalRef: Coffee w/ Mo on 10 March 22 + expiresAt: '2022-04-12T23:20:50.52Z' + createdAt: '2022-03-12T23:20:50.52Z' + updatedAt: '2022-04-01T10:24:36.11Z' completed: true - - id: 'https://openpayments.guide/alice/incoming-payments/32abc219-3dc3-44ec-a225-790cacfca8fa' + - id: 'https://openpayments.guide/incoming-payments/32abc219-3dc3-44ec-a225-790cacfca8fa' walletAddress: 'https://openpayments.guide/alice/' receivedAmount: value: '100' @@ -253,7 +245,7 @@ paths: hasPreviousPage: true hasNextPage: false result: - - id: 'https://openpayments.guide/alice/incoming-payments/32abc219-3dc3-44ec-a225-790cacfca8fa' + - id: 'https://openpayments.guide/incoming-payments/32abc219-3dc3-44ec-a225-790cacfca8fa' walletAddress: 'https://openpayments.guide/alice/' receivedAmount: value: '100' @@ -265,7 +257,7 @@ paths: updatedAt: '2022-04-01T10:24:36.11Z' metadata: description: 'I love your website, Alice! Thanks for the great content' - - id: 'https://openpayments.guide/alice/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8' + - id: 'https://openpayments.guide/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8' walletAddress: 'https://openpayments.guide/alice/' incomingAmount: value: '250' @@ -311,7 +303,7 @@ paths: examples: New Fixed Send Outgoing Payment for $25: value: - id: 'https://openpayments.guide/alice/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' + id: 'https://openpayments.guide/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' walletAddress: 'https://openpayments.guide/alice/' failed: false receiver: 'https://openpayments.guide/bob/incoming-payments/48884225-b393-4872-90de-1b737e2491c2' @@ -341,7 +333,7 @@ paths: examples: Create an outgoing payment based on a quote: value: - quoteId: 'https://openpayments.guide/alice/quotes/ab03296b-0c8b-4776-b94e-7ee27d868d4d' + quoteId: 'https://openpayments.guide/quotes/ab03296b-0c8b-4776-b94e-7ee27d868d4d' metadata: externalRef: INV2022-02-0137 schema: @@ -397,7 +389,7 @@ paths: hasPreviousPage: false hasNextPage: true result: - - id: 'https://openpayments.guide/alice/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' + - id: 'https://openpayments.guide/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' walletAddress: 'https://openpayments.guide/alice/' failed: false receiver: 'https://openpayments.guide/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e' @@ -418,7 +410,7 @@ paths: metadata: description: APlusVideo subscription externalRef: 'customer: 847458475' - - id: 'https://openpayments.guide/alice/outgoing-payments/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c' + - id: 'https://openpayments.guide/outgoing-payments/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c' walletAddress: 'https://openpayments.guide/alice/' failed: false receiver: 'https://openpayments.guide/shoeshop/incoming-payments/2fe92c6f-ef0d-487c-8759-3784eae6bce9' @@ -447,7 +439,7 @@ paths: hasPreviousPage: true hasNextPage: false result: - - id: 'https://openpayments.guide/alice/outgoing-payments/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c' + - id: 'https://openpayments.guide/outgoing-payments/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c' walletAddress: 'https://openpayments.guide/alice/' failed: false receiver: 'https://openpayments.guide/shoeshop/incoming-payments/2fe92c6f-ef0d-487c-8759-3784eae6bce9' @@ -468,7 +460,7 @@ paths: metadata: description: Thank you for your purchase at ShoeShop! externalRef: INV2022-8943756 - - id: 'https://openpayments.guide/alice/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' + - id: 'https://openpayments.guide/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' walletAddress: 'https://openpayments.guide/alice/' failed: false receiver: 'https://openpayments.guide/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e' @@ -518,7 +510,7 @@ paths: examples: New Fixed Send Quote for $25: value: - id: 'https://openpayments.guide/alice/quotes/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' + id: 'https://openpayments.guide/quotes/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' walletAddress: 'https://openpayments.guide/alice/' receiver: 'https://openpayments.guide/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e' debitAmount: @@ -550,7 +542,7 @@ paths: assetScale: 2 Create fixed-receive-amount quote for $25: value: - receiver: 'https://openpayments.guide/alice/incoming-payments/37a0d0ee-26dc-4c66-89e0-01fbf93156f7' + receiver: 'https://openpayments.guide/incoming-payments/37a0d0ee-26dc-4c66-89e0-01fbf93156f7' receiveAmount: value: '2500' assetCode: USD @@ -614,7 +606,7 @@ paths: examples: Incoming Payment for $25 with $12.34 received so far: value: - id: 'https://openpayments.guide/alice/incoming-payments/2f1b0150-db73-49e8-8713-628baa4a17ff' + id: 'https://openpayments.guide/incoming-payments/2f1b0150-db73-49e8-8713-628baa4a17ff' walletAddress: 'https://openpayments.guide/alice/' incomingAmount: value: '2500' @@ -664,7 +656,7 @@ paths: examples: Completed Incoming Payment: value: - id: 'https://openpayments.guide/alice/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8' + id: 'https://openpayments.guide/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8' walletAddress: 'https://openpayments.guide/alice/' incomingAmount: value: '250' @@ -715,7 +707,7 @@ paths: id: 'https://openpayments.guide/bob/outgoing-payments/3859b39e-4666-4ce5-8745-72f1864c5371' walletAddress: 'https://openpayments.guide/bob/' failed: false - receiver: 'https://openpayments.guide/alice/incoming-payments/2f1b0150-db73-49e8-8713-628baa4a17ff' + receiver: 'https://openpayments.guide/incoming-payments/2f1b0150-db73-49e8-8713-628baa4a17ff' debitAmount: value: '2500' assetCode: USD @@ -763,7 +755,7 @@ paths: value: id: 'https://openpayments.guide/bob/quotes/3859b39e-4666-4ce5-8745-72f1864c5371' walletAddress: 'https://openpayments.guide/bob/' - receiver: 'https://openpayments.guide/alice/incoming-payments/2f1b0150-db73-49e8-8713-628baa4a17ff' + receiver: 'https://openpayments.guide/incoming-payments/2f1b0150-db73-49e8-8713-628baa4a17ff' debitAmount: value: '2500' assetCode: USD @@ -849,7 +841,7 @@ components: description: 'An **incoming payment** resource represents a payment that will be, is currently being, or has been received by the account.' type: object examples: - - id: 'https://openpayments.guide/alice/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8' + - id: 'https://openpayments.guide/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8' walletAddress: 'https://openpayments.guide/alice/' incomingAmount: value: '250' @@ -866,7 +858,7 @@ components: metadata: description: 'Hi Mo, this is for the cappuccino I bought for you the other day.' externalRef: Coffee w/ Mo on 10 March 22 - - id: 'https://openpayments.guide/alice/incoming-payments/456da9d5-c9a4-4c80-a354-86b915a04ff8' + - id: 'https://openpayments.guide/incoming-payments/456da9d5-c9a4-4c80-a354-86b915a04ff8' walletAddress: 'https://openpayments.guide/alice/' incomingAmount: value: '2500' @@ -879,6 +871,7 @@ components: expiresAt: '2022-04-12T23:20:50.52Z' createdAt: '2022-03-12T23:20:50.52Z' updatedAt: '2022-03-12T23:20:50.52Z' + additionalProperties: false properties: id: type: string @@ -975,7 +968,7 @@ components: description: 'An **outgoing payment** resource represents a payment that will be, is currently being, or has previously been, sent from the wallet address.' type: object examples: - - id: 'https://openpayments.guide/alice/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' + - id: 'https://openpayments.guide/outgoing-payments/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' walletAddress: 'https://openpayments.guide/alice/' failed: false receiver: 'https://openpayments.guide/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e' @@ -996,7 +989,7 @@ components: metadata: description: APlusVideo subscription externalRef: 'customer: 847458475' - - id: 'https://openpayments.guide/alice/outgoing-payments/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c' + - id: 'https://openpayments.guide/outgoing-payments/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c' walletAddress: 'https://openpayments.guide/alice/' failed: false receiver: 'https://openpayments.guide/shoeshop/2fe92c6f-ef0d-487c-8759-3784eae6bce9' @@ -1071,7 +1064,7 @@ components: description: A **quote** resource represents the quoted amount details with which an Outgoing Payment may be created. type: object examples: - - id: 'https://openpayments.guide/alice/quotes/ab03296b-0c8b-4776-b94e-7ee27d868d4d' + - id: 'https://openpayments.guide/quotes/ab03296b-0c8b-4776-b94e-7ee27d868d4d' walletAddress: 'https://openpayments.guide/alice/' receiver: 'https://openpayments.guide/shoeshop/incoming-payments/2fe92c6f-ef0d-487c-8759-3784eae6bce9' receiveAmount: @@ -1088,7 +1081,7 @@ components: assetScale: 2 createdAt: '2022-03-12T23:20:50.52Z' expiresAt: '2022-04-12T23:20:50.52Z' - - id: 'https://openpayments.guide/alice/quotes/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' + - id: 'https://openpayments.guide/quotes/8c68d3cc-0a0f-4216-98b4-4fa44a6c88cf' walletAddress: 'https://openpayments.guide/alice/' receiver: 'https://openpayments.guide/aplusvideo/incoming-payments/45d495ad-b763-4882-88d7-aa14d261686e' debitAmount: @@ -1267,6 +1260,8 @@ components: schema: type: integer minimum: 1 + maximum: 100 + default: 10 name: first in: query description: The number of items to return after the cursor. @@ -1274,6 +1269,8 @@ components: schema: type: integer minimum: 1 + maximum: 100 + default: 10 name: last in: query description: The number of items to return before the cursor. diff --git a/openapi/schemas.yaml b/openapi/schemas.yaml index 8a14d434..a31d1ac5 100644 --- a/openapi/schemas.yaml +++ b/openapi/schemas.yaml @@ -44,5 +44,5 @@ components: format: uri pattern: '^https://(.+)/(incoming-payments|connections)/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' examples: - - 'https://openpayments.guide/alice/incoming-payments/08394f02-7b7b-45e2-b645-51d04e7c330c' + - 'https://openpayments.guide/incoming-payments/08394f02-7b7b-45e2-b645-51d04e7c330c' - 'https://openpayments.guide/connections/016da9d5-c9a4-4c80-a354-86b915a04ff8' diff --git a/packages/open-payments/src/client/incoming-payment.test.ts b/packages/open-payments/src/client/incoming-payment.test.ts index 2b374a26..f84d93ca 100644 --- a/packages/open-payments/src/client/incoming-payment.test.ts +++ b/packages/open-payments/src/client/incoming-payment.test.ts @@ -11,11 +11,8 @@ import { import { OpenAPI, HttpMethod, createOpenAPI } from '@interledger/openapi' import { defaultAxiosInstance, - mockILPStreamConnection, mockIncomingPayment, mockIncomingPaymentPaginationResult, - mockIncomingPaymentWithConnection, - mockIncomingPaymentWithConnectionUrl, mockOpenApiResponseValidators, silentLogger } from '../test/helpers' @@ -44,13 +41,14 @@ describe('incoming-payment', (): void => { const axiosInstance = defaultAxiosInstance const logger = silentLogger - const walletAddress = 'http://localhost:1000/.well-known/pay' + const walletAddress = 'http://localhost:1000/alice/.well-known/pay' + const serverAddress = 'http://localhost:1000' const accessToken = 'accessToken' const openApiValidators = mockOpenApiResponseValidators() describe('getIncomingPayment', (): void => { test('returns incoming payment if passes validation', async (): Promise(path: P): string =>
path as string
export type IncomingPayment = RSComponents['schemas']['incoming-payment']
-export type IncomingPaymentWithConnection =
- RSComponents['schemas']['incoming-payment-with-connection']
-export type IncomingPaymentWithConnectionUrl =
- RSComponents['schemas']['incoming-payment-with-connection-url']
export type CreateIncomingPaymentArgs =
RSOperations['create-incoming-payment']['requestBody']['content']['application/json']
-export type IncomingPaymentPaginationResult =
- PaginationResult