@cimplify/sdk 0.68.0 → 0.70.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 +3 -2
- package/dist/advanced.d.mts +1 -1
- package/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +20 -20
- package/dist/advanced.mjs +1 -1
- package/dist/{chunk-TAKORJP4.mjs → chunk-6XXVA3IV.mjs} +2 -2
- package/dist/{chunk-WCSAZRNC.js → chunk-BCWPRPK7.js} +10 -0
- package/dist/{chunk-KNPE4WCQ.mjs → chunk-EAVXSFAB.mjs} +1 -1
- package/dist/{chunk-SXGFJEME.js → chunk-I4MP2XZS.js} +73 -7
- package/dist/{chunk-SOV4H6PQ.mjs → chunk-M2CXZQHS.mjs} +10 -0
- package/dist/{chunk-FVGVJ4TC.mjs → chunk-O3ECKVOM.mjs} +73 -7
- package/dist/{chunk-5HAUJBOK.js → chunk-QZQEGRGB.js} +35 -35
- package/dist/{chunk-NGQCWFKF.js → chunk-SC5DUKGD.js} +4 -4
- package/dist/{client-CBE7ksYC.d.mts → client-BRGGjeny.d.mts} +1 -1
- package/dist/{client-Dyo3dvNy.d.mts → client-DRJvXz54.d.mts} +181 -21
- package/dist/{client-DlXfZy7N.d.ts → client-Des_GqmQ.d.ts} +1 -1
- package/dist/{client-CfeQRwhl.d.ts → client-DjQhg6yr.d.ts} +181 -21
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +68 -68
- package/dist/index.mjs +3 -3
- package/dist/mock/cli.mjs +73 -7
- package/dist/mock/library.js +73 -7
- package/dist/mock/library.mjs +73 -7
- package/dist/mock/msw.js +73 -7
- package/dist/mock/msw.mjs +73 -7
- package/dist/react.d.mts +166 -2
- package/dist/react.d.ts +166 -2
- package/dist/react.js +1223 -493
- package/dist/react.mjs +801 -79
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +7 -7
- package/dist/server.mjs +2 -2
- package/dist/styles.css +1 -1
- package/dist/testing/msw.js +2 -2
- package/dist/testing/msw.mjs +1 -1
- package/dist/testing/suite.d.mts +2 -2
- package/dist/testing/suite.d.ts +2 -2
- package/dist/testing/suite.js +23 -23
- package/dist/testing/suite.mjs +4 -4
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +79 -79
- package/dist/testing.mjs +5 -5
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkBCWPRPK7_js = require('./chunk-BCWPRPK7.js');
|
|
4
4
|
var chunkXA3ZNR75_js = require('./chunk-XA3ZNR75.js');
|
|
5
5
|
|
|
6
6
|
// src/activity.ts
|
|
@@ -29,7 +29,7 @@ var ActivityService = class {
|
|
|
29
29
|
this.sendEvents([event]);
|
|
30
30
|
}
|
|
31
31
|
async getState() {
|
|
32
|
-
return
|
|
32
|
+
return chunkBCWPRPK7_js.safe(this.client.get("/api/v1/activity/state"));
|
|
33
33
|
}
|
|
34
34
|
async getRecommendations(options) {
|
|
35
35
|
const params = new URLSearchParams();
|
|
@@ -37,10 +37,10 @@ var ActivityService = class {
|
|
|
37
37
|
if (options?.limit) params.set("limit", String(options.limit));
|
|
38
38
|
const query = params.toString();
|
|
39
39
|
const path = query ? `/api/v1/activity/recommendations?${query}` : "/api/v1/activity/recommendations";
|
|
40
|
-
return
|
|
40
|
+
return chunkBCWPRPK7_js.safe(this.client.get(path));
|
|
41
41
|
}
|
|
42
42
|
async dismissMessage(code) {
|
|
43
|
-
return
|
|
43
|
+
return chunkBCWPRPK7_js.safe(
|
|
44
44
|
this.client.post("/api/v1/activity/messages/dismiss", { code })
|
|
45
45
|
);
|
|
46
46
|
}
|
|
@@ -62,16 +62,16 @@ var SubscriptionService = class {
|
|
|
62
62
|
this.client = client;
|
|
63
63
|
}
|
|
64
64
|
async list() {
|
|
65
|
-
return
|
|
65
|
+
return chunkBCWPRPK7_js.safe(this.client.get("/api/v1/subscriptions"));
|
|
66
66
|
}
|
|
67
67
|
async get(id) {
|
|
68
68
|
const encodedId = encodeURIComponent(id);
|
|
69
|
-
return
|
|
69
|
+
return chunkBCWPRPK7_js.safe(this.client.get(`/api/v1/subscriptions/${encodedId}`));
|
|
70
70
|
}
|
|
71
71
|
async cancel(id, reason, opts) {
|
|
72
72
|
const encodedId = encodeURIComponent(id);
|
|
73
|
-
const idempotencyKey = opts?.idempotencyKey ??
|
|
74
|
-
return
|
|
73
|
+
const idempotencyKey = opts?.idempotencyKey ?? chunkBCWPRPK7_js.generateIdempotencyKey();
|
|
74
|
+
return chunkBCWPRPK7_js.safe(
|
|
75
75
|
this.client.post(
|
|
76
76
|
`/api/v1/subscriptions/${encodedId}/cancel`,
|
|
77
77
|
{ reason },
|
|
@@ -81,20 +81,20 @@ var SubscriptionService = class {
|
|
|
81
81
|
}
|
|
82
82
|
async pause(id) {
|
|
83
83
|
const encodedId = encodeURIComponent(id);
|
|
84
|
-
return
|
|
84
|
+
return chunkBCWPRPK7_js.safe(
|
|
85
85
|
this.client.post(`/api/v1/subscriptions/${encodedId}/pause`)
|
|
86
86
|
);
|
|
87
87
|
}
|
|
88
88
|
async resume(id) {
|
|
89
89
|
const encodedId = encodeURIComponent(id);
|
|
90
|
-
return
|
|
90
|
+
return chunkBCWPRPK7_js.safe(
|
|
91
91
|
this.client.post(`/api/v1/subscriptions/${encodedId}/resume`)
|
|
92
92
|
);
|
|
93
93
|
}
|
|
94
94
|
async skipNextRenewal(id, opts) {
|
|
95
95
|
const encodedId = encodeURIComponent(id);
|
|
96
|
-
const idempotencyKey = opts?.idempotencyKey ??
|
|
97
|
-
return
|
|
96
|
+
const idempotencyKey = opts?.idempotencyKey ?? chunkBCWPRPK7_js.generateIdempotencyKey();
|
|
97
|
+
return chunkBCWPRPK7_js.safe(
|
|
98
98
|
this.client.post(
|
|
99
99
|
`/api/v1/subscriptions/${encodedId}/skip`,
|
|
100
100
|
void 0,
|
|
@@ -110,8 +110,8 @@ var UploadService = class {
|
|
|
110
110
|
this.client = client;
|
|
111
111
|
}
|
|
112
112
|
async init(filename, contentType, sizeBytes, opts) {
|
|
113
|
-
const idempotencyKey = opts?.idempotencyKey ??
|
|
114
|
-
return
|
|
113
|
+
const idempotencyKey = opts?.idempotencyKey ?? chunkBCWPRPK7_js.generateIdempotencyKey();
|
|
114
|
+
return chunkBCWPRPK7_js.safe(
|
|
115
115
|
this.client.post(
|
|
116
116
|
"/api/v1/uploads/init",
|
|
117
117
|
{
|
|
@@ -124,7 +124,7 @@ var UploadService = class {
|
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
async confirm(uploadId) {
|
|
127
|
-
return
|
|
127
|
+
return chunkBCWPRPK7_js.safe(
|
|
128
128
|
this.client.post("/api/v1/uploads/confirm", {
|
|
129
129
|
upload_id: uploadId
|
|
130
130
|
})
|
|
@@ -170,7 +170,7 @@ var PlacesService = class {
|
|
|
170
170
|
this.client = client;
|
|
171
171
|
}
|
|
172
172
|
async autocomplete(input, sessionToken) {
|
|
173
|
-
return
|
|
173
|
+
return chunkBCWPRPK7_js.safe(
|
|
174
174
|
this.client.post("/api/v1/places/autocomplete", {
|
|
175
175
|
input,
|
|
176
176
|
sessionToken
|
|
@@ -178,7 +178,7 @@ var PlacesService = class {
|
|
|
178
178
|
);
|
|
179
179
|
}
|
|
180
180
|
async details(placeId, sessionToken) {
|
|
181
|
-
return
|
|
181
|
+
return chunkBCWPRPK7_js.safe(
|
|
182
182
|
this.client.post("/api/v1/places/details", {
|
|
183
183
|
place_id: placeId,
|
|
184
184
|
sessionToken
|
|
@@ -197,7 +197,7 @@ var DeliveryService = class {
|
|
|
197
197
|
params.set("dropoff_lat", String(dropoffLat));
|
|
198
198
|
params.set("dropoff_lng", String(dropoffLng));
|
|
199
199
|
if (country) params.set("country", country);
|
|
200
|
-
return
|
|
200
|
+
return chunkBCWPRPK7_js.safe(
|
|
201
201
|
this.client.get(`/api/v1/delivery/fee?${params.toString()}`)
|
|
202
202
|
);
|
|
203
203
|
}
|
|
@@ -210,8 +210,8 @@ var SupportService = class {
|
|
|
210
210
|
}
|
|
211
211
|
/** Open (or resume) the customer's widget conversation. */
|
|
212
212
|
async openConversation(opts) {
|
|
213
|
-
const idempotencyKey = opts?.idempotencyKey ??
|
|
214
|
-
return
|
|
213
|
+
const idempotencyKey = opts?.idempotencyKey ?? chunkBCWPRPK7_js.generateIdempotencyKey();
|
|
214
|
+
return chunkBCWPRPK7_js.safe(
|
|
215
215
|
this.client.post("/api/v1/support/conversation", void 0, {
|
|
216
216
|
idempotencyKey
|
|
217
217
|
})
|
|
@@ -219,8 +219,8 @@ var SupportService = class {
|
|
|
219
219
|
}
|
|
220
220
|
/** Send a message in the active conversation. */
|
|
221
221
|
async sendMessage(content, opts) {
|
|
222
|
-
const idempotencyKey = opts?.idempotencyKey ??
|
|
223
|
-
return
|
|
222
|
+
const idempotencyKey = opts?.idempotencyKey ?? chunkBCWPRPK7_js.generateIdempotencyKey();
|
|
223
|
+
return chunkBCWPRPK7_js.safe(
|
|
224
224
|
this.client.post(
|
|
225
225
|
"/api/v1/support/conversation/messages",
|
|
226
226
|
{ content },
|
|
@@ -235,7 +235,7 @@ var SupportService = class {
|
|
|
235
235
|
if (options.limit) params.set("limit", String(options.limit));
|
|
236
236
|
const query = params.toString();
|
|
237
237
|
const path = query ? `/api/v1/support/conversation/messages?${query}` : "/api/v1/support/conversation/messages";
|
|
238
|
-
return
|
|
238
|
+
return chunkBCWPRPK7_js.safe(this.client.get(path));
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
241
|
|
|
@@ -814,25 +814,25 @@ var CimplifyClient = class {
|
|
|
814
814
|
}
|
|
815
815
|
get catalogue() {
|
|
816
816
|
if (!this._catalogue) {
|
|
817
|
-
this._catalogue = new
|
|
817
|
+
this._catalogue = new chunkBCWPRPK7_js.CatalogueQueries(this);
|
|
818
818
|
}
|
|
819
819
|
return this._catalogue;
|
|
820
820
|
}
|
|
821
821
|
get cart() {
|
|
822
822
|
if (!this._cart) {
|
|
823
|
-
this._cart = new
|
|
823
|
+
this._cart = new chunkBCWPRPK7_js.CartOperations(this);
|
|
824
824
|
}
|
|
825
825
|
return this._cart;
|
|
826
826
|
}
|
|
827
827
|
get checkout() {
|
|
828
828
|
if (!this._checkout) {
|
|
829
|
-
this._checkout = new
|
|
829
|
+
this._checkout = new chunkBCWPRPK7_js.CheckoutService(this);
|
|
830
830
|
}
|
|
831
831
|
return this._checkout;
|
|
832
832
|
}
|
|
833
833
|
get orders() {
|
|
834
834
|
if (!this._orders) {
|
|
835
|
-
this._orders = new
|
|
835
|
+
this._orders = new chunkBCWPRPK7_js.OrderQueries(this);
|
|
836
836
|
}
|
|
837
837
|
return this._orders;
|
|
838
838
|
}
|
|
@@ -856,43 +856,43 @@ var CimplifyClient = class {
|
|
|
856
856
|
}
|
|
857
857
|
get link() {
|
|
858
858
|
if (!this._link) {
|
|
859
|
-
this._link = new
|
|
859
|
+
this._link = new chunkBCWPRPK7_js.LinkService(this);
|
|
860
860
|
}
|
|
861
861
|
return this._link;
|
|
862
862
|
}
|
|
863
863
|
get auth() {
|
|
864
864
|
if (!this._auth) {
|
|
865
|
-
this._auth = new
|
|
865
|
+
this._auth = new chunkBCWPRPK7_js.AuthService(this);
|
|
866
866
|
}
|
|
867
867
|
return this._auth;
|
|
868
868
|
}
|
|
869
869
|
get business() {
|
|
870
870
|
if (!this._business) {
|
|
871
|
-
this._business = new
|
|
871
|
+
this._business = new chunkBCWPRPK7_js.BusinessService(this);
|
|
872
872
|
}
|
|
873
873
|
return this._business;
|
|
874
874
|
}
|
|
875
875
|
get inventory() {
|
|
876
876
|
if (!this._inventory) {
|
|
877
|
-
this._inventory = new
|
|
877
|
+
this._inventory = new chunkBCWPRPK7_js.InventoryService(this);
|
|
878
878
|
}
|
|
879
879
|
return this._inventory;
|
|
880
880
|
}
|
|
881
881
|
get scheduling() {
|
|
882
882
|
if (!this._scheduling) {
|
|
883
|
-
this._scheduling = new
|
|
883
|
+
this._scheduling = new chunkBCWPRPK7_js.SchedulingService(this);
|
|
884
884
|
}
|
|
885
885
|
return this._scheduling;
|
|
886
886
|
}
|
|
887
887
|
get lite() {
|
|
888
888
|
if (!this._lite) {
|
|
889
|
-
this._lite = new
|
|
889
|
+
this._lite = new chunkBCWPRPK7_js.LiteService(this);
|
|
890
890
|
}
|
|
891
891
|
return this._lite;
|
|
892
892
|
}
|
|
893
893
|
get fx() {
|
|
894
894
|
if (!this._fx) {
|
|
895
|
-
this._fx = new
|
|
895
|
+
this._fx = new chunkBCWPRPK7_js.FxService(this);
|
|
896
896
|
}
|
|
897
897
|
return this._fx;
|
|
898
898
|
}
|
|
@@ -927,7 +927,7 @@ var CimplifyClient = class {
|
|
|
927
927
|
if (businessId) {
|
|
928
928
|
this.setBusinessId(businessId);
|
|
929
929
|
}
|
|
930
|
-
return
|
|
930
|
+
return chunkBCWPRPK7_js.createElements(this, businessId ?? this.businessId ?? void 0, options);
|
|
931
931
|
}
|
|
932
932
|
};
|
|
933
933
|
function createCimplifyClient(config = {}) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkI4MP2XZS_js = require('./chunk-I4MP2XZS.js');
|
|
4
|
+
var chunkQZQEGRGB_js = require('./chunk-QZQEGRGB.js');
|
|
5
5
|
var zod = require('zod');
|
|
6
6
|
|
|
7
7
|
var cimplifyRegistry = zod.z.registry();
|
|
@@ -595,7 +595,7 @@ async function toForwardedRequest(input, init) {
|
|
|
595
595
|
};
|
|
596
596
|
}
|
|
597
597
|
function createTestClient(options = {}) {
|
|
598
|
-
const mock =
|
|
598
|
+
const mock = chunkI4MP2XZS_js.createMockApp(options);
|
|
599
599
|
let sessionToken;
|
|
600
600
|
const fetchImpl = async (input, init) => {
|
|
601
601
|
const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
|
|
@@ -614,7 +614,7 @@ function createTestClient(options = {}) {
|
|
|
614
614
|
if (echoed) sessionToken = echoed;
|
|
615
615
|
return res;
|
|
616
616
|
};
|
|
617
|
-
const client =
|
|
617
|
+
const client = chunkQZQEGRGB_js.createCimplifyClient({
|
|
618
618
|
baseUrl: TEST_BASE_URL,
|
|
619
619
|
// Link mock lives at /v1/link on the same Hono app, so point the SDK's
|
|
620
620
|
// separate Link transport at the same TEST_BASE_URL.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as CimplifyError, Q as Category, aX as Product, f as AddOnWithOptions, aO as Pagination, b9 as ProductWithDetails, b7 as ProductVariant, bA as VariantAxis, bB as VariantAxisSelection, A as AddOn, U as Collection, E as BundleSummary, s as Bundle, a1 as Composite, $ as ComponentSelectionInput, a6 as CompositePriceResult, S as ChosenPrice, b4 as ProductTaxonomy, bt as TaxonomyWithChildren, av as EligiblePlansQuery, a$ as ProductBillingPlan, b5 as ProductTimeProfile, a_ as ProductAvailabilityNow, ah as Deal, b0 as ProductDealInfo, an as DiscountValidation, bq as TagsResponse, ac as CustomAttributeDefinition, ad as CustomAttributeValue, ba as PropertyFacet, bs as TaxonomyAttributeTemplate, aH as KnowledgeArticle, bu as UICart, J as CartItem, O as CartSummary, g as AddToCartInput, L as CartMutationResult, bz as UpdateCartItemInput, am as DiscountDetails, aM as Money, ab as CurrencyCode, aI as LineConfiguration, bg as SchedulingMode, at as DurationUnit, bk as Subscription, bo as SubscriptionWithDetails } from './product-B_kS4Oxa.mjs';
|
|
1
|
+
import { T as CimplifyError, Q as Category, aX as Product, f as AddOnWithOptions, aO as Pagination, b9 as ProductWithDetails, b7 as ProductVariant, bA as VariantAxis, bB as VariantAxisSelection, A as AddOn, U as Collection, E as BundleSummary, s as Bundle, a1 as Composite, $ as ComponentSelectionInput, a6 as CompositePriceResult, S as ChosenPrice, b4 as ProductTaxonomy, bt as TaxonomyWithChildren, av as EligiblePlansQuery, a$ as ProductBillingPlan, b5 as ProductTimeProfile, a_ as ProductAvailabilityNow, ah as Deal, b0 as ProductDealInfo, an as DiscountValidation, bq as TagsResponse, ac as CustomAttributeDefinition, ad as CustomAttributeValue, ba as PropertyFacet, bs as TaxonomyAttributeTemplate, aH as KnowledgeArticle, bu as UICart, J as CartItem, O as CartSummary, g as AddToCartInput, L as CartMutationResult, bz as UpdateCartItemInput, am as DiscountDetails, aM as Money, ab as CurrencyCode, aI as LineConfiguration, bG as VariantDetails, bH as VariantDetailsDTO, a as AddOnDetails, d as AddOnOptionDetails, b as AddOnGroupDetails, z as BundleSelectionData, a8 as CompositeSelectionData, ae as CustomerInputValue, bg as SchedulingMode, at as DurationUnit, bk as Subscription, bo as SubscriptionWithDetails } from './product-B_kS4Oxa.mjs';
|
|
2
2
|
import { a as AuthorizationType, c as PaymentMethod, I as InitializePaymentResult, S as SubmitAuthorizationInput, i as PaymentStatusResponse } from './payment-DVS7ZUEp.mjs';
|
|
3
3
|
|
|
4
4
|
interface RequestContext {
|
|
@@ -1172,6 +1172,144 @@ declare class CheckoutService {
|
|
|
1172
1172
|
processAndResolve(data: CheckoutFormData & ProcessAndResolveOptions): Promise<Result<ProcessCheckoutResult, CimplifyError>>;
|
|
1173
1173
|
}
|
|
1174
1174
|
|
|
1175
|
+
interface BusinessDetailsDTO {
|
|
1176
|
+
name: string;
|
|
1177
|
+
logo_url?: string;
|
|
1178
|
+
contact_email?: string;
|
|
1179
|
+
contact_phone?: string;
|
|
1180
|
+
}
|
|
1181
|
+
interface OrderCustomerInfo {
|
|
1182
|
+
id?: string;
|
|
1183
|
+
name?: string;
|
|
1184
|
+
email?: string;
|
|
1185
|
+
phone?: string;
|
|
1186
|
+
notes?: string[];
|
|
1187
|
+
delivery_address?: string;
|
|
1188
|
+
delivery_required: boolean;
|
|
1189
|
+
will_pick_up: boolean;
|
|
1190
|
+
pickup_time?: string;
|
|
1191
|
+
}
|
|
1192
|
+
interface OrderLocationInfo {
|
|
1193
|
+
id?: string;
|
|
1194
|
+
name?: string;
|
|
1195
|
+
table_number?: string;
|
|
1196
|
+
room_number?: string;
|
|
1197
|
+
}
|
|
1198
|
+
interface PaymentInfoDTO {
|
|
1199
|
+
state: PaymentState;
|
|
1200
|
+
computed_status?: string;
|
|
1201
|
+
currency: string;
|
|
1202
|
+
amount_to_pay: AmountToPay;
|
|
1203
|
+
paid_via_group: boolean;
|
|
1204
|
+
}
|
|
1205
|
+
interface FulfillmentSummaryDTO {
|
|
1206
|
+
fulfillment_type: FulfillmentType;
|
|
1207
|
+
fulfillment_id: string;
|
|
1208
|
+
status?: string;
|
|
1209
|
+
digital_type?: string;
|
|
1210
|
+
delivery_method?: string;
|
|
1211
|
+
delivered_at?: string;
|
|
1212
|
+
usage_summary?: string;
|
|
1213
|
+
identifier?: string;
|
|
1214
|
+
}
|
|
1215
|
+
interface EnrichedOrderItem {
|
|
1216
|
+
id: string;
|
|
1217
|
+
product_id: string;
|
|
1218
|
+
product_name?: string;
|
|
1219
|
+
product_description?: string;
|
|
1220
|
+
image_url?: string;
|
|
1221
|
+
line_key: string;
|
|
1222
|
+
quantity: number;
|
|
1223
|
+
line_type: LineType;
|
|
1224
|
+
variant_id?: string;
|
|
1225
|
+
variant_details?: VariantDetails;
|
|
1226
|
+
variant_info?: VariantDetailsDTO;
|
|
1227
|
+
add_on_option_ids: string[];
|
|
1228
|
+
add_on_ids: string[];
|
|
1229
|
+
add_on_details: AddOnDetails;
|
|
1230
|
+
add_on_options: AddOnOptionDetails[];
|
|
1231
|
+
add_ons: AddOnGroupDetails[];
|
|
1232
|
+
bundle_selections?: BundleSelectionData;
|
|
1233
|
+
composite_selections?: CompositeSelectionData;
|
|
1234
|
+
fulfillment?: FulfillmentSummaryDTO;
|
|
1235
|
+
customer_inputs: CustomerInputValue[];
|
|
1236
|
+
scheduled_start?: string;
|
|
1237
|
+
scheduled_end?: string;
|
|
1238
|
+
confirmation_code?: string;
|
|
1239
|
+
primary_staff_id?: string;
|
|
1240
|
+
base_price: Money;
|
|
1241
|
+
add_ons_price: Money;
|
|
1242
|
+
total_price: Money;
|
|
1243
|
+
item_discount_amount: Money;
|
|
1244
|
+
price_info: ChosenPrice;
|
|
1245
|
+
discount_details: DiscountDetails;
|
|
1246
|
+
line_state: OrderLineStatus;
|
|
1247
|
+
created_at: string;
|
|
1248
|
+
updated_at: string;
|
|
1249
|
+
metadata?: Record<string, unknown>;
|
|
1250
|
+
}
|
|
1251
|
+
interface OrderPricingView {
|
|
1252
|
+
total_price: Money;
|
|
1253
|
+
subtotal: Money;
|
|
1254
|
+
total_discount: Money;
|
|
1255
|
+
service_charge?: Money;
|
|
1256
|
+
tax?: Money;
|
|
1257
|
+
price_info: ChosenPrice;
|
|
1258
|
+
}
|
|
1259
|
+
interface OrderTimestampsDTO {
|
|
1260
|
+
created_at: string;
|
|
1261
|
+
updated_at: string;
|
|
1262
|
+
confirmed_at?: string;
|
|
1263
|
+
fulfilled_at?: string;
|
|
1264
|
+
delivered_at?: string;
|
|
1265
|
+
served_at?: string;
|
|
1266
|
+
completed_at?: string;
|
|
1267
|
+
cancelled_at?: string;
|
|
1268
|
+
}
|
|
1269
|
+
interface OrderStaffInfo {
|
|
1270
|
+
placed_by?: string;
|
|
1271
|
+
was_placed_by_staff: boolean;
|
|
1272
|
+
modified_by_staff: boolean;
|
|
1273
|
+
served_by?: string;
|
|
1274
|
+
}
|
|
1275
|
+
interface OrderDiscountInfo {
|
|
1276
|
+
discount_code?: string;
|
|
1277
|
+
applied_discount_ids: string[];
|
|
1278
|
+
applied_discount_codes: string[];
|
|
1279
|
+
discount_details: DiscountDetails;
|
|
1280
|
+
}
|
|
1281
|
+
interface GroupOrderInfo {
|
|
1282
|
+
group_order_id: string;
|
|
1283
|
+
is_closed: boolean;
|
|
1284
|
+
}
|
|
1285
|
+
/**
|
|
1286
|
+
* The order shape the storefront order endpoint (`/api/v1/orders/:id`) returns:
|
|
1287
|
+
* names, images, resolved variants/add-ons, bundle/composite selections,
|
|
1288
|
+
* customer inputs, scheduling and digital fulfillment all resolved server-side.
|
|
1289
|
+
*/
|
|
1290
|
+
interface EnrichedOrder {
|
|
1291
|
+
id: string;
|
|
1292
|
+
user_friendly_id: string;
|
|
1293
|
+
business_id: string;
|
|
1294
|
+
order_type: string;
|
|
1295
|
+
channel: OrderChannel;
|
|
1296
|
+
status: OrderStatus;
|
|
1297
|
+
bill_token?: string;
|
|
1298
|
+
tracking_token?: string;
|
|
1299
|
+
tracking_link?: string;
|
|
1300
|
+
business_details?: BusinessDetailsDTO;
|
|
1301
|
+
customer: OrderCustomerInfo;
|
|
1302
|
+
location: OrderLocationInfo;
|
|
1303
|
+
payment: PaymentInfoDTO;
|
|
1304
|
+
items: EnrichedOrderItem[];
|
|
1305
|
+
pricing: OrderPricingView;
|
|
1306
|
+
timestamps: OrderTimestampsDTO;
|
|
1307
|
+
staff: OrderStaffInfo;
|
|
1308
|
+
discounts: OrderDiscountInfo;
|
|
1309
|
+
group_order_info?: GroupOrderInfo;
|
|
1310
|
+
metadata?: Record<string, unknown>;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1175
1313
|
interface IdempotencyOption$7 {
|
|
1176
1314
|
idempotencyKey?: string;
|
|
1177
1315
|
}
|
|
@@ -1186,6 +1324,12 @@ declare class OrderQueries {
|
|
|
1186
1324
|
private orderTokenParam;
|
|
1187
1325
|
list(options?: GetOrdersOptions): Promise<Result<Order[], CimplifyError>>;
|
|
1188
1326
|
get(orderId: string): Promise<Result<Order, CimplifyError>>;
|
|
1327
|
+
/**
|
|
1328
|
+
* Same endpoint as `get`, typed as the enriched display contract
|
|
1329
|
+
* (product names, images, resolved selections, customer inputs, scheduling,
|
|
1330
|
+
* fulfillment). Feed the result through `toAccountOrderView`.
|
|
1331
|
+
*/
|
|
1332
|
+
getDetail(orderId: string): Promise<Result<EnrichedOrder, CimplifyError>>;
|
|
1189
1333
|
getRecent(limit?: number): Promise<Result<Order[], CimplifyError>>;
|
|
1190
1334
|
getByStatus(status: OrderStatus): Promise<Result<Order[], CimplifyError>>;
|
|
1191
1335
|
cancel(orderId: string, reason?: string, opts?: IdempotencyOption$7): Promise<Result<Order, CimplifyError>>;
|
|
@@ -1197,7 +1341,7 @@ interface GetLinkOrdersOptions {
|
|
|
1197
1341
|
offset?: number;
|
|
1198
1342
|
/**
|
|
1199
1343
|
* Per-merchant scope. When set, only orders placed with this business
|
|
1200
|
-
* are returned. Pass it from
|
|
1344
|
+
* are returned. Pass it from SDK-rendered account pages on a merchant
|
|
1201
1345
|
* storefront; omit for the cross-merchant view on link.cimplify.io.
|
|
1202
1346
|
*/
|
|
1203
1347
|
businessId?: string;
|
|
@@ -1205,7 +1349,7 @@ interface GetLinkOrdersOptions {
|
|
|
1205
1349
|
interface GetLinkOrderOptions {
|
|
1206
1350
|
/**
|
|
1207
1351
|
* Per-merchant scope. When set, the order must belong to this business
|
|
1208
|
-
* or the request 404s. Used by
|
|
1352
|
+
* or the request 404s. Used by merchant account pages to prevent
|
|
1209
1353
|
* cross-merchant enumeration.
|
|
1210
1354
|
*/
|
|
1211
1355
|
businessId?: string;
|
|
@@ -1213,9 +1357,12 @@ interface GetLinkOrderOptions {
|
|
|
1213
1357
|
interface IdempotencyOption$6 {
|
|
1214
1358
|
idempotencyKey?: string;
|
|
1215
1359
|
}
|
|
1216
|
-
interface SuccessResult
|
|
1360
|
+
interface SuccessResult {
|
|
1217
1361
|
success: boolean;
|
|
1218
1362
|
message?: string;
|
|
1363
|
+
action?: string;
|
|
1364
|
+
expires_in?: number;
|
|
1365
|
+
is_new_account?: boolean;
|
|
1219
1366
|
}
|
|
1220
1367
|
/**
|
|
1221
1368
|
* Cimplify Link client.
|
|
@@ -1241,10 +1388,10 @@ interface SuccessResult$1 {
|
|
|
1241
1388
|
declare class LinkService {
|
|
1242
1389
|
private client;
|
|
1243
1390
|
constructor(client: CimplifyClient);
|
|
1244
|
-
requestOtp(input: RequestOtpInput, opts?: IdempotencyOption$6): Promise<Result<SuccessResult
|
|
1391
|
+
requestOtp(input: RequestOtpInput, opts?: IdempotencyOption$6): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1245
1392
|
verifyOtp(input: VerifyOtpInput, opts?: IdempotencyOption$6): Promise<Result<AuthResponse, CimplifyError>>;
|
|
1246
1393
|
refreshSession(sessionToken?: string, opts?: IdempotencyOption$6): Promise<Result<AuthResponse, CimplifyError>>;
|
|
1247
|
-
logout(): Promise<Result<SuccessResult
|
|
1394
|
+
logout(): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1248
1395
|
checkStatus(contact: string): Promise<Result<LinkStatusResult, CimplifyError>>;
|
|
1249
1396
|
getLinkData(): Promise<Result<LinkData, CimplifyError>>;
|
|
1250
1397
|
getAddresses(): Promise<Result<CustomerAddress[], CimplifyError>>;
|
|
@@ -1259,17 +1406,17 @@ declare class LinkService {
|
|
|
1259
1406
|
getOrder(orderId: string, options?: GetLinkOrderOptions): Promise<Result<Order, CimplifyError>>;
|
|
1260
1407
|
enroll(data: EnrollmentData, opts?: IdempotencyOption$6): Promise<Result<LinkEnrollResult, CimplifyError>>;
|
|
1261
1408
|
enrollAndLinkOrder(data: EnrollAndLinkOrderInput, opts?: IdempotencyOption$6): Promise<Result<EnrollAndLinkOrderResult, CimplifyError>>;
|
|
1262
|
-
updatePreferences(preferences: Partial<CustomerLinkPreferences>): Promise<Result<SuccessResult
|
|
1409
|
+
updatePreferences(preferences: Partial<CustomerLinkPreferences>): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1263
1410
|
createAddress(input: CreateAddressInput, opts?: IdempotencyOption$6): Promise<Result<CustomerAddress, CimplifyError>>;
|
|
1264
|
-
updateAddress(input: UpdateAddressInput): Promise<Result<SuccessResult
|
|
1265
|
-
deleteAddress(addressId: string): Promise<Result<SuccessResult
|
|
1266
|
-
setDefaultAddress(addressId: string): Promise<Result<SuccessResult
|
|
1267
|
-
trackAddressUsage(addressId: string): Promise<Result<SuccessResult
|
|
1411
|
+
updateAddress(input: UpdateAddressInput): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1412
|
+
deleteAddress(addressId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1413
|
+
setDefaultAddress(addressId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1414
|
+
trackAddressUsage(addressId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1268
1415
|
createMobileMoney(input: CreateMobileMoneyInput, opts?: IdempotencyOption$6): Promise<Result<CustomerMobileMoney, CimplifyError>>;
|
|
1269
|
-
deleteMobileMoney(mobileMoneyId: string): Promise<Result<SuccessResult
|
|
1270
|
-
setDefaultMobileMoney(mobileMoneyId: string): Promise<Result<SuccessResult
|
|
1271
|
-
trackMobileMoneyUsage(mobileMoneyId: string): Promise<Result<SuccessResult
|
|
1272
|
-
verifyMobileMoney(mobileMoneyId: string, opts?: IdempotencyOption$6): Promise<Result<SuccessResult
|
|
1416
|
+
deleteMobileMoney(mobileMoneyId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1417
|
+
setDefaultMobileMoney(mobileMoneyId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1418
|
+
trackMobileMoneyUsage(mobileMoneyId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1419
|
+
verifyMobileMoney(mobileMoneyId: string, opts?: IdempotencyOption$6): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1273
1420
|
getSessions(): Promise<Result<LinkSession[], CimplifyError>>;
|
|
1274
1421
|
revokeSession(sessionId: string): Promise<Result<RevokeSessionResult, CimplifyError>>;
|
|
1275
1422
|
revokeAllSessions(): Promise<Result<RevokeAllSessionsResult, CimplifyError>>;
|
|
@@ -1284,16 +1431,29 @@ interface AuthStatus {
|
|
|
1284
1431
|
session_expires_at?: string;
|
|
1285
1432
|
}
|
|
1286
1433
|
interface OtpResult {
|
|
1434
|
+
message: string;
|
|
1435
|
+
account_id: string;
|
|
1287
1436
|
customer: Customer;
|
|
1288
|
-
session_token
|
|
1437
|
+
session_token: string;
|
|
1438
|
+
refresh_token: string;
|
|
1439
|
+
}
|
|
1440
|
+
interface RequestOtpResult {
|
|
1441
|
+
message: string;
|
|
1442
|
+
expires_in: number;
|
|
1443
|
+
is_new_account: boolean;
|
|
1289
1444
|
}
|
|
1290
1445
|
interface UpdateProfileInput {
|
|
1291
1446
|
name?: string;
|
|
1292
1447
|
email?: string;
|
|
1293
1448
|
phone?: string;
|
|
1294
1449
|
}
|
|
1295
|
-
interface
|
|
1450
|
+
interface LogoutResult {
|
|
1451
|
+
message: string;
|
|
1452
|
+
action: "discard_token" | string;
|
|
1453
|
+
}
|
|
1454
|
+
interface UpdateProfileResult {
|
|
1296
1455
|
success: boolean;
|
|
1456
|
+
message: string;
|
|
1297
1457
|
}
|
|
1298
1458
|
declare class AuthService {
|
|
1299
1459
|
private client;
|
|
@@ -1301,10 +1461,10 @@ declare class AuthService {
|
|
|
1301
1461
|
getStatus(): Promise<Result<AuthStatus, CimplifyError>>;
|
|
1302
1462
|
getCurrentUser(): Promise<Result<Customer | null, CimplifyError>>;
|
|
1303
1463
|
isAuthenticated(): Promise<Result<boolean, CimplifyError>>;
|
|
1304
|
-
requestOtp(contact: string, contactType?: "phone" | "email", opts?: IdempotencyOption$5): Promise<Result<
|
|
1464
|
+
requestOtp(contact: string, contactType?: "phone" | "email", opts?: IdempotencyOption$5): Promise<Result<RequestOtpResult, CimplifyError>>;
|
|
1305
1465
|
verifyOtp(code: string, contact?: string, opts?: IdempotencyOption$5): Promise<Result<OtpResult, CimplifyError>>;
|
|
1306
|
-
logout(): Promise<Result<
|
|
1307
|
-
updateProfile(input: UpdateProfileInput): Promise<Result<
|
|
1466
|
+
logout(): Promise<Result<LogoutResult, CimplifyError>>;
|
|
1467
|
+
updateProfile(input: UpdateProfileInput): Promise<Result<UpdateProfileResult, CimplifyError>>;
|
|
1308
1468
|
}
|
|
1309
1469
|
|
|
1310
1470
|
type BusinessType = "eatery" | "retail" | "service" | "other" | "system" | "unset";
|
|
@@ -2511,4 +2671,4 @@ declare class CimplifyClient {
|
|
|
2511
2671
|
}
|
|
2512
2672
|
declare function createCimplifyClient(config?: CimplifyConfig): CimplifyClient;
|
|
2513
2673
|
|
|
2514
|
-
export { type
|
|
2674
|
+
export { type CheckoutAddressInfo as $, AUTHORIZATION_TYPE as A, type Booking as B, BusinessService as C, type BusinessSettings as D, type BusinessType as E, type BusinessWithLocations as F, CHECKOUT_MODE as G, CHECKOUT_MUTATION as H, CHECKOUT_STEP as I, CONTACT_TYPE as J, type CacheOptions as K, type CancelBookingInput as L, type CancelBookingResult as M, type CancelOrderInput as N, type CancellationPolicy as O, CartOperations as P, CatalogueQueries as Q, type CatalogueResult as R, type CatalogueSnapshot as S, type CategoryInfo as T, type ChatAttachment as U, type ChatConversation as V, type ChatConversationResponse as W, type ChatMessage as X, type ChatWidgetStarter as Y, type CheckSlotAvailabilityInput as Z, type CheckSlotAvailabilityResult as _, AUTH_MUTATION as a, type FetchQuoteInput as a$, type CheckoutCartData as a0, type CheckoutCartItem as a1, type CheckoutCustomerInfo as a2, type CheckoutFormData as a3, type CheckoutInput as a4, type CheckoutMode as a5, type CheckoutOrderType as a6, type CheckoutPaymentMethod as a7, type CheckoutResult as a8, CheckoutService as a9, type DeviceType as aA, type DismissMessageResponse as aB, ELEMENTS_AUTH_CONTACT_TYPES as aC, ELEMENTS_AUTH_MODES as aD, ELEMENTS_AUTH_PROMPTS as aE, ELEMENT_TYPES as aF, EVENT_TYPES as aG, type ElementAppearance as aH, type ElementEventHandler as aI, type ElementEventType as aJ, type ElementOptions as aK, type ElementType as aL, type ElementsAuthContactType as aM, type ElementsAuthMode as aN, type ElementsAuthOptions as aO, type ElementsAuthPrompt as aP, type ElementsCheckoutData as aQ, type ElementsCheckoutResult as aR, type ElementsCustomerInfo as aS, type ElementsOptions as aT, type EnrichedOrder as aU, type EnrichedOrderItem as aV, type EnrollAndLinkOrderInput as aW, type EnrollAndLinkOrderResult as aX, type EnrollmentData as aY, type Err as aZ, type FeeBearerType as a_, type CheckoutStatus as aa, type CheckoutStatusContext as ab, type CheckoutStep as ac, CimplifyClient as ad, type CimplifyConfig as ae, CimplifyElement as af, CimplifyElements as ag, type ContactType as ah, type ContentType as ai, type CreateAddressInput as aj, type CreateMobileMoneyInput as ak, type Customer as al, type CustomerAddress as am, type CustomerBooking as an, type CustomerBookingServiceItem as ao, type CustomerLinkPreferences as ap, type CustomerMobileMoney as aq, type CustomerServicePreferences as ar, DEFAULT_COUNTRY as as, DEFAULT_CURRENCY as at, DEVICE_TYPE as au, type DayAvailability as av, type DeliveryFeeDetails as aw, type DeliveryFeeResponse as ax, DeliveryService as ay, type DepositResult as az, type AbortablePromise as b, type OrderStatus as b$, type FulfillmentLink as b0, type FulfillmentStatus as b1, type FulfillmentSummaryDTO as b2, type FulfillmentType as b3, type FxQuote as b4, type FxQuoteRequest as b5, type FxRateResponse as b6, FxService as b7, type GetAvailableSlotsInput as b8, type GetOrdersOptions as b9, type NextAction as bA, ORDER_MUTATION as bB, ORDER_TYPE as bC, type ObservabilityHooks as bD, type Ok as bE, type Order as bF, type OrderChannel as bG, type OrderCustomerInfo as bH, type OrderDiscountInfo as bI, type OrderFilter as bJ, type OrderFulfillmentSummary as bK, type OrderGroup as bL, type OrderGroupDetails as bM, type OrderGroupPayment as bN, type OrderGroupPaymentState as bO, type OrderGroupPaymentStatus as bP, type OrderGroupPaymentSummary as bQ, type OrderGroupStatus as bR, type OrderHistory as bS, type OrderLineState as bT, type OrderLineStatus as bU, type OrderLocationInfo as bV, type OrderPaymentEvent as bW, type OrderPricingView as bX, OrderQueries as bY, type OrderSplitDetail as bZ, type OrderStaffInfo as b_, type GetProductsOptions as ba, type GroupOrderInfo as bb, type IframeToParentMessage as bc, InventoryService as bd, LINK_MUTATION as be, LINK_QUERY as bf, type LineItem as bg, type LineType as bh, type LinkData as bi, type LinkEnrollResult as bj, LinkService as bk, type LinkSession as bl, type LinkStatusResult as bm, type LiteBootstrap as bn, LiteService as bo, type Location as bp, type LocationBooking as bq, type LocationTaxBehavior as br, type LocationTaxOverrides as bs, type LocationTimeProfile as bt, type LocationWithDetails as bu, MESSAGE_TYPES as bv, MOBILE_MONEY_PROVIDER as bw, type MobileMoneyData as bx, type MobileMoneyDetails as by, type MobileMoneyProvider as bz, type ActivityRecommendation as c, type ServiceStatus as c$, type OrderTimestampsDTO as c0, type OrderType as c1, type OtpResult as c2, PAYMENT_METHOD as c3, PAYMENT_MUTATION as c4, PAYMENT_STATE as c5, PICKUP_TIME_TYPE as c6, type ParentToIframeMessage as c7, type PaymentInfoDTO as c8, type PaymentMethodInfo as c9, type ReorderResult as cA, type RequestContext as cB, type RequestErrorEvent as cC, type RequestOptions as cD, type RequestOtpInput as cE, type RequestSource as cF, type RequestStartEvent as cG, type RequestSuccessEvent as cH, type RescheduleBookingInput as cI, type RescheduleBookingResult as cJ, type RescheduleHistoryRecord as cK, type ResourceAssignment as cL, type Result as cM, type RetryEvent as cN, type RevokeAllSessionsResult as cO, type RevokeSessionResult as cP, type Room as cQ, type SchedulingMetadata as cR, type SchedulingResult as cS, SchedulingService as cT, type SenderType as cU, type Service as cV, type ServiceAvailabilityParams as cW, type ServiceAvailabilityResult as cX, type ServiceCharge as cY, type ServiceNotes as cZ, type ServiceScheduleRequest as c_, type PaymentState as ca, type PickupTime as cb, type PickupTimeType as cc, type PlaceDetailsResponse as cd, PlacesService as ce, type PriceQuote as cf, type PricingOverrides as cg, type ProcessAndResolveOptions as ch, type ProcessCheckoutOptions as ci, type ProcessCheckoutResult as cj, type ProviderResolutionSource as ck, type QuoteBundleSelectionInput as cl, type QuoteCompositeSelectionInput as cm, type QuoteDynamicBuckets as cn, type QuoteStatus as co, type QuoteUiMessage as cp, type ReadRequestOptions as cq, type RefreshQuoteInput as cr, type RefreshQuoteResult as cs, type RefundOrderInput as ct, type RelatedCandidate as cu, type RelatedProduct as cv, type RelatedProductsEnrichment as cw, type RelationType as cx, type ReminderMethod as cy, type ReminderSettings as cz, type ActivityRecommendationsResponse as d, type SessionActivityData as d0, type SessionChangeEvent as d1, type SessionMessage as d2, type SlotResourceInfo as d3, type SlotStaffInfo as d4, type Staff as d5, type StaffAssignment as d6, type StaffRole as d7, type StaffScheduleItem as d8, type StockLevel as d9, getOrElse as dA, isErr as dB, isOk as dC, mapError as dD, mapResult as dE, ok as dF, toNullable as dG, tryCatch as dH, unwrap as dI, type StockStatus as da, type StorefrontBootstrap as db, SubscriptionService as dc, SupportService as dd, type Table as de, type TableInfo as df, type TimeRange as dg, type TimeRanges as dh, type TimeSlot as di, type TrackCategoryViewOptions as dj, type TrackProductViewOptions as dk, type UpdateAddressInput as dl, type UpdateOrderStatusInput as dm, type UpdateProfileInput as dn, type UploadInitResponse as dp, type UploadResult as dq, UploadService as dr, type VerifyOtpInput as ds, combine as dt, combineObject as du, createCimplifyClient as dv, createElements as dw, err as dx, flatMap as dy, fromPromise as dz, ActivityService as e, type ActivityStateResponse as f, type AddressData as g, type AddressInfo as h, type AmountToPay as i, type AuthResponse as j, AuthService as k, type AuthStatus as l, type AuthenticatedCustomer as m, type AuthenticatedData as n, type AutocompletePrediction as o, type AutocompleteResponse as p, type AvailabilityResult as q, type AvailableSlot as r, type BookingModificationType as s, type BookingStatus as t, type BookingWithDetails as u, type BufferTimes as v, type Business as w, type BusinessDetailsDTO as x, type BusinessHours as y, type BusinessPreferences as z };
|