@azure/web-pubsub 1.0.1-alpha.20220103.2 → 1.0.1-alpha.20220303.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +55 -36
- package/dist/index.js.map +1 -1
- package/dist-esm/test/hubs.spec.js +6 -13
- package/dist-esm/test/hubs.spec.js.map +1 -1
- package/dist-esm/test/integration.spec.js +26 -1
- package/dist-esm/test/integration.spec.js.map +1 -1
- package/dist-esm/test/testEnv.js +2 -2
- package/dist-esm/test/testEnv.js.map +1 -1
- package/package.json +9 -6
package/dist/index.js
CHANGED
@@ -2,16 +2,37 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
6
|
-
|
7
5
|
var coreAuth = require('@azure/core-auth');
|
8
6
|
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
9
7
|
var coreClient = require('@azure/core-client');
|
10
8
|
var coreTracing = require('@azure/core-tracing');
|
11
|
-
var jwt =
|
9
|
+
var jwt = require('jsonwebtoken');
|
12
10
|
var logger$1 = require('@azure/logger');
|
13
11
|
var url = require('url');
|
14
12
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
14
|
+
|
15
|
+
function _interopNamespace(e) {
|
16
|
+
if (e && e.__esModule) return e;
|
17
|
+
var n = Object.create(null);
|
18
|
+
if (e) {
|
19
|
+
Object.keys(e).forEach(function (k) {
|
20
|
+
if (k !== 'default') {
|
21
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
22
|
+
Object.defineProperty(n, k, d.get ? d : {
|
23
|
+
enumerable: true,
|
24
|
+
get: function () { return e[k]; }
|
25
|
+
});
|
26
|
+
}
|
27
|
+
});
|
28
|
+
}
|
29
|
+
n["default"] = e;
|
30
|
+
return Object.freeze(n);
|
31
|
+
}
|
32
|
+
|
33
|
+
var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
|
34
|
+
var jwt__default = /*#__PURE__*/_interopDefaultLegacy(jwt);
|
35
|
+
|
15
36
|
/*
|
16
37
|
* Copyright (c) Microsoft Corporation.
|
17
38
|
* Licensed under the MIT License.
|
@@ -682,14 +703,14 @@ class HealthApiImpl {
|
|
682
703
|
}
|
683
704
|
}
|
684
705
|
// Operation Specifications
|
685
|
-
const serializer =
|
706
|
+
const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
|
686
707
|
const getServiceStatusOperationSpec = {
|
687
708
|
path: "/api/health",
|
688
709
|
httpMethod: "HEAD",
|
689
710
|
responses: { 200: {}, default: {} },
|
690
711
|
queryParameters: [apiVersion],
|
691
712
|
urlParameters: [endpoint],
|
692
|
-
serializer
|
713
|
+
serializer: serializer$1
|
693
714
|
};
|
694
715
|
|
695
716
|
/*
|
@@ -1021,7 +1042,7 @@ class WebPubSubImpl {
|
|
1021
1042
|
}
|
1022
1043
|
}
|
1023
1044
|
// Operation Specifications
|
1024
|
-
const serializer
|
1045
|
+
const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
|
1025
1046
|
const generateClientTokenOperationSpec = {
|
1026
1047
|
path: "/api/hubs/{hub}/:generateToken",
|
1027
1048
|
httpMethod: "POST",
|
@@ -1042,7 +1063,7 @@ const generateClientTokenOperationSpec = {
|
|
1042
1063
|
],
|
1043
1064
|
urlParameters: [endpoint, hub],
|
1044
1065
|
headerParameters: [accept],
|
1045
|
-
serializer
|
1066
|
+
serializer
|
1046
1067
|
};
|
1047
1068
|
const closeAllConnectionsOperationSpec = {
|
1048
1069
|
path: "/api/hubs/{hub}/:closeConnections",
|
@@ -1061,7 +1082,7 @@ const closeAllConnectionsOperationSpec = {
|
|
1061
1082
|
],
|
1062
1083
|
urlParameters: [endpoint, hub],
|
1063
1084
|
headerParameters: [accept],
|
1064
|
-
serializer
|
1085
|
+
serializer
|
1065
1086
|
};
|
1066
1087
|
const sendToAll$binaryOperationSpec = {
|
1067
1088
|
path: "/api/hubs/{hub}/:send",
|
@@ -1078,7 +1099,7 @@ const sendToAll$binaryOperationSpec = {
|
|
1078
1099
|
urlParameters: [endpoint, hub],
|
1079
1100
|
headerParameters: [contentType, accept1],
|
1080
1101
|
mediaType: "binary",
|
1081
|
-
serializer
|
1102
|
+
serializer
|
1082
1103
|
};
|
1083
1104
|
const sendToAll$textOperationSpec = {
|
1084
1105
|
path: "/api/hubs/{hub}/:send",
|
@@ -1095,7 +1116,7 @@ const sendToAll$textOperationSpec = {
|
|
1095
1116
|
urlParameters: [endpoint, hub],
|
1096
1117
|
headerParameters: [contentType1, accept2],
|
1097
1118
|
mediaType: "text",
|
1098
|
-
serializer
|
1119
|
+
serializer
|
1099
1120
|
};
|
1100
1121
|
const connectionExistsOperationSpec = {
|
1101
1122
|
path: "/api/hubs/{hub}/connections/{connectionId}",
|
@@ -1111,7 +1132,7 @@ const connectionExistsOperationSpec = {
|
|
1111
1132
|
queryParameters: [apiVersion],
|
1112
1133
|
urlParameters: [endpoint, hub, connectionId],
|
1113
1134
|
headerParameters: [accept],
|
1114
|
-
serializer
|
1135
|
+
serializer
|
1115
1136
|
};
|
1116
1137
|
const closeConnectionOperationSpec = {
|
1117
1138
|
path: "/api/hubs/{hub}/connections/{connectionId}",
|
@@ -1126,7 +1147,7 @@ const closeConnectionOperationSpec = {
|
|
1126
1147
|
queryParameters: [apiVersion, reason],
|
1127
1148
|
urlParameters: [endpoint, hub, connectionId],
|
1128
1149
|
headerParameters: [accept],
|
1129
|
-
serializer
|
1150
|
+
serializer
|
1130
1151
|
};
|
1131
1152
|
const sendToConnection$binaryOperationSpec = {
|
1132
1153
|
path: "/api/hubs/{hub}/connections/{connectionId}/:send",
|
@@ -1143,7 +1164,7 @@ const sendToConnection$binaryOperationSpec = {
|
|
1143
1164
|
urlParameters: [endpoint, hub, connectionId],
|
1144
1165
|
headerParameters: [contentType, accept1],
|
1145
1166
|
mediaType: "binary",
|
1146
|
-
serializer
|
1167
|
+
serializer
|
1147
1168
|
};
|
1148
1169
|
const sendToConnection$textOperationSpec = {
|
1149
1170
|
path: "/api/hubs/{hub}/connections/{connectionId}/:send",
|
@@ -1160,7 +1181,7 @@ const sendToConnection$textOperationSpec = {
|
|
1160
1181
|
urlParameters: [endpoint, hub, connectionId],
|
1161
1182
|
headerParameters: [contentType1, accept2],
|
1162
1183
|
mediaType: "text",
|
1163
|
-
serializer
|
1184
|
+
serializer
|
1164
1185
|
};
|
1165
1186
|
const groupExistsOperationSpec = {
|
1166
1187
|
path: "/api/hubs/{hub}/groups/{group}",
|
@@ -1176,7 +1197,7 @@ const groupExistsOperationSpec = {
|
|
1176
1197
|
queryParameters: [apiVersion],
|
1177
1198
|
urlParameters: [endpoint, hub, group],
|
1178
1199
|
headerParameters: [accept],
|
1179
|
-
serializer
|
1200
|
+
serializer
|
1180
1201
|
};
|
1181
1202
|
const closeGroupConnectionsOperationSpec = {
|
1182
1203
|
path: "/api/hubs/{hub}/groups/{group}/:closeConnections",
|
@@ -1195,7 +1216,7 @@ const closeGroupConnectionsOperationSpec = {
|
|
1195
1216
|
],
|
1196
1217
|
urlParameters: [endpoint, hub, group],
|
1197
1218
|
headerParameters: [accept],
|
1198
|
-
serializer
|
1219
|
+
serializer
|
1199
1220
|
};
|
1200
1221
|
const sendToGroup$binaryOperationSpec = {
|
1201
1222
|
path: "/api/hubs/{hub}/groups/{group}/:send",
|
@@ -1212,7 +1233,7 @@ const sendToGroup$binaryOperationSpec = {
|
|
1212
1233
|
urlParameters: [endpoint, hub, group],
|
1213
1234
|
headerParameters: [contentType, accept1],
|
1214
1235
|
mediaType: "binary",
|
1215
|
-
serializer
|
1236
|
+
serializer
|
1216
1237
|
};
|
1217
1238
|
const sendToGroup$textOperationSpec = {
|
1218
1239
|
path: "/api/hubs/{hub}/groups/{group}/:send",
|
@@ -1229,7 +1250,7 @@ const sendToGroup$textOperationSpec = {
|
|
1229
1250
|
urlParameters: [endpoint, hub, group],
|
1230
1251
|
headerParameters: [contentType1, accept2],
|
1231
1252
|
mediaType: "text",
|
1232
|
-
serializer
|
1253
|
+
serializer
|
1233
1254
|
};
|
1234
1255
|
const addConnectionToGroupOperationSpec = {
|
1235
1256
|
path: "/api/hubs/{hub}/groups/{group}/connections/{connectionId}",
|
@@ -1250,7 +1271,7 @@ const addConnectionToGroupOperationSpec = {
|
|
1250
1271
|
group
|
1251
1272
|
],
|
1252
1273
|
headerParameters: [accept],
|
1253
|
-
serializer
|
1274
|
+
serializer
|
1254
1275
|
};
|
1255
1276
|
const removeConnectionFromGroupOperationSpec = {
|
1256
1277
|
path: "/api/hubs/{hub}/groups/{group}/connections/{connectionId}",
|
@@ -1270,7 +1291,7 @@ const removeConnectionFromGroupOperationSpec = {
|
|
1270
1291
|
group
|
1271
1292
|
],
|
1272
1293
|
headerParameters: [accept],
|
1273
|
-
serializer
|
1294
|
+
serializer
|
1274
1295
|
};
|
1275
1296
|
const userExistsOperationSpec = {
|
1276
1297
|
path: "/api/hubs/{hub}/users/{userId}",
|
@@ -1286,7 +1307,7 @@ const userExistsOperationSpec = {
|
|
1286
1307
|
queryParameters: [apiVersion],
|
1287
1308
|
urlParameters: [endpoint, hub, userId1],
|
1288
1309
|
headerParameters: [accept],
|
1289
|
-
serializer
|
1310
|
+
serializer
|
1290
1311
|
};
|
1291
1312
|
const closeUserConnectionsOperationSpec = {
|
1292
1313
|
path: "/api/hubs/{hub}/users/{userId}/:closeConnections",
|
@@ -1305,7 +1326,7 @@ const closeUserConnectionsOperationSpec = {
|
|
1305
1326
|
],
|
1306
1327
|
urlParameters: [endpoint, hub, userId1],
|
1307
1328
|
headerParameters: [accept],
|
1308
|
-
serializer
|
1329
|
+
serializer
|
1309
1330
|
};
|
1310
1331
|
const sendToUser$binaryOperationSpec = {
|
1311
1332
|
path: "/api/hubs/{hub}/users/{userId}/:send",
|
@@ -1322,7 +1343,7 @@ const sendToUser$binaryOperationSpec = {
|
|
1322
1343
|
urlParameters: [endpoint, hub, userId1],
|
1323
1344
|
headerParameters: [contentType, accept1],
|
1324
1345
|
mediaType: "binary",
|
1325
|
-
serializer
|
1346
|
+
serializer
|
1326
1347
|
};
|
1327
1348
|
const sendToUser$textOperationSpec = {
|
1328
1349
|
path: "/api/hubs/{hub}/users/{userId}/:send",
|
@@ -1339,7 +1360,7 @@ const sendToUser$textOperationSpec = {
|
|
1339
1360
|
urlParameters: [endpoint, hub, userId1],
|
1340
1361
|
headerParameters: [contentType1, accept2],
|
1341
1362
|
mediaType: "text",
|
1342
|
-
serializer
|
1363
|
+
serializer
|
1343
1364
|
};
|
1344
1365
|
const addUserToGroupOperationSpec = {
|
1345
1366
|
path: "/api/hubs/{hub}/users/{userId}/groups/{group}",
|
@@ -1360,7 +1381,7 @@ const addUserToGroupOperationSpec = {
|
|
1360
1381
|
userId1
|
1361
1382
|
],
|
1362
1383
|
headerParameters: [accept],
|
1363
|
-
serializer
|
1384
|
+
serializer
|
1364
1385
|
};
|
1365
1386
|
const removeUserFromGroupOperationSpec = {
|
1366
1387
|
path: "/api/hubs/{hub}/users/{userId}/groups/{group}",
|
@@ -1380,7 +1401,7 @@ const removeUserFromGroupOperationSpec = {
|
|
1380
1401
|
userId1
|
1381
1402
|
],
|
1382
1403
|
headerParameters: [accept],
|
1383
|
-
serializer
|
1404
|
+
serializer
|
1384
1405
|
};
|
1385
1406
|
const removeUserFromAllGroupsOperationSpec = {
|
1386
1407
|
path: "/api/hubs/{hub}/users/{userId}/groups",
|
@@ -1395,7 +1416,7 @@ const removeUserFromAllGroupsOperationSpec = {
|
|
1395
1416
|
queryParameters: [apiVersion],
|
1396
1417
|
urlParameters: [endpoint, hub, userId1],
|
1397
1418
|
headerParameters: [accept],
|
1398
|
-
serializer
|
1419
|
+
serializer
|
1399
1420
|
};
|
1400
1421
|
const grantPermissionOperationSpec = {
|
1401
1422
|
path: "/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}",
|
@@ -1415,7 +1436,7 @@ const grantPermissionOperationSpec = {
|
|
1415
1436
|
permission
|
1416
1437
|
],
|
1417
1438
|
headerParameters: [accept],
|
1418
|
-
serializer
|
1439
|
+
serializer
|
1419
1440
|
};
|
1420
1441
|
const revokePermissionOperationSpec = {
|
1421
1442
|
path: "/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}",
|
@@ -1435,7 +1456,7 @@ const revokePermissionOperationSpec = {
|
|
1435
1456
|
permission
|
1436
1457
|
],
|
1437
1458
|
headerParameters: [accept],
|
1438
|
-
serializer
|
1459
|
+
serializer
|
1439
1460
|
};
|
1440
1461
|
const checkPermissionOperationSpec = {
|
1441
1462
|
path: "/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}",
|
@@ -1456,7 +1477,7 @@ const checkPermissionOperationSpec = {
|
|
1456
1477
|
permission
|
1457
1478
|
],
|
1458
1479
|
headerParameters: [accept],
|
1459
|
-
serializer
|
1480
|
+
serializer
|
1460
1481
|
};
|
1461
1482
|
|
1462
1483
|
/*
|
@@ -1467,7 +1488,7 @@ const checkPermissionOperationSpec = {
|
|
1467
1488
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
1468
1489
|
*/
|
1469
1490
|
/** @internal */
|
1470
|
-
class GeneratedClientContext extends
|
1491
|
+
class GeneratedClientContext extends coreClient__namespace.ServiceClient {
|
1471
1492
|
/**
|
1472
1493
|
* Initializes a new instance of the GeneratedClientContext class.
|
1473
1494
|
* @param endpoint HTTP or HTTPS endpoint for the Web PubSub service instance.
|
@@ -1683,7 +1704,7 @@ function webPubSubKeyCredentialPolicy(credential) {
|
|
1683
1704
|
return {
|
1684
1705
|
name: webPubSubKeyCredentialPolicyName,
|
1685
1706
|
sendRequest(request, next) {
|
1686
|
-
const bearerToken =
|
1707
|
+
const bearerToken = jwt__default["default"].sign({}, credential.key, {
|
1687
1708
|
audience: request.url,
|
1688
1709
|
expiresIn: "1h",
|
1689
1710
|
algorithm: "HS256",
|
@@ -2095,7 +2116,7 @@ class WebPubSubServiceClient {
|
|
2095
2116
|
if (options === null || options === void 0 ? void 0 : options.userId) {
|
2096
2117
|
signOptions.subject = options === null || options === void 0 ? void 0 : options.userId;
|
2097
2118
|
}
|
2098
|
-
token =
|
2119
|
+
token = jwt__default["default"].sign(payload, key, signOptions);
|
2099
2120
|
}
|
2100
2121
|
return {
|
2101
2122
|
token,
|
@@ -2111,9 +2132,7 @@ class WebPubSubServiceClient {
|
|
2111
2132
|
|
2112
2133
|
Object.defineProperty(exports, 'AzureKeyCredential', {
|
2113
2134
|
enumerable: true,
|
2114
|
-
get: function () {
|
2115
|
-
return coreAuth.AzureKeyCredential;
|
2116
|
-
}
|
2135
|
+
get: function () { return coreAuth.AzureKeyCredential; }
|
2117
2136
|
});
|
2118
2137
|
exports.WebPubSubServiceClient = WebPubSubServiceClient;
|
2119
2138
|
//# sourceMappingURL=index.js.map
|