@final-commerce/command-frame 0.1.22 → 0.1.24

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 (33) hide show
  1. package/dist/actions/get-current-company-custom-extensions/action.d.ts +6 -0
  2. package/dist/actions/get-current-company-custom-extensions/action.js +8 -0
  3. package/dist/actions/get-current-company-custom-extensions/mock.d.ts +2 -0
  4. package/dist/actions/get-current-company-custom-extensions/mock.js +44 -0
  5. package/dist/actions/get-current-company-custom-extensions/types.d.ts +9 -0
  6. package/dist/actions/get-current-company-custom-extensions/types.js +1 -0
  7. package/dist/actions/get-custom-extension-custom-tables/mock.js +29 -1
  8. package/dist/actions/get-custom-extensions/mock.js +37 -1
  9. package/dist/actions/get-custom-table-data/mock.js +27 -1
  10. package/dist/actions/get-custom-table-fields/mock.d.ts +2 -0
  11. package/dist/actions/get-custom-table-fields/mock.js +39 -0
  12. package/dist/actions/get-custom-tables/mock.js +36 -1
  13. package/dist/actions/upsert-custom-table-data/mock.js +11 -2
  14. package/dist/demo/mocks/custom-tables.d.ts +11 -0
  15. package/dist/demo/mocks/custom-tables.js +246 -29
  16. package/dist/index.d.ts +4 -0
  17. package/dist/index.js +4 -1
  18. package/dist/projects/render/mocks.js +4 -0
  19. package/dist/projects/render/types.d.ts +3 -1
  20. package/dist/pubsub/topics/index.d.ts +1 -0
  21. package/dist/pubsub/topics/index.js +1 -0
  22. package/dist/pubsub/topics/print/index.d.ts +7 -0
  23. package/dist/pubsub/topics/print/index.js +28 -0
  24. package/dist/pubsub/topics/print/print-completed/types.d.ts +13 -0
  25. package/dist/pubsub/topics/print/print-completed/types.js +1 -0
  26. package/dist/pubsub/topics/print/print-error/types.d.ts +14 -0
  27. package/dist/pubsub/topics/print/print-error/types.js +1 -0
  28. package/dist/pubsub/topics/print/print-started/types.d.ts +23 -0
  29. package/dist/pubsub/topics/print/print-started/types.js +1 -0
  30. package/dist/pubsub/topics/print/types.d.ts +12 -0
  31. package/dist/pubsub/topics/print/types.js +8 -0
  32. package/dist/pubsub/topics/types.d.ts +2 -0
  33. package/package.json +1 -1
@@ -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>;
@@ -1,8 +1,36 @@
1
1
  export const mockGetCustomExtensionCustomTables = async (params) => {
2
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
+ ];
3
31
  return {
4
32
  success: true,
5
- customTables: [],
33
+ customTables: mockTables,
6
34
  timestamp: new Date().toISOString()
7
35
  };
8
36
  };
@@ -1,8 +1,44 @@
1
1
  export const mockGetCustomExtensions = async () => {
2
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
+ ];
3
39
  return {
4
40
  success: true,
5
- customExtensions: [],
41
+ customExtensions: mockExtensions,
6
42
  timestamp: new Date().toISOString()
7
43
  };
8
44
  };
@@ -1,8 +1,34 @@
1
1
  export const mockGetCustomTableData = async (params) => {
2
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
+ ];
3
29
  return {
4
30
  success: true,
5
- data: [],
31
+ data: mockData,
6
32
  timestamp: new Date().toISOString()
7
33
  };
8
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
+ };
@@ -1,8 +1,43 @@
1
1
  export const mockGetCustomTables = async () => {
2
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
+ ];
3
38
  return {
4
39
  success: true,
5
- customTables: [],
40
+ customTables: mockTables,
6
41
  timestamp: new Date().toISOString()
7
42
  };
8
43
  };
@@ -1,8 +1,17 @@
1
1
  export const mockUpsertCustomTableData = async (params) => {
2
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
+ };
3
12
  return {
4
13
  success: true,
5
- data: params?.data,
6
- timestamp: new Date().toISOString()
14
+ data: resultData,
15
+ timestamp: now
7
16
  };
8
17
  };
@@ -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,56 +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
  ],
13
- createdAt: new Date().toISOString(),
14
- updatedAt: new Date().toISOString()
43
+ createdAt: "2024-01-03T09:00:00.000Z",
44
+ updatedAt: "2024-01-03T09:00:00.000Z"
15
45
  }
16
46
  ];
17
47
  export const MOCK_CUSTOM_TABLE_FIELDS = [
48
+ // Fields for 'users' table
18
49
  {
19
- _id: "field_1",
20
- tableId: "custom_table_1",
21
- name: "customerId",
50
+ _id: "field_users_fullname",
51
+ tableId: "custom_table_users",
52
+ name: "fullName",
22
53
  type: AttributeType.STRING,
23
54
  required: true,
24
- createdAt: new Date().toISOString(),
25
- updatedAt: new Date().toISOString()
55
+ createdAt: "2024-01-01T10:00:00.000Z",
56
+ updatedAt: "2024-01-01T10:00:00.000Z"
26
57
  },
27
58
  {
28
- _id: "field_2",
29
- tableId: "custom_table_1",
30
- name: "points",
31
- type: AttributeType.NUMBER,
59
+ _id: "field_users_email",
60
+ tableId: "custom_table_users",
61
+ name: "email",
62
+ type: AttributeType.STRING,
32
63
  required: true,
33
- defaultValue: 0,
34
- createdAt: new Date().toISOString(),
35
- updatedAt: new Date().toISOString()
64
+ createdAt: "2024-01-01T10:00:00.000Z",
65
+ updatedAt: "2024-01-01T10:00:00.000Z"
36
66
  },
37
67
  {
38
- _id: "field_3",
39
- tableId: "custom_table_1",
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",
40
99
  name: "isActive",
41
100
  type: AttributeType.BOOLEAN,
42
101
  required: false,
43
102
  defaultValue: true,
44
- createdAt: new Date().toISOString(),
45
- updatedAt: new Date().toISOString()
103
+ createdAt: "2024-01-02T08:00:00.000Z",
104
+ updatedAt: "2024-01-02T08:00:00.000Z"
105
+ },
106
+ // Fields for 'loyalty_points' table
107
+ {
108
+ _id: "field_loyalty_fullname",
109
+ tableId: "custom_table_loyalty",
110
+ name: "fullName",
111
+ type: AttributeType.STRING,
112
+ required: true,
113
+ createdAt: "2024-01-03T09:00:00.000Z",
114
+ updatedAt: "2024-01-03T09:00:00.000Z"
115
+ },
116
+ {
117
+ _id: "field_loyalty_email",
118
+ tableId: "custom_table_loyalty",
119
+ name: "email",
120
+ type: AttributeType.STRING,
121
+ required: true,
122
+ createdAt: "2024-01-03T09:00:00.000Z",
123
+ updatedAt: "2024-01-03T09:00:00.000Z"
46
124
  },
47
125
  {
48
- _id: "field_4",
49
- tableId: "custom_table_1",
50
- name: "lastUpdated",
51
- type: AttributeType.DATE,
126
+ _id: "field_loyalty_isactive",
127
+ tableId: "custom_table_loyalty",
128
+ name: "isActive",
129
+ type: AttributeType.BOOLEAN,
52
130
  required: false,
53
- createdAt: new Date().toISOString(),
54
- updatedAt: new Date().toISOString()
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
258
+ },
259
+ {
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
55
272
  }
56
273
  ];
package/dist/index.d.ts CHANGED
@@ -55,6 +55,7 @@ export declare const command: {
55
55
  readonly upsertCustomTableData: import("./actions/upsert-custom-table-data/types").UpsertCustomTableData;
56
56
  readonly deleteCustomTableData: import("./actions/delete-custom-table-data/types").DeleteCustomTableData;
57
57
  readonly getCustomExtensions: import("./actions/get-custom-extensions/types").GetCustomExtensions;
58
+ readonly getCurrentCompanyCustomExtensions: import("./actions/get-current-company-custom-extensions/types").GetCurrentCompanyCustomExtensions;
58
59
  readonly getCustomExtensionCustomTables: import("./actions/get-custom-extension-custom-tables/types").GetCustomExtensionCustomTables;
59
60
  };
60
61
  export type { ExampleFunction, ExampleFunctionParams, ExampleFunctionResponse } from "./actions/example-function/types";
@@ -123,6 +124,7 @@ export { productsTopic } from "./pubsub/topics/products";
123
124
  export { cartTopic } from "./pubsub/topics/cart";
124
125
  export { paymentsTopic } from "./pubsub/topics/payments";
125
126
  export { customTablesTopic } from "./pubsub/topics/custom-tables";
127
+ export { printTopic } from "./pubsub/topics/print";
126
128
  export type { CustomerCreatedPayload, CustomerUpdatedPayload, CustomerNoteAddedPayload, CustomerNoteDeletedPayload, CustomerAssignedPayload, CustomerUnassignedPayload, CustomerCreatedEvent, CustomerUpdatedEvent, CustomerNoteAddedEvent, CustomerNoteDeletedEvent, CustomerAssignedEvent, CustomerUnassignedEvent, CustomersEventType, CustomersEventPayload } from "./pubsub/topics/customers/types";
127
129
  export type { OrderCreatedPayload, OrderUpdatedPayload, OrderCreatedEvent, OrderUpdatedEvent, OrdersEventType, OrdersEventPayload } from "./pubsub/topics/orders/types";
128
130
  export type { RefundCreatedPayload, RefundUpdatedPayload, RefundCreatedEvent, RefundUpdatedEvent, RefundsEventType, RefundsEventPayload } from "./pubsub/topics/refunds/types";
@@ -130,6 +132,7 @@ export type { ProductCreatedPayload, ProductUpdatedPayload, ProductCreatedEvent,
130
132
  export type { CartCreatedPayload, CartCustomerAssignedPayload, ProductAddedPayload, ProductDeletedPayload, CartDiscountAddedPayload, CartDiscountRemovedPayload, CartFeeAddedPayload, CartFeeRemovedPayload, CartCreatedEvent, CartCustomerAssignedEvent, ProductAddedEvent, ProductDeletedEvent, CartDiscountAddedEvent, CartDiscountRemovedEvent, CartFeeAddedEvent, CartFeeRemovedEvent, CartEventType, CartEventPayload } from "./pubsub/topics/cart/types";
131
133
  export type { PaymentDonePayload, PaymentErrPayload, PaymentDoneEvent, PaymentErrEvent, PaymentsEventType, PaymentsEventPayload } from "./pubsub/topics/payments/types";
132
134
  export type { RowCreatedPayload, RowUpdatedPayload, RowDeletedPayload, RowCreatedEvent, RowUpdatedEvent, RowDeletedEvent, CustomTablesEventType, CustomTablesEventPayload } from "./pubsub/topics/custom-tables/types";
135
+ export type { PrintStartedPayload, PrintCompletedPayload, PrintErrorPayload, PrintStartedEvent, PrintCompletedEvent, PrintErrorEvent, PrintEventType, PrintEventPayload } from "./pubsub/topics/print/types";
133
136
  export type { GetCustomTables, GetCustomTablesResponse } from "./actions/get-custom-tables/types";
134
137
  export type { GetCustomTableFields, GetCustomTableFieldsParams, GetCustomTableFieldsResponse } from "./actions/get-custom-table-fields/types";
135
138
  export type { GetCustomTableData, GetCustomTableDataParams, GetCustomTableDataResponse } from "./actions/get-custom-table-data/types";
@@ -137,3 +140,4 @@ export type { UpsertCustomTableData, UpsertCustomTableDataParams, UpsertCustomTa
137
140
  export type { DeleteCustomTableData, DeleteCustomTableDataParams, DeleteCustomTableDataResponse } from "./actions/delete-custom-table-data/types";
138
141
  export type { GetCustomExtensions, GetCustomExtensionsResponse } from "./actions/get-custom-extensions/types";
139
142
  export type { GetCustomExtensionCustomTables, GetCustomExtensionCustomTablesParams, GetCustomExtensionCustomTablesResponse } from "./actions/get-custom-extension-custom-tables/types";
143
+ export type { GetCurrentCompanyCustomExtensions, GetCurrentCompanyCustomExtensionsParams, GetCurrentCompanyCustomExtensionsResponse } from "./actions/get-current-company-custom-extensions/types";
package/dist/index.js CHANGED
@@ -63,6 +63,7 @@ import { upsertCustomTableData } from "./actions/upsert-custom-table-data/action
63
63
  import { deleteCustomTableData } from "./actions/delete-custom-table-data/action";
64
64
  // Custom Extensions Actions
65
65
  import { getCustomExtensions } from "./actions/get-custom-extensions/action";
66
+ import { getCurrentCompanyCustomExtensions } from "./actions/get-current-company-custom-extensions/action";
66
67
  import { getCustomExtensionCustomTables } from "./actions/get-custom-extension-custom-tables/action";
67
68
  // Export actions as command object
68
69
  export const command = {
@@ -130,7 +131,8 @@ export const command = {
130
131
  deleteCustomTableData,
131
132
  // Custom Extensions Actions
132
133
  getCustomExtensions,
133
- getCustomExtensionCustomTables,
134
+ getCurrentCompanyCustomExtensions,
135
+ getCustomExtensionCustomTables
134
136
  };
135
137
  // Export Common Types
136
138
  export * from "./CommonTypes";
@@ -152,3 +154,4 @@ export { productsTopic } from "./pubsub/topics/products";
152
154
  export { cartTopic } from "./pubsub/topics/cart";
153
155
  export { paymentsTopic } from "./pubsub/topics/payments";
154
156
  export { customTablesTopic } from "./pubsub/topics/custom-tables";
157
+ export { printTopic } from "./pubsub/topics/print";
@@ -50,9 +50,11 @@ import { mockPrint } from "../../actions/print/mock";
50
50
  import { mockSetActiveOrder } from "../../actions/set-active-order/mock";
51
51
  import { mockGetCustomTables } from "../../actions/get-custom-tables/mock";
52
52
  import { mockGetCustomTableData } from "../../actions/get-custom-table-data/mock";
53
+ import { mockGetCustomTableFields } from "../../actions/get-custom-table-fields/mock";
53
54
  import { mockUpsertCustomTableData } from "../../actions/upsert-custom-table-data/mock";
54
55
  import { mockDeleteCustomTableData } from "../../actions/delete-custom-table-data/mock";
55
56
  import { mockGetCustomExtensions } from "../../actions/get-custom-extensions/mock";
57
+ import { mockGetCurrentCompanyCustomExtensions } from "../../actions/get-current-company-custom-extensions/mock";
56
58
  import { mockGetCustomExtensionCustomTables } from "../../actions/get-custom-extension-custom-tables/mock";
57
59
  export const RENDER_MOCKS = {
58
60
  addCartDiscount: mockAddCartDiscount,
@@ -107,8 +109,10 @@ export const RENDER_MOCKS = {
107
109
  setActiveOrder: mockSetActiveOrder,
108
110
  getCustomTables: mockGetCustomTables,
109
111
  getCustomTableData: mockGetCustomTableData,
112
+ getCustomTableFields: mockGetCustomTableFields,
110
113
  upsertCustomTableData: mockUpsertCustomTableData,
111
114
  deleteCustomTableData: mockDeleteCustomTableData,
112
115
  getCustomExtensions: mockGetCustomExtensions,
116
+ getCurrentCompanyCustomExtensions: mockGetCurrentCompanyCustomExtensions,
113
117
  getCustomExtensionCustomTables: mockGetCustomExtensionCustomTables,
114
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, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCustomExtensionCustomTables } 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;
@@ -55,5 +55,7 @@ export interface RenderProviderActions {
55
55
  upsertCustomTableData: UpsertCustomTableData;
56
56
  deleteCustomTableData: DeleteCustomTableData;
57
57
  getCustomExtensions: GetCustomExtensions;
58
+ getCurrentCompanyCustomExtensions: GetCurrentCompanyCustomExtensions;
58
59
  getCustomExtensionCustomTables: GetCustomExtensionCustomTables;
60
+ getCustomTableFields: GetCustomTableFields;
59
61
  }
@@ -9,3 +9,4 @@ export * from "./products";
9
9
  export * from "./cart";
10
10
  export * from "./payments";
11
11
  export * from "./custom-tables";
12
+ export * from "./print";
@@ -9,3 +9,4 @@ export * from "./products";
9
9
  export * from "./cart";
10
10
  export * from "./payments";
11
11
  export * from "./custom-tables";
12
+ export * from "./print";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Print Topic Definition
3
+ * Defines the print topic and its available event types
4
+ */
5
+ import type { TopicDefinition } from "../../types";
6
+ export declare const printTopic: TopicDefinition;
7
+ export * from "./types";
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Print Topic Definition
3
+ * Defines the print topic and its available event types
4
+ */
5
+ export const printTopic = {
6
+ id: "print",
7
+ name: "Print",
8
+ description: "Topic for print-related events",
9
+ eventTypes: [
10
+ {
11
+ id: "print-started",
12
+ name: "Print Started",
13
+ description: "Published when a print action is initiated"
14
+ },
15
+ {
16
+ id: "print-completed",
17
+ name: "Print Completed",
18
+ description: "Published when a print action completes successfully"
19
+ },
20
+ {
21
+ id: "print-error",
22
+ name: "Print Error",
23
+ description: "Published when a print action encounters an error"
24
+ }
25
+ ]
26
+ };
27
+ // Re-export types
28
+ export * from "./types";
@@ -0,0 +1,13 @@
1
+ import type { TopicEvent } from "../../../types";
2
+ /**
3
+ * Payload for print-completed event
4
+ */
5
+ export interface PrintCompletedPayload {
6
+ type: "image" | "html" | "selector" | "receipt";
7
+ orderId?: string;
8
+ globalBlockId?: string;
9
+ }
10
+ /**
11
+ * Typed event for print-completed
12
+ */
13
+ export type PrintCompletedEvent = TopicEvent<PrintCompletedPayload>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { TopicEvent } from "../../../types";
2
+ /**
3
+ * Payload for print-error event
4
+ */
5
+ export interface PrintErrorPayload {
6
+ type: "image" | "html" | "selector" | "receipt";
7
+ error: string;
8
+ orderId?: string;
9
+ globalBlockId?: string;
10
+ }
11
+ /**
12
+ * Typed event for print-error
13
+ */
14
+ export type PrintErrorEvent = TopicEvent<PrintErrorPayload>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import type { TopicEvent } from "../../../types";
2
+ /**
3
+ * Payload for print-started event
4
+ */
5
+ export interface PrintStartedPayload {
6
+ type: "image" | "html" | "selector" | "receipt";
7
+ options?: {
8
+ margins?: {
9
+ top?: number;
10
+ right?: number;
11
+ bottom?: number;
12
+ left?: number;
13
+ };
14
+ paperSize?: string;
15
+ width?: string;
16
+ };
17
+ orderId?: string;
18
+ globalBlockId?: string;
19
+ }
20
+ /**
21
+ * Typed event for print-started
22
+ */
23
+ export type PrintStartedEvent = TopicEvent<PrintStartedPayload>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Print Topic Types
3
+ * Aggregated types for all print-related events
4
+ */
5
+ export * from "./print-started/types";
6
+ export * from "./print-completed/types";
7
+ export * from "./print-error/types";
8
+ import type { PrintStartedPayload } from "./print-started/types";
9
+ import type { PrintCompletedPayload } from "./print-completed/types";
10
+ import type { PrintErrorPayload } from "./print-error/types";
11
+ export type PrintEventPayload = PrintStartedPayload | PrintCompletedPayload | PrintErrorPayload;
12
+ export type PrintEventType = "print-started" | "print-completed" | "print-error";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Print Topic Types
3
+ * Aggregated types for all print-related events
4
+ */
5
+ // Re-export all event types
6
+ export * from "./print-started/types";
7
+ export * from "./print-completed/types";
8
+ export * from "./print-error/types";
@@ -5,6 +5,7 @@ import { ProductsEventType, ProductsEventPayload } from "./products/types";
5
5
  import { CartEventType, CartEventPayload } from "./cart/types";
6
6
  import { PaymentsEventType, PaymentsEventPayload } from "./payments/types";
7
7
  import { CustomTablesEventPayload, CustomTablesEventType } from "./custom-tables/types";
8
+ import { PrintEventType, PrintEventPayload } from "./print/types";
8
9
  export interface TopicEventPayloadMap {
9
10
  customers: Record<CustomersEventType, CustomersEventPayload>;
10
11
  orders: Record<OrdersEventType, OrdersEventPayload>;
@@ -13,4 +14,5 @@ export interface TopicEventPayloadMap {
13
14
  cart: Record<CartEventType, CartEventPayload>;
14
15
  payments: Record<PaymentsEventType, PaymentsEventPayload>;
15
16
  customTables: Record<CustomTablesEventType, CustomTablesEventPayload>;
17
+ print: Record<PrintEventType, PrintEventPayload>;
16
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@final-commerce/command-frame",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "description": "Commands Frame library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",