@itentialopensource/adapter-microsoft_graph 1.4.0 → 1.4.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.
@@ -1553,6 +1553,31 @@ describe('[integration] Microsoft_graph Adapter Test', () => {
1553
1553
  }).timeout(attemptTimeout);
1554
1554
  });
1555
1555
 
1556
+ describe('#sendChannelMessage - errors', () => {
1557
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1558
+ try {
1559
+ a.sendChannelMessage(teamsTeamId, teamsChannelId, teamsCreateaplaintextchatthreadBetaBodyParam, (data, error) => {
1560
+ try {
1561
+ if (stub) {
1562
+ const displayE = 'Error 400 received on request';
1563
+ runErrorAsserts(data, error, 'AD.500', 'Test-microsoft_graph-connectorRest-handleEndResponse', displayE);
1564
+ } else {
1565
+ runCommonAsserts(data, error);
1566
+ }
1567
+ saveMockData('Teams', 'sendChannelMessage', 'default', data);
1568
+ done();
1569
+ } catch (err) {
1570
+ log.error(`Test Failure: ${err}`);
1571
+ done(err);
1572
+ }
1573
+ });
1574
+ } catch (error) {
1575
+ log.error(`Adapter Exception: ${error}`);
1576
+ done(error);
1577
+ }
1578
+ }).timeout(attemptTimeout);
1579
+ });
1580
+
1556
1581
  const teamsCreateteamBodyParam = {
1557
1582
  'template@odata.bind': 'https://graph.microsoft.com/v1.0/teamsTemplates(\'standard\')',
1558
1583
  displayName: 'My Sample Team',
@@ -1752,6 +1777,31 @@ describe('[integration] Microsoft_graph Adapter Test', () => {
1752
1777
  }).timeout(attemptTimeout);
1753
1778
  });
1754
1779
 
1780
+ describe('#getMessagesWithoutRepliesInChannel - errors', () => {
1781
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1782
+ try {
1783
+ a.getMessagesWithoutRepliesInChannel(teamsTeamId, teamsChannelId, (data, error) => {
1784
+ try {
1785
+ if (stub) {
1786
+ const displayE = 'Error 400 received on request';
1787
+ runErrorAsserts(data, error, 'AD.500', 'Test-microsoft_graph-connectorRest-handleEndResponse', displayE);
1788
+ } else {
1789
+ runCommonAsserts(data, error);
1790
+ }
1791
+ saveMockData('Teams', 'getMessagesWithoutRepliesInChannel', 'default', data);
1792
+ done();
1793
+ } catch (err) {
1794
+ log.error(`Test Failure: ${err}`);
1795
+ done(err);
1796
+ }
1797
+ });
1798
+ } catch (error) {
1799
+ log.error(`Adapter Exception: ${error}`);
1800
+ done(error);
1801
+ }
1802
+ }).timeout(attemptTimeout);
1803
+ });
1804
+
1755
1805
  const teamsMessageId = 'fakedata';
1756
1806
  describe('#getamessageinachannelBeta - errors', () => {
1757
1807
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
@@ -1778,6 +1828,31 @@ describe('[integration] Microsoft_graph Adapter Test', () => {
1778
1828
  }).timeout(attemptTimeout);
1779
1829
  });
1780
1830
 
1831
+ describe('#getSingleMessageInChannel - errors', () => {
1832
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1833
+ try {
1834
+ a.getSingleMessageInChannel(teamsTeamId, teamsChannelId, teamsMessageId, (data, error) => {
1835
+ try {
1836
+ if (stub) {
1837
+ const displayE = 'Error 400 received on request';
1838
+ runErrorAsserts(data, error, 'AD.500', 'Test-microsoft_graph-connectorRest-handleEndResponse', displayE);
1839
+ } else {
1840
+ runCommonAsserts(data, error);
1841
+ }
1842
+ saveMockData('Teams', 'getSingleMessageInChannel', 'default', data);
1843
+ done();
1844
+ } catch (err) {
1845
+ log.error(`Test Failure: ${err}`);
1846
+ done(err);
1847
+ }
1848
+ });
1849
+ } catch (error) {
1850
+ log.error(`Adapter Exception: ${error}`);
1851
+ done(error);
1852
+ }
1853
+ }).timeout(attemptTimeout);
1854
+ });
1855
+
1781
1856
  describe('#getrepliestoamessageinachannelBeta - errors', () => {
1782
1857
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1783
1858
  try {
@@ -1803,6 +1878,31 @@ describe('[integration] Microsoft_graph Adapter Test', () => {
1803
1878
  }).timeout(attemptTimeout);
1804
1879
  });
1805
1880
 
1881
+ describe('#getRepliesToMessageInChannel - errors', () => {
1882
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1883
+ try {
1884
+ a.getRepliesToMessageInChannel(teamsTeamId, teamsChannelId, teamsMessageId, (data, error) => {
1885
+ try {
1886
+ if (stub) {
1887
+ const displayE = 'Error 400 received on request';
1888
+ runErrorAsserts(data, error, 'AD.500', 'Test-microsoft_graph-connectorRest-handleEndResponse', displayE);
1889
+ } else {
1890
+ runCommonAsserts(data, error);
1891
+ }
1892
+ saveMockData('Teams', 'getRepliesToMessageInChannel', 'default', data);
1893
+ done();
1894
+ } catch (err) {
1895
+ log.error(`Test Failure: ${err}`);
1896
+ done(err);
1897
+ }
1898
+ });
1899
+ } catch (error) {
1900
+ log.error(`Adapter Exception: ${error}`);
1901
+ done(error);
1902
+ }
1903
+ }).timeout(attemptTimeout);
1904
+ });
1905
+
1806
1906
  const teamsReplyId = 'fakedata';
1807
1907
  describe('#getareplyofamessageBeta - errors', () => {
1808
1908
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
@@ -1829,6 +1929,31 @@ describe('[integration] Microsoft_graph Adapter Test', () => {
1829
1929
  }).timeout(attemptTimeout);
1830
1930
  });
1831
1931
 
1932
+ describe('#getSingleMessageReplyInChannel - errors', () => {
1933
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1934
+ try {
1935
+ a.getSingleMessageReplyInChannel(teamsTeamId, teamsChannelId, teamsMessageId, teamsReplyId, (data, error) => {
1936
+ try {
1937
+ if (stub) {
1938
+ const displayE = 'Error 400 received on request';
1939
+ runErrorAsserts(data, error, 'AD.500', 'Test-microsoft_graph-connectorRest-handleEndResponse', displayE);
1940
+ } else {
1941
+ runCommonAsserts(data, error);
1942
+ }
1943
+ saveMockData('Teams', 'getSingleMessageReplyInChannel', 'default', data);
1944
+ done();
1945
+ } catch (err) {
1946
+ log.error(`Test Failure: ${err}`);
1947
+ done(err);
1948
+ }
1949
+ });
1950
+ } catch (error) {
1951
+ log.error(`Adapter Exception: ${error}`);
1952
+ done(error);
1953
+ }
1954
+ }).timeout(attemptTimeout);
1955
+ });
1956
+
1832
1957
  const teamsGroupId = 'fakedata';
1833
1958
  const teamsCreateteamfromgroupBodyParam = {
1834
1959
  memberSettings: {
@@ -314,16 +314,16 @@ describe('[unit] Microsoft_graph Adapter Test', () => {
314
314
  assert.notEqual(undefined, packageDotJson.dependencies);
315
315
  assert.notEqual(null, packageDotJson.dependencies);
316
316
  assert.notEqual('', packageDotJson.dependencies);
317
- assert.equal('^8.12.0', packageDotJson.dependencies.ajv);
318
- assert.equal('^1.6.8', packageDotJson.dependencies.axios);
317
+ assert.equal('^8.17.1', packageDotJson.dependencies.ajv);
318
+ assert.equal('^1.7.2', packageDotJson.dependencies.axios);
319
319
  assert.equal('^11.0.0', packageDotJson.dependencies.commander);
320
- assert.equal('^11.1.1', packageDotJson.dependencies['fs-extra']);
321
- assert.equal('^10.3.0', packageDotJson.dependencies.mocha);
320
+ assert.equal('^11.2.0', packageDotJson.dependencies['fs-extra']);
321
+ assert.equal('^10.7.0', packageDotJson.dependencies.mocha);
322
322
  assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
323
323
  assert.equal('^0.4.4', packageDotJson.dependencies.ping);
324
324
  assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
325
- assert.equal('^7.5.3', packageDotJson.dependencies.semver);
326
- assert.equal('^3.9.0', packageDotJson.dependencies.winston);
325
+ assert.equal('^7.6.3', packageDotJson.dependencies.semver);
326
+ assert.equal('^3.13.1', packageDotJson.dependencies.winston);
327
327
  done();
328
328
  } catch (error) {
329
329
  log.error(`Test Failure: ${error}`);
@@ -2890,6 +2890,52 @@ describe('[unit] Microsoft_graph Adapter Test', () => {
2890
2890
  }).timeout(attemptTimeout);
2891
2891
  });
2892
2892
 
2893
+ describe('#getMessagesWithoutRepliesInChannel - errors', () => {
2894
+ it('should have a getMessagesWithoutRepliesInChannel function', (done) => {
2895
+ try {
2896
+ assert.equal(true, typeof a.getMessagesWithoutRepliesInChannel === 'function');
2897
+ done();
2898
+ } catch (error) {
2899
+ log.error(`Test Failure: ${error}`);
2900
+ done(error);
2901
+ }
2902
+ }).timeout(attemptTimeout);
2903
+ it('should error if - missing teamId', (done) => {
2904
+ try {
2905
+ a.getMessagesWithoutRepliesInChannel(null, null, (data, error) => {
2906
+ try {
2907
+ const displayE = 'teamId is required';
2908
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-getMessagesWithoutRepliesInChannel', displayE);
2909
+ done();
2910
+ } catch (err) {
2911
+ log.error(`Test Failure: ${err}`);
2912
+ done(err);
2913
+ }
2914
+ });
2915
+ } catch (error) {
2916
+ log.error(`Adapter Exception: ${error}`);
2917
+ done(error);
2918
+ }
2919
+ }).timeout(attemptTimeout);
2920
+ it('should error if - missing channelId', (done) => {
2921
+ try {
2922
+ a.getMessagesWithoutRepliesInChannel('fakeparam', null, (data, error) => {
2923
+ try {
2924
+ const displayE = 'channelId is required';
2925
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-getMessagesWithoutRepliesInChannel', displayE);
2926
+ done();
2927
+ } catch (err) {
2928
+ log.error(`Test Failure: ${err}`);
2929
+ done(err);
2930
+ }
2931
+ });
2932
+ } catch (error) {
2933
+ log.error(`Adapter Exception: ${error}`);
2934
+ done(error);
2935
+ }
2936
+ }).timeout(attemptTimeout);
2937
+ });
2938
+
2893
2939
  describe('#createaplaintextchatthreadBeta - errors', () => {
2894
2940
  it('should have a createaplaintextchatthreadBeta function', (done) => {
2895
2941
  try {
@@ -2953,6 +2999,69 @@ describe('[unit] Microsoft_graph Adapter Test', () => {
2953
2999
  }).timeout(attemptTimeout);
2954
3000
  });
2955
3001
 
3002
+ describe('#sendChannelMessage - errors', () => {
3003
+ it('should have a sendChannelMessage function', (done) => {
3004
+ try {
3005
+ assert.equal(true, typeof a.sendChannelMessage === 'function');
3006
+ done();
3007
+ } catch (error) {
3008
+ log.error(`Test Failure: ${error}`);
3009
+ done(error);
3010
+ }
3011
+ }).timeout(attemptTimeout);
3012
+ it('should error if - missing teamId', (done) => {
3013
+ try {
3014
+ a.sendChannelMessage(null, null, null, (data, error) => {
3015
+ try {
3016
+ const displayE = 'teamId is required';
3017
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-sendChannelMessage', displayE);
3018
+ done();
3019
+ } catch (err) {
3020
+ log.error(`Test Failure: ${err}`);
3021
+ done(err);
3022
+ }
3023
+ });
3024
+ } catch (error) {
3025
+ log.error(`Adapter Exception: ${error}`);
3026
+ done(error);
3027
+ }
3028
+ }).timeout(attemptTimeout);
3029
+ it('should error if - missing channelId', (done) => {
3030
+ try {
3031
+ a.sendChannelMessage('fakeparam', null, null, (data, error) => {
3032
+ try {
3033
+ const displayE = 'channelId is required';
3034
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-sendChannelMessage', displayE);
3035
+ done();
3036
+ } catch (err) {
3037
+ log.error(`Test Failure: ${err}`);
3038
+ done(err);
3039
+ }
3040
+ });
3041
+ } catch (error) {
3042
+ log.error(`Adapter Exception: ${error}`);
3043
+ done(error);
3044
+ }
3045
+ }).timeout(attemptTimeout);
3046
+ it('should error if - missing body', (done) => {
3047
+ try {
3048
+ a.sendChannelMessage('fakeparam', 'fakeparam', null, (data, error) => {
3049
+ try {
3050
+ const displayE = 'body is required';
3051
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-sendChannelMessage', displayE);
3052
+ done();
3053
+ } catch (err) {
3054
+ log.error(`Test Failure: ${err}`);
3055
+ done(err);
3056
+ }
3057
+ });
3058
+ } catch (error) {
3059
+ log.error(`Adapter Exception: ${error}`);
3060
+ done(error);
3061
+ }
3062
+ }).timeout(attemptTimeout);
3063
+ });
3064
+
2956
3065
  describe('#getamessageinachannelBeta - errors', () => {
2957
3066
  it('should have a getamessageinachannelBeta function', (done) => {
2958
3067
  try {
@@ -3016,6 +3125,69 @@ describe('[unit] Microsoft_graph Adapter Test', () => {
3016
3125
  }).timeout(attemptTimeout);
3017
3126
  });
3018
3127
 
3128
+ describe('#getSingleMessageInChannel - errors', () => {
3129
+ it('should have a getSingleMessageInChannel function', (done) => {
3130
+ try {
3131
+ assert.equal(true, typeof a.getSingleMessageInChannel === 'function');
3132
+ done();
3133
+ } catch (error) {
3134
+ log.error(`Test Failure: ${error}`);
3135
+ done(error);
3136
+ }
3137
+ }).timeout(attemptTimeout);
3138
+ it('should error if - missing teamId', (done) => {
3139
+ try {
3140
+ a.getSingleMessageInChannel(null, null, null, (data, error) => {
3141
+ try {
3142
+ const displayE = 'teamId is required';
3143
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-getSingleMessageInChannel', displayE);
3144
+ done();
3145
+ } catch (err) {
3146
+ log.error(`Test Failure: ${err}`);
3147
+ done(err);
3148
+ }
3149
+ });
3150
+ } catch (error) {
3151
+ log.error(`Adapter Exception: ${error}`);
3152
+ done(error);
3153
+ }
3154
+ }).timeout(attemptTimeout);
3155
+ it('should error if - missing channelId', (done) => {
3156
+ try {
3157
+ a.getSingleMessageInChannel('fakeparam', null, null, (data, error) => {
3158
+ try {
3159
+ const displayE = 'channelId is required';
3160
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-getSingleMessageInChannel', displayE);
3161
+ done();
3162
+ } catch (err) {
3163
+ log.error(`Test Failure: ${err}`);
3164
+ done(err);
3165
+ }
3166
+ });
3167
+ } catch (error) {
3168
+ log.error(`Adapter Exception: ${error}`);
3169
+ done(error);
3170
+ }
3171
+ }).timeout(attemptTimeout);
3172
+ it('should error if - missing messageId', (done) => {
3173
+ try {
3174
+ a.getSingleMessageInChannel('fakeparam', 'fakeparam', null, (data, error) => {
3175
+ try {
3176
+ const displayE = 'messageId is required';
3177
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-getSingleMessageInChannel', displayE);
3178
+ done();
3179
+ } catch (err) {
3180
+ log.error(`Test Failure: ${err}`);
3181
+ done(err);
3182
+ }
3183
+ });
3184
+ } catch (error) {
3185
+ log.error(`Adapter Exception: ${error}`);
3186
+ done(error);
3187
+ }
3188
+ }).timeout(attemptTimeout);
3189
+ });
3190
+
3019
3191
  describe('#getrepliestoamessageinachannelBeta - errors', () => {
3020
3192
  it('should have a getrepliestoamessageinachannelBeta function', (done) => {
3021
3193
  try {
@@ -3079,6 +3251,69 @@ describe('[unit] Microsoft_graph Adapter Test', () => {
3079
3251
  }).timeout(attemptTimeout);
3080
3252
  });
3081
3253
 
3254
+ describe('#getRepliesToMessageInChannel - errors', () => {
3255
+ it('should have a getRepliesToMessageInChannel function', (done) => {
3256
+ try {
3257
+ assert.equal(true, typeof a.getRepliesToMessageInChannel === 'function');
3258
+ done();
3259
+ } catch (error) {
3260
+ log.error(`Test Failure: ${error}`);
3261
+ done(error);
3262
+ }
3263
+ }).timeout(attemptTimeout);
3264
+ it('should error if - missing teamId', (done) => {
3265
+ try {
3266
+ a.getRepliesToMessageInChannel(null, null, null, (data, error) => {
3267
+ try {
3268
+ const displayE = 'teamId is required';
3269
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-getRepliesToMessageInChannel', displayE);
3270
+ done();
3271
+ } catch (err) {
3272
+ log.error(`Test Failure: ${err}`);
3273
+ done(err);
3274
+ }
3275
+ });
3276
+ } catch (error) {
3277
+ log.error(`Adapter Exception: ${error}`);
3278
+ done(error);
3279
+ }
3280
+ }).timeout(attemptTimeout);
3281
+ it('should error if - missing channelId', (done) => {
3282
+ try {
3283
+ a.getRepliesToMessageInChannel('fakeparam', null, null, (data, error) => {
3284
+ try {
3285
+ const displayE = 'channelId is required';
3286
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-getRepliesToMessageInChannel', displayE);
3287
+ done();
3288
+ } catch (err) {
3289
+ log.error(`Test Failure: ${err}`);
3290
+ done(err);
3291
+ }
3292
+ });
3293
+ } catch (error) {
3294
+ log.error(`Adapter Exception: ${error}`);
3295
+ done(error);
3296
+ }
3297
+ }).timeout(attemptTimeout);
3298
+ it('should error if - missing messageId', (done) => {
3299
+ try {
3300
+ a.getRepliesToMessageInChannel('fakeparam', 'fakeparam', null, (data, error) => {
3301
+ try {
3302
+ const displayE = 'messageId is required';
3303
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-getRepliesToMessageInChannel', displayE);
3304
+ done();
3305
+ } catch (err) {
3306
+ log.error(`Test Failure: ${err}`);
3307
+ done(err);
3308
+ }
3309
+ });
3310
+ } catch (error) {
3311
+ log.error(`Adapter Exception: ${error}`);
3312
+ done(error);
3313
+ }
3314
+ }).timeout(attemptTimeout);
3315
+ });
3316
+
3082
3317
  describe('#getareplyofamessageBeta - errors', () => {
3083
3318
  it('should have a getareplyofamessageBeta function', (done) => {
3084
3319
  try {
@@ -3159,6 +3394,86 @@ describe('[unit] Microsoft_graph Adapter Test', () => {
3159
3394
  }).timeout(attemptTimeout);
3160
3395
  });
3161
3396
 
3397
+ describe('#getSingleMessageReplyInChannel - errors', () => {
3398
+ it('should have a getSingleMessageReplyInChannel function', (done) => {
3399
+ try {
3400
+ assert.equal(true, typeof a.getSingleMessageReplyInChannel === 'function');
3401
+ done();
3402
+ } catch (error) {
3403
+ log.error(`Test Failure: ${error}`);
3404
+ done(error);
3405
+ }
3406
+ }).timeout(attemptTimeout);
3407
+ it('should error if - missing teamId', (done) => {
3408
+ try {
3409
+ a.getSingleMessageReplyInChannel(null, null, null, null, (data, error) => {
3410
+ try {
3411
+ const displayE = 'teamId is required';
3412
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-getSingleMessageReplyInChannel', displayE);
3413
+ done();
3414
+ } catch (err) {
3415
+ log.error(`Test Failure: ${err}`);
3416
+ done(err);
3417
+ }
3418
+ });
3419
+ } catch (error) {
3420
+ log.error(`Adapter Exception: ${error}`);
3421
+ done(error);
3422
+ }
3423
+ }).timeout(attemptTimeout);
3424
+ it('should error if - missing channelId', (done) => {
3425
+ try {
3426
+ a.getSingleMessageReplyInChannel('fakeparam', null, null, null, (data, error) => {
3427
+ try {
3428
+ const displayE = 'channelId is required';
3429
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-getSingleMessageReplyInChannel', displayE);
3430
+ done();
3431
+ } catch (err) {
3432
+ log.error(`Test Failure: ${err}`);
3433
+ done(err);
3434
+ }
3435
+ });
3436
+ } catch (error) {
3437
+ log.error(`Adapter Exception: ${error}`);
3438
+ done(error);
3439
+ }
3440
+ }).timeout(attemptTimeout);
3441
+ it('should error if - missing messageId', (done) => {
3442
+ try {
3443
+ a.getSingleMessageReplyInChannel('fakeparam', 'fakeparam', null, null, (data, error) => {
3444
+ try {
3445
+ const displayE = 'messageId is required';
3446
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-getSingleMessageReplyInChannel', displayE);
3447
+ done();
3448
+ } catch (err) {
3449
+ log.error(`Test Failure: ${err}`);
3450
+ done(err);
3451
+ }
3452
+ });
3453
+ } catch (error) {
3454
+ log.error(`Adapter Exception: ${error}`);
3455
+ done(error);
3456
+ }
3457
+ }).timeout(attemptTimeout);
3458
+ it('should error if - missing replyId', (done) => {
3459
+ try {
3460
+ a.getareplyofamessageBeta('fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
3461
+ try {
3462
+ const displayE = 'replyId is required';
3463
+ runErrorAsserts(data, error, 'AD.300', 'Test-microsoft_graph-adapter-getareplyofamessageBeta', displayE);
3464
+ done();
3465
+ } catch (err) {
3466
+ log.error(`Test Failure: ${err}`);
3467
+ done(err);
3468
+ }
3469
+ });
3470
+ } catch (error) {
3471
+ log.error(`Adapter Exception: ${error}`);
3472
+ done(error);
3473
+ }
3474
+ }).timeout(attemptTimeout);
3475
+ });
3476
+
3162
3477
  describe('#getuserSjoinedteams - errors', () => {
3163
3478
  it('should have a getuserSjoinedteams function', (done) => {
3164
3479
  try {