@azure/arm-datacatalog 2.0.0 → 3.0.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.
Files changed (118) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/LICENSE.txt +1 -1
  4. package/README.md +70 -78
  5. package/dist/index.js +668 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.min.js +1 -0
  8. package/dist/index.min.js.map +1 -0
  9. package/dist-esm/src/dataCatalogRestClient.d.ts +22 -0
  10. package/dist-esm/src/dataCatalogRestClient.d.ts.map +1 -0
  11. package/dist-esm/src/dataCatalogRestClient.js +58 -0
  12. package/dist-esm/src/dataCatalogRestClient.js.map +1 -0
  13. package/dist-esm/src/index.d.ts +4 -0
  14. package/dist-esm/src/index.d.ts.map +1 -0
  15. package/{esm/models/aDCOperationsMappers.js → dist-esm/src/index.js} +4 -2
  16. package/dist-esm/src/index.js.map +1 -0
  17. package/dist-esm/src/lroImpl.d.ts +16 -0
  18. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  19. package/dist-esm/src/lroImpl.js +29 -0
  20. package/dist-esm/src/lroImpl.js.map +1 -0
  21. package/dist-esm/src/models/index.d.ts +133 -0
  22. package/dist-esm/src/models/index.d.ts.map +1 -0
  23. package/dist-esm/src/models/index.js +14 -0
  24. package/dist-esm/src/models/index.js.map +1 -0
  25. package/dist-esm/src/models/mappers.d.ts +9 -0
  26. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  27. package/{esm → dist-esm/src}/models/mappers.js +101 -116
  28. package/dist-esm/src/models/mappers.js.map +1 -0
  29. package/dist-esm/src/models/parameters.d.ts +10 -0
  30. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  31. package/dist-esm/src/models/parameters.js +92 -0
  32. package/dist-esm/src/models/parameters.js.map +1 -0
  33. package/dist-esm/src/operations/aDCCatalogs.d.ts +62 -0
  34. package/dist-esm/src/operations/aDCCatalogs.d.ts.map +1 -0
  35. package/dist-esm/src/operations/aDCCatalogs.js +208 -0
  36. package/dist-esm/src/operations/aDCCatalogs.js.map +1 -0
  37. package/dist-esm/src/operations/aDCOperations.d.ts +18 -0
  38. package/dist-esm/src/operations/aDCOperations.d.ts.map +1 -0
  39. package/dist-esm/src/operations/aDCOperations.js +43 -0
  40. package/dist-esm/src/operations/aDCOperations.js.map +1 -0
  41. package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  42. package/dist-esm/src/operations/index.d.ts.map +1 -0
  43. package/{esm → dist-esm/src}/operations/index.js +1 -2
  44. package/dist-esm/src/operations/index.js.map +1 -0
  45. package/dist-esm/src/operationsInterfaces/aDCCatalogs.d.ts +54 -0
  46. package/dist-esm/src/operationsInterfaces/aDCCatalogs.d.ts.map +1 -0
  47. package/{esm/models/index.js → dist-esm/src/operationsInterfaces/aDCCatalogs.js} +2 -1
  48. package/dist-esm/src/operationsInterfaces/aDCCatalogs.js.map +1 -0
  49. package/dist-esm/src/operationsInterfaces/aDCOperations.d.ts +10 -0
  50. package/dist-esm/src/operationsInterfaces/aDCOperations.d.ts.map +1 -0
  51. package/dist-esm/src/operationsInterfaces/aDCOperations.js +9 -0
  52. package/dist-esm/src/operationsInterfaces/aDCOperations.js.map +1 -0
  53. package/dist-esm/src/operationsInterfaces/index.d.ts +3 -0
  54. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  55. package/dist-esm/src/operationsInterfaces/index.js +10 -0
  56. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  57. package/dist-esm/test/sampleTest.d.ts +2 -0
  58. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  59. package/dist-esm/test/sampleTest.js +40 -0
  60. package/dist-esm/test/sampleTest.js.map +1 -0
  61. package/package.json +69 -32
  62. package/review/arm-datacatalog.api.md +157 -0
  63. package/rollup.config.js +181 -30
  64. package/src/dataCatalogRestClient.ts +70 -37
  65. package/src/{models/aDCCatalogsMappers.ts → index.ts} +3 -8
  66. package/src/lroImpl.ts +34 -0
  67. package/src/models/index.ts +108 -207
  68. package/src/models/mappers.ts +104 -119
  69. package/src/models/parameters.ts +59 -20
  70. package/src/operations/aDCCatalogs.ts +193 -251
  71. package/src/operations/aDCOperations.ts +27 -44
  72. package/src/operations/index.ts +1 -2
  73. package/src/operationsInterfaces/aDCCatalogs.ts +93 -0
  74. package/src/operationsInterfaces/aDCOperations.ts +23 -0
  75. package/src/{models/aDCOperationsMappers.ts → operationsInterfaces/index.ts} +2 -6
  76. package/tsconfig.json +3 -3
  77. package/types/arm-datacatalog.d.ts +237 -0
  78. package/types/tsdoc-metadata.json +11 -0
  79. package/dist/arm-datacatalog.js +0 -765
  80. package/dist/arm-datacatalog.js.map +0 -1
  81. package/dist/arm-datacatalog.min.js +0 -1
  82. package/dist/arm-datacatalog.min.js.map +0 -1
  83. package/esm/dataCatalogRestClient.d.ts +0 -28
  84. package/esm/dataCatalogRestClient.d.ts.map +0 -1
  85. package/esm/dataCatalogRestClient.js +0 -41
  86. package/esm/dataCatalogRestClient.js.map +0 -1
  87. package/esm/dataCatalogRestClientContext.d.ts +0 -26
  88. package/esm/dataCatalogRestClientContext.d.ts.map +0 -1
  89. package/esm/dataCatalogRestClientContext.js +0 -67
  90. package/esm/dataCatalogRestClientContext.js.map +0 -1
  91. package/esm/models/aDCCatalogsMappers.d.ts +0 -2
  92. package/esm/models/aDCCatalogsMappers.d.ts.map +0 -1
  93. package/esm/models/aDCCatalogsMappers.js +0 -9
  94. package/esm/models/aDCCatalogsMappers.js.map +0 -1
  95. package/esm/models/aDCOperationsMappers.d.ts +0 -2
  96. package/esm/models/aDCOperationsMappers.d.ts.map +0 -1
  97. package/esm/models/aDCOperationsMappers.js.map +0 -1
  98. package/esm/models/index.d.ts +0 -235
  99. package/esm/models/index.d.ts.map +0 -1
  100. package/esm/models/index.js.map +0 -1
  101. package/esm/models/mappers.d.ts +0 -11
  102. package/esm/models/mappers.d.ts.map +0 -1
  103. package/esm/models/mappers.js.map +0 -1
  104. package/esm/models/parameters.d.ts +0 -7
  105. package/esm/models/parameters.d.ts.map +0 -1
  106. package/esm/models/parameters.js +0 -64
  107. package/esm/models/parameters.js.map +0 -1
  108. package/esm/operations/aDCCatalogs.d.ts +0 -131
  109. package/esm/operations/aDCCatalogs.d.ts.map +0 -1
  110. package/esm/operations/aDCCatalogs.js +0 -209
  111. package/esm/operations/aDCCatalogs.js.map +0 -1
  112. package/esm/operations/aDCOperations.d.ts +0 -28
  113. package/esm/operations/aDCOperations.d.ts.map +0 -1
  114. package/esm/operations/aDCOperations.js +0 -50
  115. package/esm/operations/aDCOperations.js.map +0 -1
  116. package/esm/operations/index.d.ts.map +0 -1
  117. package/esm/operations/index.js.map +0 -1
  118. package/src/dataCatalogRestClientContext.ts +0 -75
package/rollup.config.js CHANGED
@@ -1,37 +1,188 @@
1
- import rollup from "rollup";
2
- import nodeResolve from "rollup-plugin-node-resolve";
3
- import sourcemaps from "rollup-plugin-sourcemaps";
4
-
5
- /**
6
- * @type {rollup.RollupFileOptions}
7
- */
8
- const config = {
9
- input: "./esm/dataCatalogRestClient.js",
10
- external: [
11
- "@azure/ms-rest-js",
12
- "@azure/ms-rest-azure-js"
13
- ],
14
- output: {
15
- file: "./dist/arm-datacatalog.js",
16
- format: "umd",
17
- name: "Azure.ArmDatacatalog",
18
- sourcemap: true,
19
- globals: {
20
- "@azure/ms-rest-js": "msRest",
21
- "@azure/ms-rest-azure-js": "msRestAzure"
22
- },
23
- banner: `/*
1
+ /*
24
2
  * Copyright (c) Microsoft Corporation.
25
3
  * Licensed under the MIT License.
26
4
  *
27
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
28
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
29
- */`
30
- },
31
- plugins: [
32
- nodeResolve({ mainFields: ['module', 'main'] }),
33
- sourcemaps()
34
- ]
7
+ */
8
+
9
+ import nodeResolve from "@rollup/plugin-node-resolve";
10
+ import cjs from "@rollup/plugin-commonjs";
11
+ import sourcemaps from "rollup-plugin-sourcemaps";
12
+ import multiEntry from "@rollup/plugin-multi-entry";
13
+ import json from "@rollup/plugin-json";
14
+
15
+ import nodeBuiltins from "builtin-modules";
16
+
17
+ /**
18
+ * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
19
+ *
20
+ * NOTE: this manual configuration is only needed because OpenTelemetry uses an
21
+ * __exportStar downleveled helper function to declare its exports which confuses
22
+ * rollup's automatic discovery mechanism.
23
+ *
24
+ * @returns an object reference that can be `...`'d into your cjs() configuration.
25
+ */
26
+ export function openTelemetryCommonJs() {
27
+ const namedExports = {};
28
+
29
+ for (const key of [
30
+ "@opentelemetry/api",
31
+ "@azure/core-tracing/node_modules/@opentelemetry/api"
32
+ ]) {
33
+ namedExports[key] = [
34
+ "SpanKind",
35
+ "TraceFlags",
36
+ "getSpan",
37
+ "setSpan",
38
+ "SpanStatusCode",
39
+ "getSpanContext",
40
+ "setSpanContext"
41
+ ];
42
+ }
43
+
44
+ const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];
45
+
46
+ for (const version of releasedOpenTelemetryVersions) {
47
+ namedExports[
48
+ // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
49
+ `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
50
+ ] = [
51
+ "SpanKind",
52
+ "TraceFlags",
53
+ "getSpan",
54
+ "setSpan",
55
+ "StatusCode",
56
+ "CanonicalCode",
57
+ "getSpanContext",
58
+ "setSpanContext"
59
+ ];
60
+ }
61
+
62
+ return namedExports;
63
+ }
64
+
65
+ // #region Warning Handler
66
+
67
+ /**
68
+ * A function that can determine whether a rollupwarning should be ignored. If
69
+ * the function returns `true`, then the warning will not be displayed.
70
+ */
71
+
72
+ function ignoreNiseSinonEvalWarnings(warning) {
73
+ return (
74
+ warning.code === "EVAL" &&
75
+ warning.id &&
76
+ (warning.id.includes("node_modules/nise") ||
77
+ warning.id.includes("node_modules/sinon")) === true
78
+ );
79
+ }
80
+
81
+ function ignoreChaiCircularDependencyWarnings(warning) {
82
+ return (
83
+ warning.code === "CIRCULAR_DEPENDENCY" &&
84
+ warning.importer && warning.importer.includes("node_modules/chai") === true
85
+ );
86
+ }
87
+
88
+ const warningInhibitors = [
89
+ ignoreChaiCircularDependencyWarnings,
90
+ ignoreNiseSinonEvalWarnings
91
+ ];
92
+
93
+ /**
94
+ * Construct a warning handler for the shared rollup configuration
95
+ * that ignores certain warnings that are not relevant to testing.
96
+ */
97
+ function makeOnWarnForTesting() {
98
+ return (warning, warn) => {
99
+ // If every inhibitor returns false (i.e. no inhibitors), then show the warning
100
+ if (warningInhibitors.every((inhib) => !inhib(warning))) {
101
+ warn(warning);
102
+ }
103
+ };
104
+ }
105
+
106
+ // #endregion
107
+
108
+ function makeBrowserTestConfig() {
109
+ const config = {
110
+ input: {
111
+ include: ["dist-esm/test/**/*.spec.js"],
112
+ exclude: ["dist-esm/test/**/node/**"]
113
+ },
114
+ output: {
115
+ file: `dist-test/index.browser.js`,
116
+ format: "umd",
117
+ sourcemap: true
118
+ },
119
+ preserveSymlinks: false,
120
+ plugins: [
121
+ multiEntry({ exports: false }),
122
+ nodeResolve({
123
+ mainFields: ["module", "browser"]
124
+ }),
125
+ cjs({
126
+ namedExports: {
127
+ // Chai's strange internal architecture makes it impossible to statically
128
+ // analyze its exports.
129
+ chai: [
130
+ "version",
131
+ "use",
132
+ "util",
133
+ "config",
134
+ "expect",
135
+ "should",
136
+ "assert"
137
+ ],
138
+ ...openTelemetryCommonJs()
139
+ }
140
+ }),
141
+ json(),
142
+ sourcemaps()
143
+ //viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
144
+ ],
145
+ onwarn: makeOnWarnForTesting(),
146
+ // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
147
+ // rollup started respecting the "sideEffects" field in package.json. Since
148
+ // our package.json sets "sideEffects=false", this also applies to test
149
+ // code, which causes all tests to be removed by tree-shaking.
150
+ treeshake: false
151
+ };
152
+
153
+ return config;
154
+ }
155
+
156
+ const defaultConfigurationOptions = {
157
+ disableBrowserBundle: false
35
158
  };
36
159
 
37
- export default config;
160
+ export function makeConfig(pkg, options) {
161
+ options = {
162
+ ...defaultConfigurationOptions,
163
+ ...(options || {})
164
+ };
165
+
166
+ const baseConfig = {
167
+ // Use the package's module field if it has one
168
+ input: pkg["module"] || "dist-esm/src/index.js",
169
+ external: [
170
+ ...nodeBuiltins,
171
+ ...Object.keys(pkg.dependencies),
172
+ ...Object.keys(pkg.devDependencies)
173
+ ],
174
+ output: { file: "dist/index.js", format: "cjs", sourcemap: true },
175
+ preserveSymlinks: false,
176
+ plugins: [sourcemaps(), nodeResolve(), cjs()]
177
+ };
178
+
179
+ const config = [baseConfig];
180
+
181
+ if (!options.disableBrowserBundle) {
182
+ config.push(makeBrowserTestConfig());
183
+ }
184
+
185
+ return config;
186
+ }
187
+
188
+ export default makeConfig(require("./package.json"));
@@ -3,50 +3,83 @@
3
3
  * Licensed under the MIT License.
4
4
  *
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is
7
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
7
  */
9
8
 
10
- import * as msRest from "@azure/ms-rest-js";
11
- import { TokenCredential } from "@azure/core-auth";
12
- import * as Models from "./models";
13
- import * as Mappers from "./models/mappers";
14
- import * as operations from "./operations";
15
- import { DataCatalogRestClientContext } from "./dataCatalogRestClientContext";
9
+ import * as coreClient from "@azure/core-client";
10
+ import * as coreAuth from "@azure/core-auth";
11
+ import { ADCOperationsImpl, ADCCatalogsImpl } from "./operations";
12
+ import { ADCOperations, ADCCatalogs } from "./operationsInterfaces";
13
+ import { DataCatalogRestClientOptionalParams } from "./models";
16
14
 
17
-
18
- class DataCatalogRestClient extends DataCatalogRestClientContext {
19
- // Operation groups
20
- aDCOperations: operations.ADCOperations;
21
- aDCCatalogs: operations.ADCCatalogs;
15
+ export class DataCatalogRestClient extends coreClient.ServiceClient {
16
+ $host: string;
17
+ apiVersion: string;
18
+ subscriptionId: string;
19
+ catalogName: string;
22
20
 
23
21
  /**
24
22
  * Initializes a new instance of the DataCatalogRestClient class.
25
- * @param credentials Credentials needed for the client to connect to Azure. Credentials
26
- * implementing the TokenCredential interface from the @azure/identity package are recommended. For
27
- * more information about these credentials, see
28
- * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
29
- * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
30
- * @azure/ms-rest-browserauth are also supported.
23
+ * @param credentials Subscription credentials which uniquely identify client subscription.
31
24
  * @param subscriptionId Gets subscription credentials which uniquely identify the Microsoft Azure
32
- * subscription. The subscription ID forms part of the URI for every service call.
33
- * @param catalogName The name of the data catalog in the specified subscription and resource
34
- * group.
35
- * @param [options] The parameter options
25
+ * subscription. The subscription ID forms part of the URI for every service call.
26
+ * @param catalogName The name of the data catalog in the specified subscription and resource group.
27
+ * @param options The parameter options
36
28
  */
37
- constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, catalogName: string, options?: Models.DataCatalogRestClientOptions) {
38
- super(credentials, subscriptionId, catalogName, options);
39
- this.aDCOperations = new operations.ADCOperations(this);
40
- this.aDCCatalogs = new operations.ADCCatalogs(this);
41
- }
42
- }
29
+ constructor(
30
+ credentials: coreAuth.TokenCredential,
31
+ subscriptionId: string,
32
+ catalogName: string,
33
+ options?: DataCatalogRestClientOptionalParams
34
+ ) {
35
+ if (credentials === undefined) {
36
+ throw new Error("'credentials' cannot be null");
37
+ }
38
+ if (subscriptionId === undefined) {
39
+ throw new Error("'subscriptionId' cannot be null");
40
+ }
41
+ if (catalogName === undefined) {
42
+ throw new Error("'catalogName' cannot be null");
43
+ }
44
+
45
+ // Initializing default values for options
46
+ if (!options) {
47
+ options = {};
48
+ }
49
+ const defaults: DataCatalogRestClientOptionalParams = {
50
+ requestContentType: "application/json; charset=utf-8",
51
+ credential: credentials
52
+ };
43
53
 
44
- // Operation Specifications
54
+ const packageDetails = `azsdk-js-arm-datacatalog/3.0.0`;
55
+ const userAgentPrefix =
56
+ options.userAgentOptions && options.userAgentOptions.userAgentPrefix
57
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
58
+ : `${packageDetails}`;
45
59
 
46
- export {
47
- DataCatalogRestClient,
48
- DataCatalogRestClientContext,
49
- Models as DataCatalogRestModels,
50
- Mappers as DataCatalogRestMappers
51
- };
52
- export * from "./operations";
60
+ if (!options.credentialScopes) {
61
+ options.credentialScopes = ["https://management.azure.com/.default"];
62
+ }
63
+ const optionsWithDefaults = {
64
+ ...defaults,
65
+ ...options,
66
+ userAgentOptions: {
67
+ userAgentPrefix
68
+ },
69
+ baseUri: options.endpoint || "https://management.azure.com"
70
+ };
71
+ super(optionsWithDefaults);
72
+ // Parameter assignments
73
+ this.subscriptionId = subscriptionId;
74
+ this.catalogName = catalogName;
75
+
76
+ // Assigning values to Constant parameters
77
+ this.$host = options.$host || "https://management.azure.com";
78
+ this.apiVersion = options.apiVersion || "2016-03-30";
79
+ this.aDCOperations = new ADCOperationsImpl(this);
80
+ this.aDCCatalogs = new ADCCatalogsImpl(this);
81
+ }
82
+
83
+ aDCOperations: ADCOperations;
84
+ aDCCatalogs: ADCCatalogs;
85
+ }
@@ -6,11 +6,6 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- export {
10
- ADCCatalog,
11
- ADCCatalogsListResult,
12
- BaseResource,
13
- CloudError,
14
- Principals,
15
- Resource
16
- } from "../models/mappers";
9
+ export * from "./models";
10
+ export { DataCatalogRestClient } from "./dataCatalogRestClient";
11
+ export * from "./operationsInterfaces";
package/src/lroImpl.ts ADDED
@@ -0,0 +1,34 @@
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 { LongRunningOperation, LroResponse } from "@azure/core-lro";
10
+
11
+ export class LroImpl<T> implements LongRunningOperation<T> {
12
+ constructor(
13
+ private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
14
+ private args: Record<string, unknown>,
15
+ private spec: {
16
+ readonly requestBody?: unknown;
17
+ readonly path?: string;
18
+ readonly httpMethod: string;
19
+ } & Record<string, any>,
20
+ public requestPath: string = spec.path!,
21
+ public requestMethod: string = spec.httpMethod
22
+ ) {}
23
+ public async sendInitialRequest(): Promise<LroResponse<T>> {
24
+ return this.sendOperationFn(this.args, this.spec);
25
+ }
26
+ public async sendPollRequest(path: string): Promise<LroResponse<T>> {
27
+ const { requestBody, ...restSpec } = this.spec;
28
+ return this.sendOperationFn(this.args, {
29
+ ...restSpec,
30
+ path,
31
+ httpMethod: "GET"
32
+ });
33
+ }
34
+ }