@salesforce/lds-adapters-industries-clm 1.100.2
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/LICENSE.txt +82 -0
- package/dist/es/es2018/industries-clm.js +3243 -0
- package/dist/types/src/generated/adapters/adapter-utils.d.ts +66 -0
- package/dist/types/src/generated/adapters/checkIn.d.ts +14 -0
- package/dist/types/src/generated/adapters/checkoutContractDocumentVersion.d.ts +16 -0
- package/dist/types/src/generated/adapters/createContractDocumentVersionAndInitializeGenerateDocumentProcess.d.ts +16 -0
- package/dist/types/src/generated/adapters/deleteAttachment.d.ts +14 -0
- package/dist/types/src/generated/adapters/executeContractAction.d.ts +16 -0
- package/dist/types/src/generated/adapters/getContentDocument.d.ts +27 -0
- package/dist/types/src/generated/adapters/getContractActions.d.ts +27 -0
- package/dist/types/src/generated/adapters/getContractDocumentVersion.d.ts +27 -0
- package/dist/types/src/generated/adapters/getDocumentGenerationProcessDetails.d.ts +26 -0
- package/dist/types/src/generated/adapters/getTemplates.d.ts +30 -0
- package/dist/types/src/generated/adapters/lockContractDocumentVersion.d.ts +14 -0
- package/dist/types/src/generated/adapters/saveExternalDocument.d.ts +15 -0
- package/dist/types/src/generated/adapters/unlock.d.ts +14 -0
- package/dist/types/src/generated/adapters/updateContractDocumentVersionWithTemplate.d.ts +16 -0
- package/dist/types/src/generated/artifacts/main.d.ts +14 -0
- package/dist/types/src/generated/artifacts/sfdc.d.ts +22 -0
- package/dist/types/src/generated/resources/deleteConnectClmContractDocumentVersionContentDocumentsByContractDocumentVersionId.d.ts +15 -0
- package/dist/types/src/generated/resources/getConnectClmContractContractActionsByContractId.d.ts +16 -0
- package/dist/types/src/generated/resources/getConnectClmContractContractDocumentVersionByContractId.d.ts +18 -0
- package/dist/types/src/generated/resources/getConnectClmContractDocumentVersionContentDocumentsByContractDocumentVersionId.d.ts +16 -0
- package/dist/types/src/generated/resources/getConnectClmDocumentGenerationProcessStatus.d.ts +15 -0
- package/dist/types/src/generated/resources/getConnectClmDocumentTemplate.d.ts +19 -0
- package/dist/types/src/generated/resources/patchConnectClmContract.d.ts +10 -0
- package/dist/types/src/generated/resources/patchConnectClmContractByContractId.d.ts +16 -0
- package/dist/types/src/generated/resources/patchConnectClmContractDocumentVersionByContractDocumentVersionId.d.ts +16 -0
- package/dist/types/src/generated/resources/patchConnectClmContractDocumentVersionCheckInByContractDocumentVersionId.d.ts +12 -0
- package/dist/types/src/generated/resources/patchConnectClmContractDocumentVersionLockByContractDocumentVersionId.d.ts +12 -0
- package/dist/types/src/generated/resources/patchConnectClmContractDocumentVersionUnlockByContractDocumentVersionId.d.ts +12 -0
- package/dist/types/src/generated/resources/patchConnectClmExternalDocumentResource.d.ts +13 -0
- package/dist/types/src/generated/resources/postConnectClmContract.d.ts +13 -0
- package/dist/types/src/generated/resources/postConnectClmContractContractDocumentVersionByContractId.d.ts +16 -0
- package/dist/types/src/generated/resources/postConnectClmContractDocumentVersionCheckoutByContractDocumentVersionId.d.ts +16 -0
- package/dist/types/src/generated/types/ContentDocumentListRepresentation.d.ts +43 -0
- package/dist/types/src/generated/types/ContentDocumentRepresentation.d.ts +47 -0
- package/dist/types/src/generated/types/ContractActionInputRepresentation.d.ts +39 -0
- package/dist/types/src/generated/types/ContractActionInputRepresentationWrapper.d.ts +30 -0
- package/dist/types/src/generated/types/ContractActionListRepresentation.d.ts +43 -0
- package/dist/types/src/generated/types/ContractActionRepresentation.d.ts +51 -0
- package/dist/types/src/generated/types/ContractDocumentVersionRepresentation.d.ts +78 -0
- package/dist/types/src/generated/types/ContractDocumentVersionsListRepresentation.d.ts +34 -0
- package/dist/types/src/generated/types/ContractInputRepresentation.d.ts +35 -0
- package/dist/types/src/generated/types/ContractInputRepresentationWrapper.d.ts +30 -0
- package/dist/types/src/generated/types/ContractOutputResponseRepresentation.d.ts +29 -0
- package/dist/types/src/generated/types/DocumentGenerateRepresentation.d.ts +49 -0
- package/dist/types/src/generated/types/DocumentGenerationProcessStatusRepresentation.d.ts +48 -0
- package/dist/types/src/generated/types/GenericOutputRepresentation.d.ts +42 -0
- package/dist/types/src/generated/types/SaveExternalDocumentInputRepresentation.d.ts +29 -0
- package/dist/types/src/generated/types/SaveExternalDocumentInputRepresentationWrapper.d.ts +30 -0
- package/dist/types/src/generated/types/SaveExternalDocumentRepresentation.d.ts +45 -0
- package/dist/types/src/generated/types/TemplateInputRepresentation.d.ts +35 -0
- package/dist/types/src/generated/types/TemplateInputRepresentationWrapper.d.ts +30 -0
- package/dist/types/src/generated/types/TemplateListRepresentation.d.ts +37 -0
- package/dist/types/src/generated/types/TemplateRepresentation.d.ts +41 -0
- package/dist/types/src/generated/types/type-utils.d.ts +39 -0
- package/dist/umd/es2018/industries-clm.js +3264 -0
- package/dist/umd/es5/industries-clm.js +3279 -0
- package/package.json +67 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +3417 -0
- package/src/raml/api.raml +649 -0
- package/src/raml/luvio.raml +173 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,3417 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* *******************************************************************************************
|
|
8
|
+
* ATTENTION!
|
|
9
|
+
* THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
|
|
10
|
+
* If you would like to contribute to LDS, please follow the steps outlined in the git repo.
|
|
11
|
+
* Any changes made to this file in p4 will be automatically overwritten.
|
|
12
|
+
* *******************************************************************************************
|
|
13
|
+
*/
|
|
14
|
+
/* proxy-compat-disable */
|
|
15
|
+
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
|
+
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
+
import { serializeStructuredKey, StoreKeyMap } from 'force/luvioEngine';
|
|
18
|
+
|
|
19
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
|
+
const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
|
|
21
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
22
|
+
/**
|
|
23
|
+
* Validates an adapter config is well-formed.
|
|
24
|
+
* @param config The config to validate.
|
|
25
|
+
* @param adapter The adapter validation configuration.
|
|
26
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
27
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
28
|
+
*/
|
|
29
|
+
function validateConfig(config, adapter, oneOf) {
|
|
30
|
+
const { displayName } = adapter;
|
|
31
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
32
|
+
if (config === undefined ||
|
|
33
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
34
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
35
|
+
}
|
|
36
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
37
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
38
|
+
}
|
|
39
|
+
if (unsupported !== undefined &&
|
|
40
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
41
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
42
|
+
}
|
|
43
|
+
const supported = required.concat(optional);
|
|
44
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
45
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function untrustedIsObject(untrusted) {
|
|
49
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
50
|
+
}
|
|
51
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
52
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
53
|
+
}
|
|
54
|
+
const snapshotRefreshOptions = {
|
|
55
|
+
overrides: {
|
|
56
|
+
headers: {
|
|
57
|
+
'Cache-Control': 'no-cache',
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const keyPrefix = 'clm';
|
|
62
|
+
|
|
63
|
+
const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
64
|
+
const { isArray: ArrayIsArray } = Array;
|
|
65
|
+
const { stringify: JSONStringify } = JSON;
|
|
66
|
+
function equalsArray(a, b, equalsItem) {
|
|
67
|
+
const aLength = a.length;
|
|
68
|
+
const bLength = b.length;
|
|
69
|
+
if (aLength !== bLength) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
for (let i = 0; i < aLength; i++) {
|
|
73
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
function deepFreeze$b(value) {
|
|
80
|
+
// No need to freeze primitives
|
|
81
|
+
if (typeof value !== 'object' || value === null) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (ArrayIsArray(value)) {
|
|
85
|
+
for (let i = 0, len = value.length; i < len; i += 1) {
|
|
86
|
+
deepFreeze$b(value[i]);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
const keys = ObjectKeys(value);
|
|
91
|
+
for (let i = 0, len = keys.length; i < len; i += 1) {
|
|
92
|
+
deepFreeze$b(value[keys[i]]);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
ObjectFreeze(value);
|
|
96
|
+
}
|
|
97
|
+
function createLink(ref) {
|
|
98
|
+
return {
|
|
99
|
+
__ref: serializeStructuredKey(ref),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const TTL$6 = 60000;
|
|
104
|
+
const VERSION$8 = "c8652b5c3ad8c532087704340d3cad55";
|
|
105
|
+
function validate$e(obj, path = 'GenericOutputRepresentation') {
|
|
106
|
+
const v_error = (() => {
|
|
107
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
108
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
109
|
+
}
|
|
110
|
+
const obj_id = obj.id;
|
|
111
|
+
const path_id = path + '.id';
|
|
112
|
+
if (typeof obj_id !== 'string') {
|
|
113
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
114
|
+
}
|
|
115
|
+
if (obj.isSuccess !== undefined) {
|
|
116
|
+
const obj_isSuccess = obj.isSuccess;
|
|
117
|
+
const path_isSuccess = path + '.isSuccess';
|
|
118
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
119
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
})();
|
|
123
|
+
return v_error === undefined ? null : v_error;
|
|
124
|
+
}
|
|
125
|
+
const RepresentationType$7 = 'GenericOutputRepresentation';
|
|
126
|
+
function keyBuilder$f(luvio, config) {
|
|
127
|
+
return keyPrefix + '::' + RepresentationType$7 + ':' + config.id;
|
|
128
|
+
}
|
|
129
|
+
function keyBuilderFromType$4(luvio, object) {
|
|
130
|
+
const keyParams = {
|
|
131
|
+
id: object.id
|
|
132
|
+
};
|
|
133
|
+
return keyBuilder$f(luvio, keyParams);
|
|
134
|
+
}
|
|
135
|
+
function normalize$7(input, existing, path, luvio, store, timestamp) {
|
|
136
|
+
return input;
|
|
137
|
+
}
|
|
138
|
+
const select$l = function GenericOutputRepresentationSelect() {
|
|
139
|
+
return {
|
|
140
|
+
kind: 'Fragment',
|
|
141
|
+
version: VERSION$8,
|
|
142
|
+
private: [],
|
|
143
|
+
opaque: true
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
function equals$8(existing, incoming) {
|
|
147
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
function deepFreeze$a(input) {
|
|
153
|
+
ObjectFreeze(input);
|
|
154
|
+
}
|
|
155
|
+
const ingest$7 = function GenericOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
156
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
157
|
+
const validateError = validate$e(input);
|
|
158
|
+
if (validateError !== null) {
|
|
159
|
+
throw validateError;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const key = keyBuilderFromType$4(luvio, input);
|
|
163
|
+
const existingRecord = store.readEntry(key);
|
|
164
|
+
const ttlToUse = TTL$6;
|
|
165
|
+
let incomingRecord = normalize$7(input, store.readEntry(key), {
|
|
166
|
+
fullPath: key,
|
|
167
|
+
parent: path.parent,
|
|
168
|
+
propertyName: path.propertyName,
|
|
169
|
+
ttl: ttlToUse
|
|
170
|
+
});
|
|
171
|
+
deepFreeze$a(input);
|
|
172
|
+
if (existingRecord === undefined || equals$8(existingRecord, incomingRecord) === false) {
|
|
173
|
+
luvio.storePublish(key, incomingRecord);
|
|
174
|
+
}
|
|
175
|
+
{
|
|
176
|
+
const storeMetadataParams = {
|
|
177
|
+
ttl: ttlToUse,
|
|
178
|
+
namespace: "clm",
|
|
179
|
+
version: VERSION$8,
|
|
180
|
+
representationName: RepresentationType$7,
|
|
181
|
+
};
|
|
182
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
183
|
+
}
|
|
184
|
+
return createLink(key);
|
|
185
|
+
};
|
|
186
|
+
function getTypeCacheKeys$7(luvio, input, fullPathFactory) {
|
|
187
|
+
const rootKeySet = new StoreKeyMap();
|
|
188
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
189
|
+
const rootKey = keyBuilderFromType$4(luvio, input);
|
|
190
|
+
rootKeySet.set(rootKey, {
|
|
191
|
+
namespace: keyPrefix,
|
|
192
|
+
representationName: RepresentationType$7,
|
|
193
|
+
mergeable: false
|
|
194
|
+
});
|
|
195
|
+
return rootKeySet;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function select$k(luvio, params) {
|
|
199
|
+
return select$l();
|
|
200
|
+
}
|
|
201
|
+
function getResponseCacheKeys$d(luvio, resourceParams, response) {
|
|
202
|
+
return getTypeCacheKeys$7(luvio, response);
|
|
203
|
+
}
|
|
204
|
+
function ingestSuccess$c(luvio, resourceParams, response) {
|
|
205
|
+
const { body } = response;
|
|
206
|
+
const key = keyBuilderFromType$4(luvio, body);
|
|
207
|
+
luvio.storeIngest(key, ingest$7, body);
|
|
208
|
+
const snapshot = luvio.storeLookup({
|
|
209
|
+
recordId: key,
|
|
210
|
+
node: select$k(),
|
|
211
|
+
variables: {},
|
|
212
|
+
});
|
|
213
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
214
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
215
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return snapshot;
|
|
219
|
+
}
|
|
220
|
+
function createResourceRequest$d(config) {
|
|
221
|
+
const headers = {};
|
|
222
|
+
return {
|
|
223
|
+
baseUri: '/services/data/v58.0',
|
|
224
|
+
basePath: '/connect/clm/contract-document-version/' + config.urlParams.contractDocumentVersionId + '/checkIn',
|
|
225
|
+
method: 'patch',
|
|
226
|
+
body: null,
|
|
227
|
+
urlParams: config.urlParams,
|
|
228
|
+
queryParams: {},
|
|
229
|
+
headers,
|
|
230
|
+
priority: 'normal',
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const checkIn_ConfigPropertyNames = {
|
|
235
|
+
displayName: 'checkIn',
|
|
236
|
+
parameters: {
|
|
237
|
+
required: ['contractDocumentVersionId'],
|
|
238
|
+
optional: []
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
function createResourceParams$d(config) {
|
|
242
|
+
const resourceParams = {
|
|
243
|
+
urlParams: {
|
|
244
|
+
contractDocumentVersionId: config.contractDocumentVersionId
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
return resourceParams;
|
|
248
|
+
}
|
|
249
|
+
function typeCheckConfig$d(untrustedConfig) {
|
|
250
|
+
const config = {};
|
|
251
|
+
const untrustedConfig_contractDocumentVersionId = untrustedConfig.contractDocumentVersionId;
|
|
252
|
+
if (typeof untrustedConfig_contractDocumentVersionId === 'string') {
|
|
253
|
+
config.contractDocumentVersionId = untrustedConfig_contractDocumentVersionId;
|
|
254
|
+
}
|
|
255
|
+
return config;
|
|
256
|
+
}
|
|
257
|
+
function validateAdapterConfig$d(untrustedConfig, configPropertyNames) {
|
|
258
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
262
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
263
|
+
}
|
|
264
|
+
const config = typeCheckConfig$d(untrustedConfig);
|
|
265
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
return config;
|
|
269
|
+
}
|
|
270
|
+
function buildNetworkSnapshot$d(luvio, config, options) {
|
|
271
|
+
const resourceParams = createResourceParams$d(config);
|
|
272
|
+
const request = createResourceRequest$d(resourceParams);
|
|
273
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
274
|
+
.then((response) => {
|
|
275
|
+
return luvio.handleSuccessResponse(() => {
|
|
276
|
+
const snapshot = ingestSuccess$c(luvio, resourceParams, response);
|
|
277
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
278
|
+
}, () => getResponseCacheKeys$d(luvio, resourceParams, response.body));
|
|
279
|
+
}, (response) => {
|
|
280
|
+
deepFreeze$b(response);
|
|
281
|
+
throw response;
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
const checkInAdapterFactory = (luvio) => {
|
|
285
|
+
return function checkIn(untrustedConfig) {
|
|
286
|
+
const config = validateAdapterConfig$d(untrustedConfig, checkIn_ConfigPropertyNames);
|
|
287
|
+
// Invalid or incomplete config
|
|
288
|
+
if (config === null) {
|
|
289
|
+
throw new Error('Invalid config for "checkIn"');
|
|
290
|
+
}
|
|
291
|
+
return buildNetworkSnapshot$d(luvio, config);
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
function validate$d(obj, path = 'TemplateInputRepresentation') {
|
|
296
|
+
const v_error = (() => {
|
|
297
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
298
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
299
|
+
}
|
|
300
|
+
if (obj.pdfDocumentId !== undefined) {
|
|
301
|
+
const obj_pdfDocumentId = obj.pdfDocumentId;
|
|
302
|
+
const path_pdfDocumentId = path + '.pdfDocumentId';
|
|
303
|
+
if (typeof obj_pdfDocumentId !== 'string') {
|
|
304
|
+
return new TypeError('Expected "string" but received "' + typeof obj_pdfDocumentId + '" (at "' + path_pdfDocumentId + '")');
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
const obj_templateId = obj.templateId;
|
|
308
|
+
const path_templateId = path + '.templateId';
|
|
309
|
+
if (typeof obj_templateId !== 'string') {
|
|
310
|
+
return new TypeError('Expected "string" but received "' + typeof obj_templateId + '" (at "' + path_templateId + '")');
|
|
311
|
+
}
|
|
312
|
+
if (obj.wordDocumentId !== undefined) {
|
|
313
|
+
const obj_wordDocumentId = obj.wordDocumentId;
|
|
314
|
+
const path_wordDocumentId = path + '.wordDocumentId';
|
|
315
|
+
if (typeof obj_wordDocumentId !== 'string') {
|
|
316
|
+
return new TypeError('Expected "string" but received "' + typeof obj_wordDocumentId + '" (at "' + path_wordDocumentId + '")');
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
})();
|
|
320
|
+
return v_error === undefined ? null : v_error;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const VERSION$7 = "f874339705636326163a82467da64b36";
|
|
324
|
+
function validate$c(obj, path = 'ContentDocumentRepresentation') {
|
|
325
|
+
const v_error = (() => {
|
|
326
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
327
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
328
|
+
}
|
|
329
|
+
const obj_contentDocumentId = obj.contentDocumentId;
|
|
330
|
+
const path_contentDocumentId = path + '.contentDocumentId';
|
|
331
|
+
if (typeof obj_contentDocumentId !== 'string') {
|
|
332
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contentDocumentId + '" (at "' + path_contentDocumentId + '")');
|
|
333
|
+
}
|
|
334
|
+
if (obj.contentDocumentLinkId !== undefined) {
|
|
335
|
+
const obj_contentDocumentLinkId = obj.contentDocumentLinkId;
|
|
336
|
+
const path_contentDocumentLinkId = path + '.contentDocumentLinkId';
|
|
337
|
+
if (typeof obj_contentDocumentLinkId !== 'string') {
|
|
338
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contentDocumentLinkId + '" (at "' + path_contentDocumentLinkId + '")');
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
const obj_contractDocumentVersionId = obj.contractDocumentVersionId;
|
|
342
|
+
const path_contractDocumentVersionId = path + '.contractDocumentVersionId';
|
|
343
|
+
if (typeof obj_contractDocumentVersionId !== 'string') {
|
|
344
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contractDocumentVersionId + '" (at "' + path_contractDocumentVersionId + '")');
|
|
345
|
+
}
|
|
346
|
+
const obj_createdDate = obj.createdDate;
|
|
347
|
+
const path_createdDate = path + '.createdDate';
|
|
348
|
+
if (typeof obj_createdDate !== 'string') {
|
|
349
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
350
|
+
}
|
|
351
|
+
if (obj.fileExtension !== undefined) {
|
|
352
|
+
const obj_fileExtension = obj.fileExtension;
|
|
353
|
+
const path_fileExtension = path + '.fileExtension';
|
|
354
|
+
if (typeof obj_fileExtension !== 'string') {
|
|
355
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fileExtension + '" (at "' + path_fileExtension + '")');
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
359
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
360
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
361
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
362
|
+
}
|
|
363
|
+
const obj_title = obj.title;
|
|
364
|
+
const path_title = path + '.title';
|
|
365
|
+
if (typeof obj_title !== 'string') {
|
|
366
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
367
|
+
}
|
|
368
|
+
})();
|
|
369
|
+
return v_error === undefined ? null : v_error;
|
|
370
|
+
}
|
|
371
|
+
const select$j = function ContentDocumentRepresentationSelect() {
|
|
372
|
+
return {
|
|
373
|
+
kind: 'Fragment',
|
|
374
|
+
version: VERSION$7,
|
|
375
|
+
private: [],
|
|
376
|
+
selections: [
|
|
377
|
+
{
|
|
378
|
+
name: 'contentDocumentId',
|
|
379
|
+
kind: 'Scalar'
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
name: 'contentDocumentLinkId',
|
|
383
|
+
kind: 'Scalar',
|
|
384
|
+
required: false
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
name: 'contractDocumentVersionId',
|
|
388
|
+
kind: 'Scalar'
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
name: 'createdDate',
|
|
392
|
+
kind: 'Scalar'
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
name: 'fileExtension',
|
|
396
|
+
kind: 'Scalar',
|
|
397
|
+
required: false
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
name: 'lastModifiedDate',
|
|
401
|
+
kind: 'Scalar'
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
name: 'title',
|
|
405
|
+
kind: 'Scalar'
|
|
406
|
+
}
|
|
407
|
+
]
|
|
408
|
+
};
|
|
409
|
+
};
|
|
410
|
+
function equals$7(existing, incoming) {
|
|
411
|
+
const existing_contentDocumentId = existing.contentDocumentId;
|
|
412
|
+
const incoming_contentDocumentId = incoming.contentDocumentId;
|
|
413
|
+
if (!(existing_contentDocumentId === incoming_contentDocumentId)) {
|
|
414
|
+
return false;
|
|
415
|
+
}
|
|
416
|
+
const existing_contentDocumentLinkId = existing.contentDocumentLinkId;
|
|
417
|
+
const incoming_contentDocumentLinkId = incoming.contentDocumentLinkId;
|
|
418
|
+
// if at least one of these optionals is defined
|
|
419
|
+
if (existing_contentDocumentLinkId !== undefined || incoming_contentDocumentLinkId !== undefined) {
|
|
420
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
421
|
+
// not equal
|
|
422
|
+
if (existing_contentDocumentLinkId === undefined || incoming_contentDocumentLinkId === undefined) {
|
|
423
|
+
return false;
|
|
424
|
+
}
|
|
425
|
+
if (!(existing_contentDocumentLinkId === incoming_contentDocumentLinkId)) {
|
|
426
|
+
return false;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
const existing_contractDocumentVersionId = existing.contractDocumentVersionId;
|
|
430
|
+
const incoming_contractDocumentVersionId = incoming.contractDocumentVersionId;
|
|
431
|
+
if (!(existing_contractDocumentVersionId === incoming_contractDocumentVersionId)) {
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
const existing_createdDate = existing.createdDate;
|
|
435
|
+
const incoming_createdDate = incoming.createdDate;
|
|
436
|
+
if (!(existing_createdDate === incoming_createdDate)) {
|
|
437
|
+
return false;
|
|
438
|
+
}
|
|
439
|
+
const existing_fileExtension = existing.fileExtension;
|
|
440
|
+
const incoming_fileExtension = incoming.fileExtension;
|
|
441
|
+
// if at least one of these optionals is defined
|
|
442
|
+
if (existing_fileExtension !== undefined || incoming_fileExtension !== undefined) {
|
|
443
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
444
|
+
// not equal
|
|
445
|
+
if (existing_fileExtension === undefined || incoming_fileExtension === undefined) {
|
|
446
|
+
return false;
|
|
447
|
+
}
|
|
448
|
+
if (!(existing_fileExtension === incoming_fileExtension)) {
|
|
449
|
+
return false;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
const existing_lastModifiedDate = existing.lastModifiedDate;
|
|
453
|
+
const incoming_lastModifiedDate = incoming.lastModifiedDate;
|
|
454
|
+
if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
|
|
455
|
+
return false;
|
|
456
|
+
}
|
|
457
|
+
const existing_title = existing.title;
|
|
458
|
+
const incoming_title = incoming.title;
|
|
459
|
+
if (!(existing_title === incoming_title)) {
|
|
460
|
+
return false;
|
|
461
|
+
}
|
|
462
|
+
return true;
|
|
463
|
+
}
|
|
464
|
+
function deepFreeze$9(input) {
|
|
465
|
+
ObjectFreeze(input);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
const TTL$5 = 60000;
|
|
469
|
+
const VERSION$6 = "520b4f1213b0e08b197d18564d0a2432";
|
|
470
|
+
function validate$b(obj, path = 'DocumentGenerateRepresentation') {
|
|
471
|
+
const v_error = (() => {
|
|
472
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
473
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
474
|
+
}
|
|
475
|
+
if (obj.contentDocuments !== undefined) {
|
|
476
|
+
const obj_contentDocuments = obj.contentDocuments;
|
|
477
|
+
const path_contentDocuments = path + '.contentDocuments';
|
|
478
|
+
if (!ArrayIsArray(obj_contentDocuments)) {
|
|
479
|
+
return new TypeError('Expected "array" but received "' + typeof obj_contentDocuments + '" (at "' + path_contentDocuments + '")');
|
|
480
|
+
}
|
|
481
|
+
for (let i = 0; i < obj_contentDocuments.length; i++) {
|
|
482
|
+
const obj_contentDocuments_item = obj_contentDocuments[i];
|
|
483
|
+
const path_contentDocuments_item = path_contentDocuments + '[' + i + ']';
|
|
484
|
+
const referencepath_contentDocuments_itemValidationError = validate$c(obj_contentDocuments_item, path_contentDocuments_item);
|
|
485
|
+
if (referencepath_contentDocuments_itemValidationError !== null) {
|
|
486
|
+
let message = 'Object doesn\'t match ContentDocumentRepresentation (at "' + path_contentDocuments_item + '")\n';
|
|
487
|
+
message += referencepath_contentDocuments_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
488
|
+
return new TypeError(message);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
const obj_contractDocumentVersionId = obj.contractDocumentVersionId;
|
|
493
|
+
const path_contractDocumentVersionId = path + '.contractDocumentVersionId';
|
|
494
|
+
if (typeof obj_contractDocumentVersionId !== 'string') {
|
|
495
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contractDocumentVersionId + '" (at "' + path_contractDocumentVersionId + '")');
|
|
496
|
+
}
|
|
497
|
+
const obj_contractId = obj.contractId;
|
|
498
|
+
const path_contractId = path + '.contractId';
|
|
499
|
+
if (typeof obj_contractId !== 'string') {
|
|
500
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contractId + '" (at "' + path_contractId + '")');
|
|
501
|
+
}
|
|
502
|
+
if (obj.jobId !== undefined) {
|
|
503
|
+
const obj_jobId = obj.jobId;
|
|
504
|
+
const path_jobId = path + '.jobId';
|
|
505
|
+
if (typeof obj_jobId !== 'string') {
|
|
506
|
+
return new TypeError('Expected "string" but received "' + typeof obj_jobId + '" (at "' + path_jobId + '")');
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
})();
|
|
510
|
+
return v_error === undefined ? null : v_error;
|
|
511
|
+
}
|
|
512
|
+
const RepresentationType$6 = 'DocumentGenerateRepresentation';
|
|
513
|
+
function keyBuilder$e(luvio, config) {
|
|
514
|
+
return keyPrefix + '::' + RepresentationType$6 + ':' + config.contractId;
|
|
515
|
+
}
|
|
516
|
+
function keyBuilderFromType$3(luvio, object) {
|
|
517
|
+
const keyParams = {
|
|
518
|
+
contractId: object.contractId
|
|
519
|
+
};
|
|
520
|
+
return keyBuilder$e(luvio, keyParams);
|
|
521
|
+
}
|
|
522
|
+
function normalize$6(input, existing, path, luvio, store, timestamp) {
|
|
523
|
+
return input;
|
|
524
|
+
}
|
|
525
|
+
const select$i = function DocumentGenerateRepresentationSelect() {
|
|
526
|
+
return {
|
|
527
|
+
kind: 'Fragment',
|
|
528
|
+
version: VERSION$6,
|
|
529
|
+
private: [],
|
|
530
|
+
opaque: true
|
|
531
|
+
};
|
|
532
|
+
};
|
|
533
|
+
function equals$6(existing, incoming) {
|
|
534
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
535
|
+
return false;
|
|
536
|
+
}
|
|
537
|
+
return true;
|
|
538
|
+
}
|
|
539
|
+
function deepFreeze$8(input) {
|
|
540
|
+
const input_contentDocuments = input.contentDocuments;
|
|
541
|
+
if (input_contentDocuments !== undefined) {
|
|
542
|
+
for (let i = 0; i < input_contentDocuments.length; i++) {
|
|
543
|
+
const input_contentDocuments_item = input_contentDocuments[i];
|
|
544
|
+
deepFreeze$9(input_contentDocuments_item);
|
|
545
|
+
}
|
|
546
|
+
ObjectFreeze(input_contentDocuments);
|
|
547
|
+
}
|
|
548
|
+
ObjectFreeze(input);
|
|
549
|
+
}
|
|
550
|
+
const ingest$6 = function DocumentGenerateRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
551
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
552
|
+
const validateError = validate$b(input);
|
|
553
|
+
if (validateError !== null) {
|
|
554
|
+
throw validateError;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
const key = keyBuilderFromType$3(luvio, input);
|
|
558
|
+
const existingRecord = store.readEntry(key);
|
|
559
|
+
const ttlToUse = TTL$5;
|
|
560
|
+
let incomingRecord = normalize$6(input, store.readEntry(key), {
|
|
561
|
+
fullPath: key,
|
|
562
|
+
parent: path.parent,
|
|
563
|
+
propertyName: path.propertyName,
|
|
564
|
+
ttl: ttlToUse
|
|
565
|
+
});
|
|
566
|
+
deepFreeze$8(input);
|
|
567
|
+
if (existingRecord === undefined || equals$6(existingRecord, incomingRecord) === false) {
|
|
568
|
+
luvio.storePublish(key, incomingRecord);
|
|
569
|
+
}
|
|
570
|
+
{
|
|
571
|
+
const storeMetadataParams = {
|
|
572
|
+
ttl: ttlToUse,
|
|
573
|
+
namespace: "clm",
|
|
574
|
+
version: VERSION$6,
|
|
575
|
+
representationName: RepresentationType$6,
|
|
576
|
+
};
|
|
577
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
578
|
+
}
|
|
579
|
+
return createLink(key);
|
|
580
|
+
};
|
|
581
|
+
function getTypeCacheKeys$6(luvio, input, fullPathFactory) {
|
|
582
|
+
const rootKeySet = new StoreKeyMap();
|
|
583
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
584
|
+
const rootKey = keyBuilderFromType$3(luvio, input);
|
|
585
|
+
rootKeySet.set(rootKey, {
|
|
586
|
+
namespace: keyPrefix,
|
|
587
|
+
representationName: RepresentationType$6,
|
|
588
|
+
mergeable: false
|
|
589
|
+
});
|
|
590
|
+
return rootKeySet;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
function select$h(luvio, params) {
|
|
594
|
+
return select$i();
|
|
595
|
+
}
|
|
596
|
+
function getResponseCacheKeys$c(luvio, resourceParams, response) {
|
|
597
|
+
return getTypeCacheKeys$6(luvio, response);
|
|
598
|
+
}
|
|
599
|
+
function ingestSuccess$b(luvio, resourceParams, response) {
|
|
600
|
+
const { body } = response;
|
|
601
|
+
const key = keyBuilderFromType$3(luvio, body);
|
|
602
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
603
|
+
const snapshot = luvio.storeLookup({
|
|
604
|
+
recordId: key,
|
|
605
|
+
node: select$h(),
|
|
606
|
+
variables: {},
|
|
607
|
+
});
|
|
608
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
609
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
610
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return snapshot;
|
|
614
|
+
}
|
|
615
|
+
function createResourceRequest$c(config) {
|
|
616
|
+
const headers = {};
|
|
617
|
+
return {
|
|
618
|
+
baseUri: '/services/data/v58.0',
|
|
619
|
+
basePath: '/connect/clm/contract-document-version/' + config.urlParams.contractDocumentVersionId + '/checkout',
|
|
620
|
+
method: 'post',
|
|
621
|
+
body: config.body,
|
|
622
|
+
urlParams: config.urlParams,
|
|
623
|
+
queryParams: {},
|
|
624
|
+
headers,
|
|
625
|
+
priority: 'normal',
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
const checkoutContractDocumentVersion_ConfigPropertyNames = {
|
|
630
|
+
displayName: 'checkoutContractDocumentVersion',
|
|
631
|
+
parameters: {
|
|
632
|
+
required: ['contractDocumentVersionId', 'templateInput'],
|
|
633
|
+
optional: []
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
function createResourceParams$c(config) {
|
|
637
|
+
const resourceParams = {
|
|
638
|
+
urlParams: {
|
|
639
|
+
contractDocumentVersionId: config.contractDocumentVersionId
|
|
640
|
+
},
|
|
641
|
+
body: {
|
|
642
|
+
templateInput: config.templateInput
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
return resourceParams;
|
|
646
|
+
}
|
|
647
|
+
function typeCheckConfig$c(untrustedConfig) {
|
|
648
|
+
const config = {};
|
|
649
|
+
const untrustedConfig_contractDocumentVersionId = untrustedConfig.contractDocumentVersionId;
|
|
650
|
+
if (typeof untrustedConfig_contractDocumentVersionId === 'string') {
|
|
651
|
+
config.contractDocumentVersionId = untrustedConfig_contractDocumentVersionId;
|
|
652
|
+
}
|
|
653
|
+
const untrustedConfig_templateInput = untrustedConfig.templateInput;
|
|
654
|
+
const referenceTemplateInputRepresentationValidationError = validate$d(untrustedConfig_templateInput);
|
|
655
|
+
if (referenceTemplateInputRepresentationValidationError === null) {
|
|
656
|
+
config.templateInput = untrustedConfig_templateInput;
|
|
657
|
+
}
|
|
658
|
+
return config;
|
|
659
|
+
}
|
|
660
|
+
function validateAdapterConfig$c(untrustedConfig, configPropertyNames) {
|
|
661
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
662
|
+
return null;
|
|
663
|
+
}
|
|
664
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
665
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
666
|
+
}
|
|
667
|
+
const config = typeCheckConfig$c(untrustedConfig);
|
|
668
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
669
|
+
return null;
|
|
670
|
+
}
|
|
671
|
+
return config;
|
|
672
|
+
}
|
|
673
|
+
function buildNetworkSnapshot$c(luvio, config, options) {
|
|
674
|
+
const resourceParams = createResourceParams$c(config);
|
|
675
|
+
const request = createResourceRequest$c(resourceParams);
|
|
676
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
677
|
+
.then((response) => {
|
|
678
|
+
return luvio.handleSuccessResponse(() => {
|
|
679
|
+
const snapshot = ingestSuccess$b(luvio, resourceParams, response);
|
|
680
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
681
|
+
}, () => getResponseCacheKeys$c(luvio, resourceParams, response.body));
|
|
682
|
+
}, (response) => {
|
|
683
|
+
deepFreeze$b(response);
|
|
684
|
+
throw response;
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
const checkoutContractDocumentVersionAdapterFactory = (luvio) => {
|
|
688
|
+
return function checkoutContractDocumentVersion(untrustedConfig) {
|
|
689
|
+
const config = validateAdapterConfig$c(untrustedConfig, checkoutContractDocumentVersion_ConfigPropertyNames);
|
|
690
|
+
// Invalid or incomplete config
|
|
691
|
+
if (config === null) {
|
|
692
|
+
throw new Error('Invalid config for "checkoutContractDocumentVersion"');
|
|
693
|
+
}
|
|
694
|
+
return buildNetworkSnapshot$c(luvio, config);
|
|
695
|
+
};
|
|
696
|
+
};
|
|
697
|
+
|
|
698
|
+
function select$g(luvio, params) {
|
|
699
|
+
return select$i();
|
|
700
|
+
}
|
|
701
|
+
function getResponseCacheKeys$b(luvio, resourceParams, response) {
|
|
702
|
+
return getTypeCacheKeys$6(luvio, response);
|
|
703
|
+
}
|
|
704
|
+
function ingestSuccess$a(luvio, resourceParams, response) {
|
|
705
|
+
const { body } = response;
|
|
706
|
+
const key = keyBuilderFromType$3(luvio, body);
|
|
707
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
708
|
+
const snapshot = luvio.storeLookup({
|
|
709
|
+
recordId: key,
|
|
710
|
+
node: select$g(),
|
|
711
|
+
variables: {},
|
|
712
|
+
});
|
|
713
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
714
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
715
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
return snapshot;
|
|
719
|
+
}
|
|
720
|
+
function createResourceRequest$b(config) {
|
|
721
|
+
const headers = {};
|
|
722
|
+
return {
|
|
723
|
+
baseUri: '/services/data/v58.0',
|
|
724
|
+
basePath: '/connect/clm/contract/' + config.urlParams.contractId + '/contract-document-version',
|
|
725
|
+
method: 'post',
|
|
726
|
+
body: config.body,
|
|
727
|
+
urlParams: config.urlParams,
|
|
728
|
+
queryParams: {},
|
|
729
|
+
headers,
|
|
730
|
+
priority: 'normal',
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
const createContractDocumentVersionAndInitializeGenerateDocumentProcess_ConfigPropertyNames = {
|
|
735
|
+
displayName: 'createContractDocumentVersionAndInitializeGenerateDocumentProcess',
|
|
736
|
+
parameters: {
|
|
737
|
+
required: ['contractId', 'templateInput'],
|
|
738
|
+
optional: []
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
function createResourceParams$b(config) {
|
|
742
|
+
const resourceParams = {
|
|
743
|
+
urlParams: {
|
|
744
|
+
contractId: config.contractId
|
|
745
|
+
},
|
|
746
|
+
body: {
|
|
747
|
+
templateInput: config.templateInput
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
return resourceParams;
|
|
751
|
+
}
|
|
752
|
+
function typeCheckConfig$b(untrustedConfig) {
|
|
753
|
+
const config = {};
|
|
754
|
+
const untrustedConfig_contractId = untrustedConfig.contractId;
|
|
755
|
+
if (typeof untrustedConfig_contractId === 'string') {
|
|
756
|
+
config.contractId = untrustedConfig_contractId;
|
|
757
|
+
}
|
|
758
|
+
const untrustedConfig_templateInput = untrustedConfig.templateInput;
|
|
759
|
+
const referenceTemplateInputRepresentationValidationError = validate$d(untrustedConfig_templateInput);
|
|
760
|
+
if (referenceTemplateInputRepresentationValidationError === null) {
|
|
761
|
+
config.templateInput = untrustedConfig_templateInput;
|
|
762
|
+
}
|
|
763
|
+
return config;
|
|
764
|
+
}
|
|
765
|
+
function validateAdapterConfig$b(untrustedConfig, configPropertyNames) {
|
|
766
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
767
|
+
return null;
|
|
768
|
+
}
|
|
769
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
770
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
771
|
+
}
|
|
772
|
+
const config = typeCheckConfig$b(untrustedConfig);
|
|
773
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
774
|
+
return null;
|
|
775
|
+
}
|
|
776
|
+
return config;
|
|
777
|
+
}
|
|
778
|
+
function buildNetworkSnapshot$b(luvio, config, options) {
|
|
779
|
+
const resourceParams = createResourceParams$b(config);
|
|
780
|
+
const request = createResourceRequest$b(resourceParams);
|
|
781
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
782
|
+
.then((response) => {
|
|
783
|
+
return luvio.handleSuccessResponse(() => {
|
|
784
|
+
const snapshot = ingestSuccess$a(luvio, resourceParams, response);
|
|
785
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
786
|
+
}, () => getResponseCacheKeys$b(luvio, resourceParams, response.body));
|
|
787
|
+
}, (response) => {
|
|
788
|
+
deepFreeze$b(response);
|
|
789
|
+
throw response;
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
const createContractDocumentVersionAndInitializeGenerateDocumentProcessAdapterFactory = (luvio) => {
|
|
793
|
+
return function createContractDocumentVersionAndInitializeGenerateDocumentProcess(untrustedConfig) {
|
|
794
|
+
const config = validateAdapterConfig$b(untrustedConfig, createContractDocumentVersionAndInitializeGenerateDocumentProcess_ConfigPropertyNames);
|
|
795
|
+
// Invalid or incomplete config
|
|
796
|
+
if (config === null) {
|
|
797
|
+
throw new Error('Invalid config for "createContractDocumentVersionAndInitializeGenerateDocumentProcess"');
|
|
798
|
+
}
|
|
799
|
+
return buildNetworkSnapshot$b(luvio, config);
|
|
800
|
+
};
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
const TTL$4 = 60000;
|
|
804
|
+
const VERSION$5 = "dce4365dead9ca97204892d274fbf1b7";
|
|
805
|
+
function validate$a(obj, path = 'ContentDocumentListRepresentation') {
|
|
806
|
+
const v_error = (() => {
|
|
807
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
808
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
809
|
+
}
|
|
810
|
+
const obj_contractDocumentVersionId = obj.contractDocumentVersionId;
|
|
811
|
+
const path_contractDocumentVersionId = path + '.contractDocumentVersionId';
|
|
812
|
+
if (typeof obj_contractDocumentVersionId !== 'string') {
|
|
813
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contractDocumentVersionId + '" (at "' + path_contractDocumentVersionId + '")');
|
|
814
|
+
}
|
|
815
|
+
if (obj.data !== undefined) {
|
|
816
|
+
const obj_data = obj.data;
|
|
817
|
+
const path_data = path + '.data';
|
|
818
|
+
if (!ArrayIsArray(obj_data)) {
|
|
819
|
+
return new TypeError('Expected "array" but received "' + typeof obj_data + '" (at "' + path_data + '")');
|
|
820
|
+
}
|
|
821
|
+
for (let i = 0; i < obj_data.length; i++) {
|
|
822
|
+
const obj_data_item = obj_data[i];
|
|
823
|
+
const path_data_item = path_data + '[' + i + ']';
|
|
824
|
+
const referencepath_data_itemValidationError = validate$c(obj_data_item, path_data_item);
|
|
825
|
+
if (referencepath_data_itemValidationError !== null) {
|
|
826
|
+
let message = 'Object doesn\'t match ContentDocumentRepresentation (at "' + path_data_item + '")\n';
|
|
827
|
+
message += referencepath_data_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
828
|
+
return new TypeError(message);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
})();
|
|
833
|
+
return v_error === undefined ? null : v_error;
|
|
834
|
+
}
|
|
835
|
+
const RepresentationType$5 = 'ContentDocumentListRepresentation';
|
|
836
|
+
function keyBuilder$d(luvio, config) {
|
|
837
|
+
return keyPrefix + '::' + RepresentationType$5 + ':' + config.contractDocumentVersionId;
|
|
838
|
+
}
|
|
839
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
840
|
+
const keyParams = {
|
|
841
|
+
contractDocumentVersionId: object.contractDocumentVersionId
|
|
842
|
+
};
|
|
843
|
+
return keyBuilder$d(luvio, keyParams);
|
|
844
|
+
}
|
|
845
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
846
|
+
return input;
|
|
847
|
+
}
|
|
848
|
+
const select$f = function ContentDocumentListRepresentationSelect() {
|
|
849
|
+
return {
|
|
850
|
+
kind: 'Fragment',
|
|
851
|
+
version: VERSION$5,
|
|
852
|
+
private: [],
|
|
853
|
+
opaque: true
|
|
854
|
+
};
|
|
855
|
+
};
|
|
856
|
+
function equals$5(existing, incoming) {
|
|
857
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
858
|
+
return false;
|
|
859
|
+
}
|
|
860
|
+
return true;
|
|
861
|
+
}
|
|
862
|
+
function deepFreeze$7(input) {
|
|
863
|
+
const input_data = input.data;
|
|
864
|
+
if (input_data !== undefined) {
|
|
865
|
+
for (let i = 0; i < input_data.length; i++) {
|
|
866
|
+
const input_data_item = input_data[i];
|
|
867
|
+
deepFreeze$9(input_data_item);
|
|
868
|
+
}
|
|
869
|
+
ObjectFreeze(input_data);
|
|
870
|
+
}
|
|
871
|
+
ObjectFreeze(input);
|
|
872
|
+
}
|
|
873
|
+
const ingest$5 = function ContentDocumentListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
874
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
875
|
+
const validateError = validate$a(input);
|
|
876
|
+
if (validateError !== null) {
|
|
877
|
+
throw validateError;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
const key = keyBuilderFromType$2(luvio, input);
|
|
881
|
+
const existingRecord = store.readEntry(key);
|
|
882
|
+
const ttlToUse = TTL$4;
|
|
883
|
+
let incomingRecord = normalize$5(input, store.readEntry(key), {
|
|
884
|
+
fullPath: key,
|
|
885
|
+
parent: path.parent,
|
|
886
|
+
propertyName: path.propertyName,
|
|
887
|
+
ttl: ttlToUse
|
|
888
|
+
});
|
|
889
|
+
deepFreeze$7(input);
|
|
890
|
+
if (existingRecord === undefined || equals$5(existingRecord, incomingRecord) === false) {
|
|
891
|
+
luvio.storePublish(key, incomingRecord);
|
|
892
|
+
}
|
|
893
|
+
{
|
|
894
|
+
const storeMetadataParams = {
|
|
895
|
+
ttl: ttlToUse,
|
|
896
|
+
namespace: "clm",
|
|
897
|
+
version: VERSION$5,
|
|
898
|
+
representationName: RepresentationType$5,
|
|
899
|
+
};
|
|
900
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
901
|
+
}
|
|
902
|
+
return createLink(key);
|
|
903
|
+
};
|
|
904
|
+
function getTypeCacheKeys$5(luvio, input, fullPathFactory) {
|
|
905
|
+
const rootKeySet = new StoreKeyMap();
|
|
906
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
907
|
+
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
908
|
+
rootKeySet.set(rootKey, {
|
|
909
|
+
namespace: keyPrefix,
|
|
910
|
+
representationName: RepresentationType$5,
|
|
911
|
+
mergeable: false
|
|
912
|
+
});
|
|
913
|
+
return rootKeySet;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
function keyBuilder$c(luvio, params) {
|
|
917
|
+
return keyBuilder$d(luvio, {
|
|
918
|
+
contractDocumentVersionId: params.urlParams.contractDocumentVersionId
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
function getResponseCacheKeys$a(luvio, resourceParams) {
|
|
922
|
+
const key = keyBuilder$c(luvio, resourceParams);
|
|
923
|
+
const cacheKeyMap = new StoreKeyMap();
|
|
924
|
+
cacheKeyMap.set(key, {
|
|
925
|
+
namespace: keyPrefix,
|
|
926
|
+
representationName: RepresentationType$5,
|
|
927
|
+
mergeable: false
|
|
928
|
+
});
|
|
929
|
+
return cacheKeyMap;
|
|
930
|
+
}
|
|
931
|
+
function evictSuccess(luvio, resourceParams) {
|
|
932
|
+
const key = keyBuilder$c(luvio, resourceParams);
|
|
933
|
+
luvio.storeEvict(key);
|
|
934
|
+
}
|
|
935
|
+
function createResourceRequest$a(config) {
|
|
936
|
+
const headers = {};
|
|
937
|
+
return {
|
|
938
|
+
baseUri: '/services/data/v58.0',
|
|
939
|
+
basePath: '/connect/clm/contract-document-version/' + config.urlParams.contractDocumentVersionId + '/content-documents',
|
|
940
|
+
method: 'delete',
|
|
941
|
+
body: null,
|
|
942
|
+
urlParams: config.urlParams,
|
|
943
|
+
queryParams: config.queryParams,
|
|
944
|
+
headers,
|
|
945
|
+
priority: 'normal',
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
const adapterName = 'deleteAttachment';
|
|
950
|
+
const deleteAttachment_ConfigPropertyNames = {
|
|
951
|
+
displayName: 'deleteAttachment',
|
|
952
|
+
parameters: {
|
|
953
|
+
required: ['contractDocumentVersionId'],
|
|
954
|
+
optional: ['contentDocumentId']
|
|
955
|
+
}
|
|
956
|
+
};
|
|
957
|
+
function createResourceParams$a(config) {
|
|
958
|
+
const resourceParams = {
|
|
959
|
+
urlParams: {
|
|
960
|
+
contractDocumentVersionId: config.contractDocumentVersionId
|
|
961
|
+
},
|
|
962
|
+
queryParams: {
|
|
963
|
+
contentDocumentId: config.contentDocumentId
|
|
964
|
+
}
|
|
965
|
+
};
|
|
966
|
+
return resourceParams;
|
|
967
|
+
}
|
|
968
|
+
function typeCheckConfig$a(untrustedConfig) {
|
|
969
|
+
const config = {};
|
|
970
|
+
const untrustedConfig_contractDocumentVersionId = untrustedConfig.contractDocumentVersionId;
|
|
971
|
+
if (typeof untrustedConfig_contractDocumentVersionId === 'string') {
|
|
972
|
+
config.contractDocumentVersionId = untrustedConfig_contractDocumentVersionId;
|
|
973
|
+
}
|
|
974
|
+
const untrustedConfig_contentDocumentId = untrustedConfig.contentDocumentId;
|
|
975
|
+
if (typeof untrustedConfig_contentDocumentId === 'string') {
|
|
976
|
+
config.contentDocumentId = untrustedConfig_contentDocumentId;
|
|
977
|
+
}
|
|
978
|
+
return config;
|
|
979
|
+
}
|
|
980
|
+
function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
|
|
981
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
982
|
+
return null;
|
|
983
|
+
}
|
|
984
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
985
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
986
|
+
}
|
|
987
|
+
const config = typeCheckConfig$a(untrustedConfig);
|
|
988
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
989
|
+
return null;
|
|
990
|
+
}
|
|
991
|
+
return config;
|
|
992
|
+
}
|
|
993
|
+
function buildNetworkSnapshot$a(luvio, config, options) {
|
|
994
|
+
const resourceParams = createResourceParams$a(config);
|
|
995
|
+
const request = createResourceRequest$a(resourceParams);
|
|
996
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
997
|
+
.then(() => {
|
|
998
|
+
return luvio.handleSuccessResponse(() => {
|
|
999
|
+
evictSuccess(luvio, resourceParams);
|
|
1000
|
+
return luvio.storeBroadcast();
|
|
1001
|
+
}, () => getResponseCacheKeys$a(luvio, resourceParams));
|
|
1002
|
+
}, (response) => {
|
|
1003
|
+
deepFreeze$b(response);
|
|
1004
|
+
throw response;
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
const deleteAttachmentAdapterFactory = (luvio) => {
|
|
1008
|
+
return function clmdeleteAttachment(untrustedConfig) {
|
|
1009
|
+
const config = validateAdapterConfig$a(untrustedConfig, deleteAttachment_ConfigPropertyNames);
|
|
1010
|
+
// Invalid or incomplete config
|
|
1011
|
+
if (config === null) {
|
|
1012
|
+
throw new Error(`Invalid config for "${adapterName}"`);
|
|
1013
|
+
}
|
|
1014
|
+
return buildNetworkSnapshot$a(luvio, config);
|
|
1015
|
+
};
|
|
1016
|
+
};
|
|
1017
|
+
|
|
1018
|
+
function validate$9(obj, path = 'ContractActionInputRepresentation') {
|
|
1019
|
+
const v_error = (() => {
|
|
1020
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1021
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1022
|
+
}
|
|
1023
|
+
if (obj.actionApiName !== undefined) {
|
|
1024
|
+
const obj_actionApiName = obj.actionApiName;
|
|
1025
|
+
const path_actionApiName = path + '.actionApiName';
|
|
1026
|
+
if (typeof obj_actionApiName !== 'string') {
|
|
1027
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionApiName + '" (at "' + path_actionApiName + '")');
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
if (obj.actionData !== undefined) {
|
|
1031
|
+
const obj_actionData = obj.actionData;
|
|
1032
|
+
const path_actionData = path + '.actionData';
|
|
1033
|
+
if (typeof obj_actionData !== 'object' || ArrayIsArray(obj_actionData) || obj_actionData === null) {
|
|
1034
|
+
return new TypeError('Expected "object" but received "' + typeof obj_actionData + '" (at "' + path_actionData + '")');
|
|
1035
|
+
}
|
|
1036
|
+
const obj_actionData_keys = ObjectKeys(obj_actionData);
|
|
1037
|
+
for (let i = 0; i < obj_actionData_keys.length; i++) {
|
|
1038
|
+
const key = obj_actionData_keys[i];
|
|
1039
|
+
const obj_actionData_prop = obj_actionData[key];
|
|
1040
|
+
const path_actionData_prop = path_actionData + '["' + key + '"]';
|
|
1041
|
+
if (typeof obj_actionData_prop !== 'string') {
|
|
1042
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionData_prop + '" (at "' + path_actionData_prop + '")');
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
if (obj.actionId !== undefined) {
|
|
1047
|
+
const obj_actionId = obj.actionId;
|
|
1048
|
+
const path_actionId = path + '.actionId';
|
|
1049
|
+
if (typeof obj_actionId !== 'string') {
|
|
1050
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionId + '" (at "' + path_actionId + '")');
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
})();
|
|
1054
|
+
return v_error === undefined ? null : v_error;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
function select$e(luvio, params) {
|
|
1058
|
+
return select$l();
|
|
1059
|
+
}
|
|
1060
|
+
function getResponseCacheKeys$9(luvio, resourceParams, response) {
|
|
1061
|
+
return getTypeCacheKeys$7(luvio, response);
|
|
1062
|
+
}
|
|
1063
|
+
function ingestSuccess$9(luvio, resourceParams, response) {
|
|
1064
|
+
const { body } = response;
|
|
1065
|
+
const key = keyBuilderFromType$4(luvio, body);
|
|
1066
|
+
luvio.storeIngest(key, ingest$7, body);
|
|
1067
|
+
const snapshot = luvio.storeLookup({
|
|
1068
|
+
recordId: key,
|
|
1069
|
+
node: select$e(),
|
|
1070
|
+
variables: {},
|
|
1071
|
+
});
|
|
1072
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1073
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1074
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
return snapshot;
|
|
1078
|
+
}
|
|
1079
|
+
function createResourceRequest$9(config) {
|
|
1080
|
+
const headers = {};
|
|
1081
|
+
return {
|
|
1082
|
+
baseUri: '/services/data/v58.0',
|
|
1083
|
+
basePath: '/connect/clm/contract/' + config.urlParams.contractId + '',
|
|
1084
|
+
method: 'patch',
|
|
1085
|
+
body: config.body,
|
|
1086
|
+
urlParams: config.urlParams,
|
|
1087
|
+
queryParams: {},
|
|
1088
|
+
headers,
|
|
1089
|
+
priority: 'normal',
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
const executeContractAction_ConfigPropertyNames = {
|
|
1094
|
+
displayName: 'executeContractAction',
|
|
1095
|
+
parameters: {
|
|
1096
|
+
required: ['contractId', 'actionInput'],
|
|
1097
|
+
optional: []
|
|
1098
|
+
}
|
|
1099
|
+
};
|
|
1100
|
+
function createResourceParams$9(config) {
|
|
1101
|
+
const resourceParams = {
|
|
1102
|
+
urlParams: {
|
|
1103
|
+
contractId: config.contractId
|
|
1104
|
+
},
|
|
1105
|
+
body: {
|
|
1106
|
+
actionInput: config.actionInput
|
|
1107
|
+
}
|
|
1108
|
+
};
|
|
1109
|
+
return resourceParams;
|
|
1110
|
+
}
|
|
1111
|
+
function typeCheckConfig$9(untrustedConfig) {
|
|
1112
|
+
const config = {};
|
|
1113
|
+
const untrustedConfig_contractId = untrustedConfig.contractId;
|
|
1114
|
+
if (typeof untrustedConfig_contractId === 'string') {
|
|
1115
|
+
config.contractId = untrustedConfig_contractId;
|
|
1116
|
+
}
|
|
1117
|
+
const untrustedConfig_actionInput = untrustedConfig.actionInput;
|
|
1118
|
+
const referenceContractActionInputRepresentationValidationError = validate$9(untrustedConfig_actionInput);
|
|
1119
|
+
if (referenceContractActionInputRepresentationValidationError === null) {
|
|
1120
|
+
config.actionInput = untrustedConfig_actionInput;
|
|
1121
|
+
}
|
|
1122
|
+
return config;
|
|
1123
|
+
}
|
|
1124
|
+
function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
|
|
1125
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1126
|
+
return null;
|
|
1127
|
+
}
|
|
1128
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1129
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1130
|
+
}
|
|
1131
|
+
const config = typeCheckConfig$9(untrustedConfig);
|
|
1132
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1133
|
+
return null;
|
|
1134
|
+
}
|
|
1135
|
+
return config;
|
|
1136
|
+
}
|
|
1137
|
+
function buildNetworkSnapshot$9(luvio, config, options) {
|
|
1138
|
+
const resourceParams = createResourceParams$9(config);
|
|
1139
|
+
const request = createResourceRequest$9(resourceParams);
|
|
1140
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1141
|
+
.then((response) => {
|
|
1142
|
+
return luvio.handleSuccessResponse(() => {
|
|
1143
|
+
const snapshot = ingestSuccess$9(luvio, resourceParams, response);
|
|
1144
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1145
|
+
}, () => getResponseCacheKeys$9(luvio, resourceParams, response.body));
|
|
1146
|
+
}, (response) => {
|
|
1147
|
+
deepFreeze$b(response);
|
|
1148
|
+
throw response;
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
const executeContractActionAdapterFactory = (luvio) => {
|
|
1152
|
+
return function executeContractAction(untrustedConfig) {
|
|
1153
|
+
const config = validateAdapterConfig$9(untrustedConfig, executeContractAction_ConfigPropertyNames);
|
|
1154
|
+
// Invalid or incomplete config
|
|
1155
|
+
if (config === null) {
|
|
1156
|
+
throw new Error('Invalid config for "executeContractAction"');
|
|
1157
|
+
}
|
|
1158
|
+
return buildNetworkSnapshot$9(luvio, config);
|
|
1159
|
+
};
|
|
1160
|
+
};
|
|
1161
|
+
|
|
1162
|
+
function select$d(luvio, params) {
|
|
1163
|
+
return select$f();
|
|
1164
|
+
}
|
|
1165
|
+
function keyBuilder$b(luvio, params) {
|
|
1166
|
+
return keyBuilder$d(luvio, {
|
|
1167
|
+
contractDocumentVersionId: params.urlParams.contractDocumentVersionId
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
function getResponseCacheKeys$8(luvio, resourceParams, response) {
|
|
1171
|
+
return getTypeCacheKeys$5(luvio, response);
|
|
1172
|
+
}
|
|
1173
|
+
function ingestSuccess$8(luvio, resourceParams, response, snapshotRefresh) {
|
|
1174
|
+
const { body } = response;
|
|
1175
|
+
const key = keyBuilder$b(luvio, resourceParams);
|
|
1176
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
1177
|
+
const snapshot = luvio.storeLookup({
|
|
1178
|
+
recordId: key,
|
|
1179
|
+
node: select$d(),
|
|
1180
|
+
variables: {},
|
|
1181
|
+
}, snapshotRefresh);
|
|
1182
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1183
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1184
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
return snapshot;
|
|
1188
|
+
}
|
|
1189
|
+
function ingestError$4(luvio, params, error, snapshotRefresh) {
|
|
1190
|
+
const key = keyBuilder$b(luvio, params);
|
|
1191
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1192
|
+
const storeMetadataParams = {
|
|
1193
|
+
ttl: TTL$4,
|
|
1194
|
+
namespace: keyPrefix,
|
|
1195
|
+
version: VERSION$5,
|
|
1196
|
+
representationName: RepresentationType$5
|
|
1197
|
+
};
|
|
1198
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1199
|
+
return errorSnapshot;
|
|
1200
|
+
}
|
|
1201
|
+
function createResourceRequest$8(config) {
|
|
1202
|
+
const headers = {};
|
|
1203
|
+
return {
|
|
1204
|
+
baseUri: '/services/data/v58.0',
|
|
1205
|
+
basePath: '/connect/clm/contract-document-version/' + config.urlParams.contractDocumentVersionId + '/content-documents',
|
|
1206
|
+
method: 'get',
|
|
1207
|
+
body: null,
|
|
1208
|
+
urlParams: config.urlParams,
|
|
1209
|
+
queryParams: {},
|
|
1210
|
+
headers,
|
|
1211
|
+
priority: 'normal',
|
|
1212
|
+
};
|
|
1213
|
+
}
|
|
1214
|
+
function createResourceRequestFromRepresentation$1(representation) {
|
|
1215
|
+
const config = {
|
|
1216
|
+
urlParams: {},
|
|
1217
|
+
};
|
|
1218
|
+
config.urlParams.contractDocumentVersionId = representation.contractDocumentVersionId;
|
|
1219
|
+
return createResourceRequest$8(config);
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
const getContentDocument_ConfigPropertyNames = {
|
|
1223
|
+
displayName: 'getContentDocument',
|
|
1224
|
+
parameters: {
|
|
1225
|
+
required: ['contractDocumentVersionId'],
|
|
1226
|
+
optional: []
|
|
1227
|
+
}
|
|
1228
|
+
};
|
|
1229
|
+
function createResourceParams$8(config) {
|
|
1230
|
+
const resourceParams = {
|
|
1231
|
+
urlParams: {
|
|
1232
|
+
contractDocumentVersionId: config.contractDocumentVersionId
|
|
1233
|
+
}
|
|
1234
|
+
};
|
|
1235
|
+
return resourceParams;
|
|
1236
|
+
}
|
|
1237
|
+
function keyBuilder$a(luvio, config) {
|
|
1238
|
+
const resourceParams = createResourceParams$8(config);
|
|
1239
|
+
return keyBuilder$b(luvio, resourceParams);
|
|
1240
|
+
}
|
|
1241
|
+
function typeCheckConfig$8(untrustedConfig) {
|
|
1242
|
+
const config = {};
|
|
1243
|
+
const untrustedConfig_contractDocumentVersionId = untrustedConfig.contractDocumentVersionId;
|
|
1244
|
+
if (typeof untrustedConfig_contractDocumentVersionId === 'string') {
|
|
1245
|
+
config.contractDocumentVersionId = untrustedConfig_contractDocumentVersionId;
|
|
1246
|
+
}
|
|
1247
|
+
return config;
|
|
1248
|
+
}
|
|
1249
|
+
function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
|
|
1250
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1251
|
+
return null;
|
|
1252
|
+
}
|
|
1253
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1254
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1255
|
+
}
|
|
1256
|
+
const config = typeCheckConfig$8(untrustedConfig);
|
|
1257
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1258
|
+
return null;
|
|
1259
|
+
}
|
|
1260
|
+
return config;
|
|
1261
|
+
}
|
|
1262
|
+
function adapterFragment$4(luvio, config) {
|
|
1263
|
+
createResourceParams$8(config);
|
|
1264
|
+
return select$d();
|
|
1265
|
+
}
|
|
1266
|
+
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
1267
|
+
const snapshot = ingestSuccess$8(luvio, resourceParams, response, {
|
|
1268
|
+
config,
|
|
1269
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
1270
|
+
});
|
|
1271
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1272
|
+
}
|
|
1273
|
+
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
1274
|
+
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
1275
|
+
config,
|
|
1276
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
1277
|
+
});
|
|
1278
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1279
|
+
}
|
|
1280
|
+
function buildNetworkSnapshot$8(luvio, config, options) {
|
|
1281
|
+
const resourceParams = createResourceParams$8(config);
|
|
1282
|
+
const request = createResourceRequest$8(resourceParams);
|
|
1283
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1284
|
+
.then((response) => {
|
|
1285
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => getResponseCacheKeys$8(luvio, resourceParams, response.body));
|
|
1286
|
+
}, (response) => {
|
|
1287
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
1288
|
+
});
|
|
1289
|
+
}
|
|
1290
|
+
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
1291
|
+
const { luvio, config } = context;
|
|
1292
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
1293
|
+
const dispatchOptions = {
|
|
1294
|
+
resourceRequestContext: {
|
|
1295
|
+
requestCorrelator,
|
|
1296
|
+
luvioRequestMethod: undefined,
|
|
1297
|
+
},
|
|
1298
|
+
eventObservers
|
|
1299
|
+
};
|
|
1300
|
+
if (networkPriority !== 'normal') {
|
|
1301
|
+
dispatchOptions.overrides = {
|
|
1302
|
+
priority: networkPriority
|
|
1303
|
+
};
|
|
1304
|
+
}
|
|
1305
|
+
return buildNetworkSnapshot$8(luvio, config, dispatchOptions);
|
|
1306
|
+
}
|
|
1307
|
+
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
1308
|
+
const { luvio, config } = context;
|
|
1309
|
+
const selector = {
|
|
1310
|
+
recordId: keyBuilder$a(luvio, config),
|
|
1311
|
+
node: adapterFragment$4(luvio, config),
|
|
1312
|
+
variables: {},
|
|
1313
|
+
};
|
|
1314
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1315
|
+
config,
|
|
1316
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
1317
|
+
});
|
|
1318
|
+
return cacheSnapshot;
|
|
1319
|
+
}
|
|
1320
|
+
const getContentDocumentAdapterFactory = (luvio) => function clm__getContentDocument(untrustedConfig, requestContext) {
|
|
1321
|
+
const config = validateAdapterConfig$8(untrustedConfig, getContentDocument_ConfigPropertyNames);
|
|
1322
|
+
// Invalid or incomplete config
|
|
1323
|
+
if (config === null) {
|
|
1324
|
+
return null;
|
|
1325
|
+
}
|
|
1326
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1327
|
+
buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
|
|
1328
|
+
};
|
|
1329
|
+
const notifyChangeFactory$1 = (luvio, options) => {
|
|
1330
|
+
return function getConnectClmContractDocumentVersionContentDocumentsByContractDocumentVersionIdNotifyChange(configs) {
|
|
1331
|
+
const keys = configs.map(c => keyBuilder$d(luvio, c));
|
|
1332
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
1333
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
1334
|
+
const { key, record: val } = entries[i];
|
|
1335
|
+
const refreshRequest = createResourceRequestFromRepresentation$1(val);
|
|
1336
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
1337
|
+
.then((response) => {
|
|
1338
|
+
return luvio.handleSuccessResponse(() => {
|
|
1339
|
+
const { body } = response;
|
|
1340
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
1341
|
+
return luvio.storeBroadcast();
|
|
1342
|
+
}, () => getTypeCacheKeys$5(luvio, response.body));
|
|
1343
|
+
}, (error) => {
|
|
1344
|
+
return luvio.handleErrorResponse(() => {
|
|
1345
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
1346
|
+
luvio.storeIngestError(key, errorSnapshot, {
|
|
1347
|
+
ttl: TTL$4,
|
|
1348
|
+
namespace: keyPrefix,
|
|
1349
|
+
version: VERSION$5,
|
|
1350
|
+
representationName: RepresentationType$5
|
|
1351
|
+
});
|
|
1352
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
1353
|
+
});
|
|
1354
|
+
});
|
|
1355
|
+
}
|
|
1356
|
+
});
|
|
1357
|
+
};
|
|
1358
|
+
};
|
|
1359
|
+
|
|
1360
|
+
function validate$8(obj, path = 'ContractActionRepresentation') {
|
|
1361
|
+
const v_error = (() => {
|
|
1362
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1363
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1364
|
+
}
|
|
1365
|
+
const obj_actionId = obj.actionId;
|
|
1366
|
+
const path_actionId = path + '.actionId';
|
|
1367
|
+
if (typeof obj_actionId !== 'string') {
|
|
1368
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionId + '" (at "' + path_actionId + '")');
|
|
1369
|
+
}
|
|
1370
|
+
if (obj.actionType !== undefined) {
|
|
1371
|
+
const obj_actionType = obj.actionType;
|
|
1372
|
+
const path_actionType = path + '.actionType';
|
|
1373
|
+
if (typeof obj_actionType !== 'string') {
|
|
1374
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionType + '" (at "' + path_actionType + '")');
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
const obj_apiName = obj.apiName;
|
|
1378
|
+
const path_apiName = path + '.apiName';
|
|
1379
|
+
if (typeof obj_apiName !== 'string') {
|
|
1380
|
+
return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
|
|
1381
|
+
}
|
|
1382
|
+
if (obj.invocableClassName !== undefined) {
|
|
1383
|
+
const obj_invocableClassName = obj.invocableClassName;
|
|
1384
|
+
const path_invocableClassName = path + '.invocableClassName';
|
|
1385
|
+
if (typeof obj_invocableClassName !== 'string') {
|
|
1386
|
+
return new TypeError('Expected "string" but received "' + typeof obj_invocableClassName + '" (at "' + path_invocableClassName + '")');
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
if (obj.invocableMethodName !== undefined) {
|
|
1390
|
+
const obj_invocableMethodName = obj.invocableMethodName;
|
|
1391
|
+
const path_invocableMethodName = path + '.invocableMethodName';
|
|
1392
|
+
if (typeof obj_invocableMethodName !== 'string') {
|
|
1393
|
+
return new TypeError('Expected "string" but received "' + typeof obj_invocableMethodName + '" (at "' + path_invocableMethodName + '")');
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
if (obj.referenceObject !== undefined) {
|
|
1397
|
+
const obj_referenceObject = obj.referenceObject;
|
|
1398
|
+
const path_referenceObject = path + '.referenceObject';
|
|
1399
|
+
if (typeof obj_referenceObject !== 'string') {
|
|
1400
|
+
return new TypeError('Expected "string" but received "' + typeof obj_referenceObject + '" (at "' + path_referenceObject + '")');
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
if (obj.referenceObjectId !== undefined) {
|
|
1404
|
+
const obj_referenceObjectId = obj.referenceObjectId;
|
|
1405
|
+
const path_referenceObjectId = path + '.referenceObjectId';
|
|
1406
|
+
if (typeof obj_referenceObjectId !== 'string') {
|
|
1407
|
+
return new TypeError('Expected "string" but received "' + typeof obj_referenceObjectId + '" (at "' + path_referenceObjectId + '")');
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
const obj_uiText = obj.uiText;
|
|
1411
|
+
const path_uiText = path + '.uiText';
|
|
1412
|
+
if (typeof obj_uiText !== 'string') {
|
|
1413
|
+
return new TypeError('Expected "string" but received "' + typeof obj_uiText + '" (at "' + path_uiText + '")');
|
|
1414
|
+
}
|
|
1415
|
+
})();
|
|
1416
|
+
return v_error === undefined ? null : v_error;
|
|
1417
|
+
}
|
|
1418
|
+
function deepFreeze$6(input) {
|
|
1419
|
+
ObjectFreeze(input);
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
const TTL$3 = 60000;
|
|
1423
|
+
const VERSION$4 = "2caf5349dc6c6aa44ef471df00f65bbd";
|
|
1424
|
+
function validate$7(obj, path = 'ContractActionListRepresentation') {
|
|
1425
|
+
const v_error = (() => {
|
|
1426
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1427
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1428
|
+
}
|
|
1429
|
+
const obj_actions = obj.actions;
|
|
1430
|
+
const path_actions = path + '.actions';
|
|
1431
|
+
if (!ArrayIsArray(obj_actions)) {
|
|
1432
|
+
return new TypeError('Expected "array" but received "' + typeof obj_actions + '" (at "' + path_actions + '")');
|
|
1433
|
+
}
|
|
1434
|
+
for (let i = 0; i < obj_actions.length; i++) {
|
|
1435
|
+
const obj_actions_item = obj_actions[i];
|
|
1436
|
+
const path_actions_item = path_actions + '[' + i + ']';
|
|
1437
|
+
const referencepath_actions_itemValidationError = validate$8(obj_actions_item, path_actions_item);
|
|
1438
|
+
if (referencepath_actions_itemValidationError !== null) {
|
|
1439
|
+
let message = 'Object doesn\'t match ContractActionRepresentation (at "' + path_actions_item + '")\n';
|
|
1440
|
+
message += referencepath_actions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1441
|
+
return new TypeError(message);
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
const obj_contractId = obj.contractId;
|
|
1445
|
+
const path_contractId = path + '.contractId';
|
|
1446
|
+
if (typeof obj_contractId !== 'string') {
|
|
1447
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contractId + '" (at "' + path_contractId + '")');
|
|
1448
|
+
}
|
|
1449
|
+
})();
|
|
1450
|
+
return v_error === undefined ? null : v_error;
|
|
1451
|
+
}
|
|
1452
|
+
const RepresentationType$4 = 'ContractActionListRepresentation';
|
|
1453
|
+
function keyBuilder$9(luvio, config) {
|
|
1454
|
+
return keyPrefix + '::' + RepresentationType$4 + ':' + config.contractId;
|
|
1455
|
+
}
|
|
1456
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
1457
|
+
const keyParams = {
|
|
1458
|
+
contractId: object.contractId
|
|
1459
|
+
};
|
|
1460
|
+
return keyBuilder$9(luvio, keyParams);
|
|
1461
|
+
}
|
|
1462
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
1463
|
+
return input;
|
|
1464
|
+
}
|
|
1465
|
+
const select$c = function ContractActionListRepresentationSelect() {
|
|
1466
|
+
return {
|
|
1467
|
+
kind: 'Fragment',
|
|
1468
|
+
version: VERSION$4,
|
|
1469
|
+
private: [],
|
|
1470
|
+
opaque: true
|
|
1471
|
+
};
|
|
1472
|
+
};
|
|
1473
|
+
function equals$4(existing, incoming) {
|
|
1474
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1475
|
+
return false;
|
|
1476
|
+
}
|
|
1477
|
+
return true;
|
|
1478
|
+
}
|
|
1479
|
+
function deepFreeze$5(input) {
|
|
1480
|
+
const input_actions = input.actions;
|
|
1481
|
+
for (let i = 0; i < input_actions.length; i++) {
|
|
1482
|
+
const input_actions_item = input_actions[i];
|
|
1483
|
+
deepFreeze$6(input_actions_item);
|
|
1484
|
+
}
|
|
1485
|
+
ObjectFreeze(input_actions);
|
|
1486
|
+
ObjectFreeze(input);
|
|
1487
|
+
}
|
|
1488
|
+
const ingest$4 = function ContractActionListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1489
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1490
|
+
const validateError = validate$7(input);
|
|
1491
|
+
if (validateError !== null) {
|
|
1492
|
+
throw validateError;
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
1496
|
+
const existingRecord = store.readEntry(key);
|
|
1497
|
+
const ttlToUse = TTL$3;
|
|
1498
|
+
let incomingRecord = normalize$4(input, store.readEntry(key), {
|
|
1499
|
+
fullPath: key,
|
|
1500
|
+
parent: path.parent,
|
|
1501
|
+
propertyName: path.propertyName,
|
|
1502
|
+
ttl: ttlToUse
|
|
1503
|
+
});
|
|
1504
|
+
deepFreeze$5(input);
|
|
1505
|
+
if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
|
|
1506
|
+
luvio.storePublish(key, incomingRecord);
|
|
1507
|
+
}
|
|
1508
|
+
{
|
|
1509
|
+
const storeMetadataParams = {
|
|
1510
|
+
ttl: ttlToUse,
|
|
1511
|
+
namespace: "clm",
|
|
1512
|
+
version: VERSION$4,
|
|
1513
|
+
representationName: RepresentationType$4,
|
|
1514
|
+
};
|
|
1515
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1516
|
+
}
|
|
1517
|
+
return createLink(key);
|
|
1518
|
+
};
|
|
1519
|
+
function getTypeCacheKeys$4(luvio, input, fullPathFactory) {
|
|
1520
|
+
const rootKeySet = new StoreKeyMap();
|
|
1521
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1522
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
1523
|
+
rootKeySet.set(rootKey, {
|
|
1524
|
+
namespace: keyPrefix,
|
|
1525
|
+
representationName: RepresentationType$4,
|
|
1526
|
+
mergeable: false
|
|
1527
|
+
});
|
|
1528
|
+
return rootKeySet;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
function select$b(luvio, params) {
|
|
1532
|
+
return select$c();
|
|
1533
|
+
}
|
|
1534
|
+
function keyBuilder$8(luvio, params) {
|
|
1535
|
+
return keyBuilder$9(luvio, {
|
|
1536
|
+
contractId: params.urlParams.contractId
|
|
1537
|
+
});
|
|
1538
|
+
}
|
|
1539
|
+
function getResponseCacheKeys$7(luvio, resourceParams, response) {
|
|
1540
|
+
return getTypeCacheKeys$4(luvio, response);
|
|
1541
|
+
}
|
|
1542
|
+
function ingestSuccess$7(luvio, resourceParams, response, snapshotRefresh) {
|
|
1543
|
+
const { body } = response;
|
|
1544
|
+
const key = keyBuilder$8(luvio, resourceParams);
|
|
1545
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
1546
|
+
const snapshot = luvio.storeLookup({
|
|
1547
|
+
recordId: key,
|
|
1548
|
+
node: select$b(),
|
|
1549
|
+
variables: {},
|
|
1550
|
+
}, snapshotRefresh);
|
|
1551
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1552
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1553
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
return snapshot;
|
|
1557
|
+
}
|
|
1558
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
1559
|
+
const key = keyBuilder$8(luvio, params);
|
|
1560
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1561
|
+
const storeMetadataParams = {
|
|
1562
|
+
ttl: TTL$3,
|
|
1563
|
+
namespace: keyPrefix,
|
|
1564
|
+
version: VERSION$4,
|
|
1565
|
+
representationName: RepresentationType$4
|
|
1566
|
+
};
|
|
1567
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1568
|
+
return errorSnapshot;
|
|
1569
|
+
}
|
|
1570
|
+
function createResourceRequest$7(config) {
|
|
1571
|
+
const headers = {};
|
|
1572
|
+
return {
|
|
1573
|
+
baseUri: '/services/data/v58.0',
|
|
1574
|
+
basePath: '/connect/clm/contract/' + config.urlParams.contractId + '/contract-actions',
|
|
1575
|
+
method: 'get',
|
|
1576
|
+
body: null,
|
|
1577
|
+
urlParams: config.urlParams,
|
|
1578
|
+
queryParams: {},
|
|
1579
|
+
headers,
|
|
1580
|
+
priority: 'normal',
|
|
1581
|
+
};
|
|
1582
|
+
}
|
|
1583
|
+
function createResourceRequestFromRepresentation(representation) {
|
|
1584
|
+
const config = {
|
|
1585
|
+
urlParams: {},
|
|
1586
|
+
};
|
|
1587
|
+
config.urlParams.contractId = representation.contractId;
|
|
1588
|
+
return createResourceRequest$7(config);
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
const getContractActions_ConfigPropertyNames = {
|
|
1592
|
+
displayName: 'getContractActions',
|
|
1593
|
+
parameters: {
|
|
1594
|
+
required: ['contractId'],
|
|
1595
|
+
optional: []
|
|
1596
|
+
}
|
|
1597
|
+
};
|
|
1598
|
+
function createResourceParams$7(config) {
|
|
1599
|
+
const resourceParams = {
|
|
1600
|
+
urlParams: {
|
|
1601
|
+
contractId: config.contractId
|
|
1602
|
+
}
|
|
1603
|
+
};
|
|
1604
|
+
return resourceParams;
|
|
1605
|
+
}
|
|
1606
|
+
function keyBuilder$7(luvio, config) {
|
|
1607
|
+
const resourceParams = createResourceParams$7(config);
|
|
1608
|
+
return keyBuilder$8(luvio, resourceParams);
|
|
1609
|
+
}
|
|
1610
|
+
function typeCheckConfig$7(untrustedConfig) {
|
|
1611
|
+
const config = {};
|
|
1612
|
+
const untrustedConfig_contractId = untrustedConfig.contractId;
|
|
1613
|
+
if (typeof untrustedConfig_contractId === 'string') {
|
|
1614
|
+
config.contractId = untrustedConfig_contractId;
|
|
1615
|
+
}
|
|
1616
|
+
return config;
|
|
1617
|
+
}
|
|
1618
|
+
function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
|
|
1619
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1620
|
+
return null;
|
|
1621
|
+
}
|
|
1622
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1623
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1624
|
+
}
|
|
1625
|
+
const config = typeCheckConfig$7(untrustedConfig);
|
|
1626
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1627
|
+
return null;
|
|
1628
|
+
}
|
|
1629
|
+
return config;
|
|
1630
|
+
}
|
|
1631
|
+
function adapterFragment$3(luvio, config) {
|
|
1632
|
+
createResourceParams$7(config);
|
|
1633
|
+
return select$b();
|
|
1634
|
+
}
|
|
1635
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
1636
|
+
const snapshot = ingestSuccess$7(luvio, resourceParams, response, {
|
|
1637
|
+
config,
|
|
1638
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
1639
|
+
});
|
|
1640
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1641
|
+
}
|
|
1642
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
1643
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
1644
|
+
config,
|
|
1645
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
1646
|
+
});
|
|
1647
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1648
|
+
}
|
|
1649
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
1650
|
+
const resourceParams = createResourceParams$7(config);
|
|
1651
|
+
const request = createResourceRequest$7(resourceParams);
|
|
1652
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1653
|
+
.then((response) => {
|
|
1654
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => getResponseCacheKeys$7(luvio, resourceParams, response.body));
|
|
1655
|
+
}, (response) => {
|
|
1656
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
1660
|
+
const { luvio, config } = context;
|
|
1661
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
1662
|
+
const dispatchOptions = {
|
|
1663
|
+
resourceRequestContext: {
|
|
1664
|
+
requestCorrelator,
|
|
1665
|
+
luvioRequestMethod: undefined,
|
|
1666
|
+
},
|
|
1667
|
+
eventObservers
|
|
1668
|
+
};
|
|
1669
|
+
if (networkPriority !== 'normal') {
|
|
1670
|
+
dispatchOptions.overrides = {
|
|
1671
|
+
priority: networkPriority
|
|
1672
|
+
};
|
|
1673
|
+
}
|
|
1674
|
+
return buildNetworkSnapshot$7(luvio, config, dispatchOptions);
|
|
1675
|
+
}
|
|
1676
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
1677
|
+
const { luvio, config } = context;
|
|
1678
|
+
const selector = {
|
|
1679
|
+
recordId: keyBuilder$7(luvio, config),
|
|
1680
|
+
node: adapterFragment$3(luvio, config),
|
|
1681
|
+
variables: {},
|
|
1682
|
+
};
|
|
1683
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1684
|
+
config,
|
|
1685
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
1686
|
+
});
|
|
1687
|
+
return cacheSnapshot;
|
|
1688
|
+
}
|
|
1689
|
+
const getContractActionsAdapterFactory = (luvio) => function clm__getContractActions(untrustedConfig, requestContext) {
|
|
1690
|
+
const config = validateAdapterConfig$7(untrustedConfig, getContractActions_ConfigPropertyNames);
|
|
1691
|
+
// Invalid or incomplete config
|
|
1692
|
+
if (config === null) {
|
|
1693
|
+
return null;
|
|
1694
|
+
}
|
|
1695
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1696
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
1697
|
+
};
|
|
1698
|
+
const notifyChangeFactory = (luvio, options) => {
|
|
1699
|
+
return function getConnectClmContractContractActionsByContractIdNotifyChange(configs) {
|
|
1700
|
+
const keys = configs.map(c => keyBuilder$9(luvio, c));
|
|
1701
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
1702
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
1703
|
+
const { key, record: val } = entries[i];
|
|
1704
|
+
const refreshRequest = createResourceRequestFromRepresentation(val);
|
|
1705
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
1706
|
+
.then((response) => {
|
|
1707
|
+
return luvio.handleSuccessResponse(() => {
|
|
1708
|
+
const { body } = response;
|
|
1709
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
1710
|
+
return luvio.storeBroadcast();
|
|
1711
|
+
}, () => getTypeCacheKeys$4(luvio, response.body));
|
|
1712
|
+
}, (error) => {
|
|
1713
|
+
return luvio.handleErrorResponse(() => {
|
|
1714
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
1715
|
+
luvio.storeIngestError(key, errorSnapshot, {
|
|
1716
|
+
ttl: TTL$3,
|
|
1717
|
+
namespace: keyPrefix,
|
|
1718
|
+
version: VERSION$4,
|
|
1719
|
+
representationName: RepresentationType$4
|
|
1720
|
+
});
|
|
1721
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
1722
|
+
});
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
});
|
|
1726
|
+
};
|
|
1727
|
+
};
|
|
1728
|
+
|
|
1729
|
+
function validate$6(obj, path = 'ContractDocumentVersionRepresentation') {
|
|
1730
|
+
const v_error = (() => {
|
|
1731
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1732
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1733
|
+
}
|
|
1734
|
+
const obj_contractDocumentVersionId = obj.contractDocumentVersionId;
|
|
1735
|
+
const path_contractDocumentVersionId = path + '.contractDocumentVersionId';
|
|
1736
|
+
if (typeof obj_contractDocumentVersionId !== 'string') {
|
|
1737
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contractDocumentVersionId + '" (at "' + path_contractDocumentVersionId + '")');
|
|
1738
|
+
}
|
|
1739
|
+
const obj_contractId = obj.contractId;
|
|
1740
|
+
const path_contractId = path + '.contractId';
|
|
1741
|
+
if (typeof obj_contractId !== 'string') {
|
|
1742
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contractId + '" (at "' + path_contractId + '")');
|
|
1743
|
+
}
|
|
1744
|
+
if (obj.createdByFullName !== undefined) {
|
|
1745
|
+
const obj_createdByFullName = obj.createdByFullName;
|
|
1746
|
+
const path_createdByFullName = path + '.createdByFullName';
|
|
1747
|
+
if (typeof obj_createdByFullName !== 'string') {
|
|
1748
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdByFullName + '" (at "' + path_createdByFullName + '")');
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
const obj_createdDate = obj.createdDate;
|
|
1752
|
+
const path_createdDate = path + '.createdDate';
|
|
1753
|
+
if (typeof obj_createdDate !== 'string') {
|
|
1754
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
1755
|
+
}
|
|
1756
|
+
if (obj.creationProcessType !== undefined) {
|
|
1757
|
+
const obj_creationProcessType = obj.creationProcessType;
|
|
1758
|
+
const path_creationProcessType = path + '.creationProcessType';
|
|
1759
|
+
if (typeof obj_creationProcessType !== 'string') {
|
|
1760
|
+
return new TypeError('Expected "string" but received "' + typeof obj_creationProcessType + '" (at "' + path_creationProcessType + '")');
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
if (obj.documentTemplateId !== undefined) {
|
|
1764
|
+
const obj_documentTemplateId = obj.documentTemplateId;
|
|
1765
|
+
const path_documentTemplateId = path + '.documentTemplateId';
|
|
1766
|
+
if (typeof obj_documentTemplateId !== 'string') {
|
|
1767
|
+
return new TypeError('Expected "string" but received "' + typeof obj_documentTemplateId + '" (at "' + path_documentTemplateId + '")');
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
const obj_isDocumentVersionLocked = obj.isDocumentVersionLocked;
|
|
1771
|
+
const path_isDocumentVersionLocked = path + '.isDocumentVersionLocked';
|
|
1772
|
+
if (typeof obj_isDocumentVersionLocked !== 'boolean') {
|
|
1773
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isDocumentVersionLocked + '" (at "' + path_isDocumentVersionLocked + '")');
|
|
1774
|
+
}
|
|
1775
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
1776
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
1777
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
1778
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
1779
|
+
}
|
|
1780
|
+
if (obj.lockType !== undefined) {
|
|
1781
|
+
const obj_lockType = obj.lockType;
|
|
1782
|
+
const path_lockType = path + '.lockType';
|
|
1783
|
+
if (typeof obj_lockType !== 'string') {
|
|
1784
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lockType + '" (at "' + path_lockType + '")');
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
if (obj.lockedByUserName !== undefined) {
|
|
1788
|
+
const obj_lockedByUserName = obj.lockedByUserName;
|
|
1789
|
+
const path_lockedByUserName = path + '.lockedByUserName';
|
|
1790
|
+
if (typeof obj_lockedByUserName !== 'string') {
|
|
1791
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lockedByUserName + '" (at "' + path_lockedByUserName + '")');
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
const obj_name = obj.name;
|
|
1795
|
+
const path_name = path + '.name';
|
|
1796
|
+
if (typeof obj_name !== 'string') {
|
|
1797
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1798
|
+
}
|
|
1799
|
+
const obj_status = obj.status;
|
|
1800
|
+
const path_status = path + '.status';
|
|
1801
|
+
if (typeof obj_status !== 'string') {
|
|
1802
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1803
|
+
}
|
|
1804
|
+
const obj_versionNumber = obj.versionNumber;
|
|
1805
|
+
const path_versionNumber = path + '.versionNumber';
|
|
1806
|
+
if (typeof obj_versionNumber !== 'string') {
|
|
1807
|
+
return new TypeError('Expected "string" but received "' + typeof obj_versionNumber + '" (at "' + path_versionNumber + '")');
|
|
1808
|
+
}
|
|
1809
|
+
})();
|
|
1810
|
+
return v_error === undefined ? null : v_error;
|
|
1811
|
+
}
|
|
1812
|
+
function deepFreeze$4(input) {
|
|
1813
|
+
ObjectFreeze(input);
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
const TTL$2 = 60000;
|
|
1817
|
+
const VERSION$3 = "a824de2ee1cbb2f1e15ea8114da78d95";
|
|
1818
|
+
function validate$5(obj, path = 'ContractDocumentVersionsListRepresentation') {
|
|
1819
|
+
const v_error = (() => {
|
|
1820
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1821
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1822
|
+
}
|
|
1823
|
+
const obj_contractId = obj.contractId;
|
|
1824
|
+
const path_contractId = path + '.contractId';
|
|
1825
|
+
if (typeof obj_contractId !== 'string') {
|
|
1826
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contractId + '" (at "' + path_contractId + '")');
|
|
1827
|
+
}
|
|
1828
|
+
if (obj.data !== undefined) {
|
|
1829
|
+
const obj_data = obj.data;
|
|
1830
|
+
const path_data = path + '.data';
|
|
1831
|
+
if (!ArrayIsArray(obj_data)) {
|
|
1832
|
+
return new TypeError('Expected "array" but received "' + typeof obj_data + '" (at "' + path_data + '")');
|
|
1833
|
+
}
|
|
1834
|
+
for (let i = 0; i < obj_data.length; i++) {
|
|
1835
|
+
const obj_data_item = obj_data[i];
|
|
1836
|
+
const path_data_item = path_data + '[' + i + ']';
|
|
1837
|
+
const referencepath_data_itemValidationError = validate$6(obj_data_item, path_data_item);
|
|
1838
|
+
if (referencepath_data_itemValidationError !== null) {
|
|
1839
|
+
let message = 'Object doesn\'t match ContractDocumentVersionRepresentation (at "' + path_data_item + '")\n';
|
|
1840
|
+
message += referencepath_data_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1841
|
+
return new TypeError(message);
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
})();
|
|
1846
|
+
return v_error === undefined ? null : v_error;
|
|
1847
|
+
}
|
|
1848
|
+
const RepresentationType$3 = 'ContractDocumentVersionsListRepresentation';
|
|
1849
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
1850
|
+
return input;
|
|
1851
|
+
}
|
|
1852
|
+
const select$a = function ContractDocumentVersionsListRepresentationSelect() {
|
|
1853
|
+
return {
|
|
1854
|
+
kind: 'Fragment',
|
|
1855
|
+
version: VERSION$3,
|
|
1856
|
+
private: [],
|
|
1857
|
+
opaque: true
|
|
1858
|
+
};
|
|
1859
|
+
};
|
|
1860
|
+
function equals$3(existing, incoming) {
|
|
1861
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1862
|
+
return false;
|
|
1863
|
+
}
|
|
1864
|
+
return true;
|
|
1865
|
+
}
|
|
1866
|
+
function deepFreeze$3(input) {
|
|
1867
|
+
const input_data = input.data;
|
|
1868
|
+
if (input_data !== undefined) {
|
|
1869
|
+
for (let i = 0; i < input_data.length; i++) {
|
|
1870
|
+
const input_data_item = input_data[i];
|
|
1871
|
+
deepFreeze$4(input_data_item);
|
|
1872
|
+
}
|
|
1873
|
+
ObjectFreeze(input_data);
|
|
1874
|
+
}
|
|
1875
|
+
ObjectFreeze(input);
|
|
1876
|
+
}
|
|
1877
|
+
const ingest$3 = function ContractDocumentVersionsListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1878
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1879
|
+
const validateError = validate$5(input);
|
|
1880
|
+
if (validateError !== null) {
|
|
1881
|
+
throw validateError;
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
const key = path.fullPath;
|
|
1885
|
+
const existingRecord = store.readEntry(key);
|
|
1886
|
+
const ttlToUse = TTL$2;
|
|
1887
|
+
let incomingRecord = normalize$3(input, store.readEntry(key), {
|
|
1888
|
+
fullPath: key,
|
|
1889
|
+
parent: path.parent,
|
|
1890
|
+
propertyName: path.propertyName,
|
|
1891
|
+
ttl: ttlToUse
|
|
1892
|
+
});
|
|
1893
|
+
deepFreeze$3(input);
|
|
1894
|
+
if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
|
|
1895
|
+
luvio.storePublish(key, incomingRecord);
|
|
1896
|
+
}
|
|
1897
|
+
{
|
|
1898
|
+
const storeMetadataParams = {
|
|
1899
|
+
ttl: ttlToUse,
|
|
1900
|
+
namespace: "clm",
|
|
1901
|
+
version: VERSION$3,
|
|
1902
|
+
representationName: RepresentationType$3,
|
|
1903
|
+
};
|
|
1904
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1905
|
+
}
|
|
1906
|
+
return createLink(key);
|
|
1907
|
+
};
|
|
1908
|
+
function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
|
|
1909
|
+
const rootKeySet = new StoreKeyMap();
|
|
1910
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1911
|
+
const rootKey = fullPathFactory();
|
|
1912
|
+
rootKeySet.set(rootKey, {
|
|
1913
|
+
namespace: keyPrefix,
|
|
1914
|
+
representationName: RepresentationType$3,
|
|
1915
|
+
mergeable: false
|
|
1916
|
+
});
|
|
1917
|
+
return rootKeySet;
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
function select$9(luvio, params) {
|
|
1921
|
+
return select$a();
|
|
1922
|
+
}
|
|
1923
|
+
function keyBuilder$6(luvio, params) {
|
|
1924
|
+
return keyPrefix + '::ContractDocumentVersionsListRepresentation:(' + 'contractDocumentVersionId:' + params.queryParams.contractDocumentVersionId + ',' + 'contractId:' + params.urlParams.contractId + ')';
|
|
1925
|
+
}
|
|
1926
|
+
function getResponseCacheKeys$6(luvio, resourceParams, response) {
|
|
1927
|
+
return getTypeCacheKeys$3(luvio, response, () => keyBuilder$6(luvio, resourceParams));
|
|
1928
|
+
}
|
|
1929
|
+
function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
1930
|
+
const { body } = response;
|
|
1931
|
+
const key = keyBuilder$6(luvio, resourceParams);
|
|
1932
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
1933
|
+
const snapshot = luvio.storeLookup({
|
|
1934
|
+
recordId: key,
|
|
1935
|
+
node: select$9(),
|
|
1936
|
+
variables: {},
|
|
1937
|
+
}, snapshotRefresh);
|
|
1938
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1939
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1940
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
return snapshot;
|
|
1944
|
+
}
|
|
1945
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
1946
|
+
const key = keyBuilder$6(luvio, params);
|
|
1947
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1948
|
+
const storeMetadataParams = {
|
|
1949
|
+
ttl: TTL$2,
|
|
1950
|
+
namespace: keyPrefix,
|
|
1951
|
+
version: VERSION$3,
|
|
1952
|
+
representationName: RepresentationType$3
|
|
1953
|
+
};
|
|
1954
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1955
|
+
return errorSnapshot;
|
|
1956
|
+
}
|
|
1957
|
+
function createResourceRequest$6(config) {
|
|
1958
|
+
const headers = {};
|
|
1959
|
+
return {
|
|
1960
|
+
baseUri: '/services/data/v58.0',
|
|
1961
|
+
basePath: '/connect/clm/contract/' + config.urlParams.contractId + '/contract-document-version',
|
|
1962
|
+
method: 'get',
|
|
1963
|
+
body: null,
|
|
1964
|
+
urlParams: config.urlParams,
|
|
1965
|
+
queryParams: config.queryParams,
|
|
1966
|
+
headers,
|
|
1967
|
+
priority: 'normal',
|
|
1968
|
+
};
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
const getContractDocumentVersion_ConfigPropertyNames = {
|
|
1972
|
+
displayName: 'getContractDocumentVersion',
|
|
1973
|
+
parameters: {
|
|
1974
|
+
required: ['contractId'],
|
|
1975
|
+
optional: ['contractDocumentVersionId']
|
|
1976
|
+
}
|
|
1977
|
+
};
|
|
1978
|
+
function createResourceParams$6(config) {
|
|
1979
|
+
const resourceParams = {
|
|
1980
|
+
urlParams: {
|
|
1981
|
+
contractId: config.contractId
|
|
1982
|
+
},
|
|
1983
|
+
queryParams: {
|
|
1984
|
+
contractDocumentVersionId: config.contractDocumentVersionId
|
|
1985
|
+
}
|
|
1986
|
+
};
|
|
1987
|
+
return resourceParams;
|
|
1988
|
+
}
|
|
1989
|
+
function keyBuilder$5(luvio, config) {
|
|
1990
|
+
const resourceParams = createResourceParams$6(config);
|
|
1991
|
+
return keyBuilder$6(luvio, resourceParams);
|
|
1992
|
+
}
|
|
1993
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
1994
|
+
const config = {};
|
|
1995
|
+
const untrustedConfig_contractId = untrustedConfig.contractId;
|
|
1996
|
+
if (typeof untrustedConfig_contractId === 'string') {
|
|
1997
|
+
config.contractId = untrustedConfig_contractId;
|
|
1998
|
+
}
|
|
1999
|
+
const untrustedConfig_contractDocumentVersionId = untrustedConfig.contractDocumentVersionId;
|
|
2000
|
+
if (typeof untrustedConfig_contractDocumentVersionId === 'string') {
|
|
2001
|
+
config.contractDocumentVersionId = untrustedConfig_contractDocumentVersionId;
|
|
2002
|
+
}
|
|
2003
|
+
return config;
|
|
2004
|
+
}
|
|
2005
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
2006
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2007
|
+
return null;
|
|
2008
|
+
}
|
|
2009
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2010
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2011
|
+
}
|
|
2012
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
2013
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2014
|
+
return null;
|
|
2015
|
+
}
|
|
2016
|
+
return config;
|
|
2017
|
+
}
|
|
2018
|
+
function adapterFragment$2(luvio, config) {
|
|
2019
|
+
createResourceParams$6(config);
|
|
2020
|
+
return select$9();
|
|
2021
|
+
}
|
|
2022
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
2023
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
|
|
2024
|
+
config,
|
|
2025
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
2026
|
+
});
|
|
2027
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2028
|
+
}
|
|
2029
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
2030
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
2031
|
+
config,
|
|
2032
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
2033
|
+
});
|
|
2034
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2035
|
+
}
|
|
2036
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
2037
|
+
const resourceParams = createResourceParams$6(config);
|
|
2038
|
+
const request = createResourceRequest$6(resourceParams);
|
|
2039
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2040
|
+
.then((response) => {
|
|
2041
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => getResponseCacheKeys$6(luvio, resourceParams, response.body));
|
|
2042
|
+
}, (response) => {
|
|
2043
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
2044
|
+
});
|
|
2045
|
+
}
|
|
2046
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
2047
|
+
const { luvio, config } = context;
|
|
2048
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
2049
|
+
const dispatchOptions = {
|
|
2050
|
+
resourceRequestContext: {
|
|
2051
|
+
requestCorrelator,
|
|
2052
|
+
luvioRequestMethod: undefined,
|
|
2053
|
+
},
|
|
2054
|
+
eventObservers
|
|
2055
|
+
};
|
|
2056
|
+
if (networkPriority !== 'normal') {
|
|
2057
|
+
dispatchOptions.overrides = {
|
|
2058
|
+
priority: networkPriority
|
|
2059
|
+
};
|
|
2060
|
+
}
|
|
2061
|
+
return buildNetworkSnapshot$6(luvio, config, dispatchOptions);
|
|
2062
|
+
}
|
|
2063
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
2064
|
+
const { luvio, config } = context;
|
|
2065
|
+
const selector = {
|
|
2066
|
+
recordId: keyBuilder$5(luvio, config),
|
|
2067
|
+
node: adapterFragment$2(luvio, config),
|
|
2068
|
+
variables: {},
|
|
2069
|
+
};
|
|
2070
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2071
|
+
config,
|
|
2072
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
2073
|
+
});
|
|
2074
|
+
return cacheSnapshot;
|
|
2075
|
+
}
|
|
2076
|
+
const getContractDocumentVersionAdapterFactory = (luvio) => function clm__getContractDocumentVersion(untrustedConfig, requestContext) {
|
|
2077
|
+
const config = validateAdapterConfig$6(untrustedConfig, getContractDocumentVersion_ConfigPropertyNames);
|
|
2078
|
+
// Invalid or incomplete config
|
|
2079
|
+
if (config === null) {
|
|
2080
|
+
return null;
|
|
2081
|
+
}
|
|
2082
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2083
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
2084
|
+
};
|
|
2085
|
+
|
|
2086
|
+
const VERSION$2 = "108316884026f0999c72cbecfb179629";
|
|
2087
|
+
function validate$4(obj, path = 'DocumentGenerationProcessStatusRepresentation') {
|
|
2088
|
+
const v_error = (() => {
|
|
2089
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2090
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2091
|
+
}
|
|
2092
|
+
if (obj.contentDocuments !== undefined) {
|
|
2093
|
+
const obj_contentDocuments = obj.contentDocuments;
|
|
2094
|
+
const path_contentDocuments = path + '.contentDocuments';
|
|
2095
|
+
if (!ArrayIsArray(obj_contentDocuments)) {
|
|
2096
|
+
return new TypeError('Expected "array" but received "' + typeof obj_contentDocuments + '" (at "' + path_contentDocuments + '")');
|
|
2097
|
+
}
|
|
2098
|
+
for (let i = 0; i < obj_contentDocuments.length; i++) {
|
|
2099
|
+
const obj_contentDocuments_item = obj_contentDocuments[i];
|
|
2100
|
+
const path_contentDocuments_item = path_contentDocuments + '[' + i + ']';
|
|
2101
|
+
const referencepath_contentDocuments_itemValidationError = validate$c(obj_contentDocuments_item, path_contentDocuments_item);
|
|
2102
|
+
if (referencepath_contentDocuments_itemValidationError !== null) {
|
|
2103
|
+
let message = 'Object doesn\'t match ContentDocumentRepresentation (at "' + path_contentDocuments_item + '")\n';
|
|
2104
|
+
message += referencepath_contentDocuments_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2105
|
+
return new TypeError(message);
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
const obj_contractDocumentVersionId = obj.contractDocumentVersionId;
|
|
2110
|
+
const path_contractDocumentVersionId = path + '.contractDocumentVersionId';
|
|
2111
|
+
if (typeof obj_contractDocumentVersionId !== 'string') {
|
|
2112
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contractDocumentVersionId + '" (at "' + path_contractDocumentVersionId + '")');
|
|
2113
|
+
}
|
|
2114
|
+
if (obj.documentGenerationProcessId !== undefined) {
|
|
2115
|
+
const obj_documentGenerationProcessId = obj.documentGenerationProcessId;
|
|
2116
|
+
const path_documentGenerationProcessId = path + '.documentGenerationProcessId';
|
|
2117
|
+
if (typeof obj_documentGenerationProcessId !== 'string') {
|
|
2118
|
+
return new TypeError('Expected "string" but received "' + typeof obj_documentGenerationProcessId + '" (at "' + path_documentGenerationProcessId + '")');
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
if (obj.documentUrl !== undefined) {
|
|
2122
|
+
const obj_documentUrl = obj.documentUrl;
|
|
2123
|
+
const path_documentUrl = path + '.documentUrl';
|
|
2124
|
+
if (typeof obj_documentUrl !== 'string') {
|
|
2125
|
+
return new TypeError('Expected "string" but received "' + typeof obj_documentUrl + '" (at "' + path_documentUrl + '")');
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
if (obj.name !== undefined) {
|
|
2129
|
+
const obj_name = obj.name;
|
|
2130
|
+
const path_name = path + '.name';
|
|
2131
|
+
if (typeof obj_name !== 'string') {
|
|
2132
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
if (obj.responseText !== undefined) {
|
|
2136
|
+
const obj_responseText = obj.responseText;
|
|
2137
|
+
const path_responseText = path + '.responseText';
|
|
2138
|
+
if (typeof obj_responseText !== 'string') {
|
|
2139
|
+
return new TypeError('Expected "string" but received "' + typeof obj_responseText + '" (at "' + path_responseText + '")');
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
if (obj.status !== undefined) {
|
|
2143
|
+
const obj_status = obj.status;
|
|
2144
|
+
const path_status = path + '.status';
|
|
2145
|
+
if (typeof obj_status !== 'string') {
|
|
2146
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
})();
|
|
2150
|
+
return v_error === undefined ? null : v_error;
|
|
2151
|
+
}
|
|
2152
|
+
const RepresentationType$2 = 'DocumentGenerationProcessStatusRepresentation';
|
|
2153
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
2154
|
+
return input;
|
|
2155
|
+
}
|
|
2156
|
+
const select$8 = function DocumentGenerationProcessStatusRepresentationSelect() {
|
|
2157
|
+
const { selections: ContentDocumentRepresentation__selections, opaque: ContentDocumentRepresentation__opaque, } = select$j();
|
|
2158
|
+
return {
|
|
2159
|
+
kind: 'Fragment',
|
|
2160
|
+
version: VERSION$2,
|
|
2161
|
+
private: [],
|
|
2162
|
+
selections: [
|
|
2163
|
+
{
|
|
2164
|
+
name: 'contentDocuments',
|
|
2165
|
+
kind: 'Object',
|
|
2166
|
+
plural: true,
|
|
2167
|
+
selections: ContentDocumentRepresentation__selections,
|
|
2168
|
+
required: false
|
|
2169
|
+
},
|
|
2170
|
+
{
|
|
2171
|
+
name: 'contractDocumentVersionId',
|
|
2172
|
+
kind: 'Scalar'
|
|
2173
|
+
},
|
|
2174
|
+
{
|
|
2175
|
+
name: 'documentGenerationProcessId',
|
|
2176
|
+
kind: 'Scalar',
|
|
2177
|
+
required: false
|
|
2178
|
+
},
|
|
2179
|
+
{
|
|
2180
|
+
name: 'documentUrl',
|
|
2181
|
+
kind: 'Scalar',
|
|
2182
|
+
required: false
|
|
2183
|
+
},
|
|
2184
|
+
{
|
|
2185
|
+
name: 'name',
|
|
2186
|
+
kind: 'Scalar',
|
|
2187
|
+
required: false
|
|
2188
|
+
},
|
|
2189
|
+
{
|
|
2190
|
+
name: 'responseText',
|
|
2191
|
+
kind: 'Scalar',
|
|
2192
|
+
required: false
|
|
2193
|
+
},
|
|
2194
|
+
{
|
|
2195
|
+
name: 'status',
|
|
2196
|
+
kind: 'Scalar',
|
|
2197
|
+
required: false
|
|
2198
|
+
}
|
|
2199
|
+
]
|
|
2200
|
+
};
|
|
2201
|
+
};
|
|
2202
|
+
function equals$2(existing, incoming) {
|
|
2203
|
+
const existing_contractDocumentVersionId = existing.contractDocumentVersionId;
|
|
2204
|
+
const incoming_contractDocumentVersionId = incoming.contractDocumentVersionId;
|
|
2205
|
+
if (!(existing_contractDocumentVersionId === incoming_contractDocumentVersionId)) {
|
|
2206
|
+
return false;
|
|
2207
|
+
}
|
|
2208
|
+
const existing_documentGenerationProcessId = existing.documentGenerationProcessId;
|
|
2209
|
+
const incoming_documentGenerationProcessId = incoming.documentGenerationProcessId;
|
|
2210
|
+
// if at least one of these optionals is defined
|
|
2211
|
+
if (existing_documentGenerationProcessId !== undefined || incoming_documentGenerationProcessId !== undefined) {
|
|
2212
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2213
|
+
// not equal
|
|
2214
|
+
if (existing_documentGenerationProcessId === undefined || incoming_documentGenerationProcessId === undefined) {
|
|
2215
|
+
return false;
|
|
2216
|
+
}
|
|
2217
|
+
if (!(existing_documentGenerationProcessId === incoming_documentGenerationProcessId)) {
|
|
2218
|
+
return false;
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
const existing_documentUrl = existing.documentUrl;
|
|
2222
|
+
const incoming_documentUrl = incoming.documentUrl;
|
|
2223
|
+
// if at least one of these optionals is defined
|
|
2224
|
+
if (existing_documentUrl !== undefined || incoming_documentUrl !== undefined) {
|
|
2225
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2226
|
+
// not equal
|
|
2227
|
+
if (existing_documentUrl === undefined || incoming_documentUrl === undefined) {
|
|
2228
|
+
return false;
|
|
2229
|
+
}
|
|
2230
|
+
if (!(existing_documentUrl === incoming_documentUrl)) {
|
|
2231
|
+
return false;
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
const existing_name = existing.name;
|
|
2235
|
+
const incoming_name = incoming.name;
|
|
2236
|
+
// if at least one of these optionals is defined
|
|
2237
|
+
if (existing_name !== undefined || incoming_name !== undefined) {
|
|
2238
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2239
|
+
// not equal
|
|
2240
|
+
if (existing_name === undefined || incoming_name === undefined) {
|
|
2241
|
+
return false;
|
|
2242
|
+
}
|
|
2243
|
+
if (!(existing_name === incoming_name)) {
|
|
2244
|
+
return false;
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
const existing_responseText = existing.responseText;
|
|
2248
|
+
const incoming_responseText = incoming.responseText;
|
|
2249
|
+
// if at least one of these optionals is defined
|
|
2250
|
+
if (existing_responseText !== undefined || incoming_responseText !== undefined) {
|
|
2251
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2252
|
+
// not equal
|
|
2253
|
+
if (existing_responseText === undefined || incoming_responseText === undefined) {
|
|
2254
|
+
return false;
|
|
2255
|
+
}
|
|
2256
|
+
if (!(existing_responseText === incoming_responseText)) {
|
|
2257
|
+
return false;
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
const existing_status = existing.status;
|
|
2261
|
+
const incoming_status = incoming.status;
|
|
2262
|
+
// if at least one of these optionals is defined
|
|
2263
|
+
if (existing_status !== undefined || incoming_status !== undefined) {
|
|
2264
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2265
|
+
// not equal
|
|
2266
|
+
if (existing_status === undefined || incoming_status === undefined) {
|
|
2267
|
+
return false;
|
|
2268
|
+
}
|
|
2269
|
+
if (!(existing_status === incoming_status)) {
|
|
2270
|
+
return false;
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
const existing_contentDocuments = existing.contentDocuments;
|
|
2274
|
+
const incoming_contentDocuments = incoming.contentDocuments;
|
|
2275
|
+
// if at least one of these optionals is defined
|
|
2276
|
+
if (existing_contentDocuments !== undefined || incoming_contentDocuments !== undefined) {
|
|
2277
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2278
|
+
// not equal
|
|
2279
|
+
if (existing_contentDocuments === undefined || incoming_contentDocuments === undefined) {
|
|
2280
|
+
return false;
|
|
2281
|
+
}
|
|
2282
|
+
const equals_contentDocuments_items = equalsArray(existing_contentDocuments, incoming_contentDocuments, (existing_contentDocuments_item, incoming_contentDocuments_item) => {
|
|
2283
|
+
if (!(equals$7(existing_contentDocuments_item, incoming_contentDocuments_item))) {
|
|
2284
|
+
return false;
|
|
2285
|
+
}
|
|
2286
|
+
});
|
|
2287
|
+
if (equals_contentDocuments_items === false) {
|
|
2288
|
+
return false;
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
return true;
|
|
2292
|
+
}
|
|
2293
|
+
const ingest$2 = function DocumentGenerationProcessStatusRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2294
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2295
|
+
const validateError = validate$4(input);
|
|
2296
|
+
if (validateError !== null) {
|
|
2297
|
+
throw validateError;
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
const key = path.fullPath;
|
|
2301
|
+
const existingRecord = store.readEntry(key);
|
|
2302
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
|
|
2303
|
+
let incomingRecord = normalize$2(input, store.readEntry(key), {
|
|
2304
|
+
fullPath: key,
|
|
2305
|
+
parent: path.parent,
|
|
2306
|
+
propertyName: path.propertyName,
|
|
2307
|
+
ttl: ttlToUse
|
|
2308
|
+
});
|
|
2309
|
+
if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
|
|
2310
|
+
luvio.storePublish(key, incomingRecord);
|
|
2311
|
+
}
|
|
2312
|
+
if (ttlToUse !== undefined) {
|
|
2313
|
+
const storeMetadataParams = {
|
|
2314
|
+
ttl: ttlToUse,
|
|
2315
|
+
namespace: "clm",
|
|
2316
|
+
version: VERSION$2,
|
|
2317
|
+
representationName: RepresentationType$2,
|
|
2318
|
+
};
|
|
2319
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
2320
|
+
}
|
|
2321
|
+
return createLink(key);
|
|
2322
|
+
};
|
|
2323
|
+
function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
|
|
2324
|
+
const rootKeySet = new StoreKeyMap();
|
|
2325
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2326
|
+
const rootKey = fullPathFactory();
|
|
2327
|
+
rootKeySet.set(rootKey, {
|
|
2328
|
+
namespace: keyPrefix,
|
|
2329
|
+
representationName: RepresentationType$2,
|
|
2330
|
+
mergeable: false
|
|
2331
|
+
});
|
|
2332
|
+
return rootKeySet;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
function select$7(luvio, params) {
|
|
2336
|
+
return select$8();
|
|
2337
|
+
}
|
|
2338
|
+
function keyBuilder$4(luvio, params) {
|
|
2339
|
+
return keyPrefix + '::DocumentGenerationProcessStatusRepresentation:(' + 'contractDocumentVersionId:' + params.queryParams.contractDocumentVersionId + ')';
|
|
2340
|
+
}
|
|
2341
|
+
function getResponseCacheKeys$5(luvio, resourceParams, response) {
|
|
2342
|
+
return getTypeCacheKeys$2(luvio, response, () => keyBuilder$4(luvio, resourceParams));
|
|
2343
|
+
}
|
|
2344
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
2345
|
+
const { body } = response;
|
|
2346
|
+
const key = keyBuilder$4(luvio, resourceParams);
|
|
2347
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
2348
|
+
const snapshot = luvio.storeLookup({
|
|
2349
|
+
recordId: key,
|
|
2350
|
+
node: select$7(),
|
|
2351
|
+
variables: {},
|
|
2352
|
+
}, snapshotRefresh);
|
|
2353
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2354
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2355
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
return snapshot;
|
|
2359
|
+
}
|
|
2360
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
2361
|
+
const key = keyBuilder$4(luvio, params);
|
|
2362
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2363
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
2364
|
+
return errorSnapshot;
|
|
2365
|
+
}
|
|
2366
|
+
function createResourceRequest$5(config) {
|
|
2367
|
+
const headers = {};
|
|
2368
|
+
return {
|
|
2369
|
+
baseUri: '/services/data/v58.0',
|
|
2370
|
+
basePath: '/connect/clm/document-generation-process/status',
|
|
2371
|
+
method: 'get',
|
|
2372
|
+
body: null,
|
|
2373
|
+
urlParams: {},
|
|
2374
|
+
queryParams: config.queryParams,
|
|
2375
|
+
headers,
|
|
2376
|
+
priority: 'normal',
|
|
2377
|
+
};
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
const getDocumentGenerationProcessDetails_ConfigPropertyNames = {
|
|
2381
|
+
displayName: 'getDocumentGenerationProcessDetails',
|
|
2382
|
+
parameters: {
|
|
2383
|
+
required: [],
|
|
2384
|
+
optional: ['contractDocumentVersionId']
|
|
2385
|
+
}
|
|
2386
|
+
};
|
|
2387
|
+
function createResourceParams$5(config) {
|
|
2388
|
+
const resourceParams = {
|
|
2389
|
+
queryParams: {
|
|
2390
|
+
contractDocumentVersionId: config.contractDocumentVersionId
|
|
2391
|
+
}
|
|
2392
|
+
};
|
|
2393
|
+
return resourceParams;
|
|
2394
|
+
}
|
|
2395
|
+
function keyBuilder$3(luvio, config) {
|
|
2396
|
+
const resourceParams = createResourceParams$5(config);
|
|
2397
|
+
return keyBuilder$4(luvio, resourceParams);
|
|
2398
|
+
}
|
|
2399
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
2400
|
+
const config = {};
|
|
2401
|
+
const untrustedConfig_contractDocumentVersionId = untrustedConfig.contractDocumentVersionId;
|
|
2402
|
+
if (typeof untrustedConfig_contractDocumentVersionId === 'string') {
|
|
2403
|
+
config.contractDocumentVersionId = untrustedConfig_contractDocumentVersionId;
|
|
2404
|
+
}
|
|
2405
|
+
return config;
|
|
2406
|
+
}
|
|
2407
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
2408
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2409
|
+
return null;
|
|
2410
|
+
}
|
|
2411
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2412
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2413
|
+
}
|
|
2414
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
2415
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2416
|
+
return null;
|
|
2417
|
+
}
|
|
2418
|
+
return config;
|
|
2419
|
+
}
|
|
2420
|
+
function adapterFragment$1(luvio, config) {
|
|
2421
|
+
createResourceParams$5(config);
|
|
2422
|
+
return select$7();
|
|
2423
|
+
}
|
|
2424
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
2425
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
2426
|
+
config,
|
|
2427
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
2428
|
+
});
|
|
2429
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2430
|
+
}
|
|
2431
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
2432
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
2433
|
+
config,
|
|
2434
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
2435
|
+
});
|
|
2436
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2437
|
+
}
|
|
2438
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
2439
|
+
const resourceParams = createResourceParams$5(config);
|
|
2440
|
+
const request = createResourceRequest$5(resourceParams);
|
|
2441
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2442
|
+
.then((response) => {
|
|
2443
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$5(luvio, resourceParams, response.body));
|
|
2444
|
+
}, (response) => {
|
|
2445
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
2446
|
+
});
|
|
2447
|
+
}
|
|
2448
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
2449
|
+
const { luvio, config } = context;
|
|
2450
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
2451
|
+
const dispatchOptions = {
|
|
2452
|
+
resourceRequestContext: {
|
|
2453
|
+
requestCorrelator,
|
|
2454
|
+
luvioRequestMethod: undefined,
|
|
2455
|
+
},
|
|
2456
|
+
eventObservers
|
|
2457
|
+
};
|
|
2458
|
+
if (networkPriority !== 'normal') {
|
|
2459
|
+
dispatchOptions.overrides = {
|
|
2460
|
+
priority: networkPriority
|
|
2461
|
+
};
|
|
2462
|
+
}
|
|
2463
|
+
return buildNetworkSnapshot$5(luvio, config, dispatchOptions);
|
|
2464
|
+
}
|
|
2465
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
2466
|
+
const { luvio, config } = context;
|
|
2467
|
+
const selector = {
|
|
2468
|
+
recordId: keyBuilder$3(luvio, config),
|
|
2469
|
+
node: adapterFragment$1(luvio, config),
|
|
2470
|
+
variables: {},
|
|
2471
|
+
};
|
|
2472
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2473
|
+
config,
|
|
2474
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
2475
|
+
});
|
|
2476
|
+
return cacheSnapshot;
|
|
2477
|
+
}
|
|
2478
|
+
const getDocumentGenerationProcessDetailsAdapterFactory = (luvio) => function clm__getDocumentGenerationProcessDetails(untrustedConfig, requestContext) {
|
|
2479
|
+
const config = validateAdapterConfig$5(untrustedConfig, getDocumentGenerationProcessDetails_ConfigPropertyNames);
|
|
2480
|
+
// Invalid or incomplete config
|
|
2481
|
+
if (config === null) {
|
|
2482
|
+
return null;
|
|
2483
|
+
}
|
|
2484
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2485
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
2486
|
+
};
|
|
2487
|
+
|
|
2488
|
+
function validate$3(obj, path = 'TemplateRepresentation') {
|
|
2489
|
+
const v_error = (() => {
|
|
2490
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2491
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2492
|
+
}
|
|
2493
|
+
const obj_id = obj.id;
|
|
2494
|
+
const path_id = path + '.id';
|
|
2495
|
+
if (typeof obj_id !== 'string') {
|
|
2496
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
2497
|
+
}
|
|
2498
|
+
const obj_isActive = obj.isActive;
|
|
2499
|
+
const path_isActive = path + '.isActive';
|
|
2500
|
+
if (typeof obj_isActive !== 'boolean') {
|
|
2501
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isActive + '" (at "' + path_isActive + '")');
|
|
2502
|
+
}
|
|
2503
|
+
const obj_name = obj.name;
|
|
2504
|
+
const path_name = path + '.name';
|
|
2505
|
+
if (typeof obj_name !== 'string') {
|
|
2506
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2507
|
+
}
|
|
2508
|
+
const obj_type = obj.type;
|
|
2509
|
+
const path_type = path + '.type';
|
|
2510
|
+
if (typeof obj_type !== 'string') {
|
|
2511
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
2512
|
+
}
|
|
2513
|
+
const obj_version = obj.version;
|
|
2514
|
+
const path_version = path + '.version';
|
|
2515
|
+
if (typeof obj_version !== 'number' || (typeof obj_version === 'number' && Math.floor(obj_version) !== obj_version)) {
|
|
2516
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_version + '" (at "' + path_version + '")');
|
|
2517
|
+
}
|
|
2518
|
+
})();
|
|
2519
|
+
return v_error === undefined ? null : v_error;
|
|
2520
|
+
}
|
|
2521
|
+
function deepFreeze$2(input) {
|
|
2522
|
+
ObjectFreeze(input);
|
|
2523
|
+
}
|
|
2524
|
+
|
|
2525
|
+
const TTL$1 = 60000;
|
|
2526
|
+
const VERSION$1 = "f3cbbe481890c87cbcb6b12993f6383c";
|
|
2527
|
+
function validate$2(obj, path = 'TemplateListRepresentation') {
|
|
2528
|
+
const v_error = (() => {
|
|
2529
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2530
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2531
|
+
}
|
|
2532
|
+
if (obj.code !== undefined) {
|
|
2533
|
+
const obj_code = obj.code;
|
|
2534
|
+
const path_code = path + '.code';
|
|
2535
|
+
if (typeof obj_code !== 'string') {
|
|
2536
|
+
return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
|
|
2537
|
+
}
|
|
2538
|
+
}
|
|
2539
|
+
const obj_data = obj.data;
|
|
2540
|
+
const path_data = path + '.data';
|
|
2541
|
+
if (!ArrayIsArray(obj_data)) {
|
|
2542
|
+
return new TypeError('Expected "array" but received "' + typeof obj_data + '" (at "' + path_data + '")');
|
|
2543
|
+
}
|
|
2544
|
+
for (let i = 0; i < obj_data.length; i++) {
|
|
2545
|
+
const obj_data_item = obj_data[i];
|
|
2546
|
+
const path_data_item = path_data + '[' + i + ']';
|
|
2547
|
+
const referencepath_data_itemValidationError = validate$3(obj_data_item, path_data_item);
|
|
2548
|
+
if (referencepath_data_itemValidationError !== null) {
|
|
2549
|
+
let message = 'Object doesn\'t match TemplateRepresentation (at "' + path_data_item + '")\n';
|
|
2550
|
+
message += referencepath_data_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2551
|
+
return new TypeError(message);
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
if (obj.message !== undefined) {
|
|
2555
|
+
const obj_message = obj.message;
|
|
2556
|
+
const path_message = path + '.message';
|
|
2557
|
+
if (typeof obj_message !== 'string') {
|
|
2558
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
})();
|
|
2562
|
+
return v_error === undefined ? null : v_error;
|
|
2563
|
+
}
|
|
2564
|
+
const RepresentationType$1 = 'TemplateListRepresentation';
|
|
2565
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
2566
|
+
return input;
|
|
2567
|
+
}
|
|
2568
|
+
const select$6 = function TemplateListRepresentationSelect() {
|
|
2569
|
+
return {
|
|
2570
|
+
kind: 'Fragment',
|
|
2571
|
+
version: VERSION$1,
|
|
2572
|
+
private: [],
|
|
2573
|
+
opaque: true
|
|
2574
|
+
};
|
|
2575
|
+
};
|
|
2576
|
+
function equals$1(existing, incoming) {
|
|
2577
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
2578
|
+
return false;
|
|
2579
|
+
}
|
|
2580
|
+
return true;
|
|
2581
|
+
}
|
|
2582
|
+
function deepFreeze$1(input) {
|
|
2583
|
+
const input_data = input.data;
|
|
2584
|
+
for (let i = 0; i < input_data.length; i++) {
|
|
2585
|
+
const input_data_item = input_data[i];
|
|
2586
|
+
deepFreeze$2(input_data_item);
|
|
2587
|
+
}
|
|
2588
|
+
ObjectFreeze(input_data);
|
|
2589
|
+
ObjectFreeze(input);
|
|
2590
|
+
}
|
|
2591
|
+
const ingest$1 = function TemplateListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2592
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2593
|
+
const validateError = validate$2(input);
|
|
2594
|
+
if (validateError !== null) {
|
|
2595
|
+
throw validateError;
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
const key = path.fullPath;
|
|
2599
|
+
const existingRecord = store.readEntry(key);
|
|
2600
|
+
const ttlToUse = TTL$1;
|
|
2601
|
+
let incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
2602
|
+
fullPath: key,
|
|
2603
|
+
parent: path.parent,
|
|
2604
|
+
propertyName: path.propertyName,
|
|
2605
|
+
ttl: ttlToUse
|
|
2606
|
+
});
|
|
2607
|
+
deepFreeze$1(input);
|
|
2608
|
+
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
2609
|
+
luvio.storePublish(key, incomingRecord);
|
|
2610
|
+
}
|
|
2611
|
+
{
|
|
2612
|
+
const storeMetadataParams = {
|
|
2613
|
+
ttl: ttlToUse,
|
|
2614
|
+
namespace: "clm",
|
|
2615
|
+
version: VERSION$1,
|
|
2616
|
+
representationName: RepresentationType$1,
|
|
2617
|
+
};
|
|
2618
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
2619
|
+
}
|
|
2620
|
+
return createLink(key);
|
|
2621
|
+
};
|
|
2622
|
+
function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
|
|
2623
|
+
const rootKeySet = new StoreKeyMap();
|
|
2624
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2625
|
+
const rootKey = fullPathFactory();
|
|
2626
|
+
rootKeySet.set(rootKey, {
|
|
2627
|
+
namespace: keyPrefix,
|
|
2628
|
+
representationName: RepresentationType$1,
|
|
2629
|
+
mergeable: false
|
|
2630
|
+
});
|
|
2631
|
+
return rootKeySet;
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
function select$5(luvio, params) {
|
|
2635
|
+
return select$6();
|
|
2636
|
+
}
|
|
2637
|
+
function keyBuilder$2(luvio, params) {
|
|
2638
|
+
return keyPrefix + '::TemplateListRepresentation:(' + 'isActive:' + params.queryParams.isActive + ',' + 'type:' + params.queryParams.type + ',' + 'usageType:' + params.queryParams.usageType + ',' + 'contractId:' + params.queryParams.contractId + ',' + 'documentTemplateTypes:' + params.queryParams.documentTemplateTypes + ')';
|
|
2639
|
+
}
|
|
2640
|
+
function getResponseCacheKeys$4(luvio, resourceParams, response) {
|
|
2641
|
+
return getTypeCacheKeys$1(luvio, response, () => keyBuilder$2(luvio, resourceParams));
|
|
2642
|
+
}
|
|
2643
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
2644
|
+
const { body } = response;
|
|
2645
|
+
const key = keyBuilder$2(luvio, resourceParams);
|
|
2646
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
2647
|
+
const snapshot = luvio.storeLookup({
|
|
2648
|
+
recordId: key,
|
|
2649
|
+
node: select$5(),
|
|
2650
|
+
variables: {},
|
|
2651
|
+
}, snapshotRefresh);
|
|
2652
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2653
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2654
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
return snapshot;
|
|
2658
|
+
}
|
|
2659
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
2660
|
+
const key = keyBuilder$2(luvio, params);
|
|
2661
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2662
|
+
const storeMetadataParams = {
|
|
2663
|
+
ttl: TTL$1,
|
|
2664
|
+
namespace: keyPrefix,
|
|
2665
|
+
version: VERSION$1,
|
|
2666
|
+
representationName: RepresentationType$1
|
|
2667
|
+
};
|
|
2668
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2669
|
+
return errorSnapshot;
|
|
2670
|
+
}
|
|
2671
|
+
function createResourceRequest$4(config) {
|
|
2672
|
+
const headers = {};
|
|
2673
|
+
return {
|
|
2674
|
+
baseUri: '/services/data/v58.0',
|
|
2675
|
+
basePath: '/connect/clm/document-template',
|
|
2676
|
+
method: 'get',
|
|
2677
|
+
body: null,
|
|
2678
|
+
urlParams: {},
|
|
2679
|
+
queryParams: config.queryParams,
|
|
2680
|
+
headers,
|
|
2681
|
+
priority: 'normal',
|
|
2682
|
+
};
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
const getTemplates_ConfigPropertyNames = {
|
|
2686
|
+
displayName: 'getTemplates',
|
|
2687
|
+
parameters: {
|
|
2688
|
+
required: [],
|
|
2689
|
+
optional: ['isActive', 'type', 'usageType', 'contractId', 'documentTemplateTypes']
|
|
2690
|
+
}
|
|
2691
|
+
};
|
|
2692
|
+
function createResourceParams$4(config) {
|
|
2693
|
+
const resourceParams = {
|
|
2694
|
+
queryParams: {
|
|
2695
|
+
isActive: config.isActive, type: config.type, usageType: config.usageType, contractId: config.contractId, documentTemplateTypes: config.documentTemplateTypes
|
|
2696
|
+
}
|
|
2697
|
+
};
|
|
2698
|
+
return resourceParams;
|
|
2699
|
+
}
|
|
2700
|
+
function keyBuilder$1(luvio, config) {
|
|
2701
|
+
const resourceParams = createResourceParams$4(config);
|
|
2702
|
+
return keyBuilder$2(luvio, resourceParams);
|
|
2703
|
+
}
|
|
2704
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
2705
|
+
const config = {};
|
|
2706
|
+
const untrustedConfig_isActive = untrustedConfig.isActive;
|
|
2707
|
+
if (typeof untrustedConfig_isActive === 'boolean') {
|
|
2708
|
+
config.isActive = untrustedConfig_isActive;
|
|
2709
|
+
}
|
|
2710
|
+
const untrustedConfig_type = untrustedConfig.type;
|
|
2711
|
+
if (typeof untrustedConfig_type === 'string') {
|
|
2712
|
+
config.type = untrustedConfig_type;
|
|
2713
|
+
}
|
|
2714
|
+
const untrustedConfig_usageType = untrustedConfig.usageType;
|
|
2715
|
+
if (typeof untrustedConfig_usageType === 'string') {
|
|
2716
|
+
config.usageType = untrustedConfig_usageType;
|
|
2717
|
+
}
|
|
2718
|
+
const untrustedConfig_contractId = untrustedConfig.contractId;
|
|
2719
|
+
if (typeof untrustedConfig_contractId === 'string') {
|
|
2720
|
+
config.contractId = untrustedConfig_contractId;
|
|
2721
|
+
}
|
|
2722
|
+
const untrustedConfig_documentTemplateTypes = untrustedConfig.documentTemplateTypes;
|
|
2723
|
+
if (ArrayIsArray$1(untrustedConfig_documentTemplateTypes)) {
|
|
2724
|
+
const untrustedConfig_documentTemplateTypes_array = [];
|
|
2725
|
+
for (let i = 0, arrayLength = untrustedConfig_documentTemplateTypes.length; i < arrayLength; i++) {
|
|
2726
|
+
const untrustedConfig_documentTemplateTypes_item = untrustedConfig_documentTemplateTypes[i];
|
|
2727
|
+
if (typeof untrustedConfig_documentTemplateTypes_item === 'string') {
|
|
2728
|
+
untrustedConfig_documentTemplateTypes_array.push(untrustedConfig_documentTemplateTypes_item);
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2731
|
+
config.documentTemplateTypes = untrustedConfig_documentTemplateTypes_array;
|
|
2732
|
+
}
|
|
2733
|
+
return config;
|
|
2734
|
+
}
|
|
2735
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
2736
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2737
|
+
return null;
|
|
2738
|
+
}
|
|
2739
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2740
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2741
|
+
}
|
|
2742
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
2743
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2744
|
+
return null;
|
|
2745
|
+
}
|
|
2746
|
+
return config;
|
|
2747
|
+
}
|
|
2748
|
+
function adapterFragment(luvio, config) {
|
|
2749
|
+
createResourceParams$4(config);
|
|
2750
|
+
return select$5();
|
|
2751
|
+
}
|
|
2752
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
2753
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
2754
|
+
config,
|
|
2755
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
2756
|
+
});
|
|
2757
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2758
|
+
}
|
|
2759
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
2760
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
2761
|
+
config,
|
|
2762
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
2763
|
+
});
|
|
2764
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2765
|
+
}
|
|
2766
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
2767
|
+
const resourceParams = createResourceParams$4(config);
|
|
2768
|
+
const request = createResourceRequest$4(resourceParams);
|
|
2769
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2770
|
+
.then((response) => {
|
|
2771
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$4(luvio, resourceParams, response.body));
|
|
2772
|
+
}, (response) => {
|
|
2773
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
2774
|
+
});
|
|
2775
|
+
}
|
|
2776
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
2777
|
+
const { luvio, config } = context;
|
|
2778
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
2779
|
+
const dispatchOptions = {
|
|
2780
|
+
resourceRequestContext: {
|
|
2781
|
+
requestCorrelator,
|
|
2782
|
+
luvioRequestMethod: undefined,
|
|
2783
|
+
},
|
|
2784
|
+
eventObservers
|
|
2785
|
+
};
|
|
2786
|
+
if (networkPriority !== 'normal') {
|
|
2787
|
+
dispatchOptions.overrides = {
|
|
2788
|
+
priority: networkPriority
|
|
2789
|
+
};
|
|
2790
|
+
}
|
|
2791
|
+
return buildNetworkSnapshot$4(luvio, config, dispatchOptions);
|
|
2792
|
+
}
|
|
2793
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
2794
|
+
const { luvio, config } = context;
|
|
2795
|
+
const selector = {
|
|
2796
|
+
recordId: keyBuilder$1(luvio, config),
|
|
2797
|
+
node: adapterFragment(luvio, config),
|
|
2798
|
+
variables: {},
|
|
2799
|
+
};
|
|
2800
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2801
|
+
config,
|
|
2802
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
2803
|
+
});
|
|
2804
|
+
return cacheSnapshot;
|
|
2805
|
+
}
|
|
2806
|
+
const getTemplatesAdapterFactory = (luvio) => function clm__getTemplates(untrustedConfig, requestContext) {
|
|
2807
|
+
const config = validateAdapterConfig$4(untrustedConfig, getTemplates_ConfigPropertyNames);
|
|
2808
|
+
// Invalid or incomplete config
|
|
2809
|
+
if (config === null) {
|
|
2810
|
+
return null;
|
|
2811
|
+
}
|
|
2812
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2813
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
2814
|
+
};
|
|
2815
|
+
|
|
2816
|
+
function select$4(luvio, params) {
|
|
2817
|
+
return select$l();
|
|
2818
|
+
}
|
|
2819
|
+
function getResponseCacheKeys$3(luvio, resourceParams, response) {
|
|
2820
|
+
return getTypeCacheKeys$7(luvio, response);
|
|
2821
|
+
}
|
|
2822
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
2823
|
+
const { body } = response;
|
|
2824
|
+
const key = keyBuilderFromType$4(luvio, body);
|
|
2825
|
+
luvio.storeIngest(key, ingest$7, body);
|
|
2826
|
+
const snapshot = luvio.storeLookup({
|
|
2827
|
+
recordId: key,
|
|
2828
|
+
node: select$4(),
|
|
2829
|
+
variables: {},
|
|
2830
|
+
});
|
|
2831
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2832
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2833
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2834
|
+
}
|
|
2835
|
+
}
|
|
2836
|
+
return snapshot;
|
|
2837
|
+
}
|
|
2838
|
+
function createResourceRequest$3(config) {
|
|
2839
|
+
const headers = {};
|
|
2840
|
+
return {
|
|
2841
|
+
baseUri: '/services/data/v58.0',
|
|
2842
|
+
basePath: '/connect/clm/contract-document-version/' + config.urlParams.contractDocumentVersionId + '/lock',
|
|
2843
|
+
method: 'patch',
|
|
2844
|
+
body: null,
|
|
2845
|
+
urlParams: config.urlParams,
|
|
2846
|
+
queryParams: {},
|
|
2847
|
+
headers,
|
|
2848
|
+
priority: 'normal',
|
|
2849
|
+
};
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2852
|
+
const lockContractDocumentVersion_ConfigPropertyNames = {
|
|
2853
|
+
displayName: 'lockContractDocumentVersion',
|
|
2854
|
+
parameters: {
|
|
2855
|
+
required: ['contractDocumentVersionId'],
|
|
2856
|
+
optional: []
|
|
2857
|
+
}
|
|
2858
|
+
};
|
|
2859
|
+
function createResourceParams$3(config) {
|
|
2860
|
+
const resourceParams = {
|
|
2861
|
+
urlParams: {
|
|
2862
|
+
contractDocumentVersionId: config.contractDocumentVersionId
|
|
2863
|
+
}
|
|
2864
|
+
};
|
|
2865
|
+
return resourceParams;
|
|
2866
|
+
}
|
|
2867
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
2868
|
+
const config = {};
|
|
2869
|
+
const untrustedConfig_contractDocumentVersionId = untrustedConfig.contractDocumentVersionId;
|
|
2870
|
+
if (typeof untrustedConfig_contractDocumentVersionId === 'string') {
|
|
2871
|
+
config.contractDocumentVersionId = untrustedConfig_contractDocumentVersionId;
|
|
2872
|
+
}
|
|
2873
|
+
return config;
|
|
2874
|
+
}
|
|
2875
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
2876
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2877
|
+
return null;
|
|
2878
|
+
}
|
|
2879
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2880
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2881
|
+
}
|
|
2882
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
2883
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2884
|
+
return null;
|
|
2885
|
+
}
|
|
2886
|
+
return config;
|
|
2887
|
+
}
|
|
2888
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
2889
|
+
const resourceParams = createResourceParams$3(config);
|
|
2890
|
+
const request = createResourceRequest$3(resourceParams);
|
|
2891
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2892
|
+
.then((response) => {
|
|
2893
|
+
return luvio.handleSuccessResponse(() => {
|
|
2894
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
2895
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2896
|
+
}, () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
|
|
2897
|
+
}, (response) => {
|
|
2898
|
+
deepFreeze$b(response);
|
|
2899
|
+
throw response;
|
|
2900
|
+
});
|
|
2901
|
+
}
|
|
2902
|
+
const lockContractDocumentVersionAdapterFactory = (luvio) => {
|
|
2903
|
+
return function lockContractDocumentVersion(untrustedConfig) {
|
|
2904
|
+
const config = validateAdapterConfig$3(untrustedConfig, lockContractDocumentVersion_ConfigPropertyNames);
|
|
2905
|
+
// Invalid or incomplete config
|
|
2906
|
+
if (config === null) {
|
|
2907
|
+
throw new Error('Invalid config for "lockContractDocumentVersion"');
|
|
2908
|
+
}
|
|
2909
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
2910
|
+
};
|
|
2911
|
+
};
|
|
2912
|
+
|
|
2913
|
+
function validate$1(obj, path = 'SaveExternalDocumentInputRepresentation') {
|
|
2914
|
+
const v_error = (() => {
|
|
2915
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2916
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2917
|
+
}
|
|
2918
|
+
const obj_extDocumentId = obj.extDocumentId;
|
|
2919
|
+
const path_extDocumentId = path + '.extDocumentId';
|
|
2920
|
+
if (typeof obj_extDocumentId !== 'string') {
|
|
2921
|
+
return new TypeError('Expected "string" but received "' + typeof obj_extDocumentId + '" (at "' + path_extDocumentId + '")');
|
|
2922
|
+
}
|
|
2923
|
+
})();
|
|
2924
|
+
return v_error === undefined ? null : v_error;
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2927
|
+
const TTL = 60000;
|
|
2928
|
+
const VERSION = "0073b6a90cebc73156c21fe3fd09256a";
|
|
2929
|
+
function validate(obj, path = 'SaveExternalDocumentRepresentation') {
|
|
2930
|
+
const v_error = (() => {
|
|
2931
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2932
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2933
|
+
}
|
|
2934
|
+
const obj_id = obj.id;
|
|
2935
|
+
const path_id = path + '.id';
|
|
2936
|
+
if (typeof obj_id !== 'string') {
|
|
2937
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
2938
|
+
}
|
|
2939
|
+
const obj_isSuccess = obj.isSuccess;
|
|
2940
|
+
const path_isSuccess = path + '.isSuccess';
|
|
2941
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
2942
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
2943
|
+
}
|
|
2944
|
+
if (obj.message !== undefined) {
|
|
2945
|
+
const obj_message = obj.message;
|
|
2946
|
+
const path_message = path + '.message';
|
|
2947
|
+
if (typeof obj_message !== 'string') {
|
|
2948
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
2949
|
+
}
|
|
2950
|
+
}
|
|
2951
|
+
})();
|
|
2952
|
+
return v_error === undefined ? null : v_error;
|
|
2953
|
+
}
|
|
2954
|
+
const RepresentationType = 'SaveExternalDocumentRepresentation';
|
|
2955
|
+
function keyBuilder(luvio, config) {
|
|
2956
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.id;
|
|
2957
|
+
}
|
|
2958
|
+
function keyBuilderFromType(luvio, object) {
|
|
2959
|
+
const keyParams = {
|
|
2960
|
+
id: object.id
|
|
2961
|
+
};
|
|
2962
|
+
return keyBuilder(luvio, keyParams);
|
|
2963
|
+
}
|
|
2964
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
2965
|
+
return input;
|
|
2966
|
+
}
|
|
2967
|
+
const select$3 = function SaveExternalDocumentRepresentationSelect() {
|
|
2968
|
+
return {
|
|
2969
|
+
kind: 'Fragment',
|
|
2970
|
+
version: VERSION,
|
|
2971
|
+
private: [],
|
|
2972
|
+
opaque: true
|
|
2973
|
+
};
|
|
2974
|
+
};
|
|
2975
|
+
function equals(existing, incoming) {
|
|
2976
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
2977
|
+
return false;
|
|
2978
|
+
}
|
|
2979
|
+
return true;
|
|
2980
|
+
}
|
|
2981
|
+
function deepFreeze(input) {
|
|
2982
|
+
ObjectFreeze(input);
|
|
2983
|
+
}
|
|
2984
|
+
const ingest = function SaveExternalDocumentRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2985
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2986
|
+
const validateError = validate(input);
|
|
2987
|
+
if (validateError !== null) {
|
|
2988
|
+
throw validateError;
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
const key = keyBuilderFromType(luvio, input);
|
|
2992
|
+
const existingRecord = store.readEntry(key);
|
|
2993
|
+
const ttlToUse = TTL;
|
|
2994
|
+
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
2995
|
+
fullPath: key,
|
|
2996
|
+
parent: path.parent,
|
|
2997
|
+
propertyName: path.propertyName,
|
|
2998
|
+
ttl: ttlToUse
|
|
2999
|
+
});
|
|
3000
|
+
deepFreeze(input);
|
|
3001
|
+
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
3002
|
+
luvio.storePublish(key, incomingRecord);
|
|
3003
|
+
}
|
|
3004
|
+
{
|
|
3005
|
+
const storeMetadataParams = {
|
|
3006
|
+
ttl: ttlToUse,
|
|
3007
|
+
namespace: "clm",
|
|
3008
|
+
version: VERSION,
|
|
3009
|
+
representationName: RepresentationType,
|
|
3010
|
+
};
|
|
3011
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
3012
|
+
}
|
|
3013
|
+
return createLink(key);
|
|
3014
|
+
};
|
|
3015
|
+
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
3016
|
+
const rootKeySet = new StoreKeyMap();
|
|
3017
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3018
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
3019
|
+
rootKeySet.set(rootKey, {
|
|
3020
|
+
namespace: keyPrefix,
|
|
3021
|
+
representationName: RepresentationType,
|
|
3022
|
+
mergeable: false
|
|
3023
|
+
});
|
|
3024
|
+
return rootKeySet;
|
|
3025
|
+
}
|
|
3026
|
+
|
|
3027
|
+
function select$2(luvio, params) {
|
|
3028
|
+
return select$3();
|
|
3029
|
+
}
|
|
3030
|
+
function getResponseCacheKeys$2(luvio, resourceParams, response) {
|
|
3031
|
+
return getTypeCacheKeys(luvio, response);
|
|
3032
|
+
}
|
|
3033
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
3034
|
+
const { body } = response;
|
|
3035
|
+
const key = keyBuilderFromType(luvio, body);
|
|
3036
|
+
luvio.storeIngest(key, ingest, body);
|
|
3037
|
+
const snapshot = luvio.storeLookup({
|
|
3038
|
+
recordId: key,
|
|
3039
|
+
node: select$2(),
|
|
3040
|
+
variables: {},
|
|
3041
|
+
});
|
|
3042
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3043
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3044
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3045
|
+
}
|
|
3046
|
+
}
|
|
3047
|
+
return snapshot;
|
|
3048
|
+
}
|
|
3049
|
+
function createResourceRequest$2(config) {
|
|
3050
|
+
const headers = {};
|
|
3051
|
+
return {
|
|
3052
|
+
baseUri: '/services/data/v58.0',
|
|
3053
|
+
basePath: '/connect/clm/external-document-resource',
|
|
3054
|
+
method: 'patch',
|
|
3055
|
+
body: config.body,
|
|
3056
|
+
urlParams: {},
|
|
3057
|
+
queryParams: {},
|
|
3058
|
+
headers,
|
|
3059
|
+
priority: 'normal',
|
|
3060
|
+
};
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3063
|
+
const saveExternalDocument_ConfigPropertyNames = {
|
|
3064
|
+
displayName: 'saveExternalDocument',
|
|
3065
|
+
parameters: {
|
|
3066
|
+
required: ['externalDocumentInput'],
|
|
3067
|
+
optional: []
|
|
3068
|
+
}
|
|
3069
|
+
};
|
|
3070
|
+
function createResourceParams$2(config) {
|
|
3071
|
+
const resourceParams = {
|
|
3072
|
+
body: {
|
|
3073
|
+
externalDocumentInput: config.externalDocumentInput
|
|
3074
|
+
}
|
|
3075
|
+
};
|
|
3076
|
+
return resourceParams;
|
|
3077
|
+
}
|
|
3078
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
3079
|
+
const config = {};
|
|
3080
|
+
const untrustedConfig_externalDocumentInput = untrustedConfig.externalDocumentInput;
|
|
3081
|
+
const referenceSaveExternalDocumentInputRepresentationValidationError = validate$1(untrustedConfig_externalDocumentInput);
|
|
3082
|
+
if (referenceSaveExternalDocumentInputRepresentationValidationError === null) {
|
|
3083
|
+
config.externalDocumentInput = untrustedConfig_externalDocumentInput;
|
|
3084
|
+
}
|
|
3085
|
+
return config;
|
|
3086
|
+
}
|
|
3087
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
3088
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3089
|
+
return null;
|
|
3090
|
+
}
|
|
3091
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3092
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3093
|
+
}
|
|
3094
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
3095
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3096
|
+
return null;
|
|
3097
|
+
}
|
|
3098
|
+
return config;
|
|
3099
|
+
}
|
|
3100
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
3101
|
+
const resourceParams = createResourceParams$2(config);
|
|
3102
|
+
const request = createResourceRequest$2(resourceParams);
|
|
3103
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3104
|
+
.then((response) => {
|
|
3105
|
+
return luvio.handleSuccessResponse(() => {
|
|
3106
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
3107
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3108
|
+
}, () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
|
|
3109
|
+
}, (response) => {
|
|
3110
|
+
deepFreeze$b(response);
|
|
3111
|
+
throw response;
|
|
3112
|
+
});
|
|
3113
|
+
}
|
|
3114
|
+
const saveExternalDocumentAdapterFactory = (luvio) => {
|
|
3115
|
+
return function saveExternalDocument(untrustedConfig) {
|
|
3116
|
+
const config = validateAdapterConfig$2(untrustedConfig, saveExternalDocument_ConfigPropertyNames);
|
|
3117
|
+
// Invalid or incomplete config
|
|
3118
|
+
if (config === null) {
|
|
3119
|
+
throw new Error('Invalid config for "saveExternalDocument"');
|
|
3120
|
+
}
|
|
3121
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
3122
|
+
};
|
|
3123
|
+
};
|
|
3124
|
+
|
|
3125
|
+
function select$1(luvio, params) {
|
|
3126
|
+
return select$l();
|
|
3127
|
+
}
|
|
3128
|
+
function getResponseCacheKeys$1(luvio, resourceParams, response) {
|
|
3129
|
+
return getTypeCacheKeys$7(luvio, response);
|
|
3130
|
+
}
|
|
3131
|
+
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
3132
|
+
const { body } = response;
|
|
3133
|
+
const key = keyBuilderFromType$4(luvio, body);
|
|
3134
|
+
luvio.storeIngest(key, ingest$7, body);
|
|
3135
|
+
const snapshot = luvio.storeLookup({
|
|
3136
|
+
recordId: key,
|
|
3137
|
+
node: select$1(),
|
|
3138
|
+
variables: {},
|
|
3139
|
+
});
|
|
3140
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3141
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3142
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
return snapshot;
|
|
3146
|
+
}
|
|
3147
|
+
function createResourceRequest$1(config) {
|
|
3148
|
+
const headers = {};
|
|
3149
|
+
return {
|
|
3150
|
+
baseUri: '/services/data/v58.0',
|
|
3151
|
+
basePath: '/connect/clm/contract-document-version/' + config.urlParams.contractDocumentVersionId + '/unlock',
|
|
3152
|
+
method: 'patch',
|
|
3153
|
+
body: null,
|
|
3154
|
+
urlParams: config.urlParams,
|
|
3155
|
+
queryParams: {},
|
|
3156
|
+
headers,
|
|
3157
|
+
priority: 'normal',
|
|
3158
|
+
};
|
|
3159
|
+
}
|
|
3160
|
+
|
|
3161
|
+
const unlock_ConfigPropertyNames = {
|
|
3162
|
+
displayName: 'unlock',
|
|
3163
|
+
parameters: {
|
|
3164
|
+
required: ['contractDocumentVersionId'],
|
|
3165
|
+
optional: []
|
|
3166
|
+
}
|
|
3167
|
+
};
|
|
3168
|
+
function createResourceParams$1(config) {
|
|
3169
|
+
const resourceParams = {
|
|
3170
|
+
urlParams: {
|
|
3171
|
+
contractDocumentVersionId: config.contractDocumentVersionId
|
|
3172
|
+
}
|
|
3173
|
+
};
|
|
3174
|
+
return resourceParams;
|
|
3175
|
+
}
|
|
3176
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
3177
|
+
const config = {};
|
|
3178
|
+
const untrustedConfig_contractDocumentVersionId = untrustedConfig.contractDocumentVersionId;
|
|
3179
|
+
if (typeof untrustedConfig_contractDocumentVersionId === 'string') {
|
|
3180
|
+
config.contractDocumentVersionId = untrustedConfig_contractDocumentVersionId;
|
|
3181
|
+
}
|
|
3182
|
+
return config;
|
|
3183
|
+
}
|
|
3184
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
3185
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3186
|
+
return null;
|
|
3187
|
+
}
|
|
3188
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3189
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3190
|
+
}
|
|
3191
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
3192
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3193
|
+
return null;
|
|
3194
|
+
}
|
|
3195
|
+
return config;
|
|
3196
|
+
}
|
|
3197
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
3198
|
+
const resourceParams = createResourceParams$1(config);
|
|
3199
|
+
const request = createResourceRequest$1(resourceParams);
|
|
3200
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3201
|
+
.then((response) => {
|
|
3202
|
+
return luvio.handleSuccessResponse(() => {
|
|
3203
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
3204
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3205
|
+
}, () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
|
|
3206
|
+
}, (response) => {
|
|
3207
|
+
deepFreeze$b(response);
|
|
3208
|
+
throw response;
|
|
3209
|
+
});
|
|
3210
|
+
}
|
|
3211
|
+
const unlockAdapterFactory = (luvio) => {
|
|
3212
|
+
return function unlock(untrustedConfig) {
|
|
3213
|
+
const config = validateAdapterConfig$1(untrustedConfig, unlock_ConfigPropertyNames);
|
|
3214
|
+
// Invalid or incomplete config
|
|
3215
|
+
if (config === null) {
|
|
3216
|
+
throw new Error('Invalid config for "unlock"');
|
|
3217
|
+
}
|
|
3218
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
3219
|
+
};
|
|
3220
|
+
};
|
|
3221
|
+
|
|
3222
|
+
function select(luvio, params) {
|
|
3223
|
+
return select$i();
|
|
3224
|
+
}
|
|
3225
|
+
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
3226
|
+
return getTypeCacheKeys$6(luvio, response);
|
|
3227
|
+
}
|
|
3228
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
3229
|
+
const { body } = response;
|
|
3230
|
+
const key = keyBuilderFromType$3(luvio, body);
|
|
3231
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
3232
|
+
const snapshot = luvio.storeLookup({
|
|
3233
|
+
recordId: key,
|
|
3234
|
+
node: select(),
|
|
3235
|
+
variables: {},
|
|
3236
|
+
});
|
|
3237
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3238
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3239
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3240
|
+
}
|
|
3241
|
+
}
|
|
3242
|
+
return snapshot;
|
|
3243
|
+
}
|
|
3244
|
+
function createResourceRequest(config) {
|
|
3245
|
+
const headers = {};
|
|
3246
|
+
return {
|
|
3247
|
+
baseUri: '/services/data/v58.0',
|
|
3248
|
+
basePath: '/connect/clm/contract-document-version/' + config.urlParams.contractDocumentVersionId + '',
|
|
3249
|
+
method: 'patch',
|
|
3250
|
+
body: config.body,
|
|
3251
|
+
urlParams: config.urlParams,
|
|
3252
|
+
queryParams: {},
|
|
3253
|
+
headers,
|
|
3254
|
+
priority: 'normal',
|
|
3255
|
+
};
|
|
3256
|
+
}
|
|
3257
|
+
|
|
3258
|
+
const updateContractDocumentVersionWithTemplate_ConfigPropertyNames = {
|
|
3259
|
+
displayName: 'updateContractDocumentVersionWithTemplate',
|
|
3260
|
+
parameters: {
|
|
3261
|
+
required: ['contractDocumentVersionId', 'templateInput'],
|
|
3262
|
+
optional: []
|
|
3263
|
+
}
|
|
3264
|
+
};
|
|
3265
|
+
function createResourceParams(config) {
|
|
3266
|
+
const resourceParams = {
|
|
3267
|
+
urlParams: {
|
|
3268
|
+
contractDocumentVersionId: config.contractDocumentVersionId
|
|
3269
|
+
},
|
|
3270
|
+
body: {
|
|
3271
|
+
templateInput: config.templateInput
|
|
3272
|
+
}
|
|
3273
|
+
};
|
|
3274
|
+
return resourceParams;
|
|
3275
|
+
}
|
|
3276
|
+
function typeCheckConfig(untrustedConfig) {
|
|
3277
|
+
const config = {};
|
|
3278
|
+
const untrustedConfig_contractDocumentVersionId = untrustedConfig.contractDocumentVersionId;
|
|
3279
|
+
if (typeof untrustedConfig_contractDocumentVersionId === 'string') {
|
|
3280
|
+
config.contractDocumentVersionId = untrustedConfig_contractDocumentVersionId;
|
|
3281
|
+
}
|
|
3282
|
+
const untrustedConfig_templateInput = untrustedConfig.templateInput;
|
|
3283
|
+
const referenceTemplateInputRepresentationValidationError = validate$d(untrustedConfig_templateInput);
|
|
3284
|
+
if (referenceTemplateInputRepresentationValidationError === null) {
|
|
3285
|
+
config.templateInput = untrustedConfig_templateInput;
|
|
3286
|
+
}
|
|
3287
|
+
return config;
|
|
3288
|
+
}
|
|
3289
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
3290
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3291
|
+
return null;
|
|
3292
|
+
}
|
|
3293
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3294
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3295
|
+
}
|
|
3296
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
3297
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3298
|
+
return null;
|
|
3299
|
+
}
|
|
3300
|
+
return config;
|
|
3301
|
+
}
|
|
3302
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
3303
|
+
const resourceParams = createResourceParams(config);
|
|
3304
|
+
const request = createResourceRequest(resourceParams);
|
|
3305
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3306
|
+
.then((response) => {
|
|
3307
|
+
return luvio.handleSuccessResponse(() => {
|
|
3308
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
3309
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3310
|
+
}, () => getResponseCacheKeys(luvio, resourceParams, response.body));
|
|
3311
|
+
}, (response) => {
|
|
3312
|
+
deepFreeze$b(response);
|
|
3313
|
+
throw response;
|
|
3314
|
+
});
|
|
3315
|
+
}
|
|
3316
|
+
const updateContractDocumentVersionWithTemplateAdapterFactory = (luvio) => {
|
|
3317
|
+
return function updateContractDocumentVersionWithTemplate(untrustedConfig) {
|
|
3318
|
+
const config = validateAdapterConfig(untrustedConfig, updateContractDocumentVersionWithTemplate_ConfigPropertyNames);
|
|
3319
|
+
// Invalid or incomplete config
|
|
3320
|
+
if (config === null) {
|
|
3321
|
+
throw new Error('Invalid config for "updateContractDocumentVersionWithTemplate"');
|
|
3322
|
+
}
|
|
3323
|
+
return buildNetworkSnapshot(luvio, config);
|
|
3324
|
+
};
|
|
3325
|
+
};
|
|
3326
|
+
|
|
3327
|
+
let checkIn;
|
|
3328
|
+
let checkoutContractDocumentVersion;
|
|
3329
|
+
let createContractDocumentVersionAndInitializeGenerateDocumentProcess;
|
|
3330
|
+
let deleteAttachment;
|
|
3331
|
+
let executeContractAction;
|
|
3332
|
+
let getContentDocument;
|
|
3333
|
+
let getContentDocumentNotifyChange;
|
|
3334
|
+
let getContractActions;
|
|
3335
|
+
let getContractActionsNotifyChange;
|
|
3336
|
+
let getContractDocumentVersion;
|
|
3337
|
+
let getDocumentGenerationProcessDetails;
|
|
3338
|
+
let getTemplates;
|
|
3339
|
+
let lockContractDocumentVersion;
|
|
3340
|
+
let saveExternalDocument;
|
|
3341
|
+
let unlock;
|
|
3342
|
+
let updateContractDocumentVersionWithTemplate;
|
|
3343
|
+
// Imperative GET Adapters
|
|
3344
|
+
let getContentDocument_imperative;
|
|
3345
|
+
let getContractActions_imperative;
|
|
3346
|
+
let getContractDocumentVersion_imperative;
|
|
3347
|
+
let getDocumentGenerationProcessDetails_imperative;
|
|
3348
|
+
let getTemplates_imperative;
|
|
3349
|
+
const getContentDocumentMetadata = { apiFamily: 'clm', name: 'getContentDocument', ttl: 60000 };
|
|
3350
|
+
const getContractActionsMetadata = { apiFamily: 'clm', name: 'getContractActions', ttl: 60000 };
|
|
3351
|
+
const getContractDocumentVersionMetadata = { apiFamily: 'clm', name: 'getContractDocumentVersion', ttl: 60000 };
|
|
3352
|
+
const getDocumentGenerationProcessDetailsMetadata = { apiFamily: 'clm', name: 'getDocumentGenerationProcessDetails' };
|
|
3353
|
+
const getTemplatesMetadata = { apiFamily: 'clm', name: 'getTemplates', ttl: 60000 };
|
|
3354
|
+
function bindExportsTo(luvio) {
|
|
3355
|
+
// LDS Adapters
|
|
3356
|
+
const getContentDocument_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getContentDocument', getContentDocumentAdapterFactory), getContentDocumentMetadata);
|
|
3357
|
+
const getContractActions_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getContractActions', getContractActionsAdapterFactory), getContractActionsMetadata);
|
|
3358
|
+
const getContractDocumentVersion_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getContractDocumentVersion', getContractDocumentVersionAdapterFactory), getContractDocumentVersionMetadata);
|
|
3359
|
+
const getDocumentGenerationProcessDetails_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDocumentGenerationProcessDetails', getDocumentGenerationProcessDetailsAdapterFactory), getDocumentGenerationProcessDetailsMetadata);
|
|
3360
|
+
const getTemplates_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getTemplates', getTemplatesAdapterFactory), getTemplatesMetadata);
|
|
3361
|
+
function unwrapSnapshotData(factory) {
|
|
3362
|
+
const adapter = factory(luvio);
|
|
3363
|
+
return (config) => adapter(config).then(snapshot => snapshot.data);
|
|
3364
|
+
}
|
|
3365
|
+
return {
|
|
3366
|
+
checkIn: unwrapSnapshotData(checkInAdapterFactory),
|
|
3367
|
+
checkoutContractDocumentVersion: unwrapSnapshotData(checkoutContractDocumentVersionAdapterFactory),
|
|
3368
|
+
createContractDocumentVersionAndInitializeGenerateDocumentProcess: unwrapSnapshotData(createContractDocumentVersionAndInitializeGenerateDocumentProcessAdapterFactory),
|
|
3369
|
+
deleteAttachment: createLDSAdapter(luvio, adapterName, deleteAttachmentAdapterFactory),
|
|
3370
|
+
executeContractAction: unwrapSnapshotData(executeContractActionAdapterFactory),
|
|
3371
|
+
getContentDocument: createWireAdapterConstructor(luvio, getContentDocument_ldsAdapter, getContentDocumentMetadata),
|
|
3372
|
+
getContentDocumentNotifyChange: createLDSAdapter(luvio, 'getContentDocumentNotifyChange', notifyChangeFactory$1),
|
|
3373
|
+
getContractActions: createWireAdapterConstructor(luvio, getContractActions_ldsAdapter, getContractActionsMetadata),
|
|
3374
|
+
getContractActionsNotifyChange: createLDSAdapter(luvio, 'getContractActionsNotifyChange', notifyChangeFactory),
|
|
3375
|
+
getContractDocumentVersion: createWireAdapterConstructor(luvio, getContractDocumentVersion_ldsAdapter, getContractDocumentVersionMetadata),
|
|
3376
|
+
getDocumentGenerationProcessDetails: createWireAdapterConstructor(luvio, getDocumentGenerationProcessDetails_ldsAdapter, getDocumentGenerationProcessDetailsMetadata),
|
|
3377
|
+
getTemplates: createWireAdapterConstructor(luvio, getTemplates_ldsAdapter, getTemplatesMetadata),
|
|
3378
|
+
lockContractDocumentVersion: unwrapSnapshotData(lockContractDocumentVersionAdapterFactory),
|
|
3379
|
+
saveExternalDocument: unwrapSnapshotData(saveExternalDocumentAdapterFactory),
|
|
3380
|
+
unlock: unwrapSnapshotData(unlockAdapterFactory),
|
|
3381
|
+
updateContractDocumentVersionWithTemplate: unwrapSnapshotData(updateContractDocumentVersionWithTemplateAdapterFactory),
|
|
3382
|
+
// Imperative GET Adapters
|
|
3383
|
+
getContentDocument_imperative: createImperativeAdapter(luvio, getContentDocument_ldsAdapter, getContentDocumentMetadata),
|
|
3384
|
+
getContractActions_imperative: createImperativeAdapter(luvio, getContractActions_ldsAdapter, getContractActionsMetadata),
|
|
3385
|
+
getContractDocumentVersion_imperative: createImperativeAdapter(luvio, getContractDocumentVersion_ldsAdapter, getContractDocumentVersionMetadata),
|
|
3386
|
+
getDocumentGenerationProcessDetails_imperative: createImperativeAdapter(luvio, getDocumentGenerationProcessDetails_ldsAdapter, getDocumentGenerationProcessDetailsMetadata),
|
|
3387
|
+
getTemplates_imperative: createImperativeAdapter(luvio, getTemplates_ldsAdapter, getTemplatesMetadata)
|
|
3388
|
+
};
|
|
3389
|
+
}
|
|
3390
|
+
withDefaultLuvio((luvio) => {
|
|
3391
|
+
({
|
|
3392
|
+
checkIn,
|
|
3393
|
+
checkoutContractDocumentVersion,
|
|
3394
|
+
createContractDocumentVersionAndInitializeGenerateDocumentProcess,
|
|
3395
|
+
deleteAttachment,
|
|
3396
|
+
executeContractAction,
|
|
3397
|
+
getContentDocument,
|
|
3398
|
+
getContentDocumentNotifyChange,
|
|
3399
|
+
getContractActions,
|
|
3400
|
+
getContractActionsNotifyChange,
|
|
3401
|
+
getContractDocumentVersion,
|
|
3402
|
+
getDocumentGenerationProcessDetails,
|
|
3403
|
+
getTemplates,
|
|
3404
|
+
lockContractDocumentVersion,
|
|
3405
|
+
saveExternalDocument,
|
|
3406
|
+
unlock,
|
|
3407
|
+
updateContractDocumentVersionWithTemplate,
|
|
3408
|
+
getContentDocument_imperative,
|
|
3409
|
+
getContractActions_imperative,
|
|
3410
|
+
getContractDocumentVersion_imperative,
|
|
3411
|
+
getDocumentGenerationProcessDetails_imperative,
|
|
3412
|
+
getTemplates_imperative
|
|
3413
|
+
} = bindExportsTo(luvio));
|
|
3414
|
+
});
|
|
3415
|
+
|
|
3416
|
+
export { checkIn, checkoutContractDocumentVersion, createContractDocumentVersionAndInitializeGenerateDocumentProcess, deleteAttachment, executeContractAction, getContentDocument, getContentDocumentNotifyChange, getContentDocument_imperative, getContractActions, getContractActionsNotifyChange, getContractActions_imperative, getContractDocumentVersion, getContractDocumentVersion_imperative, getDocumentGenerationProcessDetails, getDocumentGenerationProcessDetails_imperative, getTemplates, getTemplates_imperative, lockContractDocumentVersion, saveExternalDocument, unlock, updateContractDocumentVersionWithTemplate };
|
|
3417
|
+
// version: 1.100.2-ca56bb821
|