@burdenoff/sdk-libs 2026.521.1 → 2026.523.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,28 @@
1
- 'use strict';var r=`
1
+ 'use strict';var s=`
2
2
  query GetActiveSubscriptions($billingAccountId: ID!) {
3
3
  getActiveSubscriptions(billingAccountId: $billingAccountId) {
4
4
  id status seatCount nextBillingDate startDate endDate billingAccountId planId
5
5
  }
6
6
  }
7
- `,s=`
8
- query GetSubscription($id: ID!) {
9
- getSubscription(id: $id) {
7
+ `,r=`
8
+ query GetSubscription($id: ID!, $billingAccountId: ID!) {
9
+ getSubscription(id: $id, billingAccountId: $billingAccountId) {
10
10
  id status startDate endDate seatCount billingAccountId planId
11
11
  autoRenewal canceledAt cancellationReason
12
12
  }
13
13
  }
14
14
  `,u=`
15
15
  query GetPaginatedSubscriptions(
16
- $billingAccountId: ID
16
+ $billingAccountId: ID!
17
17
  $page: Int
18
18
  $pageSize: Int
19
+ $search: String
19
20
  ) {
20
21
  getPaginatedSubscriptions(
21
22
  billingAccountId: $billingAccountId
22
23
  page: $page
23
24
  pageSize: $pageSize
25
+ search: $search
24
26
  ) {
25
27
  subscriptions {
26
28
  id billingAccountId planId status startDate endDate
@@ -37,14 +39,14 @@
37
39
  id seatCount lastSeatChangeAt
38
40
  }
39
41
  }
40
- `,p=`
42
+ `,c=`
41
43
  mutation CancelSubscription($input: CancelSubscriptionInput!) {
42
44
  cancelSubscription(input: $input) {
43
45
  id status canceledAt cancellationReason
44
46
  }
45
47
  }
46
- `,c=`
47
- query GetAllPlans($filter: PlanFilterInput) {
48
+ `,p=`
49
+ query GetAllPlans($filter: PlansFilter) {
48
50
  getAllPlans(filter: $filter) {
49
51
  id name description price currency duration productId isActive
50
52
  features metadata createdAt updatedAt
@@ -58,7 +60,7 @@
58
60
  }
59
61
  }
60
62
  `,A=`
61
- query GetAllAddOns($filter: AddOnFilterInput, $limit: Int) {
63
+ query GetAllAddOns($filter: AddonsFilter, $limit: Int) {
62
64
  getAllAddOns(filter: $filter, limit: $limit) {
63
65
  id name description price currency productId isActive createdAt updatedAt
64
66
  }
@@ -69,9 +71,21 @@
69
71
  id name description price currency productId isActive createdAt updatedAt
70
72
  }
71
73
  }
72
- `,m=`
73
- query GetPaginatedInvoices($billingAccountId: ID!, $page: Int, $pageSize: Int) {
74
- getPaginatedInvoices(billingAccountId: $billingAccountId, page: $page, pageSize: $pageSize) {
74
+ `,I=`
75
+ query GetPaginatedInvoices(
76
+ $billingAccountId: ID
77
+ $page: Int
78
+ $pageSize: Int
79
+ $search: String
80
+ $status: InvoiceStatus
81
+ ) {
82
+ getPaginatedInvoices(
83
+ billingAccountId: $billingAccountId
84
+ page: $page
85
+ pageSize: $pageSize
86
+ search: $search
87
+ status: $status
88
+ ) {
75
89
  invoices {
76
90
  id invoiceNumber billingAccountId status amount currency
77
91
  dueDate paidAt pdfUrl metadata createdAt updatedAt
@@ -79,14 +93,14 @@
79
93
  totalCount hasMore
80
94
  }
81
95
  }
82
- `,y=`
83
- query GetInvoice($id: ID!) {
84
- getInvoice(id: $id) {
96
+ `,m=`
97
+ query GetInvoice($id: ID!, $billingAccountId: ID!) {
98
+ getInvoice(id: $id, billingAccountId: $billingAccountId) {
85
99
  id invoiceNumber billingAccountId status amount currency
86
100
  dueDate paidAt pdfUrl metadata createdAt updatedAt
87
101
  }
88
102
  }
89
- `,I=`
103
+ `,y=`
90
104
  query GetCoupons($filter: CouponFilterInput) {
91
105
  getCoupons(filter: $filter) {
92
106
  coupons {
@@ -97,8 +111,8 @@
97
111
  }
98
112
  }
99
113
  `,S=`
100
- query GetCoupon($code: String!) {
101
- getCoupon(code: $code) {
114
+ query GetCoupon($id: ID!) {
115
+ getCoupon(id: $id) {
102
116
  id code description discountType discountValue currency
103
117
  expiresAt maxRedemptions redemptions isActive
104
118
  }
@@ -115,14 +129,14 @@
115
129
  id code description discountValue isActive
116
130
  }
117
131
  }
118
- `,f=`
132
+ `,b=`
119
133
  query GetPendingRefunds($page: Int, $pageSize: Int) {
120
134
  getPendingRefunds(page: $page, pageSize: $pageSize) {
121
135
  records { id paymentId invoiceId amount currency status reason createdAt updatedAt }
122
136
  totalCount page pageSize totalPages
123
137
  }
124
138
  }
125
- `,b=`
139
+ `,f=`
126
140
  mutation RequestRefund($input: RequestRefundInput!) {
127
141
  requestRefund(input: $input) {
128
142
  id paymentId invoiceId amount status reason
@@ -130,7 +144,7 @@
130
144
  }
131
145
  `,R=`
132
146
  query GetCreditBalance($billingAccountId: ID!) {
133
- getCreditBalance(billingAccountId: $billingAccountId) {
147
+ getCreditBalanceByType(billingAccountId: $billingAccountId) {
134
148
  total
135
149
  byType { type balance }
136
150
  }
@@ -148,35 +162,35 @@
148
162
  }
149
163
  }
150
164
  `,q=`
151
- query GetUsageDashboard($period: AnalyticsPeriod!) {
152
- getUsageDashboard(period: $period) {
165
+ query GetUsageDashboard($billingAccountId: ID!, $period: AnalyticsPeriod!) {
166
+ getUsageDashboard(billingAccountId: $billingAccountId, period: $period) {
153
167
  period totalEvents byTag byResource
154
168
  }
155
169
  }
156
- `,x=`
170
+ `,D=`
157
171
  query GetPaymentMethods($billingAccountId: ID!) {
158
172
  getPaymentMethods(billingAccountId: $billingAccountId) {
159
173
  id billingAccountId type brand last4 expiryMonth expiryYear
160
174
  isDefault createdAt updatedAt
161
175
  }
162
176
  }
163
- `,D=`
164
- mutation AddPaymentMethod($input: AddPaymentMethodInput!) {
177
+ `,x=`
178
+ mutation AddPaymentMethod($input: CreatePaymentMethodInput!) {
165
179
  addPaymentMethod(input: $input) {
166
180
  id billingAccountId type brand last4 isDefault
167
181
  }
168
182
  }
169
- `,U=`
170
- mutation DeletePaymentMethod($id: ID!) {
171
- deletePaymentMethod(id: $id) { success }
183
+ `,$=`
184
+ mutation DeletePaymentMethod($id: ID!, $billingAccountId: ID!) {
185
+ deletePaymentMethod(id: $id, billingAccountId: $billingAccountId)
172
186
  }
173
- `,_=`
187
+ `,U=`
174
188
  query GetEarningsSummary($billingAccountId: ID!) {
175
189
  getEarningsSummary(billingAccountId: $billingAccountId) {
176
190
  billingAccountId totalEarned totalPaid pendingPayout currency
177
191
  }
178
192
  }
179
- `,$=`
193
+ `,_=`
180
194
  query GetPayoutAccounts($billingAccountId: ID!) {
181
195
  getPayoutAccounts(billingAccountId: $billingAccountId) {
182
196
  id billingAccountId type isDefault metadata createdAt
@@ -200,4 +214,4 @@
200
214
  url sessionId
201
215
  }
202
216
  }
203
- `;function M(i){let{global:e}=i.gql;return {async list(t,n){return (await e.request(A,{filter:t,limit:n?.limit})).getAllAddOns},async get(t){return (await e.request(g,{id:t})).getAddOn}}}function v(i){let{global:e}=i.gql;return {async earnings(t){return (await e.request(_,{billingAccountId:t})).getEarningsSummary},async payoutAccounts(t){return (await e.request($,{billingAccountId:t})).getPayoutAccounts},async addPayoutAccount(t){return (await e.request(h,{input:t})).addPayoutAccount},async requestPayout(t){return (await e.request(O,{input:t})).requestPayout}}}function B(i){let{global:e}=i.gql;return {async list(t){return (await e.request(I,{filter:t})).getCoupons},async get(t){return (await e.request(S,{code:t})).getCoupon},async create(t){return (await e.request(C,{input:t})).createCoupon},async update(t,n){return (await e.request(P,{id:t,input:n})).updateCoupon}}}function G(i){let{global:e}=i.gql;return {async balance(t){return (await e.request(R,{billingAccountId:t})).getCreditBalance},async spend(t){return (await e.request(T,{input:t})).spendCredits},async withdraw(t){return (await e.request(E,{input:t})).requestCreditWithdrawal}}}function w(i){let{global:e}=i.gql;return {async list(t,n){return (await e.request(m,{billingAccountId:t,page:n?.page,pageSize:n?.pageSize})).getPaginatedInvoices},async get(t){return (await e.request(y,{id:t})).getInvoice}}}function k(i){let{global:e}=i.gql;return {async list(t){return (await e.request(x,{billingAccountId:t})).getPaymentMethods},async add(t){return (await e.request(D,{input:t})).addPaymentMethod},async delete(t){return (await e.request(U,{id:t})).deletePaymentMethod}}}function L(i){let{global:e}=i.gql;return {async list(t){return (await e.request(c,{filter:t})).getAllPlans},async get(t){return (await e.request(l,{id:t})).getPlan}}}function j(i){let{global:e}=i.gql;return {async list(t){return (await e.request(f,{page:t?.page,pageSize:t?.pageSize})).getPendingRefunds},async request(t){return (await e.request(b,{input:t})).requestRefund}}}function z(i){let{global:e}=i.gql;return {async list(t){return (await e.request(u,{billingAccountId:t?.billingAccountId,page:t?.page,pageSize:t?.pageSize})).getPaginatedSubscriptions},async get(t){return (await e.request(s,{id:t})).getSubscription},async active(t){return (await e.request(r,{billingAccountId:t})).getActiveSubscriptions},async updateSeats(t){return (await e.request(d,{input:t})).updateSubscriptionSeats},async cancel(t){return (await e.request(p,{input:t})).cancelSubscription}}}function F(i){let{global:e}=i.gql;return {async dashboard(t){return (await e.request(q,{period:t})).getUsageDashboard}}}var Y={id:"billing",version:"1.0.0",displayName:"Billing",dependsOn:["auth"],attach(i){let{global:e}=i.gql;return {subscriptions:z(i),plans:L(i),addons:M(i),invoices:w(i),coupons:B(i),refunds:j(i),credits:G(i),usage:F(i),paymentMethods:k(i),affiliate:v(i),async getCheckoutUrl(t,n){return (await e.request(N,{planId:t,opts:n})).createCheckoutSession}}}},Mt=Y;module.exports=Mt;
217
+ `;function v(i){let{global:e}=i.gql;return {async list(t,n){return (await e.request(A,{filter:t,limit:n?.limit})).getAllAddOns},async get(t){return (await e.request(g,{id:t})).getAddOn}}}function M(i){let{global:e}=i.gql;return {async earnings(t){return (await e.request(U,{billingAccountId:t})).getEarningsSummary},async payoutAccounts(t){return (await e.request(_,{billingAccountId:t})).getPayoutAccounts},async addPayoutAccount(t){return (await e.request(h,{input:t})).addPayoutAccount},async requestPayout(t){return (await e.request(O,{input:t})).requestPayout}}}function B(i){let{global:e}=i.gql;return {async list(t){return (await e.request(y,{filter:t})).getCoupons},async get(t){return (await e.request(S,{id:t})).getCoupon},async create(t){return (await e.request(C,{input:t})).createCoupon},async update(t,n){return (await e.request(P,{id:t,input:n})).updateCoupon}}}function G(i){let{global:e}=i.gql;return {async balance(t){return (await e.request(R,{billingAccountId:t})).getCreditBalanceByType},async spend(t){return (await e.request(T,{input:t})).spendCredits},async withdraw(t){return (await e.request(E,{input:t})).requestCreditWithdrawal}}}function w(i){let{global:e}=i.gql;return {async list(t){return (await e.request(I,{billingAccountId:t?.billingAccountId,page:t?.page,pageSize:t?.pageSize,search:t?.search,status:t?.status})).getPaginatedInvoices},async get(t,n){return (await e.request(m,{id:t,billingAccountId:n})).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(x,{input:t})).addPaymentMethod},async delete(t,n){return {success:(await e.request($,{id:t,billingAccountId:n})).deletePaymentMethod}}}}function k(i){let{global:e}=i.gql;return {async list(t){return (await e.request(p,{filter:t})).getAllPlans},async get(t){return (await e.request(l,{id:t})).getPlan}}}function j(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(f,{input:t})).requestRefund}}}function z(i){let{global:e}=i.gql;return {async list(t,n){return (await e.request(u,{billingAccountId:t,page:n?.page,pageSize:n?.pageSize,search:n?.search})).getPaginatedSubscriptions},async get(t,n){return (await e.request(r,{id:t,billingAccountId:n})).getSubscription},async active(t){return (await e.request(s,{billingAccountId:t})).getActiveSubscriptions},async updateSeats(t){return (await e.request(d,{input:t})).updateSubscriptionSeats},async cancel(t){return (await e.request(c,{input:t})).cancelSubscription}}}function F(i){let{global:e}=i.gql;return {async dashboard(t,n){return (await e.request(q,{billingAccountId:t,period:n})).getUsageDashboard}}}var Y={id:"billing",version:"1.0.0",displayName:"Billing",dependsOn:["auth"],attach(i){let{global:e}=i.gql;return {subscriptions:z(i),plans:k(i),addons:v(i),invoices:w(i),coupons:B(i),refunds:j(i),credits:G(i),usage:F(i),paymentMethods:L(i),affiliate:M(i),async getCheckoutUrl(t,n){return (await e.request(N,{planId:t,opts:n})).createCheckoutSession}}}},vt=Y;module.exports=vt;
@@ -291,7 +291,7 @@ interface AffiliateApi {
291
291
 
292
292
  interface CouponsApi {
293
293
  list(filter?: CouponFilterInput): Promise<CouponsListResponse>;
294
- get(code: string): Promise<Coupon | null>;
294
+ get(id: string): Promise<Coupon | null>;
295
295
  create(input: CreateCouponInput): Promise<Coupon>;
296
296
  update(id: string, input: UpdateCouponInput): Promise<Coupon>;
297
297
  }
@@ -307,18 +307,22 @@ interface PaginatedInvoices {
307
307
  totalCount: number;
308
308
  hasMore: boolean;
309
309
  }
310
+ interface InvoicesListOptions {
311
+ billingAccountId?: string;
312
+ page?: number;
313
+ pageSize?: number;
314
+ search?: string;
315
+ status?: InvoiceStatus;
316
+ }
310
317
  interface InvoicesApi {
311
- list(billingAccountId: string, opts?: {
312
- page?: number;
313
- pageSize?: number;
314
- }): Promise<PaginatedInvoices>;
315
- get(id: string): Promise<Invoice | null>;
318
+ list(opts?: InvoicesListOptions): Promise<PaginatedInvoices>;
319
+ get(id: string, billingAccountId: string): Promise<Invoice | null>;
316
320
  }
317
321
 
318
322
  interface PaymentMethodsApi {
319
323
  list(billingAccountId: string): Promise<PaymentMethod[]>;
320
324
  add(input: CreatePaymentMethodInput): Promise<PaymentMethod>;
321
- delete(id: string): Promise<{
325
+ delete(id: string, billingAccountId: string): Promise<{
322
326
  success: boolean;
323
327
  }>;
324
328
  }
@@ -336,13 +340,14 @@ interface RefundsApi {
336
340
  request(input: RequestRefundInput): Promise<RefundRecord>;
337
341
  }
338
342
 
343
+ interface SubscriptionsListOptions {
344
+ page?: number;
345
+ pageSize?: number;
346
+ search?: string;
347
+ }
339
348
  interface SubscriptionsApi {
340
- list(opts?: {
341
- billingAccountId?: string;
342
- page?: number;
343
- pageSize?: number;
344
- }): Promise<PaginatedSubscriptions>;
345
- get(id: string): Promise<BillingSubscription | null>;
349
+ list(billingAccountId: string, opts?: SubscriptionsListOptions): Promise<PaginatedSubscriptions>;
350
+ get(id: string, billingAccountId: string): Promise<BillingSubscription | null>;
346
351
  active(billingAccountId: string): Promise<BillingSubscription[]>;
347
352
  updateSeats(input: UpdateSubscriptionSeatsInput): Promise<BillingSubscription>;
348
353
  cancel(input: {
@@ -352,7 +357,7 @@ interface SubscriptionsApi {
352
357
  }
353
358
 
354
359
  interface UsageApi {
355
- dashboard(period: AnalyticsPeriod): Promise<UsageDashboard>;
360
+ dashboard(billingAccountId: string, period: AnalyticsPeriod): Promise<UsageDashboard>;
356
361
  }
357
362
 
358
363
  interface CheckoutUrl {
@@ -291,7 +291,7 @@ interface AffiliateApi {
291
291
 
292
292
  interface CouponsApi {
293
293
  list(filter?: CouponFilterInput): Promise<CouponsListResponse>;
294
- get(code: string): Promise<Coupon | null>;
294
+ get(id: string): Promise<Coupon | null>;
295
295
  create(input: CreateCouponInput): Promise<Coupon>;
296
296
  update(id: string, input: UpdateCouponInput): Promise<Coupon>;
297
297
  }
@@ -307,18 +307,22 @@ interface PaginatedInvoices {
307
307
  totalCount: number;
308
308
  hasMore: boolean;
309
309
  }
310
+ interface InvoicesListOptions {
311
+ billingAccountId?: string;
312
+ page?: number;
313
+ pageSize?: number;
314
+ search?: string;
315
+ status?: InvoiceStatus;
316
+ }
310
317
  interface InvoicesApi {
311
- list(billingAccountId: string, opts?: {
312
- page?: number;
313
- pageSize?: number;
314
- }): Promise<PaginatedInvoices>;
315
- get(id: string): Promise<Invoice | null>;
318
+ list(opts?: InvoicesListOptions): Promise<PaginatedInvoices>;
319
+ get(id: string, billingAccountId: string): Promise<Invoice | null>;
316
320
  }
317
321
 
318
322
  interface PaymentMethodsApi {
319
323
  list(billingAccountId: string): Promise<PaymentMethod[]>;
320
324
  add(input: CreatePaymentMethodInput): Promise<PaymentMethod>;
321
- delete(id: string): Promise<{
325
+ delete(id: string, billingAccountId: string): Promise<{
322
326
  success: boolean;
323
327
  }>;
324
328
  }
@@ -336,13 +340,14 @@ interface RefundsApi {
336
340
  request(input: RequestRefundInput): Promise<RefundRecord>;
337
341
  }
338
342
 
343
+ interface SubscriptionsListOptions {
344
+ page?: number;
345
+ pageSize?: number;
346
+ search?: string;
347
+ }
339
348
  interface SubscriptionsApi {
340
- list(opts?: {
341
- billingAccountId?: string;
342
- page?: number;
343
- pageSize?: number;
344
- }): Promise<PaginatedSubscriptions>;
345
- get(id: string): Promise<BillingSubscription | null>;
349
+ list(billingAccountId: string, opts?: SubscriptionsListOptions): Promise<PaginatedSubscriptions>;
350
+ get(id: string, billingAccountId: string): Promise<BillingSubscription | null>;
346
351
  active(billingAccountId: string): Promise<BillingSubscription[]>;
347
352
  updateSeats(input: UpdateSubscriptionSeatsInput): Promise<BillingSubscription>;
348
353
  cancel(input: {
@@ -352,7 +357,7 @@ interface SubscriptionsApi {
352
357
  }
353
358
 
354
359
  interface UsageApi {
355
- dashboard(period: AnalyticsPeriod): Promise<UsageDashboard>;
360
+ dashboard(billingAccountId: string, period: AnalyticsPeriod): Promise<UsageDashboard>;
356
361
  }
357
362
 
358
363
  interface CheckoutUrl {
@@ -1,26 +1,28 @@
1
- var s=`
1
+ var r=`
2
2
  query GetActiveSubscriptions($billingAccountId: ID!) {
3
3
  getActiveSubscriptions(billingAccountId: $billingAccountId) {
4
4
  id status seatCount nextBillingDate startDate endDate billingAccountId planId
5
5
  }
6
6
  }
7
7
  `,u=`
8
- query GetSubscription($id: ID!) {
9
- getSubscription(id: $id) {
8
+ query GetSubscription($id: ID!, $billingAccountId: ID!) {
9
+ getSubscription(id: $id, billingAccountId: $billingAccountId) {
10
10
  id status startDate endDate seatCount billingAccountId planId
11
11
  autoRenewal canceledAt cancellationReason
12
12
  }
13
13
  }
14
14
  `,d=`
15
15
  query GetPaginatedSubscriptions(
16
- $billingAccountId: ID
16
+ $billingAccountId: ID!
17
17
  $page: Int
18
18
  $pageSize: Int
19
+ $search: String
19
20
  ) {
20
21
  getPaginatedSubscriptions(
21
22
  billingAccountId: $billingAccountId
22
23
  page: $page
23
24
  pageSize: $pageSize
25
+ search: $search
24
26
  ) {
25
27
  subscriptions {
26
28
  id billingAccountId planId status startDate endDate
@@ -31,20 +33,20 @@ var s=`
31
33
  totalCount hasMore page pageSize totalPages
32
34
  }
33
35
  }
34
- `,p=`
36
+ `,c=`
35
37
  mutation UpdateSubscriptionSeats($input: UpdateSubscriptionSeatsInput!) {
36
38
  updateSubscriptionSeats(input: $input) {
37
39
  id seatCount lastSeatChangeAt
38
40
  }
39
41
  }
40
- `,c=`
42
+ `,p=`
41
43
  mutation CancelSubscription($input: CancelSubscriptionInput!) {
42
44
  cancelSubscription(input: $input) {
43
45
  id status canceledAt cancellationReason
44
46
  }
45
47
  }
46
48
  `,l=`
47
- query GetAllPlans($filter: PlanFilterInput) {
49
+ query GetAllPlans($filter: PlansFilter) {
48
50
  getAllPlans(filter: $filter) {
49
51
  id name description price currency duration productId isActive
50
52
  features metadata createdAt updatedAt
@@ -58,20 +60,32 @@ var s=`
58
60
  }
59
61
  }
60
62
  `,g=`
61
- query GetAllAddOns($filter: AddOnFilterInput, $limit: Int) {
63
+ query GetAllAddOns($filter: AddonsFilter, $limit: Int) {
62
64
  getAllAddOns(filter: $filter, limit: $limit) {
63
65
  id name description price currency productId isActive createdAt updatedAt
64
66
  }
65
67
  }
66
- `,m=`
68
+ `,I=`
67
69
  query GetAddOn($id: ID!) {
68
70
  getAddOn(id: $id) {
69
71
  id name description price currency productId isActive createdAt updatedAt
70
72
  }
71
73
  }
72
- `,y=`
73
- query GetPaginatedInvoices($billingAccountId: ID!, $page: Int, $pageSize: Int) {
74
- getPaginatedInvoices(billingAccountId: $billingAccountId, page: $page, pageSize: $pageSize) {
74
+ `,m=`
75
+ query GetPaginatedInvoices(
76
+ $billingAccountId: ID
77
+ $page: Int
78
+ $pageSize: Int
79
+ $search: String
80
+ $status: InvoiceStatus
81
+ ) {
82
+ getPaginatedInvoices(
83
+ billingAccountId: $billingAccountId
84
+ page: $page
85
+ pageSize: $pageSize
86
+ search: $search
87
+ status: $status
88
+ ) {
75
89
  invoices {
76
90
  id invoiceNumber billingAccountId status amount currency
77
91
  dueDate paidAt pdfUrl metadata createdAt updatedAt
@@ -79,9 +93,9 @@ var s=`
79
93
  totalCount hasMore
80
94
  }
81
95
  }
82
- `,I=`
83
- query GetInvoice($id: ID!) {
84
- getInvoice(id: $id) {
96
+ `,y=`
97
+ query GetInvoice($id: ID!, $billingAccountId: ID!) {
98
+ getInvoice(id: $id, billingAccountId: $billingAccountId) {
85
99
  id invoiceNumber billingAccountId status amount currency
86
100
  dueDate paidAt pdfUrl metadata createdAt updatedAt
87
101
  }
@@ -97,8 +111,8 @@ var s=`
97
111
  }
98
112
  }
99
113
  `,C=`
100
- query GetCoupon($code: String!) {
101
- getCoupon(code: $code) {
114
+ query GetCoupon($id: ID!) {
115
+ getCoupon(id: $id) {
102
116
  id code description discountType discountValue currency
103
117
  expiresAt maxRedemptions redemptions isActive
104
118
  }
@@ -109,13 +123,13 @@ var s=`
109
123
  id code discountType discountValue isActive
110
124
  }
111
125
  }
112
- `,f=`
126
+ `,b=`
113
127
  mutation UpdateCoupon($id: ID!, $input: UpdateCouponInput!) {
114
128
  updateCoupon(id: $id, input: $input) {
115
129
  id code description discountValue isActive
116
130
  }
117
131
  }
118
- `,b=`
132
+ `,f=`
119
133
  query GetPendingRefunds($page: Int, $pageSize: Int) {
120
134
  getPendingRefunds(page: $page, pageSize: $pageSize) {
121
135
  records { id paymentId invoiceId amount currency status reason createdAt updatedAt }
@@ -130,7 +144,7 @@ var s=`
130
144
  }
131
145
  `,T=`
132
146
  query GetCreditBalance($billingAccountId: ID!) {
133
- getCreditBalance(billingAccountId: $billingAccountId) {
147
+ getCreditBalanceByType(billingAccountId: $billingAccountId) {
134
148
  total
135
149
  byType { type balance }
136
150
  }
@@ -147,30 +161,30 @@ var s=`
147
161
  id billingAccountId amount status createdAt
148
162
  }
149
163
  }
150
- `,x=`
151
- query GetUsageDashboard($period: AnalyticsPeriod!) {
152
- getUsageDashboard(period: $period) {
164
+ `,D=`
165
+ query GetUsageDashboard($billingAccountId: ID!, $period: AnalyticsPeriod!) {
166
+ getUsageDashboard(billingAccountId: $billingAccountId, period: $period) {
153
167
  period totalEvents byTag byResource
154
168
  }
155
169
  }
156
- `,D=`
170
+ `,x=`
157
171
  query GetPaymentMethods($billingAccountId: ID!) {
158
172
  getPaymentMethods(billingAccountId: $billingAccountId) {
159
173
  id billingAccountId type brand last4 expiryMonth expiryYear
160
174
  isDefault createdAt updatedAt
161
175
  }
162
176
  }
163
- `,U=`
164
- mutation AddPaymentMethod($input: AddPaymentMethodInput!) {
177
+ `,$=`
178
+ mutation AddPaymentMethod($input: CreatePaymentMethodInput!) {
165
179
  addPaymentMethod(input: $input) {
166
180
  id billingAccountId type brand last4 isDefault
167
181
  }
168
182
  }
169
- `,_=`
170
- mutation DeletePaymentMethod($id: ID!) {
171
- deletePaymentMethod(id: $id) { success }
183
+ `,U=`
184
+ mutation DeletePaymentMethod($id: ID!, $billingAccountId: ID!) {
185
+ deletePaymentMethod(id: $id, billingAccountId: $billingAccountId)
172
186
  }
173
- `,$=`
187
+ `,_=`
174
188
  query GetEarningsSummary($billingAccountId: ID!) {
175
189
  getEarningsSummary(billingAccountId: $billingAccountId) {
176
190
  billingAccountId totalEarned totalPaid pendingPayout currency
@@ -194,10 +208,10 @@ var s=`
194
208
  id billingAccountId amount status createdAt
195
209
  }
196
210
  }
197
- `,M=`
211
+ `,v=`
198
212
  mutation CreateCheckoutSession($planId: ID!, $opts: CheckoutSessionInput) {
199
213
  createCheckoutSession(planId: $planId, opts: $opts) {
200
214
  url sessionId
201
215
  }
202
216
  }
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};
217
+ `;function M(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(I,{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,{id:t})).getCoupon},async create(t){return (await e.request(P,{input:t})).createCoupon},async update(t,n){return (await e.request(b,{id:t,input:n})).updateCoupon}}}function w(i){let{global:e}=i.gql;return {async balance(t){return (await e.request(T,{billingAccountId:t})).getCreditBalanceByType},async spend(t){return (await e.request(E,{input:t})).spendCredits},async withdraw(t){return (await e.request(q,{input:t})).requestCreditWithdrawal}}}function L(i){let{global:e}=i.gql;return {async list(t){return (await e.request(m,{billingAccountId:t?.billingAccountId,page:t?.page,pageSize:t?.pageSize,search:t?.search,status:t?.status})).getPaginatedInvoices},async get(t,n){return (await e.request(y,{id:t,billingAccountId:n})).getInvoice}}}function k(i){let{global:e}=i.gql;return {async list(t){return (await e.request(x,{billingAccountId:t})).getPaymentMethods},async add(t){return (await e.request($,{input:t})).addPaymentMethod},async delete(t,n){return {success:(await e.request(U,{id:t,billingAccountId:n})).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(f,{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,n){return (await e.request(d,{billingAccountId:t,page:n?.page,pageSize:n?.pageSize,search:n?.search})).getPaginatedSubscriptions},async get(t,n){return (await e.request(u,{id:t,billingAccountId:n})).getSubscription},async active(t){return (await e.request(r,{billingAccountId:t})).getActiveSubscriptions},async updateSeats(t){return (await e.request(c,{input:t})).updateSubscriptionSeats},async cancel(t){return (await e.request(p,{input:t})).cancelSubscription}}}function Y(i){let{global:e}=i.gql;return {async dashboard(t,n){return (await e.request(D,{billingAccountId:t,period:n})).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:M(i),invoices:L(i),coupons:G(i),refunds:z(i),credits:w(i),usage:Y(i),paymentMethods:k(i),affiliate:B(i),async getCheckoutUrl(t,n){return (await e.request(v,{planId:t,opts:n})).createCheckoutSession}}}},Mt=H;export{Mt as default};