@delopay/sdk 0.473.0 → 0.474.0
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/dist/airwallexCard.cjs.map +1 -1
- package/dist/branding.cjs.map +1 -1
- package/dist/cardFormStyles.cjs.map +1 -1
- package/dist/checkoutSession.cjs.map +1 -1
- package/dist/chunk-244VZFFO.cjs.map +1 -1
- package/dist/chunk-2IJRBJXW.cjs.map +1 -1
- package/dist/chunk-34PC72O7.cjs.map +1 -1
- package/dist/chunk-3GBWQWTP.cjs.map +1 -1
- package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
- package/dist/chunk-44QBWVRS.cjs.map +1 -1
- package/dist/chunk-4EKAWNYI.cjs.map +1 -1
- package/dist/chunk-4LN4BR2T.cjs.map +1 -1
- package/dist/chunk-4T4XHPYN.cjs.map +1 -1
- package/dist/chunk-5CITBN33.cjs.map +1 -1
- package/dist/chunk-5HCKC4HF.cjs.map +1 -1
- package/dist/chunk-5O2JSQYA.cjs.map +1 -1
- package/dist/chunk-5QS67SBO.cjs.map +1 -1
- package/dist/chunk-6EBY2KKL.cjs.map +1 -1
- package/dist/chunk-6LFOM6HV.cjs.map +1 -1
- package/dist/chunk-6LOWE2YI.cjs.map +1 -1
- package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
- package/dist/chunk-6SU2MTN2.cjs.map +1 -1
- package/dist/chunk-6YCDLSIU.cjs.map +1 -1
- package/dist/chunk-75E5WNJG.cjs.map +1 -1
- package/dist/chunk-7JV6VVO7.cjs.map +1 -1
- package/dist/chunk-7QZCUXWB.cjs.map +1 -1
- package/dist/chunk-7VXF5D67.cjs.map +1 -1
- package/dist/chunk-7WAQX26D.cjs.map +1 -1
- package/dist/chunk-ABWAYMN5.cjs.map +1 -1
- package/dist/chunk-ACZ2R47X.cjs.map +1 -1
- package/dist/chunk-AYUYJO3I.cjs.map +1 -1
- package/dist/chunk-BCA3TCGS.cjs.map +1 -1
- package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
- package/dist/chunk-BRY3W7N3.cjs.map +1 -1
- package/dist/chunk-CAMALM35.cjs.map +1 -1
- package/dist/chunk-CCN44NZJ.cjs.map +1 -1
- package/dist/chunk-CR3JBTP3.cjs.map +1 -1
- package/dist/chunk-CYDHHARQ.cjs.map +1 -1
- package/dist/chunk-DJASVBOJ.cjs.map +1 -1
- package/dist/chunk-EEB2HDYL.cjs.map +1 -1
- package/dist/chunk-ENPSUWTS.cjs.map +1 -1
- package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
- package/dist/chunk-EXPWQBI3.cjs.map +1 -1
- package/dist/chunk-F3I5DOWV.cjs.map +1 -1
- package/dist/chunk-F46K5H3U.cjs.map +1 -1
- package/dist/chunk-F6S3WCCB.cjs.map +1 -1
- package/dist/chunk-FQRC4NJG.cjs.map +1 -1
- package/dist/chunk-FYISDU2Y.cjs.map +1 -1
- package/dist/chunk-GG52SAHA.cjs.map +1 -1
- package/dist/chunk-GK5FWN4H.cjs.map +1 -1
- package/dist/chunk-GSQN5EOO.cjs.map +1 -1
- package/dist/chunk-GW7IHYXR.cjs.map +1 -1
- package/dist/chunk-GWSVQXEY.cjs.map +1 -1
- package/dist/chunk-HLHML5ES.cjs.map +1 -1
- package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
- package/dist/chunk-HLYGHP6F.cjs.map +1 -1
- package/dist/chunk-HSJABE7X.cjs.map +1 -1
- package/dist/chunk-I2W7AO4B.cjs.map +1 -1
- package/dist/chunk-I2XGNALG.cjs.map +1 -1
- package/dist/chunk-I7SIQMGY.cjs.map +1 -1
- package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
- package/dist/chunk-IR2LFKKA.cjs.map +1 -1
- package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
- package/dist/chunk-JPPRDMTJ.cjs.map +1 -1
- package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
- package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
- package/dist/chunk-KJDMNF2T.cjs.map +1 -1
- package/dist/chunk-KLONGJCL.cjs.map +1 -1
- package/dist/chunk-KOB6MOAV.cjs.map +1 -1
- package/dist/chunk-KSJ7JLR3.cjs.map +1 -1
- package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
- package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
- package/dist/chunk-LYIBTVK6.cjs.map +1 -1
- package/dist/chunk-M3HWE7KT.cjs.map +1 -1
- package/dist/chunk-M3SJHFT4.cjs.map +1 -1
- package/dist/chunk-MCNDMK7F.cjs.map +1 -1
- package/dist/chunk-MLG6NXI6.cjs.map +1 -1
- package/dist/chunk-NAHX6XYV.cjs.map +1 -1
- package/dist/chunk-NFB3S2E6.cjs.map +1 -1
- package/dist/chunk-NYL3BNHR.cjs.map +1 -1
- package/dist/chunk-O4AYHLQX.cjs.map +1 -1
- package/dist/chunk-OAEKP665.cjs.map +1 -1
- package/dist/chunk-ODPNVNYE.cjs.map +1 -1
- package/dist/chunk-OG2KJAYD.cjs.map +1 -1
- package/dist/chunk-OMQJTXFL.cjs.map +1 -1
- package/dist/chunk-ORCK5GQ3.cjs.map +1 -1
- package/dist/chunk-OWP7XBY2.cjs.map +1 -1
- package/dist/chunk-OYZP6NF6.cjs.map +1 -1
- package/dist/chunk-P4UILJVU.cjs.map +1 -1
- package/dist/chunk-P6JLNQ6L.cjs.map +1 -1
- package/dist/chunk-P7DYLUUI.cjs.map +1 -1
- package/dist/chunk-PKAE6AQT.cjs.map +1 -1
- package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
- package/dist/chunk-QKUWFMZP.cjs.map +1 -1
- package/dist/chunk-QRSA72B3.cjs.map +1 -1
- package/dist/chunk-QYNRNDIY.cjs.map +1 -1
- package/dist/chunk-R4GA6BVP.cjs.map +1 -1
- package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
- package/dist/chunk-RHFUXHQN.cjs.map +1 -1
- package/dist/chunk-RI42IDRR.cjs.map +1 -1
- package/dist/chunk-RSVLVW4L.cjs.map +1 -1
- package/dist/chunk-S77LQWYC.cjs.map +1 -1
- package/dist/chunk-S7SBNOGS.cjs.map +1 -1
- package/dist/chunk-TMAJE5P2.cjs.map +1 -1
- package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
- package/dist/chunk-U3JK7NBG.cjs.map +1 -1
- package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
- package/dist/chunk-UKLZAOLW.cjs.map +1 -1
- package/dist/chunk-V47G7P6L.cjs.map +1 -1
- package/dist/chunk-VH5A6SMU.cjs.map +1 -1
- package/dist/chunk-VHMH4QMY.cjs.map +1 -1
- package/dist/chunk-VYC7WUM5.cjs.map +1 -1
- package/dist/chunk-VZ3BSIVU.cjs.map +1 -1
- package/dist/chunk-W457XUA6.cjs.map +1 -1
- package/dist/chunk-WHDI3TMP.cjs.map +1 -1
- package/dist/chunk-WITCPKNL.cjs.map +1 -1
- package/dist/chunk-WX6NP7UU.cjs.map +1 -1
- package/dist/chunk-XQLRIBVR.cjs.map +1 -1
- package/dist/chunk-Y7LSSRNJ.cjs.map +1 -1
- package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
- package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
- package/dist/chunk-ZUULK36E.cjs.map +1 -1
- package/dist/chunk-ZZ2JZOQF.cjs.map +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/currencies.cjs.map +1 -1
- package/dist/enigmaCardForm.cjs.map +1 -1
- package/dist/error.cjs.map +1 -1
- package/dist/eventStream.cjs.map +1 -1
- package/dist/exportDownload.cjs.map +1 -1
- package/dist/feeProgram.cjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/internal/resources/admin.cjs.map +1 -1
- package/dist/internal/resources/adminBranding.cjs.map +1 -1
- package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
- package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
- package/dist/internal/resources/adminFileScans.cjs.map +1 -1
- package/dist/internal/resources/adminIndustries.cjs.map +1 -1
- package/dist/internal/resources/adminLive.cjs.map +1 -1
- package/dist/internal/resources/adminNotices.cjs.map +1 -1
- package/dist/internal/resources/adminPortal.cjs.map +1 -1
- package/dist/internal/resources/adminSupport.cjs.map +1 -1
- package/dist/internal/resources/auditLogs.cjs.map +1 -1
- package/dist/internal/resources/cache.cjs.map +1 -1
- package/dist/internal/resources/cardIssuers.cjs.map +1 -1
- package/dist/internal/resources/configs.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
- package/dist/internal/resources/diagnostic.cjs.map +1 -1
- package/dist/internal/resources/gsm.cjs.map +1 -1
- package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
- package/dist/internal/resources/platformBilling.cjs.map +1 -1
- package/dist/internal/resources/platformFees.cjs.map +1 -1
- package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
- package/dist/internal/resources/platformSettings.cjs.map +1 -1
- package/dist/internal.cjs.map +1 -1
- package/dist/listQuery.cjs.map +1 -1
- package/dist/panes.cjs.map +1 -1
- package/dist/paymentPresentation.cjs.map +1 -1
- package/dist/recordCounter.cjs.map +1 -1
- package/dist/resources/aiTools.cjs.map +1 -1
- package/dist/resources/analytics.cjs.map +1 -1
- package/dist/resources/analyticsDashboard.cjs.map +1 -1
- package/dist/resources/apiKeys.cjs.map +1 -1
- package/dist/resources/audit.cjs.map +1 -1
- package/dist/resources/authentication.cjs.map +1 -1
- package/dist/resources/availabilityOverrides.cjs.map +1 -1
- package/dist/resources/billing.cjs.map +1 -1
- package/dist/resources/buyerAccount.cjs.map +1 -1
- package/dist/resources/buyerBlocklist.cjs.map +1 -1
- package/dist/resources/buyerConversations.cjs.map +1 -1
- package/dist/resources/buyerEvidenceReviews.cjs.map +1 -1
- package/dist/resources/buyerPortal.cjs.map +1 -1
- package/dist/resources/cards.cjs.map +1 -1
- package/dist/resources/chargebackPrevention.cjs.map +1 -1
- package/dist/resources/checkoutDomains.cjs.map +1 -1
- package/dist/resources/checkoutMethods.cjs.map +1 -1
- package/dist/resources/checkoutRecovery.cjs.map +1 -1
- package/dist/resources/checkoutTemplates.cjs.map +1 -1
- package/dist/resources/connectors.cjs.map +1 -1
- package/dist/resources/contentEncryption.cjs.map +1 -1
- package/dist/resources/costRules.cjs.map +1 -1
- package/dist/resources/customers.cjs.map +1 -1
- package/dist/resources/deploymentBranding.cjs.map +1 -1
- package/dist/resources/disputes.cjs.map +1 -1
- package/dist/resources/ephemeralKeys.cjs.map +1 -1
- package/dist/resources/events.cjs.map +1 -1
- package/dist/resources/export.cjs.map +1 -1
- package/dist/resources/externalRecords.cjs.map +1 -1
- package/dist/resources/featureMatrix.cjs.map +1 -1
- package/dist/resources/fees.cjs.map +1 -1
- package/dist/resources/files.cjs.map +1 -1
- package/dist/resources/forex.cjs.map +1 -1
- package/dist/resources/identityVerifications.cjs.map +1 -1
- package/dist/resources/industries.cjs.map +1 -1
- package/dist/resources/invoiceSettings.cjs.map +1 -1
- package/dist/resources/invoices.cjs.map +1 -1
- package/dist/resources/live.cjs.map +1 -1
- package/dist/resources/mandates.cjs.map +1 -1
- package/dist/resources/merchantAccounts.cjs.map +1 -1
- package/dist/resources/messageTemplates.cjs.map +1 -1
- package/dist/resources/notices.cjs.map +1 -1
- package/dist/resources/operationLimits.cjs.map +1 -1
- package/dist/resources/paymentLinks.cjs.map +1 -1
- package/dist/resources/paymentMethods.cjs.map +1 -1
- package/dist/resources/payments.cjs.map +1 -1
- package/dist/resources/payoutDestinations.cjs.map +1 -1
- package/dist/resources/payouts.cjs.map +1 -1
- package/dist/resources/paypalDisputes.cjs.map +1 -1
- package/dist/resources/persons.cjs.map +1 -1
- package/dist/resources/poll.cjs.map +1 -1
- package/dist/resources/processorCosts.cjs.map +1 -1
- package/dist/resources/processorImports.cjs.map +1 -1
- package/dist/resources/products.cjs.map +1 -1
- package/dist/resources/profileAcquirers.cjs.map +1 -1
- package/dist/resources/profiles.cjs.map +1 -1
- package/dist/resources/projects.cjs.map +1 -1
- package/dist/resources/refunds.cjs.map +1 -1
- package/dist/resources/regions.cjs.map +1 -1
- package/dist/resources/relay.cjs.map +1 -1
- package/dist/resources/risk.cjs.map +1 -1
- package/dist/resources/routing.cjs.map +1 -1
- package/dist/resources/search.cjs.map +1 -1
- package/dist/resources/sellToRestrictions.cjs.map +1 -1
- package/dist/resources/settings.cjs.map +1 -1
- package/dist/resources/settlement.cjs.map +1 -1
- package/dist/resources/shopLabels.cjs.map +1 -1
- package/dist/resources/shopify.cjs.map +1 -1
- package/dist/resources/shops.cjs.map +1 -1
- package/dist/resources/stripeConnect.cjs.map +1 -1
- package/dist/resources/subscriptions.cjs.map +1 -1
- package/dist/resources/support.cjs.map +1 -1
- package/dist/resources/threeDsRules.cjs.map +1 -1
- package/dist/resources/users.cjs.map +1 -1
- package/dist/resources/vatRates.cjs.map +1 -1
- package/dist/resources/verification.cjs.map +1 -1
- package/dist/resources/webhooks.cjs.map +1 -1
- package/dist/resources/whopResolutionCases.cjs.map +1 -1
- package/dist/trustedOrigins.cjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +34 -2
- package/dist/types.d.ts +34 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/sdk-publish-w6/dist/chunk-YK3P5QNZ.cjs","../src/resources/products.ts"],"names":[],"mappings":"AAAA;ACmFO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAG1C,MAAA,CAAO,SAAA,EAAmB,OAAA,EAAwC;AACxE,IAAA,OAAO,EAAE,GAAG,OAAA,EAAS,OAAA,EAAS,EAAE,cAAA,EAAgB,SAAA,EAAW,mBAAG,OAAA,2BAAS,UAAQ,EAAE,CAAA;AAAA,EACnF;AAAA;AA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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAayC,EAAA;AACiB,IAAA;AAChD,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBqC,EAAA;AACmB,IAAA;AAC9C,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAUyC,EAAA;AACa,IAAA;AACE,MAAA;AACnB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcwC,EAAA;AAC+B,IAAA;AAClC,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW6C,EAAA;AACY,IAAA;AAC/C,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBwC,EAAA;AACgC,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYwC,EAAA;AACoB,IAAA;AACvB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUwC,EAAA;AACoB,IAAA;AACvB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAe0C,EAAA;AAC8B,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAamC,EAAA;AACqC,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AACF;AD/U0E;AACA;AACA;AACA","file":"/tmp/sdk-publish-w6/dist/chunk-YK3P5QNZ.cjs","sourcesContent":[null,"import type {\n BillingReadinessResponse,\n ProductSalesQuery,\n ProductSalesResponse,\n AddonGroupCreateRequest,\n AddonGroupUpdateRequest,\n BundleDefinition,\n GetSubscriptionItemsResponse,\n ProductCategoryCreateRequest,\n ProductCategoryListQuery,\n ProductCategoryListResponse,\n ProductCategoryReorderRequest,\n ProductCategoryResponse,\n ProductCategoryUpdateRequest,\n ProductAliasCreateRequest,\n ProductConnectorReferenceCreateRequest,\n ProductAssignModeRequest,\n ProductCopyToLivePreview,\n ProductCopyToLivePreviewQuery,\n ProductCopyToLiveRequest,\n ProductCopyToLiveResponse,\n ProductCreateRequest,\n ProductLegacyUsageParams,\n ProductLegacyUsageResponse,\n ProductDeleteRequest,\n ProductDeleteResponse,\n ProductImageUploadResponse,\n ProductImportAcceptRequest,\n ProductImportApplyRequest,\n ProductImportPreviewRequest,\n ProductImportPreviewResponse,\n ProductImportRunListResponse,\n ProductImportRunResponse,\n ProductImportSuggestionsQuery,\n ProductListParams,\n ProductListResponse,\n ProductProviderCreateRequest,\n ProductProviderCreateResponse,\n ProductProviderPushRequest,\n ProductProviderPushResponse,\n ProductProviderSyncBatchRequest,\n ProductProviderSyncBatchResponse,\n ProductProviderSyncResponse,\n ProductPriceCreateRequest,\n ProductPriceUpdateRequest,\n ProductResolveQuery,\n ProductResolveResponse,\n ProductResponse,\n ProductUpdateRequest,\n ProviderAccountListResponse,\n ProviderArchiveOutcome,\n ProviderArchiveRequest,\n ProviderCleanupListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * A shop's product catalogue: what it sells, and at which prices.\n *\n * **Every route here belongs to one shop**, and the backend resolves it from\n * an `X-Profile-Id` header, answering `IR_04` without one. That is why\n * `profileId` is a required argument on every method rather than something to\n * remember in `options.headers`: a header that can be forgotten is forgotten,\n * and the failure arrives at runtime in a caller's dashboard rather than at\n * their compiler.\n *\n * Two shapes of the catalogue are worth knowing before calling this:\n *\n * * **A product is created with its prices.** The API requires at least one,\n * because a product nobody can be charged for cannot be sold.\n * * **A price is closed, never rewritten.** `updatePrice` changes its label,\n * its default flag and its metadata; the amount, the currency and the\n * billing interval are fixed for the life of the price, so a charge that was\n * made can always be explained by a price that still exists. Charging a new\n * figure means adding a price and archiving the old one.\n * * **Every price route answers with the whole product.** The catalogue's unit\n * is the product: a price means something only beside its siblings, and\n * which one is the default changes the moment another is added. So these\n * methods return `ProductResponse`, and the price that was touched is found\n * in its `prices` — typing them as the price alone let a caller read\n * `result.amount` as a number that is `undefined` at runtime, and mistake\n * the product's id for a price id.\n */\nexport class Products {\n constructor(private readonly request: RequestFn) {}\n\n /** The shop scope every route here takes, as the backend expects it. */\n private scoped(profileId: string, options?: RequestExtras): RequestExtras {\n return { ...options, headers: { 'X-Profile-Id': profileId, ...options?.headers } };\n }\n\n /** Upload a PNG, JPEG or WebP image to the merchant CDN. Save the returned\n * URL in a product create or update request; upload alone changes no product. */\n async uploadImage(\n file: Blob,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImageUploadResponse> {\n const form = new FormData();\n form.append('file', file);\n return this.request('POST', '/products/images', {\n body: form,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product together with its prices.\n * `POST /products`\n *\n * @param params - The product, with at least one price.\n * @param profileId - The shop the product belongs to.\n */\n async create(\n params: ProductCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', '/products', {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * One page of the shop's catalogue.\n * `GET /products/list`\n *\n * Archived products are returned too unless `status` narrows them away —\n * they are what past charges refer to.\n */\n async list(\n params: ProductListParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductListResponse> {\n return this.request('GET', '/products/list', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Find the product a name or a connector's id belongs to. Pass exactly one\n * of `alias`, `connector_product_id` and `connector_price_id`; the connector\n * ids need `connector` as well. Archived products resolve too, so a payment\n * that references one is still attributed. No match answers 404.\n * `GET /products/resolve`\n */\n async resolve(\n query: ProductResolveQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResolveResponse> {\n return this.request('GET', '/products/resolve', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Retrieve one product with its prices.\n * `GET /products/{product_id}`\n */\n async retrieve(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What a product sold in a window, per currency, net of the refunds credited\n * to its lines. Refunds that named no product line are not included.\n * `GET /products/{product_id}/sales`\n *\n * Needs payment read; refused (403) to a caller limited to some connector\n * accounts.\n */\n async sales(\n productId: string,\n query: ProductSalesQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductSalesResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/sales`, {\n ...this.scoped(profileId, options),\n query: { ...query },\n });\n }\n\n /**\n * Which active prices of the named recurring products can start a\n * subscription on the shop's billing processor account, in the environment\n * the account is in now. `GET /products/billing-readiness`\n *\n * Reads only; subscribing still checks the processor's price before\n * anything is billed. Unknown ids, one-time products and archived prices\n * are left out of the answer.\n *\n * @param productIds - 1 to 100 product ids.\n * @param profileId - The shop the products belong to.\n */\n async billingReadiness(\n productIds: readonly string[],\n profileId: string,\n options?: RequestExtras,\n ): Promise<BillingReadinessResponse> {\n return this.request('GET', '/products/billing-readiness', {\n ...this.scoped(profileId, options),\n // One comma-separated value, as the route reads it — not repeated keys.\n query: { product_ids: productIds.join(',') },\n });\n }\n\n /**\n * Change a product's name, description, image, metadata or category\n * (`category_id: null` makes it uncategorized).\n * `POST /products/{product_id}`\n *\n * Its kind and its prices are not editable here — see the class note.\n */\n async update(\n productId: string,\n params: ProductUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Take a product off sale.\n * `POST /products/{product_id}/archive`\n *\n * It stays readable and keeps its prices: a payment made against it has to\n * remain explicable after it is withdrawn.\n */\n async archive(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Copy a test product to live: its names, active prices under new ids,\n * image, tax category, category, selection groups and bundle composition.\n * A test product it contains or offers is replaced by its live copy; one\n * without a live copy refuses the copy. Nothing at a payment provider is\n * copied. A repeated copy returns the existing live copy unless `another`\n * is set (`created` says which).\n * `POST /products/{product_id}/copy-to-live`\n */\n async copyToLive(\n productId: string,\n params: ProductCopyToLiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLiveResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/copy-to-live`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What `copyToLive` would do, with nothing written. A copy that would be\n * refused answers with the copy's error.\n * `GET /products/{product_id}/copy-to-live/preview`\n */\n async previewCopyToLive(\n productId: string,\n query: ProductCopyToLivePreviewQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLivePreview> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/copy-to-live/preview`, {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's products from before modes, newest first, each with where it\n * is in use per mode.\n * `GET /products/legacy-usage`\n */\n async legacyUsage(\n params: ProductLegacyUsageParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductLegacyUsageResponse> {\n return this.request('GET', '/products/legacy-usage', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Give a product from before modes the mode it belongs to, once. Refused\n * while the other mode still uses it, or when it already has a mode.\n * `POST /products/{product_id}/assign-mode`\n */\n async assignMode(\n productId: string,\n params: ProductAssignModeRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/assign-mode`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put an archived product back on sale.\n * `POST /products/{product_id}/restore`\n */\n async restore(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /** Mark an archived product deleted. Historical payment lines keep\n * their own immutable purchase snapshots, and the catalog row remains stored. */\n async delete(productId: string, profileId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Delete an archived product, then carry out the chosen action at each\n * connected account it is tied to. An account not named in\n * `provider_actions` is kept as it is. A failed provider action does not\n * undo the delete: it is listed by {@link providerCleanups} and retried\n * with {@link providerArchive}.\n * `POST /products/{product_id}/delete`\n */\n async deleteWithProviders(\n productId: string,\n request: ProductDeleteRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductDeleteResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/delete`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Add a price to an existing product.\n * `POST /products/{product_id}/prices`\n *\n * This is how a price changes: the new figure is added and the old price is\n * archived, so both remain readable.\n */\n async addPrice(\n productId: string,\n params: ProductPriceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/prices`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a price's label, its default flag or its metadata.\n * `POST /products/{product_id}/prices/{price_id}`\n *\n * Not its amount, its currency or its interval: see the class note.\n */\n async updatePrice(\n productId: string,\n priceId: string,\n params: ProductPriceUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}`,\n { body: params, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Take one price off sale, leaving the product on it.\n * `POST /products/{product_id}/prices/{price_id}/archive`\n */\n async archivePrice(\n productId: string,\n priceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}/archive`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- add-on selection groups ---------------------------------------\n\n /**\n * Add a group of optional extras to a one-time product, with how many of\n * them a buyer must and may choose. Each add-on is an active product of kind\n * `addon` in the same shop. Returns the whole product.\n * `POST /products/{product_id}/addon-groups`\n */\n async createAddonGroup(\n productId: string,\n group: AddonGroupCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/addon-groups`, {\n body: group,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a group's name, bounds, or the add-ons it offers; a new list\n * replaces the old one whole.\n * `POST /products/{product_id}/addon-groups/{group_id}`\n */\n async updateAddonGroup(\n productId: string,\n groupId: string,\n changes: AddonGroupUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { body: changes, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Remove a group and what it offered. The add-on products themselves stay.\n * `DELETE /products/{product_id}/addon-groups/{group_id}`\n */\n async deleteAddonGroup(\n productId: string,\n groupId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'DELETE',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- bundles ---------------------------------------------------------\n\n /**\n * Replace what a bundle contains. Its pricing mode is fixed at creation;\n * past purchases keep their own frozen lines.\n * `POST /products/{product_id}/bundle`\n */\n async replaceBundle(\n productId: string,\n bundle: BundleDefinition,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/bundle`, {\n body: bundle,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- identity: names and connector references ---------------------\n\n /**\n * Add a name the product goes by. A name it already goes by is returned\n * as it is; one another product of the shop goes by is refused.\n * `POST /products/{product_id}/aliases`\n */\n async addAlias(\n productId: string,\n body: ProductAliasCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/aliases`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a name the product goes by. Its current name stays.\n * `POST /products/{product_id}/aliases/{alias_id}/remove`\n */\n async removeAlias(\n productId: string,\n aliasId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/aliases/${encodeURIComponent(aliasId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Tie a connected account's product, or one of its prices, to the product.\n * Recorded as `manual_id`: the ids are not checked against the account.\n * `POST /products/{product_id}/connector-references`\n */\n async addConnectorReference(\n productId: string,\n body: ProductConnectorReferenceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/connector-references`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a connected account's product or price from the product.\n * `POST /products/{product_id}/connector-references/{reference_id}/remove`\n */\n async removeConnectorReference(\n productId: string,\n referenceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/${encodeURIComponent(referenceId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * One bounded page of a connected billing account's products, to pick an\n * existing one to tie to a product. Reads only.\n * `GET /products/import-suggestions`\n */\n async importSuggestions(\n query: ProductImportSuggestionsQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/products/import-suggestions', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Tie one of a connected account's existing products (or a price of it) to\n * the product, verified against a fresh read of the page it was suggested\n * on — pass the same `limit` and `offset`. Recorded as `map_existing`.\n * `POST /products/{product_id}/connector-references/import`\n */\n async acceptImport(\n productId: string,\n body: ProductImportAcceptRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/import`,\n { body, ...this.scoped(profileId, options) },\n );\n }\n\n // --- categories ------------------------------------------------------\n\n /**\n * Add a category to the shop, at the end of its order. File products under\n * it with `category_id` on `create` or `update`.\n * `POST /products/categories`\n */\n async createCategory(\n body: ProductCategoryCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', '/products/categories', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's categories in order. Archived ones only with\n * `include_archived`; deleted ones never.\n * `GET /products/categories/list`\n */\n async listCategories(\n query: ProductCategoryListQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('GET', '/products/categories/list', {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put the shop's categories in a new order. Name every live category,\n * archived ones included, exactly once. Returns the categories in their new\n * order.\n * `POST /products/categories/reorder`\n */\n async reorderCategories(\n body: ProductCategoryReorderRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('POST', '/products/categories/reorder', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Rename a category.\n * `POST /products/categories/{category_id}`\n */\n async updateCategory(\n categoryId: string,\n changes: ProductCategoryUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}`, {\n body: changes,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Mark a category deleted. Its products become uncategorized and no payment\n * changes. Returns the deleted category.\n * `DELETE /products/categories/{category_id}`\n */\n async deleteCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('DELETE', `/products/categories/${encodeURIComponent(categoryId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Keep a category with its products, but file no new product under it.\n * `POST /products/categories/{category_id}/archive`\n */\n async archiveCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Let an archived category take products again.\n * `POST /products/categories/{category_id}/restore`\n */\n async restoreCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider import ---------------------------------------------\n\n /**\n * Read a connected billing account's products and say how each relates to\n * the catalog. Reads only: nothing is written to the provider or the catalog.\n * `POST /products/import/preview`\n */\n async importPreview(\n request: ProductImportPreviewRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportPreviewResponse> {\n return this.request('POST', '/products/import/preview', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product for every new item and add the new prices of every\n * changed one, tied to the provider's ids. Nothing else is edited or\n * removed, except that `options.archived: 'archive'` archives the catalog\n * product of every item the provider no longer offers (by default it is\n * left as it is). Nothing is written to the provider. A failed item is\n * reported with its reason and can be retried by naming it in\n * `connector_product_ids`.\n * `POST /products/import/apply`\n */\n async importApply(\n request: ProductImportApplyRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunResponse> {\n return this.request('POST', '/products/import/apply', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's past imports from one connected account, newest first.\n * `GET /products/import/runs`\n */\n async listImportRuns(\n merchantConnectorId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunListResponse> {\n return this.request('GET', '/products/import/runs', {\n query: { merchant_connector_id: merchantConnectorId },\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider sync -----------------------------------------------\n\n /**\n * Compare the product with its copy at every connected account it is tied\n * to. Reads the providers now; an unreadable provider answers `unknown`,\n * never `in_sync`.\n * `GET /products/{product_id}/provider-sync`\n */\n async providerSync(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/provider-sync`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * {@link providerSync} for 1 to 50 products at once, such as one page of the\n * product list. Unknown ids are left out of the answer.\n * `POST /products/provider-sync`\n */\n async providerSyncBatch(\n request: ProductProviderSyncBatchRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncBatchResponse> {\n return this.request('POST', '/products/provider-sync', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Write the catalog's state onto one connected account's copy of the\n * product, for the differences a push changes and nothing else. When it\n * would change a difference not named in `confirmed`, nothing is written and\n * the answer carries `confirmation_outdated: true` with the current\n * differences in `result`; `nothing_to_push` answers without a provider\n * write when nothing pushable differs.\n * `POST /products/{product_id}/provider-sync/push`\n */\n async providerPush(\n productId: string,\n request: ProductProviderPushRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderPushResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/push`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider lifecycle -----------------------------------------\n\n /**\n * The shop's connected accounts the catalog works with, and what each can\n * do: read, create, push, and how a delete can clean up there.\n * `GET /products/provider-accounts`\n */\n async providerAccounts(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderAccountListResponse> {\n return this.request('GET', '/products/provider-accounts', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Provider clean-ups still to be carried out: deletes whose action at a\n * provider failed, or was recorded and never reached.\n * `GET /products/provider-cleanups`\n */\n async providerCleanups(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderCleanupListResponse> {\n return this.request('GET', '/products/provider-cleanups', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create the product at a connected account it is not at yet. Without\n * `confirmed` nothing is written and the answer holds the plan to review;\n * send the plan's `fingerprint` back as `confirmed` to carry it out. When\n * the plan changed since, nothing is written and the answer carries\n * `confirmation_outdated: true` with the current plan.\n * `POST /products/{product_id}/provider-sync/create`\n */\n async providerCreate(\n productId: string,\n request: ProductProviderCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderCreateResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/create`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Archive the product at one connected account, or retry a clean-up that\n * failed after the product was deleted. Existing subscriptions there keep\n * billing; the catalog is not changed.\n * `POST /products/{product_id}/provider-archive`\n */\n async providerArchive(\n productId: string,\n request: ProviderArchiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderArchiveOutcome> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-archive`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/tmp/w2pub474/delopay-typescript-sdk/dist/chunk-YK3P5QNZ.cjs","../src/resources/products.ts"],"names":[],"m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AAAA;AAAA;AAAA;AAe0C,EAAA;AAC8B,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAamC,EAAA;AACqC,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AACF;AD/U0E;AACA;AACA;AACA","file":"/tmp/w2pub474/delopay-typescript-sdk/dist/chunk-YK3P5QNZ.cjs","sourcesContent":[null,"import type {\n BillingReadinessResponse,\n ProductSalesQuery,\n ProductSalesResponse,\n AddonGroupCreateRequest,\n AddonGroupUpdateRequest,\n BundleDefinition,\n GetSubscriptionItemsResponse,\n ProductCategoryCreateRequest,\n ProductCategoryListQuery,\n ProductCategoryListResponse,\n ProductCategoryReorderRequest,\n ProductCategoryResponse,\n ProductCategoryUpdateRequest,\n ProductAliasCreateRequest,\n ProductConnectorReferenceCreateRequest,\n ProductAssignModeRequest,\n ProductCopyToLivePreview,\n ProductCopyToLivePreviewQuery,\n ProductCopyToLiveRequest,\n ProductCopyToLiveResponse,\n ProductCreateRequest,\n ProductLegacyUsageParams,\n ProductLegacyUsageResponse,\n ProductDeleteRequest,\n ProductDeleteResponse,\n ProductImageUploadResponse,\n ProductImportAcceptRequest,\n ProductImportApplyRequest,\n ProductImportPreviewRequest,\n ProductImportPreviewResponse,\n ProductImportRunListResponse,\n ProductImportRunResponse,\n ProductImportSuggestionsQuery,\n ProductListParams,\n ProductListResponse,\n ProductProviderCreateRequest,\n ProductProviderCreateResponse,\n ProductProviderPushRequest,\n ProductProviderPushResponse,\n ProductProviderSyncBatchRequest,\n ProductProviderSyncBatchResponse,\n ProductProviderSyncResponse,\n ProductPriceCreateRequest,\n ProductPriceUpdateRequest,\n ProductResolveQuery,\n ProductResolveResponse,\n ProductResponse,\n ProductUpdateRequest,\n ProviderAccountListResponse,\n ProviderArchiveOutcome,\n ProviderArchiveRequest,\n ProviderCleanupListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * A shop's product catalogue: what it sells, and at which prices.\n *\n * **Every route here belongs to one shop**, and the backend resolves it from\n * an `X-Profile-Id` header, answering `IR_04` without one. That is why\n * `profileId` is a required argument on every method rather than something to\n * remember in `options.headers`: a header that can be forgotten is forgotten,\n * and the failure arrives at runtime in a caller's dashboard rather than at\n * their compiler.\n *\n * Two shapes of the catalogue are worth knowing before calling this:\n *\n * * **A product is created with its prices.** The API requires at least one,\n * because a product nobody can be charged for cannot be sold.\n * * **A price is closed, never rewritten.** `updatePrice` changes its label,\n * its default flag and its metadata; the amount, the currency and the\n * billing interval are fixed for the life of the price, so a charge that was\n * made can always be explained by a price that still exists. Charging a new\n * figure means adding a price and archiving the old one.\n * * **Every price route answers with the whole product.** The catalogue's unit\n * is the product: a price means something only beside its siblings, and\n * which one is the default changes the moment another is added. So these\n * methods return `ProductResponse`, and the price that was touched is found\n * in its `prices` — typing them as the price alone let a caller read\n * `result.amount` as a number that is `undefined` at runtime, and mistake\n * the product's id for a price id.\n */\nexport class Products {\n constructor(private readonly request: RequestFn) {}\n\n /** The shop scope every route here takes, as the backend expects it. */\n private scoped(profileId: string, options?: RequestExtras): RequestExtras {\n return { ...options, headers: { 'X-Profile-Id': profileId, ...options?.headers } };\n }\n\n /** Upload a PNG, JPEG or WebP image to the merchant CDN. Save the returned\n * URL in a product create or update request; upload alone changes no product. */\n async uploadImage(\n file: Blob,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImageUploadResponse> {\n const form = new FormData();\n form.append('file', file);\n return this.request('POST', '/products/images', {\n body: form,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product together with its prices.\n * `POST /products`\n *\n * @param params - The product, with at least one price.\n * @param profileId - The shop the product belongs to.\n */\n async create(\n params: ProductCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', '/products', {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * One page of the shop's catalogue.\n * `GET /products/list`\n *\n * Archived products are returned too unless `status` narrows them away —\n * they are what past charges refer to.\n */\n async list(\n params: ProductListParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductListResponse> {\n return this.request('GET', '/products/list', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Find the product a name or a connector's id belongs to. Pass exactly one\n * of `alias`, `connector_product_id` and `connector_price_id`; the connector\n * ids need `connector` as well. Archived products resolve too, so a payment\n * that references one is still attributed. No match answers 404.\n * `GET /products/resolve`\n */\n async resolve(\n query: ProductResolveQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResolveResponse> {\n return this.request('GET', '/products/resolve', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Retrieve one product with its prices.\n * `GET /products/{product_id}`\n */\n async retrieve(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What a product sold in a window, per currency, net of the refunds credited\n * to its lines. Refunds that named no product line are not included.\n * `GET /products/{product_id}/sales`\n *\n * Needs payment read; refused (403) to a caller limited to some connector\n * accounts.\n */\n async sales(\n productId: string,\n query: ProductSalesQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductSalesResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/sales`, {\n ...this.scoped(profileId, options),\n query: { ...query },\n });\n }\n\n /**\n * Which active prices of the named recurring products can start a\n * subscription on the shop's billing processor account, in the environment\n * the account is in now. `GET /products/billing-readiness`\n *\n * Reads only; subscribing still checks the processor's price before\n * anything is billed. Unknown ids, one-time products and archived prices\n * are left out of the answer.\n *\n * @param productIds - 1 to 100 product ids.\n * @param profileId - The shop the products belong to.\n */\n async billingReadiness(\n productIds: readonly string[],\n profileId: string,\n options?: RequestExtras,\n ): Promise<BillingReadinessResponse> {\n return this.request('GET', '/products/billing-readiness', {\n ...this.scoped(profileId, options),\n // One comma-separated value, as the route reads it — not repeated keys.\n query: { product_ids: productIds.join(',') },\n });\n }\n\n /**\n * Change a product's name, description, image, metadata or category\n * (`category_id: null` makes it uncategorized).\n * `POST /products/{product_id}`\n *\n * Its kind and its prices are not editable here — see the class note.\n */\n async update(\n productId: string,\n params: ProductUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Take a product off sale.\n * `POST /products/{product_id}/archive`\n *\n * It stays readable and keeps its prices: a payment made against it has to\n * remain explicable after it is withdrawn.\n */\n async archive(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Copy a test product to live: its names, active prices under new ids,\n * image, tax category, category, selection groups and bundle composition.\n * A test product it contains or offers is replaced by its live copy; one\n * without a live copy refuses the copy. Nothing at a payment provider is\n * copied. A repeated copy returns the existing live copy unless `another`\n * is set (`created` says which).\n * `POST /products/{product_id}/copy-to-live`\n */\n async copyToLive(\n productId: string,\n params: ProductCopyToLiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLiveResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/copy-to-live`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What `copyToLive` would do, with nothing written. A copy that would be\n * refused answers with the copy's error.\n * `GET /products/{product_id}/copy-to-live/preview`\n */\n async previewCopyToLive(\n productId: string,\n query: ProductCopyToLivePreviewQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLivePreview> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/copy-to-live/preview`, {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's products from before modes, newest first, each with where it\n * is in use per mode.\n * `GET /products/legacy-usage`\n */\n async legacyUsage(\n params: ProductLegacyUsageParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductLegacyUsageResponse> {\n return this.request('GET', '/products/legacy-usage', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Give a product from before modes the mode it belongs to, once. Refused\n * while the other mode still uses it, or when it already has a mode.\n * `POST /products/{product_id}/assign-mode`\n */\n async assignMode(\n productId: string,\n params: ProductAssignModeRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/assign-mode`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put an archived product back on sale.\n * `POST /products/{product_id}/restore`\n */\n async restore(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /** Mark an archived product deleted. Historical payment lines keep\n * their own immutable purchase snapshots, and the catalog row remains stored. */\n async delete(productId: string, profileId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Delete an archived product, then carry out the chosen action at each\n * connected account it is tied to. An account not named in\n * `provider_actions` is kept as it is. A failed provider action does not\n * undo the delete: it is listed by {@link providerCleanups} and retried\n * with {@link providerArchive}.\n * `POST /products/{product_id}/delete`\n */\n async deleteWithProviders(\n productId: string,\n request: ProductDeleteRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductDeleteResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/delete`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Add a price to an existing product.\n * `POST /products/{product_id}/prices`\n *\n * This is how a price changes: the new figure is added and the old price is\n * archived, so both remain readable.\n */\n async addPrice(\n productId: string,\n params: ProductPriceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/prices`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a price's label, its default flag or its metadata.\n * `POST /products/{product_id}/prices/{price_id}`\n *\n * Not its amount, its currency or its interval: see the class note.\n */\n async updatePrice(\n productId: string,\n priceId: string,\n params: ProductPriceUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}`,\n { body: params, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Take one price off sale, leaving the product on it.\n * `POST /products/{product_id}/prices/{price_id}/archive`\n */\n async archivePrice(\n productId: string,\n priceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}/archive`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- add-on selection groups ---------------------------------------\n\n /**\n * Add a group of optional extras to a one-time product, with how many of\n * them a buyer must and may choose. Each add-on is an active product of kind\n * `addon` in the same shop. Returns the whole product.\n * `POST /products/{product_id}/addon-groups`\n */\n async createAddonGroup(\n productId: string,\n group: AddonGroupCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/addon-groups`, {\n body: group,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a group's name, bounds, or the add-ons it offers; a new list\n * replaces the old one whole.\n * `POST /products/{product_id}/addon-groups/{group_id}`\n */\n async updateAddonGroup(\n productId: string,\n groupId: string,\n changes: AddonGroupUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { body: changes, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Remove a group and what it offered. The add-on products themselves stay.\n * `DELETE /products/{product_id}/addon-groups/{group_id}`\n */\n async deleteAddonGroup(\n productId: string,\n groupId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'DELETE',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- bundles ---------------------------------------------------------\n\n /**\n * Replace what a bundle contains. Its pricing mode is fixed at creation;\n * past purchases keep their own frozen lines.\n * `POST /products/{product_id}/bundle`\n */\n async replaceBundle(\n productId: string,\n bundle: BundleDefinition,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/bundle`, {\n body: bundle,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- identity: names and connector references ---------------------\n\n /**\n * Add a name the product goes by. A name it already goes by is returned\n * as it is; one another product of the shop goes by is refused.\n * `POST /products/{product_id}/aliases`\n */\n async addAlias(\n productId: string,\n body: ProductAliasCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/aliases`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a name the product goes by. Its current name stays.\n * `POST /products/{product_id}/aliases/{alias_id}/remove`\n */\n async removeAlias(\n productId: string,\n aliasId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/aliases/${encodeURIComponent(aliasId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Tie a connected account's product, or one of its prices, to the product.\n * Recorded as `manual_id`: the ids are not checked against the account.\n * `POST /products/{product_id}/connector-references`\n */\n async addConnectorReference(\n productId: string,\n body: ProductConnectorReferenceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/connector-references`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a connected account's product or price from the product.\n * `POST /products/{product_id}/connector-references/{reference_id}/remove`\n */\n async removeConnectorReference(\n productId: string,\n referenceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/${encodeURIComponent(referenceId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * One bounded page of a connected billing account's products, to pick an\n * existing one to tie to a product. Reads only.\n * `GET /products/import-suggestions`\n */\n async importSuggestions(\n query: ProductImportSuggestionsQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/products/import-suggestions', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Tie one of a connected account's existing products (or a price of it) to\n * the product, verified against a fresh read of the page it was suggested\n * on — pass the same `limit` and `offset`. Recorded as `map_existing`.\n * `POST /products/{product_id}/connector-references/import`\n */\n async acceptImport(\n productId: string,\n body: ProductImportAcceptRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/import`,\n { body, ...this.scoped(profileId, options) },\n );\n }\n\n // --- categories ------------------------------------------------------\n\n /**\n * Add a category to the shop, at the end of its order. File products under\n * it with `category_id` on `create` or `update`.\n * `POST /products/categories`\n */\n async createCategory(\n body: ProductCategoryCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', '/products/categories', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's categories in order. Archived ones only with\n * `include_archived`; deleted ones never.\n * `GET /products/categories/list`\n */\n async listCategories(\n query: ProductCategoryListQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('GET', '/products/categories/list', {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put the shop's categories in a new order. Name every live category,\n * archived ones included, exactly once. Returns the categories in their new\n * order.\n * `POST /products/categories/reorder`\n */\n async reorderCategories(\n body: ProductCategoryReorderRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('POST', '/products/categories/reorder', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Rename a category.\n * `POST /products/categories/{category_id}`\n */\n async updateCategory(\n categoryId: string,\n changes: ProductCategoryUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}`, {\n body: changes,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Mark a category deleted. Its products become uncategorized and no payment\n * changes. Returns the deleted category.\n * `DELETE /products/categories/{category_id}`\n */\n async deleteCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('DELETE', `/products/categories/${encodeURIComponent(categoryId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Keep a category with its products, but file no new product under it.\n * `POST /products/categories/{category_id}/archive`\n */\n async archiveCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Let an archived category take products again.\n * `POST /products/categories/{category_id}/restore`\n */\n async restoreCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider import ---------------------------------------------\n\n /**\n * Read a connected billing account's products and say how each relates to\n * the catalog. Reads only: nothing is written to the provider or the catalog.\n * `POST /products/import/preview`\n */\n async importPreview(\n request: ProductImportPreviewRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportPreviewResponse> {\n return this.request('POST', '/products/import/preview', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product for every new item and add the new prices of every\n * changed one, tied to the provider's ids. Nothing else is edited or\n * removed, except that `options.archived: 'archive'` archives the catalog\n * product of every item the provider no longer offers (by default it is\n * left as it is). Nothing is written to the provider. A failed item is\n * reported with its reason and can be retried by naming it in\n * `connector_product_ids`.\n * `POST /products/import/apply`\n */\n async importApply(\n request: ProductImportApplyRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunResponse> {\n return this.request('POST', '/products/import/apply', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's past imports from one connected account, newest first.\n * `GET /products/import/runs`\n */\n async listImportRuns(\n merchantConnectorId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunListResponse> {\n return this.request('GET', '/products/import/runs', {\n query: { merchant_connector_id: merchantConnectorId },\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider sync -----------------------------------------------\n\n /**\n * Compare the product with its copy at every connected account it is tied\n * to. Reads the providers now; an unreadable provider answers `unknown`,\n * never `in_sync`.\n * `GET /products/{product_id}/provider-sync`\n */\n async providerSync(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/provider-sync`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * {@link providerSync} for 1 to 50 products at once, such as one page of the\n * product list. Unknown ids are left out of the answer.\n * `POST /products/provider-sync`\n */\n async providerSyncBatch(\n request: ProductProviderSyncBatchRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncBatchResponse> {\n return this.request('POST', '/products/provider-sync', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Write the catalog's state onto one connected account's copy of the\n * product, for the differences a push changes and nothing else. When it\n * would change a difference not named in `confirmed`, nothing is written and\n * the answer carries `confirmation_outdated: true` with the current\n * differences in `result`; `nothing_to_push` answers without a provider\n * write when nothing pushable differs.\n * `POST /products/{product_id}/provider-sync/push`\n */\n async providerPush(\n productId: string,\n request: ProductProviderPushRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderPushResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/push`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider lifecycle -----------------------------------------\n\n /**\n * The shop's connected accounts the catalog works with, and what each can\n * do: read, create, push, and how a delete can clean up there.\n * `GET /products/provider-accounts`\n */\n async providerAccounts(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderAccountListResponse> {\n return this.request('GET', '/products/provider-accounts', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Provider clean-ups still to be carried out: deletes whose action at a\n * provider failed, or was recorded and never reached.\n * `GET /products/provider-cleanups`\n */\n async providerCleanups(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderCleanupListResponse> {\n return this.request('GET', '/products/provider-cleanups', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create the product at a connected account it is not at yet. Without\n * `confirmed` nothing is written and the answer holds the plan to review;\n * send the plan's `fingerprint` back as `confirmed` to carry it out. When\n * the plan changed since, nothing is written and the answer carries\n * `confirmation_outdated: true` with the current plan.\n * `POST /products/{product_id}/provider-sync/create`\n */\n async providerCreate(\n productId: string,\n request: ProductProviderCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderCreateResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/create`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Archive the product at one connected account, or retry a clean-up that\n * failed after the product was deleted. Existing subscriptions there keep\n * billing; the catalog is not changed.\n * `POST /products/{product_id}/provider-archive`\n */\n async providerArchive(\n productId: string,\n request: ProviderArchiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderArchiveOutcome> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-archive`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/sdk-publish-w6/dist/chunk-ZKPVUCQV.cjs","../src/resources/users.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACsFO,IAAM,MAAA,EAAN,MAAY;AAAA,EACjB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,MAAA,CAAO,MAAA,EAA0E;AACrF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,cAAA,EAAgB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC9D;AAAA,EAEA,MAAM,MAAA,CAAO,MAAA,EAA8C;AACzD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,cAAA,EAAgB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC9D;AAAA;AAAA,EAGA,MAAM,kBAAA,CAAA,EAA+D;AACnE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,uBAAuB,CAAA;AAAA,EACpD;AAAA;AAAA,EAGA,MAAM,wBAAA,CAAA,EAAqE;AACzE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,oBAAoB,CAAA;AAAA,EACjD;AAAA,EAEA,MAAM,gBAAA,CAAiB,MAAA,EAA0E;AAC/F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,mBAAA,EAAqB,EAAE,IAA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Response,\n RolePaymentVisibilityPolicy,\n SignUpRequest,\n SignUpWithMerchantRequest,\n SignInRequest,\n DashboardOAuthProvider,\n DashboardOAuthProvidersResponse,\n DashboardOAuthStartRequest,\n DashboardOAuthLinkStartRequest,\n DashboardOAuthStartResponse,\n DashboardOAuthCompleteRequest,\n DashboardOAuthDisconnectRequest,\n AuthResponse,\n UserResponse,\n ChangePasswordRequest,\n DeleteAccountRequest,\n ForgotPasswordRequest,\n ResetPasswordRequest,\n SwitchMerchantRequest,\n SwitchProfileRequest,\n ImpersonateEmployeeRequest,\n InviteUsersRequest,\n InviteUsersResponse,\n AddUserRequest,\n AddUserResponse,\n UpdateUserRoleRequest,\n DeleteUserRoleRequest,\n ChangeMemberScopeRequest,\n ChangeMemberScopeResponse,\n UpdateMemberExpiryRequest,\n UpdateMemberExpiryResponse,\n GetUserRoleDetailsResponse,\n TeamMemberDetails,\n ReInviteUserRequest,\n ReInviteUserResponse,\n InviteLinkResponse,\n TeamMemberContactProfileResponse,\n UpdateTeamMemberContactsRequest,\n WriteTeamMemberNoteRequest,\n DeleteTeamMemberNoteRequest,\n MemberMethodAccessResponse,\n UpdateMemberMethodAccessRequest,\n MemberPermissionOverridesResponse,\n PermissionOverride,\n UpdateMemberPermissionOverridesRequest,\n ResetTeamMemberPasswordRequest,\n ResetTeamMemberPasswordResponse,\n TotpResponse,\n RecoveryCodesResponse,\n PhoneOtpRequest,\n PhoneOtpResponse,\n PhoneOtpVerifyRequest,\n PhoneOtpVerifyResponse,\n UpdateMetadataRequest,\n SetUserPreferenceRequest,\n UserPreferenceResponse,\n DashboardTourResponse,\n UpdateDashboardTourRequest,\n UpdateUserDetailsRequest,\n FromEmailRequest,\n TokenResponse,\n UserInvitation,\n AcceptInvitationsPreAuthRequest,\n VerifyTotpRequest,\n Terminate2faQueryParams,\n ListInvitableRolesParams,\n ListUsersInLineageParams,\n UserInLineage,\n LoginHistoryParams,\n LoginHistoryResponse,\n UserSessionListResponse,\n UserSessionRevokeResponse,\n ParentGroupInfo,\n RoleConnectorGrant,\n UpdateRoleConnectorGrantParams,\n CreateInvitationLinkRequest,\n CreateInvitationLinkResponse,\n InvitationLinkResponse,\n InvitationLinkPreviewResponse,\n ListInvitationLinksResponse,\n UpdateInvitationLinkRequest,\n JoinInvitationLinkResponse,\n JoinInvitationLinkPreAuthResponse,\n RegisterThroughInvitationLinkRequest,\n RegisterThroughInvitationLinkResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\nexport class Users {\n constructor(private readonly request: RequestFn) {}\n\n async signUp(params: SignUpRequest | SignUpWithMerchantRequest): Promise<AuthResponse> {\n return this.request('POST', '/user/signup', { body: params });\n }\n\n async signIn(params: SignInRequest): Promise<AuthResponse> {\n return this.request('POST', '/user/signin', { body: params });\n }\n\n /** Providers currently configured for dashboard sign-in. */\n async listOAuthProviders(): Promise<DashboardOAuthProvidersResponse> {\n return this.request('GET', '/user/oauth/providers');\n }\n\n /** Current account's links; disabled providers remain visible. */\n async listLinkedOAuthProviders(): Promise<DashboardOAuthProvidersResponse> {\n return this.request('GET', '/user/oauth/linked');\n }\n\n async startOAuthSignIn(params: DashboardOAuthStartRequest): Promise<DashboardOAuthStartResponse> {\n return this.request('POST', '/user/oauth/start', { body: params });\n }\n\n async startOAuthLink(\n params: DashboardOAuthLinkStartRequest,\n ): Promise<DashboardOAuthStartResponse> {\n return this.request('POST', '/user/oauth/link/start', { body: params });\n }\n\n async completeOAuthSignIn(params: DashboardOAuthCompleteRequest): Promise<AuthResponse> {\n return this.request('POST', '/user/oauth/complete', { body: params });\n }\n\n async completeOAuthLink(params: DashboardOAuthCompleteRequest): Promise<void> {\n return this.request('POST', '/user/oauth/link/complete', { body: params });\n }\n\n async disconnectOAuthProvider(\n provider: DashboardOAuthProvider,\n params: DashboardOAuthDisconnectRequest,\n ): Promise<void> {\n return this.request('DELETE', `/user/oauth/linked/${encodeURIComponent(provider)}`, {\n body: params,\n });\n }\n\n async signOut(): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/signout');\n }\n\n /**\n * Sliding-session refresh: exchange the current (still-valid) login JWT\n * for a fresh one with the same claims and a full lifetime. The backend\n * keeps the session's identity (`jti`), slides `user_session.expires_at`\n * forward and re-sets the `login_token` cookie.\n *\n * Requires a token backed by a revocable session (a `jti` claim). Signin\n * and switch-merchant/-profile tokens have one; **session-less tokens do\n * not and are rejected with 400** — team-impersonation tokens are the\n * case in practice, and they are deliberately tab-scoped and\n * time-bounded rather than renewable. A 400 here is not a dead session:\n * the token remains valid for ordinary calls, it simply cannot slide.\n *\n * Rejected (401) for expired, blacklisted or revoked tokens — refresh can\n * only extend a session that is still alive. Rate-limited server-side\n * (429) to one mint per session per minute; treat a 429 as \"still fresh\n * enough\", not as an error.\n *\n * The returned token is NOT applied to this client automatically — pass\n * it to `setJwtToken()`, or use {@link Delopay.refreshSession} which does\n * both.\n *\n * `POST /user/token/refresh`. Requires a logged-in JWT.\n */\n async refreshToken(): Promise<TokenResponse> {\n return this.request('POST', '/user/token/refresh');\n }\n\n /**\n * Paginated login history for the authenticated user -- IP, User-Agent,\n * country / city / lat-lon (when GeoIP is enabled), success and failure\n * events with their reasons. Strictly scoped to the JWT subject; a user\n * can only see their own activity.\n *\n * `GET /user/me/login-activity`. Requires a logged-in JWT.\n *\n * Returns an empty page when a Delopay admin is impersonating a merchant,\n * so the admin's metadata is not exposed inside the merchant dashboard.\n *\n * Newest first unless `sort_by` says otherwise. Several `event_type` or\n * `auth_method` values match an event with any of them.\n */\n async listLoginActivity(params?: LoginHistoryParams): Promise<LoginHistoryResponse> {\n if (params === undefined) {\n return this.request('GET', '/user/me/login-activity');\n }\n return this.request('GET', '/user/me/login-activity', {\n query: csvQuery(params, ['event_type', 'auth_method']),\n });\n }\n\n /**\n * List the authenticated user's currently-active dashboard sessions\n * (one row per minted login JWT that hasn't been revoked or expired).\n *\n * The row matching the JWT making this call has `is_current: true`,\n * which is what lets the dashboard render a \"This device\" tag.\n *\n * `GET /user/me/sessions`. Requires a logged-in JWT. Returns an empty\n * list when a Delopay admin is impersonating a non-admin merchant\n * (same guard as `listLoginActivity`).\n */\n async listActiveSessions(): Promise<UserSessionListResponse> {\n return this.request('GET', '/user/me/sessions');\n }\n\n /**\n * Disconnect one of the authenticated user's sessions. The matching\n * JWT is rejected on its next request — fast-path via Redis, fall back\n * to the persistent `revoked_at` column.\n *\n * Idempotent: revoking an already-revoked or unknown id returns 404,\n * which the caller can treat as success for retry purposes. Revoking\n * a session id that belongs to a different user also returns 404 —\n * the response intentionally doesn't leak whether the id exists.\n *\n * `POST /user/me/sessions/{sessionId}/revoke`.\n */\n async revokeSession(sessionId: string): Promise<UserSessionRevokeResponse> {\n return this.request('POST', `/user/me/sessions/${encodeURIComponent(sessionId)}/revoke`);\n }\n\n async getDetails(): Promise<UserResponse> {\n return this.request('GET', '/user');\n }\n\n async update(params: UpdateUserDetailsRequest, options?: RequestExtras): Promise<UserResponse> {\n return this.request('POST', '/user/update', { body: params, ...options });\n }\n\n /**\n * Read a preference owned by the logged-in user. Missing keys return value null.\n * Works in both dashboards with a login JWT; API keys and impersonation are rejected.\n * Keys contain 1–128 ASCII letters, digits, dots, underscores or hyphens.\n * Unknown widget IDs and their order are preserved; consumers choose what to render.\n */\n async getPreference(key: string): Promise<UserPreferenceResponse> {\n return this.request('GET', `/user/preferences/${encodeURIComponent(key)}`);\n }\n\n /**\n * Save one own preference: omitted/false if_absent replaces it (last write wins);\n * true preserves an existing object and returns the winner. The JSON object is\n * limited to 16 KiB of compact UTF-8 JSON. For layouts, use one namespaced key\n * per page (e.g. merchant.analytics.payments) and ordered widget IDs per region,\n * without titles, fetched metrics or rendered state. Requires a login JWT.\n */\n async setPreference(\n key: string,\n params: SetUserPreferenceRequest,\n ): Promise<UserPreferenceResponse> {\n return this.request('PUT', `/user/preferences/${encodeURIComponent(key)}`, { body: params });\n }\n\n /**\n * Initialize only a missing preference. Existing objects, including a client\n * reset marker saved with setPreference (for example { reset: true }), win. Render/cache the returned value, which may differ from\n * the proposed value. Safe for migration retries after a lost response.\n * Explicit edits and reset markers use setPreference with no if_absent flag.\n * DELETE removes the key; it leaves no marker and permits initialization again.\n * Requires a login JWT and the same key/object limits as setPreference.\n */\n async initializePreference(\n key: string,\n value: Record<string, unknown>,\n ): Promise<UserPreferenceResponse> {\n return this.request('PUT', `/user/preferences/${encodeURIComponent(key)}`, {\n body: { value, if_absent: true },\n });\n }\n\n /**\n * Remove an own preference. Idempotent; returns value null, without storing a\n * tombstone. Later initialization may import a value again. To suppress legacy\n * migration after a reset, save a client reset-marker object with setPreference.\n * Login JWT only.\n */\n async deletePreference(key: string): Promise<UserPreferenceResponse> {\n return this.request('DELETE', `/user/preferences/${encodeURIComponent(key)}`);\n }\n\n /**\n * The caller's guided dashboard tour in the session's scope: their progress,\n * whether to offer the tour now, and their current and acknowledged access.\n * Progress is kept per merchant, or per shop for a user whose role is limited\n * to shops; the scope comes from the session. Login JWT only.\n *\n * `GET /user/dashboard-tour`\n */\n async getDashboardTour(): Promise<DashboardTourResponse> {\n return this.request('GET', '/user/dashboard-tour');\n }\n\n /**\n * Save the caller's tour progress in the session's scope and return the same\n * body as {@link Users.getDashboardTour}. `completed` and `skipped` are added\n * to the stored ones unless `restart` is set; `active`, `baseline` and\n * `offer_handled_at` replace them. `acknowledge_access: true` stores the\n * access the server computes as acknowledged. Unknown fields, malformed step\n * ids or baselines, and more than 300 steps per list are refused; so is any\n * save while acting as another user (`read_only`). Login JWT only.\n *\n * `PUT /user/dashboard-tour`\n */\n async updateDashboardTour(params: UpdateDashboardTourRequest): Promise<DashboardTourResponse> {\n return this.request('PUT', '/user/dashboard-tour', { body: params });\n }\n\n /**\n * RFC 7396 merge-patch the caller's own user-scoped metadata bucket.\n * Returns the full user details, so callers can refresh their context\n * without a second fetch.\n *\n * `PATCH /user/metadata`\n */\n async updateMetadata(params: UpdateMetadataRequest): Promise<UserResponse> {\n return this.request('PATCH', '/user/metadata', { body: params });\n }\n\n /**\n * RFC 7396 merge-patch the merchant-scoped metadata bucket shared by\n * every dashboard user of the merchant. Same response contract as\n * {@link Users.updateMetadata}.\n *\n * `PATCH /user/merchant/metadata`\n */\n async updateMerchantMetadata(params: UpdateMetadataRequest): Promise<UserResponse> {\n return this.request('PATCH', '/user/merchant/metadata', { body: params });\n }\n\n /**\n * Permanently delete the caller's account. Requires a fresh password\n * (and a current 6-digit TOTP code if the user has TOTP enrolled). On\n * success all role assignments are removed, the user record is\n * deactivated, and all in-flight sessions are invalidated. The caller\n * should clear local credentials and route to the login page.\n *\n * Returns `InvalidDeleteOperation` when the caller is the sole\n * owner-level admin of an org / merchant / profile -- they must\n * transfer ownership first.\n */\n async deleteAccount(params: DeleteAccountRequest): Promise<Record<string, unknown>> {\n return this.request('DELETE', '/user/account', { body: params });\n }\n\n async changePassword(params: ChangePasswordRequest): Promise<UserResponse> {\n return this.request('POST', '/user/change-password', { body: params });\n }\n\n async rotatePassword(params: ResetPasswordRequest): Promise<UserResponse> {\n return this.request('POST', '/user/rotate-password', { body: params });\n }\n\n async forgotPassword(params: ForgotPasswordRequest): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/forgot-password', { body: params });\n }\n\n /**\n * Commit a password reset.\n *\n * The caller is responsible for obtaining a `SinglePurposeToken` with\n * `purpose: reset_password` via the email-token exchange + TOTP flow\n * (see `fromEmail`, `beginTotp`, `updateTotp`/`verifyTotp`,\n * `generateRecoveryCodes`, `terminate2fa`) and setting it on the client\n * via `setJwtToken` before calling this method. `body.token` must still\n * be the original `EmailToken` from the reset-link URL — the handler\n * decodes it a second time to find the user.\n */\n async resetPassword(params: ResetPasswordRequest): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/reset-password', { body: params });\n }\n\n /**\n * Exchange an email-link token (`EmailToken`) for a single-purpose JWT\n * that drives the next step of the flow (TOTP, verify email, accept\n * invitation, etc.). No authentication required.\n *\n * The `token_type` in the response tells you which step to run next.\n */\n async fromEmail(params: FromEmailRequest): Promise<TokenResponse> {\n return this.request('POST', '/user/from-email', { body: params });\n }\n\n async verifyEmail(params: Record<string, unknown>): Promise<AuthResponse> {\n return this.request('POST', '/user/verify-email', { body: params });\n }\n\n async sendVerificationEmail(params: ForgotPasswordRequest): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/verify-email-request', { body: params });\n }\n\n async createMerchant(params: Record<string, unknown>): Promise<AuthResponse> {\n return this.request('POST', '/user/create-merchant', { body: params });\n }\n\n async switchMerchant(params: SwitchMerchantRequest): Promise<AuthResponse> {\n return this.request('POST', '/user/switch/merchant', { body: params });\n }\n\n async switchProfile(params: SwitchProfileRequest): Promise<AuthResponse> {\n return this.request('POST', '/user/switch/profile', { body: params });\n }\n\n async listMerchants(): Promise<Record<string, unknown>[]> {\n return this.request('GET', '/user/list/merchant');\n }\n\n async listProfiles(): Promise<Record<string, unknown>[]> {\n return this.request('GET', '/user/list/profile');\n }\n\n /**\n * Invite team members by email. `POST /user/employees/invite`\n *\n * `project_ids` grants a shop-level role on every shop of each project, once\n * the invitation is accepted. A refusal of `project_ids` is a `UR_23` error whose `data.reason` is one of\n * `project_not_in_merchant`, `role_not_grantable_on_project`,\n * `shop_in_granted_project`, `project_already_granted` or\n * `project_grant_requires_merchant_level`.\n */\n async inviteUsers(params: InviteUsersRequest[]): Promise<InviteUsersResponse[]> {\n return this.request('POST', '/user/employees/invite', { body: params });\n }\n\n /**\n * Add a team member directly, without sending an invite email.\n * `POST /user/employees/add`\n *\n * Unlike `inviteUsers`, the account is active immediately and you hand over\n * the credentials yourself. Omit `password` to have the server generate one\n * and return it once in `password` on the response; supply your own and it is\n * not echoed back. Either way the member must change it on first sign-in.\n *\n * Same role rules as invite: you cannot grant a role above your own, and a\n * shop-scoped caller can only target their own shop. `project_ids` grants a\n * shop-level role on every shop of each project. A refusal of `project_ids` is a `UR_23` error whose `data.reason` is one of\n * `project_not_in_merchant`, `role_not_grantable_on_project`,\n * `shop_in_granted_project`, `project_already_granted` or\n * `project_grant_requires_merchant_level`.\n */\n async addUser(params: AddUserRequest): Promise<AddUserResponse> {\n return this.request('POST', '/user/employees/add', { body: params });\n }\n\n /**\n * Impersonate one of your own team members — `POST /user/employees/impersonate`.\n *\n * Mints a session token **as** the given member, so the dashboard renders\n * exactly what they see (useful for support and role verification). The\n * caller needs the *Impersonation* permission, and the member's role must\n * either rank **strictly below** the caller's\n * (`Profile < Merchant < Organization`), or sit at the caller's own\n * merchant-or-higher level and be **strictly narrower** than the caller's\n * role (grant nothing the caller's role does not, and less in total). The\n * server rejects self-impersonation and cross-merchant targets.\n * `MinimalRoleInfo.can_impersonate` in `listUsersInLineage` answers the same rule\n * per binding, so a UI can offer the action only where it will succeed.\n *\n * A role refusal is a `UR_33` error whose `data.reason` names the rule:\n * `impersonation_target_not_narrower` (the member's role is above, equal to,\n * or not contained in the caller's), or `act_as_token_cannot_impersonate`\n * (the caller is itself signed in as another member — start from your own\n * session).\n *\n * The returned token is tab-scoped by design: open it in a fresh tab (e.g.\n * `/auth/impersonate?token=…`) rather than replacing the caller's own\n * session. No auth cookie is set on the response.\n */\n async impersonateEmployee(params: ImpersonateEmployeeRequest): Promise<TokenResponse> {\n return this.request('POST', '/user/employees/impersonate', { body: params });\n }\n\n async acceptInvitation(params: Record<string, unknown>): Promise<AuthResponse> {\n return this.request('POST', '/user/employees/invite/accept', { body: params });\n }\n\n /**\n * Accept invitations before a session exists.\n *\n * Sign-in issues a `token_type: \"accept_invite\"` step token instead of a\n * session when the caller has no active role yet — every role is still an\n * unaccepted invitation. With that token set via `setJwtToken`, pass the\n * entities from `listInvitations` here; the response is the next step of\n * the sign-in flow (`user_info` for the session, or `force_set_password`\n * first). Rejected when none of the entities carries a pending invitation.\n */\n async acceptInvitationsPreAuth(params: AcceptInvitationsPreAuthRequest): Promise<TokenResponse> {\n return this.request('POST', '/user/employees/invite/accept/pre-auth', { body: params });\n }\n\n /**\n * Accept an invitation via the email-link flow.\n *\n * Caller must already hold a `SinglePurposeToken` with\n * `purpose: accept_invitation_from_email` (obtained via `fromEmail` + any\n * required TOTP step) and have set it on the client via `setJwtToken`.\n * `body.token` must still be the original `EmailToken` from the\n * invite-link URL — the handler decodes it a second time to find the\n * invitee and the entity lineage.\n */\n async acceptInviteFromEmail(params: FromEmailRequest): Promise<AuthResponse> {\n return this.request('POST', '/user/accept-invite-from-email', { body: params });\n }\n\n /**\n * Start TOTP setup (or no-op if already set).\n *\n * Returns the QR-code payload when the user has no TOTP configured yet;\n * returns `{ secret: null }` when the user is already set up (caller\n * should then prompt for a 6-digit code and call `verifyTotp`).\n *\n * Requires `Authorization: Bearer <SPT{purpose:totp}>`.\n */\n async beginTotp(): Promise<TotpResponse> {\n return this.request('GET', '/user/2fa/totp/begin');\n }\n\n /**\n * Verify a 6-digit TOTP code for a user whose TOTP is already set up.\n * Marks the code as used in Redis so subsequent flow steps can advance.\n *\n * Requires `Authorization: Bearer <SPT{purpose:totp}>`.\n */\n async verifyTotp(params: VerifyTotpRequest): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/2fa/totp/verify', { body: params });\n }\n\n async resetTotp(): Promise<Record<string, unknown>> {\n return this.request('GET', '/user/2fa/totp/reset');\n }\n\n async generateRecoveryCodes(): Promise<RecoveryCodesResponse> {\n return this.request('GET', '/user/2fa/recovery-code/generate');\n }\n\n async verifyRecoveryCode(params: Record<string, unknown>): Promise<AuthResponse> {\n return this.request('POST', '/user/2fa/recovery-code/verify', { body: params });\n }\n\n async sendPhoneOtp(params: PhoneOtpRequest): Promise<PhoneOtpResponse> {\n return this.request('POST', '/user/phone/send-otp', { body: params });\n }\n\n async verifyPhoneOtp(params: PhoneOtpVerifyRequest): Promise<PhoneOtpVerifyResponse> {\n return this.request('POST', '/user/phone/verify-otp', { body: params });\n }\n\n /**\n * List all roles visible to the caller (predefined + custom).\n *\n * `GET /user/role/list`. With `groups: true` the response is the\n * parent-groups shape: `[{role_id, role_name, entity_type, role_scope,\n * parent_groups: [{name, description, scopes}]}]`; without it, the\n * deprecated flat `groups` shape.\n *\n * Each role carries `managed_centrally: true` when it is a shared role the\n * platform offers this merchant: it can be assigned, but `updateRole`,\n * `deleteRole` and `updateRoleConnectors` refuse it with `UR_71`\n * (`data.reason: 'managed_centrally'`).\n */\n async listRoles(params?: {\n groups?: boolean;\n entity_type?: string;\n }): Promise<Record<string, unknown>[]> {\n if (params === undefined) {\n return this.request('GET', '/user/role/list');\n }\n return this.request('GET', '/user/role/list', {\n query: { groups: params.groups, entity_type: params.entity_type },\n });\n }\n\n /**\n * The roles a member holds, one entry per role. `POST /user/employees`\n *\n * A project-level role carries `project`: it applies to every shop of that\n * project.\n */\n async listUserRoles(params?: Record<string, unknown>): Promise<GetUserRoleDetailsResponse[]> {\n return this.request('POST', '/user/employees', { body: params });\n }\n\n /**\n * The current role's explicit payment-data policy, or `null` when the role\n * retains its pre-control access. A dashboard hint: every API response\n * enforces the same policy on its own. `GET /user/role/payment-visibility`\n */\n async getRolePaymentVisibility(): Promise<RolePaymentVisibilityPolicy | null> {\n return this.request('GET', '/user/role/payment-visibility');\n }\n\n /**\n * Change a team member's role. `POST /user/employees/update-role`\n *\n * Pass `profile_id` to name the shop when managing a shop's team as a\n * merchant-scoped admin — see {@link UpdateUserRoleRequest.profile_id}.\n */\n async updateUserRole(params: UpdateUserRoleRequest): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/employees/update-role', { body: params });\n }\n\n /**\n * Remove a team member. `DELETE /user/employees/delete`\n *\n * Pass `profile_id` to name the shop when managing a shop's team as a\n * merchant-scoped admin — see {@link DeleteUserRoleRequest.profile_id}. Pass\n * `project_id` instead to remove a project-level role, which the member then\n * loses on every shop of the project.\n */\n async deleteUserRole(params: DeleteUserRoleRequest): Promise<Record<string, unknown>> {\n return this.request('DELETE', '/user/employees/delete', { body: params });\n }\n\n /**\n * Move a team member between a merchant-level role and shop-level roles.\n * `POST /user/employees/change-scope`\n *\n * A merchant-level `role_id` takes no `profile_ids` or `project_ids`; a\n * shop-level one needs at least one shop or project. A project grants the\n * role on every shop of the project, including shops added later. Every\n * earlier merchant-, project- and shop-level binding of the member in your\n * merchant is replaced. When the change takes a scope away, the\n * member's sessions end (`sessions_revoked: true`). Needs a caller at\n * merchant level or above. A refusal is a `UR_23` error whose `data.reason`\n * names the rule; an unknown `role_id` is `UR_22`. The project rules add the\n * reasons `project_not_in_merchant`, `role_not_grantable_on_project`,\n * `shop_in_granted_project`, `project_already_granted` and\n * `project_grant_requires_merchant_level`.\n */\n async changeMemberScope(params: ChangeMemberScopeRequest): Promise<ChangeMemberScopeResponse> {\n return this.request('POST', '/user/employees/change-scope', { body: params });\n }\n\n /**\n * Set or clear when a team member's access to your merchant ends.\n * `POST /user/employees/update-expiry`\n *\n * Every merchant-, shop- and project-level role the member holds in your\n * merchant, accepted or still an invitation, gets the same `expires_at`.\n * From that instant the roles grant nothing: every request, sign-in, token\n * refresh and switch made with them is refused, and `listUsersInLineage`\n * reports the instant in `MinimalRoleInfo.expires_at`. Send `null` to remove\n * the expiry. A shop-level caller reaches only members whose every role is\n * on its own shop. A refusal is a `UR_70` error whose `data` is an\n * {@link AccessExpiryRefusal}.\n */\n async updateMemberExpiry(params: UpdateMemberExpiryRequest): Promise<UpdateMemberExpiryResponse> {\n return this.request('POST', '/user/employees/update-expiry', { body: params });\n }\n\n /**\n * Create a reusable team invitation link. `POST /user/employees/invitation-links`\n *\n * Each person who joins through it gets `role_id` on the target, up to\n * `max_uses` people, until `expires_at`, and only from the networks and\n * countries `restrictions` allow. Creating it grants nothing and sends\n * nothing. You may grant only what you could invite with; a shop-level\n * caller only for its own shop. The secret to share comes back once, in\n * `token`. A refusal is a `UR_72` error whose `data` is an `InvitationLinkRefusal`.\n */\n async createInvitationLink(\n params: CreateInvitationLinkRequest,\n ): Promise<CreateInvitationLinkResponse> {\n return this.request('POST', '/user/employees/invitation-links', { body: params });\n }\n\n /**\n * Your merchant's team invitation links, newest first, with their usage and\n * status. A shop-level caller sees its own shop's.\n * `GET /user/employees/invitation-links`\n */\n async listInvitationLinks(): Promise<ListInvitationLinksResponse> {\n return this.request('GET', '/user/employees/invitation-links');\n }\n\n /**\n * Change a link's name, limit, expiry, access expiry or restrictions.\n * `PUT /user/employees/invitation-links/{link_id}`\n *\n * Send the whole policy and the `modified_at` you read as `version`. Saving\n * also reconfirms the link under your authority.\n */\n async updateInvitationLink(\n linkId: string,\n params: UpdateInvitationLinkRequest,\n ): Promise<InvitationLinkResponse> {\n return this.request('PUT', `/user/employees/invitation-links/${encodeURIComponent(linkId)}`, {\n body: params,\n });\n }\n\n /**\n * Revoke a link: nobody joins through it from now on, and who already\n * joined keeps their access. Revoking a revoked link answers it unchanged.\n * `POST /user/employees/invitation-links/{link_id}/revoke`\n */\n async revokeInvitationLink(linkId: string): Promise<InvitationLinkResponse> {\n return this.request(\n 'POST',\n `/user/employees/invitation-links/${encodeURIComponent(linkId)}/revoke`,\n );\n }\n\n /**\n * What a shared link offers, before joining. No authentication; grants\n * nothing. `POST /user/invitation-link/preview`\n */\n async previewInvitationLink(token: string): Promise<InvitationLinkPreviewResponse> {\n return this.request('POST', '/user/invitation-link/preview', { body: { token } });\n }\n\n /**\n * Join through a shared link from a signed-in session.\n * `POST /user/invitation-link/join`\n *\n * Needs a verified email address. Joining twice answers `already_member`\n * and uses no second place.\n */\n async joinInvitationLink(token: string): Promise<JoinInvitationLinkResponse> {\n return this.request('POST', '/user/invitation-link/join', { body: { token } });\n }\n\n /**\n * Join through a shared link during sign-in, for someone who holds no access\n * yet: call it with the `accept_invite` single-purpose token set on the\n * client. Answers the token for the next sign-in step.\n * `POST /user/invitation-link/join/pre-auth`\n */\n async joinInvitationLinkPreAuth(token: string): Promise<JoinInvitationLinkPreAuthResponse> {\n return this.request('POST', '/user/invitation-link/join/pre-auth', { body: { token } });\n }\n\n /**\n * Make an account through a shared link, for someone who has none. No\n * authentication. The account holds no access: its owner verifies the\n * address from the email this sends, signs in and joins.\n * `POST /user/invitation-link/register`\n */\n async registerThroughInvitationLink(\n params: RegisterThroughInvitationLinkRequest,\n ): Promise<RegisterThroughInvitationLinkResponse> {\n return this.request('POST', '/user/invitation-link/register', { body: params });\n }\n\n /**\n * One member of your merchant, with the person fields the member list\n * omits. `GET /user/employees/{user_id}/details`\n *\n * Answers only for a member `listUsersInLineage` shows you. Any other id,\n * unknown or not yours, is a 404 `UR_68` with `data.reason:\n * 'member_not_found'`.\n */\n async getTeamMemberDetails(userId: string): Promise<TeamMemberDetails> {\n return this.request('GET', `/user/employees/${encodeURIComponent(userId)}/details`);\n }\n\n /**\n * Supplied contacts and internal notes for a visible member in the current\n * merchant. Requires a session JWT and Users read permission. The returned\n * revision is required even for the first write; can_edit states write access.\n * An unknown or invisible member is refused with the same 404 UR_68 response.\n */\n async getTeamMemberContactProfile(userId: string): Promise<TeamMemberContactProfileResponse> {\n return this.request('GET', `/user/employees/${encodeURIComponent(userId)}/contact-profile`);\n }\n\n /**\n * Replace the supplied contacts, preserving notes and login/recovery identity.\n * Omitted optional contact fields are cleared. Requires Users write permission\n * and authority over the whole member. Send the exact last-read revision.\n * On a changed refusal, keep the draft and read again before resubmitting.\n * Structured UR_68 data is a TeamMemberRefusal with reason contact_profile.\n */\n async updateTeamMemberContacts(\n userId: string,\n params: UpdateTeamMemberContactsRequest,\n ): Promise<TeamMemberContactProfileResponse> {\n return this.request('PUT', `/user/employees/${encodeURIComponent(userId)}/contact-profile`, {\n body: params,\n });\n }\n\n /** Create a plain-text note with server-authored attribution; requires the current revision. */\n async createTeamMemberNote(\n userId: string,\n params: WriteTeamMemberNoteRequest,\n ): Promise<TeamMemberContactProfileResponse> {\n return this.request('POST', `/user/employees/${encodeURIComponent(userId)}/notes`, {\n body: params,\n });\n }\n\n /** Edit one note, retaining its original author and creation time. Uses the same write scope. */\n async updateTeamMemberNote(\n userId: string,\n noteId: string,\n params: WriteTeamMemberNoteRequest,\n ): Promise<TeamMemberContactProfileResponse> {\n return this.request(\n 'PUT',\n `/user/employees/${encodeURIComponent(userId)}/notes/${encodeURIComponent(noteId)}`,\n { body: params },\n );\n }\n\n /**\n * Delete only the named member note. The exact profile revision is sent in the\n * query; contacts and all other notes remain. Returns the new profile revision.\n */\n async deleteTeamMemberNote(\n userId: string,\n noteId: string,\n params: DeleteTeamMemberNoteRequest,\n ): Promise<TeamMemberContactProfileResponse> {\n return this.request(\n 'DELETE',\n `/user/employees/${encodeURIComponent(userId)}/notes/${encodeURIComponent(noteId)}`,\n { query: { expected_revision: params.expected_revision } },\n );\n }\n\n /**\n * Replace a team member's password with a temporary one, returned once.\n * `POST /user/employees/{user_id}/reset-password`\n *\n * Needs the *Users* write permission and the *Impersonation* permission,\n * and the member must be one you could sign in as with\n * `impersonateEmployee`. The member's sessions end, and their next sign-in\n * asks them to choose a new password. Two-factor authentication is left as\n * it is. `TeamMemberDetails.can_reset_password` answers the same rule. A\n * refusal is a `UR_68` error whose `data` is a {@link TeamMemberRefusal}.\n */\n async resetTeamMemberPassword(\n userId: string,\n params: ResetTeamMemberPasswordRequest,\n ): Promise<ResetTeamMemberPasswordResponse> {\n return this.request('POST', `/user/employees/${encodeURIComponent(userId)}/reset-password`, {\n body: params,\n });\n }\n\n /**\n * One team member's sign-in history: successes and failures with method,\n * address, location and device, filtered, sorted and paged as\n * `listLoginActivity` is. `GET /user/employees/{user_id}/login-activity`\n *\n * Needs the *Users* write permission. Answers only for a member\n * `listUsersInLineage` shows you; any other id is a 404 `UR_68` with\n * `data.reason: 'member_not_found'`. Sign-ins belong to the account, so\n * they are shown only for an account wholly in this merchant: refused with\n * a 400 `UR_68` `member_has_access_elsewhere` for an account that also\n * holds a role elsewhere, and `member_not_activated` for one that is only\n * invited. `TeamMemberDetails.can_view_sign_ins` answers the same rule.\n */\n async listTeamMemberLoginActivity(\n userId: string,\n params?: LoginHistoryParams,\n ): Promise<LoginHistoryResponse> {\n const path = `/user/employees/${encodeURIComponent(userId)}/login-activity`;\n if (params === undefined) {\n return this.request('GET', path);\n }\n return this.request('GET', path, {\n query: csvQuery(params, ['event_type', 'auth_method']),\n });\n }\n\n /**\n * One team member's live sessions: neither signed out nor expired.\n * `is_current` marks the caller's own session only.\n * `GET /user/employees/{user_id}/sessions`\n *\n * Same permission and refusals as `listTeamMemberLoginActivity`.\n */\n async listTeamMemberSessions(userId: string): Promise<UserSessionListResponse> {\n return this.request('GET', `/user/employees/${encodeURIComponent(userId)}/sessions`);\n }\n\n /**\n * Sign a team member out everywhere: ends every session and token of the\n * member, at this merchant and at every other merchant the account belongs\n * to. `POST /user/employees/{user_id}/sessions/revoke-all`\n *\n * The account stays active and its password unchanged, so the member can\n * sign in again at once. Allowed on exactly the members whose password you\n * may reset with `resetTeamMemberPassword`, and refused with the same\n * `UR_68` reasons ({@link TeamMemberRefusal}).\n * `TeamMemberDetails.can_sign_out` answers the same rule. Recorded in the\n * audit log.\n */\n async revokeTeamMemberSessions(userId: string): Promise<AdminRevokeUserSessionsResponse> {\n return this.request(\n 'POST',\n `/user/employees/${encodeURIComponent(userId)}/sessions/revoke-all`,\n );\n }\n\n /**\n * Which checkout payment methods a member may change in your merchant.\n * `GET /user/employees/{user_id}/method-access`\n *\n * Needs the *Users* read permission, and answers only for a member\n * `listUsersInLineage` shows you (any other id is a 404 `UR_68` with\n * `data.reason: 'member_not_found'`). `can_edit` says whether you may\n * change it; `grant_all` and `grantable` say which methods you may grant.\n */\n async getMemberMethodAccess(userId: string): Promise<MemberMethodAccessResponse> {\n return this.request('GET', `/user/employees/${encodeURIComponent(userId)}/method-access`);\n }\n\n /**\n * Limit a member to some checkout payment methods, or give every method\n * back. `PUT /user/employees/{user_id}/method-access`\n *\n * Needs the *Connectors* edit and *Payment methods* write permissions and a\n * member within your reach, other than yourself. A caller limited itself\n * grants only within its own limit. The change is audited and applies to\n * the member's next request. A refusal is a `UR_68` whose `data` is\n * `{ reason: 'method_access', refusal }` (see {@link MethodAccessRefusal}).\n */\n async updateMemberMethodAccess(\n userId: string,\n params: UpdateMemberMethodAccessRequest,\n ): Promise<MemberMethodAccessResponse> {\n return this.request('PUT', `/user/employees/${encodeURIComponent(userId)}/method-access`, {\n body: params,\n });\n }\n\n /**\n * A member's permission overrides in your merchant: every area that can be\n * overridden at their level, with what their roles give, the level set for\n * them, and what they have. `GET /user/employees/{user_id}/permission-overrides`\n *\n * Needs the *Users* read permission, and answers only for a member\n * `listUsersInLineage` shows you (any other id is a 404 `UR_68`).\n * `can_edit`, `can_raise` and each area's `grantable_level` say what you\n * may change.\n */\n async getMemberPermissionOverrides(userId: string): Promise<MemberPermissionOverridesResponse> {\n return this.request(\n 'GET',\n `/user/employees/${encodeURIComponent(userId)}/permission-overrides`,\n );\n }\n\n /**\n * Replace a member's permission overrides. An area left out goes back to\n * what their roles give. `PUT /user/employees/{user_id}/permission-overrides`\n *\n * Needs the *Users* write permission and a member within your reach, other\n * than yourself. Keeping or lowering is always allowed; a gain must stay\n * within what you hold in that area, and a gain above the member's roles\n * needs `can_raise`. The change is audited and applies to the member's next\n * request. A refusal is a `UR_68` whose `data` is\n * `{ reason: 'permission_overrides', refusal }` (see\n * {@link PermissionOverrideRefusal}).\n */\n async updateMemberPermissionOverrides(\n userId: string,\n params: UpdateMemberPermissionOverridesRequest,\n ): Promise<MemberPermissionOverridesResponse> {\n return this.request(\n 'PUT',\n `/user/employees/${encodeURIComponent(userId)}/permission-overrides`,\n { body: params },\n );\n }\n\n /**\n * The permission overrides your own session acts under, sorted by area.\n * An area named here has exactly that level, whatever a broader legacy area\n * of the role would suggest. `GET /user/role/permission-overrides`\n */\n async getOwnPermissionOverrides(): Promise<PermissionOverride[]> {\n return this.request('GET', '/user/role/permission-overrides');\n }\n\n /** Sign in via OIDC. `POST /user/oidc` */\n async signInOidc(params: Record<string, unknown>): Promise<AuthResponse> {\n return this.request('POST', '/user/oidc', { body: params });\n }\n\n /** Transfer key. `POST /user/key/transfer` */\n async transferKey(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/key/transfer', { body: params });\n }\n\n /**\n * Invitations still waiting on the caller. `GET /user/list/invitation`\n *\n * Accepts an `accept_invite` step token as well as a session JWT, so it\n * can feed `acceptInvitationsPreAuth` during sign-in. An invitation to a\n * project carries `project_id`; pass it back unchanged when accepting.\n */\n async listInvitations(): Promise<UserInvitation[]> {\n return this.request('GET', '/user/list/invitation');\n }\n\n /** Check 2FA status. `GET /user/2fa` */\n async check2faStatus(): Promise<Record<string, unknown>> {\n return this.request('GET', '/user/2fa');\n }\n\n /**\n * Finish first-time TOTP setup: commit the secret generated by `beginTotp`\n * against a 6-digit code from the user's authenticator app.\n *\n * `PUT /user/2fa/totp/verify`. Requires `Authorization: Bearer <SPT{purpose:totp}>`.\n */\n async updateTotp(params: VerifyTotpRequest): Promise<Record<string, unknown>> {\n return this.request('PUT', '/user/2fa/totp/verify', { body: params });\n }\n\n /**\n * Complete the TOTP step and advance to the next flow stage (e.g.\n * `reset_password`). Returns a fresh single-purpose token with the\n * next `token_type`.\n *\n * `GET /user/2fa/terminate`. Requires `Authorization: Bearer <SPT{purpose:totp}>`.\n */\n async terminate2fa(query?: Terminate2faQueryParams): Promise<TokenResponse> {\n if (query === undefined) {\n return this.request('GET', '/user/2fa/terminate');\n }\n return this.request('GET', '/user/2fa/terminate', {\n query: query as Record<string, boolean | undefined>,\n });\n }\n\n /** Create auth method. `POST /user/auth` */\n async createAuthMethod(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/auth', { body: params });\n }\n\n /** Update auth method. `PUT /user/auth` */\n async updateAuthMethod(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('PUT', '/user/auth', { body: params });\n }\n\n /** List auth methods. `GET /user/auth/list` */\n async listAuthMethods(): Promise<Record<string, unknown>[]> {\n return this.request('GET', '/user/auth/list');\n }\n\n /** Get auth URL. `GET /user/auth/url` */\n async getAuthUrl(): Promise<Record<string, unknown>> {\n return this.request('GET', '/user/auth/url');\n }\n\n /** Select auth method. `POST /user/auth/select` */\n async selectAuth(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/auth/select', { body: params });\n }\n\n /**\n * List users in lineage.\n *\n * Needs the Users *view* grant now — the response carries colleagues' email\n * addresses, so a role without it is refused rather than handed a roster.\n * A shop-scoped role keeps reading its own shop's members.\n *\n * `GET /user/employees/list`\n */\n async listUsersInLineage(params?: ListUsersInLineageParams): Promise<UserInLineage[]> {\n return this.request('GET', '/user/employees/list', {\n query: params as Record<string, string | undefined> | undefined,\n });\n }\n\n /**\n * Send a pending member a new invitation link. `POST /user/resend-invite`\n *\n * The new link replaces the one before it, which stops working. It works\n * for `link_valid_for_days` days, 7 by default. Works for any pending member\n * `listUsersInLineage` shows you. A refusal is a `UR_68` error\n * (`no_pending_invitation`, `invite_link_validity_out_of_range`) or a\n * `UR_70` `invitation_expired` when the access the invitation offers has\n * ended.\n */\n async resendInvite(params: ReInviteUserRequest): Promise<ReInviteUserResponse> {\n return this.request('POST', '/user/resend-invite', { body: params });\n }\n\n /**\n * A pending member's current invitation link, or why it is not shown.\n * `GET /user/employees/{user_id}/invite-link`\n *\n * Only the link of an account the invitation created, that nobody has used\n * since, is returned: the link signs its holder in without a password. Every\n * link returned is audited. Needs team write access.\n */\n async getInviteLink(userId: string): Promise<InviteLinkResponse> {\n return this.request('GET', `/user/employees/${encodeURIComponent(userId)}/invite-link`);\n }\n\n /**\n * Get the caller's parent permission groups + scopes.\n *\n * `GET /user/role`\n */\n async getRolePermissions(): Promise<ParentGroupInfo[]> {\n return this.request('GET', '/user/role');\n }\n\n /**\n * List invitable roles. `GET /user/role/list/invite`\n *\n * @param params - Optional query. `entity_type` scopes the role list to a\n * particular entity (e.g. `'merchant'` to list only merchant-scoped roles\n * when inviting employees from the merchant dashboard).\n */\n async listInvitableRoles(params?: ListInvitableRolesParams): Promise<Record<string, unknown>[]> {\n if (params === undefined || params.entity_type === undefined) {\n return this.request('GET', '/user/role/list/invite');\n }\n return this.request('GET', '/user/role/list/invite', {\n query: { entity_type: params.entity_type },\n });\n }\n\n /** List updatable roles. `GET /user/role/list/update` */\n async listUpdatableRoles(): Promise<Record<string, unknown>[]> {\n return this.request('GET', '/user/role/list/update');\n }\n\n /** Get parent list. `GET /user/parent/list` */\n async getParentList(): Promise<Record<string, unknown>[]> {\n return this.request('GET', '/user/parent/list');\n }\n\n /** Create a role. `POST /user/role` */\n async createRole(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/role', { body: params });\n }\n\n /** Get role by ID. `GET /user/role/{roleId}` */\n async getRoleById(roleId: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/user/role/${encodeURIComponent(roleId)}`);\n }\n\n /** Update role by ID. `PUT /user/role/{roleId}` */\n async updateRole(\n roleId: string,\n params: Record<string, unknown>,\n options?: RequestExtras,\n ): Promise<Record<string, unknown>> {\n return this.request('PUT', `/user/role/${encodeURIComponent(roleId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Delete a custom role. Predefined roles and roles still assigned to\n * team members are rejected by the backend with a 400.\n *\n * `DELETE /user/role/{roleId}`\n */\n async deleteRole(roleId: string): Promise<Record<string, unknown>> {\n return this.request('DELETE', `/user/role/${encodeURIComponent(roleId)}`);\n }\n\n /**\n * Read which individual connector accounts a role may see.\n *\n * `GET /user/role/{roleId}/connectors`\n *\n * **Check `restricted` before reading `connectors`.** An empty list is\n * ambiguous by itself, so the backend states which case it is: `false` means\n * the role holds no grant and sees whatever its entity and profile scope\n * already allowed. Rendering an empty `connectors` array as \"this role sees\n * nothing\" inverts the meaning.\n *\n * Requires the permission that *edits a role*, not a connector permission.\n */\n async getRoleConnectors(roleId: string): Promise<RoleConnectorGrant> {\n return this.request('GET', `/user/role/${encodeURIComponent(roleId)}/connectors`);\n }\n\n /**\n * Replace the set of connector accounts a role may see.\n *\n * `PUT /user/role/{roleId}/connectors`\n *\n * The call **replaces** the whole set rather than adding to it, so send the\n * complete list every time. An empty `merchant_connector_ids` clears the\n * grant and returns the role to unrestricted.\n *\n * The backend refuses an id that is not a connector account of the caller's\n * own merchant, an `Organization`-scoped role (a connector account belongs to\n * exactly one merchant, so an org-spanning role cannot hold one coherently),\n * and any predefined role (one static entry shared by every tenant).\n *\n * Editing a grant invalidates the role cache and blacklists tokens minted\n * before the edit, so **users holding this role must sign in again**. Worth\n * saying in the UI before the save, not after.\n */\n async updateRoleConnectors(\n roleId: string,\n params: UpdateRoleConnectorGrantParams,\n ): Promise<RoleConnectorGrant> {\n return this.request('PUT', `/user/role/${encodeURIComponent(roleId)}/connectors`, {\n body: params,\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/tmp/w2pub474/delopay-typescript-sdk/dist/chunk-ZKPVUCQV.cjs","../src/resources/users.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACsFO,IAAM,MAAA,EAAN,MAAY;AAAA,EACjB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,MAAA,CAAO,MAAA,EAA0E;AACrF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,cAAA,EAAgB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC9D;AAAA,EAEA,MAAM,MAAA,CAAO,MAAA,EAA8C;AACzD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,cAAA,EAAgB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC9D;AAAA;AAAA,EAGA,MAAM,kBAAA,CAAA,EAA+D;AACnE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,uBAAuB,CAAA;AAAA,EACpD;AAAA;AAAA,EAGA,MAAM,wBAAA,CAAA,EAAqE;AACzE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,oBAAoB,CAAA;AAAA,EACjD;AAAA,EAEA,MAAM,gBAAA,CAAiB,MAAA,EAA0E;AAC/F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,mB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esContent":[null,"import type {\n AdminRevokeUserSessionsResponse,\n RolePaymentVisibilityPolicy,\n SignUpRequest,\n SignUpWithMerchantRequest,\n SignInRequest,\n DashboardOAuthProvider,\n DashboardOAuthProvidersResponse,\n DashboardOAuthStartRequest,\n DashboardOAuthLinkStartRequest,\n DashboardOAuthStartResponse,\n DashboardOAuthCompleteRequest,\n DashboardOAuthDisconnectRequest,\n AuthResponse,\n UserResponse,\n ChangePasswordRequest,\n DeleteAccountRequest,\n ForgotPasswordRequest,\n ResetPasswordRequest,\n SwitchMerchantRequest,\n SwitchProfileRequest,\n ImpersonateEmployeeRequest,\n InviteUsersRequest,\n InviteUsersResponse,\n AddUserRequest,\n AddUserResponse,\n UpdateUserRoleRequest,\n DeleteUserRoleRequest,\n ChangeMemberScopeRequest,\n ChangeMemberScopeResponse,\n UpdateMemberExpiryRequest,\n UpdateMemberExpiryResponse,\n GetUserRoleDetailsResponse,\n TeamMemberDetails,\n ReInviteUserRequest,\n ReInviteUserResponse,\n InviteLinkResponse,\n TeamMemberContactProfileResponse,\n UpdateTeamMemberContactsRequest,\n WriteTeamMemberNoteRequest,\n DeleteTeamMemberNoteRequest,\n MemberMethodAccessResponse,\n UpdateMemberMethodAccessRequest,\n MemberPermissionOverridesResponse,\n PermissionOverride,\n UpdateMemberPermissionOverridesRequest,\n ResetTeamMemberPasswordRequest,\n ResetTeamMemberPasswordResponse,\n TotpResponse,\n RecoveryCodesResponse,\n PhoneOtpRequest,\n PhoneOtpResponse,\n PhoneOtpVerifyRequest,\n PhoneOtpVerifyResponse,\n UpdateMetadataRequest,\n SetUserPreferenceRequest,\n UserPreferenceResponse,\n DashboardTourResponse,\n UpdateDashboardTourRequest,\n UpdateUserDetailsRequest,\n FromEmailRequest,\n TokenResponse,\n UserInvitation,\n AcceptInvitationsPreAuthRequest,\n VerifyTotpRequest,\n Terminate2faQueryParams,\n ListInvitableRolesParams,\n ListUsersInLineageParams,\n UserInLineage,\n LoginHistoryParams,\n LoginHistoryResponse,\n UserSessionListResponse,\n UserSessionRevokeResponse,\n ParentGroupInfo,\n RoleConnectorGrant,\n UpdateRoleConnectorGrantParams,\n CreateInvitationLinkRequest,\n CreateInvitationLinkResponse,\n InvitationLinkResponse,\n InvitationLinkPreviewResponse,\n ListInvitationLinksResponse,\n UpdateInvitationLinkRequest,\n JoinInvitationLinkResponse,\n JoinInvitationLinkPreAuthResponse,\n RegisterThroughInvitationLinkRequest,\n RegisterThroughInvitationLinkResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\nexport class Users {\n constructor(private readonly request: RequestFn) {}\n\n async signUp(params: SignUpRequest | SignUpWithMerchantRequest): Promise<AuthResponse> {\n return this.request('POST', '/user/signup', { body: params });\n }\n\n async signIn(params: SignInRequest): Promise<AuthResponse> {\n return this.request('POST', '/user/signin', { body: params });\n }\n\n /** Providers currently configured for dashboard sign-in. */\n async listOAuthProviders(): Promise<DashboardOAuthProvidersResponse> {\n return this.request('GET', '/user/oauth/providers');\n }\n\n /** Current account's links; disabled providers remain visible. */\n async listLinkedOAuthProviders(): Promise<DashboardOAuthProvidersResponse> {\n return this.request('GET', '/user/oauth/linked');\n }\n\n async startOAuthSignIn(params: DashboardOAuthStartRequest): Promise<DashboardOAuthStartResponse> {\n return this.request('POST', '/user/oauth/start', { body: params });\n }\n\n async startOAuthLink(\n params: DashboardOAuthLinkStartRequest,\n ): Promise<DashboardOAuthStartResponse> {\n return this.request('POST', '/user/oauth/link/start', { body: params });\n }\n\n async completeOAuthSignIn(params: DashboardOAuthCompleteRequest): Promise<AuthResponse> {\n return this.request('POST', '/user/oauth/complete', { body: params });\n }\n\n async completeOAuthLink(params: DashboardOAuthCompleteRequest): Promise<void> {\n return this.request('POST', '/user/oauth/link/complete', { body: params });\n }\n\n async disconnectOAuthProvider(\n provider: DashboardOAuthProvider,\n params: DashboardOAuthDisconnectRequest,\n ): Promise<void> {\n return this.request('DELETE', `/user/oauth/linked/${encodeURIComponent(provider)}`, {\n body: params,\n });\n }\n\n async signOut(): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/signout');\n }\n\n /**\n * Sliding-session refresh: exchange the current (still-valid) login JWT\n * for a fresh one with the same claims and a full lifetime. The backend\n * keeps the session's identity (`jti`), slides `user_session.expires_at`\n * forward and re-sets the `login_token` cookie.\n *\n * Requires a token backed by a revocable session (a `jti` claim). Signin\n * and switch-merchant/-profile tokens have one; **session-less tokens do\n * not and are rejected with 400** — team-impersonation tokens are the\n * case in practice, and they are deliberately tab-scoped and\n * time-bounded rather than renewable. A 400 here is not a dead session:\n * the token remains valid for ordinary calls, it simply cannot slide.\n *\n * Rejected (401) for expired, blacklisted or revoked tokens — refresh can\n * only extend a session that is still alive. Rate-limited server-side\n * (429) to one mint per session per minute; treat a 429 as \"still fresh\n * enough\", not as an error.\n *\n * The returned token is NOT applied to this client automatically — pass\n * it to `setJwtToken()`, or use {@link Delopay.refreshSession} which does\n * both.\n *\n * `POST /user/token/refresh`. Requires a logged-in JWT.\n */\n async refreshToken(): Promise<TokenResponse> {\n return this.request('POST', '/user/token/refresh');\n }\n\n /**\n * Paginated login history for the authenticated user -- IP, User-Agent,\n * country / city / lat-lon (when GeoIP is enabled), success and failure\n * events with their reasons. Strictly scoped to the JWT subject; a user\n * can only see their own activity.\n *\n * `GET /user/me/login-activity`. Requires a logged-in JWT.\n *\n * Returns an empty page when a Delopay admin is impersonating a merchant,\n * so the admin's metadata is not exposed inside the merchant dashboard.\n *\n * Newest first unless `sort_by` says otherwise. Several `event_type` or\n * `auth_method` values match an event with any of them.\n */\n async listLoginActivity(params?: LoginHistoryParams): Promise<LoginHistoryResponse> {\n if (params === undefined) {\n return this.request('GET', '/user/me/login-activity');\n }\n return this.request('GET', '/user/me/login-activity', {\n query: csvQuery(params, ['event_type', 'auth_method']),\n });\n }\n\n /**\n * List the authenticated user's currently-active dashboard sessions\n * (one row per minted login JWT that hasn't been revoked or expired).\n *\n * The row matching the JWT making this call has `is_current: true`,\n * which is what lets the dashboard render a \"This device\" tag.\n *\n * `GET /user/me/sessions`. Requires a logged-in JWT. Returns an empty\n * list when a Delopay admin is impersonating a non-admin merchant\n * (same guard as `listLoginActivity`).\n */\n async listActiveSessions(): Promise<UserSessionListResponse> {\n return this.request('GET', '/user/me/sessions');\n }\n\n /**\n * Disconnect one of the authenticated user's sessions. The matching\n * JWT is rejected on its next request — fast-path via Redis, fall back\n * to the persistent `revoked_at` column.\n *\n * Idempotent: revoking an already-revoked or unknown id returns 404,\n * which the caller can treat as success for retry purposes. Revoking\n * a session id that belongs to a different user also returns 404 —\n * the response intentionally doesn't leak whether the id exists.\n *\n * `POST /user/me/sessions/{sessionId}/revoke`.\n */\n async revokeSession(sessionId: string): Promise<UserSessionRevokeResponse> {\n return this.request('POST', `/user/me/sessions/${encodeURIComponent(sessionId)}/revoke`);\n }\n\n async getDetails(): Promise<UserResponse> {\n return this.request('GET', '/user');\n }\n\n async update(params: UpdateUserDetailsRequest, options?: RequestExtras): Promise<UserResponse> {\n return this.request('POST', '/user/update', { body: params, ...options });\n }\n\n /**\n * Read a preference owned by the logged-in user. Missing keys return value null.\n * Works in both dashboards with a login JWT; API keys and impersonation are rejected.\n * Keys contain 1–128 ASCII letters, digits, dots, underscores or hyphens.\n * Unknown widget IDs and their order are preserved; consumers choose what to render.\n */\n async getPreference(key: string): Promise<UserPreferenceResponse> {\n return this.request('GET', `/user/preferences/${encodeURIComponent(key)}`);\n }\n\n /**\n * Save one own preference: omitted/false if_absent replaces it (last write wins);\n * true preserves an existing object and returns the winner. The JSON object is\n * limited to 16 KiB of compact UTF-8 JSON. For layouts, use one namespaced key\n * per page (e.g. merchant.analytics.payments) and ordered widget IDs per region,\n * without titles, fetched metrics or rendered state. Requires a login JWT.\n */\n async setPreference(\n key: string,\n params: SetUserPreferenceRequest,\n ): Promise<UserPreferenceResponse> {\n return this.request('PUT', `/user/preferences/${encodeURIComponent(key)}`, { body: params });\n }\n\n /**\n * Initialize only a missing preference. Existing objects, including a client\n * reset marker saved with setPreference (for example { reset: true }), win. Render/cache the returned value, which may differ from\n * the proposed value. Safe for migration retries after a lost response.\n * Explicit edits and reset markers use setPreference with no if_absent flag.\n * DELETE removes the key; it leaves no marker and permits initialization again.\n * Requires a login JWT and the same key/object limits as setPreference.\n */\n async initializePreference(\n key: string,\n value: Record<string, unknown>,\n ): Promise<UserPreferenceResponse> {\n return this.request('PUT', `/user/preferences/${encodeURIComponent(key)}`, {\n body: { value, if_absent: true },\n });\n }\n\n /**\n * Remove an own preference. Idempotent; returns value null, without storing a\n * tombstone. Later initialization may import a value again. To suppress legacy\n * migration after a reset, save a client reset-marker object with setPreference.\n * Login JWT only.\n */\n async deletePreference(key: string): Promise<UserPreferenceResponse> {\n return this.request('DELETE', `/user/preferences/${encodeURIComponent(key)}`);\n }\n\n /**\n * The caller's guided dashboard tour in the session's scope: their progress,\n * whether to offer the tour now, and their current and acknowledged access.\n * Progress is kept per merchant, or per shop for a user whose role is limited\n * to shops; the scope comes from the session. Login JWT only.\n *\n * `GET /user/dashboard-tour`\n */\n async getDashboardTour(): Promise<DashboardTourResponse> {\n return this.request('GET', '/user/dashboard-tour');\n }\n\n /**\n * Save the caller's tour progress in the session's scope and return the same\n * body as {@link Users.getDashboardTour}. `completed` and `skipped` are added\n * to the stored ones unless `restart` is set; `active`, `baseline` and\n * `offer_handled_at` replace them. `acknowledge_access: true` stores the\n * access the server computes as acknowledged. Unknown fields, malformed step\n * ids or baselines, and more than 300 steps per list are refused; so is any\n * save while acting as another user (`read_only`). Login JWT only.\n *\n * `PUT /user/dashboard-tour`\n */\n async updateDashboardTour(params: UpdateDashboardTourRequest): Promise<DashboardTourResponse> {\n return this.request('PUT', '/user/dashboard-tour', { body: params });\n }\n\n /**\n * RFC 7396 merge-patch the caller's own user-scoped metadata bucket.\n * Returns the full user details, so callers can refresh their context\n * without a second fetch.\n *\n * `PATCH /user/metadata`\n */\n async updateMetadata(params: UpdateMetadataRequest): Promise<UserResponse> {\n return this.request('PATCH', '/user/metadata', { body: params });\n }\n\n /**\n * RFC 7396 merge-patch the merchant-scoped metadata bucket shared by\n * every dashboard user of the merchant. Same response contract as\n * {@link Users.updateMetadata}.\n *\n * `PATCH /user/merchant/metadata`\n */\n async updateMerchantMetadata(params: UpdateMetadataRequest): Promise<UserResponse> {\n return this.request('PATCH', '/user/merchant/metadata', { body: params });\n }\n\n /**\n * Permanently delete the caller's account. Requires a fresh password\n * (and a current 6-digit TOTP code if the user has TOTP enrolled). On\n * success all role assignments are removed, the user record is\n * deactivated, and all in-flight sessions are invalidated. The caller\n * should clear local credentials and route to the login page.\n *\n * Returns `InvalidDeleteOperation` when the caller is the sole\n * owner-level admin of an org / merchant / profile -- they must\n * transfer ownership first.\n */\n async deleteAccount(params: DeleteAccountRequest): Promise<Record<string, unknown>> {\n return this.request('DELETE', '/user/account', { body: params });\n }\n\n async changePassword(params: ChangePasswordRequest): Promise<UserResponse> {\n return this.request('POST', '/user/change-password', { body: params });\n }\n\n async rotatePassword(params: ResetPasswordRequest): Promise<UserResponse> {\n return this.request('POST', '/user/rotate-password', { body: params });\n }\n\n async forgotPassword(params: ForgotPasswordRequest): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/forgot-password', { body: params });\n }\n\n /**\n * Commit a password reset.\n *\n * The caller is responsible for obtaining a `SinglePurposeToken` with\n * `purpose: reset_password` via the email-token exchange + TOTP flow\n * (see `fromEmail`, `beginTotp`, `updateTotp`/`verifyTotp`,\n * `generateRecoveryCodes`, `terminate2fa`) and setting it on the client\n * via `setJwtToken` before calling this method. `body.token` must still\n * be the original `EmailToken` from the reset-link URL — the handler\n * decodes it a second time to find the user.\n */\n async resetPassword(params: ResetPasswordRequest): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/reset-password', { body: params });\n }\n\n /**\n * Exchange an email-link token (`EmailToken`) for a single-purpose JWT\n * that drives the next step of the flow (TOTP, verify email, accept\n * invitation, etc.). No authentication required.\n *\n * The `token_type` in the response tells you which step to run next.\n */\n async fromEmail(params: FromEmailRequest): Promise<TokenResponse> {\n return this.request('POST', '/user/from-email', { body: params });\n }\n\n async verifyEmail(params: Record<string, unknown>): Promise<AuthResponse> {\n return this.request('POST', '/user/verify-email', { body: params });\n }\n\n async sendVerificationEmail(params: ForgotPasswordRequest): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/verify-email-request', { body: params });\n }\n\n async createMerchant(params: Record<string, unknown>): Promise<AuthResponse> {\n return this.request('POST', '/user/create-merchant', { body: params });\n }\n\n async switchMerchant(params: SwitchMerchantRequest): Promise<AuthResponse> {\n return this.request('POST', '/user/switch/merchant', { body: params });\n }\n\n async switchProfile(params: SwitchProfileRequest): Promise<AuthResponse> {\n return this.request('POST', '/user/switch/profile', { body: params });\n }\n\n async listMerchants(): Promise<Record<string, unknown>[]> {\n return this.request('GET', '/user/list/merchant');\n }\n\n async listProfiles(): Promise<Record<string, unknown>[]> {\n return this.request('GET', '/user/list/profile');\n }\n\n /**\n * Invite team members by email. `POST /user/employees/invite`\n *\n * `project_ids` grants a shop-level role on every shop of each project, once\n * the invitation is accepted. A refusal of `project_ids` is a `UR_23` error whose `data.reason` is one of\n * `project_not_in_merchant`, `role_not_grantable_on_project`,\n * `shop_in_granted_project`, `project_already_granted` or\n * `project_grant_requires_merchant_level`.\n */\n async inviteUsers(params: InviteUsersRequest[]): Promise<InviteUsersResponse[]> {\n return this.request('POST', '/user/employees/invite', { body: params });\n }\n\n /**\n * Add a team member directly, without sending an invite email.\n * `POST /user/employees/add`\n *\n * Unlike `inviteUsers`, the account is active immediately and you hand over\n * the credentials yourself. Omit `password` to have the server generate one\n * and return it once in `password` on the response; supply your own and it is\n * not echoed back. Either way the member must change it on first sign-in.\n *\n * Same role rules as invite: you cannot grant a role above your own, and a\n * shop-scoped caller can only target their own shop. `project_ids` grants a\n * shop-level role on every shop of each project. A refusal of `project_ids` is a `UR_23` error whose `data.reason` is one of\n * `project_not_in_merchant`, `role_not_grantable_on_project`,\n * `shop_in_granted_project`, `project_already_granted` or\n * `project_grant_requires_merchant_level`.\n */\n async addUser(params: AddUserRequest): Promise<AddUserResponse> {\n return this.request('POST', '/user/employees/add', { body: params });\n }\n\n /**\n * Impersonate one of your own team members — `POST /user/employees/impersonate`.\n *\n * Mints a session token **as** the given member, so the dashboard renders\n * exactly what they see (useful for support and role verification). The\n * caller needs the *Impersonation* permission, and the member's role must\n * either rank **strictly below** the caller's\n * (`Profile < Merchant < Organization`), or sit at the caller's own\n * merchant-or-higher level and be **strictly narrower** than the caller's\n * role (grant nothing the caller's role does not, and less in total). The\n * server rejects self-impersonation and cross-merchant targets.\n * `MinimalRoleInfo.can_impersonate` in `listUsersInLineage` answers the same rule\n * per binding, so a UI can offer the action only where it will succeed.\n *\n * A role refusal is a `UR_33` error whose `data.reason` names the rule:\n * `impersonation_target_not_narrower` (the member's role is above, equal to,\n * or not contained in the caller's), or `act_as_token_cannot_impersonate`\n * (the caller is itself signed in as another member — start from your own\n * session).\n *\n * The returned token is tab-scoped by design: open it in a fresh tab (e.g.\n * `/auth/impersonate?token=…`) rather than replacing the caller's own\n * session. No auth cookie is set on the response.\n */\n async impersonateEmployee(params: ImpersonateEmployeeRequest): Promise<TokenResponse> {\n return this.request('POST', '/user/employees/impersonate', { body: params });\n }\n\n async acceptInvitation(params: Record<string, unknown>): Promise<AuthResponse> {\n return this.request('POST', '/user/employees/invite/accept', { body: params });\n }\n\n /**\n * Accept invitations before a session exists.\n *\n * Sign-in issues a `token_type: \"accept_invite\"` step token instead of a\n * session when the caller has no active role yet — every role is still an\n * unaccepted invitation. With that token set via `setJwtToken`, pass the\n * entities from `listInvitations` here; the response is the next step of\n * the sign-in flow (`user_info` for the session, or `force_set_password`\n * first). Rejected when none of the entities carries a pending invitation.\n */\n async acceptInvitationsPreAuth(params: AcceptInvitationsPreAuthRequest): Promise<TokenResponse> {\n return this.request('POST', '/user/employees/invite/accept/pre-auth', { body: params });\n }\n\n /**\n * Accept an invitation via the email-link flow.\n *\n * Caller must already hold a `SinglePurposeToken` with\n * `purpose: accept_invitation_from_email` (obtained via `fromEmail` + any\n * required TOTP step) and have set it on the client via `setJwtToken`.\n * `body.token` must still be the original `EmailToken` from the\n * invite-link URL — the handler decodes it a second time to find the\n * invitee and the entity lineage.\n */\n async acceptInviteFromEmail(params: FromEmailRequest): Promise<AuthResponse> {\n return this.request('POST', '/user/accept-invite-from-email', { body: params });\n }\n\n /**\n * Start TOTP setup (or no-op if already set).\n *\n * Returns the QR-code payload when the user has no TOTP configured yet;\n * returns `{ secret: null }` when the user is already set up (caller\n * should then prompt for a 6-digit code and call `verifyTotp`).\n *\n * Requires `Authorization: Bearer <SPT{purpose:totp}>`.\n */\n async beginTotp(): Promise<TotpResponse> {\n return this.request('GET', '/user/2fa/totp/begin');\n }\n\n /**\n * Verify a 6-digit TOTP code for a user whose TOTP is already set up.\n * Marks the code as used in Redis so subsequent flow steps can advance.\n *\n * Requires `Authorization: Bearer <SPT{purpose:totp}>`.\n */\n async verifyTotp(params: VerifyTotpRequest): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/2fa/totp/verify', { body: params });\n }\n\n async resetTotp(): Promise<Record<string, unknown>> {\n return this.request('GET', '/user/2fa/totp/reset');\n }\n\n async generateRecoveryCodes(): Promise<RecoveryCodesResponse> {\n return this.request('GET', '/user/2fa/recovery-code/generate');\n }\n\n async verifyRecoveryCode(params: Record<string, unknown>): Promise<AuthResponse> {\n return this.request('POST', '/user/2fa/recovery-code/verify', { body: params });\n }\n\n async sendPhoneOtp(params: PhoneOtpRequest): Promise<PhoneOtpResponse> {\n return this.request('POST', '/user/phone/send-otp', { body: params });\n }\n\n async verifyPhoneOtp(params: PhoneOtpVerifyRequest): Promise<PhoneOtpVerifyResponse> {\n return this.request('POST', '/user/phone/verify-otp', { body: params });\n }\n\n /**\n * List all roles visible to the caller (predefined + custom).\n *\n * `GET /user/role/list`. With `groups: true` the response is the\n * parent-groups shape: `[{role_id, role_name, entity_type, role_scope,\n * parent_groups: [{name, description, scopes}]}]`; without it, the\n * deprecated flat `groups` shape.\n *\n * Each role carries `managed_centrally: true` when it is a shared role the\n * platform offers this merchant: it can be assigned, but `updateRole`,\n * `deleteRole` and `updateRoleConnectors` refuse it with `UR_71`\n * (`data.reason: 'managed_centrally'`).\n */\n async listRoles(params?: {\n groups?: boolean;\n entity_type?: string;\n }): Promise<Record<string, unknown>[]> {\n if (params === undefined) {\n return this.request('GET', '/user/role/list');\n }\n return this.request('GET', '/user/role/list', {\n query: { groups: params.groups, entity_type: params.entity_type },\n });\n }\n\n /**\n * The roles a member holds, one entry per role. `POST /user/employees`\n *\n * A project-level role carries `project`: it applies to every shop of that\n * project.\n */\n async listUserRoles(params?: Record<string, unknown>): Promise<GetUserRoleDetailsResponse[]> {\n return this.request('POST', '/user/employees', { body: params });\n }\n\n /**\n * The current role's explicit payment-data policy, or `null` when the role\n * retains its pre-control access. A dashboard hint: every API response\n * enforces the same policy on its own. `GET /user/role/payment-visibility`\n */\n async getRolePaymentVisibility(): Promise<RolePaymentVisibilityPolicy | null> {\n return this.request('GET', '/user/role/payment-visibility');\n }\n\n /**\n * Change a team member's role. `POST /user/employees/update-role`\n *\n * Pass `profile_id` to name the shop when managing a shop's team as a\n * merchant-scoped admin — see {@link UpdateUserRoleRequest.profile_id}.\n */\n async updateUserRole(params: UpdateUserRoleRequest): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/employees/update-role', { body: params });\n }\n\n /**\n * Remove a team member. `DELETE /user/employees/delete`\n *\n * Pass `profile_id` to name the shop when managing a shop's team as a\n * merchant-scoped admin — see {@link DeleteUserRoleRequest.profile_id}. Pass\n * `project_id` instead to remove a project-level role, which the member then\n * loses on every shop of the project.\n */\n async deleteUserRole(params: DeleteUserRoleRequest): Promise<Record<string, unknown>> {\n return this.request('DELETE', '/user/employees/delete', { body: params });\n }\n\n /**\n * Move a team member between a merchant-level role and shop-level roles.\n * `POST /user/employees/change-scope`\n *\n * A merchant-level `role_id` takes no `profile_ids` or `project_ids`; a\n * shop-level one needs at least one shop or project. A project grants the\n * role on every shop of the project, including shops added later. Every\n * earlier merchant-, project- and shop-level binding of the member in your\n * merchant is replaced. When the change takes a scope away, the\n * member's sessions end (`sessions_revoked: true`). Needs a caller at\n * merchant level or above. A refusal is a `UR_23` error whose `data.reason`\n * names the rule; an unknown `role_id` is `UR_22`. The project rules add the\n * reasons `project_not_in_merchant`, `role_not_grantable_on_project`,\n * `shop_in_granted_project`, `project_already_granted` and\n * `project_grant_requires_merchant_level`.\n */\n async changeMemberScope(params: ChangeMemberScopeRequest): Promise<ChangeMemberScopeResponse> {\n return this.request('POST', '/user/employees/change-scope', { body: params });\n }\n\n /**\n * Set or clear when a team member's access to your merchant ends.\n * `POST /user/employees/update-expiry`\n *\n * Every merchant-, shop- and project-level role the member holds in your\n * merchant, accepted or still an invitation, gets the same `expires_at`.\n * From that instant the roles grant nothing: every request, sign-in, token\n * refresh and switch made with them is refused, and `listUsersInLineage`\n * reports the instant in `MinimalRoleInfo.expires_at`. Send `null` to remove\n * the expiry. A shop-level caller reaches only members whose every role is\n * on its own shop. A refusal is a `UR_70` error whose `data` is an\n * {@link AccessExpiryRefusal}.\n */\n async updateMemberExpiry(params: UpdateMemberExpiryRequest): Promise<UpdateMemberExpiryResponse> {\n return this.request('POST', '/user/employees/update-expiry', { body: params });\n }\n\n /**\n * Create a reusable team invitation link. `POST /user/employees/invitation-links`\n *\n * Each person who joins through it gets `role_id` on the target, up to\n * `max_uses` people, until `expires_at`, and only from the networks and\n * countries `restrictions` allow. Creating it grants nothing and sends\n * nothing. You may grant only what you could invite with; a shop-level\n * caller only for its own shop. The secret to share comes back once, in\n * `token`. A refusal is a `UR_72` error whose `data` is an `InvitationLinkRefusal`.\n */\n async createInvitationLink(\n params: CreateInvitationLinkRequest,\n ): Promise<CreateInvitationLinkResponse> {\n return this.request('POST', '/user/employees/invitation-links', { body: params });\n }\n\n /**\n * Your merchant's team invitation links, newest first, with their usage and\n * status. A shop-level caller sees its own shop's.\n * `GET /user/employees/invitation-links`\n */\n async listInvitationLinks(): Promise<ListInvitationLinksResponse> {\n return this.request('GET', '/user/employees/invitation-links');\n }\n\n /**\n * Change a link's name, limit, expiry, access expiry or restrictions.\n * `PUT /user/employees/invitation-links/{link_id}`\n *\n * Send the whole policy and the `modified_at` you read as `version`. Saving\n * also reconfirms the link under your authority.\n */\n async updateInvitationLink(\n linkId: string,\n params: UpdateInvitationLinkRequest,\n ): Promise<InvitationLinkResponse> {\n return this.request('PUT', `/user/employees/invitation-links/${encodeURIComponent(linkId)}`, {\n body: params,\n });\n }\n\n /**\n * Revoke a link: nobody joins through it from now on, and who already\n * joined keeps their access. Revoking a revoked link answers it unchanged.\n * `POST /user/employees/invitation-links/{link_id}/revoke`\n */\n async revokeInvitationLink(linkId: string): Promise<InvitationLinkResponse> {\n return this.request(\n 'POST',\n `/user/employees/invitation-links/${encodeURIComponent(linkId)}/revoke`,\n );\n }\n\n /**\n * What a shared link offers, before joining. No authentication; grants\n * nothing. `POST /user/invitation-link/preview`\n */\n async previewInvitationLink(token: string): Promise<InvitationLinkPreviewResponse> {\n return this.request('POST', '/user/invitation-link/preview', { body: { token } });\n }\n\n /**\n * Join through a shared link from a signed-in session.\n * `POST /user/invitation-link/join`\n *\n * Needs a verified email address. Joining twice answers `already_member`\n * and uses no second place.\n */\n async joinInvitationLink(token: string): Promise<JoinInvitationLinkResponse> {\n return this.request('POST', '/user/invitation-link/join', { body: { token } });\n }\n\n /**\n * Join through a shared link during sign-in, for someone who holds no access\n * yet: call it with the `accept_invite` single-purpose token set on the\n * client. Answers the token for the next sign-in step.\n * `POST /user/invitation-link/join/pre-auth`\n */\n async joinInvitationLinkPreAuth(token: string): Promise<JoinInvitationLinkPreAuthResponse> {\n return this.request('POST', '/user/invitation-link/join/pre-auth', { body: { token } });\n }\n\n /**\n * Make an account through a shared link, for someone who has none. No\n * authentication. The account holds no access: its owner verifies the\n * address from the email this sends, signs in and joins.\n * `POST /user/invitation-link/register`\n */\n async registerThroughInvitationLink(\n params: RegisterThroughInvitationLinkRequest,\n ): Promise<RegisterThroughInvitationLinkResponse> {\n return this.request('POST', '/user/invitation-link/register', { body: params });\n }\n\n /**\n * One member of your merchant, with the person fields the member list\n * omits. `GET /user/employees/{user_id}/details`\n *\n * Answers only for a member `listUsersInLineage` shows you. Any other id,\n * unknown or not yours, is a 404 `UR_68` with `data.reason:\n * 'member_not_found'`.\n */\n async getTeamMemberDetails(userId: string): Promise<TeamMemberDetails> {\n return this.request('GET', `/user/employees/${encodeURIComponent(userId)}/details`);\n }\n\n /**\n * Supplied contacts and internal notes for a visible member in the current\n * merchant. Requires a session JWT and Users read permission. The returned\n * revision is required even for the first write; can_edit states write access.\n * An unknown or invisible member is refused with the same 404 UR_68 response.\n */\n async getTeamMemberContactProfile(userId: string): Promise<TeamMemberContactProfileResponse> {\n return this.request('GET', `/user/employees/${encodeURIComponent(userId)}/contact-profile`);\n }\n\n /**\n * Replace the supplied contacts, preserving notes and login/recovery identity.\n * Omitted optional contact fields are cleared. Requires Users write permission\n * and authority over the whole member. Send the exact last-read revision.\n * On a changed refusal, keep the draft and read again before resubmitting.\n * Structured UR_68 data is a TeamMemberRefusal with reason contact_profile.\n */\n async updateTeamMemberContacts(\n userId: string,\n params: UpdateTeamMemberContactsRequest,\n ): Promise<TeamMemberContactProfileResponse> {\n return this.request('PUT', `/user/employees/${encodeURIComponent(userId)}/contact-profile`, {\n body: params,\n });\n }\n\n /** Create a plain-text note with server-authored attribution; requires the current revision. */\n async createTeamMemberNote(\n userId: string,\n params: WriteTeamMemberNoteRequest,\n ): Promise<TeamMemberContactProfileResponse> {\n return this.request('POST', `/user/employees/${encodeURIComponent(userId)}/notes`, {\n body: params,\n });\n }\n\n /** Edit one note, retaining its original author and creation time. Uses the same write scope. */\n async updateTeamMemberNote(\n userId: string,\n noteId: string,\n params: WriteTeamMemberNoteRequest,\n ): Promise<TeamMemberContactProfileResponse> {\n return this.request(\n 'PUT',\n `/user/employees/${encodeURIComponent(userId)}/notes/${encodeURIComponent(noteId)}`,\n { body: params },\n );\n }\n\n /**\n * Delete only the named member note. The exact profile revision is sent in the\n * query; contacts and all other notes remain. Returns the new profile revision.\n */\n async deleteTeamMemberNote(\n userId: string,\n noteId: string,\n params: DeleteTeamMemberNoteRequest,\n ): Promise<TeamMemberContactProfileResponse> {\n return this.request(\n 'DELETE',\n `/user/employees/${encodeURIComponent(userId)}/notes/${encodeURIComponent(noteId)}`,\n { query: { expected_revision: params.expected_revision } },\n );\n }\n\n /**\n * Replace a team member's password with a temporary one, returned once.\n * `POST /user/employees/{user_id}/reset-password`\n *\n * Needs the *Users* write permission and the *Impersonation* permission,\n * and the member must be one you could sign in as with\n * `impersonateEmployee`. The member's sessions end, and their next sign-in\n * asks them to choose a new password. Two-factor authentication is left as\n * it is. `TeamMemberDetails.can_reset_password` answers the same rule. A\n * refusal is a `UR_68` error whose `data` is a {@link TeamMemberRefusal}.\n */\n async resetTeamMemberPassword(\n userId: string,\n params: ResetTeamMemberPasswordRequest,\n ): Promise<ResetTeamMemberPasswordResponse> {\n return this.request('POST', `/user/employees/${encodeURIComponent(userId)}/reset-password`, {\n body: params,\n });\n }\n\n /**\n * One team member's sign-in history: successes and failures with method,\n * address, location and device, filtered, sorted and paged as\n * `listLoginActivity` is. `GET /user/employees/{user_id}/login-activity`\n *\n * Needs the *Users* write permission. Answers only for a member\n * `listUsersInLineage` shows you; any other id is a 404 `UR_68` with\n * `data.reason: 'member_not_found'`. Sign-ins belong to the account, so\n * they are shown only for an account wholly in this merchant: refused with\n * a 400 `UR_68` `member_has_access_elsewhere` for an account that also\n * holds a role elsewhere, and `member_not_activated` for one that is only\n * invited. `TeamMemberDetails.can_view_sign_ins` answers the same rule.\n */\n async listTeamMemberLoginActivity(\n userId: string,\n params?: LoginHistoryParams,\n ): Promise<LoginHistoryResponse> {\n const path = `/user/employees/${encodeURIComponent(userId)}/login-activity`;\n if (params === undefined) {\n return this.request('GET', path);\n }\n return this.request('GET', path, {\n query: csvQuery(params, ['event_type', 'auth_method']),\n });\n }\n\n /**\n * One team member's live sessions: neither signed out nor expired.\n * `is_current` marks the caller's own session only.\n * `GET /user/employees/{user_id}/sessions`\n *\n * Same permission and refusals as `listTeamMemberLoginActivity`.\n */\n async listTeamMemberSessions(userId: string): Promise<UserSessionListResponse> {\n return this.request('GET', `/user/employees/${encodeURIComponent(userId)}/sessions`);\n }\n\n /**\n * Sign a team member out everywhere: ends every session and token of the\n * member, at this merchant and at every other merchant the account belongs\n * to. `POST /user/employees/{user_id}/sessions/revoke-all`\n *\n * The account stays active and its password unchanged, so the member can\n * sign in again at once. Allowed on exactly the members whose password you\n * may reset with `resetTeamMemberPassword`, and refused with the same\n * `UR_68` reasons ({@link TeamMemberRefusal}).\n * `TeamMemberDetails.can_sign_out` answers the same rule. Recorded in the\n * audit log.\n */\n async revokeTeamMemberSessions(userId: string): Promise<AdminRevokeUserSessionsResponse> {\n return this.request(\n 'POST',\n `/user/employees/${encodeURIComponent(userId)}/sessions/revoke-all`,\n );\n }\n\n /**\n * Which checkout payment methods a member may change in your merchant.\n * `GET /user/employees/{user_id}/method-access`\n *\n * Needs the *Users* read permission, and answers only for a member\n * `listUsersInLineage` shows you (any other id is a 404 `UR_68` with\n * `data.reason: 'member_not_found'`). `can_edit` says whether you may\n * change it; `grant_all` and `grantable` say which methods you may grant.\n */\n async getMemberMethodAccess(userId: string): Promise<MemberMethodAccessResponse> {\n return this.request('GET', `/user/employees/${encodeURIComponent(userId)}/method-access`);\n }\n\n /**\n * Limit a member to some checkout payment methods, or give every method\n * back. `PUT /user/employees/{user_id}/method-access`\n *\n * Needs the *Connectors* edit and *Payment methods* write permissions and a\n * member within your reach, other than yourself. A caller limited itself\n * grants only within its own limit. The change is audited and applies to\n * the member's next request. A refusal is a `UR_68` whose `data` is\n * `{ reason: 'method_access', refusal }` (see {@link MethodAccessRefusal}).\n */\n async updateMemberMethodAccess(\n userId: string,\n params: UpdateMemberMethodAccessRequest,\n ): Promise<MemberMethodAccessResponse> {\n return this.request('PUT', `/user/employees/${encodeURIComponent(userId)}/method-access`, {\n body: params,\n });\n }\n\n /**\n * A member's permission overrides in your merchant: every area that can be\n * overridden at their level, with what their roles give, the level set for\n * them, and what they have. `GET /user/employees/{user_id}/permission-overrides`\n *\n * Needs the *Users* read permission, and answers only for a member\n * `listUsersInLineage` shows you (any other id is a 404 `UR_68`).\n * `can_edit`, `can_raise` and each area's `grantable_level` say what you\n * may change.\n */\n async getMemberPermissionOverrides(userId: string): Promise<MemberPermissionOverridesResponse> {\n return this.request(\n 'GET',\n `/user/employees/${encodeURIComponent(userId)}/permission-overrides`,\n );\n }\n\n /**\n * Replace a member's permission overrides. An area left out goes back to\n * what their roles give. `PUT /user/employees/{user_id}/permission-overrides`\n *\n * Needs the *Users* write permission and a member within your reach, other\n * than yourself. Keeping or lowering is always allowed; a gain must stay\n * within what you hold in that area, and a gain above the member's roles\n * needs `can_raise`. The change is audited and applies to the member's next\n * request. A refusal is a `UR_68` whose `data` is\n * `{ reason: 'permission_overrides', refusal }` (see\n * {@link PermissionOverrideRefusal}).\n */\n async updateMemberPermissionOverrides(\n userId: string,\n params: UpdateMemberPermissionOverridesRequest,\n ): Promise<MemberPermissionOverridesResponse> {\n return this.request(\n 'PUT',\n `/user/employees/${encodeURIComponent(userId)}/permission-overrides`,\n { body: params },\n );\n }\n\n /**\n * The permission overrides your own session acts under, sorted by area.\n * An area named here has exactly that level, whatever a broader legacy area\n * of the role would suggest. `GET /user/role/permission-overrides`\n */\n async getOwnPermissionOverrides(): Promise<PermissionOverride[]> {\n return this.request('GET', '/user/role/permission-overrides');\n }\n\n /** Sign in via OIDC. `POST /user/oidc` */\n async signInOidc(params: Record<string, unknown>): Promise<AuthResponse> {\n return this.request('POST', '/user/oidc', { body: params });\n }\n\n /** Transfer key. `POST /user/key/transfer` */\n async transferKey(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/key/transfer', { body: params });\n }\n\n /**\n * Invitations still waiting on the caller. `GET /user/list/invitation`\n *\n * Accepts an `accept_invite` step token as well as a session JWT, so it\n * can feed `acceptInvitationsPreAuth` during sign-in. An invitation to a\n * project carries `project_id`; pass it back unchanged when accepting.\n */\n async listInvitations(): Promise<UserInvitation[]> {\n return this.request('GET', '/user/list/invitation');\n }\n\n /** Check 2FA status. `GET /user/2fa` */\n async check2faStatus(): Promise<Record<string, unknown>> {\n return this.request('GET', '/user/2fa');\n }\n\n /**\n * Finish first-time TOTP setup: commit the secret generated by `beginTotp`\n * against a 6-digit code from the user's authenticator app.\n *\n * `PUT /user/2fa/totp/verify`. Requires `Authorization: Bearer <SPT{purpose:totp}>`.\n */\n async updateTotp(params: VerifyTotpRequest): Promise<Record<string, unknown>> {\n return this.request('PUT', '/user/2fa/totp/verify', { body: params });\n }\n\n /**\n * Complete the TOTP step and advance to the next flow stage (e.g.\n * `reset_password`). Returns a fresh single-purpose token with the\n * next `token_type`.\n *\n * `GET /user/2fa/terminate`. Requires `Authorization: Bearer <SPT{purpose:totp}>`.\n */\n async terminate2fa(query?: Terminate2faQueryParams): Promise<TokenResponse> {\n if (query === undefined) {\n return this.request('GET', '/user/2fa/terminate');\n }\n return this.request('GET', '/user/2fa/terminate', {\n query: query as Record<string, boolean | undefined>,\n });\n }\n\n /** Create auth method. `POST /user/auth` */\n async createAuthMethod(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/auth', { body: params });\n }\n\n /** Update auth method. `PUT /user/auth` */\n async updateAuthMethod(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('PUT', '/user/auth', { body: params });\n }\n\n /** List auth methods. `GET /user/auth/list` */\n async listAuthMethods(): Promise<Record<string, unknown>[]> {\n return this.request('GET', '/user/auth/list');\n }\n\n /** Get auth URL. `GET /user/auth/url` */\n async getAuthUrl(): Promise<Record<string, unknown>> {\n return this.request('GET', '/user/auth/url');\n }\n\n /** Select auth method. `POST /user/auth/select` */\n async selectAuth(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/auth/select', { body: params });\n }\n\n /**\n * List users in lineage.\n *\n * Needs the Users *view* grant now — the response carries colleagues' email\n * addresses, so a role without it is refused rather than handed a roster.\n * A shop-scoped role keeps reading its own shop's members.\n *\n * `GET /user/employees/list`\n */\n async listUsersInLineage(params?: ListUsersInLineageParams): Promise<UserInLineage[]> {\n return this.request('GET', '/user/employees/list', {\n query: params as Record<string, string | undefined> | undefined,\n });\n }\n\n /**\n * Send a pending member a new invitation link. `POST /user/resend-invite`\n *\n * The new link replaces the one before it, which stops working. It works\n * for `link_valid_for_days` days, 7 by default. Works for any pending member\n * `listUsersInLineage` shows you. A refusal is a `UR_68` error\n * (`no_pending_invitation`, `invite_link_validity_out_of_range`) or a\n * `UR_70` `invitation_expired` when the access the invitation offers has\n * ended.\n */\n async resendInvite(params: ReInviteUserRequest): Promise<ReInviteUserResponse> {\n return this.request('POST', '/user/resend-invite', { body: params });\n }\n\n /**\n * A pending member's current invitation link, or why it is not shown.\n * `GET /user/employees/{user_id}/invite-link`\n *\n * Only the link of an account the invitation created, that nobody has used\n * since, is returned: the link signs its holder in without a password. Every\n * link returned is audited. Needs team write access.\n */\n async getInviteLink(userId: string): Promise<InviteLinkResponse> {\n return this.request('GET', `/user/employees/${encodeURIComponent(userId)}/invite-link`);\n }\n\n /**\n * Get the caller's parent permission groups + scopes.\n *\n * `GET /user/role`\n */\n async getRolePermissions(): Promise<ParentGroupInfo[]> {\n return this.request('GET', '/user/role');\n }\n\n /**\n * List invitable roles. `GET /user/role/list/invite`\n *\n * @param params - Optional query. `entity_type` scopes the role list to a\n * particular entity (e.g. `'merchant'` to list only merchant-scoped roles\n * when inviting employees from the merchant dashboard).\n */\n async listInvitableRoles(params?: ListInvitableRolesParams): Promise<Record<string, unknown>[]> {\n if (params === undefined || params.entity_type === undefined) {\n return this.request('GET', '/user/role/list/invite');\n }\n return this.request('GET', '/user/role/list/invite', {\n query: { entity_type: params.entity_type },\n });\n }\n\n /** List updatable roles. `GET /user/role/list/update` */\n async listUpdatableRoles(): Promise<Record<string, unknown>[]> {\n return this.request('GET', '/user/role/list/update');\n }\n\n /** Get parent list. `GET /user/parent/list` */\n async getParentList(): Promise<Record<string, unknown>[]> {\n return this.request('GET', '/user/parent/list');\n }\n\n /** Create a role. `POST /user/role` */\n async createRole(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/user/role', { body: params });\n }\n\n /** Get role by ID. `GET /user/role/{roleId}` */\n async getRoleById(roleId: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/user/role/${encodeURIComponent(roleId)}`);\n }\n\n /** Update role by ID. `PUT /user/role/{roleId}` */\n async updateRole(\n roleId: string,\n params: Record<string, unknown>,\n options?: RequestExtras,\n ): Promise<Record<string, unknown>> {\n return this.request('PUT', `/user/role/${encodeURIComponent(roleId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Delete a custom role. Predefined roles and roles still assigned to\n * team members are rejected by the backend with a 400.\n *\n * `DELETE /user/role/{roleId}`\n */\n async deleteRole(roleId: string): Promise<Record<string, unknown>> {\n return this.request('DELETE', `/user/role/${encodeURIComponent(roleId)}`);\n }\n\n /**\n * Read which individual connector accounts a role may see.\n *\n * `GET /user/role/{roleId}/connectors`\n *\n * **Check `restricted` before reading `connectors`.** An empty list is\n * ambiguous by itself, so the backend states which case it is: `false` means\n * the role holds no grant and sees whatever its entity and profile scope\n * already allowed. Rendering an empty `connectors` array as \"this role sees\n * nothing\" inverts the meaning.\n *\n * Requires the permission that *edits a role*, not a connector permission.\n */\n async getRoleConnectors(roleId: string): Promise<RoleConnectorGrant> {\n return this.request('GET', `/user/role/${encodeURIComponent(roleId)}/connectors`);\n }\n\n /**\n * Replace the set of connector accounts a role may see.\n *\n * `PUT /user/role/{roleId}/connectors`\n *\n * The call **replaces** the whole set rather than adding to it, so send the\n * complete list every time. An empty `merchant_connector_ids` clears the\n * grant and returns the role to unrestricted.\n *\n * The backend refuses an id that is not a connector account of the caller's\n * own merchant, an `Organization`-scoped role (a connector account belongs to\n * exactly one merchant, so an org-spanning role cannot hold one coherently),\n * and any predefined role (one static entry shared by every tenant).\n *\n * Editing a grant invalidates the role cache and blacklists tokens minted\n * before the edit, so **users holding this role must sign in again**. Worth\n * saying in the UI before the save, not after.\n */\n async updateRoleConnectors(\n roleId: string,\n params: UpdateRoleConnectorGrantParams,\n ): Promise<RoleConnectorGrant> {\n return this.request('PUT', `/user/role/${encodeURIComponent(roleId)}/connectors`, {\n body: params,\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/
|
|
1
|
+
{"version":3,"sources":["/tmp/w2pub474/delopay-typescript-sdk/dist/chunk-ZUULK36E.cjs","../src/resources/contentEncryption.ts"],"names":[],"mappings":"AAAA;ACWO,IAAM,kBAAA,EAAN,MAAwB;AAAA,EAC7B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAalD,MAAM,QAAA,CAAS,OAAA,EAA2D;AACxE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,qBAAA,EAAuB,EAAE,GAAG,QAAQ,CAAC,CAAA;AAAA,EAClE;AACF,CAAA;ADRA;AACA;AACE;AACF,8CAAC","file":"/tmp/w2pub474/delopay-typescript-sdk/dist/chunk-ZUULK36E.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport type { ContentEncryptionStatus } from '../types';\n\n/**\n * Whether the deployment stores new messages and uploaded files encrypted\n * with its own key. Public: no credential is needed, so a client built with\n * no API key or with only a publishable key can ask before anyone signs in.\n *\n * This is encryption at rest by the deployment's servers, which hold the\n * key. It is never end-to-end.\n */\nexport class ContentEncryption {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The current status. Show a \"stored encrypted\" note only while\n * `encrypted` is `true`. The answer is cached for up to 60 seconds, so a\n * change can take that long to show.\n *\n * Pass a `signal` (e.g. `AbortSignal.timeout(2500)`) to bound the call\n * including its retries; a `timeout` alone applies to each attempt. A\n * page that cannot get an answer should show no note, rather than wait.\n *\n * `GET /content-encryption`\n */\n async retrieve(options?: RequestExtras): Promise<ContentEncryptionStatus> {\n return this.request('GET', '/content-encryption', { ...options });\n }\n}\n"]}
|