@cimplify/sdk 0.31.0 → 0.35.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 +6 -2
- package/dist/advanced.d.ts +6 -2
- package/dist/advanced.js +21 -21
- package/dist/advanced.mjs +2 -2
- package/dist/{chunk-46BDUSJX.mjs → chunk-2X6P5WJZ.mjs} +108 -32
- package/dist/{chunk-E3HC2YAE.mjs → chunk-6TVQQYQ5.mjs} +14 -1
- package/dist/{chunk-2CGA3MUW.js → chunk-HKVRUGM6.js} +142 -91
- package/dist/{chunk-3J4PPSMI.mjs → chunk-TFHKVQLL.mjs} +123 -72
- package/dist/{chunk-PEDLCL72.js → chunk-V2O5AO7I.js} +15 -0
- package/dist/{chunk-6HCBOIZ4.js → chunk-ZYACIPKO.js} +160 -84
- package/dist/{index-BpyFcJVv.d.ts → client-CkGlXZRd.d.mts} +121 -72
- package/dist/{index-m8zGQUda.d.mts → client-lvLvB1_K.d.ts} +121 -72
- package/dist/{index-D4oNCc37.d.mts → index-CC1JPhB2.d.mts} +2 -2
- package/dist/{index-BHVJgyqM.d.ts → index-CPcFayQg.d.ts} +2 -2
- package/dist/index.d.mts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +117 -109
- package/dist/index.mjs +3 -3
- package/dist/{payment-DnU_eLuT.d.ts → payment-DA1i5hhk.d.mts} +13 -12
- package/dist/{payment-DnU_eLuT.d.mts → payment-DA1i5hhk.d.ts} +13 -12
- package/dist/{price-DUVmRTaz.d.ts → price-Bv4G8aOO.d.ts} +1 -1
- package/dist/{price-D-hso3np.d.mts → price-s1XN0edJ.d.mts} +1 -1
- package/dist/react.d.mts +21 -4
- package/dist/react.d.ts +21 -4
- package/dist/react.js +835 -715
- package/dist/react.mjs +725 -605
- package/dist/styles.css +1 -1
- package/dist/utils.d.mts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +28 -28
- package/dist/utils.mjs +1 -1
- package/package.json +8 -8
- package/registry/cart-summary.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as CimplifyError, am as Category, U as Product, ai as AddOnWithOptions, d as Pagination, a7 as ProductWithDetails, a9 as ProductVariant, ab as VariantAxis, ag as VariantAxisSelection, ah as AddOn, ao as Collection, at as BundleSummary, as as Bundle, aF as Composite, aM as ComponentSelectionInput, aN as CompositePriceResult, C as ChosenPrice, aU as ProductTaxonomy, aV as TaxonomyWithChildren, b$ as EligiblePlansQuery, b_ as ProductBillingPlan, aT as ProductTimeProfile, aW as ProductAvailabilityNow, aY as Deal, aZ as ProductDealInfo, a_ as DiscountValidation, b0 as TagsResponse, H as CustomAttributeDefinition, J as CustomAttributeValue, N as PropertyFacet, T as TaxonomyAttributeTemplate, Q as KnowledgeArticle, bE as UICart, bq as CartItem, bJ as CartSummary, bH as AddToCartInput, bG as CartMutationResult, bI as UpdateCartItemInput, bc as DiscountDetails, M as Money, a as CurrencyCode, bo as LineConfiguration, bO as AuthorizationType, bQ as PaymentMethod, bS as InitializePaymentResult, bW as SubmitAuthorizationInput, bU as PaymentStatusResponse, S as SchedulingMode, v as DurationUnit, c2 as Subscription, c5 as SubscriptionWithDetails } from './payment-DA1i5hhk.mjs';
|
|
2
2
|
|
|
3
3
|
interface RequestContext {
|
|
4
4
|
method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
@@ -38,6 +38,47 @@ interface ObservabilityHooks {
|
|
|
38
38
|
onSessionChange?: (event: SessionChangeEvent) => void;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
interface MutationErrorEvent {
|
|
42
|
+
service: string;
|
|
43
|
+
operation: string;
|
|
44
|
+
error: CimplifyError;
|
|
45
|
+
opId?: string;
|
|
46
|
+
idempotencyKey?: string;
|
|
47
|
+
}
|
|
48
|
+
interface OutboxEntrySnapshot {
|
|
49
|
+
id: string;
|
|
50
|
+
idempotencyKey: string;
|
|
51
|
+
service: string;
|
|
52
|
+
operation: string;
|
|
53
|
+
attemptCount: number;
|
|
54
|
+
}
|
|
55
|
+
interface OutboxReplayEvent {
|
|
56
|
+
entry: OutboxEntrySnapshot;
|
|
57
|
+
}
|
|
58
|
+
interface OutboxReplayErrorEvent {
|
|
59
|
+
entry: OutboxEntrySnapshot;
|
|
60
|
+
error: CimplifyError;
|
|
61
|
+
}
|
|
62
|
+
interface OutboxFullEvent {
|
|
63
|
+
service: string;
|
|
64
|
+
operation: string;
|
|
65
|
+
idempotencyKey: string;
|
|
66
|
+
}
|
|
67
|
+
interface ClientEventMap {
|
|
68
|
+
"mutation:error": MutationErrorEvent;
|
|
69
|
+
"outbox:replay-success": OutboxReplayEvent;
|
|
70
|
+
"outbox:replay-error": OutboxReplayErrorEvent;
|
|
71
|
+
"outbox:dead-letter": OutboxReplayEvent;
|
|
72
|
+
"outbox:full": OutboxFullEvent;
|
|
73
|
+
}
|
|
74
|
+
type ClientEventName = keyof ClientEventMap;
|
|
75
|
+
type ClientEventListener<K extends ClientEventName> = (payload: ClientEventMap[K]) => void;
|
|
76
|
+
interface ClientEvents {
|
|
77
|
+
on<K extends ClientEventName>(name: K, listener: ClientEventListener<K>): () => void;
|
|
78
|
+
off<K extends ClientEventName>(name: K, listener: ClientEventListener<K>): void;
|
|
79
|
+
emit<K extends ClientEventName>(name: K, payload: ClientEventMap[K]): void;
|
|
80
|
+
}
|
|
81
|
+
|
|
41
82
|
interface CatalogueResult<T> {
|
|
42
83
|
items: T[];
|
|
43
84
|
is_complete: boolean;
|
|
@@ -79,6 +120,9 @@ declare function combineObject<T extends Record<string, Result<unknown, unknown>
|
|
|
79
120
|
[K in keyof T]: T[K] extends Result<infer V, unknown> ? V : never;
|
|
80
121
|
}, T[keyof T] extends Result<unknown, infer E> ? E : never>;
|
|
81
122
|
|
|
123
|
+
interface IdempotencyOption$9 {
|
|
124
|
+
idempotencyKey?: string;
|
|
125
|
+
}
|
|
82
126
|
interface GetProductsOptions {
|
|
83
127
|
category?: string;
|
|
84
128
|
taxonomy?: string;
|
|
@@ -213,7 +257,7 @@ declare class CatalogueQueries {
|
|
|
213
257
|
getComposite(id: string): Promise<Result<Composite, CimplifyError>>;
|
|
214
258
|
getCompositeByProduct(productId: string): Promise<Result<Composite, CimplifyError>>;
|
|
215
259
|
calculateCompositePrice(compositeId: string, selections: ComponentSelectionInput[], locationId?: string): Promise<Result<CompositePriceResult, CimplifyError>>;
|
|
216
|
-
fetchQuote(input: FetchQuoteInput): Promise<Result<PriceQuote, CimplifyError>>;
|
|
260
|
+
fetchQuote(input: FetchQuoteInput, opts?: IdempotencyOption$9): Promise<Result<PriceQuote, CimplifyError>>;
|
|
217
261
|
getQuote(quoteId: string): Promise<Result<PriceQuote, CimplifyError>>;
|
|
218
262
|
refreshQuote(input: RefreshQuoteInput): Promise<Result<RefreshQuoteResult, CimplifyError>>;
|
|
219
263
|
getTaxonomies(parentId?: string): Promise<Result<ProductTaxonomy[], CimplifyError>>;
|
|
@@ -257,6 +301,9 @@ declare class CatalogueQueries {
|
|
|
257
301
|
getKnowledgeArticles(): Promise<Result<KnowledgeArticle[], CimplifyError>>;
|
|
258
302
|
}
|
|
259
303
|
|
|
304
|
+
interface IdempotencyOption$8 {
|
|
305
|
+
idempotencyKey?: string;
|
|
306
|
+
}
|
|
260
307
|
interface ReorderResult {
|
|
261
308
|
added: {
|
|
262
309
|
item_id: string;
|
|
@@ -270,18 +317,17 @@ declare class CartOperations {
|
|
|
270
317
|
private client;
|
|
271
318
|
constructor(client: CimplifyClient);
|
|
272
319
|
get(): Promise<Result<UICart, CimplifyError>>;
|
|
273
|
-
getRaw(): Promise<Result<Cart, CimplifyError>>;
|
|
274
320
|
getItems(): Promise<Result<CartItem[], CimplifyError>>;
|
|
275
321
|
getCount(): Promise<Result<number, CimplifyError>>;
|
|
276
322
|
getTotal(): Promise<Result<string, CimplifyError>>;
|
|
277
323
|
getSummary(): Promise<Result<CartSummary, CimplifyError>>;
|
|
278
|
-
addItem(input: AddToCartInput): Promise<Result<
|
|
279
|
-
updateItem(cartItemId: string, updates: UpdateCartItemInput): Promise<Result<
|
|
280
|
-
updateQuantity(cartItemId: string, quantity: number): Promise<Result<
|
|
281
|
-
removeItem(cartItemId: string): Promise<Result<
|
|
282
|
-
clear(): Promise<Result<
|
|
283
|
-
applyCoupon(code: string): Promise<Result<
|
|
284
|
-
removeCoupon(): Promise<Result<
|
|
324
|
+
addItem(input: AddToCartInput, opts?: IdempotencyOption$8): Promise<Result<CartMutationResult, CimplifyError>>;
|
|
325
|
+
updateItem(cartItemId: string, updates: UpdateCartItemInput): Promise<Result<CartMutationResult, CimplifyError>>;
|
|
326
|
+
updateQuantity(cartItemId: string, quantity: number): Promise<Result<CartMutationResult, CimplifyError>>;
|
|
327
|
+
removeItem(cartItemId: string): Promise<Result<CartMutationResult, CimplifyError>>;
|
|
328
|
+
clear(): Promise<Result<CartMutationResult, CimplifyError>>;
|
|
329
|
+
applyCoupon(code: string, opts?: IdempotencyOption$8): Promise<Result<CartMutationResult, CimplifyError>>;
|
|
330
|
+
removeCoupon(): Promise<Result<CartMutationResult, CimplifyError>>;
|
|
285
331
|
reorderFromOrder(orderId: string): Promise<Result<ReorderResult, CimplifyError>>;
|
|
286
332
|
isEmpty(): Promise<Result<boolean, CimplifyError>>;
|
|
287
333
|
hasItem(productId: string, variantId?: string): Promise<Result<boolean, CimplifyError>>;
|
|
@@ -1103,7 +1149,6 @@ type AbortablePromise<T> = Promise<T> & {
|
|
|
1103
1149
|
abort: () => void;
|
|
1104
1150
|
};
|
|
1105
1151
|
|
|
1106
|
-
declare function generateIdempotencyKey(): string;
|
|
1107
1152
|
declare class CheckoutService {
|
|
1108
1153
|
private client;
|
|
1109
1154
|
constructor(client: CimplifyClient);
|
|
@@ -1117,6 +1162,9 @@ declare class CheckoutService {
|
|
|
1117
1162
|
processAndResolve(data: CheckoutFormData & ProcessAndResolveOptions): Promise<Result<ProcessCheckoutResult, CimplifyError>>;
|
|
1118
1163
|
}
|
|
1119
1164
|
|
|
1165
|
+
interface IdempotencyOption$7 {
|
|
1166
|
+
idempotencyKey?: string;
|
|
1167
|
+
}
|
|
1120
1168
|
interface GetOrdersOptions {
|
|
1121
1169
|
status?: OrderStatus;
|
|
1122
1170
|
limit?: number;
|
|
@@ -1130,9 +1178,12 @@ declare class OrderQueries {
|
|
|
1130
1178
|
get(orderId: string): Promise<Result<Order, CimplifyError>>;
|
|
1131
1179
|
getRecent(limit?: number): Promise<Result<Order[], CimplifyError>>;
|
|
1132
1180
|
getByStatus(status: OrderStatus): Promise<Result<Order[], CimplifyError>>;
|
|
1133
|
-
cancel(orderId: string, reason?: string): Promise<Result<Order, CimplifyError>>;
|
|
1181
|
+
cancel(orderId: string, reason?: string, opts?: IdempotencyOption$7): Promise<Result<Order, CimplifyError>>;
|
|
1134
1182
|
}
|
|
1135
1183
|
|
|
1184
|
+
interface IdempotencyOption$6 {
|
|
1185
|
+
idempotencyKey?: string;
|
|
1186
|
+
}
|
|
1136
1187
|
interface SuccessResult$1 {
|
|
1137
1188
|
success: boolean;
|
|
1138
1189
|
message?: string;
|
|
@@ -1141,32 +1192,35 @@ declare class LinkService {
|
|
|
1141
1192
|
private client;
|
|
1142
1193
|
constructor(client: CimplifyClient);
|
|
1143
1194
|
getProfile(): Promise<Result<LinkData["customer"], CimplifyError>>;
|
|
1144
|
-
requestOtp(input: RequestOtpInput): Promise<Result<SuccessResult$1, CimplifyError>>;
|
|
1145
|
-
verifyOtp(input: VerifyOtpInput): Promise<Result<AuthResponse, CimplifyError>>;
|
|
1195
|
+
requestOtp(input: RequestOtpInput, opts?: IdempotencyOption$6): Promise<Result<SuccessResult$1, CimplifyError>>;
|
|
1196
|
+
verifyOtp(input: VerifyOtpInput, opts?: IdempotencyOption$6): Promise<Result<AuthResponse, CimplifyError>>;
|
|
1146
1197
|
logout(): Promise<Result<SuccessResult$1, CimplifyError>>;
|
|
1147
1198
|
checkStatus(contact: string): Promise<Result<LinkStatusResult, CimplifyError>>;
|
|
1148
1199
|
getLinkData(): Promise<Result<LinkData, CimplifyError>>;
|
|
1149
1200
|
getAddresses(): Promise<Result<CustomerAddress[], CimplifyError>>;
|
|
1150
1201
|
getMobileMoney(): Promise<Result<CustomerMobileMoney[], CimplifyError>>;
|
|
1151
1202
|
getPreferences(): Promise<Result<CustomerLinkPreferences, CimplifyError>>;
|
|
1152
|
-
enroll(data: EnrollmentData): Promise<Result<LinkEnrollResult, CimplifyError>>;
|
|
1153
|
-
enrollAndLinkOrder(data: EnrollAndLinkOrderInput): Promise<Result<EnrollAndLinkOrderResult, CimplifyError>>;
|
|
1203
|
+
enroll(data: EnrollmentData, opts?: IdempotencyOption$6): Promise<Result<LinkEnrollResult, CimplifyError>>;
|
|
1204
|
+
enrollAndLinkOrder(data: EnrollAndLinkOrderInput, opts?: IdempotencyOption$6): Promise<Result<EnrollAndLinkOrderResult, CimplifyError>>;
|
|
1154
1205
|
updatePreferences(preferences: Partial<CustomerLinkPreferences>): Promise<Result<SuccessResult$1, CimplifyError>>;
|
|
1155
|
-
createAddress(input: CreateAddressInput): Promise<Result<CustomerAddress, CimplifyError>>;
|
|
1206
|
+
createAddress(input: CreateAddressInput, opts?: IdempotencyOption$6): Promise<Result<CustomerAddress, CimplifyError>>;
|
|
1156
1207
|
updateAddress(input: UpdateAddressInput): Promise<Result<SuccessResult$1, CimplifyError>>;
|
|
1157
1208
|
deleteAddress(addressId: string): Promise<Result<SuccessResult$1, CimplifyError>>;
|
|
1158
1209
|
setDefaultAddress(addressId: string): Promise<Result<SuccessResult$1, CimplifyError>>;
|
|
1159
1210
|
trackAddressUsage(addressId: string): Promise<Result<SuccessResult$1, CimplifyError>>;
|
|
1160
|
-
createMobileMoney(input: CreateMobileMoneyInput): Promise<Result<CustomerMobileMoney, CimplifyError>>;
|
|
1211
|
+
createMobileMoney(input: CreateMobileMoneyInput, opts?: IdempotencyOption$6): Promise<Result<CustomerMobileMoney, CimplifyError>>;
|
|
1161
1212
|
deleteMobileMoney(mobileMoneyId: string): Promise<Result<SuccessResult$1, CimplifyError>>;
|
|
1162
1213
|
setDefaultMobileMoney(mobileMoneyId: string): Promise<Result<SuccessResult$1, CimplifyError>>;
|
|
1163
1214
|
trackMobileMoneyUsage(mobileMoneyId: string): Promise<Result<SuccessResult$1, CimplifyError>>;
|
|
1164
|
-
verifyMobileMoney(mobileMoneyId: string): Promise<Result<SuccessResult$1, CimplifyError>>;
|
|
1215
|
+
verifyMobileMoney(mobileMoneyId: string, opts?: IdempotencyOption$6): Promise<Result<SuccessResult$1, CimplifyError>>;
|
|
1165
1216
|
getSessions(): Promise<Result<LinkSession[], CimplifyError>>;
|
|
1166
1217
|
revokeSession(sessionId: string): Promise<Result<RevokeSessionResult, CimplifyError>>;
|
|
1167
1218
|
revokeAllSessions(): Promise<Result<RevokeAllSessionsResult, CimplifyError>>;
|
|
1168
1219
|
}
|
|
1169
1220
|
|
|
1221
|
+
interface IdempotencyOption$5 {
|
|
1222
|
+
idempotencyKey?: string;
|
|
1223
|
+
}
|
|
1170
1224
|
interface AuthStatus {
|
|
1171
1225
|
is_authenticated: boolean;
|
|
1172
1226
|
customer?: Customer;
|
|
@@ -1190,8 +1244,8 @@ declare class AuthService {
|
|
|
1190
1244
|
getStatus(): Promise<Result<AuthStatus, CimplifyError>>;
|
|
1191
1245
|
getCurrentUser(): Promise<Result<Customer | null, CimplifyError>>;
|
|
1192
1246
|
isAuthenticated(): Promise<Result<boolean, CimplifyError>>;
|
|
1193
|
-
requestOtp(contact: string, contactType?: "phone" | "email"): Promise<Result<void, CimplifyError>>;
|
|
1194
|
-
verifyOtp(code: string, contact?: string): Promise<Result<OtpResult, CimplifyError>>;
|
|
1247
|
+
requestOtp(contact: string, contactType?: "phone" | "email", opts?: IdempotencyOption$5): Promise<Result<void, CimplifyError>>;
|
|
1248
|
+
verifyOtp(code: string, contact?: string, opts?: IdempotencyOption$5): Promise<Result<OtpResult, CimplifyError>>;
|
|
1195
1249
|
logout(): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1196
1250
|
updateProfile(input: UpdateProfileInput): Promise<Result<Customer, CimplifyError>>;
|
|
1197
1251
|
}
|
|
@@ -1308,13 +1362,9 @@ interface ServiceCharge {
|
|
|
1308
1362
|
}
|
|
1309
1363
|
interface StorefrontBootstrap {
|
|
1310
1364
|
business: Business;
|
|
1311
|
-
location?: Location;
|
|
1312
1365
|
locations: Location[];
|
|
1366
|
+
default_location_id?: string;
|
|
1313
1367
|
categories: CategoryInfo[];
|
|
1314
|
-
currency: CurrencyCode;
|
|
1315
|
-
is_open: boolean;
|
|
1316
|
-
accepts_orders: boolean;
|
|
1317
|
-
time_profiles?: LocationTimeProfile[];
|
|
1318
1368
|
}
|
|
1319
1369
|
interface BusinessWithLocations extends Business {
|
|
1320
1370
|
locations: Location[];
|
|
@@ -1372,38 +1422,11 @@ interface StockLevel {
|
|
|
1372
1422
|
product_id: string;
|
|
1373
1423
|
variant_id?: string;
|
|
1374
1424
|
location_id?: string;
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
available_quantity: number;
|
|
1378
|
-
low_stock_threshold?: number;
|
|
1425
|
+
/** Absent when the backend cannot compute a real count for this product/location. */
|
|
1426
|
+
available_quantity?: number;
|
|
1379
1427
|
status: StockStatus;
|
|
1380
1428
|
last_updated: string;
|
|
1381
1429
|
}
|
|
1382
|
-
interface ProductStock {
|
|
1383
|
-
product_id: string;
|
|
1384
|
-
product_name: string;
|
|
1385
|
-
total_quantity: number;
|
|
1386
|
-
available_quantity: number;
|
|
1387
|
-
reserved_quantity: number;
|
|
1388
|
-
status: StockStatus;
|
|
1389
|
-
variants?: VariantStock[];
|
|
1390
|
-
locations?: LocationStock[];
|
|
1391
|
-
}
|
|
1392
|
-
interface VariantStock {
|
|
1393
|
-
variant_id: string;
|
|
1394
|
-
variant_name: string;
|
|
1395
|
-
sku?: string;
|
|
1396
|
-
quantity: number;
|
|
1397
|
-
available_quantity: number;
|
|
1398
|
-
status: StockStatus;
|
|
1399
|
-
}
|
|
1400
|
-
interface LocationStock {
|
|
1401
|
-
location_id: string;
|
|
1402
|
-
location_name: string;
|
|
1403
|
-
quantity: number;
|
|
1404
|
-
available_quantity: number;
|
|
1405
|
-
status: StockStatus;
|
|
1406
|
-
}
|
|
1407
1430
|
interface AvailabilityResult {
|
|
1408
1431
|
product_id: string;
|
|
1409
1432
|
variant_id?: string;
|
|
@@ -1417,7 +1440,7 @@ declare class InventoryService {
|
|
|
1417
1440
|
private client;
|
|
1418
1441
|
constructor(client: CimplifyClient);
|
|
1419
1442
|
private withQuery;
|
|
1420
|
-
getProductStock(productId: string, locationId?: string): Promise<Result<
|
|
1443
|
+
getProductStock(productId: string, locationId?: string): Promise<Result<StockLevel, CimplifyError>>;
|
|
1421
1444
|
getVariantStock(variantId: string, locationId?: string): Promise<Result<StockLevel, CimplifyError>>;
|
|
1422
1445
|
checkProductAvailability(productId: string, quantity: number, locationId?: string): Promise<Result<AvailabilityResult, CimplifyError>>;
|
|
1423
1446
|
checkVariantAvailability(variantId: string, quantity: number, locationId?: string): Promise<Result<AvailabilityResult, CimplifyError>>;
|
|
@@ -1427,7 +1450,7 @@ declare class InventoryService {
|
|
|
1427
1450
|
quantity: number;
|
|
1428
1451
|
}[], locationId?: string): Promise<Result<AvailabilityResult[], CimplifyError>>;
|
|
1429
1452
|
isInStock(productId: string, locationId?: string): Promise<Result<boolean, CimplifyError>>;
|
|
1430
|
-
getAvailableQuantity(productId: string, locationId?: string): Promise<Result<number, CimplifyError>>;
|
|
1453
|
+
getAvailableQuantity(productId: string, locationId?: string): Promise<Result<number | undefined, CimplifyError>>;
|
|
1431
1454
|
}
|
|
1432
1455
|
|
|
1433
1456
|
interface Service {
|
|
@@ -1466,7 +1489,7 @@ interface Staff {
|
|
|
1466
1489
|
interface TimeSlot {
|
|
1467
1490
|
start_time: string;
|
|
1468
1491
|
end_time: string;
|
|
1469
|
-
is_available
|
|
1492
|
+
is_available?: boolean;
|
|
1470
1493
|
staff_id?: string;
|
|
1471
1494
|
staff_name?: string;
|
|
1472
1495
|
remaining_capacity?: number;
|
|
@@ -1629,6 +1652,9 @@ interface RescheduleHistoryRecord {
|
|
|
1629
1652
|
metadata?: Record<string, unknown> | null;
|
|
1630
1653
|
}
|
|
1631
1654
|
|
|
1655
|
+
interface IdempotencyOption$4 {
|
|
1656
|
+
idempotencyKey?: string;
|
|
1657
|
+
}
|
|
1632
1658
|
declare class SchedulingService {
|
|
1633
1659
|
private client;
|
|
1634
1660
|
constructor(client: CimplifyClient);
|
|
@@ -1641,8 +1667,8 @@ declare class SchedulingService {
|
|
|
1641
1667
|
getCustomerBookings(customerId?: string): Promise<Result<CustomerBooking[], CimplifyError>>;
|
|
1642
1668
|
getUpcomingBookings(): Promise<Result<CustomerBooking[], CimplifyError>>;
|
|
1643
1669
|
getPastBookings(limit?: number): Promise<Result<CustomerBooking[], CimplifyError>>;
|
|
1644
|
-
cancelBooking(input: CancelBookingInput): Promise<Result<CancelBookingResult, CimplifyError>>;
|
|
1645
|
-
rescheduleBooking(input: RescheduleBookingInput): Promise<Result<RescheduleBookingResult, CimplifyError>>;
|
|
1670
|
+
cancelBooking(input: CancelBookingInput, opts?: IdempotencyOption$4): Promise<Result<CancelBookingResult, CimplifyError>>;
|
|
1671
|
+
rescheduleBooking(input: RescheduleBookingInput, opts?: IdempotencyOption$4): Promise<Result<RescheduleBookingResult, CimplifyError>>;
|
|
1646
1672
|
getNextAvailableSlot(serviceId: string, fromDate?: string): Promise<Result<AvailableSlot | null, CimplifyError>>;
|
|
1647
1673
|
hasAvailabilityOn(serviceId: string, date: string): Promise<Result<boolean, CimplifyError>>;
|
|
1648
1674
|
}
|
|
@@ -1712,11 +1738,14 @@ interface FxRateResponse {
|
|
|
1712
1738
|
valid_until: string;
|
|
1713
1739
|
}
|
|
1714
1740
|
|
|
1741
|
+
interface IdempotencyOption$3 {
|
|
1742
|
+
idempotencyKey?: string;
|
|
1743
|
+
}
|
|
1715
1744
|
declare class FxService {
|
|
1716
1745
|
private client;
|
|
1717
1746
|
constructor(client: CimplifyClient);
|
|
1718
1747
|
getRate(from: CurrencyCode, to: CurrencyCode): Promise<Result<FxRateResponse, CimplifyError>>;
|
|
1719
|
-
lockQuote(request: FxQuoteRequest): Promise<Result<FxQuote, CimplifyError>>;
|
|
1748
|
+
lockQuote(request: FxQuoteRequest, opts?: IdempotencyOption$3): Promise<Result<FxQuote, CimplifyError>>;
|
|
1720
1749
|
}
|
|
1721
1750
|
|
|
1722
1751
|
interface TrackProductViewOptions {
|
|
@@ -1797,12 +1826,15 @@ declare class ActivityService {
|
|
|
1797
1826
|
private sendEvents;
|
|
1798
1827
|
}
|
|
1799
1828
|
|
|
1829
|
+
interface IdempotencyOption$2 {
|
|
1830
|
+
idempotencyKey?: string;
|
|
1831
|
+
}
|
|
1800
1832
|
declare class SubscriptionService {
|
|
1801
1833
|
private client;
|
|
1802
1834
|
constructor(client: CimplifyClient);
|
|
1803
1835
|
list(): Promise<Result<Subscription[], CimplifyError>>;
|
|
1804
1836
|
get(id: string): Promise<Result<SubscriptionWithDetails, CimplifyError>>;
|
|
1805
|
-
cancel(id: string, reason?: string): Promise<Result<{
|
|
1837
|
+
cancel(id: string, reason?: string, opts?: IdempotencyOption$2): Promise<Result<{
|
|
1806
1838
|
success: boolean;
|
|
1807
1839
|
}, CimplifyError>>;
|
|
1808
1840
|
pause(id: string): Promise<Result<{
|
|
@@ -1811,11 +1843,14 @@ declare class SubscriptionService {
|
|
|
1811
1843
|
resume(id: string): Promise<Result<{
|
|
1812
1844
|
success: boolean;
|
|
1813
1845
|
}, CimplifyError>>;
|
|
1814
|
-
skipNextRenewal(id: string): Promise<Result<{
|
|
1846
|
+
skipNextRenewal(id: string, opts?: IdempotencyOption$2): Promise<Result<{
|
|
1815
1847
|
success: boolean;
|
|
1816
1848
|
}, CimplifyError>>;
|
|
1817
1849
|
}
|
|
1818
1850
|
|
|
1851
|
+
interface IdempotencyOption$1 {
|
|
1852
|
+
idempotencyKey?: string;
|
|
1853
|
+
}
|
|
1819
1854
|
interface UploadInitResponse {
|
|
1820
1855
|
upload_id: string;
|
|
1821
1856
|
upload_url: string;
|
|
@@ -1831,7 +1866,7 @@ interface UploadResult {
|
|
|
1831
1866
|
declare class UploadService {
|
|
1832
1867
|
private client;
|
|
1833
1868
|
constructor(client: CimplifyClient);
|
|
1834
|
-
init(filename: string, contentType: string, sizeBytes: number): Promise<Result<UploadInitResponse, CimplifyError>>;
|
|
1869
|
+
init(filename: string, contentType: string, sizeBytes: number, opts?: IdempotencyOption$1): Promise<Result<UploadInitResponse, CimplifyError>>;
|
|
1835
1870
|
confirm(uploadId: string): Promise<Result<UploadResult, CimplifyError>>;
|
|
1836
1871
|
upload(file: File): Promise<Result<UploadResult, CimplifyError>>;
|
|
1837
1872
|
}
|
|
@@ -1907,13 +1942,16 @@ interface ChatWidgetStarter {
|
|
|
1907
1942
|
text: string;
|
|
1908
1943
|
}
|
|
1909
1944
|
|
|
1945
|
+
interface IdempotencyOption {
|
|
1946
|
+
idempotencyKey?: string;
|
|
1947
|
+
}
|
|
1910
1948
|
declare class SupportService {
|
|
1911
1949
|
private client;
|
|
1912
1950
|
constructor(client: CimplifyClient);
|
|
1913
1951
|
/** Open (or resume) the customer's widget conversation. */
|
|
1914
|
-
openConversation(): Promise<Result<ChatConversationResponse, CimplifyError>>;
|
|
1952
|
+
openConversation(opts?: IdempotencyOption): Promise<Result<ChatConversationResponse, CimplifyError>>;
|
|
1915
1953
|
/** Send a message in the active conversation. */
|
|
1916
|
-
sendMessage(content: string): Promise<Result<ChatMessage, CimplifyError>>;
|
|
1954
|
+
sendMessage(content: string, opts?: IdempotencyOption): Promise<Result<ChatMessage, CimplifyError>>;
|
|
1917
1955
|
/** Poll for new messages since the given cursor. */
|
|
1918
1956
|
getMessages(options?: {
|
|
1919
1957
|
after?: string;
|
|
@@ -2250,6 +2288,10 @@ declare class CimplifyElement {
|
|
|
2250
2288
|
}
|
|
2251
2289
|
declare function createElements(client: CimplifyClient, businessId?: string, options?: ElementsOptions): CimplifyElements;
|
|
2252
2290
|
|
|
2291
|
+
interface RequestOptions {
|
|
2292
|
+
idempotencyKey?: string;
|
|
2293
|
+
headers?: Record<string, string>;
|
|
2294
|
+
}
|
|
2253
2295
|
interface CimplifyConfig {
|
|
2254
2296
|
publicKey?: string;
|
|
2255
2297
|
credentials?: RequestCredentials;
|
|
@@ -2276,6 +2318,13 @@ declare class CimplifyClient {
|
|
|
2276
2318
|
private businessId;
|
|
2277
2319
|
private businessIdResolvePromise;
|
|
2278
2320
|
private inflightRequests;
|
|
2321
|
+
/**
|
|
2322
|
+
* App-level event channel. Subscribe to surface mutation rollbacks, outbox
|
|
2323
|
+
* activity, and dead-letter notifications to consumer code (toasts,
|
|
2324
|
+
* Sentry, analytics, etc.). The SDK emits but never auto-consumes — the
|
|
2325
|
+
* consumer decides how to react.
|
|
2326
|
+
*/
|
|
2327
|
+
readonly events: ClientEvents;
|
|
2279
2328
|
private buildUrl;
|
|
2280
2329
|
private _catalogue?;
|
|
2281
2330
|
private _cart?;
|
|
@@ -2318,12 +2367,12 @@ declare class CimplifyClient {
|
|
|
2318
2367
|
private getDedupeKey;
|
|
2319
2368
|
private deduplicatedRequest;
|
|
2320
2369
|
get<T = unknown>(path: string): Promise<T>;
|
|
2321
|
-
post<T = unknown>(path: string, body?: unknown): Promise<T>;
|
|
2322
|
-
patch<T = unknown>(path: string, body?: unknown): Promise<T>;
|
|
2323
|
-
delete<T = unknown>(path: string): Promise<T>;
|
|
2370
|
+
post<T = unknown>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
2371
|
+
patch<T = unknown>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
2372
|
+
delete<T = unknown>(path: string, opts?: RequestOptions): Promise<T>;
|
|
2324
2373
|
linkGet<T = unknown>(path: string): Promise<T>;
|
|
2325
|
-
linkPost<T = unknown>(path: string, body?: unknown): Promise<T>;
|
|
2326
|
-
linkDelete<T = unknown>(path: string): Promise<T>;
|
|
2374
|
+
linkPost<T = unknown>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
2375
|
+
linkDelete<T = unknown>(path: string, opts?: RequestOptions): Promise<T>;
|
|
2327
2376
|
private handleRestResponse;
|
|
2328
2377
|
get catalogue(): CatalogueQueries;
|
|
2329
2378
|
get cart(): CartOperations;
|
|
@@ -2347,4 +2396,4 @@ declare class CimplifyClient {
|
|
|
2347
2396
|
}
|
|
2348
2397
|
declare function createCimplifyClient(config?: CimplifyConfig): CimplifyClient;
|
|
2349
2398
|
|
|
2350
|
-
export { type
|
|
2399
|
+
export { type ChatAttachment as $, AuthService as A, BusinessService as B, CimplifyClient as C, type TrackCategoryViewOptions as D, type SessionMessage as E, type FetchQuoteInput as F, type GetProductsOptions as G, type SessionActivityData as H, InventoryService as I, type ActivityStateResponse as J, type ActivityRecommendation as K, LinkService as L, type ActivityRecommendationsResponse as M, type DismissMessageResponse as N, OrderQueries as O, type PriceQuote as P, type QuoteCompositeSelectionInput as Q, type RefreshQuoteInput as R, SubscriptionService as S, type TrackProductViewOptions as T, type UpdateProfileInput as U, DeliveryService as V, type DeliveryFeeResponse as W, SupportService as X, type ChatMessage as Y, type ChatConversation as Z, type ChatConversationResponse as _, type CimplifyConfig as a, tryCatch as a$, type ChatWidgetStarter as a0, type SenderType as a1, type ContentType as a2, type LiteBootstrap as a3, type TableInfo as a4, CimplifyElements as a5, CimplifyElement as a6, createElements as a7, MESSAGE_TYPES as a8, EVENT_TYPES as a9, PICKUP_TIME_TYPE as aA, MOBILE_MONEY_PROVIDER as aB, AUTHORIZATION_TYPE as aC, DEVICE_TYPE as aD, CONTACT_TYPE as aE, LINK_QUERY as aF, LINK_MUTATION as aG, AUTH_MUTATION as aH, CHECKOUT_MUTATION as aI, PAYMENT_MUTATION as aJ, ORDER_MUTATION as aK, DEFAULT_CURRENCY as aL, DEFAULT_COUNTRY as aM, type Result as aN, type Ok as aO, type Err as aP, ok as aQ, err as aR, isOk as aS, isErr as aT, mapResult as aU, mapError as aV, flatMap as aW, getOrElse as aX, unwrap as aY, toNullable as aZ, fromPromise as a_, ELEMENT_TYPES as aa, type ElementsOptions as ab, type ElementOptions as ac, type ElementType as ad, type ElementEventType as ae, type CheckoutMode as af, type CheckoutOrderType as ag, type CheckoutPaymentMethod as ah, type CheckoutStep as ai, type CheckoutFormData as aj, type CheckoutResult as ak, type NextAction as al, type ProcessCheckoutOptions as am, type ProcessCheckoutResult as an, type ProcessAndResolveOptions as ao, type CheckoutStatus as ap, type CheckoutStatusContext as aq, type AbortablePromise as ar, type MobileMoneyProvider as as, type DeviceType as at, type ContactType as au, CHECKOUT_MODE as av, ORDER_TYPE as aw, PAYMENT_METHOD as ax, CHECKOUT_STEP as ay, PAYMENT_STATE as az, CatalogueQueries as b, type TimeRanges as b$, combine as b0, combineObject as b1, type CatalogueResult as b2, type CatalogueSnapshot as b3, type OrderStatus as b4, type PaymentState as b5, type OrderChannel as b6, type LineType as b7, type OrderLineState as b8, type OrderLineStatus as b9, type CustomerServicePreferences as bA, type BufferTimes as bB, type ReminderSettings as bC, type CancellationPolicy as bD, type ServiceNotes as bE, type PricingOverrides as bF, type SchedulingMetadata as bG, type StaffAssignment as bH, type ResourceAssignment as bI, type SchedulingResult as bJ, type DepositResult as bK, type ServiceScheduleRequest as bL, type StaffScheduleItem as bM, type LocationBooking as bN, type ProviderResolutionSource as bO, type DeliveryFeeDetails as bP, type RelationType as bQ, type RelatedProduct as bR, type RelatedCandidate as bS, type RelatedProductsEnrichment as bT, type BusinessType as bU, type BusinessPreferences as bV, type Business as bW, type LocationTaxBehavior as bX, type LocationTaxOverrides as bY, type Location as bZ, type TimeRange as b_, type FulfillmentType as ba, type FulfillmentStatus as bb, type FulfillmentLink as bc, type OrderFulfillmentSummary as bd, type FeeBearerType as be, type AmountToPay as bf, type LineItem as bg, type Order as bh, type OrderHistory as bi, type OrderGroupStatus as bj, type OrderGroupPaymentState as bk, type OrderGroupPaymentStatus as bl, type OrderGroup as bm, type OrderGroupPayment as bn, type OrderSplitDetail as bo, type OrderGroupPaymentSummary as bp, type OrderGroupDetails as bq, type OrderPaymentEvent as br, type OrderFilter as bs, type CheckoutInput as bt, type UpdateOrderStatusInput as bu, type CancelOrderInput as bv, type RefundOrderInput as bw, type ServiceStatus as bx, type StaffRole as by, type ReminderMethod as bz, createCimplifyClient as c, type FxQuote as c$, type LocationTimeProfile as c0, type Table as c1, type Room as c2, type ServiceCharge as c3, type StorefrontBootstrap as c4, type BusinessWithLocations as c5, type LocationWithDetails as c6, type BusinessSettings as c7, type BusinessHours as c8, type CategoryInfo as c9, type Customer as cA, type CustomerAddress as cB, type CustomerMobileMoney as cC, type CustomerLinkPreferences as cD, type LinkData as cE, type CreateAddressInput as cF, type UpdateAddressInput as cG, type CreateMobileMoneyInput as cH, type EnrollmentData as cI, type AddressData as cJ, type MobileMoneyData as cK, type EnrollAndLinkOrderInput as cL, type LinkStatusResult as cM, type LinkEnrollResult as cN, type EnrollAndLinkOrderResult as cO, type LinkSession as cP, type RevokeSessionResult as cQ, type RevokeAllSessionsResult as cR, type RequestOtpInput as cS, type VerifyOtpInput as cT, type AuthResponse as cU, type PickupTimeType as cV, type PickupTime as cW, type CheckoutAddressInfo as cX, type MobileMoneyDetails as cY, type CheckoutCustomerInfo as cZ, type FxQuoteRequest as c_, type Service as ca, type Staff as cb, type TimeSlot as cc, type SlotResourceInfo as cd, type SlotStaffInfo as ce, type AvailableSlot as cf, type DayAvailability as cg, type BookingStatus as ch, type Booking as ci, type BookingWithDetails as cj, type CustomerBookingServiceItem as ck, type CustomerBooking as cl, type GetAvailableSlotsInput as cm, type CheckSlotAvailabilityInput as cn, type CheckSlotAvailabilityResult as co, type RescheduleBookingInput as cp, type CancelBookingInput as cq, type CancelBookingResult as cr, type BookingModificationType as cs, type RescheduleBookingResult as ct, type ServiceAvailabilityParams as cu, type ServiceAvailabilityResult as cv, type RescheduleHistoryRecord as cw, type StockStatus as cx, type StockLevel as cy, type AvailabilityResult as cz, type QuoteBundleSelectionInput as d, type FxRateResponse as d0, type RequestContext as d1, type RequestStartEvent as d2, type RequestSuccessEvent as d3, type RequestErrorEvent as d4, type RetryEvent as d5, type SessionChangeEvent as d6, type ObservabilityHooks as d7, type OrderType as d8, type ElementAppearance as d9, type AddressInfo as da, type PaymentMethodInfo as db, type AuthenticatedCustomer as dc, type ElementsCustomerInfo as dd, type AuthenticatedData as de, type ElementsCheckoutData as df, type ElementsCheckoutResult as dg, type CheckoutCartItem as dh, type CheckoutCartData as di, type ParentToIframeMessage as dj, type IframeToParentMessage as dk, type ElementEventHandler as dl, type QuoteStatus as e, type QuoteDynamicBuckets as f, type QuoteUiMessage as g, type RequestSource as h, type RefreshQuoteResult as i, CartOperations as j, type ReorderResult as k, CheckoutService as l, type GetOrdersOptions as m, type AuthStatus as n, type OtpResult as o, SchedulingService as p, LiteService as q, FxService as r, ActivityService as s, UploadService as t, type UploadResult as u, type UploadInitResponse as v, PlacesService as w, type AutocompletePrediction as x, type AutocompleteResponse as y, type PlaceDetailsResponse as z };
|