@forgecart/sdk 1.2.7 → 1.202606151453.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/admin-types.generated.d.ts +460 -29
- package/dist/admin.d.ts +2 -0
- package/dist/admin.generated.d.ts +67 -27
- package/dist/admin.generated.js +88 -4
- package/dist/admin.js +35 -31
- package/dist/client.generated.d.ts +36 -1
- package/dist/client.generated.js +149 -5
- package/dist/documents.generated.d.ts +27 -5
- package/dist/documents.generated.js +492 -39
- package/dist/index.d.ts +1 -0
- package/dist/shop-types.generated.d.ts +190 -13
- package/dist/shop.d.ts +1 -0
- package/dist/shop.generated.d.ts +13 -4
- package/dist/shop.generated.js +19 -1
- package/dist/shop.js +17 -15
- package/package.json +8 -4
- package/src/admin-types.generated.d.ts +10013 -0
- package/src/admin-types.generated.ts +979 -92
- package/src/admin.generated.d.ts +806 -0
- package/src/admin.generated.ts +117 -29
- package/src/admin.ts +2 -0
- package/src/client.generated.d.ts +249 -0
- package/src/client.generated.ts +173 -4
- package/src/documents.generated.d.ts +473 -0
- package/src/documents.generated.ts +505 -30
- package/src/error-utils.d.ts +25 -0
- package/src/hook-event-map.generated.d.ts +243 -0
- package/src/index.d.ts +22 -0
- package/src/index.ts +1 -0
- package/src/sdk-hook-subscription.generated.d.ts +29 -0
- package/src/sdk-plugin.generated.d.ts +38 -0
- package/src/sdk-types.generated.d.ts +56 -0
- package/src/shop-types.generated.d.ts +4786 -0
- package/src/shop-types.generated.ts +259 -13
- package/src/shop.generated.d.ts +213 -0
- package/src/shop.generated.ts +22 -5
- package/src/shop.ts +1 -0
- package/src/upload.d.ts +14 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FILE — DO NOT EDIT
|
|
3
|
+
*
|
|
4
|
+
* This file was generated by @forgecart/client-sdk-generators.
|
|
5
|
+
* Any manual changes will be overwritten on the next generation run.
|
|
6
|
+
*/
|
|
7
|
+
import type { AddIdentityToSegmentInput, Administrator, Asset, AudienceMembership, AudienceSegment, Channel, ChannelPlugin, Collection, Country, CreateAdministratorInput, CreateAssetInput, CreateAudienceSegmentInput, CreateChannelInput, CreateCollectionInput, CreateCountryInput, CreateCustomerGroupInput, CreateCustomerInput, CreateFacetInput, CreateFacetValueInput, CreateFulfillmentInput, CreateProductInput, CreateProductVariantInput, CreatePromotionInput, CreateRoleInput, CreateSellerInput, CreateStockLocationInput, CreateTaxCategoryInput, CreateTaxRateInput, CreateZoneInput, Customer, CustomerGroup, Facet, FacetValue, Fulfillment, HistoryEntry, Order, Product, ProductVariant, Promotion, RegisterCustomerInput, RemoveIdentityFromSegmentInput, Role, Seller, StockLocation, TaxCategory, TaxRate, UpdateAdministratorInput, UpdateAssetInput, UpdateAudienceSegmentInput, UpdateChannelInput, UpdateChannelPluginConfigInput, UpdateCollectionInput, UpdateCountryInput, UpdateCustomerGroupInput, UpdateCustomerInput, UpdateFacetInput, UpdateFacetValueInput, UpdateProductInput, UpdateProductVariantInput, UpdatePromotionInput, UpdateRoleInput, UpdateSellerInput, UpdateStockLocationInput, UpdateTaxCategoryInput, UpdateTaxRateInput, UpdateZoneInput, Zone } from './admin-types.generated';
|
|
8
|
+
import type { TransactionContext } from './client.generated';
|
|
9
|
+
export interface AdminHookEventMap {
|
|
10
|
+
'asset.create.before': CreateAssetInput;
|
|
11
|
+
'asset.create.after': Asset;
|
|
12
|
+
'asset.create.async': Asset;
|
|
13
|
+
'asset.update.before': UpdateAssetInput;
|
|
14
|
+
'asset.update.after': Asset;
|
|
15
|
+
'asset.update.async': Asset;
|
|
16
|
+
'asset.executeSingleAssetDelete.before': void;
|
|
17
|
+
'asset.executeSingleAssetDelete.after': Asset;
|
|
18
|
+
'asset.executeSingleAssetDelete.async': Asset;
|
|
19
|
+
'asset.createFromUrl.before': string;
|
|
20
|
+
'asset.createFromUrl.after': Asset;
|
|
21
|
+
'asset.createFromUrl.async': Asset;
|
|
22
|
+
'administrator.create.before': CreateAdministratorInput;
|
|
23
|
+
'administrator.create.after': Administrator;
|
|
24
|
+
'administrator.create.async': Administrator;
|
|
25
|
+
'administrator.update.before': UpdateAdministratorInput;
|
|
26
|
+
'administrator.update.after': Administrator;
|
|
27
|
+
'administrator.update.async': Administrator;
|
|
28
|
+
'administrator.softDelete.before': string;
|
|
29
|
+
'administrator.softDelete.after': Administrator;
|
|
30
|
+
'administrator.softDelete.async': Administrator;
|
|
31
|
+
'administrator.inviteExistingUser.before': void;
|
|
32
|
+
'administrator.inviteExistingUser.after': Administrator;
|
|
33
|
+
'administrator.inviteExistingUser.async': Administrator;
|
|
34
|
+
'administrator.inviteNewUser.before': void;
|
|
35
|
+
'administrator.inviteNewUser.after': Administrator;
|
|
36
|
+
'administrator.inviteNewUser.async': Administrator;
|
|
37
|
+
'authentication.attemptLogin.before': unknown;
|
|
38
|
+
'authentication.attemptLogin.after': unknown;
|
|
39
|
+
'authentication.attemptLogin.async': unknown;
|
|
40
|
+
'role.create.before': CreateRoleInput;
|
|
41
|
+
'role.create.after': Role;
|
|
42
|
+
'role.create.async': Role;
|
|
43
|
+
'role.update.before': UpdateRoleInput;
|
|
44
|
+
'role.update.after': Role;
|
|
45
|
+
'role.update.async': Role;
|
|
46
|
+
'role.executeRoleDelete.before': void;
|
|
47
|
+
'role.executeRoleDelete.after': Role;
|
|
48
|
+
'role.executeRoleDelete.async': Role;
|
|
49
|
+
'collection.create.before': CreateCollectionInput;
|
|
50
|
+
'collection.create.after': Collection;
|
|
51
|
+
'collection.create.async': Collection;
|
|
52
|
+
'collection.update.before': UpdateCollectionInput;
|
|
53
|
+
'collection.update.after': Collection;
|
|
54
|
+
'collection.update.async': Collection;
|
|
55
|
+
'collection.executeCollectionDelete.before': void;
|
|
56
|
+
'collection.executeCollectionDelete.after': Collection;
|
|
57
|
+
'collection.executeCollectionDelete.async': Collection;
|
|
58
|
+
'facet.create.before': CreateFacetInput;
|
|
59
|
+
'facet.create.after': Facet;
|
|
60
|
+
'facet.create.async': Facet;
|
|
61
|
+
'facet.update.before': UpdateFacetInput;
|
|
62
|
+
'facet.update.after': Facet;
|
|
63
|
+
'facet.update.async': Facet;
|
|
64
|
+
'facet.executeFacetDelete.before': void;
|
|
65
|
+
'facet.executeFacetDelete.after': Facet;
|
|
66
|
+
'facet.executeFacetDelete.async': Facet;
|
|
67
|
+
'facetValue.create.before': CreateFacetValueInput;
|
|
68
|
+
'facetValue.create.after': FacetValue;
|
|
69
|
+
'facetValue.create.async': FacetValue;
|
|
70
|
+
'facetValue.update.before': UpdateFacetValueInput;
|
|
71
|
+
'facetValue.update.after': FacetValue;
|
|
72
|
+
'facetValue.update.async': FacetValue;
|
|
73
|
+
'facetValue.executeFacetValueDelete.before': void;
|
|
74
|
+
'facetValue.executeFacetValueDelete.after': FacetValue;
|
|
75
|
+
'facetValue.executeFacetValueDelete.async': FacetValue;
|
|
76
|
+
'channel.create.before': CreateChannelInput;
|
|
77
|
+
'channel.create.after': Channel;
|
|
78
|
+
'channel.create.async': Channel;
|
|
79
|
+
'channel.update.before': UpdateChannelInput;
|
|
80
|
+
'channel.update.after': Channel;
|
|
81
|
+
'channel.update.async': Channel;
|
|
82
|
+
'channel.delete.before': string;
|
|
83
|
+
'channel.delete.after': Channel;
|
|
84
|
+
'channel.delete.async': Channel;
|
|
85
|
+
'customer.create.before': CreateCustomerInput;
|
|
86
|
+
'customer.create.after': Customer;
|
|
87
|
+
'customer.create.async': Customer;
|
|
88
|
+
'customer.update.before': UpdateCustomerInput;
|
|
89
|
+
'customer.update.after': Customer;
|
|
90
|
+
'customer.update.async': Customer;
|
|
91
|
+
'customer.performSoftDelete.before': string;
|
|
92
|
+
'customer.performSoftDelete.after': Customer;
|
|
93
|
+
'customer.performSoftDelete.async': Customer;
|
|
94
|
+
'customer.registerCustomerAccount.before': RegisterCustomerInput;
|
|
95
|
+
'customer.registerCustomerAccount.after': Customer;
|
|
96
|
+
'customer.registerCustomerAccount.async': Customer;
|
|
97
|
+
'customer.createCustomerForRegistration.before': void;
|
|
98
|
+
'customer.createCustomerForRegistration.after': Customer;
|
|
99
|
+
'customer.createCustomerForRegistration.async': Customer;
|
|
100
|
+
'customerGroup.create.before': CreateCustomerGroupInput;
|
|
101
|
+
'customerGroup.create.after': CustomerGroup;
|
|
102
|
+
'customerGroup.create.async': CustomerGroup;
|
|
103
|
+
'customerGroup.update.before': UpdateCustomerGroupInput;
|
|
104
|
+
'customerGroup.update.after': CustomerGroup;
|
|
105
|
+
'customerGroup.update.async': CustomerGroup;
|
|
106
|
+
'customerGroup.executeCustomerGroupDelete.before': void;
|
|
107
|
+
'customerGroup.executeCustomerGroupDelete.after': CustomerGroup;
|
|
108
|
+
'customerGroup.executeCustomerGroupDelete.async': CustomerGroup;
|
|
109
|
+
'country.create.before': CreateCountryInput;
|
|
110
|
+
'country.create.after': Country;
|
|
111
|
+
'country.create.async': Country;
|
|
112
|
+
'country.update.before': UpdateCountryInput;
|
|
113
|
+
'country.update.after': Country;
|
|
114
|
+
'country.update.async': Country;
|
|
115
|
+
'country.executeCountryDelete.before': void;
|
|
116
|
+
'country.executeCountryDelete.after': Country;
|
|
117
|
+
'country.executeCountryDelete.async': Country;
|
|
118
|
+
'zone.create.before': CreateZoneInput;
|
|
119
|
+
'zone.create.after': Zone;
|
|
120
|
+
'zone.create.async': Zone;
|
|
121
|
+
'zone.update.before': UpdateZoneInput;
|
|
122
|
+
'zone.update.after': Zone;
|
|
123
|
+
'zone.update.async': Zone;
|
|
124
|
+
'zone.delete.before': string;
|
|
125
|
+
'zone.delete.after': Zone;
|
|
126
|
+
'zone.delete.async': Zone;
|
|
127
|
+
'product.create.before': CreateProductInput;
|
|
128
|
+
'product.create.after': Product;
|
|
129
|
+
'product.create.async': Product;
|
|
130
|
+
'product.update.before': UpdateProductInput;
|
|
131
|
+
'product.update.after': Product;
|
|
132
|
+
'product.update.async': Product;
|
|
133
|
+
'product.executeProductDelete.before': void;
|
|
134
|
+
'product.executeProductDelete.after': Product;
|
|
135
|
+
'product.executeProductDelete.async': Product;
|
|
136
|
+
'productVariant.createSingleVariant.before': CreateProductVariantInput;
|
|
137
|
+
'productVariant.createSingleVariant.after': ProductVariant;
|
|
138
|
+
'productVariant.createSingleVariant.async': ProductVariant;
|
|
139
|
+
'productVariant.updateSingleVariant.before': UpdateProductVariantInput;
|
|
140
|
+
'productVariant.updateSingleVariant.after': ProductVariant;
|
|
141
|
+
'productVariant.updateSingleVariant.async': ProductVariant;
|
|
142
|
+
'productVariant.deleteSingleVariant.before': string;
|
|
143
|
+
'productVariant.deleteSingleVariant.after': ProductVariant;
|
|
144
|
+
'productVariant.deleteSingleVariant.async': ProductVariant;
|
|
145
|
+
'promotion.create.before': CreatePromotionInput;
|
|
146
|
+
'promotion.create.after': Promotion;
|
|
147
|
+
'promotion.create.async': Promotion;
|
|
148
|
+
'promotion.update.before': UpdatePromotionInput;
|
|
149
|
+
'promotion.update.after': Promotion;
|
|
150
|
+
'promotion.update.async': Promotion;
|
|
151
|
+
'promotion.executePromotionDelete.before': void;
|
|
152
|
+
'promotion.executePromotionDelete.after': Promotion;
|
|
153
|
+
'promotion.executePromotionDelete.async': Promotion;
|
|
154
|
+
'seller.create.before': CreateSellerInput;
|
|
155
|
+
'seller.create.after': Seller;
|
|
156
|
+
'seller.create.async': Seller;
|
|
157
|
+
'seller.update.before': UpdateSellerInput;
|
|
158
|
+
'seller.update.after': Seller;
|
|
159
|
+
'seller.update.async': Seller;
|
|
160
|
+
'seller.softDelete.before': string;
|
|
161
|
+
'seller.softDelete.after': Seller;
|
|
162
|
+
'seller.softDelete.async': Seller;
|
|
163
|
+
'stockLocation.create.before': CreateStockLocationInput;
|
|
164
|
+
'stockLocation.create.after': StockLocation;
|
|
165
|
+
'stockLocation.create.async': StockLocation;
|
|
166
|
+
'stockLocation.update.before': UpdateStockLocationInput;
|
|
167
|
+
'stockLocation.update.after': StockLocation;
|
|
168
|
+
'stockLocation.update.async': StockLocation;
|
|
169
|
+
'stockLocation.executeStockLocationDelete.before': void;
|
|
170
|
+
'stockLocation.executeStockLocationDelete.after': StockLocation;
|
|
171
|
+
'stockLocation.executeStockLocationDelete.async': StockLocation;
|
|
172
|
+
'taxCategory.create.before': CreateTaxCategoryInput;
|
|
173
|
+
'taxCategory.create.after': TaxCategory;
|
|
174
|
+
'taxCategory.create.async': TaxCategory;
|
|
175
|
+
'taxCategory.update.before': UpdateTaxCategoryInput;
|
|
176
|
+
'taxCategory.update.after': TaxCategory;
|
|
177
|
+
'taxCategory.update.async': TaxCategory;
|
|
178
|
+
'taxCategory.executeTaxCategoryDelete.before': void;
|
|
179
|
+
'taxCategory.executeTaxCategoryDelete.after': TaxCategory;
|
|
180
|
+
'taxCategory.executeTaxCategoryDelete.async': TaxCategory;
|
|
181
|
+
'taxRate.create.before': CreateTaxRateInput;
|
|
182
|
+
'taxRate.create.after': TaxRate;
|
|
183
|
+
'taxRate.create.async': TaxRate;
|
|
184
|
+
'taxRate.update.before': UpdateTaxRateInput;
|
|
185
|
+
'taxRate.update.after': TaxRate;
|
|
186
|
+
'taxRate.update.async': TaxRate;
|
|
187
|
+
'taxRate.delete.before': string;
|
|
188
|
+
'taxRate.delete.after': TaxRate;
|
|
189
|
+
'taxRate.delete.async': TaxRate;
|
|
190
|
+
'fulfillment.createFulfillment.before': CreateFulfillmentInput;
|
|
191
|
+
'fulfillment.createFulfillment.after': Fulfillment;
|
|
192
|
+
'fulfillment.createFulfillment.async': Fulfillment;
|
|
193
|
+
'fulfillment.executeFulfillmentTransition.before': unknown;
|
|
194
|
+
'fulfillment.executeFulfillmentTransition.after': unknown;
|
|
195
|
+
'fulfillment.executeFulfillmentTransition.async': unknown;
|
|
196
|
+
'order.createDraft.before': void;
|
|
197
|
+
'order.createDraft.after': Order;
|
|
198
|
+
'order.createDraft.async': Order;
|
|
199
|
+
'order.create.before': void;
|
|
200
|
+
'order.create.after': Order;
|
|
201
|
+
'order.create.async': Order;
|
|
202
|
+
'payment.executePaymentTransition.before': unknown;
|
|
203
|
+
'payment.executePaymentTransition.after': unknown;
|
|
204
|
+
'payment.executePaymentTransition.async': unknown;
|
|
205
|
+
'channelPlugin.enable.before': string;
|
|
206
|
+
'channelPlugin.enable.after': ChannelPlugin;
|
|
207
|
+
'channelPlugin.enable.async': ChannelPlugin;
|
|
208
|
+
'channelPlugin.disable.before': string;
|
|
209
|
+
'channelPlugin.disable.after': ChannelPlugin;
|
|
210
|
+
'channelPlugin.disable.async': ChannelPlugin;
|
|
211
|
+
'channelPlugin.updateConfiguration.before': UpdateChannelPluginConfigInput;
|
|
212
|
+
'channelPlugin.updateConfiguration.after': ChannelPlugin;
|
|
213
|
+
'channelPlugin.updateConfiguration.async': ChannelPlugin;
|
|
214
|
+
'history.createForOrder.before': unknown;
|
|
215
|
+
'history.createForOrder.after': HistoryEntry;
|
|
216
|
+
'history.createForOrder.async': HistoryEntry;
|
|
217
|
+
'history.createForCustomer.before': unknown;
|
|
218
|
+
'history.createForCustomer.after': HistoryEntry;
|
|
219
|
+
'history.createForCustomer.async': HistoryEntry;
|
|
220
|
+
'history.updateEntry.before': unknown;
|
|
221
|
+
'history.updateEntry.after': HistoryEntry;
|
|
222
|
+
'history.updateEntry.async': HistoryEntry;
|
|
223
|
+
'history.deleteEntry.before': string;
|
|
224
|
+
'history.deleteEntry.after': HistoryEntry;
|
|
225
|
+
'history.deleteEntry.async': HistoryEntry;
|
|
226
|
+
'audienceSegment.create.before': CreateAudienceSegmentInput;
|
|
227
|
+
'audienceSegment.create.after': AudienceSegment;
|
|
228
|
+
'audienceSegment.create.async': AudienceSegment;
|
|
229
|
+
'audienceSegment.update.before': UpdateAudienceSegmentInput;
|
|
230
|
+
'audienceSegment.update.after': AudienceSegment;
|
|
231
|
+
'audienceSegment.update.async': AudienceSegment;
|
|
232
|
+
'audienceSegment.delete.before': string;
|
|
233
|
+
'audienceSegment.delete.after': AudienceSegment;
|
|
234
|
+
'audienceSegment.delete.async': AudienceSegment;
|
|
235
|
+
'audienceMembership.addIdentityToSegment.before': AddIdentityToSegmentInput;
|
|
236
|
+
'audienceMembership.addIdentityToSegment.after': AudienceMembership;
|
|
237
|
+
'audienceMembership.addIdentityToSegment.async': AudienceMembership;
|
|
238
|
+
'audienceMembership.removeIdentityFromSegment.before': RemoveIdentityFromSegmentInput;
|
|
239
|
+
'audienceMembership.removeIdentityFromSegment.after': AudienceMembership;
|
|
240
|
+
'audienceMembership.removeIdentityFromSegment.async': AudienceMembership;
|
|
241
|
+
}
|
|
242
|
+
export type AdminHookPoint = keyof AdminHookEventMap;
|
|
243
|
+
export type AdminHookHandler<K extends AdminHookPoint> = AdminHookEventMap[K] extends void ? (ctx: TransactionContext) => Promise<void> : (ctx: TransactionContext, payload: AdminHookEventMap[K]) => Promise<void>;
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { ForgeCartAdminClient } from './client.generated';
|
|
2
|
+
export { ForgeCartShopClient } from './client.generated';
|
|
3
|
+
export { ForgeCartClient, ClientError, QueryObservable } from './client.generated';
|
|
4
|
+
export type { GraphQLErrorResponse } from './client.generated';
|
|
5
|
+
export type { ForgeCartAdminClientConfig } from './client.generated';
|
|
6
|
+
export type { ForgeCartShopClientConfig } from './client.generated';
|
|
7
|
+
export type { ForgeCartClientConfig } from './client.generated';
|
|
8
|
+
export { TransactionContext } from './client.generated';
|
|
9
|
+
export { AdminNamespace } from './admin.generated';
|
|
10
|
+
export { ShopNamespace } from './shop.generated';
|
|
11
|
+
export type { ID, Type, ApiExtension, IRequestContext, HookHandler } from './sdk-types.generated';
|
|
12
|
+
export type { IFulfillmentHandler, FulfillmentHandlerCapabilities, OrderLineInput } from './sdk-types.generated';
|
|
13
|
+
export { SdkError, SdkErrorCode } from './sdk-types.generated';
|
|
14
|
+
export type { ConfigurationItem, ManageableConfig, IHookRegistry } from './sdk-plugin.generated';
|
|
15
|
+
export { ForgeCartPlugin } from './sdk-plugin.generated';
|
|
16
|
+
export type { HookDispatchEvent, HookSubscription } from './sdk-hook-subscription.generated';
|
|
17
|
+
export { hookDispatchDocument, hookRespondDocument, HookSubscriptionManager } from './sdk-hook-subscription.generated';
|
|
18
|
+
export type { AdminHookEventMap, AdminHookPoint, AdminHookHandler } from './hook-event-map.generated';
|
|
19
|
+
export type { AcfFieldType } from './admin-types.generated';
|
|
20
|
+
export { extractErrorCode, extractError, extractErrorMessage, isErrorCode } from './error-utils';
|
|
21
|
+
export type { ExtractedError } from './error-utils';
|
|
22
|
+
export { Observable, firstValueFrom, lastValueFrom } from 'rxjs';
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { ForgeCartAdminClient } from './client.generated';
|
|
|
2
2
|
export { ForgeCartShopClient } from './client.generated';
|
|
3
3
|
export { ForgeCartClient, ClientError, QueryObservable } from './client.generated';
|
|
4
4
|
export type { GraphQLErrorResponse } from './client.generated';
|
|
5
|
+
export type { ErrorHandler, LoginSession, LoginSessionChannel, AdminExternalAuthResult, AdminLoginAdministrator } from './client.generated';
|
|
5
6
|
export type { ForgeCartAdminClientConfig } from './client.generated';
|
|
6
7
|
export type { ForgeCartShopClientConfig } from './client.generated';
|
|
7
8
|
export type { ForgeCartClientConfig } from './client.generated';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FILE — DO NOT EDIT
|
|
3
|
+
*
|
|
4
|
+
* This file was generated by @forgecart/client-sdk-generators.
|
|
5
|
+
* Any manual changes will be overwritten on the next generation run.
|
|
6
|
+
*/
|
|
7
|
+
import { Observable } from 'rxjs';
|
|
8
|
+
export interface HookDispatchEvent {
|
|
9
|
+
id: string;
|
|
10
|
+
hookPoint: string;
|
|
11
|
+
transactionToken: string;
|
|
12
|
+
subscriberId: string;
|
|
13
|
+
args: unknown[];
|
|
14
|
+
}
|
|
15
|
+
export declare const hookDispatchDocument = "\n subscription OnHookDispatch($hookPoints: [String!]!) {\n hookDispatched(hookPoints: $hookPoints) {\n id\n hookPoint\n transactionToken\n subscriberId\n args\n }\n }\n";
|
|
16
|
+
export declare const hookRespondDocument = "\n mutation RespondToHook($input: RespondToHookDispatchInput!) {\n respondToHookDispatch(input: $input)\n }\n";
|
|
17
|
+
export interface HookSubscription {
|
|
18
|
+
unsubscribe(): void;
|
|
19
|
+
readonly closed: Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export declare class HookSubscriptionManager<TContext = unknown> {
|
|
22
|
+
private readonly subscribeFn;
|
|
23
|
+
private readonly respondFn;
|
|
24
|
+
private readonly createContext;
|
|
25
|
+
constructor(subscribeFn: (hookPoints: string[]) => Observable<{
|
|
26
|
+
hookDispatched: HookDispatchEvent;
|
|
27
|
+
}>, respondFn: (id: string, subscriberId: string, error?: string) => Observable<unknown>, createContext: (transactionToken: string) => TContext);
|
|
28
|
+
on(hookPoints: string[], handler: (ctx: TContext, payload?: unknown) => Promise<void>): HookSubscription;
|
|
29
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FILE — DO NOT EDIT
|
|
3
|
+
*
|
|
4
|
+
* This file was generated by @forgecart/client-sdk-generators.
|
|
5
|
+
* Any manual changes will be overwritten on the next generation run.
|
|
6
|
+
*/
|
|
7
|
+
import type { Type, ApiExtension, HookHandler } from './sdk-types.generated';
|
|
8
|
+
export interface ConfigurationItem {
|
|
9
|
+
readonly code: string;
|
|
10
|
+
readonly label: string;
|
|
11
|
+
readonly description?: string;
|
|
12
|
+
readonly type: 'string' | 'number' | 'boolean' | 'json';
|
|
13
|
+
readonly defaultValue?: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface ManageableConfig {
|
|
16
|
+
readonly description: string;
|
|
17
|
+
readonly imageUrl?: string;
|
|
18
|
+
readonly tags: string[];
|
|
19
|
+
readonly configurationItems: ConfigurationItem[];
|
|
20
|
+
}
|
|
21
|
+
export interface IHookRegistry {
|
|
22
|
+
on(hookPoint: string, handler: HookHandler, priority?: number): void;
|
|
23
|
+
}
|
|
24
|
+
export declare abstract class ForgeCartPlugin {
|
|
25
|
+
abstract readonly code: string;
|
|
26
|
+
abstract readonly name: string;
|
|
27
|
+
abstract readonly version: string;
|
|
28
|
+
readonly entities: Type[];
|
|
29
|
+
readonly services: Type[];
|
|
30
|
+
readonly resolvers: Type[];
|
|
31
|
+
readonly controllers: Type[];
|
|
32
|
+
readonly adminApiExtensions?: ApiExtension;
|
|
33
|
+
readonly shopApiExtensions?: ApiExtension;
|
|
34
|
+
register(_hooks: IHookRegistry): void;
|
|
35
|
+
onBootstrap(): Promise<void>;
|
|
36
|
+
onShutdown(): Promise<void>;
|
|
37
|
+
readonly manageable?: ManageableConfig;
|
|
38
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FILE — DO NOT EDIT
|
|
3
|
+
*
|
|
4
|
+
* This file was generated by @forgecart/client-sdk-generators.
|
|
5
|
+
* Any manual changes will be overwritten on the next generation run.
|
|
6
|
+
*/
|
|
7
|
+
export type ID = string & {
|
|
8
|
+
readonly __brand?: 'ID';
|
|
9
|
+
};
|
|
10
|
+
export type Type<T = unknown> = new (...args: any[]) => T;
|
|
11
|
+
export interface ApiExtension {
|
|
12
|
+
schema?: unknown;
|
|
13
|
+
resolvers?: Type[];
|
|
14
|
+
}
|
|
15
|
+
/** Minimal RequestContext interface for SDK consumers */
|
|
16
|
+
export interface IRequestContext {
|
|
17
|
+
readonly channelId: string;
|
|
18
|
+
readonly channelToken: string;
|
|
19
|
+
readonly apiType: 'admin' | 'shop';
|
|
20
|
+
readonly languageCode: string;
|
|
21
|
+
readonly hookDepth: number;
|
|
22
|
+
/** Cross-process correlation token set by the platform during hook dispatch */
|
|
23
|
+
readonly transactionToken?: string;
|
|
24
|
+
}
|
|
25
|
+
export type HookHandler = (...args: unknown[]) => Promise<void>;
|
|
26
|
+
export interface FulfillmentHandlerCapabilities {
|
|
27
|
+
supportsTracking: boolean;
|
|
28
|
+
requiresShippingAddress: boolean;
|
|
29
|
+
autoFulfillOnPayment: boolean;
|
|
30
|
+
autoDeliver: boolean;
|
|
31
|
+
autoCreateLabel: boolean;
|
|
32
|
+
supportsReturn: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface OrderLineInput {
|
|
35
|
+
orderLineId: ID;
|
|
36
|
+
variantId: ID;
|
|
37
|
+
quantity: number;
|
|
38
|
+
}
|
|
39
|
+
export interface IFulfillmentHandler {
|
|
40
|
+
readonly code: string;
|
|
41
|
+
readonly name: string;
|
|
42
|
+
getCapabilities(): FulfillmentHandlerCapabilities;
|
|
43
|
+
groupLines(ctx: IRequestContext, lines: OrderLineInput[]): Promise<OrderLineInput[][]>;
|
|
44
|
+
onCreated(ctx: IRequestContext, fulfillment: unknown): Promise<unknown>;
|
|
45
|
+
onStateTransition(ctx: IRequestContext, fulfillment: unknown, fromState: string, toState: string): Promise<unknown>;
|
|
46
|
+
}
|
|
47
|
+
export declare enum SdkErrorCode {
|
|
48
|
+
SERVICE_NOT_FOUND = "SERVICE_NOT_FOUND",
|
|
49
|
+
METHOD_NOT_FOUND = "METHOD_NOT_FOUND",
|
|
50
|
+
WEBSOCKET_TIMEOUT = "WEBSOCKET_TIMEOUT"
|
|
51
|
+
}
|
|
52
|
+
export declare class SdkError extends Error {
|
|
53
|
+
readonly code: SdkErrorCode;
|
|
54
|
+
readonly variables: Record<string, string>;
|
|
55
|
+
constructor(code: SdkErrorCode, variables?: Record<string, string>);
|
|
56
|
+
}
|