@blue-repository/types 0.11.0 → 0.13.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 +2 -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 +204 -204
- 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 +255 -255
- 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 +256 -256
- package/package.json +2 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { DocumentBootstrapResponded } from './DocumentBootstrapResponded.js';
|
|
2
|
+
export { AcceptChangeWorkflow } from './AcceptChangeWorkflow.js';
|
|
2
3
|
export { TriggerEvent } from './TriggerEvent.js';
|
|
3
|
-
export { ProposeChangeOperation } from './ProposeChangeOperation.js';
|
|
4
4
|
export { Response } from './Response.js';
|
|
5
5
|
export { Timeline } from './Timeline.js';
|
|
6
|
+
export { ChangeWorkflow } from './ChangeWorkflow.js';
|
|
6
7
|
export { RejectChangeOperation } from './RejectChangeOperation.js';
|
|
7
8
|
export { StatusInProgress } from './StatusInProgress.js';
|
|
8
9
|
export { DocumentStatus } from './DocumentStatus.js';
|
|
@@ -10,35 +11,34 @@ export { Event } from './Event.js';
|
|
|
10
11
|
export { LifecycleEvent } from './LifecycleEvent.js';
|
|
11
12
|
export { ContractsChangePolicy } from './ContractsChangePolicy.js';
|
|
12
13
|
export { CustomerConsent } from './CustomerConsent.js';
|
|
14
|
+
export { ProposeChangeWorkflow } from './ProposeChangeWorkflow.js';
|
|
13
15
|
export { DocumentBootstrapRequested } from './DocumentBootstrapRequested.js';
|
|
14
16
|
export { SequentialWorkflow } from './SequentialWorkflow.js';
|
|
15
17
|
export { InformUserAboutPendingAction } from './InformUserAboutPendingAction.js';
|
|
16
18
|
export { Request } from './Request.js';
|
|
19
|
+
export { RejectChangeWorkflow } from './RejectChangeWorkflow.js';
|
|
17
20
|
export { CustomerConsentRevoked } from './CustomerConsentRevoked.js';
|
|
18
|
-
export { ChangeRequest } from './ChangeRequest.js';
|
|
19
21
|
export { DocumentSectionChangeEntry } from './DocumentSectionChangeEntry.js';
|
|
20
22
|
export { CustomerActionRequested } from './CustomerActionRequested.js';
|
|
21
|
-
export { ChangeWorkflow } from './ChangeWorkflow.js';
|
|
22
23
|
export { ChatMessage } from './ChatMessage.js';
|
|
23
24
|
export { AcceptChangeOperation } from './AcceptChangeOperation.js';
|
|
24
25
|
export { DocumentBootstrapFailed } from './DocumentBootstrapFailed.js';
|
|
26
|
+
export { ProposeChangeOperation } from './ProposeChangeOperation.js';
|
|
25
27
|
export { Operation } from './Operation.js';
|
|
26
|
-
export { ChangeOperation } from './ChangeOperation.js';
|
|
27
28
|
export { StatusChange } from './StatusChange.js';
|
|
28
29
|
export { SequentialWorkflowOperation } from './SequentialWorkflowOperation.js';
|
|
29
30
|
export { Actor } from './Actor.js';
|
|
30
31
|
export { DocumentSectionChanges } from './DocumentSectionChanges.js';
|
|
31
32
|
export { ProposedChangeInvalid } from './ProposedChangeInvalid.js';
|
|
32
|
-
export { ProposeChangeWorkflow } from './ProposeChangeWorkflow.js';
|
|
33
33
|
export { StatusCompleted } from './StatusCompleted.js';
|
|
34
34
|
export { StatusPending } from './StatusPending.js';
|
|
35
35
|
export { TimelineChannel } from './TimelineChannel.js';
|
|
36
36
|
export { JavaScriptCode } from './JavaScriptCode.js';
|
|
37
37
|
export { TimelineEntry } from './TimelineEntry.js';
|
|
38
38
|
export { UpdateDocument } from './UpdateDocument.js';
|
|
39
|
-
export {
|
|
40
|
-
export { RejectChangeWorkflow } from './RejectChangeWorkflow.js';
|
|
39
|
+
export { ChangeRequest } from './ChangeRequest.js';
|
|
41
40
|
export { StatusFailed } from './StatusFailed.js';
|
|
41
|
+
export { ChangeOperation } from './ChangeOperation.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,18 +112,6 @@ export declare const contents: {
|
|
|
74
112
|
readonly blueId: "HYsLiqsqk7t98d5fK6YxKEQGeqBaHNVjM4rRNdxK4yUW";
|
|
75
113
|
};
|
|
76
114
|
};
|
|
77
|
-
readonly '2mJhqggRy7YTHK5bSeAitqhhjynpe8mApvQXXpcwPCxx': {
|
|
78
|
-
readonly description: "Operation to propose a document change for later acceptance or rejection.";
|
|
79
|
-
readonly name: "Propose Change Operation";
|
|
80
|
-
readonly request: {
|
|
81
|
-
readonly type: {
|
|
82
|
-
readonly blueId: "9KDfK6k1HBAyHckj5VuWXFMLkgY5cJBESKT4eoq1bnrw";
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
readonly type: {
|
|
86
|
-
readonly blueId: "BoAiqVUZv9Fum3wFqaX2JnQMBHJLxJSo2V9U2UBmCfsC";
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
115
|
readonly '36epvrpVHZLjapbeZsNodz2NDnm7XZeNZcnkWHgkP1pp': {
|
|
90
116
|
readonly description: "The base type for any event that is a direct response to a prior Request event.\n";
|
|
91
117
|
readonly inResponseTo: {
|
|
@@ -118,6 +144,44 @@ export declare const contents: {
|
|
|
118
144
|
};
|
|
119
145
|
};
|
|
120
146
|
};
|
|
147
|
+
readonly '4pFvBSYyitoq8rWqTmY5rLywU2tpZsivDUCAo5vwoAT9': {
|
|
148
|
+
readonly description: "Applies a requested changeset immediately to the document.";
|
|
149
|
+
readonly name: "Change Workflow";
|
|
150
|
+
readonly request: {
|
|
151
|
+
readonly description: "Expected request payload for this workflow.";
|
|
152
|
+
readonly type: {
|
|
153
|
+
readonly blueId: "FW7iYkzig4fepCdwfCdgNJw4DQ1fKwnAUf3YpjgfTPmG";
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
readonly steps: {
|
|
157
|
+
readonly items: readonly [{
|
|
158
|
+
readonly code: {
|
|
159
|
+
readonly type: {
|
|
160
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
161
|
+
};
|
|
162
|
+
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";
|
|
163
|
+
};
|
|
164
|
+
readonly name: "Prepare";
|
|
165
|
+
readonly type: {
|
|
166
|
+
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
167
|
+
};
|
|
168
|
+
}, {
|
|
169
|
+
readonly changeset: {
|
|
170
|
+
readonly type: {
|
|
171
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
172
|
+
};
|
|
173
|
+
readonly value: "${steps.Prepare.changeset}";
|
|
174
|
+
};
|
|
175
|
+
readonly name: "Apply";
|
|
176
|
+
readonly type: {
|
|
177
|
+
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
178
|
+
};
|
|
179
|
+
}];
|
|
180
|
+
};
|
|
181
|
+
readonly type: {
|
|
182
|
+
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
183
|
+
};
|
|
184
|
+
};
|
|
121
185
|
readonly '4T5AmhKAXSJAAHDEjtVJ2FQgCyz2qyd9qG5uoh627Ux6': {
|
|
122
186
|
readonly description: "Operation to reject a previously proposed change.";
|
|
123
187
|
readonly name: "Reject Change Operation";
|
|
@@ -404,6 +468,50 @@ export declare const contents: {
|
|
|
404
468
|
};
|
|
405
469
|
};
|
|
406
470
|
};
|
|
471
|
+
readonly '7dUt8jiX5vGeZL7wVzWFA8uEw37T6oPgC8KyDZmqxeSj': {
|
|
472
|
+
readonly description: "Stores a proposed change under /proposedChange{postfix}.";
|
|
473
|
+
readonly name: "Propose Change Workflow";
|
|
474
|
+
readonly postfix: {
|
|
475
|
+
readonly description: "Optional postfix used while building proposed change state key.";
|
|
476
|
+
readonly type: {
|
|
477
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
478
|
+
};
|
|
479
|
+
};
|
|
480
|
+
readonly request: {
|
|
481
|
+
readonly description: "Expected request payload for this workflow.";
|
|
482
|
+
readonly type: {
|
|
483
|
+
readonly blueId: "FW7iYkzig4fepCdwfCdgNJw4DQ1fKwnAUf3YpjgfTPmG";
|
|
484
|
+
};
|
|
485
|
+
};
|
|
486
|
+
readonly steps: {
|
|
487
|
+
readonly items: readonly [{
|
|
488
|
+
readonly code: {
|
|
489
|
+
readonly type: {
|
|
490
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
491
|
+
};
|
|
492
|
+
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";
|
|
493
|
+
};
|
|
494
|
+
readonly name: "Prepare";
|
|
495
|
+
readonly type: {
|
|
496
|
+
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
497
|
+
};
|
|
498
|
+
}, {
|
|
499
|
+
readonly changeset: {
|
|
500
|
+
readonly type: {
|
|
501
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
502
|
+
};
|
|
503
|
+
readonly value: "${steps.Prepare.changeset}";
|
|
504
|
+
};
|
|
505
|
+
readonly name: "Apply";
|
|
506
|
+
readonly type: {
|
|
507
|
+
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
508
|
+
};
|
|
509
|
+
}];
|
|
510
|
+
};
|
|
511
|
+
readonly type: {
|
|
512
|
+
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
513
|
+
};
|
|
514
|
+
};
|
|
407
515
|
readonly '7JqBn4KcmZbHBBiQf3CAfpHBNaTKS1qhtkATsF7f6Sxg': {
|
|
408
516
|
readonly bootstrapAssignee: {
|
|
409
517
|
readonly description: "Channel name of a participant in the requesting document which is asked to bootstrap the requested document";
|
|
@@ -516,45 +624,58 @@ export declare const contents: {
|
|
|
516
624
|
readonly blueId: "5Wz4G9qcnBJnntYRkz4dgLK5bSuoMpYJZj4j5M59z4we";
|
|
517
625
|
};
|
|
518
626
|
};
|
|
519
|
-
readonly '
|
|
520
|
-
readonly
|
|
521
|
-
readonly
|
|
627
|
+
readonly '9fnXwi4Za8hjEj6zDSEjhbA5dLrDzs7sxoDMGLmRT2Gz': {
|
|
628
|
+
readonly description: "Discards a previously proposed change by removing its proposal state.";
|
|
629
|
+
readonly name: "Reject Change Workflow";
|
|
630
|
+
readonly postfix: {
|
|
631
|
+
readonly description: "Optional postfix used while building proposed change state key.";
|
|
522
632
|
readonly type: {
|
|
523
633
|
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
524
634
|
};
|
|
525
635
|
};
|
|
526
|
-
readonly
|
|
527
|
-
readonly
|
|
528
|
-
readonly
|
|
529
|
-
|
|
636
|
+
readonly steps: {
|
|
637
|
+
readonly items: readonly [{
|
|
638
|
+
readonly code: {
|
|
639
|
+
readonly type: {
|
|
640
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
641
|
+
};
|
|
642
|
+
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";
|
|
643
|
+
};
|
|
644
|
+
readonly name: "Prepare";
|
|
645
|
+
readonly type: {
|
|
646
|
+
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
647
|
+
};
|
|
648
|
+
}, {
|
|
649
|
+
readonly changeset: {
|
|
650
|
+
readonly type: {
|
|
651
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
652
|
+
};
|
|
653
|
+
readonly value: "${steps.Prepare.changeset}";
|
|
654
|
+
};
|
|
655
|
+
readonly name: "Apply";
|
|
656
|
+
readonly type: {
|
|
657
|
+
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
658
|
+
};
|
|
659
|
+
}];
|
|
530
660
|
};
|
|
531
661
|
readonly type: {
|
|
532
|
-
readonly blueId: "
|
|
662
|
+
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
533
663
|
};
|
|
534
664
|
};
|
|
535
|
-
readonly '
|
|
536
|
-
readonly
|
|
537
|
-
|
|
665
|
+
readonly '9h1AhEexkxxKLYv1NHbEESYCPtvW7Nt51msGtuQC5jWK': {
|
|
666
|
+
readonly name: "Customer Consent Revoked";
|
|
667
|
+
readonly reason: {
|
|
538
668
|
readonly type: {
|
|
539
669
|
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
540
670
|
};
|
|
541
671
|
};
|
|
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
|
-
};
|
|
672
|
+
readonly revokedAt: {
|
|
547
673
|
readonly type: {
|
|
548
|
-
readonly blueId: "
|
|
674
|
+
readonly blueId: "GQaGqFxHDz64L1c9QkCbz52ths6bMVtpHnw4QDngzQYs";
|
|
549
675
|
};
|
|
550
676
|
};
|
|
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
|
-
};
|
|
677
|
+
readonly type: {
|
|
678
|
+
readonly blueId: "5Wz4G9qcnBJnntYRkz4dgLK5bSuoMpYJZj4j5M59z4we";
|
|
558
679
|
};
|
|
559
680
|
};
|
|
560
681
|
readonly '9xv7YjqsSn7W7P8rnUhSpdWGfSrgL4Jt3cmiACJT5VQs': {
|
|
@@ -628,44 +749,6 @@ export declare const contents: {
|
|
|
628
749
|
readonly blueId: "8f9UhHMbRe62sFgzQVheToaJPYi7t7HPNVvpQTbqfL5n";
|
|
629
750
|
};
|
|
630
751
|
};
|
|
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
752
|
readonly AkUKoKY1hHY1CytCrAXDPKCd4md1QGmn1WNcQtWBsyAD: {
|
|
670
753
|
readonly description: "Conversation event representing a single chat message exchanged between participants.\n";
|
|
671
754
|
readonly message: {
|
|
@@ -699,6 +782,18 @@ export declare const contents: {
|
|
|
699
782
|
readonly blueId: "36epvrpVHZLjapbeZsNodz2NDnm7XZeNZcnkWHgkP1pp";
|
|
700
783
|
};
|
|
701
784
|
};
|
|
785
|
+
readonly BeiedmmcKDhStxDnnQqUaXDJLofWSnqX6CazKTvVpfbW: {
|
|
786
|
+
readonly description: "Operation to propose a document change for later acceptance or rejection.";
|
|
787
|
+
readonly name: "Propose Change Operation";
|
|
788
|
+
readonly request: {
|
|
789
|
+
readonly type: {
|
|
790
|
+
readonly blueId: "FW7iYkzig4fepCdwfCdgNJw4DQ1fKwnAUf3YpjgfTPmG";
|
|
791
|
+
};
|
|
792
|
+
};
|
|
793
|
+
readonly type: {
|
|
794
|
+
readonly blueId: "BoAiqVUZv9Fum3wFqaX2JnQMBHJLxJSo2V9U2UBmCfsC";
|
|
795
|
+
};
|
|
796
|
+
};
|
|
702
797
|
readonly BoAiqVUZv9Fum3wFqaX2JnQMBHJLxJSo2V9U2UBmCfsC: {
|
|
703
798
|
readonly channel: {
|
|
704
799
|
readonly description: "Contracts-map key of the Channel in this scope on which Operation Request events are sent to invoke this operation.\n";
|
|
@@ -715,18 +810,6 @@ export declare const contents: {
|
|
|
715
810
|
readonly blueId: "7QACj919YMRvFCTELCf6jfQTp41RVhtHdE6bPazLUZQ6";
|
|
716
811
|
};
|
|
717
812
|
};
|
|
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
813
|
readonly C48nKSkbxraMSv4gCiGYVHKFjmtK12k63Yasn95zknWE: {
|
|
731
814
|
readonly description: "An event indicating that the document's status has transitioned.";
|
|
732
815
|
readonly name: "Status Change";
|
|
@@ -801,50 +884,6 @@ export declare const contents: {
|
|
|
801
884
|
readonly blueId: "5Wz4G9qcnBJnntYRkz4dgLK5bSuoMpYJZj4j5M59z4we";
|
|
802
885
|
};
|
|
803
886
|
};
|
|
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
887
|
readonly EhPFqrRCreg7StsZEcW8fRQ1FQVdqYSsMSis2CHHJZ1G: {
|
|
849
888
|
readonly description: "A successful final state. The document has achieved its goal and its\nprocess has finished as expected.\n";
|
|
850
889
|
readonly mode: {
|
|
@@ -940,81 +979,30 @@ export declare const contents: {
|
|
|
940
979
|
readonly blueId: "HYsLiqsqk7t98d5fK6YxKEQGeqBaHNVjM4rRNdxK4yUW";
|
|
941
980
|
};
|
|
942
981
|
};
|
|
943
|
-
readonly
|
|
944
|
-
readonly
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
982
|
+
readonly FW7iYkzig4fepCdwfCdgNJw4DQ1fKwnAUf3YpjgfTPmG: {
|
|
983
|
+
readonly changeset: {
|
|
984
|
+
readonly description: "RFC 6902 patch entries outside /contracts (blocked by policy if it touches /contracts).";
|
|
985
|
+
readonly itemType: {
|
|
986
|
+
readonly blueId: "Bz49DbfqKC1yJeCfv5RYPZUKTfb7rtZnmreCaz4RsXn5";
|
|
987
|
+
};
|
|
948
988
|
readonly type: {
|
|
949
|
-
readonly blueId: "
|
|
989
|
+
readonly blueId: "6aehfNAxHLC1PHHoDr3tYtFH3RWNbiWdFancJ1bypXEY";
|
|
950
990
|
};
|
|
951
991
|
};
|
|
952
|
-
readonly
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
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";
|
|
992
|
+
readonly description: "Payload for propose and direct change operations.";
|
|
993
|
+
readonly name: "Change Request";
|
|
994
|
+
readonly sectionChanges: {
|
|
995
|
+
readonly description: "Section-based /contracts mutations (required when Contracts Change Policy is enabled).";
|
|
996
|
+
readonly type: {
|
|
997
|
+
readonly blueId: "DEmFwGa1sWm2BKhrN98LREKiB8j8B8kFAo7KBkkaojnN";
|
|
998
|
+
};
|
|
979
999
|
};
|
|
980
|
-
|
|
981
|
-
|
|
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.";
|
|
1000
|
+
readonly summary: {
|
|
1001
|
+
readonly description: "Human-readable summary of the requested change. Required when proposal is created.";
|
|
986
1002
|
readonly type: {
|
|
987
1003
|
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
988
1004
|
};
|
|
989
1005
|
};
|
|
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
1006
|
};
|
|
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";
|
|
@@ -1029,6 +1017,18 @@ export declare const contents: {
|
|
|
1029
1017
|
readonly blueId: "58B8orsFkxxy7bWqjLXJmtBs2b5rwnNQNbeoAbGhPkJc";
|
|
1030
1018
|
};
|
|
1031
1019
|
};
|
|
1020
|
+
readonly Hd5uuFjqxyw5mrFPgJf2mcatij8ddtmGAMJu9ij5K1tc: {
|
|
1021
|
+
readonly description: "Operation that applies a changeset immediately without proposal/accept.";
|
|
1022
|
+
readonly name: "Change Operation";
|
|
1023
|
+
readonly request: {
|
|
1024
|
+
readonly type: {
|
|
1025
|
+
readonly blueId: "FW7iYkzig4fepCdwfCdgNJw4DQ1fKwnAUf3YpjgfTPmG";
|
|
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,
|
|
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,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,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,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,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,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,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,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,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,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"}
|