@azure/web-pubsub 1.0.0-beta.2 → 1.0.1-alpha.20211215.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +40 -0
- package/README.md +118 -31
- package/dist/index.js +1315 -567
- package/dist/index.js.map +1 -1
- package/dist-esm/samples-dev/broadcasting.js +16 -16
- package/dist-esm/samples-dev/broadcasting.js.map +1 -1
- package/dist-esm/samples-dev/directMessage.js +9 -9
- package/dist-esm/samples-dev/directMessage.js.map +1 -1
- package/dist-esm/samples-dev/managingGroups.js +11 -12
- package/dist-esm/samples-dev/managingGroups.js.map +1 -1
- package/dist-esm/src/generated/generatedClient.js +23 -0
- package/dist-esm/src/generated/generatedClient.js.map +1 -0
- package/dist-esm/src/generated/generatedClientContext.js +41 -0
- package/dist-esm/src/generated/generatedClientContext.js.map +1 -0
- package/dist-esm/src/generated/index.js +10 -2
- package/dist-esm/src/generated/index.js.map +1 -1
- package/dist-esm/src/generated/models/index.js +13 -1
- package/dist-esm/src/generated/models/index.js.map +1 -1
- package/dist-esm/src/generated/models/mappers.js +368 -0
- package/dist-esm/src/generated/models/mappers.js.map +1 -0
- package/dist-esm/src/generated/models/parameters.js +124 -43
- package/dist-esm/src/generated/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/operations/healthApi.js +16 -11
- package/dist-esm/src/generated/operations/healthApi.js.map +1 -1
- package/dist-esm/src/generated/operations/index.js +7 -0
- package/dist-esm/src/generated/operations/index.js.map +1 -1
- package/dist-esm/src/generated/operations/webPubSub.js +341 -175
- package/dist-esm/src/generated/operations/webPubSub.js.map +1 -1
- package/dist-esm/src/generated/operationsInterfaces/healthApi.js +9 -0
- package/dist-esm/src/generated/operationsInterfaces/healthApi.js.map +1 -0
- package/dist-esm/src/generated/operationsInterfaces/index.js +10 -0
- package/dist-esm/src/generated/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/generated/operationsInterfaces/webPubSub.js +9 -0
- package/dist-esm/src/generated/operationsInterfaces/webPubSub.js.map +1 -0
- package/dist-esm/src/groupClient.js +74 -92
- package/dist-esm/src/groupClient.js.map +1 -1
- package/dist-esm/src/hubClient.js +280 -196
- package/dist-esm/src/hubClient.js.map +1 -1
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/logger.js +1 -1
- package/dist-esm/src/logger.js.map +1 -1
- package/dist-esm/src/parseConnectionString.js +3 -1
- package/dist-esm/src/parseConnectionString.js.map +1 -1
- package/dist-esm/src/reverseProxyPolicy.js +21 -0
- package/dist-esm/src/reverseProxyPolicy.js.map +1 -0
- package/dist-esm/src/utils.js +8 -6
- package/dist-esm/src/utils.js.map +1 -1
- package/dist-esm/src/webPubSubCredentialPolicy.js +18 -18
- package/dist-esm/src/webPubSubCredentialPolicy.js.map +1 -1
- package/dist-esm/test/conn.spec.js +7 -8
- package/dist-esm/test/conn.spec.js.map +1 -1
- package/dist-esm/test/groups.spec.js +39 -38
- package/dist-esm/test/groups.spec.js.map +1 -1
- package/dist-esm/test/hubs.spec.js +95 -49
- package/dist-esm/test/hubs.spec.js.map +1 -1
- package/dist-esm/test/integration.spec.js +128 -0
- package/dist-esm/test/integration.spec.js.map +1 -0
- package/dist-esm/test/testEnv.js +5 -1
- package/dist-esm/test/testEnv.js.map +1 -1
- package/package.json +37 -36
- package/types/web-pubsub.d.ts +186 -138
- package/dist-esm/src/generated/azureWebPubSubServiceRestAPI.js +0 -15
- package/dist-esm/src/generated/azureWebPubSubServiceRestAPI.js.map +0 -1
- package/dist-esm/src/generated/azureWebPubSubServiceRestAPIContext.js +0 -34
- package/dist-esm/src/generated/azureWebPubSubServiceRestAPIContext.js.map +0 -1
- package/dist-esm/src/normalizeOptions.js +0 -8
- package/dist-esm/src/normalizeOptions.js.map +0 -1
@@ -1,6 +1,5 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT License.
|
3
|
-
import { __awaiter } from "tslib";
|
4
3
|
/**
|
5
4
|
* @summary Demonstrates broadcasting messages to a hub and a group
|
6
5
|
*/
|
@@ -8,20 +7,21 @@ import { WebPubSubServiceClient } from "@azure/web-pubsub";
|
|
8
7
|
import * as dotenv from "dotenv";
|
9
8
|
dotenv.config();
|
10
9
|
const chatHub = new WebPubSubServiceClient(process.env.WPS_CONNECTION_STRING, "chat");
|
11
|
-
function main() {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
chatHub.sendToAll(data.buffer);
|
24
|
-
});
|
10
|
+
async function main() {
|
11
|
+
// send a text message to the entire hub
|
12
|
+
await chatHub.sendToAll("Hi there!");
|
13
|
+
// send a text message to a particular group
|
14
|
+
const adminGroup = chatHub.group("admin");
|
15
|
+
await adminGroup.sendToAll("Hi admins!");
|
16
|
+
// send binary data to the entire hub
|
17
|
+
const data = new Uint8Array(10);
|
18
|
+
for (let i = 0; i < 10; i++) {
|
19
|
+
data[i] = i;
|
20
|
+
}
|
21
|
+
chatHub.sendToAll(data.buffer);
|
25
22
|
}
|
26
|
-
main()
|
23
|
+
main().catch((e) => {
|
24
|
+
console.error("Sample encountered an error", e);
|
25
|
+
process.exit(1);
|
26
|
+
});
|
27
27
|
//# sourceMappingURL=broadcasting.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"broadcasting.js","sourceRoot":"","sources":["../../samples-dev/broadcasting.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC
|
1
|
+
{"version":3,"file":"broadcasting.js","sourceRoot":"","sources":["../../samples-dev/broadcasting.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,OAAO,GAAG,IAAI,sBAAsB,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAsB,EAAE,MAAM,CAAC,CAAC;AAEvF,KAAK,UAAU,IAAI;IACjB,wCAAwC;IACxC,MAAM,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAErC,4CAA4C;IAC5C,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAEzC,qCAAqC;IACrC,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;QAC3B,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KACb;IACD,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,CAAC,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @summary Demonstrates broadcasting messages to a hub and a group\n */\n\nimport { WebPubSubServiceClient } from \"@azure/web-pubsub\";\n\nimport * as dotenv from \"dotenv\";\ndotenv.config();\n\nconst chatHub = new WebPubSubServiceClient(process.env.WPS_CONNECTION_STRING!, \"chat\");\n\nasync function main() {\n // send a text message to the entire hub\n await chatHub.sendToAll(\"Hi there!\");\n\n // send a text message to a particular group\n const adminGroup = chatHub.group(\"admin\");\n await adminGroup.sendToAll(\"Hi admins!\");\n\n // send binary data to the entire hub\n const data = new Uint8Array(10);\n for (let i = 0; i < 10; i++) {\n data[i] = i;\n }\n chatHub.sendToAll(data.buffer);\n}\n\nmain().catch((e) => {\n console.error(\"Sample encountered an error\", e);\n process.exit(1);\n});\n"]}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT License.
|
3
|
-
import { __awaiter } from "tslib";
|
4
3
|
/**
|
5
4
|
* @summary Demonstrates sending messages directly to a user or connection.
|
6
5
|
*/
|
@@ -8,13 +7,14 @@ import { WebPubSubServiceClient } from "@azure/web-pubsub";
|
|
8
7
|
import * as dotenv from "dotenv";
|
9
8
|
dotenv.config();
|
10
9
|
const chatHub = new WebPubSubServiceClient(process.env.WPS_CONNECTION_STRING, "chat");
|
11
|
-
function main() {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
yield chatHub.sendToUser("Tn3XcrAbHI0OE36XvbWwige4ac096c1", "Hi there!");
|
17
|
-
});
|
10
|
+
async function main() {
|
11
|
+
// send a text message directly to a user
|
12
|
+
await chatHub.sendToUser("bterlson", "Hi there!");
|
13
|
+
// send a text message to a specific connection
|
14
|
+
await chatHub.sendToConnection("Tn3XcrAbHI0OE36XvbWwige4ac096c1", "Hi there!");
|
18
15
|
}
|
19
|
-
main()
|
16
|
+
main().catch((e) => {
|
17
|
+
console.error("Sample encountered an error", e);
|
18
|
+
process.exit(1);
|
19
|
+
});
|
20
20
|
//# sourceMappingURL=directMessage.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"directMessage.js","sourceRoot":"","sources":["../../samples-dev/directMessage.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC
|
1
|
+
{"version":3,"file":"directMessage.js","sourceRoot":"","sources":["../../samples-dev/directMessage.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,OAAO,GAAG,IAAI,sBAAsB,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAsB,EAAE,MAAM,CAAC,CAAC;AAEvF,KAAK,UAAU,IAAI;IACjB,yCAAyC;IACzC,MAAM,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAElD,+CAA+C;IAC/C,MAAM,OAAO,CAAC,gBAAgB,CAAC,iCAAiC,EAAE,WAAW,CAAC,CAAC;AACjF,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,CAAC,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @summary Demonstrates sending messages directly to a user or connection.\n */\n\nimport { WebPubSubServiceClient } from \"@azure/web-pubsub\";\n\nimport * as dotenv from \"dotenv\";\ndotenv.config();\n\nconst chatHub = new WebPubSubServiceClient(process.env.WPS_CONNECTION_STRING!, \"chat\");\n\nasync function main() {\n // send a text message directly to a user\n await chatHub.sendToUser(\"bterlson\", \"Hi there!\");\n\n // send a text message to a specific connection\n await chatHub.sendToConnection(\"Tn3XcrAbHI0OE36XvbWwige4ac096c1\", \"Hi there!\");\n}\n\nmain().catch((e) => {\n console.error(\"Sample encountered an error\", e);\n process.exit(1);\n});\n"]}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT License.
|
3
|
-
import { __awaiter } from "tslib";
|
4
3
|
/**
|
5
4
|
* @summary Demonstrates adding and removing users from groups
|
6
5
|
*/
|
@@ -9,16 +8,16 @@ import * as dotenv from "dotenv";
|
|
9
8
|
dotenv.config();
|
10
9
|
const chatHub = new WebPubSubServiceClient(process.env.WPS_CONNECTION_STRING, "chat");
|
11
10
|
const adminGroup = chatHub.group("admin");
|
12
|
-
function main() {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
yield adminGroup.addConnection("Tn3XcrAbHI0OE36XvbWwige4ac096c1");
|
20
|
-
yield adminGroup.removeConnection("Tn3XcrAbHI0OE36XvbWwige4ac096c1");
|
21
|
-
});
|
11
|
+
async function main() {
|
12
|
+
// adding and removing users
|
13
|
+
await adminGroup.addUser("bterlson");
|
14
|
+
await adminGroup.removeUser("xirzec");
|
15
|
+
// adding and removing specific connections
|
16
|
+
await adminGroup.addConnection("Tn3XcrAbHI0OE36XvbWwige4ac096c1");
|
17
|
+
await adminGroup.removeConnection("Tn3XcrAbHI0OE36XvbWwige4ac096c1");
|
22
18
|
}
|
23
|
-
main()
|
19
|
+
main().catch((e) => {
|
20
|
+
console.error("Sample encountered an error", e);
|
21
|
+
process.exit(1);
|
22
|
+
});
|
24
23
|
//# sourceMappingURL=managingGroups.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"managingGroups.js","sourceRoot":"","sources":["../../samples-dev/managingGroups.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC
|
1
|
+
{"version":3,"file":"managingGroups.js","sourceRoot":"","sources":["../../samples-dev/managingGroups.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,OAAO,GAAG,IAAI,sBAAsB,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAsB,EAAE,MAAM,CAAC,CAAC;AACvF,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAE1C,KAAK,UAAU,IAAI;IACjB,4BAA4B;IAC5B,MAAM,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,MAAM,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAEtC,2CAA2C;IAC3C,MAAM,UAAU,CAAC,aAAa,CAAC,iCAAiC,CAAC,CAAC;IAClE,MAAM,UAAU,CAAC,gBAAgB,CAAC,iCAAiC,CAAC,CAAC;AACvE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,CAAC,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @summary Demonstrates adding and removing users from groups\n */\n\nimport { WebPubSubServiceClient } from \"@azure/web-pubsub\";\n\nimport * as dotenv from \"dotenv\";\ndotenv.config();\n\nconst chatHub = new WebPubSubServiceClient(process.env.WPS_CONNECTION_STRING!, \"chat\");\nconst adminGroup = chatHub.group(\"admin\");\n\nasync function main() {\n // adding and removing users\n await adminGroup.addUser(\"bterlson\");\n await adminGroup.removeUser(\"xirzec\");\n\n // adding and removing specific connections\n await adminGroup.addConnection(\"Tn3XcrAbHI0OE36XvbWwige4ac096c1\");\n await adminGroup.removeConnection(\"Tn3XcrAbHI0OE36XvbWwige4ac096c1\");\n}\n\nmain().catch((e) => {\n console.error(\"Sample encountered an error\", e);\n process.exit(1);\n});\n"]}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
8
|
+
import { HealthApiImpl, WebPubSubImpl } from "./operations";
|
9
|
+
import { GeneratedClientContext } from "./generatedClientContext";
|
10
|
+
/** @internal */
|
11
|
+
export class GeneratedClient extends GeneratedClientContext {
|
12
|
+
/**
|
13
|
+
* Initializes a new instance of the GeneratedClient class.
|
14
|
+
* @param endpoint HTTP or HTTPS endpoint for the Web PubSub service instance.
|
15
|
+
* @param options The parameter options
|
16
|
+
*/
|
17
|
+
constructor(endpoint, options) {
|
18
|
+
super(endpoint, options);
|
19
|
+
this.healthApi = new HealthApiImpl(this);
|
20
|
+
this.webPubSub = new WebPubSubImpl(this);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
//# sourceMappingURL=generatedClient.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"generatedClient.js","sourceRoot":"","sources":["../../../src/generated/generatedClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,gBAAgB;AAChB,MAAM,OAAO,eAAgB,SAAQ,sBAAsB;IACzD;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAAuC;QACnE,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,SAAS,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;CAIF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { HealthApiImpl, WebPubSubImpl } from \"./operations\";\nimport { HealthApi, WebPubSub } from \"./operationsInterfaces\";\nimport { GeneratedClientContext } from \"./generatedClientContext\";\nimport { GeneratedClientOptionalParams } from \"./models\";\n\n/** @internal */\nexport class GeneratedClient extends GeneratedClientContext {\n /**\n * Initializes a new instance of the GeneratedClient class.\n * @param endpoint HTTP or HTTPS endpoint for the Web PubSub service instance.\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: GeneratedClientOptionalParams) {\n super(endpoint, options);\n this.healthApi = new HealthApiImpl(this);\n this.webPubSub = new WebPubSubImpl(this);\n }\n\n healthApi: HealthApi;\n webPubSub: WebPubSub;\n}\n"]}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
8
|
+
import * as coreClient from "@azure/core-client";
|
9
|
+
/** @internal */
|
10
|
+
export class GeneratedClientContext extends coreClient.ServiceClient {
|
11
|
+
/**
|
12
|
+
* Initializes a new instance of the GeneratedClientContext class.
|
13
|
+
* @param endpoint HTTP or HTTPS endpoint for the Web PubSub service instance.
|
14
|
+
* @param options The parameter options
|
15
|
+
*/
|
16
|
+
constructor(endpoint, options) {
|
17
|
+
if (endpoint === undefined) {
|
18
|
+
throw new Error("'endpoint' cannot be null");
|
19
|
+
}
|
20
|
+
// Initializing default values for options
|
21
|
+
if (!options) {
|
22
|
+
options = {};
|
23
|
+
}
|
24
|
+
const defaults = {
|
25
|
+
requestContentType: "application/json; charset=utf-8"
|
26
|
+
};
|
27
|
+
const packageDetails = `azsdk-js-web-pubsub/1.0.1`;
|
28
|
+
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
29
|
+
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
30
|
+
: `${packageDetails}`;
|
31
|
+
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
32
|
+
userAgentPrefix
|
33
|
+
}, baseUri: options.endpoint || "{Endpoint}" });
|
34
|
+
super(optionsWithDefaults);
|
35
|
+
// Parameter assignments
|
36
|
+
this.endpoint = endpoint;
|
37
|
+
// Assigning values to Constant parameters
|
38
|
+
this.apiVersion = options.apiVersion || "2021-10-01";
|
39
|
+
}
|
40
|
+
}
|
41
|
+
//# sourceMappingURL=generatedClientContext.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"generatedClientContext.js","sourceRoot":"","sources":["../../../src/generated/generatedClientContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAGjD,gBAAgB;AAChB,MAAM,OAAO,sBAAuB,SAAQ,UAAU,CAAC,aAAa;IAIlE;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAAuC;QACnE,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAC9C;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,EAAE,CAAC;SACd;QACD,MAAM,QAAQ,GAAkC;YAC9C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,2BAA2B,CAAC;QACnD,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,OAAO,EAAE,OAAO,CAAC,QAAQ,IAAI,YAAY,GAC1C,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,wBAAwB;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,0CAA0C;QAC1C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,YAAY,CAAC;IACvD,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport { GeneratedClientOptionalParams } from \"./models\";\n\n/** @internal */\nexport class GeneratedClientContext extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the GeneratedClientContext class.\n * @param endpoint HTTP or HTTPS endpoint for the Web PubSub service instance.\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: GeneratedClientOptionalParams) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: GeneratedClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-web-pubsub/1.0.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint || \"{Endpoint}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2021-10-01\";\n }\n}\n"]}
|
@@ -1,4 +1,12 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
1
8
|
export * from "./models";
|
2
|
-
export {
|
3
|
-
export {
|
9
|
+
export { GeneratedClient } from "./generatedClient";
|
10
|
+
export { GeneratedClientContext } from "./generatedClientContext";
|
11
|
+
export * from "./operationsInterfaces";
|
4
12
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,cAAc,wBAAwB,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport * from \"./models\";\nexport { GeneratedClient } from \"./generatedClient\";\nexport { GeneratedClientContext } from \"./generatedClientContext\";\nexport * from \"./operationsInterfaces\";\n"]}
|
@@ -1,2 +1,14 @@
|
|
1
|
-
|
1
|
+
/*
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
3
|
+
* Licensed under the MIT License.
|
4
|
+
*
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7
|
+
*/
|
8
|
+
/** Known values of {@link WebPubSubPermission} that the service accepts. */
|
9
|
+
export var KnownWebPubSubPermission;
|
10
|
+
(function (KnownWebPubSubPermission) {
|
11
|
+
KnownWebPubSubPermission["SendToGroup"] = "sendToGroup";
|
12
|
+
KnownWebPubSubPermission["JoinLeaveGroup"] = "joinLeaveGroup";
|
13
|
+
})(KnownWebPubSubPermission || (KnownWebPubSubPermission = {}));
|
2
14
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/generated/models/index.ts"],"names":[],"mappings":"","sourcesContent":["import * as coreHttp from \"@azure/core-http\";\n\n/** Known values of {@link Enum0} that the service accepts. */\nexport const enum KnownEnum0 {\n SendToGroup = \"sendToGroup\",\n JoinLeaveGroup = \"joinLeaveGroup\"\n}\n\n/**\n * Defines values for Enum0. \\\n * {@link KnownEnum0} can be used interchangeably with Enum0,\n * this enum contains the known values that the service supports.\n * ### Know values supported by the service\n * **sendToGroup** \\\n * **joinLeaveGroup**\n */\nexport type Enum0 = string;\n\n/** Known values of {@link Enum1} that the service accepts. */\nexport const enum KnownEnum1 {\n SendToGroup = \"sendToGroup\",\n JoinLeaveGroup = \"joinLeaveGroup\"\n}\n\n/**\n * Defines values for Enum1. \\\n * {@link KnownEnum1} can be used interchangeably with Enum1,\n * this enum contains the known values that the service supports.\n * ### Know values supported by the service\n * **sendToGroup** \\\n * **joinLeaveGroup**\n */\nexport type Enum1 = string;\n\n/** Known values of {@link Enum2} that the service accepts. */\nexport const enum KnownEnum2 {\n SendToGroup = \"sendToGroup\",\n JoinLeaveGroup = \"joinLeaveGroup\"\n}\n\n/**\n * Defines values for Enum2. \\\n * {@link KnownEnum2} can be used interchangeably with Enum2,\n * this enum contains the known values that the service supports.\n * ### Know values supported by the service\n * **sendToGroup** \\\n * **joinLeaveGroup**\n */\nexport type Enum2 = string;\n/** Defines values for ContentType. */\nexport type ContentType = \"application/json\" | \"application/octet-stream\";\n\n/** Optional parameters. */\nexport interface WebPubSubSendToAll$binaryOptionalParams\n extends coreHttp.OperationOptions {\n /** Excluded connection Ids. */\n excluded?: string[];\n}\n\n/** Optional parameters. */\nexport interface WebPubSubSendToAll$textOptionalParams\n extends coreHttp.OperationOptions {\n /** Excluded connection Ids. */\n excluded?: string[];\n}\n\n/** Optional parameters. */\nexport interface WebPubSubCloseClientConnectionOptionalParams\n extends coreHttp.OperationOptions {\n /** The reason closing the client connection. */\n reason?: string;\n}\n\n/** Optional parameters. */\nexport interface WebPubSubSendToGroup$binaryOptionalParams\n extends coreHttp.OperationOptions {\n /** Excluded connection Ids */\n excluded?: string[];\n}\n\n/** Optional parameters. */\nexport interface WebPubSubSendToGroup$textOptionalParams\n extends coreHttp.OperationOptions {\n /** Excluded connection Ids */\n excluded?: string[];\n}\n\n/** Optional parameters. */\nexport interface WebPubSubGrantPermissionOptionalParams\n extends coreHttp.OperationOptions {\n /** Optional. If not set, grant the permission to all the targets. If set, grant the permission to the specific target. The meaning of the target depends on the specific permission. */\n targetName?: string;\n}\n\n/** Optional parameters. */\nexport interface WebPubSubRevokePermissionOptionalParams\n extends coreHttp.OperationOptions {\n /** Optional. If not set, revoke the permission for all targets. If set, revoke the permission for the specific target. The meaning of the target depends on the specific permission. */\n targetName?: string;\n}\n\n/** Optional parameters. */\nexport interface WebPubSubCheckPermissionOptionalParams\n extends coreHttp.OperationOptions {\n /** Optional. If not set, get the permission for all targets. If set, get the permission for the specific target. The meaning of the target depends on the specific permission. */\n targetName?: string;\n}\n\n/** Optional parameters. */\nexport interface AzureWebPubSubServiceRestAPIOptionalParams\n extends coreHttp.ServiceClientOptions {\n /** Api Version */\n apiVersion?: string;\n /** Overrides client endpoint. */\n endpoint?: string;\n}\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/generated/models/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAiIH,4EAA4E;AAC5E,MAAM,CAAN,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,uDAA2B,CAAA;IAC3B,6DAAiC,CAAA;AACnC,CAAC,EAHW,wBAAwB,KAAxB,wBAAwB,QAGnC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\n\n/** The response object containing the token for the client */\nexport interface ClientTokenResponse {\n /** The token value for the WebSocket client to connect to the service */\n token?: string;\n}\n\n/** The error object. */\nexport interface ErrorDetail {\n /** One of a server-defined set of error codes. */\n code?: string;\n /** A human-readable representation of the error. */\n message?: string;\n /** The target of the error. */\n target?: string;\n /** An array of details about specific errors that led to this reported error. */\n details?: ErrorDetail[];\n inner?: InnerError;\n}\n\nexport interface InnerError {\n /** A more specific error code than was provided by the containing error. */\n code?: string;\n inner?: InnerError;\n}\n\n/** Defines headers for WebPubSub_generateClientToken operation. */\nexport interface WebPubSubGenerateClientTokenExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_closeAllConnections operation. */\nexport interface WebPubSubCloseAllConnectionsExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_sendToAll operation. */\nexport interface WebPubSubSendToAllExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_connectionExists operation. */\nexport interface WebPubSubConnectionExistsExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_closeConnection operation. */\nexport interface WebPubSubCloseConnectionExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_sendToConnection operation. */\nexport interface WebPubSubSendToConnectionExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_groupExists operation. */\nexport interface WebPubSubGroupExistsExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_closeGroupConnections operation. */\nexport interface WebPubSubCloseGroupConnectionsExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_sendToGroup operation. */\nexport interface WebPubSubSendToGroupExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_addConnectionToGroup operation. */\nexport interface WebPubSubAddConnectionToGroupExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_removeConnectionFromGroup operation. */\nexport interface WebPubSubRemoveConnectionFromGroupExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_userExists operation. */\nexport interface WebPubSubUserExistsExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_closeUserConnections operation. */\nexport interface WebPubSubCloseUserConnectionsExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_sendToUser operation. */\nexport interface WebPubSubSendToUserExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_addUserToGroup operation. */\nexport interface WebPubSubAddUserToGroupExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_removeUserFromGroup operation. */\nexport interface WebPubSubRemoveUserFromGroupExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_removeUserFromAllGroups operation. */\nexport interface WebPubSubRemoveUserFromAllGroupsExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_grantPermission operation. */\nexport interface WebPubSubGrantPermissionExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_revokePermission operation. */\nexport interface WebPubSubRevokePermissionExceptionHeaders {\n errorCode?: string;\n}\n\n/** Defines headers for WebPubSub_checkPermission operation. */\nexport interface WebPubSubCheckPermissionExceptionHeaders {\n errorCode?: string;\n}\n\n/** Known values of {@link WebPubSubPermission} that the service accepts. */\nexport enum KnownWebPubSubPermission {\n SendToGroup = \"sendToGroup\",\n JoinLeaveGroup = \"joinLeaveGroup\"\n}\n\n/**\n * Defines values for WebPubSubPermission. \\\n * {@link KnownWebPubSubPermission} can be used interchangeably with WebPubSubPermission,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **sendToGroup** \\\n * **joinLeaveGroup**\n */\nexport type WebPubSubPermission = string;\n/** Defines values for ContentType. */\nexport type ContentType = \"application/json\" | \"application/octet-stream\";\n\n/** Optional parameters. */\nexport interface HealthApiGetServiceStatusOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface WebPubSubGenerateClientTokenOptionalParams\n extends coreClient.OperationOptions {\n /** User Id. */\n userId?: string;\n /** Roles that the connection with the generated token will have. */\n roles?: string[];\n /** The expire time of the generated token. */\n expirationTimeInMinutes?: number;\n}\n\n/** Contains response data for the generateClientToken operation. */\nexport type WebPubSubGenerateClientTokenResponse = ClientTokenResponse;\n\n/** Optional parameters. */\nexport interface WebPubSubCloseAllConnectionsOptionalParams\n extends coreClient.OperationOptions {\n /** Exclude these connectionIds when closing the connections in the hub. */\n excluded?: string[];\n /** The reason closing the client connection. */\n reason?: string;\n}\n\n/** Optional parameters. */\nexport interface WebPubSubSendToAll$binaryOptionalParams\n extends coreClient.OperationOptions {\n /** Excluded connection Ids. */\n excludedConnections?: string[];\n}\n\n/** Optional parameters. */\nexport interface WebPubSubSendToAll$textOptionalParams\n extends coreClient.OperationOptions {\n /** Excluded connection Ids. */\n excludedConnections?: string[];\n}\n\n/** Optional parameters. */\nexport interface WebPubSubConnectionExistsOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface WebPubSubCloseConnectionOptionalParams\n extends coreClient.OperationOptions {\n /** The reason closing the client connection. */\n reason?: string;\n}\n\n/** Optional parameters. */\nexport interface WebPubSubSendToConnection$binaryOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface WebPubSubSendToConnection$textOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface WebPubSubGroupExistsOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface WebPubSubCloseGroupConnectionsOptionalParams\n extends coreClient.OperationOptions {\n /** Exclude these connectionIds when closing the connections in the group. */\n excluded?: string[];\n /** The reason closing the client connection. */\n reason?: string;\n}\n\n/** Optional parameters. */\nexport interface WebPubSubSendToGroup$binaryOptionalParams\n extends coreClient.OperationOptions {\n /** Excluded connection Ids */\n excludedConnections?: string[];\n}\n\n/** Optional parameters. */\nexport interface WebPubSubSendToGroup$textOptionalParams\n extends coreClient.OperationOptions {\n /** Excluded connection Ids */\n excludedConnections?: string[];\n}\n\n/** Optional parameters. */\nexport interface WebPubSubAddConnectionToGroupOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface WebPubSubRemoveConnectionFromGroupOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface WebPubSubUserExistsOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface WebPubSubCloseUserConnectionsOptionalParams\n extends coreClient.OperationOptions {\n /** Exclude these connectionIds when closing the connections for the user. */\n excluded?: string[];\n /** The reason closing the client connection. */\n reason?: string;\n}\n\n/** Optional parameters. */\nexport interface WebPubSubSendToUser$binaryOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface WebPubSubSendToUser$textOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface WebPubSubAddUserToGroupOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface WebPubSubRemoveUserFromGroupOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface WebPubSubRemoveUserFromAllGroupsOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface WebPubSubGrantPermissionOptionalParams\n extends coreClient.OperationOptions {\n /** The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name. */\n targetName?: string;\n}\n\n/** Optional parameters. */\nexport interface WebPubSubRevokePermissionOptionalParams\n extends coreClient.OperationOptions {\n /** The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name. */\n targetName?: string;\n}\n\n/** Optional parameters. */\nexport interface WebPubSubCheckPermissionOptionalParams\n extends coreClient.OperationOptions {\n /** The meaning of the target depends on the specific permission. For joinLeaveGroup and sendToGroup, targetName is a required parameter standing for the group name. */\n targetName?: string;\n}\n\n/** Optional parameters. */\nexport interface GeneratedClientOptionalParams\n extends coreClient.ServiceClientOptions {\n /** Api Version */\n apiVersion?: string;\n /** Overrides client endpoint. */\n endpoint?: string;\n}\n"]}
|