@itentialopensource/adapter-slack 2.6.1 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
1
1
 
2
+ ## 2.6.2 [08-03-2022]
3
+
4
+ * Add parameters for postFilesupload
5
+
6
+ See merge request itentialopensource/adapters/notification-messaging/adapter-slack!13
7
+
8
+ ---
9
+
2
10
  ## 2.6.1 [07-25-2022]
3
11
 
4
12
  * Fix schema for threadTs
package/adapter.js CHANGED
@@ -5283,10 +5283,11 @@ class Slacktest extends AdapterBaseCl {
5283
5283
  * @param {string} content - File contents via a POST variable. If omitting this parameter, you must provide a `file`.
5284
5284
  * @param {string} token - Authentication token. Requires scope: `files:write:user`
5285
5285
  * @param {string} file - File contents via `multipart\/form-data`. If omitting this parameter, you must submit `content`.
5286
+ * @param {number} threadTs - Unique identifier of a thread's parent message
5286
5287
  * @param {getCallback} callback - a callback function to return the result
5287
5288
  */
5288
5289
  /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
5289
- postFilesupload(channels, title, initialComment, filetype, filename, content, token, file, callback) {
5290
+ postFilesupload(channels, title, initialComment, filetype, filename, content, token, file, threadTs, callback) {
5290
5291
  const meth = 'adapter-postFilesupload';
5291
5292
  const origin = `${this.id}-${meth}`;
5292
5293
  log.trace(origin);
@@ -5303,7 +5304,7 @@ class Slacktest extends AdapterBaseCl {
5303
5304
  const queryParamsAvailable = {};
5304
5305
  const queryParams = {};
5305
5306
  const pathVars = [];
5306
- const bodyVars = {};
5307
+ const bodyVars = { channels, title, initialComment, filetype, filename, content, file, threadTs };
5307
5308
 
5308
5309
  // loop in template. long callback arg name to avoid identifier conflicts
5309
5310
  Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
@@ -29,7 +29,7 @@
29
29
  "external_name": "ph_request_type"
30
30
  },
31
31
  "threadTs": {
32
- "type": "string",
32
+ "type": ["string", "number"],
33
33
  "description": "Unique identifier of a thread's parent message",
34
34
  "parse": false,
35
35
  "encode": false,
@@ -21,7 +21,7 @@
21
21
  "external_name": "ph_request_type"
22
22
  },
23
23
  "threadTs": {
24
- "type": "string",
24
+ "type": ["string", "number"],
25
25
  "description": "Unique identifier of a thread's parent message",
26
26
  "parse": false,
27
27
  "encode": false,
@@ -2,7 +2,7 @@
2
2
  "$id": "schema.json",
3
3
  "type": "object",
4
4
  "schema": "http://json-schema.org/draft-07/schema#",
5
- "translate": false,
5
+ "translate": true,
6
6
  "dynamicfields": true,
7
7
  "properties": {
8
8
  "ph_request_type": {
@@ -18,6 +18,17 @@
18
18
  "postFilesupload"
19
19
  ],
20
20
  "external_name": "ph_request_type"
21
+ },
22
+ "threadTs": {
23
+ "type": ["string", "number"],
24
+ "description": "Unique identifier of a thread's parent message",
25
+ "parse": false,
26
+ "encode": false,
27
+ "encrypt": {
28
+ "type": "AES",
29
+ "key": ""
30
+ },
31
+ "external_name": "thread_ts"
21
32
  }
22
33
  },
23
34
  "definitions": {}
@@ -30,7 +30,7 @@
30
30
  "external_name": "ph_request_type"
31
31
  },
32
32
  "threadTs": {
33
- "type": "string",
33
+ "type": ["string", "number"],
34
34
  "description": "Unique identifier of a thread's parent message",
35
35
  "parse": false,
36
36
  "encode": false,
@@ -20,7 +20,7 @@
20
20
  "external_name": "ph_request_type"
21
21
  },
22
22
  "threadTs": {
23
- "type": "string",
23
+ "type": ["string", "number"],
24
24
  "description": "Unique identifier of a thread's parent message",
25
25
  "parse": false,
26
26
  "encode": false,
@@ -20,7 +20,7 @@
20
20
  "external_name": "ph_request_type"
21
21
  },
22
22
  "threadTs": {
23
- "type": "string",
23
+ "type": ["string", "number"],
24
24
  "description": "Unique identifier of a thread's parent message",
25
25
  "parse": false,
26
26
  "encode": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-slack",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
4
4
  "description": "This adapter integrates with system Slack",
5
5
  "main": "adapter.js",
6
6
  "systemName": "Slack",
package/pronghorn.json CHANGED
@@ -4332,6 +4332,16 @@
4332
4332
  "title": "file",
4333
4333
  "type": "string"
4334
4334
  }
4335
+ },
4336
+ {
4337
+ "name": "threadTs",
4338
+ "type": "number",
4339
+ "info": "Unique identifier of a thread's parent message",
4340
+ "required": false,
4341
+ "schema": {
4342
+ "title": "threadTs",
4343
+ "type": "number"
4344
+ }
4335
4345
  }
4336
4346
  ],
4337
4347
  "output": {
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "2.5.5",
3
- "configLines": 10347,
2
+ "version": "2.6.1",
3
+ "configLines": 10357,
4
4
  "scriptLines": 1707,
5
- "codeLines": 12509,
5
+ "codeLines": 12510,
6
6
  "testLines": 9108,
7
7
  "testCases": 394,
8
- "totalCodeLines": 23324,
8
+ "totalCodeLines": 23325,
9
9
  "wfTasks": 155
10
10
  }
@@ -238,7 +238,7 @@ const Slacktest = require('../../adapter');
238
238
 
239
239
  // begin the testing - these should be pretty well defined between the describe and the it!
240
240
  describe('[integration] Slack Adapter Test', () => {
241
- describe('Slacktest Class Tests', () => {
241
+ describe('Slack Class Tests', () => {
242
242
  const a = new Slacktest(
243
243
  pronghornProps.adapterProps.adapters[0].id,
244
244
  pronghornProps.adapterProps.adapters[0].properties
@@ -2848,7 +2848,7 @@ describe('[integration] Slack Adapter Test', () => {
2848
2848
  describe('#postFilesupload - errors', () => {
2849
2849
  it('should work if integrated or standalone with mockdata', (done) => {
2850
2850
  try {
2851
- a.postFilesupload('fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', (data, error) => {
2851
+ a.postFilesupload('fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 0, (data, error) => {
2852
2852
  try {
2853
2853
  if (stub) {
2854
2854
  assert.equal(undefined, error);
@@ -131,7 +131,7 @@ if (fs.existsSync(dirPath)) {
131
131
 
132
132
  // begin the testing - these should be pretty well defined between the describe and the it!
133
133
  describe('[unit] Slack Adapter Test', () => {
134
- describe('Slacktest Class Tests', () => {
134
+ describe('Slack Class Tests', () => {
135
135
  const a = new Slacktest(
136
136
  pronghornProps.adapterProps.adapters[0].id,
137
137
  pronghornProps.adapterProps.adapters[0].properties