@cimplify/sdk 0.2.5 → 0.3.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/index.d.mts +296 -55
- package/dist/index.d.ts +296 -55
- package/dist/index.js +333 -89
- package/dist/index.mjs +320 -90
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1075,6 +1075,172 @@ interface CartSummary {
|
|
|
1075
1075
|
currency: string;
|
|
1076
1076
|
}
|
|
1077
1077
|
|
|
1078
|
+
/**
|
|
1079
|
+
* A Result type that makes errors explicit in the type system.
|
|
1080
|
+
* Inspired by Rust's Result and fp-ts Either.
|
|
1081
|
+
*
|
|
1082
|
+
* @example
|
|
1083
|
+
* ```typescript
|
|
1084
|
+
* const result = await client.cart.addItemSafe({ item_id: "prod_123" });
|
|
1085
|
+
*
|
|
1086
|
+
* if (result.ok) {
|
|
1087
|
+
* console.log(result.value); // Cart
|
|
1088
|
+
* } else {
|
|
1089
|
+
* console.log(result.error); // CimplifyError
|
|
1090
|
+
* }
|
|
1091
|
+
* ```
|
|
1092
|
+
*/
|
|
1093
|
+
type Result<T, E = Error> = Ok<T> | Err<E>;
|
|
1094
|
+
interface Ok<T> {
|
|
1095
|
+
readonly ok: true;
|
|
1096
|
+
readonly value: T;
|
|
1097
|
+
}
|
|
1098
|
+
interface Err<E> {
|
|
1099
|
+
readonly ok: false;
|
|
1100
|
+
readonly error: E;
|
|
1101
|
+
}
|
|
1102
|
+
/** Create a successful Result */
|
|
1103
|
+
declare function ok<T>(value: T): Ok<T>;
|
|
1104
|
+
/** Create a failed Result */
|
|
1105
|
+
declare function err<E>(error: E): Err<E>;
|
|
1106
|
+
/** Check if Result is Ok */
|
|
1107
|
+
declare function isOk<T, E>(result: Result<T, E>): result is Ok<T>;
|
|
1108
|
+
/** Check if Result is Err */
|
|
1109
|
+
declare function isErr<T, E>(result: Result<T, E>): result is Err<E>;
|
|
1110
|
+
/**
|
|
1111
|
+
* Transform the success value of a Result.
|
|
1112
|
+
*
|
|
1113
|
+
* @example
|
|
1114
|
+
* ```typescript
|
|
1115
|
+
* const result = ok(5);
|
|
1116
|
+
* const doubled = mapResult(result, (n) => n * 2);
|
|
1117
|
+
* // doubled = { ok: true, value: 10 }
|
|
1118
|
+
* ```
|
|
1119
|
+
*/
|
|
1120
|
+
declare function mapResult<T, U, E>(result: Result<T, E>, fn: (value: T) => U): Result<U, E>;
|
|
1121
|
+
/**
|
|
1122
|
+
* Transform the error value of a Result.
|
|
1123
|
+
*
|
|
1124
|
+
* @example
|
|
1125
|
+
* ```typescript
|
|
1126
|
+
* const result = err(new Error("oops"));
|
|
1127
|
+
* const mapped = mapError(result, (e) => new CustomError(e.message));
|
|
1128
|
+
* ```
|
|
1129
|
+
*/
|
|
1130
|
+
declare function mapError<T, E, F>(result: Result<T, E>, fn: (error: E) => F): Result<T, F>;
|
|
1131
|
+
/**
|
|
1132
|
+
* Chain Results together. If the first Result is Ok, apply the function.
|
|
1133
|
+
* If it's Err, propagate the error.
|
|
1134
|
+
*
|
|
1135
|
+
* @example
|
|
1136
|
+
* ```typescript
|
|
1137
|
+
* const getUser = (id: string): Result<User, Error> => { ... }
|
|
1138
|
+
* const getOrders = (user: User): Result<Order[], Error> => { ... }
|
|
1139
|
+
*
|
|
1140
|
+
* const result = flatMap(getUser("123"), (user) => getOrders(user));
|
|
1141
|
+
* ```
|
|
1142
|
+
*/
|
|
1143
|
+
declare function flatMap<T, U, E>(result: Result<T, E>, fn: (value: T) => Result<U, E>): Result<U, E>;
|
|
1144
|
+
/**
|
|
1145
|
+
* Get the value or a default if the Result is Err.
|
|
1146
|
+
*
|
|
1147
|
+
* @example
|
|
1148
|
+
* ```typescript
|
|
1149
|
+
* const result = err(new Error("failed"));
|
|
1150
|
+
* const value = getOrElse(result, () => defaultCart);
|
|
1151
|
+
* ```
|
|
1152
|
+
*/
|
|
1153
|
+
declare function getOrElse<T, E>(result: Result<T, E>, defaultFn: () => T): T;
|
|
1154
|
+
/**
|
|
1155
|
+
* Get the value or throw the error.
|
|
1156
|
+
* Use sparingly - defeats the purpose of Result!
|
|
1157
|
+
*
|
|
1158
|
+
* @example
|
|
1159
|
+
* ```typescript
|
|
1160
|
+
* const cart = unwrap(result); // throws if Err
|
|
1161
|
+
* ```
|
|
1162
|
+
*/
|
|
1163
|
+
declare function unwrap<T, E>(result: Result<T, E>): T;
|
|
1164
|
+
/**
|
|
1165
|
+
* Get the value or undefined if Err.
|
|
1166
|
+
*
|
|
1167
|
+
* @example
|
|
1168
|
+
* ```typescript
|
|
1169
|
+
* const cart = toNullable(result); // Cart | undefined
|
|
1170
|
+
* ```
|
|
1171
|
+
*/
|
|
1172
|
+
declare function toNullable<T, E>(result: Result<T, E>): T | undefined;
|
|
1173
|
+
/**
|
|
1174
|
+
* Convert a Promise that might throw into a Result.
|
|
1175
|
+
*
|
|
1176
|
+
* @example
|
|
1177
|
+
* ```typescript
|
|
1178
|
+
* const result = await fromPromise(
|
|
1179
|
+
* fetch("/api/data"),
|
|
1180
|
+
* (error) => new NetworkError(error.message)
|
|
1181
|
+
* );
|
|
1182
|
+
* ```
|
|
1183
|
+
*/
|
|
1184
|
+
declare function fromPromise<T, E>(promise: Promise<T>, mapError: (error: unknown) => E): Promise<Result<T, E>>;
|
|
1185
|
+
/**
|
|
1186
|
+
* Convert a function that might throw into one that returns Result.
|
|
1187
|
+
*
|
|
1188
|
+
* @example
|
|
1189
|
+
* ```typescript
|
|
1190
|
+
* const safeParse = tryCatch(
|
|
1191
|
+
* () => JSON.parse(input),
|
|
1192
|
+
* (e) => new ParseError(e.message)
|
|
1193
|
+
* );
|
|
1194
|
+
* ```
|
|
1195
|
+
*/
|
|
1196
|
+
declare function tryCatch<T, E>(fn: () => T, mapError: (error: unknown) => E): Result<T, E>;
|
|
1197
|
+
/**
|
|
1198
|
+
* Combine multiple Results. Returns Ok with array of values if all succeed,
|
|
1199
|
+
* or the first Err encountered.
|
|
1200
|
+
*
|
|
1201
|
+
* @example
|
|
1202
|
+
* ```typescript
|
|
1203
|
+
* const results = await Promise.all([
|
|
1204
|
+
* client.cart.getSafe(),
|
|
1205
|
+
* client.business.getSafe(),
|
|
1206
|
+
* ]);
|
|
1207
|
+
* const combined = combine(results);
|
|
1208
|
+
* // Result<[Cart, Business], CimplifyError>
|
|
1209
|
+
* ```
|
|
1210
|
+
*/
|
|
1211
|
+
declare function combine<T, E>(results: Result<T, E>[]): Result<T[], E>;
|
|
1212
|
+
/**
|
|
1213
|
+
* Like combine, but for an object of Results.
|
|
1214
|
+
*
|
|
1215
|
+
* @example
|
|
1216
|
+
* ```typescript
|
|
1217
|
+
* const data = combineObject({
|
|
1218
|
+
* cart: await client.cart.getSafe(),
|
|
1219
|
+
* business: await client.business.getSafe(),
|
|
1220
|
+
* });
|
|
1221
|
+
* // Result<{ cart: Cart, business: Business }, CimplifyError>
|
|
1222
|
+
* ```
|
|
1223
|
+
*/
|
|
1224
|
+
declare function combineObject<T extends Record<string, Result<unknown, unknown>>>(results: T): Result<{
|
|
1225
|
+
[K in keyof T]: T[K] extends Result<infer V, unknown> ? V : never;
|
|
1226
|
+
}, T[keyof T] extends Result<unknown, infer E> ? E : never>;
|
|
1227
|
+
|
|
1228
|
+
/**
|
|
1229
|
+
* Cart operations with explicit error handling via Result type.
|
|
1230
|
+
*
|
|
1231
|
+
* All methods return `Result<T, CimplifyError>` - no exceptions thrown.
|
|
1232
|
+
*
|
|
1233
|
+
* @example
|
|
1234
|
+
* ```typescript
|
|
1235
|
+
* const result = await client.cart.addItem({ item_id: "prod_123" });
|
|
1236
|
+
*
|
|
1237
|
+
* if (result.ok) {
|
|
1238
|
+
* console.log("Added!", result.value);
|
|
1239
|
+
* } else {
|
|
1240
|
+
* console.error("Failed:", result.error.code);
|
|
1241
|
+
* }
|
|
1242
|
+
* ```
|
|
1243
|
+
*/
|
|
1078
1244
|
declare class CartOperations {
|
|
1079
1245
|
private client;
|
|
1080
1246
|
constructor(client: CimplifyClient);
|
|
@@ -1082,22 +1248,46 @@ declare class CartOperations {
|
|
|
1082
1248
|
* Get the enriched cart with product names, images, and details.
|
|
1083
1249
|
* This is the main method for storefront display.
|
|
1084
1250
|
*/
|
|
1085
|
-
get(): Promise<UICart
|
|
1086
|
-
getRaw(): Promise<Cart
|
|
1087
|
-
getItems(): Promise<CartItem[]
|
|
1088
|
-
getCount(): Promise<number
|
|
1089
|
-
getTotal(): Promise<string
|
|
1090
|
-
getSummary(): Promise<CartSummary
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1251
|
+
get(): Promise<Result<UICart, CimplifyError>>;
|
|
1252
|
+
getRaw(): Promise<Result<Cart, CimplifyError>>;
|
|
1253
|
+
getItems(): Promise<Result<CartItem[], CimplifyError>>;
|
|
1254
|
+
getCount(): Promise<Result<number, CimplifyError>>;
|
|
1255
|
+
getTotal(): Promise<Result<string, CimplifyError>>;
|
|
1256
|
+
getSummary(): Promise<Result<CartSummary, CimplifyError>>;
|
|
1257
|
+
/**
|
|
1258
|
+
* Add an item to the cart.
|
|
1259
|
+
*
|
|
1260
|
+
* @example
|
|
1261
|
+
* ```typescript
|
|
1262
|
+
* const result = await client.cart.addItem({
|
|
1263
|
+
* item_id: "prod_burger",
|
|
1264
|
+
* quantity: 2,
|
|
1265
|
+
* variant_id: "var_large",
|
|
1266
|
+
* add_on_options: ["addon_cheese", "addon_bacon"],
|
|
1267
|
+
* });
|
|
1268
|
+
*
|
|
1269
|
+
* if (!result.ok) {
|
|
1270
|
+
* switch (result.error.code) {
|
|
1271
|
+
* case ErrorCode.ITEM_UNAVAILABLE:
|
|
1272
|
+
* toast.error("Item no longer available");
|
|
1273
|
+
* break;
|
|
1274
|
+
* case ErrorCode.VARIANT_OUT_OF_STOCK:
|
|
1275
|
+
* toast.error("Selected option is out of stock");
|
|
1276
|
+
* break;
|
|
1277
|
+
* }
|
|
1278
|
+
* }
|
|
1279
|
+
* ```
|
|
1280
|
+
*/
|
|
1281
|
+
addItem(input: AddToCartInput): Promise<Result<Cart, CimplifyError>>;
|
|
1282
|
+
updateItem(cartItemId: string, updates: UpdateCartItemInput): Promise<Result<Cart, CimplifyError>>;
|
|
1283
|
+
updateQuantity(cartItemId: string, quantity: number): Promise<Result<Cart, CimplifyError>>;
|
|
1284
|
+
removeItem(cartItemId: string): Promise<Result<Cart, CimplifyError>>;
|
|
1285
|
+
clear(): Promise<Result<Cart, CimplifyError>>;
|
|
1286
|
+
applyCoupon(code: string): Promise<Result<Cart, CimplifyError>>;
|
|
1287
|
+
removeCoupon(): Promise<Result<Cart, CimplifyError>>;
|
|
1288
|
+
isEmpty(): Promise<Result<boolean, CimplifyError>>;
|
|
1289
|
+
hasItem(productId: string, variantId?: string): Promise<Result<boolean, CimplifyError>>;
|
|
1290
|
+
findItem(productId: string, variantId?: string): Promise<Result<CartItem | undefined, CimplifyError>>;
|
|
1101
1291
|
}
|
|
1102
1292
|
|
|
1103
1293
|
type OrderStatus = "pending" | "created" | "confirmed" | "in_preparation" | "ready_to_serve" | "partially_served" | "served" | "delivered" | "picked_up" | "completed" | "cancelled" | "refunded";
|
|
@@ -1766,15 +1956,61 @@ interface CheckoutResult {
|
|
|
1766
1956
|
public_key?: string;
|
|
1767
1957
|
}
|
|
1768
1958
|
|
|
1959
|
+
/**
|
|
1960
|
+
* Checkout service with explicit error handling via Result type.
|
|
1961
|
+
*
|
|
1962
|
+
* All methods return `Result<T, CimplifyError>` - no exceptions thrown.
|
|
1963
|
+
*
|
|
1964
|
+
* @example
|
|
1965
|
+
* ```typescript
|
|
1966
|
+
* const result = await client.checkout.process(formData);
|
|
1967
|
+
*
|
|
1968
|
+
* if (result.ok) {
|
|
1969
|
+
* const checkout = result.value;
|
|
1970
|
+
* if (checkout.requires_authorization) {
|
|
1971
|
+
* // Handle OTP flow
|
|
1972
|
+
* } else if (checkout.client_secret) {
|
|
1973
|
+
* // Open Paystack popup
|
|
1974
|
+
* }
|
|
1975
|
+
* } else {
|
|
1976
|
+
* toast.error(result.error.message);
|
|
1977
|
+
* }
|
|
1978
|
+
* ```
|
|
1979
|
+
*/
|
|
1769
1980
|
declare class CheckoutService {
|
|
1770
1981
|
private client;
|
|
1771
1982
|
constructor(client: CimplifyClient);
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1983
|
+
/**
|
|
1984
|
+
* Process checkout with cart data.
|
|
1985
|
+
*
|
|
1986
|
+
* @example
|
|
1987
|
+
* ```typescript
|
|
1988
|
+
* const result = await client.checkout.process({
|
|
1989
|
+
* cart_id: cart.id,
|
|
1990
|
+
* customer: { name, email, phone, save_details: true },
|
|
1991
|
+
* order_type: "pickup",
|
|
1992
|
+
* payment_method: "mobile_money",
|
|
1993
|
+
* mobile_money_details: { phone_number, provider: "mtn" },
|
|
1994
|
+
* });
|
|
1995
|
+
*
|
|
1996
|
+
* if (!result.ok) {
|
|
1997
|
+
* switch (result.error.code) {
|
|
1998
|
+
* case ErrorCode.CART_EMPTY:
|
|
1999
|
+
* toast.error("Your cart is empty");
|
|
2000
|
+
* break;
|
|
2001
|
+
* case ErrorCode.PAYMENT_FAILED:
|
|
2002
|
+
* toast.error("Payment failed. Please try again.");
|
|
2003
|
+
* break;
|
|
2004
|
+
* }
|
|
2005
|
+
* }
|
|
2006
|
+
* ```
|
|
2007
|
+
*/
|
|
2008
|
+
process(data: CheckoutFormData): Promise<Result<CheckoutResult, CimplifyError>>;
|
|
2009
|
+
initializePayment(orderId: string, method: PaymentMethod): Promise<Result<InitializePaymentResult, CimplifyError>>;
|
|
2010
|
+
submitAuthorization(input: SubmitAuthorizationInput): Promise<Result<CheckoutResult, CimplifyError>>;
|
|
2011
|
+
pollPaymentStatus(orderId: string): Promise<Result<PaymentStatusResponse, CimplifyError>>;
|
|
2012
|
+
updateOrderCustomer(orderId: string, customer: CheckoutCustomerInfo): Promise<Result<Order, CimplifyError>>;
|
|
2013
|
+
verifyPayment(orderId: string): Promise<Result<Order, CimplifyError>>;
|
|
1778
2014
|
}
|
|
1779
2015
|
|
|
1780
2016
|
interface GetOrdersOptions {
|
|
@@ -1796,41 +2032,46 @@ interface SuccessResult {
|
|
|
1796
2032
|
success: boolean;
|
|
1797
2033
|
message?: string;
|
|
1798
2034
|
}
|
|
2035
|
+
/**
|
|
2036
|
+
* Cimplify Link service for express checkout with saved customer data.
|
|
2037
|
+
*
|
|
2038
|
+
* All methods return `Result<T, CimplifyError>` - no exceptions thrown.
|
|
2039
|
+
*/
|
|
1799
2040
|
declare class LinkService {
|
|
1800
2041
|
private client;
|
|
1801
2042
|
constructor(client: CimplifyClient);
|
|
1802
|
-
requestOtp(input: RequestOtpInput): Promise<SuccessResult
|
|
1803
|
-
verifyOtp(input: VerifyOtpInput): Promise<AuthResponse
|
|
1804
|
-
logout(): Promise<SuccessResult
|
|
1805
|
-
checkStatus(contact: string): Promise<LinkStatusResult
|
|
1806
|
-
getLinkData(): Promise<LinkData
|
|
1807
|
-
getAddresses(): Promise<CustomerAddress[]
|
|
1808
|
-
getMobileMoney(): Promise<CustomerMobileMoney[]
|
|
1809
|
-
getPreferences(): Promise<CustomerLinkPreferences
|
|
1810
|
-
enroll(data: EnrollmentData): Promise<LinkEnrollResult
|
|
1811
|
-
enrollAndLinkOrder(data: EnrollAndLinkOrderInput): Promise<EnrollAndLinkOrderResult
|
|
1812
|
-
updatePreferences(preferences: Partial<CustomerLinkPreferences>): Promise<SuccessResult
|
|
1813
|
-
createAddress(input: CreateAddressInput): Promise<CustomerAddress
|
|
1814
|
-
updateAddress(input: UpdateAddressInput): Promise<SuccessResult
|
|
1815
|
-
deleteAddress(addressId: string): Promise<SuccessResult
|
|
1816
|
-
setDefaultAddress(addressId: string): Promise<SuccessResult
|
|
1817
|
-
trackAddressUsage(addressId: string): Promise<SuccessResult
|
|
1818
|
-
createMobileMoney(input: CreateMobileMoneyInput): Promise<CustomerMobileMoney
|
|
1819
|
-
deleteMobileMoney(mobileMoneyId: string): Promise<SuccessResult
|
|
1820
|
-
setDefaultMobileMoney(mobileMoneyId: string): Promise<SuccessResult
|
|
1821
|
-
trackMobileMoneyUsage(mobileMoneyId: string): Promise<SuccessResult
|
|
1822
|
-
verifyMobileMoney(mobileMoneyId: string): Promise<SuccessResult
|
|
1823
|
-
getSessions(): Promise<LinkSession[]
|
|
1824
|
-
revokeSession(sessionId: string): Promise<RevokeSessionResult
|
|
1825
|
-
revokeAllSessions(): Promise<RevokeAllSessionsResult
|
|
1826
|
-
getAddressesRest(): Promise<CustomerAddress[]
|
|
1827
|
-
createAddressRest(input: CreateAddressInput): Promise<CustomerAddress
|
|
1828
|
-
deleteAddressRest(addressId: string): Promise<SuccessResult
|
|
1829
|
-
setDefaultAddressRest(addressId: string): Promise<SuccessResult
|
|
1830
|
-
getMobileMoneyRest(): Promise<CustomerMobileMoney[]
|
|
1831
|
-
createMobileMoneyRest(input: CreateMobileMoneyInput): Promise<CustomerMobileMoney
|
|
1832
|
-
deleteMobileMoneyRest(mobileMoneyId: string): Promise<SuccessResult
|
|
1833
|
-
setDefaultMobileMoneyRest(mobileMoneyId: string): Promise<SuccessResult
|
|
2043
|
+
requestOtp(input: RequestOtpInput): Promise<Result<SuccessResult, CimplifyError>>;
|
|
2044
|
+
verifyOtp(input: VerifyOtpInput): Promise<Result<AuthResponse, CimplifyError>>;
|
|
2045
|
+
logout(): Promise<Result<SuccessResult, CimplifyError>>;
|
|
2046
|
+
checkStatus(contact: string): Promise<Result<LinkStatusResult, CimplifyError>>;
|
|
2047
|
+
getLinkData(): Promise<Result<LinkData, CimplifyError>>;
|
|
2048
|
+
getAddresses(): Promise<Result<CustomerAddress[], CimplifyError>>;
|
|
2049
|
+
getMobileMoney(): Promise<Result<CustomerMobileMoney[], CimplifyError>>;
|
|
2050
|
+
getPreferences(): Promise<Result<CustomerLinkPreferences, CimplifyError>>;
|
|
2051
|
+
enroll(data: EnrollmentData): Promise<Result<LinkEnrollResult, CimplifyError>>;
|
|
2052
|
+
enrollAndLinkOrder(data: EnrollAndLinkOrderInput): Promise<Result<EnrollAndLinkOrderResult, CimplifyError>>;
|
|
2053
|
+
updatePreferences(preferences: Partial<CustomerLinkPreferences>): Promise<Result<SuccessResult, CimplifyError>>;
|
|
2054
|
+
createAddress(input: CreateAddressInput): Promise<Result<CustomerAddress, CimplifyError>>;
|
|
2055
|
+
updateAddress(input: UpdateAddressInput): Promise<Result<SuccessResult, CimplifyError>>;
|
|
2056
|
+
deleteAddress(addressId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
2057
|
+
setDefaultAddress(addressId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
2058
|
+
trackAddressUsage(addressId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
2059
|
+
createMobileMoney(input: CreateMobileMoneyInput): Promise<Result<CustomerMobileMoney, CimplifyError>>;
|
|
2060
|
+
deleteMobileMoney(mobileMoneyId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
2061
|
+
setDefaultMobileMoney(mobileMoneyId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
2062
|
+
trackMobileMoneyUsage(mobileMoneyId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
2063
|
+
verifyMobileMoney(mobileMoneyId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
2064
|
+
getSessions(): Promise<Result<LinkSession[], CimplifyError>>;
|
|
2065
|
+
revokeSession(sessionId: string): Promise<Result<RevokeSessionResult, CimplifyError>>;
|
|
2066
|
+
revokeAllSessions(): Promise<Result<RevokeAllSessionsResult, CimplifyError>>;
|
|
2067
|
+
getAddressesRest(): Promise<Result<CustomerAddress[], CimplifyError>>;
|
|
2068
|
+
createAddressRest(input: CreateAddressInput): Promise<Result<CustomerAddress, CimplifyError>>;
|
|
2069
|
+
deleteAddressRest(addressId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
2070
|
+
setDefaultAddressRest(addressId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
2071
|
+
getMobileMoneyRest(): Promise<Result<CustomerMobileMoney[], CimplifyError>>;
|
|
2072
|
+
createMobileMoneyRest(input: CreateMobileMoneyInput): Promise<Result<CustomerMobileMoney, CimplifyError>>;
|
|
2073
|
+
deleteMobileMoneyRest(mobileMoneyId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
2074
|
+
setDefaultMobileMoneyRest(mobileMoneyId: string): Promise<Result<SuccessResult, CimplifyError>>;
|
|
1834
2075
|
}
|
|
1835
2076
|
|
|
1836
2077
|
interface AuthStatus {
|
|
@@ -3034,4 +3275,4 @@ interface ApiResponse<T> {
|
|
|
3034
3275
|
metadata?: ResponseMetadata;
|
|
3035
3276
|
}
|
|
3036
3277
|
|
|
3037
|
-
export { AUTHORIZATION_TYPE, AUTH_MUTATION, type AddOn, type AddOnDetails, type AddOnGroupDetails, type AddOnOption, type AddOnOptionDetails, type AddOnOptionPrice, type AddOnWithOptions, type AddToCartInput, type AddressData, type AdjustmentType, type AmountToPay, type ApiError, type ApiResponse, type AppliedDiscount, type AuthResponse, AuthService, type AuthStatus, type AuthorizationType, type AvailabilityCheck, type AvailabilityResult, type AvailableSlot, type BenefitType, type Booking, type BookingRequirementOverride, type BookingStatus, type BookingWithDetails, type BufferTimes, type Bundle, type BundleComponentData, type BundleComponentInfo, type BundlePriceType, type BundleProduct, type BundleSelectionData, type BundleSelectionInput, type BundleStoredSelection, type BundleSummary, type BundleWithDetails, type Business, type BusinessHours, type BusinessPreferences, BusinessService, type BusinessSettings, type BusinessType, type BusinessWithLocations, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CURRENCY_SYMBOLS, type CancelBookingInput, type CancelOrderInput, type CancellationPolicy, type Cart, type CartAddOn, type CartChannel, type CartItem, type CartItemDetails, CartOperations, type CartStatus, type CartSummary, type CartTotals, CatalogueQueries, type Category, type CategoryInfo, type CategorySummary, type ChangePasswordInput, type CheckSlotAvailabilityInput, type CheckoutAddressInfo, type CheckoutCustomerInfo, type CheckoutFormData, type CheckoutInput, type CheckoutMode, CheckoutService as CheckoutOperations, type CheckoutOrderType, type CheckoutPaymentMethod, type CheckoutResult, CheckoutService, type CheckoutStep, type ChosenPrice, CimplifyClient, type CimplifyConfig, CimplifyError, type Collection, type CollectionProduct, type CollectionSummary, type ComponentGroup, type ComponentGroupWithComponents, type ComponentPriceBreakdown, type ComponentSelectionInput, type ComponentSourceType, type Composite, type CompositeComponent, type CompositePriceBreakdown, type CompositePriceResult, type CompositePricingMode, type CompositeSelectionData, type ComponentSelectionInput as CompositeSelectionInput, type CompositeStoredSelection, type CompositeWithDetails, type ContactType, type CreateAddressInput, type CreateMobileMoneyInput, type Currency, type Customer, type CustomerAddress, type CustomerLinkPreferences, type CustomerMobileMoney, type CustomerServicePreferences, DEFAULT_COUNTRY, DEFAULT_CURRENCY, type DayAvailability, type DepositResult, type DepositType, type DeviceType, type DigitalProductType, type DiscountBreakdown, type DiscountDetails, type DisplayAddOn, type DisplayAddOnOption, type DisplayCart, type DisplayCartItem, type EnrollAndLinkOrderInput, type EnrollAndLinkOrderResult, type EnrollmentData, ErrorCode, type ErrorCodeType, type FeeBearerType, type FormatCompactOptions, type FormatPriceOptions, type FulfillmentLink, type FulfillmentStatus, type FulfillmentType, type GetAvailableSlotsInput, type GetOrdersOptions, type GetProductsOptions, type GroupPricingBehavior, type InitializePaymentResult, InventoryService, type InventorySummary, type InventoryType, type KitchenOrderItem, type KitchenOrderResult, LINK_MUTATION, LINK_QUERY, type LineConfiguration, type LineItem, type LineType, type LinkData, type LinkEnrollResult, LinkService, type LinkSession, type LinkStatusResult, type LiteBootstrap, LiteService, type Location, type LocationAppointment, type LocationProductPrice, type LocationStock, type LocationTaxBehavior, type LocationTaxOverrides, type LocationTimeProfile, type LocationWithDetails, MOBILE_MONEY_PROVIDER, MOBILE_MONEY_PROVIDERS, type MobileMoneyData, type MobileMoneyDetails, type MobileMoneyProvider, type Money, type MutationRequest, ORDER_MUTATION, ORDER_TYPE, type Order, type OrderChannel, type OrderFilter, type OrderFulfillmentSummary, type OrderGroup, type OrderGroupDetails, type OrderGroupPayment, type OrderGroupPaymentState, type OrderGroupPaymentSummary, type OrderHistory, type OrderLineState, type OrderLineStatus, type OrderPaymentEvent, OrderQueries, type OrderSplitDetail, type OrderStatus, type OtpResult, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, type Pagination, type PaginationParams, type ParsedPrice, type Payment, type PaymentErrorDetails, type PaymentMethod, type PaymentMethodType, type PaymentProcessingState, type PaymentProvider, type PaymentResponse, type PaymentState, type PaymentStatus, type PaymentStatusResponse, type PickupTime, type PickupTimeType, type Price, type PriceAdjustment, type PriceDecisionPath, type PriceEntryType, type PriceInfo, type PricePathTaxInfo, type PriceSource, type PricingOverrides, type Product, type ProductAddOn, type ProductAvailability, type ProductStock, type ProductTimeProfile, type ProductType, type ProductVariant, type ProductVariantValue, type ProductWithDetails, type ProductWithPrice, QueryBuilder, type QueryRequest, type RefundOrderInput, type ReminderMethod, type ReminderSettings, type RequestOtpInput, type RescheduleBookingInput, type ResourceAssignment, type ResourceAvailabilityException, type ResourceAvailabilityRule, type ResourceType, type ResponseMetadata, type RevokeAllSessionsResult, type RevokeSessionResult, type Room, type SalesChannel, type SchedulingMetadata, type SchedulingResult, SchedulingService, type SearchOptions, type SelectedAddOnOption, type Service, type ServiceAvailabilityException, type ServiceAvailabilityParams, type ServiceAvailabilityResult, type ServiceAvailabilityRule, type ServiceCharge, type ServiceNotes, type ServiceScheduleRequest, type ServiceStaffRequirement, type ServiceStatus, type ServiceWithStaff, type Staff, type StaffAssignment, type StaffAvailabilityException, type StaffAvailabilityRule, type StaffBookingProfile, type StaffRole, type StaffScheduleItem, type Stock, type StockLevel, type StockOwnershipType, type StockStatus, type StorefrontBootstrap, type SubmitAuthorizationInput, type Table, type TableInfo, type TaxComponent, type TaxInfo, type TaxPathComponent, type TimeRange, type TimeRanges, type TimeSlot, type UICart, type UICartBusiness, type UICartCustomer, type UICartLocation, type UICartPricing, type UpdateAddressInput, type UpdateCartItemInput, type UpdateOrderStatusInput, type UpdateProfileInput, type VariantAxis, type VariantAxisSelection, type VariantAxisValue, type VariantAxisWithValues, type VariantDetails, type VariantDetailsDTO, type VariantDisplayAttribute, type VariantLocationAvailability, type VariantStock, type VariantStrategy, type VerifyOtpInput, categorizePaymentError, createCimplifyClient, detectMobileMoneyProvider, extractPriceInfo, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, isCimplifyError, isOnSale, isRetryableError, normalizePaymentResponse, normalizeStatusResponse, parsePrice, parsePricePath, parsedPriceToPriceInfo, query };
|
|
3278
|
+
export { AUTHORIZATION_TYPE, AUTH_MUTATION, type AddOn, type AddOnDetails, type AddOnGroupDetails, type AddOnOption, type AddOnOptionDetails, type AddOnOptionPrice, type AddOnWithOptions, type AddToCartInput, type AddressData, type AdjustmentType, type AmountToPay, type ApiError, type ApiResponse, type AppliedDiscount, type AuthResponse, AuthService, type AuthStatus, type AuthorizationType, type AvailabilityCheck, type AvailabilityResult, type AvailableSlot, type BenefitType, type Booking, type BookingRequirementOverride, type BookingStatus, type BookingWithDetails, type BufferTimes, type Bundle, type BundleComponentData, type BundleComponentInfo, type BundlePriceType, type BundleProduct, type BundleSelectionData, type BundleSelectionInput, type BundleStoredSelection, type BundleSummary, type BundleWithDetails, type Business, type BusinessHours, type BusinessPreferences, BusinessService, type BusinessSettings, type BusinessType, type BusinessWithLocations, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CURRENCY_SYMBOLS, type CancelBookingInput, type CancelOrderInput, type CancellationPolicy, type Cart, type CartAddOn, type CartChannel, type CartItem, type CartItemDetails, CartOperations, type CartStatus, type CartSummary, type CartTotals, CatalogueQueries, type Category, type CategoryInfo, type CategorySummary, type ChangePasswordInput, type CheckSlotAvailabilityInput, type CheckoutAddressInfo, type CheckoutCustomerInfo, type CheckoutFormData, type CheckoutInput, type CheckoutMode, CheckoutService as CheckoutOperations, type CheckoutOrderType, type CheckoutPaymentMethod, type CheckoutResult, CheckoutService, type CheckoutStep, type ChosenPrice, CimplifyClient, type CimplifyConfig, CimplifyError, type Collection, type CollectionProduct, type CollectionSummary, type ComponentGroup, type ComponentGroupWithComponents, type ComponentPriceBreakdown, type ComponentSelectionInput, type ComponentSourceType, type Composite, type CompositeComponent, type CompositePriceBreakdown, type CompositePriceResult, type CompositePricingMode, type CompositeSelectionData, type ComponentSelectionInput as CompositeSelectionInput, type CompositeStoredSelection, type CompositeWithDetails, type ContactType, type CreateAddressInput, type CreateMobileMoneyInput, type Currency, type Customer, type CustomerAddress, type CustomerLinkPreferences, type CustomerMobileMoney, type CustomerServicePreferences, DEFAULT_COUNTRY, DEFAULT_CURRENCY, type DayAvailability, type DepositResult, type DepositType, type DeviceType, type DigitalProductType, type DiscountBreakdown, type DiscountDetails, type DisplayAddOn, type DisplayAddOnOption, type DisplayCart, type DisplayCartItem, type EnrollAndLinkOrderInput, type EnrollAndLinkOrderResult, type EnrollmentData, type Err, ErrorCode, type ErrorCodeType, type FeeBearerType, type FormatCompactOptions, type FormatPriceOptions, type FulfillmentLink, type FulfillmentStatus, type FulfillmentType, type GetAvailableSlotsInput, type GetOrdersOptions, type GetProductsOptions, type GroupPricingBehavior, type InitializePaymentResult, InventoryService, type InventorySummary, type InventoryType, type KitchenOrderItem, type KitchenOrderResult, LINK_MUTATION, LINK_QUERY, type LineConfiguration, type LineItem, type LineType, type LinkData, type LinkEnrollResult, LinkService, type LinkSession, type LinkStatusResult, type LiteBootstrap, LiteService, type Location, type LocationAppointment, type LocationProductPrice, type LocationStock, type LocationTaxBehavior, type LocationTaxOverrides, type LocationTimeProfile, type LocationWithDetails, MOBILE_MONEY_PROVIDER, MOBILE_MONEY_PROVIDERS, type MobileMoneyData, type MobileMoneyDetails, type MobileMoneyProvider, type Money, type MutationRequest, ORDER_MUTATION, ORDER_TYPE, type Ok, type Order, type OrderChannel, type OrderFilter, type OrderFulfillmentSummary, type OrderGroup, type OrderGroupDetails, type OrderGroupPayment, type OrderGroupPaymentState, type OrderGroupPaymentSummary, type OrderHistory, type OrderLineState, type OrderLineStatus, type OrderPaymentEvent, OrderQueries, type OrderSplitDetail, type OrderStatus, type OtpResult, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, type Pagination, type PaginationParams, type ParsedPrice, type Payment, type PaymentErrorDetails, type PaymentMethod, type PaymentMethodType, type PaymentProcessingState, type PaymentProvider, type PaymentResponse, type PaymentState, type PaymentStatus, type PaymentStatusResponse, type PickupTime, type PickupTimeType, type Price, type PriceAdjustment, type PriceDecisionPath, type PriceEntryType, type PriceInfo, type PricePathTaxInfo, type PriceSource, type PricingOverrides, type Product, type ProductAddOn, type ProductAvailability, type ProductStock, type ProductTimeProfile, type ProductType, type ProductVariant, type ProductVariantValue, type ProductWithDetails, type ProductWithPrice, QueryBuilder, type QueryRequest, type RefundOrderInput, type ReminderMethod, type ReminderSettings, type RequestOtpInput, type RescheduleBookingInput, type ResourceAssignment, type ResourceAvailabilityException, type ResourceAvailabilityRule, type ResourceType, type ResponseMetadata, type Result, type RevokeAllSessionsResult, type RevokeSessionResult, type Room, type SalesChannel, type SchedulingMetadata, type SchedulingResult, SchedulingService, type SearchOptions, type SelectedAddOnOption, type Service, type ServiceAvailabilityException, type ServiceAvailabilityParams, type ServiceAvailabilityResult, type ServiceAvailabilityRule, type ServiceCharge, type ServiceNotes, type ServiceScheduleRequest, type ServiceStaffRequirement, type ServiceStatus, type ServiceWithStaff, type Staff, type StaffAssignment, type StaffAvailabilityException, type StaffAvailabilityRule, type StaffBookingProfile, type StaffRole, type StaffScheduleItem, type Stock, type StockLevel, type StockOwnershipType, type StockStatus, type StorefrontBootstrap, type SubmitAuthorizationInput, type Table, type TableInfo, type TaxComponent, type TaxInfo, type TaxPathComponent, type TimeRange, type TimeRanges, type TimeSlot, type UICart, type UICartBusiness, type UICartCustomer, type UICartLocation, type UICartPricing, type UpdateAddressInput, type UpdateCartItemInput, type UpdateOrderStatusInput, type UpdateProfileInput, type VariantAxis, type VariantAxisSelection, type VariantAxisValue, type VariantAxisWithValues, type VariantDetails, type VariantDetailsDTO, type VariantDisplayAttribute, type VariantLocationAvailability, type VariantStock, type VariantStrategy, type VerifyOtpInput, categorizePaymentError, combine, combineObject, createCimplifyClient, detectMobileMoneyProvider, err, extractPriceInfo, flatMap, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatProductPrice, fromPromise, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getOrElse, getProductCurrency, isCimplifyError, isErr, isOk, isOnSale, isRetryableError, mapError, mapResult, normalizePaymentResponse, normalizeStatusResponse, ok, parsePrice, parsePricePath, parsedPriceToPriceInfo, query, toNullable, tryCatch, unwrap };
|