openxiangda-devkit-core 2.0.0-alpha.87 → 2.0.0-alpha.90
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/command-registry.d.ts +13 -0
- package/dist/command-registry.d.ts.map +1 -1
- package/dist/command-registry.js +6 -6
- package/dist/command-registry.js.map +1 -1
- package/dist/compiler/bundle.d.ts +5 -0
- package/dist/compiler/bundle.d.ts.map +1 -1
- package/dist/compiler/bundle.js +80 -5
- package/dist/compiler/bundle.js.map +1 -1
- package/dist/compiler/config.d.ts +22 -1
- package/dist/compiler/config.d.ts.map +1 -1
- package/dist/compiler/config.js +86 -3
- package/dist/compiler/config.js.map +1 -1
- package/dist/compiler/package-compiler.d.ts.map +1 -1
- package/dist/compiler/package-compiler.js +1 -0
- package/dist/compiler/package-compiler.js.map +1 -1
- package/dist/internal/workflow.d.ts +2 -0
- package/dist/internal/workflow.d.ts.map +1 -1
- package/dist/internal/workflow.js +45 -6
- package/dist/internal/workflow.js.map +1 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +36 -1
- package/dist/workspace.js.map +1 -1
- package/package.json +2 -2
|
@@ -4,22 +4,26 @@ export interface DevkitCommandDefinition {
|
|
|
4
4
|
operation: string;
|
|
5
5
|
summary: string;
|
|
6
6
|
risk: DevkitCommandRisk;
|
|
7
|
+
studioJsonEvents?: true;
|
|
7
8
|
}
|
|
8
9
|
export declare const DEVKIT_COMMANDS: readonly [{
|
|
9
10
|
readonly id: "create";
|
|
10
11
|
readonly operation: "create";
|
|
11
12
|
readonly summary: "创建、绑定并初始化应用";
|
|
12
13
|
readonly risk: "deploy";
|
|
14
|
+
readonly studioJsonEvents: true;
|
|
13
15
|
}, {
|
|
14
16
|
readonly id: "dev";
|
|
15
17
|
readonly operation: "dev";
|
|
16
18
|
readonly summary: "连接平台测试数据启动本地 Web 与 Nest";
|
|
17
19
|
readonly risk: "write-local";
|
|
20
|
+
readonly studioJsonEvents: true;
|
|
18
21
|
}, {
|
|
19
22
|
readonly id: "check";
|
|
20
23
|
readonly operation: "check";
|
|
21
24
|
readonly summary: "生成契约并在目标平台预检后执行检查、测试和构建";
|
|
22
25
|
readonly risk: "write-local";
|
|
26
|
+
readonly studioJsonEvents: true;
|
|
23
27
|
}, {
|
|
24
28
|
readonly id: "accept";
|
|
25
29
|
readonly operation: "accept";
|
|
@@ -30,6 +34,7 @@ export declare const DEVKIT_COMMANDS: readonly [{
|
|
|
30
34
|
readonly operation: "deploy";
|
|
31
35
|
readonly summary: "部署测试环境或显式复用测试版本部署生产";
|
|
32
36
|
readonly risk: "deploy";
|
|
37
|
+
readonly studioJsonEvents: true;
|
|
33
38
|
}, {
|
|
34
39
|
readonly id: "status";
|
|
35
40
|
readonly operation: "status";
|
|
@@ -40,6 +45,7 @@ export declare const DEVKIT_COMMANDS: readonly [{
|
|
|
40
45
|
readonly operation: "logs";
|
|
41
46
|
readonly summary: "查询最近或指定部署日志";
|
|
42
47
|
readonly risk: "read";
|
|
48
|
+
readonly studioJsonEvents: true;
|
|
43
49
|
}, {
|
|
44
50
|
readonly id: "cancel";
|
|
45
51
|
readonly operation: "cancel";
|
|
@@ -65,6 +71,7 @@ export declare const DEVKIT_COMMANDS: readonly [{
|
|
|
65
71
|
readonly operation: "rollback";
|
|
66
72
|
readonly summary: "回滚测试或生产环境";
|
|
67
73
|
readonly risk: "deploy";
|
|
74
|
+
readonly studioJsonEvents: true;
|
|
68
75
|
}, {
|
|
69
76
|
readonly id: "login";
|
|
70
77
|
readonly operation: "login";
|
|
@@ -86,16 +93,19 @@ export declare function commandDefinition(id: string): {
|
|
|
86
93
|
readonly operation: "create";
|
|
87
94
|
readonly summary: "创建、绑定并初始化应用";
|
|
88
95
|
readonly risk: "deploy";
|
|
96
|
+
readonly studioJsonEvents: true;
|
|
89
97
|
} | {
|
|
90
98
|
readonly id: "dev";
|
|
91
99
|
readonly operation: "dev";
|
|
92
100
|
readonly summary: "连接平台测试数据启动本地 Web 与 Nest";
|
|
93
101
|
readonly risk: "write-local";
|
|
102
|
+
readonly studioJsonEvents: true;
|
|
94
103
|
} | {
|
|
95
104
|
readonly id: "check";
|
|
96
105
|
readonly operation: "check";
|
|
97
106
|
readonly summary: "生成契约并在目标平台预检后执行检查、测试和构建";
|
|
98
107
|
readonly risk: "write-local";
|
|
108
|
+
readonly studioJsonEvents: true;
|
|
99
109
|
} | {
|
|
100
110
|
readonly id: "accept";
|
|
101
111
|
readonly operation: "accept";
|
|
@@ -106,6 +116,7 @@ export declare function commandDefinition(id: string): {
|
|
|
106
116
|
readonly operation: "deploy";
|
|
107
117
|
readonly summary: "部署测试环境或显式复用测试版本部署生产";
|
|
108
118
|
readonly risk: "deploy";
|
|
119
|
+
readonly studioJsonEvents: true;
|
|
109
120
|
} | {
|
|
110
121
|
readonly id: "status";
|
|
111
122
|
readonly operation: "status";
|
|
@@ -116,6 +127,7 @@ export declare function commandDefinition(id: string): {
|
|
|
116
127
|
readonly operation: "logs";
|
|
117
128
|
readonly summary: "查询最近或指定部署日志";
|
|
118
129
|
readonly risk: "read";
|
|
130
|
+
readonly studioJsonEvents: true;
|
|
119
131
|
} | {
|
|
120
132
|
readonly id: "cancel";
|
|
121
133
|
readonly operation: "cancel";
|
|
@@ -141,6 +153,7 @@ export declare function commandDefinition(id: string): {
|
|
|
141
153
|
readonly operation: "rollback";
|
|
142
154
|
readonly summary: "回滚测试或生产环境";
|
|
143
155
|
readonly risk: "deploy";
|
|
156
|
+
readonly studioJsonEvents: true;
|
|
144
157
|
} | {
|
|
145
158
|
readonly id: "login";
|
|
146
159
|
readonly operation: "login";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-registry.d.ts","sourceRoot":"","sources":["../src/command-registry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,aAAa,GAAG,QAAQ,CAAC;AAElE,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"command-registry.d.ts","sourceRoot":"","sources":["../src/command-registry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,aAAa,GAAG,QAAQ,CAAC;AAElE,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,iBAAiB,CAAC;IACxB,gBAAgB,CAAC,EAAE,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB2B,CAAC;AAExD,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAE3C;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,GAAE;IACP,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CAChB,UASP"}
|
package/dist/command-registry.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export const DEVKIT_COMMANDS = [
|
|
2
|
-
{ id: "create", operation: "create", summary: "创建、绑定并初始化应用", risk: "deploy" },
|
|
3
|
-
{ id: "dev", operation: "dev", summary: "连接平台测试数据启动本地 Web 与 Nest", risk: "write-local" },
|
|
4
|
-
{ id: "check", operation: "check", summary: "生成契约并在目标平台预检后执行检查、测试和构建", risk: "write-local" },
|
|
2
|
+
{ id: "create", operation: "create", summary: "创建、绑定并初始化应用", risk: "deploy", studioJsonEvents: true },
|
|
3
|
+
{ id: "dev", operation: "dev", summary: "连接平台测试数据启动本地 Web 与 Nest", risk: "write-local", studioJsonEvents: true },
|
|
4
|
+
{ id: "check", operation: "check", summary: "生成契约并在目标平台预检后执行检查、测试和构建", risk: "write-local", studioJsonEvents: true },
|
|
5
5
|
{ id: "accept", operation: "accept", summary: "按计划准备可选的真实预发验收身份", risk: "deploy" },
|
|
6
|
-
{ id: "deploy", operation: "deploy", summary: "部署测试环境或显式复用测试版本部署生产", risk: "deploy" },
|
|
6
|
+
{ id: "deploy", operation: "deploy", summary: "部署测试环境或显式复用测试版本部署生产", risk: "deploy", studioJsonEvents: true },
|
|
7
7
|
{ id: "status", operation: "status", summary: "查询最近或指定部署状态", risk: "read" },
|
|
8
|
-
{ id: "logs", operation: "logs", summary: "查询最近或指定部署日志", risk: "read" },
|
|
8
|
+
{ id: "logs", operation: "logs", summary: "查询最近或指定部署日志", risk: "read", studioJsonEvents: true },
|
|
9
9
|
{ id: "cancel", operation: "cancel", summary: "幂等取消尚未提交激活的部署", risk: "deploy" },
|
|
10
10
|
{ id: "retry", operation: "retry", summary: "显式重试可恢复的失败部署", risk: "deploy" },
|
|
11
11
|
{ id: "start", operation: "environment.start", summary: "从当前不可变版本启动应用环境", risk: "deploy" },
|
|
12
12
|
{ id: "stop", operation: "environment.stop", summary: "将应用环境缩容为零并保留数据", risk: "deploy" },
|
|
13
|
-
{ id: "rollback", operation: "rollback", summary: "回滚测试或生产环境", risk: "deploy" },
|
|
13
|
+
{ id: "rollback", operation: "rollback", summary: "回滚测试或生产环境", risk: "deploy", studioJsonEvents: true },
|
|
14
14
|
{ id: "login", operation: "login", summary: "通过平台浏览器授权登录", risk: "write-local" },
|
|
15
15
|
{ id: "skill", operation: "skill install", summary: "安装当前版本的 AI Skill", risk: "write-local" },
|
|
16
16
|
{ id: "spec", operation: "spec", summary: "维护可选的 AppSpec 需求与变更辅助", risk: "write-local" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-registry.js","sourceRoot":"","sources":["../src/command-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-registry.js","sourceRoot":"","sources":["../src/command-registry.ts"],"names":[],"mappings":"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"}
|
|
@@ -24,6 +24,11 @@ export interface CompiledApplicationSources {
|
|
|
24
24
|
export declare function compileApplicationSources(config: OpenXiangdaAppConfig, generatorVersion?: string): CompiledApplicationSources;
|
|
25
25
|
export declare function normalizeConfiguration(config: OpenXiangdaAppConfig): ConfigurationBundleV3;
|
|
26
26
|
export declare function compileContractBundle(config: OpenXiangdaAppConfig, configDigest?: string, generatorVersion?: string): ContractBundleV3;
|
|
27
|
+
export declare const DEFAULT_ROUTE_MANIFEST_DEVICE_POLICY: Readonly<{
|
|
28
|
+
kind: "viewport-family";
|
|
29
|
+
mobileMaxWidthPx: number;
|
|
30
|
+
desktopMinWidthPx: number;
|
|
31
|
+
}>;
|
|
27
32
|
export declare function renderGeneratedContracts(config: OpenXiangdaAppConfig, contract?: ContractBundleV3): string;
|
|
28
33
|
export declare function sha256Bytes(content: string | Uint8Array): string;
|
|
29
34
|
//# sourceMappingURL=bundle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/compiler/bundle.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/compiler/bundle.ts"],"names":[],"mappings":"AACA,OAAO,EAiBL,KAAK,WAAW,EAOhB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EAMtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,aAAa,CAAC;AAoBrB,eAAO,MAAM,oBAAoB,gCAAsC,CAAC;AACxE,eAAO,MAAM,sBAAsB,kCAAiC,CAAC;AACrE,eAAO,MAAM,yBAAyB,YACC,CAAC;AAExC,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC,KAAK,EAAE,CAAC,CAAC;IACT,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,WAAW,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;IACpD,SAAS,EAAE,oBAAoB,CAAC,gBAAgB,CAAC,GAAG;QAClD,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,SAAS,EAAE;QACT,KAAK,EAAE,mBAAmB,CAAC;QAC3B,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,mDAAmD,CAAC;KAChE,CAAC;CACH;AA8CD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,oBAAoB,EAC5B,gBAAgB,SAA4B,GAC3C,0BAA0B,CAuD5B;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,oBAAoB,GAC3B,qBAAqB,CA+YvB;AA8DD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,oBAAoB,EAC5B,YAAY,CAAC,EAAE,MAAM,EACrB,gBAAgB,SAA4B,GAC3C,gBAAgB,CAQlB;AAuYD,eAAO,MAAM,oCAAoC;;;;EAIN,CAAC;AAmqB5C,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,mBAAgC,UA8NzC;AA0LD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,UAEvD"}
|
package/dist/compiler/bundle.js
CHANGED
|
@@ -4,6 +4,7 @@ import { AppConfigValidationError, } from './config.js';
|
|
|
4
4
|
import { AUTHORIZATION_TRANSITION_CAPABILITY_CODE_PATTERN, AUTHORIZATION_TRANSITION_KEYS, AUTHORIZATION_TRANSITION_ROLE_CODE_PATTERN, exactKeys, isExactStringArray, isPlainRecord, } from './authorization-transition.js';
|
|
5
5
|
import { compileAiCapabilityCatalog } from './ai-catalog.js';
|
|
6
6
|
import { FIELD_VALUE_TYPESCRIPT_DECLARATIONS, fieldNullable, supportsGeneratedMutation, typescriptType, } from './field-codec.js';
|
|
7
|
+
import { normalizeWorkflowDefinition } from '../internal/workflow.js';
|
|
7
8
|
import { supportsSearch, supportsSort } from './field-query-plan.js';
|
|
8
9
|
import { resolveDataFieldSurfaceWidget } from './field-surface.js';
|
|
9
10
|
export const CONFIG_BUNDLE_SCHEMA = SCHEMA_VERSIONS.configurationBundle;
|
|
@@ -343,7 +344,7 @@ export function normalizeConfiguration(config) {
|
|
|
343
344
|
workflows: {
|
|
344
345
|
definitions: sorted((config.workflows?.definitions || []).map(item => ({
|
|
345
346
|
version: item.version,
|
|
346
|
-
definition: item.definition,
|
|
347
|
+
definition: normalizeWorkflowDefinition(item.definition),
|
|
347
348
|
launch: { mode: item.launch?.mode || 'work-center-only' },
|
|
348
349
|
...(item.detailRouteCode
|
|
349
350
|
? { detailRouteCode: { ...item.detailRouteCode } }
|
|
@@ -390,6 +391,7 @@ export function normalizeConfiguration(config) {
|
|
|
390
391
|
},
|
|
391
392
|
frontend: {
|
|
392
393
|
routes: compileFrontendRoutes(config),
|
|
394
|
+
devicePolicy: compileRouteManifestDevicePolicy(config),
|
|
393
395
|
authentication: compileApplicationAuthentication(config),
|
|
394
396
|
...(config.frontend.publicAccess
|
|
395
397
|
? { publicAccess: compileAnonymousPublicAccess(config) }
|
|
@@ -561,7 +563,7 @@ function compileContractBundleFromNormalized(config, configDigest, generatorVers
|
|
|
561
563
|
...(config.frontend.publicAccess
|
|
562
564
|
? { publicAccess: compileAnonymousPublicAccess(config) }
|
|
563
565
|
: {}),
|
|
564
|
-
routeManifest: compileStandardRouteManifest(config
|
|
566
|
+
routeManifest: compileStandardRouteManifest(config, adminPages),
|
|
565
567
|
adminPages,
|
|
566
568
|
adminNavigation: compileAdminNavigation(config),
|
|
567
569
|
};
|
|
@@ -790,6 +792,17 @@ function compileAdminPages(config) {
|
|
|
790
792
|
function routePathParams(path) {
|
|
791
793
|
return uniqueSorted([...path.matchAll(/:([A-Za-z][A-Za-z0-9_]*)/g)].map(match => match[1]));
|
|
792
794
|
}
|
|
795
|
+
export const DEFAULT_ROUTE_MANIFEST_DEVICE_POLICY = Object.freeze({
|
|
796
|
+
kind: 'viewport-family',
|
|
797
|
+
mobileMaxWidthPx: 900,
|
|
798
|
+
desktopMinWidthPx: 901,
|
|
799
|
+
});
|
|
800
|
+
function compileRouteManifestDevicePolicy(config) {
|
|
801
|
+
return {
|
|
802
|
+
...DEFAULT_ROUTE_MANIFEST_DEVICE_POLICY,
|
|
803
|
+
...(config.frontend.devicePolicy || {}),
|
|
804
|
+
};
|
|
805
|
+
}
|
|
793
806
|
function compileStandardRouteManifestRoute(routeCode, path, surface, page) {
|
|
794
807
|
return {
|
|
795
808
|
routeCode,
|
|
@@ -808,7 +821,7 @@ function standardRouteCode(kind, device, workflowCode) {
|
|
|
808
821
|
return `application.todo-center.${device}`;
|
|
809
822
|
return `${kind.replaceAll('-', '.')}.${device}`;
|
|
810
823
|
}
|
|
811
|
-
function compileStandardRouteManifest(
|
|
824
|
+
function compileStandardRouteManifest(config, adminPages) {
|
|
812
825
|
const routes = [];
|
|
813
826
|
for (const page of adminPages) {
|
|
814
827
|
if (page.kind !== 'application-todo-center' &&
|
|
@@ -839,13 +852,70 @@ function compileStandardRouteManifest(appCode, adminPages) {
|
|
|
839
852
|
});
|
|
840
853
|
}
|
|
841
854
|
const normalizedRoutes = routes.sort((left, right) => compare(left.code, right.code));
|
|
855
|
+
const staticRoute = (device) => {
|
|
856
|
+
const expectedPath = device === 'mobile' ? '/m/' : '/';
|
|
857
|
+
const declared = (config.frontend.routes || [])
|
|
858
|
+
.filter(route => route.surface === 'user' &&
|
|
859
|
+
validManifestStaticPath(route.path) &&
|
|
860
|
+
route.path === expectedPath)
|
|
861
|
+
.sort((left, right) => compare(left.code, right.code))[0];
|
|
862
|
+
if (declared &&
|
|
863
|
+
declared.surface === 'user' &&
|
|
864
|
+
validManifestStaticPath(declared.path)) {
|
|
865
|
+
return { code: declared.code, path: declared.path };
|
|
866
|
+
}
|
|
867
|
+
const fallback = (config.frontend.routes || [])
|
|
868
|
+
.filter(route => route.surface === 'user' &&
|
|
869
|
+
validManifestStaticPath(route.path) &&
|
|
870
|
+
(device === 'mobile'
|
|
871
|
+
? route.path.startsWith('/m/')
|
|
872
|
+
: !route.path.startsWith('/m/')))
|
|
873
|
+
.sort((left, right) => compare(left.code, right.code))[0];
|
|
874
|
+
return fallback
|
|
875
|
+
? { code: fallback.code, path: fallback.path }
|
|
876
|
+
: {
|
|
877
|
+
code: device === 'mobile' ? 'application-root-mobile' : 'application-root',
|
|
878
|
+
path: expectedPath,
|
|
879
|
+
};
|
|
880
|
+
};
|
|
881
|
+
const authentication = config.frontend.authentication
|
|
882
|
+
? {
|
|
883
|
+
desktop: {
|
|
884
|
+
routeCode: config.frontend.authentication.surfaces.desktop.routeCode,
|
|
885
|
+
path: config.frontend.authentication.surfaces.desktop.path,
|
|
886
|
+
},
|
|
887
|
+
mobile: {
|
|
888
|
+
routeCode: config.frontend.authentication.surfaces.mobile.routeCode,
|
|
889
|
+
path: config.frontend.authentication.surfaces.mobile.path,
|
|
890
|
+
},
|
|
891
|
+
}
|
|
892
|
+
: {
|
|
893
|
+
desktop: { routeCode: 'application-login', path: '/login' },
|
|
894
|
+
mobile: { routeCode: 'application-login-mobile', path: '/m/login' },
|
|
895
|
+
};
|
|
896
|
+
const rootDesktop = staticRoute('desktop');
|
|
897
|
+
const rootMobile = staticRoute('mobile');
|
|
842
898
|
const payload = {
|
|
843
899
|
schemaVersion: SCHEMA_VERSIONS.applicationRouteManifest,
|
|
844
|
-
appCode,
|
|
900
|
+
appCode: config.app.code,
|
|
901
|
+
devicePolicy: compileRouteManifestDevicePolicy(config),
|
|
902
|
+
rootEntry: {
|
|
903
|
+
code: rootDesktop.code,
|
|
904
|
+
desktop: rootDesktop.path,
|
|
905
|
+
mobile: rootMobile.path,
|
|
906
|
+
},
|
|
907
|
+
authentication,
|
|
845
908
|
routes: normalizedRoutes,
|
|
846
909
|
};
|
|
847
910
|
return { ...payload, digest: sha256Digest(payload) };
|
|
848
911
|
}
|
|
912
|
+
function validManifestStaticPath(path) {
|
|
913
|
+
return (path.startsWith('/') &&
|
|
914
|
+
!path.startsWith('//') &&
|
|
915
|
+
!path.includes('..') &&
|
|
916
|
+
!/[:*?#\\]/.test(path) &&
|
|
917
|
+
path.length <= 2048);
|
|
918
|
+
}
|
|
849
919
|
function pageCodeForReference(reference) {
|
|
850
920
|
if (reference.kind === 'resource')
|
|
851
921
|
return `resource:${reference.resourceCode}:list`;
|
|
@@ -1020,7 +1090,12 @@ function compileWorkflows(config) {
|
|
|
1020
1090
|
code,
|
|
1021
1091
|
title: currentDefinition.definition.title,
|
|
1022
1092
|
acceptedCommandDeactivationPolicy: currentDefinition.definition.acceptedCommandDeactivationPolicy,
|
|
1023
|
-
subject: {
|
|
1093
|
+
subject: {
|
|
1094
|
+
...currentDefinition.definition.subject,
|
|
1095
|
+
summaryFields: Array.isArray(currentDefinition.definition.subject.summaryFields)
|
|
1096
|
+
? [...currentDefinition.definition.subject.summaryFields]
|
|
1097
|
+
: [],
|
|
1098
|
+
},
|
|
1024
1099
|
launch: {
|
|
1025
1100
|
mode: currentDefinition.launch?.mode || 'work-center-only',
|
|
1026
1101
|
},
|