@managesome/eposmatic-toolkit 0.4.69 → 0.4.72

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.
@@ -1,4 +1,5 @@
1
1
  import { CUSTOMER_TARGET_MODE_ENUM, DIALER_TYPES_ENUM, WALLET_ASSET_TYPE_ENUM, WALLET_ASSIGNMENT_BEHAVIOR_ENUM } from '../../constants';
2
+ import { ICustomer } from '../../schemas/types/customers';
2
3
  /**
3
4
  * Request/response contracts for backend service APIs, shared between apps and
4
5
  * services (items-service, POS frontends, provider integrations).
@@ -309,3 +310,38 @@ export interface IGoogleMapsRouteResponse {
309
310
  polyline?: [number, number][];
310
311
  distanceMeters: number;
311
312
  }
313
+ /**
314
+ * Response for `GET /customer-auth/session` (items-service).
315
+ *
316
+ * `uid` is the session's Firebase uid. When an email/Google credential maps to
317
+ * a phone-verified account, the backend returns `canonical_token`; signing in
318
+ * with it switches the session to that uid before wallet data is read.
319
+ * `needs_phone` is true when the account has no customer record yet.
320
+ */
321
+ export interface ICustomerAccountSessionResponse {
322
+ uid: string;
323
+ email: string | null;
324
+ email_verified: boolean;
325
+ phone_number: string | null;
326
+ phone_verified: boolean;
327
+ needs_phone: boolean;
328
+ customer: ICustomer | null;
329
+ canonical_token: string | null;
330
+ }
331
+ /**
332
+ * Outcome of `POST /customer-auth/link-phone` (items-service).
333
+ *
334
+ * - `created`: the phone was free and a new unverified row was created.
335
+ * - `linked`: the row already belonged to this identity.
336
+ * - `requires_otp`: an unverified row owned by someone else; send a code via
337
+ * `/wa/auth/send-otp` or `/sms/auth/send-otp`, then call again with `otp`.
338
+ * - `conflict`: a verified row owned by another account.
339
+ * - `verified`: the submitted `otp` was accepted and the phone now belongs to
340
+ * this account.
341
+ */
342
+ export type TCustomerPhoneLinkStatus = 'created' | 'linked' | 'requires_otp' | 'conflict' | 'verified';
343
+ export interface ICustomerPhoneLinkResponse {
344
+ status: TCustomerPhoneLinkStatus;
345
+ phone_number_verified: boolean;
346
+ customer?: ICustomer | null;
347
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.4.69",
3
+ "version": "0.4.72",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",