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