@cimplify/sdk 0.102.0 → 0.103.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.
Files changed (68) hide show
  1. package/dist/advanced.d.mts +3 -3
  2. package/dist/advanced.d.ts +3 -3
  3. package/dist/advanced.js +23 -22
  4. package/dist/advanced.mjs +4 -3
  5. package/dist/{chunk-DCMXUKDQ.mjs → chunk-C2JSNJUC.mjs} +404 -95
  6. package/dist/chunk-CNN7Z2IP.js +125 -0
  7. package/dist/{chunk-DKLHCZ5M.mjs → chunk-GERXZQSX.mjs} +487 -11
  8. package/dist/chunk-GOHSXBKW.mjs +105 -0
  9. package/dist/{chunk-4KNFBPV2.mjs → chunk-H7ACMHM3.mjs} +32 -14
  10. package/dist/{chunk-Z3K2D3TE.mjs → chunk-J6PNHDHL.mjs} +453 -483
  11. package/dist/{chunk-NIOUSKQQ.js → chunk-JG5CQNCB.js} +5 -0
  12. package/dist/{chunk-YER7DIOM.js → chunk-JSWJ4XDE.js} +471 -519
  13. package/dist/{chunk-DLW3RWRK.mjs → chunk-M4URVKHE.mjs} +46 -12
  14. package/dist/{chunk-WMEC5JWN.js → chunk-NNG6IFFX.js} +50 -13
  15. package/dist/{chunk-LOWSMGRT.js → chunk-QOWPGS7Z.js} +34 -16
  16. package/dist/{chunk-YDA46OZ6.js → chunk-R6OLQ33I.js} +560 -80
  17. package/dist/{chunk-EAZGA7LD.js → chunk-VIL6IQCG.js} +406 -97
  18. package/dist/{chunk-O3YUHLZL.mjs → chunk-VNPEYLB2.mjs} +5 -0
  19. package/dist/{client-B40KFazg.d.ts → client-BfpNjJ_a.d.mts} +90 -299
  20. package/dist/{client-BizGfqB7.d.mts → client-DHBwvh7U.d.ts} +90 -299
  21. package/dist/{client-BdErclfU.d.mts → client-DpqRobY9.d.mts} +2 -2
  22. package/dist/{client-nsiMwuC1.d.ts → client-Dqg2mc-7.d.ts} +2 -2
  23. package/dist/{index-DpmnI__D.d.mts → index-C8uDqLwJ.d.ts} +14 -4
  24. package/dist/{index-nEyXWIyR.d.ts → index-e2y6AK70.d.mts} +14 -4
  25. package/dist/index.d.mts +81 -8
  26. package/dist/index.d.ts +81 -8
  27. package/dist/index.js +202 -169
  28. package/dist/index.mjs +6 -5
  29. package/dist/link-cuNVYc2s.d.mts +297 -0
  30. package/dist/link-cuNVYc2s.d.ts +297 -0
  31. package/dist/mock/cli.mjs +410 -94
  32. package/dist/mock/library.js +410 -94
  33. package/dist/mock/library.mjs +410 -94
  34. package/dist/mock/msw.js +410 -94
  35. package/dist/mock/msw.mjs +410 -94
  36. package/dist/{product-Byf0unSy.d.mts → payment-H5LoIvXU.d.mts} +189 -7
  37. package/dist/{product-Byf0unSy.d.ts → payment-H5LoIvXU.d.ts} +189 -7
  38. package/dist/{price-CS4E5zLS.d.mts → price-BvePgDXe.d.mts} +1 -1
  39. package/dist/{price-BstChV9a.d.ts → price-C2RqscMY.d.ts} +1 -1
  40. package/dist/react.d.mts +4 -4
  41. package/dist/react.d.ts +4 -4
  42. package/dist/react.js +141 -140
  43. package/dist/react.mjs +5 -4
  44. package/dist/{server-DqbZh8Bk.d.mts → server-C7FyLdrz.d.mts} +11 -9
  45. package/dist/{server-Cj40R2ZD.d.ts → server-DoXIpSd7.d.ts} +11 -9
  46. package/dist/server.d.mts +4 -4
  47. package/dist/server.d.ts +4 -4
  48. package/dist/server.js +11 -10
  49. package/dist/server.mjs +5 -4
  50. package/dist/testing/msw.d.mts +2 -2
  51. package/dist/testing/msw.d.ts +2 -2
  52. package/dist/testing/msw.js +4 -3
  53. package/dist/testing/msw.mjs +3 -2
  54. package/dist/testing/suite.d.mts +6 -6
  55. package/dist/testing/suite.d.ts +6 -6
  56. package/dist/testing/suite.js +26 -25
  57. package/dist/testing/suite.mjs +7 -6
  58. package/dist/testing.d.mts +154 -55
  59. package/dist/testing.d.ts +154 -55
  60. package/dist/testing.js +83 -82
  61. package/dist/testing.mjs +8 -7
  62. package/dist/utils.d.mts +4 -4
  63. package/dist/utils.d.ts +4 -4
  64. package/dist/utils.js +37 -29
  65. package/dist/utils.mjs +2 -2
  66. package/package.json +7 -1
  67. package/dist/payment-l0rkieEQ.d.mts +0 -113
  68. package/dist/payment-vzNnIi1n.d.ts +0 -113
package/dist/index.mjs CHANGED
@@ -1,10 +1,11 @@
1
1
  export { BOUNDARY_KIND, CIMPLIFY_CDN_HOSTS, DEFAULT_CDN_BASE_URL, DURATION_UNIT, INPUT_FIELD_TYPE, PRODUCT_TYPE, RENDER_HINT, allGalleryImages, assetUrl, chatMessageCards, displaysGrossPrices, getVariantDisplayName, isCimplifyAsset, isMultiDayService, priceBasisLabel, resolveGallery, serviceBillingMultiplier, stayLength, stayPeriods } from './chunk-3V4DVXV3.mjs';
2
2
  export { isValidPhoneForContext, normalizePhoneToE164, resolvePhoneCountryCode } from './chunk-YOIVZ6OA.mjs';
3
- export { ActivityService, CimplifyClient, DeliveryService, PlacesService, StoreCreditQueries, SubscriptionService, SupportService, UploadService, createCimplifyClient } from './chunk-DKLHCZ5M.mjs';
4
- import { getAuthorizationEndpoint, DEFAULT_ISSUER, generatePkce, generateState } from './chunk-Z3K2D3TE.mjs';
5
- export { AUTHORIZATION_TYPE, AUTH_MUTATION, AuthService, BusinessService, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CONTACT_TYPE, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, ELEMENTS_AUTH_CONTACT_TYPES, ELEMENTS_AUTH_MODES, ELEMENTS_AUTH_PROMPTS, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LINK_MUTATION, LINK_QUERY, LinkService, LiteService, MESSAGE_TYPES, MOBILE_MONEY_PROVIDER, ORDER_MUTATION, ORDER_TYPE, OrderQueries, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, SchedulingService, combine, combineObject, createElements, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, startSignIn, toNullable, tryCatch, unwrap } from './chunk-Z3K2D3TE.mjs';
6
- export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceRange, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getPriceRange, getProductCurrency, getTaxAmount, getUnitPriceAtQuantity, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice } from './chunk-DLW3RWRK.mjs';
7
- export { CimplifyError, ERROR_HINTS, ErrorCode, IdempotencyMismatchError, ZERO, currencyCode, enrichError, getErrorHint, isCimplifyError, isIdempotencyMismatchError, isQuoteConflictRequiringConsent, isQuoteError, isRetryableError, isSupportedCurrency, money, moneyFromNumber } from './chunk-O3YUHLZL.mjs';
3
+ export { ActivityService, CimplifyClient, DeliveryService, PaymentAuthorizationAdapterRegistry, PaystackAuthorizationAdapter, PlacesService, StoreCreditQueries, StripeAuthorizationAdapter, SubscriptionService, SupportService, UploadService, createCimplifyClient, createDefaultPaymentAuthorizationAdapterRegistry } from './chunk-GERXZQSX.mjs';
4
+ import { getAuthorizationEndpoint, DEFAULT_ISSUER, generatePkce, generateState } from './chunk-J6PNHDHL.mjs';
5
+ export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENTS_AUTH_CONTACT_TYPES, ELEMENTS_AUTH_MODES, ELEMENTS_AUTH_PROMPTS, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, SchedulingService, combine, combineObject, createElements, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, startSignIn, toNullable, tryCatch, unwrap } from './chunk-J6PNHDHL.mjs';
6
+ export { AUTHORIZATION_TYPE, AUTH_MUTATION, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CONTACT_TYPE, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, LINK_MUTATION, LINK_QUERY, MAX_PAYMENT_AUTHORIZATION_STEPS, MOBILE_MONEY_PROVIDER, ORDER_MUTATION, ORDER_TYPE, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE } from './chunk-GOHSXBKW.mjs';
7
+ export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, PAYMENT_TERMINAL_FAILURE_STATUSES, canonicalMobileMoneyProvider, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceRange, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getPriceRange, getProductCurrency, getTaxAmount, getUnitPriceAtQuantity, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice, paymentAuthorizationUrl } from './chunk-M4URVKHE.mjs';
8
+ export { CimplifyError, ERROR_HINTS, ErrorCode, IdempotencyMismatchError, ZERO, currencyCode, enrichError, getErrorHint, isCimplifyError, isIdempotencyMismatchError, isQuoteConflictRequiringConsent, isQuoteError, isRetryableError, isSupportedCurrency, money, moneyFromNumber } from './chunk-VNPEYLB2.mjs';
8
9
  import './chunk-3G6RQLXK.mjs';
9
10
 
10
11
  // src/silent-sign-in.ts
@@ -0,0 +1,297 @@
1
+ declare const CHECKOUT_MODE: {
2
+ readonly LINK: "link";
3
+ readonly GUEST: "guest";
4
+ };
5
+ declare const ORDER_TYPE: {
6
+ readonly DELIVERY: "delivery";
7
+ readonly PICKUP: "pickup";
8
+ readonly DINE_IN: "dine-in";
9
+ readonly WALK_IN: "walk-in";
10
+ };
11
+ declare const PAYMENT_METHOD: {
12
+ readonly MOBILE_MONEY: "mobile_money";
13
+ readonly CARD: "card";
14
+ };
15
+ declare const CHECKOUT_STEP: {
16
+ readonly AUTHENTICATION: "authentication";
17
+ readonly ORDER_DETAILS: "order_details";
18
+ readonly PAYMENT_METHOD: "payment_method";
19
+ readonly PAYMENT: "payment";
20
+ readonly CONFIRMATION: "confirmation";
21
+ };
22
+ declare const PAYMENT_STATE: {
23
+ readonly INITIAL: "initial";
24
+ readonly PREPARING: "preparing";
25
+ readonly PROCESSING: "processing";
26
+ readonly VERIFYING: "verifying";
27
+ readonly AWAITING_AUTHORIZATION: "awaiting_authorization";
28
+ readonly SUCCESS: "success";
29
+ readonly ERROR: "error";
30
+ readonly TIMEOUT: "timeout";
31
+ };
32
+ declare const PICKUP_TIME_TYPE: {
33
+ readonly ASAP: "asap";
34
+ readonly SCHEDULED: "scheduled";
35
+ };
36
+ declare const MOBILE_MONEY_PROVIDER: {
37
+ readonly MTN: "mtn";
38
+ readonly VODAFONE: "vodafone";
39
+ readonly TELECEL: "telecel";
40
+ readonly AIRTEL: "airtel";
41
+ readonly AIRTELTIGO: "airteltigo";
42
+ readonly MPESA: "mpesa";
43
+ };
44
+ declare const AUTHORIZATION_TYPE: {
45
+ readonly OTP: "otp";
46
+ readonly PIN: "pin";
47
+ readonly PHONE: "phone";
48
+ readonly BIRTHDAY: "birthday";
49
+ readonly ADDRESS: "address";
50
+ };
51
+ /** Hard stop for provider-controlled sequential checkout challenges. */
52
+ declare const MAX_PAYMENT_AUTHORIZATION_STEPS = 8;
53
+ declare const DEVICE_TYPE: {
54
+ readonly MOBILE: "mobile";
55
+ readonly DESKTOP: "desktop";
56
+ readonly TABLET: "tablet";
57
+ readonly UNKNOWN: "unknown";
58
+ };
59
+ declare const CONTACT_TYPE: {
60
+ readonly PHONE: "phone";
61
+ readonly EMAIL: "email";
62
+ };
63
+ declare const LINK_QUERY: {
64
+ readonly DATA: "link.data";
65
+ readonly ADDRESSES: "link.addresses";
66
+ readonly MOBILE_MONEY: "link.mobile_money";
67
+ readonly PREFERENCES: "link.preferences";
68
+ readonly SESSIONS: "link.sessions";
69
+ };
70
+ declare const LINK_MUTATION: {
71
+ readonly CHECK_STATUS: "link.check_status";
72
+ readonly ENROLL: "link.enroll";
73
+ readonly ENROLL_AND_LINK_ORDER: "link.enroll_and_link_order";
74
+ readonly UPDATE_PREFERENCES: "link.update_preferences";
75
+ readonly CREATE_ADDRESS: "link.create_address";
76
+ readonly UPDATE_ADDRESS: "link.update_address";
77
+ readonly DELETE_ADDRESS: "link.delete_address";
78
+ readonly SET_DEFAULT_ADDRESS: "link.set_default_address";
79
+ readonly TRACK_ADDRESS_USAGE: "link.track_address_usage";
80
+ readonly CREATE_MOBILE_MONEY: "link.create_mobile_money";
81
+ readonly DELETE_MOBILE_MONEY: "link.delete_mobile_money";
82
+ readonly SET_DEFAULT_MOBILE_MONEY: "link.set_default_mobile_money";
83
+ readonly TRACK_MOBILE_MONEY_USAGE: "link.track_mobile_money_usage";
84
+ readonly VERIFY_MOBILE_MONEY: "link.verify_mobile_money";
85
+ readonly REVOKE_SESSION: "link.revoke_session";
86
+ readonly REVOKE_ALL_SESSIONS: "link.revoke_all_sessions";
87
+ };
88
+ declare const AUTH_MUTATION: {
89
+ readonly REQUEST_OTP: "auth.request_otp";
90
+ readonly VERIFY_OTP: "auth.verify_otp";
91
+ };
92
+ declare const CHECKOUT_MUTATION: {
93
+ readonly PROCESS: "checkout.process";
94
+ };
95
+ declare const PAYMENT_MUTATION: {
96
+ readonly SUBMIT_AUTHORIZATION: "payment.submit_authorization";
97
+ readonly CHECK_STATUS: "order.poll_payment_status";
98
+ };
99
+ declare const ORDER_MUTATION: {
100
+ readonly UPDATE_CUSTOMER: "order.update_order_customer";
101
+ };
102
+ declare const DEFAULT_CURRENCY = "GHS";
103
+ declare const DEFAULT_COUNTRY = "GHA";
104
+
105
+ type MobileMoneyProvider = (typeof MOBILE_MONEY_PROVIDER)[keyof typeof MOBILE_MONEY_PROVIDER];
106
+ interface Customer {
107
+ id: string;
108
+ email: string | null;
109
+ phone: string | null;
110
+ name: string;
111
+ delivery_address: string | null;
112
+ created_at: string;
113
+ updated_at: string;
114
+ metadata?: Record<string, unknown> | null;
115
+ account_id?: string | null;
116
+ }
117
+ interface CustomerAddress {
118
+ id: string;
119
+ customer_id: string;
120
+ label: string;
121
+ street_address: string;
122
+ apartment: string | null;
123
+ city: string;
124
+ region: string;
125
+ postal_code: string | null;
126
+ country: string | null;
127
+ delivery_instructions: string | null;
128
+ phone_for_delivery: string | null;
129
+ latitude: number | null;
130
+ longitude: number | null;
131
+ is_default: boolean | null;
132
+ usage_count: number | null;
133
+ last_used_at: string | null;
134
+ created_at: string;
135
+ updated_at: string;
136
+ }
137
+ interface CustomerMobileMoney {
138
+ id: string;
139
+ customer_id: string;
140
+ phone_number: string;
141
+ provider: string;
142
+ label: string;
143
+ is_verified: boolean | null;
144
+ verification_date: string | null;
145
+ is_default: boolean | null;
146
+ usage_count: number | null;
147
+ last_used_at: string | null;
148
+ success_rate: number | null;
149
+ created_at: string;
150
+ updated_at: string;
151
+ }
152
+ interface CustomerLinkPreferences {
153
+ customer_id: string;
154
+ is_link_enabled: boolean | null;
155
+ enrolled_at: string | null;
156
+ enrollment_business_id: string | null;
157
+ preferred_order_type: string | null;
158
+ default_address_id: string | null;
159
+ default_mobile_money_id: string | null;
160
+ remember_me: boolean | null;
161
+ session_duration_days: number | null;
162
+ two_factor_enabled: boolean | null;
163
+ notify_on_order: boolean | null;
164
+ notify_on_payment: boolean | null;
165
+ created_at: string;
166
+ updated_at: string;
167
+ }
168
+ interface LinkData {
169
+ customer: Customer;
170
+ addresses: CustomerAddress[];
171
+ mobile_money: CustomerMobileMoney[];
172
+ preferences: CustomerLinkPreferences;
173
+ default_address: CustomerAddress | null;
174
+ default_mobile_money: CustomerMobileMoney | null;
175
+ }
176
+ interface CreateAddressInput {
177
+ label?: string;
178
+ street_address: string;
179
+ apartment?: string;
180
+ city: string;
181
+ region?: string;
182
+ postal_code?: string;
183
+ country?: string;
184
+ delivery_instructions?: string;
185
+ phone_for_delivery?: string;
186
+ latitude?: number;
187
+ longitude?: number;
188
+ }
189
+ interface UpdateAddressInput {
190
+ address_id: string;
191
+ label?: string;
192
+ street_address?: string;
193
+ apartment?: string;
194
+ city?: string;
195
+ region?: string;
196
+ postal_code?: string;
197
+ country?: string;
198
+ delivery_instructions?: string;
199
+ phone_for_delivery?: string;
200
+ latitude?: number;
201
+ longitude?: number;
202
+ clear_coordinates?: boolean;
203
+ }
204
+ interface CreateMobileMoneyInput {
205
+ phone_number: string;
206
+ provider: MobileMoneyProvider;
207
+ label?: string;
208
+ }
209
+ interface EnrollmentData {
210
+ contact: string;
211
+ name?: string;
212
+ }
213
+ interface AddressData {
214
+ label: string;
215
+ street_address: string;
216
+ apartment?: string;
217
+ city: string;
218
+ region: string;
219
+ postal_code?: string;
220
+ country?: string;
221
+ delivery_instructions?: string;
222
+ phone_for_delivery?: string;
223
+ latitude?: number;
224
+ longitude?: number;
225
+ }
226
+ interface MobileMoneyData {
227
+ phone_number: string;
228
+ provider: string;
229
+ label: string;
230
+ }
231
+ interface EnrollAndLinkOrderInput {
232
+ order_id: string;
233
+ business_id: string;
234
+ address?: AddressData;
235
+ mobile_money?: MobileMoneyData;
236
+ order_type?: string;
237
+ }
238
+ interface LinkStatusResult {
239
+ is_link_customer: boolean;
240
+ }
241
+ interface LinkEnrollResult {
242
+ success: boolean;
243
+ customer_id: string;
244
+ contact?: string;
245
+ enrolled_at?: string;
246
+ preferences?: CustomerLinkPreferences;
247
+ }
248
+ interface EnrollAndLinkOrderResult {
249
+ success: boolean;
250
+ customer_id: string;
251
+ order_id: string;
252
+ enrollment_result: unknown;
253
+ linked_at: string;
254
+ }
255
+ type DeviceType = (typeof DEVICE_TYPE)[keyof typeof DEVICE_TYPE];
256
+ interface LinkSession {
257
+ id: string;
258
+ device_name: string | null;
259
+ device_type: DeviceType | null;
260
+ ip_address: string | null;
261
+ last_used_at: string | null;
262
+ created_at: string;
263
+ is_current: boolean;
264
+ }
265
+ interface RevokeSessionResult {
266
+ success: boolean;
267
+ session_id: string;
268
+ message: string;
269
+ }
270
+ interface RevokeAllSessionsResult {
271
+ success: boolean;
272
+ revoked_count: number;
273
+ message: string;
274
+ }
275
+ type ContactType = (typeof CONTACT_TYPE)[keyof typeof CONTACT_TYPE];
276
+ interface RequestOtpInput {
277
+ contact: string;
278
+ contact_type: ContactType;
279
+ }
280
+ interface VerifyOtpInput {
281
+ contact: string;
282
+ contact_type: ContactType;
283
+ otp_code: string;
284
+ }
285
+ interface AuthResponse {
286
+ success: boolean;
287
+ session_token: string | null;
288
+ refresh_token?: string | null;
289
+ account_id?: string | null;
290
+ customer_id: string | null;
291
+ name?: string | null;
292
+ email?: string | null;
293
+ phone?: string | null;
294
+ message: string;
295
+ }
296
+
297
+ export { AUTHORIZATION_TYPE as A, ORDER_TYPE as B, CHECKOUT_MODE as C, DEFAULT_COUNTRY as D, type EnrollAndLinkOrderInput as E, PAYMENT_MUTATION as F, PAYMENT_STATE as G, PICKUP_TIME_TYPE as H, type RevokeAllSessionsResult as I, type RevokeSessionResult as J, LINK_MUTATION as L, MAX_PAYMENT_AUTHORIZATION_STEPS as M, ORDER_MUTATION as O, PAYMENT_METHOD as P, type RequestOtpInput as R, type UpdateAddressInput as U, type VerifyOtpInput as V, AUTH_MUTATION as a, type AddressData as b, type AuthResponse as c, CHECKOUT_MUTATION as d, CHECKOUT_STEP as e, CONTACT_TYPE as f, type ContactType as g, type CreateAddressInput as h, type CreateMobileMoneyInput as i, type Customer as j, type CustomerAddress as k, type CustomerLinkPreferences as l, type CustomerMobileMoney as m, DEFAULT_CURRENCY as n, DEVICE_TYPE as o, type DeviceType as p, type EnrollAndLinkOrderResult as q, type EnrollmentData as r, LINK_QUERY as s, type LinkData as t, type LinkEnrollResult as u, type LinkSession as v, type LinkStatusResult as w, MOBILE_MONEY_PROVIDER as x, type MobileMoneyData as y, type MobileMoneyProvider as z };
@@ -0,0 +1,297 @@
1
+ declare const CHECKOUT_MODE: {
2
+ readonly LINK: "link";
3
+ readonly GUEST: "guest";
4
+ };
5
+ declare const ORDER_TYPE: {
6
+ readonly DELIVERY: "delivery";
7
+ readonly PICKUP: "pickup";
8
+ readonly DINE_IN: "dine-in";
9
+ readonly WALK_IN: "walk-in";
10
+ };
11
+ declare const PAYMENT_METHOD: {
12
+ readonly MOBILE_MONEY: "mobile_money";
13
+ readonly CARD: "card";
14
+ };
15
+ declare const CHECKOUT_STEP: {
16
+ readonly AUTHENTICATION: "authentication";
17
+ readonly ORDER_DETAILS: "order_details";
18
+ readonly PAYMENT_METHOD: "payment_method";
19
+ readonly PAYMENT: "payment";
20
+ readonly CONFIRMATION: "confirmation";
21
+ };
22
+ declare const PAYMENT_STATE: {
23
+ readonly INITIAL: "initial";
24
+ readonly PREPARING: "preparing";
25
+ readonly PROCESSING: "processing";
26
+ readonly VERIFYING: "verifying";
27
+ readonly AWAITING_AUTHORIZATION: "awaiting_authorization";
28
+ readonly SUCCESS: "success";
29
+ readonly ERROR: "error";
30
+ readonly TIMEOUT: "timeout";
31
+ };
32
+ declare const PICKUP_TIME_TYPE: {
33
+ readonly ASAP: "asap";
34
+ readonly SCHEDULED: "scheduled";
35
+ };
36
+ declare const MOBILE_MONEY_PROVIDER: {
37
+ readonly MTN: "mtn";
38
+ readonly VODAFONE: "vodafone";
39
+ readonly TELECEL: "telecel";
40
+ readonly AIRTEL: "airtel";
41
+ readonly AIRTELTIGO: "airteltigo";
42
+ readonly MPESA: "mpesa";
43
+ };
44
+ declare const AUTHORIZATION_TYPE: {
45
+ readonly OTP: "otp";
46
+ readonly PIN: "pin";
47
+ readonly PHONE: "phone";
48
+ readonly BIRTHDAY: "birthday";
49
+ readonly ADDRESS: "address";
50
+ };
51
+ /** Hard stop for provider-controlled sequential checkout challenges. */
52
+ declare const MAX_PAYMENT_AUTHORIZATION_STEPS = 8;
53
+ declare const DEVICE_TYPE: {
54
+ readonly MOBILE: "mobile";
55
+ readonly DESKTOP: "desktop";
56
+ readonly TABLET: "tablet";
57
+ readonly UNKNOWN: "unknown";
58
+ };
59
+ declare const CONTACT_TYPE: {
60
+ readonly PHONE: "phone";
61
+ readonly EMAIL: "email";
62
+ };
63
+ declare const LINK_QUERY: {
64
+ readonly DATA: "link.data";
65
+ readonly ADDRESSES: "link.addresses";
66
+ readonly MOBILE_MONEY: "link.mobile_money";
67
+ readonly PREFERENCES: "link.preferences";
68
+ readonly SESSIONS: "link.sessions";
69
+ };
70
+ declare const LINK_MUTATION: {
71
+ readonly CHECK_STATUS: "link.check_status";
72
+ readonly ENROLL: "link.enroll";
73
+ readonly ENROLL_AND_LINK_ORDER: "link.enroll_and_link_order";
74
+ readonly UPDATE_PREFERENCES: "link.update_preferences";
75
+ readonly CREATE_ADDRESS: "link.create_address";
76
+ readonly UPDATE_ADDRESS: "link.update_address";
77
+ readonly DELETE_ADDRESS: "link.delete_address";
78
+ readonly SET_DEFAULT_ADDRESS: "link.set_default_address";
79
+ readonly TRACK_ADDRESS_USAGE: "link.track_address_usage";
80
+ readonly CREATE_MOBILE_MONEY: "link.create_mobile_money";
81
+ readonly DELETE_MOBILE_MONEY: "link.delete_mobile_money";
82
+ readonly SET_DEFAULT_MOBILE_MONEY: "link.set_default_mobile_money";
83
+ readonly TRACK_MOBILE_MONEY_USAGE: "link.track_mobile_money_usage";
84
+ readonly VERIFY_MOBILE_MONEY: "link.verify_mobile_money";
85
+ readonly REVOKE_SESSION: "link.revoke_session";
86
+ readonly REVOKE_ALL_SESSIONS: "link.revoke_all_sessions";
87
+ };
88
+ declare const AUTH_MUTATION: {
89
+ readonly REQUEST_OTP: "auth.request_otp";
90
+ readonly VERIFY_OTP: "auth.verify_otp";
91
+ };
92
+ declare const CHECKOUT_MUTATION: {
93
+ readonly PROCESS: "checkout.process";
94
+ };
95
+ declare const PAYMENT_MUTATION: {
96
+ readonly SUBMIT_AUTHORIZATION: "payment.submit_authorization";
97
+ readonly CHECK_STATUS: "order.poll_payment_status";
98
+ };
99
+ declare const ORDER_MUTATION: {
100
+ readonly UPDATE_CUSTOMER: "order.update_order_customer";
101
+ };
102
+ declare const DEFAULT_CURRENCY = "GHS";
103
+ declare const DEFAULT_COUNTRY = "GHA";
104
+
105
+ type MobileMoneyProvider = (typeof MOBILE_MONEY_PROVIDER)[keyof typeof MOBILE_MONEY_PROVIDER];
106
+ interface Customer {
107
+ id: string;
108
+ email: string | null;
109
+ phone: string | null;
110
+ name: string;
111
+ delivery_address: string | null;
112
+ created_at: string;
113
+ updated_at: string;
114
+ metadata?: Record<string, unknown> | null;
115
+ account_id?: string | null;
116
+ }
117
+ interface CustomerAddress {
118
+ id: string;
119
+ customer_id: string;
120
+ label: string;
121
+ street_address: string;
122
+ apartment: string | null;
123
+ city: string;
124
+ region: string;
125
+ postal_code: string | null;
126
+ country: string | null;
127
+ delivery_instructions: string | null;
128
+ phone_for_delivery: string | null;
129
+ latitude: number | null;
130
+ longitude: number | null;
131
+ is_default: boolean | null;
132
+ usage_count: number | null;
133
+ last_used_at: string | null;
134
+ created_at: string;
135
+ updated_at: string;
136
+ }
137
+ interface CustomerMobileMoney {
138
+ id: string;
139
+ customer_id: string;
140
+ phone_number: string;
141
+ provider: string;
142
+ label: string;
143
+ is_verified: boolean | null;
144
+ verification_date: string | null;
145
+ is_default: boolean | null;
146
+ usage_count: number | null;
147
+ last_used_at: string | null;
148
+ success_rate: number | null;
149
+ created_at: string;
150
+ updated_at: string;
151
+ }
152
+ interface CustomerLinkPreferences {
153
+ customer_id: string;
154
+ is_link_enabled: boolean | null;
155
+ enrolled_at: string | null;
156
+ enrollment_business_id: string | null;
157
+ preferred_order_type: string | null;
158
+ default_address_id: string | null;
159
+ default_mobile_money_id: string | null;
160
+ remember_me: boolean | null;
161
+ session_duration_days: number | null;
162
+ two_factor_enabled: boolean | null;
163
+ notify_on_order: boolean | null;
164
+ notify_on_payment: boolean | null;
165
+ created_at: string;
166
+ updated_at: string;
167
+ }
168
+ interface LinkData {
169
+ customer: Customer;
170
+ addresses: CustomerAddress[];
171
+ mobile_money: CustomerMobileMoney[];
172
+ preferences: CustomerLinkPreferences;
173
+ default_address: CustomerAddress | null;
174
+ default_mobile_money: CustomerMobileMoney | null;
175
+ }
176
+ interface CreateAddressInput {
177
+ label?: string;
178
+ street_address: string;
179
+ apartment?: string;
180
+ city: string;
181
+ region?: string;
182
+ postal_code?: string;
183
+ country?: string;
184
+ delivery_instructions?: string;
185
+ phone_for_delivery?: string;
186
+ latitude?: number;
187
+ longitude?: number;
188
+ }
189
+ interface UpdateAddressInput {
190
+ address_id: string;
191
+ label?: string;
192
+ street_address?: string;
193
+ apartment?: string;
194
+ city?: string;
195
+ region?: string;
196
+ postal_code?: string;
197
+ country?: string;
198
+ delivery_instructions?: string;
199
+ phone_for_delivery?: string;
200
+ latitude?: number;
201
+ longitude?: number;
202
+ clear_coordinates?: boolean;
203
+ }
204
+ interface CreateMobileMoneyInput {
205
+ phone_number: string;
206
+ provider: MobileMoneyProvider;
207
+ label?: string;
208
+ }
209
+ interface EnrollmentData {
210
+ contact: string;
211
+ name?: string;
212
+ }
213
+ interface AddressData {
214
+ label: string;
215
+ street_address: string;
216
+ apartment?: string;
217
+ city: string;
218
+ region: string;
219
+ postal_code?: string;
220
+ country?: string;
221
+ delivery_instructions?: string;
222
+ phone_for_delivery?: string;
223
+ latitude?: number;
224
+ longitude?: number;
225
+ }
226
+ interface MobileMoneyData {
227
+ phone_number: string;
228
+ provider: string;
229
+ label: string;
230
+ }
231
+ interface EnrollAndLinkOrderInput {
232
+ order_id: string;
233
+ business_id: string;
234
+ address?: AddressData;
235
+ mobile_money?: MobileMoneyData;
236
+ order_type?: string;
237
+ }
238
+ interface LinkStatusResult {
239
+ is_link_customer: boolean;
240
+ }
241
+ interface LinkEnrollResult {
242
+ success: boolean;
243
+ customer_id: string;
244
+ contact?: string;
245
+ enrolled_at?: string;
246
+ preferences?: CustomerLinkPreferences;
247
+ }
248
+ interface EnrollAndLinkOrderResult {
249
+ success: boolean;
250
+ customer_id: string;
251
+ order_id: string;
252
+ enrollment_result: unknown;
253
+ linked_at: string;
254
+ }
255
+ type DeviceType = (typeof DEVICE_TYPE)[keyof typeof DEVICE_TYPE];
256
+ interface LinkSession {
257
+ id: string;
258
+ device_name: string | null;
259
+ device_type: DeviceType | null;
260
+ ip_address: string | null;
261
+ last_used_at: string | null;
262
+ created_at: string;
263
+ is_current: boolean;
264
+ }
265
+ interface RevokeSessionResult {
266
+ success: boolean;
267
+ session_id: string;
268
+ message: string;
269
+ }
270
+ interface RevokeAllSessionsResult {
271
+ success: boolean;
272
+ revoked_count: number;
273
+ message: string;
274
+ }
275
+ type ContactType = (typeof CONTACT_TYPE)[keyof typeof CONTACT_TYPE];
276
+ interface RequestOtpInput {
277
+ contact: string;
278
+ contact_type: ContactType;
279
+ }
280
+ interface VerifyOtpInput {
281
+ contact: string;
282
+ contact_type: ContactType;
283
+ otp_code: string;
284
+ }
285
+ interface AuthResponse {
286
+ success: boolean;
287
+ session_token: string | null;
288
+ refresh_token?: string | null;
289
+ account_id?: string | null;
290
+ customer_id: string | null;
291
+ name?: string | null;
292
+ email?: string | null;
293
+ phone?: string | null;
294
+ message: string;
295
+ }
296
+
297
+ export { AUTHORIZATION_TYPE as A, ORDER_TYPE as B, CHECKOUT_MODE as C, DEFAULT_COUNTRY as D, type EnrollAndLinkOrderInput as E, PAYMENT_MUTATION as F, PAYMENT_STATE as G, PICKUP_TIME_TYPE as H, type RevokeAllSessionsResult as I, type RevokeSessionResult as J, LINK_MUTATION as L, MAX_PAYMENT_AUTHORIZATION_STEPS as M, ORDER_MUTATION as O, PAYMENT_METHOD as P, type RequestOtpInput as R, type UpdateAddressInput as U, type VerifyOtpInput as V, AUTH_MUTATION as a, type AddressData as b, type AuthResponse as c, CHECKOUT_MUTATION as d, CHECKOUT_STEP as e, CONTACT_TYPE as f, type ContactType as g, type CreateAddressInput as h, type CreateMobileMoneyInput as i, type Customer as j, type CustomerAddress as k, type CustomerLinkPreferences as l, type CustomerMobileMoney as m, DEFAULT_CURRENCY as n, DEVICE_TYPE as o, type DeviceType as p, type EnrollAndLinkOrderResult as q, type EnrollmentData as r, LINK_QUERY as s, type LinkData as t, type LinkEnrollResult as u, type LinkSession as v, type LinkStatusResult as w, MOBILE_MONEY_PROVIDER as x, type MobileMoneyData as y, type MobileMoneyProvider as z };