@naturalpay/sdk 0.1.4 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +119 -0
- package/LICENSE +7 -0
- package/README.md +340 -26
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +255 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +255 -0
- package/client.d.ts.map +1 -0
- package/client.js +548 -0
- package/client.js.map +1 -0
- package/client.mjs +544 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +30 -0
- package/index.js.map +1 -0
- package/index.mjs +7 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +40 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +37 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +87 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +81 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +8 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +8 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +12 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +9 -0
- package/internal/utils.mjs.map +1 -0
- package/lib/envelope.d.mts +4 -0
- package/lib/envelope.d.mts.map +1 -0
- package/lib/envelope.d.ts +4 -0
- package/lib/envelope.d.ts.map +1 -0
- package/lib/envelope.js +43 -0
- package/lib/envelope.js.map +1 -0
- package/lib/envelope.mjs +39 -0
- package/lib/envelope.mjs.map +1 -0
- package/package.json +142 -76
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/agents.d.mts +1392 -0
- package/resources/agents.d.mts.map +1 -0
- package/resources/agents.d.ts +1392 -0
- package/resources/agents.d.ts.map +1 -0
- package/resources/agents.js +192 -0
- package/resources/agents.js.map +1 -0
- package/resources/agents.mjs +188 -0
- package/resources/agents.mjs.map +1 -0
- package/resources/api-keys.d.mts +539 -0
- package/resources/api-keys.d.mts.map +1 -0
- package/resources/api-keys.d.ts +539 -0
- package/resources/api-keys.d.ts.map +1 -0
- package/resources/api-keys.js +100 -0
- package/resources/api-keys.js.map +1 -0
- package/resources/api-keys.mjs +96 -0
- package/resources/api-keys.mjs.map +1 -0
- package/resources/counterparties.d.mts +139 -0
- package/resources/counterparties.d.mts.map +1 -0
- package/resources/counterparties.d.ts +139 -0
- package/resources/counterparties.d.ts.map +1 -0
- package/resources/counterparties.js +32 -0
- package/resources/counterparties.js.map +1 -0
- package/resources/counterparties.mjs +28 -0
- package/resources/counterparties.mjs.map +1 -0
- package/resources/customers.d.mts +272 -0
- package/resources/customers.d.mts.map +1 -0
- package/resources/customers.d.ts +272 -0
- package/resources/customers.d.ts.map +1 -0
- package/resources/customers.js +48 -0
- package/resources/customers.js.map +1 -0
- package/resources/customers.mjs +44 -0
- package/resources/customers.mjs.map +1 -0
- package/resources/delegations.d.mts +458 -0
- package/resources/delegations.d.mts.map +1 -0
- package/resources/delegations.d.ts +458 -0
- package/resources/delegations.d.ts.map +1 -0
- package/resources/delegations.js +47 -0
- package/resources/delegations.js.map +1 -0
- package/resources/delegations.mjs +43 -0
- package/resources/delegations.mjs.map +1 -0
- package/resources/index.d.mts +12 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +12 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +27 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +13 -0
- package/resources/index.mjs.map +1 -0
- package/resources/invitations.d.mts +304 -0
- package/resources/invitations.d.mts.map +1 -0
- package/resources/invitations.d.ts +304 -0
- package/resources/invitations.d.ts.map +1 -0
- package/resources/invitations.js +85 -0
- package/resources/invitations.js.map +1 -0
- package/resources/invitations.mjs +81 -0
- package/resources/invitations.mjs.map +1 -0
- package/resources/parties.d.mts +364 -0
- package/resources/parties.d.mts.map +1 -0
- package/resources/parties.d.ts +364 -0
- package/resources/parties.d.ts.map +1 -0
- package/resources/parties.js +78 -0
- package/resources/parties.js.map +1 -0
- package/resources/parties.mjs +74 -0
- package/resources/parties.mjs.map +1 -0
- package/resources/payment-requests.d.mts +442 -0
- package/resources/payment-requests.d.mts.map +1 -0
- package/resources/payment-requests.d.ts +442 -0
- package/resources/payment-requests.d.ts.map +1 -0
- package/resources/payment-requests.js +87 -0
- package/resources/payment-requests.js.map +1 -0
- package/resources/payment-requests.mjs +83 -0
- package/resources/payment-requests.mjs.map +1 -0
- package/resources/payments.d.mts +174 -0
- package/resources/payments.d.mts.map +1 -0
- package/resources/payments.d.ts +174 -0
- package/resources/payments.d.ts.map +1 -0
- package/resources/payments.js +40 -0
- package/resources/payments.js.map +1 -0
- package/resources/payments.mjs +36 -0
- package/resources/payments.mjs.map +1 -0
- package/resources/transactions.d.mts +478 -0
- package/resources/transactions.d.mts.map +1 -0
- package/resources/transactions.d.ts +478 -0
- package/resources/transactions.d.ts.map +1 -0
- package/resources/transactions.js +48 -0
- package/resources/transactions.js.map +1 -0
- package/resources/transactions.mjs +44 -0
- package/resources/transactions.mjs.map +1 -0
- package/resources/wallet.d.mts +628 -0
- package/resources/wallet.d.mts.map +1 -0
- package/resources/wallet.d.ts +628 -0
- package/resources/wallet.d.ts.map +1 -0
- package/resources/wallet.js +161 -0
- package/resources/wallet.js.map +1 -0
- package/resources/wallet.mjs +157 -0
- package/resources/wallet.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +1020 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +22 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +56 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +93 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +128 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +9 -0
- package/src/lib/.keep +4 -0
- package/src/lib/envelope.ts +32 -0
- package/src/resource.ts +2 -0
- package/src/resources/agents.ts +1785 -0
- package/src/resources/api-keys.ts +743 -0
- package/src/resources/counterparties.ts +187 -0
- package/src/resources/customers.ts +365 -0
- package/src/resources/delegations.ts +580 -0
- package/src/resources/index.ts +95 -0
- package/src/resources/invitations.ts +414 -0
- package/src/resources/parties.ts +493 -0
- package/src/resources/payment-requests.ts +601 -0
- package/src/resources/payments.ts +228 -0
- package/src/resources/transactions.ts +610 -0
- package/src/resources/wallet.ts +864 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
- package/dist/index.cjs +0 -1688
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -879
- package/dist/index.d.ts +0 -879
- package/dist/index.js +0 -1657
- package/dist/index.js.map +0 -1
- package/dist/mcp/cli.cjs +0 -166
- package/dist/mcp/cli.cjs.map +0 -1
- package/dist/mcp/cli.d.cts +0 -1
- package/dist/mcp/cli.d.ts +0 -1
- package/dist/mcp/cli.js +0 -164
- package/dist/mcp/cli.js.map +0 -1
- package/dist/mcp/index.cjs +0 -8
- package/dist/mcp/index.cjs.map +0 -1
- package/dist/mcp/index.d.cts +0 -9
- package/dist/mcp/index.d.ts +0 -9
- package/dist/mcp/index.js +0 -6
- package/dist/mcp/index.js.map +0 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Counterparty management
|
|
10
|
+
*/
|
|
11
|
+
export class Counterparties extends APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* Returns one row per counterparty with sent and received aggregates. Either side
|
|
14
|
+
* may be null when there are no payments in that direction. Pass direction=sent or
|
|
15
|
+
* direction=received to scope the list (and its pagination) to one side.
|
|
16
|
+
*/
|
|
17
|
+
list(
|
|
18
|
+
params: CounterpartyListParams | null | undefined = {},
|
|
19
|
+
options?: RequestOptions,
|
|
20
|
+
): APIPromise<CounterpartyListResponse> {
|
|
21
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
22
|
+
return this._client.get('/counterparties', {
|
|
23
|
+
query,
|
|
24
|
+
...options,
|
|
25
|
+
headers: buildHeaders([
|
|
26
|
+
{
|
|
27
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
28
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
29
|
+
},
|
|
30
|
+
options?.headers,
|
|
31
|
+
]),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface CounterpartyListResponse {
|
|
37
|
+
data: Array<CounterpartyListResponse.Data>;
|
|
38
|
+
|
|
39
|
+
meta: CounterpartyListResponse.Meta;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export namespace CounterpartyListResponse {
|
|
43
|
+
export interface Data {
|
|
44
|
+
/**
|
|
45
|
+
* Counterparty ID: a party id (pty_xxx), or unknown_xxx for unclaimed payments
|
|
46
|
+
*/
|
|
47
|
+
id: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Counterparty attributes
|
|
51
|
+
*/
|
|
52
|
+
attributes: Data.Attributes;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Resource type
|
|
56
|
+
*/
|
|
57
|
+
type: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export namespace Data {
|
|
61
|
+
/**
|
|
62
|
+
* Counterparty attributes
|
|
63
|
+
*/
|
|
64
|
+
export interface Attributes {
|
|
65
|
+
/**
|
|
66
|
+
* Counterparty primary email
|
|
67
|
+
*/
|
|
68
|
+
partyEmail: string | null;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Party ID (pty_xxx) - null for unclaimed payments
|
|
72
|
+
*/
|
|
73
|
+
partyId: string | null;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Counterparty display name
|
|
77
|
+
*/
|
|
78
|
+
partyName: string | null;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Counterparty party status
|
|
82
|
+
*/
|
|
83
|
+
partyStatus: 'PROVISIONAL' | 'ACTIVE' | 'SUSPENDED' | 'INACTIVE' | null;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Aggregates for payments you received from this counterparty. Null if none.
|
|
87
|
+
*/
|
|
88
|
+
received: Attributes.Received | null;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Aggregates for payments you sent to this counterparty. Null if none.
|
|
92
|
+
*/
|
|
93
|
+
sent: Attributes.Sent | null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export namespace Attributes {
|
|
97
|
+
/**
|
|
98
|
+
* Aggregates for payments you received from this counterparty. Null if none.
|
|
99
|
+
*/
|
|
100
|
+
export interface Received {
|
|
101
|
+
/**
|
|
102
|
+
* Timestamp of first payment in this direction
|
|
103
|
+
*/
|
|
104
|
+
firstAt: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Total amount in this direction, minor units (cents)
|
|
108
|
+
*/
|
|
109
|
+
totalAmountMinor: number;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Number of payments in this direction
|
|
113
|
+
*/
|
|
114
|
+
transactionCount: number;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Aggregates for payments you sent to this counterparty. Null if none.
|
|
119
|
+
*/
|
|
120
|
+
export interface Sent {
|
|
121
|
+
/**
|
|
122
|
+
* Timestamp of first payment in this direction
|
|
123
|
+
*/
|
|
124
|
+
firstAt: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Total amount in this direction, minor units (cents)
|
|
128
|
+
*/
|
|
129
|
+
totalAmountMinor: number;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Number of payments in this direction
|
|
133
|
+
*/
|
|
134
|
+
transactionCount: number;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface Meta {
|
|
140
|
+
pagination: Meta.Pagination;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export namespace Meta {
|
|
144
|
+
export interface Pagination {
|
|
145
|
+
hasMore: boolean;
|
|
146
|
+
|
|
147
|
+
nextCursor: string | null;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface CounterpartyListParams {
|
|
153
|
+
/**
|
|
154
|
+
* Query param: Cursor for pagination
|
|
155
|
+
*/
|
|
156
|
+
cursor?: string;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Query param: Optional filter. When set, only counterparties with activity in
|
|
160
|
+
* that direction are returned, and pagination is scoped to that subset. Omit to
|
|
161
|
+
* return every counterparty.
|
|
162
|
+
*/
|
|
163
|
+
direction?: 'sent' | 'received';
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Query param: Maximum number of results
|
|
167
|
+
*/
|
|
168
|
+
limit?: number;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
172
|
+
*/
|
|
173
|
+
'X-Agent-ID'?: string;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
177
|
+
* for agent observability.
|
|
178
|
+
*/
|
|
179
|
+
'X-Instance-ID'?: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export declare namespace Counterparties {
|
|
183
|
+
export {
|
|
184
|
+
type CounterpartyListResponse as CounterpartyListResponse,
|
|
185
|
+
type CounterpartyListParams as CounterpartyListParams,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Customer management
|
|
10
|
+
*/
|
|
11
|
+
export class Customers extends APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* List active customers you can operate on behalf of.
|
|
14
|
+
*/
|
|
15
|
+
list(
|
|
16
|
+
params: CustomerListParams | null | undefined = {},
|
|
17
|
+
options?: RequestOptions,
|
|
18
|
+
): APIPromise<CustomerListResponse> {
|
|
19
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
20
|
+
return this._client.get('/customers', {
|
|
21
|
+
query,
|
|
22
|
+
...options,
|
|
23
|
+
headers: buildHeaders([
|
|
24
|
+
{
|
|
25
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
26
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
27
|
+
},
|
|
28
|
+
options?.headers,
|
|
29
|
+
]),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* List the pending customer invitations you've sent — agent invitations grouped by
|
|
35
|
+
* recipient.
|
|
36
|
+
*/
|
|
37
|
+
listInvitations(
|
|
38
|
+
params: CustomerListInvitationsParams | null | undefined = {},
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<CustomerListInvitationsResponse> {
|
|
41
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
42
|
+
return this._client.get('/customers/invitations', {
|
|
43
|
+
query,
|
|
44
|
+
...options,
|
|
45
|
+
headers: buildHeaders([
|
|
46
|
+
{
|
|
47
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
48
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
49
|
+
},
|
|
50
|
+
options?.headers,
|
|
51
|
+
]),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface CustomerListResponse {
|
|
57
|
+
data: Array<CustomerListResponse.Data>;
|
|
58
|
+
|
|
59
|
+
meta: CustomerListResponse.Meta;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export namespace CustomerListResponse {
|
|
63
|
+
/**
|
|
64
|
+
* Customer resource for an active customer (type='customer', id=pty_xxx).
|
|
65
|
+
*/
|
|
66
|
+
export interface Data {
|
|
67
|
+
/**
|
|
68
|
+
* Customer party handle (pty_xxx)
|
|
69
|
+
*/
|
|
70
|
+
id: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Resource attributes
|
|
74
|
+
*/
|
|
75
|
+
attributes: Data.Attributes;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Resource type
|
|
79
|
+
*/
|
|
80
|
+
type: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export namespace Data {
|
|
84
|
+
/**
|
|
85
|
+
* Resource attributes
|
|
86
|
+
*/
|
|
87
|
+
export interface Attributes {
|
|
88
|
+
/**
|
|
89
|
+
* When the delegation was created
|
|
90
|
+
*/
|
|
91
|
+
createdAt: string;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Customer email, if known
|
|
95
|
+
*/
|
|
96
|
+
email: string | null;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Party info
|
|
100
|
+
*/
|
|
101
|
+
party: Attributes.Party;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Granted permissions
|
|
105
|
+
*/
|
|
106
|
+
permissions: Array<string>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Status (ACTIVE, etc.)
|
|
110
|
+
*/
|
|
111
|
+
status: string;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Why walletAvailableMinor may be null: "granted" balance is fresh; "denied"
|
|
115
|
+
* caller lacks wallets.read; "noWallet" party has not provisioned a wallet.
|
|
116
|
+
*/
|
|
117
|
+
walletAccess: 'granted' | 'denied' | 'noWallet';
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Available wallet balance in cents. Null when access is denied or no wallet
|
|
121
|
+
* exists — see walletAccess.
|
|
122
|
+
*/
|
|
123
|
+
walletAvailableMinor: number | null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export namespace Attributes {
|
|
127
|
+
/**
|
|
128
|
+
* Party info
|
|
129
|
+
*/
|
|
130
|
+
export interface Party {
|
|
131
|
+
/**
|
|
132
|
+
* Party handle (pty_xxx)
|
|
133
|
+
*/
|
|
134
|
+
id: string;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Primary email
|
|
138
|
+
*/
|
|
139
|
+
email: string | null;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Display name, falling back to legal name when display name is unset
|
|
143
|
+
*/
|
|
144
|
+
name: string;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface Meta {
|
|
150
|
+
pagination: Meta.Pagination;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export namespace Meta {
|
|
154
|
+
export interface Pagination {
|
|
155
|
+
hasMore: boolean;
|
|
156
|
+
|
|
157
|
+
nextCursor: string | null;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface CustomerListInvitationsResponse {
|
|
163
|
+
data: Array<CustomerListInvitationsResponse.Data>;
|
|
164
|
+
|
|
165
|
+
meta: CustomerListInvitationsResponse.Meta;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export namespace CustomerListInvitationsResponse {
|
|
169
|
+
/**
|
|
170
|
+
* A pending customer invitation (type='customerInvitation', id=recipient email) —
|
|
171
|
+
* a grouping of agent invitations sent to one recipient.
|
|
172
|
+
*/
|
|
173
|
+
export interface Data {
|
|
174
|
+
/**
|
|
175
|
+
* Recipient email — the grouping key for the pending invitation. Stays the id even
|
|
176
|
+
* after the recipient creates an account.
|
|
177
|
+
*/
|
|
178
|
+
id: string;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Resource attributes
|
|
182
|
+
*/
|
|
183
|
+
attributes: Data.Attributes;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Resource type
|
|
187
|
+
*/
|
|
188
|
+
type: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export namespace Data {
|
|
192
|
+
/**
|
|
193
|
+
* Resource attributes
|
|
194
|
+
*/
|
|
195
|
+
export interface Attributes {
|
|
196
|
+
/**
|
|
197
|
+
* Pending agent delegation invitations sent to this recipient
|
|
198
|
+
*/
|
|
199
|
+
agentInvitations: Array<Attributes.AgentInvitation>;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* When the earliest agent invitation was created
|
|
203
|
+
*/
|
|
204
|
+
createdAt: string;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Recipient email — the grouping key
|
|
208
|
+
*/
|
|
209
|
+
email: string;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Party info (null until the recipient creates an account)
|
|
213
|
+
*/
|
|
214
|
+
party: Attributes.Party | null;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Status (always PENDING)
|
|
218
|
+
*/
|
|
219
|
+
status: string;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Always 'denied' for pending customers
|
|
223
|
+
*/
|
|
224
|
+
walletAccess: 'granted' | 'denied' | 'noWallet';
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Always null for pending customers
|
|
228
|
+
*/
|
|
229
|
+
walletAvailableMinor: number | null;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export namespace Attributes {
|
|
233
|
+
export interface AgentInvitation {
|
|
234
|
+
/**
|
|
235
|
+
* Agent the invitation targets
|
|
236
|
+
*/
|
|
237
|
+
agent: AgentInvitation.Agent;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* When the agent invitation was created
|
|
241
|
+
*/
|
|
242
|
+
createdAt: string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* When the agent invitation expires (null if it does not expire)
|
|
246
|
+
*/
|
|
247
|
+
expiresAt: string | null;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Agent delegation invitation handle (adi_xxx)
|
|
251
|
+
*/
|
|
252
|
+
invitationId: string;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Permissions the invitation requests
|
|
256
|
+
*/
|
|
257
|
+
permissions: Array<string>;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export namespace AgentInvitation {
|
|
261
|
+
/**
|
|
262
|
+
* Agent the invitation targets
|
|
263
|
+
*/
|
|
264
|
+
export interface Agent {
|
|
265
|
+
/**
|
|
266
|
+
* Agent handle (agt_xxx)
|
|
267
|
+
*/
|
|
268
|
+
id: string;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Agent display name
|
|
272
|
+
*/
|
|
273
|
+
name: string | null;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Party info (null until the recipient creates an account)
|
|
279
|
+
*/
|
|
280
|
+
export interface Party {
|
|
281
|
+
/**
|
|
282
|
+
* Party handle (pty_xxx)
|
|
283
|
+
*/
|
|
284
|
+
id: string;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Primary email
|
|
288
|
+
*/
|
|
289
|
+
email: string | null;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Display name, falling back to legal name when display name is unset
|
|
293
|
+
*/
|
|
294
|
+
name: string;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export interface Meta {
|
|
300
|
+
pagination: Meta.Pagination;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export namespace Meta {
|
|
304
|
+
export interface Pagination {
|
|
305
|
+
hasMore: boolean;
|
|
306
|
+
|
|
307
|
+
nextCursor: string | null;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export interface CustomerListParams {
|
|
313
|
+
/**
|
|
314
|
+
* Query param: Cursor for pagination
|
|
315
|
+
*/
|
|
316
|
+
cursor?: string;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Query param: Maximum number of results
|
|
320
|
+
*/
|
|
321
|
+
limit?: number;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
325
|
+
*/
|
|
326
|
+
'X-Agent-ID'?: string;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
330
|
+
* for agent observability.
|
|
331
|
+
*/
|
|
332
|
+
'X-Instance-ID'?: string;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export interface CustomerListInvitationsParams {
|
|
336
|
+
/**
|
|
337
|
+
* Query param: Cursor for pagination
|
|
338
|
+
*/
|
|
339
|
+
cursor?: string;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Query param: Maximum number of results
|
|
343
|
+
*/
|
|
344
|
+
limit?: number;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
348
|
+
*/
|
|
349
|
+
'X-Agent-ID'?: string;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
353
|
+
* for agent observability.
|
|
354
|
+
*/
|
|
355
|
+
'X-Instance-ID'?: string;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export declare namespace Customers {
|
|
359
|
+
export {
|
|
360
|
+
type CustomerListResponse as CustomerListResponse,
|
|
361
|
+
type CustomerListInvitationsResponse as CustomerListInvitationsResponse,
|
|
362
|
+
type CustomerListParams as CustomerListParams,
|
|
363
|
+
type CustomerListInvitationsParams as CustomerListInvitationsParams,
|
|
364
|
+
};
|
|
365
|
+
}
|