@cimplify/sdk 0.106.2 → 0.107.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/dist/advanced.d.mts +3 -3
- package/dist/advanced.d.ts +3 -3
- package/dist/advanced.js +20 -20
- package/dist/advanced.mjs +1 -1
- package/dist/{catalogue-ChBjPPME.d.ts → catalogue-BohD-jU_.d.mts} +44 -38
- package/dist/{catalogue-CVKH9faR.d.mts → catalogue-C4xKpirp.d.ts} +44 -38
- package/dist/{chunk-T3MXI7JD.mjs → chunk-2I6YKE6Q.mjs} +85 -126
- package/dist/{chunk-7O2BBPDM.js → chunk-73HY36Z7.js} +4 -4
- package/dist/{chunk-B7JH5D3J.js → chunk-HKCB73AJ.js} +85 -126
- package/dist/{chunk-4VTFTLH7.mjs → chunk-IWZKCL3P.mjs} +2 -2
- package/dist/{chunk-L4XKIMUO.mjs → chunk-MKZXZDHE.mjs} +17 -0
- package/dist/{chunk-NJK3THWT.js → chunk-NX5YBQZP.js} +17 -0
- package/dist/{chunk-LJAZ7H4I.mjs → chunk-P4HYAV3L.mjs} +102 -82
- package/dist/{chunk-BCLGREHS.js → chunk-W4ZFZPPY.js} +181 -160
- package/dist/{client-BfKFK7cn.d.mts → client-BBFfAtn4.d.mts} +2 -2
- package/dist/{client-DoczTJbs.d.ts → client-ByURQZM9.d.ts} +2 -2
- package/dist/{checkout-XoV4HNg2.d.mts → elements-Dtqe9Ekd.d.mts} +348 -361
- package/dist/{checkout-XoV4HNg2.d.ts → elements-Dtqe9Ekd.d.ts} +348 -361
- package/dist/{index-DEUorPUO.d.mts → index-7oz-hVVA.d.mts} +2 -2
- package/dist/{index-DRMBo26v.d.mts → index-B6mukQYB.d.mts} +2 -2
- package/dist/{index-Dn6xCpDe.d.ts → index-CvLuAMjQ.d.ts} +2 -2
- package/dist/{index-DweR60Cv.d.ts → index-DFqDU6yU.d.ts} +2 -2
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +71 -67
- package/dist/index.mjs +3 -3
- package/dist/mock/cli.mjs +17 -0
- package/dist/mock/library.js +17 -0
- package/dist/mock/library.mjs +17 -0
- package/dist/mock/msw.js +17 -0
- package/dist/mock/msw.mjs +17 -0
- package/dist/{price-De-sxcuj.d.ts → price-B4jL81ef.d.ts} +1 -1
- package/dist/{price-CUGIYRtD.d.mts → price-Pyq-vlrm.d.mts} +1 -1
- package/dist/react.d.mts +3 -3
- package/dist/react.d.ts +3 -3
- package/dist/react.js +34 -34
- package/dist/react.mjs +5 -5
- package/dist/{server-7soMMUgP.d.ts → server-Cowuvfbr.d.ts} +1 -1
- package/dist/{server-DDEJ7e9s.d.mts → server-KilvZJU0.d.mts} +1 -1
- package/dist/server.d.mts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +7 -7
- package/dist/server.mjs +2 -2
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/msw.js +2 -2
- package/dist/testing/msw.mjs +1 -1
- package/dist/testing/suite.d.mts +5 -5
- package/dist/testing/suite.d.ts +5 -5
- package/dist/testing/suite.js +24 -24
- package/dist/testing/suite.mjs +4 -4
- package/dist/testing.d.mts +4 -4
- package/dist/testing.d.ts +4 -4
- package/dist/testing.js +116 -116
- package/dist/testing.mjs +5 -5
- package/dist/utils.d.mts +3 -3
- package/dist/utils.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkXREIZ56K_js = require('./chunk-XREIZ56K.js');
|
|
4
|
-
var
|
|
4
|
+
var chunkHKCB73AJ_js = require('./chunk-HKCB73AJ.js');
|
|
5
5
|
var chunkAVXA4F6G_js = require('./chunk-AVXA4F6G.js');
|
|
6
6
|
|
|
7
7
|
// src/types/observability.ts
|
|
@@ -66,23 +66,23 @@ var PurchaseIntentResolver = class {
|
|
|
66
66
|
const requestOptions = { signal: options.signal, timeoutMs: options.requestTimeoutMs };
|
|
67
67
|
this.ensureActive(options.signal);
|
|
68
68
|
this.notify(options, chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLVE_STATUS.CONFIRMING);
|
|
69
|
-
let responseResult = options.initialResponse ?
|
|
69
|
+
let responseResult = options.initialResponse ? chunkHKCB73AJ_js.ok(options.initialResponse) : await this.confirmation.confirm(intentId, request, requestOptions);
|
|
70
70
|
while (responseResult.ok) {
|
|
71
71
|
this.ensureActive(options.signal);
|
|
72
72
|
const response = responseResult.value;
|
|
73
73
|
switch (response.status) {
|
|
74
74
|
case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.ORDER_CREATED:
|
|
75
75
|
this.notify(options, chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLVE_STATUS.COMPLETED, response);
|
|
76
|
-
return
|
|
76
|
+
return chunkHKCB73AJ_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.COMPLETED, response });
|
|
77
77
|
case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.PAYMENT_FAILED:
|
|
78
78
|
this.notify(options, chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLVE_STATUS.FAILED, response);
|
|
79
|
-
return
|
|
79
|
+
return chunkHKCB73AJ_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.FAILED, response });
|
|
80
80
|
case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.PAYMENT_OUTCOME_UNKNOWN:
|
|
81
81
|
this.notify(options, chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLVE_STATUS.OUTCOME_UNKNOWN, response);
|
|
82
|
-
return
|
|
82
|
+
return chunkHKCB73AJ_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.OUTCOME_UNKNOWN, response });
|
|
83
83
|
case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.COLLECTION_PROCESSING:
|
|
84
84
|
if (pollAttempts >= maxPollAttempts) {
|
|
85
|
-
return
|
|
85
|
+
return chunkHKCB73AJ_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.TIMED_OUT, response });
|
|
86
86
|
}
|
|
87
87
|
pollAttempts += 1;
|
|
88
88
|
this.notify(options, chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLVE_STATUS.POLLING, response);
|
|
@@ -94,16 +94,16 @@ var PurchaseIntentResolver = class {
|
|
|
94
94
|
case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.AUTHORIZATION_REQUIRED: {
|
|
95
95
|
this.notify(options, chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLVE_STATUS.AWAITING_ACTION, response);
|
|
96
96
|
if (!options.onActionRequired || actionSteps >= maxActionSteps) {
|
|
97
|
-
return
|
|
97
|
+
return chunkHKCB73AJ_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.ACTION_REQUIRED, response });
|
|
98
98
|
}
|
|
99
99
|
actionSteps += 1;
|
|
100
100
|
const decision = await options.onActionRequired(response);
|
|
101
101
|
if (decision === chunkAVXA4F6G_js.PURCHASE_INTENT_ACTION_DECISION.STOP) {
|
|
102
|
-
return
|
|
102
|
+
return chunkHKCB73AJ_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.ACTION_REQUIRED, response });
|
|
103
103
|
}
|
|
104
104
|
if (typeof decision === "object" && decision.kind === chunkAVXA4F6G_js.PURCHASE_INTENT_ACTION_DECISION.SUBMIT) {
|
|
105
105
|
if (!this.confirmation.submitAction) {
|
|
106
|
-
return
|
|
106
|
+
return chunkHKCB73AJ_js.err(
|
|
107
107
|
new chunkAVXA4F6G_js.CimplifyError(
|
|
108
108
|
chunkAVXA4F6G_js.PURCHASE_INTENT_ERROR_CODE.ACTION_UNSUPPORTED,
|
|
109
109
|
"This confirmation transport cannot submit purchase-intent actions.",
|
|
@@ -120,7 +120,7 @@ var PurchaseIntentResolver = class {
|
|
|
120
120
|
continue;
|
|
121
121
|
}
|
|
122
122
|
if (decision !== chunkAVXA4F6G_js.PURCHASE_INTENT_ACTION_DECISION.CONTINUE) {
|
|
123
|
-
return
|
|
123
|
+
return chunkHKCB73AJ_js.err(
|
|
124
124
|
new chunkAVXA4F6G_js.CimplifyError(
|
|
125
125
|
chunkAVXA4F6G_js.PURCHASE_INTENT_ERROR_CODE.ACTION_UNSUPPORTED,
|
|
126
126
|
"The action callback returned an unsupported decision.",
|
|
@@ -135,12 +135,12 @@ var PurchaseIntentResolver = class {
|
|
|
135
135
|
case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.TERMS_CHANGED: {
|
|
136
136
|
this.notify(options, chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLVE_STATUS.REVIEWING_TERMS, response);
|
|
137
137
|
if (!options.onTermsChanged || termsReviewSteps >= maxTermsReviewSteps) {
|
|
138
|
-
return
|
|
138
|
+
return chunkHKCB73AJ_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.REVIEW_REQUIRED, response });
|
|
139
139
|
}
|
|
140
140
|
termsReviewSteps += 1;
|
|
141
141
|
const replacementRequest = await options.onTermsChanged(response);
|
|
142
142
|
if (!replacementRequest) {
|
|
143
|
-
return
|
|
143
|
+
return chunkHKCB73AJ_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.REVIEW_REQUIRED, response });
|
|
144
144
|
}
|
|
145
145
|
request = replacementRequest;
|
|
146
146
|
responseResult = await this.confirmation.confirm(intentId, request, requestOptions);
|
|
@@ -149,7 +149,7 @@ var PurchaseIntentResolver = class {
|
|
|
149
149
|
case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.SELECTION_UNAVAILABLE:
|
|
150
150
|
case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.OFFER_ENDED:
|
|
151
151
|
case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.SOURCE_UNAVAILABLE:
|
|
152
|
-
return
|
|
152
|
+
return chunkHKCB73AJ_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.REVIEW_REQUIRED, response });
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
return responseResult;
|
|
@@ -192,7 +192,7 @@ var PurchaseIntentService = class {
|
|
|
192
192
|
this.resolver = new PurchaseIntentResolver({ confirmation: this });
|
|
193
193
|
}
|
|
194
194
|
mint(request, options) {
|
|
195
|
-
return
|
|
195
|
+
return chunkHKCB73AJ_js.safe(
|
|
196
196
|
this.transport.post(PURCHASE_INTENT_ROUTE.DIRECT_COLLECTION, request, {
|
|
197
197
|
idempotencyKey: request.client_intent_key,
|
|
198
198
|
signal: options?.signal,
|
|
@@ -201,7 +201,7 @@ var PurchaseIntentService = class {
|
|
|
201
201
|
);
|
|
202
202
|
}
|
|
203
203
|
get(intentId, options) {
|
|
204
|
-
return
|
|
204
|
+
return chunkHKCB73AJ_js.safe(
|
|
205
205
|
this.transport.get(this.intentPath(intentId), {
|
|
206
206
|
signal: options?.signal,
|
|
207
207
|
timeoutMs: options?.timeoutMs
|
|
@@ -212,7 +212,7 @@ var PurchaseIntentService = class {
|
|
|
212
212
|
const request = {
|
|
213
213
|
expected_intent_revision: expectedRevision
|
|
214
214
|
};
|
|
215
|
-
return
|
|
215
|
+
return chunkHKCB73AJ_js.safe(
|
|
216
216
|
this.transport.post(
|
|
217
217
|
`${this.intentPath(intentId)}/${PURCHASE_INTENT_ROUTE.REFRESH}`,
|
|
218
218
|
request,
|
|
@@ -224,7 +224,7 @@ var PurchaseIntentService = class {
|
|
|
224
224
|
);
|
|
225
225
|
}
|
|
226
226
|
confirm(intentId, request, options) {
|
|
227
|
-
return
|
|
227
|
+
return chunkHKCB73AJ_js.safe(
|
|
228
228
|
this.transport.post(
|
|
229
229
|
`${this.intentPath(intentId)}/${PURCHASE_INTENT_ROUTE.CONFIRM}`,
|
|
230
230
|
request,
|
|
@@ -239,7 +239,7 @@ var PurchaseIntentService = class {
|
|
|
239
239
|
submitAction(intentId, attemptId, request, options) {
|
|
240
240
|
const normalizedAttemptId = attemptId.trim();
|
|
241
241
|
if (!normalizedAttemptId) throw new TypeError("attemptId must not be empty");
|
|
242
|
-
return
|
|
242
|
+
return chunkHKCB73AJ_js.safe(
|
|
243
243
|
this.transport.post(
|
|
244
244
|
`${this.intentPath(intentId)}/${PURCHASE_INTENT_ROUTE.ATTEMPTS}/${encodeURIComponent(normalizedAttemptId)}/${PURCHASE_INTENT_ROUTE.ACTIONS}`,
|
|
245
245
|
request,
|
|
@@ -271,7 +271,7 @@ var HostedPurchaseIntentService = class {
|
|
|
271
271
|
this.resolver = new PurchaseIntentResolver({ confirmation: this });
|
|
272
272
|
}
|
|
273
273
|
prepare(request, options) {
|
|
274
|
-
return
|
|
274
|
+
return chunkHKCB73AJ_js.safe(
|
|
275
275
|
this.transport.post(
|
|
276
276
|
`${this.sessionPath}/${PURCHASE_INTENT_ROUTE.PREPARE}`,
|
|
277
277
|
request,
|
|
@@ -284,7 +284,7 @@ var HostedPurchaseIntentService = class {
|
|
|
284
284
|
);
|
|
285
285
|
}
|
|
286
286
|
confirm(_intentId, request, options) {
|
|
287
|
-
return
|
|
287
|
+
return chunkHKCB73AJ_js.safe(
|
|
288
288
|
this.transport.post(
|
|
289
289
|
`${this.sessionPath}/${PURCHASE_INTENT_ROUTE.CONFIRM}`,
|
|
290
290
|
request,
|
|
@@ -297,7 +297,7 @@ var HostedPurchaseIntentService = class {
|
|
|
297
297
|
);
|
|
298
298
|
}
|
|
299
299
|
replay(options) {
|
|
300
|
-
return
|
|
300
|
+
return chunkHKCB73AJ_js.safe(
|
|
301
301
|
this.transport.get(
|
|
302
302
|
`${this.sessionPath}/${PURCHASE_INTENT_ROUTE.REPLAY}`,
|
|
303
303
|
{
|
|
@@ -310,7 +310,7 @@ var HostedPurchaseIntentService = class {
|
|
|
310
310
|
submitAction(_intentId, attemptId, request, options) {
|
|
311
311
|
const normalized = attemptId.trim();
|
|
312
312
|
if (!normalized) throw new TypeError("attemptId must not be empty");
|
|
313
|
-
return
|
|
313
|
+
return chunkHKCB73AJ_js.safe(
|
|
314
314
|
this.transport.post(
|
|
315
315
|
`${this.sessionPath}/${PURCHASE_INTENT_ROUTE.ATTEMPTS}/${encodeURIComponent(normalized)}/${PURCHASE_INTENT_ROUTE.ACTIONS}`,
|
|
316
316
|
request,
|
|
@@ -336,7 +336,7 @@ var StoreCreditQueries = class {
|
|
|
336
336
|
* currency. Requires a signed-in customer; returns an error otherwise.
|
|
337
337
|
*/
|
|
338
338
|
async balance() {
|
|
339
|
-
return
|
|
339
|
+
return chunkHKCB73AJ_js.safe(this.client.get("/api/v1/store-credit/balance"));
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
342
|
|
|
@@ -712,7 +712,7 @@ var ActivityService = class {
|
|
|
712
712
|
this.sendEvents([event]);
|
|
713
713
|
}
|
|
714
714
|
async getState() {
|
|
715
|
-
return
|
|
715
|
+
return chunkHKCB73AJ_js.safe(this.client.get("/api/v1/activity/state"));
|
|
716
716
|
}
|
|
717
717
|
async getRecommendations(options) {
|
|
718
718
|
const params = new URLSearchParams();
|
|
@@ -720,10 +720,10 @@ var ActivityService = class {
|
|
|
720
720
|
if (options?.limit) params.set("limit", String(options.limit));
|
|
721
721
|
const query = params.toString();
|
|
722
722
|
const path = query ? `/api/v1/activity/recommendations?${query}` : "/api/v1/activity/recommendations";
|
|
723
|
-
return
|
|
723
|
+
return chunkHKCB73AJ_js.safe(this.client.get(path));
|
|
724
724
|
}
|
|
725
725
|
async dismissMessage(code) {
|
|
726
|
-
return
|
|
726
|
+
return chunkHKCB73AJ_js.safe(
|
|
727
727
|
this.client.post("/api/v1/activity/messages/dismiss", { code })
|
|
728
728
|
);
|
|
729
729
|
}
|
|
@@ -829,16 +829,16 @@ var SubscriptionService = class {
|
|
|
829
829
|
this.client = client;
|
|
830
830
|
}
|
|
831
831
|
async list() {
|
|
832
|
-
return
|
|
832
|
+
return chunkHKCB73AJ_js.safe(this.client.get("/api/v1/subscriptions"));
|
|
833
833
|
}
|
|
834
834
|
async get(id) {
|
|
835
835
|
const encodedId = encodeURIComponent(id);
|
|
836
|
-
return
|
|
836
|
+
return chunkHKCB73AJ_js.safe(this.client.get(`/api/v1/subscriptions/${encodedId}`));
|
|
837
837
|
}
|
|
838
838
|
async cancel(id, reason, opts) {
|
|
839
839
|
const encodedId = encodeURIComponent(id);
|
|
840
|
-
const idempotencyKey = opts?.idempotencyKey ??
|
|
841
|
-
return
|
|
840
|
+
const idempotencyKey = opts?.idempotencyKey ?? chunkHKCB73AJ_js.generateIdempotencyKey();
|
|
841
|
+
return chunkHKCB73AJ_js.safe(
|
|
842
842
|
this.client.post(
|
|
843
843
|
`/api/v1/subscriptions/${encodedId}/cancel`,
|
|
844
844
|
{ reason },
|
|
@@ -848,20 +848,20 @@ var SubscriptionService = class {
|
|
|
848
848
|
}
|
|
849
849
|
async pause(id) {
|
|
850
850
|
const encodedId = encodeURIComponent(id);
|
|
851
|
-
return
|
|
851
|
+
return chunkHKCB73AJ_js.safe(
|
|
852
852
|
this.client.post(`/api/v1/subscriptions/${encodedId}/pause`)
|
|
853
853
|
);
|
|
854
854
|
}
|
|
855
855
|
async resume(id) {
|
|
856
856
|
const encodedId = encodeURIComponent(id);
|
|
857
|
-
return
|
|
857
|
+
return chunkHKCB73AJ_js.safe(
|
|
858
858
|
this.client.post(`/api/v1/subscriptions/${encodedId}/resume`)
|
|
859
859
|
);
|
|
860
860
|
}
|
|
861
861
|
async skipNextRenewal(id, opts) {
|
|
862
862
|
const encodedId = encodeURIComponent(id);
|
|
863
|
-
const idempotencyKey = opts?.idempotencyKey ??
|
|
864
|
-
return
|
|
863
|
+
const idempotencyKey = opts?.idempotencyKey ?? chunkHKCB73AJ_js.generateIdempotencyKey();
|
|
864
|
+
return chunkHKCB73AJ_js.safe(
|
|
865
865
|
this.client.post(
|
|
866
866
|
`/api/v1/subscriptions/${encodedId}/skip`,
|
|
867
867
|
void 0,
|
|
@@ -877,8 +877,8 @@ var UploadService = class {
|
|
|
877
877
|
this.client = client;
|
|
878
878
|
}
|
|
879
879
|
async init(filename, contentType2, sizeBytes, opts) {
|
|
880
|
-
const idempotencyKey = opts?.idempotencyKey ??
|
|
881
|
-
return
|
|
880
|
+
const idempotencyKey = opts?.idempotencyKey ?? chunkHKCB73AJ_js.generateIdempotencyKey();
|
|
881
|
+
return chunkHKCB73AJ_js.safe(
|
|
882
882
|
this.client.post(
|
|
883
883
|
"/api/v1/uploads/init",
|
|
884
884
|
{
|
|
@@ -891,7 +891,7 @@ var UploadService = class {
|
|
|
891
891
|
);
|
|
892
892
|
}
|
|
893
893
|
async confirm(uploadId) {
|
|
894
|
-
return
|
|
894
|
+
return chunkHKCB73AJ_js.safe(
|
|
895
895
|
this.client.post("/api/v1/uploads/confirm", {
|
|
896
896
|
upload_id: uploadId
|
|
897
897
|
})
|
|
@@ -937,7 +937,7 @@ var PlacesService = class {
|
|
|
937
937
|
this.client = client;
|
|
938
938
|
}
|
|
939
939
|
async autocomplete(input, sessionToken) {
|
|
940
|
-
return
|
|
940
|
+
return chunkHKCB73AJ_js.safe(
|
|
941
941
|
this.client.post("/api/v1/places/autocomplete", {
|
|
942
942
|
input,
|
|
943
943
|
sessionToken
|
|
@@ -945,7 +945,7 @@ var PlacesService = class {
|
|
|
945
945
|
);
|
|
946
946
|
}
|
|
947
947
|
async details(placeId, sessionToken) {
|
|
948
|
-
return
|
|
948
|
+
return chunkHKCB73AJ_js.safe(
|
|
949
949
|
this.client.post("/api/v1/places/details", {
|
|
950
950
|
place_id: placeId,
|
|
951
951
|
sessionToken
|
|
@@ -964,7 +964,7 @@ var DeliveryService = class {
|
|
|
964
964
|
params.set("dropoff_lat", String(dropoffLat));
|
|
965
965
|
params.set("dropoff_lng", String(dropoffLng));
|
|
966
966
|
if (country) params.set("country", country);
|
|
967
|
-
return
|
|
967
|
+
return chunkHKCB73AJ_js.safe(this.client.get(`/api/v1/delivery/fee?${params.toString()}`));
|
|
968
968
|
}
|
|
969
969
|
async getOptions(queryOrLatitude, longitude, legacyOptions) {
|
|
970
970
|
const query = typeof queryOrLatitude === "number" ? {
|
|
@@ -978,7 +978,7 @@ var DeliveryService = class {
|
|
|
978
978
|
if (query.country) params.set("country", query.country);
|
|
979
979
|
if (query.currency) params.set("currency", query.currency);
|
|
980
980
|
if (query.orderValue != null) params.set("order_value", String(query.orderValue));
|
|
981
|
-
return
|
|
981
|
+
return chunkHKCB73AJ_js.safe(
|
|
982
982
|
this.client.get(`/api/v1/delivery/options?${params.toString()}`)
|
|
983
983
|
);
|
|
984
984
|
}
|
|
@@ -1078,85 +1078,9 @@ function chatRealtimeUpdateFromWire(envelope) {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
|
|
1080
1080
|
// src/support.ts
|
|
1081
|
-
var CLAIM_TIMEOUT_MS = 15e3;
|
|
1082
1081
|
var SupportService = class {
|
|
1083
1082
|
constructor(client) {
|
|
1084
1083
|
this.client = client;
|
|
1085
|
-
this.claimInFlight = null;
|
|
1086
|
-
this.claimInFlightToken = null;
|
|
1087
|
-
this.lastClaimedAccessToken = null;
|
|
1088
|
-
this.claimedName = null;
|
|
1089
|
-
this.client.events.on(chunkB7JH5D3J_js.SESSION_CLEARED, () => {
|
|
1090
|
-
this.lastClaimedAccessToken = null;
|
|
1091
|
-
this.claimedName = null;
|
|
1092
|
-
});
|
|
1093
|
-
this.client.events.on(chunkB7JH5D3J_js.SESSION_CLAIMED, (event) => {
|
|
1094
|
-
if (event.customerName) this.claimedName = event.customerName;
|
|
1095
|
-
});
|
|
1096
|
-
}
|
|
1097
|
-
/** The verified customer this session's conversation was claimed for, null while anonymous. */
|
|
1098
|
-
get claimedCustomerName() {
|
|
1099
|
-
return this.claimedName;
|
|
1100
|
-
}
|
|
1101
|
-
/**
|
|
1102
|
-
* Claim the anonymous session for the verified Link identity: the server
|
|
1103
|
-
* verifies the access token, rotates the session token (adopted here, so
|
|
1104
|
-
* every subsequent request rides the bound session), folds the guest cart
|
|
1105
|
-
* in, and opens or reuses the account's canonical direct Chat thread.
|
|
1106
|
-
*
|
|
1107
|
-
* Idempotent and single-flight: concurrent calls share one request, and a
|
|
1108
|
-
* token already claimed by this instance short-circuits without a network
|
|
1109
|
-
* round trip. A session already bound to another Link account is rejected
|
|
1110
|
-
* rather than transferring that account's cart. Emits `session:claimed` on
|
|
1111
|
-
* the client's event channel.
|
|
1112
|
-
*/
|
|
1113
|
-
async claimConversation() {
|
|
1114
|
-
const accessToken = this.client.getAccessToken();
|
|
1115
|
-
if (!accessToken) {
|
|
1116
|
-
return chunkB7JH5D3J_js.err(new chunkAVXA4F6G_js.CimplifyError("not_authenticated", "No access token to claim with"));
|
|
1117
|
-
}
|
|
1118
|
-
if (this.claimInFlight) {
|
|
1119
|
-
if (this.claimInFlightToken === accessToken) return this.claimInFlight;
|
|
1120
|
-
await this.claimInFlight;
|
|
1121
|
-
return this.claimConversation();
|
|
1122
|
-
}
|
|
1123
|
-
if (this.lastClaimedAccessToken === accessToken) {
|
|
1124
|
-
return chunkB7JH5D3J_js.err(new chunkAVXA4F6G_js.CimplifyError("already_claimed", "Session already claimed for this token"));
|
|
1125
|
-
}
|
|
1126
|
-
const epoch = this.client.getSessionEpoch();
|
|
1127
|
-
this.claimInFlightToken = accessToken;
|
|
1128
|
-
this.claimInFlight = (async () => {
|
|
1129
|
-
const result = await chunkB7JH5D3J_js.safe(
|
|
1130
|
-
this.client.post(
|
|
1131
|
-
"/api/v1/support/conversation/claim",
|
|
1132
|
-
{ access_token: accessToken },
|
|
1133
|
-
{ timeoutMs: CLAIM_TIMEOUT_MS }
|
|
1134
|
-
)
|
|
1135
|
-
);
|
|
1136
|
-
if (result.ok) {
|
|
1137
|
-
if (this.client.getSessionEpoch() !== epoch) {
|
|
1138
|
-
return chunkB7JH5D3J_js.err(
|
|
1139
|
-
new chunkAVXA4F6G_js.CimplifyError("session_cleared", "Session was cleared during the claim")
|
|
1140
|
-
);
|
|
1141
|
-
}
|
|
1142
|
-
this.lastClaimedAccessToken = accessToken;
|
|
1143
|
-
this.claimedName = result.value.customer_name || null;
|
|
1144
|
-
this.client.adoptSessionToken(result.value.session_token);
|
|
1145
|
-
this.client.publishSessionClaimed(this.claimedName);
|
|
1146
|
-
this.client.events.emit(chunkB7JH5D3J_js.SESSION_CLAIMED, {
|
|
1147
|
-
sessionToken: result.value.session_token,
|
|
1148
|
-
threadId: result.value.thread.id,
|
|
1149
|
-
customerName: result.value.customer_name
|
|
1150
|
-
});
|
|
1151
|
-
}
|
|
1152
|
-
return result;
|
|
1153
|
-
})();
|
|
1154
|
-
try {
|
|
1155
|
-
return await this.claimInFlight;
|
|
1156
|
-
} finally {
|
|
1157
|
-
this.claimInFlight = null;
|
|
1158
|
-
this.claimInFlightToken = null;
|
|
1159
|
-
}
|
|
1160
1084
|
}
|
|
1161
1085
|
/**
|
|
1162
1086
|
* Retry verified external-history discovery for the current storefront.
|
|
@@ -1166,9 +1090,9 @@ var SupportService = class {
|
|
|
1166
1090
|
*/
|
|
1167
1091
|
async claimExternalChats() {
|
|
1168
1092
|
if (!this.client.getAccessToken()) {
|
|
1169
|
-
return
|
|
1093
|
+
return chunkHKCB73AJ_js.err(new chunkAVXA4F6G_js.CimplifyError("not_authenticated", "No access token to claim with"));
|
|
1170
1094
|
}
|
|
1171
|
-
return
|
|
1095
|
+
return chunkHKCB73AJ_js.safe(
|
|
1172
1096
|
(async () => {
|
|
1173
1097
|
const businessId = await this.client.resolveBusinessId();
|
|
1174
1098
|
return this.client.post("/v1/me/chats/external-claims", {
|
|
@@ -1183,26 +1107,26 @@ var SupportService = class {
|
|
|
1183
1107
|
* the inbox with empty threads.
|
|
1184
1108
|
*/
|
|
1185
1109
|
async peekConversation() {
|
|
1186
|
-
const result = await
|
|
1110
|
+
const result = await chunkHKCB73AJ_js.safe(
|
|
1187
1111
|
this.client.get("/api/v1/support/conversation")
|
|
1188
1112
|
);
|
|
1189
1113
|
if (!result.ok) return result;
|
|
1190
|
-
if (!result.value.conversation) return
|
|
1191
|
-
return
|
|
1114
|
+
if (!result.value.conversation) return chunkHKCB73AJ_js.ok(null);
|
|
1115
|
+
return chunkHKCB73AJ_js.ok({
|
|
1192
1116
|
conversation: result.value.conversation,
|
|
1193
1117
|
messages: chatMessagesFromWire(result.value.messages)
|
|
1194
1118
|
});
|
|
1195
1119
|
}
|
|
1196
1120
|
/** Open (or resume) the customer's widget conversation. */
|
|
1197
1121
|
async openConversation(opts) {
|
|
1198
|
-
const idempotencyKey = opts?.idempotencyKey ??
|
|
1199
|
-
const result = await
|
|
1122
|
+
const idempotencyKey = opts?.idempotencyKey ?? chunkHKCB73AJ_js.generateIdempotencyKey();
|
|
1123
|
+
const result = await chunkHKCB73AJ_js.safe(
|
|
1200
1124
|
this.client.post("/api/v1/support/conversation", void 0, {
|
|
1201
1125
|
idempotencyKey
|
|
1202
1126
|
})
|
|
1203
1127
|
);
|
|
1204
1128
|
if (!result.ok) return result;
|
|
1205
|
-
return
|
|
1129
|
+
return chunkHKCB73AJ_js.ok({
|
|
1206
1130
|
conversation: result.value.conversation,
|
|
1207
1131
|
messages: chatMessagesFromWire(result.value.messages)
|
|
1208
1132
|
});
|
|
@@ -1216,8 +1140,8 @@ var SupportService = class {
|
|
|
1216
1140
|
* server resolves it thread-scoped and echoes the quote as `reply_to`.
|
|
1217
1141
|
*/
|
|
1218
1142
|
async sendMessage(content, opts) {
|
|
1219
|
-
const idempotencyKey = opts?.idempotencyKey ??
|
|
1220
|
-
const result = await
|
|
1143
|
+
const idempotencyKey = opts?.idempotencyKey ?? chunkHKCB73AJ_js.generateIdempotencyKey();
|
|
1144
|
+
const result = await chunkHKCB73AJ_js.safe(
|
|
1221
1145
|
this.client.post(
|
|
1222
1146
|
"/api/v1/support/conversation/messages",
|
|
1223
1147
|
{
|
|
@@ -1229,7 +1153,7 @@ var SupportService = class {
|
|
|
1229
1153
|
{ idempotencyKey }
|
|
1230
1154
|
)
|
|
1231
1155
|
);
|
|
1232
|
-
return result.ok ?
|
|
1156
|
+
return result.ok ? chunkHKCB73AJ_js.ok(chatMessageFromWire(result.value.message)) : result;
|
|
1233
1157
|
}
|
|
1234
1158
|
/**
|
|
1235
1159
|
* Poll for messages. `after` pages forward (live updates); `before` pages
|
|
@@ -1244,25 +1168,25 @@ var SupportService = class {
|
|
|
1244
1168
|
if (options.limit) params.set("limit", String(options.limit));
|
|
1245
1169
|
const query = params.toString();
|
|
1246
1170
|
const path = query ? `/api/v1/support/conversation/messages?${query}` : "/api/v1/support/conversation/messages";
|
|
1247
|
-
const result = await
|
|
1248
|
-
return result.ok ?
|
|
1171
|
+
const result = await chunkHKCB73AJ_js.safe(this.client.get(path));
|
|
1172
|
+
return result.ok ? chunkHKCB73AJ_js.ok(chatMessagesFromWire(result.value)) : result;
|
|
1249
1173
|
}
|
|
1250
1174
|
/** React to a message in the active conversation by its `ChatMessage.id`. */
|
|
1251
1175
|
async reactToMessage(messageId, emoji) {
|
|
1252
|
-
const clientId =
|
|
1253
|
-
const result = await
|
|
1176
|
+
const clientId = chunkHKCB73AJ_js.generateIdempotencyKey();
|
|
1177
|
+
const result = await chunkHKCB73AJ_js.safe(
|
|
1254
1178
|
this.client.post(
|
|
1255
1179
|
`/api/v1/support/conversation/messages/${messageId}/reactions`,
|
|
1256
1180
|
{ emoji, client_id: clientId },
|
|
1257
1181
|
{ idempotencyKey: clientId }
|
|
1258
1182
|
)
|
|
1259
1183
|
);
|
|
1260
|
-
return result.ok ?
|
|
1184
|
+
return result.ok ? chunkHKCB73AJ_js.ok(chatMessageFromWire(result.value.message)) : result;
|
|
1261
1185
|
}
|
|
1262
1186
|
/** Ask for a person: flags the thread for the merchant's inbox. */
|
|
1263
1187
|
async requestHuman(opts) {
|
|
1264
|
-
const idempotencyKey = opts?.idempotencyKey ??
|
|
1265
|
-
return
|
|
1188
|
+
const idempotencyKey = opts?.idempotencyKey ?? chunkHKCB73AJ_js.generateIdempotencyKey();
|
|
1189
|
+
return chunkHKCB73AJ_js.safe(
|
|
1266
1190
|
this.client.post(
|
|
1267
1191
|
"/api/v1/support/conversation/handoff",
|
|
1268
1192
|
void 0,
|
|
@@ -1272,6 +1196,95 @@ var SupportService = class {
|
|
|
1272
1196
|
}
|
|
1273
1197
|
};
|
|
1274
1198
|
|
|
1199
|
+
// src/session.ts
|
|
1200
|
+
var CLAIM_TIMEOUT_MS = 15e3;
|
|
1201
|
+
var CLAIM_PATH = "/api/v1/auth/session/claim";
|
|
1202
|
+
var SessionService = class {
|
|
1203
|
+
constructor(client) {
|
|
1204
|
+
this.client = client;
|
|
1205
|
+
this.claimInFlight = null;
|
|
1206
|
+
this.claimInFlightToken = null;
|
|
1207
|
+
this.lastClaimedAccessToken = null;
|
|
1208
|
+
this.claimedName = null;
|
|
1209
|
+
this.client.events.on(chunkHKCB73AJ_js.SESSION_CLEARED, () => {
|
|
1210
|
+
this.lastClaimedAccessToken = null;
|
|
1211
|
+
this.claimedName = null;
|
|
1212
|
+
});
|
|
1213
|
+
this.client.events.on(chunkHKCB73AJ_js.SESSION_CLAIMED, (event) => {
|
|
1214
|
+
if (event.customerName) this.claimedName = event.customerName;
|
|
1215
|
+
});
|
|
1216
|
+
}
|
|
1217
|
+
/** The verified customer this session is bound to, null while anonymous. */
|
|
1218
|
+
get claimedCustomerName() {
|
|
1219
|
+
return this.claimedName;
|
|
1220
|
+
}
|
|
1221
|
+
/** Adopt a session another holder already bound for this bearer. */
|
|
1222
|
+
adopt(accessToken, session) {
|
|
1223
|
+
this.lastClaimedAccessToken = accessToken;
|
|
1224
|
+
this.claimedName = session.customerName || null;
|
|
1225
|
+
this.client.adoptSessionToken(session.sessionToken);
|
|
1226
|
+
this.client.publishSessionClaimed(this.claimedName);
|
|
1227
|
+
this.client.events.emit(chunkHKCB73AJ_js.SESSION_CLAIMED, session);
|
|
1228
|
+
}
|
|
1229
|
+
/**
|
|
1230
|
+
* Bind the anonymous session to the verified Link identity in one server
|
|
1231
|
+
* transaction: verify the bearer, rotate the session token (adopted here),
|
|
1232
|
+
* fold the guest cart under the customer and re-price it. A repeat for the
|
|
1233
|
+
* same account and session returns the same session.
|
|
1234
|
+
*
|
|
1235
|
+
* Idempotent and single-flight: concurrent calls share one request, and a
|
|
1236
|
+
* token already claimed by this instance short-circuits without a network
|
|
1237
|
+
* round trip. A session already bound to another Link account is rejected
|
|
1238
|
+
* rather than transferring that account's cart. Emits `session:claimed` on
|
|
1239
|
+
* the client's event channel.
|
|
1240
|
+
*/
|
|
1241
|
+
async claim() {
|
|
1242
|
+
const accessToken = this.client.getAccessToken();
|
|
1243
|
+
if (!accessToken) {
|
|
1244
|
+
return chunkHKCB73AJ_js.err(new chunkAVXA4F6G_js.CimplifyError("not_authenticated", "No access token to claim with"));
|
|
1245
|
+
}
|
|
1246
|
+
if (this.claimInFlight) {
|
|
1247
|
+
if (this.claimInFlightToken === accessToken) return this.claimInFlight;
|
|
1248
|
+
await this.claimInFlight;
|
|
1249
|
+
return this.claim();
|
|
1250
|
+
}
|
|
1251
|
+
if (this.lastClaimedAccessToken === accessToken) {
|
|
1252
|
+
return chunkHKCB73AJ_js.err(new chunkAVXA4F6G_js.CimplifyError("already_claimed", "Session already claimed for this token"));
|
|
1253
|
+
}
|
|
1254
|
+
const epoch = this.client.getSessionEpoch();
|
|
1255
|
+
this.claimInFlightToken = accessToken;
|
|
1256
|
+
this.claimInFlight = (async () => {
|
|
1257
|
+
const result = await chunkHKCB73AJ_js.safe(
|
|
1258
|
+
this.client.post(
|
|
1259
|
+
CLAIM_PATH,
|
|
1260
|
+
{ access_token: accessToken },
|
|
1261
|
+
{ timeoutMs: CLAIM_TIMEOUT_MS }
|
|
1262
|
+
)
|
|
1263
|
+
);
|
|
1264
|
+
if (result.ok) {
|
|
1265
|
+
if (this.client.getSessionEpoch() !== epoch) {
|
|
1266
|
+
return chunkHKCB73AJ_js.err(
|
|
1267
|
+
new chunkAVXA4F6G_js.CimplifyError("session_cleared", "Session was cleared during the claim")
|
|
1268
|
+
);
|
|
1269
|
+
}
|
|
1270
|
+
this.adopt(accessToken, {
|
|
1271
|
+
sessionToken: result.value.session_token,
|
|
1272
|
+
customerName: result.value.customer.name,
|
|
1273
|
+
customer: result.value.customer,
|
|
1274
|
+
cart: result.value.cart
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
return result;
|
|
1278
|
+
})();
|
|
1279
|
+
try {
|
|
1280
|
+
return await this.claimInFlight;
|
|
1281
|
+
} finally {
|
|
1282
|
+
this.claimInFlight = null;
|
|
1283
|
+
this.claimInFlightToken = null;
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1275
1288
|
// src/internal/cross-tab-session.ts
|
|
1276
1289
|
var CROSS_TAB_SESSION_HUB_KEY = /* @__PURE__ */ Symbol.for("@cimplify/sdk.cross-tab-session-hub");
|
|
1277
1290
|
var SESSION_SYNC_STORAGE_KEY = "cimplify_session_sync";
|
|
@@ -1535,7 +1548,7 @@ var CimplifyClient = class {
|
|
|
1535
1548
|
* Sentry, analytics, etc.). The SDK emits but never auto-consumes — the
|
|
1536
1549
|
* consumer decides how to react.
|
|
1537
1550
|
*/
|
|
1538
|
-
this.events =
|
|
1551
|
+
this.events = chunkHKCB73AJ_js.createClientEvents();
|
|
1539
1552
|
this.stopPageViewTracking = null;
|
|
1540
1553
|
this.publicKey = config.publicKey || getEnvPublicKey() || "";
|
|
1541
1554
|
const urls = deriveUrls();
|
|
@@ -1546,7 +1559,7 @@ var CimplifyClient = class {
|
|
|
1546
1559
|
this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
1547
1560
|
this.retryDelay = config.retryDelay ?? DEFAULT_RETRY_DELAY_MS;
|
|
1548
1561
|
this.hooks = config.hooks ?? {};
|
|
1549
|
-
this.authorizationAdapters = config.authorizationAdapterRegistry ??
|
|
1562
|
+
this.authorizationAdapters = config.authorizationAdapterRegistry ?? chunkHKCB73AJ_js.createDefaultPaymentAuthorizationAdapterRegistry();
|
|
1550
1563
|
this.fetchImpl = (config.fetch ?? globalThis.fetch).bind(globalThis);
|
|
1551
1564
|
this.sessionToken = this.loadSessionToken() ?? this.mintSessionToken();
|
|
1552
1565
|
const persistedSessionSync = this.loadSessionSyncPayload();
|
|
@@ -1615,7 +1628,7 @@ var CimplifyClient = class {
|
|
|
1615
1628
|
newToken: token,
|
|
1616
1629
|
source: SESSION_CHANGE_SOURCE.MANUAL
|
|
1617
1630
|
});
|
|
1618
|
-
this.events.emit(
|
|
1631
|
+
this.events.emit(chunkHKCB73AJ_js.AUTH_TOKEN_CHANGED, { token });
|
|
1619
1632
|
}
|
|
1620
1633
|
/**
|
|
1621
1634
|
* Zero-UI claim: a freshly verified customer identity (OTP verify, silent
|
|
@@ -1625,9 +1638,9 @@ var CimplifyClient = class {
|
|
|
1625
1638
|
* merchant auth flows, never by the raw token setter. Global Link clients
|
|
1626
1639
|
* have no storefront tenant and therefore activate without this step.
|
|
1627
1640
|
*/
|
|
1628
|
-
|
|
1641
|
+
autoClaimSession() {
|
|
1629
1642
|
if (typeof window === "undefined" || !this.sessionToken || !this.accessToken) return;
|
|
1630
|
-
void this.
|
|
1643
|
+
void this.session.claim();
|
|
1631
1644
|
}
|
|
1632
1645
|
/**
|
|
1633
1646
|
* Adopt a server-rotated session token (claim flow). The old token stays
|
|
@@ -1659,8 +1672,8 @@ var CimplifyClient = class {
|
|
|
1659
1672
|
newToken: null,
|
|
1660
1673
|
source: SESSION_CHANGE_SOURCE.CLEAR
|
|
1661
1674
|
});
|
|
1662
|
-
this.events.emit(
|
|
1663
|
-
this.events.emit(
|
|
1675
|
+
this.events.emit(chunkHKCB73AJ_js.AUTH_TOKEN_CHANGED, { token: null });
|
|
1676
|
+
this.events.emit(chunkHKCB73AJ_js.SESSION_CLEARED, {});
|
|
1664
1677
|
}
|
|
1665
1678
|
getSessionEpoch() {
|
|
1666
1679
|
return this.sessionEpoch;
|
|
@@ -1713,18 +1726,19 @@ var CimplifyClient = class {
|
|
|
1713
1726
|
if (payload.type === "claimed") {
|
|
1714
1727
|
this.sessionToken = payload.token;
|
|
1715
1728
|
this.sessionEpoch++;
|
|
1716
|
-
this.events.emit(
|
|
1729
|
+
this.events.emit(chunkHKCB73AJ_js.SESSION_CLAIMED, {
|
|
1717
1730
|
sessionToken: payload.token,
|
|
1718
|
-
|
|
1719
|
-
|
|
1731
|
+
customerName: payload.name ?? "",
|
|
1732
|
+
customer: null,
|
|
1733
|
+
cart: null
|
|
1720
1734
|
});
|
|
1721
1735
|
} else {
|
|
1722
1736
|
this.accessToken = null;
|
|
1723
1737
|
this._activity?.resetSession();
|
|
1724
1738
|
this.sessionToken = payload.token;
|
|
1725
1739
|
this.sessionEpoch++;
|
|
1726
|
-
this.events.emit(
|
|
1727
|
-
this.events.emit(
|
|
1740
|
+
this.events.emit(chunkHKCB73AJ_js.AUTH_TOKEN_CHANGED, { token: null });
|
|
1741
|
+
this.events.emit(chunkHKCB73AJ_js.SESSION_CLEARED, {});
|
|
1728
1742
|
}
|
|
1729
1743
|
}
|
|
1730
1744
|
observeSessionSync(payload) {
|
|
@@ -1817,7 +1831,7 @@ var CimplifyClient = class {
|
|
|
1817
1831
|
if (this.accessToken !== null) {
|
|
1818
1832
|
this.setAccessToken(null);
|
|
1819
1833
|
}
|
|
1820
|
-
this.events.emit(
|
|
1834
|
+
this.events.emit(chunkHKCB73AJ_js.SESSION_CLEARED, {});
|
|
1821
1835
|
if (restartPageViewTracking) {
|
|
1822
1836
|
this.stopPageViewTracking = this.activity.autoTrackPageViews();
|
|
1823
1837
|
}
|
|
@@ -2261,19 +2275,19 @@ var CimplifyClient = class {
|
|
|
2261
2275
|
}
|
|
2262
2276
|
get catalogue() {
|
|
2263
2277
|
if (!this._catalogue) {
|
|
2264
|
-
this._catalogue = new
|
|
2278
|
+
this._catalogue = new chunkHKCB73AJ_js.CatalogueQueries(this);
|
|
2265
2279
|
}
|
|
2266
2280
|
return this._catalogue;
|
|
2267
2281
|
}
|
|
2268
2282
|
get cart() {
|
|
2269
2283
|
if (!this._cart) {
|
|
2270
|
-
this._cart = new
|
|
2284
|
+
this._cart = new chunkHKCB73AJ_js.CartOperations(this);
|
|
2271
2285
|
}
|
|
2272
2286
|
return this._cart;
|
|
2273
2287
|
}
|
|
2274
2288
|
get checkout() {
|
|
2275
2289
|
if (!this._checkout) {
|
|
2276
|
-
this._checkout = new
|
|
2290
|
+
this._checkout = new chunkHKCB73AJ_js.CheckoutService(this);
|
|
2277
2291
|
}
|
|
2278
2292
|
return this._checkout;
|
|
2279
2293
|
}
|
|
@@ -2285,7 +2299,7 @@ var CimplifyClient = class {
|
|
|
2285
2299
|
}
|
|
2286
2300
|
get orders() {
|
|
2287
2301
|
if (!this._orders) {
|
|
2288
|
-
this._orders = new
|
|
2302
|
+
this._orders = new chunkHKCB73AJ_js.OrderQueries(this);
|
|
2289
2303
|
}
|
|
2290
2304
|
return this._orders;
|
|
2291
2305
|
}
|
|
@@ -2315,43 +2329,43 @@ var CimplifyClient = class {
|
|
|
2315
2329
|
}
|
|
2316
2330
|
get link() {
|
|
2317
2331
|
if (!this._link) {
|
|
2318
|
-
this._link = new
|
|
2332
|
+
this._link = new chunkHKCB73AJ_js.LinkService(this);
|
|
2319
2333
|
}
|
|
2320
2334
|
return this._link;
|
|
2321
2335
|
}
|
|
2322
2336
|
get auth() {
|
|
2323
2337
|
if (!this._auth) {
|
|
2324
|
-
this._auth = new
|
|
2338
|
+
this._auth = new chunkHKCB73AJ_js.AuthService(this);
|
|
2325
2339
|
}
|
|
2326
2340
|
return this._auth;
|
|
2327
2341
|
}
|
|
2328
2342
|
get business() {
|
|
2329
2343
|
if (!this._business) {
|
|
2330
|
-
this._business = new
|
|
2344
|
+
this._business = new chunkHKCB73AJ_js.BusinessService(this);
|
|
2331
2345
|
}
|
|
2332
2346
|
return this._business;
|
|
2333
2347
|
}
|
|
2334
2348
|
get inventory() {
|
|
2335
2349
|
if (!this._inventory) {
|
|
2336
|
-
this._inventory = new
|
|
2350
|
+
this._inventory = new chunkHKCB73AJ_js.InventoryService(this);
|
|
2337
2351
|
}
|
|
2338
2352
|
return this._inventory;
|
|
2339
2353
|
}
|
|
2340
2354
|
get scheduling() {
|
|
2341
2355
|
if (!this._scheduling) {
|
|
2342
|
-
this._scheduling = new
|
|
2356
|
+
this._scheduling = new chunkHKCB73AJ_js.SchedulingService(this);
|
|
2343
2357
|
}
|
|
2344
2358
|
return this._scheduling;
|
|
2345
2359
|
}
|
|
2346
2360
|
get lite() {
|
|
2347
2361
|
if (!this._lite) {
|
|
2348
|
-
this._lite = new
|
|
2362
|
+
this._lite = new chunkHKCB73AJ_js.LiteService(this);
|
|
2349
2363
|
}
|
|
2350
2364
|
return this._lite;
|
|
2351
2365
|
}
|
|
2352
2366
|
get fx() {
|
|
2353
2367
|
if (!this._fx) {
|
|
2354
|
-
this._fx = new
|
|
2368
|
+
this._fx = new chunkHKCB73AJ_js.FxService(this);
|
|
2355
2369
|
}
|
|
2356
2370
|
return this._fx;
|
|
2357
2371
|
}
|
|
@@ -2373,6 +2387,12 @@ var CimplifyClient = class {
|
|
|
2373
2387
|
}
|
|
2374
2388
|
return this._support;
|
|
2375
2389
|
}
|
|
2390
|
+
get session() {
|
|
2391
|
+
if (!this._session) {
|
|
2392
|
+
this._session = new SessionService(this);
|
|
2393
|
+
}
|
|
2394
|
+
return this._session;
|
|
2395
|
+
}
|
|
2376
2396
|
buildWsUrl(path) {
|
|
2377
2397
|
const protocol = this.baseUrl.startsWith("https") ? "wss:" : "ws:";
|
|
2378
2398
|
const host = this.baseUrl.replace(/^https?:\/\//, "");
|
|
@@ -2386,7 +2406,7 @@ var CimplifyClient = class {
|
|
|
2386
2406
|
if (businessId) {
|
|
2387
2407
|
this.setBusinessId(businessId);
|
|
2388
2408
|
}
|
|
2389
|
-
return
|
|
2409
|
+
return chunkHKCB73AJ_js.createElements(this, businessId ?? this.businessId ?? void 0, options);
|
|
2390
2410
|
}
|
|
2391
2411
|
};
|
|
2392
2412
|
function createCimplifyClient(config = {}) {
|
|
@@ -2402,6 +2422,7 @@ exports.PlacesService = PlacesService;
|
|
|
2402
2422
|
exports.PurchaseIntentResolver = PurchaseIntentResolver;
|
|
2403
2423
|
exports.PurchaseIntentService = PurchaseIntentService;
|
|
2404
2424
|
exports.SESSION_CHANGE_SOURCE = SESSION_CHANGE_SOURCE;
|
|
2425
|
+
exports.SessionService = SessionService;
|
|
2405
2426
|
exports.StoreCreditQueries = StoreCreditQueries;
|
|
2406
2427
|
exports.SubscriptionService = SubscriptionService;
|
|
2407
2428
|
exports.SupportService = SupportService;
|