@digipair/skill-microsoft 0.88.6 → 0.90.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/index.cjs.js +21 -3
- package/index.esm.js +21 -3
- package/package.json +1 -1
- package/schema.fr.json +108 -0
- package/schema.json +108 -0
package/index.cjs.js
CHANGED
|
@@ -24954,6 +24954,7 @@ let MicrosoftService = class MicrosoftService {
|
|
|
24954
24954
|
}
|
|
24955
24955
|
}
|
|
24956
24956
|
async call(url, method, version, data, headers, signal) {
|
|
24957
|
+
let result;
|
|
24957
24958
|
const accessToken = await this.getAccessToken();
|
|
24958
24959
|
const response = await fetch(`${API_ENDPOINT}/${version}/${url}`, {
|
|
24959
24960
|
signal,
|
|
@@ -24961,12 +24962,25 @@ let MicrosoftService = class MicrosoftService {
|
|
|
24961
24962
|
headers: _extends({
|
|
24962
24963
|
Authorization: `Bearer ${accessToken}`,
|
|
24963
24964
|
Accept: 'application/json',
|
|
24964
|
-
'Content-Type':
|
|
24965
|
+
'Content-Type': this.contentType
|
|
24965
24966
|
}, headers),
|
|
24966
|
-
body: method.toUpperCase() === 'GET' || method.toUpperCase() === 'HEAD' ? undefined : JSON.stringify(data)
|
|
24967
|
+
body: method.toUpperCase() === 'GET' || method.toUpperCase() === 'HEAD' ? undefined : this.contentType === 'application/json' ? JSON.stringify(data) : typeof data === 'string' && data.startsWith('data:') ? Buffer.from(data.replace(/^data:.*;base64,/, ''), 'base64') : data
|
|
24967
24968
|
});
|
|
24968
24969
|
if (!response.ok) throw new Error('[SKILL-MICROSOFT] REQUEST FAILED: ' + response.status);
|
|
24969
|
-
|
|
24970
|
+
if (!response.headers.has('content-length') || response.headers.get('content-length') > 0) {
|
|
24971
|
+
if (this.type === 'json') {
|
|
24972
|
+
result = await response.json();
|
|
24973
|
+
} else if (this.type === 'text') {
|
|
24974
|
+
result = await response.text();
|
|
24975
|
+
} else {
|
|
24976
|
+
const arrayBuffer = await response.arrayBuffer();
|
|
24977
|
+
const buffer = Buffer.from(arrayBuffer);
|
|
24978
|
+
result = buffer.toString('base64');
|
|
24979
|
+
}
|
|
24980
|
+
} else {
|
|
24981
|
+
result = {};
|
|
24982
|
+
}
|
|
24983
|
+
return result;
|
|
24970
24984
|
}
|
|
24971
24985
|
async create(params, _pinsSettingsList, context) {
|
|
24972
24986
|
var _context_protected;
|
|
@@ -25005,6 +25019,10 @@ let MicrosoftService = class MicrosoftService {
|
|
|
25005
25019
|
this.OAUTH_CLIENT_SECRET = (_ref1 = (_context_privates_MICROSOFT_OAUTH_CLIENT_SECRET = context.privates.MICROSOFT_OAUTH_CLIENT_SECRET) != null ? _context_privates_MICROSOFT_OAUTH_CLIENT_SECRET : params == null ? void 0 : params.MICROSOFT_OAUTH_CLIENT_SECRET) != null ? _ref1 : process.env['MICROSOFT_OAUTH_CLIENT_SECRET'];
|
|
25006
25020
|
var _context_privates_MICROSOFT_TENANT_ID, _ref2;
|
|
25007
25021
|
this.TENANT_ID = (_ref2 = (_context_privates_MICROSOFT_TENANT_ID = context.privates.MICROSOFT_TENANT_ID) != null ? _context_privates_MICROSOFT_TENANT_ID : params == null ? void 0 : params.MICROSOFT_TENANT_ID) != null ? _ref2 : process.env['MICROSOFT_TENANT_ID'];
|
|
25022
|
+
var _params_type;
|
|
25023
|
+
this.type = (_params_type = params.type) != null ? _params_type : 'json';
|
|
25024
|
+
var _params_contentType;
|
|
25025
|
+
this.contentType = (_params_contentType = params.contentType) != null ? _params_contentType : 'application/json';
|
|
25008
25026
|
}
|
|
25009
25027
|
};
|
|
25010
25028
|
const create = (params, pinsSettingsList, context)=>new MicrosoftService(context, params).create(params, pinsSettingsList, context);
|
package/index.esm.js
CHANGED
|
@@ -24941,6 +24941,7 @@ let MicrosoftService = class MicrosoftService {
|
|
|
24941
24941
|
}
|
|
24942
24942
|
}
|
|
24943
24943
|
async call(url, method, version, data, headers, signal) {
|
|
24944
|
+
let result;
|
|
24944
24945
|
const accessToken = await this.getAccessToken();
|
|
24945
24946
|
const response = await fetch(`${API_ENDPOINT}/${version}/${url}`, {
|
|
24946
24947
|
signal,
|
|
@@ -24948,12 +24949,25 @@ let MicrosoftService = class MicrosoftService {
|
|
|
24948
24949
|
headers: _extends({
|
|
24949
24950
|
Authorization: `Bearer ${accessToken}`,
|
|
24950
24951
|
Accept: 'application/json',
|
|
24951
|
-
'Content-Type':
|
|
24952
|
+
'Content-Type': this.contentType
|
|
24952
24953
|
}, headers),
|
|
24953
|
-
body: method.toUpperCase() === 'GET' || method.toUpperCase() === 'HEAD' ? undefined : JSON.stringify(data)
|
|
24954
|
+
body: method.toUpperCase() === 'GET' || method.toUpperCase() === 'HEAD' ? undefined : this.contentType === 'application/json' ? JSON.stringify(data) : typeof data === 'string' && data.startsWith('data:') ? Buffer.from(data.replace(/^data:.*;base64,/, ''), 'base64') : data
|
|
24954
24955
|
});
|
|
24955
24956
|
if (!response.ok) throw new Error('[SKILL-MICROSOFT] REQUEST FAILED: ' + response.status);
|
|
24956
|
-
|
|
24957
|
+
if (!response.headers.has('content-length') || response.headers.get('content-length') > 0) {
|
|
24958
|
+
if (this.type === 'json') {
|
|
24959
|
+
result = await response.json();
|
|
24960
|
+
} else if (this.type === 'text') {
|
|
24961
|
+
result = await response.text();
|
|
24962
|
+
} else {
|
|
24963
|
+
const arrayBuffer = await response.arrayBuffer();
|
|
24964
|
+
const buffer = Buffer.from(arrayBuffer);
|
|
24965
|
+
result = buffer.toString('base64');
|
|
24966
|
+
}
|
|
24967
|
+
} else {
|
|
24968
|
+
result = {};
|
|
24969
|
+
}
|
|
24970
|
+
return result;
|
|
24957
24971
|
}
|
|
24958
24972
|
async create(params, _pinsSettingsList, context) {
|
|
24959
24973
|
var _context_protected;
|
|
@@ -24992,6 +25006,10 @@ let MicrosoftService = class MicrosoftService {
|
|
|
24992
25006
|
this.OAUTH_CLIENT_SECRET = (_ref1 = (_context_privates_MICROSOFT_OAUTH_CLIENT_SECRET = context.privates.MICROSOFT_OAUTH_CLIENT_SECRET) != null ? _context_privates_MICROSOFT_OAUTH_CLIENT_SECRET : params == null ? void 0 : params.MICROSOFT_OAUTH_CLIENT_SECRET) != null ? _ref1 : process.env['MICROSOFT_OAUTH_CLIENT_SECRET'];
|
|
24993
25007
|
var _context_privates_MICROSOFT_TENANT_ID, _ref2;
|
|
24994
25008
|
this.TENANT_ID = (_ref2 = (_context_privates_MICROSOFT_TENANT_ID = context.privates.MICROSOFT_TENANT_ID) != null ? _context_privates_MICROSOFT_TENANT_ID : params == null ? void 0 : params.MICROSOFT_TENANT_ID) != null ? _ref2 : process.env['MICROSOFT_TENANT_ID'];
|
|
25009
|
+
var _params_type;
|
|
25010
|
+
this.type = (_params_type = params.type) != null ? _params_type : 'json';
|
|
25011
|
+
var _params_contentType;
|
|
25012
|
+
this.contentType = (_params_contentType = params.contentType) != null ? _params_contentType : 'application/json';
|
|
24995
25013
|
}
|
|
24996
25014
|
};
|
|
24997
25015
|
const create = (params, pinsSettingsList, context)=>new MicrosoftService(context, params).create(params, pinsSettingsList, context);
|
package/package.json
CHANGED
package/schema.fr.json
CHANGED
|
@@ -84,6 +84,24 @@
|
|
|
84
84
|
"schema": {
|
|
85
85
|
"type": "string"
|
|
86
86
|
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "type",
|
|
90
|
+
"summary": "Type de sortie",
|
|
91
|
+
"required": false,
|
|
92
|
+
"description": "Type de sortie attendu",
|
|
93
|
+
"schema": {
|
|
94
|
+
"type": "string"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "contentType",
|
|
99
|
+
"summary": "Type de contenu",
|
|
100
|
+
"required": false,
|
|
101
|
+
"description": "Type de contenu à envoyer",
|
|
102
|
+
"schema": {
|
|
103
|
+
"type": "string"
|
|
104
|
+
}
|
|
87
105
|
}
|
|
88
106
|
],
|
|
89
107
|
"x-events": []
|
|
@@ -156,6 +174,24 @@
|
|
|
156
174
|
"schema": {
|
|
157
175
|
"type": "string"
|
|
158
176
|
}
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "type",
|
|
180
|
+
"summary": "Type de sortie",
|
|
181
|
+
"required": false,
|
|
182
|
+
"description": "Type de sortie attendu",
|
|
183
|
+
"schema": {
|
|
184
|
+
"type": "string"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"name": "contentType",
|
|
189
|
+
"summary": "Type de contenu",
|
|
190
|
+
"required": false,
|
|
191
|
+
"description": "Type de contenu à envoyer",
|
|
192
|
+
"schema": {
|
|
193
|
+
"type": "string"
|
|
194
|
+
}
|
|
159
195
|
}
|
|
160
196
|
],
|
|
161
197
|
"x-events": []
|
|
@@ -219,6 +255,24 @@
|
|
|
219
255
|
"schema": {
|
|
220
256
|
"type": "string"
|
|
221
257
|
}
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "type",
|
|
261
|
+
"summary": "Type de sortie",
|
|
262
|
+
"required": false,
|
|
263
|
+
"description": "Type de sortie attendu",
|
|
264
|
+
"schema": {
|
|
265
|
+
"type": "string"
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"name": "contentType",
|
|
270
|
+
"summary": "Type de contenu",
|
|
271
|
+
"required": false,
|
|
272
|
+
"description": "Type de contenu à envoyer",
|
|
273
|
+
"schema": {
|
|
274
|
+
"type": "string"
|
|
275
|
+
}
|
|
222
276
|
}
|
|
223
277
|
],
|
|
224
278
|
"x-events": []
|
|
@@ -291,6 +345,24 @@
|
|
|
291
345
|
"schema": {
|
|
292
346
|
"type": "string"
|
|
293
347
|
}
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"name": "type",
|
|
351
|
+
"summary": "Type de sortie",
|
|
352
|
+
"required": false,
|
|
353
|
+
"description": "Type de sortie attendu",
|
|
354
|
+
"schema": {
|
|
355
|
+
"type": "string"
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"name": "contentType",
|
|
360
|
+
"summary": "Type de contenu",
|
|
361
|
+
"required": false,
|
|
362
|
+
"description": "Type de contenu à envoyer",
|
|
363
|
+
"schema": {
|
|
364
|
+
"type": "string"
|
|
365
|
+
}
|
|
294
366
|
}
|
|
295
367
|
],
|
|
296
368
|
"x-events": []
|
|
@@ -363,6 +435,24 @@
|
|
|
363
435
|
"schema": {
|
|
364
436
|
"type": "string"
|
|
365
437
|
}
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"name": "type",
|
|
441
|
+
"summary": "Type de sortie",
|
|
442
|
+
"required": false,
|
|
443
|
+
"description": "Type de sortie attendu",
|
|
444
|
+
"schema": {
|
|
445
|
+
"type": "string"
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"name": "contentType",
|
|
450
|
+
"summary": "Type de contenu",
|
|
451
|
+
"required": false,
|
|
452
|
+
"description": "Type de contenu à envoyer",
|
|
453
|
+
"schema": {
|
|
454
|
+
"type": "string"
|
|
455
|
+
}
|
|
366
456
|
}
|
|
367
457
|
],
|
|
368
458
|
"x-events": []
|
|
@@ -426,6 +516,24 @@
|
|
|
426
516
|
"schema": {
|
|
427
517
|
"type": "string"
|
|
428
518
|
}
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"name": "type",
|
|
522
|
+
"summary": "Type de sortie",
|
|
523
|
+
"required": false,
|
|
524
|
+
"description": "Type de sortie attendu",
|
|
525
|
+
"schema": {
|
|
526
|
+
"type": "string"
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"name": "contentType",
|
|
531
|
+
"summary": "Type de contenu",
|
|
532
|
+
"required": false,
|
|
533
|
+
"description": "Type de contenu à envoyer",
|
|
534
|
+
"schema": {
|
|
535
|
+
"type": "string"
|
|
536
|
+
}
|
|
429
537
|
}
|
|
430
538
|
],
|
|
431
539
|
"x-events": []
|
package/schema.json
CHANGED
|
@@ -84,6 +84,24 @@
|
|
|
84
84
|
"schema": {
|
|
85
85
|
"type": "string"
|
|
86
86
|
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "type",
|
|
90
|
+
"summary": "Output type",
|
|
91
|
+
"required": false,
|
|
92
|
+
"description": "Type of output expected from the service",
|
|
93
|
+
"schema": {
|
|
94
|
+
"type": "string"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "contentType",
|
|
99
|
+
"summary": "Content type",
|
|
100
|
+
"required": false,
|
|
101
|
+
"description": "Content type of the request",
|
|
102
|
+
"schema": {
|
|
103
|
+
"type": "string"
|
|
104
|
+
}
|
|
87
105
|
}
|
|
88
106
|
],
|
|
89
107
|
"x-events": []
|
|
@@ -156,6 +174,24 @@
|
|
|
156
174
|
"schema": {
|
|
157
175
|
"type": "string"
|
|
158
176
|
}
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "type",
|
|
180
|
+
"summary": "Output type",
|
|
181
|
+
"required": false,
|
|
182
|
+
"description": "Type of output expected from the service",
|
|
183
|
+
"schema": {
|
|
184
|
+
"type": "string"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"name": "contentType",
|
|
189
|
+
"summary": "Content type",
|
|
190
|
+
"required": false,
|
|
191
|
+
"description": "Content type of the request",
|
|
192
|
+
"schema": {
|
|
193
|
+
"type": "string"
|
|
194
|
+
}
|
|
159
195
|
}
|
|
160
196
|
],
|
|
161
197
|
"x-events": []
|
|
@@ -219,6 +255,24 @@
|
|
|
219
255
|
"schema": {
|
|
220
256
|
"type": "string"
|
|
221
257
|
}
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "type",
|
|
261
|
+
"summary": "Output type",
|
|
262
|
+
"required": false,
|
|
263
|
+
"description": "Type of output expected from the service",
|
|
264
|
+
"schema": {
|
|
265
|
+
"type": "string"
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"name": "contentType",
|
|
270
|
+
"summary": "Content type",
|
|
271
|
+
"required": false,
|
|
272
|
+
"description": "Content type of the request",
|
|
273
|
+
"schema": {
|
|
274
|
+
"type": "string"
|
|
275
|
+
}
|
|
222
276
|
}
|
|
223
277
|
],
|
|
224
278
|
"x-events": []
|
|
@@ -291,6 +345,24 @@
|
|
|
291
345
|
"schema": {
|
|
292
346
|
"type": "string"
|
|
293
347
|
}
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"name": "type",
|
|
351
|
+
"summary": "Output type",
|
|
352
|
+
"required": false,
|
|
353
|
+
"description": "Type of output expected from the service",
|
|
354
|
+
"schema": {
|
|
355
|
+
"type": "string"
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"name": "contentType",
|
|
360
|
+
"summary": "Content type",
|
|
361
|
+
"required": false,
|
|
362
|
+
"description": "Content type of the request",
|
|
363
|
+
"schema": {
|
|
364
|
+
"type": "string"
|
|
365
|
+
}
|
|
294
366
|
}
|
|
295
367
|
],
|
|
296
368
|
"x-events": []
|
|
@@ -363,6 +435,24 @@
|
|
|
363
435
|
"schema": {
|
|
364
436
|
"type": "string"
|
|
365
437
|
}
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"name": "type",
|
|
441
|
+
"summary": "Output type",
|
|
442
|
+
"required": false,
|
|
443
|
+
"description": "Type of output expected from the service",
|
|
444
|
+
"schema": {
|
|
445
|
+
"type": "string"
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"name": "contentType",
|
|
450
|
+
"summary": "Content type",
|
|
451
|
+
"required": false,
|
|
452
|
+
"description": "Content type of the request",
|
|
453
|
+
"schema": {
|
|
454
|
+
"type": "string"
|
|
455
|
+
}
|
|
366
456
|
}
|
|
367
457
|
],
|
|
368
458
|
"x-events": []
|
|
@@ -426,6 +516,24 @@
|
|
|
426
516
|
"schema": {
|
|
427
517
|
"type": "string"
|
|
428
518
|
}
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"name": "type",
|
|
522
|
+
"summary": "Output type",
|
|
523
|
+
"required": false,
|
|
524
|
+
"description": "Type of output expected from the service",
|
|
525
|
+
"schema": {
|
|
526
|
+
"type": "string"
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"name": "contentType",
|
|
531
|
+
"summary": "Content type",
|
|
532
|
+
"required": false,
|
|
533
|
+
"description": "Content type of the request",
|
|
534
|
+
"schema": {
|
|
535
|
+
"type": "string"
|
|
536
|
+
}
|
|
429
537
|
}
|
|
430
538
|
],
|
|
431
539
|
"x-events": []
|