@salesforce/lds-adapters-service-articlefeedback 1.344.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +82 -0
- package/dist/es/es2018/service-articlefeedback.js +978 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/createSurveyInvitation.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/adapters/getArticleFeedbackResponsesPaginated.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/adapters/getSurveyInvitation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +3 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +7 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectArticleFeedbackInvitations.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectArticleFeedbackResponses.d.ts +20 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectArticleFeedbackInvitations.d.ts +13 -0
- package/dist/es/es2018/types/src/generated/types/ArticleFeedbackInvitationInputRepresentation.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/ArticleFeedbackInvitationRepresentation.d.ts +47 -0
- package/dist/es/es2018/types/src/generated/types/ArticleFeedbackQuestionResponseRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/ArticleFeedbackResponseCollectionRepresentation.d.ts +39 -0
- package/dist/es/es2018/types/src/generated/types/ArticleFeedbackResponseRepresentation.d.ts +54 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +66 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +1078 -0
- package/src/raml/api.raml +166 -0
- package/src/raml/luvio.raml +43 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,1078 @@
|
|
|
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$3, typeCheckConfig as typeCheckConfig$3, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2 } from 'force/luvioEngine';
|
|
18
|
+
|
|
19
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
|
+
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
21
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
22
|
+
/**
|
|
23
|
+
* Validates an adapter config is well-formed.
|
|
24
|
+
* @param config The config to validate.
|
|
25
|
+
* @param adapter The adapter validation configuration.
|
|
26
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
27
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
28
|
+
*/
|
|
29
|
+
function validateConfig(config, adapter, oneOf) {
|
|
30
|
+
const { displayName } = adapter;
|
|
31
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
32
|
+
if (config === undefined ||
|
|
33
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
34
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
35
|
+
}
|
|
36
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
37
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
38
|
+
}
|
|
39
|
+
if (unsupported !== undefined &&
|
|
40
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
41
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
42
|
+
}
|
|
43
|
+
const supported = required.concat(optional);
|
|
44
|
+
if (ObjectKeys(config).some(key => !supported.includes(key))) {
|
|
45
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function untrustedIsObject(untrusted) {
|
|
49
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
50
|
+
}
|
|
51
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
52
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
53
|
+
}
|
|
54
|
+
const snapshotRefreshOptions = {
|
|
55
|
+
overrides: {
|
|
56
|
+
headers: {
|
|
57
|
+
'Cache-Control': 'no-cache',
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
62
|
+
return {
|
|
63
|
+
name,
|
|
64
|
+
required,
|
|
65
|
+
resourceType,
|
|
66
|
+
typeCheckShape,
|
|
67
|
+
isArrayShape,
|
|
68
|
+
coerceFn,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
72
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
73
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
74
|
+
return {
|
|
75
|
+
displayName,
|
|
76
|
+
parameters: {
|
|
77
|
+
required,
|
|
78
|
+
optional,
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const keyPrefix = 'articlefeedback';
|
|
83
|
+
|
|
84
|
+
const { isArray: ArrayIsArray } = Array;
|
|
85
|
+
function equalsArray(a, b, equalsItem) {
|
|
86
|
+
const aLength = a.length;
|
|
87
|
+
const bLength = b.length;
|
|
88
|
+
if (aLength !== bLength) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
for (let i = 0; i < aLength; i++) {
|
|
92
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
function createLink(ref) {
|
|
99
|
+
return {
|
|
100
|
+
__ref: serializeStructuredKey(ref),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const TTL$2 = 300;
|
|
105
|
+
const VERSION$3 = "d359c272de3a58a5361447d52ad2c296";
|
|
106
|
+
function validate$3(obj, path = 'ArticleFeedbackInvitationRepresentation') {
|
|
107
|
+
const v_error = (() => {
|
|
108
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
109
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
110
|
+
}
|
|
111
|
+
const obj_invitationId = obj.invitationId;
|
|
112
|
+
const path_invitationId = path + '.invitationId';
|
|
113
|
+
let obj_invitationId_union0 = null;
|
|
114
|
+
const obj_invitationId_union0_error = (() => {
|
|
115
|
+
if (typeof obj_invitationId !== 'string') {
|
|
116
|
+
return new TypeError('Expected "string" but received "' + typeof obj_invitationId + '" (at "' + path_invitationId + '")');
|
|
117
|
+
}
|
|
118
|
+
})();
|
|
119
|
+
if (obj_invitationId_union0_error != null) {
|
|
120
|
+
obj_invitationId_union0 = obj_invitationId_union0_error.message;
|
|
121
|
+
}
|
|
122
|
+
let obj_invitationId_union1 = null;
|
|
123
|
+
const obj_invitationId_union1_error = (() => {
|
|
124
|
+
if (obj_invitationId !== null) {
|
|
125
|
+
return new TypeError('Expected "null" but received "' + typeof obj_invitationId + '" (at "' + path_invitationId + '")');
|
|
126
|
+
}
|
|
127
|
+
})();
|
|
128
|
+
if (obj_invitationId_union1_error != null) {
|
|
129
|
+
obj_invitationId_union1 = obj_invitationId_union1_error.message;
|
|
130
|
+
}
|
|
131
|
+
if (obj_invitationId_union0 && obj_invitationId_union1) {
|
|
132
|
+
let message = 'Object doesn\'t match union (at "' + path_invitationId + '")';
|
|
133
|
+
message += '\n' + obj_invitationId_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
134
|
+
message += '\n' + obj_invitationId_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
135
|
+
return new TypeError(message);
|
|
136
|
+
}
|
|
137
|
+
const obj_invitationUrl = obj.invitationUrl;
|
|
138
|
+
const path_invitationUrl = path + '.invitationUrl';
|
|
139
|
+
let obj_invitationUrl_union0 = null;
|
|
140
|
+
const obj_invitationUrl_union0_error = (() => {
|
|
141
|
+
if (typeof obj_invitationUrl !== 'string') {
|
|
142
|
+
return new TypeError('Expected "string" but received "' + typeof obj_invitationUrl + '" (at "' + path_invitationUrl + '")');
|
|
143
|
+
}
|
|
144
|
+
})();
|
|
145
|
+
if (obj_invitationUrl_union0_error != null) {
|
|
146
|
+
obj_invitationUrl_union0 = obj_invitationUrl_union0_error.message;
|
|
147
|
+
}
|
|
148
|
+
let obj_invitationUrl_union1 = null;
|
|
149
|
+
const obj_invitationUrl_union1_error = (() => {
|
|
150
|
+
if (obj_invitationUrl !== null) {
|
|
151
|
+
return new TypeError('Expected "null" but received "' + typeof obj_invitationUrl + '" (at "' + path_invitationUrl + '")');
|
|
152
|
+
}
|
|
153
|
+
})();
|
|
154
|
+
if (obj_invitationUrl_union1_error != null) {
|
|
155
|
+
obj_invitationUrl_union1 = obj_invitationUrl_union1_error.message;
|
|
156
|
+
}
|
|
157
|
+
if (obj_invitationUrl_union0 && obj_invitationUrl_union1) {
|
|
158
|
+
let message = 'Object doesn\'t match union (at "' + path_invitationUrl + '")';
|
|
159
|
+
message += '\n' + obj_invitationUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
160
|
+
message += '\n' + obj_invitationUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
161
|
+
return new TypeError(message);
|
|
162
|
+
}
|
|
163
|
+
const obj_knowledgeArticleVersionId = obj.knowledgeArticleVersionId;
|
|
164
|
+
const path_knowledgeArticleVersionId = path + '.knowledgeArticleVersionId';
|
|
165
|
+
if (typeof obj_knowledgeArticleVersionId !== 'string') {
|
|
166
|
+
return new TypeError('Expected "string" but received "' + typeof obj_knowledgeArticleVersionId + '" (at "' + path_knowledgeArticleVersionId + '")');
|
|
167
|
+
}
|
|
168
|
+
const obj_responseSubmitted = obj.responseSubmitted;
|
|
169
|
+
const path_responseSubmitted = path + '.responseSubmitted';
|
|
170
|
+
let obj_responseSubmitted_union0 = null;
|
|
171
|
+
const obj_responseSubmitted_union0_error = (() => {
|
|
172
|
+
if (typeof obj_responseSubmitted !== 'boolean') {
|
|
173
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_responseSubmitted + '" (at "' + path_responseSubmitted + '")');
|
|
174
|
+
}
|
|
175
|
+
})();
|
|
176
|
+
if (obj_responseSubmitted_union0_error != null) {
|
|
177
|
+
obj_responseSubmitted_union0 = obj_responseSubmitted_union0_error.message;
|
|
178
|
+
}
|
|
179
|
+
let obj_responseSubmitted_union1 = null;
|
|
180
|
+
const obj_responseSubmitted_union1_error = (() => {
|
|
181
|
+
if (obj_responseSubmitted !== null) {
|
|
182
|
+
return new TypeError('Expected "null" but received "' + typeof obj_responseSubmitted + '" (at "' + path_responseSubmitted + '")');
|
|
183
|
+
}
|
|
184
|
+
})();
|
|
185
|
+
if (obj_responseSubmitted_union1_error != null) {
|
|
186
|
+
obj_responseSubmitted_union1 = obj_responseSubmitted_union1_error.message;
|
|
187
|
+
}
|
|
188
|
+
if (obj_responseSubmitted_union0 && obj_responseSubmitted_union1) {
|
|
189
|
+
let message = 'Object doesn\'t match union (at "' + path_responseSubmitted + '")';
|
|
190
|
+
message += '\n' + obj_responseSubmitted_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
191
|
+
message += '\n' + obj_responseSubmitted_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
192
|
+
return new TypeError(message);
|
|
193
|
+
}
|
|
194
|
+
})();
|
|
195
|
+
return v_error === undefined ? null : v_error;
|
|
196
|
+
}
|
|
197
|
+
const RepresentationType$2 = 'ArticleFeedbackInvitationRepresentation';
|
|
198
|
+
function keyBuilder$5(luvio, config) {
|
|
199
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.id;
|
|
200
|
+
}
|
|
201
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
202
|
+
const keyParams = {
|
|
203
|
+
id: object.knowledgeArticleVersionId
|
|
204
|
+
};
|
|
205
|
+
return keyBuilder$5(luvio, keyParams);
|
|
206
|
+
}
|
|
207
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
208
|
+
return input;
|
|
209
|
+
}
|
|
210
|
+
const select$6 = function ArticleFeedbackInvitationRepresentationSelect() {
|
|
211
|
+
return {
|
|
212
|
+
kind: 'Fragment',
|
|
213
|
+
version: VERSION$3,
|
|
214
|
+
private: [],
|
|
215
|
+
selections: [
|
|
216
|
+
{
|
|
217
|
+
name: 'invitationId',
|
|
218
|
+
kind: 'Scalar'
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: 'invitationUrl',
|
|
222
|
+
kind: 'Scalar'
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: 'knowledgeArticleVersionId',
|
|
226
|
+
kind: 'Scalar'
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: 'responseSubmitted',
|
|
230
|
+
kind: 'Scalar'
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
function equals$3(existing, incoming) {
|
|
236
|
+
const existing_knowledgeArticleVersionId = existing.knowledgeArticleVersionId;
|
|
237
|
+
const incoming_knowledgeArticleVersionId = incoming.knowledgeArticleVersionId;
|
|
238
|
+
if (!(existing_knowledgeArticleVersionId === incoming_knowledgeArticleVersionId)) {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
const existing_invitationId = existing.invitationId;
|
|
242
|
+
const incoming_invitationId = incoming.invitationId;
|
|
243
|
+
if (!(existing_invitationId === incoming_invitationId)) {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
const existing_invitationUrl = existing.invitationUrl;
|
|
247
|
+
const incoming_invitationUrl = incoming.invitationUrl;
|
|
248
|
+
if (!(existing_invitationUrl === incoming_invitationUrl)) {
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
const existing_responseSubmitted = existing.responseSubmitted;
|
|
252
|
+
const incoming_responseSubmitted = incoming.responseSubmitted;
|
|
253
|
+
if (!(existing_responseSubmitted === incoming_responseSubmitted)) {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
return true;
|
|
257
|
+
}
|
|
258
|
+
const ingest$2 = function ArticleFeedbackInvitationRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
259
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
260
|
+
const validateError = validate$3(input);
|
|
261
|
+
if (validateError !== null) {
|
|
262
|
+
throw validateError;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
266
|
+
const ttlToUse = TTL$2;
|
|
267
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "articlefeedback", VERSION$3, RepresentationType$2, equals$3);
|
|
268
|
+
return createLink(key);
|
|
269
|
+
};
|
|
270
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
271
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
272
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
273
|
+
rootKeySet.set(rootKey, {
|
|
274
|
+
namespace: keyPrefix,
|
|
275
|
+
representationName: RepresentationType$2,
|
|
276
|
+
mergeable: false
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function select$5(luvio, params) {
|
|
281
|
+
return select$6();
|
|
282
|
+
}
|
|
283
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
284
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
285
|
+
}
|
|
286
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
287
|
+
const { body } = response;
|
|
288
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
289
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
290
|
+
const snapshot = luvio.storeLookup({
|
|
291
|
+
recordId: key,
|
|
292
|
+
node: select$5(),
|
|
293
|
+
variables: {},
|
|
294
|
+
});
|
|
295
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
296
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
297
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
deepFreeze(snapshot.data);
|
|
301
|
+
return snapshot;
|
|
302
|
+
}
|
|
303
|
+
function createResourceRequest$2(config) {
|
|
304
|
+
const headers = {};
|
|
305
|
+
return {
|
|
306
|
+
baseUri: '/services/data/v64.0',
|
|
307
|
+
basePath: '/connect/article-feedback/invitations',
|
|
308
|
+
method: 'post',
|
|
309
|
+
body: config.body,
|
|
310
|
+
urlParams: {},
|
|
311
|
+
queryParams: {},
|
|
312
|
+
headers,
|
|
313
|
+
priority: 'normal',
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const adapterName$2 = 'createSurveyInvitation';
|
|
318
|
+
const createSurveyInvitation_ConfigPropertyMetadata = [
|
|
319
|
+
generateParamConfigMetadata('communityId', false, 2 /* Body */, 0 /* String */),
|
|
320
|
+
generateParamConfigMetadata('knowledgeArticleVersionId', true, 2 /* Body */, 0 /* String */),
|
|
321
|
+
];
|
|
322
|
+
const createSurveyInvitation_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, createSurveyInvitation_ConfigPropertyMetadata);
|
|
323
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(createSurveyInvitation_ConfigPropertyMetadata);
|
|
324
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
325
|
+
const config = {};
|
|
326
|
+
typeCheckConfig$3(untrustedConfig, config, createSurveyInvitation_ConfigPropertyMetadata);
|
|
327
|
+
return config;
|
|
328
|
+
}
|
|
329
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
330
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
331
|
+
return null;
|
|
332
|
+
}
|
|
333
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
334
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
335
|
+
}
|
|
336
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
337
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
338
|
+
return null;
|
|
339
|
+
}
|
|
340
|
+
return config;
|
|
341
|
+
}
|
|
342
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
343
|
+
const resourceParams = createResourceParams$2(config);
|
|
344
|
+
const request = createResourceRequest$2(resourceParams);
|
|
345
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
346
|
+
.then((response) => {
|
|
347
|
+
return luvio.handleSuccessResponse(() => {
|
|
348
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
349
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
350
|
+
}, () => {
|
|
351
|
+
const cache = new StoreKeyMap();
|
|
352
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
353
|
+
return cache;
|
|
354
|
+
});
|
|
355
|
+
}, (response) => {
|
|
356
|
+
deepFreeze(response);
|
|
357
|
+
throw response;
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
const createSurveyInvitationAdapterFactory = (luvio) => {
|
|
361
|
+
return function createSurveyInvitation(untrustedConfig) {
|
|
362
|
+
const config = validateAdapterConfig$2(untrustedConfig, createSurveyInvitation_ConfigPropertyNames);
|
|
363
|
+
// Invalid or incomplete config
|
|
364
|
+
if (config === null) {
|
|
365
|
+
throw new Error('Invalid config for "createSurveyInvitation"');
|
|
366
|
+
}
|
|
367
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
const VERSION$2 = "f8d3926087c897d275e01cb038f7baa2";
|
|
372
|
+
function validate$2(obj, path = 'ArticleFeedbackQuestionResponseRepresentation') {
|
|
373
|
+
const v_error = (() => {
|
|
374
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
375
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
376
|
+
}
|
|
377
|
+
const obj_questionName = obj.questionName;
|
|
378
|
+
const path_questionName = path + '.questionName';
|
|
379
|
+
if (typeof obj_questionName !== 'string') {
|
|
380
|
+
return new TypeError('Expected "string" but received "' + typeof obj_questionName + '" (at "' + path_questionName + '")');
|
|
381
|
+
}
|
|
382
|
+
const obj_questionOrder = obj.questionOrder;
|
|
383
|
+
const path_questionOrder = path + '.questionOrder';
|
|
384
|
+
if (typeof obj_questionOrder !== 'number' || (typeof obj_questionOrder === 'number' && Math.floor(obj_questionOrder) !== obj_questionOrder)) {
|
|
385
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_questionOrder + '" (at "' + path_questionOrder + '")');
|
|
386
|
+
}
|
|
387
|
+
const obj_questionResponse = obj.questionResponse;
|
|
388
|
+
const path_questionResponse = path + '.questionResponse';
|
|
389
|
+
if (typeof obj_questionResponse !== 'string') {
|
|
390
|
+
return new TypeError('Expected "string" but received "' + typeof obj_questionResponse + '" (at "' + path_questionResponse + '")');
|
|
391
|
+
}
|
|
392
|
+
const obj_questionType = obj.questionType;
|
|
393
|
+
const path_questionType = path + '.questionType';
|
|
394
|
+
if (typeof obj_questionType !== 'string') {
|
|
395
|
+
return new TypeError('Expected "string" but received "' + typeof obj_questionType + '" (at "' + path_questionType + '")');
|
|
396
|
+
}
|
|
397
|
+
})();
|
|
398
|
+
return v_error === undefined ? null : v_error;
|
|
399
|
+
}
|
|
400
|
+
const select$4 = function ArticleFeedbackQuestionResponseRepresentationSelect() {
|
|
401
|
+
return {
|
|
402
|
+
kind: 'Fragment',
|
|
403
|
+
version: VERSION$2,
|
|
404
|
+
private: [],
|
|
405
|
+
selections: [
|
|
406
|
+
{
|
|
407
|
+
name: 'questionName',
|
|
408
|
+
kind: 'Scalar'
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
name: 'questionOrder',
|
|
412
|
+
kind: 'Scalar'
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
name: 'questionResponse',
|
|
416
|
+
kind: 'Scalar'
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
name: 'questionType',
|
|
420
|
+
kind: 'Scalar'
|
|
421
|
+
}
|
|
422
|
+
]
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
function equals$2(existing, incoming) {
|
|
426
|
+
const existing_questionOrder = existing.questionOrder;
|
|
427
|
+
const incoming_questionOrder = incoming.questionOrder;
|
|
428
|
+
if (!(existing_questionOrder === incoming_questionOrder)) {
|
|
429
|
+
return false;
|
|
430
|
+
}
|
|
431
|
+
const existing_questionName = existing.questionName;
|
|
432
|
+
const incoming_questionName = incoming.questionName;
|
|
433
|
+
if (!(existing_questionName === incoming_questionName)) {
|
|
434
|
+
return false;
|
|
435
|
+
}
|
|
436
|
+
const existing_questionResponse = existing.questionResponse;
|
|
437
|
+
const incoming_questionResponse = incoming.questionResponse;
|
|
438
|
+
if (!(existing_questionResponse === incoming_questionResponse)) {
|
|
439
|
+
return false;
|
|
440
|
+
}
|
|
441
|
+
const existing_questionType = existing.questionType;
|
|
442
|
+
const incoming_questionType = incoming.questionType;
|
|
443
|
+
if (!(existing_questionType === incoming_questionType)) {
|
|
444
|
+
return false;
|
|
445
|
+
}
|
|
446
|
+
return true;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
const TTL$1 = 300;
|
|
450
|
+
const VERSION$1 = "746d0590aaa94fa8b4d6bba8a86ecea8";
|
|
451
|
+
function validate$1(obj, path = 'ArticleFeedbackResponseRepresentation') {
|
|
452
|
+
const v_error = (() => {
|
|
453
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
454
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
455
|
+
}
|
|
456
|
+
const obj_articleFeedbackQuestionResponseRepresentationList = obj.articleFeedbackQuestionResponseRepresentationList;
|
|
457
|
+
const path_articleFeedbackQuestionResponseRepresentationList = path + '.articleFeedbackQuestionResponseRepresentationList';
|
|
458
|
+
if (!ArrayIsArray(obj_articleFeedbackQuestionResponseRepresentationList)) {
|
|
459
|
+
return new TypeError('Expected "array" but received "' + typeof obj_articleFeedbackQuestionResponseRepresentationList + '" (at "' + path_articleFeedbackQuestionResponseRepresentationList + '")');
|
|
460
|
+
}
|
|
461
|
+
for (let i = 0; i < obj_articleFeedbackQuestionResponseRepresentationList.length; i++) {
|
|
462
|
+
const obj_articleFeedbackQuestionResponseRepresentationList_item = obj_articleFeedbackQuestionResponseRepresentationList[i];
|
|
463
|
+
const path_articleFeedbackQuestionResponseRepresentationList_item = path_articleFeedbackQuestionResponseRepresentationList + '[' + i + ']';
|
|
464
|
+
const referencepath_articleFeedbackQuestionResponseRepresentationList_itemValidationError = validate$2(obj_articleFeedbackQuestionResponseRepresentationList_item, path_articleFeedbackQuestionResponseRepresentationList_item);
|
|
465
|
+
if (referencepath_articleFeedbackQuestionResponseRepresentationList_itemValidationError !== null) {
|
|
466
|
+
let message = 'Object doesn\'t match ArticleFeedbackQuestionResponseRepresentation (at "' + path_articleFeedbackQuestionResponseRepresentationList_item + '")\n';
|
|
467
|
+
message += referencepath_articleFeedbackQuestionResponseRepresentationList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
468
|
+
return new TypeError(message);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
const obj_completionDate = obj.completionDate;
|
|
472
|
+
const path_completionDate = path + '.completionDate';
|
|
473
|
+
if (typeof obj_completionDate !== 'string') {
|
|
474
|
+
return new TypeError('Expected "string" but received "' + typeof obj_completionDate + '" (at "' + path_completionDate + '")');
|
|
475
|
+
}
|
|
476
|
+
const obj_responseId = obj.responseId;
|
|
477
|
+
const path_responseId = path + '.responseId';
|
|
478
|
+
if (typeof obj_responseId !== 'string') {
|
|
479
|
+
return new TypeError('Expected "string" but received "' + typeof obj_responseId + '" (at "' + path_responseId + '")');
|
|
480
|
+
}
|
|
481
|
+
const obj_responseName = obj.responseName;
|
|
482
|
+
const path_responseName = path + '.responseName';
|
|
483
|
+
if (typeof obj_responseName !== 'string') {
|
|
484
|
+
return new TypeError('Expected "string" but received "' + typeof obj_responseName + '" (at "' + path_responseName + '")');
|
|
485
|
+
}
|
|
486
|
+
const obj_submitterId = obj.submitterId;
|
|
487
|
+
const path_submitterId = path + '.submitterId';
|
|
488
|
+
if (typeof obj_submitterId !== 'string') {
|
|
489
|
+
return new TypeError('Expected "string" but received "' + typeof obj_submitterId + '" (at "' + path_submitterId + '")');
|
|
490
|
+
}
|
|
491
|
+
const obj_submitterName = obj.submitterName;
|
|
492
|
+
const path_submitterName = path + '.submitterName';
|
|
493
|
+
if (typeof obj_submitterName !== 'string') {
|
|
494
|
+
return new TypeError('Expected "string" but received "' + typeof obj_submitterName + '" (at "' + path_submitterName + '")');
|
|
495
|
+
}
|
|
496
|
+
})();
|
|
497
|
+
return v_error === undefined ? null : v_error;
|
|
498
|
+
}
|
|
499
|
+
const RepresentationType$1 = 'ArticleFeedbackResponseRepresentation';
|
|
500
|
+
function keyBuilder$4(luvio, config) {
|
|
501
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.id;
|
|
502
|
+
}
|
|
503
|
+
function keyBuilderFromType(luvio, object) {
|
|
504
|
+
const keyParams = {
|
|
505
|
+
id: object.responseId
|
|
506
|
+
};
|
|
507
|
+
return keyBuilder$4(luvio, keyParams);
|
|
508
|
+
}
|
|
509
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
510
|
+
return input;
|
|
511
|
+
}
|
|
512
|
+
const select$3 = function ArticleFeedbackResponseRepresentationSelect() {
|
|
513
|
+
const { selections: ArticleFeedbackQuestionResponseRepresentation__selections, opaque: ArticleFeedbackQuestionResponseRepresentation__opaque, } = select$4();
|
|
514
|
+
return {
|
|
515
|
+
kind: 'Fragment',
|
|
516
|
+
version: VERSION$1,
|
|
517
|
+
private: [],
|
|
518
|
+
selections: [
|
|
519
|
+
{
|
|
520
|
+
name: 'articleFeedbackQuestionResponseRepresentationList',
|
|
521
|
+
kind: 'Object',
|
|
522
|
+
plural: true,
|
|
523
|
+
selections: ArticleFeedbackQuestionResponseRepresentation__selections
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
name: 'completionDate',
|
|
527
|
+
kind: 'Scalar'
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
name: 'responseId',
|
|
531
|
+
kind: 'Scalar'
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
name: 'responseName',
|
|
535
|
+
kind: 'Scalar'
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
name: 'submitterId',
|
|
539
|
+
kind: 'Scalar'
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
name: 'submitterName',
|
|
543
|
+
kind: 'Scalar'
|
|
544
|
+
}
|
|
545
|
+
]
|
|
546
|
+
};
|
|
547
|
+
};
|
|
548
|
+
function equals$1(existing, incoming) {
|
|
549
|
+
const existing_completionDate = existing.completionDate;
|
|
550
|
+
const incoming_completionDate = incoming.completionDate;
|
|
551
|
+
if (!(existing_completionDate === incoming_completionDate)) {
|
|
552
|
+
return false;
|
|
553
|
+
}
|
|
554
|
+
const existing_responseId = existing.responseId;
|
|
555
|
+
const incoming_responseId = incoming.responseId;
|
|
556
|
+
if (!(existing_responseId === incoming_responseId)) {
|
|
557
|
+
return false;
|
|
558
|
+
}
|
|
559
|
+
const existing_responseName = existing.responseName;
|
|
560
|
+
const incoming_responseName = incoming.responseName;
|
|
561
|
+
if (!(existing_responseName === incoming_responseName)) {
|
|
562
|
+
return false;
|
|
563
|
+
}
|
|
564
|
+
const existing_submitterId = existing.submitterId;
|
|
565
|
+
const incoming_submitterId = incoming.submitterId;
|
|
566
|
+
if (!(existing_submitterId === incoming_submitterId)) {
|
|
567
|
+
return false;
|
|
568
|
+
}
|
|
569
|
+
const existing_submitterName = existing.submitterName;
|
|
570
|
+
const incoming_submitterName = incoming.submitterName;
|
|
571
|
+
if (!(existing_submitterName === incoming_submitterName)) {
|
|
572
|
+
return false;
|
|
573
|
+
}
|
|
574
|
+
const existing_articleFeedbackQuestionResponseRepresentationList = existing.articleFeedbackQuestionResponseRepresentationList;
|
|
575
|
+
const incoming_articleFeedbackQuestionResponseRepresentationList = incoming.articleFeedbackQuestionResponseRepresentationList;
|
|
576
|
+
const equals_articleFeedbackQuestionResponseRepresentationList_items = equalsArray(existing_articleFeedbackQuestionResponseRepresentationList, incoming_articleFeedbackQuestionResponseRepresentationList, (existing_articleFeedbackQuestionResponseRepresentationList_item, incoming_articleFeedbackQuestionResponseRepresentationList_item) => {
|
|
577
|
+
if (!(equals$2(existing_articleFeedbackQuestionResponseRepresentationList_item, incoming_articleFeedbackQuestionResponseRepresentationList_item))) {
|
|
578
|
+
return false;
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
if (equals_articleFeedbackQuestionResponseRepresentationList_items === false) {
|
|
582
|
+
return false;
|
|
583
|
+
}
|
|
584
|
+
return true;
|
|
585
|
+
}
|
|
586
|
+
const ingest$1 = function ArticleFeedbackResponseRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
587
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
588
|
+
const validateError = validate$1(input);
|
|
589
|
+
if (validateError !== null) {
|
|
590
|
+
throw validateError;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
const key = keyBuilderFromType(luvio, input);
|
|
594
|
+
const ttlToUse = TTL$1;
|
|
595
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "articlefeedback", VERSION$1, RepresentationType$1, equals$1);
|
|
596
|
+
return createLink(key);
|
|
597
|
+
};
|
|
598
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
599
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
600
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
601
|
+
rootKeySet.set(rootKey, {
|
|
602
|
+
namespace: keyPrefix,
|
|
603
|
+
representationName: RepresentationType$1,
|
|
604
|
+
mergeable: false
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
const TTL = 300;
|
|
609
|
+
const VERSION = "54877326778a280d2dc278a8765e57bd";
|
|
610
|
+
function validate(obj, path = 'ArticleFeedbackResponseCollectionRepresentation') {
|
|
611
|
+
const v_error = (() => {
|
|
612
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
613
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
614
|
+
}
|
|
615
|
+
const obj_articleFeedbackResponseRepresentationList = obj.articleFeedbackResponseRepresentationList;
|
|
616
|
+
const path_articleFeedbackResponseRepresentationList = path + '.articleFeedbackResponseRepresentationList';
|
|
617
|
+
if (!ArrayIsArray(obj_articleFeedbackResponseRepresentationList)) {
|
|
618
|
+
return new TypeError('Expected "array" but received "' + typeof obj_articleFeedbackResponseRepresentationList + '" (at "' + path_articleFeedbackResponseRepresentationList + '")');
|
|
619
|
+
}
|
|
620
|
+
for (let i = 0; i < obj_articleFeedbackResponseRepresentationList.length; i++) {
|
|
621
|
+
const obj_articleFeedbackResponseRepresentationList_item = obj_articleFeedbackResponseRepresentationList[i];
|
|
622
|
+
const path_articleFeedbackResponseRepresentationList_item = path_articleFeedbackResponseRepresentationList + '[' + i + ']';
|
|
623
|
+
if (typeof obj_articleFeedbackResponseRepresentationList_item !== 'object') {
|
|
624
|
+
return new TypeError('Expected "object" but received "' + typeof obj_articleFeedbackResponseRepresentationList_item + '" (at "' + path_articleFeedbackResponseRepresentationList_item + '")');
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
})();
|
|
628
|
+
return v_error === undefined ? null : v_error;
|
|
629
|
+
}
|
|
630
|
+
const RepresentationType = 'ArticleFeedbackResponseCollectionRepresentation';
|
|
631
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
632
|
+
const input_articleFeedbackResponseRepresentationList = input.articleFeedbackResponseRepresentationList;
|
|
633
|
+
const input_articleFeedbackResponseRepresentationList_id = path.fullPath + '__articleFeedbackResponseRepresentationList';
|
|
634
|
+
for (let i = 0; i < input_articleFeedbackResponseRepresentationList.length; i++) {
|
|
635
|
+
const input_articleFeedbackResponseRepresentationList_item = input_articleFeedbackResponseRepresentationList[i];
|
|
636
|
+
let input_articleFeedbackResponseRepresentationList_item_id = input_articleFeedbackResponseRepresentationList_id + '__' + i;
|
|
637
|
+
input_articleFeedbackResponseRepresentationList[i] = ingest$1(input_articleFeedbackResponseRepresentationList_item, {
|
|
638
|
+
fullPath: input_articleFeedbackResponseRepresentationList_item_id,
|
|
639
|
+
propertyName: i,
|
|
640
|
+
parent: {
|
|
641
|
+
data: input,
|
|
642
|
+
key: path.fullPath,
|
|
643
|
+
existing: existing,
|
|
644
|
+
},
|
|
645
|
+
ttl: path.ttl
|
|
646
|
+
}, luvio, store, timestamp);
|
|
647
|
+
}
|
|
648
|
+
return input;
|
|
649
|
+
}
|
|
650
|
+
const select$2 = function ArticleFeedbackResponseCollectionRepresentationSelect() {
|
|
651
|
+
return {
|
|
652
|
+
kind: 'Fragment',
|
|
653
|
+
version: VERSION,
|
|
654
|
+
private: [],
|
|
655
|
+
selections: [
|
|
656
|
+
{
|
|
657
|
+
name: 'articleFeedbackResponseRepresentationList',
|
|
658
|
+
kind: 'Link',
|
|
659
|
+
plural: true,
|
|
660
|
+
fragment: select$3()
|
|
661
|
+
}
|
|
662
|
+
]
|
|
663
|
+
};
|
|
664
|
+
};
|
|
665
|
+
function equals(existing, incoming) {
|
|
666
|
+
const existing_articleFeedbackResponseRepresentationList = existing.articleFeedbackResponseRepresentationList;
|
|
667
|
+
const incoming_articleFeedbackResponseRepresentationList = incoming.articleFeedbackResponseRepresentationList;
|
|
668
|
+
const equals_articleFeedbackResponseRepresentationList_items = equalsArray(existing_articleFeedbackResponseRepresentationList, incoming_articleFeedbackResponseRepresentationList, (existing_articleFeedbackResponseRepresentationList_item, incoming_articleFeedbackResponseRepresentationList_item) => {
|
|
669
|
+
if (!(existing_articleFeedbackResponseRepresentationList_item.__ref === incoming_articleFeedbackResponseRepresentationList_item.__ref)) {
|
|
670
|
+
return false;
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
if (equals_articleFeedbackResponseRepresentationList_items === false) {
|
|
674
|
+
return false;
|
|
675
|
+
}
|
|
676
|
+
return true;
|
|
677
|
+
}
|
|
678
|
+
const ingest = function ArticleFeedbackResponseCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
679
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
680
|
+
const validateError = validate(input);
|
|
681
|
+
if (validateError !== null) {
|
|
682
|
+
throw validateError;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
const key = path.fullPath;
|
|
686
|
+
const ttlToUse = TTL;
|
|
687
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "articlefeedback", VERSION, RepresentationType, equals);
|
|
688
|
+
return createLink(key);
|
|
689
|
+
};
|
|
690
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
691
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
692
|
+
const rootKey = fullPathFactory();
|
|
693
|
+
rootKeySet.set(rootKey, {
|
|
694
|
+
namespace: keyPrefix,
|
|
695
|
+
representationName: RepresentationType,
|
|
696
|
+
mergeable: false
|
|
697
|
+
});
|
|
698
|
+
const input_articleFeedbackResponseRepresentationList_length = input.articleFeedbackResponseRepresentationList.length;
|
|
699
|
+
for (let i = 0; i < input_articleFeedbackResponseRepresentationList_length; i++) {
|
|
700
|
+
getTypeCacheKeys$1(rootKeySet, luvio, input.articleFeedbackResponseRepresentationList[i]);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
function select$1(luvio, params) {
|
|
705
|
+
return select$2();
|
|
706
|
+
}
|
|
707
|
+
function keyBuilder$3(luvio, params) {
|
|
708
|
+
return keyPrefix + '::ArticleFeedbackResponseCollectionRepresentation:(' + 'communityId:' + params.queryParams.communityId + ',' + 'isUserResponse:' + params.queryParams.isUserResponse + ',' + 'knowledgeArticleVersionId:' + params.queryParams.knowledgeArticleVersionId + ',' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'orderBy:' + params.queryParams.orderBy + ')';
|
|
709
|
+
}
|
|
710
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
711
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
712
|
+
}
|
|
713
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
714
|
+
const { body } = response;
|
|
715
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
716
|
+
luvio.storeIngest(key, ingest, body);
|
|
717
|
+
const snapshot = luvio.storeLookup({
|
|
718
|
+
recordId: key,
|
|
719
|
+
node: select$1(),
|
|
720
|
+
variables: {},
|
|
721
|
+
}, snapshotRefresh);
|
|
722
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
723
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
724
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
deepFreeze(snapshot.data);
|
|
728
|
+
return snapshot;
|
|
729
|
+
}
|
|
730
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
731
|
+
const key = keyBuilder$3(luvio, params);
|
|
732
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
733
|
+
const storeMetadataParams = {
|
|
734
|
+
ttl: TTL,
|
|
735
|
+
namespace: keyPrefix,
|
|
736
|
+
version: VERSION,
|
|
737
|
+
representationName: RepresentationType
|
|
738
|
+
};
|
|
739
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
740
|
+
return errorSnapshot;
|
|
741
|
+
}
|
|
742
|
+
function createResourceRequest$1(config) {
|
|
743
|
+
const headers = {};
|
|
744
|
+
return {
|
|
745
|
+
baseUri: '/services/data/v64.0',
|
|
746
|
+
basePath: '/connect/article-feedback/responses',
|
|
747
|
+
method: 'get',
|
|
748
|
+
body: null,
|
|
749
|
+
urlParams: {},
|
|
750
|
+
queryParams: config.queryParams,
|
|
751
|
+
headers,
|
|
752
|
+
priority: 'normal',
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
const adapterName$1 = 'getArticleFeedbackResponsesPaginated';
|
|
757
|
+
const getArticleFeedbackResponsesPaginated_ConfigPropertyMetadata = [
|
|
758
|
+
generateParamConfigMetadata('communityId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
759
|
+
generateParamConfigMetadata('isUserResponse', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
760
|
+
generateParamConfigMetadata('knowledgeArticleVersionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
761
|
+
generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
762
|
+
generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
763
|
+
generateParamConfigMetadata('orderBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
764
|
+
];
|
|
765
|
+
const getArticleFeedbackResponsesPaginated_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getArticleFeedbackResponsesPaginated_ConfigPropertyMetadata);
|
|
766
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(getArticleFeedbackResponsesPaginated_ConfigPropertyMetadata);
|
|
767
|
+
function keyBuilder$2(luvio, config) {
|
|
768
|
+
const resourceParams = createResourceParams$1(config);
|
|
769
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
770
|
+
}
|
|
771
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
772
|
+
const config = {};
|
|
773
|
+
typeCheckConfig$3(untrustedConfig, config, getArticleFeedbackResponsesPaginated_ConfigPropertyMetadata);
|
|
774
|
+
return config;
|
|
775
|
+
}
|
|
776
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
777
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
778
|
+
return null;
|
|
779
|
+
}
|
|
780
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
781
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
782
|
+
}
|
|
783
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
784
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
785
|
+
return null;
|
|
786
|
+
}
|
|
787
|
+
return config;
|
|
788
|
+
}
|
|
789
|
+
function adapterFragment$1(luvio, config) {
|
|
790
|
+
createResourceParams$1(config);
|
|
791
|
+
return select$1();
|
|
792
|
+
}
|
|
793
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
794
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
795
|
+
config,
|
|
796
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
797
|
+
});
|
|
798
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
799
|
+
}
|
|
800
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
801
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
802
|
+
config,
|
|
803
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
804
|
+
});
|
|
805
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
806
|
+
}
|
|
807
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
808
|
+
const resourceParams = createResourceParams$1(config);
|
|
809
|
+
const request = createResourceRequest$1(resourceParams);
|
|
810
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
811
|
+
.then((response) => {
|
|
812
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
813
|
+
const cache = new StoreKeyMap();
|
|
814
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
815
|
+
return cache;
|
|
816
|
+
});
|
|
817
|
+
}, (response) => {
|
|
818
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
822
|
+
return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
823
|
+
}
|
|
824
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
825
|
+
const { luvio, config } = context;
|
|
826
|
+
const selector = {
|
|
827
|
+
recordId: keyBuilder$2(luvio, config),
|
|
828
|
+
node: adapterFragment$1(luvio, config),
|
|
829
|
+
variables: {},
|
|
830
|
+
};
|
|
831
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
832
|
+
config,
|
|
833
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
834
|
+
});
|
|
835
|
+
return cacheSnapshot;
|
|
836
|
+
}
|
|
837
|
+
const getArticleFeedbackResponsesPaginatedAdapterFactory = (luvio) => function articlefeedback__getArticleFeedbackResponsesPaginated(untrustedConfig, requestContext) {
|
|
838
|
+
const config = validateAdapterConfig$1(untrustedConfig, getArticleFeedbackResponsesPaginated_ConfigPropertyNames);
|
|
839
|
+
// Invalid or incomplete config
|
|
840
|
+
if (config === null) {
|
|
841
|
+
return null;
|
|
842
|
+
}
|
|
843
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
844
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
function select(luvio, params) {
|
|
848
|
+
return select$6();
|
|
849
|
+
}
|
|
850
|
+
function keyBuilder$1(luvio, params) {
|
|
851
|
+
return keyBuilder$5(luvio, {
|
|
852
|
+
id: params.queryParams.knowledgeArticleVersionId
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
856
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
857
|
+
}
|
|
858
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
859
|
+
const { body } = response;
|
|
860
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
861
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
862
|
+
const snapshot = luvio.storeLookup({
|
|
863
|
+
recordId: key,
|
|
864
|
+
node: select(),
|
|
865
|
+
variables: {},
|
|
866
|
+
}, snapshotRefresh);
|
|
867
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
868
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
869
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
deepFreeze(snapshot.data);
|
|
873
|
+
return snapshot;
|
|
874
|
+
}
|
|
875
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
876
|
+
const key = keyBuilder$1(luvio, params);
|
|
877
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
878
|
+
const storeMetadataParams = {
|
|
879
|
+
ttl: TTL$2,
|
|
880
|
+
namespace: keyPrefix,
|
|
881
|
+
version: VERSION$3,
|
|
882
|
+
representationName: RepresentationType$2
|
|
883
|
+
};
|
|
884
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
885
|
+
return errorSnapshot;
|
|
886
|
+
}
|
|
887
|
+
function createResourceRequest(config) {
|
|
888
|
+
const headers = {};
|
|
889
|
+
return {
|
|
890
|
+
baseUri: '/services/data/v64.0',
|
|
891
|
+
basePath: '/connect/article-feedback/invitations',
|
|
892
|
+
method: 'get',
|
|
893
|
+
body: null,
|
|
894
|
+
urlParams: {},
|
|
895
|
+
queryParams: config.queryParams,
|
|
896
|
+
headers,
|
|
897
|
+
priority: 'normal',
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
function createResourceRequestFromRepresentation(representation) {
|
|
901
|
+
const config = {
|
|
902
|
+
queryParams: {},
|
|
903
|
+
};
|
|
904
|
+
config.queryParams.knowledgeArticleVersionId = representation.knowledgeArticleVersionId;
|
|
905
|
+
return createResourceRequest(config);
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
const adapterName = 'getSurveyInvitation';
|
|
909
|
+
const getSurveyInvitation_ConfigPropertyMetadata = [
|
|
910
|
+
generateParamConfigMetadata('communityId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
911
|
+
generateParamConfigMetadata('knowledgeArticleVersionId', true, 1 /* QueryParameter */, 0 /* String */),
|
|
912
|
+
];
|
|
913
|
+
const getSurveyInvitation_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getSurveyInvitation_ConfigPropertyMetadata);
|
|
914
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$3(getSurveyInvitation_ConfigPropertyMetadata);
|
|
915
|
+
function keyBuilder(luvio, config) {
|
|
916
|
+
const resourceParams = createResourceParams(config);
|
|
917
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
918
|
+
}
|
|
919
|
+
function typeCheckConfig(untrustedConfig) {
|
|
920
|
+
const config = {};
|
|
921
|
+
typeCheckConfig$3(untrustedConfig, config, getSurveyInvitation_ConfigPropertyMetadata);
|
|
922
|
+
return config;
|
|
923
|
+
}
|
|
924
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
925
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
926
|
+
return null;
|
|
927
|
+
}
|
|
928
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
929
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
930
|
+
}
|
|
931
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
932
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
933
|
+
return null;
|
|
934
|
+
}
|
|
935
|
+
return config;
|
|
936
|
+
}
|
|
937
|
+
function adapterFragment(luvio, config) {
|
|
938
|
+
createResourceParams(config);
|
|
939
|
+
return select();
|
|
940
|
+
}
|
|
941
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
942
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
943
|
+
config,
|
|
944
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
945
|
+
});
|
|
946
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
947
|
+
}
|
|
948
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
949
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
950
|
+
config,
|
|
951
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
952
|
+
});
|
|
953
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
954
|
+
}
|
|
955
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
956
|
+
const resourceParams = createResourceParams(config);
|
|
957
|
+
const request = createResourceRequest(resourceParams);
|
|
958
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
959
|
+
.then((response) => {
|
|
960
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
961
|
+
const cache = new StoreKeyMap();
|
|
962
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
963
|
+
return cache;
|
|
964
|
+
});
|
|
965
|
+
}, (response) => {
|
|
966
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
970
|
+
return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
971
|
+
}
|
|
972
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
973
|
+
const { luvio, config } = context;
|
|
974
|
+
const selector = {
|
|
975
|
+
recordId: keyBuilder(luvio, config),
|
|
976
|
+
node: adapterFragment(luvio, config),
|
|
977
|
+
variables: {},
|
|
978
|
+
};
|
|
979
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
980
|
+
config,
|
|
981
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
982
|
+
});
|
|
983
|
+
return cacheSnapshot;
|
|
984
|
+
}
|
|
985
|
+
const getSurveyInvitationAdapterFactory = (luvio) => function articlefeedback__getSurveyInvitation(untrustedConfig, requestContext) {
|
|
986
|
+
const config = validateAdapterConfig(untrustedConfig, getSurveyInvitation_ConfigPropertyNames);
|
|
987
|
+
// Invalid or incomplete config
|
|
988
|
+
if (config === null) {
|
|
989
|
+
return null;
|
|
990
|
+
}
|
|
991
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
992
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
993
|
+
};
|
|
994
|
+
const notifyChangeFactory = (luvio, options) => {
|
|
995
|
+
return function getConnectArticleFeedbackInvitationsNotifyChange(configs) {
|
|
996
|
+
const keys = configs.map(c => keyBuilder$5(luvio, c));
|
|
997
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
998
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
999
|
+
const { key, record: val } = entries[i];
|
|
1000
|
+
const refreshRequest = createResourceRequestFromRepresentation(val);
|
|
1001
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
1002
|
+
.then((response) => {
|
|
1003
|
+
return luvio.handleSuccessResponse(() => {
|
|
1004
|
+
const { body } = response;
|
|
1005
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
1006
|
+
return luvio.storeBroadcast();
|
|
1007
|
+
}, () => {
|
|
1008
|
+
const cache = new StoreKeyMap();
|
|
1009
|
+
getTypeCacheKeys$2(cache, luvio, response.body);
|
|
1010
|
+
return cache;
|
|
1011
|
+
});
|
|
1012
|
+
}, (error) => {
|
|
1013
|
+
return luvio.handleErrorResponse(() => {
|
|
1014
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
1015
|
+
luvio.storeIngestError(key, errorSnapshot, {
|
|
1016
|
+
ttl: TTL$2,
|
|
1017
|
+
namespace: keyPrefix,
|
|
1018
|
+
version: VERSION$3,
|
|
1019
|
+
representationName: RepresentationType$2
|
|
1020
|
+
});
|
|
1021
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
1022
|
+
});
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
});
|
|
1026
|
+
};
|
|
1027
|
+
};
|
|
1028
|
+
|
|
1029
|
+
let createSurveyInvitation;
|
|
1030
|
+
let getArticleFeedbackResponsesPaginated;
|
|
1031
|
+
let getSurveyInvitation;
|
|
1032
|
+
let getSurveyInvitationNotifyChange;
|
|
1033
|
+
// Imperative GET Adapters
|
|
1034
|
+
let getArticleFeedbackResponsesPaginated_imperative;
|
|
1035
|
+
let getSurveyInvitation_imperative;
|
|
1036
|
+
const getArticleFeedbackResponsesPaginatedMetadata = {
|
|
1037
|
+
apiFamily: 'articlefeedback',
|
|
1038
|
+
name: 'getArticleFeedbackResponsesPaginated',
|
|
1039
|
+
ttl: 300,
|
|
1040
|
+
};
|
|
1041
|
+
const getSurveyInvitationMetadata = {
|
|
1042
|
+
apiFamily: 'articlefeedback',
|
|
1043
|
+
name: 'getSurveyInvitation',
|
|
1044
|
+
ttl: 300,
|
|
1045
|
+
};
|
|
1046
|
+
// Notify Update Available
|
|
1047
|
+
function bindExportsTo(luvio) {
|
|
1048
|
+
// LDS Adapters
|
|
1049
|
+
const getArticleFeedbackResponsesPaginated_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getArticleFeedbackResponsesPaginated', getArticleFeedbackResponsesPaginatedAdapterFactory), getArticleFeedbackResponsesPaginatedMetadata);
|
|
1050
|
+
const getSurveyInvitation_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getSurveyInvitation', getSurveyInvitationAdapterFactory), getSurveyInvitationMetadata);
|
|
1051
|
+
function unwrapSnapshotData(factory) {
|
|
1052
|
+
const adapter = factory(luvio);
|
|
1053
|
+
return (config) => adapter(config).then((snapshot) => snapshot.data);
|
|
1054
|
+
}
|
|
1055
|
+
return {
|
|
1056
|
+
createSurveyInvitation: unwrapSnapshotData(createSurveyInvitationAdapterFactory),
|
|
1057
|
+
getArticleFeedbackResponsesPaginated: createWireAdapterConstructor(luvio, getArticleFeedbackResponsesPaginated_ldsAdapter, getArticleFeedbackResponsesPaginatedMetadata),
|
|
1058
|
+
getSurveyInvitation: createWireAdapterConstructor(luvio, getSurveyInvitation_ldsAdapter, getSurveyInvitationMetadata),
|
|
1059
|
+
getSurveyInvitationNotifyChange: createLDSAdapter(luvio, 'getSurveyInvitationNotifyChange', notifyChangeFactory),
|
|
1060
|
+
// Imperative GET Adapters
|
|
1061
|
+
getArticleFeedbackResponsesPaginated_imperative: createImperativeAdapter(luvio, getArticleFeedbackResponsesPaginated_ldsAdapter, getArticleFeedbackResponsesPaginatedMetadata),
|
|
1062
|
+
getSurveyInvitation_imperative: createImperativeAdapter(luvio, getSurveyInvitation_ldsAdapter, getSurveyInvitationMetadata),
|
|
1063
|
+
// Notify Update Availables
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
withDefaultLuvio((luvio) => {
|
|
1067
|
+
({
|
|
1068
|
+
createSurveyInvitation,
|
|
1069
|
+
getArticleFeedbackResponsesPaginated,
|
|
1070
|
+
getSurveyInvitation,
|
|
1071
|
+
getSurveyInvitationNotifyChange,
|
|
1072
|
+
getArticleFeedbackResponsesPaginated_imperative,
|
|
1073
|
+
getSurveyInvitation_imperative,
|
|
1074
|
+
} = bindExportsTo(luvio));
|
|
1075
|
+
});
|
|
1076
|
+
|
|
1077
|
+
export { createSurveyInvitation, getArticleFeedbackResponsesPaginated, getArticleFeedbackResponsesPaginated_imperative, getSurveyInvitation, getSurveyInvitationNotifyChange, getSurveyInvitation_imperative };
|
|
1078
|
+
// version: 1.344.0-455da7ef74
|