@polar-sh/sdk 1.0.0-alpha.12 → 1.0.0-alpha.13
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/README.md +4 -2
- package/dist/2026-04/index.d.cts +36 -36
- package/dist/2026-04/index.d.mts +36 -36
- package/dist/2026-04/services/benefit_grants.cjs +3 -3
- package/dist/2026-04/services/benefit_grants.cjs.map +1 -1
- package/dist/2026-04/services/benefit_grants.d.cts +3 -3
- package/dist/2026-04/services/benefit_grants.d.mts +3 -3
- package/dist/2026-04/services/benefit_grants.mjs +3 -3
- package/dist/2026-04/services/benefit_grants.mjs.map +1 -1
- package/dist/2026-04/services/benefits.cjs +6 -6
- package/dist/2026-04/services/benefits.cjs.map +1 -1
- package/dist/2026-04/services/benefits.d.cts +5 -5
- package/dist/2026-04/services/benefits.d.mts +5 -5
- package/dist/2026-04/services/benefits.mjs +5 -5
- package/dist/2026-04/services/benefits.mjs.map +1 -1
- package/dist/2026-04/services/checkout_links.cjs +3 -3
- package/dist/2026-04/services/checkout_links.cjs.map +1 -1
- package/dist/2026-04/services/checkout_links.d.cts +3 -3
- package/dist/2026-04/services/checkout_links.d.mts +3 -3
- package/dist/2026-04/services/checkout_links.mjs +3 -3
- package/dist/2026-04/services/checkout_links.mjs.map +1 -1
- package/dist/2026-04/services/checkouts.cjs +3 -3
- package/dist/2026-04/services/checkouts.cjs.map +1 -1
- package/dist/2026-04/services/checkouts.d.cts +3 -3
- package/dist/2026-04/services/checkouts.d.mts +3 -3
- package/dist/2026-04/services/checkouts.mjs +3 -3
- package/dist/2026-04/services/checkouts.mjs.map +1 -1
- package/dist/2026-04/services/custom_fields.cjs +3 -3
- package/dist/2026-04/services/custom_fields.cjs.map +1 -1
- package/dist/2026-04/services/custom_fields.d.cts +3 -3
- package/dist/2026-04/services/custom_fields.d.mts +3 -3
- package/dist/2026-04/services/custom_fields.mjs +3 -3
- package/dist/2026-04/services/custom_fields.mjs.map +1 -1
- package/dist/2026-04/services/customer_meters.cjs +3 -3
- package/dist/2026-04/services/customer_meters.cjs.map +1 -1
- package/dist/2026-04/services/customer_meters.d.cts +3 -3
- package/dist/2026-04/services/customer_meters.d.mts +3 -3
- package/dist/2026-04/services/customer_meters.mjs +3 -3
- package/dist/2026-04/services/customer_meters.mjs.map +1 -1
- package/dist/2026-04/services/customer_portal/benefit_grants.cjs +3 -3
- package/dist/2026-04/services/customer_portal/benefit_grants.cjs.map +1 -1
- package/dist/2026-04/services/customer_portal/benefit_grants.d.cts +3 -3
- package/dist/2026-04/services/customer_portal/benefit_grants.d.mts +3 -3
- package/dist/2026-04/services/customer_portal/benefit_grants.mjs +3 -3
- package/dist/2026-04/services/customer_portal/benefit_grants.mjs.map +1 -1
- package/dist/2026-04/services/customer_portal/customer_meters.cjs +3 -3
- package/dist/2026-04/services/customer_portal/customer_meters.cjs.map +1 -1
- package/dist/2026-04/services/customer_portal/customer_meters.d.cts +3 -3
- package/dist/2026-04/services/customer_portal/customer_meters.d.mts +3 -3
- package/dist/2026-04/services/customer_portal/customer_meters.mjs +3 -3
- package/dist/2026-04/services/customer_portal/customer_meters.mjs.map +1 -1
- package/dist/2026-04/services/customer_portal/customers.cjs +3 -3
- package/dist/2026-04/services/customer_portal/customers.cjs.map +1 -1
- package/dist/2026-04/services/customer_portal/customers.d.cts +3 -3
- package/dist/2026-04/services/customer_portal/customers.d.mts +3 -3
- package/dist/2026-04/services/customer_portal/customers.mjs +3 -3
- package/dist/2026-04/services/customer_portal/customers.mjs.map +1 -1
- package/dist/2026-04/services/customer_portal/downloadables.cjs +3 -3
- package/dist/2026-04/services/customer_portal/downloadables.cjs.map +1 -1
- package/dist/2026-04/services/customer_portal/downloadables.d.cts +3 -3
- package/dist/2026-04/services/customer_portal/downloadables.d.mts +3 -3
- package/dist/2026-04/services/customer_portal/downloadables.mjs +3 -3
- package/dist/2026-04/services/customer_portal/downloadables.mjs.map +1 -1
- package/dist/2026-04/services/customer_portal/index.d.cts +10 -10
- package/dist/2026-04/services/customer_portal/index.d.mts +10 -10
- package/dist/2026-04/services/customer_portal/license_keys.cjs +3 -3
- package/dist/2026-04/services/customer_portal/license_keys.cjs.map +1 -1
- package/dist/2026-04/services/customer_portal/license_keys.d.cts +3 -3
- package/dist/2026-04/services/customer_portal/license_keys.d.mts +3 -3
- package/dist/2026-04/services/customer_portal/license_keys.mjs +3 -3
- package/dist/2026-04/services/customer_portal/license_keys.mjs.map +1 -1
- package/dist/2026-04/services/customer_portal/members.cjs +3 -3
- package/dist/2026-04/services/customer_portal/members.cjs.map +1 -1
- package/dist/2026-04/services/customer_portal/members.d.cts +3 -3
- package/dist/2026-04/services/customer_portal/members.d.mts +3 -3
- package/dist/2026-04/services/customer_portal/members.mjs +3 -3
- package/dist/2026-04/services/customer_portal/members.mjs.map +1 -1
- package/dist/2026-04/services/customer_portal/orders.cjs +3 -3
- package/dist/2026-04/services/customer_portal/orders.cjs.map +1 -1
- package/dist/2026-04/services/customer_portal/orders.d.cts +3 -3
- package/dist/2026-04/services/customer_portal/orders.d.mts +3 -3
- package/dist/2026-04/services/customer_portal/orders.mjs +3 -3
- package/dist/2026-04/services/customer_portal/orders.mjs.map +1 -1
- package/dist/2026-04/services/customer_portal/seats.cjs +3 -3
- package/dist/2026-04/services/customer_portal/seats.cjs.map +1 -1
- package/dist/2026-04/services/customer_portal/seats.d.cts +3 -3
- package/dist/2026-04/services/customer_portal/seats.d.mts +3 -3
- package/dist/2026-04/services/customer_portal/seats.mjs +3 -3
- package/dist/2026-04/services/customer_portal/seats.mjs.map +1 -1
- package/dist/2026-04/services/customer_portal/subscriptions.cjs +3 -3
- package/dist/2026-04/services/customer_portal/subscriptions.cjs.map +1 -1
- package/dist/2026-04/services/customer_portal/subscriptions.d.cts +3 -3
- package/dist/2026-04/services/customer_portal/subscriptions.d.mts +3 -3
- package/dist/2026-04/services/customer_portal/subscriptions.mjs +3 -3
- package/dist/2026-04/services/customer_portal/subscriptions.mjs.map +1 -1
- package/dist/2026-04/services/customer_portal/wallets.cjs +3 -3
- package/dist/2026-04/services/customer_portal/wallets.cjs.map +1 -1
- package/dist/2026-04/services/customer_portal/wallets.d.cts +3 -3
- package/dist/2026-04/services/customer_portal/wallets.d.mts +3 -3
- package/dist/2026-04/services/customer_portal/wallets.mjs +3 -3
- package/dist/2026-04/services/customer_portal/wallets.mjs.map +1 -1
- package/dist/2026-04/services/customers/index.cjs +9 -9
- package/dist/2026-04/services/customers/index.cjs.map +1 -1
- package/dist/2026-04/services/customers/index.d.cts +7 -7
- package/dist/2026-04/services/customers/index.d.mts +7 -7
- package/dist/2026-04/services/customers/index.mjs +7 -7
- package/dist/2026-04/services/customers/index.mjs.map +1 -1
- package/dist/2026-04/services/discounts.cjs +3 -3
- package/dist/2026-04/services/discounts.cjs.map +1 -1
- package/dist/2026-04/services/discounts.d.cts +3 -3
- package/dist/2026-04/services/discounts.d.mts +3 -3
- package/dist/2026-04/services/discounts.mjs +3 -3
- package/dist/2026-04/services/discounts.mjs.map +1 -1
- package/dist/2026-04/services/disputes.cjs +3 -3
- package/dist/2026-04/services/disputes.cjs.map +1 -1
- package/dist/2026-04/services/disputes.d.cts +3 -3
- package/dist/2026-04/services/disputes.d.mts +3 -3
- package/dist/2026-04/services/disputes.mjs +3 -3
- package/dist/2026-04/services/disputes.mjs.map +1 -1
- package/dist/2026-04/services/event_types.cjs +3 -3
- package/dist/2026-04/services/event_types.cjs.map +1 -1
- package/dist/2026-04/services/event_types.d.cts +3 -3
- package/dist/2026-04/services/event_types.d.mts +3 -3
- package/dist/2026-04/services/event_types.mjs +3 -3
- package/dist/2026-04/services/event_types.mjs.map +1 -1
- package/dist/2026-04/services/events.cjs +3 -3
- package/dist/2026-04/services/events.cjs.map +1 -1
- package/dist/2026-04/services/events.d.cts +3 -3
- package/dist/2026-04/services/events.d.mts +3 -3
- package/dist/2026-04/services/events.mjs +3 -3
- package/dist/2026-04/services/events.mjs.map +1 -1
- package/dist/2026-04/services/files.cjs +3 -3
- package/dist/2026-04/services/files.cjs.map +1 -1
- package/dist/2026-04/services/files.d.cts +3 -3
- package/dist/2026-04/services/files.d.mts +3 -3
- package/dist/2026-04/services/files.mjs +3 -3
- package/dist/2026-04/services/files.mjs.map +1 -1
- package/dist/2026-04/services/license_keys.cjs +3 -3
- package/dist/2026-04/services/license_keys.cjs.map +1 -1
- package/dist/2026-04/services/license_keys.d.cts +3 -3
- package/dist/2026-04/services/license_keys.d.mts +3 -3
- package/dist/2026-04/services/license_keys.mjs +3 -3
- package/dist/2026-04/services/license_keys.mjs.map +1 -1
- package/dist/2026-04/services/members.cjs +3 -3
- package/dist/2026-04/services/members.cjs.map +1 -1
- package/dist/2026-04/services/members.d.cts +3 -3
- package/dist/2026-04/services/members.d.mts +3 -3
- package/dist/2026-04/services/members.mjs +3 -3
- package/dist/2026-04/services/members.mjs.map +1 -1
- package/dist/2026-04/services/meters.cjs +3 -3
- package/dist/2026-04/services/meters.cjs.map +1 -1
- package/dist/2026-04/services/meters.d.cts +3 -3
- package/dist/2026-04/services/meters.d.mts +3 -3
- package/dist/2026-04/services/meters.mjs +3 -3
- package/dist/2026-04/services/meters.mjs.map +1 -1
- package/dist/2026-04/services/orders.cjs +3 -3
- package/dist/2026-04/services/orders.cjs.map +1 -1
- package/dist/2026-04/services/orders.d.cts +3 -3
- package/dist/2026-04/services/orders.d.mts +3 -3
- package/dist/2026-04/services/orders.mjs +3 -3
- package/dist/2026-04/services/orders.mjs.map +1 -1
- package/dist/2026-04/services/organizations.cjs +3 -3
- package/dist/2026-04/services/organizations.cjs.map +1 -1
- package/dist/2026-04/services/organizations.d.cts +3 -3
- package/dist/2026-04/services/organizations.d.mts +3 -3
- package/dist/2026-04/services/organizations.mjs +3 -3
- package/dist/2026-04/services/organizations.mjs.map +1 -1
- package/dist/2026-04/services/payments.cjs +3 -3
- package/dist/2026-04/services/payments.cjs.map +1 -1
- package/dist/2026-04/services/payments.d.cts +3 -3
- package/dist/2026-04/services/payments.d.mts +3 -3
- package/dist/2026-04/services/payments.mjs +3 -3
- package/dist/2026-04/services/payments.mjs.map +1 -1
- package/dist/2026-04/services/products.cjs +3 -3
- package/dist/2026-04/services/products.cjs.map +1 -1
- package/dist/2026-04/services/products.d.cts +3 -3
- package/dist/2026-04/services/products.d.mts +3 -3
- package/dist/2026-04/services/products.mjs +3 -3
- package/dist/2026-04/services/products.mjs.map +1 -1
- package/dist/2026-04/services/refunds.cjs +3 -3
- package/dist/2026-04/services/refunds.cjs.map +1 -1
- package/dist/2026-04/services/refunds.d.cts +3 -3
- package/dist/2026-04/services/refunds.d.mts +3 -3
- package/dist/2026-04/services/refunds.mjs +3 -3
- package/dist/2026-04/services/refunds.mjs.map +1 -1
- package/dist/2026-04/services/subscriptions.cjs +3 -3
- package/dist/2026-04/services/subscriptions.cjs.map +1 -1
- package/dist/2026-04/services/subscriptions.d.cts +3 -3
- package/dist/2026-04/services/subscriptions.d.mts +3 -3
- package/dist/2026-04/services/subscriptions.mjs +3 -3
- package/dist/2026-04/services/subscriptions.mjs.map +1 -1
- package/dist/2026-04/services/webhooks.cjs +6 -6
- package/dist/2026-04/services/webhooks.cjs.map +1 -1
- package/dist/2026-04/services/webhooks.d.cts +5 -5
- package/dist/2026-04/services/webhooks.d.mts +5 -5
- package/dist/2026-04/services/webhooks.mjs +5 -5
- package/dist/2026-04/services/webhooks.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.cjs","names":["HTTPValidationError","ResourceNotFound","AlreadyCanceledSubscription","PaymentFailed","Update403Error"],"sources":["../../../../src/2026-04/services/customer_portal/subscriptions.ts"],"sourcesContent":["import type { ClientBase } from \"../../../base\";\nimport type {\n CustomerSubscription,\n CustomerSubscriptionSortProperty,\n CustomerSubscriptionUpdate,\n ListResourceCustomerSubscription,\n} from \"../../models\";\n\nimport {\n AlreadyCanceledSubscription,\n HTTPValidationError,\n PaymentFailed,\n ResourceNotFound,\n Update403Error,\n} from \"../../errors\";\n\nexport const listSubscriptions = (client: ClientBase) => {\n /**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @returns {ListResourceCustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (query?: {\n product_id?: string | string[] | null;\n active?: boolean | null;\n query?: string | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSubscriptionSortProperty[] | null;\n }): Promise<ListResourceCustomerSubscription> => {\n const pathParams = {};\n const queryParams = {\n product_id: query?.product_id,\n active: query?.active,\n query: query?.query,\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n sorting: query?.sorting ?? [\"-started_at\"],\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/subscriptions/\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<ListResourceCustomerSubscription>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @returns {AsyncGenerator<CustomerSubscription>} A generator that yields items of type CustomerSubscription.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\nexport const
|
|
1
|
+
{"version":3,"file":"subscriptions.cjs","names":["HTTPValidationError","ResourceNotFound","AlreadyCanceledSubscription","PaymentFailed","Update403Error"],"sources":["../../../../src/2026-04/services/customer_portal/subscriptions.ts"],"sourcesContent":["import type { ClientBase } from \"../../../base\";\nimport type {\n CustomerSubscription,\n CustomerSubscriptionSortProperty,\n CustomerSubscriptionUpdate,\n ListResourceCustomerSubscription,\n} from \"../../models\";\n\nimport {\n AlreadyCanceledSubscription,\n HTTPValidationError,\n PaymentFailed,\n ResourceNotFound,\n Update403Error,\n} from \"../../errors\";\n\nexport const listSubscriptions = (client: ClientBase) => {\n /**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @returns {ListResourceCustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (query?: {\n product_id?: string | string[] | null;\n active?: boolean | null;\n query?: string | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSubscriptionSortProperty[] | null;\n }): Promise<ListResourceCustomerSubscription> => {\n const pathParams = {};\n const queryParams = {\n product_id: query?.product_id,\n active: query?.active,\n query: query?.query,\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n sorting: query?.sorting ?? [\"-started_at\"],\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/subscriptions/\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<ListResourceCustomerSubscription>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @returns {AsyncGenerator<CustomerSubscription>} A generator that yields items of type CustomerSubscription.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListSubscriptions = (client: ClientBase) => {\n return async function* (query?: {\n product_id?: string | string[] | null;\n active?: boolean | null;\n query?: string | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSubscriptionSortProperty[] | null;\n }): AsyncGenerator<CustomerSubscription> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listSubscriptions(client)({ ...query, page, limit });\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\nexport const getSubscriptions = (client: ClientBase) => {\n /**\n * Get a subscription for the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param id - The subscription ID.\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const cancelSubscriptions = (client: ClientBase) => {\n /**\n * Cancel a subscription of the authenticated customer.\n *\n * @param id - The subscription ID.\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {AlreadyCanceledSubscription} Customer subscription is already canceled or will be at the end of the period, or the user lacks billing permissions.\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 403: AlreadyCanceledSubscription,\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const updateSubscriptions = (client: ClientBase) => {\n /**\n * Update a subscription of the authenticated customer.\n *\n * @param id - The subscription ID.\n * @param body - Request body\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {PaymentFailed} Payment required to apply the subscription update.\n * @throws {Update403Error} Customer subscription is already canceled or will be at the end of the period, the user lacks billing permissions, or pausing/resuming is not enabled for the organization.\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string, body: CustomerSubscriptionUpdate): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"PATCH\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 402: PaymentFailed,\n 403: Update403Error,\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\n\nexport function createSubscriptionsService(client: ClientBase) {\n return {\n list: listSubscriptions(client),\n get: getSubscriptions(client),\n cancel: cancelSubscriptions(client),\n update: updateSubscriptions(client),\n iterList: iterListSubscriptions(client),\n };\n}\n\nexport type Subscriptions = ReturnType<typeof createSubscriptionsService>;\n"],"mappings":";;;AAgBA,MAAa,qBAAqB,WAAuB;;;;;;;;;;;;;CAavD,OAAO,OAAO,UAOmC;EAC/C,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,YAAY,OAAO;GACnB,QAAQ,OAAO;GACf,OAAO,OAAO;GACd,MAAM,OAAO,QAAQ;GACrB,OAAO,OAAO,SAAS;GACvB,SAAS,OAAO,WAAW,CAAC,aAAa;EAC3C;EACA,MAAM,UAAU,OAAO,aACrB,OACA,sCACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,OAAO;EACjD,OAAO,OAAO,cA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AAO;EACjD,OAAO,OAAO,cAAoC,UAAU,QAAQ;GAClE,KAAKG,eAAAA;GACL,KAAKC,eAAAA;GACL,KAAKH,eAAAA;GACL,KAAKD,eAAAA;EACP,CAAC;CACH;AACF;AAEA,SAAgB,2BAA2B,QAAoB;CAC7D,OAAO;EACL,MAAM,kBAAkB,MAAM;EAC9B,KAAK,iBAAiB,MAAM;EAC5B,QAAQ,oBAAoB,MAAM;EAClC,QAAQ,oBAAoB,MAAM;EAClC,UAAU,sBAAsB,MAAM;CACxC;AACF"}
|
|
@@ -21,7 +21,7 @@ declare const listSubscriptions: (client: ClientBase) => (query?: {
|
|
|
21
21
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
22
22
|
* @throws {HTTPValidationError} Validation Error
|
|
23
23
|
*/
|
|
24
|
-
declare const
|
|
24
|
+
declare const iterListSubscriptions: (client: ClientBase) => (query?: {
|
|
25
25
|
product_id?: string | string[] | null;
|
|
26
26
|
active?: boolean | null;
|
|
27
27
|
query?: string | null;
|
|
@@ -44,7 +44,7 @@ declare function createSubscriptionsService(client: ClientBase): {
|
|
|
44
44
|
get: (id: string) => Promise<CustomerSubscription>;
|
|
45
45
|
cancel: (id: string) => Promise<CustomerSubscription>;
|
|
46
46
|
update: (id: string, body: CustomerSubscriptionUpdate) => Promise<CustomerSubscription>;
|
|
47
|
-
|
|
47
|
+
iterList: (query?: {
|
|
48
48
|
product_id?: string | string[] | null;
|
|
49
49
|
active?: boolean | null;
|
|
50
50
|
query?: string | null;
|
|
@@ -55,5 +55,5 @@ declare function createSubscriptionsService(client: ClientBase): {
|
|
|
55
55
|
};
|
|
56
56
|
type Subscriptions = ReturnType<typeof createSubscriptionsService>;
|
|
57
57
|
//#endregion
|
|
58
|
-
export { Subscriptions, cancelSubscriptions, createSubscriptionsService, getSubscriptions,
|
|
58
|
+
export { Subscriptions, cancelSubscriptions, createSubscriptionsService, getSubscriptions, iterListSubscriptions, listSubscriptions, updateSubscriptions };
|
|
59
59
|
//# sourceMappingURL=subscriptions.d.cts.map
|
|
@@ -21,7 +21,7 @@ declare const listSubscriptions: (client: ClientBase) => (query?: {
|
|
|
21
21
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
22
22
|
* @throws {HTTPValidationError} Validation Error
|
|
23
23
|
*/
|
|
24
|
-
declare const
|
|
24
|
+
declare const iterListSubscriptions: (client: ClientBase) => (query?: {
|
|
25
25
|
product_id?: string | string[] | null;
|
|
26
26
|
active?: boolean | null;
|
|
27
27
|
query?: string | null;
|
|
@@ -44,7 +44,7 @@ declare function createSubscriptionsService(client: ClientBase): {
|
|
|
44
44
|
get: (id: string) => Promise<CustomerSubscription>;
|
|
45
45
|
cancel: (id: string) => Promise<CustomerSubscription>;
|
|
46
46
|
update: (id: string, body: CustomerSubscriptionUpdate) => Promise<CustomerSubscription>;
|
|
47
|
-
|
|
47
|
+
iterList: (query?: {
|
|
48
48
|
product_id?: string | string[] | null;
|
|
49
49
|
active?: boolean | null;
|
|
50
50
|
query?: string | null;
|
|
@@ -55,5 +55,5 @@ declare function createSubscriptionsService(client: ClientBase): {
|
|
|
55
55
|
};
|
|
56
56
|
type Subscriptions = ReturnType<typeof createSubscriptionsService>;
|
|
57
57
|
//#endregion
|
|
58
|
-
export { Subscriptions, cancelSubscriptions, createSubscriptionsService, getSubscriptions,
|
|
58
|
+
export { Subscriptions, cancelSubscriptions, createSubscriptionsService, getSubscriptions, iterListSubscriptions, listSubscriptions, updateSubscriptions };
|
|
59
59
|
//# sourceMappingURL=subscriptions.d.mts.map
|
|
@@ -40,7 +40,7 @@ const listSubscriptions = (client) => {
|
|
|
40
40
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
41
41
|
* @throws {HTTPValidationError} Validation Error
|
|
42
42
|
*/
|
|
43
|
-
const
|
|
43
|
+
const iterListSubscriptions = (client) => {
|
|
44
44
|
return async function* (query) {
|
|
45
45
|
let page;
|
|
46
46
|
page = query?.page ?? 1;
|
|
@@ -139,10 +139,10 @@ function createSubscriptionsService(client) {
|
|
|
139
139
|
get: getSubscriptions(client),
|
|
140
140
|
cancel: cancelSubscriptions(client),
|
|
141
141
|
update: updateSubscriptions(client),
|
|
142
|
-
|
|
142
|
+
iterList: iterListSubscriptions(client)
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
145
|
//#endregion
|
|
146
|
-
export { cancelSubscriptions, createSubscriptionsService, getSubscriptions,
|
|
146
|
+
export { cancelSubscriptions, createSubscriptionsService, getSubscriptions, iterListSubscriptions, listSubscriptions, updateSubscriptions };
|
|
147
147
|
|
|
148
148
|
//# sourceMappingURL=subscriptions.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.mjs","names":[],"sources":["../../../../src/2026-04/services/customer_portal/subscriptions.ts"],"sourcesContent":["import type { ClientBase } from \"../../../base\";\nimport type {\n CustomerSubscription,\n CustomerSubscriptionSortProperty,\n CustomerSubscriptionUpdate,\n ListResourceCustomerSubscription,\n} from \"../../models\";\n\nimport {\n AlreadyCanceledSubscription,\n HTTPValidationError,\n PaymentFailed,\n ResourceNotFound,\n Update403Error,\n} from \"../../errors\";\n\nexport const listSubscriptions = (client: ClientBase) => {\n /**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @returns {ListResourceCustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (query?: {\n product_id?: string | string[] | null;\n active?: boolean | null;\n query?: string | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSubscriptionSortProperty[] | null;\n }): Promise<ListResourceCustomerSubscription> => {\n const pathParams = {};\n const queryParams = {\n product_id: query?.product_id,\n active: query?.active,\n query: query?.query,\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n sorting: query?.sorting ?? [\"-started_at\"],\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/subscriptions/\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<ListResourceCustomerSubscription>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @returns {AsyncGenerator<CustomerSubscription>} A generator that yields items of type CustomerSubscription.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\nexport const
|
|
1
|
+
{"version":3,"file":"subscriptions.mjs","names":[],"sources":["../../../../src/2026-04/services/customer_portal/subscriptions.ts"],"sourcesContent":["import type { ClientBase } from \"../../../base\";\nimport type {\n CustomerSubscription,\n CustomerSubscriptionSortProperty,\n CustomerSubscriptionUpdate,\n ListResourceCustomerSubscription,\n} from \"../../models\";\n\nimport {\n AlreadyCanceledSubscription,\n HTTPValidationError,\n PaymentFailed,\n ResourceNotFound,\n Update403Error,\n} from \"../../errors\";\n\nexport const listSubscriptions = (client: ClientBase) => {\n /**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @returns {ListResourceCustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (query?: {\n product_id?: string | string[] | null;\n active?: boolean | null;\n query?: string | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSubscriptionSortProperty[] | null;\n }): Promise<ListResourceCustomerSubscription> => {\n const pathParams = {};\n const queryParams = {\n product_id: query?.product_id,\n active: query?.active,\n query: query?.query,\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n sorting: query?.sorting ?? [\"-started_at\"],\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/subscriptions/\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<ListResourceCustomerSubscription>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List subscriptions of the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param query - Query parameters\n * @returns {AsyncGenerator<CustomerSubscription>} A generator that yields items of type CustomerSubscription.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListSubscriptions = (client: ClientBase) => {\n return async function* (query?: {\n product_id?: string | string[] | null;\n active?: boolean | null;\n query?: string | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSubscriptionSortProperty[] | null;\n }): AsyncGenerator<CustomerSubscription> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listSubscriptions(client)({ ...query, page, limit });\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\nexport const getSubscriptions = (client: ClientBase) => {\n /**\n * Get a subscription for the authenticated customer.\n *\n * **Scopes**: `customer_portal:read` `customer_portal:write`\n *\n * @param id - The subscription ID.\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const cancelSubscriptions = (client: ClientBase) => {\n /**\n * Cancel a subscription of the authenticated customer.\n *\n * @param id - The subscription ID.\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {AlreadyCanceledSubscription} Customer subscription is already canceled or will be at the end of the period, or the user lacks billing permissions.\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 403: AlreadyCanceledSubscription,\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const updateSubscriptions = (client: ClientBase) => {\n /**\n * Update a subscription of the authenticated customer.\n *\n * @param id - The subscription ID.\n * @param body - Request body\n * @returns {CustomerSubscription}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {PaymentFailed} Payment required to apply the subscription update.\n * @throws {Update403Error} Customer subscription is already canceled or will be at the end of the period, the user lacks billing permissions, or pausing/resuming is not enabled for the organization.\n * @throws {ResourceNotFound} Customer subscription was not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string, body: CustomerSubscriptionUpdate): Promise<CustomerSubscription> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"PATCH\",\n \"/v1/customer-portal/subscriptions/{id}\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<CustomerSubscription>(response, \"json\", {\n 402: PaymentFailed,\n 403: Update403Error,\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\n\nexport function createSubscriptionsService(client: ClientBase) {\n return {\n list: listSubscriptions(client),\n get: getSubscriptions(client),\n cancel: cancelSubscriptions(client),\n update: updateSubscriptions(client),\n iterList: iterListSubscriptions(client),\n };\n}\n\nexport type Subscriptions = ReturnType<typeof createSubscriptionsService>;\n"],"mappings":";;AAgBA,MAAa,qBAAqB,WAAuB;;;;;;;;;;;;;CAavD,OAAO,OAAO,UAOmC;EAC/C,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,YAAY,OAAO;GACnB,QAAQ,OAAO;GACf,OAAO,OAAO;GACd,MAAM,OAAO,QAAQ;GACrB,OAAO,OAAO,SAAS;GACvB,SAAS,OAAO,WAAW,CAAC,aAAa;EAC3C;EACA,MAAM,UAAU,OAAO,aACrB,OACA,sCACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,OAAO;EACjD,OAAO,OAAO,cAAgD,UAAU,QAAQ,EAC9E,KAAK,oBACP,CAAC;CACH;AACF;;;;;;;;;;;;;AAaA,MAAa,yBAAyB,WAAuB;CAC3D,OAAO,iBAAiB,OAOiB;EACvC,IAAI;EACJ,OAAO,OAAO,QAAQ;EACtB,IAAI;EACJ,QAAQ,OAAO;EAEf,OAAO,MAAM;GACX,MAAM,WAAW,MAAM,kBAAkB,MAAM,CAAC,CAAC;IAAE,GAAG;IAAO;IAAM;GAAM,CAAC;GAC1E,KAAK,MAAM,QAAQ,SAAS,OAC1B,MAAM;GAER,IAAI,QAAQ,SAAS,WAAW,UAC9B;GAEF;EACF;CACF;AACF;AACA,MAAa,oBAAoB,WAAuB;;;;;;;;;;;;;;CActD,OAAO,OAAO,OAA8C;EAC1D,MAAM,aAAa,EACb,GACN;EAEA,MAAM,UAAU,OAAO,aACrB,OACA,0CACA,YACA,CAAU,GACV,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,OAAO;EACjD,OAAO,OAAO,cAAoC,UAAU,QAAQ;GAClE,KAAK;GACL,KAAK;EACP,CAAC;CACH;AACF;AACA,MAAa,uBAAuB,WAAuB;;;;;;;;;;;;;CAazD,OAAO,OAAO,OAA8C;EAC1D,MAAM,aAAa,EACb,GACN;EAEA,MAAM,UAAU,OAAO,aACrB,UACA,0CACA,YACA,CAAU,GACV,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,OAAO;EACjD,OAAO,OAAO,cAAoC,UAAU,QAAQ;GAClE,KAAK;GACL,KAAK;GACL,KAAK;EACP,CAAC;CACH;AACF;AACA,MAAa,uBAAuB,WAAuB;;;;;;;;;;;;;;;CAezD,OAAO,OAAO,IAAY,SAAoE;EAC5F,MAAM,aAAa,EACb,GACN;EAEA,MAAM,UAAU,OAAO,aACrB,SACA,0CACA,YACA,CAAU,GACV,IACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,OAAO;EACjD,OAAO,OAAO,cAAoC,UAAU,QAAQ;GAClE,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;EACP,CAAC;CACH;AACF;AAEA,SAAgB,2BAA2B,QAAoB;CAC7D,OAAO;EACL,MAAM,kBAAkB,MAAM;EAC9B,KAAK,iBAAiB,MAAM;EAC5B,QAAQ,oBAAoB,MAAM;EAClC,QAAQ,oBAAoB,MAAM;EAClC,UAAU,sBAAsB,MAAM;CACxC;AACF"}
|
|
@@ -34,7 +34,7 @@ const listWallets = (client) => {
|
|
|
34
34
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
35
35
|
* @throws {HTTPValidationError} Validation Error
|
|
36
36
|
*/
|
|
37
|
-
const
|
|
37
|
+
const iterListWallets = (client) => {
|
|
38
38
|
return async function* (query) {
|
|
39
39
|
let page;
|
|
40
40
|
page = query?.page ?? 1;
|
|
@@ -78,13 +78,13 @@ function createWalletsService(client) {
|
|
|
78
78
|
return {
|
|
79
79
|
list: listWallets(client),
|
|
80
80
|
get: getWallets(client),
|
|
81
|
-
|
|
81
|
+
iterList: iterListWallets(client)
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
//#endregion
|
|
85
85
|
exports.createWalletsService = createWalletsService;
|
|
86
86
|
exports.getWallets = getWallets;
|
|
87
|
-
exports.
|
|
87
|
+
exports.iterListWallets = iterListWallets;
|
|
88
88
|
exports.listWallets = listWallets;
|
|
89
89
|
|
|
90
90
|
//# sourceMappingURL=wallets.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.cjs","names":["HTTPValidationError","ResourceNotFound"],"sources":["../../../../src/2026-04/services/customer_portal/wallets.ts"],"sourcesContent":["import type { ClientBase } from \"../../../base\";\nimport type {\n CustomerWallet,\n CustomerWalletSortProperty,\n ListResourceCustomerWallet,\n} from \"../../models\";\n\nimport { HTTPValidationError, ResourceNotFound } from \"../../errors\";\n\nexport const listWallets = (client: ClientBase) => {\n /**\n * List wallets of the authenticated customer.\n *\n * @param query - Query parameters\n * @returns {ListResourceCustomerWallet}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (query?: {\n page?: number;\n limit?: number;\n sorting?: CustomerWalletSortProperty[] | null;\n }): Promise<ListResourceCustomerWallet> => {\n const pathParams = {};\n const queryParams = {\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n sorting: query?.sorting ?? [\"-created_at\"],\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/wallets/\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<ListResourceCustomerWallet>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List wallets of the authenticated customer.\n *\n * @param query - Query parameters\n * @returns {AsyncGenerator<CustomerWallet>} A generator that yields items of type CustomerWallet.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\nexport const
|
|
1
|
+
{"version":3,"file":"wallets.cjs","names":["HTTPValidationError","ResourceNotFound"],"sources":["../../../../src/2026-04/services/customer_portal/wallets.ts"],"sourcesContent":["import type { ClientBase } from \"../../../base\";\nimport type {\n CustomerWallet,\n CustomerWalletSortProperty,\n ListResourceCustomerWallet,\n} from \"../../models\";\n\nimport { HTTPValidationError, ResourceNotFound } from \"../../errors\";\n\nexport const listWallets = (client: ClientBase) => {\n /**\n * List wallets of the authenticated customer.\n *\n * @param query - Query parameters\n * @returns {ListResourceCustomerWallet}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (query?: {\n page?: number;\n limit?: number;\n sorting?: CustomerWalletSortProperty[] | null;\n }): Promise<ListResourceCustomerWallet> => {\n const pathParams = {};\n const queryParams = {\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n sorting: query?.sorting ?? [\"-created_at\"],\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/wallets/\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<ListResourceCustomerWallet>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List wallets of the authenticated customer.\n *\n * @param query - Query parameters\n * @returns {AsyncGenerator<CustomerWallet>} A generator that yields items of type CustomerWallet.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListWallets = (client: ClientBase) => {\n return async function* (query?: {\n page?: number;\n limit?: number;\n sorting?: CustomerWalletSortProperty[] | null;\n }): AsyncGenerator<CustomerWallet> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listWallets(client)({ ...query, page, limit });\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\nexport const getWallets = (client: ClientBase) => {\n /**\n * Get a wallet by ID for the authenticated customer.\n *\n * @param id - The wallet ID.\n * @returns {CustomerWallet}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Wallet not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string): Promise<CustomerWallet> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/wallets/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<CustomerWallet>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\n\nexport function createWalletsService(client: ClientBase) {\n return {\n list: listWallets(client),\n get: getWallets(client),\n iterList: iterListWallets(client),\n };\n}\n\nexport type Wallets = ReturnType<typeof createWalletsService>;\n"],"mappings":";;;AASA,MAAa,eAAe,WAAuB;;;;;;;;;;;CAWjD,OAAO,OAAO,UAI6B;EACzC,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,MAAM,OAAO,QAAQ;GACrB,OAAO,OAAO,SAAS;GACvB,SAAS,OAAO,WAAW,CAAC,aAAa;EAC3C;EACA,MAAM,UAAU,OAAO,aACrB,OACA,gCACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,OAAO;EACjD,OAAO,OAAO,cAA0C,UAAU,QAAQ,EACxE,KAAKA,eAAAA,oBACP,CAAC;CACH;AACF;;;;;;;;;;;AAWA,MAAa,mBAAmB,WAAuB;CACrD,OAAO,iBAAiB,OAIW;EACjC,IAAI;EACJ,OAAO,OAAO,QAAQ;EACtB,IAAI;EACJ,QAAQ,OAAO;EAEf,OAAO,MAAM;GACX,MAAM,WAAW,MAAM,YAAY,MAAM,CAAC,CAAC;IAAE,GAAG;IAAO;IAAM;GAAM,CAAC;GACpE,KAAK,MAAM,QAAQ,SAAS,OAC1B,MAAM;GAER,IAAI,QAAQ,SAAS,WAAW,UAC9B;GAEF;EACF;CACF;AACF;AACA,MAAa,cAAc,WAAuB;;;;;;;;;;;;CAYhD,OAAO,OAAO,OAAwC;EACpD,MAAM,aAAa,EACb,GACN;EAEA,MAAM,UAAU,OAAO,aACrB,OACA,oCACA,YACA,CAAU,GACV,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,OAAO;EACjD,OAAO,OAAO,cAA8B,UAAU,QAAQ;GAC5D,KAAKC,eAAAA;GACL,KAAKD,eAAAA;EACP,CAAC;CACH;AACF;AAEA,SAAgB,qBAAqB,QAAoB;CACvD,OAAO;EACL,MAAM,YAAY,MAAM;EACxB,KAAK,WAAW,MAAM;EACtB,UAAU,gBAAgB,MAAM;CAClC;AACF"}
|
|
@@ -16,7 +16,7 @@ declare const listWallets: (client: ClientBase) => (query?: {
|
|
|
16
16
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
17
17
|
* @throws {HTTPValidationError} Validation Error
|
|
18
18
|
*/
|
|
19
|
-
declare const
|
|
19
|
+
declare const iterListWallets: (client: ClientBase) => (query?: {
|
|
20
20
|
page?: number;
|
|
21
21
|
limit?: number;
|
|
22
22
|
sorting?: CustomerWalletSortProperty[] | null;
|
|
@@ -29,7 +29,7 @@ declare function createWalletsService(client: ClientBase): {
|
|
|
29
29
|
sorting?: CustomerWalletSortProperty[] | null;
|
|
30
30
|
}) => Promise<ListResourceCustomerWallet>;
|
|
31
31
|
get: (id: string) => Promise<CustomerWallet>;
|
|
32
|
-
|
|
32
|
+
iterList: (query?: {
|
|
33
33
|
page?: number;
|
|
34
34
|
limit?: number;
|
|
35
35
|
sorting?: CustomerWalletSortProperty[] | null;
|
|
@@ -37,5 +37,5 @@ declare function createWalletsService(client: ClientBase): {
|
|
|
37
37
|
};
|
|
38
38
|
type Wallets = ReturnType<typeof createWalletsService>;
|
|
39
39
|
//#endregion
|
|
40
|
-
export { Wallets, createWalletsService, getWallets,
|
|
40
|
+
export { Wallets, createWalletsService, getWallets, iterListWallets, listWallets };
|
|
41
41
|
//# sourceMappingURL=wallets.d.cts.map
|
|
@@ -16,7 +16,7 @@ declare const listWallets: (client: ClientBase) => (query?: {
|
|
|
16
16
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
17
17
|
* @throws {HTTPValidationError} Validation Error
|
|
18
18
|
*/
|
|
19
|
-
declare const
|
|
19
|
+
declare const iterListWallets: (client: ClientBase) => (query?: {
|
|
20
20
|
page?: number;
|
|
21
21
|
limit?: number;
|
|
22
22
|
sorting?: CustomerWalletSortProperty[] | null;
|
|
@@ -29,7 +29,7 @@ declare function createWalletsService(client: ClientBase): {
|
|
|
29
29
|
sorting?: CustomerWalletSortProperty[] | null;
|
|
30
30
|
}) => Promise<ListResourceCustomerWallet>;
|
|
31
31
|
get: (id: string) => Promise<CustomerWallet>;
|
|
32
|
-
|
|
32
|
+
iterList: (query?: {
|
|
33
33
|
page?: number;
|
|
34
34
|
limit?: number;
|
|
35
35
|
sorting?: CustomerWalletSortProperty[] | null;
|
|
@@ -37,5 +37,5 @@ declare function createWalletsService(client: ClientBase): {
|
|
|
37
37
|
};
|
|
38
38
|
type Wallets = ReturnType<typeof createWalletsService>;
|
|
39
39
|
//#endregion
|
|
40
|
-
export { Wallets, createWalletsService, getWallets,
|
|
40
|
+
export { Wallets, createWalletsService, getWallets, iterListWallets, listWallets };
|
|
41
41
|
//# sourceMappingURL=wallets.d.mts.map
|
|
@@ -33,7 +33,7 @@ const listWallets = (client) => {
|
|
|
33
33
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
34
34
|
* @throws {HTTPValidationError} Validation Error
|
|
35
35
|
*/
|
|
36
|
-
const
|
|
36
|
+
const iterListWallets = (client) => {
|
|
37
37
|
return async function* (query) {
|
|
38
38
|
let page;
|
|
39
39
|
page = query?.page ?? 1;
|
|
@@ -77,10 +77,10 @@ function createWalletsService(client) {
|
|
|
77
77
|
return {
|
|
78
78
|
list: listWallets(client),
|
|
79
79
|
get: getWallets(client),
|
|
80
|
-
|
|
80
|
+
iterList: iterListWallets(client)
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
//#endregion
|
|
84
|
-
export { createWalletsService, getWallets,
|
|
84
|
+
export { createWalletsService, getWallets, iterListWallets, listWallets };
|
|
85
85
|
|
|
86
86
|
//# sourceMappingURL=wallets.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.mjs","names":[],"sources":["../../../../src/2026-04/services/customer_portal/wallets.ts"],"sourcesContent":["import type { ClientBase } from \"../../../base\";\nimport type {\n CustomerWallet,\n CustomerWalletSortProperty,\n ListResourceCustomerWallet,\n} from \"../../models\";\n\nimport { HTTPValidationError, ResourceNotFound } from \"../../errors\";\n\nexport const listWallets = (client: ClientBase) => {\n /**\n * List wallets of the authenticated customer.\n *\n * @param query - Query parameters\n * @returns {ListResourceCustomerWallet}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (query?: {\n page?: number;\n limit?: number;\n sorting?: CustomerWalletSortProperty[] | null;\n }): Promise<ListResourceCustomerWallet> => {\n const pathParams = {};\n const queryParams = {\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n sorting: query?.sorting ?? [\"-created_at\"],\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/wallets/\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<ListResourceCustomerWallet>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List wallets of the authenticated customer.\n *\n * @param query - Query parameters\n * @returns {AsyncGenerator<CustomerWallet>} A generator that yields items of type CustomerWallet.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\nexport const
|
|
1
|
+
{"version":3,"file":"wallets.mjs","names":[],"sources":["../../../../src/2026-04/services/customer_portal/wallets.ts"],"sourcesContent":["import type { ClientBase } from \"../../../base\";\nimport type {\n CustomerWallet,\n CustomerWalletSortProperty,\n ListResourceCustomerWallet,\n} from \"../../models\";\n\nimport { HTTPValidationError, ResourceNotFound } from \"../../errors\";\n\nexport const listWallets = (client: ClientBase) => {\n /**\n * List wallets of the authenticated customer.\n *\n * @param query - Query parameters\n * @returns {ListResourceCustomerWallet}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (query?: {\n page?: number;\n limit?: number;\n sorting?: CustomerWalletSortProperty[] | null;\n }): Promise<ListResourceCustomerWallet> => {\n const pathParams = {};\n const queryParams = {\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n sorting: query?.sorting ?? [\"-created_at\"],\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/wallets/\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<ListResourceCustomerWallet>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List wallets of the authenticated customer.\n *\n * @param query - Query parameters\n * @returns {AsyncGenerator<CustomerWallet>} A generator that yields items of type CustomerWallet.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListWallets = (client: ClientBase) => {\n return async function* (query?: {\n page?: number;\n limit?: number;\n sorting?: CustomerWalletSortProperty[] | null;\n }): AsyncGenerator<CustomerWallet> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listWallets(client)({ ...query, page, limit });\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\nexport const getWallets = (client: ClientBase) => {\n /**\n * Get a wallet by ID for the authenticated customer.\n *\n * @param id - The wallet ID.\n * @returns {CustomerWallet}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Wallet not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string): Promise<CustomerWallet> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customer-portal/wallets/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<CustomerWallet>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\n\nexport function createWalletsService(client: ClientBase) {\n return {\n list: listWallets(client),\n get: getWallets(client),\n iterList: iterListWallets(client),\n };\n}\n\nexport type Wallets = ReturnType<typeof createWalletsService>;\n"],"mappings":";;AASA,MAAa,eAAe,WAAuB;;;;;;;;;;;CAWjD,OAAO,OAAO,UAI6B;EACzC,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,MAAM,OAAO,QAAQ;GACrB,OAAO,OAAO,SAAS;GACvB,SAAS,OAAO,WAAW,CAAC,aAAa;EAC3C;EACA,MAAM,UAAU,OAAO,aACrB,OACA,gCACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,OAAO;EACjD,OAAO,OAAO,cAA0C,UAAU,QAAQ,EACxE,KAAK,oBACP,CAAC;CACH;AACF;;;;;;;;;;;AAWA,MAAa,mBAAmB,WAAuB;CACrD,OAAO,iBAAiB,OAIW;EACjC,IAAI;EACJ,OAAO,OAAO,QAAQ;EACtB,IAAI;EACJ,QAAQ,OAAO;EAEf,OAAO,MAAM;GACX,MAAM,WAAW,MAAM,YAAY,MAAM,CAAC,CAAC;IAAE,GAAG;IAAO;IAAM;GAAM,CAAC;GACpE,KAAK,MAAM,QAAQ,SAAS,OAC1B,MAAM;GAER,IAAI,QAAQ,SAAS,WAAW,UAC9B;GAEF;EACF;CACF;AACF;AACA,MAAa,cAAc,WAAuB;;;;;;;;;;;;CAYhD,OAAO,OAAO,OAAwC;EACpD,MAAM,aAAa,EACb,GACN;EAEA,MAAM,UAAU,OAAO,aACrB,OACA,oCACA,YACA,CAAU,GACV,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,OAAO;EACjD,OAAO,OAAO,cAA8B,UAAU,QAAQ;GAC5D,KAAK;GACL,KAAK;EACP,CAAC;CACH;AACF;AAEA,SAAgB,qBAAqB,QAAoB;CACvD,OAAO;EACL,MAAM,YAAY,MAAM;EACxB,KAAK,WAAW,MAAM;EACtB,UAAU,gBAAgB,MAAM;CAClC;AACF"}
|
|
@@ -44,7 +44,7 @@ const listCustomers = (client) => {
|
|
|
44
44
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
45
45
|
* @throws {HTTPValidationError} Validation Error
|
|
46
46
|
*/
|
|
47
|
-
const
|
|
47
|
+
const iterListCustomers = (client) => {
|
|
48
48
|
return async function* (query) {
|
|
49
49
|
let page;
|
|
50
50
|
page = query?.page ?? 1;
|
|
@@ -373,7 +373,7 @@ const listPaymentMethodsCustomers = (client) => {
|
|
|
373
373
|
* @throws {ResourceNotFound} Customer not found.
|
|
374
374
|
* @throws {HTTPValidationError} Validation Error
|
|
375
375
|
*/
|
|
376
|
-
const
|
|
376
|
+
const iterListPaymentMethodsCustomers = (client) => {
|
|
377
377
|
return async function* (id, query) {
|
|
378
378
|
let page;
|
|
379
379
|
page = query?.page ?? 1;
|
|
@@ -434,7 +434,7 @@ const listPaymentMethodsExternalCustomers = (client) => {
|
|
|
434
434
|
* @throws {ResourceNotFound} Customer not found.
|
|
435
435
|
* @throws {HTTPValidationError} Validation Error
|
|
436
436
|
*/
|
|
437
|
-
const
|
|
437
|
+
const iterListPaymentMethodsExternalCustomers = (client) => {
|
|
438
438
|
return async function* (external_id, query) {
|
|
439
439
|
let page;
|
|
440
440
|
page = query?.page ?? 1;
|
|
@@ -467,9 +467,9 @@ function createCustomersService(client) {
|
|
|
467
467
|
getStateExternal: getStateExternalCustomers(client),
|
|
468
468
|
listPaymentMethods: listPaymentMethodsCustomers(client),
|
|
469
469
|
listPaymentMethodsExternal: listPaymentMethodsExternalCustomers(client),
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
470
|
+
iterList: iterListCustomers(client),
|
|
471
|
+
iterListPaymentMethods: iterListPaymentMethodsCustomers(client),
|
|
472
|
+
iterListPaymentMethodsExternal: iterListPaymentMethodsExternalCustomers(client),
|
|
473
473
|
members: require_2026_04_services_customers_members.createMembersService(client)
|
|
474
474
|
};
|
|
475
475
|
}
|
|
@@ -483,9 +483,9 @@ exports.getCustomers = getCustomers;
|
|
|
483
483
|
exports.getExternalCustomers = getExternalCustomers;
|
|
484
484
|
exports.getStateCustomers = getStateCustomers;
|
|
485
485
|
exports.getStateExternalCustomers = getStateExternalCustomers;
|
|
486
|
-
exports.
|
|
487
|
-
exports.
|
|
488
|
-
exports.
|
|
486
|
+
exports.iterListCustomers = iterListCustomers;
|
|
487
|
+
exports.iterListPaymentMethodsCustomers = iterListPaymentMethodsCustomers;
|
|
488
|
+
exports.iterListPaymentMethodsExternalCustomers = iterListPaymentMethodsExternalCustomers;
|
|
489
489
|
exports.listCustomers = listCustomers;
|
|
490
490
|
exports.listPaymentMethodsCustomers = listPaymentMethodsCustomers;
|
|
491
491
|
exports.listPaymentMethodsExternalCustomers = listPaymentMethodsExternalCustomers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["HTTPValidationError","ResourceNotFound","createMembersService"],"sources":["../../../../src/2026-04/services/customers/index.ts"],"sourcesContent":["import type { ClientBase } from \"../../../base\";\nimport type {\n Customer,\n CustomerCreate,\n CustomerSortProperty,\n CustomerState,\n CustomerUpdate,\n CustomerUpdateExternalID,\n ListResourceCustomer,\n ListResourcePaymentMethod,\n MetadataQuery,\n PaymentMethod,\n} from \"../../models\";\n\nimport { HTTPValidationError, ResourceNotFound } from \"../../errors\";\nimport { createMembersService } from \"./members\";\n\nexport const listCustomers = (client: ClientBase) => {\n /**\n * List customers.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param query - Query parameters\n * @returns {ListResourceCustomer}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (query?: {\n organization_id?: string | string[] | null;\n email?: string | null;\n query?: string | null;\n active?: boolean | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSortProperty[] | null;\n metadata?: MetadataQuery;\n }): Promise<ListResourceCustomer> => {\n const pathParams = {};\n const queryParams = {\n organization_id: query?.organization_id,\n email: query?.email,\n query: query?.query,\n active: query?.active,\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n sorting: query?.sorting ?? [\"-created_at\"],\n metadata: query?.metadata,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<ListResourceCustomer>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List customers.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param query - Query parameters\n * @returns {AsyncGenerator<Customer>} A generator that yields items of type Customer.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterlistCustomers = (client: ClientBase) => {\n return async function* (query?: {\n organization_id?: string | string[] | null;\n email?: string | null;\n query?: string | null;\n active?: boolean | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSortProperty[] | null;\n metadata?: MetadataQuery;\n }): AsyncGenerator<Customer> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listCustomers(client)({ ...query, page, limit });\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\nexport const createCustomers = (client: ClientBase) => {\n /**\n * Create a customer.\n *\n * **Scopes**: `customers:write`\n *\n * @param body - Request body\n * @returns {Customer}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (body: CustomerCreate): Promise<Customer> => {\n const pathParams = {};\n const queryParams = {};\n const request = client.buildRequest(\"POST\", \"/v1/customers/\", pathParams, queryParams, body);\n const response = await client.sendRequest(request);\n return client.parseResponse<Customer>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\nexport const exportCustomers = (client: ClientBase) => {\n /**\n * Export customers as a CSV file.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param query - Query parameters\n * @returns {string}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (query?: { organization_id?: string | string[] | null }): Promise<string> => {\n const pathParams = {};\n const queryParams = {\n organization_id: query?.organization_id,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/export\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<string>(response, \"text\", {\n 422: HTTPValidationError,\n });\n };\n};\nexport const getCustomers = (client: ClientBase) => {\n /**\n * Get a customer by ID.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param id - The customer ID.\n * @returns {Customer}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string): Promise<Customer> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<Customer>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const deleteCustomers = (client: ClientBase) => {\n /**\n * Delete a customer.\n *\n * This action cannot be undone and will immediately:\n * - Cancel any active subscriptions for the customer\n * - Revoke all their benefits\n * - Clear any `external_id`\n *\n * Use it only in the context of deleting a user within your\n * own service. Otherwise, use more granular API endpoints to cancel\n * a specific subscription or revoke certain benefits.\n *\n * Note: The customers information will nonetheless be retained for historic\n * orders and subscriptions.\n *\n * Set `anonymize=true` to also anonymize PII for GDPR compliance.\n *\n * **Scopes**: `customers:write`\n *\n * @param id - The customer ID.\n * @param query - Query parameters\n * @returns {void}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n id: string,\n query?: {\n anonymize?: boolean;\n },\n ): Promise<void> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {\n anonymize: query?.anonymize,\n };\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customers/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<void>(response, \"none\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const updateCustomers = (client: ClientBase) => {\n /**\n * Update a customer.\n *\n * **Scopes**: `customers:write`\n *\n * @param id - The customer ID.\n * @param body - Request body\n * @returns {Customer}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string, body: CustomerUpdate): Promise<Customer> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"PATCH\",\n \"/v1/customers/{id}\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<Customer>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const getExternalCustomers = (client: ClientBase) => {\n /**\n * Get a customer by external ID.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param external_id - The customer external ID.\n * @returns {Customer}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (external_id: string): Promise<Customer> => {\n const pathParams = {\n external_id: external_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/external/{external_id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<Customer>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const deleteExternalCustomers = (client: ClientBase) => {\n /**\n * Delete a customer by external ID.\n *\n * Immediately cancels any active subscriptions and revokes any active benefits.\n *\n * Set `anonymize=true` to also anonymize PII for GDPR compliance.\n *\n * **Scopes**: `customers:write`\n *\n * @param external_id - The customer external ID.\n * @param query - Query parameters\n * @returns {void}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n external_id: string,\n query?: {\n anonymize?: boolean;\n },\n ): Promise<void> => {\n const pathParams = {\n external_id: external_id,\n };\n const queryParams = {\n anonymize: query?.anonymize,\n };\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customers/external/{external_id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<void>(response, \"none\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const updateExternalCustomers = (client: ClientBase) => {\n /**\n * Update a customer by external ID.\n *\n * **Scopes**: `customers:write`\n *\n * @param external_id - The customer external ID.\n * @param body - Request body\n * @returns {Customer}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (external_id: string, body: CustomerUpdateExternalID): Promise<Customer> => {\n const pathParams = {\n external_id: external_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"PATCH\",\n \"/v1/customers/external/{external_id}\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<Customer>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const getStateCustomers = (client: ClientBase) => {\n /**\n * Get a customer state by ID.\n *\n * The customer state includes information about\n * the customer's active subscriptions and benefits.\n *\n * It's the ideal endpoint to use when you need to get a full overview\n * of a customer's status.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param id - The customer ID.\n * @returns {CustomerState}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string): Promise<CustomerState> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/{id}/state\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<CustomerState>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const getStateExternalCustomers = (client: ClientBase) => {\n /**\n * Get a customer state by external ID.\n *\n * The customer state includes information about\n * the customer's active subscriptions and benefits.\n *\n * It's the ideal endpoint to use when you need to get a full overview\n * of a customer's status.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param external_id - The customer external ID.\n * @returns {CustomerState}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (external_id: string): Promise<CustomerState> => {\n const pathParams = {\n external_id: external_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/external/{external_id}/state\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<CustomerState>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const listPaymentMethodsCustomers = (client: ClientBase) => {\n /**\n * Get saved payment methods of a customer.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param id - The customer ID.\n * @param query - Query parameters\n * @returns {ListResourcePaymentMethod}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n id: string,\n query?: {\n page?: number;\n limit?: number;\n },\n ): Promise<ListResourcePaymentMethod> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/{id}/payment-methods\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<ListResourcePaymentMethod>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * Get saved payment methods of a customer.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param id - The customer ID.\n * @param query - Query parameters\n * @returns {AsyncGenerator<PaymentMethod>} A generator that yields items of type PaymentMethod.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterlistPaymentMethodsCustomers = (client: ClientBase) => {\n return async function* (\n id: string,\n query?: {\n page?: number;\n limit?: number;\n },\n ): AsyncGenerator<PaymentMethod> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listPaymentMethodsCustomers(client)(id, { ...query, page, limit });\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\nexport const listPaymentMethodsExternalCustomers = (client: ClientBase) => {\n /**\n * Get saved payment methods of a customer by external ID.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param external_id - The customer external ID.\n * @param query - Query parameters\n * @returns {ListResourcePaymentMethod}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n external_id: string,\n query?: {\n page?: number;\n limit?: number;\n },\n ): Promise<ListResourcePaymentMethod> => {\n const pathParams = {\n external_id: external_id,\n };\n const queryParams = {\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/external/{external_id}/payment-methods\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<ListResourcePaymentMethod>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * Get saved payment methods of a customer by external ID.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param external_id - The customer external ID.\n * @param query - Query parameters\n * @returns {AsyncGenerator<PaymentMethod>} A generator that yields items of type PaymentMethod.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterlistPaymentMethodsExternalCustomers = (client: ClientBase) => {\n return async function* (\n external_id: string,\n query?: {\n page?: number;\n limit?: number;\n },\n ): AsyncGenerator<PaymentMethod> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listPaymentMethodsExternalCustomers(client)(external_id, {\n ...query,\n page,\n limit,\n });\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\n\nexport function createCustomersService(client: ClientBase) {\n return {\n list: listCustomers(client),\n create: createCustomers(client),\n export: exportCustomers(client),\n get: getCustomers(client),\n delete: deleteCustomers(client),\n update: updateCustomers(client),\n getExternal: getExternalCustomers(client),\n deleteExternal: deleteExternalCustomers(client),\n updateExternal: updateExternalCustomers(client),\n getState: getStateCustomers(client),\n getStateExternal: getStateExternalCustomers(client),\n listPaymentMethods: listPaymentMethodsCustomers(client),\n listPaymentMethodsExternal: listPaymentMethodsExternalCustomers(client),\n iterlist: iterlistCustomers(client),\n iterlistPaymentMethods: iterlistPaymentMethodsCustomers(client),\n iterlistPaymentMethodsExternal: iterlistPaymentMethodsExternalCustomers(client),\n members: createMembersService(client),\n };\n}\n\nexport type Customers = ReturnType<typeof createCustomersService>;\n"],"mappings":";;;;AAiBA,MAAa,iBAAiB,WAAuB;;;;;;;;;;;;;CAanD,OAAO,OAAO,UASuB;EACnC,MAAM,aAAa,CAAC;EACpB,MAAM,cAAc;GAClB,iBAAiB,OAAO;GACxB,OAAO,OAAO;GACd,OAAO,OAAO;GACd,QAAQ,OAAO;GACf,MAAM,OAAO,QAAQ;GACrB,OAAO,OAAO,SAAS;GACvB,SAAS,OAAO,WAAW,CAAC,aAAa;GACzC,UAAU,OAAO;EACnB;EACA,MAAM,UAAU,OAAO,aACrB,OACA,kBACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,OAAO;EACjD,OAAO,OAAO,cAAoC,UAAU,QAAQ,EAClE,KAAKA,eAAAA,oBACP,CAAC;CACH;AACF;;;;;;;;;;;;;AAaA,MAAa,qBAAqB,WAAuB;CACvD,OAAO,iBAAiB,OASK;EAC3B,IAAI;EACJ,OAAO,OAAO,QAAQ;EACtB,IAAI;EACJ,QAAQ,OAAO;EAEf,OAAO,MAAM;GACX,MAAM,WAAW,MAAM,cAAc,MAAM,CAAC,CAAC;IAAE,GAAG;IAAO;IAAM;GAAM,CAAC;GACtE,KAAK,MAAM,QAAQ,SAAS,OAC1B,MAAM;GAER,IAAI,QAAQ,SAAS,WAAW,UAC9B;GAEF;EACF;CACF;AACF;AACA,MAAa,mBAAmB,WAAuB;;;;;;;;;;;;;CAarD,OAAO,OAAO,SAA4C;EAGxD,MAAM,UAAU,OAAO,aAAa,QAAQ,kBAAkB,CAAS,GAAG,CAAU,GAAG,IAAI;EAC3F,MAAM,WAAW,MAAM,OAAO,YAAY,OAAO;EACjD,OAAO,OAAO,cAAwB,UAAU,QAAQ,EACtD,KAAKA,eAAAA,oBACP,CAAC;CACH;AACF;AACA,MAAa,mBAAmB,WAAuB;;;;;;;;;;;;;CAarD,OAAO,OAAO,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AO,OAAO,SAAS;EACzB;EACA,MAAM,UAAU,OAAO,aACrB,OACA,wDACA,YACA,aACA,KAAA,CACF;EACA,MAAM,WAAW,MAAM,OAAO,YAAY,OAAO;EACjD,OAAO,OAAO,cAAyC,UAAU,QAAQ;GACvE,KAAKC,eAAAA;GACL,KAAKD,eAAAA;EACP,CAAC;CACH;AACF;;;;;;;;;;;;;;;AAeA,MAAa,2CAA2C,WAAuB;CAC7E,OAAO,iBACL,aACA,OAI+B;EAC/B,IAAI;EACJ,OAAO,OAAO,QAAQ;EACtB,IAAI;EACJ,QAAQ,OAAO;EAEf,OAAO,MAAM;GACX,MAAM,WAAW,MAAM,oCAAoC,MAAM,CAAC,CAAC,aAAa;IAC9E,GAAG;IACH;IACA;GACF,CAAC;GACD,KAAK,MAAM,QAAQ,SAAS,OAC1B,MAAM;GAER,IAAI,QAAQ,SAAS,WAAW,UAC9B;GAEF;EACF;CACF;AACF;AAEA,SAAgB,uBAAuB,QAAoB;CACzD,OAAO;EACL,MAAM,cAAc,MAAM;EAC1B,QAAQ,gBAAgB,MAAM;EAC9B,QAAQ,gBAAgB,MAAM;EAC9B,KAAK,aAAa,MAAM;EACxB,QAAQ,gBAAgB,MAAM;EAC9B,QAAQ,gBAAgB,MAAM;EAC9B,aAAa,qBAAqB,MAAM;EACxC,gBAAgB,wBAAwB,MAAM;EAC9C,gBAAgB,wBAAwB,MAAM;EAC9C,UAAU,kBAAkB,MAAM;EAClC,kBAAkB,0BAA0B,MAAM;EAClD,oBAAoB,4BAA4B,MAAM;EACtD,4BAA4B,oCAAoC,MAAM;EACtE,UAAU,kBAAkB,MAAM;EAClC,wBAAwB,gCAAgC,MAAM;EAC9D,gCAAgC,wCAAwC,MAAM;EAC9E,SAASE,2CAAAA,qBAAqB,MAAM;CACtC;AACF"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["HTTPValidationError","ResourceNotFound","createMembersService"],"sources":["../../../../src/2026-04/services/customers/index.ts"],"sourcesContent":["import type { ClientBase } from \"../../../base\";\nimport type {\n Customer,\n CustomerCreate,\n CustomerSortProperty,\n CustomerState,\n CustomerUpdate,\n CustomerUpdateExternalID,\n ListResourceCustomer,\n ListResourcePaymentMethod,\n MetadataQuery,\n PaymentMethod,\n} from \"../../models\";\n\nimport { HTTPValidationError, ResourceNotFound } from \"../../errors\";\nimport { createMembersService } from \"./members\";\n\nexport const listCustomers = (client: ClientBase) => {\n /**\n * List customers.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param query - Query parameters\n * @returns {ListResourceCustomer}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (query?: {\n organization_id?: string | string[] | null;\n email?: string | null;\n query?: string | null;\n active?: boolean | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSortProperty[] | null;\n metadata?: MetadataQuery;\n }): Promise<ListResourceCustomer> => {\n const pathParams = {};\n const queryParams = {\n organization_id: query?.organization_id,\n email: query?.email,\n query: query?.query,\n active: query?.active,\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n sorting: query?.sorting ?? [\"-created_at\"],\n metadata: query?.metadata,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<ListResourceCustomer>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * List customers.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param query - Query parameters\n * @returns {AsyncGenerator<Customer>} A generator that yields items of type Customer.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListCustomers = (client: ClientBase) => {\n return async function* (query?: {\n organization_id?: string | string[] | null;\n email?: string | null;\n query?: string | null;\n active?: boolean | null;\n page?: number;\n limit?: number;\n sorting?: CustomerSortProperty[] | null;\n metadata?: MetadataQuery;\n }): AsyncGenerator<Customer> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listCustomers(client)({ ...query, page, limit });\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\nexport const createCustomers = (client: ClientBase) => {\n /**\n * Create a customer.\n *\n * **Scopes**: `customers:write`\n *\n * @param body - Request body\n * @returns {Customer}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (body: CustomerCreate): Promise<Customer> => {\n const pathParams = {};\n const queryParams = {};\n const request = client.buildRequest(\"POST\", \"/v1/customers/\", pathParams, queryParams, body);\n const response = await client.sendRequest(request);\n return client.parseResponse<Customer>(response, \"json\", {\n 422: HTTPValidationError,\n });\n };\n};\nexport const exportCustomers = (client: ClientBase) => {\n /**\n * Export customers as a CSV file.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param query - Query parameters\n * @returns {string}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {HTTPValidationError} Validation Error\n */\n return async (query?: { organization_id?: string | string[] | null }): Promise<string> => {\n const pathParams = {};\n const queryParams = {\n organization_id: query?.organization_id,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/export\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<string>(response, \"text\", {\n 422: HTTPValidationError,\n });\n };\n};\nexport const getCustomers = (client: ClientBase) => {\n /**\n * Get a customer by ID.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param id - The customer ID.\n * @returns {Customer}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string): Promise<Customer> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<Customer>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const deleteCustomers = (client: ClientBase) => {\n /**\n * Delete a customer.\n *\n * This action cannot be undone and will immediately:\n * - Cancel any active subscriptions for the customer\n * - Revoke all their benefits\n * - Clear any `external_id`\n *\n * Use it only in the context of deleting a user within your\n * own service. Otherwise, use more granular API endpoints to cancel\n * a specific subscription or revoke certain benefits.\n *\n * Note: The customers information will nonetheless be retained for historic\n * orders and subscriptions.\n *\n * Set `anonymize=true` to also anonymize PII for GDPR compliance.\n *\n * **Scopes**: `customers:write`\n *\n * @param id - The customer ID.\n * @param query - Query parameters\n * @returns {void}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n id: string,\n query?: {\n anonymize?: boolean;\n },\n ): Promise<void> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {\n anonymize: query?.anonymize,\n };\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customers/{id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<void>(response, \"none\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const updateCustomers = (client: ClientBase) => {\n /**\n * Update a customer.\n *\n * **Scopes**: `customers:write`\n *\n * @param id - The customer ID.\n * @param body - Request body\n * @returns {Customer}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string, body: CustomerUpdate): Promise<Customer> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"PATCH\",\n \"/v1/customers/{id}\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<Customer>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const getExternalCustomers = (client: ClientBase) => {\n /**\n * Get a customer by external ID.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param external_id - The customer external ID.\n * @returns {Customer}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (external_id: string): Promise<Customer> => {\n const pathParams = {\n external_id: external_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/external/{external_id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<Customer>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const deleteExternalCustomers = (client: ClientBase) => {\n /**\n * Delete a customer by external ID.\n *\n * Immediately cancels any active subscriptions and revokes any active benefits.\n *\n * Set `anonymize=true` to also anonymize PII for GDPR compliance.\n *\n * **Scopes**: `customers:write`\n *\n * @param external_id - The customer external ID.\n * @param query - Query parameters\n * @returns {void}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n external_id: string,\n query?: {\n anonymize?: boolean;\n },\n ): Promise<void> => {\n const pathParams = {\n external_id: external_id,\n };\n const queryParams = {\n anonymize: query?.anonymize,\n };\n const request = client.buildRequest(\n \"DELETE\",\n \"/v1/customers/external/{external_id}\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<void>(response, \"none\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const updateExternalCustomers = (client: ClientBase) => {\n /**\n * Update a customer by external ID.\n *\n * **Scopes**: `customers:write`\n *\n * @param external_id - The customer external ID.\n * @param body - Request body\n * @returns {Customer}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (external_id: string, body: CustomerUpdateExternalID): Promise<Customer> => {\n const pathParams = {\n external_id: external_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"PATCH\",\n \"/v1/customers/external/{external_id}\",\n pathParams,\n queryParams,\n body,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<Customer>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const getStateCustomers = (client: ClientBase) => {\n /**\n * Get a customer state by ID.\n *\n * The customer state includes information about\n * the customer's active subscriptions and benefits.\n *\n * It's the ideal endpoint to use when you need to get a full overview\n * of a customer's status.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param id - The customer ID.\n * @returns {CustomerState}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (id: string): Promise<CustomerState> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/{id}/state\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<CustomerState>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const getStateExternalCustomers = (client: ClientBase) => {\n /**\n * Get a customer state by external ID.\n *\n * The customer state includes information about\n * the customer's active subscriptions and benefits.\n *\n * It's the ideal endpoint to use when you need to get a full overview\n * of a customer's status.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param external_id - The customer external ID.\n * @returns {CustomerState}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (external_id: string): Promise<CustomerState> => {\n const pathParams = {\n external_id: external_id,\n };\n const queryParams = {};\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/external/{external_id}/state\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<CustomerState>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\nexport const listPaymentMethodsCustomers = (client: ClientBase) => {\n /**\n * Get saved payment methods of a customer.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param id - The customer ID.\n * @param query - Query parameters\n * @returns {ListResourcePaymentMethod}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n id: string,\n query?: {\n page?: number;\n limit?: number;\n },\n ): Promise<ListResourcePaymentMethod> => {\n const pathParams = {\n id: id,\n };\n const queryParams = {\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/{id}/payment-methods\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<ListResourcePaymentMethod>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * Get saved payment methods of a customer.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param id - The customer ID.\n * @param query - Query parameters\n * @returns {AsyncGenerator<PaymentMethod>} A generator that yields items of type PaymentMethod.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListPaymentMethodsCustomers = (client: ClientBase) => {\n return async function* (\n id: string,\n query?: {\n page?: number;\n limit?: number;\n },\n ): AsyncGenerator<PaymentMethod> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listPaymentMethodsCustomers(client)(id, { ...query, page, limit });\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\nexport const listPaymentMethodsExternalCustomers = (client: ClientBase) => {\n /**\n * Get saved payment methods of a customer by external ID.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param external_id - The customer external ID.\n * @param query - Query parameters\n * @returns {ListResourcePaymentMethod}\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\n return async (\n external_id: string,\n query?: {\n page?: number;\n limit?: number;\n },\n ): Promise<ListResourcePaymentMethod> => {\n const pathParams = {\n external_id: external_id,\n };\n const queryParams = {\n page: query?.page ?? 1,\n limit: query?.limit ?? 10,\n };\n const request = client.buildRequest(\n \"GET\",\n \"/v1/customers/external/{external_id}/payment-methods\",\n pathParams,\n queryParams,\n undefined,\n );\n const response = await client.sendRequest(request);\n return client.parseResponse<ListResourcePaymentMethod>(response, \"json\", {\n 404: ResourceNotFound,\n 422: HTTPValidationError,\n });\n };\n};\n/**\n * Get saved payment methods of a customer by external ID.\n *\n * **Scopes**: `customers:read` `customers:write`\n *\n * @param external_id - The customer external ID.\n * @param query - Query parameters\n * @returns {AsyncGenerator<PaymentMethod>} A generator that yields items of type PaymentMethod.\n * @throws {PolarNetworkError} When a network error occurs\n * @throws {PolarRateLimitError} When the rate limit is exceeded\n * @throws {PolarServerError} When the server returns a 5xx error\n * @throws {ResourceNotFound} Customer not found.\n * @throws {HTTPValidationError} Validation Error\n */\nexport const iterListPaymentMethodsExternalCustomers = (client: ClientBase) => {\n return async function* (\n external_id: string,\n query?: {\n page?: number;\n limit?: number;\n },\n ): AsyncGenerator<PaymentMethod> {\n let page: number;\n page = query?.page ?? 1;\n let limit: number | undefined;\n limit = query?.limit;\n\n while (true) {\n const response = await listPaymentMethodsExternalCustomers(client)(external_id, {\n ...query,\n page,\n limit,\n });\n for (const item of response.items) {\n yield item;\n }\n if (page >= response.pagination.max_page) {\n break;\n }\n page++;\n }\n };\n};\n\nexport function createCustomersService(client: ClientBase) {\n return {\n list: listCustomers(client),\n create: createCustomers(client),\n export: exportCustomers(client),\n get: getCustomers(client),\n delete: deleteCustomers(client),\n update: updateCustomers(client),\n getExternal: getExternalCustomers(client),\n deleteExternal: deleteExternalCustomers(client),\n updateExternal: updateExternalCustomers(client),\n getState: getStateCustomers(client),\n getStateExternal: getStateExternalCustomers(client),\n listPaymentMethods: listPaymentMethodsCustomers(client),\n listPaymentMethodsExternal: listPaymentMethodsExternalCustomers(client),\n iterList: iterListCustomers(client),\n iterListPaymentMethods: iterListPaymentMethodsCustomers(client),\n iterListPaymentMethodsExternal: iterListPaymentMethodsExternalCustomers(client),\n members: createMembersService(client),\n };\n}\n\nexport type Customers = ReturnType<typeof createCustomersService>;\n"],"mappings":";;;;AAiBA,MAAa,iBAAiB,WAAuB;;;;;;;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OAAO,OAAO,cAAyC,UAAU,QAAQ;GACvE,KAAKC,eAAAA;GACL,KAAKD,eAAAA;EACP,CAAC;CACH;AACF;;;;;;;;;;;;;;;AAeA,MAAa,2CAA2C,WAAuB;CAC7E,OAAO,iBACL,aACA,OAI+B;EAC/B,IAAI;EACJ,OAAO,OAAO,QAAQ;EACtB,IAAI;EACJ,QAAQ,OAAO;EAEf,OAAO,MAAM;GACX,MAAM,WAAW,MAAM,oCAAoC,MAAM,CAAC,CAAC,aAAa;IAC9E,GAAG;IACH;IACA;GACF,CAAC;GACD,KAAK,MAAM,QAAQ,SAAS,OAC1B,MAAM;GAER,IAAI,QAAQ,SAAS,WAAW,UAC9B;GAEF;EACF;CACF;AACF;AAEA,SAAgB,uBAAuB,QAAoB;CACzD,OAAO;EACL,MAAM,cAAc,MAAM;EAC1B,QAAQ,gBAAgB,MAAM;EAC9B,QAAQ,gBAAgB,MAAM;EAC9B,KAAK,aAAa,MAAM;EACxB,QAAQ,gBAAgB,MAAM;EAC9B,QAAQ,gBAAgB,MAAM;EAC9B,aAAa,qBAAqB,MAAM;EACxC,gBAAgB,wBAAwB,MAAM;EAC9C,gBAAgB,wBAAwB,MAAM;EAC9C,UAAU,kBAAkB,MAAM;EAClC,kBAAkB,0BAA0B,MAAM;EAClD,oBAAoB,4BAA4B,MAAM;EACtD,4BAA4B,oCAAoC,MAAM;EACtE,UAAU,kBAAkB,MAAM;EAClC,wBAAwB,gCAAgC,MAAM;EAC9D,gCAAgC,wCAAwC,MAAM;EAC9E,SAASE,2CAAAA,qBAAqB,MAAM;CACtC;AACF"}
|
|
@@ -23,7 +23,7 @@ declare const listCustomers: (client: ClientBase) => (query?: {
|
|
|
23
23
|
* @throws {PolarServerError} When the server returns a 5xx error
|
|
24
24
|
* @throws {HTTPValidationError} Validation Error
|
|
25
25
|
*/
|
|
26
|
-
declare const
|
|
26
|
+
declare const iterListCustomers: (client: ClientBase) => (query?: {
|
|
27
27
|
organization_id?: string | string[] | null;
|
|
28
28
|
email?: string | null;
|
|
29
29
|
query?: string | null;
|
|
@@ -67,7 +67,7 @@ declare const listPaymentMethodsCustomers: (client: ClientBase) => (id: string,
|
|
|
67
67
|
* @throws {ResourceNotFound} Customer not found.
|
|
68
68
|
* @throws {HTTPValidationError} Validation Error
|
|
69
69
|
*/
|
|
70
|
-
declare const
|
|
70
|
+
declare const iterListPaymentMethodsCustomers: (client: ClientBase) => (id: string, query?: {
|
|
71
71
|
page?: number;
|
|
72
72
|
limit?: number;
|
|
73
73
|
}) => AsyncGenerator<PaymentMethod>;
|
|
@@ -89,7 +89,7 @@ declare const listPaymentMethodsExternalCustomers: (client: ClientBase) => (exte
|
|
|
89
89
|
* @throws {ResourceNotFound} Customer not found.
|
|
90
90
|
* @throws {HTTPValidationError} Validation Error
|
|
91
91
|
*/
|
|
92
|
-
declare const
|
|
92
|
+
declare const iterListPaymentMethodsExternalCustomers: (client: ClientBase) => (external_id: string, query?: {
|
|
93
93
|
page?: number;
|
|
94
94
|
limit?: number;
|
|
95
95
|
}) => AsyncGenerator<PaymentMethod>;
|
|
@@ -128,7 +128,7 @@ declare function createCustomersService(client: ClientBase): {
|
|
|
128
128
|
page?: number;
|
|
129
129
|
limit?: number;
|
|
130
130
|
}) => Promise<ListResourcePaymentMethod>;
|
|
131
|
-
|
|
131
|
+
iterList: (query?: {
|
|
132
132
|
organization_id?: string | string[] | null;
|
|
133
133
|
email?: string | null;
|
|
134
134
|
query?: string | null;
|
|
@@ -138,11 +138,11 @@ declare function createCustomersService(client: ClientBase): {
|
|
|
138
138
|
sorting?: CustomerSortProperty[] | null;
|
|
139
139
|
metadata?: MetadataQuery;
|
|
140
140
|
}) => AsyncGenerator<Customer>;
|
|
141
|
-
|
|
141
|
+
iterListPaymentMethods: (id: string, query?: {
|
|
142
142
|
page?: number;
|
|
143
143
|
limit?: number;
|
|
144
144
|
}) => AsyncGenerator<PaymentMethod>;
|
|
145
|
-
|
|
145
|
+
iterListPaymentMethodsExternal: (external_id: string, query?: {
|
|
146
146
|
page?: number;
|
|
147
147
|
limit?: number;
|
|
148
148
|
}) => AsyncGenerator<PaymentMethod>;
|
|
@@ -159,5 +159,5 @@ declare function createCustomersService(client: ClientBase): {
|
|
|
159
159
|
};
|
|
160
160
|
type Customers = ReturnType<typeof createCustomersService>;
|
|
161
161
|
//#endregion
|
|
162
|
-
export { Customers, createCustomers, createCustomersService, deleteCustomers, deleteExternalCustomers, exportCustomers, getCustomers, getExternalCustomers, getStateCustomers, getStateExternalCustomers,
|
|
162
|
+
export { Customers, createCustomers, createCustomersService, deleteCustomers, deleteExternalCustomers, exportCustomers, getCustomers, getExternalCustomers, getStateCustomers, getStateExternalCustomers, iterListCustomers, iterListPaymentMethodsCustomers, iterListPaymentMethodsExternalCustomers, listCustomers, listPaymentMethodsCustomers, listPaymentMethodsExternalCustomers, updateCustomers, updateExternalCustomers };
|
|
163
163
|
//# sourceMappingURL=index.d.cts.map
|