@carthooks/arcubase-cli 0.1.10 → 0.1.13
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/bundle/arcubase-admin.mjs +1365 -375
- package/bundle/arcubase.mjs +1365 -375
- package/dist/generated/command_registry.generated.d.ts +36 -35
- package/dist/generated/command_registry.generated.d.ts.map +1 -1
- package/dist/generated/command_registry.generated.js +37 -36
- package/dist/generated/type_index.generated.d.ts +23 -23
- package/dist/generated/type_index.generated.js +23 -23
- package/dist/runtime/entity_save_schema.d.ts.map +1 -1
- package/dist/runtime/entity_save_schema.js +30 -0
- package/dist/runtime/env.d.ts +2 -1
- package/dist/runtime/env.d.ts.map +1 -1
- package/dist/runtime/env.js +10 -1
- package/dist/runtime/errors.d.ts +3 -0
- package/dist/runtime/errors.d.ts.map +1 -1
- package/dist/runtime/execute.d.ts +4 -2
- package/dist/runtime/execute.d.ts.map +1 -1
- package/dist/runtime/execute.js +1046 -134
- package/dist/runtime/paths.d.ts +1 -1
- package/dist/runtime/paths.d.ts.map +1 -1
- package/dist/runtime/paths.js +9 -2
- package/dist/runtime/upload.d.ts +1 -11
- package/dist/runtime/upload.d.ts.map +1 -1
- package/dist/runtime/upload.js +19 -133
- package/dist/runtime/zod_registry.d.ts +5 -3
- package/dist/runtime/zod_registry.d.ts.map +1 -1
- package/dist/runtime/zod_registry.js +108 -48
- package/dist/tests/bootstrap.test.js +12 -0
- package/dist/tests/command_registry.test.js +8 -0
- package/dist/tests/docs_readability.test.d.ts +2 -0
- package/dist/tests/docs_readability.test.d.ts.map +1 -0
- package/dist/tests/docs_readability.test.js +87 -0
- package/dist/tests/entity_save_schema.test.js +22 -0
- package/dist/tests/execute_validation.test.js +443 -44
- package/dist/tests/help.test.js +47 -8
- package/dist/tests/upload.test.js +30 -77
- package/package.json +1 -1
- package/sdk-dist/docs/runtime-reference/README.md +43 -29
- package/sdk-dist/docs/runtime-reference/access-rule.md +128 -0
- package/sdk-dist/docs/runtime-reference/condition.md +182 -0
- package/sdk-dist/docs/runtime-reference/entity-schema/README.md +6 -5
- package/sdk-dist/docs/runtime-reference/entity-schema/checkbox.md +1 -1
- package/sdk-dist/docs/runtime-reference/entity-schema/file.md +2 -2
- package/sdk-dist/docs/runtime-reference/entity-schema/image.md +2 -2
- package/sdk-dist/docs/runtime-reference/entity-schema/linkto.md +3 -3
- package/sdk-dist/docs/runtime-reference/entity-schema/number.md +1 -1
- package/sdk-dist/docs/runtime-reference/entity-schema/query.md +3 -3
- package/sdk-dist/docs/runtime-reference/entity-schema/relation.md +3 -3
- package/sdk-dist/docs/runtime-reference/entity-schema/relationfield.md +3 -3
- package/sdk-dist/docs/runtime-reference/entity-schema/status.md +1 -1
- package/sdk-dist/docs/runtime-reference/entity-schema/text.md +1 -1
- package/sdk-dist/docs/runtime-reference/entity-schema.md +28 -21
- package/sdk-dist/docs/runtime-reference/examples/README.md +1 -1
- package/sdk-dist/docs/runtime-reference/examples/crm-01/README.md +30 -11
- package/sdk-dist/docs/runtime-reference/examples/crm-01/contact.create-entity.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/crm-01/contact.schema.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/crm-01/create-app.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/crm-01/customer.create-entity.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/crm-01/customer.schema.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/crm-01/follow-up.create-entity.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/crm-01/follow-up.schema.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/crm-01/lead.bulk-update.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/crm-01/lead.create-entity.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/crm-01/lead.query.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/crm-01/lead.row.insert.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/crm-01/lead.schema.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/crm-01/lead.selection.condition.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/oms-01/README.md +26 -26
- package/sdk-dist/docs/runtime-reference/examples/oms-01/sales-order.row.insert.json +1 -1
- package/sdk-dist/docs/runtime-reference/examples/wms-01/README.md +26 -10
- package/sdk-dist/docs/runtime-reference/examples/wms-01/create-app.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/wms-01/goods-receipt.create-entity.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/wms-01/goods-receipt.schema.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/wms-01/inventory-snapshot.bulk-update.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/wms-01/inventory-snapshot.create-entity.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/wms-01/inventory-snapshot.query.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/wms-01/inventory-snapshot.schema.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/wms-01/inventory-snapshot.selection.condition.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/wms-01/item-master.create-entity.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/wms-01/item-master.schema.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/wms-01/stock-issue.create-entity.json +1 -0
- package/sdk-dist/docs/runtime-reference/examples/wms-01/stock-issue.schema.json +1 -0
- package/sdk-dist/docs/runtime-reference/row-crud.md +48 -8
- package/sdk-dist/docs/runtime-reference/search-and-bulk-actions.md +31 -95
- package/sdk-dist/docs/runtime-reference/selection.md +128 -0
- package/sdk-dist/docs/runtime-reference/table-lifecycle.md +113 -30
- package/sdk-dist/docs/runtime-reference/uploads.md +30 -59
- package/sdk-dist/docs/runtime-reference/workflow/README.md +129 -13
- package/sdk-dist/generated/command_registry.generated.ts +37 -36
- package/sdk-dist/generated/type_index.generated.ts +23 -23
- package/src/generated/command_registry.generated.ts +37 -36
- package/src/generated/type_index.generated.ts +23 -23
- package/src/runtime/entity_save_schema.ts +30 -0
- package/src/runtime/env.ts +14 -2
- package/src/runtime/errors.ts +3 -0
- package/src/runtime/execute.ts +1272 -134
- package/src/runtime/paths.ts +11 -2
- package/src/runtime/upload.ts +19 -178
- package/src/runtime/zod_registry.ts +113 -48
- package/src/tests/bootstrap.test.ts +16 -0
- package/src/tests/command_registry.test.ts +9 -0
- package/src/tests/docs_readability.test.ts +96 -0
- package/src/tests/entity_save_schema.test.ts +22 -0
- package/src/tests/execute_validation.test.ts +577 -47
- package/src/tests/help.test.ts +51 -8
- package/src/tests/upload.test.ts +34 -91
|
@@ -1,94 +1,94 @@
|
|
|
1
1
|
export declare const typeIndex: {
|
|
2
2
|
readonly AppCreateByTenantsReqVO: {
|
|
3
|
-
readonly file: "
|
|
3
|
+
readonly file: "types/app.ts";
|
|
4
4
|
readonly dependencies: readonly [];
|
|
5
5
|
};
|
|
6
6
|
readonly AppCreateEntityReqVO: {
|
|
7
|
-
readonly file: "
|
|
7
|
+
readonly file: "types/app.ts";
|
|
8
8
|
readonly dependencies: readonly [];
|
|
9
9
|
};
|
|
10
10
|
readonly AppIngressCreateReqVO: {
|
|
11
|
-
readonly file: "
|
|
11
|
+
readonly file: "types/ingress.ts";
|
|
12
12
|
readonly dependencies: readonly [];
|
|
13
13
|
};
|
|
14
14
|
readonly AppIngressUpdateReqVO: {
|
|
15
|
-
readonly file: "
|
|
15
|
+
readonly file: "types/ingress.ts";
|
|
16
16
|
readonly dependencies: readonly [];
|
|
17
17
|
};
|
|
18
18
|
readonly AppUpdateAppReqVO: {
|
|
19
|
-
readonly file: "
|
|
19
|
+
readonly file: "types/app.ts";
|
|
20
20
|
readonly dependencies: readonly [];
|
|
21
21
|
};
|
|
22
22
|
readonly EntityBulkUpdateReqVO: {
|
|
23
|
-
readonly file: "
|
|
23
|
+
readonly file: "types/user-action.ts";
|
|
24
24
|
readonly dependencies: readonly [];
|
|
25
25
|
};
|
|
26
26
|
readonly EntityDoActionReqVO: {
|
|
27
|
-
readonly file: "
|
|
27
|
+
readonly file: "types/user-action.ts";
|
|
28
28
|
readonly dependencies: readonly [];
|
|
29
29
|
};
|
|
30
30
|
readonly EntityQueryRelationReqVO: {
|
|
31
|
-
readonly file: "
|
|
31
|
+
readonly file: "types/user-action.ts";
|
|
32
32
|
readonly dependencies: readonly [];
|
|
33
33
|
};
|
|
34
34
|
readonly EntityQueryReqVO: {
|
|
35
|
-
readonly file: "
|
|
35
|
+
readonly file: "types/user-action.ts";
|
|
36
36
|
readonly dependencies: readonly [];
|
|
37
37
|
};
|
|
38
38
|
readonly EntityResolveWorkflowReqVO: {
|
|
39
|
-
readonly file: "
|
|
39
|
+
readonly file: "types/user-action.ts";
|
|
40
40
|
readonly dependencies: readonly [];
|
|
41
41
|
};
|
|
42
42
|
readonly EntitySaveNameReqVO: {
|
|
43
|
-
readonly file: "
|
|
43
|
+
readonly file: "types/entity.ts";
|
|
44
44
|
readonly dependencies: readonly [];
|
|
45
45
|
};
|
|
46
46
|
readonly EntitySaveReqVO: {
|
|
47
|
-
readonly file: "
|
|
47
|
+
readonly file: "types/entity.ts";
|
|
48
48
|
readonly dependencies: readonly [];
|
|
49
49
|
};
|
|
50
50
|
readonly EntitySelectionActionReqVO: {
|
|
51
|
-
readonly file: "
|
|
51
|
+
readonly file: "types/user-action.ts";
|
|
52
52
|
readonly dependencies: readonly [];
|
|
53
53
|
};
|
|
54
54
|
readonly EntityUpdateReqVO: {
|
|
55
|
-
readonly file: "
|
|
55
|
+
readonly file: "types/user-action.ts";
|
|
56
56
|
readonly dependencies: readonly [];
|
|
57
57
|
};
|
|
58
58
|
readonly EntityWorkflowApproveUsersReqVO: {
|
|
59
|
-
readonly file: "
|
|
59
|
+
readonly file: "types/user-action.ts";
|
|
60
60
|
readonly dependencies: readonly [];
|
|
61
61
|
};
|
|
62
62
|
readonly EntityWorkflowDeployReqVO: {
|
|
63
|
-
readonly file: "
|
|
63
|
+
readonly file: "types/workflow.ts";
|
|
64
64
|
readonly dependencies: readonly [];
|
|
65
65
|
};
|
|
66
66
|
readonly EntityWorkflowUpdateReqVO: {
|
|
67
|
-
readonly file: "
|
|
67
|
+
readonly file: "types/workflow.ts";
|
|
68
68
|
readonly dependencies: readonly [];
|
|
69
69
|
};
|
|
70
70
|
readonly GetUploadTokenReqVO: {
|
|
71
|
-
readonly file: "
|
|
71
|
+
readonly file: "types/user-action.ts";
|
|
72
72
|
readonly dependencies: readonly [];
|
|
73
73
|
};
|
|
74
74
|
readonly InsertReqVO: {
|
|
75
|
-
readonly file: "
|
|
75
|
+
readonly file: "types/user-action.ts";
|
|
76
76
|
readonly dependencies: readonly [];
|
|
77
77
|
};
|
|
78
78
|
readonly MobileUploadCheckReqVO: {
|
|
79
|
-
readonly file: "
|
|
79
|
+
readonly file: "types/user-action.ts";
|
|
80
80
|
readonly dependencies: readonly [];
|
|
81
81
|
};
|
|
82
82
|
readonly MobileUploadReqVO: {
|
|
83
|
-
readonly file: "
|
|
83
|
+
readonly file: "types/user-action.ts";
|
|
84
84
|
readonly dependencies: readonly [];
|
|
85
85
|
};
|
|
86
86
|
readonly UploadPreviewReqVO: {
|
|
87
|
-
readonly file: "
|
|
87
|
+
readonly file: "types/common.ts";
|
|
88
88
|
readonly dependencies: readonly [];
|
|
89
89
|
};
|
|
90
90
|
readonly UserProfileUpdateReqVO: {
|
|
91
|
-
readonly file: "
|
|
91
|
+
readonly file: "types/user-action.ts";
|
|
92
92
|
readonly dependencies: readonly [];
|
|
93
93
|
};
|
|
94
94
|
};
|
|
@@ -1,95 +1,95 @@
|
|
|
1
1
|
// Generated by scripts/generate-type-index.mjs. Do not edit by hand.
|
|
2
2
|
export const typeIndex = {
|
|
3
3
|
"AppCreateByTenantsReqVO": {
|
|
4
|
-
"file": "
|
|
4
|
+
"file": "types/app.ts",
|
|
5
5
|
"dependencies": []
|
|
6
6
|
},
|
|
7
7
|
"AppCreateEntityReqVO": {
|
|
8
|
-
"file": "
|
|
8
|
+
"file": "types/app.ts",
|
|
9
9
|
"dependencies": []
|
|
10
10
|
},
|
|
11
11
|
"AppIngressCreateReqVO": {
|
|
12
|
-
"file": "
|
|
12
|
+
"file": "types/ingress.ts",
|
|
13
13
|
"dependencies": []
|
|
14
14
|
},
|
|
15
15
|
"AppIngressUpdateReqVO": {
|
|
16
|
-
"file": "
|
|
16
|
+
"file": "types/ingress.ts",
|
|
17
17
|
"dependencies": []
|
|
18
18
|
},
|
|
19
19
|
"AppUpdateAppReqVO": {
|
|
20
|
-
"file": "
|
|
20
|
+
"file": "types/app.ts",
|
|
21
21
|
"dependencies": []
|
|
22
22
|
},
|
|
23
23
|
"EntityBulkUpdateReqVO": {
|
|
24
|
-
"file": "
|
|
24
|
+
"file": "types/user-action.ts",
|
|
25
25
|
"dependencies": []
|
|
26
26
|
},
|
|
27
27
|
"EntityDoActionReqVO": {
|
|
28
|
-
"file": "
|
|
28
|
+
"file": "types/user-action.ts",
|
|
29
29
|
"dependencies": []
|
|
30
30
|
},
|
|
31
31
|
"EntityQueryRelationReqVO": {
|
|
32
|
-
"file": "
|
|
32
|
+
"file": "types/user-action.ts",
|
|
33
33
|
"dependencies": []
|
|
34
34
|
},
|
|
35
35
|
"EntityQueryReqVO": {
|
|
36
|
-
"file": "
|
|
36
|
+
"file": "types/user-action.ts",
|
|
37
37
|
"dependencies": []
|
|
38
38
|
},
|
|
39
39
|
"EntityResolveWorkflowReqVO": {
|
|
40
|
-
"file": "
|
|
40
|
+
"file": "types/user-action.ts",
|
|
41
41
|
"dependencies": []
|
|
42
42
|
},
|
|
43
43
|
"EntitySaveNameReqVO": {
|
|
44
|
-
"file": "
|
|
44
|
+
"file": "types/entity.ts",
|
|
45
45
|
"dependencies": []
|
|
46
46
|
},
|
|
47
47
|
"EntitySaveReqVO": {
|
|
48
|
-
"file": "
|
|
48
|
+
"file": "types/entity.ts",
|
|
49
49
|
"dependencies": []
|
|
50
50
|
},
|
|
51
51
|
"EntitySelectionActionReqVO": {
|
|
52
|
-
"file": "
|
|
52
|
+
"file": "types/user-action.ts",
|
|
53
53
|
"dependencies": []
|
|
54
54
|
},
|
|
55
55
|
"EntityUpdateReqVO": {
|
|
56
|
-
"file": "
|
|
56
|
+
"file": "types/user-action.ts",
|
|
57
57
|
"dependencies": []
|
|
58
58
|
},
|
|
59
59
|
"EntityWorkflowApproveUsersReqVO": {
|
|
60
|
-
"file": "
|
|
60
|
+
"file": "types/user-action.ts",
|
|
61
61
|
"dependencies": []
|
|
62
62
|
},
|
|
63
63
|
"EntityWorkflowDeployReqVO": {
|
|
64
|
-
"file": "
|
|
64
|
+
"file": "types/workflow.ts",
|
|
65
65
|
"dependencies": []
|
|
66
66
|
},
|
|
67
67
|
"EntityWorkflowUpdateReqVO": {
|
|
68
|
-
"file": "
|
|
68
|
+
"file": "types/workflow.ts",
|
|
69
69
|
"dependencies": []
|
|
70
70
|
},
|
|
71
71
|
"GetUploadTokenReqVO": {
|
|
72
|
-
"file": "
|
|
72
|
+
"file": "types/user-action.ts",
|
|
73
73
|
"dependencies": []
|
|
74
74
|
},
|
|
75
75
|
"InsertReqVO": {
|
|
76
|
-
"file": "
|
|
76
|
+
"file": "types/user-action.ts",
|
|
77
77
|
"dependencies": []
|
|
78
78
|
},
|
|
79
79
|
"MobileUploadCheckReqVO": {
|
|
80
|
-
"file": "
|
|
80
|
+
"file": "types/user-action.ts",
|
|
81
81
|
"dependencies": []
|
|
82
82
|
},
|
|
83
83
|
"MobileUploadReqVO": {
|
|
84
|
-
"file": "
|
|
84
|
+
"file": "types/user-action.ts",
|
|
85
85
|
"dependencies": []
|
|
86
86
|
},
|
|
87
87
|
"UploadPreviewReqVO": {
|
|
88
|
-
"file": "
|
|
88
|
+
"file": "types/common.ts",
|
|
89
89
|
"dependencies": []
|
|
90
90
|
},
|
|
91
91
|
"UserProfileUpdateReqVO": {
|
|
92
|
-
"file": "
|
|
92
|
+
"file": "types/user-action.ts",
|
|
93
93
|
"dependencies": []
|
|
94
94
|
}
|
|
95
95
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity_save_schema.d.ts","sourceRoot":"","sources":["../../src/runtime/entity_save_schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"entity_save_schema.d.ts","sourceRoot":"","sources":["../../src/runtime/entity_save_schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA+SvB,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,UAA6C,CAAA;AAE7E,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,UAQlC,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,UAK7B,CAAA;AAuKD,eAAO,MAAM,6BAA6B,EAAE,CAAC,CAAC,UAA8E,CAAA;AAO5H,eAAO,MAAM,qCAAqC,EAAE,CAAC,CAAC,UAI3C,CAAA;AAEX,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,UASpC,CAAA;AAEX,eAAO,MAAM,yBAAyB,EAAE,CAAC,CAAC,UAaxC,CAAA;AAEF,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,UA4B9C,CAAA;AA4EF,eAAO,MAAM,wCAAwC,EAAE,CAAC,CAAC,UAOxD,CAAA;AAwED,eAAO,MAAM,mCAAmC,EAAE,CAAC,CAAC,UAOzC,CAAA;AAEX,eAAO,MAAM,sCAAsC,EAAE,CAAC,CAAC,UAG5C,CAAA;AAEX,eAAO,MAAM,kCAAkC,EAAE,CAAC,CAAC,UAIxC,CAAA;AAEX,eAAO,MAAM,4CAA4C,EAAE,CAAC,CAAC,UAQlD,CAAA"}
|
|
@@ -142,6 +142,33 @@ function isRecord(value) {
|
|
|
142
142
|
function cloneJSON(value) {
|
|
143
143
|
return JSON.parse(JSON.stringify(value));
|
|
144
144
|
}
|
|
145
|
+
function normalizeFieldVO(value) {
|
|
146
|
+
if (!isRecord(value)) {
|
|
147
|
+
return value;
|
|
148
|
+
}
|
|
149
|
+
const field = { ...value };
|
|
150
|
+
field.unique ?? (field.unique = false);
|
|
151
|
+
field.editable ?? (field.editable = true);
|
|
152
|
+
field.visible ?? (field.visible = true);
|
|
153
|
+
field.show_label ?? (field.show_label = true);
|
|
154
|
+
field.scannable ?? (field.scannable = false);
|
|
155
|
+
field.default_value_mode ?? (field.default_value_mode = 0);
|
|
156
|
+
field.description ?? (field.description = '');
|
|
157
|
+
field.value ?? (field.value = null);
|
|
158
|
+
field.number_decimal ?? (field.number_decimal = 0);
|
|
159
|
+
field.depends ?? (field.depends = []);
|
|
160
|
+
field.code_index ?? (field.code_index = false);
|
|
161
|
+
field.transfers ?? (field.transfers = null);
|
|
162
|
+
if (field.type === 'subform') {
|
|
163
|
+
if (Array.isArray(field.children)) {
|
|
164
|
+
field.children = field.children.map((child) => normalizeFieldVO(child));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
field.children ?? (field.children = null);
|
|
169
|
+
}
|
|
170
|
+
return field;
|
|
171
|
+
}
|
|
145
172
|
function makeSimpleFieldSchema(type) {
|
|
146
173
|
return z.object({
|
|
147
174
|
...fieldCommonShape,
|
|
@@ -287,6 +314,9 @@ function normalizeEntitySaveInput(value) {
|
|
|
287
314
|
}
|
|
288
315
|
}
|
|
289
316
|
}
|
|
317
|
+
if (Array.isArray(entity.fields)) {
|
|
318
|
+
entity.fields = entity.fields.map((field) => normalizeFieldVO(field));
|
|
319
|
+
}
|
|
290
320
|
return entity;
|
|
291
321
|
}
|
|
292
322
|
function collectAllFieldIds(fields) {
|
package/dist/runtime/env.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export type RuntimeEnv = {
|
|
1
|
+
export type RuntimeEnv = Record<string, string | undefined> & {
|
|
2
2
|
ARCUBASE_BASE_URL: string;
|
|
3
3
|
ARCUBASE_ACCESS_TOKEN: string;
|
|
4
|
+
ARCUBASE_SDK_ROOT: string;
|
|
4
5
|
ARCUBASE_TRACE_ID?: string;
|
|
5
6
|
ARCUBASE_SUBJECT_TYPE?: string;
|
|
6
7
|
ARCUBASE_SUBJECT_ID?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/runtime/env.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/runtime/env.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG;IAC5D,iBAAiB,EAAE,MAAM,CAAA;IACzB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,iBAAiB,EAAE,MAAM,CAAA;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,yBAAyB,CAAC,EAAE,MAAM,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,CAAA;AAE9C,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;AA6ClD,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,GAAE,QAAsB,GAAG,UAAU,CAU9F"}
|
package/dist/runtime/env.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CLIError } from './errors.js';
|
|
1
2
|
const PREFIX_BY_SCOPE = {
|
|
2
3
|
admin: 'ARCUBASE_ADMIN_',
|
|
3
4
|
user: 'ARCUBASE_USER_',
|
|
@@ -18,10 +19,17 @@ function envValue(env, scope, key) {
|
|
|
18
19
|
function requiredValue(env, scope, key) {
|
|
19
20
|
const value = envValue(env, scope, key);
|
|
20
21
|
if (!value || value.trim() === '') {
|
|
21
|
-
throw new
|
|
22
|
+
throw new CLIError('RUNTIME_ENV_REQUIRED', `${key} is required`, 2);
|
|
22
23
|
}
|
|
23
24
|
return value;
|
|
24
25
|
}
|
|
26
|
+
function requiredDirectValue(env, key) {
|
|
27
|
+
const value = env[key];
|
|
28
|
+
if (!value || value.trim() === '') {
|
|
29
|
+
throw new CLIError('RUNTIME_ENV_REQUIRED', `${key} is required`, 2);
|
|
30
|
+
}
|
|
31
|
+
return value.trim();
|
|
32
|
+
}
|
|
25
33
|
function optionalValue(env, scope, key) {
|
|
26
34
|
const value = envValue(env, scope, key);
|
|
27
35
|
if (!value || value.trim() === '') {
|
|
@@ -33,6 +41,7 @@ export function loadRuntimeEnv(scope, env = process.env) {
|
|
|
33
41
|
return {
|
|
34
42
|
ARCUBASE_BASE_URL: requiredValue(env, scope, 'ARCUBASE_BASE_URL'),
|
|
35
43
|
ARCUBASE_ACCESS_TOKEN: requiredValue(env, scope, 'ARCUBASE_ACCESS_TOKEN'),
|
|
44
|
+
ARCUBASE_SDK_ROOT: requiredDirectValue(env, 'ARCUBASE_SDK_ROOT'),
|
|
36
45
|
ARCUBASE_TRACE_ID: optionalValue(env, scope, 'ARCUBASE_TRACE_ID'),
|
|
37
46
|
ARCUBASE_SUBJECT_TYPE: optionalValue(env, scope, 'ARCUBASE_SUBJECT_TYPE'),
|
|
38
47
|
ARCUBASE_SUBJECT_ID: optionalValue(env, scope, 'ARCUBASE_SUBJECT_ID'),
|
package/dist/runtime/errors.d.ts
CHANGED
|
@@ -22,8 +22,11 @@ export type CLIErrorDetails = {
|
|
|
22
22
|
hint?: string;
|
|
23
23
|
endpoint?: string;
|
|
24
24
|
method?: string;
|
|
25
|
+
status?: number;
|
|
26
|
+
responseBody?: string;
|
|
25
27
|
traceId?: string;
|
|
26
28
|
upstreamError?: unknown;
|
|
29
|
+
retryToolCalls?: unknown[];
|
|
27
30
|
suggestions?: string[];
|
|
28
31
|
};
|
|
29
32
|
export declare class CLIError extends Error {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","s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AAC,OAAO,CAAC,EAAE,eAAe,CAAA;gBAEtB,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,SAAI,EAAE,OAAO,CAAC,EAAE,eAAe;IAQlF,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CASlC"}
|
|
@@ -10,8 +10,10 @@ export type CommandExecutionSummary = {
|
|
|
10
10
|
queryFlags: readonly string[];
|
|
11
11
|
};
|
|
12
12
|
export declare function renderRootHelp(scope: CommandScope): string;
|
|
13
|
-
export declare function renderModuleHelp(scope: CommandScope, moduleName: string): string;
|
|
14
|
-
|
|
13
|
+
export declare function renderModuleHelp(scope: CommandScope, moduleName: string, env?: EnvInput): string;
|
|
14
|
+
type EnvInput = Record<string, string | undefined>;
|
|
15
|
+
export declare function renderCommandHelp(scope: CommandScope, moduleName: string, commandName?: string, env?: EnvInput): string;
|
|
15
16
|
export declare function summarizeCommand(scope: CommandScope, moduleName: string, commandName: string): CommandExecutionSummary;
|
|
16
17
|
export declare function executeCLI(scope: CommandScope, argv: string[], env?: RuntimeEnv, fetchImpl?: typeof fetch): Promise<any>;
|
|
18
|
+
export {};
|
|
17
19
|
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/runtime/execute.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAG1D,OAAO,EAAwE,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAK/H,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,YAAY,CAAA;IACnB,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IA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