@salesforce/lds-adapters-industries-constraints 1.308.0 → 1.310.0

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 (24) hide show
  1. package/dist/es/es2018/industries-constraints.js +353 -125
  2. package/dist/es/es2018/types/src/generated/adapters/createConstraintVersion.d.ts +18 -0
  3. package/dist/es/es2018/types/src/generated/adapters/getConstraintVersion.d.ts +28 -0
  4. package/dist/es/es2018/types/src/generated/adapters/updateConstraintVersion.d.ts +19 -0
  5. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +3 -2
  6. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +5 -4
  7. package/dist/es/es2018/types/src/generated/resources/{getConstraintActionsViewByExpressionSetDefinitionVersionId.d.ts → getIndustriesConstraintsVersionsByExpressionSetId.d.ts} +5 -5
  8. package/dist/es/es2018/types/src/generated/resources/getIndustriesConstraintsVersionsByExpressionSetIdAndExpressionSetVersionId.d.ts +16 -0
  9. package/dist/es/es2018/types/src/generated/resources/patchIndustriesConstraintsVersionsByExpressionSetId.d.ts +17 -0
  10. package/dist/es/es2018/types/src/generated/resources/patchIndustriesConstraintsVersionsByExpressionSetIdAndExpressionSetVersionId.d.ts +18 -0
  11. package/dist/es/es2018/types/src/generated/resources/{patchConstraintActionsUpdateByExpressionSetDefinitionVersionId.d.ts → postIndustriesConstraintsVersionsByExpressionSetId.d.ts} +4 -4
  12. package/dist/es/es2018/types/src/generated/resources/postIndustriesConstraintsVersionsByExpressionSetIdAndExpressionSetVersionId.d.ts +18 -0
  13. package/dist/es/es2018/types/src/generated/types/{ViewConstraintOutputRepresentation.d.ts → ConstraintVersionOutputRepresentation.d.ts} +8 -8
  14. package/dist/es/es2018/types/src/generated/types/CreateConstraintVersionInputRepresentation.d.ts +34 -0
  15. package/dist/es/es2018/types/src/generated/types/CreateConstraintVersionOutputRepresentation.d.ts +54 -0
  16. package/dist/es/es2018/types/src/generated/types/UpdateConstraintVersionInputRepresentation.d.ts +34 -0
  17. package/dist/es/es2018/types/src/generated/types/{ConstraintOutputRepresentation.d.ts → UpdateConstraintVersionOutputRepresentation.d.ts} +14 -14
  18. package/package.json +3 -3
  19. package/sfdc/index.js +362 -129
  20. package/src/raml/api.raml +125 -40
  21. package/src/raml/luvio.raml +21 -13
  22. package/dist/es/es2018/types/src/generated/adapters/getViewConstraint.d.ts +0 -27
  23. package/dist/es/es2018/types/src/generated/adapters/patchUpdateConstraint.d.ts +0 -18
  24. package/dist/es/es2018/types/src/generated/types/ConstraintInputRepresentation.d.ts +0 -34
@@ -4,7 +4,7 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$2, typeCheckConfig as typeCheckConfig$2, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$3, typeCheckConfig as typeCheckConfig$3, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -92,9 +92,9 @@ function createLink(ref) {
92
92
  };
93
93
  }
94
94
 
95
- const TTL$2 = 1000;
96
- const VERSION$2 = "ced261010494087086be7d8b043d2fda";
97
- function validate$2(obj, path = 'ConstraintErrorResponseRepresentation') {
95
+ const TTL$3 = 1000;
96
+ const VERSION$3 = "ced261010494087086be7d8b043d2fda";
97
+ function validate$3(obj, path = 'ConstraintErrorResponseRepresentation') {
98
98
  const v_error = (() => {
99
99
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
100
100
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -112,49 +112,49 @@ function validate$2(obj, path = 'ConstraintErrorResponseRepresentation') {
112
112
  })();
113
113
  return v_error === undefined ? null : v_error;
114
114
  }
115
- const RepresentationType$2 = 'ConstraintErrorResponseRepresentation';
116
- function normalize$2(input, existing, path, luvio, store, timestamp) {
115
+ const RepresentationType$3 = 'ConstraintErrorResponseRepresentation';
116
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
117
117
  return input;
118
118
  }
119
- const select$4 = function ConstraintErrorResponseRepresentationSelect() {
119
+ const select$6 = function ConstraintErrorResponseRepresentationSelect() {
120
120
  return {
121
121
  kind: 'Fragment',
122
- version: VERSION$2,
122
+ version: VERSION$3,
123
123
  private: [],
124
124
  opaque: true
125
125
  };
126
126
  };
127
- function equals$2(existing, incoming) {
127
+ function equals$3(existing, incoming) {
128
128
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
129
129
  return false;
130
130
  }
131
131
  return true;
132
132
  }
133
- const ingest$2 = function ConstraintErrorResponseRepresentationIngest(input, path, luvio, store, timestamp) {
133
+ const ingest$3 = function ConstraintErrorResponseRepresentationIngest(input, path, luvio, store, timestamp) {
134
134
  if (process.env.NODE_ENV !== 'production') {
135
- const validateError = validate$2(input);
135
+ const validateError = validate$3(input);
136
136
  if (validateError !== null) {
137
137
  throw validateError;
138
138
  }
139
139
  }
140
140
  const key = path.fullPath;
141
- const ttlToUse = TTL$2;
142
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "constraints", VERSION$2, RepresentationType$2, equals$2);
141
+ const ttlToUse = TTL$3;
142
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "constraints", VERSION$3, RepresentationType$3, equals$3);
143
143
  return createLink(key);
144
144
  };
145
- function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
145
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
146
146
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
147
147
  const rootKey = fullPathFactory();
148
148
  rootKeySet.set(rootKey, {
149
149
  namespace: keyPrefix,
150
- representationName: RepresentationType$2,
150
+ representationName: RepresentationType$3,
151
151
  mergeable: false
152
152
  });
153
153
  }
154
154
 
155
- const TTL$1 = 1000;
156
- const VERSION$1 = "5646f5b52bdab0ca9d29c0a28b60ac39";
157
- function validate$1(obj, path = 'ConstraintOutputRepresentation') {
155
+ const TTL$2 = 1000;
156
+ const VERSION$2 = "faf4a72fe3721080fa45e289d0a79216";
157
+ function validate$2(obj, path = 'CreateConstraintVersionOutputRepresentation') {
158
158
  const v_error = (() => {
159
159
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
160
160
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -176,26 +176,31 @@ function validate$1(obj, path = 'ConstraintOutputRepresentation') {
176
176
  if (typeof obj_success !== 'boolean') {
177
177
  return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
178
178
  }
179
+ const obj_versionId = obj.versionId;
180
+ const path_versionId = path + '.versionId';
181
+ if (typeof obj_versionId !== 'string') {
182
+ return new TypeError('Expected "string" but received "' + typeof obj_versionId + '" (at "' + path_versionId + '")');
183
+ }
179
184
  })();
180
185
  return v_error === undefined ? null : v_error;
181
186
  }
182
- const RepresentationType$1 = 'ConstraintOutputRepresentation';
183
- function keyBuilder$2(luvio, config) {
184
- return keyPrefix + '::' + RepresentationType$1 + ':' + config.success;
187
+ const RepresentationType$2 = 'CreateConstraintVersionOutputRepresentation';
188
+ function keyBuilder$3(luvio, config) {
189
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.success;
185
190
  }
186
- function keyBuilderFromType(luvio, object) {
191
+ function keyBuilderFromType$1(luvio, object) {
187
192
  const keyParams = {
188
193
  success: object.success
189
194
  };
190
- return keyBuilder$2(luvio, keyParams);
195
+ return keyBuilder$3(luvio, keyParams);
191
196
  }
192
- function normalize$1(input, existing, path, luvio, store, timestamp) {
197
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
193
198
  const input_errors = input.errors;
194
199
  const input_errors_id = path.fullPath + '__errors';
195
200
  for (let i = 0; i < input_errors.length; i++) {
196
201
  const input_errors_item = input_errors[i];
197
202
  let input_errors_item_id = input_errors_id + '__' + i;
198
- input_errors[i] = ingest$2(input_errors_item, {
203
+ input_errors[i] = ingest$3(input_errors_item, {
199
204
  fullPath: input_errors_item_id,
200
205
  propertyName: i,
201
206
  parent: {
@@ -208,31 +213,40 @@ function normalize$1(input, existing, path, luvio, store, timestamp) {
208
213
  }
209
214
  return input;
210
215
  }
211
- const select$3 = function ConstraintOutputRepresentationSelect() {
216
+ const select$5 = function CreateConstraintVersionOutputRepresentationSelect() {
212
217
  return {
213
218
  kind: 'Fragment',
214
- version: VERSION$1,
219
+ version: VERSION$2,
215
220
  private: [],
216
221
  selections: [
217
222
  {
218
223
  name: 'errors',
219
224
  kind: 'Link',
220
225
  plural: true,
221
- fragment: select$4()
226
+ fragment: select$6()
222
227
  },
223
228
  {
224
229
  name: 'success',
225
230
  kind: 'Scalar'
231
+ },
232
+ {
233
+ name: 'versionId',
234
+ kind: 'Scalar'
226
235
  }
227
236
  ]
228
237
  };
229
238
  };
230
- function equals$1(existing, incoming) {
239
+ function equals$2(existing, incoming) {
231
240
  const existing_success = existing.success;
232
241
  const incoming_success = incoming.success;
233
242
  if (!(existing_success === incoming_success)) {
234
243
  return false;
235
244
  }
245
+ const existing_versionId = existing.versionId;
246
+ const incoming_versionId = incoming.versionId;
247
+ if (!(existing_versionId === incoming_versionId)) {
248
+ return false;
249
+ }
236
250
  const existing_errors = existing.errors;
237
251
  const incoming_errors = incoming.errors;
238
252
  const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
@@ -245,45 +259,45 @@ function equals$1(existing, incoming) {
245
259
  }
246
260
  return true;
247
261
  }
248
- const ingest$1 = function ConstraintOutputRepresentationIngest(input, path, luvio, store, timestamp) {
262
+ const ingest$2 = function CreateConstraintVersionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
249
263
  if (process.env.NODE_ENV !== 'production') {
250
- const validateError = validate$1(input);
264
+ const validateError = validate$2(input);
251
265
  if (validateError !== null) {
252
266
  throw validateError;
253
267
  }
254
268
  }
255
- const key = keyBuilderFromType(luvio, input);
256
- const ttlToUse = TTL$1;
257
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "constraints", VERSION$1, RepresentationType$1, equals$1);
269
+ const key = keyBuilderFromType$1(luvio, input);
270
+ const ttlToUse = TTL$2;
271
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "constraints", VERSION$2, RepresentationType$2, equals$2);
258
272
  return createLink(key);
259
273
  };
260
- function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
274
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
261
275
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
262
- const rootKey = keyBuilderFromType(luvio, input);
276
+ const rootKey = keyBuilderFromType$1(luvio, input);
263
277
  rootKeySet.set(rootKey, {
264
278
  namespace: keyPrefix,
265
- representationName: RepresentationType$1,
279
+ representationName: RepresentationType$2,
266
280
  mergeable: false
267
281
  });
268
282
  const input_errors_length = input.errors.length;
269
283
  for (let i = 0; i < input_errors_length; i++) {
270
- getTypeCacheKeys$2(rootKeySet, luvio, input.errors[i], () => '');
284
+ getTypeCacheKeys$3(rootKeySet, luvio, input.errors[i], () => '');
271
285
  }
272
286
  }
273
287
 
274
- function select$2(luvio, params) {
275
- return select$3();
288
+ function select$4(luvio, params) {
289
+ return select$5();
276
290
  }
277
- function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
278
- getTypeCacheKeys$1(storeKeyMap, luvio, response);
291
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
292
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
279
293
  }
280
- function ingestSuccess$1(luvio, resourceParams, response) {
294
+ function ingestSuccess$2(luvio, resourceParams, response) {
281
295
  const { body } = response;
282
- const key = keyBuilderFromType(luvio, body);
283
- luvio.storeIngest(key, ingest$1, body);
296
+ const key = keyBuilderFromType$1(luvio, body);
297
+ luvio.storeIngest(key, ingest$2, body);
284
298
  const snapshot = luvio.storeLookup({
285
299
  recordId: key,
286
- node: select$2(),
300
+ node: select$4(),
287
301
  variables: {},
288
302
  });
289
303
  if (process.env.NODE_ENV !== 'production') {
@@ -294,12 +308,12 @@ function ingestSuccess$1(luvio, resourceParams, response) {
294
308
  deepFreeze(snapshot.data);
295
309
  return snapshot;
296
310
  }
297
- function createResourceRequest$1(config) {
311
+ function createResourceRequest$2(config) {
298
312
  const headers = {};
299
313
  return {
300
314
  baseUri: '/services/data/v62.0',
301
- basePath: '/constraint/actions/' + config.urlParams.expressionSetDefinitionVersionId + '/update',
302
- method: 'patch',
315
+ basePath: '/industries/constraints/' + config.urlParams.expressionSetId + '/versions',
316
+ method: 'post',
303
317
  body: config.body,
304
318
  urlParams: config.urlParams,
305
319
  queryParams: {},
@@ -308,44 +322,44 @@ function createResourceRequest$1(config) {
308
322
  };
309
323
  }
310
324
 
311
- const adapterName$1 = 'patchUpdateConstraint';
312
- const patchUpdateConstraint_ConfigPropertyMetadata = [
313
- generateParamConfigMetadata('expressionSetDefinitionVersionId', true, 0 /* UrlParameter */, 0 /* String */),
325
+ const adapterName$2 = 'createConstraintVersion';
326
+ const createConstraintVersion_ConfigPropertyMetadata = [
327
+ generateParamConfigMetadata('expressionSetId', true, 0 /* UrlParameter */, 0 /* String */),
314
328
  generateParamConfigMetadata('constraintModel', true, 2 /* Body */, 0 /* String */),
315
329
  generateParamConfigMetadata('description', true, 2 /* Body */, 0 /* String */),
316
330
  generateParamConfigMetadata('status', true, 2 /* Body */, 0 /* String */),
317
331
  ];
318
- const patchUpdateConstraint_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, patchUpdateConstraint_ConfigPropertyMetadata);
319
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(patchUpdateConstraint_ConfigPropertyMetadata);
320
- function typeCheckConfig$1(untrustedConfig) {
332
+ const createConstraintVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, createConstraintVersion_ConfigPropertyMetadata);
333
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(createConstraintVersion_ConfigPropertyMetadata);
334
+ function typeCheckConfig$2(untrustedConfig) {
321
335
  const config = {};
322
- typeCheckConfig$2(untrustedConfig, config, patchUpdateConstraint_ConfigPropertyMetadata);
336
+ typeCheckConfig$3(untrustedConfig, config, createConstraintVersion_ConfigPropertyMetadata);
323
337
  return config;
324
338
  }
325
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
339
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
326
340
  if (!untrustedIsObject(untrustedConfig)) {
327
341
  return null;
328
342
  }
329
343
  if (process.env.NODE_ENV !== 'production') {
330
344
  validateConfig(untrustedConfig, configPropertyNames);
331
345
  }
332
- const config = typeCheckConfig$1(untrustedConfig);
346
+ const config = typeCheckConfig$2(untrustedConfig);
333
347
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
334
348
  return null;
335
349
  }
336
350
  return config;
337
351
  }
338
- function buildNetworkSnapshot$1(luvio, config, options) {
339
- const resourceParams = createResourceParams$1(config);
340
- const request = createResourceRequest$1(resourceParams);
352
+ function buildNetworkSnapshot$2(luvio, config, options) {
353
+ const resourceParams = createResourceParams$2(config);
354
+ const request = createResourceRequest$2(resourceParams);
341
355
  return luvio.dispatchResourceRequest(request, options)
342
356
  .then((response) => {
343
357
  return luvio.handleSuccessResponse(() => {
344
- const snapshot = ingestSuccess$1(luvio, resourceParams, response);
358
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
345
359
  return luvio.storeBroadcast().then(() => snapshot);
346
360
  }, () => {
347
361
  const cache = new StoreKeyMap();
348
- getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
362
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
349
363
  return cache;
350
364
  });
351
365
  }, (response) => {
@@ -353,20 +367,20 @@ function buildNetworkSnapshot$1(luvio, config, options) {
353
367
  throw response;
354
368
  });
355
369
  }
356
- const patchUpdateConstraintAdapterFactory = (luvio) => {
357
- return function patchUpdateConstraint(untrustedConfig) {
358
- const config = validateAdapterConfig$1(untrustedConfig, patchUpdateConstraint_ConfigPropertyNames);
370
+ const createConstraintVersionAdapterFactory = (luvio) => {
371
+ return function createConstraintVersion(untrustedConfig) {
372
+ const config = validateAdapterConfig$2(untrustedConfig, createConstraintVersion_ConfigPropertyNames);
359
373
  // Invalid or incomplete config
360
374
  if (config === null) {
361
- throw new Error('Invalid config for "patchUpdateConstraint"');
375
+ throw new Error('Invalid config for "createConstraintVersion"');
362
376
  }
363
- return buildNetworkSnapshot$1(luvio, config);
377
+ return buildNetworkSnapshot$2(luvio, config);
364
378
  };
365
379
  };
366
380
 
367
- const TTL = 1000;
368
- const VERSION = "76516fe771fad46e2555a4f24b577b13";
369
- function validate(obj, path = 'ViewConstraintOutputRepresentation') {
381
+ const TTL$1 = 1000;
382
+ const VERSION$1 = "77293f36036fd711f0617fb4a5f21057";
383
+ function validate$1(obj, path = 'ConstraintVersionOutputRepresentation') {
370
384
  const v_error = (() => {
371
385
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
372
386
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -389,62 +403,62 @@ function validate(obj, path = 'ViewConstraintOutputRepresentation') {
389
403
  })();
390
404
  return v_error === undefined ? null : v_error;
391
405
  }
392
- const RepresentationType = 'ViewConstraintOutputRepresentation';
393
- function normalize(input, existing, path, luvio, store, timestamp) {
406
+ const RepresentationType$1 = 'ConstraintVersionOutputRepresentation';
407
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
394
408
  return input;
395
409
  }
396
- const select$1 = function ViewConstraintOutputRepresentationSelect() {
410
+ const select$3 = function ConstraintVersionOutputRepresentationSelect() {
397
411
  return {
398
412
  kind: 'Fragment',
399
- version: VERSION,
413
+ version: VERSION$1,
400
414
  private: [],
401
415
  opaque: true
402
416
  };
403
417
  };
404
- function equals(existing, incoming) {
418
+ function equals$1(existing, incoming) {
405
419
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
406
420
  return false;
407
421
  }
408
422
  return true;
409
423
  }
410
- const ingest = function ViewConstraintOutputRepresentationIngest(input, path, luvio, store, timestamp) {
424
+ const ingest$1 = function ConstraintVersionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
411
425
  if (process.env.NODE_ENV !== 'production') {
412
- const validateError = validate(input);
426
+ const validateError = validate$1(input);
413
427
  if (validateError !== null) {
414
428
  throw validateError;
415
429
  }
416
430
  }
417
431
  const key = path.fullPath;
418
- const ttlToUse = TTL;
419
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "constraints", VERSION, RepresentationType, equals);
432
+ const ttlToUse = TTL$1;
433
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "constraints", VERSION$1, RepresentationType$1, equals$1);
420
434
  return createLink(key);
421
435
  };
422
- function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
436
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
423
437
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
424
438
  const rootKey = fullPathFactory();
425
439
  rootKeySet.set(rootKey, {
426
440
  namespace: keyPrefix,
427
- representationName: RepresentationType,
441
+ representationName: RepresentationType$1,
428
442
  mergeable: false
429
443
  });
430
444
  }
431
445
 
432
- function select(luvio, params) {
433
- return select$1();
446
+ function select$2(luvio, params) {
447
+ return select$3();
434
448
  }
435
- function keyBuilder$1(luvio, params) {
436
- return keyPrefix + '::ViewConstraintOutputRepresentation:(' + 'expressionSetDefinitionVersionId:' + params.urlParams.expressionSetDefinitionVersionId + ')';
449
+ function keyBuilder$2(luvio, params) {
450
+ return keyPrefix + '::ConstraintVersionOutputRepresentation:(' + 'expressionSetId:' + params.urlParams.expressionSetId + ',' + 'expressionSetVersionId:' + params.urlParams.expressionSetVersionId + ')';
437
451
  }
438
- function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
439
- getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
452
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
453
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$2(luvio, resourceParams));
440
454
  }
441
- function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
455
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
442
456
  const { body } = response;
443
- const key = keyBuilder$1(luvio, resourceParams);
444
- luvio.storeIngest(key, ingest, body);
457
+ const key = keyBuilder$2(luvio, resourceParams);
458
+ luvio.storeIngest(key, ingest$1, body);
445
459
  const snapshot = luvio.storeLookup({
446
460
  recordId: key,
447
- node: select(),
461
+ node: select$2(),
448
462
  variables: {},
449
463
  }, snapshotRefresh);
450
464
  if (process.env.NODE_ENV !== 'production') {
@@ -456,22 +470,22 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
456
470
  return snapshot;
457
471
  }
458
472
  function ingestError(luvio, params, error, snapshotRefresh) {
459
- const key = keyBuilder$1(luvio, params);
473
+ const key = keyBuilder$2(luvio, params);
460
474
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
461
475
  const storeMetadataParams = {
462
- ttl: TTL,
476
+ ttl: TTL$1,
463
477
  namespace: keyPrefix,
464
- version: VERSION,
465
- representationName: RepresentationType
478
+ version: VERSION$1,
479
+ representationName: RepresentationType$1
466
480
  };
467
481
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
468
482
  return errorSnapshot;
469
483
  }
470
- function createResourceRequest(config) {
484
+ function createResourceRequest$1(config) {
471
485
  const headers = {};
472
486
  return {
473
487
  baseUri: '/services/data/v62.0',
474
- basePath: '/constraint/actions/' + config.urlParams.expressionSetDefinitionVersionId + '/view',
488
+ basePath: '/industries/constraints/' + config.urlParams.expressionSetId + '/versions/' + config.urlParams.expressionSetVersionId + '',
475
489
  method: 'get',
476
490
  body: null,
477
491
  urlParams: config.urlParams,
@@ -481,60 +495,61 @@ function createResourceRequest(config) {
481
495
  };
482
496
  }
483
497
 
484
- const adapterName = 'getViewConstraint';
485
- const getViewConstraint_ConfigPropertyMetadata = [
486
- generateParamConfigMetadata('expressionSetDefinitionVersionId', true, 0 /* UrlParameter */, 0 /* String */),
498
+ const adapterName$1 = 'getConstraintVersion';
499
+ const getConstraintVersion_ConfigPropertyMetadata = [
500
+ generateParamConfigMetadata('expressionSetId', true, 0 /* UrlParameter */, 0 /* String */),
501
+ generateParamConfigMetadata('expressionSetVersionId', true, 0 /* UrlParameter */, 0 /* String */),
487
502
  ];
488
- const getViewConstraint_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getViewConstraint_ConfigPropertyMetadata);
489
- const createResourceParams = /*#__PURE__*/ createResourceParams$2(getViewConstraint_ConfigPropertyMetadata);
490
- function keyBuilder(luvio, config) {
491
- const resourceParams = createResourceParams(config);
492
- return keyBuilder$1(luvio, resourceParams);
503
+ const getConstraintVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getConstraintVersion_ConfigPropertyMetadata);
504
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(getConstraintVersion_ConfigPropertyMetadata);
505
+ function keyBuilder$1(luvio, config) {
506
+ const resourceParams = createResourceParams$1(config);
507
+ return keyBuilder$2(luvio, resourceParams);
493
508
  }
494
- function typeCheckConfig(untrustedConfig) {
509
+ function typeCheckConfig$1(untrustedConfig) {
495
510
  const config = {};
496
- typeCheckConfig$2(untrustedConfig, config, getViewConstraint_ConfigPropertyMetadata);
511
+ typeCheckConfig$3(untrustedConfig, config, getConstraintVersion_ConfigPropertyMetadata);
497
512
  return config;
498
513
  }
499
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
514
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
500
515
  if (!untrustedIsObject(untrustedConfig)) {
501
516
  return null;
502
517
  }
503
518
  if (process.env.NODE_ENV !== 'production') {
504
519
  validateConfig(untrustedConfig, configPropertyNames);
505
520
  }
506
- const config = typeCheckConfig(untrustedConfig);
521
+ const config = typeCheckConfig$1(untrustedConfig);
507
522
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
508
523
  return null;
509
524
  }
510
525
  return config;
511
526
  }
512
527
  function adapterFragment(luvio, config) {
513
- createResourceParams(config);
514
- return select();
528
+ createResourceParams$1(config);
529
+ return select$2();
515
530
  }
516
531
  function onFetchResponseSuccess(luvio, config, resourceParams, response) {
517
- const snapshot = ingestSuccess(luvio, resourceParams, response, {
532
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
518
533
  config,
519
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
534
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
520
535
  });
521
536
  return luvio.storeBroadcast().then(() => snapshot);
522
537
  }
523
538
  function onFetchResponseError(luvio, config, resourceParams, response) {
524
539
  const snapshot = ingestError(luvio, resourceParams, response, {
525
540
  config,
526
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
541
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
527
542
  });
528
543
  return luvio.storeBroadcast().then(() => snapshot);
529
544
  }
530
- function buildNetworkSnapshot(luvio, config, options) {
531
- const resourceParams = createResourceParams(config);
532
- const request = createResourceRequest(resourceParams);
545
+ function buildNetworkSnapshot$1(luvio, config, options) {
546
+ const resourceParams = createResourceParams$1(config);
547
+ const request = createResourceRequest$1(resourceParams);
533
548
  return luvio.dispatchResourceRequest(request, options)
534
549
  .then((response) => {
535
550
  return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
536
551
  const cache = new StoreKeyMap();
537
- getResponseCacheKeys(cache, luvio, resourceParams, response.body);
552
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
538
553
  return cache;
539
554
  });
540
555
  }, (response) => {
@@ -542,23 +557,23 @@ function buildNetworkSnapshot(luvio, config, options) {
542
557
  });
543
558
  }
544
559
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
545
- return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
560
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
546
561
  }
547
562
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
548
563
  const { luvio, config } = context;
549
564
  const selector = {
550
- recordId: keyBuilder(luvio, config),
565
+ recordId: keyBuilder$1(luvio, config),
551
566
  node: adapterFragment(luvio, config),
552
567
  variables: {},
553
568
  };
554
569
  const cacheSnapshot = storeLookup(selector, {
555
570
  config,
556
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
571
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
557
572
  });
558
573
  return cacheSnapshot;
559
574
  }
560
- const getViewConstraintAdapterFactory = (luvio) => function constraints__getViewConstraint(untrustedConfig, requestContext) {
561
- const config = validateAdapterConfig(untrustedConfig, getViewConstraint_ConfigPropertyNames);
575
+ const getConstraintVersionAdapterFactory = (luvio) => function constraints__getConstraintVersion(untrustedConfig, requestContext) {
576
+ const config = validateAdapterConfig$1(untrustedConfig, getConstraintVersion_ConfigPropertyNames);
562
577
  // Invalid or incomplete config
563
578
  if (config === null) {
564
579
  return null;
@@ -567,4 +582,217 @@ const getViewConstraintAdapterFactory = (luvio) => function constraints__getView
567
582
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
568
583
  };
569
584
 
570
- export { getViewConstraintAdapterFactory, patchUpdateConstraintAdapterFactory };
585
+ const TTL = 1000;
586
+ const VERSION = "b590e58041197454c14f0163a2fc28e3";
587
+ function validate(obj, path = 'UpdateConstraintVersionOutputRepresentation') {
588
+ const v_error = (() => {
589
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
590
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
591
+ }
592
+ const obj_errors = obj.errors;
593
+ const path_errors = path + '.errors';
594
+ if (!ArrayIsArray(obj_errors)) {
595
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
596
+ }
597
+ for (let i = 0; i < obj_errors.length; i++) {
598
+ const obj_errors_item = obj_errors[i];
599
+ const path_errors_item = path_errors + '[' + i + ']';
600
+ if (typeof obj_errors_item !== 'object') {
601
+ return new TypeError('Expected "object" but received "' + typeof obj_errors_item + '" (at "' + path_errors_item + '")');
602
+ }
603
+ }
604
+ const obj_success = obj.success;
605
+ const path_success = path + '.success';
606
+ if (typeof obj_success !== 'boolean') {
607
+ return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
608
+ }
609
+ })();
610
+ return v_error === undefined ? null : v_error;
611
+ }
612
+ const RepresentationType = 'UpdateConstraintVersionOutputRepresentation';
613
+ function keyBuilder(luvio, config) {
614
+ return keyPrefix + '::' + RepresentationType + ':' + config.success;
615
+ }
616
+ function keyBuilderFromType(luvio, object) {
617
+ const keyParams = {
618
+ success: object.success
619
+ };
620
+ return keyBuilder(luvio, keyParams);
621
+ }
622
+ function normalize(input, existing, path, luvio, store, timestamp) {
623
+ const input_errors = input.errors;
624
+ const input_errors_id = path.fullPath + '__errors';
625
+ for (let i = 0; i < input_errors.length; i++) {
626
+ const input_errors_item = input_errors[i];
627
+ let input_errors_item_id = input_errors_id + '__' + i;
628
+ input_errors[i] = ingest$3(input_errors_item, {
629
+ fullPath: input_errors_item_id,
630
+ propertyName: i,
631
+ parent: {
632
+ data: input,
633
+ key: path.fullPath,
634
+ existing: existing,
635
+ },
636
+ ttl: path.ttl
637
+ }, luvio, store, timestamp);
638
+ }
639
+ return input;
640
+ }
641
+ const select$1 = function UpdateConstraintVersionOutputRepresentationSelect() {
642
+ return {
643
+ kind: 'Fragment',
644
+ version: VERSION,
645
+ private: [],
646
+ selections: [
647
+ {
648
+ name: 'errors',
649
+ kind: 'Link',
650
+ plural: true,
651
+ fragment: select$6()
652
+ },
653
+ {
654
+ name: 'success',
655
+ kind: 'Scalar'
656
+ }
657
+ ]
658
+ };
659
+ };
660
+ function equals(existing, incoming) {
661
+ const existing_success = existing.success;
662
+ const incoming_success = incoming.success;
663
+ if (!(existing_success === incoming_success)) {
664
+ return false;
665
+ }
666
+ const existing_errors = existing.errors;
667
+ const incoming_errors = incoming.errors;
668
+ const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
669
+ if (!(existing_errors_item.__ref === incoming_errors_item.__ref)) {
670
+ return false;
671
+ }
672
+ });
673
+ if (equals_errors_items === false) {
674
+ return false;
675
+ }
676
+ return true;
677
+ }
678
+ const ingest = function UpdateConstraintVersionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
679
+ if (process.env.NODE_ENV !== 'production') {
680
+ const validateError = validate(input);
681
+ if (validateError !== null) {
682
+ throw validateError;
683
+ }
684
+ }
685
+ const key = keyBuilderFromType(luvio, input);
686
+ const ttlToUse = TTL;
687
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "constraints", VERSION, RepresentationType, equals);
688
+ return createLink(key);
689
+ };
690
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
691
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
692
+ const rootKey = keyBuilderFromType(luvio, input);
693
+ rootKeySet.set(rootKey, {
694
+ namespace: keyPrefix,
695
+ representationName: RepresentationType,
696
+ mergeable: false
697
+ });
698
+ const input_errors_length = input.errors.length;
699
+ for (let i = 0; i < input_errors_length; i++) {
700
+ getTypeCacheKeys$3(rootKeySet, luvio, input.errors[i], () => '');
701
+ }
702
+ }
703
+
704
+ function select(luvio, params) {
705
+ return select$1();
706
+ }
707
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
708
+ getTypeCacheKeys(storeKeyMap, luvio, response);
709
+ }
710
+ function ingestSuccess(luvio, resourceParams, response) {
711
+ const { body } = response;
712
+ const key = keyBuilderFromType(luvio, body);
713
+ luvio.storeIngest(key, ingest, body);
714
+ const snapshot = luvio.storeLookup({
715
+ recordId: key,
716
+ node: select(),
717
+ variables: {},
718
+ });
719
+ if (process.env.NODE_ENV !== 'production') {
720
+ if (snapshot.state !== 'Fulfilled') {
721
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
722
+ }
723
+ }
724
+ deepFreeze(snapshot.data);
725
+ return snapshot;
726
+ }
727
+ function createResourceRequest(config) {
728
+ const headers = {};
729
+ return {
730
+ baseUri: '/services/data/v62.0',
731
+ basePath: '/industries/constraints/' + config.urlParams.expressionSetId + '/versions/' + config.urlParams.expressionSetVersionId + '',
732
+ method: 'patch',
733
+ body: config.body,
734
+ urlParams: config.urlParams,
735
+ queryParams: {},
736
+ headers,
737
+ priority: 'normal',
738
+ };
739
+ }
740
+
741
+ const adapterName = 'updateConstraintVersion';
742
+ const updateConstraintVersion_ConfigPropertyMetadata = [
743
+ generateParamConfigMetadata('expressionSetId', true, 0 /* UrlParameter */, 0 /* String */),
744
+ generateParamConfigMetadata('expressionSetVersionId', true, 0 /* UrlParameter */, 0 /* String */),
745
+ generateParamConfigMetadata('constraintModel', false, 2 /* Body */, 0 /* String */),
746
+ generateParamConfigMetadata('description', false, 2 /* Body */, 0 /* String */),
747
+ generateParamConfigMetadata('status', false, 2 /* Body */, 0 /* String */),
748
+ ];
749
+ const updateConstraintVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updateConstraintVersion_ConfigPropertyMetadata);
750
+ const createResourceParams = /*#__PURE__*/ createResourceParams$3(updateConstraintVersion_ConfigPropertyMetadata);
751
+ function typeCheckConfig(untrustedConfig) {
752
+ const config = {};
753
+ typeCheckConfig$3(untrustedConfig, config, updateConstraintVersion_ConfigPropertyMetadata);
754
+ return config;
755
+ }
756
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
757
+ if (!untrustedIsObject(untrustedConfig)) {
758
+ return null;
759
+ }
760
+ if (process.env.NODE_ENV !== 'production') {
761
+ validateConfig(untrustedConfig, configPropertyNames);
762
+ }
763
+ const config = typeCheckConfig(untrustedConfig);
764
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
765
+ return null;
766
+ }
767
+ return config;
768
+ }
769
+ function buildNetworkSnapshot(luvio, config, options) {
770
+ const resourceParams = createResourceParams(config);
771
+ const request = createResourceRequest(resourceParams);
772
+ return luvio.dispatchResourceRequest(request, options)
773
+ .then((response) => {
774
+ return luvio.handleSuccessResponse(() => {
775
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
776
+ return luvio.storeBroadcast().then(() => snapshot);
777
+ }, () => {
778
+ const cache = new StoreKeyMap();
779
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
780
+ return cache;
781
+ });
782
+ }, (response) => {
783
+ deepFreeze(response);
784
+ throw response;
785
+ });
786
+ }
787
+ const updateConstraintVersionAdapterFactory = (luvio) => {
788
+ return function updateConstraintVersion(untrustedConfig) {
789
+ const config = validateAdapterConfig(untrustedConfig, updateConstraintVersion_ConfigPropertyNames);
790
+ // Invalid or incomplete config
791
+ if (config === null) {
792
+ throw new Error('Invalid config for "updateConstraintVersion"');
793
+ }
794
+ return buildNetworkSnapshot(luvio, config);
795
+ };
796
+ };
797
+
798
+ export { createConstraintVersionAdapterFactory, getConstraintVersionAdapterFactory, updateConstraintVersionAdapterFactory };