@forgecart/sdk 1.202608110054.0 → 1.202608160103.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 +1 -1
- package/dist/admin-client.generated.d.ts +97 -0
- package/dist/admin-client.generated.js +295 -0
- package/dist/admin-types.generated.d.ts +46 -6
- package/dist/admin.d.ts +6 -0
- package/dist/admin.js +11 -1
- package/dist/client.generated.d.ts +0 -148
- package/dist/client.generated.js +22 -478
- package/dist/documents.generated.d.ts +11 -7
- package/dist/documents.generated.js +78 -12
- package/dist/hook-event-map.generated.d.ts +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +10 -9
- package/dist/nest.generated.js +14 -12
- package/dist/shop-client.generated.d.ts +53 -0
- package/dist/shop-client.generated.js +149 -0
- package/dist/shop-types.generated.d.ts +91 -9
- package/dist/shop.d.ts +7 -0
- package/dist/shop.generated.d.ts +12 -2
- package/dist/shop.generated.js +27 -3
- package/dist/shop.js +33 -21
- package/dist/unified-client.generated.d.ts +24 -0
- package/dist/unified-client.generated.js +60 -0
- package/package.json +1 -1
- package/src/admin-client.generated.ts +340 -0
- package/src/admin-types.generated.ts +53 -6
- package/src/admin.ts +6 -0
- package/src/client.generated.ts +19 -552
- package/src/documents.generated.ts +79 -10
- package/src/hook-event-map.generated.ts +1 -1
- package/src/index.ts +5 -4
- package/src/nest.generated.ts +3 -1
- package/src/shop-client.generated.ts +173 -0
- package/src/shop-types.generated.ts +177 -21
- package/src/shop.generated.ts +26 -4
- package/src/shop.ts +7 -0
- package/src/unified-client.generated.ts +70 -0
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ const order = await client.shop.cart.addItemToOrder({ variantId, quantity: 1 });
|
|
|
57
57
|
## Namespaces
|
|
58
58
|
|
|
59
59
|
- `client.admin` — entry, fieldDefinition, publish, acfSchema, acf, administrator, analyticsGateway, asset, audienceMembership, audienceSegment, auth, automation, settings, channel, chat, collection, country, address, group, customerAnalytics, customer, deployment, designerTask, experiment, facet, fulfillmentRequest, fulfillment, hookDispatch, hook, market, marketingAttribution, marketingEvent, marketingIdentity, mission, onboarding, coupon, draft, modification, note, orderAnalytics, order, payment, manageable, plugin, optionGroup, option, productVariant, product, promotion, role, scheduledJob, search, seller, sellingPlan, shipping, stockAnalytics, stock, storefrontRouteTree, subscriptionAnalytics, subscription, tax, transaction, zone
|
|
60
|
-
- `client.shop` — acf, auth, cart, channel, checkout, collection, country, customer, experiment, facet, hookDispatch, hook, marketingEvent, marketingIdentity, order, payment, product, search, sellingPlan, shipping, subscription
|
|
60
|
+
- `client.shop` — acf, address, auth, cart, channel, checkout, collection, country, customer, experiment, facet, hookDispatch, hook, marketingEvent, marketingIdentity, order, payment, product, search, sellingPlan, shipping, subscription
|
|
61
61
|
|
|
62
62
|
## NestJS Integration
|
|
63
63
|
|
|
@@ -0,0 +1,97 @@
|
|
|
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 { AdminNamespace } from './admin.generated';
|
|
8
|
+
import type * as Admin from './admin.generated';
|
|
9
|
+
import type { AdminExternalAuthResult, ErrorHandler, ForgeCartAdminClientConfig, LoginSession, QueryObservable } from './client.generated';
|
|
10
|
+
import type { HookSubscription } from './sdk-hook-subscription.generated';
|
|
11
|
+
import type { AdminHookPoint, AdminHookHandler } from './hook-event-map.generated';
|
|
12
|
+
import type { ShopNamespace } from './shop.generated';
|
|
13
|
+
import type { ForgeCartShopClient } from './shop-client.generated';
|
|
14
|
+
export declare class TransactionContext {
|
|
15
|
+
private readonly _admin;
|
|
16
|
+
private readonly _shop;
|
|
17
|
+
constructor(admin: AdminNamespace, shop?: ShopNamespace);
|
|
18
|
+
get admin(): AdminNamespace;
|
|
19
|
+
get shop(): ShopNamespace;
|
|
20
|
+
}
|
|
21
|
+
export declare class ForgeCartAdminClient {
|
|
22
|
+
private readonly client;
|
|
23
|
+
private readonly _namespace;
|
|
24
|
+
constructor(config: ForgeCartAdminClientConfig);
|
|
25
|
+
setAuthToken(token: string): void;
|
|
26
|
+
getAuthToken(): string | null;
|
|
27
|
+
clearAuthToken(): void;
|
|
28
|
+
setCurrencyCode(currencyCode: string): void;
|
|
29
|
+
clearCurrencyCode(): void;
|
|
30
|
+
setLanguageCode(languageCode: string): void;
|
|
31
|
+
clearLanguageCode(): void;
|
|
32
|
+
setTransactionToken(token: string): void;
|
|
33
|
+
clearTransactionToken(): void;
|
|
34
|
+
setErrorHandler(handler: ErrorHandler): void;
|
|
35
|
+
dispose(): void;
|
|
36
|
+
query<T>(document: string, variables?: Record<string, unknown>): QueryObservable<T>;
|
|
37
|
+
mutate<T>(document: string, variables?: Record<string, unknown>): QueryObservable<T>;
|
|
38
|
+
private shopPeer;
|
|
39
|
+
setShopPeer(shop: ForgeCartShopClient): void;
|
|
40
|
+
createScopedNamespace(transactionToken: string): AdminNamespace;
|
|
41
|
+
withTransaction<T>(fn: (ctx: TransactionContext) => Promise<T>): Promise<T>;
|
|
42
|
+
private hookManager;
|
|
43
|
+
on<K extends AdminHookPoint>(hookPoints: K[], handler: AdminHookHandler<K>): HookSubscription;
|
|
44
|
+
login(emailAddress: string, password: string): Promise<LoginSession>;
|
|
45
|
+
loginWithExternalStrategy(strategyCode: string, data: Record<string, unknown>): Promise<AdminExternalAuthResult>;
|
|
46
|
+
logout(): Promise<void>;
|
|
47
|
+
get acf(): Admin.AcfCategory;
|
|
48
|
+
get acfSchema(): Admin.AcfSchemaCategory;
|
|
49
|
+
get administrator(): Admin.AdministratorCategory;
|
|
50
|
+
get analyticsGateway(): Admin.AnalyticsGatewayCategory;
|
|
51
|
+
get asset(): Admin.AssetCategory;
|
|
52
|
+
get audienceMembership(): Admin.AudienceMembershipCategory;
|
|
53
|
+
get audienceSegment(): Admin.AudienceSegmentCategory;
|
|
54
|
+
get auth(): Admin.AuthCategory;
|
|
55
|
+
get automation(): Admin.AutomationCategory;
|
|
56
|
+
get channel(): Admin.ChannelCategory;
|
|
57
|
+
get chat(): Admin.ChatCategory;
|
|
58
|
+
get collection(): Admin.CollectionCategory;
|
|
59
|
+
get country(): Admin.CountryCategory;
|
|
60
|
+
get customer(): Admin.CustomerCategory;
|
|
61
|
+
get customerAnalytics(): Admin.CustomerAnalyticsCategory;
|
|
62
|
+
get deployment(): Admin.DeploymentCategory;
|
|
63
|
+
get designerTask(): Admin.DesignerTaskCategory;
|
|
64
|
+
get experiment(): Admin.ExperimentCategory;
|
|
65
|
+
get facet(): Admin.FacetCategory;
|
|
66
|
+
get fulfillment(): Admin.FulfillmentCategory;
|
|
67
|
+
get fulfillmentRequest(): Admin.FulfillmentRequestCategory;
|
|
68
|
+
get hook(): Admin.HookCategory;
|
|
69
|
+
get hookDispatch(): Admin.HookDispatchCategory;
|
|
70
|
+
get market(): Admin.MarketCategory;
|
|
71
|
+
get marketingAttribution(): Admin.MarketingAttributionCategory;
|
|
72
|
+
get marketingEvent(): Admin.MarketingEventCategory;
|
|
73
|
+
get marketingIdentity(): Admin.MarketingIdentityCategory;
|
|
74
|
+
get mission(): Admin.MissionCategory;
|
|
75
|
+
get onboarding(): Admin.OnboardingCategory;
|
|
76
|
+
get order(): Admin.OrderCategory;
|
|
77
|
+
get orderAnalytics(): Admin.OrderAnalyticsCategory;
|
|
78
|
+
get payment(): Admin.PaymentCategory;
|
|
79
|
+
get plugin(): Admin.PluginCategory;
|
|
80
|
+
get product(): Admin.ProductCategory;
|
|
81
|
+
get productVariant(): Admin.ProductVariantCategory;
|
|
82
|
+
get promotion(): Admin.PromotionCategory;
|
|
83
|
+
get role(): Admin.RoleCategory;
|
|
84
|
+
get scheduledJob(): Admin.ScheduledJobCategory;
|
|
85
|
+
get search(): Admin.SearchCategory;
|
|
86
|
+
get seller(): Admin.SellerCategory;
|
|
87
|
+
get sellingPlan(): Admin.SellingPlanCategory;
|
|
88
|
+
get shipping(): Admin.ShippingCategory;
|
|
89
|
+
get stock(): Admin.StockCategory;
|
|
90
|
+
get stockAnalytics(): Admin.StockAnalyticsCategory;
|
|
91
|
+
get storefrontRouteTree(): Admin.StorefrontRouteTreeCategory;
|
|
92
|
+
get subscription(): Admin.SubscriptionCategory;
|
|
93
|
+
get subscriptionAnalytics(): Admin.SubscriptionAnalyticsCategory;
|
|
94
|
+
get tax(): Admin.TaxCategory;
|
|
95
|
+
get transaction(): Admin.TransactionCategory;
|
|
96
|
+
get zone(): Admin.ZoneCategory;
|
|
97
|
+
}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* AUTO-GENERATED FILE — DO NOT EDIT
|
|
5
|
+
*
|
|
6
|
+
* This file was generated by @forgecart/client-sdk-generators.
|
|
7
|
+
* Any manual changes will be overwritten on the next generation run.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ForgeCartAdminClient = exports.TransactionContext = void 0;
|
|
11
|
+
const rxjs_1 = require("rxjs");
|
|
12
|
+
const admin_generated_1 = require("./admin.generated");
|
|
13
|
+
const client_generated_1 = require("./client.generated");
|
|
14
|
+
const sdk_hook_subscription_generated_1 = require("./sdk-hook-subscription.generated");
|
|
15
|
+
class TransactionContext {
|
|
16
|
+
_admin;
|
|
17
|
+
_shop;
|
|
18
|
+
constructor(admin, shop) {
|
|
19
|
+
this._admin = admin;
|
|
20
|
+
this._shop = shop;
|
|
21
|
+
}
|
|
22
|
+
get admin() {
|
|
23
|
+
return this._admin;
|
|
24
|
+
}
|
|
25
|
+
get shop() {
|
|
26
|
+
if (!this._shop) {
|
|
27
|
+
throw new Error('SHOP_NAMESPACE_NOT_AVAILABLE');
|
|
28
|
+
}
|
|
29
|
+
return this._shop;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.TransactionContext = TransactionContext;
|
|
33
|
+
class ForgeCartAdminClient {
|
|
34
|
+
client;
|
|
35
|
+
_namespace;
|
|
36
|
+
constructor(config) {
|
|
37
|
+
const headers = { 'forgecart-token': config.channelToken, ...config.headers };
|
|
38
|
+
if (config.adminSecret) {
|
|
39
|
+
headers['forgecart-secret'] = config.adminSecret;
|
|
40
|
+
}
|
|
41
|
+
this.client = new client_generated_1.BaseGraphQLClient(config.endpoint, headers, config.uploadEndpoint, {
|
|
42
|
+
wsEndpoint: config.wsEndpoint,
|
|
43
|
+
currencyCode: config.currencyCode,
|
|
44
|
+
languageCode: config.languageCode,
|
|
45
|
+
});
|
|
46
|
+
this._namespace = new admin_generated_1.AdminNamespace(this.client);
|
|
47
|
+
}
|
|
48
|
+
setAuthToken(token) {
|
|
49
|
+
this.client.setAuthToken(token);
|
|
50
|
+
}
|
|
51
|
+
getAuthToken() {
|
|
52
|
+
return this.client.getAuthToken();
|
|
53
|
+
}
|
|
54
|
+
clearAuthToken() {
|
|
55
|
+
this.client.clearAuthToken();
|
|
56
|
+
}
|
|
57
|
+
setCurrencyCode(currencyCode) {
|
|
58
|
+
this.client.setCurrencyCode(currencyCode);
|
|
59
|
+
}
|
|
60
|
+
clearCurrencyCode() {
|
|
61
|
+
this.client.clearCurrencyCode();
|
|
62
|
+
}
|
|
63
|
+
setLanguageCode(languageCode) {
|
|
64
|
+
this.client.setLanguageCode(languageCode);
|
|
65
|
+
}
|
|
66
|
+
clearLanguageCode() {
|
|
67
|
+
this.client.clearLanguageCode();
|
|
68
|
+
}
|
|
69
|
+
setTransactionToken(token) {
|
|
70
|
+
this.client.setTransactionToken(token);
|
|
71
|
+
}
|
|
72
|
+
clearTransactionToken() {
|
|
73
|
+
this.client.clearTransactionToken();
|
|
74
|
+
}
|
|
75
|
+
setErrorHandler(handler) {
|
|
76
|
+
this.client.setErrorHandler(handler);
|
|
77
|
+
}
|
|
78
|
+
dispose() {
|
|
79
|
+
this.client.dispose();
|
|
80
|
+
}
|
|
81
|
+
query(document, variables) {
|
|
82
|
+
return this.client.query(document, variables);
|
|
83
|
+
}
|
|
84
|
+
mutate(document, variables) {
|
|
85
|
+
return this.client.mutate(document, variables);
|
|
86
|
+
}
|
|
87
|
+
shopPeer = null;
|
|
88
|
+
setShopPeer(shop) {
|
|
89
|
+
this.shopPeer = shop;
|
|
90
|
+
}
|
|
91
|
+
createScopedNamespace(transactionToken) {
|
|
92
|
+
return new admin_generated_1.AdminNamespace(this.client.fork(transactionToken));
|
|
93
|
+
}
|
|
94
|
+
async withTransaction(fn) {
|
|
95
|
+
const result = await (0, rxjs_1.firstValueFrom)(this.transaction.beginTransaction());
|
|
96
|
+
const token = result.beginTransaction.token;
|
|
97
|
+
const adminNs = this.createScopedNamespace(token);
|
|
98
|
+
const shopNs = this.shopPeer?.createScopedNamespace(token);
|
|
99
|
+
const ctx = new TransactionContext(adminNs, shopNs);
|
|
100
|
+
try {
|
|
101
|
+
const value = await fn(ctx);
|
|
102
|
+
await (0, rxjs_1.firstValueFrom)(this.transaction.commitTransaction({ token }));
|
|
103
|
+
return value;
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
await (0, rxjs_1.firstValueFrom)(this.transaction.rollbackTransaction({ token })).catch(() => { });
|
|
107
|
+
throw error;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
hookManager = null;
|
|
111
|
+
on(hookPoints, handler) {
|
|
112
|
+
if (!this.hookManager) {
|
|
113
|
+
this.hookManager = new sdk_hook_subscription_generated_1.HookSubscriptionManager((hp) => this.client.subscribe(sdk_hook_subscription_generated_1.hookDispatchDocument, { hookPoints: hp }), (id, subscriberId, error) => this.client.mutate(sdk_hook_subscription_generated_1.hookRespondDocument, { input: { id, subscriberId, error } }), (token) => {
|
|
114
|
+
const adminNs = this.createScopedNamespace(token);
|
|
115
|
+
const shopNs = this.shopPeer?.createScopedNamespace(token);
|
|
116
|
+
return new TransactionContext(adminNs, shopNs);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return this.hookManager.on(hookPoints, handler);
|
|
120
|
+
}
|
|
121
|
+
async login(emailAddress, password) {
|
|
122
|
+
const result = await (0, rxjs_1.firstValueFrom)(this.auth.login({ input: { emailAddress, password } }));
|
|
123
|
+
this.client.setAuthToken(result.login.token);
|
|
124
|
+
if (this.shopPeer) {
|
|
125
|
+
this.shopPeer.setAuthToken(result.login.token);
|
|
126
|
+
}
|
|
127
|
+
return result.login;
|
|
128
|
+
}
|
|
129
|
+
async loginWithExternalStrategy(strategyCode, data) {
|
|
130
|
+
const result = await (0, rxjs_1.firstValueFrom)(this.auth.authenticateWithExternalStrategy({ input: { strategyCode, data } }));
|
|
131
|
+
this.client.setAuthToken(result.authenticateWithExternalStrategy.session.token);
|
|
132
|
+
if (this.shopPeer) {
|
|
133
|
+
this.shopPeer.setAuthToken(result.authenticateWithExternalStrategy.session.token);
|
|
134
|
+
}
|
|
135
|
+
return result.authenticateWithExternalStrategy;
|
|
136
|
+
}
|
|
137
|
+
async logout() {
|
|
138
|
+
await (0, rxjs_1.firstValueFrom)(this.auth.logout());
|
|
139
|
+
this.client.clearAuthToken();
|
|
140
|
+
if (this.shopPeer) {
|
|
141
|
+
this.shopPeer.clearAuthToken();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
get acf() {
|
|
145
|
+
return this._namespace.acf;
|
|
146
|
+
}
|
|
147
|
+
get acfSchema() {
|
|
148
|
+
return this._namespace.acfSchema;
|
|
149
|
+
}
|
|
150
|
+
get administrator() {
|
|
151
|
+
return this._namespace.administrator;
|
|
152
|
+
}
|
|
153
|
+
get analyticsGateway() {
|
|
154
|
+
return this._namespace.analyticsGateway;
|
|
155
|
+
}
|
|
156
|
+
get asset() {
|
|
157
|
+
return this._namespace.asset;
|
|
158
|
+
}
|
|
159
|
+
get audienceMembership() {
|
|
160
|
+
return this._namespace.audienceMembership;
|
|
161
|
+
}
|
|
162
|
+
get audienceSegment() {
|
|
163
|
+
return this._namespace.audienceSegment;
|
|
164
|
+
}
|
|
165
|
+
get auth() {
|
|
166
|
+
return this._namespace.auth;
|
|
167
|
+
}
|
|
168
|
+
get automation() {
|
|
169
|
+
return this._namespace.automation;
|
|
170
|
+
}
|
|
171
|
+
get channel() {
|
|
172
|
+
return this._namespace.channel;
|
|
173
|
+
}
|
|
174
|
+
get chat() {
|
|
175
|
+
return this._namespace.chat;
|
|
176
|
+
}
|
|
177
|
+
get collection() {
|
|
178
|
+
return this._namespace.collection;
|
|
179
|
+
}
|
|
180
|
+
get country() {
|
|
181
|
+
return this._namespace.country;
|
|
182
|
+
}
|
|
183
|
+
get customer() {
|
|
184
|
+
return this._namespace.customer;
|
|
185
|
+
}
|
|
186
|
+
get customerAnalytics() {
|
|
187
|
+
return this._namespace.customerAnalytics;
|
|
188
|
+
}
|
|
189
|
+
get deployment() {
|
|
190
|
+
return this._namespace.deployment;
|
|
191
|
+
}
|
|
192
|
+
get designerTask() {
|
|
193
|
+
return this._namespace.designerTask;
|
|
194
|
+
}
|
|
195
|
+
get experiment() {
|
|
196
|
+
return this._namespace.experiment;
|
|
197
|
+
}
|
|
198
|
+
get facet() {
|
|
199
|
+
return this._namespace.facet;
|
|
200
|
+
}
|
|
201
|
+
get fulfillment() {
|
|
202
|
+
return this._namespace.fulfillment;
|
|
203
|
+
}
|
|
204
|
+
get fulfillmentRequest() {
|
|
205
|
+
return this._namespace.fulfillmentRequest;
|
|
206
|
+
}
|
|
207
|
+
get hook() {
|
|
208
|
+
return this._namespace.hook;
|
|
209
|
+
}
|
|
210
|
+
get hookDispatch() {
|
|
211
|
+
return this._namespace.hookDispatch;
|
|
212
|
+
}
|
|
213
|
+
get market() {
|
|
214
|
+
return this._namespace.market;
|
|
215
|
+
}
|
|
216
|
+
get marketingAttribution() {
|
|
217
|
+
return this._namespace.marketingAttribution;
|
|
218
|
+
}
|
|
219
|
+
get marketingEvent() {
|
|
220
|
+
return this._namespace.marketingEvent;
|
|
221
|
+
}
|
|
222
|
+
get marketingIdentity() {
|
|
223
|
+
return this._namespace.marketingIdentity;
|
|
224
|
+
}
|
|
225
|
+
get mission() {
|
|
226
|
+
return this._namespace.mission;
|
|
227
|
+
}
|
|
228
|
+
get onboarding() {
|
|
229
|
+
return this._namespace.onboarding;
|
|
230
|
+
}
|
|
231
|
+
get order() {
|
|
232
|
+
return this._namespace.order;
|
|
233
|
+
}
|
|
234
|
+
get orderAnalytics() {
|
|
235
|
+
return this._namespace.orderAnalytics;
|
|
236
|
+
}
|
|
237
|
+
get payment() {
|
|
238
|
+
return this._namespace.payment;
|
|
239
|
+
}
|
|
240
|
+
get plugin() {
|
|
241
|
+
return this._namespace.plugin;
|
|
242
|
+
}
|
|
243
|
+
get product() {
|
|
244
|
+
return this._namespace.product;
|
|
245
|
+
}
|
|
246
|
+
get productVariant() {
|
|
247
|
+
return this._namespace.productVariant;
|
|
248
|
+
}
|
|
249
|
+
get promotion() {
|
|
250
|
+
return this._namespace.promotion;
|
|
251
|
+
}
|
|
252
|
+
get role() {
|
|
253
|
+
return this._namespace.role;
|
|
254
|
+
}
|
|
255
|
+
get scheduledJob() {
|
|
256
|
+
return this._namespace.scheduledJob;
|
|
257
|
+
}
|
|
258
|
+
get search() {
|
|
259
|
+
return this._namespace.search;
|
|
260
|
+
}
|
|
261
|
+
get seller() {
|
|
262
|
+
return this._namespace.seller;
|
|
263
|
+
}
|
|
264
|
+
get sellingPlan() {
|
|
265
|
+
return this._namespace.sellingPlan;
|
|
266
|
+
}
|
|
267
|
+
get shipping() {
|
|
268
|
+
return this._namespace.shipping;
|
|
269
|
+
}
|
|
270
|
+
get stock() {
|
|
271
|
+
return this._namespace.stock;
|
|
272
|
+
}
|
|
273
|
+
get stockAnalytics() {
|
|
274
|
+
return this._namespace.stockAnalytics;
|
|
275
|
+
}
|
|
276
|
+
get storefrontRouteTree() {
|
|
277
|
+
return this._namespace.storefrontRouteTree;
|
|
278
|
+
}
|
|
279
|
+
get subscription() {
|
|
280
|
+
return this._namespace.subscription;
|
|
281
|
+
}
|
|
282
|
+
get subscriptionAnalytics() {
|
|
283
|
+
return this._namespace.subscriptionAnalytics;
|
|
284
|
+
}
|
|
285
|
+
get tax() {
|
|
286
|
+
return this._namespace.tax;
|
|
287
|
+
}
|
|
288
|
+
get transaction() {
|
|
289
|
+
return this._namespace.transaction;
|
|
290
|
+
}
|
|
291
|
+
get zone() {
|
|
292
|
+
return this._namespace.zone;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
exports.ForgeCartAdminClient = ForgeCartAdminClient;
|
|
@@ -220,6 +220,19 @@ export type Address = {
|
|
|
220
220
|
streetLine2?: Maybe<Scalars['String']['output']>;
|
|
221
221
|
updatedAt: Scalars['DateTime']['output'];
|
|
222
222
|
};
|
|
223
|
+
export type AddressAutocompleteInput = {
|
|
224
|
+
countryCode?: InputMaybe<Scalars['String']['input']>;
|
|
225
|
+
query: Scalars['String']['input'];
|
|
226
|
+
sessionToken?: InputMaybe<Scalars['String']['input']>;
|
|
227
|
+
};
|
|
228
|
+
export type AddressSuggestion = {
|
|
229
|
+
description: Scalars['String']['output'];
|
|
230
|
+
id: Scalars['ID']['output'];
|
|
231
|
+
};
|
|
232
|
+
export type AddressSuggestionInput = {
|
|
233
|
+
id: Scalars['ID']['input'];
|
|
234
|
+
sessionToken?: InputMaybe<Scalars['String']['input']>;
|
|
235
|
+
};
|
|
223
236
|
export type AdjustOrderLineInput = {
|
|
224
237
|
orderLineId: Scalars['ID']['input'];
|
|
225
238
|
quantity: Scalars['Int']['input'];
|
|
@@ -636,6 +649,15 @@ export type ChannelDeploymentInfo = {
|
|
|
636
649
|
deployments: Array<DeploymentSummary>;
|
|
637
650
|
providerCode?: Maybe<Scalars['String']['output']>;
|
|
638
651
|
};
|
|
652
|
+
export type ChannelInfo = {
|
|
653
|
+
availableCurrencyCodes?: Maybe<Array<Scalars['String']['output']>>;
|
|
654
|
+
availableLanguageCodes?: Maybe<Array<Scalars['String']['output']>>;
|
|
655
|
+
code: Scalars['String']['output'];
|
|
656
|
+
defaultCurrencyCode: Scalars['String']['output'];
|
|
657
|
+
defaultLanguageCode: Scalars['String']['output'];
|
|
658
|
+
id: Scalars['ID']['output'];
|
|
659
|
+
pricesIncludeTax: Scalars['Boolean']['output'];
|
|
660
|
+
};
|
|
639
661
|
export type ChannelList = {
|
|
640
662
|
items: Array<Channel>;
|
|
641
663
|
totalItems: Scalars['Int']['output'];
|
|
@@ -667,6 +689,7 @@ export type ChannelSettings = {
|
|
|
667
689
|
fxRoundingRule: Scalars['String']['output'];
|
|
668
690
|
id: Scalars['ID']['output'];
|
|
669
691
|
requireCustomerForCheckout: Scalars['Boolean']['output'];
|
|
692
|
+
requireShippingPhone: Scalars['Boolean']['output'];
|
|
670
693
|
requiresShippingAddressValidation: Scalars['Boolean']['output'];
|
|
671
694
|
shopName?: Maybe<Scalars['String']['output']>;
|
|
672
695
|
taxOriginScope: Scalars['String']['output'];
|
|
@@ -1210,6 +1233,7 @@ export type CreateStockLocationInput = {
|
|
|
1210
1233
|
name: Scalars['String']['input'];
|
|
1211
1234
|
};
|
|
1212
1235
|
export type CreateStorefrontPageInput = {
|
|
1236
|
+
copyFromRoutePattern?: InputMaybe<Scalars['String']['input']>;
|
|
1213
1237
|
routePattern: Scalars['String']['input'];
|
|
1214
1238
|
};
|
|
1215
1239
|
export type CreateStorefrontPageResult = {
|
|
@@ -4010,15 +4034,14 @@ export type QuerygetPaymentGatewayTokensArgs = {
|
|
|
4010
4034
|
customerId: Scalars['ID']['input'];
|
|
4011
4035
|
};
|
|
4012
4036
|
export type QuerygetSessionTemplateArgs = {
|
|
4013
|
-
|
|
4014
|
-
providerCode: Scalars['String']['input'];
|
|
4037
|
+
input: SessionTemplateInput;
|
|
4015
4038
|
};
|
|
4016
4039
|
export type QuerygetSessionVariablesArgs = {
|
|
4017
4040
|
orderId: Scalars['ID']['input'];
|
|
4018
4041
|
providerCode: Scalars['String']['input'];
|
|
4019
4042
|
};
|
|
4020
4043
|
export type QuerygetTokenTemplateArgs = {
|
|
4021
|
-
|
|
4044
|
+
input: TokenTemplateInput;
|
|
4022
4045
|
};
|
|
4023
4046
|
export type QuerylowStockVariantsArgs = {
|
|
4024
4047
|
input: LowStockVariantsInput;
|
|
@@ -4608,6 +4631,11 @@ export type SendMissionMessageInput = {
|
|
|
4608
4631
|
message: Scalars['String']['input'];
|
|
4609
4632
|
missionId: Scalars['ID']['input'];
|
|
4610
4633
|
};
|
|
4634
|
+
export type SessionTemplateInput = {
|
|
4635
|
+
orderId: Scalars['ID']['input'];
|
|
4636
|
+
origin?: InputMaybe<Scalars['String']['input']>;
|
|
4637
|
+
providerCode?: InputMaybe<Scalars['String']['input']>;
|
|
4638
|
+
};
|
|
4611
4639
|
export type SetBillingAddressInput = {
|
|
4612
4640
|
address: CreateAddressInput;
|
|
4613
4641
|
orderId: Scalars['ID']['input'];
|
|
@@ -5102,6 +5130,14 @@ export type SubscriptionVariantConfig = {
|
|
|
5102
5130
|
trialPeriodDays: Scalars['Int']['output'];
|
|
5103
5131
|
variant: ProductVariant;
|
|
5104
5132
|
};
|
|
5133
|
+
export type SuggestedAddress = {
|
|
5134
|
+
city?: Maybe<Scalars['String']['output']>;
|
|
5135
|
+
countryCode: Scalars['String']['output'];
|
|
5136
|
+
postalCode?: Maybe<Scalars['String']['output']>;
|
|
5137
|
+
province?: Maybe<Scalars['String']['output']>;
|
|
5138
|
+
streetLine1: Scalars['String']['output'];
|
|
5139
|
+
streetLine2?: Maybe<Scalars['String']['output']>;
|
|
5140
|
+
};
|
|
5105
5141
|
export type Surcharge = {
|
|
5106
5142
|
createdAt: Scalars['DateTime']['output'];
|
|
5107
5143
|
description: Scalars['String']['output'];
|
|
@@ -5162,6 +5198,10 @@ export type TaxRateList = {
|
|
|
5162
5198
|
items: Array<TaxRate>;
|
|
5163
5199
|
totalItems: Scalars['Int']['output'];
|
|
5164
5200
|
};
|
|
5201
|
+
export type TokenTemplateInput = {
|
|
5202
|
+
origin?: InputMaybe<Scalars['String']['input']>;
|
|
5203
|
+
providerCode: Scalars['String']['input'];
|
|
5204
|
+
};
|
|
5165
5205
|
export type ToolResultDetail = {
|
|
5166
5206
|
isError: Scalars['Boolean']['output'];
|
|
5167
5207
|
result: Scalars['String']['output'];
|
|
@@ -5311,6 +5351,7 @@ export type UpdateChannelSettingsInput = {
|
|
|
5311
5351
|
fxMarkupPercent?: InputMaybe<Scalars['Float']['input']>;
|
|
5312
5352
|
fxRoundingRule?: InputMaybe<Scalars['String']['input']>;
|
|
5313
5353
|
requireCustomerForCheckout?: InputMaybe<Scalars['Boolean']['input']>;
|
|
5354
|
+
requireShippingPhone?: InputMaybe<Scalars['Boolean']['input']>;
|
|
5314
5355
|
requiresShippingAddressValidation?: InputMaybe<Scalars['Boolean']['input']>;
|
|
5315
5356
|
shopName?: InputMaybe<Scalars['String']['input']>;
|
|
5316
5357
|
taxOriginScope?: InputMaybe<Scalars['String']['input']>;
|
|
@@ -10135,14 +10176,13 @@ export type CancelSessionMutation = {
|
|
|
10135
10176
|
cancelPaymentSession: Pick<PaymentGatewaySession, 'id' | 'extId' | 'clientSecret' | 'redirectUrl' | 'nonce' | 'status' | 'amount' | 'providerCode' | 'orderId' | 'createdAt' | 'updatedAt'>;
|
|
10136
10177
|
};
|
|
10137
10178
|
export type GetTokenTemplateQueryVariables = Exact<{
|
|
10138
|
-
|
|
10179
|
+
input: TokenTemplateInput;
|
|
10139
10180
|
}>;
|
|
10140
10181
|
export type GetTokenTemplateQuery = {
|
|
10141
10182
|
getTokenTemplate: Pick<PaymentFormTemplate, 'providerCode' | 'html' | 'scriptUrl' | 'config'>;
|
|
10142
10183
|
};
|
|
10143
10184
|
export type GetSessionTemplateQueryVariables = Exact<{
|
|
10144
|
-
|
|
10145
|
-
providerCode: Scalars['String']['input'];
|
|
10185
|
+
input: SessionTemplateInput;
|
|
10146
10186
|
}>;
|
|
10147
10187
|
export type GetSessionTemplateQuery = {
|
|
10148
10188
|
getSessionTemplate: Pick<PaymentFormTemplate, 'providerCode' | 'html' | 'scriptUrl' | 'config'>;
|
package/dist/admin.d.ts
CHANGED
|
@@ -62,4 +62,10 @@ export { SubscriptionAnalyticsCategory } from './admin.generated';
|
|
|
62
62
|
export { TaxCategory } from './admin.generated';
|
|
63
63
|
export { TransactionCategory } from './admin.generated';
|
|
64
64
|
export { ZoneCategory } from './admin.generated';
|
|
65
|
+
export { ForgeCartAdminClient } from './admin-client.generated';
|
|
66
|
+
export type { ForgeCartAdminClientConfig } from './client.generated';
|
|
67
|
+
export { ClientError, QueryObservable } from './client.generated';
|
|
68
|
+
export type { ErrorHandler, GraphQLErrorResponse, LoginSession, LoginSessionChannel } from './client.generated';
|
|
69
|
+
export { extractError, extractErrorCode, extractErrorMessage, isErrorCode } from './error-utils';
|
|
70
|
+
export type { ExtractedError } from './error-utils';
|
|
65
71
|
export type * from './admin-types.generated';
|
package/dist/admin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PromotionCategory = exports.ProductVariantCategory = exports.ProductOptionGroupCategory = exports.ProductOptionCategory = exports.ProductCategory = exports.PluginManageableCategory = exports.PluginCategory = exports.PaymentCategory = exports.OrderAnalyticsCategory = exports.OrderNoteCategory = exports.OrderModificationCategory = exports.OrderDraftCategory = exports.OrderCouponCategory = exports.OrderCategory = exports.OnboardingCategory = exports.MissionCategory = exports.MarketingIdentityCategory = exports.MarketingEventCategory = exports.MarketingAttributionCategory = exports.MarketCategory = exports.HookDispatchCategory = exports.HookCategory = exports.FulfillmentRequestCategory = exports.FulfillmentCategory = exports.FacetCategory = exports.ExperimentCategory = exports.DesignerTaskCategory = exports.DeploymentCategory = exports.CustomerAnalyticsCategory = exports.CustomerGroupCategory = exports.CustomerAddressCategory = exports.CustomerCategory = exports.CountryCategory = exports.CollectionCategory = exports.ChatCategory = exports.ChannelSettingsCategory = exports.ChannelCategory = exports.AutomationCategory = exports.AuthCategory = exports.AudienceSegmentCategory = exports.AudienceMembershipCategory = exports.AssetCategory = exports.AnalyticsGatewayCategory = exports.AdministratorCategory = exports.AcfSchemaCategory = exports.AcfPublishCategory = exports.AcfFieldDefinitionCategory = exports.AcfEntryCategory = exports.AcfCategory = exports.AdminNamespace = void 0;
|
|
4
|
-
exports.ZoneCategory = exports.TransactionCategory = exports.TaxCategory = exports.SubscriptionAnalyticsCategory = exports.SubscriptionCategory = exports.StorefrontRouteTreeCategory = exports.StockAnalyticsCategory = exports.StockCategory = exports.ShippingCategory = exports.SellingPlanCategory = exports.SellerCategory = exports.SearchCategory = exports.ScheduledJobCategory = exports.RoleCategory = void 0;
|
|
4
|
+
exports.isErrorCode = exports.extractErrorMessage = exports.extractErrorCode = exports.extractError = exports.QueryObservable = exports.ClientError = exports.ForgeCartAdminClient = exports.ZoneCategory = exports.TransactionCategory = exports.TaxCategory = exports.SubscriptionAnalyticsCategory = exports.SubscriptionCategory = exports.StorefrontRouteTreeCategory = exports.StockAnalyticsCategory = exports.StockCategory = exports.ShippingCategory = exports.SellingPlanCategory = exports.SellerCategory = exports.SearchCategory = exports.ScheduledJobCategory = exports.RoleCategory = void 0;
|
|
5
5
|
var admin_generated_1 = require("./admin.generated");
|
|
6
6
|
Object.defineProperty(exports, "AdminNamespace", { enumerable: true, get: function () { return admin_generated_1.AdminNamespace; } });
|
|
7
7
|
var admin_generated_2 = require("./admin.generated");
|
|
@@ -130,3 +130,13 @@ var admin_generated_63 = require("./admin.generated");
|
|
|
130
130
|
Object.defineProperty(exports, "TransactionCategory", { enumerable: true, get: function () { return admin_generated_63.TransactionCategory; } });
|
|
131
131
|
var admin_generated_64 = require("./admin.generated");
|
|
132
132
|
Object.defineProperty(exports, "ZoneCategory", { enumerable: true, get: function () { return admin_generated_64.ZoneCategory; } });
|
|
133
|
+
var admin_client_generated_1 = require("./admin-client.generated");
|
|
134
|
+
Object.defineProperty(exports, "ForgeCartAdminClient", { enumerable: true, get: function () { return admin_client_generated_1.ForgeCartAdminClient; } });
|
|
135
|
+
var client_generated_1 = require("./client.generated");
|
|
136
|
+
Object.defineProperty(exports, "ClientError", { enumerable: true, get: function () { return client_generated_1.ClientError; } });
|
|
137
|
+
Object.defineProperty(exports, "QueryObservable", { enumerable: true, get: function () { return client_generated_1.QueryObservable; } });
|
|
138
|
+
var error_utils_1 = require("./error-utils");
|
|
139
|
+
Object.defineProperty(exports, "extractError", { enumerable: true, get: function () { return error_utils_1.extractError; } });
|
|
140
|
+
Object.defineProperty(exports, "extractErrorCode", { enumerable: true, get: function () { return error_utils_1.extractErrorCode; } });
|
|
141
|
+
Object.defineProperty(exports, "extractErrorMessage", { enumerable: true, get: function () { return error_utils_1.extractErrorMessage; } });
|
|
142
|
+
Object.defineProperty(exports, "isErrorCode", { enumerable: true, get: function () { return error_utils_1.isErrorCode; } });
|