@salesforce/lds-adapters-service-slack 1.291.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +82 -0
- package/dist/es/es2018/service-slack.js +3567 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/getSlackConversation.d.ts +33 -0
- package/dist/es/es2018/types/src/generated/adapters/getSlackConversationdeleteSlackMessage.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/adapters/getSlackConversationdeleteSlackMessageReactions.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/adapters/getSlackConversationgetSlackConversationInfo.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/adapters/getSlackConversationgetSlackMessage.d.ts +33 -0
- package/dist/es/es2018/types/src/generated/adapters/getSlackConversationgetSlackUser.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/adapters/getSlackConversationpatchSlackMessage.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/adapters/getSlackConversationpostSlackConversation.d.ts +21 -0
- package/dist/es/es2018/types/src/generated/adapters/getSlackConversationpostSlackMessageReactions.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/adapters/getSlackCustomEmoji.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/postSlackFile.d.ts +23 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +11 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/resources/deleteConnectSwarmingConversationMessagesByMessageTimestamp.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/resources/deleteConnectSwarmingConversationMessagesReactionsByMessageTimestamp.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectSwarmingConversationEmojis.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectSwarmingConversationMessages.d.ts +21 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectSwarmingConversationMessagesByMessageTimestamp.d.ts +23 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectSwarmingConversationMessagesReactionsByMessageTimestamp.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectSwarmingConversationUserByUserId.d.ts +20 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectSwarmingSlackConversationInfo.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/resources/patchConnectSwarmingConversationMessagesByMessageTimestamp.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectSwarmingConversationFiles.d.ts +20 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectSwarmingConversationMessages.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectSwarmingConversationMessagesReactionsByMessageTimestamp.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/types/ContentDocumentOutputRepresentation.d.ts +40 -0
- package/dist/es/es2018/types/src/generated/types/ContentVersionOutputRepresentation.d.ts +43 -0
- package/dist/es/es2018/types/src/generated/types/EmptyRepresentation.d.ts +36 -0
- package/dist/es/es2018/types/src/generated/types/FileTypeOutputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/SlackConversationInfoOutputRepresentation.d.ts +67 -0
- package/dist/es/es2018/types/src/generated/types/SlackConversationOutputRepresentation.d.ts +64 -0
- package/dist/es/es2018/types/src/generated/types/SlackCustomEmojisOutputRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/SlackFileInputRepresentation.d.ts +52 -0
- package/dist/es/es2018/types/src/generated/types/SlackFileOutputRepresentation.d.ts +68 -0
- package/dist/es/es2018/types/src/generated/types/SlackMessageOutputRepresentation.d.ts +127 -0
- package/dist/es/es2018/types/src/generated/types/SlackPostMessageInputRepresentation.d.ts +46 -0
- package/dist/es/es2018/types/src/generated/types/SlackPostMessageOutputRepresentation.d.ts +57 -0
- package/dist/es/es2018/types/src/generated/types/SlackPostMessageReactionInputRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/SlackReactionOutputRepresentation.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/types/SlackUpdateMessageInputRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/SlackUpdatedMessageOutputRepresentation.d.ts +57 -0
- package/dist/es/es2018/types/src/generated/types/SlackUserInfoOutputRepresentation.d.ts +55 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +66 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +3750 -0
- package/src/raml/api.raml +731 -0
- package/src/raml/luvio.raml +84 -0
|
@@ -0,0 +1,3567 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$5, typeCheckConfig as typeCheckConfig$b, StoreKeyMap, createResourceParams as createResourceParams$b } from '@luvio/engine';
|
|
8
|
+
|
|
9
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
|
+
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
11
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
12
|
+
/**
|
|
13
|
+
* Validates an adapter config is well-formed.
|
|
14
|
+
* @param config The config to validate.
|
|
15
|
+
* @param adapter The adapter validation configuration.
|
|
16
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
17
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
18
|
+
*/
|
|
19
|
+
function validateConfig(config, adapter, oneOf) {
|
|
20
|
+
const { displayName } = adapter;
|
|
21
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
22
|
+
if (config === undefined ||
|
|
23
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
24
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
25
|
+
}
|
|
26
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
27
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
28
|
+
}
|
|
29
|
+
if (unsupported !== undefined &&
|
|
30
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
31
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
32
|
+
}
|
|
33
|
+
const supported = required.concat(optional);
|
|
34
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
35
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function untrustedIsObject(untrusted) {
|
|
39
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
40
|
+
}
|
|
41
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
42
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
43
|
+
}
|
|
44
|
+
const snapshotRefreshOptions = {
|
|
45
|
+
overrides: {
|
|
46
|
+
headers: {
|
|
47
|
+
'Cache-Control': 'no-cache',
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
52
|
+
return {
|
|
53
|
+
name,
|
|
54
|
+
required,
|
|
55
|
+
resourceType,
|
|
56
|
+
typeCheckShape,
|
|
57
|
+
isArrayShape,
|
|
58
|
+
coerceFn,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
62
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
63
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
64
|
+
return {
|
|
65
|
+
displayName,
|
|
66
|
+
parameters: {
|
|
67
|
+
required,
|
|
68
|
+
optional,
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const keyPrefix = 'Slack';
|
|
73
|
+
|
|
74
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
75
|
+
const { isArray: ArrayIsArray } = Array;
|
|
76
|
+
function equalsArray(a, b, equalsItem) {
|
|
77
|
+
const aLength = a.length;
|
|
78
|
+
const bLength = b.length;
|
|
79
|
+
if (aLength !== bLength) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
for (let i = 0; i < aLength; i++) {
|
|
83
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
function equalsObject(a, b, equalsProp) {
|
|
90
|
+
const aKeys = ObjectKeys(a).sort();
|
|
91
|
+
const bKeys = ObjectKeys(b).sort();
|
|
92
|
+
const aKeysLength = aKeys.length;
|
|
93
|
+
const bKeysLength = bKeys.length;
|
|
94
|
+
if (aKeysLength !== bKeysLength) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
for (let i = 0; i < aKeys.length; i++) {
|
|
98
|
+
const key = aKeys[i];
|
|
99
|
+
if (key !== bKeys[i]) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
if (equalsProp(a[key], b[key]) === false) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
function createLink(ref) {
|
|
109
|
+
return {
|
|
110
|
+
__ref: serializeStructuredKey(ref),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const VERSION$c = "c1bddf326dab5c5496dc81bd0e4d7e2e";
|
|
115
|
+
function validate$c(obj, path = 'SlackCustomEmojisOutputRepresentation') {
|
|
116
|
+
const v_error = (() => {
|
|
117
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
118
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
119
|
+
}
|
|
120
|
+
const obj_customEmojis = obj.customEmojis;
|
|
121
|
+
const path_customEmojis = path + '.customEmojis';
|
|
122
|
+
if (typeof obj_customEmojis !== 'object' || ArrayIsArray(obj_customEmojis) || obj_customEmojis === null) {
|
|
123
|
+
return new TypeError('Expected "object" but received "' + typeof obj_customEmojis + '" (at "' + path_customEmojis + '")');
|
|
124
|
+
}
|
|
125
|
+
const obj_customEmojis_keys = ObjectKeys(obj_customEmojis);
|
|
126
|
+
for (let i = 0; i < obj_customEmojis_keys.length; i++) {
|
|
127
|
+
const key = obj_customEmojis_keys[i];
|
|
128
|
+
const obj_customEmojis_prop = obj_customEmojis[key];
|
|
129
|
+
const path_customEmojis_prop = path_customEmojis + '["' + key + '"]';
|
|
130
|
+
if (typeof obj_customEmojis_prop !== 'string') {
|
|
131
|
+
return new TypeError('Expected "string" but received "' + typeof obj_customEmojis_prop + '" (at "' + path_customEmojis_prop + '")');
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const obj_teamId = obj.teamId;
|
|
135
|
+
const path_teamId = path + '.teamId';
|
|
136
|
+
if (typeof obj_teamId !== 'string') {
|
|
137
|
+
return new TypeError('Expected "string" but received "' + typeof obj_teamId + '" (at "' + path_teamId + '")');
|
|
138
|
+
}
|
|
139
|
+
})();
|
|
140
|
+
return v_error === undefined ? null : v_error;
|
|
141
|
+
}
|
|
142
|
+
const RepresentationType$9 = 'SlackCustomEmojisOutputRepresentation';
|
|
143
|
+
function normalize$9(input, existing, path, luvio, store, timestamp) {
|
|
144
|
+
return input;
|
|
145
|
+
}
|
|
146
|
+
const select$l = function SlackCustomEmojisOutputRepresentationSelect() {
|
|
147
|
+
return {
|
|
148
|
+
kind: 'Fragment',
|
|
149
|
+
version: VERSION$c,
|
|
150
|
+
private: [],
|
|
151
|
+
selections: [
|
|
152
|
+
{
|
|
153
|
+
name: 'customEmojis',
|
|
154
|
+
kind: 'Scalar',
|
|
155
|
+
map: true
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'teamId',
|
|
159
|
+
kind: 'Scalar'
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
function equals$c(existing, incoming) {
|
|
165
|
+
const existing_teamId = existing.teamId;
|
|
166
|
+
const incoming_teamId = incoming.teamId;
|
|
167
|
+
if (!(existing_teamId === incoming_teamId)) {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
const existing_customEmojis = existing.customEmojis;
|
|
171
|
+
const incoming_customEmojis = incoming.customEmojis;
|
|
172
|
+
const equals_customEmojis_props = equalsObject(existing_customEmojis, incoming_customEmojis, (existing_customEmojis_prop, incoming_customEmojis_prop) => {
|
|
173
|
+
if (!(existing_customEmojis_prop === incoming_customEmojis_prop)) {
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
if (equals_customEmojis_props === false) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
const ingest$9 = function SlackCustomEmojisOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
183
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
184
|
+
const validateError = validate$c(input);
|
|
185
|
+
if (validateError !== null) {
|
|
186
|
+
throw validateError;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const key = path.fullPath;
|
|
190
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
|
|
191
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$9, "Slack", VERSION$c, RepresentationType$9, equals$c);
|
|
192
|
+
return createLink(key);
|
|
193
|
+
};
|
|
194
|
+
function getTypeCacheKeys$9(rootKeySet, luvio, input, fullPathFactory) {
|
|
195
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
196
|
+
const rootKey = fullPathFactory();
|
|
197
|
+
rootKeySet.set(rootKey, {
|
|
198
|
+
namespace: keyPrefix,
|
|
199
|
+
representationName: RepresentationType$9,
|
|
200
|
+
mergeable: false
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function select$k(luvio, params) {
|
|
205
|
+
return select$l();
|
|
206
|
+
}
|
|
207
|
+
function keyBuilder$h(luvio, params) {
|
|
208
|
+
return keyPrefix + '::SlackCustomEmojisOutputRepresentation:(' + 'appId:' + params.queryParams.appId + ',' + 'teamId:' + params.queryParams.teamId + ')';
|
|
209
|
+
}
|
|
210
|
+
function getResponseCacheKeys$a(storeKeyMap, luvio, resourceParams, response) {
|
|
211
|
+
getTypeCacheKeys$9(storeKeyMap, luvio, response, () => keyBuilder$h(luvio, resourceParams));
|
|
212
|
+
}
|
|
213
|
+
function ingestSuccess$8(luvio, resourceParams, response, snapshotRefresh) {
|
|
214
|
+
const { body } = response;
|
|
215
|
+
const key = keyBuilder$h(luvio, resourceParams);
|
|
216
|
+
luvio.storeIngest(key, ingest$9, body);
|
|
217
|
+
const snapshot = luvio.storeLookup({
|
|
218
|
+
recordId: key,
|
|
219
|
+
node: select$k(),
|
|
220
|
+
variables: {},
|
|
221
|
+
}, snapshotRefresh);
|
|
222
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
223
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
224
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
deepFreeze(snapshot.data);
|
|
228
|
+
return snapshot;
|
|
229
|
+
}
|
|
230
|
+
function ingestError$4(luvio, params, error, snapshotRefresh) {
|
|
231
|
+
const key = keyBuilder$h(luvio, params);
|
|
232
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
233
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
234
|
+
return errorSnapshot;
|
|
235
|
+
}
|
|
236
|
+
function createResourceRequest$a(config) {
|
|
237
|
+
const headers = {};
|
|
238
|
+
return {
|
|
239
|
+
baseUri: '/services/data/v62.0',
|
|
240
|
+
basePath: '/connect/swarming/conversation/emojis',
|
|
241
|
+
method: 'get',
|
|
242
|
+
body: null,
|
|
243
|
+
urlParams: {},
|
|
244
|
+
queryParams: config.queryParams,
|
|
245
|
+
headers,
|
|
246
|
+
priority: 'normal',
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const adapterName$a = 'getSlackCustomEmoji';
|
|
251
|
+
const getSlackCustomEmoji_ConfigPropertyMetadata = [
|
|
252
|
+
generateParamConfigMetadata('appId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
253
|
+
generateParamConfigMetadata('teamId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
254
|
+
];
|
|
255
|
+
const getSlackCustomEmoji_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$a, getSlackCustomEmoji_ConfigPropertyMetadata);
|
|
256
|
+
const createResourceParams$a = /*#__PURE__*/ createResourceParams$b(getSlackCustomEmoji_ConfigPropertyMetadata);
|
|
257
|
+
function keyBuilder$g(luvio, config) {
|
|
258
|
+
const resourceParams = createResourceParams$a(config);
|
|
259
|
+
return keyBuilder$h(luvio, resourceParams);
|
|
260
|
+
}
|
|
261
|
+
function typeCheckConfig$a(untrustedConfig) {
|
|
262
|
+
const config = {};
|
|
263
|
+
typeCheckConfig$b(untrustedConfig, config, getSlackCustomEmoji_ConfigPropertyMetadata);
|
|
264
|
+
return config;
|
|
265
|
+
}
|
|
266
|
+
function validateAdapterConfig$a(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$a(untrustedConfig);
|
|
274
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
return config;
|
|
278
|
+
}
|
|
279
|
+
function adapterFragment$4(luvio, config) {
|
|
280
|
+
createResourceParams$a(config);
|
|
281
|
+
return select$k();
|
|
282
|
+
}
|
|
283
|
+
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
284
|
+
const snapshot = ingestSuccess$8(luvio, resourceParams, response, {
|
|
285
|
+
config,
|
|
286
|
+
resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
|
|
287
|
+
});
|
|
288
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
289
|
+
}
|
|
290
|
+
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
291
|
+
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
292
|
+
config,
|
|
293
|
+
resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
|
|
294
|
+
});
|
|
295
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
296
|
+
}
|
|
297
|
+
function buildNetworkSnapshot$a(luvio, config, options) {
|
|
298
|
+
const resourceParams = createResourceParams$a(config);
|
|
299
|
+
const request = createResourceRequest$a(resourceParams);
|
|
300
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
301
|
+
.then((response) => {
|
|
302
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
|
|
303
|
+
const cache = new StoreKeyMap();
|
|
304
|
+
getResponseCacheKeys$a(cache, luvio, resourceParams, response.body);
|
|
305
|
+
return cache;
|
|
306
|
+
});
|
|
307
|
+
}, (response) => {
|
|
308
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
312
|
+
return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot$a, undefined, false);
|
|
313
|
+
}
|
|
314
|
+
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
315
|
+
const { luvio, config } = context;
|
|
316
|
+
const selector = {
|
|
317
|
+
recordId: keyBuilder$g(luvio, config),
|
|
318
|
+
node: adapterFragment$4(luvio, config),
|
|
319
|
+
variables: {},
|
|
320
|
+
};
|
|
321
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
322
|
+
config,
|
|
323
|
+
resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
|
|
324
|
+
});
|
|
325
|
+
return cacheSnapshot;
|
|
326
|
+
}
|
|
327
|
+
const getSlackCustomEmojiAdapterFactory = (luvio) => function Slack__getSlackCustomEmoji(untrustedConfig, requestContext) {
|
|
328
|
+
const config = validateAdapterConfig$a(untrustedConfig, getSlackCustomEmoji_ConfigPropertyNames);
|
|
329
|
+
// Invalid or incomplete config
|
|
330
|
+
if (config === null) {
|
|
331
|
+
return null;
|
|
332
|
+
}
|
|
333
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
334
|
+
buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
const VERSION$b = "67b7fe6f8ee1967c58049a7212129bad";
|
|
338
|
+
function validate$b(obj, path = 'FileTypeOutputRepresentation') {
|
|
339
|
+
const v_error = (() => {
|
|
340
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
341
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
342
|
+
}
|
|
343
|
+
const obj_extension = obj.extension;
|
|
344
|
+
const path_extension = path + '.extension';
|
|
345
|
+
if (typeof obj_extension !== 'string') {
|
|
346
|
+
return new TypeError('Expected "string" but received "' + typeof obj_extension + '" (at "' + path_extension + '")');
|
|
347
|
+
}
|
|
348
|
+
const obj_iconName = obj.iconName;
|
|
349
|
+
const path_iconName = path + '.iconName';
|
|
350
|
+
if (typeof obj_iconName !== 'string') {
|
|
351
|
+
return new TypeError('Expected "string" but received "' + typeof obj_iconName + '" (at "' + path_iconName + '")');
|
|
352
|
+
}
|
|
353
|
+
})();
|
|
354
|
+
return v_error === undefined ? null : v_error;
|
|
355
|
+
}
|
|
356
|
+
const select$j = function FileTypeOutputRepresentationSelect() {
|
|
357
|
+
return {
|
|
358
|
+
kind: 'Fragment',
|
|
359
|
+
version: VERSION$b,
|
|
360
|
+
private: [],
|
|
361
|
+
selections: [
|
|
362
|
+
{
|
|
363
|
+
name: 'extension',
|
|
364
|
+
kind: 'Scalar'
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
name: 'iconName',
|
|
368
|
+
kind: 'Scalar'
|
|
369
|
+
}
|
|
370
|
+
]
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
function equals$b(existing, incoming) {
|
|
374
|
+
const existing_extension = existing.extension;
|
|
375
|
+
const incoming_extension = incoming.extension;
|
|
376
|
+
if (!(existing_extension === incoming_extension)) {
|
|
377
|
+
return false;
|
|
378
|
+
}
|
|
379
|
+
const existing_iconName = existing.iconName;
|
|
380
|
+
const incoming_iconName = incoming.iconName;
|
|
381
|
+
if (!(existing_iconName === incoming_iconName)) {
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
return true;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
const VERSION$a = "d1fa6f4938be185a790ae2f7aa423266";
|
|
388
|
+
function validate$a(obj, path = 'ContentVersionOutputRepresentation') {
|
|
389
|
+
const v_error = (() => {
|
|
390
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
391
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
392
|
+
}
|
|
393
|
+
const obj_attachmentUrl = obj.attachmentUrl;
|
|
394
|
+
const path_attachmentUrl = path + '.attachmentUrl';
|
|
395
|
+
if (typeof obj_attachmentUrl !== 'string') {
|
|
396
|
+
return new TypeError('Expected "string" but received "' + typeof obj_attachmentUrl + '" (at "' + path_attachmentUrl + '")');
|
|
397
|
+
}
|
|
398
|
+
const obj_filetype = obj.filetype;
|
|
399
|
+
const path_filetype = path + '.filetype';
|
|
400
|
+
const referencepath_filetypeValidationError = validate$b(obj_filetype, path_filetype);
|
|
401
|
+
if (referencepath_filetypeValidationError !== null) {
|
|
402
|
+
let message = 'Object doesn\'t match FileTypeOutputRepresentation (at "' + path_filetype + '")\n';
|
|
403
|
+
message += referencepath_filetypeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
404
|
+
return new TypeError(message);
|
|
405
|
+
}
|
|
406
|
+
const obj_id = obj.id;
|
|
407
|
+
const path_id = path + '.id';
|
|
408
|
+
if (typeof obj_id !== 'string') {
|
|
409
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
410
|
+
}
|
|
411
|
+
const obj_size = obj.size;
|
|
412
|
+
const path_size = path + '.size';
|
|
413
|
+
if (typeof obj_size !== 'number' || (typeof obj_size === 'number' && Math.floor(obj_size) !== obj_size)) {
|
|
414
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_size + '" (at "' + path_size + '")');
|
|
415
|
+
}
|
|
416
|
+
const obj_title = obj.title;
|
|
417
|
+
const path_title = path + '.title';
|
|
418
|
+
if (typeof obj_title !== 'string') {
|
|
419
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
420
|
+
}
|
|
421
|
+
const obj_versionUrl = obj.versionUrl;
|
|
422
|
+
const path_versionUrl = path + '.versionUrl';
|
|
423
|
+
if (typeof obj_versionUrl !== 'string') {
|
|
424
|
+
return new TypeError('Expected "string" but received "' + typeof obj_versionUrl + '" (at "' + path_versionUrl + '")');
|
|
425
|
+
}
|
|
426
|
+
})();
|
|
427
|
+
return v_error === undefined ? null : v_error;
|
|
428
|
+
}
|
|
429
|
+
const select$i = function ContentVersionOutputRepresentationSelect() {
|
|
430
|
+
const { selections: FileTypeOutputRepresentation__selections, opaque: FileTypeOutputRepresentation__opaque, } = select$j();
|
|
431
|
+
return {
|
|
432
|
+
kind: 'Fragment',
|
|
433
|
+
version: VERSION$a,
|
|
434
|
+
private: [],
|
|
435
|
+
selections: [
|
|
436
|
+
{
|
|
437
|
+
name: 'attachmentUrl',
|
|
438
|
+
kind: 'Scalar'
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: 'filetype',
|
|
442
|
+
kind: 'Object',
|
|
443
|
+
selections: FileTypeOutputRepresentation__selections
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
name: 'id',
|
|
447
|
+
kind: 'Scalar'
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
name: 'size',
|
|
451
|
+
kind: 'Scalar'
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
name: 'title',
|
|
455
|
+
kind: 'Scalar'
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
name: 'versionUrl',
|
|
459
|
+
kind: 'Scalar'
|
|
460
|
+
}
|
|
461
|
+
]
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
function equals$a(existing, incoming) {
|
|
465
|
+
const existing_size = existing.size;
|
|
466
|
+
const incoming_size = incoming.size;
|
|
467
|
+
if (!(existing_size === incoming_size)) {
|
|
468
|
+
return false;
|
|
469
|
+
}
|
|
470
|
+
const existing_attachmentUrl = existing.attachmentUrl;
|
|
471
|
+
const incoming_attachmentUrl = incoming.attachmentUrl;
|
|
472
|
+
if (!(existing_attachmentUrl === incoming_attachmentUrl)) {
|
|
473
|
+
return false;
|
|
474
|
+
}
|
|
475
|
+
const existing_id = existing.id;
|
|
476
|
+
const incoming_id = incoming.id;
|
|
477
|
+
if (!(existing_id === incoming_id)) {
|
|
478
|
+
return false;
|
|
479
|
+
}
|
|
480
|
+
const existing_title = existing.title;
|
|
481
|
+
const incoming_title = incoming.title;
|
|
482
|
+
if (!(existing_title === incoming_title)) {
|
|
483
|
+
return false;
|
|
484
|
+
}
|
|
485
|
+
const existing_versionUrl = existing.versionUrl;
|
|
486
|
+
const incoming_versionUrl = incoming.versionUrl;
|
|
487
|
+
if (!(existing_versionUrl === incoming_versionUrl)) {
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
const existing_filetype = existing.filetype;
|
|
491
|
+
const incoming_filetype = incoming.filetype;
|
|
492
|
+
if (!(equals$b(existing_filetype, incoming_filetype))) {
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
return true;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
const VERSION$9 = "86dc45870c15b40e9591690f7fb1ac16";
|
|
499
|
+
function validate$9(obj, path = 'ContentDocumentOutputRepresentation') {
|
|
500
|
+
const v_error = (() => {
|
|
501
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
502
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
503
|
+
}
|
|
504
|
+
const obj_filetype = obj.filetype;
|
|
505
|
+
const path_filetype = path + '.filetype';
|
|
506
|
+
const referencepath_filetypeValidationError = validate$b(obj_filetype, path_filetype);
|
|
507
|
+
if (referencepath_filetypeValidationError !== null) {
|
|
508
|
+
let message = 'Object doesn\'t match FileTypeOutputRepresentation (at "' + path_filetype + '")\n';
|
|
509
|
+
message += referencepath_filetypeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
510
|
+
return new TypeError(message);
|
|
511
|
+
}
|
|
512
|
+
const obj_id = obj.id;
|
|
513
|
+
const path_id = path + '.id';
|
|
514
|
+
if (typeof obj_id !== 'string') {
|
|
515
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
516
|
+
}
|
|
517
|
+
const obj_latestPublishedVersion = obj.latestPublishedVersion;
|
|
518
|
+
const path_latestPublishedVersion = path + '.latestPublishedVersion';
|
|
519
|
+
const referencepath_latestPublishedVersionValidationError = validate$a(obj_latestPublishedVersion, path_latestPublishedVersion);
|
|
520
|
+
if (referencepath_latestPublishedVersionValidationError !== null) {
|
|
521
|
+
let message = 'Object doesn\'t match ContentVersionOutputRepresentation (at "' + path_latestPublishedVersion + '")\n';
|
|
522
|
+
message += referencepath_latestPublishedVersionValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
523
|
+
return new TypeError(message);
|
|
524
|
+
}
|
|
525
|
+
const obj_size = obj.size;
|
|
526
|
+
const path_size = path + '.size';
|
|
527
|
+
if (typeof obj_size !== 'number' || (typeof obj_size === 'number' && Math.floor(obj_size) !== obj_size)) {
|
|
528
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_size + '" (at "' + path_size + '")');
|
|
529
|
+
}
|
|
530
|
+
const obj_title = obj.title;
|
|
531
|
+
const path_title = path + '.title';
|
|
532
|
+
if (typeof obj_title !== 'string') {
|
|
533
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
534
|
+
}
|
|
535
|
+
})();
|
|
536
|
+
return v_error === undefined ? null : v_error;
|
|
537
|
+
}
|
|
538
|
+
const select$h = function ContentDocumentOutputRepresentationSelect() {
|
|
539
|
+
const { selections: FileTypeOutputRepresentation__selections, opaque: FileTypeOutputRepresentation__opaque, } = select$j();
|
|
540
|
+
const { selections: ContentVersionOutputRepresentation__selections, opaque: ContentVersionOutputRepresentation__opaque, } = select$i();
|
|
541
|
+
return {
|
|
542
|
+
kind: 'Fragment',
|
|
543
|
+
version: VERSION$9,
|
|
544
|
+
private: [],
|
|
545
|
+
selections: [
|
|
546
|
+
{
|
|
547
|
+
name: 'filetype',
|
|
548
|
+
kind: 'Object',
|
|
549
|
+
selections: FileTypeOutputRepresentation__selections
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
name: 'id',
|
|
553
|
+
kind: 'Scalar'
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
name: 'latestPublishedVersion',
|
|
557
|
+
kind: 'Object',
|
|
558
|
+
selections: ContentVersionOutputRepresentation__selections
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
name: 'size',
|
|
562
|
+
kind: 'Scalar'
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
name: 'title',
|
|
566
|
+
kind: 'Scalar'
|
|
567
|
+
}
|
|
568
|
+
]
|
|
569
|
+
};
|
|
570
|
+
};
|
|
571
|
+
function equals$9(existing, incoming) {
|
|
572
|
+
const existing_size = existing.size;
|
|
573
|
+
const incoming_size = incoming.size;
|
|
574
|
+
if (!(existing_size === incoming_size)) {
|
|
575
|
+
return false;
|
|
576
|
+
}
|
|
577
|
+
const existing_id = existing.id;
|
|
578
|
+
const incoming_id = incoming.id;
|
|
579
|
+
if (!(existing_id === incoming_id)) {
|
|
580
|
+
return false;
|
|
581
|
+
}
|
|
582
|
+
const existing_title = existing.title;
|
|
583
|
+
const incoming_title = incoming.title;
|
|
584
|
+
if (!(existing_title === incoming_title)) {
|
|
585
|
+
return false;
|
|
586
|
+
}
|
|
587
|
+
const existing_filetype = existing.filetype;
|
|
588
|
+
const incoming_filetype = incoming.filetype;
|
|
589
|
+
if (!(equals$b(existing_filetype, incoming_filetype))) {
|
|
590
|
+
return false;
|
|
591
|
+
}
|
|
592
|
+
const existing_latestPublishedVersion = existing.latestPublishedVersion;
|
|
593
|
+
const incoming_latestPublishedVersion = incoming.latestPublishedVersion;
|
|
594
|
+
if (!(equals$a(existing_latestPublishedVersion, incoming_latestPublishedVersion))) {
|
|
595
|
+
return false;
|
|
596
|
+
}
|
|
597
|
+
return true;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
const VERSION$8 = "23fef6ea7c8dad47030e1e983274593a";
|
|
601
|
+
function validate$8(obj, path = 'SlackFileOutputRepresentation') {
|
|
602
|
+
const v_error = (() => {
|
|
603
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
604
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
605
|
+
}
|
|
606
|
+
const obj_contentDocument = obj.contentDocument;
|
|
607
|
+
const path_contentDocument = path + '.contentDocument';
|
|
608
|
+
const referencepath_contentDocumentValidationError = validate$9(obj_contentDocument, path_contentDocument);
|
|
609
|
+
if (referencepath_contentDocumentValidationError !== null) {
|
|
610
|
+
let message = 'Object doesn\'t match ContentDocumentOutputRepresentation (at "' + path_contentDocument + '")\n';
|
|
611
|
+
message += referencepath_contentDocumentValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
612
|
+
return new TypeError(message);
|
|
613
|
+
}
|
|
614
|
+
const obj_filetype = obj.filetype;
|
|
615
|
+
const path_filetype = path + '.filetype';
|
|
616
|
+
if (typeof obj_filetype !== 'string') {
|
|
617
|
+
return new TypeError('Expected "string" but received "' + typeof obj_filetype + '" (at "' + path_filetype + '")');
|
|
618
|
+
}
|
|
619
|
+
const obj_id = obj.id;
|
|
620
|
+
const path_id = path + '.id';
|
|
621
|
+
if (typeof obj_id !== 'string') {
|
|
622
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
623
|
+
}
|
|
624
|
+
const obj_mimetype = obj.mimetype;
|
|
625
|
+
const path_mimetype = path + '.mimetype';
|
|
626
|
+
if (typeof obj_mimetype !== 'string') {
|
|
627
|
+
return new TypeError('Expected "string" but received "' + typeof obj_mimetype + '" (at "' + path_mimetype + '")');
|
|
628
|
+
}
|
|
629
|
+
const obj_name = obj.name;
|
|
630
|
+
const path_name = path + '.name';
|
|
631
|
+
if (typeof obj_name !== 'string') {
|
|
632
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
633
|
+
}
|
|
634
|
+
const obj_size = obj.size;
|
|
635
|
+
const path_size = path + '.size';
|
|
636
|
+
if (typeof obj_size !== 'number' || (typeof obj_size === 'number' && Math.floor(obj_size) !== obj_size)) {
|
|
637
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_size + '" (at "' + path_size + '")');
|
|
638
|
+
}
|
|
639
|
+
const obj_slackPermalink = obj.slackPermalink;
|
|
640
|
+
const path_slackPermalink = path + '.slackPermalink';
|
|
641
|
+
if (typeof obj_slackPermalink !== 'string') {
|
|
642
|
+
return new TypeError('Expected "string" but received "' + typeof obj_slackPermalink + '" (at "' + path_slackPermalink + '")');
|
|
643
|
+
}
|
|
644
|
+
const obj_title = obj.title;
|
|
645
|
+
const path_title = path + '.title';
|
|
646
|
+
if (typeof obj_title !== 'string') {
|
|
647
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
648
|
+
}
|
|
649
|
+
const obj_token = obj.token;
|
|
650
|
+
const path_token = path + '.token';
|
|
651
|
+
if (typeof obj_token !== 'string') {
|
|
652
|
+
return new TypeError('Expected "string" but received "' + typeof obj_token + '" (at "' + path_token + '")');
|
|
653
|
+
}
|
|
654
|
+
const obj_uniqueKey = obj.uniqueKey;
|
|
655
|
+
const path_uniqueKey = path + '.uniqueKey';
|
|
656
|
+
if (typeof obj_uniqueKey !== 'string') {
|
|
657
|
+
return new TypeError('Expected "string" but received "' + typeof obj_uniqueKey + '" (at "' + path_uniqueKey + '")');
|
|
658
|
+
}
|
|
659
|
+
const obj_url = obj.url;
|
|
660
|
+
const path_url = path + '.url';
|
|
661
|
+
if (typeof obj_url !== 'string') {
|
|
662
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
663
|
+
}
|
|
664
|
+
})();
|
|
665
|
+
return v_error === undefined ? null : v_error;
|
|
666
|
+
}
|
|
667
|
+
const RepresentationType$8 = 'SlackFileOutputRepresentation';
|
|
668
|
+
function keyBuilder$f(luvio, config) {
|
|
669
|
+
return keyPrefix + '::' + RepresentationType$8 + ':' + config.uniqueKey;
|
|
670
|
+
}
|
|
671
|
+
function keyBuilderFromType$5(luvio, object) {
|
|
672
|
+
const keyParams = {
|
|
673
|
+
uniqueKey: object.uniqueKey
|
|
674
|
+
};
|
|
675
|
+
return keyBuilder$f(luvio, keyParams);
|
|
676
|
+
}
|
|
677
|
+
function normalize$8(input, existing, path, luvio, store, timestamp) {
|
|
678
|
+
return input;
|
|
679
|
+
}
|
|
680
|
+
const select$g = function SlackFileOutputRepresentationSelect() {
|
|
681
|
+
const { selections: ContentDocumentOutputRepresentation__selections, opaque: ContentDocumentOutputRepresentation__opaque, } = select$h();
|
|
682
|
+
return {
|
|
683
|
+
kind: 'Fragment',
|
|
684
|
+
version: VERSION$8,
|
|
685
|
+
private: [],
|
|
686
|
+
selections: [
|
|
687
|
+
{
|
|
688
|
+
name: 'contentDocument',
|
|
689
|
+
kind: 'Object',
|
|
690
|
+
selections: ContentDocumentOutputRepresentation__selections
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
name: 'filetype',
|
|
694
|
+
kind: 'Scalar'
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
name: 'id',
|
|
698
|
+
kind: 'Scalar'
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
name: 'mimetype',
|
|
702
|
+
kind: 'Scalar'
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
name: 'name',
|
|
706
|
+
kind: 'Scalar'
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
name: 'size',
|
|
710
|
+
kind: 'Scalar'
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
name: 'slackPermalink',
|
|
714
|
+
kind: 'Scalar'
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
name: 'title',
|
|
718
|
+
kind: 'Scalar'
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
name: 'token',
|
|
722
|
+
kind: 'Scalar'
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
name: 'uniqueKey',
|
|
726
|
+
kind: 'Scalar'
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
name: 'url',
|
|
730
|
+
kind: 'Scalar'
|
|
731
|
+
}
|
|
732
|
+
]
|
|
733
|
+
};
|
|
734
|
+
};
|
|
735
|
+
function equals$8(existing, incoming) {
|
|
736
|
+
const existing_size = existing.size;
|
|
737
|
+
const incoming_size = incoming.size;
|
|
738
|
+
if (!(existing_size === incoming_size)) {
|
|
739
|
+
return false;
|
|
740
|
+
}
|
|
741
|
+
const existing_filetype = existing.filetype;
|
|
742
|
+
const incoming_filetype = incoming.filetype;
|
|
743
|
+
if (!(existing_filetype === incoming_filetype)) {
|
|
744
|
+
return false;
|
|
745
|
+
}
|
|
746
|
+
const existing_id = existing.id;
|
|
747
|
+
const incoming_id = incoming.id;
|
|
748
|
+
if (!(existing_id === incoming_id)) {
|
|
749
|
+
return false;
|
|
750
|
+
}
|
|
751
|
+
const existing_mimetype = existing.mimetype;
|
|
752
|
+
const incoming_mimetype = incoming.mimetype;
|
|
753
|
+
if (!(existing_mimetype === incoming_mimetype)) {
|
|
754
|
+
return false;
|
|
755
|
+
}
|
|
756
|
+
const existing_name = existing.name;
|
|
757
|
+
const incoming_name = incoming.name;
|
|
758
|
+
if (!(existing_name === incoming_name)) {
|
|
759
|
+
return false;
|
|
760
|
+
}
|
|
761
|
+
const existing_slackPermalink = existing.slackPermalink;
|
|
762
|
+
const incoming_slackPermalink = incoming.slackPermalink;
|
|
763
|
+
if (!(existing_slackPermalink === incoming_slackPermalink)) {
|
|
764
|
+
return false;
|
|
765
|
+
}
|
|
766
|
+
const existing_title = existing.title;
|
|
767
|
+
const incoming_title = incoming.title;
|
|
768
|
+
if (!(existing_title === incoming_title)) {
|
|
769
|
+
return false;
|
|
770
|
+
}
|
|
771
|
+
const existing_token = existing.token;
|
|
772
|
+
const incoming_token = incoming.token;
|
|
773
|
+
if (!(existing_token === incoming_token)) {
|
|
774
|
+
return false;
|
|
775
|
+
}
|
|
776
|
+
const existing_uniqueKey = existing.uniqueKey;
|
|
777
|
+
const incoming_uniqueKey = incoming.uniqueKey;
|
|
778
|
+
if (!(existing_uniqueKey === incoming_uniqueKey)) {
|
|
779
|
+
return false;
|
|
780
|
+
}
|
|
781
|
+
const existing_url = existing.url;
|
|
782
|
+
const incoming_url = incoming.url;
|
|
783
|
+
if (!(existing_url === incoming_url)) {
|
|
784
|
+
return false;
|
|
785
|
+
}
|
|
786
|
+
const existing_contentDocument = existing.contentDocument;
|
|
787
|
+
const incoming_contentDocument = incoming.contentDocument;
|
|
788
|
+
if (!(equals$9(existing_contentDocument, incoming_contentDocument))) {
|
|
789
|
+
return false;
|
|
790
|
+
}
|
|
791
|
+
return true;
|
|
792
|
+
}
|
|
793
|
+
const ingest$8 = function SlackFileOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
794
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
795
|
+
const validateError = validate$8(input);
|
|
796
|
+
if (validateError !== null) {
|
|
797
|
+
throw validateError;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
const key = keyBuilderFromType$5(luvio, input);
|
|
801
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
|
|
802
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$8, "Slack", VERSION$8, RepresentationType$8, equals$8);
|
|
803
|
+
return createLink(key);
|
|
804
|
+
};
|
|
805
|
+
function getTypeCacheKeys$8(rootKeySet, luvio, input, fullPathFactory) {
|
|
806
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
807
|
+
const rootKey = keyBuilderFromType$5(luvio, input);
|
|
808
|
+
rootKeySet.set(rootKey, {
|
|
809
|
+
namespace: keyPrefix,
|
|
810
|
+
representationName: RepresentationType$8,
|
|
811
|
+
mergeable: false
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
function select$f(luvio, params) {
|
|
816
|
+
return select$g();
|
|
817
|
+
}
|
|
818
|
+
function getResponseCacheKeys$9(storeKeyMap, luvio, resourceParams, response) {
|
|
819
|
+
getTypeCacheKeys$8(storeKeyMap, luvio, response);
|
|
820
|
+
}
|
|
821
|
+
function ingestSuccess$7(luvio, resourceParams, response) {
|
|
822
|
+
const { body } = response;
|
|
823
|
+
const key = keyBuilderFromType$5(luvio, body);
|
|
824
|
+
luvio.storeIngest(key, ingest$8, body);
|
|
825
|
+
const snapshot = luvio.storeLookup({
|
|
826
|
+
recordId: key,
|
|
827
|
+
node: select$f(),
|
|
828
|
+
variables: {},
|
|
829
|
+
});
|
|
830
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
831
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
832
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
deepFreeze(snapshot.data);
|
|
836
|
+
return snapshot;
|
|
837
|
+
}
|
|
838
|
+
function createResourceRequest$9(config) {
|
|
839
|
+
const headers = {};
|
|
840
|
+
return {
|
|
841
|
+
baseUri: '/services/data/v62.0',
|
|
842
|
+
basePath: '/connect/swarming/conversation/files',
|
|
843
|
+
method: 'post',
|
|
844
|
+
body: config.body,
|
|
845
|
+
urlParams: {},
|
|
846
|
+
queryParams: {},
|
|
847
|
+
headers,
|
|
848
|
+
priority: 'normal',
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
const adapterName$9 = 'postSlackFile';
|
|
853
|
+
const postSlackFile_ConfigPropertyMetadata = [
|
|
854
|
+
generateParamConfigMetadata('appId', true, 2 /* Body */, 0 /* String */),
|
|
855
|
+
generateParamConfigMetadata('base64EncodedFileData', true, 2 /* Body */, 0 /* String */),
|
|
856
|
+
generateParamConfigMetadata('channels', true, 2 /* Body */, 0 /* String */, true),
|
|
857
|
+
generateParamConfigMetadata('fileName', true, 2 /* Body */, 0 /* String */),
|
|
858
|
+
generateParamConfigMetadata('fileType', true, 2 /* Body */, 0 /* String */),
|
|
859
|
+
generateParamConfigMetadata('initialComment', true, 2 /* Body */, 0 /* String */),
|
|
860
|
+
generateParamConfigMetadata('teamId', true, 2 /* Body */, 0 /* String */),
|
|
861
|
+
generateParamConfigMetadata('threadTs', true, 2 /* Body */, 0 /* String */),
|
|
862
|
+
generateParamConfigMetadata('title', true, 2 /* Body */, 0 /* String */),
|
|
863
|
+
];
|
|
864
|
+
const postSlackFile_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$9, postSlackFile_ConfigPropertyMetadata);
|
|
865
|
+
const createResourceParams$9 = /*#__PURE__*/ createResourceParams$b(postSlackFile_ConfigPropertyMetadata);
|
|
866
|
+
function typeCheckConfig$9(untrustedConfig) {
|
|
867
|
+
const config = {};
|
|
868
|
+
typeCheckConfig$b(untrustedConfig, config, postSlackFile_ConfigPropertyMetadata);
|
|
869
|
+
return config;
|
|
870
|
+
}
|
|
871
|
+
function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
|
|
872
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
873
|
+
return null;
|
|
874
|
+
}
|
|
875
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
876
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
877
|
+
}
|
|
878
|
+
const config = typeCheckConfig$9(untrustedConfig);
|
|
879
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
880
|
+
return null;
|
|
881
|
+
}
|
|
882
|
+
return config;
|
|
883
|
+
}
|
|
884
|
+
function buildNetworkSnapshot$9(luvio, config, options) {
|
|
885
|
+
const resourceParams = createResourceParams$9(config);
|
|
886
|
+
const request = createResourceRequest$9(resourceParams);
|
|
887
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
888
|
+
.then((response) => {
|
|
889
|
+
return luvio.handleSuccessResponse(() => {
|
|
890
|
+
const snapshot = ingestSuccess$7(luvio, resourceParams, response);
|
|
891
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
892
|
+
}, () => {
|
|
893
|
+
const cache = new StoreKeyMap();
|
|
894
|
+
getResponseCacheKeys$9(cache, luvio, resourceParams, response.body);
|
|
895
|
+
return cache;
|
|
896
|
+
});
|
|
897
|
+
}, (response) => {
|
|
898
|
+
deepFreeze(response);
|
|
899
|
+
throw response;
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
const postSlackFileAdapterFactory = (luvio) => {
|
|
903
|
+
return function postSlackFile(untrustedConfig) {
|
|
904
|
+
const config = validateAdapterConfig$9(untrustedConfig, postSlackFile_ConfigPropertyNames);
|
|
905
|
+
// Invalid or incomplete config
|
|
906
|
+
if (config === null) {
|
|
907
|
+
throw new Error('Invalid config for "postSlackFile"');
|
|
908
|
+
}
|
|
909
|
+
return buildNetworkSnapshot$9(luvio, config);
|
|
910
|
+
};
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
const VERSION$7 = "3ab8a0bb29f3b91228cf856e86966b0e";
|
|
914
|
+
function validate$7(obj, path = 'SlackUserInfoOutputRepresentation') {
|
|
915
|
+
const v_error = (() => {
|
|
916
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
917
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
918
|
+
}
|
|
919
|
+
const obj_bot = obj.bot;
|
|
920
|
+
const path_bot = path + '.bot';
|
|
921
|
+
if (typeof obj_bot !== 'boolean') {
|
|
922
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_bot + '" (at "' + path_bot + '")');
|
|
923
|
+
}
|
|
924
|
+
const obj_profileUrl = obj.profileUrl;
|
|
925
|
+
const path_profileUrl = path + '.profileUrl';
|
|
926
|
+
if (typeof obj_profileUrl !== 'string') {
|
|
927
|
+
return new TypeError('Expected "string" but received "' + typeof obj_profileUrl + '" (at "' + path_profileUrl + '")');
|
|
928
|
+
}
|
|
929
|
+
const obj_salesforceUserId = obj.salesforceUserId;
|
|
930
|
+
const path_salesforceUserId = path + '.salesforceUserId';
|
|
931
|
+
if (typeof obj_salesforceUserId !== 'string') {
|
|
932
|
+
return new TypeError('Expected "string" but received "' + typeof obj_salesforceUserId + '" (at "' + path_salesforceUserId + '")');
|
|
933
|
+
}
|
|
934
|
+
const obj_slackUserId = obj.slackUserId;
|
|
935
|
+
const path_slackUserId = path + '.slackUserId';
|
|
936
|
+
if (typeof obj_slackUserId !== 'string') {
|
|
937
|
+
return new TypeError('Expected "string" but received "' + typeof obj_slackUserId + '" (at "' + path_slackUserId + '")');
|
|
938
|
+
}
|
|
939
|
+
const obj_slackUserImageUrl = obj.slackUserImageUrl;
|
|
940
|
+
const path_slackUserImageUrl = path + '.slackUserImageUrl';
|
|
941
|
+
if (typeof obj_slackUserImageUrl !== 'string') {
|
|
942
|
+
return new TypeError('Expected "string" but received "' + typeof obj_slackUserImageUrl + '" (at "' + path_slackUserImageUrl + '")');
|
|
943
|
+
}
|
|
944
|
+
const obj_slackUsername = obj.slackUsername;
|
|
945
|
+
const path_slackUsername = path + '.slackUsername';
|
|
946
|
+
if (typeof obj_slackUsername !== 'string') {
|
|
947
|
+
return new TypeError('Expected "string" but received "' + typeof obj_slackUsername + '" (at "' + path_slackUsername + '")');
|
|
948
|
+
}
|
|
949
|
+
const obj_teamId = obj.teamId;
|
|
950
|
+
const path_teamId = path + '.teamId';
|
|
951
|
+
if (typeof obj_teamId !== 'string') {
|
|
952
|
+
return new TypeError('Expected "string" but received "' + typeof obj_teamId + '" (at "' + path_teamId + '")');
|
|
953
|
+
}
|
|
954
|
+
})();
|
|
955
|
+
return v_error === undefined ? null : v_error;
|
|
956
|
+
}
|
|
957
|
+
const RepresentationType$7 = 'SlackUserInfoOutputRepresentation';
|
|
958
|
+
function keyBuilder$e(luvio, config) {
|
|
959
|
+
return keyPrefix + '::' + RepresentationType$7 + ':' + config.userId;
|
|
960
|
+
}
|
|
961
|
+
function keyBuilderFromType$4(luvio, object) {
|
|
962
|
+
const keyParams = {
|
|
963
|
+
userId: object.slackUserId
|
|
964
|
+
};
|
|
965
|
+
return keyBuilder$e(luvio, keyParams);
|
|
966
|
+
}
|
|
967
|
+
function normalize$7(input, existing, path, luvio, store, timestamp) {
|
|
968
|
+
return input;
|
|
969
|
+
}
|
|
970
|
+
const select$e = function SlackUserInfoOutputRepresentationSelect() {
|
|
971
|
+
return {
|
|
972
|
+
kind: 'Fragment',
|
|
973
|
+
version: VERSION$7,
|
|
974
|
+
private: [],
|
|
975
|
+
selections: [
|
|
976
|
+
{
|
|
977
|
+
name: 'bot',
|
|
978
|
+
kind: 'Scalar'
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
name: 'profileUrl',
|
|
982
|
+
kind: 'Scalar'
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
name: 'salesforceUserId',
|
|
986
|
+
kind: 'Scalar'
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
name: 'slackUserId',
|
|
990
|
+
kind: 'Scalar'
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
name: 'slackUserImageUrl',
|
|
994
|
+
kind: 'Scalar'
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
name: 'slackUsername',
|
|
998
|
+
kind: 'Scalar'
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
name: 'teamId',
|
|
1002
|
+
kind: 'Scalar'
|
|
1003
|
+
}
|
|
1004
|
+
]
|
|
1005
|
+
};
|
|
1006
|
+
};
|
|
1007
|
+
function equals$7(existing, incoming) {
|
|
1008
|
+
const existing_bot = existing.bot;
|
|
1009
|
+
const incoming_bot = incoming.bot;
|
|
1010
|
+
if (!(existing_bot === incoming_bot)) {
|
|
1011
|
+
return false;
|
|
1012
|
+
}
|
|
1013
|
+
const existing_profileUrl = existing.profileUrl;
|
|
1014
|
+
const incoming_profileUrl = incoming.profileUrl;
|
|
1015
|
+
if (!(existing_profileUrl === incoming_profileUrl)) {
|
|
1016
|
+
return false;
|
|
1017
|
+
}
|
|
1018
|
+
const existing_salesforceUserId = existing.salesforceUserId;
|
|
1019
|
+
const incoming_salesforceUserId = incoming.salesforceUserId;
|
|
1020
|
+
if (!(existing_salesforceUserId === incoming_salesforceUserId)) {
|
|
1021
|
+
return false;
|
|
1022
|
+
}
|
|
1023
|
+
const existing_slackUserId = existing.slackUserId;
|
|
1024
|
+
const incoming_slackUserId = incoming.slackUserId;
|
|
1025
|
+
if (!(existing_slackUserId === incoming_slackUserId)) {
|
|
1026
|
+
return false;
|
|
1027
|
+
}
|
|
1028
|
+
const existing_slackUserImageUrl = existing.slackUserImageUrl;
|
|
1029
|
+
const incoming_slackUserImageUrl = incoming.slackUserImageUrl;
|
|
1030
|
+
if (!(existing_slackUserImageUrl === incoming_slackUserImageUrl)) {
|
|
1031
|
+
return false;
|
|
1032
|
+
}
|
|
1033
|
+
const existing_slackUsername = existing.slackUsername;
|
|
1034
|
+
const incoming_slackUsername = incoming.slackUsername;
|
|
1035
|
+
if (!(existing_slackUsername === incoming_slackUsername)) {
|
|
1036
|
+
return false;
|
|
1037
|
+
}
|
|
1038
|
+
const existing_teamId = existing.teamId;
|
|
1039
|
+
const incoming_teamId = incoming.teamId;
|
|
1040
|
+
if (!(existing_teamId === incoming_teamId)) {
|
|
1041
|
+
return false;
|
|
1042
|
+
}
|
|
1043
|
+
return true;
|
|
1044
|
+
}
|
|
1045
|
+
const ingest$7 = function SlackUserInfoOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1046
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1047
|
+
const validateError = validate$7(input);
|
|
1048
|
+
if (validateError !== null) {
|
|
1049
|
+
throw validateError;
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
const key = keyBuilderFromType$4(luvio, input);
|
|
1053
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
|
|
1054
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$7, "Slack", VERSION$7, RepresentationType$7, equals$7);
|
|
1055
|
+
return createLink(key);
|
|
1056
|
+
};
|
|
1057
|
+
function getTypeCacheKeys$7(rootKeySet, luvio, input, fullPathFactory) {
|
|
1058
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1059
|
+
const rootKey = keyBuilderFromType$4(luvio, input);
|
|
1060
|
+
rootKeySet.set(rootKey, {
|
|
1061
|
+
namespace: keyPrefix,
|
|
1062
|
+
representationName: RepresentationType$7,
|
|
1063
|
+
mergeable: false
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
const VERSION$6 = "c90a441214ca8dcf92b93fd78646dd6e";
|
|
1068
|
+
function validate$6(obj, path = 'SlackReactionOutputRepresentation') {
|
|
1069
|
+
const v_error = (() => {
|
|
1070
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1071
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1072
|
+
}
|
|
1073
|
+
const obj_count = obj.count;
|
|
1074
|
+
const path_count = path + '.count';
|
|
1075
|
+
if (typeof obj_count !== 'number' || (typeof obj_count === 'number' && Math.floor(obj_count) !== obj_count)) {
|
|
1076
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_count + '" (at "' + path_count + '")');
|
|
1077
|
+
}
|
|
1078
|
+
const obj_hasUserReacted = obj.hasUserReacted;
|
|
1079
|
+
const path_hasUserReacted = path + '.hasUserReacted';
|
|
1080
|
+
if (typeof obj_hasUserReacted !== 'boolean') {
|
|
1081
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_hasUserReacted + '" (at "' + path_hasUserReacted + '")');
|
|
1082
|
+
}
|
|
1083
|
+
const obj_isCustomEmoji = obj.isCustomEmoji;
|
|
1084
|
+
const path_isCustomEmoji = path + '.isCustomEmoji';
|
|
1085
|
+
if (typeof obj_isCustomEmoji !== 'boolean') {
|
|
1086
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isCustomEmoji + '" (at "' + path_isCustomEmoji + '")');
|
|
1087
|
+
}
|
|
1088
|
+
const obj_messageTs = obj.messageTs;
|
|
1089
|
+
const path_messageTs = path + '.messageTs';
|
|
1090
|
+
if (typeof obj_messageTs !== 'string') {
|
|
1091
|
+
return new TypeError('Expected "string" but received "' + typeof obj_messageTs + '" (at "' + path_messageTs + '")');
|
|
1092
|
+
}
|
|
1093
|
+
const obj_name = obj.name;
|
|
1094
|
+
const path_name = path + '.name';
|
|
1095
|
+
if (typeof obj_name !== 'string') {
|
|
1096
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1097
|
+
}
|
|
1098
|
+
const obj_reactedUsers = obj.reactedUsers;
|
|
1099
|
+
const path_reactedUsers = path + '.reactedUsers';
|
|
1100
|
+
if (!ArrayIsArray(obj_reactedUsers)) {
|
|
1101
|
+
return new TypeError('Expected "array" but received "' + typeof obj_reactedUsers + '" (at "' + path_reactedUsers + '")');
|
|
1102
|
+
}
|
|
1103
|
+
for (let i = 0; i < obj_reactedUsers.length; i++) {
|
|
1104
|
+
const obj_reactedUsers_item = obj_reactedUsers[i];
|
|
1105
|
+
const path_reactedUsers_item = path_reactedUsers + '[' + i + ']';
|
|
1106
|
+
if (typeof obj_reactedUsers_item !== 'object') {
|
|
1107
|
+
return new TypeError('Expected "object" but received "' + typeof obj_reactedUsers_item + '" (at "' + path_reactedUsers_item + '")');
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
const obj_unicode = obj.unicode;
|
|
1111
|
+
const path_unicode = path + '.unicode';
|
|
1112
|
+
if (typeof obj_unicode !== 'string') {
|
|
1113
|
+
return new TypeError('Expected "string" but received "' + typeof obj_unicode + '" (at "' + path_unicode + '")');
|
|
1114
|
+
}
|
|
1115
|
+
const obj_uniqueKey = obj.uniqueKey;
|
|
1116
|
+
const path_uniqueKey = path + '.uniqueKey';
|
|
1117
|
+
if (typeof obj_uniqueKey !== 'string') {
|
|
1118
|
+
return new TypeError('Expected "string" but received "' + typeof obj_uniqueKey + '" (at "' + path_uniqueKey + '")');
|
|
1119
|
+
}
|
|
1120
|
+
const obj_url = obj.url;
|
|
1121
|
+
const path_url = path + '.url';
|
|
1122
|
+
if (typeof obj_url !== 'string') {
|
|
1123
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
1124
|
+
}
|
|
1125
|
+
})();
|
|
1126
|
+
return v_error === undefined ? null : v_error;
|
|
1127
|
+
}
|
|
1128
|
+
const RepresentationType$6 = 'SlackReactionOutputRepresentation';
|
|
1129
|
+
function normalize$6(input, existing, path, luvio, store, timestamp) {
|
|
1130
|
+
const input_reactedUsers = input.reactedUsers;
|
|
1131
|
+
const input_reactedUsers_id = path.fullPath + '__reactedUsers';
|
|
1132
|
+
for (let i = 0; i < input_reactedUsers.length; i++) {
|
|
1133
|
+
const input_reactedUsers_item = input_reactedUsers[i];
|
|
1134
|
+
let input_reactedUsers_item_id = input_reactedUsers_id + '__' + i;
|
|
1135
|
+
input_reactedUsers[i] = ingest$7(input_reactedUsers_item, {
|
|
1136
|
+
fullPath: input_reactedUsers_item_id,
|
|
1137
|
+
propertyName: i,
|
|
1138
|
+
parent: {
|
|
1139
|
+
data: input,
|
|
1140
|
+
key: path.fullPath,
|
|
1141
|
+
existing: existing,
|
|
1142
|
+
},
|
|
1143
|
+
ttl: path.ttl
|
|
1144
|
+
}, luvio, store, timestamp);
|
|
1145
|
+
}
|
|
1146
|
+
return input;
|
|
1147
|
+
}
|
|
1148
|
+
const select$d = function SlackReactionOutputRepresentationSelect() {
|
|
1149
|
+
return {
|
|
1150
|
+
kind: 'Fragment',
|
|
1151
|
+
version: VERSION$6,
|
|
1152
|
+
private: [],
|
|
1153
|
+
selections: [
|
|
1154
|
+
{
|
|
1155
|
+
name: 'count',
|
|
1156
|
+
kind: 'Scalar'
|
|
1157
|
+
},
|
|
1158
|
+
{
|
|
1159
|
+
name: 'hasUserReacted',
|
|
1160
|
+
kind: 'Scalar'
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
name: 'isCustomEmoji',
|
|
1164
|
+
kind: 'Scalar'
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
name: 'messageTs',
|
|
1168
|
+
kind: 'Scalar'
|
|
1169
|
+
},
|
|
1170
|
+
{
|
|
1171
|
+
name: 'name',
|
|
1172
|
+
kind: 'Scalar'
|
|
1173
|
+
},
|
|
1174
|
+
{
|
|
1175
|
+
name: 'reactedUsers',
|
|
1176
|
+
kind: 'Link',
|
|
1177
|
+
plural: true,
|
|
1178
|
+
fragment: select$e()
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
name: 'unicode',
|
|
1182
|
+
kind: 'Scalar'
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
name: 'uniqueKey',
|
|
1186
|
+
kind: 'Scalar'
|
|
1187
|
+
},
|
|
1188
|
+
{
|
|
1189
|
+
name: 'url',
|
|
1190
|
+
kind: 'Scalar'
|
|
1191
|
+
}
|
|
1192
|
+
]
|
|
1193
|
+
};
|
|
1194
|
+
};
|
|
1195
|
+
function equals$6(existing, incoming) {
|
|
1196
|
+
const existing_hasUserReacted = existing.hasUserReacted;
|
|
1197
|
+
const incoming_hasUserReacted = incoming.hasUserReacted;
|
|
1198
|
+
if (!(existing_hasUserReacted === incoming_hasUserReacted)) {
|
|
1199
|
+
return false;
|
|
1200
|
+
}
|
|
1201
|
+
const existing_isCustomEmoji = existing.isCustomEmoji;
|
|
1202
|
+
const incoming_isCustomEmoji = incoming.isCustomEmoji;
|
|
1203
|
+
if (!(existing_isCustomEmoji === incoming_isCustomEmoji)) {
|
|
1204
|
+
return false;
|
|
1205
|
+
}
|
|
1206
|
+
const existing_count = existing.count;
|
|
1207
|
+
const incoming_count = incoming.count;
|
|
1208
|
+
if (!(existing_count === incoming_count)) {
|
|
1209
|
+
return false;
|
|
1210
|
+
}
|
|
1211
|
+
const existing_messageTs = existing.messageTs;
|
|
1212
|
+
const incoming_messageTs = incoming.messageTs;
|
|
1213
|
+
if (!(existing_messageTs === incoming_messageTs)) {
|
|
1214
|
+
return false;
|
|
1215
|
+
}
|
|
1216
|
+
const existing_name = existing.name;
|
|
1217
|
+
const incoming_name = incoming.name;
|
|
1218
|
+
if (!(existing_name === incoming_name)) {
|
|
1219
|
+
return false;
|
|
1220
|
+
}
|
|
1221
|
+
const existing_unicode = existing.unicode;
|
|
1222
|
+
const incoming_unicode = incoming.unicode;
|
|
1223
|
+
if (!(existing_unicode === incoming_unicode)) {
|
|
1224
|
+
return false;
|
|
1225
|
+
}
|
|
1226
|
+
const existing_uniqueKey = existing.uniqueKey;
|
|
1227
|
+
const incoming_uniqueKey = incoming.uniqueKey;
|
|
1228
|
+
if (!(existing_uniqueKey === incoming_uniqueKey)) {
|
|
1229
|
+
return false;
|
|
1230
|
+
}
|
|
1231
|
+
const existing_url = existing.url;
|
|
1232
|
+
const incoming_url = incoming.url;
|
|
1233
|
+
if (!(existing_url === incoming_url)) {
|
|
1234
|
+
return false;
|
|
1235
|
+
}
|
|
1236
|
+
const existing_reactedUsers = existing.reactedUsers;
|
|
1237
|
+
const incoming_reactedUsers = incoming.reactedUsers;
|
|
1238
|
+
const equals_reactedUsers_items = equalsArray(existing_reactedUsers, incoming_reactedUsers, (existing_reactedUsers_item, incoming_reactedUsers_item) => {
|
|
1239
|
+
if (!(existing_reactedUsers_item.__ref === incoming_reactedUsers_item.__ref)) {
|
|
1240
|
+
return false;
|
|
1241
|
+
}
|
|
1242
|
+
});
|
|
1243
|
+
if (equals_reactedUsers_items === false) {
|
|
1244
|
+
return false;
|
|
1245
|
+
}
|
|
1246
|
+
return true;
|
|
1247
|
+
}
|
|
1248
|
+
const ingest$6 = function SlackReactionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1249
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1250
|
+
const validateError = validate$6(input);
|
|
1251
|
+
if (validateError !== null) {
|
|
1252
|
+
throw validateError;
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
const key = path.fullPath;
|
|
1256
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
|
|
1257
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "Slack", VERSION$6, RepresentationType$6, equals$6);
|
|
1258
|
+
return createLink(key);
|
|
1259
|
+
};
|
|
1260
|
+
function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
|
|
1261
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1262
|
+
const rootKey = fullPathFactory();
|
|
1263
|
+
rootKeySet.set(rootKey, {
|
|
1264
|
+
namespace: keyPrefix,
|
|
1265
|
+
representationName: RepresentationType$6,
|
|
1266
|
+
mergeable: false
|
|
1267
|
+
});
|
|
1268
|
+
const input_reactedUsers_length = input.reactedUsers.length;
|
|
1269
|
+
for (let i = 0; i < input_reactedUsers_length; i++) {
|
|
1270
|
+
getTypeCacheKeys$7(rootKeySet, luvio, input.reactedUsers[i]);
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
const TTL$2 = 300;
|
|
1275
|
+
const VERSION$5 = "530df8acc9c3c40a091cb37970289745";
|
|
1276
|
+
function validate$5(obj, path = 'SlackMessageOutputRepresentation') {
|
|
1277
|
+
const v_error = (() => {
|
|
1278
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1279
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1280
|
+
}
|
|
1281
|
+
const obj_appId = obj.appId;
|
|
1282
|
+
const path_appId = path + '.appId';
|
|
1283
|
+
if (typeof obj_appId !== 'string') {
|
|
1284
|
+
return new TypeError('Expected "string" but received "' + typeof obj_appId + '" (at "' + path_appId + '")');
|
|
1285
|
+
}
|
|
1286
|
+
const obj_broadcastThreadTs = obj.broadcastThreadTs;
|
|
1287
|
+
const path_broadcastThreadTs = path + '.broadcastThreadTs';
|
|
1288
|
+
if (typeof obj_broadcastThreadTs !== 'string') {
|
|
1289
|
+
return new TypeError('Expected "string" but received "' + typeof obj_broadcastThreadTs + '" (at "' + path_broadcastThreadTs + '")');
|
|
1290
|
+
}
|
|
1291
|
+
const obj_channelId = obj.channelId;
|
|
1292
|
+
const path_channelId = path + '.channelId';
|
|
1293
|
+
if (typeof obj_channelId !== 'string') {
|
|
1294
|
+
return new TypeError('Expected "string" but received "' + typeof obj_channelId + '" (at "' + path_channelId + '")');
|
|
1295
|
+
}
|
|
1296
|
+
const obj_files = obj.files;
|
|
1297
|
+
const path_files = path + '.files';
|
|
1298
|
+
if (!ArrayIsArray(obj_files)) {
|
|
1299
|
+
return new TypeError('Expected "array" but received "' + typeof obj_files + '" (at "' + path_files + '")');
|
|
1300
|
+
}
|
|
1301
|
+
for (let i = 0; i < obj_files.length; i++) {
|
|
1302
|
+
const obj_files_item = obj_files[i];
|
|
1303
|
+
const path_files_item = path_files + '[' + i + ']';
|
|
1304
|
+
if (typeof obj_files_item !== 'object') {
|
|
1305
|
+
return new TypeError('Expected "object" but received "' + typeof obj_files_item + '" (at "' + path_files_item + '")');
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
const obj_includesCustomEmoji = obj.includesCustomEmoji;
|
|
1309
|
+
const path_includesCustomEmoji = path + '.includesCustomEmoji';
|
|
1310
|
+
if (typeof obj_includesCustomEmoji !== 'boolean') {
|
|
1311
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_includesCustomEmoji + '" (at "' + path_includesCustomEmoji + '")');
|
|
1312
|
+
}
|
|
1313
|
+
const obj_isBroadcast = obj.isBroadcast;
|
|
1314
|
+
const path_isBroadcast = path + '.isBroadcast';
|
|
1315
|
+
if (typeof obj_isBroadcast !== 'boolean') {
|
|
1316
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isBroadcast + '" (at "' + path_isBroadcast + '")');
|
|
1317
|
+
}
|
|
1318
|
+
const obj_isEditable = obj.isEditable;
|
|
1319
|
+
const path_isEditable = path + '.isEditable';
|
|
1320
|
+
if (typeof obj_isEditable !== 'boolean') {
|
|
1321
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isEditable + '" (at "' + path_isEditable + '")');
|
|
1322
|
+
}
|
|
1323
|
+
const obj_isEdited = obj.isEdited;
|
|
1324
|
+
const path_isEdited = path + '.isEdited';
|
|
1325
|
+
if (typeof obj_isEdited !== 'boolean') {
|
|
1326
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isEdited + '" (at "' + path_isEdited + '")');
|
|
1327
|
+
}
|
|
1328
|
+
const obj_isFileReadAllowed = obj.isFileReadAllowed;
|
|
1329
|
+
const path_isFileReadAllowed = path + '.isFileReadAllowed';
|
|
1330
|
+
if (typeof obj_isFileReadAllowed !== 'boolean') {
|
|
1331
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isFileReadAllowed + '" (at "' + path_isFileReadAllowed + '")');
|
|
1332
|
+
}
|
|
1333
|
+
const obj_latestReplyTimestamp = obj.latestReplyTimestamp;
|
|
1334
|
+
const path_latestReplyTimestamp = path + '.latestReplyTimestamp';
|
|
1335
|
+
if (typeof obj_latestReplyTimestamp !== 'string') {
|
|
1336
|
+
return new TypeError('Expected "string" but received "' + typeof obj_latestReplyTimestamp + '" (at "' + path_latestReplyTimestamp + '")');
|
|
1337
|
+
}
|
|
1338
|
+
const obj_message = obj.message;
|
|
1339
|
+
const path_message = path + '.message';
|
|
1340
|
+
if (typeof obj_message !== 'string') {
|
|
1341
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
1342
|
+
}
|
|
1343
|
+
obj.messageEpochMillisecond;
|
|
1344
|
+
const obj_outbound = obj.outbound;
|
|
1345
|
+
const path_outbound = path + '.outbound';
|
|
1346
|
+
if (typeof obj_outbound !== 'boolean') {
|
|
1347
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_outbound + '" (at "' + path_outbound + '")');
|
|
1348
|
+
}
|
|
1349
|
+
const obj_reactions = obj.reactions;
|
|
1350
|
+
const path_reactions = path + '.reactions';
|
|
1351
|
+
if (!ArrayIsArray(obj_reactions)) {
|
|
1352
|
+
return new TypeError('Expected "array" but received "' + typeof obj_reactions + '" (at "' + path_reactions + '")');
|
|
1353
|
+
}
|
|
1354
|
+
for (let i = 0; i < obj_reactions.length; i++) {
|
|
1355
|
+
const obj_reactions_item = obj_reactions[i];
|
|
1356
|
+
const path_reactions_item = path_reactions + '[' + i + ']';
|
|
1357
|
+
if (typeof obj_reactions_item !== 'object') {
|
|
1358
|
+
return new TypeError('Expected "object" but received "' + typeof obj_reactions_item + '" (at "' + path_reactions_item + '")');
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
const obj_replyCount = obj.replyCount;
|
|
1362
|
+
const path_replyCount = path + '.replyCount';
|
|
1363
|
+
if (typeof obj_replyCount !== 'number' || (typeof obj_replyCount === 'number' && Math.floor(obj_replyCount) !== obj_replyCount)) {
|
|
1364
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_replyCount + '" (at "' + path_replyCount + '")');
|
|
1365
|
+
}
|
|
1366
|
+
const obj_replyUsers = obj.replyUsers;
|
|
1367
|
+
const path_replyUsers = path + '.replyUsers';
|
|
1368
|
+
if (!ArrayIsArray(obj_replyUsers)) {
|
|
1369
|
+
return new TypeError('Expected "array" but received "' + typeof obj_replyUsers + '" (at "' + path_replyUsers + '")');
|
|
1370
|
+
}
|
|
1371
|
+
for (let i = 0; i < obj_replyUsers.length; i++) {
|
|
1372
|
+
const obj_replyUsers_item = obj_replyUsers[i];
|
|
1373
|
+
const path_replyUsers_item = path_replyUsers + '[' + i + ']';
|
|
1374
|
+
if (typeof obj_replyUsers_item !== 'object') {
|
|
1375
|
+
return new TypeError('Expected "object" but received "' + typeof obj_replyUsers_item + '" (at "' + path_replyUsers_item + '")');
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
const obj_replyUsersCount = obj.replyUsersCount;
|
|
1379
|
+
const path_replyUsersCount = path + '.replyUsersCount';
|
|
1380
|
+
if (typeof obj_replyUsersCount !== 'number' || (typeof obj_replyUsersCount === 'number' && Math.floor(obj_replyUsersCount) !== obj_replyUsersCount)) {
|
|
1381
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_replyUsersCount + '" (at "' + path_replyUsersCount + '")');
|
|
1382
|
+
}
|
|
1383
|
+
const obj_slackMessageTs = obj.slackMessageTs;
|
|
1384
|
+
const path_slackMessageTs = path + '.slackMessageTs';
|
|
1385
|
+
if (typeof obj_slackMessageTs !== 'string') {
|
|
1386
|
+
return new TypeError('Expected "string" but received "' + typeof obj_slackMessageTs + '" (at "' + path_slackMessageTs + '")');
|
|
1387
|
+
}
|
|
1388
|
+
const obj_subtype = obj.subtype;
|
|
1389
|
+
const path_subtype = path + '.subtype';
|
|
1390
|
+
if (typeof obj_subtype !== 'string') {
|
|
1391
|
+
return new TypeError('Expected "string" but received "' + typeof obj_subtype + '" (at "' + path_subtype + '")');
|
|
1392
|
+
}
|
|
1393
|
+
const obj_teamId = obj.teamId;
|
|
1394
|
+
const path_teamId = path + '.teamId';
|
|
1395
|
+
if (typeof obj_teamId !== 'string') {
|
|
1396
|
+
return new TypeError('Expected "string" but received "' + typeof obj_teamId + '" (at "' + path_teamId + '")');
|
|
1397
|
+
}
|
|
1398
|
+
const obj_threadTs = obj.threadTs;
|
|
1399
|
+
const path_threadTs = path + '.threadTs';
|
|
1400
|
+
if (typeof obj_threadTs !== 'string') {
|
|
1401
|
+
return new TypeError('Expected "string" but received "' + typeof obj_threadTs + '" (at "' + path_threadTs + '")');
|
|
1402
|
+
}
|
|
1403
|
+
const obj_type = obj.type;
|
|
1404
|
+
const path_type = path + '.type';
|
|
1405
|
+
if (typeof obj_type !== 'string') {
|
|
1406
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
1407
|
+
}
|
|
1408
|
+
const obj_uniqueKey = obj.uniqueKey;
|
|
1409
|
+
const path_uniqueKey = path + '.uniqueKey';
|
|
1410
|
+
if (typeof obj_uniqueKey !== 'string') {
|
|
1411
|
+
return new TypeError('Expected "string" but received "' + typeof obj_uniqueKey + '" (at "' + path_uniqueKey + '")');
|
|
1412
|
+
}
|
|
1413
|
+
const obj_url = obj.url;
|
|
1414
|
+
const path_url = path + '.url';
|
|
1415
|
+
if (typeof obj_url !== 'string') {
|
|
1416
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
1417
|
+
}
|
|
1418
|
+
const obj_userInfo = obj.userInfo;
|
|
1419
|
+
const path_userInfo = path + '.userInfo';
|
|
1420
|
+
if (typeof obj_userInfo !== 'object') {
|
|
1421
|
+
return new TypeError('Expected "object" but received "' + typeof obj_userInfo + '" (at "' + path_userInfo + '")');
|
|
1422
|
+
}
|
|
1423
|
+
})();
|
|
1424
|
+
return v_error === undefined ? null : v_error;
|
|
1425
|
+
}
|
|
1426
|
+
const RepresentationType$5 = 'SlackMessageOutputRepresentation';
|
|
1427
|
+
function keyBuilder$d(luvio, config) {
|
|
1428
|
+
return keyPrefix + '::' + RepresentationType$5 + ':' + config.messageTimestamp;
|
|
1429
|
+
}
|
|
1430
|
+
function keyBuilderFromType$3(luvio, object) {
|
|
1431
|
+
const keyParams = {
|
|
1432
|
+
messageTimestamp: object.slackMessageTs
|
|
1433
|
+
};
|
|
1434
|
+
return keyBuilder$d(luvio, keyParams);
|
|
1435
|
+
}
|
|
1436
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
1437
|
+
const input_files = input.files;
|
|
1438
|
+
const input_files_id = path.fullPath + '__files';
|
|
1439
|
+
for (let i = 0; i < input_files.length; i++) {
|
|
1440
|
+
const input_files_item = input_files[i];
|
|
1441
|
+
let input_files_item_id = input_files_id + '__' + i;
|
|
1442
|
+
input_files[i] = ingest$8(input_files_item, {
|
|
1443
|
+
fullPath: input_files_item_id,
|
|
1444
|
+
propertyName: i,
|
|
1445
|
+
parent: {
|
|
1446
|
+
data: input,
|
|
1447
|
+
key: path.fullPath,
|
|
1448
|
+
existing: existing,
|
|
1449
|
+
},
|
|
1450
|
+
ttl: path.ttl
|
|
1451
|
+
}, luvio, store, timestamp);
|
|
1452
|
+
}
|
|
1453
|
+
const input_reactions = input.reactions;
|
|
1454
|
+
const input_reactions_id = path.fullPath + '__reactions';
|
|
1455
|
+
for (let i = 0; i < input_reactions.length; i++) {
|
|
1456
|
+
const input_reactions_item = input_reactions[i];
|
|
1457
|
+
let input_reactions_item_id = input_reactions_id + '__' + i;
|
|
1458
|
+
input_reactions[i] = ingest$6(input_reactions_item, {
|
|
1459
|
+
fullPath: input_reactions_item_id,
|
|
1460
|
+
propertyName: i,
|
|
1461
|
+
parent: {
|
|
1462
|
+
data: input,
|
|
1463
|
+
key: path.fullPath,
|
|
1464
|
+
existing: existing,
|
|
1465
|
+
},
|
|
1466
|
+
ttl: path.ttl
|
|
1467
|
+
}, luvio, store, timestamp);
|
|
1468
|
+
}
|
|
1469
|
+
const input_replyUsers = input.replyUsers;
|
|
1470
|
+
const input_replyUsers_id = path.fullPath + '__replyUsers';
|
|
1471
|
+
for (let i = 0; i < input_replyUsers.length; i++) {
|
|
1472
|
+
const input_replyUsers_item = input_replyUsers[i];
|
|
1473
|
+
let input_replyUsers_item_id = input_replyUsers_id + '__' + i;
|
|
1474
|
+
input_replyUsers[i] = ingest$7(input_replyUsers_item, {
|
|
1475
|
+
fullPath: input_replyUsers_item_id,
|
|
1476
|
+
propertyName: i,
|
|
1477
|
+
parent: {
|
|
1478
|
+
data: input,
|
|
1479
|
+
key: path.fullPath,
|
|
1480
|
+
existing: existing,
|
|
1481
|
+
},
|
|
1482
|
+
ttl: path.ttl
|
|
1483
|
+
}, luvio, store, timestamp);
|
|
1484
|
+
}
|
|
1485
|
+
const input_userInfo = input.userInfo;
|
|
1486
|
+
const input_userInfo_id = path.fullPath + '__userInfo';
|
|
1487
|
+
input.userInfo = ingest$7(input_userInfo, {
|
|
1488
|
+
fullPath: input_userInfo_id,
|
|
1489
|
+
propertyName: 'userInfo',
|
|
1490
|
+
parent: {
|
|
1491
|
+
data: input,
|
|
1492
|
+
key: path.fullPath,
|
|
1493
|
+
existing: existing,
|
|
1494
|
+
},
|
|
1495
|
+
ttl: path.ttl
|
|
1496
|
+
}, luvio, store, timestamp);
|
|
1497
|
+
return input;
|
|
1498
|
+
}
|
|
1499
|
+
const select$c = function SlackMessageOutputRepresentationSelect() {
|
|
1500
|
+
return {
|
|
1501
|
+
kind: 'Fragment',
|
|
1502
|
+
version: VERSION$5,
|
|
1503
|
+
private: [],
|
|
1504
|
+
selections: [
|
|
1505
|
+
{
|
|
1506
|
+
name: 'appId',
|
|
1507
|
+
kind: 'Scalar'
|
|
1508
|
+
},
|
|
1509
|
+
{
|
|
1510
|
+
name: 'broadcastThreadTs',
|
|
1511
|
+
kind: 'Scalar'
|
|
1512
|
+
},
|
|
1513
|
+
{
|
|
1514
|
+
name: 'channelId',
|
|
1515
|
+
kind: 'Scalar'
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
name: 'files',
|
|
1519
|
+
kind: 'Link',
|
|
1520
|
+
plural: true,
|
|
1521
|
+
fragment: select$g()
|
|
1522
|
+
},
|
|
1523
|
+
{
|
|
1524
|
+
name: 'includesCustomEmoji',
|
|
1525
|
+
kind: 'Scalar'
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
name: 'isBroadcast',
|
|
1529
|
+
kind: 'Scalar'
|
|
1530
|
+
},
|
|
1531
|
+
{
|
|
1532
|
+
name: 'isEditable',
|
|
1533
|
+
kind: 'Scalar'
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
name: 'isEdited',
|
|
1537
|
+
kind: 'Scalar'
|
|
1538
|
+
},
|
|
1539
|
+
{
|
|
1540
|
+
name: 'isFileReadAllowed',
|
|
1541
|
+
kind: 'Scalar'
|
|
1542
|
+
},
|
|
1543
|
+
{
|
|
1544
|
+
name: 'latestReplyTimestamp',
|
|
1545
|
+
kind: 'Scalar'
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
name: 'message',
|
|
1549
|
+
kind: 'Scalar'
|
|
1550
|
+
},
|
|
1551
|
+
{
|
|
1552
|
+
name: 'messageEpochMillisecond',
|
|
1553
|
+
kind: 'Scalar'
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
name: 'outbound',
|
|
1557
|
+
kind: 'Scalar'
|
|
1558
|
+
},
|
|
1559
|
+
{
|
|
1560
|
+
name: 'reactions',
|
|
1561
|
+
kind: 'Link',
|
|
1562
|
+
plural: true,
|
|
1563
|
+
fragment: select$d()
|
|
1564
|
+
},
|
|
1565
|
+
{
|
|
1566
|
+
name: 'replyCount',
|
|
1567
|
+
kind: 'Scalar'
|
|
1568
|
+
},
|
|
1569
|
+
{
|
|
1570
|
+
name: 'replyUsers',
|
|
1571
|
+
kind: 'Link',
|
|
1572
|
+
plural: true,
|
|
1573
|
+
fragment: select$e()
|
|
1574
|
+
},
|
|
1575
|
+
{
|
|
1576
|
+
name: 'replyUsersCount',
|
|
1577
|
+
kind: 'Scalar'
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
name: 'slackMessageTs',
|
|
1581
|
+
kind: 'Scalar'
|
|
1582
|
+
},
|
|
1583
|
+
{
|
|
1584
|
+
name: 'subtype',
|
|
1585
|
+
kind: 'Scalar'
|
|
1586
|
+
},
|
|
1587
|
+
{
|
|
1588
|
+
name: 'teamId',
|
|
1589
|
+
kind: 'Scalar'
|
|
1590
|
+
},
|
|
1591
|
+
{
|
|
1592
|
+
name: 'threadTs',
|
|
1593
|
+
kind: 'Scalar'
|
|
1594
|
+
},
|
|
1595
|
+
{
|
|
1596
|
+
name: 'type',
|
|
1597
|
+
kind: 'Scalar'
|
|
1598
|
+
},
|
|
1599
|
+
{
|
|
1600
|
+
name: 'uniqueKey',
|
|
1601
|
+
kind: 'Scalar'
|
|
1602
|
+
},
|
|
1603
|
+
{
|
|
1604
|
+
name: 'url',
|
|
1605
|
+
kind: 'Scalar'
|
|
1606
|
+
},
|
|
1607
|
+
{
|
|
1608
|
+
name: 'userInfo',
|
|
1609
|
+
kind: 'Link',
|
|
1610
|
+
fragment: select$e()
|
|
1611
|
+
}
|
|
1612
|
+
]
|
|
1613
|
+
};
|
|
1614
|
+
};
|
|
1615
|
+
function equals$5(existing, incoming) {
|
|
1616
|
+
const existing_includesCustomEmoji = existing.includesCustomEmoji;
|
|
1617
|
+
const incoming_includesCustomEmoji = incoming.includesCustomEmoji;
|
|
1618
|
+
if (!(existing_includesCustomEmoji === incoming_includesCustomEmoji)) {
|
|
1619
|
+
return false;
|
|
1620
|
+
}
|
|
1621
|
+
const existing_isBroadcast = existing.isBroadcast;
|
|
1622
|
+
const incoming_isBroadcast = incoming.isBroadcast;
|
|
1623
|
+
if (!(existing_isBroadcast === incoming_isBroadcast)) {
|
|
1624
|
+
return false;
|
|
1625
|
+
}
|
|
1626
|
+
const existing_isEditable = existing.isEditable;
|
|
1627
|
+
const incoming_isEditable = incoming.isEditable;
|
|
1628
|
+
if (!(existing_isEditable === incoming_isEditable)) {
|
|
1629
|
+
return false;
|
|
1630
|
+
}
|
|
1631
|
+
const existing_isEdited = existing.isEdited;
|
|
1632
|
+
const incoming_isEdited = incoming.isEdited;
|
|
1633
|
+
if (!(existing_isEdited === incoming_isEdited)) {
|
|
1634
|
+
return false;
|
|
1635
|
+
}
|
|
1636
|
+
const existing_isFileReadAllowed = existing.isFileReadAllowed;
|
|
1637
|
+
const incoming_isFileReadAllowed = incoming.isFileReadAllowed;
|
|
1638
|
+
if (!(existing_isFileReadAllowed === incoming_isFileReadAllowed)) {
|
|
1639
|
+
return false;
|
|
1640
|
+
}
|
|
1641
|
+
const existing_outbound = existing.outbound;
|
|
1642
|
+
const incoming_outbound = incoming.outbound;
|
|
1643
|
+
if (!(existing_outbound === incoming_outbound)) {
|
|
1644
|
+
return false;
|
|
1645
|
+
}
|
|
1646
|
+
const existing_replyCount = existing.replyCount;
|
|
1647
|
+
const incoming_replyCount = incoming.replyCount;
|
|
1648
|
+
if (!(existing_replyCount === incoming_replyCount)) {
|
|
1649
|
+
return false;
|
|
1650
|
+
}
|
|
1651
|
+
const existing_replyUsersCount = existing.replyUsersCount;
|
|
1652
|
+
const incoming_replyUsersCount = incoming.replyUsersCount;
|
|
1653
|
+
if (!(existing_replyUsersCount === incoming_replyUsersCount)) {
|
|
1654
|
+
return false;
|
|
1655
|
+
}
|
|
1656
|
+
const existing_appId = existing.appId;
|
|
1657
|
+
const incoming_appId = incoming.appId;
|
|
1658
|
+
if (!(existing_appId === incoming_appId)) {
|
|
1659
|
+
return false;
|
|
1660
|
+
}
|
|
1661
|
+
const existing_broadcastThreadTs = existing.broadcastThreadTs;
|
|
1662
|
+
const incoming_broadcastThreadTs = incoming.broadcastThreadTs;
|
|
1663
|
+
if (!(existing_broadcastThreadTs === incoming_broadcastThreadTs)) {
|
|
1664
|
+
return false;
|
|
1665
|
+
}
|
|
1666
|
+
const existing_channelId = existing.channelId;
|
|
1667
|
+
const incoming_channelId = incoming.channelId;
|
|
1668
|
+
if (!(existing_channelId === incoming_channelId)) {
|
|
1669
|
+
return false;
|
|
1670
|
+
}
|
|
1671
|
+
const existing_latestReplyTimestamp = existing.latestReplyTimestamp;
|
|
1672
|
+
const incoming_latestReplyTimestamp = incoming.latestReplyTimestamp;
|
|
1673
|
+
if (!(existing_latestReplyTimestamp === incoming_latestReplyTimestamp)) {
|
|
1674
|
+
return false;
|
|
1675
|
+
}
|
|
1676
|
+
const existing_message = existing.message;
|
|
1677
|
+
const incoming_message = incoming.message;
|
|
1678
|
+
if (!(existing_message === incoming_message)) {
|
|
1679
|
+
return false;
|
|
1680
|
+
}
|
|
1681
|
+
const existing_slackMessageTs = existing.slackMessageTs;
|
|
1682
|
+
const incoming_slackMessageTs = incoming.slackMessageTs;
|
|
1683
|
+
if (!(existing_slackMessageTs === incoming_slackMessageTs)) {
|
|
1684
|
+
return false;
|
|
1685
|
+
}
|
|
1686
|
+
const existing_subtype = existing.subtype;
|
|
1687
|
+
const incoming_subtype = incoming.subtype;
|
|
1688
|
+
if (!(existing_subtype === incoming_subtype)) {
|
|
1689
|
+
return false;
|
|
1690
|
+
}
|
|
1691
|
+
const existing_teamId = existing.teamId;
|
|
1692
|
+
const incoming_teamId = incoming.teamId;
|
|
1693
|
+
if (!(existing_teamId === incoming_teamId)) {
|
|
1694
|
+
return false;
|
|
1695
|
+
}
|
|
1696
|
+
const existing_threadTs = existing.threadTs;
|
|
1697
|
+
const incoming_threadTs = incoming.threadTs;
|
|
1698
|
+
if (!(existing_threadTs === incoming_threadTs)) {
|
|
1699
|
+
return false;
|
|
1700
|
+
}
|
|
1701
|
+
const existing_type = existing.type;
|
|
1702
|
+
const incoming_type = incoming.type;
|
|
1703
|
+
if (!(existing_type === incoming_type)) {
|
|
1704
|
+
return false;
|
|
1705
|
+
}
|
|
1706
|
+
const existing_uniqueKey = existing.uniqueKey;
|
|
1707
|
+
const incoming_uniqueKey = incoming.uniqueKey;
|
|
1708
|
+
if (!(existing_uniqueKey === incoming_uniqueKey)) {
|
|
1709
|
+
return false;
|
|
1710
|
+
}
|
|
1711
|
+
const existing_url = existing.url;
|
|
1712
|
+
const incoming_url = incoming.url;
|
|
1713
|
+
if (!(existing_url === incoming_url)) {
|
|
1714
|
+
return false;
|
|
1715
|
+
}
|
|
1716
|
+
const existing_messageEpochMillisecond = existing.messageEpochMillisecond;
|
|
1717
|
+
const incoming_messageEpochMillisecond = incoming.messageEpochMillisecond;
|
|
1718
|
+
if (!(existing_messageEpochMillisecond === incoming_messageEpochMillisecond)) {
|
|
1719
|
+
return false;
|
|
1720
|
+
}
|
|
1721
|
+
const existing_files = existing.files;
|
|
1722
|
+
const incoming_files = incoming.files;
|
|
1723
|
+
const equals_files_items = equalsArray(existing_files, incoming_files, (existing_files_item, incoming_files_item) => {
|
|
1724
|
+
if (!(existing_files_item.__ref === incoming_files_item.__ref)) {
|
|
1725
|
+
return false;
|
|
1726
|
+
}
|
|
1727
|
+
});
|
|
1728
|
+
if (equals_files_items === false) {
|
|
1729
|
+
return false;
|
|
1730
|
+
}
|
|
1731
|
+
const existing_reactions = existing.reactions;
|
|
1732
|
+
const incoming_reactions = incoming.reactions;
|
|
1733
|
+
const equals_reactions_items = equalsArray(existing_reactions, incoming_reactions, (existing_reactions_item, incoming_reactions_item) => {
|
|
1734
|
+
if (!(existing_reactions_item.__ref === incoming_reactions_item.__ref)) {
|
|
1735
|
+
return false;
|
|
1736
|
+
}
|
|
1737
|
+
});
|
|
1738
|
+
if (equals_reactions_items === false) {
|
|
1739
|
+
return false;
|
|
1740
|
+
}
|
|
1741
|
+
const existing_replyUsers = existing.replyUsers;
|
|
1742
|
+
const incoming_replyUsers = incoming.replyUsers;
|
|
1743
|
+
const equals_replyUsers_items = equalsArray(existing_replyUsers, incoming_replyUsers, (existing_replyUsers_item, incoming_replyUsers_item) => {
|
|
1744
|
+
if (!(existing_replyUsers_item.__ref === incoming_replyUsers_item.__ref)) {
|
|
1745
|
+
return false;
|
|
1746
|
+
}
|
|
1747
|
+
});
|
|
1748
|
+
if (equals_replyUsers_items === false) {
|
|
1749
|
+
return false;
|
|
1750
|
+
}
|
|
1751
|
+
const existing_userInfo = existing.userInfo;
|
|
1752
|
+
const incoming_userInfo = incoming.userInfo;
|
|
1753
|
+
if (!(existing_userInfo.__ref === incoming_userInfo.__ref)) {
|
|
1754
|
+
return false;
|
|
1755
|
+
}
|
|
1756
|
+
return true;
|
|
1757
|
+
}
|
|
1758
|
+
const ingest$5 = function SlackMessageOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1759
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1760
|
+
const validateError = validate$5(input);
|
|
1761
|
+
if (validateError !== null) {
|
|
1762
|
+
throw validateError;
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
const key = keyBuilderFromType$3(luvio, input);
|
|
1766
|
+
const ttlToUse = TTL$2;
|
|
1767
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "Slack", VERSION$5, RepresentationType$5, equals$5);
|
|
1768
|
+
return createLink(key);
|
|
1769
|
+
};
|
|
1770
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
1771
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1772
|
+
const rootKey = keyBuilderFromType$3(luvio, input);
|
|
1773
|
+
rootKeySet.set(rootKey, {
|
|
1774
|
+
namespace: keyPrefix,
|
|
1775
|
+
representationName: RepresentationType$5,
|
|
1776
|
+
mergeable: false
|
|
1777
|
+
});
|
|
1778
|
+
const input_files_length = input.files.length;
|
|
1779
|
+
for (let i = 0; i < input_files_length; i++) {
|
|
1780
|
+
getTypeCacheKeys$8(rootKeySet, luvio, input.files[i]);
|
|
1781
|
+
}
|
|
1782
|
+
const input_reactions_length = input.reactions.length;
|
|
1783
|
+
for (let i = 0; i < input_reactions_length; i++) {
|
|
1784
|
+
getTypeCacheKeys$6(rootKeySet, luvio, input.reactions[i], () => '');
|
|
1785
|
+
}
|
|
1786
|
+
const input_replyUsers_length = input.replyUsers.length;
|
|
1787
|
+
for (let i = 0; i < input_replyUsers_length; i++) {
|
|
1788
|
+
getTypeCacheKeys$7(rootKeySet, luvio, input.replyUsers[i]);
|
|
1789
|
+
}
|
|
1790
|
+
getTypeCacheKeys$7(rootKeySet, luvio, input.userInfo);
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
const VERSION$4 = "e4e8c704e6c946c65744ccd361f036ba";
|
|
1794
|
+
function validate$4(obj, path = 'SlackConversationOutputRepresentation') {
|
|
1795
|
+
const v_error = (() => {
|
|
1796
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1797
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1798
|
+
}
|
|
1799
|
+
const obj_appId = obj.appId;
|
|
1800
|
+
const path_appId = path + '.appId';
|
|
1801
|
+
if (typeof obj_appId !== 'string') {
|
|
1802
|
+
return new TypeError('Expected "string" but received "' + typeof obj_appId + '" (at "' + path_appId + '")');
|
|
1803
|
+
}
|
|
1804
|
+
const obj_channelId = obj.channelId;
|
|
1805
|
+
const path_channelId = path + '.channelId';
|
|
1806
|
+
if (typeof obj_channelId !== 'string') {
|
|
1807
|
+
return new TypeError('Expected "string" but received "' + typeof obj_channelId + '" (at "' + path_channelId + '")');
|
|
1808
|
+
}
|
|
1809
|
+
const obj_contextUserInfo = obj.contextUserInfo;
|
|
1810
|
+
const path_contextUserInfo = path + '.contextUserInfo';
|
|
1811
|
+
if (typeof obj_contextUserInfo !== 'object') {
|
|
1812
|
+
return new TypeError('Expected "object" but received "' + typeof obj_contextUserInfo + '" (at "' + path_contextUserInfo + '")');
|
|
1813
|
+
}
|
|
1814
|
+
const obj_hasMore = obj.hasMore;
|
|
1815
|
+
const path_hasMore = path + '.hasMore';
|
|
1816
|
+
if (typeof obj_hasMore !== 'boolean') {
|
|
1817
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_hasMore + '" (at "' + path_hasMore + '")');
|
|
1818
|
+
}
|
|
1819
|
+
const obj_latestMessageTs = obj.latestMessageTs;
|
|
1820
|
+
const path_latestMessageTs = path + '.latestMessageTs';
|
|
1821
|
+
if (typeof obj_latestMessageTs !== 'string') {
|
|
1822
|
+
return new TypeError('Expected "string" but received "' + typeof obj_latestMessageTs + '" (at "' + path_latestMessageTs + '")');
|
|
1823
|
+
}
|
|
1824
|
+
const obj_messages = obj.messages;
|
|
1825
|
+
const path_messages = path + '.messages';
|
|
1826
|
+
if (!ArrayIsArray(obj_messages)) {
|
|
1827
|
+
return new TypeError('Expected "array" but received "' + typeof obj_messages + '" (at "' + path_messages + '")');
|
|
1828
|
+
}
|
|
1829
|
+
for (let i = 0; i < obj_messages.length; i++) {
|
|
1830
|
+
const obj_messages_item = obj_messages[i];
|
|
1831
|
+
const path_messages_item = path_messages + '[' + i + ']';
|
|
1832
|
+
if (typeof obj_messages_item !== 'object') {
|
|
1833
|
+
return new TypeError('Expected "object" but received "' + typeof obj_messages_item + '" (at "' + path_messages_item + '")');
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
const obj_oldestMessageTs = obj.oldestMessageTs;
|
|
1837
|
+
const path_oldestMessageTs = path + '.oldestMessageTs';
|
|
1838
|
+
if (typeof obj_oldestMessageTs !== 'string') {
|
|
1839
|
+
return new TypeError('Expected "string" but received "' + typeof obj_oldestMessageTs + '" (at "' + path_oldestMessageTs + '")');
|
|
1840
|
+
}
|
|
1841
|
+
const obj_teamId = obj.teamId;
|
|
1842
|
+
const path_teamId = path + '.teamId';
|
|
1843
|
+
if (typeof obj_teamId !== 'string') {
|
|
1844
|
+
return new TypeError('Expected "string" but received "' + typeof obj_teamId + '" (at "' + path_teamId + '")');
|
|
1845
|
+
}
|
|
1846
|
+
const obj_threadTs = obj.threadTs;
|
|
1847
|
+
const path_threadTs = path + '.threadTs';
|
|
1848
|
+
if (typeof obj_threadTs !== 'string') {
|
|
1849
|
+
return new TypeError('Expected "string" but received "' + typeof obj_threadTs + '" (at "' + path_threadTs + '")');
|
|
1850
|
+
}
|
|
1851
|
+
})();
|
|
1852
|
+
return v_error === undefined ? null : v_error;
|
|
1853
|
+
}
|
|
1854
|
+
const RepresentationType$4 = 'SlackConversationOutputRepresentation';
|
|
1855
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
1856
|
+
const input_contextUserInfo = input.contextUserInfo;
|
|
1857
|
+
const input_contextUserInfo_id = path.fullPath + '__contextUserInfo';
|
|
1858
|
+
input.contextUserInfo = ingest$7(input_contextUserInfo, {
|
|
1859
|
+
fullPath: input_contextUserInfo_id,
|
|
1860
|
+
propertyName: 'contextUserInfo',
|
|
1861
|
+
parent: {
|
|
1862
|
+
data: input,
|
|
1863
|
+
key: path.fullPath,
|
|
1864
|
+
existing: existing,
|
|
1865
|
+
},
|
|
1866
|
+
ttl: path.ttl
|
|
1867
|
+
}, luvio, store, timestamp);
|
|
1868
|
+
const input_messages = input.messages;
|
|
1869
|
+
const input_messages_id = path.fullPath + '__messages';
|
|
1870
|
+
for (let i = 0; i < input_messages.length; i++) {
|
|
1871
|
+
const input_messages_item = input_messages[i];
|
|
1872
|
+
let input_messages_item_id = input_messages_id + '__' + i;
|
|
1873
|
+
input_messages[i] = ingest$5(input_messages_item, {
|
|
1874
|
+
fullPath: input_messages_item_id,
|
|
1875
|
+
propertyName: i,
|
|
1876
|
+
parent: {
|
|
1877
|
+
data: input,
|
|
1878
|
+
key: path.fullPath,
|
|
1879
|
+
existing: existing,
|
|
1880
|
+
},
|
|
1881
|
+
ttl: path.ttl
|
|
1882
|
+
}, luvio, store, timestamp);
|
|
1883
|
+
}
|
|
1884
|
+
return input;
|
|
1885
|
+
}
|
|
1886
|
+
const select$b = function SlackConversationOutputRepresentationSelect() {
|
|
1887
|
+
return {
|
|
1888
|
+
kind: 'Fragment',
|
|
1889
|
+
version: VERSION$4,
|
|
1890
|
+
private: [],
|
|
1891
|
+
selections: [
|
|
1892
|
+
{
|
|
1893
|
+
name: 'appId',
|
|
1894
|
+
kind: 'Scalar'
|
|
1895
|
+
},
|
|
1896
|
+
{
|
|
1897
|
+
name: 'channelId',
|
|
1898
|
+
kind: 'Scalar'
|
|
1899
|
+
},
|
|
1900
|
+
{
|
|
1901
|
+
name: 'contextUserInfo',
|
|
1902
|
+
kind: 'Link',
|
|
1903
|
+
fragment: select$e()
|
|
1904
|
+
},
|
|
1905
|
+
{
|
|
1906
|
+
name: 'hasMore',
|
|
1907
|
+
kind: 'Scalar'
|
|
1908
|
+
},
|
|
1909
|
+
{
|
|
1910
|
+
name: 'latestMessageTs',
|
|
1911
|
+
kind: 'Scalar'
|
|
1912
|
+
},
|
|
1913
|
+
{
|
|
1914
|
+
name: 'messages',
|
|
1915
|
+
kind: 'Link',
|
|
1916
|
+
plural: true,
|
|
1917
|
+
fragment: select$c()
|
|
1918
|
+
},
|
|
1919
|
+
{
|
|
1920
|
+
name: 'oldestMessageTs',
|
|
1921
|
+
kind: 'Scalar'
|
|
1922
|
+
},
|
|
1923
|
+
{
|
|
1924
|
+
name: 'teamId',
|
|
1925
|
+
kind: 'Scalar'
|
|
1926
|
+
},
|
|
1927
|
+
{
|
|
1928
|
+
name: 'threadTs',
|
|
1929
|
+
kind: 'Scalar'
|
|
1930
|
+
}
|
|
1931
|
+
]
|
|
1932
|
+
};
|
|
1933
|
+
};
|
|
1934
|
+
function equals$4(existing, incoming) {
|
|
1935
|
+
const existing_hasMore = existing.hasMore;
|
|
1936
|
+
const incoming_hasMore = incoming.hasMore;
|
|
1937
|
+
if (!(existing_hasMore === incoming_hasMore)) {
|
|
1938
|
+
return false;
|
|
1939
|
+
}
|
|
1940
|
+
const existing_appId = existing.appId;
|
|
1941
|
+
const incoming_appId = incoming.appId;
|
|
1942
|
+
if (!(existing_appId === incoming_appId)) {
|
|
1943
|
+
return false;
|
|
1944
|
+
}
|
|
1945
|
+
const existing_channelId = existing.channelId;
|
|
1946
|
+
const incoming_channelId = incoming.channelId;
|
|
1947
|
+
if (!(existing_channelId === incoming_channelId)) {
|
|
1948
|
+
return false;
|
|
1949
|
+
}
|
|
1950
|
+
const existing_latestMessageTs = existing.latestMessageTs;
|
|
1951
|
+
const incoming_latestMessageTs = incoming.latestMessageTs;
|
|
1952
|
+
if (!(existing_latestMessageTs === incoming_latestMessageTs)) {
|
|
1953
|
+
return false;
|
|
1954
|
+
}
|
|
1955
|
+
const existing_oldestMessageTs = existing.oldestMessageTs;
|
|
1956
|
+
const incoming_oldestMessageTs = incoming.oldestMessageTs;
|
|
1957
|
+
if (!(existing_oldestMessageTs === incoming_oldestMessageTs)) {
|
|
1958
|
+
return false;
|
|
1959
|
+
}
|
|
1960
|
+
const existing_teamId = existing.teamId;
|
|
1961
|
+
const incoming_teamId = incoming.teamId;
|
|
1962
|
+
if (!(existing_teamId === incoming_teamId)) {
|
|
1963
|
+
return false;
|
|
1964
|
+
}
|
|
1965
|
+
const existing_threadTs = existing.threadTs;
|
|
1966
|
+
const incoming_threadTs = incoming.threadTs;
|
|
1967
|
+
if (!(existing_threadTs === incoming_threadTs)) {
|
|
1968
|
+
return false;
|
|
1969
|
+
}
|
|
1970
|
+
const existing_contextUserInfo = existing.contextUserInfo;
|
|
1971
|
+
const incoming_contextUserInfo = incoming.contextUserInfo;
|
|
1972
|
+
if (!(existing_contextUserInfo.__ref === incoming_contextUserInfo.__ref)) {
|
|
1973
|
+
return false;
|
|
1974
|
+
}
|
|
1975
|
+
const existing_messages = existing.messages;
|
|
1976
|
+
const incoming_messages = incoming.messages;
|
|
1977
|
+
const equals_messages_items = equalsArray(existing_messages, incoming_messages, (existing_messages_item, incoming_messages_item) => {
|
|
1978
|
+
if (!(existing_messages_item.__ref === incoming_messages_item.__ref)) {
|
|
1979
|
+
return false;
|
|
1980
|
+
}
|
|
1981
|
+
});
|
|
1982
|
+
if (equals_messages_items === false) {
|
|
1983
|
+
return false;
|
|
1984
|
+
}
|
|
1985
|
+
return true;
|
|
1986
|
+
}
|
|
1987
|
+
const ingest$4 = function SlackConversationOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1988
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1989
|
+
const validateError = validate$4(input);
|
|
1990
|
+
if (validateError !== null) {
|
|
1991
|
+
throw validateError;
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
const key = path.fullPath;
|
|
1995
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
|
|
1996
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "Slack", VERSION$4, RepresentationType$4, equals$4);
|
|
1997
|
+
return createLink(key);
|
|
1998
|
+
};
|
|
1999
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
2000
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2001
|
+
const rootKey = fullPathFactory();
|
|
2002
|
+
rootKeySet.set(rootKey, {
|
|
2003
|
+
namespace: keyPrefix,
|
|
2004
|
+
representationName: RepresentationType$4,
|
|
2005
|
+
mergeable: false
|
|
2006
|
+
});
|
|
2007
|
+
getTypeCacheKeys$7(rootKeySet, luvio, input.contextUserInfo);
|
|
2008
|
+
const input_messages_length = input.messages.length;
|
|
2009
|
+
for (let i = 0; i < input_messages_length; i++) {
|
|
2010
|
+
getTypeCacheKeys$5(rootKeySet, luvio, input.messages[i]);
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
|
|
2014
|
+
function select$a(luvio, params) {
|
|
2015
|
+
return select$b();
|
|
2016
|
+
}
|
|
2017
|
+
function keyBuilder$c(luvio, params) {
|
|
2018
|
+
return keyPrefix + '::SlackConversationOutputRepresentation:(' + 'appId:' + params.queryParams.appId + ',' + 'channelId:' + params.queryParams.channelId + ',' + 'latestMessageTs:' + params.queryParams.latestMessageTs + ',' + 'limit:' + params.queryParams.limit + ',' + 'parentMessageTs:' + params.queryParams.parentMessageTs + ',' + 'relatedRecordId:' + params.queryParams.relatedRecordId + ',' + 'teamId:' + params.queryParams.teamId + ')';
|
|
2019
|
+
}
|
|
2020
|
+
function getResponseCacheKeys$8(storeKeyMap, luvio, resourceParams, response) {
|
|
2021
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$c(luvio, resourceParams));
|
|
2022
|
+
}
|
|
2023
|
+
function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
2024
|
+
const { body } = response;
|
|
2025
|
+
const key = keyBuilder$c(luvio, resourceParams);
|
|
2026
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
2027
|
+
const snapshot = luvio.storeLookup({
|
|
2028
|
+
recordId: key,
|
|
2029
|
+
node: select$a(),
|
|
2030
|
+
variables: {},
|
|
2031
|
+
}, snapshotRefresh);
|
|
2032
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2033
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2034
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
deepFreeze(snapshot.data);
|
|
2038
|
+
return snapshot;
|
|
2039
|
+
}
|
|
2040
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
2041
|
+
const key = keyBuilder$c(luvio, params);
|
|
2042
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2043
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
2044
|
+
return errorSnapshot;
|
|
2045
|
+
}
|
|
2046
|
+
function createResourceRequest$8(config) {
|
|
2047
|
+
const headers = {};
|
|
2048
|
+
return {
|
|
2049
|
+
baseUri: '/services/data/v62.0',
|
|
2050
|
+
basePath: '/connect/swarming/conversation/messages',
|
|
2051
|
+
method: 'get',
|
|
2052
|
+
body: null,
|
|
2053
|
+
urlParams: {},
|
|
2054
|
+
queryParams: config.queryParams,
|
|
2055
|
+
headers,
|
|
2056
|
+
priority: 'normal',
|
|
2057
|
+
};
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
const adapterName$8 = 'getSlackConversation';
|
|
2061
|
+
const getSlackConversation_ConfigPropertyMetadata = [
|
|
2062
|
+
generateParamConfigMetadata('appId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2063
|
+
generateParamConfigMetadata('channelId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2064
|
+
generateParamConfigMetadata('latestMessageTs', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2065
|
+
generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
2066
|
+
generateParamConfigMetadata('parentMessageTs', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2067
|
+
generateParamConfigMetadata('relatedRecordId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2068
|
+
generateParamConfigMetadata('teamId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2069
|
+
];
|
|
2070
|
+
const getSlackConversation_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$8, getSlackConversation_ConfigPropertyMetadata);
|
|
2071
|
+
const createResourceParams$8 = /*#__PURE__*/ createResourceParams$b(getSlackConversation_ConfigPropertyMetadata);
|
|
2072
|
+
function keyBuilder$b(luvio, config) {
|
|
2073
|
+
const resourceParams = createResourceParams$8(config);
|
|
2074
|
+
return keyBuilder$c(luvio, resourceParams);
|
|
2075
|
+
}
|
|
2076
|
+
function typeCheckConfig$8(untrustedConfig) {
|
|
2077
|
+
const config = {};
|
|
2078
|
+
typeCheckConfig$b(untrustedConfig, config, getSlackConversation_ConfigPropertyMetadata);
|
|
2079
|
+
return config;
|
|
2080
|
+
}
|
|
2081
|
+
function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
|
|
2082
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2083
|
+
return null;
|
|
2084
|
+
}
|
|
2085
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2086
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2087
|
+
}
|
|
2088
|
+
const config = typeCheckConfig$8(untrustedConfig);
|
|
2089
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2090
|
+
return null;
|
|
2091
|
+
}
|
|
2092
|
+
return config;
|
|
2093
|
+
}
|
|
2094
|
+
function adapterFragment$3(luvio, config) {
|
|
2095
|
+
createResourceParams$8(config);
|
|
2096
|
+
return select$a();
|
|
2097
|
+
}
|
|
2098
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
2099
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
|
|
2100
|
+
config,
|
|
2101
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
2102
|
+
});
|
|
2103
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2104
|
+
}
|
|
2105
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
2106
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
2107
|
+
config,
|
|
2108
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
2109
|
+
});
|
|
2110
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2111
|
+
}
|
|
2112
|
+
function buildNetworkSnapshot$8(luvio, config, options) {
|
|
2113
|
+
const resourceParams = createResourceParams$8(config);
|
|
2114
|
+
const request = createResourceRequest$8(resourceParams);
|
|
2115
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2116
|
+
.then((response) => {
|
|
2117
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
2118
|
+
const cache = new StoreKeyMap();
|
|
2119
|
+
getResponseCacheKeys$8(cache, luvio, resourceParams, response.body);
|
|
2120
|
+
return cache;
|
|
2121
|
+
});
|
|
2122
|
+
}, (response) => {
|
|
2123
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
2124
|
+
});
|
|
2125
|
+
}
|
|
2126
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
2127
|
+
return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot$8, undefined, false);
|
|
2128
|
+
}
|
|
2129
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
2130
|
+
const { luvio, config } = context;
|
|
2131
|
+
const selector = {
|
|
2132
|
+
recordId: keyBuilder$b(luvio, config),
|
|
2133
|
+
node: adapterFragment$3(luvio, config),
|
|
2134
|
+
variables: {},
|
|
2135
|
+
};
|
|
2136
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2137
|
+
config,
|
|
2138
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
2139
|
+
});
|
|
2140
|
+
return cacheSnapshot;
|
|
2141
|
+
}
|
|
2142
|
+
const getSlackConversationAdapterFactory = (luvio) => function Slack__getSlackConversation(untrustedConfig, requestContext) {
|
|
2143
|
+
const config = validateAdapterConfig$8(untrustedConfig, getSlackConversation_ConfigPropertyNames);
|
|
2144
|
+
// Invalid or incomplete config
|
|
2145
|
+
if (config === null) {
|
|
2146
|
+
return null;
|
|
2147
|
+
}
|
|
2148
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2149
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
2150
|
+
};
|
|
2151
|
+
|
|
2152
|
+
const TTL$1 = 300;
|
|
2153
|
+
const VERSION$3 = "3fbe2a2b782a04407aa59b540ea5c4ba";
|
|
2154
|
+
function validate$3(obj, path = 'SlackPostMessageOutputRepresentation') {
|
|
2155
|
+
const v_error = (() => {
|
|
2156
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2157
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2158
|
+
}
|
|
2159
|
+
const obj_channelId = obj.channelId;
|
|
2160
|
+
const path_channelId = path + '.channelId';
|
|
2161
|
+
if (typeof obj_channelId !== 'string') {
|
|
2162
|
+
return new TypeError('Expected "string" but received "' + typeof obj_channelId + '" (at "' + path_channelId + '")');
|
|
2163
|
+
}
|
|
2164
|
+
const obj_postedMessage = obj.postedMessage;
|
|
2165
|
+
const path_postedMessage = path + '.postedMessage';
|
|
2166
|
+
if (typeof obj_postedMessage !== 'object') {
|
|
2167
|
+
return new TypeError('Expected "object" but received "' + typeof obj_postedMessage + '" (at "' + path_postedMessage + '")');
|
|
2168
|
+
}
|
|
2169
|
+
const obj_timestamp = obj.timestamp;
|
|
2170
|
+
const path_timestamp = path + '.timestamp';
|
|
2171
|
+
if (typeof obj_timestamp !== 'string') {
|
|
2172
|
+
return new TypeError('Expected "string" but received "' + typeof obj_timestamp + '" (at "' + path_timestamp + '")');
|
|
2173
|
+
}
|
|
2174
|
+
})();
|
|
2175
|
+
return v_error === undefined ? null : v_error;
|
|
2176
|
+
}
|
|
2177
|
+
const RepresentationType$3 = 'SlackPostMessageOutputRepresentation';
|
|
2178
|
+
function keyBuilder$a(luvio, config) {
|
|
2179
|
+
return keyPrefix + '::' + RepresentationType$3 + ':' + config.channelId + ':' + config.timestamp;
|
|
2180
|
+
}
|
|
2181
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
2182
|
+
const keyParams = {
|
|
2183
|
+
channelId: object.channelId,
|
|
2184
|
+
timestamp: object.timestamp
|
|
2185
|
+
};
|
|
2186
|
+
return keyBuilder$a(luvio, keyParams);
|
|
2187
|
+
}
|
|
2188
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
2189
|
+
const input_postedMessage = input.postedMessage;
|
|
2190
|
+
const input_postedMessage_id = path.fullPath + '__postedMessage';
|
|
2191
|
+
input.postedMessage = ingest$5(input_postedMessage, {
|
|
2192
|
+
fullPath: input_postedMessage_id,
|
|
2193
|
+
propertyName: 'postedMessage',
|
|
2194
|
+
parent: {
|
|
2195
|
+
data: input,
|
|
2196
|
+
key: path.fullPath,
|
|
2197
|
+
existing: existing,
|
|
2198
|
+
},
|
|
2199
|
+
ttl: path.ttl
|
|
2200
|
+
}, luvio, store, timestamp);
|
|
2201
|
+
return input;
|
|
2202
|
+
}
|
|
2203
|
+
const select$9 = function SlackPostMessageOutputRepresentationSelect() {
|
|
2204
|
+
return {
|
|
2205
|
+
kind: 'Fragment',
|
|
2206
|
+
version: VERSION$3,
|
|
2207
|
+
private: [],
|
|
2208
|
+
selections: [
|
|
2209
|
+
{
|
|
2210
|
+
name: 'channelId',
|
|
2211
|
+
kind: 'Scalar'
|
|
2212
|
+
},
|
|
2213
|
+
{
|
|
2214
|
+
name: 'postedMessage',
|
|
2215
|
+
kind: 'Link',
|
|
2216
|
+
fragment: select$c()
|
|
2217
|
+
},
|
|
2218
|
+
{
|
|
2219
|
+
name: 'timestamp',
|
|
2220
|
+
kind: 'Scalar'
|
|
2221
|
+
}
|
|
2222
|
+
]
|
|
2223
|
+
};
|
|
2224
|
+
};
|
|
2225
|
+
function equals$3(existing, incoming) {
|
|
2226
|
+
const existing_channelId = existing.channelId;
|
|
2227
|
+
const incoming_channelId = incoming.channelId;
|
|
2228
|
+
if (!(existing_channelId === incoming_channelId)) {
|
|
2229
|
+
return false;
|
|
2230
|
+
}
|
|
2231
|
+
const existing_timestamp = existing.timestamp;
|
|
2232
|
+
const incoming_timestamp = incoming.timestamp;
|
|
2233
|
+
if (!(existing_timestamp === incoming_timestamp)) {
|
|
2234
|
+
return false;
|
|
2235
|
+
}
|
|
2236
|
+
const existing_postedMessage = existing.postedMessage;
|
|
2237
|
+
const incoming_postedMessage = incoming.postedMessage;
|
|
2238
|
+
if (!(existing_postedMessage.__ref === incoming_postedMessage.__ref)) {
|
|
2239
|
+
return false;
|
|
2240
|
+
}
|
|
2241
|
+
return true;
|
|
2242
|
+
}
|
|
2243
|
+
const ingest$3 = function SlackPostMessageOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2244
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2245
|
+
const validateError = validate$3(input);
|
|
2246
|
+
if (validateError !== null) {
|
|
2247
|
+
throw validateError;
|
|
2248
|
+
}
|
|
2249
|
+
}
|
|
2250
|
+
const key = keyBuilderFromType$2(luvio, input);
|
|
2251
|
+
const ttlToUse = TTL$1;
|
|
2252
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "Slack", VERSION$3, RepresentationType$3, equals$3);
|
|
2253
|
+
return createLink(key);
|
|
2254
|
+
};
|
|
2255
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
2256
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2257
|
+
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
2258
|
+
rootKeySet.set(rootKey, {
|
|
2259
|
+
namespace: keyPrefix,
|
|
2260
|
+
representationName: RepresentationType$3,
|
|
2261
|
+
mergeable: false
|
|
2262
|
+
});
|
|
2263
|
+
getTypeCacheKeys$5(rootKeySet, luvio, input.postedMessage);
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
function select$8(luvio, params) {
|
|
2267
|
+
return select$9();
|
|
2268
|
+
}
|
|
2269
|
+
function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
|
|
2270
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
2271
|
+
}
|
|
2272
|
+
function ingestSuccess$5(luvio, resourceParams, response) {
|
|
2273
|
+
const { body } = response;
|
|
2274
|
+
const key = keyBuilderFromType$2(luvio, body);
|
|
2275
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
2276
|
+
const snapshot = luvio.storeLookup({
|
|
2277
|
+
recordId: key,
|
|
2278
|
+
node: select$8(),
|
|
2279
|
+
variables: {},
|
|
2280
|
+
});
|
|
2281
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2282
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2283
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
deepFreeze(snapshot.data);
|
|
2287
|
+
return snapshot;
|
|
2288
|
+
}
|
|
2289
|
+
function createResourceRequest$7(config) {
|
|
2290
|
+
const headers = {};
|
|
2291
|
+
return {
|
|
2292
|
+
baseUri: '/services/data/v62.0',
|
|
2293
|
+
basePath: '/connect/swarming/conversation/messages',
|
|
2294
|
+
method: 'post',
|
|
2295
|
+
body: config.body,
|
|
2296
|
+
urlParams: {},
|
|
2297
|
+
queryParams: {},
|
|
2298
|
+
headers,
|
|
2299
|
+
priority: 'normal',
|
|
2300
|
+
};
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
const adapterName$7 = 'getSlackConversationpostSlackConversation';
|
|
2304
|
+
const getSlackConversationpostSlackConversation_ConfigPropertyMetadata = [
|
|
2305
|
+
generateParamConfigMetadata('appId', true, 2 /* Body */, 0 /* String */),
|
|
2306
|
+
generateParamConfigMetadata('channelId', true, 2 /* Body */, 0 /* String */),
|
|
2307
|
+
generateParamConfigMetadata('linkNames', true, 2 /* Body */, 1 /* Boolean */),
|
|
2308
|
+
generateParamConfigMetadata('replyBroadcast', true, 2 /* Body */, 1 /* Boolean */),
|
|
2309
|
+
generateParamConfigMetadata('teamId', true, 2 /* Body */, 0 /* String */),
|
|
2310
|
+
generateParamConfigMetadata('text', true, 2 /* Body */, 0 /* String */),
|
|
2311
|
+
generateParamConfigMetadata('threadTs', true, 2 /* Body */, 0 /* String */),
|
|
2312
|
+
];
|
|
2313
|
+
const getSlackConversationpostSlackConversation_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, getSlackConversationpostSlackConversation_ConfigPropertyMetadata);
|
|
2314
|
+
const createResourceParams$7 = /*#__PURE__*/ createResourceParams$b(getSlackConversationpostSlackConversation_ConfigPropertyMetadata);
|
|
2315
|
+
function typeCheckConfig$7(untrustedConfig) {
|
|
2316
|
+
const config = {};
|
|
2317
|
+
typeCheckConfig$b(untrustedConfig, config, getSlackConversationpostSlackConversation_ConfigPropertyMetadata);
|
|
2318
|
+
return config;
|
|
2319
|
+
}
|
|
2320
|
+
function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
|
|
2321
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2322
|
+
return null;
|
|
2323
|
+
}
|
|
2324
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2325
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2326
|
+
}
|
|
2327
|
+
const config = typeCheckConfig$7(untrustedConfig);
|
|
2328
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2329
|
+
return null;
|
|
2330
|
+
}
|
|
2331
|
+
return config;
|
|
2332
|
+
}
|
|
2333
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
2334
|
+
const resourceParams = createResourceParams$7(config);
|
|
2335
|
+
const request = createResourceRequest$7(resourceParams);
|
|
2336
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2337
|
+
.then((response) => {
|
|
2338
|
+
return luvio.handleSuccessResponse(() => {
|
|
2339
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response);
|
|
2340
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2341
|
+
}, () => {
|
|
2342
|
+
const cache = new StoreKeyMap();
|
|
2343
|
+
getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
|
|
2344
|
+
return cache;
|
|
2345
|
+
});
|
|
2346
|
+
}, (response) => {
|
|
2347
|
+
deepFreeze(response);
|
|
2348
|
+
throw response;
|
|
2349
|
+
});
|
|
2350
|
+
}
|
|
2351
|
+
const getSlackConversationpostSlackConversationAdapterFactory = (luvio) => {
|
|
2352
|
+
return function getSlackConversationpostSlackConversation(untrustedConfig) {
|
|
2353
|
+
const config = validateAdapterConfig$7(untrustedConfig, getSlackConversationpostSlackConversation_ConfigPropertyNames);
|
|
2354
|
+
// Invalid or incomplete config
|
|
2355
|
+
if (config === null) {
|
|
2356
|
+
throw new Error('Invalid config for "getSlackConversationpostSlackConversation"');
|
|
2357
|
+
}
|
|
2358
|
+
return buildNetworkSnapshot$7(luvio, config);
|
|
2359
|
+
};
|
|
2360
|
+
};
|
|
2361
|
+
|
|
2362
|
+
function keyBuilder$9(luvio, params) {
|
|
2363
|
+
return keyBuilder$d(luvio, {
|
|
2364
|
+
messageTimestamp: params.urlParams.messageTimestamp
|
|
2365
|
+
});
|
|
2366
|
+
}
|
|
2367
|
+
function getResponseCacheKeys$6(cacheKeyMap, luvio, resourceParams) {
|
|
2368
|
+
const key = keyBuilder$9(luvio, resourceParams);
|
|
2369
|
+
cacheKeyMap.set(key, {
|
|
2370
|
+
namespace: keyPrefix,
|
|
2371
|
+
representationName: RepresentationType$5,
|
|
2372
|
+
mergeable: false
|
|
2373
|
+
});
|
|
2374
|
+
}
|
|
2375
|
+
function evictSuccess$1(luvio, resourceParams) {
|
|
2376
|
+
const key = keyBuilder$9(luvio, resourceParams);
|
|
2377
|
+
luvio.storeEvict(key);
|
|
2378
|
+
}
|
|
2379
|
+
function createResourceRequest$6(config) {
|
|
2380
|
+
const headers = {};
|
|
2381
|
+
return {
|
|
2382
|
+
baseUri: '/services/data/v62.0',
|
|
2383
|
+
basePath: '/connect/swarming/conversation/messages/' + config.urlParams.messageTimestamp + '',
|
|
2384
|
+
method: 'delete',
|
|
2385
|
+
body: null,
|
|
2386
|
+
urlParams: config.urlParams,
|
|
2387
|
+
queryParams: config.queryParams,
|
|
2388
|
+
headers,
|
|
2389
|
+
priority: 'normal',
|
|
2390
|
+
};
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
const adapterName$6 = 'getSlackConversationdeleteSlackMessage';
|
|
2394
|
+
const getSlackConversationdeleteSlackMessage_ConfigPropertyMetadata = [
|
|
2395
|
+
generateParamConfigMetadata('messageTimestamp', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2396
|
+
generateParamConfigMetadata('appId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2397
|
+
generateParamConfigMetadata('channelId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2398
|
+
generateParamConfigMetadata('teamId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2399
|
+
];
|
|
2400
|
+
const getSlackConversationdeleteSlackMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getSlackConversationdeleteSlackMessage_ConfigPropertyMetadata);
|
|
2401
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$b(getSlackConversationdeleteSlackMessage_ConfigPropertyMetadata);
|
|
2402
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
2403
|
+
const config = {};
|
|
2404
|
+
typeCheckConfig$b(untrustedConfig, config, getSlackConversationdeleteSlackMessage_ConfigPropertyMetadata);
|
|
2405
|
+
return config;
|
|
2406
|
+
}
|
|
2407
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
2408
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2409
|
+
return null;
|
|
2410
|
+
}
|
|
2411
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2412
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2413
|
+
}
|
|
2414
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
2415
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2416
|
+
return null;
|
|
2417
|
+
}
|
|
2418
|
+
return config;
|
|
2419
|
+
}
|
|
2420
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
2421
|
+
const resourceParams = createResourceParams$6(config);
|
|
2422
|
+
const request = createResourceRequest$6(resourceParams);
|
|
2423
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2424
|
+
.then(() => {
|
|
2425
|
+
return luvio.handleSuccessResponse(() => {
|
|
2426
|
+
evictSuccess$1(luvio, resourceParams);
|
|
2427
|
+
return luvio.storeBroadcast();
|
|
2428
|
+
}, () => {
|
|
2429
|
+
const cache = new StoreKeyMap();
|
|
2430
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams);
|
|
2431
|
+
return cache;
|
|
2432
|
+
});
|
|
2433
|
+
}, (response) => {
|
|
2434
|
+
deepFreeze(response);
|
|
2435
|
+
throw response;
|
|
2436
|
+
});
|
|
2437
|
+
}
|
|
2438
|
+
const getSlackConversationdeleteSlackMessageAdapterFactory = (luvio) => {
|
|
2439
|
+
return function SlackgetSlackConversationdeleteSlackMessage(untrustedConfig) {
|
|
2440
|
+
const config = validateAdapterConfig$6(untrustedConfig, getSlackConversationdeleteSlackMessage_ConfigPropertyNames);
|
|
2441
|
+
// Invalid or incomplete config
|
|
2442
|
+
if (config === null) {
|
|
2443
|
+
throw new Error(`Invalid config for "${adapterName$6}"`);
|
|
2444
|
+
}
|
|
2445
|
+
return buildNetworkSnapshot$6(luvio, config);
|
|
2446
|
+
};
|
|
2447
|
+
};
|
|
2448
|
+
|
|
2449
|
+
function select$7(luvio, params) {
|
|
2450
|
+
return select$c();
|
|
2451
|
+
}
|
|
2452
|
+
function keyBuilder$8(luvio, params) {
|
|
2453
|
+
return keyBuilder$d(luvio, {
|
|
2454
|
+
messageTimestamp: params.urlParams.messageTimestamp
|
|
2455
|
+
});
|
|
2456
|
+
}
|
|
2457
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
2458
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response);
|
|
2459
|
+
}
|
|
2460
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
2461
|
+
const { body } = response;
|
|
2462
|
+
const key = keyBuilder$8(luvio, resourceParams);
|
|
2463
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
2464
|
+
const snapshot = luvio.storeLookup({
|
|
2465
|
+
recordId: key,
|
|
2466
|
+
node: select$7(),
|
|
2467
|
+
variables: {},
|
|
2468
|
+
}, snapshotRefresh);
|
|
2469
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2470
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2471
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
deepFreeze(snapshot.data);
|
|
2475
|
+
return snapshot;
|
|
2476
|
+
}
|
|
2477
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
2478
|
+
const key = keyBuilder$8(luvio, params);
|
|
2479
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2480
|
+
const storeMetadataParams = {
|
|
2481
|
+
ttl: TTL$2,
|
|
2482
|
+
namespace: keyPrefix,
|
|
2483
|
+
version: VERSION$5,
|
|
2484
|
+
representationName: RepresentationType$5
|
|
2485
|
+
};
|
|
2486
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2487
|
+
return errorSnapshot;
|
|
2488
|
+
}
|
|
2489
|
+
function createResourceRequest$5(config) {
|
|
2490
|
+
const headers = {};
|
|
2491
|
+
return {
|
|
2492
|
+
baseUri: '/services/data/v62.0',
|
|
2493
|
+
basePath: '/connect/swarming/conversation/messages/' + config.urlParams.messageTimestamp + '',
|
|
2494
|
+
method: 'get',
|
|
2495
|
+
body: null,
|
|
2496
|
+
urlParams: config.urlParams,
|
|
2497
|
+
queryParams: config.queryParams,
|
|
2498
|
+
headers,
|
|
2499
|
+
priority: 'normal',
|
|
2500
|
+
};
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2503
|
+
const adapterName$5 = 'getSlackConversationgetSlackMessage';
|
|
2504
|
+
const getSlackConversationgetSlackMessage_ConfigPropertyMetadata = [
|
|
2505
|
+
generateParamConfigMetadata('messageTimestamp', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2506
|
+
generateParamConfigMetadata('appId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2507
|
+
generateParamConfigMetadata('channelId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2508
|
+
generateParamConfigMetadata('parentMessageTs', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2509
|
+
generateParamConfigMetadata('relatedRecordId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2510
|
+
generateParamConfigMetadata('teamId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2511
|
+
];
|
|
2512
|
+
const getSlackConversationgetSlackMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getSlackConversationgetSlackMessage_ConfigPropertyMetadata);
|
|
2513
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$b(getSlackConversationgetSlackMessage_ConfigPropertyMetadata);
|
|
2514
|
+
function keyBuilder$7(luvio, config) {
|
|
2515
|
+
const resourceParams = createResourceParams$5(config);
|
|
2516
|
+
return keyBuilder$8(luvio, resourceParams);
|
|
2517
|
+
}
|
|
2518
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
2519
|
+
const config = {};
|
|
2520
|
+
typeCheckConfig$b(untrustedConfig, config, getSlackConversationgetSlackMessage_ConfigPropertyMetadata);
|
|
2521
|
+
return config;
|
|
2522
|
+
}
|
|
2523
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
2524
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2525
|
+
return null;
|
|
2526
|
+
}
|
|
2527
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2528
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2529
|
+
}
|
|
2530
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
2531
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2532
|
+
return null;
|
|
2533
|
+
}
|
|
2534
|
+
return config;
|
|
2535
|
+
}
|
|
2536
|
+
function adapterFragment$2(luvio, config) {
|
|
2537
|
+
createResourceParams$5(config);
|
|
2538
|
+
return select$7();
|
|
2539
|
+
}
|
|
2540
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
2541
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
2542
|
+
config,
|
|
2543
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
2544
|
+
});
|
|
2545
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2546
|
+
}
|
|
2547
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
2548
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
2549
|
+
config,
|
|
2550
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
2551
|
+
});
|
|
2552
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2553
|
+
}
|
|
2554
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
2555
|
+
const resourceParams = createResourceParams$5(config);
|
|
2556
|
+
const request = createResourceRequest$5(resourceParams);
|
|
2557
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2558
|
+
.then((response) => {
|
|
2559
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
2560
|
+
const cache = new StoreKeyMap();
|
|
2561
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
2562
|
+
return cache;
|
|
2563
|
+
});
|
|
2564
|
+
}, (response) => {
|
|
2565
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
2566
|
+
});
|
|
2567
|
+
}
|
|
2568
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
2569
|
+
return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
2570
|
+
}
|
|
2571
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
2572
|
+
const { luvio, config } = context;
|
|
2573
|
+
const selector = {
|
|
2574
|
+
recordId: keyBuilder$7(luvio, config),
|
|
2575
|
+
node: adapterFragment$2(luvio, config),
|
|
2576
|
+
variables: {},
|
|
2577
|
+
};
|
|
2578
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2579
|
+
config,
|
|
2580
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
2581
|
+
});
|
|
2582
|
+
return cacheSnapshot;
|
|
2583
|
+
}
|
|
2584
|
+
const getSlackConversationgetSlackMessageAdapterFactory = (luvio) => function Slack__getSlackConversationgetSlackMessage(untrustedConfig, requestContext) {
|
|
2585
|
+
const config = validateAdapterConfig$5(untrustedConfig, getSlackConversationgetSlackMessage_ConfigPropertyNames);
|
|
2586
|
+
// Invalid or incomplete config
|
|
2587
|
+
if (config === null) {
|
|
2588
|
+
return null;
|
|
2589
|
+
}
|
|
2590
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2591
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
2592
|
+
};
|
|
2593
|
+
|
|
2594
|
+
const TTL = 300;
|
|
2595
|
+
const VERSION$2 = "e0dc0ed06034e8a0dcff97612151271f";
|
|
2596
|
+
function validate$2(obj, path = 'SlackUpdatedMessageOutputRepresentation') {
|
|
2597
|
+
const v_error = (() => {
|
|
2598
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2599
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2600
|
+
}
|
|
2601
|
+
const obj_channelId = obj.channelId;
|
|
2602
|
+
const path_channelId = path + '.channelId';
|
|
2603
|
+
if (typeof obj_channelId !== 'string') {
|
|
2604
|
+
return new TypeError('Expected "string" but received "' + typeof obj_channelId + '" (at "' + path_channelId + '")');
|
|
2605
|
+
}
|
|
2606
|
+
const obj_timestamp = obj.timestamp;
|
|
2607
|
+
const path_timestamp = path + '.timestamp';
|
|
2608
|
+
if (typeof obj_timestamp !== 'string') {
|
|
2609
|
+
return new TypeError('Expected "string" but received "' + typeof obj_timestamp + '" (at "' + path_timestamp + '")');
|
|
2610
|
+
}
|
|
2611
|
+
const obj_updatedMessage = obj.updatedMessage;
|
|
2612
|
+
const path_updatedMessage = path + '.updatedMessage';
|
|
2613
|
+
if (typeof obj_updatedMessage !== 'object') {
|
|
2614
|
+
return new TypeError('Expected "object" but received "' + typeof obj_updatedMessage + '" (at "' + path_updatedMessage + '")');
|
|
2615
|
+
}
|
|
2616
|
+
})();
|
|
2617
|
+
return v_error === undefined ? null : v_error;
|
|
2618
|
+
}
|
|
2619
|
+
const RepresentationType$2 = 'SlackUpdatedMessageOutputRepresentation';
|
|
2620
|
+
function keyBuilder$6(luvio, config) {
|
|
2621
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.channelId + ':' + config.timestamp;
|
|
2622
|
+
}
|
|
2623
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
2624
|
+
const keyParams = {
|
|
2625
|
+
channelId: object.channelId,
|
|
2626
|
+
timestamp: object.timestamp
|
|
2627
|
+
};
|
|
2628
|
+
return keyBuilder$6(luvio, keyParams);
|
|
2629
|
+
}
|
|
2630
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
2631
|
+
const input_updatedMessage = input.updatedMessage;
|
|
2632
|
+
const input_updatedMessage_id = path.fullPath + '__updatedMessage';
|
|
2633
|
+
input.updatedMessage = ingest$5(input_updatedMessage, {
|
|
2634
|
+
fullPath: input_updatedMessage_id,
|
|
2635
|
+
propertyName: 'updatedMessage',
|
|
2636
|
+
parent: {
|
|
2637
|
+
data: input,
|
|
2638
|
+
key: path.fullPath,
|
|
2639
|
+
existing: existing,
|
|
2640
|
+
},
|
|
2641
|
+
ttl: path.ttl
|
|
2642
|
+
}, luvio, store, timestamp);
|
|
2643
|
+
return input;
|
|
2644
|
+
}
|
|
2645
|
+
const select$6 = function SlackUpdatedMessageOutputRepresentationSelect() {
|
|
2646
|
+
return {
|
|
2647
|
+
kind: 'Fragment',
|
|
2648
|
+
version: VERSION$2,
|
|
2649
|
+
private: [],
|
|
2650
|
+
selections: [
|
|
2651
|
+
{
|
|
2652
|
+
name: 'channelId',
|
|
2653
|
+
kind: 'Scalar'
|
|
2654
|
+
},
|
|
2655
|
+
{
|
|
2656
|
+
name: 'timestamp',
|
|
2657
|
+
kind: 'Scalar'
|
|
2658
|
+
},
|
|
2659
|
+
{
|
|
2660
|
+
name: 'updatedMessage',
|
|
2661
|
+
kind: 'Link',
|
|
2662
|
+
fragment: select$c()
|
|
2663
|
+
}
|
|
2664
|
+
]
|
|
2665
|
+
};
|
|
2666
|
+
};
|
|
2667
|
+
function equals$2(existing, incoming) {
|
|
2668
|
+
const existing_channelId = existing.channelId;
|
|
2669
|
+
const incoming_channelId = incoming.channelId;
|
|
2670
|
+
if (!(existing_channelId === incoming_channelId)) {
|
|
2671
|
+
return false;
|
|
2672
|
+
}
|
|
2673
|
+
const existing_timestamp = existing.timestamp;
|
|
2674
|
+
const incoming_timestamp = incoming.timestamp;
|
|
2675
|
+
if (!(existing_timestamp === incoming_timestamp)) {
|
|
2676
|
+
return false;
|
|
2677
|
+
}
|
|
2678
|
+
const existing_updatedMessage = existing.updatedMessage;
|
|
2679
|
+
const incoming_updatedMessage = incoming.updatedMessage;
|
|
2680
|
+
if (!(existing_updatedMessage.__ref === incoming_updatedMessage.__ref)) {
|
|
2681
|
+
return false;
|
|
2682
|
+
}
|
|
2683
|
+
return true;
|
|
2684
|
+
}
|
|
2685
|
+
const ingest$2 = function SlackUpdatedMessageOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2686
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2687
|
+
const validateError = validate$2(input);
|
|
2688
|
+
if (validateError !== null) {
|
|
2689
|
+
throw validateError;
|
|
2690
|
+
}
|
|
2691
|
+
}
|
|
2692
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
2693
|
+
const ttlToUse = TTL;
|
|
2694
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "Slack", VERSION$2, RepresentationType$2, equals$2);
|
|
2695
|
+
return createLink(key);
|
|
2696
|
+
};
|
|
2697
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
2698
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2699
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
2700
|
+
rootKeySet.set(rootKey, {
|
|
2701
|
+
namespace: keyPrefix,
|
|
2702
|
+
representationName: RepresentationType$2,
|
|
2703
|
+
mergeable: false
|
|
2704
|
+
});
|
|
2705
|
+
getTypeCacheKeys$5(rootKeySet, luvio, input.updatedMessage);
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
function select$5(luvio, params) {
|
|
2709
|
+
return select$6();
|
|
2710
|
+
}
|
|
2711
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
2712
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
2713
|
+
}
|
|
2714
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
2715
|
+
const { body } = response;
|
|
2716
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
2717
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
2718
|
+
const snapshot = luvio.storeLookup({
|
|
2719
|
+
recordId: key,
|
|
2720
|
+
node: select$5(),
|
|
2721
|
+
variables: {},
|
|
2722
|
+
});
|
|
2723
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2724
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2725
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2726
|
+
}
|
|
2727
|
+
}
|
|
2728
|
+
deepFreeze(snapshot.data);
|
|
2729
|
+
return snapshot;
|
|
2730
|
+
}
|
|
2731
|
+
function createResourceRequest$4(config) {
|
|
2732
|
+
const headers = {};
|
|
2733
|
+
return {
|
|
2734
|
+
baseUri: '/services/data/v62.0',
|
|
2735
|
+
basePath: '/connect/swarming/conversation/messages/' + config.urlParams.messageTimestamp + '',
|
|
2736
|
+
method: 'patch',
|
|
2737
|
+
body: config.body,
|
|
2738
|
+
urlParams: config.urlParams,
|
|
2739
|
+
queryParams: {},
|
|
2740
|
+
headers,
|
|
2741
|
+
priority: 'normal',
|
|
2742
|
+
};
|
|
2743
|
+
}
|
|
2744
|
+
|
|
2745
|
+
const adapterName$4 = 'getSlackConversationpatchSlackMessage';
|
|
2746
|
+
const getSlackConversationpatchSlackMessage_ConfigPropertyMetadata = [
|
|
2747
|
+
generateParamConfigMetadata('messageTimestamp', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2748
|
+
generateParamConfigMetadata('appId', true, 2 /* Body */, 0 /* String */),
|
|
2749
|
+
generateParamConfigMetadata('channelId', true, 2 /* Body */, 0 /* String */),
|
|
2750
|
+
generateParamConfigMetadata('teamId', true, 2 /* Body */, 0 /* String */),
|
|
2751
|
+
generateParamConfigMetadata('text', true, 2 /* Body */, 0 /* String */),
|
|
2752
|
+
];
|
|
2753
|
+
const getSlackConversationpatchSlackMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getSlackConversationpatchSlackMessage_ConfigPropertyMetadata);
|
|
2754
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$b(getSlackConversationpatchSlackMessage_ConfigPropertyMetadata);
|
|
2755
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
2756
|
+
const config = {};
|
|
2757
|
+
typeCheckConfig$b(untrustedConfig, config, getSlackConversationpatchSlackMessage_ConfigPropertyMetadata);
|
|
2758
|
+
return config;
|
|
2759
|
+
}
|
|
2760
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
2761
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2762
|
+
return null;
|
|
2763
|
+
}
|
|
2764
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2765
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2766
|
+
}
|
|
2767
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
2768
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2769
|
+
return null;
|
|
2770
|
+
}
|
|
2771
|
+
return config;
|
|
2772
|
+
}
|
|
2773
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
2774
|
+
const resourceParams = createResourceParams$4(config);
|
|
2775
|
+
const request = createResourceRequest$4(resourceParams);
|
|
2776
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2777
|
+
.then((response) => {
|
|
2778
|
+
return luvio.handleSuccessResponse(() => {
|
|
2779
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
2780
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2781
|
+
}, () => {
|
|
2782
|
+
const cache = new StoreKeyMap();
|
|
2783
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
2784
|
+
return cache;
|
|
2785
|
+
});
|
|
2786
|
+
}, (response) => {
|
|
2787
|
+
deepFreeze(response);
|
|
2788
|
+
throw response;
|
|
2789
|
+
});
|
|
2790
|
+
}
|
|
2791
|
+
const getSlackConversationpatchSlackMessageAdapterFactory = (luvio) => {
|
|
2792
|
+
return function getSlackConversationpatchSlackMessage(untrustedConfig) {
|
|
2793
|
+
const config = validateAdapterConfig$4(untrustedConfig, getSlackConversationpatchSlackMessage_ConfigPropertyNames);
|
|
2794
|
+
// Invalid or incomplete config
|
|
2795
|
+
if (config === null) {
|
|
2796
|
+
throw new Error('Invalid config for "getSlackConversationpatchSlackMessage"');
|
|
2797
|
+
}
|
|
2798
|
+
return buildNetworkSnapshot$4(luvio, config);
|
|
2799
|
+
};
|
|
2800
|
+
};
|
|
2801
|
+
|
|
2802
|
+
const VERSION$1 = "7d25d1bba6bb42fdd8c2c160c7e201a1";
|
|
2803
|
+
function validate$1(obj, path = 'EmptyRepresentation') {
|
|
2804
|
+
const v_error = (() => {
|
|
2805
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2806
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2807
|
+
}
|
|
2808
|
+
const obj_fakeKey = obj.fakeKey;
|
|
2809
|
+
const path_fakeKey = path + '.fakeKey';
|
|
2810
|
+
if (typeof obj_fakeKey !== 'string') {
|
|
2811
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fakeKey + '" (at "' + path_fakeKey + '")');
|
|
2812
|
+
}
|
|
2813
|
+
})();
|
|
2814
|
+
return v_error === undefined ? null : v_error;
|
|
2815
|
+
}
|
|
2816
|
+
const RepresentationType$1 = 'EmptyRepresentation';
|
|
2817
|
+
function keyBuilder$5(luvio, config) {
|
|
2818
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.messageTimestamp;
|
|
2819
|
+
}
|
|
2820
|
+
function keyBuilderFromType(luvio, object) {
|
|
2821
|
+
const keyParams = {
|
|
2822
|
+
messageTimestamp: object.fakeKey
|
|
2823
|
+
};
|
|
2824
|
+
return keyBuilder$5(luvio, keyParams);
|
|
2825
|
+
}
|
|
2826
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
2827
|
+
return input;
|
|
2828
|
+
}
|
|
2829
|
+
const select$4 = function EmptyRepresentationSelect() {
|
|
2830
|
+
return {
|
|
2831
|
+
kind: 'Fragment',
|
|
2832
|
+
version: VERSION$1,
|
|
2833
|
+
private: [],
|
|
2834
|
+
selections: [
|
|
2835
|
+
{
|
|
2836
|
+
name: 'fakeKey',
|
|
2837
|
+
kind: 'Scalar'
|
|
2838
|
+
}
|
|
2839
|
+
]
|
|
2840
|
+
};
|
|
2841
|
+
};
|
|
2842
|
+
function equals$1(existing, incoming) {
|
|
2843
|
+
const existing_fakeKey = existing.fakeKey;
|
|
2844
|
+
const incoming_fakeKey = incoming.fakeKey;
|
|
2845
|
+
if (!(existing_fakeKey === incoming_fakeKey)) {
|
|
2846
|
+
return false;
|
|
2847
|
+
}
|
|
2848
|
+
return true;
|
|
2849
|
+
}
|
|
2850
|
+
const ingest$1 = function EmptyRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2851
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2852
|
+
const validateError = validate$1(input);
|
|
2853
|
+
if (validateError !== null) {
|
|
2854
|
+
throw validateError;
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
const key = keyBuilderFromType(luvio, input);
|
|
2858
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
|
|
2859
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "Slack", VERSION$1, RepresentationType$1, equals$1);
|
|
2860
|
+
return createLink(key);
|
|
2861
|
+
};
|
|
2862
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
2863
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2864
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
2865
|
+
rootKeySet.set(rootKey, {
|
|
2866
|
+
namespace: keyPrefix,
|
|
2867
|
+
representationName: RepresentationType$1,
|
|
2868
|
+
mergeable: false
|
|
2869
|
+
});
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
function keyBuilder$4(luvio, params) {
|
|
2873
|
+
return keyBuilder$5(luvio, {
|
|
2874
|
+
messageTimestamp: params.urlParams.messageTimestamp
|
|
2875
|
+
});
|
|
2876
|
+
}
|
|
2877
|
+
function getResponseCacheKeys$3(cacheKeyMap, luvio, resourceParams) {
|
|
2878
|
+
const key = keyBuilder$4(luvio, resourceParams);
|
|
2879
|
+
cacheKeyMap.set(key, {
|
|
2880
|
+
namespace: keyPrefix,
|
|
2881
|
+
representationName: RepresentationType$1,
|
|
2882
|
+
mergeable: false
|
|
2883
|
+
});
|
|
2884
|
+
}
|
|
2885
|
+
function evictSuccess(luvio, resourceParams) {
|
|
2886
|
+
const key = keyBuilder$4(luvio, resourceParams);
|
|
2887
|
+
luvio.storeEvict(key);
|
|
2888
|
+
}
|
|
2889
|
+
function createResourceRequest$3(config) {
|
|
2890
|
+
const headers = {};
|
|
2891
|
+
return {
|
|
2892
|
+
baseUri: '/services/data/v62.0',
|
|
2893
|
+
basePath: '/connect/swarming/conversation/messages/' + config.urlParams.messageTimestamp + '/reactions',
|
|
2894
|
+
method: 'delete',
|
|
2895
|
+
body: null,
|
|
2896
|
+
urlParams: config.urlParams,
|
|
2897
|
+
queryParams: config.queryParams,
|
|
2898
|
+
headers,
|
|
2899
|
+
priority: 'normal',
|
|
2900
|
+
};
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
const adapterName$3 = 'getSlackConversationdeleteSlackMessageReactions';
|
|
2904
|
+
const getSlackConversationdeleteSlackMessageReactions_ConfigPropertyMetadata = [
|
|
2905
|
+
generateParamConfigMetadata('messageTimestamp', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2906
|
+
generateParamConfigMetadata('appId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2907
|
+
generateParamConfigMetadata('channelId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2908
|
+
generateParamConfigMetadata('name', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2909
|
+
generateParamConfigMetadata('teamId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2910
|
+
];
|
|
2911
|
+
const getSlackConversationdeleteSlackMessageReactions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getSlackConversationdeleteSlackMessageReactions_ConfigPropertyMetadata);
|
|
2912
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$b(getSlackConversationdeleteSlackMessageReactions_ConfigPropertyMetadata);
|
|
2913
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
2914
|
+
const config = {};
|
|
2915
|
+
typeCheckConfig$b(untrustedConfig, config, getSlackConversationdeleteSlackMessageReactions_ConfigPropertyMetadata);
|
|
2916
|
+
return config;
|
|
2917
|
+
}
|
|
2918
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
2919
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2920
|
+
return null;
|
|
2921
|
+
}
|
|
2922
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2923
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2924
|
+
}
|
|
2925
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
2926
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2927
|
+
return null;
|
|
2928
|
+
}
|
|
2929
|
+
return config;
|
|
2930
|
+
}
|
|
2931
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
2932
|
+
const resourceParams = createResourceParams$3(config);
|
|
2933
|
+
const request = createResourceRequest$3(resourceParams);
|
|
2934
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2935
|
+
.then(() => {
|
|
2936
|
+
return luvio.handleSuccessResponse(() => {
|
|
2937
|
+
evictSuccess(luvio, resourceParams);
|
|
2938
|
+
return luvio.storeBroadcast();
|
|
2939
|
+
}, () => {
|
|
2940
|
+
const cache = new StoreKeyMap();
|
|
2941
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams);
|
|
2942
|
+
return cache;
|
|
2943
|
+
});
|
|
2944
|
+
}, (response) => {
|
|
2945
|
+
deepFreeze(response);
|
|
2946
|
+
throw response;
|
|
2947
|
+
});
|
|
2948
|
+
}
|
|
2949
|
+
const getSlackConversationdeleteSlackMessageReactionsAdapterFactory = (luvio) => {
|
|
2950
|
+
return function SlackgetSlackConversationdeleteSlackMessageReactions(untrustedConfig) {
|
|
2951
|
+
const config = validateAdapterConfig$3(untrustedConfig, getSlackConversationdeleteSlackMessageReactions_ConfigPropertyNames);
|
|
2952
|
+
// Invalid or incomplete config
|
|
2953
|
+
if (config === null) {
|
|
2954
|
+
throw new Error(`Invalid config for "${adapterName$3}"`);
|
|
2955
|
+
}
|
|
2956
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
2957
|
+
};
|
|
2958
|
+
};
|
|
2959
|
+
|
|
2960
|
+
function select$3(luvio, params) {
|
|
2961
|
+
return select$4();
|
|
2962
|
+
}
|
|
2963
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
2964
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
2965
|
+
}
|
|
2966
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
2967
|
+
const { body } = response;
|
|
2968
|
+
const key = keyBuilderFromType(luvio, body);
|
|
2969
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
2970
|
+
const snapshot = luvio.storeLookup({
|
|
2971
|
+
recordId: key,
|
|
2972
|
+
node: select$3(),
|
|
2973
|
+
variables: {},
|
|
2974
|
+
});
|
|
2975
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2976
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2977
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
deepFreeze(snapshot.data);
|
|
2981
|
+
return snapshot;
|
|
2982
|
+
}
|
|
2983
|
+
function createResourceRequest$2(config) {
|
|
2984
|
+
const headers = {};
|
|
2985
|
+
return {
|
|
2986
|
+
baseUri: '/services/data/v62.0',
|
|
2987
|
+
basePath: '/connect/swarming/conversation/messages/' + config.urlParams.messageTimestamp + '/reactions',
|
|
2988
|
+
method: 'post',
|
|
2989
|
+
body: config.body,
|
|
2990
|
+
urlParams: config.urlParams,
|
|
2991
|
+
queryParams: {},
|
|
2992
|
+
headers,
|
|
2993
|
+
priority: 'normal',
|
|
2994
|
+
};
|
|
2995
|
+
}
|
|
2996
|
+
|
|
2997
|
+
const adapterName$2 = 'getSlackConversationpostSlackMessageReactions';
|
|
2998
|
+
const getSlackConversationpostSlackMessageReactions_ConfigPropertyMetadata = [
|
|
2999
|
+
generateParamConfigMetadata('messageTimestamp', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3000
|
+
generateParamConfigMetadata('appId', true, 2 /* Body */, 0 /* String */),
|
|
3001
|
+
generateParamConfigMetadata('channelId', true, 2 /* Body */, 0 /* String */),
|
|
3002
|
+
generateParamConfigMetadata('name', true, 2 /* Body */, 0 /* String */),
|
|
3003
|
+
generateParamConfigMetadata('teamId', true, 2 /* Body */, 0 /* String */),
|
|
3004
|
+
];
|
|
3005
|
+
const getSlackConversationpostSlackMessageReactions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getSlackConversationpostSlackMessageReactions_ConfigPropertyMetadata);
|
|
3006
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$b(getSlackConversationpostSlackMessageReactions_ConfigPropertyMetadata);
|
|
3007
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
3008
|
+
const config = {};
|
|
3009
|
+
typeCheckConfig$b(untrustedConfig, config, getSlackConversationpostSlackMessageReactions_ConfigPropertyMetadata);
|
|
3010
|
+
return config;
|
|
3011
|
+
}
|
|
3012
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
3013
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3014
|
+
return null;
|
|
3015
|
+
}
|
|
3016
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3017
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3018
|
+
}
|
|
3019
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
3020
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3021
|
+
return null;
|
|
3022
|
+
}
|
|
3023
|
+
return config;
|
|
3024
|
+
}
|
|
3025
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
3026
|
+
const resourceParams = createResourceParams$2(config);
|
|
3027
|
+
const request = createResourceRequest$2(resourceParams);
|
|
3028
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3029
|
+
.then((response) => {
|
|
3030
|
+
return luvio.handleSuccessResponse(() => {
|
|
3031
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
3032
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3033
|
+
}, () => {
|
|
3034
|
+
const cache = new StoreKeyMap();
|
|
3035
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
3036
|
+
return cache;
|
|
3037
|
+
});
|
|
3038
|
+
}, (response) => {
|
|
3039
|
+
deepFreeze(response);
|
|
3040
|
+
throw response;
|
|
3041
|
+
});
|
|
3042
|
+
}
|
|
3043
|
+
const getSlackConversationpostSlackMessageReactionsAdapterFactory = (luvio) => {
|
|
3044
|
+
return function getSlackConversationpostSlackMessageReactions(untrustedConfig) {
|
|
3045
|
+
const config = validateAdapterConfig$2(untrustedConfig, getSlackConversationpostSlackMessageReactions_ConfigPropertyNames);
|
|
3046
|
+
// Invalid or incomplete config
|
|
3047
|
+
if (config === null) {
|
|
3048
|
+
throw new Error('Invalid config for "getSlackConversationpostSlackMessageReactions"');
|
|
3049
|
+
}
|
|
3050
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
3051
|
+
};
|
|
3052
|
+
};
|
|
3053
|
+
|
|
3054
|
+
function select$2(luvio, params) {
|
|
3055
|
+
return select$e();
|
|
3056
|
+
}
|
|
3057
|
+
function keyBuilder$3(luvio, params) {
|
|
3058
|
+
return keyBuilder$e(luvio, {
|
|
3059
|
+
userId: params.urlParams.userId
|
|
3060
|
+
});
|
|
3061
|
+
}
|
|
3062
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
3063
|
+
getTypeCacheKeys$7(storeKeyMap, luvio, response);
|
|
3064
|
+
}
|
|
3065
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
3066
|
+
const { body } = response;
|
|
3067
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
3068
|
+
luvio.storeIngest(key, ingest$7, body);
|
|
3069
|
+
const snapshot = luvio.storeLookup({
|
|
3070
|
+
recordId: key,
|
|
3071
|
+
node: select$2(),
|
|
3072
|
+
variables: {},
|
|
3073
|
+
}, snapshotRefresh);
|
|
3074
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3075
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3076
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3079
|
+
deepFreeze(snapshot.data);
|
|
3080
|
+
return snapshot;
|
|
3081
|
+
}
|
|
3082
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
3083
|
+
const key = keyBuilder$3(luvio, params);
|
|
3084
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
3085
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
3086
|
+
return errorSnapshot;
|
|
3087
|
+
}
|
|
3088
|
+
function createResourceRequest$1(config) {
|
|
3089
|
+
const headers = {};
|
|
3090
|
+
return {
|
|
3091
|
+
baseUri: '/services/data/v62.0',
|
|
3092
|
+
basePath: '/connect/swarming/conversation/user/' + config.urlParams.userId + '',
|
|
3093
|
+
method: 'get',
|
|
3094
|
+
body: null,
|
|
3095
|
+
urlParams: config.urlParams,
|
|
3096
|
+
queryParams: config.queryParams,
|
|
3097
|
+
headers,
|
|
3098
|
+
priority: 'normal',
|
|
3099
|
+
};
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3102
|
+
const adapterName$1 = 'getSlackConversationgetSlackUser';
|
|
3103
|
+
const getSlackConversationgetSlackUser_ConfigPropertyMetadata = [
|
|
3104
|
+
generateParamConfigMetadata('userId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3105
|
+
generateParamConfigMetadata('appId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
3106
|
+
generateParamConfigMetadata('teamId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
3107
|
+
];
|
|
3108
|
+
const getSlackConversationgetSlackUser_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getSlackConversationgetSlackUser_ConfigPropertyMetadata);
|
|
3109
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$b(getSlackConversationgetSlackUser_ConfigPropertyMetadata);
|
|
3110
|
+
function keyBuilder$2(luvio, config) {
|
|
3111
|
+
const resourceParams = createResourceParams$1(config);
|
|
3112
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
3113
|
+
}
|
|
3114
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
3115
|
+
const config = {};
|
|
3116
|
+
typeCheckConfig$b(untrustedConfig, config, getSlackConversationgetSlackUser_ConfigPropertyMetadata);
|
|
3117
|
+
return config;
|
|
3118
|
+
}
|
|
3119
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
3120
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3121
|
+
return null;
|
|
3122
|
+
}
|
|
3123
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3124
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3125
|
+
}
|
|
3126
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
3127
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3128
|
+
return null;
|
|
3129
|
+
}
|
|
3130
|
+
return config;
|
|
3131
|
+
}
|
|
3132
|
+
function adapterFragment$1(luvio, config) {
|
|
3133
|
+
createResourceParams$1(config);
|
|
3134
|
+
return select$2();
|
|
3135
|
+
}
|
|
3136
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
3137
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
3138
|
+
config,
|
|
3139
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
3140
|
+
});
|
|
3141
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3142
|
+
}
|
|
3143
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
3144
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
3145
|
+
config,
|
|
3146
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
3147
|
+
});
|
|
3148
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3149
|
+
}
|
|
3150
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
3151
|
+
const resourceParams = createResourceParams$1(config);
|
|
3152
|
+
const request = createResourceRequest$1(resourceParams);
|
|
3153
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3154
|
+
.then((response) => {
|
|
3155
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
3156
|
+
const cache = new StoreKeyMap();
|
|
3157
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
3158
|
+
return cache;
|
|
3159
|
+
});
|
|
3160
|
+
}, (response) => {
|
|
3161
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
3162
|
+
});
|
|
3163
|
+
}
|
|
3164
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
3165
|
+
return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
3166
|
+
}
|
|
3167
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
3168
|
+
const { luvio, config } = context;
|
|
3169
|
+
const selector = {
|
|
3170
|
+
recordId: keyBuilder$2(luvio, config),
|
|
3171
|
+
node: adapterFragment$1(luvio, config),
|
|
3172
|
+
variables: {},
|
|
3173
|
+
};
|
|
3174
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
3175
|
+
config,
|
|
3176
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
3177
|
+
});
|
|
3178
|
+
return cacheSnapshot;
|
|
3179
|
+
}
|
|
3180
|
+
const getSlackConversationgetSlackUserAdapterFactory = (luvio) => function Slack__getSlackConversationgetSlackUser(untrustedConfig, requestContext) {
|
|
3181
|
+
const config = validateAdapterConfig$1(untrustedConfig, getSlackConversationgetSlackUser_ConfigPropertyNames);
|
|
3182
|
+
// Invalid or incomplete config
|
|
3183
|
+
if (config === null) {
|
|
3184
|
+
return null;
|
|
3185
|
+
}
|
|
3186
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
3187
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
3188
|
+
};
|
|
3189
|
+
|
|
3190
|
+
const VERSION = "e90388d02a2e03d044c551d2f42e4ed4";
|
|
3191
|
+
function validate(obj, path = 'SlackConversationInfoOutputRepresentation') {
|
|
3192
|
+
const v_error = (() => {
|
|
3193
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3194
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3195
|
+
}
|
|
3196
|
+
const obj_id = obj.id;
|
|
3197
|
+
const path_id = path + '.id';
|
|
3198
|
+
if (typeof obj_id !== 'string') {
|
|
3199
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
3200
|
+
}
|
|
3201
|
+
const obj_isArchived = obj.isArchived;
|
|
3202
|
+
const path_isArchived = path + '.isArchived';
|
|
3203
|
+
if (typeof obj_isArchived !== 'boolean') {
|
|
3204
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isArchived + '" (at "' + path_isArchived + '")');
|
|
3205
|
+
}
|
|
3206
|
+
const obj_isChannel = obj.isChannel;
|
|
3207
|
+
const path_isChannel = path + '.isChannel';
|
|
3208
|
+
if (typeof obj_isChannel !== 'boolean') {
|
|
3209
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isChannel + '" (at "' + path_isChannel + '")');
|
|
3210
|
+
}
|
|
3211
|
+
const obj_isCustomEmojiSupported = obj.isCustomEmojiSupported;
|
|
3212
|
+
const path_isCustomEmojiSupported = path + '.isCustomEmojiSupported';
|
|
3213
|
+
if (typeof obj_isCustomEmojiSupported !== 'boolean') {
|
|
3214
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isCustomEmojiSupported + '" (at "' + path_isCustomEmojiSupported + '")');
|
|
3215
|
+
}
|
|
3216
|
+
const obj_isGroup = obj.isGroup;
|
|
3217
|
+
const path_isGroup = path + '.isGroup';
|
|
3218
|
+
if (typeof obj_isGroup !== 'boolean') {
|
|
3219
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isGroup + '" (at "' + path_isGroup + '")');
|
|
3220
|
+
}
|
|
3221
|
+
const obj_isIm = obj.isIm;
|
|
3222
|
+
const path_isIm = path + '.isIm';
|
|
3223
|
+
if (typeof obj_isIm !== 'boolean') {
|
|
3224
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isIm + '" (at "' + path_isIm + '")');
|
|
3225
|
+
}
|
|
3226
|
+
const obj_isMember = obj.isMember;
|
|
3227
|
+
const path_isMember = path + '.isMember';
|
|
3228
|
+
if (typeof obj_isMember !== 'boolean') {
|
|
3229
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isMember + '" (at "' + path_isMember + '")');
|
|
3230
|
+
}
|
|
3231
|
+
const obj_isOpen = obj.isOpen;
|
|
3232
|
+
const path_isOpen = path + '.isOpen';
|
|
3233
|
+
if (typeof obj_isOpen !== 'boolean') {
|
|
3234
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isOpen + '" (at "' + path_isOpen + '")');
|
|
3235
|
+
}
|
|
3236
|
+
const obj_isPrivate = obj.isPrivate;
|
|
3237
|
+
const path_isPrivate = path + '.isPrivate';
|
|
3238
|
+
if (typeof obj_isPrivate !== 'boolean') {
|
|
3239
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isPrivate + '" (at "' + path_isPrivate + '")');
|
|
3240
|
+
}
|
|
3241
|
+
const obj_isReadOnly = obj.isReadOnly;
|
|
3242
|
+
const path_isReadOnly = path + '.isReadOnly';
|
|
3243
|
+
if (typeof obj_isReadOnly !== 'boolean') {
|
|
3244
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isReadOnly + '" (at "' + path_isReadOnly + '")');
|
|
3245
|
+
}
|
|
3246
|
+
const obj_isThreadOnly = obj.isThreadOnly;
|
|
3247
|
+
const path_isThreadOnly = path + '.isThreadOnly';
|
|
3248
|
+
if (typeof obj_isThreadOnly !== 'boolean') {
|
|
3249
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isThreadOnly + '" (at "' + path_isThreadOnly + '")');
|
|
3250
|
+
}
|
|
3251
|
+
const obj_name = obj.name;
|
|
3252
|
+
const path_name = path + '.name';
|
|
3253
|
+
if (typeof obj_name !== 'string') {
|
|
3254
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
3255
|
+
}
|
|
3256
|
+
const obj_numOfMembers = obj.numOfMembers;
|
|
3257
|
+
const path_numOfMembers = path + '.numOfMembers';
|
|
3258
|
+
if (typeof obj_numOfMembers !== 'number' || (typeof obj_numOfMembers === 'number' && Math.floor(obj_numOfMembers) !== obj_numOfMembers)) {
|
|
3259
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_numOfMembers + '" (at "' + path_numOfMembers + '")');
|
|
3260
|
+
}
|
|
3261
|
+
const obj_shouldCacheCustomEmoji = obj.shouldCacheCustomEmoji;
|
|
3262
|
+
const path_shouldCacheCustomEmoji = path + '.shouldCacheCustomEmoji';
|
|
3263
|
+
if (typeof obj_shouldCacheCustomEmoji !== 'boolean') {
|
|
3264
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_shouldCacheCustomEmoji + '" (at "' + path_shouldCacheCustomEmoji + '")');
|
|
3265
|
+
}
|
|
3266
|
+
})();
|
|
3267
|
+
return v_error === undefined ? null : v_error;
|
|
3268
|
+
}
|
|
3269
|
+
const RepresentationType = 'SlackConversationInfoOutputRepresentation';
|
|
3270
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
3271
|
+
return input;
|
|
3272
|
+
}
|
|
3273
|
+
const select$1 = function SlackConversationInfoOutputRepresentationSelect() {
|
|
3274
|
+
return {
|
|
3275
|
+
kind: 'Fragment',
|
|
3276
|
+
version: VERSION,
|
|
3277
|
+
private: [],
|
|
3278
|
+
selections: [
|
|
3279
|
+
{
|
|
3280
|
+
name: 'id',
|
|
3281
|
+
kind: 'Scalar'
|
|
3282
|
+
},
|
|
3283
|
+
{
|
|
3284
|
+
name: 'isArchived',
|
|
3285
|
+
kind: 'Scalar'
|
|
3286
|
+
},
|
|
3287
|
+
{
|
|
3288
|
+
name: 'isChannel',
|
|
3289
|
+
kind: 'Scalar'
|
|
3290
|
+
},
|
|
3291
|
+
{
|
|
3292
|
+
name: 'isCustomEmojiSupported',
|
|
3293
|
+
kind: 'Scalar'
|
|
3294
|
+
},
|
|
3295
|
+
{
|
|
3296
|
+
name: 'isGroup',
|
|
3297
|
+
kind: 'Scalar'
|
|
3298
|
+
},
|
|
3299
|
+
{
|
|
3300
|
+
name: 'isIm',
|
|
3301
|
+
kind: 'Scalar'
|
|
3302
|
+
},
|
|
3303
|
+
{
|
|
3304
|
+
name: 'isMember',
|
|
3305
|
+
kind: 'Scalar'
|
|
3306
|
+
},
|
|
3307
|
+
{
|
|
3308
|
+
name: 'isOpen',
|
|
3309
|
+
kind: 'Scalar'
|
|
3310
|
+
},
|
|
3311
|
+
{
|
|
3312
|
+
name: 'isPrivate',
|
|
3313
|
+
kind: 'Scalar'
|
|
3314
|
+
},
|
|
3315
|
+
{
|
|
3316
|
+
name: 'isReadOnly',
|
|
3317
|
+
kind: 'Scalar'
|
|
3318
|
+
},
|
|
3319
|
+
{
|
|
3320
|
+
name: 'isThreadOnly',
|
|
3321
|
+
kind: 'Scalar'
|
|
3322
|
+
},
|
|
3323
|
+
{
|
|
3324
|
+
name: 'name',
|
|
3325
|
+
kind: 'Scalar'
|
|
3326
|
+
},
|
|
3327
|
+
{
|
|
3328
|
+
name: 'numOfMembers',
|
|
3329
|
+
kind: 'Scalar'
|
|
3330
|
+
},
|
|
3331
|
+
{
|
|
3332
|
+
name: 'shouldCacheCustomEmoji',
|
|
3333
|
+
kind: 'Scalar'
|
|
3334
|
+
}
|
|
3335
|
+
]
|
|
3336
|
+
};
|
|
3337
|
+
};
|
|
3338
|
+
function equals(existing, incoming) {
|
|
3339
|
+
const existing_isArchived = existing.isArchived;
|
|
3340
|
+
const incoming_isArchived = incoming.isArchived;
|
|
3341
|
+
if (!(existing_isArchived === incoming_isArchived)) {
|
|
3342
|
+
return false;
|
|
3343
|
+
}
|
|
3344
|
+
const existing_isChannel = existing.isChannel;
|
|
3345
|
+
const incoming_isChannel = incoming.isChannel;
|
|
3346
|
+
if (!(existing_isChannel === incoming_isChannel)) {
|
|
3347
|
+
return false;
|
|
3348
|
+
}
|
|
3349
|
+
const existing_isCustomEmojiSupported = existing.isCustomEmojiSupported;
|
|
3350
|
+
const incoming_isCustomEmojiSupported = incoming.isCustomEmojiSupported;
|
|
3351
|
+
if (!(existing_isCustomEmojiSupported === incoming_isCustomEmojiSupported)) {
|
|
3352
|
+
return false;
|
|
3353
|
+
}
|
|
3354
|
+
const existing_isGroup = existing.isGroup;
|
|
3355
|
+
const incoming_isGroup = incoming.isGroup;
|
|
3356
|
+
if (!(existing_isGroup === incoming_isGroup)) {
|
|
3357
|
+
return false;
|
|
3358
|
+
}
|
|
3359
|
+
const existing_isIm = existing.isIm;
|
|
3360
|
+
const incoming_isIm = incoming.isIm;
|
|
3361
|
+
if (!(existing_isIm === incoming_isIm)) {
|
|
3362
|
+
return false;
|
|
3363
|
+
}
|
|
3364
|
+
const existing_isMember = existing.isMember;
|
|
3365
|
+
const incoming_isMember = incoming.isMember;
|
|
3366
|
+
if (!(existing_isMember === incoming_isMember)) {
|
|
3367
|
+
return false;
|
|
3368
|
+
}
|
|
3369
|
+
const existing_isOpen = existing.isOpen;
|
|
3370
|
+
const incoming_isOpen = incoming.isOpen;
|
|
3371
|
+
if (!(existing_isOpen === incoming_isOpen)) {
|
|
3372
|
+
return false;
|
|
3373
|
+
}
|
|
3374
|
+
const existing_isPrivate = existing.isPrivate;
|
|
3375
|
+
const incoming_isPrivate = incoming.isPrivate;
|
|
3376
|
+
if (!(existing_isPrivate === incoming_isPrivate)) {
|
|
3377
|
+
return false;
|
|
3378
|
+
}
|
|
3379
|
+
const existing_isReadOnly = existing.isReadOnly;
|
|
3380
|
+
const incoming_isReadOnly = incoming.isReadOnly;
|
|
3381
|
+
if (!(existing_isReadOnly === incoming_isReadOnly)) {
|
|
3382
|
+
return false;
|
|
3383
|
+
}
|
|
3384
|
+
const existing_isThreadOnly = existing.isThreadOnly;
|
|
3385
|
+
const incoming_isThreadOnly = incoming.isThreadOnly;
|
|
3386
|
+
if (!(existing_isThreadOnly === incoming_isThreadOnly)) {
|
|
3387
|
+
return false;
|
|
3388
|
+
}
|
|
3389
|
+
const existing_shouldCacheCustomEmoji = existing.shouldCacheCustomEmoji;
|
|
3390
|
+
const incoming_shouldCacheCustomEmoji = incoming.shouldCacheCustomEmoji;
|
|
3391
|
+
if (!(existing_shouldCacheCustomEmoji === incoming_shouldCacheCustomEmoji)) {
|
|
3392
|
+
return false;
|
|
3393
|
+
}
|
|
3394
|
+
const existing_numOfMembers = existing.numOfMembers;
|
|
3395
|
+
const incoming_numOfMembers = incoming.numOfMembers;
|
|
3396
|
+
if (!(existing_numOfMembers === incoming_numOfMembers)) {
|
|
3397
|
+
return false;
|
|
3398
|
+
}
|
|
3399
|
+
const existing_id = existing.id;
|
|
3400
|
+
const incoming_id = incoming.id;
|
|
3401
|
+
if (!(existing_id === incoming_id)) {
|
|
3402
|
+
return false;
|
|
3403
|
+
}
|
|
3404
|
+
const existing_name = existing.name;
|
|
3405
|
+
const incoming_name = incoming.name;
|
|
3406
|
+
if (!(existing_name === incoming_name)) {
|
|
3407
|
+
return false;
|
|
3408
|
+
}
|
|
3409
|
+
return true;
|
|
3410
|
+
}
|
|
3411
|
+
const ingest = function SlackConversationInfoOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3412
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3413
|
+
const validateError = validate(input);
|
|
3414
|
+
if (validateError !== null) {
|
|
3415
|
+
throw validateError;
|
|
3416
|
+
}
|
|
3417
|
+
}
|
|
3418
|
+
const key = path.fullPath;
|
|
3419
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
|
|
3420
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "Slack", VERSION, RepresentationType, equals);
|
|
3421
|
+
return createLink(key);
|
|
3422
|
+
};
|
|
3423
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
3424
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3425
|
+
const rootKey = fullPathFactory();
|
|
3426
|
+
rootKeySet.set(rootKey, {
|
|
3427
|
+
namespace: keyPrefix,
|
|
3428
|
+
representationName: RepresentationType,
|
|
3429
|
+
mergeable: false
|
|
3430
|
+
});
|
|
3431
|
+
}
|
|
3432
|
+
|
|
3433
|
+
function select(luvio, params) {
|
|
3434
|
+
return select$1();
|
|
3435
|
+
}
|
|
3436
|
+
function keyBuilder$1(luvio, params) {
|
|
3437
|
+
return keyPrefix + '::SlackConversationInfoOutputRepresentation:(' + 'appId:' + params.queryParams.appId + ',' + 'channelId:' + params.queryParams.channelId + ',' + 'teamId:' + params.queryParams.teamId + ')';
|
|
3438
|
+
}
|
|
3439
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
3440
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
3441
|
+
}
|
|
3442
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
3443
|
+
const { body } = response;
|
|
3444
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
3445
|
+
luvio.storeIngest(key, ingest, body);
|
|
3446
|
+
const snapshot = luvio.storeLookup({
|
|
3447
|
+
recordId: key,
|
|
3448
|
+
node: select(),
|
|
3449
|
+
variables: {},
|
|
3450
|
+
}, snapshotRefresh);
|
|
3451
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3452
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3453
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3454
|
+
}
|
|
3455
|
+
}
|
|
3456
|
+
deepFreeze(snapshot.data);
|
|
3457
|
+
return snapshot;
|
|
3458
|
+
}
|
|
3459
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
3460
|
+
const key = keyBuilder$1(luvio, params);
|
|
3461
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
3462
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
3463
|
+
return errorSnapshot;
|
|
3464
|
+
}
|
|
3465
|
+
function createResourceRequest(config) {
|
|
3466
|
+
const headers = {};
|
|
3467
|
+
return {
|
|
3468
|
+
baseUri: '/services/data/v62.0',
|
|
3469
|
+
basePath: '/connect/swarming/slack/conversation/info',
|
|
3470
|
+
method: 'get',
|
|
3471
|
+
body: null,
|
|
3472
|
+
urlParams: {},
|
|
3473
|
+
queryParams: config.queryParams,
|
|
3474
|
+
headers,
|
|
3475
|
+
priority: 'normal',
|
|
3476
|
+
};
|
|
3477
|
+
}
|
|
3478
|
+
|
|
3479
|
+
const adapterName = 'getSlackConversationgetSlackConversationInfo';
|
|
3480
|
+
const getSlackConversationgetSlackConversationInfo_ConfigPropertyMetadata = [
|
|
3481
|
+
generateParamConfigMetadata('appId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
3482
|
+
generateParamConfigMetadata('channelId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
3483
|
+
generateParamConfigMetadata('teamId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
3484
|
+
];
|
|
3485
|
+
const getSlackConversationgetSlackConversationInfo_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getSlackConversationgetSlackConversationInfo_ConfigPropertyMetadata);
|
|
3486
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$b(getSlackConversationgetSlackConversationInfo_ConfigPropertyMetadata);
|
|
3487
|
+
function keyBuilder(luvio, config) {
|
|
3488
|
+
const resourceParams = createResourceParams(config);
|
|
3489
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
3490
|
+
}
|
|
3491
|
+
function typeCheckConfig(untrustedConfig) {
|
|
3492
|
+
const config = {};
|
|
3493
|
+
typeCheckConfig$b(untrustedConfig, config, getSlackConversationgetSlackConversationInfo_ConfigPropertyMetadata);
|
|
3494
|
+
return config;
|
|
3495
|
+
}
|
|
3496
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
3497
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3498
|
+
return null;
|
|
3499
|
+
}
|
|
3500
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3501
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3502
|
+
}
|
|
3503
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
3504
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3505
|
+
return null;
|
|
3506
|
+
}
|
|
3507
|
+
return config;
|
|
3508
|
+
}
|
|
3509
|
+
function adapterFragment(luvio, config) {
|
|
3510
|
+
createResourceParams(config);
|
|
3511
|
+
return select();
|
|
3512
|
+
}
|
|
3513
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
3514
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
3515
|
+
config,
|
|
3516
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
3517
|
+
});
|
|
3518
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3519
|
+
}
|
|
3520
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
3521
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
3522
|
+
config,
|
|
3523
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
3524
|
+
});
|
|
3525
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3526
|
+
}
|
|
3527
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
3528
|
+
const resourceParams = createResourceParams(config);
|
|
3529
|
+
const request = createResourceRequest(resourceParams);
|
|
3530
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3531
|
+
.then((response) => {
|
|
3532
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
3533
|
+
const cache = new StoreKeyMap();
|
|
3534
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
3535
|
+
return cache;
|
|
3536
|
+
});
|
|
3537
|
+
}, (response) => {
|
|
3538
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
3539
|
+
});
|
|
3540
|
+
}
|
|
3541
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
3542
|
+
return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
3543
|
+
}
|
|
3544
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
3545
|
+
const { luvio, config } = context;
|
|
3546
|
+
const selector = {
|
|
3547
|
+
recordId: keyBuilder(luvio, config),
|
|
3548
|
+
node: adapterFragment(luvio, config),
|
|
3549
|
+
variables: {},
|
|
3550
|
+
};
|
|
3551
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
3552
|
+
config,
|
|
3553
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
3554
|
+
});
|
|
3555
|
+
return cacheSnapshot;
|
|
3556
|
+
}
|
|
3557
|
+
const getSlackConversationgetSlackConversationInfoAdapterFactory = (luvio) => function Slack__getSlackConversationgetSlackConversationInfo(untrustedConfig, requestContext) {
|
|
3558
|
+
const config = validateAdapterConfig(untrustedConfig, getSlackConversationgetSlackConversationInfo_ConfigPropertyNames);
|
|
3559
|
+
// Invalid or incomplete config
|
|
3560
|
+
if (config === null) {
|
|
3561
|
+
return null;
|
|
3562
|
+
}
|
|
3563
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
3564
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
3565
|
+
};
|
|
3566
|
+
|
|
3567
|
+
export { getSlackConversationAdapterFactory, getSlackConversationdeleteSlackMessageAdapterFactory, getSlackConversationdeleteSlackMessageReactionsAdapterFactory, getSlackConversationgetSlackConversationInfoAdapterFactory, getSlackConversationgetSlackMessageAdapterFactory, getSlackConversationgetSlackUserAdapterFactory, getSlackConversationpatchSlackMessageAdapterFactory, getSlackConversationpostSlackConversationAdapterFactory, getSlackConversationpostSlackMessageReactionsAdapterFactory, getSlackCustomEmojiAdapterFactory, postSlackFileAdapterFactory };
|