@blue-repository/types 0.11.0 → 0.12.0
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 +1 -1
- package/dist/meta.d.ts +2 -2
- package/dist/meta.d.ts.map +1 -1
- package/dist/meta.js +1 -0
- package/dist/meta.js.map +1 -1
- package/dist/packages/conversation/blue-ids.d.ts +7 -7
- package/dist/packages/conversation/blue-ids.js +7 -7
- package/dist/packages/conversation/contents/AcceptChangeWorkflow.d.ts +1 -1
- package/dist/packages/conversation/contents/AcceptChangeWorkflow.js +1 -1
- package/dist/packages/conversation/contents/AcceptChangeWorkflow.js.map +1 -1
- package/dist/packages/conversation/contents/ChangeOperation.d.ts +1 -1
- package/dist/packages/conversation/contents/ChangeOperation.js +1 -1
- package/dist/packages/conversation/contents/ChangeRequest.d.ts +8 -8
- package/dist/packages/conversation/contents/ChangeRequest.js +8 -8
- package/dist/packages/conversation/contents/ChangeRequest.js.map +1 -1
- package/dist/packages/conversation/contents/ChangeWorkflow.d.ts +2 -2
- package/dist/packages/conversation/contents/ChangeWorkflow.js +2 -2
- package/dist/packages/conversation/contents/ChangeWorkflow.js.map +1 -1
- package/dist/packages/conversation/contents/ProposeChangeOperation.d.ts +1 -1
- package/dist/packages/conversation/contents/ProposeChangeOperation.js +1 -1
- package/dist/packages/conversation/contents/ProposeChangeWorkflow.d.ts +2 -2
- package/dist/packages/conversation/contents/ProposeChangeWorkflow.js +2 -2
- package/dist/packages/conversation/contents/ProposeChangeWorkflow.js.map +1 -1
- package/dist/packages/conversation/contents/RejectChangeWorkflow.d.ts +1 -1
- package/dist/packages/conversation/contents/RejectChangeWorkflow.js +1 -1
- package/dist/packages/conversation/contents/RejectChangeWorkflow.js.map +1 -1
- package/dist/packages/conversation/contents/index.d.ts +206 -206
- package/dist/packages/conversation/contents/index.d.ts.map +1 -1
- package/dist/packages/conversation/contents/index.js +21 -21
- package/dist/packages/conversation/contents/index.js.map +1 -1
- package/dist/packages/conversation/index.d.ts +257 -257
- package/dist/packages/conversation/meta.d.ts +28 -28
- package/dist/packages/conversation/meta.js +21 -21
- package/dist/packages/conversation/meta.js.map +1 -1
- package/dist/packages/conversation/schemas/ChangeOperation.d.ts +5 -5
- package/dist/packages/conversation/schemas/ChangeRequest.d.ts +3 -3
- package/dist/packages/conversation/schemas/ChangeRequest.js +1 -1
- package/dist/packages/conversation/schemas/ChangeRequest.js.map +1 -1
- package/dist/packages/conversation/schemas/ChangeWorkflow.d.ts +5 -5
- package/dist/packages/conversation/schemas/ProposeChangeOperation.d.ts +5 -5
- package/dist/packages/conversation/schemas/ProposeChangeWorkflow.d.ts +5 -5
- package/dist/packages/conversation/schemas/index.d.ts +30 -30
- package/dist/packages/conversation/schemas/index.js +7 -7
- package/dist/packages/conversation/schemas/index.js.map +1 -1
- package/dist/repository.d.ts +258 -258
- package/package.json +2 -2
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
export { DocumentBootstrapResponded } from './DocumentBootstrapResponded.js';
|
|
2
|
+
export { AcceptChangeWorkflow } from './AcceptChangeWorkflow.js';
|
|
2
3
|
export { TriggerEvent } from './TriggerEvent.js';
|
|
3
|
-
export {
|
|
4
|
+
export { ChangeWorkflow } from './ChangeWorkflow.js';
|
|
4
5
|
export { Response } from './Response.js';
|
|
5
6
|
export { Timeline } from './Timeline.js';
|
|
6
7
|
export { RejectChangeOperation } from './RejectChangeOperation.js';
|
|
7
8
|
export { StatusInProgress } from './StatusInProgress.js';
|
|
8
9
|
export { DocumentStatus } from './DocumentStatus.js';
|
|
10
|
+
export { ProposeChangeWorkflow } from './ProposeChangeWorkflow.js';
|
|
9
11
|
export { Event } from './Event.js';
|
|
10
12
|
export { LifecycleEvent } from './LifecycleEvent.js';
|
|
11
13
|
export { ContractsChangePolicy } from './ContractsChangePolicy.js';
|
|
14
|
+
export { ChangeRequest } from './ChangeRequest.js';
|
|
12
15
|
export { CustomerConsent } from './CustomerConsent.js';
|
|
13
16
|
export { DocumentBootstrapRequested } from './DocumentBootstrapRequested.js';
|
|
14
17
|
export { SequentialWorkflow } from './SequentialWorkflow.js';
|
|
15
18
|
export { InformUserAboutPendingAction } from './InformUserAboutPendingAction.js';
|
|
16
19
|
export { Request } from './Request.js';
|
|
20
|
+
export { RejectChangeWorkflow } from './RejectChangeWorkflow.js';
|
|
17
21
|
export { CustomerConsentRevoked } from './CustomerConsentRevoked.js';
|
|
18
|
-
export { ChangeRequest } from './ChangeRequest.js';
|
|
19
22
|
export { DocumentSectionChangeEntry } from './DocumentSectionChangeEntry.js';
|
|
23
|
+
export { ChangeOperation } from './ChangeOperation.js';
|
|
20
24
|
export { CustomerActionRequested } from './CustomerActionRequested.js';
|
|
21
|
-
export { ChangeWorkflow } from './ChangeWorkflow.js';
|
|
22
25
|
export { ChatMessage } from './ChatMessage.js';
|
|
23
26
|
export { AcceptChangeOperation } from './AcceptChangeOperation.js';
|
|
24
27
|
export { DocumentBootstrapFailed } from './DocumentBootstrapFailed.js';
|
|
25
28
|
export { Operation } from './Operation.js';
|
|
26
|
-
export { ChangeOperation } from './ChangeOperation.js';
|
|
27
29
|
export { StatusChange } from './StatusChange.js';
|
|
28
30
|
export { SequentialWorkflowOperation } from './SequentialWorkflowOperation.js';
|
|
29
31
|
export { Actor } from './Actor.js';
|
|
30
32
|
export { DocumentSectionChanges } from './DocumentSectionChanges.js';
|
|
31
33
|
export { ProposedChangeInvalid } from './ProposedChangeInvalid.js';
|
|
32
|
-
export { ProposeChangeWorkflow } from './ProposeChangeWorkflow.js';
|
|
33
34
|
export { StatusCompleted } from './StatusCompleted.js';
|
|
34
35
|
export { StatusPending } from './StatusPending.js';
|
|
35
36
|
export { TimelineChannel } from './TimelineChannel.js';
|
|
36
37
|
export { JavaScriptCode } from './JavaScriptCode.js';
|
|
37
38
|
export { TimelineEntry } from './TimelineEntry.js';
|
|
38
39
|
export { UpdateDocument } from './UpdateDocument.js';
|
|
39
|
-
export { AcceptChangeWorkflow } from './AcceptChangeWorkflow.js';
|
|
40
|
-
export { RejectChangeWorkflow } from './RejectChangeWorkflow.js';
|
|
41
40
|
export { StatusFailed } from './StatusFailed.js';
|
|
41
|
+
export { ProposeChangeOperation } from './ProposeChangeOperation.js';
|
|
42
42
|
export { DocumentBootstrapCompleted } from './DocumentBootstrapCompleted.js';
|
|
43
43
|
export { OperationRequest } from './OperationRequest.js';
|
|
44
44
|
export { CompositeTimelineChannel } from './CompositeTimelineChannel.js';
|
|
@@ -64,6 +64,44 @@ export declare const contents: {
|
|
|
64
64
|
readonly blueId: "36epvrpVHZLjapbeZsNodz2NDnm7XZeNZcnkWHgkP1pp";
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
|
+
readonly '29xcoYKf9p47xagTDwGLuQyFrT9WBN3Sd7FaPtqLvydy': {
|
|
68
|
+
readonly description: "Applies a previously proposed change and removes its proposal state.";
|
|
69
|
+
readonly name: "Accept Change Workflow";
|
|
70
|
+
readonly postfix: {
|
|
71
|
+
readonly description: "Optional postfix used while building proposed change state key.";
|
|
72
|
+
readonly type: {
|
|
73
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
readonly steps: {
|
|
77
|
+
readonly items: readonly [{
|
|
78
|
+
readonly code: {
|
|
79
|
+
readonly type: {
|
|
80
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
81
|
+
};
|
|
82
|
+
readonly value: "const invalid = (reason) => ({\n changeset: [],\n events: [{ type: 'Conversation/Proposed Change Invalid', reason }]\n});\n\nconst isArray = Array.isArray;\n\nconst postfixValue = currentContract?.postfix || '';\nconst proposedPath = '/proposedChange' + postfixValue;\n\nconst change = document(proposedPath);\nif (!change) {\n return invalid('no proposed change at ' + proposedPath);\n}\n\nconst requestChangeset = isArray(change?.changeset) ? change.changeset : [];\nconst sectionChanges = change.sectionChanges;\n\nconst entryPath = (entry) => `${entry?.path || ''}`;\nconst isContractsPath = (p) => p === '/contracts' || p.startsWith('/contracts/');\nconst isProposedChangePath = (p) => p.startsWith('/proposedChange');\n\nconst contracts = document('/contracts') || {};\nconst policy = Object.values(contracts).find((c) => c?.requireSectionChanges !== undefined);\nconst policyEnabled = !!policy && policy.requireSectionChanges !== false;\n\nif (\n policyEnabled &&\n requestChangeset.some((e) => isContractsPath(entryPath(e)))\n) {\n return invalid('changeset cannot modify /contracts when Contracts Change Policy is enabled');\n}\n\nif (requestChangeset.some((e) => isProposedChangePath(entryPath(e)))) {\n return invalid('changeset cannot modify /proposedChange');\n}\n\nconst escapePointer = (value) =>\n `${value}`.split('~').join('~0').split('/').join('~1');\n\nconst contractPtr = (key) => '/contracts/' + escapePointer(key);\n\nconst isMetaKey = (key) =>\n key === 'type' || key === 'keyType' || key === 'valueType' || key === 'description';\n\nconst contractKeysFromMap = (contractsMap) =>\n Object.keys(contractsMap || {}).filter((k) => !isMetaKey(k));\n\nconst normalizeSection = (section, contractKeys) => ({\n ...(section || {}),\n type: 'Conversation/Document Section',\n relatedContracts: (section?.relatedContracts?.length ? section.relatedContracts : contractKeys)\n});\n\nconst hasMatchingRelatedContracts = (section, contractKeys) => {\n const related = isArray(section?.relatedContracts)\n ? section.relatedContracts.map((value) => `${value}`)\n : [];\n if (!related.length) {\n return true;\n }\n if (related.length !== contractKeys.length) {\n return false;\n }\n const relatedMap = {};\n for (const value of related) {\n const key = `${value}`;\n relatedMap[key] = (relatedMap[key] || 0) + 1;\n }\n if (Object.keys(relatedMap).length !== contractKeys.length) {\n return false;\n }\n for (const key of contractKeys) {\n if (!relatedMap[key]) {\n return false;\n }\n }\n return true;\n};\n\nconst sectionChangeset = [];\nconst seenSectionKeys = {};\nconst seenContractKeys = {};\nconst existingContractKeys = {};\nfor (const key of Object.keys(contracts || {}).filter((k) => !isMetaKey(k))) {\n existingContractKeys[key] = true;\n}\n\nconst trackSectionKey = (sectionKey) => {\n if (seenSectionKeys[sectionKey]) {\n return invalid(`section key duplicated in sectionChanges: ${sectionKey}`);\n }\n seenSectionKeys[sectionKey] = true;\n return null;\n};\n\nconst trackContractKey = (sectionKey, contractKey) => {\n const existingSection = seenContractKeys[contractKey];\n if (existingSection && existingSection !== sectionKey) {\n return invalid(`contract key used by multiple sections in request: ${contractKey}`);\n }\n seenContractKeys[contractKey] = sectionKey;\n return null;\n};\n\nconst addList = isArray(sectionChanges?.add) ? sectionChanges.add : [];\nfor (const entry of addList) {\n const sectionKey = `${entry?.sectionKey || ''}`;\n if (!sectionKey) return invalid('sectionChanges.add is missing sectionKey');\n\n const sectionKeyDup = trackSectionKey(sectionKey);\n if (sectionKeyDup) return sectionKeyDup;\n\n if (existingContractKeys[sectionKey]) {\n return invalid(`contract key already exists at ${contractPtr(sectionKey)}`);\n }\n\n const contractsMap = entry?.contracts || {};\n const contractKeys = contractKeysFromMap(contractsMap).map((key) => `${key}`);\n\n if (!hasMatchingRelatedContracts(entry?.section, contractKeys)) {\n return invalid('relatedContracts must match contracts');\n }\n\n for (const key of contractKeys) {\n if (existingContractKeys[key]) {\n return invalid(`contract key already exists at ${contractPtr(key)}`);\n }\n const dup = trackContractKey(sectionKey, key);\n if (dup) return dup;\n }\n\n for (const key of contractKeys) {\n sectionChangeset.push({ op: 'add', path: contractPtr(key), val: contractsMap[key] });\n }\n\n sectionChangeset.push({\n op: 'add',\n path: contractPtr(sectionKey),\n val: normalizeSection(entry?.section, contractKeys)\n });\n}\n\nconst modifyList = isArray(sectionChanges?.modify) ? sectionChanges.modify : [];\nfor (const entry of modifyList) {\n const sectionKey = `${entry?.sectionKey || ''}`;\n if (!sectionKey) return invalid('sectionChanges.modify is missing sectionKey');\n\n const sectionKeyDup = trackSectionKey(sectionKey);\n if (sectionKeyDup) return sectionKeyDup;\n\n const existingRelated = isArray(contracts?.[sectionKey]?.relatedContracts)\n ? contracts[sectionKey].relatedContracts.map((value) => `${value}`)\n : [];\n const existingRelatedMap = {};\n for (const value of existingRelated) {\n existingRelatedMap[`${value}`] = true;\n }\n\n const contractsMap = entry?.contracts || {};\n const contractKeys = contractKeysFromMap(contractsMap).map((key) => `${key}`);\n\n if (!hasMatchingRelatedContracts(entry?.section, contractKeys)) {\n return invalid('relatedContracts must match contracts');\n }\n\n for (const key of contractKeys) {\n const dup = trackContractKey(sectionKey, key);\n if (dup) return dup;\n if (existingContractKeys[key] && !existingRelatedMap[key]) {\n return invalid(`contract key already exists at ${contractPtr(key)}`);\n }\n }\n\n for (const key of contractKeys) {\n sectionChangeset.push({ op: 'add', path: contractPtr(key), val: contractsMap[key] });\n }\n\n for (const oldKey of existingRelated) {\n if (contractKeys.indexOf(oldKey) === -1) {\n sectionChangeset.push({ op: 'remove', path: contractPtr(oldKey) });\n }\n }\n\n sectionChangeset.push({\n op: 'add',\n path: contractPtr(sectionKey),\n val: normalizeSection(entry?.section, contractKeys)\n });\n}\n\nconst removeList = isArray(sectionChanges?.remove) ? sectionChanges.remove : [];\nfor (const entry of removeList) {\n const sectionKey = `${entry?.sectionKey || entry || ''}`;\n if (!sectionKey) return invalid('sectionChanges.remove is missing sectionKey');\n\n const related = isArray(contracts?.[sectionKey]?.relatedContracts)\n ? contracts[sectionKey].relatedContracts\n : [];\n\n for (const key of related) {\n sectionChangeset.push({ op: 'remove', path: contractPtr(key) });\n }\n sectionChangeset.push({ op: 'remove', path: contractPtr(sectionKey) });\n}\n\nconst combined = sectionChangeset.concat(requestChangeset);\n\nif (combined.length === 0) {\n return invalid('no changes provided');\n}\n\nreturn {\n changeset: combined.concat({ op: 'remove', path: proposedPath })\n};\n";
|
|
83
|
+
};
|
|
84
|
+
readonly name: "Prepare";
|
|
85
|
+
readonly type: {
|
|
86
|
+
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
87
|
+
};
|
|
88
|
+
}, {
|
|
89
|
+
readonly changeset: {
|
|
90
|
+
readonly type: {
|
|
91
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
92
|
+
};
|
|
93
|
+
readonly value: "${steps.Prepare.changeset}";
|
|
94
|
+
};
|
|
95
|
+
readonly name: "Apply";
|
|
96
|
+
readonly type: {
|
|
97
|
+
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
98
|
+
};
|
|
99
|
+
}];
|
|
100
|
+
};
|
|
101
|
+
readonly type: {
|
|
102
|
+
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
103
|
+
};
|
|
104
|
+
};
|
|
67
105
|
readonly '2bSWEoMSZwzf32Hnr4BDVsuq8NRjrWEpnhZvMZAJGhh2': {
|
|
68
106
|
readonly description: "Conversation workflow step that enqueues an event as part of the workflow.\n- Gas accounting (when and what is charged):\n - Base step charge (once per run of this step): 30.\n - Expression/template resolution under \"/event\" (if present):\n - Expressions run in the deterministic QuickJS VM (same sandbox and\n bindings as the JavaScript Code step).\n - VM gas is converted to host gas as:\n hostGas = ceil(wasmFuel / 1700)\n (calibration factor currently 1700 fuel per host gas unit).\n - Any document(<pointer>) used inside expressions/templates charges\n per call: 8 + depth(pointer) + ceil(snapshotBytes/100).\n - Event emission (enqueue): 20 + ceil(eventBytes/100) for the final event\n payload after expression resolution.\n";
|
|
69
107
|
readonly event: {
|
|
@@ -74,16 +112,42 @@ export declare const contents: {
|
|
|
74
112
|
readonly blueId: "HYsLiqsqk7t98d5fK6YxKEQGeqBaHNVjM4rRNdxK4yUW";
|
|
75
113
|
};
|
|
76
114
|
};
|
|
77
|
-
readonly '
|
|
78
|
-
readonly description: "
|
|
79
|
-
readonly name: "
|
|
115
|
+
readonly '2jSne57MeM1HvhrQscpbDqhR46TwpmpiEpfG6h8PfMZP': {
|
|
116
|
+
readonly description: "Applies a requested changeset immediately to the document.";
|
|
117
|
+
readonly name: "Change Workflow";
|
|
80
118
|
readonly request: {
|
|
119
|
+
readonly description: "Expected request payload for this workflow.";
|
|
81
120
|
readonly type: {
|
|
82
|
-
readonly blueId: "
|
|
121
|
+
readonly blueId: "6KZwmcsyYNiJhn2pAfS9LAFTxTRHcDw4yzPwV3A3SSQp";
|
|
83
122
|
};
|
|
84
123
|
};
|
|
124
|
+
readonly steps: {
|
|
125
|
+
readonly items: readonly [{
|
|
126
|
+
readonly code: {
|
|
127
|
+
readonly type: {
|
|
128
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
129
|
+
};
|
|
130
|
+
readonly value: "const invalid = (reason) => ({\n changeset: [],\n events: [{ type: 'Conversation/Proposed Change Invalid', reason }]\n});\n\nconst isArray = Array.isArray;\n\nconst change = event.message.request;\n\nconst summary = change?.summary;\nif (!summary || typeof summary !== 'string') {\n return invalid('summary is missing');\n}\n\nconst requestChangeset = isArray(change?.changeset) ? change.changeset : [];\nconst sectionChanges = change.sectionChanges;\n\nconst entryPath = (entry) => `${entry?.path || ''}`;\nconst isContractsPath = (p) => p === '/contracts' || p.startsWith('/contracts/');\nconst isProposedChangePath = (p) => p.startsWith('/proposedChange');\n\nconst contracts = document('/contracts') || {};\nconst policy = Object.values(contracts).find((c) => c?.requireSectionChanges !== undefined);\nconst policyEnabled = !!policy && policy.requireSectionChanges !== false;\n\nif (\n policyEnabled &&\n requestChangeset.some((e) => isContractsPath(entryPath(e)))\n) {\n return invalid('changeset cannot modify /contracts when Contracts Change Policy is enabled');\n}\n\nif (requestChangeset.some((e) => isProposedChangePath(entryPath(e)))) {\n return invalid('changeset cannot modify /proposedChange');\n}\n\nconst escapePointer = (value) =>\n `${value}`.split('~').join('~0').split('/').join('~1');\n\nconst contractPtr = (key) => '/contracts/' + escapePointer(key);\n\nconst isMetaKey = (key) =>\n key === 'type' || key === 'keyType' || key === 'valueType' || key === 'description';\n\nconst contractKeysFromMap = (contractsMap) =>\n Object.keys(contractsMap || {}).filter((k) => !isMetaKey(k));\n\nconst normalizeSection = (section, contractKeys) => ({\n ...(section || {}),\n type: 'Conversation/Document Section',\n relatedContracts: (section?.relatedContracts?.length ? section.relatedContracts : contractKeys)\n});\n\nconst hasMatchingRelatedContracts = (section, contractKeys) => {\n const related = isArray(section?.relatedContracts)\n ? section.relatedContracts.map((value) => `${value}`)\n : [];\n if (!related.length) {\n return true;\n }\n if (related.length !== contractKeys.length) {\n return false;\n }\n const relatedMap = {};\n for (const value of related) {\n const key = `${value}`;\n relatedMap[key] = (relatedMap[key] || 0) + 1;\n }\n if (Object.keys(relatedMap).length !== contractKeys.length) {\n return false;\n }\n for (const key of contractKeys) {\n if (!relatedMap[key]) {\n return false;\n }\n }\n return true;\n};\n\nconst sectionChangeset = [];\nconst seenSectionKeys = {};\nconst seenContractKeys = {};\nconst existingContractKeys = {};\nfor (const key of Object.keys(contracts || {}).filter((k) => !isMetaKey(k))) {\n existingContractKeys[key] = true;\n}\n\nconst trackSectionKey = (sectionKey) => {\n if (seenSectionKeys[sectionKey]) {\n return invalid(`section key duplicated in sectionChanges: ${sectionKey}`);\n }\n seenSectionKeys[sectionKey] = true;\n return null;\n};\n\nconst trackContractKey = (sectionKey, contractKey) => {\n const existingSection = seenContractKeys[contractKey];\n if (existingSection && existingSection !== sectionKey) {\n return invalid(`contract key used by multiple sections in request: ${contractKey}`);\n }\n seenContractKeys[contractKey] = sectionKey;\n return null;\n};\n\nconst addList = isArray(sectionChanges?.add) ? sectionChanges.add : [];\nfor (const entry of addList) {\n const sectionKey = `${entry?.sectionKey || ''}`;\n if (!sectionKey) return invalid('sectionChanges.add is missing sectionKey');\n\n const sectionKeyDup = trackSectionKey(sectionKey);\n if (sectionKeyDup) return sectionKeyDup;\n\n if (existingContractKeys[sectionKey]) {\n return invalid(`contract key already exists at ${contractPtr(sectionKey)}`);\n }\n\n const contractsMap = entry?.contracts || {};\n const contractKeys = contractKeysFromMap(contractsMap).map((key) => `${key}`);\n\n if (!hasMatchingRelatedContracts(entry?.section, contractKeys)) {\n return invalid('relatedContracts must match contracts');\n }\n\n for (const key of contractKeys) {\n if (existingContractKeys[key]) {\n return invalid(`contract key already exists at ${contractPtr(key)}`);\n }\n const dup = trackContractKey(sectionKey, key);\n if (dup) return dup;\n }\n\n for (const key of contractKeys) {\n sectionChangeset.push({ op: 'add', path: contractPtr(key), val: contractsMap[key] });\n }\n\n sectionChangeset.push({\n op: 'add',\n path: contractPtr(sectionKey),\n val: normalizeSection(entry?.section, contractKeys)\n });\n}\n\nconst modifyList = isArray(sectionChanges?.modify) ? sectionChanges.modify : [];\nfor (const entry of modifyList) {\n const sectionKey = `${entry?.sectionKey || ''}`;\n if (!sectionKey) return invalid('sectionChanges.modify is missing sectionKey');\n\n const sectionKeyDup = trackSectionKey(sectionKey);\n if (sectionKeyDup) return sectionKeyDup;\n\n const existingRelated = isArray(contracts?.[sectionKey]?.relatedContracts)\n ? contracts[sectionKey].relatedContracts.map((value) => `${value}`)\n : [];\n const existingRelatedMap = {};\n for (const value of existingRelated) {\n existingRelatedMap[`${value}`] = true;\n }\n\n const contractsMap = entry?.contracts || {};\n const contractKeys = contractKeysFromMap(contractsMap).map((key) => `${key}`);\n\n if (!hasMatchingRelatedContracts(entry?.section, contractKeys)) {\n return invalid('relatedContracts must match contracts');\n }\n\n for (const key of contractKeys) {\n const dup = trackContractKey(sectionKey, key);\n if (dup) return dup;\n if (existingContractKeys[key] && !existingRelatedMap[key]) {\n return invalid(`contract key already exists at ${contractPtr(key)}`);\n }\n }\n\n for (const key of contractKeys) {\n sectionChangeset.push({ op: 'add', path: contractPtr(key), val: contractsMap[key] });\n }\n\n for (const oldKey of existingRelated) {\n if (contractKeys.indexOf(oldKey) === -1) {\n sectionChangeset.push({ op: 'remove', path: contractPtr(oldKey) });\n }\n }\n\n sectionChangeset.push({\n op: 'add',\n path: contractPtr(sectionKey),\n val: normalizeSection(entry?.section, contractKeys)\n });\n}\n\nconst removeList = isArray(sectionChanges?.remove) ? sectionChanges.remove : [];\nfor (const entry of removeList) {\n const sectionKey = `${entry?.sectionKey || entry || ''}`;\n if (!sectionKey) return invalid('sectionChanges.remove is missing sectionKey');\n\n const related = isArray(contracts?.[sectionKey]?.relatedContracts)\n ? contracts[sectionKey].relatedContracts\n : [];\n\n for (const key of related) {\n sectionChangeset.push({ op: 'remove', path: contractPtr(key) });\n }\n sectionChangeset.push({ op: 'remove', path: contractPtr(sectionKey) });\n}\n\nconst combined = sectionChangeset.concat(requestChangeset);\n\nif (combined.length === 0) {\n return invalid('no changes provided');\n}\n\nreturn { changeset: combined };\n";
|
|
131
|
+
};
|
|
132
|
+
readonly name: "Prepare";
|
|
133
|
+
readonly type: {
|
|
134
|
+
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
135
|
+
};
|
|
136
|
+
}, {
|
|
137
|
+
readonly changeset: {
|
|
138
|
+
readonly type: {
|
|
139
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
140
|
+
};
|
|
141
|
+
readonly value: "${steps.Prepare.changeset}";
|
|
142
|
+
};
|
|
143
|
+
readonly name: "Apply";
|
|
144
|
+
readonly type: {
|
|
145
|
+
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
146
|
+
};
|
|
147
|
+
}];
|
|
148
|
+
};
|
|
85
149
|
readonly type: {
|
|
86
|
-
readonly blueId: "
|
|
150
|
+
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
87
151
|
};
|
|
88
152
|
};
|
|
89
153
|
readonly '36epvrpVHZLjapbeZsNodz2NDnm7XZeNZcnkWHgkP1pp': {
|
|
@@ -148,6 +212,50 @@ export declare const contents: {
|
|
|
148
212
|
};
|
|
149
213
|
readonly name: "Document Status";
|
|
150
214
|
};
|
|
215
|
+
readonly '5Ptp4ykWNiYNCmSbYEDpxjE21DGpBxdDR6CQeAaZUSva': {
|
|
216
|
+
readonly description: "Stores a proposed change under /proposedChange{postfix}.";
|
|
217
|
+
readonly name: "Propose Change Workflow";
|
|
218
|
+
readonly postfix: {
|
|
219
|
+
readonly description: "Optional postfix used while building proposed change state key.";
|
|
220
|
+
readonly type: {
|
|
221
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
readonly request: {
|
|
225
|
+
readonly description: "Expected request payload for this workflow.";
|
|
226
|
+
readonly type: {
|
|
227
|
+
readonly blueId: "6KZwmcsyYNiJhn2pAfS9LAFTxTRHcDw4yzPwV3A3SSQp";
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
readonly steps: {
|
|
231
|
+
readonly items: readonly [{
|
|
232
|
+
readonly code: {
|
|
233
|
+
readonly type: {
|
|
234
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
235
|
+
};
|
|
236
|
+
readonly value: "const invalid = (reason) => ({\n changeset: [],\n events: [{ type: 'Conversation/Proposed Change Invalid', reason }]\n});\n\nconst request = event.message.request;\n\nconst summary = request?.summary;\nif (!summary || typeof summary !== 'string') {\n return invalid('summary is missing');\n}\n\nconst postfixValue = currentContract?.postfix || '';\nconst path = '/proposedChange' + postfixValue;\n\nif (document(path)) {\n return invalid('proposed change already exists at ' + path);\n}\n\nreturn {\n changeset: [{ op: 'add', path, val: request }]\n};\n";
|
|
237
|
+
};
|
|
238
|
+
readonly name: "Prepare";
|
|
239
|
+
readonly type: {
|
|
240
|
+
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
241
|
+
};
|
|
242
|
+
}, {
|
|
243
|
+
readonly changeset: {
|
|
244
|
+
readonly type: {
|
|
245
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
246
|
+
};
|
|
247
|
+
readonly value: "${steps.Prepare.changeset}";
|
|
248
|
+
};
|
|
249
|
+
readonly name: "Apply";
|
|
250
|
+
readonly type: {
|
|
251
|
+
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
252
|
+
};
|
|
253
|
+
}];
|
|
254
|
+
};
|
|
255
|
+
readonly type: {
|
|
256
|
+
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
257
|
+
};
|
|
258
|
+
};
|
|
151
259
|
readonly '5Wz4G9qcnBJnntYRkz4dgLK5bSuoMpYJZj4j5M59z4we': {
|
|
152
260
|
readonly description: "Conversation package type. Abstract base for domain events (payload nodes delivered via channels). Not a contract; carries no runtime behavior by itself.\n";
|
|
153
261
|
readonly name: "Event";
|
|
@@ -172,6 +280,31 @@ export declare const contents: {
|
|
|
172
280
|
readonly blueId: "7QACj919YMRvFCTELCf6jfQTp41RVhtHdE6bPazLUZQ6";
|
|
173
281
|
};
|
|
174
282
|
};
|
|
283
|
+
readonly '6KZwmcsyYNiJhn2pAfS9LAFTxTRHcDw4yzPwV3A3SSQp': {
|
|
284
|
+
readonly changeset: {
|
|
285
|
+
readonly description: "RFC 6902 patch entries outside /contracts (blocked by policy if it touches /contracts).";
|
|
286
|
+
readonly itemType: {
|
|
287
|
+
readonly blueId: "Bz49DbfqKC1yJeCfv5RYPZUKTfb7rtZnmreCaz4RsXn5";
|
|
288
|
+
};
|
|
289
|
+
readonly type: {
|
|
290
|
+
readonly blueId: "6aehfNAxHLC1PHHoDr3tYtFH3RWNbiWdFancJ1bypXEY";
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
readonly description: "Payload for propose/make change operations.";
|
|
294
|
+
readonly name: "Change Request";
|
|
295
|
+
readonly sectionChanges: {
|
|
296
|
+
readonly description: "Section-based /contracts mutations (required when Contracts Change Policy is enabled).";
|
|
297
|
+
readonly type: {
|
|
298
|
+
readonly blueId: "DEmFwGa1sWm2BKhrN98LREKiB8j8B8kFAo7KBkkaojnN";
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
readonly summary: {
|
|
302
|
+
readonly description: "Human-readable summary of the requested change. Required when proposal is created.";
|
|
303
|
+
readonly type: {
|
|
304
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
};
|
|
175
308
|
readonly '7czpW4QyEqJy3d2X8dqsxcu3Q1G2CftTJUCTTyJSY6J8': {
|
|
176
309
|
readonly consentDetails: {
|
|
177
310
|
readonly description: "Generic scope details (merchant id, event categories, requesting contract refs, etc.).";
|
|
@@ -516,45 +649,58 @@ export declare const contents: {
|
|
|
516
649
|
readonly blueId: "5Wz4G9qcnBJnntYRkz4dgLK5bSuoMpYJZj4j5M59z4we";
|
|
517
650
|
};
|
|
518
651
|
};
|
|
519
|
-
readonly '
|
|
520
|
-
readonly
|
|
521
|
-
readonly
|
|
652
|
+
readonly '9fnXwi4Za8hjEj6zDSEjhbA5dLrDzs7sxoDMGLmRT2Gz': {
|
|
653
|
+
readonly description: "Discards a previously proposed change by removing its proposal state.";
|
|
654
|
+
readonly name: "Reject Change Workflow";
|
|
655
|
+
readonly postfix: {
|
|
656
|
+
readonly description: "Optional postfix used while building proposed change state key.";
|
|
522
657
|
readonly type: {
|
|
523
658
|
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
524
659
|
};
|
|
525
660
|
};
|
|
526
|
-
readonly
|
|
527
|
-
readonly
|
|
528
|
-
readonly
|
|
529
|
-
|
|
661
|
+
readonly steps: {
|
|
662
|
+
readonly items: readonly [{
|
|
663
|
+
readonly code: {
|
|
664
|
+
readonly type: {
|
|
665
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
666
|
+
};
|
|
667
|
+
readonly value: "const invalid = (reason) => ({\n changeset: [],\n events: [{ type: 'Conversation/Proposed Change Invalid', reason }]\n});\n\nconst postfixValue = currentContract?.postfix || '';\nconst path = '/proposedChange' + postfixValue;\n\nif (!document(path)) {\n return invalid('no proposed change at ' + path);\n}\n\nreturn {\n changeset: [{ op: 'remove', path }]\n};\n";
|
|
668
|
+
};
|
|
669
|
+
readonly name: "Prepare";
|
|
670
|
+
readonly type: {
|
|
671
|
+
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
672
|
+
};
|
|
673
|
+
}, {
|
|
674
|
+
readonly changeset: {
|
|
675
|
+
readonly type: {
|
|
676
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
677
|
+
};
|
|
678
|
+
readonly value: "${steps.Prepare.changeset}";
|
|
679
|
+
};
|
|
680
|
+
readonly name: "Apply";
|
|
681
|
+
readonly type: {
|
|
682
|
+
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
683
|
+
};
|
|
684
|
+
}];
|
|
530
685
|
};
|
|
531
686
|
readonly type: {
|
|
532
|
-
readonly blueId: "
|
|
687
|
+
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
533
688
|
};
|
|
534
689
|
};
|
|
535
|
-
readonly '
|
|
536
|
-
readonly
|
|
537
|
-
|
|
690
|
+
readonly '9h1AhEexkxxKLYv1NHbEESYCPtvW7Nt51msGtuQC5jWK': {
|
|
691
|
+
readonly name: "Customer Consent Revoked";
|
|
692
|
+
readonly reason: {
|
|
538
693
|
readonly type: {
|
|
539
694
|
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
540
695
|
};
|
|
541
696
|
};
|
|
542
|
-
readonly
|
|
543
|
-
readonly description: "RFC 6902 patch entries outside /contracts (blocked by policy when touching /contracts).";
|
|
544
|
-
readonly itemType: {
|
|
545
|
-
readonly blueId: "Bz49DbfqKC1yJeCfv5RYPZUKTfb7rtZnmreCaz4RsXn5";
|
|
546
|
-
};
|
|
697
|
+
readonly revokedAt: {
|
|
547
698
|
readonly type: {
|
|
548
|
-
readonly blueId: "
|
|
699
|
+
readonly blueId: "GQaGqFxHDz64L1c9QkCbz52ths6bMVtpHnw4QDngzQYs";
|
|
549
700
|
};
|
|
550
701
|
};
|
|
551
|
-
readonly
|
|
552
|
-
|
|
553
|
-
readonly sectionChanges: {
|
|
554
|
-
readonly description: "Section-based /contracts mutations (required when Contracts Change Policy is enabled).";
|
|
555
|
-
readonly type: {
|
|
556
|
-
readonly blueId: "DEmFwGa1sWm2BKhrN98LREKiB8j8B8kFAo7KBkkaojnN";
|
|
557
|
-
};
|
|
702
|
+
readonly type: {
|
|
703
|
+
readonly blueId: "5Wz4G9qcnBJnntYRkz4dgLK5bSuoMpYJZj4j5M59z4we";
|
|
558
704
|
};
|
|
559
705
|
};
|
|
560
706
|
readonly '9xv7YjqsSn7W7P8rnUhSpdWGfSrgL4Jt3cmiACJT5VQs': {
|
|
@@ -585,6 +731,18 @@ export declare const contents: {
|
|
|
585
731
|
};
|
|
586
732
|
};
|
|
587
733
|
};
|
|
734
|
+
readonly A3jjsMRLxrKo5pyPgLoT6e9jPGWfFPdkMs2wjyYMRpXk: {
|
|
735
|
+
readonly description: "Operation that applies a changeset immediately without proposal/accept.";
|
|
736
|
+
readonly name: "Change Operation";
|
|
737
|
+
readonly request: {
|
|
738
|
+
readonly type: {
|
|
739
|
+
readonly blueId: "6KZwmcsyYNiJhn2pAfS9LAFTxTRHcDw4yzPwV3A3SSQp";
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
readonly type: {
|
|
743
|
+
readonly blueId: "BoAiqVUZv9Fum3wFqaX2JnQMBHJLxJSo2V9U2UBmCfsC";
|
|
744
|
+
};
|
|
745
|
+
};
|
|
588
746
|
readonly AemAG9Bb3XUZm6hLPMipUeYmpFFG6X4CUYZFSLC88WjV: {
|
|
589
747
|
readonly actionId: {
|
|
590
748
|
readonly description: "Optional idempotency key for the action request.";
|
|
@@ -628,44 +786,6 @@ export declare const contents: {
|
|
|
628
786
|
readonly blueId: "8f9UhHMbRe62sFgzQVheToaJPYi7t7HPNVvpQTbqfL5n";
|
|
629
787
|
};
|
|
630
788
|
};
|
|
631
|
-
readonly AKNj5zwzgAkXZo3psikJfoVxUcNfMBVgDrf4HDGWL1gm: {
|
|
632
|
-
readonly description: "Applies a requested changeset immediately to the document.";
|
|
633
|
-
readonly name: "Change Workflow";
|
|
634
|
-
readonly request: {
|
|
635
|
-
readonly description: "Expected request payload for this workflow.";
|
|
636
|
-
readonly type: {
|
|
637
|
-
readonly blueId: "9KDfK6k1HBAyHckj5VuWXFMLkgY5cJBESKT4eoq1bnrw";
|
|
638
|
-
};
|
|
639
|
-
};
|
|
640
|
-
readonly steps: {
|
|
641
|
-
readonly items: readonly [{
|
|
642
|
-
readonly code: {
|
|
643
|
-
readonly type: {
|
|
644
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
645
|
-
};
|
|
646
|
-
readonly value: "const issues = [];\n\nconst request = event.message.request || {};\n\nconst changeDescription = request.changeDescription;\nconst rawChangeset = request.changeset;\nconst rawSectionChanges = request.sectionChanges;\nconst requestSectionChanges = rawSectionChanges || {};\n\nconst toText = (value) => {\n const raw = value && value.value ? value.value : value;\n return raw && raw.trim ? raw.trim() : '';\n};\nconst asList = (value) => Array.isArray(value) ? value : [];\nconst hasType = (value) => value && value.type;\nconst escapePointer = (value) => {\n const text = toText(value);\n return text.split('~').join('~0').split('/').join('~1');\n};\nconst requestChangeset = asList(rawChangeset);\n\nconst uniqueKeys = (values, label) => {\n const seen = new Set();\n const output = [];\n for (const value of values) {\n const key = toText(value);\n if (!key) {\n issues.push(label + ' contains invalid key');\n continue;\n }\n if (seen.has(key)) {\n issues.push(label + ' contains duplicate key: ' + key);\n continue;\n }\n seen.add(key);\n output.push(key);\n }\n return output;\n};\n\nconst sameStringSet = (left, right) => {\n if (left.length !== right.length) return false;\n const set = new Set(left);\n if (set.size !== right.length) return false;\n for (const value of right) {\n if (!set.has(value)) return false;\n }\n return true;\n};\n\nconst contracts = Object(document('/contracts') || {});\n\nconst isDocumentSection = (contract) =>\n !!contract && Array.isArray(contract.relatedContracts);\n\nconst isContractsChangePolicy = (contract) => {\n if (!contract) return false;\n return 'requireSectionChanges' in contract;\n};\n\nconst findPolicy = () => {\n for (const key of Object.keys(contracts)) {\n const contract = contracts[key];\n if (isContractsChangePolicy(contract)) {\n return contract;\n }\n }\n return null;\n};\n\nconst policy = findPolicy();\nconst policyEnabled = !!policy && policy.requireSectionChanges !== false;\n\nif (!toText(changeDescription)) {\n issues.push('changeDescription is missing');\n}\n\nconst hasChangeset = !!rawChangeset;\nconst hasSectionChanges = !!rawSectionChanges;\n\nif (!hasChangeset && !hasSectionChanges) {\n issues.push('changeset or sectionChanges is required');\n}\n\nconst isContractsPath = (path) => {\n const value = toText(path);\n return value === '/contracts' || value.startsWith('/contracts/');\n};\nif (policyEnabled && hasChangeset) {\n for (const entry of requestChangeset) {\n if (entry && isContractsPath(entry.path)) {\n issues.push('changeset cannot modify /contracts when Contracts Change Policy is enabled');\n break;\n }\n }\n}\nconst isProposedChangePath = (path) =>\n toText(path).startsWith('/proposedChange');\nif (hasChangeset) {\n for (const entry of requestChangeset) {\n if (entry && isProposedChangePath(entry.path)) {\n issues.push('changeset cannot modify /proposedChange');\n break;\n }\n }\n}\n\nconst existingSections = {};\nfor (const key of Object.keys(contracts)) {\n const contract = contracts[key];\n if (isDocumentSection(contract)) {\n existingSections[key] = contract;\n }\n}\n\nconst contractIndex = {};\nfor (const sectionKey of Object.keys(existingSections)) {\n const section = existingSections[sectionKey];\n const related = asList(section.relatedContracts);\n for (const relatedKey of related) {\n const contractKey = toText(relatedKey);\n if (!contractKey) continue;\n if (contractIndex[contractKey] && contractIndex[contractKey] !== sectionKey) {\n contractIndex[contractKey] = null;\n } else if (!contractIndex[contractKey]) {\n contractIndex[contractKey] = sectionKey;\n }\n }\n}\n\nconst normalizeSectionDefinition = (sectionDef, label) => {\n if (!sectionDef) {\n issues.push(label + ' entry must be an object');\n return null;\n }\n const sectionKey = toText(sectionDef.sectionKey);\n if (!sectionKey) {\n issues.push(label + ' sectionKey is missing');\n return null;\n }\n const section = sectionDef.section;\n if (!section) {\n issues.push(label + ' section is missing');\n return null;\n }\n\n const rawContractsMap = sectionDef.contracts && sectionDef.contracts.value\n ? sectionDef.contracts.value\n : sectionDef.contracts || {};\n const contractDefs = [];\n const contractKeys = [];\n for (const [rawKey, contract] of Object.entries(rawContractsMap)) {\n if (\n rawKey === 'type' ||\n rawKey === 'keyType' ||\n rawKey === 'valueType' ||\n rawKey === 'description'\n ) {\n continue;\n }\n const key = toText(rawKey);\n if (!key) {\n issues.push(label + ' contract key is missing');\n continue;\n }\n if (!contract) {\n issues.push(label + ' contract ' + key + ' is missing or invalid');\n continue;\n }\n if (!hasType(contract)) {\n issues.push(label + ' contract ' + key + ' is missing type');\n }\n contractDefs.push({ key, contract });\n contractKeys.push(key);\n }\n\n if (!hasType(section)) {\n issues.push(label + ' section ' + sectionKey + ' is missing type');\n }\n\n const related = section.relatedContracts\n ? uniqueKeys(asList(section.relatedContracts), label + ' section ' + sectionKey + ' relatedContracts')\n : null;\n if (related && !sameStringSet(related, contractKeys)) {\n issues.push(label + ' section ' + sectionKey + ' relatedContracts must match contracts');\n }\n\n const normalizedRelated = related || contractKeys;\n const normalizedSection = Object.assign({}, section, {\n type: 'Conversation/Document Section',\n relatedContracts: normalizedRelated\n });\n\n return {\n sectionKey,\n section: normalizedSection,\n contractDefs,\n contractKeys\n };\n};\n\nconst sectionChangeset = [];\nconst seenSectionKeys = new Set();\nconst seenContractKeys = new Set();\n\nconst addList = asList(requestSectionChanges.add);\nconst modifyList = asList(requestSectionChanges.modify);\nconst removeList = asList(requestSectionChanges.remove);\n\nfor (const entry of addList) {\n const normalized = normalizeSectionDefinition(entry, 'sectionChanges.add');\n if (!normalized) continue;\n const sectionKey = normalized.sectionKey;\n if (seenSectionKeys.has(sectionKey)) {\n issues.push('section key duplicated in sectionChanges: ' + sectionKey);\n continue;\n }\n seenSectionKeys.add(sectionKey);\n\n if (contracts[sectionKey]) {\n issues.push('section key already exists at /contracts/' + sectionKey);\n }\n\n for (const contractKey of normalized.contractKeys) {\n if (seenContractKeys.has(contractKey)) {\n issues.push('contract key used by multiple sections in request: ' + contractKey);\n continue;\n }\n seenContractKeys.add(contractKey);\n if (contracts[contractKey]) {\n issues.push('contract key already exists at /contracts/' + contractKey);\n }\n }\n\n for (const contractDef of normalized.contractDefs) {\n sectionChangeset.push({\n op: 'add',\n path: '/contracts/' + escapePointer(contractDef.key),\n val: contractDef.contract\n });\n }\n sectionChangeset.push({\n op: 'add',\n path: '/contracts/' + escapePointer(sectionKey),\n val: normalized.section\n });\n}\n\nfor (const entry of modifyList) {\n const normalized = normalizeSectionDefinition(entry, 'sectionChanges.modify');\n if (!normalized) continue;\n const sectionKey = normalized.sectionKey;\n if (seenSectionKeys.has(sectionKey)) {\n issues.push('section key duplicated in sectionChanges: ' + sectionKey);\n continue;\n }\n seenSectionKeys.add(sectionKey);\n\n const existingSection = contracts[sectionKey];\n if (!existingSection) {\n issues.push('section key does not exist at /contracts/' + sectionKey);\n } else if (!isDocumentSection(existingSection)) {\n issues.push('existing section at /contracts/' + sectionKey + ' is not a Document Section');\n }\n\n const existingRelated =\n existingSection && existingSection.relatedContracts\n ? asList(existingSection.relatedContracts)\n : [];\n if (existingSection && !existingSection.relatedContracts) {\n issues.push('existing section ' + sectionKey + ' is missing relatedContracts');\n }\n\n for (const contractKey of normalized.contractKeys) {\n if (seenContractKeys.has(contractKey)) {\n issues.push('contract key used by multiple sections in request: ' + contractKey);\n continue;\n }\n seenContractKeys.add(contractKey);\n if (contractIndex[contractKey] && contractIndex[contractKey] !== sectionKey) {\n issues.push('contract key ' + contractKey + ' is linked to another section');\n }\n }\n\n for (const contractDef of normalized.contractDefs) {\n const op = contracts[contractDef.key] ? 'replace' : 'add';\n sectionChangeset.push({\n op,\n path: '/contracts/' + escapePointer(contractDef.key),\n val: contractDef.contract\n });\n }\n\n const toRemove = uniqueKeys(existingRelated, 'sectionChanges.modify remove list').filter(\n (key) => !normalized.contractKeys.includes(key)\n );\n for (const contractKey of toRemove) {\n if (contractIndex[contractKey] && contractIndex[contractKey] !== sectionKey) {\n issues.push('contract key ' + contractKey + ' is linked to another section');\n continue;\n }\n sectionChangeset.push({\n op: 'remove',\n path: '/contracts/' + escapePointer(contractKey)\n });\n }\n\n sectionChangeset.push({\n op: 'replace',\n path: '/contracts/' + escapePointer(sectionKey),\n val: normalized.section\n });\n}\n\nconst removeKeys = uniqueKeys(removeList, 'sectionChanges.remove');\nfor (const sectionKey of removeKeys) {\n if (seenSectionKeys.has(sectionKey)) {\n issues.push('section key duplicated in sectionChanges: ' + sectionKey);\n continue;\n }\n seenSectionKeys.add(sectionKey);\n\n const existingSection = contracts[sectionKey];\n if (!existingSection) {\n issues.push('section key does not exist at /contracts/' + sectionKey);\n continue;\n }\n if (!isDocumentSection(existingSection)) {\n issues.push('existing section at /contracts/' + sectionKey + ' is not a Document Section');\n continue;\n }\n\n const related = existingSection.relatedContracts\n ? uniqueKeys(asList(existingSection.relatedContracts), 'sectionChanges.remove relatedContracts')\n : [];\n if (!existingSection.relatedContracts) {\n issues.push('existing section ' + sectionKey + ' is missing relatedContracts');\n }\n\n for (const contractKey of related) {\n if (contractIndex[contractKey] && contractIndex[contractKey] !== sectionKey) {\n issues.push('contract key ' + contractKey + ' is linked to another section');\n continue;\n }\n sectionChangeset.push({\n op: 'remove',\n path: '/contracts/' + escapePointer(contractKey)\n });\n }\n sectionChangeset.push({\n op: 'remove',\n path: '/contracts/' + escapePointer(sectionKey)\n });\n}\nconst combinedChangeset = sectionChangeset.concat(hasChangeset ? requestChangeset : []);\n\nif (combinedChangeset.length === 0) {\n issues.push('no changes provided');\n}\n\nif (issues.length > 0) {\n return {\n changeset: [],\n events: [\n {\n type: \"Conversation/Proposed Change Invalid\",\n reason: issues.join('; ')\n }\n ]\n }\n}\n\nreturn {\n changeset: combinedChangeset\n};\n";
|
|
647
|
-
};
|
|
648
|
-
readonly name: "Prepare";
|
|
649
|
-
readonly type: {
|
|
650
|
-
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
651
|
-
};
|
|
652
|
-
}, {
|
|
653
|
-
readonly changeset: {
|
|
654
|
-
readonly type: {
|
|
655
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
656
|
-
};
|
|
657
|
-
readonly value: "${steps.Prepare.changeset}";
|
|
658
|
-
};
|
|
659
|
-
readonly name: "Apply";
|
|
660
|
-
readonly type: {
|
|
661
|
-
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
662
|
-
};
|
|
663
|
-
}];
|
|
664
|
-
};
|
|
665
|
-
readonly type: {
|
|
666
|
-
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
667
|
-
};
|
|
668
|
-
};
|
|
669
789
|
readonly AkUKoKY1hHY1CytCrAXDPKCd4md1QGmn1WNcQtWBsyAD: {
|
|
670
790
|
readonly description: "Conversation event representing a single chat message exchanged between participants.\n";
|
|
671
791
|
readonly message: {
|
|
@@ -715,18 +835,6 @@ export declare const contents: {
|
|
|
715
835
|
readonly blueId: "7QACj919YMRvFCTELCf6jfQTp41RVhtHdE6bPazLUZQ6";
|
|
716
836
|
};
|
|
717
837
|
};
|
|
718
|
-
readonly BoyJNkH7CAzjuuzbZFpxB7HguZVtLCxpBLnuYY5k1eqB: {
|
|
719
|
-
readonly description: "Operation that applies a changeset immediately without proposal/accept.";
|
|
720
|
-
readonly name: "Change Operation";
|
|
721
|
-
readonly request: {
|
|
722
|
-
readonly type: {
|
|
723
|
-
readonly blueId: "9KDfK6k1HBAyHckj5VuWXFMLkgY5cJBESKT4eoq1bnrw";
|
|
724
|
-
};
|
|
725
|
-
};
|
|
726
|
-
readonly type: {
|
|
727
|
-
readonly blueId: "BoAiqVUZv9Fum3wFqaX2JnQMBHJLxJSo2V9U2UBmCfsC";
|
|
728
|
-
};
|
|
729
|
-
};
|
|
730
838
|
readonly C48nKSkbxraMSv4gCiGYVHKFjmtK12k63Yasn95zknWE: {
|
|
731
839
|
readonly description: "An event indicating that the document's status has transitioned.";
|
|
732
840
|
readonly name: "Status Change";
|
|
@@ -801,50 +909,6 @@ export declare const contents: {
|
|
|
801
909
|
readonly blueId: "5Wz4G9qcnBJnntYRkz4dgLK5bSuoMpYJZj4j5M59z4we";
|
|
802
910
|
};
|
|
803
911
|
};
|
|
804
|
-
readonly Ecj8Y7rb7kMCkNFfvyZ36CNB2JjCWrqy7BiHcvcNELEL: {
|
|
805
|
-
readonly description: "Stores a proposed change under /proposedChange{postfix}.";
|
|
806
|
-
readonly name: "Propose Change Workflow";
|
|
807
|
-
readonly postfix: {
|
|
808
|
-
readonly description: "Optional postfix used while building proposed change state key.";
|
|
809
|
-
readonly type: {
|
|
810
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
811
|
-
};
|
|
812
|
-
};
|
|
813
|
-
readonly request: {
|
|
814
|
-
readonly description: "Expected request payload for this workflow.";
|
|
815
|
-
readonly type: {
|
|
816
|
-
readonly blueId: "9KDfK6k1HBAyHckj5VuWXFMLkgY5cJBESKT4eoq1bnrw";
|
|
817
|
-
};
|
|
818
|
-
};
|
|
819
|
-
readonly steps: {
|
|
820
|
-
readonly items: readonly [{
|
|
821
|
-
readonly code: {
|
|
822
|
-
readonly type: {
|
|
823
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
824
|
-
};
|
|
825
|
-
readonly value: "const issues = [];\n\nconst request = event.message.request || {};\n\nconst changeDescription = request.changeDescription;\nconst rawChangeset = request.changeset;\nconst rawSectionChanges = request.sectionChanges;\nconst requestSectionChanges = rawSectionChanges || {};\n\nconst toText = (value) => {\n const raw = value && value.value ? value.value : value;\n return raw && raw.trim ? raw.trim() : '';\n};\nconst asList = (value) => Array.isArray(value) ? value : [];\nconst hasType = (value) => value && value.type;\nconst escapePointer = (value) => {\n const text = toText(value);\n return text.split('~').join('~0').split('/').join('~1');\n};\nconst requestChangeset = asList(rawChangeset);\n\nconst uniqueKeys = (values, label) => {\n const seen = new Set();\n const output = [];\n for (const value of values) {\n const key = toText(value);\n if (!key) {\n issues.push(label + ' contains invalid key');\n continue;\n }\n if (seen.has(key)) {\n issues.push(label + ' contains duplicate key: ' + key);\n continue;\n }\n seen.add(key);\n output.push(key);\n }\n return output;\n};\n\nconst sameStringSet = (left, right) => {\n if (left.length !== right.length) return false;\n const set = new Set(left);\n if (set.size !== right.length) return false;\n for (const value of right) {\n if (!set.has(value)) return false;\n }\n return true;\n};\n\nconst contracts = Object(document('/contracts') || {});\n\nconst isDocumentSection = (contract) =>\n !!contract && Array.isArray(contract.relatedContracts);\n\nconst isContractsChangePolicy = (contract) => {\n if (!contract) return false;\n return 'requireSectionChanges' in contract;\n};\n\nconst findPolicy = () => {\n for (const key of Object.keys(contracts)) {\n const contract = contracts[key];\n if (isContractsChangePolicy(contract)) {\n return contract;\n }\n }\n return null;\n};\n\nconst policy = findPolicy();\nconst policyEnabled = !!policy && policy.requireSectionChanges !== false;\n\nif (!toText(changeDescription)) {\n issues.push('changeDescription is missing');\n}\n\nconst hasChangeset = !!rawChangeset;\nconst hasSectionChanges = !!rawSectionChanges;\n\nif (!hasChangeset && !hasSectionChanges) {\n issues.push('changeset or sectionChanges is required');\n}\n\nconst isContractsPath = (path) => {\n const value = toText(path);\n return value === '/contracts' || value.startsWith('/contracts/');\n};\nif (policyEnabled && hasChangeset) {\n for (const entry of requestChangeset) {\n if (entry && isContractsPath(entry.path)) {\n issues.push('changeset cannot modify /contracts when Contracts Change Policy is enabled');\n break;\n }\n }\n}\nconst isProposedChangePath = (path) =>\n toText(path).startsWith('/proposedChange');\nif (hasChangeset) {\n for (const entry of requestChangeset) {\n if (entry && isProposedChangePath(entry.path)) {\n issues.push('changeset cannot modify /proposedChange');\n break;\n }\n }\n}\n\nconst existingSections = {};\nfor (const key of Object.keys(contracts)) {\n const contract = contracts[key];\n if (isDocumentSection(contract)) {\n existingSections[key] = contract;\n }\n}\n\nconst contractIndex = {};\nfor (const sectionKey of Object.keys(existingSections)) {\n const section = existingSections[sectionKey];\n const related = asList(section.relatedContracts);\n for (const relatedKey of related) {\n const contractKey = toText(relatedKey);\n if (!contractKey) continue;\n if (contractIndex[contractKey] && contractIndex[contractKey] !== sectionKey) {\n contractIndex[contractKey] = null;\n } else if (!contractIndex[contractKey]) {\n contractIndex[contractKey] = sectionKey;\n }\n }\n}\n\nconst normalizeSectionDefinition = (sectionDef, label) => {\n if (!sectionDef) {\n issues.push(label + ' entry must be an object');\n return null;\n }\n const sectionKey = toText(sectionDef.sectionKey);\n if (!sectionKey) {\n issues.push(label + ' sectionKey is missing');\n return null;\n }\n const section = sectionDef.section;\n if (!section) {\n issues.push(label + ' section is missing');\n return null;\n }\n\n const rawContractsMap = sectionDef.contracts && sectionDef.contracts.value\n ? sectionDef.contracts.value\n : sectionDef.contracts || {};\n const contractDefs = [];\n const contractKeys = [];\n for (const [rawKey, contract] of Object.entries(rawContractsMap)) {\n if (\n rawKey === 'type' ||\n rawKey === 'keyType' ||\n rawKey === 'valueType' ||\n rawKey === 'description'\n ) {\n continue;\n }\n const key = toText(rawKey);\n if (!key) {\n issues.push(label + ' contract key is missing');\n continue;\n }\n if (!contract) {\n issues.push(label + ' contract ' + key + ' is missing or invalid');\n continue;\n }\n if (!hasType(contract)) {\n issues.push(label + ' contract ' + key + ' is missing type');\n }\n contractDefs.push({ key, contract });\n contractKeys.push(key);\n }\n\n if (!hasType(section)) {\n issues.push(label + ' section ' + sectionKey + ' is missing type');\n }\n\n const related = section.relatedContracts\n ? uniqueKeys(asList(section.relatedContracts), label + ' section ' + sectionKey + ' relatedContracts')\n : null;\n if (related && !sameStringSet(related, contractKeys)) {\n issues.push(label + ' section ' + sectionKey + ' relatedContracts must match contracts');\n }\n\n const normalizedRelated = related || contractKeys;\n const normalizedSection = Object.assign({}, section, {\n type: 'Conversation/Document Section',\n relatedContracts: normalizedRelated\n });\n\n return {\n sectionKey,\n section: normalizedSection,\n contractDefs,\n contractKeys\n };\n};\n\nconst sectionChangeset = [];\nconst seenSectionKeys = new Set();\nconst seenContractKeys = new Set();\n\nconst addList = asList(requestSectionChanges.add);\nconst modifyList = asList(requestSectionChanges.modify);\nconst removeList = asList(requestSectionChanges.remove);\n\nfor (const entry of addList) {\n const normalized = normalizeSectionDefinition(entry, 'sectionChanges.add');\n if (!normalized) continue;\n const sectionKey = normalized.sectionKey;\n if (seenSectionKeys.has(sectionKey)) {\n issues.push('section key duplicated in sectionChanges: ' + sectionKey);\n continue;\n }\n seenSectionKeys.add(sectionKey);\n\n if (contracts[sectionKey]) {\n issues.push('section key already exists at /contracts/' + sectionKey);\n }\n\n for (const contractKey of normalized.contractKeys) {\n if (seenContractKeys.has(contractKey)) {\n issues.push('contract key used by multiple sections in request: ' + contractKey);\n continue;\n }\n seenContractKeys.add(contractKey);\n if (contracts[contractKey]) {\n issues.push('contract key already exists at /contracts/' + contractKey);\n }\n }\n\n for (const contractDef of normalized.contractDefs) {\n sectionChangeset.push({\n op: 'add',\n path: '/contracts/' + escapePointer(contractDef.key),\n val: contractDef.contract\n });\n }\n sectionChangeset.push({\n op: 'add',\n path: '/contracts/' + escapePointer(sectionKey),\n val: normalized.section\n });\n}\n\nfor (const entry of modifyList) {\n const normalized = normalizeSectionDefinition(entry, 'sectionChanges.modify');\n if (!normalized) continue;\n const sectionKey = normalized.sectionKey;\n if (seenSectionKeys.has(sectionKey)) {\n issues.push('section key duplicated in sectionChanges: ' + sectionKey);\n continue;\n }\n seenSectionKeys.add(sectionKey);\n\n const existingSection = contracts[sectionKey];\n if (!existingSection) {\n issues.push('section key does not exist at /contracts/' + sectionKey);\n } else if (!isDocumentSection(existingSection)) {\n issues.push('existing section at /contracts/' + sectionKey + ' is not a Document Section');\n }\n\n const existingRelated =\n existingSection && existingSection.relatedContracts\n ? asList(existingSection.relatedContracts)\n : [];\n if (existingSection && !existingSection.relatedContracts) {\n issues.push('existing section ' + sectionKey + ' is missing relatedContracts');\n }\n\n for (const contractKey of normalized.contractKeys) {\n if (seenContractKeys.has(contractKey)) {\n issues.push('contract key used by multiple sections in request: ' + contractKey);\n continue;\n }\n seenContractKeys.add(contractKey);\n if (contractIndex[contractKey] && contractIndex[contractKey] !== sectionKey) {\n issues.push('contract key ' + contractKey + ' is linked to another section');\n }\n }\n\n for (const contractDef of normalized.contractDefs) {\n const op = contracts[contractDef.key] ? 'replace' : 'add';\n sectionChangeset.push({\n op,\n path: '/contracts/' + escapePointer(contractDef.key),\n val: contractDef.contract\n });\n }\n\n const toRemove = uniqueKeys(existingRelated, 'sectionChanges.modify remove list').filter(\n (key) => !normalized.contractKeys.includes(key)\n );\n for (const contractKey of toRemove) {\n if (contractIndex[contractKey] && contractIndex[contractKey] !== sectionKey) {\n issues.push('contract key ' + contractKey + ' is linked to another section');\n continue;\n }\n sectionChangeset.push({\n op: 'remove',\n path: '/contracts/' + escapePointer(contractKey)\n });\n }\n\n sectionChangeset.push({\n op: 'replace',\n path: '/contracts/' + escapePointer(sectionKey),\n val: normalized.section\n });\n}\n\nconst removeKeys = uniqueKeys(removeList, 'sectionChanges.remove');\nfor (const sectionKey of removeKeys) {\n if (seenSectionKeys.has(sectionKey)) {\n issues.push('section key duplicated in sectionChanges: ' + sectionKey);\n continue;\n }\n seenSectionKeys.add(sectionKey);\n\n const existingSection = contracts[sectionKey];\n if (!existingSection) {\n issues.push('section key does not exist at /contracts/' + sectionKey);\n continue;\n }\n if (!isDocumentSection(existingSection)) {\n issues.push('existing section at /contracts/' + sectionKey + ' is not a Document Section');\n continue;\n }\n\n const related = existingSection.relatedContracts\n ? uniqueKeys(asList(existingSection.relatedContracts), 'sectionChanges.remove relatedContracts')\n : [];\n if (!existingSection.relatedContracts) {\n issues.push('existing section ' + sectionKey + ' is missing relatedContracts');\n }\n\n for (const contractKey of related) {\n if (contractIndex[contractKey] && contractIndex[contractKey] !== sectionKey) {\n issues.push('contract key ' + contractKey + ' is linked to another section');\n continue;\n }\n sectionChangeset.push({\n op: 'remove',\n path: '/contracts/' + escapePointer(contractKey)\n });\n }\n sectionChangeset.push({\n op: 'remove',\n path: '/contracts/' + escapePointer(sectionKey)\n });\n}\nconst combinedChangeset = sectionChangeset.concat(hasChangeset ? requestChangeset : []);\n\nif (combinedChangeset.length === 0) {\n issues.push('no changes provided');\n}\n\nif (issues.length > 0) {\n return {\n changeset: [],\n events: [\n {\n type: \"Conversation/Proposed Change Invalid\",\n reason: issues.join('; ')\n }\n ]\n }\n}\n\nconst postfixValue = currentContract.postfix || '';\nconst path = '/proposedChange' + postfixValue;\n\nif (document(path)) {\n return {\n changeset: [],\n events: [\n {\n type: \"Conversation/Proposed Change Invalid\",\n reason: \"Can not propose change when it already exists at \" + path\n }\n ]\n }\n}\n\nconst proposedPayload = {\n changeDescription\n};\n\nproposedPayload.preparedChangeset = combinedChangeset;\n\nif (hasChangeset) {\n proposedPayload.changeset = requestChangeset;\n}\n\nconst hasSectionChangesData = addList.length || modifyList.length || removeList.length;\nif (hasSectionChangesData) {\n proposedPayload.sectionChanges = rawSectionChanges;\n}\n\nreturn {\n changeset: [{\n op: 'add',\n path,\n val: proposedPayload\n }]\n};\n";
|
|
826
|
-
};
|
|
827
|
-
readonly name: "Prepare";
|
|
828
|
-
readonly type: {
|
|
829
|
-
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
830
|
-
};
|
|
831
|
-
}, {
|
|
832
|
-
readonly changeset: {
|
|
833
|
-
readonly type: {
|
|
834
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
835
|
-
};
|
|
836
|
-
readonly value: "${steps.Prepare.changeset}";
|
|
837
|
-
};
|
|
838
|
-
readonly name: "Apply";
|
|
839
|
-
readonly type: {
|
|
840
|
-
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
841
|
-
};
|
|
842
|
-
}];
|
|
843
|
-
};
|
|
844
|
-
readonly type: {
|
|
845
|
-
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
846
|
-
};
|
|
847
|
-
};
|
|
848
912
|
readonly EhPFqrRCreg7StsZEcW8fRQ1FQVdqYSsMSis2CHHJZ1G: {
|
|
849
913
|
readonly description: "A successful final state. The document has achieved its goal and its\nprocess has finished as expected.\n";
|
|
850
914
|
readonly mode: {
|
|
@@ -940,82 +1004,6 @@ export declare const contents: {
|
|
|
940
1004
|
readonly blueId: "HYsLiqsqk7t98d5fK6YxKEQGeqBaHNVjM4rRNdxK4yUW";
|
|
941
1005
|
};
|
|
942
1006
|
};
|
|
943
|
-
readonly G6GMCB3AQvH2xR12RiDvaCiEbCjgz4uhjKssDMRXbCTG: {
|
|
944
|
-
readonly description: "Applies a previously proposed change and removes its proposal state.";
|
|
945
|
-
readonly name: "Accept Change Workflow";
|
|
946
|
-
readonly postfix: {
|
|
947
|
-
readonly description: "Optional postfix used while building proposed change state key.";
|
|
948
|
-
readonly type: {
|
|
949
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
950
|
-
};
|
|
951
|
-
};
|
|
952
|
-
readonly steps: {
|
|
953
|
-
readonly items: readonly [{
|
|
954
|
-
readonly code: {
|
|
955
|
-
readonly type: {
|
|
956
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
957
|
-
};
|
|
958
|
-
readonly value: "const postfix = currentContract.postfix || '';\nconst path = '/proposedChange' + postfix;\n\nconst proposedChange = document(path);\nif (!proposedChange) {\n return {\n changeset: [],\n events: [\n {\n type: \"Conversation/Proposed Change Invalid\",\n reason: \"Proposed change does not exist at \" + path\n }\n ]\n };\n}\n\nconst preparedChangeset = proposedChange.preparedChangeset;\nif (!preparedChangeset || preparedChangeset.length === 0) {\n return {\n changeset: [],\n events: [\n {\n type: \"Conversation/Proposed Change Invalid\",\n reason: \"Proposed change is missing prepared changeset at \" + path\n }\n ]\n };\n}\n\nreturn {\n changeset: preparedChangeset.concat({ op: 'remove', path })\n};\n";
|
|
959
|
-
};
|
|
960
|
-
readonly name: "Prepare";
|
|
961
|
-
readonly type: {
|
|
962
|
-
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
963
|
-
};
|
|
964
|
-
}, {
|
|
965
|
-
readonly changeset: {
|
|
966
|
-
readonly type: {
|
|
967
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
968
|
-
};
|
|
969
|
-
readonly value: "${steps.Prepare.changeset}";
|
|
970
|
-
};
|
|
971
|
-
readonly name: "Apply";
|
|
972
|
-
readonly type: {
|
|
973
|
-
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
974
|
-
};
|
|
975
|
-
}];
|
|
976
|
-
};
|
|
977
|
-
readonly type: {
|
|
978
|
-
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
979
|
-
};
|
|
980
|
-
};
|
|
981
|
-
readonly GfqZJJtSJfd69v3pJ67XURdzhC4byWJZAstCh6i4X6MZ: {
|
|
982
|
-
readonly description: "Discards a previously proposed change by removing its proposal state.";
|
|
983
|
-
readonly name: "Reject Change Workflow";
|
|
984
|
-
readonly postfix: {
|
|
985
|
-
readonly description: "Optional postfix used while building proposed change state key.";
|
|
986
|
-
readonly type: {
|
|
987
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
988
|
-
};
|
|
989
|
-
};
|
|
990
|
-
readonly steps: {
|
|
991
|
-
readonly items: readonly [{
|
|
992
|
-
readonly code: {
|
|
993
|
-
readonly type: {
|
|
994
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
995
|
-
};
|
|
996
|
-
readonly value: "const postfix = currentContract.postfix || ''\nconst path = '/proposedChange' + postfix\n\nconst proposedChange = document(path)\nif (proposedChange) {\n return {\n changeset: [{ op: 'remove', path }]\n }\n}\n\nreturn {\n changeset: [],\n events: [\n {\n type: \"Conversation/Proposed Change Invalid\",\n reason: \"Proposed change does not exist at \" + path\n }\n ]\n};\n";
|
|
997
|
-
};
|
|
998
|
-
readonly name: "Prepare";
|
|
999
|
-
readonly type: {
|
|
1000
|
-
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
1001
|
-
};
|
|
1002
|
-
}, {
|
|
1003
|
-
readonly changeset: {
|
|
1004
|
-
readonly type: {
|
|
1005
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
1006
|
-
};
|
|
1007
|
-
readonly value: "${steps.Prepare.changeset}";
|
|
1008
|
-
};
|
|
1009
|
-
readonly name: "Apply";
|
|
1010
|
-
readonly type: {
|
|
1011
|
-
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
1012
|
-
};
|
|
1013
|
-
}];
|
|
1014
|
-
};
|
|
1015
|
-
readonly type: {
|
|
1016
|
-
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
1017
|
-
};
|
|
1018
|
-
};
|
|
1019
1007
|
readonly Guus3kHbivXvy5G93yhiKs3Pc8sxCc4XVvSo7CqLsQEc: {
|
|
1020
1008
|
readonly description: "A final state indicating that the document encountered an unrecoverable\nerror and could not complete its process.\n";
|
|
1021
1009
|
readonly mode: {
|
|
@@ -1029,6 +1017,18 @@ export declare const contents: {
|
|
|
1029
1017
|
readonly blueId: "58B8orsFkxxy7bWqjLXJmtBs2b5rwnNQNbeoAbGhPkJc";
|
|
1030
1018
|
};
|
|
1031
1019
|
};
|
|
1020
|
+
readonly GzA8QNJnfYyFpFKmeM2HWzXJxYXoWgW6PtbyCAHhgoy4: {
|
|
1021
|
+
readonly description: "Operation to propose a document change for later acceptance or rejection.";
|
|
1022
|
+
readonly name: "Propose Change Operation";
|
|
1023
|
+
readonly request: {
|
|
1024
|
+
readonly type: {
|
|
1025
|
+
readonly blueId: "6KZwmcsyYNiJhn2pAfS9LAFTxTRHcDw4yzPwV3A3SSQp";
|
|
1026
|
+
};
|
|
1027
|
+
};
|
|
1028
|
+
readonly type: {
|
|
1029
|
+
readonly blueId: "BoAiqVUZv9Fum3wFqaX2JnQMBHJLxJSo2V9U2UBmCfsC";
|
|
1030
|
+
};
|
|
1031
|
+
};
|
|
1032
1032
|
readonly HH5u8PwvdXrARNkT4oyWR4QjgkwhKfPWGnNtEwfUBiUg: {
|
|
1033
1033
|
readonly description: "Response event confirming completion of the document bootstrap.";
|
|
1034
1034
|
readonly documentId: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packages/conversation/contents/index.ts"],"names":[],"mappings":"AA+CA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packages/conversation/contents/index.ts"],"names":[],"mappings":"AA+CA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CX,CAAC"}
|