@forgecart/sdk 1.2.5 → 1.2.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 (58) hide show
  1. package/README.md +2 -87
  2. package/dist/admin-types.generated.d.ts +9884 -0
  3. package/dist/admin.d.ts +55 -8
  4. package/dist/admin.generated.d.ts +790 -0
  5. package/dist/admin.generated.js +1801 -0
  6. package/dist/admin.js +112 -23
  7. package/dist/client.generated.d.ts +251 -0
  8. package/dist/client.generated.js +757 -0
  9. package/dist/documents.generated.d.ts +465 -0
  10. package/dist/documents.generated.js +24283 -0
  11. package/dist/error-utils.d.ts +25 -0
  12. package/dist/error-utils.js +59 -0
  13. package/dist/hook-event-map.generated.d.ts +243 -0
  14. package/dist/hook-event-map.generated.js +9 -0
  15. package/dist/index.d.ts +23 -59
  16. package/dist/index.js +35 -83
  17. package/dist/sdk-hook-subscription.generated.d.ts +29 -0
  18. package/dist/sdk-hook-subscription.generated.js +73 -0
  19. package/dist/sdk-plugin.generated.d.ts +38 -0
  20. package/dist/sdk-plugin.generated.js +31 -0
  21. package/dist/sdk-types.generated.d.ts +56 -0
  22. package/dist/sdk-types.generated.js +28 -0
  23. package/dist/shop-types.generated.d.ts +4776 -0
  24. package/dist/shop.d.ts +18 -8
  25. package/dist/shop.generated.d.ts +213 -0
  26. package/dist/shop.generated.js +465 -0
  27. package/dist/shop.js +37 -23
  28. package/dist/upload.d.ts +14 -0
  29. package/dist/upload.js +163 -0
  30. package/package.json +10 -25
  31. package/src/admin-types.generated.ts +28377 -0
  32. package/src/admin.generated.ts +1771 -0
  33. package/src/admin.ts +55 -9
  34. package/src/client.generated.ts +845 -0
  35. package/src/documents.generated.ts +24730 -0
  36. package/src/error-utils.ts +74 -0
  37. package/src/hook-event-map.generated.ts +252 -0
  38. package/src/index.ts +23 -115
  39. package/src/sdk-hook-subscription.generated.ts +93 -0
  40. package/src/sdk-plugin.generated.ts +59 -0
  41. package/src/sdk-types.generated.ts +79 -0
  42. package/src/shop-types.generated.ts +10400 -0
  43. package/src/shop.generated.ts +452 -0
  44. package/src/shop.ts +18 -9
  45. package/src/upload.ts +211 -0
  46. package/LICENSE +0 -21
  47. package/dist/admin-namespace.d.ts +0 -2688
  48. package/dist/admin-namespace.js +0 -9691
  49. package/dist/admin-types.d.ts +0 -16195
  50. package/dist/shop-namespace.d.ts +0 -718
  51. package/dist/shop-namespace.js +0 -3124
  52. package/dist/shop-types.d.ts +0 -6310
  53. package/src/admin-namespace.ts +0 -11428
  54. package/src/admin-types.ts +0 -10809
  55. package/src/shop-namespace.ts +0 -3547
  56. package/src/shop-types.ts +0 -4684
  57. /package/dist/{admin-types.js → admin-types.generated.js} +0 -0
  58. /package/dist/{shop-types.js → shop-types.generated.js} +0 -0
@@ -0,0 +1,452 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * AUTO-GENERATED FILE — DO NOT EDIT
4
+ *
5
+ * This file was generated by @forgecart/client-sdk-generators.
6
+ * Any manual changes will be overwritten on the next generation run.
7
+ */
8
+
9
+
10
+ import type { BaseGraphQLClient } from './client.generated';
11
+ import * as Types from './shop-types.generated';
12
+ import { Observable } from 'rxjs';
13
+ import { QueryObservable } from './client.generated';
14
+ import { shopShopFieldDefinitionDocument, shopShopEntryDocument, shopShopEntriesDocument, shopExternalAuthenticationMethodsDocument, shopLoginDocument, shopLogoutDocument, shopAuthenticateWithExternalStrategyDocument, shopUnlinkExternalAuthenticationMethodDocument, shopUpdateUserPreferencesDocument, shopAddItemToOrderDocument, shopAdjustOrderLineDocument, shopRemoveOrderLineDocument, shopRemoveAllOrderLinesDocument, shopApplyCouponCodeDocument, shopRemoveCouponCodeDocument, shopSetCustomerForOrderDocument, shopAddItemsToOrderDocument, shopAdjustOrderLinesDocument, shopRemoveItemsFromOrderDocument, shopSetOrderShippingAddressDocument, shopSetOrderBillingAddressDocument, shopTransitionOrderToStateDocument, shopShopCollectionDocument, shopShopCollectionsDocument, shopActiveCustomerDocument, shopActiveCustomerAddressesDocument, shopShopUpdateCustomerDocument, shopRegisterCustomerAccountDocument, shopVerifyCustomerAccountDocument, shopRequestPasswordResetDocument, shopResetPasswordDocument, shopCreateCustomerAddressDocument, shopUpdateCustomerAddressDocument, shopDeleteCustomerAddressDocument, shopUpdateCustomerPasswordDocument, shopRequestUpdateCustomerEmailAddressDocument, shopUpdateCustomerEmailAddressDocument, shopRequestCustomerReVerificationDocument, shopVerifyCustomerAccountWithPasswordDocument, shopShopFacetDocument, shopShopFacetsDocument, shopShopHookDispatchedDocument, shopRespondToHookDispatchDocument, shopHookListenDocument, shopHookRespondDocument, shopShopTrackEventDocument, shopShopResolveMarketingIdentityDocument, shopShopSetMarketingIdentifiersDocument, shopShopLinkMarketingEmailDocument, shopActiveOrderDocument, shopShopOrderByCodeDocument, shopNextOrderStatesDocument, shopShopOrderNotesDocument, shopShopActiveOrderUpdatedDocument, shopShopEligiblePaymentProvidersDocument, shopGetTokensDocument, shopCreatePaymentSessionDocument, shopConfirmPaymentSessionDocument, shopCancelPaymentSessionDocument, shopDeleteTokenDocument, shopSetDefaultTokenDocument, shopSaveTokenDocument, shopGetTokenTemplateDocument, shopGetSessionTemplateDocument, shopGetSessionVariablesDocument, shopShopProductDocument, shopShopProductsDocument, shopShopProductOptionGroupsDocument, shopShopSearchDocument, shopSuggestDocument, shopShippingRateGroupsDocument, shopSelectShippingRateDocument, shopMySubscriptionsDocument, shopMySubscriptionDocument, shopShopCreateSubscriptionDocument, shopShopCancelSubscriptionDocument, shopShopPauseSubscriptionDocument, shopShopResumeSubscriptionDocument, shopShopChangeSubscriptionPlanDocument, shopShopChangeSubscriptionQuantityDocument, shopReportUsageDocument } from './documents.generated';
15
+
16
+ export class AcfCategory {
17
+ constructor(private readonly client: BaseGraphQLClient) {}
18
+
19
+ shopFieldDefinition(variables: Types.ShopFieldDefinitionQueryVariables): QueryObservable<Types.ShopFieldDefinitionQuery> {
20
+ return this.client.query<Types.ShopFieldDefinitionQuery>(shopShopFieldDefinitionDocument, variables);
21
+ }
22
+ shopEntry(variables: Types.ShopEntryQueryVariables): QueryObservable<Types.ShopEntryQuery> {
23
+ return this.client.query<Types.ShopEntryQuery>(shopShopEntryDocument, variables);
24
+ }
25
+ shopEntries(variables: Types.ShopEntriesQueryVariables): QueryObservable<Types.ShopEntriesQuery> {
26
+ return this.client.query<Types.ShopEntriesQuery>(shopShopEntriesDocument, variables);
27
+ }
28
+ }
29
+
30
+ export class AuthCategory {
31
+ constructor(private readonly client: BaseGraphQLClient) {}
32
+
33
+ externalAuthenticationMethods(): QueryObservable<Types.ExternalAuthenticationMethodsQuery> {
34
+ return this.client.query<Types.ExternalAuthenticationMethodsQuery>(shopExternalAuthenticationMethodsDocument);
35
+ }
36
+ login(variables: Types.LoginMutationVariables): QueryObservable<Types.LoginMutation> {
37
+ return this.client.mutate<Types.LoginMutation>(shopLoginDocument, variables);
38
+ }
39
+ logout(): QueryObservable<Types.LogoutMutation> {
40
+ return this.client.mutate<Types.LogoutMutation>(shopLogoutDocument);
41
+ }
42
+ authenticateWithExternalStrategy(variables: Types.AuthenticateWithExternalStrategyMutationVariables): QueryObservable<Types.AuthenticateWithExternalStrategyMutation> {
43
+ return this.client.mutate<Types.AuthenticateWithExternalStrategyMutation>(shopAuthenticateWithExternalStrategyDocument, variables);
44
+ }
45
+ unlinkExternalAuthenticationMethod(variables: Types.UnlinkExternalAuthenticationMethodMutationVariables): QueryObservable<Types.UnlinkExternalAuthenticationMethodMutation> {
46
+ return this.client.mutate<Types.UnlinkExternalAuthenticationMethodMutation>(shopUnlinkExternalAuthenticationMethodDocument, variables);
47
+ }
48
+ updateUserPreferences(variables: Types.UpdateUserPreferencesMutationVariables): QueryObservable<Types.UpdateUserPreferencesMutation> {
49
+ return this.client.mutate<Types.UpdateUserPreferencesMutation>(shopUpdateUserPreferencesDocument, variables);
50
+ }
51
+ }
52
+
53
+ export class CartCategory {
54
+ constructor(private readonly client: BaseGraphQLClient) {}
55
+
56
+ addItemToOrder(variables: Types.AddItemToOrderMutationVariables): QueryObservable<Types.AddItemToOrderMutation> {
57
+ return this.client.mutate<Types.AddItemToOrderMutation>(shopAddItemToOrderDocument, variables);
58
+ }
59
+ adjustOrderLine(variables: Types.AdjustOrderLineMutationVariables): QueryObservable<Types.AdjustOrderLineMutation> {
60
+ return this.client.mutate<Types.AdjustOrderLineMutation>(shopAdjustOrderLineDocument, variables);
61
+ }
62
+ removeOrderLine(variables: Types.RemoveOrderLineMutationVariables): QueryObservable<Types.RemoveOrderLineMutation> {
63
+ return this.client.mutate<Types.RemoveOrderLineMutation>(shopRemoveOrderLineDocument, variables);
64
+ }
65
+ removeAllOrderLines(): QueryObservable<Types.RemoveAllOrderLinesMutation> {
66
+ return this.client.mutate<Types.RemoveAllOrderLinesMutation>(shopRemoveAllOrderLinesDocument);
67
+ }
68
+ applyCouponCode(variables: Types.ApplyCouponCodeMutationVariables): QueryObservable<Types.ApplyCouponCodeMutation> {
69
+ return this.client.mutate<Types.ApplyCouponCodeMutation>(shopApplyCouponCodeDocument, variables);
70
+ }
71
+ removeCouponCode(variables: Types.RemoveCouponCodeMutationVariables): QueryObservable<Types.RemoveCouponCodeMutation> {
72
+ return this.client.mutate<Types.RemoveCouponCodeMutation>(shopRemoveCouponCodeDocument, variables);
73
+ }
74
+ setCustomerForOrder(variables: Types.SetCustomerForOrderMutationVariables): QueryObservable<Types.SetCustomerForOrderMutation> {
75
+ return this.client.mutate<Types.SetCustomerForOrderMutation>(shopSetCustomerForOrderDocument, variables);
76
+ }
77
+ addItemsToOrder(variables: Types.AddItemsToOrderMutationVariables): QueryObservable<Types.AddItemsToOrderMutation> {
78
+ return this.client.mutate<Types.AddItemsToOrderMutation>(shopAddItemsToOrderDocument, variables);
79
+ }
80
+ adjustOrderLines(variables: Types.AdjustOrderLinesMutationVariables): QueryObservable<Types.AdjustOrderLinesMutation> {
81
+ return this.client.mutate<Types.AdjustOrderLinesMutation>(shopAdjustOrderLinesDocument, variables);
82
+ }
83
+ removeItemsFromOrder(variables: Types.RemoveItemsFromOrderMutationVariables): QueryObservable<Types.RemoveItemsFromOrderMutation> {
84
+ return this.client.mutate<Types.RemoveItemsFromOrderMutation>(shopRemoveItemsFromOrderDocument, variables);
85
+ }
86
+ }
87
+
88
+ export class CheckoutCategory {
89
+ constructor(private readonly client: BaseGraphQLClient) {}
90
+
91
+ setOrderShippingAddress(variables: Types.SetOrderShippingAddressMutationVariables): QueryObservable<Types.SetOrderShippingAddressMutation> {
92
+ return this.client.mutate<Types.SetOrderShippingAddressMutation>(shopSetOrderShippingAddressDocument, variables);
93
+ }
94
+ setOrderBillingAddress(variables: Types.SetOrderBillingAddressMutationVariables): QueryObservable<Types.SetOrderBillingAddressMutation> {
95
+ return this.client.mutate<Types.SetOrderBillingAddressMutation>(shopSetOrderBillingAddressDocument, variables);
96
+ }
97
+ transitionOrderToState(variables: Types.TransitionOrderToStateMutationVariables): QueryObservable<Types.TransitionOrderToStateMutation> {
98
+ return this.client.mutate<Types.TransitionOrderToStateMutation>(shopTransitionOrderToStateDocument, variables);
99
+ }
100
+ }
101
+
102
+ export class CollectionCategory {
103
+ constructor(private readonly client: BaseGraphQLClient) {}
104
+
105
+ shopCollection(variables: Types.ShopCollectionQueryVariables): QueryObservable<Types.ShopCollectionQuery> {
106
+ return this.client.query<Types.ShopCollectionQuery>(shopShopCollectionDocument, variables);
107
+ }
108
+ shopCollections(variables: Types.ShopCollectionsQueryVariables): QueryObservable<Types.ShopCollectionsQuery> {
109
+ return this.client.query<Types.ShopCollectionsQuery>(shopShopCollectionsDocument, variables);
110
+ }
111
+ }
112
+
113
+ export class CustomerCategory {
114
+ constructor(private readonly client: BaseGraphQLClient) {}
115
+
116
+ activeCustomer(): QueryObservable<Types.ActiveCustomerQuery> {
117
+ return this.client.query<Types.ActiveCustomerQuery>(shopActiveCustomerDocument);
118
+ }
119
+ activeCustomerAddresses(): QueryObservable<Types.ActiveCustomerAddressesQuery> {
120
+ return this.client.query<Types.ActiveCustomerAddressesQuery>(shopActiveCustomerAddressesDocument);
121
+ }
122
+ shopUpdateCustomer(variables: Types.ShopUpdateCustomerMutationVariables): QueryObservable<Types.ShopUpdateCustomerMutation> {
123
+ return this.client.mutate<Types.ShopUpdateCustomerMutation>(shopShopUpdateCustomerDocument, variables);
124
+ }
125
+ registerCustomerAccount(variables: Types.RegisterCustomerAccountMutationVariables): QueryObservable<Types.RegisterCustomerAccountMutation> {
126
+ return this.client.mutate<Types.RegisterCustomerAccountMutation>(shopRegisterCustomerAccountDocument, variables);
127
+ }
128
+ verifyCustomerAccount(variables: Types.VerifyCustomerAccountMutationVariables): QueryObservable<Types.VerifyCustomerAccountMutation> {
129
+ return this.client.mutate<Types.VerifyCustomerAccountMutation>(shopVerifyCustomerAccountDocument, variables);
130
+ }
131
+ requestPasswordReset(variables: Types.RequestPasswordResetMutationVariables): QueryObservable<Types.RequestPasswordResetMutation> {
132
+ return this.client.mutate<Types.RequestPasswordResetMutation>(shopRequestPasswordResetDocument, variables);
133
+ }
134
+ resetPassword(variables: Types.ResetPasswordMutationVariables): QueryObservable<Types.ResetPasswordMutation> {
135
+ return this.client.mutate<Types.ResetPasswordMutation>(shopResetPasswordDocument, variables);
136
+ }
137
+ createCustomerAddress(variables: Types.CreateCustomerAddressMutationVariables): QueryObservable<Types.CreateCustomerAddressMutation> {
138
+ return this.client.mutate<Types.CreateCustomerAddressMutation>(shopCreateCustomerAddressDocument, variables);
139
+ }
140
+ updateCustomerAddress(variables: Types.UpdateCustomerAddressMutationVariables): QueryObservable<Types.UpdateCustomerAddressMutation> {
141
+ return this.client.mutate<Types.UpdateCustomerAddressMutation>(shopUpdateCustomerAddressDocument, variables);
142
+ }
143
+ deleteCustomerAddress(variables: Types.DeleteCustomerAddressMutationVariables): QueryObservable<Types.DeleteCustomerAddressMutation> {
144
+ return this.client.mutate<Types.DeleteCustomerAddressMutation>(shopDeleteCustomerAddressDocument, variables);
145
+ }
146
+ updateCustomerPassword(variables: Types.UpdateCustomerPasswordMutationVariables): QueryObservable<Types.UpdateCustomerPasswordMutation> {
147
+ return this.client.mutate<Types.UpdateCustomerPasswordMutation>(shopUpdateCustomerPasswordDocument, variables);
148
+ }
149
+ requestUpdateCustomerEmailAddress(variables: Types.RequestUpdateCustomerEmailAddressMutationVariables): QueryObservable<Types.RequestUpdateCustomerEmailAddressMutation> {
150
+ return this.client.mutate<Types.RequestUpdateCustomerEmailAddressMutation>(shopRequestUpdateCustomerEmailAddressDocument, variables);
151
+ }
152
+ updateCustomerEmailAddress(variables: Types.UpdateCustomerEmailAddressMutationVariables): QueryObservable<Types.UpdateCustomerEmailAddressMutation> {
153
+ return this.client.mutate<Types.UpdateCustomerEmailAddressMutation>(shopUpdateCustomerEmailAddressDocument, variables);
154
+ }
155
+ requestCustomerReVerification(): QueryObservable<Types.RequestCustomerReVerificationMutation> {
156
+ return this.client.mutate<Types.RequestCustomerReVerificationMutation>(shopRequestCustomerReVerificationDocument);
157
+ }
158
+ verifyCustomerAccountWithPassword(variables: Types.VerifyCustomerAccountWithPasswordMutationVariables): QueryObservable<Types.VerifyCustomerAccountWithPasswordMutation> {
159
+ return this.client.mutate<Types.VerifyCustomerAccountWithPasswordMutation>(shopVerifyCustomerAccountWithPasswordDocument, variables);
160
+ }
161
+ }
162
+
163
+ export class FacetCategory {
164
+ constructor(private readonly client: BaseGraphQLClient) {}
165
+
166
+ shopFacet(variables: Types.ShopFacetQueryVariables): QueryObservable<Types.ShopFacetQuery> {
167
+ return this.client.query<Types.ShopFacetQuery>(shopShopFacetDocument, variables);
168
+ }
169
+ shopFacets(variables: Types.ShopFacetsQueryVariables): QueryObservable<Types.ShopFacetsQuery> {
170
+ return this.client.query<Types.ShopFacetsQuery>(shopShopFacetsDocument, variables);
171
+ }
172
+ }
173
+
174
+ export class HookDispatchCategory {
175
+ constructor(private readonly client: BaseGraphQLClient) {}
176
+
177
+ shopHookDispatched(variables: Types.ShopHookDispatchedSubscriptionVariables): Observable<Types.ShopHookDispatchedSubscription> {
178
+ return this.client.subscribe<Types.ShopHookDispatchedSubscription>(shopShopHookDispatchedDocument, variables);
179
+ }
180
+ respondToHookDispatch(variables: Types.RespondToHookDispatchMutationVariables): QueryObservable<Types.RespondToHookDispatchMutation> {
181
+ return this.client.mutate<Types.RespondToHookDispatchMutation>(shopRespondToHookDispatchDocument, variables);
182
+ }
183
+ }
184
+
185
+ export class HookCategory {
186
+ constructor(private readonly client: BaseGraphQLClient) {}
187
+
188
+ hookListen(variables: Types.HookListenSubscriptionVariables): Observable<Types.HookListenSubscription> {
189
+ return this.client.subscribe<Types.HookListenSubscription>(shopHookListenDocument, variables);
190
+ }
191
+ hookRespond(variables: Types.HookRespondMutationVariables): QueryObservable<Types.HookRespondMutation> {
192
+ return this.client.mutate<Types.HookRespondMutation>(shopHookRespondDocument, variables);
193
+ }
194
+ }
195
+
196
+ export class MarketingEventCategory {
197
+ constructor(private readonly client: BaseGraphQLClient) {}
198
+
199
+ shopTrackEvent(variables: Types.ShopTrackEventMutationVariables): QueryObservable<Types.ShopTrackEventMutation> {
200
+ return this.client.mutate<Types.ShopTrackEventMutation>(shopShopTrackEventDocument, variables);
201
+ }
202
+ }
203
+
204
+ export class MarketingIdentityCategory {
205
+ constructor(private readonly client: BaseGraphQLClient) {}
206
+
207
+ shopResolveMarketingIdentity(): QueryObservable<Types.ShopResolveMarketingIdentityMutation> {
208
+ return this.client.mutate<Types.ShopResolveMarketingIdentityMutation>(shopShopResolveMarketingIdentityDocument);
209
+ }
210
+ shopSetMarketingIdentifiers(variables: Types.ShopSetMarketingIdentifiersMutationVariables): QueryObservable<Types.ShopSetMarketingIdentifiersMutation> {
211
+ return this.client.mutate<Types.ShopSetMarketingIdentifiersMutation>(shopShopSetMarketingIdentifiersDocument, variables);
212
+ }
213
+ shopLinkMarketingEmail(variables: Types.ShopLinkMarketingEmailMutationVariables): QueryObservable<Types.ShopLinkMarketingEmailMutation> {
214
+ return this.client.mutate<Types.ShopLinkMarketingEmailMutation>(shopShopLinkMarketingEmailDocument, variables);
215
+ }
216
+ }
217
+
218
+ export class OrderCategory {
219
+ constructor(private readonly client: BaseGraphQLClient) {}
220
+
221
+ activeOrder(): QueryObservable<Types.ActiveOrderQuery> {
222
+ return this.client.query<Types.ActiveOrderQuery>(shopActiveOrderDocument);
223
+ }
224
+ shopOrderByCode(variables: Types.ShopOrderByCodeQueryVariables): QueryObservable<Types.ShopOrderByCodeQuery> {
225
+ return this.client.query<Types.ShopOrderByCodeQuery>(shopShopOrderByCodeDocument, variables);
226
+ }
227
+ nextOrderStates(): QueryObservable<Types.NextOrderStatesQuery> {
228
+ return this.client.query<Types.NextOrderStatesQuery>(shopNextOrderStatesDocument);
229
+ }
230
+ shopOrderNotes(variables: Types.ShopOrderNotesQueryVariables): QueryObservable<Types.ShopOrderNotesQuery> {
231
+ return this.client.query<Types.ShopOrderNotesQuery>(shopShopOrderNotesDocument, variables);
232
+ }
233
+ shopActiveOrderUpdated(): Observable<Types.ShopActiveOrderUpdatedSubscription> {
234
+ return this.client.subscribe<Types.ShopActiveOrderUpdatedSubscription>(shopShopActiveOrderUpdatedDocument);
235
+ }
236
+ }
237
+
238
+ export class PaymentCategory {
239
+ constructor(private readonly client: BaseGraphQLClient) {}
240
+
241
+ shopEligiblePaymentProviders(variables: Types.ShopEligiblePaymentProvidersQueryVariables): QueryObservable<Types.ShopEligiblePaymentProvidersQuery> {
242
+ return this.client.query<Types.ShopEligiblePaymentProvidersQuery>(shopShopEligiblePaymentProvidersDocument, variables);
243
+ }
244
+ getTokens(): QueryObservable<Types.GetTokensQuery> {
245
+ return this.client.query<Types.GetTokensQuery>(shopGetTokensDocument);
246
+ }
247
+ createPaymentSession(variables: Types.CreatePaymentSessionMutationVariables): QueryObservable<Types.CreatePaymentSessionMutation> {
248
+ return this.client.mutate<Types.CreatePaymentSessionMutation>(shopCreatePaymentSessionDocument, variables);
249
+ }
250
+ confirmPaymentSession(variables: Types.ConfirmPaymentSessionMutationVariables): QueryObservable<Types.ConfirmPaymentSessionMutation> {
251
+ return this.client.mutate<Types.ConfirmPaymentSessionMutation>(shopConfirmPaymentSessionDocument, variables);
252
+ }
253
+ cancelPaymentSession(variables: Types.CancelPaymentSessionMutationVariables): QueryObservable<Types.CancelPaymentSessionMutation> {
254
+ return this.client.mutate<Types.CancelPaymentSessionMutation>(shopCancelPaymentSessionDocument, variables);
255
+ }
256
+ deleteToken(variables: Types.DeleteTokenMutationVariables): QueryObservable<Types.DeleteTokenMutation> {
257
+ return this.client.mutate<Types.DeleteTokenMutation>(shopDeleteTokenDocument, variables);
258
+ }
259
+ setDefaultToken(variables: Types.SetDefaultTokenMutationVariables): QueryObservable<Types.SetDefaultTokenMutation> {
260
+ return this.client.mutate<Types.SetDefaultTokenMutation>(shopSetDefaultTokenDocument, variables);
261
+ }
262
+ saveToken(variables: Types.SaveTokenMutationVariables): QueryObservable<Types.SaveTokenMutation> {
263
+ return this.client.mutate<Types.SaveTokenMutation>(shopSaveTokenDocument, variables);
264
+ }
265
+ getTokenTemplate(): QueryObservable<Types.GetTokenTemplateQuery> {
266
+ return this.client.query<Types.GetTokenTemplateQuery>(shopGetTokenTemplateDocument);
267
+ }
268
+ getSessionTemplate(variables: Types.GetSessionTemplateQueryVariables): QueryObservable<Types.GetSessionTemplateQuery> {
269
+ return this.client.query<Types.GetSessionTemplateQuery>(shopGetSessionTemplateDocument, variables);
270
+ }
271
+ getSessionVariables(variables: Types.GetSessionVariablesQueryVariables): QueryObservable<Types.GetSessionVariablesQuery> {
272
+ return this.client.query<Types.GetSessionVariablesQuery>(shopGetSessionVariablesDocument, variables);
273
+ }
274
+ }
275
+
276
+ export class ProductCategory {
277
+ constructor(private readonly client: BaseGraphQLClient) {}
278
+
279
+ shopProduct(variables: Types.ShopProductQueryVariables): QueryObservable<Types.ShopProductQuery> {
280
+ return this.client.query<Types.ShopProductQuery>(shopShopProductDocument, variables);
281
+ }
282
+ shopProducts(variables: Types.ShopProductsQueryVariables): QueryObservable<Types.ShopProductsQuery> {
283
+ return this.client.query<Types.ShopProductsQuery>(shopShopProductsDocument, variables);
284
+ }
285
+ shopProductOptionGroups(variables: Types.ShopProductOptionGroupsQueryVariables): QueryObservable<Types.ShopProductOptionGroupsQuery> {
286
+ return this.client.query<Types.ShopProductOptionGroupsQuery>(shopShopProductOptionGroupsDocument, variables);
287
+ }
288
+ }
289
+
290
+ export class SearchCategory {
291
+ constructor(private readonly client: BaseGraphQLClient) {}
292
+
293
+ shopSearch(variables: Types.ShopSearchQueryVariables): QueryObservable<Types.ShopSearchQuery> {
294
+ return this.client.query<Types.ShopSearchQuery>(shopShopSearchDocument, variables);
295
+ }
296
+ suggest(variables: Types.SuggestQueryVariables): QueryObservable<Types.SuggestQuery> {
297
+ return this.client.query<Types.SuggestQuery>(shopSuggestDocument, variables);
298
+ }
299
+ }
300
+
301
+ export class ShippingCategory {
302
+ constructor(private readonly client: BaseGraphQLClient) {}
303
+
304
+ shippingRateGroups(): QueryObservable<Types.ShippingRateGroupsQuery> {
305
+ return this.client.query<Types.ShippingRateGroupsQuery>(shopShippingRateGroupsDocument);
306
+ }
307
+ selectShippingRate(variables: Types.SelectShippingRateMutationVariables): QueryObservable<Types.SelectShippingRateMutation> {
308
+ return this.client.mutate<Types.SelectShippingRateMutation>(shopSelectShippingRateDocument, variables);
309
+ }
310
+ }
311
+
312
+ export class SubscriptionCategory {
313
+ constructor(private readonly client: BaseGraphQLClient) {}
314
+
315
+ mySubscriptions(): QueryObservable<Types.MySubscriptionsQuery> {
316
+ return this.client.query<Types.MySubscriptionsQuery>(shopMySubscriptionsDocument);
317
+ }
318
+ mySubscription(variables: Types.MySubscriptionQueryVariables): QueryObservable<Types.MySubscriptionQuery> {
319
+ return this.client.query<Types.MySubscriptionQuery>(shopMySubscriptionDocument, variables);
320
+ }
321
+ shopCreateSubscription(variables: Types.ShopCreateSubscriptionMutationVariables): QueryObservable<Types.ShopCreateSubscriptionMutation> {
322
+ return this.client.mutate<Types.ShopCreateSubscriptionMutation>(shopShopCreateSubscriptionDocument, variables);
323
+ }
324
+ shopCancelSubscription(variables: Types.ShopCancelSubscriptionMutationVariables): QueryObservable<Types.ShopCancelSubscriptionMutation> {
325
+ return this.client.mutate<Types.ShopCancelSubscriptionMutation>(shopShopCancelSubscriptionDocument, variables);
326
+ }
327
+ shopPauseSubscription(variables: Types.ShopPauseSubscriptionMutationVariables): QueryObservable<Types.ShopPauseSubscriptionMutation> {
328
+ return this.client.mutate<Types.ShopPauseSubscriptionMutation>(shopShopPauseSubscriptionDocument, variables);
329
+ }
330
+ shopResumeSubscription(variables: Types.ShopResumeSubscriptionMutationVariables): QueryObservable<Types.ShopResumeSubscriptionMutation> {
331
+ return this.client.mutate<Types.ShopResumeSubscriptionMutation>(shopShopResumeSubscriptionDocument, variables);
332
+ }
333
+ shopChangeSubscriptionPlan(variables: Types.ShopChangeSubscriptionPlanMutationVariables): QueryObservable<Types.ShopChangeSubscriptionPlanMutation> {
334
+ return this.client.mutate<Types.ShopChangeSubscriptionPlanMutation>(shopShopChangeSubscriptionPlanDocument, variables);
335
+ }
336
+ shopChangeSubscriptionQuantity(variables: Types.ShopChangeSubscriptionQuantityMutationVariables): QueryObservable<Types.ShopChangeSubscriptionQuantityMutation> {
337
+ return this.client.mutate<Types.ShopChangeSubscriptionQuantityMutation>(shopShopChangeSubscriptionQuantityDocument, variables);
338
+ }
339
+ reportUsage(variables: Types.ReportUsageMutationVariables): QueryObservable<Types.ReportUsageMutation> {
340
+ return this.client.mutate<Types.ReportUsageMutation>(shopReportUsageDocument, variables);
341
+ }
342
+ }
343
+
344
+ export class ShopNamespace {
345
+ private readonly _acf: AcfCategory;
346
+ private readonly _auth: AuthCategory;
347
+ private readonly _cart: CartCategory;
348
+ private readonly _checkout: CheckoutCategory;
349
+ private readonly _collection: CollectionCategory;
350
+ private readonly _customer: CustomerCategory;
351
+ private readonly _facet: FacetCategory;
352
+ private readonly _hookDispatch: HookDispatchCategory;
353
+ private readonly _hook: HookCategory;
354
+ private readonly _marketingEvent: MarketingEventCategory;
355
+ private readonly _marketingIdentity: MarketingIdentityCategory;
356
+ private readonly _order: OrderCategory;
357
+ private readonly _payment: PaymentCategory;
358
+ private readonly _product: ProductCategory;
359
+ private readonly _search: SearchCategory;
360
+ private readonly _shipping: ShippingCategory;
361
+ private readonly _subscription: SubscriptionCategory;
362
+
363
+ constructor(private readonly client: BaseGraphQLClient) {
364
+ this._acf = new AcfCategory(client);
365
+ this._auth = new AuthCategory(client);
366
+ this._cart = new CartCategory(client);
367
+ this._checkout = new CheckoutCategory(client);
368
+ this._collection = new CollectionCategory(client);
369
+ this._customer = new CustomerCategory(client);
370
+ this._facet = new FacetCategory(client);
371
+ this._hookDispatch = new HookDispatchCategory(client);
372
+ this._hook = new HookCategory(client);
373
+ this._marketingEvent = new MarketingEventCategory(client);
374
+ this._marketingIdentity = new MarketingIdentityCategory(client);
375
+ this._order = new OrderCategory(client);
376
+ this._payment = new PaymentCategory(client);
377
+ this._product = new ProductCategory(client);
378
+ this._search = new SearchCategory(client);
379
+ this._shipping = new ShippingCategory(client);
380
+ this._subscription = new SubscriptionCategory(client);
381
+ }
382
+
383
+ get acf(): AcfCategory {
384
+ return this._acf;
385
+ }
386
+ get auth(): AuthCategory {
387
+ return this._auth;
388
+ }
389
+ get cart(): CartCategory {
390
+ return this._cart;
391
+ }
392
+ get checkout(): CheckoutCategory {
393
+ return this._checkout;
394
+ }
395
+ get collection(): CollectionCategory {
396
+ return this._collection;
397
+ }
398
+ get customer(): CustomerCategory {
399
+ return this._customer;
400
+ }
401
+ get facet(): FacetCategory {
402
+ return this._facet;
403
+ }
404
+ get hookDispatch(): HookDispatchCategory {
405
+ return this._hookDispatch;
406
+ }
407
+ get hook(): HookCategory {
408
+ return this._hook;
409
+ }
410
+ get marketingEvent(): MarketingEventCategory {
411
+ return this._marketingEvent;
412
+ }
413
+ get marketingIdentity(): MarketingIdentityCategory {
414
+ return this._marketingIdentity;
415
+ }
416
+ get order(): OrderCategory {
417
+ return this._order;
418
+ }
419
+ get payment(): PaymentCategory {
420
+ return this._payment;
421
+ }
422
+ get product(): ProductCategory {
423
+ return this._product;
424
+ }
425
+ get search(): SearchCategory {
426
+ return this._search;
427
+ }
428
+ get shipping(): ShippingCategory {
429
+ return this._shipping;
430
+ }
431
+ get subscription(): SubscriptionCategory {
432
+ return this._subscription;
433
+ }
434
+ }
435
+
436
+ // Entity types (generated from fragments)
437
+ export type Address = Types.ShopCustomerAddressFieldFragment;
438
+ export type Adjustment = Types.ShopAdjustmentFieldFragment;
439
+ export type BillingSubscription = Types.ShopBillingSubscriptionFieldsFragment;
440
+ export type Collection = Types.ShopCollectionFieldsFragment;
441
+ export type Customer = Types.ShopCustomerFieldFragment;
442
+ export type Facet = Types.ShopFacetFieldsFragment;
443
+ export type Order = Types.ShopOrderFieldFragment;
444
+ export type OrderAddress = Types.ShopOrderAddressFieldFragment;
445
+ export type OrderDiscount = Types.ShopDiscountFieldFragment;
446
+ export type OrderLine = Types.ShopOrderLineFieldFragment;
447
+ export type OrderTaxLine = Types.ShopTaxLineFieldFragment;
448
+ export type OrderTaxSummary = Types.ShopTaxSummaryFieldFragment;
449
+ export type PaymentGatewaySession = Types.ShopPaymentSessionFieldFragment;
450
+ export type PaymentGatewayToken = Types.ShopPaymentTokenFieldFragment;
451
+ export type ShippingLine = Types.ShopShippingLineFieldFragment;
452
+ export type Surcharge = Types.ShopSurchargeFieldFragment;
package/src/shop.ts CHANGED
@@ -1,9 +1,18 @@
1
- /**
2
- * @forgecart/sdk - Shop API
3
- *
4
- * Shop namespace and types
5
- */
6
-
7
- export { ShopNamespace } from './shop-namespace.js'
8
- export type { SDKConfig as ShopSDKConfig } from './shop-namespace.js'
9
- export * from './shop-types.js'
1
+ export { ShopNamespace } from './shop.generated';
2
+ export { AcfCategory } from './shop.generated';
3
+ export { AuthCategory } from './shop.generated';
4
+ export { CartCategory } from './shop.generated';
5
+ export { CheckoutCategory } from './shop.generated';
6
+ export { CollectionCategory } from './shop.generated';
7
+ export { CustomerCategory } from './shop.generated';
8
+ export { FacetCategory } from './shop.generated';
9
+ export { HookDispatchCategory } from './shop.generated';
10
+ export { HookCategory } from './shop.generated';
11
+ export { MarketingEventCategory } from './shop.generated';
12
+ export { MarketingIdentityCategory } from './shop.generated';
13
+ export { OrderCategory } from './shop.generated';
14
+ export { PaymentCategory } from './shop.generated';
15
+ export { ProductCategory } from './shop.generated';
16
+ export { SearchCategory } from './shop.generated';
17
+ export { ShippingCategory } from './shop.generated';
18
+ export { SubscriptionCategory } from './shop.generated';