@salesforce/lds-adapters-sales-people-api 1.124.2 → 1.124.3

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.
@@ -6,637 +6,637 @@
6
6
 
7
7
  import { serializeStructuredKey, StoreKeyMap } from '@luvio/engine';
8
8
 
9
- const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
- const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
11
- const { isArray: ArrayIsArray$1 } = Array;
12
- /**
13
- * Validates an adapter config is well-formed.
14
- * @param config The config to validate.
15
- * @param adapter The adapter validation configuration.
16
- * @param oneOf The keys the config must contain at least one of.
17
- * @throws A TypeError if config doesn't satisfy the adapter's config validation.
18
- */
19
- function validateConfig(config, adapter, oneOf) {
20
- const { displayName } = adapter;
21
- const { required, optional, unsupported } = adapter.parameters;
22
- if (config === undefined ||
23
- required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
24
- throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
25
- }
26
- if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
27
- throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
28
- }
29
- if (unsupported !== undefined &&
30
- unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
31
- throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
- }
33
- const supported = required.concat(optional);
34
- if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
35
- throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
- }
37
- }
38
- function untrustedIsObject(untrusted) {
39
- return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
40
- }
41
- function areRequiredParametersPresent(config, configPropertyNames) {
42
- return configPropertyNames.parameters.required.every(req => req in config);
43
- }
44
- const snapshotRefreshOptions = {
45
- overrides: {
46
- headers: {
47
- 'Cache-Control': 'no-cache',
48
- },
49
- }
50
- };
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
11
+ const { isArray: ArrayIsArray$1 } = Array;
12
+ /**
13
+ * Validates an adapter config is well-formed.
14
+ * @param config The config to validate.
15
+ * @param adapter The adapter validation configuration.
16
+ * @param oneOf The keys the config must contain at least one of.
17
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
18
+ */
19
+ function validateConfig(config, adapter, oneOf) {
20
+ const { displayName } = adapter;
21
+ const { required, optional, unsupported } = adapter.parameters;
22
+ if (config === undefined ||
23
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
24
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
25
+ }
26
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
27
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
28
+ }
29
+ if (unsupported !== undefined &&
30
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
31
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
+ }
33
+ const supported = required.concat(optional);
34
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
35
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
+ }
37
+ }
38
+ function untrustedIsObject(untrusted) {
39
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
40
+ }
41
+ function areRequiredParametersPresent(config, configPropertyNames) {
42
+ return configPropertyNames.parameters.required.every(req => req in config);
43
+ }
44
+ const snapshotRefreshOptions = {
45
+ overrides: {
46
+ headers: {
47
+ 'Cache-Control': 'no-cache',
48
+ },
49
+ }
50
+ };
51
51
  const keyPrefix = 'people-api';
52
52
 
53
- const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
54
- const { isArray: ArrayIsArray } = Array;
55
- const { stringify: JSONStringify } = JSON;
56
- function createLink(ref) {
57
- return {
58
- __ref: serializeStructuredKey(ref),
59
- };
53
+ const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
54
+ const { isArray: ArrayIsArray } = Array;
55
+ const { stringify: JSONStringify } = JSON;
56
+ function createLink(ref) {
57
+ return {
58
+ __ref: serializeStructuredKey(ref),
59
+ };
60
60
  }
61
61
 
62
- function validate$7(obj, path = 'PhysAddressUi') {
63
- const v_error = (() => {
64
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
65
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
66
- }
67
- const obj_apartment = obj.apartment;
68
- const path_apartment = path + '.apartment';
69
- if (typeof obj_apartment !== 'string') {
70
- return new TypeError('Expected "string" but received "' + typeof obj_apartment + '" (at "' + path_apartment + '")');
71
- }
72
- const obj_city = obj.city;
73
- const path_city = path + '.city';
74
- if (typeof obj_city !== 'string') {
75
- return new TypeError('Expected "string" but received "' + typeof obj_city + '" (at "' + path_city + '")');
76
- }
77
- const obj_country = obj.country;
78
- const path_country = path + '.country';
79
- if (typeof obj_country !== 'string') {
80
- return new TypeError('Expected "string" but received "' + typeof obj_country + '" (at "' + path_country + '")');
81
- }
82
- const obj_houseNo = obj.houseNo;
83
- const path_houseNo = path + '.houseNo';
84
- if (typeof obj_houseNo !== 'string') {
85
- return new TypeError('Expected "string" but received "' + typeof obj_houseNo + '" (at "' + path_houseNo + '")');
86
- }
87
- const obj_poBox = obj.poBox;
88
- const path_poBox = path + '.poBox';
89
- if (typeof obj_poBox !== 'string') {
90
- return new TypeError('Expected "string" but received "' + typeof obj_poBox + '" (at "' + path_poBox + '")');
91
- }
92
- const obj_postalCode = obj.postalCode;
93
- const path_postalCode = path + '.postalCode';
94
- if (typeof obj_postalCode !== 'string') {
95
- return new TypeError('Expected "string" but received "' + typeof obj_postalCode + '" (at "' + path_postalCode + '")');
96
- }
97
- const obj_state = obj.state;
98
- const path_state = path + '.state';
99
- if (typeof obj_state !== 'string') {
100
- return new TypeError('Expected "string" but received "' + typeof obj_state + '" (at "' + path_state + '")');
101
- }
102
- const obj_street = obj.street;
103
- const path_street = path + '.street';
104
- if (typeof obj_street !== 'string') {
105
- return new TypeError('Expected "string" but received "' + typeof obj_street + '" (at "' + path_street + '")');
106
- }
107
- })();
108
- return v_error === undefined ? null : v_error;
109
- }
110
- function deepFreeze$7(input) {
111
- ObjectFreeze(input);
62
+ function validate$7(obj, path = 'PhysAddressUi') {
63
+ const v_error = (() => {
64
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
65
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
66
+ }
67
+ const obj_apartment = obj.apartment;
68
+ const path_apartment = path + '.apartment';
69
+ if (typeof obj_apartment !== 'string') {
70
+ return new TypeError('Expected "string" but received "' + typeof obj_apartment + '" (at "' + path_apartment + '")');
71
+ }
72
+ const obj_city = obj.city;
73
+ const path_city = path + '.city';
74
+ if (typeof obj_city !== 'string') {
75
+ return new TypeError('Expected "string" but received "' + typeof obj_city + '" (at "' + path_city + '")');
76
+ }
77
+ const obj_country = obj.country;
78
+ const path_country = path + '.country';
79
+ if (typeof obj_country !== 'string') {
80
+ return new TypeError('Expected "string" but received "' + typeof obj_country + '" (at "' + path_country + '")');
81
+ }
82
+ const obj_houseNo = obj.houseNo;
83
+ const path_houseNo = path + '.houseNo';
84
+ if (typeof obj_houseNo !== 'string') {
85
+ return new TypeError('Expected "string" but received "' + typeof obj_houseNo + '" (at "' + path_houseNo + '")');
86
+ }
87
+ const obj_poBox = obj.poBox;
88
+ const path_poBox = path + '.poBox';
89
+ if (typeof obj_poBox !== 'string') {
90
+ return new TypeError('Expected "string" but received "' + typeof obj_poBox + '" (at "' + path_poBox + '")');
91
+ }
92
+ const obj_postalCode = obj.postalCode;
93
+ const path_postalCode = path + '.postalCode';
94
+ if (typeof obj_postalCode !== 'string') {
95
+ return new TypeError('Expected "string" but received "' + typeof obj_postalCode + '" (at "' + path_postalCode + '")');
96
+ }
97
+ const obj_state = obj.state;
98
+ const path_state = path + '.state';
99
+ if (typeof obj_state !== 'string') {
100
+ return new TypeError('Expected "string" but received "' + typeof obj_state + '" (at "' + path_state + '")');
101
+ }
102
+ const obj_street = obj.street;
103
+ const path_street = path + '.street';
104
+ if (typeof obj_street !== 'string') {
105
+ return new TypeError('Expected "string" but received "' + typeof obj_street + '" (at "' + path_street + '")');
106
+ }
107
+ })();
108
+ return v_error === undefined ? null : v_error;
109
+ }
110
+ function deepFreeze$7(input) {
111
+ ObjectFreeze(input);
112
112
  }
113
113
 
114
- function validate$6(obj, path = 'NameUi') {
115
- const v_error = (() => {
116
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
117
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
118
- }
119
- const obj_first = obj.first;
120
- const path_first = path + '.first';
121
- if (typeof obj_first !== 'string') {
122
- return new TypeError('Expected "string" but received "' + typeof obj_first + '" (at "' + path_first + '")');
123
- }
124
- const obj_initials = obj.initials;
125
- const path_initials = path + '.initials';
126
- if (typeof obj_initials !== 'string') {
127
- return new TypeError('Expected "string" but received "' + typeof obj_initials + '" (at "' + path_initials + '")');
128
- }
129
- const obj_last = obj.last;
130
- const path_last = path + '.last';
131
- if (typeof obj_last !== 'string') {
132
- return new TypeError('Expected "string" but received "' + typeof obj_last + '" (at "' + path_last + '")');
133
- }
134
- })();
135
- return v_error === undefined ? null : v_error;
136
- }
137
- function deepFreeze$6(input) {
138
- ObjectFreeze(input);
114
+ function validate$6(obj, path = 'NameUi') {
115
+ const v_error = (() => {
116
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
117
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
118
+ }
119
+ const obj_first = obj.first;
120
+ const path_first = path + '.first';
121
+ if (typeof obj_first !== 'string') {
122
+ return new TypeError('Expected "string" but received "' + typeof obj_first + '" (at "' + path_first + '")');
123
+ }
124
+ const obj_initials = obj.initials;
125
+ const path_initials = path + '.initials';
126
+ if (typeof obj_initials !== 'string') {
127
+ return new TypeError('Expected "string" but received "' + typeof obj_initials + '" (at "' + path_initials + '")');
128
+ }
129
+ const obj_last = obj.last;
130
+ const path_last = path + '.last';
131
+ if (typeof obj_last !== 'string') {
132
+ return new TypeError('Expected "string" but received "' + typeof obj_last + '" (at "' + path_last + '")');
133
+ }
134
+ })();
135
+ return v_error === undefined ? null : v_error;
136
+ }
137
+ function deepFreeze$6(input) {
138
+ ObjectFreeze(input);
139
139
  }
140
140
 
141
- function validate$5(obj, path = 'PhoneUi') {
142
- const v_error = (() => {
143
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
144
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
145
- }
146
- const obj_countryCode = obj.countryCode;
147
- const path_countryCode = path + '.countryCode';
148
- if (typeof obj_countryCode !== 'string') {
149
- return new TypeError('Expected "string" but received "' + typeof obj_countryCode + '" (at "' + path_countryCode + '")');
150
- }
151
- const obj_extension = obj.extension;
152
- const path_extension = path + '.extension';
153
- if (typeof obj_extension !== 'string') {
154
- return new TypeError('Expected "string" but received "' + typeof obj_extension + '" (at "' + path_extension + '")');
155
- }
156
- const obj_number = obj.number;
157
- const path_number = path + '.number';
158
- if (typeof obj_number !== 'string') {
159
- return new TypeError('Expected "string" but received "' + typeof obj_number + '" (at "' + path_number + '")');
160
- }
161
- const obj_phoneType = obj.phoneType;
162
- const path_phoneType = path + '.phoneType';
163
- if (typeof obj_phoneType !== 'string') {
164
- return new TypeError('Expected "string" but received "' + typeof obj_phoneType + '" (at "' + path_phoneType + '")');
165
- }
166
- })();
167
- return v_error === undefined ? null : v_error;
168
- }
169
- function deepFreeze$5(input) {
170
- ObjectFreeze(input);
141
+ function validate$5(obj, path = 'PhoneUi') {
142
+ const v_error = (() => {
143
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
144
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
145
+ }
146
+ const obj_countryCode = obj.countryCode;
147
+ const path_countryCode = path + '.countryCode';
148
+ if (typeof obj_countryCode !== 'string') {
149
+ return new TypeError('Expected "string" but received "' + typeof obj_countryCode + '" (at "' + path_countryCode + '")');
150
+ }
151
+ const obj_extension = obj.extension;
152
+ const path_extension = path + '.extension';
153
+ if (typeof obj_extension !== 'string') {
154
+ return new TypeError('Expected "string" but received "' + typeof obj_extension + '" (at "' + path_extension + '")');
155
+ }
156
+ const obj_number = obj.number;
157
+ const path_number = path + '.number';
158
+ if (typeof obj_number !== 'string') {
159
+ return new TypeError('Expected "string" but received "' + typeof obj_number + '" (at "' + path_number + '")');
160
+ }
161
+ const obj_phoneType = obj.phoneType;
162
+ const path_phoneType = path + '.phoneType';
163
+ if (typeof obj_phoneType !== 'string') {
164
+ return new TypeError('Expected "string" but received "' + typeof obj_phoneType + '" (at "' + path_phoneType + '")');
165
+ }
166
+ })();
167
+ return v_error === undefined ? null : v_error;
168
+ }
169
+ function deepFreeze$5(input) {
170
+ ObjectFreeze(input);
171
171
  }
172
172
 
173
- function validate$4(obj, path = 'SocialMediaUi') {
174
- const v_error = (() => {
175
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
176
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
177
- }
178
- const obj_handle = obj.handle;
179
- const path_handle = path + '.handle';
180
- if (typeof obj_handle !== 'string') {
181
- return new TypeError('Expected "string" but received "' + typeof obj_handle + '" (at "' + path_handle + '")');
182
- }
183
- const obj_link = obj.link;
184
- const path_link = path + '.link';
185
- if (typeof obj_link !== 'string') {
186
- return new TypeError('Expected "string" but received "' + typeof obj_link + '" (at "' + path_link + '")');
187
- }
188
- const obj_service = obj.service;
189
- const path_service = path + '.service';
190
- if (typeof obj_service !== 'string') {
191
- return new TypeError('Expected "string" but received "' + typeof obj_service + '" (at "' + path_service + '")');
192
- }
193
- })();
194
- return v_error === undefined ? null : v_error;
195
- }
196
- function deepFreeze$4(input) {
197
- ObjectFreeze(input);
173
+ function validate$4(obj, path = 'SocialMediaUi') {
174
+ const v_error = (() => {
175
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
176
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
177
+ }
178
+ const obj_handle = obj.handle;
179
+ const path_handle = path + '.handle';
180
+ if (typeof obj_handle !== 'string') {
181
+ return new TypeError('Expected "string" but received "' + typeof obj_handle + '" (at "' + path_handle + '")');
182
+ }
183
+ const obj_link = obj.link;
184
+ const path_link = path + '.link';
185
+ if (typeof obj_link !== 'string') {
186
+ return new TypeError('Expected "string" but received "' + typeof obj_link + '" (at "' + path_link + '")');
187
+ }
188
+ const obj_service = obj.service;
189
+ const path_service = path + '.service';
190
+ if (typeof obj_service !== 'string') {
191
+ return new TypeError('Expected "string" but received "' + typeof obj_service + '" (at "' + path_service + '")');
192
+ }
193
+ })();
194
+ return v_error === undefined ? null : v_error;
195
+ }
196
+ function deepFreeze$4(input) {
197
+ ObjectFreeze(input);
198
198
  }
199
199
 
200
- function validate$3(obj, path = 'TitleUi') {
201
- const v_error = (() => {
202
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
203
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
204
- }
205
- const obj_function = obj.function;
206
- const path_function = path + '.function';
207
- if (typeof obj_function !== 'string') {
208
- return new TypeError('Expected "string" but received "' + typeof obj_function + '" (at "' + path_function + '")');
209
- }
210
- const obj_level = obj.level;
211
- const path_level = path + '.level';
212
- if (typeof obj_level !== 'string') {
213
- return new TypeError('Expected "string" but received "' + typeof obj_level + '" (at "' + path_level + '")');
214
- }
215
- const obj_title = obj.title;
216
- const path_title = path + '.title';
217
- if (typeof obj_title !== 'string') {
218
- return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
219
- }
220
- })();
221
- return v_error === undefined ? null : v_error;
222
- }
223
- function deepFreeze$3(input) {
224
- ObjectFreeze(input);
200
+ function validate$3(obj, path = 'TitleUi') {
201
+ const v_error = (() => {
202
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
203
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
204
+ }
205
+ const obj_function = obj.function;
206
+ const path_function = path + '.function';
207
+ if (typeof obj_function !== 'string') {
208
+ return new TypeError('Expected "string" but received "' + typeof obj_function + '" (at "' + path_function + '")');
209
+ }
210
+ const obj_level = obj.level;
211
+ const path_level = path + '.level';
212
+ if (typeof obj_level !== 'string') {
213
+ return new TypeError('Expected "string" but received "' + typeof obj_level + '" (at "' + path_level + '")');
214
+ }
215
+ const obj_title = obj.title;
216
+ const path_title = path + '.title';
217
+ if (typeof obj_title !== 'string') {
218
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
219
+ }
220
+ })();
221
+ return v_error === undefined ? null : v_error;
222
+ }
223
+ function deepFreeze$3(input) {
224
+ ObjectFreeze(input);
225
225
  }
226
226
 
227
- function validate$2(obj, path = 'SignatureUi') {
228
- const v_error = (() => {
229
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
230
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
231
- }
232
- const obj_addresses = obj.addresses;
233
- const path_addresses = path + '.addresses';
234
- if (!ArrayIsArray(obj_addresses)) {
235
- return new TypeError('Expected "array" but received "' + typeof obj_addresses + '" (at "' + path_addresses + '")');
236
- }
237
- for (let i = 0; i < obj_addresses.length; i++) {
238
- const obj_addresses_item = obj_addresses[i];
239
- const path_addresses_item = path_addresses + '[' + i + ']';
240
- const referencepath_addresses_itemValidationError = validate$7(obj_addresses_item, path_addresses_item);
241
- if (referencepath_addresses_itemValidationError !== null) {
242
- let message = 'Object doesn\'t match PhysAddressUi (at "' + path_addresses_item + '")\n';
243
- message += referencepath_addresses_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
244
- return new TypeError(message);
245
- }
246
- }
247
- const obj_companyName = obj.companyName;
248
- const path_companyName = path + '.companyName';
249
- if (typeof obj_companyName !== 'string') {
250
- return new TypeError('Expected "string" but received "' + typeof obj_companyName + '" (at "' + path_companyName + '")');
251
- }
252
- const obj_emailAddress = obj.emailAddress;
253
- const path_emailAddress = path + '.emailAddress';
254
- if (typeof obj_emailAddress !== 'string') {
255
- return new TypeError('Expected "string" but received "' + typeof obj_emailAddress + '" (at "' + path_emailAddress + '")');
256
- }
257
- const obj_hash = obj.hash;
258
- const path_hash = path + '.hash';
259
- if (typeof obj_hash !== 'string') {
260
- return new TypeError('Expected "string" but received "' + typeof obj_hash + '" (at "' + path_hash + '")');
261
- }
262
- const obj_name = obj.name;
263
- const path_name = path + '.name';
264
- const referencepath_nameValidationError = validate$6(obj_name, path_name);
265
- if (referencepath_nameValidationError !== null) {
266
- let message = 'Object doesn\'t match NameUi (at "' + path_name + '")\n';
267
- message += referencepath_nameValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
268
- return new TypeError(message);
269
- }
270
- const obj_phones = obj.phones;
271
- const path_phones = path + '.phones';
272
- if (!ArrayIsArray(obj_phones)) {
273
- return new TypeError('Expected "array" but received "' + typeof obj_phones + '" (at "' + path_phones + '")');
274
- }
275
- for (let i = 0; i < obj_phones.length; i++) {
276
- const obj_phones_item = obj_phones[i];
277
- const path_phones_item = path_phones + '[' + i + ']';
278
- const referencepath_phones_itemValidationError = validate$5(obj_phones_item, path_phones_item);
279
- if (referencepath_phones_itemValidationError !== null) {
280
- let message = 'Object doesn\'t match PhoneUi (at "' + path_phones_item + '")\n';
281
- message += referencepath_phones_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
282
- return new TypeError(message);
283
- }
284
- }
285
- const obj_receivedTime = obj.receivedTime;
286
- const path_receivedTime = path + '.receivedTime';
287
- if (typeof obj_receivedTime !== 'string') {
288
- return new TypeError('Expected "string" but received "' + typeof obj_receivedTime + '" (at "' + path_receivedTime + '")');
289
- }
290
- const obj_sfdcOrgId = obj.sfdcOrgId;
291
- const path_sfdcOrgId = path + '.sfdcOrgId';
292
- if (typeof obj_sfdcOrgId !== 'string') {
293
- return new TypeError('Expected "string" but received "' + typeof obj_sfdcOrgId + '" (at "' + path_sfdcOrgId + '")');
294
- }
295
- const obj_socialMediaUrls = obj.socialMediaUrls;
296
- const path_socialMediaUrls = path + '.socialMediaUrls';
297
- if (!ArrayIsArray(obj_socialMediaUrls)) {
298
- return new TypeError('Expected "array" but received "' + typeof obj_socialMediaUrls + '" (at "' + path_socialMediaUrls + '")');
299
- }
300
- for (let i = 0; i < obj_socialMediaUrls.length; i++) {
301
- const obj_socialMediaUrls_item = obj_socialMediaUrls[i];
302
- const path_socialMediaUrls_item = path_socialMediaUrls + '[' + i + ']';
303
- const referencepath_socialMediaUrls_itemValidationError = validate$4(obj_socialMediaUrls_item, path_socialMediaUrls_item);
304
- if (referencepath_socialMediaUrls_itemValidationError !== null) {
305
- let message = 'Object doesn\'t match SocialMediaUi (at "' + path_socialMediaUrls_item + '")\n';
306
- message += referencepath_socialMediaUrls_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
307
- return new TypeError(message);
308
- }
309
- }
310
- const obj_title = obj.title;
311
- const path_title = path + '.title';
312
- const referencepath_titleValidationError = validate$3(obj_title, path_title);
313
- if (referencepath_titleValidationError !== null) {
314
- let message = 'Object doesn\'t match TitleUi (at "' + path_title + '")\n';
315
- message += referencepath_titleValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
316
- return new TypeError(message);
317
- }
318
- const obj_webUrls = obj.webUrls;
319
- const path_webUrls = path + '.webUrls';
320
- if (!ArrayIsArray(obj_webUrls)) {
321
- return new TypeError('Expected "array" but received "' + typeof obj_webUrls + '" (at "' + path_webUrls + '")');
322
- }
323
- for (let i = 0; i < obj_webUrls.length; i++) {
324
- const obj_webUrls_item = obj_webUrls[i];
325
- const path_webUrls_item = path_webUrls + '[' + i + ']';
326
- if (typeof obj_webUrls_item !== 'string') {
327
- return new TypeError('Expected "string" but received "' + typeof obj_webUrls_item + '" (at "' + path_webUrls_item + '")');
328
- }
329
- }
330
- })();
331
- return v_error === undefined ? null : v_error;
332
- }
333
- function deepFreeze$2(input) {
334
- const input_addresses = input.addresses;
335
- for (let i = 0; i < input_addresses.length; i++) {
336
- const input_addresses_item = input_addresses[i];
337
- deepFreeze$7(input_addresses_item);
338
- }
339
- ObjectFreeze(input_addresses);
340
- const input_name = input.name;
341
- deepFreeze$6(input_name);
342
- const input_phones = input.phones;
343
- for (let i = 0; i < input_phones.length; i++) {
344
- const input_phones_item = input_phones[i];
345
- deepFreeze$5(input_phones_item);
346
- }
347
- ObjectFreeze(input_phones);
348
- const input_socialMediaUrls = input.socialMediaUrls;
349
- for (let i = 0; i < input_socialMediaUrls.length; i++) {
350
- const input_socialMediaUrls_item = input_socialMediaUrls[i];
351
- deepFreeze$4(input_socialMediaUrls_item);
352
- }
353
- ObjectFreeze(input_socialMediaUrls);
354
- const input_title = input.title;
355
- deepFreeze$3(input_title);
356
- const input_webUrls = input.webUrls;
357
- ObjectFreeze(input_webUrls);
358
- ObjectFreeze(input);
227
+ function validate$2(obj, path = 'SignatureUi') {
228
+ const v_error = (() => {
229
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
230
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
231
+ }
232
+ const obj_addresses = obj.addresses;
233
+ const path_addresses = path + '.addresses';
234
+ if (!ArrayIsArray(obj_addresses)) {
235
+ return new TypeError('Expected "array" but received "' + typeof obj_addresses + '" (at "' + path_addresses + '")');
236
+ }
237
+ for (let i = 0; i < obj_addresses.length; i++) {
238
+ const obj_addresses_item = obj_addresses[i];
239
+ const path_addresses_item = path_addresses + '[' + i + ']';
240
+ const referencepath_addresses_itemValidationError = validate$7(obj_addresses_item, path_addresses_item);
241
+ if (referencepath_addresses_itemValidationError !== null) {
242
+ let message = 'Object doesn\'t match PhysAddressUi (at "' + path_addresses_item + '")\n';
243
+ message += referencepath_addresses_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
244
+ return new TypeError(message);
245
+ }
246
+ }
247
+ const obj_companyName = obj.companyName;
248
+ const path_companyName = path + '.companyName';
249
+ if (typeof obj_companyName !== 'string') {
250
+ return new TypeError('Expected "string" but received "' + typeof obj_companyName + '" (at "' + path_companyName + '")');
251
+ }
252
+ const obj_emailAddress = obj.emailAddress;
253
+ const path_emailAddress = path + '.emailAddress';
254
+ if (typeof obj_emailAddress !== 'string') {
255
+ return new TypeError('Expected "string" but received "' + typeof obj_emailAddress + '" (at "' + path_emailAddress + '")');
256
+ }
257
+ const obj_hash = obj.hash;
258
+ const path_hash = path + '.hash';
259
+ if (typeof obj_hash !== 'string') {
260
+ return new TypeError('Expected "string" but received "' + typeof obj_hash + '" (at "' + path_hash + '")');
261
+ }
262
+ const obj_name = obj.name;
263
+ const path_name = path + '.name';
264
+ const referencepath_nameValidationError = validate$6(obj_name, path_name);
265
+ if (referencepath_nameValidationError !== null) {
266
+ let message = 'Object doesn\'t match NameUi (at "' + path_name + '")\n';
267
+ message += referencepath_nameValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
268
+ return new TypeError(message);
269
+ }
270
+ const obj_phones = obj.phones;
271
+ const path_phones = path + '.phones';
272
+ if (!ArrayIsArray(obj_phones)) {
273
+ return new TypeError('Expected "array" but received "' + typeof obj_phones + '" (at "' + path_phones + '")');
274
+ }
275
+ for (let i = 0; i < obj_phones.length; i++) {
276
+ const obj_phones_item = obj_phones[i];
277
+ const path_phones_item = path_phones + '[' + i + ']';
278
+ const referencepath_phones_itemValidationError = validate$5(obj_phones_item, path_phones_item);
279
+ if (referencepath_phones_itemValidationError !== null) {
280
+ let message = 'Object doesn\'t match PhoneUi (at "' + path_phones_item + '")\n';
281
+ message += referencepath_phones_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
282
+ return new TypeError(message);
283
+ }
284
+ }
285
+ const obj_receivedTime = obj.receivedTime;
286
+ const path_receivedTime = path + '.receivedTime';
287
+ if (typeof obj_receivedTime !== 'string') {
288
+ return new TypeError('Expected "string" but received "' + typeof obj_receivedTime + '" (at "' + path_receivedTime + '")');
289
+ }
290
+ const obj_sfdcOrgId = obj.sfdcOrgId;
291
+ const path_sfdcOrgId = path + '.sfdcOrgId';
292
+ if (typeof obj_sfdcOrgId !== 'string') {
293
+ return new TypeError('Expected "string" but received "' + typeof obj_sfdcOrgId + '" (at "' + path_sfdcOrgId + '")');
294
+ }
295
+ const obj_socialMediaUrls = obj.socialMediaUrls;
296
+ const path_socialMediaUrls = path + '.socialMediaUrls';
297
+ if (!ArrayIsArray(obj_socialMediaUrls)) {
298
+ return new TypeError('Expected "array" but received "' + typeof obj_socialMediaUrls + '" (at "' + path_socialMediaUrls + '")');
299
+ }
300
+ for (let i = 0; i < obj_socialMediaUrls.length; i++) {
301
+ const obj_socialMediaUrls_item = obj_socialMediaUrls[i];
302
+ const path_socialMediaUrls_item = path_socialMediaUrls + '[' + i + ']';
303
+ const referencepath_socialMediaUrls_itemValidationError = validate$4(obj_socialMediaUrls_item, path_socialMediaUrls_item);
304
+ if (referencepath_socialMediaUrls_itemValidationError !== null) {
305
+ let message = 'Object doesn\'t match SocialMediaUi (at "' + path_socialMediaUrls_item + '")\n';
306
+ message += referencepath_socialMediaUrls_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
307
+ return new TypeError(message);
308
+ }
309
+ }
310
+ const obj_title = obj.title;
311
+ const path_title = path + '.title';
312
+ const referencepath_titleValidationError = validate$3(obj_title, path_title);
313
+ if (referencepath_titleValidationError !== null) {
314
+ let message = 'Object doesn\'t match TitleUi (at "' + path_title + '")\n';
315
+ message += referencepath_titleValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
316
+ return new TypeError(message);
317
+ }
318
+ const obj_webUrls = obj.webUrls;
319
+ const path_webUrls = path + '.webUrls';
320
+ if (!ArrayIsArray(obj_webUrls)) {
321
+ return new TypeError('Expected "array" but received "' + typeof obj_webUrls + '" (at "' + path_webUrls + '")');
322
+ }
323
+ for (let i = 0; i < obj_webUrls.length; i++) {
324
+ const obj_webUrls_item = obj_webUrls[i];
325
+ const path_webUrls_item = path_webUrls + '[' + i + ']';
326
+ if (typeof obj_webUrls_item !== 'string') {
327
+ return new TypeError('Expected "string" but received "' + typeof obj_webUrls_item + '" (at "' + path_webUrls_item + '")');
328
+ }
329
+ }
330
+ })();
331
+ return v_error === undefined ? null : v_error;
332
+ }
333
+ function deepFreeze$2(input) {
334
+ const input_addresses = input.addresses;
335
+ for (let i = 0; i < input_addresses.length; i++) {
336
+ const input_addresses_item = input_addresses[i];
337
+ deepFreeze$7(input_addresses_item);
338
+ }
339
+ ObjectFreeze(input_addresses);
340
+ const input_name = input.name;
341
+ deepFreeze$6(input_name);
342
+ const input_phones = input.phones;
343
+ for (let i = 0; i < input_phones.length; i++) {
344
+ const input_phones_item = input_phones[i];
345
+ deepFreeze$5(input_phones_item);
346
+ }
347
+ ObjectFreeze(input_phones);
348
+ const input_socialMediaUrls = input.socialMediaUrls;
349
+ for (let i = 0; i < input_socialMediaUrls.length; i++) {
350
+ const input_socialMediaUrls_item = input_socialMediaUrls[i];
351
+ deepFreeze$4(input_socialMediaUrls_item);
352
+ }
353
+ ObjectFreeze(input_socialMediaUrls);
354
+ const input_title = input.title;
355
+ deepFreeze$3(input_title);
356
+ const input_webUrls = input.webUrls;
357
+ ObjectFreeze(input_webUrls);
358
+ ObjectFreeze(input);
359
359
  }
360
360
 
361
- function validate$1(obj, path = 'PeopleAPIResponse') {
362
- const v_error = (() => {
363
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
364
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
365
- }
366
- const obj_emailAddress = obj.emailAddress;
367
- const path_emailAddress = path + '.emailAddress';
368
- if (typeof obj_emailAddress !== 'string') {
369
- return new TypeError('Expected "string" but received "' + typeof obj_emailAddress + '" (at "' + path_emailAddress + '")');
370
- }
371
- const obj_signature = obj.signature;
372
- const path_signature = path + '.signature';
373
- const referencepath_signatureValidationError = validate$2(obj_signature, path_signature);
374
- if (referencepath_signatureValidationError !== null) {
375
- let message = 'Object doesn\'t match SignatureUi (at "' + path_signature + '")\n';
376
- message += referencepath_signatureValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
377
- return new TypeError(message);
378
- }
379
- })();
380
- return v_error === undefined ? null : v_error;
381
- }
382
- function deepFreeze$1(input) {
383
- const input_signature = input.signature;
384
- deepFreeze$2(input_signature);
385
- ObjectFreeze(input);
361
+ function validate$1(obj, path = 'PeopleAPIResponse') {
362
+ const v_error = (() => {
363
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
364
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
365
+ }
366
+ const obj_emailAddress = obj.emailAddress;
367
+ const path_emailAddress = path + '.emailAddress';
368
+ if (typeof obj_emailAddress !== 'string') {
369
+ return new TypeError('Expected "string" but received "' + typeof obj_emailAddress + '" (at "' + path_emailAddress + '")');
370
+ }
371
+ const obj_signature = obj.signature;
372
+ const path_signature = path + '.signature';
373
+ const referencepath_signatureValidationError = validate$2(obj_signature, path_signature);
374
+ if (referencepath_signatureValidationError !== null) {
375
+ let message = 'Object doesn\'t match SignatureUi (at "' + path_signature + '")\n';
376
+ message += referencepath_signatureValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
377
+ return new TypeError(message);
378
+ }
379
+ })();
380
+ return v_error === undefined ? null : v_error;
381
+ }
382
+ function deepFreeze$1(input) {
383
+ const input_signature = input.signature;
384
+ deepFreeze$2(input_signature);
385
+ ObjectFreeze(input);
386
386
  }
387
387
 
388
- const VERSION = "1acb2e7e06055d8818df0d3592d62c04";
389
- function validate(obj, path = 'PeopleAPIResponseCollection') {
390
- const v_error = (() => {
391
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
392
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
393
- }
394
- const obj_responses = obj.responses;
395
- const path_responses = path + '.responses';
396
- if (!ArrayIsArray(obj_responses)) {
397
- return new TypeError('Expected "array" but received "' + typeof obj_responses + '" (at "' + path_responses + '")');
398
- }
399
- for (let i = 0; i < obj_responses.length; i++) {
400
- const obj_responses_item = obj_responses[i];
401
- const path_responses_item = path_responses + '[' + i + ']';
402
- const referencepath_responses_itemValidationError = validate$1(obj_responses_item, path_responses_item);
403
- if (referencepath_responses_itemValidationError !== null) {
404
- let message = 'Object doesn\'t match PeopleAPIResponse (at "' + path_responses_item + '")\n';
405
- message += referencepath_responses_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
406
- return new TypeError(message);
407
- }
408
- }
409
- })();
410
- return v_error === undefined ? null : v_error;
411
- }
412
- const RepresentationType = 'PeopleAPIResponseCollection';
413
- function normalize(input, existing, path, luvio, store, timestamp) {
414
- return input;
415
- }
416
- const select$1 = function PeopleAPIResponseCollectionSelect() {
417
- return {
418
- kind: 'Fragment',
419
- version: VERSION,
420
- private: [],
421
- opaque: true
422
- };
423
- };
424
- function equals(existing, incoming) {
425
- if (JSONStringify(incoming) !== JSONStringify(existing)) {
426
- return false;
427
- }
428
- return true;
429
- }
430
- function deepFreeze(input) {
431
- const input_responses = input.responses;
432
- for (let i = 0; i < input_responses.length; i++) {
433
- const input_responses_item = input_responses[i];
434
- deepFreeze$1(input_responses_item);
435
- }
436
- ObjectFreeze(input_responses);
437
- ObjectFreeze(input);
438
- }
439
- const ingest = function PeopleAPIResponseCollectionIngest(input, path, luvio, store, timestamp) {
440
- if (process.env.NODE_ENV !== 'production') {
441
- const validateError = validate(input);
442
- if (validateError !== null) {
443
- throw validateError;
444
- }
445
- }
446
- const key = path.fullPath;
447
- const existingRecord = store.readEntry(key);
448
- const ttlToUse = path.ttl !== undefined ? path.ttl : 3600000;
449
- let incomingRecord = normalize(input, store.readEntry(key), {
450
- fullPath: key,
451
- parent: path.parent,
452
- propertyName: path.propertyName,
453
- ttl: ttlToUse
454
- });
455
- deepFreeze(input);
456
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
457
- luvio.storePublish(key, incomingRecord);
458
- }
459
- if (ttlToUse !== undefined) {
460
- const storeMetadataParams = {
461
- ttl: ttlToUse,
462
- namespace: "people-api",
463
- version: VERSION,
464
- representationName: RepresentationType,
465
- };
466
- luvio.publishStoreMetadata(key, storeMetadataParams);
467
- }
468
- return createLink(key);
469
- };
470
- function getTypeCacheKeys(luvio, input, fullPathFactory) {
471
- const rootKeySet = new StoreKeyMap();
472
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
473
- const rootKey = fullPathFactory();
474
- rootKeySet.set(rootKey, {
475
- namespace: keyPrefix,
476
- representationName: RepresentationType,
477
- mergeable: false
478
- });
479
- return rootKeySet;
388
+ const VERSION = "1acb2e7e06055d8818df0d3592d62c04";
389
+ function validate(obj, path = 'PeopleAPIResponseCollection') {
390
+ const v_error = (() => {
391
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
392
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
393
+ }
394
+ const obj_responses = obj.responses;
395
+ const path_responses = path + '.responses';
396
+ if (!ArrayIsArray(obj_responses)) {
397
+ return new TypeError('Expected "array" but received "' + typeof obj_responses + '" (at "' + path_responses + '")');
398
+ }
399
+ for (let i = 0; i < obj_responses.length; i++) {
400
+ const obj_responses_item = obj_responses[i];
401
+ const path_responses_item = path_responses + '[' + i + ']';
402
+ const referencepath_responses_itemValidationError = validate$1(obj_responses_item, path_responses_item);
403
+ if (referencepath_responses_itemValidationError !== null) {
404
+ let message = 'Object doesn\'t match PeopleAPIResponse (at "' + path_responses_item + '")\n';
405
+ message += referencepath_responses_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
406
+ return new TypeError(message);
407
+ }
408
+ }
409
+ })();
410
+ return v_error === undefined ? null : v_error;
411
+ }
412
+ const RepresentationType = 'PeopleAPIResponseCollection';
413
+ function normalize(input, existing, path, luvio, store, timestamp) {
414
+ return input;
415
+ }
416
+ const select$1 = function PeopleAPIResponseCollectionSelect() {
417
+ return {
418
+ kind: 'Fragment',
419
+ version: VERSION,
420
+ private: [],
421
+ opaque: true
422
+ };
423
+ };
424
+ function equals(existing, incoming) {
425
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
426
+ return false;
427
+ }
428
+ return true;
429
+ }
430
+ function deepFreeze(input) {
431
+ const input_responses = input.responses;
432
+ for (let i = 0; i < input_responses.length; i++) {
433
+ const input_responses_item = input_responses[i];
434
+ deepFreeze$1(input_responses_item);
435
+ }
436
+ ObjectFreeze(input_responses);
437
+ ObjectFreeze(input);
438
+ }
439
+ const ingest = function PeopleAPIResponseCollectionIngest(input, path, luvio, store, timestamp) {
440
+ if (process.env.NODE_ENV !== 'production') {
441
+ const validateError = validate(input);
442
+ if (validateError !== null) {
443
+ throw validateError;
444
+ }
445
+ }
446
+ const key = path.fullPath;
447
+ const existingRecord = store.readEntry(key);
448
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 3600000;
449
+ let incomingRecord = normalize(input, store.readEntry(key), {
450
+ fullPath: key,
451
+ parent: path.parent,
452
+ propertyName: path.propertyName,
453
+ ttl: ttlToUse
454
+ });
455
+ deepFreeze(input);
456
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
457
+ luvio.storePublish(key, incomingRecord);
458
+ }
459
+ if (ttlToUse !== undefined) {
460
+ const storeMetadataParams = {
461
+ ttl: ttlToUse,
462
+ namespace: "people-api",
463
+ version: VERSION,
464
+ representationName: RepresentationType,
465
+ };
466
+ luvio.publishStoreMetadata(key, storeMetadataParams);
467
+ }
468
+ return createLink(key);
469
+ };
470
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
471
+ const rootKeySet = new StoreKeyMap();
472
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
473
+ const rootKey = fullPathFactory();
474
+ rootKeySet.set(rootKey, {
475
+ namespace: keyPrefix,
476
+ representationName: RepresentationType,
477
+ mergeable: false
478
+ });
479
+ return rootKeySet;
480
480
  }
481
481
 
482
- function select(luvio, params) {
483
- return select$1();
484
- }
485
- function keyBuilder$1(luvio, params) {
486
- return keyPrefix + '::PeopleAPIResponseCollection:(' + 'emailAddresses:' + params.queryParams.emailAddresses + ')';
487
- }
488
- function getResponseCacheKeys(luvio, resourceParams, response) {
489
- return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
490
- }
491
- function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
492
- const { body } = response;
493
- const key = keyBuilder$1(luvio, resourceParams);
494
- luvio.storeIngest(key, ingest, body);
495
- const snapshot = luvio.storeLookup({
496
- recordId: key,
497
- node: select(),
498
- variables: {},
499
- }, snapshotRefresh);
500
- if (process.env.NODE_ENV !== 'production') {
501
- if (snapshot.state !== 'Fulfilled') {
502
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
503
- }
504
- }
505
- return snapshot;
506
- }
507
- function ingestError(luvio, params, error, snapshotRefresh) {
508
- const key = keyBuilder$1(luvio, params);
509
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
510
- luvio.storeIngestError(key, errorSnapshot);
511
- return errorSnapshot;
512
- }
513
- function createResourceRequest(config) {
514
- const headers = {};
515
- return {
516
- baseUri: '/services/data/v58.0',
517
- basePath: '/people',
518
- method: 'get',
519
- body: null,
520
- urlParams: {},
521
- queryParams: config.queryParams,
522
- headers,
523
- priority: 'normal',
524
- };
482
+ function select(luvio, params) {
483
+ return select$1();
484
+ }
485
+ function keyBuilder$1(luvio, params) {
486
+ return keyPrefix + '::PeopleAPIResponseCollection:(' + 'emailAddresses:' + params.queryParams.emailAddresses + ')';
487
+ }
488
+ function getResponseCacheKeys(luvio, resourceParams, response) {
489
+ return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
490
+ }
491
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
492
+ const { body } = response;
493
+ const key = keyBuilder$1(luvio, resourceParams);
494
+ luvio.storeIngest(key, ingest, body);
495
+ const snapshot = luvio.storeLookup({
496
+ recordId: key,
497
+ node: select(),
498
+ variables: {},
499
+ }, snapshotRefresh);
500
+ if (process.env.NODE_ENV !== 'production') {
501
+ if (snapshot.state !== 'Fulfilled') {
502
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
503
+ }
504
+ }
505
+ return snapshot;
506
+ }
507
+ function ingestError(luvio, params, error, snapshotRefresh) {
508
+ const key = keyBuilder$1(luvio, params);
509
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
510
+ luvio.storeIngestError(key, errorSnapshot);
511
+ return errorSnapshot;
512
+ }
513
+ function createResourceRequest(config) {
514
+ const headers = {};
515
+ return {
516
+ baseUri: '/services/data/v58.0',
517
+ basePath: '/people',
518
+ method: 'get',
519
+ body: null,
520
+ urlParams: {},
521
+ queryParams: config.queryParams,
522
+ headers,
523
+ priority: 'normal',
524
+ };
525
525
  }
526
526
 
527
- const getParsedSignatureData_ConfigPropertyNames = {
528
- displayName: 'getParsedSignatureData',
529
- parameters: {
530
- required: [],
531
- optional: ['emailAddresses']
532
- }
533
- };
534
- function createResourceParams(config) {
535
- const resourceParams = {
536
- queryParams: {
537
- emailAddresses: config.emailAddresses
538
- }
539
- };
540
- return resourceParams;
541
- }
542
- function keyBuilder(luvio, config) {
543
- const resourceParams = createResourceParams(config);
544
- return keyBuilder$1(luvio, resourceParams);
545
- }
546
- function typeCheckConfig(untrustedConfig) {
547
- const config = {};
548
- const untrustedConfig_emailAddresses = untrustedConfig.emailAddresses;
549
- if (ArrayIsArray$1(untrustedConfig_emailAddresses)) {
550
- const untrustedConfig_emailAddresses_array = [];
551
- for (let i = 0, arrayLength = untrustedConfig_emailAddresses.length; i < arrayLength; i++) {
552
- const untrustedConfig_emailAddresses_item = untrustedConfig_emailAddresses[i];
553
- if (typeof untrustedConfig_emailAddresses_item === 'string') {
554
- untrustedConfig_emailAddresses_array.push(untrustedConfig_emailAddresses_item);
555
- }
556
- }
557
- config.emailAddresses = untrustedConfig_emailAddresses_array;
558
- }
559
- return config;
560
- }
561
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
562
- if (!untrustedIsObject(untrustedConfig)) {
563
- return null;
564
- }
565
- if (process.env.NODE_ENV !== 'production') {
566
- validateConfig(untrustedConfig, configPropertyNames);
567
- }
568
- const config = typeCheckConfig(untrustedConfig);
569
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
570
- return null;
571
- }
572
- return config;
573
- }
574
- function adapterFragment(luvio, config) {
575
- createResourceParams(config);
576
- return select();
577
- }
578
- function onFetchResponseSuccess(luvio, config, resourceParams, response) {
579
- const snapshot = ingestSuccess(luvio, resourceParams, response, {
580
- config,
581
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
582
- });
583
- return luvio.storeBroadcast().then(() => snapshot);
584
- }
585
- function onFetchResponseError(luvio, config, resourceParams, response) {
586
- const snapshot = ingestError(luvio, resourceParams, response, {
587
- config,
588
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
589
- });
590
- return luvio.storeBroadcast().then(() => snapshot);
591
- }
592
- function buildNetworkSnapshot(luvio, config, options) {
593
- const resourceParams = createResourceParams(config);
594
- const request = createResourceRequest(resourceParams);
595
- return luvio.dispatchResourceRequest(request, options)
596
- .then((response) => {
597
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
598
- }, (response) => {
599
- return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
600
- });
601
- }
602
- function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
603
- const { luvio, config } = context;
604
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
605
- const dispatchOptions = {
606
- resourceRequestContext: {
607
- requestCorrelator,
608
- luvioRequestMethod: undefined,
609
- },
610
- eventObservers
611
- };
612
- if (networkPriority !== 'normal') {
613
- dispatchOptions.overrides = {
614
- priority: networkPriority
615
- };
616
- }
617
- return buildNetworkSnapshot(luvio, config, dispatchOptions);
618
- }
619
- function buildCachedSnapshotCachePolicy(context, storeLookup) {
620
- const { luvio, config } = context;
621
- const selector = {
622
- recordId: keyBuilder(luvio, config),
623
- node: adapterFragment(luvio, config),
624
- variables: {},
625
- };
626
- const cacheSnapshot = storeLookup(selector, {
627
- config,
628
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
629
- });
630
- return cacheSnapshot;
631
- }
632
- const getParsedSignatureDataAdapterFactory = (luvio) => function peopleApi__getParsedSignatureData(untrustedConfig, requestContext) {
633
- const config = validateAdapterConfig(untrustedConfig, getParsedSignatureData_ConfigPropertyNames);
634
- // Invalid or incomplete config
635
- if (config === null) {
636
- return null;
637
- }
638
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
639
- buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
527
+ const getParsedSignatureData_ConfigPropertyNames = {
528
+ displayName: 'getParsedSignatureData',
529
+ parameters: {
530
+ required: [],
531
+ optional: ['emailAddresses']
532
+ }
533
+ };
534
+ function createResourceParams(config) {
535
+ const resourceParams = {
536
+ queryParams: {
537
+ emailAddresses: config.emailAddresses
538
+ }
539
+ };
540
+ return resourceParams;
541
+ }
542
+ function keyBuilder(luvio, config) {
543
+ const resourceParams = createResourceParams(config);
544
+ return keyBuilder$1(luvio, resourceParams);
545
+ }
546
+ function typeCheckConfig(untrustedConfig) {
547
+ const config = {};
548
+ const untrustedConfig_emailAddresses = untrustedConfig.emailAddresses;
549
+ if (ArrayIsArray$1(untrustedConfig_emailAddresses)) {
550
+ const untrustedConfig_emailAddresses_array = [];
551
+ for (let i = 0, arrayLength = untrustedConfig_emailAddresses.length; i < arrayLength; i++) {
552
+ const untrustedConfig_emailAddresses_item = untrustedConfig_emailAddresses[i];
553
+ if (typeof untrustedConfig_emailAddresses_item === 'string') {
554
+ untrustedConfig_emailAddresses_array.push(untrustedConfig_emailAddresses_item);
555
+ }
556
+ }
557
+ config.emailAddresses = untrustedConfig_emailAddresses_array;
558
+ }
559
+ return config;
560
+ }
561
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
562
+ if (!untrustedIsObject(untrustedConfig)) {
563
+ return null;
564
+ }
565
+ if (process.env.NODE_ENV !== 'production') {
566
+ validateConfig(untrustedConfig, configPropertyNames);
567
+ }
568
+ const config = typeCheckConfig(untrustedConfig);
569
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
570
+ return null;
571
+ }
572
+ return config;
573
+ }
574
+ function adapterFragment(luvio, config) {
575
+ createResourceParams(config);
576
+ return select();
577
+ }
578
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
579
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
580
+ config,
581
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
582
+ });
583
+ return luvio.storeBroadcast().then(() => snapshot);
584
+ }
585
+ function onFetchResponseError(luvio, config, resourceParams, response) {
586
+ const snapshot = ingestError(luvio, resourceParams, response, {
587
+ config,
588
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
589
+ });
590
+ return luvio.storeBroadcast().then(() => snapshot);
591
+ }
592
+ function buildNetworkSnapshot(luvio, config, options) {
593
+ const resourceParams = createResourceParams(config);
594
+ const request = createResourceRequest(resourceParams);
595
+ return luvio.dispatchResourceRequest(request, options)
596
+ .then((response) => {
597
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
598
+ }, (response) => {
599
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
600
+ });
601
+ }
602
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
603
+ const { luvio, config } = context;
604
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
605
+ const dispatchOptions = {
606
+ resourceRequestContext: {
607
+ requestCorrelator,
608
+ luvioRequestMethod: undefined,
609
+ },
610
+ eventObservers
611
+ };
612
+ if (networkPriority !== 'normal') {
613
+ dispatchOptions.overrides = {
614
+ priority: networkPriority
615
+ };
616
+ }
617
+ return buildNetworkSnapshot(luvio, config, dispatchOptions);
618
+ }
619
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
620
+ const { luvio, config } = context;
621
+ const selector = {
622
+ recordId: keyBuilder(luvio, config),
623
+ node: adapterFragment(luvio, config),
624
+ variables: {},
625
+ };
626
+ const cacheSnapshot = storeLookup(selector, {
627
+ config,
628
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
629
+ });
630
+ return cacheSnapshot;
631
+ }
632
+ const getParsedSignatureDataAdapterFactory = (luvio) => function peopleApi__getParsedSignatureData(untrustedConfig, requestContext) {
633
+ const config = validateAdapterConfig(untrustedConfig, getParsedSignatureData_ConfigPropertyNames);
634
+ // Invalid or incomplete config
635
+ if (config === null) {
636
+ return null;
637
+ }
638
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
639
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
640
640
  };
641
641
 
642
642
  export { getParsedSignatureDataAdapterFactory };