@salesforce/lds-adapters-industries-gdf-information-lib 0.1.0-dev1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/sfdc/index.js ADDED
@@ -0,0 +1,562 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ /*
8
+ * ATTENTION!
9
+ * THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
10
+ * If you would like to contribute to LDS, please follow the steps outlined in the git repo.
11
+ * Any changes made to this file in p4 will be automatically overwritten.
12
+ * *******************************************************************************************
13
+ */
14
+ /* proxy-compat-disable */
15
+ import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
16
+ import { withDefaultLuvio } from 'force/ldsEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$2, StoreKeyMap, createResourceParams as createResourceParams$2 } from 'force/luvioEngine';
18
+
19
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
+ const { keys: ObjectKeys, create: ObjectCreate } = Object;
21
+ const { isArray: ArrayIsArray$1 } = Array;
22
+ /**
23
+ * Validates an adapter config is well-formed.
24
+ * @param config The config to validate.
25
+ * @param adapter The adapter validation configuration.
26
+ * @param oneOf The keys the config must contain at least one of.
27
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
28
+ */
29
+ function validateConfig(config, adapter, oneOf) {
30
+ const { displayName } = adapter;
31
+ const { required, optional, unsupported } = adapter.parameters;
32
+ if (config === undefined ||
33
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
34
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
35
+ }
36
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
37
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
38
+ }
39
+ if (unsupported !== undefined &&
40
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
41
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
42
+ }
43
+ const supported = required.concat(optional);
44
+ if (ObjectKeys(config).some(key => !supported.includes(key))) {
45
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
46
+ }
47
+ }
48
+ function untrustedIsObject(untrusted) {
49
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
50
+ }
51
+ function areRequiredParametersPresent(config, configPropertyNames) {
52
+ return configPropertyNames.parameters.required.every(req => req in config);
53
+ }
54
+ const snapshotRefreshOptions = {
55
+ overrides: {
56
+ headers: {
57
+ 'Cache-Control': 'no-cache',
58
+ },
59
+ }
60
+ };
61
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
62
+ return {
63
+ name,
64
+ required,
65
+ resourceType,
66
+ typeCheckShape,
67
+ isArrayShape,
68
+ coerceFn,
69
+ };
70
+ }
71
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
72
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
73
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
74
+ return {
75
+ displayName,
76
+ parameters: {
77
+ required,
78
+ optional,
79
+ }
80
+ };
81
+ }
82
+ const keyPrefix = 'gdf-information-lib';
83
+
84
+ const { isArray: ArrayIsArray } = Array;
85
+ const { stringify: JSONStringify } = JSON;
86
+ function createLink(ref) {
87
+ return {
88
+ __ref: serializeStructuredKey(ref),
89
+ };
90
+ }
91
+
92
+ function validate$3(obj, path = 'MaterialityTopicOutputRepresentation') {
93
+ const v_error = (() => {
94
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
95
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
96
+ }
97
+ const obj_documentClauseSetsOutputRepresentation = obj.documentClauseSetsOutputRepresentation;
98
+ const path_documentClauseSetsOutputRepresentation = path + '.documentClauseSetsOutputRepresentation';
99
+ if (!ArrayIsArray(obj_documentClauseSetsOutputRepresentation)) {
100
+ return new TypeError('Expected "array" but received "' + typeof obj_documentClauseSetsOutputRepresentation + '" (at "' + path_documentClauseSetsOutputRepresentation + '")');
101
+ }
102
+ for (let i = 0; i < obj_documentClauseSetsOutputRepresentation.length; i++) {
103
+ const obj_documentClauseSetsOutputRepresentation_item = obj_documentClauseSetsOutputRepresentation[i];
104
+ const path_documentClauseSetsOutputRepresentation_item = path_documentClauseSetsOutputRepresentation + '[' + i + ']';
105
+ if (typeof obj_documentClauseSetsOutputRepresentation_item !== 'string') {
106
+ return new TypeError('Expected "string" but received "' + typeof obj_documentClauseSetsOutputRepresentation_item + '" (at "' + path_documentClauseSetsOutputRepresentation_item + '")');
107
+ }
108
+ }
109
+ const obj_materialityTopicId = obj.materialityTopicId;
110
+ const path_materialityTopicId = path + '.materialityTopicId';
111
+ if (typeof obj_materialityTopicId !== 'string') {
112
+ return new TypeError('Expected "string" but received "' + typeof obj_materialityTopicId + '" (at "' + path_materialityTopicId + '")');
113
+ }
114
+ const obj_materialityTopicName = obj.materialityTopicName;
115
+ const path_materialityTopicName = path + '.materialityTopicName';
116
+ if (typeof obj_materialityTopicName !== 'string') {
117
+ return new TypeError('Expected "string" but received "' + typeof obj_materialityTopicName + '" (at "' + path_materialityTopicName + '")');
118
+ }
119
+ const obj_materialityTopicParentRecordId = obj.materialityTopicParentRecordId;
120
+ const path_materialityTopicParentRecordId = path + '.materialityTopicParentRecordId';
121
+ if (typeof obj_materialityTopicParentRecordId !== 'string') {
122
+ return new TypeError('Expected "string" but received "' + typeof obj_materialityTopicParentRecordId + '" (at "' + path_materialityTopicParentRecordId + '")');
123
+ }
124
+ const obj_materialityTopicSortOrder = obj.materialityTopicSortOrder;
125
+ const path_materialityTopicSortOrder = path + '.materialityTopicSortOrder';
126
+ if (typeof obj_materialityTopicSortOrder !== 'string') {
127
+ return new TypeError('Expected "string" but received "' + typeof obj_materialityTopicSortOrder + '" (at "' + path_materialityTopicSortOrder + '")');
128
+ }
129
+ })();
130
+ return v_error === undefined ? null : v_error;
131
+ }
132
+
133
+ function validate$2(obj, path = 'MaterialityTopicDocClauseSetOutputRepresentation') {
134
+ const v_error = (() => {
135
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
136
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
137
+ }
138
+ const obj_materialityTopic = obj.materialityTopic;
139
+ const path_materialityTopic = path + '.materialityTopic';
140
+ const referencepath_materialityTopicValidationError = validate$3(obj_materialityTopic, path_materialityTopic);
141
+ if (referencepath_materialityTopicValidationError !== null) {
142
+ let message = 'Object doesn\'t match MaterialityTopicOutputRepresentation (at "' + path_materialityTopic + '")\n';
143
+ message += referencepath_materialityTopicValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
144
+ return new TypeError(message);
145
+ }
146
+ const obj_materialityTopicDocClauseSetId = obj.materialityTopicDocClauseSetId;
147
+ const path_materialityTopicDocClauseSetId = path + '.materialityTopicDocClauseSetId';
148
+ if (typeof obj_materialityTopicDocClauseSetId !== 'string') {
149
+ return new TypeError('Expected "string" but received "' + typeof obj_materialityTopicDocClauseSetId + '" (at "' + path_materialityTopicDocClauseSetId + '")');
150
+ }
151
+ })();
152
+ return v_error === undefined ? null : v_error;
153
+ }
154
+
155
+ const TTL$1 = 10000;
156
+ const VERSION$1 = "bd24c369b1f9f91f1ad5119e0ebad412";
157
+ function validate$1(obj, path = 'SnippetRelatedTopicsOutputRepresentation') {
158
+ const v_error = (() => {
159
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
160
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
161
+ }
162
+ const obj_code = obj.code;
163
+ const path_code = path + '.code';
164
+ if (typeof obj_code !== 'number' || (typeof obj_code === 'number' && Math.floor(obj_code) !== obj_code)) {
165
+ return new TypeError('Expected "integer" but received "' + typeof obj_code + '" (at "' + path_code + '")');
166
+ }
167
+ const obj_materialityTopicDocClauseSetList = obj.materialityTopicDocClauseSetList;
168
+ const path_materialityTopicDocClauseSetList = path + '.materialityTopicDocClauseSetList';
169
+ if (!ArrayIsArray(obj_materialityTopicDocClauseSetList)) {
170
+ return new TypeError('Expected "array" but received "' + typeof obj_materialityTopicDocClauseSetList + '" (at "' + path_materialityTopicDocClauseSetList + '")');
171
+ }
172
+ for (let i = 0; i < obj_materialityTopicDocClauseSetList.length; i++) {
173
+ const obj_materialityTopicDocClauseSetList_item = obj_materialityTopicDocClauseSetList[i];
174
+ const path_materialityTopicDocClauseSetList_item = path_materialityTopicDocClauseSetList + '[' + i + ']';
175
+ const referencepath_materialityTopicDocClauseSetList_itemValidationError = validate$2(obj_materialityTopicDocClauseSetList_item, path_materialityTopicDocClauseSetList_item);
176
+ if (referencepath_materialityTopicDocClauseSetList_itemValidationError !== null) {
177
+ let message = 'Object doesn\'t match MaterialityTopicDocClauseSetOutputRepresentation (at "' + path_materialityTopicDocClauseSetList_item + '")\n';
178
+ message += referencepath_materialityTopicDocClauseSetList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
179
+ return new TypeError(message);
180
+ }
181
+ }
182
+ const obj_response = obj.response;
183
+ const path_response = path + '.response';
184
+ if (typeof obj_response !== 'string') {
185
+ return new TypeError('Expected "string" but received "' + typeof obj_response + '" (at "' + path_response + '")');
186
+ }
187
+ })();
188
+ return v_error === undefined ? null : v_error;
189
+ }
190
+ const RepresentationType$1 = 'SnippetRelatedTopicsOutputRepresentation';
191
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
192
+ return input;
193
+ }
194
+ const select$3 = function SnippetRelatedTopicsOutputRepresentationSelect() {
195
+ return {
196
+ kind: 'Fragment',
197
+ version: VERSION$1,
198
+ private: [],
199
+ opaque: true
200
+ };
201
+ };
202
+ function equals$1(existing, incoming) {
203
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
204
+ return false;
205
+ }
206
+ return true;
207
+ }
208
+ const ingest$1 = function SnippetRelatedTopicsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
209
+ if (process.env.NODE_ENV !== 'production') {
210
+ const validateError = validate$1(input);
211
+ if (validateError !== null) {
212
+ throw validateError;
213
+ }
214
+ }
215
+ const key = path.fullPath;
216
+ const ttlToUse = TTL$1;
217
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "gdf-information-lib", VERSION$1, RepresentationType$1, equals$1);
218
+ return createLink(key);
219
+ };
220
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
221
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
222
+ const rootKey = fullPathFactory();
223
+ rootKeySet.set(rootKey, {
224
+ namespace: keyPrefix,
225
+ representationName: RepresentationType$1,
226
+ mergeable: false
227
+ });
228
+ }
229
+
230
+ function select$2(luvio, params) {
231
+ return select$3();
232
+ }
233
+ function keyBuilder$2(luvio, params) {
234
+ return keyPrefix + '::SnippetRelatedTopicsOutputRepresentation:(' + 'snippetId:' + params.queryParams.snippetId + ')';
235
+ }
236
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
237
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$2(luvio, resourceParams));
238
+ }
239
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
240
+ const { body } = response;
241
+ const key = keyBuilder$2(luvio, resourceParams);
242
+ luvio.storeIngest(key, ingest$1, body);
243
+ const snapshot = luvio.storeLookup({
244
+ recordId: key,
245
+ node: select$2(),
246
+ variables: {},
247
+ }, snapshotRefresh);
248
+ if (process.env.NODE_ENV !== 'production') {
249
+ if (snapshot.state !== 'Fulfilled') {
250
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
251
+ }
252
+ }
253
+ deepFreeze(snapshot.data);
254
+ return snapshot;
255
+ }
256
+ function ingestError(luvio, params, error, snapshotRefresh) {
257
+ const key = keyBuilder$2(luvio, params);
258
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
259
+ const storeMetadataParams = {
260
+ ttl: TTL$1,
261
+ namespace: keyPrefix,
262
+ version: VERSION$1,
263
+ representationName: RepresentationType$1
264
+ };
265
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
266
+ return errorSnapshot;
267
+ }
268
+ function createResourceRequest$1(config) {
269
+ const headers = {};
270
+ return {
271
+ baseUri: '/services/data/v66.0',
272
+ basePath: '/connect/gdf/information-library/snippet/related-topics',
273
+ method: 'get',
274
+ body: null,
275
+ urlParams: {},
276
+ queryParams: config.queryParams,
277
+ headers,
278
+ priority: 'normal',
279
+ };
280
+ }
281
+
282
+ const adapterName$1 = 'getSnippetRelatedTopicsListView';
283
+ const getSnippetRelatedTopicsListView_ConfigPropertyMetadata = [
284
+ generateParamConfigMetadata('snippetId', false, 1 /* QueryParameter */, 0 /* String */),
285
+ ];
286
+ const getSnippetRelatedTopicsListView_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getSnippetRelatedTopicsListView_ConfigPropertyMetadata);
287
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(getSnippetRelatedTopicsListView_ConfigPropertyMetadata);
288
+ function keyBuilder$1(luvio, config) {
289
+ const resourceParams = createResourceParams$1(config);
290
+ return keyBuilder$2(luvio, resourceParams);
291
+ }
292
+ function typeCheckConfig$1(untrustedConfig) {
293
+ const config = {};
294
+ typeCheckConfig$2(untrustedConfig, config, getSnippetRelatedTopicsListView_ConfigPropertyMetadata);
295
+ return config;
296
+ }
297
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
298
+ if (!untrustedIsObject(untrustedConfig)) {
299
+ return null;
300
+ }
301
+ if (process.env.NODE_ENV !== 'production') {
302
+ validateConfig(untrustedConfig, configPropertyNames);
303
+ }
304
+ const config = typeCheckConfig$1(untrustedConfig);
305
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
306
+ return null;
307
+ }
308
+ return config;
309
+ }
310
+ function adapterFragment(luvio, config) {
311
+ createResourceParams$1(config);
312
+ return select$2();
313
+ }
314
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
315
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
316
+ config,
317
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
318
+ });
319
+ return luvio.storeBroadcast().then(() => snapshot);
320
+ }
321
+ function onFetchResponseError(luvio, config, resourceParams, response) {
322
+ const snapshot = ingestError(luvio, resourceParams, response, {
323
+ config,
324
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
325
+ });
326
+ return luvio.storeBroadcast().then(() => snapshot);
327
+ }
328
+ function buildNetworkSnapshot$1(luvio, config, options) {
329
+ const resourceParams = createResourceParams$1(config);
330
+ const request = createResourceRequest$1(resourceParams);
331
+ return luvio.dispatchResourceRequest(request, options)
332
+ .then((response) => {
333
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
334
+ const cache = new StoreKeyMap();
335
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
336
+ return cache;
337
+ });
338
+ }, (response) => {
339
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
340
+ });
341
+ }
342
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
343
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
344
+ }
345
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
346
+ const { luvio, config } = context;
347
+ const selector = {
348
+ recordId: keyBuilder$1(luvio, config),
349
+ node: adapterFragment(luvio, config),
350
+ variables: {},
351
+ };
352
+ const cacheSnapshot = storeLookup(selector, {
353
+ config,
354
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
355
+ });
356
+ return cacheSnapshot;
357
+ }
358
+ const getSnippetRelatedTopicsListViewAdapterFactory = (luvio) => function gdfInformationLib__getSnippetRelatedTopicsListView(untrustedConfig, requestContext) {
359
+ const config = validateAdapterConfig$1(untrustedConfig, getSnippetRelatedTopicsListView_ConfigPropertyNames);
360
+ // Invalid or incomplete config
361
+ if (config === null) {
362
+ return null;
363
+ }
364
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
365
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
366
+ };
367
+
368
+ const TTL = 1000;
369
+ const VERSION = "13695223436a9cc9374f82068ea120f4";
370
+ function validate(obj, path = 'DeleteTopicOutputRepresentation') {
371
+ const v_error = (() => {
372
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
373
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
374
+ }
375
+ const obj_code = obj.code;
376
+ const path_code = path + '.code';
377
+ if (typeof obj_code !== 'number' || (typeof obj_code === 'number' && Math.floor(obj_code) !== obj_code)) {
378
+ return new TypeError('Expected "integer" but received "' + typeof obj_code + '" (at "' + path_code + '")');
379
+ }
380
+ const obj_message = obj.message;
381
+ const path_message = path + '.message';
382
+ if (typeof obj_message !== 'string') {
383
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
384
+ }
385
+ })();
386
+ return v_error === undefined ? null : v_error;
387
+ }
388
+ const RepresentationType = 'DeleteTopicOutputRepresentation';
389
+ function keyBuilder(luvio, config) {
390
+ return keyPrefix + '::' + RepresentationType + ':' + config.message;
391
+ }
392
+ function keyBuilderFromType(luvio, object) {
393
+ const keyParams = {
394
+ message: object.message
395
+ };
396
+ return keyBuilder(luvio, keyParams);
397
+ }
398
+ function normalize(input, existing, path, luvio, store, timestamp) {
399
+ return input;
400
+ }
401
+ const select$1 = function DeleteTopicOutputRepresentationSelect() {
402
+ return {
403
+ kind: 'Fragment',
404
+ version: VERSION,
405
+ private: [],
406
+ opaque: true
407
+ };
408
+ };
409
+ function equals(existing, incoming) {
410
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
411
+ return false;
412
+ }
413
+ return true;
414
+ }
415
+ const ingest = function DeleteTopicOutputRepresentationIngest(input, path, luvio, store, timestamp) {
416
+ if (process.env.NODE_ENV !== 'production') {
417
+ const validateError = validate(input);
418
+ if (validateError !== null) {
419
+ throw validateError;
420
+ }
421
+ }
422
+ const key = keyBuilderFromType(luvio, input);
423
+ const ttlToUse = TTL;
424
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "gdf-information-lib", VERSION, RepresentationType, equals);
425
+ return createLink(key);
426
+ };
427
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
428
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
429
+ const rootKey = keyBuilderFromType(luvio, input);
430
+ rootKeySet.set(rootKey, {
431
+ namespace: keyPrefix,
432
+ representationName: RepresentationType,
433
+ mergeable: false
434
+ });
435
+ }
436
+
437
+ function select(luvio, params) {
438
+ return select$1();
439
+ }
440
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
441
+ getTypeCacheKeys(storeKeyMap, luvio, response);
442
+ }
443
+ function ingestSuccess(luvio, resourceParams, response) {
444
+ const { body } = response;
445
+ const key = keyBuilderFromType(luvio, body);
446
+ luvio.storeIngest(key, ingest, body);
447
+ const snapshot = luvio.storeLookup({
448
+ recordId: key,
449
+ node: select(),
450
+ variables: {},
451
+ });
452
+ if (process.env.NODE_ENV !== 'production') {
453
+ if (snapshot.state !== 'Fulfilled') {
454
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
455
+ }
456
+ }
457
+ deepFreeze(snapshot.data);
458
+ return snapshot;
459
+ }
460
+ function createResourceRequest(config) {
461
+ const headers = {};
462
+ return {
463
+ baseUri: '/services/data/v66.0',
464
+ basePath: '/connect/gdf/information-library/delete-topic-record',
465
+ method: 'post',
466
+ body: config.body,
467
+ urlParams: {},
468
+ queryParams: {},
469
+ headers,
470
+ priority: 'normal',
471
+ };
472
+ }
473
+
474
+ const adapterName = 'postDeleteTopic';
475
+ const postDeleteTopic_ConfigPropertyMetadata = [
476
+ generateParamConfigMetadata('topicIds', true, 2 /* Body */, 0 /* String */, true),
477
+ ];
478
+ const postDeleteTopic_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, postDeleteTopic_ConfigPropertyMetadata);
479
+ const createResourceParams = /*#__PURE__*/ createResourceParams$2(postDeleteTopic_ConfigPropertyMetadata);
480
+ function typeCheckConfig(untrustedConfig) {
481
+ const config = {};
482
+ typeCheckConfig$2(untrustedConfig, config, postDeleteTopic_ConfigPropertyMetadata);
483
+ return config;
484
+ }
485
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
486
+ if (!untrustedIsObject(untrustedConfig)) {
487
+ return null;
488
+ }
489
+ if (process.env.NODE_ENV !== 'production') {
490
+ validateConfig(untrustedConfig, configPropertyNames);
491
+ }
492
+ const config = typeCheckConfig(untrustedConfig);
493
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
494
+ return null;
495
+ }
496
+ return config;
497
+ }
498
+ function buildNetworkSnapshot(luvio, config, options) {
499
+ const resourceParams = createResourceParams(config);
500
+ const request = createResourceRequest(resourceParams);
501
+ return luvio.dispatchResourceRequest(request, options)
502
+ .then((response) => {
503
+ return luvio.handleSuccessResponse(() => {
504
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
505
+ return luvio.storeBroadcast().then(() => snapshot);
506
+ }, () => {
507
+ const cache = new StoreKeyMap();
508
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
509
+ return cache;
510
+ });
511
+ }, (response) => {
512
+ deepFreeze(response);
513
+ throw response;
514
+ });
515
+ }
516
+ const postDeleteTopicAdapterFactory = (luvio) => {
517
+ return function postDeleteTopic(untrustedConfig) {
518
+ const config = validateAdapterConfig(untrustedConfig, postDeleteTopic_ConfigPropertyNames);
519
+ // Invalid or incomplete config
520
+ if (config === null) {
521
+ throw new Error('Invalid config for "postDeleteTopic"');
522
+ }
523
+ return buildNetworkSnapshot(luvio, config);
524
+ };
525
+ };
526
+
527
+ let getSnippetRelatedTopicsListView;
528
+ let postDeleteTopic;
529
+ // Imperative GET Adapters
530
+ let getSnippetRelatedTopicsListView_imperative;
531
+ // Adapter Metadata
532
+ const getSnippetRelatedTopicsListViewMetadata = {
533
+ apiFamily: 'gdfinformation-lib',
534
+ name: 'getSnippetRelatedTopicsListView',
535
+ ttl: 10000,
536
+ };
537
+ // Notify Update Available
538
+ function bindExportsTo(luvio) {
539
+ // LDS Adapters
540
+ const getSnippetRelatedTopicsListView_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getSnippetRelatedTopicsListView', getSnippetRelatedTopicsListViewAdapterFactory), getSnippetRelatedTopicsListViewMetadata);
541
+ function unwrapSnapshotData(factory) {
542
+ const adapter = factory(luvio);
543
+ return (config) => adapter(config).then((snapshot) => snapshot.data);
544
+ }
545
+ return {
546
+ getSnippetRelatedTopicsListView: createWireAdapterConstructor(luvio, getSnippetRelatedTopicsListView_ldsAdapter, getSnippetRelatedTopicsListViewMetadata),
547
+ postDeleteTopic: unwrapSnapshotData(postDeleteTopicAdapterFactory),
548
+ // Imperative GET Adapters
549
+ getSnippetRelatedTopicsListView_imperative: createImperativeAdapter(luvio, getSnippetRelatedTopicsListView_ldsAdapter, getSnippetRelatedTopicsListViewMetadata),
550
+ // Notify Update Availables
551
+ };
552
+ }
553
+ withDefaultLuvio((luvio) => {
554
+ ({
555
+ getSnippetRelatedTopicsListView,
556
+ postDeleteTopic,
557
+ getSnippetRelatedTopicsListView_imperative,
558
+ } = bindExportsTo(luvio));
559
+ });
560
+
561
+ export { getSnippetRelatedTopicsListView, getSnippetRelatedTopicsListView_imperative, postDeleteTopic };
562
+ // version: 0.1.0-dev1-c978a7b010
@@ -0,0 +1,125 @@
1
+ #%RAML 1.0
2
+ securedBy:
3
+ - OAuth2
4
+ title: Salesforce Connect API
5
+ version: '62.0'
6
+ mediaType: application/json
7
+ protocols:
8
+ - https
9
+ baseUri: /services/data/v66.0
10
+ securitySchemes:
11
+ OAuth2:
12
+ type: OAuth 2.0
13
+ settings:
14
+ authorizationUri: https://example.com/oauth/authorize
15
+ accessTokenUri: ''
16
+ authorizationGrants:
17
+ - implicit
18
+ annotationTypes:
19
+ oas-readOnly:
20
+ type: boolean
21
+ allowedTargets: TypeDeclaration
22
+ oas-collectionFormat:
23
+ type: string
24
+ oas-body-name:
25
+ type: string
26
+ allowedTargets: TypeDeclaration
27
+ types:
28
+ DeleteTopicInputRepresentation:
29
+ description: Delete Topic input representation
30
+ type: object
31
+ properties:
32
+ topicIds:
33
+ description: Topic Id's to be deleted
34
+ type: array
35
+ items:
36
+ type: string
37
+ DeleteTopicOutputRepresentation:
38
+ description: Delete a topic output representation
39
+ type: object
40
+ properties:
41
+ code:
42
+ description: Response code
43
+ type: integer
44
+ message:
45
+ description: Response message
46
+ type: string
47
+ MaterialityTopicDocClauseSetOutputRepresentation:
48
+ description: Materiality topic document clause set information
49
+ type: object
50
+ properties:
51
+ materialityTopic:
52
+ description: Materiality topics information
53
+ type: MaterialityTopicOutputRepresentation
54
+ materialityTopicDocClauseSetId:
55
+ description: Materiality topic document clause set id
56
+ type: string
57
+ MaterialityTopicOutputRepresentation:
58
+ description: Materiality topics for display in list view for information library
59
+ app
60
+ type: object
61
+ properties:
62
+ documentClauseSetsOutputRepresentation:
63
+ description: Document Clause sets associated with this materiality topic
64
+ type: array
65
+ items:
66
+ type: string
67
+ materialityTopicId:
68
+ description: Materiality topic id for information library list view request
69
+ type: string
70
+ materialityTopicName:
71
+ description: Materiality topic name for information library list view request
72
+ type: string
73
+ materialityTopicParentRecordId:
74
+ description: Materiality topic parent record id for information library list
75
+ view request
76
+ type: string
77
+ materialityTopicSortOrder:
78
+ description: Materiality topic sort order for information library list view
79
+ request
80
+ type: string
81
+ SnippetRelatedTopicsOutputRepresentation:
82
+ description: Get snippets to list Topics and MaterialityTopicDocClauseSet
83
+ type: object
84
+ properties:
85
+ code:
86
+ description: Response code for snippet to topics related list
87
+ type: integer
88
+ materialityTopicDocClauseSetList:
89
+ description: Materiality assessment topics document clause set information
90
+ type: array
91
+ items:
92
+ type: MaterialityTopicDocClauseSetOutputRepresentation
93
+ response:
94
+ description: Response message for snippet to topics related list
95
+ type: string
96
+ /connect:
97
+ /gdf/information-library:
98
+ /delete-topic-record:
99
+ post:
100
+ displayName: postDeleteTopic
101
+ description: POST method for deleting a topic
102
+ responses:
103
+ '200':
104
+ description: Success
105
+ body:
106
+ application/json:
107
+ type: DeleteTopicOutputRepresentation
108
+ body:
109
+ application/json:
110
+ type: DeleteTopicInputRepresentation
111
+ (oas-body-name): deleteTopicInput
112
+ /snippet/related-topics:
113
+ get:
114
+ displayName: getSnippetRelatedTopicsListView
115
+ description: Get Materiality Topics List associated with snippet
116
+ responses:
117
+ '200':
118
+ description: Success
119
+ body:
120
+ application/json:
121
+ type: SnippetRelatedTopicsOutputRepresentation
122
+ queryParameters:
123
+ snippetId:
124
+ type: string
125
+ required: false