@salesforce/lds-adapters-platform-admin-success-guidance 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/platform-admin-success-guidance.js +3843 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/evaluateStep.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/adapters/getAssistant.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getAssistantInfoList.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getAssistantList.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getAssistantTarget.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getQuestionnaire.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getQuestionnaires.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/initialize.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/adapters/saveAssistant.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/adapters/saveAssistantList.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/adapters/saveQuestionnaire.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +11 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +24 -0
- package/dist/es/es2018/types/src/generated/resources/getAssistantPlatformByAssistantName.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getAssistantPlatformInfoByAssistantTarget.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getAssistantPlatformListByAssistantTarget.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getAssistantPlatformListInfoByAssistantTarget.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getAssistantPlatformQuestionnaireByQuestionnaireName.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getAssistantPlatformQuestionnairesByAssistantName.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/patchAssistantPlatformByAssistantName.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/patchAssistantPlatformListByAssistantTarget.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/patchAssistantPlatformQuestionnaireByQuestionnaireName.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/patchAssistantPlatformStepByStepName.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/resources/putAssistantPlatformInitializeByAssistantTarget.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/types/AbstractLightningAssistantActionRepresentation.d.ts +39 -0
- package/dist/es/es2018/types/src/generated/types/AssistantData.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantAnswerDataInputRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantCategoryRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantChoiceRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantCustomActionRepresentation.d.ts +40 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantInfoListRepresentation.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantInfoRepresentation.d.ts +55 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantInitializationRepresentation.d.ts +43 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantInputRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantItemInputRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantLayoutNodeRepresentation.d.ts +56 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantLinkActionRepresentation.d.ts +36 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantLinkRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantListInputRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantListRepresentation.d.ts +50 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantLsfActionRepresentation.d.ts +43 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantNoActionRepresentation.d.ts +26 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantQuestionRepresentation.d.ts +42 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantQuestionnaireInputRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantQuestionnaireListRepresentation.d.ts +40 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantQuestionnaireRepresentation.d.ts +53 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantRepresentation.d.ts +98 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantStepRepresentation.d.ts +75 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantTargetRepresentation.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantTrailheadActionRepresentation.d.ts +36 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantUpdateInputRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantVideoActionRepresentation.d.ts +33 -0
- package/dist/es/es2018/types/src/generated/types/LightningAssistantWalkthroughActionRepresentation.d.ts +33 -0
- package/dist/es/es2018/types/src/generated/types/QuestionnaireData.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/UpdateAssistantData.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +77 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +4169 -0
- package/src/raml/api.raml +736 -0
- package/src/raml/luvio.raml +98 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,4169 @@
|
|
|
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, createResourceParams as createResourceParams$b, typeCheckConfig as typeCheckConfig$b, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$6 } from 'force/luvioEngine';
|
|
18
|
+
|
|
19
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
|
+
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = 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$1(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 = 'LEAP';
|
|
83
|
+
|
|
84
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
85
|
+
const { isArray: ArrayIsArray } = Array;
|
|
86
|
+
const { stringify: JSONStringify } = JSON;
|
|
87
|
+
function equalsArray(a, b, equalsItem) {
|
|
88
|
+
const aLength = a.length;
|
|
89
|
+
const bLength = b.length;
|
|
90
|
+
if (aLength !== bLength) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
for (let i = 0; i < aLength; i++) {
|
|
94
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
function createLink(ref) {
|
|
101
|
+
return {
|
|
102
|
+
__ref: serializeStructuredKey(ref),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const VERSION$l = "a9a46e0cf983e314934e0703d28f75bf";
|
|
107
|
+
const select$w = function LightningAssistantLinkActionRepresentationSelect() {
|
|
108
|
+
const { selections: AbstractLightningAssistantActionRepresentationSelections } = select$p();
|
|
109
|
+
return {
|
|
110
|
+
kind: 'Fragment',
|
|
111
|
+
version: VERSION$l,
|
|
112
|
+
private: [],
|
|
113
|
+
selections: [
|
|
114
|
+
...AbstractLightningAssistantActionRepresentationSelections,
|
|
115
|
+
{
|
|
116
|
+
name: 'iconName',
|
|
117
|
+
kind: 'Scalar',
|
|
118
|
+
required: false
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'label',
|
|
122
|
+
kind: 'Scalar',
|
|
123
|
+
required: false
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'url',
|
|
127
|
+
kind: 'Scalar'
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const VERSION$k = "c2fb7ece6f9eba9ca7b25608a670310a";
|
|
134
|
+
const select$v = function LightningAssistantCustomActionRepresentationSelect() {
|
|
135
|
+
const { selections: AbstractLightningAssistantActionRepresentationSelections } = select$p();
|
|
136
|
+
return {
|
|
137
|
+
kind: 'Fragment',
|
|
138
|
+
version: VERSION$k,
|
|
139
|
+
private: [],
|
|
140
|
+
selections: [
|
|
141
|
+
...AbstractLightningAssistantActionRepresentationSelections,
|
|
142
|
+
{
|
|
143
|
+
name: 'actionComponent',
|
|
144
|
+
kind: 'Scalar'
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: 'customData',
|
|
148
|
+
kind: 'Scalar',
|
|
149
|
+
map: true
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'iconName',
|
|
153
|
+
kind: 'Scalar',
|
|
154
|
+
required: false
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const VERSION$j = "376fdaae939e8f46021d153816e03c56";
|
|
161
|
+
const select$u = function LightningAssistantNoActionRepresentationSelect() {
|
|
162
|
+
const { selections: AbstractLightningAssistantActionRepresentationSelections } = select$p();
|
|
163
|
+
return {
|
|
164
|
+
kind: 'Fragment',
|
|
165
|
+
version: VERSION$j,
|
|
166
|
+
private: [],
|
|
167
|
+
selections: [
|
|
168
|
+
...AbstractLightningAssistantActionRepresentationSelections,
|
|
169
|
+
]
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const VERSION$i = "2e0cc24f5c0ab2bbf7b6dade0eecb17e";
|
|
174
|
+
const select$t = function LightningAssistantLsfActionRepresentationSelect() {
|
|
175
|
+
const { selections: AbstractLightningAssistantActionRepresentationSelections } = select$p();
|
|
176
|
+
return {
|
|
177
|
+
kind: 'Fragment',
|
|
178
|
+
version: VERSION$i,
|
|
179
|
+
private: [],
|
|
180
|
+
selections: [
|
|
181
|
+
...AbstractLightningAssistantActionRepresentationSelections,
|
|
182
|
+
{
|
|
183
|
+
name: 'customData',
|
|
184
|
+
kind: 'Scalar',
|
|
185
|
+
map: true,
|
|
186
|
+
required: false
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'iconName',
|
|
190
|
+
kind: 'Scalar',
|
|
191
|
+
required: false
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: 'label',
|
|
195
|
+
kind: 'Scalar',
|
|
196
|
+
required: false
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: 'lsf',
|
|
200
|
+
kind: 'Scalar'
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
const VERSION$h = "d7605ace66fce89a8ae0436b797d125d";
|
|
207
|
+
const select$s = function LightningAssistantVideoActionRepresentationSelect() {
|
|
208
|
+
const { selections: AbstractLightningAssistantActionRepresentationSelections } = select$p();
|
|
209
|
+
return {
|
|
210
|
+
kind: 'Fragment',
|
|
211
|
+
version: VERSION$h,
|
|
212
|
+
private: [],
|
|
213
|
+
selections: [
|
|
214
|
+
...AbstractLightningAssistantActionRepresentationSelections,
|
|
215
|
+
{
|
|
216
|
+
name: 'iconName',
|
|
217
|
+
kind: 'Scalar',
|
|
218
|
+
required: false
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: 'url',
|
|
222
|
+
kind: 'Scalar'
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
const VERSION$g = "fe9b2afa38e1fc9af6abd29c7fd3e307";
|
|
229
|
+
const select$r = function LightningAssistantWalkthroughActionRepresentationSelect() {
|
|
230
|
+
const { selections: AbstractLightningAssistantActionRepresentationSelections } = select$p();
|
|
231
|
+
return {
|
|
232
|
+
kind: 'Fragment',
|
|
233
|
+
version: VERSION$g,
|
|
234
|
+
private: [],
|
|
235
|
+
selections: [
|
|
236
|
+
...AbstractLightningAssistantActionRepresentationSelections,
|
|
237
|
+
{
|
|
238
|
+
name: 'iconName',
|
|
239
|
+
kind: 'Scalar',
|
|
240
|
+
required: false
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: 'promptId',
|
|
244
|
+
kind: 'Scalar'
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
const VERSION$f = "2abd7cd970bb200649e8944e43b72de5";
|
|
251
|
+
const select$q = function LightningAssistantTrailheadActionRepresentationSelect() {
|
|
252
|
+
const { selections: AbstractLightningAssistantActionRepresentationSelections } = select$p();
|
|
253
|
+
return {
|
|
254
|
+
kind: 'Fragment',
|
|
255
|
+
version: VERSION$f,
|
|
256
|
+
private: [],
|
|
257
|
+
selections: [
|
|
258
|
+
...AbstractLightningAssistantActionRepresentationSelections,
|
|
259
|
+
{
|
|
260
|
+
name: 'iconName',
|
|
261
|
+
kind: 'Scalar',
|
|
262
|
+
required: false
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
name: 'moduleId',
|
|
266
|
+
kind: 'Scalar'
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: 'url',
|
|
270
|
+
kind: 'Scalar'
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
var DiscriminatorValues;
|
|
277
|
+
(function (DiscriminatorValues) {
|
|
278
|
+
DiscriminatorValues["Link"] = "Link";
|
|
279
|
+
DiscriminatorValues["Custom"] = "Custom";
|
|
280
|
+
DiscriminatorValues["NoAction"] = "NoAction";
|
|
281
|
+
DiscriminatorValues["Lsf"] = "Lsf";
|
|
282
|
+
DiscriminatorValues["Video"] = "Video";
|
|
283
|
+
DiscriminatorValues["Walkthrough"] = "Walkthrough";
|
|
284
|
+
DiscriminatorValues["TlxModule"] = "TlxModule";
|
|
285
|
+
})(DiscriminatorValues || (DiscriminatorValues = {}));
|
|
286
|
+
const VERSION$e = "ee8eb1dcdc27527e958bea3bc608ab0c";
|
|
287
|
+
function validate$h(obj, path = 'AbstractLightningAssistantActionRepresentation') {
|
|
288
|
+
const v_error = (() => {
|
|
289
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
290
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
291
|
+
}
|
|
292
|
+
const obj_actionType = obj.actionType;
|
|
293
|
+
const path_actionType = path + '.actionType';
|
|
294
|
+
if (typeof obj_actionType !== 'string') {
|
|
295
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionType + '" (at "' + path_actionType + '")');
|
|
296
|
+
}
|
|
297
|
+
})();
|
|
298
|
+
return v_error === undefined ? null : v_error;
|
|
299
|
+
}
|
|
300
|
+
const selectChildren = function AbstractLightningAssistantActionRepresentationSelectChildren() {
|
|
301
|
+
const lightningAssistantLinkActionRepresentationSelections = select$w();
|
|
302
|
+
const lightningAssistantCustomActionRepresentationSelections = select$v();
|
|
303
|
+
const lightningAssistantNoActionRepresentationSelections = select$u();
|
|
304
|
+
const lightningAssistantLsfActionRepresentationSelections = select$t();
|
|
305
|
+
const lightningAssistantVideoActionRepresentationSelections = select$s();
|
|
306
|
+
const lightningAssistantWalkthroughActionRepresentationSelections = select$r();
|
|
307
|
+
const lightningAssistantTrailheadActionRepresentationSelections = select$q();
|
|
308
|
+
return {
|
|
309
|
+
kind: 'Fragment',
|
|
310
|
+
union: true,
|
|
311
|
+
discriminator: 'actionType',
|
|
312
|
+
unionSelections: {
|
|
313
|
+
[DiscriminatorValues.Link]: lightningAssistantLinkActionRepresentationSelections,
|
|
314
|
+
[DiscriminatorValues.Custom]: lightningAssistantCustomActionRepresentationSelections,
|
|
315
|
+
[DiscriminatorValues.NoAction]: lightningAssistantNoActionRepresentationSelections,
|
|
316
|
+
[DiscriminatorValues.Lsf]: lightningAssistantLsfActionRepresentationSelections,
|
|
317
|
+
[DiscriminatorValues.Video]: lightningAssistantVideoActionRepresentationSelections,
|
|
318
|
+
[DiscriminatorValues.Walkthrough]: lightningAssistantWalkthroughActionRepresentationSelections,
|
|
319
|
+
[DiscriminatorValues.TlxModule]: lightningAssistantTrailheadActionRepresentationSelections
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
const select$p = function AbstractLightningAssistantActionRepresentationSelect() {
|
|
324
|
+
return {
|
|
325
|
+
kind: 'Fragment',
|
|
326
|
+
version: VERSION$e,
|
|
327
|
+
private: [],
|
|
328
|
+
selections: [
|
|
329
|
+
{
|
|
330
|
+
name: 'actionType',
|
|
331
|
+
kind: 'Scalar'
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
function equals$e(existing, incoming) {
|
|
337
|
+
const existing_actionType = existing.actionType;
|
|
338
|
+
const incoming_actionType = incoming.actionType;
|
|
339
|
+
if (!(existing_actionType === incoming_actionType)) {
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
return true;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const VERSION$d = "28b96e40cf73e94d0650007d61c3214a";
|
|
346
|
+
function validate$g(obj, path = 'LightningAssistantStepRepresentation') {
|
|
347
|
+
const v_error = (() => {
|
|
348
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
349
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
350
|
+
}
|
|
351
|
+
const obj_action = obj.action;
|
|
352
|
+
const path_action = path + '.action';
|
|
353
|
+
const referencepath_actionValidationError = validate$h(obj_action, path_action);
|
|
354
|
+
if (referencepath_actionValidationError !== null) {
|
|
355
|
+
let message = 'Object doesn\'t match AbstractLightningAssistantActionRepresentation (at "' + path_action + '")\n';
|
|
356
|
+
message += referencepath_actionValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
357
|
+
return new TypeError(message);
|
|
358
|
+
}
|
|
359
|
+
if (obj.description !== undefined) {
|
|
360
|
+
const obj_description = obj.description;
|
|
361
|
+
const path_description = path + '.description';
|
|
362
|
+
if (typeof obj_description !== 'string') {
|
|
363
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
if (obj.figureComponent !== undefined) {
|
|
367
|
+
const obj_figureComponent = obj.figureComponent;
|
|
368
|
+
const path_figureComponent = path + '.figureComponent';
|
|
369
|
+
if (typeof obj_figureComponent !== 'string') {
|
|
370
|
+
return new TypeError('Expected "string" but received "' + typeof obj_figureComponent + '" (at "' + path_figureComponent + '")');
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
if (obj.firstSeenTime !== undefined) {
|
|
374
|
+
const obj_firstSeenTime = obj.firstSeenTime;
|
|
375
|
+
const path_firstSeenTime = path + '.firstSeenTime';
|
|
376
|
+
if (typeof obj_firstSeenTime !== 'string') {
|
|
377
|
+
return new TypeError('Expected "string" but received "' + typeof obj_firstSeenTime + '" (at "' + path_firstSeenTime + '")');
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
const obj_id = obj.id;
|
|
381
|
+
const path_id = path + '.id';
|
|
382
|
+
if (typeof obj_id !== 'string') {
|
|
383
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
384
|
+
}
|
|
385
|
+
const obj_isManaged = obj.isManaged;
|
|
386
|
+
const path_isManaged = path + '.isManaged';
|
|
387
|
+
if (typeof obj_isManaged !== 'boolean') {
|
|
388
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isManaged + '" (at "' + path_isManaged + '")');
|
|
389
|
+
}
|
|
390
|
+
const obj_status = obj.status;
|
|
391
|
+
const path_status = path + '.status';
|
|
392
|
+
if (typeof obj_status !== 'string') {
|
|
393
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
394
|
+
}
|
|
395
|
+
if (obj.stepComponent !== undefined) {
|
|
396
|
+
const obj_stepComponent = obj.stepComponent;
|
|
397
|
+
const path_stepComponent = path + '.stepComponent';
|
|
398
|
+
if (typeof obj_stepComponent !== 'string') {
|
|
399
|
+
return new TypeError('Expected "string" but received "' + typeof obj_stepComponent + '" (at "' + path_stepComponent + '")');
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
const obj_tags = obj.tags;
|
|
403
|
+
const path_tags = path + '.tags';
|
|
404
|
+
if (!ArrayIsArray(obj_tags)) {
|
|
405
|
+
return new TypeError('Expected "array" but received "' + typeof obj_tags + '" (at "' + path_tags + '")');
|
|
406
|
+
}
|
|
407
|
+
for (let i = 0; i < obj_tags.length; i++) {
|
|
408
|
+
const obj_tags_item = obj_tags[i];
|
|
409
|
+
const path_tags_item = path_tags + '[' + i + ']';
|
|
410
|
+
if (typeof obj_tags_item !== 'string') {
|
|
411
|
+
return new TypeError('Expected "string" but received "' + typeof obj_tags_item + '" (at "' + path_tags_item + '")');
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
const obj_title = obj.title;
|
|
415
|
+
const path_title = path + '.title';
|
|
416
|
+
if (typeof obj_title !== 'string') {
|
|
417
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
418
|
+
}
|
|
419
|
+
const obj_updateStrategy = obj.updateStrategy;
|
|
420
|
+
const path_updateStrategy = path + '.updateStrategy';
|
|
421
|
+
if (typeof obj_updateStrategy !== 'string') {
|
|
422
|
+
return new TypeError('Expected "string" but received "' + typeof obj_updateStrategy + '" (at "' + path_updateStrategy + '")');
|
|
423
|
+
}
|
|
424
|
+
})();
|
|
425
|
+
return v_error === undefined ? null : v_error;
|
|
426
|
+
}
|
|
427
|
+
const RepresentationType$8 = 'LightningAssistantStepRepresentation';
|
|
428
|
+
function keyBuilder$j(luvio, config) {
|
|
429
|
+
return keyPrefix + '::' + RepresentationType$8 + ':' + config.step_id;
|
|
430
|
+
}
|
|
431
|
+
function keyBuilderFromType$7(luvio, object) {
|
|
432
|
+
const keyParams = {
|
|
433
|
+
step_id: object.id
|
|
434
|
+
};
|
|
435
|
+
return keyBuilder$j(luvio, keyParams);
|
|
436
|
+
}
|
|
437
|
+
function normalize$8(input, existing, path, luvio, store, timestamp) {
|
|
438
|
+
return input;
|
|
439
|
+
}
|
|
440
|
+
const select$o = function LightningAssistantStepRepresentationSelect() {
|
|
441
|
+
const AbstractLightningAssistantActionRepresentation__unionSelections = selectChildren();
|
|
442
|
+
return {
|
|
443
|
+
kind: 'Fragment',
|
|
444
|
+
version: VERSION$d,
|
|
445
|
+
private: [],
|
|
446
|
+
selections: [
|
|
447
|
+
{
|
|
448
|
+
kind: 'Object',
|
|
449
|
+
name: 'action',
|
|
450
|
+
discriminator: AbstractLightningAssistantActionRepresentation__unionSelections.discriminator,
|
|
451
|
+
union: true,
|
|
452
|
+
nullable: false,
|
|
453
|
+
unionSelections: AbstractLightningAssistantActionRepresentation__unionSelections.unionSelections
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
name: 'description',
|
|
457
|
+
kind: 'Scalar',
|
|
458
|
+
required: false
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
name: 'figureComponent',
|
|
462
|
+
kind: 'Scalar',
|
|
463
|
+
required: false
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
name: 'firstSeenTime',
|
|
467
|
+
kind: 'Scalar',
|
|
468
|
+
required: false
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
name: 'id',
|
|
472
|
+
kind: 'Scalar'
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
name: 'isManaged',
|
|
476
|
+
kind: 'Scalar'
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
name: 'status',
|
|
480
|
+
kind: 'Scalar'
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
name: 'stepComponent',
|
|
484
|
+
kind: 'Scalar',
|
|
485
|
+
required: false
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
name: 'tags',
|
|
489
|
+
kind: 'Scalar',
|
|
490
|
+
plural: true
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
name: 'title',
|
|
494
|
+
kind: 'Scalar'
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
name: 'updateStrategy',
|
|
498
|
+
kind: 'Scalar'
|
|
499
|
+
}
|
|
500
|
+
]
|
|
501
|
+
};
|
|
502
|
+
};
|
|
503
|
+
function equals$d(existing, incoming) {
|
|
504
|
+
const existing_isManaged = existing.isManaged;
|
|
505
|
+
const incoming_isManaged = incoming.isManaged;
|
|
506
|
+
if (!(existing_isManaged === incoming_isManaged)) {
|
|
507
|
+
return false;
|
|
508
|
+
}
|
|
509
|
+
const existing_description = existing.description;
|
|
510
|
+
const incoming_description = incoming.description;
|
|
511
|
+
// if at least one of these optionals is defined
|
|
512
|
+
if (existing_description !== undefined || incoming_description !== undefined) {
|
|
513
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
514
|
+
// not equal
|
|
515
|
+
if (existing_description === undefined || incoming_description === undefined) {
|
|
516
|
+
return false;
|
|
517
|
+
}
|
|
518
|
+
if (!(existing_description === incoming_description)) {
|
|
519
|
+
return false;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
const existing_figureComponent = existing.figureComponent;
|
|
523
|
+
const incoming_figureComponent = incoming.figureComponent;
|
|
524
|
+
// if at least one of these optionals is defined
|
|
525
|
+
if (existing_figureComponent !== undefined || incoming_figureComponent !== undefined) {
|
|
526
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
527
|
+
// not equal
|
|
528
|
+
if (existing_figureComponent === undefined || incoming_figureComponent === undefined) {
|
|
529
|
+
return false;
|
|
530
|
+
}
|
|
531
|
+
if (!(existing_figureComponent === incoming_figureComponent)) {
|
|
532
|
+
return false;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
const existing_firstSeenTime = existing.firstSeenTime;
|
|
536
|
+
const incoming_firstSeenTime = incoming.firstSeenTime;
|
|
537
|
+
// if at least one of these optionals is defined
|
|
538
|
+
if (existing_firstSeenTime !== undefined || incoming_firstSeenTime !== undefined) {
|
|
539
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
540
|
+
// not equal
|
|
541
|
+
if (existing_firstSeenTime === undefined || incoming_firstSeenTime === undefined) {
|
|
542
|
+
return false;
|
|
543
|
+
}
|
|
544
|
+
if (!(existing_firstSeenTime === incoming_firstSeenTime)) {
|
|
545
|
+
return false;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
const existing_id = existing.id;
|
|
549
|
+
const incoming_id = incoming.id;
|
|
550
|
+
if (!(existing_id === incoming_id)) {
|
|
551
|
+
return false;
|
|
552
|
+
}
|
|
553
|
+
const existing_status = existing.status;
|
|
554
|
+
const incoming_status = incoming.status;
|
|
555
|
+
if (!(existing_status === incoming_status)) {
|
|
556
|
+
return false;
|
|
557
|
+
}
|
|
558
|
+
const existing_stepComponent = existing.stepComponent;
|
|
559
|
+
const incoming_stepComponent = incoming.stepComponent;
|
|
560
|
+
// if at least one of these optionals is defined
|
|
561
|
+
if (existing_stepComponent !== undefined || incoming_stepComponent !== undefined) {
|
|
562
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
563
|
+
// not equal
|
|
564
|
+
if (existing_stepComponent === undefined || incoming_stepComponent === undefined) {
|
|
565
|
+
return false;
|
|
566
|
+
}
|
|
567
|
+
if (!(existing_stepComponent === incoming_stepComponent)) {
|
|
568
|
+
return false;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
const existing_title = existing.title;
|
|
572
|
+
const incoming_title = incoming.title;
|
|
573
|
+
if (!(existing_title === incoming_title)) {
|
|
574
|
+
return false;
|
|
575
|
+
}
|
|
576
|
+
const existing_updateStrategy = existing.updateStrategy;
|
|
577
|
+
const incoming_updateStrategy = incoming.updateStrategy;
|
|
578
|
+
if (!(existing_updateStrategy === incoming_updateStrategy)) {
|
|
579
|
+
return false;
|
|
580
|
+
}
|
|
581
|
+
const existing_action = existing.action;
|
|
582
|
+
const incoming_action = incoming.action;
|
|
583
|
+
if (!(equals$e(existing_action, incoming_action))) {
|
|
584
|
+
return false;
|
|
585
|
+
}
|
|
586
|
+
const existing_tags = existing.tags;
|
|
587
|
+
const incoming_tags = incoming.tags;
|
|
588
|
+
const equals_tags_items = equalsArray(existing_tags, incoming_tags, (existing_tags_item, incoming_tags_item) => {
|
|
589
|
+
if (!(existing_tags_item === incoming_tags_item)) {
|
|
590
|
+
return false;
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
if (equals_tags_items === false) {
|
|
594
|
+
return false;
|
|
595
|
+
}
|
|
596
|
+
return true;
|
|
597
|
+
}
|
|
598
|
+
const ingest$8 = function LightningAssistantStepRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
599
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
600
|
+
const validateError = validate$g(input);
|
|
601
|
+
if (validateError !== null) {
|
|
602
|
+
throw validateError;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
const key = keyBuilderFromType$7(luvio, input);
|
|
606
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
607
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$8, "LEAP", VERSION$d, RepresentationType$8, equals$d);
|
|
608
|
+
return createLink(key);
|
|
609
|
+
};
|
|
610
|
+
function getTypeCacheKeys$8(rootKeySet, luvio, input, fullPathFactory) {
|
|
611
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
612
|
+
const rootKey = keyBuilderFromType$7(luvio, input);
|
|
613
|
+
rootKeySet.set(rootKey, {
|
|
614
|
+
namespace: keyPrefix,
|
|
615
|
+
representationName: RepresentationType$8,
|
|
616
|
+
mergeable: false
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
function select$n(luvio, params) {
|
|
621
|
+
return select$o();
|
|
622
|
+
}
|
|
623
|
+
function getResponseCacheKeys$a(storeKeyMap, luvio, resourceParams, response) {
|
|
624
|
+
getTypeCacheKeys$8(storeKeyMap, luvio, response);
|
|
625
|
+
}
|
|
626
|
+
function ingestSuccess$a(luvio, resourceParams, response) {
|
|
627
|
+
const { body } = response;
|
|
628
|
+
const key = keyBuilderFromType$7(luvio, body);
|
|
629
|
+
luvio.storeIngest(key, ingest$8, body);
|
|
630
|
+
const snapshot = luvio.storeLookup({
|
|
631
|
+
recordId: key,
|
|
632
|
+
node: select$n(),
|
|
633
|
+
variables: {},
|
|
634
|
+
});
|
|
635
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
636
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
637
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
deepFreeze(snapshot.data);
|
|
641
|
+
return snapshot;
|
|
642
|
+
}
|
|
643
|
+
function createResourceRequest$a(config) {
|
|
644
|
+
const headers = {};
|
|
645
|
+
return {
|
|
646
|
+
baseUri: '/services/data/v66.0',
|
|
647
|
+
basePath: '/assistant-platform/step/' + config.urlParams.stepName + '',
|
|
648
|
+
method: 'patch',
|
|
649
|
+
body: null,
|
|
650
|
+
urlParams: config.urlParams,
|
|
651
|
+
queryParams: {},
|
|
652
|
+
headers,
|
|
653
|
+
priority: 'normal',
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
const adapterName$a = 'evaluateStep';
|
|
658
|
+
const evaluateStep_ConfigPropertyMetadata = [
|
|
659
|
+
generateParamConfigMetadata('stepName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
660
|
+
];
|
|
661
|
+
const evaluateStep_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$a, evaluateStep_ConfigPropertyMetadata);
|
|
662
|
+
const createResourceParams$a = /*#__PURE__*/ createResourceParams$b(evaluateStep_ConfigPropertyMetadata);
|
|
663
|
+
function typeCheckConfig$a(untrustedConfig) {
|
|
664
|
+
const config = {};
|
|
665
|
+
typeCheckConfig$b(untrustedConfig, config, evaluateStep_ConfigPropertyMetadata);
|
|
666
|
+
return config;
|
|
667
|
+
}
|
|
668
|
+
function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
|
|
669
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
670
|
+
return null;
|
|
671
|
+
}
|
|
672
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
673
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
674
|
+
}
|
|
675
|
+
const config = typeCheckConfig$a(untrustedConfig);
|
|
676
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
677
|
+
return null;
|
|
678
|
+
}
|
|
679
|
+
return config;
|
|
680
|
+
}
|
|
681
|
+
function buildNetworkSnapshot$a(luvio, config, options) {
|
|
682
|
+
const resourceParams = createResourceParams$a(config);
|
|
683
|
+
const request = createResourceRequest$a(resourceParams);
|
|
684
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
685
|
+
.then((response) => {
|
|
686
|
+
return luvio.handleSuccessResponse(() => {
|
|
687
|
+
const snapshot = ingestSuccess$a(luvio, resourceParams, response);
|
|
688
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
689
|
+
}, () => {
|
|
690
|
+
const cache = new StoreKeyMap();
|
|
691
|
+
getResponseCacheKeys$a(cache, luvio, resourceParams, response.body);
|
|
692
|
+
return cache;
|
|
693
|
+
});
|
|
694
|
+
}, (response) => {
|
|
695
|
+
deepFreeze(response);
|
|
696
|
+
throw response;
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
const evaluateStepAdapterFactory = (luvio) => {
|
|
700
|
+
return function evaluateStep(untrustedConfig) {
|
|
701
|
+
const config = validateAdapterConfig$a(untrustedConfig, evaluateStep_ConfigPropertyNames);
|
|
702
|
+
// Invalid or incomplete config
|
|
703
|
+
if (config === null) {
|
|
704
|
+
throw new Error('Invalid config for "evaluateStep"');
|
|
705
|
+
}
|
|
706
|
+
return buildNetworkSnapshot$a(luvio, config);
|
|
707
|
+
};
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
const VERSION$c = "bc99d93cdafe8300d6f09b735c390bcd";
|
|
711
|
+
function validate$f(obj, path = 'LightningAssistantLayoutNodeRepresentation') {
|
|
712
|
+
const v_error = (() => {
|
|
713
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
714
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
715
|
+
}
|
|
716
|
+
const obj_children = obj.children;
|
|
717
|
+
const path_children = path + '.children';
|
|
718
|
+
if (!ArrayIsArray(obj_children)) {
|
|
719
|
+
return new TypeError('Expected "array" but received "' + typeof obj_children + '" (at "' + path_children + '")');
|
|
720
|
+
}
|
|
721
|
+
for (let i = 0; i < obj_children.length; i++) {
|
|
722
|
+
const obj_children_item = obj_children[i];
|
|
723
|
+
const path_children_item = path_children + '[' + i + ']';
|
|
724
|
+
if (obj_children_item === undefined) {
|
|
725
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_children_item + '" (at "' + path_children_item + '")');
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
const obj_description = obj.description;
|
|
729
|
+
const path_description = path + '.description';
|
|
730
|
+
let obj_description_union0 = null;
|
|
731
|
+
const obj_description_union0_error = (() => {
|
|
732
|
+
if (typeof obj_description !== 'string') {
|
|
733
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
734
|
+
}
|
|
735
|
+
})();
|
|
736
|
+
if (obj_description_union0_error != null) {
|
|
737
|
+
obj_description_union0 = obj_description_union0_error.message;
|
|
738
|
+
}
|
|
739
|
+
let obj_description_union1 = null;
|
|
740
|
+
const obj_description_union1_error = (() => {
|
|
741
|
+
if (obj_description !== null) {
|
|
742
|
+
return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
743
|
+
}
|
|
744
|
+
})();
|
|
745
|
+
if (obj_description_union1_error != null) {
|
|
746
|
+
obj_description_union1 = obj_description_union1_error.message;
|
|
747
|
+
}
|
|
748
|
+
if (obj_description_union0 && obj_description_union1) {
|
|
749
|
+
let message = 'Object doesn\'t match union (at "' + path_description + '")';
|
|
750
|
+
message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
751
|
+
message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
752
|
+
return new TypeError(message);
|
|
753
|
+
}
|
|
754
|
+
const obj_status = obj.status;
|
|
755
|
+
const path_status = path + '.status';
|
|
756
|
+
let obj_status_union0 = null;
|
|
757
|
+
const obj_status_union0_error = (() => {
|
|
758
|
+
if (typeof obj_status !== 'string') {
|
|
759
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
760
|
+
}
|
|
761
|
+
})();
|
|
762
|
+
if (obj_status_union0_error != null) {
|
|
763
|
+
obj_status_union0 = obj_status_union0_error.message;
|
|
764
|
+
}
|
|
765
|
+
let obj_status_union1 = null;
|
|
766
|
+
const obj_status_union1_error = (() => {
|
|
767
|
+
if (obj_status !== null) {
|
|
768
|
+
return new TypeError('Expected "null" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
769
|
+
}
|
|
770
|
+
})();
|
|
771
|
+
if (obj_status_union1_error != null) {
|
|
772
|
+
obj_status_union1 = obj_status_union1_error.message;
|
|
773
|
+
}
|
|
774
|
+
if (obj_status_union0 && obj_status_union1) {
|
|
775
|
+
let message = 'Object doesn\'t match union (at "' + path_status + '")';
|
|
776
|
+
message += '\n' + obj_status_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
777
|
+
message += '\n' + obj_status_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
778
|
+
return new TypeError(message);
|
|
779
|
+
}
|
|
780
|
+
const obj_step = obj.step;
|
|
781
|
+
const path_step = path + '.step';
|
|
782
|
+
let obj_step_union0 = null;
|
|
783
|
+
const obj_step_union0_error = (() => {
|
|
784
|
+
if (typeof obj_step !== 'object' || Array.isArray(obj_step)) {
|
|
785
|
+
return new TypeError('Expected "object" but received "' + typeof obj_step + '" (at "' + path_step + '")');
|
|
786
|
+
}
|
|
787
|
+
})();
|
|
788
|
+
if (obj_step_union0_error != null) {
|
|
789
|
+
obj_step_union0 = obj_step_union0_error.message;
|
|
790
|
+
}
|
|
791
|
+
let obj_step_union1 = null;
|
|
792
|
+
const obj_step_union1_error = (() => {
|
|
793
|
+
if (obj_step !== null) {
|
|
794
|
+
return new TypeError('Expected "null" but received "' + typeof obj_step + '" (at "' + path_step + '")');
|
|
795
|
+
}
|
|
796
|
+
})();
|
|
797
|
+
if (obj_step_union1_error != null) {
|
|
798
|
+
obj_step_union1 = obj_step_union1_error.message;
|
|
799
|
+
}
|
|
800
|
+
if (obj_step_union0 && obj_step_union1) {
|
|
801
|
+
let message = 'Object doesn\'t match union (at "' + path_step + '")';
|
|
802
|
+
message += '\n' + obj_step_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
803
|
+
message += '\n' + obj_step_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
804
|
+
return new TypeError(message);
|
|
805
|
+
}
|
|
806
|
+
const obj_tags = obj.tags;
|
|
807
|
+
const path_tags = path + '.tags';
|
|
808
|
+
if (!ArrayIsArray(obj_tags)) {
|
|
809
|
+
return new TypeError('Expected "array" but received "' + typeof obj_tags + '" (at "' + path_tags + '")');
|
|
810
|
+
}
|
|
811
|
+
for (let i = 0; i < obj_tags.length; i++) {
|
|
812
|
+
const obj_tags_item = obj_tags[i];
|
|
813
|
+
const path_tags_item = path_tags + '[' + i + ']';
|
|
814
|
+
if (typeof obj_tags_item !== 'string') {
|
|
815
|
+
return new TypeError('Expected "string" but received "' + typeof obj_tags_item + '" (at "' + path_tags_item + '")');
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
const obj_title = obj.title;
|
|
819
|
+
const path_title = path + '.title';
|
|
820
|
+
let obj_title_union0 = null;
|
|
821
|
+
const obj_title_union0_error = (() => {
|
|
822
|
+
if (typeof obj_title !== 'string') {
|
|
823
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
824
|
+
}
|
|
825
|
+
})();
|
|
826
|
+
if (obj_title_union0_error != null) {
|
|
827
|
+
obj_title_union0 = obj_title_union0_error.message;
|
|
828
|
+
}
|
|
829
|
+
let obj_title_union1 = null;
|
|
830
|
+
const obj_title_union1_error = (() => {
|
|
831
|
+
if (obj_title !== null) {
|
|
832
|
+
return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
833
|
+
}
|
|
834
|
+
})();
|
|
835
|
+
if (obj_title_union1_error != null) {
|
|
836
|
+
obj_title_union1 = obj_title_union1_error.message;
|
|
837
|
+
}
|
|
838
|
+
if (obj_title_union0 && obj_title_union1) {
|
|
839
|
+
let message = 'Object doesn\'t match union (at "' + path_title + '")';
|
|
840
|
+
message += '\n' + obj_title_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
841
|
+
message += '\n' + obj_title_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
842
|
+
return new TypeError(message);
|
|
843
|
+
}
|
|
844
|
+
const obj_type = obj.type;
|
|
845
|
+
const path_type = path + '.type';
|
|
846
|
+
if (typeof obj_type !== 'string') {
|
|
847
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
848
|
+
}
|
|
849
|
+
})();
|
|
850
|
+
return v_error === undefined ? null : v_error;
|
|
851
|
+
}
|
|
852
|
+
const RepresentationType$7 = 'LightningAssistantLayoutNodeRepresentation';
|
|
853
|
+
function normalize$7(input, existing, path, luvio, store, timestamp) {
|
|
854
|
+
const input_step = input.step;
|
|
855
|
+
const input_step_id = path.fullPath + '__step';
|
|
856
|
+
if (!Array.isArray(input_step) && input_step !== null && typeof input_step === 'object') {
|
|
857
|
+
input.step = ingest$8(input_step, {
|
|
858
|
+
fullPath: input_step_id,
|
|
859
|
+
propertyName: 'step',
|
|
860
|
+
parent: {
|
|
861
|
+
data: input,
|
|
862
|
+
key: path.fullPath,
|
|
863
|
+
existing: existing,
|
|
864
|
+
},
|
|
865
|
+
ttl: path.ttl
|
|
866
|
+
}, luvio, store, timestamp);
|
|
867
|
+
}
|
|
868
|
+
return input;
|
|
869
|
+
}
|
|
870
|
+
const select$m = function LightningAssistantLayoutNodeRepresentationSelect() {
|
|
871
|
+
return {
|
|
872
|
+
kind: 'Fragment',
|
|
873
|
+
version: VERSION$c,
|
|
874
|
+
private: [],
|
|
875
|
+
selections: [
|
|
876
|
+
{
|
|
877
|
+
name: 'children',
|
|
878
|
+
kind: 'Object',
|
|
879
|
+
// any
|
|
880
|
+
},
|
|
881
|
+
{
|
|
882
|
+
name: 'description',
|
|
883
|
+
kind: 'Scalar'
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
name: 'status',
|
|
887
|
+
kind: 'Scalar'
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
name: 'step',
|
|
891
|
+
kind: 'Link',
|
|
892
|
+
nullable: true,
|
|
893
|
+
fragment: select$o()
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
name: 'tags',
|
|
897
|
+
kind: 'Scalar',
|
|
898
|
+
plural: true
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
name: 'title',
|
|
902
|
+
kind: 'Scalar'
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
name: 'type',
|
|
906
|
+
kind: 'Scalar'
|
|
907
|
+
}
|
|
908
|
+
]
|
|
909
|
+
};
|
|
910
|
+
};
|
|
911
|
+
function equals$c(existing, incoming) {
|
|
912
|
+
const existing_type = existing.type;
|
|
913
|
+
const incoming_type = incoming.type;
|
|
914
|
+
if (!(existing_type === incoming_type)) {
|
|
915
|
+
return false;
|
|
916
|
+
}
|
|
917
|
+
const existing_children = existing.children;
|
|
918
|
+
const incoming_children = incoming.children;
|
|
919
|
+
const equals_children_items = equalsArray(existing_children, incoming_children, (existing_children_item, incoming_children_item) => {
|
|
920
|
+
if (JSONStringify(incoming_children_item) !== JSONStringify(existing_children_item)) {
|
|
921
|
+
return false;
|
|
922
|
+
}
|
|
923
|
+
});
|
|
924
|
+
if (equals_children_items === false) {
|
|
925
|
+
return false;
|
|
926
|
+
}
|
|
927
|
+
const existing_description = existing.description;
|
|
928
|
+
const incoming_description = incoming.description;
|
|
929
|
+
if (!(existing_description === incoming_description)) {
|
|
930
|
+
return false;
|
|
931
|
+
}
|
|
932
|
+
const existing_status = existing.status;
|
|
933
|
+
const incoming_status = incoming.status;
|
|
934
|
+
if (!(existing_status === incoming_status)) {
|
|
935
|
+
return false;
|
|
936
|
+
}
|
|
937
|
+
const existing_step = existing.step;
|
|
938
|
+
const incoming_step = incoming.step;
|
|
939
|
+
if (!(existing_step === incoming_step
|
|
940
|
+
|| (existing_step != null &&
|
|
941
|
+
incoming_step != null &&
|
|
942
|
+
existing_step.__ref != null &&
|
|
943
|
+
incoming_step.__ref != null &&
|
|
944
|
+
existing_step.__ref === incoming_step.__ref))) {
|
|
945
|
+
return false;
|
|
946
|
+
}
|
|
947
|
+
const existing_tags = existing.tags;
|
|
948
|
+
const incoming_tags = incoming.tags;
|
|
949
|
+
const equals_tags_items = equalsArray(existing_tags, incoming_tags, (existing_tags_item, incoming_tags_item) => {
|
|
950
|
+
if (!(existing_tags_item === incoming_tags_item)) {
|
|
951
|
+
return false;
|
|
952
|
+
}
|
|
953
|
+
});
|
|
954
|
+
if (equals_tags_items === false) {
|
|
955
|
+
return false;
|
|
956
|
+
}
|
|
957
|
+
const existing_title = existing.title;
|
|
958
|
+
const incoming_title = incoming.title;
|
|
959
|
+
if (!(existing_title === incoming_title)) {
|
|
960
|
+
return false;
|
|
961
|
+
}
|
|
962
|
+
return true;
|
|
963
|
+
}
|
|
964
|
+
const ingest$7 = function LightningAssistantLayoutNodeRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
965
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
966
|
+
const validateError = validate$f(input);
|
|
967
|
+
if (validateError !== null) {
|
|
968
|
+
throw validateError;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
const key = path.fullPath;
|
|
972
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
973
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$7, "LEAP", VERSION$c, RepresentationType$7, equals$c);
|
|
974
|
+
return createLink(key);
|
|
975
|
+
};
|
|
976
|
+
function getTypeCacheKeys$7(rootKeySet, luvio, input, fullPathFactory) {
|
|
977
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
978
|
+
const rootKey = fullPathFactory();
|
|
979
|
+
rootKeySet.set(rootKey, {
|
|
980
|
+
namespace: keyPrefix,
|
|
981
|
+
representationName: RepresentationType$7,
|
|
982
|
+
mergeable: false
|
|
983
|
+
});
|
|
984
|
+
if (!Array.isArray(input.step) && input.step !== null && typeof input.step === 'object') {
|
|
985
|
+
getTypeCacheKeys$8(rootKeySet, luvio, input.step);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
const VERSION$b = "596a25b0bee0b1db5495fe57dd7bd025";
|
|
990
|
+
function validate$e(obj, path = 'LightningAssistantRepresentation') {
|
|
991
|
+
const v_error = (() => {
|
|
992
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
993
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
994
|
+
}
|
|
995
|
+
const obj_assistantTarget = obj.assistantTarget;
|
|
996
|
+
const path_assistantTarget = path + '.assistantTarget';
|
|
997
|
+
if (typeof obj_assistantTarget !== 'string') {
|
|
998
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
|
|
999
|
+
}
|
|
1000
|
+
if (obj.category !== undefined) {
|
|
1001
|
+
const obj_category = obj.category;
|
|
1002
|
+
const path_category = path + '.category';
|
|
1003
|
+
if (typeof obj_category !== 'string') {
|
|
1004
|
+
return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
if (obj.categoryName !== undefined) {
|
|
1008
|
+
const obj_categoryName = obj.categoryName;
|
|
1009
|
+
const path_categoryName = path + '.categoryName';
|
|
1010
|
+
if (typeof obj_categoryName !== 'string') {
|
|
1011
|
+
return new TypeError('Expected "string" but received "' + typeof obj_categoryName + '" (at "' + path_categoryName + '")');
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
if (obj.completionDate !== undefined) {
|
|
1015
|
+
const obj_completionDate = obj.completionDate;
|
|
1016
|
+
const path_completionDate = path + '.completionDate';
|
|
1017
|
+
if (typeof obj_completionDate !== 'string') {
|
|
1018
|
+
return new TypeError('Expected "string" but received "' + typeof obj_completionDate + '" (at "' + path_completionDate + '")');
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
const obj_contentVersion = obj.contentVersion;
|
|
1022
|
+
const path_contentVersion = path + '.contentVersion';
|
|
1023
|
+
if (typeof obj_contentVersion !== 'string') {
|
|
1024
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contentVersion + '" (at "' + path_contentVersion + '")');
|
|
1025
|
+
}
|
|
1026
|
+
const obj_debugModeEnabled = obj.debugModeEnabled;
|
|
1027
|
+
const path_debugModeEnabled = path + '.debugModeEnabled';
|
|
1028
|
+
if (typeof obj_debugModeEnabled !== 'boolean') {
|
|
1029
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_debugModeEnabled + '" (at "' + path_debugModeEnabled + '")');
|
|
1030
|
+
}
|
|
1031
|
+
if (obj.description !== undefined) {
|
|
1032
|
+
const obj_description = obj.description;
|
|
1033
|
+
const path_description = path + '.description';
|
|
1034
|
+
if (typeof obj_description !== 'string') {
|
|
1035
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
const obj_developerName = obj.developerName;
|
|
1039
|
+
const path_developerName = path + '.developerName';
|
|
1040
|
+
if (typeof obj_developerName !== 'string') {
|
|
1041
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
1042
|
+
}
|
|
1043
|
+
if (obj.estimatedMinutesToComplete !== undefined) {
|
|
1044
|
+
const obj_estimatedMinutesToComplete = obj.estimatedMinutesToComplete;
|
|
1045
|
+
const path_estimatedMinutesToComplete = path + '.estimatedMinutesToComplete';
|
|
1046
|
+
if (typeof obj_estimatedMinutesToComplete !== 'number' || (typeof obj_estimatedMinutesToComplete === 'number' && Math.floor(obj_estimatedMinutesToComplete) !== obj_estimatedMinutesToComplete)) {
|
|
1047
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_estimatedMinutesToComplete + '" (at "' + path_estimatedMinutesToComplete + '")');
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
const obj_icon = obj.icon;
|
|
1051
|
+
const path_icon = path + '.icon';
|
|
1052
|
+
if (typeof obj_icon !== 'string') {
|
|
1053
|
+
return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
|
|
1054
|
+
}
|
|
1055
|
+
const obj_isArchived = obj.isArchived;
|
|
1056
|
+
const path_isArchived = path + '.isArchived';
|
|
1057
|
+
if (typeof obj_isArchived !== 'boolean') {
|
|
1058
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isArchived + '" (at "' + path_isArchived + '")');
|
|
1059
|
+
}
|
|
1060
|
+
const obj_isPreview = obj.isPreview;
|
|
1061
|
+
const path_isPreview = path + '.isPreview';
|
|
1062
|
+
if (typeof obj_isPreview !== 'boolean') {
|
|
1063
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isPreview + '" (at "' + path_isPreview + '")');
|
|
1064
|
+
}
|
|
1065
|
+
const obj_layout = obj.layout;
|
|
1066
|
+
const path_layout = path + '.layout';
|
|
1067
|
+
if (typeof obj_layout !== 'object' || Array.isArray(obj_layout)) {
|
|
1068
|
+
return new TypeError('Expected "object" but received "' + typeof obj_layout + '" (at "' + path_layout + '")');
|
|
1069
|
+
}
|
|
1070
|
+
const obj_numberOfSteps = obj.numberOfSteps;
|
|
1071
|
+
const path_numberOfSteps = path + '.numberOfSteps';
|
|
1072
|
+
if (typeof obj_numberOfSteps !== 'number' || (typeof obj_numberOfSteps === 'number' && Math.floor(obj_numberOfSteps) !== obj_numberOfSteps)) {
|
|
1073
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_numberOfSteps + '" (at "' + path_numberOfSteps + '")');
|
|
1074
|
+
}
|
|
1075
|
+
obj.progress;
|
|
1076
|
+
const obj_questionnaireIds = obj.questionnaireIds;
|
|
1077
|
+
const path_questionnaireIds = path + '.questionnaireIds';
|
|
1078
|
+
if (!ArrayIsArray(obj_questionnaireIds)) {
|
|
1079
|
+
return new TypeError('Expected "array" but received "' + typeof obj_questionnaireIds + '" (at "' + path_questionnaireIds + '")');
|
|
1080
|
+
}
|
|
1081
|
+
for (let i = 0; i < obj_questionnaireIds.length; i++) {
|
|
1082
|
+
const obj_questionnaireIds_item = obj_questionnaireIds[i];
|
|
1083
|
+
const path_questionnaireIds_item = path_questionnaireIds + '[' + i + ']';
|
|
1084
|
+
if (typeof obj_questionnaireIds_item !== 'string') {
|
|
1085
|
+
return new TypeError('Expected "string" but received "' + typeof obj_questionnaireIds_item + '" (at "' + path_questionnaireIds_item + '")');
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
const obj_status = obj.status;
|
|
1089
|
+
const path_status = path + '.status';
|
|
1090
|
+
if (typeof obj_status !== 'string') {
|
|
1091
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1092
|
+
}
|
|
1093
|
+
const obj_title = obj.title;
|
|
1094
|
+
const path_title = path + '.title';
|
|
1095
|
+
if (typeof obj_title !== 'string') {
|
|
1096
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
1097
|
+
}
|
|
1098
|
+
})();
|
|
1099
|
+
return v_error === undefined ? null : v_error;
|
|
1100
|
+
}
|
|
1101
|
+
const RepresentationType$6 = 'LightningAssistantRepresentation';
|
|
1102
|
+
function keyBuilder$i(luvio, config) {
|
|
1103
|
+
return keyPrefix + '::' + RepresentationType$6 + ':' + config.assistant_name;
|
|
1104
|
+
}
|
|
1105
|
+
function keyBuilderFromType$6(luvio, object) {
|
|
1106
|
+
const keyParams = {
|
|
1107
|
+
assistant_name: object.developerName
|
|
1108
|
+
};
|
|
1109
|
+
return keyBuilder$i(luvio, keyParams);
|
|
1110
|
+
}
|
|
1111
|
+
function normalize$6(input, existing, path, luvio, store, timestamp) {
|
|
1112
|
+
const input_layout = input.layout;
|
|
1113
|
+
const input_layout_id = path.fullPath + '__layout';
|
|
1114
|
+
input.layout = ingest$7(input_layout, {
|
|
1115
|
+
fullPath: input_layout_id,
|
|
1116
|
+
propertyName: 'layout',
|
|
1117
|
+
parent: {
|
|
1118
|
+
data: input,
|
|
1119
|
+
key: path.fullPath,
|
|
1120
|
+
existing: existing,
|
|
1121
|
+
},
|
|
1122
|
+
ttl: path.ttl
|
|
1123
|
+
}, luvio, store, timestamp);
|
|
1124
|
+
return input;
|
|
1125
|
+
}
|
|
1126
|
+
const select$l = function LightningAssistantRepresentationSelect() {
|
|
1127
|
+
return {
|
|
1128
|
+
kind: 'Fragment',
|
|
1129
|
+
version: VERSION$b,
|
|
1130
|
+
private: [],
|
|
1131
|
+
selections: [
|
|
1132
|
+
{
|
|
1133
|
+
name: 'assistantTarget',
|
|
1134
|
+
kind: 'Scalar'
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
name: 'category',
|
|
1138
|
+
kind: 'Scalar',
|
|
1139
|
+
required: false
|
|
1140
|
+
},
|
|
1141
|
+
{
|
|
1142
|
+
name: 'categoryName',
|
|
1143
|
+
kind: 'Scalar',
|
|
1144
|
+
required: false
|
|
1145
|
+
},
|
|
1146
|
+
{
|
|
1147
|
+
name: 'completionDate',
|
|
1148
|
+
kind: 'Scalar',
|
|
1149
|
+
required: false
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
name: 'contentVersion',
|
|
1153
|
+
kind: 'Scalar'
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
name: 'debugModeEnabled',
|
|
1157
|
+
kind: 'Scalar'
|
|
1158
|
+
},
|
|
1159
|
+
{
|
|
1160
|
+
name: 'description',
|
|
1161
|
+
kind: 'Scalar',
|
|
1162
|
+
required: false
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
name: 'developerName',
|
|
1166
|
+
kind: 'Scalar'
|
|
1167
|
+
},
|
|
1168
|
+
{
|
|
1169
|
+
name: 'estimatedMinutesToComplete',
|
|
1170
|
+
kind: 'Scalar',
|
|
1171
|
+
required: false
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
name: 'icon',
|
|
1175
|
+
kind: 'Scalar'
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
name: 'isArchived',
|
|
1179
|
+
kind: 'Scalar'
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
name: 'isPreview',
|
|
1183
|
+
kind: 'Scalar'
|
|
1184
|
+
},
|
|
1185
|
+
{
|
|
1186
|
+
name: 'layout',
|
|
1187
|
+
kind: 'Link',
|
|
1188
|
+
fragment: select$m()
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
name: 'numberOfSteps',
|
|
1192
|
+
kind: 'Scalar'
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
name: 'progress',
|
|
1196
|
+
kind: 'Scalar'
|
|
1197
|
+
},
|
|
1198
|
+
{
|
|
1199
|
+
name: 'questionnaireIds',
|
|
1200
|
+
kind: 'Scalar',
|
|
1201
|
+
plural: true
|
|
1202
|
+
},
|
|
1203
|
+
{
|
|
1204
|
+
name: 'status',
|
|
1205
|
+
kind: 'Scalar'
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
name: 'title',
|
|
1209
|
+
kind: 'Scalar'
|
|
1210
|
+
}
|
|
1211
|
+
]
|
|
1212
|
+
};
|
|
1213
|
+
};
|
|
1214
|
+
function equals$b(existing, incoming) {
|
|
1215
|
+
const existing_debugModeEnabled = existing.debugModeEnabled;
|
|
1216
|
+
const incoming_debugModeEnabled = incoming.debugModeEnabled;
|
|
1217
|
+
if (!(existing_debugModeEnabled === incoming_debugModeEnabled)) {
|
|
1218
|
+
return false;
|
|
1219
|
+
}
|
|
1220
|
+
const existing_isArchived = existing.isArchived;
|
|
1221
|
+
const incoming_isArchived = incoming.isArchived;
|
|
1222
|
+
if (!(existing_isArchived === incoming_isArchived)) {
|
|
1223
|
+
return false;
|
|
1224
|
+
}
|
|
1225
|
+
const existing_isPreview = existing.isPreview;
|
|
1226
|
+
const incoming_isPreview = incoming.isPreview;
|
|
1227
|
+
if (!(existing_isPreview === incoming_isPreview)) {
|
|
1228
|
+
return false;
|
|
1229
|
+
}
|
|
1230
|
+
const existing_estimatedMinutesToComplete = existing.estimatedMinutesToComplete;
|
|
1231
|
+
const incoming_estimatedMinutesToComplete = incoming.estimatedMinutesToComplete;
|
|
1232
|
+
// if at least one of these optionals is defined
|
|
1233
|
+
if (existing_estimatedMinutesToComplete !== undefined || incoming_estimatedMinutesToComplete !== undefined) {
|
|
1234
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1235
|
+
// not equal
|
|
1236
|
+
if (existing_estimatedMinutesToComplete === undefined || incoming_estimatedMinutesToComplete === undefined) {
|
|
1237
|
+
return false;
|
|
1238
|
+
}
|
|
1239
|
+
if (!(existing_estimatedMinutesToComplete === incoming_estimatedMinutesToComplete)) {
|
|
1240
|
+
return false;
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
const existing_numberOfSteps = existing.numberOfSteps;
|
|
1244
|
+
const incoming_numberOfSteps = incoming.numberOfSteps;
|
|
1245
|
+
if (!(existing_numberOfSteps === incoming_numberOfSteps)) {
|
|
1246
|
+
return false;
|
|
1247
|
+
}
|
|
1248
|
+
const existing_assistantTarget = existing.assistantTarget;
|
|
1249
|
+
const incoming_assistantTarget = incoming.assistantTarget;
|
|
1250
|
+
if (!(existing_assistantTarget === incoming_assistantTarget)) {
|
|
1251
|
+
return false;
|
|
1252
|
+
}
|
|
1253
|
+
const existing_category = existing.category;
|
|
1254
|
+
const incoming_category = incoming.category;
|
|
1255
|
+
// if at least one of these optionals is defined
|
|
1256
|
+
if (existing_category !== undefined || incoming_category !== undefined) {
|
|
1257
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1258
|
+
// not equal
|
|
1259
|
+
if (existing_category === undefined || incoming_category === undefined) {
|
|
1260
|
+
return false;
|
|
1261
|
+
}
|
|
1262
|
+
if (!(existing_category === incoming_category)) {
|
|
1263
|
+
return false;
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
const existing_categoryName = existing.categoryName;
|
|
1267
|
+
const incoming_categoryName = incoming.categoryName;
|
|
1268
|
+
// if at least one of these optionals is defined
|
|
1269
|
+
if (existing_categoryName !== undefined || incoming_categoryName !== undefined) {
|
|
1270
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1271
|
+
// not equal
|
|
1272
|
+
if (existing_categoryName === undefined || incoming_categoryName === undefined) {
|
|
1273
|
+
return false;
|
|
1274
|
+
}
|
|
1275
|
+
if (!(existing_categoryName === incoming_categoryName)) {
|
|
1276
|
+
return false;
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
const existing_completionDate = existing.completionDate;
|
|
1280
|
+
const incoming_completionDate = incoming.completionDate;
|
|
1281
|
+
// if at least one of these optionals is defined
|
|
1282
|
+
if (existing_completionDate !== undefined || incoming_completionDate !== undefined) {
|
|
1283
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1284
|
+
// not equal
|
|
1285
|
+
if (existing_completionDate === undefined || incoming_completionDate === undefined) {
|
|
1286
|
+
return false;
|
|
1287
|
+
}
|
|
1288
|
+
if (!(existing_completionDate === incoming_completionDate)) {
|
|
1289
|
+
return false;
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
const existing_contentVersion = existing.contentVersion;
|
|
1293
|
+
const incoming_contentVersion = incoming.contentVersion;
|
|
1294
|
+
if (!(existing_contentVersion === incoming_contentVersion)) {
|
|
1295
|
+
return false;
|
|
1296
|
+
}
|
|
1297
|
+
const existing_description = existing.description;
|
|
1298
|
+
const incoming_description = incoming.description;
|
|
1299
|
+
// if at least one of these optionals is defined
|
|
1300
|
+
if (existing_description !== undefined || incoming_description !== undefined) {
|
|
1301
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1302
|
+
// not equal
|
|
1303
|
+
if (existing_description === undefined || incoming_description === undefined) {
|
|
1304
|
+
return false;
|
|
1305
|
+
}
|
|
1306
|
+
if (!(existing_description === incoming_description)) {
|
|
1307
|
+
return false;
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
const existing_developerName = existing.developerName;
|
|
1311
|
+
const incoming_developerName = incoming.developerName;
|
|
1312
|
+
if (!(existing_developerName === incoming_developerName)) {
|
|
1313
|
+
return false;
|
|
1314
|
+
}
|
|
1315
|
+
const existing_icon = existing.icon;
|
|
1316
|
+
const incoming_icon = incoming.icon;
|
|
1317
|
+
if (!(existing_icon === incoming_icon)) {
|
|
1318
|
+
return false;
|
|
1319
|
+
}
|
|
1320
|
+
const existing_status = existing.status;
|
|
1321
|
+
const incoming_status = incoming.status;
|
|
1322
|
+
if (!(existing_status === incoming_status)) {
|
|
1323
|
+
return false;
|
|
1324
|
+
}
|
|
1325
|
+
const existing_title = existing.title;
|
|
1326
|
+
const incoming_title = incoming.title;
|
|
1327
|
+
if (!(existing_title === incoming_title)) {
|
|
1328
|
+
return false;
|
|
1329
|
+
}
|
|
1330
|
+
const existing_progress = existing.progress;
|
|
1331
|
+
const incoming_progress = incoming.progress;
|
|
1332
|
+
if (!(existing_progress === incoming_progress)) {
|
|
1333
|
+
return false;
|
|
1334
|
+
}
|
|
1335
|
+
const existing_layout = existing.layout;
|
|
1336
|
+
const incoming_layout = incoming.layout;
|
|
1337
|
+
if (!(existing_layout.__ref === incoming_layout.__ref)) {
|
|
1338
|
+
return false;
|
|
1339
|
+
}
|
|
1340
|
+
const existing_questionnaireIds = existing.questionnaireIds;
|
|
1341
|
+
const incoming_questionnaireIds = incoming.questionnaireIds;
|
|
1342
|
+
const equals_questionnaireIds_items = equalsArray(existing_questionnaireIds, incoming_questionnaireIds, (existing_questionnaireIds_item, incoming_questionnaireIds_item) => {
|
|
1343
|
+
if (!(existing_questionnaireIds_item === incoming_questionnaireIds_item)) {
|
|
1344
|
+
return false;
|
|
1345
|
+
}
|
|
1346
|
+
});
|
|
1347
|
+
if (equals_questionnaireIds_items === false) {
|
|
1348
|
+
return false;
|
|
1349
|
+
}
|
|
1350
|
+
return true;
|
|
1351
|
+
}
|
|
1352
|
+
const ingest$6 = function LightningAssistantRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1353
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1354
|
+
const validateError = validate$e(input);
|
|
1355
|
+
if (validateError !== null) {
|
|
1356
|
+
throw validateError;
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
const key = keyBuilderFromType$6(luvio, input);
|
|
1360
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
1361
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "LEAP", VERSION$b, RepresentationType$6, equals$b);
|
|
1362
|
+
return createLink(key);
|
|
1363
|
+
};
|
|
1364
|
+
function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
|
|
1365
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1366
|
+
const rootKey = keyBuilderFromType$6(luvio, input);
|
|
1367
|
+
rootKeySet.set(rootKey, {
|
|
1368
|
+
namespace: keyPrefix,
|
|
1369
|
+
representationName: RepresentationType$6,
|
|
1370
|
+
mergeable: false
|
|
1371
|
+
});
|
|
1372
|
+
getTypeCacheKeys$7(rootKeySet, luvio, input.layout, () => rootKey + "__" + "layout");
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
function select$k(luvio, params) {
|
|
1376
|
+
return select$l();
|
|
1377
|
+
}
|
|
1378
|
+
function keyBuilder$h(luvio, params) {
|
|
1379
|
+
return keyBuilder$i(luvio, {
|
|
1380
|
+
assistant_name: params.urlParams.assistantName
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
1383
|
+
function getResponseCacheKeys$9(storeKeyMap, luvio, resourceParams, response) {
|
|
1384
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response);
|
|
1385
|
+
}
|
|
1386
|
+
function ingestSuccess$9(luvio, resourceParams, response, snapshotRefresh) {
|
|
1387
|
+
const { body } = response;
|
|
1388
|
+
const key = keyBuilder$h(luvio, resourceParams);
|
|
1389
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
1390
|
+
const snapshot = luvio.storeLookup({
|
|
1391
|
+
recordId: key,
|
|
1392
|
+
node: select$k(),
|
|
1393
|
+
variables: {},
|
|
1394
|
+
}, snapshotRefresh);
|
|
1395
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1396
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1397
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
deepFreeze(snapshot.data);
|
|
1401
|
+
return snapshot;
|
|
1402
|
+
}
|
|
1403
|
+
function ingestError$5(luvio, params, error, snapshotRefresh) {
|
|
1404
|
+
const key = keyBuilder$h(luvio, params);
|
|
1405
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1406
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
1407
|
+
return errorSnapshot;
|
|
1408
|
+
}
|
|
1409
|
+
function createResourceRequest$9(config) {
|
|
1410
|
+
const headers = {};
|
|
1411
|
+
return {
|
|
1412
|
+
baseUri: '/services/data/v66.0',
|
|
1413
|
+
basePath: '/assistant-platform/' + config.urlParams.assistantName + '',
|
|
1414
|
+
method: 'get',
|
|
1415
|
+
body: null,
|
|
1416
|
+
urlParams: config.urlParams,
|
|
1417
|
+
queryParams: {},
|
|
1418
|
+
headers,
|
|
1419
|
+
priority: 'normal',
|
|
1420
|
+
};
|
|
1421
|
+
}
|
|
1422
|
+
function createResourceRequestFromRepresentation$5(representation) {
|
|
1423
|
+
const config = {
|
|
1424
|
+
urlParams: {},
|
|
1425
|
+
};
|
|
1426
|
+
config.urlParams.assistantName = representation.developerName;
|
|
1427
|
+
return createResourceRequest$9(config);
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
const adapterName$9 = 'getAssistant';
|
|
1431
|
+
const getAssistant_ConfigPropertyMetadata = [
|
|
1432
|
+
generateParamConfigMetadata('assistantName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1433
|
+
];
|
|
1434
|
+
const getAssistant_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$9, getAssistant_ConfigPropertyMetadata);
|
|
1435
|
+
const createResourceParams$9 = /*#__PURE__*/ createResourceParams$b(getAssistant_ConfigPropertyMetadata);
|
|
1436
|
+
function keyBuilder$g(luvio, config) {
|
|
1437
|
+
const resourceParams = createResourceParams$9(config);
|
|
1438
|
+
return keyBuilder$h(luvio, resourceParams);
|
|
1439
|
+
}
|
|
1440
|
+
function typeCheckConfig$9(untrustedConfig) {
|
|
1441
|
+
const config = {};
|
|
1442
|
+
typeCheckConfig$b(untrustedConfig, config, getAssistant_ConfigPropertyMetadata);
|
|
1443
|
+
return config;
|
|
1444
|
+
}
|
|
1445
|
+
function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
|
|
1446
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1447
|
+
return null;
|
|
1448
|
+
}
|
|
1449
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1450
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1451
|
+
}
|
|
1452
|
+
const config = typeCheckConfig$9(untrustedConfig);
|
|
1453
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1454
|
+
return null;
|
|
1455
|
+
}
|
|
1456
|
+
return config;
|
|
1457
|
+
}
|
|
1458
|
+
function adapterFragment$5(luvio, config) {
|
|
1459
|
+
createResourceParams$9(config);
|
|
1460
|
+
return select$k();
|
|
1461
|
+
}
|
|
1462
|
+
function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
|
|
1463
|
+
const snapshot = ingestSuccess$9(luvio, resourceParams, response, {
|
|
1464
|
+
config,
|
|
1465
|
+
resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
|
|
1466
|
+
});
|
|
1467
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1468
|
+
}
|
|
1469
|
+
function onFetchResponseError$5(luvio, config, resourceParams, response) {
|
|
1470
|
+
const snapshot = ingestError$5(luvio, resourceParams, response, {
|
|
1471
|
+
config,
|
|
1472
|
+
resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
|
|
1473
|
+
});
|
|
1474
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1475
|
+
}
|
|
1476
|
+
function buildNetworkSnapshot$9(luvio, config, options) {
|
|
1477
|
+
const resourceParams = createResourceParams$9(config);
|
|
1478
|
+
const request = createResourceRequest$9(resourceParams);
|
|
1479
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1480
|
+
.then((response) => {
|
|
1481
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
|
|
1482
|
+
const cache = new StoreKeyMap();
|
|
1483
|
+
getResponseCacheKeys$9(cache, luvio, resourceParams, response.body);
|
|
1484
|
+
return cache;
|
|
1485
|
+
});
|
|
1486
|
+
}, (response) => {
|
|
1487
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
|
|
1488
|
+
});
|
|
1489
|
+
}
|
|
1490
|
+
function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
|
|
1491
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$9, undefined, false);
|
|
1492
|
+
}
|
|
1493
|
+
function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
|
|
1494
|
+
const { luvio, config } = context;
|
|
1495
|
+
const selector = {
|
|
1496
|
+
recordId: keyBuilder$g(luvio, config),
|
|
1497
|
+
node: adapterFragment$5(luvio, config),
|
|
1498
|
+
variables: {},
|
|
1499
|
+
};
|
|
1500
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1501
|
+
config,
|
|
1502
|
+
resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
|
|
1503
|
+
});
|
|
1504
|
+
return cacheSnapshot;
|
|
1505
|
+
}
|
|
1506
|
+
const getAssistantAdapterFactory = (luvio) => function LEAP__getAssistant(untrustedConfig, requestContext) {
|
|
1507
|
+
const config = validateAdapterConfig$9(untrustedConfig, getAssistant_ConfigPropertyNames);
|
|
1508
|
+
// Invalid or incomplete config
|
|
1509
|
+
if (config === null) {
|
|
1510
|
+
return null;
|
|
1511
|
+
}
|
|
1512
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1513
|
+
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
|
|
1514
|
+
};
|
|
1515
|
+
const notifyChangeFactory$5 = (luvio, options) => {
|
|
1516
|
+
return function getAssistantPlatformByAssistantNameNotifyChange(configs) {
|
|
1517
|
+
const keys = configs.map(c => keyBuilder$i(luvio, c));
|
|
1518
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
1519
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
1520
|
+
const { key, record: val } = entries[i];
|
|
1521
|
+
const refreshRequest = createResourceRequestFromRepresentation$5(val);
|
|
1522
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
1523
|
+
.then((response) => {
|
|
1524
|
+
return luvio.handleSuccessResponse(() => {
|
|
1525
|
+
const { body } = response;
|
|
1526
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
1527
|
+
return luvio.storeBroadcast();
|
|
1528
|
+
}, () => {
|
|
1529
|
+
const cache = new StoreKeyMap();
|
|
1530
|
+
getTypeCacheKeys$6(cache, luvio, response.body);
|
|
1531
|
+
return cache;
|
|
1532
|
+
});
|
|
1533
|
+
}, (error) => {
|
|
1534
|
+
return luvio.handleErrorResponse(() => {
|
|
1535
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
1536
|
+
luvio.storeIngestError(key, errorSnapshot, undefined);
|
|
1537
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
1538
|
+
});
|
|
1539
|
+
});
|
|
1540
|
+
}
|
|
1541
|
+
});
|
|
1542
|
+
};
|
|
1543
|
+
};
|
|
1544
|
+
|
|
1545
|
+
const VERSION$a = "60c238eb770e68fa40b048eee3d01775";
|
|
1546
|
+
function validate$d(obj, path = 'LightningAssistantInfoRepresentation') {
|
|
1547
|
+
const v_error = (() => {
|
|
1548
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1549
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1550
|
+
}
|
|
1551
|
+
const obj_assistantTarget = obj.assistantTarget;
|
|
1552
|
+
const path_assistantTarget = path + '.assistantTarget';
|
|
1553
|
+
if (typeof obj_assistantTarget !== 'string') {
|
|
1554
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
|
|
1555
|
+
}
|
|
1556
|
+
if (obj.category !== undefined) {
|
|
1557
|
+
const obj_category = obj.category;
|
|
1558
|
+
const path_category = path + '.category';
|
|
1559
|
+
if (typeof obj_category !== 'string') {
|
|
1560
|
+
return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
if (obj.categoryName !== undefined) {
|
|
1564
|
+
const obj_categoryName = obj.categoryName;
|
|
1565
|
+
const path_categoryName = path + '.categoryName';
|
|
1566
|
+
if (typeof obj_categoryName !== 'string') {
|
|
1567
|
+
return new TypeError('Expected "string" but received "' + typeof obj_categoryName + '" (at "' + path_categoryName + '")');
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
const obj_contentVersion = obj.contentVersion;
|
|
1571
|
+
const path_contentVersion = path + '.contentVersion';
|
|
1572
|
+
if (typeof obj_contentVersion !== 'string') {
|
|
1573
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contentVersion + '" (at "' + path_contentVersion + '")');
|
|
1574
|
+
}
|
|
1575
|
+
const obj_debugModeEnabled = obj.debugModeEnabled;
|
|
1576
|
+
const path_debugModeEnabled = path + '.debugModeEnabled';
|
|
1577
|
+
if (typeof obj_debugModeEnabled !== 'boolean') {
|
|
1578
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_debugModeEnabled + '" (at "' + path_debugModeEnabled + '")');
|
|
1579
|
+
}
|
|
1580
|
+
const obj_description = obj.description;
|
|
1581
|
+
const path_description = path + '.description';
|
|
1582
|
+
if (typeof obj_description !== 'string') {
|
|
1583
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
1584
|
+
}
|
|
1585
|
+
const obj_developerName = obj.developerName;
|
|
1586
|
+
const path_developerName = path + '.developerName';
|
|
1587
|
+
if (typeof obj_developerName !== 'string') {
|
|
1588
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
1589
|
+
}
|
|
1590
|
+
const obj_icon = obj.icon;
|
|
1591
|
+
const path_icon = path + '.icon';
|
|
1592
|
+
if (typeof obj_icon !== 'string') {
|
|
1593
|
+
return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
|
|
1594
|
+
}
|
|
1595
|
+
const obj_isPreview = obj.isPreview;
|
|
1596
|
+
const path_isPreview = path + '.isPreview';
|
|
1597
|
+
if (typeof obj_isPreview !== 'boolean') {
|
|
1598
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isPreview + '" (at "' + path_isPreview + '")');
|
|
1599
|
+
}
|
|
1600
|
+
const obj_title = obj.title;
|
|
1601
|
+
const path_title = path + '.title';
|
|
1602
|
+
if (typeof obj_title !== 'string') {
|
|
1603
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
1604
|
+
}
|
|
1605
|
+
})();
|
|
1606
|
+
return v_error === undefined ? null : v_error;
|
|
1607
|
+
}
|
|
1608
|
+
const select$j = function LightningAssistantInfoRepresentationSelect() {
|
|
1609
|
+
return {
|
|
1610
|
+
kind: 'Fragment',
|
|
1611
|
+
version: VERSION$a,
|
|
1612
|
+
private: [],
|
|
1613
|
+
selections: [
|
|
1614
|
+
{
|
|
1615
|
+
name: 'assistantTarget',
|
|
1616
|
+
kind: 'Scalar'
|
|
1617
|
+
},
|
|
1618
|
+
{
|
|
1619
|
+
name: 'category',
|
|
1620
|
+
kind: 'Scalar',
|
|
1621
|
+
required: false
|
|
1622
|
+
},
|
|
1623
|
+
{
|
|
1624
|
+
name: 'categoryName',
|
|
1625
|
+
kind: 'Scalar',
|
|
1626
|
+
required: false
|
|
1627
|
+
},
|
|
1628
|
+
{
|
|
1629
|
+
name: 'contentVersion',
|
|
1630
|
+
kind: 'Scalar'
|
|
1631
|
+
},
|
|
1632
|
+
{
|
|
1633
|
+
name: 'debugModeEnabled',
|
|
1634
|
+
kind: 'Scalar'
|
|
1635
|
+
},
|
|
1636
|
+
{
|
|
1637
|
+
name: 'description',
|
|
1638
|
+
kind: 'Scalar'
|
|
1639
|
+
},
|
|
1640
|
+
{
|
|
1641
|
+
name: 'developerName',
|
|
1642
|
+
kind: 'Scalar'
|
|
1643
|
+
},
|
|
1644
|
+
{
|
|
1645
|
+
name: 'icon',
|
|
1646
|
+
kind: 'Scalar'
|
|
1647
|
+
},
|
|
1648
|
+
{
|
|
1649
|
+
name: 'isPreview',
|
|
1650
|
+
kind: 'Scalar'
|
|
1651
|
+
},
|
|
1652
|
+
{
|
|
1653
|
+
name: 'title',
|
|
1654
|
+
kind: 'Scalar'
|
|
1655
|
+
}
|
|
1656
|
+
]
|
|
1657
|
+
};
|
|
1658
|
+
};
|
|
1659
|
+
function equals$a(existing, incoming) {
|
|
1660
|
+
const existing_debugModeEnabled = existing.debugModeEnabled;
|
|
1661
|
+
const incoming_debugModeEnabled = incoming.debugModeEnabled;
|
|
1662
|
+
if (!(existing_debugModeEnabled === incoming_debugModeEnabled)) {
|
|
1663
|
+
return false;
|
|
1664
|
+
}
|
|
1665
|
+
const existing_isPreview = existing.isPreview;
|
|
1666
|
+
const incoming_isPreview = incoming.isPreview;
|
|
1667
|
+
if (!(existing_isPreview === incoming_isPreview)) {
|
|
1668
|
+
return false;
|
|
1669
|
+
}
|
|
1670
|
+
const existing_assistantTarget = existing.assistantTarget;
|
|
1671
|
+
const incoming_assistantTarget = incoming.assistantTarget;
|
|
1672
|
+
if (!(existing_assistantTarget === incoming_assistantTarget)) {
|
|
1673
|
+
return false;
|
|
1674
|
+
}
|
|
1675
|
+
const existing_category = existing.category;
|
|
1676
|
+
const incoming_category = incoming.category;
|
|
1677
|
+
// if at least one of these optionals is defined
|
|
1678
|
+
if (existing_category !== undefined || incoming_category !== undefined) {
|
|
1679
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1680
|
+
// not equal
|
|
1681
|
+
if (existing_category === undefined || incoming_category === undefined) {
|
|
1682
|
+
return false;
|
|
1683
|
+
}
|
|
1684
|
+
if (!(existing_category === incoming_category)) {
|
|
1685
|
+
return false;
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
const existing_categoryName = existing.categoryName;
|
|
1689
|
+
const incoming_categoryName = incoming.categoryName;
|
|
1690
|
+
// if at least one of these optionals is defined
|
|
1691
|
+
if (existing_categoryName !== undefined || incoming_categoryName !== undefined) {
|
|
1692
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1693
|
+
// not equal
|
|
1694
|
+
if (existing_categoryName === undefined || incoming_categoryName === undefined) {
|
|
1695
|
+
return false;
|
|
1696
|
+
}
|
|
1697
|
+
if (!(existing_categoryName === incoming_categoryName)) {
|
|
1698
|
+
return false;
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
const existing_contentVersion = existing.contentVersion;
|
|
1702
|
+
const incoming_contentVersion = incoming.contentVersion;
|
|
1703
|
+
if (!(existing_contentVersion === incoming_contentVersion)) {
|
|
1704
|
+
return false;
|
|
1705
|
+
}
|
|
1706
|
+
const existing_description = existing.description;
|
|
1707
|
+
const incoming_description = incoming.description;
|
|
1708
|
+
if (!(existing_description === incoming_description)) {
|
|
1709
|
+
return false;
|
|
1710
|
+
}
|
|
1711
|
+
const existing_developerName = existing.developerName;
|
|
1712
|
+
const incoming_developerName = incoming.developerName;
|
|
1713
|
+
if (!(existing_developerName === incoming_developerName)) {
|
|
1714
|
+
return false;
|
|
1715
|
+
}
|
|
1716
|
+
const existing_icon = existing.icon;
|
|
1717
|
+
const incoming_icon = incoming.icon;
|
|
1718
|
+
if (!(existing_icon === incoming_icon)) {
|
|
1719
|
+
return false;
|
|
1720
|
+
}
|
|
1721
|
+
const existing_title = existing.title;
|
|
1722
|
+
const incoming_title = incoming.title;
|
|
1723
|
+
if (!(existing_title === incoming_title)) {
|
|
1724
|
+
return false;
|
|
1725
|
+
}
|
|
1726
|
+
return true;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
const VERSION$9 = "d3f2957d23e995fb380f62e85e1d26ea";
|
|
1730
|
+
function validate$c(obj, path = 'LightningAssistantInfoListRepresentation') {
|
|
1731
|
+
const v_error = (() => {
|
|
1732
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1733
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1734
|
+
}
|
|
1735
|
+
const obj_assistantInfoList = obj.assistantInfoList;
|
|
1736
|
+
const path_assistantInfoList = path + '.assistantInfoList';
|
|
1737
|
+
if (!ArrayIsArray(obj_assistantInfoList)) {
|
|
1738
|
+
return new TypeError('Expected "array" but received "' + typeof obj_assistantInfoList + '" (at "' + path_assistantInfoList + '")');
|
|
1739
|
+
}
|
|
1740
|
+
for (let i = 0; i < obj_assistantInfoList.length; i++) {
|
|
1741
|
+
const obj_assistantInfoList_item = obj_assistantInfoList[i];
|
|
1742
|
+
const path_assistantInfoList_item = path_assistantInfoList + '[' + i + ']';
|
|
1743
|
+
const referencepath_assistantInfoList_itemValidationError = validate$d(obj_assistantInfoList_item, path_assistantInfoList_item);
|
|
1744
|
+
if (referencepath_assistantInfoList_itemValidationError !== null) {
|
|
1745
|
+
let message = 'Object doesn\'t match LightningAssistantInfoRepresentation (at "' + path_assistantInfoList_item + '")\n';
|
|
1746
|
+
message += referencepath_assistantInfoList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1747
|
+
return new TypeError(message);
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
const obj_assistantTarget = obj.assistantTarget;
|
|
1751
|
+
const path_assistantTarget = path + '.assistantTarget';
|
|
1752
|
+
if (typeof obj_assistantTarget !== 'string') {
|
|
1753
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
|
|
1754
|
+
}
|
|
1755
|
+
})();
|
|
1756
|
+
return v_error === undefined ? null : v_error;
|
|
1757
|
+
}
|
|
1758
|
+
const RepresentationType$5 = 'LightningAssistantInfoListRepresentation';
|
|
1759
|
+
function keyBuilder$f(luvio, config) {
|
|
1760
|
+
return keyPrefix + '::' + RepresentationType$5 + ':' + config.assistant_target;
|
|
1761
|
+
}
|
|
1762
|
+
function keyBuilderFromType$5(luvio, object) {
|
|
1763
|
+
const keyParams = {
|
|
1764
|
+
assistant_target: object.assistantTarget
|
|
1765
|
+
};
|
|
1766
|
+
return keyBuilder$f(luvio, keyParams);
|
|
1767
|
+
}
|
|
1768
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
1769
|
+
return input;
|
|
1770
|
+
}
|
|
1771
|
+
const select$i = function LightningAssistantInfoListRepresentationSelect() {
|
|
1772
|
+
const { selections: LightningAssistantInfoRepresentation__selections, opaque: LightningAssistantInfoRepresentation__opaque, } = select$j();
|
|
1773
|
+
return {
|
|
1774
|
+
kind: 'Fragment',
|
|
1775
|
+
version: VERSION$9,
|
|
1776
|
+
private: [],
|
|
1777
|
+
selections: [
|
|
1778
|
+
{
|
|
1779
|
+
name: 'assistantInfoList',
|
|
1780
|
+
kind: 'Object',
|
|
1781
|
+
plural: true,
|
|
1782
|
+
selections: LightningAssistantInfoRepresentation__selections
|
|
1783
|
+
},
|
|
1784
|
+
{
|
|
1785
|
+
name: 'assistantTarget',
|
|
1786
|
+
kind: 'Scalar'
|
|
1787
|
+
}
|
|
1788
|
+
]
|
|
1789
|
+
};
|
|
1790
|
+
};
|
|
1791
|
+
function equals$9(existing, incoming) {
|
|
1792
|
+
const existing_assistantTarget = existing.assistantTarget;
|
|
1793
|
+
const incoming_assistantTarget = incoming.assistantTarget;
|
|
1794
|
+
if (!(existing_assistantTarget === incoming_assistantTarget)) {
|
|
1795
|
+
return false;
|
|
1796
|
+
}
|
|
1797
|
+
const existing_assistantInfoList = existing.assistantInfoList;
|
|
1798
|
+
const incoming_assistantInfoList = incoming.assistantInfoList;
|
|
1799
|
+
const equals_assistantInfoList_items = equalsArray(existing_assistantInfoList, incoming_assistantInfoList, (existing_assistantInfoList_item, incoming_assistantInfoList_item) => {
|
|
1800
|
+
if (!(equals$a(existing_assistantInfoList_item, incoming_assistantInfoList_item))) {
|
|
1801
|
+
return false;
|
|
1802
|
+
}
|
|
1803
|
+
});
|
|
1804
|
+
if (equals_assistantInfoList_items === false) {
|
|
1805
|
+
return false;
|
|
1806
|
+
}
|
|
1807
|
+
return true;
|
|
1808
|
+
}
|
|
1809
|
+
const ingest$5 = function LightningAssistantInfoListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1810
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1811
|
+
const validateError = validate$c(input);
|
|
1812
|
+
if (validateError !== null) {
|
|
1813
|
+
throw validateError;
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
const key = keyBuilderFromType$5(luvio, input);
|
|
1817
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
1818
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "LEAP", VERSION$9, RepresentationType$5, equals$9);
|
|
1819
|
+
return createLink(key);
|
|
1820
|
+
};
|
|
1821
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
1822
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1823
|
+
const rootKey = keyBuilderFromType$5(luvio, input);
|
|
1824
|
+
rootKeySet.set(rootKey, {
|
|
1825
|
+
namespace: keyPrefix,
|
|
1826
|
+
representationName: RepresentationType$5,
|
|
1827
|
+
mergeable: false
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
function select$h(luvio, params) {
|
|
1832
|
+
return select$i();
|
|
1833
|
+
}
|
|
1834
|
+
function keyBuilder$e(luvio, params) {
|
|
1835
|
+
return keyBuilder$f(luvio, {
|
|
1836
|
+
assistant_target: params.urlParams.assistantTarget
|
|
1837
|
+
});
|
|
1838
|
+
}
|
|
1839
|
+
function getResponseCacheKeys$8(storeKeyMap, luvio, resourceParams, response) {
|
|
1840
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response);
|
|
1841
|
+
}
|
|
1842
|
+
function ingestSuccess$8(luvio, resourceParams, response, snapshotRefresh) {
|
|
1843
|
+
const { body } = response;
|
|
1844
|
+
const key = keyBuilder$e(luvio, resourceParams);
|
|
1845
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
1846
|
+
const snapshot = luvio.storeLookup({
|
|
1847
|
+
recordId: key,
|
|
1848
|
+
node: select$h(),
|
|
1849
|
+
variables: {},
|
|
1850
|
+
}, snapshotRefresh);
|
|
1851
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1852
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1853
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
deepFreeze(snapshot.data);
|
|
1857
|
+
return snapshot;
|
|
1858
|
+
}
|
|
1859
|
+
function ingestError$4(luvio, params, error, snapshotRefresh) {
|
|
1860
|
+
const key = keyBuilder$e(luvio, params);
|
|
1861
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1862
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
1863
|
+
return errorSnapshot;
|
|
1864
|
+
}
|
|
1865
|
+
function createResourceRequest$8(config) {
|
|
1866
|
+
const headers = {};
|
|
1867
|
+
return {
|
|
1868
|
+
baseUri: '/services/data/v66.0',
|
|
1869
|
+
basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/list/info',
|
|
1870
|
+
method: 'get',
|
|
1871
|
+
body: null,
|
|
1872
|
+
urlParams: config.urlParams,
|
|
1873
|
+
queryParams: {},
|
|
1874
|
+
headers,
|
|
1875
|
+
priority: 'normal',
|
|
1876
|
+
};
|
|
1877
|
+
}
|
|
1878
|
+
function createResourceRequestFromRepresentation$4(representation) {
|
|
1879
|
+
const config = {
|
|
1880
|
+
urlParams: {},
|
|
1881
|
+
};
|
|
1882
|
+
config.urlParams.assistantTarget = representation.assistantTarget;
|
|
1883
|
+
return createResourceRequest$8(config);
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
const adapterName$8 = 'getAssistantInfoList';
|
|
1887
|
+
const getAssistantInfoList_ConfigPropertyMetadata = [
|
|
1888
|
+
generateParamConfigMetadata('assistantTarget', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1889
|
+
];
|
|
1890
|
+
const getAssistantInfoList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$8, getAssistantInfoList_ConfigPropertyMetadata);
|
|
1891
|
+
const createResourceParams$8 = /*#__PURE__*/ createResourceParams$b(getAssistantInfoList_ConfigPropertyMetadata);
|
|
1892
|
+
function keyBuilder$d(luvio, config) {
|
|
1893
|
+
const resourceParams = createResourceParams$8(config);
|
|
1894
|
+
return keyBuilder$e(luvio, resourceParams);
|
|
1895
|
+
}
|
|
1896
|
+
function typeCheckConfig$8(untrustedConfig) {
|
|
1897
|
+
const config = {};
|
|
1898
|
+
typeCheckConfig$b(untrustedConfig, config, getAssistantInfoList_ConfigPropertyMetadata);
|
|
1899
|
+
return config;
|
|
1900
|
+
}
|
|
1901
|
+
function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
|
|
1902
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1903
|
+
return null;
|
|
1904
|
+
}
|
|
1905
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1906
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1907
|
+
}
|
|
1908
|
+
const config = typeCheckConfig$8(untrustedConfig);
|
|
1909
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1910
|
+
return null;
|
|
1911
|
+
}
|
|
1912
|
+
return config;
|
|
1913
|
+
}
|
|
1914
|
+
function adapterFragment$4(luvio, config) {
|
|
1915
|
+
createResourceParams$8(config);
|
|
1916
|
+
return select$h();
|
|
1917
|
+
}
|
|
1918
|
+
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
1919
|
+
const snapshot = ingestSuccess$8(luvio, resourceParams, response, {
|
|
1920
|
+
config,
|
|
1921
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
1922
|
+
});
|
|
1923
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1924
|
+
}
|
|
1925
|
+
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
1926
|
+
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
1927
|
+
config,
|
|
1928
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
1929
|
+
});
|
|
1930
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1931
|
+
}
|
|
1932
|
+
function buildNetworkSnapshot$8(luvio, config, options) {
|
|
1933
|
+
const resourceParams = createResourceParams$8(config);
|
|
1934
|
+
const request = createResourceRequest$8(resourceParams);
|
|
1935
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1936
|
+
.then((response) => {
|
|
1937
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
|
|
1938
|
+
const cache = new StoreKeyMap();
|
|
1939
|
+
getResponseCacheKeys$8(cache, luvio, resourceParams, response.body);
|
|
1940
|
+
return cache;
|
|
1941
|
+
});
|
|
1942
|
+
}, (response) => {
|
|
1943
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
1944
|
+
});
|
|
1945
|
+
}
|
|
1946
|
+
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
1947
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$8, undefined, false);
|
|
1948
|
+
}
|
|
1949
|
+
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
1950
|
+
const { luvio, config } = context;
|
|
1951
|
+
const selector = {
|
|
1952
|
+
recordId: keyBuilder$d(luvio, config),
|
|
1953
|
+
node: adapterFragment$4(luvio, config),
|
|
1954
|
+
variables: {},
|
|
1955
|
+
};
|
|
1956
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1957
|
+
config,
|
|
1958
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
1959
|
+
});
|
|
1960
|
+
return cacheSnapshot;
|
|
1961
|
+
}
|
|
1962
|
+
const getAssistantInfoListAdapterFactory = (luvio) => function LEAP__getAssistantInfoList(untrustedConfig, requestContext) {
|
|
1963
|
+
const config = validateAdapterConfig$8(untrustedConfig, getAssistantInfoList_ConfigPropertyNames);
|
|
1964
|
+
// Invalid or incomplete config
|
|
1965
|
+
if (config === null) {
|
|
1966
|
+
return null;
|
|
1967
|
+
}
|
|
1968
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1969
|
+
buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
|
|
1970
|
+
};
|
|
1971
|
+
const notifyChangeFactory$4 = (luvio, options) => {
|
|
1972
|
+
return function getAssistantPlatformListInfoByAssistantTargetNotifyChange(configs) {
|
|
1973
|
+
const keys = configs.map(c => keyBuilder$f(luvio, c));
|
|
1974
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
1975
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
1976
|
+
const { key, record: val } = entries[i];
|
|
1977
|
+
const refreshRequest = createResourceRequestFromRepresentation$4(val);
|
|
1978
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
1979
|
+
.then((response) => {
|
|
1980
|
+
return luvio.handleSuccessResponse(() => {
|
|
1981
|
+
const { body } = response;
|
|
1982
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
1983
|
+
return luvio.storeBroadcast();
|
|
1984
|
+
}, () => {
|
|
1985
|
+
const cache = new StoreKeyMap();
|
|
1986
|
+
getTypeCacheKeys$5(cache, luvio, response.body);
|
|
1987
|
+
return cache;
|
|
1988
|
+
});
|
|
1989
|
+
}, (error) => {
|
|
1990
|
+
return luvio.handleErrorResponse(() => {
|
|
1991
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
1992
|
+
luvio.storeIngestError(key, errorSnapshot, undefined);
|
|
1993
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
1994
|
+
});
|
|
1995
|
+
});
|
|
1996
|
+
}
|
|
1997
|
+
});
|
|
1998
|
+
};
|
|
1999
|
+
};
|
|
2000
|
+
|
|
2001
|
+
const VERSION$8 = "86eec990f47f496e2991fb9e5ccf0802";
|
|
2002
|
+
function validate$b(obj, path = 'LightningAssistantListRepresentation') {
|
|
2003
|
+
const v_error = (() => {
|
|
2004
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2005
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2006
|
+
}
|
|
2007
|
+
const obj_assistantList = obj.assistantList;
|
|
2008
|
+
const path_assistantList = path + '.assistantList';
|
|
2009
|
+
if (!ArrayIsArray(obj_assistantList)) {
|
|
2010
|
+
return new TypeError('Expected "array" but received "' + typeof obj_assistantList + '" (at "' + path_assistantList + '")');
|
|
2011
|
+
}
|
|
2012
|
+
for (let i = 0; i < obj_assistantList.length; i++) {
|
|
2013
|
+
const obj_assistantList_item = obj_assistantList[i];
|
|
2014
|
+
const path_assistantList_item = path_assistantList + '[' + i + ']';
|
|
2015
|
+
if (typeof obj_assistantList_item !== 'object' || Array.isArray(obj_assistantList_item)) {
|
|
2016
|
+
return new TypeError('Expected "object" but received "' + typeof obj_assistantList_item + '" (at "' + path_assistantList_item + '")');
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
const obj_assistantTarget = obj.assistantTarget;
|
|
2020
|
+
const path_assistantTarget = path + '.assistantTarget';
|
|
2021
|
+
if (typeof obj_assistantTarget !== 'string') {
|
|
2022
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
|
|
2023
|
+
}
|
|
2024
|
+
})();
|
|
2025
|
+
return v_error === undefined ? null : v_error;
|
|
2026
|
+
}
|
|
2027
|
+
const RepresentationType$4 = 'LightningAssistantListRepresentation';
|
|
2028
|
+
function keyBuilder$c(luvio, config) {
|
|
2029
|
+
return keyPrefix + '::' + RepresentationType$4 + ':' + config.assistant_target;
|
|
2030
|
+
}
|
|
2031
|
+
function keyBuilderFromType$4(luvio, object) {
|
|
2032
|
+
const keyParams = {
|
|
2033
|
+
assistant_target: object.assistantTarget
|
|
2034
|
+
};
|
|
2035
|
+
return keyBuilder$c(luvio, keyParams);
|
|
2036
|
+
}
|
|
2037
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
2038
|
+
const input_assistantList = input.assistantList;
|
|
2039
|
+
const input_assistantList_id = path.fullPath + '__assistantList';
|
|
2040
|
+
for (let i = 0; i < input_assistantList.length; i++) {
|
|
2041
|
+
const input_assistantList_item = input_assistantList[i];
|
|
2042
|
+
let input_assistantList_item_id = input_assistantList_id + '__' + i;
|
|
2043
|
+
input_assistantList[i] = ingest$6(input_assistantList_item, {
|
|
2044
|
+
fullPath: input_assistantList_item_id,
|
|
2045
|
+
propertyName: i,
|
|
2046
|
+
parent: {
|
|
2047
|
+
data: input,
|
|
2048
|
+
key: path.fullPath,
|
|
2049
|
+
existing: existing,
|
|
2050
|
+
},
|
|
2051
|
+
ttl: path.ttl
|
|
2052
|
+
}, luvio, store, timestamp);
|
|
2053
|
+
}
|
|
2054
|
+
return input;
|
|
2055
|
+
}
|
|
2056
|
+
const select$g = function LightningAssistantListRepresentationSelect() {
|
|
2057
|
+
return {
|
|
2058
|
+
kind: 'Fragment',
|
|
2059
|
+
version: VERSION$8,
|
|
2060
|
+
private: [],
|
|
2061
|
+
selections: [
|
|
2062
|
+
{
|
|
2063
|
+
name: 'assistantList',
|
|
2064
|
+
kind: 'Link',
|
|
2065
|
+
plural: true,
|
|
2066
|
+
fragment: select$l()
|
|
2067
|
+
},
|
|
2068
|
+
{
|
|
2069
|
+
name: 'assistantTarget',
|
|
2070
|
+
kind: 'Scalar'
|
|
2071
|
+
}
|
|
2072
|
+
]
|
|
2073
|
+
};
|
|
2074
|
+
};
|
|
2075
|
+
function equals$8(existing, incoming) {
|
|
2076
|
+
const existing_assistantTarget = existing.assistantTarget;
|
|
2077
|
+
const incoming_assistantTarget = incoming.assistantTarget;
|
|
2078
|
+
if (!(existing_assistantTarget === incoming_assistantTarget)) {
|
|
2079
|
+
return false;
|
|
2080
|
+
}
|
|
2081
|
+
const existing_assistantList = existing.assistantList;
|
|
2082
|
+
const incoming_assistantList = incoming.assistantList;
|
|
2083
|
+
const equals_assistantList_items = equalsArray(existing_assistantList, incoming_assistantList, (existing_assistantList_item, incoming_assistantList_item) => {
|
|
2084
|
+
if (!(existing_assistantList_item.__ref === incoming_assistantList_item.__ref)) {
|
|
2085
|
+
return false;
|
|
2086
|
+
}
|
|
2087
|
+
});
|
|
2088
|
+
if (equals_assistantList_items === false) {
|
|
2089
|
+
return false;
|
|
2090
|
+
}
|
|
2091
|
+
return true;
|
|
2092
|
+
}
|
|
2093
|
+
const ingest$4 = function LightningAssistantListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2094
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2095
|
+
const validateError = validate$b(input);
|
|
2096
|
+
if (validateError !== null) {
|
|
2097
|
+
throw validateError;
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
const key = keyBuilderFromType$4(luvio, input);
|
|
2101
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
2102
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "LEAP", VERSION$8, RepresentationType$4, equals$8);
|
|
2103
|
+
return createLink(key);
|
|
2104
|
+
};
|
|
2105
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
2106
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2107
|
+
const rootKey = keyBuilderFromType$4(luvio, input);
|
|
2108
|
+
rootKeySet.set(rootKey, {
|
|
2109
|
+
namespace: keyPrefix,
|
|
2110
|
+
representationName: RepresentationType$4,
|
|
2111
|
+
mergeable: false
|
|
2112
|
+
});
|
|
2113
|
+
const input_assistantList_length = input.assistantList.length;
|
|
2114
|
+
for (let i = 0; i < input_assistantList_length; i++) {
|
|
2115
|
+
getTypeCacheKeys$6(rootKeySet, luvio, input.assistantList[i]);
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
function select$f(luvio, params) {
|
|
2120
|
+
return select$g();
|
|
2121
|
+
}
|
|
2122
|
+
function keyBuilder$b(luvio, params) {
|
|
2123
|
+
return keyBuilder$c(luvio, {
|
|
2124
|
+
assistant_target: params.urlParams.assistantTarget
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2127
|
+
function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
|
|
2128
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response);
|
|
2129
|
+
}
|
|
2130
|
+
function ingestSuccess$7(luvio, resourceParams, response, snapshotRefresh) {
|
|
2131
|
+
const { body } = response;
|
|
2132
|
+
const key = keyBuilder$b(luvio, resourceParams);
|
|
2133
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
2134
|
+
const snapshot = luvio.storeLookup({
|
|
2135
|
+
recordId: key,
|
|
2136
|
+
node: select$f(),
|
|
2137
|
+
variables: {},
|
|
2138
|
+
}, snapshotRefresh);
|
|
2139
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2140
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2141
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
deepFreeze(snapshot.data);
|
|
2145
|
+
return snapshot;
|
|
2146
|
+
}
|
|
2147
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
2148
|
+
const key = keyBuilder$b(luvio, params);
|
|
2149
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2150
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
2151
|
+
return errorSnapshot;
|
|
2152
|
+
}
|
|
2153
|
+
function createResourceRequest$7(config) {
|
|
2154
|
+
const headers = {};
|
|
2155
|
+
return {
|
|
2156
|
+
baseUri: '/services/data/v66.0',
|
|
2157
|
+
basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/list',
|
|
2158
|
+
method: 'get',
|
|
2159
|
+
body: null,
|
|
2160
|
+
urlParams: config.urlParams,
|
|
2161
|
+
queryParams: {},
|
|
2162
|
+
headers,
|
|
2163
|
+
priority: 'normal',
|
|
2164
|
+
};
|
|
2165
|
+
}
|
|
2166
|
+
function createResourceRequestFromRepresentation$3(representation) {
|
|
2167
|
+
const config = {
|
|
2168
|
+
urlParams: {},
|
|
2169
|
+
};
|
|
2170
|
+
config.urlParams.assistantTarget = representation.assistantTarget;
|
|
2171
|
+
return createResourceRequest$7(config);
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
const adapterName$7 = 'getAssistantList';
|
|
2175
|
+
const getAssistantList_ConfigPropertyMetadata = [
|
|
2176
|
+
generateParamConfigMetadata('assistantTarget', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2177
|
+
];
|
|
2178
|
+
const getAssistantList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, getAssistantList_ConfigPropertyMetadata);
|
|
2179
|
+
const createResourceParams$7 = /*#__PURE__*/ createResourceParams$b(getAssistantList_ConfigPropertyMetadata);
|
|
2180
|
+
function keyBuilder$a(luvio, config) {
|
|
2181
|
+
const resourceParams = createResourceParams$7(config);
|
|
2182
|
+
return keyBuilder$b(luvio, resourceParams);
|
|
2183
|
+
}
|
|
2184
|
+
function typeCheckConfig$7(untrustedConfig) {
|
|
2185
|
+
const config = {};
|
|
2186
|
+
typeCheckConfig$b(untrustedConfig, config, getAssistantList_ConfigPropertyMetadata);
|
|
2187
|
+
return config;
|
|
2188
|
+
}
|
|
2189
|
+
function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
|
|
2190
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2191
|
+
return null;
|
|
2192
|
+
}
|
|
2193
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2194
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2195
|
+
}
|
|
2196
|
+
const config = typeCheckConfig$7(untrustedConfig);
|
|
2197
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2198
|
+
return null;
|
|
2199
|
+
}
|
|
2200
|
+
return config;
|
|
2201
|
+
}
|
|
2202
|
+
function adapterFragment$3(luvio, config) {
|
|
2203
|
+
createResourceParams$7(config);
|
|
2204
|
+
return select$f();
|
|
2205
|
+
}
|
|
2206
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
2207
|
+
const snapshot = ingestSuccess$7(luvio, resourceParams, response, {
|
|
2208
|
+
config,
|
|
2209
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
2210
|
+
});
|
|
2211
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2212
|
+
}
|
|
2213
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
2214
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
2215
|
+
config,
|
|
2216
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
2217
|
+
});
|
|
2218
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2219
|
+
}
|
|
2220
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
2221
|
+
const resourceParams = createResourceParams$7(config);
|
|
2222
|
+
const request = createResourceRequest$7(resourceParams);
|
|
2223
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2224
|
+
.then((response) => {
|
|
2225
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
2226
|
+
const cache = new StoreKeyMap();
|
|
2227
|
+
getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
|
|
2228
|
+
return cache;
|
|
2229
|
+
});
|
|
2230
|
+
}, (response) => {
|
|
2231
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
2232
|
+
});
|
|
2233
|
+
}
|
|
2234
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
2235
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$7, undefined, false);
|
|
2236
|
+
}
|
|
2237
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
2238
|
+
const { luvio, config } = context;
|
|
2239
|
+
const selector = {
|
|
2240
|
+
recordId: keyBuilder$a(luvio, config),
|
|
2241
|
+
node: adapterFragment$3(luvio, config),
|
|
2242
|
+
variables: {},
|
|
2243
|
+
};
|
|
2244
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2245
|
+
config,
|
|
2246
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
2247
|
+
});
|
|
2248
|
+
return cacheSnapshot;
|
|
2249
|
+
}
|
|
2250
|
+
const getAssistantListAdapterFactory = (luvio) => function LEAP__getAssistantList(untrustedConfig, requestContext) {
|
|
2251
|
+
const config = validateAdapterConfig$7(untrustedConfig, getAssistantList_ConfigPropertyNames);
|
|
2252
|
+
// Invalid or incomplete config
|
|
2253
|
+
if (config === null) {
|
|
2254
|
+
return null;
|
|
2255
|
+
}
|
|
2256
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2257
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
2258
|
+
};
|
|
2259
|
+
const notifyChangeFactory$3 = (luvio, options) => {
|
|
2260
|
+
return function getAssistantPlatformListByAssistantTargetNotifyChange(configs) {
|
|
2261
|
+
const keys = configs.map(c => keyBuilder$c(luvio, c));
|
|
2262
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
2263
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
2264
|
+
const { key, record: val } = entries[i];
|
|
2265
|
+
const refreshRequest = createResourceRequestFromRepresentation$3(val);
|
|
2266
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
2267
|
+
.then((response) => {
|
|
2268
|
+
return luvio.handleSuccessResponse(() => {
|
|
2269
|
+
const { body } = response;
|
|
2270
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
2271
|
+
return luvio.storeBroadcast();
|
|
2272
|
+
}, () => {
|
|
2273
|
+
const cache = new StoreKeyMap();
|
|
2274
|
+
getTypeCacheKeys$4(cache, luvio, response.body);
|
|
2275
|
+
return cache;
|
|
2276
|
+
});
|
|
2277
|
+
}, (error) => {
|
|
2278
|
+
return luvio.handleErrorResponse(() => {
|
|
2279
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
2280
|
+
luvio.storeIngestError(key, errorSnapshot, undefined);
|
|
2281
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
2282
|
+
});
|
|
2283
|
+
});
|
|
2284
|
+
}
|
|
2285
|
+
});
|
|
2286
|
+
};
|
|
2287
|
+
};
|
|
2288
|
+
|
|
2289
|
+
const VERSION$7 = "107898f86df2248eab831be29f7e7205";
|
|
2290
|
+
function validate$a(obj, path = 'LightningAssistantCategoryRepresentation') {
|
|
2291
|
+
const v_error = (() => {
|
|
2292
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2293
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2294
|
+
}
|
|
2295
|
+
const obj_developerName = obj.developerName;
|
|
2296
|
+
const path_developerName = path + '.developerName';
|
|
2297
|
+
if (typeof obj_developerName !== 'string') {
|
|
2298
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
2299
|
+
}
|
|
2300
|
+
const obj_recommended = obj.recommended;
|
|
2301
|
+
const path_recommended = path + '.recommended';
|
|
2302
|
+
if (typeof obj_recommended !== 'boolean') {
|
|
2303
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_recommended + '" (at "' + path_recommended + '")');
|
|
2304
|
+
}
|
|
2305
|
+
const obj_title = obj.title;
|
|
2306
|
+
const path_title = path + '.title';
|
|
2307
|
+
if (typeof obj_title !== 'string') {
|
|
2308
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
2309
|
+
}
|
|
2310
|
+
})();
|
|
2311
|
+
return v_error === undefined ? null : v_error;
|
|
2312
|
+
}
|
|
2313
|
+
const select$e = function LightningAssistantCategoryRepresentationSelect() {
|
|
2314
|
+
return {
|
|
2315
|
+
kind: 'Fragment',
|
|
2316
|
+
version: VERSION$7,
|
|
2317
|
+
private: [],
|
|
2318
|
+
selections: [
|
|
2319
|
+
{
|
|
2320
|
+
name: 'developerName',
|
|
2321
|
+
kind: 'Scalar'
|
|
2322
|
+
},
|
|
2323
|
+
{
|
|
2324
|
+
name: 'recommended',
|
|
2325
|
+
kind: 'Scalar'
|
|
2326
|
+
},
|
|
2327
|
+
{
|
|
2328
|
+
name: 'title',
|
|
2329
|
+
kind: 'Scalar'
|
|
2330
|
+
}
|
|
2331
|
+
]
|
|
2332
|
+
};
|
|
2333
|
+
};
|
|
2334
|
+
function equals$7(existing, incoming) {
|
|
2335
|
+
const existing_recommended = existing.recommended;
|
|
2336
|
+
const incoming_recommended = incoming.recommended;
|
|
2337
|
+
if (!(existing_recommended === incoming_recommended)) {
|
|
2338
|
+
return false;
|
|
2339
|
+
}
|
|
2340
|
+
const existing_developerName = existing.developerName;
|
|
2341
|
+
const incoming_developerName = incoming.developerName;
|
|
2342
|
+
if (!(existing_developerName === incoming_developerName)) {
|
|
2343
|
+
return false;
|
|
2344
|
+
}
|
|
2345
|
+
const existing_title = existing.title;
|
|
2346
|
+
const incoming_title = incoming.title;
|
|
2347
|
+
if (!(existing_title === incoming_title)) {
|
|
2348
|
+
return false;
|
|
2349
|
+
}
|
|
2350
|
+
return true;
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2353
|
+
const VERSION$6 = "f629b70d652ad385840baede1ec16739";
|
|
2354
|
+
function validate$9(obj, path = 'LightningAssistantTargetRepresentation') {
|
|
2355
|
+
const v_error = (() => {
|
|
2356
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2357
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2358
|
+
}
|
|
2359
|
+
const obj_categoryList = obj.categoryList;
|
|
2360
|
+
const path_categoryList = path + '.categoryList';
|
|
2361
|
+
if (!ArrayIsArray(obj_categoryList)) {
|
|
2362
|
+
return new TypeError('Expected "array" but received "' + typeof obj_categoryList + '" (at "' + path_categoryList + '")');
|
|
2363
|
+
}
|
|
2364
|
+
for (let i = 0; i < obj_categoryList.length; i++) {
|
|
2365
|
+
const obj_categoryList_item = obj_categoryList[i];
|
|
2366
|
+
const path_categoryList_item = path_categoryList + '[' + i + ']';
|
|
2367
|
+
const referencepath_categoryList_itemValidationError = validate$a(obj_categoryList_item, path_categoryList_item);
|
|
2368
|
+
if (referencepath_categoryList_itemValidationError !== null) {
|
|
2369
|
+
let message = 'Object doesn\'t match LightningAssistantCategoryRepresentation (at "' + path_categoryList_item + '")\n';
|
|
2370
|
+
message += referencepath_categoryList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2371
|
+
return new TypeError(message);
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
const obj_developerName = obj.developerName;
|
|
2375
|
+
const path_developerName = path + '.developerName';
|
|
2376
|
+
if (typeof obj_developerName !== 'string') {
|
|
2377
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
2378
|
+
}
|
|
2379
|
+
})();
|
|
2380
|
+
return v_error === undefined ? null : v_error;
|
|
2381
|
+
}
|
|
2382
|
+
const RepresentationType$3 = 'LightningAssistantTargetRepresentation';
|
|
2383
|
+
function keyBuilder$9(luvio, config) {
|
|
2384
|
+
return keyPrefix + '::' + RepresentationType$3 + ':' + config.assistant_target;
|
|
2385
|
+
}
|
|
2386
|
+
function keyBuilderFromType$3(luvio, object) {
|
|
2387
|
+
const keyParams = {
|
|
2388
|
+
assistant_target: object.developerName
|
|
2389
|
+
};
|
|
2390
|
+
return keyBuilder$9(luvio, keyParams);
|
|
2391
|
+
}
|
|
2392
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
2393
|
+
return input;
|
|
2394
|
+
}
|
|
2395
|
+
const select$d = function LightningAssistantTargetRepresentationSelect() {
|
|
2396
|
+
const { selections: LightningAssistantCategoryRepresentation__selections, opaque: LightningAssistantCategoryRepresentation__opaque, } = select$e();
|
|
2397
|
+
return {
|
|
2398
|
+
kind: 'Fragment',
|
|
2399
|
+
version: VERSION$6,
|
|
2400
|
+
private: [],
|
|
2401
|
+
selections: [
|
|
2402
|
+
{
|
|
2403
|
+
name: 'categoryList',
|
|
2404
|
+
kind: 'Object',
|
|
2405
|
+
plural: true,
|
|
2406
|
+
selections: LightningAssistantCategoryRepresentation__selections
|
|
2407
|
+
},
|
|
2408
|
+
{
|
|
2409
|
+
name: 'developerName',
|
|
2410
|
+
kind: 'Scalar'
|
|
2411
|
+
}
|
|
2412
|
+
]
|
|
2413
|
+
};
|
|
2414
|
+
};
|
|
2415
|
+
function equals$6(existing, incoming) {
|
|
2416
|
+
const existing_developerName = existing.developerName;
|
|
2417
|
+
const incoming_developerName = incoming.developerName;
|
|
2418
|
+
if (!(existing_developerName === incoming_developerName)) {
|
|
2419
|
+
return false;
|
|
2420
|
+
}
|
|
2421
|
+
const existing_categoryList = existing.categoryList;
|
|
2422
|
+
const incoming_categoryList = incoming.categoryList;
|
|
2423
|
+
const equals_categoryList_items = equalsArray(existing_categoryList, incoming_categoryList, (existing_categoryList_item, incoming_categoryList_item) => {
|
|
2424
|
+
if (!(equals$7(existing_categoryList_item, incoming_categoryList_item))) {
|
|
2425
|
+
return false;
|
|
2426
|
+
}
|
|
2427
|
+
});
|
|
2428
|
+
if (equals_categoryList_items === false) {
|
|
2429
|
+
return false;
|
|
2430
|
+
}
|
|
2431
|
+
return true;
|
|
2432
|
+
}
|
|
2433
|
+
const ingest$3 = function LightningAssistantTargetRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2434
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2435
|
+
const validateError = validate$9(input);
|
|
2436
|
+
if (validateError !== null) {
|
|
2437
|
+
throw validateError;
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
const key = keyBuilderFromType$3(luvio, input);
|
|
2441
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
2442
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "LEAP", VERSION$6, RepresentationType$3, equals$6);
|
|
2443
|
+
return createLink(key);
|
|
2444
|
+
};
|
|
2445
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
2446
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2447
|
+
const rootKey = keyBuilderFromType$3(luvio, input);
|
|
2448
|
+
rootKeySet.set(rootKey, {
|
|
2449
|
+
namespace: keyPrefix,
|
|
2450
|
+
representationName: RepresentationType$3,
|
|
2451
|
+
mergeable: false
|
|
2452
|
+
});
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
function select$c(luvio, params) {
|
|
2456
|
+
return select$d();
|
|
2457
|
+
}
|
|
2458
|
+
function keyBuilder$8(luvio, params) {
|
|
2459
|
+
return keyBuilder$9(luvio, {
|
|
2460
|
+
assistant_target: params.urlParams.assistantTarget
|
|
2461
|
+
});
|
|
2462
|
+
}
|
|
2463
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
2464
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
2465
|
+
}
|
|
2466
|
+
function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
2467
|
+
const { body } = response;
|
|
2468
|
+
const key = keyBuilder$8(luvio, resourceParams);
|
|
2469
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
2470
|
+
const snapshot = luvio.storeLookup({
|
|
2471
|
+
recordId: key,
|
|
2472
|
+
node: select$c(),
|
|
2473
|
+
variables: {},
|
|
2474
|
+
}, snapshotRefresh);
|
|
2475
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2476
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2477
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
deepFreeze(snapshot.data);
|
|
2481
|
+
return snapshot;
|
|
2482
|
+
}
|
|
2483
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
2484
|
+
const key = keyBuilder$8(luvio, params);
|
|
2485
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2486
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
2487
|
+
return errorSnapshot;
|
|
2488
|
+
}
|
|
2489
|
+
function createResourceRequest$6(config) {
|
|
2490
|
+
const headers = {};
|
|
2491
|
+
return {
|
|
2492
|
+
baseUri: '/services/data/v66.0',
|
|
2493
|
+
basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/info',
|
|
2494
|
+
method: 'get',
|
|
2495
|
+
body: null,
|
|
2496
|
+
urlParams: config.urlParams,
|
|
2497
|
+
queryParams: {},
|
|
2498
|
+
headers,
|
|
2499
|
+
priority: 'normal',
|
|
2500
|
+
};
|
|
2501
|
+
}
|
|
2502
|
+
function createResourceRequestFromRepresentation$2(representation) {
|
|
2503
|
+
const config = {
|
|
2504
|
+
urlParams: {},
|
|
2505
|
+
};
|
|
2506
|
+
config.urlParams.assistantTarget = representation.developerName;
|
|
2507
|
+
return createResourceRequest$6(config);
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2510
|
+
const adapterName$6 = 'getAssistantTarget';
|
|
2511
|
+
const getAssistantTarget_ConfigPropertyMetadata = [
|
|
2512
|
+
generateParamConfigMetadata('assistantTarget', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2513
|
+
];
|
|
2514
|
+
const getAssistantTarget_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getAssistantTarget_ConfigPropertyMetadata);
|
|
2515
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$b(getAssistantTarget_ConfigPropertyMetadata);
|
|
2516
|
+
function keyBuilder$7(luvio, config) {
|
|
2517
|
+
const resourceParams = createResourceParams$6(config);
|
|
2518
|
+
return keyBuilder$8(luvio, resourceParams);
|
|
2519
|
+
}
|
|
2520
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
2521
|
+
const config = {};
|
|
2522
|
+
typeCheckConfig$b(untrustedConfig, config, getAssistantTarget_ConfigPropertyMetadata);
|
|
2523
|
+
return config;
|
|
2524
|
+
}
|
|
2525
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
2526
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2527
|
+
return null;
|
|
2528
|
+
}
|
|
2529
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2530
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2531
|
+
}
|
|
2532
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
2533
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2534
|
+
return null;
|
|
2535
|
+
}
|
|
2536
|
+
return config;
|
|
2537
|
+
}
|
|
2538
|
+
function adapterFragment$2(luvio, config) {
|
|
2539
|
+
createResourceParams$6(config);
|
|
2540
|
+
return select$c();
|
|
2541
|
+
}
|
|
2542
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
2543
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
|
|
2544
|
+
config,
|
|
2545
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
2546
|
+
});
|
|
2547
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2548
|
+
}
|
|
2549
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
2550
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
2551
|
+
config,
|
|
2552
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
2553
|
+
});
|
|
2554
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2555
|
+
}
|
|
2556
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
2557
|
+
const resourceParams = createResourceParams$6(config);
|
|
2558
|
+
const request = createResourceRequest$6(resourceParams);
|
|
2559
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2560
|
+
.then((response) => {
|
|
2561
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
2562
|
+
const cache = new StoreKeyMap();
|
|
2563
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
2564
|
+
return cache;
|
|
2565
|
+
});
|
|
2566
|
+
}, (response) => {
|
|
2567
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
2568
|
+
});
|
|
2569
|
+
}
|
|
2570
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
2571
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
|
|
2572
|
+
}
|
|
2573
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
2574
|
+
const { luvio, config } = context;
|
|
2575
|
+
const selector = {
|
|
2576
|
+
recordId: keyBuilder$7(luvio, config),
|
|
2577
|
+
node: adapterFragment$2(luvio, config),
|
|
2578
|
+
variables: {},
|
|
2579
|
+
};
|
|
2580
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2581
|
+
config,
|
|
2582
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
2583
|
+
});
|
|
2584
|
+
return cacheSnapshot;
|
|
2585
|
+
}
|
|
2586
|
+
const getAssistantTargetAdapterFactory = (luvio) => function LEAP__getAssistantTarget(untrustedConfig, requestContext) {
|
|
2587
|
+
const config = validateAdapterConfig$6(untrustedConfig, getAssistantTarget_ConfigPropertyNames);
|
|
2588
|
+
// Invalid or incomplete config
|
|
2589
|
+
if (config === null) {
|
|
2590
|
+
return null;
|
|
2591
|
+
}
|
|
2592
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2593
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
2594
|
+
};
|
|
2595
|
+
const notifyChangeFactory$2 = (luvio, options) => {
|
|
2596
|
+
return function getAssistantPlatformInfoByAssistantTargetNotifyChange(configs) {
|
|
2597
|
+
const keys = configs.map(c => keyBuilder$9(luvio, c));
|
|
2598
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
2599
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
2600
|
+
const { key, record: val } = entries[i];
|
|
2601
|
+
const refreshRequest = createResourceRequestFromRepresentation$2(val);
|
|
2602
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
2603
|
+
.then((response) => {
|
|
2604
|
+
return luvio.handleSuccessResponse(() => {
|
|
2605
|
+
const { body } = response;
|
|
2606
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
2607
|
+
return luvio.storeBroadcast();
|
|
2608
|
+
}, () => {
|
|
2609
|
+
const cache = new StoreKeyMap();
|
|
2610
|
+
getTypeCacheKeys$3(cache, luvio, response.body);
|
|
2611
|
+
return cache;
|
|
2612
|
+
});
|
|
2613
|
+
}, (error) => {
|
|
2614
|
+
return luvio.handleErrorResponse(() => {
|
|
2615
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
2616
|
+
luvio.storeIngestError(key, errorSnapshot, undefined);
|
|
2617
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
2618
|
+
});
|
|
2619
|
+
});
|
|
2620
|
+
}
|
|
2621
|
+
});
|
|
2622
|
+
};
|
|
2623
|
+
};
|
|
2624
|
+
|
|
2625
|
+
const VERSION$5 = "fec1ea773d37039808d8d9e4e4d7c085";
|
|
2626
|
+
function validate$8(obj, path = 'LightningAssistantChoiceRepresentation') {
|
|
2627
|
+
const v_error = (() => {
|
|
2628
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2629
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2630
|
+
}
|
|
2631
|
+
if (obj.description !== undefined) {
|
|
2632
|
+
const obj_description = obj.description;
|
|
2633
|
+
const path_description = path + '.description';
|
|
2634
|
+
if (typeof obj_description !== 'string') {
|
|
2635
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
2636
|
+
}
|
|
2637
|
+
}
|
|
2638
|
+
const obj_developerName = obj.developerName;
|
|
2639
|
+
const path_developerName = path + '.developerName';
|
|
2640
|
+
if (typeof obj_developerName !== 'string') {
|
|
2641
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
2642
|
+
}
|
|
2643
|
+
const obj_next = obj.next;
|
|
2644
|
+
const path_next = path + '.next';
|
|
2645
|
+
if (typeof obj_next !== 'string') {
|
|
2646
|
+
return new TypeError('Expected "string" but received "' + typeof obj_next + '" (at "' + path_next + '")');
|
|
2647
|
+
}
|
|
2648
|
+
const obj_title = obj.title;
|
|
2649
|
+
const path_title = path + '.title';
|
|
2650
|
+
if (typeof obj_title !== 'string') {
|
|
2651
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
2652
|
+
}
|
|
2653
|
+
})();
|
|
2654
|
+
return v_error === undefined ? null : v_error;
|
|
2655
|
+
}
|
|
2656
|
+
const select$b = function LightningAssistantChoiceRepresentationSelect() {
|
|
2657
|
+
return {
|
|
2658
|
+
kind: 'Fragment',
|
|
2659
|
+
version: VERSION$5,
|
|
2660
|
+
private: [],
|
|
2661
|
+
selections: [
|
|
2662
|
+
{
|
|
2663
|
+
name: 'description',
|
|
2664
|
+
kind: 'Scalar',
|
|
2665
|
+
required: false
|
|
2666
|
+
},
|
|
2667
|
+
{
|
|
2668
|
+
name: 'developerName',
|
|
2669
|
+
kind: 'Scalar'
|
|
2670
|
+
},
|
|
2671
|
+
{
|
|
2672
|
+
name: 'next',
|
|
2673
|
+
kind: 'Scalar'
|
|
2674
|
+
},
|
|
2675
|
+
{
|
|
2676
|
+
name: 'title',
|
|
2677
|
+
kind: 'Scalar'
|
|
2678
|
+
}
|
|
2679
|
+
]
|
|
2680
|
+
};
|
|
2681
|
+
};
|
|
2682
|
+
function equals$5(existing, incoming) {
|
|
2683
|
+
const existing_description = existing.description;
|
|
2684
|
+
const incoming_description = incoming.description;
|
|
2685
|
+
// if at least one of these optionals is defined
|
|
2686
|
+
if (existing_description !== undefined || incoming_description !== undefined) {
|
|
2687
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2688
|
+
// not equal
|
|
2689
|
+
if (existing_description === undefined || incoming_description === undefined) {
|
|
2690
|
+
return false;
|
|
2691
|
+
}
|
|
2692
|
+
if (!(existing_description === incoming_description)) {
|
|
2693
|
+
return false;
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2696
|
+
const existing_developerName = existing.developerName;
|
|
2697
|
+
const incoming_developerName = incoming.developerName;
|
|
2698
|
+
if (!(existing_developerName === incoming_developerName)) {
|
|
2699
|
+
return false;
|
|
2700
|
+
}
|
|
2701
|
+
const existing_next = existing.next;
|
|
2702
|
+
const incoming_next = incoming.next;
|
|
2703
|
+
if (!(existing_next === incoming_next)) {
|
|
2704
|
+
return false;
|
|
2705
|
+
}
|
|
2706
|
+
const existing_title = existing.title;
|
|
2707
|
+
const incoming_title = incoming.title;
|
|
2708
|
+
if (!(existing_title === incoming_title)) {
|
|
2709
|
+
return false;
|
|
2710
|
+
}
|
|
2711
|
+
return true;
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2714
|
+
const VERSION$4 = "545ec40aff7b3db184e84760ae732370";
|
|
2715
|
+
function validate$7(obj, path = 'LightningAssistantLinkRepresentation') {
|
|
2716
|
+
const v_error = (() => {
|
|
2717
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2718
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2719
|
+
}
|
|
2720
|
+
const obj_label = obj.label;
|
|
2721
|
+
const path_label = path + '.label';
|
|
2722
|
+
if (typeof obj_label !== 'string') {
|
|
2723
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
2724
|
+
}
|
|
2725
|
+
const obj_url = obj.url;
|
|
2726
|
+
const path_url = path + '.url';
|
|
2727
|
+
if (typeof obj_url !== 'string') {
|
|
2728
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
2729
|
+
}
|
|
2730
|
+
})();
|
|
2731
|
+
return v_error === undefined ? null : v_error;
|
|
2732
|
+
}
|
|
2733
|
+
const select$a = function LightningAssistantLinkRepresentationSelect() {
|
|
2734
|
+
return {
|
|
2735
|
+
kind: 'Fragment',
|
|
2736
|
+
version: VERSION$4,
|
|
2737
|
+
private: [],
|
|
2738
|
+
selections: [
|
|
2739
|
+
{
|
|
2740
|
+
name: 'label',
|
|
2741
|
+
kind: 'Scalar'
|
|
2742
|
+
},
|
|
2743
|
+
{
|
|
2744
|
+
name: 'url',
|
|
2745
|
+
kind: 'Scalar'
|
|
2746
|
+
}
|
|
2747
|
+
]
|
|
2748
|
+
};
|
|
2749
|
+
};
|
|
2750
|
+
function equals$4(existing, incoming) {
|
|
2751
|
+
const existing_label = existing.label;
|
|
2752
|
+
const incoming_label = incoming.label;
|
|
2753
|
+
if (!(existing_label === incoming_label)) {
|
|
2754
|
+
return false;
|
|
2755
|
+
}
|
|
2756
|
+
const existing_url = existing.url;
|
|
2757
|
+
const incoming_url = incoming.url;
|
|
2758
|
+
if (!(existing_url === incoming_url)) {
|
|
2759
|
+
return false;
|
|
2760
|
+
}
|
|
2761
|
+
return true;
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
const VERSION$3 = "33d491734169be0180f670c757b53a34";
|
|
2765
|
+
function validate$6(obj, path = 'LightningAssistantQuestionRepresentation') {
|
|
2766
|
+
const v_error = (() => {
|
|
2767
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2768
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2769
|
+
}
|
|
2770
|
+
const obj_choices = obj.choices;
|
|
2771
|
+
const path_choices = path + '.choices';
|
|
2772
|
+
if (!ArrayIsArray(obj_choices)) {
|
|
2773
|
+
return new TypeError('Expected "array" but received "' + typeof obj_choices + '" (at "' + path_choices + '")');
|
|
2774
|
+
}
|
|
2775
|
+
for (let i = 0; i < obj_choices.length; i++) {
|
|
2776
|
+
const obj_choices_item = obj_choices[i];
|
|
2777
|
+
const path_choices_item = path_choices + '[' + i + ']';
|
|
2778
|
+
const referencepath_choices_itemValidationError = validate$8(obj_choices_item, path_choices_item);
|
|
2779
|
+
if (referencepath_choices_itemValidationError !== null) {
|
|
2780
|
+
let message = 'Object doesn\'t match LightningAssistantChoiceRepresentation (at "' + path_choices_item + '")\n';
|
|
2781
|
+
message += referencepath_choices_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2782
|
+
return new TypeError(message);
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
if (obj.description !== undefined) {
|
|
2786
|
+
const obj_description = obj.description;
|
|
2787
|
+
const path_description = path + '.description';
|
|
2788
|
+
if (typeof obj_description !== 'string') {
|
|
2789
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
const obj_developerName = obj.developerName;
|
|
2793
|
+
const path_developerName = path + '.developerName';
|
|
2794
|
+
if (typeof obj_developerName !== 'string') {
|
|
2795
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
2796
|
+
}
|
|
2797
|
+
if (obj.link !== undefined) {
|
|
2798
|
+
const obj_link = obj.link;
|
|
2799
|
+
const path_link = path + '.link';
|
|
2800
|
+
let obj_link_union0 = null;
|
|
2801
|
+
const obj_link_union0_error = (() => {
|
|
2802
|
+
const referencepath_linkValidationError = validate$7(obj_link, path_link);
|
|
2803
|
+
if (referencepath_linkValidationError !== null) {
|
|
2804
|
+
let message = 'Object doesn\'t match LightningAssistantLinkRepresentation (at "' + path_link + '")\n';
|
|
2805
|
+
message += referencepath_linkValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2806
|
+
return new TypeError(message);
|
|
2807
|
+
}
|
|
2808
|
+
})();
|
|
2809
|
+
if (obj_link_union0_error != null) {
|
|
2810
|
+
obj_link_union0 = obj_link_union0_error.message;
|
|
2811
|
+
}
|
|
2812
|
+
let obj_link_union1 = null;
|
|
2813
|
+
const obj_link_union1_error = (() => {
|
|
2814
|
+
if (obj_link !== null) {
|
|
2815
|
+
return new TypeError('Expected "null" but received "' + typeof obj_link + '" (at "' + path_link + '")');
|
|
2816
|
+
}
|
|
2817
|
+
})();
|
|
2818
|
+
if (obj_link_union1_error != null) {
|
|
2819
|
+
obj_link_union1 = obj_link_union1_error.message;
|
|
2820
|
+
}
|
|
2821
|
+
if (obj_link_union0 && obj_link_union1) {
|
|
2822
|
+
let message = 'Object doesn\'t match union (at "' + path_link + '")';
|
|
2823
|
+
message += '\n' + obj_link_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2824
|
+
message += '\n' + obj_link_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2825
|
+
return new TypeError(message);
|
|
2826
|
+
}
|
|
2827
|
+
}
|
|
2828
|
+
const obj_title = obj.title;
|
|
2829
|
+
const path_title = path + '.title';
|
|
2830
|
+
if (typeof obj_title !== 'string') {
|
|
2831
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
2832
|
+
}
|
|
2833
|
+
})();
|
|
2834
|
+
return v_error === undefined ? null : v_error;
|
|
2835
|
+
}
|
|
2836
|
+
const select$9 = function LightningAssistantQuestionRepresentationSelect() {
|
|
2837
|
+
const { selections: LightningAssistantChoiceRepresentation__selections, opaque: LightningAssistantChoiceRepresentation__opaque, } = select$b();
|
|
2838
|
+
const { selections: LightningAssistantLinkRepresentation__selections, opaque: LightningAssistantLinkRepresentation__opaque, } = select$a();
|
|
2839
|
+
return {
|
|
2840
|
+
kind: 'Fragment',
|
|
2841
|
+
version: VERSION$3,
|
|
2842
|
+
private: [],
|
|
2843
|
+
selections: [
|
|
2844
|
+
{
|
|
2845
|
+
name: 'choices',
|
|
2846
|
+
kind: 'Object',
|
|
2847
|
+
plural: true,
|
|
2848
|
+
selections: LightningAssistantChoiceRepresentation__selections
|
|
2849
|
+
},
|
|
2850
|
+
{
|
|
2851
|
+
name: 'description',
|
|
2852
|
+
kind: 'Scalar',
|
|
2853
|
+
required: false
|
|
2854
|
+
},
|
|
2855
|
+
{
|
|
2856
|
+
name: 'developerName',
|
|
2857
|
+
kind: 'Scalar'
|
|
2858
|
+
},
|
|
2859
|
+
{
|
|
2860
|
+
name: 'link',
|
|
2861
|
+
kind: 'Object',
|
|
2862
|
+
nullable: true,
|
|
2863
|
+
selections: LightningAssistantLinkRepresentation__selections,
|
|
2864
|
+
required: false
|
|
2865
|
+
},
|
|
2866
|
+
{
|
|
2867
|
+
name: 'title',
|
|
2868
|
+
kind: 'Scalar'
|
|
2869
|
+
}
|
|
2870
|
+
]
|
|
2871
|
+
};
|
|
2872
|
+
};
|
|
2873
|
+
function equals$3(existing, incoming) {
|
|
2874
|
+
const existing_description = existing.description;
|
|
2875
|
+
const incoming_description = incoming.description;
|
|
2876
|
+
// if at least one of these optionals is defined
|
|
2877
|
+
if (existing_description !== undefined || incoming_description !== undefined) {
|
|
2878
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2879
|
+
// not equal
|
|
2880
|
+
if (existing_description === undefined || incoming_description === undefined) {
|
|
2881
|
+
return false;
|
|
2882
|
+
}
|
|
2883
|
+
if (!(existing_description === incoming_description)) {
|
|
2884
|
+
return false;
|
|
2885
|
+
}
|
|
2886
|
+
}
|
|
2887
|
+
const existing_developerName = existing.developerName;
|
|
2888
|
+
const incoming_developerName = incoming.developerName;
|
|
2889
|
+
if (!(existing_developerName === incoming_developerName)) {
|
|
2890
|
+
return false;
|
|
2891
|
+
}
|
|
2892
|
+
const existing_title = existing.title;
|
|
2893
|
+
const incoming_title = incoming.title;
|
|
2894
|
+
if (!(existing_title === incoming_title)) {
|
|
2895
|
+
return false;
|
|
2896
|
+
}
|
|
2897
|
+
const existing_choices = existing.choices;
|
|
2898
|
+
const incoming_choices = incoming.choices;
|
|
2899
|
+
const equals_choices_items = equalsArray(existing_choices, incoming_choices, (existing_choices_item, incoming_choices_item) => {
|
|
2900
|
+
if (!(equals$5(existing_choices_item, incoming_choices_item))) {
|
|
2901
|
+
return false;
|
|
2902
|
+
}
|
|
2903
|
+
});
|
|
2904
|
+
if (equals_choices_items === false) {
|
|
2905
|
+
return false;
|
|
2906
|
+
}
|
|
2907
|
+
const existing_link = existing.link;
|
|
2908
|
+
const incoming_link = incoming.link;
|
|
2909
|
+
// if at least one of these optionals is defined
|
|
2910
|
+
if (existing_link !== undefined || incoming_link !== undefined) {
|
|
2911
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2912
|
+
// not equal
|
|
2913
|
+
if (existing_link === undefined || incoming_link === undefined) {
|
|
2914
|
+
return false;
|
|
2915
|
+
}
|
|
2916
|
+
if (!(existing_link === incoming_link
|
|
2917
|
+
|| (existing_link != null &&
|
|
2918
|
+
incoming_link != null &&
|
|
2919
|
+
equals$4(existing_link, incoming_link)))) {
|
|
2920
|
+
return false;
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
return true;
|
|
2924
|
+
}
|
|
2925
|
+
|
|
2926
|
+
const VERSION$2 = "defc7152bc133ff8e890226cd2092bf0";
|
|
2927
|
+
function validate$5(obj, path = 'LightningAssistantQuestionnaireRepresentation') {
|
|
2928
|
+
const v_error = (() => {
|
|
2929
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2930
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2931
|
+
}
|
|
2932
|
+
const obj_assistantTarget = obj.assistantTarget;
|
|
2933
|
+
const path_assistantTarget = path + '.assistantTarget';
|
|
2934
|
+
if (typeof obj_assistantTarget !== 'string') {
|
|
2935
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
|
|
2936
|
+
}
|
|
2937
|
+
if (obj.description !== undefined) {
|
|
2938
|
+
const obj_description = obj.description;
|
|
2939
|
+
const path_description = path + '.description';
|
|
2940
|
+
if (typeof obj_description !== 'string') {
|
|
2941
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
const obj_developerName = obj.developerName;
|
|
2945
|
+
const path_developerName = path + '.developerName';
|
|
2946
|
+
if (typeof obj_developerName !== 'string') {
|
|
2947
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
2948
|
+
}
|
|
2949
|
+
const obj_questions = obj.questions;
|
|
2950
|
+
const path_questions = path + '.questions';
|
|
2951
|
+
if (!ArrayIsArray(obj_questions)) {
|
|
2952
|
+
return new TypeError('Expected "array" but received "' + typeof obj_questions + '" (at "' + path_questions + '")');
|
|
2953
|
+
}
|
|
2954
|
+
for (let i = 0; i < obj_questions.length; i++) {
|
|
2955
|
+
const obj_questions_item = obj_questions[i];
|
|
2956
|
+
const path_questions_item = path_questions + '[' + i + ']';
|
|
2957
|
+
const referencepath_questions_itemValidationError = validate$6(obj_questions_item, path_questions_item);
|
|
2958
|
+
if (referencepath_questions_itemValidationError !== null) {
|
|
2959
|
+
let message = 'Object doesn\'t match LightningAssistantQuestionRepresentation (at "' + path_questions_item + '")\n';
|
|
2960
|
+
message += referencepath_questions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2961
|
+
return new TypeError(message);
|
|
2962
|
+
}
|
|
2963
|
+
}
|
|
2964
|
+
const obj_status = obj.status;
|
|
2965
|
+
const path_status = path + '.status';
|
|
2966
|
+
if (typeof obj_status !== 'string') {
|
|
2967
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
2968
|
+
}
|
|
2969
|
+
const obj_title = obj.title;
|
|
2970
|
+
const path_title = path + '.title';
|
|
2971
|
+
if (typeof obj_title !== 'string') {
|
|
2972
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
2973
|
+
}
|
|
2974
|
+
})();
|
|
2975
|
+
return v_error === undefined ? null : v_error;
|
|
2976
|
+
}
|
|
2977
|
+
const RepresentationType$2 = 'LightningAssistantQuestionnaireRepresentation';
|
|
2978
|
+
function keyBuilder$6(luvio, config) {
|
|
2979
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.questionnaire_name;
|
|
2980
|
+
}
|
|
2981
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
2982
|
+
const keyParams = {
|
|
2983
|
+
questionnaire_name: object.developerName
|
|
2984
|
+
};
|
|
2985
|
+
return keyBuilder$6(luvio, keyParams);
|
|
2986
|
+
}
|
|
2987
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
2988
|
+
return input;
|
|
2989
|
+
}
|
|
2990
|
+
const select$8 = function LightningAssistantQuestionnaireRepresentationSelect() {
|
|
2991
|
+
const { selections: LightningAssistantQuestionRepresentation__selections, opaque: LightningAssistantQuestionRepresentation__opaque, } = select$9();
|
|
2992
|
+
return {
|
|
2993
|
+
kind: 'Fragment',
|
|
2994
|
+
version: VERSION$2,
|
|
2995
|
+
private: [],
|
|
2996
|
+
selections: [
|
|
2997
|
+
{
|
|
2998
|
+
name: 'assistantTarget',
|
|
2999
|
+
kind: 'Scalar'
|
|
3000
|
+
},
|
|
3001
|
+
{
|
|
3002
|
+
name: 'description',
|
|
3003
|
+
kind: 'Scalar',
|
|
3004
|
+
required: false
|
|
3005
|
+
},
|
|
3006
|
+
{
|
|
3007
|
+
name: 'developerName',
|
|
3008
|
+
kind: 'Scalar'
|
|
3009
|
+
},
|
|
3010
|
+
{
|
|
3011
|
+
name: 'questions',
|
|
3012
|
+
kind: 'Object',
|
|
3013
|
+
plural: true,
|
|
3014
|
+
selections: LightningAssistantQuestionRepresentation__selections
|
|
3015
|
+
},
|
|
3016
|
+
{
|
|
3017
|
+
name: 'status',
|
|
3018
|
+
kind: 'Scalar'
|
|
3019
|
+
},
|
|
3020
|
+
{
|
|
3021
|
+
name: 'title',
|
|
3022
|
+
kind: 'Scalar'
|
|
3023
|
+
}
|
|
3024
|
+
]
|
|
3025
|
+
};
|
|
3026
|
+
};
|
|
3027
|
+
function equals$2(existing, incoming) {
|
|
3028
|
+
const existing_assistantTarget = existing.assistantTarget;
|
|
3029
|
+
const incoming_assistantTarget = incoming.assistantTarget;
|
|
3030
|
+
if (!(existing_assistantTarget === incoming_assistantTarget)) {
|
|
3031
|
+
return false;
|
|
3032
|
+
}
|
|
3033
|
+
const existing_description = existing.description;
|
|
3034
|
+
const incoming_description = incoming.description;
|
|
3035
|
+
// if at least one of these optionals is defined
|
|
3036
|
+
if (existing_description !== undefined || incoming_description !== undefined) {
|
|
3037
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
3038
|
+
// not equal
|
|
3039
|
+
if (existing_description === undefined || incoming_description === undefined) {
|
|
3040
|
+
return false;
|
|
3041
|
+
}
|
|
3042
|
+
if (!(existing_description === incoming_description)) {
|
|
3043
|
+
return false;
|
|
3044
|
+
}
|
|
3045
|
+
}
|
|
3046
|
+
const existing_developerName = existing.developerName;
|
|
3047
|
+
const incoming_developerName = incoming.developerName;
|
|
3048
|
+
if (!(existing_developerName === incoming_developerName)) {
|
|
3049
|
+
return false;
|
|
3050
|
+
}
|
|
3051
|
+
const existing_status = existing.status;
|
|
3052
|
+
const incoming_status = incoming.status;
|
|
3053
|
+
if (!(existing_status === incoming_status)) {
|
|
3054
|
+
return false;
|
|
3055
|
+
}
|
|
3056
|
+
const existing_title = existing.title;
|
|
3057
|
+
const incoming_title = incoming.title;
|
|
3058
|
+
if (!(existing_title === incoming_title)) {
|
|
3059
|
+
return false;
|
|
3060
|
+
}
|
|
3061
|
+
const existing_questions = existing.questions;
|
|
3062
|
+
const incoming_questions = incoming.questions;
|
|
3063
|
+
const equals_questions_items = equalsArray(existing_questions, incoming_questions, (existing_questions_item, incoming_questions_item) => {
|
|
3064
|
+
if (!(equals$3(existing_questions_item, incoming_questions_item))) {
|
|
3065
|
+
return false;
|
|
3066
|
+
}
|
|
3067
|
+
});
|
|
3068
|
+
if (equals_questions_items === false) {
|
|
3069
|
+
return false;
|
|
3070
|
+
}
|
|
3071
|
+
return true;
|
|
3072
|
+
}
|
|
3073
|
+
const ingest$2 = function LightningAssistantQuestionnaireRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3074
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3075
|
+
const validateError = validate$5(input);
|
|
3076
|
+
if (validateError !== null) {
|
|
3077
|
+
throw validateError;
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
const key = keyBuilderFromType$2(luvio, input);
|
|
3081
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
3082
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "LEAP", VERSION$2, RepresentationType$2, equals$2);
|
|
3083
|
+
return createLink(key);
|
|
3084
|
+
};
|
|
3085
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
3086
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3087
|
+
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
3088
|
+
rootKeySet.set(rootKey, {
|
|
3089
|
+
namespace: keyPrefix,
|
|
3090
|
+
representationName: RepresentationType$2,
|
|
3091
|
+
mergeable: false
|
|
3092
|
+
});
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
function select$7(luvio, params) {
|
|
3096
|
+
return select$8();
|
|
3097
|
+
}
|
|
3098
|
+
function keyBuilder$5(luvio, params) {
|
|
3099
|
+
return keyBuilder$6(luvio, {
|
|
3100
|
+
questionnaire_name: params.urlParams.questionnaireName
|
|
3101
|
+
});
|
|
3102
|
+
}
|
|
3103
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
3104
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
3105
|
+
}
|
|
3106
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
3107
|
+
const { body } = response;
|
|
3108
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
3109
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
3110
|
+
const snapshot = luvio.storeLookup({
|
|
3111
|
+
recordId: key,
|
|
3112
|
+
node: select$7(),
|
|
3113
|
+
variables: {},
|
|
3114
|
+
}, snapshotRefresh);
|
|
3115
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3116
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3117
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
deepFreeze(snapshot.data);
|
|
3121
|
+
return snapshot;
|
|
3122
|
+
}
|
|
3123
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
3124
|
+
const key = keyBuilder$5(luvio, params);
|
|
3125
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
3126
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
3127
|
+
return errorSnapshot;
|
|
3128
|
+
}
|
|
3129
|
+
function createResourceRequest$5(config) {
|
|
3130
|
+
const headers = {};
|
|
3131
|
+
return {
|
|
3132
|
+
baseUri: '/services/data/v66.0',
|
|
3133
|
+
basePath: '/assistant-platform/questionnaire/' + config.urlParams.questionnaireName + '',
|
|
3134
|
+
method: 'get',
|
|
3135
|
+
body: null,
|
|
3136
|
+
urlParams: config.urlParams,
|
|
3137
|
+
queryParams: {},
|
|
3138
|
+
headers,
|
|
3139
|
+
priority: 'normal',
|
|
3140
|
+
};
|
|
3141
|
+
}
|
|
3142
|
+
function createResourceRequestFromRepresentation$1(representation) {
|
|
3143
|
+
const config = {
|
|
3144
|
+
urlParams: {},
|
|
3145
|
+
};
|
|
3146
|
+
config.urlParams.questionnaireName = representation.developerName;
|
|
3147
|
+
return createResourceRequest$5(config);
|
|
3148
|
+
}
|
|
3149
|
+
|
|
3150
|
+
const adapterName$5 = 'getQuestionnaire';
|
|
3151
|
+
const getQuestionnaire_ConfigPropertyMetadata = [
|
|
3152
|
+
generateParamConfigMetadata('questionnaireName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3153
|
+
];
|
|
3154
|
+
const getQuestionnaire_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getQuestionnaire_ConfigPropertyMetadata);
|
|
3155
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$b(getQuestionnaire_ConfigPropertyMetadata);
|
|
3156
|
+
function keyBuilder$4(luvio, config) {
|
|
3157
|
+
const resourceParams = createResourceParams$5(config);
|
|
3158
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
3159
|
+
}
|
|
3160
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
3161
|
+
const config = {};
|
|
3162
|
+
typeCheckConfig$b(untrustedConfig, config, getQuestionnaire_ConfigPropertyMetadata);
|
|
3163
|
+
return config;
|
|
3164
|
+
}
|
|
3165
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
3166
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3167
|
+
return null;
|
|
3168
|
+
}
|
|
3169
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3170
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3171
|
+
}
|
|
3172
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
3173
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3174
|
+
return null;
|
|
3175
|
+
}
|
|
3176
|
+
return config;
|
|
3177
|
+
}
|
|
3178
|
+
function adapterFragment$1(luvio, config) {
|
|
3179
|
+
createResourceParams$5(config);
|
|
3180
|
+
return select$7();
|
|
3181
|
+
}
|
|
3182
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
3183
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
3184
|
+
config,
|
|
3185
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
3186
|
+
});
|
|
3187
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3188
|
+
}
|
|
3189
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
3190
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
3191
|
+
config,
|
|
3192
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
3193
|
+
});
|
|
3194
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3195
|
+
}
|
|
3196
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
3197
|
+
const resourceParams = createResourceParams$5(config);
|
|
3198
|
+
const request = createResourceRequest$5(resourceParams);
|
|
3199
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3200
|
+
.then((response) => {
|
|
3201
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
3202
|
+
const cache = new StoreKeyMap();
|
|
3203
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
3204
|
+
return cache;
|
|
3205
|
+
});
|
|
3206
|
+
}, (response) => {
|
|
3207
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
3208
|
+
});
|
|
3209
|
+
}
|
|
3210
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
3211
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
3212
|
+
}
|
|
3213
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
3214
|
+
const { luvio, config } = context;
|
|
3215
|
+
const selector = {
|
|
3216
|
+
recordId: keyBuilder$4(luvio, config),
|
|
3217
|
+
node: adapterFragment$1(luvio, config),
|
|
3218
|
+
variables: {},
|
|
3219
|
+
};
|
|
3220
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
3221
|
+
config,
|
|
3222
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
3223
|
+
});
|
|
3224
|
+
return cacheSnapshot;
|
|
3225
|
+
}
|
|
3226
|
+
const getQuestionnaireAdapterFactory = (luvio) => function LEAP__getQuestionnaire(untrustedConfig, requestContext) {
|
|
3227
|
+
const config = validateAdapterConfig$5(untrustedConfig, getQuestionnaire_ConfigPropertyNames);
|
|
3228
|
+
// Invalid or incomplete config
|
|
3229
|
+
if (config === null) {
|
|
3230
|
+
return null;
|
|
3231
|
+
}
|
|
3232
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
3233
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
3234
|
+
};
|
|
3235
|
+
const notifyChangeFactory$1 = (luvio, options) => {
|
|
3236
|
+
return function getAssistantPlatformQuestionnaireByQuestionnaireNameNotifyChange(configs) {
|
|
3237
|
+
const keys = configs.map(c => keyBuilder$6(luvio, c));
|
|
3238
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
3239
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
3240
|
+
const { key, record: val } = entries[i];
|
|
3241
|
+
const refreshRequest = createResourceRequestFromRepresentation$1(val);
|
|
3242
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
3243
|
+
.then((response) => {
|
|
3244
|
+
return luvio.handleSuccessResponse(() => {
|
|
3245
|
+
const { body } = response;
|
|
3246
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
3247
|
+
return luvio.storeBroadcast();
|
|
3248
|
+
}, () => {
|
|
3249
|
+
const cache = new StoreKeyMap();
|
|
3250
|
+
getTypeCacheKeys$2(cache, luvio, response.body);
|
|
3251
|
+
return cache;
|
|
3252
|
+
});
|
|
3253
|
+
}, (error) => {
|
|
3254
|
+
return luvio.handleErrorResponse(() => {
|
|
3255
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
3256
|
+
luvio.storeIngestError(key, errorSnapshot, undefined);
|
|
3257
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
3258
|
+
});
|
|
3259
|
+
});
|
|
3260
|
+
}
|
|
3261
|
+
});
|
|
3262
|
+
};
|
|
3263
|
+
};
|
|
3264
|
+
|
|
3265
|
+
const VERSION$1 = "042081dc16ad8bafa711efc0ff696bde";
|
|
3266
|
+
function validate$4(obj, path = 'LightningAssistantQuestionnaireListRepresentation') {
|
|
3267
|
+
const v_error = (() => {
|
|
3268
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3269
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3270
|
+
}
|
|
3271
|
+
const obj_assistantName = obj.assistantName;
|
|
3272
|
+
const path_assistantName = path + '.assistantName';
|
|
3273
|
+
if (typeof obj_assistantName !== 'string') {
|
|
3274
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assistantName + '" (at "' + path_assistantName + '")');
|
|
3275
|
+
}
|
|
3276
|
+
const obj_questionnaireNames = obj.questionnaireNames;
|
|
3277
|
+
const path_questionnaireNames = path + '.questionnaireNames';
|
|
3278
|
+
if (!ArrayIsArray(obj_questionnaireNames)) {
|
|
3279
|
+
return new TypeError('Expected "array" but received "' + typeof obj_questionnaireNames + '" (at "' + path_questionnaireNames + '")');
|
|
3280
|
+
}
|
|
3281
|
+
for (let i = 0; i < obj_questionnaireNames.length; i++) {
|
|
3282
|
+
const obj_questionnaireNames_item = obj_questionnaireNames[i];
|
|
3283
|
+
const path_questionnaireNames_item = path_questionnaireNames + '[' + i + ']';
|
|
3284
|
+
if (typeof obj_questionnaireNames_item !== 'string') {
|
|
3285
|
+
return new TypeError('Expected "string" but received "' + typeof obj_questionnaireNames_item + '" (at "' + path_questionnaireNames_item + '")');
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
})();
|
|
3289
|
+
return v_error === undefined ? null : v_error;
|
|
3290
|
+
}
|
|
3291
|
+
const RepresentationType$1 = 'LightningAssistantQuestionnaireListRepresentation';
|
|
3292
|
+
function keyBuilder$3(luvio, config) {
|
|
3293
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.assistant_name;
|
|
3294
|
+
}
|
|
3295
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
3296
|
+
const keyParams = {
|
|
3297
|
+
assistant_name: object.assistantName
|
|
3298
|
+
};
|
|
3299
|
+
return keyBuilder$3(luvio, keyParams);
|
|
3300
|
+
}
|
|
3301
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
3302
|
+
return input;
|
|
3303
|
+
}
|
|
3304
|
+
const select$6 = function LightningAssistantQuestionnaireListRepresentationSelect() {
|
|
3305
|
+
return {
|
|
3306
|
+
kind: 'Fragment',
|
|
3307
|
+
version: VERSION$1,
|
|
3308
|
+
private: [],
|
|
3309
|
+
selections: [
|
|
3310
|
+
{
|
|
3311
|
+
name: 'assistantName',
|
|
3312
|
+
kind: 'Scalar'
|
|
3313
|
+
},
|
|
3314
|
+
{
|
|
3315
|
+
name: 'questionnaireNames',
|
|
3316
|
+
kind: 'Scalar',
|
|
3317
|
+
plural: true
|
|
3318
|
+
}
|
|
3319
|
+
]
|
|
3320
|
+
};
|
|
3321
|
+
};
|
|
3322
|
+
function equals$1(existing, incoming) {
|
|
3323
|
+
const existing_assistantName = existing.assistantName;
|
|
3324
|
+
const incoming_assistantName = incoming.assistantName;
|
|
3325
|
+
if (!(existing_assistantName === incoming_assistantName)) {
|
|
3326
|
+
return false;
|
|
3327
|
+
}
|
|
3328
|
+
const existing_questionnaireNames = existing.questionnaireNames;
|
|
3329
|
+
const incoming_questionnaireNames = incoming.questionnaireNames;
|
|
3330
|
+
const equals_questionnaireNames_items = equalsArray(existing_questionnaireNames, incoming_questionnaireNames, (existing_questionnaireNames_item, incoming_questionnaireNames_item) => {
|
|
3331
|
+
if (!(existing_questionnaireNames_item === incoming_questionnaireNames_item)) {
|
|
3332
|
+
return false;
|
|
3333
|
+
}
|
|
3334
|
+
});
|
|
3335
|
+
if (equals_questionnaireNames_items === false) {
|
|
3336
|
+
return false;
|
|
3337
|
+
}
|
|
3338
|
+
return true;
|
|
3339
|
+
}
|
|
3340
|
+
const ingest$1 = function LightningAssistantQuestionnaireListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3341
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3342
|
+
const validateError = validate$4(input);
|
|
3343
|
+
if (validateError !== null) {
|
|
3344
|
+
throw validateError;
|
|
3345
|
+
}
|
|
3346
|
+
}
|
|
3347
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
3348
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
3349
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "LEAP", VERSION$1, RepresentationType$1, equals$1);
|
|
3350
|
+
return createLink(key);
|
|
3351
|
+
};
|
|
3352
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
3353
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3354
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
3355
|
+
rootKeySet.set(rootKey, {
|
|
3356
|
+
namespace: keyPrefix,
|
|
3357
|
+
representationName: RepresentationType$1,
|
|
3358
|
+
mergeable: false
|
|
3359
|
+
});
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
function select$5(luvio, params) {
|
|
3363
|
+
return select$6();
|
|
3364
|
+
}
|
|
3365
|
+
function keyBuilder$2(luvio, params) {
|
|
3366
|
+
return keyBuilder$3(luvio, {
|
|
3367
|
+
assistant_name: params.urlParams.assistantName
|
|
3368
|
+
});
|
|
3369
|
+
}
|
|
3370
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
3371
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
3372
|
+
}
|
|
3373
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
3374
|
+
const { body } = response;
|
|
3375
|
+
const key = keyBuilder$2(luvio, resourceParams);
|
|
3376
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
3377
|
+
const snapshot = luvio.storeLookup({
|
|
3378
|
+
recordId: key,
|
|
3379
|
+
node: select$5(),
|
|
3380
|
+
variables: {},
|
|
3381
|
+
}, snapshotRefresh);
|
|
3382
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3383
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3384
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3385
|
+
}
|
|
3386
|
+
}
|
|
3387
|
+
deepFreeze(snapshot.data);
|
|
3388
|
+
return snapshot;
|
|
3389
|
+
}
|
|
3390
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
3391
|
+
const key = keyBuilder$2(luvio, params);
|
|
3392
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
3393
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
3394
|
+
return errorSnapshot;
|
|
3395
|
+
}
|
|
3396
|
+
function createResourceRequest$4(config) {
|
|
3397
|
+
const headers = {};
|
|
3398
|
+
return {
|
|
3399
|
+
baseUri: '/services/data/v66.0',
|
|
3400
|
+
basePath: '/assistant-platform/' + config.urlParams.assistantName + '/questionnaires',
|
|
3401
|
+
method: 'get',
|
|
3402
|
+
body: null,
|
|
3403
|
+
urlParams: config.urlParams,
|
|
3404
|
+
queryParams: {},
|
|
3405
|
+
headers,
|
|
3406
|
+
priority: 'normal',
|
|
3407
|
+
};
|
|
3408
|
+
}
|
|
3409
|
+
function createResourceRequestFromRepresentation(representation) {
|
|
3410
|
+
const config = {
|
|
3411
|
+
urlParams: {},
|
|
3412
|
+
};
|
|
3413
|
+
config.urlParams.assistantName = representation.assistantName;
|
|
3414
|
+
return createResourceRequest$4(config);
|
|
3415
|
+
}
|
|
3416
|
+
|
|
3417
|
+
const adapterName$4 = 'getQuestionnaires';
|
|
3418
|
+
const getQuestionnaires_ConfigPropertyMetadata = [
|
|
3419
|
+
generateParamConfigMetadata('assistantName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3420
|
+
];
|
|
3421
|
+
const getQuestionnaires_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getQuestionnaires_ConfigPropertyMetadata);
|
|
3422
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$b(getQuestionnaires_ConfigPropertyMetadata);
|
|
3423
|
+
function keyBuilder$1(luvio, config) {
|
|
3424
|
+
const resourceParams = createResourceParams$4(config);
|
|
3425
|
+
return keyBuilder$2(luvio, resourceParams);
|
|
3426
|
+
}
|
|
3427
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
3428
|
+
const config = {};
|
|
3429
|
+
typeCheckConfig$b(untrustedConfig, config, getQuestionnaires_ConfigPropertyMetadata);
|
|
3430
|
+
return config;
|
|
3431
|
+
}
|
|
3432
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
3433
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3434
|
+
return null;
|
|
3435
|
+
}
|
|
3436
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3437
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3438
|
+
}
|
|
3439
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
3440
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3441
|
+
return null;
|
|
3442
|
+
}
|
|
3443
|
+
return config;
|
|
3444
|
+
}
|
|
3445
|
+
function adapterFragment(luvio, config) {
|
|
3446
|
+
createResourceParams$4(config);
|
|
3447
|
+
return select$5();
|
|
3448
|
+
}
|
|
3449
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
3450
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
3451
|
+
config,
|
|
3452
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
3453
|
+
});
|
|
3454
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3455
|
+
}
|
|
3456
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
3457
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
3458
|
+
config,
|
|
3459
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
3460
|
+
});
|
|
3461
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3462
|
+
}
|
|
3463
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
3464
|
+
const resourceParams = createResourceParams$4(config);
|
|
3465
|
+
const request = createResourceRequest$4(resourceParams);
|
|
3466
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3467
|
+
.then((response) => {
|
|
3468
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
3469
|
+
const cache = new StoreKeyMap();
|
|
3470
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
3471
|
+
return cache;
|
|
3472
|
+
});
|
|
3473
|
+
}, (response) => {
|
|
3474
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
3475
|
+
});
|
|
3476
|
+
}
|
|
3477
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
3478
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
|
|
3479
|
+
}
|
|
3480
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
3481
|
+
const { luvio, config } = context;
|
|
3482
|
+
const selector = {
|
|
3483
|
+
recordId: keyBuilder$1(luvio, config),
|
|
3484
|
+
node: adapterFragment(luvio, config),
|
|
3485
|
+
variables: {},
|
|
3486
|
+
};
|
|
3487
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
3488
|
+
config,
|
|
3489
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
3490
|
+
});
|
|
3491
|
+
return cacheSnapshot;
|
|
3492
|
+
}
|
|
3493
|
+
const getQuestionnairesAdapterFactory = (luvio) => function LEAP__getQuestionnaires(untrustedConfig, requestContext) {
|
|
3494
|
+
const config = validateAdapterConfig$4(untrustedConfig, getQuestionnaires_ConfigPropertyNames);
|
|
3495
|
+
// Invalid or incomplete config
|
|
3496
|
+
if (config === null) {
|
|
3497
|
+
return null;
|
|
3498
|
+
}
|
|
3499
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
3500
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
3501
|
+
};
|
|
3502
|
+
const notifyChangeFactory = (luvio, options) => {
|
|
3503
|
+
return function getAssistantPlatformQuestionnairesByAssistantNameNotifyChange(configs) {
|
|
3504
|
+
const keys = configs.map(c => keyBuilder$3(luvio, c));
|
|
3505
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
3506
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
3507
|
+
const { key, record: val } = entries[i];
|
|
3508
|
+
const refreshRequest = createResourceRequestFromRepresentation(val);
|
|
3509
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
3510
|
+
.then((response) => {
|
|
3511
|
+
return luvio.handleSuccessResponse(() => {
|
|
3512
|
+
const { body } = response;
|
|
3513
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
3514
|
+
return luvio.storeBroadcast();
|
|
3515
|
+
}, () => {
|
|
3516
|
+
const cache = new StoreKeyMap();
|
|
3517
|
+
getTypeCacheKeys$1(cache, luvio, response.body);
|
|
3518
|
+
return cache;
|
|
3519
|
+
});
|
|
3520
|
+
}, (error) => {
|
|
3521
|
+
return luvio.handleErrorResponse(() => {
|
|
3522
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
3523
|
+
luvio.storeIngestError(key, errorSnapshot, undefined);
|
|
3524
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
3525
|
+
});
|
|
3526
|
+
});
|
|
3527
|
+
}
|
|
3528
|
+
});
|
|
3529
|
+
};
|
|
3530
|
+
};
|
|
3531
|
+
|
|
3532
|
+
const VERSION = "f2e480ff95d6a6b46f4a4b00d2d40a04";
|
|
3533
|
+
function validate$3(obj, path = 'LightningAssistantInitializationRepresentation') {
|
|
3534
|
+
const v_error = (() => {
|
|
3535
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3536
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3537
|
+
}
|
|
3538
|
+
const obj_assistantTarget = obj.assistantTarget;
|
|
3539
|
+
const path_assistantTarget = path + '.assistantTarget';
|
|
3540
|
+
if (typeof obj_assistantTarget !== 'string') {
|
|
3541
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assistantTarget + '" (at "' + path_assistantTarget + '")');
|
|
3542
|
+
}
|
|
3543
|
+
const obj_isInitialized = obj.isInitialized;
|
|
3544
|
+
const path_isInitialized = path + '.isInitialized';
|
|
3545
|
+
if (typeof obj_isInitialized !== 'boolean') {
|
|
3546
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isInitialized + '" (at "' + path_isInitialized + '")');
|
|
3547
|
+
}
|
|
3548
|
+
})();
|
|
3549
|
+
return v_error === undefined ? null : v_error;
|
|
3550
|
+
}
|
|
3551
|
+
const RepresentationType = 'LightningAssistantInitializationRepresentation';
|
|
3552
|
+
function keyBuilder(luvio, config) {
|
|
3553
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.is_initialized + ':' + config.assistant_target;
|
|
3554
|
+
}
|
|
3555
|
+
function keyBuilderFromType(luvio, object) {
|
|
3556
|
+
const keyParams = {
|
|
3557
|
+
is_initialized: object.isInitialized,
|
|
3558
|
+
assistant_target: object.assistantTarget
|
|
3559
|
+
};
|
|
3560
|
+
return keyBuilder(luvio, keyParams);
|
|
3561
|
+
}
|
|
3562
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
3563
|
+
return input;
|
|
3564
|
+
}
|
|
3565
|
+
const select$4 = function LightningAssistantInitializationRepresentationSelect() {
|
|
3566
|
+
return {
|
|
3567
|
+
kind: 'Fragment',
|
|
3568
|
+
version: VERSION,
|
|
3569
|
+
private: [],
|
|
3570
|
+
selections: [
|
|
3571
|
+
{
|
|
3572
|
+
name: 'assistantTarget',
|
|
3573
|
+
kind: 'Scalar'
|
|
3574
|
+
},
|
|
3575
|
+
{
|
|
3576
|
+
name: 'isInitialized',
|
|
3577
|
+
kind: 'Scalar'
|
|
3578
|
+
}
|
|
3579
|
+
]
|
|
3580
|
+
};
|
|
3581
|
+
};
|
|
3582
|
+
function equals(existing, incoming) {
|
|
3583
|
+
const existing_isInitialized = existing.isInitialized;
|
|
3584
|
+
const incoming_isInitialized = incoming.isInitialized;
|
|
3585
|
+
if (!(existing_isInitialized === incoming_isInitialized)) {
|
|
3586
|
+
return false;
|
|
3587
|
+
}
|
|
3588
|
+
const existing_assistantTarget = existing.assistantTarget;
|
|
3589
|
+
const incoming_assistantTarget = incoming.assistantTarget;
|
|
3590
|
+
if (!(existing_assistantTarget === incoming_assistantTarget)) {
|
|
3591
|
+
return false;
|
|
3592
|
+
}
|
|
3593
|
+
return true;
|
|
3594
|
+
}
|
|
3595
|
+
const ingest = function LightningAssistantInitializationRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3596
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3597
|
+
const validateError = validate$3(input);
|
|
3598
|
+
if (validateError !== null) {
|
|
3599
|
+
throw validateError;
|
|
3600
|
+
}
|
|
3601
|
+
}
|
|
3602
|
+
const key = keyBuilderFromType(luvio, input);
|
|
3603
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
3604
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "LEAP", VERSION, RepresentationType, equals);
|
|
3605
|
+
return createLink(key);
|
|
3606
|
+
};
|
|
3607
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
3608
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3609
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
3610
|
+
rootKeySet.set(rootKey, {
|
|
3611
|
+
namespace: keyPrefix,
|
|
3612
|
+
representationName: RepresentationType,
|
|
3613
|
+
mergeable: false
|
|
3614
|
+
});
|
|
3615
|
+
}
|
|
3616
|
+
|
|
3617
|
+
function select$3(luvio, params) {
|
|
3618
|
+
return select$4();
|
|
3619
|
+
}
|
|
3620
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
3621
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
3622
|
+
}
|
|
3623
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
3624
|
+
const { body } = response;
|
|
3625
|
+
const key = keyBuilderFromType(luvio, body);
|
|
3626
|
+
luvio.storeIngest(key, ingest, body);
|
|
3627
|
+
const snapshot = luvio.storeLookup({
|
|
3628
|
+
recordId: key,
|
|
3629
|
+
node: select$3(),
|
|
3630
|
+
variables: {},
|
|
3631
|
+
});
|
|
3632
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3633
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3634
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3635
|
+
}
|
|
3636
|
+
}
|
|
3637
|
+
deepFreeze(snapshot.data);
|
|
3638
|
+
return snapshot;
|
|
3639
|
+
}
|
|
3640
|
+
function createResourceRequest$3(config) {
|
|
3641
|
+
const headers = {};
|
|
3642
|
+
return {
|
|
3643
|
+
baseUri: '/services/data/v66.0',
|
|
3644
|
+
basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/initialize',
|
|
3645
|
+
method: 'put',
|
|
3646
|
+
body: null,
|
|
3647
|
+
urlParams: config.urlParams,
|
|
3648
|
+
queryParams: {},
|
|
3649
|
+
headers,
|
|
3650
|
+
priority: 'normal',
|
|
3651
|
+
};
|
|
3652
|
+
}
|
|
3653
|
+
|
|
3654
|
+
const adapterName$3 = 'initialize';
|
|
3655
|
+
const initialize_ConfigPropertyMetadata = [
|
|
3656
|
+
generateParamConfigMetadata('assistantTarget', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3657
|
+
];
|
|
3658
|
+
const initialize_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, initialize_ConfigPropertyMetadata);
|
|
3659
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$b(initialize_ConfigPropertyMetadata);
|
|
3660
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
3661
|
+
const config = {};
|
|
3662
|
+
typeCheckConfig$b(untrustedConfig, config, initialize_ConfigPropertyMetadata);
|
|
3663
|
+
return config;
|
|
3664
|
+
}
|
|
3665
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
3666
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3667
|
+
return null;
|
|
3668
|
+
}
|
|
3669
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3670
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3671
|
+
}
|
|
3672
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
3673
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3674
|
+
return null;
|
|
3675
|
+
}
|
|
3676
|
+
return config;
|
|
3677
|
+
}
|
|
3678
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
3679
|
+
const resourceParams = createResourceParams$3(config);
|
|
3680
|
+
const request = createResourceRequest$3(resourceParams);
|
|
3681
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3682
|
+
.then((response) => {
|
|
3683
|
+
return luvio.handleSuccessResponse(() => {
|
|
3684
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
3685
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3686
|
+
}, () => {
|
|
3687
|
+
const cache = new StoreKeyMap();
|
|
3688
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
3689
|
+
return cache;
|
|
3690
|
+
});
|
|
3691
|
+
}, (response) => {
|
|
3692
|
+
deepFreeze(response);
|
|
3693
|
+
throw response;
|
|
3694
|
+
});
|
|
3695
|
+
}
|
|
3696
|
+
const initializeAdapterFactory = (luvio) => {
|
|
3697
|
+
return function initialize(untrustedConfig) {
|
|
3698
|
+
const config = validateAdapterConfig$3(untrustedConfig, initialize_ConfigPropertyNames);
|
|
3699
|
+
// Invalid or incomplete config
|
|
3700
|
+
if (config === null) {
|
|
3701
|
+
throw new Error('Invalid config for "initialize"');
|
|
3702
|
+
}
|
|
3703
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
3704
|
+
};
|
|
3705
|
+
};
|
|
3706
|
+
|
|
3707
|
+
function validate$2(obj, path = 'LightningAssistantUpdateInputRepresentation') {
|
|
3708
|
+
const v_error = (() => {
|
|
3709
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3710
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3711
|
+
}
|
|
3712
|
+
const obj_items = obj.items;
|
|
3713
|
+
const path_items = path + '.items';
|
|
3714
|
+
if (typeof obj_items !== 'object' || ArrayIsArray(obj_items) || obj_items === null) {
|
|
3715
|
+
return new TypeError('Expected "object" but received "' + typeof obj_items + '" (at "' + path_items + '")');
|
|
3716
|
+
}
|
|
3717
|
+
const obj_items_keys = ObjectKeys(obj_items);
|
|
3718
|
+
for (let i = 0; i < obj_items_keys.length; i++) {
|
|
3719
|
+
const key = obj_items_keys[i];
|
|
3720
|
+
const obj_items_prop = obj_items[key];
|
|
3721
|
+
const path_items_prop = path_items + '["' + key + '"]';
|
|
3722
|
+
if (typeof obj_items_prop !== 'object' || ArrayIsArray(obj_items_prop) || obj_items_prop === null) {
|
|
3723
|
+
return new TypeError('Expected "object" but received "' + typeof obj_items_prop + '" (at "' + path_items_prop + '")');
|
|
3724
|
+
}
|
|
3725
|
+
}
|
|
3726
|
+
})();
|
|
3727
|
+
return v_error === undefined ? null : v_error;
|
|
3728
|
+
}
|
|
3729
|
+
|
|
3730
|
+
function select$2(luvio, params) {
|
|
3731
|
+
return select$l();
|
|
3732
|
+
}
|
|
3733
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
3734
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response);
|
|
3735
|
+
}
|
|
3736
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
3737
|
+
const { body } = response;
|
|
3738
|
+
const key = keyBuilderFromType$6(luvio, body);
|
|
3739
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
3740
|
+
const snapshot = luvio.storeLookup({
|
|
3741
|
+
recordId: key,
|
|
3742
|
+
node: select$2(),
|
|
3743
|
+
variables: {},
|
|
3744
|
+
});
|
|
3745
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3746
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3747
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3748
|
+
}
|
|
3749
|
+
}
|
|
3750
|
+
deepFreeze(snapshot.data);
|
|
3751
|
+
return snapshot;
|
|
3752
|
+
}
|
|
3753
|
+
function createResourceRequest$2(config) {
|
|
3754
|
+
const headers = {};
|
|
3755
|
+
return {
|
|
3756
|
+
baseUri: '/services/data/v66.0',
|
|
3757
|
+
basePath: '/assistant-platform/' + config.urlParams.assistantName + '',
|
|
3758
|
+
method: 'patch',
|
|
3759
|
+
body: config.body,
|
|
3760
|
+
urlParams: config.urlParams,
|
|
3761
|
+
queryParams: {},
|
|
3762
|
+
headers,
|
|
3763
|
+
priority: 'normal',
|
|
3764
|
+
};
|
|
3765
|
+
}
|
|
3766
|
+
|
|
3767
|
+
const adapterName$2 = 'saveAssistant';
|
|
3768
|
+
const saveAssistant_ConfigPropertyMetadata = [
|
|
3769
|
+
generateParamConfigMetadata('assistantName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3770
|
+
generateParamConfigMetadata('assistantData', true, 2 /* Body */, 4 /* Unsupported */),
|
|
3771
|
+
];
|
|
3772
|
+
const saveAssistant_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, saveAssistant_ConfigPropertyMetadata);
|
|
3773
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$b(saveAssistant_ConfigPropertyMetadata);
|
|
3774
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
3775
|
+
const config = {};
|
|
3776
|
+
typeCheckConfig$b(untrustedConfig, config, saveAssistant_ConfigPropertyMetadata);
|
|
3777
|
+
const untrustedConfig_assistantData = untrustedConfig.assistantData;
|
|
3778
|
+
const referenceLightningAssistantUpdateInputRepresentationValidationError = validate$2(untrustedConfig_assistantData);
|
|
3779
|
+
if (referenceLightningAssistantUpdateInputRepresentationValidationError === null) {
|
|
3780
|
+
config.assistantData = untrustedConfig_assistantData;
|
|
3781
|
+
}
|
|
3782
|
+
return config;
|
|
3783
|
+
}
|
|
3784
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
3785
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3786
|
+
return null;
|
|
3787
|
+
}
|
|
3788
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3789
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3790
|
+
}
|
|
3791
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
3792
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3793
|
+
return null;
|
|
3794
|
+
}
|
|
3795
|
+
return config;
|
|
3796
|
+
}
|
|
3797
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
3798
|
+
const resourceParams = createResourceParams$2(config);
|
|
3799
|
+
const request = createResourceRequest$2(resourceParams);
|
|
3800
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3801
|
+
.then((response) => {
|
|
3802
|
+
return luvio.handleSuccessResponse(() => {
|
|
3803
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
3804
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3805
|
+
}, () => {
|
|
3806
|
+
const cache = new StoreKeyMap();
|
|
3807
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
3808
|
+
return cache;
|
|
3809
|
+
});
|
|
3810
|
+
}, (response) => {
|
|
3811
|
+
deepFreeze(response);
|
|
3812
|
+
throw response;
|
|
3813
|
+
});
|
|
3814
|
+
}
|
|
3815
|
+
const saveAssistantAdapterFactory = (luvio) => {
|
|
3816
|
+
return function saveAssistant(untrustedConfig) {
|
|
3817
|
+
const config = validateAdapterConfig$2(untrustedConfig, saveAssistant_ConfigPropertyNames);
|
|
3818
|
+
// Invalid or incomplete config
|
|
3819
|
+
if (config === null) {
|
|
3820
|
+
throw new Error('Invalid config for "saveAssistant"');
|
|
3821
|
+
}
|
|
3822
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
3823
|
+
};
|
|
3824
|
+
};
|
|
3825
|
+
|
|
3826
|
+
function validate$1(obj, path = 'LightningAssistantListInputRepresentation') {
|
|
3827
|
+
const v_error = (() => {
|
|
3828
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3829
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3830
|
+
}
|
|
3831
|
+
const obj_assistantList = obj.assistantList;
|
|
3832
|
+
const path_assistantList = path + '.assistantList';
|
|
3833
|
+
if (typeof obj_assistantList !== 'object' || ArrayIsArray(obj_assistantList) || obj_assistantList === null) {
|
|
3834
|
+
return new TypeError('Expected "object" but received "' + typeof obj_assistantList + '" (at "' + path_assistantList + '")');
|
|
3835
|
+
}
|
|
3836
|
+
const obj_assistantList_keys = ObjectKeys(obj_assistantList);
|
|
3837
|
+
for (let i = 0; i < obj_assistantList_keys.length; i++) {
|
|
3838
|
+
const key = obj_assistantList_keys[i];
|
|
3839
|
+
const obj_assistantList_prop = obj_assistantList[key];
|
|
3840
|
+
const path_assistantList_prop = path_assistantList + '["' + key + '"]';
|
|
3841
|
+
if (typeof obj_assistantList_prop !== 'object' || ArrayIsArray(obj_assistantList_prop) || obj_assistantList_prop === null) {
|
|
3842
|
+
return new TypeError('Expected "object" but received "' + typeof obj_assistantList_prop + '" (at "' + path_assistantList_prop + '")');
|
|
3843
|
+
}
|
|
3844
|
+
}
|
|
3845
|
+
})();
|
|
3846
|
+
return v_error === undefined ? null : v_error;
|
|
3847
|
+
}
|
|
3848
|
+
|
|
3849
|
+
function select$1(luvio, params) {
|
|
3850
|
+
return select$g();
|
|
3851
|
+
}
|
|
3852
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
3853
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response);
|
|
3854
|
+
}
|
|
3855
|
+
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
3856
|
+
const { body } = response;
|
|
3857
|
+
const key = keyBuilderFromType$4(luvio, body);
|
|
3858
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
3859
|
+
const snapshot = luvio.storeLookup({
|
|
3860
|
+
recordId: key,
|
|
3861
|
+
node: select$1(),
|
|
3862
|
+
variables: {},
|
|
3863
|
+
});
|
|
3864
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3865
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3866
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3867
|
+
}
|
|
3868
|
+
}
|
|
3869
|
+
deepFreeze(snapshot.data);
|
|
3870
|
+
return snapshot;
|
|
3871
|
+
}
|
|
3872
|
+
function createResourceRequest$1(config) {
|
|
3873
|
+
const headers = {};
|
|
3874
|
+
return {
|
|
3875
|
+
baseUri: '/services/data/v66.0',
|
|
3876
|
+
basePath: '/assistant-platform/' + config.urlParams.assistantTarget + '/list',
|
|
3877
|
+
method: 'patch',
|
|
3878
|
+
body: config.body,
|
|
3879
|
+
urlParams: config.urlParams,
|
|
3880
|
+
queryParams: {},
|
|
3881
|
+
headers,
|
|
3882
|
+
priority: 'normal',
|
|
3883
|
+
};
|
|
3884
|
+
}
|
|
3885
|
+
|
|
3886
|
+
const adapterName$1 = 'saveAssistantList';
|
|
3887
|
+
const saveAssistantList_ConfigPropertyMetadata = [
|
|
3888
|
+
generateParamConfigMetadata('assistantTarget', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3889
|
+
generateParamConfigMetadata('assistantData', true, 2 /* Body */, 4 /* Unsupported */),
|
|
3890
|
+
];
|
|
3891
|
+
const saveAssistantList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, saveAssistantList_ConfigPropertyMetadata);
|
|
3892
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$b(saveAssistantList_ConfigPropertyMetadata);
|
|
3893
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
3894
|
+
const config = {};
|
|
3895
|
+
typeCheckConfig$b(untrustedConfig, config, saveAssistantList_ConfigPropertyMetadata);
|
|
3896
|
+
const untrustedConfig_assistantData = untrustedConfig.assistantData;
|
|
3897
|
+
const referenceLightningAssistantListInputRepresentationValidationError = validate$1(untrustedConfig_assistantData);
|
|
3898
|
+
if (referenceLightningAssistantListInputRepresentationValidationError === null) {
|
|
3899
|
+
config.assistantData = untrustedConfig_assistantData;
|
|
3900
|
+
}
|
|
3901
|
+
return config;
|
|
3902
|
+
}
|
|
3903
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
3904
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3905
|
+
return null;
|
|
3906
|
+
}
|
|
3907
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3908
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3909
|
+
}
|
|
3910
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
3911
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3912
|
+
return null;
|
|
3913
|
+
}
|
|
3914
|
+
return config;
|
|
3915
|
+
}
|
|
3916
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
3917
|
+
const resourceParams = createResourceParams$1(config);
|
|
3918
|
+
const request = createResourceRequest$1(resourceParams);
|
|
3919
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3920
|
+
.then((response) => {
|
|
3921
|
+
return luvio.handleSuccessResponse(() => {
|
|
3922
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
3923
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3924
|
+
}, () => {
|
|
3925
|
+
const cache = new StoreKeyMap();
|
|
3926
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
3927
|
+
return cache;
|
|
3928
|
+
});
|
|
3929
|
+
}, (response) => {
|
|
3930
|
+
deepFreeze(response);
|
|
3931
|
+
throw response;
|
|
3932
|
+
});
|
|
3933
|
+
}
|
|
3934
|
+
const saveAssistantListAdapterFactory = (luvio) => {
|
|
3935
|
+
return function saveAssistantList(untrustedConfig) {
|
|
3936
|
+
const config = validateAdapterConfig$1(untrustedConfig, saveAssistantList_ConfigPropertyNames);
|
|
3937
|
+
// Invalid or incomplete config
|
|
3938
|
+
if (config === null) {
|
|
3939
|
+
throw new Error('Invalid config for "saveAssistantList"');
|
|
3940
|
+
}
|
|
3941
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
3942
|
+
};
|
|
3943
|
+
};
|
|
3944
|
+
|
|
3945
|
+
function validate(obj, path = 'LightningAssistantQuestionnaireInputRepresentation') {
|
|
3946
|
+
const v_error = (() => {
|
|
3947
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3948
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3949
|
+
}
|
|
3950
|
+
const obj_questionToAnswer = obj.questionToAnswer;
|
|
3951
|
+
const path_questionToAnswer = path + '.questionToAnswer';
|
|
3952
|
+
if (typeof obj_questionToAnswer !== 'object' || ArrayIsArray(obj_questionToAnswer) || obj_questionToAnswer === null) {
|
|
3953
|
+
return new TypeError('Expected "object" but received "' + typeof obj_questionToAnswer + '" (at "' + path_questionToAnswer + '")');
|
|
3954
|
+
}
|
|
3955
|
+
const obj_questionToAnswer_keys = ObjectKeys(obj_questionToAnswer);
|
|
3956
|
+
for (let i = 0; i < obj_questionToAnswer_keys.length; i++) {
|
|
3957
|
+
const key = obj_questionToAnswer_keys[i];
|
|
3958
|
+
const obj_questionToAnswer_prop = obj_questionToAnswer[key];
|
|
3959
|
+
const path_questionToAnswer_prop = path_questionToAnswer + '["' + key + '"]';
|
|
3960
|
+
if (typeof obj_questionToAnswer_prop !== 'object' || ArrayIsArray(obj_questionToAnswer_prop) || obj_questionToAnswer_prop === null) {
|
|
3961
|
+
return new TypeError('Expected "object" but received "' + typeof obj_questionToAnswer_prop + '" (at "' + path_questionToAnswer_prop + '")');
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3964
|
+
const obj_status = obj.status;
|
|
3965
|
+
const path_status = path + '.status';
|
|
3966
|
+
if (typeof obj_status !== 'string') {
|
|
3967
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
3968
|
+
}
|
|
3969
|
+
})();
|
|
3970
|
+
return v_error === undefined ? null : v_error;
|
|
3971
|
+
}
|
|
3972
|
+
|
|
3973
|
+
function select(luvio, params) {
|
|
3974
|
+
return select$8();
|
|
3975
|
+
}
|
|
3976
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
3977
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
3978
|
+
}
|
|
3979
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
3980
|
+
const { body } = response;
|
|
3981
|
+
const key = keyBuilderFromType$2(luvio, body);
|
|
3982
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
3983
|
+
const snapshot = luvio.storeLookup({
|
|
3984
|
+
recordId: key,
|
|
3985
|
+
node: select(),
|
|
3986
|
+
variables: {},
|
|
3987
|
+
});
|
|
3988
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3989
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3990
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3991
|
+
}
|
|
3992
|
+
}
|
|
3993
|
+
deepFreeze(snapshot.data);
|
|
3994
|
+
return snapshot;
|
|
3995
|
+
}
|
|
3996
|
+
function createResourceRequest(config) {
|
|
3997
|
+
const headers = {};
|
|
3998
|
+
return {
|
|
3999
|
+
baseUri: '/services/data/v66.0',
|
|
4000
|
+
basePath: '/assistant-platform/questionnaire/' + config.urlParams.questionnaireName + '',
|
|
4001
|
+
method: 'patch',
|
|
4002
|
+
body: config.body,
|
|
4003
|
+
urlParams: config.urlParams,
|
|
4004
|
+
queryParams: {},
|
|
4005
|
+
headers,
|
|
4006
|
+
priority: 'normal',
|
|
4007
|
+
};
|
|
4008
|
+
}
|
|
4009
|
+
|
|
4010
|
+
const adapterName = 'saveQuestionnaire';
|
|
4011
|
+
const saveQuestionnaire_ConfigPropertyMetadata = [
|
|
4012
|
+
generateParamConfigMetadata('questionnaireName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
4013
|
+
generateParamConfigMetadata('questionnaireData', true, 2 /* Body */, 4 /* Unsupported */),
|
|
4014
|
+
];
|
|
4015
|
+
const saveQuestionnaire_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, saveQuestionnaire_ConfigPropertyMetadata);
|
|
4016
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$b(saveQuestionnaire_ConfigPropertyMetadata);
|
|
4017
|
+
function typeCheckConfig(untrustedConfig) {
|
|
4018
|
+
const config = {};
|
|
4019
|
+
typeCheckConfig$b(untrustedConfig, config, saveQuestionnaire_ConfigPropertyMetadata);
|
|
4020
|
+
const untrustedConfig_questionnaireData = untrustedConfig.questionnaireData;
|
|
4021
|
+
const referenceLightningAssistantQuestionnaireInputRepresentationValidationError = validate(untrustedConfig_questionnaireData);
|
|
4022
|
+
if (referenceLightningAssistantQuestionnaireInputRepresentationValidationError === null) {
|
|
4023
|
+
config.questionnaireData = untrustedConfig_questionnaireData;
|
|
4024
|
+
}
|
|
4025
|
+
return config;
|
|
4026
|
+
}
|
|
4027
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
4028
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
4029
|
+
return null;
|
|
4030
|
+
}
|
|
4031
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4032
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
4033
|
+
}
|
|
4034
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
4035
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
4036
|
+
return null;
|
|
4037
|
+
}
|
|
4038
|
+
return config;
|
|
4039
|
+
}
|
|
4040
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
4041
|
+
const resourceParams = createResourceParams(config);
|
|
4042
|
+
const request = createResourceRequest(resourceParams);
|
|
4043
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
4044
|
+
.then((response) => {
|
|
4045
|
+
return luvio.handleSuccessResponse(() => {
|
|
4046
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
4047
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
4048
|
+
}, () => {
|
|
4049
|
+
const cache = new StoreKeyMap();
|
|
4050
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
4051
|
+
return cache;
|
|
4052
|
+
});
|
|
4053
|
+
}, (response) => {
|
|
4054
|
+
deepFreeze(response);
|
|
4055
|
+
throw response;
|
|
4056
|
+
});
|
|
4057
|
+
}
|
|
4058
|
+
const saveQuestionnaireAdapterFactory = (luvio) => {
|
|
4059
|
+
return function saveQuestionnaire(untrustedConfig) {
|
|
4060
|
+
const config = validateAdapterConfig(untrustedConfig, saveQuestionnaire_ConfigPropertyNames);
|
|
4061
|
+
// Invalid or incomplete config
|
|
4062
|
+
if (config === null) {
|
|
4063
|
+
throw new Error('Invalid config for "saveQuestionnaire"');
|
|
4064
|
+
}
|
|
4065
|
+
return buildNetworkSnapshot(luvio, config);
|
|
4066
|
+
};
|
|
4067
|
+
};
|
|
4068
|
+
|
|
4069
|
+
let evaluateStep;
|
|
4070
|
+
let getAssistant;
|
|
4071
|
+
let getAssistantInfoList;
|
|
4072
|
+
let getAssistantInfoListNotifyChange;
|
|
4073
|
+
let getAssistantList;
|
|
4074
|
+
let getAssistantListNotifyChange;
|
|
4075
|
+
let getAssistantNotifyChange;
|
|
4076
|
+
let getAssistantTarget;
|
|
4077
|
+
let getAssistantTargetNotifyChange;
|
|
4078
|
+
let getQuestionnaire;
|
|
4079
|
+
let getQuestionnaireNotifyChange;
|
|
4080
|
+
let getQuestionnaires;
|
|
4081
|
+
let getQuestionnairesNotifyChange;
|
|
4082
|
+
let initialize;
|
|
4083
|
+
let saveAssistant;
|
|
4084
|
+
let saveAssistantList;
|
|
4085
|
+
let saveQuestionnaire;
|
|
4086
|
+
// Imperative GET Adapters
|
|
4087
|
+
let getAssistant_imperative;
|
|
4088
|
+
let getAssistantInfoList_imperative;
|
|
4089
|
+
let getAssistantList_imperative;
|
|
4090
|
+
let getAssistantTarget_imperative;
|
|
4091
|
+
let getQuestionnaire_imperative;
|
|
4092
|
+
let getQuestionnaires_imperative;
|
|
4093
|
+
const getAssistantMetadata = { apiFamily: 'LEAP', name: 'getAssistant' };
|
|
4094
|
+
const getAssistantInfoListMetadata = { apiFamily: 'LEAP', name: 'getAssistantInfoList' };
|
|
4095
|
+
const getAssistantListMetadata = { apiFamily: 'LEAP', name: 'getAssistantList' };
|
|
4096
|
+
const getAssistantTargetMetadata = { apiFamily: 'LEAP', name: 'getAssistantTarget' };
|
|
4097
|
+
const getQuestionnaireMetadata = { apiFamily: 'LEAP', name: 'getQuestionnaire' };
|
|
4098
|
+
const getQuestionnairesMetadata = { apiFamily: 'LEAP', name: 'getQuestionnaires' };
|
|
4099
|
+
// Notify Update Available
|
|
4100
|
+
function bindExportsTo(luvio) {
|
|
4101
|
+
// LDS Adapters
|
|
4102
|
+
const getAssistant_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getAssistant', getAssistantAdapterFactory), getAssistantMetadata);
|
|
4103
|
+
const getAssistantInfoList_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getAssistantInfoList', getAssistantInfoListAdapterFactory), getAssistantInfoListMetadata);
|
|
4104
|
+
const getAssistantList_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getAssistantList', getAssistantListAdapterFactory), getAssistantListMetadata);
|
|
4105
|
+
const getAssistantTarget_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getAssistantTarget', getAssistantTargetAdapterFactory), getAssistantTargetMetadata);
|
|
4106
|
+
const getQuestionnaire_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getQuestionnaire', getQuestionnaireAdapterFactory), getQuestionnaireMetadata);
|
|
4107
|
+
const getQuestionnaires_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getQuestionnaires', getQuestionnairesAdapterFactory), getQuestionnairesMetadata);
|
|
4108
|
+
function unwrapSnapshotData(factory) {
|
|
4109
|
+
const adapter = factory(luvio);
|
|
4110
|
+
return (config) => adapter(config).then((snapshot) => snapshot.data);
|
|
4111
|
+
}
|
|
4112
|
+
return {
|
|
4113
|
+
evaluateStep: unwrapSnapshotData(evaluateStepAdapterFactory),
|
|
4114
|
+
getAssistant: createWireAdapterConstructor(luvio, getAssistant_ldsAdapter, getAssistantMetadata),
|
|
4115
|
+
getAssistantInfoList: createWireAdapterConstructor(luvio, getAssistantInfoList_ldsAdapter, getAssistantInfoListMetadata),
|
|
4116
|
+
getAssistantInfoListNotifyChange: createLDSAdapter(luvio, 'getAssistantInfoListNotifyChange', notifyChangeFactory$4),
|
|
4117
|
+
getAssistantList: createWireAdapterConstructor(luvio, getAssistantList_ldsAdapter, getAssistantListMetadata),
|
|
4118
|
+
getAssistantListNotifyChange: createLDSAdapter(luvio, 'getAssistantListNotifyChange', notifyChangeFactory$3),
|
|
4119
|
+
getAssistantNotifyChange: createLDSAdapter(luvio, 'getAssistantNotifyChange', notifyChangeFactory$5),
|
|
4120
|
+
getAssistantTarget: createWireAdapterConstructor(luvio, getAssistantTarget_ldsAdapter, getAssistantTargetMetadata),
|
|
4121
|
+
getAssistantTargetNotifyChange: createLDSAdapter(luvio, 'getAssistantTargetNotifyChange', notifyChangeFactory$2),
|
|
4122
|
+
getQuestionnaire: createWireAdapterConstructor(luvio, getQuestionnaire_ldsAdapter, getQuestionnaireMetadata),
|
|
4123
|
+
getQuestionnaireNotifyChange: createLDSAdapter(luvio, 'getQuestionnaireNotifyChange', notifyChangeFactory$1),
|
|
4124
|
+
getQuestionnaires: createWireAdapterConstructor(luvio, getQuestionnaires_ldsAdapter, getQuestionnairesMetadata),
|
|
4125
|
+
getQuestionnairesNotifyChange: createLDSAdapter(luvio, 'getQuestionnairesNotifyChange', notifyChangeFactory),
|
|
4126
|
+
initialize: unwrapSnapshotData(initializeAdapterFactory),
|
|
4127
|
+
saveAssistant: unwrapSnapshotData(saveAssistantAdapterFactory),
|
|
4128
|
+
saveAssistantList: unwrapSnapshotData(saveAssistantListAdapterFactory),
|
|
4129
|
+
saveQuestionnaire: unwrapSnapshotData(saveQuestionnaireAdapterFactory),
|
|
4130
|
+
// Imperative GET Adapters
|
|
4131
|
+
getAssistant_imperative: createImperativeAdapter(luvio, getAssistant_ldsAdapter, getAssistantMetadata),
|
|
4132
|
+
getAssistantInfoList_imperative: createImperativeAdapter(luvio, getAssistantInfoList_ldsAdapter, getAssistantInfoListMetadata),
|
|
4133
|
+
getAssistantList_imperative: createImperativeAdapter(luvio, getAssistantList_ldsAdapter, getAssistantListMetadata),
|
|
4134
|
+
getAssistantTarget_imperative: createImperativeAdapter(luvio, getAssistantTarget_ldsAdapter, getAssistantTargetMetadata),
|
|
4135
|
+
getQuestionnaire_imperative: createImperativeAdapter(luvio, getQuestionnaire_ldsAdapter, getQuestionnaireMetadata),
|
|
4136
|
+
getQuestionnaires_imperative: createImperativeAdapter(luvio, getQuestionnaires_ldsAdapter, getQuestionnairesMetadata),
|
|
4137
|
+
// Notify Update Availables
|
|
4138
|
+
};
|
|
4139
|
+
}
|
|
4140
|
+
withDefaultLuvio((luvio) => {
|
|
4141
|
+
({
|
|
4142
|
+
evaluateStep,
|
|
4143
|
+
getAssistant,
|
|
4144
|
+
getAssistantInfoList,
|
|
4145
|
+
getAssistantInfoListNotifyChange,
|
|
4146
|
+
getAssistantList,
|
|
4147
|
+
getAssistantListNotifyChange,
|
|
4148
|
+
getAssistantNotifyChange,
|
|
4149
|
+
getAssistantTarget,
|
|
4150
|
+
getAssistantTargetNotifyChange,
|
|
4151
|
+
getQuestionnaire,
|
|
4152
|
+
getQuestionnaireNotifyChange,
|
|
4153
|
+
getQuestionnaires,
|
|
4154
|
+
getQuestionnairesNotifyChange,
|
|
4155
|
+
initialize,
|
|
4156
|
+
saveAssistant,
|
|
4157
|
+
saveAssistantList,
|
|
4158
|
+
saveQuestionnaire,
|
|
4159
|
+
getAssistant_imperative,
|
|
4160
|
+
getAssistantInfoList_imperative,
|
|
4161
|
+
getAssistantList_imperative,
|
|
4162
|
+
getAssistantTarget_imperative,
|
|
4163
|
+
getQuestionnaire_imperative,
|
|
4164
|
+
getQuestionnaires_imperative,
|
|
4165
|
+
} = bindExportsTo(luvio));
|
|
4166
|
+
});
|
|
4167
|
+
|
|
4168
|
+
export { evaluateStep, getAssistant, getAssistantInfoList, getAssistantInfoListNotifyChange, getAssistantInfoList_imperative, getAssistantList, getAssistantListNotifyChange, getAssistantList_imperative, getAssistantNotifyChange, getAssistantTarget, getAssistantTargetNotifyChange, getAssistantTarget_imperative, getAssistant_imperative, getQuestionnaire, getQuestionnaireNotifyChange, getQuestionnaire_imperative, getQuestionnaires, getQuestionnairesNotifyChange, getQuestionnaires_imperative, initialize, saveAssistant, saveAssistantList, saveQuestionnaire };
|
|
4169
|
+
// version: 0.1.0-dev1-c978a7b010
|