@salesforce/lds-adapters-platform-slack-bridge 1.332.0-dev3 → 1.332.0-dev4

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.
@@ -73,6 +73,7 @@ const keyPrefix = 'SlackBridge';
73
73
 
74
74
  const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
75
75
  const { isArray: ArrayIsArray } = Array;
76
+ const { stringify: JSONStringify } = JSON;
76
77
  function equalsArray(a, b, equalsItem) {
77
78
  const aLength = a.length;
78
79
  const bLength = b.length;
@@ -1519,12 +1520,54 @@ function getTypeCacheKeys$9(rootKeySet, luvio, input, fullPathFactory) {
1519
1520
  });
1520
1521
  }
1521
1522
 
1522
- const VERSION$8 = "2685fcb652b41bdb9cb71cc45d73e44b";
1523
+ const VERSION$8 = "d4fb2fb522a777fd831f500fea806ebe";
1523
1524
  function validate$8(obj, path = 'SlackBridgeMessageOutputRepresentation') {
1524
1525
  const v_error = (() => {
1525
1526
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1526
1527
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1527
1528
  }
1529
+ const obj_attachments = obj.attachments;
1530
+ const path_attachments = path + '.attachments';
1531
+ if (!ArrayIsArray(obj_attachments)) {
1532
+ return new TypeError('Expected "array" but received "' + typeof obj_attachments + '" (at "' + path_attachments + '")');
1533
+ }
1534
+ for (let i = 0; i < obj_attachments.length; i++) {
1535
+ const obj_attachments_item = obj_attachments[i];
1536
+ const path_attachments_item = path_attachments + '[' + i + ']';
1537
+ if (typeof obj_attachments_item !== 'object' || ArrayIsArray(obj_attachments_item) || obj_attachments_item === null) {
1538
+ return new TypeError('Expected "object" but received "' + typeof obj_attachments_item + '" (at "' + path_attachments_item + '")');
1539
+ }
1540
+ const obj_attachments_item_keys = ObjectKeys(obj_attachments_item);
1541
+ for (let i = 0; i < obj_attachments_item_keys.length; i++) {
1542
+ const key = obj_attachments_item_keys[i];
1543
+ const obj_attachments_item_prop = obj_attachments_item[key];
1544
+ const path_attachments_item_prop = path_attachments_item + '["' + key + '"]';
1545
+ if (obj_attachments_item_prop === undefined) {
1546
+ return new TypeError('Expected "defined" but received "' + typeof obj_attachments_item_prop + '" (at "' + path_attachments_item_prop + '")');
1547
+ }
1548
+ }
1549
+ }
1550
+ const obj_blocks = obj.blocks;
1551
+ const path_blocks = path + '.blocks';
1552
+ if (!ArrayIsArray(obj_blocks)) {
1553
+ return new TypeError('Expected "array" but received "' + typeof obj_blocks + '" (at "' + path_blocks + '")');
1554
+ }
1555
+ for (let i = 0; i < obj_blocks.length; i++) {
1556
+ const obj_blocks_item = obj_blocks[i];
1557
+ const path_blocks_item = path_blocks + '[' + i + ']';
1558
+ if (typeof obj_blocks_item !== 'object' || ArrayIsArray(obj_blocks_item) || obj_blocks_item === null) {
1559
+ return new TypeError('Expected "object" but received "' + typeof obj_blocks_item + '" (at "' + path_blocks_item + '")');
1560
+ }
1561
+ const obj_blocks_item_keys = ObjectKeys(obj_blocks_item);
1562
+ for (let i = 0; i < obj_blocks_item_keys.length; i++) {
1563
+ const key = obj_blocks_item_keys[i];
1564
+ const obj_blocks_item_prop = obj_blocks_item[key];
1565
+ const path_blocks_item_prop = path_blocks_item + '["' + key + '"]';
1566
+ if (obj_blocks_item_prop === undefined) {
1567
+ return new TypeError('Expected "defined" but received "' + typeof obj_blocks_item_prop + '" (at "' + path_blocks_item_prop + '")');
1568
+ }
1569
+ }
1570
+ }
1528
1571
  const obj_files = obj.files;
1529
1572
  const path_files = path + '.files';
1530
1573
  if (!ArrayIsArray(obj_files)) {
@@ -1790,6 +1833,16 @@ const select$i = function SlackBridgeMessageOutputRepresentationSelect() {
1790
1833
  version: VERSION$8,
1791
1834
  private: [],
1792
1835
  selections: [
1836
+ {
1837
+ name: 'attachments',
1838
+ kind: 'Object',
1839
+ // any
1840
+ },
1841
+ {
1842
+ name: 'blocks',
1843
+ kind: 'Object',
1844
+ // any
1845
+ },
1793
1846
  {
1794
1847
  name: 'files',
1795
1848
  kind: 'Link',
@@ -1907,6 +1960,36 @@ function equals$8(existing, incoming) {
1907
1960
  if (!(existing_url === incoming_url)) {
1908
1961
  return false;
1909
1962
  }
1963
+ const existing_attachments = existing.attachments;
1964
+ const incoming_attachments = incoming.attachments;
1965
+ const equals_attachments_items = equalsArray(existing_attachments, incoming_attachments, (existing_attachments_item, incoming_attachments_item) => {
1966
+ const equals_attachments_items_props = equalsObject(existing_attachments_item, incoming_attachments_item, (existing_attachments_item_prop, incoming_attachments_item_prop) => {
1967
+ if (JSONStringify(incoming_attachments_item_prop) !== JSONStringify(existing_attachments_item_prop)) {
1968
+ return false;
1969
+ }
1970
+ });
1971
+ if (equals_attachments_items_props === false) {
1972
+ return false;
1973
+ }
1974
+ });
1975
+ if (equals_attachments_items === false) {
1976
+ return false;
1977
+ }
1978
+ const existing_blocks = existing.blocks;
1979
+ const incoming_blocks = incoming.blocks;
1980
+ const equals_blocks_items = equalsArray(existing_blocks, incoming_blocks, (existing_blocks_item, incoming_blocks_item) => {
1981
+ const equals_blocks_items_props = equalsObject(existing_blocks_item, incoming_blocks_item, (existing_blocks_item_prop, incoming_blocks_item_prop) => {
1982
+ if (JSONStringify(incoming_blocks_item_prop) !== JSONStringify(existing_blocks_item_prop)) {
1983
+ return false;
1984
+ }
1985
+ });
1986
+ if (equals_blocks_items_props === false) {
1987
+ return false;
1988
+ }
1989
+ });
1990
+ if (equals_blocks_items === false) {
1991
+ return false;
1992
+ }
1910
1993
  const existing_files = existing.files;
1911
1994
  const incoming_files = incoming.files;
1912
1995
  const equals_files_items = equalsArray(existing_files, incoming_files, (existing_files_item, incoming_files_item) => {
@@ -1,7 +1,7 @@
1
1
  import { SlackBridgeReactionOutputRepresentation as SlackBridgeReactionOutputRepresentation_SlackBridgeReactionOutputRepresentation } from './SlackBridgeReactionOutputRepresentation';
2
2
  import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, ResourceIngest as $64$luvio_engine_ResourceIngest, FragmentSelection as $64$luvio_engine_FragmentSelection, LinkSelection as $64$luvio_engine_LinkSelection, StoreLink as $64$luvio_engine_StoreLink, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
3
3
  import { SlackBridgeFileOutputRepresentation as SlackBridgeFileOutputRepresentation_SlackBridgeFileOutputRepresentation } from './SlackBridgeFileOutputRepresentation';
4
- export declare const VERSION = "2685fcb652b41bdb9cb71cc45d73e44b";
4
+ export declare const VERSION = "d4fb2fb522a777fd831f500fea806ebe";
5
5
  export declare function validate(obj: any, path?: string): TypeError | null;
6
6
  export declare const RepresentationType: string;
7
7
  export declare function normalize(input: SlackBridgeMessageOutputRepresentation, existing: SlackBridgeMessageOutputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): SlackBridgeMessageOutputRepresentationNormalized;
@@ -25,6 +25,14 @@ export declare function dynamicIngest(ingestParams: DynamicIngestParams): $64$lu
25
25
  * (none)
26
26
  */
27
27
  export interface SlackBridgeMessageOutputRepresentationNormalized {
28
+ /** Message attachments */
29
+ attachments: Array<{
30
+ [key: string]: unknown;
31
+ }>;
32
+ /** Message blocks */
33
+ blocks: Array<{
34
+ [key: string]: unknown;
35
+ }>;
28
36
  /** List of files attached to this message */
29
37
  files: Array<$64$luvio_engine_StoreLink>;
30
38
  /** Does this message includes Custom emoji? */
@@ -67,6 +75,12 @@ export interface SlackBridgeMessageOutputRepresentationNormalized {
67
75
  * (none)
68
76
  */
69
77
  export interface SlackBridgeMessageOutputRepresentation {
78
+ attachments: Array<{
79
+ [key: string]: unknown;
80
+ }>;
81
+ blocks: Array<{
82
+ [key: string]: unknown;
83
+ }>;
70
84
  files: Array<SlackBridgeFileOutputRepresentation_SlackBridgeFileOutputRepresentation>;
71
85
  includesCustomEmoji: boolean | null;
72
86
  isBroadcast: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-platform-slack-bridge",
3
- "version": "1.332.0-dev3",
3
+ "version": "1.332.0-dev4",
4
4
  "description": "API for bridging over to Slack from Salesforce Core",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "dist/es/es2018/platform-slack-bridge.js",
@@ -40,10 +40,10 @@
40
40
  "test:unit": "jest"
41
41
  },
42
42
  "dependencies": {
43
- "@salesforce/lds-bindings": "^1.332.0-dev3"
43
+ "@salesforce/lds-bindings": "^1.332.0-dev4"
44
44
  },
45
45
  "devDependencies": {
46
- "@salesforce/lds-compiler-plugins": "^1.332.0-dev3"
46
+ "@salesforce/lds-compiler-plugins": "^1.332.0-dev4"
47
47
  },
48
48
  "nx": {
49
49
  "targets": {
package/sfdc/index.js CHANGED
@@ -83,6 +83,7 @@ const keyPrefix = 'SlackBridge';
83
83
 
84
84
  const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
85
85
  const { isArray: ArrayIsArray } = Array;
86
+ const { stringify: JSONStringify } = JSON;
86
87
  function equalsArray(a, b, equalsItem) {
87
88
  const aLength = a.length;
88
89
  const bLength = b.length;
@@ -1930,12 +1931,54 @@ function getTypeCacheKeys$7(rootKeySet, luvio, input, fullPathFactory) {
1930
1931
  });
1931
1932
  }
1932
1933
 
1933
- const VERSION$6 = "2685fcb652b41bdb9cb71cc45d73e44b";
1934
+ const VERSION$6 = "d4fb2fb522a777fd831f500fea806ebe";
1934
1935
  function validate$6(obj, path = 'SlackBridgeMessageOutputRepresentation') {
1935
1936
  const v_error = (() => {
1936
1937
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1937
1938
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1938
1939
  }
1940
+ const obj_attachments = obj.attachments;
1941
+ const path_attachments = path + '.attachments';
1942
+ if (!ArrayIsArray(obj_attachments)) {
1943
+ return new TypeError('Expected "array" but received "' + typeof obj_attachments + '" (at "' + path_attachments + '")');
1944
+ }
1945
+ for (let i = 0; i < obj_attachments.length; i++) {
1946
+ const obj_attachments_item = obj_attachments[i];
1947
+ const path_attachments_item = path_attachments + '[' + i + ']';
1948
+ if (typeof obj_attachments_item !== 'object' || ArrayIsArray(obj_attachments_item) || obj_attachments_item === null) {
1949
+ return new TypeError('Expected "object" but received "' + typeof obj_attachments_item + '" (at "' + path_attachments_item + '")');
1950
+ }
1951
+ const obj_attachments_item_keys = ObjectKeys(obj_attachments_item);
1952
+ for (let i = 0; i < obj_attachments_item_keys.length; i++) {
1953
+ const key = obj_attachments_item_keys[i];
1954
+ const obj_attachments_item_prop = obj_attachments_item[key];
1955
+ const path_attachments_item_prop = path_attachments_item + '["' + key + '"]';
1956
+ if (obj_attachments_item_prop === undefined) {
1957
+ return new TypeError('Expected "defined" but received "' + typeof obj_attachments_item_prop + '" (at "' + path_attachments_item_prop + '")');
1958
+ }
1959
+ }
1960
+ }
1961
+ const obj_blocks = obj.blocks;
1962
+ const path_blocks = path + '.blocks';
1963
+ if (!ArrayIsArray(obj_blocks)) {
1964
+ return new TypeError('Expected "array" but received "' + typeof obj_blocks + '" (at "' + path_blocks + '")');
1965
+ }
1966
+ for (let i = 0; i < obj_blocks.length; i++) {
1967
+ const obj_blocks_item = obj_blocks[i];
1968
+ const path_blocks_item = path_blocks + '[' + i + ']';
1969
+ if (typeof obj_blocks_item !== 'object' || ArrayIsArray(obj_blocks_item) || obj_blocks_item === null) {
1970
+ return new TypeError('Expected "object" but received "' + typeof obj_blocks_item + '" (at "' + path_blocks_item + '")');
1971
+ }
1972
+ const obj_blocks_item_keys = ObjectKeys(obj_blocks_item);
1973
+ for (let i = 0; i < obj_blocks_item_keys.length; i++) {
1974
+ const key = obj_blocks_item_keys[i];
1975
+ const obj_blocks_item_prop = obj_blocks_item[key];
1976
+ const path_blocks_item_prop = path_blocks_item + '["' + key + '"]';
1977
+ if (obj_blocks_item_prop === undefined) {
1978
+ return new TypeError('Expected "defined" but received "' + typeof obj_blocks_item_prop + '" (at "' + path_blocks_item_prop + '")');
1979
+ }
1980
+ }
1981
+ }
1939
1982
  const obj_files = obj.files;
1940
1983
  const path_files = path + '.files';
1941
1984
  if (!ArrayIsArray(obj_files)) {
@@ -2201,6 +2244,16 @@ const select$g = function SlackBridgeMessageOutputRepresentationSelect() {
2201
2244
  version: VERSION$6,
2202
2245
  private: [],
2203
2246
  selections: [
2247
+ {
2248
+ name: 'attachments',
2249
+ kind: 'Object',
2250
+ // any
2251
+ },
2252
+ {
2253
+ name: 'blocks',
2254
+ kind: 'Object',
2255
+ // any
2256
+ },
2204
2257
  {
2205
2258
  name: 'files',
2206
2259
  kind: 'Link',
@@ -2318,6 +2371,36 @@ function equals$6(existing, incoming) {
2318
2371
  if (!(existing_url === incoming_url)) {
2319
2372
  return false;
2320
2373
  }
2374
+ const existing_attachments = existing.attachments;
2375
+ const incoming_attachments = incoming.attachments;
2376
+ const equals_attachments_items = equalsArray(existing_attachments, incoming_attachments, (existing_attachments_item, incoming_attachments_item) => {
2377
+ const equals_attachments_items_props = equalsObject(existing_attachments_item, incoming_attachments_item, (existing_attachments_item_prop, incoming_attachments_item_prop) => {
2378
+ if (JSONStringify(incoming_attachments_item_prop) !== JSONStringify(existing_attachments_item_prop)) {
2379
+ return false;
2380
+ }
2381
+ });
2382
+ if (equals_attachments_items_props === false) {
2383
+ return false;
2384
+ }
2385
+ });
2386
+ if (equals_attachments_items === false) {
2387
+ return false;
2388
+ }
2389
+ const existing_blocks = existing.blocks;
2390
+ const incoming_blocks = incoming.blocks;
2391
+ const equals_blocks_items = equalsArray(existing_blocks, incoming_blocks, (existing_blocks_item, incoming_blocks_item) => {
2392
+ const equals_blocks_items_props = equalsObject(existing_blocks_item, incoming_blocks_item, (existing_blocks_item_prop, incoming_blocks_item_prop) => {
2393
+ if (JSONStringify(incoming_blocks_item_prop) !== JSONStringify(existing_blocks_item_prop)) {
2394
+ return false;
2395
+ }
2396
+ });
2397
+ if (equals_blocks_items_props === false) {
2398
+ return false;
2399
+ }
2400
+ });
2401
+ if (equals_blocks_items === false) {
2402
+ return false;
2403
+ }
2321
2404
  const existing_files = existing.files;
2322
2405
  const incoming_files = incoming.files;
2323
2406
  const equals_files_items = equalsArray(existing_files, incoming_files, (existing_files_item, incoming_files_item) => {
@@ -4655,4 +4738,4 @@ withDefaultLuvio((luvio) => {
4655
4738
  });
4656
4739
 
4657
4740
  export { deleteSlackMessage, deleteSlackMessageReactions, getSlackConversation, getSlackConversation_imperative, getSlackCustomEmoji, getSlackCustomEmoji_imperative, getSlackMessage, getSlackMessageNotifyChange, getSlackMessage_imperative, getSlackSearchEmoji, getSlackSearchEmoji_imperative, getSlackSearchUser, getSlackSearchUser_imperative, getSlackUser, getSlackUserNotifyChange, getSlackUser_imperative, patchSlackMessage, postSlackConversation, postSlackFile, postSlackMessageReactions };
4658
- // version: 1.332.0-dev3-9fb043ed2d
4741
+ // version: 1.332.0-dev4-b9914caa2e
package/src/raml/api.raml CHANGED
@@ -319,6 +319,22 @@ types:
319
319
  description: Contains the details of Slack Message
320
320
  type: object
321
321
  properties:
322
+ attachments:
323
+ description: Message attachments
324
+ type: array
325
+ items:
326
+ type: object
327
+ properties:
328
+ //:
329
+ type: any
330
+ blocks:
331
+ description: Message blocks
332
+ type: array
333
+ items:
334
+ type: object
335
+ properties:
336
+ //:
337
+ type: any
322
338
  files:
323
339
  description: List of files attached to this message
324
340
  type: array