@final-commerce/command-frame 0.1.21 → 0.1.23

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 (46) hide show
  1. package/dist/actions/delete-custom-table-data/action.d.ts +2 -2
  2. package/dist/actions/delete-custom-table-data/action.js +2 -2
  3. package/dist/actions/delete-custom-table-data/mock.d.ts +2 -0
  4. package/dist/actions/delete-custom-table-data/mock.js +7 -0
  5. package/dist/actions/get-current-company-custom-extensions/action.d.ts +6 -0
  6. package/dist/actions/get-current-company-custom-extensions/action.js +8 -0
  7. package/dist/actions/get-current-company-custom-extensions/mock.d.ts +2 -0
  8. package/dist/actions/get-current-company-custom-extensions/mock.js +44 -0
  9. package/dist/actions/get-current-company-custom-extensions/types.d.ts +9 -0
  10. package/dist/actions/get-current-company-custom-extensions/types.js +1 -0
  11. package/dist/actions/get-custom-extension-custom-tables/action.d.ts +6 -0
  12. package/dist/actions/get-custom-extension-custom-tables/action.js +8 -0
  13. package/dist/actions/get-custom-extension-custom-tables/mock.d.ts +2 -0
  14. package/dist/actions/get-custom-extension-custom-tables/mock.js +36 -0
  15. package/dist/actions/get-custom-extension-custom-tables/types.d.ts +10 -0
  16. package/dist/actions/get-custom-extension-custom-tables/types.js +1 -0
  17. package/dist/actions/get-custom-extensions/action.d.ts +6 -0
  18. package/dist/actions/get-custom-extensions/action.js +8 -0
  19. package/dist/actions/get-custom-extensions/mock.d.ts +2 -0
  20. package/dist/actions/get-custom-extensions/mock.js +44 -0
  21. package/dist/actions/get-custom-extensions/types.d.ts +7 -0
  22. package/dist/actions/get-custom-extensions/types.js +1 -0
  23. package/dist/actions/get-custom-table-data/action.d.ts +2 -2
  24. package/dist/actions/get-custom-table-data/action.js +2 -2
  25. package/dist/actions/get-custom-table-data/mock.d.ts +2 -0
  26. package/dist/actions/get-custom-table-data/mock.js +34 -0
  27. package/dist/actions/get-custom-table-fields/mock.d.ts +2 -0
  28. package/dist/actions/get-custom-table-fields/mock.js +39 -0
  29. package/dist/actions/get-custom-tables/mock.d.ts +2 -0
  30. package/dist/actions/get-custom-tables/mock.js +43 -0
  31. package/dist/actions/upsert-custom-table-data/mock.d.ts +2 -0
  32. package/dist/actions/upsert-custom-table-data/mock.js +17 -0
  33. package/dist/common-types/base-entity.d.ts +5 -0
  34. package/dist/common-types/base-entity.js +1 -0
  35. package/dist/common-types/custom-extensions.d.ts +18 -0
  36. package/dist/common-types/custom-extensions.js +1 -0
  37. package/dist/common-types/custom-tables.d.ts +3 -4
  38. package/dist/common-types/index.d.ts +1 -0
  39. package/dist/common-types/index.js +1 -0
  40. package/dist/demo/mocks/custom-tables.d.ts +11 -0
  41. package/dist/demo/mocks/custom-tables.js +250 -23
  42. package/dist/index.d.ts +9 -0
  43. package/dist/index.js +15 -1
  44. package/dist/projects/render/mocks.js +17 -1
  45. package/dist/projects/render/types.d.ts +9 -1
  46. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Get custom tables action
3
- * Calls the getCustomTables action on the parent window
2
+ * Delete custom table data action
3
+ * Calls the deleteCustomTableData action on the parent window
4
4
  */
5
5
  import type { DeleteCustomTableData } from "./types";
6
6
  export declare const deleteCustomTableData: DeleteCustomTableData;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Get custom tables action
3
- * Calls the getCustomTables action on the parent window
2
+ * Delete custom table data action
3
+ * Calls the deleteCustomTableData action on the parent window
4
4
  */
5
5
  import { commandFrameClient } from "../../client";
6
6
  export const deleteCustomTableData = async (params) => {
@@ -0,0 +1,2 @@
1
+ import { DeleteCustomTableData } from "./types";
2
+ export declare const mockDeleteCustomTableData: DeleteCustomTableData;
@@ -0,0 +1,7 @@
1
+ export const mockDeleteCustomTableData = async (params) => {
2
+ console.log("[Mock] deleteCustomTableData called", params);
3
+ return {
4
+ success: true,
5
+ timestamp: new Date().toISOString()
6
+ };
7
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get custom extensions action
3
+ * Calls the getCustomExtensions action on the parent window
4
+ */
5
+ import type { GetCurrentCompanyCustomExtensions } from "./types";
6
+ export declare const getCurrentCompanyCustomExtensions: GetCurrentCompanyCustomExtensions;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Get custom extensions action
3
+ * Calls the getCustomExtensions action on the parent window
4
+ */
5
+ import { commandFrameClient } from "../../client";
6
+ export const getCurrentCompanyCustomExtensions = async (params) => {
7
+ return await commandFrameClient.call("getCurrentCompanyCustomExtensions", params);
8
+ };
@@ -0,0 +1,2 @@
1
+ import { GetCurrentCompanyCustomExtensions } from "./types";
2
+ export declare const mockGetCurrentCompanyCustomExtensions: GetCurrentCompanyCustomExtensions;
@@ -0,0 +1,44 @@
1
+ export const mockGetCurrentCompanyCustomExtensions = async (params) => {
2
+ console.log("[Mock] getCurrentCompanyCustomExtensions called", params);
3
+ const mockExtensions = [
4
+ {
5
+ _id: "ext_loyalty_program",
6
+ label: "Loyalty Program Extension",
7
+ description: "Add a loyalty points system to your POS",
8
+ category: "Customer Management",
9
+ short_description: "Loyalty points tracking",
10
+ long_description: "A comprehensive loyalty program that allows you to track customer points, offer rewards, and increase customer retention.",
11
+ main_image: "https://example.com/images/loyalty-extension.png",
12
+ backgroundUrl: "https://example.com/images/loyalty-bg.jpg",
13
+ gallery: [
14
+ "https://example.com/images/loyalty-1.png",
15
+ "https://example.com/images/loyalty-2.png"
16
+ ],
17
+ price: "$29.99",
18
+ website: "https://loyalty-extension.example.com",
19
+ isDeleted: false,
20
+ createdAt: "2024-01-01T10:00:00.000Z",
21
+ updatedAt: "2024-01-10T14:30:00.000Z",
22
+ __v: 0
23
+ },
24
+ {
25
+ _id: "ext_inventory_analytics",
26
+ label: "Inventory Analytics",
27
+ description: "Advanced inventory tracking and reporting",
28
+ category: "Analytics",
29
+ short_description: "Real-time inventory insights",
30
+ long_description: "Get detailed insights into your inventory with real-time tracking, low stock alerts, and comprehensive reporting.",
31
+ main_image: "https://example.com/images/inventory-extension.png",
32
+ price: "$49.99",
33
+ isDeleted: false,
34
+ createdAt: "2024-01-05T08:00:00.000Z",
35
+ updatedAt: "2024-01-05T08:00:00.000Z",
36
+ __v: 0
37
+ }
38
+ ];
39
+ return {
40
+ success: true,
41
+ customExtensions: mockExtensions,
42
+ timestamp: new Date().toISOString()
43
+ };
44
+ };
@@ -0,0 +1,9 @@
1
+ import { CustomExtension } from "../../common-types/custom-extensions";
2
+ export interface GetCurrentCompanyCustomExtensionsParams {
3
+ }
4
+ export interface GetCurrentCompanyCustomExtensionsResponse {
5
+ success: boolean;
6
+ customExtensions: CustomExtension[];
7
+ timestamp: string;
8
+ }
9
+ export type GetCurrentCompanyCustomExtensions = (params: GetCurrentCompanyCustomExtensionsParams) => Promise<GetCurrentCompanyCustomExtensionsResponse>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get custom extensions action
3
+ * Calls the getCustomExtensions action on the parent window
4
+ */
5
+ import type { GetCustomExtensionCustomTables } from "./types";
6
+ export declare const getCustomExtensionCustomTables: GetCustomExtensionCustomTables;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Get custom extensions action
3
+ * Calls the getCustomExtensions action on the parent window
4
+ */
5
+ import { commandFrameClient } from "../../client";
6
+ export const getCustomExtensionCustomTables = async (params) => {
7
+ return await commandFrameClient.call("getCustomExtensionCustomTables", params);
8
+ };
@@ -0,0 +1,2 @@
1
+ import { GetCustomExtensionCustomTables } from "./types";
2
+ export declare const mockGetCustomExtensionCustomTables: GetCustomExtensionCustomTables;
@@ -0,0 +1,36 @@
1
+ export const mockGetCustomExtensionCustomTables = async (params) => {
2
+ console.log("[Mock] getCustomExtensionCustomTables called", params);
3
+ const mockTables = [
4
+ {
5
+ _id: "custom_table_1",
6
+ name: "users",
7
+ description: "Store user information with fullName, email, and active status",
8
+ metadata: [
9
+ {
10
+ key: "extensionId",
11
+ value: params.extensionId
12
+ }
13
+ ],
14
+ createdAt: "2024-01-01T10:00:00.000Z",
15
+ updatedAt: "2024-01-01T10:00:00.000Z"
16
+ },
17
+ {
18
+ _id: "custom_table_2",
19
+ name: "loyalty_points",
20
+ description: "Track customer loyalty points",
21
+ metadata: [
22
+ {
23
+ key: "extensionId",
24
+ value: params.extensionId
25
+ }
26
+ ],
27
+ createdAt: "2024-01-03T09:00:00.000Z",
28
+ updatedAt: "2024-01-03T09:00:00.000Z"
29
+ }
30
+ ];
31
+ return {
32
+ success: true,
33
+ customTables: mockTables,
34
+ timestamp: new Date().toISOString()
35
+ };
36
+ };
@@ -0,0 +1,10 @@
1
+ import { CFCustomTable } from "../../common-types/custom-tables";
2
+ export interface GetCustomExtensionCustomTablesParams {
3
+ extensionId: string;
4
+ }
5
+ export interface GetCustomExtensionCustomTablesResponse {
6
+ success: boolean;
7
+ customTables: CFCustomTable[];
8
+ timestamp: string;
9
+ }
10
+ export type GetCustomExtensionCustomTables = (params: GetCustomExtensionCustomTablesParams) => Promise<GetCustomExtensionCustomTablesResponse>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get custom extensions action
3
+ * Calls the getCustomExtensions action on the parent window
4
+ */
5
+ import type { GetCustomExtensions } from "./types";
6
+ export declare const getCustomExtensions: GetCustomExtensions;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Get custom extensions action
3
+ * Calls the getCustomExtensions action on the parent window
4
+ */
5
+ import { commandFrameClient } from "../../client";
6
+ export const getCustomExtensions = async () => {
7
+ return await commandFrameClient.call("getCustomExtensions");
8
+ };
@@ -0,0 +1,2 @@
1
+ import { GetCustomExtensions } from "./types";
2
+ export declare const mockGetCustomExtensions: GetCustomExtensions;
@@ -0,0 +1,44 @@
1
+ export const mockGetCustomExtensions = async () => {
2
+ console.log("[Mock] getCustomExtensions called");
3
+ const mockExtensions = [
4
+ {
5
+ _id: "ext_loyalty_program",
6
+ label: "Loyalty Program Extension",
7
+ description: "Add a loyalty points system to your POS",
8
+ category: "Customer Management",
9
+ short_description: "Loyalty points tracking",
10
+ long_description: "A comprehensive loyalty program that allows you to track customer points, offer rewards, and increase customer retention.",
11
+ main_image: "https://example.com/images/loyalty-extension.png",
12
+ backgroundUrl: "https://example.com/images/loyalty-bg.jpg",
13
+ gallery: [
14
+ "https://example.com/images/loyalty-1.png",
15
+ "https://example.com/images/loyalty-2.png"
16
+ ],
17
+ price: "$29.99",
18
+ website: "https://loyalty-extension.example.com",
19
+ isDeleted: false,
20
+ createdAt: "2024-01-01T10:00:00.000Z",
21
+ updatedAt: "2024-01-10T14:30:00.000Z",
22
+ __v: 0
23
+ },
24
+ {
25
+ _id: "ext_inventory_analytics",
26
+ label: "Inventory Analytics",
27
+ description: "Advanced inventory tracking and reporting",
28
+ category: "Analytics",
29
+ short_description: "Real-time inventory insights",
30
+ long_description: "Get detailed insights into your inventory with real-time tracking, low stock alerts, and comprehensive reporting.",
31
+ main_image: "https://example.com/images/inventory-extension.png",
32
+ price: "$49.99",
33
+ isDeleted: false,
34
+ createdAt: "2024-01-05T08:00:00.000Z",
35
+ updatedAt: "2024-01-05T08:00:00.000Z",
36
+ __v: 0
37
+ }
38
+ ];
39
+ return {
40
+ success: true,
41
+ customExtensions: mockExtensions,
42
+ timestamp: new Date().toISOString()
43
+ };
44
+ };
@@ -0,0 +1,7 @@
1
+ import { CustomExtension } from "../../common-types/custom-extensions";
2
+ export interface GetCustomExtensionsResponse {
3
+ success: boolean;
4
+ customExtensions: CustomExtension[];
5
+ timestamp: string;
6
+ }
7
+ export type GetCustomExtensions = () => Promise<GetCustomExtensionsResponse>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Get custom tables action
3
- * Calls the getCustomTables action on the parent window
2
+ * Get custom table data action
3
+ * Calls the getCustomTableData action on the parent window
4
4
  */
5
5
  import type { GetCustomTableData } from "./types";
6
6
  export declare const getCustomTableData: GetCustomTableData;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Get custom tables action
3
- * Calls the getCustomTables action on the parent window
2
+ * Get custom table data action
3
+ * Calls the getCustomTableData action on the parent window
4
4
  */
5
5
  import { commandFrameClient } from "../../client";
6
6
  export const getCustomTableData = async (params) => {
@@ -0,0 +1,2 @@
1
+ import { GetCustomTableData } from "./types";
2
+ export declare const mockGetCustomTableData: GetCustomTableData;
@@ -0,0 +1,34 @@
1
+ export const mockGetCustomTableData = async (params) => {
2
+ console.log("[Mock] getCustomTableData called", params);
3
+ const mockData = [
4
+ {
5
+ _id: "user_data_1",
6
+ fullName: "John Doe",
7
+ email: "john.doe@example.com",
8
+ isActive: true,
9
+ createdAt: "2024-01-10T10:00:00.000Z",
10
+ updatedAt: "2024-01-10T10:00:00.000Z"
11
+ },
12
+ {
13
+ _id: "user_data_2",
14
+ fullName: "Jane Smith",
15
+ email: "jane.smith@example.com",
16
+ isActive: true,
17
+ createdAt: "2024-01-11T11:00:00.000Z",
18
+ updatedAt: "2024-01-11T11:00:00.000Z"
19
+ },
20
+ {
21
+ _id: "user_data_3",
22
+ fullName: "Bob Johnson",
23
+ email: "bob.johnson@example.com",
24
+ isActive: false,
25
+ createdAt: "2024-01-12T09:00:00.000Z",
26
+ updatedAt: "2024-01-15T14:30:00.000Z"
27
+ }
28
+ ];
29
+ return {
30
+ success: true,
31
+ data: mockData,
32
+ timestamp: new Date().toISOString()
33
+ };
34
+ };
@@ -0,0 +1,2 @@
1
+ import { GetCustomTableFields } from "./types";
2
+ export declare const mockGetCustomTableFields: GetCustomTableFields;
@@ -0,0 +1,39 @@
1
+ import { AttributeType } from "../../CommonTypes";
2
+ export const mockGetCustomTableFields = async (params) => {
3
+ console.log("[Mock] getCustomTableFields called", params);
4
+ const mockFields = [
5
+ {
6
+ _id: "field_fullname",
7
+ tableId: params.tableId,
8
+ name: "fullName",
9
+ type: AttributeType.STRING,
10
+ required: true,
11
+ createdAt: "2024-01-01T10:00:00.000Z",
12
+ updatedAt: "2024-01-01T10:00:00.000Z"
13
+ },
14
+ {
15
+ _id: "field_email",
16
+ tableId: params.tableId,
17
+ name: "email",
18
+ type: AttributeType.STRING,
19
+ required: true,
20
+ createdAt: "2024-01-01T10:00:00.000Z",
21
+ updatedAt: "2024-01-01T10:00:00.000Z"
22
+ },
23
+ {
24
+ _id: "field_isactive",
25
+ tableId: params.tableId,
26
+ name: "isActive",
27
+ type: AttributeType.BOOLEAN,
28
+ required: true,
29
+ defaultValue: true,
30
+ createdAt: "2024-01-01T10:00:00.000Z",
31
+ updatedAt: "2024-01-01T10:00:00.000Z"
32
+ }
33
+ ];
34
+ return {
35
+ success: true,
36
+ fields: mockFields,
37
+ timestamp: new Date().toISOString()
38
+ };
39
+ };
@@ -0,0 +1,2 @@
1
+ import { GetCustomTables } from "./types";
2
+ export declare const mockGetCustomTables: GetCustomTables;
@@ -0,0 +1,43 @@
1
+ export const mockGetCustomTables = async () => {
2
+ console.log("[Mock] getCustomTables called");
3
+ const mockTables = [
4
+ {
5
+ _id: "custom_table_1",
6
+ name: "users",
7
+ description: "Store user information with fullName, email, and active status",
8
+ metadata: [
9
+ {
10
+ key: "category",
11
+ value: "user_data"
12
+ }
13
+ ],
14
+ createdAt: "2024-01-01T10:00:00.000Z",
15
+ updatedAt: "2024-01-01T10:00:00.000Z"
16
+ },
17
+ {
18
+ _id: "custom_table_2",
19
+ name: "customer_preferences",
20
+ description: "Store customer preferences and settings",
21
+ metadata: [
22
+ {
23
+ key: "category",
24
+ value: "customer_data"
25
+ }
26
+ ],
27
+ createdAt: "2024-01-02T08:00:00.000Z",
28
+ updatedAt: "2024-01-02T08:00:00.000Z"
29
+ },
30
+ {
31
+ _id: "custom_table_3",
32
+ name: "loyalty_points",
33
+ description: "Track customer loyalty points",
34
+ createdAt: "2024-01-03T09:00:00.000Z",
35
+ updatedAt: "2024-01-03T09:00:00.000Z"
36
+ }
37
+ ];
38
+ return {
39
+ success: true,
40
+ customTables: mockTables,
41
+ timestamp: new Date().toISOString()
42
+ };
43
+ };
@@ -0,0 +1,2 @@
1
+ import { UpsertCustomTableData } from "./types";
2
+ export declare const mockUpsertCustomTableData: UpsertCustomTableData;
@@ -0,0 +1,17 @@
1
+ export const mockUpsertCustomTableData = async (params) => {
2
+ console.log("[Mock] upsertCustomTableData called", params);
3
+ const data = params?.data;
4
+ const now = new Date().toISOString();
5
+ // Return the data with _id and timestamps added
6
+ const resultData = {
7
+ ...data,
8
+ _id: data?._id || `mock_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
9
+ createdAt: data?.createdAt || now,
10
+ updatedAt: now
11
+ };
12
+ return {
13
+ success: true,
14
+ data: resultData,
15
+ timestamp: now
16
+ };
17
+ };
@@ -0,0 +1,5 @@
1
+ export type BaseEntity = {
2
+ _id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import { BaseEntity } from "./base-entity";
2
+ export type CustomExtension = BaseEntity & {
3
+ _id: string;
4
+ label: string;
5
+ description?: string;
6
+ backgroundUrl?: string;
7
+ gallery?: string[];
8
+ category: string;
9
+ short_description?: string;
10
+ long_description?: string;
11
+ main_image?: string;
12
+ price: string;
13
+ isDeleted: boolean;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ __v: number;
17
+ website?: string;
18
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
- export type CFCustomTable = {
2
- _id: string;
1
+ import { BaseEntity } from "./base-entity";
2
+ export type CFCustomTable = BaseEntity & {
3
3
  name: string;
4
4
  description?: string;
5
5
  metadata?: Array<{
@@ -14,8 +14,7 @@ export declare enum AttributeType {
14
14
  DATE = "date",
15
15
  JSON_STRING = "json-string"
16
16
  }
17
- export type CFCustomTableField = {
18
- _id: string;
17
+ export type CFCustomTableField = BaseEntity & {
19
18
  tableId: string;
20
19
  name: string;
21
20
  type: AttributeType;
@@ -1 +1,2 @@
1
1
  export * from "./custom-tables";
2
+ export * from "./custom-extensions";
@@ -1 +1,2 @@
1
1
  export * from "./custom-tables";
2
+ export * from "./custom-extensions";
@@ -1,3 +1,14 @@
1
1
  import { CFCustomTable, CFCustomTableField } from "../../CommonTypes";
2
+ import { CustomExtension } from "../../common-types/custom-extensions";
2
3
  export declare const MOCK_CUSTOM_TABLES: CFCustomTable[];
3
4
  export declare const MOCK_CUSTOM_TABLE_FIELDS: CFCustomTableField[];
5
+ export interface CustomTableDataRow {
6
+ _id: string;
7
+ fullName: string;
8
+ email: string;
9
+ isActive: boolean;
10
+ createdAt: string;
11
+ updatedAt: string;
12
+ }
13
+ export declare const MOCK_CUSTOM_TABLE_DATA: Record<string, CustomTableDataRow[]>;
14
+ export declare const MOCK_CUSTOM_EXTENSIONS: CustomExtension[];
@@ -1,46 +1,273 @@
1
1
  import { AttributeType } from "../../CommonTypes";
2
2
  export const MOCK_CUSTOM_TABLES = [
3
3
  {
4
- _id: "custom_table_1",
5
- name: "Custom Table 1",
6
- description: "Custom Table 1 Description",
4
+ _id: "custom_table_users",
5
+ name: "users",
6
+ description: "Store user information with fullName, email, and active status",
7
7
  metadata: [
8
8
  {
9
- key: "value",
10
- value: "value"
9
+ key: "extensionId",
10
+ value: "ext_loyalty_program"
11
+ },
12
+ {
13
+ key: "version",
14
+ value: "1.0"
15
+ }
16
+ ],
17
+ createdAt: "2024-01-01T10:00:00.000Z",
18
+ updatedAt: "2024-01-01T10:00:00.000Z"
19
+ },
20
+ {
21
+ _id: "custom_table_preferences",
22
+ name: "customer_preferences",
23
+ description: "Store customer preferences and settings",
24
+ metadata: [
25
+ {
26
+ key: "category",
27
+ value: "customer_data"
28
+ }
29
+ ],
30
+ createdAt: "2024-01-02T08:00:00.000Z",
31
+ updatedAt: "2024-01-02T08:00:00.000Z"
32
+ },
33
+ {
34
+ _id: "custom_table_loyalty",
35
+ name: "loyalty_points",
36
+ description: "Track customer loyalty points",
37
+ metadata: [
38
+ {
39
+ key: "extensionId",
40
+ value: "ext_loyalty_program"
11
41
  }
12
- ]
42
+ ],
43
+ createdAt: "2024-01-03T09:00:00.000Z",
44
+ updatedAt: "2024-01-03T09:00:00.000Z"
13
45
  }
14
46
  ];
15
47
  export const MOCK_CUSTOM_TABLE_FIELDS = [
48
+ // Fields for 'users' table
49
+ {
50
+ _id: "field_users_fullname",
51
+ tableId: "custom_table_users",
52
+ name: "fullName",
53
+ type: AttributeType.STRING,
54
+ required: true,
55
+ createdAt: "2024-01-01T10:00:00.000Z",
56
+ updatedAt: "2024-01-01T10:00:00.000Z"
57
+ },
58
+ {
59
+ _id: "field_users_email",
60
+ tableId: "custom_table_users",
61
+ name: "email",
62
+ type: AttributeType.STRING,
63
+ required: true,
64
+ createdAt: "2024-01-01T10:00:00.000Z",
65
+ updatedAt: "2024-01-01T10:00:00.000Z"
66
+ },
67
+ {
68
+ _id: "field_users_isactive",
69
+ tableId: "custom_table_users",
70
+ name: "isActive",
71
+ type: AttributeType.BOOLEAN,
72
+ required: true,
73
+ defaultValue: true,
74
+ createdAt: "2024-01-01T10:00:00.000Z",
75
+ updatedAt: "2024-01-01T10:00:00.000Z"
76
+ },
77
+ // Fields for 'customer_preferences' table
78
+ {
79
+ _id: "field_prefs_fullname",
80
+ tableId: "custom_table_preferences",
81
+ name: "fullName",
82
+ type: AttributeType.STRING,
83
+ required: true,
84
+ createdAt: "2024-01-02T08:00:00.000Z",
85
+ updatedAt: "2024-01-02T08:00:00.000Z"
86
+ },
87
+ {
88
+ _id: "field_prefs_email",
89
+ tableId: "custom_table_preferences",
90
+ name: "email",
91
+ type: AttributeType.STRING,
92
+ required: true,
93
+ createdAt: "2024-01-02T08:00:00.000Z",
94
+ updatedAt: "2024-01-02T08:00:00.000Z"
95
+ },
96
+ {
97
+ _id: "field_prefs_isactive",
98
+ tableId: "custom_table_preferences",
99
+ name: "isActive",
100
+ type: AttributeType.BOOLEAN,
101
+ required: false,
102
+ defaultValue: true,
103
+ createdAt: "2024-01-02T08:00:00.000Z",
104
+ updatedAt: "2024-01-02T08:00:00.000Z"
105
+ },
106
+ // Fields for 'loyalty_points' table
16
107
  {
17
- _id: "field_1",
18
- tableId: "custom_table_1",
19
- name: "customerId",
108
+ _id: "field_loyalty_fullname",
109
+ tableId: "custom_table_loyalty",
110
+ name: "fullName",
20
111
  type: AttributeType.STRING,
21
- required: true
112
+ required: true,
113
+ createdAt: "2024-01-03T09:00:00.000Z",
114
+ updatedAt: "2024-01-03T09:00:00.000Z"
22
115
  },
23
116
  {
24
- _id: "field_2",
25
- tableId: "custom_table_1",
26
- name: "points",
27
- type: AttributeType.NUMBER,
117
+ _id: "field_loyalty_email",
118
+ tableId: "custom_table_loyalty",
119
+ name: "email",
120
+ type: AttributeType.STRING,
28
121
  required: true,
29
- defaultValue: 0
122
+ createdAt: "2024-01-03T09:00:00.000Z",
123
+ updatedAt: "2024-01-03T09:00:00.000Z"
30
124
  },
31
125
  {
32
- _id: "field_3",
33
- tableId: "custom_table_1",
126
+ _id: "field_loyalty_isactive",
127
+ tableId: "custom_table_loyalty",
34
128
  name: "isActive",
35
129
  type: AttributeType.BOOLEAN,
36
130
  required: false,
37
- defaultValue: true
131
+ defaultValue: true,
132
+ createdAt: "2024-01-03T09:00:00.000Z",
133
+ updatedAt: "2024-01-03T09:00:00.000Z"
134
+ }
135
+ ];
136
+ export const MOCK_CUSTOM_TABLE_DATA = {
137
+ users: [
138
+ {
139
+ _id: "user_data_1",
140
+ fullName: "John Doe",
141
+ email: "john.doe@example.com",
142
+ isActive: true,
143
+ createdAt: "2024-01-10T10:00:00.000Z",
144
+ updatedAt: "2024-01-10T10:00:00.000Z"
145
+ },
146
+ {
147
+ _id: "user_data_2",
148
+ fullName: "Jane Smith",
149
+ email: "jane.smith@example.com",
150
+ isActive: true,
151
+ createdAt: "2024-01-11T11:00:00.000Z",
152
+ updatedAt: "2024-01-11T11:00:00.000Z"
153
+ },
154
+ {
155
+ _id: "user_data_3",
156
+ fullName: "Bob Johnson",
157
+ email: "bob.johnson@example.com",
158
+ isActive: false,
159
+ createdAt: "2024-01-12T09:00:00.000Z",
160
+ updatedAt: "2024-01-15T14:30:00.000Z"
161
+ },
162
+ {
163
+ _id: "user_data_4",
164
+ fullName: "Alice Williams",
165
+ email: "alice.williams@example.com",
166
+ isActive: true,
167
+ createdAt: "2024-01-13T08:00:00.000Z",
168
+ updatedAt: "2024-01-13T08:00:00.000Z"
169
+ },
170
+ {
171
+ _id: "user_data_5",
172
+ fullName: "Charlie Brown",
173
+ email: "charlie.brown@example.com",
174
+ isActive: false,
175
+ createdAt: "2024-01-14T12:00:00.000Z",
176
+ updatedAt: "2024-01-16T16:00:00.000Z"
177
+ }
178
+ ],
179
+ customer_preferences: [
180
+ {
181
+ _id: "pref_data_1",
182
+ fullName: "Giuseppe Verdi",
183
+ email: "giuseppe@example.com",
184
+ isActive: true,
185
+ createdAt: "2024-01-10T14:00:00.000Z",
186
+ updatedAt: "2024-01-10T14:00:00.000Z"
187
+ },
188
+ {
189
+ _id: "pref_data_2",
190
+ fullName: "Sofia Loren",
191
+ email: "sofia@example.com",
192
+ isActive: true,
193
+ createdAt: "2024-01-11T15:00:00.000Z",
194
+ updatedAt: "2024-01-11T15:00:00.000Z"
195
+ },
196
+ {
197
+ _id: "pref_data_3",
198
+ fullName: "Alessandro Volta",
199
+ email: "alessandro@example.com",
200
+ isActive: false,
201
+ createdAt: "2024-01-12T16:00:00.000Z",
202
+ updatedAt: "2024-01-12T16:00:00.000Z"
203
+ }
204
+ ],
205
+ loyalty_points: [
206
+ {
207
+ _id: "loyalty_data_1",
208
+ fullName: "Isabella Rossellini",
209
+ email: "isabella@example.com",
210
+ isActive: true,
211
+ createdAt: "2024-01-10T10:30:00.000Z",
212
+ updatedAt: "2024-01-10T10:30:00.000Z"
213
+ },
214
+ {
215
+ _id: "loyalty_data_2",
216
+ fullName: "Leonardo Da Vinci",
217
+ email: "leonardo@example.com",
218
+ isActive: true,
219
+ createdAt: "2024-01-11T11:30:00.000Z",
220
+ updatedAt: "2024-01-11T11:30:00.000Z"
221
+ }
222
+ ]
223
+ };
224
+ export const MOCK_CUSTOM_EXTENSIONS = [
225
+ {
226
+ _id: "ext_loyalty_program",
227
+ label: "Loyalty Program Extension",
228
+ description: "Add a loyalty points system to your POS",
229
+ category: "Customer Management",
230
+ short_description: "Loyalty points tracking",
231
+ long_description: "A comprehensive loyalty program that allows you to track customer points, offer rewards, and increase customer retention.",
232
+ main_image: "https://example.com/images/loyalty-extension.png",
233
+ backgroundUrl: "https://example.com/images/loyalty-bg.jpg",
234
+ gallery: [
235
+ "https://example.com/images/loyalty-1.png",
236
+ "https://example.com/images/loyalty-2.png"
237
+ ],
238
+ price: "$29.99",
239
+ website: "https://loyalty-extension.example.com",
240
+ isDeleted: false,
241
+ createdAt: "2024-01-01T10:00:00.000Z",
242
+ updatedAt: "2024-01-10T14:30:00.000Z",
243
+ __v: 0
244
+ },
245
+ {
246
+ _id: "ext_inventory_analytics",
247
+ label: "Inventory Analytics",
248
+ description: "Advanced inventory tracking and reporting",
249
+ category: "Analytics",
250
+ short_description: "Real-time inventory insights",
251
+ long_description: "Get detailed insights into your inventory with real-time tracking, low stock alerts, and comprehensive reporting.",
252
+ main_image: "https://example.com/images/inventory-extension.png",
253
+ price: "$49.99",
254
+ isDeleted: false,
255
+ createdAt: "2024-01-05T08:00:00.000Z",
256
+ updatedAt: "2024-01-05T08:00:00.000Z",
257
+ __v: 0
38
258
  },
39
259
  {
40
- _id: "field_4",
41
- tableId: "custom_table_1",
42
- name: "lastUpdated",
43
- type: AttributeType.DATE,
44
- required: false
260
+ _id: "ext_email_marketing",
261
+ label: "Email Marketing Suite",
262
+ description: "Email campaigns and customer engagement",
263
+ category: "Marketing",
264
+ short_description: "Automated email marketing",
265
+ long_description: "Create and manage email campaigns, automate customer communications, and track engagement metrics.",
266
+ main_image: "https://example.com/images/email-extension.png",
267
+ price: "$39.99",
268
+ isDeleted: false,
269
+ createdAt: "2024-01-08T12:00:00.000Z",
270
+ updatedAt: "2024-01-08T12:00:00.000Z",
271
+ __v: 0
45
272
  }
46
273
  ];
package/dist/index.d.ts CHANGED
@@ -51,6 +51,12 @@ export declare const command: {
51
51
  readonly processPartialRefund: import("./actions/process-partial-refund/types").ProcessPartialRefund;
52
52
  readonly getCustomTables: import("./actions/get-custom-tables/types").GetCustomTables;
53
53
  readonly getCustomTableFields: import("./actions/get-custom-table-fields/types").GetCustomTableFields;
54
+ readonly getCustomTableData: import("./actions/get-custom-table-data/types").GetCustomTableData;
55
+ readonly upsertCustomTableData: import("./actions/upsert-custom-table-data/types").UpsertCustomTableData;
56
+ readonly deleteCustomTableData: import("./actions/delete-custom-table-data/types").DeleteCustomTableData;
57
+ readonly getCustomExtensions: import("./actions/get-custom-extensions/types").GetCustomExtensions;
58
+ readonly getCurrentCompanyCustomExtensions: import("./actions/get-current-company-custom-extensions/types").GetCurrentCompanyCustomExtensions;
59
+ readonly getCustomExtensionCustomTables: import("./actions/get-custom-extension-custom-tables/types").GetCustomExtensionCustomTables;
54
60
  };
55
61
  export type { ExampleFunction, ExampleFunctionParams, ExampleFunctionResponse } from "./actions/example-function/types";
56
62
  export type { GetProducts, GetProductsParams, GetProductsResponse } from "./actions/get-products/types";
@@ -130,3 +136,6 @@ export type { GetCustomTableFields, GetCustomTableFieldsParams, GetCustomTableFi
130
136
  export type { GetCustomTableData, GetCustomTableDataParams, GetCustomTableDataResponse } from "./actions/get-custom-table-data/types";
131
137
  export type { UpsertCustomTableData, UpsertCustomTableDataParams, UpsertCustomTableDataResponse } from "./actions/upsert-custom-table-data/types";
132
138
  export type { DeleteCustomTableData, DeleteCustomTableDataParams, DeleteCustomTableDataResponse } from "./actions/delete-custom-table-data/types";
139
+ export type { GetCustomExtensions, GetCustomExtensionsResponse } from "./actions/get-custom-extensions/types";
140
+ export type { GetCustomExtensionCustomTables, GetCustomExtensionCustomTablesParams, GetCustomExtensionCustomTablesResponse } from "./actions/get-custom-extension-custom-tables/types";
141
+ export type { GetCurrentCompanyCustomExtensions, GetCurrentCompanyCustomExtensionsParams, GetCurrentCompanyCustomExtensionsResponse } from "./actions/get-current-company-custom-extensions/types";
package/dist/index.js CHANGED
@@ -58,6 +58,13 @@ import { processPartialRefund } from "./actions/process-partial-refund/action";
58
58
  // Custom Tables Actions
59
59
  import { getCustomTables } from "./actions/get-custom-tables/action";
60
60
  import { getCustomTableFields } from "./actions/get-custom-table-fields/action";
61
+ import { getCustomTableData } from "./actions/get-custom-table-data/action";
62
+ import { upsertCustomTableData } from "./actions/upsert-custom-table-data/action";
63
+ import { deleteCustomTableData } from "./actions/delete-custom-table-data/action";
64
+ // Custom Extensions Actions
65
+ import { getCustomExtensions } from "./actions/get-custom-extensions/action";
66
+ import { getCurrentCompanyCustomExtensions } from "./actions/get-current-company-custom-extensions/action";
67
+ import { getCustomExtensionCustomTables } from "./actions/get-custom-extension-custom-tables/action";
61
68
  // Export actions as command object
62
69
  export const command = {
63
70
  exampleFunction,
@@ -118,7 +125,14 @@ export const command = {
118
125
  processPartialRefund,
119
126
  // Custom Tables Actions
120
127
  getCustomTables,
121
- getCustomTableFields
128
+ getCustomTableFields,
129
+ getCustomTableData,
130
+ upsertCustomTableData,
131
+ deleteCustomTableData,
132
+ // Custom Extensions Actions
133
+ getCustomExtensions,
134
+ getCurrentCompanyCustomExtensions,
135
+ getCustomExtensionCustomTables,
122
136
  };
123
137
  // Export Common Types
124
138
  export * from "./CommonTypes";
@@ -48,6 +48,14 @@ import { mockVendaraPayment } from "../../actions/vendara-payment/mock";
48
48
  import { mockGetFinalContext } from "../../actions/get-final-context/mock";
49
49
  import { mockPrint } from "../../actions/print/mock";
50
50
  import { mockSetActiveOrder } from "../../actions/set-active-order/mock";
51
+ import { mockGetCustomTables } from "../../actions/get-custom-tables/mock";
52
+ import { mockGetCustomTableData } from "../../actions/get-custom-table-data/mock";
53
+ import { mockGetCustomTableFields } from "../../actions/get-custom-table-fields/mock";
54
+ import { mockUpsertCustomTableData } from "../../actions/upsert-custom-table-data/mock";
55
+ import { mockDeleteCustomTableData } from "../../actions/delete-custom-table-data/mock";
56
+ import { mockGetCustomExtensions } from "../../actions/get-custom-extensions/mock";
57
+ import { mockGetCurrentCompanyCustomExtensions } from "../../actions/get-current-company-custom-extensions/mock";
58
+ import { mockGetCustomExtensionCustomTables } from "../../actions/get-custom-extension-custom-tables/mock";
51
59
  export const RENDER_MOCKS = {
52
60
  addCartDiscount: mockAddCartDiscount,
53
61
  addCartFee: mockAddCartFee,
@@ -98,5 +106,13 @@ export const RENDER_MOCKS = {
98
106
  vendaraPayment: mockVendaraPayment,
99
107
  getFinalContext: mockGetFinalContext,
100
108
  print: mockPrint,
101
- setActiveOrder: mockSetActiveOrder
109
+ setActiveOrder: mockSetActiveOrder,
110
+ getCustomTables: mockGetCustomTables,
111
+ getCustomTableData: mockGetCustomTableData,
112
+ getCustomTableFields: mockGetCustomTableFields,
113
+ upsertCustomTableData: mockUpsertCustomTableData,
114
+ deleteCustomTableData: mockDeleteCustomTableData,
115
+ getCustomExtensions: mockGetCustomExtensions,
116
+ getCurrentCompanyCustomExtensions: mockGetCurrentCompanyCustomExtensions,
117
+ getCustomExtensionCustomTables: mockGetCustomExtensionCustomTables,
102
118
  };
@@ -1,4 +1,4 @@
1
- import type { ExampleFunction, GetProducts, AddCustomSale, GetCustomers, AssignCustomer, AddCustomer, GetCategories, GetOrders, GetRefunds, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, InitiateRefund, CashPayment, TapToPayPayment, TerminalPayment, VendaraPayment, AddCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, TriggerWebhook, TriggerZapierWebhook, SetRefundStockAction, SelectAllRefundItems, ResetRefundDetails, CalculateRefundTotal, GetRemainingRefundableQuantities, ProcessPartialRefund, GetCurrentCart, Print, SetActiveOrder } from "../../index";
1
+ import type { ExampleFunction, GetProducts, AddCustomSale, GetCustomers, AssignCustomer, AddCustomer, GetCategories, GetOrders, GetRefunds, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, InitiateRefund, CashPayment, TapToPayPayment, TerminalPayment, VendaraPayment, AddCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, TriggerWebhook, TriggerZapierWebhook, SetRefundStockAction, SelectAllRefundItems, ResetRefundDetails, CalculateRefundTotal, GetRemainingRefundableQuantities, ProcessPartialRefund, GetCurrentCart, Print, SetActiveOrder, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCurrentCompanyCustomExtensions, GetCustomExtensionCustomTables, GetCustomTableFields } from "../../index";
2
2
  export interface RenderProviderActions {
3
3
  exampleFunction: ExampleFunction;
4
4
  getProducts: GetProducts;
@@ -50,4 +50,12 @@ export interface RenderProviderActions {
50
50
  getCurrentCart: GetCurrentCart;
51
51
  print: Print;
52
52
  setActiveOrder: SetActiveOrder;
53
+ getCustomTables: GetCustomTables;
54
+ getCustomTableData: GetCustomTableData;
55
+ upsertCustomTableData: UpsertCustomTableData;
56
+ deleteCustomTableData: DeleteCustomTableData;
57
+ getCustomExtensions: GetCustomExtensions;
58
+ getCurrentCompanyCustomExtensions: GetCurrentCompanyCustomExtensions;
59
+ getCustomExtensionCustomTables: GetCustomExtensionCustomTables;
60
+ getCustomTableFields: GetCustomTableFields;
53
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@final-commerce/command-frame",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "description": "Commands Frame library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",