@salesforce/lds-adapters-service-gis 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/service-gis.js +1670 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/createGisExternalAuthIdentityProvider.d.ts +20 -0
- package/dist/es/es2018/types/src/generated/adapters/getGisExternalAuthAccessToken.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/getGisExternalAuthIdentityProviders.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/getGisExtlMapObjectConfig.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getGisRelatedObjectConfig.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +5 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +10 -0
- package/dist/es/es2018/types/src/generated/resources/getGisAuthGisExternalAccessToken.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/getGisAuthGisExternalAuthIdentityProviders.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/getGisConfigGisExtlMapObjectConfig.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getGisConfigGisRelatedObjectConfig.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/postGisAuthGisExternalAuthIdentityProvider.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/types/ErrorResponse.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/GisExternalAccessTokenOutputRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/GisExternalAuthIdentityProviderCollectionRepresentation.d.ts +42 -0
- package/dist/es/es2018/types/src/generated/types/GisExternalAuthIdentityProviderInputRepresentation.d.ts +44 -0
- package/dist/es/es2018/types/src/generated/types/GisExternalAuthIdentityProviderOutputRepresentation.d.ts +56 -0
- package/dist/es/es2018/types/src/generated/types/GisExtlMapObjectConfigCollectionRepresentation.d.ts +42 -0
- package/dist/es/es2018/types/src/generated/types/GisExtlMapObjectConfigOutputRepresentation.d.ts +50 -0
- package/dist/es/es2018/types/src/generated/types/GisRelatedObjectConfigCollectionRepresentation.d.ts +42 -0
- package/dist/es/es2018/types/src/generated/types/GisRelatedObjectConfigOutputRepresentation.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +68 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +1750 -0
- package/src/raml/api.raml +270 -0
- package/src/raml/luvio.raml +77 -0
|
@@ -0,0 +1,1670 @@
|
|
|
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$4, typeCheckConfig as typeCheckConfig$5, StoreKeyMap, createResourceParams as createResourceParams$5 } 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 = 'gis';
|
|
73
|
+
|
|
74
|
+
const { isArray: ArrayIsArray } = Array;
|
|
75
|
+
function equalsArray(a, b, equalsItem) {
|
|
76
|
+
const aLength = a.length;
|
|
77
|
+
const bLength = b.length;
|
|
78
|
+
if (aLength !== bLength) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
for (let i = 0; i < aLength; i++) {
|
|
82
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
function createLink(ref) {
|
|
89
|
+
return {
|
|
90
|
+
__ref: serializeStructuredKey(ref),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const TTL$6 = 300;
|
|
95
|
+
const VERSION$6 = "534766993185fd21f5aac8e706c226bf";
|
|
96
|
+
function validate$6(obj, path = 'GisExternalAccessTokenOutputRepresentation') {
|
|
97
|
+
const v_error = (() => {
|
|
98
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
99
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
100
|
+
}
|
|
101
|
+
const obj_expiresIn = obj.expiresIn;
|
|
102
|
+
const path_expiresIn = path + '.expiresIn';
|
|
103
|
+
if (typeof obj_expiresIn !== 'number' || (typeof obj_expiresIn === 'number' && Math.floor(obj_expiresIn) !== obj_expiresIn)) {
|
|
104
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_expiresIn + '" (at "' + path_expiresIn + '")');
|
|
105
|
+
}
|
|
106
|
+
const obj_token = obj.token;
|
|
107
|
+
const path_token = path + '.token';
|
|
108
|
+
if (typeof obj_token !== 'string') {
|
|
109
|
+
return new TypeError('Expected "string" but received "' + typeof obj_token + '" (at "' + path_token + '")');
|
|
110
|
+
}
|
|
111
|
+
const obj_type = obj.type;
|
|
112
|
+
const path_type = path + '.type';
|
|
113
|
+
if (typeof obj_type !== 'string') {
|
|
114
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
115
|
+
}
|
|
116
|
+
})();
|
|
117
|
+
return v_error === undefined ? null : v_error;
|
|
118
|
+
}
|
|
119
|
+
const RepresentationType$6 = 'GisExternalAccessTokenOutputRepresentation';
|
|
120
|
+
function normalize$6(input, existing, path, luvio, store, timestamp) {
|
|
121
|
+
return input;
|
|
122
|
+
}
|
|
123
|
+
const select$b = function GisExternalAccessTokenOutputRepresentationSelect() {
|
|
124
|
+
return {
|
|
125
|
+
kind: 'Fragment',
|
|
126
|
+
version: VERSION$6,
|
|
127
|
+
private: [],
|
|
128
|
+
selections: [
|
|
129
|
+
{
|
|
130
|
+
name: 'expiresIn',
|
|
131
|
+
kind: 'Scalar'
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'token',
|
|
135
|
+
kind: 'Scalar'
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: 'type',
|
|
139
|
+
kind: 'Scalar'
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
function equals$6(existing, incoming) {
|
|
145
|
+
const existing_expiresIn = existing.expiresIn;
|
|
146
|
+
const incoming_expiresIn = incoming.expiresIn;
|
|
147
|
+
if (!(existing_expiresIn === incoming_expiresIn)) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
const existing_token = existing.token;
|
|
151
|
+
const incoming_token = incoming.token;
|
|
152
|
+
if (!(existing_token === incoming_token)) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
const existing_type = existing.type;
|
|
156
|
+
const incoming_type = incoming.type;
|
|
157
|
+
if (!(existing_type === incoming_type)) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
const ingest$6 = function GisExternalAccessTokenOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
163
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
164
|
+
const validateError = validate$6(input);
|
|
165
|
+
if (validateError !== null) {
|
|
166
|
+
throw validateError;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
const key = path.fullPath;
|
|
170
|
+
const ttlToUse = TTL$6;
|
|
171
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "gis", VERSION$6, RepresentationType$6, equals$6);
|
|
172
|
+
return createLink(key);
|
|
173
|
+
};
|
|
174
|
+
function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
|
|
175
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
176
|
+
const rootKey = fullPathFactory();
|
|
177
|
+
rootKeySet.set(rootKey, {
|
|
178
|
+
namespace: keyPrefix,
|
|
179
|
+
representationName: RepresentationType$6,
|
|
180
|
+
mergeable: false
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function select$a(luvio, params) {
|
|
185
|
+
return select$b();
|
|
186
|
+
}
|
|
187
|
+
function keyBuilder$a(luvio, params) {
|
|
188
|
+
return keyPrefix + '::GisExternalAccessTokenOutputRepresentation:(' + 'authSettingsId:' + params.queryParams.authSettingsId + ')';
|
|
189
|
+
}
|
|
190
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
191
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response, () => keyBuilder$a(luvio, resourceParams));
|
|
192
|
+
}
|
|
193
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
194
|
+
const { body } = response;
|
|
195
|
+
const key = keyBuilder$a(luvio, resourceParams);
|
|
196
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
197
|
+
const snapshot = luvio.storeLookup({
|
|
198
|
+
recordId: key,
|
|
199
|
+
node: select$a(),
|
|
200
|
+
variables: {},
|
|
201
|
+
}, snapshotRefresh);
|
|
202
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
203
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
204
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
deepFreeze(snapshot.data);
|
|
208
|
+
return snapshot;
|
|
209
|
+
}
|
|
210
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
211
|
+
const key = keyBuilder$a(luvio, params);
|
|
212
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
213
|
+
const storeMetadataParams = {
|
|
214
|
+
ttl: TTL$6,
|
|
215
|
+
namespace: keyPrefix,
|
|
216
|
+
version: VERSION$6,
|
|
217
|
+
representationName: RepresentationType$6
|
|
218
|
+
};
|
|
219
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
220
|
+
return errorSnapshot;
|
|
221
|
+
}
|
|
222
|
+
function createResourceRequest$4(config) {
|
|
223
|
+
const headers = {};
|
|
224
|
+
return {
|
|
225
|
+
baseUri: '/services/data/v66.0',
|
|
226
|
+
basePath: '/gis/auth/GisExternalAccessToken',
|
|
227
|
+
method: 'get',
|
|
228
|
+
body: null,
|
|
229
|
+
urlParams: {},
|
|
230
|
+
queryParams: config.queryParams,
|
|
231
|
+
headers,
|
|
232
|
+
priority: 'normal',
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const adapterName$4 = 'getGisExternalAuthAccessToken';
|
|
237
|
+
const getGisExternalAuthAccessToken_ConfigPropertyMetadata = [
|
|
238
|
+
generateParamConfigMetadata('authSettingsId', true, 1 /* QueryParameter */, 0 /* String */),
|
|
239
|
+
];
|
|
240
|
+
const getGisExternalAuthAccessToken_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getGisExternalAuthAccessToken_ConfigPropertyMetadata);
|
|
241
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$5(getGisExternalAuthAccessToken_ConfigPropertyMetadata);
|
|
242
|
+
function keyBuilder$9(luvio, config) {
|
|
243
|
+
const resourceParams = createResourceParams$4(config);
|
|
244
|
+
return keyBuilder$a(luvio, resourceParams);
|
|
245
|
+
}
|
|
246
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
247
|
+
const config = {};
|
|
248
|
+
typeCheckConfig$5(untrustedConfig, config, getGisExternalAuthAccessToken_ConfigPropertyMetadata);
|
|
249
|
+
return config;
|
|
250
|
+
}
|
|
251
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
252
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
256
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
257
|
+
}
|
|
258
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
259
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
return config;
|
|
263
|
+
}
|
|
264
|
+
function adapterFragment$3(luvio, config) {
|
|
265
|
+
createResourceParams$4(config);
|
|
266
|
+
return select$a();
|
|
267
|
+
}
|
|
268
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
269
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
270
|
+
config,
|
|
271
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
272
|
+
});
|
|
273
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
274
|
+
}
|
|
275
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
276
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
277
|
+
config,
|
|
278
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
279
|
+
});
|
|
280
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
281
|
+
}
|
|
282
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
283
|
+
const resourceParams = createResourceParams$4(config);
|
|
284
|
+
const request = createResourceRequest$4(resourceParams);
|
|
285
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
286
|
+
.then((response) => {
|
|
287
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
288
|
+
const cache = new StoreKeyMap();
|
|
289
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
290
|
+
return cache;
|
|
291
|
+
});
|
|
292
|
+
}, (response) => {
|
|
293
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
297
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
|
|
298
|
+
}
|
|
299
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
300
|
+
const { luvio, config } = context;
|
|
301
|
+
const selector = {
|
|
302
|
+
recordId: keyBuilder$9(luvio, config),
|
|
303
|
+
node: adapterFragment$3(luvio, config),
|
|
304
|
+
variables: {},
|
|
305
|
+
};
|
|
306
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
307
|
+
config,
|
|
308
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
309
|
+
});
|
|
310
|
+
return cacheSnapshot;
|
|
311
|
+
}
|
|
312
|
+
const getGisExternalAuthAccessTokenAdapterFactory = (luvio) => function gis__getGisExternalAuthAccessToken(untrustedConfig, requestContext) {
|
|
313
|
+
const config = validateAdapterConfig$4(untrustedConfig, getGisExternalAuthAccessToken_ConfigPropertyNames);
|
|
314
|
+
// Invalid or incomplete config
|
|
315
|
+
if (config === null) {
|
|
316
|
+
return null;
|
|
317
|
+
}
|
|
318
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
319
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
const TTL$5 = 300;
|
|
323
|
+
const VERSION$5 = "0f69e4358dd6aed8111c869611c4526c";
|
|
324
|
+
function validate$5(obj, path = 'GisExternalAuthIdentityProviderOutputRepresentation') {
|
|
325
|
+
const v_error = (() => {
|
|
326
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
327
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
328
|
+
}
|
|
329
|
+
const obj_authType = obj.authType;
|
|
330
|
+
const path_authType = path + '.authType';
|
|
331
|
+
if (typeof obj_authType !== 'string') {
|
|
332
|
+
return new TypeError('Expected "string" but received "' + typeof obj_authType + '" (at "' + path_authType + '")');
|
|
333
|
+
}
|
|
334
|
+
const obj_baseUrl = obj.baseUrl;
|
|
335
|
+
const path_baseUrl = path + '.baseUrl';
|
|
336
|
+
if (typeof obj_baseUrl !== 'string') {
|
|
337
|
+
return new TypeError('Expected "string" but received "' + typeof obj_baseUrl + '" (at "' + path_baseUrl + '")');
|
|
338
|
+
}
|
|
339
|
+
const obj_clientId = obj.clientId;
|
|
340
|
+
const path_clientId = path + '.clientId';
|
|
341
|
+
if (typeof obj_clientId !== 'string') {
|
|
342
|
+
return new TypeError('Expected "string" but received "' + typeof obj_clientId + '" (at "' + path_clientId + '")');
|
|
343
|
+
}
|
|
344
|
+
const obj_fullName = obj.fullName;
|
|
345
|
+
const path_fullName = path + '.fullName';
|
|
346
|
+
if (typeof obj_fullName !== 'string') {
|
|
347
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fullName + '" (at "' + path_fullName + '")');
|
|
348
|
+
}
|
|
349
|
+
const obj_gisProvider = obj.gisProvider;
|
|
350
|
+
const path_gisProvider = path + '.gisProvider';
|
|
351
|
+
if (typeof obj_gisProvider !== 'string') {
|
|
352
|
+
return new TypeError('Expected "string" but received "' + typeof obj_gisProvider + '" (at "' + path_gisProvider + '")');
|
|
353
|
+
}
|
|
354
|
+
const obj_id = obj.id;
|
|
355
|
+
const path_id = path + '.id';
|
|
356
|
+
if (typeof obj_id !== 'string') {
|
|
357
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
358
|
+
}
|
|
359
|
+
const obj_label = obj.label;
|
|
360
|
+
const path_label = path + '.label';
|
|
361
|
+
if (typeof obj_label !== 'string') {
|
|
362
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
363
|
+
}
|
|
364
|
+
})();
|
|
365
|
+
return v_error === undefined ? null : v_error;
|
|
366
|
+
}
|
|
367
|
+
const RepresentationType$5 = 'GisExternalAuthIdentityProviderOutputRepresentation';
|
|
368
|
+
function keyBuilder$8(luvio, config) {
|
|
369
|
+
return keyPrefix + '::' + RepresentationType$5 + ':' + config.id;
|
|
370
|
+
}
|
|
371
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
372
|
+
const keyParams = {
|
|
373
|
+
id: object.id
|
|
374
|
+
};
|
|
375
|
+
return keyBuilder$8(luvio, keyParams);
|
|
376
|
+
}
|
|
377
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
378
|
+
return input;
|
|
379
|
+
}
|
|
380
|
+
const select$9 = function GisExternalAuthIdentityProviderOutputRepresentationSelect() {
|
|
381
|
+
return {
|
|
382
|
+
kind: 'Fragment',
|
|
383
|
+
version: VERSION$5,
|
|
384
|
+
private: [],
|
|
385
|
+
selections: [
|
|
386
|
+
{
|
|
387
|
+
name: 'authType',
|
|
388
|
+
kind: 'Scalar'
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
name: 'baseUrl',
|
|
392
|
+
kind: 'Scalar'
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
name: 'clientId',
|
|
396
|
+
kind: 'Scalar'
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: 'fullName',
|
|
400
|
+
kind: 'Scalar'
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: 'gisProvider',
|
|
404
|
+
kind: 'Scalar'
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: 'id',
|
|
408
|
+
kind: 'Scalar'
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
name: 'label',
|
|
412
|
+
kind: 'Scalar'
|
|
413
|
+
}
|
|
414
|
+
]
|
|
415
|
+
};
|
|
416
|
+
};
|
|
417
|
+
function equals$5(existing, incoming) {
|
|
418
|
+
const existing_authType = existing.authType;
|
|
419
|
+
const incoming_authType = incoming.authType;
|
|
420
|
+
if (!(existing_authType === incoming_authType)) {
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
const existing_baseUrl = existing.baseUrl;
|
|
424
|
+
const incoming_baseUrl = incoming.baseUrl;
|
|
425
|
+
if (!(existing_baseUrl === incoming_baseUrl)) {
|
|
426
|
+
return false;
|
|
427
|
+
}
|
|
428
|
+
const existing_clientId = existing.clientId;
|
|
429
|
+
const incoming_clientId = incoming.clientId;
|
|
430
|
+
if (!(existing_clientId === incoming_clientId)) {
|
|
431
|
+
return false;
|
|
432
|
+
}
|
|
433
|
+
const existing_fullName = existing.fullName;
|
|
434
|
+
const incoming_fullName = incoming.fullName;
|
|
435
|
+
if (!(existing_fullName === incoming_fullName)) {
|
|
436
|
+
return false;
|
|
437
|
+
}
|
|
438
|
+
const existing_gisProvider = existing.gisProvider;
|
|
439
|
+
const incoming_gisProvider = incoming.gisProvider;
|
|
440
|
+
if (!(existing_gisProvider === incoming_gisProvider)) {
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
const existing_id = existing.id;
|
|
444
|
+
const incoming_id = incoming.id;
|
|
445
|
+
if (!(existing_id === incoming_id)) {
|
|
446
|
+
return false;
|
|
447
|
+
}
|
|
448
|
+
const existing_label = existing.label;
|
|
449
|
+
const incoming_label = incoming.label;
|
|
450
|
+
if (!(existing_label === incoming_label)) {
|
|
451
|
+
return false;
|
|
452
|
+
}
|
|
453
|
+
return true;
|
|
454
|
+
}
|
|
455
|
+
const ingest$5 = function GisExternalAuthIdentityProviderOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
456
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
457
|
+
const validateError = validate$5(input);
|
|
458
|
+
if (validateError !== null) {
|
|
459
|
+
throw validateError;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
const key = keyBuilderFromType$2(luvio, input);
|
|
463
|
+
const ttlToUse = TTL$5;
|
|
464
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "gis", VERSION$5, RepresentationType$5, equals$5);
|
|
465
|
+
return createLink(key);
|
|
466
|
+
};
|
|
467
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
468
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
469
|
+
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
470
|
+
rootKeySet.set(rootKey, {
|
|
471
|
+
namespace: keyPrefix,
|
|
472
|
+
representationName: RepresentationType$5,
|
|
473
|
+
mergeable: false
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function select$8(luvio, params) {
|
|
478
|
+
return select$9();
|
|
479
|
+
}
|
|
480
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
481
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response);
|
|
482
|
+
}
|
|
483
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
484
|
+
const { body } = response;
|
|
485
|
+
const key = keyBuilderFromType$2(luvio, body);
|
|
486
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
487
|
+
const snapshot = luvio.storeLookup({
|
|
488
|
+
recordId: key,
|
|
489
|
+
node: select$8(),
|
|
490
|
+
variables: {},
|
|
491
|
+
});
|
|
492
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
493
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
494
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
deepFreeze(snapshot.data);
|
|
498
|
+
return snapshot;
|
|
499
|
+
}
|
|
500
|
+
function createResourceRequest$3(config) {
|
|
501
|
+
const headers = {};
|
|
502
|
+
return {
|
|
503
|
+
baseUri: '/services/data/v66.0',
|
|
504
|
+
basePath: '/gis/auth/GisExternalAuthIdentityProvider',
|
|
505
|
+
method: 'post',
|
|
506
|
+
body: config.body,
|
|
507
|
+
urlParams: {},
|
|
508
|
+
queryParams: {},
|
|
509
|
+
headers,
|
|
510
|
+
priority: 'normal',
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
const adapterName$3 = 'createGisExternalAuthIdentityProvider';
|
|
515
|
+
const createGisExternalAuthIdentityProvider_ConfigPropertyMetadata = [
|
|
516
|
+
generateParamConfigMetadata('authType', true, 2 /* Body */, 0 /* String */),
|
|
517
|
+
generateParamConfigMetadata('baseUrl', true, 2 /* Body */, 0 /* String */),
|
|
518
|
+
generateParamConfigMetadata('clientId', true, 2 /* Body */, 0 /* String */),
|
|
519
|
+
generateParamConfigMetadata('clientSecret', true, 2 /* Body */, 0 /* String */),
|
|
520
|
+
generateParamConfigMetadata('gisProvider', true, 2 /* Body */, 0 /* String */),
|
|
521
|
+
generateParamConfigMetadata('name', true, 2 /* Body */, 0 /* String */),
|
|
522
|
+
];
|
|
523
|
+
const createGisExternalAuthIdentityProvider_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createGisExternalAuthIdentityProvider_ConfigPropertyMetadata);
|
|
524
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$5(createGisExternalAuthIdentityProvider_ConfigPropertyMetadata);
|
|
525
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
526
|
+
const config = {};
|
|
527
|
+
typeCheckConfig$5(untrustedConfig, config, createGisExternalAuthIdentityProvider_ConfigPropertyMetadata);
|
|
528
|
+
return config;
|
|
529
|
+
}
|
|
530
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
531
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
532
|
+
return null;
|
|
533
|
+
}
|
|
534
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
535
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
536
|
+
}
|
|
537
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
538
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
539
|
+
return null;
|
|
540
|
+
}
|
|
541
|
+
return config;
|
|
542
|
+
}
|
|
543
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
544
|
+
const resourceParams = createResourceParams$3(config);
|
|
545
|
+
const request = createResourceRequest$3(resourceParams);
|
|
546
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
547
|
+
.then((response) => {
|
|
548
|
+
return luvio.handleSuccessResponse(() => {
|
|
549
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
550
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
551
|
+
}, () => {
|
|
552
|
+
const cache = new StoreKeyMap();
|
|
553
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
554
|
+
return cache;
|
|
555
|
+
});
|
|
556
|
+
}, (response) => {
|
|
557
|
+
deepFreeze(response);
|
|
558
|
+
throw response;
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
const createGisExternalAuthIdentityProviderAdapterFactory = (luvio) => {
|
|
562
|
+
return function createGisExternalAuthIdentityProvider(untrustedConfig) {
|
|
563
|
+
const config = validateAdapterConfig$3(untrustedConfig, createGisExternalAuthIdentityProvider_ConfigPropertyNames);
|
|
564
|
+
// Invalid or incomplete config
|
|
565
|
+
if (config === null) {
|
|
566
|
+
throw new Error('Invalid config for "createGisExternalAuthIdentityProvider"');
|
|
567
|
+
}
|
|
568
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
569
|
+
};
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
const TTL$4 = 300;
|
|
573
|
+
const VERSION$4 = "a7ac614251e70adfb9330b0fcdbfcbf2";
|
|
574
|
+
function validate$4(obj, path = 'GisExternalAuthIdentityProviderCollectionRepresentation') {
|
|
575
|
+
const v_error = (() => {
|
|
576
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
577
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
578
|
+
}
|
|
579
|
+
const obj_count = obj.count;
|
|
580
|
+
const path_count = path + '.count';
|
|
581
|
+
if (typeof obj_count !== 'number' || (typeof obj_count === 'number' && Math.floor(obj_count) !== obj_count)) {
|
|
582
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_count + '" (at "' + path_count + '")');
|
|
583
|
+
}
|
|
584
|
+
const obj_gisExternalAuthIdentityProviderOutputRepresentation = obj.gisExternalAuthIdentityProviderOutputRepresentation;
|
|
585
|
+
const path_gisExternalAuthIdentityProviderOutputRepresentation = path + '.gisExternalAuthIdentityProviderOutputRepresentation';
|
|
586
|
+
if (!ArrayIsArray(obj_gisExternalAuthIdentityProviderOutputRepresentation)) {
|
|
587
|
+
return new TypeError('Expected "array" but received "' + typeof obj_gisExternalAuthIdentityProviderOutputRepresentation + '" (at "' + path_gisExternalAuthIdentityProviderOutputRepresentation + '")');
|
|
588
|
+
}
|
|
589
|
+
for (let i = 0; i < obj_gisExternalAuthIdentityProviderOutputRepresentation.length; i++) {
|
|
590
|
+
const obj_gisExternalAuthIdentityProviderOutputRepresentation_item = obj_gisExternalAuthIdentityProviderOutputRepresentation[i];
|
|
591
|
+
const path_gisExternalAuthIdentityProviderOutputRepresentation_item = path_gisExternalAuthIdentityProviderOutputRepresentation + '[' + i + ']';
|
|
592
|
+
if (typeof obj_gisExternalAuthIdentityProviderOutputRepresentation_item !== 'object' || Array.isArray(obj_gisExternalAuthIdentityProviderOutputRepresentation_item)) {
|
|
593
|
+
return new TypeError('Expected "object" but received "' + typeof obj_gisExternalAuthIdentityProviderOutputRepresentation_item + '" (at "' + path_gisExternalAuthIdentityProviderOutputRepresentation_item + '")');
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
})();
|
|
597
|
+
return v_error === undefined ? null : v_error;
|
|
598
|
+
}
|
|
599
|
+
const RepresentationType$4 = 'GisExternalAuthIdentityProviderCollectionRepresentation';
|
|
600
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
601
|
+
const input_gisExternalAuthIdentityProviderOutputRepresentation = input.gisExternalAuthIdentityProviderOutputRepresentation;
|
|
602
|
+
const input_gisExternalAuthIdentityProviderOutputRepresentation_id = path.fullPath + '__gisExternalAuthIdentityProviderOutputRepresentation';
|
|
603
|
+
for (let i = 0; i < input_gisExternalAuthIdentityProviderOutputRepresentation.length; i++) {
|
|
604
|
+
const input_gisExternalAuthIdentityProviderOutputRepresentation_item = input_gisExternalAuthIdentityProviderOutputRepresentation[i];
|
|
605
|
+
let input_gisExternalAuthIdentityProviderOutputRepresentation_item_id = input_gisExternalAuthIdentityProviderOutputRepresentation_id + '__' + i;
|
|
606
|
+
input_gisExternalAuthIdentityProviderOutputRepresentation[i] = ingest$5(input_gisExternalAuthIdentityProviderOutputRepresentation_item, {
|
|
607
|
+
fullPath: input_gisExternalAuthIdentityProviderOutputRepresentation_item_id,
|
|
608
|
+
propertyName: i,
|
|
609
|
+
parent: {
|
|
610
|
+
data: input,
|
|
611
|
+
key: path.fullPath,
|
|
612
|
+
existing: existing,
|
|
613
|
+
},
|
|
614
|
+
ttl: path.ttl
|
|
615
|
+
}, luvio, store, timestamp);
|
|
616
|
+
}
|
|
617
|
+
return input;
|
|
618
|
+
}
|
|
619
|
+
const select$7 = function GisExternalAuthIdentityProviderCollectionRepresentationSelect() {
|
|
620
|
+
return {
|
|
621
|
+
kind: 'Fragment',
|
|
622
|
+
version: VERSION$4,
|
|
623
|
+
private: [],
|
|
624
|
+
selections: [
|
|
625
|
+
{
|
|
626
|
+
name: 'count',
|
|
627
|
+
kind: 'Scalar'
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
name: 'gisExternalAuthIdentityProviderOutputRepresentation',
|
|
631
|
+
kind: 'Link',
|
|
632
|
+
plural: true,
|
|
633
|
+
fragment: select$9()
|
|
634
|
+
}
|
|
635
|
+
]
|
|
636
|
+
};
|
|
637
|
+
};
|
|
638
|
+
function equals$4(existing, incoming) {
|
|
639
|
+
const existing_count = existing.count;
|
|
640
|
+
const incoming_count = incoming.count;
|
|
641
|
+
if (!(existing_count === incoming_count)) {
|
|
642
|
+
return false;
|
|
643
|
+
}
|
|
644
|
+
const existing_gisExternalAuthIdentityProviderOutputRepresentation = existing.gisExternalAuthIdentityProviderOutputRepresentation;
|
|
645
|
+
const incoming_gisExternalAuthIdentityProviderOutputRepresentation = incoming.gisExternalAuthIdentityProviderOutputRepresentation;
|
|
646
|
+
const equals_gisExternalAuthIdentityProviderOutputRepresentation_items = equalsArray(existing_gisExternalAuthIdentityProviderOutputRepresentation, incoming_gisExternalAuthIdentityProviderOutputRepresentation, (existing_gisExternalAuthIdentityProviderOutputRepresentation_item, incoming_gisExternalAuthIdentityProviderOutputRepresentation_item) => {
|
|
647
|
+
if (!(existing_gisExternalAuthIdentityProviderOutputRepresentation_item.__ref === incoming_gisExternalAuthIdentityProviderOutputRepresentation_item.__ref)) {
|
|
648
|
+
return false;
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
if (equals_gisExternalAuthIdentityProviderOutputRepresentation_items === false) {
|
|
652
|
+
return false;
|
|
653
|
+
}
|
|
654
|
+
return true;
|
|
655
|
+
}
|
|
656
|
+
const ingest$4 = function GisExternalAuthIdentityProviderCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
657
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
658
|
+
const validateError = validate$4(input);
|
|
659
|
+
if (validateError !== null) {
|
|
660
|
+
throw validateError;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
const key = path.fullPath;
|
|
664
|
+
const ttlToUse = TTL$4;
|
|
665
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "gis", VERSION$4, RepresentationType$4, equals$4);
|
|
666
|
+
return createLink(key);
|
|
667
|
+
};
|
|
668
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
669
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
670
|
+
const rootKey = fullPathFactory();
|
|
671
|
+
rootKeySet.set(rootKey, {
|
|
672
|
+
namespace: keyPrefix,
|
|
673
|
+
representationName: RepresentationType$4,
|
|
674
|
+
mergeable: false
|
|
675
|
+
});
|
|
676
|
+
const input_gisExternalAuthIdentityProviderOutputRepresentation_length = input.gisExternalAuthIdentityProviderOutputRepresentation.length;
|
|
677
|
+
for (let i = 0; i < input_gisExternalAuthIdentityProviderOutputRepresentation_length; i++) {
|
|
678
|
+
getTypeCacheKeys$5(rootKeySet, luvio, input.gisExternalAuthIdentityProviderOutputRepresentation[i]);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
function select$6(luvio, params) {
|
|
683
|
+
return select$7();
|
|
684
|
+
}
|
|
685
|
+
function keyBuilder$7(luvio, params) {
|
|
686
|
+
return keyPrefix + '::GisExternalAuthIdentityProviderCollectionRepresentation:(' + 'limitByProfile:' + params.queryParams.limitByProfile + ')';
|
|
687
|
+
}
|
|
688
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
689
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$7(luvio, resourceParams));
|
|
690
|
+
}
|
|
691
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
692
|
+
const { body } = response;
|
|
693
|
+
const key = keyBuilder$7(luvio, resourceParams);
|
|
694
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
695
|
+
const snapshot = luvio.storeLookup({
|
|
696
|
+
recordId: key,
|
|
697
|
+
node: select$6(),
|
|
698
|
+
variables: {},
|
|
699
|
+
}, snapshotRefresh);
|
|
700
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
701
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
702
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
deepFreeze(snapshot.data);
|
|
706
|
+
return snapshot;
|
|
707
|
+
}
|
|
708
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
709
|
+
const key = keyBuilder$7(luvio, params);
|
|
710
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
711
|
+
const storeMetadataParams = {
|
|
712
|
+
ttl: TTL$4,
|
|
713
|
+
namespace: keyPrefix,
|
|
714
|
+
version: VERSION$4,
|
|
715
|
+
representationName: RepresentationType$4
|
|
716
|
+
};
|
|
717
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
718
|
+
return errorSnapshot;
|
|
719
|
+
}
|
|
720
|
+
function createResourceRequest$2(config) {
|
|
721
|
+
const headers = {};
|
|
722
|
+
return {
|
|
723
|
+
baseUri: '/services/data/v66.0',
|
|
724
|
+
basePath: '/gis/auth/GisExternalAuthIdentityProviders',
|
|
725
|
+
method: 'get',
|
|
726
|
+
body: null,
|
|
727
|
+
urlParams: {},
|
|
728
|
+
queryParams: config.queryParams,
|
|
729
|
+
headers,
|
|
730
|
+
priority: 'normal',
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
const adapterName$2 = 'getGisExternalAuthIdentityProviders';
|
|
735
|
+
const getGisExternalAuthIdentityProviders_ConfigPropertyMetadata = [
|
|
736
|
+
generateParamConfigMetadata('limitByProfile', true, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
737
|
+
];
|
|
738
|
+
const getGisExternalAuthIdentityProviders_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getGisExternalAuthIdentityProviders_ConfigPropertyMetadata);
|
|
739
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$5(getGisExternalAuthIdentityProviders_ConfigPropertyMetadata);
|
|
740
|
+
function keyBuilder$6(luvio, config) {
|
|
741
|
+
const resourceParams = createResourceParams$2(config);
|
|
742
|
+
return keyBuilder$7(luvio, resourceParams);
|
|
743
|
+
}
|
|
744
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
745
|
+
const config = {};
|
|
746
|
+
typeCheckConfig$5(untrustedConfig, config, getGisExternalAuthIdentityProviders_ConfigPropertyMetadata);
|
|
747
|
+
return config;
|
|
748
|
+
}
|
|
749
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
750
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
751
|
+
return null;
|
|
752
|
+
}
|
|
753
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
754
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
755
|
+
}
|
|
756
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
757
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
758
|
+
return null;
|
|
759
|
+
}
|
|
760
|
+
return config;
|
|
761
|
+
}
|
|
762
|
+
function adapterFragment$2(luvio, config) {
|
|
763
|
+
createResourceParams$2(config);
|
|
764
|
+
return select$6();
|
|
765
|
+
}
|
|
766
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
767
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
768
|
+
config,
|
|
769
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
770
|
+
});
|
|
771
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
772
|
+
}
|
|
773
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
774
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
775
|
+
config,
|
|
776
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
777
|
+
});
|
|
778
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
779
|
+
}
|
|
780
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
781
|
+
const resourceParams = createResourceParams$2(config);
|
|
782
|
+
const request = createResourceRequest$2(resourceParams);
|
|
783
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
784
|
+
.then((response) => {
|
|
785
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
786
|
+
const cache = new StoreKeyMap();
|
|
787
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
788
|
+
return cache;
|
|
789
|
+
});
|
|
790
|
+
}, (response) => {
|
|
791
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
795
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
796
|
+
}
|
|
797
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
798
|
+
const { luvio, config } = context;
|
|
799
|
+
const selector = {
|
|
800
|
+
recordId: keyBuilder$6(luvio, config),
|
|
801
|
+
node: adapterFragment$2(luvio, config),
|
|
802
|
+
variables: {},
|
|
803
|
+
};
|
|
804
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
805
|
+
config,
|
|
806
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
807
|
+
});
|
|
808
|
+
return cacheSnapshot;
|
|
809
|
+
}
|
|
810
|
+
const getGisExternalAuthIdentityProvidersAdapterFactory = (luvio) => function gis__getGisExternalAuthIdentityProviders(untrustedConfig, requestContext) {
|
|
811
|
+
const config = validateAdapterConfig$2(untrustedConfig, getGisExternalAuthIdentityProviders_ConfigPropertyNames);
|
|
812
|
+
// Invalid or incomplete config
|
|
813
|
+
if (config === null) {
|
|
814
|
+
return null;
|
|
815
|
+
}
|
|
816
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
817
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
const TTL$3 = 300;
|
|
821
|
+
const VERSION$3 = "d1f7afbf8cf734038f702e4ff23870c9";
|
|
822
|
+
function validate$3(obj, path = 'GisExtlMapObjectConfigOutputRepresentation') {
|
|
823
|
+
const v_error = (() => {
|
|
824
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
825
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
826
|
+
}
|
|
827
|
+
const obj_defaultMapId = obj.defaultMapId;
|
|
828
|
+
const path_defaultMapId = path + '.defaultMapId';
|
|
829
|
+
if (typeof obj_defaultMapId !== 'string') {
|
|
830
|
+
return new TypeError('Expected "string" but received "' + typeof obj_defaultMapId + '" (at "' + path_defaultMapId + '")');
|
|
831
|
+
}
|
|
832
|
+
const obj_id = obj.id;
|
|
833
|
+
const path_id = path + '.id';
|
|
834
|
+
if (typeof obj_id !== 'string') {
|
|
835
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
836
|
+
}
|
|
837
|
+
const obj_mapIdFieldName = obj.mapIdFieldName;
|
|
838
|
+
const path_mapIdFieldName = path + '.mapIdFieldName';
|
|
839
|
+
let obj_mapIdFieldName_union0 = null;
|
|
840
|
+
const obj_mapIdFieldName_union0_error = (() => {
|
|
841
|
+
if (typeof obj_mapIdFieldName !== 'string') {
|
|
842
|
+
return new TypeError('Expected "string" but received "' + typeof obj_mapIdFieldName + '" (at "' + path_mapIdFieldName + '")');
|
|
843
|
+
}
|
|
844
|
+
})();
|
|
845
|
+
if (obj_mapIdFieldName_union0_error != null) {
|
|
846
|
+
obj_mapIdFieldName_union0 = obj_mapIdFieldName_union0_error.message;
|
|
847
|
+
}
|
|
848
|
+
let obj_mapIdFieldName_union1 = null;
|
|
849
|
+
const obj_mapIdFieldName_union1_error = (() => {
|
|
850
|
+
if (obj_mapIdFieldName !== null) {
|
|
851
|
+
return new TypeError('Expected "null" but received "' + typeof obj_mapIdFieldName + '" (at "' + path_mapIdFieldName + '")');
|
|
852
|
+
}
|
|
853
|
+
})();
|
|
854
|
+
if (obj_mapIdFieldName_union1_error != null) {
|
|
855
|
+
obj_mapIdFieldName_union1 = obj_mapIdFieldName_union1_error.message;
|
|
856
|
+
}
|
|
857
|
+
if (obj_mapIdFieldName_union0 && obj_mapIdFieldName_union1) {
|
|
858
|
+
let message = 'Object doesn\'t match union (at "' + path_mapIdFieldName + '")';
|
|
859
|
+
message += '\n' + obj_mapIdFieldName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
860
|
+
message += '\n' + obj_mapIdFieldName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
861
|
+
return new TypeError(message);
|
|
862
|
+
}
|
|
863
|
+
const obj_objectName = obj.objectName;
|
|
864
|
+
const path_objectName = path + '.objectName';
|
|
865
|
+
if (typeof obj_objectName !== 'string') {
|
|
866
|
+
return new TypeError('Expected "string" but received "' + typeof obj_objectName + '" (at "' + path_objectName + '")');
|
|
867
|
+
}
|
|
868
|
+
const obj_recordType = obj.recordType;
|
|
869
|
+
const path_recordType = path + '.recordType';
|
|
870
|
+
let obj_recordType_union0 = null;
|
|
871
|
+
const obj_recordType_union0_error = (() => {
|
|
872
|
+
if (typeof obj_recordType !== 'string') {
|
|
873
|
+
return new TypeError('Expected "string" but received "' + typeof obj_recordType + '" (at "' + path_recordType + '")');
|
|
874
|
+
}
|
|
875
|
+
})();
|
|
876
|
+
if (obj_recordType_union0_error != null) {
|
|
877
|
+
obj_recordType_union0 = obj_recordType_union0_error.message;
|
|
878
|
+
}
|
|
879
|
+
let obj_recordType_union1 = null;
|
|
880
|
+
const obj_recordType_union1_error = (() => {
|
|
881
|
+
if (obj_recordType !== null) {
|
|
882
|
+
return new TypeError('Expected "null" but received "' + typeof obj_recordType + '" (at "' + path_recordType + '")');
|
|
883
|
+
}
|
|
884
|
+
})();
|
|
885
|
+
if (obj_recordType_union1_error != null) {
|
|
886
|
+
obj_recordType_union1 = obj_recordType_union1_error.message;
|
|
887
|
+
}
|
|
888
|
+
if (obj_recordType_union0 && obj_recordType_union1) {
|
|
889
|
+
let message = 'Object doesn\'t match union (at "' + path_recordType + '")';
|
|
890
|
+
message += '\n' + obj_recordType_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
891
|
+
message += '\n' + obj_recordType_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
892
|
+
return new TypeError(message);
|
|
893
|
+
}
|
|
894
|
+
})();
|
|
895
|
+
return v_error === undefined ? null : v_error;
|
|
896
|
+
}
|
|
897
|
+
const RepresentationType$3 = 'GisExtlMapObjectConfigOutputRepresentation';
|
|
898
|
+
function keyBuilder$5(luvio, config) {
|
|
899
|
+
return keyPrefix + '::' + RepresentationType$3 + ':' + config.id;
|
|
900
|
+
}
|
|
901
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
902
|
+
const keyParams = {
|
|
903
|
+
id: object.id
|
|
904
|
+
};
|
|
905
|
+
return keyBuilder$5(luvio, keyParams);
|
|
906
|
+
}
|
|
907
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
908
|
+
return input;
|
|
909
|
+
}
|
|
910
|
+
const select$5 = function GisExtlMapObjectConfigOutputRepresentationSelect() {
|
|
911
|
+
return {
|
|
912
|
+
kind: 'Fragment',
|
|
913
|
+
version: VERSION$3,
|
|
914
|
+
private: [],
|
|
915
|
+
selections: [
|
|
916
|
+
{
|
|
917
|
+
name: 'defaultMapId',
|
|
918
|
+
kind: 'Scalar'
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
name: 'id',
|
|
922
|
+
kind: 'Scalar'
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
name: 'mapIdFieldName',
|
|
926
|
+
kind: 'Scalar'
|
|
927
|
+
},
|
|
928
|
+
{
|
|
929
|
+
name: 'objectName',
|
|
930
|
+
kind: 'Scalar'
|
|
931
|
+
},
|
|
932
|
+
{
|
|
933
|
+
name: 'recordType',
|
|
934
|
+
kind: 'Scalar'
|
|
935
|
+
}
|
|
936
|
+
]
|
|
937
|
+
};
|
|
938
|
+
};
|
|
939
|
+
function equals$3(existing, incoming) {
|
|
940
|
+
const existing_defaultMapId = existing.defaultMapId;
|
|
941
|
+
const incoming_defaultMapId = incoming.defaultMapId;
|
|
942
|
+
if (!(existing_defaultMapId === incoming_defaultMapId)) {
|
|
943
|
+
return false;
|
|
944
|
+
}
|
|
945
|
+
const existing_id = existing.id;
|
|
946
|
+
const incoming_id = incoming.id;
|
|
947
|
+
if (!(existing_id === incoming_id)) {
|
|
948
|
+
return false;
|
|
949
|
+
}
|
|
950
|
+
const existing_objectName = existing.objectName;
|
|
951
|
+
const incoming_objectName = incoming.objectName;
|
|
952
|
+
if (!(existing_objectName === incoming_objectName)) {
|
|
953
|
+
return false;
|
|
954
|
+
}
|
|
955
|
+
const existing_mapIdFieldName = existing.mapIdFieldName;
|
|
956
|
+
const incoming_mapIdFieldName = incoming.mapIdFieldName;
|
|
957
|
+
if (!(existing_mapIdFieldName === incoming_mapIdFieldName)) {
|
|
958
|
+
return false;
|
|
959
|
+
}
|
|
960
|
+
const existing_recordType = existing.recordType;
|
|
961
|
+
const incoming_recordType = incoming.recordType;
|
|
962
|
+
if (!(existing_recordType === incoming_recordType)) {
|
|
963
|
+
return false;
|
|
964
|
+
}
|
|
965
|
+
return true;
|
|
966
|
+
}
|
|
967
|
+
const ingest$3 = function GisExtlMapObjectConfigOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
968
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
969
|
+
const validateError = validate$3(input);
|
|
970
|
+
if (validateError !== null) {
|
|
971
|
+
throw validateError;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
975
|
+
const ttlToUse = TTL$3;
|
|
976
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "gis", VERSION$3, RepresentationType$3, equals$3);
|
|
977
|
+
return createLink(key);
|
|
978
|
+
};
|
|
979
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
980
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
981
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
982
|
+
rootKeySet.set(rootKey, {
|
|
983
|
+
namespace: keyPrefix,
|
|
984
|
+
representationName: RepresentationType$3,
|
|
985
|
+
mergeable: false
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
const TTL$2 = 300;
|
|
990
|
+
const VERSION$2 = "9cba8584dbb15a650cd322528530d375";
|
|
991
|
+
function validate$2(obj, path = 'GisExtlMapObjectConfigCollectionRepresentation') {
|
|
992
|
+
const v_error = (() => {
|
|
993
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
994
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
995
|
+
}
|
|
996
|
+
const obj_count = obj.count;
|
|
997
|
+
const path_count = path + '.count';
|
|
998
|
+
if (typeof obj_count !== 'number' || (typeof obj_count === 'number' && Math.floor(obj_count) !== obj_count)) {
|
|
999
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_count + '" (at "' + path_count + '")');
|
|
1000
|
+
}
|
|
1001
|
+
const obj_gisExtlMapObjectConfigs = obj.gisExtlMapObjectConfigs;
|
|
1002
|
+
const path_gisExtlMapObjectConfigs = path + '.gisExtlMapObjectConfigs';
|
|
1003
|
+
if (!ArrayIsArray(obj_gisExtlMapObjectConfigs)) {
|
|
1004
|
+
return new TypeError('Expected "array" but received "' + typeof obj_gisExtlMapObjectConfigs + '" (at "' + path_gisExtlMapObjectConfigs + '")');
|
|
1005
|
+
}
|
|
1006
|
+
for (let i = 0; i < obj_gisExtlMapObjectConfigs.length; i++) {
|
|
1007
|
+
const obj_gisExtlMapObjectConfigs_item = obj_gisExtlMapObjectConfigs[i];
|
|
1008
|
+
const path_gisExtlMapObjectConfigs_item = path_gisExtlMapObjectConfigs + '[' + i + ']';
|
|
1009
|
+
if (typeof obj_gisExtlMapObjectConfigs_item !== 'object' || Array.isArray(obj_gisExtlMapObjectConfigs_item)) {
|
|
1010
|
+
return new TypeError('Expected "object" but received "' + typeof obj_gisExtlMapObjectConfigs_item + '" (at "' + path_gisExtlMapObjectConfigs_item + '")');
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
})();
|
|
1014
|
+
return v_error === undefined ? null : v_error;
|
|
1015
|
+
}
|
|
1016
|
+
const RepresentationType$2 = 'GisExtlMapObjectConfigCollectionRepresentation';
|
|
1017
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
1018
|
+
const input_gisExtlMapObjectConfigs = input.gisExtlMapObjectConfigs;
|
|
1019
|
+
const input_gisExtlMapObjectConfigs_id = path.fullPath + '__gisExtlMapObjectConfigs';
|
|
1020
|
+
for (let i = 0; i < input_gisExtlMapObjectConfigs.length; i++) {
|
|
1021
|
+
const input_gisExtlMapObjectConfigs_item = input_gisExtlMapObjectConfigs[i];
|
|
1022
|
+
let input_gisExtlMapObjectConfigs_item_id = input_gisExtlMapObjectConfigs_id + '__' + i;
|
|
1023
|
+
input_gisExtlMapObjectConfigs[i] = ingest$3(input_gisExtlMapObjectConfigs_item, {
|
|
1024
|
+
fullPath: input_gisExtlMapObjectConfigs_item_id,
|
|
1025
|
+
propertyName: i,
|
|
1026
|
+
parent: {
|
|
1027
|
+
data: input,
|
|
1028
|
+
key: path.fullPath,
|
|
1029
|
+
existing: existing,
|
|
1030
|
+
},
|
|
1031
|
+
ttl: path.ttl
|
|
1032
|
+
}, luvio, store, timestamp);
|
|
1033
|
+
}
|
|
1034
|
+
return input;
|
|
1035
|
+
}
|
|
1036
|
+
const select$4 = function GisExtlMapObjectConfigCollectionRepresentationSelect() {
|
|
1037
|
+
return {
|
|
1038
|
+
kind: 'Fragment',
|
|
1039
|
+
version: VERSION$2,
|
|
1040
|
+
private: [],
|
|
1041
|
+
selections: [
|
|
1042
|
+
{
|
|
1043
|
+
name: 'count',
|
|
1044
|
+
kind: 'Scalar'
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
name: 'gisExtlMapObjectConfigs',
|
|
1048
|
+
kind: 'Link',
|
|
1049
|
+
plural: true,
|
|
1050
|
+
fragment: select$5()
|
|
1051
|
+
}
|
|
1052
|
+
]
|
|
1053
|
+
};
|
|
1054
|
+
};
|
|
1055
|
+
function equals$2(existing, incoming) {
|
|
1056
|
+
const existing_count = existing.count;
|
|
1057
|
+
const incoming_count = incoming.count;
|
|
1058
|
+
if (!(existing_count === incoming_count)) {
|
|
1059
|
+
return false;
|
|
1060
|
+
}
|
|
1061
|
+
const existing_gisExtlMapObjectConfigs = existing.gisExtlMapObjectConfigs;
|
|
1062
|
+
const incoming_gisExtlMapObjectConfigs = incoming.gisExtlMapObjectConfigs;
|
|
1063
|
+
const equals_gisExtlMapObjectConfigs_items = equalsArray(existing_gisExtlMapObjectConfigs, incoming_gisExtlMapObjectConfigs, (existing_gisExtlMapObjectConfigs_item, incoming_gisExtlMapObjectConfigs_item) => {
|
|
1064
|
+
if (!(existing_gisExtlMapObjectConfigs_item.__ref === incoming_gisExtlMapObjectConfigs_item.__ref)) {
|
|
1065
|
+
return false;
|
|
1066
|
+
}
|
|
1067
|
+
});
|
|
1068
|
+
if (equals_gisExtlMapObjectConfigs_items === false) {
|
|
1069
|
+
return false;
|
|
1070
|
+
}
|
|
1071
|
+
return true;
|
|
1072
|
+
}
|
|
1073
|
+
const ingest$2 = function GisExtlMapObjectConfigCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1074
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1075
|
+
const validateError = validate$2(input);
|
|
1076
|
+
if (validateError !== null) {
|
|
1077
|
+
throw validateError;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
const key = path.fullPath;
|
|
1081
|
+
const ttlToUse = TTL$2;
|
|
1082
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "gis", VERSION$2, RepresentationType$2, equals$2);
|
|
1083
|
+
return createLink(key);
|
|
1084
|
+
};
|
|
1085
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
1086
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1087
|
+
const rootKey = fullPathFactory();
|
|
1088
|
+
rootKeySet.set(rootKey, {
|
|
1089
|
+
namespace: keyPrefix,
|
|
1090
|
+
representationName: RepresentationType$2,
|
|
1091
|
+
mergeable: false
|
|
1092
|
+
});
|
|
1093
|
+
const input_gisExtlMapObjectConfigs_length = input.gisExtlMapObjectConfigs.length;
|
|
1094
|
+
for (let i = 0; i < input_gisExtlMapObjectConfigs_length; i++) {
|
|
1095
|
+
getTypeCacheKeys$3(rootKeySet, luvio, input.gisExtlMapObjectConfigs[i]);
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
function select$3(luvio, params) {
|
|
1100
|
+
return select$4();
|
|
1101
|
+
}
|
|
1102
|
+
function keyBuilder$4(luvio, params) {
|
|
1103
|
+
return keyPrefix + '::GisExtlMapObjectConfigCollectionRepresentation:(' + 'id:' + params.queryParams.id + ',' + 'objectName:' + params.queryParams.objectName + ')';
|
|
1104
|
+
}
|
|
1105
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
1106
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
|
|
1107
|
+
}
|
|
1108
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
1109
|
+
const { body } = response;
|
|
1110
|
+
const key = keyBuilder$4(luvio, resourceParams);
|
|
1111
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
1112
|
+
const snapshot = luvio.storeLookup({
|
|
1113
|
+
recordId: key,
|
|
1114
|
+
node: select$3(),
|
|
1115
|
+
variables: {},
|
|
1116
|
+
}, snapshotRefresh);
|
|
1117
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1118
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1119
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
deepFreeze(snapshot.data);
|
|
1123
|
+
return snapshot;
|
|
1124
|
+
}
|
|
1125
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
1126
|
+
const key = keyBuilder$4(luvio, params);
|
|
1127
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1128
|
+
const storeMetadataParams = {
|
|
1129
|
+
ttl: TTL$2,
|
|
1130
|
+
namespace: keyPrefix,
|
|
1131
|
+
version: VERSION$2,
|
|
1132
|
+
representationName: RepresentationType$2
|
|
1133
|
+
};
|
|
1134
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1135
|
+
return errorSnapshot;
|
|
1136
|
+
}
|
|
1137
|
+
function createResourceRequest$1(config) {
|
|
1138
|
+
const headers = {};
|
|
1139
|
+
return {
|
|
1140
|
+
baseUri: '/services/data/v66.0',
|
|
1141
|
+
basePath: '/gis/config/GisExtlMapObjectConfig',
|
|
1142
|
+
method: 'get',
|
|
1143
|
+
body: null,
|
|
1144
|
+
urlParams: {},
|
|
1145
|
+
queryParams: config.queryParams,
|
|
1146
|
+
headers,
|
|
1147
|
+
priority: 'normal',
|
|
1148
|
+
};
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
const adapterName$1 = 'getGisExtlMapObjectConfig';
|
|
1152
|
+
const getGisExtlMapObjectConfig_ConfigPropertyMetadata = [
|
|
1153
|
+
generateParamConfigMetadata('id', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1154
|
+
generateParamConfigMetadata('objectName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1155
|
+
];
|
|
1156
|
+
const getGisExtlMapObjectConfig_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getGisExtlMapObjectConfig_ConfigPropertyMetadata);
|
|
1157
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$5(getGisExtlMapObjectConfig_ConfigPropertyMetadata);
|
|
1158
|
+
function keyBuilder$3(luvio, config) {
|
|
1159
|
+
const resourceParams = createResourceParams$1(config);
|
|
1160
|
+
return keyBuilder$4(luvio, resourceParams);
|
|
1161
|
+
}
|
|
1162
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
1163
|
+
const config = {};
|
|
1164
|
+
typeCheckConfig$5(untrustedConfig, config, getGisExtlMapObjectConfig_ConfigPropertyMetadata);
|
|
1165
|
+
return config;
|
|
1166
|
+
}
|
|
1167
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1168
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1169
|
+
return null;
|
|
1170
|
+
}
|
|
1171
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1172
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1173
|
+
}
|
|
1174
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
1175
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1176
|
+
return null;
|
|
1177
|
+
}
|
|
1178
|
+
return config;
|
|
1179
|
+
}
|
|
1180
|
+
function adapterFragment$1(luvio, config) {
|
|
1181
|
+
createResourceParams$1(config);
|
|
1182
|
+
return select$3();
|
|
1183
|
+
}
|
|
1184
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
1185
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
1186
|
+
config,
|
|
1187
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1188
|
+
});
|
|
1189
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1190
|
+
}
|
|
1191
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
1192
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
1193
|
+
config,
|
|
1194
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1195
|
+
});
|
|
1196
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1197
|
+
}
|
|
1198
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1199
|
+
const resourceParams = createResourceParams$1(config);
|
|
1200
|
+
const request = createResourceRequest$1(resourceParams);
|
|
1201
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1202
|
+
.then((response) => {
|
|
1203
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
1204
|
+
const cache = new StoreKeyMap();
|
|
1205
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
1206
|
+
return cache;
|
|
1207
|
+
});
|
|
1208
|
+
}, (response) => {
|
|
1209
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
1213
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
1214
|
+
}
|
|
1215
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
1216
|
+
const { luvio, config } = context;
|
|
1217
|
+
const selector = {
|
|
1218
|
+
recordId: keyBuilder$3(luvio, config),
|
|
1219
|
+
node: adapterFragment$1(luvio, config),
|
|
1220
|
+
variables: {},
|
|
1221
|
+
};
|
|
1222
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1223
|
+
config,
|
|
1224
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1225
|
+
});
|
|
1226
|
+
return cacheSnapshot;
|
|
1227
|
+
}
|
|
1228
|
+
const getGisExtlMapObjectConfigAdapterFactory = (luvio) => function gis__getGisExtlMapObjectConfig(untrustedConfig, requestContext) {
|
|
1229
|
+
const config = validateAdapterConfig$1(untrustedConfig, getGisExtlMapObjectConfig_ConfigPropertyNames);
|
|
1230
|
+
// Invalid or incomplete config
|
|
1231
|
+
if (config === null) {
|
|
1232
|
+
return null;
|
|
1233
|
+
}
|
|
1234
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1235
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1236
|
+
};
|
|
1237
|
+
|
|
1238
|
+
const TTL$1 = 300;
|
|
1239
|
+
const VERSION$1 = "4364518b3ecb57ed83bbbb4fd5adbe6a";
|
|
1240
|
+
function validate$1(obj, path = 'GisRelatedObjectConfigOutputRepresentation') {
|
|
1241
|
+
const v_error = (() => {
|
|
1242
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1243
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1244
|
+
}
|
|
1245
|
+
const obj_defaultColor = obj.defaultColor;
|
|
1246
|
+
const path_defaultColor = path + '.defaultColor';
|
|
1247
|
+
if (typeof obj_defaultColor !== 'string') {
|
|
1248
|
+
return new TypeError('Expected "string" but received "' + typeof obj_defaultColor + '" (at "' + path_defaultColor + '")');
|
|
1249
|
+
}
|
|
1250
|
+
const obj_defaultIcon = obj.defaultIcon;
|
|
1251
|
+
const path_defaultIcon = path + '.defaultIcon';
|
|
1252
|
+
if (typeof obj_defaultIcon !== 'string') {
|
|
1253
|
+
return new TypeError('Expected "string" but received "' + typeof obj_defaultIcon + '" (at "' + path_defaultIcon + '")');
|
|
1254
|
+
}
|
|
1255
|
+
const obj_fieldName = obj.fieldName;
|
|
1256
|
+
const path_fieldName = path + '.fieldName';
|
|
1257
|
+
if (typeof obj_fieldName !== 'string') {
|
|
1258
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
|
|
1259
|
+
}
|
|
1260
|
+
const obj_fieldType = obj.fieldType;
|
|
1261
|
+
const path_fieldType = path + '.fieldType';
|
|
1262
|
+
if (typeof obj_fieldType !== 'string') {
|
|
1263
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fieldType + '" (at "' + path_fieldType + '")');
|
|
1264
|
+
}
|
|
1265
|
+
const obj_id = obj.id;
|
|
1266
|
+
const path_id = path + '.id';
|
|
1267
|
+
if (typeof obj_id !== 'string') {
|
|
1268
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1269
|
+
}
|
|
1270
|
+
const obj_objectName = obj.objectName;
|
|
1271
|
+
const path_objectName = path + '.objectName';
|
|
1272
|
+
if (typeof obj_objectName !== 'string') {
|
|
1273
|
+
return new TypeError('Expected "string" but received "' + typeof obj_objectName + '" (at "' + path_objectName + '")');
|
|
1274
|
+
}
|
|
1275
|
+
const obj_recordType = obj.recordType;
|
|
1276
|
+
const path_recordType = path + '.recordType';
|
|
1277
|
+
if (typeof obj_recordType !== 'string') {
|
|
1278
|
+
return new TypeError('Expected "string" but received "' + typeof obj_recordType + '" (at "' + path_recordType + '")');
|
|
1279
|
+
}
|
|
1280
|
+
const obj_recordTypeId = obj.recordTypeId;
|
|
1281
|
+
const path_recordTypeId = path + '.recordTypeId';
|
|
1282
|
+
if (typeof obj_recordTypeId !== 'string') {
|
|
1283
|
+
return new TypeError('Expected "string" but received "' + typeof obj_recordTypeId + '" (at "' + path_recordTypeId + '")');
|
|
1284
|
+
}
|
|
1285
|
+
const obj_referenceObjectName = obj.referenceObjectName;
|
|
1286
|
+
const path_referenceObjectName = path + '.referenceObjectName';
|
|
1287
|
+
if (typeof obj_referenceObjectName !== 'string') {
|
|
1288
|
+
return new TypeError('Expected "string" but received "' + typeof obj_referenceObjectName + '" (at "' + path_referenceObjectName + '")');
|
|
1289
|
+
}
|
|
1290
|
+
})();
|
|
1291
|
+
return v_error === undefined ? null : v_error;
|
|
1292
|
+
}
|
|
1293
|
+
const RepresentationType$1 = 'GisRelatedObjectConfigOutputRepresentation';
|
|
1294
|
+
function keyBuilder$2(luvio, config) {
|
|
1295
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.id;
|
|
1296
|
+
}
|
|
1297
|
+
function keyBuilderFromType(luvio, object) {
|
|
1298
|
+
const keyParams = {
|
|
1299
|
+
id: object.id
|
|
1300
|
+
};
|
|
1301
|
+
return keyBuilder$2(luvio, keyParams);
|
|
1302
|
+
}
|
|
1303
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1304
|
+
return input;
|
|
1305
|
+
}
|
|
1306
|
+
const select$2 = function GisRelatedObjectConfigOutputRepresentationSelect() {
|
|
1307
|
+
return {
|
|
1308
|
+
kind: 'Fragment',
|
|
1309
|
+
version: VERSION$1,
|
|
1310
|
+
private: [],
|
|
1311
|
+
selections: [
|
|
1312
|
+
{
|
|
1313
|
+
name: 'defaultColor',
|
|
1314
|
+
kind: 'Scalar'
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
name: 'defaultIcon',
|
|
1318
|
+
kind: 'Scalar'
|
|
1319
|
+
},
|
|
1320
|
+
{
|
|
1321
|
+
name: 'fieldName',
|
|
1322
|
+
kind: 'Scalar'
|
|
1323
|
+
},
|
|
1324
|
+
{
|
|
1325
|
+
name: 'fieldType',
|
|
1326
|
+
kind: 'Scalar'
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
name: 'id',
|
|
1330
|
+
kind: 'Scalar'
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
name: 'objectName',
|
|
1334
|
+
kind: 'Scalar'
|
|
1335
|
+
},
|
|
1336
|
+
{
|
|
1337
|
+
name: 'recordType',
|
|
1338
|
+
kind: 'Scalar'
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
name: 'recordTypeId',
|
|
1342
|
+
kind: 'Scalar'
|
|
1343
|
+
},
|
|
1344
|
+
{
|
|
1345
|
+
name: 'referenceObjectName',
|
|
1346
|
+
kind: 'Scalar'
|
|
1347
|
+
}
|
|
1348
|
+
]
|
|
1349
|
+
};
|
|
1350
|
+
};
|
|
1351
|
+
function equals$1(existing, incoming) {
|
|
1352
|
+
const existing_defaultColor = existing.defaultColor;
|
|
1353
|
+
const incoming_defaultColor = incoming.defaultColor;
|
|
1354
|
+
if (!(existing_defaultColor === incoming_defaultColor)) {
|
|
1355
|
+
return false;
|
|
1356
|
+
}
|
|
1357
|
+
const existing_defaultIcon = existing.defaultIcon;
|
|
1358
|
+
const incoming_defaultIcon = incoming.defaultIcon;
|
|
1359
|
+
if (!(existing_defaultIcon === incoming_defaultIcon)) {
|
|
1360
|
+
return false;
|
|
1361
|
+
}
|
|
1362
|
+
const existing_fieldName = existing.fieldName;
|
|
1363
|
+
const incoming_fieldName = incoming.fieldName;
|
|
1364
|
+
if (!(existing_fieldName === incoming_fieldName)) {
|
|
1365
|
+
return false;
|
|
1366
|
+
}
|
|
1367
|
+
const existing_fieldType = existing.fieldType;
|
|
1368
|
+
const incoming_fieldType = incoming.fieldType;
|
|
1369
|
+
if (!(existing_fieldType === incoming_fieldType)) {
|
|
1370
|
+
return false;
|
|
1371
|
+
}
|
|
1372
|
+
const existing_id = existing.id;
|
|
1373
|
+
const incoming_id = incoming.id;
|
|
1374
|
+
if (!(existing_id === incoming_id)) {
|
|
1375
|
+
return false;
|
|
1376
|
+
}
|
|
1377
|
+
const existing_objectName = existing.objectName;
|
|
1378
|
+
const incoming_objectName = incoming.objectName;
|
|
1379
|
+
if (!(existing_objectName === incoming_objectName)) {
|
|
1380
|
+
return false;
|
|
1381
|
+
}
|
|
1382
|
+
const existing_recordType = existing.recordType;
|
|
1383
|
+
const incoming_recordType = incoming.recordType;
|
|
1384
|
+
if (!(existing_recordType === incoming_recordType)) {
|
|
1385
|
+
return false;
|
|
1386
|
+
}
|
|
1387
|
+
const existing_recordTypeId = existing.recordTypeId;
|
|
1388
|
+
const incoming_recordTypeId = incoming.recordTypeId;
|
|
1389
|
+
if (!(existing_recordTypeId === incoming_recordTypeId)) {
|
|
1390
|
+
return false;
|
|
1391
|
+
}
|
|
1392
|
+
const existing_referenceObjectName = existing.referenceObjectName;
|
|
1393
|
+
const incoming_referenceObjectName = incoming.referenceObjectName;
|
|
1394
|
+
if (!(existing_referenceObjectName === incoming_referenceObjectName)) {
|
|
1395
|
+
return false;
|
|
1396
|
+
}
|
|
1397
|
+
return true;
|
|
1398
|
+
}
|
|
1399
|
+
const ingest$1 = function GisRelatedObjectConfigOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1400
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1401
|
+
const validateError = validate$1(input);
|
|
1402
|
+
if (validateError !== null) {
|
|
1403
|
+
throw validateError;
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
const key = keyBuilderFromType(luvio, input);
|
|
1407
|
+
const ttlToUse = TTL$1;
|
|
1408
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "gis", VERSION$1, RepresentationType$1, equals$1);
|
|
1409
|
+
return createLink(key);
|
|
1410
|
+
};
|
|
1411
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
1412
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1413
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
1414
|
+
rootKeySet.set(rootKey, {
|
|
1415
|
+
namespace: keyPrefix,
|
|
1416
|
+
representationName: RepresentationType$1,
|
|
1417
|
+
mergeable: false
|
|
1418
|
+
});
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
const TTL = 300;
|
|
1422
|
+
const VERSION = "a58708a8e997c383af8c127b5e1e55b4";
|
|
1423
|
+
function validate(obj, path = 'GisRelatedObjectConfigCollectionRepresentation') {
|
|
1424
|
+
const v_error = (() => {
|
|
1425
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1426
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1427
|
+
}
|
|
1428
|
+
const obj_count = obj.count;
|
|
1429
|
+
const path_count = path + '.count';
|
|
1430
|
+
if (typeof obj_count !== 'number' || (typeof obj_count === 'number' && Math.floor(obj_count) !== obj_count)) {
|
|
1431
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_count + '" (at "' + path_count + '")');
|
|
1432
|
+
}
|
|
1433
|
+
const obj_gisRelatedObjectConfigOutputRepresentation = obj.gisRelatedObjectConfigOutputRepresentation;
|
|
1434
|
+
const path_gisRelatedObjectConfigOutputRepresentation = path + '.gisRelatedObjectConfigOutputRepresentation';
|
|
1435
|
+
if (!ArrayIsArray(obj_gisRelatedObjectConfigOutputRepresentation)) {
|
|
1436
|
+
return new TypeError('Expected "array" but received "' + typeof obj_gisRelatedObjectConfigOutputRepresentation + '" (at "' + path_gisRelatedObjectConfigOutputRepresentation + '")');
|
|
1437
|
+
}
|
|
1438
|
+
for (let i = 0; i < obj_gisRelatedObjectConfigOutputRepresentation.length; i++) {
|
|
1439
|
+
const obj_gisRelatedObjectConfigOutputRepresentation_item = obj_gisRelatedObjectConfigOutputRepresentation[i];
|
|
1440
|
+
const path_gisRelatedObjectConfigOutputRepresentation_item = path_gisRelatedObjectConfigOutputRepresentation + '[' + i + ']';
|
|
1441
|
+
if (typeof obj_gisRelatedObjectConfigOutputRepresentation_item !== 'object' || Array.isArray(obj_gisRelatedObjectConfigOutputRepresentation_item)) {
|
|
1442
|
+
return new TypeError('Expected "object" but received "' + typeof obj_gisRelatedObjectConfigOutputRepresentation_item + '" (at "' + path_gisRelatedObjectConfigOutputRepresentation_item + '")');
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
})();
|
|
1446
|
+
return v_error === undefined ? null : v_error;
|
|
1447
|
+
}
|
|
1448
|
+
const RepresentationType = 'GisRelatedObjectConfigCollectionRepresentation';
|
|
1449
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1450
|
+
const input_gisRelatedObjectConfigOutputRepresentation = input.gisRelatedObjectConfigOutputRepresentation;
|
|
1451
|
+
const input_gisRelatedObjectConfigOutputRepresentation_id = path.fullPath + '__gisRelatedObjectConfigOutputRepresentation';
|
|
1452
|
+
for (let i = 0; i < input_gisRelatedObjectConfigOutputRepresentation.length; i++) {
|
|
1453
|
+
const input_gisRelatedObjectConfigOutputRepresentation_item = input_gisRelatedObjectConfigOutputRepresentation[i];
|
|
1454
|
+
let input_gisRelatedObjectConfigOutputRepresentation_item_id = input_gisRelatedObjectConfigOutputRepresentation_id + '__' + i;
|
|
1455
|
+
input_gisRelatedObjectConfigOutputRepresentation[i] = ingest$1(input_gisRelatedObjectConfigOutputRepresentation_item, {
|
|
1456
|
+
fullPath: input_gisRelatedObjectConfigOutputRepresentation_item_id,
|
|
1457
|
+
propertyName: i,
|
|
1458
|
+
parent: {
|
|
1459
|
+
data: input,
|
|
1460
|
+
key: path.fullPath,
|
|
1461
|
+
existing: existing,
|
|
1462
|
+
},
|
|
1463
|
+
ttl: path.ttl
|
|
1464
|
+
}, luvio, store, timestamp);
|
|
1465
|
+
}
|
|
1466
|
+
return input;
|
|
1467
|
+
}
|
|
1468
|
+
const select$1 = function GisRelatedObjectConfigCollectionRepresentationSelect() {
|
|
1469
|
+
return {
|
|
1470
|
+
kind: 'Fragment',
|
|
1471
|
+
version: VERSION,
|
|
1472
|
+
private: [],
|
|
1473
|
+
selections: [
|
|
1474
|
+
{
|
|
1475
|
+
name: 'count',
|
|
1476
|
+
kind: 'Scalar'
|
|
1477
|
+
},
|
|
1478
|
+
{
|
|
1479
|
+
name: 'gisRelatedObjectConfigOutputRepresentation',
|
|
1480
|
+
kind: 'Link',
|
|
1481
|
+
plural: true,
|
|
1482
|
+
fragment: select$2()
|
|
1483
|
+
}
|
|
1484
|
+
]
|
|
1485
|
+
};
|
|
1486
|
+
};
|
|
1487
|
+
function equals(existing, incoming) {
|
|
1488
|
+
const existing_count = existing.count;
|
|
1489
|
+
const incoming_count = incoming.count;
|
|
1490
|
+
if (!(existing_count === incoming_count)) {
|
|
1491
|
+
return false;
|
|
1492
|
+
}
|
|
1493
|
+
const existing_gisRelatedObjectConfigOutputRepresentation = existing.gisRelatedObjectConfigOutputRepresentation;
|
|
1494
|
+
const incoming_gisRelatedObjectConfigOutputRepresentation = incoming.gisRelatedObjectConfigOutputRepresentation;
|
|
1495
|
+
const equals_gisRelatedObjectConfigOutputRepresentation_items = equalsArray(existing_gisRelatedObjectConfigOutputRepresentation, incoming_gisRelatedObjectConfigOutputRepresentation, (existing_gisRelatedObjectConfigOutputRepresentation_item, incoming_gisRelatedObjectConfigOutputRepresentation_item) => {
|
|
1496
|
+
if (!(existing_gisRelatedObjectConfigOutputRepresentation_item.__ref === incoming_gisRelatedObjectConfigOutputRepresentation_item.__ref)) {
|
|
1497
|
+
return false;
|
|
1498
|
+
}
|
|
1499
|
+
});
|
|
1500
|
+
if (equals_gisRelatedObjectConfigOutputRepresentation_items === false) {
|
|
1501
|
+
return false;
|
|
1502
|
+
}
|
|
1503
|
+
return true;
|
|
1504
|
+
}
|
|
1505
|
+
const ingest = function GisRelatedObjectConfigCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1506
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1507
|
+
const validateError = validate(input);
|
|
1508
|
+
if (validateError !== null) {
|
|
1509
|
+
throw validateError;
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
const key = path.fullPath;
|
|
1513
|
+
const ttlToUse = TTL;
|
|
1514
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "gis", VERSION, RepresentationType, equals);
|
|
1515
|
+
return createLink(key);
|
|
1516
|
+
};
|
|
1517
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
1518
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1519
|
+
const rootKey = fullPathFactory();
|
|
1520
|
+
rootKeySet.set(rootKey, {
|
|
1521
|
+
namespace: keyPrefix,
|
|
1522
|
+
representationName: RepresentationType,
|
|
1523
|
+
mergeable: false
|
|
1524
|
+
});
|
|
1525
|
+
const input_gisRelatedObjectConfigOutputRepresentation_length = input.gisRelatedObjectConfigOutputRepresentation.length;
|
|
1526
|
+
for (let i = 0; i < input_gisRelatedObjectConfigOutputRepresentation_length; i++) {
|
|
1527
|
+
getTypeCacheKeys$1(rootKeySet, luvio, input.gisRelatedObjectConfigOutputRepresentation[i]);
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
function select(luvio, params) {
|
|
1532
|
+
return select$1();
|
|
1533
|
+
}
|
|
1534
|
+
function keyBuilder$1(luvio, params) {
|
|
1535
|
+
return keyPrefix + '::GisRelatedObjectConfigCollectionRepresentation:(' + 'id:' + params.queryParams.id + ',' + 'objectName:' + params.queryParams.objectName + ')';
|
|
1536
|
+
}
|
|
1537
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1538
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
1539
|
+
}
|
|
1540
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
1541
|
+
const { body } = response;
|
|
1542
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
1543
|
+
luvio.storeIngest(key, ingest, body);
|
|
1544
|
+
const snapshot = luvio.storeLookup({
|
|
1545
|
+
recordId: key,
|
|
1546
|
+
node: select(),
|
|
1547
|
+
variables: {},
|
|
1548
|
+
}, snapshotRefresh);
|
|
1549
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1550
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1551
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
deepFreeze(snapshot.data);
|
|
1555
|
+
return snapshot;
|
|
1556
|
+
}
|
|
1557
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1558
|
+
const key = keyBuilder$1(luvio, params);
|
|
1559
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1560
|
+
const storeMetadataParams = {
|
|
1561
|
+
ttl: TTL,
|
|
1562
|
+
namespace: keyPrefix,
|
|
1563
|
+
version: VERSION,
|
|
1564
|
+
representationName: RepresentationType
|
|
1565
|
+
};
|
|
1566
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1567
|
+
return errorSnapshot;
|
|
1568
|
+
}
|
|
1569
|
+
function createResourceRequest(config) {
|
|
1570
|
+
const headers = {};
|
|
1571
|
+
return {
|
|
1572
|
+
baseUri: '/services/data/v66.0',
|
|
1573
|
+
basePath: '/gis/config/GisRelatedObjectConfig',
|
|
1574
|
+
method: 'get',
|
|
1575
|
+
body: null,
|
|
1576
|
+
urlParams: {},
|
|
1577
|
+
queryParams: config.queryParams,
|
|
1578
|
+
headers,
|
|
1579
|
+
priority: 'normal',
|
|
1580
|
+
};
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
const adapterName = 'getGisRelatedObjectConfig';
|
|
1584
|
+
const getGisRelatedObjectConfig_ConfigPropertyMetadata = [
|
|
1585
|
+
generateParamConfigMetadata('id', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1586
|
+
generateParamConfigMetadata('objectName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1587
|
+
];
|
|
1588
|
+
const getGisRelatedObjectConfig_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getGisRelatedObjectConfig_ConfigPropertyMetadata);
|
|
1589
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$5(getGisRelatedObjectConfig_ConfigPropertyMetadata);
|
|
1590
|
+
function keyBuilder(luvio, config) {
|
|
1591
|
+
const resourceParams = createResourceParams(config);
|
|
1592
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
1593
|
+
}
|
|
1594
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1595
|
+
const config = {};
|
|
1596
|
+
typeCheckConfig$5(untrustedConfig, config, getGisRelatedObjectConfig_ConfigPropertyMetadata);
|
|
1597
|
+
return config;
|
|
1598
|
+
}
|
|
1599
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1600
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1601
|
+
return null;
|
|
1602
|
+
}
|
|
1603
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1604
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1605
|
+
}
|
|
1606
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
1607
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1608
|
+
return null;
|
|
1609
|
+
}
|
|
1610
|
+
return config;
|
|
1611
|
+
}
|
|
1612
|
+
function adapterFragment(luvio, config) {
|
|
1613
|
+
createResourceParams(config);
|
|
1614
|
+
return select();
|
|
1615
|
+
}
|
|
1616
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1617
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
1618
|
+
config,
|
|
1619
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1620
|
+
});
|
|
1621
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1622
|
+
}
|
|
1623
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1624
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1625
|
+
config,
|
|
1626
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1627
|
+
});
|
|
1628
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1629
|
+
}
|
|
1630
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1631
|
+
const resourceParams = createResourceParams(config);
|
|
1632
|
+
const request = createResourceRequest(resourceParams);
|
|
1633
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1634
|
+
.then((response) => {
|
|
1635
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
1636
|
+
const cache = new StoreKeyMap();
|
|
1637
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
1638
|
+
return cache;
|
|
1639
|
+
});
|
|
1640
|
+
}, (response) => {
|
|
1641
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
1642
|
+
});
|
|
1643
|
+
}
|
|
1644
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1645
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
1646
|
+
}
|
|
1647
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1648
|
+
const { luvio, config } = context;
|
|
1649
|
+
const selector = {
|
|
1650
|
+
recordId: keyBuilder(luvio, config),
|
|
1651
|
+
node: adapterFragment(luvio, config),
|
|
1652
|
+
variables: {},
|
|
1653
|
+
};
|
|
1654
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1655
|
+
config,
|
|
1656
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1657
|
+
});
|
|
1658
|
+
return cacheSnapshot;
|
|
1659
|
+
}
|
|
1660
|
+
const getGisRelatedObjectConfigAdapterFactory = (luvio) => function gis__getGisRelatedObjectConfig(untrustedConfig, requestContext) {
|
|
1661
|
+
const config = validateAdapterConfig(untrustedConfig, getGisRelatedObjectConfig_ConfigPropertyNames);
|
|
1662
|
+
// Invalid or incomplete config
|
|
1663
|
+
if (config === null) {
|
|
1664
|
+
return null;
|
|
1665
|
+
}
|
|
1666
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1667
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1668
|
+
};
|
|
1669
|
+
|
|
1670
|
+
export { createGisExternalAuthIdentityProviderAdapterFactory, getGisExternalAuthAccessTokenAdapterFactory, getGisExternalAuthIdentityProvidersAdapterFactory, getGisExtlMapObjectConfigAdapterFactory, getGisRelatedObjectConfigAdapterFactory };
|