@rytass/bpm-core-react 0.16.2 → 0.17.1
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/CHANGELOG.md +61 -0
- package/README.md +54 -6
- package/dist/chunks/admin-pickers-BRHk3qKq.cjs +2 -0
- package/dist/chunks/admin-pickers-BRHk3qKq.cjs.map +1 -0
- package/dist/chunks/{admin-pickers-DxhzECkD.js → admin-pickers-Djq3h-UR.js} +41 -39
- package/dist/chunks/admin-pickers-Djq3h-UR.js.map +1 -0
- package/dist/chunks/{categories-DjENouRm.cjs → categories-AxxhqjLZ.cjs} +2 -2
- package/dist/chunks/{categories-DjENouRm.cjs.map → categories-AxxhqjLZ.cjs.map} +1 -1
- package/dist/chunks/{categories-1gKxeEqw.js → categories-riC33J_j.js} +2 -2
- package/dist/chunks/{categories-1gKxeEqw.js.map → categories-riC33J_j.js.map} +1 -1
- package/dist/chunks/{compose-DUH9cQ-L.cjs → compose-B7TtrpQJ.cjs} +2 -2
- package/dist/chunks/{compose-DUH9cQ-L.cjs.map → compose-B7TtrpQJ.cjs.map} +1 -1
- package/dist/chunks/{compose-DO6n0NJi.js → compose-_pREPtfN.js} +2 -2
- package/dist/chunks/{compose-DO6n0NJi.js.map → compose-_pREPtfN.js.map} +1 -1
- package/dist/chunks/{delegations-BLzYnOae.cjs → delegations-V9HIe3_P.cjs} +2 -2
- package/dist/chunks/delegations-V9HIe3_P.cjs.map +1 -0
- package/dist/chunks/{delegations-_b4_xBit.js → delegations-xUt1tj8d.js} +2 -1
- package/dist/chunks/{delegations-_b4_xBit.js.map → delegations-xUt1tj8d.js.map} +1 -1
- package/dist/chunks/{designer-B-cfiob9.js → designer-BiywgNXs.js} +1003 -949
- package/dist/chunks/designer-BiywgNXs.js.map +1 -0
- package/dist/chunks/designer-ttAqv859.cjs +65 -0
- package/dist/chunks/designer-ttAqv859.cjs.map +1 -0
- package/dist/chunks/detail-DRCTnuKm.cjs +2 -0
- package/dist/chunks/detail-DRCTnuKm.cjs.map +1 -0
- package/dist/chunks/{detail-C6NdVijG.js → detail-DScLf42P.js} +183 -156
- package/dist/chunks/detail-DScLf42P.js.map +1 -0
- package/dist/chunks/orgs-C8usknWb.cjs +2 -0
- package/dist/chunks/orgs-C8usknWb.cjs.map +1 -0
- package/dist/chunks/{orgs-Bpp1U60k.js → orgs-Lg7tXv2u.js} +584 -544
- package/dist/chunks/orgs-Lg7tXv2u.js.map +1 -0
- package/dist/chunks/users-DRbuDYF1.js +422 -0
- package/dist/chunks/users-DRbuDYF1.js.map +1 -0
- package/dist/chunks/users-DVQicZIo.cjs +2 -0
- package/dist/chunks/users-DVQicZIo.cjs.map +1 -0
- package/dist/components/admin-pickers.d.cts +65 -0
- package/dist/components/approval-instance-list-page.d.cts +17 -0
- package/dist/components/bpm-form-field.d.cts +10 -0
- package/dist/components/bpm-notification-bell-button.d.cts +22 -0
- package/dist/components/dashboard-page.d.cts +7 -0
- package/dist/components/notification-drawer.d.cts +11 -0
- package/dist/components/org-unit-tree-draft-editor.d.cts +24 -0
- package/dist/components/org-unit-tree-draft-editor.d.ts +1 -1
- package/dist/components/pdf-preview.d.cts +12 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +15 -0
- package/dist/index.d.ts +15 -15
- package/dist/index.js +1 -1
- package/dist/lib/auth-provider.d.cts +37 -0
- package/dist/lib/format-date-time.d.cts +5 -0
- package/dist/lib/format-member-label.d.cts +12 -0
- package/dist/lib/member-profile-resolution.d.cts +48 -0
- package/dist/lib/notification-drawer-provider.d.cts +27 -0
- package/dist/lib/notification-unread-provider.d.cts +25 -0
- package/dist/lib/org-tree-draft.d.cts +27 -0
- package/dist/lib/providers.d.cts +31 -0
- package/dist/lib/router-adapter.d.cts +47 -0
- package/dist/lib/routes-config.d.cts +117 -0
- package/dist/lib/task-node-label.d.cts +10 -0
- package/dist/lib/use-bpm-logout.d.cts +12 -0
- package/dist/lib/use-bpm-member.d.cts +17 -0
- package/dist/next/BPMNextProviders.d.cts +51 -0
- package/dist/next/index.d.cts +2 -0
- package/dist/next/index.d.ts +2 -2
- package/dist/next/workflow-chat-route.d.cts +17 -0
- package/dist/pages/admin/delegations/index.cjs +1 -1
- package/dist/pages/admin/delegations/index.d.cts +4 -0
- package/dist/pages/admin/delegations/index.js +1 -1
- package/dist/pages/admin/orgs/index.cjs +1 -1
- package/dist/pages/admin/orgs/index.d.cts +4 -0
- package/dist/pages/admin/orgs/index.js +1 -1
- package/dist/pages/admin/users/index.cjs +1 -1
- package/dist/pages/admin/users/index.d.cts +4 -0
- package/dist/pages/admin/users/index.js +1 -1
- package/dist/pages/admin/webhook-endpoints/index.d.cts +4 -0
- package/dist/pages/cc/index.d.cts +16 -0
- package/dist/pages/dashboard/index.d.cts +16 -0
- package/dist/pages/delegations/index.d.cts +4 -0
- package/dist/pages/inbox/index.d.cts +16 -0
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.d.cts +23 -0
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/instances/new/index.d.cts +20 -0
- package/dist/pages/login/index.d.cts +21 -0
- package/dist/pages/root/index.d.cts +18 -0
- package/dist/pages/search/index.d.cts +16 -0
- package/dist/pages/sent/index.d.cts +16 -0
- package/dist/pages/settings/notifications/index.d.cts +4 -0
- package/dist/pages/templates/categories/index.cjs +1 -1
- package/dist/pages/templates/categories/index.d.cts +4 -0
- package/dist/pages/templates/categories/index.js +1 -1
- package/dist/pages/templates/compose/index.cjs +1 -1
- package/dist/pages/templates/compose/index.d.cts +25 -0
- package/dist/pages/templates/compose/index.js +1 -1
- package/dist/pages/templates/designer/index.cjs +1 -1
- package/dist/pages/templates/designer/index.d.cts +8 -0
- package/dist/pages/templates/designer/index.js +1 -1
- package/dist/pages/templates/index.d.cts +4 -0
- package/dist/pages/templates/versions/index.d.cts +8 -0
- package/dist/views/admin/delegations/AdminDelegationsView.d.cts +2 -0
- package/dist/views/admin/delegations/index.cjs +1 -1
- package/dist/views/admin/delegations/index.d.cts +1 -0
- package/dist/views/admin/delegations/index.d.ts +1 -1
- package/dist/views/admin/delegations/index.js +1 -1
- package/dist/views/admin/index.cjs +1 -1
- package/dist/views/admin/index.d.cts +4 -0
- package/dist/views/admin/index.d.ts +4 -4
- package/dist/views/admin/index.js +3 -3
- package/dist/views/admin/orgs/AdminOrgsView.d.cts +2 -0
- package/dist/views/admin/orgs/index.cjs +1 -1
- package/dist/views/admin/orgs/index.d.cts +1 -0
- package/dist/views/admin/orgs/index.d.ts +1 -1
- package/dist/views/admin/orgs/index.js +1 -1
- package/dist/views/admin/users/AdminUsersView.d.cts +2 -0
- package/dist/views/admin/users/MemberTaskReassignModal.d.cts +13 -0
- package/dist/views/admin/users/MemberTaskReassignModal.d.ts +13 -0
- package/dist/views/admin/users/index.cjs +1 -1
- package/dist/views/admin/users/index.d.cts +1 -0
- package/dist/views/admin/users/index.d.ts +1 -1
- package/dist/views/admin/users/index.js +1 -1
- package/dist/views/admin/webhook-endpoints/AdminWebhookEndpointsView.d.cts +8 -0
- package/dist/views/admin/webhook-endpoints/index.d.cts +1 -0
- package/dist/views/admin/webhook-endpoints/index.d.ts +1 -1
- package/dist/views/cc/CcView.d.cts +7 -0
- package/dist/views/cc/index.d.cts +1 -0
- package/dist/views/cc/index.d.ts +1 -1
- package/dist/views/dashboard/DashboardView.d.cts +7 -0
- package/dist/views/dashboard/index.d.cts +1 -0
- package/dist/views/dashboard/index.d.ts +1 -1
- package/dist/views/delegations/DelegationsView.d.cts +2 -0
- package/dist/views/delegations/index.d.cts +1 -0
- package/dist/views/delegations/index.d.ts +1 -1
- package/dist/views/forms/builder/FormBuilderView.d.cts +18 -0
- package/dist/views/forms/builder/index.d.cts +1 -0
- package/dist/views/forms/builder/index.d.ts +1 -1
- package/dist/views/forms/builder/json-code-editor.d.cts +11 -0
- package/dist/views/forms/renderer/FormRendererView.d.cts +24 -0
- package/dist/views/forms/renderer/FormRendererView.d.ts +1 -1
- package/dist/views/forms/renderer/form-data-source-field.d.cts +65 -0
- package/dist/views/forms/renderer/form-field-link.d.cts +16 -0
- package/dist/views/forms/renderer/index.d.cts +2 -0
- package/dist/views/forms/renderer/index.d.ts +2 -2
- package/dist/views/forms/renderer/member-field-options.d.cts +39 -0
- package/dist/views/forms/renderer/member-field.d.cts +21 -0
- package/dist/views/inbox/InboxView.d.cts +7 -0
- package/dist/views/inbox/index.d.cts +1 -0
- package/dist/views/inbox/index.d.ts +1 -1
- package/dist/views/instances/detail/InstanceDetailView.d.cts +27 -0
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.d.cts +7 -0
- package/dist/views/instances/detail/index.d.ts +7 -7
- package/dist/views/instances/detail/index.js +1 -1
- package/dist/views/instances/detail/sections/InstanceAttachmentsSection.d.cts +15 -0
- package/dist/views/instances/detail/sections/InstanceFormSection.d.cts +36 -0
- package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +1 -1
- package/dist/views/instances/detail/sections/InstanceHistorySection.d.cts +29 -0
- package/dist/views/instances/detail/sections/InstanceSignaturesSection.d.cts +14 -0
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +55 -0
- package/dist/views/instances/detail/sections/InstanceWebhookDeliveriesSection.d.cts +20 -0
- package/dist/views/instances/detail/sections/container-helpers.d.cts +10 -0
- package/dist/views/instances/detail/sections/container-helpers.d.ts +1 -1
- package/dist/views/instances/detail/sections/shared.d.cts +141 -0
- package/dist/views/instances/detail/submitted-by.d.cts +23 -0
- package/dist/views/instances/index.d.cts +1 -0
- package/dist/views/instances/index.d.ts +1 -1
- package/dist/views/instances/new/InstanceNewView.d.cts +15 -0
- package/dist/views/instances/new/index.d.cts +1 -0
- package/dist/views/instances/new/index.d.ts +1 -1
- package/dist/views/login/LoginView.d.cts +47 -0
- package/dist/views/login/index.d.cts +1 -0
- package/dist/views/login/index.d.ts +1 -1
- package/dist/views/root/RootView.d.cts +10 -0
- package/dist/views/root/index.d.cts +1 -0
- package/dist/views/root/index.d.ts +1 -1
- package/dist/views/search/SearchView.d.cts +7 -0
- package/dist/views/search/index.d.cts +1 -0
- package/dist/views/search/index.d.ts +1 -1
- package/dist/views/sent/SentView.d.cts +7 -0
- package/dist/views/sent/index.d.cts +1 -0
- package/dist/views/sent/index.d.ts +1 -1
- package/dist/views/settings/index.d.cts +1 -0
- package/dist/views/settings/index.d.ts +1 -1
- package/dist/views/settings/notifications/SettingsNotificationsView.d.cts +2 -0
- package/dist/views/settings/notifications/index.d.cts +1 -0
- package/dist/views/settings/notifications/index.d.ts +1 -1
- package/dist/views/templates/TemplatesView.d.cts +7 -0
- package/dist/views/templates/categories/TemplateCategoriesView.d.cts +2 -0
- package/dist/views/templates/categories/index.cjs +1 -1
- package/dist/views/templates/categories/index.d.cts +1 -0
- package/dist/views/templates/categories/index.d.ts +1 -1
- package/dist/views/templates/categories/index.js +1 -1
- package/dist/views/templates/compose/TemplateComposeWizardView.d.cts +21 -0
- package/dist/views/templates/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.d.cts +2 -0
- package/dist/views/templates/compose/index.d.ts +2 -2
- package/dist/views/templates/compose/index.js +1 -1
- package/dist/views/templates/compose/steps/ComposeFormStep.d.cts +15 -0
- package/dist/views/templates/compose/steps/ComposeReviewStep.d.cts +12 -0
- package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.cts +22 -0
- package/dist/views/templates/compose/use-template-compose-wizard.d.cts +46 -0
- package/dist/views/templates/designer/NotifyWebhookTargetsEditor.d.cts +20 -0
- package/dist/views/templates/designer/NotifyWebhookTargetsEditor.d.ts +1 -1
- package/dist/views/templates/designer/TemplateDesignerView.d.cts +65 -0
- package/dist/views/templates/designer/chrome-workflow-chat.d.cts +12 -0
- package/dist/views/templates/designer/chrome-workflow-chat.d.ts +1 -1
- package/dist/views/templates/designer/decision-policy-options.d.cts +8 -0
- package/dist/views/templates/designer/designer-version-labels.d.cts +12 -0
- package/dist/views/templates/designer/dry-run-assignee-label.d.cts +28 -0
- package/dist/views/templates/designer/dry-run-sample-data.d.cts +9 -0
- package/dist/views/templates/designer/dynamic-form-resolver-options.d.cts +35 -0
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.d.cts +1 -0
- package/dist/views/templates/designer/index.d.ts +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/dist/views/templates/designer/notify-webhook-designer.d.cts +74 -0
- package/dist/views/templates/designer/position-level-options.d.cts +17 -0
- package/dist/views/templates/designer/use-workflow-chat.d.cts +21 -0
- package/dist/views/templates/designer/use-workflow-chat.d.ts +1 -1
- package/dist/views/templates/designer/use-workflow-designer-controller.d.cts +41 -0
- package/dist/views/templates/designer/workflow-chat-drawer.d.cts +16 -0
- package/dist/views/templates/designer/workflow-chat-drawer.d.ts +1 -1
- package/dist/views/templates/index.cjs +1 -1
- package/dist/views/templates/index.d.cts +3 -0
- package/dist/views/templates/index.d.ts +3 -3
- package/dist/views/templates/index.js +1 -1
- package/dist/views/templates/versions/TemplateVersionsView.d.cts +5 -0
- package/dist/views/templates/versions/index.d.cts +1 -0
- package/dist/views/templates/versions/index.d.ts +1 -1
- package/dist/views/workflow/index.d.cts +4 -0
- package/dist/views/workflow/index.d.ts +4 -4
- package/package.json +387 -147
- package/dist/chunks/admin-pickers-DxhzECkD.js.map +0 -1
- package/dist/chunks/admin-pickers-qe3j--gX.cjs +0 -2
- package/dist/chunks/admin-pickers-qe3j--gX.cjs.map +0 -1
- package/dist/chunks/delegations-BLzYnOae.cjs.map +0 -1
- package/dist/chunks/designer-2YvjP_GU.cjs +0 -65
- package/dist/chunks/designer-2YvjP_GU.cjs.map +0 -1
- package/dist/chunks/designer-B-cfiob9.js.map +0 -1
- package/dist/chunks/detail-C6NdVijG.js.map +0 -1
- package/dist/chunks/detail-DKobK4Cg.cjs +0 -2
- package/dist/chunks/detail-DKobK4Cg.cjs.map +0 -1
- package/dist/chunks/orgs-Bpp1U60k.js.map +0 -1
- package/dist/chunks/orgs-ywaE1_02.cjs +0 -2
- package/dist/chunks/orgs-ywaE1_02.cjs.map +0 -1
- package/dist/chunks/users-BSVo_eNe.js +0 -215
- package/dist/chunks/users-BSVo_eNe.js.map +0 -1
- package/dist/chunks/users-DFSBTDMy.cjs +0 -2
- package/dist/chunks/users-DFSBTDMy.cjs.map +0 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ActivityLogRecord, ApprovalInstanceRecord, AttachmentRecord, MemberProfileRecord, SignatureRecord, SignatureVerificationRecord, TaskDecisionRecord, TaskRecord, WorkflowTokenRecord } from '@rytass/bpm-core-client/workflow';
|
|
2
|
+
import { WorkflowDefinition, WorkflowNode } from '@rytass/bpm-core-shared/workflow';
|
|
3
|
+
export type TaskRow = Readonly<Record<string, unknown> & TaskRecord & {
|
|
4
|
+
assigneeLabel: string;
|
|
5
|
+
key: string;
|
|
6
|
+
nodeLabel: string;
|
|
7
|
+
statusLabel: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type AttachmentRow = Readonly<Record<string, unknown> & {
|
|
10
|
+
attachment: AttachmentRecord;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
filename: string;
|
|
13
|
+
id: string;
|
|
14
|
+
key: string;
|
|
15
|
+
mimeType: string;
|
|
16
|
+
sizeLabel: string;
|
|
17
|
+
}>;
|
|
18
|
+
export type SignatureRow = Readonly<Record<string, unknown> & {
|
|
19
|
+
algorithm: string;
|
|
20
|
+
hashLabel: string;
|
|
21
|
+
key: string;
|
|
22
|
+
keyVersion: number;
|
|
23
|
+
signedAtLabel: string;
|
|
24
|
+
signerMemberId: string;
|
|
25
|
+
}>;
|
|
26
|
+
export type MemberOption = Readonly<{
|
|
27
|
+
email: string | null;
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}>;
|
|
31
|
+
export type ActivityStepDescriptionPart = Readonly<{
|
|
32
|
+
text: string;
|
|
33
|
+
type: 'text';
|
|
34
|
+
}> | Readonly<{
|
|
35
|
+
email: string | null;
|
|
36
|
+
label: string;
|
|
37
|
+
memberId: string | null;
|
|
38
|
+
prefix: string;
|
|
39
|
+
type: 'member';
|
|
40
|
+
}>
|
|
41
|
+
/**
|
|
42
|
+
* What an approver actually wrote. Kept apart from the `text` parts so the
|
|
43
|
+
* timeline can give it its own line instead of burying it mid-sentence
|
|
44
|
+
* between the node, the actor, the timestamp and the signature hash.
|
|
45
|
+
*/
|
|
46
|
+
| Readonly<{
|
|
47
|
+
label: string;
|
|
48
|
+
text: string;
|
|
49
|
+
tone: 'danger' | 'neutral';
|
|
50
|
+
type: 'comment';
|
|
51
|
+
}>;
|
|
52
|
+
export interface ActivityStepRecord {
|
|
53
|
+
readonly descriptionParts: readonly ActivityStepDescriptionPart[];
|
|
54
|
+
readonly error: boolean;
|
|
55
|
+
readonly forcePending?: boolean;
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly title: string;
|
|
58
|
+
}
|
|
59
|
+
interface DelegationChainStep {
|
|
60
|
+
readonly from: string;
|
|
61
|
+
readonly reason: string;
|
|
62
|
+
readonly ruleId: string | null;
|
|
63
|
+
readonly to: string;
|
|
64
|
+
}
|
|
65
|
+
export declare function readDelegationChain(value: string): readonly DelegationChainStep[];
|
|
66
|
+
export declare function readStringField(record: Readonly<Record<string, unknown>>, key: string): string | null;
|
|
67
|
+
export declare function readStringArrayField(record: Readonly<Record<string, unknown>>, key: string): readonly string[];
|
|
68
|
+
export declare function readNumberField(record: Readonly<Record<string, unknown>>, key: string): number | null;
|
|
69
|
+
export declare function isPresentText(value: string | null): value is string;
|
|
70
|
+
export declare function isRecord(value: unknown): value is Readonly<Record<string, unknown>>;
|
|
71
|
+
export declare function isPendingTask(task: TaskRecord): boolean;
|
|
72
|
+
export declare function readErrorMessage(error: unknown): string;
|
|
73
|
+
export declare function formatFileSize(sizeBytes: number): string;
|
|
74
|
+
export declare function readShortHash(hash: string): string;
|
|
75
|
+
export declare function readInstanceStateLabel(state: string): string;
|
|
76
|
+
export declare function readTaskStatusLabel(status: TaskRecord['status']): string;
|
|
77
|
+
export declare function readTaskDecisionActionLabel(action: string): string;
|
|
78
|
+
export declare function readNodeKindLabel(type: WorkflowNode['type']): string;
|
|
79
|
+
export declare function readNodeDisplayLabel(nodeId: string, workflow: WorkflowDefinition | null): string;
|
|
80
|
+
export declare function readMemberDisplayText(memberId: string | null, memberProfilesById: ReadonlyMap<string, MemberProfileRecord>): string;
|
|
81
|
+
export declare function readTaskAssigneeLabel(task: TaskRecord, memberProfilesById?: ReadonlyMap<string, MemberProfileRecord>): string;
|
|
82
|
+
export declare function canMemberActOnTask(task: TaskRecord, memberId: string | null): boolean;
|
|
83
|
+
export declare function readReturnTargetOptions(workflow: WorkflowDefinition, node: WorkflowNode): readonly {
|
|
84
|
+
readonly id: string;
|
|
85
|
+
readonly name: string;
|
|
86
|
+
}[];
|
|
87
|
+
export declare function readMemberOption(profile: MemberProfileRecord): MemberOption;
|
|
88
|
+
/**
|
|
89
|
+
* The target an ad-hoc directive is sent to, or the reason it cannot be built
|
|
90
|
+
* yet. Kept out of the component so the "which shape do we send" decision is
|
|
91
|
+
* testable on its own — it is the part that changed when the member picker
|
|
92
|
+
* went from one selection to many.
|
|
93
|
+
*/
|
|
94
|
+
export type AdhocTargetDraft = Readonly<{
|
|
95
|
+
target: Readonly<{
|
|
96
|
+
kind: 'MEMBER';
|
|
97
|
+
memberIds: readonly string[];
|
|
98
|
+
}> | Readonly<{
|
|
99
|
+
kind: 'WEBHOOK';
|
|
100
|
+
webhookUrl: string;
|
|
101
|
+
}>;
|
|
102
|
+
valid: true;
|
|
103
|
+
}> | Readonly<{
|
|
104
|
+
error: string;
|
|
105
|
+
valid: false;
|
|
106
|
+
}>;
|
|
107
|
+
export declare function readAdhocTargetDraft({ memberIds, useWebhookTarget, webhookUrl, }: {
|
|
108
|
+
readonly memberIds: readonly string[];
|
|
109
|
+
readonly useWebhookTarget: boolean;
|
|
110
|
+
readonly webhookUrl: string;
|
|
111
|
+
}): AdhocTargetDraft;
|
|
112
|
+
export declare function isPresentMemberOption(option: MemberOption | null): option is MemberOption;
|
|
113
|
+
export declare function readMemberOptionFromValue(value: unknown): MemberOption | null;
|
|
114
|
+
export declare function readUniqueMemberOption(searchText: string, options: readonly MemberOption[]): MemberOption | null;
|
|
115
|
+
export declare function readTextDescriptionPart(text: string | null): ActivityStepDescriptionPart | null;
|
|
116
|
+
export declare function readCommentDescriptionPart(label: string, text: string | null, tone?: 'danger' | 'neutral'): ActivityStepDescriptionPart | null;
|
|
117
|
+
export declare function readMemberDescriptionPart(prefix: string, memberId: string | null, memberProfilesById: ReadonlyMap<string, MemberProfileRecord>, fallbackLabel: string): ActivityStepDescriptionPart;
|
|
118
|
+
export declare function isActivityDescriptionPart(part: ActivityStepDescriptionPart | null): part is ActivityStepDescriptionPart;
|
|
119
|
+
export declare function readCurrentActivityStep(activitySteps: readonly ActivityStepRecord[]): number;
|
|
120
|
+
export declare function isUserMeaningfulActivity(activityLog: ActivityLogRecord): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Member ids that only appear inside the payload of the sequential-signing
|
|
123
|
+
* events, so the timeline can load their profiles and show names, not ids.
|
|
124
|
+
*/
|
|
125
|
+
export declare function readSequentialActivityPayloadMemberIds(activityLog: ActivityLogRecord): readonly string[];
|
|
126
|
+
export declare function readActivityEventLabel(eventType: string, payload: Readonly<Record<string, unknown>>): string;
|
|
127
|
+
export declare function readActivityPayload(activityLog: ActivityLogRecord): Readonly<Record<string, unknown>>;
|
|
128
|
+
export declare function isActivityError(activityLog: ActivityLogRecord, payload: Readonly<Record<string, unknown>>): boolean;
|
|
129
|
+
export declare function formatActivityDateTime(value: string): string;
|
|
130
|
+
export declare function readActivityDetailParts(activityLog: ActivityLogRecord, payload: Readonly<Record<string, unknown>>, workflow: WorkflowDefinition | null, taskDecisionsByTaskId: ReadonlyMap<string, TaskDecisionRecord>, signaturesById: ReadonlyMap<string, SignatureRecord>, signatureVerification: SignatureVerificationRecord | null, memberProfilesById: ReadonlyMap<string, MemberProfileRecord>): readonly ActivityStepDescriptionPart[];
|
|
131
|
+
export declare function isFutureTimelineNode(node: WorkflowNode, tasks: readonly TaskRecord[], tokens: readonly WorkflowTokenRecord[], instanceState: ApprovalInstanceRecord['state'], representedNodeIds: ReadonlySet<string>): boolean;
|
|
132
|
+
export declare function readFutureTimelineNodes(workflow: WorkflowDefinition, tasks: readonly TaskRecord[], tokens: readonly WorkflowTokenRecord[], instanceState: ApprovalInstanceRecord['state'], representedNodeIds: ReadonlySet<string>): readonly WorkflowNode[];
|
|
133
|
+
export declare function readFutureNodeStepTitle(node: WorkflowNode): string;
|
|
134
|
+
export declare function readActivityStepRecords(activityLogs: readonly ActivityLogRecord[], tasks: readonly TaskRecord[], tokens: readonly WorkflowTokenRecord[], workflow: WorkflowDefinition | null, instanceState: ApprovalInstanceRecord['state'], memberProfilesById: ReadonlyMap<string, MemberProfileRecord>, taskDecisionsByTaskId: ReadonlyMap<string, TaskDecisionRecord>, signaturesById: ReadonlyMap<string, SignatureRecord>, signatureVerification: SignatureVerificationRecord | null): ActivityStepRecord[];
|
|
135
|
+
type RuntimeTone = 'cancelled' | 'completed' | 'current' | 'neutral' | 'waiting';
|
|
136
|
+
export declare function readNodeRuntimeState(node: WorkflowNode, tasks: readonly TaskRecord[], tokens: readonly WorkflowTokenRecord[], instanceState: string): Readonly<{
|
|
137
|
+
secondaryLabel: string;
|
|
138
|
+
statusLabel: string;
|
|
139
|
+
tone: RuntimeTone;
|
|
140
|
+
}>;
|
|
141
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who filed an approval instance on someone's behalf.
|
|
3
|
+
*
|
|
4
|
+
* `submittedByMemberId` is `null` on rows written before the column existed
|
|
5
|
+
* and equals `initiatorMemberId` when the applicant submitted it themselves;
|
|
6
|
+
* only a different, non-empty value means somebody else filed it. This is the
|
|
7
|
+
* one place the detail page reads that rule.
|
|
8
|
+
*/
|
|
9
|
+
interface SubmittedByFields {
|
|
10
|
+
readonly initiatorMemberId: string | null | undefined;
|
|
11
|
+
readonly submittedByMemberId?: string | null;
|
|
12
|
+
}
|
|
13
|
+
interface NamedMember {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function readDistinctSubmitterMemberId({ initiatorMemberId, submittedByMemberId, }: SubmittedByFields): string | null;
|
|
17
|
+
/**
|
|
18
|
+
* 「由 {submitter} 代 {initiator} 送出」, or `null` when the applicant
|
|
19
|
+
* submitted it themselves. A member whose profile did not load shows by id,
|
|
20
|
+
* like every other member on the page.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readSubmittedOnBehalfLabel(fields: SubmittedByFields, memberProfilesById: ReadonlyMap<string, NamedMember>): string | null;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './new/index.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './new';
|
|
1
|
+
export * from './new/index.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export interface InstanceNewViewProps {
|
|
3
|
+
/**
|
|
4
|
+
* Optional template id pre-selected by the host. The Server Component
|
|
5
|
+
* page should read `?templateId=` from its `searchParams` and pass the
|
|
6
|
+
* value through this prop.
|
|
7
|
+
*/
|
|
8
|
+
readonly templateId?: string | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Framework-agnostic view for the BPM "發起簽核" launch page. Mechanical port
|
|
12
|
+
* of `apps/client/src/app/instances/new/page.tsx` — picks a launchable
|
|
13
|
+
* template and submits the launch form.
|
|
14
|
+
*/
|
|
15
|
+
export declare function InstanceNewView(props?: InstanceNewViewProps): ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InstanceNewView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './InstanceNewView';
|
|
1
|
+
export * from './InstanceNewView.js';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export interface LoginViewProps {
|
|
3
|
+
/**
|
|
4
|
+
* Logo image URL. Renders an inline `<img>` so the view stays framework
|
|
5
|
+
* agnostic (no `next/image` dependency). Defaults to
|
|
6
|
+
* `/rytass-logo.png` — host should serve a static asset at that path or
|
|
7
|
+
* override via this prop.
|
|
8
|
+
*/
|
|
9
|
+
readonly logoSrc?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Pre-fill the identifier input. Defaults to the seeded demo account
|
|
12
|
+
* email so the form is usable out of the box.
|
|
13
|
+
*/
|
|
14
|
+
readonly defaultIdentifier?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Pre-fill the password input. Defaults to the seeded demo password
|
|
17
|
+
* (`'demo'`). Production hosts should pass an empty string.
|
|
18
|
+
*/
|
|
19
|
+
readonly defaultPassword?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Custom redirect target after a successful login. Defaults to reading
|
|
22
|
+
* `?next=` from the host router's search params, falling back to `'/'`.
|
|
23
|
+
*/
|
|
24
|
+
readonly defaultNextPath?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Override the BPM admin brand title shown above the form. Defaults to
|
|
27
|
+
* `'BPM Admin'`.
|
|
28
|
+
*/
|
|
29
|
+
readonly brandTitle?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Override the brand subtitle shown above the form. Defaults to
|
|
32
|
+
* `'BPM API 登入'`.
|
|
33
|
+
*/
|
|
34
|
+
readonly brandSubtitle?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Login UI for the BPM admin host. Renders the brand mark, identifier /
|
|
38
|
+
* password fields, and a "test members" picker fed by
|
|
39
|
+
* `listApiTestMembers()`. Self-contained: composes Mezzanine UI primitives,
|
|
40
|
+
* reads the auth context, and uses the host router adapter to redirect on
|
|
41
|
+
* success.
|
|
42
|
+
*
|
|
43
|
+
* Wrap with `<AuthProvider>` (and indirectly `<RouterAdapterProvider>`)
|
|
44
|
+
* higher in the tree. The `pages/login` subpath ships a thin Next.js
|
|
45
|
+
* wrapper that exports `default` (Server Component) and `metadata`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function LoginView({ logoSrc, defaultIdentifier, defaultPassword, defaultNextPath, brandTitle, brandSubtitle, }?: LoginViewProps): ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LoginView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './LoginView';
|
|
1
|
+
export * from './LoginView.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Framework-agnostic placeholder for the BPM root path. Server-side redirect
|
|
4
|
+
* to `/dashboard` is the consumer's responsibility (Next.js `middleware.ts`
|
|
5
|
+
* or `app/page.tsx`). This view renders nothing so it can be safely mounted
|
|
6
|
+
* during the redirect flash.
|
|
7
|
+
*
|
|
8
|
+
* Mechanical port of `apps/client/src/app/page.tsx`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function RootView(): ReactElement | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RootView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './RootView';
|
|
1
|
+
export * from './RootView.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Framework-agnostic view for the BPM case search page — list of all
|
|
4
|
+
* instances the current member has visibility on. Mechanical port of
|
|
5
|
+
* `apps/client/src/app/search/page.tsx`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function SearchView(): ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SearchView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './SearchView';
|
|
1
|
+
export * from './SearchView.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Framework-agnostic view for the BPM "sent" inbox — instances the current
|
|
4
|
+
* member has initiated or submitted on someone's behalf. Mechanical port of
|
|
5
|
+
* `apps/client/src/app/sent/page.tsx`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function SentView(): ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SentView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './SentView';
|
|
1
|
+
export * from './SentView.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './notifications/index.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './notifications';
|
|
1
|
+
export * from './notifications/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SettingsNotificationsView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './SettingsNotificationsView';
|
|
1
|
+
export * from './SettingsNotificationsView.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/categories-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/categories-AxxhqjLZ.cjs");exports.TemplateCategoriesView=e.t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TemplateCategoriesView.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './TemplateCategoriesView';
|
|
1
|
+
export * from './TemplateCategoriesView.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as TemplateCategoriesView } from "../../../chunks/categories-
|
|
1
|
+
export { t as TemplateCategoriesView } from "../../../chunks/categories-riC33J_j.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export interface TemplateComposeWizardViewProps {
|
|
3
|
+
/**
|
|
4
|
+
* Show the workflow designer AI assistant inside Step 1 (流程設計). Opt-in,
|
|
5
|
+
* default hidden — the server page maps `BPM_AI_ASSISTANT_ENABLED` to it.
|
|
6
|
+
*/
|
|
7
|
+
readonly showAiAssistant?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the LLM backend is configured (host has an API key). When `false`
|
|
10
|
+
* the AI button shows disabled as a placeholder. Default `false`.
|
|
11
|
+
*/
|
|
12
|
+
readonly aiAssistantAvailable?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Unified "form + flow" template creation wizard. Walks the user through
|
|
16
|
+
* Step 0 表單設計 → Step 1 流程設計 → Step 2 檢視並發佈, then commits both
|
|
17
|
+
* sides atomically through `composeApprovalTemplateWithForm`. This is the
|
|
18
|
+
* template entry point; the form builder is intentionally controlled here
|
|
19
|
+
* instead of exposed as a standalone `/forms` page.
|
|
20
|
+
*/
|
|
21
|
+
export declare function TemplateComposeWizardView({ aiAssistantAvailable, showAiAssistant, }?: TemplateComposeWizardViewProps): ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/compose-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/compose-B7TtrpQJ.cjs");exports.EMPTY_COMPOSE_FORM_SCHEMA=e.n,exports.EMPTY_COMPOSE_FORM_UI_SCHEMA=e.r,exports.TemplateComposeWizardView=e.t,exports.useTemplateComposeWizard=e.i;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './TemplateComposeWizardView';
|
|
2
|
-
export * from './use-template-compose-wizard';
|
|
1
|
+
export * from './TemplateComposeWizardView.js';
|
|
2
|
+
export * from './use-template-compose-wizard.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as EMPTY_COMPOSE_FORM_SCHEMA, r as EMPTY_COMPOSE_FORM_UI_SCHEMA, t as TemplateComposeWizardView, i as useTemplateComposeWizard } from "../../../chunks/compose-
|
|
1
|
+
export { n as EMPTY_COMPOSE_FORM_SCHEMA, r as EMPTY_COMPOSE_FORM_UI_SCHEMA, t as TemplateComposeWizardView, i as useTemplateComposeWizard } from "../../../chunks/compose-_pREPtfN.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FormDefinitionSchema, FormUiSchema } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
export interface ComposeFormStepProps {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly categoryId: string | null;
|
|
6
|
+
readonly formSchema: FormDefinitionSchema;
|
|
7
|
+
readonly formUiSchema: FormUiSchema;
|
|
8
|
+
readonly onNameChange: (value: string) => void;
|
|
9
|
+
readonly onCategoryIdChange: (value: string | null) => void;
|
|
10
|
+
readonly onFormChange: (next: {
|
|
11
|
+
readonly schema: FormDefinitionSchema;
|
|
12
|
+
readonly uiSchema: FormUiSchema;
|
|
13
|
+
}) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function ComposeFormStep({ categoryId, formSchema, formUiSchema, name, onCategoryIdChange, onFormChange, onNameChange, }: ComposeFormStepProps): ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FormDefinitionSchema, FormUiSchema } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
export interface ComposeReviewStepProps {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly formSchema: FormDefinitionSchema;
|
|
7
|
+
readonly formUiSchema: FormUiSchema;
|
|
8
|
+
readonly workflowDefinition: WorkflowDefinition | null;
|
|
9
|
+
readonly initiatorPolicyCel: string | null;
|
|
10
|
+
readonly publishError: string | null;
|
|
11
|
+
}
|
|
12
|
+
export declare function ComposeReviewStep({ formSchema, formUiSchema, initiatorPolicyCel, name, publishError, workflowDefinition, }: ComposeReviewStepProps): ReactElement;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
export interface ComposeWorkflowStepProps {
|
|
5
|
+
readonly formSchema: FormDefinitionSchema;
|
|
6
|
+
readonly workflowDefinition: WorkflowDefinition | null;
|
|
7
|
+
readonly initiatorPolicyCel: string | null;
|
|
8
|
+
readonly onWorkflowChange: (definition: WorkflowDefinition) => void;
|
|
9
|
+
readonly onInitiatorPolicyChange: (cel: string | null) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Show the AI assistant button inside the embedded designer's side panel.
|
|
12
|
+
* Follows the same opt-in contract as the standalone designer page; default
|
|
13
|
+
* hidden. Wired up the stack from the server page's `BPM_AI_ASSISTANT_ENABLED`.
|
|
14
|
+
*/
|
|
15
|
+
readonly showAiAssistant?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the LLM backend is configured (host has an API key). When `false`
|
|
18
|
+
* the AI button shows disabled as a placeholder. Default `false`.
|
|
19
|
+
*/
|
|
20
|
+
readonly aiAssistantAvailable?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function ComposeWorkflowStep({ aiAssistantAvailable, formSchema, initiatorPolicyCel, onInitiatorPolicyChange, onWorkflowChange, showAiAssistant, workflowDefinition, }: ComposeWorkflowStepProps): ReactElement;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FormDefinitionSchema, FormUiSchema } from '@rytass/bpm-core-shared/form';
|
|
2
|
+
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
3
|
+
import { ComposeApprovalTemplateWithFormResult } from '@rytass/bpm-core-client/template';
|
|
4
|
+
export type ComposeWizardStep = 0 | 1 | 2;
|
|
5
|
+
export type ComposePublishPhase = 'error' | 'idle' | 'submitting' | 'success';
|
|
6
|
+
export declare const EMPTY_COMPOSE_FORM_SCHEMA: FormDefinitionSchema;
|
|
7
|
+
export declare const EMPTY_COMPOSE_FORM_UI_SCHEMA: FormUiSchema;
|
|
8
|
+
export interface TemplateComposeWizard {
|
|
9
|
+
readonly currentStep: ComposeWizardStep;
|
|
10
|
+
/**
|
|
11
|
+
* Single user-facing name. Persisted to both the template and the form
|
|
12
|
+
* (`templateName` / `formName`) at the `composeApprovalTemplateWithForm`
|
|
13
|
+
* boundary — the DB keeps two columns, the UI keeps one field.
|
|
14
|
+
*/
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly categoryId: string | null;
|
|
17
|
+
readonly formSchema: FormDefinitionSchema;
|
|
18
|
+
readonly formUiSchema: FormUiSchema;
|
|
19
|
+
readonly workflowDefinition: WorkflowDefinition | null;
|
|
20
|
+
readonly initiatorPolicyCel: string | null;
|
|
21
|
+
readonly publishPhase: ComposePublishPhase;
|
|
22
|
+
readonly publishError: string | null;
|
|
23
|
+
readonly canLeaveBasics: boolean;
|
|
24
|
+
readonly goToStep: (step: ComposeWizardStep) => void;
|
|
25
|
+
readonly goNext: () => void;
|
|
26
|
+
readonly goBack: () => void;
|
|
27
|
+
readonly setName: (value: string) => void;
|
|
28
|
+
readonly setCategoryId: (value: string | null) => void;
|
|
29
|
+
readonly setFormValue: (next: {
|
|
30
|
+
readonly schema: FormDefinitionSchema;
|
|
31
|
+
readonly uiSchema: FormUiSchema;
|
|
32
|
+
}) => void;
|
|
33
|
+
readonly setWorkflowDefinition: (definition: WorkflowDefinition) => void;
|
|
34
|
+
readonly setInitiatorPolicyCel: (cel: string | null) => void;
|
|
35
|
+
readonly publish: () => Promise<ComposeApprovalTemplateWithFormResult | null>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Owns the cross-step state for the unified "form + flow" template wizard.
|
|
39
|
+
*
|
|
40
|
+
* Step 0 (表單) edits `formSchema`/`formUiSchema`; that same in-memory schema
|
|
41
|
+
* feeds Step 1 (流程) as the field source for condition branches, so the
|
|
42
|
+
* embedded designer never needs a published form version. Step 2 (檢視發佈)
|
|
43
|
+
* submits everything through the atomic `composeApprovalTemplateWithForm`
|
|
44
|
+
* mutation.
|
|
45
|
+
*/
|
|
46
|
+
export declare function useTemplateComposeWizard(): TemplateComposeWizard;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FormFieldDefinition } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
import { NotifyWebhookTarget } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
import { NotifyWebhookDesignerEndpoint } from './notify-webhook-designer.cjs';
|
|
5
|
+
export type NotifyWebhookCatalogState = 'loading' | 'ready' | 'unavailable';
|
|
6
|
+
export interface NotifyWebhookTargetsEditorProps {
|
|
7
|
+
/** Every endpoint the catalog lists, deprecated ones included. */
|
|
8
|
+
readonly catalog: readonly NotifyWebhookDesignerEndpoint[];
|
|
9
|
+
readonly catalogState: NotifyWebhookCatalogState;
|
|
10
|
+
/** `null` when no form is bound yet, so fields cannot be picked. */
|
|
11
|
+
readonly formFields: readonly FormFieldDefinition[] | null;
|
|
12
|
+
readonly onChange: (targets: readonly NotifyWebhookTarget[]) => void;
|
|
13
|
+
readonly targets: readonly NotifyWebhookTarget[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Edits a NOTIFY node's webhook targets (ADR 18 §3.3). Parameters come from
|
|
17
|
+
* the endpoint catalog, so the author only picks an endpoint and binds each
|
|
18
|
+
* parameter; a URL, header or secret is never shown or entered here.
|
|
19
|
+
*/
|
|
20
|
+
export declare function NotifyWebhookTargetsEditor({ catalog, catalogState, formFields, onChange, targets, }: NotifyWebhookTargetsEditorProps): ReactElement | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { FormFieldDefinition } from '@rytass/bpm-core-shared/form';
|
|
3
3
|
import { NotifyWebhookTarget } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
-
import { NotifyWebhookDesignerEndpoint } from './notify-webhook-designer';
|
|
4
|
+
import { NotifyWebhookDesignerEndpoint } from './notify-webhook-designer.js';
|
|
5
5
|
export type NotifyWebhookCatalogState = 'loading' | 'ready' | 'unavailable';
|
|
6
6
|
export interface NotifyWebhookTargetsEditorProps {
|
|
7
7
|
/** Every endpoint the catalog lists, deprecated ones included. */
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
export interface TemplateDesignerViewProps {
|
|
5
|
+
/**
|
|
6
|
+
* Template id to load. Required in non-embedded mode; unused in embedded mode.
|
|
7
|
+
*/
|
|
8
|
+
readonly templateId?: string;
|
|
9
|
+
/**
|
|
10
|
+
* When `true`, the component operates in embedded / wizard mode:
|
|
11
|
+
* - No `readTemplateDesigner` call (no templateId needed).
|
|
12
|
+
* - Only org data is loaded for approver pickers.
|
|
13
|
+
* - PageHeader / ContentHeader, form-version binding, and dry-run are hidden.
|
|
14
|
+
* - The AI assistant, when `showAiAssistant` is set, is offered through a
|
|
15
|
+
* button in the side "流程工具" panel (the PageHeader button it normally
|
|
16
|
+
* lives in is hidden here), and drives the same embedded canvas.
|
|
17
|
+
* - Mutations flow out via `onWorkflowChange` / `onInitiatorPolicyChange`
|
|
18
|
+
* rather than save-draft / publish actions.
|
|
19
|
+
* Default `false`.
|
|
20
|
+
*/
|
|
21
|
+
readonly embedded?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* In embedded mode: the formSchema used for condition-edge compilation,
|
|
24
|
+
* injected from outside (e.g. the wizard already knows the form). Replaces
|
|
25
|
+
* the "bind form version" picker. Pass `null` to clear.
|
|
26
|
+
*/
|
|
27
|
+
readonly formSchemaOverride?: FormDefinitionSchema | null;
|
|
28
|
+
/**
|
|
29
|
+
* In embedded mode: the initial workflow definition to seed the canvas.
|
|
30
|
+
* Falls back to an empty start→end workflow when omitted.
|
|
31
|
+
*/
|
|
32
|
+
readonly initialWorkflowDefinition?: WorkflowDefinition;
|
|
33
|
+
/**
|
|
34
|
+
* In embedded mode: the initial initiator-policy CEL expression.
|
|
35
|
+
* Falls back to `null` (no policy) when omitted.
|
|
36
|
+
*/
|
|
37
|
+
readonly initialInitiatorPolicyCel?: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* In embedded mode: called whenever the workflow definition changes so the
|
|
40
|
+
* host can persist the current canvas state.
|
|
41
|
+
*/
|
|
42
|
+
readonly onWorkflowChange?: (definition: WorkflowDefinition) => void;
|
|
43
|
+
/**
|
|
44
|
+
* In embedded mode: called whenever the initiator-policy CEL changes.
|
|
45
|
+
*/
|
|
46
|
+
readonly onInitiatorPolicyChange?: (cel: string | null) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Render the "試跑流程" (dry-run) button at all. Default `true`. Hosts can
|
|
49
|
+
* pass `false` to hide it (e.g. deployments that don't expose dry-run).
|
|
50
|
+
* Has no effect in embedded mode, where the PageHeader is hidden entirely.
|
|
51
|
+
*/
|
|
52
|
+
readonly showDryRun?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Render the AI assistant toggle at all. Default `false` — the feature is
|
|
55
|
+
* hidden unless the host opts in (e.g. a deployment that has it configured).
|
|
56
|
+
*/
|
|
57
|
+
readonly showAiAssistant?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the LLM backend is configured (e.g. the host has an API key set).
|
|
60
|
+
* Default `true`. When `false`, the toggle is shown but disabled and labelled
|
|
61
|
+
* as not configured — a placeholder rather than a broken feature.
|
|
62
|
+
*/
|
|
63
|
+
readonly aiAssistantAvailable?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export declare function TemplateDesignerView({ aiAssistantAvailable, embedded, formSchemaOverride, initialInitiatorPolicyCel, initialWorkflowDefinition, onInitiatorPolicyChange, onWorkflowChange, showAiAssistant, showDryRun, templateId, }: TemplateDesignerViewProps): ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UIMessage } from 'ai';
|
|
2
|
+
import { WorkflowDesignerController } from './use-workflow-designer-controller.cjs';
|
|
3
|
+
export interface UseChromeWorkflowChatResult {
|
|
4
|
+
/** True only when the on-device model is usable in this browser. */
|
|
5
|
+
readonly available: boolean;
|
|
6
|
+
readonly messages: readonly UIMessage[];
|
|
7
|
+
readonly status: 'ready' | 'submitted' | 'streaming' | 'error';
|
|
8
|
+
readonly send: (text: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function useChromeWorkflowChat({ controller, }: {
|
|
11
|
+
readonly controller: WorkflowDesignerController;
|
|
12
|
+
}): UseChromeWorkflowChatResult;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UIMessage } from 'ai';
|
|
2
|
-
import { WorkflowDesignerController } from './use-workflow-designer-controller';
|
|
2
|
+
import { WorkflowDesignerController } from './use-workflow-designer-controller.js';
|
|
3
3
|
export interface UseChromeWorkflowChatResult {
|
|
4
4
|
/** True only when the on-device model is usable in this browser. */
|
|
5
5
|
readonly available: boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DecisionPolicy } from '@rytass/bpm-core-shared/workflow';
|
|
2
|
+
export type DecisionPolicyOption = Readonly<{
|
|
3
|
+
id: DecisionPolicy['type'];
|
|
4
|
+
name: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const DECISION_POLICY_OPTIONS: readonly DecisionPolicyOption[];
|
|
7
|
+
export declare function readDecisionPolicyHint(policy: DecisionPolicy | undefined): string;
|
|
8
|
+
export declare function readDecisionPolicyOption(type: DecisionPolicy['type']): DecisionPolicyOption;
|