@blue-repository/types 0.22.0 → 0.23.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 +3 -3
- package/dist/packages/conversation/blue-ids.js +3 -3
- 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/ProposeChangeWorkflow.d.ts +1 -1
- package/dist/packages/conversation/contents/ProposeChangeWorkflow.js +1 -1
- 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 +80 -80
- package/dist/packages/conversation/contents/index.d.ts.map +1 -1
- package/dist/packages/conversation/contents/index.js +7 -7
- package/dist/packages/conversation/contents/index.js.map +1 -1
- package/dist/packages/conversation/index.d.ts +93 -93
- package/dist/packages/conversation/meta.d.ts +12 -12
- package/dist/packages/conversation/meta.js +9 -9
- package/dist/packages/conversation/meta.js.map +1 -1
- package/dist/packages/conversation/schemas/index.d.ts +3 -3
- package/dist/packages/conversation/schemas/index.js +3 -3
- package/dist/packages/conversation/schemas/index.js.map +1 -1
- package/dist/repository.d.ts +94 -94
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/meta.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const name: "Blue Repository";
|
|
2
|
-
export declare const repositoryVersions: readonly ["CQn9FCus2xkhgCdSZQqKQmKGRLKnqTboSyiJXn3pya68", "22xxEjtpjUSpttaRiHX5XbmGNcFhpgLipai685YMdMWv", "58apGqo2EExaKTQQJmjASbj8p7tHvrWkoQVjWeWzaox5", "C6oygUcsKjgqmSej2DMZkuDMqT7frfFL3t11gHGMFebY", "5FLaqPWQ7FJF5DFyCy1H4Ry9SHvX2ByfLbgJ2U3QTqUx", "EpNsiwie3wUf5Hqeo9fdiycvemBQm681hXEaWPEKNAuF", "EpCTtQtiyxppoVxqFbVZLiV7684165ENL3M2qwJigMFP", "9HWPEq8AoXuWtmsqgbxYqFqpuizJg1RdXmfEQA1qhsbi", "2X96EiMnmws7kmgtS3bgGm38NHGBwXeViAxmGqkxyiDT", "Aig1A2dxJCJkXPYQLyPSXhXJUdBDULKq2cFVv1mv2Uvg", "FLEAJh7wxmniwWikxfZmDDZvHKjBKuNQeBbQUbBqdJ7E", "8woWtWYyJxmzPJhAv5SptmZJsyXAq2Q2ckF4jtwDQJPE"];
|
|
2
|
+
export declare const repositoryVersions: readonly ["CQn9FCus2xkhgCdSZQqKQmKGRLKnqTboSyiJXn3pya68", "22xxEjtpjUSpttaRiHX5XbmGNcFhpgLipai685YMdMWv", "58apGqo2EExaKTQQJmjASbj8p7tHvrWkoQVjWeWzaox5", "C6oygUcsKjgqmSej2DMZkuDMqT7frfFL3t11gHGMFebY", "5FLaqPWQ7FJF5DFyCy1H4Ry9SHvX2ByfLbgJ2U3QTqUx", "EpNsiwie3wUf5Hqeo9fdiycvemBQm681hXEaWPEKNAuF", "EpCTtQtiyxppoVxqFbVZLiV7684165ENL3M2qwJigMFP", "9HWPEq8AoXuWtmsqgbxYqFqpuizJg1RdXmfEQA1qhsbi", "2X96EiMnmws7kmgtS3bgGm38NHGBwXeViAxmGqkxyiDT", "Aig1A2dxJCJkXPYQLyPSXhXJUdBDULKq2cFVv1mv2Uvg", "FLEAJh7wxmniwWikxfZmDDZvHKjBKuNQeBbQUbBqdJ7E", "8woWtWYyJxmzPJhAv5SptmZJsyXAq2Q2ckF4jtwDQJPE", "EQTRE5bBZZb7P6GB6r3p9scPTTgwbR1SHFhYePo3ji4x"];
|
|
3
3
|
declare const _default: {
|
|
4
4
|
readonly name: "Blue Repository";
|
|
5
|
-
readonly repositoryVersions: readonly ["CQn9FCus2xkhgCdSZQqKQmKGRLKnqTboSyiJXn3pya68", "22xxEjtpjUSpttaRiHX5XbmGNcFhpgLipai685YMdMWv", "58apGqo2EExaKTQQJmjASbj8p7tHvrWkoQVjWeWzaox5", "C6oygUcsKjgqmSej2DMZkuDMqT7frfFL3t11gHGMFebY", "5FLaqPWQ7FJF5DFyCy1H4Ry9SHvX2ByfLbgJ2U3QTqUx", "EpNsiwie3wUf5Hqeo9fdiycvemBQm681hXEaWPEKNAuF", "EpCTtQtiyxppoVxqFbVZLiV7684165ENL3M2qwJigMFP", "9HWPEq8AoXuWtmsqgbxYqFqpuizJg1RdXmfEQA1qhsbi", "2X96EiMnmws7kmgtS3bgGm38NHGBwXeViAxmGqkxyiDT", "Aig1A2dxJCJkXPYQLyPSXhXJUdBDULKq2cFVv1mv2Uvg", "FLEAJh7wxmniwWikxfZmDDZvHKjBKuNQeBbQUbBqdJ7E", "8woWtWYyJxmzPJhAv5SptmZJsyXAq2Q2ckF4jtwDQJPE"];
|
|
5
|
+
readonly repositoryVersions: readonly ["CQn9FCus2xkhgCdSZQqKQmKGRLKnqTboSyiJXn3pya68", "22xxEjtpjUSpttaRiHX5XbmGNcFhpgLipai685YMdMWv", "58apGqo2EExaKTQQJmjASbj8p7tHvrWkoQVjWeWzaox5", "C6oygUcsKjgqmSej2DMZkuDMqT7frfFL3t11gHGMFebY", "5FLaqPWQ7FJF5DFyCy1H4Ry9SHvX2ByfLbgJ2U3QTqUx", "EpNsiwie3wUf5Hqeo9fdiycvemBQm681hXEaWPEKNAuF", "EpCTtQtiyxppoVxqFbVZLiV7684165ENL3M2qwJigMFP", "9HWPEq8AoXuWtmsqgbxYqFqpuizJg1RdXmfEQA1qhsbi", "2X96EiMnmws7kmgtS3bgGm38NHGBwXeViAxmGqkxyiDT", "Aig1A2dxJCJkXPYQLyPSXhXJUdBDULKq2cFVv1mv2Uvg", "FLEAJh7wxmniwWikxfZmDDZvHKjBKuNQeBbQUbBqdJ7E", "8woWtWYyJxmzPJhAv5SptmZJsyXAq2Q2ckF4jtwDQJPE", "EQTRE5bBZZb7P6GB6r3p9scPTTgwbR1SHFhYePo3ji4x"];
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
8
|
//# sourceMappingURL=meta.d.ts.map
|
package/dist/meta.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,EAAG,iBAA0B,CAAC;AAC/C,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,EAAG,iBAA0B,CAAC;AAC/C,eAAO,MAAM,kBAAkB,2nBAcrB,CAAC;;;;;AACX,wBAAqD"}
|
package/dist/meta.js
CHANGED
|
@@ -12,6 +12,7 @@ export const repositoryVersions = [
|
|
|
12
12
|
'Aig1A2dxJCJkXPYQLyPSXhXJUdBDULKq2cFVv1mv2Uvg',
|
|
13
13
|
'FLEAJh7wxmniwWikxfZmDDZvHKjBKuNQeBbQUbBqdJ7E',
|
|
14
14
|
'8woWtWYyJxmzPJhAv5SptmZJsyXAq2Q2ckF4jtwDQJPE',
|
|
15
|
+
'EQTRE5bBZZb7P6GB6r3p9scPTTgwbR1SHFhYePo3ji4x',
|
|
15
16
|
];
|
|
16
17
|
export default { name, repositoryVersions };
|
|
17
18
|
//# sourceMappingURL=meta.js.map
|
package/dist/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,iBAA0B,CAAC;AAC/C,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;CACtC,CAAC;AACX,eAAe,EAAE,IAAI,EAAE,kBAAkB,EAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,iBAA0B,CAAC;AAC/C,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;CACtC,CAAC;AACX,eAAe,EAAE,IAAI,EAAE,kBAAkB,EAAW,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const blueIds: {
|
|
2
2
|
readonly 'Conversation/Accept Change Operation': "APk3siB8g9pvWLG3qyqtGjRNNGB7RDpFWQtG4epj5Avv";
|
|
3
|
-
readonly 'Conversation/Accept Change Workflow': "
|
|
3
|
+
readonly 'Conversation/Accept Change Workflow': "Eh2y8JypsGTdFMpEGEK64vBdGtaJ9Q7Q5t7ChqHafwCV";
|
|
4
4
|
readonly 'Conversation/Actor': "CN5efWVizJbRsMCw8YWRfT2q9vM9XfeGDN9wFvYcvMnQ";
|
|
5
5
|
readonly 'Conversation/Change Operation': "Hd5uuFjqxyw5mrFPgJf2mcatij8ddtmGAMJu9ij5K1tc";
|
|
6
6
|
readonly 'Conversation/Change Request': "FW7iYkzig4fepCdwfCdgNJw4DQ1fKwnAUf3YpjgfTPmG";
|
|
@@ -27,10 +27,10 @@ export declare const blueIds: {
|
|
|
27
27
|
readonly 'Conversation/Operation': "BoAiqVUZv9Fum3wFqaX2JnQMBHJLxJSo2V9U2UBmCfsC";
|
|
28
28
|
readonly 'Conversation/Operation Request': "HM4Ku4LFcjC5MxnhPMRwQ8w3BbHmJKKZfHTTzsd4jbJq";
|
|
29
29
|
readonly 'Conversation/Propose Change Operation': "BeiedmmcKDhStxDnnQqUaXDJLofWSnqX6CazKTvVpfbW";
|
|
30
|
-
readonly 'Conversation/Propose Change Workflow': "
|
|
30
|
+
readonly 'Conversation/Propose Change Workflow': "7icTT1chbH3UA2ybXgpfSSyNEAR4Wmm3EkbdGFaZSydo";
|
|
31
31
|
readonly 'Conversation/Proposed Change Invalid': "EbGQYtYR9UNAxcn7auCCujXmnz6DWxMpqVcgYSsKE85M";
|
|
32
32
|
readonly 'Conversation/Reject Change Operation': "4T5AmhKAXSJAAHDEjtVJ2FQgCyz2qyd9qG5uoh627Ux6";
|
|
33
|
-
readonly 'Conversation/Reject Change Workflow': "
|
|
33
|
+
readonly 'Conversation/Reject Change Workflow': "DUjCaEniHH5oDXU3Ss5jWWft3pT9TUcNhv7HoCDU1NTB";
|
|
34
34
|
readonly 'Conversation/Request': "8f9UhHMbRe62sFgzQVheToaJPYi7t7HPNVvpQTbqfL5n";
|
|
35
35
|
readonly 'Conversation/Response': "36epvrpVHZLjapbeZsNodz2NDnm7XZeNZcnkWHgkP1pp";
|
|
36
36
|
readonly 'Conversation/Sequential Workflow': "7X3LkN54Yp88JgZbppPhP6hM3Jqiqv8Z2i4kS7phXtQe";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const blueIds = {
|
|
2
2
|
'Conversation/Accept Change Operation': 'APk3siB8g9pvWLG3qyqtGjRNNGB7RDpFWQtG4epj5Avv',
|
|
3
|
-
'Conversation/Accept Change Workflow': '
|
|
3
|
+
'Conversation/Accept Change Workflow': 'Eh2y8JypsGTdFMpEGEK64vBdGtaJ9Q7Q5t7ChqHafwCV',
|
|
4
4
|
'Conversation/Actor': 'CN5efWVizJbRsMCw8YWRfT2q9vM9XfeGDN9wFvYcvMnQ',
|
|
5
5
|
'Conversation/Change Operation': 'Hd5uuFjqxyw5mrFPgJf2mcatij8ddtmGAMJu9ij5K1tc',
|
|
6
6
|
'Conversation/Change Request': 'FW7iYkzig4fepCdwfCdgNJw4DQ1fKwnAUf3YpjgfTPmG',
|
|
@@ -27,10 +27,10 @@ export const blueIds = {
|
|
|
27
27
|
'Conversation/Operation': 'BoAiqVUZv9Fum3wFqaX2JnQMBHJLxJSo2V9U2UBmCfsC',
|
|
28
28
|
'Conversation/Operation Request': 'HM4Ku4LFcjC5MxnhPMRwQ8w3BbHmJKKZfHTTzsd4jbJq',
|
|
29
29
|
'Conversation/Propose Change Operation': 'BeiedmmcKDhStxDnnQqUaXDJLofWSnqX6CazKTvVpfbW',
|
|
30
|
-
'Conversation/Propose Change Workflow': '
|
|
30
|
+
'Conversation/Propose Change Workflow': '7icTT1chbH3UA2ybXgpfSSyNEAR4Wmm3EkbdGFaZSydo',
|
|
31
31
|
'Conversation/Proposed Change Invalid': 'EbGQYtYR9UNAxcn7auCCujXmnz6DWxMpqVcgYSsKE85M',
|
|
32
32
|
'Conversation/Reject Change Operation': '4T5AmhKAXSJAAHDEjtVJ2FQgCyz2qyd9qG5uoh627Ux6',
|
|
33
|
-
'Conversation/Reject Change Workflow': '
|
|
33
|
+
'Conversation/Reject Change Workflow': 'DUjCaEniHH5oDXU3Ss5jWWft3pT9TUcNhv7HoCDU1NTB',
|
|
34
34
|
'Conversation/Request': '8f9UhHMbRe62sFgzQVheToaJPYi7t7HPNVvpQTbqfL5n',
|
|
35
35
|
'Conversation/Response': '36epvrpVHZLjapbeZsNodz2NDnm7XZeNZcnkWHgkP1pp',
|
|
36
36
|
'Conversation/Sequential Workflow': '7X3LkN54Yp88JgZbppPhP6hM3Jqiqv8Z2i4kS7phXtQe',
|
|
@@ -13,7 +13,7 @@ export declare const AcceptChangeWorkflow: {
|
|
|
13
13
|
readonly type: {
|
|
14
14
|
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
15
15
|
};
|
|
16
|
-
readonly value: "const invalid = (reason) => ({\n changeset: [],\n events: [{ type: 'Conversation/Proposed Change Invalid', reason }]\n});\n\nconst isArray = Array.isArray;\n\nconst
|
|
16
|
+
readonly value: "const invalid = (reason) => ({\n changeset: [],\n events: [{ type: 'Conversation/Proposed Change Invalid', reason }]\n});\n\nconst isArray = Array.isArray;\n\nconst postfixNode = canon.at(currentContractCanonical, '/postfix');\nconst postfixValue =\n typeof postfixNode?.value === 'string' ? postfixNode.value : '';\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";
|
|
17
17
|
};
|
|
18
18
|
readonly name: "Prepare";
|
|
19
19
|
readonly type: {
|
|
@@ -14,7 +14,7 @@ export const AcceptChangeWorkflow = {
|
|
|
14
14
|
type: {
|
|
15
15
|
blueId: 'DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K',
|
|
16
16
|
},
|
|
17
|
-
value: "const invalid = (reason) => ({\n changeset: [],\n events: [{ type: 'Conversation/Proposed Change Invalid', reason }]\n});\n\nconst isArray = Array.isArray;\n\nconst
|
|
17
|
+
value: "const invalid = (reason) => ({\n changeset: [],\n events: [{ type: 'Conversation/Proposed Change Invalid', reason }]\n});\n\nconst isArray = Array.isArray;\n\nconst postfixNode = canon.at(currentContractCanonical, '/postfix');\nconst postfixValue =\n typeof postfixNode?.value === 'string' ? postfixNode.value : '';\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",
|
|
18
18
|
},
|
|
19
19
|
name: 'Prepare',
|
|
20
20
|
type: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcceptChangeWorkflow.js","sourceRoot":"","sources":["../../../../src/packages/conversation/contents/AcceptChangeWorkflow.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EACT,sEAAsE;IACxE,IAAI,EAAE,wBAAwB;IAC9B,OAAO,EAAE;QACP,WAAW,EACT,iEAAiE;QACnE,IAAI,EAAE;YACJ,MAAM,EAAE,8CAA8C;SACvD;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE;wBACJ,MAAM,EAAE,8CAA8C;qBACvD;oBACD,KAAK,EACH,
|
|
1
|
+
{"version":3,"file":"AcceptChangeWorkflow.js","sourceRoot":"","sources":["../../../../src/packages/conversation/contents/AcceptChangeWorkflow.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EACT,sEAAsE;IACxE,IAAI,EAAE,wBAAwB;IAC9B,OAAO,EAAE;QACP,WAAW,EACT,iEAAiE;QACnE,IAAI,EAAE;YACJ,MAAM,EAAE,8CAA8C;SACvD;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE;wBACJ,MAAM,EAAE,8CAA8C;qBACvD;oBACD,KAAK,EACH,0iOAA0iO;iBAC7iO;gBACD,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE;oBACJ,MAAM,EAAE,8CAA8C;iBACvD;aACF;YACD;gBACE,SAAS,EAAE;oBACT,IAAI,EAAE;wBACJ,MAAM,EAAE,8CAA8C;qBACvD;oBACD,KAAK,EAAE,4BAA4B;iBACpC;gBACD,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE;oBACJ,MAAM,EAAE,8CAA8C;iBACvD;aACF;SACF;KACF;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,8CAA8C;KACvD;CACO,CAAC"}
|
|
@@ -19,7 +19,7 @@ export declare const ProposeChangeWorkflow: {
|
|
|
19
19
|
readonly type: {
|
|
20
20
|
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
21
21
|
};
|
|
22
|
-
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
|
|
22
|
+
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 postfixNode = canon.at(currentContractCanonical, '/postfix');\nconst postfixValue =\n typeof postfixNode?.value === 'string' ? postfixNode.value : '';\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";
|
|
23
23
|
};
|
|
24
24
|
readonly name: "Prepare";
|
|
25
25
|
readonly type: {
|
|
@@ -20,7 +20,7 @@ export const ProposeChangeWorkflow = {
|
|
|
20
20
|
type: {
|
|
21
21
|
blueId: 'DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K',
|
|
22
22
|
},
|
|
23
|
-
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
|
|
23
|
+
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 postfixNode = canon.at(currentContractCanonical, '/postfix');\nconst postfixValue =\n typeof postfixNode?.value === 'string' ? postfixNode.value : '';\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",
|
|
24
24
|
},
|
|
25
25
|
name: 'Prepare',
|
|
26
26
|
type: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProposeChangeWorkflow.js","sourceRoot":"","sources":["../../../../src/packages/conversation/contents/ProposeChangeWorkflow.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,WAAW,EAAE,0DAA0D;IACvE,IAAI,EAAE,yBAAyB;IAC/B,OAAO,EAAE;QACP,WAAW,EACT,iEAAiE;QACnE,IAAI,EAAE;YACJ,MAAM,EAAE,8CAA8C;SACvD;KACF;IACD,OAAO,EAAE;QACP,WAAW,EAAE,6CAA6C;QAC1D,IAAI,EAAE;YACJ,MAAM,EAAE,8CAA8C;SACvD;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE;wBACJ,MAAM,EAAE,8CAA8C;qBACvD;oBACD,KAAK,EACH,
|
|
1
|
+
{"version":3,"file":"ProposeChangeWorkflow.js","sourceRoot":"","sources":["../../../../src/packages/conversation/contents/ProposeChangeWorkflow.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,WAAW,EAAE,0DAA0D;IACvE,IAAI,EAAE,yBAAyB;IAC/B,OAAO,EAAE;QACP,WAAW,EACT,iEAAiE;QACnE,IAAI,EAAE;YACJ,MAAM,EAAE,8CAA8C;SACvD;KACF;IACD,OAAO,EAAE;QACP,WAAW,EAAE,6CAA6C;QAC1D,IAAI,EAAE;YACJ,MAAM,EAAE,8CAA8C;SACvD;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE;wBACJ,MAAM,EAAE,8CAA8C;qBACvD;oBACD,KAAK,EACH,ypBAAypB;iBAC5pB;gBACD,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE;oBACJ,MAAM,EAAE,8CAA8C;iBACvD;aACF;YACD;gBACE,SAAS,EAAE;oBACT,IAAI,EAAE;wBACJ,MAAM,EAAE,8CAA8C;qBACvD;oBACD,KAAK,EAAE,4BAA4B;iBACpC;gBACD,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE;oBACJ,MAAM,EAAE,8CAA8C;iBACvD;aACF;SACF;KACF;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,8CAA8C;KACvD;CACO,CAAC"}
|
|
@@ -13,7 +13,7 @@ export declare const RejectChangeWorkflow: {
|
|
|
13
13
|
readonly type: {
|
|
14
14
|
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
15
15
|
};
|
|
16
|
-
readonly value: "const invalid = (reason) => ({\n changeset: [],\n events: [{ type: 'Conversation/Proposed Change Invalid', reason }]\n});\n\nconst
|
|
16
|
+
readonly value: "const invalid = (reason) => ({\n changeset: [],\n events: [{ type: 'Conversation/Proposed Change Invalid', reason }]\n});\n\nconst postfixNode = canon.at(currentContractCanonical, '/postfix');\nconst postfixValue =\n typeof postfixNode?.value === 'string' ? postfixNode.value : '';\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";
|
|
17
17
|
};
|
|
18
18
|
readonly name: "Prepare";
|
|
19
19
|
readonly type: {
|
|
@@ -14,7 +14,7 @@ export const RejectChangeWorkflow = {
|
|
|
14
14
|
type: {
|
|
15
15
|
blueId: 'DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K',
|
|
16
16
|
},
|
|
17
|
-
value: "const invalid = (reason) => ({\n changeset: [],\n events: [{ type: 'Conversation/Proposed Change Invalid', reason }]\n});\n\nconst
|
|
17
|
+
value: "const invalid = (reason) => ({\n changeset: [],\n events: [{ type: 'Conversation/Proposed Change Invalid', reason }]\n});\n\nconst postfixNode = canon.at(currentContractCanonical, '/postfix');\nconst postfixValue =\n typeof postfixNode?.value === 'string' ? postfixNode.value : '';\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",
|
|
18
18
|
},
|
|
19
19
|
name: 'Prepare',
|
|
20
20
|
type: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RejectChangeWorkflow.js","sourceRoot":"","sources":["../../../../src/packages/conversation/contents/RejectChangeWorkflow.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EACT,uEAAuE;IACzE,IAAI,EAAE,wBAAwB;IAC9B,OAAO,EAAE;QACP,WAAW,EACT,iEAAiE;QACnE,IAAI,EAAE;YACJ,MAAM,EAAE,8CAA8C;SACvD;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE;wBACJ,MAAM,EAAE,8CAA8C;qBACvD;oBACD,KAAK,EACH
|
|
1
|
+
{"version":3,"file":"RejectChangeWorkflow.js","sourceRoot":"","sources":["../../../../src/packages/conversation/contents/RejectChangeWorkflow.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EACT,uEAAuE;IACzE,IAAI,EAAE,wBAAwB;IAC9B,OAAO,EAAE;QACP,WAAW,EACT,iEAAiE;QACnE,IAAI,EAAE;YACJ,MAAM,EAAE,8CAA8C;SACvD;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE;wBACJ,MAAM,EAAE,8CAA8C;qBACvD;oBACD,KAAK,EACH,wdAAwd;iBAC3d;gBACD,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE;oBACJ,MAAM,EAAE,8CAA8C;iBACvD;aACF;YACD;gBACE,SAAS,EAAE;oBACT,IAAI,EAAE;wBACJ,MAAM,EAAE,8CAA8C;qBACvD;oBACD,KAAK,EAAE,4BAA4B;iBACpC;gBACD,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE;oBACJ,MAAM,EAAE,8CAA8C;iBACvD;aACF;SACF;KACF;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,8CAA8C;KACvD;CACO,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { DocumentBootstrapResponded } from './DocumentBootstrapResponded.js';
|
|
2
|
-
export { AcceptChangeWorkflow } from './AcceptChangeWorkflow.js';
|
|
3
2
|
export { TriggerEvent } from './TriggerEvent.js';
|
|
4
3
|
export { Response } from './Response.js';
|
|
5
4
|
export { Timeline } from './Timeline.js';
|
|
@@ -17,7 +16,6 @@ export { ProposeChangeWorkflow } from './ProposeChangeWorkflow.js';
|
|
|
17
16
|
export { SequentialWorkflow } from './SequentialWorkflow.js';
|
|
18
17
|
export { InformUserAboutPendingAction } from './InformUserAboutPendingAction.js';
|
|
19
18
|
export { Request } from './Request.js';
|
|
20
|
-
export { RejectChangeWorkflow } from './RejectChangeWorkflow.js';
|
|
21
19
|
export { CustomerConsentRevoked } from './CustomerConsentRevoked.js';
|
|
22
20
|
export { DocumentSectionChangeEntry } from './DocumentSectionChangeEntry.js';
|
|
23
21
|
export { ChatMessage } from './ChatMessage.js';
|
|
@@ -29,7 +27,9 @@ export { StatusChange } from './StatusChange.js';
|
|
|
29
27
|
export { SequentialWorkflowOperation } from './SequentialWorkflowOperation.js';
|
|
30
28
|
export { Actor } from './Actor.js';
|
|
31
29
|
export { DocumentSectionChanges } from './DocumentSectionChanges.js';
|
|
30
|
+
export { RejectChangeWorkflow } from './RejectChangeWorkflow.js';
|
|
32
31
|
export { ProposedChangeInvalid } from './ProposedChangeInvalid.js';
|
|
32
|
+
export { AcceptChangeWorkflow } from './AcceptChangeWorkflow.js';
|
|
33
33
|
export { StatusCompleted } from './StatusCompleted.js';
|
|
34
34
|
export { StatusPending } from './StatusPending.js';
|
|
35
35
|
export { TimelineChannel } from './TimelineChannel.js';
|
|
@@ -65,44 +65,6 @@ export declare const contents: {
|
|
|
65
65
|
readonly blueId: "36epvrpVHZLjapbeZsNodz2NDnm7XZeNZcnkWHgkP1pp";
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
-
readonly '29xcoYKf9p47xagTDwGLuQyFrT9WBN3Sd7FaPtqLvydy': {
|
|
69
|
-
readonly description: "Applies a previously proposed change and removes its proposal state.";
|
|
70
|
-
readonly name: "Accept Change Workflow";
|
|
71
|
-
readonly postfix: {
|
|
72
|
-
readonly description: "Optional postfix used while building proposed change state key.";
|
|
73
|
-
readonly type: {
|
|
74
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
readonly steps: {
|
|
78
|
-
readonly items: readonly [{
|
|
79
|
-
readonly code: {
|
|
80
|
-
readonly type: {
|
|
81
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
82
|
-
};
|
|
83
|
-
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";
|
|
84
|
-
};
|
|
85
|
-
readonly name: "Prepare";
|
|
86
|
-
readonly type: {
|
|
87
|
-
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
88
|
-
};
|
|
89
|
-
}, {
|
|
90
|
-
readonly changeset: {
|
|
91
|
-
readonly type: {
|
|
92
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
93
|
-
};
|
|
94
|
-
readonly value: "${steps.Prepare.changeset}";
|
|
95
|
-
};
|
|
96
|
-
readonly name: "Apply";
|
|
97
|
-
readonly type: {
|
|
98
|
-
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
99
|
-
};
|
|
100
|
-
}];
|
|
101
|
-
};
|
|
102
|
-
readonly type: {
|
|
103
|
-
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
68
|
readonly '2bSWEoMSZwzf32Hnr4BDVsuq8NRjrWEpnhZvMZAJGhh2': {
|
|
107
69
|
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";
|
|
108
70
|
readonly event: {
|
|
@@ -583,7 +545,7 @@ export declare const contents: {
|
|
|
583
545
|
readonly blueId: "8f9UhHMbRe62sFgzQVheToaJPYi7t7HPNVvpQTbqfL5n";
|
|
584
546
|
};
|
|
585
547
|
};
|
|
586
|
-
readonly '
|
|
548
|
+
readonly '7icTT1chbH3UA2ybXgpfSSyNEAR4Wmm3EkbdGFaZSydo': {
|
|
587
549
|
readonly description: "Stores a proposed change under /proposedChange{postfix}.";
|
|
588
550
|
readonly name: "Propose Change Workflow";
|
|
589
551
|
readonly postfix: {
|
|
@@ -604,7 +566,7 @@ export declare const contents: {
|
|
|
604
566
|
readonly type: {
|
|
605
567
|
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
606
568
|
};
|
|
607
|
-
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
|
|
569
|
+
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 postfixNode = canon.at(currentContractCanonical, '/postfix');\nconst postfixValue =\n typeof postfixNode?.value === 'string' ? postfixNode.value : '';\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";
|
|
608
570
|
};
|
|
609
571
|
readonly name: "Prepare";
|
|
610
572
|
readonly type: {
|
|
@@ -690,44 +652,6 @@ export declare const contents: {
|
|
|
690
652
|
readonly blueId: "5Wz4G9qcnBJnntYRkz4dgLK5bSuoMpYJZj4j5M59z4we";
|
|
691
653
|
};
|
|
692
654
|
};
|
|
693
|
-
readonly '9fnXwi4Za8hjEj6zDSEjhbA5dLrDzs7sxoDMGLmRT2Gz': {
|
|
694
|
-
readonly description: "Discards a previously proposed change by removing its proposal state.";
|
|
695
|
-
readonly name: "Reject Change Workflow";
|
|
696
|
-
readonly postfix: {
|
|
697
|
-
readonly description: "Optional postfix used while building proposed change state key.";
|
|
698
|
-
readonly type: {
|
|
699
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
700
|
-
};
|
|
701
|
-
};
|
|
702
|
-
readonly steps: {
|
|
703
|
-
readonly items: readonly [{
|
|
704
|
-
readonly code: {
|
|
705
|
-
readonly type: {
|
|
706
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
707
|
-
};
|
|
708
|
-
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";
|
|
709
|
-
};
|
|
710
|
-
readonly name: "Prepare";
|
|
711
|
-
readonly type: {
|
|
712
|
-
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
713
|
-
};
|
|
714
|
-
}, {
|
|
715
|
-
readonly changeset: {
|
|
716
|
-
readonly type: {
|
|
717
|
-
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
718
|
-
};
|
|
719
|
-
readonly value: "${steps.Prepare.changeset}";
|
|
720
|
-
};
|
|
721
|
-
readonly name: "Apply";
|
|
722
|
-
readonly type: {
|
|
723
|
-
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
724
|
-
};
|
|
725
|
-
}];
|
|
726
|
-
};
|
|
727
|
-
readonly type: {
|
|
728
|
-
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
729
|
-
};
|
|
730
|
-
};
|
|
731
655
|
readonly '9h1AhEexkxxKLYv1NHbEESYCPtvW7Nt51msGtuQC5jWK': {
|
|
732
656
|
readonly name: "Customer Consent Revoked";
|
|
733
657
|
readonly reason: {
|
|
@@ -894,6 +818,44 @@ export declare const contents: {
|
|
|
894
818
|
};
|
|
895
819
|
};
|
|
896
820
|
};
|
|
821
|
+
readonly DUjCaEniHH5oDXU3Ss5jWWft3pT9TUcNhv7HoCDU1NTB: {
|
|
822
|
+
readonly description: "Discards a previously proposed change by removing its proposal state.";
|
|
823
|
+
readonly name: "Reject Change Workflow";
|
|
824
|
+
readonly postfix: {
|
|
825
|
+
readonly description: "Optional postfix used while building proposed change state key.";
|
|
826
|
+
readonly type: {
|
|
827
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
828
|
+
};
|
|
829
|
+
};
|
|
830
|
+
readonly steps: {
|
|
831
|
+
readonly items: readonly [{
|
|
832
|
+
readonly code: {
|
|
833
|
+
readonly type: {
|
|
834
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
835
|
+
};
|
|
836
|
+
readonly value: "const invalid = (reason) => ({\n changeset: [],\n events: [{ type: 'Conversation/Proposed Change Invalid', reason }]\n});\n\nconst postfixNode = canon.at(currentContractCanonical, '/postfix');\nconst postfixValue =\n typeof postfixNode?.value === 'string' ? postfixNode.value : '';\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";
|
|
837
|
+
};
|
|
838
|
+
readonly name: "Prepare";
|
|
839
|
+
readonly type: {
|
|
840
|
+
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
841
|
+
};
|
|
842
|
+
}, {
|
|
843
|
+
readonly changeset: {
|
|
844
|
+
readonly type: {
|
|
845
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
846
|
+
};
|
|
847
|
+
readonly value: "${steps.Prepare.changeset}";
|
|
848
|
+
};
|
|
849
|
+
readonly name: "Apply";
|
|
850
|
+
readonly type: {
|
|
851
|
+
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
852
|
+
};
|
|
853
|
+
}];
|
|
854
|
+
};
|
|
855
|
+
readonly type: {
|
|
856
|
+
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
857
|
+
};
|
|
858
|
+
};
|
|
897
859
|
readonly EbGQYtYR9UNAxcn7auCCujXmnz6DWxMpqVcgYSsKE85M: {
|
|
898
860
|
readonly description: "Emitted when a proposed change operation cannot be applied.";
|
|
899
861
|
readonly name: "Proposed Change Invalid";
|
|
@@ -907,6 +869,44 @@ export declare const contents: {
|
|
|
907
869
|
readonly blueId: "5Wz4G9qcnBJnntYRkz4dgLK5bSuoMpYJZj4j5M59z4we";
|
|
908
870
|
};
|
|
909
871
|
};
|
|
872
|
+
readonly Eh2y8JypsGTdFMpEGEK64vBdGtaJ9Q7Q5t7ChqHafwCV: {
|
|
873
|
+
readonly description: "Applies a previously proposed change and removes its proposal state.";
|
|
874
|
+
readonly name: "Accept Change Workflow";
|
|
875
|
+
readonly postfix: {
|
|
876
|
+
readonly description: "Optional postfix used while building proposed change state key.";
|
|
877
|
+
readonly type: {
|
|
878
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
879
|
+
};
|
|
880
|
+
};
|
|
881
|
+
readonly steps: {
|
|
882
|
+
readonly items: readonly [{
|
|
883
|
+
readonly code: {
|
|
884
|
+
readonly type: {
|
|
885
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
886
|
+
};
|
|
887
|
+
readonly value: "const invalid = (reason) => ({\n changeset: [],\n events: [{ type: 'Conversation/Proposed Change Invalid', reason }]\n});\n\nconst isArray = Array.isArray;\n\nconst postfixNode = canon.at(currentContractCanonical, '/postfix');\nconst postfixValue =\n typeof postfixNode?.value === 'string' ? postfixNode.value : '';\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";
|
|
888
|
+
};
|
|
889
|
+
readonly name: "Prepare";
|
|
890
|
+
readonly type: {
|
|
891
|
+
readonly blueId: "ExZxT61PSpWHpEAtP2WKMXXqxEYN7Z13j7Zv36Dp99kS";
|
|
892
|
+
};
|
|
893
|
+
}, {
|
|
894
|
+
readonly changeset: {
|
|
895
|
+
readonly type: {
|
|
896
|
+
readonly blueId: "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K";
|
|
897
|
+
};
|
|
898
|
+
readonly value: "${steps.Prepare.changeset}";
|
|
899
|
+
};
|
|
900
|
+
readonly name: "Apply";
|
|
901
|
+
readonly type: {
|
|
902
|
+
readonly blueId: "FtHZJzH4hqAoGxFBjsmy1svfT4BwEBB4aHpFSZycZLLa";
|
|
903
|
+
};
|
|
904
|
+
}];
|
|
905
|
+
};
|
|
906
|
+
readonly type: {
|
|
907
|
+
readonly blueId: "CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv";
|
|
908
|
+
};
|
|
909
|
+
};
|
|
910
910
|
readonly EhPFqrRCreg7StsZEcW8fRQ1FQVdqYSsMSis2CHHJZ1G: {
|
|
911
911
|
readonly description: "A successful final state. The document has achieved its goal and its\nprocess has finished as expected.\n";
|
|
912
912
|
readonly mode: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packages/conversation/contents/index.ts"],"names":[],"mappings":"AAgDA,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":"AAgDA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,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,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,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,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,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,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,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,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,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,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,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,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDX,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DocumentBootstrapResponded } from './DocumentBootstrapResponded.js';
|
|
2
|
-
import { AcceptChangeWorkflow } from './AcceptChangeWorkflow.js';
|
|
3
2
|
import { TriggerEvent } from './TriggerEvent.js';
|
|
4
3
|
import { Response } from './Response.js';
|
|
5
4
|
import { Timeline } from './Timeline.js';
|
|
@@ -17,7 +16,6 @@ import { ProposeChangeWorkflow } from './ProposeChangeWorkflow.js';
|
|
|
17
16
|
import { SequentialWorkflow } from './SequentialWorkflow.js';
|
|
18
17
|
import { InformUserAboutPendingAction } from './InformUserAboutPendingAction.js';
|
|
19
18
|
import { Request } from './Request.js';
|
|
20
|
-
import { RejectChangeWorkflow } from './RejectChangeWorkflow.js';
|
|
21
19
|
import { CustomerConsentRevoked } from './CustomerConsentRevoked.js';
|
|
22
20
|
import { DocumentSectionChangeEntry } from './DocumentSectionChangeEntry.js';
|
|
23
21
|
import { ChatMessage } from './ChatMessage.js';
|
|
@@ -29,7 +27,9 @@ import { StatusChange } from './StatusChange.js';
|
|
|
29
27
|
import { SequentialWorkflowOperation } from './SequentialWorkflowOperation.js';
|
|
30
28
|
import { Actor } from './Actor.js';
|
|
31
29
|
import { DocumentSectionChanges } from './DocumentSectionChanges.js';
|
|
30
|
+
import { RejectChangeWorkflow } from './RejectChangeWorkflow.js';
|
|
32
31
|
import { ProposedChangeInvalid } from './ProposedChangeInvalid.js';
|
|
32
|
+
import { AcceptChangeWorkflow } from './AcceptChangeWorkflow.js';
|
|
33
33
|
import { StatusCompleted } from './StatusCompleted.js';
|
|
34
34
|
import { StatusPending } from './StatusPending.js';
|
|
35
35
|
import { TimelineChannel } from './TimelineChannel.js';
|
|
@@ -46,7 +46,6 @@ import { CompositeTimelineChannel } from './CompositeTimelineChannel.js';
|
|
|
46
46
|
import { SequentialWorkflowStep } from './SequentialWorkflowStep.js';
|
|
47
47
|
import { DocumentSection } from './DocumentSection.js';
|
|
48
48
|
export { DocumentBootstrapResponded } from './DocumentBootstrapResponded.js';
|
|
49
|
-
export { AcceptChangeWorkflow } from './AcceptChangeWorkflow.js';
|
|
50
49
|
export { TriggerEvent } from './TriggerEvent.js';
|
|
51
50
|
export { Response } from './Response.js';
|
|
52
51
|
export { Timeline } from './Timeline.js';
|
|
@@ -64,7 +63,6 @@ export { ProposeChangeWorkflow } from './ProposeChangeWorkflow.js';
|
|
|
64
63
|
export { SequentialWorkflow } from './SequentialWorkflow.js';
|
|
65
64
|
export { InformUserAboutPendingAction } from './InformUserAboutPendingAction.js';
|
|
66
65
|
export { Request } from './Request.js';
|
|
67
|
-
export { RejectChangeWorkflow } from './RejectChangeWorkflow.js';
|
|
68
66
|
export { CustomerConsentRevoked } from './CustomerConsentRevoked.js';
|
|
69
67
|
export { DocumentSectionChangeEntry } from './DocumentSectionChangeEntry.js';
|
|
70
68
|
export { ChatMessage } from './ChatMessage.js';
|
|
@@ -76,7 +74,9 @@ export { StatusChange } from './StatusChange.js';
|
|
|
76
74
|
export { SequentialWorkflowOperation } from './SequentialWorkflowOperation.js';
|
|
77
75
|
export { Actor } from './Actor.js';
|
|
78
76
|
export { DocumentSectionChanges } from './DocumentSectionChanges.js';
|
|
77
|
+
export { RejectChangeWorkflow } from './RejectChangeWorkflow.js';
|
|
79
78
|
export { ProposedChangeInvalid } from './ProposedChangeInvalid.js';
|
|
79
|
+
export { AcceptChangeWorkflow } from './AcceptChangeWorkflow.js';
|
|
80
80
|
export { StatusCompleted } from './StatusCompleted.js';
|
|
81
81
|
export { StatusPending } from './StatusPending.js';
|
|
82
82
|
export { TimelineChannel } from './TimelineChannel.js';
|
|
@@ -94,7 +94,6 @@ export { SequentialWorkflowStep } from './SequentialWorkflowStep.js';
|
|
|
94
94
|
export { DocumentSection } from './DocumentSection.js';
|
|
95
95
|
export const contents = {
|
|
96
96
|
'1Ucfmhtb9xjvyLxLKSVkqXZjVVuAdXyzdjb11QG11Uv': DocumentBootstrapResponded,
|
|
97
|
-
'29xcoYKf9p47xagTDwGLuQyFrT9WBN3Sd7FaPtqLvydy': AcceptChangeWorkflow,
|
|
98
97
|
'2bSWEoMSZwzf32Hnr4BDVsuq8NRjrWEpnhZvMZAJGhh2': TriggerEvent,
|
|
99
98
|
'36epvrpVHZLjapbeZsNodz2NDnm7XZeNZcnkWHgkP1pp': Response,
|
|
100
99
|
'3Ge54FsGJaaeZmm8nTKJdS6HVdYhiR3g18fDwg3Ev1Sa': Timeline,
|
|
@@ -108,11 +107,10 @@ export const contents = {
|
|
|
108
107
|
'5YZEAtUaHhNfnVnwtSsyBnBakpcSwdL75UcgtrtnqeYn': LifecycleEvent,
|
|
109
108
|
'6FDVZRQwuhXdXtnXq8kRg3f3DM8SUdbN3TT8rSGJcS2U': ContractsChangePolicy,
|
|
110
109
|
'6ZLHE59mb1ytEjW78jmYCU3DXxj4Fzfjea7tz3VEkwyX': CustomerActionRequested,
|
|
111
|
-
'
|
|
110
|
+
'7icTT1chbH3UA2ybXgpfSSyNEAR4Wmm3EkbdGFaZSydo': ProposeChangeWorkflow,
|
|
112
111
|
'7X3LkN54Yp88JgZbppPhP6hM3Jqiqv8Z2i4kS7phXtQe': SequentialWorkflow,
|
|
113
112
|
'8Akr9sdTkxBqMYWSGh8gHgoXQQeYEPfhV4s8fXeKTd9W': InformUserAboutPendingAction,
|
|
114
113
|
'8f9UhHMbRe62sFgzQVheToaJPYi7t7HPNVvpQTbqfL5n': Request,
|
|
115
|
-
'9fnXwi4Za8hjEj6zDSEjhbA5dLrDzs7sxoDMGLmRT2Gz': RejectChangeWorkflow,
|
|
116
114
|
'9h1AhEexkxxKLYv1NHbEESYCPtvW7Nt51msGtuQC5jWK': CustomerConsentRevoked,
|
|
117
115
|
'9xv7YjqsSn7W7P8rnUhSpdWGfSrgL4Jt3cmiACJT5VQs': DocumentSectionChangeEntry,
|
|
118
116
|
AkUKoKY1hHY1CytCrAXDPKCd4md1QGmn1WNcQtWBsyAD: ChatMessage,
|
|
@@ -124,7 +122,9 @@ export const contents = {
|
|
|
124
122
|
CGdxkNjPcsdescqLPz6SNLsMyak6demQQr7RoKNHbCyv: SequentialWorkflowOperation,
|
|
125
123
|
CN5efWVizJbRsMCw8YWRfT2q9vM9XfeGDN9wFvYcvMnQ: Actor,
|
|
126
124
|
DEmFwGa1sWm2BKhrN98LREKiB8j8B8kFAo7KBkkaojnN: DocumentSectionChanges,
|
|
125
|
+
DUjCaEniHH5oDXU3Ss5jWWft3pT9TUcNhv7HoCDU1NTB: RejectChangeWorkflow,
|
|
127
126
|
EbGQYtYR9UNAxcn7auCCujXmnz6DWxMpqVcgYSsKE85M: ProposedChangeInvalid,
|
|
127
|
+
Eh2y8JypsGTdFMpEGEK64vBdGtaJ9Q7Q5t7ChqHafwCV: AcceptChangeWorkflow,
|
|
128
128
|
EhPFqrRCreg7StsZEcW8fRQ1FQVdqYSsMSis2CHHJZ1G: StatusCompleted,
|
|
129
129
|
ETAPjwZVyYEfPUWvXkCWAuybBhYUayg4hKC2V7mLXmsv: StatusPending,
|
|
130
130
|
EvuCWsG1E6WJQg8QXmk6rwMANYTZjoLWVZ1vYQWUwdTH: TimelineChannel,
|