@salesforce/lds-adapters-platform-slack-bridge 1.329.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/platform-slack-bridge.js +4444 -0
  3. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
  4. package/dist/es/es2018/types/src/generated/adapters/deleteSlackMessage.d.ts +16 -0
  5. package/dist/es/es2018/types/src/generated/adapters/deleteSlackMessageReactions.d.ts +17 -0
  6. package/dist/es/es2018/types/src/generated/adapters/getSlackConversation.d.ts +35 -0
  7. package/dist/es/es2018/types/src/generated/adapters/getSlackCustomEmoji.d.ts +27 -0
  8. package/dist/es/es2018/types/src/generated/adapters/getSlackMessage.d.ts +30 -0
  9. package/dist/es/es2018/types/src/generated/adapters/getSlackSearchEmoji.d.ts +28 -0
  10. package/dist/es/es2018/types/src/generated/adapters/getSlackSearchUser.d.ts +28 -0
  11. package/dist/es/es2018/types/src/generated/adapters/getSlackUser.d.ts +29 -0
  12. package/dist/es/es2018/types/src/generated/adapters/patchSlackMessage.d.ts +18 -0
  13. package/dist/es/es2018/types/src/generated/adapters/postSlackConversation.d.ts +20 -0
  14. package/dist/es/es2018/types/src/generated/adapters/postSlackFile.d.ts +22 -0
  15. package/dist/es/es2018/types/src/generated/adapters/postSlackMessageReactions.d.ts +18 -0
  16. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +12 -0
  17. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +21 -0
  18. package/dist/es/es2018/types/src/generated/resources/deleteConnectSlackbridgeTeamChannelMessagesByChannelIdAndMessageTsAndTeamId.d.ts +14 -0
  19. package/dist/es/es2018/types/src/generated/resources/deleteConnectSlackbridgeTeamChannelMessagesReactionsByChannelIdAndMessageTsAndTeamId.d.ts +17 -0
  20. package/dist/es/es2018/types/src/generated/resources/getConnectSlackbridgeConversationMessages.d.ts +23 -0
  21. package/dist/es/es2018/types/src/generated/resources/getConnectSlackbridgeTeamChannelMessagesByChannelIdAndMessageTsAndTeamId.d.ts +18 -0
  22. package/dist/es/es2018/types/src/generated/resources/getConnectSlackbridgeTeamChannelMessagesReactionsByChannelIdAndMessageTsAndTeamId.d.ts +17 -0
  23. package/dist/es/es2018/types/src/generated/resources/getConnectSlackbridgeTeamEmojisByTeamId.d.ts +15 -0
  24. package/dist/es/es2018/types/src/generated/resources/getConnectSlackbridgeTeamSearchEmojisByTeamId.d.ts +18 -0
  25. package/dist/es/es2018/types/src/generated/resources/getConnectSlackbridgeTeamSearchUsersByTeamId.d.ts +18 -0
  26. package/dist/es/es2018/types/src/generated/resources/getConnectSlackbridgeTeamUserBySlackUserIdAndTeamId.d.ts +17 -0
  27. package/dist/es/es2018/types/src/generated/resources/patchConnectSlackbridgeTeamChannelMessagesByChannelIdAndMessageTsAndTeamId.d.ts +17 -0
  28. package/dist/es/es2018/types/src/generated/resources/postConnectSlackbridgeConversationMessages.d.ts +17 -0
  29. package/dist/es/es2018/types/src/generated/resources/postConnectSlackbridgeFiles.d.ts +19 -0
  30. package/dist/es/es2018/types/src/generated/resources/postConnectSlackbridgeTeamChannelMessagesReactionsByChannelIdAndMessageTsAndTeamId.d.ts +17 -0
  31. package/dist/es/es2018/types/src/generated/types/SlackBridgeContentDocumentOutputRepresentation.d.ts +40 -0
  32. package/dist/es/es2018/types/src/generated/types/SlackBridgeContentVersionOutputRepresentation.d.ts +43 -0
  33. package/dist/es/es2018/types/src/generated/types/SlackBridgeConversationHistoryOutputRepresentation.d.ts +44 -0
  34. package/dist/es/es2018/types/src/generated/types/SlackBridgeConversationInfoOutputRepresentation.d.ts +67 -0
  35. package/dist/es/es2018/types/src/generated/types/SlackBridgeConversationInfosOutputRepresentation.d.ts +32 -0
  36. package/dist/es/es2018/types/src/generated/types/SlackBridgeConversationOutputRepresentation.d.ts +65 -0
  37. package/dist/es/es2018/types/src/generated/types/SlackBridgeCustomEmojisOutputRepresentation.d.ts +35 -0
  38. package/dist/es/es2018/types/src/generated/types/SlackBridgeEmojiOutputRepresentation.d.ts +40 -0
  39. package/dist/es/es2018/types/src/generated/types/SlackBridgeEmojisOutputRepresentation.d.ts +32 -0
  40. package/dist/es/es2018/types/src/generated/types/SlackBridgeFileInputRepresentation.d.ts +49 -0
  41. package/dist/es/es2018/types/src/generated/types/SlackBridgeFileOutputRepresentation.d.ts +68 -0
  42. package/dist/es/es2018/types/src/generated/types/SlackBridgeFileTypeOutputRepresentation.d.ts +31 -0
  43. package/dist/es/es2018/types/src/generated/types/SlackBridgeMessageFragmentOutputRepresentation.d.ts +43 -0
  44. package/dist/es/es2018/types/src/generated/types/SlackBridgeMessageOutputRepresentation.d.ts +87 -0
  45. package/dist/es/es2018/types/src/generated/types/SlackBridgePostMessageInputRepresentation.d.ts +43 -0
  46. package/dist/es/es2018/types/src/generated/types/SlackBridgePostMessageOutputRepresentation.d.ts +53 -0
  47. package/dist/es/es2018/types/src/generated/types/SlackBridgePostMessageReactionInputRepresentation.d.ts +28 -0
  48. package/dist/es/es2018/types/src/generated/types/SlackBridgeReactionOutputRepresentation.d.ts +37 -0
  49. package/dist/es/es2018/types/src/generated/types/SlackBridgeReactionsOutputRepresentation.d.ts +47 -0
  50. package/dist/es/es2018/types/src/generated/types/SlackBridgeUpdateMessageInputRepresentation.d.ts +28 -0
  51. package/dist/es/es2018/types/src/generated/types/SlackBridgeUpdatedMessageOutputRepresentation.d.ts +44 -0
  52. package/dist/es/es2018/types/src/generated/types/SlackBridgeUserInfoOutputRepresentation.d.ts +84 -0
  53. package/dist/es/es2018/types/src/generated/types/SlackBridgeUserInfosOutputRepresentation.d.ts +41 -0
  54. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  55. package/package.json +66 -0
  56. package/sfdc/index.d.ts +1 -0
  57. package/sfdc/index.js +4623 -0
  58. package/src/raml/api.raml +778 -0
  59. package/src/raml/luvio.raml +88 -0
package/sfdc/index.js ADDED
@@ -0,0 +1,4623 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ /*
8
+ * ATTENTION!
9
+ * THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
10
+ * If you would like to contribute to LDS, please follow the steps outlined in the git repo.
11
+ * Any changes made to this file in p4 will be automatically overwritten.
12
+ * *******************************************************************************************
13
+ */
14
+ /* proxy-compat-disable */
15
+ import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
16
+ import { withDefaultLuvio } from 'force/ldsEngine';
17
+ import { serializeStructuredKey, ingestShape, StoreKeyMap, deepFreeze, createResourceParams as createResourceParams$c, typeCheckConfig as typeCheckConfig$c, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$6 } from 'force/luvioEngine';
18
+
19
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
+ const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
21
+ const { isArray: ArrayIsArray$1 } = Array;
22
+ /**
23
+ * Validates an adapter config is well-formed.
24
+ * @param config The config to validate.
25
+ * @param adapter The adapter validation configuration.
26
+ * @param oneOf The keys the config must contain at least one of.
27
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
28
+ */
29
+ function validateConfig(config, adapter, oneOf) {
30
+ const { displayName } = adapter;
31
+ const { required, optional, unsupported } = adapter.parameters;
32
+ if (config === undefined ||
33
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
34
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
35
+ }
36
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
37
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
38
+ }
39
+ if (unsupported !== undefined &&
40
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
41
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
42
+ }
43
+ const supported = required.concat(optional);
44
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
45
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
46
+ }
47
+ }
48
+ function untrustedIsObject(untrusted) {
49
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
50
+ }
51
+ function areRequiredParametersPresent(config, configPropertyNames) {
52
+ return configPropertyNames.parameters.required.every(req => req in config);
53
+ }
54
+ const snapshotRefreshOptions = {
55
+ overrides: {
56
+ headers: {
57
+ 'Cache-Control': 'no-cache',
58
+ },
59
+ }
60
+ };
61
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
62
+ return {
63
+ name,
64
+ required,
65
+ resourceType,
66
+ typeCheckShape,
67
+ isArrayShape,
68
+ coerceFn,
69
+ };
70
+ }
71
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
72
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
73
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
74
+ return {
75
+ displayName,
76
+ parameters: {
77
+ required,
78
+ optional,
79
+ }
80
+ };
81
+ }
82
+ const keyPrefix = 'SlackBridge';
83
+
84
+ const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
85
+ const { isArray: ArrayIsArray } = Array;
86
+ function equalsArray(a, b, equalsItem) {
87
+ const aLength = a.length;
88
+ const bLength = b.length;
89
+ if (aLength !== bLength) {
90
+ return false;
91
+ }
92
+ for (let i = 0; i < aLength; i++) {
93
+ if (equalsItem(a[i], b[i]) === false) {
94
+ return false;
95
+ }
96
+ }
97
+ return true;
98
+ }
99
+ function equalsObject(a, b, equalsProp) {
100
+ const aKeys = ObjectKeys(a).sort();
101
+ const bKeys = ObjectKeys(b).sort();
102
+ const aKeysLength = aKeys.length;
103
+ const bKeysLength = bKeys.length;
104
+ if (aKeysLength !== bKeysLength) {
105
+ return false;
106
+ }
107
+ for (let i = 0; i < aKeys.length; i++) {
108
+ const key = aKeys[i];
109
+ if (key !== bKeys[i]) {
110
+ return false;
111
+ }
112
+ if (equalsProp(a[key], b[key]) === false) {
113
+ return false;
114
+ }
115
+ }
116
+ return true;
117
+ }
118
+ function createLink(ref) {
119
+ return {
120
+ __ref: serializeStructuredKey(ref),
121
+ };
122
+ }
123
+
124
+ const VERSION$g = "605674abcbc0dad7e2707e4e00e8d4cd";
125
+ function validate$g(obj, path = 'SlackBridgeMessageFragmentOutputRepresentation') {
126
+ const v_error = (() => {
127
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
128
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
129
+ }
130
+ const obj_channelId = obj.channelId;
131
+ const path_channelId = path + '.channelId';
132
+ if (typeof obj_channelId !== 'string') {
133
+ return new TypeError('Expected "string" but received "' + typeof obj_channelId + '" (at "' + path_channelId + '")');
134
+ }
135
+ const obj_messageTs = obj.messageTs;
136
+ const path_messageTs = path + '.messageTs';
137
+ if (typeof obj_messageTs !== 'string') {
138
+ return new TypeError('Expected "string" but received "' + typeof obj_messageTs + '" (at "' + path_messageTs + '")');
139
+ }
140
+ const obj_teamId = obj.teamId;
141
+ const path_teamId = path + '.teamId';
142
+ if (typeof obj_teamId !== 'string') {
143
+ return new TypeError('Expected "string" but received "' + typeof obj_teamId + '" (at "' + path_teamId + '")');
144
+ }
145
+ })();
146
+ return v_error === undefined ? null : v_error;
147
+ }
148
+ const RepresentationType$a = 'SlackBridgeMessageFragmentOutputRepresentation';
149
+ function keyBuilder$i(luvio, config) {
150
+ return keyPrefix + '::' + RepresentationType$a + ':' + config.channelId;
151
+ }
152
+ function keyBuilderFromType$4(luvio, object) {
153
+ const keyParams = {
154
+ channelId: object.channelId
155
+ };
156
+ return keyBuilder$i(luvio, keyParams);
157
+ }
158
+ function normalize$a(input, existing, path, luvio, store, timestamp) {
159
+ return input;
160
+ }
161
+ const select$q = function SlackBridgeMessageFragmentOutputRepresentationSelect() {
162
+ return {
163
+ kind: 'Fragment',
164
+ version: VERSION$g,
165
+ private: [],
166
+ selections: [
167
+ {
168
+ name: 'channelId',
169
+ kind: 'Scalar'
170
+ },
171
+ {
172
+ name: 'messageTs',
173
+ kind: 'Scalar'
174
+ },
175
+ {
176
+ name: 'teamId',
177
+ kind: 'Scalar'
178
+ }
179
+ ]
180
+ };
181
+ };
182
+ function equals$g(existing, incoming) {
183
+ const existing_channelId = existing.channelId;
184
+ const incoming_channelId = incoming.channelId;
185
+ if (!(existing_channelId === incoming_channelId)) {
186
+ return false;
187
+ }
188
+ const existing_messageTs = existing.messageTs;
189
+ const incoming_messageTs = incoming.messageTs;
190
+ if (!(existing_messageTs === incoming_messageTs)) {
191
+ return false;
192
+ }
193
+ const existing_teamId = existing.teamId;
194
+ const incoming_teamId = incoming.teamId;
195
+ if (!(existing_teamId === incoming_teamId)) {
196
+ return false;
197
+ }
198
+ return true;
199
+ }
200
+ const ingest$a = function SlackBridgeMessageFragmentOutputRepresentationIngest(input, path, luvio, store, timestamp) {
201
+ if (process.env.NODE_ENV !== 'production') {
202
+ const validateError = validate$g(input);
203
+ if (validateError !== null) {
204
+ throw validateError;
205
+ }
206
+ }
207
+ const key = keyBuilderFromType$4(luvio, input);
208
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
209
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$a, "SlackBridge", VERSION$g, RepresentationType$a, equals$g);
210
+ return createLink(key);
211
+ };
212
+ function getTypeCacheKeys$a(rootKeySet, luvio, input, fullPathFactory) {
213
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
214
+ const rootKey = keyBuilderFromType$4(luvio, input);
215
+ rootKeySet.set(rootKey, {
216
+ namespace: keyPrefix,
217
+ representationName: RepresentationType$a,
218
+ mergeable: false
219
+ });
220
+ }
221
+
222
+ function keyBuilder$h(luvio, params) {
223
+ return keyBuilder$i(luvio, {
224
+ channelId: params.urlParams.channelId
225
+ });
226
+ }
227
+ function getResponseCacheKeys$b(cacheKeyMap, luvio, resourceParams) {
228
+ const key = keyBuilder$h(luvio, resourceParams);
229
+ cacheKeyMap.set(key, {
230
+ namespace: keyPrefix,
231
+ representationName: RepresentationType$a,
232
+ mergeable: false
233
+ });
234
+ }
235
+ function evictSuccess$1(luvio, resourceParams) {
236
+ const key = keyBuilder$h(luvio, resourceParams);
237
+ luvio.storeEvict(key);
238
+ }
239
+ function createResourceRequest$b(config) {
240
+ const headers = {};
241
+ return {
242
+ baseUri: '/services/data/v63.0',
243
+ basePath: '/connect/slackbridge/team/' + config.urlParams.teamId + '/channel/' + config.urlParams.channelId + '/messages/' + config.urlParams.messageTs + '',
244
+ method: 'delete',
245
+ body: null,
246
+ urlParams: config.urlParams,
247
+ queryParams: {},
248
+ headers,
249
+ priority: 'normal',
250
+ };
251
+ }
252
+
253
+ const adapterName$b = 'deleteSlackMessage';
254
+ const deleteSlackMessage_ConfigPropertyMetadata = [
255
+ generateParamConfigMetadata('channelId', true, 0 /* UrlParameter */, 0 /* String */),
256
+ generateParamConfigMetadata('messageTs', true, 0 /* UrlParameter */, 0 /* String */),
257
+ generateParamConfigMetadata('teamId', true, 0 /* UrlParameter */, 0 /* String */),
258
+ ];
259
+ const deleteSlackMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$b, deleteSlackMessage_ConfigPropertyMetadata);
260
+ const createResourceParams$b = /*#__PURE__*/ createResourceParams$c(deleteSlackMessage_ConfigPropertyMetadata);
261
+ function typeCheckConfig$b(untrustedConfig) {
262
+ const config = {};
263
+ typeCheckConfig$c(untrustedConfig, config, deleteSlackMessage_ConfigPropertyMetadata);
264
+ return config;
265
+ }
266
+ function validateAdapterConfig$b(untrustedConfig, configPropertyNames) {
267
+ if (!untrustedIsObject(untrustedConfig)) {
268
+ return null;
269
+ }
270
+ if (process.env.NODE_ENV !== 'production') {
271
+ validateConfig(untrustedConfig, configPropertyNames);
272
+ }
273
+ const config = typeCheckConfig$b(untrustedConfig);
274
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
275
+ return null;
276
+ }
277
+ return config;
278
+ }
279
+ function buildNetworkSnapshot$b(luvio, config, options) {
280
+ const resourceParams = createResourceParams$b(config);
281
+ const request = createResourceRequest$b(resourceParams);
282
+ return luvio.dispatchResourceRequest(request, options)
283
+ .then(() => {
284
+ return luvio.handleSuccessResponse(() => {
285
+ evictSuccess$1(luvio, resourceParams);
286
+ return luvio.storeBroadcast();
287
+ }, () => {
288
+ const cache = new StoreKeyMap();
289
+ getResponseCacheKeys$b(cache, luvio, resourceParams);
290
+ return cache;
291
+ });
292
+ }, (response) => {
293
+ deepFreeze(response);
294
+ throw response;
295
+ });
296
+ }
297
+ const deleteSlackMessageAdapterFactory = (luvio) => {
298
+ return function SlackBridgedeleteSlackMessage(untrustedConfig) {
299
+ const config = validateAdapterConfig$b(untrustedConfig, deleteSlackMessage_ConfigPropertyNames);
300
+ // Invalid or incomplete config
301
+ if (config === null) {
302
+ throw new Error(`Invalid config for "${adapterName$b}"`);
303
+ }
304
+ return buildNetworkSnapshot$b(luvio, config);
305
+ };
306
+ };
307
+
308
+ const VERSION$f = "c7dec6b60c7d567a7835fbdd84d3e67e";
309
+ function validate$f(obj, path = 'SlackBridgeReactionOutputRepresentation') {
310
+ const v_error = (() => {
311
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
312
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
313
+ }
314
+ const obj_count = obj.count;
315
+ const path_count = path + '.count';
316
+ if (typeof obj_count !== 'number' || (typeof obj_count === 'number' && Math.floor(obj_count) !== obj_count)) {
317
+ return new TypeError('Expected "integer" but received "' + typeof obj_count + '" (at "' + path_count + '")');
318
+ }
319
+ const obj_name = obj.name;
320
+ const path_name = path + '.name';
321
+ if (typeof obj_name !== 'string') {
322
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
323
+ }
324
+ const obj_reactedUsers = obj.reactedUsers;
325
+ const path_reactedUsers = path + '.reactedUsers';
326
+ if (!ArrayIsArray(obj_reactedUsers)) {
327
+ return new TypeError('Expected "array" but received "' + typeof obj_reactedUsers + '" (at "' + path_reactedUsers + '")');
328
+ }
329
+ for (let i = 0; i < obj_reactedUsers.length; i++) {
330
+ const obj_reactedUsers_item = obj_reactedUsers[i];
331
+ const path_reactedUsers_item = path_reactedUsers + '[' + i + ']';
332
+ if (typeof obj_reactedUsers_item !== 'string') {
333
+ return new TypeError('Expected "string" but received "' + typeof obj_reactedUsers_item + '" (at "' + path_reactedUsers_item + '")');
334
+ }
335
+ }
336
+ const obj_url = obj.url;
337
+ const path_url = path + '.url';
338
+ let obj_url_union0 = null;
339
+ const obj_url_union0_error = (() => {
340
+ if (typeof obj_url !== 'string') {
341
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
342
+ }
343
+ })();
344
+ if (obj_url_union0_error != null) {
345
+ obj_url_union0 = obj_url_union0_error.message;
346
+ }
347
+ let obj_url_union1 = null;
348
+ const obj_url_union1_error = (() => {
349
+ if (obj_url !== null) {
350
+ return new TypeError('Expected "null" but received "' + typeof obj_url + '" (at "' + path_url + '")');
351
+ }
352
+ })();
353
+ if (obj_url_union1_error != null) {
354
+ obj_url_union1 = obj_url_union1_error.message;
355
+ }
356
+ if (obj_url_union0 && obj_url_union1) {
357
+ let message = 'Object doesn\'t match union (at "' + path_url + '")';
358
+ message += '\n' + obj_url_union0.split('\n').map((line) => '\t' + line).join('\n');
359
+ message += '\n' + obj_url_union1.split('\n').map((line) => '\t' + line).join('\n');
360
+ return new TypeError(message);
361
+ }
362
+ })();
363
+ return v_error === undefined ? null : v_error;
364
+ }
365
+ const select$p = function SlackBridgeReactionOutputRepresentationSelect() {
366
+ return {
367
+ kind: 'Fragment',
368
+ version: VERSION$f,
369
+ private: [],
370
+ selections: [
371
+ {
372
+ name: 'count',
373
+ kind: 'Scalar'
374
+ },
375
+ {
376
+ name: 'name',
377
+ kind: 'Scalar'
378
+ },
379
+ {
380
+ name: 'reactedUsers',
381
+ kind: 'Scalar',
382
+ plural: true
383
+ },
384
+ {
385
+ name: 'url',
386
+ kind: 'Scalar'
387
+ }
388
+ ]
389
+ };
390
+ };
391
+ function equals$f(existing, incoming) {
392
+ const existing_count = existing.count;
393
+ const incoming_count = incoming.count;
394
+ if (!(existing_count === incoming_count)) {
395
+ return false;
396
+ }
397
+ const existing_name = existing.name;
398
+ const incoming_name = incoming.name;
399
+ if (!(existing_name === incoming_name)) {
400
+ return false;
401
+ }
402
+ const existing_reactedUsers = existing.reactedUsers;
403
+ const incoming_reactedUsers = incoming.reactedUsers;
404
+ const equals_reactedUsers_items = equalsArray(existing_reactedUsers, incoming_reactedUsers, (existing_reactedUsers_item, incoming_reactedUsers_item) => {
405
+ if (!(existing_reactedUsers_item === incoming_reactedUsers_item)) {
406
+ return false;
407
+ }
408
+ });
409
+ if (equals_reactedUsers_items === false) {
410
+ return false;
411
+ }
412
+ const existing_url = existing.url;
413
+ const incoming_url = incoming.url;
414
+ if (!(existing_url === incoming_url)) {
415
+ return false;
416
+ }
417
+ return true;
418
+ }
419
+
420
+ const VERSION$e = "804aa6216a7579adeeae856f76b688db";
421
+ function validate$e(obj, path = 'SlackBridgeReactionsOutputRepresentation') {
422
+ const v_error = (() => {
423
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
424
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
425
+ }
426
+ const obj_channelId = obj.channelId;
427
+ const path_channelId = path + '.channelId';
428
+ if (typeof obj_channelId !== 'string') {
429
+ return new TypeError('Expected "string" but received "' + typeof obj_channelId + '" (at "' + path_channelId + '")');
430
+ }
431
+ const obj_messageTs = obj.messageTs;
432
+ const path_messageTs = path + '.messageTs';
433
+ if (typeof obj_messageTs !== 'string') {
434
+ return new TypeError('Expected "string" but received "' + typeof obj_messageTs + '" (at "' + path_messageTs + '")');
435
+ }
436
+ const obj_reactions = obj.reactions;
437
+ const path_reactions = path + '.reactions';
438
+ if (!ArrayIsArray(obj_reactions)) {
439
+ return new TypeError('Expected "array" but received "' + typeof obj_reactions + '" (at "' + path_reactions + '")');
440
+ }
441
+ for (let i = 0; i < obj_reactions.length; i++) {
442
+ const obj_reactions_item = obj_reactions[i];
443
+ const path_reactions_item = path_reactions + '[' + i + ']';
444
+ const referencepath_reactions_itemValidationError = validate$f(obj_reactions_item, path_reactions_item);
445
+ if (referencepath_reactions_itemValidationError !== null) {
446
+ let message = 'Object doesn\'t match SlackBridgeReactionOutputRepresentation (at "' + path_reactions_item + '")\n';
447
+ message += referencepath_reactions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
448
+ return new TypeError(message);
449
+ }
450
+ }
451
+ const obj_teamId = obj.teamId;
452
+ const path_teamId = path + '.teamId';
453
+ if (typeof obj_teamId !== 'string') {
454
+ return new TypeError('Expected "string" but received "' + typeof obj_teamId + '" (at "' + path_teamId + '")');
455
+ }
456
+ })();
457
+ return v_error === undefined ? null : v_error;
458
+ }
459
+ const RepresentationType$9 = 'SlackBridgeReactionsOutputRepresentation';
460
+ function keyBuilder$g(luvio, config) {
461
+ return keyPrefix + '::' + RepresentationType$9 + ':' + config.channelId;
462
+ }
463
+ function keyBuilderFromType$3(luvio, object) {
464
+ const keyParams = {
465
+ channelId: object.channelId
466
+ };
467
+ return keyBuilder$g(luvio, keyParams);
468
+ }
469
+ function normalize$9(input, existing, path, luvio, store, timestamp) {
470
+ return input;
471
+ }
472
+ const select$o = function SlackBridgeReactionsOutputRepresentationSelect() {
473
+ const { selections: SlackBridgeReactionOutputRepresentation__selections, opaque: SlackBridgeReactionOutputRepresentation__opaque, } = select$p();
474
+ return {
475
+ kind: 'Fragment',
476
+ version: VERSION$e,
477
+ private: [],
478
+ selections: [
479
+ {
480
+ name: 'channelId',
481
+ kind: 'Scalar'
482
+ },
483
+ {
484
+ name: 'messageTs',
485
+ kind: 'Scalar'
486
+ },
487
+ {
488
+ name: 'reactions',
489
+ kind: 'Object',
490
+ plural: true,
491
+ selections: SlackBridgeReactionOutputRepresentation__selections
492
+ },
493
+ {
494
+ name: 'teamId',
495
+ kind: 'Scalar'
496
+ }
497
+ ]
498
+ };
499
+ };
500
+ function equals$e(existing, incoming) {
501
+ const existing_channelId = existing.channelId;
502
+ const incoming_channelId = incoming.channelId;
503
+ if (!(existing_channelId === incoming_channelId)) {
504
+ return false;
505
+ }
506
+ const existing_messageTs = existing.messageTs;
507
+ const incoming_messageTs = incoming.messageTs;
508
+ if (!(existing_messageTs === incoming_messageTs)) {
509
+ return false;
510
+ }
511
+ const existing_teamId = existing.teamId;
512
+ const incoming_teamId = incoming.teamId;
513
+ if (!(existing_teamId === incoming_teamId)) {
514
+ return false;
515
+ }
516
+ const existing_reactions = existing.reactions;
517
+ const incoming_reactions = incoming.reactions;
518
+ const equals_reactions_items = equalsArray(existing_reactions, incoming_reactions, (existing_reactions_item, incoming_reactions_item) => {
519
+ if (!(equals$f(existing_reactions_item, incoming_reactions_item))) {
520
+ return false;
521
+ }
522
+ });
523
+ if (equals_reactions_items === false) {
524
+ return false;
525
+ }
526
+ return true;
527
+ }
528
+ const ingest$9 = function SlackBridgeReactionsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
529
+ if (process.env.NODE_ENV !== 'production') {
530
+ const validateError = validate$e(input);
531
+ if (validateError !== null) {
532
+ throw validateError;
533
+ }
534
+ }
535
+ const key = keyBuilderFromType$3(luvio, input);
536
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
537
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$9, "SlackBridge", VERSION$e, RepresentationType$9, equals$e);
538
+ return createLink(key);
539
+ };
540
+ function getTypeCacheKeys$9(rootKeySet, luvio, input, fullPathFactory) {
541
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
542
+ const rootKey = keyBuilderFromType$3(luvio, input);
543
+ rootKeySet.set(rootKey, {
544
+ namespace: keyPrefix,
545
+ representationName: RepresentationType$9,
546
+ mergeable: false
547
+ });
548
+ }
549
+
550
+ function keyBuilder$f(luvio, params) {
551
+ return keyBuilder$g(luvio, {
552
+ channelId: params.urlParams.channelId
553
+ });
554
+ }
555
+ function getResponseCacheKeys$a(cacheKeyMap, luvio, resourceParams) {
556
+ const key = keyBuilder$f(luvio, resourceParams);
557
+ cacheKeyMap.set(key, {
558
+ namespace: keyPrefix,
559
+ representationName: RepresentationType$9,
560
+ mergeable: false
561
+ });
562
+ }
563
+ function evictSuccess(luvio, resourceParams) {
564
+ const key = keyBuilder$f(luvio, resourceParams);
565
+ luvio.storeEvict(key);
566
+ }
567
+ function createResourceRequest$a(config) {
568
+ const headers = {};
569
+ return {
570
+ baseUri: '/services/data/v63.0',
571
+ basePath: '/connect/slackbridge/team/' + config.urlParams.teamId + '/channel/' + config.urlParams.channelId + '/messages/' + config.urlParams.messageTs + '/reactions',
572
+ method: 'delete',
573
+ body: null,
574
+ urlParams: config.urlParams,
575
+ queryParams: config.queryParams,
576
+ headers,
577
+ priority: 'normal',
578
+ };
579
+ }
580
+
581
+ const adapterName$a = 'deleteSlackMessageReactions';
582
+ const deleteSlackMessageReactions_ConfigPropertyMetadata = [
583
+ generateParamConfigMetadata('channelId', true, 0 /* UrlParameter */, 0 /* String */),
584
+ generateParamConfigMetadata('messageTs', true, 0 /* UrlParameter */, 0 /* String */),
585
+ generateParamConfigMetadata('teamId', true, 0 /* UrlParameter */, 0 /* String */),
586
+ generateParamConfigMetadata('name', false, 1 /* QueryParameter */, 0 /* String */),
587
+ ];
588
+ const deleteSlackMessageReactions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$a, deleteSlackMessageReactions_ConfigPropertyMetadata);
589
+ const createResourceParams$a = /*#__PURE__*/ createResourceParams$c(deleteSlackMessageReactions_ConfigPropertyMetadata);
590
+ function typeCheckConfig$a(untrustedConfig) {
591
+ const config = {};
592
+ typeCheckConfig$c(untrustedConfig, config, deleteSlackMessageReactions_ConfigPropertyMetadata);
593
+ return config;
594
+ }
595
+ function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
596
+ if (!untrustedIsObject(untrustedConfig)) {
597
+ return null;
598
+ }
599
+ if (process.env.NODE_ENV !== 'production') {
600
+ validateConfig(untrustedConfig, configPropertyNames);
601
+ }
602
+ const config = typeCheckConfig$a(untrustedConfig);
603
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
604
+ return null;
605
+ }
606
+ return config;
607
+ }
608
+ function buildNetworkSnapshot$a(luvio, config, options) {
609
+ const resourceParams = createResourceParams$a(config);
610
+ const request = createResourceRequest$a(resourceParams);
611
+ return luvio.dispatchResourceRequest(request, options)
612
+ .then(() => {
613
+ return luvio.handleSuccessResponse(() => {
614
+ evictSuccess(luvio, resourceParams);
615
+ return luvio.storeBroadcast();
616
+ }, () => {
617
+ const cache = new StoreKeyMap();
618
+ getResponseCacheKeys$a(cache, luvio, resourceParams);
619
+ return cache;
620
+ });
621
+ }, (response) => {
622
+ deepFreeze(response);
623
+ throw response;
624
+ });
625
+ }
626
+ const deleteSlackMessageReactionsAdapterFactory = (luvio) => {
627
+ return function SlackBridgedeleteSlackMessageReactions(untrustedConfig) {
628
+ const config = validateAdapterConfig$a(untrustedConfig, deleteSlackMessageReactions_ConfigPropertyNames);
629
+ // Invalid or incomplete config
630
+ if (config === null) {
631
+ throw new Error(`Invalid config for "${adapterName$a}"`);
632
+ }
633
+ return buildNetworkSnapshot$a(luvio, config);
634
+ };
635
+ };
636
+
637
+ const VERSION$d = "f4f8dd4ae465a32e7bda2bd6dd6dca13";
638
+ function validate$d(obj, path = 'SlackBridgeConversationInfoOutputRepresentation') {
639
+ const v_error = (() => {
640
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
641
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
642
+ }
643
+ const obj_id = obj.id;
644
+ const path_id = path + '.id';
645
+ if (typeof obj_id !== 'string') {
646
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
647
+ }
648
+ const obj_isArchived = obj.isArchived;
649
+ const path_isArchived = path + '.isArchived';
650
+ if (typeof obj_isArchived !== 'boolean') {
651
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isArchived + '" (at "' + path_isArchived + '")');
652
+ }
653
+ const obj_isChannel = obj.isChannel;
654
+ const path_isChannel = path + '.isChannel';
655
+ if (typeof obj_isChannel !== 'boolean') {
656
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isChannel + '" (at "' + path_isChannel + '")');
657
+ }
658
+ const obj_isCustomEmojiSupported = obj.isCustomEmojiSupported;
659
+ const path_isCustomEmojiSupported = path + '.isCustomEmojiSupported';
660
+ let obj_isCustomEmojiSupported_union0 = null;
661
+ const obj_isCustomEmojiSupported_union0_error = (() => {
662
+ if (typeof obj_isCustomEmojiSupported !== 'boolean') {
663
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isCustomEmojiSupported + '" (at "' + path_isCustomEmojiSupported + '")');
664
+ }
665
+ })();
666
+ if (obj_isCustomEmojiSupported_union0_error != null) {
667
+ obj_isCustomEmojiSupported_union0 = obj_isCustomEmojiSupported_union0_error.message;
668
+ }
669
+ let obj_isCustomEmojiSupported_union1 = null;
670
+ const obj_isCustomEmojiSupported_union1_error = (() => {
671
+ if (obj_isCustomEmojiSupported !== null) {
672
+ return new TypeError('Expected "null" but received "' + typeof obj_isCustomEmojiSupported + '" (at "' + path_isCustomEmojiSupported + '")');
673
+ }
674
+ })();
675
+ if (obj_isCustomEmojiSupported_union1_error != null) {
676
+ obj_isCustomEmojiSupported_union1 = obj_isCustomEmojiSupported_union1_error.message;
677
+ }
678
+ if (obj_isCustomEmojiSupported_union0 && obj_isCustomEmojiSupported_union1) {
679
+ let message = 'Object doesn\'t match union (at "' + path_isCustomEmojiSupported + '")';
680
+ message += '\n' + obj_isCustomEmojiSupported_union0.split('\n').map((line) => '\t' + line).join('\n');
681
+ message += '\n' + obj_isCustomEmojiSupported_union1.split('\n').map((line) => '\t' + line).join('\n');
682
+ return new TypeError(message);
683
+ }
684
+ const obj_isGroup = obj.isGroup;
685
+ const path_isGroup = path + '.isGroup';
686
+ if (typeof obj_isGroup !== 'boolean') {
687
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isGroup + '" (at "' + path_isGroup + '")');
688
+ }
689
+ const obj_isIm = obj.isIm;
690
+ const path_isIm = path + '.isIm';
691
+ if (typeof obj_isIm !== 'boolean') {
692
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isIm + '" (at "' + path_isIm + '")');
693
+ }
694
+ const obj_isMember = obj.isMember;
695
+ const path_isMember = path + '.isMember';
696
+ if (typeof obj_isMember !== 'boolean') {
697
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isMember + '" (at "' + path_isMember + '")');
698
+ }
699
+ const obj_isOpen = obj.isOpen;
700
+ const path_isOpen = path + '.isOpen';
701
+ if (typeof obj_isOpen !== 'boolean') {
702
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isOpen + '" (at "' + path_isOpen + '")');
703
+ }
704
+ const obj_isPrivate = obj.isPrivate;
705
+ const path_isPrivate = path + '.isPrivate';
706
+ if (typeof obj_isPrivate !== 'boolean') {
707
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isPrivate + '" (at "' + path_isPrivate + '")');
708
+ }
709
+ const obj_isReadOnly = obj.isReadOnly;
710
+ const path_isReadOnly = path + '.isReadOnly';
711
+ if (typeof obj_isReadOnly !== 'boolean') {
712
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isReadOnly + '" (at "' + path_isReadOnly + '")');
713
+ }
714
+ const obj_isThreadOnly = obj.isThreadOnly;
715
+ const path_isThreadOnly = path + '.isThreadOnly';
716
+ if (typeof obj_isThreadOnly !== 'boolean') {
717
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isThreadOnly + '" (at "' + path_isThreadOnly + '")');
718
+ }
719
+ const obj_name = obj.name;
720
+ const path_name = path + '.name';
721
+ if (typeof obj_name !== 'string') {
722
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
723
+ }
724
+ const obj_numOfMembers = obj.numOfMembers;
725
+ const path_numOfMembers = path + '.numOfMembers';
726
+ let obj_numOfMembers_union0 = null;
727
+ const obj_numOfMembers_union0_error = (() => {
728
+ if (typeof obj_numOfMembers !== 'number' || (typeof obj_numOfMembers === 'number' && Math.floor(obj_numOfMembers) !== obj_numOfMembers)) {
729
+ return new TypeError('Expected "integer" but received "' + typeof obj_numOfMembers + '" (at "' + path_numOfMembers + '")');
730
+ }
731
+ })();
732
+ if (obj_numOfMembers_union0_error != null) {
733
+ obj_numOfMembers_union0 = obj_numOfMembers_union0_error.message;
734
+ }
735
+ let obj_numOfMembers_union1 = null;
736
+ const obj_numOfMembers_union1_error = (() => {
737
+ if (obj_numOfMembers !== null) {
738
+ return new TypeError('Expected "null" but received "' + typeof obj_numOfMembers + '" (at "' + path_numOfMembers + '")');
739
+ }
740
+ })();
741
+ if (obj_numOfMembers_union1_error != null) {
742
+ obj_numOfMembers_union1 = obj_numOfMembers_union1_error.message;
743
+ }
744
+ if (obj_numOfMembers_union0 && obj_numOfMembers_union1) {
745
+ let message = 'Object doesn\'t match union (at "' + path_numOfMembers + '")';
746
+ message += '\n' + obj_numOfMembers_union0.split('\n').map((line) => '\t' + line).join('\n');
747
+ message += '\n' + obj_numOfMembers_union1.split('\n').map((line) => '\t' + line).join('\n');
748
+ return new TypeError(message);
749
+ }
750
+ const obj_shouldCacheCustomEmoji = obj.shouldCacheCustomEmoji;
751
+ const path_shouldCacheCustomEmoji = path + '.shouldCacheCustomEmoji';
752
+ let obj_shouldCacheCustomEmoji_union0 = null;
753
+ const obj_shouldCacheCustomEmoji_union0_error = (() => {
754
+ if (typeof obj_shouldCacheCustomEmoji !== 'boolean') {
755
+ return new TypeError('Expected "boolean" but received "' + typeof obj_shouldCacheCustomEmoji + '" (at "' + path_shouldCacheCustomEmoji + '")');
756
+ }
757
+ })();
758
+ if (obj_shouldCacheCustomEmoji_union0_error != null) {
759
+ obj_shouldCacheCustomEmoji_union0 = obj_shouldCacheCustomEmoji_union0_error.message;
760
+ }
761
+ let obj_shouldCacheCustomEmoji_union1 = null;
762
+ const obj_shouldCacheCustomEmoji_union1_error = (() => {
763
+ if (obj_shouldCacheCustomEmoji !== null) {
764
+ return new TypeError('Expected "null" but received "' + typeof obj_shouldCacheCustomEmoji + '" (at "' + path_shouldCacheCustomEmoji + '")');
765
+ }
766
+ })();
767
+ if (obj_shouldCacheCustomEmoji_union1_error != null) {
768
+ obj_shouldCacheCustomEmoji_union1 = obj_shouldCacheCustomEmoji_union1_error.message;
769
+ }
770
+ if (obj_shouldCacheCustomEmoji_union0 && obj_shouldCacheCustomEmoji_union1) {
771
+ let message = 'Object doesn\'t match union (at "' + path_shouldCacheCustomEmoji + '")';
772
+ message += '\n' + obj_shouldCacheCustomEmoji_union0.split('\n').map((line) => '\t' + line).join('\n');
773
+ message += '\n' + obj_shouldCacheCustomEmoji_union1.split('\n').map((line) => '\t' + line).join('\n');
774
+ return new TypeError(message);
775
+ }
776
+ })();
777
+ return v_error === undefined ? null : v_error;
778
+ }
779
+ const select$n = function SlackBridgeConversationInfoOutputRepresentationSelect() {
780
+ return {
781
+ kind: 'Fragment',
782
+ version: VERSION$d,
783
+ private: [],
784
+ selections: [
785
+ {
786
+ name: 'id',
787
+ kind: 'Scalar'
788
+ },
789
+ {
790
+ name: 'isArchived',
791
+ kind: 'Scalar'
792
+ },
793
+ {
794
+ name: 'isChannel',
795
+ kind: 'Scalar'
796
+ },
797
+ {
798
+ name: 'isCustomEmojiSupported',
799
+ kind: 'Scalar'
800
+ },
801
+ {
802
+ name: 'isGroup',
803
+ kind: 'Scalar'
804
+ },
805
+ {
806
+ name: 'isIm',
807
+ kind: 'Scalar'
808
+ },
809
+ {
810
+ name: 'isMember',
811
+ kind: 'Scalar'
812
+ },
813
+ {
814
+ name: 'isOpen',
815
+ kind: 'Scalar'
816
+ },
817
+ {
818
+ name: 'isPrivate',
819
+ kind: 'Scalar'
820
+ },
821
+ {
822
+ name: 'isReadOnly',
823
+ kind: 'Scalar'
824
+ },
825
+ {
826
+ name: 'isThreadOnly',
827
+ kind: 'Scalar'
828
+ },
829
+ {
830
+ name: 'name',
831
+ kind: 'Scalar'
832
+ },
833
+ {
834
+ name: 'numOfMembers',
835
+ kind: 'Scalar'
836
+ },
837
+ {
838
+ name: 'shouldCacheCustomEmoji',
839
+ kind: 'Scalar'
840
+ }
841
+ ]
842
+ };
843
+ };
844
+ function equals$d(existing, incoming) {
845
+ const existing_isArchived = existing.isArchived;
846
+ const incoming_isArchived = incoming.isArchived;
847
+ if (!(existing_isArchived === incoming_isArchived)) {
848
+ return false;
849
+ }
850
+ const existing_isChannel = existing.isChannel;
851
+ const incoming_isChannel = incoming.isChannel;
852
+ if (!(existing_isChannel === incoming_isChannel)) {
853
+ return false;
854
+ }
855
+ const existing_isGroup = existing.isGroup;
856
+ const incoming_isGroup = incoming.isGroup;
857
+ if (!(existing_isGroup === incoming_isGroup)) {
858
+ return false;
859
+ }
860
+ const existing_isIm = existing.isIm;
861
+ const incoming_isIm = incoming.isIm;
862
+ if (!(existing_isIm === incoming_isIm)) {
863
+ return false;
864
+ }
865
+ const existing_isMember = existing.isMember;
866
+ const incoming_isMember = incoming.isMember;
867
+ if (!(existing_isMember === incoming_isMember)) {
868
+ return false;
869
+ }
870
+ const existing_isOpen = existing.isOpen;
871
+ const incoming_isOpen = incoming.isOpen;
872
+ if (!(existing_isOpen === incoming_isOpen)) {
873
+ return false;
874
+ }
875
+ const existing_isPrivate = existing.isPrivate;
876
+ const incoming_isPrivate = incoming.isPrivate;
877
+ if (!(existing_isPrivate === incoming_isPrivate)) {
878
+ return false;
879
+ }
880
+ const existing_isReadOnly = existing.isReadOnly;
881
+ const incoming_isReadOnly = incoming.isReadOnly;
882
+ if (!(existing_isReadOnly === incoming_isReadOnly)) {
883
+ return false;
884
+ }
885
+ const existing_isThreadOnly = existing.isThreadOnly;
886
+ const incoming_isThreadOnly = incoming.isThreadOnly;
887
+ if (!(existing_isThreadOnly === incoming_isThreadOnly)) {
888
+ return false;
889
+ }
890
+ const existing_id = existing.id;
891
+ const incoming_id = incoming.id;
892
+ if (!(existing_id === incoming_id)) {
893
+ return false;
894
+ }
895
+ const existing_name = existing.name;
896
+ const incoming_name = incoming.name;
897
+ if (!(existing_name === incoming_name)) {
898
+ return false;
899
+ }
900
+ const existing_isCustomEmojiSupported = existing.isCustomEmojiSupported;
901
+ const incoming_isCustomEmojiSupported = incoming.isCustomEmojiSupported;
902
+ if (!(existing_isCustomEmojiSupported === incoming_isCustomEmojiSupported)) {
903
+ return false;
904
+ }
905
+ const existing_numOfMembers = existing.numOfMembers;
906
+ const incoming_numOfMembers = incoming.numOfMembers;
907
+ if (!(existing_numOfMembers === incoming_numOfMembers)) {
908
+ return false;
909
+ }
910
+ const existing_shouldCacheCustomEmoji = existing.shouldCacheCustomEmoji;
911
+ const incoming_shouldCacheCustomEmoji = incoming.shouldCacheCustomEmoji;
912
+ if (!(existing_shouldCacheCustomEmoji === incoming_shouldCacheCustomEmoji)) {
913
+ return false;
914
+ }
915
+ return true;
916
+ }
917
+
918
+ const VERSION$c = "a398e130daf23612644f70d0705347e8";
919
+ function validate$c(obj, path = 'SlackBridgeEmojiOutputRepresentation') {
920
+ const v_error = (() => {
921
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
922
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
923
+ }
924
+ const obj_altText = obj.altText;
925
+ const path_altText = path + '.altText';
926
+ if (typeof obj_altText !== 'string') {
927
+ return new TypeError('Expected "string" but received "' + typeof obj_altText + '" (at "' + path_altText + '")');
928
+ }
929
+ const obj_isCustom = obj.isCustom;
930
+ const path_isCustom = path + '.isCustom';
931
+ let obj_isCustom_union0 = null;
932
+ const obj_isCustom_union0_error = (() => {
933
+ if (typeof obj_isCustom !== 'boolean') {
934
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isCustom + '" (at "' + path_isCustom + '")');
935
+ }
936
+ })();
937
+ if (obj_isCustom_union0_error != null) {
938
+ obj_isCustom_union0 = obj_isCustom_union0_error.message;
939
+ }
940
+ let obj_isCustom_union1 = null;
941
+ const obj_isCustom_union1_error = (() => {
942
+ if (obj_isCustom !== null) {
943
+ return new TypeError('Expected "null" but received "' + typeof obj_isCustom + '" (at "' + path_isCustom + '")');
944
+ }
945
+ })();
946
+ if (obj_isCustom_union1_error != null) {
947
+ obj_isCustom_union1 = obj_isCustom_union1_error.message;
948
+ }
949
+ if (obj_isCustom_union0 && obj_isCustom_union1) {
950
+ let message = 'Object doesn\'t match union (at "' + path_isCustom + '")';
951
+ message += '\n' + obj_isCustom_union0.split('\n').map((line) => '\t' + line).join('\n');
952
+ message += '\n' + obj_isCustom_union1.split('\n').map((line) => '\t' + line).join('\n');
953
+ return new TypeError(message);
954
+ }
955
+ const obj_name = obj.name;
956
+ const path_name = path + '.name';
957
+ if (typeof obj_name !== 'string') {
958
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
959
+ }
960
+ const obj_unicode = obj.unicode;
961
+ const path_unicode = path + '.unicode';
962
+ if (typeof obj_unicode !== 'string') {
963
+ return new TypeError('Expected "string" but received "' + typeof obj_unicode + '" (at "' + path_unicode + '")');
964
+ }
965
+ const obj_url = obj.url;
966
+ const path_url = path + '.url';
967
+ if (typeof obj_url !== 'string') {
968
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
969
+ }
970
+ })();
971
+ return v_error === undefined ? null : v_error;
972
+ }
973
+ const select$m = function SlackBridgeEmojiOutputRepresentationSelect() {
974
+ return {
975
+ kind: 'Fragment',
976
+ version: VERSION$c,
977
+ private: [],
978
+ selections: [
979
+ {
980
+ name: 'altText',
981
+ kind: 'Scalar'
982
+ },
983
+ {
984
+ name: 'isCustom',
985
+ kind: 'Scalar'
986
+ },
987
+ {
988
+ name: 'name',
989
+ kind: 'Scalar'
990
+ },
991
+ {
992
+ name: 'unicode',
993
+ kind: 'Scalar'
994
+ },
995
+ {
996
+ name: 'url',
997
+ kind: 'Scalar'
998
+ }
999
+ ]
1000
+ };
1001
+ };
1002
+ function equals$c(existing, incoming) {
1003
+ const existing_altText = existing.altText;
1004
+ const incoming_altText = incoming.altText;
1005
+ if (!(existing_altText === incoming_altText)) {
1006
+ return false;
1007
+ }
1008
+ const existing_name = existing.name;
1009
+ const incoming_name = incoming.name;
1010
+ if (!(existing_name === incoming_name)) {
1011
+ return false;
1012
+ }
1013
+ const existing_unicode = existing.unicode;
1014
+ const incoming_unicode = incoming.unicode;
1015
+ if (!(existing_unicode === incoming_unicode)) {
1016
+ return false;
1017
+ }
1018
+ const existing_url = existing.url;
1019
+ const incoming_url = incoming.url;
1020
+ if (!(existing_url === incoming_url)) {
1021
+ return false;
1022
+ }
1023
+ const existing_isCustom = existing.isCustom;
1024
+ const incoming_isCustom = incoming.isCustom;
1025
+ if (!(existing_isCustom === incoming_isCustom)) {
1026
+ return false;
1027
+ }
1028
+ return true;
1029
+ }
1030
+
1031
+ const TTL = 300000;
1032
+ const VERSION$b = "1c89c1c8379c0e55b8f94fecd03d8775";
1033
+ function validate$b(obj, path = 'SlackBridgeUserInfoOutputRepresentation') {
1034
+ const v_error = (() => {
1035
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1036
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1037
+ }
1038
+ const obj_bot = obj.bot;
1039
+ const path_bot = path + '.bot';
1040
+ if (typeof obj_bot !== 'boolean') {
1041
+ return new TypeError('Expected "boolean" but received "' + typeof obj_bot + '" (at "' + path_bot + '")');
1042
+ }
1043
+ const obj_displayName = obj.displayName;
1044
+ const path_displayName = path + '.displayName';
1045
+ if (typeof obj_displayName !== 'string') {
1046
+ return new TypeError('Expected "string" but received "' + typeof obj_displayName + '" (at "' + path_displayName + '")');
1047
+ }
1048
+ const obj_image24 = obj.image24;
1049
+ const path_image24 = path + '.image24';
1050
+ if (typeof obj_image24 !== 'string') {
1051
+ return new TypeError('Expected "string" but received "' + typeof obj_image24 + '" (at "' + path_image24 + '")');
1052
+ }
1053
+ const obj_imageOriginal = obj.imageOriginal;
1054
+ const path_imageOriginal = path + '.imageOriginal';
1055
+ let obj_imageOriginal_union0 = null;
1056
+ const obj_imageOriginal_union0_error = (() => {
1057
+ if (typeof obj_imageOriginal !== 'string') {
1058
+ return new TypeError('Expected "string" but received "' + typeof obj_imageOriginal + '" (at "' + path_imageOriginal + '")');
1059
+ }
1060
+ })();
1061
+ if (obj_imageOriginal_union0_error != null) {
1062
+ obj_imageOriginal_union0 = obj_imageOriginal_union0_error.message;
1063
+ }
1064
+ let obj_imageOriginal_union1 = null;
1065
+ const obj_imageOriginal_union1_error = (() => {
1066
+ if (obj_imageOriginal !== null) {
1067
+ return new TypeError('Expected "null" but received "' + typeof obj_imageOriginal + '" (at "' + path_imageOriginal + '")');
1068
+ }
1069
+ })();
1070
+ if (obj_imageOriginal_union1_error != null) {
1071
+ obj_imageOriginal_union1 = obj_imageOriginal_union1_error.message;
1072
+ }
1073
+ if (obj_imageOriginal_union0 && obj_imageOriginal_union1) {
1074
+ let message = 'Object doesn\'t match union (at "' + path_imageOriginal + '")';
1075
+ message += '\n' + obj_imageOriginal_union0.split('\n').map((line) => '\t' + line).join('\n');
1076
+ message += '\n' + obj_imageOriginal_union1.split('\n').map((line) => '\t' + line).join('\n');
1077
+ return new TypeError(message);
1078
+ }
1079
+ const obj_inHuddle = obj.inHuddle;
1080
+ const path_inHuddle = path + '.inHuddle';
1081
+ let obj_inHuddle_union0 = null;
1082
+ const obj_inHuddle_union0_error = (() => {
1083
+ if (typeof obj_inHuddle !== 'boolean') {
1084
+ return new TypeError('Expected "boolean" but received "' + typeof obj_inHuddle + '" (at "' + path_inHuddle + '")');
1085
+ }
1086
+ })();
1087
+ if (obj_inHuddle_union0_error != null) {
1088
+ obj_inHuddle_union0 = obj_inHuddle_union0_error.message;
1089
+ }
1090
+ let obj_inHuddle_union1 = null;
1091
+ const obj_inHuddle_union1_error = (() => {
1092
+ if (obj_inHuddle !== null) {
1093
+ return new TypeError('Expected "null" but received "' + typeof obj_inHuddle + '" (at "' + path_inHuddle + '")');
1094
+ }
1095
+ })();
1096
+ if (obj_inHuddle_union1_error != null) {
1097
+ obj_inHuddle_union1 = obj_inHuddle_union1_error.message;
1098
+ }
1099
+ if (obj_inHuddle_union0 && obj_inHuddle_union1) {
1100
+ let message = 'Object doesn\'t match union (at "' + path_inHuddle + '")';
1101
+ message += '\n' + obj_inHuddle_union0.split('\n').map((line) => '\t' + line).join('\n');
1102
+ message += '\n' + obj_inHuddle_union1.split('\n').map((line) => '\t' + line).join('\n');
1103
+ return new TypeError(message);
1104
+ }
1105
+ const obj_isActive = obj.isActive;
1106
+ const path_isActive = path + '.isActive';
1107
+ let obj_isActive_union0 = null;
1108
+ const obj_isActive_union0_error = (() => {
1109
+ if (typeof obj_isActive !== 'boolean') {
1110
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isActive + '" (at "' + path_isActive + '")');
1111
+ }
1112
+ })();
1113
+ if (obj_isActive_union0_error != null) {
1114
+ obj_isActive_union0 = obj_isActive_union0_error.message;
1115
+ }
1116
+ let obj_isActive_union1 = null;
1117
+ const obj_isActive_union1_error = (() => {
1118
+ if (obj_isActive !== null) {
1119
+ return new TypeError('Expected "null" but received "' + typeof obj_isActive + '" (at "' + path_isActive + '")');
1120
+ }
1121
+ })();
1122
+ if (obj_isActive_union1_error != null) {
1123
+ obj_isActive_union1 = obj_isActive_union1_error.message;
1124
+ }
1125
+ if (obj_isActive_union0 && obj_isActive_union1) {
1126
+ let message = 'Object doesn\'t match union (at "' + path_isActive + '")';
1127
+ message += '\n' + obj_isActive_union0.split('\n').map((line) => '\t' + line).join('\n');
1128
+ message += '\n' + obj_isActive_union1.split('\n').map((line) => '\t' + line).join('\n');
1129
+ return new TypeError(message);
1130
+ }
1131
+ const obj_isExternal = obj.isExternal;
1132
+ const path_isExternal = path + '.isExternal';
1133
+ let obj_isExternal_union0 = null;
1134
+ const obj_isExternal_union0_error = (() => {
1135
+ if (typeof obj_isExternal !== 'boolean') {
1136
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isExternal + '" (at "' + path_isExternal + '")');
1137
+ }
1138
+ })();
1139
+ if (obj_isExternal_union0_error != null) {
1140
+ obj_isExternal_union0 = obj_isExternal_union0_error.message;
1141
+ }
1142
+ let obj_isExternal_union1 = null;
1143
+ const obj_isExternal_union1_error = (() => {
1144
+ if (obj_isExternal !== null) {
1145
+ return new TypeError('Expected "null" but received "' + typeof obj_isExternal + '" (at "' + path_isExternal + '")');
1146
+ }
1147
+ })();
1148
+ if (obj_isExternal_union1_error != null) {
1149
+ obj_isExternal_union1 = obj_isExternal_union1_error.message;
1150
+ }
1151
+ if (obj_isExternal_union0 && obj_isExternal_union1) {
1152
+ let message = 'Object doesn\'t match union (at "' + path_isExternal + '")';
1153
+ message += '\n' + obj_isExternal_union0.split('\n').map((line) => '\t' + line).join('\n');
1154
+ message += '\n' + obj_isExternal_union1.split('\n').map((line) => '\t' + line).join('\n');
1155
+ return new TypeError(message);
1156
+ }
1157
+ const obj_name = obj.name;
1158
+ const path_name = path + '.name';
1159
+ if (typeof obj_name !== 'string') {
1160
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1161
+ }
1162
+ const obj_profileUrl = obj.profileUrl;
1163
+ const path_profileUrl = path + '.profileUrl';
1164
+ let obj_profileUrl_union0 = null;
1165
+ const obj_profileUrl_union0_error = (() => {
1166
+ if (typeof obj_profileUrl !== 'string') {
1167
+ return new TypeError('Expected "string" but received "' + typeof obj_profileUrl + '" (at "' + path_profileUrl + '")');
1168
+ }
1169
+ })();
1170
+ if (obj_profileUrl_union0_error != null) {
1171
+ obj_profileUrl_union0 = obj_profileUrl_union0_error.message;
1172
+ }
1173
+ let obj_profileUrl_union1 = null;
1174
+ const obj_profileUrl_union1_error = (() => {
1175
+ if (obj_profileUrl !== null) {
1176
+ return new TypeError('Expected "null" but received "' + typeof obj_profileUrl + '" (at "' + path_profileUrl + '")');
1177
+ }
1178
+ })();
1179
+ if (obj_profileUrl_union1_error != null) {
1180
+ obj_profileUrl_union1 = obj_profileUrl_union1_error.message;
1181
+ }
1182
+ if (obj_profileUrl_union0 && obj_profileUrl_union1) {
1183
+ let message = 'Object doesn\'t match union (at "' + path_profileUrl + '")';
1184
+ message += '\n' + obj_profileUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
1185
+ message += '\n' + obj_profileUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
1186
+ return new TypeError(message);
1187
+ }
1188
+ const obj_realName = obj.realName;
1189
+ const path_realName = path + '.realName';
1190
+ if (typeof obj_realName !== 'string') {
1191
+ return new TypeError('Expected "string" but received "' + typeof obj_realName + '" (at "' + path_realName + '")');
1192
+ }
1193
+ const obj_salesforceUserId = obj.salesforceUserId;
1194
+ const path_salesforceUserId = path + '.salesforceUserId';
1195
+ let obj_salesforceUserId_union0 = null;
1196
+ const obj_salesforceUserId_union0_error = (() => {
1197
+ if (typeof obj_salesforceUserId !== 'string') {
1198
+ return new TypeError('Expected "string" but received "' + typeof obj_salesforceUserId + '" (at "' + path_salesforceUserId + '")');
1199
+ }
1200
+ })();
1201
+ if (obj_salesforceUserId_union0_error != null) {
1202
+ obj_salesforceUserId_union0 = obj_salesforceUserId_union0_error.message;
1203
+ }
1204
+ let obj_salesforceUserId_union1 = null;
1205
+ const obj_salesforceUserId_union1_error = (() => {
1206
+ if (obj_salesforceUserId !== null) {
1207
+ return new TypeError('Expected "null" but received "' + typeof obj_salesforceUserId + '" (at "' + path_salesforceUserId + '")');
1208
+ }
1209
+ })();
1210
+ if (obj_salesforceUserId_union1_error != null) {
1211
+ obj_salesforceUserId_union1 = obj_salesforceUserId_union1_error.message;
1212
+ }
1213
+ if (obj_salesforceUserId_union0 && obj_salesforceUserId_union1) {
1214
+ let message = 'Object doesn\'t match union (at "' + path_salesforceUserId + '")';
1215
+ message += '\n' + obj_salesforceUserId_union0.split('\n').map((line) => '\t' + line).join('\n');
1216
+ message += '\n' + obj_salesforceUserId_union1.split('\n').map((line) => '\t' + line).join('\n');
1217
+ return new TypeError(message);
1218
+ }
1219
+ const obj_slackUserId = obj.slackUserId;
1220
+ const path_slackUserId = path + '.slackUserId';
1221
+ if (typeof obj_slackUserId !== 'string') {
1222
+ return new TypeError('Expected "string" but received "' + typeof obj_slackUserId + '" (at "' + path_slackUserId + '")');
1223
+ }
1224
+ const obj_statusEmoji = obj.statusEmoji;
1225
+ const path_statusEmoji = path + '.statusEmoji';
1226
+ let obj_statusEmoji_union0 = null;
1227
+ const obj_statusEmoji_union0_error = (() => {
1228
+ const referencepath_statusEmojiValidationError = validate$c(obj_statusEmoji, path_statusEmoji);
1229
+ if (referencepath_statusEmojiValidationError !== null) {
1230
+ let message = 'Object doesn\'t match SlackBridgeEmojiOutputRepresentation (at "' + path_statusEmoji + '")\n';
1231
+ message += referencepath_statusEmojiValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1232
+ return new TypeError(message);
1233
+ }
1234
+ })();
1235
+ if (obj_statusEmoji_union0_error != null) {
1236
+ obj_statusEmoji_union0 = obj_statusEmoji_union0_error.message;
1237
+ }
1238
+ let obj_statusEmoji_union1 = null;
1239
+ const obj_statusEmoji_union1_error = (() => {
1240
+ if (obj_statusEmoji !== null) {
1241
+ return new TypeError('Expected "null" but received "' + typeof obj_statusEmoji + '" (at "' + path_statusEmoji + '")');
1242
+ }
1243
+ })();
1244
+ if (obj_statusEmoji_union1_error != null) {
1245
+ obj_statusEmoji_union1 = obj_statusEmoji_union1_error.message;
1246
+ }
1247
+ if (obj_statusEmoji_union0 && obj_statusEmoji_union1) {
1248
+ let message = 'Object doesn\'t match union (at "' + path_statusEmoji + '")';
1249
+ message += '\n' + obj_statusEmoji_union0.split('\n').map((line) => '\t' + line).join('\n');
1250
+ message += '\n' + obj_statusEmoji_union1.split('\n').map((line) => '\t' + line).join('\n');
1251
+ return new TypeError(message);
1252
+ }
1253
+ const obj_statusMessage = obj.statusMessage;
1254
+ const path_statusMessage = path + '.statusMessage';
1255
+ if (typeof obj_statusMessage !== 'string') {
1256
+ return new TypeError('Expected "string" but received "' + typeof obj_statusMessage + '" (at "' + path_statusMessage + '")');
1257
+ }
1258
+ const obj_teamId = obj.teamId;
1259
+ const path_teamId = path + '.teamId';
1260
+ if (typeof obj_teamId !== 'string') {
1261
+ return new TypeError('Expected "string" but received "' + typeof obj_teamId + '" (at "' + path_teamId + '")');
1262
+ }
1263
+ })();
1264
+ return v_error === undefined ? null : v_error;
1265
+ }
1266
+ const RepresentationType$8 = 'SlackBridgeUserInfoOutputRepresentation';
1267
+ function keyBuilder$e(luvio, config) {
1268
+ return keyPrefix + '::' + RepresentationType$8 + ':' + config.teamId + ':' + config.slackUserId;
1269
+ }
1270
+ function keyBuilderFromType$2(luvio, object) {
1271
+ const keyParams = {
1272
+ teamId: object.teamId,
1273
+ slackUserId: object.slackUserId
1274
+ };
1275
+ return keyBuilder$e(luvio, keyParams);
1276
+ }
1277
+ function normalize$8(input, existing, path, luvio, store, timestamp) {
1278
+ return input;
1279
+ }
1280
+ const select$l = function SlackBridgeUserInfoOutputRepresentationSelect() {
1281
+ const { selections: SlackBridgeEmojiOutputRepresentation__selections, opaque: SlackBridgeEmojiOutputRepresentation__opaque, } = select$m();
1282
+ return {
1283
+ kind: 'Fragment',
1284
+ version: VERSION$b,
1285
+ private: [],
1286
+ selections: [
1287
+ {
1288
+ name: 'bot',
1289
+ kind: 'Scalar'
1290
+ },
1291
+ {
1292
+ name: 'displayName',
1293
+ kind: 'Scalar'
1294
+ },
1295
+ {
1296
+ name: 'image24',
1297
+ kind: 'Scalar'
1298
+ },
1299
+ {
1300
+ name: 'imageOriginal',
1301
+ kind: 'Scalar'
1302
+ },
1303
+ {
1304
+ name: 'inHuddle',
1305
+ kind: 'Scalar'
1306
+ },
1307
+ {
1308
+ name: 'isActive',
1309
+ kind: 'Scalar'
1310
+ },
1311
+ {
1312
+ name: 'isExternal',
1313
+ kind: 'Scalar'
1314
+ },
1315
+ {
1316
+ name: 'name',
1317
+ kind: 'Scalar'
1318
+ },
1319
+ {
1320
+ name: 'profileUrl',
1321
+ kind: 'Scalar'
1322
+ },
1323
+ {
1324
+ name: 'realName',
1325
+ kind: 'Scalar'
1326
+ },
1327
+ {
1328
+ name: 'salesforceUserId',
1329
+ kind: 'Scalar'
1330
+ },
1331
+ {
1332
+ name: 'slackUserId',
1333
+ kind: 'Scalar'
1334
+ },
1335
+ {
1336
+ name: 'statusEmoji',
1337
+ kind: 'Object',
1338
+ nullable: true,
1339
+ selections: SlackBridgeEmojiOutputRepresentation__selections
1340
+ },
1341
+ {
1342
+ name: 'statusMessage',
1343
+ kind: 'Scalar'
1344
+ },
1345
+ {
1346
+ name: 'teamId',
1347
+ kind: 'Scalar'
1348
+ }
1349
+ ]
1350
+ };
1351
+ };
1352
+ function equals$b(existing, incoming) {
1353
+ const existing_bot = existing.bot;
1354
+ const incoming_bot = incoming.bot;
1355
+ if (!(existing_bot === incoming_bot)) {
1356
+ return false;
1357
+ }
1358
+ const existing_displayName = existing.displayName;
1359
+ const incoming_displayName = incoming.displayName;
1360
+ if (!(existing_displayName === incoming_displayName)) {
1361
+ return false;
1362
+ }
1363
+ const existing_image24 = existing.image24;
1364
+ const incoming_image24 = incoming.image24;
1365
+ if (!(existing_image24 === incoming_image24)) {
1366
+ return false;
1367
+ }
1368
+ const existing_name = existing.name;
1369
+ const incoming_name = incoming.name;
1370
+ if (!(existing_name === incoming_name)) {
1371
+ return false;
1372
+ }
1373
+ const existing_realName = existing.realName;
1374
+ const incoming_realName = incoming.realName;
1375
+ if (!(existing_realName === incoming_realName)) {
1376
+ return false;
1377
+ }
1378
+ const existing_slackUserId = existing.slackUserId;
1379
+ const incoming_slackUserId = incoming.slackUserId;
1380
+ if (!(existing_slackUserId === incoming_slackUserId)) {
1381
+ return false;
1382
+ }
1383
+ const existing_statusMessage = existing.statusMessage;
1384
+ const incoming_statusMessage = incoming.statusMessage;
1385
+ if (!(existing_statusMessage === incoming_statusMessage)) {
1386
+ return false;
1387
+ }
1388
+ const existing_teamId = existing.teamId;
1389
+ const incoming_teamId = incoming.teamId;
1390
+ if (!(existing_teamId === incoming_teamId)) {
1391
+ return false;
1392
+ }
1393
+ const existing_imageOriginal = existing.imageOriginal;
1394
+ const incoming_imageOriginal = incoming.imageOriginal;
1395
+ if (!(existing_imageOriginal === incoming_imageOriginal)) {
1396
+ return false;
1397
+ }
1398
+ const existing_inHuddle = existing.inHuddle;
1399
+ const incoming_inHuddle = incoming.inHuddle;
1400
+ if (!(existing_inHuddle === incoming_inHuddle)) {
1401
+ return false;
1402
+ }
1403
+ const existing_isActive = existing.isActive;
1404
+ const incoming_isActive = incoming.isActive;
1405
+ if (!(existing_isActive === incoming_isActive)) {
1406
+ return false;
1407
+ }
1408
+ const existing_isExternal = existing.isExternal;
1409
+ const incoming_isExternal = incoming.isExternal;
1410
+ if (!(existing_isExternal === incoming_isExternal)) {
1411
+ return false;
1412
+ }
1413
+ const existing_profileUrl = existing.profileUrl;
1414
+ const incoming_profileUrl = incoming.profileUrl;
1415
+ if (!(existing_profileUrl === incoming_profileUrl)) {
1416
+ return false;
1417
+ }
1418
+ const existing_salesforceUserId = existing.salesforceUserId;
1419
+ const incoming_salesforceUserId = incoming.salesforceUserId;
1420
+ if (!(existing_salesforceUserId === incoming_salesforceUserId)) {
1421
+ return false;
1422
+ }
1423
+ const existing_statusEmoji = existing.statusEmoji;
1424
+ const incoming_statusEmoji = incoming.statusEmoji;
1425
+ if (!(existing_statusEmoji === incoming_statusEmoji
1426
+ || (existing_statusEmoji != null &&
1427
+ incoming_statusEmoji != null &&
1428
+ equals$c(existing_statusEmoji, incoming_statusEmoji)))) {
1429
+ return false;
1430
+ }
1431
+ return true;
1432
+ }
1433
+ const ingest$8 = function SlackBridgeUserInfoOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1434
+ if (process.env.NODE_ENV !== 'production') {
1435
+ const validateError = validate$b(input);
1436
+ if (validateError !== null) {
1437
+ throw validateError;
1438
+ }
1439
+ }
1440
+ const key = keyBuilderFromType$2(luvio, input);
1441
+ const ttlToUse = TTL;
1442
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$8, "SlackBridge", VERSION$b, RepresentationType$8, equals$b);
1443
+ return createLink(key);
1444
+ };
1445
+ function getTypeCacheKeys$8(rootKeySet, luvio, input, fullPathFactory) {
1446
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1447
+ const rootKey = keyBuilderFromType$2(luvio, input);
1448
+ rootKeySet.set(rootKey, {
1449
+ namespace: keyPrefix,
1450
+ representationName: RepresentationType$8,
1451
+ mergeable: false
1452
+ });
1453
+ }
1454
+
1455
+ const VERSION$a = "4634cd404d8392ac4ca9f0e1be03bfbd";
1456
+ function validate$a(obj, path = 'SlackBridgeFileTypeOutputRepresentation') {
1457
+ const v_error = (() => {
1458
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1459
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1460
+ }
1461
+ const obj_extension = obj.extension;
1462
+ const path_extension = path + '.extension';
1463
+ if (typeof obj_extension !== 'string') {
1464
+ return new TypeError('Expected "string" but received "' + typeof obj_extension + '" (at "' + path_extension + '")');
1465
+ }
1466
+ const obj_iconName = obj.iconName;
1467
+ const path_iconName = path + '.iconName';
1468
+ if (typeof obj_iconName !== 'string') {
1469
+ return new TypeError('Expected "string" but received "' + typeof obj_iconName + '" (at "' + path_iconName + '")');
1470
+ }
1471
+ })();
1472
+ return v_error === undefined ? null : v_error;
1473
+ }
1474
+ const select$k = function SlackBridgeFileTypeOutputRepresentationSelect() {
1475
+ return {
1476
+ kind: 'Fragment',
1477
+ version: VERSION$a,
1478
+ private: [],
1479
+ selections: [
1480
+ {
1481
+ name: 'extension',
1482
+ kind: 'Scalar'
1483
+ },
1484
+ {
1485
+ name: 'iconName',
1486
+ kind: 'Scalar'
1487
+ }
1488
+ ]
1489
+ };
1490
+ };
1491
+ function equals$a(existing, incoming) {
1492
+ const existing_extension = existing.extension;
1493
+ const incoming_extension = incoming.extension;
1494
+ if (!(existing_extension === incoming_extension)) {
1495
+ return false;
1496
+ }
1497
+ const existing_iconName = existing.iconName;
1498
+ const incoming_iconName = incoming.iconName;
1499
+ if (!(existing_iconName === incoming_iconName)) {
1500
+ return false;
1501
+ }
1502
+ return true;
1503
+ }
1504
+
1505
+ const VERSION$9 = "929dbada9eaca4bca26deee89f9d11b2";
1506
+ function validate$9(obj, path = 'SlackBridgeContentVersionOutputRepresentation') {
1507
+ const v_error = (() => {
1508
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1509
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1510
+ }
1511
+ const obj_attachmentUrl = obj.attachmentUrl;
1512
+ const path_attachmentUrl = path + '.attachmentUrl';
1513
+ if (typeof obj_attachmentUrl !== 'string') {
1514
+ return new TypeError('Expected "string" but received "' + typeof obj_attachmentUrl + '" (at "' + path_attachmentUrl + '")');
1515
+ }
1516
+ const obj_filetype = obj.filetype;
1517
+ const path_filetype = path + '.filetype';
1518
+ const referencepath_filetypeValidationError = validate$a(obj_filetype, path_filetype);
1519
+ if (referencepath_filetypeValidationError !== null) {
1520
+ let message = 'Object doesn\'t match SlackBridgeFileTypeOutputRepresentation (at "' + path_filetype + '")\n';
1521
+ message += referencepath_filetypeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1522
+ return new TypeError(message);
1523
+ }
1524
+ const obj_id = obj.id;
1525
+ const path_id = path + '.id';
1526
+ if (typeof obj_id !== 'string') {
1527
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1528
+ }
1529
+ const obj_size = obj.size;
1530
+ const path_size = path + '.size';
1531
+ if (typeof obj_size !== 'number' || (typeof obj_size === 'number' && Math.floor(obj_size) !== obj_size)) {
1532
+ return new TypeError('Expected "integer" but received "' + typeof obj_size + '" (at "' + path_size + '")');
1533
+ }
1534
+ const obj_title = obj.title;
1535
+ const path_title = path + '.title';
1536
+ if (typeof obj_title !== 'string') {
1537
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1538
+ }
1539
+ const obj_versionUrl = obj.versionUrl;
1540
+ const path_versionUrl = path + '.versionUrl';
1541
+ if (typeof obj_versionUrl !== 'string') {
1542
+ return new TypeError('Expected "string" but received "' + typeof obj_versionUrl + '" (at "' + path_versionUrl + '")');
1543
+ }
1544
+ })();
1545
+ return v_error === undefined ? null : v_error;
1546
+ }
1547
+ const select$j = function SlackBridgeContentVersionOutputRepresentationSelect() {
1548
+ const { selections: SlackBridgeFileTypeOutputRepresentation__selections, opaque: SlackBridgeFileTypeOutputRepresentation__opaque, } = select$k();
1549
+ return {
1550
+ kind: 'Fragment',
1551
+ version: VERSION$9,
1552
+ private: [],
1553
+ selections: [
1554
+ {
1555
+ name: 'attachmentUrl',
1556
+ kind: 'Scalar'
1557
+ },
1558
+ {
1559
+ name: 'filetype',
1560
+ kind: 'Object',
1561
+ selections: SlackBridgeFileTypeOutputRepresentation__selections
1562
+ },
1563
+ {
1564
+ name: 'id',
1565
+ kind: 'Scalar'
1566
+ },
1567
+ {
1568
+ name: 'size',
1569
+ kind: 'Scalar'
1570
+ },
1571
+ {
1572
+ name: 'title',
1573
+ kind: 'Scalar'
1574
+ },
1575
+ {
1576
+ name: 'versionUrl',
1577
+ kind: 'Scalar'
1578
+ }
1579
+ ]
1580
+ };
1581
+ };
1582
+ function equals$9(existing, incoming) {
1583
+ const existing_size = existing.size;
1584
+ const incoming_size = incoming.size;
1585
+ if (!(existing_size === incoming_size)) {
1586
+ return false;
1587
+ }
1588
+ const existing_attachmentUrl = existing.attachmentUrl;
1589
+ const incoming_attachmentUrl = incoming.attachmentUrl;
1590
+ if (!(existing_attachmentUrl === incoming_attachmentUrl)) {
1591
+ return false;
1592
+ }
1593
+ const existing_id = existing.id;
1594
+ const incoming_id = incoming.id;
1595
+ if (!(existing_id === incoming_id)) {
1596
+ return false;
1597
+ }
1598
+ const existing_title = existing.title;
1599
+ const incoming_title = incoming.title;
1600
+ if (!(existing_title === incoming_title)) {
1601
+ return false;
1602
+ }
1603
+ const existing_versionUrl = existing.versionUrl;
1604
+ const incoming_versionUrl = incoming.versionUrl;
1605
+ if (!(existing_versionUrl === incoming_versionUrl)) {
1606
+ return false;
1607
+ }
1608
+ const existing_filetype = existing.filetype;
1609
+ const incoming_filetype = incoming.filetype;
1610
+ if (!(equals$a(existing_filetype, incoming_filetype))) {
1611
+ return false;
1612
+ }
1613
+ return true;
1614
+ }
1615
+
1616
+ const VERSION$8 = "effdd259bc622bee05493fc2a3ecd276";
1617
+ function validate$8(obj, path = 'SlackBridgeContentDocumentOutputRepresentation') {
1618
+ const v_error = (() => {
1619
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1620
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1621
+ }
1622
+ const obj_filetype = obj.filetype;
1623
+ const path_filetype = path + '.filetype';
1624
+ const referencepath_filetypeValidationError = validate$a(obj_filetype, path_filetype);
1625
+ if (referencepath_filetypeValidationError !== null) {
1626
+ let message = 'Object doesn\'t match SlackBridgeFileTypeOutputRepresentation (at "' + path_filetype + '")\n';
1627
+ message += referencepath_filetypeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1628
+ return new TypeError(message);
1629
+ }
1630
+ const obj_id = obj.id;
1631
+ const path_id = path + '.id';
1632
+ if (typeof obj_id !== 'string') {
1633
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1634
+ }
1635
+ const obj_latestPublishedVersion = obj.latestPublishedVersion;
1636
+ const path_latestPublishedVersion = path + '.latestPublishedVersion';
1637
+ const referencepath_latestPublishedVersionValidationError = validate$9(obj_latestPublishedVersion, path_latestPublishedVersion);
1638
+ if (referencepath_latestPublishedVersionValidationError !== null) {
1639
+ let message = 'Object doesn\'t match SlackBridgeContentVersionOutputRepresentation (at "' + path_latestPublishedVersion + '")\n';
1640
+ message += referencepath_latestPublishedVersionValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1641
+ return new TypeError(message);
1642
+ }
1643
+ const obj_size = obj.size;
1644
+ const path_size = path + '.size';
1645
+ if (typeof obj_size !== 'number' || (typeof obj_size === 'number' && Math.floor(obj_size) !== obj_size)) {
1646
+ return new TypeError('Expected "integer" but received "' + typeof obj_size + '" (at "' + path_size + '")');
1647
+ }
1648
+ const obj_title = obj.title;
1649
+ const path_title = path + '.title';
1650
+ if (typeof obj_title !== 'string') {
1651
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1652
+ }
1653
+ })();
1654
+ return v_error === undefined ? null : v_error;
1655
+ }
1656
+ const select$i = function SlackBridgeContentDocumentOutputRepresentationSelect() {
1657
+ const { selections: SlackBridgeFileTypeOutputRepresentation__selections, opaque: SlackBridgeFileTypeOutputRepresentation__opaque, } = select$k();
1658
+ const { selections: SlackBridgeContentVersionOutputRepresentation__selections, opaque: SlackBridgeContentVersionOutputRepresentation__opaque, } = select$j();
1659
+ return {
1660
+ kind: 'Fragment',
1661
+ version: VERSION$8,
1662
+ private: [],
1663
+ selections: [
1664
+ {
1665
+ name: 'filetype',
1666
+ kind: 'Object',
1667
+ selections: SlackBridgeFileTypeOutputRepresentation__selections
1668
+ },
1669
+ {
1670
+ name: 'id',
1671
+ kind: 'Scalar'
1672
+ },
1673
+ {
1674
+ name: 'latestPublishedVersion',
1675
+ kind: 'Object',
1676
+ selections: SlackBridgeContentVersionOutputRepresentation__selections
1677
+ },
1678
+ {
1679
+ name: 'size',
1680
+ kind: 'Scalar'
1681
+ },
1682
+ {
1683
+ name: 'title',
1684
+ kind: 'Scalar'
1685
+ }
1686
+ ]
1687
+ };
1688
+ };
1689
+ function equals$8(existing, incoming) {
1690
+ const existing_size = existing.size;
1691
+ const incoming_size = incoming.size;
1692
+ if (!(existing_size === incoming_size)) {
1693
+ return false;
1694
+ }
1695
+ const existing_id = existing.id;
1696
+ const incoming_id = incoming.id;
1697
+ if (!(existing_id === incoming_id)) {
1698
+ return false;
1699
+ }
1700
+ const existing_title = existing.title;
1701
+ const incoming_title = incoming.title;
1702
+ if (!(existing_title === incoming_title)) {
1703
+ return false;
1704
+ }
1705
+ const existing_filetype = existing.filetype;
1706
+ const incoming_filetype = incoming.filetype;
1707
+ if (!(equals$a(existing_filetype, incoming_filetype))) {
1708
+ return false;
1709
+ }
1710
+ const existing_latestPublishedVersion = existing.latestPublishedVersion;
1711
+ const incoming_latestPublishedVersion = incoming.latestPublishedVersion;
1712
+ if (!(equals$9(existing_latestPublishedVersion, incoming_latestPublishedVersion))) {
1713
+ return false;
1714
+ }
1715
+ return true;
1716
+ }
1717
+
1718
+ const VERSION$7 = "3f1a7f34ee73f6a8d9677314d88bad78";
1719
+ function validate$7(obj, path = 'SlackBridgeFileOutputRepresentation') {
1720
+ const v_error = (() => {
1721
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1722
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1723
+ }
1724
+ const obj_contentDocument = obj.contentDocument;
1725
+ const path_contentDocument = path + '.contentDocument';
1726
+ const referencepath_contentDocumentValidationError = validate$8(obj_contentDocument, path_contentDocument);
1727
+ if (referencepath_contentDocumentValidationError !== null) {
1728
+ let message = 'Object doesn\'t match SlackBridgeContentDocumentOutputRepresentation (at "' + path_contentDocument + '")\n';
1729
+ message += referencepath_contentDocumentValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1730
+ return new TypeError(message);
1731
+ }
1732
+ const obj_filetype = obj.filetype;
1733
+ const path_filetype = path + '.filetype';
1734
+ if (typeof obj_filetype !== 'string') {
1735
+ return new TypeError('Expected "string" but received "' + typeof obj_filetype + '" (at "' + path_filetype + '")');
1736
+ }
1737
+ const obj_id = obj.id;
1738
+ const path_id = path + '.id';
1739
+ if (typeof obj_id !== 'string') {
1740
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1741
+ }
1742
+ const obj_mimetype = obj.mimetype;
1743
+ const path_mimetype = path + '.mimetype';
1744
+ if (typeof obj_mimetype !== 'string') {
1745
+ return new TypeError('Expected "string" but received "' + typeof obj_mimetype + '" (at "' + path_mimetype + '")');
1746
+ }
1747
+ const obj_name = obj.name;
1748
+ const path_name = path + '.name';
1749
+ if (typeof obj_name !== 'string') {
1750
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1751
+ }
1752
+ const obj_size = obj.size;
1753
+ const path_size = path + '.size';
1754
+ if (typeof obj_size !== 'number' || (typeof obj_size === 'number' && Math.floor(obj_size) !== obj_size)) {
1755
+ return new TypeError('Expected "integer" but received "' + typeof obj_size + '" (at "' + path_size + '")');
1756
+ }
1757
+ const obj_slackPermalink = obj.slackPermalink;
1758
+ const path_slackPermalink = path + '.slackPermalink';
1759
+ if (typeof obj_slackPermalink !== 'string') {
1760
+ return new TypeError('Expected "string" but received "' + typeof obj_slackPermalink + '" (at "' + path_slackPermalink + '")');
1761
+ }
1762
+ const obj_title = obj.title;
1763
+ const path_title = path + '.title';
1764
+ if (typeof obj_title !== 'string') {
1765
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1766
+ }
1767
+ const obj_token = obj.token;
1768
+ const path_token = path + '.token';
1769
+ if (typeof obj_token !== 'string') {
1770
+ return new TypeError('Expected "string" but received "' + typeof obj_token + '" (at "' + path_token + '")');
1771
+ }
1772
+ const obj_uniqueKey = obj.uniqueKey;
1773
+ const path_uniqueKey = path + '.uniqueKey';
1774
+ if (typeof obj_uniqueKey !== 'string') {
1775
+ return new TypeError('Expected "string" but received "' + typeof obj_uniqueKey + '" (at "' + path_uniqueKey + '")');
1776
+ }
1777
+ const obj_url = obj.url;
1778
+ const path_url = path + '.url';
1779
+ if (typeof obj_url !== 'string') {
1780
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
1781
+ }
1782
+ })();
1783
+ return v_error === undefined ? null : v_error;
1784
+ }
1785
+ const RepresentationType$7 = 'SlackBridgeFileOutputRepresentation';
1786
+ function keyBuilder$d(luvio, config) {
1787
+ return keyPrefix + '::' + RepresentationType$7 + ':' + config.uniqueKey;
1788
+ }
1789
+ function keyBuilderFromType$1(luvio, object) {
1790
+ const keyParams = {
1791
+ uniqueKey: object.uniqueKey
1792
+ };
1793
+ return keyBuilder$d(luvio, keyParams);
1794
+ }
1795
+ function normalize$7(input, existing, path, luvio, store, timestamp) {
1796
+ return input;
1797
+ }
1798
+ const select$h = function SlackBridgeFileOutputRepresentationSelect() {
1799
+ const { selections: SlackBridgeContentDocumentOutputRepresentation__selections, opaque: SlackBridgeContentDocumentOutputRepresentation__opaque, } = select$i();
1800
+ return {
1801
+ kind: 'Fragment',
1802
+ version: VERSION$7,
1803
+ private: [],
1804
+ selections: [
1805
+ {
1806
+ name: 'contentDocument',
1807
+ kind: 'Object',
1808
+ selections: SlackBridgeContentDocumentOutputRepresentation__selections
1809
+ },
1810
+ {
1811
+ name: 'filetype',
1812
+ kind: 'Scalar'
1813
+ },
1814
+ {
1815
+ name: 'id',
1816
+ kind: 'Scalar'
1817
+ },
1818
+ {
1819
+ name: 'mimetype',
1820
+ kind: 'Scalar'
1821
+ },
1822
+ {
1823
+ name: 'name',
1824
+ kind: 'Scalar'
1825
+ },
1826
+ {
1827
+ name: 'size',
1828
+ kind: 'Scalar'
1829
+ },
1830
+ {
1831
+ name: 'slackPermalink',
1832
+ kind: 'Scalar'
1833
+ },
1834
+ {
1835
+ name: 'title',
1836
+ kind: 'Scalar'
1837
+ },
1838
+ {
1839
+ name: 'token',
1840
+ kind: 'Scalar'
1841
+ },
1842
+ {
1843
+ name: 'uniqueKey',
1844
+ kind: 'Scalar'
1845
+ },
1846
+ {
1847
+ name: 'url',
1848
+ kind: 'Scalar'
1849
+ }
1850
+ ]
1851
+ };
1852
+ };
1853
+ function equals$7(existing, incoming) {
1854
+ const existing_size = existing.size;
1855
+ const incoming_size = incoming.size;
1856
+ if (!(existing_size === incoming_size)) {
1857
+ return false;
1858
+ }
1859
+ const existing_filetype = existing.filetype;
1860
+ const incoming_filetype = incoming.filetype;
1861
+ if (!(existing_filetype === incoming_filetype)) {
1862
+ return false;
1863
+ }
1864
+ const existing_id = existing.id;
1865
+ const incoming_id = incoming.id;
1866
+ if (!(existing_id === incoming_id)) {
1867
+ return false;
1868
+ }
1869
+ const existing_mimetype = existing.mimetype;
1870
+ const incoming_mimetype = incoming.mimetype;
1871
+ if (!(existing_mimetype === incoming_mimetype)) {
1872
+ return false;
1873
+ }
1874
+ const existing_name = existing.name;
1875
+ const incoming_name = incoming.name;
1876
+ if (!(existing_name === incoming_name)) {
1877
+ return false;
1878
+ }
1879
+ const existing_slackPermalink = existing.slackPermalink;
1880
+ const incoming_slackPermalink = incoming.slackPermalink;
1881
+ if (!(existing_slackPermalink === incoming_slackPermalink)) {
1882
+ return false;
1883
+ }
1884
+ const existing_title = existing.title;
1885
+ const incoming_title = incoming.title;
1886
+ if (!(existing_title === incoming_title)) {
1887
+ return false;
1888
+ }
1889
+ const existing_token = existing.token;
1890
+ const incoming_token = incoming.token;
1891
+ if (!(existing_token === incoming_token)) {
1892
+ return false;
1893
+ }
1894
+ const existing_uniqueKey = existing.uniqueKey;
1895
+ const incoming_uniqueKey = incoming.uniqueKey;
1896
+ if (!(existing_uniqueKey === incoming_uniqueKey)) {
1897
+ return false;
1898
+ }
1899
+ const existing_url = existing.url;
1900
+ const incoming_url = incoming.url;
1901
+ if (!(existing_url === incoming_url)) {
1902
+ return false;
1903
+ }
1904
+ const existing_contentDocument = existing.contentDocument;
1905
+ const incoming_contentDocument = incoming.contentDocument;
1906
+ if (!(equals$8(existing_contentDocument, incoming_contentDocument))) {
1907
+ return false;
1908
+ }
1909
+ return true;
1910
+ }
1911
+ const ingest$7 = function SlackBridgeFileOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1912
+ if (process.env.NODE_ENV !== 'production') {
1913
+ const validateError = validate$7(input);
1914
+ if (validateError !== null) {
1915
+ throw validateError;
1916
+ }
1917
+ }
1918
+ const key = keyBuilderFromType$1(luvio, input);
1919
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
1920
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$7, "SlackBridge", VERSION$7, RepresentationType$7, equals$7);
1921
+ return createLink(key);
1922
+ };
1923
+ function getTypeCacheKeys$7(rootKeySet, luvio, input, fullPathFactory) {
1924
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1925
+ const rootKey = keyBuilderFromType$1(luvio, input);
1926
+ rootKeySet.set(rootKey, {
1927
+ namespace: keyPrefix,
1928
+ representationName: RepresentationType$7,
1929
+ mergeable: false
1930
+ });
1931
+ }
1932
+
1933
+ const VERSION$6 = "2685fcb652b41bdb9cb71cc45d73e44b";
1934
+ function validate$6(obj, path = 'SlackBridgeMessageOutputRepresentation') {
1935
+ const v_error = (() => {
1936
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1937
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1938
+ }
1939
+ const obj_files = obj.files;
1940
+ const path_files = path + '.files';
1941
+ if (!ArrayIsArray(obj_files)) {
1942
+ return new TypeError('Expected "array" but received "' + typeof obj_files + '" (at "' + path_files + '")');
1943
+ }
1944
+ for (let i = 0; i < obj_files.length; i++) {
1945
+ const obj_files_item = obj_files[i];
1946
+ const path_files_item = path_files + '[' + i + ']';
1947
+ if (typeof obj_files_item !== 'object') {
1948
+ return new TypeError('Expected "object" but received "' + typeof obj_files_item + '" (at "' + path_files_item + '")');
1949
+ }
1950
+ }
1951
+ const obj_includesCustomEmoji = obj.includesCustomEmoji;
1952
+ const path_includesCustomEmoji = path + '.includesCustomEmoji';
1953
+ let obj_includesCustomEmoji_union0 = null;
1954
+ const obj_includesCustomEmoji_union0_error = (() => {
1955
+ if (typeof obj_includesCustomEmoji !== 'boolean') {
1956
+ return new TypeError('Expected "boolean" but received "' + typeof obj_includesCustomEmoji + '" (at "' + path_includesCustomEmoji + '")');
1957
+ }
1958
+ })();
1959
+ if (obj_includesCustomEmoji_union0_error != null) {
1960
+ obj_includesCustomEmoji_union0 = obj_includesCustomEmoji_union0_error.message;
1961
+ }
1962
+ let obj_includesCustomEmoji_union1 = null;
1963
+ const obj_includesCustomEmoji_union1_error = (() => {
1964
+ if (obj_includesCustomEmoji !== null) {
1965
+ return new TypeError('Expected "null" but received "' + typeof obj_includesCustomEmoji + '" (at "' + path_includesCustomEmoji + '")');
1966
+ }
1967
+ })();
1968
+ if (obj_includesCustomEmoji_union1_error != null) {
1969
+ obj_includesCustomEmoji_union1 = obj_includesCustomEmoji_union1_error.message;
1970
+ }
1971
+ if (obj_includesCustomEmoji_union0 && obj_includesCustomEmoji_union1) {
1972
+ let message = 'Object doesn\'t match union (at "' + path_includesCustomEmoji + '")';
1973
+ message += '\n' + obj_includesCustomEmoji_union0.split('\n').map((line) => '\t' + line).join('\n');
1974
+ message += '\n' + obj_includesCustomEmoji_union1.split('\n').map((line) => '\t' + line).join('\n');
1975
+ return new TypeError(message);
1976
+ }
1977
+ const obj_isBroadcast = obj.isBroadcast;
1978
+ const path_isBroadcast = path + '.isBroadcast';
1979
+ if (typeof obj_isBroadcast !== 'boolean') {
1980
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isBroadcast + '" (at "' + path_isBroadcast + '")');
1981
+ }
1982
+ const obj_isEditable = obj.isEditable;
1983
+ const path_isEditable = path + '.isEditable';
1984
+ if (typeof obj_isEditable !== 'boolean') {
1985
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isEditable + '" (at "' + path_isEditable + '")');
1986
+ }
1987
+ const obj_isEdited = obj.isEdited;
1988
+ const path_isEdited = path + '.isEdited';
1989
+ if (typeof obj_isEdited !== 'boolean') {
1990
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isEdited + '" (at "' + path_isEdited + '")');
1991
+ }
1992
+ const obj_latestReplyTimestamp = obj.latestReplyTimestamp;
1993
+ const path_latestReplyTimestamp = path + '.latestReplyTimestamp';
1994
+ let obj_latestReplyTimestamp_union0 = null;
1995
+ const obj_latestReplyTimestamp_union0_error = (() => {
1996
+ if (typeof obj_latestReplyTimestamp !== 'string') {
1997
+ return new TypeError('Expected "string" but received "' + typeof obj_latestReplyTimestamp + '" (at "' + path_latestReplyTimestamp + '")');
1998
+ }
1999
+ })();
2000
+ if (obj_latestReplyTimestamp_union0_error != null) {
2001
+ obj_latestReplyTimestamp_union0 = obj_latestReplyTimestamp_union0_error.message;
2002
+ }
2003
+ let obj_latestReplyTimestamp_union1 = null;
2004
+ const obj_latestReplyTimestamp_union1_error = (() => {
2005
+ if (obj_latestReplyTimestamp !== null) {
2006
+ return new TypeError('Expected "null" but received "' + typeof obj_latestReplyTimestamp + '" (at "' + path_latestReplyTimestamp + '")');
2007
+ }
2008
+ })();
2009
+ if (obj_latestReplyTimestamp_union1_error != null) {
2010
+ obj_latestReplyTimestamp_union1 = obj_latestReplyTimestamp_union1_error.message;
2011
+ }
2012
+ if (obj_latestReplyTimestamp_union0 && obj_latestReplyTimestamp_union1) {
2013
+ let message = 'Object doesn\'t match union (at "' + path_latestReplyTimestamp + '")';
2014
+ message += '\n' + obj_latestReplyTimestamp_union0.split('\n').map((line) => '\t' + line).join('\n');
2015
+ message += '\n' + obj_latestReplyTimestamp_union1.split('\n').map((line) => '\t' + line).join('\n');
2016
+ return new TypeError(message);
2017
+ }
2018
+ const obj_message = obj.message;
2019
+ const path_message = path + '.message';
2020
+ if (typeof obj_message !== 'string') {
2021
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
2022
+ }
2023
+ const obj_messageTs = obj.messageTs;
2024
+ const path_messageTs = path + '.messageTs';
2025
+ if (typeof obj_messageTs !== 'string') {
2026
+ return new TypeError('Expected "string" but received "' + typeof obj_messageTs + '" (at "' + path_messageTs + '")');
2027
+ }
2028
+ const obj_reactions = obj.reactions;
2029
+ const path_reactions = path + '.reactions';
2030
+ if (!ArrayIsArray(obj_reactions)) {
2031
+ return new TypeError('Expected "array" but received "' + typeof obj_reactions + '" (at "' + path_reactions + '")');
2032
+ }
2033
+ for (let i = 0; i < obj_reactions.length; i++) {
2034
+ const obj_reactions_item = obj_reactions[i];
2035
+ const path_reactions_item = path_reactions + '[' + i + ']';
2036
+ const referencepath_reactions_itemValidationError = validate$f(obj_reactions_item, path_reactions_item);
2037
+ if (referencepath_reactions_itemValidationError !== null) {
2038
+ let message = 'Object doesn\'t match SlackBridgeReactionOutputRepresentation (at "' + path_reactions_item + '")\n';
2039
+ message += referencepath_reactions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2040
+ return new TypeError(message);
2041
+ }
2042
+ }
2043
+ const obj_replyCount = obj.replyCount;
2044
+ const path_replyCount = path + '.replyCount';
2045
+ let obj_replyCount_union0 = null;
2046
+ const obj_replyCount_union0_error = (() => {
2047
+ if (typeof obj_replyCount !== 'number' || (typeof obj_replyCount === 'number' && Math.floor(obj_replyCount) !== obj_replyCount)) {
2048
+ return new TypeError('Expected "integer" but received "' + typeof obj_replyCount + '" (at "' + path_replyCount + '")');
2049
+ }
2050
+ })();
2051
+ if (obj_replyCount_union0_error != null) {
2052
+ obj_replyCount_union0 = obj_replyCount_union0_error.message;
2053
+ }
2054
+ let obj_replyCount_union1 = null;
2055
+ const obj_replyCount_union1_error = (() => {
2056
+ if (obj_replyCount !== null) {
2057
+ return new TypeError('Expected "null" but received "' + typeof obj_replyCount + '" (at "' + path_replyCount + '")');
2058
+ }
2059
+ })();
2060
+ if (obj_replyCount_union1_error != null) {
2061
+ obj_replyCount_union1 = obj_replyCount_union1_error.message;
2062
+ }
2063
+ if (obj_replyCount_union0 && obj_replyCount_union1) {
2064
+ let message = 'Object doesn\'t match union (at "' + path_replyCount + '")';
2065
+ message += '\n' + obj_replyCount_union0.split('\n').map((line) => '\t' + line).join('\n');
2066
+ message += '\n' + obj_replyCount_union1.split('\n').map((line) => '\t' + line).join('\n');
2067
+ return new TypeError(message);
2068
+ }
2069
+ const obj_replyUsers = obj.replyUsers;
2070
+ const path_replyUsers = path + '.replyUsers';
2071
+ if (!ArrayIsArray(obj_replyUsers)) {
2072
+ return new TypeError('Expected "array" but received "' + typeof obj_replyUsers + '" (at "' + path_replyUsers + '")');
2073
+ }
2074
+ for (let i = 0; i < obj_replyUsers.length; i++) {
2075
+ const obj_replyUsers_item = obj_replyUsers[i];
2076
+ const path_replyUsers_item = path_replyUsers + '[' + i + ']';
2077
+ if (typeof obj_replyUsers_item !== 'string') {
2078
+ return new TypeError('Expected "string" but received "' + typeof obj_replyUsers_item + '" (at "' + path_replyUsers_item + '")');
2079
+ }
2080
+ }
2081
+ const obj_replyUsersCount = obj.replyUsersCount;
2082
+ const path_replyUsersCount = path + '.replyUsersCount';
2083
+ let obj_replyUsersCount_union0 = null;
2084
+ const obj_replyUsersCount_union0_error = (() => {
2085
+ if (typeof obj_replyUsersCount !== 'number' || (typeof obj_replyUsersCount === 'number' && Math.floor(obj_replyUsersCount) !== obj_replyUsersCount)) {
2086
+ return new TypeError('Expected "integer" but received "' + typeof obj_replyUsersCount + '" (at "' + path_replyUsersCount + '")');
2087
+ }
2088
+ })();
2089
+ if (obj_replyUsersCount_union0_error != null) {
2090
+ obj_replyUsersCount_union0 = obj_replyUsersCount_union0_error.message;
2091
+ }
2092
+ let obj_replyUsersCount_union1 = null;
2093
+ const obj_replyUsersCount_union1_error = (() => {
2094
+ if (obj_replyUsersCount !== null) {
2095
+ return new TypeError('Expected "null" but received "' + typeof obj_replyUsersCount + '" (at "' + path_replyUsersCount + '")');
2096
+ }
2097
+ })();
2098
+ if (obj_replyUsersCount_union1_error != null) {
2099
+ obj_replyUsersCount_union1 = obj_replyUsersCount_union1_error.message;
2100
+ }
2101
+ if (obj_replyUsersCount_union0 && obj_replyUsersCount_union1) {
2102
+ let message = 'Object doesn\'t match union (at "' + path_replyUsersCount + '")';
2103
+ message += '\n' + obj_replyUsersCount_union0.split('\n').map((line) => '\t' + line).join('\n');
2104
+ message += '\n' + obj_replyUsersCount_union1.split('\n').map((line) => '\t' + line).join('\n');
2105
+ return new TypeError(message);
2106
+ }
2107
+ const obj_slackUserId = obj.slackUserId;
2108
+ const path_slackUserId = path + '.slackUserId';
2109
+ if (typeof obj_slackUserId !== 'string') {
2110
+ return new TypeError('Expected "string" but received "' + typeof obj_slackUserId + '" (at "' + path_slackUserId + '")');
2111
+ }
2112
+ const obj_subtype = obj.subtype;
2113
+ const path_subtype = path + '.subtype';
2114
+ let obj_subtype_union0 = null;
2115
+ const obj_subtype_union0_error = (() => {
2116
+ if (typeof obj_subtype !== 'string') {
2117
+ return new TypeError('Expected "string" but received "' + typeof obj_subtype + '" (at "' + path_subtype + '")');
2118
+ }
2119
+ })();
2120
+ if (obj_subtype_union0_error != null) {
2121
+ obj_subtype_union0 = obj_subtype_union0_error.message;
2122
+ }
2123
+ let obj_subtype_union1 = null;
2124
+ const obj_subtype_union1_error = (() => {
2125
+ if (obj_subtype !== null) {
2126
+ return new TypeError('Expected "null" but received "' + typeof obj_subtype + '" (at "' + path_subtype + '")');
2127
+ }
2128
+ })();
2129
+ if (obj_subtype_union1_error != null) {
2130
+ obj_subtype_union1 = obj_subtype_union1_error.message;
2131
+ }
2132
+ if (obj_subtype_union0 && obj_subtype_union1) {
2133
+ let message = 'Object doesn\'t match union (at "' + path_subtype + '")';
2134
+ message += '\n' + obj_subtype_union0.split('\n').map((line) => '\t' + line).join('\n');
2135
+ message += '\n' + obj_subtype_union1.split('\n').map((line) => '\t' + line).join('\n');
2136
+ return new TypeError(message);
2137
+ }
2138
+ const obj_threadTs = obj.threadTs;
2139
+ const path_threadTs = path + '.threadTs';
2140
+ let obj_threadTs_union0 = null;
2141
+ const obj_threadTs_union0_error = (() => {
2142
+ if (typeof obj_threadTs !== 'string') {
2143
+ return new TypeError('Expected "string" but received "' + typeof obj_threadTs + '" (at "' + path_threadTs + '")');
2144
+ }
2145
+ })();
2146
+ if (obj_threadTs_union0_error != null) {
2147
+ obj_threadTs_union0 = obj_threadTs_union0_error.message;
2148
+ }
2149
+ let obj_threadTs_union1 = null;
2150
+ const obj_threadTs_union1_error = (() => {
2151
+ if (obj_threadTs !== null) {
2152
+ return new TypeError('Expected "null" but received "' + typeof obj_threadTs + '" (at "' + path_threadTs + '")');
2153
+ }
2154
+ })();
2155
+ if (obj_threadTs_union1_error != null) {
2156
+ obj_threadTs_union1 = obj_threadTs_union1_error.message;
2157
+ }
2158
+ if (obj_threadTs_union0 && obj_threadTs_union1) {
2159
+ let message = 'Object doesn\'t match union (at "' + path_threadTs + '")';
2160
+ message += '\n' + obj_threadTs_union0.split('\n').map((line) => '\t' + line).join('\n');
2161
+ message += '\n' + obj_threadTs_union1.split('\n').map((line) => '\t' + line).join('\n');
2162
+ return new TypeError(message);
2163
+ }
2164
+ const obj_type = obj.type;
2165
+ const path_type = path + '.type';
2166
+ if (typeof obj_type !== 'string') {
2167
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
2168
+ }
2169
+ const obj_url = obj.url;
2170
+ const path_url = path + '.url';
2171
+ if (typeof obj_url !== 'string') {
2172
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
2173
+ }
2174
+ })();
2175
+ return v_error === undefined ? null : v_error;
2176
+ }
2177
+ const RepresentationType$6 = 'SlackBridgeMessageOutputRepresentation';
2178
+ function normalize$6(input, existing, path, luvio, store, timestamp) {
2179
+ const input_files = input.files;
2180
+ const input_files_id = path.fullPath + '__files';
2181
+ for (let i = 0; i < input_files.length; i++) {
2182
+ const input_files_item = input_files[i];
2183
+ let input_files_item_id = input_files_id + '__' + i;
2184
+ input_files[i] = ingest$7(input_files_item, {
2185
+ fullPath: input_files_item_id,
2186
+ propertyName: i,
2187
+ parent: {
2188
+ data: input,
2189
+ key: path.fullPath,
2190
+ existing: existing,
2191
+ },
2192
+ ttl: path.ttl
2193
+ }, luvio, store, timestamp);
2194
+ }
2195
+ return input;
2196
+ }
2197
+ const select$g = function SlackBridgeMessageOutputRepresentationSelect() {
2198
+ const { selections: SlackBridgeReactionOutputRepresentation__selections, opaque: SlackBridgeReactionOutputRepresentation__opaque, } = select$p();
2199
+ return {
2200
+ kind: 'Fragment',
2201
+ version: VERSION$6,
2202
+ private: [],
2203
+ selections: [
2204
+ {
2205
+ name: 'files',
2206
+ kind: 'Link',
2207
+ plural: true,
2208
+ fragment: select$h()
2209
+ },
2210
+ {
2211
+ name: 'includesCustomEmoji',
2212
+ kind: 'Scalar'
2213
+ },
2214
+ {
2215
+ name: 'isBroadcast',
2216
+ kind: 'Scalar'
2217
+ },
2218
+ {
2219
+ name: 'isEditable',
2220
+ kind: 'Scalar'
2221
+ },
2222
+ {
2223
+ name: 'isEdited',
2224
+ kind: 'Scalar'
2225
+ },
2226
+ {
2227
+ name: 'latestReplyTimestamp',
2228
+ kind: 'Scalar'
2229
+ },
2230
+ {
2231
+ name: 'message',
2232
+ kind: 'Scalar'
2233
+ },
2234
+ {
2235
+ name: 'messageTs',
2236
+ kind: 'Scalar'
2237
+ },
2238
+ {
2239
+ name: 'reactions',
2240
+ kind: 'Object',
2241
+ plural: true,
2242
+ selections: SlackBridgeReactionOutputRepresentation__selections
2243
+ },
2244
+ {
2245
+ name: 'replyCount',
2246
+ kind: 'Scalar'
2247
+ },
2248
+ {
2249
+ name: 'replyUsers',
2250
+ kind: 'Scalar',
2251
+ plural: true
2252
+ },
2253
+ {
2254
+ name: 'replyUsersCount',
2255
+ kind: 'Scalar'
2256
+ },
2257
+ {
2258
+ name: 'slackUserId',
2259
+ kind: 'Scalar'
2260
+ },
2261
+ {
2262
+ name: 'subtype',
2263
+ kind: 'Scalar'
2264
+ },
2265
+ {
2266
+ name: 'threadTs',
2267
+ kind: 'Scalar'
2268
+ },
2269
+ {
2270
+ name: 'type',
2271
+ kind: 'Scalar'
2272
+ },
2273
+ {
2274
+ name: 'url',
2275
+ kind: 'Scalar'
2276
+ }
2277
+ ]
2278
+ };
2279
+ };
2280
+ function equals$6(existing, incoming) {
2281
+ const existing_isBroadcast = existing.isBroadcast;
2282
+ const incoming_isBroadcast = incoming.isBroadcast;
2283
+ if (!(existing_isBroadcast === incoming_isBroadcast)) {
2284
+ return false;
2285
+ }
2286
+ const existing_isEditable = existing.isEditable;
2287
+ const incoming_isEditable = incoming.isEditable;
2288
+ if (!(existing_isEditable === incoming_isEditable)) {
2289
+ return false;
2290
+ }
2291
+ const existing_isEdited = existing.isEdited;
2292
+ const incoming_isEdited = incoming.isEdited;
2293
+ if (!(existing_isEdited === incoming_isEdited)) {
2294
+ return false;
2295
+ }
2296
+ const existing_message = existing.message;
2297
+ const incoming_message = incoming.message;
2298
+ if (!(existing_message === incoming_message)) {
2299
+ return false;
2300
+ }
2301
+ const existing_messageTs = existing.messageTs;
2302
+ const incoming_messageTs = incoming.messageTs;
2303
+ if (!(existing_messageTs === incoming_messageTs)) {
2304
+ return false;
2305
+ }
2306
+ const existing_slackUserId = existing.slackUserId;
2307
+ const incoming_slackUserId = incoming.slackUserId;
2308
+ if (!(existing_slackUserId === incoming_slackUserId)) {
2309
+ return false;
2310
+ }
2311
+ const existing_type = existing.type;
2312
+ const incoming_type = incoming.type;
2313
+ if (!(existing_type === incoming_type)) {
2314
+ return false;
2315
+ }
2316
+ const existing_url = existing.url;
2317
+ const incoming_url = incoming.url;
2318
+ if (!(existing_url === incoming_url)) {
2319
+ return false;
2320
+ }
2321
+ const existing_files = existing.files;
2322
+ const incoming_files = incoming.files;
2323
+ const equals_files_items = equalsArray(existing_files, incoming_files, (existing_files_item, incoming_files_item) => {
2324
+ if (!(existing_files_item.__ref === incoming_files_item.__ref)) {
2325
+ return false;
2326
+ }
2327
+ });
2328
+ if (equals_files_items === false) {
2329
+ return false;
2330
+ }
2331
+ const existing_includesCustomEmoji = existing.includesCustomEmoji;
2332
+ const incoming_includesCustomEmoji = incoming.includesCustomEmoji;
2333
+ if (!(existing_includesCustomEmoji === incoming_includesCustomEmoji)) {
2334
+ return false;
2335
+ }
2336
+ const existing_latestReplyTimestamp = existing.latestReplyTimestamp;
2337
+ const incoming_latestReplyTimestamp = incoming.latestReplyTimestamp;
2338
+ if (!(existing_latestReplyTimestamp === incoming_latestReplyTimestamp)) {
2339
+ return false;
2340
+ }
2341
+ const existing_reactions = existing.reactions;
2342
+ const incoming_reactions = incoming.reactions;
2343
+ const equals_reactions_items = equalsArray(existing_reactions, incoming_reactions, (existing_reactions_item, incoming_reactions_item) => {
2344
+ if (!(equals$f(existing_reactions_item, incoming_reactions_item))) {
2345
+ return false;
2346
+ }
2347
+ });
2348
+ if (equals_reactions_items === false) {
2349
+ return false;
2350
+ }
2351
+ const existing_replyCount = existing.replyCount;
2352
+ const incoming_replyCount = incoming.replyCount;
2353
+ if (!(existing_replyCount === incoming_replyCount)) {
2354
+ return false;
2355
+ }
2356
+ const existing_replyUsers = existing.replyUsers;
2357
+ const incoming_replyUsers = incoming.replyUsers;
2358
+ const equals_replyUsers_items = equalsArray(existing_replyUsers, incoming_replyUsers, (existing_replyUsers_item, incoming_replyUsers_item) => {
2359
+ if (!(existing_replyUsers_item === incoming_replyUsers_item)) {
2360
+ return false;
2361
+ }
2362
+ });
2363
+ if (equals_replyUsers_items === false) {
2364
+ return false;
2365
+ }
2366
+ const existing_replyUsersCount = existing.replyUsersCount;
2367
+ const incoming_replyUsersCount = incoming.replyUsersCount;
2368
+ if (!(existing_replyUsersCount === incoming_replyUsersCount)) {
2369
+ return false;
2370
+ }
2371
+ const existing_subtype = existing.subtype;
2372
+ const incoming_subtype = incoming.subtype;
2373
+ if (!(existing_subtype === incoming_subtype)) {
2374
+ return false;
2375
+ }
2376
+ const existing_threadTs = existing.threadTs;
2377
+ const incoming_threadTs = incoming.threadTs;
2378
+ if (!(existing_threadTs === incoming_threadTs)) {
2379
+ return false;
2380
+ }
2381
+ return true;
2382
+ }
2383
+ const ingest$6 = function SlackBridgeMessageOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2384
+ if (process.env.NODE_ENV !== 'production') {
2385
+ const validateError = validate$6(input);
2386
+ if (validateError !== null) {
2387
+ throw validateError;
2388
+ }
2389
+ }
2390
+ const key = path.fullPath;
2391
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
2392
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "SlackBridge", VERSION$6, RepresentationType$6, equals$6);
2393
+ return createLink(key);
2394
+ };
2395
+ function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
2396
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2397
+ const rootKey = fullPathFactory();
2398
+ rootKeySet.set(rootKey, {
2399
+ namespace: keyPrefix,
2400
+ representationName: RepresentationType$6,
2401
+ mergeable: false
2402
+ });
2403
+ const input_files_length = input.files.length;
2404
+ for (let i = 0; i < input_files_length; i++) {
2405
+ getTypeCacheKeys$7(rootKeySet, luvio, input.files[i]);
2406
+ }
2407
+ }
2408
+
2409
+ const VERSION$5 = "5145ac2c241c561e4baa29b3884748dc";
2410
+ function validate$5(obj, path = 'SlackBridgeConversationHistoryOutputRepresentation') {
2411
+ const v_error = (() => {
2412
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2413
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2414
+ }
2415
+ const obj_hasMore = obj.hasMore;
2416
+ const path_hasMore = path + '.hasMore';
2417
+ if (typeof obj_hasMore !== 'boolean') {
2418
+ return new TypeError('Expected "boolean" but received "' + typeof obj_hasMore + '" (at "' + path_hasMore + '")');
2419
+ }
2420
+ const obj_messages = obj.messages;
2421
+ const path_messages = path + '.messages';
2422
+ if (!ArrayIsArray(obj_messages)) {
2423
+ return new TypeError('Expected "array" but received "' + typeof obj_messages + '" (at "' + path_messages + '")');
2424
+ }
2425
+ for (let i = 0; i < obj_messages.length; i++) {
2426
+ const obj_messages_item = obj_messages[i];
2427
+ const path_messages_item = path_messages + '[' + i + ']';
2428
+ if (typeof obj_messages_item !== 'object') {
2429
+ return new TypeError('Expected "object" but received "' + typeof obj_messages_item + '" (at "' + path_messages_item + '")');
2430
+ }
2431
+ }
2432
+ const obj_nextCursor = obj.nextCursor;
2433
+ const path_nextCursor = path + '.nextCursor';
2434
+ let obj_nextCursor_union0 = null;
2435
+ const obj_nextCursor_union0_error = (() => {
2436
+ if (typeof obj_nextCursor !== 'string') {
2437
+ return new TypeError('Expected "string" but received "' + typeof obj_nextCursor + '" (at "' + path_nextCursor + '")');
2438
+ }
2439
+ })();
2440
+ if (obj_nextCursor_union0_error != null) {
2441
+ obj_nextCursor_union0 = obj_nextCursor_union0_error.message;
2442
+ }
2443
+ let obj_nextCursor_union1 = null;
2444
+ const obj_nextCursor_union1_error = (() => {
2445
+ if (obj_nextCursor !== null) {
2446
+ return new TypeError('Expected "null" but received "' + typeof obj_nextCursor + '" (at "' + path_nextCursor + '")');
2447
+ }
2448
+ })();
2449
+ if (obj_nextCursor_union1_error != null) {
2450
+ obj_nextCursor_union1 = obj_nextCursor_union1_error.message;
2451
+ }
2452
+ if (obj_nextCursor_union0 && obj_nextCursor_union1) {
2453
+ let message = 'Object doesn\'t match union (at "' + path_nextCursor + '")';
2454
+ message += '\n' + obj_nextCursor_union0.split('\n').map((line) => '\t' + line).join('\n');
2455
+ message += '\n' + obj_nextCursor_union1.split('\n').map((line) => '\t' + line).join('\n');
2456
+ return new TypeError(message);
2457
+ }
2458
+ })();
2459
+ return v_error === undefined ? null : v_error;
2460
+ }
2461
+ const RepresentationType$5 = 'SlackBridgeConversationHistoryOutputRepresentation';
2462
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
2463
+ const input_messages = input.messages;
2464
+ const input_messages_id = path.fullPath + '__messages';
2465
+ for (let i = 0; i < input_messages.length; i++) {
2466
+ const input_messages_item = input_messages[i];
2467
+ let input_messages_item_id = input_messages_id + '__' + i;
2468
+ input_messages[i] = ingest$6(input_messages_item, {
2469
+ fullPath: input_messages_item_id,
2470
+ propertyName: i,
2471
+ parent: {
2472
+ data: input,
2473
+ key: path.fullPath,
2474
+ existing: existing,
2475
+ },
2476
+ ttl: path.ttl
2477
+ }, luvio, store, timestamp);
2478
+ }
2479
+ return input;
2480
+ }
2481
+ const select$f = function SlackBridgeConversationHistoryOutputRepresentationSelect() {
2482
+ return {
2483
+ kind: 'Fragment',
2484
+ version: VERSION$5,
2485
+ private: [],
2486
+ selections: [
2487
+ {
2488
+ name: 'hasMore',
2489
+ kind: 'Scalar'
2490
+ },
2491
+ {
2492
+ name: 'messages',
2493
+ kind: 'Link',
2494
+ plural: true,
2495
+ fragment: select$g()
2496
+ },
2497
+ {
2498
+ name: 'nextCursor',
2499
+ kind: 'Scalar'
2500
+ }
2501
+ ]
2502
+ };
2503
+ };
2504
+ function equals$5(existing, incoming) {
2505
+ const existing_hasMore = existing.hasMore;
2506
+ const incoming_hasMore = incoming.hasMore;
2507
+ if (!(existing_hasMore === incoming_hasMore)) {
2508
+ return false;
2509
+ }
2510
+ const existing_messages = existing.messages;
2511
+ const incoming_messages = incoming.messages;
2512
+ const equals_messages_items = equalsArray(existing_messages, incoming_messages, (existing_messages_item, incoming_messages_item) => {
2513
+ if (!(existing_messages_item.__ref === incoming_messages_item.__ref)) {
2514
+ return false;
2515
+ }
2516
+ });
2517
+ if (equals_messages_items === false) {
2518
+ return false;
2519
+ }
2520
+ const existing_nextCursor = existing.nextCursor;
2521
+ const incoming_nextCursor = incoming.nextCursor;
2522
+ if (!(existing_nextCursor === incoming_nextCursor)) {
2523
+ return false;
2524
+ }
2525
+ return true;
2526
+ }
2527
+ const ingest$5 = function SlackBridgeConversationHistoryOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2528
+ if (process.env.NODE_ENV !== 'production') {
2529
+ const validateError = validate$5(input);
2530
+ if (validateError !== null) {
2531
+ throw validateError;
2532
+ }
2533
+ }
2534
+ const key = path.fullPath;
2535
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
2536
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "SlackBridge", VERSION$5, RepresentationType$5, equals$5);
2537
+ return createLink(key);
2538
+ };
2539
+ function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
2540
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2541
+ const rootKey = fullPathFactory();
2542
+ rootKeySet.set(rootKey, {
2543
+ namespace: keyPrefix,
2544
+ representationName: RepresentationType$5,
2545
+ mergeable: false
2546
+ });
2547
+ const input_messages_length = input.messages.length;
2548
+ for (let i = 0; i < input_messages_length; i++) {
2549
+ getTypeCacheKeys$6(rootKeySet, luvio, input.messages[i], () => '');
2550
+ }
2551
+ }
2552
+
2553
+ const VERSION$4 = "21c847787f50f951dda23488ddff3863";
2554
+ function validate$4(obj, path = 'SlackBridgeConversationOutputRepresentation') {
2555
+ const v_error = (() => {
2556
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2557
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2558
+ }
2559
+ const obj_channelId = obj.channelId;
2560
+ const path_channelId = path + '.channelId';
2561
+ if (typeof obj_channelId !== 'string') {
2562
+ return new TypeError('Expected "string" but received "' + typeof obj_channelId + '" (at "' + path_channelId + '")');
2563
+ }
2564
+ const obj_channelUrl = obj.channelUrl;
2565
+ const path_channelUrl = path + '.channelUrl';
2566
+ if (typeof obj_channelUrl !== 'string') {
2567
+ return new TypeError('Expected "string" but received "' + typeof obj_channelUrl + '" (at "' + path_channelUrl + '")');
2568
+ }
2569
+ const obj_contextUserInfo = obj.contextUserInfo;
2570
+ const path_contextUserInfo = path + '.contextUserInfo';
2571
+ let obj_contextUserInfo_union0 = null;
2572
+ const obj_contextUserInfo_union0_error = (() => {
2573
+ if (typeof obj_contextUserInfo !== 'object') {
2574
+ return new TypeError('Expected "object" but received "' + typeof obj_contextUserInfo + '" (at "' + path_contextUserInfo + '")');
2575
+ }
2576
+ })();
2577
+ if (obj_contextUserInfo_union0_error != null) {
2578
+ obj_contextUserInfo_union0 = obj_contextUserInfo_union0_error.message;
2579
+ }
2580
+ let obj_contextUserInfo_union1 = null;
2581
+ const obj_contextUserInfo_union1_error = (() => {
2582
+ if (obj_contextUserInfo !== null) {
2583
+ return new TypeError('Expected "null" but received "' + typeof obj_contextUserInfo + '" (at "' + path_contextUserInfo + '")');
2584
+ }
2585
+ })();
2586
+ if (obj_contextUserInfo_union1_error != null) {
2587
+ obj_contextUserInfo_union1 = obj_contextUserInfo_union1_error.message;
2588
+ }
2589
+ if (obj_contextUserInfo_union0 && obj_contextUserInfo_union1) {
2590
+ let message = 'Object doesn\'t match union (at "' + path_contextUserInfo + '")';
2591
+ message += '\n' + obj_contextUserInfo_union0.split('\n').map((line) => '\t' + line).join('\n');
2592
+ message += '\n' + obj_contextUserInfo_union1.split('\n').map((line) => '\t' + line).join('\n');
2593
+ return new TypeError(message);
2594
+ }
2595
+ const obj_conversationInfo = obj.conversationInfo;
2596
+ const path_conversationInfo = path + '.conversationInfo';
2597
+ let obj_conversationInfo_union0 = null;
2598
+ const obj_conversationInfo_union0_error = (() => {
2599
+ const referencepath_conversationInfoValidationError = validate$d(obj_conversationInfo, path_conversationInfo);
2600
+ if (referencepath_conversationInfoValidationError !== null) {
2601
+ let message = 'Object doesn\'t match SlackBridgeConversationInfoOutputRepresentation (at "' + path_conversationInfo + '")\n';
2602
+ message += referencepath_conversationInfoValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2603
+ return new TypeError(message);
2604
+ }
2605
+ })();
2606
+ if (obj_conversationInfo_union0_error != null) {
2607
+ obj_conversationInfo_union0 = obj_conversationInfo_union0_error.message;
2608
+ }
2609
+ let obj_conversationInfo_union1 = null;
2610
+ const obj_conversationInfo_union1_error = (() => {
2611
+ if (obj_conversationInfo !== null) {
2612
+ return new TypeError('Expected "null" but received "' + typeof obj_conversationInfo + '" (at "' + path_conversationInfo + '")');
2613
+ }
2614
+ })();
2615
+ if (obj_conversationInfo_union1_error != null) {
2616
+ obj_conversationInfo_union1 = obj_conversationInfo_union1_error.message;
2617
+ }
2618
+ if (obj_conversationInfo_union0 && obj_conversationInfo_union1) {
2619
+ let message = 'Object doesn\'t match union (at "' + path_conversationInfo + '")';
2620
+ message += '\n' + obj_conversationInfo_union0.split('\n').map((line) => '\t' + line).join('\n');
2621
+ message += '\n' + obj_conversationInfo_union1.split('\n').map((line) => '\t' + line).join('\n');
2622
+ return new TypeError(message);
2623
+ }
2624
+ const obj_history = obj.history;
2625
+ const path_history = path + '.history';
2626
+ if (typeof obj_history !== 'object') {
2627
+ return new TypeError('Expected "object" but received "' + typeof obj_history + '" (at "' + path_history + '")');
2628
+ }
2629
+ const obj_teamId = obj.teamId;
2630
+ const path_teamId = path + '.teamId';
2631
+ if (typeof obj_teamId !== 'string') {
2632
+ return new TypeError('Expected "string" but received "' + typeof obj_teamId + '" (at "' + path_teamId + '")');
2633
+ }
2634
+ const obj_threadTs = obj.threadTs;
2635
+ const path_threadTs = path + '.threadTs';
2636
+ let obj_threadTs_union0 = null;
2637
+ const obj_threadTs_union0_error = (() => {
2638
+ if (typeof obj_threadTs !== 'string') {
2639
+ return new TypeError('Expected "string" but received "' + typeof obj_threadTs + '" (at "' + path_threadTs + '")');
2640
+ }
2641
+ })();
2642
+ if (obj_threadTs_union0_error != null) {
2643
+ obj_threadTs_union0 = obj_threadTs_union0_error.message;
2644
+ }
2645
+ let obj_threadTs_union1 = null;
2646
+ const obj_threadTs_union1_error = (() => {
2647
+ if (obj_threadTs !== null) {
2648
+ return new TypeError('Expected "null" but received "' + typeof obj_threadTs + '" (at "' + path_threadTs + '")');
2649
+ }
2650
+ })();
2651
+ if (obj_threadTs_union1_error != null) {
2652
+ obj_threadTs_union1 = obj_threadTs_union1_error.message;
2653
+ }
2654
+ if (obj_threadTs_union0 && obj_threadTs_union1) {
2655
+ let message = 'Object doesn\'t match union (at "' + path_threadTs + '")';
2656
+ message += '\n' + obj_threadTs_union0.split('\n').map((line) => '\t' + line).join('\n');
2657
+ message += '\n' + obj_threadTs_union1.split('\n').map((line) => '\t' + line).join('\n');
2658
+ return new TypeError(message);
2659
+ }
2660
+ const obj_userInfos = obj.userInfos;
2661
+ const path_userInfos = path + '.userInfos';
2662
+ if (!ArrayIsArray(obj_userInfos)) {
2663
+ return new TypeError('Expected "array" but received "' + typeof obj_userInfos + '" (at "' + path_userInfos + '")');
2664
+ }
2665
+ for (let i = 0; i < obj_userInfos.length; i++) {
2666
+ const obj_userInfos_item = obj_userInfos[i];
2667
+ const path_userInfos_item = path_userInfos + '[' + i + ']';
2668
+ if (typeof obj_userInfos_item !== 'object') {
2669
+ return new TypeError('Expected "object" but received "' + typeof obj_userInfos_item + '" (at "' + path_userInfos_item + '")');
2670
+ }
2671
+ }
2672
+ })();
2673
+ return v_error === undefined ? null : v_error;
2674
+ }
2675
+ const RepresentationType$4 = 'SlackBridgeConversationOutputRepresentation';
2676
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
2677
+ const input_contextUserInfo = input.contextUserInfo;
2678
+ const input_contextUserInfo_id = path.fullPath + '__contextUserInfo';
2679
+ if (input_contextUserInfo !== null && typeof input_contextUserInfo === 'object') {
2680
+ input.contextUserInfo = ingest$8(input_contextUserInfo, {
2681
+ fullPath: input_contextUserInfo_id,
2682
+ propertyName: 'contextUserInfo',
2683
+ parent: {
2684
+ data: input,
2685
+ key: path.fullPath,
2686
+ existing: existing,
2687
+ },
2688
+ ttl: path.ttl
2689
+ }, luvio, store, timestamp);
2690
+ }
2691
+ const input_history = input.history;
2692
+ const input_history_id = path.fullPath + '__history';
2693
+ input.history = ingest$5(input_history, {
2694
+ fullPath: input_history_id,
2695
+ propertyName: 'history',
2696
+ parent: {
2697
+ data: input,
2698
+ key: path.fullPath,
2699
+ existing: existing,
2700
+ },
2701
+ ttl: path.ttl
2702
+ }, luvio, store, timestamp);
2703
+ const input_userInfos = input.userInfos;
2704
+ const input_userInfos_id = path.fullPath + '__userInfos';
2705
+ for (let i = 0; i < input_userInfos.length; i++) {
2706
+ const input_userInfos_item = input_userInfos[i];
2707
+ let input_userInfos_item_id = input_userInfos_id + '__' + i;
2708
+ input_userInfos[i] = ingest$8(input_userInfos_item, {
2709
+ fullPath: input_userInfos_item_id,
2710
+ propertyName: i,
2711
+ parent: {
2712
+ data: input,
2713
+ key: path.fullPath,
2714
+ existing: existing,
2715
+ },
2716
+ ttl: path.ttl
2717
+ }, luvio, store, timestamp);
2718
+ }
2719
+ return input;
2720
+ }
2721
+ const select$e = function SlackBridgeConversationOutputRepresentationSelect() {
2722
+ const { selections: SlackBridgeConversationInfoOutputRepresentation__selections, opaque: SlackBridgeConversationInfoOutputRepresentation__opaque, } = select$n();
2723
+ return {
2724
+ kind: 'Fragment',
2725
+ version: VERSION$4,
2726
+ private: [],
2727
+ selections: [
2728
+ {
2729
+ name: 'channelId',
2730
+ kind: 'Scalar'
2731
+ },
2732
+ {
2733
+ name: 'channelUrl',
2734
+ kind: 'Scalar'
2735
+ },
2736
+ {
2737
+ name: 'contextUserInfo',
2738
+ kind: 'Link',
2739
+ nullable: true,
2740
+ fragment: select$l()
2741
+ },
2742
+ {
2743
+ name: 'conversationInfo',
2744
+ kind: 'Object',
2745
+ nullable: true,
2746
+ selections: SlackBridgeConversationInfoOutputRepresentation__selections
2747
+ },
2748
+ {
2749
+ name: 'history',
2750
+ kind: 'Link',
2751
+ fragment: select$f()
2752
+ },
2753
+ {
2754
+ name: 'teamId',
2755
+ kind: 'Scalar'
2756
+ },
2757
+ {
2758
+ name: 'threadTs',
2759
+ kind: 'Scalar'
2760
+ },
2761
+ {
2762
+ name: 'userInfos',
2763
+ kind: 'Link',
2764
+ plural: true,
2765
+ fragment: select$l()
2766
+ }
2767
+ ]
2768
+ };
2769
+ };
2770
+ function equals$4(existing, incoming) {
2771
+ const existing_channelId = existing.channelId;
2772
+ const incoming_channelId = incoming.channelId;
2773
+ if (!(existing_channelId === incoming_channelId)) {
2774
+ return false;
2775
+ }
2776
+ const existing_channelUrl = existing.channelUrl;
2777
+ const incoming_channelUrl = incoming.channelUrl;
2778
+ if (!(existing_channelUrl === incoming_channelUrl)) {
2779
+ return false;
2780
+ }
2781
+ const existing_teamId = existing.teamId;
2782
+ const incoming_teamId = incoming.teamId;
2783
+ if (!(existing_teamId === incoming_teamId)) {
2784
+ return false;
2785
+ }
2786
+ const existing_contextUserInfo = existing.contextUserInfo;
2787
+ const incoming_contextUserInfo = incoming.contextUserInfo;
2788
+ if (!(existing_contextUserInfo === incoming_contextUserInfo
2789
+ || (existing_contextUserInfo != null &&
2790
+ incoming_contextUserInfo != null &&
2791
+ existing_contextUserInfo.__ref != null &&
2792
+ incoming_contextUserInfo.__ref != null &&
2793
+ existing_contextUserInfo.__ref === incoming_contextUserInfo.__ref))) {
2794
+ return false;
2795
+ }
2796
+ const existing_conversationInfo = existing.conversationInfo;
2797
+ const incoming_conversationInfo = incoming.conversationInfo;
2798
+ if (!(existing_conversationInfo === incoming_conversationInfo
2799
+ || (existing_conversationInfo != null &&
2800
+ incoming_conversationInfo != null &&
2801
+ equals$d(existing_conversationInfo, incoming_conversationInfo)))) {
2802
+ return false;
2803
+ }
2804
+ const existing_history = existing.history;
2805
+ const incoming_history = incoming.history;
2806
+ if (!(existing_history.__ref === incoming_history.__ref)) {
2807
+ return false;
2808
+ }
2809
+ const existing_threadTs = existing.threadTs;
2810
+ const incoming_threadTs = incoming.threadTs;
2811
+ if (!(existing_threadTs === incoming_threadTs)) {
2812
+ return false;
2813
+ }
2814
+ const existing_userInfos = existing.userInfos;
2815
+ const incoming_userInfos = incoming.userInfos;
2816
+ const equals_userInfos_items = equalsArray(existing_userInfos, incoming_userInfos, (existing_userInfos_item, incoming_userInfos_item) => {
2817
+ if (!(existing_userInfos_item.__ref === incoming_userInfos_item.__ref)) {
2818
+ return false;
2819
+ }
2820
+ });
2821
+ if (equals_userInfos_items === false) {
2822
+ return false;
2823
+ }
2824
+ return true;
2825
+ }
2826
+ const ingest$4 = function SlackBridgeConversationOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2827
+ if (process.env.NODE_ENV !== 'production') {
2828
+ const validateError = validate$4(input);
2829
+ if (validateError !== null) {
2830
+ throw validateError;
2831
+ }
2832
+ }
2833
+ const key = path.fullPath;
2834
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
2835
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "SlackBridge", VERSION$4, RepresentationType$4, equals$4);
2836
+ return createLink(key);
2837
+ };
2838
+ function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
2839
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2840
+ const rootKey = fullPathFactory();
2841
+ rootKeySet.set(rootKey, {
2842
+ namespace: keyPrefix,
2843
+ representationName: RepresentationType$4,
2844
+ mergeable: false
2845
+ });
2846
+ if (input.contextUserInfo !== null && typeof input.contextUserInfo === 'object') {
2847
+ getTypeCacheKeys$8(rootKeySet, luvio, input.contextUserInfo);
2848
+ }
2849
+ getTypeCacheKeys$5(rootKeySet, luvio, input.history, () => rootKey + "__" + "history");
2850
+ const input_userInfos_length = input.userInfos.length;
2851
+ for (let i = 0; i < input_userInfos_length; i++) {
2852
+ getTypeCacheKeys$8(rootKeySet, luvio, input.userInfos[i]);
2853
+ }
2854
+ }
2855
+
2856
+ function select$d(luvio, params) {
2857
+ return select$e();
2858
+ }
2859
+ function keyBuilder$c(luvio, params) {
2860
+ return keyPrefix + '::SlackBridgeConversationOutputRepresentation:(' + 'channelId:' + params.queryParams.channelId + ',' + 'includeView:' + params.queryParams.includeView + ',' + 'inclusive:' + params.queryParams.inclusive + ',' + 'latestMessageTs:' + params.queryParams.latestMessageTs + ',' + 'limit:' + params.queryParams.limit + ',' + 'oldestMessageTs:' + params.queryParams.oldestMessageTs + ',' + 'parentMessageTs:' + params.queryParams.parentMessageTs + ',' + 'relatedRecordId:' + params.queryParams.relatedRecordId + ',' + 'teamId:' + params.queryParams.teamId + ')';
2861
+ }
2862
+ function getResponseCacheKeys$9(storeKeyMap, luvio, resourceParams, response) {
2863
+ getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$c(luvio, resourceParams));
2864
+ }
2865
+ function ingestSuccess$9(luvio, resourceParams, response, snapshotRefresh) {
2866
+ const { body } = response;
2867
+ const key = keyBuilder$c(luvio, resourceParams);
2868
+ luvio.storeIngest(key, ingest$4, body);
2869
+ const snapshot = luvio.storeLookup({
2870
+ recordId: key,
2871
+ node: select$d(),
2872
+ variables: {},
2873
+ }, snapshotRefresh);
2874
+ if (process.env.NODE_ENV !== 'production') {
2875
+ if (snapshot.state !== 'Fulfilled') {
2876
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2877
+ }
2878
+ }
2879
+ deepFreeze(snapshot.data);
2880
+ return snapshot;
2881
+ }
2882
+ function ingestError$5(luvio, params, error, snapshotRefresh) {
2883
+ const key = keyBuilder$c(luvio, params);
2884
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2885
+ luvio.storeIngestError(key, errorSnapshot);
2886
+ return errorSnapshot;
2887
+ }
2888
+ function createResourceRequest$9(config) {
2889
+ const headers = {};
2890
+ return {
2891
+ baseUri: '/services/data/v63.0',
2892
+ basePath: '/connect/slackbridge/conversation/messages',
2893
+ method: 'get',
2894
+ body: null,
2895
+ urlParams: {},
2896
+ queryParams: config.queryParams,
2897
+ headers,
2898
+ priority: 'normal',
2899
+ };
2900
+ }
2901
+
2902
+ const adapterName$9 = 'getSlackConversation';
2903
+ const getSlackConversation_ConfigPropertyMetadata = [
2904
+ generateParamConfigMetadata('channelId', false, 1 /* QueryParameter */, 0 /* String */),
2905
+ generateParamConfigMetadata('includeView', false, 1 /* QueryParameter */, 1 /* Boolean */),
2906
+ generateParamConfigMetadata('inclusive', false, 1 /* QueryParameter */, 1 /* Boolean */),
2907
+ generateParamConfigMetadata('latestMessageTs', false, 1 /* QueryParameter */, 0 /* String */),
2908
+ generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
2909
+ generateParamConfigMetadata('oldestMessageTs', false, 1 /* QueryParameter */, 0 /* String */),
2910
+ generateParamConfigMetadata('parentMessageTs', false, 1 /* QueryParameter */, 0 /* String */),
2911
+ generateParamConfigMetadata('relatedRecordId', false, 1 /* QueryParameter */, 0 /* String */),
2912
+ generateParamConfigMetadata('teamId', false, 1 /* QueryParameter */, 0 /* String */),
2913
+ ];
2914
+ const getSlackConversation_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$9, getSlackConversation_ConfigPropertyMetadata);
2915
+ const createResourceParams$9 = /*#__PURE__*/ createResourceParams$c(getSlackConversation_ConfigPropertyMetadata);
2916
+ function keyBuilder$b(luvio, config) {
2917
+ const resourceParams = createResourceParams$9(config);
2918
+ return keyBuilder$c(luvio, resourceParams);
2919
+ }
2920
+ function typeCheckConfig$9(untrustedConfig) {
2921
+ const config = {};
2922
+ typeCheckConfig$c(untrustedConfig, config, getSlackConversation_ConfigPropertyMetadata);
2923
+ return config;
2924
+ }
2925
+ function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
2926
+ if (!untrustedIsObject(untrustedConfig)) {
2927
+ return null;
2928
+ }
2929
+ if (process.env.NODE_ENV !== 'production') {
2930
+ validateConfig(untrustedConfig, configPropertyNames);
2931
+ }
2932
+ const config = typeCheckConfig$9(untrustedConfig);
2933
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2934
+ return null;
2935
+ }
2936
+ return config;
2937
+ }
2938
+ function adapterFragment$5(luvio, config) {
2939
+ createResourceParams$9(config);
2940
+ return select$d();
2941
+ }
2942
+ function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
2943
+ const snapshot = ingestSuccess$9(luvio, resourceParams, response, {
2944
+ config,
2945
+ resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
2946
+ });
2947
+ return luvio.storeBroadcast().then(() => snapshot);
2948
+ }
2949
+ function onFetchResponseError$5(luvio, config, resourceParams, response) {
2950
+ const snapshot = ingestError$5(luvio, resourceParams, response, {
2951
+ config,
2952
+ resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
2953
+ });
2954
+ return luvio.storeBroadcast().then(() => snapshot);
2955
+ }
2956
+ function buildNetworkSnapshot$9(luvio, config, options) {
2957
+ const resourceParams = createResourceParams$9(config);
2958
+ const request = createResourceRequest$9(resourceParams);
2959
+ return luvio.dispatchResourceRequest(request, options)
2960
+ .then((response) => {
2961
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
2962
+ const cache = new StoreKeyMap();
2963
+ getResponseCacheKeys$9(cache, luvio, resourceParams, response.body);
2964
+ return cache;
2965
+ });
2966
+ }, (response) => {
2967
+ return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
2968
+ });
2969
+ }
2970
+ function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
2971
+ return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$9, undefined, false);
2972
+ }
2973
+ function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
2974
+ const { luvio, config } = context;
2975
+ const selector = {
2976
+ recordId: keyBuilder$b(luvio, config),
2977
+ node: adapterFragment$5(luvio, config),
2978
+ variables: {},
2979
+ };
2980
+ const cacheSnapshot = storeLookup(selector, {
2981
+ config,
2982
+ resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
2983
+ });
2984
+ return cacheSnapshot;
2985
+ }
2986
+ const getSlackConversationAdapterFactory = (luvio) => function SlackBridge__getSlackConversation(untrustedConfig, requestContext) {
2987
+ const config = validateAdapterConfig$9(untrustedConfig, getSlackConversation_ConfigPropertyNames);
2988
+ // Invalid or incomplete config
2989
+ if (config === null) {
2990
+ return null;
2991
+ }
2992
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2993
+ buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
2994
+ };
2995
+
2996
+ const VERSION$3 = "8eb41a29d901a4cc9611e387d180f0da";
2997
+ function validate$3(obj, path = 'SlackBridgeCustomEmojisOutputRepresentation') {
2998
+ const v_error = (() => {
2999
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3000
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3001
+ }
3002
+ const obj_customEmojis = obj.customEmojis;
3003
+ const path_customEmojis = path + '.customEmojis';
3004
+ if (typeof obj_customEmojis !== 'object' || ArrayIsArray(obj_customEmojis) || obj_customEmojis === null) {
3005
+ return new TypeError('Expected "object" but received "' + typeof obj_customEmojis + '" (at "' + path_customEmojis + '")');
3006
+ }
3007
+ const obj_customEmojis_keys = ObjectKeys(obj_customEmojis);
3008
+ for (let i = 0; i < obj_customEmojis_keys.length; i++) {
3009
+ const key = obj_customEmojis_keys[i];
3010
+ const obj_customEmojis_prop = obj_customEmojis[key];
3011
+ const path_customEmojis_prop = path_customEmojis + '["' + key + '"]';
3012
+ if (typeof obj_customEmojis_prop !== 'string') {
3013
+ return new TypeError('Expected "string" but received "' + typeof obj_customEmojis_prop + '" (at "' + path_customEmojis_prop + '")');
3014
+ }
3015
+ }
3016
+ const obj_teamId = obj.teamId;
3017
+ const path_teamId = path + '.teamId';
3018
+ if (typeof obj_teamId !== 'string') {
3019
+ return new TypeError('Expected "string" but received "' + typeof obj_teamId + '" (at "' + path_teamId + '")');
3020
+ }
3021
+ })();
3022
+ return v_error === undefined ? null : v_error;
3023
+ }
3024
+ const RepresentationType$3 = 'SlackBridgeCustomEmojisOutputRepresentation';
3025
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
3026
+ return input;
3027
+ }
3028
+ const select$c = function SlackBridgeCustomEmojisOutputRepresentationSelect() {
3029
+ return {
3030
+ kind: 'Fragment',
3031
+ version: VERSION$3,
3032
+ private: [],
3033
+ selections: [
3034
+ {
3035
+ name: 'customEmojis',
3036
+ kind: 'Scalar',
3037
+ map: true
3038
+ },
3039
+ {
3040
+ name: 'teamId',
3041
+ kind: 'Scalar'
3042
+ }
3043
+ ]
3044
+ };
3045
+ };
3046
+ function equals$3(existing, incoming) {
3047
+ const existing_teamId = existing.teamId;
3048
+ const incoming_teamId = incoming.teamId;
3049
+ if (!(existing_teamId === incoming_teamId)) {
3050
+ return false;
3051
+ }
3052
+ const existing_customEmojis = existing.customEmojis;
3053
+ const incoming_customEmojis = incoming.customEmojis;
3054
+ const equals_customEmojis_props = equalsObject(existing_customEmojis, incoming_customEmojis, (existing_customEmojis_prop, incoming_customEmojis_prop) => {
3055
+ if (!(existing_customEmojis_prop === incoming_customEmojis_prop)) {
3056
+ return false;
3057
+ }
3058
+ });
3059
+ if (equals_customEmojis_props === false) {
3060
+ return false;
3061
+ }
3062
+ return true;
3063
+ }
3064
+ const ingest$3 = function SlackBridgeCustomEmojisOutputRepresentationIngest(input, path, luvio, store, timestamp) {
3065
+ if (process.env.NODE_ENV !== 'production') {
3066
+ const validateError = validate$3(input);
3067
+ if (validateError !== null) {
3068
+ throw validateError;
3069
+ }
3070
+ }
3071
+ const key = path.fullPath;
3072
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
3073
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "SlackBridge", VERSION$3, RepresentationType$3, equals$3);
3074
+ return createLink(key);
3075
+ };
3076
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
3077
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3078
+ const rootKey = fullPathFactory();
3079
+ rootKeySet.set(rootKey, {
3080
+ namespace: keyPrefix,
3081
+ representationName: RepresentationType$3,
3082
+ mergeable: false
3083
+ });
3084
+ }
3085
+
3086
+ function select$b(luvio, params) {
3087
+ return select$c();
3088
+ }
3089
+ function keyBuilder$a(luvio, params) {
3090
+ return keyPrefix + '::SlackBridgeCustomEmojisOutputRepresentation:(' + 'teamId:' + params.urlParams.teamId + ')';
3091
+ }
3092
+ function getResponseCacheKeys$8(storeKeyMap, luvio, resourceParams, response) {
3093
+ getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$a(luvio, resourceParams));
3094
+ }
3095
+ function ingestSuccess$8(luvio, resourceParams, response, snapshotRefresh) {
3096
+ const { body } = response;
3097
+ const key = keyBuilder$a(luvio, resourceParams);
3098
+ luvio.storeIngest(key, ingest$3, body);
3099
+ const snapshot = luvio.storeLookup({
3100
+ recordId: key,
3101
+ node: select$b(),
3102
+ variables: {},
3103
+ }, snapshotRefresh);
3104
+ if (process.env.NODE_ENV !== 'production') {
3105
+ if (snapshot.state !== 'Fulfilled') {
3106
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3107
+ }
3108
+ }
3109
+ deepFreeze(snapshot.data);
3110
+ return snapshot;
3111
+ }
3112
+ function ingestError$4(luvio, params, error, snapshotRefresh) {
3113
+ const key = keyBuilder$a(luvio, params);
3114
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3115
+ luvio.storeIngestError(key, errorSnapshot);
3116
+ return errorSnapshot;
3117
+ }
3118
+ function createResourceRequest$8(config) {
3119
+ const headers = {};
3120
+ return {
3121
+ baseUri: '/services/data/v63.0',
3122
+ basePath: '/connect/slackbridge/team/' + config.urlParams.teamId + '/emojis',
3123
+ method: 'get',
3124
+ body: null,
3125
+ urlParams: config.urlParams,
3126
+ queryParams: {},
3127
+ headers,
3128
+ priority: 'normal',
3129
+ };
3130
+ }
3131
+
3132
+ const adapterName$8 = 'getSlackCustomEmoji';
3133
+ const getSlackCustomEmoji_ConfigPropertyMetadata = [
3134
+ generateParamConfigMetadata('teamId', true, 0 /* UrlParameter */, 0 /* String */),
3135
+ ];
3136
+ const getSlackCustomEmoji_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$8, getSlackCustomEmoji_ConfigPropertyMetadata);
3137
+ const createResourceParams$8 = /*#__PURE__*/ createResourceParams$c(getSlackCustomEmoji_ConfigPropertyMetadata);
3138
+ function keyBuilder$9(luvio, config) {
3139
+ const resourceParams = createResourceParams$8(config);
3140
+ return keyBuilder$a(luvio, resourceParams);
3141
+ }
3142
+ function typeCheckConfig$8(untrustedConfig) {
3143
+ const config = {};
3144
+ typeCheckConfig$c(untrustedConfig, config, getSlackCustomEmoji_ConfigPropertyMetadata);
3145
+ return config;
3146
+ }
3147
+ function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
3148
+ if (!untrustedIsObject(untrustedConfig)) {
3149
+ return null;
3150
+ }
3151
+ if (process.env.NODE_ENV !== 'production') {
3152
+ validateConfig(untrustedConfig, configPropertyNames);
3153
+ }
3154
+ const config = typeCheckConfig$8(untrustedConfig);
3155
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3156
+ return null;
3157
+ }
3158
+ return config;
3159
+ }
3160
+ function adapterFragment$4(luvio, config) {
3161
+ createResourceParams$8(config);
3162
+ return select$b();
3163
+ }
3164
+ function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
3165
+ const snapshot = ingestSuccess$8(luvio, resourceParams, response, {
3166
+ config,
3167
+ resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
3168
+ });
3169
+ return luvio.storeBroadcast().then(() => snapshot);
3170
+ }
3171
+ function onFetchResponseError$4(luvio, config, resourceParams, response) {
3172
+ const snapshot = ingestError$4(luvio, resourceParams, response, {
3173
+ config,
3174
+ resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
3175
+ });
3176
+ return luvio.storeBroadcast().then(() => snapshot);
3177
+ }
3178
+ function buildNetworkSnapshot$8(luvio, config, options) {
3179
+ const resourceParams = createResourceParams$8(config);
3180
+ const request = createResourceRequest$8(resourceParams);
3181
+ return luvio.dispatchResourceRequest(request, options)
3182
+ .then((response) => {
3183
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
3184
+ const cache = new StoreKeyMap();
3185
+ getResponseCacheKeys$8(cache, luvio, resourceParams, response.body);
3186
+ return cache;
3187
+ });
3188
+ }, (response) => {
3189
+ return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
3190
+ });
3191
+ }
3192
+ function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
3193
+ return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$8, undefined, false);
3194
+ }
3195
+ function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
3196
+ const { luvio, config } = context;
3197
+ const selector = {
3198
+ recordId: keyBuilder$9(luvio, config),
3199
+ node: adapterFragment$4(luvio, config),
3200
+ variables: {},
3201
+ };
3202
+ const cacheSnapshot = storeLookup(selector, {
3203
+ config,
3204
+ resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
3205
+ });
3206
+ return cacheSnapshot;
3207
+ }
3208
+ const getSlackCustomEmojiAdapterFactory = (luvio) => function SlackBridge__getSlackCustomEmoji(untrustedConfig, requestContext) {
3209
+ const config = validateAdapterConfig$8(untrustedConfig, getSlackCustomEmoji_ConfigPropertyNames);
3210
+ // Invalid or incomplete config
3211
+ if (config === null) {
3212
+ return null;
3213
+ }
3214
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3215
+ buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
3216
+ };
3217
+
3218
+ function select$a(luvio, params) {
3219
+ return select$q();
3220
+ }
3221
+ function keyBuilder$8(luvio, params) {
3222
+ return keyBuilder$i(luvio, {
3223
+ channelId: params.urlParams.channelId
3224
+ });
3225
+ }
3226
+ function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
3227
+ getTypeCacheKeys$a(storeKeyMap, luvio, response);
3228
+ }
3229
+ function ingestSuccess$7(luvio, resourceParams, response, snapshotRefresh) {
3230
+ const { body } = response;
3231
+ const key = keyBuilder$8(luvio, resourceParams);
3232
+ luvio.storeIngest(key, ingest$a, body);
3233
+ const snapshot = luvio.storeLookup({
3234
+ recordId: key,
3235
+ node: select$a(),
3236
+ variables: {},
3237
+ }, snapshotRefresh);
3238
+ if (process.env.NODE_ENV !== 'production') {
3239
+ if (snapshot.state !== 'Fulfilled') {
3240
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3241
+ }
3242
+ }
3243
+ deepFreeze(snapshot.data);
3244
+ return snapshot;
3245
+ }
3246
+ function ingestError$3(luvio, params, error, snapshotRefresh) {
3247
+ const key = keyBuilder$8(luvio, params);
3248
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3249
+ luvio.storeIngestError(key, errorSnapshot);
3250
+ return errorSnapshot;
3251
+ }
3252
+ function createResourceRequest$7(config) {
3253
+ const headers = {};
3254
+ return {
3255
+ baseUri: '/services/data/v63.0',
3256
+ basePath: '/connect/slackbridge/team/' + config.urlParams.teamId + '/channel/' + config.urlParams.channelId + '/messages/' + config.urlParams.messageTs + '',
3257
+ method: 'get',
3258
+ body: null,
3259
+ urlParams: config.urlParams,
3260
+ queryParams: {},
3261
+ headers,
3262
+ priority: 'normal',
3263
+ };
3264
+ }
3265
+ function createResourceRequestFromRepresentation$1(representation) {
3266
+ const config = {
3267
+ urlParams: {},
3268
+ };
3269
+ config.urlParams.channelId = representation.channelId;
3270
+ return createResourceRequest$7(config);
3271
+ }
3272
+
3273
+ const adapterName$7 = 'getSlackMessage';
3274
+ const getSlackMessage_ConfigPropertyMetadata = [
3275
+ generateParamConfigMetadata('channelId', true, 0 /* UrlParameter */, 0 /* String */),
3276
+ generateParamConfigMetadata('messageTs', true, 0 /* UrlParameter */, 0 /* String */),
3277
+ generateParamConfigMetadata('teamId', true, 0 /* UrlParameter */, 0 /* String */),
3278
+ ];
3279
+ const getSlackMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, getSlackMessage_ConfigPropertyMetadata);
3280
+ const createResourceParams$7 = /*#__PURE__*/ createResourceParams$c(getSlackMessage_ConfigPropertyMetadata);
3281
+ function keyBuilder$7(luvio, config) {
3282
+ const resourceParams = createResourceParams$7(config);
3283
+ return keyBuilder$8(luvio, resourceParams);
3284
+ }
3285
+ function typeCheckConfig$7(untrustedConfig) {
3286
+ const config = {};
3287
+ typeCheckConfig$c(untrustedConfig, config, getSlackMessage_ConfigPropertyMetadata);
3288
+ return config;
3289
+ }
3290
+ function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
3291
+ if (!untrustedIsObject(untrustedConfig)) {
3292
+ return null;
3293
+ }
3294
+ if (process.env.NODE_ENV !== 'production') {
3295
+ validateConfig(untrustedConfig, configPropertyNames);
3296
+ }
3297
+ const config = typeCheckConfig$7(untrustedConfig);
3298
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3299
+ return null;
3300
+ }
3301
+ return config;
3302
+ }
3303
+ function adapterFragment$3(luvio, config) {
3304
+ createResourceParams$7(config);
3305
+ return select$a();
3306
+ }
3307
+ function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
3308
+ const snapshot = ingestSuccess$7(luvio, resourceParams, response, {
3309
+ config,
3310
+ resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
3311
+ });
3312
+ return luvio.storeBroadcast().then(() => snapshot);
3313
+ }
3314
+ function onFetchResponseError$3(luvio, config, resourceParams, response) {
3315
+ const snapshot = ingestError$3(luvio, resourceParams, response, {
3316
+ config,
3317
+ resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
3318
+ });
3319
+ return luvio.storeBroadcast().then(() => snapshot);
3320
+ }
3321
+ function buildNetworkSnapshot$7(luvio, config, options) {
3322
+ const resourceParams = createResourceParams$7(config);
3323
+ const request = createResourceRequest$7(resourceParams);
3324
+ return luvio.dispatchResourceRequest(request, options)
3325
+ .then((response) => {
3326
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
3327
+ const cache = new StoreKeyMap();
3328
+ getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
3329
+ return cache;
3330
+ });
3331
+ }, (response) => {
3332
+ return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
3333
+ });
3334
+ }
3335
+ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
3336
+ return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$7, undefined, false);
3337
+ }
3338
+ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
3339
+ const { luvio, config } = context;
3340
+ const selector = {
3341
+ recordId: keyBuilder$7(luvio, config),
3342
+ node: adapterFragment$3(luvio, config),
3343
+ variables: {},
3344
+ };
3345
+ const cacheSnapshot = storeLookup(selector, {
3346
+ config,
3347
+ resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
3348
+ });
3349
+ return cacheSnapshot;
3350
+ }
3351
+ const getSlackMessageAdapterFactory = (luvio) => function SlackBridge__getSlackMessage(untrustedConfig, requestContext) {
3352
+ const config = validateAdapterConfig$7(untrustedConfig, getSlackMessage_ConfigPropertyNames);
3353
+ // Invalid or incomplete config
3354
+ if (config === null) {
3355
+ return null;
3356
+ }
3357
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3358
+ buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
3359
+ };
3360
+ const notifyChangeFactory$1 = (luvio, options) => {
3361
+ return function getConnectSlackbridgeTeamChannelMessagesByChannelIdAndMessageTsAndTeamIdNotifyChange(configs) {
3362
+ const keys = configs.map(c => keyBuilder$i(luvio, c));
3363
+ luvio.getNotifyChangeStoreEntries(keys).then(entries => {
3364
+ for (let i = 0, len = entries.length; i < len; i++) {
3365
+ const { key, record: val } = entries[i];
3366
+ const refreshRequest = createResourceRequestFromRepresentation$1(val);
3367
+ luvio.dispatchResourceRequest(refreshRequest, options)
3368
+ .then((response) => {
3369
+ return luvio.handleSuccessResponse(() => {
3370
+ const { body } = response;
3371
+ luvio.storeIngest(key, ingest$a, body);
3372
+ return luvio.storeBroadcast();
3373
+ }, () => {
3374
+ const cache = new StoreKeyMap();
3375
+ getTypeCacheKeys$a(cache, luvio, response.body);
3376
+ return cache;
3377
+ });
3378
+ }, (error) => {
3379
+ return luvio.handleErrorResponse(() => {
3380
+ const errorSnapshot = luvio.errorSnapshot(error);
3381
+ luvio.storeIngestError(key, errorSnapshot, undefined);
3382
+ return luvio.storeBroadcast().then(() => errorSnapshot);
3383
+ });
3384
+ });
3385
+ }
3386
+ });
3387
+ };
3388
+ };
3389
+
3390
+ const VERSION$2 = "071d815d304929393ef8cec1c66123dd";
3391
+ function validate$2(obj, path = 'SlackBridgeEmojisOutputRepresentation') {
3392
+ const v_error = (() => {
3393
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3394
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3395
+ }
3396
+ const obj_emojis = obj.emojis;
3397
+ const path_emojis = path + '.emojis';
3398
+ if (!ArrayIsArray(obj_emojis)) {
3399
+ return new TypeError('Expected "array" but received "' + typeof obj_emojis + '" (at "' + path_emojis + '")');
3400
+ }
3401
+ for (let i = 0; i < obj_emojis.length; i++) {
3402
+ const obj_emojis_item = obj_emojis[i];
3403
+ const path_emojis_item = path_emojis + '[' + i + ']';
3404
+ const referencepath_emojis_itemValidationError = validate$c(obj_emojis_item, path_emojis_item);
3405
+ if (referencepath_emojis_itemValidationError !== null) {
3406
+ let message = 'Object doesn\'t match SlackBridgeEmojiOutputRepresentation (at "' + path_emojis_item + '")\n';
3407
+ message += referencepath_emojis_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3408
+ return new TypeError(message);
3409
+ }
3410
+ }
3411
+ const obj_searchString = obj.searchString;
3412
+ const path_searchString = path + '.searchString';
3413
+ if (typeof obj_searchString !== 'string') {
3414
+ return new TypeError('Expected "string" but received "' + typeof obj_searchString + '" (at "' + path_searchString + '")');
3415
+ }
3416
+ })();
3417
+ return v_error === undefined ? null : v_error;
3418
+ }
3419
+ const RepresentationType$2 = 'SlackBridgeEmojisOutputRepresentation';
3420
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
3421
+ return input;
3422
+ }
3423
+ const select$9 = function SlackBridgeEmojisOutputRepresentationSelect() {
3424
+ const { selections: SlackBridgeEmojiOutputRepresentation__selections, opaque: SlackBridgeEmojiOutputRepresentation__opaque, } = select$m();
3425
+ return {
3426
+ kind: 'Fragment',
3427
+ version: VERSION$2,
3428
+ private: [],
3429
+ selections: [
3430
+ {
3431
+ name: 'emojis',
3432
+ kind: 'Object',
3433
+ plural: true,
3434
+ selections: SlackBridgeEmojiOutputRepresentation__selections
3435
+ },
3436
+ {
3437
+ name: 'searchString',
3438
+ kind: 'Scalar'
3439
+ }
3440
+ ]
3441
+ };
3442
+ };
3443
+ function equals$2(existing, incoming) {
3444
+ const existing_searchString = existing.searchString;
3445
+ const incoming_searchString = incoming.searchString;
3446
+ if (!(existing_searchString === incoming_searchString)) {
3447
+ return false;
3448
+ }
3449
+ const existing_emojis = existing.emojis;
3450
+ const incoming_emojis = incoming.emojis;
3451
+ const equals_emojis_items = equalsArray(existing_emojis, incoming_emojis, (existing_emojis_item, incoming_emojis_item) => {
3452
+ if (!(equals$c(existing_emojis_item, incoming_emojis_item))) {
3453
+ return false;
3454
+ }
3455
+ });
3456
+ if (equals_emojis_items === false) {
3457
+ return false;
3458
+ }
3459
+ return true;
3460
+ }
3461
+ const ingest$2 = function SlackBridgeEmojisOutputRepresentationIngest(input, path, luvio, store, timestamp) {
3462
+ if (process.env.NODE_ENV !== 'production') {
3463
+ const validateError = validate$2(input);
3464
+ if (validateError !== null) {
3465
+ throw validateError;
3466
+ }
3467
+ }
3468
+ const key = path.fullPath;
3469
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
3470
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "SlackBridge", VERSION$2, RepresentationType$2, equals$2);
3471
+ return createLink(key);
3472
+ };
3473
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
3474
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3475
+ const rootKey = fullPathFactory();
3476
+ rootKeySet.set(rootKey, {
3477
+ namespace: keyPrefix,
3478
+ representationName: RepresentationType$2,
3479
+ mergeable: false
3480
+ });
3481
+ }
3482
+
3483
+ function select$8(luvio, params) {
3484
+ return select$9();
3485
+ }
3486
+ function keyBuilder$6(luvio, params) {
3487
+ return keyPrefix + '::SlackBridgeEmojisOutputRepresentation:(' + 'search:' + params.queryParams.search + ',' + 'teamId:' + params.urlParams.teamId + ')';
3488
+ }
3489
+ function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
3490
+ getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$6(luvio, resourceParams));
3491
+ }
3492
+ function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
3493
+ const { body } = response;
3494
+ const key = keyBuilder$6(luvio, resourceParams);
3495
+ luvio.storeIngest(key, ingest$2, body);
3496
+ const snapshot = luvio.storeLookup({
3497
+ recordId: key,
3498
+ node: select$8(),
3499
+ variables: {},
3500
+ }, snapshotRefresh);
3501
+ if (process.env.NODE_ENV !== 'production') {
3502
+ if (snapshot.state !== 'Fulfilled') {
3503
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3504
+ }
3505
+ }
3506
+ deepFreeze(snapshot.data);
3507
+ return snapshot;
3508
+ }
3509
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
3510
+ const key = keyBuilder$6(luvio, params);
3511
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3512
+ luvio.storeIngestError(key, errorSnapshot);
3513
+ return errorSnapshot;
3514
+ }
3515
+ function createResourceRequest$6(config) {
3516
+ const headers = {};
3517
+ return {
3518
+ baseUri: '/services/data/v63.0',
3519
+ basePath: '/connect/slackbridge/team/' + config.urlParams.teamId + '/search/emojis',
3520
+ method: 'get',
3521
+ body: null,
3522
+ urlParams: config.urlParams,
3523
+ queryParams: config.queryParams,
3524
+ headers,
3525
+ priority: 'normal',
3526
+ };
3527
+ }
3528
+
3529
+ const adapterName$6 = 'getSlackSearchEmoji';
3530
+ const getSlackSearchEmoji_ConfigPropertyMetadata = [
3531
+ generateParamConfigMetadata('teamId', true, 0 /* UrlParameter */, 0 /* String */),
3532
+ generateParamConfigMetadata('search', false, 1 /* QueryParameter */, 0 /* String */),
3533
+ ];
3534
+ const getSlackSearchEmoji_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getSlackSearchEmoji_ConfigPropertyMetadata);
3535
+ const createResourceParams$6 = /*#__PURE__*/ createResourceParams$c(getSlackSearchEmoji_ConfigPropertyMetadata);
3536
+ function keyBuilder$5(luvio, config) {
3537
+ const resourceParams = createResourceParams$6(config);
3538
+ return keyBuilder$6(luvio, resourceParams);
3539
+ }
3540
+ function typeCheckConfig$6(untrustedConfig) {
3541
+ const config = {};
3542
+ typeCheckConfig$c(untrustedConfig, config, getSlackSearchEmoji_ConfigPropertyMetadata);
3543
+ return config;
3544
+ }
3545
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
3546
+ if (!untrustedIsObject(untrustedConfig)) {
3547
+ return null;
3548
+ }
3549
+ if (process.env.NODE_ENV !== 'production') {
3550
+ validateConfig(untrustedConfig, configPropertyNames);
3551
+ }
3552
+ const config = typeCheckConfig$6(untrustedConfig);
3553
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3554
+ return null;
3555
+ }
3556
+ return config;
3557
+ }
3558
+ function adapterFragment$2(luvio, config) {
3559
+ createResourceParams$6(config);
3560
+ return select$8();
3561
+ }
3562
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
3563
+ const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
3564
+ config,
3565
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
3566
+ });
3567
+ return luvio.storeBroadcast().then(() => snapshot);
3568
+ }
3569
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
3570
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
3571
+ config,
3572
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
3573
+ });
3574
+ return luvio.storeBroadcast().then(() => snapshot);
3575
+ }
3576
+ function buildNetworkSnapshot$6(luvio, config, options) {
3577
+ const resourceParams = createResourceParams$6(config);
3578
+ const request = createResourceRequest$6(resourceParams);
3579
+ return luvio.dispatchResourceRequest(request, options)
3580
+ .then((response) => {
3581
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
3582
+ const cache = new StoreKeyMap();
3583
+ getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
3584
+ return cache;
3585
+ });
3586
+ }, (response) => {
3587
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
3588
+ });
3589
+ }
3590
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
3591
+ return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
3592
+ }
3593
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
3594
+ const { luvio, config } = context;
3595
+ const selector = {
3596
+ recordId: keyBuilder$5(luvio, config),
3597
+ node: adapterFragment$2(luvio, config),
3598
+ variables: {},
3599
+ };
3600
+ const cacheSnapshot = storeLookup(selector, {
3601
+ config,
3602
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
3603
+ });
3604
+ return cacheSnapshot;
3605
+ }
3606
+ const getSlackSearchEmojiAdapterFactory = (luvio) => function SlackBridge__getSlackSearchEmoji(untrustedConfig, requestContext) {
3607
+ const config = validateAdapterConfig$6(untrustedConfig, getSlackSearchEmoji_ConfigPropertyNames);
3608
+ // Invalid or incomplete config
3609
+ if (config === null) {
3610
+ return null;
3611
+ }
3612
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3613
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
3614
+ };
3615
+
3616
+ const VERSION$1 = "a34bf4d8d78f6cfc1c3ff193ce06f673";
3617
+ function validate$1(obj, path = 'SlackBridgeUserInfosOutputRepresentation') {
3618
+ const v_error = (() => {
3619
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3620
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3621
+ }
3622
+ const obj_searchString = obj.searchString;
3623
+ const path_searchString = path + '.searchString';
3624
+ if (typeof obj_searchString !== 'string') {
3625
+ return new TypeError('Expected "string" but received "' + typeof obj_searchString + '" (at "' + path_searchString + '")');
3626
+ }
3627
+ const obj_userInfos = obj.userInfos;
3628
+ const path_userInfos = path + '.userInfos';
3629
+ if (!ArrayIsArray(obj_userInfos)) {
3630
+ return new TypeError('Expected "array" but received "' + typeof obj_userInfos + '" (at "' + path_userInfos + '")');
3631
+ }
3632
+ for (let i = 0; i < obj_userInfos.length; i++) {
3633
+ const obj_userInfos_item = obj_userInfos[i];
3634
+ const path_userInfos_item = path_userInfos + '[' + i + ']';
3635
+ if (typeof obj_userInfos_item !== 'object') {
3636
+ return new TypeError('Expected "object" but received "' + typeof obj_userInfos_item + '" (at "' + path_userInfos_item + '")');
3637
+ }
3638
+ }
3639
+ })();
3640
+ return v_error === undefined ? null : v_error;
3641
+ }
3642
+ const RepresentationType$1 = 'SlackBridgeUserInfosOutputRepresentation';
3643
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
3644
+ const input_userInfos = input.userInfos;
3645
+ const input_userInfos_id = path.fullPath + '__userInfos';
3646
+ for (let i = 0; i < input_userInfos.length; i++) {
3647
+ const input_userInfos_item = input_userInfos[i];
3648
+ let input_userInfos_item_id = input_userInfos_id + '__' + i;
3649
+ input_userInfos[i] = ingest$8(input_userInfos_item, {
3650
+ fullPath: input_userInfos_item_id,
3651
+ propertyName: i,
3652
+ parent: {
3653
+ data: input,
3654
+ key: path.fullPath,
3655
+ existing: existing,
3656
+ },
3657
+ ttl: path.ttl
3658
+ }, luvio, store, timestamp);
3659
+ }
3660
+ return input;
3661
+ }
3662
+ const select$7 = function SlackBridgeUserInfosOutputRepresentationSelect() {
3663
+ return {
3664
+ kind: 'Fragment',
3665
+ version: VERSION$1,
3666
+ private: [],
3667
+ selections: [
3668
+ {
3669
+ name: 'searchString',
3670
+ kind: 'Scalar'
3671
+ },
3672
+ {
3673
+ name: 'userInfos',
3674
+ kind: 'Link',
3675
+ plural: true,
3676
+ fragment: select$l()
3677
+ }
3678
+ ]
3679
+ };
3680
+ };
3681
+ function equals$1(existing, incoming) {
3682
+ const existing_searchString = existing.searchString;
3683
+ const incoming_searchString = incoming.searchString;
3684
+ if (!(existing_searchString === incoming_searchString)) {
3685
+ return false;
3686
+ }
3687
+ const existing_userInfos = existing.userInfos;
3688
+ const incoming_userInfos = incoming.userInfos;
3689
+ const equals_userInfos_items = equalsArray(existing_userInfos, incoming_userInfos, (existing_userInfos_item, incoming_userInfos_item) => {
3690
+ if (!(existing_userInfos_item.__ref === incoming_userInfos_item.__ref)) {
3691
+ return false;
3692
+ }
3693
+ });
3694
+ if (equals_userInfos_items === false) {
3695
+ return false;
3696
+ }
3697
+ return true;
3698
+ }
3699
+ const ingest$1 = function SlackBridgeUserInfosOutputRepresentationIngest(input, path, luvio, store, timestamp) {
3700
+ if (process.env.NODE_ENV !== 'production') {
3701
+ const validateError = validate$1(input);
3702
+ if (validateError !== null) {
3703
+ throw validateError;
3704
+ }
3705
+ }
3706
+ const key = path.fullPath;
3707
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
3708
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "SlackBridge", VERSION$1, RepresentationType$1, equals$1);
3709
+ return createLink(key);
3710
+ };
3711
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
3712
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3713
+ const rootKey = fullPathFactory();
3714
+ rootKeySet.set(rootKey, {
3715
+ namespace: keyPrefix,
3716
+ representationName: RepresentationType$1,
3717
+ mergeable: false
3718
+ });
3719
+ const input_userInfos_length = input.userInfos.length;
3720
+ for (let i = 0; i < input_userInfos_length; i++) {
3721
+ getTypeCacheKeys$8(rootKeySet, luvio, input.userInfos[i]);
3722
+ }
3723
+ }
3724
+
3725
+ function select$6(luvio, params) {
3726
+ return select$7();
3727
+ }
3728
+ function keyBuilder$4(luvio, params) {
3729
+ return keyPrefix + '::SlackBridgeUserInfosOutputRepresentation:(' + 'search:' + params.queryParams.search + ',' + 'teamId:' + params.urlParams.teamId + ')';
3730
+ }
3731
+ function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
3732
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
3733
+ }
3734
+ function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
3735
+ const { body } = response;
3736
+ const key = keyBuilder$4(luvio, resourceParams);
3737
+ luvio.storeIngest(key, ingest$1, body);
3738
+ const snapshot = luvio.storeLookup({
3739
+ recordId: key,
3740
+ node: select$6(),
3741
+ variables: {},
3742
+ }, snapshotRefresh);
3743
+ if (process.env.NODE_ENV !== 'production') {
3744
+ if (snapshot.state !== 'Fulfilled') {
3745
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3746
+ }
3747
+ }
3748
+ deepFreeze(snapshot.data);
3749
+ return snapshot;
3750
+ }
3751
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
3752
+ const key = keyBuilder$4(luvio, params);
3753
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3754
+ luvio.storeIngestError(key, errorSnapshot);
3755
+ return errorSnapshot;
3756
+ }
3757
+ function createResourceRequest$5(config) {
3758
+ const headers = {};
3759
+ return {
3760
+ baseUri: '/services/data/v63.0',
3761
+ basePath: '/connect/slackbridge/team/' + config.urlParams.teamId + '/search/users',
3762
+ method: 'get',
3763
+ body: null,
3764
+ urlParams: config.urlParams,
3765
+ queryParams: config.queryParams,
3766
+ headers,
3767
+ priority: 'normal',
3768
+ };
3769
+ }
3770
+
3771
+ const adapterName$5 = 'getSlackSearchUser';
3772
+ const getSlackSearchUser_ConfigPropertyMetadata = [
3773
+ generateParamConfigMetadata('teamId', true, 0 /* UrlParameter */, 0 /* String */),
3774
+ generateParamConfigMetadata('search', false, 1 /* QueryParameter */, 0 /* String */),
3775
+ ];
3776
+ const getSlackSearchUser_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getSlackSearchUser_ConfigPropertyMetadata);
3777
+ const createResourceParams$5 = /*#__PURE__*/ createResourceParams$c(getSlackSearchUser_ConfigPropertyMetadata);
3778
+ function keyBuilder$3(luvio, config) {
3779
+ const resourceParams = createResourceParams$5(config);
3780
+ return keyBuilder$4(luvio, resourceParams);
3781
+ }
3782
+ function typeCheckConfig$5(untrustedConfig) {
3783
+ const config = {};
3784
+ typeCheckConfig$c(untrustedConfig, config, getSlackSearchUser_ConfigPropertyMetadata);
3785
+ return config;
3786
+ }
3787
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
3788
+ if (!untrustedIsObject(untrustedConfig)) {
3789
+ return null;
3790
+ }
3791
+ if (process.env.NODE_ENV !== 'production') {
3792
+ validateConfig(untrustedConfig, configPropertyNames);
3793
+ }
3794
+ const config = typeCheckConfig$5(untrustedConfig);
3795
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3796
+ return null;
3797
+ }
3798
+ return config;
3799
+ }
3800
+ function adapterFragment$1(luvio, config) {
3801
+ createResourceParams$5(config);
3802
+ return select$6();
3803
+ }
3804
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
3805
+ const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
3806
+ config,
3807
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
3808
+ });
3809
+ return luvio.storeBroadcast().then(() => snapshot);
3810
+ }
3811
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
3812
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
3813
+ config,
3814
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
3815
+ });
3816
+ return luvio.storeBroadcast().then(() => snapshot);
3817
+ }
3818
+ function buildNetworkSnapshot$5(luvio, config, options) {
3819
+ const resourceParams = createResourceParams$5(config);
3820
+ const request = createResourceRequest$5(resourceParams);
3821
+ return luvio.dispatchResourceRequest(request, options)
3822
+ .then((response) => {
3823
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
3824
+ const cache = new StoreKeyMap();
3825
+ getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
3826
+ return cache;
3827
+ });
3828
+ }, (response) => {
3829
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
3830
+ });
3831
+ }
3832
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
3833
+ return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
3834
+ }
3835
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
3836
+ const { luvio, config } = context;
3837
+ const selector = {
3838
+ recordId: keyBuilder$3(luvio, config),
3839
+ node: adapterFragment$1(luvio, config),
3840
+ variables: {},
3841
+ };
3842
+ const cacheSnapshot = storeLookup(selector, {
3843
+ config,
3844
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
3845
+ });
3846
+ return cacheSnapshot;
3847
+ }
3848
+ const getSlackSearchUserAdapterFactory = (luvio) => function SlackBridge__getSlackSearchUser(untrustedConfig, requestContext) {
3849
+ const config = validateAdapterConfig$5(untrustedConfig, getSlackSearchUser_ConfigPropertyNames);
3850
+ // Invalid or incomplete config
3851
+ if (config === null) {
3852
+ return null;
3853
+ }
3854
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3855
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
3856
+ };
3857
+
3858
+ function select$5(luvio, params) {
3859
+ return select$l();
3860
+ }
3861
+ function keyBuilder$2(luvio, params) {
3862
+ return keyBuilder$e(luvio, {
3863
+ slackUserId: params.urlParams.slackUserId,
3864
+ teamId: params.urlParams.teamId
3865
+ });
3866
+ }
3867
+ function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
3868
+ getTypeCacheKeys$8(storeKeyMap, luvio, response);
3869
+ }
3870
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
3871
+ const { body } = response;
3872
+ const key = keyBuilder$2(luvio, resourceParams);
3873
+ luvio.storeIngest(key, ingest$8, body);
3874
+ const snapshot = luvio.storeLookup({
3875
+ recordId: key,
3876
+ node: select$5(),
3877
+ variables: {},
3878
+ }, snapshotRefresh);
3879
+ if (process.env.NODE_ENV !== 'production') {
3880
+ if (snapshot.state !== 'Fulfilled') {
3881
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3882
+ }
3883
+ }
3884
+ deepFreeze(snapshot.data);
3885
+ return snapshot;
3886
+ }
3887
+ function ingestError(luvio, params, error, snapshotRefresh) {
3888
+ const key = keyBuilder$2(luvio, params);
3889
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3890
+ const storeMetadataParams = {
3891
+ ttl: TTL,
3892
+ namespace: keyPrefix,
3893
+ version: VERSION$b,
3894
+ representationName: RepresentationType$8
3895
+ };
3896
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
3897
+ return errorSnapshot;
3898
+ }
3899
+ function createResourceRequest$4(config) {
3900
+ const headers = {};
3901
+ return {
3902
+ baseUri: '/services/data/v63.0',
3903
+ basePath: '/connect/slackbridge/team/' + config.urlParams.teamId + '/user/' + config.urlParams.slackUserId + '',
3904
+ method: 'get',
3905
+ body: null,
3906
+ urlParams: config.urlParams,
3907
+ queryParams: {},
3908
+ headers,
3909
+ priority: 'normal',
3910
+ };
3911
+ }
3912
+ function createResourceRequestFromRepresentation(representation) {
3913
+ const config = {
3914
+ urlParams: {},
3915
+ };
3916
+ config.urlParams.slackUserId = representation.slackUserId;
3917
+ config.urlParams.teamId = representation.teamId;
3918
+ return createResourceRequest$4(config);
3919
+ }
3920
+
3921
+ const adapterName$4 = 'getSlackUser';
3922
+ const getSlackUser_ConfigPropertyMetadata = [
3923
+ generateParamConfigMetadata('slackUserId', true, 0 /* UrlParameter */, 0 /* String */),
3924
+ generateParamConfigMetadata('teamId', true, 0 /* UrlParameter */, 0 /* String */),
3925
+ ];
3926
+ const getSlackUser_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getSlackUser_ConfigPropertyMetadata);
3927
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$c(getSlackUser_ConfigPropertyMetadata);
3928
+ function keyBuilder$1(luvio, config) {
3929
+ const resourceParams = createResourceParams$4(config);
3930
+ return keyBuilder$2(luvio, resourceParams);
3931
+ }
3932
+ function typeCheckConfig$4(untrustedConfig) {
3933
+ const config = {};
3934
+ typeCheckConfig$c(untrustedConfig, config, getSlackUser_ConfigPropertyMetadata);
3935
+ return config;
3936
+ }
3937
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
3938
+ if (!untrustedIsObject(untrustedConfig)) {
3939
+ return null;
3940
+ }
3941
+ if (process.env.NODE_ENV !== 'production') {
3942
+ validateConfig(untrustedConfig, configPropertyNames);
3943
+ }
3944
+ const config = typeCheckConfig$4(untrustedConfig);
3945
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3946
+ return null;
3947
+ }
3948
+ return config;
3949
+ }
3950
+ function adapterFragment(luvio, config) {
3951
+ createResourceParams$4(config);
3952
+ return select$5();
3953
+ }
3954
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
3955
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
3956
+ config,
3957
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
3958
+ });
3959
+ return luvio.storeBroadcast().then(() => snapshot);
3960
+ }
3961
+ function onFetchResponseError(luvio, config, resourceParams, response) {
3962
+ const snapshot = ingestError(luvio, resourceParams, response, {
3963
+ config,
3964
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
3965
+ });
3966
+ return luvio.storeBroadcast().then(() => snapshot);
3967
+ }
3968
+ function buildNetworkSnapshot$4(luvio, config, options) {
3969
+ const resourceParams = createResourceParams$4(config);
3970
+ const request = createResourceRequest$4(resourceParams);
3971
+ return luvio.dispatchResourceRequest(request, options)
3972
+ .then((response) => {
3973
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
3974
+ const cache = new StoreKeyMap();
3975
+ getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
3976
+ return cache;
3977
+ });
3978
+ }, (response) => {
3979
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
3980
+ });
3981
+ }
3982
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
3983
+ return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
3984
+ }
3985
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
3986
+ const { luvio, config } = context;
3987
+ const selector = {
3988
+ recordId: keyBuilder$1(luvio, config),
3989
+ node: adapterFragment(luvio, config),
3990
+ variables: {},
3991
+ };
3992
+ const cacheSnapshot = storeLookup(selector, {
3993
+ config,
3994
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
3995
+ });
3996
+ return cacheSnapshot;
3997
+ }
3998
+ const getSlackUserAdapterFactory = (luvio) => function SlackBridge__getSlackUser(untrustedConfig, requestContext) {
3999
+ const config = validateAdapterConfig$4(untrustedConfig, getSlackUser_ConfigPropertyNames);
4000
+ // Invalid or incomplete config
4001
+ if (config === null) {
4002
+ return null;
4003
+ }
4004
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
4005
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
4006
+ };
4007
+ const notifyChangeFactory = (luvio, options) => {
4008
+ return function getConnectSlackbridgeTeamUserBySlackUserIdAndTeamIdNotifyChange(configs) {
4009
+ const keys = configs.map(c => keyBuilder$e(luvio, c));
4010
+ luvio.getNotifyChangeStoreEntries(keys).then(entries => {
4011
+ for (let i = 0, len = entries.length; i < len; i++) {
4012
+ const { key, record: val } = entries[i];
4013
+ const refreshRequest = createResourceRequestFromRepresentation(val);
4014
+ luvio.dispatchResourceRequest(refreshRequest, options)
4015
+ .then((response) => {
4016
+ return luvio.handleSuccessResponse(() => {
4017
+ const { body } = response;
4018
+ luvio.storeIngest(key, ingest$8, body);
4019
+ return luvio.storeBroadcast();
4020
+ }, () => {
4021
+ const cache = new StoreKeyMap();
4022
+ getTypeCacheKeys$8(cache, luvio, response.body);
4023
+ return cache;
4024
+ });
4025
+ }, (error) => {
4026
+ return luvio.handleErrorResponse(() => {
4027
+ const errorSnapshot = luvio.errorSnapshot(error);
4028
+ luvio.storeIngestError(key, errorSnapshot, {
4029
+ ttl: TTL,
4030
+ namespace: keyPrefix,
4031
+ version: VERSION$b,
4032
+ representationName: RepresentationType$8
4033
+ });
4034
+ return luvio.storeBroadcast().then(() => errorSnapshot);
4035
+ });
4036
+ });
4037
+ }
4038
+ });
4039
+ };
4040
+ };
4041
+
4042
+ function select$4(luvio, params) {
4043
+ return select$q();
4044
+ }
4045
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
4046
+ getTypeCacheKeys$a(storeKeyMap, luvio, response);
4047
+ }
4048
+ function ingestSuccess$3(luvio, resourceParams, response) {
4049
+ const { body } = response;
4050
+ const key = keyBuilderFromType$4(luvio, body);
4051
+ luvio.storeIngest(key, ingest$a, body);
4052
+ const snapshot = luvio.storeLookup({
4053
+ recordId: key,
4054
+ node: select$4(),
4055
+ variables: {},
4056
+ });
4057
+ if (process.env.NODE_ENV !== 'production') {
4058
+ if (snapshot.state !== 'Fulfilled') {
4059
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
4060
+ }
4061
+ }
4062
+ deepFreeze(snapshot.data);
4063
+ return snapshot;
4064
+ }
4065
+ function createResourceRequest$3(config) {
4066
+ const headers = {};
4067
+ return {
4068
+ baseUri: '/services/data/v63.0',
4069
+ basePath: '/connect/slackbridge/team/' + config.urlParams.teamId + '/channel/' + config.urlParams.channelId + '/messages/' + config.urlParams.messageTs + '',
4070
+ method: 'patch',
4071
+ body: config.body,
4072
+ urlParams: config.urlParams,
4073
+ queryParams: {},
4074
+ headers,
4075
+ priority: 'normal',
4076
+ };
4077
+ }
4078
+
4079
+ const adapterName$3 = 'patchSlackMessage';
4080
+ const patchSlackMessage_ConfigPropertyMetadata = [
4081
+ generateParamConfigMetadata('channelId', true, 0 /* UrlParameter */, 0 /* String */),
4082
+ generateParamConfigMetadata('messageTs', true, 0 /* UrlParameter */, 0 /* String */),
4083
+ generateParamConfigMetadata('teamId', true, 0 /* UrlParameter */, 0 /* String */),
4084
+ generateParamConfigMetadata('text', true, 2 /* Body */, 0 /* String */),
4085
+ ];
4086
+ const patchSlackMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, patchSlackMessage_ConfigPropertyMetadata);
4087
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$c(patchSlackMessage_ConfigPropertyMetadata);
4088
+ function typeCheckConfig$3(untrustedConfig) {
4089
+ const config = {};
4090
+ typeCheckConfig$c(untrustedConfig, config, patchSlackMessage_ConfigPropertyMetadata);
4091
+ return config;
4092
+ }
4093
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
4094
+ if (!untrustedIsObject(untrustedConfig)) {
4095
+ return null;
4096
+ }
4097
+ if (process.env.NODE_ENV !== 'production') {
4098
+ validateConfig(untrustedConfig, configPropertyNames);
4099
+ }
4100
+ const config = typeCheckConfig$3(untrustedConfig);
4101
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4102
+ return null;
4103
+ }
4104
+ return config;
4105
+ }
4106
+ function buildNetworkSnapshot$3(luvio, config, options) {
4107
+ const resourceParams = createResourceParams$3(config);
4108
+ const request = createResourceRequest$3(resourceParams);
4109
+ return luvio.dispatchResourceRequest(request, options)
4110
+ .then((response) => {
4111
+ return luvio.handleSuccessResponse(() => {
4112
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
4113
+ return luvio.storeBroadcast().then(() => snapshot);
4114
+ }, () => {
4115
+ const cache = new StoreKeyMap();
4116
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
4117
+ return cache;
4118
+ });
4119
+ }, (response) => {
4120
+ deepFreeze(response);
4121
+ throw response;
4122
+ });
4123
+ }
4124
+ const patchSlackMessageAdapterFactory = (luvio) => {
4125
+ return function patchSlackMessage(untrustedConfig) {
4126
+ const config = validateAdapterConfig$3(untrustedConfig, patchSlackMessage_ConfigPropertyNames);
4127
+ // Invalid or incomplete config
4128
+ if (config === null) {
4129
+ throw new Error('Invalid config for "patchSlackMessage"');
4130
+ }
4131
+ return buildNetworkSnapshot$3(luvio, config);
4132
+ };
4133
+ };
4134
+
4135
+ const VERSION = "769b5b0ed94219341e9be74c08e63aed";
4136
+ function validate(obj, path = 'SlackBridgePostMessageOutputRepresentation') {
4137
+ const v_error = (() => {
4138
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4139
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4140
+ }
4141
+ const obj_channelId = obj.channelId;
4142
+ const path_channelId = path + '.channelId';
4143
+ if (typeof obj_channelId !== 'string') {
4144
+ return new TypeError('Expected "string" but received "' + typeof obj_channelId + '" (at "' + path_channelId + '")');
4145
+ }
4146
+ const obj_postedMessage = obj.postedMessage;
4147
+ const path_postedMessage = path + '.postedMessage';
4148
+ if (typeof obj_postedMessage !== 'object') {
4149
+ return new TypeError('Expected "object" but received "' + typeof obj_postedMessage + '" (at "' + path_postedMessage + '")');
4150
+ }
4151
+ const obj_timestamp = obj.timestamp;
4152
+ const path_timestamp = path + '.timestamp';
4153
+ if (typeof obj_timestamp !== 'string') {
4154
+ return new TypeError('Expected "string" but received "' + typeof obj_timestamp + '" (at "' + path_timestamp + '")');
4155
+ }
4156
+ })();
4157
+ return v_error === undefined ? null : v_error;
4158
+ }
4159
+ const RepresentationType = 'SlackBridgePostMessageOutputRepresentation';
4160
+ function keyBuilder(luvio, config) {
4161
+ return keyPrefix + '::' + RepresentationType + ':' + config.channelId;
4162
+ }
4163
+ function keyBuilderFromType(luvio, object) {
4164
+ const keyParams = {
4165
+ channelId: object.channelId
4166
+ };
4167
+ return keyBuilder(luvio, keyParams);
4168
+ }
4169
+ function normalize(input, existing, path, luvio, store, timestamp) {
4170
+ const input_postedMessage = input.postedMessage;
4171
+ const input_postedMessage_id = path.fullPath + '__postedMessage';
4172
+ input.postedMessage = ingest$6(input_postedMessage, {
4173
+ fullPath: input_postedMessage_id,
4174
+ propertyName: 'postedMessage',
4175
+ parent: {
4176
+ data: input,
4177
+ key: path.fullPath,
4178
+ existing: existing,
4179
+ },
4180
+ ttl: path.ttl
4181
+ }, luvio, store, timestamp);
4182
+ return input;
4183
+ }
4184
+ const select$3 = function SlackBridgePostMessageOutputRepresentationSelect() {
4185
+ return {
4186
+ kind: 'Fragment',
4187
+ version: VERSION,
4188
+ private: [],
4189
+ selections: [
4190
+ {
4191
+ name: 'channelId',
4192
+ kind: 'Scalar'
4193
+ },
4194
+ {
4195
+ name: 'postedMessage',
4196
+ kind: 'Link',
4197
+ fragment: select$g()
4198
+ },
4199
+ {
4200
+ name: 'timestamp',
4201
+ kind: 'Scalar'
4202
+ }
4203
+ ]
4204
+ };
4205
+ };
4206
+ function equals(existing, incoming) {
4207
+ const existing_channelId = existing.channelId;
4208
+ const incoming_channelId = incoming.channelId;
4209
+ if (!(existing_channelId === incoming_channelId)) {
4210
+ return false;
4211
+ }
4212
+ const existing_timestamp = existing.timestamp;
4213
+ const incoming_timestamp = incoming.timestamp;
4214
+ if (!(existing_timestamp === incoming_timestamp)) {
4215
+ return false;
4216
+ }
4217
+ const existing_postedMessage = existing.postedMessage;
4218
+ const incoming_postedMessage = incoming.postedMessage;
4219
+ if (!(existing_postedMessage.__ref === incoming_postedMessage.__ref)) {
4220
+ return false;
4221
+ }
4222
+ return true;
4223
+ }
4224
+ const ingest = function SlackBridgePostMessageOutputRepresentationIngest(input, path, luvio, store, timestamp) {
4225
+ if (process.env.NODE_ENV !== 'production') {
4226
+ const validateError = validate(input);
4227
+ if (validateError !== null) {
4228
+ throw validateError;
4229
+ }
4230
+ }
4231
+ const key = keyBuilderFromType(luvio, input);
4232
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
4233
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "SlackBridge", VERSION, RepresentationType, equals);
4234
+ return createLink(key);
4235
+ };
4236
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
4237
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
4238
+ const rootKey = keyBuilderFromType(luvio, input);
4239
+ rootKeySet.set(rootKey, {
4240
+ namespace: keyPrefix,
4241
+ representationName: RepresentationType,
4242
+ mergeable: false
4243
+ });
4244
+ getTypeCacheKeys$6(rootKeySet, luvio, input.postedMessage, () => rootKey + "__" + "postedMessage");
4245
+ }
4246
+
4247
+ function select$2(luvio, params) {
4248
+ return select$3();
4249
+ }
4250
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
4251
+ getTypeCacheKeys(storeKeyMap, luvio, response);
4252
+ }
4253
+ function ingestSuccess$2(luvio, resourceParams, response) {
4254
+ const { body } = response;
4255
+ const key = keyBuilderFromType(luvio, body);
4256
+ luvio.storeIngest(key, ingest, body);
4257
+ const snapshot = luvio.storeLookup({
4258
+ recordId: key,
4259
+ node: select$2(),
4260
+ variables: {},
4261
+ });
4262
+ if (process.env.NODE_ENV !== 'production') {
4263
+ if (snapshot.state !== 'Fulfilled') {
4264
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
4265
+ }
4266
+ }
4267
+ deepFreeze(snapshot.data);
4268
+ return snapshot;
4269
+ }
4270
+ function createResourceRequest$2(config) {
4271
+ const headers = {};
4272
+ return {
4273
+ baseUri: '/services/data/v63.0',
4274
+ basePath: '/connect/slackbridge/conversation/messages',
4275
+ method: 'post',
4276
+ body: config.body,
4277
+ urlParams: {},
4278
+ queryParams: {},
4279
+ headers,
4280
+ priority: 'normal',
4281
+ };
4282
+ }
4283
+
4284
+ const adapterName$2 = 'postSlackConversation';
4285
+ const postSlackConversation_ConfigPropertyMetadata = [
4286
+ generateParamConfigMetadata('channelId', true, 2 /* Body */, 0 /* String */),
4287
+ generateParamConfigMetadata('linkNames', true, 2 /* Body */, 1 /* Boolean */),
4288
+ generateParamConfigMetadata('replyBroadcast', true, 2 /* Body */, 1 /* Boolean */),
4289
+ generateParamConfigMetadata('teamId', true, 2 /* Body */, 0 /* String */),
4290
+ generateParamConfigMetadata('text', true, 2 /* Body */, 0 /* String */),
4291
+ generateParamConfigMetadata('threadTs', true, 2 /* Body */, 0 /* String */),
4292
+ ];
4293
+ const postSlackConversation_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, postSlackConversation_ConfigPropertyMetadata);
4294
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$c(postSlackConversation_ConfigPropertyMetadata);
4295
+ function typeCheckConfig$2(untrustedConfig) {
4296
+ const config = {};
4297
+ typeCheckConfig$c(untrustedConfig, config, postSlackConversation_ConfigPropertyMetadata);
4298
+ return config;
4299
+ }
4300
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
4301
+ if (!untrustedIsObject(untrustedConfig)) {
4302
+ return null;
4303
+ }
4304
+ if (process.env.NODE_ENV !== 'production') {
4305
+ validateConfig(untrustedConfig, configPropertyNames);
4306
+ }
4307
+ const config = typeCheckConfig$2(untrustedConfig);
4308
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4309
+ return null;
4310
+ }
4311
+ return config;
4312
+ }
4313
+ function buildNetworkSnapshot$2(luvio, config, options) {
4314
+ const resourceParams = createResourceParams$2(config);
4315
+ const request = createResourceRequest$2(resourceParams);
4316
+ return luvio.dispatchResourceRequest(request, options)
4317
+ .then((response) => {
4318
+ return luvio.handleSuccessResponse(() => {
4319
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
4320
+ return luvio.storeBroadcast().then(() => snapshot);
4321
+ }, () => {
4322
+ const cache = new StoreKeyMap();
4323
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
4324
+ return cache;
4325
+ });
4326
+ }, (response) => {
4327
+ deepFreeze(response);
4328
+ throw response;
4329
+ });
4330
+ }
4331
+ const postSlackConversationAdapterFactory = (luvio) => {
4332
+ return function postSlackConversation(untrustedConfig) {
4333
+ const config = validateAdapterConfig$2(untrustedConfig, postSlackConversation_ConfigPropertyNames);
4334
+ // Invalid or incomplete config
4335
+ if (config === null) {
4336
+ throw new Error('Invalid config for "postSlackConversation"');
4337
+ }
4338
+ return buildNetworkSnapshot$2(luvio, config);
4339
+ };
4340
+ };
4341
+
4342
+ function select$1(luvio, params) {
4343
+ return select$h();
4344
+ }
4345
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
4346
+ getTypeCacheKeys$7(storeKeyMap, luvio, response);
4347
+ }
4348
+ function ingestSuccess$1(luvio, resourceParams, response) {
4349
+ const { body } = response;
4350
+ const key = keyBuilderFromType$1(luvio, body);
4351
+ luvio.storeIngest(key, ingest$7, body);
4352
+ const snapshot = luvio.storeLookup({
4353
+ recordId: key,
4354
+ node: select$1(),
4355
+ variables: {},
4356
+ });
4357
+ if (process.env.NODE_ENV !== 'production') {
4358
+ if (snapshot.state !== 'Fulfilled') {
4359
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
4360
+ }
4361
+ }
4362
+ deepFreeze(snapshot.data);
4363
+ return snapshot;
4364
+ }
4365
+ function createResourceRequest$1(config) {
4366
+ const headers = {};
4367
+ return {
4368
+ baseUri: '/services/data/v63.0',
4369
+ basePath: '/connect/slackbridge/files',
4370
+ method: 'post',
4371
+ body: config.body,
4372
+ urlParams: {},
4373
+ queryParams: {},
4374
+ headers,
4375
+ priority: 'normal',
4376
+ };
4377
+ }
4378
+
4379
+ const adapterName$1 = 'postSlackFile';
4380
+ const postSlackFile_ConfigPropertyMetadata = [
4381
+ generateParamConfigMetadata('base64EncodedFileData', true, 2 /* Body */, 0 /* String */),
4382
+ generateParamConfigMetadata('channels', true, 2 /* Body */, 0 /* String */, true),
4383
+ generateParamConfigMetadata('fileName', true, 2 /* Body */, 0 /* String */),
4384
+ generateParamConfigMetadata('fileType', true, 2 /* Body */, 0 /* String */),
4385
+ generateParamConfigMetadata('initialComment', true, 2 /* Body */, 0 /* String */),
4386
+ generateParamConfigMetadata('teamId', true, 2 /* Body */, 0 /* String */),
4387
+ generateParamConfigMetadata('threadTs', true, 2 /* Body */, 0 /* String */),
4388
+ generateParamConfigMetadata('title', true, 2 /* Body */, 0 /* String */),
4389
+ ];
4390
+ const postSlackFile_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, postSlackFile_ConfigPropertyMetadata);
4391
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$c(postSlackFile_ConfigPropertyMetadata);
4392
+ function typeCheckConfig$1(untrustedConfig) {
4393
+ const config = {};
4394
+ typeCheckConfig$c(untrustedConfig, config, postSlackFile_ConfigPropertyMetadata);
4395
+ return config;
4396
+ }
4397
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
4398
+ if (!untrustedIsObject(untrustedConfig)) {
4399
+ return null;
4400
+ }
4401
+ if (process.env.NODE_ENV !== 'production') {
4402
+ validateConfig(untrustedConfig, configPropertyNames);
4403
+ }
4404
+ const config = typeCheckConfig$1(untrustedConfig);
4405
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4406
+ return null;
4407
+ }
4408
+ return config;
4409
+ }
4410
+ function buildNetworkSnapshot$1(luvio, config, options) {
4411
+ const resourceParams = createResourceParams$1(config);
4412
+ const request = createResourceRequest$1(resourceParams);
4413
+ return luvio.dispatchResourceRequest(request, options)
4414
+ .then((response) => {
4415
+ return luvio.handleSuccessResponse(() => {
4416
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
4417
+ return luvio.storeBroadcast().then(() => snapshot);
4418
+ }, () => {
4419
+ const cache = new StoreKeyMap();
4420
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
4421
+ return cache;
4422
+ });
4423
+ }, (response) => {
4424
+ deepFreeze(response);
4425
+ throw response;
4426
+ });
4427
+ }
4428
+ const postSlackFileAdapterFactory = (luvio) => {
4429
+ return function postSlackFile(untrustedConfig) {
4430
+ const config = validateAdapterConfig$1(untrustedConfig, postSlackFile_ConfigPropertyNames);
4431
+ // Invalid or incomplete config
4432
+ if (config === null) {
4433
+ throw new Error('Invalid config for "postSlackFile"');
4434
+ }
4435
+ return buildNetworkSnapshot$1(luvio, config);
4436
+ };
4437
+ };
4438
+
4439
+ function select(luvio, params) {
4440
+ return select$o();
4441
+ }
4442
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
4443
+ getTypeCacheKeys$9(storeKeyMap, luvio, response);
4444
+ }
4445
+ function ingestSuccess(luvio, resourceParams, response) {
4446
+ const { body } = response;
4447
+ const key = keyBuilderFromType$3(luvio, body);
4448
+ luvio.storeIngest(key, ingest$9, body);
4449
+ const snapshot = luvio.storeLookup({
4450
+ recordId: key,
4451
+ node: select(),
4452
+ variables: {},
4453
+ });
4454
+ if (process.env.NODE_ENV !== 'production') {
4455
+ if (snapshot.state !== 'Fulfilled') {
4456
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
4457
+ }
4458
+ }
4459
+ deepFreeze(snapshot.data);
4460
+ return snapshot;
4461
+ }
4462
+ function createResourceRequest(config) {
4463
+ const headers = {};
4464
+ return {
4465
+ baseUri: '/services/data/v63.0',
4466
+ basePath: '/connect/slackbridge/team/' + config.urlParams.teamId + '/channel/' + config.urlParams.channelId + '/messages/' + config.urlParams.messageTs + '/reactions',
4467
+ method: 'post',
4468
+ body: null,
4469
+ urlParams: config.urlParams,
4470
+ queryParams: config.queryParams,
4471
+ headers,
4472
+ priority: 'normal',
4473
+ };
4474
+ }
4475
+
4476
+ const adapterName = 'postSlackMessageReactions';
4477
+ const postSlackMessageReactions_ConfigPropertyMetadata = [
4478
+ generateParamConfigMetadata('channelId', true, 0 /* UrlParameter */, 0 /* String */),
4479
+ generateParamConfigMetadata('messageTs', true, 0 /* UrlParameter */, 0 /* String */),
4480
+ generateParamConfigMetadata('teamId', true, 0 /* UrlParameter */, 0 /* String */),
4481
+ generateParamConfigMetadata('name', false, 1 /* QueryParameter */, 0 /* String */),
4482
+ ];
4483
+ const postSlackMessageReactions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, postSlackMessageReactions_ConfigPropertyMetadata);
4484
+ const createResourceParams = /*#__PURE__*/ createResourceParams$c(postSlackMessageReactions_ConfigPropertyMetadata);
4485
+ function typeCheckConfig(untrustedConfig) {
4486
+ const config = {};
4487
+ typeCheckConfig$c(untrustedConfig, config, postSlackMessageReactions_ConfigPropertyMetadata);
4488
+ return config;
4489
+ }
4490
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
4491
+ if (!untrustedIsObject(untrustedConfig)) {
4492
+ return null;
4493
+ }
4494
+ if (process.env.NODE_ENV !== 'production') {
4495
+ validateConfig(untrustedConfig, configPropertyNames);
4496
+ }
4497
+ const config = typeCheckConfig(untrustedConfig);
4498
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4499
+ return null;
4500
+ }
4501
+ return config;
4502
+ }
4503
+ function buildNetworkSnapshot(luvio, config, options) {
4504
+ const resourceParams = createResourceParams(config);
4505
+ const request = createResourceRequest(resourceParams);
4506
+ return luvio.dispatchResourceRequest(request, options)
4507
+ .then((response) => {
4508
+ return luvio.handleSuccessResponse(() => {
4509
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
4510
+ return luvio.storeBroadcast().then(() => snapshot);
4511
+ }, () => {
4512
+ const cache = new StoreKeyMap();
4513
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
4514
+ return cache;
4515
+ });
4516
+ }, (response) => {
4517
+ deepFreeze(response);
4518
+ throw response;
4519
+ });
4520
+ }
4521
+ const postSlackMessageReactionsAdapterFactory = (luvio) => {
4522
+ return function postSlackMessageReactions(untrustedConfig) {
4523
+ const config = validateAdapterConfig(untrustedConfig, postSlackMessageReactions_ConfigPropertyNames);
4524
+ // Invalid or incomplete config
4525
+ if (config === null) {
4526
+ throw new Error('Invalid config for "postSlackMessageReactions"');
4527
+ }
4528
+ return buildNetworkSnapshot(luvio, config);
4529
+ };
4530
+ };
4531
+
4532
+ let deleteSlackMessage;
4533
+ let deleteSlackMessageReactions;
4534
+ let getSlackConversation;
4535
+ let getSlackCustomEmoji;
4536
+ let getSlackMessage;
4537
+ let getSlackMessageNotifyChange;
4538
+ let getSlackSearchEmoji;
4539
+ let getSlackSearchUser;
4540
+ let getSlackUser;
4541
+ let getSlackUserNotifyChange;
4542
+ let patchSlackMessage;
4543
+ let postSlackConversation;
4544
+ let postSlackFile;
4545
+ let postSlackMessageReactions;
4546
+ // Imperative GET Adapters
4547
+ let getSlackConversation_imperative;
4548
+ let getSlackCustomEmoji_imperative;
4549
+ let getSlackMessage_imperative;
4550
+ let getSlackSearchEmoji_imperative;
4551
+ let getSlackSearchUser_imperative;
4552
+ let getSlackUser_imperative;
4553
+ const getSlackConversationMetadata = { apiFamily: 'SlackBridge', name: 'getSlackConversation' };
4554
+ const getSlackCustomEmojiMetadata = { apiFamily: 'SlackBridge', name: 'getSlackCustomEmoji' };
4555
+ const getSlackMessageMetadata = { apiFamily: 'SlackBridge', name: 'getSlackMessage' };
4556
+ const getSlackSearchEmojiMetadata = { apiFamily: 'SlackBridge', name: 'getSlackSearchEmoji' };
4557
+ const getSlackSearchUserMetadata = { apiFamily: 'SlackBridge', name: 'getSlackSearchUser' };
4558
+ const getSlackUserMetadata = { apiFamily: 'SlackBridge', name: 'getSlackUser', ttl: 300000 };
4559
+ // Notify Update Available
4560
+ function bindExportsTo(luvio) {
4561
+ // LDS Adapters
4562
+ const getSlackConversation_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getSlackConversation', getSlackConversationAdapterFactory), getSlackConversationMetadata);
4563
+ const getSlackCustomEmoji_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getSlackCustomEmoji', getSlackCustomEmojiAdapterFactory), getSlackCustomEmojiMetadata);
4564
+ const getSlackMessage_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getSlackMessage', getSlackMessageAdapterFactory), getSlackMessageMetadata);
4565
+ const getSlackSearchEmoji_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getSlackSearchEmoji', getSlackSearchEmojiAdapterFactory), getSlackSearchEmojiMetadata);
4566
+ const getSlackSearchUser_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getSlackSearchUser', getSlackSearchUserAdapterFactory), getSlackSearchUserMetadata);
4567
+ const getSlackUser_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getSlackUser', getSlackUserAdapterFactory), getSlackUserMetadata);
4568
+ function unwrapSnapshotData(factory) {
4569
+ const adapter = factory(luvio);
4570
+ return (config) => adapter(config).then((snapshot) => snapshot.data);
4571
+ }
4572
+ return {
4573
+ deleteSlackMessage: createLDSAdapter(luvio, adapterName$b, deleteSlackMessageAdapterFactory),
4574
+ deleteSlackMessageReactions: createLDSAdapter(luvio, adapterName$a, deleteSlackMessageReactionsAdapterFactory),
4575
+ getSlackConversation: createWireAdapterConstructor(luvio, getSlackConversation_ldsAdapter, getSlackConversationMetadata),
4576
+ getSlackCustomEmoji: createWireAdapterConstructor(luvio, getSlackCustomEmoji_ldsAdapter, getSlackCustomEmojiMetadata),
4577
+ getSlackMessage: createWireAdapterConstructor(luvio, getSlackMessage_ldsAdapter, getSlackMessageMetadata),
4578
+ getSlackMessageNotifyChange: createLDSAdapter(luvio, 'getSlackMessageNotifyChange', notifyChangeFactory$1),
4579
+ getSlackSearchEmoji: createWireAdapterConstructor(luvio, getSlackSearchEmoji_ldsAdapter, getSlackSearchEmojiMetadata),
4580
+ getSlackSearchUser: createWireAdapterConstructor(luvio, getSlackSearchUser_ldsAdapter, getSlackSearchUserMetadata),
4581
+ getSlackUser: createWireAdapterConstructor(luvio, getSlackUser_ldsAdapter, getSlackUserMetadata),
4582
+ getSlackUserNotifyChange: createLDSAdapter(luvio, 'getSlackUserNotifyChange', notifyChangeFactory),
4583
+ patchSlackMessage: unwrapSnapshotData(patchSlackMessageAdapterFactory),
4584
+ postSlackConversation: unwrapSnapshotData(postSlackConversationAdapterFactory),
4585
+ postSlackFile: unwrapSnapshotData(postSlackFileAdapterFactory),
4586
+ postSlackMessageReactions: unwrapSnapshotData(postSlackMessageReactionsAdapterFactory),
4587
+ // Imperative GET Adapters
4588
+ getSlackConversation_imperative: createImperativeAdapter(luvio, getSlackConversation_ldsAdapter, getSlackConversationMetadata),
4589
+ getSlackCustomEmoji_imperative: createImperativeAdapter(luvio, getSlackCustomEmoji_ldsAdapter, getSlackCustomEmojiMetadata),
4590
+ getSlackMessage_imperative: createImperativeAdapter(luvio, getSlackMessage_ldsAdapter, getSlackMessageMetadata),
4591
+ getSlackSearchEmoji_imperative: createImperativeAdapter(luvio, getSlackSearchEmoji_ldsAdapter, getSlackSearchEmojiMetadata),
4592
+ getSlackSearchUser_imperative: createImperativeAdapter(luvio, getSlackSearchUser_ldsAdapter, getSlackSearchUserMetadata),
4593
+ getSlackUser_imperative: createImperativeAdapter(luvio, getSlackUser_ldsAdapter, getSlackUserMetadata),
4594
+ // Notify Update Availables
4595
+ };
4596
+ }
4597
+ withDefaultLuvio((luvio) => {
4598
+ ({
4599
+ deleteSlackMessage,
4600
+ deleteSlackMessageReactions,
4601
+ getSlackConversation,
4602
+ getSlackCustomEmoji,
4603
+ getSlackMessage,
4604
+ getSlackMessageNotifyChange,
4605
+ getSlackSearchEmoji,
4606
+ getSlackSearchUser,
4607
+ getSlackUser,
4608
+ getSlackUserNotifyChange,
4609
+ patchSlackMessage,
4610
+ postSlackConversation,
4611
+ postSlackFile,
4612
+ postSlackMessageReactions,
4613
+ getSlackConversation_imperative,
4614
+ getSlackCustomEmoji_imperative,
4615
+ getSlackMessage_imperative,
4616
+ getSlackSearchEmoji_imperative,
4617
+ getSlackSearchUser_imperative,
4618
+ getSlackUser_imperative,
4619
+ } = bindExportsTo(luvio));
4620
+ });
4621
+
4622
+ export { deleteSlackMessage, deleteSlackMessageReactions, getSlackConversation, getSlackConversation_imperative, getSlackCustomEmoji, getSlackCustomEmoji_imperative, getSlackMessage, getSlackMessageNotifyChange, getSlackMessage_imperative, getSlackSearchEmoji, getSlackSearchEmoji_imperative, getSlackSearchUser, getSlackSearchUser_imperative, getSlackUser, getSlackUserNotifyChange, getSlackUser_imperative, patchSlackMessage, postSlackConversation, postSlackFile, postSlackMessageReactions };
4623
+ // version: 1.329.0-beac2bb064