@burdenoff/sdk-libs 2026.501.6

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.
Files changed (103) hide show
  1. package/LICENSE +4 -0
  2. package/README.md +52 -0
  3. package/dist/chunk-NEREAHJ6.js +1 -0
  4. package/dist/chunk-YGVAZ3D7.js +2 -0
  5. package/dist/core/index.cjs +2 -0
  6. package/dist/core/index.d.cts +52 -0
  7. package/dist/core/index.d.ts +52 -0
  8. package/dist/core/index.js +1 -0
  9. package/dist/index.cjs +2 -0
  10. package/dist/index.d.cts +3 -0
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.js +1 -0
  13. package/dist/module-JDbvil5h.d.cts +194 -0
  14. package/dist/module-JDbvil5h.d.ts +194 -0
  15. package/dist/modules/auth/index.cjs +71 -0
  16. package/dist/modules/auth/index.d.cts +94 -0
  17. package/dist/modules/auth/index.d.ts +94 -0
  18. package/dist/modules/auth/index.js +71 -0
  19. package/dist/modules/billing/index.cjs +203 -0
  20. package/dist/modules/billing/index.d.cts +377 -0
  21. package/dist/modules/billing/index.d.ts +377 -0
  22. package/dist/modules/billing/index.js +203 -0
  23. package/dist/modules/channels/index.cjs +108 -0
  24. package/dist/modules/channels/index.d.cts +146 -0
  25. package/dist/modules/channels/index.d.ts +146 -0
  26. package/dist/modules/channels/index.js +108 -0
  27. package/dist/modules/conversations/index.cjs +61 -0
  28. package/dist/modules/conversations/index.d.cts +112 -0
  29. package/dist/modules/conversations/index.d.ts +112 -0
  30. package/dist/modules/conversations/index.js +61 -0
  31. package/dist/modules/devportal/index.cjs +216 -0
  32. package/dist/modules/devportal/index.d.cts +303 -0
  33. package/dist/modules/devportal/index.d.ts +303 -0
  34. package/dist/modules/devportal/index.js +216 -0
  35. package/dist/modules/export/index.cjs +61 -0
  36. package/dist/modules/export/index.d.cts +169 -0
  37. package/dist/modules/export/index.d.ts +169 -0
  38. package/dist/modules/export/index.js +61 -0
  39. package/dist/modules/files/index.cjs +51 -0
  40. package/dist/modules/files/index.d.cts +102 -0
  41. package/dist/modules/files/index.d.ts +102 -0
  42. package/dist/modules/files/index.js +51 -0
  43. package/dist/modules/groups/index.cjs +80 -0
  44. package/dist/modules/groups/index.d.cts +168 -0
  45. package/dist/modules/groups/index.d.ts +168 -0
  46. package/dist/modules/groups/index.js +80 -0
  47. package/dist/modules/health/index.cjs +5 -0
  48. package/dist/modules/health/index.d.cts +18 -0
  49. package/dist/modules/health/index.d.ts +18 -0
  50. package/dist/modules/health/index.js +5 -0
  51. package/dist/modules/integrations/index.cjs +65 -0
  52. package/dist/modules/integrations/index.d.cts +120 -0
  53. package/dist/modules/integrations/index.d.ts +120 -0
  54. package/dist/modules/integrations/index.js +65 -0
  55. package/dist/modules/notifications/index.cjs +53 -0
  56. package/dist/modules/notifications/index.d.cts +140 -0
  57. package/dist/modules/notifications/index.d.ts +140 -0
  58. package/dist/modules/notifications/index.js +53 -0
  59. package/dist/modules/organizations/index.cjs +72 -0
  60. package/dist/modules/organizations/index.d.cts +88 -0
  61. package/dist/modules/organizations/index.d.ts +88 -0
  62. package/dist/modules/organizations/index.js +72 -0
  63. package/dist/modules/products/index.cjs +149 -0
  64. package/dist/modules/products/index.d.cts +361 -0
  65. package/dist/modules/products/index.d.ts +361 -0
  66. package/dist/modules/products/index.js +149 -0
  67. package/dist/modules/rbac/index.cjs +55 -0
  68. package/dist/modules/rbac/index.d.cts +100 -0
  69. package/dist/modules/rbac/index.d.ts +100 -0
  70. package/dist/modules/rbac/index.js +55 -0
  71. package/dist/modules/scheduler/index.cjs +61 -0
  72. package/dist/modules/scheduler/index.d.cts +121 -0
  73. package/dist/modules/scheduler/index.d.ts +121 -0
  74. package/dist/modules/scheduler/index.js +61 -0
  75. package/dist/modules/security/index.cjs +61 -0
  76. package/dist/modules/security/index.d.cts +110 -0
  77. package/dist/modules/security/index.d.ts +110 -0
  78. package/dist/modules/security/index.js +61 -0
  79. package/dist/modules/store/index.cjs +82 -0
  80. package/dist/modules/store/index.d.cts +139 -0
  81. package/dist/modules/store/index.d.ts +139 -0
  82. package/dist/modules/store/index.js +82 -0
  83. package/dist/modules/support/index.cjs +56 -0
  84. package/dist/modules/support/index.d.cts +147 -0
  85. package/dist/modules/support/index.d.ts +147 -0
  86. package/dist/modules/support/index.js +56 -0
  87. package/dist/modules/tags/index.cjs +55 -0
  88. package/dist/modules/tags/index.d.cts +131 -0
  89. package/dist/modules/tags/index.d.ts +131 -0
  90. package/dist/modules/tags/index.js +55 -0
  91. package/dist/modules/tours/index.cjs +37 -0
  92. package/dist/modules/tours/index.d.cts +61 -0
  93. package/dist/modules/tours/index.d.ts +61 -0
  94. package/dist/modules/tours/index.js +37 -0
  95. package/dist/modules/vibecontrols/index.cjs +1081 -0
  96. package/dist/modules/vibecontrols/index.d.cts +1483 -0
  97. package/dist/modules/vibecontrols/index.d.ts +1483 -0
  98. package/dist/modules/vibecontrols/index.js +1081 -0
  99. package/dist/modules/workspaces/index.cjs +91 -0
  100. package/dist/modules/workspaces/index.d.cts +128 -0
  101. package/dist/modules/workspaces/index.d.ts +128 -0
  102. package/dist/modules/workspaces/index.js +91 -0
  103. package/package.json +117 -0
@@ -0,0 +1,377 @@
1
+ import { J as Json, S as SdkModule } from '../../module-JDbvil5h.js';
2
+ import 'graphql-request';
3
+
4
+ interface MoneyAmount {
5
+ amount: number;
6
+ currency: string;
7
+ }
8
+ type SubscriptionStatus = 'active' | 'canceled' | 'expired' | 'past_due' | 'trialing' | 'paused' | 'incomplete' | 'incomplete_expired' | 'upgraded' | 'downgraded' | 'completed';
9
+ interface BillingSubscription {
10
+ id: string;
11
+ billingAccountId: string;
12
+ planId: string;
13
+ status: SubscriptionStatus;
14
+ startDate: string;
15
+ endDate: string;
16
+ recurrence: boolean;
17
+ autoRenewal?: boolean | null;
18
+ seatCount?: number | null;
19
+ lastSeatChangeAt?: string | null;
20
+ paymentGateway?: string | null;
21
+ canceledAt?: string | null;
22
+ cancellationReason?: string | null;
23
+ canceledBy?: string | null;
24
+ nextBillingDate?: string | null;
25
+ lastBillingDate?: string | null;
26
+ lastRenewalDate?: string | null;
27
+ context?: Json;
28
+ createdAt: string;
29
+ updatedAt: string;
30
+ }
31
+ interface PaginatedSubscriptions {
32
+ subscriptions: BillingSubscription[];
33
+ totalCount: number;
34
+ hasMore: boolean;
35
+ page: number;
36
+ pageSize: number;
37
+ totalPages: number;
38
+ }
39
+ interface UpdateSubscriptionSeatsInput {
40
+ subscriptionId: string;
41
+ seatCount: number;
42
+ }
43
+ interface Plan {
44
+ id: string;
45
+ name: string;
46
+ description?: string | null;
47
+ price?: number | null;
48
+ currency?: string | null;
49
+ duration?: string | null;
50
+ productId?: string | null;
51
+ isActive?: boolean | null;
52
+ features?: Json;
53
+ metadata?: Json;
54
+ createdAt?: string | null;
55
+ updatedAt?: string | null;
56
+ }
57
+ interface PlansFilter {
58
+ productId?: string;
59
+ isActive?: boolean;
60
+ }
61
+ interface Addon {
62
+ id: string;
63
+ name: string;
64
+ description?: string | null;
65
+ price?: number | null;
66
+ currency?: string | null;
67
+ productId?: string | null;
68
+ isActive?: boolean | null;
69
+ createdAt?: string | null;
70
+ updatedAt?: string | null;
71
+ }
72
+ interface AddonsFilter {
73
+ productId?: string;
74
+ isActive?: boolean;
75
+ }
76
+ interface CreateAddOnsInput {
77
+ name: string;
78
+ description?: string;
79
+ price?: number;
80
+ currency?: string;
81
+ productId?: string;
82
+ }
83
+ interface UpdateAddOnsInput {
84
+ id: string;
85
+ name?: string;
86
+ description?: string;
87
+ price?: number;
88
+ currency?: string;
89
+ }
90
+ type InvoiceStatus = 'draft' | 'open' | 'paid' | 'void' | 'uncollectible';
91
+ interface Invoice {
92
+ id: string;
93
+ invoiceNumber?: string | null;
94
+ billingAccountId?: string | null;
95
+ status: InvoiceStatus;
96
+ amount?: number | null;
97
+ currency?: string | null;
98
+ dueDate?: string | null;
99
+ paidAt?: string | null;
100
+ pdfUrl?: string | null;
101
+ metadata?: Json;
102
+ createdAt?: string | null;
103
+ updatedAt?: string | null;
104
+ }
105
+ interface Coupon {
106
+ id: string;
107
+ code: string;
108
+ description?: string | null;
109
+ discountType?: string | null;
110
+ discountValue?: number | null;
111
+ currency?: string | null;
112
+ expiresAt?: string | null;
113
+ maxRedemptions?: number | null;
114
+ redemptions?: number | null;
115
+ isActive?: boolean | null;
116
+ createdAt?: string | null;
117
+ updatedAt?: string | null;
118
+ }
119
+ interface CouponFilterInput {
120
+ isActive?: boolean;
121
+ productId?: string;
122
+ }
123
+ interface CouponsListResponse {
124
+ coupons: Coupon[];
125
+ totalCount: number;
126
+ }
127
+ interface CreateCouponInput {
128
+ code: string;
129
+ description?: string;
130
+ discountType: string;
131
+ discountValue: number;
132
+ currency?: string;
133
+ expiresAt?: string;
134
+ maxRedemptions?: number;
135
+ }
136
+ interface UpdateCouponInput {
137
+ description?: string;
138
+ discountValue?: number;
139
+ expiresAt?: string;
140
+ maxRedemptions?: number;
141
+ isActive?: boolean;
142
+ }
143
+ interface RefundRecord {
144
+ id: string;
145
+ paymentId?: string | null;
146
+ invoiceId?: string | null;
147
+ amount?: number | null;
148
+ currency?: string | null;
149
+ status?: string | null;
150
+ reason?: string | null;
151
+ createdAt?: string | null;
152
+ updatedAt?: string | null;
153
+ }
154
+ interface PaginatedRefundRecords {
155
+ records: RefundRecord[];
156
+ totalCount: number;
157
+ page: number;
158
+ pageSize: number;
159
+ totalPages: number;
160
+ }
161
+ interface RequestRefundInput {
162
+ paymentId?: string;
163
+ invoiceId?: string;
164
+ amount?: number;
165
+ reason?: string;
166
+ }
167
+ interface CreditTransaction {
168
+ id: string;
169
+ billingAccountId?: string | null;
170
+ amount: number;
171
+ type?: string | null;
172
+ reason?: string | null;
173
+ metadata?: Json;
174
+ createdAt?: string | null;
175
+ }
176
+ interface CreditBalanceByType {
177
+ total: number;
178
+ byType: Array<{
179
+ type: string;
180
+ balance: number;
181
+ }>;
182
+ }
183
+ interface SpendCreditsInput {
184
+ billingAccountId: string;
185
+ amount: number;
186
+ reason?: string;
187
+ metadata?: Json;
188
+ }
189
+ interface SpendCreditResponse {
190
+ success: boolean;
191
+ remainingBalance?: number | null;
192
+ transactionId?: string | null;
193
+ error?: string | null;
194
+ }
195
+ interface RequestCreditWithdrawalInput {
196
+ billingAccountId: string;
197
+ amount: number;
198
+ payoutAccountId?: string;
199
+ }
200
+ interface PayoutRequest {
201
+ id: string;
202
+ billingAccountId?: string | null;
203
+ amount: number;
204
+ status?: string | null;
205
+ createdAt?: string | null;
206
+ }
207
+ interface QuotaAssignment {
208
+ id: string;
209
+ subscriptionId?: string | null;
210
+ type?: string | null;
211
+ limit: number;
212
+ used?: number | null;
213
+ remaining?: number | null;
214
+ metadata?: Json;
215
+ createdAt?: string | null;
216
+ updatedAt?: string | null;
217
+ }
218
+ type AnalyticsPeriod = 'TODAY' | 'LAST_7_DAYS' | 'LAST_30_DAYS' | 'LAST_90_DAYS' | 'YEAR_TO_DATE';
219
+ interface UsageDashboard {
220
+ period: AnalyticsPeriod;
221
+ totalEvents?: number | null;
222
+ byTag?: Json;
223
+ byResource?: Json;
224
+ }
225
+ interface PaymentMethod {
226
+ id: string;
227
+ billingAccountId?: string | null;
228
+ type?: string | null;
229
+ brand?: string | null;
230
+ last4?: string | null;
231
+ expiryMonth?: number | null;
232
+ expiryYear?: number | null;
233
+ isDefault?: boolean | null;
234
+ createdAt?: string | null;
235
+ updatedAt?: string | null;
236
+ }
237
+ interface CreatePaymentMethodInput {
238
+ billingAccountId: string;
239
+ type: string;
240
+ token?: string;
241
+ isDefault?: boolean;
242
+ metadata?: Json;
243
+ }
244
+ interface EarningsSummary {
245
+ billingAccountId: string;
246
+ totalEarned: number;
247
+ totalPaid: number;
248
+ pendingPayout: number;
249
+ currency?: string | null;
250
+ }
251
+ interface PayoutAccount {
252
+ id: string;
253
+ billingAccountId?: string | null;
254
+ type?: string | null;
255
+ isDefault?: boolean | null;
256
+ metadata?: Json;
257
+ createdAt?: string | null;
258
+ }
259
+ interface AddPayoutAccountInput {
260
+ billingAccountId: string;
261
+ type: string;
262
+ metadata?: Json;
263
+ }
264
+ interface RequestPayoutInput {
265
+ billingAccountId: string;
266
+ amount: number;
267
+ payoutAccountId?: string;
268
+ notes?: string;
269
+ }
270
+ interface GetCheckoutUrlOpts {
271
+ billingAccountId?: string;
272
+ returnUrl?: string;
273
+ cancelUrl?: string;
274
+ couponCode?: string;
275
+ seatCount?: number;
276
+ }
277
+
278
+ interface AddonsApi {
279
+ list(filter?: AddonsFilter, opts?: {
280
+ limit?: number;
281
+ }): Promise<Addon[]>;
282
+ get(id: string): Promise<Addon | null>;
283
+ }
284
+
285
+ interface AffiliateApi {
286
+ earnings(billingAccountId: string): Promise<EarningsSummary>;
287
+ payoutAccounts(billingAccountId: string): Promise<PayoutAccount[]>;
288
+ addPayoutAccount(input: AddPayoutAccountInput): Promise<PayoutAccount>;
289
+ requestPayout(input: RequestPayoutInput): Promise<PayoutRequest>;
290
+ }
291
+
292
+ interface CouponsApi {
293
+ list(filter?: CouponFilterInput): Promise<CouponsListResponse>;
294
+ get(code: string): Promise<Coupon | null>;
295
+ create(input: CreateCouponInput): Promise<Coupon>;
296
+ update(id: string, input: UpdateCouponInput): Promise<Coupon>;
297
+ }
298
+
299
+ interface CreditsApi {
300
+ balance(billingAccountId: string): Promise<CreditBalanceByType>;
301
+ spend(input: SpendCreditsInput): Promise<SpendCreditResponse>;
302
+ withdraw(input: RequestCreditWithdrawalInput): Promise<PayoutRequest>;
303
+ }
304
+
305
+ interface PaginatedInvoices {
306
+ invoices: Invoice[];
307
+ totalCount: number;
308
+ hasMore: boolean;
309
+ }
310
+ interface InvoicesApi {
311
+ list(billingAccountId: string, opts?: {
312
+ page?: number;
313
+ pageSize?: number;
314
+ }): Promise<PaginatedInvoices>;
315
+ get(id: string): Promise<Invoice | null>;
316
+ }
317
+
318
+ interface PaymentMethodsApi {
319
+ list(billingAccountId: string): Promise<PaymentMethod[]>;
320
+ add(input: CreatePaymentMethodInput): Promise<PaymentMethod>;
321
+ delete(id: string): Promise<{
322
+ success: boolean;
323
+ }>;
324
+ }
325
+
326
+ interface PlansApi {
327
+ list(filter?: PlansFilter): Promise<Plan[]>;
328
+ get(id: string): Promise<Plan | null>;
329
+ }
330
+
331
+ interface RefundsApi {
332
+ list(opts?: {
333
+ page?: number;
334
+ pageSize?: number;
335
+ }): Promise<PaginatedRefundRecords>;
336
+ request(input: RequestRefundInput): Promise<RefundRecord>;
337
+ }
338
+
339
+ interface SubscriptionsApi {
340
+ list(opts?: {
341
+ billingAccountId?: string;
342
+ page?: number;
343
+ pageSize?: number;
344
+ }): Promise<PaginatedSubscriptions>;
345
+ get(id: string): Promise<BillingSubscription | null>;
346
+ active(billingAccountId: string): Promise<BillingSubscription[]>;
347
+ updateSeats(input: UpdateSubscriptionSeatsInput): Promise<BillingSubscription>;
348
+ cancel(input: {
349
+ subscriptionId: string;
350
+ reason?: string;
351
+ }): Promise<BillingSubscription>;
352
+ }
353
+
354
+ interface UsageApi {
355
+ dashboard(period: AnalyticsPeriod): Promise<UsageDashboard>;
356
+ }
357
+
358
+ interface CheckoutUrl {
359
+ url: string;
360
+ sessionId: string;
361
+ }
362
+ interface BillingApi {
363
+ subscriptions: SubscriptionsApi;
364
+ plans: PlansApi;
365
+ addons: AddonsApi;
366
+ invoices: InvoicesApi;
367
+ coupons: CouponsApi;
368
+ refunds: RefundsApi;
369
+ credits: CreditsApi;
370
+ usage: UsageApi;
371
+ paymentMethods: PaymentMethodsApi;
372
+ affiliate: AffiliateApi;
373
+ getCheckoutUrl(planId: string, opts?: GetCheckoutUrlOpts): Promise<CheckoutUrl>;
374
+ }
375
+ declare const billingModule: SdkModule<BillingApi>;
376
+
377
+ export { type AddPayoutAccountInput, type Addon, type AddonsApi, type AddonsFilter, type AffiliateApi, type AnalyticsPeriod, type BillingApi, type BillingSubscription, type CheckoutUrl, type Coupon, type CouponFilterInput, type CouponsApi, type CouponsListResponse, type CreateAddOnsInput, type CreateCouponInput, type CreatePaymentMethodInput, type CreditBalanceByType, type CreditTransaction, type CreditsApi, type EarningsSummary, type GetCheckoutUrlOpts, type Invoice, type InvoiceStatus, type InvoicesApi, type MoneyAmount, type PaginatedInvoices, type PaginatedRefundRecords, type PaginatedSubscriptions, type PaymentMethod, type PaymentMethodsApi, type PayoutAccount, type PayoutRequest, type Plan, type PlansApi, type PlansFilter, type QuotaAssignment, type RefundRecord, type RefundsApi, type RequestCreditWithdrawalInput, type RequestPayoutInput, type RequestRefundInput, type SpendCreditResponse, type SpendCreditsInput, type SubscriptionStatus, type SubscriptionsApi, type UpdateAddOnsInput, type UpdateCouponInput, type UpdateSubscriptionSeatsInput, type UsageApi, type UsageDashboard, billingModule as default };
@@ -0,0 +1,203 @@
1
+ var s=`
2
+ query GetActiveSubscriptions($billingAccountId: ID!) {
3
+ getActiveSubscriptions(billingAccountId: $billingAccountId) {
4
+ id status seatCount nextBillingDate startDate endDate billingAccountId planId
5
+ }
6
+ }
7
+ `,u=`
8
+ query GetSubscription($id: ID!) {
9
+ getSubscription(id: $id) {
10
+ id status startDate endDate seatCount billingAccountId planId
11
+ autoRenewal canceledAt cancellationReason
12
+ }
13
+ }
14
+ `,d=`
15
+ query GetPaginatedSubscriptions(
16
+ $billingAccountId: ID
17
+ $page: Int
18
+ $pageSize: Int
19
+ ) {
20
+ getPaginatedSubscriptions(
21
+ billingAccountId: $billingAccountId
22
+ page: $page
23
+ pageSize: $pageSize
24
+ ) {
25
+ subscriptions {
26
+ id billingAccountId planId status startDate endDate
27
+ recurrence autoRenewal seatCount lastSeatChangeAt paymentGateway
28
+ canceledAt cancellationReason canceledBy nextBillingDate
29
+ lastBillingDate lastRenewalDate context createdAt updatedAt
30
+ }
31
+ totalCount hasMore page pageSize totalPages
32
+ }
33
+ }
34
+ `,p=`
35
+ mutation UpdateSubscriptionSeats($input: UpdateSubscriptionSeatsInput!) {
36
+ updateSubscriptionSeats(input: $input) {
37
+ id seatCount lastSeatChangeAt
38
+ }
39
+ }
40
+ `,c=`
41
+ mutation CancelSubscription($input: CancelSubscriptionInput!) {
42
+ cancelSubscription(input: $input) {
43
+ id status canceledAt cancellationReason
44
+ }
45
+ }
46
+ `,l=`
47
+ query GetAllPlans($filter: PlanFilterInput) {
48
+ getAllPlans(filter: $filter) {
49
+ id name description price currency duration productId isActive
50
+ features metadata createdAt updatedAt
51
+ }
52
+ }
53
+ `,A=`
54
+ query GetPlan($id: ID!) {
55
+ getPlan(id: $id) {
56
+ id name description price currency duration productId isActive
57
+ features metadata createdAt updatedAt
58
+ }
59
+ }
60
+ `,g=`
61
+ query GetAllAddOns($filter: AddOnFilterInput, $limit: Int) {
62
+ getAllAddOns(filter: $filter, limit: $limit) {
63
+ id name description price currency productId isActive createdAt updatedAt
64
+ }
65
+ }
66
+ `,m=`
67
+ query GetAddOn($id: ID!) {
68
+ getAddOn(id: $id) {
69
+ id name description price currency productId isActive createdAt updatedAt
70
+ }
71
+ }
72
+ `,y=`
73
+ query GetPaginatedInvoices($billingAccountId: ID!, $page: Int, $pageSize: Int) {
74
+ getPaginatedInvoices(billingAccountId: $billingAccountId, page: $page, pageSize: $pageSize) {
75
+ invoices {
76
+ id invoiceNumber billingAccountId status amount currency
77
+ dueDate paidAt pdfUrl metadata createdAt updatedAt
78
+ }
79
+ totalCount hasMore
80
+ }
81
+ }
82
+ `,I=`
83
+ query GetInvoice($id: ID!) {
84
+ getInvoice(id: $id) {
85
+ id invoiceNumber billingAccountId status amount currency
86
+ dueDate paidAt pdfUrl metadata createdAt updatedAt
87
+ }
88
+ }
89
+ `,S=`
90
+ query GetCoupons($filter: CouponFilterInput) {
91
+ getCoupons(filter: $filter) {
92
+ coupons {
93
+ id code description discountType discountValue currency
94
+ expiresAt maxRedemptions redemptions isActive createdAt updatedAt
95
+ }
96
+ totalCount
97
+ }
98
+ }
99
+ `,C=`
100
+ query GetCoupon($code: String!) {
101
+ getCoupon(code: $code) {
102
+ id code description discountType discountValue currency
103
+ expiresAt maxRedemptions redemptions isActive
104
+ }
105
+ }
106
+ `,P=`
107
+ mutation CreateCoupon($input: CreateCouponInput!) {
108
+ createCoupon(input: $input) {
109
+ id code discountType discountValue isActive
110
+ }
111
+ }
112
+ `,f=`
113
+ mutation UpdateCoupon($id: ID!, $input: UpdateCouponInput!) {
114
+ updateCoupon(id: $id, input: $input) {
115
+ id code description discountValue isActive
116
+ }
117
+ }
118
+ `,b=`
119
+ query GetPendingRefunds($page: Int, $pageSize: Int) {
120
+ getPendingRefunds(page: $page, pageSize: $pageSize) {
121
+ records { id paymentId invoiceId amount currency status reason createdAt updatedAt }
122
+ totalCount page pageSize totalPages
123
+ }
124
+ }
125
+ `,R=`
126
+ mutation RequestRefund($input: RequestRefundInput!) {
127
+ requestRefund(input: $input) {
128
+ id paymentId invoiceId amount status reason
129
+ }
130
+ }
131
+ `,T=`
132
+ query GetCreditBalance($billingAccountId: ID!) {
133
+ getCreditBalance(billingAccountId: $billingAccountId) {
134
+ total
135
+ byType { type balance }
136
+ }
137
+ }
138
+ `,E=`
139
+ mutation SpendCredits($input: SpendCreditsInput!) {
140
+ spendCredits(input: $input) {
141
+ success remainingBalance transactionId error
142
+ }
143
+ }
144
+ `,q=`
145
+ mutation RequestCreditWithdrawal($input: RequestCreditWithdrawalInput!) {
146
+ requestCreditWithdrawal(input: $input) {
147
+ id billingAccountId amount status createdAt
148
+ }
149
+ }
150
+ `,x=`
151
+ query GetUsageDashboard($period: AnalyticsPeriod!) {
152
+ getUsageDashboard(period: $period) {
153
+ period totalEvents byTag byResource
154
+ }
155
+ }
156
+ `,D=`
157
+ query GetPaymentMethods($billingAccountId: ID!) {
158
+ getPaymentMethods(billingAccountId: $billingAccountId) {
159
+ id billingAccountId type brand last4 expiryMonth expiryYear
160
+ isDefault createdAt updatedAt
161
+ }
162
+ }
163
+ `,U=`
164
+ mutation AddPaymentMethod($input: AddPaymentMethodInput!) {
165
+ addPaymentMethod(input: $input) {
166
+ id billingAccountId type brand last4 isDefault
167
+ }
168
+ }
169
+ `,_=`
170
+ mutation DeletePaymentMethod($id: ID!) {
171
+ deletePaymentMethod(id: $id) { success }
172
+ }
173
+ `,$=`
174
+ query GetEarningsSummary($billingAccountId: ID!) {
175
+ getEarningsSummary(billingAccountId: $billingAccountId) {
176
+ billingAccountId totalEarned totalPaid pendingPayout currency
177
+ }
178
+ }
179
+ `,h=`
180
+ query GetPayoutAccounts($billingAccountId: ID!) {
181
+ getPayoutAccounts(billingAccountId: $billingAccountId) {
182
+ id billingAccountId type isDefault metadata createdAt
183
+ }
184
+ }
185
+ `,O=`
186
+ mutation AddPayoutAccount($input: AddPayoutAccountInput!) {
187
+ addPayoutAccount(input: $input) {
188
+ id billingAccountId type isDefault
189
+ }
190
+ }
191
+ `,N=`
192
+ mutation RequestPayout($input: RequestPayoutInput!) {
193
+ requestPayout(input: $input) {
194
+ id billingAccountId amount status createdAt
195
+ }
196
+ }
197
+ `,M=`
198
+ mutation CreateCheckoutSession($planId: ID!, $opts: CheckoutSessionInput) {
199
+ createCheckoutSession(planId: $planId, opts: $opts) {
200
+ url sessionId
201
+ }
202
+ }
203
+ `;function v(i){let{global:e}=i.gql;return {async list(t,n){return (await e.request(g,{filter:t,limit:n?.limit})).getAllAddOns},async get(t){return (await e.request(m,{id:t})).getAddOn}}}function B(i){let{global:e}=i.gql;return {async earnings(t){return (await e.request($,{billingAccountId:t})).getEarningsSummary},async payoutAccounts(t){return (await e.request(h,{billingAccountId:t})).getPayoutAccounts},async addPayoutAccount(t){return (await e.request(O,{input:t})).addPayoutAccount},async requestPayout(t){return (await e.request(N,{input:t})).requestPayout}}}function G(i){let{global:e}=i.gql;return {async list(t){return (await e.request(S,{filter:t})).getCoupons},async get(t){return (await e.request(C,{code:t})).getCoupon},async create(t){return (await e.request(P,{input:t})).createCoupon},async update(t,n){return (await e.request(f,{id:t,input:n})).updateCoupon}}}function w(i){let{global:e}=i.gql;return {async balance(t){return (await e.request(T,{billingAccountId:t})).getCreditBalance},async spend(t){return (await e.request(E,{input:t})).spendCredits},async withdraw(t){return (await e.request(q,{input:t})).requestCreditWithdrawal}}}function k(i){let{global:e}=i.gql;return {async list(t,n){return (await e.request(y,{billingAccountId:t,page:n?.page,pageSize:n?.pageSize})).getPaginatedInvoices},async get(t){return (await e.request(I,{id:t})).getInvoice}}}function L(i){let{global:e}=i.gql;return {async list(t){return (await e.request(D,{billingAccountId:t})).getPaymentMethods},async add(t){return (await e.request(U,{input:t})).addPaymentMethod},async delete(t){return (await e.request(_,{id:t})).deletePaymentMethod}}}function j(i){let{global:e}=i.gql;return {async list(t){return (await e.request(l,{filter:t})).getAllPlans},async get(t){return (await e.request(A,{id:t})).getPlan}}}function z(i){let{global:e}=i.gql;return {async list(t){return (await e.request(b,{page:t?.page,pageSize:t?.pageSize})).getPendingRefunds},async request(t){return (await e.request(R,{input:t})).requestRefund}}}function F(i){let{global:e}=i.gql;return {async list(t){return (await e.request(d,{billingAccountId:t?.billingAccountId,page:t?.page,pageSize:t?.pageSize})).getPaginatedSubscriptions},async get(t){return (await e.request(u,{id:t})).getSubscription},async active(t){return (await e.request(s,{billingAccountId:t})).getActiveSubscriptions},async updateSeats(t){return (await e.request(p,{input:t})).updateSubscriptionSeats},async cancel(t){return (await e.request(c,{input:t})).cancelSubscription}}}function Y(i){let{global:e}=i.gql;return {async dashboard(t){return (await e.request(x,{period:t})).getUsageDashboard}}}var H={id:"billing",version:"1.0.0",displayName:"Billing",dependsOn:["auth"],attach(i){let{global:e}=i.gql;return {subscriptions:F(i),plans:j(i),addons:v(i),invoices:k(i),coupons:G(i),refunds:z(i),credits:w(i),usage:Y(i),paymentMethods:L(i),affiliate:B(i),async getCheckoutUrl(t,n){return (await e.request(M,{planId:t,opts:n})).createCheckoutSession}}}},vt=H;export{vt as default};
@@ -0,0 +1,108 @@
1
+ 'use strict';var i=`
2
+ fragment ChannelFields on Channel {
3
+ id name description platform type status organizationId configuration
4
+ createdAt updatedAt
5
+ }
6
+ `,E=`
7
+ fragment ChannelConnectionFields on ChannelConnection {
8
+ id channelId status externalAccountId externalAccountName createdAt updatedAt
9
+ }
10
+ `,I=`
11
+ fragment UserPlatformConnectionFields on UserPlatformConnection {
12
+ id channelId externalUserId internalUserId notificationsEnabled createdAt updatedAt
13
+ }
14
+ `,y=`
15
+ fragment MessageDeliveryAttemptFields on MessageDeliveryAttempt {
16
+ id channelId status attemptNumber externalMessageId errorMessage
17
+ createdAt updatedAt
18
+ }
19
+ `,A=`
20
+ fragment WebhookEventFields on WebhookEvent {
21
+ id channelId eventType payload processed createdAt
22
+ }
23
+ `,s=`
24
+ ${i}
25
+ query GetChannels($filter: ChannelFilterInput, $pagination: ChannelPaginationInput) {
26
+ getChannels(filter: $filter, pagination: $pagination) {
27
+ items { ...ChannelFields }
28
+ total
29
+ hasMore
30
+ }
31
+ }
32
+ `,o=`
33
+ ${i}
34
+ query GetChannel($id: ID!) {
35
+ getChannel(id: $id) { ...ChannelFields }
36
+ }
37
+ `,r=`
38
+ ${i}
39
+ mutation CreateChannel($input: CreateChannelInput!) {
40
+ createChannel(input: $input) { ...ChannelFields }
41
+ }
42
+ `,l=`
43
+ ${i}
44
+ mutation UpdateChannel($id: ID!, $input: UpdateChannelInput!) {
45
+ updateChannel(id: $id, input: $input) { ...ChannelFields }
46
+ }
47
+ `,u="mutation DeleteChannel($id: ID!) { deleteChannel(id: $id) }",C=`
48
+ mutation SendMessage($input: SendMessageInput!) {
49
+ sendMessage(input: $input) {
50
+ success
51
+ attemptId
52
+ externalMessageId
53
+ error
54
+ }
55
+ }
56
+ `,c=`
57
+ ${y}
58
+ query GetChannelDeliveryAttempts($channelId: ID!, $cursor: String, $limit: Int) {
59
+ getChannelDeliveryAttempts(channelId: $channelId, cursor: $cursor, limit: $limit) {
60
+ items { ...MessageDeliveryAttemptFields }
61
+ hasMore
62
+ cursor
63
+ }
64
+ }
65
+ `,d=`
66
+ ${I}
67
+ query ListUserPlatformConnectionsByChannel(
68
+ $channelId: ID!
69
+ $cursor: String
70
+ $pagination: ChannelPaginationInput
71
+ ) {
72
+ listUserPlatformConnectionsByChannel(
73
+ channelId: $channelId
74
+ cursor: $cursor
75
+ pagination: $pagination
76
+ ) {
77
+ items { ...UserPlatformConnectionFields }
78
+ hasMore
79
+ cursor
80
+ }
81
+ }
82
+ `,h=`
83
+ ${A}
84
+ query GetChannelWebhookEvents($channelId: ID!, $cursor: String, $limit: Int) {
85
+ getChannelWebhookEvents(channelId: $channelId, cursor: $cursor, limit: $limit) {
86
+ items { ...WebhookEventFields }
87
+ hasMore
88
+ cursor
89
+ }
90
+ }
91
+ `,p=`
92
+ ${E}
93
+ query GetConnectionsByOrganization(
94
+ $organizationId: ID!
95
+ $cursor: String
96
+ $pagination: ChannelPaginationInput
97
+ ) {
98
+ getConnectionsByOrganization(
99
+ organizationId: $organizationId
100
+ cursor: $cursor
101
+ pagination: $pagination
102
+ ) {
103
+ items { ...ChannelConnectionFields }
104
+ hasMore
105
+ cursor
106
+ }
107
+ }
108
+ `;var $={id:"channels",version:"1.0.0",displayName:"Channels",dependsOn:["auth"],attach(g){let{global:t}=g.gql;return {async list(n,e){return (await t.request(s,{filter:n,pagination:e})).getChannels},async get(n){return (await t.request(o,{id:n})).getChannel},async create(n){return (await t.request(r,{input:n})).createChannel},async update(n,e){return (await t.request(l,{id:n,input:e})).updateChannel},async delete(n){return (await t.request(u,{id:n})).deleteChannel},async send(n){return (await t.request(C,{input:n})).sendMessage},async deliveries(n,e){return (await t.request(c,{channelId:n,cursor:e?.cursor??null,limit:e?.limit??null})).getChannelDeliveryAttempts},async users(n,e){return (await t.request(d,{channelId:n,cursor:e?.cursor??null,pagination:e?.pagination??null})).listUserPlatformConnectionsByChannel},async webhooks(n,e){return (await t.request(h,{channelId:n,cursor:e?.cursor??null,limit:e?.limit??null})).getChannelWebhookEvents},async connections(n,e){return (await t.request(p,{organizationId:n,cursor:e?.cursor??null,pagination:e?.pagination??null})).getConnectionsByOrganization}}}},S=$;module.exports=S;