@salesforce/lds-adapters-industries-mfgprogram 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/LICENSE.txt +82 -0
- package/dist/es/es2018/industries-mfgprogram.js +537 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/getManufacturingProgramTemplateDetails.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/getManufacturingProgramTemplatesList.d.ts +26 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +5 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectEntityMfgProgramTemplates.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectEntityMfgProgramTemplatesById.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/types/MfgProgramTemplateRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/MfgProgramTemplatesListRepresentation.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +67 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +587 -0
- package/src/raml/api.raml +76 -0
- package/src/raml/luvio.raml +28 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,587 @@
|
|
|
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$2, 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 = 'MfgProgram';
|
|
83
|
+
|
|
84
|
+
const { isArray: ArrayIsArray } = Array;
|
|
85
|
+
function equalsArray(a, b, equalsItem) {
|
|
86
|
+
const aLength = a.length;
|
|
87
|
+
const bLength = b.length;
|
|
88
|
+
if (aLength !== bLength) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
for (let i = 0; i < aLength; i++) {
|
|
92
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
function createLink(ref) {
|
|
99
|
+
return {
|
|
100
|
+
__ref: serializeStructuredKey(ref),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const TTL$1 = 500;
|
|
105
|
+
const VERSION$1 = "901d5de487f245ab2a397cb46633ee0a";
|
|
106
|
+
function validate$1(obj, path = 'MfgProgramTemplateRepresentation') {
|
|
107
|
+
const v_error = (() => {
|
|
108
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
109
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
110
|
+
}
|
|
111
|
+
const obj_description = obj.description;
|
|
112
|
+
const path_description = path + '.description';
|
|
113
|
+
if (typeof obj_description !== 'string') {
|
|
114
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
115
|
+
}
|
|
116
|
+
const obj_id = obj.id;
|
|
117
|
+
const path_id = path + '.id';
|
|
118
|
+
if (typeof obj_id !== 'string') {
|
|
119
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
120
|
+
}
|
|
121
|
+
const obj_name = obj.name;
|
|
122
|
+
const path_name = path + '.name';
|
|
123
|
+
if (typeof obj_name !== 'string') {
|
|
124
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
125
|
+
}
|
|
126
|
+
})();
|
|
127
|
+
return v_error === undefined ? null : v_error;
|
|
128
|
+
}
|
|
129
|
+
const RepresentationType$1 = 'MfgProgramTemplateRepresentation';
|
|
130
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
131
|
+
return input;
|
|
132
|
+
}
|
|
133
|
+
const select$3 = function MfgProgramTemplateRepresentationSelect() {
|
|
134
|
+
return {
|
|
135
|
+
kind: 'Fragment',
|
|
136
|
+
version: VERSION$1,
|
|
137
|
+
private: [],
|
|
138
|
+
selections: [
|
|
139
|
+
{
|
|
140
|
+
name: 'description',
|
|
141
|
+
kind: 'Scalar'
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'id',
|
|
145
|
+
kind: 'Scalar'
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'name',
|
|
149
|
+
kind: 'Scalar'
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
function equals$1(existing, incoming) {
|
|
155
|
+
const existing_description = existing.description;
|
|
156
|
+
const incoming_description = incoming.description;
|
|
157
|
+
if (!(existing_description === incoming_description)) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
const existing_id = existing.id;
|
|
161
|
+
const incoming_id = incoming.id;
|
|
162
|
+
if (!(existing_id === incoming_id)) {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
const existing_name = existing.name;
|
|
166
|
+
const incoming_name = incoming.name;
|
|
167
|
+
if (!(existing_name === incoming_name)) {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
const ingest$1 = function MfgProgramTemplateRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
173
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
174
|
+
const validateError = validate$1(input);
|
|
175
|
+
if (validateError !== null) {
|
|
176
|
+
throw validateError;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const key = path.fullPath;
|
|
180
|
+
const ttlToUse = TTL$1;
|
|
181
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "MfgProgram", VERSION$1, RepresentationType$1, equals$1);
|
|
182
|
+
return createLink(key);
|
|
183
|
+
};
|
|
184
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
185
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
186
|
+
const rootKey = fullPathFactory();
|
|
187
|
+
rootKeySet.set(rootKey, {
|
|
188
|
+
namespace: keyPrefix,
|
|
189
|
+
representationName: RepresentationType$1,
|
|
190
|
+
mergeable: false
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function select$2(luvio, params) {
|
|
195
|
+
return select$3();
|
|
196
|
+
}
|
|
197
|
+
function keyBuilder$3(luvio, params) {
|
|
198
|
+
return keyPrefix + '::MfgProgramTemplateRepresentation:(' + 'id:' + params.urlParams.id + ')';
|
|
199
|
+
}
|
|
200
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
201
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
202
|
+
}
|
|
203
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
204
|
+
const { body } = response;
|
|
205
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
206
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
207
|
+
const snapshot = luvio.storeLookup({
|
|
208
|
+
recordId: key,
|
|
209
|
+
node: select$2(),
|
|
210
|
+
variables: {},
|
|
211
|
+
}, snapshotRefresh);
|
|
212
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
213
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
214
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
deepFreeze(snapshot.data);
|
|
218
|
+
return snapshot;
|
|
219
|
+
}
|
|
220
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
221
|
+
const key = keyBuilder$3(luvio, params);
|
|
222
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
223
|
+
const storeMetadataParams = {
|
|
224
|
+
ttl: TTL$1,
|
|
225
|
+
namespace: keyPrefix,
|
|
226
|
+
version: VERSION$1,
|
|
227
|
+
representationName: RepresentationType$1
|
|
228
|
+
};
|
|
229
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
230
|
+
return errorSnapshot;
|
|
231
|
+
}
|
|
232
|
+
function createResourceRequest$1(config) {
|
|
233
|
+
const headers = {};
|
|
234
|
+
return {
|
|
235
|
+
baseUri: '/services/data/v66.0',
|
|
236
|
+
basePath: '/connect/entity/mfg-program-templates/' + config.urlParams.id + '',
|
|
237
|
+
method: 'get',
|
|
238
|
+
body: null,
|
|
239
|
+
urlParams: config.urlParams,
|
|
240
|
+
queryParams: {},
|
|
241
|
+
headers,
|
|
242
|
+
priority: 'normal',
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const adapterName$1 = 'getManufacturingProgramTemplateDetails';
|
|
247
|
+
const getManufacturingProgramTemplateDetails_ConfigPropertyMetadata = [
|
|
248
|
+
generateParamConfigMetadata('id', true, 0 /* UrlParameter */, 0 /* String */),
|
|
249
|
+
];
|
|
250
|
+
const getManufacturingProgramTemplateDetails_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getManufacturingProgramTemplateDetails_ConfigPropertyMetadata);
|
|
251
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(getManufacturingProgramTemplateDetails_ConfigPropertyMetadata);
|
|
252
|
+
function keyBuilder$2(luvio, config) {
|
|
253
|
+
const resourceParams = createResourceParams$1(config);
|
|
254
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
255
|
+
}
|
|
256
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
257
|
+
const config = {};
|
|
258
|
+
typeCheckConfig$2(untrustedConfig, config, getManufacturingProgramTemplateDetails_ConfigPropertyMetadata);
|
|
259
|
+
return config;
|
|
260
|
+
}
|
|
261
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
262
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
266
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
267
|
+
}
|
|
268
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
269
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
return config;
|
|
273
|
+
}
|
|
274
|
+
function adapterFragment$1(luvio, config) {
|
|
275
|
+
createResourceParams$1(config);
|
|
276
|
+
return select$2();
|
|
277
|
+
}
|
|
278
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
279
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
280
|
+
config,
|
|
281
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
282
|
+
});
|
|
283
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
284
|
+
}
|
|
285
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
286
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
287
|
+
config,
|
|
288
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
289
|
+
});
|
|
290
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
291
|
+
}
|
|
292
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
293
|
+
const resourceParams = createResourceParams$1(config);
|
|
294
|
+
const request = createResourceRequest$1(resourceParams);
|
|
295
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
296
|
+
.then((response) => {
|
|
297
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
298
|
+
const cache = new StoreKeyMap();
|
|
299
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
300
|
+
return cache;
|
|
301
|
+
});
|
|
302
|
+
}, (response) => {
|
|
303
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
307
|
+
return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
308
|
+
}
|
|
309
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
310
|
+
const { luvio, config } = context;
|
|
311
|
+
const selector = {
|
|
312
|
+
recordId: keyBuilder$2(luvio, config),
|
|
313
|
+
node: adapterFragment$1(luvio, config),
|
|
314
|
+
variables: {},
|
|
315
|
+
};
|
|
316
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
317
|
+
config,
|
|
318
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
319
|
+
});
|
|
320
|
+
return cacheSnapshot;
|
|
321
|
+
}
|
|
322
|
+
const getManufacturingProgramTemplateDetailsAdapterFactory = (luvio) => function MfgProgram__getManufacturingProgramTemplateDetails(untrustedConfig, requestContext) {
|
|
323
|
+
const config = validateAdapterConfig$1(untrustedConfig, getManufacturingProgramTemplateDetails_ConfigPropertyNames);
|
|
324
|
+
// Invalid or incomplete config
|
|
325
|
+
if (config === null) {
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
329
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
const TTL = 500;
|
|
333
|
+
const VERSION = "f58cbaebc107cbaac9402067399356f9";
|
|
334
|
+
function validate(obj, path = 'MfgProgramTemplatesListRepresentation') {
|
|
335
|
+
const v_error = (() => {
|
|
336
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
337
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
338
|
+
}
|
|
339
|
+
const obj_mfgProgramTemplateList = obj.mfgProgramTemplateList;
|
|
340
|
+
const path_mfgProgramTemplateList = path + '.mfgProgramTemplateList';
|
|
341
|
+
if (!ArrayIsArray(obj_mfgProgramTemplateList)) {
|
|
342
|
+
return new TypeError('Expected "array" but received "' + typeof obj_mfgProgramTemplateList + '" (at "' + path_mfgProgramTemplateList + '")');
|
|
343
|
+
}
|
|
344
|
+
for (let i = 0; i < obj_mfgProgramTemplateList.length; i++) {
|
|
345
|
+
const obj_mfgProgramTemplateList_item = obj_mfgProgramTemplateList[i];
|
|
346
|
+
const path_mfgProgramTemplateList_item = path_mfgProgramTemplateList + '[' + i + ']';
|
|
347
|
+
const referencepath_mfgProgramTemplateList_itemValidationError = validate$1(obj_mfgProgramTemplateList_item, path_mfgProgramTemplateList_item);
|
|
348
|
+
if (referencepath_mfgProgramTemplateList_itemValidationError !== null) {
|
|
349
|
+
let message = 'Object doesn\'t match MfgProgramTemplateRepresentation (at "' + path_mfgProgramTemplateList_item + '")\n';
|
|
350
|
+
message += referencepath_mfgProgramTemplateList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
351
|
+
return new TypeError(message);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
})();
|
|
355
|
+
return v_error === undefined ? null : v_error;
|
|
356
|
+
}
|
|
357
|
+
const RepresentationType = 'MfgProgramTemplatesListRepresentation';
|
|
358
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
359
|
+
return input;
|
|
360
|
+
}
|
|
361
|
+
const select$1 = function MfgProgramTemplatesListRepresentationSelect() {
|
|
362
|
+
const { selections: MfgProgramTemplateRepresentation__selections, opaque: MfgProgramTemplateRepresentation__opaque, } = select$3();
|
|
363
|
+
return {
|
|
364
|
+
kind: 'Fragment',
|
|
365
|
+
version: VERSION,
|
|
366
|
+
private: [],
|
|
367
|
+
selections: [
|
|
368
|
+
{
|
|
369
|
+
name: 'mfgProgramTemplateList',
|
|
370
|
+
kind: 'Object',
|
|
371
|
+
plural: true,
|
|
372
|
+
selections: MfgProgramTemplateRepresentation__selections
|
|
373
|
+
}
|
|
374
|
+
]
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
function equals(existing, incoming) {
|
|
378
|
+
const existing_mfgProgramTemplateList = existing.mfgProgramTemplateList;
|
|
379
|
+
const incoming_mfgProgramTemplateList = incoming.mfgProgramTemplateList;
|
|
380
|
+
const equals_mfgProgramTemplateList_items = equalsArray(existing_mfgProgramTemplateList, incoming_mfgProgramTemplateList, (existing_mfgProgramTemplateList_item, incoming_mfgProgramTemplateList_item) => {
|
|
381
|
+
if (!(equals$1(existing_mfgProgramTemplateList_item, incoming_mfgProgramTemplateList_item))) {
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
if (equals_mfgProgramTemplateList_items === false) {
|
|
386
|
+
return false;
|
|
387
|
+
}
|
|
388
|
+
return true;
|
|
389
|
+
}
|
|
390
|
+
const ingest = function MfgProgramTemplatesListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
391
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
392
|
+
const validateError = validate(input);
|
|
393
|
+
if (validateError !== null) {
|
|
394
|
+
throw validateError;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
const key = path.fullPath;
|
|
398
|
+
const ttlToUse = TTL;
|
|
399
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "MfgProgram", VERSION, RepresentationType, equals);
|
|
400
|
+
return createLink(key);
|
|
401
|
+
};
|
|
402
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
403
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
404
|
+
const rootKey = fullPathFactory();
|
|
405
|
+
rootKeySet.set(rootKey, {
|
|
406
|
+
namespace: keyPrefix,
|
|
407
|
+
representationName: RepresentationType,
|
|
408
|
+
mergeable: false
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
function select(luvio, params) {
|
|
413
|
+
return select$1();
|
|
414
|
+
}
|
|
415
|
+
function keyBuilder$1(luvio, params) {
|
|
416
|
+
return keyPrefix + '::MfgProgramTemplatesListRepresentation:(' + ')';
|
|
417
|
+
}
|
|
418
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
419
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1());
|
|
420
|
+
}
|
|
421
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
422
|
+
const { body } = response;
|
|
423
|
+
const key = keyBuilder$1();
|
|
424
|
+
luvio.storeIngest(key, ingest, body);
|
|
425
|
+
const snapshot = luvio.storeLookup({
|
|
426
|
+
recordId: key,
|
|
427
|
+
node: select(),
|
|
428
|
+
variables: {},
|
|
429
|
+
}, snapshotRefresh);
|
|
430
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
431
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
432
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
deepFreeze(snapshot.data);
|
|
436
|
+
return snapshot;
|
|
437
|
+
}
|
|
438
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
439
|
+
const key = keyBuilder$1();
|
|
440
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
441
|
+
const storeMetadataParams = {
|
|
442
|
+
ttl: TTL,
|
|
443
|
+
namespace: keyPrefix,
|
|
444
|
+
version: VERSION,
|
|
445
|
+
representationName: RepresentationType
|
|
446
|
+
};
|
|
447
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
448
|
+
return errorSnapshot;
|
|
449
|
+
}
|
|
450
|
+
function createResourceRequest(config) {
|
|
451
|
+
const headers = {};
|
|
452
|
+
return {
|
|
453
|
+
baseUri: '/services/data/v66.0',
|
|
454
|
+
basePath: '/connect/entity/mfg-program-templates',
|
|
455
|
+
method: 'get',
|
|
456
|
+
body: null,
|
|
457
|
+
urlParams: {},
|
|
458
|
+
queryParams: {},
|
|
459
|
+
headers,
|
|
460
|
+
priority: 'normal',
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
const adapterName = 'getManufacturingProgramTemplatesList';
|
|
465
|
+
const getManufacturingProgramTemplatesList_ConfigPropertyMetadata = [];
|
|
466
|
+
const getManufacturingProgramTemplatesList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getManufacturingProgramTemplatesList_ConfigPropertyMetadata);
|
|
467
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$2(getManufacturingProgramTemplatesList_ConfigPropertyMetadata);
|
|
468
|
+
function keyBuilder(luvio, config) {
|
|
469
|
+
createResourceParams(config);
|
|
470
|
+
return keyBuilder$1();
|
|
471
|
+
}
|
|
472
|
+
function typeCheckConfig(untrustedConfig) {
|
|
473
|
+
const config = {};
|
|
474
|
+
return config;
|
|
475
|
+
}
|
|
476
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
477
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
478
|
+
return null;
|
|
479
|
+
}
|
|
480
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
481
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
482
|
+
}
|
|
483
|
+
const config = typeCheckConfig();
|
|
484
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
485
|
+
return null;
|
|
486
|
+
}
|
|
487
|
+
return config;
|
|
488
|
+
}
|
|
489
|
+
function adapterFragment(luvio, config) {
|
|
490
|
+
createResourceParams(config);
|
|
491
|
+
return select();
|
|
492
|
+
}
|
|
493
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
494
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
495
|
+
config,
|
|
496
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
497
|
+
});
|
|
498
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
499
|
+
}
|
|
500
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
501
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
502
|
+
config,
|
|
503
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
504
|
+
});
|
|
505
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
506
|
+
}
|
|
507
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
508
|
+
const resourceParams = createResourceParams(config);
|
|
509
|
+
const request = createResourceRequest();
|
|
510
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
511
|
+
.then((response) => {
|
|
512
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
513
|
+
const cache = new StoreKeyMap();
|
|
514
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
515
|
+
return cache;
|
|
516
|
+
});
|
|
517
|
+
}, (response) => {
|
|
518
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
522
|
+
return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
523
|
+
}
|
|
524
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
525
|
+
const { luvio, config } = context;
|
|
526
|
+
const selector = {
|
|
527
|
+
recordId: keyBuilder(luvio, config),
|
|
528
|
+
node: adapterFragment(luvio, config),
|
|
529
|
+
variables: {},
|
|
530
|
+
};
|
|
531
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
532
|
+
config,
|
|
533
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
534
|
+
});
|
|
535
|
+
return cacheSnapshot;
|
|
536
|
+
}
|
|
537
|
+
const getManufacturingProgramTemplatesListAdapterFactory = (luvio) => function MfgProgram__getManufacturingProgramTemplatesList(untrustedConfig, requestContext) {
|
|
538
|
+
const config = validateAdapterConfig(untrustedConfig, getManufacturingProgramTemplatesList_ConfigPropertyNames);
|
|
539
|
+
// Invalid or incomplete config
|
|
540
|
+
if (config === null) {
|
|
541
|
+
return null;
|
|
542
|
+
}
|
|
543
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
544
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
let getManufacturingProgramTemplateDetails;
|
|
548
|
+
let getManufacturingProgramTemplatesList;
|
|
549
|
+
// Imperative GET Adapters
|
|
550
|
+
let getManufacturingProgramTemplateDetails_imperative;
|
|
551
|
+
let getManufacturingProgramTemplatesList_imperative;
|
|
552
|
+
// Adapter Metadata
|
|
553
|
+
const getManufacturingProgramTemplateDetailsMetadata = {
|
|
554
|
+
apiFamily: 'MfgProgram',
|
|
555
|
+
name: 'getManufacturingProgramTemplateDetails',
|
|
556
|
+
ttl: 500,
|
|
557
|
+
};
|
|
558
|
+
const getManufacturingProgramTemplatesListMetadata = {
|
|
559
|
+
apiFamily: 'MfgProgram',
|
|
560
|
+
name: 'getManufacturingProgramTemplatesList',
|
|
561
|
+
ttl: 500,
|
|
562
|
+
};
|
|
563
|
+
// Notify Update Available
|
|
564
|
+
function bindExportsTo(luvio) {
|
|
565
|
+
// LDS Adapters
|
|
566
|
+
const getManufacturingProgramTemplateDetails_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getManufacturingProgramTemplateDetails', getManufacturingProgramTemplateDetailsAdapterFactory), getManufacturingProgramTemplateDetailsMetadata);
|
|
567
|
+
const getManufacturingProgramTemplatesList_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getManufacturingProgramTemplatesList', getManufacturingProgramTemplatesListAdapterFactory), getManufacturingProgramTemplatesListMetadata);
|
|
568
|
+
return {
|
|
569
|
+
getManufacturingProgramTemplateDetails: createWireAdapterConstructor(luvio, getManufacturingProgramTemplateDetails_ldsAdapter, getManufacturingProgramTemplateDetailsMetadata),
|
|
570
|
+
getManufacturingProgramTemplatesList: createWireAdapterConstructor(luvio, getManufacturingProgramTemplatesList_ldsAdapter, getManufacturingProgramTemplatesListMetadata),
|
|
571
|
+
// Imperative GET Adapters
|
|
572
|
+
getManufacturingProgramTemplateDetails_imperative: createImperativeAdapter(luvio, getManufacturingProgramTemplateDetails_ldsAdapter, getManufacturingProgramTemplateDetailsMetadata),
|
|
573
|
+
getManufacturingProgramTemplatesList_imperative: createImperativeAdapter(luvio, getManufacturingProgramTemplatesList_ldsAdapter, getManufacturingProgramTemplatesListMetadata),
|
|
574
|
+
// Notify Update Availables
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
withDefaultLuvio((luvio) => {
|
|
578
|
+
({
|
|
579
|
+
getManufacturingProgramTemplateDetails,
|
|
580
|
+
getManufacturingProgramTemplatesList,
|
|
581
|
+
getManufacturingProgramTemplateDetails_imperative,
|
|
582
|
+
getManufacturingProgramTemplatesList_imperative,
|
|
583
|
+
} = bindExportsTo(luvio));
|
|
584
|
+
});
|
|
585
|
+
|
|
586
|
+
export { getManufacturingProgramTemplateDetails, getManufacturingProgramTemplateDetails_imperative, getManufacturingProgramTemplatesList, getManufacturingProgramTemplatesList_imperative };
|
|
587
|
+
// version: 0.1.0-dev1-c978a7b010
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#%RAML 1.0
|
|
2
|
+
securedBy:
|
|
3
|
+
- OAuth2
|
|
4
|
+
title: Salesforce Connect API
|
|
5
|
+
version: '61.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
|
+
MfgProgramTemplateRepresentation:
|
|
29
|
+
description: The details of a manufacturing program template.
|
|
30
|
+
type: object
|
|
31
|
+
properties:
|
|
32
|
+
description:
|
|
33
|
+
description: The description of the manufacturing program template.
|
|
34
|
+
type: string
|
|
35
|
+
id:
|
|
36
|
+
description: The ID of the manufacturing program template.
|
|
37
|
+
type: string
|
|
38
|
+
name:
|
|
39
|
+
description: The name of the manufacturing program template.
|
|
40
|
+
type: string
|
|
41
|
+
MfgProgramTemplatesListRepresentation:
|
|
42
|
+
description: A list of the manufacturing program templates.
|
|
43
|
+
type: object
|
|
44
|
+
properties:
|
|
45
|
+
mfgProgramTemplateList:
|
|
46
|
+
description: A list of the manufacturing program templates.
|
|
47
|
+
type: array
|
|
48
|
+
items:
|
|
49
|
+
type: MfgProgramTemplateRepresentation
|
|
50
|
+
/connect:
|
|
51
|
+
/entity/mfg-program-templates:
|
|
52
|
+
get:
|
|
53
|
+
displayName: getMfgProgramTemplatesList
|
|
54
|
+
description: Fetches the list of all manufacturing program templates with the
|
|
55
|
+
status as Active.
|
|
56
|
+
responses:
|
|
57
|
+
'200':
|
|
58
|
+
description: Success
|
|
59
|
+
body:
|
|
60
|
+
application/json:
|
|
61
|
+
type: MfgProgramTemplatesListRepresentation
|
|
62
|
+
/entity/mfg-program-templates/{id}:
|
|
63
|
+
get:
|
|
64
|
+
displayName: getMfgProgramTemplate
|
|
65
|
+
description: Fetches the details of a manufacturing program template.
|
|
66
|
+
responses:
|
|
67
|
+
'200':
|
|
68
|
+
description: Success
|
|
69
|
+
body:
|
|
70
|
+
application/json:
|
|
71
|
+
type: MfgProgramTemplateRepresentation
|
|
72
|
+
uriParameters:
|
|
73
|
+
id:
|
|
74
|
+
description: The ID of the manufacturing program template.
|
|
75
|
+
type: string
|
|
76
|
+
required: true
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#%RAML 1.0 Overlay
|
|
2
|
+
extends: ./api.raml
|
|
3
|
+
|
|
4
|
+
uses:
|
|
5
|
+
luvio: luvio://annotations.raml
|
|
6
|
+
|
|
7
|
+
(luvio.keyPrefix): 'MfgProgram'
|
|
8
|
+
(luvio.ttl): 360000
|
|
9
|
+
|
|
10
|
+
types:
|
|
11
|
+
MfgProgramTemplateRepresentation:
|
|
12
|
+
(luvio.ttl): 500
|
|
13
|
+
MfgProgramTemplatesListRepresentation:
|
|
14
|
+
(luvio.ttl): 500
|
|
15
|
+
|
|
16
|
+
/connect:
|
|
17
|
+
/entity/mfg-program-templates/{id}:
|
|
18
|
+
get:
|
|
19
|
+
(luvio.adapter):
|
|
20
|
+
name: getManufacturingProgramTemplateDetails
|
|
21
|
+
uriParameters:
|
|
22
|
+
id:
|
|
23
|
+
type: string
|
|
24
|
+
required: true
|
|
25
|
+
/entity/mfg-program-templates:
|
|
26
|
+
get:
|
|
27
|
+
(luvio.adapter):
|
|
28
|
+
name: getManufacturingProgramTemplatesList
|