@salesforce/lds-adapters-service-einsteinllm 1.380.0-dev1 → 1.380.0-dev11

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 (40) hide show
  1. package/dist/es/es2018/service-einsteinllm.js +2234 -491
  2. package/dist/es/es2018/types/src/generated/adapters/createPromptTemplate.d.ts +2 -3
  3. package/dist/es/es2018/types/src/generated/adapters/createPromptTemplateVersion.d.ts +2 -3
  4. package/dist/es/es2018/types/src/generated/adapters/getDataProviderInstanceConfig.d.ts +31 -0
  5. package/dist/es/es2018/types/src/generated/adapters/getDataProviderTypeConfigs.d.ts +27 -0
  6. package/dist/es/es2018/types/src/generated/adapters/getDataProviders.d.ts +29 -0
  7. package/dist/es/es2018/types/src/generated/adapters/getInputMappedDataProviders.d.ts +30 -0
  8. package/dist/es/es2018/types/src/generated/adapters/getPromptTemplateVersion.d.ts +30 -0
  9. package/dist/es/es2018/types/src/generated/adapters/getPromptTemplateVersions.d.ts +29 -0
  10. package/dist/es/es2018/types/src/generated/adapters/putEinsteinPromptTemplateVersionStatus.d.ts +18 -0
  11. package/dist/es/es2018/types/src/generated/adapters/updatePromptTemplateVersion.d.ts +2 -3
  12. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +7 -0
  13. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +14 -1
  14. package/dist/es/es2018/types/src/generated/resources/getEinsteinPromptTemplatesDataProviderTypesByTemplateType.d.ts +15 -0
  15. package/dist/es/es2018/types/src/generated/resources/getEinsteinPromptTemplatesDataProvidersByTemplateType.d.ts +19 -0
  16. package/dist/es/es2018/types/src/generated/resources/getEinsteinPromptTemplatesVersionsByPromptTemplateDevName.d.ts +19 -0
  17. package/dist/es/es2018/types/src/generated/resources/getEinsteinPromptTemplatesVersionsByPromptTemplateDevNameAndVersionId.d.ts +20 -0
  18. package/dist/es/es2018/types/src/generated/resources/postEinsteinPromptTemplates.d.ts +2 -3
  19. package/dist/es/es2018/types/src/generated/resources/postEinsteinPromptTemplatesDataProviderDescribe.d.ts +19 -0
  20. package/dist/es/es2018/types/src/generated/resources/postEinsteinPromptTemplatesDataProvidersMapped.d.ts +18 -0
  21. package/dist/es/es2018/types/src/generated/resources/postEinsteinPromptTemplatesVersionsByPromptTemplateDevName.d.ts +2 -3
  22. package/dist/es/es2018/types/src/generated/resources/putEinsteinPromptTemplatesVersionsByPromptTemplateDevNameAndVersionId.d.ts +2 -3
  23. package/dist/es/es2018/types/src/generated/resources/putEinsteinPromptTemplatesVersionsStatusByPromptTemplateDevNameAndVersionId.d.ts +17 -0
  24. package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationCitationRepresentation.d.ts +29 -0
  25. package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationGenAiCitedReferenceRepresentation.d.ts +40 -0
  26. package/dist/es/es2018/types/src/generated/types/EinsteinPromptRecordInputRepresentation.d.ts +5 -8
  27. package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateGenerationsRepresentation.d.ts +7 -1
  28. package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderDiscoveryInputRepresentation.d.ts +37 -0
  29. package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderInputParamRepresentation.d.ts +37 -0
  30. package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderInstanceConfigCollectionRepresentation.d.ts +30 -0
  31. package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderInstanceConfigInputRepresentation.d.ts +38 -0
  32. package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderInstanceConfigRepresentation.d.ts +77 -0
  33. package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderOutputParamRepresentation.d.ts +34 -0
  34. package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderTypeConfigCollectionRepresentation.d.ts +30 -0
  35. package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderTypeConfigRepresentation.d.ts +46 -0
  36. package/dist/es/es2018/types/src/generated/types/WrappedMap.d.ts +3 -3
  37. package/package.json +4 -4
  38. package/sfdc/index.js +2496 -682
  39. package/src/raml/api.raml +365 -10
  40. package/src/raml/luvio.raml +44 -0
@@ -4,7 +4,7 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$4, StoreKeyMap, createResourceParams as createResourceParams$a, typeCheckConfig as typeCheckConfig$a } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$a, StoreKeyMap, createResourceParams as createResourceParams$h, typeCheckConfig as typeCheckConfig$h } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
@@ -168,7 +168,7 @@ function createLink(ref) {
168
168
  };
169
169
  }
170
170
 
171
- function validate$t(obj, path = 'EinsteinLlmEmbeddingsAdditionalConfigInputRepresentation') {
171
+ function validate$B(obj, path = 'EinsteinLlmEmbeddingsAdditionalConfigInputRepresentation') {
172
172
  const v_error = (() => {
173
173
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
174
174
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -212,7 +212,7 @@ function validate$t(obj, path = 'EinsteinLlmEmbeddingsAdditionalConfigInputRepre
212
212
  return v_error === undefined ? null : v_error;
213
213
  }
214
214
 
215
- function validate$s(obj, path = 'WrappedListString') {
215
+ function validate$A(obj, path = 'WrappedListString') {
216
216
  const v_error = (() => {
217
217
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
218
218
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -233,14 +233,14 @@ function validate$s(obj, path = 'WrappedListString') {
233
233
  return v_error === undefined ? null : v_error;
234
234
  }
235
235
 
236
- function validate$r(obj, path = 'EinsteinLlmEmbeddingsInputRepresentation') {
236
+ function validate$z(obj, path = 'EinsteinLlmEmbeddingsInputRepresentation') {
237
237
  const v_error = (() => {
238
238
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
239
239
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
240
240
  }
241
241
  const obj_additionalConfig = obj.additionalConfig;
242
242
  const path_additionalConfig = path + '.additionalConfig';
243
- const referencepath_additionalConfigValidationError = validate$t(obj_additionalConfig, path_additionalConfig);
243
+ const referencepath_additionalConfigValidationError = validate$B(obj_additionalConfig, path_additionalConfig);
244
244
  if (referencepath_additionalConfigValidationError !== null) {
245
245
  let message = 'Object doesn\'t match EinsteinLlmEmbeddingsAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
246
246
  message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -248,7 +248,7 @@ function validate$r(obj, path = 'EinsteinLlmEmbeddingsInputRepresentation') {
248
248
  }
249
249
  const obj_prompts = obj.prompts;
250
250
  const path_prompts = path + '.prompts';
251
- const referencepath_promptsValidationError = validate$s(obj_prompts, path_prompts);
251
+ const referencepath_promptsValidationError = validate$A(obj_prompts, path_prompts);
252
252
  if (referencepath_promptsValidationError !== null) {
253
253
  let message = 'Object doesn\'t match WrappedListString (at "' + path_prompts + '")\n';
254
254
  message += referencepath_promptsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -265,8 +265,8 @@ function validate$r(obj, path = 'EinsteinLlmEmbeddingsInputRepresentation') {
265
265
  return v_error === undefined ? null : v_error;
266
266
  }
267
267
 
268
- const VERSION$k = "5ed5ccc6fa6f15691ec0fc1080e41fe6";
269
- function validate$q(obj, path = 'EinsteinLlmEmbeddingItemRepresentation') {
268
+ const VERSION$p = "5ed5ccc6fa6f15691ec0fc1080e41fe6";
269
+ function validate$y(obj, path = 'EinsteinLlmEmbeddingItemRepresentation') {
270
270
  const v_error = (() => {
271
271
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
272
272
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -287,10 +287,10 @@ function validate$q(obj, path = 'EinsteinLlmEmbeddingItemRepresentation') {
287
287
  })();
288
288
  return v_error === undefined ? null : v_error;
289
289
  }
290
- const select$u = function EinsteinLlmEmbeddingItemRepresentationSelect() {
290
+ const select$G = function EinsteinLlmEmbeddingItemRepresentationSelect() {
291
291
  return {
292
292
  kind: 'Fragment',
293
- version: VERSION$k,
293
+ version: VERSION$p,
294
294
  private: [],
295
295
  selections: [
296
296
  {
@@ -305,7 +305,7 @@ const select$u = function EinsteinLlmEmbeddingItemRepresentationSelect() {
305
305
  ]
306
306
  };
307
307
  };
308
- function equals$k(existing, incoming) {
308
+ function equals$p(existing, incoming) {
309
309
  const existing_index = existing.index;
310
310
  const incoming_index = incoming.index;
311
311
  if (!(existing_index === incoming_index)) {
@@ -324,9 +324,9 @@ function equals$k(existing, incoming) {
324
324
  return true;
325
325
  }
326
326
 
327
- const TTL$7 = 100;
328
- const VERSION$j = "d9873651f09d29764ef4d4231eb653d7";
329
- function validate$p(obj, path = 'EinsteinLlmEmbeddingsRepresentation') {
327
+ const TTL$a = 100;
328
+ const VERSION$o = "d9873651f09d29764ef4d4231eb653d7";
329
+ function validate$x(obj, path = 'EinsteinLlmEmbeddingsRepresentation') {
330
330
  const v_error = (() => {
331
331
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
332
332
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -339,7 +339,7 @@ function validate$p(obj, path = 'EinsteinLlmEmbeddingsRepresentation') {
339
339
  for (let i = 0; i < obj_embeddings.length; i++) {
340
340
  const obj_embeddings_item = obj_embeddings[i];
341
341
  const path_embeddings_item = path_embeddings + '[' + i + ']';
342
- const referencepath_embeddings_itemValidationError = validate$q(obj_embeddings_item, path_embeddings_item);
342
+ const referencepath_embeddings_itemValidationError = validate$y(obj_embeddings_item, path_embeddings_item);
343
343
  if (referencepath_embeddings_itemValidationError !== null) {
344
344
  let message = 'Object doesn\'t match EinsteinLlmEmbeddingItemRepresentation (at "' + path_embeddings_item + '")\n';
345
345
  message += referencepath_embeddings_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -363,15 +363,15 @@ function validate$p(obj, path = 'EinsteinLlmEmbeddingsRepresentation') {
363
363
  })();
364
364
  return v_error === undefined ? null : v_error;
365
365
  }
366
- const RepresentationType$7 = 'EinsteinLlmEmbeddingsRepresentation';
367
- function normalize$7(input, existing, path, luvio, store, timestamp) {
366
+ const RepresentationType$a = 'EinsteinLlmEmbeddingsRepresentation';
367
+ function normalize$a(input, existing, path, luvio, store, timestamp) {
368
368
  return input;
369
369
  }
370
- const select$t = function EinsteinLlmEmbeddingsRepresentationSelect() {
371
- const { selections: EinsteinLlmEmbeddingItemRepresentation__selections, opaque: EinsteinLlmEmbeddingItemRepresentation__opaque, } = select$u();
370
+ const select$F = function EinsteinLlmEmbeddingsRepresentationSelect() {
371
+ const { selections: EinsteinLlmEmbeddingItemRepresentation__selections, opaque: EinsteinLlmEmbeddingItemRepresentation__opaque, } = select$G();
372
372
  return {
373
373
  kind: 'Fragment',
374
- version: VERSION$j,
374
+ version: VERSION$o,
375
375
  private: [],
376
376
  selections: [
377
377
  {
@@ -388,11 +388,11 @@ const select$t = function EinsteinLlmEmbeddingsRepresentationSelect() {
388
388
  ]
389
389
  };
390
390
  };
391
- function equals$j(existing, incoming) {
391
+ function equals$o(existing, incoming) {
392
392
  const existing_embeddings = existing.embeddings;
393
393
  const incoming_embeddings = incoming.embeddings;
394
394
  const equals_embeddings_items = equalsArray(existing_embeddings, incoming_embeddings, (existing_embeddings_item, incoming_embeddings_item) => {
395
- if (!(equals$k(existing_embeddings_item, incoming_embeddings_item))) {
395
+ if (!(equals$p(existing_embeddings_item, incoming_embeddings_item))) {
396
396
  return false;
397
397
  }
398
398
  });
@@ -411,44 +411,44 @@ function equals$j(existing, incoming) {
411
411
  }
412
412
  return true;
413
413
  }
414
- const ingest$7 = function EinsteinLlmEmbeddingsRepresentationIngest(input, path, luvio, store, timestamp) {
414
+ const ingest$a = function EinsteinLlmEmbeddingsRepresentationIngest(input, path, luvio, store, timestamp) {
415
415
  if (process.env.NODE_ENV !== 'production') {
416
- const validateError = validate$p(input);
416
+ const validateError = validate$x(input);
417
417
  if (validateError !== null) {
418
418
  throw validateError;
419
419
  }
420
420
  }
421
421
  const key = path.fullPath;
422
- const ttlToUse = TTL$7;
423
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$7, "EinsteinLLM", VERSION$j, RepresentationType$7, equals$j);
422
+ const ttlToUse = TTL$a;
423
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$a, "EinsteinLLM", VERSION$o, RepresentationType$a, equals$o);
424
424
  return createLink(key);
425
425
  };
426
- function getTypeCacheKeys$7(rootKeySet, luvio, input, fullPathFactory) {
426
+ function getTypeCacheKeys$a(rootKeySet, luvio, input, fullPathFactory) {
427
427
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
428
428
  const rootKey = fullPathFactory();
429
429
  rootKeySet.set(rootKey, {
430
430
  namespace: keyPrefix,
431
- representationName: RepresentationType$7,
431
+ representationName: RepresentationType$a,
432
432
  mergeable: false
433
433
  });
434
434
  }
435
435
 
436
- function select$s(luvio, params) {
437
- return select$t();
436
+ function select$E(luvio, params) {
437
+ return select$F();
438
438
  }
439
- function keyBuilder$b(luvio, params) {
439
+ function keyBuilder$n(luvio, params) {
440
440
  return keyPrefix + '::EinsteinLlmEmbeddingsRepresentation:(' + stableJSONStringify(params.body.embeddingsInput.additionalConfig.additionalParameters) + '::' + 'embeddingsInput.additionalConfig.applicationName:' + params.body.embeddingsInput.additionalConfig.applicationName + '::' + (params.body.embeddingsInput.additionalConfig.enablePiiMasking === undefined ? 'embeddingsInput.additionalConfig.enablePiiMasking' : 'embeddingsInput.additionalConfig.enablePiiMasking:' + params.body.embeddingsInput.additionalConfig.enablePiiMasking) + '::' + (params.body.embeddingsInput.additionalConfig.model === undefined ? 'embeddingsInput.additionalConfig.model' : 'embeddingsInput.additionalConfig.model:' + params.body.embeddingsInput.additionalConfig.model) + '::' + 'embeddingsInput.prompts.wrappedListString:' + params.body.embeddingsInput.prompts.wrappedListString + '::' + (params.body.embeddingsInput.provider === undefined ? 'embeddingsInput.provider' : 'embeddingsInput.provider:' + params.body.embeddingsInput.provider) + ')';
441
441
  }
442
- function getResponseCacheKeys$9(storeKeyMap, luvio, resourceParams, response) {
443
- getTypeCacheKeys$7(storeKeyMap, luvio, response, () => keyBuilder$b(luvio, resourceParams));
442
+ function getResponseCacheKeys$g(storeKeyMap, luvio, resourceParams, response) {
443
+ getTypeCacheKeys$a(storeKeyMap, luvio, response, () => keyBuilder$n(luvio, resourceParams));
444
444
  }
445
- function ingestSuccess$9(luvio, resourceParams, response, snapshotRefresh) {
445
+ function ingestSuccess$g(luvio, resourceParams, response, snapshotRefresh) {
446
446
  const { body } = response;
447
- const key = keyBuilder$b(luvio, resourceParams);
448
- luvio.storeIngest(key, ingest$7, body);
447
+ const key = keyBuilder$n(luvio, resourceParams);
448
+ luvio.storeIngest(key, ingest$a, body);
449
449
  const snapshot = luvio.storeLookup({
450
450
  recordId: key,
451
- node: select$s(),
451
+ node: select$E(),
452
452
  variables: {},
453
453
  }, snapshotRefresh);
454
454
  if (process.env.NODE_ENV !== 'production') {
@@ -459,19 +459,19 @@ function ingestSuccess$9(luvio, resourceParams, response, snapshotRefresh) {
459
459
  deepFreeze(snapshot.data);
460
460
  return snapshot;
461
461
  }
462
- function ingestError$3(luvio, params, error, snapshotRefresh) {
463
- const key = keyBuilder$b(luvio, params);
462
+ function ingestError$9(luvio, params, error, snapshotRefresh) {
463
+ const key = keyBuilder$n(luvio, params);
464
464
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
465
465
  const storeMetadataParams = {
466
- ttl: TTL$7,
466
+ ttl: TTL$a,
467
467
  namespace: keyPrefix,
468
- version: VERSION$j,
469
- representationName: RepresentationType$7
468
+ version: VERSION$o,
469
+ representationName: RepresentationType$a
470
470
  };
471
471
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
472
472
  return errorSnapshot;
473
473
  }
474
- function createResourceRequest$9(config) {
474
+ function createResourceRequest$g(config) {
475
475
  const headers = {};
476
476
  return {
477
477
  baseUri: '/services/data/v65.0',
@@ -485,97 +485,97 @@ function createResourceRequest$9(config) {
485
485
  };
486
486
  }
487
487
 
488
- const adapterName$9 = 'createEmbeddings';
488
+ const adapterName$g = 'createEmbeddings';
489
489
  const createEmbeddings_ConfigPropertyMetadata = [
490
490
  generateParamConfigMetadata('embeddingsInput', true, 2 /* Body */, 4 /* Unsupported */),
491
491
  ];
492
- const createEmbeddings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$9, createEmbeddings_ConfigPropertyMetadata);
493
- const createResourceParams$9 = /*#__PURE__*/ createResourceParams$a(createEmbeddings_ConfigPropertyMetadata);
494
- function keyBuilder$a(luvio, config) {
495
- const resourceParams = createResourceParams$9(config);
496
- return keyBuilder$b(luvio, resourceParams);
492
+ const createEmbeddings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$g, createEmbeddings_ConfigPropertyMetadata);
493
+ const createResourceParams$g = /*#__PURE__*/ createResourceParams$h(createEmbeddings_ConfigPropertyMetadata);
494
+ function keyBuilder$m(luvio, config) {
495
+ const resourceParams = createResourceParams$g(config);
496
+ return keyBuilder$n(luvio, resourceParams);
497
497
  }
498
- function typeCheckConfig$9(untrustedConfig) {
498
+ function typeCheckConfig$g(untrustedConfig) {
499
499
  const config = {};
500
500
  const untrustedConfig_embeddingsInput = untrustedConfig.embeddingsInput;
501
- const referenceEinsteinLlmEmbeddingsInputRepresentationValidationError = validate$r(untrustedConfig_embeddingsInput);
501
+ const referenceEinsteinLlmEmbeddingsInputRepresentationValidationError = validate$z(untrustedConfig_embeddingsInput);
502
502
  if (referenceEinsteinLlmEmbeddingsInputRepresentationValidationError === null) {
503
503
  config.embeddingsInput = untrustedConfig_embeddingsInput;
504
504
  }
505
505
  return config;
506
506
  }
507
- function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
507
+ function validateAdapterConfig$g(untrustedConfig, configPropertyNames) {
508
508
  if (!untrustedIsObject(untrustedConfig)) {
509
509
  return null;
510
510
  }
511
511
  if (process.env.NODE_ENV !== 'production') {
512
512
  validateConfig(untrustedConfig, configPropertyNames);
513
513
  }
514
- const config = typeCheckConfig$9(untrustedConfig);
514
+ const config = typeCheckConfig$g(untrustedConfig);
515
515
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
516
516
  return null;
517
517
  }
518
518
  return config;
519
519
  }
520
- function adapterFragment$3(luvio, config) {
521
- createResourceParams$9(config);
522
- return select$s();
520
+ function adapterFragment$9(luvio, config) {
521
+ createResourceParams$g(config);
522
+ return select$E();
523
523
  }
524
- function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
525
- const snapshot = ingestSuccess$9(luvio, resourceParams, response, {
524
+ function onFetchResponseSuccess$9(luvio, config, resourceParams, response) {
525
+ const snapshot = ingestSuccess$g(luvio, resourceParams, response, {
526
526
  config,
527
- resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
527
+ resolve: () => buildNetworkSnapshot$g(luvio, config, snapshotRefreshOptions)
528
528
  });
529
529
  return luvio.storeBroadcast().then(() => snapshot);
530
530
  }
531
- function onFetchResponseError$3(luvio, config, resourceParams, response) {
532
- const snapshot = ingestError$3(luvio, resourceParams, response, {
531
+ function onFetchResponseError$9(luvio, config, resourceParams, response) {
532
+ const snapshot = ingestError$9(luvio, resourceParams, response, {
533
533
  config,
534
- resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
534
+ resolve: () => buildNetworkSnapshot$g(luvio, config, snapshotRefreshOptions)
535
535
  });
536
536
  return luvio.storeBroadcast().then(() => snapshot);
537
537
  }
538
- function buildNetworkSnapshot$9(luvio, config, options) {
539
- const resourceParams = createResourceParams$9(config);
540
- const request = createResourceRequest$9(resourceParams);
538
+ function buildNetworkSnapshot$g(luvio, config, options) {
539
+ const resourceParams = createResourceParams$g(config);
540
+ const request = createResourceRequest$g(resourceParams);
541
541
  return luvio.dispatchResourceRequest(request, options)
542
542
  .then((response) => {
543
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
543
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$9(luvio, config, resourceParams, response), () => {
544
544
  const cache = new StoreKeyMap();
545
- getResponseCacheKeys$9(cache, luvio, resourceParams, response.body);
545
+ getResponseCacheKeys$g(cache, luvio, resourceParams, response.body);
546
546
  return cache;
547
547
  });
548
548
  }, (response) => {
549
- return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
549
+ return luvio.handleErrorResponse(() => onFetchResponseError$9(luvio, config, resourceParams, response));
550
550
  });
551
551
  }
552
- function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
553
- return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$9, 'get', false);
552
+ function buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext) {
553
+ return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$g, 'get', false);
554
554
  }
555
- function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
555
+ function buildCachedSnapshotCachePolicy$9(context, storeLookup) {
556
556
  const { luvio, config } = context;
557
557
  const selector = {
558
- recordId: keyBuilder$a(luvio, config),
559
- node: adapterFragment$3(luvio, config),
558
+ recordId: keyBuilder$m(luvio, config),
559
+ node: adapterFragment$9(luvio, config),
560
560
  variables: {},
561
561
  };
562
562
  const cacheSnapshot = storeLookup(selector, {
563
563
  config,
564
- resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
564
+ resolve: () => buildNetworkSnapshot$g(luvio, config, snapshotRefreshOptions)
565
565
  });
566
566
  return cacheSnapshot;
567
567
  }
568
568
  const createEmbeddingsAdapterFactory = (luvio) => function EinsteinLLM__createEmbeddings(untrustedConfig, requestContext) {
569
- const config = validateAdapterConfig$9(untrustedConfig, createEmbeddings_ConfigPropertyNames);
569
+ const config = validateAdapterConfig$g(untrustedConfig, createEmbeddings_ConfigPropertyNames);
570
570
  // Invalid or incomplete config
571
571
  if (config === null) {
572
572
  return null;
573
573
  }
574
574
  return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
575
- buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
575
+ buildCachedSnapshotCachePolicy$9, buildNetworkSnapshotCachePolicy$9);
576
576
  };
577
577
 
578
- function validate$o(obj, path = 'EinsteinLlmFeedbackInputRepresentation') {
578
+ function validate$w(obj, path = 'EinsteinLlmFeedbackInputRepresentation') {
579
579
  const v_error = (() => {
580
580
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
581
581
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -622,9 +622,9 @@ function validate$o(obj, path = 'EinsteinLlmFeedbackInputRepresentation') {
622
622
  return v_error === undefined ? null : v_error;
623
623
  }
624
624
 
625
- const TTL$6 = 100;
626
- const VERSION$i = "4033328f65865dd5d80c68a7573a4522";
627
- function validate$n(obj, path = 'EinsteinLlmFeedbackRepresentation') {
625
+ const TTL$9 = 100;
626
+ const VERSION$n = "4033328f65865dd5d80c68a7573a4522";
627
+ function validate$v(obj, path = 'EinsteinLlmFeedbackRepresentation') {
628
628
  const v_error = (() => {
629
629
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
630
630
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -637,23 +637,23 @@ function validate$n(obj, path = 'EinsteinLlmFeedbackRepresentation') {
637
637
  })();
638
638
  return v_error === undefined ? null : v_error;
639
639
  }
640
- const RepresentationType$6 = 'EinsteinLlmFeedbackRepresentation';
641
- function keyBuilder$9(luvio, config) {
642
- return keyPrefix + '::' + RepresentationType$6 + ':' + config.message;
640
+ const RepresentationType$9 = 'EinsteinLlmFeedbackRepresentation';
641
+ function keyBuilder$l(luvio, config) {
642
+ return keyPrefix + '::' + RepresentationType$9 + ':' + config.message;
643
643
  }
644
644
  function keyBuilderFromType$3(luvio, object) {
645
645
  const keyParams = {
646
646
  message: object.message
647
647
  };
648
- return keyBuilder$9(luvio, keyParams);
648
+ return keyBuilder$l(luvio, keyParams);
649
649
  }
650
- function normalize$6(input, existing, path, luvio, store, timestamp) {
650
+ function normalize$9(input, existing, path, luvio, store, timestamp) {
651
651
  return input;
652
652
  }
653
- const select$r = function EinsteinLlmFeedbackRepresentationSelect() {
653
+ const select$D = function EinsteinLlmFeedbackRepresentationSelect() {
654
654
  return {
655
655
  kind: 'Fragment',
656
- version: VERSION$i,
656
+ version: VERSION$n,
657
657
  private: [],
658
658
  selections: [
659
659
  {
@@ -663,7 +663,7 @@ const select$r = function EinsteinLlmFeedbackRepresentationSelect() {
663
663
  ]
664
664
  };
665
665
  };
666
- function equals$i(existing, incoming) {
666
+ function equals$n(existing, incoming) {
667
667
  const existing_message = existing.message;
668
668
  const incoming_message = incoming.message;
669
669
  if (!(existing_message === incoming_message)) {
@@ -671,41 +671,41 @@ function equals$i(existing, incoming) {
671
671
  }
672
672
  return true;
673
673
  }
674
- const ingest$6 = function EinsteinLlmFeedbackRepresentationIngest(input, path, luvio, store, timestamp) {
674
+ const ingest$9 = function EinsteinLlmFeedbackRepresentationIngest(input, path, luvio, store, timestamp) {
675
675
  if (process.env.NODE_ENV !== 'production') {
676
- const validateError = validate$n(input);
676
+ const validateError = validate$v(input);
677
677
  if (validateError !== null) {
678
678
  throw validateError;
679
679
  }
680
680
  }
681
681
  const key = keyBuilderFromType$3(luvio, input);
682
- const ttlToUse = TTL$6;
683
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "EinsteinLLM", VERSION$i, RepresentationType$6, equals$i);
682
+ const ttlToUse = TTL$9;
683
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$9, "EinsteinLLM", VERSION$n, RepresentationType$9, equals$n);
684
684
  return createLink(key);
685
685
  };
686
- function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
686
+ function getTypeCacheKeys$9(rootKeySet, luvio, input, fullPathFactory) {
687
687
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
688
688
  const rootKey = keyBuilderFromType$3(luvio, input);
689
689
  rootKeySet.set(rootKey, {
690
690
  namespace: keyPrefix,
691
- representationName: RepresentationType$6,
691
+ representationName: RepresentationType$9,
692
692
  mergeable: false
693
693
  });
694
694
  }
695
695
 
696
- function select$q(luvio, params) {
697
- return select$r();
696
+ function select$C(luvio, params) {
697
+ return select$D();
698
698
  }
699
- function getResponseCacheKeys$8(storeKeyMap, luvio, resourceParams, response) {
700
- getTypeCacheKeys$6(storeKeyMap, luvio, response);
699
+ function getResponseCacheKeys$f(storeKeyMap, luvio, resourceParams, response) {
700
+ getTypeCacheKeys$9(storeKeyMap, luvio, response);
701
701
  }
702
- function ingestSuccess$8(luvio, resourceParams, response) {
702
+ function ingestSuccess$f(luvio, resourceParams, response) {
703
703
  const { body } = response;
704
704
  const key = keyBuilderFromType$3(luvio, body);
705
- luvio.storeIngest(key, ingest$6, body);
705
+ luvio.storeIngest(key, ingest$9, body);
706
706
  const snapshot = luvio.storeLookup({
707
707
  recordId: key,
708
- node: select$q(),
708
+ node: select$C(),
709
709
  variables: {},
710
710
  });
711
711
  if (process.env.NODE_ENV !== 'production') {
@@ -716,7 +716,7 @@ function ingestSuccess$8(luvio, resourceParams, response) {
716
716
  deepFreeze(snapshot.data);
717
717
  return snapshot;
718
718
  }
719
- function createResourceRequest$8(config) {
719
+ function createResourceRequest$f(config) {
720
720
  const headers = {};
721
721
  return {
722
722
  baseUri: '/services/data/v65.0',
@@ -730,45 +730,45 @@ function createResourceRequest$8(config) {
730
730
  };
731
731
  }
732
732
 
733
- const adapterName$8 = 'createFeedback';
733
+ const adapterName$f = 'createFeedback';
734
734
  const createFeedback_ConfigPropertyMetadata = [
735
735
  generateParamConfigMetadata('feedbackInput', true, 2 /* Body */, 4 /* Unsupported */),
736
736
  ];
737
- const createFeedback_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$8, createFeedback_ConfigPropertyMetadata);
738
- const createResourceParams$8 = /*#__PURE__*/ createResourceParams$a(createFeedback_ConfigPropertyMetadata);
739
- function typeCheckConfig$8(untrustedConfig) {
737
+ const createFeedback_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$f, createFeedback_ConfigPropertyMetadata);
738
+ const createResourceParams$f = /*#__PURE__*/ createResourceParams$h(createFeedback_ConfigPropertyMetadata);
739
+ function typeCheckConfig$f(untrustedConfig) {
740
740
  const config = {};
741
741
  const untrustedConfig_feedbackInput = untrustedConfig.feedbackInput;
742
- const referenceEinsteinLlmFeedbackInputRepresentationValidationError = validate$o(untrustedConfig_feedbackInput);
742
+ const referenceEinsteinLlmFeedbackInputRepresentationValidationError = validate$w(untrustedConfig_feedbackInput);
743
743
  if (referenceEinsteinLlmFeedbackInputRepresentationValidationError === null) {
744
744
  config.feedbackInput = untrustedConfig_feedbackInput;
745
745
  }
746
746
  return config;
747
747
  }
748
- function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
748
+ function validateAdapterConfig$f(untrustedConfig, configPropertyNames) {
749
749
  if (!untrustedIsObject(untrustedConfig)) {
750
750
  return null;
751
751
  }
752
752
  if (process.env.NODE_ENV !== 'production') {
753
753
  validateConfig(untrustedConfig, configPropertyNames);
754
754
  }
755
- const config = typeCheckConfig$8(untrustedConfig);
755
+ const config = typeCheckConfig$f(untrustedConfig);
756
756
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
757
757
  return null;
758
758
  }
759
759
  return config;
760
760
  }
761
- function buildNetworkSnapshot$8(luvio, config, options) {
762
- const resourceParams = createResourceParams$8(config);
763
- const request = createResourceRequest$8(resourceParams);
761
+ function buildNetworkSnapshot$f(luvio, config, options) {
762
+ const resourceParams = createResourceParams$f(config);
763
+ const request = createResourceRequest$f(resourceParams);
764
764
  return luvio.dispatchResourceRequest(request, options)
765
765
  .then((response) => {
766
766
  return luvio.handleSuccessResponse(() => {
767
- const snapshot = ingestSuccess$8(luvio, resourceParams, response);
767
+ const snapshot = ingestSuccess$f(luvio, resourceParams, response);
768
768
  return luvio.storeBroadcast().then(() => snapshot);
769
769
  }, () => {
770
770
  const cache = new StoreKeyMap();
771
- getResponseCacheKeys$8(cache, luvio, resourceParams, response.body);
771
+ getResponseCacheKeys$f(cache, luvio, resourceParams, response.body);
772
772
  return cache;
773
773
  });
774
774
  }, (response) => {
@@ -778,16 +778,16 @@ function buildNetworkSnapshot$8(luvio, config, options) {
778
778
  }
779
779
  const createFeedbackAdapterFactory = (luvio) => {
780
780
  return function createFeedback(untrustedConfig) {
781
- const config = validateAdapterConfig$8(untrustedConfig, createFeedback_ConfigPropertyNames);
781
+ const config = validateAdapterConfig$f(untrustedConfig, createFeedback_ConfigPropertyNames);
782
782
  // Invalid or incomplete config
783
783
  if (config === null) {
784
784
  throw new Error('Invalid config for "createFeedback"');
785
785
  }
786
- return buildNetworkSnapshot$8(luvio, config);
786
+ return buildNetworkSnapshot$f(luvio, config);
787
787
  };
788
788
  };
789
789
 
790
- function validate$m(obj, path = 'EinsteinLlmAdditionalConfigInputRepresentation') {
790
+ function validate$u(obj, path = 'EinsteinLlmAdditionalConfigInputRepresentation') {
791
791
  const v_error = (() => {
792
792
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
793
793
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -870,7 +870,7 @@ function validate$m(obj, path = 'EinsteinLlmAdditionalConfigInputRepresentation'
870
870
  return v_error === undefined ? null : v_error;
871
871
  }
872
872
 
873
- function validate$l(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
873
+ function validate$t(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
874
874
  const v_error = (() => {
875
875
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
876
876
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -878,7 +878,7 @@ function validate$l(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
878
878
  if (obj.additionalConfig !== undefined) {
879
879
  const obj_additionalConfig = obj.additionalConfig;
880
880
  const path_additionalConfig = path + '.additionalConfig';
881
- const referencepath_additionalConfigValidationError = validate$m(obj_additionalConfig, path_additionalConfig);
881
+ const referencepath_additionalConfigValidationError = validate$u(obj_additionalConfig, path_additionalConfig);
882
882
  if (referencepath_additionalConfigValidationError !== null) {
883
883
  let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
884
884
  message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -901,8 +901,8 @@ function validate$l(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
901
901
  return v_error === undefined ? null : v_error;
902
902
  }
903
903
 
904
- const VERSION$h = "9ebac74e6f964c363d5fd1913df363af";
905
- function validate$k(obj, path = 'EinsteinLlmGenerationsContentQualityRepresentation') {
904
+ const VERSION$m = "9ebac74e6f964c363d5fd1913df363af";
905
+ function validate$s(obj, path = 'EinsteinLlmGenerationsContentQualityRepresentation') {
906
906
  const v_error = (() => {
907
907
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
908
908
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -938,10 +938,10 @@ function validate$k(obj, path = 'EinsteinLlmGenerationsContentQualityRepresentat
938
938
  })();
939
939
  return v_error === undefined ? null : v_error;
940
940
  }
941
- const select$p = function EinsteinLlmGenerationsContentQualityRepresentationSelect() {
941
+ const select$B = function EinsteinLlmGenerationsContentQualityRepresentationSelect() {
942
942
  return {
943
943
  kind: 'Fragment',
944
- version: VERSION$h,
944
+ version: VERSION$m,
945
945
  private: [],
946
946
  selections: [
947
947
  {
@@ -952,7 +952,7 @@ const select$p = function EinsteinLlmGenerationsContentQualityRepresentationSele
952
952
  ]
953
953
  };
954
954
  };
955
- function equals$h(existing, incoming) {
955
+ function equals$m(existing, incoming) {
956
956
  const existing_isToxicityDetected = existing.isToxicityDetected;
957
957
  const incoming_isToxicityDetected = incoming.isToxicityDetected;
958
958
  // if at least one of these optionals is defined
@@ -969,8 +969,8 @@ function equals$h(existing, incoming) {
969
969
  return true;
970
970
  }
971
971
 
972
- const VERSION$g = "77af44a252cb5b45b4d9a8101368d2aa";
973
- function validate$j(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation') {
972
+ const VERSION$l = "77af44a252cb5b45b4d9a8101368d2aa";
973
+ function validate$r(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation') {
974
974
  const v_error = (() => {
975
975
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
976
976
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -1174,10 +1174,10 @@ function validate$j(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation
1174
1174
  })();
1175
1175
  return v_error === undefined ? null : v_error;
1176
1176
  }
1177
- const select$o = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect() {
1177
+ const select$A = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect() {
1178
1178
  return {
1179
1179
  kind: 'Fragment',
1180
- version: VERSION$g,
1180
+ version: VERSION$l,
1181
1181
  private: [],
1182
1182
  selections: [
1183
1183
  {
@@ -1218,7 +1218,7 @@ const select$o = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect(
1218
1218
  ]
1219
1219
  };
1220
1220
  };
1221
- function equals$g(existing, incoming) {
1221
+ function equals$l(existing, incoming) {
1222
1222
  const existing_hateScore = existing.hateScore;
1223
1223
  const incoming_hateScore = incoming.hateScore;
1224
1224
  // if at least one of these optionals is defined
@@ -1313,8 +1313,8 @@ function equals$g(existing, incoming) {
1313
1313
  return true;
1314
1314
  }
1315
1315
 
1316
- const VERSION$f = "4a07778ff6c595d91c575188146647a1";
1317
- function validate$i(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
1316
+ const VERSION$k = "4a07778ff6c595d91c575188146647a1";
1317
+ function validate$q(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
1318
1318
  const v_error = (() => {
1319
1319
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1320
1320
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -1324,7 +1324,7 @@ function validate$i(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
1324
1324
  const path_contentQualityRepresentation = path + '.contentQualityRepresentation';
1325
1325
  let obj_contentQualityRepresentation_union0 = null;
1326
1326
  const obj_contentQualityRepresentation_union0_error = (() => {
1327
- const referencepath_contentQualityRepresentationValidationError = validate$k(obj_contentQualityRepresentation, path_contentQualityRepresentation);
1327
+ const referencepath_contentQualityRepresentationValidationError = validate$s(obj_contentQualityRepresentation, path_contentQualityRepresentation);
1328
1328
  if (referencepath_contentQualityRepresentationValidationError !== null) {
1329
1329
  let message = 'Object doesn\'t match EinsteinLlmGenerationsContentQualityRepresentation (at "' + path_contentQualityRepresentation + '")\n';
1330
1330
  message += referencepath_contentQualityRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -1372,7 +1372,7 @@ function validate$i(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
1372
1372
  const path_safetyScoreRepresentation = path + '.safetyScoreRepresentation';
1373
1373
  let obj_safetyScoreRepresentation_union0 = null;
1374
1374
  const obj_safetyScoreRepresentation_union0_error = (() => {
1375
- const referencepath_safetyScoreRepresentationValidationError = validate$j(obj_safetyScoreRepresentation, path_safetyScoreRepresentation);
1375
+ const referencepath_safetyScoreRepresentationValidationError = validate$r(obj_safetyScoreRepresentation, path_safetyScoreRepresentation);
1376
1376
  if (referencepath_safetyScoreRepresentationValidationError !== null) {
1377
1377
  let message = 'Object doesn\'t match EinsteinLlmGenerationsSafetyScoreRepresentation (at "' + path_safetyScoreRepresentation + '")\n';
1378
1378
  message += referencepath_safetyScoreRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -1406,12 +1406,12 @@ function validate$i(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
1406
1406
  })();
1407
1407
  return v_error === undefined ? null : v_error;
1408
1408
  }
1409
- const select$n = function EinsteinLlmGenerationItemRepresentationSelect() {
1410
- const { selections: EinsteinLlmGenerationsContentQualityRepresentation__selections, opaque: EinsteinLlmGenerationsContentQualityRepresentation__opaque, } = select$p();
1411
- const { selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections, opaque: EinsteinLlmGenerationsSafetyScoreRepresentation__opaque, } = select$o();
1409
+ const select$z = function EinsteinLlmGenerationItemRepresentationSelect() {
1410
+ const { selections: EinsteinLlmGenerationsContentQualityRepresentation__selections, opaque: EinsteinLlmGenerationsContentQualityRepresentation__opaque, } = select$B();
1411
+ const { selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections, opaque: EinsteinLlmGenerationsSafetyScoreRepresentation__opaque, } = select$A();
1412
1412
  return {
1413
1413
  kind: 'Fragment',
1414
- version: VERSION$f,
1414
+ version: VERSION$k,
1415
1415
  private: [],
1416
1416
  selections: [
1417
1417
  {
@@ -1448,7 +1448,7 @@ const select$n = function EinsteinLlmGenerationItemRepresentationSelect() {
1448
1448
  ]
1449
1449
  };
1450
1450
  };
1451
- function equals$f(existing, incoming) {
1451
+ function equals$k(existing, incoming) {
1452
1452
  const existing_isSummarized = existing.isSummarized;
1453
1453
  const incoming_isSummarized = incoming.isSummarized;
1454
1454
  // if at least one of these optionals is defined
@@ -1489,7 +1489,7 @@ function equals$f(existing, incoming) {
1489
1489
  if (!(existing_contentQualityRepresentation === incoming_contentQualityRepresentation
1490
1490
  || (existing_contentQualityRepresentation != null &&
1491
1491
  incoming_contentQualityRepresentation != null &&
1492
- equals$h(existing_contentQualityRepresentation, incoming_contentQualityRepresentation)))) {
1492
+ equals$m(existing_contentQualityRepresentation, incoming_contentQualityRepresentation)))) {
1493
1493
  return false;
1494
1494
  }
1495
1495
  }
@@ -1505,15 +1505,15 @@ function equals$f(existing, incoming) {
1505
1505
  if (!(existing_safetyScoreRepresentation === incoming_safetyScoreRepresentation
1506
1506
  || (existing_safetyScoreRepresentation != null &&
1507
1507
  incoming_safetyScoreRepresentation != null &&
1508
- equals$g(existing_safetyScoreRepresentation, incoming_safetyScoreRepresentation)))) {
1508
+ equals$l(existing_safetyScoreRepresentation, incoming_safetyScoreRepresentation)))) {
1509
1509
  return false;
1510
1510
  }
1511
1511
  }
1512
1512
  return true;
1513
1513
  }
1514
1514
 
1515
- const VERSION$e = "4656c961c9d093a9e206c1db7d4de0b0";
1516
- function validate$h(obj, path = 'WrappedMap') {
1515
+ const VERSION$j = "379fd960d1a0118f506f458ab2c8dd7e";
1516
+ function validate$p(obj, path = 'WrappedMap') {
1517
1517
  const v_error = (() => {
1518
1518
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1519
1519
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -1528,25 +1528,34 @@ function validate$h(obj, path = 'WrappedMap') {
1528
1528
  const key = obj_wrappedMap_keys[i];
1529
1529
  const obj_wrappedMap_prop = obj_wrappedMap[key];
1530
1530
  const path_wrappedMap_prop = path_wrappedMap + '["' + key + '"]';
1531
- if (typeof obj_wrappedMap_prop !== 'object' || ArrayIsArray(obj_wrappedMap_prop) || obj_wrappedMap_prop === null) {
1532
- return new TypeError('Expected "object" but received "' + typeof obj_wrappedMap_prop + '" (at "' + path_wrappedMap_prop + '")');
1531
+ if (obj_wrappedMap_prop === undefined) {
1532
+ return new TypeError('Expected "defined" but received "' + typeof obj_wrappedMap_prop + '" (at "' + path_wrappedMap_prop + '")');
1533
1533
  }
1534
1534
  }
1535
1535
  })();
1536
1536
  return v_error === undefined ? null : v_error;
1537
1537
  }
1538
- const select$m = function WrappedMapSelect() {
1538
+ const select$y = function WrappedMapSelect() {
1539
1539
  return {
1540
1540
  kind: 'Fragment',
1541
- version: VERSION$e,
1541
+ version: VERSION$j,
1542
1542
  private: [],
1543
- selections: []
1543
+ selections: [
1544
+ {
1545
+ name: 'wrappedMap',
1546
+ kind: 'Object',
1547
+ // any
1548
+ }
1549
+ ]
1544
1550
  };
1545
1551
  };
1546
- function equals$e(existing, incoming) {
1552
+ function equals$j(existing, incoming) {
1547
1553
  const existing_wrappedMap = existing.wrappedMap;
1548
1554
  const incoming_wrappedMap = incoming.wrappedMap;
1549
1555
  const equals_wrappedMap_props = equalsObject(existing_wrappedMap, incoming_wrappedMap, (existing_wrappedMap_prop, incoming_wrappedMap_prop) => {
1556
+ if (JSONStringify(incoming_wrappedMap_prop) !== JSONStringify(existing_wrappedMap_prop)) {
1557
+ return false;
1558
+ }
1550
1559
  });
1551
1560
  if (equals_wrappedMap_props === false) {
1552
1561
  return false;
@@ -1554,9 +1563,9 @@ function equals$e(existing, incoming) {
1554
1563
  return true;
1555
1564
  }
1556
1565
 
1557
- const TTL$5 = 100;
1558
- const VERSION$d = "d8abd72a42e842b253da1c38954dafbc";
1559
- function validate$g(obj, path = 'EinsteinLlmGenerationsRepresentation') {
1566
+ const TTL$8 = 100;
1567
+ const VERSION$i = "d8abd72a42e842b253da1c38954dafbc";
1568
+ function validate$o(obj, path = 'EinsteinLlmGenerationsRepresentation') {
1560
1569
  const v_error = (() => {
1561
1570
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1562
1571
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -1569,7 +1578,7 @@ function validate$g(obj, path = 'EinsteinLlmGenerationsRepresentation') {
1569
1578
  for (let i = 0; i < obj_generations.length; i++) {
1570
1579
  const obj_generations_item = obj_generations[i];
1571
1580
  const path_generations_item = path_generations + '[' + i + ']';
1572
- const referencepath_generations_itemValidationError = validate$i(obj_generations_item, path_generations_item);
1581
+ const referencepath_generations_itemValidationError = validate$q(obj_generations_item, path_generations_item);
1573
1582
  if (referencepath_generations_itemValidationError !== null) {
1574
1583
  let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
1575
1584
  message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -1580,7 +1589,7 @@ function validate$g(obj, path = 'EinsteinLlmGenerationsRepresentation') {
1580
1589
  const path_parameters = path + '.parameters';
1581
1590
  let obj_parameters_union0 = null;
1582
1591
  const obj_parameters_union0_error = (() => {
1583
- const referencepath_parametersValidationError = validate$h(obj_parameters, path_parameters);
1592
+ const referencepath_parametersValidationError = validate$p(obj_parameters, path_parameters);
1584
1593
  if (referencepath_parametersValidationError !== null) {
1585
1594
  let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
1586
1595
  message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -1639,25 +1648,25 @@ function validate$g(obj, path = 'EinsteinLlmGenerationsRepresentation') {
1639
1648
  })();
1640
1649
  return v_error === undefined ? null : v_error;
1641
1650
  }
1642
- const RepresentationType$5 = 'EinsteinLlmGenerationsRepresentation';
1643
- function keyBuilder$8(luvio, config) {
1644
- return keyPrefix + '::' + RepresentationType$5 + ':' + config.requestId;
1651
+ const RepresentationType$8 = 'EinsteinLlmGenerationsRepresentation';
1652
+ function keyBuilder$k(luvio, config) {
1653
+ return keyPrefix + '::' + RepresentationType$8 + ':' + config.requestId;
1645
1654
  }
1646
1655
  function keyBuilderFromType$2(luvio, object) {
1647
1656
  const keyParams = {
1648
1657
  requestId: object.requestId
1649
1658
  };
1650
- return keyBuilder$8(luvio, keyParams);
1659
+ return keyBuilder$k(luvio, keyParams);
1651
1660
  }
1652
- function normalize$5(input, existing, path, luvio, store, timestamp) {
1661
+ function normalize$8(input, existing, path, luvio, store, timestamp) {
1653
1662
  return input;
1654
1663
  }
1655
- const select$l = function EinsteinLlmGenerationsRepresentationSelect() {
1656
- const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$n();
1657
- const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$m();
1664
+ const select$x = function EinsteinLlmGenerationsRepresentationSelect() {
1665
+ const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$z();
1666
+ const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$y();
1658
1667
  return {
1659
1668
  kind: 'Fragment',
1660
- version: VERSION$d,
1669
+ version: VERSION$i,
1661
1670
  private: [],
1662
1671
  selections: [
1663
1672
  {
@@ -1683,7 +1692,7 @@ const select$l = function EinsteinLlmGenerationsRepresentationSelect() {
1683
1692
  ]
1684
1693
  };
1685
1694
  };
1686
- function equals$d(existing, incoming) {
1695
+ function equals$i(existing, incoming) {
1687
1696
  const existing_requestId = existing.requestId;
1688
1697
  const incoming_requestId = incoming.requestId;
1689
1698
  if (!(existing_requestId === incoming_requestId)) {
@@ -1692,7 +1701,7 @@ function equals$d(existing, incoming) {
1692
1701
  const existing_generations = existing.generations;
1693
1702
  const incoming_generations = incoming.generations;
1694
1703
  const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
1695
- if (!(equals$f(existing_generations_item, incoming_generations_item))) {
1704
+ if (!(equals$k(existing_generations_item, incoming_generations_item))) {
1696
1705
  return false;
1697
1706
  }
1698
1707
  });
@@ -1704,7 +1713,7 @@ function equals$d(existing, incoming) {
1704
1713
  if (!(existing_parameters === incoming_parameters
1705
1714
  || (existing_parameters != null &&
1706
1715
  incoming_parameters != null &&
1707
- equals$e(existing_parameters, incoming_parameters)))) {
1716
+ equals$j(existing_parameters, incoming_parameters)))) {
1708
1717
  return false;
1709
1718
  }
1710
1719
  const existing_prompt = existing.prompt;
@@ -1714,41 +1723,41 @@ function equals$d(existing, incoming) {
1714
1723
  }
1715
1724
  return true;
1716
1725
  }
1717
- const ingest$5 = function EinsteinLlmGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
1726
+ const ingest$8 = function EinsteinLlmGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
1718
1727
  if (process.env.NODE_ENV !== 'production') {
1719
- const validateError = validate$g(input);
1728
+ const validateError = validate$o(input);
1720
1729
  if (validateError !== null) {
1721
1730
  throw validateError;
1722
1731
  }
1723
1732
  }
1724
1733
  const key = keyBuilderFromType$2(luvio, input);
1725
- const ttlToUse = TTL$5;
1726
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "EinsteinLLM", VERSION$d, RepresentationType$5, equals$d);
1734
+ const ttlToUse = TTL$8;
1735
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$8, "EinsteinLLM", VERSION$i, RepresentationType$8, equals$i);
1727
1736
  return createLink(key);
1728
1737
  };
1729
- function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
1738
+ function getTypeCacheKeys$8(rootKeySet, luvio, input, fullPathFactory) {
1730
1739
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1731
1740
  const rootKey = keyBuilderFromType$2(luvio, input);
1732
1741
  rootKeySet.set(rootKey, {
1733
1742
  namespace: keyPrefix,
1734
- representationName: RepresentationType$5,
1743
+ representationName: RepresentationType$8,
1735
1744
  mergeable: false
1736
1745
  });
1737
1746
  }
1738
1747
 
1739
- function select$k(luvio, params) {
1740
- return select$l();
1748
+ function select$w(luvio, params) {
1749
+ return select$x();
1741
1750
  }
1742
- function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
1743
- getTypeCacheKeys$5(storeKeyMap, luvio, response);
1751
+ function getResponseCacheKeys$e(storeKeyMap, luvio, resourceParams, response) {
1752
+ getTypeCacheKeys$8(storeKeyMap, luvio, response);
1744
1753
  }
1745
- function ingestSuccess$7(luvio, resourceParams, response) {
1754
+ function ingestSuccess$e(luvio, resourceParams, response) {
1746
1755
  const { body } = response;
1747
1756
  const key = keyBuilderFromType$2(luvio, body);
1748
- luvio.storeIngest(key, ingest$5, body);
1757
+ luvio.storeIngest(key, ingest$8, body);
1749
1758
  const snapshot = luvio.storeLookup({
1750
1759
  recordId: key,
1751
- node: select$k(),
1760
+ node: select$w(),
1752
1761
  variables: {},
1753
1762
  });
1754
1763
  if (process.env.NODE_ENV !== 'production') {
@@ -1759,7 +1768,7 @@ function ingestSuccess$7(luvio, resourceParams, response) {
1759
1768
  deepFreeze(snapshot.data);
1760
1769
  return snapshot;
1761
1770
  }
1762
- function createResourceRequest$7(config) {
1771
+ function createResourceRequest$e(config) {
1763
1772
  const headers = {};
1764
1773
  return {
1765
1774
  baseUri: '/services/data/v65.0',
@@ -1773,45 +1782,45 @@ function createResourceRequest$7(config) {
1773
1782
  };
1774
1783
  }
1775
1784
 
1776
- const adapterName$7 = 'createGenerations';
1785
+ const adapterName$e = 'createGenerations';
1777
1786
  const createGenerations_ConfigPropertyMetadata = [
1778
1787
  generateParamConfigMetadata('generationsInput', true, 2 /* Body */, 4 /* Unsupported */),
1779
1788
  ];
1780
- const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, createGenerations_ConfigPropertyMetadata);
1781
- const createResourceParams$7 = /*#__PURE__*/ createResourceParams$a(createGenerations_ConfigPropertyMetadata);
1782
- function typeCheckConfig$7(untrustedConfig) {
1789
+ const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$e, createGenerations_ConfigPropertyMetadata);
1790
+ const createResourceParams$e = /*#__PURE__*/ createResourceParams$h(createGenerations_ConfigPropertyMetadata);
1791
+ function typeCheckConfig$e(untrustedConfig) {
1783
1792
  const config = {};
1784
1793
  const untrustedConfig_generationsInput = untrustedConfig.generationsInput;
1785
- const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$l(untrustedConfig_generationsInput);
1794
+ const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$t(untrustedConfig_generationsInput);
1786
1795
  if (referenceEinsteinLlmGenerationsInputRepresentationValidationError === null) {
1787
1796
  config.generationsInput = untrustedConfig_generationsInput;
1788
1797
  }
1789
1798
  return config;
1790
1799
  }
1791
- function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
1800
+ function validateAdapterConfig$e(untrustedConfig, configPropertyNames) {
1792
1801
  if (!untrustedIsObject(untrustedConfig)) {
1793
1802
  return null;
1794
1803
  }
1795
1804
  if (process.env.NODE_ENV !== 'production') {
1796
1805
  validateConfig(untrustedConfig, configPropertyNames);
1797
1806
  }
1798
- const config = typeCheckConfig$7(untrustedConfig);
1807
+ const config = typeCheckConfig$e(untrustedConfig);
1799
1808
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1800
1809
  return null;
1801
1810
  }
1802
1811
  return config;
1803
1812
  }
1804
- function buildNetworkSnapshot$7(luvio, config, options) {
1805
- const resourceParams = createResourceParams$7(config);
1806
- const request = createResourceRequest$7(resourceParams);
1813
+ function buildNetworkSnapshot$e(luvio, config, options) {
1814
+ const resourceParams = createResourceParams$e(config);
1815
+ const request = createResourceRequest$e(resourceParams);
1807
1816
  return luvio.dispatchResourceRequest(request, options)
1808
1817
  .then((response) => {
1809
1818
  return luvio.handleSuccessResponse(() => {
1810
- const snapshot = ingestSuccess$7(luvio, resourceParams, response);
1819
+ const snapshot = ingestSuccess$e(luvio, resourceParams, response);
1811
1820
  return luvio.storeBroadcast().then(() => snapshot);
1812
1821
  }, () => {
1813
1822
  const cache = new StoreKeyMap();
1814
- getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
1823
+ getResponseCacheKeys$e(cache, luvio, resourceParams, response.body);
1815
1824
  return cache;
1816
1825
  });
1817
1826
  }, (response) => {
@@ -1821,16 +1830,16 @@ function buildNetworkSnapshot$7(luvio, config, options) {
1821
1830
  }
1822
1831
  const createGenerationsAdapterFactory = (luvio) => {
1823
1832
  return function createGenerations(untrustedConfig) {
1824
- const config = validateAdapterConfig$7(untrustedConfig, createGenerations_ConfigPropertyNames);
1833
+ const config = validateAdapterConfig$e(untrustedConfig, createGenerations_ConfigPropertyNames);
1825
1834
  // Invalid or incomplete config
1826
1835
  if (config === null) {
1827
1836
  throw new Error('Invalid config for "createGenerations"');
1828
1837
  }
1829
- return buildNetworkSnapshot$7(luvio, config);
1838
+ return buildNetworkSnapshot$e(luvio, config);
1830
1839
  };
1831
1840
  };
1832
1841
 
1833
- function validate$f(obj, path = 'EinsteinPromptRecordFieldRepresentation') {
1842
+ function validate$n(obj, path = 'EinsteinPromptRecordFieldRepresentation') {
1834
1843
  const v_error = (() => {
1835
1844
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1836
1845
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -1890,9 +1899,9 @@ function validate$f(obj, path = 'EinsteinPromptRecordFieldRepresentation') {
1890
1899
  return v_error === undefined ? null : v_error;
1891
1900
  }
1892
1901
 
1893
- const TTL$4 = 100;
1894
- const VERSION$c = "2d1628544b54fc1701aa9b4eff05127b";
1895
- function validate$e(obj, path = 'EinsteinPromptRecordRepresentation') {
1902
+ const TTL$7 = 100;
1903
+ const VERSION$h = "2d1628544b54fc1701aa9b4eff05127b";
1904
+ function validate$m(obj, path = 'EinsteinPromptRecordRepresentation') {
1896
1905
  const v_error = (() => {
1897
1906
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1898
1907
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -1921,7 +1930,7 @@ function validate$e(obj, path = 'EinsteinPromptRecordRepresentation') {
1921
1930
  for (let i = 0; i < obj_childRelationships_prop.length; i++) {
1922
1931
  const obj_childRelationships_prop_item = obj_childRelationships_prop[i];
1923
1932
  const path_childRelationships_prop_item = path_childRelationships_prop + '[' + i + ']';
1924
- const referencepath_childRelationships_prop_itemValidationError = validate$e(obj_childRelationships_prop_item, path_childRelationships_prop_item);
1933
+ const referencepath_childRelationships_prop_itemValidationError = validate$m(obj_childRelationships_prop_item, path_childRelationships_prop_item);
1925
1934
  if (referencepath_childRelationships_prop_itemValidationError !== null) {
1926
1935
  let message = 'Object doesn\'t match EinsteinPromptRecordRepresentation (at "' + path_childRelationships_prop_item + '")\n';
1927
1936
  message += referencepath_childRelationships_prop_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -1941,7 +1950,7 @@ function validate$e(obj, path = 'EinsteinPromptRecordRepresentation') {
1941
1950
  const key = obj_fields_keys[i];
1942
1951
  const obj_fields_prop = obj_fields[key];
1943
1952
  const path_fields_prop = path_fields + '["' + key + '"]';
1944
- const referencepath_fields_propValidationError = validate$f(obj_fields_prop, path_fields_prop);
1953
+ const referencepath_fields_propValidationError = validate$n(obj_fields_prop, path_fields_prop);
1945
1954
  if (referencepath_fields_propValidationError !== null) {
1946
1955
  let message = 'Object doesn\'t match EinsteinPromptRecordFieldRepresentation (at "' + path_fields_prop + '")\n';
1947
1956
  message += referencepath_fields_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -1959,49 +1968,49 @@ function validate$e(obj, path = 'EinsteinPromptRecordRepresentation') {
1959
1968
  })();
1960
1969
  return v_error === undefined ? null : v_error;
1961
1970
  }
1962
- const RepresentationType$4 = 'EinsteinPromptRecordRepresentation';
1963
- function normalize$4(input, existing, path, luvio, store, timestamp) {
1971
+ const RepresentationType$7 = 'EinsteinPromptRecordRepresentation';
1972
+ function normalize$7(input, existing, path, luvio, store, timestamp) {
1964
1973
  return input;
1965
1974
  }
1966
- const select$j = function EinsteinPromptRecordRepresentationSelect() {
1975
+ const select$v = function EinsteinPromptRecordRepresentationSelect() {
1967
1976
  return {
1968
1977
  kind: 'Fragment',
1969
- version: VERSION$c,
1978
+ version: VERSION$h,
1970
1979
  private: [],
1971
1980
  opaque: true
1972
1981
  };
1973
1982
  };
1974
- function equals$c(existing, incoming) {
1983
+ function equals$h(existing, incoming) {
1975
1984
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
1976
1985
  return false;
1977
1986
  }
1978
1987
  return true;
1979
1988
  }
1980
- const ingest$4 = function EinsteinPromptRecordRepresentationIngest(input, path, luvio, store, timestamp) {
1989
+ const ingest$7 = function EinsteinPromptRecordRepresentationIngest(input, path, luvio, store, timestamp) {
1981
1990
  if (process.env.NODE_ENV !== 'production') {
1982
- const validateError = validate$e(input);
1991
+ const validateError = validate$m(input);
1983
1992
  if (validateError !== null) {
1984
1993
  throw validateError;
1985
1994
  }
1986
1995
  }
1987
1996
  const key = path.fullPath;
1988
- const ttlToUse = TTL$4;
1989
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "EinsteinLLM", VERSION$c, RepresentationType$4, equals$c);
1997
+ const ttlToUse = TTL$7;
1998
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$7, "EinsteinLLM", VERSION$h, RepresentationType$7, equals$h);
1990
1999
  return createLink(key);
1991
2000
  };
1992
- function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
2001
+ function getTypeCacheKeys$7(rootKeySet, luvio, input, fullPathFactory) {
1993
2002
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1994
2003
  const rootKey = fullPathFactory();
1995
2004
  rootKeySet.set(rootKey, {
1996
2005
  namespace: keyPrefix,
1997
- representationName: RepresentationType$4,
2006
+ representationName: RepresentationType$7,
1998
2007
  mergeable: false
1999
2008
  });
2000
2009
  }
2001
2010
 
2002
- const TTL$3 = 100;
2003
- const VERSION$b = "5fd7b8a03d155ba601bcb4ee725e0893";
2004
- function validate$d(obj, path = 'EinsteinPromptRecordCollectionOutputRepresentation') {
2011
+ const TTL$6 = 100;
2012
+ const VERSION$g = "5fd7b8a03d155ba601bcb4ee725e0893";
2013
+ function validate$l(obj, path = 'EinsteinPromptRecordCollectionOutputRepresentation') {
2005
2014
  const v_error = (() => {
2006
2015
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2007
2016
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -2020,7 +2029,7 @@ function validate$d(obj, path = 'EinsteinPromptRecordCollectionOutputRepresentat
2020
2029
  for (let i = 0; i < obj_promptRecords.length; i++) {
2021
2030
  const obj_promptRecords_item = obj_promptRecords[i];
2022
2031
  const path_promptRecords_item = path_promptRecords + '[' + i + ']';
2023
- const referencepath_promptRecords_itemValidationError = validate$e(obj_promptRecords_item, path_promptRecords_item);
2032
+ const referencepath_promptRecords_itemValidationError = validate$m(obj_promptRecords_item, path_promptRecords_item);
2024
2033
  if (referencepath_promptRecords_itemValidationError !== null) {
2025
2034
  let message = 'Object doesn\'t match EinsteinPromptRecordRepresentation (at "' + path_promptRecords_item + '")\n';
2026
2035
  message += referencepath_promptRecords_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -2036,62 +2045,62 @@ function validate$d(obj, path = 'EinsteinPromptRecordCollectionOutputRepresentat
2036
2045
  })();
2037
2046
  return v_error === undefined ? null : v_error;
2038
2047
  }
2039
- const RepresentationType$3 = 'EinsteinPromptRecordCollectionOutputRepresentation';
2040
- function normalize$3(input, existing, path, luvio, store, timestamp) {
2048
+ const RepresentationType$6 = 'EinsteinPromptRecordCollectionOutputRepresentation';
2049
+ function normalize$6(input, existing, path, luvio, store, timestamp) {
2041
2050
  return input;
2042
2051
  }
2043
- const select$i = function EinsteinPromptRecordCollectionOutputRepresentationSelect() {
2052
+ const select$u = function EinsteinPromptRecordCollectionOutputRepresentationSelect() {
2044
2053
  return {
2045
2054
  kind: 'Fragment',
2046
- version: VERSION$b,
2055
+ version: VERSION$g,
2047
2056
  private: [],
2048
2057
  opaque: true
2049
2058
  };
2050
2059
  };
2051
- function equals$b(existing, incoming) {
2060
+ function equals$g(existing, incoming) {
2052
2061
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
2053
2062
  return false;
2054
2063
  }
2055
2064
  return true;
2056
2065
  }
2057
- const ingest$3 = function EinsteinPromptRecordCollectionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2066
+ const ingest$6 = function EinsteinPromptRecordCollectionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2058
2067
  if (process.env.NODE_ENV !== 'production') {
2059
- const validateError = validate$d(input);
2068
+ const validateError = validate$l(input);
2060
2069
  if (validateError !== null) {
2061
2070
  throw validateError;
2062
2071
  }
2063
2072
  }
2064
2073
  const key = path.fullPath;
2065
- const ttlToUse = TTL$3;
2066
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "EinsteinLLM", VERSION$b, RepresentationType$3, equals$b);
2074
+ const ttlToUse = TTL$6;
2075
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "EinsteinLLM", VERSION$g, RepresentationType$6, equals$g);
2067
2076
  return createLink(key);
2068
2077
  };
2069
- function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
2078
+ function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
2070
2079
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2071
2080
  const rootKey = fullPathFactory();
2072
2081
  rootKeySet.set(rootKey, {
2073
2082
  namespace: keyPrefix,
2074
- representationName: RepresentationType$3,
2083
+ representationName: RepresentationType$6,
2075
2084
  mergeable: false
2076
2085
  });
2077
2086
  }
2078
2087
 
2079
- function select$h(luvio, params) {
2080
- return select$i();
2088
+ function select$t(luvio, params) {
2089
+ return select$u();
2081
2090
  }
2082
- function keyBuilder$7(luvio, params) {
2091
+ function keyBuilder$j(luvio, params) {
2083
2092
  return keyPrefix + '::EinsteinPromptRecordCollectionOutputRepresentation:(' + 'isActive:' + params.queryParams.isActive + ',' + 'fields:' + params.queryParams.fields + ',' + 'relatedEntity:' + params.queryParams.relatedEntity + ',' + 'offset:' + params.queryParams.offset + ',' + 'pageLimit:' + params.queryParams.pageLimit + ',' + 'type:' + params.queryParams.type + ',' + 'query:' + params.queryParams.query + ',' + 'sortBy:' + params.queryParams.sortBy + ')';
2084
2093
  }
2085
- function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
2086
- getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$7(luvio, resourceParams));
2094
+ function getResponseCacheKeys$d(storeKeyMap, luvio, resourceParams, response) {
2095
+ getTypeCacheKeys$6(storeKeyMap, luvio, response, () => keyBuilder$j(luvio, resourceParams));
2087
2096
  }
2088
- function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
2097
+ function ingestSuccess$d(luvio, resourceParams, response, snapshotRefresh) {
2089
2098
  const { body } = response;
2090
- const key = keyBuilder$7(luvio, resourceParams);
2091
- luvio.storeIngest(key, ingest$3, body);
2099
+ const key = keyBuilder$j(luvio, resourceParams);
2100
+ luvio.storeIngest(key, ingest$6, body);
2092
2101
  const snapshot = luvio.storeLookup({
2093
2102
  recordId: key,
2094
- node: select$h(),
2103
+ node: select$t(),
2095
2104
  variables: {},
2096
2105
  }, snapshotRefresh);
2097
2106
  if (process.env.NODE_ENV !== 'production') {
@@ -2102,19 +2111,19 @@ function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
2102
2111
  deepFreeze(snapshot.data);
2103
2112
  return snapshot;
2104
2113
  }
2105
- function ingestError$2(luvio, params, error, snapshotRefresh) {
2106
- const key = keyBuilder$7(luvio, params);
2114
+ function ingestError$8(luvio, params, error, snapshotRefresh) {
2115
+ const key = keyBuilder$j(luvio, params);
2107
2116
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2108
2117
  const storeMetadataParams = {
2109
- ttl: TTL$3,
2118
+ ttl: TTL$6,
2110
2119
  namespace: keyPrefix,
2111
- version: VERSION$b,
2112
- representationName: RepresentationType$3
2120
+ version: VERSION$g,
2121
+ representationName: RepresentationType$6
2113
2122
  };
2114
2123
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
2115
2124
  return errorSnapshot;
2116
2125
  }
2117
- function createResourceRequest$6(config) {
2126
+ function createResourceRequest$d(config) {
2118
2127
  const headers = {};
2119
2128
  return {
2120
2129
  baseUri: '/services/data/v65.0',
@@ -2128,7 +2137,7 @@ function createResourceRequest$6(config) {
2128
2137
  };
2129
2138
  }
2130
2139
 
2131
- const adapterName$6 = 'getPromptTemplates';
2140
+ const adapterName$d = 'getPromptTemplates';
2132
2141
  const getPromptTemplates_ConfigPropertyMetadata = [
2133
2142
  generateParamConfigMetadata('isActive', false, 1 /* QueryParameter */, 1 /* Boolean */),
2134
2143
  generateParamConfigMetadata('fields', false, 1 /* QueryParameter */, 0 /* String */, true),
@@ -2139,91 +2148,91 @@ const getPromptTemplates_ConfigPropertyMetadata = [
2139
2148
  generateParamConfigMetadata('query', false, 1 /* QueryParameter */, 0 /* String */),
2140
2149
  generateParamConfigMetadata('sortBy', false, 1 /* QueryParameter */, 0 /* String */),
2141
2150
  ];
2142
- const getPromptTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getPromptTemplates_ConfigPropertyMetadata);
2143
- const createResourceParams$6 = /*#__PURE__*/ createResourceParams$a(getPromptTemplates_ConfigPropertyMetadata);
2144
- function keyBuilder$6(luvio, config) {
2145
- const resourceParams = createResourceParams$6(config);
2146
- return keyBuilder$7(luvio, resourceParams);
2151
+ const getPromptTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$d, getPromptTemplates_ConfigPropertyMetadata);
2152
+ const createResourceParams$d = /*#__PURE__*/ createResourceParams$h(getPromptTemplates_ConfigPropertyMetadata);
2153
+ function keyBuilder$i(luvio, config) {
2154
+ const resourceParams = createResourceParams$d(config);
2155
+ return keyBuilder$j(luvio, resourceParams);
2147
2156
  }
2148
- function typeCheckConfig$6(untrustedConfig) {
2157
+ function typeCheckConfig$d(untrustedConfig) {
2149
2158
  const config = {};
2150
- typeCheckConfig$a(untrustedConfig, config, getPromptTemplates_ConfigPropertyMetadata);
2159
+ typeCheckConfig$h(untrustedConfig, config, getPromptTemplates_ConfigPropertyMetadata);
2151
2160
  return config;
2152
2161
  }
2153
- function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
2162
+ function validateAdapterConfig$d(untrustedConfig, configPropertyNames) {
2154
2163
  if (!untrustedIsObject(untrustedConfig)) {
2155
2164
  return null;
2156
2165
  }
2157
2166
  if (process.env.NODE_ENV !== 'production') {
2158
2167
  validateConfig(untrustedConfig, configPropertyNames);
2159
2168
  }
2160
- const config = typeCheckConfig$6(untrustedConfig);
2169
+ const config = typeCheckConfig$d(untrustedConfig);
2161
2170
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
2162
2171
  return null;
2163
2172
  }
2164
2173
  return config;
2165
2174
  }
2166
- function adapterFragment$2(luvio, config) {
2167
- createResourceParams$6(config);
2168
- return select$h();
2175
+ function adapterFragment$8(luvio, config) {
2176
+ createResourceParams$d(config);
2177
+ return select$t();
2169
2178
  }
2170
- function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
2171
- const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
2179
+ function onFetchResponseSuccess$8(luvio, config, resourceParams, response) {
2180
+ const snapshot = ingestSuccess$d(luvio, resourceParams, response, {
2172
2181
  config,
2173
- resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
2182
+ resolve: () => buildNetworkSnapshot$d(luvio, config, snapshotRefreshOptions)
2174
2183
  });
2175
2184
  return luvio.storeBroadcast().then(() => snapshot);
2176
2185
  }
2177
- function onFetchResponseError$2(luvio, config, resourceParams, response) {
2178
- const snapshot = ingestError$2(luvio, resourceParams, response, {
2186
+ function onFetchResponseError$8(luvio, config, resourceParams, response) {
2187
+ const snapshot = ingestError$8(luvio, resourceParams, response, {
2179
2188
  config,
2180
- resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
2189
+ resolve: () => buildNetworkSnapshot$d(luvio, config, snapshotRefreshOptions)
2181
2190
  });
2182
2191
  return luvio.storeBroadcast().then(() => snapshot);
2183
2192
  }
2184
- function buildNetworkSnapshot$6(luvio, config, options) {
2185
- const resourceParams = createResourceParams$6(config);
2186
- const request = createResourceRequest$6(resourceParams);
2193
+ function buildNetworkSnapshot$d(luvio, config, options) {
2194
+ const resourceParams = createResourceParams$d(config);
2195
+ const request = createResourceRequest$d(resourceParams);
2187
2196
  return luvio.dispatchResourceRequest(request, options)
2188
2197
  .then((response) => {
2189
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
2198
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$8(luvio, config, resourceParams, response), () => {
2190
2199
  const cache = new StoreKeyMap();
2191
- getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
2200
+ getResponseCacheKeys$d(cache, luvio, resourceParams, response.body);
2192
2201
  return cache;
2193
2202
  });
2194
2203
  }, (response) => {
2195
- return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
2204
+ return luvio.handleErrorResponse(() => onFetchResponseError$8(luvio, config, resourceParams, response));
2196
2205
  });
2197
2206
  }
2198
- function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
2199
- return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
2207
+ function buildNetworkSnapshotCachePolicy$8(context, coercedAdapterRequestContext) {
2208
+ return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$d, undefined, false);
2200
2209
  }
2201
- function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
2210
+ function buildCachedSnapshotCachePolicy$8(context, storeLookup) {
2202
2211
  const { luvio, config } = context;
2203
2212
  const selector = {
2204
- recordId: keyBuilder$6(luvio, config),
2205
- node: adapterFragment$2(luvio, config),
2213
+ recordId: keyBuilder$i(luvio, config),
2214
+ node: adapterFragment$8(luvio, config),
2206
2215
  variables: {},
2207
2216
  };
2208
2217
  const cacheSnapshot = storeLookup(selector, {
2209
2218
  config,
2210
- resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
2219
+ resolve: () => buildNetworkSnapshot$d(luvio, config, snapshotRefreshOptions)
2211
2220
  });
2212
2221
  return cacheSnapshot;
2213
2222
  }
2214
2223
  const getPromptTemplatesAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplates(untrustedConfig, requestContext) {
2215
- const config = validateAdapterConfig$6(untrustedConfig, getPromptTemplates_ConfigPropertyNames);
2224
+ const config = validateAdapterConfig$d(untrustedConfig, getPromptTemplates_ConfigPropertyNames);
2216
2225
  // Invalid or incomplete config
2217
2226
  if (config === null) {
2218
2227
  return null;
2219
2228
  }
2220
2229
  return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2221
- buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
2230
+ buildCachedSnapshotCachePolicy$8, buildNetworkSnapshotCachePolicy$8);
2222
2231
  };
2223
2232
 
2224
- const TTL$2 = 100;
2225
- const VERSION$a = "a90a51578e2fdd7a9741d310bed22b1d";
2226
- function validate$c(obj, path = 'EinsteinPromptTemplateRepresentation') {
2233
+ const TTL$5 = 100;
2234
+ const VERSION$f = "a90a51578e2fdd7a9741d310bed22b1d";
2235
+ function validate$k(obj, path = 'EinsteinPromptTemplateRepresentation') {
2227
2236
  const v_error = (() => {
2228
2237
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2229
2238
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -2231,7 +2240,7 @@ function validate$c(obj, path = 'EinsteinPromptTemplateRepresentation') {
2231
2240
  if (obj.additionalData !== undefined) {
2232
2241
  const obj_additionalData = obj.additionalData;
2233
2242
  const path_additionalData = path + '.additionalData';
2234
- const referencepath_additionalDataValidationError = validate$h(obj_additionalData, path_additionalData);
2243
+ const referencepath_additionalDataValidationError = validate$p(obj_additionalData, path_additionalData);
2235
2244
  if (referencepath_additionalDataValidationError !== null) {
2236
2245
  let message = 'Object doesn\'t match WrappedMap (at "' + path_additionalData + '")\n';
2237
2246
  message += referencepath_additionalDataValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -2299,24 +2308,24 @@ function validate$c(obj, path = 'EinsteinPromptTemplateRepresentation') {
2299
2308
  })();
2300
2309
  return v_error === undefined ? null : v_error;
2301
2310
  }
2302
- const RepresentationType$2 = 'EinsteinPromptTemplateRepresentation';
2303
- function keyBuilder$5(luvio, config) {
2304
- return keyPrefix + '::' + RepresentationType$2 + ':' + config.versionId;
2311
+ const RepresentationType$5 = 'EinsteinPromptTemplateRepresentation';
2312
+ function keyBuilder$h(luvio, config) {
2313
+ return keyPrefix + '::' + RepresentationType$5 + ':' + config.versionId;
2305
2314
  }
2306
2315
  function keyBuilderFromType$1(luvio, object) {
2307
2316
  const keyParams = {
2308
2317
  versionId: object.versionId
2309
2318
  };
2310
- return keyBuilder$5(luvio, keyParams);
2319
+ return keyBuilder$h(luvio, keyParams);
2311
2320
  }
2312
- function normalize$2(input, existing, path, luvio, store, timestamp) {
2321
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
2313
2322
  return input;
2314
2323
  }
2315
- const select$g = function EinsteinPromptTemplateRepresentationSelect() {
2316
- const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$m();
2324
+ const select$s = function EinsteinPromptTemplateRepresentationSelect() {
2325
+ const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$y();
2317
2326
  return {
2318
2327
  kind: 'Fragment',
2319
- version: VERSION$a,
2328
+ version: VERSION$f,
2320
2329
  private: [],
2321
2330
  selections: [
2322
2331
  {
@@ -2364,7 +2373,7 @@ const select$g = function EinsteinPromptTemplateRepresentationSelect() {
2364
2373
  ]
2365
2374
  };
2366
2375
  };
2367
- function equals$a(existing, incoming) {
2376
+ function equals$f(existing, incoming) {
2368
2377
  const existing_hasWarning = existing.hasWarning;
2369
2378
  const incoming_hasWarning = incoming.hasWarning;
2370
2379
  if (!(existing_hasWarning === incoming_hasWarning)) {
@@ -2420,7 +2429,7 @@ function equals$a(existing, incoming) {
2420
2429
  if (existing_additionalData === undefined || incoming_additionalData === undefined) {
2421
2430
  return false;
2422
2431
  }
2423
- if (!(equals$e(existing_additionalData, incoming_additionalData))) {
2432
+ if (!(equals$j(existing_additionalData, incoming_additionalData))) {
2424
2433
  return false;
2425
2434
  }
2426
2435
  }
@@ -2446,41 +2455,41 @@ function equals$a(existing, incoming) {
2446
2455
  }
2447
2456
  return true;
2448
2457
  }
2449
- const ingest$2 = function EinsteinPromptTemplateRepresentationIngest(input, path, luvio, store, timestamp) {
2458
+ const ingest$5 = function EinsteinPromptTemplateRepresentationIngest(input, path, luvio, store, timestamp) {
2450
2459
  if (process.env.NODE_ENV !== 'production') {
2451
- const validateError = validate$c(input);
2460
+ const validateError = validate$k(input);
2452
2461
  if (validateError !== null) {
2453
2462
  throw validateError;
2454
2463
  }
2455
2464
  }
2456
2465
  const key = keyBuilderFromType$1(luvio, input);
2457
- const ttlToUse = TTL$2;
2458
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "EinsteinLLM", VERSION$a, RepresentationType$2, equals$a);
2466
+ const ttlToUse = TTL$5;
2467
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "EinsteinLLM", VERSION$f, RepresentationType$5, equals$f);
2459
2468
  return createLink(key);
2460
2469
  };
2461
- function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
2470
+ function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
2462
2471
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2463
2472
  const rootKey = keyBuilderFromType$1(luvio, input);
2464
2473
  rootKeySet.set(rootKey, {
2465
2474
  namespace: keyPrefix,
2466
- representationName: RepresentationType$2,
2475
+ representationName: RepresentationType$5,
2467
2476
  mergeable: false
2468
2477
  });
2469
2478
  }
2470
2479
 
2471
- function select$f(luvio, params) {
2472
- return select$g();
2480
+ function select$r(luvio, params) {
2481
+ return select$s();
2473
2482
  }
2474
- function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
2475
- getTypeCacheKeys$2(storeKeyMap, luvio, response);
2483
+ function getResponseCacheKeys$c(storeKeyMap, luvio, resourceParams, response) {
2484
+ getTypeCacheKeys$5(storeKeyMap, luvio, response);
2476
2485
  }
2477
- function ingestSuccess$5(luvio, resourceParams, response) {
2486
+ function ingestSuccess$c(luvio, resourceParams, response) {
2478
2487
  const { body } = response;
2479
2488
  const key = keyBuilderFromType$1(luvio, body);
2480
- luvio.storeIngest(key, ingest$2, body);
2489
+ luvio.storeIngest(key, ingest$5, body);
2481
2490
  const snapshot = luvio.storeLookup({
2482
2491
  recordId: key,
2483
- node: select$f(),
2492
+ node: select$r(),
2484
2493
  variables: {},
2485
2494
  });
2486
2495
  if (process.env.NODE_ENV !== 'production') {
@@ -2491,7 +2500,7 @@ function ingestSuccess$5(luvio, resourceParams, response) {
2491
2500
  deepFreeze(snapshot.data);
2492
2501
  return snapshot;
2493
2502
  }
2494
- function createResourceRequest$5(config) {
2503
+ function createResourceRequest$c(config) {
2495
2504
  const headers = {};
2496
2505
  return {
2497
2506
  baseUri: '/services/data/v65.0',
@@ -2505,19 +2514,18 @@ function createResourceRequest$5(config) {
2505
2514
  };
2506
2515
  }
2507
2516
 
2508
- const adapterName$5 = 'createPromptTemplate';
2517
+ const adapterName$c = 'createPromptTemplate';
2509
2518
  const createPromptTemplate_ConfigPropertyMetadata = [
2510
2519
  generateParamConfigMetadata('apiName', true, 2 /* Body */, 0 /* String */),
2511
2520
  generateParamConfigMetadata('childRelationships', true, 2 /* Body */, 4 /* Unsupported */),
2512
- generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported */, true),
2521
+ generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported */),
2513
2522
  generateParamConfigMetadata('id', false, 2 /* Body */, 0 /* String */),
2514
- generateParamConfigMetadata('isStandard', true, 2 /* Body */, 1 /* Boolean */),
2515
2523
  ];
2516
- const createPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, createPromptTemplate_ConfigPropertyMetadata);
2517
- const createResourceParams$5 = /*#__PURE__*/ createResourceParams$a(createPromptTemplate_ConfigPropertyMetadata);
2518
- function typeCheckConfig$5(untrustedConfig) {
2524
+ const createPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$c, createPromptTemplate_ConfigPropertyMetadata);
2525
+ const createResourceParams$c = /*#__PURE__*/ createResourceParams$h(createPromptTemplate_ConfigPropertyMetadata);
2526
+ function typeCheckConfig$c(untrustedConfig) {
2519
2527
  const config = {};
2520
- typeCheckConfig$a(untrustedConfig, config, createPromptTemplate_ConfigPropertyMetadata);
2528
+ typeCheckConfig$h(untrustedConfig, config, createPromptTemplate_ConfigPropertyMetadata);
2521
2529
  const untrustedConfig_childRelationships = untrustedConfig.childRelationships;
2522
2530
  if (untrustedIsObject(untrustedConfig_childRelationships)) {
2523
2531
  const untrustedConfig_childRelationships_object = {};
@@ -2534,53 +2542,46 @@ function typeCheckConfig$5(untrustedConfig) {
2534
2542
  }
2535
2543
  }
2536
2544
  const untrustedConfig_fields = untrustedConfig.fields;
2537
- if (ArrayIsArray$1(untrustedConfig_fields)) {
2538
- const untrustedConfig_fields_array = [];
2539
- for (let i = 0, arrayLength = untrustedConfig_fields.length; i < arrayLength; i++) {
2540
- const untrustedConfig_fields_item = untrustedConfig_fields[i];
2541
- if (untrustedIsObject(untrustedConfig_fields_item)) {
2542
- const untrustedConfig_fields_item_object = {};
2543
- const untrustedConfig_fields_item_keys = Object.keys(untrustedConfig_fields_item);
2544
- for (let i = 0, arrayLength = untrustedConfig_fields_item_keys.length; i < arrayLength; i++) {
2545
- const key = untrustedConfig_fields_item_keys[i];
2546
- const untrustedConfig_fields_item_prop = untrustedConfig_fields_item[key];
2547
- if (untrustedConfig_fields_item_object !== undefined) {
2548
- untrustedConfig_fields_item_object[key] = untrustedConfig_fields_item_prop;
2549
- }
2550
- }
2551
- if (untrustedConfig_fields_item_object !== undefined && Object.keys(untrustedConfig_fields_item_object).length >= 0) {
2552
- untrustedConfig_fields_array.push(untrustedConfig_fields_item_object);
2553
- }
2545
+ if (untrustedIsObject(untrustedConfig_fields)) {
2546
+ const untrustedConfig_fields_object = {};
2547
+ const untrustedConfig_fields_keys = Object.keys(untrustedConfig_fields);
2548
+ for (let i = 0, arrayLength = untrustedConfig_fields_keys.length; i < arrayLength; i++) {
2549
+ const key = untrustedConfig_fields_keys[i];
2550
+ const untrustedConfig_fields_prop = untrustedConfig_fields[key];
2551
+ if (untrustedConfig_fields_object !== undefined) {
2552
+ untrustedConfig_fields_object[key] = untrustedConfig_fields_prop;
2554
2553
  }
2555
2554
  }
2556
- config.fields = untrustedConfig_fields_array;
2555
+ if (untrustedConfig_fields_object !== undefined && Object.keys(untrustedConfig_fields_object).length >= 0) {
2556
+ config.fields = untrustedConfig_fields_object;
2557
+ }
2557
2558
  }
2558
2559
  return config;
2559
2560
  }
2560
- function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
2561
+ function validateAdapterConfig$c(untrustedConfig, configPropertyNames) {
2561
2562
  if (!untrustedIsObject(untrustedConfig)) {
2562
2563
  return null;
2563
2564
  }
2564
2565
  if (process.env.NODE_ENV !== 'production') {
2565
2566
  validateConfig(untrustedConfig, configPropertyNames);
2566
2567
  }
2567
- const config = typeCheckConfig$5(untrustedConfig);
2568
+ const config = typeCheckConfig$c(untrustedConfig);
2568
2569
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
2569
2570
  return null;
2570
2571
  }
2571
2572
  return config;
2572
2573
  }
2573
- function buildNetworkSnapshot$5(luvio, config, options) {
2574
- const resourceParams = createResourceParams$5(config);
2575
- const request = createResourceRequest$5(resourceParams);
2574
+ function buildNetworkSnapshot$c(luvio, config, options) {
2575
+ const resourceParams = createResourceParams$c(config);
2576
+ const request = createResourceRequest$c(resourceParams);
2576
2577
  return luvio.dispatchResourceRequest(request, options)
2577
2578
  .then((response) => {
2578
2579
  return luvio.handleSuccessResponse(() => {
2579
- const snapshot = ingestSuccess$5(luvio, resourceParams, response);
2580
+ const snapshot = ingestSuccess$c(luvio, resourceParams, response);
2580
2581
  return luvio.storeBroadcast().then(() => snapshot);
2581
2582
  }, () => {
2582
2583
  const cache = new StoreKeyMap();
2583
- getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
2584
+ getResponseCacheKeys$c(cache, luvio, resourceParams, response.body);
2584
2585
  return cache;
2585
2586
  });
2586
2587
  }, (response) => {
@@ -2590,50 +2591,1534 @@ function buildNetworkSnapshot$5(luvio, config, options) {
2590
2591
  }
2591
2592
  const createPromptTemplateAdapterFactory = (luvio) => {
2592
2593
  return function createPromptTemplate(untrustedConfig) {
2593
- const config = validateAdapterConfig$5(untrustedConfig, createPromptTemplate_ConfigPropertyNames);
2594
+ const config = validateAdapterConfig$c(untrustedConfig, createPromptTemplate_ConfigPropertyNames);
2594
2595
  // Invalid or incomplete config
2595
2596
  if (config === null) {
2596
2597
  throw new Error('Invalid config for "createPromptTemplate"');
2597
2598
  }
2598
- return buildNetworkSnapshot$5(luvio, config);
2599
+ return buildNetworkSnapshot$c(luvio, config);
2599
2600
  };
2600
2601
  };
2601
2602
 
2602
- function select$e(luvio, params) {
2603
- return select$j();
2604
- }
2605
- function keyBuilder$4(luvio, params) {
2606
- return keyPrefix + '::EinsteinPromptRecordRepresentation:(' + 'versionId:' + params.queryParams.versionId + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ')';
2607
- }
2608
- function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
2609
- getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
2603
+ function validate$j(obj, path = 'PromptTemplateDataProviderOutputParamRepresentation') {
2604
+ const v_error = (() => {
2605
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2606
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2607
+ }
2608
+ const obj_apiName = obj.apiName;
2609
+ const path_apiName = path + '.apiName';
2610
+ if (typeof obj_apiName !== 'string') {
2611
+ return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
2612
+ }
2613
+ const obj_label = obj.label;
2614
+ const path_label = path + '.label';
2615
+ if (typeof obj_label !== 'string') {
2616
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
2617
+ }
2618
+ if (obj.type !== undefined) {
2619
+ const obj_type = obj.type;
2620
+ const path_type = path + '.type';
2621
+ if (typeof obj_type !== 'string') {
2622
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
2623
+ }
2624
+ }
2625
+ })();
2626
+ return v_error === undefined ? null : v_error;
2610
2627
  }
2611
- function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
2612
- const { body } = response;
2613
- const key = keyBuilder$4(luvio, resourceParams);
2614
- luvio.storeIngest(key, ingest$4, body);
2615
- const snapshot = luvio.storeLookup({
2616
- recordId: key,
2617
- node: select$e(),
2618
- variables: {},
2619
- }, snapshotRefresh);
2620
- if (process.env.NODE_ENV !== 'production') {
2621
- if (snapshot.state !== 'Fulfilled') {
2622
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2628
+
2629
+ function validate$i(obj, path = 'PromptTemplateDataProviderInputParamRepresentation') {
2630
+ const v_error = (() => {
2631
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2632
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2623
2633
  }
2624
- }
2625
- deepFreeze(snapshot.data);
2626
- return snapshot;
2634
+ const obj_apiName = obj.apiName;
2635
+ const path_apiName = path + '.apiName';
2636
+ if (typeof obj_apiName !== 'string') {
2637
+ return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
2638
+ }
2639
+ const obj_label = obj.label;
2640
+ const path_label = path + '.label';
2641
+ if (typeof obj_label !== 'string') {
2642
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
2643
+ }
2644
+ const obj_required = obj.required;
2645
+ const path_required = path + '.required';
2646
+ if (typeof obj_required !== 'boolean') {
2647
+ return new TypeError('Expected "boolean" but received "' + typeof obj_required + '" (at "' + path_required + '")');
2648
+ }
2649
+ const obj_type = obj.type;
2650
+ const path_type = path + '.type';
2651
+ if (typeof obj_type !== 'string') {
2652
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
2653
+ }
2654
+ })();
2655
+ return v_error === undefined ? null : v_error;
2627
2656
  }
2628
- function ingestError$1(luvio, params, error, snapshotRefresh) {
2629
- const key = keyBuilder$4(luvio, params);
2630
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2631
- const storeMetadataParams = {
2632
- ttl: TTL$4,
2633
- namespace: keyPrefix,
2634
- version: VERSION$c,
2635
- representationName: RepresentationType$4
2636
- };
2657
+
2658
+ const TTL$4 = 300;
2659
+ const VERSION$e = "d4824d8c6e7848df0de89295e6d9d434";
2660
+ function validate$h(obj, path = 'PromptTemplateDataProviderInstanceConfigRepresentation') {
2661
+ const v_error = (() => {
2662
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2663
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2664
+ }
2665
+ const obj_apiName = obj.apiName;
2666
+ const path_apiName = path + '.apiName';
2667
+ if (typeof obj_apiName !== 'string') {
2668
+ return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
2669
+ }
2670
+ if (obj.dataProviderBundle !== undefined) {
2671
+ const obj_dataProviderBundle = obj.dataProviderBundle;
2672
+ const path_dataProviderBundle = path + '.dataProviderBundle';
2673
+ if (typeof obj_dataProviderBundle !== 'object' || ArrayIsArray(obj_dataProviderBundle) || obj_dataProviderBundle === null) {
2674
+ return new TypeError('Expected "object" but received "' + typeof obj_dataProviderBundle + '" (at "' + path_dataProviderBundle + '")');
2675
+ }
2676
+ const obj_dataProviderBundle_keys = ObjectKeys(obj_dataProviderBundle);
2677
+ for (let i = 0; i < obj_dataProviderBundle_keys.length; i++) {
2678
+ const key = obj_dataProviderBundle_keys[i];
2679
+ const obj_dataProviderBundle_prop = obj_dataProviderBundle[key];
2680
+ const path_dataProviderBundle_prop = path_dataProviderBundle + '["' + key + '"]';
2681
+ if (obj_dataProviderBundle_prop === undefined) {
2682
+ return new TypeError('Expected "defined" but received "' + typeof obj_dataProviderBundle_prop + '" (at "' + path_dataProviderBundle_prop + '")');
2683
+ }
2684
+ }
2685
+ }
2686
+ if (obj.defaultOutputParam !== undefined) {
2687
+ const obj_defaultOutputParam = obj.defaultOutputParam;
2688
+ const path_defaultOutputParam = path + '.defaultOutputParam';
2689
+ const referencepath_defaultOutputParamValidationError = validate$j(obj_defaultOutputParam, path_defaultOutputParam);
2690
+ if (referencepath_defaultOutputParamValidationError !== null) {
2691
+ let message = 'Object doesn\'t match PromptTemplateDataProviderOutputParamRepresentation (at "' + path_defaultOutputParam + '")\n';
2692
+ message += referencepath_defaultOutputParamValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2693
+ return new TypeError(message);
2694
+ }
2695
+ }
2696
+ const obj_definition = obj.definition;
2697
+ const path_definition = path + '.definition';
2698
+ if (typeof obj_definition !== 'string') {
2699
+ return new TypeError('Expected "string" but received "' + typeof obj_definition + '" (at "' + path_definition + '")');
2700
+ }
2701
+ if (obj.description !== undefined) {
2702
+ const obj_description = obj.description;
2703
+ const path_description = path + '.description';
2704
+ let obj_description_union0 = null;
2705
+ const obj_description_union0_error = (() => {
2706
+ if (typeof obj_description !== 'string') {
2707
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
2708
+ }
2709
+ })();
2710
+ if (obj_description_union0_error != null) {
2711
+ obj_description_union0 = obj_description_union0_error.message;
2712
+ }
2713
+ let obj_description_union1 = null;
2714
+ const obj_description_union1_error = (() => {
2715
+ if (obj_description !== null) {
2716
+ return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
2717
+ }
2718
+ })();
2719
+ if (obj_description_union1_error != null) {
2720
+ obj_description_union1 = obj_description_union1_error.message;
2721
+ }
2722
+ if (obj_description_union0 && obj_description_union1) {
2723
+ let message = 'Object doesn\'t match union (at "' + path_description + '")';
2724
+ message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
2725
+ message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
2726
+ return new TypeError(message);
2727
+ }
2728
+ }
2729
+ const obj_groupName = obj.groupName;
2730
+ const path_groupName = path + '.groupName';
2731
+ if (typeof obj_groupName !== 'string') {
2732
+ return new TypeError('Expected "string" but received "' + typeof obj_groupName + '" (at "' + path_groupName + '")');
2733
+ }
2734
+ if (obj.inputParams !== undefined) {
2735
+ const obj_inputParams = obj.inputParams;
2736
+ const path_inputParams = path + '.inputParams';
2737
+ if (!ArrayIsArray(obj_inputParams)) {
2738
+ return new TypeError('Expected "array" but received "' + typeof obj_inputParams + '" (at "' + path_inputParams + '")');
2739
+ }
2740
+ for (let i = 0; i < obj_inputParams.length; i++) {
2741
+ const obj_inputParams_item = obj_inputParams[i];
2742
+ const path_inputParams_item = path_inputParams + '[' + i + ']';
2743
+ const referencepath_inputParams_itemValidationError = validate$i(obj_inputParams_item, path_inputParams_item);
2744
+ if (referencepath_inputParams_itemValidationError !== null) {
2745
+ let message = 'Object doesn\'t match PromptTemplateDataProviderInputParamRepresentation (at "' + path_inputParams_item + '")\n';
2746
+ message += referencepath_inputParams_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2747
+ return new TypeError(message);
2748
+ }
2749
+ }
2750
+ }
2751
+ const obj_label = obj.label;
2752
+ const path_label = path + '.label';
2753
+ if (typeof obj_label !== 'string') {
2754
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
2755
+ }
2756
+ if (obj.mappedInputs !== undefined) {
2757
+ const obj_mappedInputs = obj.mappedInputs;
2758
+ const path_mappedInputs = path + '.mappedInputs';
2759
+ if (typeof obj_mappedInputs !== 'object' || ArrayIsArray(obj_mappedInputs) || obj_mappedInputs === null) {
2760
+ return new TypeError('Expected "object" but received "' + typeof obj_mappedInputs + '" (at "' + path_mappedInputs + '")');
2761
+ }
2762
+ const obj_mappedInputs_keys = ObjectKeys(obj_mappedInputs);
2763
+ for (let i = 0; i < obj_mappedInputs_keys.length; i++) {
2764
+ const key = obj_mappedInputs_keys[i];
2765
+ const obj_mappedInputs_prop = obj_mappedInputs[key];
2766
+ const path_mappedInputs_prop = path_mappedInputs + '["' + key + '"]';
2767
+ if (obj_mappedInputs_prop === undefined) {
2768
+ return new TypeError('Expected "defined" but received "' + typeof obj_mappedInputs_prop + '" (at "' + path_mappedInputs_prop + '")');
2769
+ }
2770
+ }
2771
+ }
2772
+ if (obj.nodeIcon !== undefined) {
2773
+ const obj_nodeIcon = obj.nodeIcon;
2774
+ const path_nodeIcon = path + '.nodeIcon';
2775
+ let obj_nodeIcon_union0 = null;
2776
+ const obj_nodeIcon_union0_error = (() => {
2777
+ if (typeof obj_nodeIcon !== 'string') {
2778
+ return new TypeError('Expected "string" but received "' + typeof obj_nodeIcon + '" (at "' + path_nodeIcon + '")');
2779
+ }
2780
+ })();
2781
+ if (obj_nodeIcon_union0_error != null) {
2782
+ obj_nodeIcon_union0 = obj_nodeIcon_union0_error.message;
2783
+ }
2784
+ let obj_nodeIcon_union1 = null;
2785
+ const obj_nodeIcon_union1_error = (() => {
2786
+ if (obj_nodeIcon !== null) {
2787
+ return new TypeError('Expected "null" but received "' + typeof obj_nodeIcon + '" (at "' + path_nodeIcon + '")');
2788
+ }
2789
+ })();
2790
+ if (obj_nodeIcon_union1_error != null) {
2791
+ obj_nodeIcon_union1 = obj_nodeIcon_union1_error.message;
2792
+ }
2793
+ if (obj_nodeIcon_union0 && obj_nodeIcon_union1) {
2794
+ let message = 'Object doesn\'t match union (at "' + path_nodeIcon + '")';
2795
+ message += '\n' + obj_nodeIcon_union0.split('\n').map((line) => '\t' + line).join('\n');
2796
+ message += '\n' + obj_nodeIcon_union1.split('\n').map((line) => '\t' + line).join('\n');
2797
+ return new TypeError(message);
2798
+ }
2799
+ }
2800
+ if (obj.outputParams !== undefined) {
2801
+ const obj_outputParams = obj.outputParams;
2802
+ const path_outputParams = path + '.outputParams';
2803
+ if (!ArrayIsArray(obj_outputParams)) {
2804
+ return new TypeError('Expected "array" but received "' + typeof obj_outputParams + '" (at "' + path_outputParams + '")');
2805
+ }
2806
+ for (let i = 0; i < obj_outputParams.length; i++) {
2807
+ const obj_outputParams_item = obj_outputParams[i];
2808
+ const path_outputParams_item = path_outputParams + '[' + i + ']';
2809
+ const referencepath_outputParams_itemValidationError = validate$j(obj_outputParams_item, path_outputParams_item);
2810
+ if (referencepath_outputParams_itemValidationError !== null) {
2811
+ let message = 'Object doesn\'t match PromptTemplateDataProviderOutputParamRepresentation (at "' + path_outputParams_item + '")\n';
2812
+ message += referencepath_outputParams_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2813
+ return new TypeError(message);
2814
+ }
2815
+ }
2816
+ }
2817
+ const obj_referenceName = obj.referenceName;
2818
+ const path_referenceName = path + '.referenceName';
2819
+ if (typeof obj_referenceName !== 'string') {
2820
+ return new TypeError('Expected "string" but received "' + typeof obj_referenceName + '" (at "' + path_referenceName + '")');
2821
+ }
2822
+ if (obj.scopedToTarget !== undefined) {
2823
+ const obj_scopedToTarget = obj.scopedToTarget;
2824
+ const path_scopedToTarget = path + '.scopedToTarget';
2825
+ let obj_scopedToTarget_union0 = null;
2826
+ const obj_scopedToTarget_union0_error = (() => {
2827
+ if (typeof obj_scopedToTarget !== 'string') {
2828
+ return new TypeError('Expected "string" but received "' + typeof obj_scopedToTarget + '" (at "' + path_scopedToTarget + '")');
2829
+ }
2830
+ })();
2831
+ if (obj_scopedToTarget_union0_error != null) {
2832
+ obj_scopedToTarget_union0 = obj_scopedToTarget_union0_error.message;
2833
+ }
2834
+ let obj_scopedToTarget_union1 = null;
2835
+ const obj_scopedToTarget_union1_error = (() => {
2836
+ if (obj_scopedToTarget !== null) {
2837
+ return new TypeError('Expected "null" but received "' + typeof obj_scopedToTarget + '" (at "' + path_scopedToTarget + '")');
2838
+ }
2839
+ })();
2840
+ if (obj_scopedToTarget_union1_error != null) {
2841
+ obj_scopedToTarget_union1 = obj_scopedToTarget_union1_error.message;
2842
+ }
2843
+ if (obj_scopedToTarget_union0 && obj_scopedToTarget_union1) {
2844
+ let message = 'Object doesn\'t match union (at "' + path_scopedToTarget + '")';
2845
+ message += '\n' + obj_scopedToTarget_union0.split('\n').map((line) => '\t' + line).join('\n');
2846
+ message += '\n' + obj_scopedToTarget_union1.split('\n').map((line) => '\t' + line).join('\n');
2847
+ return new TypeError(message);
2848
+ }
2849
+ }
2850
+ if (obj.subGroup !== undefined) {
2851
+ const obj_subGroup = obj.subGroup;
2852
+ const path_subGroup = path + '.subGroup';
2853
+ let obj_subGroup_union0 = null;
2854
+ const obj_subGroup_union0_error = (() => {
2855
+ if (typeof obj_subGroup !== 'string') {
2856
+ return new TypeError('Expected "string" but received "' + typeof obj_subGroup + '" (at "' + path_subGroup + '")');
2857
+ }
2858
+ })();
2859
+ if (obj_subGroup_union0_error != null) {
2860
+ obj_subGroup_union0 = obj_subGroup_union0_error.message;
2861
+ }
2862
+ let obj_subGroup_union1 = null;
2863
+ const obj_subGroup_union1_error = (() => {
2864
+ if (obj_subGroup !== null) {
2865
+ return new TypeError('Expected "null" but received "' + typeof obj_subGroup + '" (at "' + path_subGroup + '")');
2866
+ }
2867
+ })();
2868
+ if (obj_subGroup_union1_error != null) {
2869
+ obj_subGroup_union1 = obj_subGroup_union1_error.message;
2870
+ }
2871
+ if (obj_subGroup_union0 && obj_subGroup_union1) {
2872
+ let message = 'Object doesn\'t match union (at "' + path_subGroup + '")';
2873
+ message += '\n' + obj_subGroup_union0.split('\n').map((line) => '\t' + line).join('\n');
2874
+ message += '\n' + obj_subGroup_union1.split('\n').map((line) => '\t' + line).join('\n');
2875
+ return new TypeError(message);
2876
+ }
2877
+ }
2878
+ })();
2879
+ return v_error === undefined ? null : v_error;
2880
+ }
2881
+ const RepresentationType$4 = 'PromptTemplateDataProviderInstanceConfigRepresentation';
2882
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
2883
+ return input;
2884
+ }
2885
+ const select$q = function PromptTemplateDataProviderInstanceConfigRepresentationSelect() {
2886
+ return {
2887
+ kind: 'Fragment',
2888
+ version: VERSION$e,
2889
+ private: [],
2890
+ opaque: true
2891
+ };
2892
+ };
2893
+ function equals$e(existing, incoming) {
2894
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
2895
+ return false;
2896
+ }
2897
+ return true;
2898
+ }
2899
+ const ingest$4 = function PromptTemplateDataProviderInstanceConfigRepresentationIngest(input, path, luvio, store, timestamp) {
2900
+ if (process.env.NODE_ENV !== 'production') {
2901
+ const validateError = validate$h(input);
2902
+ if (validateError !== null) {
2903
+ throw validateError;
2904
+ }
2905
+ }
2906
+ const key = path.fullPath;
2907
+ const ttlToUse = TTL$4;
2908
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "EinsteinLLM", VERSION$e, RepresentationType$4, equals$e);
2909
+ return createLink(key);
2910
+ };
2911
+ function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
2912
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2913
+ const rootKey = fullPathFactory();
2914
+ rootKeySet.set(rootKey, {
2915
+ namespace: keyPrefix,
2916
+ representationName: RepresentationType$4,
2917
+ mergeable: false
2918
+ });
2919
+ }
2920
+
2921
+ const TTL$3 = 300;
2922
+ const VERSION$d = "3a6ecdfe18eb2af8f8f6aaa1a30b194c";
2923
+ function validate$g(obj, path = 'PromptTemplateDataProviderInstanceConfigCollectionRepresentation') {
2924
+ const v_error = (() => {
2925
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2926
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2927
+ }
2928
+ const obj_dataProviderInstanceConfigs = obj.dataProviderInstanceConfigs;
2929
+ const path_dataProviderInstanceConfigs = path + '.dataProviderInstanceConfigs';
2930
+ if (!ArrayIsArray(obj_dataProviderInstanceConfigs)) {
2931
+ return new TypeError('Expected "array" but received "' + typeof obj_dataProviderInstanceConfigs + '" (at "' + path_dataProviderInstanceConfigs + '")');
2932
+ }
2933
+ for (let i = 0; i < obj_dataProviderInstanceConfigs.length; i++) {
2934
+ const obj_dataProviderInstanceConfigs_item = obj_dataProviderInstanceConfigs[i];
2935
+ const path_dataProviderInstanceConfigs_item = path_dataProviderInstanceConfigs + '[' + i + ']';
2936
+ const referencepath_dataProviderInstanceConfigs_itemValidationError = validate$h(obj_dataProviderInstanceConfigs_item, path_dataProviderInstanceConfigs_item);
2937
+ if (referencepath_dataProviderInstanceConfigs_itemValidationError !== null) {
2938
+ let message = 'Object doesn\'t match PromptTemplateDataProviderInstanceConfigRepresentation (at "' + path_dataProviderInstanceConfigs_item + '")\n';
2939
+ message += referencepath_dataProviderInstanceConfigs_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2940
+ return new TypeError(message);
2941
+ }
2942
+ }
2943
+ })();
2944
+ return v_error === undefined ? null : v_error;
2945
+ }
2946
+ const RepresentationType$3 = 'PromptTemplateDataProviderInstanceConfigCollectionRepresentation';
2947
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
2948
+ return input;
2949
+ }
2950
+ const select$p = function PromptTemplateDataProviderInstanceConfigCollectionRepresentationSelect() {
2951
+ return {
2952
+ kind: 'Fragment',
2953
+ version: VERSION$d,
2954
+ private: [],
2955
+ opaque: true
2956
+ };
2957
+ };
2958
+ function equals$d(existing, incoming) {
2959
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
2960
+ return false;
2961
+ }
2962
+ return true;
2963
+ }
2964
+ const ingest$3 = function PromptTemplateDataProviderInstanceConfigCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
2965
+ if (process.env.NODE_ENV !== 'production') {
2966
+ const validateError = validate$g(input);
2967
+ if (validateError !== null) {
2968
+ throw validateError;
2969
+ }
2970
+ }
2971
+ const key = path.fullPath;
2972
+ const ttlToUse = TTL$3;
2973
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "EinsteinLLM", VERSION$d, RepresentationType$3, equals$d);
2974
+ return createLink(key);
2975
+ };
2976
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
2977
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2978
+ const rootKey = fullPathFactory();
2979
+ rootKeySet.set(rootKey, {
2980
+ namespace: keyPrefix,
2981
+ representationName: RepresentationType$3,
2982
+ mergeable: false
2983
+ });
2984
+ }
2985
+
2986
+ function select$o(luvio, params) {
2987
+ return select$p();
2988
+ }
2989
+ function keyBuilder$g(luvio, params) {
2990
+ return keyPrefix + '::PromptTemplateDataProviderInstanceConfigCollectionRepresentation:(' + (params.body.groupName === undefined ? 'groupName' : 'groupName:' + params.body.groupName) + '::' + (params.body.target === undefined ? 'target' : 'target:' + params.body.target) + '::' + 'templateInputs:' + params.body.templateInputs + '::' + 'templateTypeName:' + params.body.templateTypeName + ')';
2991
+ }
2992
+ function getResponseCacheKeys$b(storeKeyMap, luvio, resourceParams, response) {
2993
+ getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$g(luvio, resourceParams));
2994
+ }
2995
+ function ingestSuccess$b(luvio, resourceParams, response, snapshotRefresh) {
2996
+ const { body } = response;
2997
+ const key = keyBuilder$g(luvio, resourceParams);
2998
+ luvio.storeIngest(key, ingest$3, body);
2999
+ const snapshot = luvio.storeLookup({
3000
+ recordId: key,
3001
+ node: select$o(),
3002
+ variables: {},
3003
+ }, snapshotRefresh);
3004
+ if (process.env.NODE_ENV !== 'production') {
3005
+ if (snapshot.state !== 'Fulfilled') {
3006
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3007
+ }
3008
+ }
3009
+ deepFreeze(snapshot.data);
3010
+ return snapshot;
3011
+ }
3012
+ function ingestError$7(luvio, params, error, snapshotRefresh) {
3013
+ const key = keyBuilder$g(luvio, params);
3014
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3015
+ const storeMetadataParams = {
3016
+ ttl: TTL$3,
3017
+ namespace: keyPrefix,
3018
+ version: VERSION$d,
3019
+ representationName: RepresentationType$3
3020
+ };
3021
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
3022
+ return errorSnapshot;
3023
+ }
3024
+ function createResourceRequest$b(config) {
3025
+ const headers = {};
3026
+ return {
3027
+ baseUri: '/services/data/v65.0',
3028
+ basePath: '/einstein/prompt-templates/data-providers/mapped',
3029
+ method: 'post',
3030
+ body: config.body,
3031
+ urlParams: {},
3032
+ queryParams: {},
3033
+ headers,
3034
+ priority: 'normal',
3035
+ };
3036
+ }
3037
+
3038
+ const adapterName$b = 'getInputMappedDataProviders';
3039
+ const getInputMappedDataProviders_ConfigPropertyMetadata = [
3040
+ generateParamConfigMetadata('groupName', false, 2 /* Body */, 0 /* String */),
3041
+ generateParamConfigMetadata('target', false, 2 /* Body */, 0 /* String */),
3042
+ generateParamConfigMetadata('templateInputs', true, 2 /* Body */, 4 /* Unsupported */, true),
3043
+ generateParamConfigMetadata('templateTypeName', true, 2 /* Body */, 0 /* String */),
3044
+ ];
3045
+ const getInputMappedDataProviders_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$b, getInputMappedDataProviders_ConfigPropertyMetadata);
3046
+ const createResourceParams$b = /*#__PURE__*/ createResourceParams$h(getInputMappedDataProviders_ConfigPropertyMetadata);
3047
+ function keyBuilder$f(luvio, config) {
3048
+ const resourceParams = createResourceParams$b(config);
3049
+ return keyBuilder$g(luvio, resourceParams);
3050
+ }
3051
+ function typeCheckConfig$b(untrustedConfig) {
3052
+ const config = {};
3053
+ typeCheckConfig$h(untrustedConfig, config, getInputMappedDataProviders_ConfigPropertyMetadata);
3054
+ const untrustedConfig_templateInputs = untrustedConfig.templateInputs;
3055
+ if (ArrayIsArray$1(untrustedConfig_templateInputs)) {
3056
+ const untrustedConfig_templateInputs_array = [];
3057
+ for (let i = 0, arrayLength = untrustedConfig_templateInputs.length; i < arrayLength; i++) {
3058
+ const untrustedConfig_templateInputs_item = untrustedConfig_templateInputs[i];
3059
+ untrustedConfig_templateInputs_array.push(untrustedConfig_templateInputs_item);
3060
+ }
3061
+ config.templateInputs = untrustedConfig_templateInputs_array;
3062
+ }
3063
+ return config;
3064
+ }
3065
+ function validateAdapterConfig$b(untrustedConfig, configPropertyNames) {
3066
+ if (!untrustedIsObject(untrustedConfig)) {
3067
+ return null;
3068
+ }
3069
+ if (process.env.NODE_ENV !== 'production') {
3070
+ validateConfig(untrustedConfig, configPropertyNames);
3071
+ }
3072
+ const config = typeCheckConfig$b(untrustedConfig);
3073
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3074
+ return null;
3075
+ }
3076
+ return config;
3077
+ }
3078
+ function adapterFragment$7(luvio, config) {
3079
+ createResourceParams$b(config);
3080
+ return select$o();
3081
+ }
3082
+ function onFetchResponseSuccess$7(luvio, config, resourceParams, response) {
3083
+ const snapshot = ingestSuccess$b(luvio, resourceParams, response, {
3084
+ config,
3085
+ resolve: () => buildNetworkSnapshot$b(luvio, config, snapshotRefreshOptions)
3086
+ });
3087
+ return luvio.storeBroadcast().then(() => snapshot);
3088
+ }
3089
+ function onFetchResponseError$7(luvio, config, resourceParams, response) {
3090
+ const snapshot = ingestError$7(luvio, resourceParams, response, {
3091
+ config,
3092
+ resolve: () => buildNetworkSnapshot$b(luvio, config, snapshotRefreshOptions)
3093
+ });
3094
+ return luvio.storeBroadcast().then(() => snapshot);
3095
+ }
3096
+ function buildNetworkSnapshot$b(luvio, config, options) {
3097
+ const resourceParams = createResourceParams$b(config);
3098
+ const request = createResourceRequest$b(resourceParams);
3099
+ return luvio.dispatchResourceRequest(request, options)
3100
+ .then((response) => {
3101
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$7(luvio, config, resourceParams, response), () => {
3102
+ const cache = new StoreKeyMap();
3103
+ getResponseCacheKeys$b(cache, luvio, resourceParams, response.body);
3104
+ return cache;
3105
+ });
3106
+ }, (response) => {
3107
+ return luvio.handleErrorResponse(() => onFetchResponseError$7(luvio, config, resourceParams, response));
3108
+ });
3109
+ }
3110
+ function buildNetworkSnapshotCachePolicy$7(context, coercedAdapterRequestContext) {
3111
+ return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$b, 'get', false);
3112
+ }
3113
+ function buildCachedSnapshotCachePolicy$7(context, storeLookup) {
3114
+ const { luvio, config } = context;
3115
+ const selector = {
3116
+ recordId: keyBuilder$f(luvio, config),
3117
+ node: adapterFragment$7(luvio, config),
3118
+ variables: {},
3119
+ };
3120
+ const cacheSnapshot = storeLookup(selector, {
3121
+ config,
3122
+ resolve: () => buildNetworkSnapshot$b(luvio, config, snapshotRefreshOptions)
3123
+ });
3124
+ return cacheSnapshot;
3125
+ }
3126
+ const getInputMappedDataProvidersAdapterFactory = (luvio) => function EinsteinLLM__getInputMappedDataProviders(untrustedConfig, requestContext) {
3127
+ const config = validateAdapterConfig$b(untrustedConfig, getInputMappedDataProviders_ConfigPropertyNames);
3128
+ // Invalid or incomplete config
3129
+ if (config === null) {
3130
+ return null;
3131
+ }
3132
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3133
+ buildCachedSnapshotCachePolicy$7, buildNetworkSnapshotCachePolicy$7);
3134
+ };
3135
+
3136
+ function select$n(luvio, params) {
3137
+ return select$p();
3138
+ }
3139
+ function keyBuilder$e(luvio, params) {
3140
+ return keyPrefix + '::PromptTemplateDataProviderInstanceConfigCollectionRepresentation:(' + 'groupNames:' + params.queryParams.groupNames + ',' + 'targets:' + params.queryParams.targets + ',' + 'templateType:' + params.urlParams.templateType + ')';
3141
+ }
3142
+ function getResponseCacheKeys$a(storeKeyMap, luvio, resourceParams, response) {
3143
+ getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$e(luvio, resourceParams));
3144
+ }
3145
+ function ingestSuccess$a(luvio, resourceParams, response, snapshotRefresh) {
3146
+ const { body } = response;
3147
+ const key = keyBuilder$e(luvio, resourceParams);
3148
+ luvio.storeIngest(key, ingest$3, body);
3149
+ const snapshot = luvio.storeLookup({
3150
+ recordId: key,
3151
+ node: select$n(),
3152
+ variables: {},
3153
+ }, snapshotRefresh);
3154
+ if (process.env.NODE_ENV !== 'production') {
3155
+ if (snapshot.state !== 'Fulfilled') {
3156
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3157
+ }
3158
+ }
3159
+ deepFreeze(snapshot.data);
3160
+ return snapshot;
3161
+ }
3162
+ function ingestError$6(luvio, params, error, snapshotRefresh) {
3163
+ const key = keyBuilder$e(luvio, params);
3164
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3165
+ const storeMetadataParams = {
3166
+ ttl: TTL$3,
3167
+ namespace: keyPrefix,
3168
+ version: VERSION$d,
3169
+ representationName: RepresentationType$3
3170
+ };
3171
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
3172
+ return errorSnapshot;
3173
+ }
3174
+ function createResourceRequest$a(config) {
3175
+ const headers = {};
3176
+ return {
3177
+ baseUri: '/services/data/v65.0',
3178
+ basePath: '/einstein/prompt-templates/data-providers/' + config.urlParams.templateType + '',
3179
+ method: 'get',
3180
+ body: null,
3181
+ urlParams: config.urlParams,
3182
+ queryParams: config.queryParams,
3183
+ headers,
3184
+ priority: 'normal',
3185
+ };
3186
+ }
3187
+
3188
+ const adapterName$a = 'getDataProviders';
3189
+ const getDataProviders_ConfigPropertyMetadata = [
3190
+ generateParamConfigMetadata('templateType', true, 0 /* UrlParameter */, 0 /* String */),
3191
+ generateParamConfigMetadata('groupNames', false, 1 /* QueryParameter */, 0 /* String */, true),
3192
+ generateParamConfigMetadata('targets', false, 1 /* QueryParameter */, 0 /* String */, true),
3193
+ ];
3194
+ const getDataProviders_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$a, getDataProviders_ConfigPropertyMetadata);
3195
+ const createResourceParams$a = /*#__PURE__*/ createResourceParams$h(getDataProviders_ConfigPropertyMetadata);
3196
+ function keyBuilder$d(luvio, config) {
3197
+ const resourceParams = createResourceParams$a(config);
3198
+ return keyBuilder$e(luvio, resourceParams);
3199
+ }
3200
+ function typeCheckConfig$a(untrustedConfig) {
3201
+ const config = {};
3202
+ typeCheckConfig$h(untrustedConfig, config, getDataProviders_ConfigPropertyMetadata);
3203
+ return config;
3204
+ }
3205
+ function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
3206
+ if (!untrustedIsObject(untrustedConfig)) {
3207
+ return null;
3208
+ }
3209
+ if (process.env.NODE_ENV !== 'production') {
3210
+ validateConfig(untrustedConfig, configPropertyNames);
3211
+ }
3212
+ const config = typeCheckConfig$a(untrustedConfig);
3213
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3214
+ return null;
3215
+ }
3216
+ return config;
3217
+ }
3218
+ function adapterFragment$6(luvio, config) {
3219
+ createResourceParams$a(config);
3220
+ return select$n();
3221
+ }
3222
+ function onFetchResponseSuccess$6(luvio, config, resourceParams, response) {
3223
+ const snapshot = ingestSuccess$a(luvio, resourceParams, response, {
3224
+ config,
3225
+ resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
3226
+ });
3227
+ return luvio.storeBroadcast().then(() => snapshot);
3228
+ }
3229
+ function onFetchResponseError$6(luvio, config, resourceParams, response) {
3230
+ const snapshot = ingestError$6(luvio, resourceParams, response, {
3231
+ config,
3232
+ resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
3233
+ });
3234
+ return luvio.storeBroadcast().then(() => snapshot);
3235
+ }
3236
+ function buildNetworkSnapshot$a(luvio, config, options) {
3237
+ const resourceParams = createResourceParams$a(config);
3238
+ const request = createResourceRequest$a(resourceParams);
3239
+ return luvio.dispatchResourceRequest(request, options)
3240
+ .then((response) => {
3241
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$6(luvio, config, resourceParams, response), () => {
3242
+ const cache = new StoreKeyMap();
3243
+ getResponseCacheKeys$a(cache, luvio, resourceParams, response.body);
3244
+ return cache;
3245
+ });
3246
+ }, (response) => {
3247
+ return luvio.handleErrorResponse(() => onFetchResponseError$6(luvio, config, resourceParams, response));
3248
+ });
3249
+ }
3250
+ function buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext) {
3251
+ return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$a, undefined, false);
3252
+ }
3253
+ function buildCachedSnapshotCachePolicy$6(context, storeLookup) {
3254
+ const { luvio, config } = context;
3255
+ const selector = {
3256
+ recordId: keyBuilder$d(luvio, config),
3257
+ node: adapterFragment$6(luvio, config),
3258
+ variables: {},
3259
+ };
3260
+ const cacheSnapshot = storeLookup(selector, {
3261
+ config,
3262
+ resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
3263
+ });
3264
+ return cacheSnapshot;
3265
+ }
3266
+ const getDataProvidersAdapterFactory = (luvio) => function EinsteinLLM__getDataProviders(untrustedConfig, requestContext) {
3267
+ const config = validateAdapterConfig$a(untrustedConfig, getDataProviders_ConfigPropertyNames);
3268
+ // Invalid or incomplete config
3269
+ if (config === null) {
3270
+ return null;
3271
+ }
3272
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3273
+ buildCachedSnapshotCachePolicy$6, buildNetworkSnapshotCachePolicy$6);
3274
+ };
3275
+
3276
+ function select$m(luvio, params) {
3277
+ return select$q();
3278
+ }
3279
+ function keyBuilder$c(luvio, params) {
3280
+ return keyPrefix + '::PromptTemplateDataProviderInstanceConfigRepresentation:(' + stableJSONStringify(params.body.additionalParam) + '::' + 'definition:' + params.body.definition + '::' + 'groupName:' + params.body.groupName + ')';
3281
+ }
3282
+ function getResponseCacheKeys$9(storeKeyMap, luvio, resourceParams, response) {
3283
+ getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$c(luvio, resourceParams));
3284
+ }
3285
+ function ingestSuccess$9(luvio, resourceParams, response, snapshotRefresh) {
3286
+ const { body } = response;
3287
+ const key = keyBuilder$c(luvio, resourceParams);
3288
+ luvio.storeIngest(key, ingest$4, body);
3289
+ const snapshot = luvio.storeLookup({
3290
+ recordId: key,
3291
+ node: select$m(),
3292
+ variables: {},
3293
+ }, snapshotRefresh);
3294
+ if (process.env.NODE_ENV !== 'production') {
3295
+ if (snapshot.state !== 'Fulfilled') {
3296
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3297
+ }
3298
+ }
3299
+ deepFreeze(snapshot.data);
3300
+ return snapshot;
3301
+ }
3302
+ function ingestError$5(luvio, params, error, snapshotRefresh) {
3303
+ const key = keyBuilder$c(luvio, params);
3304
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3305
+ const storeMetadataParams = {
3306
+ ttl: TTL$4,
3307
+ namespace: keyPrefix,
3308
+ version: VERSION$e,
3309
+ representationName: RepresentationType$4
3310
+ };
3311
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
3312
+ return errorSnapshot;
3313
+ }
3314
+ function createResourceRequest$9(config) {
3315
+ const headers = {};
3316
+ return {
3317
+ baseUri: '/services/data/v65.0',
3318
+ basePath: '/einstein/prompt-templates/data-provider/describe',
3319
+ method: 'post',
3320
+ body: config.body,
3321
+ urlParams: {},
3322
+ queryParams: {},
3323
+ headers,
3324
+ priority: 'normal',
3325
+ };
3326
+ }
3327
+
3328
+ const adapterName$9 = 'getDataProviderInstanceConfig';
3329
+ const getDataProviderInstanceConfig_ConfigPropertyMetadata = [
3330
+ generateParamConfigMetadata('additionalParam', false, 2 /* Body */, 4 /* Unsupported */),
3331
+ generateParamConfigMetadata('definition', true, 2 /* Body */, 0 /* String */),
3332
+ generateParamConfigMetadata('groupName', true, 2 /* Body */, 0 /* String */),
3333
+ ];
3334
+ const getDataProviderInstanceConfig_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$9, getDataProviderInstanceConfig_ConfigPropertyMetadata);
3335
+ const createResourceParams$9 = /*#__PURE__*/ createResourceParams$h(getDataProviderInstanceConfig_ConfigPropertyMetadata);
3336
+ function keyBuilder$b(luvio, config) {
3337
+ const resourceParams = createResourceParams$9(config);
3338
+ return keyBuilder$c(luvio, resourceParams);
3339
+ }
3340
+ function typeCheckConfig$9(untrustedConfig) {
3341
+ const config = {};
3342
+ typeCheckConfig$h(untrustedConfig, config, getDataProviderInstanceConfig_ConfigPropertyMetadata);
3343
+ const untrustedConfig_additionalParam = untrustedConfig.additionalParam;
3344
+ if (untrustedIsObject(untrustedConfig_additionalParam)) {
3345
+ const untrustedConfig_additionalParam_object = {};
3346
+ const untrustedConfig_additionalParam_keys = Object.keys(untrustedConfig_additionalParam);
3347
+ for (let i = 0, arrayLength = untrustedConfig_additionalParam_keys.length; i < arrayLength; i++) {
3348
+ const key = untrustedConfig_additionalParam_keys[i];
3349
+ const untrustedConfig_additionalParam_prop = untrustedConfig_additionalParam[key];
3350
+ if (untrustedConfig_additionalParam_object !== undefined) {
3351
+ untrustedConfig_additionalParam_object[key] = untrustedConfig_additionalParam_prop;
3352
+ }
3353
+ }
3354
+ if (untrustedConfig_additionalParam_object !== undefined && Object.keys(untrustedConfig_additionalParam_object).length >= 0) {
3355
+ config.additionalParam = untrustedConfig_additionalParam_object;
3356
+ }
3357
+ }
3358
+ return config;
3359
+ }
3360
+ function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
3361
+ if (!untrustedIsObject(untrustedConfig)) {
3362
+ return null;
3363
+ }
3364
+ if (process.env.NODE_ENV !== 'production') {
3365
+ validateConfig(untrustedConfig, configPropertyNames);
3366
+ }
3367
+ const config = typeCheckConfig$9(untrustedConfig);
3368
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3369
+ return null;
3370
+ }
3371
+ return config;
3372
+ }
3373
+ function adapterFragment$5(luvio, config) {
3374
+ createResourceParams$9(config);
3375
+ return select$m();
3376
+ }
3377
+ function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
3378
+ const snapshot = ingestSuccess$9(luvio, resourceParams, response, {
3379
+ config,
3380
+ resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
3381
+ });
3382
+ return luvio.storeBroadcast().then(() => snapshot);
3383
+ }
3384
+ function onFetchResponseError$5(luvio, config, resourceParams, response) {
3385
+ const snapshot = ingestError$5(luvio, resourceParams, response, {
3386
+ config,
3387
+ resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
3388
+ });
3389
+ return luvio.storeBroadcast().then(() => snapshot);
3390
+ }
3391
+ function buildNetworkSnapshot$9(luvio, config, options) {
3392
+ const resourceParams = createResourceParams$9(config);
3393
+ const request = createResourceRequest$9(resourceParams);
3394
+ return luvio.dispatchResourceRequest(request, options)
3395
+ .then((response) => {
3396
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
3397
+ const cache = new StoreKeyMap();
3398
+ getResponseCacheKeys$9(cache, luvio, resourceParams, response.body);
3399
+ return cache;
3400
+ });
3401
+ }, (response) => {
3402
+ return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
3403
+ });
3404
+ }
3405
+ function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
3406
+ return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$9, 'get', false);
3407
+ }
3408
+ function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
3409
+ const { luvio, config } = context;
3410
+ const selector = {
3411
+ recordId: keyBuilder$b(luvio, config),
3412
+ node: adapterFragment$5(luvio, config),
3413
+ variables: {},
3414
+ };
3415
+ const cacheSnapshot = storeLookup(selector, {
3416
+ config,
3417
+ resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
3418
+ });
3419
+ return cacheSnapshot;
3420
+ }
3421
+ const getDataProviderInstanceConfigAdapterFactory = (luvio) => function EinsteinLLM__getDataProviderInstanceConfig(untrustedConfig, requestContext) {
3422
+ const config = validateAdapterConfig$9(untrustedConfig, getDataProviderInstanceConfig_ConfigPropertyNames);
3423
+ // Invalid or incomplete config
3424
+ if (config === null) {
3425
+ return null;
3426
+ }
3427
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3428
+ buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
3429
+ };
3430
+
3431
+ function validate$f(obj, path = 'PromptTemplateDataProviderTypeConfigRepresentation') {
3432
+ const v_error = (() => {
3433
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3434
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3435
+ }
3436
+ if (obj.description !== undefined) {
3437
+ const obj_description = obj.description;
3438
+ const path_description = path + '.description';
3439
+ if (typeof obj_description !== 'string') {
3440
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
3441
+ }
3442
+ }
3443
+ const obj_groupName = obj.groupName;
3444
+ const path_groupName = path + '.groupName';
3445
+ if (typeof obj_groupName !== 'string') {
3446
+ return new TypeError('Expected "string" but received "' + typeof obj_groupName + '" (at "' + path_groupName + '")');
3447
+ }
3448
+ const obj_icon = obj.icon;
3449
+ const path_icon = path + '.icon';
3450
+ if (typeof obj_icon !== 'string') {
3451
+ return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
3452
+ }
3453
+ const obj_isTopLevel = obj.isTopLevel;
3454
+ const path_isTopLevel = path + '.isTopLevel';
3455
+ if (typeof obj_isTopLevel !== 'boolean') {
3456
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isTopLevel + '" (at "' + path_isTopLevel + '")');
3457
+ }
3458
+ const obj_label = obj.label;
3459
+ const path_label = path + '.label';
3460
+ if (typeof obj_label !== 'string') {
3461
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
3462
+ }
3463
+ if (obj.parentNode !== undefined) {
3464
+ const obj_parentNode = obj.parentNode;
3465
+ const path_parentNode = path + '.parentNode';
3466
+ if (typeof obj_parentNode !== 'string') {
3467
+ return new TypeError('Expected "string" but received "' + typeof obj_parentNode + '" (at "' + path_parentNode + '")');
3468
+ }
3469
+ }
3470
+ if (obj.scope !== undefined) {
3471
+ const obj_scope = obj.scope;
3472
+ const path_scope = path + '.scope';
3473
+ if (obj_scope === undefined) {
3474
+ return new TypeError('Expected "defined" but received "' + typeof obj_scope + '" (at "' + path_scope + '")');
3475
+ }
3476
+ }
3477
+ })();
3478
+ return v_error === undefined ? null : v_error;
3479
+ }
3480
+
3481
+ const TTL$2 = 300;
3482
+ const VERSION$c = "212332dac1decc071b476742df3440fb";
3483
+ function validate$e(obj, path = 'PromptTemplateDataProviderTypeConfigCollectionRepresentation') {
3484
+ const v_error = (() => {
3485
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3486
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3487
+ }
3488
+ const obj_dataProviderTypeConfigs = obj.dataProviderTypeConfigs;
3489
+ const path_dataProviderTypeConfigs = path + '.dataProviderTypeConfigs';
3490
+ if (!ArrayIsArray(obj_dataProviderTypeConfigs)) {
3491
+ return new TypeError('Expected "array" but received "' + typeof obj_dataProviderTypeConfigs + '" (at "' + path_dataProviderTypeConfigs + '")');
3492
+ }
3493
+ for (let i = 0; i < obj_dataProviderTypeConfigs.length; i++) {
3494
+ const obj_dataProviderTypeConfigs_item = obj_dataProviderTypeConfigs[i];
3495
+ const path_dataProviderTypeConfigs_item = path_dataProviderTypeConfigs + '[' + i + ']';
3496
+ const referencepath_dataProviderTypeConfigs_itemValidationError = validate$f(obj_dataProviderTypeConfigs_item, path_dataProviderTypeConfigs_item);
3497
+ if (referencepath_dataProviderTypeConfigs_itemValidationError !== null) {
3498
+ let message = 'Object doesn\'t match PromptTemplateDataProviderTypeConfigRepresentation (at "' + path_dataProviderTypeConfigs_item + '")\n';
3499
+ message += referencepath_dataProviderTypeConfigs_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3500
+ return new TypeError(message);
3501
+ }
3502
+ }
3503
+ })();
3504
+ return v_error === undefined ? null : v_error;
3505
+ }
3506
+ const RepresentationType$2 = 'PromptTemplateDataProviderTypeConfigCollectionRepresentation';
3507
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
3508
+ return input;
3509
+ }
3510
+ const select$l = function PromptTemplateDataProviderTypeConfigCollectionRepresentationSelect() {
3511
+ return {
3512
+ kind: 'Fragment',
3513
+ version: VERSION$c,
3514
+ private: [],
3515
+ opaque: true
3516
+ };
3517
+ };
3518
+ function equals$c(existing, incoming) {
3519
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
3520
+ return false;
3521
+ }
3522
+ return true;
3523
+ }
3524
+ const ingest$2 = function PromptTemplateDataProviderTypeConfigCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
3525
+ if (process.env.NODE_ENV !== 'production') {
3526
+ const validateError = validate$e(input);
3527
+ if (validateError !== null) {
3528
+ throw validateError;
3529
+ }
3530
+ }
3531
+ const key = path.fullPath;
3532
+ const ttlToUse = TTL$2;
3533
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "EinsteinLLM", VERSION$c, RepresentationType$2, equals$c);
3534
+ return createLink(key);
3535
+ };
3536
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
3537
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3538
+ const rootKey = fullPathFactory();
3539
+ rootKeySet.set(rootKey, {
3540
+ namespace: keyPrefix,
3541
+ representationName: RepresentationType$2,
3542
+ mergeable: false
3543
+ });
3544
+ }
3545
+
3546
+ function select$k(luvio, params) {
3547
+ return select$l();
3548
+ }
3549
+ function keyBuilder$a(luvio, params) {
3550
+ return keyPrefix + '::PromptTemplateDataProviderTypeConfigCollectionRepresentation:(' + 'templateType:' + params.urlParams.templateType + ')';
3551
+ }
3552
+ function getResponseCacheKeys$8(storeKeyMap, luvio, resourceParams, response) {
3553
+ getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$a(luvio, resourceParams));
3554
+ }
3555
+ function ingestSuccess$8(luvio, resourceParams, response, snapshotRefresh) {
3556
+ const { body } = response;
3557
+ const key = keyBuilder$a(luvio, resourceParams);
3558
+ luvio.storeIngest(key, ingest$2, body);
3559
+ const snapshot = luvio.storeLookup({
3560
+ recordId: key,
3561
+ node: select$k(),
3562
+ variables: {},
3563
+ }, snapshotRefresh);
3564
+ if (process.env.NODE_ENV !== 'production') {
3565
+ if (snapshot.state !== 'Fulfilled') {
3566
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3567
+ }
3568
+ }
3569
+ deepFreeze(snapshot.data);
3570
+ return snapshot;
3571
+ }
3572
+ function ingestError$4(luvio, params, error, snapshotRefresh) {
3573
+ const key = keyBuilder$a(luvio, params);
3574
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3575
+ const storeMetadataParams = {
3576
+ ttl: TTL$2,
3577
+ namespace: keyPrefix,
3578
+ version: VERSION$c,
3579
+ representationName: RepresentationType$2
3580
+ };
3581
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
3582
+ return errorSnapshot;
3583
+ }
3584
+ function createResourceRequest$8(config) {
3585
+ const headers = {};
3586
+ return {
3587
+ baseUri: '/services/data/v65.0',
3588
+ basePath: '/einstein/prompt-templates/data-provider-types/' + config.urlParams.templateType + '',
3589
+ method: 'get',
3590
+ body: null,
3591
+ urlParams: config.urlParams,
3592
+ queryParams: {},
3593
+ headers,
3594
+ priority: 'normal',
3595
+ };
3596
+ }
3597
+
3598
+ const adapterName$8 = 'getDataProviderTypeConfigs';
3599
+ const getDataProviderTypeConfigs_ConfigPropertyMetadata = [
3600
+ generateParamConfigMetadata('templateType', true, 0 /* UrlParameter */, 0 /* String */),
3601
+ ];
3602
+ const getDataProviderTypeConfigs_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$8, getDataProviderTypeConfigs_ConfigPropertyMetadata);
3603
+ const createResourceParams$8 = /*#__PURE__*/ createResourceParams$h(getDataProviderTypeConfigs_ConfigPropertyMetadata);
3604
+ function keyBuilder$9(luvio, config) {
3605
+ const resourceParams = createResourceParams$8(config);
3606
+ return keyBuilder$a(luvio, resourceParams);
3607
+ }
3608
+ function typeCheckConfig$8(untrustedConfig) {
3609
+ const config = {};
3610
+ typeCheckConfig$h(untrustedConfig, config, getDataProviderTypeConfigs_ConfigPropertyMetadata);
3611
+ return config;
3612
+ }
3613
+ function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
3614
+ if (!untrustedIsObject(untrustedConfig)) {
3615
+ return null;
3616
+ }
3617
+ if (process.env.NODE_ENV !== 'production') {
3618
+ validateConfig(untrustedConfig, configPropertyNames);
3619
+ }
3620
+ const config = typeCheckConfig$8(untrustedConfig);
3621
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3622
+ return null;
3623
+ }
3624
+ return config;
3625
+ }
3626
+ function adapterFragment$4(luvio, config) {
3627
+ createResourceParams$8(config);
3628
+ return select$k();
3629
+ }
3630
+ function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
3631
+ const snapshot = ingestSuccess$8(luvio, resourceParams, response, {
3632
+ config,
3633
+ resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
3634
+ });
3635
+ return luvio.storeBroadcast().then(() => snapshot);
3636
+ }
3637
+ function onFetchResponseError$4(luvio, config, resourceParams, response) {
3638
+ const snapshot = ingestError$4(luvio, resourceParams, response, {
3639
+ config,
3640
+ resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
3641
+ });
3642
+ return luvio.storeBroadcast().then(() => snapshot);
3643
+ }
3644
+ function buildNetworkSnapshot$8(luvio, config, options) {
3645
+ const resourceParams = createResourceParams$8(config);
3646
+ const request = createResourceRequest$8(resourceParams);
3647
+ return luvio.dispatchResourceRequest(request, options)
3648
+ .then((response) => {
3649
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
3650
+ const cache = new StoreKeyMap();
3651
+ getResponseCacheKeys$8(cache, luvio, resourceParams, response.body);
3652
+ return cache;
3653
+ });
3654
+ }, (response) => {
3655
+ return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
3656
+ });
3657
+ }
3658
+ function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
3659
+ return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$8, undefined, false);
3660
+ }
3661
+ function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
3662
+ const { luvio, config } = context;
3663
+ const selector = {
3664
+ recordId: keyBuilder$9(luvio, config),
3665
+ node: adapterFragment$4(luvio, config),
3666
+ variables: {},
3667
+ };
3668
+ const cacheSnapshot = storeLookup(selector, {
3669
+ config,
3670
+ resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
3671
+ });
3672
+ return cacheSnapshot;
3673
+ }
3674
+ const getDataProviderTypeConfigsAdapterFactory = (luvio) => function EinsteinLLM__getDataProviderTypeConfigs(untrustedConfig, requestContext) {
3675
+ const config = validateAdapterConfig$8(untrustedConfig, getDataProviderTypeConfigs_ConfigPropertyNames);
3676
+ // Invalid or incomplete config
3677
+ if (config === null) {
3678
+ return null;
3679
+ }
3680
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3681
+ buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
3682
+ };
3683
+
3684
+ function select$j(luvio, params) {
3685
+ return select$v();
3686
+ }
3687
+ function keyBuilder$8(luvio, params) {
3688
+ return keyPrefix + '::EinsteinPromptRecordRepresentation:(' + 'versionId:' + params.queryParams.versionId + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ')';
3689
+ }
3690
+ function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
3691
+ getTypeCacheKeys$7(storeKeyMap, luvio, response, () => keyBuilder$8(luvio, resourceParams));
3692
+ }
3693
+ function ingestSuccess$7(luvio, resourceParams, response, snapshotRefresh) {
3694
+ const { body } = response;
3695
+ const key = keyBuilder$8(luvio, resourceParams);
3696
+ luvio.storeIngest(key, ingest$7, body);
3697
+ const snapshot = luvio.storeLookup({
3698
+ recordId: key,
3699
+ node: select$j(),
3700
+ variables: {},
3701
+ }, snapshotRefresh);
3702
+ if (process.env.NODE_ENV !== 'production') {
3703
+ if (snapshot.state !== 'Fulfilled') {
3704
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3705
+ }
3706
+ }
3707
+ deepFreeze(snapshot.data);
3708
+ return snapshot;
3709
+ }
3710
+ function ingestError$3(luvio, params, error, snapshotRefresh) {
3711
+ const key = keyBuilder$8(luvio, params);
3712
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3713
+ const storeMetadataParams = {
3714
+ ttl: TTL$7,
3715
+ namespace: keyPrefix,
3716
+ version: VERSION$h,
3717
+ representationName: RepresentationType$7
3718
+ };
3719
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
3720
+ return errorSnapshot;
3721
+ }
3722
+ function createResourceRequest$7(config) {
3723
+ const headers = {};
3724
+ return {
3725
+ baseUri: '/services/data/v65.0',
3726
+ basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '',
3727
+ method: 'get',
3728
+ body: null,
3729
+ urlParams: config.urlParams,
3730
+ queryParams: config.queryParams,
3731
+ headers,
3732
+ priority: 'normal',
3733
+ };
3734
+ }
3735
+
3736
+ const adapterName$7 = 'getPromptTemplate';
3737
+ const getPromptTemplate_ConfigPropertyMetadata = [
3738
+ generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
3739
+ generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
3740
+ ];
3741
+ const getPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, getPromptTemplate_ConfigPropertyMetadata);
3742
+ const createResourceParams$7 = /*#__PURE__*/ createResourceParams$h(getPromptTemplate_ConfigPropertyMetadata);
3743
+ function keyBuilder$7(luvio, config) {
3744
+ const resourceParams = createResourceParams$7(config);
3745
+ return keyBuilder$8(luvio, resourceParams);
3746
+ }
3747
+ function typeCheckConfig$7(untrustedConfig) {
3748
+ const config = {};
3749
+ typeCheckConfig$h(untrustedConfig, config, getPromptTemplate_ConfigPropertyMetadata);
3750
+ return config;
3751
+ }
3752
+ function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
3753
+ if (!untrustedIsObject(untrustedConfig)) {
3754
+ return null;
3755
+ }
3756
+ if (process.env.NODE_ENV !== 'production') {
3757
+ validateConfig(untrustedConfig, configPropertyNames);
3758
+ }
3759
+ const config = typeCheckConfig$7(untrustedConfig);
3760
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3761
+ return null;
3762
+ }
3763
+ return config;
3764
+ }
3765
+ function adapterFragment$3(luvio, config) {
3766
+ createResourceParams$7(config);
3767
+ return select$j();
3768
+ }
3769
+ function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
3770
+ const snapshot = ingestSuccess$7(luvio, resourceParams, response, {
3771
+ config,
3772
+ resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
3773
+ });
3774
+ return luvio.storeBroadcast().then(() => snapshot);
3775
+ }
3776
+ function onFetchResponseError$3(luvio, config, resourceParams, response) {
3777
+ const snapshot = ingestError$3(luvio, resourceParams, response, {
3778
+ config,
3779
+ resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
3780
+ });
3781
+ return luvio.storeBroadcast().then(() => snapshot);
3782
+ }
3783
+ function buildNetworkSnapshot$7(luvio, config, options) {
3784
+ const resourceParams = createResourceParams$7(config);
3785
+ const request = createResourceRequest$7(resourceParams);
3786
+ return luvio.dispatchResourceRequest(request, options)
3787
+ .then((response) => {
3788
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
3789
+ const cache = new StoreKeyMap();
3790
+ getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
3791
+ return cache;
3792
+ });
3793
+ }, (response) => {
3794
+ return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
3795
+ });
3796
+ }
3797
+ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
3798
+ return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$7, undefined, false);
3799
+ }
3800
+ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
3801
+ const { luvio, config } = context;
3802
+ const selector = {
3803
+ recordId: keyBuilder$7(luvio, config),
3804
+ node: adapterFragment$3(luvio, config),
3805
+ variables: {},
3806
+ };
3807
+ const cacheSnapshot = storeLookup(selector, {
3808
+ config,
3809
+ resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
3810
+ });
3811
+ return cacheSnapshot;
3812
+ }
3813
+ const getPromptTemplateAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplate(untrustedConfig, requestContext) {
3814
+ const config = validateAdapterConfig$7(untrustedConfig, getPromptTemplate_ConfigPropertyNames);
3815
+ // Invalid or incomplete config
3816
+ if (config === null) {
3817
+ return null;
3818
+ }
3819
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3820
+ buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
3821
+ };
3822
+
3823
+ function select$i(luvio, params) {
3824
+ return select$v();
3825
+ }
3826
+ function keyBuilder$6(luvio, params) {
3827
+ return keyPrefix + '::EinsteinPromptRecordRepresentation:(' + 'includingContent:' + params.queryParams.includingContent + ',' + 'includingVersionDetail:' + params.queryParams.includingVersionDetail + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ')';
3828
+ }
3829
+ function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
3830
+ getTypeCacheKeys$7(storeKeyMap, luvio, response, () => keyBuilder$6(luvio, resourceParams));
3831
+ }
3832
+ function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
3833
+ const { body } = response;
3834
+ const key = keyBuilder$6(luvio, resourceParams);
3835
+ luvio.storeIngest(key, ingest$7, body);
3836
+ const snapshot = luvio.storeLookup({
3837
+ recordId: key,
3838
+ node: select$i(),
3839
+ variables: {},
3840
+ }, snapshotRefresh);
3841
+ if (process.env.NODE_ENV !== 'production') {
3842
+ if (snapshot.state !== 'Fulfilled') {
3843
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3844
+ }
3845
+ }
3846
+ deepFreeze(snapshot.data);
3847
+ return snapshot;
3848
+ }
3849
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
3850
+ const key = keyBuilder$6(luvio, params);
3851
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3852
+ const storeMetadataParams = {
3853
+ ttl: TTL$7,
3854
+ namespace: keyPrefix,
3855
+ version: VERSION$h,
3856
+ representationName: RepresentationType$7
3857
+ };
3858
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
3859
+ return errorSnapshot;
3860
+ }
3861
+ function createResourceRequest$6(config) {
3862
+ const headers = {};
3863
+ return {
3864
+ baseUri: '/services/data/v65.0',
3865
+ basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/versions',
3866
+ method: 'get',
3867
+ body: null,
3868
+ urlParams: config.urlParams,
3869
+ queryParams: config.queryParams,
3870
+ headers,
3871
+ priority: 'normal',
3872
+ };
3873
+ }
3874
+
3875
+ const adapterName$6 = 'getPromptTemplateVersions';
3876
+ const getPromptTemplateVersions_ConfigPropertyMetadata = [
3877
+ generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
3878
+ generateParamConfigMetadata('includingContent', false, 1 /* QueryParameter */, 1 /* Boolean */),
3879
+ generateParamConfigMetadata('includingVersionDetail', false, 1 /* QueryParameter */, 1 /* Boolean */),
3880
+ ];
3881
+ const getPromptTemplateVersions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getPromptTemplateVersions_ConfigPropertyMetadata);
3882
+ const createResourceParams$6 = /*#__PURE__*/ createResourceParams$h(getPromptTemplateVersions_ConfigPropertyMetadata);
3883
+ function keyBuilder$5(luvio, config) {
3884
+ const resourceParams = createResourceParams$6(config);
3885
+ return keyBuilder$6(luvio, resourceParams);
3886
+ }
3887
+ function typeCheckConfig$6(untrustedConfig) {
3888
+ const config = {};
3889
+ typeCheckConfig$h(untrustedConfig, config, getPromptTemplateVersions_ConfigPropertyMetadata);
3890
+ return config;
3891
+ }
3892
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
3893
+ if (!untrustedIsObject(untrustedConfig)) {
3894
+ return null;
3895
+ }
3896
+ if (process.env.NODE_ENV !== 'production') {
3897
+ validateConfig(untrustedConfig, configPropertyNames);
3898
+ }
3899
+ const config = typeCheckConfig$6(untrustedConfig);
3900
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3901
+ return null;
3902
+ }
3903
+ return config;
3904
+ }
3905
+ function adapterFragment$2(luvio, config) {
3906
+ createResourceParams$6(config);
3907
+ return select$i();
3908
+ }
3909
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
3910
+ const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
3911
+ config,
3912
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
3913
+ });
3914
+ return luvio.storeBroadcast().then(() => snapshot);
3915
+ }
3916
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
3917
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
3918
+ config,
3919
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
3920
+ });
3921
+ return luvio.storeBroadcast().then(() => snapshot);
3922
+ }
3923
+ function buildNetworkSnapshot$6(luvio, config, options) {
3924
+ const resourceParams = createResourceParams$6(config);
3925
+ const request = createResourceRequest$6(resourceParams);
3926
+ return luvio.dispatchResourceRequest(request, options)
3927
+ .then((response) => {
3928
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
3929
+ const cache = new StoreKeyMap();
3930
+ getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
3931
+ return cache;
3932
+ });
3933
+ }, (response) => {
3934
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
3935
+ });
3936
+ }
3937
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
3938
+ return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
3939
+ }
3940
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
3941
+ const { luvio, config } = context;
3942
+ const selector = {
3943
+ recordId: keyBuilder$5(luvio, config),
3944
+ node: adapterFragment$2(luvio, config),
3945
+ variables: {},
3946
+ };
3947
+ const cacheSnapshot = storeLookup(selector, {
3948
+ config,
3949
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
3950
+ });
3951
+ return cacheSnapshot;
3952
+ }
3953
+ const getPromptTemplateVersionsAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplateVersions(untrustedConfig, requestContext) {
3954
+ const config = validateAdapterConfig$6(untrustedConfig, getPromptTemplateVersions_ConfigPropertyNames);
3955
+ // Invalid or incomplete config
3956
+ if (config === null) {
3957
+ return null;
3958
+ }
3959
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3960
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
3961
+ };
3962
+
3963
+ function select$h(luvio, params) {
3964
+ return select$s();
3965
+ }
3966
+ function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
3967
+ getTypeCacheKeys$5(storeKeyMap, luvio, response);
3968
+ }
3969
+ function ingestSuccess$5(luvio, resourceParams, response) {
3970
+ const { body } = response;
3971
+ const key = keyBuilderFromType$1(luvio, body);
3972
+ luvio.storeIngest(key, ingest$5, body);
3973
+ const snapshot = luvio.storeLookup({
3974
+ recordId: key,
3975
+ node: select$h(),
3976
+ variables: {},
3977
+ });
3978
+ if (process.env.NODE_ENV !== 'production') {
3979
+ if (snapshot.state !== 'Fulfilled') {
3980
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3981
+ }
3982
+ }
3983
+ deepFreeze(snapshot.data);
3984
+ return snapshot;
3985
+ }
3986
+ function createResourceRequest$5(config) {
3987
+ const headers = {};
3988
+ return {
3989
+ baseUri: '/services/data/v65.0',
3990
+ basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/versions',
3991
+ method: 'post',
3992
+ body: config.body,
3993
+ urlParams: config.urlParams,
3994
+ queryParams: {},
3995
+ headers,
3996
+ priority: 'normal',
3997
+ };
3998
+ }
3999
+
4000
+ const adapterName$5 = 'createPromptTemplateVersion';
4001
+ const createPromptTemplateVersion_ConfigPropertyMetadata = [
4002
+ generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
4003
+ generateParamConfigMetadata('apiName', true, 2 /* Body */, 0 /* String */),
4004
+ generateParamConfigMetadata('childRelationships', true, 2 /* Body */, 4 /* Unsupported */),
4005
+ generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported */),
4006
+ generateParamConfigMetadata('id', false, 2 /* Body */, 0 /* String */),
4007
+ ];
4008
+ const createPromptTemplateVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, createPromptTemplateVersion_ConfigPropertyMetadata);
4009
+ const createResourceParams$5 = /*#__PURE__*/ createResourceParams$h(createPromptTemplateVersion_ConfigPropertyMetadata);
4010
+ function typeCheckConfig$5(untrustedConfig) {
4011
+ const config = {};
4012
+ typeCheckConfig$h(untrustedConfig, config, createPromptTemplateVersion_ConfigPropertyMetadata);
4013
+ const untrustedConfig_childRelationships = untrustedConfig.childRelationships;
4014
+ if (untrustedIsObject(untrustedConfig_childRelationships)) {
4015
+ const untrustedConfig_childRelationships_object = {};
4016
+ const untrustedConfig_childRelationships_keys = Object.keys(untrustedConfig_childRelationships);
4017
+ for (let i = 0, arrayLength = untrustedConfig_childRelationships_keys.length; i < arrayLength; i++) {
4018
+ const key = untrustedConfig_childRelationships_keys[i];
4019
+ const untrustedConfig_childRelationships_prop = untrustedConfig_childRelationships[key];
4020
+ if (untrustedConfig_childRelationships_object !== undefined) {
4021
+ untrustedConfig_childRelationships_object[key] = untrustedConfig_childRelationships_prop;
4022
+ }
4023
+ }
4024
+ if (untrustedConfig_childRelationships_object !== undefined && Object.keys(untrustedConfig_childRelationships_object).length >= 0) {
4025
+ config.childRelationships = untrustedConfig_childRelationships_object;
4026
+ }
4027
+ }
4028
+ const untrustedConfig_fields = untrustedConfig.fields;
4029
+ if (untrustedIsObject(untrustedConfig_fields)) {
4030
+ const untrustedConfig_fields_object = {};
4031
+ const untrustedConfig_fields_keys = Object.keys(untrustedConfig_fields);
4032
+ for (let i = 0, arrayLength = untrustedConfig_fields_keys.length; i < arrayLength; i++) {
4033
+ const key = untrustedConfig_fields_keys[i];
4034
+ const untrustedConfig_fields_prop = untrustedConfig_fields[key];
4035
+ if (untrustedConfig_fields_object !== undefined) {
4036
+ untrustedConfig_fields_object[key] = untrustedConfig_fields_prop;
4037
+ }
4038
+ }
4039
+ if (untrustedConfig_fields_object !== undefined && Object.keys(untrustedConfig_fields_object).length >= 0) {
4040
+ config.fields = untrustedConfig_fields_object;
4041
+ }
4042
+ }
4043
+ return config;
4044
+ }
4045
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
4046
+ if (!untrustedIsObject(untrustedConfig)) {
4047
+ return null;
4048
+ }
4049
+ if (process.env.NODE_ENV !== 'production') {
4050
+ validateConfig(untrustedConfig, configPropertyNames);
4051
+ }
4052
+ const config = typeCheckConfig$5(untrustedConfig);
4053
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4054
+ return null;
4055
+ }
4056
+ return config;
4057
+ }
4058
+ function buildNetworkSnapshot$5(luvio, config, options) {
4059
+ const resourceParams = createResourceParams$5(config);
4060
+ const request = createResourceRequest$5(resourceParams);
4061
+ return luvio.dispatchResourceRequest(request, options)
4062
+ .then((response) => {
4063
+ return luvio.handleSuccessResponse(() => {
4064
+ const snapshot = ingestSuccess$5(luvio, resourceParams, response);
4065
+ return luvio.storeBroadcast().then(() => snapshot);
4066
+ }, () => {
4067
+ const cache = new StoreKeyMap();
4068
+ getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
4069
+ return cache;
4070
+ });
4071
+ }, (response) => {
4072
+ deepFreeze(response);
4073
+ throw response;
4074
+ });
4075
+ }
4076
+ const createPromptTemplateVersionAdapterFactory = (luvio) => {
4077
+ return function createPromptTemplateVersion(untrustedConfig) {
4078
+ const config = validateAdapterConfig$5(untrustedConfig, createPromptTemplateVersion_ConfigPropertyNames);
4079
+ // Invalid or incomplete config
4080
+ if (config === null) {
4081
+ throw new Error('Invalid config for "createPromptTemplateVersion"');
4082
+ }
4083
+ return buildNetworkSnapshot$5(luvio, config);
4084
+ };
4085
+ };
4086
+
4087
+ function select$g(luvio, params) {
4088
+ return select$v();
4089
+ }
4090
+ function keyBuilder$4(luvio, params) {
4091
+ return keyPrefix + '::EinsteinPromptRecordRepresentation:(' + 'includingContent:' + params.queryParams.includingContent + ',' + 'includingVersionDetail:' + params.queryParams.includingVersionDetail + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ',' + 'versionId:' + params.urlParams.versionId + ')';
4092
+ }
4093
+ function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
4094
+ getTypeCacheKeys$7(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
4095
+ }
4096
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
4097
+ const { body } = response;
4098
+ const key = keyBuilder$4(luvio, resourceParams);
4099
+ luvio.storeIngest(key, ingest$7, body);
4100
+ const snapshot = luvio.storeLookup({
4101
+ recordId: key,
4102
+ node: select$g(),
4103
+ variables: {},
4104
+ }, snapshotRefresh);
4105
+ if (process.env.NODE_ENV !== 'production') {
4106
+ if (snapshot.state !== 'Fulfilled') {
4107
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
4108
+ }
4109
+ }
4110
+ deepFreeze(snapshot.data);
4111
+ return snapshot;
4112
+ }
4113
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
4114
+ const key = keyBuilder$4(luvio, params);
4115
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
4116
+ const storeMetadataParams = {
4117
+ ttl: TTL$7,
4118
+ namespace: keyPrefix,
4119
+ version: VERSION$h,
4120
+ representationName: RepresentationType$7
4121
+ };
2637
4122
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
2638
4123
  return errorSnapshot;
2639
4124
  }
@@ -2641,7 +4126,7 @@ function createResourceRequest$4(config) {
2641
4126
  const headers = {};
2642
4127
  return {
2643
4128
  baseUri: '/services/data/v65.0',
2644
- basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '',
4129
+ basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/versions/' + config.urlParams.versionId + '',
2645
4130
  method: 'get',
2646
4131
  body: null,
2647
4132
  urlParams: config.urlParams,
@@ -2651,20 +4136,22 @@ function createResourceRequest$4(config) {
2651
4136
  };
2652
4137
  }
2653
4138
 
2654
- const adapterName$4 = 'getPromptTemplate';
2655
- const getPromptTemplate_ConfigPropertyMetadata = [
4139
+ const adapterName$4 = 'getPromptTemplateVersion';
4140
+ const getPromptTemplateVersion_ConfigPropertyMetadata = [
2656
4141
  generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
2657
- generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
4142
+ generateParamConfigMetadata('versionId', true, 0 /* UrlParameter */, 0 /* String */),
4143
+ generateParamConfigMetadata('includingContent', false, 1 /* QueryParameter */, 1 /* Boolean */),
4144
+ generateParamConfigMetadata('includingVersionDetail', false, 1 /* QueryParameter */, 1 /* Boolean */),
2658
4145
  ];
2659
- const getPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getPromptTemplate_ConfigPropertyMetadata);
2660
- const createResourceParams$4 = /*#__PURE__*/ createResourceParams$a(getPromptTemplate_ConfigPropertyMetadata);
4146
+ const getPromptTemplateVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getPromptTemplateVersion_ConfigPropertyMetadata);
4147
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$h(getPromptTemplateVersion_ConfigPropertyMetadata);
2661
4148
  function keyBuilder$3(luvio, config) {
2662
4149
  const resourceParams = createResourceParams$4(config);
2663
4150
  return keyBuilder$4(luvio, resourceParams);
2664
4151
  }
2665
4152
  function typeCheckConfig$4(untrustedConfig) {
2666
4153
  const config = {};
2667
- typeCheckConfig$a(untrustedConfig, config, getPromptTemplate_ConfigPropertyMetadata);
4154
+ typeCheckConfig$h(untrustedConfig, config, getPromptTemplateVersion_ConfigPropertyMetadata);
2668
4155
  return config;
2669
4156
  }
2670
4157
  function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
@@ -2682,7 +4169,7 @@ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
2682
4169
  }
2683
4170
  function adapterFragment$1(luvio, config) {
2684
4171
  createResourceParams$4(config);
2685
- return select$e();
4172
+ return select$g();
2686
4173
  }
2687
4174
  function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
2688
4175
  const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
@@ -2713,7 +4200,7 @@ function buildNetworkSnapshot$4(luvio, config, options) {
2713
4200
  });
2714
4201
  }
2715
4202
  function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
2716
- return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
4203
+ return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
2717
4204
  }
2718
4205
  function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
2719
4206
  const { luvio, config } = context;
@@ -2728,8 +4215,8 @@ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
2728
4215
  });
2729
4216
  return cacheSnapshot;
2730
4217
  }
2731
- const getPromptTemplateAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplate(untrustedConfig, requestContext) {
2732
- const config = validateAdapterConfig$4(untrustedConfig, getPromptTemplate_ConfigPropertyNames);
4218
+ const getPromptTemplateVersionAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplateVersion(untrustedConfig, requestContext) {
4219
+ const config = validateAdapterConfig$4(untrustedConfig, getPromptTemplateVersion_ConfigPropertyNames);
2733
4220
  // Invalid or incomplete config
2734
4221
  if (config === null) {
2735
4222
  return null;
@@ -2738,19 +4225,19 @@ const getPromptTemplateAdapterFactory = (luvio) => function EinsteinLLM__getProm
2738
4225
  buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
2739
4226
  };
2740
4227
 
2741
- function select$d(luvio, params) {
2742
- return select$g();
4228
+ function select$f(luvio, params) {
4229
+ return select$s();
2743
4230
  }
2744
4231
  function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
2745
- getTypeCacheKeys$2(storeKeyMap, luvio, response);
4232
+ getTypeCacheKeys$5(storeKeyMap, luvio, response);
2746
4233
  }
2747
4234
  function ingestSuccess$3(luvio, resourceParams, response) {
2748
4235
  const { body } = response;
2749
4236
  const key = keyBuilderFromType$1(luvio, body);
2750
- luvio.storeIngest(key, ingest$2, body);
4237
+ luvio.storeIngest(key, ingest$5, body);
2751
4238
  const snapshot = luvio.storeLookup({
2752
4239
  recordId: key,
2753
- node: select$d(),
4240
+ node: select$f(),
2754
4241
  variables: {},
2755
4242
  });
2756
4243
  if (process.env.NODE_ENV !== 'production') {
@@ -2765,8 +4252,8 @@ function createResourceRequest$3(config) {
2765
4252
  const headers = {};
2766
4253
  return {
2767
4254
  baseUri: '/services/data/v65.0',
2768
- basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/versions',
2769
- method: 'post',
4255
+ basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/versions/' + config.urlParams.versionId + '',
4256
+ method: 'put',
2770
4257
  body: config.body,
2771
4258
  urlParams: config.urlParams,
2772
4259
  queryParams: {},
@@ -2775,20 +4262,20 @@ function createResourceRequest$3(config) {
2775
4262
  };
2776
4263
  }
2777
4264
 
2778
- const adapterName$3 = 'createPromptTemplateVersion';
2779
- const createPromptTemplateVersion_ConfigPropertyMetadata = [
4265
+ const adapterName$3 = 'updatePromptTemplateVersion';
4266
+ const updatePromptTemplateVersion_ConfigPropertyMetadata = [
2780
4267
  generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
4268
+ generateParamConfigMetadata('versionId', true, 0 /* UrlParameter */, 0 /* String */),
2781
4269
  generateParamConfigMetadata('apiName', true, 2 /* Body */, 0 /* String */),
2782
4270
  generateParamConfigMetadata('childRelationships', true, 2 /* Body */, 4 /* Unsupported */),
2783
- generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported */, true),
4271
+ generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported */),
2784
4272
  generateParamConfigMetadata('id', false, 2 /* Body */, 0 /* String */),
2785
- generateParamConfigMetadata('isStandard', true, 2 /* Body */, 1 /* Boolean */),
2786
4273
  ];
2787
- const createPromptTemplateVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createPromptTemplateVersion_ConfigPropertyMetadata);
2788
- const createResourceParams$3 = /*#__PURE__*/ createResourceParams$a(createPromptTemplateVersion_ConfigPropertyMetadata);
4274
+ const updatePromptTemplateVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, updatePromptTemplateVersion_ConfigPropertyMetadata);
4275
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$h(updatePromptTemplateVersion_ConfigPropertyMetadata);
2789
4276
  function typeCheckConfig$3(untrustedConfig) {
2790
4277
  const config = {};
2791
- typeCheckConfig$a(untrustedConfig, config, createPromptTemplateVersion_ConfigPropertyMetadata);
4278
+ typeCheckConfig$h(untrustedConfig, config, updatePromptTemplateVersion_ConfigPropertyMetadata);
2792
4279
  const untrustedConfig_childRelationships = untrustedConfig.childRelationships;
2793
4280
  if (untrustedIsObject(untrustedConfig_childRelationships)) {
2794
4281
  const untrustedConfig_childRelationships_object = {};
@@ -2805,26 +4292,19 @@ function typeCheckConfig$3(untrustedConfig) {
2805
4292
  }
2806
4293
  }
2807
4294
  const untrustedConfig_fields = untrustedConfig.fields;
2808
- if (ArrayIsArray$1(untrustedConfig_fields)) {
2809
- const untrustedConfig_fields_array = [];
2810
- for (let i = 0, arrayLength = untrustedConfig_fields.length; i < arrayLength; i++) {
2811
- const untrustedConfig_fields_item = untrustedConfig_fields[i];
2812
- if (untrustedIsObject(untrustedConfig_fields_item)) {
2813
- const untrustedConfig_fields_item_object = {};
2814
- const untrustedConfig_fields_item_keys = Object.keys(untrustedConfig_fields_item);
2815
- for (let i = 0, arrayLength = untrustedConfig_fields_item_keys.length; i < arrayLength; i++) {
2816
- const key = untrustedConfig_fields_item_keys[i];
2817
- const untrustedConfig_fields_item_prop = untrustedConfig_fields_item[key];
2818
- if (untrustedConfig_fields_item_object !== undefined) {
2819
- untrustedConfig_fields_item_object[key] = untrustedConfig_fields_item_prop;
2820
- }
2821
- }
2822
- if (untrustedConfig_fields_item_object !== undefined && Object.keys(untrustedConfig_fields_item_object).length >= 0) {
2823
- untrustedConfig_fields_array.push(untrustedConfig_fields_item_object);
2824
- }
4295
+ if (untrustedIsObject(untrustedConfig_fields)) {
4296
+ const untrustedConfig_fields_object = {};
4297
+ const untrustedConfig_fields_keys = Object.keys(untrustedConfig_fields);
4298
+ for (let i = 0, arrayLength = untrustedConfig_fields_keys.length; i < arrayLength; i++) {
4299
+ const key = untrustedConfig_fields_keys[i];
4300
+ const untrustedConfig_fields_prop = untrustedConfig_fields[key];
4301
+ if (untrustedConfig_fields_object !== undefined) {
4302
+ untrustedConfig_fields_object[key] = untrustedConfig_fields_prop;
2825
4303
  }
2826
4304
  }
2827
- config.fields = untrustedConfig_fields_array;
4305
+ if (untrustedConfig_fields_object !== undefined && Object.keys(untrustedConfig_fields_object).length >= 0) {
4306
+ config.fields = untrustedConfig_fields_object;
4307
+ }
2828
4308
  }
2829
4309
  return config;
2830
4310
  }
@@ -2859,30 +4339,30 @@ function buildNetworkSnapshot$3(luvio, config, options) {
2859
4339
  throw response;
2860
4340
  });
2861
4341
  }
2862
- const createPromptTemplateVersionAdapterFactory = (luvio) => {
2863
- return function createPromptTemplateVersion(untrustedConfig) {
2864
- const config = validateAdapterConfig$3(untrustedConfig, createPromptTemplateVersion_ConfigPropertyNames);
4342
+ const updatePromptTemplateVersionAdapterFactory = (luvio) => {
4343
+ return function updatePromptTemplateVersion(untrustedConfig) {
4344
+ const config = validateAdapterConfig$3(untrustedConfig, updatePromptTemplateVersion_ConfigPropertyNames);
2865
4345
  // Invalid or incomplete config
2866
4346
  if (config === null) {
2867
- throw new Error('Invalid config for "createPromptTemplateVersion"');
4347
+ throw new Error('Invalid config for "updatePromptTemplateVersion"');
2868
4348
  }
2869
4349
  return buildNetworkSnapshot$3(luvio, config);
2870
4350
  };
2871
4351
  };
2872
4352
 
2873
- function select$c(luvio, params) {
2874
- return select$g();
4353
+ function select$e(luvio, params) {
4354
+ return select$s();
2875
4355
  }
2876
4356
  function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
2877
- getTypeCacheKeys$2(storeKeyMap, luvio, response);
4357
+ getTypeCacheKeys$5(storeKeyMap, luvio, response);
2878
4358
  }
2879
4359
  function ingestSuccess$2(luvio, resourceParams, response) {
2880
4360
  const { body } = response;
2881
4361
  const key = keyBuilderFromType$1(luvio, body);
2882
- luvio.storeIngest(key, ingest$2, body);
4362
+ luvio.storeIngest(key, ingest$5, body);
2883
4363
  const snapshot = luvio.storeLookup({
2884
4364
  recordId: key,
2885
- node: select$c(),
4365
+ node: select$e(),
2886
4366
  variables: {},
2887
4367
  });
2888
4368
  if (process.env.NODE_ENV !== 'production') {
@@ -2897,68 +4377,28 @@ function createResourceRequest$2(config) {
2897
4377
  const headers = {};
2898
4378
  return {
2899
4379
  baseUri: '/services/data/v65.0',
2900
- basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/versions/' + config.urlParams.versionId + '',
4380
+ basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/versions/' + config.urlParams.versionId + '/status',
2901
4381
  method: 'put',
2902
- body: config.body,
4382
+ body: null,
2903
4383
  urlParams: config.urlParams,
2904
- queryParams: {},
4384
+ queryParams: config.queryParams,
2905
4385
  headers,
2906
4386
  priority: 'normal',
2907
4387
  };
2908
4388
  }
2909
4389
 
2910
- const adapterName$2 = 'updatePromptTemplateVersion';
2911
- const updatePromptTemplateVersion_ConfigPropertyMetadata = [
4390
+ const adapterName$2 = 'putEinsteinPromptTemplateVersionStatus';
4391
+ const putEinsteinPromptTemplateVersionStatus_ConfigPropertyMetadata = [
2912
4392
  generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
2913
4393
  generateParamConfigMetadata('versionId', true, 0 /* UrlParameter */, 0 /* String */),
2914
- generateParamConfigMetadata('apiName', true, 2 /* Body */, 0 /* String */),
2915
- generateParamConfigMetadata('childRelationships', true, 2 /* Body */, 4 /* Unsupported */),
2916
- generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported */, true),
2917
- generateParamConfigMetadata('id', false, 2 /* Body */, 0 /* String */),
2918
- generateParamConfigMetadata('isStandard', true, 2 /* Body */, 1 /* Boolean */),
4394
+ generateParamConfigMetadata('action', false, 1 /* QueryParameter */, 0 /* String */),
4395
+ generateParamConfigMetadata('ignoreWarnings', false, 1 /* QueryParameter */, 1 /* Boolean */),
2919
4396
  ];
2920
- const updatePromptTemplateVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, updatePromptTemplateVersion_ConfigPropertyMetadata);
2921
- const createResourceParams$2 = /*#__PURE__*/ createResourceParams$a(updatePromptTemplateVersion_ConfigPropertyMetadata);
4397
+ const putEinsteinPromptTemplateVersionStatus_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, putEinsteinPromptTemplateVersionStatus_ConfigPropertyMetadata);
4398
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$h(putEinsteinPromptTemplateVersionStatus_ConfigPropertyMetadata);
2922
4399
  function typeCheckConfig$2(untrustedConfig) {
2923
4400
  const config = {};
2924
- typeCheckConfig$a(untrustedConfig, config, updatePromptTemplateVersion_ConfigPropertyMetadata);
2925
- const untrustedConfig_childRelationships = untrustedConfig.childRelationships;
2926
- if (untrustedIsObject(untrustedConfig_childRelationships)) {
2927
- const untrustedConfig_childRelationships_object = {};
2928
- const untrustedConfig_childRelationships_keys = Object.keys(untrustedConfig_childRelationships);
2929
- for (let i = 0, arrayLength = untrustedConfig_childRelationships_keys.length; i < arrayLength; i++) {
2930
- const key = untrustedConfig_childRelationships_keys[i];
2931
- const untrustedConfig_childRelationships_prop = untrustedConfig_childRelationships[key];
2932
- if (untrustedConfig_childRelationships_object !== undefined) {
2933
- untrustedConfig_childRelationships_object[key] = untrustedConfig_childRelationships_prop;
2934
- }
2935
- }
2936
- if (untrustedConfig_childRelationships_object !== undefined && Object.keys(untrustedConfig_childRelationships_object).length >= 0) {
2937
- config.childRelationships = untrustedConfig_childRelationships_object;
2938
- }
2939
- }
2940
- const untrustedConfig_fields = untrustedConfig.fields;
2941
- if (ArrayIsArray$1(untrustedConfig_fields)) {
2942
- const untrustedConfig_fields_array = [];
2943
- for (let i = 0, arrayLength = untrustedConfig_fields.length; i < arrayLength; i++) {
2944
- const untrustedConfig_fields_item = untrustedConfig_fields[i];
2945
- if (untrustedIsObject(untrustedConfig_fields_item)) {
2946
- const untrustedConfig_fields_item_object = {};
2947
- const untrustedConfig_fields_item_keys = Object.keys(untrustedConfig_fields_item);
2948
- for (let i = 0, arrayLength = untrustedConfig_fields_item_keys.length; i < arrayLength; i++) {
2949
- const key = untrustedConfig_fields_item_keys[i];
2950
- const untrustedConfig_fields_item_prop = untrustedConfig_fields_item[key];
2951
- if (untrustedConfig_fields_item_object !== undefined) {
2952
- untrustedConfig_fields_item_object[key] = untrustedConfig_fields_item_prop;
2953
- }
2954
- }
2955
- if (untrustedConfig_fields_item_object !== undefined && Object.keys(untrustedConfig_fields_item_object).length >= 0) {
2956
- untrustedConfig_fields_array.push(untrustedConfig_fields_item_object);
2957
- }
2958
- }
2959
- }
2960
- config.fields = untrustedConfig_fields_array;
2961
- }
4401
+ typeCheckConfig$h(untrustedConfig, config, putEinsteinPromptTemplateVersionStatus_ConfigPropertyMetadata);
2962
4402
  return config;
2963
4403
  }
2964
4404
  function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
@@ -2992,18 +4432,18 @@ function buildNetworkSnapshot$2(luvio, config, options) {
2992
4432
  throw response;
2993
4433
  });
2994
4434
  }
2995
- const updatePromptTemplateVersionAdapterFactory = (luvio) => {
2996
- return function updatePromptTemplateVersion(untrustedConfig) {
2997
- const config = validateAdapterConfig$2(untrustedConfig, updatePromptTemplateVersion_ConfigPropertyNames);
4435
+ const putEinsteinPromptTemplateVersionStatusAdapterFactory = (luvio) => {
4436
+ return function putEinsteinPromptTemplateVersionStatus(untrustedConfig) {
4437
+ const config = validateAdapterConfig$2(untrustedConfig, putEinsteinPromptTemplateVersionStatus_ConfigPropertyNames);
2998
4438
  // Invalid or incomplete config
2999
4439
  if (config === null) {
3000
- throw new Error('Invalid config for "updatePromptTemplateVersion"');
4440
+ throw new Error('Invalid config for "putEinsteinPromptTemplateVersionStatus"');
3001
4441
  }
3002
4442
  return buildNetworkSnapshot$2(luvio, config);
3003
4443
  };
3004
4444
  };
3005
4445
 
3006
- function validate$b(obj, path = 'WrappedValueMap') {
4446
+ function validate$d(obj, path = 'WrappedValueMap') {
3007
4447
  const v_error = (() => {
3008
4448
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3009
4449
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -3026,7 +4466,7 @@ function validate$b(obj, path = 'WrappedValueMap') {
3026
4466
  return v_error === undefined ? null : v_error;
3027
4467
  }
3028
4468
 
3029
- function validate$a(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresentation') {
4469
+ function validate$c(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresentation') {
3030
4470
  const v_error = (() => {
3031
4471
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3032
4472
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -3034,7 +4474,7 @@ function validate$a(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
3034
4474
  if (obj.additionalConfig !== undefined) {
3035
4475
  const obj_additionalConfig = obj.additionalConfig;
3036
4476
  const path_additionalConfig = path + '.additionalConfig';
3037
- const referencepath_additionalConfigValidationError = validate$m(obj_additionalConfig, path_additionalConfig);
4477
+ const referencepath_additionalConfigValidationError = validate$u(obj_additionalConfig, path_additionalConfig);
3038
4478
  if (referencepath_additionalConfigValidationError !== null) {
3039
4479
  let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
3040
4480
  message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -3043,7 +4483,7 @@ function validate$a(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
3043
4483
  }
3044
4484
  const obj_inputParams = obj.inputParams;
3045
4485
  const path_inputParams = path + '.inputParams';
3046
- const referencepath_inputParamsValidationError = validate$b(obj_inputParams, path_inputParams);
4486
+ const referencepath_inputParamsValidationError = validate$d(obj_inputParams, path_inputParams);
3047
4487
  if (referencepath_inputParamsValidationError !== null) {
3048
4488
  let message = 'Object doesn\'t match WrappedValueMap (at "' + path_inputParams + '")\n';
3049
4489
  message += referencepath_inputParamsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -3079,6 +4519,244 @@ function validate$a(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
3079
4519
  return v_error === undefined ? null : v_error;
3080
4520
  }
3081
4521
 
4522
+ const VERSION$b = "63584d83290e21bdff26b1bef3db119c";
4523
+ function validate$b(obj, path = 'EinsteinLlmGenerationGenAiCitedReferenceRepresentation') {
4524
+ const v_error = (() => {
4525
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4526
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4527
+ }
4528
+ if (obj.citationLocations !== undefined) {
4529
+ const obj_citationLocations = obj.citationLocations;
4530
+ const path_citationLocations = path + '.citationLocations';
4531
+ if (!ArrayIsArray(obj_citationLocations)) {
4532
+ return new TypeError('Expected "array" but received "' + typeof obj_citationLocations + '" (at "' + path_citationLocations + '")');
4533
+ }
4534
+ for (let i = 0; i < obj_citationLocations.length; i++) {
4535
+ const obj_citationLocations_item = obj_citationLocations[i];
4536
+ const path_citationLocations_item = path_citationLocations + '[' + i + ']';
4537
+ if (typeof obj_citationLocations_item !== 'number' || (typeof obj_citationLocations_item === 'number' && Math.floor(obj_citationLocations_item) !== obj_citationLocations_item)) {
4538
+ return new TypeError('Expected "integer" but received "' + typeof obj_citationLocations_item + '" (at "' + path_citationLocations_item + '")');
4539
+ }
4540
+ }
4541
+ }
4542
+ if (obj.claims !== undefined) {
4543
+ const obj_claims = obj.claims;
4544
+ const path_claims = path + '.claims';
4545
+ if (!ArrayIsArray(obj_claims)) {
4546
+ return new TypeError('Expected "array" but received "' + typeof obj_claims + '" (at "' + path_claims + '")');
4547
+ }
4548
+ for (let i = 0; i < obj_claims.length; i++) {
4549
+ const obj_claims_item = obj_claims[i];
4550
+ const path_claims_item = path_claims + '[' + i + ']';
4551
+ if (typeof obj_claims_item !== 'string') {
4552
+ return new TypeError('Expected "string" but received "' + typeof obj_claims_item + '" (at "' + path_claims_item + '")');
4553
+ }
4554
+ }
4555
+ }
4556
+ if (obj.link !== undefined) {
4557
+ const obj_link = obj.link;
4558
+ const path_link = path + '.link';
4559
+ if (typeof obj_link !== 'string') {
4560
+ return new TypeError('Expected "string" but received "' + typeof obj_link + '" (at "' + path_link + '")');
4561
+ }
4562
+ }
4563
+ if (obj.sourceObjectApiName !== undefined) {
4564
+ const obj_sourceObjectApiName = obj.sourceObjectApiName;
4565
+ const path_sourceObjectApiName = path + '.sourceObjectApiName';
4566
+ if (typeof obj_sourceObjectApiName !== 'string') {
4567
+ return new TypeError('Expected "string" but received "' + typeof obj_sourceObjectApiName + '" (at "' + path_sourceObjectApiName + '")');
4568
+ }
4569
+ }
4570
+ if (obj.sourceObjectRecordId !== undefined) {
4571
+ const obj_sourceObjectRecordId = obj.sourceObjectRecordId;
4572
+ const path_sourceObjectRecordId = path + '.sourceObjectRecordId';
4573
+ if (typeof obj_sourceObjectRecordId !== 'string') {
4574
+ return new TypeError('Expected "string" but received "' + typeof obj_sourceObjectRecordId + '" (at "' + path_sourceObjectRecordId + '")');
4575
+ }
4576
+ }
4577
+ })();
4578
+ return v_error === undefined ? null : v_error;
4579
+ }
4580
+ const select$d = function EinsteinLlmGenerationGenAiCitedReferenceRepresentationSelect() {
4581
+ return {
4582
+ kind: 'Fragment',
4583
+ version: VERSION$b,
4584
+ private: [],
4585
+ selections: [
4586
+ {
4587
+ name: 'citationLocations',
4588
+ kind: 'Scalar',
4589
+ plural: true,
4590
+ required: false
4591
+ },
4592
+ {
4593
+ name: 'claims',
4594
+ kind: 'Scalar',
4595
+ plural: true,
4596
+ required: false
4597
+ },
4598
+ {
4599
+ name: 'link',
4600
+ kind: 'Scalar',
4601
+ required: false
4602
+ },
4603
+ {
4604
+ name: 'sourceObjectApiName',
4605
+ kind: 'Scalar',
4606
+ required: false
4607
+ },
4608
+ {
4609
+ name: 'sourceObjectRecordId',
4610
+ kind: 'Scalar',
4611
+ required: false
4612
+ }
4613
+ ]
4614
+ };
4615
+ };
4616
+ function equals$b(existing, incoming) {
4617
+ const existing_link = existing.link;
4618
+ const incoming_link = incoming.link;
4619
+ // if at least one of these optionals is defined
4620
+ if (existing_link !== undefined || incoming_link !== undefined) {
4621
+ // if one of these is not defined we know the other is defined and therefore
4622
+ // not equal
4623
+ if (existing_link === undefined || incoming_link === undefined) {
4624
+ return false;
4625
+ }
4626
+ if (!(existing_link === incoming_link)) {
4627
+ return false;
4628
+ }
4629
+ }
4630
+ const existing_sourceObjectApiName = existing.sourceObjectApiName;
4631
+ const incoming_sourceObjectApiName = incoming.sourceObjectApiName;
4632
+ // if at least one of these optionals is defined
4633
+ if (existing_sourceObjectApiName !== undefined || incoming_sourceObjectApiName !== undefined) {
4634
+ // if one of these is not defined we know the other is defined and therefore
4635
+ // not equal
4636
+ if (existing_sourceObjectApiName === undefined || incoming_sourceObjectApiName === undefined) {
4637
+ return false;
4638
+ }
4639
+ if (!(existing_sourceObjectApiName === incoming_sourceObjectApiName)) {
4640
+ return false;
4641
+ }
4642
+ }
4643
+ const existing_sourceObjectRecordId = existing.sourceObjectRecordId;
4644
+ const incoming_sourceObjectRecordId = incoming.sourceObjectRecordId;
4645
+ // if at least one of these optionals is defined
4646
+ if (existing_sourceObjectRecordId !== undefined || incoming_sourceObjectRecordId !== undefined) {
4647
+ // if one of these is not defined we know the other is defined and therefore
4648
+ // not equal
4649
+ if (existing_sourceObjectRecordId === undefined || incoming_sourceObjectRecordId === undefined) {
4650
+ return false;
4651
+ }
4652
+ if (!(existing_sourceObjectRecordId === incoming_sourceObjectRecordId)) {
4653
+ return false;
4654
+ }
4655
+ }
4656
+ const existing_citationLocations = existing.citationLocations;
4657
+ const incoming_citationLocations = incoming.citationLocations;
4658
+ // if at least one of these optionals is defined
4659
+ if (existing_citationLocations !== undefined || incoming_citationLocations !== undefined) {
4660
+ // if one of these is not defined we know the other is defined and therefore
4661
+ // not equal
4662
+ if (existing_citationLocations === undefined || incoming_citationLocations === undefined) {
4663
+ return false;
4664
+ }
4665
+ const equals_citationLocations_items = equalsArray(existing_citationLocations, incoming_citationLocations, (existing_citationLocations_item, incoming_citationLocations_item) => {
4666
+ if (!(existing_citationLocations_item === incoming_citationLocations_item)) {
4667
+ return false;
4668
+ }
4669
+ });
4670
+ if (equals_citationLocations_items === false) {
4671
+ return false;
4672
+ }
4673
+ }
4674
+ const existing_claims = existing.claims;
4675
+ const incoming_claims = incoming.claims;
4676
+ // if at least one of these optionals is defined
4677
+ if (existing_claims !== undefined || incoming_claims !== undefined) {
4678
+ // if one of these is not defined we know the other is defined and therefore
4679
+ // not equal
4680
+ if (existing_claims === undefined || incoming_claims === undefined) {
4681
+ return false;
4682
+ }
4683
+ const equals_claims_items = equalsArray(existing_claims, incoming_claims, (existing_claims_item, incoming_claims_item) => {
4684
+ if (!(existing_claims_item === incoming_claims_item)) {
4685
+ return false;
4686
+ }
4687
+ });
4688
+ if (equals_claims_items === false) {
4689
+ return false;
4690
+ }
4691
+ }
4692
+ return true;
4693
+ }
4694
+
4695
+ const VERSION$a = "bcc0ea08323732f4187dd2b9f70fea6c";
4696
+ function validate$a(obj, path = 'EinsteinLlmGenerationCitationRepresentation') {
4697
+ const v_error = (() => {
4698
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4699
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4700
+ }
4701
+ if (obj.citedReferences !== undefined) {
4702
+ const obj_citedReferences = obj.citedReferences;
4703
+ const path_citedReferences = path + '.citedReferences';
4704
+ if (!ArrayIsArray(obj_citedReferences)) {
4705
+ return new TypeError('Expected "array" but received "' + typeof obj_citedReferences + '" (at "' + path_citedReferences + '")');
4706
+ }
4707
+ for (let i = 0; i < obj_citedReferences.length; i++) {
4708
+ const obj_citedReferences_item = obj_citedReferences[i];
4709
+ const path_citedReferences_item = path_citedReferences + '[' + i + ']';
4710
+ const referencepath_citedReferences_itemValidationError = validate$b(obj_citedReferences_item, path_citedReferences_item);
4711
+ if (referencepath_citedReferences_itemValidationError !== null) {
4712
+ let message = 'Object doesn\'t match EinsteinLlmGenerationGenAiCitedReferenceRepresentation (at "' + path_citedReferences_item + '")\n';
4713
+ message += referencepath_citedReferences_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
4714
+ return new TypeError(message);
4715
+ }
4716
+ }
4717
+ }
4718
+ })();
4719
+ return v_error === undefined ? null : v_error;
4720
+ }
4721
+ const select$c = function EinsteinLlmGenerationCitationRepresentationSelect() {
4722
+ const { selections: EinsteinLlmGenerationGenAiCitedReferenceRepresentation__selections, opaque: EinsteinLlmGenerationGenAiCitedReferenceRepresentation__opaque, } = select$d();
4723
+ return {
4724
+ kind: 'Fragment',
4725
+ version: VERSION$a,
4726
+ private: [],
4727
+ selections: [
4728
+ {
4729
+ name: 'citedReferences',
4730
+ kind: 'Object',
4731
+ plural: true,
4732
+ selections: EinsteinLlmGenerationGenAiCitedReferenceRepresentation__selections,
4733
+ required: false
4734
+ }
4735
+ ]
4736
+ };
4737
+ };
4738
+ function equals$a(existing, incoming) {
4739
+ const existing_citedReferences = existing.citedReferences;
4740
+ const incoming_citedReferences = incoming.citedReferences;
4741
+ // if at least one of these optionals is defined
4742
+ if (existing_citedReferences !== undefined || incoming_citedReferences !== undefined) {
4743
+ // if one of these is not defined we know the other is defined and therefore
4744
+ // not equal
4745
+ if (existing_citedReferences === undefined || incoming_citedReferences === undefined) {
4746
+ return false;
4747
+ }
4748
+ const equals_citedReferences_items = equalsArray(existing_citedReferences, incoming_citedReferences, (existing_citedReferences_item, incoming_citedReferences_item) => {
4749
+ if (!(equals$b(existing_citedReferences_item, incoming_citedReferences_item))) {
4750
+ return false;
4751
+ }
4752
+ });
4753
+ if (equals_citedReferences_items === false) {
4754
+ return false;
4755
+ }
4756
+ }
4757
+ return true;
4758
+ }
4759
+
3082
4760
  const VERSION$9 = "f62ac44b024b123f079b57f349e05230";
3083
4761
  function validate$9(obj, path = 'EinsteinPromptTemplateAttachmentExclusionInfoRepresentation') {
3084
4762
  const v_error = (() => {
@@ -3581,12 +5259,22 @@ function equals$4(existing, incoming) {
3581
5259
  }
3582
5260
 
3583
5261
  const TTL$1 = 100;
3584
- const VERSION$3 = "492c5045545dfbf96d7f660532a30499";
5262
+ const VERSION$3 = "4f8799314eebcd45e3fca72dcdf7722d";
3585
5263
  function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation') {
3586
5264
  const v_error = (() => {
3587
5265
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3588
5266
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3589
5267
  }
5268
+ if (obj.citations !== undefined) {
5269
+ const obj_citations = obj.citations;
5270
+ const path_citations = path + '.citations';
5271
+ const referencepath_citationsValidationError = validate$a(obj_citations, path_citations);
5272
+ if (referencepath_citationsValidationError !== null) {
5273
+ let message = 'Object doesn\'t match EinsteinLlmGenerationCitationRepresentation (at "' + path_citations + '")\n';
5274
+ message += referencepath_citationsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
5275
+ return new TypeError(message);
5276
+ }
5277
+ }
3590
5278
  if (obj.fileData !== undefined) {
3591
5279
  const obj_fileData = obj.fileData;
3592
5280
  const path_fileData = path + '.fileData';
@@ -3629,7 +5317,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
3629
5317
  for (let i = 0; i < obj_generations.length; i++) {
3630
5318
  const obj_generations_item = obj_generations[i];
3631
5319
  const path_generations_item = path_generations + '[' + i + ']';
3632
- const referencepath_generations_itemValidationError = validate$i(obj_generations_item, path_generations_item);
5320
+ const referencepath_generations_itemValidationError = validate$q(obj_generations_item, path_generations_item);
3633
5321
  if (referencepath_generations_itemValidationError !== null) {
3634
5322
  let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
3635
5323
  message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -3656,7 +5344,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
3656
5344
  const path_parameters = path + '.parameters';
3657
5345
  let obj_parameters_union0 = null;
3658
5346
  const obj_parameters_union0_error = (() => {
3659
- const referencepath_parametersValidationError = validate$h(obj_parameters, path_parameters);
5347
+ const referencepath_parametersValidationError = validate$p(obj_parameters, path_parameters);
3660
5348
  if (referencepath_parametersValidationError !== null) {
3661
5349
  let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
3662
5350
  message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -3712,6 +5400,32 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
3712
5400
  if (typeof obj_promptTemplateDevName !== 'string') {
3713
5401
  return new TypeError('Expected "string" but received "' + typeof obj_promptTemplateDevName + '" (at "' + path_promptTemplateDevName + '")');
3714
5402
  }
5403
+ const obj_rawPrompt = obj.rawPrompt;
5404
+ const path_rawPrompt = path + '.rawPrompt';
5405
+ let obj_rawPrompt_union0 = null;
5406
+ const obj_rawPrompt_union0_error = (() => {
5407
+ if (typeof obj_rawPrompt !== 'string') {
5408
+ return new TypeError('Expected "string" but received "' + typeof obj_rawPrompt + '" (at "' + path_rawPrompt + '")');
5409
+ }
5410
+ })();
5411
+ if (obj_rawPrompt_union0_error != null) {
5412
+ obj_rawPrompt_union0 = obj_rawPrompt_union0_error.message;
5413
+ }
5414
+ let obj_rawPrompt_union1 = null;
5415
+ const obj_rawPrompt_union1_error = (() => {
5416
+ if (obj_rawPrompt !== null) {
5417
+ return new TypeError('Expected "null" but received "' + typeof obj_rawPrompt + '" (at "' + path_rawPrompt + '")');
5418
+ }
5419
+ })();
5420
+ if (obj_rawPrompt_union1_error != null) {
5421
+ obj_rawPrompt_union1 = obj_rawPrompt_union1_error.message;
5422
+ }
5423
+ if (obj_rawPrompt_union0 && obj_rawPrompt_union1) {
5424
+ let message = 'Object doesn\'t match union (at "' + path_rawPrompt + '")';
5425
+ message += '\n' + obj_rawPrompt_union0.split('\n').map((line) => '\t' + line).join('\n');
5426
+ message += '\n' + obj_rawPrompt_union1.split('\n').map((line) => '\t' + line).join('\n');
5427
+ return new TypeError(message);
5428
+ }
3715
5429
  const obj_requestId = obj.requestId;
3716
5430
  const path_requestId = path + '.requestId';
3717
5431
  if (typeof obj_requestId !== 'string') {
@@ -3785,10 +5499,11 @@ function normalize$1(input, existing, path, luvio, store, timestamp) {
3785
5499
  return input;
3786
5500
  }
3787
5501
  const select$5 = function EinsteinPromptTemplateGenerationsRepresentationSelect() {
5502
+ const { selections: EinsteinLlmGenerationCitationRepresentation__selections, opaque: EinsteinLlmGenerationCitationRepresentation__opaque, } = select$c();
3788
5503
  const { selections: EinsteinPromptTemplateAttachmentRepresentation__selections, opaque: EinsteinPromptTemplateAttachmentRepresentation__opaque, } = select$a();
3789
5504
  const { selections: EinsteinPromptTemplateGenerationsErrorRepresentation__selections, opaque: EinsteinPromptTemplateGenerationsErrorRepresentation__opaque, } = select$9();
3790
- const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$n();
3791
- const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$m();
5505
+ const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$z();
5506
+ const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$y();
3792
5507
  const { selections: EinsteinPromptTemplateMaskContentRepresentation__selections, opaque: EinsteinPromptTemplateMaskContentRepresentation__opaque, } = select$7();
3793
5508
  const { selections: EinsteinPromptTemplateMaskDataRepresentation__selections, opaque: EinsteinPromptTemplateMaskDataRepresentation__opaque, } = select$6();
3794
5509
  return {
@@ -3796,6 +5511,12 @@ const select$5 = function EinsteinPromptTemplateGenerationsRepresentationSelect(
3796
5511
  version: VERSION$3,
3797
5512
  private: [],
3798
5513
  selections: [
5514
+ {
5515
+ name: 'citations',
5516
+ kind: 'Object',
5517
+ selections: EinsteinLlmGenerationCitationRepresentation__selections,
5518
+ required: false
5519
+ },
3799
5520
  {
3800
5521
  name: 'fileData',
3801
5522
  kind: 'Object',
@@ -3835,6 +5556,10 @@ const select$5 = function EinsteinPromptTemplateGenerationsRepresentationSelect(
3835
5556
  name: 'promptTemplateDevName',
3836
5557
  kind: 'Scalar'
3837
5558
  },
5559
+ {
5560
+ name: 'rawPrompt',
5561
+ kind: 'Scalar'
5562
+ },
3838
5563
  {
3839
5564
  name: 'requestId',
3840
5565
  kind: 'Scalar'
@@ -3874,6 +5599,19 @@ function equals$3(existing, incoming) {
3874
5599
  if (!(existing_requestId === incoming_requestId)) {
3875
5600
  return false;
3876
5601
  }
5602
+ const existing_citations = existing.citations;
5603
+ const incoming_citations = incoming.citations;
5604
+ // if at least one of these optionals is defined
5605
+ if (existing_citations !== undefined || incoming_citations !== undefined) {
5606
+ // if one of these is not defined we know the other is defined and therefore
5607
+ // not equal
5608
+ if (existing_citations === undefined || incoming_citations === undefined) {
5609
+ return false;
5610
+ }
5611
+ if (!(equals$a(existing_citations, incoming_citations))) {
5612
+ return false;
5613
+ }
5614
+ }
3877
5615
  const existing_fileData = existing.fileData;
3878
5616
  const incoming_fileData = incoming.fileData;
3879
5617
  // if at least one of these optionals is defined
@@ -3913,7 +5651,7 @@ function equals$3(existing, incoming) {
3913
5651
  const existing_generations = existing.generations;
3914
5652
  const incoming_generations = incoming.generations;
3915
5653
  const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
3916
- if (!(equals$f(existing_generations_item, incoming_generations_item))) {
5654
+ if (!(equals$k(existing_generations_item, incoming_generations_item))) {
3917
5655
  return false;
3918
5656
  }
3919
5657
  });
@@ -3943,7 +5681,7 @@ function equals$3(existing, incoming) {
3943
5681
  if (!(existing_parameters === incoming_parameters
3944
5682
  || (existing_parameters != null &&
3945
5683
  incoming_parameters != null &&
3946
- equals$e(existing_parameters, incoming_parameters)))) {
5684
+ equals$j(existing_parameters, incoming_parameters)))) {
3947
5685
  return false;
3948
5686
  }
3949
5687
  const existing_prompt = existing.prompt;
@@ -3951,6 +5689,11 @@ function equals$3(existing, incoming) {
3951
5689
  if (!(existing_prompt === incoming_prompt)) {
3952
5690
  return false;
3953
5691
  }
5692
+ const existing_rawPrompt = existing.rawPrompt;
5693
+ const incoming_rawPrompt = incoming.rawPrompt;
5694
+ if (!(existing_rawPrompt === incoming_rawPrompt)) {
5695
+ return false;
5696
+ }
3954
5697
  const existing_requestMessages = existing.requestMessages;
3955
5698
  const incoming_requestMessages = incoming.requestMessages;
3956
5699
  // if at least one of these optionals is defined
@@ -4073,12 +5816,12 @@ const createGenerationsForPromptTemplate_ConfigPropertyMetadata = [
4073
5816
  generateParamConfigMetadata('promptTemplateGenerationsInput', true, 2 /* Body */, 4 /* Unsupported */),
4074
5817
  ];
4075
5818
  const createGenerationsForPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
4076
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$a(createGenerationsForPromptTemplate_ConfigPropertyMetadata);
5819
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$h(createGenerationsForPromptTemplate_ConfigPropertyMetadata);
4077
5820
  function typeCheckConfig$1(untrustedConfig) {
4078
5821
  const config = {};
4079
- typeCheckConfig$a(untrustedConfig, config, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
5822
+ typeCheckConfig$h(untrustedConfig, config, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
4080
5823
  const untrustedConfig_promptTemplateGenerationsInput = untrustedConfig.promptTemplateGenerationsInput;
4081
- const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$a(untrustedConfig_promptTemplateGenerationsInput);
5824
+ const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$c(untrustedConfig_promptTemplateGenerationsInput);
4082
5825
  if (referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError === null) {
4083
5826
  config.promptTemplateGenerationsInput = untrustedConfig_promptTemplateGenerationsInput;
4084
5827
  }
@@ -4439,14 +6182,14 @@ const getOutputLanguages_ConfigPropertyMetadata = [
4439
6182
  generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
4440
6183
  ];
4441
6184
  const getOutputLanguages_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getOutputLanguages_ConfigPropertyMetadata);
4442
- const createResourceParams = /*#__PURE__*/ createResourceParams$a(getOutputLanguages_ConfigPropertyMetadata);
6185
+ const createResourceParams = /*#__PURE__*/ createResourceParams$h(getOutputLanguages_ConfigPropertyMetadata);
4443
6186
  function keyBuilder(luvio, config) {
4444
6187
  const resourceParams = createResourceParams(config);
4445
6188
  return keyBuilder$1(luvio, resourceParams);
4446
6189
  }
4447
6190
  function typeCheckConfig(untrustedConfig) {
4448
6191
  const config = {};
4449
- typeCheckConfig$a(untrustedConfig, config, getOutputLanguages_ConfigPropertyMetadata);
6192
+ typeCheckConfig$h(untrustedConfig, config, getOutputLanguages_ConfigPropertyMetadata);
4450
6193
  return config;
4451
6194
  }
4452
6195
  function validateAdapterConfig(untrustedConfig, configPropertyNames) {
@@ -4495,7 +6238,7 @@ function buildNetworkSnapshot(luvio, config, options) {
4495
6238
  });
4496
6239
  }
4497
6240
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
4498
- return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
6241
+ return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
4499
6242
  }
4500
6243
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
4501
6244
  const { luvio, config } = context;
@@ -4520,4 +6263,4 @@ const getOutputLanguagesAdapterFactory = (luvio) => function EinsteinLLM__getOut
4520
6263
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
4521
6264
  };
4522
6265
 
4523
- export { createEmbeddingsAdapterFactory, createFeedbackAdapterFactory, createGenerationsAdapterFactory, createGenerationsForPromptTemplateAdapterFactory, createPromptTemplateAdapterFactory, createPromptTemplateVersionAdapterFactory, getOutputLanguagesAdapterFactory, getPromptTemplateAdapterFactory, getPromptTemplatesAdapterFactory, updatePromptTemplateVersionAdapterFactory };
6266
+ export { createEmbeddingsAdapterFactory, createFeedbackAdapterFactory, createGenerationsAdapterFactory, createGenerationsForPromptTemplateAdapterFactory, createPromptTemplateAdapterFactory, createPromptTemplateVersionAdapterFactory, getDataProviderInstanceConfigAdapterFactory, getDataProviderTypeConfigsAdapterFactory, getDataProvidersAdapterFactory, getInputMappedDataProvidersAdapterFactory, getOutputLanguagesAdapterFactory, getPromptTemplateAdapterFactory, getPromptTemplateVersionAdapterFactory, getPromptTemplateVersionsAdapterFactory, getPromptTemplatesAdapterFactory, putEinsteinPromptTemplateVersionStatusAdapterFactory, updatePromptTemplateVersionAdapterFactory };