@talosjs/payment 1.1.0 → 1.1.2

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 CHANGED
@@ -1,30 +1,6 @@
1
1
  # @talosjs/payment
2
2
 
3
- Payment and pricing type definitions with currency handling, product categorization, and billing metadata for e-commerce integrations.
4
-
5
- ![Bun](https://img.shields.io/badge/Bun-Compatible-orange?style=flat-square&logo=bun)
6
- ![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?style=flat-square&logo=typescript)
7
- ![MIT License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)
8
-
9
- ## Features
10
-
11
- ✅ **Polar Integration** - Full Polar SDK integration for products, checkouts, customers, discounts, and analytics
12
-
13
- ✅ **Checkout Flow** - Create and retrieve checkout sessions with customer and discount support
14
-
15
- ✅ **Product Management** - Create, update, and archive products with pricing, benefits, and custom fields
16
-
17
- ✅ **Customer Management** - Create, update, list, and delete customers with billing address and metadata
18
-
19
- ✅ **Discount System** - Percentage and fixed discounts with duration, redemption limits, and product scoping
20
-
21
- ✅ **Subscription Support** - Plans, credits, and recurring billing with trial periods
22
-
23
- ✅ **Analytics** - Revenue, order, and subscription analytics with configurable time intervals
24
-
25
- ✅ **Customer Portal** - Create customer portal sessions for self-service account management
26
-
27
- ✅ **Type-Safe** - Comprehensive TypeScript types for all payment entities and API responses
3
+ Payment and pricing type definitions with currency handling, product categorization, and billing metadata for e-commerce integrations
28
4
 
29
5
  ## Installation
30
6
 
@@ -32,209 +8,10 @@ Payment and pricing type definitions with currency handling, product categorizat
32
8
  bun add @talosjs/payment
33
9
  ```
34
10
 
35
- ## Usage
36
-
37
- ### Creating a Checkout
38
-
39
- ```typescript
40
- import { PolarCheckout } from '@talosjs/payment';
41
-
42
- // Requires POLAR_ACCESS_TOKEN environment variable
43
- const checkout = new PolarCheckout();
44
-
45
- const session = await checkout.create({
46
- products: ['product-id-1'],
47
- customerEmail: 'user@example.com',
48
- successUrl: 'https://example.com/success',
49
- allowDiscountCodes: true,
50
- });
51
-
52
- console.log(session.url); // Redirect user to this URL
53
- ```
54
-
55
- ### Managing Products
56
-
57
- ```typescript
58
- import { PolarProduct } from '@talosjs/payment';
59
-
60
- const products = new PolarProduct();
61
-
62
- // Create a product
63
- const product = await products.create({
64
- name: 'Pro Plan',
65
- description: 'Full access to all features',
66
- recurringInterval: 'monthly',
67
- prices: [
68
- { type: 'fixed', priceCurrency: 'usd', priceAmount: 2900 },
69
- ],
70
- });
71
-
72
- // Update a product
73
- await products.update('product-id', {
74
- name: 'Pro Plan (Updated)',
75
- });
76
-
77
- // Archive a product
78
- await products.remove('product-id');
79
- ```
80
-
81
- ### Customer Management
82
-
83
- ```typescript
84
- import { PolarCustomer } from '@talosjs/payment';
85
-
86
- const customers = new PolarCustomer();
87
-
88
- // Create a customer
89
- const customer = await customers.create({
90
- email: 'user@example.com',
91
- name: 'John Doe',
92
- metadata: { plan: 'pro' },
93
- });
94
-
95
- // List customers
96
- const result = await customers.list({
97
- query: 'john',
98
- limit: 20,
99
- });
100
- ```
101
-
102
- ### Managing Discounts
103
-
104
- ```typescript
105
- import { PolarDiscount } from '@talosjs/payment';
106
-
107
- const discounts = new PolarDiscount();
108
-
109
- // Create a percentage discount
110
- const discount = await discounts.create({
111
- name: '20% Off',
112
- code: 'SAVE20',
113
- type: 'percentage',
114
- amount: 2000, // basis points (20%)
115
- duration: 'once',
116
- });
117
- ```
118
-
119
- ### Revenue Analytics
120
-
121
- ```typescript
122
- import { PolarAnalytics } from '@talosjs/payment';
123
-
124
- const analytics = new PolarAnalytics();
125
-
126
- const data = await analytics.get({
127
- startDate: new Date('2024-01-01'),
128
- endDate: new Date('2024-12-31'),
129
- interval: 'month',
130
- });
131
-
132
- for (const period of data.periods) {
133
- console.log(`${period.timestamp}: $${period.revenue / 100}`);
134
- }
135
- ```
136
-
137
- ## API Reference
138
-
139
- ### Classes
140
-
141
- #### `PolarCheckout`
142
-
143
- Create and retrieve Polar checkout sessions.
144
-
145
- **Methods:**
146
- - `create(data: CheckoutCreateType): Promise<CheckoutType>` - Create a checkout session
147
- - `get(id: string): Promise<CheckoutType>` - Retrieve a checkout by ID
148
-
149
- #### `PolarProduct`
150
-
151
- Manage products via the Polar API.
152
-
153
- **Methods:**
154
- - `create(data: IProduct): Promise<Omit<IProduct, 'id'>>` - Create a product
155
- - `update(id: string, data: Partial<IProduct>): Promise<Omit<IProduct, 'id'>>` - Update a product
156
- - `remove(id: string): Promise<void>` - Archive a product
157
-
158
- #### `PolarCustomer`
159
-
160
- Manage customers via the Polar API.
161
-
162
- **Methods:**
163
- - `create(data: CustomerCreateType): Promise<CustomerType>` - Create a customer
164
- - `update(id: string, data: CustomerUpdateType): Promise<CustomerType>` - Update a customer
165
- - `get(id: string): Promise<CustomerType>` - Get a customer by ID
166
- - `list(options?: CustomerListOptionsType): Promise<CustomerListResultType>` - List customers
167
- - `remove(id: string): Promise<void>` - Delete a customer
168
-
169
- #### `PolarCustomerPortal`
170
-
171
- Create customer portal sessions for self-service management.
172
-
173
- #### `PolarDiscount`
174
-
175
- Create and manage discounts.
176
-
177
- #### `PolarAnalytics`
178
-
179
- Retrieve revenue and order analytics.
180
-
181
- ### Key Types
11
+ ## Documentation
182
12
 
183
- #### `IProduct`
184
-
185
- Product interface with name, description, prices, benefits, recurring interval, and metadata.
186
-
187
- #### `CheckoutCreateType`
188
-
189
- Checkout creation options including products, customer info, discount, and success URL.
190
-
191
- #### `IDiscount`
192
-
193
- Discount interface with type (percentage/fixed), duration, amount, and redemption limits.
194
-
195
- #### `ISubscription`
196
-
197
- Subscription interface with plans, credits, discounts, and billing dates.
198
-
199
- ### Enums
200
-
201
- | Enum | Values |
202
- |------|--------|
203
- | `EPriceType` | `FIXED`, `CUSTOM`, `FREE` |
204
- | `EDiscountType` | `PERCENTAGE`, `FIXED` |
205
- | `EDiscountDuration` | `ONCE`, `REPEATING`, `FOREVER` |
206
- | `ESubscriptionPeriod` | `MONTHLY`, `YEARLY`, `WEEKLY`, `DAILY` |
207
- | `EBenefitType` | `CREDITS`, `LICENSE_KEYS`, `FILE_DOWNLOADS`, `GITHUB_REPOSITORY_ACCESS`, `DISCORD_ACCESS`, `CUSTOM` |
208
- | `ECheckoutStatus` | `OPEN`, `EXPIRED`, `CONFIRMED`, `SUCCEEDED`, `FAILED` |
209
- | `EAnalyticsInterval` | `YEAR`, `MONTH`, `WEEK`, `DAY`, `HOUR` |
210
-
211
- ## Environment Variables
212
-
213
- - `POLAR_ACCESS_TOKEN` - Polar API access token (required)
214
- - `POLAR_ENVIRONMENT` - `"sandbox"` or `"production"` (default: `"production"`)
13
+ Read the full documentation at [docs.talosjs.com](https://docs.talosjs.com).
215
14
 
216
15
  ## License
217
16
 
218
- This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
219
-
220
- ## Contributing
221
-
222
- Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
223
-
224
- ### Development Setup
225
-
226
- 1. Clone the repository
227
- 2. Install dependencies: `bun install`
228
- 3. Run tests: `bun run test`
229
- 4. Build the project: `bun run build`
230
-
231
- ### Guidelines
232
-
233
- - Write tests for new features
234
- - Follow the existing code style
235
- - Update documentation for API changes
236
- - Ensure all tests pass before submitting PR
237
-
238
- ---
239
-
240
- Made with ❤️ by the Talos team
17
+ MIT
package/dist/index.js CHANGED
@@ -30,9 +30,9 @@ class PaymentException extends Exception {
30
30
  }
31
31
  }
32
32
  // src/PolarAnalytics.ts
33
+ import { Polar } from "@polar-sh/sdk";
33
34
  import { AppEnv } from "@talosjs/app-env";
34
35
  import { inject, injectable } from "@talosjs/container";
35
- import { Polar } from "@polar-sh/sdk";
36
36
  class PolarAnalytics {
37
37
  env;
38
38
  client;
@@ -133,9 +133,9 @@ PolarAnalytics = __legacyDecorateClassTS([
133
133
  ])
134
134
  ], PolarAnalytics);
135
135
  // src/PolarCheckout.ts
136
+ import { Polar as Polar2 } from "@polar-sh/sdk";
136
137
  import { AppEnv as AppEnv2 } from "@talosjs/app-env";
137
138
  import { inject as inject2, injectable as injectable2 } from "@talosjs/container";
138
- import { Polar as Polar2 } from "@polar-sh/sdk";
139
139
  class PolarCheckout {
140
140
  env;
141
141
  client;
@@ -264,9 +264,9 @@ PolarCheckout = __legacyDecorateClassTS([
264
264
  ])
265
265
  ], PolarCheckout);
266
266
  // src/PolarCustomer.ts
267
+ import { Polar as Polar3 } from "@polar-sh/sdk";
267
268
  import { AppEnv as AppEnv3 } from "@talosjs/app-env";
268
269
  import { inject as inject3, injectable as injectable3 } from "@talosjs/container";
269
- import { Polar as Polar3 } from "@polar-sh/sdk";
270
270
  class PolarCustomer {
271
271
  env;
272
272
  client;
@@ -427,9 +427,9 @@ PolarCustomer = __legacyDecorateClassTS([
427
427
  ])
428
428
  ], PolarCustomer);
429
429
  // src/PolarCustomerPortal.ts
430
+ import { Polar as Polar4 } from "@polar-sh/sdk";
430
431
  import { AppEnv as AppEnv4 } from "@talosjs/app-env";
431
432
  import { inject as inject4, injectable as injectable4 } from "@talosjs/container";
432
- import { Polar as Polar4 } from "@polar-sh/sdk";
433
433
  class PolarCustomerPortal {
434
434
  env;
435
435
  client;
@@ -480,9 +480,9 @@ PolarCustomerPortal = __legacyDecorateClassTS([
480
480
  ])
481
481
  ], PolarCustomerPortal);
482
482
  // src/PolarDiscount.ts
483
+ import { Polar as Polar5 } from "@polar-sh/sdk";
483
484
  import { AppEnv as AppEnv5 } from "@talosjs/app-env";
484
485
  import { inject as inject5, injectable as injectable5 } from "@talosjs/container";
485
- import { Polar as Polar5 } from "@polar-sh/sdk";
486
486
  class PolarDiscount {
487
487
  env;
488
488
  client;
@@ -641,9 +641,9 @@ PolarDiscount = __legacyDecorateClassTS([
641
641
  ])
642
642
  ], PolarDiscount);
643
643
  // src/PolarProduct.ts
644
+ import { Polar as Polar6 } from "@polar-sh/sdk";
644
645
  import { AppEnv as AppEnv6 } from "@talosjs/app-env";
645
646
  import { inject as inject6, injectable as injectable6 } from "@talosjs/container";
646
- import { Polar as Polar6 } from "@polar-sh/sdk";
647
647
  class PolarProduct {
648
648
  env;
649
649
  client;
@@ -840,4 +840,4 @@ export {
840
840
  EAnalyticsInterval
841
841
  };
842
842
 
843
- //# debugId=1D32103632506D8764756E2164756E21
843
+ //# debugId=33031D37A547AF8A64756E2164756E21
package/dist/index.js.map CHANGED
@@ -3,15 +3,15 @@
3
3
  "sources": ["src/PaymentException.ts", "src/PolarAnalytics.ts", "src/PolarCheckout.ts", "src/PolarCustomer.ts", "src/PolarCustomerPortal.ts", "src/PolarDiscount.ts", "src/PolarProduct.ts", "src/types.ts"],
4
4
  "sourcesContent": [
5
5
  "import { Exception } from \"@talosjs/exception\";\nimport { HttpStatus } from \"@talosjs/http-status\";\n\nexport class PaymentException extends Exception {\n constructor(message: string, key: string, data: Record<string, unknown> = {}) {\n super(message, {\n key,\n status: HttpStatus.Code.InternalServerError,\n data,\n });\n\n this.name = \"PaymentException\";\n }\n}\n",
6
- "import { AppEnv } from \"@talosjs/app-env\";\nimport { inject, injectable } from \"@talosjs/container\";\nimport { Polar } from \"@polar-sh/sdk\";\nimport type { RFCDate } from \"@polar-sh/sdk/types/rfcdate.js\";\nimport { PaymentException } from \"./PaymentException\";\nimport type {\n AnalyticsIntervalsLimitsType,\n AnalyticsLimitsType,\n AnalyticsMetricInfoType,\n AnalyticsMetricsType,\n AnalyticsOptionsType,\n AnalyticsPeriodType,\n AnalyticsResponseType,\n BillingTypeType,\n} from \"./types\";\n\n@injectable()\nexport class PolarAnalytics {\n private client: Polar;\n\n constructor(@inject(AppEnv) private readonly env: AppEnv) {\n const accessToken = this.env.POLAR_ACCESS_TOKEN;\n\n if (!accessToken) {\n throw new PaymentException(\n \"Polar access token is required. Please set the POLAR_ACCESS_TOKEN environment variable.\",\n \"TOKEN_REQUIRED\",\n );\n }\n\n this.client = new Polar({\n accessToken,\n server: (this.env.POLAR_ENVIRONMENT as \"sandbox\" | \"production\") || \"production\",\n });\n }\n\n public async get(options: AnalyticsOptionsType): Promise<AnalyticsResponseType> {\n const response = await this.client.metrics.get({\n startDate: this.toRFCDate(options.startDate),\n endDate: this.toRFCDate(options.endDate),\n interval: options.interval,\n organizationId: options.organizationId ?? null,\n productId: options.productId ?? null,\n billingType: (options.billingType as BillingTypeType) ?? null,\n customerId: options.customerId ?? null,\n });\n\n return {\n periods: response.periods.map((period) => this.mapPeriod(period)),\n metrics: this.mapMetrics(response.metrics),\n };\n }\n\n public async getLimits(): Promise<AnalyticsLimitsType> {\n const response = await this.client.metrics.limits();\n\n return {\n minDate: new Date(response.minDate.toString()),\n intervals: this.mapIntervalsLimits(response.intervals),\n };\n }\n\n private toRFCDate(date: Date): RFCDate {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n\n return `${year}-${month}-${day}` as unknown as RFCDate;\n }\n\n private mapPeriod(period: {\n timestamp: Date;\n orders: number;\n revenue: number;\n cumulativeRevenue: number;\n averageOrderValue: number;\n oneTimeProducts: number;\n oneTimeProductsRevenue: number;\n newSubscriptions: number;\n newSubscriptionsRevenue: number;\n renewedSubscriptions: number;\n renewedSubscriptionsRevenue: number;\n activeSubscriptions: number;\n monthlyRecurringRevenue: number;\n }): AnalyticsPeriodType {\n return {\n timestamp: period.timestamp,\n orders: period.orders,\n revenue: period.revenue,\n cumulativeRevenue: period.cumulativeRevenue,\n averageOrderValue: period.averageOrderValue,\n oneTimeProducts: period.oneTimeProducts,\n oneTimeProductsRevenue: period.oneTimeProductsRevenue,\n newSubscriptions: period.newSubscriptions,\n newSubscriptionsRevenue: period.newSubscriptionsRevenue,\n renewedSubscriptions: period.renewedSubscriptions,\n renewedSubscriptionsRevenue: period.renewedSubscriptionsRevenue,\n activeSubscriptions: period.activeSubscriptions,\n monthlyRecurringRevenue: period.monthlyRecurringRevenue,\n };\n }\n\n private mapMetricInfo(metric: { slug: string; displayName: string; type: string }): AnalyticsMetricInfoType {\n return {\n slug: metric.slug,\n displayName: metric.displayName,\n type: metric.type,\n };\n }\n\n private mapMetrics(metrics: {\n orders: { slug: string; displayName: string; type: string };\n revenue: { slug: string; displayName: string; type: string };\n cumulativeRevenue: { slug: string; displayName: string; type: string };\n averageOrderValue: { slug: string; displayName: string; type: string };\n oneTimeProducts: { slug: string; displayName: string; type: string };\n oneTimeProductsRevenue: { slug: string; displayName: string; type: string };\n newSubscriptions: { slug: string; displayName: string; type: string };\n newSubscriptionsRevenue: { slug: string; displayName: string; type: string };\n renewedSubscriptions: { slug: string; displayName: string; type: string };\n renewedSubscriptionsRevenue: { slug: string; displayName: string; type: string };\n activeSubscriptions: { slug: string; displayName: string; type: string };\n monthlyRecurringRevenue: { slug: string; displayName: string; type: string };\n }): AnalyticsMetricsType {\n return {\n orders: this.mapMetricInfo(metrics.orders),\n revenue: this.mapMetricInfo(metrics.revenue),\n cumulativeRevenue: this.mapMetricInfo(metrics.cumulativeRevenue),\n averageOrderValue: this.mapMetricInfo(metrics.averageOrderValue),\n oneTimeProducts: this.mapMetricInfo(metrics.oneTimeProducts),\n oneTimeProductsRevenue: this.mapMetricInfo(metrics.oneTimeProductsRevenue),\n newSubscriptions: this.mapMetricInfo(metrics.newSubscriptions),\n newSubscriptionsRevenue: this.mapMetricInfo(metrics.newSubscriptionsRevenue),\n renewedSubscriptions: this.mapMetricInfo(metrics.renewedSubscriptions),\n renewedSubscriptionsRevenue: this.mapMetricInfo(metrics.renewedSubscriptionsRevenue),\n activeSubscriptions: this.mapMetricInfo(metrics.activeSubscriptions),\n monthlyRecurringRevenue: this.mapMetricInfo(metrics.monthlyRecurringRevenue),\n };\n }\n\n private mapIntervalsLimits(intervals: {\n hour: { maxDays: number };\n day: { maxDays: number };\n week: { maxDays: number };\n month: { maxDays: number };\n year: { maxDays: number };\n }): AnalyticsIntervalsLimitsType {\n return {\n hour: { maxDays: intervals.hour.maxDays },\n day: { maxDays: intervals.day.maxDays },\n week: { maxDays: intervals.week.maxDays },\n month: { maxDays: intervals.month.maxDays },\n year: { maxDays: intervals.year.maxDays },\n };\n }\n}\n",
7
- "import { AppEnv } from \"@talosjs/app-env\";\nimport { inject, injectable } from \"@talosjs/container\";\nimport type { CurrencyCodeType } from \"@talosjs/currencies\";\nimport { Polar } from \"@polar-sh/sdk\";\nimport { PaymentException } from \"./PaymentException\";\nimport type {\n CheckoutAddressType,\n CheckoutCreateType,\n CheckoutCustomerType,\n CheckoutResponseType,\n CheckoutStatusType,\n CheckoutType,\n} from \"./types\";\n\n@injectable()\nexport class PolarCheckout {\n private client: Polar;\n\n constructor(@inject(AppEnv) private readonly env: AppEnv) {\n const accessToken = this.env.POLAR_ACCESS_TOKEN;\n\n if (!accessToken) {\n throw new PaymentException(\n \"Polar access token is required. Please set the POLAR_ACCESS_TOKEN environment variable.\",\n \"TOKEN_REQUIRED\",\n );\n }\n\n this.client = new Polar({\n accessToken,\n server: (this.env.POLAR_ENVIRONMENT as \"sandbox\" | \"production\") || \"production\",\n });\n }\n\n public async create(data: CheckoutCreateType): Promise<CheckoutType> {\n const response = await this.client.checkouts.create({\n products: data.products,\n customerExternalId: data.customerExternalId ?? null,\n customerId: data.customerId ?? null,\n customerEmail: data.customerEmail ?? null,\n customerName: data.customerName ?? null,\n customerBillingAddress: data.customerBillingAddress?.country\n ? {\n country: data.customerBillingAddress.country,\n line1: data.customerBillingAddress.line1 ?? null,\n line2: data.customerBillingAddress.line2 ?? null,\n city: data.customerBillingAddress.city ?? null,\n state: data.customerBillingAddress.state ?? null,\n postalCode: data.customerBillingAddress.postalCode ?? null,\n }\n : null,\n customerTaxId: data.customerTaxId ?? null,\n discountId: data.discountId ?? null,\n allowDiscountCodes: data.allowDiscountCodes ?? true,\n successUrl: data.successUrl ?? null,\n embedOrigin: data.embedOrigin ?? null,\n metadata: data.metadata,\n });\n\n return this.mapResponse(response as unknown as CheckoutResponseType);\n }\n\n public async get(id: string): Promise<CheckoutType> {\n const response = await this.client.checkouts.get({ id });\n\n return this.mapResponse(response as unknown as CheckoutResponseType);\n }\n\n private mapResponse(response: CheckoutResponseType): CheckoutType {\n const checkout: CheckoutType = {\n id: response.id,\n status: response.status as CheckoutStatusType,\n clientSecret: response.clientSecret,\n };\n\n if (response.url) {\n checkout.url = response.url;\n }\n\n if (response.embedId) {\n checkout.embedId = response.embedId;\n }\n\n if (response.allowDiscountCodes !== undefined) {\n checkout.allowDiscountCodes = response.allowDiscountCodes;\n }\n\n if (response.isDiscountApplicable !== undefined) {\n checkout.isDiscountApplicable = response.isDiscountApplicable;\n }\n\n if (response.isPaymentRequired !== undefined) {\n checkout.isPaymentRequired = response.isPaymentRequired;\n }\n\n if (response.metadata) {\n checkout.metadata = response.metadata;\n }\n\n if (response.createdAt) {\n checkout.createdAt = response.createdAt;\n }\n\n if (response.modifiedAt) {\n checkout.updatedAt = response.modifiedAt;\n }\n\n if (response.expiresAt) {\n checkout.expiresAt = response.expiresAt;\n }\n\n if (response.successUrl) {\n checkout.successUrl = response.successUrl;\n }\n\n if (response.embedOrigin) {\n checkout.embedOrigin = response.embedOrigin;\n }\n\n if (response.amount !== undefined) {\n checkout.amount = response.amount;\n }\n\n if (response.taxAmount !== undefined) {\n checkout.taxAmount = response.taxAmount;\n }\n\n if (response.currency) {\n checkout.currency = response.currency as CurrencyCodeType;\n }\n\n if (response.subtotalAmount !== undefined) {\n checkout.subtotalAmount = response.subtotalAmount;\n }\n\n if (response.totalAmount !== undefined) {\n checkout.totalAmount = response.totalAmount;\n }\n\n if (response.productId) {\n checkout.productId = response.productId;\n }\n\n if (response.productPriceId) {\n checkout.productPriceId = response.productPriceId;\n }\n\n if (response.discountId) {\n checkout.discountId = response.discountId;\n }\n\n if (response.customer) {\n checkout.customer = {\n id: response.customer.id,\n email: response.customer.email,\n name: response.customer.name,\n externalId: response.customer.externalId,\n taxId: response.customer.taxId,\n } as CheckoutCustomerType;\n\n if (response.customer.billingAddress) {\n checkout.customer.billingAddress = response.customer.billingAddress as CheckoutAddressType;\n }\n }\n\n return checkout;\n }\n}\n",
8
- "import { AppEnv } from \"@talosjs/app-env\";\nimport { inject, injectable } from \"@talosjs/container\";\nimport { Polar } from \"@polar-sh/sdk\";\nimport type { Address } from \"@polar-sh/sdk/models/components/address.js\";\nimport { PaymentException } from \"./PaymentException\";\nimport type {\n CustomerAddressType,\n CustomerCreateType,\n CustomerListOptionsType,\n CustomerListResponseType,\n CustomerListResultType,\n CustomerResponseType,\n CustomerType,\n CustomerUpdateType,\n} from \"./types\";\n\n@injectable()\nexport class PolarCustomer {\n private client: Polar;\n\n constructor(@inject(AppEnv) private readonly env: AppEnv) {\n const accessToken = this.env.POLAR_ACCESS_TOKEN;\n\n if (!accessToken) {\n throw new PaymentException(\n \"Polar access token is required. Please set the POLAR_ACCESS_TOKEN environment variable.\",\n \"TOKEN_REQUIRED\",\n );\n }\n\n this.client = new Polar({\n accessToken,\n server: (this.env.POLAR_ENVIRONMENT as \"sandbox\" | \"production\") || \"production\",\n });\n }\n\n public async create(data: CustomerCreateType): Promise<CustomerType> {\n const response = await this.client.customers.create({\n email: data.email,\n name: data.name ?? null,\n externalId: data.externalId ?? null,\n billingAddress: data.billingAddress ? this.toBillingAddress(data.billingAddress) : null,\n taxId: data.taxId ? [data.taxId, null] : null,\n organizationId: data.organizationId ?? null,\n metadata: data.metadata,\n });\n\n return this.mapResponse(response as unknown as CustomerResponseType);\n }\n\n public async update(id: string, data: CustomerUpdateType): Promise<CustomerType> {\n const response = await this.client.customers.update({\n id,\n customerUpdate: {\n email: data.email ?? null,\n name: data.name ?? null,\n billingAddress: data.billingAddress ? this.toBillingAddress(data.billingAddress) : null,\n taxId: data.taxId ? [data.taxId, null] : null,\n metadata: data.metadata,\n },\n });\n\n return this.mapResponse(response as unknown as CustomerResponseType);\n }\n\n public async remove(id: string): Promise<void> {\n await this.client.customers.delete({ id });\n }\n\n public async get(id: string): Promise<CustomerType> {\n const response = await this.client.customers.get({ id });\n\n return this.mapResponse(response as unknown as CustomerResponseType);\n }\n\n public async list(options?: CustomerListOptionsType): Promise<CustomerListResultType> {\n const response = await this.client.customers.list({\n organizationId: options?.organizationId,\n email: options?.email,\n query: options?.query,\n page: options?.page ?? 1,\n limit: options?.limit ?? 10,\n });\n\n const result = response as unknown as CustomerListResponseType;\n\n return {\n items: result.result.items.map((item) => this.mapResponse(item)),\n pagination: {\n totalCount: result.result.pagination.totalCount,\n maxPage: result.result.pagination.maxPage,\n },\n };\n }\n\n public async getByExternalId(externalId: string): Promise<CustomerType> {\n const response = await this.client.customers.getExternal({ externalId });\n\n return this.mapResponse(response as unknown as CustomerResponseType);\n }\n\n public async updateByExternalId(externalId: string, data: CustomerUpdateType): Promise<CustomerType> {\n const response = await this.client.customers.updateExternal({\n externalId,\n customerUpdate: {\n email: data.email ?? null,\n name: data.name ?? null,\n billingAddress: data.billingAddress ? this.toBillingAddress(data.billingAddress) : null,\n taxId: data.taxId ? [data.taxId, null] : null,\n metadata: data.metadata,\n },\n });\n\n return this.mapResponse(response as unknown as CustomerResponseType);\n }\n\n public async removeByExternalId(externalId: string): Promise<void> {\n await this.client.customers.deleteExternal({ externalId });\n }\n\n private toBillingAddress(address: CustomerAddressType): Address {\n return {\n country: address.country ?? \"\",\n line1: address.line1,\n line2: address.line2,\n city: address.city,\n state: address.state,\n postalCode: address.postalCode,\n };\n }\n\n private mapResponse(response: CustomerResponseType): CustomerType {\n const customer: CustomerType = {\n id: response.id,\n email: response.email,\n emailVerified: response.emailVerified ?? false,\n };\n\n if (response.createdAt) {\n customer.createdAt = response.createdAt;\n }\n\n if (response.modifiedAt) {\n customer.updatedAt = response.modifiedAt;\n }\n\n if (response.deletedAt) {\n customer.deletedAt = response.deletedAt;\n }\n\n if (response.name) {\n customer.name = response.name;\n }\n\n if (response.externalId) {\n customer.externalId = response.externalId;\n }\n\n if (response.avatarUrl) {\n customer.avatarUrl = response.avatarUrl;\n }\n\n if (response.billingAddress) {\n const billingAddress: CustomerAddressType = {};\n if (response.billingAddress.line1) {\n billingAddress.line1 = response.billingAddress.line1;\n }\n if (response.billingAddress.line2) {\n billingAddress.line2 = response.billingAddress.line2;\n }\n if (response.billingAddress.city) {\n billingAddress.city = response.billingAddress.city;\n }\n if (response.billingAddress.state) {\n billingAddress.state = response.billingAddress.state;\n }\n if (response.billingAddress.postalCode) {\n billingAddress.postalCode = response.billingAddress.postalCode;\n }\n if (response.billingAddress.country) {\n billingAddress.country = response.billingAddress.country;\n }\n customer.billingAddress = billingAddress;\n }\n\n if (response.taxId) {\n const taxIdValue = typeof response.taxId === \"string\" ? response.taxId : response.taxId[1];\n customer.taxId = taxIdValue;\n }\n\n if (response.organizationId) {\n customer.organizationId = response.organizationId;\n }\n\n if (response.metadata) {\n customer.metadata = response.metadata;\n }\n\n return customer;\n }\n}\n",
9
- "import { AppEnv } from \"@talosjs/app-env\";\nimport { inject, injectable } from \"@talosjs/container\";\nimport { Polar } from \"@polar-sh/sdk\";\nimport { PaymentException } from \"./PaymentException\";\nimport type { CustomerSessionCreateType, CustomerSessionResponseType, CustomerSessionType } from \"./types\";\n\n@injectable()\nexport class PolarCustomerPortal {\n private client: Polar;\n\n constructor(@inject(AppEnv) private readonly env: AppEnv) {\n const accessToken = this.env.POLAR_ACCESS_TOKEN;\n\n if (!accessToken) {\n throw new PaymentException(\n \"Polar access token is required. Please set the POLAR_ACCESS_TOKEN environment variable.\",\n \"TOKEN_REQUIRED\",\n );\n }\n\n this.client = new Polar({\n accessToken,\n server: (this.env.POLAR_ENVIRONMENT as \"sandbox\" | \"production\") || \"production\",\n });\n }\n\n public async create(data: CustomerSessionCreateType): Promise<CustomerSessionType> {\n const response = await this.client.customerSessions.create({\n customerId: data.customerId,\n });\n\n return this.mapResponse(response as unknown as CustomerSessionResponseType);\n }\n\n public getPortalUrl(organizationSlug: string): string {\n const baseUrl = this.env.POLAR_ENVIRONMENT === \"sandbox\" ? \"https://sandbox.polar.sh\" : \"https://polar.sh\";\n\n return `${baseUrl}/${organizationSlug}/portal`;\n }\n\n private mapResponse(response: CustomerSessionResponseType): CustomerSessionType {\n const session: CustomerSessionType = {\n id: response.id,\n token: response.token,\n customerPortalUrl: response.customerPortalUrl,\n };\n\n if (response.createdAt) {\n session.createdAt = response.createdAt;\n }\n\n if (response.expiresAt) {\n session.expiresAt = response.expiresAt;\n }\n\n if (response.customerId) {\n session.customerId = response.customerId;\n }\n\n return session;\n }\n}\n",
10
- "import { AppEnv } from \"@talosjs/app-env\";\nimport { inject, injectable } from \"@talosjs/container\";\nimport type { CurrencyCodeType } from \"@talosjs/currencies\";\nimport { Polar } from \"@polar-sh/sdk\";\nimport { PaymentException } from \"./PaymentException\";\nimport type { DiscountDurationType, DiscountResponseType, DiscountType, IDiscount, IProduct } from \"./types\";\n\n@injectable()\nexport class PolarDiscount {\n private client: Polar;\n\n constructor(@inject(AppEnv) private readonly env: AppEnv) {\n const accessToken = this.env.POLAR_ACCESS_TOKEN;\n\n if (!accessToken) {\n throw new PaymentException(\n \"Polar access token is required. Please set the POLAR_ACCESS_TOKEN environment variable.\",\n \"TOKEN_REQUIRED\",\n );\n }\n\n this.client = new Polar({\n accessToken,\n server: (this.env.POLAR_ENVIRONMENT as \"sandbox\" | \"production\") || \"production\",\n });\n }\n\n private toDiscountType(type: DiscountType): \"percentage\" | \"fixed\" {\n return type === \"percentage\" ? \"percentage\" : \"fixed\";\n }\n\n private toDiscountDuration(duration: DiscountDurationType): \"once\" | \"repeating\" | \"forever\" {\n switch (duration) {\n case \"once\":\n return \"once\";\n case \"repeating\":\n return \"repeating\";\n case \"forever\":\n return \"forever\";\n default:\n return \"once\";\n }\n }\n\n public async create(data: IDiscount): Promise<IDiscount> {\n const discountType = this.toDiscountType(data.type);\n const duration = this.toDiscountDuration(data.duration);\n\n const basePayload = {\n name: data.name,\n code: data.code ?? null,\n startsAt: data.startAt ?? null,\n endsAt: data.endAt ?? null,\n maxRedemptions: data.maxRedemptions ?? null,\n organizationId: data.organizationId ?? null,\n metadata: data.metadata,\n products: data.applicableProducts?.map((p) => p.id as string) ?? null,\n };\n\n let response: unknown;\n\n if (discountType === \"percentage\") {\n if (duration === \"repeating\") {\n response = await this.client.discounts.create({\n ...basePayload,\n type: \"percentage\",\n basisPoints: data.amount * 100,\n duration: \"repeating\",\n durationInMonths: data.durationInMonths ?? 1,\n });\n } else {\n response = await this.client.discounts.create({\n ...basePayload,\n type: \"percentage\",\n basisPoints: data.amount * 100,\n duration: duration as \"once\" | \"forever\",\n });\n }\n } else {\n if (duration === \"repeating\") {\n response = await this.client.discounts.create({\n ...basePayload,\n type: \"fixed\",\n amount: data.amount,\n currency: data.currency ?? \"usd\",\n duration: \"repeating\",\n durationInMonths: data.durationInMonths ?? 1,\n });\n } else {\n response = await this.client.discounts.create({\n ...basePayload,\n type: \"fixed\",\n amount: data.amount,\n currency: data.currency ?? \"usd\",\n duration: duration as \"once\" | \"forever\",\n });\n }\n }\n\n return this.mapResponse(response as unknown as DiscountResponseType);\n }\n\n public async update(id: string, data: Partial<IDiscount>): Promise<IDiscount> {\n const response = await this.client.discounts.update({\n id,\n discountUpdate: {\n name: data.name ?? null,\n code: data.code ?? null,\n startsAt: data.startAt ?? null,\n endsAt: data.endAt ?? null,\n maxRedemptions: data.maxRedemptions ?? null,\n metadata: data.metadata,\n products: data.applicableProducts?.map((p) => p.id as string) ?? null,\n },\n });\n\n return this.mapResponse(response as unknown as DiscountResponseType);\n }\n\n public async remove(id: string): Promise<void> {\n await this.client.discounts.delete({ id });\n }\n\n public async get(id: string): Promise<IDiscount> {\n const response = await this.client.discounts.get({ id });\n\n return this.mapResponse(response as unknown as DiscountResponseType);\n }\n\n private mapResponse(response: DiscountResponseType): IDiscount {\n const discount: IDiscount = {\n id: response.id,\n name: response.name,\n type: response.type as DiscountType,\n amount: response.type === \"percentage\" ? (response.basisPoints ?? 0) / 100 : (response.amount ?? 0),\n duration: response.duration as DiscountDurationType,\n redemptionsCount: response.redemptionsCount,\n metadata: response.metadata,\n };\n\n if (response.createdAt) {\n discount.createdAt = response.createdAt;\n }\n\n if (response.modifiedAt) {\n discount.updatedAt = response.modifiedAt;\n }\n\n if (response.code) {\n discount.code = response.code;\n }\n\n if (response.startsAt) {\n discount.startAt = response.startsAt;\n }\n\n if (response.endsAt) {\n discount.endAt = response.endsAt;\n }\n\n if (response.maxRedemptions) {\n discount.maxRedemptions = response.maxRedemptions;\n }\n\n if (response.durationInMonths) {\n discount.durationInMonths = response.durationInMonths;\n }\n\n if (response.organizationId) {\n discount.organizationId = response.organizationId;\n }\n\n if (response.currency) {\n discount.currency = response.currency as CurrencyCodeType;\n }\n\n if (response.products) {\n discount.applicableProducts = response.products.map(\n (p: { id: string; name: string }) =>\n ({\n id: p.id,\n name: p.name,\n }) as IProduct,\n );\n }\n\n return discount;\n }\n}\n",
11
- "import { AppEnv } from \"@talosjs/app-env\";\nimport { inject, injectable } from \"@talosjs/container\";\nimport { Polar } from \"@polar-sh/sdk\";\nimport type { SubscriptionRecurringInterval } from \"@polar-sh/sdk/models/components/subscriptionrecurringinterval.js\";\nimport { PaymentException } from \"./PaymentException\";\nimport type { BenefitType, CustomFieldType, IProduct, PriceType, SubscriptionPeriodType } from \"./types\";\n\n@injectable()\nexport class PolarProduct {\n private client: Polar;\n\n constructor(@inject(AppEnv) private readonly env: AppEnv) {\n const accessToken = this.env.POLAR_ACCESS_TOKEN;\n\n if (!accessToken) {\n throw new PaymentException(\n \"Polar access token is required. Please set the POLAR_ACCESS_TOKEN environment variable.\",\n \"TOKEN_REQUIRED\",\n );\n }\n\n this.client = new Polar({\n accessToken,\n server: (this.env.POLAR_ENVIRONMENT as \"sandbox\" | \"production\") || \"production\",\n });\n }\n\n private toRecurringInterval(period?: SubscriptionPeriodType): SubscriptionRecurringInterval | null {\n if (!period) return null;\n\n switch (period) {\n case \"monthly\":\n return \"month\";\n case \"yearly\":\n return \"year\";\n default:\n return null;\n }\n }\n\n public async create(data: IProduct): Promise<Omit<IProduct, \"id\">> {\n const response = await this.client.products.create({\n name: data.name,\n description: data.description ?? null,\n recurringInterval: this.toRecurringInterval(data.recurringInterval),\n prices:\n data.prices?.map((price) => ({\n type: price.type,\n priceCurrency: price.priceCurrency ?? \"usd\",\n priceAmount: price.priceAmount,\n minimumAmount: price.minimumAmount,\n maximumAmount: price.maximumAmount,\n presetAmount: price.presetAmount,\n })) ?? [],\n medias: data.images?.map((image) => image.url) ?? null,\n organizationId: data.organizationId ?? null,\n metadata: data.metadata,\n attachedCustomFields: data.attachedCustomFields?.map((field) => ({\n customFieldId: field.customFieldId,\n required: field.required,\n })),\n });\n\n return this.mapResponse(response);\n }\n\n public async update(id: string, data: Partial<IProduct>): Promise<Omit<IProduct, \"id\">> {\n const response = await this.client.products.update({\n id,\n productUpdate: {\n name: data.name ?? null,\n description: data.description ?? null,\n isArchived: data.isArchived ?? null,\n recurringInterval: this.toRecurringInterval(data.recurringInterval),\n prices:\n data.prices?.map((price) => ({\n type: price.type,\n priceCurrency: price.priceCurrency ?? \"usd\",\n priceAmount: price.priceAmount,\n minimumAmount: price.minimumAmount,\n maximumAmount: price.maximumAmount,\n presetAmount: price.presetAmount,\n })) ?? null,\n medias: data.images?.map((image) => image.url) ?? null,\n metadata: data.metadata,\n attachedCustomFields:\n data.attachedCustomFields?.map((field) => ({\n customFieldId: field.customFieldId,\n required: field.required,\n })) ?? null,\n },\n });\n\n return this.mapResponse(response);\n }\n\n public async remove(id: string): Promise<void> {\n await this.client.products.update({\n id,\n productUpdate: {\n isArchived: true,\n },\n });\n }\n\n private mapResponse(response: {\n id: string;\n createdAt: Date;\n modifiedAt: Date | null;\n name: string;\n description: string | null;\n isRecurring: boolean;\n isArchived: boolean;\n organizationId: string;\n metadata: Record<string, string | number | boolean>;\n prices: unknown[];\n benefits: unknown[];\n attachedCustomFields: unknown[];\n }): Omit<IProduct, \"id\"> {\n const product: Omit<IProduct, \"id\"> = {\n key: response.id,\n name: response.name,\n isRecurring: response.isRecurring,\n isArchived: response.isArchived,\n organizationId: response.organizationId,\n metadata: response.metadata,\n prices: response.prices as PriceType[],\n benefits: response.benefits as BenefitType[],\n attachedCustomFields: response.attachedCustomFields as CustomFieldType[],\n };\n\n if (response.createdAt) {\n product.createdAt = response.createdAt;\n }\n\n if (response.modifiedAt) {\n product.updatedAt = response.modifiedAt;\n }\n\n if (response.description) {\n product.description = response.description;\n }\n\n return product;\n }\n}\n",
6
+ "import { Polar } from \"@polar-sh/sdk\";\nimport type { RFCDate } from \"@polar-sh/sdk/types/rfcdate.js\";\nimport { AppEnv } from \"@talosjs/app-env\";\nimport { inject, injectable } from \"@talosjs/container\";\nimport { PaymentException } from \"./PaymentException\";\nimport type {\n AnalyticsIntervalsLimitsType,\n AnalyticsLimitsType,\n AnalyticsMetricInfoType,\n AnalyticsMetricsType,\n AnalyticsOptionsType,\n AnalyticsPeriodType,\n AnalyticsResponseType,\n BillingTypeType,\n} from \"./types\";\n\n@injectable()\nexport class PolarAnalytics {\n private client: Polar;\n\n constructor(@inject(AppEnv) private readonly env: AppEnv) {\n const accessToken = this.env.POLAR_ACCESS_TOKEN;\n\n if (!accessToken) {\n throw new PaymentException(\n \"Polar access token is required. Please set the POLAR_ACCESS_TOKEN environment variable.\",\n \"TOKEN_REQUIRED\",\n );\n }\n\n this.client = new Polar({\n accessToken,\n server: (this.env.POLAR_ENVIRONMENT as \"sandbox\" | \"production\") || \"production\",\n });\n }\n\n public async get(options: AnalyticsOptionsType): Promise<AnalyticsResponseType> {\n const response = await this.client.metrics.get({\n startDate: this.toRFCDate(options.startDate),\n endDate: this.toRFCDate(options.endDate),\n interval: options.interval,\n organizationId: options.organizationId ?? null,\n productId: options.productId ?? null,\n billingType: (options.billingType as BillingTypeType) ?? null,\n customerId: options.customerId ?? null,\n });\n\n return {\n periods: response.periods.map((period) => this.mapPeriod(period)),\n metrics: this.mapMetrics(response.metrics),\n };\n }\n\n public async getLimits(): Promise<AnalyticsLimitsType> {\n const response = await this.client.metrics.limits();\n\n return {\n minDate: new Date(response.minDate.toString()),\n intervals: this.mapIntervalsLimits(response.intervals),\n };\n }\n\n private toRFCDate(date: Date): RFCDate {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n\n return `${year}-${month}-${day}` as unknown as RFCDate;\n }\n\n private mapPeriod(period: {\n timestamp: Date;\n orders: number;\n revenue: number;\n cumulativeRevenue: number;\n averageOrderValue: number;\n oneTimeProducts: number;\n oneTimeProductsRevenue: number;\n newSubscriptions: number;\n newSubscriptionsRevenue: number;\n renewedSubscriptions: number;\n renewedSubscriptionsRevenue: number;\n activeSubscriptions: number;\n monthlyRecurringRevenue: number;\n }): AnalyticsPeriodType {\n return {\n timestamp: period.timestamp,\n orders: period.orders,\n revenue: period.revenue,\n cumulativeRevenue: period.cumulativeRevenue,\n averageOrderValue: period.averageOrderValue,\n oneTimeProducts: period.oneTimeProducts,\n oneTimeProductsRevenue: period.oneTimeProductsRevenue,\n newSubscriptions: period.newSubscriptions,\n newSubscriptionsRevenue: period.newSubscriptionsRevenue,\n renewedSubscriptions: period.renewedSubscriptions,\n renewedSubscriptionsRevenue: period.renewedSubscriptionsRevenue,\n activeSubscriptions: period.activeSubscriptions,\n monthlyRecurringRevenue: period.monthlyRecurringRevenue,\n };\n }\n\n private mapMetricInfo(metric: { slug: string; displayName: string; type: string }): AnalyticsMetricInfoType {\n return {\n slug: metric.slug,\n displayName: metric.displayName,\n type: metric.type,\n };\n }\n\n private mapMetrics(metrics: {\n orders: { slug: string; displayName: string; type: string };\n revenue: { slug: string; displayName: string; type: string };\n cumulativeRevenue: { slug: string; displayName: string; type: string };\n averageOrderValue: { slug: string; displayName: string; type: string };\n oneTimeProducts: { slug: string; displayName: string; type: string };\n oneTimeProductsRevenue: { slug: string; displayName: string; type: string };\n newSubscriptions: { slug: string; displayName: string; type: string };\n newSubscriptionsRevenue: { slug: string; displayName: string; type: string };\n renewedSubscriptions: { slug: string; displayName: string; type: string };\n renewedSubscriptionsRevenue: { slug: string; displayName: string; type: string };\n activeSubscriptions: { slug: string; displayName: string; type: string };\n monthlyRecurringRevenue: { slug: string; displayName: string; type: string };\n }): AnalyticsMetricsType {\n return {\n orders: this.mapMetricInfo(metrics.orders),\n revenue: this.mapMetricInfo(metrics.revenue),\n cumulativeRevenue: this.mapMetricInfo(metrics.cumulativeRevenue),\n averageOrderValue: this.mapMetricInfo(metrics.averageOrderValue),\n oneTimeProducts: this.mapMetricInfo(metrics.oneTimeProducts),\n oneTimeProductsRevenue: this.mapMetricInfo(metrics.oneTimeProductsRevenue),\n newSubscriptions: this.mapMetricInfo(metrics.newSubscriptions),\n newSubscriptionsRevenue: this.mapMetricInfo(metrics.newSubscriptionsRevenue),\n renewedSubscriptions: this.mapMetricInfo(metrics.renewedSubscriptions),\n renewedSubscriptionsRevenue: this.mapMetricInfo(metrics.renewedSubscriptionsRevenue),\n activeSubscriptions: this.mapMetricInfo(metrics.activeSubscriptions),\n monthlyRecurringRevenue: this.mapMetricInfo(metrics.monthlyRecurringRevenue),\n };\n }\n\n private mapIntervalsLimits(intervals: {\n hour: { maxDays: number };\n day: { maxDays: number };\n week: { maxDays: number };\n month: { maxDays: number };\n year: { maxDays: number };\n }): AnalyticsIntervalsLimitsType {\n return {\n hour: { maxDays: intervals.hour.maxDays },\n day: { maxDays: intervals.day.maxDays },\n week: { maxDays: intervals.week.maxDays },\n month: { maxDays: intervals.month.maxDays },\n year: { maxDays: intervals.year.maxDays },\n };\n }\n}\n",
7
+ "import { Polar } from \"@polar-sh/sdk\";\nimport { AppEnv } from \"@talosjs/app-env\";\nimport { inject, injectable } from \"@talosjs/container\";\nimport type { CurrencyCodeType } from \"@talosjs/currencies\";\nimport { PaymentException } from \"./PaymentException\";\nimport type {\n CheckoutAddressType,\n CheckoutCreateType,\n CheckoutCustomerType,\n CheckoutResponseType,\n CheckoutStatusType,\n CheckoutType,\n} from \"./types\";\n\n@injectable()\nexport class PolarCheckout {\n private client: Polar;\n\n constructor(@inject(AppEnv) private readonly env: AppEnv) {\n const accessToken = this.env.POLAR_ACCESS_TOKEN;\n\n if (!accessToken) {\n throw new PaymentException(\n \"Polar access token is required. Please set the POLAR_ACCESS_TOKEN environment variable.\",\n \"TOKEN_REQUIRED\",\n );\n }\n\n this.client = new Polar({\n accessToken,\n server: (this.env.POLAR_ENVIRONMENT as \"sandbox\" | \"production\") || \"production\",\n });\n }\n\n public async create(data: CheckoutCreateType): Promise<CheckoutType> {\n const response = await this.client.checkouts.create({\n products: data.products,\n customerExternalId: data.customerExternalId ?? null,\n customerId: data.customerId ?? null,\n customerEmail: data.customerEmail ?? null,\n customerName: data.customerName ?? null,\n customerBillingAddress: data.customerBillingAddress?.country\n ? {\n country: data.customerBillingAddress.country,\n line1: data.customerBillingAddress.line1 ?? null,\n line2: data.customerBillingAddress.line2 ?? null,\n city: data.customerBillingAddress.city ?? null,\n state: data.customerBillingAddress.state ?? null,\n postalCode: data.customerBillingAddress.postalCode ?? null,\n }\n : null,\n customerTaxId: data.customerTaxId ?? null,\n discountId: data.discountId ?? null,\n allowDiscountCodes: data.allowDiscountCodes ?? true,\n successUrl: data.successUrl ?? null,\n embedOrigin: data.embedOrigin ?? null,\n metadata: data.metadata,\n });\n\n return this.mapResponse(response as unknown as CheckoutResponseType);\n }\n\n public async get(id: string): Promise<CheckoutType> {\n const response = await this.client.checkouts.get({ id });\n\n return this.mapResponse(response as unknown as CheckoutResponseType);\n }\n\n private mapResponse(response: CheckoutResponseType): CheckoutType {\n const checkout: CheckoutType = {\n id: response.id,\n status: response.status as CheckoutStatusType,\n clientSecret: response.clientSecret,\n };\n\n if (response.url) {\n checkout.url = response.url;\n }\n\n if (response.embedId) {\n checkout.embedId = response.embedId;\n }\n\n if (response.allowDiscountCodes !== undefined) {\n checkout.allowDiscountCodes = response.allowDiscountCodes;\n }\n\n if (response.isDiscountApplicable !== undefined) {\n checkout.isDiscountApplicable = response.isDiscountApplicable;\n }\n\n if (response.isPaymentRequired !== undefined) {\n checkout.isPaymentRequired = response.isPaymentRequired;\n }\n\n if (response.metadata) {\n checkout.metadata = response.metadata;\n }\n\n if (response.createdAt) {\n checkout.createdAt = response.createdAt;\n }\n\n if (response.modifiedAt) {\n checkout.updatedAt = response.modifiedAt;\n }\n\n if (response.expiresAt) {\n checkout.expiresAt = response.expiresAt;\n }\n\n if (response.successUrl) {\n checkout.successUrl = response.successUrl;\n }\n\n if (response.embedOrigin) {\n checkout.embedOrigin = response.embedOrigin;\n }\n\n if (response.amount !== undefined) {\n checkout.amount = response.amount;\n }\n\n if (response.taxAmount !== undefined) {\n checkout.taxAmount = response.taxAmount;\n }\n\n if (response.currency) {\n checkout.currency = response.currency as CurrencyCodeType;\n }\n\n if (response.subtotalAmount !== undefined) {\n checkout.subtotalAmount = response.subtotalAmount;\n }\n\n if (response.totalAmount !== undefined) {\n checkout.totalAmount = response.totalAmount;\n }\n\n if (response.productId) {\n checkout.productId = response.productId;\n }\n\n if (response.productPriceId) {\n checkout.productPriceId = response.productPriceId;\n }\n\n if (response.discountId) {\n checkout.discountId = response.discountId;\n }\n\n if (response.customer) {\n checkout.customer = {\n id: response.customer.id,\n email: response.customer.email,\n name: response.customer.name,\n externalId: response.customer.externalId,\n taxId: response.customer.taxId,\n } as CheckoutCustomerType;\n\n if (response.customer.billingAddress) {\n checkout.customer.billingAddress = response.customer.billingAddress as CheckoutAddressType;\n }\n }\n\n return checkout;\n }\n}\n",
8
+ "import { Polar } from \"@polar-sh/sdk\";\nimport type { Address } from \"@polar-sh/sdk/models/components/address.js\";\nimport { AppEnv } from \"@talosjs/app-env\";\nimport { inject, injectable } from \"@talosjs/container\";\nimport { PaymentException } from \"./PaymentException\";\nimport type {\n CustomerAddressType,\n CustomerCreateType,\n CustomerListOptionsType,\n CustomerListResponseType,\n CustomerListResultType,\n CustomerResponseType,\n CustomerType,\n CustomerUpdateType,\n} from \"./types\";\n\n@injectable()\nexport class PolarCustomer {\n private client: Polar;\n\n constructor(@inject(AppEnv) private readonly env: AppEnv) {\n const accessToken = this.env.POLAR_ACCESS_TOKEN;\n\n if (!accessToken) {\n throw new PaymentException(\n \"Polar access token is required. Please set the POLAR_ACCESS_TOKEN environment variable.\",\n \"TOKEN_REQUIRED\",\n );\n }\n\n this.client = new Polar({\n accessToken,\n server: (this.env.POLAR_ENVIRONMENT as \"sandbox\" | \"production\") || \"production\",\n });\n }\n\n public async create(data: CustomerCreateType): Promise<CustomerType> {\n const response = await this.client.customers.create({\n email: data.email,\n name: data.name ?? null,\n externalId: data.externalId ?? null,\n billingAddress: data.billingAddress ? this.toBillingAddress(data.billingAddress) : null,\n taxId: data.taxId ? [data.taxId, null] : null,\n organizationId: data.organizationId ?? null,\n metadata: data.metadata,\n });\n\n return this.mapResponse(response as unknown as CustomerResponseType);\n }\n\n public async update(id: string, data: CustomerUpdateType): Promise<CustomerType> {\n const response = await this.client.customers.update({\n id,\n customerUpdate: {\n email: data.email ?? null,\n name: data.name ?? null,\n billingAddress: data.billingAddress ? this.toBillingAddress(data.billingAddress) : null,\n taxId: data.taxId ? [data.taxId, null] : null,\n metadata: data.metadata,\n },\n });\n\n return this.mapResponse(response as unknown as CustomerResponseType);\n }\n\n public async remove(id: string): Promise<void> {\n await this.client.customers.delete({ id });\n }\n\n public async get(id: string): Promise<CustomerType> {\n const response = await this.client.customers.get({ id });\n\n return this.mapResponse(response as unknown as CustomerResponseType);\n }\n\n public async list(options?: CustomerListOptionsType): Promise<CustomerListResultType> {\n const response = await this.client.customers.list({\n organizationId: options?.organizationId,\n email: options?.email,\n query: options?.query,\n page: options?.page ?? 1,\n limit: options?.limit ?? 10,\n });\n\n const result = response as unknown as CustomerListResponseType;\n\n return {\n items: result.result.items.map((item) => this.mapResponse(item)),\n pagination: {\n totalCount: result.result.pagination.totalCount,\n maxPage: result.result.pagination.maxPage,\n },\n };\n }\n\n public async getByExternalId(externalId: string): Promise<CustomerType> {\n const response = await this.client.customers.getExternal({ externalId });\n\n return this.mapResponse(response as unknown as CustomerResponseType);\n }\n\n public async updateByExternalId(externalId: string, data: CustomerUpdateType): Promise<CustomerType> {\n const response = await this.client.customers.updateExternal({\n externalId,\n customerUpdate: {\n email: data.email ?? null,\n name: data.name ?? null,\n billingAddress: data.billingAddress ? this.toBillingAddress(data.billingAddress) : null,\n taxId: data.taxId ? [data.taxId, null] : null,\n metadata: data.metadata,\n },\n });\n\n return this.mapResponse(response as unknown as CustomerResponseType);\n }\n\n public async removeByExternalId(externalId: string): Promise<void> {\n await this.client.customers.deleteExternal({ externalId });\n }\n\n private toBillingAddress(address: CustomerAddressType): Address {\n return {\n country: address.country ?? \"\",\n line1: address.line1,\n line2: address.line2,\n city: address.city,\n state: address.state,\n postalCode: address.postalCode,\n };\n }\n\n private mapResponse(response: CustomerResponseType): CustomerType {\n const customer: CustomerType = {\n id: response.id,\n email: response.email,\n emailVerified: response.emailVerified ?? false,\n };\n\n if (response.createdAt) {\n customer.createdAt = response.createdAt;\n }\n\n if (response.modifiedAt) {\n customer.updatedAt = response.modifiedAt;\n }\n\n if (response.deletedAt) {\n customer.deletedAt = response.deletedAt;\n }\n\n if (response.name) {\n customer.name = response.name;\n }\n\n if (response.externalId) {\n customer.externalId = response.externalId;\n }\n\n if (response.avatarUrl) {\n customer.avatarUrl = response.avatarUrl;\n }\n\n if (response.billingAddress) {\n const billingAddress: CustomerAddressType = {};\n if (response.billingAddress.line1) {\n billingAddress.line1 = response.billingAddress.line1;\n }\n if (response.billingAddress.line2) {\n billingAddress.line2 = response.billingAddress.line2;\n }\n if (response.billingAddress.city) {\n billingAddress.city = response.billingAddress.city;\n }\n if (response.billingAddress.state) {\n billingAddress.state = response.billingAddress.state;\n }\n if (response.billingAddress.postalCode) {\n billingAddress.postalCode = response.billingAddress.postalCode;\n }\n if (response.billingAddress.country) {\n billingAddress.country = response.billingAddress.country;\n }\n customer.billingAddress = billingAddress;\n }\n\n if (response.taxId) {\n const taxIdValue = typeof response.taxId === \"string\" ? response.taxId : response.taxId[1];\n customer.taxId = taxIdValue;\n }\n\n if (response.organizationId) {\n customer.organizationId = response.organizationId;\n }\n\n if (response.metadata) {\n customer.metadata = response.metadata;\n }\n\n return customer;\n }\n}\n",
9
+ "import { Polar } from \"@polar-sh/sdk\";\nimport { AppEnv } from \"@talosjs/app-env\";\nimport { inject, injectable } from \"@talosjs/container\";\nimport { PaymentException } from \"./PaymentException\";\nimport type { CustomerSessionCreateType, CustomerSessionResponseType, CustomerSessionType } from \"./types\";\n\n@injectable()\nexport class PolarCustomerPortal {\n private client: Polar;\n\n constructor(@inject(AppEnv) private readonly env: AppEnv) {\n const accessToken = this.env.POLAR_ACCESS_TOKEN;\n\n if (!accessToken) {\n throw new PaymentException(\n \"Polar access token is required. Please set the POLAR_ACCESS_TOKEN environment variable.\",\n \"TOKEN_REQUIRED\",\n );\n }\n\n this.client = new Polar({\n accessToken,\n server: (this.env.POLAR_ENVIRONMENT as \"sandbox\" | \"production\") || \"production\",\n });\n }\n\n public async create(data: CustomerSessionCreateType): Promise<CustomerSessionType> {\n const response = await this.client.customerSessions.create({\n customerId: data.customerId,\n });\n\n return this.mapResponse(response as unknown as CustomerSessionResponseType);\n }\n\n public getPortalUrl(organizationSlug: string): string {\n const baseUrl = this.env.POLAR_ENVIRONMENT === \"sandbox\" ? \"https://sandbox.polar.sh\" : \"https://polar.sh\";\n\n return `${baseUrl}/${organizationSlug}/portal`;\n }\n\n private mapResponse(response: CustomerSessionResponseType): CustomerSessionType {\n const session: CustomerSessionType = {\n id: response.id,\n token: response.token,\n customerPortalUrl: response.customerPortalUrl,\n };\n\n if (response.createdAt) {\n session.createdAt = response.createdAt;\n }\n\n if (response.expiresAt) {\n session.expiresAt = response.expiresAt;\n }\n\n if (response.customerId) {\n session.customerId = response.customerId;\n }\n\n return session;\n }\n}\n",
10
+ "import { Polar } from \"@polar-sh/sdk\";\nimport { AppEnv } from \"@talosjs/app-env\";\nimport { inject, injectable } from \"@talosjs/container\";\nimport type { CurrencyCodeType } from \"@talosjs/currencies\";\nimport { PaymentException } from \"./PaymentException\";\nimport type { DiscountDurationType, DiscountResponseType, DiscountType, IDiscount, IProduct } from \"./types\";\n\n@injectable()\nexport class PolarDiscount {\n private client: Polar;\n\n constructor(@inject(AppEnv) private readonly env: AppEnv) {\n const accessToken = this.env.POLAR_ACCESS_TOKEN;\n\n if (!accessToken) {\n throw new PaymentException(\n \"Polar access token is required. Please set the POLAR_ACCESS_TOKEN environment variable.\",\n \"TOKEN_REQUIRED\",\n );\n }\n\n this.client = new Polar({\n accessToken,\n server: (this.env.POLAR_ENVIRONMENT as \"sandbox\" | \"production\") || \"production\",\n });\n }\n\n private toDiscountType(type: DiscountType): \"percentage\" | \"fixed\" {\n return type === \"percentage\" ? \"percentage\" : \"fixed\";\n }\n\n private toDiscountDuration(duration: DiscountDurationType): \"once\" | \"repeating\" | \"forever\" {\n switch (duration) {\n case \"once\":\n return \"once\";\n case \"repeating\":\n return \"repeating\";\n case \"forever\":\n return \"forever\";\n default:\n return \"once\";\n }\n }\n\n public async create(data: IDiscount): Promise<IDiscount> {\n const discountType = this.toDiscountType(data.type);\n const duration = this.toDiscountDuration(data.duration);\n\n const basePayload = {\n name: data.name,\n code: data.code ?? null,\n startsAt: data.startAt ?? null,\n endsAt: data.endAt ?? null,\n maxRedemptions: data.maxRedemptions ?? null,\n organizationId: data.organizationId ?? null,\n metadata: data.metadata,\n products: data.applicableProducts?.map((p) => p.id as string) ?? null,\n };\n\n let response: unknown;\n\n if (discountType === \"percentage\") {\n if (duration === \"repeating\") {\n response = await this.client.discounts.create({\n ...basePayload,\n type: \"percentage\",\n basisPoints: data.amount * 100,\n duration: \"repeating\",\n durationInMonths: data.durationInMonths ?? 1,\n });\n } else {\n response = await this.client.discounts.create({\n ...basePayload,\n type: \"percentage\",\n basisPoints: data.amount * 100,\n duration: duration as \"once\" | \"forever\",\n });\n }\n } else {\n if (duration === \"repeating\") {\n response = await this.client.discounts.create({\n ...basePayload,\n type: \"fixed\",\n amount: data.amount,\n currency: data.currency ?? \"usd\",\n duration: \"repeating\",\n durationInMonths: data.durationInMonths ?? 1,\n });\n } else {\n response = await this.client.discounts.create({\n ...basePayload,\n type: \"fixed\",\n amount: data.amount,\n currency: data.currency ?? \"usd\",\n duration: duration as \"once\" | \"forever\",\n });\n }\n }\n\n return this.mapResponse(response as unknown as DiscountResponseType);\n }\n\n public async update(id: string, data: Partial<IDiscount>): Promise<IDiscount> {\n const response = await this.client.discounts.update({\n id,\n discountUpdate: {\n name: data.name ?? null,\n code: data.code ?? null,\n startsAt: data.startAt ?? null,\n endsAt: data.endAt ?? null,\n maxRedemptions: data.maxRedemptions ?? null,\n metadata: data.metadata,\n products: data.applicableProducts?.map((p) => p.id as string) ?? null,\n },\n });\n\n return this.mapResponse(response as unknown as DiscountResponseType);\n }\n\n public async remove(id: string): Promise<void> {\n await this.client.discounts.delete({ id });\n }\n\n public async get(id: string): Promise<IDiscount> {\n const response = await this.client.discounts.get({ id });\n\n return this.mapResponse(response as unknown as DiscountResponseType);\n }\n\n private mapResponse(response: DiscountResponseType): IDiscount {\n const discount: IDiscount = {\n id: response.id,\n name: response.name,\n type: response.type as DiscountType,\n amount: response.type === \"percentage\" ? (response.basisPoints ?? 0) / 100 : (response.amount ?? 0),\n duration: response.duration as DiscountDurationType,\n redemptionsCount: response.redemptionsCount,\n metadata: response.metadata,\n };\n\n if (response.createdAt) {\n discount.createdAt = response.createdAt;\n }\n\n if (response.modifiedAt) {\n discount.updatedAt = response.modifiedAt;\n }\n\n if (response.code) {\n discount.code = response.code;\n }\n\n if (response.startsAt) {\n discount.startAt = response.startsAt;\n }\n\n if (response.endsAt) {\n discount.endAt = response.endsAt;\n }\n\n if (response.maxRedemptions) {\n discount.maxRedemptions = response.maxRedemptions;\n }\n\n if (response.durationInMonths) {\n discount.durationInMonths = response.durationInMonths;\n }\n\n if (response.organizationId) {\n discount.organizationId = response.organizationId;\n }\n\n if (response.currency) {\n discount.currency = response.currency as CurrencyCodeType;\n }\n\n if (response.products) {\n discount.applicableProducts = response.products.map(\n (p: { id: string; name: string }) =>\n ({\n id: p.id,\n name: p.name,\n }) as IProduct,\n );\n }\n\n return discount;\n }\n}\n",
11
+ "import { Polar } from \"@polar-sh/sdk\";\nimport type { SubscriptionRecurringInterval } from \"@polar-sh/sdk/models/components/subscriptionrecurringinterval.js\";\nimport { AppEnv } from \"@talosjs/app-env\";\nimport { inject, injectable } from \"@talosjs/container\";\nimport { PaymentException } from \"./PaymentException\";\nimport type { BenefitType, CustomFieldType, IProduct, PriceType, SubscriptionPeriodType } from \"./types\";\n\n@injectable()\nexport class PolarProduct {\n private client: Polar;\n\n constructor(@inject(AppEnv) private readonly env: AppEnv) {\n const accessToken = this.env.POLAR_ACCESS_TOKEN;\n\n if (!accessToken) {\n throw new PaymentException(\n \"Polar access token is required. Please set the POLAR_ACCESS_TOKEN environment variable.\",\n \"TOKEN_REQUIRED\",\n );\n }\n\n this.client = new Polar({\n accessToken,\n server: (this.env.POLAR_ENVIRONMENT as \"sandbox\" | \"production\") || \"production\",\n });\n }\n\n private toRecurringInterval(period?: SubscriptionPeriodType): SubscriptionRecurringInterval | null {\n if (!period) return null;\n\n switch (period) {\n case \"monthly\":\n return \"month\";\n case \"yearly\":\n return \"year\";\n default:\n return null;\n }\n }\n\n public async create(data: IProduct): Promise<Omit<IProduct, \"id\">> {\n const response = await this.client.products.create({\n name: data.name,\n description: data.description ?? null,\n recurringInterval: this.toRecurringInterval(data.recurringInterval),\n prices:\n data.prices?.map((price) => ({\n type: price.type,\n priceCurrency: price.priceCurrency ?? \"usd\",\n priceAmount: price.priceAmount,\n minimumAmount: price.minimumAmount,\n maximumAmount: price.maximumAmount,\n presetAmount: price.presetAmount,\n })) ?? [],\n medias: data.images?.map((image) => image.url) ?? null,\n organizationId: data.organizationId ?? null,\n metadata: data.metadata,\n attachedCustomFields: data.attachedCustomFields?.map((field) => ({\n customFieldId: field.customFieldId,\n required: field.required,\n })),\n });\n\n return this.mapResponse(response);\n }\n\n public async update(id: string, data: Partial<IProduct>): Promise<Omit<IProduct, \"id\">> {\n const response = await this.client.products.update({\n id,\n productUpdate: {\n name: data.name ?? null,\n description: data.description ?? null,\n isArchived: data.isArchived ?? null,\n recurringInterval: this.toRecurringInterval(data.recurringInterval),\n prices:\n data.prices?.map((price) => ({\n type: price.type,\n priceCurrency: price.priceCurrency ?? \"usd\",\n priceAmount: price.priceAmount,\n minimumAmount: price.minimumAmount,\n maximumAmount: price.maximumAmount,\n presetAmount: price.presetAmount,\n })) ?? null,\n medias: data.images?.map((image) => image.url) ?? null,\n metadata: data.metadata,\n attachedCustomFields:\n data.attachedCustomFields?.map((field) => ({\n customFieldId: field.customFieldId,\n required: field.required,\n })) ?? null,\n },\n });\n\n return this.mapResponse(response);\n }\n\n public async remove(id: string): Promise<void> {\n await this.client.products.update({\n id,\n productUpdate: {\n isArchived: true,\n },\n });\n }\n\n private mapResponse(response: {\n id: string;\n createdAt: Date;\n modifiedAt: Date | null;\n name: string;\n description: string | null;\n isRecurring: boolean;\n isArchived: boolean;\n organizationId: string;\n metadata: Record<string, string | number | boolean>;\n prices: unknown[];\n benefits: unknown[];\n attachedCustomFields: unknown[];\n }): Omit<IProduct, \"id\"> {\n const product: Omit<IProduct, \"id\"> = {\n key: response.id,\n name: response.name,\n isRecurring: response.isRecurring,\n isArchived: response.isArchived,\n organizationId: response.organizationId,\n metadata: response.metadata,\n prices: response.prices as PriceType[],\n benefits: response.benefits as BenefitType[],\n attachedCustomFields: response.attachedCustomFields as CustomFieldType[],\n };\n\n if (response.createdAt) {\n product.createdAt = response.createdAt;\n }\n\n if (response.modifiedAt) {\n product.updatedAt = response.modifiedAt;\n }\n\n if (response.description) {\n product.description = response.description;\n }\n\n return product;\n }\n}\n",
12
12
  "import type { CurrencyCodeType } from \"@talosjs/currencies\";\nimport type { IBase, ScalarType } from \"@talosjs/types\";\n\nexport enum EPriceType {\n FIXED = \"fixed\",\n CUSTOM = \"custom\",\n FREE = \"free\",\n}\n\nexport type PriceTypeType = `${EPriceType}`;\n\nexport type ProductImageType = {\n id: string;\n url: string;\n};\n\nexport type PriceType = {\n type: PriceTypeType;\n priceCurrency?: string;\n priceAmount?: number;\n minimumAmount?: number;\n maximumAmount?: number;\n presetAmount?: number;\n};\n\nexport type CustomFieldType = {\n customFieldId: string;\n required: boolean;\n};\n\nexport enum EDiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n}\n\nexport enum EDiscountDuration {\n ONCE = \"once\",\n REPEATING = \"repeating\",\n FOREVER = \"forever\",\n}\n\nexport type DiscountDurationType = `${EDiscountDuration}`;\n\nexport enum ESubscriptionPeriod {\n MONTHLY = \"monthly\",\n YEARLY = \"yearly\",\n WEEKLY = \"weekly\",\n DAILY = \"daily\",\n}\n\nexport type DiscountType = `${EDiscountType}`;\nexport type SubscriptionPeriodType = `${ESubscriptionPeriod}`;\n\nexport enum EBenefitType {\n CREDITS = \"credits\",\n LICENSE_KEYS = \"license_keys\",\n FILE_DOWNLOADS = \"file_downloads\",\n GITHUB_REPOSITORY_ACCESS = \"github_repository_access\",\n DISCORD_ACCESS = \"discord_access\",\n CUSTOM = \"custom\",\n}\n\nexport type BenefitTypeType = `${EBenefitType}`;\n\nexport enum EGitHubPermission {\n READ = \"read\",\n TRIAGE = \"triage\",\n WRITE = \"write\",\n MAINTAIN = \"maintain\",\n ADMIN = \"admin\",\n}\n\nexport type GitHubPermissionType = `${EGitHubPermission}`;\n\nexport type BenefitBaseType = {\n type: BenefitTypeType;\n name: string;\n description?: string;\n isSelectable?: boolean;\n isDeletable?: boolean;\n organizationId?: string;\n};\n\nexport type CreditsBenefitType = BenefitBaseType & {\n type: typeof EBenefitType.CREDITS;\n amount: number;\n rollover?: boolean;\n};\n\nexport type LicenseKeysBenefitType = BenefitBaseType & {\n type: typeof EBenefitType.LICENSE_KEYS;\n prefix?: string;\n expiresInDays?: number;\n expiresInMonths?: number;\n expiresInYears?: number;\n activationLimit?: number;\n usageLimit?: number;\n};\n\nexport type FileDownloadsBenefitType = BenefitBaseType & {\n type: typeof EBenefitType.FILE_DOWNLOADS;\n files?: BenefitFileType[];\n};\n\nexport type BenefitFileType = {\n id: string;\n name: string;\n size: number;\n mimeType?: string;\n checksum?: string;\n isEnabled?: boolean;\n};\n\nexport type GitHubRepositoryAccessBenefitType = BenefitBaseType & {\n type: typeof EBenefitType.GITHUB_REPOSITORY_ACCESS;\n repositoryOwner: string;\n repositoryName: string;\n permission?: GitHubPermissionType;\n};\n\nexport type DiscordAccessBenefitType = BenefitBaseType & {\n type: typeof EBenefitType.DISCORD_ACCESS;\n guildId: string;\n roleId: string;\n};\n\nexport type CustomBenefitType = BenefitBaseType & {\n type: typeof EBenefitType.CUSTOM;\n note?: string;\n};\n\nexport type BenefitType =\n | CreditsBenefitType\n | LicenseKeysBenefitType\n | FileDownloadsBenefitType\n | GitHubRepositoryAccessBenefitType\n | DiscordAccessBenefitType\n | CustomBenefitType;\n\nexport interface IProduct extends IBase {\n key?: string;\n name: string;\n description?: string;\n categories?: string[];\n currency?: CurrencyCodeType;\n price?: number;\n barcode?: string;\n images?: ProductImageType[];\n attributes?: Record<string, ScalarType>;\n tags?: string[];\n isRecurring?: boolean;\n isArchived?: boolean;\n organizationId?: string;\n recurringInterval?: SubscriptionPeriodType;\n metadata?: Record<string, string | number | boolean>;\n prices?: PriceType[];\n benefits?: BenefitType[];\n attachedCustomFields?: CustomFieldType[];\n}\n\nexport interface IFeature extends IBase {\n name: string;\n description?: string;\n isEnabled?: boolean;\n limit?: number;\n}\n\nexport interface IPlan extends IBase {\n name: string;\n description?: string;\n currency: CurrencyCodeType;\n price: number;\n period: ESubscriptionPeriod;\n periodCount?: number;\n features?: IFeature[];\n isActive?: boolean;\n trialDays?: number;\n}\n\nexport interface ICredit extends IBase {\n balance: number;\n currency?: CurrencyCodeType;\n expiresAt?: Date;\n description?: string;\n}\n\nexport interface ISubscription extends IBase {\n discounts?: IDiscount[];\n plans?: IPlan[];\n credits?: ICredit[];\n startAt: Date;\n endAt?: Date;\n isTrial?: boolean;\n isActive?: boolean;\n}\n\nexport interface IDiscount extends IBase {\n key?: string;\n name: string;\n description?: string;\n code?: string;\n type: DiscountType;\n amount: number;\n currency?: CurrencyCodeType;\n duration: DiscountDurationType;\n durationInMonths?: number;\n startAt?: Date;\n endAt?: Date;\n maxUses?: number;\n usedCount?: number;\n maxRedemptions?: number;\n redemptionsCount?: number;\n isActive?: boolean;\n minimumAmount?: number;\n applicableProducts?: IProduct[];\n applicablePlans?: IPlan[];\n organizationId?: string;\n metadata?: Record<string, string | number | boolean>;\n}\n\nexport enum ECheckoutStatus {\n OPEN = \"open\",\n EXPIRED = \"expired\",\n CONFIRMED = \"confirmed\",\n SUCCEEDED = \"succeeded\",\n FAILED = \"failed\",\n}\n\nexport type CheckoutStatusType = `${ECheckoutStatus}`;\n\nexport type CheckoutCustomerType = {\n id?: string;\n email?: string;\n name?: string;\n externalId?: string;\n billingAddress?: CheckoutAddressType;\n taxId?: string;\n};\n\nexport type CheckoutAddressType = {\n line1?: string;\n line2?: string;\n city?: string;\n state?: string;\n postalCode?: string;\n country?: string;\n};\n\nexport type CheckoutCreateType = {\n products: string[];\n customerExternalId?: string;\n customerId?: string;\n customerEmail?: string;\n customerName?: string;\n customerBillingAddress?: CheckoutAddressType;\n customerTaxId?: string;\n discountId?: string;\n allowDiscountCodes?: boolean;\n successUrl?: string;\n embedOrigin?: string;\n metadata?: Record<string, string | number | boolean>;\n};\n\nexport type CheckoutType = {\n id: string;\n url?: string;\n embedId?: string;\n status: CheckoutStatusType;\n clientSecret: string;\n createdAt?: Date;\n updatedAt?: Date;\n expiresAt?: Date;\n successUrl?: string;\n embedOrigin?: string;\n amount?: number;\n taxAmount?: number;\n currency?: CurrencyCodeType;\n subtotalAmount?: number;\n totalAmount?: number;\n productId?: string;\n productPriceId?: string;\n discountId?: string;\n allowDiscountCodes?: boolean;\n isDiscountApplicable?: boolean;\n isPaymentRequired?: boolean;\n customer?: CheckoutCustomerType;\n metadata?: Record<string, string | number | boolean>;\n};\n\nexport type CustomerSessionCreateType = {\n customerId: string;\n};\n\nexport type CustomerSessionType = {\n id: string;\n token: string;\n customerPortalUrl: string;\n createdAt?: Date;\n expiresAt?: Date;\n customerId?: string;\n};\n\nexport type CustomerAddressType = {\n line1?: string;\n line2?: string;\n city?: string;\n state?: string;\n postalCode?: string;\n country?: string;\n};\n\nexport type CustomerCreateType = {\n email: string;\n name?: string;\n externalId?: string;\n billingAddress?: CustomerAddressType;\n taxId?: string;\n organizationId?: string;\n metadata?: Record<string, string | number | boolean>;\n};\n\nexport type CustomerUpdateType = {\n email?: string;\n name?: string;\n billingAddress?: CustomerAddressType;\n taxId?: string;\n metadata?: Record<string, string | number | boolean>;\n};\n\nexport type CustomerType = {\n id: string;\n email: string;\n emailVerified: boolean;\n name?: string;\n externalId?: string;\n avatarUrl?: string;\n billingAddress?: CustomerAddressType;\n taxId?: string;\n organizationId?: string;\n metadata?: Record<string, string | number | boolean>;\n createdAt?: Date;\n updatedAt?: Date;\n deletedAt?: Date;\n};\n\nexport type CustomerListOptionsType = {\n organizationId?: string;\n email?: string;\n query?: string;\n page?: number;\n limit?: number;\n};\n\nexport type CustomerListResultType = {\n items: CustomerType[];\n pagination: {\n totalCount: number;\n maxPage: number;\n };\n};\n\nexport enum EAnalyticsInterval {\n YEAR = \"year\",\n MONTH = \"month\",\n WEEK = \"week\",\n DAY = \"day\",\n HOUR = \"hour\",\n}\n\nexport type AnalyticsIntervalType = `${EAnalyticsInterval}`;\n\nexport enum EBillingType {\n ONE_TIME = \"one_time\",\n RECURRING = \"recurring\",\n}\n\nexport type BillingTypeType = `${EBillingType}`;\n\nexport type AnalyticsOptionsType = {\n startDate: Date;\n endDate: Date;\n interval: AnalyticsIntervalType;\n organizationId?: string | string[];\n productId?: string | string[];\n billingType?: BillingTypeType | BillingTypeType[];\n customerId?: string | string[];\n};\n\nexport type AnalyticsPeriodType = {\n timestamp: Date;\n orders: number;\n revenue: number;\n cumulativeRevenue: number;\n averageOrderValue: number;\n oneTimeProducts: number;\n oneTimeProductsRevenue: number;\n newSubscriptions: number;\n newSubscriptionsRevenue: number;\n renewedSubscriptions: number;\n renewedSubscriptionsRevenue: number;\n activeSubscriptions: number;\n monthlyRecurringRevenue: number;\n};\n\nexport type AnalyticsMetricInfoType = {\n slug: string;\n displayName: string;\n type: string;\n};\n\nexport type AnalyticsMetricsType = {\n orders: AnalyticsMetricInfoType;\n revenue: AnalyticsMetricInfoType;\n cumulativeRevenue: AnalyticsMetricInfoType;\n averageOrderValue: AnalyticsMetricInfoType;\n oneTimeProducts: AnalyticsMetricInfoType;\n oneTimeProductsRevenue: AnalyticsMetricInfoType;\n newSubscriptions: AnalyticsMetricInfoType;\n newSubscriptionsRevenue: AnalyticsMetricInfoType;\n renewedSubscriptions: AnalyticsMetricInfoType;\n renewedSubscriptionsRevenue: AnalyticsMetricInfoType;\n activeSubscriptions: AnalyticsMetricInfoType;\n monthlyRecurringRevenue: AnalyticsMetricInfoType;\n};\n\nexport type AnalyticsResponseType = {\n periods: AnalyticsPeriodType[];\n metrics: AnalyticsMetricsType;\n};\n\nexport type AnalyticsIntervalLimitType = {\n maxDays: number;\n};\n\nexport type AnalyticsIntervalsLimitsType = {\n hour: AnalyticsIntervalLimitType;\n day: AnalyticsIntervalLimitType;\n week: AnalyticsIntervalLimitType;\n month: AnalyticsIntervalLimitType;\n year: AnalyticsIntervalLimitType;\n};\n\nexport type AnalyticsLimitsType = {\n minDate: Date;\n intervals: AnalyticsIntervalsLimitsType;\n};\n\nexport type CustomerSessionResponseType = {\n id: string;\n token: string;\n customerPortalUrl: string;\n createdAt?: Date;\n expiresAt?: Date;\n customerId?: string;\n};\n\nexport type DiscountResponseType = {\n id: string;\n createdAt?: Date;\n modifiedAt?: Date;\n name: string;\n code?: string;\n type: string;\n basisPoints?: number;\n amount?: number;\n currency?: string;\n duration: string;\n durationInMonths?: number;\n startsAt?: Date;\n endsAt?: Date;\n maxRedemptions?: number;\n redemptionsCount: number;\n organizationId?: string;\n metadata: Record<string, string | number | boolean>;\n products?: { id: string; name: string }[];\n};\n\nexport type CheckoutResponseType = {\n id: string;\n createdAt?: Date;\n modifiedAt?: Date;\n url?: string;\n embedId?: string;\n status: string;\n clientSecret: string;\n expiresAt?: Date;\n successUrl?: string;\n embedOrigin?: string;\n amount?: number;\n taxAmount?: number;\n currency?: string;\n subtotalAmount?: number;\n totalAmount?: number;\n productId?: string;\n productPriceId?: string;\n discountId?: string;\n allowDiscountCodes?: boolean;\n isDiscountApplicable?: boolean;\n isPaymentRequired?: boolean;\n customer?: {\n id?: string;\n email?: string;\n name?: string;\n externalId?: string;\n billingAddress?: {\n line1?: string;\n line2?: string;\n city?: string;\n state?: string;\n postalCode?: string;\n country?: string;\n };\n taxId?: string;\n };\n metadata: Record<string, string | number | boolean>;\n};\n\nexport type CustomerResponseType = {\n id: string;\n createdAt?: Date;\n modifiedAt?: Date;\n deletedAt?: Date;\n email: string;\n emailVerified?: boolean;\n name?: string;\n externalId?: string;\n avatarUrl?: string;\n billingAddress?: {\n line1?: string;\n line2?: string;\n city?: string;\n state?: string;\n postalCode?: string;\n country?: string;\n };\n taxId?: string | [string, string];\n organizationId?: string;\n metadata?: Record<string, string | number | boolean>;\n};\n\nexport type CustomerListResponseType = {\n result: {\n items: CustomerResponseType[];\n pagination: {\n totalCount: number;\n maxPage: number;\n };\n };\n};\n"
13
13
  ],
14
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AACA;AAAA;AAEO,MAAM,yBAAyB,UAAU;AAAA,EAC9C,WAAW,CAAC,SAAiB,KAAa,OAAgC,CAAC,GAAG;AAAA,IAC5E,MAAM,SAAS;AAAA,MACb;AAAA,MACA,QAAQ,WAAW,KAAK;AAAA,MACxB;AAAA,IACF,CAAC;AAAA,IAED,KAAK,OAAO;AAAA;AAEhB;;ACbA;AACA;AACA;AAeO,MAAM,eAAe;AAAA,EAGmB;AAAA,EAFrC;AAAA,EAER,WAAW,CAAkC,KAAa;AAAA,IAAb;AAAA,IAC3C,MAAM,cAAc,KAAK,IAAI;AAAA,IAE7B,IAAI,CAAC,aAAa;AAAA,MAChB,MAAM,IAAI,iBACR,2FACA,gBACF;AAAA,I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6BAAY;AAAA,GAFF;",
15
+ "debugId": "33031D37A547AF8A64756E2164756E21",
16
16
  "names": []
17
17
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@talosjs/payment",
3
3
  "description": "Payment and pricing type definitions with currency handling, product categorization, and billing metadata for e-commerce integrations",
4
- "version": "1.1.0",
4
+ "version": "1.1.2",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -23,19 +23,19 @@
23
23
  "license": "MIT",
24
24
  "scripts": {
25
25
  "build": "bunup",
26
- "lint": "tsgo --noEmit && bunx biome lint",
27
- "npm:publish": "bun publish --tolerate-republish --force --production --access public"
26
+ "fmt": "bunx biome check --write",
27
+ "lint": "tsgo --noEmit && bunx biome lint"
28
28
  },
29
29
  "dependencies": {
30
- "@talosjs/app-env": "^1.1.0",
31
- "@talosjs/container": "^1.1.0",
32
- "@talosjs/exception": "^1.1.0",
33
- "@talosjs/http-status": "^1.1.0",
30
+ "@talosjs/app-env": "^1.1.2",
31
+ "@talosjs/container": "^1.1.1",
32
+ "@talosjs/exception": "^1.1.1",
33
+ "@talosjs/http-status": "^1.1.1",
34
34
  "@polar-sh/sdk": "^0.30.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@talosjs/currencies": "^1.1.0",
38
- "@talosjs/types": "^1.1.0"
37
+ "@talosjs/currencies": "^1.1.1",
38
+ "@talosjs/types": "^1.1.1"
39
39
  },
40
40
  "keywords": [
41
41
  "billing",