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