@azure/arm-playwrighttesting 1.0.0-alpha.20230927.3

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.
Files changed (128) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +109 -0
  4. package/dist/index.js +1766 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/samples-dev/accountsCreateOrUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/accountsCreateOrUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/accountsCreateOrUpdateSample.js +44 -0
  11. package/dist-esm/samples-dev/accountsCreateOrUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/accountsDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/accountsDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/accountsDeleteSample.js +39 -0
  15. package/dist-esm/samples-dev/accountsDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/accountsGetSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/accountsGetSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/accountsGetSample.js +39 -0
  19. package/dist-esm/samples-dev/accountsGetSample.js.map +1 -0
  20. package/dist-esm/samples-dev/accountsListByResourceGroupSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/accountsListByResourceGroupSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/accountsListByResourceGroupSample.js +59 -0
  23. package/dist-esm/samples-dev/accountsListByResourceGroupSample.js.map +1 -0
  24. package/dist-esm/samples-dev/accountsListBySubscriptionSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/accountsListBySubscriptionSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/accountsListBySubscriptionSample.js +58 -0
  27. package/dist-esm/samples-dev/accountsListBySubscriptionSample.js.map +1 -0
  28. package/dist-esm/samples-dev/accountsUpdateSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/accountsUpdateSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/accountsUpdateSample.js +43 -0
  31. package/dist-esm/samples-dev/accountsUpdateSample.js.map +1 -0
  32. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/operationsListSample.js +58 -0
  35. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  36. package/dist-esm/samples-dev/quotasGetSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/quotasGetSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/quotasGetSample.js +39 -0
  39. package/dist-esm/samples-dev/quotasGetSample.js.map +1 -0
  40. package/dist-esm/samples-dev/quotasListBySubscriptionSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/quotasListBySubscriptionSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/quotasListBySubscriptionSample.js +59 -0
  43. package/dist-esm/samples-dev/quotasListBySubscriptionSample.js.map +1 -0
  44. package/dist-esm/src/index.d.ts +6 -0
  45. package/dist-esm/src/index.d.ts.map +1 -0
  46. package/dist-esm/src/index.js +13 -0
  47. package/dist-esm/src/index.js.map +1 -0
  48. package/dist-esm/src/lroImpl.d.ts +11 -0
  49. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  50. package/dist-esm/src/lroImpl.js +21 -0
  51. package/dist-esm/src/lroImpl.js.map +1 -0
  52. package/dist-esm/src/models/index.d.ts +469 -0
  53. package/dist-esm/src/models/index.d.ts.map +1 -0
  54. package/dist-esm/src/models/index.js +72 -0
  55. package/dist-esm/src/models/index.js.map +1 -0
  56. package/dist-esm/src/models/mappers.d.ts +20 -0
  57. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  58. package/dist-esm/src/models/mappers.js +556 -0
  59. package/dist-esm/src/models/mappers.js.map +1 -0
  60. package/dist-esm/src/models/parameters.d.ts +14 -0
  61. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  62. package/dist-esm/src/models/parameters.js +134 -0
  63. package/dist-esm/src/models/parameters.js.map +1 -0
  64. package/dist-esm/src/operations/accounts.d.ts +99 -0
  65. package/dist-esm/src/operations/accounts.d.ts.map +1 -0
  66. package/dist-esm/src/operations/accounts.js +499 -0
  67. package/dist-esm/src/operations/accounts.js.map +1 -0
  68. package/dist-esm/src/operations/index.d.ts +4 -0
  69. package/dist-esm/src/operations/index.d.ts.map +1 -0
  70. package/dist-esm/src/operations/index.js +11 -0
  71. package/dist-esm/src/operations/index.js.map +1 -0
  72. package/dist-esm/src/operations/operations.d.ts +32 -0
  73. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  74. package/dist-esm/src/operations/operations.js +138 -0
  75. package/dist-esm/src/operations/operations.js.map +1 -0
  76. package/dist-esm/src/operations/quotas.d.ts +42 -0
  77. package/dist-esm/src/operations/quotas.d.ts.map +1 -0
  78. package/dist-esm/src/operations/quotas.js +180 -0
  79. package/dist-esm/src/operations/quotas.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/accounts.d.ts +63 -0
  81. package/dist-esm/src/operationsInterfaces/accounts.d.ts.map +1 -0
  82. package/dist-esm/src/operationsInterfaces/accounts.js +9 -0
  83. package/dist-esm/src/operationsInterfaces/accounts.js.map +1 -0
  84. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  85. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  86. package/dist-esm/src/operationsInterfaces/index.js +11 -0
  87. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  88. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  89. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  90. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  91. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  92. package/dist-esm/src/operationsInterfaces/quotas.d.ts +19 -0
  93. package/dist-esm/src/operationsInterfaces/quotas.d.ts.map +1 -0
  94. package/dist-esm/src/operationsInterfaces/quotas.js +9 -0
  95. package/dist-esm/src/operationsInterfaces/quotas.js.map +1 -0
  96. package/dist-esm/src/pagingHelper.d.ts +13 -0
  97. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  98. package/dist-esm/src/pagingHelper.js +32 -0
  99. package/dist-esm/src/pagingHelper.js.map +1 -0
  100. package/dist-esm/src/playwrightTestingClient.d.ts +22 -0
  101. package/dist-esm/src/playwrightTestingClient.d.ts.map +1 -0
  102. package/dist-esm/src/playwrightTestingClient.js +102 -0
  103. package/dist-esm/src/playwrightTestingClient.js.map +1 -0
  104. package/dist-esm/test/playwrighttesting_operations_test.spec.d.ts +4 -0
  105. package/dist-esm/test/playwrighttesting_operations_test.spec.d.ts.map +1 -0
  106. package/dist-esm/test/playwrighttesting_operations_test.spec.js +76 -0
  107. package/dist-esm/test/playwrighttesting_operations_test.spec.js.map +1 -0
  108. package/package.json +124 -0
  109. package/review/arm-playwrighttesting.api.md +356 -0
  110. package/rollup.config.js +122 -0
  111. package/src/index.ts +13 -0
  112. package/src/lroImpl.ts +42 -0
  113. package/src/models/index.ts +531 -0
  114. package/src/models/mappers.ts +592 -0
  115. package/src/models/parameters.ts +154 -0
  116. package/src/operations/accounts.ts +630 -0
  117. package/src/operations/index.ts +11 -0
  118. package/src/operations/operations.ts +149 -0
  119. package/src/operations/quotas.ts +219 -0
  120. package/src/operationsInterfaces/accounts.ts +121 -0
  121. package/src/operationsInterfaces/index.ts +11 -0
  122. package/src/operationsInterfaces/operations.ts +22 -0
  123. package/src/operationsInterfaces/quotas.ts +41 -0
  124. package/src/pagingHelper.ts +39 -0
  125. package/src/playwrightTestingClient.ts +144 -0
  126. package/tsconfig.json +33 -0
  127. package/types/arm-playwrighttesting.d.ts +645 -0
  128. package/types/tsdoc-metadata.json +11 -0
@@ -0,0 +1,144 @@
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
+
9
+ import * as coreClient from "@azure/core-client";
10
+ import * as coreRestPipeline from "@azure/core-rest-pipeline";
11
+ import {
12
+ PipelineRequest,
13
+ PipelineResponse,
14
+ SendRequest
15
+ } from "@azure/core-rest-pipeline";
16
+ import * as coreAuth from "@azure/core-auth";
17
+ import { OperationsImpl, AccountsImpl, QuotasImpl } from "./operations";
18
+ import { Operations, Accounts, Quotas } from "./operationsInterfaces";
19
+ import { PlaywrightTestingClientOptionalParams } from "./models";
20
+
21
+ export class PlaywrightTestingClient extends coreClient.ServiceClient {
22
+ $host: string;
23
+ apiVersion: string;
24
+ subscriptionId: string;
25
+
26
+ /**
27
+ * Initializes a new instance of the PlaywrightTestingClient class.
28
+ * @param credentials Subscription credentials which uniquely identify client subscription.
29
+ * @param subscriptionId The ID of the target subscription.
30
+ * @param options The parameter options
31
+ */
32
+ constructor(
33
+ credentials: coreAuth.TokenCredential,
34
+ subscriptionId: string,
35
+ options?: PlaywrightTestingClientOptionalParams
36
+ ) {
37
+ if (credentials === undefined) {
38
+ throw new Error("'credentials' cannot be null");
39
+ }
40
+ if (subscriptionId === undefined) {
41
+ throw new Error("'subscriptionId' cannot be null");
42
+ }
43
+
44
+ // Initializing default values for options
45
+ if (!options) {
46
+ options = {};
47
+ }
48
+ const defaults: PlaywrightTestingClientOptionalParams = {
49
+ requestContentType: "application/json; charset=utf-8",
50
+ credential: credentials
51
+ };
52
+
53
+ const packageDetails = `azsdk-js-arm-playwrighttesting/1.0.0-beta.1`;
54
+ const userAgentPrefix =
55
+ options.userAgentOptions && options.userAgentOptions.userAgentPrefix
56
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
57
+ : `${packageDetails}`;
58
+
59
+ const optionsWithDefaults = {
60
+ ...defaults,
61
+ ...options,
62
+ userAgentOptions: {
63
+ userAgentPrefix
64
+ },
65
+ endpoint:
66
+ options.endpoint ?? options.baseUri ?? "https://management.azure.com"
67
+ };
68
+ super(optionsWithDefaults);
69
+
70
+ let bearerTokenAuthenticationPolicyFound: boolean = false;
71
+ if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
72
+ const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
73
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
74
+ (pipelinePolicy) =>
75
+ pipelinePolicy.name ===
76
+ coreRestPipeline.bearerTokenAuthenticationPolicyName
77
+ );
78
+ }
79
+ if (
80
+ !options ||
81
+ !options.pipeline ||
82
+ options.pipeline.getOrderedPolicies().length == 0 ||
83
+ !bearerTokenAuthenticationPolicyFound
84
+ ) {
85
+ this.pipeline.removePolicy({
86
+ name: coreRestPipeline.bearerTokenAuthenticationPolicyName
87
+ });
88
+ this.pipeline.addPolicy(
89
+ coreRestPipeline.bearerTokenAuthenticationPolicy({
90
+ credential: credentials,
91
+ scopes:
92
+ optionsWithDefaults.credentialScopes ??
93
+ `${optionsWithDefaults.endpoint}/.default`,
94
+ challengeCallbacks: {
95
+ authorizeRequestOnChallenge:
96
+ coreClient.authorizeRequestOnClaimChallenge
97
+ }
98
+ })
99
+ );
100
+ }
101
+ // Parameter assignments
102
+ this.subscriptionId = subscriptionId;
103
+
104
+ // Assigning values to Constant parameters
105
+ this.$host = options.$host || "https://management.azure.com";
106
+ this.apiVersion = options.apiVersion || "2023-10-01-preview";
107
+ this.operations = new OperationsImpl(this);
108
+ this.accounts = new AccountsImpl(this);
109
+ this.quotas = new QuotasImpl(this);
110
+ this.addCustomApiVersionPolicy(options.apiVersion);
111
+ }
112
+
113
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
114
+ private addCustomApiVersionPolicy(apiVersion?: string) {
115
+ if (!apiVersion) {
116
+ return;
117
+ }
118
+ const apiVersionPolicy = {
119
+ name: "CustomApiVersionPolicy",
120
+ async sendRequest(
121
+ request: PipelineRequest,
122
+ next: SendRequest
123
+ ): Promise<PipelineResponse> {
124
+ const param = request.url.split("?");
125
+ if (param.length > 1) {
126
+ const newParams = param[1].split("&").map((item) => {
127
+ if (item.indexOf("api-version") > -1) {
128
+ return "api-version=" + apiVersion;
129
+ } else {
130
+ return item;
131
+ }
132
+ });
133
+ request.url = param[0] + "?" + newParams.join("&");
134
+ }
135
+ return next(request);
136
+ }
137
+ };
138
+ this.pipeline.addPolicy(apiVersionPolicy);
139
+ }
140
+
141
+ operations: Operations;
142
+ accounts: Accounts;
143
+ quotas: Quotas;
144
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "es6",
4
+ "moduleResolution": "node",
5
+ "strict": true,
6
+ "target": "es6",
7
+ "sourceMap": true,
8
+ "declarationMap": true,
9
+ "esModuleInterop": true,
10
+ "allowSyntheticDefaultImports": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "lib": [
13
+ "es6",
14
+ "dom"
15
+ ],
16
+ "declaration": true,
17
+ "outDir": "./dist-esm",
18
+ "importHelpers": true,
19
+ "paths": {
20
+ "@azure/arm-playwrighttesting": [
21
+ "./src/index"
22
+ ]
23
+ }
24
+ },
25
+ "include": [
26
+ "./src/**/*.ts",
27
+ "./test/**/*.ts",
28
+ "samples-dev/**/*.ts"
29
+ ],
30
+ "exclude": [
31
+ "node_modules"
32
+ ]
33
+ }