@salesforce/lds-adapters-community-info 1.100.2

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.
@@ -0,0 +1,1112 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ (function (global, factory) {
8
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@luvio/engine')) :
9
+ typeof define === 'function' && define.amd ? define(['exports', '@luvio/engine'], factory) :
10
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.communityInfo = {}, global.engine));
11
+ })(this, (function (exports, engine) { 'use strict';
12
+
13
+ var ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
14
+ var ObjectKeys = Object.keys;
15
+ var ArrayIsArray$1 = Array.isArray;
16
+ /**
17
+ * Validates an adapter config is well-formed.
18
+ * @param config The config to validate.
19
+ * @param adapter The adapter validation configuration.
20
+ * @param oneOf The keys the config must contain at least one of.
21
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
22
+ */
23
+ function validateConfig(config, adapter, oneOf) {
24
+ var displayName = adapter.displayName;
25
+ var _a = adapter.parameters, required = _a.required, optional = _a.optional, unsupported = _a.unsupported;
26
+ if (config === undefined ||
27
+ required.every(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
28
+ throw new TypeError("adapter ".concat(displayName, " configuration must specify ").concat(required.sort().join(', ')));
29
+ }
30
+ if (oneOf && oneOf.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
31
+ throw new TypeError("adapter ".concat(displayName, " configuration must specify one of ").concat(oneOf.sort().join(', ')));
32
+ }
33
+ if (unsupported !== undefined &&
34
+ unsupported.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); })) {
35
+ throw new TypeError("adapter ".concat(displayName, " does not yet support ").concat(unsupported.sort().join(', ')));
36
+ }
37
+ var supported = required.concat(optional);
38
+ if (ObjectKeys(config).some(function (key) { return !supported.includes(key); })) {
39
+ throw new TypeError("adapter ".concat(displayName, " configuration supports only ").concat(supported.sort().join(', ')));
40
+ }
41
+ }
42
+ function untrustedIsObject(untrusted) {
43
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
44
+ }
45
+ function areRequiredParametersPresent(config, configPropertyNames) {
46
+ return configPropertyNames.parameters.required.every(function (req) { return req in config; });
47
+ }
48
+ var snapshotRefreshOptions = {
49
+ overrides: {
50
+ headers: {
51
+ 'Cache-Control': 'no-cache',
52
+ },
53
+ }
54
+ };
55
+ var keyPrefix = 'CommunityInfo';
56
+
57
+ var ArrayIsArray = Array.isArray;
58
+ function createLink(ref) {
59
+ return {
60
+ __ref: engine.serializeStructuredKey(ref),
61
+ };
62
+ }
63
+
64
+ var TTL = 3600000;
65
+ var VERSION = "eb8b3dfcd6efef00904275e9019e34f8";
66
+ function validate(obj, path) {
67
+ if (path === void 0) { path = 'CommunityRepresentation'; }
68
+ var v_error = (function () {
69
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
70
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
71
+ }
72
+ var obj_allowChatterAccessWithoutLogin = obj.allowChatterAccessWithoutLogin;
73
+ var path_allowChatterAccessWithoutLogin = path + '.allowChatterAccessWithoutLogin';
74
+ var obj_allowChatterAccessWithoutLogin_union0 = null;
75
+ var obj_allowChatterAccessWithoutLogin_union0_error = (function () {
76
+ if (typeof obj_allowChatterAccessWithoutLogin !== 'boolean') {
77
+ return new TypeError('Expected "boolean" but received "' + typeof obj_allowChatterAccessWithoutLogin + '" (at "' + path_allowChatterAccessWithoutLogin + '")');
78
+ }
79
+ })();
80
+ if (obj_allowChatterAccessWithoutLogin_union0_error != null) {
81
+ obj_allowChatterAccessWithoutLogin_union0 = obj_allowChatterAccessWithoutLogin_union0_error.message;
82
+ }
83
+ var obj_allowChatterAccessWithoutLogin_union1 = null;
84
+ var obj_allowChatterAccessWithoutLogin_union1_error = (function () {
85
+ if (obj_allowChatterAccessWithoutLogin !== null) {
86
+ return new TypeError('Expected "null" but received "' + typeof obj_allowChatterAccessWithoutLogin + '" (at "' + path_allowChatterAccessWithoutLogin + '")');
87
+ }
88
+ })();
89
+ if (obj_allowChatterAccessWithoutLogin_union1_error != null) {
90
+ obj_allowChatterAccessWithoutLogin_union1 = obj_allowChatterAccessWithoutLogin_union1_error.message;
91
+ }
92
+ if (obj_allowChatterAccessWithoutLogin_union0 && obj_allowChatterAccessWithoutLogin_union1) {
93
+ var message = 'Object doesn\'t match union (at "' + path_allowChatterAccessWithoutLogin + '")';
94
+ message += '\n' + obj_allowChatterAccessWithoutLogin_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
95
+ message += '\n' + obj_allowChatterAccessWithoutLogin_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
96
+ return new TypeError(message);
97
+ }
98
+ var obj_allowMembersToFlag = obj.allowMembersToFlag;
99
+ var path_allowMembersToFlag = path + '.allowMembersToFlag';
100
+ var obj_allowMembersToFlag_union0 = null;
101
+ var obj_allowMembersToFlag_union0_error = (function () {
102
+ if (typeof obj_allowMembersToFlag !== 'boolean') {
103
+ return new TypeError('Expected "boolean" but received "' + typeof obj_allowMembersToFlag + '" (at "' + path_allowMembersToFlag + '")');
104
+ }
105
+ })();
106
+ if (obj_allowMembersToFlag_union0_error != null) {
107
+ obj_allowMembersToFlag_union0 = obj_allowMembersToFlag_union0_error.message;
108
+ }
109
+ var obj_allowMembersToFlag_union1 = null;
110
+ var obj_allowMembersToFlag_union1_error = (function () {
111
+ if (obj_allowMembersToFlag !== null) {
112
+ return new TypeError('Expected "null" but received "' + typeof obj_allowMembersToFlag + '" (at "' + path_allowMembersToFlag + '")');
113
+ }
114
+ })();
115
+ if (obj_allowMembersToFlag_union1_error != null) {
116
+ obj_allowMembersToFlag_union1 = obj_allowMembersToFlag_union1_error.message;
117
+ }
118
+ if (obj_allowMembersToFlag_union0 && obj_allowMembersToFlag_union1) {
119
+ var message = 'Object doesn\'t match union (at "' + path_allowMembersToFlag + '")';
120
+ message += '\n' + obj_allowMembersToFlag_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
121
+ message += '\n' + obj_allowMembersToFlag_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
122
+ return new TypeError(message);
123
+ }
124
+ var obj_builderBasedSnaEnabled = obj.builderBasedSnaEnabled;
125
+ var path_builderBasedSnaEnabled = path + '.builderBasedSnaEnabled';
126
+ var obj_builderBasedSnaEnabled_union0 = null;
127
+ var obj_builderBasedSnaEnabled_union0_error = (function () {
128
+ if (typeof obj_builderBasedSnaEnabled !== 'boolean') {
129
+ return new TypeError('Expected "boolean" but received "' + typeof obj_builderBasedSnaEnabled + '" (at "' + path_builderBasedSnaEnabled + '")');
130
+ }
131
+ })();
132
+ if (obj_builderBasedSnaEnabled_union0_error != null) {
133
+ obj_builderBasedSnaEnabled_union0 = obj_builderBasedSnaEnabled_union0_error.message;
134
+ }
135
+ var obj_builderBasedSnaEnabled_union1 = null;
136
+ var obj_builderBasedSnaEnabled_union1_error = (function () {
137
+ if (obj_builderBasedSnaEnabled !== null) {
138
+ return new TypeError('Expected "null" but received "' + typeof obj_builderBasedSnaEnabled + '" (at "' + path_builderBasedSnaEnabled + '")');
139
+ }
140
+ })();
141
+ if (obj_builderBasedSnaEnabled_union1_error != null) {
142
+ obj_builderBasedSnaEnabled_union1 = obj_builderBasedSnaEnabled_union1_error.message;
143
+ }
144
+ if (obj_builderBasedSnaEnabled_union0 && obj_builderBasedSnaEnabled_union1) {
145
+ var message = 'Object doesn\'t match union (at "' + path_builderBasedSnaEnabled + '")';
146
+ message += '\n' + obj_builderBasedSnaEnabled_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
147
+ message += '\n' + obj_builderBasedSnaEnabled_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
148
+ return new TypeError(message);
149
+ }
150
+ var obj_builderUrl = obj.builderUrl;
151
+ var path_builderUrl = path + '.builderUrl';
152
+ var obj_builderUrl_union0 = null;
153
+ var obj_builderUrl_union0_error = (function () {
154
+ if (typeof obj_builderUrl !== 'string') {
155
+ return new TypeError('Expected "string" but received "' + typeof obj_builderUrl + '" (at "' + path_builderUrl + '")');
156
+ }
157
+ })();
158
+ if (obj_builderUrl_union0_error != null) {
159
+ obj_builderUrl_union0 = obj_builderUrl_union0_error.message;
160
+ }
161
+ var obj_builderUrl_union1 = null;
162
+ var obj_builderUrl_union1_error = (function () {
163
+ if (obj_builderUrl !== null) {
164
+ return new TypeError('Expected "null" but received "' + typeof obj_builderUrl + '" (at "' + path_builderUrl + '")');
165
+ }
166
+ })();
167
+ if (obj_builderUrl_union1_error != null) {
168
+ obj_builderUrl_union1 = obj_builderUrl_union1_error.message;
169
+ }
170
+ if (obj_builderUrl_union0 && obj_builderUrl_union1) {
171
+ var message = 'Object doesn\'t match union (at "' + path_builderUrl + '")';
172
+ message += '\n' + obj_builderUrl_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
173
+ message += '\n' + obj_builderUrl_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
174
+ return new TypeError(message);
175
+ }
176
+ var obj_description = obj.description;
177
+ var path_description = path + '.description';
178
+ var obj_description_union0 = null;
179
+ var obj_description_union0_error = (function () {
180
+ if (typeof obj_description !== 'string') {
181
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
182
+ }
183
+ })();
184
+ if (obj_description_union0_error != null) {
185
+ obj_description_union0 = obj_description_union0_error.message;
186
+ }
187
+ var obj_description_union1 = null;
188
+ var obj_description_union1_error = (function () {
189
+ if (obj_description !== null) {
190
+ return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
191
+ }
192
+ })();
193
+ if (obj_description_union1_error != null) {
194
+ obj_description_union1 = obj_description_union1_error.message;
195
+ }
196
+ if (obj_description_union0 && obj_description_union1) {
197
+ var message = 'Object doesn\'t match union (at "' + path_description + '")';
198
+ message += '\n' + obj_description_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
199
+ message += '\n' + obj_description_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
200
+ return new TypeError(message);
201
+ }
202
+ var obj_guestMemberVisibilityEnabled = obj.guestMemberVisibilityEnabled;
203
+ var path_guestMemberVisibilityEnabled = path + '.guestMemberVisibilityEnabled';
204
+ var obj_guestMemberVisibilityEnabled_union0 = null;
205
+ var obj_guestMemberVisibilityEnabled_union0_error = (function () {
206
+ if (typeof obj_guestMemberVisibilityEnabled !== 'boolean') {
207
+ return new TypeError('Expected "boolean" but received "' + typeof obj_guestMemberVisibilityEnabled + '" (at "' + path_guestMemberVisibilityEnabled + '")');
208
+ }
209
+ })();
210
+ if (obj_guestMemberVisibilityEnabled_union0_error != null) {
211
+ obj_guestMemberVisibilityEnabled_union0 = obj_guestMemberVisibilityEnabled_union0_error.message;
212
+ }
213
+ var obj_guestMemberVisibilityEnabled_union1 = null;
214
+ var obj_guestMemberVisibilityEnabled_union1_error = (function () {
215
+ if (obj_guestMemberVisibilityEnabled !== null) {
216
+ return new TypeError('Expected "null" but received "' + typeof obj_guestMemberVisibilityEnabled + '" (at "' + path_guestMemberVisibilityEnabled + '")');
217
+ }
218
+ })();
219
+ if (obj_guestMemberVisibilityEnabled_union1_error != null) {
220
+ obj_guestMemberVisibilityEnabled_union1 = obj_guestMemberVisibilityEnabled_union1_error.message;
221
+ }
222
+ if (obj_guestMemberVisibilityEnabled_union0 && obj_guestMemberVisibilityEnabled_union1) {
223
+ var message = 'Object doesn\'t match union (at "' + path_guestMemberVisibilityEnabled + '")';
224
+ message += '\n' + obj_guestMemberVisibilityEnabled_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
225
+ message += '\n' + obj_guestMemberVisibilityEnabled_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
226
+ return new TypeError(message);
227
+ }
228
+ var obj_id = obj.id;
229
+ var path_id = path + '.id';
230
+ var obj_id_union0 = null;
231
+ var obj_id_union0_error = (function () {
232
+ if (typeof obj_id !== 'string') {
233
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
234
+ }
235
+ })();
236
+ if (obj_id_union0_error != null) {
237
+ obj_id_union0 = obj_id_union0_error.message;
238
+ }
239
+ var obj_id_union1 = null;
240
+ var obj_id_union1_error = (function () {
241
+ if (obj_id !== null) {
242
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
243
+ }
244
+ })();
245
+ if (obj_id_union1_error != null) {
246
+ obj_id_union1 = obj_id_union1_error.message;
247
+ }
248
+ if (obj_id_union0 && obj_id_union1) {
249
+ var message = 'Object doesn\'t match union (at "' + path_id + '")';
250
+ message += '\n' + obj_id_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
251
+ message += '\n' + obj_id_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
252
+ return new TypeError(message);
253
+ }
254
+ var obj_imageOptimizationCDNEnabled = obj.imageOptimizationCDNEnabled;
255
+ var path_imageOptimizationCDNEnabled = path + '.imageOptimizationCDNEnabled';
256
+ var obj_imageOptimizationCDNEnabled_union0 = null;
257
+ var obj_imageOptimizationCDNEnabled_union0_error = (function () {
258
+ if (typeof obj_imageOptimizationCDNEnabled !== 'boolean') {
259
+ return new TypeError('Expected "boolean" but received "' + typeof obj_imageOptimizationCDNEnabled + '" (at "' + path_imageOptimizationCDNEnabled + '")');
260
+ }
261
+ })();
262
+ if (obj_imageOptimizationCDNEnabled_union0_error != null) {
263
+ obj_imageOptimizationCDNEnabled_union0 = obj_imageOptimizationCDNEnabled_union0_error.message;
264
+ }
265
+ var obj_imageOptimizationCDNEnabled_union1 = null;
266
+ var obj_imageOptimizationCDNEnabled_union1_error = (function () {
267
+ if (obj_imageOptimizationCDNEnabled !== null) {
268
+ return new TypeError('Expected "null" but received "' + typeof obj_imageOptimizationCDNEnabled + '" (at "' + path_imageOptimizationCDNEnabled + '")');
269
+ }
270
+ })();
271
+ if (obj_imageOptimizationCDNEnabled_union1_error != null) {
272
+ obj_imageOptimizationCDNEnabled_union1 = obj_imageOptimizationCDNEnabled_union1_error.message;
273
+ }
274
+ if (obj_imageOptimizationCDNEnabled_union0 && obj_imageOptimizationCDNEnabled_union1) {
275
+ var message = 'Object doesn\'t match union (at "' + path_imageOptimizationCDNEnabled + '")';
276
+ message += '\n' + obj_imageOptimizationCDNEnabled_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
277
+ message += '\n' + obj_imageOptimizationCDNEnabled_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
278
+ return new TypeError(message);
279
+ }
280
+ var obj_invitationsEnabled = obj.invitationsEnabled;
281
+ var path_invitationsEnabled = path + '.invitationsEnabled';
282
+ var obj_invitationsEnabled_union0 = null;
283
+ var obj_invitationsEnabled_union0_error = (function () {
284
+ if (typeof obj_invitationsEnabled !== 'boolean') {
285
+ return new TypeError('Expected "boolean" but received "' + typeof obj_invitationsEnabled + '" (at "' + path_invitationsEnabled + '")');
286
+ }
287
+ })();
288
+ if (obj_invitationsEnabled_union0_error != null) {
289
+ obj_invitationsEnabled_union0 = obj_invitationsEnabled_union0_error.message;
290
+ }
291
+ var obj_invitationsEnabled_union1 = null;
292
+ var obj_invitationsEnabled_union1_error = (function () {
293
+ if (obj_invitationsEnabled !== null) {
294
+ return new TypeError('Expected "null" but received "' + typeof obj_invitationsEnabled + '" (at "' + path_invitationsEnabled + '")');
295
+ }
296
+ })();
297
+ if (obj_invitationsEnabled_union1_error != null) {
298
+ obj_invitationsEnabled_union1 = obj_invitationsEnabled_union1_error.message;
299
+ }
300
+ if (obj_invitationsEnabled_union0 && obj_invitationsEnabled_union1) {
301
+ var message = 'Object doesn\'t match union (at "' + path_invitationsEnabled + '")';
302
+ message += '\n' + obj_invitationsEnabled_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
303
+ message += '\n' + obj_invitationsEnabled_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
304
+ return new TypeError(message);
305
+ }
306
+ var obj_knowledgeableEnabled = obj.knowledgeableEnabled;
307
+ var path_knowledgeableEnabled = path + '.knowledgeableEnabled';
308
+ var obj_knowledgeableEnabled_union0 = null;
309
+ var obj_knowledgeableEnabled_union0_error = (function () {
310
+ if (typeof obj_knowledgeableEnabled !== 'boolean') {
311
+ return new TypeError('Expected "boolean" but received "' + typeof obj_knowledgeableEnabled + '" (at "' + path_knowledgeableEnabled + '")');
312
+ }
313
+ })();
314
+ if (obj_knowledgeableEnabled_union0_error != null) {
315
+ obj_knowledgeableEnabled_union0 = obj_knowledgeableEnabled_union0_error.message;
316
+ }
317
+ var obj_knowledgeableEnabled_union1 = null;
318
+ var obj_knowledgeableEnabled_union1_error = (function () {
319
+ if (obj_knowledgeableEnabled !== null) {
320
+ return new TypeError('Expected "null" but received "' + typeof obj_knowledgeableEnabled + '" (at "' + path_knowledgeableEnabled + '")');
321
+ }
322
+ })();
323
+ if (obj_knowledgeableEnabled_union1_error != null) {
324
+ obj_knowledgeableEnabled_union1 = obj_knowledgeableEnabled_union1_error.message;
325
+ }
326
+ if (obj_knowledgeableEnabled_union0 && obj_knowledgeableEnabled_union1) {
327
+ var message = 'Object doesn\'t match union (at "' + path_knowledgeableEnabled + '")';
328
+ message += '\n' + obj_knowledgeableEnabled_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
329
+ message += '\n' + obj_knowledgeableEnabled_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
330
+ return new TypeError(message);
331
+ }
332
+ var obj_loginUrl = obj.loginUrl;
333
+ var path_loginUrl = path + '.loginUrl';
334
+ var obj_loginUrl_union0 = null;
335
+ var obj_loginUrl_union0_error = (function () {
336
+ if (typeof obj_loginUrl !== 'string') {
337
+ return new TypeError('Expected "string" but received "' + typeof obj_loginUrl + '" (at "' + path_loginUrl + '")');
338
+ }
339
+ })();
340
+ if (obj_loginUrl_union0_error != null) {
341
+ obj_loginUrl_union0 = obj_loginUrl_union0_error.message;
342
+ }
343
+ var obj_loginUrl_union1 = null;
344
+ var obj_loginUrl_union1_error = (function () {
345
+ if (obj_loginUrl !== null) {
346
+ return new TypeError('Expected "null" but received "' + typeof obj_loginUrl + '" (at "' + path_loginUrl + '")');
347
+ }
348
+ })();
349
+ if (obj_loginUrl_union1_error != null) {
350
+ obj_loginUrl_union1 = obj_loginUrl_union1_error.message;
351
+ }
352
+ if (obj_loginUrl_union0 && obj_loginUrl_union1) {
353
+ var message = 'Object doesn\'t match union (at "' + path_loginUrl + '")';
354
+ message += '\n' + obj_loginUrl_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
355
+ message += '\n' + obj_loginUrl_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
356
+ return new TypeError(message);
357
+ }
358
+ var obj_memberVisibilityEnabled = obj.memberVisibilityEnabled;
359
+ var path_memberVisibilityEnabled = path + '.memberVisibilityEnabled';
360
+ var obj_memberVisibilityEnabled_union0 = null;
361
+ var obj_memberVisibilityEnabled_union0_error = (function () {
362
+ if (typeof obj_memberVisibilityEnabled !== 'boolean') {
363
+ return new TypeError('Expected "boolean" but received "' + typeof obj_memberVisibilityEnabled + '" (at "' + path_memberVisibilityEnabled + '")');
364
+ }
365
+ })();
366
+ if (obj_memberVisibilityEnabled_union0_error != null) {
367
+ obj_memberVisibilityEnabled_union0 = obj_memberVisibilityEnabled_union0_error.message;
368
+ }
369
+ var obj_memberVisibilityEnabled_union1 = null;
370
+ var obj_memberVisibilityEnabled_union1_error = (function () {
371
+ if (obj_memberVisibilityEnabled !== null) {
372
+ return new TypeError('Expected "null" but received "' + typeof obj_memberVisibilityEnabled + '" (at "' + path_memberVisibilityEnabled + '")');
373
+ }
374
+ })();
375
+ if (obj_memberVisibilityEnabled_union1_error != null) {
376
+ obj_memberVisibilityEnabled_union1 = obj_memberVisibilityEnabled_union1_error.message;
377
+ }
378
+ if (obj_memberVisibilityEnabled_union0 && obj_memberVisibilityEnabled_union1) {
379
+ var message = 'Object doesn\'t match union (at "' + path_memberVisibilityEnabled + '")';
380
+ message += '\n' + obj_memberVisibilityEnabled_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
381
+ message += '\n' + obj_memberVisibilityEnabled_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
382
+ return new TypeError(message);
383
+ }
384
+ var obj_name = obj.name;
385
+ var path_name = path + '.name';
386
+ var obj_name_union0 = null;
387
+ var obj_name_union0_error = (function () {
388
+ if (typeof obj_name !== 'string') {
389
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
390
+ }
391
+ })();
392
+ if (obj_name_union0_error != null) {
393
+ obj_name_union0 = obj_name_union0_error.message;
394
+ }
395
+ var obj_name_union1 = null;
396
+ var obj_name_union1_error = (function () {
397
+ if (obj_name !== null) {
398
+ return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
399
+ }
400
+ })();
401
+ if (obj_name_union1_error != null) {
402
+ obj_name_union1 = obj_name_union1_error.message;
403
+ }
404
+ if (obj_name_union0 && obj_name_union1) {
405
+ var message = 'Object doesn\'t match union (at "' + path_name + '")';
406
+ message += '\n' + obj_name_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
407
+ message += '\n' + obj_name_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
408
+ return new TypeError(message);
409
+ }
410
+ var obj_nicknameDisplayEnabled = obj.nicknameDisplayEnabled;
411
+ var path_nicknameDisplayEnabled = path + '.nicknameDisplayEnabled';
412
+ var obj_nicknameDisplayEnabled_union0 = null;
413
+ var obj_nicknameDisplayEnabled_union0_error = (function () {
414
+ if (typeof obj_nicknameDisplayEnabled !== 'boolean') {
415
+ return new TypeError('Expected "boolean" but received "' + typeof obj_nicknameDisplayEnabled + '" (at "' + path_nicknameDisplayEnabled + '")');
416
+ }
417
+ })();
418
+ if (obj_nicknameDisplayEnabled_union0_error != null) {
419
+ obj_nicknameDisplayEnabled_union0 = obj_nicknameDisplayEnabled_union0_error.message;
420
+ }
421
+ var obj_nicknameDisplayEnabled_union1 = null;
422
+ var obj_nicknameDisplayEnabled_union1_error = (function () {
423
+ if (obj_nicknameDisplayEnabled !== null) {
424
+ return new TypeError('Expected "null" but received "' + typeof obj_nicknameDisplayEnabled + '" (at "' + path_nicknameDisplayEnabled + '")');
425
+ }
426
+ })();
427
+ if (obj_nicknameDisplayEnabled_union1_error != null) {
428
+ obj_nicknameDisplayEnabled_union1 = obj_nicknameDisplayEnabled_union1_error.message;
429
+ }
430
+ if (obj_nicknameDisplayEnabled_union0 && obj_nicknameDisplayEnabled_union1) {
431
+ var message = 'Object doesn\'t match union (at "' + path_nicknameDisplayEnabled + '")';
432
+ message += '\n' + obj_nicknameDisplayEnabled_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
433
+ message += '\n' + obj_nicknameDisplayEnabled_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
434
+ return new TypeError(message);
435
+ }
436
+ var obj_privateMessagesEnabled = obj.privateMessagesEnabled;
437
+ var path_privateMessagesEnabled = path + '.privateMessagesEnabled';
438
+ var obj_privateMessagesEnabled_union0 = null;
439
+ var obj_privateMessagesEnabled_union0_error = (function () {
440
+ if (typeof obj_privateMessagesEnabled !== 'boolean') {
441
+ return new TypeError('Expected "boolean" but received "' + typeof obj_privateMessagesEnabled + '" (at "' + path_privateMessagesEnabled + '")');
442
+ }
443
+ })();
444
+ if (obj_privateMessagesEnabled_union0_error != null) {
445
+ obj_privateMessagesEnabled_union0 = obj_privateMessagesEnabled_union0_error.message;
446
+ }
447
+ var obj_privateMessagesEnabled_union1 = null;
448
+ var obj_privateMessagesEnabled_union1_error = (function () {
449
+ if (obj_privateMessagesEnabled !== null) {
450
+ return new TypeError('Expected "null" but received "' + typeof obj_privateMessagesEnabled + '" (at "' + path_privateMessagesEnabled + '")');
451
+ }
452
+ })();
453
+ if (obj_privateMessagesEnabled_union1_error != null) {
454
+ obj_privateMessagesEnabled_union1 = obj_privateMessagesEnabled_union1_error.message;
455
+ }
456
+ if (obj_privateMessagesEnabled_union0 && obj_privateMessagesEnabled_union1) {
457
+ var message = 'Object doesn\'t match union (at "' + path_privateMessagesEnabled + '")';
458
+ message += '\n' + obj_privateMessagesEnabled_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
459
+ message += '\n' + obj_privateMessagesEnabled_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
460
+ return new TypeError(message);
461
+ }
462
+ var obj_reputationEnabled = obj.reputationEnabled;
463
+ var path_reputationEnabled = path + '.reputationEnabled';
464
+ var obj_reputationEnabled_union0 = null;
465
+ var obj_reputationEnabled_union0_error = (function () {
466
+ if (typeof obj_reputationEnabled !== 'boolean') {
467
+ return new TypeError('Expected "boolean" but received "' + typeof obj_reputationEnabled + '" (at "' + path_reputationEnabled + '")');
468
+ }
469
+ })();
470
+ if (obj_reputationEnabled_union0_error != null) {
471
+ obj_reputationEnabled_union0 = obj_reputationEnabled_union0_error.message;
472
+ }
473
+ var obj_reputationEnabled_union1 = null;
474
+ var obj_reputationEnabled_union1_error = (function () {
475
+ if (obj_reputationEnabled !== null) {
476
+ return new TypeError('Expected "null" but received "' + typeof obj_reputationEnabled + '" (at "' + path_reputationEnabled + '")');
477
+ }
478
+ })();
479
+ if (obj_reputationEnabled_union1_error != null) {
480
+ obj_reputationEnabled_union1 = obj_reputationEnabled_union1_error.message;
481
+ }
482
+ if (obj_reputationEnabled_union0 && obj_reputationEnabled_union1) {
483
+ var message = 'Object doesn\'t match union (at "' + path_reputationEnabled + '")';
484
+ message += '\n' + obj_reputationEnabled_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
485
+ message += '\n' + obj_reputationEnabled_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
486
+ return new TypeError(message);
487
+ }
488
+ var obj_sendWelcomeEmail = obj.sendWelcomeEmail;
489
+ var path_sendWelcomeEmail = path + '.sendWelcomeEmail';
490
+ var obj_sendWelcomeEmail_union0 = null;
491
+ var obj_sendWelcomeEmail_union0_error = (function () {
492
+ if (typeof obj_sendWelcomeEmail !== 'boolean') {
493
+ return new TypeError('Expected "boolean" but received "' + typeof obj_sendWelcomeEmail + '" (at "' + path_sendWelcomeEmail + '")');
494
+ }
495
+ })();
496
+ if (obj_sendWelcomeEmail_union0_error != null) {
497
+ obj_sendWelcomeEmail_union0 = obj_sendWelcomeEmail_union0_error.message;
498
+ }
499
+ var obj_sendWelcomeEmail_union1 = null;
500
+ var obj_sendWelcomeEmail_union1_error = (function () {
501
+ if (obj_sendWelcomeEmail !== null) {
502
+ return new TypeError('Expected "null" but received "' + typeof obj_sendWelcomeEmail + '" (at "' + path_sendWelcomeEmail + '")');
503
+ }
504
+ })();
505
+ if (obj_sendWelcomeEmail_union1_error != null) {
506
+ obj_sendWelcomeEmail_union1 = obj_sendWelcomeEmail_union1_error.message;
507
+ }
508
+ if (obj_sendWelcomeEmail_union0 && obj_sendWelcomeEmail_union1) {
509
+ var message = 'Object doesn\'t match union (at "' + path_sendWelcomeEmail + '")';
510
+ message += '\n' + obj_sendWelcomeEmail_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
511
+ message += '\n' + obj_sendWelcomeEmail_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
512
+ return new TypeError(message);
513
+ }
514
+ var obj_siteAsContainerEnabled = obj.siteAsContainerEnabled;
515
+ var path_siteAsContainerEnabled = path + '.siteAsContainerEnabled';
516
+ var obj_siteAsContainerEnabled_union0 = null;
517
+ var obj_siteAsContainerEnabled_union0_error = (function () {
518
+ if (typeof obj_siteAsContainerEnabled !== 'boolean') {
519
+ return new TypeError('Expected "boolean" but received "' + typeof obj_siteAsContainerEnabled + '" (at "' + path_siteAsContainerEnabled + '")');
520
+ }
521
+ })();
522
+ if (obj_siteAsContainerEnabled_union0_error != null) {
523
+ obj_siteAsContainerEnabled_union0 = obj_siteAsContainerEnabled_union0_error.message;
524
+ }
525
+ var obj_siteAsContainerEnabled_union1 = null;
526
+ var obj_siteAsContainerEnabled_union1_error = (function () {
527
+ if (obj_siteAsContainerEnabled !== null) {
528
+ return new TypeError('Expected "null" but received "' + typeof obj_siteAsContainerEnabled + '" (at "' + path_siteAsContainerEnabled + '")');
529
+ }
530
+ })();
531
+ if (obj_siteAsContainerEnabled_union1_error != null) {
532
+ obj_siteAsContainerEnabled_union1 = obj_siteAsContainerEnabled_union1_error.message;
533
+ }
534
+ if (obj_siteAsContainerEnabled_union0 && obj_siteAsContainerEnabled_union1) {
535
+ var message = 'Object doesn\'t match union (at "' + path_siteAsContainerEnabled + '")';
536
+ message += '\n' + obj_siteAsContainerEnabled_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
537
+ message += '\n' + obj_siteAsContainerEnabled_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
538
+ return new TypeError(message);
539
+ }
540
+ var obj_siteUrl = obj.siteUrl;
541
+ var path_siteUrl = path + '.siteUrl';
542
+ var obj_siteUrl_union0 = null;
543
+ var obj_siteUrl_union0_error = (function () {
544
+ if (typeof obj_siteUrl !== 'string') {
545
+ return new TypeError('Expected "string" but received "' + typeof obj_siteUrl + '" (at "' + path_siteUrl + '")');
546
+ }
547
+ })();
548
+ if (obj_siteUrl_union0_error != null) {
549
+ obj_siteUrl_union0 = obj_siteUrl_union0_error.message;
550
+ }
551
+ var obj_siteUrl_union1 = null;
552
+ var obj_siteUrl_union1_error = (function () {
553
+ if (obj_siteUrl !== null) {
554
+ return new TypeError('Expected "null" but received "' + typeof obj_siteUrl + '" (at "' + path_siteUrl + '")');
555
+ }
556
+ })();
557
+ if (obj_siteUrl_union1_error != null) {
558
+ obj_siteUrl_union1 = obj_siteUrl_union1_error.message;
559
+ }
560
+ if (obj_siteUrl_union0 && obj_siteUrl_union1) {
561
+ var message = 'Object doesn\'t match union (at "' + path_siteUrl + '")';
562
+ message += '\n' + obj_siteUrl_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
563
+ message += '\n' + obj_siteUrl_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
564
+ return new TypeError(message);
565
+ }
566
+ var obj_status = obj.status;
567
+ var path_status = path + '.status';
568
+ var obj_status_union0 = null;
569
+ var obj_status_union0_error = (function () {
570
+ if (typeof obj_status !== 'string') {
571
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
572
+ }
573
+ })();
574
+ if (obj_status_union0_error != null) {
575
+ obj_status_union0 = obj_status_union0_error.message;
576
+ }
577
+ var obj_status_union1 = null;
578
+ var obj_status_union1_error = (function () {
579
+ if (obj_status !== null) {
580
+ return new TypeError('Expected "null" but received "' + typeof obj_status + '" (at "' + path_status + '")');
581
+ }
582
+ })();
583
+ if (obj_status_union1_error != null) {
584
+ obj_status_union1 = obj_status_union1_error.message;
585
+ }
586
+ if (obj_status_union0 && obj_status_union1) {
587
+ var message = 'Object doesn\'t match union (at "' + path_status + '")';
588
+ message += '\n' + obj_status_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
589
+ message += '\n' + obj_status_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
590
+ return new TypeError(message);
591
+ }
592
+ var obj_templateName = obj.templateName;
593
+ var path_templateName = path + '.templateName';
594
+ var obj_templateName_union0 = null;
595
+ var obj_templateName_union0_error = (function () {
596
+ if (typeof obj_templateName !== 'string') {
597
+ return new TypeError('Expected "string" but received "' + typeof obj_templateName + '" (at "' + path_templateName + '")');
598
+ }
599
+ })();
600
+ if (obj_templateName_union0_error != null) {
601
+ obj_templateName_union0 = obj_templateName_union0_error.message;
602
+ }
603
+ var obj_templateName_union1 = null;
604
+ var obj_templateName_union1_error = (function () {
605
+ if (obj_templateName !== null) {
606
+ return new TypeError('Expected "null" but received "' + typeof obj_templateName + '" (at "' + path_templateName + '")');
607
+ }
608
+ })();
609
+ if (obj_templateName_union1_error != null) {
610
+ obj_templateName_union1 = obj_templateName_union1_error.message;
611
+ }
612
+ if (obj_templateName_union0 && obj_templateName_union1) {
613
+ var message = 'Object doesn\'t match union (at "' + path_templateName + '")';
614
+ message += '\n' + obj_templateName_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
615
+ message += '\n' + obj_templateName_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
616
+ return new TypeError(message);
617
+ }
618
+ var obj_url = obj.url;
619
+ var path_url = path + '.url';
620
+ var obj_url_union0 = null;
621
+ var obj_url_union0_error = (function () {
622
+ if (typeof obj_url !== 'string') {
623
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
624
+ }
625
+ })();
626
+ if (obj_url_union0_error != null) {
627
+ obj_url_union0 = obj_url_union0_error.message;
628
+ }
629
+ var obj_url_union1 = null;
630
+ var obj_url_union1_error = (function () {
631
+ if (obj_url !== null) {
632
+ return new TypeError('Expected "null" but received "' + typeof obj_url + '" (at "' + path_url + '")');
633
+ }
634
+ })();
635
+ if (obj_url_union1_error != null) {
636
+ obj_url_union1 = obj_url_union1_error.message;
637
+ }
638
+ if (obj_url_union0 && obj_url_union1) {
639
+ var message = 'Object doesn\'t match union (at "' + path_url + '")';
640
+ message += '\n' + obj_url_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
641
+ message += '\n' + obj_url_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
642
+ return new TypeError(message);
643
+ }
644
+ var obj_urlPathPrefix = obj.urlPathPrefix;
645
+ var path_urlPathPrefix = path + '.urlPathPrefix';
646
+ var obj_urlPathPrefix_union0 = null;
647
+ var obj_urlPathPrefix_union0_error = (function () {
648
+ if (typeof obj_urlPathPrefix !== 'string') {
649
+ return new TypeError('Expected "string" but received "' + typeof obj_urlPathPrefix + '" (at "' + path_urlPathPrefix + '")');
650
+ }
651
+ })();
652
+ if (obj_urlPathPrefix_union0_error != null) {
653
+ obj_urlPathPrefix_union0 = obj_urlPathPrefix_union0_error.message;
654
+ }
655
+ var obj_urlPathPrefix_union1 = null;
656
+ var obj_urlPathPrefix_union1_error = (function () {
657
+ if (obj_urlPathPrefix !== null) {
658
+ return new TypeError('Expected "null" but received "' + typeof obj_urlPathPrefix + '" (at "' + path_urlPathPrefix + '")');
659
+ }
660
+ })();
661
+ if (obj_urlPathPrefix_union1_error != null) {
662
+ obj_urlPathPrefix_union1 = obj_urlPathPrefix_union1_error.message;
663
+ }
664
+ if (obj_urlPathPrefix_union0 && obj_urlPathPrefix_union1) {
665
+ var message = 'Object doesn\'t match union (at "' + path_urlPathPrefix + '")';
666
+ message += '\n' + obj_urlPathPrefix_union0.split('\n').map(function (line) { return '\t' + line; }).join('\n');
667
+ message += '\n' + obj_urlPathPrefix_union1.split('\n').map(function (line) { return '\t' + line; }).join('\n');
668
+ return new TypeError(message);
669
+ }
670
+ })();
671
+ return v_error === undefined ? null : v_error;
672
+ }
673
+ var RepresentationType = 'CommunityRepresentation';
674
+ function keyBuilder$2(luvio, config) {
675
+ return keyPrefix + '::' + RepresentationType + ':' + (config.id === null ? '' : config.id);
676
+ }
677
+ function keyBuilderFromType(luvio, object) {
678
+ var keyParams = {
679
+ id: object.id
680
+ };
681
+ return keyBuilder$2(luvio, keyParams);
682
+ }
683
+ function normalize(input, existing, path, luvio, store, timestamp) {
684
+ return input;
685
+ }
686
+ var select$1 = function CommunityRepresentationSelect() {
687
+ return {
688
+ kind: 'Fragment',
689
+ version: VERSION,
690
+ private: [],
691
+ selections: [
692
+ {
693
+ name: 'allowChatterAccessWithoutLogin',
694
+ kind: 'Scalar'
695
+ },
696
+ {
697
+ name: 'allowMembersToFlag',
698
+ kind: 'Scalar'
699
+ },
700
+ {
701
+ name: 'builderBasedSnaEnabled',
702
+ kind: 'Scalar'
703
+ },
704
+ {
705
+ name: 'builderUrl',
706
+ kind: 'Scalar'
707
+ },
708
+ {
709
+ name: 'description',
710
+ kind: 'Scalar'
711
+ },
712
+ {
713
+ name: 'guestMemberVisibilityEnabled',
714
+ kind: 'Scalar'
715
+ },
716
+ {
717
+ name: 'id',
718
+ kind: 'Scalar'
719
+ },
720
+ {
721
+ name: 'imageOptimizationCDNEnabled',
722
+ kind: 'Scalar'
723
+ },
724
+ {
725
+ name: 'invitationsEnabled',
726
+ kind: 'Scalar'
727
+ },
728
+ {
729
+ name: 'knowledgeableEnabled',
730
+ kind: 'Scalar'
731
+ },
732
+ {
733
+ name: 'loginUrl',
734
+ kind: 'Scalar'
735
+ },
736
+ {
737
+ name: 'memberVisibilityEnabled',
738
+ kind: 'Scalar'
739
+ },
740
+ {
741
+ name: 'name',
742
+ kind: 'Scalar'
743
+ },
744
+ {
745
+ name: 'nicknameDisplayEnabled',
746
+ kind: 'Scalar'
747
+ },
748
+ {
749
+ name: 'privateMessagesEnabled',
750
+ kind: 'Scalar'
751
+ },
752
+ {
753
+ name: 'reputationEnabled',
754
+ kind: 'Scalar'
755
+ },
756
+ {
757
+ name: 'sendWelcomeEmail',
758
+ kind: 'Scalar'
759
+ },
760
+ {
761
+ name: 'siteAsContainerEnabled',
762
+ kind: 'Scalar'
763
+ },
764
+ {
765
+ name: 'siteUrl',
766
+ kind: 'Scalar'
767
+ },
768
+ {
769
+ name: 'status',
770
+ kind: 'Scalar'
771
+ },
772
+ {
773
+ name: 'templateName',
774
+ kind: 'Scalar'
775
+ },
776
+ {
777
+ name: 'url',
778
+ kind: 'Scalar'
779
+ },
780
+ {
781
+ name: 'urlPathPrefix',
782
+ kind: 'Scalar'
783
+ }
784
+ ]
785
+ };
786
+ };
787
+ function equals(existing, incoming) {
788
+ var existing_allowChatterAccessWithoutLogin = existing.allowChatterAccessWithoutLogin;
789
+ var incoming_allowChatterAccessWithoutLogin = incoming.allowChatterAccessWithoutLogin;
790
+ if (!(existing_allowChatterAccessWithoutLogin === incoming_allowChatterAccessWithoutLogin)) {
791
+ return false;
792
+ }
793
+ var existing_allowMembersToFlag = existing.allowMembersToFlag;
794
+ var incoming_allowMembersToFlag = incoming.allowMembersToFlag;
795
+ if (!(existing_allowMembersToFlag === incoming_allowMembersToFlag)) {
796
+ return false;
797
+ }
798
+ var existing_builderBasedSnaEnabled = existing.builderBasedSnaEnabled;
799
+ var incoming_builderBasedSnaEnabled = incoming.builderBasedSnaEnabled;
800
+ if (!(existing_builderBasedSnaEnabled === incoming_builderBasedSnaEnabled)) {
801
+ return false;
802
+ }
803
+ var existing_builderUrl = existing.builderUrl;
804
+ var incoming_builderUrl = incoming.builderUrl;
805
+ if (!(existing_builderUrl === incoming_builderUrl)) {
806
+ return false;
807
+ }
808
+ var existing_description = existing.description;
809
+ var incoming_description = incoming.description;
810
+ if (!(existing_description === incoming_description)) {
811
+ return false;
812
+ }
813
+ var existing_guestMemberVisibilityEnabled = existing.guestMemberVisibilityEnabled;
814
+ var incoming_guestMemberVisibilityEnabled = incoming.guestMemberVisibilityEnabled;
815
+ if (!(existing_guestMemberVisibilityEnabled === incoming_guestMemberVisibilityEnabled)) {
816
+ return false;
817
+ }
818
+ var existing_id = existing.id;
819
+ var incoming_id = incoming.id;
820
+ if (!(existing_id === incoming_id)) {
821
+ return false;
822
+ }
823
+ var existing_imageOptimizationCDNEnabled = existing.imageOptimizationCDNEnabled;
824
+ var incoming_imageOptimizationCDNEnabled = incoming.imageOptimizationCDNEnabled;
825
+ if (!(existing_imageOptimizationCDNEnabled === incoming_imageOptimizationCDNEnabled)) {
826
+ return false;
827
+ }
828
+ var existing_invitationsEnabled = existing.invitationsEnabled;
829
+ var incoming_invitationsEnabled = incoming.invitationsEnabled;
830
+ if (!(existing_invitationsEnabled === incoming_invitationsEnabled)) {
831
+ return false;
832
+ }
833
+ var existing_knowledgeableEnabled = existing.knowledgeableEnabled;
834
+ var incoming_knowledgeableEnabled = incoming.knowledgeableEnabled;
835
+ if (!(existing_knowledgeableEnabled === incoming_knowledgeableEnabled)) {
836
+ return false;
837
+ }
838
+ var existing_loginUrl = existing.loginUrl;
839
+ var incoming_loginUrl = incoming.loginUrl;
840
+ if (!(existing_loginUrl === incoming_loginUrl)) {
841
+ return false;
842
+ }
843
+ var existing_memberVisibilityEnabled = existing.memberVisibilityEnabled;
844
+ var incoming_memberVisibilityEnabled = incoming.memberVisibilityEnabled;
845
+ if (!(existing_memberVisibilityEnabled === incoming_memberVisibilityEnabled)) {
846
+ return false;
847
+ }
848
+ var existing_name = existing.name;
849
+ var incoming_name = incoming.name;
850
+ if (!(existing_name === incoming_name)) {
851
+ return false;
852
+ }
853
+ var existing_nicknameDisplayEnabled = existing.nicknameDisplayEnabled;
854
+ var incoming_nicknameDisplayEnabled = incoming.nicknameDisplayEnabled;
855
+ if (!(existing_nicknameDisplayEnabled === incoming_nicknameDisplayEnabled)) {
856
+ return false;
857
+ }
858
+ var existing_privateMessagesEnabled = existing.privateMessagesEnabled;
859
+ var incoming_privateMessagesEnabled = incoming.privateMessagesEnabled;
860
+ if (!(existing_privateMessagesEnabled === incoming_privateMessagesEnabled)) {
861
+ return false;
862
+ }
863
+ var existing_reputationEnabled = existing.reputationEnabled;
864
+ var incoming_reputationEnabled = incoming.reputationEnabled;
865
+ if (!(existing_reputationEnabled === incoming_reputationEnabled)) {
866
+ return false;
867
+ }
868
+ var existing_sendWelcomeEmail = existing.sendWelcomeEmail;
869
+ var incoming_sendWelcomeEmail = incoming.sendWelcomeEmail;
870
+ if (!(existing_sendWelcomeEmail === incoming_sendWelcomeEmail)) {
871
+ return false;
872
+ }
873
+ var existing_siteAsContainerEnabled = existing.siteAsContainerEnabled;
874
+ var incoming_siteAsContainerEnabled = incoming.siteAsContainerEnabled;
875
+ if (!(existing_siteAsContainerEnabled === incoming_siteAsContainerEnabled)) {
876
+ return false;
877
+ }
878
+ var existing_siteUrl = existing.siteUrl;
879
+ var incoming_siteUrl = incoming.siteUrl;
880
+ if (!(existing_siteUrl === incoming_siteUrl)) {
881
+ return false;
882
+ }
883
+ var existing_status = existing.status;
884
+ var incoming_status = incoming.status;
885
+ if (!(existing_status === incoming_status)) {
886
+ return false;
887
+ }
888
+ var existing_templateName = existing.templateName;
889
+ var incoming_templateName = incoming.templateName;
890
+ if (!(existing_templateName === incoming_templateName)) {
891
+ return false;
892
+ }
893
+ var existing_url = existing.url;
894
+ var incoming_url = incoming.url;
895
+ if (!(existing_url === incoming_url)) {
896
+ return false;
897
+ }
898
+ var existing_urlPathPrefix = existing.urlPathPrefix;
899
+ var incoming_urlPathPrefix = incoming.urlPathPrefix;
900
+ if (!(existing_urlPathPrefix === incoming_urlPathPrefix)) {
901
+ return false;
902
+ }
903
+ return true;
904
+ }
905
+ var ingest = function CommunityRepresentationIngest(input, path, luvio, store, timestamp) {
906
+ if (process.env.NODE_ENV !== 'production') {
907
+ var validateError = validate(input);
908
+ if (validateError !== null) {
909
+ throw validateError;
910
+ }
911
+ }
912
+ var key = keyBuilderFromType(luvio, input);
913
+ var existingRecord = store.readEntry(key);
914
+ var ttlToUse = TTL;
915
+ var incomingRecord = normalize(input, store.readEntry(key), {
916
+ fullPath: key,
917
+ parent: path.parent,
918
+ propertyName: path.propertyName,
919
+ ttl: ttlToUse
920
+ });
921
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
922
+ luvio.storePublish(key, incomingRecord);
923
+ }
924
+ {
925
+ var storeMetadataParams = {
926
+ ttl: ttlToUse,
927
+ namespace: "CommunityInfo",
928
+ version: VERSION,
929
+ representationName: RepresentationType,
930
+ };
931
+ luvio.publishStoreMetadata(key, storeMetadataParams);
932
+ }
933
+ return createLink(key);
934
+ };
935
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
936
+ var rootKeySet = new engine.StoreKeyMap();
937
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
938
+ var rootKey = keyBuilderFromType(luvio, input);
939
+ rootKeySet.set(rootKey, {
940
+ namespace: keyPrefix,
941
+ representationName: RepresentationType,
942
+ mergeable: false
943
+ });
944
+ return rootKeySet;
945
+ }
946
+
947
+ function select(luvio, params) {
948
+ return select$1();
949
+ }
950
+ function keyBuilder$1(luvio, params) {
951
+ return keyBuilder$2(luvio, {
952
+ id: params.urlParams.communityId
953
+ });
954
+ }
955
+ function getResponseCacheKeys(luvio, resourceParams, response) {
956
+ return getTypeCacheKeys(luvio, response);
957
+ }
958
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
959
+ var body = response.body;
960
+ var key = keyBuilder$1(luvio, resourceParams);
961
+ luvio.storeIngest(key, ingest, body);
962
+ var snapshot = luvio.storeLookup({
963
+ recordId: key,
964
+ node: select(),
965
+ variables: {},
966
+ }, snapshotRefresh);
967
+ if (process.env.NODE_ENV !== 'production') {
968
+ if (snapshot.state !== 'Fulfilled') {
969
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
970
+ }
971
+ }
972
+ return snapshot;
973
+ }
974
+ function ingestError(luvio, params, error, snapshotRefresh) {
975
+ var key = keyBuilder$1(luvio, params);
976
+ var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
977
+ var storeMetadataParams = {
978
+ ttl: TTL,
979
+ namespace: keyPrefix,
980
+ version: VERSION,
981
+ representationName: RepresentationType
982
+ };
983
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
984
+ return errorSnapshot;
985
+ }
986
+ function createResourceRequest(config) {
987
+ var headers = {};
988
+ return {
989
+ baseUri: '/services/data/v58.0',
990
+ basePath: '/connect/communities/' + config.urlParams.communityId + '',
991
+ method: 'get',
992
+ body: null,
993
+ urlParams: config.urlParams,
994
+ queryParams: {},
995
+ headers: headers,
996
+ priority: 'normal',
997
+ };
998
+ }
999
+
1000
+ var getCommunity_ConfigPropertyNames = {
1001
+ displayName: 'getCommunity',
1002
+ parameters: {
1003
+ required: ['communityId'],
1004
+ optional: []
1005
+ }
1006
+ };
1007
+ function createResourceParams(config) {
1008
+ var resourceParams = {
1009
+ urlParams: {
1010
+ communityId: config.communityId
1011
+ }
1012
+ };
1013
+ return resourceParams;
1014
+ }
1015
+ function keyBuilder(luvio, config) {
1016
+ var resourceParams = createResourceParams(config);
1017
+ return keyBuilder$1(luvio, resourceParams);
1018
+ }
1019
+ function typeCheckConfig(untrustedConfig) {
1020
+ var config = {};
1021
+ var untrustedConfig_communityId = untrustedConfig.communityId;
1022
+ if (typeof untrustedConfig_communityId === 'string') {
1023
+ config.communityId = untrustedConfig_communityId;
1024
+ }
1025
+ return config;
1026
+ }
1027
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1028
+ if (!untrustedIsObject(untrustedConfig)) {
1029
+ return null;
1030
+ }
1031
+ if (process.env.NODE_ENV !== 'production') {
1032
+ validateConfig(untrustedConfig, configPropertyNames);
1033
+ }
1034
+ var config = typeCheckConfig(untrustedConfig);
1035
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1036
+ return null;
1037
+ }
1038
+ return config;
1039
+ }
1040
+ function adapterFragment(luvio, config) {
1041
+ createResourceParams(config);
1042
+ return select();
1043
+ }
1044
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1045
+ var snapshot = ingestSuccess(luvio, resourceParams, response, {
1046
+ config: config,
1047
+ resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
1048
+ });
1049
+ return luvio.storeBroadcast().then(function () { return snapshot; });
1050
+ }
1051
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1052
+ var snapshot = ingestError(luvio, resourceParams, response, {
1053
+ config: config,
1054
+ resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
1055
+ });
1056
+ return luvio.storeBroadcast().then(function () { return snapshot; });
1057
+ }
1058
+ function buildNetworkSnapshot(luvio, config, options) {
1059
+ var resourceParams = createResourceParams(config);
1060
+ var request = createResourceRequest(resourceParams);
1061
+ return luvio.dispatchResourceRequest(request, options)
1062
+ .then(function (response) {
1063
+ return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys(luvio, resourceParams, response.body); });
1064
+ }, function (response) {
1065
+ return luvio.handleErrorResponse(function () { return onFetchResponseError(luvio, config, resourceParams, response); });
1066
+ });
1067
+ }
1068
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1069
+ var luvio = context.luvio, config = context.config;
1070
+ var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
1071
+ var dispatchOptions = {
1072
+ resourceRequestContext: {
1073
+ requestCorrelator: requestCorrelator,
1074
+ luvioRequestMethod: undefined,
1075
+ },
1076
+ eventObservers: eventObservers
1077
+ };
1078
+ if (networkPriority !== 'normal') {
1079
+ dispatchOptions.overrides = {
1080
+ priority: networkPriority
1081
+ };
1082
+ }
1083
+ return buildNetworkSnapshot(luvio, config, dispatchOptions);
1084
+ }
1085
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
1086
+ var luvio = context.luvio, config = context.config;
1087
+ var selector = {
1088
+ recordId: keyBuilder(luvio, config),
1089
+ node: adapterFragment(luvio, config),
1090
+ variables: {},
1091
+ };
1092
+ var cacheSnapshot = storeLookup(selector, {
1093
+ config: config,
1094
+ resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
1095
+ });
1096
+ return cacheSnapshot;
1097
+ }
1098
+ var getCommunityAdapterFactory = function (luvio) { return function CommunityInfo__getCommunity(untrustedConfig, requestContext) {
1099
+ var config = validateAdapterConfig(untrustedConfig, getCommunity_ConfigPropertyNames);
1100
+ // Invalid or incomplete config
1101
+ if (config === null) {
1102
+ return null;
1103
+ }
1104
+ return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
1105
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1106
+ }; };
1107
+
1108
+ exports.getCommunityAdapterFactory = getCommunityAdapterFactory;
1109
+
1110
+ Object.defineProperty(exports, '__esModule', { value: true });
1111
+
1112
+ }));