openxiangda-cli 2.0.0-alpha.17 → 2.0.0-alpha.170
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/README.md +51 -15
- package/bin/run.js +79 -1
- package/dist/base.d.ts +59 -5
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +213 -10
- package/dist/base.js.map +1 -1
- package/dist/commands/accept.d.ts +28 -0
- package/dist/commands/accept.d.ts.map +1 -0
- package/dist/commands/accept.js +21 -0
- package/dist/commands/accept.js.map +1 -0
- package/dist/commands/cancel.d.ts +19 -1
- package/dist/commands/cancel.d.ts.map +1 -1
- package/dist/commands/cancel.js +1 -1
- package/dist/commands/cancel.js.map +1 -1
- package/dist/commands/check.d.ts +22 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +17 -4
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/create.d.ts +39 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +457 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/deploy.d.ts +26 -8
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +31 -17
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.d.ts +23 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +28 -4
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/login.d.ts +29 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/{auth/login.js → login.js} +27 -9
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logs.d.ts +22 -2
- package/dist/commands/logs.d.ts.map +1 -1
- package/dist/commands/logs.js +9 -5
- package/dist/commands/logs.js.map +1 -1
- package/dist/commands/retry.d.ts +19 -1
- package/dist/commands/retry.d.ts.map +1 -1
- package/dist/commands/retry.js +5 -2
- package/dist/commands/retry.js.map +1 -1
- package/dist/commands/rollback.d.ts +23 -4
- package/dist/commands/rollback.d.ts.map +1 -1
- package/dist/commands/rollback.js +18 -5
- package/dist/commands/rollback.js.map +1 -1
- package/dist/commands/skill.d.ts +31 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +43 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/commands/spec.d.ts +39 -0
- package/dist/commands/spec.d.ts.map +1 -0
- package/dist/commands/spec.js +117 -0
- package/dist/commands/spec.js.map +1 -0
- package/dist/commands/start.d.ts +28 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +18 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +19 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/stop.d.ts +28 -0
- package/dist/commands/stop.d.ts.map +1 -0
- package/dist/commands/stop.js +18 -0
- package/dist/commands/stop.js.map +1 -0
- package/dist/create-workspace.d.ts +67 -0
- package/dist/create-workspace.d.ts.map +1 -0
- package/dist/create-workspace.js +631 -0
- package/dist/create-workspace.js.map +1 -0
- package/dist/studio-events.d.ts +9 -0
- package/dist/studio-events.d.ts.map +1 -0
- package/dist/studio-events.js +30 -0
- package/dist/studio-events.js.map +1 -0
- package/dist/toolchain-capsule.d.ts +4 -0
- package/dist/toolchain-capsule.d.ts.map +1 -0
- package/dist/toolchain-capsule.js +116 -0
- package/dist/toolchain-capsule.js.map +1 -0
- package/package.json +16 -9
- package/template/.dockerignore +23 -0
- package/template/.env.example +3 -0
- package/template/AGENTS.md +62 -0
- package/template/README.md +70 -0
- package/template/_gitignore +14 -0
- package/template/apps/web/data-api-live.e2e.html +15 -0
- package/template/apps/web/e2e/client-fixture.ts +5 -0
- package/template/apps/web/e2e/component-defaults-fixture.css +15 -0
- package/template/apps/web/e2e/data-api-live-fixture.tsx +162 -0
- package/template/apps/web/e2e/data-api-live.spec.ts +144 -0
- package/template/apps/web/e2e/field-protocol-fixture.tsx +387 -0
- package/template/apps/web/e2e/field-protocol.spec.ts +285 -0
- package/template/apps/web/e2e/mobile-files.spec.ts +93 -0
- package/template/apps/web/e2e/mobile-reference-fixture.tsx +314 -0
- package/template/apps/web/e2e/mobile-reference.spec.ts +360 -0
- package/template/apps/web/e2e/mobile-selection.spec.ts +199 -0
- package/template/apps/web/e2e/resource-experience-fixture.tsx +491 -0
- package/template/apps/web/e2e/resource-platform-mock.ts +202 -0
- package/template/apps/web/e2e/resources.spec.ts +477 -0
- package/template/apps/web/e2e/standard-admin.spec.ts +441 -0
- package/template/apps/web/e2e/workflow-experience-fixture.tsx +338 -0
- package/template/apps/web/e2e/workflow.spec.ts +1173 -0
- package/template/apps/web/field-protocol.e2e.html +22 -0
- package/template/apps/web/index.html +12 -0
- package/template/apps/web/mobile-reference.e2e.html +27 -0
- package/template/apps/web/package.json +34 -0
- package/template/apps/web/playwright.config.ts +47 -0
- package/template/apps/web/resource-experience.e2e.html +16 -0
- package/template/apps/web/scripts/check.mjs +43 -0
- package/template/apps/web/scripts/verify-build.mjs +6 -0
- package/template/apps/web/src/document.css +5 -0
- package/template/apps/web/src/main.tsx +66 -0
- package/template/apps/web/src/user-end/tailwind.css +5 -0
- package/template/apps/web/test/contracts.test.ts +162 -0
- package/template/apps/web/test/loopback.test.ts +68 -0
- package/template/apps/web/test/standard-user-surfaces.typecheck.tsx +27 -0
- package/template/apps/web/tsconfig.json +12 -0
- package/template/apps/web/vite.config.ts +42 -0
- package/template/apps/web/workflow-experience.e2e.html +15 -0
- package/template/appspec/app.md +62 -0
- package/template/openxiangda.config.ts +55 -0
- package/template/package.json +28 -0
- package/template/packages/contracts/package.json +23 -0
- package/template/packages/contracts/src/generated.ts +265 -0
- package/template/packages/contracts/src/index.ts +1 -0
- package/template/packages/contracts/tsconfig.json +9 -0
- package/template/pnpm-workspace.yaml +7 -0
- package/template/tsconfig.base.json +13 -0
- package/dist/commands/app/create.d.ts +0 -15
- package/dist/commands/app/create.d.ts.map +0 -1
- package/dist/commands/app/create.js +0 -42
- package/dist/commands/app/create.js.map +0 -1
- package/dist/commands/app/info.d.ts +0 -9
- package/dist/commands/app/info.d.ts.map +0 -1
- package/dist/commands/app/info.js +0 -10
- package/dist/commands/app/info.js.map +0 -1
- package/dist/commands/app/link.d.ts +0 -10
- package/dist/commands/app/link.d.ts.map +0 -1
- package/dist/commands/app/link.js +0 -16
- package/dist/commands/app/link.js.map +0 -1
- package/dist/commands/app/provision.d.ts +0 -9
- package/dist/commands/app/provision.d.ts.map +0 -1
- package/dist/commands/app/provision.js +0 -10
- package/dist/commands/app/provision.js.map +0 -1
- package/dist/commands/auth/login.d.ts +0 -11
- package/dist/commands/auth/login.d.ts.map +0 -1
- package/dist/commands/auth/login.js.map +0 -1
- package/dist/commands/auth/logout.d.ts +0 -6
- package/dist/commands/auth/logout.d.ts.map +0 -1
- package/dist/commands/auth/logout.js +0 -30
- package/dist/commands/auth/logout.js.map +0 -1
- package/dist/commands/auth/status.d.ts +0 -6
- package/dist/commands/auth/status.d.ts.map +0 -1
- package/dist/commands/auth/status.js +0 -60
- package/dist/commands/auth/status.js.map +0 -1
- package/dist/commands/build.d.ts +0 -11
- package/dist/commands/build.d.ts.map +0 -1
- package/dist/commands/build.js +0 -23
- package/dist/commands/build.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -9
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -7
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/event/delivery/list.d.ts +0 -10
- package/dist/commands/event/delivery/list.d.ts.map +0 -1
- package/dist/commands/event/delivery/list.js +0 -14
- package/dist/commands/event/delivery/list.js.map +0 -1
- package/dist/commands/event/delivery/replay.d.ts +0 -13
- package/dist/commands/event/delivery/replay.d.ts.map +0 -1
- package/dist/commands/event/delivery/replay.js +0 -16
- package/dist/commands/event/delivery/replay.js.map +0 -1
- package/dist/commands/event/subscription/list.d.ts +0 -9
- package/dist/commands/event/subscription/list.d.ts.map +0 -1
- package/dist/commands/event/subscription/list.js +0 -10
- package/dist/commands/event/subscription/list.js.map +0 -1
- package/dist/commands/event/subscription/rotate-secret.d.ts +0 -15
- package/dist/commands/event/subscription/rotate-secret.d.ts.map +0 -1
- package/dist/commands/event/subscription/rotate-secret.js +0 -33
- package/dist/commands/event/subscription/rotate-secret.js.map +0 -1
- package/dist/commands/event/subscription/status.d.ts +0 -14
- package/dist/commands/event/subscription/status.d.ts.map +0 -1
- package/dist/commands/event/subscription/status.js +0 -19
- package/dist/commands/event/subscription/status.js.map +0 -1
- package/dist/commands/event/timer/list.d.ts +0 -9
- package/dist/commands/event/timer/list.d.ts.map +0 -1
- package/dist/commands/event/timer/list.js +0 -10
- package/dist/commands/event/timer/list.js.map +0 -1
- package/dist/commands/event/timer/status.d.ts +0 -14
- package/dist/commands/event/timer/status.d.ts.map +0 -1
- package/dist/commands/event/timer/status.js +0 -19
- package/dist/commands/event/timer/status.js.map +0 -1
- package/dist/commands/generate.d.ts +0 -10
- package/dist/commands/generate.d.ts.map +0 -1
- package/dist/commands/generate.js +0 -8
- package/dist/commands/generate.js.map +0 -1
- package/dist/commands/oauth/audit/list.d.ts +0 -12
- package/dist/commands/oauth/audit/list.d.ts.map +0 -1
- package/dist/commands/oauth/audit/list.js +0 -20
- package/dist/commands/oauth/audit/list.js.map +0 -1
- package/dist/commands/oauth/client/create.d.ts +0 -13
- package/dist/commands/oauth/client/create.d.ts.map +0 -1
- package/dist/commands/oauth/client/create.js +0 -34
- package/dist/commands/oauth/client/create.js.map +0 -1
- package/dist/commands/oauth/client/list.d.ts +0 -9
- package/dist/commands/oauth/client/list.d.ts.map +0 -1
- package/dist/commands/oauth/client/list.js +0 -10
- package/dist/commands/oauth/client/list.js.map +0 -1
- package/dist/commands/oauth/client/revoke.d.ts +0 -12
- package/dist/commands/oauth/client/revoke.d.ts.map +0 -1
- package/dist/commands/oauth/client/revoke.js +0 -12
- package/dist/commands/oauth/client/revoke.js.map +0 -1
- package/dist/commands/oauth/client/rotate.d.ts +0 -13
- package/dist/commands/oauth/client/rotate.d.ts.map +0 -1
- package/dist/commands/oauth/client/rotate.js +0 -20
- package/dist/commands/oauth/client/rotate.js.map +0 -1
- package/dist/commands/oauth/client/update.d.ts +0 -15
- package/dist/commands/oauth/client/update.d.ts.map +0 -1
- package/dist/commands/oauth/client/update.js +0 -23
- package/dist/commands/oauth/client/update.js.map +0 -1
- package/dist/commands/oauth/runtime/rotate.d.ts +0 -12
- package/dist/commands/oauth/runtime/rotate.d.ts.map +0 -1
- package/dist/commands/oauth/runtime/rotate.js +0 -31
- package/dist/commands/oauth/runtime/rotate.js.map +0 -1
- package/dist/commands/oauth/runtime/status.d.ts +0 -10
- package/dist/commands/oauth/runtime/status.d.ts.map +0 -1
- package/dist/commands/oauth/runtime/status.js +0 -17
- package/dist/commands/oauth/runtime/status.js.map +0 -1
- package/dist/commands/promote.d.ts +0 -13
- package/dist/commands/promote.d.ts.map +0 -1
- package/dist/commands/promote.js +0 -9
- package/dist/commands/promote.js.map +0 -1
- package/dist/commands/secret/audit/list.d.ts +0 -14
- package/dist/commands/secret/audit/list.d.ts.map +0 -1
- package/dist/commands/secret/audit/list.js +0 -16
- package/dist/commands/secret/audit/list.js.map +0 -1
- package/dist/commands/secret/create.d.ts +0 -18
- package/dist/commands/secret/create.d.ts.map +0 -1
- package/dist/commands/secret/create.js +0 -33
- package/dist/commands/secret/create.js.map +0 -1
- package/dist/commands/secret/delete.d.ts +0 -15
- package/dist/commands/secret/delete.d.ts.map +0 -1
- package/dist/commands/secret/delete.js +0 -20
- package/dist/commands/secret/delete.js.map +0 -1
- package/dist/commands/secret/list.d.ts +0 -10
- package/dist/commands/secret/list.d.ts.map +0 -1
- package/dist/commands/secret/list.js +0 -14
- package/dist/commands/secret/list.js.map +0 -1
- package/dist/commands/secret/rotate.d.ts +0 -18
- package/dist/commands/secret/rotate.d.ts.map +0 -1
- package/dist/commands/secret/rotate.js +0 -30
- package/dist/commands/secret/rotate.js.map +0 -1
- package/dist/commands/secret/update.d.ts +0 -17
- package/dist/commands/secret/update.d.ts.map +0 -1
- package/dist/commands/secret/update.js +0 -37
- package/dist/commands/secret/update.js.map +0 -1
- package/dist/commands/skill/install.d.ts +0 -11
- package/dist/commands/skill/install.d.ts.map +0 -1
- package/dist/commands/skill/install.js +0 -52
- package/dist/commands/skill/install.js.map +0 -1
- package/dist/commands/skill/validate.d.ts +0 -9
- package/dist/commands/skill/validate.d.ts.map +0 -1
- package/dist/commands/skill/validate.js +0 -32
- package/dist/commands/skill/validate.js.map +0 -1
- package/dist/commands/test.d.ts +0 -9
- package/dist/commands/test.d.ts.map +0 -1
- package/dist/commands/test.js +0 -7
- package/dist/commands/test.js.map +0 -1
- package/dist/commands/workflow/provider/list.d.ts +0 -10
- package/dist/commands/workflow/provider/list.d.ts.map +0 -1
- package/dist/commands/workflow/provider/list.js +0 -14
- package/dist/commands/workflow/provider/list.js.map +0 -1
- package/dist/commands/workflow/provider/rotate.d.ts +0 -15
- package/dist/commands/workflow/provider/rotate.d.ts.map +0 -1
- package/dist/commands/workflow/provider/rotate.js +0 -24
- package/dist/commands/workflow/provider/rotate.js.map +0 -1
- package/dist/secret-value.d.ts +0 -5
- package/dist/secret-value.d.ts.map +0 -1
- package/dist/secret-value.js +0 -15
- package/dist/secret-value.js.map +0 -1
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom/client';
|
|
3
|
+
import {
|
|
4
|
+
defineApplicationContributions,
|
|
5
|
+
OpenXiangdaApplication,
|
|
6
|
+
type AdminNavigationInput,
|
|
7
|
+
type AdminPagesInput,
|
|
8
|
+
type StandardApplicationTodoCenterProps,
|
|
9
|
+
type StandardUserPageFrameProps,
|
|
10
|
+
type StandardUserSurfaceContributions,
|
|
11
|
+
} from 'openxiangda/react';
|
|
12
|
+
import { useParams, useSearchParams } from 'react-router-dom';
|
|
13
|
+
import { appCode } from '../../../packages/contracts/src/generated.js';
|
|
14
|
+
import 'openxiangda/react/styles.css';
|
|
15
|
+
|
|
16
|
+
const fixtureParams = new URLSearchParams(window.location.search);
|
|
17
|
+
const standardSurfaceMode = fixtureParams.get('surfaces');
|
|
18
|
+
|
|
19
|
+
const workflowDefinitions = [
|
|
20
|
+
{
|
|
21
|
+
code: 'purchase-approval',
|
|
22
|
+
title: '采购审批',
|
|
23
|
+
launch: { mode: 'standalone' },
|
|
24
|
+
subject: {
|
|
25
|
+
resourceCode: 'purchase-orders',
|
|
26
|
+
factProjection: { amount: 'amount' },
|
|
27
|
+
summaryFields: ['amount'],
|
|
28
|
+
},
|
|
29
|
+
processOperationCode: 'openxiangda.workflow.purchase-approval.submit',
|
|
30
|
+
},
|
|
31
|
+
] as const;
|
|
32
|
+
|
|
33
|
+
const resourceDefinitions = {
|
|
34
|
+
'purchase-orders': {
|
|
35
|
+
code: 'purchase-orders',
|
|
36
|
+
name: '采购申请',
|
|
37
|
+
capabilities: {
|
|
38
|
+
read: `app:${appCode}:data:purchase-orders:read`,
|
|
39
|
+
create: `app:${appCode}:data:purchase-orders:create`,
|
|
40
|
+
update: `app:${appCode}:data:purchase-orders:update`,
|
|
41
|
+
delete: `app:${appCode}:data:purchase-orders:delete`,
|
|
42
|
+
},
|
|
43
|
+
surface: {
|
|
44
|
+
mutationOwner: 'native',
|
|
45
|
+
generated: { list: true, detail: true, create: true, update: true, delete: true },
|
|
46
|
+
fields: {
|
|
47
|
+
amount: {
|
|
48
|
+
label: '申请金额',
|
|
49
|
+
type: 'number.decimal',
|
|
50
|
+
widget: 'money',
|
|
51
|
+
requiredHint: true,
|
|
52
|
+
readCapabilities: [`app:${appCode}:data:purchase-orders:read`],
|
|
53
|
+
createCapabilities: [`app:${appCode}:data:purchase-orders:create`],
|
|
54
|
+
updateCapabilities: [`app:${appCode}:data:purchase-orders:update`],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
form: { layout: 'flat', fieldOrder: ['amount'] },
|
|
58
|
+
mobile: { enabled: true },
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
} as const;
|
|
62
|
+
|
|
63
|
+
const detailRoutes = {
|
|
64
|
+
desktop: {
|
|
65
|
+
code: 'purchase-detail',
|
|
66
|
+
path: '/admin/operations/purchases/:instanceId',
|
|
67
|
+
label: '采购审批详情',
|
|
68
|
+
surface: 'admin',
|
|
69
|
+
tabPersistence: 'none',
|
|
70
|
+
keepAlive: 'none',
|
|
71
|
+
},
|
|
72
|
+
mobile: {
|
|
73
|
+
code: 'purchase-detail-mobile',
|
|
74
|
+
path: '/m/purchases/:instanceId',
|
|
75
|
+
label: '移动采购审批详情',
|
|
76
|
+
surface: 'user',
|
|
77
|
+
tabPersistence: 'none',
|
|
78
|
+
keepAlive: 'none',
|
|
79
|
+
},
|
|
80
|
+
} as const;
|
|
81
|
+
|
|
82
|
+
function CustomWorkflowDetail() {
|
|
83
|
+
const { instanceId } = useParams();
|
|
84
|
+
const [search] = useSearchParams();
|
|
85
|
+
return (
|
|
86
|
+
<div data-testid="custom-workflow-detail">
|
|
87
|
+
自定义流程详情 {instanceId} / {search.get('taskId') || 'instance'}
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function StandardFrame({
|
|
93
|
+
back,
|
|
94
|
+
canGoBack,
|
|
95
|
+
children,
|
|
96
|
+
device,
|
|
97
|
+
pageKind,
|
|
98
|
+
route,
|
|
99
|
+
}: StandardUserPageFrameProps) {
|
|
100
|
+
return (
|
|
101
|
+
<section
|
|
102
|
+
data-can-go-back={String(canGoBack)}
|
|
103
|
+
data-page-kind={pageKind}
|
|
104
|
+
data-route-code={route.routeCode}
|
|
105
|
+
data-route-params={JSON.stringify(route.params)}
|
|
106
|
+
data-testid={`standard-frame-${device}`}
|
|
107
|
+
>
|
|
108
|
+
<button onClick={back} type="button">返回</button>
|
|
109
|
+
{children}
|
|
110
|
+
</section>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function CustomTodo({
|
|
115
|
+
device,
|
|
116
|
+
error,
|
|
117
|
+
hasMore,
|
|
118
|
+
items,
|
|
119
|
+
loadMore,
|
|
120
|
+
loading,
|
|
121
|
+
loadingMore,
|
|
122
|
+
openItem,
|
|
123
|
+
query,
|
|
124
|
+
refresh,
|
|
125
|
+
setQuery,
|
|
126
|
+
}: StandardApplicationTodoCenterProps) {
|
|
127
|
+
return (
|
|
128
|
+
<main data-testid={`custom-todo-${device}`}>
|
|
129
|
+
<h1>{device === 'mobile' ? '移动应用待办' : '桌面应用待办'}</h1>
|
|
130
|
+
<output data-testid="custom-todo-query">
|
|
131
|
+
{query.view}/{String(query.unread)}/{query.keyword || 'all'}
|
|
132
|
+
</output>
|
|
133
|
+
{error ? <div role="alert">{error}</div> : null}
|
|
134
|
+
<button onClick={() => void refresh()} type="button">刷新待办</button>
|
|
135
|
+
<button
|
|
136
|
+
onClick={() => setQuery({ unread: !query.unread })}
|
|
137
|
+
type="button"
|
|
138
|
+
>
|
|
139
|
+
切换未读
|
|
140
|
+
</button>
|
|
141
|
+
<ul aria-busy={loading || loadingMore}>
|
|
142
|
+
{items.map(item => (
|
|
143
|
+
<li key={item.messageId}>
|
|
144
|
+
<button onClick={() => void openItem(item)} type="button">
|
|
145
|
+
{item.title}
|
|
146
|
+
</button>
|
|
147
|
+
</li>
|
|
148
|
+
))}
|
|
149
|
+
</ul>
|
|
150
|
+
<button
|
|
151
|
+
disabled={!hasMore || loadingMore}
|
|
152
|
+
onClick={() => void loadMore()}
|
|
153
|
+
type="button"
|
|
154
|
+
>
|
|
155
|
+
加载更多
|
|
156
|
+
</button>
|
|
157
|
+
</main>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function BrokenTodo(_props: StandardApplicationTodoCenterProps) {
|
|
162
|
+
throw new Error('fixture standard user renderer failure');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const standardUserSurfaces: StandardUserSurfaceContributions | undefined =
|
|
166
|
+
standardSurfaceMode
|
|
167
|
+
? {
|
|
168
|
+
frame: { desktop: StandardFrame, mobile: StandardFrame },
|
|
169
|
+
applicationTodoCenter: {
|
|
170
|
+
desktop:
|
|
171
|
+
standardSurfaceMode === 'error' ? BrokenTodo : CustomTodo,
|
|
172
|
+
mobile: standardSurfaceMode === 'error' ? BrokenTodo : CustomTodo,
|
|
173
|
+
},
|
|
174
|
+
}
|
|
175
|
+
: undefined;
|
|
176
|
+
|
|
177
|
+
const applicationContributions = defineApplicationContributions(detailRoutes, {
|
|
178
|
+
pages: {
|
|
179
|
+
desktop: CustomWorkflowDetail,
|
|
180
|
+
mobile: CustomWorkflowDetail,
|
|
181
|
+
},
|
|
182
|
+
...(standardUserSurfaces ? { standardUserSurfaces } : {}),
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
const adminPages = [] as const satisfies AdminPagesInput;
|
|
186
|
+
|
|
187
|
+
const routeManifest = {
|
|
188
|
+
schemaVersion: 'openxiangda.application-route-manifest/v3',
|
|
189
|
+
appCode,
|
|
190
|
+
devicePolicy: {
|
|
191
|
+
kind: 'viewport-family',
|
|
192
|
+
mobileMaxWidthPx: 900,
|
|
193
|
+
desktopMinWidthPx: 901,
|
|
194
|
+
},
|
|
195
|
+
rootEntry: { code: 'application-root', desktop: '/', mobile: '/m/' },
|
|
196
|
+
authentication: {
|
|
197
|
+
desktop: { routeCode: 'application-login', path: '/login' },
|
|
198
|
+
mobile: { routeCode: 'application-login-mobile', path: '/m/login' },
|
|
199
|
+
},
|
|
200
|
+
routes: [
|
|
201
|
+
{
|
|
202
|
+
code: 'application:todo-center',
|
|
203
|
+
kind: 'application-todo-center',
|
|
204
|
+
desktop: {
|
|
205
|
+
routeCode: 'application.todo-center.desktop',
|
|
206
|
+
path: '/todos',
|
|
207
|
+
surface: 'user',
|
|
208
|
+
pathParams: [],
|
|
209
|
+
requiresAuthentication: true,
|
|
210
|
+
},
|
|
211
|
+
mobile: {
|
|
212
|
+
routeCode: 'application.todo-center.mobile',
|
|
213
|
+
path: '/m/todos',
|
|
214
|
+
surface: 'user',
|
|
215
|
+
pathParams: [],
|
|
216
|
+
requiresAuthentication: true,
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
code: 'workflow:work-center',
|
|
221
|
+
kind: 'workflow-work-center',
|
|
222
|
+
desktop: {
|
|
223
|
+
routeCode: 'workflow.work.center.desktop',
|
|
224
|
+
path: '/work-center',
|
|
225
|
+
surface: 'user',
|
|
226
|
+
pathParams: [],
|
|
227
|
+
requiresAuthentication: true,
|
|
228
|
+
},
|
|
229
|
+
mobile: {
|
|
230
|
+
routeCode: 'workflow.work.center.mobile',
|
|
231
|
+
path: '/m/work-center',
|
|
232
|
+
surface: 'user',
|
|
233
|
+
pathParams: [],
|
|
234
|
+
requiresAuthentication: true,
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
code: 'workflow:task',
|
|
239
|
+
kind: 'workflow-task',
|
|
240
|
+
desktop: {
|
|
241
|
+
routeCode: 'workflow.task.desktop',
|
|
242
|
+
path: '/tasks/:taskId',
|
|
243
|
+
surface: 'user',
|
|
244
|
+
pathParams: ['taskId'],
|
|
245
|
+
requiresAuthentication: true,
|
|
246
|
+
},
|
|
247
|
+
mobile: {
|
|
248
|
+
routeCode: 'workflow.task.mobile',
|
|
249
|
+
path: '/m/tasks/:taskId',
|
|
250
|
+
surface: 'user',
|
|
251
|
+
pathParams: ['taskId'],
|
|
252
|
+
requiresAuthentication: true,
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
code: 'workflow:instance',
|
|
257
|
+
kind: 'workflow-instance',
|
|
258
|
+
desktop: {
|
|
259
|
+
routeCode: 'workflow.instance.desktop',
|
|
260
|
+
path: '/workflows/:instanceId',
|
|
261
|
+
surface: 'user',
|
|
262
|
+
pathParams: ['instanceId'],
|
|
263
|
+
requiresAuthentication: true,
|
|
264
|
+
},
|
|
265
|
+
mobile: {
|
|
266
|
+
routeCode: 'workflow.instance.mobile',
|
|
267
|
+
path: '/m/workflows/:instanceId',
|
|
268
|
+
surface: 'user',
|
|
269
|
+
pathParams: ['instanceId'],
|
|
270
|
+
requiresAuthentication: true,
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
code: 'workflow:purchase-approval:launch',
|
|
275
|
+
kind: 'workflow-launch',
|
|
276
|
+
workflowCode: 'purchase-approval',
|
|
277
|
+
desktop: {
|
|
278
|
+
routeCode: 'workflow.purchase-approval.launch.desktop',
|
|
279
|
+
path: '/workflows/:workflowCode/start',
|
|
280
|
+
surface: 'user',
|
|
281
|
+
pathParams: ['workflowCode'],
|
|
282
|
+
requiresAuthentication: true,
|
|
283
|
+
},
|
|
284
|
+
mobile: {
|
|
285
|
+
routeCode: 'workflow.purchase-approval.launch.mobile',
|
|
286
|
+
path: '/m/workflows/:workflowCode/start',
|
|
287
|
+
surface: 'user',
|
|
288
|
+
pathParams: ['workflowCode'],
|
|
289
|
+
requiresAuthentication: true,
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
],
|
|
293
|
+
digest: '34cc08a02cd187a07d9e2d2f99c1080b5b86f3a4512f9e0f43ff4cb05b7195fa',
|
|
294
|
+
} as const;
|
|
295
|
+
|
|
296
|
+
const adminNavigation = [] as const satisfies AdminNavigationInput;
|
|
297
|
+
|
|
298
|
+
const initialPath = fixtureParams.get('initial') || '/work-center';
|
|
299
|
+
const runtimeBase = fixtureParams.get('base')?.trim();
|
|
300
|
+
if (runtimeBase) {
|
|
301
|
+
for (const [name, content] of [
|
|
302
|
+
['openxiangda-runtime-base', runtimeBase],
|
|
303
|
+
['openxiangda-app-code', appCode],
|
|
304
|
+
['openxiangda-environment', 'preproduction'],
|
|
305
|
+
] as const) {
|
|
306
|
+
const meta =
|
|
307
|
+
document.querySelector<HTMLMetaElement>(`meta[name="${name}"]`) ||
|
|
308
|
+
document.createElement('meta');
|
|
309
|
+
meta.name = name;
|
|
310
|
+
meta.content = content;
|
|
311
|
+
if (!meta.parentElement) document.head.appendChild(meta);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
if (location.pathname.endsWith('/workflow-experience.e2e.html')) {
|
|
315
|
+
const stateToken = fixtureParams.get('state');
|
|
316
|
+
history.replaceState(
|
|
317
|
+
stateToken
|
|
318
|
+
? { usr: { routeNegotiationState: stateToken }, key: 'fixture-state' }
|
|
319
|
+
: {},
|
|
320
|
+
'',
|
|
321
|
+
initialPath,
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
326
|
+
<React.StrictMode>
|
|
327
|
+
<OpenXiangdaApplication
|
|
328
|
+
appCode={appCode}
|
|
329
|
+
appName="流程体验验收"
|
|
330
|
+
adminNavigation={adminNavigation}
|
|
331
|
+
adminPages={adminPages}
|
|
332
|
+
routeManifest={routeManifest}
|
|
333
|
+
contributions={applicationContributions}
|
|
334
|
+
resourceDefinitions={resourceDefinitions}
|
|
335
|
+
workflows={workflowDefinitions}
|
|
336
|
+
/>
|
|
337
|
+
</React.StrictMode>
|
|
338
|
+
);
|