@salesforce/lds-adapters-industries-nlpservice 0.1.0-dev1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/industries-nlpservice.js +888 -0
  3. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
  4. package/dist/es/es2018/types/src/generated/adapters/createAINaturalLangProcessResult.d.ts +16 -0
  5. package/dist/es/es2018/types/src/generated/adapters/getAINaturalLangProcessResultsByReferenceRecordId.d.ts +28 -0
  6. package/dist/es/es2018/types/src/generated/adapters/getAINaturalLangProcessResultsBySourceId.d.ts +28 -0
  7. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +3 -0
  8. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +6 -0
  9. package/dist/es/es2018/types/src/generated/resources/getConnectNlpServiceAiNaturalLangProcessResultsReferenceRecordsByReferenceRecordId.d.ts +18 -0
  10. package/dist/es/es2018/types/src/generated/resources/getConnectNlpServiceAiNaturalLangProcessResultsSourceRecordsBySourceRecordId.d.ts +18 -0
  11. package/dist/es/es2018/types/src/generated/resources/postConnectNlpServiceAiNaturalLangProcessResults.d.ts +13 -0
  12. package/dist/es/es2018/types/src/generated/types/AINaturalLangProcessResultCollectionRepresentation.d.ts +30 -0
  13. package/dist/es/es2018/types/src/generated/types/AINaturalLangProcessResultInputRepresentation.d.ts +38 -0
  14. package/dist/es/es2018/types/src/generated/types/AINaturalLangProcessResultInputWrapperRepresentation.d.ts +28 -0
  15. package/dist/es/es2018/types/src/generated/types/AINaturalLangProcessResultRepresentation.d.ts +60 -0
  16. package/dist/es/es2018/types/src/generated/types/AWSEntityRepresentation.d.ts +32 -0
  17. package/dist/es/es2018/types/src/generated/types/AWSEntityStructRepresentation.d.ts +40 -0
  18. package/dist/es/es2018/types/src/generated/types/AWSKeyPhraseRepresentation.d.ts +32 -0
  19. package/dist/es/es2018/types/src/generated/types/AWSKeyPhraseStructRepresentation.d.ts +37 -0
  20. package/dist/es/es2018/types/src/generated/types/AdditionalInformationRepresentation.d.ts +31 -0
  21. package/dist/es/es2018/types/src/generated/types/AdditionalParametersInputMap.d.ts +28 -0
  22. package/dist/es/es2018/types/src/generated/types/ClauseStructRepresentation.d.ts +31 -0
  23. package/dist/es/es2018/types/src/generated/types/ComplianceClauseStructRepresentation.d.ts +31 -0
  24. package/dist/es/es2018/types/src/generated/types/EntityStructRepresentation.d.ts +31 -0
  25. package/dist/es/es2018/types/src/generated/types/ErrorRepresentation.d.ts +31 -0
  26. package/dist/es/es2018/types/src/generated/types/NullableAdditionalParametersInputMap.d.ts +27 -0
  27. package/dist/es/es2018/types/src/generated/types/OpenAIClauseRepresentation.d.ts +32 -0
  28. package/dist/es/es2018/types/src/generated/types/OpenAIComplianceClauseRepresentation.d.ts +32 -0
  29. package/dist/es/es2018/types/src/generated/types/OpenAIEntityRepresentation.d.ts +32 -0
  30. package/dist/es/es2018/types/src/generated/types/OpenAISurveyGenerationRepresentation.d.ts +32 -0
  31. package/dist/es/es2018/types/src/generated/types/OpenAITranslationGenerationRepresentation.d.ts +32 -0
  32. package/dist/es/es2018/types/src/generated/types/SurveyStructRepresentation.d.ts +40 -0
  33. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  34. package/package.json +74 -0
  35. package/sfdc/index.d.ts +1 -0
  36. package/sfdc/index.js +944 -0
  37. package/src/raml/api.raml +404 -0
  38. package/src/raml/luvio.raml +33 -0
@@ -0,0 +1,888 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$3, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, typeCheckConfig as typeCheckConfig$3 } from '@luvio/engine';
8
+
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
11
+ const { isArray: ArrayIsArray$1 } = Array;
12
+ /**
13
+ * Validates an adapter config is well-formed.
14
+ * @param config The config to validate.
15
+ * @param adapter The adapter validation configuration.
16
+ * @param oneOf The keys the config must contain at least one of.
17
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
18
+ */
19
+ function validateConfig(config, adapter, oneOf) {
20
+ const { displayName } = adapter;
21
+ const { required, optional, unsupported } = adapter.parameters;
22
+ if (config === undefined ||
23
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
24
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
25
+ }
26
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
27
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
28
+ }
29
+ if (unsupported !== undefined &&
30
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
31
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
+ }
33
+ const supported = required.concat(optional);
34
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
35
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
+ }
37
+ }
38
+ function untrustedIsObject(untrusted) {
39
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
40
+ }
41
+ function areRequiredParametersPresent(config, configPropertyNames) {
42
+ return configPropertyNames.parameters.required.every(req => req in config);
43
+ }
44
+ const snapshotRefreshOptions = {
45
+ overrides: {
46
+ headers: {
47
+ 'Cache-Control': 'no-cache',
48
+ },
49
+ }
50
+ };
51
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
52
+ return {
53
+ name,
54
+ required,
55
+ resourceType,
56
+ typeCheckShape,
57
+ isArrayShape,
58
+ coerceFn,
59
+ };
60
+ }
61
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
62
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
63
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
64
+ return {
65
+ displayName,
66
+ parameters: {
67
+ required,
68
+ optional,
69
+ }
70
+ };
71
+ }
72
+ const keyPrefix = 'NlpService';
73
+
74
+ const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
75
+ const { isArray: ArrayIsArray } = Array;
76
+ const { stringify: JSONStringify } = JSON;
77
+ function createLink(ref) {
78
+ return {
79
+ __ref: serializeStructuredKey(ref),
80
+ };
81
+ }
82
+
83
+ function validate$5(obj, path = 'NullableAdditionalParametersInputMap') {
84
+ const v_error = (() => {
85
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
86
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
87
+ }
88
+ const obj_keys = ObjectKeys(obj);
89
+ for (let i = 0; i < obj_keys.length; i++) {
90
+ const key = obj_keys[i];
91
+ const obj_prop = obj[key];
92
+ const path_prop = path + '["' + key + '"]';
93
+ if (obj_prop === undefined) {
94
+ return new TypeError('Expected "defined" but received "' + typeof obj_prop + '" (at "' + path_prop + '")');
95
+ }
96
+ }
97
+ })();
98
+ return v_error === undefined ? null : v_error;
99
+ }
100
+
101
+ function validate$4(obj, path = 'AdditionalParametersInputMap') {
102
+ const v_error = (() => {
103
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
104
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
105
+ }
106
+ if (obj.additionalParameters !== undefined) {
107
+ const obj_additionalParameters = obj.additionalParameters;
108
+ const path_additionalParameters = path + '.additionalParameters';
109
+ const referencepath_additionalParametersValidationError = validate$5(obj_additionalParameters, path_additionalParameters);
110
+ if (referencepath_additionalParametersValidationError !== null) {
111
+ let message = 'Object doesn\'t match NullableAdditionalParametersInputMap (at "' + path_additionalParameters + '")\n';
112
+ message += referencepath_additionalParametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
113
+ return new TypeError(message);
114
+ }
115
+ }
116
+ })();
117
+ return v_error === undefined ? null : v_error;
118
+ }
119
+
120
+ function validate$3(obj, path = 'AINaturalLangProcessResultInputRepresentation') {
121
+ const v_error = (() => {
122
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
123
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
124
+ }
125
+ if (obj.additionalParameters !== undefined) {
126
+ const obj_additionalParameters = obj.additionalParameters;
127
+ const path_additionalParameters = path + '.additionalParameters';
128
+ const referencepath_additionalParametersValidationError = validate$4(obj_additionalParameters, path_additionalParameters);
129
+ if (referencepath_additionalParametersValidationError !== null) {
130
+ let message = 'Object doesn\'t match AdditionalParametersInputMap (at "' + path_additionalParameters + '")\n';
131
+ message += referencepath_additionalParametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
132
+ return new TypeError(message);
133
+ }
134
+ }
135
+ if (obj.configurationApiName !== undefined) {
136
+ const obj_configurationApiName = obj.configurationApiName;
137
+ const path_configurationApiName = path + '.configurationApiName';
138
+ if (typeof obj_configurationApiName !== 'string') {
139
+ return new TypeError('Expected "string" but received "' + typeof obj_configurationApiName + '" (at "' + path_configurationApiName + '")');
140
+ }
141
+ }
142
+ if (obj.query !== undefined) {
143
+ const obj_query = obj.query;
144
+ const path_query = path + '.query';
145
+ if (typeof obj_query !== 'string') {
146
+ return new TypeError('Expected "string" but received "' + typeof obj_query + '" (at "' + path_query + '")');
147
+ }
148
+ }
149
+ if (obj.serviceType !== undefined) {
150
+ const obj_serviceType = obj.serviceType;
151
+ const path_serviceType = path + '.serviceType';
152
+ if (typeof obj_serviceType !== 'string') {
153
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceType + '" (at "' + path_serviceType + '")');
154
+ }
155
+ }
156
+ })();
157
+ return v_error === undefined ? null : v_error;
158
+ }
159
+
160
+ function validate$2(obj, path = 'AdditionalInformationRepresentation') {
161
+ const v_error = (() => {
162
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
163
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
164
+ }
165
+ if (obj.generationsResponseIds !== undefined) {
166
+ const obj_generationsResponseIds = obj.generationsResponseIds;
167
+ const path_generationsResponseIds = path + '.generationsResponseIds';
168
+ if (!ArrayIsArray(obj_generationsResponseIds)) {
169
+ return new TypeError('Expected "array" but received "' + typeof obj_generationsResponseIds + '" (at "' + path_generationsResponseIds + '")');
170
+ }
171
+ for (let i = 0; i < obj_generationsResponseIds.length; i++) {
172
+ const obj_generationsResponseIds_item = obj_generationsResponseIds[i];
173
+ const path_generationsResponseIds_item = path_generationsResponseIds + '[' + i + ']';
174
+ let obj_generationsResponseIds_item_union0 = null;
175
+ const obj_generationsResponseIds_item_union0_error = (() => {
176
+ if (typeof obj_generationsResponseIds_item !== 'string') {
177
+ return new TypeError('Expected "string" but received "' + typeof obj_generationsResponseIds_item + '" (at "' + path_generationsResponseIds_item + '")');
178
+ }
179
+ })();
180
+ if (obj_generationsResponseIds_item_union0_error != null) {
181
+ obj_generationsResponseIds_item_union0 = obj_generationsResponseIds_item_union0_error.message;
182
+ }
183
+ let obj_generationsResponseIds_item_union1 = null;
184
+ const obj_generationsResponseIds_item_union1_error = (() => {
185
+ if (obj_generationsResponseIds_item !== null) {
186
+ return new TypeError('Expected "null" but received "' + typeof obj_generationsResponseIds_item + '" (at "' + path_generationsResponseIds_item + '")');
187
+ }
188
+ })();
189
+ if (obj_generationsResponseIds_item_union1_error != null) {
190
+ obj_generationsResponseIds_item_union1 = obj_generationsResponseIds_item_union1_error.message;
191
+ }
192
+ if (obj_generationsResponseIds_item_union0 && obj_generationsResponseIds_item_union1) {
193
+ let message = 'Object doesn\'t match union (at "' + path_generationsResponseIds_item + '")';
194
+ message += '\n' + obj_generationsResponseIds_item_union0.split('\n').map((line) => '\t' + line).join('\n');
195
+ message += '\n' + obj_generationsResponseIds_item_union1.split('\n').map((line) => '\t' + line).join('\n');
196
+ return new TypeError(message);
197
+ }
198
+ }
199
+ }
200
+ if (obj.sessionId !== undefined) {
201
+ const obj_sessionId = obj.sessionId;
202
+ const path_sessionId = path + '.sessionId';
203
+ let obj_sessionId_union0 = null;
204
+ const obj_sessionId_union0_error = (() => {
205
+ if (typeof obj_sessionId !== 'string') {
206
+ return new TypeError('Expected "string" but received "' + typeof obj_sessionId + '" (at "' + path_sessionId + '")');
207
+ }
208
+ })();
209
+ if (obj_sessionId_union0_error != null) {
210
+ obj_sessionId_union0 = obj_sessionId_union0_error.message;
211
+ }
212
+ let obj_sessionId_union1 = null;
213
+ const obj_sessionId_union1_error = (() => {
214
+ if (obj_sessionId !== null) {
215
+ return new TypeError('Expected "null" but received "' + typeof obj_sessionId + '" (at "' + path_sessionId + '")');
216
+ }
217
+ })();
218
+ if (obj_sessionId_union1_error != null) {
219
+ obj_sessionId_union1 = obj_sessionId_union1_error.message;
220
+ }
221
+ if (obj_sessionId_union0 && obj_sessionId_union1) {
222
+ let message = 'Object doesn\'t match union (at "' + path_sessionId + '")';
223
+ message += '\n' + obj_sessionId_union0.split('\n').map((line) => '\t' + line).join('\n');
224
+ message += '\n' + obj_sessionId_union1.split('\n').map((line) => '\t' + line).join('\n');
225
+ return new TypeError(message);
226
+ }
227
+ }
228
+ })();
229
+ return v_error === undefined ? null : v_error;
230
+ }
231
+
232
+ const TTL$1 = 1000;
233
+ const VERSION$1 = "daed3f78476b51a054b92fc3c9a5c931";
234
+ function validate$1(obj, path = 'AINaturalLangProcessResultRepresentation') {
235
+ const v_error = (() => {
236
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
237
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
238
+ }
239
+ if (obj.additionalInformation !== undefined) {
240
+ const obj_additionalInformation = obj.additionalInformation;
241
+ const path_additionalInformation = path + '.additionalInformation';
242
+ let obj_additionalInformation_union0 = null;
243
+ const obj_additionalInformation_union0_error = (() => {
244
+ const referencepath_additionalInformationValidationError = validate$2(obj_additionalInformation, path_additionalInformation);
245
+ if (referencepath_additionalInformationValidationError !== null) {
246
+ let message = 'Object doesn\'t match AdditionalInformationRepresentation (at "' + path_additionalInformation + '")\n';
247
+ message += referencepath_additionalInformationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
248
+ return new TypeError(message);
249
+ }
250
+ })();
251
+ if (obj_additionalInformation_union0_error != null) {
252
+ obj_additionalInformation_union0 = obj_additionalInformation_union0_error.message;
253
+ }
254
+ let obj_additionalInformation_union1 = null;
255
+ const obj_additionalInformation_union1_error = (() => {
256
+ if (obj_additionalInformation !== null) {
257
+ return new TypeError('Expected "null" but received "' + typeof obj_additionalInformation + '" (at "' + path_additionalInformation + '")');
258
+ }
259
+ })();
260
+ if (obj_additionalInformation_union1_error != null) {
261
+ obj_additionalInformation_union1 = obj_additionalInformation_union1_error.message;
262
+ }
263
+ if (obj_additionalInformation_union0 && obj_additionalInformation_union1) {
264
+ let message = 'Object doesn\'t match union (at "' + path_additionalInformation + '")';
265
+ message += '\n' + obj_additionalInformation_union0.split('\n').map((line) => '\t' + line).join('\n');
266
+ message += '\n' + obj_additionalInformation_union1.split('\n').map((line) => '\t' + line).join('\n');
267
+ return new TypeError(message);
268
+ }
269
+ }
270
+ const obj_id = obj.id;
271
+ const path_id = path + '.id';
272
+ if (typeof obj_id !== 'string') {
273
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
274
+ }
275
+ const obj_referenceRecord = obj.referenceRecord;
276
+ const path_referenceRecord = path + '.referenceRecord';
277
+ let obj_referenceRecord_union0 = null;
278
+ const obj_referenceRecord_union0_error = (() => {
279
+ if (typeof obj_referenceRecord !== 'string') {
280
+ return new TypeError('Expected "string" but received "' + typeof obj_referenceRecord + '" (at "' + path_referenceRecord + '")');
281
+ }
282
+ })();
283
+ if (obj_referenceRecord_union0_error != null) {
284
+ obj_referenceRecord_union0 = obj_referenceRecord_union0_error.message;
285
+ }
286
+ let obj_referenceRecord_union1 = null;
287
+ const obj_referenceRecord_union1_error = (() => {
288
+ if (obj_referenceRecord !== null) {
289
+ return new TypeError('Expected "null" but received "' + typeof obj_referenceRecord + '" (at "' + path_referenceRecord + '")');
290
+ }
291
+ })();
292
+ if (obj_referenceRecord_union1_error != null) {
293
+ obj_referenceRecord_union1 = obj_referenceRecord_union1_error.message;
294
+ }
295
+ if (obj_referenceRecord_union0 && obj_referenceRecord_union1) {
296
+ let message = 'Object doesn\'t match union (at "' + path_referenceRecord + '")';
297
+ message += '\n' + obj_referenceRecord_union0.split('\n').map((line) => '\t' + line).join('\n');
298
+ message += '\n' + obj_referenceRecord_union1.split('\n').map((line) => '\t' + line).join('\n');
299
+ return new TypeError(message);
300
+ }
301
+ const obj_requestText = obj.requestText;
302
+ const path_requestText = path + '.requestText';
303
+ let obj_requestText_union0 = null;
304
+ const obj_requestText_union0_error = (() => {
305
+ if (typeof obj_requestText !== 'string') {
306
+ return new TypeError('Expected "string" but received "' + typeof obj_requestText + '" (at "' + path_requestText + '")');
307
+ }
308
+ })();
309
+ if (obj_requestText_union0_error != null) {
310
+ obj_requestText_union0 = obj_requestText_union0_error.message;
311
+ }
312
+ let obj_requestText_union1 = null;
313
+ const obj_requestText_union1_error = (() => {
314
+ if (obj_requestText !== null) {
315
+ return new TypeError('Expected "null" but received "' + typeof obj_requestText + '" (at "' + path_requestText + '")');
316
+ }
317
+ })();
318
+ if (obj_requestText_union1_error != null) {
319
+ obj_requestText_union1 = obj_requestText_union1_error.message;
320
+ }
321
+ if (obj_requestText_union0 && obj_requestText_union1) {
322
+ let message = 'Object doesn\'t match union (at "' + path_requestText + '")';
323
+ message += '\n' + obj_requestText_union0.split('\n').map((line) => '\t' + line).join('\n');
324
+ message += '\n' + obj_requestText_union1.split('\n').map((line) => '\t' + line).join('\n');
325
+ return new TypeError(message);
326
+ }
327
+ const obj_response = obj.response;
328
+ const path_response = path + '.response';
329
+ let obj_response_union0 = null;
330
+ const obj_response_union0_error = (() => {
331
+ if (typeof obj_response !== 'object' || ArrayIsArray(obj_response) || obj_response === null) {
332
+ return new TypeError('Expected "object" but received "' + typeof obj_response + '" (at "' + path_response + '")');
333
+ }
334
+ })();
335
+ if (obj_response_union0_error != null) {
336
+ obj_response_union0 = obj_response_union0_error.message;
337
+ }
338
+ let obj_response_union1 = null;
339
+ const obj_response_union1_error = (() => {
340
+ if (typeof obj_response !== 'string') {
341
+ return new TypeError('Expected "string" but received "' + typeof obj_response + '" (at "' + path_response + '")');
342
+ }
343
+ })();
344
+ if (obj_response_union1_error != null) {
345
+ obj_response_union1 = obj_response_union1_error.message;
346
+ }
347
+ let obj_response_union2 = null;
348
+ const obj_response_union2_error = (() => {
349
+ if (obj_response !== null) {
350
+ return new TypeError('Expected "null" but received "' + typeof obj_response + '" (at "' + path_response + '")');
351
+ }
352
+ })();
353
+ if (obj_response_union2_error != null) {
354
+ obj_response_union2 = obj_response_union2_error.message;
355
+ }
356
+ if (obj_response_union0 && obj_response_union1 && obj_response_union2) {
357
+ let message = 'Object doesn\'t match union (at "' + path_response + '")';
358
+ message += '\n' + obj_response_union0.split('\n').map((line) => '\t' + line).join('\n');
359
+ message += '\n' + obj_response_union1.split('\n').map((line) => '\t' + line).join('\n');
360
+ message += '\n' + obj_response_union2.split('\n').map((line) => '\t' + line).join('\n');
361
+ return new TypeError(message);
362
+ }
363
+ const obj_serviceType = obj.serviceType;
364
+ const path_serviceType = path + '.serviceType';
365
+ if (typeof obj_serviceType !== 'string') {
366
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceType + '" (at "' + path_serviceType + '")');
367
+ }
368
+ const obj_sourceRecord = obj.sourceRecord;
369
+ const path_sourceRecord = path + '.sourceRecord';
370
+ let obj_sourceRecord_union0 = null;
371
+ const obj_sourceRecord_union0_error = (() => {
372
+ if (typeof obj_sourceRecord !== 'string') {
373
+ return new TypeError('Expected "string" but received "' + typeof obj_sourceRecord + '" (at "' + path_sourceRecord + '")');
374
+ }
375
+ })();
376
+ if (obj_sourceRecord_union0_error != null) {
377
+ obj_sourceRecord_union0 = obj_sourceRecord_union0_error.message;
378
+ }
379
+ let obj_sourceRecord_union1 = null;
380
+ const obj_sourceRecord_union1_error = (() => {
381
+ if (obj_sourceRecord !== null) {
382
+ return new TypeError('Expected "null" but received "' + typeof obj_sourceRecord + '" (at "' + path_sourceRecord + '")');
383
+ }
384
+ })();
385
+ if (obj_sourceRecord_union1_error != null) {
386
+ obj_sourceRecord_union1 = obj_sourceRecord_union1_error.message;
387
+ }
388
+ if (obj_sourceRecord_union0 && obj_sourceRecord_union1) {
389
+ let message = 'Object doesn\'t match union (at "' + path_sourceRecord + '")';
390
+ message += '\n' + obj_sourceRecord_union0.split('\n').map((line) => '\t' + line).join('\n');
391
+ message += '\n' + obj_sourceRecord_union1.split('\n').map((line) => '\t' + line).join('\n');
392
+ return new TypeError(message);
393
+ }
394
+ const obj_status = obj.status;
395
+ const path_status = path + '.status';
396
+ if (typeof obj_status !== 'string') {
397
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
398
+ }
399
+ })();
400
+ return v_error === undefined ? null : v_error;
401
+ }
402
+ const RepresentationType$1 = 'AINaturalLangProcessResultRepresentation';
403
+ function keyBuilder$4(luvio, config) {
404
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.serviceType;
405
+ }
406
+ function keyBuilderFromType(luvio, object) {
407
+ const keyParams = {
408
+ serviceType: object.serviceType
409
+ };
410
+ return keyBuilder$4(luvio, keyParams);
411
+ }
412
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
413
+ return input;
414
+ }
415
+ const select$4 = function AINaturalLangProcessResultRepresentationSelect() {
416
+ return {
417
+ kind: 'Fragment',
418
+ version: VERSION$1,
419
+ private: [],
420
+ opaque: true
421
+ };
422
+ };
423
+ function equals$1(existing, incoming) {
424
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
425
+ return false;
426
+ }
427
+ return true;
428
+ }
429
+ const ingest$1 = function AINaturalLangProcessResultRepresentationIngest(input, path, luvio, store, timestamp) {
430
+ if (process.env.NODE_ENV !== 'production') {
431
+ const validateError = validate$1(input);
432
+ if (validateError !== null) {
433
+ throw validateError;
434
+ }
435
+ }
436
+ const key = keyBuilderFromType(luvio, input);
437
+ const ttlToUse = TTL$1;
438
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "NlpService", VERSION$1, RepresentationType$1, equals$1);
439
+ return createLink(key);
440
+ };
441
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
442
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
443
+ const rootKey = keyBuilderFromType(luvio, input);
444
+ rootKeySet.set(rootKey, {
445
+ namespace: keyPrefix,
446
+ representationName: RepresentationType$1,
447
+ mergeable: false
448
+ });
449
+ }
450
+
451
+ function select$3(luvio, params) {
452
+ return select$4();
453
+ }
454
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
455
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
456
+ }
457
+ function ingestSuccess$2(luvio, resourceParams, response) {
458
+ const { body } = response;
459
+ const key = keyBuilderFromType(luvio, body);
460
+ luvio.storeIngest(key, ingest$1, body);
461
+ const snapshot = luvio.storeLookup({
462
+ recordId: key,
463
+ node: select$3(),
464
+ variables: {},
465
+ });
466
+ if (process.env.NODE_ENV !== 'production') {
467
+ if (snapshot.state !== 'Fulfilled') {
468
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
469
+ }
470
+ }
471
+ deepFreeze(snapshot.data);
472
+ return snapshot;
473
+ }
474
+ function createResourceRequest$2(config) {
475
+ const headers = {};
476
+ return {
477
+ baseUri: '/services/data/v66.0',
478
+ basePath: '/connect/nlp-service/aiNaturalLangProcessResults',
479
+ method: 'post',
480
+ body: config.body,
481
+ urlParams: {},
482
+ queryParams: {},
483
+ headers,
484
+ priority: 'normal',
485
+ };
486
+ }
487
+
488
+ const adapterName$2 = 'createAINaturalLangProcessResult';
489
+ const createAINaturalLangProcessResult_ConfigPropertyMetadata = [
490
+ generateParamConfigMetadata('aiNaturalLangProcessResultInputParam', true, 2 /* Body */, 4 /* Unsupported */),
491
+ ];
492
+ const createAINaturalLangProcessResult_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, createAINaturalLangProcessResult_ConfigPropertyMetadata);
493
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(createAINaturalLangProcessResult_ConfigPropertyMetadata);
494
+ function typeCheckConfig$2(untrustedConfig) {
495
+ const config = {};
496
+ const untrustedConfig_aiNaturalLangProcessResultInputParam = untrustedConfig.aiNaturalLangProcessResultInputParam;
497
+ const referenceAINaturalLangProcessResultInputRepresentationValidationError = validate$3(untrustedConfig_aiNaturalLangProcessResultInputParam);
498
+ if (referenceAINaturalLangProcessResultInputRepresentationValidationError === null) {
499
+ config.aiNaturalLangProcessResultInputParam = untrustedConfig_aiNaturalLangProcessResultInputParam;
500
+ }
501
+ return config;
502
+ }
503
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
504
+ if (!untrustedIsObject(untrustedConfig)) {
505
+ return null;
506
+ }
507
+ if (process.env.NODE_ENV !== 'production') {
508
+ validateConfig(untrustedConfig, configPropertyNames);
509
+ }
510
+ const config = typeCheckConfig$2(untrustedConfig);
511
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
512
+ return null;
513
+ }
514
+ return config;
515
+ }
516
+ function buildNetworkSnapshot$2(luvio, config, options) {
517
+ const resourceParams = createResourceParams$2(config);
518
+ const request = createResourceRequest$2(resourceParams);
519
+ return luvio.dispatchResourceRequest(request, options)
520
+ .then((response) => {
521
+ return luvio.handleSuccessResponse(() => {
522
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
523
+ return luvio.storeBroadcast().then(() => snapshot);
524
+ }, () => {
525
+ const cache = new StoreKeyMap();
526
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
527
+ return cache;
528
+ });
529
+ }, (response) => {
530
+ deepFreeze(response);
531
+ throw response;
532
+ });
533
+ }
534
+ const createAINaturalLangProcessResultAdapterFactory = (luvio) => {
535
+ return function createAINaturalLangProcessResult(untrustedConfig) {
536
+ const config = validateAdapterConfig$2(untrustedConfig, createAINaturalLangProcessResult_ConfigPropertyNames);
537
+ // Invalid or incomplete config
538
+ if (config === null) {
539
+ throw new Error('Invalid config for "createAINaturalLangProcessResult"');
540
+ }
541
+ return buildNetworkSnapshot$2(luvio, config);
542
+ };
543
+ };
544
+
545
+ const TTL = 1000;
546
+ const VERSION = "059e32d9b0fe4cfbf1672345a49e5d3d";
547
+ function validate(obj, path = 'AINaturalLangProcessResultCollectionRepresentation') {
548
+ const v_error = (() => {
549
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
550
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
551
+ }
552
+ const obj_aiNaturalLangProcessResults = obj.aiNaturalLangProcessResults;
553
+ const path_aiNaturalLangProcessResults = path + '.aiNaturalLangProcessResults';
554
+ if (!ArrayIsArray(obj_aiNaturalLangProcessResults)) {
555
+ return new TypeError('Expected "array" but received "' + typeof obj_aiNaturalLangProcessResults + '" (at "' + path_aiNaturalLangProcessResults + '")');
556
+ }
557
+ for (let i = 0; i < obj_aiNaturalLangProcessResults.length; i++) {
558
+ const obj_aiNaturalLangProcessResults_item = obj_aiNaturalLangProcessResults[i];
559
+ const path_aiNaturalLangProcessResults_item = path_aiNaturalLangProcessResults + '[' + i + ']';
560
+ const referencepath_aiNaturalLangProcessResults_itemValidationError = validate$1(obj_aiNaturalLangProcessResults_item, path_aiNaturalLangProcessResults_item);
561
+ if (referencepath_aiNaturalLangProcessResults_itemValidationError !== null) {
562
+ let message = 'Object doesn\'t match AINaturalLangProcessResultRepresentation (at "' + path_aiNaturalLangProcessResults_item + '")\n';
563
+ message += referencepath_aiNaturalLangProcessResults_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
564
+ return new TypeError(message);
565
+ }
566
+ }
567
+ })();
568
+ return v_error === undefined ? null : v_error;
569
+ }
570
+ const RepresentationType = 'AINaturalLangProcessResultCollectionRepresentation';
571
+ function normalize(input, existing, path, luvio, store, timestamp) {
572
+ return input;
573
+ }
574
+ const select$2 = function AINaturalLangProcessResultCollectionRepresentationSelect() {
575
+ return {
576
+ kind: 'Fragment',
577
+ version: VERSION,
578
+ private: [],
579
+ opaque: true
580
+ };
581
+ };
582
+ function equals(existing, incoming) {
583
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
584
+ return false;
585
+ }
586
+ return true;
587
+ }
588
+ const ingest = function AINaturalLangProcessResultCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
589
+ if (process.env.NODE_ENV !== 'production') {
590
+ const validateError = validate(input);
591
+ if (validateError !== null) {
592
+ throw validateError;
593
+ }
594
+ }
595
+ const key = path.fullPath;
596
+ const ttlToUse = TTL;
597
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "NlpService", VERSION, RepresentationType, equals);
598
+ return createLink(key);
599
+ };
600
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
601
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
602
+ const rootKey = fullPathFactory();
603
+ rootKeySet.set(rootKey, {
604
+ namespace: keyPrefix,
605
+ representationName: RepresentationType,
606
+ mergeable: false
607
+ });
608
+ }
609
+
610
+ function select$1(luvio, params) {
611
+ return select$2();
612
+ }
613
+ function keyBuilder$3(luvio, params) {
614
+ return keyPrefix + '::AINaturalLangProcessResultCollectionRepresentation:(' + 'serviceTypes:' + params.queryParams.serviceTypes + ',' + 'referenceRecordId:' + params.urlParams.referenceRecordId + ')';
615
+ }
616
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
617
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
618
+ }
619
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
620
+ const { body } = response;
621
+ const key = keyBuilder$3(luvio, resourceParams);
622
+ luvio.storeIngest(key, ingest, body);
623
+ const snapshot = luvio.storeLookup({
624
+ recordId: key,
625
+ node: select$1(),
626
+ variables: {},
627
+ }, snapshotRefresh);
628
+ if (process.env.NODE_ENV !== 'production') {
629
+ if (snapshot.state !== 'Fulfilled') {
630
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
631
+ }
632
+ }
633
+ deepFreeze(snapshot.data);
634
+ return snapshot;
635
+ }
636
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
637
+ const key = keyBuilder$3(luvio, params);
638
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
639
+ const storeMetadataParams = {
640
+ ttl: TTL,
641
+ namespace: keyPrefix,
642
+ version: VERSION,
643
+ representationName: RepresentationType
644
+ };
645
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
646
+ return errorSnapshot;
647
+ }
648
+ function createResourceRequest$1(config) {
649
+ const headers = {};
650
+ return {
651
+ baseUri: '/services/data/v66.0',
652
+ basePath: '/connect/nlp-service/aiNaturalLangProcessResults/referenceRecords/' + config.urlParams.referenceRecordId + '',
653
+ method: 'get',
654
+ body: null,
655
+ urlParams: config.urlParams,
656
+ queryParams: config.queryParams,
657
+ headers,
658
+ priority: 'normal',
659
+ };
660
+ }
661
+
662
+ const adapterName$1 = 'getAINaturalLangProcessResultsByReferenceRecordId';
663
+ const getAINaturalLangProcessResultsByReferenceRecordId_ConfigPropertyMetadata = [
664
+ generateParamConfigMetadata('referenceRecordId', true, 0 /* UrlParameter */, 0 /* String */),
665
+ generateParamConfigMetadata('serviceTypes', false, 1 /* QueryParameter */, 0 /* String */, true),
666
+ ];
667
+ const getAINaturalLangProcessResultsByReferenceRecordId_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getAINaturalLangProcessResultsByReferenceRecordId_ConfigPropertyMetadata);
668
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(getAINaturalLangProcessResultsByReferenceRecordId_ConfigPropertyMetadata);
669
+ function keyBuilder$2(luvio, config) {
670
+ const resourceParams = createResourceParams$1(config);
671
+ return keyBuilder$3(luvio, resourceParams);
672
+ }
673
+ function typeCheckConfig$1(untrustedConfig) {
674
+ const config = {};
675
+ typeCheckConfig$3(untrustedConfig, config, getAINaturalLangProcessResultsByReferenceRecordId_ConfigPropertyMetadata);
676
+ return config;
677
+ }
678
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
679
+ if (!untrustedIsObject(untrustedConfig)) {
680
+ return null;
681
+ }
682
+ if (process.env.NODE_ENV !== 'production') {
683
+ validateConfig(untrustedConfig, configPropertyNames);
684
+ }
685
+ const config = typeCheckConfig$1(untrustedConfig);
686
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
687
+ return null;
688
+ }
689
+ return config;
690
+ }
691
+ function adapterFragment$1(luvio, config) {
692
+ createResourceParams$1(config);
693
+ return select$1();
694
+ }
695
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
696
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
697
+ config,
698
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
699
+ });
700
+ return luvio.storeBroadcast().then(() => snapshot);
701
+ }
702
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
703
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
704
+ config,
705
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
706
+ });
707
+ return luvio.storeBroadcast().then(() => snapshot);
708
+ }
709
+ function buildNetworkSnapshot$1(luvio, config, options) {
710
+ const resourceParams = createResourceParams$1(config);
711
+ const request = createResourceRequest$1(resourceParams);
712
+ return luvio.dispatchResourceRequest(request, options)
713
+ .then((response) => {
714
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
715
+ const cache = new StoreKeyMap();
716
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
717
+ return cache;
718
+ });
719
+ }, (response) => {
720
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
721
+ });
722
+ }
723
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
724
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
725
+ }
726
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
727
+ const { luvio, config } = context;
728
+ const selector = {
729
+ recordId: keyBuilder$2(luvio, config),
730
+ node: adapterFragment$1(luvio, config),
731
+ variables: {},
732
+ };
733
+ const cacheSnapshot = storeLookup(selector, {
734
+ config,
735
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
736
+ });
737
+ return cacheSnapshot;
738
+ }
739
+ const getAINaturalLangProcessResultsByReferenceRecordIdAdapterFactory = (luvio) => function NlpService__getAINaturalLangProcessResultsByReferenceRecordId(untrustedConfig, requestContext) {
740
+ const config = validateAdapterConfig$1(untrustedConfig, getAINaturalLangProcessResultsByReferenceRecordId_ConfigPropertyNames);
741
+ // Invalid or incomplete config
742
+ if (config === null) {
743
+ return null;
744
+ }
745
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
746
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
747
+ };
748
+
749
+ function select(luvio, params) {
750
+ return select$2();
751
+ }
752
+ function keyBuilder$1(luvio, params) {
753
+ return keyPrefix + '::AINaturalLangProcessResultCollectionRepresentation:(' + 'serviceTypes:' + params.queryParams.serviceTypes + ',' + 'sourceRecordId:' + params.urlParams.sourceRecordId + ')';
754
+ }
755
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
756
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
757
+ }
758
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
759
+ const { body } = response;
760
+ const key = keyBuilder$1(luvio, resourceParams);
761
+ luvio.storeIngest(key, ingest, body);
762
+ const snapshot = luvio.storeLookup({
763
+ recordId: key,
764
+ node: select(),
765
+ variables: {},
766
+ }, snapshotRefresh);
767
+ if (process.env.NODE_ENV !== 'production') {
768
+ if (snapshot.state !== 'Fulfilled') {
769
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
770
+ }
771
+ }
772
+ deepFreeze(snapshot.data);
773
+ return snapshot;
774
+ }
775
+ function ingestError(luvio, params, error, snapshotRefresh) {
776
+ const key = keyBuilder$1(luvio, params);
777
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
778
+ const storeMetadataParams = {
779
+ ttl: TTL,
780
+ namespace: keyPrefix,
781
+ version: VERSION,
782
+ representationName: RepresentationType
783
+ };
784
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
785
+ return errorSnapshot;
786
+ }
787
+ function createResourceRequest(config) {
788
+ const headers = {};
789
+ return {
790
+ baseUri: '/services/data/v66.0',
791
+ basePath: '/connect/nlp-service/aiNaturalLangProcessResults/sourceRecords/' + config.urlParams.sourceRecordId + '',
792
+ method: 'get',
793
+ body: null,
794
+ urlParams: config.urlParams,
795
+ queryParams: config.queryParams,
796
+ headers,
797
+ priority: 'normal',
798
+ };
799
+ }
800
+
801
+ const adapterName = 'getAINaturalLangProcessResultsBySourceId';
802
+ const getAINaturalLangProcessResultsBySourceId_ConfigPropertyMetadata = [
803
+ generateParamConfigMetadata('sourceRecordId', true, 0 /* UrlParameter */, 0 /* String */),
804
+ generateParamConfigMetadata('serviceTypes', false, 1 /* QueryParameter */, 0 /* String */, true),
805
+ ];
806
+ const getAINaturalLangProcessResultsBySourceId_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getAINaturalLangProcessResultsBySourceId_ConfigPropertyMetadata);
807
+ const createResourceParams = /*#__PURE__*/ createResourceParams$3(getAINaturalLangProcessResultsBySourceId_ConfigPropertyMetadata);
808
+ function keyBuilder(luvio, config) {
809
+ const resourceParams = createResourceParams(config);
810
+ return keyBuilder$1(luvio, resourceParams);
811
+ }
812
+ function typeCheckConfig(untrustedConfig) {
813
+ const config = {};
814
+ typeCheckConfig$3(untrustedConfig, config, getAINaturalLangProcessResultsBySourceId_ConfigPropertyMetadata);
815
+ return config;
816
+ }
817
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
818
+ if (!untrustedIsObject(untrustedConfig)) {
819
+ return null;
820
+ }
821
+ if (process.env.NODE_ENV !== 'production') {
822
+ validateConfig(untrustedConfig, configPropertyNames);
823
+ }
824
+ const config = typeCheckConfig(untrustedConfig);
825
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
826
+ return null;
827
+ }
828
+ return config;
829
+ }
830
+ function adapterFragment(luvio, config) {
831
+ createResourceParams(config);
832
+ return select();
833
+ }
834
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
835
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
836
+ config,
837
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
838
+ });
839
+ return luvio.storeBroadcast().then(() => snapshot);
840
+ }
841
+ function onFetchResponseError(luvio, config, resourceParams, response) {
842
+ const snapshot = ingestError(luvio, resourceParams, response, {
843
+ config,
844
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
845
+ });
846
+ return luvio.storeBroadcast().then(() => snapshot);
847
+ }
848
+ function buildNetworkSnapshot(luvio, config, options) {
849
+ const resourceParams = createResourceParams(config);
850
+ const request = createResourceRequest(resourceParams);
851
+ return luvio.dispatchResourceRequest(request, options)
852
+ .then((response) => {
853
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
854
+ const cache = new StoreKeyMap();
855
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
856
+ return cache;
857
+ });
858
+ }, (response) => {
859
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
860
+ });
861
+ }
862
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
863
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
864
+ }
865
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
866
+ const { luvio, config } = context;
867
+ const selector = {
868
+ recordId: keyBuilder(luvio, config),
869
+ node: adapterFragment(luvio, config),
870
+ variables: {},
871
+ };
872
+ const cacheSnapshot = storeLookup(selector, {
873
+ config,
874
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
875
+ });
876
+ return cacheSnapshot;
877
+ }
878
+ const getAINaturalLangProcessResultsBySourceIdAdapterFactory = (luvio) => function NlpService__getAINaturalLangProcessResultsBySourceId(untrustedConfig, requestContext) {
879
+ const config = validateAdapterConfig(untrustedConfig, getAINaturalLangProcessResultsBySourceId_ConfigPropertyNames);
880
+ // Invalid or incomplete config
881
+ if (config === null) {
882
+ return null;
883
+ }
884
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
885
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
886
+ };
887
+
888
+ export { createAINaturalLangProcessResultAdapterFactory, getAINaturalLangProcessResultsByReferenceRecordIdAdapterFactory, getAINaturalLangProcessResultsBySourceIdAdapterFactory };