@salesforce/lds-adapters-community-info 1.124.1 → 1.124.3

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