@final-commerce/command-frame 0.6.1 → 0.7.0-staging.1
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/CommonTypes.d.ts +11 -1
- package/dist/actions/add-booking-to-cart/action.d.ts +6 -0
- package/dist/actions/add-booking-to-cart/action.js +8 -0
- package/dist/actions/add-booking-to-cart/mock.d.ts +2 -0
- package/dist/actions/add-booking-to-cart/mock.js +8 -0
- package/dist/actions/add-booking-to-cart/types.d.ts +23 -0
- package/dist/actions/cancel-booking/action.d.ts +6 -0
- package/dist/actions/cancel-booking/action.js +8 -0
- package/dist/actions/cancel-booking/mock.d.ts +2 -0
- package/dist/actions/cancel-booking/mock.js +10 -0
- package/dist/actions/cancel-booking/types.d.ts +10 -0
- package/dist/actions/cancel-booking/types.js +1 -0
- package/dist/actions/get-booking-availability/action.d.ts +6 -0
- package/dist/actions/get-booking-availability/action.js +8 -0
- package/dist/actions/get-booking-availability/mock.d.ts +2 -0
- package/dist/actions/get-booking-availability/mock.js +6 -0
- package/dist/actions/get-booking-availability/types.d.ts +18 -0
- package/dist/actions/get-booking-availability/types.js +1 -0
- package/dist/actions/get-booking-resources/action.d.ts +6 -0
- package/dist/actions/get-booking-resources/action.js +8 -0
- package/dist/actions/get-booking-resources/mock.d.ts +2 -0
- package/dist/actions/get-booking-resources/mock.js +7 -0
- package/dist/actions/get-booking-resources/types.d.ts +12 -0
- package/dist/actions/get-booking-resources/types.js +1 -0
- package/dist/actions/get-bookings/action.d.ts +6 -0
- package/dist/actions/get-bookings/action.js +8 -0
- package/dist/actions/get-bookings/mock.d.ts +2 -0
- package/dist/actions/get-bookings/mock.js +20 -0
- package/dist/actions/get-bookings/types.d.ts +18 -0
- package/dist/actions/get-bookings/types.js +1 -0
- package/dist/actions/hold-booking/action.d.ts +6 -0
- package/dist/actions/hold-booking/action.js +8 -0
- package/dist/actions/hold-booking/mock.d.ts +2 -0
- package/dist/actions/hold-booking/mock.js +33 -0
- package/dist/actions/hold-booking/types.d.ts +24 -0
- package/dist/actions/hold-booking/types.js +1 -0
- package/dist/actions/remove-booking-from-cart/action.d.ts +6 -0
- package/dist/actions/remove-booking-from-cart/action.js +8 -0
- package/dist/actions/remove-booking-from-cart/mock.d.ts +2 -0
- package/dist/actions/remove-booking-from-cart/mock.js +16 -0
- package/dist/actions/remove-booking-from-cart/types.d.ts +12 -0
- package/dist/actions/remove-booking-from-cart/types.js +1 -0
- package/dist/demo/database.d.ts +8 -1
- package/dist/demo/database.js +93 -0
- package/dist/index.d.ts +16 -6
- package/dist/index.js +15 -8
- package/dist/projects/render/mocks.js +14 -6
- package/dist/projects/render/types.d.ts +8 -4
- package/dist/pubsub/topics/bookings/booking-created/types.d.ts +6 -0
- package/dist/pubsub/topics/bookings/booking-created/types.js +1 -0
- package/dist/pubsub/topics/bookings/booking-setup-changed/types.d.ts +15 -0
- package/dist/pubsub/topics/bookings/booking-setup-changed/types.js +1 -0
- package/dist/pubsub/topics/bookings/booking-updated/types.d.ts +6 -0
- package/dist/pubsub/topics/bookings/booking-updated/types.js +1 -0
- package/dist/pubsub/topics/bookings/index.d.ts +3 -0
- package/dist/pubsub/topics/bookings/index.js +27 -0
- package/dist/pubsub/topics/bookings/types.d.ts +8 -0
- package/dist/pubsub/topics/bookings/types.js +3 -0
- package/dist/pubsub/topics/index.d.ts +17 -16
- package/dist/pubsub/topics/index.js +17 -16
- package/dist/pubsub/topics/types.d.ts +2 -0
- package/package.json +2 -2
- package/dist/actions/charge-moto/action.d.ts +0 -6
- package/dist/actions/charge-moto/action.js +0 -8
- package/dist/actions/charge-moto/mock.d.ts +0 -2
- package/dist/actions/charge-moto/mock.js +0 -47
- package/dist/actions/charge-moto/types.d.ts +0 -53
- package/dist/actions/create-payment-link/action.d.ts +0 -6
- package/dist/actions/create-payment-link/action.js +0 -8
- package/dist/actions/create-payment-link/mock.d.ts +0 -2
- package/dist/actions/create-payment-link/mock.js +0 -35
- package/dist/actions/create-payment-link/types.d.ts +0 -27
- package/dist/actions/create-payment-link/types.js +0 -12
- package/dist/actions/get-time-clock-status/action.d.ts +0 -6
- package/dist/actions/get-time-clock-status/action.js +0 -8
- package/dist/actions/get-time-clock-status/mock.d.ts +0 -2
- package/dist/actions/get-time-clock-status/mock.js +0 -17
- package/dist/actions/get-time-clock-status/types.d.ts +0 -18
- package/dist/actions/get-time-clock-status/types.js +0 -7
- /package/dist/actions/{charge-moto → add-booking-to-cart}/types.js +0 -0
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export interface CreatePaymentLinkParams {
|
|
2
|
-
/** Address to email the link to. Exactly one of `email`/`phone` is required. */
|
|
3
|
-
email?: string;
|
|
4
|
-
/** Phone number to text the link to, E.164 (e.g. "+15555550123"). Exactly one of `email`/`phone` is required. */
|
|
5
|
-
phone?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface CreatePaymentLinkResponse {
|
|
8
|
-
success: boolean;
|
|
9
|
-
timestamp: string;
|
|
10
|
-
/** Client `_id` of the order the station created for this link (charges the CURRENT CART). */
|
|
11
|
-
orderId: string;
|
|
12
|
-
/** Hosted payment page to send the shopper. */
|
|
13
|
-
url: string;
|
|
14
|
-
/** The provider's payment-link id. */
|
|
15
|
-
id: string;
|
|
16
|
-
/** When the link stops accepting payment (ISO date string). */
|
|
17
|
-
expiresAt: string;
|
|
18
|
-
/**
|
|
19
|
-
* Per-channel delivery outcome. OPTIONAL: an older hub omits it entirely,
|
|
20
|
-
* which reads as "delivered" — treat absence as success, not as a failure.
|
|
21
|
-
*/
|
|
22
|
-
delivery?: {
|
|
23
|
-
email?: 'sent' | 'failed';
|
|
24
|
-
sms?: 'sent' | 'failed';
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export type CreatePaymentLink = (params: CreatePaymentLinkParams) => Promise<CreatePaymentLinkResponse>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Create Payment Link Types
|
|
2
|
-
//
|
|
3
|
-
// Creates a hosted payment link FOR THE CURRENT CART (station-v2 D-decisions,
|
|
4
|
-
// payment-link addendum). Mirrors kaching's `createPaymentLinkFromCart` input
|
|
5
|
-
// (`CreatePaymentLinkFromCartInput`) and result (`PaymentLinkFromCartResult`,
|
|
6
|
-
// which extends the provider's `PaymentLinkResponse` with the local `orderId`).
|
|
7
|
-
//
|
|
8
|
-
// The station creates the order (client `_id`, `unpaid × in_progress`) BEFORE
|
|
9
|
-
// the link is requested — only that id travels on the wire. On success the
|
|
10
|
-
// cart is cleared; on a failed send the order is voided and the cart is kept
|
|
11
|
-
// so the cashier can retry. Adyen-only today.
|
|
12
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get time clock status action
|
|
3
|
-
* Calls the getTimeClockStatus action on the parent window
|
|
4
|
-
*/
|
|
5
|
-
import { commandFrameClient } from '../../client';
|
|
6
|
-
export const getTimeClockStatus = async (params) => {
|
|
7
|
-
return await commandFrameClient.call('getTimeClockStatus', params);
|
|
8
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** Fixed shift start used by the mock — a clocked-in snapshot with no break taken. */
|
|
2
|
-
const MOCK_CLOCK_IN_TIME = new Date(Date.now() - 2 * 60 * 60 * 1000).toISOString();
|
|
3
|
-
export const mockGetTimeClockStatus = async (params) => {
|
|
4
|
-
console.log('[Mock] getTimeClockStatus called', params);
|
|
5
|
-
const workedMs = Date.now() - new Date(MOCK_CLOCK_IN_TIME).getTime();
|
|
6
|
-
return {
|
|
7
|
-
success: true,
|
|
8
|
-
timestamp: new Date().toISOString(),
|
|
9
|
-
status: 'clocked-in',
|
|
10
|
-
entry: {
|
|
11
|
-
clockInTime: MOCK_CLOCK_IN_TIME,
|
|
12
|
-
breakStartedAt: null,
|
|
13
|
-
totalBreakMinutes: 0,
|
|
14
|
-
workedMs,
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface TimeClockEntry {
|
|
2
|
-
/** ISO date string of when the current shift started. */
|
|
3
|
-
clockInTime: string;
|
|
4
|
-
/** ISO date string of when the current break started, or `null` when not on break. */
|
|
5
|
-
breakStartedAt: string | null;
|
|
6
|
-
/** Total break time accumulated on this shift so far, in minutes. */
|
|
7
|
-
totalBreakMinutes: number;
|
|
8
|
-
/** Milliseconds worked so far on this shift, as of when this response was generated. */
|
|
9
|
-
workedMs: number;
|
|
10
|
-
}
|
|
11
|
-
export interface GetTimeClockStatusResponse {
|
|
12
|
-
success: boolean;
|
|
13
|
-
timestamp: string;
|
|
14
|
-
status: 'out' | 'clocked-in' | 'on-break';
|
|
15
|
-
/** `null` when `status` is `'out'`. */
|
|
16
|
-
entry: TimeClockEntry | null;
|
|
17
|
-
}
|
|
18
|
-
export type GetTimeClockStatus = (params?: Record<string, never>) => Promise<GetTimeClockStatusResponse>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// Get Time Clock Status Types
|
|
2
|
-
//
|
|
3
|
-
// READ-ONLY query: is the active employee clocked out, clocked in, or on
|
|
4
|
-
// break, and since when? There are no clock-in/clock-out commands — this
|
|
5
|
-
// action only reports the current state; `workedMs` is a snapshot at call
|
|
6
|
-
// time and flows are expected to tick it client-side from `clockInTime`.
|
|
7
|
-
export {};
|
|
File without changes
|