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