@salesforce/lds-adapters-sales-people-api 0.1.0-dev1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +82 -0
- package/dist/es/es2018/sales-people-api.js +557 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/getParsedSignatureData.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +3 -0
- package/dist/es/es2018/types/src/generated/resources/getPeople.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/types/NameUi.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/PeopleAPIResponse.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/PeopleAPIResponseCollection.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/PhoneUi.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/PhysAddressUi.d.ts +49 -0
- package/dist/es/es2018/types/src/generated/types/SignatureUi.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/types/SocialMediaUi.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/TitleUi.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +74 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +588 -0
- package/src/raml/api.raml +196 -0
- package/src/raml/luvio.raml +17 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Terms of Use
|
|
2
|
+
|
|
3
|
+
Copyright 2022 Salesforce, Inc. All rights reserved.
|
|
4
|
+
|
|
5
|
+
These Terms of Use govern the download, installation, and/or use of this
|
|
6
|
+
software provided by Salesforce, Inc. ("Salesforce") (the "Software"), were
|
|
7
|
+
last updated on April 15, 2022, and constitute a legally binding
|
|
8
|
+
agreement between you and Salesforce. If you do not agree to these Terms of
|
|
9
|
+
Use, do not install or use the Software.
|
|
10
|
+
|
|
11
|
+
Salesforce grants you a worldwide, non-exclusive, no-charge, royalty-free
|
|
12
|
+
copyright license to reproduce, prepare derivative works of, publicly
|
|
13
|
+
display, publicly perform, sublicense, and distribute the Software and
|
|
14
|
+
derivative works subject to these Terms. These Terms shall be included in
|
|
15
|
+
all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
Subject to the limited rights expressly granted hereunder, Salesforce
|
|
18
|
+
reserves all rights, title, and interest in and to all intellectual
|
|
19
|
+
property subsisting in the Software. No rights are granted to you hereunder
|
|
20
|
+
other than as expressly set forth herein. Users residing in countries on
|
|
21
|
+
the United States Office of Foreign Assets Control sanction list, or which
|
|
22
|
+
are otherwise subject to a US export embargo, may not use the Software.
|
|
23
|
+
|
|
24
|
+
Implementation of the Software may require development work, for which you
|
|
25
|
+
are responsible. The Software may contain bugs, errors and
|
|
26
|
+
incompatibilities and is made available on an AS IS basis without support,
|
|
27
|
+
updates, or service level commitments.
|
|
28
|
+
|
|
29
|
+
Salesforce reserves the right at any time to modify, suspend, or
|
|
30
|
+
discontinue, the Software (or any part thereof) with or without notice. You
|
|
31
|
+
agree that Salesforce shall not be liable to you or to any third party for
|
|
32
|
+
any modification, suspension, or discontinuance.
|
|
33
|
+
|
|
34
|
+
You agree to defend Salesforce against any claim, demand, suit or
|
|
35
|
+
proceeding made or brought against Salesforce by a third party arising out
|
|
36
|
+
of or accruing from (a) your use of the Software, and (b) any application
|
|
37
|
+
you develop with the Software that infringes any copyright, trademark,
|
|
38
|
+
trade secret, trade dress, patent, or other intellectual property right of
|
|
39
|
+
any person or defames any person or violates their rights of publicity or
|
|
40
|
+
privacy (each a "Claim Against Salesforce"), and will indemnify Salesforce
|
|
41
|
+
from any damages, attorney fees, and costs finally awarded against
|
|
42
|
+
Salesforce as a result of, or for any amounts paid by Salesforce under a
|
|
43
|
+
settlement approved by you in writing of, a Claim Against Salesforce,
|
|
44
|
+
provided Salesforce (x) promptly gives you written notice of the Claim
|
|
45
|
+
Against Salesforce, (y) gives you sole control of the defense and
|
|
46
|
+
settlement of the Claim Against Salesforce (except that you may not settle
|
|
47
|
+
any Claim Against Salesforce unless it unconditionally releases Salesforce
|
|
48
|
+
of all liability), and (z) gives you all reasonable assistance, at your
|
|
49
|
+
expense.
|
|
50
|
+
|
|
51
|
+
WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE SOFTWARE IS NOT
|
|
52
|
+
SUPPORTED AND IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
53
|
+
IMPLIED. IN NO EVENT SHALL SALESFORCE HAVE ANY LIABILITY FOR ANY DAMAGES,
|
|
54
|
+
INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL, INCIDENTAL,
|
|
55
|
+
PUNITIVE, OR CONSEQUENTIAL DAMAGES, OR DAMAGES BASED ON LOST PROFITS, DATA,
|
|
56
|
+
OR USE, IN CONNECTION WITH THE SOFTWARE, HOWEVER CAUSED AND WHETHER IN
|
|
57
|
+
CONTRACT, TORT, OR UNDER ANY OTHER THEORY OF LIABILITY, WHETHER OR NOT YOU
|
|
58
|
+
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
59
|
+
|
|
60
|
+
These Terms of Use shall be governed exclusively by the internal laws of
|
|
61
|
+
the State of California, without regard to its conflicts of laws
|
|
62
|
+
rules. Each party hereby consents to the exclusive jurisdiction of the
|
|
63
|
+
state and federal courts located in San Francisco County, California to
|
|
64
|
+
adjudicate any dispute arising out of or relating to these Terms of Use and
|
|
65
|
+
the download, installation, and/or use of the Software. Except as expressly
|
|
66
|
+
stated herein, these Terms of Use constitute the entire agreement between
|
|
67
|
+
the parties, and supersede all prior and contemporaneous agreements,
|
|
68
|
+
proposals, or representations, written or oral, concerning their subject
|
|
69
|
+
matter. No modification, amendment, or waiver of any provision of these
|
|
70
|
+
Terms of Use shall be effective unless it is by an update to these Terms of
|
|
71
|
+
Use that Salesforce makes available, or is in writing and signed by the
|
|
72
|
+
party against whom the modification, amendment, or waiver is to be
|
|
73
|
+
asserted.
|
|
74
|
+
|
|
75
|
+
Data Privacy: Salesforce may collect, process, and store device,
|
|
76
|
+
system, and other information related to your use of the Software. This
|
|
77
|
+
information includes, but is not limited to, IP address, user metrics, and
|
|
78
|
+
other data ("Usage Data"). Salesforce may use Usage Data for analytics,
|
|
79
|
+
product development, and marketing purposes. You acknowledge that files
|
|
80
|
+
generated in conjunction with the Software may contain sensitive or
|
|
81
|
+
confidential data, and you are solely responsible for anonymizing and
|
|
82
|
+
protecting such data.
|
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from '@luvio/engine';
|
|
8
|
+
|
|
9
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
|
+
const { keys: ObjectKeys, create: ObjectCreate } = 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(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
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
52
|
+
return {
|
|
53
|
+
name,
|
|
54
|
+
required,
|
|
55
|
+
resourceType,
|
|
56
|
+
typeCheckShape,
|
|
57
|
+
isArrayShape,
|
|
58
|
+
coerceFn,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
62
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
63
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
64
|
+
return {
|
|
65
|
+
displayName,
|
|
66
|
+
parameters: {
|
|
67
|
+
required,
|
|
68
|
+
optional,
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const keyPrefix = 'people-api';
|
|
73
|
+
|
|
74
|
+
const { isArray: ArrayIsArray } = Array;
|
|
75
|
+
const { stringify: JSONStringify } = JSON;
|
|
76
|
+
function createLink(ref) {
|
|
77
|
+
return {
|
|
78
|
+
__ref: serializeStructuredKey(ref),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function validate$7(obj, path = 'PhysAddressUi') {
|
|
83
|
+
const v_error = (() => {
|
|
84
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
85
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
86
|
+
}
|
|
87
|
+
const obj_apartment = obj.apartment;
|
|
88
|
+
const path_apartment = path + '.apartment';
|
|
89
|
+
if (typeof obj_apartment !== 'string') {
|
|
90
|
+
return new TypeError('Expected "string" but received "' + typeof obj_apartment + '" (at "' + path_apartment + '")');
|
|
91
|
+
}
|
|
92
|
+
const obj_city = obj.city;
|
|
93
|
+
const path_city = path + '.city';
|
|
94
|
+
if (typeof obj_city !== 'string') {
|
|
95
|
+
return new TypeError('Expected "string" but received "' + typeof obj_city + '" (at "' + path_city + '")');
|
|
96
|
+
}
|
|
97
|
+
const obj_country = obj.country;
|
|
98
|
+
const path_country = path + '.country';
|
|
99
|
+
if (typeof obj_country !== 'string') {
|
|
100
|
+
return new TypeError('Expected "string" but received "' + typeof obj_country + '" (at "' + path_country + '")');
|
|
101
|
+
}
|
|
102
|
+
const obj_houseNo = obj.houseNo;
|
|
103
|
+
const path_houseNo = path + '.houseNo';
|
|
104
|
+
if (typeof obj_houseNo !== 'string') {
|
|
105
|
+
return new TypeError('Expected "string" but received "' + typeof obj_houseNo + '" (at "' + path_houseNo + '")');
|
|
106
|
+
}
|
|
107
|
+
const obj_poBox = obj.poBox;
|
|
108
|
+
const path_poBox = path + '.poBox';
|
|
109
|
+
if (typeof obj_poBox !== 'string') {
|
|
110
|
+
return new TypeError('Expected "string" but received "' + typeof obj_poBox + '" (at "' + path_poBox + '")');
|
|
111
|
+
}
|
|
112
|
+
const obj_postalCode = obj.postalCode;
|
|
113
|
+
const path_postalCode = path + '.postalCode';
|
|
114
|
+
if (typeof obj_postalCode !== 'string') {
|
|
115
|
+
return new TypeError('Expected "string" but received "' + typeof obj_postalCode + '" (at "' + path_postalCode + '")');
|
|
116
|
+
}
|
|
117
|
+
const obj_state = obj.state;
|
|
118
|
+
const path_state = path + '.state';
|
|
119
|
+
if (typeof obj_state !== 'string') {
|
|
120
|
+
return new TypeError('Expected "string" but received "' + typeof obj_state + '" (at "' + path_state + '")');
|
|
121
|
+
}
|
|
122
|
+
const obj_street = obj.street;
|
|
123
|
+
const path_street = path + '.street';
|
|
124
|
+
if (typeof obj_street !== 'string') {
|
|
125
|
+
return new TypeError('Expected "string" but received "' + typeof obj_street + '" (at "' + path_street + '")');
|
|
126
|
+
}
|
|
127
|
+
})();
|
|
128
|
+
return v_error === undefined ? null : v_error;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function validate$6(obj, path = 'NameUi') {
|
|
132
|
+
const v_error = (() => {
|
|
133
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
134
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
135
|
+
}
|
|
136
|
+
const obj_first = obj.first;
|
|
137
|
+
const path_first = path + '.first';
|
|
138
|
+
if (typeof obj_first !== 'string') {
|
|
139
|
+
return new TypeError('Expected "string" but received "' + typeof obj_first + '" (at "' + path_first + '")');
|
|
140
|
+
}
|
|
141
|
+
const obj_initials = obj.initials;
|
|
142
|
+
const path_initials = path + '.initials';
|
|
143
|
+
if (typeof obj_initials !== 'string') {
|
|
144
|
+
return new TypeError('Expected "string" but received "' + typeof obj_initials + '" (at "' + path_initials + '")');
|
|
145
|
+
}
|
|
146
|
+
const obj_last = obj.last;
|
|
147
|
+
const path_last = path + '.last';
|
|
148
|
+
if (typeof obj_last !== 'string') {
|
|
149
|
+
return new TypeError('Expected "string" but received "' + typeof obj_last + '" (at "' + path_last + '")');
|
|
150
|
+
}
|
|
151
|
+
})();
|
|
152
|
+
return v_error === undefined ? null : v_error;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function validate$5(obj, path = 'PhoneUi') {
|
|
156
|
+
const v_error = (() => {
|
|
157
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
158
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
159
|
+
}
|
|
160
|
+
const obj_countryCode = obj.countryCode;
|
|
161
|
+
const path_countryCode = path + '.countryCode';
|
|
162
|
+
if (typeof obj_countryCode !== 'string') {
|
|
163
|
+
return new TypeError('Expected "string" but received "' + typeof obj_countryCode + '" (at "' + path_countryCode + '")');
|
|
164
|
+
}
|
|
165
|
+
const obj_extension = obj.extension;
|
|
166
|
+
const path_extension = path + '.extension';
|
|
167
|
+
if (typeof obj_extension !== 'string') {
|
|
168
|
+
return new TypeError('Expected "string" but received "' + typeof obj_extension + '" (at "' + path_extension + '")');
|
|
169
|
+
}
|
|
170
|
+
const obj_number = obj.number;
|
|
171
|
+
const path_number = path + '.number';
|
|
172
|
+
if (typeof obj_number !== 'string') {
|
|
173
|
+
return new TypeError('Expected "string" but received "' + typeof obj_number + '" (at "' + path_number + '")');
|
|
174
|
+
}
|
|
175
|
+
const obj_phoneType = obj.phoneType;
|
|
176
|
+
const path_phoneType = path + '.phoneType';
|
|
177
|
+
if (typeof obj_phoneType !== 'string') {
|
|
178
|
+
return new TypeError('Expected "string" but received "' + typeof obj_phoneType + '" (at "' + path_phoneType + '")');
|
|
179
|
+
}
|
|
180
|
+
})();
|
|
181
|
+
return v_error === undefined ? null : v_error;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function validate$4(obj, path = 'SocialMediaUi') {
|
|
185
|
+
const v_error = (() => {
|
|
186
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
187
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
188
|
+
}
|
|
189
|
+
const obj_handle = obj.handle;
|
|
190
|
+
const path_handle = path + '.handle';
|
|
191
|
+
if (typeof obj_handle !== 'string') {
|
|
192
|
+
return new TypeError('Expected "string" but received "' + typeof obj_handle + '" (at "' + path_handle + '")');
|
|
193
|
+
}
|
|
194
|
+
const obj_link = obj.link;
|
|
195
|
+
const path_link = path + '.link';
|
|
196
|
+
if (typeof obj_link !== 'string') {
|
|
197
|
+
return new TypeError('Expected "string" but received "' + typeof obj_link + '" (at "' + path_link + '")');
|
|
198
|
+
}
|
|
199
|
+
const obj_service = obj.service;
|
|
200
|
+
const path_service = path + '.service';
|
|
201
|
+
if (typeof obj_service !== 'string') {
|
|
202
|
+
return new TypeError('Expected "string" but received "' + typeof obj_service + '" (at "' + path_service + '")');
|
|
203
|
+
}
|
|
204
|
+
})();
|
|
205
|
+
return v_error === undefined ? null : v_error;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function validate$3(obj, path = 'TitleUi') {
|
|
209
|
+
const v_error = (() => {
|
|
210
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
211
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
212
|
+
}
|
|
213
|
+
const obj_function = obj.function;
|
|
214
|
+
const path_function = path + '.function';
|
|
215
|
+
if (typeof obj_function !== 'string') {
|
|
216
|
+
return new TypeError('Expected "string" but received "' + typeof obj_function + '" (at "' + path_function + '")');
|
|
217
|
+
}
|
|
218
|
+
const obj_level = obj.level;
|
|
219
|
+
const path_level = path + '.level';
|
|
220
|
+
if (typeof obj_level !== 'string') {
|
|
221
|
+
return new TypeError('Expected "string" but received "' + typeof obj_level + '" (at "' + path_level + '")');
|
|
222
|
+
}
|
|
223
|
+
const obj_title = obj.title;
|
|
224
|
+
const path_title = path + '.title';
|
|
225
|
+
if (typeof obj_title !== 'string') {
|
|
226
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
227
|
+
}
|
|
228
|
+
})();
|
|
229
|
+
return v_error === undefined ? null : v_error;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function validate$2(obj, path = 'SignatureUi') {
|
|
233
|
+
const v_error = (() => {
|
|
234
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
235
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
236
|
+
}
|
|
237
|
+
const obj_addresses = obj.addresses;
|
|
238
|
+
const path_addresses = path + '.addresses';
|
|
239
|
+
if (!ArrayIsArray(obj_addresses)) {
|
|
240
|
+
return new TypeError('Expected "array" but received "' + typeof obj_addresses + '" (at "' + path_addresses + '")');
|
|
241
|
+
}
|
|
242
|
+
for (let i = 0; i < obj_addresses.length; i++) {
|
|
243
|
+
const obj_addresses_item = obj_addresses[i];
|
|
244
|
+
const path_addresses_item = path_addresses + '[' + i + ']';
|
|
245
|
+
const referencepath_addresses_itemValidationError = validate$7(obj_addresses_item, path_addresses_item);
|
|
246
|
+
if (referencepath_addresses_itemValidationError !== null) {
|
|
247
|
+
let message = 'Object doesn\'t match PhysAddressUi (at "' + path_addresses_item + '")\n';
|
|
248
|
+
message += referencepath_addresses_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
249
|
+
return new TypeError(message);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
const obj_companyName = obj.companyName;
|
|
253
|
+
const path_companyName = path + '.companyName';
|
|
254
|
+
if (typeof obj_companyName !== 'string') {
|
|
255
|
+
return new TypeError('Expected "string" but received "' + typeof obj_companyName + '" (at "' + path_companyName + '")');
|
|
256
|
+
}
|
|
257
|
+
const obj_emailAddress = obj.emailAddress;
|
|
258
|
+
const path_emailAddress = path + '.emailAddress';
|
|
259
|
+
if (typeof obj_emailAddress !== 'string') {
|
|
260
|
+
return new TypeError('Expected "string" but received "' + typeof obj_emailAddress + '" (at "' + path_emailAddress + '")');
|
|
261
|
+
}
|
|
262
|
+
const obj_hash = obj.hash;
|
|
263
|
+
const path_hash = path + '.hash';
|
|
264
|
+
if (typeof obj_hash !== 'string') {
|
|
265
|
+
return new TypeError('Expected "string" but received "' + typeof obj_hash + '" (at "' + path_hash + '")');
|
|
266
|
+
}
|
|
267
|
+
const obj_name = obj.name;
|
|
268
|
+
const path_name = path + '.name';
|
|
269
|
+
const referencepath_nameValidationError = validate$6(obj_name, path_name);
|
|
270
|
+
if (referencepath_nameValidationError !== null) {
|
|
271
|
+
let message = 'Object doesn\'t match NameUi (at "' + path_name + '")\n';
|
|
272
|
+
message += referencepath_nameValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
273
|
+
return new TypeError(message);
|
|
274
|
+
}
|
|
275
|
+
const obj_phones = obj.phones;
|
|
276
|
+
const path_phones = path + '.phones';
|
|
277
|
+
if (!ArrayIsArray(obj_phones)) {
|
|
278
|
+
return new TypeError('Expected "array" but received "' + typeof obj_phones + '" (at "' + path_phones + '")');
|
|
279
|
+
}
|
|
280
|
+
for (let i = 0; i < obj_phones.length; i++) {
|
|
281
|
+
const obj_phones_item = obj_phones[i];
|
|
282
|
+
const path_phones_item = path_phones + '[' + i + ']';
|
|
283
|
+
const referencepath_phones_itemValidationError = validate$5(obj_phones_item, path_phones_item);
|
|
284
|
+
if (referencepath_phones_itemValidationError !== null) {
|
|
285
|
+
let message = 'Object doesn\'t match PhoneUi (at "' + path_phones_item + '")\n';
|
|
286
|
+
message += referencepath_phones_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
287
|
+
return new TypeError(message);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
const obj_receivedTime = obj.receivedTime;
|
|
291
|
+
const path_receivedTime = path + '.receivedTime';
|
|
292
|
+
if (typeof obj_receivedTime !== 'string') {
|
|
293
|
+
return new TypeError('Expected "string" but received "' + typeof obj_receivedTime + '" (at "' + path_receivedTime + '")');
|
|
294
|
+
}
|
|
295
|
+
const obj_sfdcOrgId = obj.sfdcOrgId;
|
|
296
|
+
const path_sfdcOrgId = path + '.sfdcOrgId';
|
|
297
|
+
if (typeof obj_sfdcOrgId !== 'string') {
|
|
298
|
+
return new TypeError('Expected "string" but received "' + typeof obj_sfdcOrgId + '" (at "' + path_sfdcOrgId + '")');
|
|
299
|
+
}
|
|
300
|
+
const obj_socialMediaUrls = obj.socialMediaUrls;
|
|
301
|
+
const path_socialMediaUrls = path + '.socialMediaUrls';
|
|
302
|
+
if (!ArrayIsArray(obj_socialMediaUrls)) {
|
|
303
|
+
return new TypeError('Expected "array" but received "' + typeof obj_socialMediaUrls + '" (at "' + path_socialMediaUrls + '")');
|
|
304
|
+
}
|
|
305
|
+
for (let i = 0; i < obj_socialMediaUrls.length; i++) {
|
|
306
|
+
const obj_socialMediaUrls_item = obj_socialMediaUrls[i];
|
|
307
|
+
const path_socialMediaUrls_item = path_socialMediaUrls + '[' + i + ']';
|
|
308
|
+
const referencepath_socialMediaUrls_itemValidationError = validate$4(obj_socialMediaUrls_item, path_socialMediaUrls_item);
|
|
309
|
+
if (referencepath_socialMediaUrls_itemValidationError !== null) {
|
|
310
|
+
let message = 'Object doesn\'t match SocialMediaUi (at "' + path_socialMediaUrls_item + '")\n';
|
|
311
|
+
message += referencepath_socialMediaUrls_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
312
|
+
return new TypeError(message);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
const obj_title = obj.title;
|
|
316
|
+
const path_title = path + '.title';
|
|
317
|
+
const referencepath_titleValidationError = validate$3(obj_title, path_title);
|
|
318
|
+
if (referencepath_titleValidationError !== null) {
|
|
319
|
+
let message = 'Object doesn\'t match TitleUi (at "' + path_title + '")\n';
|
|
320
|
+
message += referencepath_titleValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
321
|
+
return new TypeError(message);
|
|
322
|
+
}
|
|
323
|
+
const obj_webUrls = obj.webUrls;
|
|
324
|
+
const path_webUrls = path + '.webUrls';
|
|
325
|
+
if (!ArrayIsArray(obj_webUrls)) {
|
|
326
|
+
return new TypeError('Expected "array" but received "' + typeof obj_webUrls + '" (at "' + path_webUrls + '")');
|
|
327
|
+
}
|
|
328
|
+
for (let i = 0; i < obj_webUrls.length; i++) {
|
|
329
|
+
const obj_webUrls_item = obj_webUrls[i];
|
|
330
|
+
const path_webUrls_item = path_webUrls + '[' + i + ']';
|
|
331
|
+
if (typeof obj_webUrls_item !== 'string') {
|
|
332
|
+
return new TypeError('Expected "string" but received "' + typeof obj_webUrls_item + '" (at "' + path_webUrls_item + '")');
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
})();
|
|
336
|
+
return v_error === undefined ? null : v_error;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
function validate$1(obj, path = 'PeopleAPIResponse') {
|
|
340
|
+
const v_error = (() => {
|
|
341
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
342
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
343
|
+
}
|
|
344
|
+
const obj_emailAddress = obj.emailAddress;
|
|
345
|
+
const path_emailAddress = path + '.emailAddress';
|
|
346
|
+
if (typeof obj_emailAddress !== 'string') {
|
|
347
|
+
return new TypeError('Expected "string" but received "' + typeof obj_emailAddress + '" (at "' + path_emailAddress + '")');
|
|
348
|
+
}
|
|
349
|
+
const obj_signature = obj.signature;
|
|
350
|
+
const path_signature = path + '.signature';
|
|
351
|
+
const referencepath_signatureValidationError = validate$2(obj_signature, path_signature);
|
|
352
|
+
if (referencepath_signatureValidationError !== null) {
|
|
353
|
+
let message = 'Object doesn\'t match SignatureUi (at "' + path_signature + '")\n';
|
|
354
|
+
message += referencepath_signatureValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
355
|
+
return new TypeError(message);
|
|
356
|
+
}
|
|
357
|
+
})();
|
|
358
|
+
return v_error === undefined ? null : v_error;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
const VERSION = "1acb2e7e06055d8818df0d3592d62c04";
|
|
362
|
+
function validate(obj, path = 'PeopleAPIResponseCollection') {
|
|
363
|
+
const v_error = (() => {
|
|
364
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
365
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
366
|
+
}
|
|
367
|
+
const obj_responses = obj.responses;
|
|
368
|
+
const path_responses = path + '.responses';
|
|
369
|
+
if (!ArrayIsArray(obj_responses)) {
|
|
370
|
+
return new TypeError('Expected "array" but received "' + typeof obj_responses + '" (at "' + path_responses + '")');
|
|
371
|
+
}
|
|
372
|
+
for (let i = 0; i < obj_responses.length; i++) {
|
|
373
|
+
const obj_responses_item = obj_responses[i];
|
|
374
|
+
const path_responses_item = path_responses + '[' + i + ']';
|
|
375
|
+
const referencepath_responses_itemValidationError = validate$1(obj_responses_item, path_responses_item);
|
|
376
|
+
if (referencepath_responses_itemValidationError !== null) {
|
|
377
|
+
let message = 'Object doesn\'t match PeopleAPIResponse (at "' + path_responses_item + '")\n';
|
|
378
|
+
message += referencepath_responses_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
379
|
+
return new TypeError(message);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
})();
|
|
383
|
+
return v_error === undefined ? null : v_error;
|
|
384
|
+
}
|
|
385
|
+
const RepresentationType = 'PeopleAPIResponseCollection';
|
|
386
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
387
|
+
return input;
|
|
388
|
+
}
|
|
389
|
+
const select$1 = function PeopleAPIResponseCollectionSelect() {
|
|
390
|
+
return {
|
|
391
|
+
kind: 'Fragment',
|
|
392
|
+
version: VERSION,
|
|
393
|
+
private: [],
|
|
394
|
+
opaque: true
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
function equals(existing, incoming) {
|
|
398
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
399
|
+
return false;
|
|
400
|
+
}
|
|
401
|
+
return true;
|
|
402
|
+
}
|
|
403
|
+
const ingest = function PeopleAPIResponseCollectionIngest(input, path, luvio, store, timestamp) {
|
|
404
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
405
|
+
const validateError = validate(input);
|
|
406
|
+
if (validateError !== null) {
|
|
407
|
+
throw validateError;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
const key = path.fullPath;
|
|
411
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 3600000;
|
|
412
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "people-api", VERSION, RepresentationType, equals);
|
|
413
|
+
return createLink(key);
|
|
414
|
+
};
|
|
415
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
416
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
417
|
+
const rootKey = fullPathFactory();
|
|
418
|
+
rootKeySet.set(rootKey, {
|
|
419
|
+
namespace: keyPrefix,
|
|
420
|
+
representationName: RepresentationType,
|
|
421
|
+
mergeable: false
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
function select(luvio, params) {
|
|
426
|
+
return select$1();
|
|
427
|
+
}
|
|
428
|
+
function keyBuilder$1(luvio, params) {
|
|
429
|
+
return keyPrefix + '::PeopleAPIResponseCollection:(' + 'emailAddresses:' + params.queryParams.emailAddresses + ')';
|
|
430
|
+
}
|
|
431
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
432
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
433
|
+
}
|
|
434
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
435
|
+
const { body } = response;
|
|
436
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
437
|
+
luvio.storeIngest(key, ingest, body);
|
|
438
|
+
const snapshot = luvio.storeLookup({
|
|
439
|
+
recordId: key,
|
|
440
|
+
node: select(),
|
|
441
|
+
variables: {},
|
|
442
|
+
}, snapshotRefresh);
|
|
443
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
444
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
445
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
deepFreeze(snapshot.data);
|
|
449
|
+
return snapshot;
|
|
450
|
+
}
|
|
451
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
452
|
+
const key = keyBuilder$1(luvio, params);
|
|
453
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
454
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
455
|
+
return errorSnapshot;
|
|
456
|
+
}
|
|
457
|
+
function createResourceRequest(config) {
|
|
458
|
+
const headers = {};
|
|
459
|
+
return {
|
|
460
|
+
baseUri: '/services/data/v66.0',
|
|
461
|
+
basePath: '/people',
|
|
462
|
+
method: 'get',
|
|
463
|
+
body: null,
|
|
464
|
+
urlParams: {},
|
|
465
|
+
queryParams: config.queryParams,
|
|
466
|
+
headers,
|
|
467
|
+
priority: 'normal',
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
const adapterName = 'getParsedSignatureData';
|
|
472
|
+
const getParsedSignatureData_ConfigPropertyMetadata = [
|
|
473
|
+
generateParamConfigMetadata('emailAddresses', false, 1 /* QueryParameter */, 0 /* String */, true),
|
|
474
|
+
];
|
|
475
|
+
const getParsedSignatureData_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getParsedSignatureData_ConfigPropertyMetadata);
|
|
476
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$1(getParsedSignatureData_ConfigPropertyMetadata);
|
|
477
|
+
function keyBuilder(luvio, config) {
|
|
478
|
+
const resourceParams = createResourceParams(config);
|
|
479
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
480
|
+
}
|
|
481
|
+
function typeCheckConfig(untrustedConfig) {
|
|
482
|
+
const config = {};
|
|
483
|
+
typeCheckConfig$1(untrustedConfig, config, getParsedSignatureData_ConfigPropertyMetadata);
|
|
484
|
+
return config;
|
|
485
|
+
}
|
|
486
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
487
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
488
|
+
return null;
|
|
489
|
+
}
|
|
490
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
491
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
492
|
+
}
|
|
493
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
494
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
495
|
+
return null;
|
|
496
|
+
}
|
|
497
|
+
return config;
|
|
498
|
+
}
|
|
499
|
+
function adapterFragment(luvio, config) {
|
|
500
|
+
createResourceParams(config);
|
|
501
|
+
return select();
|
|
502
|
+
}
|
|
503
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
504
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
505
|
+
config,
|
|
506
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
507
|
+
});
|
|
508
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
509
|
+
}
|
|
510
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
511
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
512
|
+
config,
|
|
513
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
514
|
+
});
|
|
515
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
516
|
+
}
|
|
517
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
518
|
+
const resourceParams = createResourceParams(config);
|
|
519
|
+
const request = createResourceRequest(resourceParams);
|
|
520
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
521
|
+
.then((response) => {
|
|
522
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
523
|
+
const cache = new StoreKeyMap();
|
|
524
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
525
|
+
return cache;
|
|
526
|
+
});
|
|
527
|
+
}, (response) => {
|
|
528
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
532
|
+
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
533
|
+
}
|
|
534
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
535
|
+
const { luvio, config } = context;
|
|
536
|
+
const selector = {
|
|
537
|
+
recordId: keyBuilder(luvio, config),
|
|
538
|
+
node: adapterFragment(luvio, config),
|
|
539
|
+
variables: {},
|
|
540
|
+
};
|
|
541
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
542
|
+
config,
|
|
543
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
544
|
+
});
|
|
545
|
+
return cacheSnapshot;
|
|
546
|
+
}
|
|
547
|
+
const getParsedSignatureDataAdapterFactory = (luvio) => function peopleApi__getParsedSignatureData(untrustedConfig, requestContext) {
|
|
548
|
+
const config = validateAdapterConfig(untrustedConfig, getParsedSignatureData_ConfigPropertyNames);
|
|
549
|
+
// Invalid or incomplete config
|
|
550
|
+
if (config === null) {
|
|
551
|
+
return null;
|
|
552
|
+
}
|
|
553
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
554
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
export { getParsedSignatureDataAdapterFactory };
|