@salesforce/lds-adapters-industries-docgen 0.131.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +82 -0
- package/dist/es/es2018/industries-docgen.js +3666 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +66 -0
- package/dist/es/es2018/types/src/generated/adapters/createDocumentEnvelopeForEsign.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/adapters/getDocumentClauseFields.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/adapters/getDocumentClauseSetCategories.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getDocumentClauseSets.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/adapters/getDocuments.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/getESignNotificationSettings.d.ts +26 -0
- package/dist/es/es2018/types/src/generated/adapters/getRecipients.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/getSignerRoles.d.ts +25 -0
- package/dist/es/es2018/types/src/generated/adapters/updateEnvelope.d.ts +14 -0
- package/dist/es/es2018/types/src/generated/adapters/updateVoidedEnvelope.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +10 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectClauseLibraryClauseCategoryConfigurations.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectClauseLibraryDocumentClauseSets.d.ts +20 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectClauseLibraryDocumentClausesFields.d.ts +20 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectESignDocuments.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectESignNotificationSettings.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectESignRecipients.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectESignSignerRoles.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/resources/patchConnectESignSignatureRequestsEnvelopesStatusBySourceObjectId.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/resources/patchConnectESignSignatureRequestsEnvelopesVoidBySourceObjectId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectESignSignatureRequestsEnvelopeSendBySourceObjectId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/types/ClauseCategoriesResponse.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/ClauseCategoryResponse.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/DocumentClauseFieldsResponse.d.ts +33 -0
- package/dist/es/es2018/types/src/generated/types/DocumentClauseSetListResponse.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/DocumentClauseSetResponse.d.ts +44 -0
- package/dist/es/es2018/types/src/generated/types/DocumentListResponse.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/DocumentResponse.d.ts +45 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeSendAnchorRequest.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeSendAnchorsRequest.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeSendDocumentsRequest.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeSendEmailNotificationRequest.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeSendEmailSettingsRequest.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeSendNotificationExpirationsRequest.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeSendNotificationRemindersRequest.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeSendNotificationRequest.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeSendRecipientDetailRequest.d.ts +68 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeSendRecipientsRequest.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeSendRequest.d.ts +44 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeSendRequestWrapper.d.ts +39 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeSendResponse.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeStatusListResponse.d.ts +48 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeStatusResponse.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeVoidRequest.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeVoidRequestWrapper.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/types/EnvelopeVoidResponse.d.ts +51 -0
- package/dist/es/es2018/types/src/generated/types/NotificationExpirationResponse.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/NotificationReminderResponse.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/NotificationSettingResponse.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/RecipientListResponse.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/RecipientResponse.d.ts +42 -0
- package/dist/es/es2018/types/src/generated/types/SignerRolesResponse.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +39 -0
- package/package.json +68 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +3758 -0
- package/src/raml/api.raml +750 -0
- package/src/raml/luvio.raml +152 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,3758 @@
|
|
|
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 = 'docgen';
|
|
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 equalsObject(a, b, equalsProp) {
|
|
80
|
+
const aKeys = ObjectKeys(a).sort();
|
|
81
|
+
const bKeys = ObjectKeys(b).sort();
|
|
82
|
+
const aKeysLength = aKeys.length;
|
|
83
|
+
const bKeysLength = bKeys.length;
|
|
84
|
+
if (aKeysLength !== bKeysLength) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
for (let i = 0; i < aKeys.length; i++) {
|
|
88
|
+
const key = aKeys[i];
|
|
89
|
+
if (key !== bKeys[i]) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
if (equalsProp(a[key], b[key]) === false) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
function deepFreeze(value) {
|
|
99
|
+
// No need to freeze primitives
|
|
100
|
+
if (typeof value !== 'object' || value === null) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (ArrayIsArray(value)) {
|
|
104
|
+
for (let i = 0, len = value.length; i < len; i += 1) {
|
|
105
|
+
deepFreeze(value[i]);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
const keys = ObjectKeys(value);
|
|
110
|
+
for (let i = 0, len = keys.length; i < len; i += 1) {
|
|
111
|
+
deepFreeze(value[keys[i]]);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
ObjectFreeze(value);
|
|
115
|
+
}
|
|
116
|
+
function createLink(ref) {
|
|
117
|
+
return {
|
|
118
|
+
__ref: serializeStructuredKey(ref),
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function validate$i(obj, path = 'EnvelopeSendRequest') {
|
|
123
|
+
const v_error = (() => {
|
|
124
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
125
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
126
|
+
}
|
|
127
|
+
const obj_documents = obj.documents;
|
|
128
|
+
const path_documents = path + '.documents';
|
|
129
|
+
if (!ArrayIsArray(obj_documents)) {
|
|
130
|
+
return new TypeError('Expected "array" but received "' + typeof obj_documents + '" (at "' + path_documents + '")');
|
|
131
|
+
}
|
|
132
|
+
for (let i = 0; i < obj_documents.length; i++) {
|
|
133
|
+
const obj_documents_item = obj_documents[i];
|
|
134
|
+
const path_documents_item = path_documents + '[' + i + ']';
|
|
135
|
+
if (typeof obj_documents_item !== 'object' || ArrayIsArray(obj_documents_item) || obj_documents_item === null) {
|
|
136
|
+
return new TypeError('Expected "object" but received "' + typeof obj_documents_item + '" (at "' + path_documents_item + '")');
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const obj_emailSettings = obj.emailSettings;
|
|
140
|
+
const path_emailSettings = path + '.emailSettings';
|
|
141
|
+
if (typeof obj_emailSettings !== 'object' || ArrayIsArray(obj_emailSettings) || obj_emailSettings === null) {
|
|
142
|
+
return new TypeError('Expected "object" but received "' + typeof obj_emailSettings + '" (at "' + path_emailSettings + '")');
|
|
143
|
+
}
|
|
144
|
+
const obj_notificationSettings = obj.notificationSettings;
|
|
145
|
+
const path_notificationSettings = path + '.notificationSettings';
|
|
146
|
+
if (typeof obj_notificationSettings !== 'object' || ArrayIsArray(obj_notificationSettings) || obj_notificationSettings === null) {
|
|
147
|
+
return new TypeError('Expected "object" but received "' + typeof obj_notificationSettings + '" (at "' + path_notificationSettings + '")');
|
|
148
|
+
}
|
|
149
|
+
if (obj.parentId !== undefined) {
|
|
150
|
+
const obj_parentId = obj.parentId;
|
|
151
|
+
const path_parentId = path + '.parentId';
|
|
152
|
+
if (typeof obj_parentId !== 'string') {
|
|
153
|
+
return new TypeError('Expected "string" but received "' + typeof obj_parentId + '" (at "' + path_parentId + '")');
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const obj_recipients = obj.recipients;
|
|
157
|
+
const path_recipients = path + '.recipients';
|
|
158
|
+
if (typeof obj_recipients !== 'object' || ArrayIsArray(obj_recipients) || obj_recipients === null) {
|
|
159
|
+
return new TypeError('Expected "object" but received "' + typeof obj_recipients + '" (at "' + path_recipients + '")');
|
|
160
|
+
}
|
|
161
|
+
const obj_vendor = obj.vendor;
|
|
162
|
+
const path_vendor = path + '.vendor';
|
|
163
|
+
if (typeof obj_vendor !== 'string') {
|
|
164
|
+
return new TypeError('Expected "string" but received "' + typeof obj_vendor + '" (at "' + path_vendor + '")');
|
|
165
|
+
}
|
|
166
|
+
})();
|
|
167
|
+
return v_error === undefined ? null : v_error;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const VERSION$g = "44758c9d3b9165dafba7053b5ef892f0";
|
|
171
|
+
function validate$h(obj, path = 'EnvelopeSendResponse') {
|
|
172
|
+
const v_error = (() => {
|
|
173
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
174
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
175
|
+
}
|
|
176
|
+
const obj_envelopeId = obj.envelopeId;
|
|
177
|
+
const path_envelopeId = path + '.envelopeId';
|
|
178
|
+
if (typeof obj_envelopeId !== 'string') {
|
|
179
|
+
return new TypeError('Expected "string" but received "' + typeof obj_envelopeId + '" (at "' + path_envelopeId + '")');
|
|
180
|
+
}
|
|
181
|
+
if (obj.envelopeStatus !== undefined) {
|
|
182
|
+
const obj_envelopeStatus = obj.envelopeStatus;
|
|
183
|
+
const path_envelopeStatus = path + '.envelopeStatus';
|
|
184
|
+
if (typeof obj_envelopeStatus !== 'string') {
|
|
185
|
+
return new TypeError('Expected "string" but received "' + typeof obj_envelopeStatus + '" (at "' + path_envelopeStatus + '")');
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
})();
|
|
189
|
+
return v_error === undefined ? null : v_error;
|
|
190
|
+
}
|
|
191
|
+
const RepresentationType$9 = 'EnvelopeSendResponse';
|
|
192
|
+
function keyBuilder$g(luvio, config) {
|
|
193
|
+
return keyPrefix + '::' + RepresentationType$9 + ':' + config.envelopeId;
|
|
194
|
+
}
|
|
195
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
196
|
+
const keyParams = {
|
|
197
|
+
envelopeId: object.envelopeId
|
|
198
|
+
};
|
|
199
|
+
return keyBuilder$g(luvio, keyParams);
|
|
200
|
+
}
|
|
201
|
+
function normalize$9(input, existing, path, luvio, store, timestamp) {
|
|
202
|
+
return input;
|
|
203
|
+
}
|
|
204
|
+
const select$q = function EnvelopeSendResponseSelect() {
|
|
205
|
+
return {
|
|
206
|
+
kind: 'Fragment',
|
|
207
|
+
version: VERSION$g,
|
|
208
|
+
private: [],
|
|
209
|
+
selections: [
|
|
210
|
+
{
|
|
211
|
+
name: 'envelopeId',
|
|
212
|
+
kind: 'Scalar'
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: 'envelopeStatus',
|
|
216
|
+
kind: 'Scalar',
|
|
217
|
+
required: false
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
function equals$g(existing, incoming) {
|
|
223
|
+
const existing_envelopeId = existing.envelopeId;
|
|
224
|
+
const incoming_envelopeId = incoming.envelopeId;
|
|
225
|
+
if (!(existing_envelopeId === incoming_envelopeId)) {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
const existing_envelopeStatus = existing.envelopeStatus;
|
|
229
|
+
const incoming_envelopeStatus = incoming.envelopeStatus;
|
|
230
|
+
// if at least one of these optionals is defined
|
|
231
|
+
if (existing_envelopeStatus !== undefined || incoming_envelopeStatus !== undefined) {
|
|
232
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
233
|
+
// not equal
|
|
234
|
+
if (existing_envelopeStatus === undefined || incoming_envelopeStatus === undefined) {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
if (!(existing_envelopeStatus === incoming_envelopeStatus)) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
const ingest$9 = function EnvelopeSendResponseIngest(input, path, luvio, store, timestamp) {
|
|
244
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
245
|
+
const validateError = validate$h(input);
|
|
246
|
+
if (validateError !== null) {
|
|
247
|
+
throw validateError;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
const key = keyBuilderFromType$2(luvio, input);
|
|
251
|
+
const existingRecord = store.readEntry(key);
|
|
252
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
|
|
253
|
+
let incomingRecord = normalize$9(input, store.readEntry(key), {
|
|
254
|
+
fullPath: key,
|
|
255
|
+
parent: path.parent,
|
|
256
|
+
propertyName: path.propertyName,
|
|
257
|
+
ttl: ttlToUse
|
|
258
|
+
});
|
|
259
|
+
if (existingRecord === undefined || equals$g(existingRecord, incomingRecord) === false) {
|
|
260
|
+
luvio.storePublish(key, incomingRecord);
|
|
261
|
+
}
|
|
262
|
+
if (ttlToUse !== undefined) {
|
|
263
|
+
const storeMetadataParams = {
|
|
264
|
+
ttl: ttlToUse,
|
|
265
|
+
namespace: "docgen",
|
|
266
|
+
version: VERSION$g,
|
|
267
|
+
representationName: RepresentationType$9,
|
|
268
|
+
};
|
|
269
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
270
|
+
}
|
|
271
|
+
return createLink(key);
|
|
272
|
+
};
|
|
273
|
+
function getTypeCacheKeys$9(luvio, input, fullPathFactory) {
|
|
274
|
+
const rootKeySet = new StoreKeyMap();
|
|
275
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
276
|
+
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
277
|
+
rootKeySet.set(rootKey, {
|
|
278
|
+
namespace: keyPrefix,
|
|
279
|
+
representationName: RepresentationType$9,
|
|
280
|
+
mergeable: false
|
|
281
|
+
});
|
|
282
|
+
return rootKeySet;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
function select$p(luvio, params) {
|
|
286
|
+
return select$q();
|
|
287
|
+
}
|
|
288
|
+
function getResponseCacheKeys$9(luvio, resourceParams, response) {
|
|
289
|
+
return getTypeCacheKeys$9(luvio, response);
|
|
290
|
+
}
|
|
291
|
+
function ingestSuccess$9(luvio, resourceParams, response) {
|
|
292
|
+
const { body } = response;
|
|
293
|
+
const key = keyBuilderFromType$2(luvio, body);
|
|
294
|
+
luvio.storeIngest(key, ingest$9, body);
|
|
295
|
+
const snapshot = luvio.storeLookup({
|
|
296
|
+
recordId: key,
|
|
297
|
+
node: select$p(),
|
|
298
|
+
variables: {},
|
|
299
|
+
});
|
|
300
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
301
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
302
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return snapshot;
|
|
306
|
+
}
|
|
307
|
+
function createResourceRequest$9(config) {
|
|
308
|
+
const headers = {};
|
|
309
|
+
return {
|
|
310
|
+
baseUri: '/services/data/v58.0',
|
|
311
|
+
basePath: '/connect/e-sign/signature-requests/' + config.urlParams.sourceObjectId + '/envelope/send',
|
|
312
|
+
method: 'post',
|
|
313
|
+
body: config.body,
|
|
314
|
+
urlParams: config.urlParams,
|
|
315
|
+
queryParams: {},
|
|
316
|
+
headers,
|
|
317
|
+
priority: 'normal',
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const createDocumentEnvelopeForEsign_ConfigPropertyNames = {
|
|
322
|
+
displayName: 'createDocumentEnvelopeForEsign',
|
|
323
|
+
parameters: {
|
|
324
|
+
required: ['sourceObjectId', 'envelope'],
|
|
325
|
+
optional: []
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
function createResourceParams$9(config) {
|
|
329
|
+
const resourceParams = {
|
|
330
|
+
urlParams: {
|
|
331
|
+
sourceObjectId: config.sourceObjectId
|
|
332
|
+
},
|
|
333
|
+
body: {
|
|
334
|
+
envelope: config.envelope
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
return resourceParams;
|
|
338
|
+
}
|
|
339
|
+
function typeCheckConfig$9(untrustedConfig) {
|
|
340
|
+
const config = {};
|
|
341
|
+
const untrustedConfig_sourceObjectId = untrustedConfig.sourceObjectId;
|
|
342
|
+
if (typeof untrustedConfig_sourceObjectId === 'string') {
|
|
343
|
+
config.sourceObjectId = untrustedConfig_sourceObjectId;
|
|
344
|
+
}
|
|
345
|
+
const untrustedConfig_envelope = untrustedConfig.envelope;
|
|
346
|
+
const referenceEnvelopeSendRequestValidationError = validate$i(untrustedConfig_envelope);
|
|
347
|
+
if (referenceEnvelopeSendRequestValidationError === null) {
|
|
348
|
+
config.envelope = untrustedConfig_envelope;
|
|
349
|
+
}
|
|
350
|
+
return config;
|
|
351
|
+
}
|
|
352
|
+
function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
|
|
353
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
354
|
+
return null;
|
|
355
|
+
}
|
|
356
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
357
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
358
|
+
}
|
|
359
|
+
const config = typeCheckConfig$9(untrustedConfig);
|
|
360
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
361
|
+
return null;
|
|
362
|
+
}
|
|
363
|
+
return config;
|
|
364
|
+
}
|
|
365
|
+
function buildNetworkSnapshot$9(luvio, config, options) {
|
|
366
|
+
const resourceParams = createResourceParams$9(config);
|
|
367
|
+
const request = createResourceRequest$9(resourceParams);
|
|
368
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
369
|
+
.then((response) => {
|
|
370
|
+
return luvio.handleSuccessResponse(() => {
|
|
371
|
+
const snapshot = ingestSuccess$9(luvio, resourceParams, response);
|
|
372
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
373
|
+
}, () => getResponseCacheKeys$9(luvio, resourceParams, response.body));
|
|
374
|
+
}, (response) => {
|
|
375
|
+
deepFreeze(response);
|
|
376
|
+
throw response;
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
const createDocumentEnvelopeForEsignAdapterFactory = (luvio) => {
|
|
380
|
+
return function createDocumentEnvelopeForEsign(untrustedConfig) {
|
|
381
|
+
const config = validateAdapterConfig$9(untrustedConfig, createDocumentEnvelopeForEsign_ConfigPropertyNames);
|
|
382
|
+
// Invalid or incomplete config
|
|
383
|
+
if (config === null) {
|
|
384
|
+
throw new Error('Invalid config for "createDocumentEnvelopeForEsign"');
|
|
385
|
+
}
|
|
386
|
+
return buildNetworkSnapshot$9(luvio, config);
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
const TTL$6 = 100;
|
|
391
|
+
const VERSION$f = "a3afe2a67715551a49f0d59eafb639aa";
|
|
392
|
+
function validate$g(obj, path = 'DocumentClauseFieldsResponse') {
|
|
393
|
+
const v_error = (() => {
|
|
394
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
395
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
396
|
+
}
|
|
397
|
+
const obj_extendedFields = obj.extendedFields;
|
|
398
|
+
const path_extendedFields = path + '.extendedFields';
|
|
399
|
+
if (obj_extendedFields === undefined) {
|
|
400
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_extendedFields + '" (at "' + path_extendedFields + '")');
|
|
401
|
+
}
|
|
402
|
+
const obj_fieldValues = obj.fieldValues;
|
|
403
|
+
const path_fieldValues = path + '.fieldValues';
|
|
404
|
+
if (!ArrayIsArray(obj_fieldValues)) {
|
|
405
|
+
return new TypeError('Expected "array" but received "' + typeof obj_fieldValues + '" (at "' + path_fieldValues + '")');
|
|
406
|
+
}
|
|
407
|
+
for (let i = 0; i < obj_fieldValues.length; i++) {
|
|
408
|
+
const obj_fieldValues_item = obj_fieldValues[i];
|
|
409
|
+
const path_fieldValues_item = path_fieldValues + '[' + i + ']';
|
|
410
|
+
if (typeof obj_fieldValues_item !== 'string') {
|
|
411
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fieldValues_item + '" (at "' + path_fieldValues_item + '")');
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
})();
|
|
415
|
+
return v_error === undefined ? null : v_error;
|
|
416
|
+
}
|
|
417
|
+
const RepresentationType$8 = 'DocumentClauseFieldsResponse';
|
|
418
|
+
function normalize$8(input, existing, path, luvio, store, timestamp) {
|
|
419
|
+
return input;
|
|
420
|
+
}
|
|
421
|
+
const select$o = function DocumentClauseFieldsResponseSelect() {
|
|
422
|
+
return {
|
|
423
|
+
kind: 'Fragment',
|
|
424
|
+
version: VERSION$f,
|
|
425
|
+
private: [],
|
|
426
|
+
selections: [
|
|
427
|
+
{
|
|
428
|
+
name: 'extendedFields',
|
|
429
|
+
kind: 'Object',
|
|
430
|
+
// any
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
name: 'fieldValues',
|
|
434
|
+
kind: 'Scalar',
|
|
435
|
+
plural: true
|
|
436
|
+
}
|
|
437
|
+
]
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
function equals$f(existing, incoming) {
|
|
441
|
+
const existing_extendedFields = existing.extendedFields;
|
|
442
|
+
const incoming_extendedFields = incoming.extendedFields;
|
|
443
|
+
if (JSONStringify(incoming_extendedFields) !== JSONStringify(existing_extendedFields)) {
|
|
444
|
+
return false;
|
|
445
|
+
}
|
|
446
|
+
const existing_fieldValues = existing.fieldValues;
|
|
447
|
+
const incoming_fieldValues = incoming.fieldValues;
|
|
448
|
+
const equals_fieldValues_items = equalsArray(existing_fieldValues, incoming_fieldValues, (existing_fieldValues_item, incoming_fieldValues_item) => {
|
|
449
|
+
if (!(existing_fieldValues_item === incoming_fieldValues_item)) {
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
if (equals_fieldValues_items === false) {
|
|
454
|
+
return false;
|
|
455
|
+
}
|
|
456
|
+
return true;
|
|
457
|
+
}
|
|
458
|
+
const ingest$8 = function DocumentClauseFieldsResponseIngest(input, path, luvio, store, timestamp) {
|
|
459
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
460
|
+
const validateError = validate$g(input);
|
|
461
|
+
if (validateError !== null) {
|
|
462
|
+
throw validateError;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
const key = path.fullPath;
|
|
466
|
+
const existingRecord = store.readEntry(key);
|
|
467
|
+
const ttlToUse = TTL$6;
|
|
468
|
+
let incomingRecord = normalize$8(input, store.readEntry(key), {
|
|
469
|
+
fullPath: key,
|
|
470
|
+
parent: path.parent,
|
|
471
|
+
propertyName: path.propertyName,
|
|
472
|
+
ttl: ttlToUse
|
|
473
|
+
});
|
|
474
|
+
if (existingRecord === undefined || equals$f(existingRecord, incomingRecord) === false) {
|
|
475
|
+
luvio.storePublish(key, incomingRecord);
|
|
476
|
+
}
|
|
477
|
+
{
|
|
478
|
+
const storeMetadataParams = {
|
|
479
|
+
ttl: ttlToUse,
|
|
480
|
+
namespace: "docgen",
|
|
481
|
+
version: VERSION$f,
|
|
482
|
+
representationName: RepresentationType$8,
|
|
483
|
+
};
|
|
484
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
485
|
+
}
|
|
486
|
+
return createLink(key);
|
|
487
|
+
};
|
|
488
|
+
function getTypeCacheKeys$8(luvio, input, fullPathFactory) {
|
|
489
|
+
const rootKeySet = new StoreKeyMap();
|
|
490
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
491
|
+
const rootKey = fullPathFactory();
|
|
492
|
+
rootKeySet.set(rootKey, {
|
|
493
|
+
namespace: keyPrefix,
|
|
494
|
+
representationName: RepresentationType$8,
|
|
495
|
+
mergeable: false
|
|
496
|
+
});
|
|
497
|
+
return rootKeySet;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function select$n(luvio, params) {
|
|
501
|
+
return select$o();
|
|
502
|
+
}
|
|
503
|
+
function keyBuilder$f(luvio, params) {
|
|
504
|
+
return keyPrefix + '::DocumentClauseFieldsResponse:(' + 'clauseSetId:' + params.queryParams.clauseSetId + ',' + 'extendedFields:' + params.queryParams.extendedFields + ',' + 'fieldName:' + params.queryParams.fieldName + ',' + 'language:' + params.queryParams.language + ',' + 'name:' + params.queryParams.name + ',' + 'status:' + params.queryParams.status + ')';
|
|
505
|
+
}
|
|
506
|
+
function getResponseCacheKeys$8(luvio, resourceParams, response) {
|
|
507
|
+
return getTypeCacheKeys$8(luvio, response, () => keyBuilder$f(luvio, resourceParams));
|
|
508
|
+
}
|
|
509
|
+
function ingestSuccess$8(luvio, resourceParams, response, snapshotRefresh) {
|
|
510
|
+
const { body } = response;
|
|
511
|
+
const key = keyBuilder$f(luvio, resourceParams);
|
|
512
|
+
luvio.storeIngest(key, ingest$8, body);
|
|
513
|
+
const snapshot = luvio.storeLookup({
|
|
514
|
+
recordId: key,
|
|
515
|
+
node: select$n(),
|
|
516
|
+
variables: {},
|
|
517
|
+
}, snapshotRefresh);
|
|
518
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
519
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
520
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
return snapshot;
|
|
524
|
+
}
|
|
525
|
+
function ingestError$6(luvio, params, error, snapshotRefresh) {
|
|
526
|
+
const key = keyBuilder$f(luvio, params);
|
|
527
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
528
|
+
const storeMetadataParams = {
|
|
529
|
+
ttl: TTL$6,
|
|
530
|
+
namespace: keyPrefix,
|
|
531
|
+
version: VERSION$f,
|
|
532
|
+
representationName: RepresentationType$8
|
|
533
|
+
};
|
|
534
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
535
|
+
return errorSnapshot;
|
|
536
|
+
}
|
|
537
|
+
function createResourceRequest$8(config) {
|
|
538
|
+
const headers = {};
|
|
539
|
+
return {
|
|
540
|
+
baseUri: '/services/data/v58.0',
|
|
541
|
+
basePath: '/connect/clause-library/document-clauses/fields',
|
|
542
|
+
method: 'get',
|
|
543
|
+
body: null,
|
|
544
|
+
urlParams: {},
|
|
545
|
+
queryParams: config.queryParams,
|
|
546
|
+
headers,
|
|
547
|
+
priority: 'normal',
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
const getDocumentClauseFields_ConfigPropertyNames = {
|
|
552
|
+
displayName: 'getDocumentClauseFields',
|
|
553
|
+
parameters: {
|
|
554
|
+
required: [],
|
|
555
|
+
optional: ['clauseSetId', 'extendedFields', 'fieldName', 'language', 'name', 'status']
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
function createResourceParams$8(config) {
|
|
559
|
+
const resourceParams = {
|
|
560
|
+
queryParams: {
|
|
561
|
+
clauseSetId: config.clauseSetId, extendedFields: config.extendedFields, fieldName: config.fieldName, language: config.language, name: config.name, status: config.status
|
|
562
|
+
}
|
|
563
|
+
};
|
|
564
|
+
return resourceParams;
|
|
565
|
+
}
|
|
566
|
+
function keyBuilder$e(luvio, config) {
|
|
567
|
+
const resourceParams = createResourceParams$8(config);
|
|
568
|
+
return keyBuilder$f(luvio, resourceParams);
|
|
569
|
+
}
|
|
570
|
+
function typeCheckConfig$8(untrustedConfig) {
|
|
571
|
+
const config = {};
|
|
572
|
+
const untrustedConfig_clauseSetId = untrustedConfig.clauseSetId;
|
|
573
|
+
if (typeof untrustedConfig_clauseSetId === 'string') {
|
|
574
|
+
config.clauseSetId = untrustedConfig_clauseSetId;
|
|
575
|
+
}
|
|
576
|
+
const untrustedConfig_extendedFields = untrustedConfig.extendedFields;
|
|
577
|
+
if (typeof untrustedConfig_extendedFields === 'string') {
|
|
578
|
+
config.extendedFields = untrustedConfig_extendedFields;
|
|
579
|
+
}
|
|
580
|
+
const untrustedConfig_fieldName = untrustedConfig.fieldName;
|
|
581
|
+
if (typeof untrustedConfig_fieldName === 'string') {
|
|
582
|
+
config.fieldName = untrustedConfig_fieldName;
|
|
583
|
+
}
|
|
584
|
+
const untrustedConfig_language = untrustedConfig.language;
|
|
585
|
+
if (typeof untrustedConfig_language === 'string') {
|
|
586
|
+
config.language = untrustedConfig_language;
|
|
587
|
+
}
|
|
588
|
+
const untrustedConfig_name = untrustedConfig.name;
|
|
589
|
+
if (typeof untrustedConfig_name === 'string') {
|
|
590
|
+
config.name = untrustedConfig_name;
|
|
591
|
+
}
|
|
592
|
+
const untrustedConfig_status = untrustedConfig.status;
|
|
593
|
+
if (typeof untrustedConfig_status === 'string') {
|
|
594
|
+
config.status = untrustedConfig_status;
|
|
595
|
+
}
|
|
596
|
+
return config;
|
|
597
|
+
}
|
|
598
|
+
function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
|
|
599
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
600
|
+
return null;
|
|
601
|
+
}
|
|
602
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
603
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
604
|
+
}
|
|
605
|
+
const config = typeCheckConfig$8(untrustedConfig);
|
|
606
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
607
|
+
return null;
|
|
608
|
+
}
|
|
609
|
+
return config;
|
|
610
|
+
}
|
|
611
|
+
function adapterFragment$6(luvio, config) {
|
|
612
|
+
createResourceParams$8(config);
|
|
613
|
+
return select$n();
|
|
614
|
+
}
|
|
615
|
+
function onFetchResponseSuccess$6(luvio, config, resourceParams, response) {
|
|
616
|
+
const snapshot = ingestSuccess$8(luvio, resourceParams, response, {
|
|
617
|
+
config,
|
|
618
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
619
|
+
});
|
|
620
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
621
|
+
}
|
|
622
|
+
function onFetchResponseError$6(luvio, config, resourceParams, response) {
|
|
623
|
+
const snapshot = ingestError$6(luvio, resourceParams, response, {
|
|
624
|
+
config,
|
|
625
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
626
|
+
});
|
|
627
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
628
|
+
}
|
|
629
|
+
function buildNetworkSnapshot$8(luvio, config, options) {
|
|
630
|
+
const resourceParams = createResourceParams$8(config);
|
|
631
|
+
const request = createResourceRequest$8(resourceParams);
|
|
632
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
633
|
+
.then((response) => {
|
|
634
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$6(luvio, config, resourceParams, response), () => getResponseCacheKeys$8(luvio, resourceParams, response.body));
|
|
635
|
+
}, (response) => {
|
|
636
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$6(luvio, config, resourceParams, response));
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
function buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext) {
|
|
640
|
+
const { luvio, config } = context;
|
|
641
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
642
|
+
const dispatchOptions = {
|
|
643
|
+
resourceRequestContext: {
|
|
644
|
+
requestCorrelator,
|
|
645
|
+
luvioRequestMethod: undefined,
|
|
646
|
+
},
|
|
647
|
+
eventObservers
|
|
648
|
+
};
|
|
649
|
+
if (networkPriority !== 'normal') {
|
|
650
|
+
dispatchOptions.overrides = {
|
|
651
|
+
priority: networkPriority
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
return buildNetworkSnapshot$8(luvio, config, dispatchOptions);
|
|
655
|
+
}
|
|
656
|
+
function buildCachedSnapshotCachePolicy$6(context, storeLookup) {
|
|
657
|
+
const { luvio, config } = context;
|
|
658
|
+
const selector = {
|
|
659
|
+
recordId: keyBuilder$e(luvio, config),
|
|
660
|
+
node: adapterFragment$6(luvio, config),
|
|
661
|
+
variables: {},
|
|
662
|
+
};
|
|
663
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
664
|
+
config,
|
|
665
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
666
|
+
});
|
|
667
|
+
return cacheSnapshot;
|
|
668
|
+
}
|
|
669
|
+
const getDocumentClauseFieldsAdapterFactory = (luvio) => function docgen__getDocumentClauseFields(untrustedConfig, requestContext) {
|
|
670
|
+
const config = validateAdapterConfig$8(untrustedConfig, getDocumentClauseFields_ConfigPropertyNames);
|
|
671
|
+
// Invalid or incomplete config
|
|
672
|
+
if (config === null) {
|
|
673
|
+
return null;
|
|
674
|
+
}
|
|
675
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
676
|
+
buildCachedSnapshotCachePolicy$6, buildNetworkSnapshotCachePolicy$6);
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
const VERSION$e = "c0cdffc7d0ce780dd3dbd6844cb94df8";
|
|
680
|
+
function validate$f(obj, path = 'ClauseCategoryResponse') {
|
|
681
|
+
const v_error = (() => {
|
|
682
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
683
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
684
|
+
}
|
|
685
|
+
if (obj.id !== undefined) {
|
|
686
|
+
const obj_id = obj.id;
|
|
687
|
+
const path_id = path + '.id';
|
|
688
|
+
if (typeof obj_id !== 'string') {
|
|
689
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
const obj_name = obj.name;
|
|
693
|
+
const path_name = path + '.name';
|
|
694
|
+
if (typeof obj_name !== 'string') {
|
|
695
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
696
|
+
}
|
|
697
|
+
const obj_usageType = obj.usageType;
|
|
698
|
+
const path_usageType = path + '.usageType';
|
|
699
|
+
if (typeof obj_usageType !== 'string') {
|
|
700
|
+
return new TypeError('Expected "string" but received "' + typeof obj_usageType + '" (at "' + path_usageType + '")');
|
|
701
|
+
}
|
|
702
|
+
})();
|
|
703
|
+
return v_error === undefined ? null : v_error;
|
|
704
|
+
}
|
|
705
|
+
const select$m = function ClauseCategoryResponseSelect() {
|
|
706
|
+
return {
|
|
707
|
+
kind: 'Fragment',
|
|
708
|
+
version: VERSION$e,
|
|
709
|
+
private: [],
|
|
710
|
+
selections: [
|
|
711
|
+
{
|
|
712
|
+
name: 'id',
|
|
713
|
+
kind: 'Scalar',
|
|
714
|
+
required: false
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
name: 'name',
|
|
718
|
+
kind: 'Scalar'
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
name: 'usageType',
|
|
722
|
+
kind: 'Scalar'
|
|
723
|
+
}
|
|
724
|
+
]
|
|
725
|
+
};
|
|
726
|
+
};
|
|
727
|
+
function equals$e(existing, incoming) {
|
|
728
|
+
const existing_id = existing.id;
|
|
729
|
+
const incoming_id = incoming.id;
|
|
730
|
+
// if at least one of these optionals is defined
|
|
731
|
+
if (existing_id !== undefined || incoming_id !== undefined) {
|
|
732
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
733
|
+
// not equal
|
|
734
|
+
if (existing_id === undefined || incoming_id === undefined) {
|
|
735
|
+
return false;
|
|
736
|
+
}
|
|
737
|
+
if (!(existing_id === incoming_id)) {
|
|
738
|
+
return false;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
const existing_name = existing.name;
|
|
742
|
+
const incoming_name = incoming.name;
|
|
743
|
+
if (!(existing_name === incoming_name)) {
|
|
744
|
+
return false;
|
|
745
|
+
}
|
|
746
|
+
const existing_usageType = existing.usageType;
|
|
747
|
+
const incoming_usageType = incoming.usageType;
|
|
748
|
+
if (!(existing_usageType === incoming_usageType)) {
|
|
749
|
+
return false;
|
|
750
|
+
}
|
|
751
|
+
return true;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
const TTL$5 = 30000;
|
|
755
|
+
const VERSION$d = "6f04ab6a782443d237ece40b87b8d756";
|
|
756
|
+
function validate$e(obj, path = 'ClauseCategoriesResponse') {
|
|
757
|
+
const v_error = (() => {
|
|
758
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
759
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
760
|
+
}
|
|
761
|
+
const obj_clauseCategories = obj.clauseCategories;
|
|
762
|
+
const path_clauseCategories = path + '.clauseCategories';
|
|
763
|
+
if (!ArrayIsArray(obj_clauseCategories)) {
|
|
764
|
+
return new TypeError('Expected "array" but received "' + typeof obj_clauseCategories + '" (at "' + path_clauseCategories + '")');
|
|
765
|
+
}
|
|
766
|
+
for (let i = 0; i < obj_clauseCategories.length; i++) {
|
|
767
|
+
const obj_clauseCategories_item = obj_clauseCategories[i];
|
|
768
|
+
const path_clauseCategories_item = path_clauseCategories + '[' + i + ']';
|
|
769
|
+
const referencepath_clauseCategories_itemValidationError = validate$f(obj_clauseCategories_item, path_clauseCategories_item);
|
|
770
|
+
if (referencepath_clauseCategories_itemValidationError !== null) {
|
|
771
|
+
let message = 'Object doesn\'t match ClauseCategoryResponse (at "' + path_clauseCategories_item + '")\n';
|
|
772
|
+
message += referencepath_clauseCategories_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
773
|
+
return new TypeError(message);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
})();
|
|
777
|
+
return v_error === undefined ? null : v_error;
|
|
778
|
+
}
|
|
779
|
+
const RepresentationType$7 = 'ClauseCategoriesResponse';
|
|
780
|
+
function normalize$7(input, existing, path, luvio, store, timestamp) {
|
|
781
|
+
return input;
|
|
782
|
+
}
|
|
783
|
+
const select$l = function ClauseCategoriesResponseSelect() {
|
|
784
|
+
const { selections: ClauseCategoryResponse__selections, opaque: ClauseCategoryResponse__opaque, } = select$m();
|
|
785
|
+
return {
|
|
786
|
+
kind: 'Fragment',
|
|
787
|
+
version: VERSION$d,
|
|
788
|
+
private: [],
|
|
789
|
+
selections: [
|
|
790
|
+
{
|
|
791
|
+
name: 'clauseCategories',
|
|
792
|
+
kind: 'Object',
|
|
793
|
+
plural: true,
|
|
794
|
+
selections: ClauseCategoryResponse__selections
|
|
795
|
+
}
|
|
796
|
+
]
|
|
797
|
+
};
|
|
798
|
+
};
|
|
799
|
+
function equals$d(existing, incoming) {
|
|
800
|
+
const existing_clauseCategories = existing.clauseCategories;
|
|
801
|
+
const incoming_clauseCategories = incoming.clauseCategories;
|
|
802
|
+
const equals_clauseCategories_items = equalsArray(existing_clauseCategories, incoming_clauseCategories, (existing_clauseCategories_item, incoming_clauseCategories_item) => {
|
|
803
|
+
if (!(equals$e(existing_clauseCategories_item, incoming_clauseCategories_item))) {
|
|
804
|
+
return false;
|
|
805
|
+
}
|
|
806
|
+
});
|
|
807
|
+
if (equals_clauseCategories_items === false) {
|
|
808
|
+
return false;
|
|
809
|
+
}
|
|
810
|
+
return true;
|
|
811
|
+
}
|
|
812
|
+
const ingest$7 = function ClauseCategoriesResponseIngest(input, path, luvio, store, timestamp) {
|
|
813
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
814
|
+
const validateError = validate$e(input);
|
|
815
|
+
if (validateError !== null) {
|
|
816
|
+
throw validateError;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
const key = path.fullPath;
|
|
820
|
+
const existingRecord = store.readEntry(key);
|
|
821
|
+
const ttlToUse = TTL$5;
|
|
822
|
+
let incomingRecord = normalize$7(input, store.readEntry(key), {
|
|
823
|
+
fullPath: key,
|
|
824
|
+
parent: path.parent,
|
|
825
|
+
propertyName: path.propertyName,
|
|
826
|
+
ttl: ttlToUse
|
|
827
|
+
});
|
|
828
|
+
if (existingRecord === undefined || equals$d(existingRecord, incomingRecord) === false) {
|
|
829
|
+
luvio.storePublish(key, incomingRecord);
|
|
830
|
+
}
|
|
831
|
+
{
|
|
832
|
+
const storeMetadataParams = {
|
|
833
|
+
ttl: ttlToUse,
|
|
834
|
+
namespace: "docgen",
|
|
835
|
+
version: VERSION$d,
|
|
836
|
+
representationName: RepresentationType$7,
|
|
837
|
+
};
|
|
838
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
839
|
+
}
|
|
840
|
+
return createLink(key);
|
|
841
|
+
};
|
|
842
|
+
function getTypeCacheKeys$7(luvio, input, fullPathFactory) {
|
|
843
|
+
const rootKeySet = new StoreKeyMap();
|
|
844
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
845
|
+
const rootKey = fullPathFactory();
|
|
846
|
+
rootKeySet.set(rootKey, {
|
|
847
|
+
namespace: keyPrefix,
|
|
848
|
+
representationName: RepresentationType$7,
|
|
849
|
+
mergeable: false
|
|
850
|
+
});
|
|
851
|
+
return rootKeySet;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
function select$k(luvio, params) {
|
|
855
|
+
return select$l();
|
|
856
|
+
}
|
|
857
|
+
function keyBuilder$d(luvio, params) {
|
|
858
|
+
return keyPrefix + '::ClauseCategoriesResponse:(' + 'id:' + params.queryParams.id + ',' + 'name:' + params.queryParams.name + ',' + 'usageType:' + params.queryParams.usageType + ')';
|
|
859
|
+
}
|
|
860
|
+
function getResponseCacheKeys$7(luvio, resourceParams, response) {
|
|
861
|
+
return getTypeCacheKeys$7(luvio, response, () => keyBuilder$d(luvio, resourceParams));
|
|
862
|
+
}
|
|
863
|
+
function ingestSuccess$7(luvio, resourceParams, response, snapshotRefresh) {
|
|
864
|
+
const { body } = response;
|
|
865
|
+
const key = keyBuilder$d(luvio, resourceParams);
|
|
866
|
+
luvio.storeIngest(key, ingest$7, body);
|
|
867
|
+
const snapshot = luvio.storeLookup({
|
|
868
|
+
recordId: key,
|
|
869
|
+
node: select$k(),
|
|
870
|
+
variables: {},
|
|
871
|
+
}, snapshotRefresh);
|
|
872
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
873
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
874
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
return snapshot;
|
|
878
|
+
}
|
|
879
|
+
function ingestError$5(luvio, params, error, snapshotRefresh) {
|
|
880
|
+
const key = keyBuilder$d(luvio, params);
|
|
881
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
882
|
+
const storeMetadataParams = {
|
|
883
|
+
ttl: TTL$5,
|
|
884
|
+
namespace: keyPrefix,
|
|
885
|
+
version: VERSION$d,
|
|
886
|
+
representationName: RepresentationType$7
|
|
887
|
+
};
|
|
888
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
889
|
+
return errorSnapshot;
|
|
890
|
+
}
|
|
891
|
+
function createResourceRequest$7(config) {
|
|
892
|
+
const headers = {};
|
|
893
|
+
return {
|
|
894
|
+
baseUri: '/services/data/v58.0',
|
|
895
|
+
basePath: '/connect/clause-library/clause-category-configurations',
|
|
896
|
+
method: 'get',
|
|
897
|
+
body: null,
|
|
898
|
+
urlParams: {},
|
|
899
|
+
queryParams: config.queryParams,
|
|
900
|
+
headers,
|
|
901
|
+
priority: 'normal',
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
const getDocumentClauseSetCategories_ConfigPropertyNames = {
|
|
906
|
+
displayName: 'getDocumentClauseSetCategories',
|
|
907
|
+
parameters: {
|
|
908
|
+
required: [],
|
|
909
|
+
optional: ['id', 'name', 'usageType']
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
function createResourceParams$7(config) {
|
|
913
|
+
const resourceParams = {
|
|
914
|
+
queryParams: {
|
|
915
|
+
id: config.id, name: config.name, usageType: config.usageType
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
return resourceParams;
|
|
919
|
+
}
|
|
920
|
+
function keyBuilder$c(luvio, config) {
|
|
921
|
+
const resourceParams = createResourceParams$7(config);
|
|
922
|
+
return keyBuilder$d(luvio, resourceParams);
|
|
923
|
+
}
|
|
924
|
+
function typeCheckConfig$7(untrustedConfig) {
|
|
925
|
+
const config = {};
|
|
926
|
+
const untrustedConfig_id = untrustedConfig.id;
|
|
927
|
+
if (typeof untrustedConfig_id === 'string') {
|
|
928
|
+
config.id = untrustedConfig_id;
|
|
929
|
+
}
|
|
930
|
+
const untrustedConfig_name = untrustedConfig.name;
|
|
931
|
+
if (typeof untrustedConfig_name === 'string') {
|
|
932
|
+
config.name = untrustedConfig_name;
|
|
933
|
+
}
|
|
934
|
+
const untrustedConfig_usageType = untrustedConfig.usageType;
|
|
935
|
+
if (typeof untrustedConfig_usageType === 'string') {
|
|
936
|
+
config.usageType = untrustedConfig_usageType;
|
|
937
|
+
}
|
|
938
|
+
return config;
|
|
939
|
+
}
|
|
940
|
+
function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
|
|
941
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
942
|
+
return null;
|
|
943
|
+
}
|
|
944
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
945
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
946
|
+
}
|
|
947
|
+
const config = typeCheckConfig$7(untrustedConfig);
|
|
948
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
949
|
+
return null;
|
|
950
|
+
}
|
|
951
|
+
return config;
|
|
952
|
+
}
|
|
953
|
+
function adapterFragment$5(luvio, config) {
|
|
954
|
+
createResourceParams$7(config);
|
|
955
|
+
return select$k();
|
|
956
|
+
}
|
|
957
|
+
function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
|
|
958
|
+
const snapshot = ingestSuccess$7(luvio, resourceParams, response, {
|
|
959
|
+
config,
|
|
960
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
961
|
+
});
|
|
962
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
963
|
+
}
|
|
964
|
+
function onFetchResponseError$5(luvio, config, resourceParams, response) {
|
|
965
|
+
const snapshot = ingestError$5(luvio, resourceParams, response, {
|
|
966
|
+
config,
|
|
967
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
968
|
+
});
|
|
969
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
970
|
+
}
|
|
971
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
972
|
+
const resourceParams = createResourceParams$7(config);
|
|
973
|
+
const request = createResourceRequest$7(resourceParams);
|
|
974
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
975
|
+
.then((response) => {
|
|
976
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => getResponseCacheKeys$7(luvio, resourceParams, response.body));
|
|
977
|
+
}, (response) => {
|
|
978
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
|
|
979
|
+
});
|
|
980
|
+
}
|
|
981
|
+
function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
|
|
982
|
+
const { luvio, config } = context;
|
|
983
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
984
|
+
const dispatchOptions = {
|
|
985
|
+
resourceRequestContext: {
|
|
986
|
+
requestCorrelator,
|
|
987
|
+
luvioRequestMethod: undefined,
|
|
988
|
+
},
|
|
989
|
+
eventObservers
|
|
990
|
+
};
|
|
991
|
+
if (networkPriority !== 'normal') {
|
|
992
|
+
dispatchOptions.overrides = {
|
|
993
|
+
priority: networkPriority
|
|
994
|
+
};
|
|
995
|
+
}
|
|
996
|
+
return buildNetworkSnapshot$7(luvio, config, dispatchOptions);
|
|
997
|
+
}
|
|
998
|
+
function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
|
|
999
|
+
const { luvio, config } = context;
|
|
1000
|
+
const selector = {
|
|
1001
|
+
recordId: keyBuilder$c(luvio, config),
|
|
1002
|
+
node: adapterFragment$5(luvio, config),
|
|
1003
|
+
variables: {},
|
|
1004
|
+
};
|
|
1005
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1006
|
+
config,
|
|
1007
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
1008
|
+
});
|
|
1009
|
+
return cacheSnapshot;
|
|
1010
|
+
}
|
|
1011
|
+
const getDocumentClauseSetCategoriesAdapterFactory = (luvio) => function docgen__getDocumentClauseSetCategories(untrustedConfig, requestContext) {
|
|
1012
|
+
const config = validateAdapterConfig$7(untrustedConfig, getDocumentClauseSetCategories_ConfigPropertyNames);
|
|
1013
|
+
// Invalid or incomplete config
|
|
1014
|
+
if (config === null) {
|
|
1015
|
+
return null;
|
|
1016
|
+
}
|
|
1017
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1018
|
+
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
|
|
1019
|
+
};
|
|
1020
|
+
|
|
1021
|
+
const VERSION$c = "29a9e61a0952cff8f7e98cc7d8857c62";
|
|
1022
|
+
function validate$d(obj, path = 'DocumentClauseSetResponse') {
|
|
1023
|
+
const v_error = (() => {
|
|
1024
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1025
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1026
|
+
}
|
|
1027
|
+
const obj_category = obj.category;
|
|
1028
|
+
const path_category = path + '.category';
|
|
1029
|
+
if (typeof obj_category !== 'string') {
|
|
1030
|
+
return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
|
|
1031
|
+
}
|
|
1032
|
+
const obj_categoryName = obj.categoryName;
|
|
1033
|
+
const path_categoryName = path + '.categoryName';
|
|
1034
|
+
if (typeof obj_categoryName !== 'string') {
|
|
1035
|
+
return new TypeError('Expected "string" but received "' + typeof obj_categoryName + '" (at "' + path_categoryName + '")');
|
|
1036
|
+
}
|
|
1037
|
+
const obj_defaultLanguage = obj.defaultLanguage;
|
|
1038
|
+
const path_defaultLanguage = path + '.defaultLanguage';
|
|
1039
|
+
if (typeof obj_defaultLanguage !== 'string') {
|
|
1040
|
+
return new TypeError('Expected "string" but received "' + typeof obj_defaultLanguage + '" (at "' + path_defaultLanguage + '")');
|
|
1041
|
+
}
|
|
1042
|
+
const obj_id = obj.id;
|
|
1043
|
+
const path_id = path + '.id';
|
|
1044
|
+
if (typeof obj_id !== 'string') {
|
|
1045
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1046
|
+
}
|
|
1047
|
+
const obj_name = obj.name;
|
|
1048
|
+
const path_name = path + '.name';
|
|
1049
|
+
if (typeof obj_name !== 'string') {
|
|
1050
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1051
|
+
}
|
|
1052
|
+
const obj_status = obj.status;
|
|
1053
|
+
const path_status = path + '.status';
|
|
1054
|
+
if (typeof obj_status !== 'string') {
|
|
1055
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1056
|
+
}
|
|
1057
|
+
})();
|
|
1058
|
+
return v_error === undefined ? null : v_error;
|
|
1059
|
+
}
|
|
1060
|
+
const select$j = function DocumentClauseSetResponseSelect() {
|
|
1061
|
+
return {
|
|
1062
|
+
kind: 'Fragment',
|
|
1063
|
+
version: VERSION$c,
|
|
1064
|
+
private: [],
|
|
1065
|
+
selections: [
|
|
1066
|
+
{
|
|
1067
|
+
name: 'category',
|
|
1068
|
+
kind: 'Scalar'
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
name: 'categoryName',
|
|
1072
|
+
kind: 'Scalar'
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
name: 'defaultLanguage',
|
|
1076
|
+
kind: 'Scalar'
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
name: 'id',
|
|
1080
|
+
kind: 'Scalar'
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
name: 'name',
|
|
1084
|
+
kind: 'Scalar'
|
|
1085
|
+
},
|
|
1086
|
+
{
|
|
1087
|
+
name: 'status',
|
|
1088
|
+
kind: 'Scalar'
|
|
1089
|
+
}
|
|
1090
|
+
]
|
|
1091
|
+
};
|
|
1092
|
+
};
|
|
1093
|
+
function equals$c(existing, incoming) {
|
|
1094
|
+
const existing_category = existing.category;
|
|
1095
|
+
const incoming_category = incoming.category;
|
|
1096
|
+
if (!(existing_category === incoming_category)) {
|
|
1097
|
+
return false;
|
|
1098
|
+
}
|
|
1099
|
+
const existing_categoryName = existing.categoryName;
|
|
1100
|
+
const incoming_categoryName = incoming.categoryName;
|
|
1101
|
+
if (!(existing_categoryName === incoming_categoryName)) {
|
|
1102
|
+
return false;
|
|
1103
|
+
}
|
|
1104
|
+
const existing_defaultLanguage = existing.defaultLanguage;
|
|
1105
|
+
const incoming_defaultLanguage = incoming.defaultLanguage;
|
|
1106
|
+
if (!(existing_defaultLanguage === incoming_defaultLanguage)) {
|
|
1107
|
+
return false;
|
|
1108
|
+
}
|
|
1109
|
+
const existing_id = existing.id;
|
|
1110
|
+
const incoming_id = incoming.id;
|
|
1111
|
+
if (!(existing_id === incoming_id)) {
|
|
1112
|
+
return false;
|
|
1113
|
+
}
|
|
1114
|
+
const existing_name = existing.name;
|
|
1115
|
+
const incoming_name = incoming.name;
|
|
1116
|
+
if (!(existing_name === incoming_name)) {
|
|
1117
|
+
return false;
|
|
1118
|
+
}
|
|
1119
|
+
const existing_status = existing.status;
|
|
1120
|
+
const incoming_status = incoming.status;
|
|
1121
|
+
if (!(existing_status === incoming_status)) {
|
|
1122
|
+
return false;
|
|
1123
|
+
}
|
|
1124
|
+
return true;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
const TTL$4 = 100;
|
|
1128
|
+
const VERSION$b = "c6ad1fbdbd4d8cd718a8a62c63216687";
|
|
1129
|
+
function validate$c(obj, path = 'DocumentClauseSetListResponse') {
|
|
1130
|
+
const v_error = (() => {
|
|
1131
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1132
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1133
|
+
}
|
|
1134
|
+
const obj_documentClauseSets = obj.documentClauseSets;
|
|
1135
|
+
const path_documentClauseSets = path + '.documentClauseSets';
|
|
1136
|
+
if (!ArrayIsArray(obj_documentClauseSets)) {
|
|
1137
|
+
return new TypeError('Expected "array" but received "' + typeof obj_documentClauseSets + '" (at "' + path_documentClauseSets + '")');
|
|
1138
|
+
}
|
|
1139
|
+
for (let i = 0; i < obj_documentClauseSets.length; i++) {
|
|
1140
|
+
const obj_documentClauseSets_item = obj_documentClauseSets[i];
|
|
1141
|
+
const path_documentClauseSets_item = path_documentClauseSets + '[' + i + ']';
|
|
1142
|
+
const referencepath_documentClauseSets_itemValidationError = validate$d(obj_documentClauseSets_item, path_documentClauseSets_item);
|
|
1143
|
+
if (referencepath_documentClauseSets_itemValidationError !== null) {
|
|
1144
|
+
let message = 'Object doesn\'t match DocumentClauseSetResponse (at "' + path_documentClauseSets_item + '")\n';
|
|
1145
|
+
message += referencepath_documentClauseSets_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1146
|
+
return new TypeError(message);
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
})();
|
|
1150
|
+
return v_error === undefined ? null : v_error;
|
|
1151
|
+
}
|
|
1152
|
+
const RepresentationType$6 = 'DocumentClauseSetListResponse';
|
|
1153
|
+
function normalize$6(input, existing, path, luvio, store, timestamp) {
|
|
1154
|
+
return input;
|
|
1155
|
+
}
|
|
1156
|
+
const select$i = function DocumentClauseSetListResponseSelect() {
|
|
1157
|
+
const { selections: DocumentClauseSetResponse__selections, opaque: DocumentClauseSetResponse__opaque, } = select$j();
|
|
1158
|
+
return {
|
|
1159
|
+
kind: 'Fragment',
|
|
1160
|
+
version: VERSION$b,
|
|
1161
|
+
private: [],
|
|
1162
|
+
selections: [
|
|
1163
|
+
{
|
|
1164
|
+
name: 'documentClauseSets',
|
|
1165
|
+
kind: 'Object',
|
|
1166
|
+
plural: true,
|
|
1167
|
+
selections: DocumentClauseSetResponse__selections
|
|
1168
|
+
}
|
|
1169
|
+
]
|
|
1170
|
+
};
|
|
1171
|
+
};
|
|
1172
|
+
function equals$b(existing, incoming) {
|
|
1173
|
+
const existing_documentClauseSets = existing.documentClauseSets;
|
|
1174
|
+
const incoming_documentClauseSets = incoming.documentClauseSets;
|
|
1175
|
+
const equals_documentClauseSets_items = equalsArray(existing_documentClauseSets, incoming_documentClauseSets, (existing_documentClauseSets_item, incoming_documentClauseSets_item) => {
|
|
1176
|
+
if (!(equals$c(existing_documentClauseSets_item, incoming_documentClauseSets_item))) {
|
|
1177
|
+
return false;
|
|
1178
|
+
}
|
|
1179
|
+
});
|
|
1180
|
+
if (equals_documentClauseSets_items === false) {
|
|
1181
|
+
return false;
|
|
1182
|
+
}
|
|
1183
|
+
return true;
|
|
1184
|
+
}
|
|
1185
|
+
const ingest$6 = function DocumentClauseSetListResponseIngest(input, path, luvio, store, timestamp) {
|
|
1186
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1187
|
+
const validateError = validate$c(input);
|
|
1188
|
+
if (validateError !== null) {
|
|
1189
|
+
throw validateError;
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
const key = path.fullPath;
|
|
1193
|
+
const existingRecord = store.readEntry(key);
|
|
1194
|
+
const ttlToUse = TTL$4;
|
|
1195
|
+
let incomingRecord = normalize$6(input, store.readEntry(key), {
|
|
1196
|
+
fullPath: key,
|
|
1197
|
+
parent: path.parent,
|
|
1198
|
+
propertyName: path.propertyName,
|
|
1199
|
+
ttl: ttlToUse
|
|
1200
|
+
});
|
|
1201
|
+
if (existingRecord === undefined || equals$b(existingRecord, incomingRecord) === false) {
|
|
1202
|
+
luvio.storePublish(key, incomingRecord);
|
|
1203
|
+
}
|
|
1204
|
+
{
|
|
1205
|
+
const storeMetadataParams = {
|
|
1206
|
+
ttl: ttlToUse,
|
|
1207
|
+
namespace: "docgen",
|
|
1208
|
+
version: VERSION$b,
|
|
1209
|
+
representationName: RepresentationType$6,
|
|
1210
|
+
};
|
|
1211
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1212
|
+
}
|
|
1213
|
+
return createLink(key);
|
|
1214
|
+
};
|
|
1215
|
+
function getTypeCacheKeys$6(luvio, input, fullPathFactory) {
|
|
1216
|
+
const rootKeySet = new StoreKeyMap();
|
|
1217
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1218
|
+
const rootKey = fullPathFactory();
|
|
1219
|
+
rootKeySet.set(rootKey, {
|
|
1220
|
+
namespace: keyPrefix,
|
|
1221
|
+
representationName: RepresentationType$6,
|
|
1222
|
+
mergeable: false
|
|
1223
|
+
});
|
|
1224
|
+
return rootKeySet;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
function select$h(luvio, params) {
|
|
1228
|
+
return select$i();
|
|
1229
|
+
}
|
|
1230
|
+
function keyBuilder$b(luvio, params) {
|
|
1231
|
+
return keyPrefix + '::DocumentClauseSetListResponse:(' + 'category:' + params.queryParams.category + ',' + 'defaultLanguage:' + params.queryParams.defaultLanguage + ',' + 'limit:' + params.queryParams.limit + ',' + 'name:' + params.queryParams.name + ',' + 'offset:' + params.queryParams.offset + ',' + 'status:' + params.queryParams.status + ')';
|
|
1232
|
+
}
|
|
1233
|
+
function getResponseCacheKeys$6(luvio, resourceParams, response) {
|
|
1234
|
+
return getTypeCacheKeys$6(luvio, response, () => keyBuilder$b(luvio, resourceParams));
|
|
1235
|
+
}
|
|
1236
|
+
function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
1237
|
+
const { body } = response;
|
|
1238
|
+
const key = keyBuilder$b(luvio, resourceParams);
|
|
1239
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
1240
|
+
const snapshot = luvio.storeLookup({
|
|
1241
|
+
recordId: key,
|
|
1242
|
+
node: select$h(),
|
|
1243
|
+
variables: {},
|
|
1244
|
+
}, snapshotRefresh);
|
|
1245
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1246
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1247
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
return snapshot;
|
|
1251
|
+
}
|
|
1252
|
+
function ingestError$4(luvio, params, error, snapshotRefresh) {
|
|
1253
|
+
const key = keyBuilder$b(luvio, params);
|
|
1254
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1255
|
+
const storeMetadataParams = {
|
|
1256
|
+
ttl: TTL$4,
|
|
1257
|
+
namespace: keyPrefix,
|
|
1258
|
+
version: VERSION$b,
|
|
1259
|
+
representationName: RepresentationType$6
|
|
1260
|
+
};
|
|
1261
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1262
|
+
return errorSnapshot;
|
|
1263
|
+
}
|
|
1264
|
+
function createResourceRequest$6(config) {
|
|
1265
|
+
const headers = {};
|
|
1266
|
+
return {
|
|
1267
|
+
baseUri: '/services/data/v58.0',
|
|
1268
|
+
basePath: '/connect/clause-library/document-clause-sets',
|
|
1269
|
+
method: 'get',
|
|
1270
|
+
body: null,
|
|
1271
|
+
urlParams: {},
|
|
1272
|
+
queryParams: config.queryParams,
|
|
1273
|
+
headers,
|
|
1274
|
+
priority: 'normal',
|
|
1275
|
+
};
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
const getDocumentClauseSets_ConfigPropertyNames = {
|
|
1279
|
+
displayName: 'getDocumentClauseSets',
|
|
1280
|
+
parameters: {
|
|
1281
|
+
required: [],
|
|
1282
|
+
optional: ['category', 'defaultLanguage', 'limit', 'name', 'offset', 'status']
|
|
1283
|
+
}
|
|
1284
|
+
};
|
|
1285
|
+
function createResourceParams$6(config) {
|
|
1286
|
+
const resourceParams = {
|
|
1287
|
+
queryParams: {
|
|
1288
|
+
category: config.category, defaultLanguage: config.defaultLanguage, limit: config.limit, name: config.name, offset: config.offset, status: config.status
|
|
1289
|
+
}
|
|
1290
|
+
};
|
|
1291
|
+
return resourceParams;
|
|
1292
|
+
}
|
|
1293
|
+
function keyBuilder$a(luvio, config) {
|
|
1294
|
+
const resourceParams = createResourceParams$6(config);
|
|
1295
|
+
return keyBuilder$b(luvio, resourceParams);
|
|
1296
|
+
}
|
|
1297
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
1298
|
+
const config = {};
|
|
1299
|
+
const untrustedConfig_category = untrustedConfig.category;
|
|
1300
|
+
if (typeof untrustedConfig_category === 'string') {
|
|
1301
|
+
config.category = untrustedConfig_category;
|
|
1302
|
+
}
|
|
1303
|
+
const untrustedConfig_defaultLanguage = untrustedConfig.defaultLanguage;
|
|
1304
|
+
if (typeof untrustedConfig_defaultLanguage === 'string') {
|
|
1305
|
+
config.defaultLanguage = untrustedConfig_defaultLanguage;
|
|
1306
|
+
}
|
|
1307
|
+
const untrustedConfig_limit = untrustedConfig.limit;
|
|
1308
|
+
if (typeof untrustedConfig_limit === 'number' && Math.floor(untrustedConfig_limit) === untrustedConfig_limit) {
|
|
1309
|
+
config.limit = untrustedConfig_limit;
|
|
1310
|
+
}
|
|
1311
|
+
const untrustedConfig_name = untrustedConfig.name;
|
|
1312
|
+
if (typeof untrustedConfig_name === 'string') {
|
|
1313
|
+
config.name = untrustedConfig_name;
|
|
1314
|
+
}
|
|
1315
|
+
const untrustedConfig_offset = untrustedConfig.offset;
|
|
1316
|
+
if (typeof untrustedConfig_offset === 'number' && Math.floor(untrustedConfig_offset) === untrustedConfig_offset) {
|
|
1317
|
+
config.offset = untrustedConfig_offset;
|
|
1318
|
+
}
|
|
1319
|
+
const untrustedConfig_status = untrustedConfig.status;
|
|
1320
|
+
if (typeof untrustedConfig_status === 'string') {
|
|
1321
|
+
config.status = untrustedConfig_status;
|
|
1322
|
+
}
|
|
1323
|
+
return config;
|
|
1324
|
+
}
|
|
1325
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
1326
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1327
|
+
return null;
|
|
1328
|
+
}
|
|
1329
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1330
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1331
|
+
}
|
|
1332
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
1333
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1334
|
+
return null;
|
|
1335
|
+
}
|
|
1336
|
+
return config;
|
|
1337
|
+
}
|
|
1338
|
+
function adapterFragment$4(luvio, config) {
|
|
1339
|
+
createResourceParams$6(config);
|
|
1340
|
+
return select$h();
|
|
1341
|
+
}
|
|
1342
|
+
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
1343
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
|
|
1344
|
+
config,
|
|
1345
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
1346
|
+
});
|
|
1347
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1348
|
+
}
|
|
1349
|
+
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
1350
|
+
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
1351
|
+
config,
|
|
1352
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
1353
|
+
});
|
|
1354
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1355
|
+
}
|
|
1356
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
1357
|
+
const resourceParams = createResourceParams$6(config);
|
|
1358
|
+
const request = createResourceRequest$6(resourceParams);
|
|
1359
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1360
|
+
.then((response) => {
|
|
1361
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => getResponseCacheKeys$6(luvio, resourceParams, response.body));
|
|
1362
|
+
}, (response) => {
|
|
1363
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
1367
|
+
const { luvio, config } = context;
|
|
1368
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
1369
|
+
const dispatchOptions = {
|
|
1370
|
+
resourceRequestContext: {
|
|
1371
|
+
requestCorrelator,
|
|
1372
|
+
luvioRequestMethod: undefined,
|
|
1373
|
+
},
|
|
1374
|
+
eventObservers
|
|
1375
|
+
};
|
|
1376
|
+
if (networkPriority !== 'normal') {
|
|
1377
|
+
dispatchOptions.overrides = {
|
|
1378
|
+
priority: networkPriority
|
|
1379
|
+
};
|
|
1380
|
+
}
|
|
1381
|
+
return buildNetworkSnapshot$6(luvio, config, dispatchOptions);
|
|
1382
|
+
}
|
|
1383
|
+
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
1384
|
+
const { luvio, config } = context;
|
|
1385
|
+
const selector = {
|
|
1386
|
+
recordId: keyBuilder$a(luvio, config),
|
|
1387
|
+
node: adapterFragment$4(luvio, config),
|
|
1388
|
+
variables: {},
|
|
1389
|
+
};
|
|
1390
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1391
|
+
config,
|
|
1392
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
1393
|
+
});
|
|
1394
|
+
return cacheSnapshot;
|
|
1395
|
+
}
|
|
1396
|
+
const getDocumentClauseSetsAdapterFactory = (luvio) => function docgen__getDocumentClauseSets(untrustedConfig, requestContext) {
|
|
1397
|
+
const config = validateAdapterConfig$6(untrustedConfig, getDocumentClauseSets_ConfigPropertyNames);
|
|
1398
|
+
// Invalid or incomplete config
|
|
1399
|
+
if (config === null) {
|
|
1400
|
+
return null;
|
|
1401
|
+
}
|
|
1402
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1403
|
+
buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
|
|
1404
|
+
};
|
|
1405
|
+
|
|
1406
|
+
const VERSION$a = "0bb7df7b5d24fd4c03e5515621a5ad3c";
|
|
1407
|
+
function validate$b(obj, path = 'DocumentResponse') {
|
|
1408
|
+
const v_error = (() => {
|
|
1409
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1410
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1411
|
+
}
|
|
1412
|
+
if (obj.additionalFields !== undefined) {
|
|
1413
|
+
const obj_additionalFields = obj.additionalFields;
|
|
1414
|
+
const path_additionalFields = path + '.additionalFields';
|
|
1415
|
+
if (typeof obj_additionalFields !== 'object' || ArrayIsArray(obj_additionalFields) || obj_additionalFields === null) {
|
|
1416
|
+
return new TypeError('Expected "object" but received "' + typeof obj_additionalFields + '" (at "' + path_additionalFields + '")');
|
|
1417
|
+
}
|
|
1418
|
+
const obj_additionalFields_keys = ObjectKeys(obj_additionalFields);
|
|
1419
|
+
for (let i = 0; i < obj_additionalFields_keys.length; i++) {
|
|
1420
|
+
const key = obj_additionalFields_keys[i];
|
|
1421
|
+
const obj_additionalFields_prop = obj_additionalFields[key];
|
|
1422
|
+
const path_additionalFields_prop = path_additionalFields + '["' + key + '"]';
|
|
1423
|
+
if (typeof obj_additionalFields_prop !== 'string') {
|
|
1424
|
+
return new TypeError('Expected "string" but received "' + typeof obj_additionalFields_prop + '" (at "' + path_additionalFields_prop + '")');
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
if (obj.fileExtension !== undefined) {
|
|
1429
|
+
const obj_fileExtension = obj.fileExtension;
|
|
1430
|
+
const path_fileExtension = path + '.fileExtension';
|
|
1431
|
+
if (typeof obj_fileExtension !== 'string') {
|
|
1432
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fileExtension + '" (at "' + path_fileExtension + '")');
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
if (obj.name !== undefined) {
|
|
1436
|
+
const obj_name = obj.name;
|
|
1437
|
+
const path_name = path + '.name';
|
|
1438
|
+
if (typeof obj_name !== 'string') {
|
|
1439
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
if (obj.sourceId !== undefined) {
|
|
1443
|
+
const obj_sourceId = obj.sourceId;
|
|
1444
|
+
const path_sourceId = path + '.sourceId';
|
|
1445
|
+
if (typeof obj_sourceId !== 'string') {
|
|
1446
|
+
return new TypeError('Expected "string" but received "' + typeof obj_sourceId + '" (at "' + path_sourceId + '")');
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
if (obj.sourceType !== undefined) {
|
|
1450
|
+
const obj_sourceType = obj.sourceType;
|
|
1451
|
+
const path_sourceType = path + '.sourceType';
|
|
1452
|
+
if (typeof obj_sourceType !== 'string') {
|
|
1453
|
+
return new TypeError('Expected "string" but received "' + typeof obj_sourceType + '" (at "' + path_sourceType + '")');
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
})();
|
|
1457
|
+
return v_error === undefined ? null : v_error;
|
|
1458
|
+
}
|
|
1459
|
+
const select$g = function DocumentResponseSelect() {
|
|
1460
|
+
return {
|
|
1461
|
+
kind: 'Fragment',
|
|
1462
|
+
version: VERSION$a,
|
|
1463
|
+
private: [],
|
|
1464
|
+
selections: [
|
|
1465
|
+
{
|
|
1466
|
+
name: 'additionalFields',
|
|
1467
|
+
kind: 'Scalar',
|
|
1468
|
+
map: true,
|
|
1469
|
+
required: false
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
name: 'fileExtension',
|
|
1473
|
+
kind: 'Scalar',
|
|
1474
|
+
required: false
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
name: 'name',
|
|
1478
|
+
kind: 'Scalar',
|
|
1479
|
+
required: false
|
|
1480
|
+
},
|
|
1481
|
+
{
|
|
1482
|
+
name: 'sourceId',
|
|
1483
|
+
kind: 'Scalar',
|
|
1484
|
+
required: false
|
|
1485
|
+
},
|
|
1486
|
+
{
|
|
1487
|
+
name: 'sourceType',
|
|
1488
|
+
kind: 'Scalar',
|
|
1489
|
+
required: false
|
|
1490
|
+
}
|
|
1491
|
+
]
|
|
1492
|
+
};
|
|
1493
|
+
};
|
|
1494
|
+
function equals$a(existing, incoming) {
|
|
1495
|
+
const existing_fileExtension = existing.fileExtension;
|
|
1496
|
+
const incoming_fileExtension = incoming.fileExtension;
|
|
1497
|
+
// if at least one of these optionals is defined
|
|
1498
|
+
if (existing_fileExtension !== undefined || incoming_fileExtension !== undefined) {
|
|
1499
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1500
|
+
// not equal
|
|
1501
|
+
if (existing_fileExtension === undefined || incoming_fileExtension === undefined) {
|
|
1502
|
+
return false;
|
|
1503
|
+
}
|
|
1504
|
+
if (!(existing_fileExtension === incoming_fileExtension)) {
|
|
1505
|
+
return false;
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
const existing_name = existing.name;
|
|
1509
|
+
const incoming_name = incoming.name;
|
|
1510
|
+
// if at least one of these optionals is defined
|
|
1511
|
+
if (existing_name !== undefined || incoming_name !== undefined) {
|
|
1512
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1513
|
+
// not equal
|
|
1514
|
+
if (existing_name === undefined || incoming_name === undefined) {
|
|
1515
|
+
return false;
|
|
1516
|
+
}
|
|
1517
|
+
if (!(existing_name === incoming_name)) {
|
|
1518
|
+
return false;
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
const existing_sourceId = existing.sourceId;
|
|
1522
|
+
const incoming_sourceId = incoming.sourceId;
|
|
1523
|
+
// if at least one of these optionals is defined
|
|
1524
|
+
if (existing_sourceId !== undefined || incoming_sourceId !== undefined) {
|
|
1525
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1526
|
+
// not equal
|
|
1527
|
+
if (existing_sourceId === undefined || incoming_sourceId === undefined) {
|
|
1528
|
+
return false;
|
|
1529
|
+
}
|
|
1530
|
+
if (!(existing_sourceId === incoming_sourceId)) {
|
|
1531
|
+
return false;
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
const existing_sourceType = existing.sourceType;
|
|
1535
|
+
const incoming_sourceType = incoming.sourceType;
|
|
1536
|
+
// if at least one of these optionals is defined
|
|
1537
|
+
if (existing_sourceType !== undefined || incoming_sourceType !== undefined) {
|
|
1538
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1539
|
+
// not equal
|
|
1540
|
+
if (existing_sourceType === undefined || incoming_sourceType === undefined) {
|
|
1541
|
+
return false;
|
|
1542
|
+
}
|
|
1543
|
+
if (!(existing_sourceType === incoming_sourceType)) {
|
|
1544
|
+
return false;
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
const existing_additionalFields = existing.additionalFields;
|
|
1548
|
+
const incoming_additionalFields = incoming.additionalFields;
|
|
1549
|
+
// if at least one of these optionals is defined
|
|
1550
|
+
if (existing_additionalFields !== undefined || incoming_additionalFields !== undefined) {
|
|
1551
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1552
|
+
// not equal
|
|
1553
|
+
if (existing_additionalFields === undefined || incoming_additionalFields === undefined) {
|
|
1554
|
+
return false;
|
|
1555
|
+
}
|
|
1556
|
+
const equals_additionalFields_props = equalsObject(existing_additionalFields, incoming_additionalFields, (existing_additionalFields_prop, incoming_additionalFields_prop) => {
|
|
1557
|
+
if (!(existing_additionalFields_prop === incoming_additionalFields_prop)) {
|
|
1558
|
+
return false;
|
|
1559
|
+
}
|
|
1560
|
+
});
|
|
1561
|
+
if (equals_additionalFields_props === false) {
|
|
1562
|
+
return false;
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
return true;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
const TTL$3 = 60000;
|
|
1569
|
+
const VERSION$9 = "71edf629bc2d90d36d4a1ead41f16a6d";
|
|
1570
|
+
function validate$a(obj, path = 'DocumentListResponse') {
|
|
1571
|
+
const v_error = (() => {
|
|
1572
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1573
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1574
|
+
}
|
|
1575
|
+
if (obj.documents !== undefined) {
|
|
1576
|
+
const obj_documents = obj.documents;
|
|
1577
|
+
const path_documents = path + '.documents';
|
|
1578
|
+
if (!ArrayIsArray(obj_documents)) {
|
|
1579
|
+
return new TypeError('Expected "array" but received "' + typeof obj_documents + '" (at "' + path_documents + '")');
|
|
1580
|
+
}
|
|
1581
|
+
for (let i = 0; i < obj_documents.length; i++) {
|
|
1582
|
+
const obj_documents_item = obj_documents[i];
|
|
1583
|
+
const path_documents_item = path_documents + '[' + i + ']';
|
|
1584
|
+
const referencepath_documents_itemValidationError = validate$b(obj_documents_item, path_documents_item);
|
|
1585
|
+
if (referencepath_documents_itemValidationError !== null) {
|
|
1586
|
+
let message = 'Object doesn\'t match DocumentResponse (at "' + path_documents_item + '")\n';
|
|
1587
|
+
message += referencepath_documents_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1588
|
+
return new TypeError(message);
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
})();
|
|
1593
|
+
return v_error === undefined ? null : v_error;
|
|
1594
|
+
}
|
|
1595
|
+
const RepresentationType$5 = 'DocumentListResponse';
|
|
1596
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
1597
|
+
return input;
|
|
1598
|
+
}
|
|
1599
|
+
const select$f = function DocumentListResponseSelect() {
|
|
1600
|
+
const { selections: DocumentResponse__selections, opaque: DocumentResponse__opaque, } = select$g();
|
|
1601
|
+
return {
|
|
1602
|
+
kind: 'Fragment',
|
|
1603
|
+
version: VERSION$9,
|
|
1604
|
+
private: [],
|
|
1605
|
+
selections: [
|
|
1606
|
+
{
|
|
1607
|
+
name: 'documents',
|
|
1608
|
+
kind: 'Object',
|
|
1609
|
+
plural: true,
|
|
1610
|
+
selections: DocumentResponse__selections,
|
|
1611
|
+
required: false
|
|
1612
|
+
}
|
|
1613
|
+
]
|
|
1614
|
+
};
|
|
1615
|
+
};
|
|
1616
|
+
function equals$9(existing, incoming) {
|
|
1617
|
+
const existing_documents = existing.documents;
|
|
1618
|
+
const incoming_documents = incoming.documents;
|
|
1619
|
+
// if at least one of these optionals is defined
|
|
1620
|
+
if (existing_documents !== undefined || incoming_documents !== undefined) {
|
|
1621
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1622
|
+
// not equal
|
|
1623
|
+
if (existing_documents === undefined || incoming_documents === undefined) {
|
|
1624
|
+
return false;
|
|
1625
|
+
}
|
|
1626
|
+
const equals_documents_items = equalsArray(existing_documents, incoming_documents, (existing_documents_item, incoming_documents_item) => {
|
|
1627
|
+
if (!(equals$a(existing_documents_item, incoming_documents_item))) {
|
|
1628
|
+
return false;
|
|
1629
|
+
}
|
|
1630
|
+
});
|
|
1631
|
+
if (equals_documents_items === false) {
|
|
1632
|
+
return false;
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
return true;
|
|
1636
|
+
}
|
|
1637
|
+
const ingest$5 = function DocumentListResponseIngest(input, path, luvio, store, timestamp) {
|
|
1638
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1639
|
+
const validateError = validate$a(input);
|
|
1640
|
+
if (validateError !== null) {
|
|
1641
|
+
throw validateError;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
const key = path.fullPath;
|
|
1645
|
+
const existingRecord = store.readEntry(key);
|
|
1646
|
+
const ttlToUse = TTL$3;
|
|
1647
|
+
let incomingRecord = normalize$5(input, store.readEntry(key), {
|
|
1648
|
+
fullPath: key,
|
|
1649
|
+
parent: path.parent,
|
|
1650
|
+
propertyName: path.propertyName,
|
|
1651
|
+
ttl: ttlToUse
|
|
1652
|
+
});
|
|
1653
|
+
if (existingRecord === undefined || equals$9(existingRecord, incomingRecord) === false) {
|
|
1654
|
+
luvio.storePublish(key, incomingRecord);
|
|
1655
|
+
}
|
|
1656
|
+
{
|
|
1657
|
+
const storeMetadataParams = {
|
|
1658
|
+
ttl: ttlToUse,
|
|
1659
|
+
namespace: "docgen",
|
|
1660
|
+
version: VERSION$9,
|
|
1661
|
+
representationName: RepresentationType$5,
|
|
1662
|
+
};
|
|
1663
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1664
|
+
}
|
|
1665
|
+
return createLink(key);
|
|
1666
|
+
};
|
|
1667
|
+
function getTypeCacheKeys$5(luvio, input, fullPathFactory) {
|
|
1668
|
+
const rootKeySet = new StoreKeyMap();
|
|
1669
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1670
|
+
const rootKey = fullPathFactory();
|
|
1671
|
+
rootKeySet.set(rootKey, {
|
|
1672
|
+
namespace: keyPrefix,
|
|
1673
|
+
representationName: RepresentationType$5,
|
|
1674
|
+
mergeable: false
|
|
1675
|
+
});
|
|
1676
|
+
return rootKeySet;
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
function select$e(luvio, params) {
|
|
1680
|
+
return select$f();
|
|
1681
|
+
}
|
|
1682
|
+
function keyBuilder$9(luvio, params) {
|
|
1683
|
+
return keyPrefix + '::DocumentListResponse:(' + 'documentSelector:' + params.queryParams.documentSelector + ',' + 'sourceObjectId:' + params.queryParams.sourceObjectId + ')';
|
|
1684
|
+
}
|
|
1685
|
+
function getResponseCacheKeys$5(luvio, resourceParams, response) {
|
|
1686
|
+
return getTypeCacheKeys$5(luvio, response, () => keyBuilder$9(luvio, resourceParams));
|
|
1687
|
+
}
|
|
1688
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
1689
|
+
const { body } = response;
|
|
1690
|
+
const key = keyBuilder$9(luvio, resourceParams);
|
|
1691
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
1692
|
+
const snapshot = luvio.storeLookup({
|
|
1693
|
+
recordId: key,
|
|
1694
|
+
node: select$e(),
|
|
1695
|
+
variables: {},
|
|
1696
|
+
}, snapshotRefresh);
|
|
1697
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1698
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1699
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
return snapshot;
|
|
1703
|
+
}
|
|
1704
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
1705
|
+
const key = keyBuilder$9(luvio, params);
|
|
1706
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1707
|
+
const storeMetadataParams = {
|
|
1708
|
+
ttl: TTL$3,
|
|
1709
|
+
namespace: keyPrefix,
|
|
1710
|
+
version: VERSION$9,
|
|
1711
|
+
representationName: RepresentationType$5
|
|
1712
|
+
};
|
|
1713
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1714
|
+
return errorSnapshot;
|
|
1715
|
+
}
|
|
1716
|
+
function createResourceRequest$5(config) {
|
|
1717
|
+
const headers = {};
|
|
1718
|
+
return {
|
|
1719
|
+
baseUri: '/services/data/v58.0',
|
|
1720
|
+
basePath: '/connect/e-sign/documents',
|
|
1721
|
+
method: 'get',
|
|
1722
|
+
body: null,
|
|
1723
|
+
urlParams: {},
|
|
1724
|
+
queryParams: config.queryParams,
|
|
1725
|
+
headers,
|
|
1726
|
+
priority: 'normal',
|
|
1727
|
+
};
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
const getDocuments_ConfigPropertyNames = {
|
|
1731
|
+
displayName: 'getDocuments',
|
|
1732
|
+
parameters: {
|
|
1733
|
+
required: [],
|
|
1734
|
+
optional: ['documentSelector', 'sourceObjectId']
|
|
1735
|
+
}
|
|
1736
|
+
};
|
|
1737
|
+
function createResourceParams$5(config) {
|
|
1738
|
+
const resourceParams = {
|
|
1739
|
+
queryParams: {
|
|
1740
|
+
documentSelector: config.documentSelector, sourceObjectId: config.sourceObjectId
|
|
1741
|
+
}
|
|
1742
|
+
};
|
|
1743
|
+
return resourceParams;
|
|
1744
|
+
}
|
|
1745
|
+
function keyBuilder$8(luvio, config) {
|
|
1746
|
+
const resourceParams = createResourceParams$5(config);
|
|
1747
|
+
return keyBuilder$9(luvio, resourceParams);
|
|
1748
|
+
}
|
|
1749
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
1750
|
+
const config = {};
|
|
1751
|
+
const untrustedConfig_documentSelector = untrustedConfig.documentSelector;
|
|
1752
|
+
if (typeof untrustedConfig_documentSelector === 'string') {
|
|
1753
|
+
config.documentSelector = untrustedConfig_documentSelector;
|
|
1754
|
+
}
|
|
1755
|
+
const untrustedConfig_sourceObjectId = untrustedConfig.sourceObjectId;
|
|
1756
|
+
if (typeof untrustedConfig_sourceObjectId === 'string') {
|
|
1757
|
+
config.sourceObjectId = untrustedConfig_sourceObjectId;
|
|
1758
|
+
}
|
|
1759
|
+
return config;
|
|
1760
|
+
}
|
|
1761
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
1762
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1763
|
+
return null;
|
|
1764
|
+
}
|
|
1765
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1766
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1767
|
+
}
|
|
1768
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
1769
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1770
|
+
return null;
|
|
1771
|
+
}
|
|
1772
|
+
return config;
|
|
1773
|
+
}
|
|
1774
|
+
function adapterFragment$3(luvio, config) {
|
|
1775
|
+
createResourceParams$5(config);
|
|
1776
|
+
return select$e();
|
|
1777
|
+
}
|
|
1778
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
1779
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
1780
|
+
config,
|
|
1781
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1782
|
+
});
|
|
1783
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1784
|
+
}
|
|
1785
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
1786
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
1787
|
+
config,
|
|
1788
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1789
|
+
});
|
|
1790
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1791
|
+
}
|
|
1792
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
1793
|
+
const resourceParams = createResourceParams$5(config);
|
|
1794
|
+
const request = createResourceRequest$5(resourceParams);
|
|
1795
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1796
|
+
.then((response) => {
|
|
1797
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => getResponseCacheKeys$5(luvio, resourceParams, response.body));
|
|
1798
|
+
}, (response) => {
|
|
1799
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
1800
|
+
});
|
|
1801
|
+
}
|
|
1802
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
1803
|
+
const { luvio, config } = context;
|
|
1804
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
1805
|
+
const dispatchOptions = {
|
|
1806
|
+
resourceRequestContext: {
|
|
1807
|
+
requestCorrelator,
|
|
1808
|
+
luvioRequestMethod: undefined,
|
|
1809
|
+
},
|
|
1810
|
+
eventObservers
|
|
1811
|
+
};
|
|
1812
|
+
if (networkPriority !== 'normal') {
|
|
1813
|
+
dispatchOptions.overrides = {
|
|
1814
|
+
priority: networkPriority
|
|
1815
|
+
};
|
|
1816
|
+
}
|
|
1817
|
+
return buildNetworkSnapshot$5(luvio, config, dispatchOptions);
|
|
1818
|
+
}
|
|
1819
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
1820
|
+
const { luvio, config } = context;
|
|
1821
|
+
const selector = {
|
|
1822
|
+
recordId: keyBuilder$8(luvio, config),
|
|
1823
|
+
node: adapterFragment$3(luvio, config),
|
|
1824
|
+
variables: {},
|
|
1825
|
+
};
|
|
1826
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1827
|
+
config,
|
|
1828
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1829
|
+
});
|
|
1830
|
+
return cacheSnapshot;
|
|
1831
|
+
}
|
|
1832
|
+
const getDocumentsAdapterFactory = (luvio) => function docgen__getDocuments(untrustedConfig, requestContext) {
|
|
1833
|
+
const config = validateAdapterConfig$5(untrustedConfig, getDocuments_ConfigPropertyNames);
|
|
1834
|
+
// Invalid or incomplete config
|
|
1835
|
+
if (config === null) {
|
|
1836
|
+
return null;
|
|
1837
|
+
}
|
|
1838
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1839
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
1840
|
+
};
|
|
1841
|
+
|
|
1842
|
+
const VERSION$8 = "242dbae9f8d68428741c5d365c103de9";
|
|
1843
|
+
function validate$9(obj, path = 'NotificationExpirationResponse') {
|
|
1844
|
+
const v_error = (() => {
|
|
1845
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1846
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1847
|
+
}
|
|
1848
|
+
if (obj.expireAfter !== undefined) {
|
|
1849
|
+
const obj_expireAfter = obj.expireAfter;
|
|
1850
|
+
const path_expireAfter = path + '.expireAfter';
|
|
1851
|
+
if (typeof obj_expireAfter !== 'number' || (typeof obj_expireAfter === 'number' && Math.floor(obj_expireAfter) !== obj_expireAfter)) {
|
|
1852
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_expireAfter + '" (at "' + path_expireAfter + '")');
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
if (obj.expireEnabled !== undefined) {
|
|
1856
|
+
const obj_expireEnabled = obj.expireEnabled;
|
|
1857
|
+
const path_expireEnabled = path + '.expireEnabled';
|
|
1858
|
+
if (typeof obj_expireEnabled !== 'boolean') {
|
|
1859
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_expireEnabled + '" (at "' + path_expireEnabled + '")');
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
if (obj.expireWarn !== undefined) {
|
|
1863
|
+
const obj_expireWarn = obj.expireWarn;
|
|
1864
|
+
const path_expireWarn = path + '.expireWarn';
|
|
1865
|
+
if (typeof obj_expireWarn !== 'number' || (typeof obj_expireWarn === 'number' && Math.floor(obj_expireWarn) !== obj_expireWarn)) {
|
|
1866
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_expireWarn + '" (at "' + path_expireWarn + '")');
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
})();
|
|
1870
|
+
return v_error === undefined ? null : v_error;
|
|
1871
|
+
}
|
|
1872
|
+
const select$d = function NotificationExpirationResponseSelect() {
|
|
1873
|
+
return {
|
|
1874
|
+
kind: 'Fragment',
|
|
1875
|
+
version: VERSION$8,
|
|
1876
|
+
private: [],
|
|
1877
|
+
selections: [
|
|
1878
|
+
{
|
|
1879
|
+
name: 'expireAfter',
|
|
1880
|
+
kind: 'Scalar',
|
|
1881
|
+
required: false
|
|
1882
|
+
},
|
|
1883
|
+
{
|
|
1884
|
+
name: 'expireEnabled',
|
|
1885
|
+
kind: 'Scalar',
|
|
1886
|
+
required: false
|
|
1887
|
+
},
|
|
1888
|
+
{
|
|
1889
|
+
name: 'expireWarn',
|
|
1890
|
+
kind: 'Scalar',
|
|
1891
|
+
required: false
|
|
1892
|
+
}
|
|
1893
|
+
]
|
|
1894
|
+
};
|
|
1895
|
+
};
|
|
1896
|
+
function equals$8(existing, incoming) {
|
|
1897
|
+
const existing_expireEnabled = existing.expireEnabled;
|
|
1898
|
+
const incoming_expireEnabled = incoming.expireEnabled;
|
|
1899
|
+
// if at least one of these optionals is defined
|
|
1900
|
+
if (existing_expireEnabled !== undefined || incoming_expireEnabled !== undefined) {
|
|
1901
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1902
|
+
// not equal
|
|
1903
|
+
if (existing_expireEnabled === undefined || incoming_expireEnabled === undefined) {
|
|
1904
|
+
return false;
|
|
1905
|
+
}
|
|
1906
|
+
if (!(existing_expireEnabled === incoming_expireEnabled)) {
|
|
1907
|
+
return false;
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
const existing_expireAfter = existing.expireAfter;
|
|
1911
|
+
const incoming_expireAfter = incoming.expireAfter;
|
|
1912
|
+
// if at least one of these optionals is defined
|
|
1913
|
+
if (existing_expireAfter !== undefined || incoming_expireAfter !== undefined) {
|
|
1914
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1915
|
+
// not equal
|
|
1916
|
+
if (existing_expireAfter === undefined || incoming_expireAfter === undefined) {
|
|
1917
|
+
return false;
|
|
1918
|
+
}
|
|
1919
|
+
if (!(existing_expireAfter === incoming_expireAfter)) {
|
|
1920
|
+
return false;
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
const existing_expireWarn = existing.expireWarn;
|
|
1924
|
+
const incoming_expireWarn = incoming.expireWarn;
|
|
1925
|
+
// if at least one of these optionals is defined
|
|
1926
|
+
if (existing_expireWarn !== undefined || incoming_expireWarn !== undefined) {
|
|
1927
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1928
|
+
// not equal
|
|
1929
|
+
if (existing_expireWarn === undefined || incoming_expireWarn === undefined) {
|
|
1930
|
+
return false;
|
|
1931
|
+
}
|
|
1932
|
+
if (!(existing_expireWarn === incoming_expireWarn)) {
|
|
1933
|
+
return false;
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
return true;
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
const VERSION$7 = "878d3a3156c243b43f8de432991dcb35";
|
|
1940
|
+
function validate$8(obj, path = 'NotificationReminderResponse') {
|
|
1941
|
+
const v_error = (() => {
|
|
1942
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1943
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1944
|
+
}
|
|
1945
|
+
if (obj.reminderDelay !== undefined) {
|
|
1946
|
+
const obj_reminderDelay = obj.reminderDelay;
|
|
1947
|
+
const path_reminderDelay = path + '.reminderDelay';
|
|
1948
|
+
if (typeof obj_reminderDelay !== 'number' || (typeof obj_reminderDelay === 'number' && Math.floor(obj_reminderDelay) !== obj_reminderDelay)) {
|
|
1949
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_reminderDelay + '" (at "' + path_reminderDelay + '")');
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
if (obj.reminderEnabled !== undefined) {
|
|
1953
|
+
const obj_reminderEnabled = obj.reminderEnabled;
|
|
1954
|
+
const path_reminderEnabled = path + '.reminderEnabled';
|
|
1955
|
+
if (typeof obj_reminderEnabled !== 'boolean') {
|
|
1956
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_reminderEnabled + '" (at "' + path_reminderEnabled + '")');
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
if (obj.reminderFrequency !== undefined) {
|
|
1960
|
+
const obj_reminderFrequency = obj.reminderFrequency;
|
|
1961
|
+
const path_reminderFrequency = path + '.reminderFrequency';
|
|
1962
|
+
if (typeof obj_reminderFrequency !== 'number' || (typeof obj_reminderFrequency === 'number' && Math.floor(obj_reminderFrequency) !== obj_reminderFrequency)) {
|
|
1963
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_reminderFrequency + '" (at "' + path_reminderFrequency + '")');
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
})();
|
|
1967
|
+
return v_error === undefined ? null : v_error;
|
|
1968
|
+
}
|
|
1969
|
+
const select$c = function NotificationReminderResponseSelect() {
|
|
1970
|
+
return {
|
|
1971
|
+
kind: 'Fragment',
|
|
1972
|
+
version: VERSION$7,
|
|
1973
|
+
private: [],
|
|
1974
|
+
selections: [
|
|
1975
|
+
{
|
|
1976
|
+
name: 'reminderDelay',
|
|
1977
|
+
kind: 'Scalar',
|
|
1978
|
+
required: false
|
|
1979
|
+
},
|
|
1980
|
+
{
|
|
1981
|
+
name: 'reminderEnabled',
|
|
1982
|
+
kind: 'Scalar',
|
|
1983
|
+
required: false
|
|
1984
|
+
},
|
|
1985
|
+
{
|
|
1986
|
+
name: 'reminderFrequency',
|
|
1987
|
+
kind: 'Scalar',
|
|
1988
|
+
required: false
|
|
1989
|
+
}
|
|
1990
|
+
]
|
|
1991
|
+
};
|
|
1992
|
+
};
|
|
1993
|
+
function equals$7(existing, incoming) {
|
|
1994
|
+
const existing_reminderEnabled = existing.reminderEnabled;
|
|
1995
|
+
const incoming_reminderEnabled = incoming.reminderEnabled;
|
|
1996
|
+
// if at least one of these optionals is defined
|
|
1997
|
+
if (existing_reminderEnabled !== undefined || incoming_reminderEnabled !== undefined) {
|
|
1998
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1999
|
+
// not equal
|
|
2000
|
+
if (existing_reminderEnabled === undefined || incoming_reminderEnabled === undefined) {
|
|
2001
|
+
return false;
|
|
2002
|
+
}
|
|
2003
|
+
if (!(existing_reminderEnabled === incoming_reminderEnabled)) {
|
|
2004
|
+
return false;
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
const existing_reminderDelay = existing.reminderDelay;
|
|
2008
|
+
const incoming_reminderDelay = incoming.reminderDelay;
|
|
2009
|
+
// if at least one of these optionals is defined
|
|
2010
|
+
if (existing_reminderDelay !== undefined || incoming_reminderDelay !== undefined) {
|
|
2011
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2012
|
+
// not equal
|
|
2013
|
+
if (existing_reminderDelay === undefined || incoming_reminderDelay === undefined) {
|
|
2014
|
+
return false;
|
|
2015
|
+
}
|
|
2016
|
+
if (!(existing_reminderDelay === incoming_reminderDelay)) {
|
|
2017
|
+
return false;
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
const existing_reminderFrequency = existing.reminderFrequency;
|
|
2021
|
+
const incoming_reminderFrequency = incoming.reminderFrequency;
|
|
2022
|
+
// if at least one of these optionals is defined
|
|
2023
|
+
if (existing_reminderFrequency !== undefined || incoming_reminderFrequency !== undefined) {
|
|
2024
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2025
|
+
// not equal
|
|
2026
|
+
if (existing_reminderFrequency === undefined || incoming_reminderFrequency === undefined) {
|
|
2027
|
+
return false;
|
|
2028
|
+
}
|
|
2029
|
+
if (!(existing_reminderFrequency === incoming_reminderFrequency)) {
|
|
2030
|
+
return false;
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
return true;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
const TTL$2 = 60000;
|
|
2037
|
+
const VERSION$6 = "28193900c26e4624f9c72a6c08348a55";
|
|
2038
|
+
function validate$7(obj, path = 'NotificationSettingResponse') {
|
|
2039
|
+
const v_error = (() => {
|
|
2040
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2041
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2042
|
+
}
|
|
2043
|
+
if (obj.expirations !== undefined) {
|
|
2044
|
+
const obj_expirations = obj.expirations;
|
|
2045
|
+
const path_expirations = path + '.expirations';
|
|
2046
|
+
const referencepath_expirationsValidationError = validate$9(obj_expirations, path_expirations);
|
|
2047
|
+
if (referencepath_expirationsValidationError !== null) {
|
|
2048
|
+
let message = 'Object doesn\'t match NotificationExpirationResponse (at "' + path_expirations + '")\n';
|
|
2049
|
+
message += referencepath_expirationsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2050
|
+
return new TypeError(message);
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
2053
|
+
if (obj.reminders !== undefined) {
|
|
2054
|
+
const obj_reminders = obj.reminders;
|
|
2055
|
+
const path_reminders = path + '.reminders';
|
|
2056
|
+
const referencepath_remindersValidationError = validate$8(obj_reminders, path_reminders);
|
|
2057
|
+
if (referencepath_remindersValidationError !== null) {
|
|
2058
|
+
let message = 'Object doesn\'t match NotificationReminderResponse (at "' + path_reminders + '")\n';
|
|
2059
|
+
message += referencepath_remindersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2060
|
+
return new TypeError(message);
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
if (obj.useAccountDefaults !== undefined) {
|
|
2064
|
+
const obj_useAccountDefaults = obj.useAccountDefaults;
|
|
2065
|
+
const path_useAccountDefaults = path + '.useAccountDefaults';
|
|
2066
|
+
if (typeof obj_useAccountDefaults !== 'boolean') {
|
|
2067
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_useAccountDefaults + '" (at "' + path_useAccountDefaults + '")');
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
})();
|
|
2071
|
+
return v_error === undefined ? null : v_error;
|
|
2072
|
+
}
|
|
2073
|
+
const RepresentationType$4 = 'NotificationSettingResponse';
|
|
2074
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
2075
|
+
return input;
|
|
2076
|
+
}
|
|
2077
|
+
const select$b = function NotificationSettingResponseSelect() {
|
|
2078
|
+
const { selections: NotificationExpirationResponse__selections, opaque: NotificationExpirationResponse__opaque, } = select$d();
|
|
2079
|
+
const { selections: NotificationReminderResponse__selections, opaque: NotificationReminderResponse__opaque, } = select$c();
|
|
2080
|
+
return {
|
|
2081
|
+
kind: 'Fragment',
|
|
2082
|
+
version: VERSION$6,
|
|
2083
|
+
private: [],
|
|
2084
|
+
selections: [
|
|
2085
|
+
{
|
|
2086
|
+
name: 'expirations',
|
|
2087
|
+
kind: 'Object',
|
|
2088
|
+
selections: NotificationExpirationResponse__selections,
|
|
2089
|
+
required: false
|
|
2090
|
+
},
|
|
2091
|
+
{
|
|
2092
|
+
name: 'reminders',
|
|
2093
|
+
kind: 'Object',
|
|
2094
|
+
selections: NotificationReminderResponse__selections,
|
|
2095
|
+
required: false
|
|
2096
|
+
},
|
|
2097
|
+
{
|
|
2098
|
+
name: 'useAccountDefaults',
|
|
2099
|
+
kind: 'Scalar',
|
|
2100
|
+
required: false
|
|
2101
|
+
}
|
|
2102
|
+
]
|
|
2103
|
+
};
|
|
2104
|
+
};
|
|
2105
|
+
function equals$6(existing, incoming) {
|
|
2106
|
+
const existing_useAccountDefaults = existing.useAccountDefaults;
|
|
2107
|
+
const incoming_useAccountDefaults = incoming.useAccountDefaults;
|
|
2108
|
+
// if at least one of these optionals is defined
|
|
2109
|
+
if (existing_useAccountDefaults !== undefined || incoming_useAccountDefaults !== undefined) {
|
|
2110
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2111
|
+
// not equal
|
|
2112
|
+
if (existing_useAccountDefaults === undefined || incoming_useAccountDefaults === undefined) {
|
|
2113
|
+
return false;
|
|
2114
|
+
}
|
|
2115
|
+
if (!(existing_useAccountDefaults === incoming_useAccountDefaults)) {
|
|
2116
|
+
return false;
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
const existing_expirations = existing.expirations;
|
|
2120
|
+
const incoming_expirations = incoming.expirations;
|
|
2121
|
+
// if at least one of these optionals is defined
|
|
2122
|
+
if (existing_expirations !== undefined || incoming_expirations !== undefined) {
|
|
2123
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2124
|
+
// not equal
|
|
2125
|
+
if (existing_expirations === undefined || incoming_expirations === undefined) {
|
|
2126
|
+
return false;
|
|
2127
|
+
}
|
|
2128
|
+
if (!(equals$8(existing_expirations, incoming_expirations))) {
|
|
2129
|
+
return false;
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
const existing_reminders = existing.reminders;
|
|
2133
|
+
const incoming_reminders = incoming.reminders;
|
|
2134
|
+
// if at least one of these optionals is defined
|
|
2135
|
+
if (existing_reminders !== undefined || incoming_reminders !== undefined) {
|
|
2136
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2137
|
+
// not equal
|
|
2138
|
+
if (existing_reminders === undefined || incoming_reminders === undefined) {
|
|
2139
|
+
return false;
|
|
2140
|
+
}
|
|
2141
|
+
if (!(equals$7(existing_reminders, incoming_reminders))) {
|
|
2142
|
+
return false;
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
return true;
|
|
2146
|
+
}
|
|
2147
|
+
const ingest$4 = function NotificationSettingResponseIngest(input, path, luvio, store, timestamp) {
|
|
2148
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2149
|
+
const validateError = validate$7(input);
|
|
2150
|
+
if (validateError !== null) {
|
|
2151
|
+
throw validateError;
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
const key = path.fullPath;
|
|
2155
|
+
const existingRecord = store.readEntry(key);
|
|
2156
|
+
const ttlToUse = TTL$2;
|
|
2157
|
+
let incomingRecord = normalize$4(input, store.readEntry(key), {
|
|
2158
|
+
fullPath: key,
|
|
2159
|
+
parent: path.parent,
|
|
2160
|
+
propertyName: path.propertyName,
|
|
2161
|
+
ttl: ttlToUse
|
|
2162
|
+
});
|
|
2163
|
+
if (existingRecord === undefined || equals$6(existingRecord, incomingRecord) === false) {
|
|
2164
|
+
luvio.storePublish(key, incomingRecord);
|
|
2165
|
+
}
|
|
2166
|
+
{
|
|
2167
|
+
const storeMetadataParams = {
|
|
2168
|
+
ttl: ttlToUse,
|
|
2169
|
+
namespace: "docgen",
|
|
2170
|
+
version: VERSION$6,
|
|
2171
|
+
representationName: RepresentationType$4,
|
|
2172
|
+
};
|
|
2173
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
2174
|
+
}
|
|
2175
|
+
return createLink(key);
|
|
2176
|
+
};
|
|
2177
|
+
function getTypeCacheKeys$4(luvio, input, fullPathFactory) {
|
|
2178
|
+
const rootKeySet = new StoreKeyMap();
|
|
2179
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2180
|
+
const rootKey = fullPathFactory();
|
|
2181
|
+
rootKeySet.set(rootKey, {
|
|
2182
|
+
namespace: keyPrefix,
|
|
2183
|
+
representationName: RepresentationType$4,
|
|
2184
|
+
mergeable: false
|
|
2185
|
+
});
|
|
2186
|
+
return rootKeySet;
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
function select$a(luvio, params) {
|
|
2190
|
+
return select$b();
|
|
2191
|
+
}
|
|
2192
|
+
function keyBuilder$7(luvio, params) {
|
|
2193
|
+
return keyPrefix + '::NotificationSettingResponse:(' + 'sourceObjectId:' + params.queryParams.sourceObjectId + ')';
|
|
2194
|
+
}
|
|
2195
|
+
function getResponseCacheKeys$4(luvio, resourceParams, response) {
|
|
2196
|
+
return getTypeCacheKeys$4(luvio, response, () => keyBuilder$7(luvio, resourceParams));
|
|
2197
|
+
}
|
|
2198
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
2199
|
+
const { body } = response;
|
|
2200
|
+
const key = keyBuilder$7(luvio, resourceParams);
|
|
2201
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
2202
|
+
const snapshot = luvio.storeLookup({
|
|
2203
|
+
recordId: key,
|
|
2204
|
+
node: select$a(),
|
|
2205
|
+
variables: {},
|
|
2206
|
+
}, snapshotRefresh);
|
|
2207
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2208
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2209
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
return snapshot;
|
|
2213
|
+
}
|
|
2214
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
2215
|
+
const key = keyBuilder$7(luvio, params);
|
|
2216
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2217
|
+
const storeMetadataParams = {
|
|
2218
|
+
ttl: TTL$2,
|
|
2219
|
+
namespace: keyPrefix,
|
|
2220
|
+
version: VERSION$6,
|
|
2221
|
+
representationName: RepresentationType$4
|
|
2222
|
+
};
|
|
2223
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2224
|
+
return errorSnapshot;
|
|
2225
|
+
}
|
|
2226
|
+
function createResourceRequest$4(config) {
|
|
2227
|
+
const headers = {};
|
|
2228
|
+
return {
|
|
2229
|
+
baseUri: '/services/data/v58.0',
|
|
2230
|
+
basePath: '/connect/e-sign/notification-settings',
|
|
2231
|
+
method: 'get',
|
|
2232
|
+
body: null,
|
|
2233
|
+
urlParams: {},
|
|
2234
|
+
queryParams: config.queryParams,
|
|
2235
|
+
headers,
|
|
2236
|
+
priority: 'normal',
|
|
2237
|
+
};
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
const getESignNotificationSettings_ConfigPropertyNames = {
|
|
2241
|
+
displayName: 'getESignNotificationSettings',
|
|
2242
|
+
parameters: {
|
|
2243
|
+
required: [],
|
|
2244
|
+
optional: ['sourceObjectId']
|
|
2245
|
+
}
|
|
2246
|
+
};
|
|
2247
|
+
function createResourceParams$4(config) {
|
|
2248
|
+
const resourceParams = {
|
|
2249
|
+
queryParams: {
|
|
2250
|
+
sourceObjectId: config.sourceObjectId
|
|
2251
|
+
}
|
|
2252
|
+
};
|
|
2253
|
+
return resourceParams;
|
|
2254
|
+
}
|
|
2255
|
+
function keyBuilder$6(luvio, config) {
|
|
2256
|
+
const resourceParams = createResourceParams$4(config);
|
|
2257
|
+
return keyBuilder$7(luvio, resourceParams);
|
|
2258
|
+
}
|
|
2259
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
2260
|
+
const config = {};
|
|
2261
|
+
const untrustedConfig_sourceObjectId = untrustedConfig.sourceObjectId;
|
|
2262
|
+
if (typeof untrustedConfig_sourceObjectId === 'string') {
|
|
2263
|
+
config.sourceObjectId = untrustedConfig_sourceObjectId;
|
|
2264
|
+
}
|
|
2265
|
+
return config;
|
|
2266
|
+
}
|
|
2267
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
2268
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2269
|
+
return null;
|
|
2270
|
+
}
|
|
2271
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2272
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2273
|
+
}
|
|
2274
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
2275
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2276
|
+
return null;
|
|
2277
|
+
}
|
|
2278
|
+
return config;
|
|
2279
|
+
}
|
|
2280
|
+
function adapterFragment$2(luvio, config) {
|
|
2281
|
+
createResourceParams$4(config);
|
|
2282
|
+
return select$a();
|
|
2283
|
+
}
|
|
2284
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
2285
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
2286
|
+
config,
|
|
2287
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
2288
|
+
});
|
|
2289
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2290
|
+
}
|
|
2291
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
2292
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
2293
|
+
config,
|
|
2294
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
2295
|
+
});
|
|
2296
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2297
|
+
}
|
|
2298
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
2299
|
+
const resourceParams = createResourceParams$4(config);
|
|
2300
|
+
const request = createResourceRequest$4(resourceParams);
|
|
2301
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2302
|
+
.then((response) => {
|
|
2303
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => getResponseCacheKeys$4(luvio, resourceParams, response.body));
|
|
2304
|
+
}, (response) => {
|
|
2305
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
2306
|
+
});
|
|
2307
|
+
}
|
|
2308
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
2309
|
+
const { luvio, config } = context;
|
|
2310
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
2311
|
+
const dispatchOptions = {
|
|
2312
|
+
resourceRequestContext: {
|
|
2313
|
+
requestCorrelator,
|
|
2314
|
+
luvioRequestMethod: undefined,
|
|
2315
|
+
},
|
|
2316
|
+
eventObservers
|
|
2317
|
+
};
|
|
2318
|
+
if (networkPriority !== 'normal') {
|
|
2319
|
+
dispatchOptions.overrides = {
|
|
2320
|
+
priority: networkPriority
|
|
2321
|
+
};
|
|
2322
|
+
}
|
|
2323
|
+
return buildNetworkSnapshot$4(luvio, config, dispatchOptions);
|
|
2324
|
+
}
|
|
2325
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
2326
|
+
const { luvio, config } = context;
|
|
2327
|
+
const selector = {
|
|
2328
|
+
recordId: keyBuilder$6(luvio, config),
|
|
2329
|
+
node: adapterFragment$2(luvio, config),
|
|
2330
|
+
variables: {},
|
|
2331
|
+
};
|
|
2332
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2333
|
+
config,
|
|
2334
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
2335
|
+
});
|
|
2336
|
+
return cacheSnapshot;
|
|
2337
|
+
}
|
|
2338
|
+
const getESignNotificationSettingsAdapterFactory = (luvio) => function docgen__getESignNotificationSettings(untrustedConfig, requestContext) {
|
|
2339
|
+
const config = validateAdapterConfig$4(untrustedConfig, getESignNotificationSettings_ConfigPropertyNames);
|
|
2340
|
+
// Invalid or incomplete config
|
|
2341
|
+
if (config === null) {
|
|
2342
|
+
return null;
|
|
2343
|
+
}
|
|
2344
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2345
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
2346
|
+
};
|
|
2347
|
+
|
|
2348
|
+
const VERSION$5 = "7d30ab722fb54c1edfb451a3c3867d01";
|
|
2349
|
+
function validate$6(obj, path = 'RecipientResponse') {
|
|
2350
|
+
const v_error = (() => {
|
|
2351
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2352
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2353
|
+
}
|
|
2354
|
+
if (obj.additionalFields !== undefined) {
|
|
2355
|
+
const obj_additionalFields = obj.additionalFields;
|
|
2356
|
+
const path_additionalFields = path + '.additionalFields';
|
|
2357
|
+
if (typeof obj_additionalFields !== 'object' || ArrayIsArray(obj_additionalFields) || obj_additionalFields === null) {
|
|
2358
|
+
return new TypeError('Expected "object" but received "' + typeof obj_additionalFields + '" (at "' + path_additionalFields + '")');
|
|
2359
|
+
}
|
|
2360
|
+
const obj_additionalFields_keys = ObjectKeys(obj_additionalFields);
|
|
2361
|
+
for (let i = 0; i < obj_additionalFields_keys.length; i++) {
|
|
2362
|
+
const key = obj_additionalFields_keys[i];
|
|
2363
|
+
const obj_additionalFields_prop = obj_additionalFields[key];
|
|
2364
|
+
const path_additionalFields_prop = path_additionalFields + '["' + key + '"]';
|
|
2365
|
+
if (typeof obj_additionalFields_prop !== 'string') {
|
|
2366
|
+
return new TypeError('Expected "string" but received "' + typeof obj_additionalFields_prop + '" (at "' + path_additionalFields_prop + '")');
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
if (obj.email !== undefined) {
|
|
2371
|
+
const obj_email = obj.email;
|
|
2372
|
+
const path_email = path + '.email';
|
|
2373
|
+
if (typeof obj_email !== 'string') {
|
|
2374
|
+
return new TypeError('Expected "string" but received "' + typeof obj_email + '" (at "' + path_email + '")');
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
if (obj.id !== undefined) {
|
|
2378
|
+
const obj_id = obj.id;
|
|
2379
|
+
const path_id = path + '.id';
|
|
2380
|
+
if (typeof obj_id !== 'string') {
|
|
2381
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
if (obj.name !== undefined) {
|
|
2385
|
+
const obj_name = obj.name;
|
|
2386
|
+
const path_name = path + '.name';
|
|
2387
|
+
if (typeof obj_name !== 'string') {
|
|
2388
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
})();
|
|
2392
|
+
return v_error === undefined ? null : v_error;
|
|
2393
|
+
}
|
|
2394
|
+
const select$9 = function RecipientResponseSelect() {
|
|
2395
|
+
return {
|
|
2396
|
+
kind: 'Fragment',
|
|
2397
|
+
version: VERSION$5,
|
|
2398
|
+
private: [],
|
|
2399
|
+
selections: [
|
|
2400
|
+
{
|
|
2401
|
+
name: 'additionalFields',
|
|
2402
|
+
kind: 'Scalar',
|
|
2403
|
+
map: true,
|
|
2404
|
+
required: false
|
|
2405
|
+
},
|
|
2406
|
+
{
|
|
2407
|
+
name: 'email',
|
|
2408
|
+
kind: 'Scalar',
|
|
2409
|
+
required: false
|
|
2410
|
+
},
|
|
2411
|
+
{
|
|
2412
|
+
name: 'id',
|
|
2413
|
+
kind: 'Scalar',
|
|
2414
|
+
required: false
|
|
2415
|
+
},
|
|
2416
|
+
{
|
|
2417
|
+
name: 'name',
|
|
2418
|
+
kind: 'Scalar',
|
|
2419
|
+
required: false
|
|
2420
|
+
}
|
|
2421
|
+
]
|
|
2422
|
+
};
|
|
2423
|
+
};
|
|
2424
|
+
function equals$5(existing, incoming) {
|
|
2425
|
+
const existing_email = existing.email;
|
|
2426
|
+
const incoming_email = incoming.email;
|
|
2427
|
+
// if at least one of these optionals is defined
|
|
2428
|
+
if (existing_email !== undefined || incoming_email !== undefined) {
|
|
2429
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2430
|
+
// not equal
|
|
2431
|
+
if (existing_email === undefined || incoming_email === undefined) {
|
|
2432
|
+
return false;
|
|
2433
|
+
}
|
|
2434
|
+
if (!(existing_email === incoming_email)) {
|
|
2435
|
+
return false;
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
const existing_id = existing.id;
|
|
2439
|
+
const incoming_id = incoming.id;
|
|
2440
|
+
// if at least one of these optionals is defined
|
|
2441
|
+
if (existing_id !== undefined || incoming_id !== undefined) {
|
|
2442
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2443
|
+
// not equal
|
|
2444
|
+
if (existing_id === undefined || incoming_id === undefined) {
|
|
2445
|
+
return false;
|
|
2446
|
+
}
|
|
2447
|
+
if (!(existing_id === incoming_id)) {
|
|
2448
|
+
return false;
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
const existing_name = existing.name;
|
|
2452
|
+
const incoming_name = incoming.name;
|
|
2453
|
+
// if at least one of these optionals is defined
|
|
2454
|
+
if (existing_name !== undefined || incoming_name !== undefined) {
|
|
2455
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2456
|
+
// not equal
|
|
2457
|
+
if (existing_name === undefined || incoming_name === undefined) {
|
|
2458
|
+
return false;
|
|
2459
|
+
}
|
|
2460
|
+
if (!(existing_name === incoming_name)) {
|
|
2461
|
+
return false;
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
const existing_additionalFields = existing.additionalFields;
|
|
2465
|
+
const incoming_additionalFields = incoming.additionalFields;
|
|
2466
|
+
// if at least one of these optionals is defined
|
|
2467
|
+
if (existing_additionalFields !== undefined || incoming_additionalFields !== undefined) {
|
|
2468
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2469
|
+
// not equal
|
|
2470
|
+
if (existing_additionalFields === undefined || incoming_additionalFields === undefined) {
|
|
2471
|
+
return false;
|
|
2472
|
+
}
|
|
2473
|
+
const equals_additionalFields_props = equalsObject(existing_additionalFields, incoming_additionalFields, (existing_additionalFields_prop, incoming_additionalFields_prop) => {
|
|
2474
|
+
if (!(existing_additionalFields_prop === incoming_additionalFields_prop)) {
|
|
2475
|
+
return false;
|
|
2476
|
+
}
|
|
2477
|
+
});
|
|
2478
|
+
if (equals_additionalFields_props === false) {
|
|
2479
|
+
return false;
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
return true;
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2485
|
+
const TTL$1 = 60000;
|
|
2486
|
+
const VERSION$4 = "7ae6d670be9a5ad75e4e1d4199e54f06";
|
|
2487
|
+
function validate$5(obj, path = 'RecipientListResponse') {
|
|
2488
|
+
const v_error = (() => {
|
|
2489
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2490
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2491
|
+
}
|
|
2492
|
+
if (obj.recipients !== undefined) {
|
|
2493
|
+
const obj_recipients = obj.recipients;
|
|
2494
|
+
const path_recipients = path + '.recipients';
|
|
2495
|
+
if (!ArrayIsArray(obj_recipients)) {
|
|
2496
|
+
return new TypeError('Expected "array" but received "' + typeof obj_recipients + '" (at "' + path_recipients + '")');
|
|
2497
|
+
}
|
|
2498
|
+
for (let i = 0; i < obj_recipients.length; i++) {
|
|
2499
|
+
const obj_recipients_item = obj_recipients[i];
|
|
2500
|
+
const path_recipients_item = path_recipients + '[' + i + ']';
|
|
2501
|
+
const referencepath_recipients_itemValidationError = validate$6(obj_recipients_item, path_recipients_item);
|
|
2502
|
+
if (referencepath_recipients_itemValidationError !== null) {
|
|
2503
|
+
let message = 'Object doesn\'t match RecipientResponse (at "' + path_recipients_item + '")\n';
|
|
2504
|
+
message += referencepath_recipients_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2505
|
+
return new TypeError(message);
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
})();
|
|
2510
|
+
return v_error === undefined ? null : v_error;
|
|
2511
|
+
}
|
|
2512
|
+
const RepresentationType$3 = 'RecipientListResponse';
|
|
2513
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
2514
|
+
return input;
|
|
2515
|
+
}
|
|
2516
|
+
const select$8 = function RecipientListResponseSelect() {
|
|
2517
|
+
const { selections: RecipientResponse__selections, opaque: RecipientResponse__opaque, } = select$9();
|
|
2518
|
+
return {
|
|
2519
|
+
kind: 'Fragment',
|
|
2520
|
+
version: VERSION$4,
|
|
2521
|
+
private: [],
|
|
2522
|
+
selections: [
|
|
2523
|
+
{
|
|
2524
|
+
name: 'recipients',
|
|
2525
|
+
kind: 'Object',
|
|
2526
|
+
plural: true,
|
|
2527
|
+
selections: RecipientResponse__selections,
|
|
2528
|
+
required: false
|
|
2529
|
+
}
|
|
2530
|
+
]
|
|
2531
|
+
};
|
|
2532
|
+
};
|
|
2533
|
+
function equals$4(existing, incoming) {
|
|
2534
|
+
const existing_recipients = existing.recipients;
|
|
2535
|
+
const incoming_recipients = incoming.recipients;
|
|
2536
|
+
// if at least one of these optionals is defined
|
|
2537
|
+
if (existing_recipients !== undefined || incoming_recipients !== undefined) {
|
|
2538
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2539
|
+
// not equal
|
|
2540
|
+
if (existing_recipients === undefined || incoming_recipients === undefined) {
|
|
2541
|
+
return false;
|
|
2542
|
+
}
|
|
2543
|
+
const equals_recipients_items = equalsArray(existing_recipients, incoming_recipients, (existing_recipients_item, incoming_recipients_item) => {
|
|
2544
|
+
if (!(equals$5(existing_recipients_item, incoming_recipients_item))) {
|
|
2545
|
+
return false;
|
|
2546
|
+
}
|
|
2547
|
+
});
|
|
2548
|
+
if (equals_recipients_items === false) {
|
|
2549
|
+
return false;
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
return true;
|
|
2553
|
+
}
|
|
2554
|
+
const ingest$3 = function RecipientListResponseIngest(input, path, luvio, store, timestamp) {
|
|
2555
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2556
|
+
const validateError = validate$5(input);
|
|
2557
|
+
if (validateError !== null) {
|
|
2558
|
+
throw validateError;
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
const key = path.fullPath;
|
|
2562
|
+
const existingRecord = store.readEntry(key);
|
|
2563
|
+
const ttlToUse = TTL$1;
|
|
2564
|
+
let incomingRecord = normalize$3(input, store.readEntry(key), {
|
|
2565
|
+
fullPath: key,
|
|
2566
|
+
parent: path.parent,
|
|
2567
|
+
propertyName: path.propertyName,
|
|
2568
|
+
ttl: ttlToUse
|
|
2569
|
+
});
|
|
2570
|
+
if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
|
|
2571
|
+
luvio.storePublish(key, incomingRecord);
|
|
2572
|
+
}
|
|
2573
|
+
{
|
|
2574
|
+
const storeMetadataParams = {
|
|
2575
|
+
ttl: ttlToUse,
|
|
2576
|
+
namespace: "docgen",
|
|
2577
|
+
version: VERSION$4,
|
|
2578
|
+
representationName: RepresentationType$3,
|
|
2579
|
+
};
|
|
2580
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
2581
|
+
}
|
|
2582
|
+
return createLink(key);
|
|
2583
|
+
};
|
|
2584
|
+
function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
|
|
2585
|
+
const rootKeySet = new StoreKeyMap();
|
|
2586
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2587
|
+
const rootKey = fullPathFactory();
|
|
2588
|
+
rootKeySet.set(rootKey, {
|
|
2589
|
+
namespace: keyPrefix,
|
|
2590
|
+
representationName: RepresentationType$3,
|
|
2591
|
+
mergeable: false
|
|
2592
|
+
});
|
|
2593
|
+
return rootKeySet;
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
function select$7(luvio, params) {
|
|
2597
|
+
return select$8();
|
|
2598
|
+
}
|
|
2599
|
+
function keyBuilder$5(luvio, params) {
|
|
2600
|
+
return keyPrefix + '::RecipientListResponse:(' + 'recipientSelector:' + params.queryParams.recipientSelector + ',' + 'sourceObjectId:' + params.queryParams.sourceObjectId + ')';
|
|
2601
|
+
}
|
|
2602
|
+
function getResponseCacheKeys$3(luvio, resourceParams, response) {
|
|
2603
|
+
return getTypeCacheKeys$3(luvio, response, () => keyBuilder$5(luvio, resourceParams));
|
|
2604
|
+
}
|
|
2605
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
2606
|
+
const { body } = response;
|
|
2607
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
2608
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
2609
|
+
const snapshot = luvio.storeLookup({
|
|
2610
|
+
recordId: key,
|
|
2611
|
+
node: select$7(),
|
|
2612
|
+
variables: {},
|
|
2613
|
+
}, snapshotRefresh);
|
|
2614
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2615
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2616
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
return snapshot;
|
|
2620
|
+
}
|
|
2621
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
2622
|
+
const key = keyBuilder$5(luvio, params);
|
|
2623
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2624
|
+
const storeMetadataParams = {
|
|
2625
|
+
ttl: TTL$1,
|
|
2626
|
+
namespace: keyPrefix,
|
|
2627
|
+
version: VERSION$4,
|
|
2628
|
+
representationName: RepresentationType$3
|
|
2629
|
+
};
|
|
2630
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2631
|
+
return errorSnapshot;
|
|
2632
|
+
}
|
|
2633
|
+
function createResourceRequest$3(config) {
|
|
2634
|
+
const headers = {};
|
|
2635
|
+
return {
|
|
2636
|
+
baseUri: '/services/data/v58.0',
|
|
2637
|
+
basePath: '/connect/e-sign/recipients',
|
|
2638
|
+
method: 'get',
|
|
2639
|
+
body: null,
|
|
2640
|
+
urlParams: {},
|
|
2641
|
+
queryParams: config.queryParams,
|
|
2642
|
+
headers,
|
|
2643
|
+
priority: 'normal',
|
|
2644
|
+
};
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2647
|
+
const getRecipients_ConfigPropertyNames = {
|
|
2648
|
+
displayName: 'getRecipients',
|
|
2649
|
+
parameters: {
|
|
2650
|
+
required: [],
|
|
2651
|
+
optional: ['recipientSelector', 'sourceObjectId']
|
|
2652
|
+
}
|
|
2653
|
+
};
|
|
2654
|
+
function createResourceParams$3(config) {
|
|
2655
|
+
const resourceParams = {
|
|
2656
|
+
queryParams: {
|
|
2657
|
+
recipientSelector: config.recipientSelector, sourceObjectId: config.sourceObjectId
|
|
2658
|
+
}
|
|
2659
|
+
};
|
|
2660
|
+
return resourceParams;
|
|
2661
|
+
}
|
|
2662
|
+
function keyBuilder$4(luvio, config) {
|
|
2663
|
+
const resourceParams = createResourceParams$3(config);
|
|
2664
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
2665
|
+
}
|
|
2666
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
2667
|
+
const config = {};
|
|
2668
|
+
const untrustedConfig_recipientSelector = untrustedConfig.recipientSelector;
|
|
2669
|
+
if (typeof untrustedConfig_recipientSelector === 'string') {
|
|
2670
|
+
config.recipientSelector = untrustedConfig_recipientSelector;
|
|
2671
|
+
}
|
|
2672
|
+
const untrustedConfig_sourceObjectId = untrustedConfig.sourceObjectId;
|
|
2673
|
+
if (typeof untrustedConfig_sourceObjectId === 'string') {
|
|
2674
|
+
config.sourceObjectId = untrustedConfig_sourceObjectId;
|
|
2675
|
+
}
|
|
2676
|
+
return config;
|
|
2677
|
+
}
|
|
2678
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
2679
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2680
|
+
return null;
|
|
2681
|
+
}
|
|
2682
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2683
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2684
|
+
}
|
|
2685
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
2686
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2687
|
+
return null;
|
|
2688
|
+
}
|
|
2689
|
+
return config;
|
|
2690
|
+
}
|
|
2691
|
+
function adapterFragment$1(luvio, config) {
|
|
2692
|
+
createResourceParams$3(config);
|
|
2693
|
+
return select$7();
|
|
2694
|
+
}
|
|
2695
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
2696
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
2697
|
+
config,
|
|
2698
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2699
|
+
});
|
|
2700
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2701
|
+
}
|
|
2702
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
2703
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
2704
|
+
config,
|
|
2705
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2706
|
+
});
|
|
2707
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2708
|
+
}
|
|
2709
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
2710
|
+
const resourceParams = createResourceParams$3(config);
|
|
2711
|
+
const request = createResourceRequest$3(resourceParams);
|
|
2712
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2713
|
+
.then((response) => {
|
|
2714
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
|
|
2715
|
+
}, (response) => {
|
|
2716
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
2717
|
+
});
|
|
2718
|
+
}
|
|
2719
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
2720
|
+
const { luvio, config } = context;
|
|
2721
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
2722
|
+
const dispatchOptions = {
|
|
2723
|
+
resourceRequestContext: {
|
|
2724
|
+
requestCorrelator,
|
|
2725
|
+
luvioRequestMethod: undefined,
|
|
2726
|
+
},
|
|
2727
|
+
eventObservers
|
|
2728
|
+
};
|
|
2729
|
+
if (networkPriority !== 'normal') {
|
|
2730
|
+
dispatchOptions.overrides = {
|
|
2731
|
+
priority: networkPriority
|
|
2732
|
+
};
|
|
2733
|
+
}
|
|
2734
|
+
return buildNetworkSnapshot$3(luvio, config, dispatchOptions);
|
|
2735
|
+
}
|
|
2736
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
2737
|
+
const { luvio, config } = context;
|
|
2738
|
+
const selector = {
|
|
2739
|
+
recordId: keyBuilder$4(luvio, config),
|
|
2740
|
+
node: adapterFragment$1(luvio, config),
|
|
2741
|
+
variables: {},
|
|
2742
|
+
};
|
|
2743
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2744
|
+
config,
|
|
2745
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2746
|
+
});
|
|
2747
|
+
return cacheSnapshot;
|
|
2748
|
+
}
|
|
2749
|
+
const getRecipientsAdapterFactory = (luvio) => function docgen__getRecipients(untrustedConfig, requestContext) {
|
|
2750
|
+
const config = validateAdapterConfig$3(untrustedConfig, getRecipients_ConfigPropertyNames);
|
|
2751
|
+
// Invalid or incomplete config
|
|
2752
|
+
if (config === null) {
|
|
2753
|
+
return null;
|
|
2754
|
+
}
|
|
2755
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2756
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
2757
|
+
};
|
|
2758
|
+
|
|
2759
|
+
const TTL = 60000;
|
|
2760
|
+
const VERSION$3 = "433838bd1cf4c3b77577cddf0ca5f731";
|
|
2761
|
+
function validate$4(obj, path = 'SignerRolesResponse') {
|
|
2762
|
+
const v_error = (() => {
|
|
2763
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2764
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2765
|
+
}
|
|
2766
|
+
if (obj.signerRoles !== undefined) {
|
|
2767
|
+
const obj_signerRoles = obj.signerRoles;
|
|
2768
|
+
const path_signerRoles = path + '.signerRoles';
|
|
2769
|
+
if (!ArrayIsArray(obj_signerRoles)) {
|
|
2770
|
+
return new TypeError('Expected "array" but received "' + typeof obj_signerRoles + '" (at "' + path_signerRoles + '")');
|
|
2771
|
+
}
|
|
2772
|
+
for (let i = 0; i < obj_signerRoles.length; i++) {
|
|
2773
|
+
const obj_signerRoles_item = obj_signerRoles[i];
|
|
2774
|
+
const path_signerRoles_item = path_signerRoles + '[' + i + ']';
|
|
2775
|
+
if (typeof obj_signerRoles_item !== 'string') {
|
|
2776
|
+
return new TypeError('Expected "string" but received "' + typeof obj_signerRoles_item + '" (at "' + path_signerRoles_item + '")');
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2779
|
+
}
|
|
2780
|
+
})();
|
|
2781
|
+
return v_error === undefined ? null : v_error;
|
|
2782
|
+
}
|
|
2783
|
+
const RepresentationType$2 = 'SignerRolesResponse';
|
|
2784
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
2785
|
+
return input;
|
|
2786
|
+
}
|
|
2787
|
+
const select$6 = function SignerRolesResponseSelect() {
|
|
2788
|
+
return {
|
|
2789
|
+
kind: 'Fragment',
|
|
2790
|
+
version: VERSION$3,
|
|
2791
|
+
private: [],
|
|
2792
|
+
selections: [
|
|
2793
|
+
{
|
|
2794
|
+
name: 'signerRoles',
|
|
2795
|
+
kind: 'Scalar',
|
|
2796
|
+
plural: true,
|
|
2797
|
+
required: false
|
|
2798
|
+
}
|
|
2799
|
+
]
|
|
2800
|
+
};
|
|
2801
|
+
};
|
|
2802
|
+
function equals$3(existing, incoming) {
|
|
2803
|
+
const existing_signerRoles = existing.signerRoles;
|
|
2804
|
+
const incoming_signerRoles = incoming.signerRoles;
|
|
2805
|
+
// if at least one of these optionals is defined
|
|
2806
|
+
if (existing_signerRoles !== undefined || incoming_signerRoles !== undefined) {
|
|
2807
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2808
|
+
// not equal
|
|
2809
|
+
if (existing_signerRoles === undefined || incoming_signerRoles === undefined) {
|
|
2810
|
+
return false;
|
|
2811
|
+
}
|
|
2812
|
+
const equals_signerRoles_items = equalsArray(existing_signerRoles, incoming_signerRoles, (existing_signerRoles_item, incoming_signerRoles_item) => {
|
|
2813
|
+
if (!(existing_signerRoles_item === incoming_signerRoles_item)) {
|
|
2814
|
+
return false;
|
|
2815
|
+
}
|
|
2816
|
+
});
|
|
2817
|
+
if (equals_signerRoles_items === false) {
|
|
2818
|
+
return false;
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
return true;
|
|
2822
|
+
}
|
|
2823
|
+
const ingest$2 = function SignerRolesResponseIngest(input, path, luvio, store, timestamp) {
|
|
2824
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2825
|
+
const validateError = validate$4(input);
|
|
2826
|
+
if (validateError !== null) {
|
|
2827
|
+
throw validateError;
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
const key = path.fullPath;
|
|
2831
|
+
const existingRecord = store.readEntry(key);
|
|
2832
|
+
const ttlToUse = TTL;
|
|
2833
|
+
let incomingRecord = normalize$2(input, store.readEntry(key), {
|
|
2834
|
+
fullPath: key,
|
|
2835
|
+
parent: path.parent,
|
|
2836
|
+
propertyName: path.propertyName,
|
|
2837
|
+
ttl: ttlToUse
|
|
2838
|
+
});
|
|
2839
|
+
if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
|
|
2840
|
+
luvio.storePublish(key, incomingRecord);
|
|
2841
|
+
}
|
|
2842
|
+
{
|
|
2843
|
+
const storeMetadataParams = {
|
|
2844
|
+
ttl: ttlToUse,
|
|
2845
|
+
namespace: "docgen",
|
|
2846
|
+
version: VERSION$3,
|
|
2847
|
+
representationName: RepresentationType$2,
|
|
2848
|
+
};
|
|
2849
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
2850
|
+
}
|
|
2851
|
+
return createLink(key);
|
|
2852
|
+
};
|
|
2853
|
+
function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
|
|
2854
|
+
const rootKeySet = new StoreKeyMap();
|
|
2855
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2856
|
+
const rootKey = fullPathFactory();
|
|
2857
|
+
rootKeySet.set(rootKey, {
|
|
2858
|
+
namespace: keyPrefix,
|
|
2859
|
+
representationName: RepresentationType$2,
|
|
2860
|
+
mergeable: false
|
|
2861
|
+
});
|
|
2862
|
+
return rootKeySet;
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2865
|
+
function select$5(luvio, params) {
|
|
2866
|
+
return select$6();
|
|
2867
|
+
}
|
|
2868
|
+
function keyBuilder$3(luvio, params) {
|
|
2869
|
+
return keyPrefix + '::SignerRolesResponse:(' + ')';
|
|
2870
|
+
}
|
|
2871
|
+
function getResponseCacheKeys$2(luvio, resourceParams, response) {
|
|
2872
|
+
return getTypeCacheKeys$2(luvio, response, () => keyBuilder$3());
|
|
2873
|
+
}
|
|
2874
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
2875
|
+
const { body } = response;
|
|
2876
|
+
const key = keyBuilder$3();
|
|
2877
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
2878
|
+
const snapshot = luvio.storeLookup({
|
|
2879
|
+
recordId: key,
|
|
2880
|
+
node: select$5(),
|
|
2881
|
+
variables: {},
|
|
2882
|
+
}, snapshotRefresh);
|
|
2883
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2884
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2885
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2886
|
+
}
|
|
2887
|
+
}
|
|
2888
|
+
return snapshot;
|
|
2889
|
+
}
|
|
2890
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
2891
|
+
const key = keyBuilder$3();
|
|
2892
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2893
|
+
const storeMetadataParams = {
|
|
2894
|
+
ttl: TTL,
|
|
2895
|
+
namespace: keyPrefix,
|
|
2896
|
+
version: VERSION$3,
|
|
2897
|
+
representationName: RepresentationType$2
|
|
2898
|
+
};
|
|
2899
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2900
|
+
return errorSnapshot;
|
|
2901
|
+
}
|
|
2902
|
+
function createResourceRequest$2(config) {
|
|
2903
|
+
const headers = {};
|
|
2904
|
+
return {
|
|
2905
|
+
baseUri: '/services/data/v58.0',
|
|
2906
|
+
basePath: '/connect/e-sign/signer-roles',
|
|
2907
|
+
method: 'get',
|
|
2908
|
+
body: null,
|
|
2909
|
+
urlParams: {},
|
|
2910
|
+
queryParams: {},
|
|
2911
|
+
headers,
|
|
2912
|
+
priority: 'normal',
|
|
2913
|
+
};
|
|
2914
|
+
}
|
|
2915
|
+
|
|
2916
|
+
const getSignerRoles_ConfigPropertyNames = {
|
|
2917
|
+
displayName: 'getSignerRoles',
|
|
2918
|
+
parameters: {
|
|
2919
|
+
required: [],
|
|
2920
|
+
optional: []
|
|
2921
|
+
}
|
|
2922
|
+
};
|
|
2923
|
+
function createResourceParams$2(config) {
|
|
2924
|
+
const resourceParams = {};
|
|
2925
|
+
return resourceParams;
|
|
2926
|
+
}
|
|
2927
|
+
function keyBuilder$2(luvio, config) {
|
|
2928
|
+
return keyBuilder$3();
|
|
2929
|
+
}
|
|
2930
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
2931
|
+
const config = {};
|
|
2932
|
+
return config;
|
|
2933
|
+
}
|
|
2934
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
2935
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2936
|
+
return null;
|
|
2937
|
+
}
|
|
2938
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2939
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2940
|
+
}
|
|
2941
|
+
const config = typeCheckConfig$2();
|
|
2942
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2943
|
+
return null;
|
|
2944
|
+
}
|
|
2945
|
+
return config;
|
|
2946
|
+
}
|
|
2947
|
+
function adapterFragment(luvio, config) {
|
|
2948
|
+
return select$5();
|
|
2949
|
+
}
|
|
2950
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
2951
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
2952
|
+
config,
|
|
2953
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2954
|
+
});
|
|
2955
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2956
|
+
}
|
|
2957
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
2958
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
2959
|
+
config,
|
|
2960
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2961
|
+
});
|
|
2962
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2963
|
+
}
|
|
2964
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
2965
|
+
const resourceParams = createResourceParams$2();
|
|
2966
|
+
const request = createResourceRequest$2();
|
|
2967
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2968
|
+
.then((response) => {
|
|
2969
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
|
|
2970
|
+
}, (response) => {
|
|
2971
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
2972
|
+
});
|
|
2973
|
+
}
|
|
2974
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
2975
|
+
const { luvio, config } = context;
|
|
2976
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
2977
|
+
const dispatchOptions = {
|
|
2978
|
+
resourceRequestContext: {
|
|
2979
|
+
requestCorrelator,
|
|
2980
|
+
luvioRequestMethod: undefined,
|
|
2981
|
+
},
|
|
2982
|
+
eventObservers
|
|
2983
|
+
};
|
|
2984
|
+
if (networkPriority !== 'normal') {
|
|
2985
|
+
dispatchOptions.overrides = {
|
|
2986
|
+
priority: networkPriority
|
|
2987
|
+
};
|
|
2988
|
+
}
|
|
2989
|
+
return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
|
|
2990
|
+
}
|
|
2991
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
2992
|
+
const { luvio, config } = context;
|
|
2993
|
+
const selector = {
|
|
2994
|
+
recordId: keyBuilder$2(),
|
|
2995
|
+
node: adapterFragment(),
|
|
2996
|
+
variables: {},
|
|
2997
|
+
};
|
|
2998
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2999
|
+
config,
|
|
3000
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
3001
|
+
});
|
|
3002
|
+
return cacheSnapshot;
|
|
3003
|
+
}
|
|
3004
|
+
const getSignerRolesAdapterFactory = (luvio) => function docgen__getSignerRoles(untrustedConfig, requestContext) {
|
|
3005
|
+
const config = validateAdapterConfig$2(untrustedConfig, getSignerRoles_ConfigPropertyNames);
|
|
3006
|
+
// Invalid or incomplete config
|
|
3007
|
+
if (config === null) {
|
|
3008
|
+
return null;
|
|
3009
|
+
}
|
|
3010
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
3011
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
3012
|
+
};
|
|
3013
|
+
|
|
3014
|
+
const VERSION$2 = "a526dee965728f9d0539fea320b7e28b";
|
|
3015
|
+
function validate$3(obj, path = 'EnvelopeStatusResponse') {
|
|
3016
|
+
const v_error = (() => {
|
|
3017
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3018
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3019
|
+
}
|
|
3020
|
+
const obj_envelopeId = obj.envelopeId;
|
|
3021
|
+
const path_envelopeId = path + '.envelopeId';
|
|
3022
|
+
if (typeof obj_envelopeId !== 'string') {
|
|
3023
|
+
return new TypeError('Expected "string" but received "' + typeof obj_envelopeId + '" (at "' + path_envelopeId + '")');
|
|
3024
|
+
}
|
|
3025
|
+
if (obj.error !== undefined) {
|
|
3026
|
+
const obj_error = obj.error;
|
|
3027
|
+
const path_error = path + '.error';
|
|
3028
|
+
if (typeof obj_error !== 'string') {
|
|
3029
|
+
return new TypeError('Expected "string" but received "' + typeof obj_error + '" (at "' + path_error + '")');
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
if (obj.errorMessage !== undefined) {
|
|
3033
|
+
const obj_errorMessage = obj.errorMessage;
|
|
3034
|
+
const path_errorMessage = path + '.errorMessage';
|
|
3035
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
3036
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
const obj_status = obj.status;
|
|
3040
|
+
const path_status = path + '.status';
|
|
3041
|
+
if (typeof obj_status !== 'string') {
|
|
3042
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
3043
|
+
}
|
|
3044
|
+
const obj_success = obj.success;
|
|
3045
|
+
const path_success = path + '.success';
|
|
3046
|
+
if (typeof obj_success !== 'boolean') {
|
|
3047
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
|
|
3048
|
+
}
|
|
3049
|
+
})();
|
|
3050
|
+
return v_error === undefined ? null : v_error;
|
|
3051
|
+
}
|
|
3052
|
+
const select$4 = function EnvelopeStatusResponseSelect() {
|
|
3053
|
+
return {
|
|
3054
|
+
kind: 'Fragment',
|
|
3055
|
+
version: VERSION$2,
|
|
3056
|
+
private: [],
|
|
3057
|
+
selections: [
|
|
3058
|
+
{
|
|
3059
|
+
name: 'envelopeId',
|
|
3060
|
+
kind: 'Scalar'
|
|
3061
|
+
},
|
|
3062
|
+
{
|
|
3063
|
+
name: 'error',
|
|
3064
|
+
kind: 'Scalar',
|
|
3065
|
+
required: false
|
|
3066
|
+
},
|
|
3067
|
+
{
|
|
3068
|
+
name: 'errorMessage',
|
|
3069
|
+
kind: 'Scalar',
|
|
3070
|
+
required: false
|
|
3071
|
+
},
|
|
3072
|
+
{
|
|
3073
|
+
name: 'status',
|
|
3074
|
+
kind: 'Scalar'
|
|
3075
|
+
},
|
|
3076
|
+
{
|
|
3077
|
+
name: 'success',
|
|
3078
|
+
kind: 'Scalar'
|
|
3079
|
+
}
|
|
3080
|
+
]
|
|
3081
|
+
};
|
|
3082
|
+
};
|
|
3083
|
+
function equals$2(existing, incoming) {
|
|
3084
|
+
const existing_success = existing.success;
|
|
3085
|
+
const incoming_success = incoming.success;
|
|
3086
|
+
if (!(existing_success === incoming_success)) {
|
|
3087
|
+
return false;
|
|
3088
|
+
}
|
|
3089
|
+
const existing_envelopeId = existing.envelopeId;
|
|
3090
|
+
const incoming_envelopeId = incoming.envelopeId;
|
|
3091
|
+
if (!(existing_envelopeId === incoming_envelopeId)) {
|
|
3092
|
+
return false;
|
|
3093
|
+
}
|
|
3094
|
+
const existing_error = existing.error;
|
|
3095
|
+
const incoming_error = incoming.error;
|
|
3096
|
+
// if at least one of these optionals is defined
|
|
3097
|
+
if (existing_error !== undefined || incoming_error !== undefined) {
|
|
3098
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
3099
|
+
// not equal
|
|
3100
|
+
if (existing_error === undefined || incoming_error === undefined) {
|
|
3101
|
+
return false;
|
|
3102
|
+
}
|
|
3103
|
+
if (!(existing_error === incoming_error)) {
|
|
3104
|
+
return false;
|
|
3105
|
+
}
|
|
3106
|
+
}
|
|
3107
|
+
const existing_errorMessage = existing.errorMessage;
|
|
3108
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
3109
|
+
// if at least one of these optionals is defined
|
|
3110
|
+
if (existing_errorMessage !== undefined || incoming_errorMessage !== undefined) {
|
|
3111
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
3112
|
+
// not equal
|
|
3113
|
+
if (existing_errorMessage === undefined || incoming_errorMessage === undefined) {
|
|
3114
|
+
return false;
|
|
3115
|
+
}
|
|
3116
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
3117
|
+
return false;
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
const existing_status = existing.status;
|
|
3121
|
+
const incoming_status = incoming.status;
|
|
3122
|
+
if (!(existing_status === incoming_status)) {
|
|
3123
|
+
return false;
|
|
3124
|
+
}
|
|
3125
|
+
return true;
|
|
3126
|
+
}
|
|
3127
|
+
|
|
3128
|
+
const VERSION$1 = "c623a9a652645ca3d05d47cde1ff900e";
|
|
3129
|
+
function validate$2(obj, path = 'EnvelopeStatusListResponse') {
|
|
3130
|
+
const v_error = (() => {
|
|
3131
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3132
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3133
|
+
}
|
|
3134
|
+
const obj_signatureStatus = obj.signatureStatus;
|
|
3135
|
+
const path_signatureStatus = path + '.signatureStatus';
|
|
3136
|
+
if (!ArrayIsArray(obj_signatureStatus)) {
|
|
3137
|
+
return new TypeError('Expected "array" but received "' + typeof obj_signatureStatus + '" (at "' + path_signatureStatus + '")');
|
|
3138
|
+
}
|
|
3139
|
+
for (let i = 0; i < obj_signatureStatus.length; i++) {
|
|
3140
|
+
const obj_signatureStatus_item = obj_signatureStatus[i];
|
|
3141
|
+
const path_signatureStatus_item = path_signatureStatus + '[' + i + ']';
|
|
3142
|
+
const referencepath_signatureStatus_itemValidationError = validate$3(obj_signatureStatus_item, path_signatureStatus_item);
|
|
3143
|
+
if (referencepath_signatureStatus_itemValidationError !== null) {
|
|
3144
|
+
let message = 'Object doesn\'t match EnvelopeStatusResponse (at "' + path_signatureStatus_item + '")\n';
|
|
3145
|
+
message += referencepath_signatureStatus_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3146
|
+
return new TypeError(message);
|
|
3147
|
+
}
|
|
3148
|
+
}
|
|
3149
|
+
const obj_sourceObjectId = obj.sourceObjectId;
|
|
3150
|
+
const path_sourceObjectId = path + '.sourceObjectId';
|
|
3151
|
+
if (typeof obj_sourceObjectId !== 'string') {
|
|
3152
|
+
return new TypeError('Expected "string" but received "' + typeof obj_sourceObjectId + '" (at "' + path_sourceObjectId + '")');
|
|
3153
|
+
}
|
|
3154
|
+
const obj_totalEnvelopesToBeUpdated = obj.totalEnvelopesToBeUpdated;
|
|
3155
|
+
const path_totalEnvelopesToBeUpdated = path + '.totalEnvelopesToBeUpdated';
|
|
3156
|
+
if (typeof obj_totalEnvelopesToBeUpdated !== 'number' || (typeof obj_totalEnvelopesToBeUpdated === 'number' && Math.floor(obj_totalEnvelopesToBeUpdated) !== obj_totalEnvelopesToBeUpdated)) {
|
|
3157
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalEnvelopesToBeUpdated + '" (at "' + path_totalEnvelopesToBeUpdated + '")');
|
|
3158
|
+
}
|
|
3159
|
+
const obj_totalEnvelopesUpdated = obj.totalEnvelopesUpdated;
|
|
3160
|
+
const path_totalEnvelopesUpdated = path + '.totalEnvelopesUpdated';
|
|
3161
|
+
if (typeof obj_totalEnvelopesUpdated !== 'number' || (typeof obj_totalEnvelopesUpdated === 'number' && Math.floor(obj_totalEnvelopesUpdated) !== obj_totalEnvelopesUpdated)) {
|
|
3162
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalEnvelopesUpdated + '" (at "' + path_totalEnvelopesUpdated + '")');
|
|
3163
|
+
}
|
|
3164
|
+
})();
|
|
3165
|
+
return v_error === undefined ? null : v_error;
|
|
3166
|
+
}
|
|
3167
|
+
const RepresentationType$1 = 'EnvelopeStatusListResponse';
|
|
3168
|
+
function keyBuilder$1(luvio, config) {
|
|
3169
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.sourceObjectId;
|
|
3170
|
+
}
|
|
3171
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
3172
|
+
const keyParams = {
|
|
3173
|
+
sourceObjectId: object.sourceObjectId
|
|
3174
|
+
};
|
|
3175
|
+
return keyBuilder$1(luvio, keyParams);
|
|
3176
|
+
}
|
|
3177
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
3178
|
+
return input;
|
|
3179
|
+
}
|
|
3180
|
+
const select$3 = function EnvelopeStatusListResponseSelect() {
|
|
3181
|
+
const { selections: EnvelopeStatusResponse__selections, opaque: EnvelopeStatusResponse__opaque, } = select$4();
|
|
3182
|
+
return {
|
|
3183
|
+
kind: 'Fragment',
|
|
3184
|
+
version: VERSION$1,
|
|
3185
|
+
private: [],
|
|
3186
|
+
selections: [
|
|
3187
|
+
{
|
|
3188
|
+
name: 'signatureStatus',
|
|
3189
|
+
kind: 'Object',
|
|
3190
|
+
plural: true,
|
|
3191
|
+
selections: EnvelopeStatusResponse__selections
|
|
3192
|
+
},
|
|
3193
|
+
{
|
|
3194
|
+
name: 'sourceObjectId',
|
|
3195
|
+
kind: 'Scalar'
|
|
3196
|
+
},
|
|
3197
|
+
{
|
|
3198
|
+
name: 'totalEnvelopesToBeUpdated',
|
|
3199
|
+
kind: 'Scalar'
|
|
3200
|
+
},
|
|
3201
|
+
{
|
|
3202
|
+
name: 'totalEnvelopesUpdated',
|
|
3203
|
+
kind: 'Scalar'
|
|
3204
|
+
}
|
|
3205
|
+
]
|
|
3206
|
+
};
|
|
3207
|
+
};
|
|
3208
|
+
function equals$1(existing, incoming) {
|
|
3209
|
+
const existing_totalEnvelopesToBeUpdated = existing.totalEnvelopesToBeUpdated;
|
|
3210
|
+
const incoming_totalEnvelopesToBeUpdated = incoming.totalEnvelopesToBeUpdated;
|
|
3211
|
+
if (!(existing_totalEnvelopesToBeUpdated === incoming_totalEnvelopesToBeUpdated)) {
|
|
3212
|
+
return false;
|
|
3213
|
+
}
|
|
3214
|
+
const existing_totalEnvelopesUpdated = existing.totalEnvelopesUpdated;
|
|
3215
|
+
const incoming_totalEnvelopesUpdated = incoming.totalEnvelopesUpdated;
|
|
3216
|
+
if (!(existing_totalEnvelopesUpdated === incoming_totalEnvelopesUpdated)) {
|
|
3217
|
+
return false;
|
|
3218
|
+
}
|
|
3219
|
+
const existing_sourceObjectId = existing.sourceObjectId;
|
|
3220
|
+
const incoming_sourceObjectId = incoming.sourceObjectId;
|
|
3221
|
+
if (!(existing_sourceObjectId === incoming_sourceObjectId)) {
|
|
3222
|
+
return false;
|
|
3223
|
+
}
|
|
3224
|
+
const existing_signatureStatus = existing.signatureStatus;
|
|
3225
|
+
const incoming_signatureStatus = incoming.signatureStatus;
|
|
3226
|
+
const equals_signatureStatus_items = equalsArray(existing_signatureStatus, incoming_signatureStatus, (existing_signatureStatus_item, incoming_signatureStatus_item) => {
|
|
3227
|
+
if (!(equals$2(existing_signatureStatus_item, incoming_signatureStatus_item))) {
|
|
3228
|
+
return false;
|
|
3229
|
+
}
|
|
3230
|
+
});
|
|
3231
|
+
if (equals_signatureStatus_items === false) {
|
|
3232
|
+
return false;
|
|
3233
|
+
}
|
|
3234
|
+
return true;
|
|
3235
|
+
}
|
|
3236
|
+
const ingest$1 = function EnvelopeStatusListResponseIngest(input, path, luvio, store, timestamp) {
|
|
3237
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3238
|
+
const validateError = validate$2(input);
|
|
3239
|
+
if (validateError !== null) {
|
|
3240
|
+
throw validateError;
|
|
3241
|
+
}
|
|
3242
|
+
}
|
|
3243
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
3244
|
+
const existingRecord = store.readEntry(key);
|
|
3245
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
|
|
3246
|
+
let incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
3247
|
+
fullPath: key,
|
|
3248
|
+
parent: path.parent,
|
|
3249
|
+
propertyName: path.propertyName,
|
|
3250
|
+
ttl: ttlToUse
|
|
3251
|
+
});
|
|
3252
|
+
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
3253
|
+
luvio.storePublish(key, incomingRecord);
|
|
3254
|
+
}
|
|
3255
|
+
if (ttlToUse !== undefined) {
|
|
3256
|
+
const storeMetadataParams = {
|
|
3257
|
+
ttl: ttlToUse,
|
|
3258
|
+
namespace: "docgen",
|
|
3259
|
+
version: VERSION$1,
|
|
3260
|
+
representationName: RepresentationType$1,
|
|
3261
|
+
};
|
|
3262
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
3263
|
+
}
|
|
3264
|
+
return createLink(key);
|
|
3265
|
+
};
|
|
3266
|
+
function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
|
|
3267
|
+
const rootKeySet = new StoreKeyMap();
|
|
3268
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3269
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
3270
|
+
rootKeySet.set(rootKey, {
|
|
3271
|
+
namespace: keyPrefix,
|
|
3272
|
+
representationName: RepresentationType$1,
|
|
3273
|
+
mergeable: false
|
|
3274
|
+
});
|
|
3275
|
+
return rootKeySet;
|
|
3276
|
+
}
|
|
3277
|
+
|
|
3278
|
+
function select$2(luvio, params) {
|
|
3279
|
+
return select$3();
|
|
3280
|
+
}
|
|
3281
|
+
function getResponseCacheKeys$1(luvio, resourceParams, response) {
|
|
3282
|
+
return getTypeCacheKeys$1(luvio, response);
|
|
3283
|
+
}
|
|
3284
|
+
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
3285
|
+
const { body } = response;
|
|
3286
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
3287
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
3288
|
+
const snapshot = luvio.storeLookup({
|
|
3289
|
+
recordId: key,
|
|
3290
|
+
node: select$2(),
|
|
3291
|
+
variables: {},
|
|
3292
|
+
});
|
|
3293
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3294
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3295
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3296
|
+
}
|
|
3297
|
+
}
|
|
3298
|
+
return snapshot;
|
|
3299
|
+
}
|
|
3300
|
+
function createResourceRequest$1(config) {
|
|
3301
|
+
const headers = {};
|
|
3302
|
+
return {
|
|
3303
|
+
baseUri: '/services/data/v58.0',
|
|
3304
|
+
basePath: '/connect/e-sign/signature-requests/' + config.urlParams.sourceObjectId + '/envelopes/status',
|
|
3305
|
+
method: 'patch',
|
|
3306
|
+
body: null,
|
|
3307
|
+
urlParams: config.urlParams,
|
|
3308
|
+
queryParams: {},
|
|
3309
|
+
headers,
|
|
3310
|
+
priority: 'normal',
|
|
3311
|
+
};
|
|
3312
|
+
}
|
|
3313
|
+
|
|
3314
|
+
const updateEnvelope_ConfigPropertyNames = {
|
|
3315
|
+
displayName: 'updateEnvelope',
|
|
3316
|
+
parameters: {
|
|
3317
|
+
required: ['sourceObjectId'],
|
|
3318
|
+
optional: []
|
|
3319
|
+
}
|
|
3320
|
+
};
|
|
3321
|
+
function createResourceParams$1(config) {
|
|
3322
|
+
const resourceParams = {
|
|
3323
|
+
urlParams: {
|
|
3324
|
+
sourceObjectId: config.sourceObjectId
|
|
3325
|
+
}
|
|
3326
|
+
};
|
|
3327
|
+
return resourceParams;
|
|
3328
|
+
}
|
|
3329
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
3330
|
+
const config = {};
|
|
3331
|
+
const untrustedConfig_sourceObjectId = untrustedConfig.sourceObjectId;
|
|
3332
|
+
if (typeof untrustedConfig_sourceObjectId === 'string') {
|
|
3333
|
+
config.sourceObjectId = untrustedConfig_sourceObjectId;
|
|
3334
|
+
}
|
|
3335
|
+
return config;
|
|
3336
|
+
}
|
|
3337
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
3338
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3339
|
+
return null;
|
|
3340
|
+
}
|
|
3341
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3342
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3343
|
+
}
|
|
3344
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
3345
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3346
|
+
return null;
|
|
3347
|
+
}
|
|
3348
|
+
return config;
|
|
3349
|
+
}
|
|
3350
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
3351
|
+
const resourceParams = createResourceParams$1(config);
|
|
3352
|
+
const request = createResourceRequest$1(resourceParams);
|
|
3353
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3354
|
+
.then((response) => {
|
|
3355
|
+
return luvio.handleSuccessResponse(() => {
|
|
3356
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
3357
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3358
|
+
}, () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
|
|
3359
|
+
}, (response) => {
|
|
3360
|
+
deepFreeze(response);
|
|
3361
|
+
throw response;
|
|
3362
|
+
});
|
|
3363
|
+
}
|
|
3364
|
+
const updateEnvelopeAdapterFactory = (luvio) => {
|
|
3365
|
+
return function updateEnvelope(untrustedConfig) {
|
|
3366
|
+
const config = validateAdapterConfig$1(untrustedConfig, updateEnvelope_ConfigPropertyNames);
|
|
3367
|
+
// Invalid or incomplete config
|
|
3368
|
+
if (config === null) {
|
|
3369
|
+
throw new Error('Invalid config for "updateEnvelope"');
|
|
3370
|
+
}
|
|
3371
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
3372
|
+
};
|
|
3373
|
+
};
|
|
3374
|
+
|
|
3375
|
+
function validate$1(obj, path = 'EnvelopeVoidRequest') {
|
|
3376
|
+
const v_error = (() => {
|
|
3377
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3378
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3379
|
+
}
|
|
3380
|
+
const obj_senderEmail = obj.senderEmail;
|
|
3381
|
+
const path_senderEmail = path + '.senderEmail';
|
|
3382
|
+
if (typeof obj_senderEmail !== 'string') {
|
|
3383
|
+
return new TypeError('Expected "string" but received "' + typeof obj_senderEmail + '" (at "' + path_senderEmail + '")');
|
|
3384
|
+
}
|
|
3385
|
+
const obj_voidedReason = obj.voidedReason;
|
|
3386
|
+
const path_voidedReason = path + '.voidedReason';
|
|
3387
|
+
if (typeof obj_voidedReason !== 'string') {
|
|
3388
|
+
return new TypeError('Expected "string" but received "' + typeof obj_voidedReason + '" (at "' + path_voidedReason + '")');
|
|
3389
|
+
}
|
|
3390
|
+
})();
|
|
3391
|
+
return v_error === undefined ? null : v_error;
|
|
3392
|
+
}
|
|
3393
|
+
|
|
3394
|
+
const VERSION = "4ab3327ee7f8a460529061d0fda7ddc2";
|
|
3395
|
+
function validate(obj, path = 'EnvelopeVoidResponse') {
|
|
3396
|
+
const v_error = (() => {
|
|
3397
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3398
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3399
|
+
}
|
|
3400
|
+
const obj_failedEnvelopeList = obj.failedEnvelopeList;
|
|
3401
|
+
const path_failedEnvelopeList = path + '.failedEnvelopeList';
|
|
3402
|
+
if (!ArrayIsArray(obj_failedEnvelopeList)) {
|
|
3403
|
+
return new TypeError('Expected "array" but received "' + typeof obj_failedEnvelopeList + '" (at "' + path_failedEnvelopeList + '")');
|
|
3404
|
+
}
|
|
3405
|
+
for (let i = 0; i < obj_failedEnvelopeList.length; i++) {
|
|
3406
|
+
const obj_failedEnvelopeList_item = obj_failedEnvelopeList[i];
|
|
3407
|
+
const path_failedEnvelopeList_item = path_failedEnvelopeList + '[' + i + ']';
|
|
3408
|
+
const referencepath_failedEnvelopeList_itemValidationError = validate$3(obj_failedEnvelopeList_item, path_failedEnvelopeList_item);
|
|
3409
|
+
if (referencepath_failedEnvelopeList_itemValidationError !== null) {
|
|
3410
|
+
let message = 'Object doesn\'t match EnvelopeStatusResponse (at "' + path_failedEnvelopeList_item + '")\n';
|
|
3411
|
+
message += referencepath_failedEnvelopeList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3412
|
+
return new TypeError(message);
|
|
3413
|
+
}
|
|
3414
|
+
}
|
|
3415
|
+
const obj_sourceObjectId = obj.sourceObjectId;
|
|
3416
|
+
const path_sourceObjectId = path + '.sourceObjectId';
|
|
3417
|
+
if (typeof obj_sourceObjectId !== 'string') {
|
|
3418
|
+
return new TypeError('Expected "string" but received "' + typeof obj_sourceObjectId + '" (at "' + path_sourceObjectId + '")');
|
|
3419
|
+
}
|
|
3420
|
+
const obj_successfulEnvelopeIds = obj.successfulEnvelopeIds;
|
|
3421
|
+
const path_successfulEnvelopeIds = path + '.successfulEnvelopeIds';
|
|
3422
|
+
if (!ArrayIsArray(obj_successfulEnvelopeIds)) {
|
|
3423
|
+
return new TypeError('Expected "array" but received "' + typeof obj_successfulEnvelopeIds + '" (at "' + path_successfulEnvelopeIds + '")');
|
|
3424
|
+
}
|
|
3425
|
+
for (let i = 0; i < obj_successfulEnvelopeIds.length; i++) {
|
|
3426
|
+
const obj_successfulEnvelopeIds_item = obj_successfulEnvelopeIds[i];
|
|
3427
|
+
const path_successfulEnvelopeIds_item = path_successfulEnvelopeIds + '[' + i + ']';
|
|
3428
|
+
if (typeof obj_successfulEnvelopeIds_item !== 'string') {
|
|
3429
|
+
return new TypeError('Expected "string" but received "' + typeof obj_successfulEnvelopeIds_item + '" (at "' + path_successfulEnvelopeIds_item + '")');
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
const obj_totalEnvelopesToBeVoided = obj.totalEnvelopesToBeVoided;
|
|
3433
|
+
const path_totalEnvelopesToBeVoided = path + '.totalEnvelopesToBeVoided';
|
|
3434
|
+
if (typeof obj_totalEnvelopesToBeVoided !== 'number' || (typeof obj_totalEnvelopesToBeVoided === 'number' && Math.floor(obj_totalEnvelopesToBeVoided) !== obj_totalEnvelopesToBeVoided)) {
|
|
3435
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalEnvelopesToBeVoided + '" (at "' + path_totalEnvelopesToBeVoided + '")');
|
|
3436
|
+
}
|
|
3437
|
+
const obj_totalEnvelopesVoided = obj.totalEnvelopesVoided;
|
|
3438
|
+
const path_totalEnvelopesVoided = path + '.totalEnvelopesVoided';
|
|
3439
|
+
if (typeof obj_totalEnvelopesVoided !== 'number' || (typeof obj_totalEnvelopesVoided === 'number' && Math.floor(obj_totalEnvelopesVoided) !== obj_totalEnvelopesVoided)) {
|
|
3440
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalEnvelopesVoided + '" (at "' + path_totalEnvelopesVoided + '")');
|
|
3441
|
+
}
|
|
3442
|
+
})();
|
|
3443
|
+
return v_error === undefined ? null : v_error;
|
|
3444
|
+
}
|
|
3445
|
+
const RepresentationType = 'EnvelopeVoidResponse';
|
|
3446
|
+
function keyBuilder(luvio, config) {
|
|
3447
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.sourceObjectId;
|
|
3448
|
+
}
|
|
3449
|
+
function keyBuilderFromType(luvio, object) {
|
|
3450
|
+
const keyParams = {
|
|
3451
|
+
sourceObjectId: object.sourceObjectId
|
|
3452
|
+
};
|
|
3453
|
+
return keyBuilder(luvio, keyParams);
|
|
3454
|
+
}
|
|
3455
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
3456
|
+
return input;
|
|
3457
|
+
}
|
|
3458
|
+
const select$1 = function EnvelopeVoidResponseSelect() {
|
|
3459
|
+
const { selections: EnvelopeStatusResponse__selections, opaque: EnvelopeStatusResponse__opaque, } = select$4();
|
|
3460
|
+
return {
|
|
3461
|
+
kind: 'Fragment',
|
|
3462
|
+
version: VERSION,
|
|
3463
|
+
private: [],
|
|
3464
|
+
selections: [
|
|
3465
|
+
{
|
|
3466
|
+
name: 'failedEnvelopeList',
|
|
3467
|
+
kind: 'Object',
|
|
3468
|
+
plural: true,
|
|
3469
|
+
selections: EnvelopeStatusResponse__selections
|
|
3470
|
+
},
|
|
3471
|
+
{
|
|
3472
|
+
name: 'sourceObjectId',
|
|
3473
|
+
kind: 'Scalar'
|
|
3474
|
+
},
|
|
3475
|
+
{
|
|
3476
|
+
name: 'successfulEnvelopeIds',
|
|
3477
|
+
kind: 'Scalar',
|
|
3478
|
+
plural: true
|
|
3479
|
+
},
|
|
3480
|
+
{
|
|
3481
|
+
name: 'totalEnvelopesToBeVoided',
|
|
3482
|
+
kind: 'Scalar'
|
|
3483
|
+
},
|
|
3484
|
+
{
|
|
3485
|
+
name: 'totalEnvelopesVoided',
|
|
3486
|
+
kind: 'Scalar'
|
|
3487
|
+
}
|
|
3488
|
+
]
|
|
3489
|
+
};
|
|
3490
|
+
};
|
|
3491
|
+
function equals(existing, incoming) {
|
|
3492
|
+
const existing_totalEnvelopesToBeVoided = existing.totalEnvelopesToBeVoided;
|
|
3493
|
+
const incoming_totalEnvelopesToBeVoided = incoming.totalEnvelopesToBeVoided;
|
|
3494
|
+
if (!(existing_totalEnvelopesToBeVoided === incoming_totalEnvelopesToBeVoided)) {
|
|
3495
|
+
return false;
|
|
3496
|
+
}
|
|
3497
|
+
const existing_totalEnvelopesVoided = existing.totalEnvelopesVoided;
|
|
3498
|
+
const incoming_totalEnvelopesVoided = incoming.totalEnvelopesVoided;
|
|
3499
|
+
if (!(existing_totalEnvelopesVoided === incoming_totalEnvelopesVoided)) {
|
|
3500
|
+
return false;
|
|
3501
|
+
}
|
|
3502
|
+
const existing_sourceObjectId = existing.sourceObjectId;
|
|
3503
|
+
const incoming_sourceObjectId = incoming.sourceObjectId;
|
|
3504
|
+
if (!(existing_sourceObjectId === incoming_sourceObjectId)) {
|
|
3505
|
+
return false;
|
|
3506
|
+
}
|
|
3507
|
+
const existing_failedEnvelopeList = existing.failedEnvelopeList;
|
|
3508
|
+
const incoming_failedEnvelopeList = incoming.failedEnvelopeList;
|
|
3509
|
+
const equals_failedEnvelopeList_items = equalsArray(existing_failedEnvelopeList, incoming_failedEnvelopeList, (existing_failedEnvelopeList_item, incoming_failedEnvelopeList_item) => {
|
|
3510
|
+
if (!(equals$2(existing_failedEnvelopeList_item, incoming_failedEnvelopeList_item))) {
|
|
3511
|
+
return false;
|
|
3512
|
+
}
|
|
3513
|
+
});
|
|
3514
|
+
if (equals_failedEnvelopeList_items === false) {
|
|
3515
|
+
return false;
|
|
3516
|
+
}
|
|
3517
|
+
const existing_successfulEnvelopeIds = existing.successfulEnvelopeIds;
|
|
3518
|
+
const incoming_successfulEnvelopeIds = incoming.successfulEnvelopeIds;
|
|
3519
|
+
const equals_successfulEnvelopeIds_items = equalsArray(existing_successfulEnvelopeIds, incoming_successfulEnvelopeIds, (existing_successfulEnvelopeIds_item, incoming_successfulEnvelopeIds_item) => {
|
|
3520
|
+
if (!(existing_successfulEnvelopeIds_item === incoming_successfulEnvelopeIds_item)) {
|
|
3521
|
+
return false;
|
|
3522
|
+
}
|
|
3523
|
+
});
|
|
3524
|
+
if (equals_successfulEnvelopeIds_items === false) {
|
|
3525
|
+
return false;
|
|
3526
|
+
}
|
|
3527
|
+
return true;
|
|
3528
|
+
}
|
|
3529
|
+
const ingest = function EnvelopeVoidResponseIngest(input, path, luvio, store, timestamp) {
|
|
3530
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3531
|
+
const validateError = validate(input);
|
|
3532
|
+
if (validateError !== null) {
|
|
3533
|
+
throw validateError;
|
|
3534
|
+
}
|
|
3535
|
+
}
|
|
3536
|
+
const key = keyBuilderFromType(luvio, input);
|
|
3537
|
+
const existingRecord = store.readEntry(key);
|
|
3538
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
|
|
3539
|
+
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
3540
|
+
fullPath: key,
|
|
3541
|
+
parent: path.parent,
|
|
3542
|
+
propertyName: path.propertyName,
|
|
3543
|
+
ttl: ttlToUse
|
|
3544
|
+
});
|
|
3545
|
+
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
3546
|
+
luvio.storePublish(key, incomingRecord);
|
|
3547
|
+
}
|
|
3548
|
+
if (ttlToUse !== undefined) {
|
|
3549
|
+
const storeMetadataParams = {
|
|
3550
|
+
ttl: ttlToUse,
|
|
3551
|
+
namespace: "docgen",
|
|
3552
|
+
version: VERSION,
|
|
3553
|
+
representationName: RepresentationType,
|
|
3554
|
+
};
|
|
3555
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
3556
|
+
}
|
|
3557
|
+
return createLink(key);
|
|
3558
|
+
};
|
|
3559
|
+
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
3560
|
+
const rootKeySet = new StoreKeyMap();
|
|
3561
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3562
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
3563
|
+
rootKeySet.set(rootKey, {
|
|
3564
|
+
namespace: keyPrefix,
|
|
3565
|
+
representationName: RepresentationType,
|
|
3566
|
+
mergeable: false
|
|
3567
|
+
});
|
|
3568
|
+
return rootKeySet;
|
|
3569
|
+
}
|
|
3570
|
+
|
|
3571
|
+
function select(luvio, params) {
|
|
3572
|
+
return select$1();
|
|
3573
|
+
}
|
|
3574
|
+
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
3575
|
+
return getTypeCacheKeys(luvio, response);
|
|
3576
|
+
}
|
|
3577
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
3578
|
+
const { body } = response;
|
|
3579
|
+
const key = keyBuilderFromType(luvio, body);
|
|
3580
|
+
luvio.storeIngest(key, ingest, body);
|
|
3581
|
+
const snapshot = luvio.storeLookup({
|
|
3582
|
+
recordId: key,
|
|
3583
|
+
node: select(),
|
|
3584
|
+
variables: {},
|
|
3585
|
+
});
|
|
3586
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3587
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3588
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3589
|
+
}
|
|
3590
|
+
}
|
|
3591
|
+
return snapshot;
|
|
3592
|
+
}
|
|
3593
|
+
function createResourceRequest(config) {
|
|
3594
|
+
const headers = {};
|
|
3595
|
+
return {
|
|
3596
|
+
baseUri: '/services/data/v58.0',
|
|
3597
|
+
basePath: '/connect/e-sign/signature-requests/' + config.urlParams.sourceObjectId + '/envelopes/void',
|
|
3598
|
+
method: 'patch',
|
|
3599
|
+
body: config.body,
|
|
3600
|
+
urlParams: config.urlParams,
|
|
3601
|
+
queryParams: {},
|
|
3602
|
+
headers,
|
|
3603
|
+
priority: 'normal',
|
|
3604
|
+
};
|
|
3605
|
+
}
|
|
3606
|
+
|
|
3607
|
+
const updateVoidedEnvelope_ConfigPropertyNames = {
|
|
3608
|
+
displayName: 'updateVoidedEnvelope',
|
|
3609
|
+
parameters: {
|
|
3610
|
+
required: ['sourceObjectId', 'voidParam'],
|
|
3611
|
+
optional: []
|
|
3612
|
+
}
|
|
3613
|
+
};
|
|
3614
|
+
function createResourceParams(config) {
|
|
3615
|
+
const resourceParams = {
|
|
3616
|
+
urlParams: {
|
|
3617
|
+
sourceObjectId: config.sourceObjectId
|
|
3618
|
+
},
|
|
3619
|
+
body: {
|
|
3620
|
+
voidParam: config.voidParam
|
|
3621
|
+
}
|
|
3622
|
+
};
|
|
3623
|
+
return resourceParams;
|
|
3624
|
+
}
|
|
3625
|
+
function typeCheckConfig(untrustedConfig) {
|
|
3626
|
+
const config = {};
|
|
3627
|
+
const untrustedConfig_sourceObjectId = untrustedConfig.sourceObjectId;
|
|
3628
|
+
if (typeof untrustedConfig_sourceObjectId === 'string') {
|
|
3629
|
+
config.sourceObjectId = untrustedConfig_sourceObjectId;
|
|
3630
|
+
}
|
|
3631
|
+
const untrustedConfig_voidParam = untrustedConfig.voidParam;
|
|
3632
|
+
const referenceEnvelopeVoidRequestValidationError = validate$1(untrustedConfig_voidParam);
|
|
3633
|
+
if (referenceEnvelopeVoidRequestValidationError === null) {
|
|
3634
|
+
config.voidParam = untrustedConfig_voidParam;
|
|
3635
|
+
}
|
|
3636
|
+
return config;
|
|
3637
|
+
}
|
|
3638
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
3639
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3640
|
+
return null;
|
|
3641
|
+
}
|
|
3642
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3643
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3644
|
+
}
|
|
3645
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
3646
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3647
|
+
return null;
|
|
3648
|
+
}
|
|
3649
|
+
return config;
|
|
3650
|
+
}
|
|
3651
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
3652
|
+
const resourceParams = createResourceParams(config);
|
|
3653
|
+
const request = createResourceRequest(resourceParams);
|
|
3654
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3655
|
+
.then((response) => {
|
|
3656
|
+
return luvio.handleSuccessResponse(() => {
|
|
3657
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
3658
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3659
|
+
}, () => getResponseCacheKeys(luvio, resourceParams, response.body));
|
|
3660
|
+
}, (response) => {
|
|
3661
|
+
deepFreeze(response);
|
|
3662
|
+
throw response;
|
|
3663
|
+
});
|
|
3664
|
+
}
|
|
3665
|
+
const updateVoidedEnvelopeAdapterFactory = (luvio) => {
|
|
3666
|
+
return function updateVoidedEnvelope(untrustedConfig) {
|
|
3667
|
+
const config = validateAdapterConfig(untrustedConfig, updateVoidedEnvelope_ConfigPropertyNames);
|
|
3668
|
+
// Invalid or incomplete config
|
|
3669
|
+
if (config === null) {
|
|
3670
|
+
throw new Error('Invalid config for "updateVoidedEnvelope"');
|
|
3671
|
+
}
|
|
3672
|
+
return buildNetworkSnapshot(luvio, config);
|
|
3673
|
+
};
|
|
3674
|
+
};
|
|
3675
|
+
|
|
3676
|
+
let createDocumentEnvelopeForEsign;
|
|
3677
|
+
let getDocumentClauseFields;
|
|
3678
|
+
let getDocumentClauseSetCategories;
|
|
3679
|
+
let getDocumentClauseSets;
|
|
3680
|
+
let getDocuments;
|
|
3681
|
+
let getESignNotificationSettings;
|
|
3682
|
+
let getRecipients;
|
|
3683
|
+
let getSignerRoles;
|
|
3684
|
+
let updateEnvelope;
|
|
3685
|
+
let updateVoidedEnvelope;
|
|
3686
|
+
// Imperative GET Adapters
|
|
3687
|
+
let getDocumentClauseFields_imperative;
|
|
3688
|
+
let getDocumentClauseSetCategories_imperative;
|
|
3689
|
+
let getDocumentClauseSets_imperative;
|
|
3690
|
+
let getDocuments_imperative;
|
|
3691
|
+
let getESignNotificationSettings_imperative;
|
|
3692
|
+
let getRecipients_imperative;
|
|
3693
|
+
let getSignerRoles_imperative;
|
|
3694
|
+
const getDocumentClauseFieldsMetadata = { apiFamily: 'docgen', name: 'getDocumentClauseFields', ttl: 100 };
|
|
3695
|
+
const getDocumentClauseSetCategoriesMetadata = { apiFamily: 'docgen', name: 'getDocumentClauseSetCategories', ttl: 30000 };
|
|
3696
|
+
const getDocumentClauseSetsMetadata = { apiFamily: 'docgen', name: 'getDocumentClauseSets', ttl: 100 };
|
|
3697
|
+
const getDocumentsMetadata = { apiFamily: 'docgen', name: 'getDocuments', ttl: 60000 };
|
|
3698
|
+
const getESignNotificationSettingsMetadata = { apiFamily: 'docgen', name: 'getESignNotificationSettings', ttl: 60000 };
|
|
3699
|
+
const getRecipientsMetadata = { apiFamily: 'docgen', name: 'getRecipients', ttl: 60000 };
|
|
3700
|
+
const getSignerRolesMetadata = { apiFamily: 'docgen', name: 'getSignerRoles', ttl: 60000 };
|
|
3701
|
+
function bindExportsTo(luvio) {
|
|
3702
|
+
// LDS Adapters
|
|
3703
|
+
const getDocumentClauseFields_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDocumentClauseFields', getDocumentClauseFieldsAdapterFactory), getDocumentClauseFieldsMetadata);
|
|
3704
|
+
const getDocumentClauseSetCategories_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDocumentClauseSetCategories', getDocumentClauseSetCategoriesAdapterFactory), getDocumentClauseSetCategoriesMetadata);
|
|
3705
|
+
const getDocumentClauseSets_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDocumentClauseSets', getDocumentClauseSetsAdapterFactory), getDocumentClauseSetsMetadata);
|
|
3706
|
+
const getDocuments_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDocuments', getDocumentsAdapterFactory), getDocumentsMetadata);
|
|
3707
|
+
const getESignNotificationSettings_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getESignNotificationSettings', getESignNotificationSettingsAdapterFactory), getESignNotificationSettingsMetadata);
|
|
3708
|
+
const getRecipients_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRecipients', getRecipientsAdapterFactory), getRecipientsMetadata);
|
|
3709
|
+
const getSignerRoles_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getSignerRoles', getSignerRolesAdapterFactory), getSignerRolesMetadata);
|
|
3710
|
+
function unwrapSnapshotData(factory) {
|
|
3711
|
+
const adapter = factory(luvio);
|
|
3712
|
+
return (config) => adapter(config).then(snapshot => snapshot.data);
|
|
3713
|
+
}
|
|
3714
|
+
return {
|
|
3715
|
+
createDocumentEnvelopeForEsign: unwrapSnapshotData(createDocumentEnvelopeForEsignAdapterFactory),
|
|
3716
|
+
getDocumentClauseFields: createWireAdapterConstructor(luvio, getDocumentClauseFields_ldsAdapter, getDocumentClauseFieldsMetadata),
|
|
3717
|
+
getDocumentClauseSetCategories: createWireAdapterConstructor(luvio, getDocumentClauseSetCategories_ldsAdapter, getDocumentClauseSetCategoriesMetadata),
|
|
3718
|
+
getDocumentClauseSets: createWireAdapterConstructor(luvio, getDocumentClauseSets_ldsAdapter, getDocumentClauseSetsMetadata),
|
|
3719
|
+
getDocuments: createWireAdapterConstructor(luvio, getDocuments_ldsAdapter, getDocumentsMetadata),
|
|
3720
|
+
getESignNotificationSettings: createWireAdapterConstructor(luvio, getESignNotificationSettings_ldsAdapter, getESignNotificationSettingsMetadata),
|
|
3721
|
+
getRecipients: createWireAdapterConstructor(luvio, getRecipients_ldsAdapter, getRecipientsMetadata),
|
|
3722
|
+
getSignerRoles: createWireAdapterConstructor(luvio, getSignerRoles_ldsAdapter, getSignerRolesMetadata),
|
|
3723
|
+
updateEnvelope: unwrapSnapshotData(updateEnvelopeAdapterFactory),
|
|
3724
|
+
updateVoidedEnvelope: unwrapSnapshotData(updateVoidedEnvelopeAdapterFactory),
|
|
3725
|
+
// Imperative GET Adapters
|
|
3726
|
+
getDocumentClauseFields_imperative: createImperativeAdapter(luvio, getDocumentClauseFields_ldsAdapter, getDocumentClauseFieldsMetadata),
|
|
3727
|
+
getDocumentClauseSetCategories_imperative: createImperativeAdapter(luvio, getDocumentClauseSetCategories_ldsAdapter, getDocumentClauseSetCategoriesMetadata),
|
|
3728
|
+
getDocumentClauseSets_imperative: createImperativeAdapter(luvio, getDocumentClauseSets_ldsAdapter, getDocumentClauseSetsMetadata),
|
|
3729
|
+
getDocuments_imperative: createImperativeAdapter(luvio, getDocuments_ldsAdapter, getDocumentsMetadata),
|
|
3730
|
+
getESignNotificationSettings_imperative: createImperativeAdapter(luvio, getESignNotificationSettings_ldsAdapter, getESignNotificationSettingsMetadata),
|
|
3731
|
+
getRecipients_imperative: createImperativeAdapter(luvio, getRecipients_ldsAdapter, getRecipientsMetadata),
|
|
3732
|
+
getSignerRoles_imperative: createImperativeAdapter(luvio, getSignerRoles_ldsAdapter, getSignerRolesMetadata)
|
|
3733
|
+
};
|
|
3734
|
+
}
|
|
3735
|
+
withDefaultLuvio((luvio) => {
|
|
3736
|
+
({
|
|
3737
|
+
createDocumentEnvelopeForEsign,
|
|
3738
|
+
getDocumentClauseFields,
|
|
3739
|
+
getDocumentClauseSetCategories,
|
|
3740
|
+
getDocumentClauseSets,
|
|
3741
|
+
getDocuments,
|
|
3742
|
+
getESignNotificationSettings,
|
|
3743
|
+
getRecipients,
|
|
3744
|
+
getSignerRoles,
|
|
3745
|
+
updateEnvelope,
|
|
3746
|
+
updateVoidedEnvelope,
|
|
3747
|
+
getDocumentClauseFields_imperative,
|
|
3748
|
+
getDocumentClauseSetCategories_imperative,
|
|
3749
|
+
getDocumentClauseSets_imperative,
|
|
3750
|
+
getDocuments_imperative,
|
|
3751
|
+
getESignNotificationSettings_imperative,
|
|
3752
|
+
getRecipients_imperative,
|
|
3753
|
+
getSignerRoles_imperative
|
|
3754
|
+
} = bindExportsTo(luvio));
|
|
3755
|
+
});
|
|
3756
|
+
|
|
3757
|
+
export { createDocumentEnvelopeForEsign, getDocumentClauseFields, getDocumentClauseFields_imperative, getDocumentClauseSetCategories, getDocumentClauseSetCategories_imperative, getDocumentClauseSets, getDocumentClauseSets_imperative, getDocuments, getDocuments_imperative, getESignNotificationSettings, getESignNotificationSettings_imperative, getRecipients, getRecipients_imperative, getSignerRoles, getSignerRoles_imperative, updateEnvelope, updateVoidedEnvelope };
|
|
3758
|
+
// version: 0.131.0-c1ec5b7de
|