@salesforce/lds-adapters-platform-applications 1.340.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.txt ADDED
@@ -0,0 +1,82 @@
1
+ Terms of Use
2
+
3
+ Copyright 2022 Salesforce, Inc. All rights reserved.
4
+
5
+ These Terms of Use govern the download, installation, and/or use of this
6
+ software provided by Salesforce, Inc. ("Salesforce") (the "Software"), were
7
+ last updated on April 15, 2022, and constitute a legally binding
8
+ agreement between you and Salesforce. If you do not agree to these Terms of
9
+ Use, do not install or use the Software.
10
+
11
+ Salesforce grants you a worldwide, non-exclusive, no-charge, royalty-free
12
+ copyright license to reproduce, prepare derivative works of, publicly
13
+ display, publicly perform, sublicense, and distribute the Software and
14
+ derivative works subject to these Terms. These Terms shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ Subject to the limited rights expressly granted hereunder, Salesforce
18
+ reserves all rights, title, and interest in and to all intellectual
19
+ property subsisting in the Software. No rights are granted to you hereunder
20
+ other than as expressly set forth herein. Users residing in countries on
21
+ the United States Office of Foreign Assets Control sanction list, or which
22
+ are otherwise subject to a US export embargo, may not use the Software.
23
+
24
+ Implementation of the Software may require development work, for which you
25
+ are responsible. The Software may contain bugs, errors and
26
+ incompatibilities and is made available on an AS IS basis without support,
27
+ updates, or service level commitments.
28
+
29
+ Salesforce reserves the right at any time to modify, suspend, or
30
+ discontinue, the Software (or any part thereof) with or without notice. You
31
+ agree that Salesforce shall not be liable to you or to any third party for
32
+ any modification, suspension, or discontinuance.
33
+
34
+ You agree to defend Salesforce against any claim, demand, suit or
35
+ proceeding made or brought against Salesforce by a third party arising out
36
+ of or accruing from (a) your use of the Software, and (b) any application
37
+ you develop with the Software that infringes any copyright, trademark,
38
+ trade secret, trade dress, patent, or other intellectual property right of
39
+ any person or defames any person or violates their rights of publicity or
40
+ privacy (each a "Claim Against Salesforce"), and will indemnify Salesforce
41
+ from any damages, attorney fees, and costs finally awarded against
42
+ Salesforce as a result of, or for any amounts paid by Salesforce under a
43
+ settlement approved by you in writing of, a Claim Against Salesforce,
44
+ provided Salesforce (x) promptly gives you written notice of the Claim
45
+ Against Salesforce, (y) gives you sole control of the defense and
46
+ settlement of the Claim Against Salesforce (except that you may not settle
47
+ any Claim Against Salesforce unless it unconditionally releases Salesforce
48
+ of all liability), and (z) gives you all reasonable assistance, at your
49
+ expense.
50
+
51
+ WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE SOFTWARE IS NOT
52
+ SUPPORTED AND IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
53
+ IMPLIED. IN NO EVENT SHALL SALESFORCE HAVE ANY LIABILITY FOR ANY DAMAGES,
54
+ INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL, INCIDENTAL,
55
+ PUNITIVE, OR CONSEQUENTIAL DAMAGES, OR DAMAGES BASED ON LOST PROFITS, DATA,
56
+ OR USE, IN CONNECTION WITH THE SOFTWARE, HOWEVER CAUSED AND WHETHER IN
57
+ CONTRACT, TORT, OR UNDER ANY OTHER THEORY OF LIABILITY, WHETHER OR NOT YOU
58
+ HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
59
+
60
+ These Terms of Use shall be governed exclusively by the internal laws of
61
+ the State of California, without regard to its conflicts of laws
62
+ rules. Each party hereby consents to the exclusive jurisdiction of the
63
+ state and federal courts located in San Francisco County, California to
64
+ adjudicate any dispute arising out of or relating to these Terms of Use and
65
+ the download, installation, and/or use of the Software. Except as expressly
66
+ stated herein, these Terms of Use constitute the entire agreement between
67
+ the parties, and supersede all prior and contemporaneous agreements,
68
+ proposals, or representations, written or oral, concerning their subject
69
+ matter. No modification, amendment, or waiver of any provision of these
70
+ Terms of Use shall be effective unless it is by an update to these Terms of
71
+ Use that Salesforce makes available, or is in writing and signed by the
72
+ party against whom the modification, amendment, or waiver is to be
73
+ asserted.
74
+
75
+ Data Privacy: Salesforce may collect, process, and store device,
76
+ system, and other information related to your use of the Software. This
77
+ information includes, but is not limited to, IP address, user metrics, and
78
+ other data ("Usage Data"). Salesforce may use Usage Data for analytics,
79
+ product development, and marketing purposes. You acknowledge that files
80
+ generated in conjunction with the Software may contain sensitive or
81
+ confidential data, and you are solely responsible for anonymizing and
82
+ protecting such data.
@@ -0,0 +1,338 @@
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, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from '@luvio/engine';
8
+
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys, create: ObjectCreate } = 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(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 = 'applications';
73
+
74
+ const { isArray: ArrayIsArray } = Array;
75
+ const { stringify: JSONStringify } = JSON;
76
+ function createLink(ref) {
77
+ return {
78
+ __ref: serializeStructuredKey(ref),
79
+ };
80
+ }
81
+
82
+ function validate$1(obj, path = 'ExplorerViewItem') {
83
+ const v_error = (() => {
84
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
85
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
86
+ }
87
+ const obj_builderUrl = obj.builderUrl;
88
+ const path_builderUrl = path + '.builderUrl';
89
+ if (typeof obj_builderUrl !== 'string') {
90
+ return new TypeError('Expected "string" but received "' + typeof obj_builderUrl + '" (at "' + path_builderUrl + '")');
91
+ }
92
+ const obj_children = obj.children;
93
+ const path_children = path + '.children';
94
+ if (!ArrayIsArray(obj_children)) {
95
+ return new TypeError('Expected "array" but received "' + typeof obj_children + '" (at "' + path_children + '")');
96
+ }
97
+ for (let i = 0; i < obj_children.length; i++) {
98
+ const obj_children_item = obj_children[i];
99
+ const path_children_item = path_children + '[' + i + ']';
100
+ const referencepath_children_itemValidationError = validate$1(obj_children_item, path_children_item);
101
+ if (referencepath_children_itemValidationError !== null) {
102
+ let message = 'Object doesn\'t match ExplorerViewItem (at "' + path_children_item + '")\n';
103
+ message += referencepath_children_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
104
+ return new TypeError(message);
105
+ }
106
+ }
107
+ const obj_label = obj.label;
108
+ const path_label = path + '.label';
109
+ if (typeof obj_label !== 'string') {
110
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
111
+ }
112
+ const obj_name = obj.name;
113
+ const path_name = path + '.name';
114
+ if (typeof obj_name !== 'string') {
115
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
116
+ }
117
+ const obj_showAiGeneratedIcon = obj.showAiGeneratedIcon;
118
+ const path_showAiGeneratedIcon = path + '.showAiGeneratedIcon';
119
+ if (typeof obj_showAiGeneratedIcon !== 'boolean') {
120
+ return new TypeError('Expected "boolean" but received "' + typeof obj_showAiGeneratedIcon + '" (at "' + path_showAiGeneratedIcon + '")');
121
+ }
122
+ })();
123
+ return v_error === undefined ? null : v_error;
124
+ }
125
+
126
+ const TTL = 100000;
127
+ const VERSION = "a1c0c920d7be43bcdc3c77ec011db7a9";
128
+ function validate(obj, path = 'ExplorerViewRepresentation') {
129
+ const v_error = (() => {
130
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
131
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
132
+ }
133
+ const obj_explorerViewItem = obj.explorerViewItem;
134
+ const path_explorerViewItem = path + '.explorerViewItem';
135
+ const referencepath_explorerViewItemValidationError = validate$1(obj_explorerViewItem, path_explorerViewItem);
136
+ if (referencepath_explorerViewItemValidationError !== null) {
137
+ let message = 'Object doesn\'t match ExplorerViewItem (at "' + path_explorerViewItem + '")\n';
138
+ message += referencepath_explorerViewItemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
139
+ return new TypeError(message);
140
+ }
141
+ const obj_metadataId = obj.metadataId;
142
+ const path_metadataId = path + '.metadataId';
143
+ if (typeof obj_metadataId !== 'string') {
144
+ return new TypeError('Expected "string" but received "' + typeof obj_metadataId + '" (at "' + path_metadataId + '")');
145
+ }
146
+ })();
147
+ return v_error === undefined ? null : v_error;
148
+ }
149
+ const RepresentationType = 'ExplorerViewRepresentation';
150
+ function keyBuilder$2(luvio, config) {
151
+ return keyPrefix + '::' + RepresentationType + ':' + config.metadataId;
152
+ }
153
+ function keyBuilderFromType(luvio, object) {
154
+ const keyParams = {
155
+ metadataId: object.metadataId
156
+ };
157
+ return keyBuilder$2(luvio, keyParams);
158
+ }
159
+ function normalize(input, existing, path, luvio, store, timestamp) {
160
+ return input;
161
+ }
162
+ const select$1 = function ExplorerViewRepresentationSelect() {
163
+ return {
164
+ kind: 'Fragment',
165
+ version: VERSION,
166
+ private: [],
167
+ opaque: true
168
+ };
169
+ };
170
+ function equals(existing, incoming) {
171
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
172
+ return false;
173
+ }
174
+ return true;
175
+ }
176
+ const ingest = function ExplorerViewRepresentationIngest(input, path, luvio, store, timestamp) {
177
+ if (process.env.NODE_ENV !== 'production') {
178
+ const validateError = validate(input);
179
+ if (validateError !== null) {
180
+ throw validateError;
181
+ }
182
+ }
183
+ const key = keyBuilderFromType(luvio, input);
184
+ const ttlToUse = TTL;
185
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "applications", VERSION, RepresentationType, equals);
186
+ return createLink(key);
187
+ };
188
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
189
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
190
+ const rootKey = keyBuilderFromType(luvio, input);
191
+ rootKeySet.set(rootKey, {
192
+ namespace: keyPrefix,
193
+ representationName: RepresentationType,
194
+ mergeable: false
195
+ });
196
+ }
197
+
198
+ function select(luvio, params) {
199
+ return select$1();
200
+ }
201
+ function keyBuilder$1(luvio, params) {
202
+ return keyBuilder$2(luvio, {
203
+ metadataId: params.urlParams.metadataId
204
+ });
205
+ }
206
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
207
+ getTypeCacheKeys(storeKeyMap, luvio, response);
208
+ }
209
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
210
+ const { body } = response;
211
+ const key = keyBuilder$1(luvio, resourceParams);
212
+ luvio.storeIngest(key, ingest, body);
213
+ const snapshot = luvio.storeLookup({
214
+ recordId: key,
215
+ node: select(),
216
+ variables: {},
217
+ }, snapshotRefresh);
218
+ if (process.env.NODE_ENV !== 'production') {
219
+ if (snapshot.state !== 'Fulfilled') {
220
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
221
+ }
222
+ }
223
+ deepFreeze(snapshot.data);
224
+ return snapshot;
225
+ }
226
+ function ingestError(luvio, params, error, snapshotRefresh) {
227
+ const key = keyBuilder$1(luvio, params);
228
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
229
+ const storeMetadataParams = {
230
+ ttl: TTL,
231
+ namespace: keyPrefix,
232
+ version: VERSION,
233
+ representationName: RepresentationType
234
+ };
235
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
236
+ return errorSnapshot;
237
+ }
238
+ function createResourceRequest(config) {
239
+ const headers = {};
240
+ return {
241
+ baseUri: '/services/data/v64.0',
242
+ basePath: '/connect/explorer-view/' + config.urlParams.metadataId + '',
243
+ method: 'get',
244
+ body: null,
245
+ urlParams: config.urlParams,
246
+ queryParams: {},
247
+ headers,
248
+ priority: 'normal',
249
+ };
250
+ }
251
+
252
+ const adapterName = 'getExplorerView';
253
+ const getExplorerView_ConfigPropertyMetadata = [
254
+ generateParamConfigMetadata('metadataId', true, 0 /* UrlParameter */, 0 /* String */),
255
+ ];
256
+ const getExplorerView_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getExplorerView_ConfigPropertyMetadata);
257
+ const createResourceParams = /*#__PURE__*/ createResourceParams$1(getExplorerView_ConfigPropertyMetadata);
258
+ function keyBuilder(luvio, config) {
259
+ const resourceParams = createResourceParams(config);
260
+ return keyBuilder$1(luvio, resourceParams);
261
+ }
262
+ function typeCheckConfig(untrustedConfig) {
263
+ const config = {};
264
+ typeCheckConfig$1(untrustedConfig, config, getExplorerView_ConfigPropertyMetadata);
265
+ return config;
266
+ }
267
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
268
+ if (!untrustedIsObject(untrustedConfig)) {
269
+ return null;
270
+ }
271
+ if (process.env.NODE_ENV !== 'production') {
272
+ validateConfig(untrustedConfig, configPropertyNames);
273
+ }
274
+ const config = typeCheckConfig(untrustedConfig);
275
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
276
+ return null;
277
+ }
278
+ return config;
279
+ }
280
+ function adapterFragment(luvio, config) {
281
+ createResourceParams(config);
282
+ return select();
283
+ }
284
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
285
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
286
+ config,
287
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
288
+ });
289
+ return luvio.storeBroadcast().then(() => snapshot);
290
+ }
291
+ function onFetchResponseError(luvio, config, resourceParams, response) {
292
+ const snapshot = ingestError(luvio, resourceParams, response, {
293
+ config,
294
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
295
+ });
296
+ return luvio.storeBroadcast().then(() => snapshot);
297
+ }
298
+ function buildNetworkSnapshot(luvio, config, options) {
299
+ const resourceParams = createResourceParams(config);
300
+ const request = createResourceRequest(resourceParams);
301
+ return luvio.dispatchResourceRequest(request, options)
302
+ .then((response) => {
303
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
304
+ const cache = new StoreKeyMap();
305
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
306
+ return cache;
307
+ });
308
+ }, (response) => {
309
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
310
+ });
311
+ }
312
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
313
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
314
+ }
315
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
316
+ const { luvio, config } = context;
317
+ const selector = {
318
+ recordId: keyBuilder(luvio, config),
319
+ node: adapterFragment(luvio, config),
320
+ variables: {},
321
+ };
322
+ const cacheSnapshot = storeLookup(selector, {
323
+ config,
324
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
325
+ });
326
+ return cacheSnapshot;
327
+ }
328
+ const getExplorerViewAdapterFactory = (luvio) => function applications__getExplorerView(untrustedConfig, requestContext) {
329
+ const config = validateAdapterConfig(untrustedConfig, getExplorerView_ConfigPropertyNames);
330
+ // Invalid or incomplete config
331
+ if (config === null) {
332
+ return null;
333
+ }
334
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
335
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
336
+ };
337
+
338
+ export { getExplorerViewAdapterFactory };
@@ -0,0 +1,62 @@
1
+ import { Adapter as $64$luvio_engine_Adapter, Snapshot as $64$luvio_engine_Snapshot, UnfulfilledSnapshot as $64$luvio_engine_UnfulfilledSnapshot, AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata } from '@luvio/engine';
2
+ export declare const ObjectPrototypeHasOwnProperty: (v: PropertyKey) => boolean;
3
+ declare const ObjectKeys: {
4
+ (o: object): string[];
5
+ (o: {}): string[];
6
+ }, ObjectCreate: {
7
+ (o: object | null): any;
8
+ (o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
9
+ };
10
+ export { ObjectCreate, ObjectKeys };
11
+ export declare const ArrayIsArray: (arg: any) => arg is any[];
12
+ export declare const ArrayPrototypePush: (...items: any[]) => number;
13
+ export interface AdapterValidationConfig {
14
+ displayName: string;
15
+ parameters: {
16
+ required: string[];
17
+ optional: string[];
18
+ unsupported?: string[];
19
+ };
20
+ }
21
+ /**
22
+ * Validates an adapter config is well-formed.
23
+ * @param config The config to validate.
24
+ * @param adapter The adapter validation configuration.
25
+ * @param oneOf The keys the config must contain at least one of.
26
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
27
+ */
28
+ export declare function validateConfig<T>(config: Untrusted<T>, adapter: AdapterValidationConfig, oneOf?: string[]): void;
29
+ export declare function untrustedIsObject<Base>(untrusted: unknown): untrusted is Untrusted<Base>;
30
+ export type UncoercedConfiguration<Base, Options extends {
31
+ [key in keyof Base]?: any;
32
+ }> = {
33
+ [Key in keyof Base]?: Base[Key] | Options[Key];
34
+ };
35
+ export type Untrusted<Base> = Partial<Base>;
36
+ export declare function areRequiredParametersPresent<T>(config: any, configPropertyNames: AdapterValidationConfig): config is T;
37
+ export declare function refreshable<C, D, R>(adapter: $64$luvio_engine_Adapter<C, D>, resolve: (config: unknown) => Promise<$64$luvio_engine_Snapshot<R>>): $64$luvio_engine_Adapter<C, D>;
38
+ export declare const SNAPSHOT_STATE_FULFILLED = "Fulfilled";
39
+ export declare const SNAPSHOT_STATE_UNFULFILLED = "Unfulfilled";
40
+ export declare const snapshotRefreshOptions: {
41
+ overrides: {
42
+ headers: {
43
+ 'Cache-Control': string;
44
+ };
45
+ };
46
+ };
47
+ /**
48
+ * A deterministic JSON stringify implementation. Heavily adapted from https://github.com/epoberezkin/fast-json-stable-stringify.
49
+ * This is needed because insertion order for JSON.stringify(object) affects output:
50
+ * JSON.stringify({a: 1, b: 2})
51
+ * "{"a":1,"b":2}"
52
+ * JSON.stringify({b: 2, a: 1})
53
+ * "{"b":2,"a":1}"
54
+ * @param data Data to be JSON-stringified.
55
+ * @returns JSON.stringified value with consistent ordering of keys.
56
+ */
57
+ export declare function stableJSONStringify(node: any): string | undefined;
58
+ export declare function getFetchResponseStatusText(status: number): string;
59
+ export declare function isUnfulfilledSnapshot<T, U>(snapshot: $64$luvio_engine_Snapshot<T, U>): snapshot is $64$luvio_engine_UnfulfilledSnapshot<T, U>;
60
+ export declare function generateParamConfigMetadata(name: string, required: boolean, resourceType: $64$luvio_engine_AdapterConfigMetadata['resourceType'], typeCheckShape: $64$luvio_engine_AdapterConfigMetadata['typeCheckShape'], isArrayShape?: boolean, coerceFn?: (v: unknown) => unknown): $64$luvio_engine_AdapterConfigMetadata;
61
+ export declare function buildAdapterValidationConfig(displayName: string, paramsMeta: $64$luvio_engine_AdapterConfigMetadata[]): AdapterValidationConfig;
62
+ export declare const keyPrefix = "applications";
@@ -0,0 +1,28 @@
1
+ import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
2
+ import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, UncoercedConfiguration as adapter$45$utils_UncoercedConfiguration } from './adapter-utils';
3
+ import { ResourceRequestConfig as resources_getConnectExplorerViewByMetadataId_ResourceRequestConfig } from '../resources/getConnectExplorerViewByMetadataId';
4
+ import { ExplorerViewRepresentation as types_ExplorerViewRepresentation_ExplorerViewRepresentation, KeyParams as types_ExplorerViewRepresentation_KeyParams } from '../types/ExplorerViewRepresentation';
5
+ export declare const adapterName = "getExplorerView";
6
+ export declare const getExplorerView_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
+ export declare const getExplorerView_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
+ export interface GetExplorerViewConfig {
9
+ metadataId: string;
10
+ }
11
+ export declare const createResourceParams: (config: GetExplorerViewConfig) => resources_getConnectExplorerViewByMetadataId_ResourceRequestConfig;
12
+ export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, config: GetExplorerViewConfig): string;
13
+ export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, config: GetExplorerViewConfig): $64$luvio_engine_NormalizedKeyMetadata;
14
+ export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<GetExplorerViewConfig>): adapter$45$utils_Untrusted<GetExplorerViewConfig>;
15
+ export declare function validateAdapterConfig(untrustedConfig: unknown, configPropertyNames: adapter$45$utils_AdapterValidationConfig): GetExplorerViewConfig | null;
16
+ export declare function adapterFragment(luvio: $64$luvio_engine_Luvio, config: GetExplorerViewConfig): $64$luvio_engine_Fragment;
17
+ export declare function buildCachedSnapshot(luvio: $64$luvio_engine_Luvio, config: GetExplorerViewConfig): $64$luvio_engine_Snapshot<types_ExplorerViewRepresentation_ExplorerViewRepresentation, any>;
18
+ export declare function onFetchResponseSuccess(luvio: $64$luvio_engine_Luvio, config: GetExplorerViewConfig, resourceParams: resources_getConnectExplorerViewByMetadataId_ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_ExplorerViewRepresentation_ExplorerViewRepresentation>): Promise<import("@luvio/engine").FulfilledSnapshot<types_ExplorerViewRepresentation_ExplorerViewRepresentation, {}> | import("@luvio/engine").StaleSnapshot<types_ExplorerViewRepresentation_ExplorerViewRepresentation, {}> | import("@luvio/engine").PendingSnapshot<types_ExplorerViewRepresentation_ExplorerViewRepresentation, any>>;
19
+ export declare function onFetchResponseError(luvio: $64$luvio_engine_Luvio, config: GetExplorerViewConfig, resourceParams: resources_getConnectExplorerViewByMetadataId_ResourceRequestConfig, response: $64$luvio_engine_ErrorResponse): Promise<import("@luvio/engine").ErrorSnapshot>;
20
+ export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: GetExplorerViewConfig, options?: $64$luvio_engine_DispatchResourceRequestContext): Promise<$64$luvio_engine_Snapshot<types_ExplorerViewRepresentation_ExplorerViewRepresentation, any>>;
21
+ export type BuildSnapshotContext = {
22
+ luvio: $64$luvio_engine_Luvio;
23
+ config: GetExplorerViewConfig;
24
+ };
25
+ export declare function buildNetworkSnapshotCachePolicy(context: BuildSnapshotContext, coercedAdapterRequestContext: $64$luvio_engine_CoercedAdapterRequestContext): Promise<$64$luvio_engine_Snapshot<types_ExplorerViewRepresentation_ExplorerViewRepresentation, any>>;
26
+ export declare function buildCachedSnapshotCachePolicy(context: BuildSnapshotContext, storeLookup: $64$luvio_engine_StoreLookup<types_ExplorerViewRepresentation_ExplorerViewRepresentation>): $64$luvio_engine_Snapshot<types_ExplorerViewRepresentation_ExplorerViewRepresentation, any>;
27
+ export declare const getExplorerViewAdapterFactory: $64$luvio_engine_AdapterFactory<GetExplorerViewConfig, types_ExplorerViewRepresentation_ExplorerViewRepresentation>;
28
+ export declare const notifyChangeFactory: (luvio: $64$luvio_engine_Luvio, options?: $64$luvio_engine_DispatchResourceRequestContext) => (configs: adapter$45$utils_UncoercedConfiguration<types_ExplorerViewRepresentation_KeyParams, any>[]) => void;
@@ -0,0 +1 @@
1
+ export { getExplorerViewAdapterFactory } from '../adapters/getExplorerView';
@@ -0,0 +1,4 @@
1
+ declare let getExplorerView: any;
2
+ declare let getExplorerViewNotifyChange: any;
3
+ declare let getExplorerView_imperative: any;
4
+ export { getExplorerView, getExplorerViewNotifyChange, getExplorerView_imperative };
@@ -0,0 +1,16 @@
1
+ import { Luvio as $64$luvio_engine_Luvio, Fragment as $64$luvio_engine_Fragment, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, FetchResponse as $64$luvio_engine_FetchResponse, SnapshotRefresh as $64$luvio_engine_SnapshotRefresh, FulfilledSnapshot as $64$luvio_engine_FulfilledSnapshot, StaleSnapshot as $64$luvio_engine_StaleSnapshot, PendingSnapshot as $64$luvio_engine_PendingSnapshot, ErrorResponse as $64$luvio_engine_ErrorResponse, ErrorSnapshot as $64$luvio_engine_ErrorSnapshot, ResourceRequest as $64$luvio_engine_ResourceRequest } from '@luvio/engine';
2
+ import { ExplorerViewRepresentation as types_ExplorerViewRepresentation_ExplorerViewRepresentation } from '../types/ExplorerViewRepresentation';
3
+ export interface ResourceRequestConfig {
4
+ urlParams: {
5
+ metadataId: string;
6
+ };
7
+ }
8
+ export declare function select(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_Fragment;
9
+ export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): string;
10
+ export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_NormalizedKeyMetadata;
11
+ export declare function getResponseCacheKeys(storeKeyMap: any, luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: types_ExplorerViewRepresentation_ExplorerViewRepresentation): void;
12
+ export declare function ingestSuccess(luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_ExplorerViewRepresentation_ExplorerViewRepresentation>, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_ExplorerViewRepresentation_ExplorerViewRepresentation>): $64$luvio_engine_FulfilledSnapshot<types_ExplorerViewRepresentation_ExplorerViewRepresentation, {}> | $64$luvio_engine_StaleSnapshot<types_ExplorerViewRepresentation_ExplorerViewRepresentation, {}> | $64$luvio_engine_PendingSnapshot<types_ExplorerViewRepresentation_ExplorerViewRepresentation, any>;
13
+ export declare function ingestError(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig, error: $64$luvio_engine_ErrorResponse, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_ExplorerViewRepresentation_ExplorerViewRepresentation>): $64$luvio_engine_ErrorSnapshot;
14
+ export declare function createResourceRequest(config: ResourceRequestConfig): $64$luvio_engine_ResourceRequest;
15
+ export default createResourceRequest;
16
+ export declare function createResourceRequestFromRepresentation(representation: types_ExplorerViewRepresentation_ExplorerViewRepresentation): $64$luvio_engine_ResourceRequest;
@@ -0,0 +1,40 @@
1
+ import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
2
+ export declare const VERSION = "8ad0ea3accaa64b0357bddb5a1fbb1d5";
3
+ export declare function validate(obj: any, path?: string): TypeError | null;
4
+ export declare const RepresentationType: string;
5
+ export declare function normalize(input: ExplorerViewItem, existing: ExplorerViewItemNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ExplorerViewItemNormalized;
6
+ export declare const select: () => $64$luvio_engine_FragmentSelection;
7
+ export declare function equals(existing: ExplorerViewItemNormalized, incoming: ExplorerViewItemNormalized): boolean;
8
+ export declare const ingest: $64$luvio_engine_ResourceIngest;
9
+ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: ExplorerViewItem, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
10
+ /**
11
+ * Representation for the each tree item inside Explorer View
12
+ *
13
+ * Keys:
14
+ * (none)
15
+ */
16
+ export interface ExplorerViewItemNormalized {
17
+ /** Returns the builder url of the explorer view item */
18
+ builderUrl: string;
19
+ /** Returns the list of children associated with that explorer view item */
20
+ children: Array<ExplorerViewItem>;
21
+ /** Returns the label of the explorer view item */
22
+ label: string;
23
+ /** Returns the name of the explorer view item */
24
+ name: string;
25
+ /** Returns explorer view item true if explorer view item is AI generated */
26
+ showAiGeneratedIcon: boolean;
27
+ }
28
+ /**
29
+ * Representation for the each tree item inside Explorer View
30
+ *
31
+ * Keys:
32
+ * (none)
33
+ */
34
+ export interface ExplorerViewItem {
35
+ builderUrl: string;
36
+ children: Array<ExplorerViewItem>;
37
+ label: string;
38
+ name: string;
39
+ showAiGeneratedIcon: boolean;
40
+ }
@@ -0,0 +1,42 @@
1
+ import { ExplorerViewItem as ExplorerViewItem_ExplorerViewItem } from './ExplorerViewItem';
2
+ import { KeyMetadata as $64$luvio_engine_KeyMetadata, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Luvio as $64$luvio_engine_Luvio, IngestPath as $64$luvio_engine_IngestPath, Store as $64$luvio_engine_Store, BaseFragment as $64$luvio_engine_BaseFragment, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap } from '@luvio/engine';
3
+ export declare const TTL = 100000;
4
+ export declare const VERSION = "a1c0c920d7be43bcdc3c77ec011db7a9";
5
+ export declare function validate(obj: any, path?: string): TypeError | null;
6
+ export declare const RepresentationType: string;
7
+ export interface KeyParams extends $64$luvio_engine_KeyMetadata {
8
+ metadataId: string;
9
+ }
10
+ export type ExplorerViewRepresentationNormalizedKeyMetadata = KeyParams & $64$luvio_engine_NormalizedKeyMetadata;
11
+ export type PartialExplorerViewRepresentationNormalizedKeyMetadata = Partial<KeyParams> & $64$luvio_engine_NormalizedKeyMetadata;
12
+ export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, config: KeyParams): string;
13
+ export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, config: KeyParams): ExplorerViewRepresentationNormalizedKeyMetadata;
14
+ export declare function keyBuilderFromType(luvio: $64$luvio_engine_Luvio, object: ExplorerViewRepresentation): string;
15
+ export declare function keyBuilderFromType_StructuredKey(luvio: $64$luvio_engine_Luvio, object: ExplorerViewRepresentation): $64$luvio_engine_NormalizedKeyMetadata;
16
+ export declare function normalize(input: ExplorerViewRepresentation, existing: ExplorerViewRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ExplorerViewRepresentationNormalized;
17
+ export declare const select: () => $64$luvio_engine_BaseFragment;
18
+ export declare function equals(existing: ExplorerViewRepresentationNormalized, incoming: ExplorerViewRepresentationNormalized): boolean;
19
+ export declare const ingest: $64$luvio_engine_ResourceIngest;
20
+ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: ExplorerViewRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
21
+ /**
22
+ * Representation for the tree like Explorer View structure
23
+ *
24
+ * Keys:
25
+ * metadataId (string): metadataId
26
+ */
27
+ export interface ExplorerViewRepresentationNormalized {
28
+ /** Returns the root node of explorer view */
29
+ explorerViewItem: ExplorerViewItem_ExplorerViewItem;
30
+ /** Returns the metadata id for which explorer view is shown */
31
+ metadataId: string;
32
+ }
33
+ /**
34
+ * Representation for the tree like Explorer View structure
35
+ *
36
+ * Keys:
37
+ * metadataId (string): metadataId
38
+ */
39
+ export interface ExplorerViewRepresentation {
40
+ explorerViewItem: ExplorerViewItem_ExplorerViewItem;
41
+ metadataId: string;
42
+ }
@@ -0,0 +1,32 @@
1
+ import { NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
2
+ export declare const ObjectKeys: {
3
+ (o: object): string[];
4
+ (o: {}): string[];
5
+ }, ObjectCreate: {
6
+ (o: object | null): any;
7
+ (o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
8
+ }, ObjectAssign: {
9
+ <T extends {}, U>(target: T, source: U): T & U;
10
+ <T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
11
+ <T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
12
+ (target: object, ...sources: any[]): any;
13
+ };
14
+ export declare const ArrayIsArray: (arg: any) => arg is any[];
15
+ export declare const JSONStringify: {
16
+ (value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
17
+ (value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
18
+ };
19
+ type AllowedPrimitives = boolean | string | number | Date | null;
20
+ type Value<T> = T extends AllowedPrimitives ? T : RecursivePartial<T>;
21
+ export type RecursivePartial<T> = null | {
22
+ [P in keyof T]?: T[P] extends Array<infer U> ? Array<Value<U>> | null : Value<T[P]> | null;
23
+ };
24
+ export declare function equalsArray<U, V extends U[]>(a: V, b: V, equalsItem: (itemA: U, itemB: U) => boolean | void): boolean;
25
+ export declare function equalsObject<U, V extends {
26
+ [key: string]: U;
27
+ }>(a: V, b: V, equalsProp: (propA: U, propB: U) => boolean | void): boolean;
28
+ export declare function createLink(ref: string | $64$luvio_engine_NormalizedKeyMetadata): {
29
+ __ref: string;
30
+ };
31
+ export declare function assignMetadataLink(entry: any, metadataKey: string | $64$luvio_engine_NormalizedKeyMetadata): void;
32
+ export {};
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@salesforce/lds-adapters-platform-applications",
3
+ "version": "1.340.0",
4
+ "description": "salesforce applications",
5
+ "license": "SEE LICENSE IN LICENSE.txt",
6
+ "main": "dist/es/es2018/platform-applications.js",
7
+ "module": "dist/es/es2018/platform-applications.js",
8
+ "types": "dist/es/es2018/types/src/generated/artifacts/main.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "sfdc",
12
+ "src/raml/*"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/es/es2018/types/src/generated/artifacts/main.d.ts",
17
+ "import": "./dist/es/es2018/platform-applications.js",
18
+ "require": "./dist/es/es2018/platform-applications.js"
19
+ },
20
+ "./sfdc": {
21
+ "types": "./sfdc/index.d.ts",
22
+ "import": "./sfdc/index.js",
23
+ "default": "./sfdc/index.js"
24
+ }
25
+ },
26
+ "sfdc": {
27
+ "namespace": "lightning",
28
+ "module": "platformApplicationsApi"
29
+ },
30
+ "contributors": [
31
+ "t.garg@salesforce.com"
32
+ ],
33
+ "scripts": {
34
+ "build": "yarn build:services",
35
+ "build:raml": "luvio generate src/raml/luvio.raml src/generated -p '../lds-compiler-plugins'",
36
+ "build:services": "rollup --bundleConfigAsCjs --config rollup.config.js",
37
+ "clean": "rm -rf dist sfdc src/generated",
38
+ "release:core": "../../scripts/release/core.js --adapter=lds-adapters-platform-applications",
39
+ "release:corejar": "yarn build && ../core-build/scripts/core.js --adapter=lds-adapters-platform-applications",
40
+ "test:unit": "jest"
41
+ },
42
+ "dependencies": {
43
+ "@salesforce/lds-bindings": "^1.340.0"
44
+ },
45
+ "devDependencies": {
46
+ "@salesforce/lds-compiler-plugins": "^1.340.0"
47
+ },
48
+ "nx": {
49
+ "targets": {
50
+ "build": {
51
+ "outputs": [
52
+ "{projectRoot}/dist",
53
+ "{projectRoot}/sfdc"
54
+ ]
55
+ },
56
+ "build:raml": {
57
+ "outputs": [
58
+ "{projectRoot}/src/generated"
59
+ ]
60
+ }
61
+ }
62
+ },
63
+ "volta": {
64
+ "extends": "../../package.json"
65
+ }
66
+ }
@@ -0,0 +1 @@
1
+ export * from '../dist/es/es2018/types/src/generated/artifacts/sfdc';
package/sfdc/index.js ADDED
@@ -0,0 +1,413 @@
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, StoreKeyMap, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$1, createResourceParams as createResourceParams$1 } 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 = 'applications';
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$1(obj, path = 'ExplorerViewItem') {
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_builderUrl = obj.builderUrl;
98
+ const path_builderUrl = path + '.builderUrl';
99
+ if (typeof obj_builderUrl !== 'string') {
100
+ return new TypeError('Expected "string" but received "' + typeof obj_builderUrl + '" (at "' + path_builderUrl + '")');
101
+ }
102
+ const obj_children = obj.children;
103
+ const path_children = path + '.children';
104
+ if (!ArrayIsArray(obj_children)) {
105
+ return new TypeError('Expected "array" but received "' + typeof obj_children + '" (at "' + path_children + '")');
106
+ }
107
+ for (let i = 0; i < obj_children.length; i++) {
108
+ const obj_children_item = obj_children[i];
109
+ const path_children_item = path_children + '[' + i + ']';
110
+ const referencepath_children_itemValidationError = validate$1(obj_children_item, path_children_item);
111
+ if (referencepath_children_itemValidationError !== null) {
112
+ let message = 'Object doesn\'t match ExplorerViewItem (at "' + path_children_item + '")\n';
113
+ message += referencepath_children_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
114
+ return new TypeError(message);
115
+ }
116
+ }
117
+ const obj_label = obj.label;
118
+ const path_label = path + '.label';
119
+ if (typeof obj_label !== 'string') {
120
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
121
+ }
122
+ const obj_name = obj.name;
123
+ const path_name = path + '.name';
124
+ if (typeof obj_name !== 'string') {
125
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
126
+ }
127
+ const obj_showAiGeneratedIcon = obj.showAiGeneratedIcon;
128
+ const path_showAiGeneratedIcon = path + '.showAiGeneratedIcon';
129
+ if (typeof obj_showAiGeneratedIcon !== 'boolean') {
130
+ return new TypeError('Expected "boolean" but received "' + typeof obj_showAiGeneratedIcon + '" (at "' + path_showAiGeneratedIcon + '")');
131
+ }
132
+ })();
133
+ return v_error === undefined ? null : v_error;
134
+ }
135
+
136
+ const TTL = 100000;
137
+ const VERSION = "a1c0c920d7be43bcdc3c77ec011db7a9";
138
+ function validate(obj, path = 'ExplorerViewRepresentation') {
139
+ const v_error = (() => {
140
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
141
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
142
+ }
143
+ const obj_explorerViewItem = obj.explorerViewItem;
144
+ const path_explorerViewItem = path + '.explorerViewItem';
145
+ const referencepath_explorerViewItemValidationError = validate$1(obj_explorerViewItem, path_explorerViewItem);
146
+ if (referencepath_explorerViewItemValidationError !== null) {
147
+ let message = 'Object doesn\'t match ExplorerViewItem (at "' + path_explorerViewItem + '")\n';
148
+ message += referencepath_explorerViewItemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
149
+ return new TypeError(message);
150
+ }
151
+ const obj_metadataId = obj.metadataId;
152
+ const path_metadataId = path + '.metadataId';
153
+ if (typeof obj_metadataId !== 'string') {
154
+ return new TypeError('Expected "string" but received "' + typeof obj_metadataId + '" (at "' + path_metadataId + '")');
155
+ }
156
+ })();
157
+ return v_error === undefined ? null : v_error;
158
+ }
159
+ const RepresentationType = 'ExplorerViewRepresentation';
160
+ function keyBuilder$2(luvio, config) {
161
+ return keyPrefix + '::' + RepresentationType + ':' + config.metadataId;
162
+ }
163
+ function keyBuilderFromType(luvio, object) {
164
+ const keyParams = {
165
+ metadataId: object.metadataId
166
+ };
167
+ return keyBuilder$2(luvio, keyParams);
168
+ }
169
+ function normalize(input, existing, path, luvio, store, timestamp) {
170
+ return input;
171
+ }
172
+ const select$1 = function ExplorerViewRepresentationSelect() {
173
+ return {
174
+ kind: 'Fragment',
175
+ version: VERSION,
176
+ private: [],
177
+ opaque: true
178
+ };
179
+ };
180
+ function equals(existing, incoming) {
181
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
182
+ return false;
183
+ }
184
+ return true;
185
+ }
186
+ const ingest = function ExplorerViewRepresentationIngest(input, path, luvio, store, timestamp) {
187
+ if (process.env.NODE_ENV !== 'production') {
188
+ const validateError = validate(input);
189
+ if (validateError !== null) {
190
+ throw validateError;
191
+ }
192
+ }
193
+ const key = keyBuilderFromType(luvio, input);
194
+ const ttlToUse = TTL;
195
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "applications", VERSION, RepresentationType, equals);
196
+ return createLink(key);
197
+ };
198
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
199
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
200
+ const rootKey = keyBuilderFromType(luvio, input);
201
+ rootKeySet.set(rootKey, {
202
+ namespace: keyPrefix,
203
+ representationName: RepresentationType,
204
+ mergeable: false
205
+ });
206
+ }
207
+
208
+ function select(luvio, params) {
209
+ return select$1();
210
+ }
211
+ function keyBuilder$1(luvio, params) {
212
+ return keyBuilder$2(luvio, {
213
+ metadataId: params.urlParams.metadataId
214
+ });
215
+ }
216
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
217
+ getTypeCacheKeys(storeKeyMap, luvio, response);
218
+ }
219
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
220
+ const { body } = response;
221
+ const key = keyBuilder$1(luvio, resourceParams);
222
+ luvio.storeIngest(key, ingest, body);
223
+ const snapshot = luvio.storeLookup({
224
+ recordId: key,
225
+ node: select(),
226
+ variables: {},
227
+ }, snapshotRefresh);
228
+ if (process.env.NODE_ENV !== 'production') {
229
+ if (snapshot.state !== 'Fulfilled') {
230
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
231
+ }
232
+ }
233
+ deepFreeze(snapshot.data);
234
+ return snapshot;
235
+ }
236
+ function ingestError(luvio, params, error, snapshotRefresh) {
237
+ const key = keyBuilder$1(luvio, params);
238
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
239
+ const storeMetadataParams = {
240
+ ttl: TTL,
241
+ namespace: keyPrefix,
242
+ version: VERSION,
243
+ representationName: RepresentationType
244
+ };
245
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
246
+ return errorSnapshot;
247
+ }
248
+ function createResourceRequest(config) {
249
+ const headers = {};
250
+ return {
251
+ baseUri: '/services/data/v64.0',
252
+ basePath: '/connect/explorer-view/' + config.urlParams.metadataId + '',
253
+ method: 'get',
254
+ body: null,
255
+ urlParams: config.urlParams,
256
+ queryParams: {},
257
+ headers,
258
+ priority: 'normal',
259
+ };
260
+ }
261
+ function createResourceRequestFromRepresentation(representation) {
262
+ const config = {
263
+ urlParams: {},
264
+ };
265
+ config.urlParams.metadataId = representation.metadataId;
266
+ return createResourceRequest(config);
267
+ }
268
+
269
+ const adapterName = 'getExplorerView';
270
+ const getExplorerView_ConfigPropertyMetadata = [
271
+ generateParamConfigMetadata('metadataId', true, 0 /* UrlParameter */, 0 /* String */),
272
+ ];
273
+ const getExplorerView_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getExplorerView_ConfigPropertyMetadata);
274
+ const createResourceParams = /*#__PURE__*/ createResourceParams$1(getExplorerView_ConfigPropertyMetadata);
275
+ function keyBuilder(luvio, config) {
276
+ const resourceParams = createResourceParams(config);
277
+ return keyBuilder$1(luvio, resourceParams);
278
+ }
279
+ function typeCheckConfig(untrustedConfig) {
280
+ const config = {};
281
+ typeCheckConfig$1(untrustedConfig, config, getExplorerView_ConfigPropertyMetadata);
282
+ return config;
283
+ }
284
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
285
+ if (!untrustedIsObject(untrustedConfig)) {
286
+ return null;
287
+ }
288
+ if (process.env.NODE_ENV !== 'production') {
289
+ validateConfig(untrustedConfig, configPropertyNames);
290
+ }
291
+ const config = typeCheckConfig(untrustedConfig);
292
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
293
+ return null;
294
+ }
295
+ return config;
296
+ }
297
+ function adapterFragment(luvio, config) {
298
+ createResourceParams(config);
299
+ return select();
300
+ }
301
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
302
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
303
+ config,
304
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
305
+ });
306
+ return luvio.storeBroadcast().then(() => snapshot);
307
+ }
308
+ function onFetchResponseError(luvio, config, resourceParams, response) {
309
+ const snapshot = ingestError(luvio, resourceParams, response, {
310
+ config,
311
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
312
+ });
313
+ return luvio.storeBroadcast().then(() => snapshot);
314
+ }
315
+ function buildNetworkSnapshot(luvio, config, options) {
316
+ const resourceParams = createResourceParams(config);
317
+ const request = createResourceRequest(resourceParams);
318
+ return luvio.dispatchResourceRequest(request, options)
319
+ .then((response) => {
320
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
321
+ const cache = new StoreKeyMap();
322
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
323
+ return cache;
324
+ });
325
+ }, (response) => {
326
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
327
+ });
328
+ }
329
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
330
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
331
+ }
332
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
333
+ const { luvio, config } = context;
334
+ const selector = {
335
+ recordId: keyBuilder(luvio, config),
336
+ node: adapterFragment(luvio, config),
337
+ variables: {},
338
+ };
339
+ const cacheSnapshot = storeLookup(selector, {
340
+ config,
341
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
342
+ });
343
+ return cacheSnapshot;
344
+ }
345
+ const getExplorerViewAdapterFactory = (luvio) => function applications__getExplorerView(untrustedConfig, requestContext) {
346
+ const config = validateAdapterConfig(untrustedConfig, getExplorerView_ConfigPropertyNames);
347
+ // Invalid or incomplete config
348
+ if (config === null) {
349
+ return null;
350
+ }
351
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
352
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
353
+ };
354
+ const notifyChangeFactory = (luvio, options) => {
355
+ return function getConnectExplorerViewByMetadataIdNotifyChange(configs) {
356
+ const keys = configs.map(c => keyBuilder$2(luvio, c));
357
+ luvio.getNotifyChangeStoreEntries(keys).then(entries => {
358
+ for (let i = 0, len = entries.length; i < len; i++) {
359
+ const { key, record: val } = entries[i];
360
+ const refreshRequest = createResourceRequestFromRepresentation(val);
361
+ luvio.dispatchResourceRequest(refreshRequest, options)
362
+ .then((response) => {
363
+ return luvio.handleSuccessResponse(() => {
364
+ const { body } = response;
365
+ luvio.storeIngest(key, ingest, body);
366
+ return luvio.storeBroadcast();
367
+ }, () => {
368
+ const cache = new StoreKeyMap();
369
+ getTypeCacheKeys(cache, luvio, response.body);
370
+ return cache;
371
+ });
372
+ }, (error) => {
373
+ return luvio.handleErrorResponse(() => {
374
+ const errorSnapshot = luvio.errorSnapshot(error);
375
+ luvio.storeIngestError(key, errorSnapshot, {
376
+ ttl: TTL,
377
+ namespace: keyPrefix,
378
+ version: VERSION,
379
+ representationName: RepresentationType
380
+ });
381
+ return luvio.storeBroadcast().then(() => errorSnapshot);
382
+ });
383
+ });
384
+ }
385
+ });
386
+ };
387
+ };
388
+
389
+ let getExplorerView;
390
+ let getExplorerViewNotifyChange;
391
+ // Imperative GET Adapters
392
+ let getExplorerView_imperative;
393
+ // Adapter Metadata
394
+ const getExplorerViewMetadata = { apiFamily: 'applications', name: 'getExplorerView', ttl: 100000 };
395
+ // Notify Update Available
396
+ function bindExportsTo(luvio) {
397
+ // LDS Adapters
398
+ const getExplorerView_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getExplorerView', getExplorerViewAdapterFactory), getExplorerViewMetadata);
399
+ return {
400
+ getExplorerView: createWireAdapterConstructor(luvio, getExplorerView_ldsAdapter, getExplorerViewMetadata),
401
+ getExplorerViewNotifyChange: createLDSAdapter(luvio, 'getExplorerViewNotifyChange', notifyChangeFactory),
402
+ // Imperative GET Adapters
403
+ getExplorerView_imperative: createImperativeAdapter(luvio, getExplorerView_ldsAdapter, getExplorerViewMetadata),
404
+ // Notify Update Availables
405
+ };
406
+ }
407
+ withDefaultLuvio((luvio) => {
408
+ ({ getExplorerView, getExplorerViewNotifyChange, getExplorerView_imperative } =
409
+ bindExportsTo(luvio));
410
+ });
411
+
412
+ export { getExplorerView, getExplorerViewNotifyChange, getExplorerView_imperative };
413
+ // version: 1.340.0-08235a5e1b
@@ -0,0 +1,74 @@
1
+ #%RAML 1.0
2
+ securedBy:
3
+ - OAuth2
4
+ title: Salesforce Connect API
5
+ version: '63.0'
6
+ mediaType: application/json
7
+ protocols:
8
+ - https
9
+ baseUri: /services/data/v64.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
+ ExplorerViewItem:
29
+ description: Representation for the each tree item inside Explorer View
30
+ type: object
31
+ properties:
32
+ builderUrl:
33
+ description: Returns the builder url of the explorer view item
34
+ type: string
35
+ children:
36
+ description: Returns the list of children associated with that explorer view
37
+ item
38
+ type: array
39
+ items:
40
+ type: ExplorerViewItem
41
+ label:
42
+ description: Returns the label of the explorer view item
43
+ type: string
44
+ name:
45
+ description: Returns the name of the explorer view item
46
+ type: string
47
+ showAiGeneratedIcon:
48
+ description: Returns explorer view item true if explorer view item is AI generated
49
+ type: boolean
50
+ ExplorerViewRepresentation:
51
+ description: Representation for the tree like Explorer View structure
52
+ type: object
53
+ properties:
54
+ explorerViewItem:
55
+ description: Returns the root node of explorer view
56
+ type: ExplorerViewItem
57
+ metadataId:
58
+ description: Returns the metadata id for which explorer view is shown
59
+ type: string
60
+
61
+ /connect/explorer-view/{metadataId}:
62
+ get:
63
+ displayName: getExplorerView
64
+ description: Get Explorer view items for a given agent id
65
+ responses:
66
+ '200':
67
+ description: Success
68
+ body:
69
+ application/json:
70
+ type: ExplorerViewRepresentation
71
+ uriParameters:
72
+ metadataId:
73
+ type: string
74
+ required: true
@@ -0,0 +1,21 @@
1
+ #%RAML 1.0 Overlay
2
+ extends: ./api.raml
3
+
4
+ uses:
5
+ luvio: luvio://annotations.raml
6
+
7
+ (luvio.keyPrefix): 'applications'
8
+
9
+ types:
10
+ ExplorerViewRepresentation:
11
+ (luvio.ttl): 100000
12
+ (luvio.opaque): true
13
+ (luvio.key):
14
+ metadataId: metadataId
15
+
16
+ /connect/explorer-view/{metadataId}:
17
+ get:
18
+ (luvio.adapter):
19
+ name: getExplorerView
20
+ (luvio.key):
21
+ metadataId: urlParams.metadataId