@final-commerce/command-frame 0.1.44 → 0.1.47

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 (56) hide show
  1. package/README.md +1 -1
  2. package/dist/CommonTypes.d.ts +82 -35
  3. package/dist/CommonTypes.js +44 -0
  4. package/dist/actions/add-product/mock.js +7 -5
  5. package/dist/actions/add-product/types.d.ts +2 -2
  6. package/dist/actions/edit-product/mock.js +3 -1
  7. package/dist/actions/get-branding/action.d.ts +5 -0
  8. package/dist/actions/get-branding/action.js +7 -0
  9. package/dist/actions/get-branding/mock.d.ts +2 -0
  10. package/dist/actions/get-branding/mock.js +24 -0
  11. package/dist/actions/get-branding/types.d.ts +23 -0
  12. package/dist/actions/get-branding/types.js +2 -0
  13. package/dist/actions/get-current-company-custom-extensions/mock.js +2 -2
  14. package/dist/actions/get-custom-extensions/mock.js +2 -2
  15. package/dist/actions/get-media/action.d.ts +5 -0
  16. package/dist/actions/get-media/action.js +7 -0
  17. package/dist/actions/get-media/mock.d.ts +2 -0
  18. package/dist/actions/get-media/mock.js +35 -0
  19. package/dist/actions/get-media/types.d.ts +30 -0
  20. package/dist/actions/get-media/types.js +2 -0
  21. package/dist/actions/get-tax-tables/action.d.ts +5 -0
  22. package/dist/actions/get-tax-tables/action.js +7 -0
  23. package/dist/actions/get-tax-tables/mock.d.ts +2 -0
  24. package/dist/actions/get-tax-tables/mock.js +21 -0
  25. package/dist/actions/get-tax-tables/types.d.ts +15 -0
  26. package/dist/actions/get-tax-tables/types.js +2 -0
  27. package/dist/actions/navigate-to/action.d.ts +5 -0
  28. package/dist/actions/navigate-to/action.js +7 -0
  29. package/dist/actions/navigate-to/mock.d.ts +2 -0
  30. package/dist/actions/navigate-to/mock.js +7 -0
  31. package/dist/actions/navigate-to/types.d.ts +9 -0
  32. package/dist/actions/navigate-to/types.js +2 -0
  33. package/dist/actions/refresh-resource/action.d.ts +5 -0
  34. package/dist/actions/refresh-resource/action.js +7 -0
  35. package/dist/actions/refresh-resource/mock.d.ts +2 -0
  36. package/dist/actions/refresh-resource/mock.js +7 -0
  37. package/dist/actions/refresh-resource/types.d.ts +9 -0
  38. package/dist/actions/refresh-resource/types.js +2 -0
  39. package/dist/actions/resume-parked-order/mock.js +3 -3
  40. package/dist/actions/show-notification/mock.js +2 -2
  41. package/dist/actions/show-notification/types.d.ts +2 -0
  42. package/dist/actions/upload-media/action.d.ts +5 -0
  43. package/dist/actions/upload-media/action.js +7 -0
  44. package/dist/actions/upload-media/mock.d.ts +2 -0
  45. package/dist/actions/upload-media/mock.js +14 -0
  46. package/dist/actions/upload-media/types.d.ts +20 -0
  47. package/dist/actions/upload-media/types.js +2 -0
  48. package/dist/common-types/custom-extensions.d.ts +1 -1
  49. package/dist/demo/database.d.ts +1 -1
  50. package/dist/demo/database.js +66 -60
  51. package/dist/demo/mocks/custom-tables.js +3 -3
  52. package/dist/index.d.ts +12 -0
  53. package/dist/index.js +14 -0
  54. package/dist/projects/manage/mocks.js +16 -0
  55. package/dist/projects/manage/types.d.ts +15 -1
  56. package/package.json +1 -1
package/README.md CHANGED
@@ -61,7 +61,7 @@ const products = await client.getProducts();
61
61
  For building applications that run inside the Final Commerce Management Dashboard.
62
62
 
63
63
  - **[Manage Documentation](./src/projects/manage/README.md)**
64
- - **Features:** Context information, Dashboard widgets (more coming soon).
64
+ - **Features:** Context, catalog, entities, custom tables, secrets, and optional host-specific commands (navigation, media, tax, branding, notifications) when the dashboard implements them.
65
65
 
66
66
  ```typescript
67
67
  import { ManageClient } from '@final-commerce/command-frame';
@@ -1,4 +1,47 @@
1
1
  export * from "./common-types";
2
+ export declare enum CurrencyCode {
3
+ USD = "USD",
4
+ EUR = "EUR",
5
+ GBP = "GBP",
6
+ CAD = "CAD",
7
+ AUD = "AUD",
8
+ NZD = "NZD",
9
+ CHF = "CHF",
10
+ CNY = "CNY",
11
+ INR = "INR",
12
+ MXN = "MXN",
13
+ BRL = "BRL",
14
+ ZAR = "ZAR",
15
+ SGD = "SGD",
16
+ HKD = "HKD",
17
+ SEK = "SEK",
18
+ NOK = "NOK",
19
+ DKK = "DKK",
20
+ PLN = "PLN",
21
+ THB = "THB",
22
+ MYR = "MYR",
23
+ PHP = "PHP",
24
+ IDR = "IDR",
25
+ AED = "AED",
26
+ SAR = "SAR",
27
+ ILS = "ILS",
28
+ TRY = "TRY",
29
+ RUB = "RUB",
30
+ JPY = "JPY",
31
+ KRW = "KRW",
32
+ VND = "VND",
33
+ CLP = "CLP",
34
+ ISK = "ISK",
35
+ HUF = "HUF",
36
+ TWD = "TWD",
37
+ KWD = "KWD",
38
+ BHD = "BHD",
39
+ OMR = "OMR",
40
+ JOD = "JOD",
41
+ TND = "TND",
42
+ LYD = "LYD",
43
+ IQD = "IQD"
44
+ }
2
45
  export declare enum CFProductType {
3
46
  SIMPLE = "simple",
4
47
  VARIABLE = "variable"
@@ -51,7 +94,7 @@ export interface CFTax {
51
94
  id: string;
52
95
  name: string;
53
96
  percentage: number;
54
- amount: string;
97
+ amount: number;
55
98
  taxTableName: string;
56
99
  taxTableId: string;
57
100
  }
@@ -82,11 +125,11 @@ export interface CFCategory {
82
125
  }
83
126
  export interface CFProductVariant {
84
127
  sku: string;
85
- price: string;
86
- salePrice: string;
128
+ price: number;
129
+ salePrice: number;
87
130
  isOnSale: boolean;
88
131
  barcode?: string;
89
- costPrice?: string;
132
+ costPrice?: number;
90
133
  manageStock: boolean;
91
134
  externalId?: string;
92
135
  inventory?: CFInventory[];
@@ -121,8 +164,10 @@ export interface CFProduct {
121
164
  sku?: string;
122
165
  productType: CFProductType;
123
166
  variants: CFProductVariant[];
124
- minPrice?: string;
125
- maxPrice?: string;
167
+ currency: CurrencyCode;
168
+ minorUnits: number;
169
+ minPrice?: number;
170
+ maxPrice?: number;
126
171
  status?: string;
127
172
  isDeleted?: boolean;
128
173
  }
@@ -172,15 +217,15 @@ export interface CFActiveCustomer extends CFCustomer {
172
217
  id?: string;
173
218
  }
174
219
  export interface CFTip {
175
- amount: string;
220
+ amount: number;
176
221
  percentage: number;
177
222
  }
178
223
  export interface CFSummary {
179
- discountTotal: string;
180
- shippingTotal?: string | null;
181
- total: string;
182
- totalTaxes: string;
183
- subTotal: string;
224
+ discountTotal: number;
225
+ shippingTotal?: number | null;
226
+ total: number;
227
+ totalTaxes: number;
228
+ subTotal: number;
184
229
  taxes: CFTax[];
185
230
  tip?: CFTip | null;
186
231
  isTaxInclusive: boolean;
@@ -189,25 +234,25 @@ export interface CFSummary {
189
234
  }
190
235
  export interface CFCartDiscountItem {
191
236
  label: string;
192
- amount: string;
237
+ amount: number;
193
238
  percentage: number;
194
239
  }
195
240
  export interface CFCartFeeItem {
196
241
  id: string;
197
242
  label: string;
198
- amount: string;
243
+ amount: number;
199
244
  percentage: number;
200
245
  taxTableId?: string;
201
- tax?: string;
246
+ tax?: number;
202
247
  taxName: string;
203
248
  }
204
249
  export interface CFTipPayment {
205
- amount: string;
250
+ amount: number;
206
251
  tipTo: string;
207
252
  percentage: number;
208
253
  }
209
254
  export interface CFRefundedTipPayment {
210
- amount: string;
255
+ amount: number;
211
256
  percentage: number;
212
257
  transactionId: string;
213
258
  tipTo: string;
@@ -215,11 +260,11 @@ export interface CFRefundedTipPayment {
215
260
  export interface CFPaymentMethod {
216
261
  transactionId: string;
217
262
  paymentType: string;
218
- amount: string;
263
+ amount: number;
219
264
  timestamp: string;
220
265
  processor: string;
221
266
  saleId?: string;
222
- change?: string | null;
267
+ change?: number | null;
223
268
  tip?: CFTipPayment | null;
224
269
  cashRounding?: number;
225
270
  emv?: string | null;
@@ -235,13 +280,13 @@ export interface CFPosDataItem {
235
280
  }
236
281
  export interface CFDiscountDetail {
237
282
  percentage: number;
238
- amount: string;
283
+ amount: number;
239
284
  label?: string;
240
285
  }
241
286
  export interface CFFeeDetail {
242
287
  percentage: number;
243
- amount: string;
244
- tax: string;
288
+ amount: number;
289
+ tax: number;
245
290
  taxTableId: string;
246
291
  label?: string;
247
292
  }
@@ -260,12 +305,12 @@ export interface CFLineItem {
260
305
  internalId?: string;
261
306
  name: string;
262
307
  quantity: number;
263
- price: string;
308
+ price: number;
264
309
  taxes: CFTax[];
265
310
  discount: CFDiscountLineItem;
266
311
  fee: CFFeeLineItem;
267
- totalTax: string;
268
- total: string;
312
+ totalTax: number;
313
+ total: number;
269
314
  metadata: CFMetadataItem[];
270
315
  image: string;
271
316
  sku: string;
@@ -279,11 +324,11 @@ export interface CFLineItem {
279
324
  export interface CFCustomSale {
280
325
  customSaleId: string;
281
326
  name: string;
282
- price: string;
327
+ price: number;
283
328
  quantity: number;
284
329
  applyTaxes: boolean;
285
- total: string;
286
- totalTax: string;
330
+ total: number;
331
+ totalTax: number;
287
332
  taxes: CFTax[];
288
333
  discount: {
289
334
  cartDiscount: CFDiscountDetail;
@@ -300,11 +345,11 @@ export interface CFRefundedLineItem {
300
345
  internalId?: string;
301
346
  name: string;
302
347
  quantity: number;
303
- price: string;
348
+ price: number;
304
349
  taxes: CFTax[];
305
350
  discount: CFDiscountLineItem;
306
- totalTax: string;
307
- total: string;
351
+ totalTax: number;
352
+ total: number;
308
353
  image: string;
309
354
  sku: string;
310
355
  note?: string;
@@ -323,12 +368,15 @@ export interface CFRefundItem {
323
368
  timestamp: string | undefined;
324
369
  summary?: CFSummary;
325
370
  refundPayment: CFPaymentMethod[];
326
- balance?: string;
371
+ balance?: number;
327
372
  receiptId?: string;
328
- currency?: string;
373
+ currency: CurrencyCode;
374
+ minorUnits: number;
329
375
  }
330
376
  export interface CFOrder {
331
377
  _id: string;
378
+ currency: CurrencyCode;
379
+ minorUnits: number;
332
380
  receiptId?: string;
333
381
  companyId: string;
334
382
  externalId: string | null;
@@ -353,7 +401,7 @@ export interface CFOrder {
353
401
  /** Gift card / liability purchase lines (not product revenue) */
354
402
  nonRevenueItems?: CFNonRevenueItem[];
355
403
  refund?: CFRefundItem[];
356
- balance: string;
404
+ balance: number;
357
405
  signature?: string | null;
358
406
  }
359
407
  export interface CFActiveUserRole {
@@ -424,7 +472,6 @@ export interface CFActiveOrder extends CFOrder {
424
472
  outlet?: CFActiveOutlet;
425
473
  isDeleted?: boolean;
426
474
  newOrder?: boolean;
427
- currency?: string;
428
475
  station?: CFActiveStation;
429
476
  }
430
477
  export interface CFActiveCustomSales {
@@ -1,4 +1,48 @@
1
1
  export * from "./common-types";
2
+ export var CurrencyCode;
3
+ (function (CurrencyCode) {
4
+ CurrencyCode["USD"] = "USD";
5
+ CurrencyCode["EUR"] = "EUR";
6
+ CurrencyCode["GBP"] = "GBP";
7
+ CurrencyCode["CAD"] = "CAD";
8
+ CurrencyCode["AUD"] = "AUD";
9
+ CurrencyCode["NZD"] = "NZD";
10
+ CurrencyCode["CHF"] = "CHF";
11
+ CurrencyCode["CNY"] = "CNY";
12
+ CurrencyCode["INR"] = "INR";
13
+ CurrencyCode["MXN"] = "MXN";
14
+ CurrencyCode["BRL"] = "BRL";
15
+ CurrencyCode["ZAR"] = "ZAR";
16
+ CurrencyCode["SGD"] = "SGD";
17
+ CurrencyCode["HKD"] = "HKD";
18
+ CurrencyCode["SEK"] = "SEK";
19
+ CurrencyCode["NOK"] = "NOK";
20
+ CurrencyCode["DKK"] = "DKK";
21
+ CurrencyCode["PLN"] = "PLN";
22
+ CurrencyCode["THB"] = "THB";
23
+ CurrencyCode["MYR"] = "MYR";
24
+ CurrencyCode["PHP"] = "PHP";
25
+ CurrencyCode["IDR"] = "IDR";
26
+ CurrencyCode["AED"] = "AED";
27
+ CurrencyCode["SAR"] = "SAR";
28
+ CurrencyCode["ILS"] = "ILS";
29
+ CurrencyCode["TRY"] = "TRY";
30
+ CurrencyCode["RUB"] = "RUB";
31
+ CurrencyCode["JPY"] = "JPY";
32
+ CurrencyCode["KRW"] = "KRW";
33
+ CurrencyCode["VND"] = "VND";
34
+ CurrencyCode["CLP"] = "CLP";
35
+ CurrencyCode["ISK"] = "ISK";
36
+ CurrencyCode["HUF"] = "HUF";
37
+ CurrencyCode["TWD"] = "TWD";
38
+ CurrencyCode["KWD"] = "KWD";
39
+ CurrencyCode["BHD"] = "BHD";
40
+ CurrencyCode["OMR"] = "OMR";
41
+ CurrencyCode["JOD"] = "JOD";
42
+ CurrencyCode["TND"] = "TND";
43
+ CurrencyCode["LYD"] = "LYD";
44
+ CurrencyCode["IQD"] = "IQD";
45
+ })(CurrencyCode || (CurrencyCode = {}));
2
46
  // Enums
3
47
  export var CFProductType;
4
48
  (function (CFProductType) {
@@ -1,10 +1,12 @@
1
- import { CFProductType } from "../../CommonTypes";
1
+ import { CFProductType, CurrencyCode } from "../../CommonTypes";
2
2
  export const mockAddProduct = async (params) => {
3
3
  console.log("[Mock] addProduct called", params);
4
4
  const hasVariants = params.variants && params.variants.length > 0;
5
5
  return {
6
6
  product: {
7
7
  _id: "mock_product_" + Date.now(),
8
+ currency: CurrencyCode.USD,
9
+ minorUnits: 2,
8
10
  name: params.name,
9
11
  description: params.description,
10
12
  categories: params.categories || [],
@@ -14,15 +16,15 @@ export const mockAddProduct = async (params) => {
14
16
  sku: params.sku,
15
17
  productType: hasVariants ? CFProductType.VARIABLE : CFProductType.SIMPLE,
16
18
  attributes: [],
17
- minPrice: params.price || "0",
18
- maxPrice: params.price || "0",
19
+ minPrice: params.price || 0,
20
+ maxPrice: params.price || 0,
19
21
  variants: hasVariants
20
22
  ? params.variants.map((v, i) => ({ ...v, _id: `mock_variant_${Date.now()}_${i}` }))
21
23
  : [{
22
24
  _id: `mock_variant_${Date.now()}_0`,
23
25
  sku: params.sku || "",
24
- price: params.price || "0",
25
- salePrice: "0",
26
+ price: params.price || 0,
27
+ salePrice: 0,
26
28
  isOnSale: false,
27
29
  manageStock: params.manageStock || false,
28
30
  attributes: [],
@@ -7,9 +7,9 @@ export interface AddProductParams {
7
7
  images?: string[];
8
8
  status?: 'active' | 'inactive';
9
9
  /** For simple products: set price directly */
10
- price?: string;
10
+ price?: number;
11
11
  sku?: string;
12
- costPrice?: string;
12
+ costPrice?: number;
13
13
  manageStock?: boolean;
14
14
  /** For variable products: provide variants array */
15
15
  variants?: Omit<CFProductVariant, '_id'>[];
@@ -1,9 +1,11 @@
1
- import { CFProductType } from "../../CommonTypes";
1
+ import { CFProductType, CurrencyCode } from "../../CommonTypes";
2
2
  export const mockEditProduct = async (params) => {
3
3
  console.log("[Mock] editProduct called", params);
4
4
  return {
5
5
  product: {
6
6
  _id: params.productId,
7
+ currency: CurrencyCode.USD,
8
+ minorUnits: 2,
7
9
  name: params.changes.name || "Updated Product",
8
10
  description: params.changes.description,
9
11
  categories: params.changes.categories || [],
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get branding action — current theme tokens from the Manage host.
3
+ */
4
+ import type { GetBranding } from "./types";
5
+ export declare const getBranding: GetBranding;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Get branding action — current theme tokens from the Manage host.
3
+ */
4
+ import { commandFrameClient } from "../../client";
5
+ export const getBranding = async () => {
6
+ return await commandFrameClient.call("getBranding");
7
+ };
@@ -0,0 +1,2 @@
1
+ import { GetBranding } from "./types";
2
+ export declare const mockGetBranding: GetBranding;
@@ -0,0 +1,24 @@
1
+ export const mockGetBranding = async () => {
2
+ console.log("[Mock] getBranding called");
3
+ return {
4
+ theme: "light",
5
+ colors: {
6
+ primary: "#2563eb",
7
+ secondary: "#64748b",
8
+ accent: "#0ea5e9",
9
+ destructive: "#dc2626",
10
+ sidebar: "#1e293b",
11
+ background: "#ffffff",
12
+ foreground: "#0f172a",
13
+ muted: "#f1f5f9",
14
+ border: "#e2e8f0"
15
+ },
16
+ borderRadius: "round",
17
+ borderRadiusValue: "0.5rem",
18
+ font: {
19
+ family: "system-ui, sans-serif"
20
+ },
21
+ logo: null,
22
+ timestamp: new Date().toISOString()
23
+ };
24
+ };
@@ -0,0 +1,23 @@
1
+ export type BorderRadiusPreset = "sharp" | "soft" | "round" | "pill";
2
+ export interface GetBrandingResponse {
3
+ theme: "light" | "dark";
4
+ colors: {
5
+ primary: string;
6
+ secondary: string;
7
+ accent: string;
8
+ destructive: string;
9
+ sidebar: string;
10
+ background: string;
11
+ foreground: string;
12
+ muted: string;
13
+ border: string;
14
+ };
15
+ borderRadius: BorderRadiusPreset;
16
+ borderRadiusValue: string;
17
+ font: {
18
+ family: string;
19
+ };
20
+ logo: string | null;
21
+ timestamp: string;
22
+ }
23
+ export type GetBranding = () => Promise<GetBrandingResponse>;
@@ -0,0 +1,2 @@
1
+ // Get Branding Types (Manage host extension)
2
+ export {};
@@ -14,7 +14,7 @@ export const mockGetCurrentCompanyCustomExtensions = async (params) => {
14
14
  "https://example.com/images/loyalty-1.png",
15
15
  "https://example.com/images/loyalty-2.png"
16
16
  ],
17
- price: "$29.99",
17
+ price: 2999,
18
18
  website: "https://loyalty-extension.example.com",
19
19
  isDeleted: false,
20
20
  createdAt: "2024-01-01T10:00:00.000Z",
@@ -29,7 +29,7 @@ export const mockGetCurrentCompanyCustomExtensions = async (params) => {
29
29
  short_description: "Real-time inventory insights",
30
30
  long_description: "Get detailed insights into your inventory with real-time tracking, low stock alerts, and comprehensive reporting.",
31
31
  main_image: "https://example.com/images/inventory-extension.png",
32
- price: "$49.99",
32
+ price: 4999,
33
33
  isDeleted: false,
34
34
  createdAt: "2024-01-05T08:00:00.000Z",
35
35
  updatedAt: "2024-01-05T08:00:00.000Z",
@@ -14,7 +14,7 @@ export const mockGetCustomExtensions = async () => {
14
14
  "https://example.com/images/loyalty-1.png",
15
15
  "https://example.com/images/loyalty-2.png"
16
16
  ],
17
- price: "$29.99",
17
+ price: 2999,
18
18
  website: "https://loyalty-extension.example.com",
19
19
  isDeleted: false,
20
20
  createdAt: "2024-01-01T10:00:00.000Z",
@@ -29,7 +29,7 @@ export const mockGetCustomExtensions = async () => {
29
29
  short_description: "Real-time inventory insights",
30
30
  long_description: "Get detailed insights into your inventory with real-time tracking, low stock alerts, and comprehensive reporting.",
31
31
  main_image: "https://example.com/images/inventory-extension.png",
32
- price: "$49.99",
32
+ price: 4999,
33
33
  isDeleted: false,
34
34
  createdAt: "2024-01-05T08:00:00.000Z",
35
35
  updatedAt: "2024-01-05T08:00:00.000Z",
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get media action — list media library items from the Manage host.
3
+ */
4
+ import type { GetMedia } from "./types";
5
+ export declare const getMedia: GetMedia;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Get media action — list media library items from the Manage host.
3
+ */
4
+ import { commandFrameClient } from "../../client";
5
+ export const getMedia = async (params) => {
6
+ return await commandFrameClient.call("getMedia", params);
7
+ };
@@ -0,0 +1,2 @@
1
+ import { GetMedia } from "./types";
2
+ export declare const mockGetMedia: GetMedia;
@@ -0,0 +1,35 @@
1
+ const now = new Date().toISOString();
2
+ export const mockGetMedia = async (params) => {
3
+ console.log("[Mock] getMedia called", params);
4
+ const items = [
5
+ {
6
+ _id: "mock_media_1",
7
+ url: "https://example.com/media/photo1.jpg",
8
+ filename: "photo1.jpg",
9
+ mimeType: "image/jpeg",
10
+ size: 102400,
11
+ folder: "images",
12
+ title: "Sample photo",
13
+ alt: "Sample",
14
+ width: 800,
15
+ height: 600,
16
+ createdAt: now
17
+ },
18
+ {
19
+ _id: "mock_media_2",
20
+ url: "https://example.com/media/doc.pdf",
21
+ filename: "doc.pdf",
22
+ mimeType: "application/pdf",
23
+ size: 51200,
24
+ folder: "documents",
25
+ createdAt: now
26
+ }
27
+ ];
28
+ return {
29
+ items,
30
+ total: items.length,
31
+ page: params?.page ?? 1,
32
+ pageSize: params?.pageSize ?? 20,
33
+ timestamp: new Date().toISOString()
34
+ };
35
+ };
@@ -0,0 +1,30 @@
1
+ export interface GetMediaParams {
2
+ search?: string;
3
+ mimeType?: string[];
4
+ folder?: string;
5
+ page?: number;
6
+ pageSize?: number;
7
+ sortBy?: "createdAt" | "filename" | "size" | "title";
8
+ sortDir?: "asc" | "desc";
9
+ }
10
+ export interface MediaItemPayload {
11
+ _id: string;
12
+ url: string;
13
+ filename: string;
14
+ mimeType: string;
15
+ size: number;
16
+ folder: string;
17
+ title?: string;
18
+ alt?: string;
19
+ width?: number;
20
+ height?: number;
21
+ createdAt: string;
22
+ }
23
+ export interface GetMediaResponse {
24
+ items: MediaItemPayload[];
25
+ total: number;
26
+ page: number;
27
+ pageSize: number;
28
+ timestamp: string;
29
+ }
30
+ export type GetMedia = (params?: GetMediaParams) => Promise<GetMediaResponse>;
@@ -0,0 +1,2 @@
1
+ // Get Media Types (Manage host extension)
2
+ export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get tax tables action — list tax tables for the company.
3
+ */
4
+ import type { GetTaxTables } from "./types";
5
+ export declare const getTaxTables: GetTaxTables;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Get tax tables action — list tax tables for the company.
3
+ */
4
+ import { commandFrameClient } from "../../client";
5
+ export const getTaxTables = async () => {
6
+ return await commandFrameClient.call("getTaxTables");
7
+ };
@@ -0,0 +1,2 @@
1
+ import { GetTaxTables } from "./types";
2
+ export declare const mockGetTaxTables: GetTaxTables;
@@ -0,0 +1,21 @@
1
+ export const mockGetTaxTables = async () => {
2
+ console.log("[Mock] getTaxTables called");
3
+ return {
4
+ taxTables: [
5
+ {
6
+ _id: "mock_table_1",
7
+ name: "Standard",
8
+ rates: [
9
+ { _id: "mock_rate_1", name: "GST", isCompounding: false },
10
+ { _id: "mock_rate_2", name: "PST", isCompounding: true }
11
+ ]
12
+ },
13
+ {
14
+ _id: "mock_table_2",
15
+ name: "Zero",
16
+ rates: [{ _id: "mock_rate_3", name: "Zero rated", isCompounding: false }]
17
+ }
18
+ ],
19
+ timestamp: new Date().toISOString()
20
+ };
21
+ };
@@ -0,0 +1,15 @@
1
+ export interface TaxRatePayload {
2
+ _id: string;
3
+ name: string;
4
+ isCompounding: boolean;
5
+ }
6
+ export interface TaxTablePayload {
7
+ _id: string;
8
+ name: string;
9
+ rates: TaxRatePayload[];
10
+ }
11
+ export interface GetTaxTablesResponse {
12
+ taxTables: TaxTablePayload[];
13
+ timestamp: string;
14
+ }
15
+ export type GetTaxTables = () => Promise<GetTaxTablesResponse>;
@@ -0,0 +1,2 @@
1
+ // Get Tax Tables Types (Manage host extension)
2
+ export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Navigate to action — SPA navigation in the Manage host.
3
+ */
4
+ import type { NavigateTo } from "./types";
5
+ export declare const navigateTo: NavigateTo;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Navigate to action — SPA navigation in the Manage host.
3
+ */
4
+ import { commandFrameClient } from "../../client";
5
+ export const navigateTo = async (params) => {
6
+ return await commandFrameClient.call("navigateTo", params);
7
+ };
@@ -0,0 +1,2 @@
1
+ import { NavigateTo } from "./types";
2
+ export declare const mockNavigateTo: NavigateTo;
@@ -0,0 +1,7 @@
1
+ export const mockNavigateTo = async (params) => {
2
+ console.log("[Mock] navigateTo called", params.path);
3
+ return {
4
+ success: true,
5
+ timestamp: new Date().toISOString()
6
+ };
7
+ };