@salesforce/lds-adapters-platform-named-credential 1.124.1 → 1.124.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/es/es2018/platform-named-credential.js +990 -990
  2. package/dist/{types → es/es2018/types}/src/generated/adapters/adapter-utils.d.ts +66 -66
  3. package/dist/{types → es/es2018/types}/src/generated/adapters/deleteCredential.d.ts +15 -15
  4. package/dist/{types → es/es2018/types}/src/generated/adapters/getExternalCredentials.d.ts +25 -25
  5. package/dist/{types → es/es2018/types}/src/generated/adapters/getOAuthCredentialAuthUrl.d.ts +15 -15
  6. package/dist/{types → es/es2018/types}/src/generated/artifacts/main.d.ts +3 -3
  7. package/dist/{types → es/es2018/types}/src/generated/artifacts/sfdc.d.ts +5 -5
  8. package/dist/{types → es/es2018/types}/src/generated/resources/deleteNamedCredentialsCredential.d.ts +14 -14
  9. package/dist/{types → es/es2018/types}/src/generated/resources/getNamedCredentialsCredential.d.ts +17 -17
  10. package/dist/{types → es/es2018/types}/src/generated/resources/getNamedCredentialsExternalCredentials.d.ts +12 -12
  11. package/dist/{types → es/es2018/types}/src/generated/resources/getNamedCredentialsExternalCredentialsByDeveloperName.d.ts +15 -15
  12. package/dist/{types → es/es2018/types}/src/generated/resources/postNamedCredentialsCredential.d.ts +18 -18
  13. package/dist/{types → es/es2018/types}/src/generated/resources/postNamedCredentialsCredentialAuthUrlOAuth.d.ts +13 -13
  14. package/dist/{types → es/es2018/types}/src/generated/resources/putNamedCredentialsCredential.d.ts +18 -18
  15. package/dist/{types → es/es2018/types}/src/generated/types/CredentialInputRepresentation.d.ts +45 -45
  16. package/dist/{types → es/es2018/types}/src/generated/types/CredentialMapRepresentation.d.ts +33 -33
  17. package/dist/{types → es/es2018/types}/src/generated/types/CredentialRepresentation.d.ts +63 -63
  18. package/dist/{types → es/es2018/types}/src/generated/types/ExternalCredentialListRepresentation.d.ts +39 -39
  19. package/dist/{types → es/es2018/types}/src/generated/types/ExternalCredentialPrincipalRepresentation.d.ts +35 -35
  20. package/dist/{types → es/es2018/types}/src/generated/types/ExternalCredentialRepresentation.d.ts +55 -55
  21. package/dist/{types → es/es2018/types}/src/generated/types/NamedCredentialRepresentation.d.ts +32 -32
  22. package/dist/{types → es/es2018/types}/src/generated/types/OAuthCredentialAuthUrlInputRepresentation.d.ts +38 -38
  23. package/dist/{types → es/es2018/types}/src/generated/types/OAuthCredentialAuthUrlInputRepresentationWrapper.d.ts +30 -30
  24. package/dist/{types → es/es2018/types}/src/generated/types/OAuthCredentialAuthUrlRepresentation.d.ts +47 -47
  25. package/dist/{types → es/es2018/types}/src/generated/types/type-utils.d.ts +39 -39
  26. package/package.json +5 -5
  27. package/sfdc/index.d.ts +1 -1
  28. package/sfdc/index.js +1019 -1019
  29. package/dist/umd/es2018/platform-named-credential.js +0 -1039
  30. package/dist/umd/es5/platform-named-credential.js +0 -1045
package/sfdc/index.js CHANGED
@@ -16,1055 +16,1055 @@ import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstruct
16
16
  import { withDefaultLuvio } from 'force/ldsEngine';
17
17
  import { serializeStructuredKey, StoreKeyMap } from 'force/luvioEngine';
18
18
 
19
- const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
- const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
21
- const { isArray: ArrayIsArray$1 } = Array;
22
- /**
23
- * Validates an adapter config is well-formed.
24
- * @param config The config to validate.
25
- * @param adapter The adapter validation configuration.
26
- * @param oneOf The keys the config must contain at least one of.
27
- * @throws A TypeError if config doesn't satisfy the adapter's config validation.
28
- */
29
- function validateConfig(config, adapter, oneOf) {
30
- const { displayName } = adapter;
31
- const { required, optional, unsupported } = adapter.parameters;
32
- if (config === undefined ||
33
- required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
34
- throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
35
- }
36
- if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
37
- throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
38
- }
39
- if (unsupported !== undefined &&
40
- unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
41
- throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
42
- }
43
- const supported = required.concat(optional);
44
- if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
45
- throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
46
- }
47
- }
48
- function untrustedIsObject(untrusted) {
49
- return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
50
- }
51
- function areRequiredParametersPresent(config, configPropertyNames) {
52
- return configPropertyNames.parameters.required.every(req => req in config);
53
- }
54
- const snapshotRefreshOptions = {
55
- overrides: {
56
- headers: {
57
- 'Cache-Control': 'no-cache',
58
- },
59
- }
60
- };
19
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
+ const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
21
+ const { isArray: ArrayIsArray$1 } = Array;
22
+ /**
23
+ * Validates an adapter config is well-formed.
24
+ * @param config The config to validate.
25
+ * @param adapter The adapter validation configuration.
26
+ * @param oneOf The keys the config must contain at least one of.
27
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
28
+ */
29
+ function validateConfig(config, adapter, oneOf) {
30
+ const { displayName } = adapter;
31
+ const { required, optional, unsupported } = adapter.parameters;
32
+ if (config === undefined ||
33
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
34
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
35
+ }
36
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
37
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
38
+ }
39
+ if (unsupported !== undefined &&
40
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
41
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
42
+ }
43
+ const supported = required.concat(optional);
44
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
45
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
46
+ }
47
+ }
48
+ function untrustedIsObject(untrusted) {
49
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
50
+ }
51
+ function areRequiredParametersPresent(config, configPropertyNames) {
52
+ return configPropertyNames.parameters.required.every(req => req in config);
53
+ }
54
+ const snapshotRefreshOptions = {
55
+ overrides: {
56
+ headers: {
57
+ 'Cache-Control': 'no-cache',
58
+ },
59
+ }
60
+ };
61
61
  const keyPrefix = 'named-credential';
62
62
 
63
- const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
64
- const { isArray: ArrayIsArray } = Array;
65
- function equalsArray(a, b, equalsItem) {
66
- const aLength = a.length;
67
- const bLength = b.length;
68
- if (aLength !== bLength) {
69
- return false;
70
- }
71
- for (let i = 0; i < aLength; i++) {
72
- if (equalsItem(a[i], b[i]) === false) {
73
- return false;
74
- }
75
- }
76
- return true;
77
- }
78
- function deepFreeze(value) {
79
- // No need to freeze primitives
80
- if (typeof value !== 'object' || value === null) {
81
- return;
82
- }
83
- if (ArrayIsArray(value)) {
84
- for (let i = 0, len = value.length; i < len; i += 1) {
85
- deepFreeze(value[i]);
86
- }
87
- }
88
- else {
89
- const keys = ObjectKeys(value);
90
- for (let i = 0, len = keys.length; i < len; i += 1) {
91
- deepFreeze(value[keys[i]]);
92
- }
93
- }
94
- ObjectFreeze(value);
95
- }
96
- function createLink(ref) {
97
- return {
98
- __ref: serializeStructuredKey(ref),
99
- };
63
+ const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
64
+ const { isArray: ArrayIsArray } = Array;
65
+ function equalsArray(a, b, equalsItem) {
66
+ const aLength = a.length;
67
+ const bLength = b.length;
68
+ if (aLength !== bLength) {
69
+ return false;
70
+ }
71
+ for (let i = 0; i < aLength; i++) {
72
+ if (equalsItem(a[i], b[i]) === false) {
73
+ return false;
74
+ }
75
+ }
76
+ return true;
77
+ }
78
+ function deepFreeze(value) {
79
+ // No need to freeze primitives
80
+ if (typeof value !== 'object' || value === null) {
81
+ return;
82
+ }
83
+ if (ArrayIsArray(value)) {
84
+ for (let i = 0, len = value.length; i < len; i += 1) {
85
+ deepFreeze(value[i]);
86
+ }
87
+ }
88
+ else {
89
+ const keys = ObjectKeys(value);
90
+ for (let i = 0, len = keys.length; i < len; i += 1) {
91
+ deepFreeze(value[keys[i]]);
92
+ }
93
+ }
94
+ ObjectFreeze(value);
95
+ }
96
+ function createLink(ref) {
97
+ return {
98
+ __ref: serializeStructuredKey(ref),
99
+ };
100
100
  }
101
101
 
102
- const RepresentationType$3 = 'CredentialRepresentation';
103
- function keyBuilder$5(luvio, config) {
104
- return keyPrefix + '::' + RepresentationType$3 + ':' + config.externalCredential + ':' + config.principalType + ':' + (config.principalName === null ? '' : config.principalName);
102
+ const RepresentationType$3 = 'CredentialRepresentation';
103
+ function keyBuilder$5(luvio, config) {
104
+ return keyPrefix + '::' + RepresentationType$3 + ':' + config.externalCredential + ':' + config.principalType + ':' + (config.principalName === null ? '' : config.principalName);
105
105
  }
106
106
 
107
- function keyBuilder$4(luvio, params) {
108
- return keyBuilder$5(luvio, {
109
- externalCredential: params.queryParams.externalCredential || '',
110
- principalType: params.queryParams.principalType || '',
111
- principalName: params.queryParams.principalName || ''
112
- });
113
- }
114
- function getResponseCacheKeys$2(luvio, resourceParams) {
115
- const key = keyBuilder$4(luvio, resourceParams);
116
- const cacheKeyMap = new StoreKeyMap();
117
- cacheKeyMap.set(key, {
118
- namespace: keyPrefix,
119
- representationName: RepresentationType$3,
120
- mergeable: false
121
- });
122
- return cacheKeyMap;
123
- }
124
- function evictSuccess(luvio, resourceParams) {
125
- const key = keyBuilder$4(luvio, resourceParams);
126
- luvio.storeEvict(key);
127
- }
128
- function createResourceRequest$2(config) {
129
- const headers = {};
130
- return {
131
- baseUri: '/services/data/v58.0',
132
- basePath: '/named-credentials/credential',
133
- method: 'delete',
134
- body: null,
135
- urlParams: {},
136
- queryParams: config.queryParams,
137
- headers,
138
- priority: 'normal',
139
- };
107
+ function keyBuilder$4(luvio, params) {
108
+ return keyBuilder$5(luvio, {
109
+ externalCredential: params.queryParams.externalCredential || '',
110
+ principalType: params.queryParams.principalType || '',
111
+ principalName: params.queryParams.principalName || ''
112
+ });
113
+ }
114
+ function getResponseCacheKeys$2(luvio, resourceParams) {
115
+ const key = keyBuilder$4(luvio, resourceParams);
116
+ const cacheKeyMap = new StoreKeyMap();
117
+ cacheKeyMap.set(key, {
118
+ namespace: keyPrefix,
119
+ representationName: RepresentationType$3,
120
+ mergeable: false
121
+ });
122
+ return cacheKeyMap;
123
+ }
124
+ function evictSuccess(luvio, resourceParams) {
125
+ const key = keyBuilder$4(luvio, resourceParams);
126
+ luvio.storeEvict(key);
127
+ }
128
+ function createResourceRequest$2(config) {
129
+ const headers = {};
130
+ return {
131
+ baseUri: '/services/data/v58.0',
132
+ basePath: '/named-credentials/credential',
133
+ method: 'delete',
134
+ body: null,
135
+ urlParams: {},
136
+ queryParams: config.queryParams,
137
+ headers,
138
+ priority: 'normal',
139
+ };
140
140
  }
141
141
 
142
- const adapterName = 'deleteCredential';
143
- const deleteCredential_ConfigPropertyNames = {
144
- displayName: 'deleteCredential',
145
- parameters: {
146
- required: [],
147
- optional: ['externalCredential', 'principalName', 'principalType']
148
- }
149
- };
150
- function createResourceParams$2(config) {
151
- const resourceParams = {
152
- queryParams: {
153
- externalCredential: config.externalCredential, principalName: config.principalName, principalType: config.principalType
154
- }
155
- };
156
- return resourceParams;
157
- }
158
- function typeCheckConfig$2(untrustedConfig) {
159
- const config = {};
160
- const untrustedConfig_externalCredential = untrustedConfig.externalCredential;
161
- if (typeof untrustedConfig_externalCredential === 'string') {
162
- config.externalCredential = untrustedConfig_externalCredential;
163
- }
164
- const untrustedConfig_principalName = untrustedConfig.principalName;
165
- if (typeof untrustedConfig_principalName === 'string') {
166
- config.principalName = untrustedConfig_principalName;
167
- }
168
- const untrustedConfig_principalType = untrustedConfig.principalType;
169
- if (typeof untrustedConfig_principalType === 'string') {
170
- config.principalType = untrustedConfig_principalType;
171
- }
172
- return config;
173
- }
174
- function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
175
- if (!untrustedIsObject(untrustedConfig)) {
176
- return null;
177
- }
178
- if (process.env.NODE_ENV !== 'production') {
179
- validateConfig(untrustedConfig, configPropertyNames);
180
- }
181
- const config = typeCheckConfig$2(untrustedConfig);
182
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
183
- return null;
184
- }
185
- return config;
186
- }
187
- function buildNetworkSnapshot$2(luvio, config, options) {
188
- const resourceParams = createResourceParams$2(config);
189
- const request = createResourceRequest$2(resourceParams);
190
- return luvio.dispatchResourceRequest(request, options)
191
- .then(() => {
192
- return luvio.handleSuccessResponse(() => {
193
- evictSuccess(luvio, resourceParams);
194
- return luvio.storeBroadcast();
195
- }, () => getResponseCacheKeys$2(luvio, resourceParams));
196
- }, (response) => {
197
- deepFreeze(response);
198
- throw response;
199
- });
200
- }
201
- const deleteCredentialAdapterFactory = (luvio) => {
202
- return function namedCredentialdeleteCredential(untrustedConfig) {
203
- const config = validateAdapterConfig$2(untrustedConfig, deleteCredential_ConfigPropertyNames);
204
- // Invalid or incomplete config
205
- if (config === null) {
206
- throw new Error(`Invalid config for "${adapterName}"`);
207
- }
208
- return buildNetworkSnapshot$2(luvio, config);
209
- };
142
+ const adapterName = 'deleteCredential';
143
+ const deleteCredential_ConfigPropertyNames = {
144
+ displayName: 'deleteCredential',
145
+ parameters: {
146
+ required: [],
147
+ optional: ['externalCredential', 'principalName', 'principalType']
148
+ }
149
+ };
150
+ function createResourceParams$2(config) {
151
+ const resourceParams = {
152
+ queryParams: {
153
+ externalCredential: config.externalCredential, principalName: config.principalName, principalType: config.principalType
154
+ }
155
+ };
156
+ return resourceParams;
157
+ }
158
+ function typeCheckConfig$2(untrustedConfig) {
159
+ const config = {};
160
+ const untrustedConfig_externalCredential = untrustedConfig.externalCredential;
161
+ if (typeof untrustedConfig_externalCredential === 'string') {
162
+ config.externalCredential = untrustedConfig_externalCredential;
163
+ }
164
+ const untrustedConfig_principalName = untrustedConfig.principalName;
165
+ if (typeof untrustedConfig_principalName === 'string') {
166
+ config.principalName = untrustedConfig_principalName;
167
+ }
168
+ const untrustedConfig_principalType = untrustedConfig.principalType;
169
+ if (typeof untrustedConfig_principalType === 'string') {
170
+ config.principalType = untrustedConfig_principalType;
171
+ }
172
+ return config;
173
+ }
174
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
175
+ if (!untrustedIsObject(untrustedConfig)) {
176
+ return null;
177
+ }
178
+ if (process.env.NODE_ENV !== 'production') {
179
+ validateConfig(untrustedConfig, configPropertyNames);
180
+ }
181
+ const config = typeCheckConfig$2(untrustedConfig);
182
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
183
+ return null;
184
+ }
185
+ return config;
186
+ }
187
+ function buildNetworkSnapshot$2(luvio, config, options) {
188
+ const resourceParams = createResourceParams$2(config);
189
+ const request = createResourceRequest$2(resourceParams);
190
+ return luvio.dispatchResourceRequest(request, options)
191
+ .then(() => {
192
+ return luvio.handleSuccessResponse(() => {
193
+ evictSuccess(luvio, resourceParams);
194
+ return luvio.storeBroadcast();
195
+ }, () => getResponseCacheKeys$2(luvio, resourceParams));
196
+ }, (response) => {
197
+ deepFreeze(response);
198
+ throw response;
199
+ });
200
+ }
201
+ const deleteCredentialAdapterFactory = (luvio) => {
202
+ return function namedCredentialdeleteCredential(untrustedConfig) {
203
+ const config = validateAdapterConfig$2(untrustedConfig, deleteCredential_ConfigPropertyNames);
204
+ // Invalid or incomplete config
205
+ if (config === null) {
206
+ throw new Error(`Invalid config for "${adapterName}"`);
207
+ }
208
+ return buildNetworkSnapshot$2(luvio, config);
209
+ };
210
210
  };
211
211
 
212
- const VERSION$4 = "0874099e8f2a31ddf81f3ce490386603";
213
- function validate$5(obj, path = 'ExternalCredentialPrincipalRepresentation') {
214
- const v_error = (() => {
215
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
216
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
217
- }
218
- const obj_authenticationStatus = obj.authenticationStatus;
219
- const path_authenticationStatus = path + '.authenticationStatus';
220
- if (typeof obj_authenticationStatus !== 'string') {
221
- return new TypeError('Expected "string" but received "' + typeof obj_authenticationStatus + '" (at "' + path_authenticationStatus + '")');
222
- }
223
- const obj_principalName = obj.principalName;
224
- const path_principalName = path + '.principalName';
225
- if (typeof obj_principalName !== 'string') {
226
- return new TypeError('Expected "string" but received "' + typeof obj_principalName + '" (at "' + path_principalName + '")');
227
- }
228
- const obj_principalType = obj.principalType;
229
- const path_principalType = path + '.principalType';
230
- if (typeof obj_principalType !== 'string') {
231
- return new TypeError('Expected "string" but received "' + typeof obj_principalType + '" (at "' + path_principalType + '")');
232
- }
233
- })();
234
- return v_error === undefined ? null : v_error;
235
- }
236
- const select$6 = function ExternalCredentialPrincipalRepresentationSelect() {
237
- return {
238
- kind: 'Fragment',
239
- version: VERSION$4,
240
- private: [],
241
- selections: [
242
- {
243
- name: 'authenticationStatus',
244
- kind: 'Scalar'
245
- },
246
- {
247
- name: 'principalName',
248
- kind: 'Scalar'
249
- },
250
- {
251
- name: 'principalType',
252
- kind: 'Scalar'
253
- }
254
- ]
255
- };
256
- };
257
- function equals$4(existing, incoming) {
258
- const existing_authenticationStatus = existing.authenticationStatus;
259
- const incoming_authenticationStatus = incoming.authenticationStatus;
260
- if (!(existing_authenticationStatus === incoming_authenticationStatus)) {
261
- return false;
262
- }
263
- const existing_principalName = existing.principalName;
264
- const incoming_principalName = incoming.principalName;
265
- if (!(existing_principalName === incoming_principalName)) {
266
- return false;
267
- }
268
- const existing_principalType = existing.principalType;
269
- const incoming_principalType = incoming.principalType;
270
- if (!(existing_principalType === incoming_principalType)) {
271
- return false;
272
- }
273
- return true;
212
+ const VERSION$4 = "0874099e8f2a31ddf81f3ce490386603";
213
+ function validate$5(obj, path = 'ExternalCredentialPrincipalRepresentation') {
214
+ const v_error = (() => {
215
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
216
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
217
+ }
218
+ const obj_authenticationStatus = obj.authenticationStatus;
219
+ const path_authenticationStatus = path + '.authenticationStatus';
220
+ if (typeof obj_authenticationStatus !== 'string') {
221
+ return new TypeError('Expected "string" but received "' + typeof obj_authenticationStatus + '" (at "' + path_authenticationStatus + '")');
222
+ }
223
+ const obj_principalName = obj.principalName;
224
+ const path_principalName = path + '.principalName';
225
+ if (typeof obj_principalName !== 'string') {
226
+ return new TypeError('Expected "string" but received "' + typeof obj_principalName + '" (at "' + path_principalName + '")');
227
+ }
228
+ const obj_principalType = obj.principalType;
229
+ const path_principalType = path + '.principalType';
230
+ if (typeof obj_principalType !== 'string') {
231
+ return new TypeError('Expected "string" but received "' + typeof obj_principalType + '" (at "' + path_principalType + '")');
232
+ }
233
+ })();
234
+ return v_error === undefined ? null : v_error;
235
+ }
236
+ const select$6 = function ExternalCredentialPrincipalRepresentationSelect() {
237
+ return {
238
+ kind: 'Fragment',
239
+ version: VERSION$4,
240
+ private: [],
241
+ selections: [
242
+ {
243
+ name: 'authenticationStatus',
244
+ kind: 'Scalar'
245
+ },
246
+ {
247
+ name: 'principalName',
248
+ kind: 'Scalar'
249
+ },
250
+ {
251
+ name: 'principalType',
252
+ kind: 'Scalar'
253
+ }
254
+ ]
255
+ };
256
+ };
257
+ function equals$4(existing, incoming) {
258
+ const existing_authenticationStatus = existing.authenticationStatus;
259
+ const incoming_authenticationStatus = incoming.authenticationStatus;
260
+ if (!(existing_authenticationStatus === incoming_authenticationStatus)) {
261
+ return false;
262
+ }
263
+ const existing_principalName = existing.principalName;
264
+ const incoming_principalName = incoming.principalName;
265
+ if (!(existing_principalName === incoming_principalName)) {
266
+ return false;
267
+ }
268
+ const existing_principalType = existing.principalType;
269
+ const incoming_principalType = incoming.principalType;
270
+ if (!(existing_principalType === incoming_principalType)) {
271
+ return false;
272
+ }
273
+ return true;
274
274
  }
275
275
 
276
- const VERSION$3 = "95db03e0e8990cc8f51f006ccf355bf9";
277
- function validate$4(obj, path = 'NamedCredentialRepresentation') {
278
- const v_error = (() => {
279
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
280
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
281
- }
282
- const obj_developerName = obj.developerName;
283
- const path_developerName = path + '.developerName';
284
- if (typeof obj_developerName !== 'string') {
285
- return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
286
- }
287
- const obj_masterLabel = obj.masterLabel;
288
- const path_masterLabel = path + '.masterLabel';
289
- if (typeof obj_masterLabel !== 'string') {
290
- return new TypeError('Expected "string" but received "' + typeof obj_masterLabel + '" (at "' + path_masterLabel + '")');
291
- }
292
- })();
293
- return v_error === undefined ? null : v_error;
294
- }
295
- const select$5 = function NamedCredentialRepresentationSelect() {
296
- return {
297
- kind: 'Fragment',
298
- version: VERSION$3,
299
- private: [],
300
- selections: [
301
- {
302
- name: 'developerName',
303
- kind: 'Scalar'
304
- },
305
- {
306
- name: 'masterLabel',
307
- kind: 'Scalar'
308
- }
309
- ]
310
- };
311
- };
312
- function equals$3(existing, incoming) {
313
- const existing_developerName = existing.developerName;
314
- const incoming_developerName = incoming.developerName;
315
- if (!(existing_developerName === incoming_developerName)) {
316
- return false;
317
- }
318
- const existing_masterLabel = existing.masterLabel;
319
- const incoming_masterLabel = incoming.masterLabel;
320
- if (!(existing_masterLabel === incoming_masterLabel)) {
321
- return false;
322
- }
323
- return true;
276
+ const VERSION$3 = "95db03e0e8990cc8f51f006ccf355bf9";
277
+ function validate$4(obj, path = 'NamedCredentialRepresentation') {
278
+ const v_error = (() => {
279
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
280
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
281
+ }
282
+ const obj_developerName = obj.developerName;
283
+ const path_developerName = path + '.developerName';
284
+ if (typeof obj_developerName !== 'string') {
285
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
286
+ }
287
+ const obj_masterLabel = obj.masterLabel;
288
+ const path_masterLabel = path + '.masterLabel';
289
+ if (typeof obj_masterLabel !== 'string') {
290
+ return new TypeError('Expected "string" but received "' + typeof obj_masterLabel + '" (at "' + path_masterLabel + '")');
291
+ }
292
+ })();
293
+ return v_error === undefined ? null : v_error;
294
+ }
295
+ const select$5 = function NamedCredentialRepresentationSelect() {
296
+ return {
297
+ kind: 'Fragment',
298
+ version: VERSION$3,
299
+ private: [],
300
+ selections: [
301
+ {
302
+ name: 'developerName',
303
+ kind: 'Scalar'
304
+ },
305
+ {
306
+ name: 'masterLabel',
307
+ kind: 'Scalar'
308
+ }
309
+ ]
310
+ };
311
+ };
312
+ function equals$3(existing, incoming) {
313
+ const existing_developerName = existing.developerName;
314
+ const incoming_developerName = incoming.developerName;
315
+ if (!(existing_developerName === incoming_developerName)) {
316
+ return false;
317
+ }
318
+ const existing_masterLabel = existing.masterLabel;
319
+ const incoming_masterLabel = incoming.masterLabel;
320
+ if (!(existing_masterLabel === incoming_masterLabel)) {
321
+ return false;
322
+ }
323
+ return true;
324
324
  }
325
325
 
326
- const VERSION$2 = "fd37a032d72e3491fe4d211486a3fea1";
327
- function validate$3(obj, path = 'ExternalCredentialRepresentation') {
328
- const v_error = (() => {
329
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
330
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
331
- }
332
- const obj_authenticationProtocol = obj.authenticationProtocol;
333
- const path_authenticationProtocol = path + '.authenticationProtocol';
334
- if (typeof obj_authenticationProtocol !== 'string') {
335
- return new TypeError('Expected "string" but received "' + typeof obj_authenticationProtocol + '" (at "' + path_authenticationProtocol + '")');
336
- }
337
- const obj_authenticationStatus = obj.authenticationStatus;
338
- const path_authenticationStatus = path + '.authenticationStatus';
339
- if (typeof obj_authenticationStatus !== 'string') {
340
- return new TypeError('Expected "string" but received "' + typeof obj_authenticationStatus + '" (at "' + path_authenticationStatus + '")');
341
- }
342
- const obj_developerName = obj.developerName;
343
- const path_developerName = path + '.developerName';
344
- if (typeof obj_developerName !== 'string') {
345
- return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
346
- }
347
- const obj_masterLabel = obj.masterLabel;
348
- const path_masterLabel = path + '.masterLabel';
349
- if (typeof obj_masterLabel !== 'string') {
350
- return new TypeError('Expected "string" but received "' + typeof obj_masterLabel + '" (at "' + path_masterLabel + '")');
351
- }
352
- const obj_principals = obj.principals;
353
- const path_principals = path + '.principals';
354
- if (!ArrayIsArray(obj_principals)) {
355
- return new TypeError('Expected "array" but received "' + typeof obj_principals + '" (at "' + path_principals + '")');
356
- }
357
- for (let i = 0; i < obj_principals.length; i++) {
358
- const obj_principals_item = obj_principals[i];
359
- const path_principals_item = path_principals + '[' + i + ']';
360
- const referencepath_principals_itemValidationError = validate$5(obj_principals_item, path_principals_item);
361
- if (referencepath_principals_itemValidationError !== null) {
362
- let message = 'Object doesn\'t match ExternalCredentialPrincipalRepresentation (at "' + path_principals_item + '")\n';
363
- message += referencepath_principals_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
364
- return new TypeError(message);
365
- }
366
- }
367
- const obj_relatedNamedCredentials = obj.relatedNamedCredentials;
368
- const path_relatedNamedCredentials = path + '.relatedNamedCredentials';
369
- if (!ArrayIsArray(obj_relatedNamedCredentials)) {
370
- return new TypeError('Expected "array" but received "' + typeof obj_relatedNamedCredentials + '" (at "' + path_relatedNamedCredentials + '")');
371
- }
372
- for (let i = 0; i < obj_relatedNamedCredentials.length; i++) {
373
- const obj_relatedNamedCredentials_item = obj_relatedNamedCredentials[i];
374
- const path_relatedNamedCredentials_item = path_relatedNamedCredentials + '[' + i + ']';
375
- const referencepath_relatedNamedCredentials_itemValidationError = validate$4(obj_relatedNamedCredentials_item, path_relatedNamedCredentials_item);
376
- if (referencepath_relatedNamedCredentials_itemValidationError !== null) {
377
- let message = 'Object doesn\'t match NamedCredentialRepresentation (at "' + path_relatedNamedCredentials_item + '")\n';
378
- message += referencepath_relatedNamedCredentials_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
379
- return new TypeError(message);
380
- }
381
- }
382
- })();
383
- return v_error === undefined ? null : v_error;
384
- }
385
- const RepresentationType$2 = 'ExternalCredentialRepresentation';
386
- function keyBuilder$3(luvio, config) {
387
- return keyPrefix + '::' + RepresentationType$2 + ':' + config.developerName;
388
- }
389
- function keyBuilderFromType$1(luvio, object) {
390
- const keyParams = {
391
- developerName: object.developerName
392
- };
393
- return keyBuilder$3(luvio, keyParams);
394
- }
395
- function normalize$2(input, existing, path, luvio, store, timestamp) {
396
- return input;
397
- }
398
- const select$4 = function ExternalCredentialRepresentationSelect() {
399
- const { selections: ExternalCredentialPrincipalRepresentation__selections, opaque: ExternalCredentialPrincipalRepresentation__opaque, } = select$6();
400
- const { selections: NamedCredentialRepresentation__selections, opaque: NamedCredentialRepresentation__opaque, } = select$5();
401
- return {
402
- kind: 'Fragment',
403
- version: VERSION$2,
404
- private: [],
405
- selections: [
406
- {
407
- name: 'authenticationProtocol',
408
- kind: 'Scalar'
409
- },
410
- {
411
- name: 'authenticationStatus',
412
- kind: 'Scalar'
413
- },
414
- {
415
- name: 'developerName',
416
- kind: 'Scalar'
417
- },
418
- {
419
- name: 'masterLabel',
420
- kind: 'Scalar'
421
- },
422
- {
423
- name: 'principals',
424
- kind: 'Object',
425
- plural: true,
426
- selections: ExternalCredentialPrincipalRepresentation__selections
427
- },
428
- {
429
- name: 'relatedNamedCredentials',
430
- kind: 'Object',
431
- plural: true,
432
- selections: NamedCredentialRepresentation__selections
433
- }
434
- ]
435
- };
436
- };
437
- function equals$2(existing, incoming) {
438
- const existing_authenticationProtocol = existing.authenticationProtocol;
439
- const incoming_authenticationProtocol = incoming.authenticationProtocol;
440
- if (!(existing_authenticationProtocol === incoming_authenticationProtocol)) {
441
- return false;
442
- }
443
- const existing_authenticationStatus = existing.authenticationStatus;
444
- const incoming_authenticationStatus = incoming.authenticationStatus;
445
- if (!(existing_authenticationStatus === incoming_authenticationStatus)) {
446
- return false;
447
- }
448
- const existing_developerName = existing.developerName;
449
- const incoming_developerName = incoming.developerName;
450
- if (!(existing_developerName === incoming_developerName)) {
451
- return false;
452
- }
453
- const existing_masterLabel = existing.masterLabel;
454
- const incoming_masterLabel = incoming.masterLabel;
455
- if (!(existing_masterLabel === incoming_masterLabel)) {
456
- return false;
457
- }
458
- const existing_principals = existing.principals;
459
- const incoming_principals = incoming.principals;
460
- const equals_principals_items = equalsArray(existing_principals, incoming_principals, (existing_principals_item, incoming_principals_item) => {
461
- if (!(equals$4(existing_principals_item, incoming_principals_item))) {
462
- return false;
463
- }
464
- });
465
- if (equals_principals_items === false) {
466
- return false;
467
- }
468
- const existing_relatedNamedCredentials = existing.relatedNamedCredentials;
469
- const incoming_relatedNamedCredentials = incoming.relatedNamedCredentials;
470
- const equals_relatedNamedCredentials_items = equalsArray(existing_relatedNamedCredentials, incoming_relatedNamedCredentials, (existing_relatedNamedCredentials_item, incoming_relatedNamedCredentials_item) => {
471
- if (!(equals$3(existing_relatedNamedCredentials_item, incoming_relatedNamedCredentials_item))) {
472
- return false;
473
- }
474
- });
475
- if (equals_relatedNamedCredentials_items === false) {
476
- return false;
477
- }
478
- return true;
479
- }
480
- const ingest$2 = function ExternalCredentialRepresentationIngest(input, path, luvio, store, timestamp) {
481
- if (process.env.NODE_ENV !== 'production') {
482
- const validateError = validate$3(input);
483
- if (validateError !== null) {
484
- throw validateError;
485
- }
486
- }
487
- const key = keyBuilderFromType$1(luvio, input);
488
- const existingRecord = store.readEntry(key);
489
- const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
490
- let incomingRecord = normalize$2(input, store.readEntry(key), {
491
- fullPath: key,
492
- parent: path.parent,
493
- propertyName: path.propertyName,
494
- ttl: ttlToUse
495
- });
496
- if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
497
- luvio.storePublish(key, incomingRecord);
498
- }
499
- if (ttlToUse !== undefined) {
500
- const storeMetadataParams = {
501
- ttl: ttlToUse,
502
- namespace: "named-credential",
503
- version: VERSION$2,
504
- representationName: RepresentationType$2,
505
- };
506
- luvio.publishStoreMetadata(key, storeMetadataParams);
507
- }
508
- return createLink(key);
509
- };
510
- function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
511
- const rootKeySet = new StoreKeyMap();
512
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
513
- const rootKey = keyBuilderFromType$1(luvio, input);
514
- rootKeySet.set(rootKey, {
515
- namespace: keyPrefix,
516
- representationName: RepresentationType$2,
517
- mergeable: false
518
- });
519
- return rootKeySet;
326
+ const VERSION$2 = "fd37a032d72e3491fe4d211486a3fea1";
327
+ function validate$3(obj, path = 'ExternalCredentialRepresentation') {
328
+ const v_error = (() => {
329
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
330
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
331
+ }
332
+ const obj_authenticationProtocol = obj.authenticationProtocol;
333
+ const path_authenticationProtocol = path + '.authenticationProtocol';
334
+ if (typeof obj_authenticationProtocol !== 'string') {
335
+ return new TypeError('Expected "string" but received "' + typeof obj_authenticationProtocol + '" (at "' + path_authenticationProtocol + '")');
336
+ }
337
+ const obj_authenticationStatus = obj.authenticationStatus;
338
+ const path_authenticationStatus = path + '.authenticationStatus';
339
+ if (typeof obj_authenticationStatus !== 'string') {
340
+ return new TypeError('Expected "string" but received "' + typeof obj_authenticationStatus + '" (at "' + path_authenticationStatus + '")');
341
+ }
342
+ const obj_developerName = obj.developerName;
343
+ const path_developerName = path + '.developerName';
344
+ if (typeof obj_developerName !== 'string') {
345
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
346
+ }
347
+ const obj_masterLabel = obj.masterLabel;
348
+ const path_masterLabel = path + '.masterLabel';
349
+ if (typeof obj_masterLabel !== 'string') {
350
+ return new TypeError('Expected "string" but received "' + typeof obj_masterLabel + '" (at "' + path_masterLabel + '")');
351
+ }
352
+ const obj_principals = obj.principals;
353
+ const path_principals = path + '.principals';
354
+ if (!ArrayIsArray(obj_principals)) {
355
+ return new TypeError('Expected "array" but received "' + typeof obj_principals + '" (at "' + path_principals + '")');
356
+ }
357
+ for (let i = 0; i < obj_principals.length; i++) {
358
+ const obj_principals_item = obj_principals[i];
359
+ const path_principals_item = path_principals + '[' + i + ']';
360
+ const referencepath_principals_itemValidationError = validate$5(obj_principals_item, path_principals_item);
361
+ if (referencepath_principals_itemValidationError !== null) {
362
+ let message = 'Object doesn\'t match ExternalCredentialPrincipalRepresentation (at "' + path_principals_item + '")\n';
363
+ message += referencepath_principals_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
364
+ return new TypeError(message);
365
+ }
366
+ }
367
+ const obj_relatedNamedCredentials = obj.relatedNamedCredentials;
368
+ const path_relatedNamedCredentials = path + '.relatedNamedCredentials';
369
+ if (!ArrayIsArray(obj_relatedNamedCredentials)) {
370
+ return new TypeError('Expected "array" but received "' + typeof obj_relatedNamedCredentials + '" (at "' + path_relatedNamedCredentials + '")');
371
+ }
372
+ for (let i = 0; i < obj_relatedNamedCredentials.length; i++) {
373
+ const obj_relatedNamedCredentials_item = obj_relatedNamedCredentials[i];
374
+ const path_relatedNamedCredentials_item = path_relatedNamedCredentials + '[' + i + ']';
375
+ const referencepath_relatedNamedCredentials_itemValidationError = validate$4(obj_relatedNamedCredentials_item, path_relatedNamedCredentials_item);
376
+ if (referencepath_relatedNamedCredentials_itemValidationError !== null) {
377
+ let message = 'Object doesn\'t match NamedCredentialRepresentation (at "' + path_relatedNamedCredentials_item + '")\n';
378
+ message += referencepath_relatedNamedCredentials_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
379
+ return new TypeError(message);
380
+ }
381
+ }
382
+ })();
383
+ return v_error === undefined ? null : v_error;
384
+ }
385
+ const RepresentationType$2 = 'ExternalCredentialRepresentation';
386
+ function keyBuilder$3(luvio, config) {
387
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.developerName;
388
+ }
389
+ function keyBuilderFromType$1(luvio, object) {
390
+ const keyParams = {
391
+ developerName: object.developerName
392
+ };
393
+ return keyBuilder$3(luvio, keyParams);
394
+ }
395
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
396
+ return input;
397
+ }
398
+ const select$4 = function ExternalCredentialRepresentationSelect() {
399
+ const { selections: ExternalCredentialPrincipalRepresentation__selections, opaque: ExternalCredentialPrincipalRepresentation__opaque, } = select$6();
400
+ const { selections: NamedCredentialRepresentation__selections, opaque: NamedCredentialRepresentation__opaque, } = select$5();
401
+ return {
402
+ kind: 'Fragment',
403
+ version: VERSION$2,
404
+ private: [],
405
+ selections: [
406
+ {
407
+ name: 'authenticationProtocol',
408
+ kind: 'Scalar'
409
+ },
410
+ {
411
+ name: 'authenticationStatus',
412
+ kind: 'Scalar'
413
+ },
414
+ {
415
+ name: 'developerName',
416
+ kind: 'Scalar'
417
+ },
418
+ {
419
+ name: 'masterLabel',
420
+ kind: 'Scalar'
421
+ },
422
+ {
423
+ name: 'principals',
424
+ kind: 'Object',
425
+ plural: true,
426
+ selections: ExternalCredentialPrincipalRepresentation__selections
427
+ },
428
+ {
429
+ name: 'relatedNamedCredentials',
430
+ kind: 'Object',
431
+ plural: true,
432
+ selections: NamedCredentialRepresentation__selections
433
+ }
434
+ ]
435
+ };
436
+ };
437
+ function equals$2(existing, incoming) {
438
+ const existing_authenticationProtocol = existing.authenticationProtocol;
439
+ const incoming_authenticationProtocol = incoming.authenticationProtocol;
440
+ if (!(existing_authenticationProtocol === incoming_authenticationProtocol)) {
441
+ return false;
442
+ }
443
+ const existing_authenticationStatus = existing.authenticationStatus;
444
+ const incoming_authenticationStatus = incoming.authenticationStatus;
445
+ if (!(existing_authenticationStatus === incoming_authenticationStatus)) {
446
+ return false;
447
+ }
448
+ const existing_developerName = existing.developerName;
449
+ const incoming_developerName = incoming.developerName;
450
+ if (!(existing_developerName === incoming_developerName)) {
451
+ return false;
452
+ }
453
+ const existing_masterLabel = existing.masterLabel;
454
+ const incoming_masterLabel = incoming.masterLabel;
455
+ if (!(existing_masterLabel === incoming_masterLabel)) {
456
+ return false;
457
+ }
458
+ const existing_principals = existing.principals;
459
+ const incoming_principals = incoming.principals;
460
+ const equals_principals_items = equalsArray(existing_principals, incoming_principals, (existing_principals_item, incoming_principals_item) => {
461
+ if (!(equals$4(existing_principals_item, incoming_principals_item))) {
462
+ return false;
463
+ }
464
+ });
465
+ if (equals_principals_items === false) {
466
+ return false;
467
+ }
468
+ const existing_relatedNamedCredentials = existing.relatedNamedCredentials;
469
+ const incoming_relatedNamedCredentials = incoming.relatedNamedCredentials;
470
+ const equals_relatedNamedCredentials_items = equalsArray(existing_relatedNamedCredentials, incoming_relatedNamedCredentials, (existing_relatedNamedCredentials_item, incoming_relatedNamedCredentials_item) => {
471
+ if (!(equals$3(existing_relatedNamedCredentials_item, incoming_relatedNamedCredentials_item))) {
472
+ return false;
473
+ }
474
+ });
475
+ if (equals_relatedNamedCredentials_items === false) {
476
+ return false;
477
+ }
478
+ return true;
479
+ }
480
+ const ingest$2 = function ExternalCredentialRepresentationIngest(input, path, luvio, store, timestamp) {
481
+ if (process.env.NODE_ENV !== 'production') {
482
+ const validateError = validate$3(input);
483
+ if (validateError !== null) {
484
+ throw validateError;
485
+ }
486
+ }
487
+ const key = keyBuilderFromType$1(luvio, input);
488
+ const existingRecord = store.readEntry(key);
489
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
490
+ let incomingRecord = normalize$2(input, store.readEntry(key), {
491
+ fullPath: key,
492
+ parent: path.parent,
493
+ propertyName: path.propertyName,
494
+ ttl: ttlToUse
495
+ });
496
+ if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
497
+ luvio.storePublish(key, incomingRecord);
498
+ }
499
+ if (ttlToUse !== undefined) {
500
+ const storeMetadataParams = {
501
+ ttl: ttlToUse,
502
+ namespace: "named-credential",
503
+ version: VERSION$2,
504
+ representationName: RepresentationType$2,
505
+ };
506
+ luvio.publishStoreMetadata(key, storeMetadataParams);
507
+ }
508
+ return createLink(key);
509
+ };
510
+ function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
511
+ const rootKeySet = new StoreKeyMap();
512
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
513
+ const rootKey = keyBuilderFromType$1(luvio, input);
514
+ rootKeySet.set(rootKey, {
515
+ namespace: keyPrefix,
516
+ representationName: RepresentationType$2,
517
+ mergeable: false
518
+ });
519
+ return rootKeySet;
520
520
  }
521
521
 
522
- const VERSION$1 = "81417919a5a3d6b3e4fc26ab05d87aea";
523
- function validate$2(obj, path = 'ExternalCredentialListRepresentation') {
524
- const v_error = (() => {
525
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
526
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
527
- }
528
- const obj_externalCredentials = obj.externalCredentials;
529
- const path_externalCredentials = path + '.externalCredentials';
530
- if (!ArrayIsArray(obj_externalCredentials)) {
531
- return new TypeError('Expected "array" but received "' + typeof obj_externalCredentials + '" (at "' + path_externalCredentials + '")');
532
- }
533
- for (let i = 0; i < obj_externalCredentials.length; i++) {
534
- const obj_externalCredentials_item = obj_externalCredentials[i];
535
- const path_externalCredentials_item = path_externalCredentials + '[' + i + ']';
536
- if (typeof obj_externalCredentials_item !== 'object') {
537
- return new TypeError('Expected "object" but received "' + typeof obj_externalCredentials_item + '" (at "' + path_externalCredentials_item + '")');
538
- }
539
- }
540
- })();
541
- return v_error === undefined ? null : v_error;
542
- }
543
- const RepresentationType$1 = 'ExternalCredentialListRepresentation';
544
- function normalize$1(input, existing, path, luvio, store, timestamp) {
545
- const input_externalCredentials = input.externalCredentials;
546
- const input_externalCredentials_id = path.fullPath + '__externalCredentials';
547
- for (let i = 0; i < input_externalCredentials.length; i++) {
548
- const input_externalCredentials_item = input_externalCredentials[i];
549
- let input_externalCredentials_item_id = input_externalCredentials_id + '__' + i;
550
- input_externalCredentials[i] = ingest$2(input_externalCredentials_item, {
551
- fullPath: input_externalCredentials_item_id,
552
- propertyName: i,
553
- parent: {
554
- data: input,
555
- key: path.fullPath,
556
- existing: existing,
557
- },
558
- ttl: path.ttl
559
- }, luvio, store);
560
- }
561
- return input;
562
- }
563
- const select$3 = function ExternalCredentialListRepresentationSelect() {
564
- return {
565
- kind: 'Fragment',
566
- version: VERSION$1,
567
- private: [],
568
- selections: [
569
- {
570
- name: 'externalCredentials',
571
- kind: 'Link',
572
- plural: true,
573
- fragment: select$4()
574
- }
575
- ]
576
- };
577
- };
578
- function equals$1(existing, incoming) {
579
- const existing_externalCredentials = existing.externalCredentials;
580
- const incoming_externalCredentials = incoming.externalCredentials;
581
- const equals_externalCredentials_items = equalsArray(existing_externalCredentials, incoming_externalCredentials, (existing_externalCredentials_item, incoming_externalCredentials_item) => {
582
- if (!(existing_externalCredentials_item.__ref === incoming_externalCredentials_item.__ref)) {
583
- return false;
584
- }
585
- });
586
- if (equals_externalCredentials_items === false) {
587
- return false;
588
- }
589
- return true;
590
- }
591
- const ingest$1 = function ExternalCredentialListRepresentationIngest(input, path, luvio, store, timestamp) {
592
- if (process.env.NODE_ENV !== 'production') {
593
- const validateError = validate$2(input);
594
- if (validateError !== null) {
595
- throw validateError;
596
- }
597
- }
598
- const key = path.fullPath;
599
- const existingRecord = store.readEntry(key);
600
- const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
601
- let incomingRecord = normalize$1(input, store.readEntry(key), {
602
- fullPath: key,
603
- parent: path.parent,
604
- propertyName: path.propertyName,
605
- ttl: ttlToUse
606
- }, luvio, store);
607
- if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
608
- luvio.storePublish(key, incomingRecord);
609
- }
610
- if (ttlToUse !== undefined) {
611
- const storeMetadataParams = {
612
- ttl: ttlToUse,
613
- namespace: "named-credential",
614
- version: VERSION$1,
615
- representationName: RepresentationType$1,
616
- };
617
- luvio.publishStoreMetadata(key, storeMetadataParams);
618
- }
619
- return createLink(key);
620
- };
621
- function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
622
- const rootKeySet = new StoreKeyMap();
623
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
624
- const rootKey = fullPathFactory();
625
- rootKeySet.set(rootKey, {
626
- namespace: keyPrefix,
627
- representationName: RepresentationType$1,
628
- mergeable: false
629
- });
630
- const input_externalCredentials_length = input.externalCredentials.length;
631
- for (let i = 0; i < input_externalCredentials_length; i++) {
632
- rootKeySet.merge(getTypeCacheKeys$2(luvio, input.externalCredentials[i]));
633
- }
634
- return rootKeySet;
522
+ const VERSION$1 = "81417919a5a3d6b3e4fc26ab05d87aea";
523
+ function validate$2(obj, path = 'ExternalCredentialListRepresentation') {
524
+ const v_error = (() => {
525
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
526
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
527
+ }
528
+ const obj_externalCredentials = obj.externalCredentials;
529
+ const path_externalCredentials = path + '.externalCredentials';
530
+ if (!ArrayIsArray(obj_externalCredentials)) {
531
+ return new TypeError('Expected "array" but received "' + typeof obj_externalCredentials + '" (at "' + path_externalCredentials + '")');
532
+ }
533
+ for (let i = 0; i < obj_externalCredentials.length; i++) {
534
+ const obj_externalCredentials_item = obj_externalCredentials[i];
535
+ const path_externalCredentials_item = path_externalCredentials + '[' + i + ']';
536
+ if (typeof obj_externalCredentials_item !== 'object') {
537
+ return new TypeError('Expected "object" but received "' + typeof obj_externalCredentials_item + '" (at "' + path_externalCredentials_item + '")');
538
+ }
539
+ }
540
+ })();
541
+ return v_error === undefined ? null : v_error;
542
+ }
543
+ const RepresentationType$1 = 'ExternalCredentialListRepresentation';
544
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
545
+ const input_externalCredentials = input.externalCredentials;
546
+ const input_externalCredentials_id = path.fullPath + '__externalCredentials';
547
+ for (let i = 0; i < input_externalCredentials.length; i++) {
548
+ const input_externalCredentials_item = input_externalCredentials[i];
549
+ let input_externalCredentials_item_id = input_externalCredentials_id + '__' + i;
550
+ input_externalCredentials[i] = ingest$2(input_externalCredentials_item, {
551
+ fullPath: input_externalCredentials_item_id,
552
+ propertyName: i,
553
+ parent: {
554
+ data: input,
555
+ key: path.fullPath,
556
+ existing: existing,
557
+ },
558
+ ttl: path.ttl
559
+ }, luvio, store);
560
+ }
561
+ return input;
562
+ }
563
+ const select$3 = function ExternalCredentialListRepresentationSelect() {
564
+ return {
565
+ kind: 'Fragment',
566
+ version: VERSION$1,
567
+ private: [],
568
+ selections: [
569
+ {
570
+ name: 'externalCredentials',
571
+ kind: 'Link',
572
+ plural: true,
573
+ fragment: select$4()
574
+ }
575
+ ]
576
+ };
577
+ };
578
+ function equals$1(existing, incoming) {
579
+ const existing_externalCredentials = existing.externalCredentials;
580
+ const incoming_externalCredentials = incoming.externalCredentials;
581
+ const equals_externalCredentials_items = equalsArray(existing_externalCredentials, incoming_externalCredentials, (existing_externalCredentials_item, incoming_externalCredentials_item) => {
582
+ if (!(existing_externalCredentials_item.__ref === incoming_externalCredentials_item.__ref)) {
583
+ return false;
584
+ }
585
+ });
586
+ if (equals_externalCredentials_items === false) {
587
+ return false;
588
+ }
589
+ return true;
590
+ }
591
+ const ingest$1 = function ExternalCredentialListRepresentationIngest(input, path, luvio, store, timestamp) {
592
+ if (process.env.NODE_ENV !== 'production') {
593
+ const validateError = validate$2(input);
594
+ if (validateError !== null) {
595
+ throw validateError;
596
+ }
597
+ }
598
+ const key = path.fullPath;
599
+ const existingRecord = store.readEntry(key);
600
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
601
+ let incomingRecord = normalize$1(input, store.readEntry(key), {
602
+ fullPath: key,
603
+ parent: path.parent,
604
+ propertyName: path.propertyName,
605
+ ttl: ttlToUse
606
+ }, luvio, store);
607
+ if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
608
+ luvio.storePublish(key, incomingRecord);
609
+ }
610
+ if (ttlToUse !== undefined) {
611
+ const storeMetadataParams = {
612
+ ttl: ttlToUse,
613
+ namespace: "named-credential",
614
+ version: VERSION$1,
615
+ representationName: RepresentationType$1,
616
+ };
617
+ luvio.publishStoreMetadata(key, storeMetadataParams);
618
+ }
619
+ return createLink(key);
620
+ };
621
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
622
+ const rootKeySet = new StoreKeyMap();
623
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
624
+ const rootKey = fullPathFactory();
625
+ rootKeySet.set(rootKey, {
626
+ namespace: keyPrefix,
627
+ representationName: RepresentationType$1,
628
+ mergeable: false
629
+ });
630
+ const input_externalCredentials_length = input.externalCredentials.length;
631
+ for (let i = 0; i < input_externalCredentials_length; i++) {
632
+ rootKeySet.merge(getTypeCacheKeys$2(luvio, input.externalCredentials[i]));
633
+ }
634
+ return rootKeySet;
635
635
  }
636
636
 
637
- function select$2(luvio, params) {
638
- return select$3();
639
- }
640
- function keyBuilder$2(luvio, params) {
641
- return keyPrefix + '::ExternalCredentialListRepresentation:(' + ')';
642
- }
643
- function getResponseCacheKeys$1(luvio, resourceParams, response) {
644
- return getTypeCacheKeys$1(luvio, response, () => keyBuilder$2());
645
- }
646
- function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
647
- const { body } = response;
648
- const key = keyBuilder$2();
649
- luvio.storeIngest(key, ingest$1, body);
650
- const snapshot = luvio.storeLookup({
651
- recordId: key,
652
- node: select$2(),
653
- variables: {},
654
- }, snapshotRefresh);
655
- if (process.env.NODE_ENV !== 'production') {
656
- if (snapshot.state !== 'Fulfilled') {
657
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
658
- }
659
- }
660
- return snapshot;
661
- }
662
- function ingestError(luvio, params, error, snapshotRefresh) {
663
- const key = keyBuilder$2();
664
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
665
- luvio.storeIngestError(key, errorSnapshot);
666
- return errorSnapshot;
667
- }
668
- function createResourceRequest$1(config) {
669
- const headers = {};
670
- return {
671
- baseUri: '/services/data/v58.0',
672
- basePath: '/named-credentials/external-credentials',
673
- method: 'get',
674
- body: null,
675
- urlParams: {},
676
- queryParams: {},
677
- headers,
678
- priority: 'normal',
679
- };
637
+ function select$2(luvio, params) {
638
+ return select$3();
639
+ }
640
+ function keyBuilder$2(luvio, params) {
641
+ return keyPrefix + '::ExternalCredentialListRepresentation:(' + ')';
642
+ }
643
+ function getResponseCacheKeys$1(luvio, resourceParams, response) {
644
+ return getTypeCacheKeys$1(luvio, response, () => keyBuilder$2());
645
+ }
646
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
647
+ const { body } = response;
648
+ const key = keyBuilder$2();
649
+ luvio.storeIngest(key, ingest$1, body);
650
+ const snapshot = luvio.storeLookup({
651
+ recordId: key,
652
+ node: select$2(),
653
+ variables: {},
654
+ }, snapshotRefresh);
655
+ if (process.env.NODE_ENV !== 'production') {
656
+ if (snapshot.state !== 'Fulfilled') {
657
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
658
+ }
659
+ }
660
+ return snapshot;
661
+ }
662
+ function ingestError(luvio, params, error, snapshotRefresh) {
663
+ const key = keyBuilder$2();
664
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
665
+ luvio.storeIngestError(key, errorSnapshot);
666
+ return errorSnapshot;
667
+ }
668
+ function createResourceRequest$1(config) {
669
+ const headers = {};
670
+ return {
671
+ baseUri: '/services/data/v58.0',
672
+ basePath: '/named-credentials/external-credentials',
673
+ method: 'get',
674
+ body: null,
675
+ urlParams: {},
676
+ queryParams: {},
677
+ headers,
678
+ priority: 'normal',
679
+ };
680
680
  }
681
681
 
682
- const getExternalCredentials_ConfigPropertyNames = {
683
- displayName: 'getExternalCredentials',
684
- parameters: {
685
- required: [],
686
- optional: []
687
- }
688
- };
689
- function createResourceParams$1(config) {
690
- const resourceParams = {};
691
- return resourceParams;
692
- }
693
- function keyBuilder$1(luvio, config) {
694
- return keyBuilder$2();
695
- }
696
- function typeCheckConfig$1(untrustedConfig) {
697
- const config = {};
698
- return config;
699
- }
700
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
701
- if (!untrustedIsObject(untrustedConfig)) {
702
- return null;
703
- }
704
- if (process.env.NODE_ENV !== 'production') {
705
- validateConfig(untrustedConfig, configPropertyNames);
706
- }
707
- const config = typeCheckConfig$1();
708
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
709
- return null;
710
- }
711
- return config;
712
- }
713
- function adapterFragment(luvio, config) {
714
- return select$2();
715
- }
716
- function onFetchResponseSuccess(luvio, config, resourceParams, response) {
717
- const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
718
- config,
719
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
720
- });
721
- return luvio.storeBroadcast().then(() => snapshot);
722
- }
723
- function onFetchResponseError(luvio, config, resourceParams, response) {
724
- const snapshot = ingestError(luvio, resourceParams, response, {
725
- config,
726
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
727
- });
728
- return luvio.storeBroadcast().then(() => snapshot);
729
- }
730
- function buildNetworkSnapshot$1(luvio, config, options) {
731
- const resourceParams = createResourceParams$1();
732
- const request = createResourceRequest$1();
733
- return luvio.dispatchResourceRequest(request, options)
734
- .then((response) => {
735
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
736
- }, (response) => {
737
- return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
738
- });
739
- }
740
- function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
741
- const { luvio, config } = context;
742
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
743
- const dispatchOptions = {
744
- resourceRequestContext: {
745
- requestCorrelator,
746
- luvioRequestMethod: undefined,
747
- },
748
- eventObservers
749
- };
750
- if (networkPriority !== 'normal') {
751
- dispatchOptions.overrides = {
752
- priority: networkPriority
753
- };
754
- }
755
- return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
756
- }
757
- function buildCachedSnapshotCachePolicy(context, storeLookup) {
758
- const { luvio, config } = context;
759
- const selector = {
760
- recordId: keyBuilder$1(),
761
- node: adapterFragment(),
762
- variables: {},
763
- };
764
- const cacheSnapshot = storeLookup(selector, {
765
- config,
766
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
767
- });
768
- return cacheSnapshot;
769
- }
770
- const getExternalCredentialsAdapterFactory = (luvio) => function namedCredential__getExternalCredentials(untrustedConfig, requestContext) {
771
- const config = validateAdapterConfig$1(untrustedConfig, getExternalCredentials_ConfigPropertyNames);
772
- // Invalid or incomplete config
773
- if (config === null) {
774
- return null;
775
- }
776
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
777
- buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
682
+ const getExternalCredentials_ConfigPropertyNames = {
683
+ displayName: 'getExternalCredentials',
684
+ parameters: {
685
+ required: [],
686
+ optional: []
687
+ }
688
+ };
689
+ function createResourceParams$1(config) {
690
+ const resourceParams = {};
691
+ return resourceParams;
692
+ }
693
+ function keyBuilder$1(luvio, config) {
694
+ return keyBuilder$2();
695
+ }
696
+ function typeCheckConfig$1(untrustedConfig) {
697
+ const config = {};
698
+ return config;
699
+ }
700
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
701
+ if (!untrustedIsObject(untrustedConfig)) {
702
+ return null;
703
+ }
704
+ if (process.env.NODE_ENV !== 'production') {
705
+ validateConfig(untrustedConfig, configPropertyNames);
706
+ }
707
+ const config = typeCheckConfig$1();
708
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
709
+ return null;
710
+ }
711
+ return config;
712
+ }
713
+ function adapterFragment(luvio, config) {
714
+ return select$2();
715
+ }
716
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
717
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
718
+ config,
719
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
720
+ });
721
+ return luvio.storeBroadcast().then(() => snapshot);
722
+ }
723
+ function onFetchResponseError(luvio, config, resourceParams, response) {
724
+ const snapshot = ingestError(luvio, resourceParams, response, {
725
+ config,
726
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
727
+ });
728
+ return luvio.storeBroadcast().then(() => snapshot);
729
+ }
730
+ function buildNetworkSnapshot$1(luvio, config, options) {
731
+ const resourceParams = createResourceParams$1();
732
+ const request = createResourceRequest$1();
733
+ return luvio.dispatchResourceRequest(request, options)
734
+ .then((response) => {
735
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
736
+ }, (response) => {
737
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
738
+ });
739
+ }
740
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
741
+ const { luvio, config } = context;
742
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
743
+ const dispatchOptions = {
744
+ resourceRequestContext: {
745
+ requestCorrelator,
746
+ luvioRequestMethod: undefined,
747
+ },
748
+ eventObservers
749
+ };
750
+ if (networkPriority !== 'normal') {
751
+ dispatchOptions.overrides = {
752
+ priority: networkPriority
753
+ };
754
+ }
755
+ return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
756
+ }
757
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
758
+ const { luvio, config } = context;
759
+ const selector = {
760
+ recordId: keyBuilder$1(),
761
+ node: adapterFragment(),
762
+ variables: {},
763
+ };
764
+ const cacheSnapshot = storeLookup(selector, {
765
+ config,
766
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
767
+ });
768
+ return cacheSnapshot;
769
+ }
770
+ const getExternalCredentialsAdapterFactory = (luvio) => function namedCredential__getExternalCredentials(untrustedConfig, requestContext) {
771
+ const config = validateAdapterConfig$1(untrustedConfig, getExternalCredentials_ConfigPropertyNames);
772
+ // Invalid or incomplete config
773
+ if (config === null) {
774
+ return null;
775
+ }
776
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
777
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
778
778
  };
779
779
 
780
- function validate$1(obj, path = 'OAuthCredentialAuthUrlInputRepresentation') {
781
- const v_error = (() => {
782
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
783
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
784
- }
785
- const obj_externalCredential = obj.externalCredential;
786
- const path_externalCredential = path + '.externalCredential';
787
- if (typeof obj_externalCredential !== 'string') {
788
- return new TypeError('Expected "string" but received "' + typeof obj_externalCredential + '" (at "' + path_externalCredential + '")');
789
- }
790
- const obj_principalName = obj.principalName;
791
- const path_principalName = path + '.principalName';
792
- if (typeof obj_principalName !== 'string') {
793
- return new TypeError('Expected "string" but received "' + typeof obj_principalName + '" (at "' + path_principalName + '")');
794
- }
795
- const obj_principalType = obj.principalType;
796
- const path_principalType = path + '.principalType';
797
- if (typeof obj_principalType !== 'string') {
798
- return new TypeError('Expected "string" but received "' + typeof obj_principalType + '" (at "' + path_principalType + '")');
799
- }
800
- const obj_returnUrl = obj.returnUrl;
801
- const path_returnUrl = path + '.returnUrl';
802
- if (typeof obj_returnUrl !== 'string') {
803
- return new TypeError('Expected "string" but received "' + typeof obj_returnUrl + '" (at "' + path_returnUrl + '")');
804
- }
805
- })();
806
- return v_error === undefined ? null : v_error;
780
+ function validate$1(obj, path = 'OAuthCredentialAuthUrlInputRepresentation') {
781
+ const v_error = (() => {
782
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
783
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
784
+ }
785
+ const obj_externalCredential = obj.externalCredential;
786
+ const path_externalCredential = path + '.externalCredential';
787
+ if (typeof obj_externalCredential !== 'string') {
788
+ return new TypeError('Expected "string" but received "' + typeof obj_externalCredential + '" (at "' + path_externalCredential + '")');
789
+ }
790
+ const obj_principalName = obj.principalName;
791
+ const path_principalName = path + '.principalName';
792
+ if (typeof obj_principalName !== 'string') {
793
+ return new TypeError('Expected "string" but received "' + typeof obj_principalName + '" (at "' + path_principalName + '")');
794
+ }
795
+ const obj_principalType = obj.principalType;
796
+ const path_principalType = path + '.principalType';
797
+ if (typeof obj_principalType !== 'string') {
798
+ return new TypeError('Expected "string" but received "' + typeof obj_principalType + '" (at "' + path_principalType + '")');
799
+ }
800
+ const obj_returnUrl = obj.returnUrl;
801
+ const path_returnUrl = path + '.returnUrl';
802
+ if (typeof obj_returnUrl !== 'string') {
803
+ return new TypeError('Expected "string" but received "' + typeof obj_returnUrl + '" (at "' + path_returnUrl + '")');
804
+ }
805
+ })();
806
+ return v_error === undefined ? null : v_error;
807
807
  }
808
808
 
809
- const VERSION = "1e72de165572264bf8309eccfc284fd6";
810
- function validate(obj, path = 'OAuthCredentialAuthUrlRepresentation') {
811
- const v_error = (() => {
812
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
813
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
814
- }
815
- const obj_authenticationUrl = obj.authenticationUrl;
816
- const path_authenticationUrl = path + '.authenticationUrl';
817
- if (typeof obj_authenticationUrl !== 'string') {
818
- return new TypeError('Expected "string" but received "' + typeof obj_authenticationUrl + '" (at "' + path_authenticationUrl + '")');
819
- }
820
- const obj_externalCredential = obj.externalCredential;
821
- const path_externalCredential = path + '.externalCredential';
822
- if (typeof obj_externalCredential !== 'string') {
823
- return new TypeError('Expected "string" but received "' + typeof obj_externalCredential + '" (at "' + path_externalCredential + '")');
824
- }
825
- const obj_principalName = obj.principalName;
826
- const path_principalName = path + '.principalName';
827
- if (typeof obj_principalName !== 'string') {
828
- return new TypeError('Expected "string" but received "' + typeof obj_principalName + '" (at "' + path_principalName + '")');
829
- }
830
- const obj_principalType = obj.principalType;
831
- const path_principalType = path + '.principalType';
832
- if (typeof obj_principalType !== 'string') {
833
- return new TypeError('Expected "string" but received "' + typeof obj_principalType + '" (at "' + path_principalType + '")');
834
- }
835
- })();
836
- return v_error === undefined ? null : v_error;
837
- }
838
- const RepresentationType = 'OAuthCredentialAuthUrlRepresentation';
839
- function keyBuilder(luvio, config) {
840
- return keyPrefix + '::' + RepresentationType + ':' + config.authenticationUrl;
841
- }
842
- function keyBuilderFromType(luvio, object) {
843
- const keyParams = {
844
- authenticationUrl: object.authenticationUrl
845
- };
846
- return keyBuilder(luvio, keyParams);
847
- }
848
- function normalize(input, existing, path, luvio, store, timestamp) {
849
- return input;
850
- }
851
- const select$1 = function OAuthCredentialAuthUrlRepresentationSelect() {
852
- return {
853
- kind: 'Fragment',
854
- version: VERSION,
855
- private: [],
856
- selections: [
857
- {
858
- name: 'authenticationUrl',
859
- kind: 'Scalar'
860
- },
861
- {
862
- name: 'externalCredential',
863
- kind: 'Scalar'
864
- },
865
- {
866
- name: 'principalName',
867
- kind: 'Scalar'
868
- },
869
- {
870
- name: 'principalType',
871
- kind: 'Scalar'
872
- }
873
- ]
874
- };
875
- };
876
- function equals(existing, incoming) {
877
- const existing_authenticationUrl = existing.authenticationUrl;
878
- const incoming_authenticationUrl = incoming.authenticationUrl;
879
- if (!(existing_authenticationUrl === incoming_authenticationUrl)) {
880
- return false;
881
- }
882
- const existing_externalCredential = existing.externalCredential;
883
- const incoming_externalCredential = incoming.externalCredential;
884
- if (!(existing_externalCredential === incoming_externalCredential)) {
885
- return false;
886
- }
887
- const existing_principalName = existing.principalName;
888
- const incoming_principalName = incoming.principalName;
889
- if (!(existing_principalName === incoming_principalName)) {
890
- return false;
891
- }
892
- const existing_principalType = existing.principalType;
893
- const incoming_principalType = incoming.principalType;
894
- if (!(existing_principalType === incoming_principalType)) {
895
- return false;
896
- }
897
- return true;
898
- }
899
- const ingest = function OAuthCredentialAuthUrlRepresentationIngest(input, path, luvio, store, timestamp) {
900
- if (process.env.NODE_ENV !== 'production') {
901
- const validateError = validate(input);
902
- if (validateError !== null) {
903
- throw validateError;
904
- }
905
- }
906
- const key = keyBuilderFromType(luvio, input);
907
- const existingRecord = store.readEntry(key);
908
- const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
909
- let incomingRecord = normalize(input, store.readEntry(key), {
910
- fullPath: key,
911
- parent: path.parent,
912
- propertyName: path.propertyName,
913
- ttl: ttlToUse
914
- });
915
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
916
- luvio.storePublish(key, incomingRecord);
917
- }
918
- if (ttlToUse !== undefined) {
919
- const storeMetadataParams = {
920
- ttl: ttlToUse,
921
- namespace: "named-credential",
922
- version: VERSION,
923
- representationName: RepresentationType,
924
- };
925
- luvio.publishStoreMetadata(key, storeMetadataParams);
926
- }
927
- return createLink(key);
928
- };
929
- function getTypeCacheKeys(luvio, input, fullPathFactory) {
930
- const rootKeySet = new StoreKeyMap();
931
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
932
- const rootKey = keyBuilderFromType(luvio, input);
933
- rootKeySet.set(rootKey, {
934
- namespace: keyPrefix,
935
- representationName: RepresentationType,
936
- mergeable: false
937
- });
938
- return rootKeySet;
809
+ const VERSION = "1e72de165572264bf8309eccfc284fd6";
810
+ function validate(obj, path = 'OAuthCredentialAuthUrlRepresentation') {
811
+ const v_error = (() => {
812
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
813
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
814
+ }
815
+ const obj_authenticationUrl = obj.authenticationUrl;
816
+ const path_authenticationUrl = path + '.authenticationUrl';
817
+ if (typeof obj_authenticationUrl !== 'string') {
818
+ return new TypeError('Expected "string" but received "' + typeof obj_authenticationUrl + '" (at "' + path_authenticationUrl + '")');
819
+ }
820
+ const obj_externalCredential = obj.externalCredential;
821
+ const path_externalCredential = path + '.externalCredential';
822
+ if (typeof obj_externalCredential !== 'string') {
823
+ return new TypeError('Expected "string" but received "' + typeof obj_externalCredential + '" (at "' + path_externalCredential + '")');
824
+ }
825
+ const obj_principalName = obj.principalName;
826
+ const path_principalName = path + '.principalName';
827
+ if (typeof obj_principalName !== 'string') {
828
+ return new TypeError('Expected "string" but received "' + typeof obj_principalName + '" (at "' + path_principalName + '")');
829
+ }
830
+ const obj_principalType = obj.principalType;
831
+ const path_principalType = path + '.principalType';
832
+ if (typeof obj_principalType !== 'string') {
833
+ return new TypeError('Expected "string" but received "' + typeof obj_principalType + '" (at "' + path_principalType + '")');
834
+ }
835
+ })();
836
+ return v_error === undefined ? null : v_error;
837
+ }
838
+ const RepresentationType = 'OAuthCredentialAuthUrlRepresentation';
839
+ function keyBuilder(luvio, config) {
840
+ return keyPrefix + '::' + RepresentationType + ':' + config.authenticationUrl;
841
+ }
842
+ function keyBuilderFromType(luvio, object) {
843
+ const keyParams = {
844
+ authenticationUrl: object.authenticationUrl
845
+ };
846
+ return keyBuilder(luvio, keyParams);
847
+ }
848
+ function normalize(input, existing, path, luvio, store, timestamp) {
849
+ return input;
850
+ }
851
+ const select$1 = function OAuthCredentialAuthUrlRepresentationSelect() {
852
+ return {
853
+ kind: 'Fragment',
854
+ version: VERSION,
855
+ private: [],
856
+ selections: [
857
+ {
858
+ name: 'authenticationUrl',
859
+ kind: 'Scalar'
860
+ },
861
+ {
862
+ name: 'externalCredential',
863
+ kind: 'Scalar'
864
+ },
865
+ {
866
+ name: 'principalName',
867
+ kind: 'Scalar'
868
+ },
869
+ {
870
+ name: 'principalType',
871
+ kind: 'Scalar'
872
+ }
873
+ ]
874
+ };
875
+ };
876
+ function equals(existing, incoming) {
877
+ const existing_authenticationUrl = existing.authenticationUrl;
878
+ const incoming_authenticationUrl = incoming.authenticationUrl;
879
+ if (!(existing_authenticationUrl === incoming_authenticationUrl)) {
880
+ return false;
881
+ }
882
+ const existing_externalCredential = existing.externalCredential;
883
+ const incoming_externalCredential = incoming.externalCredential;
884
+ if (!(existing_externalCredential === incoming_externalCredential)) {
885
+ return false;
886
+ }
887
+ const existing_principalName = existing.principalName;
888
+ const incoming_principalName = incoming.principalName;
889
+ if (!(existing_principalName === incoming_principalName)) {
890
+ return false;
891
+ }
892
+ const existing_principalType = existing.principalType;
893
+ const incoming_principalType = incoming.principalType;
894
+ if (!(existing_principalType === incoming_principalType)) {
895
+ return false;
896
+ }
897
+ return true;
898
+ }
899
+ const ingest = function OAuthCredentialAuthUrlRepresentationIngest(input, path, luvio, store, timestamp) {
900
+ if (process.env.NODE_ENV !== 'production') {
901
+ const validateError = validate(input);
902
+ if (validateError !== null) {
903
+ throw validateError;
904
+ }
905
+ }
906
+ const key = keyBuilderFromType(luvio, input);
907
+ const existingRecord = store.readEntry(key);
908
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
909
+ let incomingRecord = normalize(input, store.readEntry(key), {
910
+ fullPath: key,
911
+ parent: path.parent,
912
+ propertyName: path.propertyName,
913
+ ttl: ttlToUse
914
+ });
915
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
916
+ luvio.storePublish(key, incomingRecord);
917
+ }
918
+ if (ttlToUse !== undefined) {
919
+ const storeMetadataParams = {
920
+ ttl: ttlToUse,
921
+ namespace: "named-credential",
922
+ version: VERSION,
923
+ representationName: RepresentationType,
924
+ };
925
+ luvio.publishStoreMetadata(key, storeMetadataParams);
926
+ }
927
+ return createLink(key);
928
+ };
929
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
930
+ const rootKeySet = new StoreKeyMap();
931
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
932
+ const rootKey = keyBuilderFromType(luvio, input);
933
+ rootKeySet.set(rootKey, {
934
+ namespace: keyPrefix,
935
+ representationName: RepresentationType,
936
+ mergeable: false
937
+ });
938
+ return rootKeySet;
939
939
  }
940
940
 
941
- function select(luvio, params) {
942
- return select$1();
943
- }
944
- function getResponseCacheKeys(luvio, resourceParams, response) {
945
- return getTypeCacheKeys(luvio, response);
946
- }
947
- function ingestSuccess(luvio, resourceParams, response) {
948
- const { body } = response;
949
- const key = keyBuilderFromType(luvio, body);
950
- luvio.storeIngest(key, ingest, body);
951
- const snapshot = luvio.storeLookup({
952
- recordId: key,
953
- node: select(),
954
- variables: {},
955
- });
956
- if (process.env.NODE_ENV !== 'production') {
957
- if (snapshot.state !== 'Fulfilled') {
958
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
959
- }
960
- }
961
- return snapshot;
962
- }
963
- function createResourceRequest(config) {
964
- const headers = {};
965
- return {
966
- baseUri: '/services/data/v58.0',
967
- basePath: '/named-credentials/credential/auth-url/o-auth',
968
- method: 'post',
969
- body: config.body,
970
- urlParams: {},
971
- queryParams: {},
972
- headers,
973
- priority: 'normal',
974
- };
941
+ function select(luvio, params) {
942
+ return select$1();
943
+ }
944
+ function getResponseCacheKeys(luvio, resourceParams, response) {
945
+ return getTypeCacheKeys(luvio, response);
946
+ }
947
+ function ingestSuccess(luvio, resourceParams, response) {
948
+ const { body } = response;
949
+ const key = keyBuilderFromType(luvio, body);
950
+ luvio.storeIngest(key, ingest, body);
951
+ const snapshot = luvio.storeLookup({
952
+ recordId: key,
953
+ node: select(),
954
+ variables: {},
955
+ });
956
+ if (process.env.NODE_ENV !== 'production') {
957
+ if (snapshot.state !== 'Fulfilled') {
958
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
959
+ }
960
+ }
961
+ return snapshot;
962
+ }
963
+ function createResourceRequest(config) {
964
+ const headers = {};
965
+ return {
966
+ baseUri: '/services/data/v58.0',
967
+ basePath: '/named-credentials/credential/auth-url/o-auth',
968
+ method: 'post',
969
+ body: config.body,
970
+ urlParams: {},
971
+ queryParams: {},
972
+ headers,
973
+ priority: 'normal',
974
+ };
975
975
  }
976
976
 
977
- const getOAuthCredentialAuthUrl_ConfigPropertyNames = {
978
- displayName: 'getOAuthCredentialAuthUrl',
979
- parameters: {
980
- required: ['requestBody'],
981
- optional: []
982
- }
983
- };
984
- function createResourceParams(config) {
985
- const resourceParams = {
986
- body: {
987
- requestBody: config.requestBody
988
- }
989
- };
990
- return resourceParams;
991
- }
992
- function typeCheckConfig(untrustedConfig) {
993
- const config = {};
994
- const untrustedConfig_requestBody = untrustedConfig.requestBody;
995
- const referenceOAuthCredentialAuthUrlInputRepresentationValidationError = validate$1(untrustedConfig_requestBody);
996
- if (referenceOAuthCredentialAuthUrlInputRepresentationValidationError === null) {
997
- config.requestBody = untrustedConfig_requestBody;
998
- }
999
- return config;
1000
- }
1001
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1002
- if (!untrustedIsObject(untrustedConfig)) {
1003
- return null;
1004
- }
1005
- if (process.env.NODE_ENV !== 'production') {
1006
- validateConfig(untrustedConfig, configPropertyNames);
1007
- }
1008
- const config = typeCheckConfig(untrustedConfig);
1009
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
1010
- return null;
1011
- }
1012
- return config;
1013
- }
1014
- function buildNetworkSnapshot(luvio, config, options) {
1015
- const resourceParams = createResourceParams(config);
1016
- const request = createResourceRequest(resourceParams);
1017
- return luvio.dispatchResourceRequest(request, options)
1018
- .then((response) => {
1019
- return luvio.handleSuccessResponse(() => {
1020
- const snapshot = ingestSuccess(luvio, resourceParams, response);
1021
- return luvio.storeBroadcast().then(() => snapshot);
1022
- }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
1023
- }, (response) => {
1024
- deepFreeze(response);
1025
- throw response;
1026
- });
1027
- }
1028
- const getOAuthCredentialAuthUrlAdapterFactory = (luvio) => {
1029
- return function getOAuthCredentialAuthUrl(untrustedConfig) {
1030
- const config = validateAdapterConfig(untrustedConfig, getOAuthCredentialAuthUrl_ConfigPropertyNames);
1031
- // Invalid or incomplete config
1032
- if (config === null) {
1033
- throw new Error('Invalid config for "getOAuthCredentialAuthUrl"');
1034
- }
1035
- return buildNetworkSnapshot(luvio, config);
1036
- };
977
+ const getOAuthCredentialAuthUrl_ConfigPropertyNames = {
978
+ displayName: 'getOAuthCredentialAuthUrl',
979
+ parameters: {
980
+ required: ['requestBody'],
981
+ optional: []
982
+ }
983
+ };
984
+ function createResourceParams(config) {
985
+ const resourceParams = {
986
+ body: {
987
+ requestBody: config.requestBody
988
+ }
989
+ };
990
+ return resourceParams;
991
+ }
992
+ function typeCheckConfig(untrustedConfig) {
993
+ const config = {};
994
+ const untrustedConfig_requestBody = untrustedConfig.requestBody;
995
+ const referenceOAuthCredentialAuthUrlInputRepresentationValidationError = validate$1(untrustedConfig_requestBody);
996
+ if (referenceOAuthCredentialAuthUrlInputRepresentationValidationError === null) {
997
+ config.requestBody = untrustedConfig_requestBody;
998
+ }
999
+ return config;
1000
+ }
1001
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1002
+ if (!untrustedIsObject(untrustedConfig)) {
1003
+ return null;
1004
+ }
1005
+ if (process.env.NODE_ENV !== 'production') {
1006
+ validateConfig(untrustedConfig, configPropertyNames);
1007
+ }
1008
+ const config = typeCheckConfig(untrustedConfig);
1009
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1010
+ return null;
1011
+ }
1012
+ return config;
1013
+ }
1014
+ function buildNetworkSnapshot(luvio, config, options) {
1015
+ const resourceParams = createResourceParams(config);
1016
+ const request = createResourceRequest(resourceParams);
1017
+ return luvio.dispatchResourceRequest(request, options)
1018
+ .then((response) => {
1019
+ return luvio.handleSuccessResponse(() => {
1020
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
1021
+ return luvio.storeBroadcast().then(() => snapshot);
1022
+ }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
1023
+ }, (response) => {
1024
+ deepFreeze(response);
1025
+ throw response;
1026
+ });
1027
+ }
1028
+ const getOAuthCredentialAuthUrlAdapterFactory = (luvio) => {
1029
+ return function getOAuthCredentialAuthUrl(untrustedConfig) {
1030
+ const config = validateAdapterConfig(untrustedConfig, getOAuthCredentialAuthUrl_ConfigPropertyNames);
1031
+ // Invalid or incomplete config
1032
+ if (config === null) {
1033
+ throw new Error('Invalid config for "getOAuthCredentialAuthUrl"');
1034
+ }
1035
+ return buildNetworkSnapshot(luvio, config);
1036
+ };
1037
1037
  };
1038
1038
 
1039
- let deleteCredential;
1040
- let getExternalCredentials;
1041
- let getOAuthCredentialAuthUrl;
1042
- // Imperative GET Adapters
1043
- let getExternalCredentials_imperative;
1044
- const getExternalCredentialsMetadata = { apiFamily: 'namedcredential', name: 'getExternalCredentials' };
1045
- function bindExportsTo(luvio) {
1046
- // LDS Adapters
1047
- const getExternalCredentials_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getExternalCredentials', getExternalCredentialsAdapterFactory), getExternalCredentialsMetadata);
1048
- function unwrapSnapshotData(factory) {
1049
- const adapter = factory(luvio);
1050
- return (config) => adapter(config).then(snapshot => snapshot.data);
1051
- }
1052
- return {
1053
- deleteCredential: createLDSAdapter(luvio, adapterName, deleteCredentialAdapterFactory),
1054
- getExternalCredentials: createWireAdapterConstructor(luvio, getExternalCredentials_ldsAdapter, getExternalCredentialsMetadata),
1055
- getOAuthCredentialAuthUrl: unwrapSnapshotData(getOAuthCredentialAuthUrlAdapterFactory),
1056
- // Imperative GET Adapters
1057
- getExternalCredentials_imperative: createImperativeAdapter(luvio, getExternalCredentials_ldsAdapter, getExternalCredentialsMetadata)
1058
- };
1059
- }
1060
- withDefaultLuvio((luvio) => {
1061
- ({
1062
- deleteCredential,
1063
- getExternalCredentials,
1064
- getOAuthCredentialAuthUrl,
1065
- getExternalCredentials_imperative
1066
- } = bindExportsTo(luvio));
1039
+ let deleteCredential;
1040
+ let getExternalCredentials;
1041
+ let getOAuthCredentialAuthUrl;
1042
+ // Imperative GET Adapters
1043
+ let getExternalCredentials_imperative;
1044
+ const getExternalCredentialsMetadata = { apiFamily: 'namedcredential', name: 'getExternalCredentials' };
1045
+ function bindExportsTo(luvio) {
1046
+ // LDS Adapters
1047
+ const getExternalCredentials_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getExternalCredentials', getExternalCredentialsAdapterFactory), getExternalCredentialsMetadata);
1048
+ function unwrapSnapshotData(factory) {
1049
+ const adapter = factory(luvio);
1050
+ return (config) => adapter(config).then(snapshot => snapshot.data);
1051
+ }
1052
+ return {
1053
+ deleteCredential: createLDSAdapter(luvio, adapterName, deleteCredentialAdapterFactory),
1054
+ getExternalCredentials: createWireAdapterConstructor(luvio, getExternalCredentials_ldsAdapter, getExternalCredentialsMetadata),
1055
+ getOAuthCredentialAuthUrl: unwrapSnapshotData(getOAuthCredentialAuthUrlAdapterFactory),
1056
+ // Imperative GET Adapters
1057
+ getExternalCredentials_imperative: createImperativeAdapter(luvio, getExternalCredentials_ldsAdapter, getExternalCredentialsMetadata)
1058
+ };
1059
+ }
1060
+ withDefaultLuvio((luvio) => {
1061
+ ({
1062
+ deleteCredential,
1063
+ getExternalCredentials,
1064
+ getOAuthCredentialAuthUrl,
1065
+ getExternalCredentials_imperative
1066
+ } = bindExportsTo(luvio));
1067
1067
  });
1068
1068
 
1069
1069
  export { deleteCredential, getExternalCredentials, getExternalCredentials_imperative, getOAuthCredentialAuthUrl };
1070
- // version: 1.124.1-f96ced753
1070
+ // version: 1.124.3-c058f7d96