@final-commerce/command-frame 0.1.22 → 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.
- package/dist/actions/get-current-company-custom-extensions/action.d.ts +6 -0
- package/dist/actions/get-current-company-custom-extensions/action.js +8 -0
- package/dist/actions/get-current-company-custom-extensions/mock.d.ts +2 -0
- package/dist/actions/get-current-company-custom-extensions/mock.js +44 -0
- package/dist/actions/get-current-company-custom-extensions/types.d.ts +9 -0
- package/dist/actions/get-current-company-custom-extensions/types.js +1 -0
- package/dist/actions/get-custom-extension-custom-tables/mock.js +29 -1
- package/dist/actions/get-custom-extensions/mock.js +37 -1
- package/dist/actions/get-custom-table-data/mock.js +27 -1
- package/dist/actions/get-custom-table-fields/mock.d.ts +2 -0
- package/dist/actions/get-custom-table-fields/mock.js +39 -0
- package/dist/actions/get-custom-tables/mock.js +36 -1
- package/dist/actions/upsert-custom-table-data/mock.js +11 -2
- package/dist/demo/mocks/custom-tables.d.ts +11 -0
- package/dist/demo/mocks/custom-tables.js +246 -29
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/projects/render/mocks.js +4 -0
- package/dist/projects/render/types.d.ts +3 -1
- package/package.json +1 -1
|
@@ -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,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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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,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:
|
|
6
|
-
timestamp:
|
|
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: "
|
|
5
|
-
name: "
|
|
6
|
-
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: "
|
|
10
|
-
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:
|
|
14
|
-
updatedAt:
|
|
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: "
|
|
20
|
-
tableId: "
|
|
21
|
-
name: "
|
|
50
|
+
_id: "field_users_fullname",
|
|
51
|
+
tableId: "custom_table_users",
|
|
52
|
+
name: "fullName",
|
|
22
53
|
type: AttributeType.STRING,
|
|
23
54
|
required: true,
|
|
24
|
-
createdAt:
|
|
25
|
-
updatedAt:
|
|
55
|
+
createdAt: "2024-01-01T10:00:00.000Z",
|
|
56
|
+
updatedAt: "2024-01-01T10:00:00.000Z"
|
|
26
57
|
},
|
|
27
58
|
{
|
|
28
|
-
_id: "
|
|
29
|
-
tableId: "
|
|
30
|
-
name: "
|
|
31
|
-
type: AttributeType.
|
|
59
|
+
_id: "field_users_email",
|
|
60
|
+
tableId: "custom_table_users",
|
|
61
|
+
name: "email",
|
|
62
|
+
type: AttributeType.STRING,
|
|
32
63
|
required: true,
|
|
33
|
-
|
|
34
|
-
|
|
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: "
|
|
39
|
-
tableId: "
|
|
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:
|
|
45
|
-
updatedAt:
|
|
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: "
|
|
49
|
-
tableId: "
|
|
50
|
-
name: "
|
|
51
|
-
type: AttributeType.
|
|
126
|
+
_id: "field_loyalty_isactive",
|
|
127
|
+
tableId: "custom_table_loyalty",
|
|
128
|
+
name: "isActive",
|
|
129
|
+
type: AttributeType.BOOLEAN,
|
|
52
130
|
required: false,
|
|
53
|
-
|
|
54
|
-
|
|
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";
|
|
@@ -137,3 +138,4 @@ export type { UpsertCustomTableData, UpsertCustomTableDataParams, UpsertCustomTa
|
|
|
137
138
|
export type { DeleteCustomTableData, DeleteCustomTableDataParams, DeleteCustomTableDataResponse } from "./actions/delete-custom-table-data/types";
|
|
138
139
|
export type { GetCustomExtensions, GetCustomExtensionsResponse } from "./actions/get-custom-extensions/types";
|
|
139
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
|
@@ -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,6 +131,7 @@ export const command = {
|
|
|
130
131
|
deleteCustomTableData,
|
|
131
132
|
// Custom Extensions Actions
|
|
132
133
|
getCustomExtensions,
|
|
134
|
+
getCurrentCompanyCustomExtensions,
|
|
133
135
|
getCustomExtensionCustomTables,
|
|
134
136
|
};
|
|
135
137
|
// Export Common Types
|
|
@@ -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
|
}
|