@salesforce/lds-adapters-cdp-data-clean-room 1.332.0-dev19
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/cdp-data-clean-room.js +749 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/createProvider.d.ts +21 -0
- package/dist/es/es2018/types/src/generated/adapters/getDataCleanRoomProvidersPaginated.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +4 -0
- package/dist/es/es2018/types/src/generated/resources/getSsotDataCleanRoomProviders.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/resources/postSsotDataCleanRoomProviders.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/types/CdpPaginatedResponseBaseRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/CdpUserRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/DataCleanRoomProviderCollectionRepresentation.d.ts +53 -0
- package/dist/es/es2018/types/src/generated/types/DataCleanRoomProviderInputRepresentation.d.ts +46 -0
- package/dist/es/es2018/types/src/generated/types/DataCleanRoomProviderRepresentation.d.ts +74 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +67 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +792 -0
- package/src/raml/api.raml +204 -0
- package/src/raml/luvio.raml +23 -0
|
@@ -0,0 +1,749 @@
|
|
|
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$2, StoreKeyMap, createResourceParams as createResourceParams$2 } 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 = 'data-clean-room';
|
|
73
|
+
|
|
74
|
+
const { isArray: ArrayIsArray } = Array;
|
|
75
|
+
const { stringify: JSONStringify } = JSON;
|
|
76
|
+
function equalsArray(a, b, equalsItem) {
|
|
77
|
+
const aLength = a.length;
|
|
78
|
+
const bLength = b.length;
|
|
79
|
+
if (aLength !== bLength) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
for (let i = 0; i < aLength; i++) {
|
|
83
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
function createLink(ref) {
|
|
90
|
+
return {
|
|
91
|
+
__ref: serializeStructuredKey(ref),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function validate$2(obj, path = 'CdpUserRepresentation') {
|
|
96
|
+
const v_error = (() => {
|
|
97
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
98
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
99
|
+
}
|
|
100
|
+
const obj_id = obj.id;
|
|
101
|
+
const path_id = path + '.id';
|
|
102
|
+
if (typeof obj_id !== 'string') {
|
|
103
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
104
|
+
}
|
|
105
|
+
if (obj.name !== undefined) {
|
|
106
|
+
const obj_name = obj.name;
|
|
107
|
+
const path_name = path + '.name';
|
|
108
|
+
if (typeof obj_name !== 'string') {
|
|
109
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (obj.profilePhotoUrl !== undefined) {
|
|
113
|
+
const obj_profilePhotoUrl = obj.profilePhotoUrl;
|
|
114
|
+
const path_profilePhotoUrl = path + '.profilePhotoUrl';
|
|
115
|
+
if (typeof obj_profilePhotoUrl !== 'string') {
|
|
116
|
+
return new TypeError('Expected "string" but received "' + typeof obj_profilePhotoUrl + '" (at "' + path_profilePhotoUrl + '")');
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
})();
|
|
120
|
+
return v_error === undefined ? null : v_error;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const VERSION$1 = "929b1bcf37fe62f914c2364146a0f5e6";
|
|
124
|
+
function validate$1(obj, path = 'DataCleanRoomProviderRepresentation') {
|
|
125
|
+
const v_error = (() => {
|
|
126
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
127
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
128
|
+
}
|
|
129
|
+
if (obj.createdBy !== undefined) {
|
|
130
|
+
const obj_createdBy = obj.createdBy;
|
|
131
|
+
const path_createdBy = path + '.createdBy';
|
|
132
|
+
const referencepath_createdByValidationError = validate$2(obj_createdBy, path_createdBy);
|
|
133
|
+
if (referencepath_createdByValidationError !== null) {
|
|
134
|
+
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_createdBy + '")\n';
|
|
135
|
+
message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
136
|
+
return new TypeError(message);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (obj.createdDate !== undefined) {
|
|
140
|
+
const obj_createdDate = obj.createdDate;
|
|
141
|
+
const path_createdDate = path + '.createdDate';
|
|
142
|
+
if (typeof obj_createdDate !== 'string') {
|
|
143
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
const obj_dataCloudOrgId = obj.dataCloudOrgId;
|
|
147
|
+
const path_dataCloudOrgId = path + '.dataCloudOrgId';
|
|
148
|
+
if (typeof obj_dataCloudOrgId !== 'string') {
|
|
149
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataCloudOrgId + '" (at "' + path_dataCloudOrgId + '")');
|
|
150
|
+
}
|
|
151
|
+
const obj_description = obj.description;
|
|
152
|
+
const path_description = path + '.description';
|
|
153
|
+
if (typeof obj_description !== 'string') {
|
|
154
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
155
|
+
}
|
|
156
|
+
const obj_id = obj.id;
|
|
157
|
+
const path_id = path + '.id';
|
|
158
|
+
if (typeof obj_id !== 'string') {
|
|
159
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
160
|
+
}
|
|
161
|
+
if (obj.label !== undefined) {
|
|
162
|
+
const obj_label = obj.label;
|
|
163
|
+
const path_label = path + '.label';
|
|
164
|
+
if (typeof obj_label !== 'string') {
|
|
165
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (obj.lastModifiedBy !== undefined) {
|
|
169
|
+
const obj_lastModifiedBy = obj.lastModifiedBy;
|
|
170
|
+
const path_lastModifiedBy = path + '.lastModifiedBy';
|
|
171
|
+
const referencepath_lastModifiedByValidationError = validate$2(obj_lastModifiedBy, path_lastModifiedBy);
|
|
172
|
+
if (referencepath_lastModifiedByValidationError !== null) {
|
|
173
|
+
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastModifiedBy + '")\n';
|
|
174
|
+
message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
175
|
+
return new TypeError(message);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (obj.lastModifiedDate !== undefined) {
|
|
179
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
180
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
181
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
182
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (obj.logoUrl !== undefined) {
|
|
186
|
+
const obj_logoUrl = obj.logoUrl;
|
|
187
|
+
const path_logoUrl = path + '.logoUrl';
|
|
188
|
+
if (typeof obj_logoUrl !== 'string') {
|
|
189
|
+
return new TypeError('Expected "string" but received "' + typeof obj_logoUrl + '" (at "' + path_logoUrl + '")');
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (obj.name !== undefined) {
|
|
193
|
+
const obj_name = obj.name;
|
|
194
|
+
const path_name = path + '.name';
|
|
195
|
+
if (typeof obj_name !== 'string') {
|
|
196
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (obj.namespace !== undefined) {
|
|
200
|
+
const obj_namespace = obj.namespace;
|
|
201
|
+
const path_namespace = path + '.namespace';
|
|
202
|
+
if (typeof obj_namespace !== 'string') {
|
|
203
|
+
return new TypeError('Expected "string" but received "' + typeof obj_namespace + '" (at "' + path_namespace + '")');
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const obj_templateNames = obj.templateNames;
|
|
207
|
+
const path_templateNames = path + '.templateNames';
|
|
208
|
+
if (!ArrayIsArray(obj_templateNames)) {
|
|
209
|
+
return new TypeError('Expected "array" but received "' + typeof obj_templateNames + '" (at "' + path_templateNames + '")');
|
|
210
|
+
}
|
|
211
|
+
for (let i = 0; i < obj_templateNames.length; i++) {
|
|
212
|
+
const obj_templateNames_item = obj_templateNames[i];
|
|
213
|
+
const path_templateNames_item = path_templateNames + '[' + i + ']';
|
|
214
|
+
if (typeof obj_templateNames_item !== 'string') {
|
|
215
|
+
return new TypeError('Expected "string" but received "' + typeof obj_templateNames_item + '" (at "' + path_templateNames_item + '")');
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (obj.url !== undefined) {
|
|
219
|
+
const obj_url = obj.url;
|
|
220
|
+
const path_url = path + '.url';
|
|
221
|
+
if (typeof obj_url !== 'string') {
|
|
222
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
})();
|
|
226
|
+
return v_error === undefined ? null : v_error;
|
|
227
|
+
}
|
|
228
|
+
const RepresentationType$1 = 'DataCleanRoomProviderRepresentation';
|
|
229
|
+
function keyBuilder$2(luvio, config) {
|
|
230
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.id;
|
|
231
|
+
}
|
|
232
|
+
function keyBuilderFromType(luvio, object) {
|
|
233
|
+
const keyParams = {
|
|
234
|
+
id: object.id
|
|
235
|
+
};
|
|
236
|
+
return keyBuilder$2(luvio, keyParams);
|
|
237
|
+
}
|
|
238
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
239
|
+
return input;
|
|
240
|
+
}
|
|
241
|
+
const select$3 = function DataCleanRoomProviderRepresentationSelect() {
|
|
242
|
+
return {
|
|
243
|
+
kind: 'Fragment',
|
|
244
|
+
version: VERSION$1,
|
|
245
|
+
private: [],
|
|
246
|
+
opaque: true
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
function equals$1(existing, incoming) {
|
|
250
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
const ingest$1 = function DataCleanRoomProviderRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
256
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
257
|
+
const validateError = validate$1(input);
|
|
258
|
+
if (validateError !== null) {
|
|
259
|
+
throw validateError;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
const key = keyBuilderFromType(luvio, input);
|
|
263
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
|
|
264
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "data-clean-room", VERSION$1, RepresentationType$1, equals$1);
|
|
265
|
+
return createLink(key);
|
|
266
|
+
};
|
|
267
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
268
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
269
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
270
|
+
rootKeySet.set(rootKey, {
|
|
271
|
+
namespace: keyPrefix,
|
|
272
|
+
representationName: RepresentationType$1,
|
|
273
|
+
mergeable: false
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
const VERSION = "52237eeecd4f8f11ae22e265d9abe5ca";
|
|
278
|
+
function validate(obj, path = 'DataCleanRoomProviderCollectionRepresentation') {
|
|
279
|
+
const v_error = (() => {
|
|
280
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
281
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
282
|
+
}
|
|
283
|
+
if (obj.currentPageUrl !== undefined) {
|
|
284
|
+
const obj_currentPageUrl = obj.currentPageUrl;
|
|
285
|
+
const path_currentPageUrl = path + '.currentPageUrl';
|
|
286
|
+
if (typeof obj_currentPageUrl !== 'string') {
|
|
287
|
+
return new TypeError('Expected "string" but received "' + typeof obj_currentPageUrl + '" (at "' + path_currentPageUrl + '")');
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
if (obj.limit !== undefined) {
|
|
291
|
+
const obj_limit = obj.limit;
|
|
292
|
+
const path_limit = path + '.limit';
|
|
293
|
+
if (typeof obj_limit !== 'number' || (typeof obj_limit === 'number' && Math.floor(obj_limit) !== obj_limit)) {
|
|
294
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_limit + '" (at "' + path_limit + '")');
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
if (obj.nextPageUrl !== undefined) {
|
|
298
|
+
const obj_nextPageUrl = obj.nextPageUrl;
|
|
299
|
+
const path_nextPageUrl = path + '.nextPageUrl';
|
|
300
|
+
let obj_nextPageUrl_union0 = null;
|
|
301
|
+
const obj_nextPageUrl_union0_error = (() => {
|
|
302
|
+
if (typeof obj_nextPageUrl !== 'string') {
|
|
303
|
+
return new TypeError('Expected "string" but received "' + typeof obj_nextPageUrl + '" (at "' + path_nextPageUrl + '")');
|
|
304
|
+
}
|
|
305
|
+
})();
|
|
306
|
+
if (obj_nextPageUrl_union0_error != null) {
|
|
307
|
+
obj_nextPageUrl_union0 = obj_nextPageUrl_union0_error.message;
|
|
308
|
+
}
|
|
309
|
+
let obj_nextPageUrl_union1 = null;
|
|
310
|
+
const obj_nextPageUrl_union1_error = (() => {
|
|
311
|
+
if (obj_nextPageUrl !== null) {
|
|
312
|
+
return new TypeError('Expected "null" but received "' + typeof obj_nextPageUrl + '" (at "' + path_nextPageUrl + '")');
|
|
313
|
+
}
|
|
314
|
+
})();
|
|
315
|
+
if (obj_nextPageUrl_union1_error != null) {
|
|
316
|
+
obj_nextPageUrl_union1 = obj_nextPageUrl_union1_error.message;
|
|
317
|
+
}
|
|
318
|
+
if (obj_nextPageUrl_union0 && obj_nextPageUrl_union1) {
|
|
319
|
+
let message = 'Object doesn\'t match union (at "' + path_nextPageUrl + '")';
|
|
320
|
+
message += '\n' + obj_nextPageUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
321
|
+
message += '\n' + obj_nextPageUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
322
|
+
return new TypeError(message);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (obj.offset !== undefined) {
|
|
326
|
+
const obj_offset = obj.offset;
|
|
327
|
+
const path_offset = path + '.offset';
|
|
328
|
+
if (typeof obj_offset !== 'number' || (typeof obj_offset === 'number' && Math.floor(obj_offset) !== obj_offset)) {
|
|
329
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_offset + '" (at "' + path_offset + '")');
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
const obj_providers = obj.providers;
|
|
333
|
+
const path_providers = path + '.providers';
|
|
334
|
+
if (!ArrayIsArray(obj_providers)) {
|
|
335
|
+
return new TypeError('Expected "array" but received "' + typeof obj_providers + '" (at "' + path_providers + '")');
|
|
336
|
+
}
|
|
337
|
+
for (let i = 0; i < obj_providers.length; i++) {
|
|
338
|
+
const obj_providers_item = obj_providers[i];
|
|
339
|
+
const path_providers_item = path_providers + '[' + i + ']';
|
|
340
|
+
if (typeof obj_providers_item !== 'object') {
|
|
341
|
+
return new TypeError('Expected "object" but received "' + typeof obj_providers_item + '" (at "' + path_providers_item + '")');
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
if (obj.totalSize !== undefined) {
|
|
345
|
+
const obj_totalSize = obj.totalSize;
|
|
346
|
+
const path_totalSize = path + '.totalSize';
|
|
347
|
+
if (typeof obj_totalSize !== 'number' || (typeof obj_totalSize === 'number' && Math.floor(obj_totalSize) !== obj_totalSize)) {
|
|
348
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalSize + '" (at "' + path_totalSize + '")');
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
})();
|
|
352
|
+
return v_error === undefined ? null : v_error;
|
|
353
|
+
}
|
|
354
|
+
const RepresentationType = 'DataCleanRoomProviderCollectionRepresentation';
|
|
355
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
356
|
+
const input_providers = input.providers;
|
|
357
|
+
const input_providers_id = path.fullPath + '__providers';
|
|
358
|
+
for (let i = 0; i < input_providers.length; i++) {
|
|
359
|
+
const input_providers_item = input_providers[i];
|
|
360
|
+
let input_providers_item_id = input_providers_id + '__' + i;
|
|
361
|
+
input_providers[i] = ingest$1(input_providers_item, {
|
|
362
|
+
fullPath: input_providers_item_id,
|
|
363
|
+
propertyName: i,
|
|
364
|
+
parent: {
|
|
365
|
+
data: input,
|
|
366
|
+
key: path.fullPath,
|
|
367
|
+
existing: existing,
|
|
368
|
+
},
|
|
369
|
+
ttl: path.ttl
|
|
370
|
+
}, luvio, store, timestamp);
|
|
371
|
+
}
|
|
372
|
+
return input;
|
|
373
|
+
}
|
|
374
|
+
const select$2 = function DataCleanRoomProviderCollectionRepresentationSelect() {
|
|
375
|
+
return {
|
|
376
|
+
kind: 'Fragment',
|
|
377
|
+
version: VERSION,
|
|
378
|
+
private: [],
|
|
379
|
+
selections: [
|
|
380
|
+
{
|
|
381
|
+
name: 'currentPageUrl',
|
|
382
|
+
kind: 'Scalar',
|
|
383
|
+
required: false
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
name: 'limit',
|
|
387
|
+
kind: 'Scalar',
|
|
388
|
+
required: false
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
name: 'nextPageUrl',
|
|
392
|
+
kind: 'Scalar',
|
|
393
|
+
required: false
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
name: 'offset',
|
|
397
|
+
kind: 'Scalar',
|
|
398
|
+
required: false
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
name: 'providers',
|
|
402
|
+
kind: 'Link',
|
|
403
|
+
plural: true,
|
|
404
|
+
fragment: select$3()
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: 'totalSize',
|
|
408
|
+
kind: 'Scalar',
|
|
409
|
+
required: false
|
|
410
|
+
}
|
|
411
|
+
]
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
function equals(existing, incoming) {
|
|
415
|
+
const existing_limit = existing.limit;
|
|
416
|
+
const incoming_limit = incoming.limit;
|
|
417
|
+
// if at least one of these optionals is defined
|
|
418
|
+
if (existing_limit !== undefined || incoming_limit !== undefined) {
|
|
419
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
420
|
+
// not equal
|
|
421
|
+
if (existing_limit === undefined || incoming_limit === undefined) {
|
|
422
|
+
return false;
|
|
423
|
+
}
|
|
424
|
+
if (!(existing_limit === incoming_limit)) {
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
const existing_offset = existing.offset;
|
|
429
|
+
const incoming_offset = incoming.offset;
|
|
430
|
+
// if at least one of these optionals is defined
|
|
431
|
+
if (existing_offset !== undefined || incoming_offset !== undefined) {
|
|
432
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
433
|
+
// not equal
|
|
434
|
+
if (existing_offset === undefined || incoming_offset === undefined) {
|
|
435
|
+
return false;
|
|
436
|
+
}
|
|
437
|
+
if (!(existing_offset === incoming_offset)) {
|
|
438
|
+
return false;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
const existing_totalSize = existing.totalSize;
|
|
442
|
+
const incoming_totalSize = incoming.totalSize;
|
|
443
|
+
// if at least one of these optionals is defined
|
|
444
|
+
if (existing_totalSize !== undefined || incoming_totalSize !== undefined) {
|
|
445
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
446
|
+
// not equal
|
|
447
|
+
if (existing_totalSize === undefined || incoming_totalSize === undefined) {
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
450
|
+
if (!(existing_totalSize === incoming_totalSize)) {
|
|
451
|
+
return false;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
const existing_currentPageUrl = existing.currentPageUrl;
|
|
455
|
+
const incoming_currentPageUrl = incoming.currentPageUrl;
|
|
456
|
+
// if at least one of these optionals is defined
|
|
457
|
+
if (existing_currentPageUrl !== undefined || incoming_currentPageUrl !== undefined) {
|
|
458
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
459
|
+
// not equal
|
|
460
|
+
if (existing_currentPageUrl === undefined || incoming_currentPageUrl === undefined) {
|
|
461
|
+
return false;
|
|
462
|
+
}
|
|
463
|
+
if (!(existing_currentPageUrl === incoming_currentPageUrl)) {
|
|
464
|
+
return false;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
const existing_nextPageUrl = existing.nextPageUrl;
|
|
468
|
+
const incoming_nextPageUrl = incoming.nextPageUrl;
|
|
469
|
+
// if at least one of these optionals is defined
|
|
470
|
+
if (existing_nextPageUrl !== undefined || incoming_nextPageUrl !== undefined) {
|
|
471
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
472
|
+
// not equal
|
|
473
|
+
if (existing_nextPageUrl === undefined || incoming_nextPageUrl === undefined) {
|
|
474
|
+
return false;
|
|
475
|
+
}
|
|
476
|
+
if (!(existing_nextPageUrl === incoming_nextPageUrl)) {
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
const existing_providers = existing.providers;
|
|
481
|
+
const incoming_providers = incoming.providers;
|
|
482
|
+
const equals_providers_items = equalsArray(existing_providers, incoming_providers, (existing_providers_item, incoming_providers_item) => {
|
|
483
|
+
if (!(existing_providers_item.__ref === incoming_providers_item.__ref)) {
|
|
484
|
+
return false;
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
if (equals_providers_items === false) {
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
return true;
|
|
491
|
+
}
|
|
492
|
+
const ingest = function DataCleanRoomProviderCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
493
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
494
|
+
const validateError = validate(input);
|
|
495
|
+
if (validateError !== null) {
|
|
496
|
+
throw validateError;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
const key = path.fullPath;
|
|
500
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
|
|
501
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "data-clean-room", VERSION, RepresentationType, equals);
|
|
502
|
+
return createLink(key);
|
|
503
|
+
};
|
|
504
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
505
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
506
|
+
const rootKey = fullPathFactory();
|
|
507
|
+
rootKeySet.set(rootKey, {
|
|
508
|
+
namespace: keyPrefix,
|
|
509
|
+
representationName: RepresentationType,
|
|
510
|
+
mergeable: false
|
|
511
|
+
});
|
|
512
|
+
const input_providers_length = input.providers.length;
|
|
513
|
+
for (let i = 0; i < input_providers_length; i++) {
|
|
514
|
+
getTypeCacheKeys$1(rootKeySet, luvio, input.providers[i]);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
function select$1(luvio, params) {
|
|
519
|
+
return select$2();
|
|
520
|
+
}
|
|
521
|
+
function keyBuilder$1(luvio, params) {
|
|
522
|
+
return keyPrefix + '::DataCleanRoomProviderCollectionRepresentation:(' + 'batchSize:' + params.queryParams.batchSize + ',' + 'filters:' + params.queryParams.filters + ',' + 'offset:' + params.queryParams.offset + ',' + 'orderBy:' + params.queryParams.orderBy + ')';
|
|
523
|
+
}
|
|
524
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
525
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
526
|
+
}
|
|
527
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
528
|
+
const { body } = response;
|
|
529
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
530
|
+
luvio.storeIngest(key, ingest, body);
|
|
531
|
+
const snapshot = luvio.storeLookup({
|
|
532
|
+
recordId: key,
|
|
533
|
+
node: select$1(),
|
|
534
|
+
variables: {},
|
|
535
|
+
}, snapshotRefresh);
|
|
536
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
537
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
538
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
deepFreeze(snapshot.data);
|
|
542
|
+
return snapshot;
|
|
543
|
+
}
|
|
544
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
545
|
+
const key = keyBuilder$1(luvio, params);
|
|
546
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
547
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
548
|
+
return errorSnapshot;
|
|
549
|
+
}
|
|
550
|
+
function createResourceRequest$1(config) {
|
|
551
|
+
const headers = {};
|
|
552
|
+
return {
|
|
553
|
+
baseUri: '/services/data/v63.0',
|
|
554
|
+
basePath: '/ssot/data-clean-room/providers',
|
|
555
|
+
method: 'get',
|
|
556
|
+
body: null,
|
|
557
|
+
urlParams: {},
|
|
558
|
+
queryParams: config.queryParams,
|
|
559
|
+
headers,
|
|
560
|
+
priority: 'normal',
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
const adapterName$1 = 'getDataCleanRoomProvidersPaginated';
|
|
565
|
+
const getDataCleanRoomProvidersPaginated_ConfigPropertyMetadata = [
|
|
566
|
+
generateParamConfigMetadata('batchSize', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
567
|
+
generateParamConfigMetadata('filters', false, 1 /* QueryParameter */, 0 /* String */),
|
|
568
|
+
generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
569
|
+
generateParamConfigMetadata('orderBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
570
|
+
];
|
|
571
|
+
const getDataCleanRoomProvidersPaginated_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getDataCleanRoomProvidersPaginated_ConfigPropertyMetadata);
|
|
572
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(getDataCleanRoomProvidersPaginated_ConfigPropertyMetadata);
|
|
573
|
+
function keyBuilder(luvio, config) {
|
|
574
|
+
const resourceParams = createResourceParams$1(config);
|
|
575
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
576
|
+
}
|
|
577
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
578
|
+
const config = {};
|
|
579
|
+
typeCheckConfig$2(untrustedConfig, config, getDataCleanRoomProvidersPaginated_ConfigPropertyMetadata);
|
|
580
|
+
return config;
|
|
581
|
+
}
|
|
582
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
583
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
584
|
+
return null;
|
|
585
|
+
}
|
|
586
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
587
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
588
|
+
}
|
|
589
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
590
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
591
|
+
return null;
|
|
592
|
+
}
|
|
593
|
+
return config;
|
|
594
|
+
}
|
|
595
|
+
function adapterFragment(luvio, config) {
|
|
596
|
+
createResourceParams$1(config);
|
|
597
|
+
return select$1();
|
|
598
|
+
}
|
|
599
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
600
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
601
|
+
config,
|
|
602
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
603
|
+
});
|
|
604
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
605
|
+
}
|
|
606
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
607
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
608
|
+
config,
|
|
609
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
610
|
+
});
|
|
611
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
612
|
+
}
|
|
613
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
614
|
+
const resourceParams = createResourceParams$1(config);
|
|
615
|
+
const request = createResourceRequest$1(resourceParams);
|
|
616
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
617
|
+
.then((response) => {
|
|
618
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
619
|
+
const cache = new StoreKeyMap();
|
|
620
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
621
|
+
return cache;
|
|
622
|
+
});
|
|
623
|
+
}, (response) => {
|
|
624
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
628
|
+
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
629
|
+
}
|
|
630
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
631
|
+
const { luvio, config } = context;
|
|
632
|
+
const selector = {
|
|
633
|
+
recordId: keyBuilder(luvio, config),
|
|
634
|
+
node: adapterFragment(luvio, config),
|
|
635
|
+
variables: {},
|
|
636
|
+
};
|
|
637
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
638
|
+
config,
|
|
639
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
640
|
+
});
|
|
641
|
+
return cacheSnapshot;
|
|
642
|
+
}
|
|
643
|
+
const getDataCleanRoomProvidersPaginatedAdapterFactory = (luvio) => function dataCleanRoom__getDataCleanRoomProvidersPaginated(untrustedConfig, requestContext) {
|
|
644
|
+
const config = validateAdapterConfig$1(untrustedConfig, getDataCleanRoomProvidersPaginated_ConfigPropertyNames);
|
|
645
|
+
// Invalid or incomplete config
|
|
646
|
+
if (config === null) {
|
|
647
|
+
return null;
|
|
648
|
+
}
|
|
649
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
650
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
651
|
+
};
|
|
652
|
+
|
|
653
|
+
function select(luvio, params) {
|
|
654
|
+
return select$3();
|
|
655
|
+
}
|
|
656
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
657
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
658
|
+
}
|
|
659
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
660
|
+
const { body } = response;
|
|
661
|
+
const key = keyBuilderFromType(luvio, body);
|
|
662
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
663
|
+
const snapshot = luvio.storeLookup({
|
|
664
|
+
recordId: key,
|
|
665
|
+
node: select(),
|
|
666
|
+
variables: {},
|
|
667
|
+
});
|
|
668
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
669
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
670
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
deepFreeze(snapshot.data);
|
|
674
|
+
return snapshot;
|
|
675
|
+
}
|
|
676
|
+
function createResourceRequest(config) {
|
|
677
|
+
const headers = {};
|
|
678
|
+
return {
|
|
679
|
+
baseUri: '/services/data/v63.0',
|
|
680
|
+
basePath: '/ssot/data-clean-room/providers',
|
|
681
|
+
method: 'post',
|
|
682
|
+
body: config.body,
|
|
683
|
+
urlParams: {},
|
|
684
|
+
queryParams: {},
|
|
685
|
+
headers,
|
|
686
|
+
priority: 'normal',
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
const adapterName = 'createProvider';
|
|
691
|
+
const createProvider_ConfigPropertyMetadata = [
|
|
692
|
+
generateParamConfigMetadata('label', true, 2 /* Body */, 0 /* String */),
|
|
693
|
+
generateParamConfigMetadata('description', true, 2 /* Body */, 0 /* String */),
|
|
694
|
+
generateParamConfigMetadata('templateNames', true, 2 /* Body */, 0 /* String */, true),
|
|
695
|
+
generateParamConfigMetadata('dataCloudOrgId', true, 2 /* Body */, 0 /* String */),
|
|
696
|
+
generateParamConfigMetadata('dataspaceName', false, 2 /* Body */, 0 /* String */),
|
|
697
|
+
generateParamConfigMetadata('name', false, 2 /* Body */, 0 /* String */),
|
|
698
|
+
generateParamConfigMetadata('logoUrl', false, 2 /* Body */, 0 /* String */),
|
|
699
|
+
];
|
|
700
|
+
const createProvider_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, createProvider_ConfigPropertyMetadata);
|
|
701
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$2(createProvider_ConfigPropertyMetadata);
|
|
702
|
+
function typeCheckConfig(untrustedConfig) {
|
|
703
|
+
const config = {};
|
|
704
|
+
typeCheckConfig$2(untrustedConfig, config, createProvider_ConfigPropertyMetadata);
|
|
705
|
+
return config;
|
|
706
|
+
}
|
|
707
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
708
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
709
|
+
return null;
|
|
710
|
+
}
|
|
711
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
712
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
713
|
+
}
|
|
714
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
715
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
716
|
+
return null;
|
|
717
|
+
}
|
|
718
|
+
return config;
|
|
719
|
+
}
|
|
720
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
721
|
+
const resourceParams = createResourceParams(config);
|
|
722
|
+
const request = createResourceRequest(resourceParams);
|
|
723
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
724
|
+
.then((response) => {
|
|
725
|
+
return luvio.handleSuccessResponse(() => {
|
|
726
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
727
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
728
|
+
}, () => {
|
|
729
|
+
const cache = new StoreKeyMap();
|
|
730
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
731
|
+
return cache;
|
|
732
|
+
});
|
|
733
|
+
}, (response) => {
|
|
734
|
+
deepFreeze(response);
|
|
735
|
+
throw response;
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
const createProviderAdapterFactory = (luvio) => {
|
|
739
|
+
return function createProvider(untrustedConfig) {
|
|
740
|
+
const config = validateAdapterConfig(untrustedConfig, createProvider_ConfigPropertyNames);
|
|
741
|
+
// Invalid or incomplete config
|
|
742
|
+
if (config === null) {
|
|
743
|
+
throw new Error('Invalid config for "createProvider"');
|
|
744
|
+
}
|
|
745
|
+
return buildNetworkSnapshot(luvio, config);
|
|
746
|
+
};
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
export { createProviderAdapterFactory, getDataCleanRoomProvidersPaginatedAdapterFactory };
|