@azure-tools/rlc-common 1.0.0-alpha.8.20230130.1 → 1.0.0-alpha.8.20230206.1
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/.rush/temp/package-deps_build.json +3 -3
- package/dist/metadata/buildPackageFile.js +3 -4
- package/dist/metadata/buildPackageFile.js.map +1 -1
- package/dist/static/pollingContent.js +25 -6
- package/dist/static/pollingContent.js.map +1 -1
- package/dist/test/template.js +0 -2
- package/dist/test/template.js.map +1 -1
- package/dist-esm/metadata/buildPackageFile.js +3 -4
- package/dist-esm/metadata/buildPackageFile.js.map +1 -1
- package/dist-esm/static/pollingContent.js +25 -6
- package/dist-esm/static/pollingContent.js.map +1 -1
- package/dist-esm/test/template.js +0 -2
- package/dist-esm/test/template.js.map +1 -1
- package/package.json +1 -1
- package/src/metadata/buildPackageFile.ts +3 -4
- package/src/static/pollingContent.ts +25 -6
- package/src/test/template.ts +0 -2
- package/types/static/pollingContent.d.ts +1 -1
- package/types/test/template.d.ts +1 -1
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
"packages/rlc-common/src/metadata/buildApiExtractorConfig.ts": "4bcc63b3551d923d2881adb015b23978a2539e14",
|
|
33
33
|
"packages/rlc-common/src/metadata/buildESLintConfig.ts": "b0530cba08bf5e29cc1d307b93363f66c1e6b81d",
|
|
34
34
|
"packages/rlc-common/src/metadata/buildLicenseFile.ts": "ce4083770e48d3b0dd670f7efc324a7fed10dac4",
|
|
35
|
-
"packages/rlc-common/src/metadata/buildPackageFile.ts": "
|
|
35
|
+
"packages/rlc-common/src/metadata/buildPackageFile.ts": "6b06070d1ce36719feb2ccaefd87d232306429b9",
|
|
36
36
|
"packages/rlc-common/src/metadata/buildReadmeFile.ts": "649510f75d04ba8438202b92b83a56d3d3206efe",
|
|
37
37
|
"packages/rlc-common/src/metadata/buildRollupConfig.ts": "56a0ac2b69266d8a3192981abc4c09fcde444634",
|
|
38
38
|
"packages/rlc-common/src/metadata/buildTsConfig.ts": "861d8af19f1e8658b7fef02b51c63d4f006c76f3",
|
|
39
39
|
"packages/rlc-common/src/static/paginateContent.ts": "48f146c05b7b803958dc1206680b7b6ce38010c5",
|
|
40
|
-
"packages/rlc-common/src/static/pollingContent.ts": "
|
|
40
|
+
"packages/rlc-common/src/static/pollingContent.ts": "c71c7c1b5916b44d4b7ac1a57b3bcdd77bf62a8b",
|
|
41
41
|
"packages/rlc-common/src/static/serializeHelper.ts": "0ddb576015992208f824f0f06f5c5e7de019c26e",
|
|
42
42
|
"packages/rlc-common/src/test/buildEnvFile.ts": "4759b68f0216d2e060810b045baf47b6d5ecf849",
|
|
43
43
|
"packages/rlc-common/src/test/buildKarmaConfig.ts": "494c6a2b6621fe162d4e9c29706a4ceead343555",
|
|
44
44
|
"packages/rlc-common/src/test/buildRecordedClient.ts": "fb4b5bb7f98d42fe15dd040a8ddbdf2b00a7cebe",
|
|
45
45
|
"packages/rlc-common/src/test/buildSampleTest.ts": "5a96d955be175e1f2d38caaafd8c5d6d3410256e",
|
|
46
|
-
"packages/rlc-common/src/test/template.ts": "
|
|
46
|
+
"packages/rlc-common/src/test/template.ts": "a7244e9cdff9273ffe825f3e56546b5a04f23d50",
|
|
47
47
|
"packages/rlc-common/tsconfig-cjs.json": "dc2e21bca1015edfa25099555abdf3ee2266c7da",
|
|
48
48
|
"packages/rlc-common/tsconfig-common.json": "84c874d137a56103d2fa8b5ab33744e25540874c",
|
|
49
49
|
"packages/rlc-common/tsconfig.json": "2ce338052b40a33cef04fa132458b8630ae1a809"
|
|
@@ -104,7 +104,8 @@ function restLevelPackage(model, hasSamplesGenerated) {
|
|
|
104
104
|
dependencies: Object.assign(Object.assign({ "@azure/core-auth": "^1.3.0", "@azure-rest/core-client": "1.0.0-beta.10", "@azure/core-rest-pipeline": "^1.8.0", "@azure/logger": "^1.0.0", tslib: "^2.2.0" }, (hasPaging && {
|
|
105
105
|
"@azure/core-paging": "^1.2.0"
|
|
106
106
|
})), (hasLRO && {
|
|
107
|
-
"@azure/core-lro": "^2.
|
|
107
|
+
"@azure/core-lro": "^2.5.0",
|
|
108
|
+
"@azure/abort-controller": "^1.0.0"
|
|
108
109
|
})),
|
|
109
110
|
devDependencies: {
|
|
110
111
|
"@microsoft/api-extractor": "^7.31.1",
|
|
@@ -113,7 +114,7 @@ function restLevelPackage(model, hasSamplesGenerated) {
|
|
|
113
114
|
dotenv: "^16.0.0",
|
|
114
115
|
eslint: "^8.0.0",
|
|
115
116
|
mkdirp: "^2.1.2",
|
|
116
|
-
prettier: "2.
|
|
117
|
+
prettier: "^2.5.1",
|
|
117
118
|
rimraf: "^3.0.0",
|
|
118
119
|
"source-map-support": "^0.5.9",
|
|
119
120
|
typescript: "~4.8.0"
|
|
@@ -169,10 +170,8 @@ function restLevelPackage(model, hasSamplesGenerated) {
|
|
|
169
170
|
packageInfo.devDependencies["cross-env"] = "^7.0.2";
|
|
170
171
|
packageInfo.devDependencies["karma-chrome-launcher"] = "^3.0.0";
|
|
171
172
|
packageInfo.devDependencies["karma-coverage"] = "^2.0.0";
|
|
172
|
-
packageInfo.devDependencies["karma-edge-launcher"] = "^0.4.2";
|
|
173
173
|
packageInfo.devDependencies["karma-env-preprocessor"] = "^0.1.1";
|
|
174
174
|
packageInfo.devDependencies["karma-firefox-launcher"] = "^1.1.0";
|
|
175
|
-
packageInfo.devDependencies["karma-ie-launcher"] = "^1.0.0";
|
|
176
175
|
packageInfo.devDependencies["karma-junit-reporter"] = "^2.0.1";
|
|
177
176
|
packageInfo.devDependencies["karma-mocha-reporter"] = "^2.2.5";
|
|
178
177
|
packageInfo.devDependencies["karma-mocha"] = "^2.0.1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildPackageFile.js","sourceRoot":"","sources":["../../src/metadata/buildPackageFile.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,uCAAmC;AACnC,wEAGwC;AAGxC,IAAI,SAAS,GAAG,KAAK,CAA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,CAAC,GAAG;YACrC,WAAW,EAAE,MAAA,MAAA,KAAK,CAAC,OAAO,CAAC,WAAW,0CAAE,KAAK,mCAAI,KAAK,CAAC,WAAW;YAClE,YAAY,EAAE,CAAC,OAAO,CAAC;YACvB,aAAa,EAAE,IAAI;YACnB,UAAU,EAAE,6CAA6C,iBAAiB,GAAG,uBAAuB,EAAE;SACvG,CAAC;QACF,IAAI,aAAa,EAAE;YACjB,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC;gBACpC,kCAAkC,CAAC;SACtC;KACF;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,SAAS,oBAAoB,CAC3B,YAAsB,EACtB,cAAwB;IAExB,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,YAAY,EAAE;QAChB,IAAI,GAAG,IAAI,GAAG,iBAAiB,CAAC;KACjC;IACD,IAAI,cAAc,EAAE;QAClB,IAAI,GAAG,IAAI,GAAG,wBAAwB,CAAC;KACxC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,kBAAkB,CAAC,YAAsB;IAChD,OAAO,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.pollingContent = void 0;
|
|
4
4
|
exports.pollingContent = `
|
|
5
5
|
import { Client, HttpResponse } from "@azure-rest/core-client";
|
|
6
|
+
{{#if useLegacyLro}}
|
|
6
7
|
import {
|
|
7
8
|
LongRunningOperation,
|
|
8
9
|
LroEngine,
|
|
@@ -11,7 +12,16 @@ import {
|
|
|
11
12
|
PollerLike,
|
|
12
13
|
PollOperationState
|
|
13
14
|
} from "@azure/core-lro";
|
|
14
|
-
|
|
15
|
+
{{else}}
|
|
16
|
+
import {
|
|
17
|
+
CreateHttpPollerOptions,
|
|
18
|
+
LongRunningOperation,
|
|
19
|
+
LroResponse,
|
|
20
|
+
OperationState,
|
|
21
|
+
SimplePollerLike,
|
|
22
|
+
createHttpPoller
|
|
23
|
+
} from "@azure/core-lro";
|
|
24
|
+
{{/if}}
|
|
15
25
|
/**
|
|
16
26
|
* Helper function that builds a Poller object to help polling a long running operation.
|
|
17
27
|
* @param client - Client to use for sending the request to get additional pages.
|
|
@@ -19,12 +29,17 @@ import {
|
|
|
19
29
|
* @param options - Options to set a resume state or custom polling interval.
|
|
20
30
|
* @returns - A poller object to poll for operation state updates and eventually get the final response.
|
|
21
31
|
*/
|
|
22
|
-
export function getLongRunningPoller<TResult extends HttpResponse>(
|
|
32
|
+
export {{#unless useLegacyLro}}async {{/unless}}function getLongRunningPoller<TResult extends HttpResponse>(
|
|
23
33
|
client: Client,
|
|
24
34
|
initialResponse: TResult,
|
|
35
|
+
{{#if useLegacyLro}}
|
|
25
36
|
options: LroEngineOptions<TResult, PollOperationState<TResult>> = {}
|
|
26
|
-
): PollerLike<PollOperationState<TResult>, TResult> {
|
|
27
|
-
|
|
37
|
+
): PollerLike<PollOperationState<TResult>, TResult> {
|
|
38
|
+
{{else}}
|
|
39
|
+
options: CreateHttpPollerOptions<TResult, OperationState<TResult>> = {}
|
|
40
|
+
): Promise<SimplePollerLike<OperationState<TResult>, TResult>> {
|
|
41
|
+
{{/if}}
|
|
42
|
+
const poller: LongRunningOperation<TResult> = {
|
|
28
43
|
requestMethod: initialResponse.request.method,
|
|
29
44
|
requestPath: initialResponse.request.url,
|
|
30
45
|
sendInitialRequest: async () => {
|
|
@@ -48,13 +63,17 @@ export function getLongRunningPoller<TResult extends HttpResponse>(
|
|
|
48
63
|
}
|
|
49
64
|
};
|
|
50
65
|
|
|
66
|
+
{{#if useLegacyLro}}
|
|
51
67
|
return new LroEngine(poller, options);
|
|
68
|
+
{{else}}
|
|
69
|
+
return await createHttpPoller(poller, options);
|
|
70
|
+
{{/if}}
|
|
52
71
|
}
|
|
53
72
|
|
|
54
73
|
/**
|
|
55
|
-
* Converts a Rest Client response to a response that the LRO
|
|
74
|
+
* Converts a Rest Client response to a response that the LRO implementation understands
|
|
56
75
|
* @param response - a rest client http response
|
|
57
|
-
* @returns - An LRO response that the LRO
|
|
76
|
+
* @returns - An LRO response that the LRO implementation understands
|
|
58
77
|
*/
|
|
59
78
|
function getLroResponse<TResult extends HttpResponse>(
|
|
60
79
|
response: TResult
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pollingContent.js","sourceRoot":"","sources":["../../src/static/pollingContent.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG
|
|
1
|
+
{"version":3,"file":"pollingContent.js","sourceRoot":"","sources":["../../src/static/pollingContent.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4F7B,CAAC"}
|
package/dist/test/template.js
CHANGED
|
@@ -31,9 +31,7 @@ module.exports = function (config) {
|
|
|
31
31
|
"karma-mocha",
|
|
32
32
|
"karma-mocha-reporter",
|
|
33
33
|
"karma-chrome-launcher",
|
|
34
|
-
"karma-edge-launcher",
|
|
35
34
|
"karma-firefox-launcher",
|
|
36
|
-
"karma-ie-launcher",
|
|
37
35
|
"karma-env-preprocessor",
|
|
38
36
|
"karma-coverage",
|
|
39
37
|
"karma-sourcemap-loader",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/test/template.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;;;;CAIzB,CAAC;AAEW,QAAA,iBAAiB,GAAG;;;;CAIhC,CAAC;AAEW,QAAA,WAAW,GAAG
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/test/template.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;;;;CAIzB,CAAC;AAEW,QAAA,iBAAiB,GAAG;;;;CAIhC,CAAC;AAEW,QAAA,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8H1B,CAAC;AAEW,QAAA,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BpC,CAAC;AAEW,QAAA,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBhC,CAAC"}
|
|
@@ -105,7 +105,8 @@ function restLevelPackage(model, hasSamplesGenerated) {
|
|
|
105
105
|
"@azure/core-paging": "^1.2.0"
|
|
106
106
|
}),
|
|
107
107
|
...(hasLRO && {
|
|
108
|
-
"@azure/core-lro": "^2.
|
|
108
|
+
"@azure/core-lro": "^2.5.0",
|
|
109
|
+
"@azure/abort-controller": "^1.0.0"
|
|
109
110
|
})
|
|
110
111
|
},
|
|
111
112
|
devDependencies: {
|
|
@@ -115,7 +116,7 @@ function restLevelPackage(model, hasSamplesGenerated) {
|
|
|
115
116
|
dotenv: "^16.0.0",
|
|
116
117
|
eslint: "^8.0.0",
|
|
117
118
|
mkdirp: "^2.1.2",
|
|
118
|
-
prettier: "2.
|
|
119
|
+
prettier: "^2.5.1",
|
|
119
120
|
rimraf: "^3.0.0",
|
|
120
121
|
"source-map-support": "^0.5.9",
|
|
121
122
|
typescript: "~4.8.0"
|
|
@@ -171,10 +172,8 @@ function restLevelPackage(model, hasSamplesGenerated) {
|
|
|
171
172
|
packageInfo.devDependencies["cross-env"] = "^7.0.2";
|
|
172
173
|
packageInfo.devDependencies["karma-chrome-launcher"] = "^3.0.0";
|
|
173
174
|
packageInfo.devDependencies["karma-coverage"] = "^2.0.0";
|
|
174
|
-
packageInfo.devDependencies["karma-edge-launcher"] = "^0.4.2";
|
|
175
175
|
packageInfo.devDependencies["karma-env-preprocessor"] = "^0.1.1";
|
|
176
176
|
packageInfo.devDependencies["karma-firefox-launcher"] = "^1.1.0";
|
|
177
|
-
packageInfo.devDependencies["karma-ie-launcher"] = "^1.0.0";
|
|
178
177
|
packageInfo.devDependencies["karma-junit-reporter"] = "^2.0.1";
|
|
179
178
|
packageInfo.devDependencies["karma-mocha-reporter"] = "^2.2.5";
|
|
180
179
|
packageInfo.devDependencies["karma-mocha"] = "^2.0.1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildPackageFile.js","sourceRoot":"","sources":["../../src/metadata/buildPackageFile.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,gCAAgC,CAAC;AAGxC,IAAI,SAAS,GAAG,KAAK,CAAC;AACtB,IAAI,MAAM,GAAG,KAAK,CAAC;AACnB,MAAM,UAAU,gBAAgB,CAAC,KAAe,EAAE,mBAAmB,GAAG,KAAK;IAC3E,MAAM,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IAClE,IAAI,CAAC,gBAAgB,EAAE;QACrB,OAAO;KACR;IACD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,cAAc,CAAC;IAChC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;IACzE,0CAA0C;IAC1C,IAAI,CAAC,mBAAmB,EAAE;QACxB,OAAO;KACR;IAED,MAAM,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAC1C,QAAQ,EACR,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,EACnC;QACE,SAAS,EAAE,IAAI;KAChB,CACF,CAAC;IACF,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,WAAW,CAAC,WAAW,EAAE;KACnC,CAAC;AACJ,CAAC;AAED;;;GAG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AAO,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const pollingContent = `
|
|
2
2
|
import { Client, HttpResponse } from "@azure-rest/core-client";
|
|
3
|
+
{{#if useLegacyLro}}
|
|
3
4
|
import {
|
|
4
5
|
LongRunningOperation,
|
|
5
6
|
LroEngine,
|
|
@@ -8,7 +9,16 @@ import {
|
|
|
8
9
|
PollerLike,
|
|
9
10
|
PollOperationState
|
|
10
11
|
} from "@azure/core-lro";
|
|
11
|
-
|
|
12
|
+
{{else}}
|
|
13
|
+
import {
|
|
14
|
+
CreateHttpPollerOptions,
|
|
15
|
+
LongRunningOperation,
|
|
16
|
+
LroResponse,
|
|
17
|
+
OperationState,
|
|
18
|
+
SimplePollerLike,
|
|
19
|
+
createHttpPoller
|
|
20
|
+
} from "@azure/core-lro";
|
|
21
|
+
{{/if}}
|
|
12
22
|
/**
|
|
13
23
|
* Helper function that builds a Poller object to help polling a long running operation.
|
|
14
24
|
* @param client - Client to use for sending the request to get additional pages.
|
|
@@ -16,12 +26,17 @@ import {
|
|
|
16
26
|
* @param options - Options to set a resume state or custom polling interval.
|
|
17
27
|
* @returns - A poller object to poll for operation state updates and eventually get the final response.
|
|
18
28
|
*/
|
|
19
|
-
export function getLongRunningPoller<TResult extends HttpResponse>(
|
|
29
|
+
export {{#unless useLegacyLro}}async {{/unless}}function getLongRunningPoller<TResult extends HttpResponse>(
|
|
20
30
|
client: Client,
|
|
21
31
|
initialResponse: TResult,
|
|
32
|
+
{{#if useLegacyLro}}
|
|
22
33
|
options: LroEngineOptions<TResult, PollOperationState<TResult>> = {}
|
|
23
|
-
): PollerLike<PollOperationState<TResult>, TResult> {
|
|
24
|
-
|
|
34
|
+
): PollerLike<PollOperationState<TResult>, TResult> {
|
|
35
|
+
{{else}}
|
|
36
|
+
options: CreateHttpPollerOptions<TResult, OperationState<TResult>> = {}
|
|
37
|
+
): Promise<SimplePollerLike<OperationState<TResult>, TResult>> {
|
|
38
|
+
{{/if}}
|
|
39
|
+
const poller: LongRunningOperation<TResult> = {
|
|
25
40
|
requestMethod: initialResponse.request.method,
|
|
26
41
|
requestPath: initialResponse.request.url,
|
|
27
42
|
sendInitialRequest: async () => {
|
|
@@ -45,13 +60,17 @@ export function getLongRunningPoller<TResult extends HttpResponse>(
|
|
|
45
60
|
}
|
|
46
61
|
};
|
|
47
62
|
|
|
63
|
+
{{#if useLegacyLro}}
|
|
48
64
|
return new LroEngine(poller, options);
|
|
65
|
+
{{else}}
|
|
66
|
+
return await createHttpPoller(poller, options);
|
|
67
|
+
{{/if}}
|
|
49
68
|
}
|
|
50
69
|
|
|
51
70
|
/**
|
|
52
|
-
* Converts a Rest Client response to a response that the LRO
|
|
71
|
+
* Converts a Rest Client response to a response that the LRO implementation understands
|
|
53
72
|
* @param response - a rest client http response
|
|
54
|
-
* @returns - An LRO response that the LRO
|
|
73
|
+
* @returns - An LRO response that the LRO implementation understands
|
|
55
74
|
*/
|
|
56
75
|
function getLroResponse<TResult extends HttpResponse>(
|
|
57
76
|
response: TResult
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pollingContent.js","sourceRoot":"","sources":["../../src/static/pollingContent.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG
|
|
1
|
+
{"version":3,"file":"pollingContent.js","sourceRoot":"","sources":["../../src/static/pollingContent.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4F7B,CAAC"}
|
|
@@ -28,9 +28,7 @@ module.exports = function (config) {
|
|
|
28
28
|
"karma-mocha",
|
|
29
29
|
"karma-mocha-reporter",
|
|
30
30
|
"karma-chrome-launcher",
|
|
31
|
-
"karma-edge-launcher",
|
|
32
31
|
"karma-firefox-launcher",
|
|
33
|
-
"karma-ie-launcher",
|
|
34
32
|
"karma-env-preprocessor",
|
|
35
33
|
"karma-coverage",
|
|
36
34
|
"karma-sourcemap-loader",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/test/template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;;;;CAIzB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;CAIhC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/test/template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;;;;CAIzB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;CAIhC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8H1B,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BpC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBhC,CAAC"}
|
package/package.json
CHANGED
|
@@ -141,7 +141,8 @@ function restLevelPackage(model: RLCModel, hasSamplesGenerated: boolean) {
|
|
|
141
141
|
"@azure/core-paging": "^1.2.0"
|
|
142
142
|
}),
|
|
143
143
|
...(hasLRO && {
|
|
144
|
-
"@azure/core-lro": "^2.
|
|
144
|
+
"@azure/core-lro": "^2.5.0",
|
|
145
|
+
"@azure/abort-controller": "^1.0.0"
|
|
145
146
|
})
|
|
146
147
|
},
|
|
147
148
|
devDependencies: {
|
|
@@ -151,7 +152,7 @@ function restLevelPackage(model: RLCModel, hasSamplesGenerated: boolean) {
|
|
|
151
152
|
dotenv: "^16.0.0",
|
|
152
153
|
eslint: "^8.0.0",
|
|
153
154
|
mkdirp: "^2.1.2",
|
|
154
|
-
prettier: "2.
|
|
155
|
+
prettier: "^2.5.1",
|
|
155
156
|
rimraf: "^3.0.0",
|
|
156
157
|
"source-map-support": "^0.5.9",
|
|
157
158
|
typescript: "~4.8.0"
|
|
@@ -212,10 +213,8 @@ function restLevelPackage(model: RLCModel, hasSamplesGenerated: boolean) {
|
|
|
212
213
|
packageInfo.devDependencies["cross-env"] = "^7.0.2";
|
|
213
214
|
packageInfo.devDependencies["karma-chrome-launcher"] = "^3.0.0";
|
|
214
215
|
packageInfo.devDependencies["karma-coverage"] = "^2.0.0";
|
|
215
|
-
packageInfo.devDependencies["karma-edge-launcher"] = "^0.4.2";
|
|
216
216
|
packageInfo.devDependencies["karma-env-preprocessor"] = "^0.1.1";
|
|
217
217
|
packageInfo.devDependencies["karma-firefox-launcher"] = "^1.1.0";
|
|
218
|
-
packageInfo.devDependencies["karma-ie-launcher"] = "^1.0.0";
|
|
219
218
|
packageInfo.devDependencies["karma-junit-reporter"] = "^2.0.1";
|
|
220
219
|
packageInfo.devDependencies["karma-mocha-reporter"] = "^2.2.5";
|
|
221
220
|
packageInfo.devDependencies["karma-mocha"] = "^2.0.1";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const pollingContent = `
|
|
2
2
|
import { Client, HttpResponse } from "@azure-rest/core-client";
|
|
3
|
+
{{#if useLegacyLro}}
|
|
3
4
|
import {
|
|
4
5
|
LongRunningOperation,
|
|
5
6
|
LroEngine,
|
|
@@ -8,7 +9,16 @@ import {
|
|
|
8
9
|
PollerLike,
|
|
9
10
|
PollOperationState
|
|
10
11
|
} from "@azure/core-lro";
|
|
11
|
-
|
|
12
|
+
{{else}}
|
|
13
|
+
import {
|
|
14
|
+
CreateHttpPollerOptions,
|
|
15
|
+
LongRunningOperation,
|
|
16
|
+
LroResponse,
|
|
17
|
+
OperationState,
|
|
18
|
+
SimplePollerLike,
|
|
19
|
+
createHttpPoller
|
|
20
|
+
} from "@azure/core-lro";
|
|
21
|
+
{{/if}}
|
|
12
22
|
/**
|
|
13
23
|
* Helper function that builds a Poller object to help polling a long running operation.
|
|
14
24
|
* @param client - Client to use for sending the request to get additional pages.
|
|
@@ -16,12 +26,17 @@ import {
|
|
|
16
26
|
* @param options - Options to set a resume state or custom polling interval.
|
|
17
27
|
* @returns - A poller object to poll for operation state updates and eventually get the final response.
|
|
18
28
|
*/
|
|
19
|
-
export function getLongRunningPoller<TResult extends HttpResponse>(
|
|
29
|
+
export {{#unless useLegacyLro}}async {{/unless}}function getLongRunningPoller<TResult extends HttpResponse>(
|
|
20
30
|
client: Client,
|
|
21
31
|
initialResponse: TResult,
|
|
32
|
+
{{#if useLegacyLro}}
|
|
22
33
|
options: LroEngineOptions<TResult, PollOperationState<TResult>> = {}
|
|
23
|
-
): PollerLike<PollOperationState<TResult>, TResult> {
|
|
24
|
-
|
|
34
|
+
): PollerLike<PollOperationState<TResult>, TResult> {
|
|
35
|
+
{{else}}
|
|
36
|
+
options: CreateHttpPollerOptions<TResult, OperationState<TResult>> = {}
|
|
37
|
+
): Promise<SimplePollerLike<OperationState<TResult>, TResult>> {
|
|
38
|
+
{{/if}}
|
|
39
|
+
const poller: LongRunningOperation<TResult> = {
|
|
25
40
|
requestMethod: initialResponse.request.method,
|
|
26
41
|
requestPath: initialResponse.request.url,
|
|
27
42
|
sendInitialRequest: async () => {
|
|
@@ -45,13 +60,17 @@ export function getLongRunningPoller<TResult extends HttpResponse>(
|
|
|
45
60
|
}
|
|
46
61
|
};
|
|
47
62
|
|
|
63
|
+
{{#if useLegacyLro}}
|
|
48
64
|
return new LroEngine(poller, options);
|
|
65
|
+
{{else}}
|
|
66
|
+
return await createHttpPoller(poller, options);
|
|
67
|
+
{{/if}}
|
|
49
68
|
}
|
|
50
69
|
|
|
51
70
|
/**
|
|
52
|
-
* Converts a Rest Client response to a response that the LRO
|
|
71
|
+
* Converts a Rest Client response to a response that the LRO implementation understands
|
|
53
72
|
* @param response - a rest client http response
|
|
54
|
-
* @returns - An LRO response that the LRO
|
|
73
|
+
* @returns - An LRO response that the LRO implementation understands
|
|
55
74
|
*/
|
|
56
75
|
function getLroResponse<TResult extends HttpResponse>(
|
|
57
76
|
response: TResult
|
package/src/test/template.ts
CHANGED
|
@@ -30,9 +30,7 @@ module.exports = function (config) {
|
|
|
30
30
|
"karma-mocha",
|
|
31
31
|
"karma-mocha-reporter",
|
|
32
32
|
"karma-chrome-launcher",
|
|
33
|
-
"karma-edge-launcher",
|
|
34
33
|
"karma-firefox-launcher",
|
|
35
|
-
"karma-ie-launcher",
|
|
36
34
|
"karma-env-preprocessor",
|
|
37
35
|
"karma-coverage",
|
|
38
36
|
"karma-sourcemap-loader",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const pollingContent = "\nimport { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport {\n LongRunningOperation,\n LroEngine,\n LroEngineOptions,\n LroResponse,\n PollerLike,\n PollOperationState\n} from \"@azure/core-lro\";\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: LroEngineOptions<TResult, PollOperationState<TResult>> = {}\n): PollerLike<PollOperationState<TResult>, TResult> {\n const poller: LongRunningOperation<TResult> = {\n requestMethod: initialResponse.request.method,\n requestPath: initialResponse.request.url,\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async path => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n const response = await client\n .pathUnchecked(path ?? initialResponse.request.url)\n .get();\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] =\n initialResponse.request.url;\n return lroResponse;\n }\n };\n\n return new LroEngine(poller, options);\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO
|
|
1
|
+
export declare const pollingContent = "\nimport { Client, HttpResponse } from \"@azure-rest/core-client\";\n{{#if useLegacyLro}}\nimport {\n LongRunningOperation,\n LroEngine,\n LroEngineOptions,\n LroResponse,\n PollerLike,\n PollOperationState\n} from \"@azure/core-lro\";\n{{else}}\nimport {\n CreateHttpPollerOptions,\n LongRunningOperation,\n LroResponse,\n OperationState,\n SimplePollerLike,\n createHttpPoller\n} from \"@azure/core-lro\";\n{{/if}}\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport {{#unless useLegacyLro}}async {{/unless}}function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n {{#if useLegacyLro}}\n options: LroEngineOptions<TResult, PollOperationState<TResult>> = {}\n ): PollerLike<PollOperationState<TResult>, TResult> {\n {{else}}\n options: CreateHttpPollerOptions<TResult, OperationState<TResult>> = {}\n ): Promise<SimplePollerLike<OperationState<TResult>, TResult>> {\n {{/if}} \n const poller: LongRunningOperation<TResult> = {\n requestMethod: initialResponse.request.method,\n requestPath: initialResponse.request.url,\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async path => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n const response = await client\n .pathUnchecked(path ?? initialResponse.request.url)\n .get();\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] =\n initialResponse.request.url;\n return lroResponse;\n }\n };\n\n {{#if useLegacyLro}}\n return new LroEngine(poller, options);\n {{else}}\n return await createHttpPoller(poller, options);\n {{/if}}\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO implementation understands\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO implementation understands\n */\nfunction getLroResponse<TResult extends HttpResponse>(\n response: TResult\n): LroResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(\n `Status code of the response is not a number. Value: ${response.status}`\n );\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body\n }\n };\n}\n";
|
package/types/test/template.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const envContent = "\nimport * as dotenv from \"dotenv\";\n\ndotenv.config();\n";
|
|
2
2
|
export declare const envBrowserContent = "\nimport * as dotenv from \"dotenv\";\n\ndotenv.config();\n";
|
|
3
|
-
export declare const karmaConfig = "\n// https://github.com/karma-runner/karma-chrome-launcher\nprocess.env.CHROME_BIN = require(\"puppeteer\").executablePath();\nrequire(\"dotenv\").config();\nconst { relativeRecordingsPath } = require(\"@azure-tools/test-recorder\");\nprocess.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath();\n\nmodule.exports = function (config) {\n config.set({\n // base path that will be used to resolve all patterns (eg. files, exclude)\n basePath: \"./\",\n\n // frameworks to use\n // available frameworks: https://npmjs.org/browse/keyword/karma-adapter\n frameworks: [\"source-map-support\", \"mocha\"],\n\n plugins: [\n \"karma-mocha\",\n \"karma-mocha-reporter\",\n \"karma-chrome-launcher\",\n \"karma-
|
|
3
|
+
export declare const karmaConfig = "\n// https://github.com/karma-runner/karma-chrome-launcher\nprocess.env.CHROME_BIN = require(\"puppeteer\").executablePath();\nrequire(\"dotenv\").config();\nconst { relativeRecordingsPath } = require(\"@azure-tools/test-recorder\");\nprocess.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath();\n\nmodule.exports = function (config) {\n config.set({\n // base path that will be used to resolve all patterns (eg. files, exclude)\n basePath: \"./\",\n\n // frameworks to use\n // available frameworks: https://npmjs.org/browse/keyword/karma-adapter\n frameworks: [\"source-map-support\", \"mocha\"],\n\n plugins: [\n \"karma-mocha\",\n \"karma-mocha-reporter\",\n \"karma-chrome-launcher\",\n \"karma-firefox-launcher\",\n \"karma-env-preprocessor\",\n \"karma-coverage\",\n \"karma-sourcemap-loader\",\n \"karma-junit-reporter\",\n \"karma-source-map-support\",\n ],\n\n // list of files / patterns to load in the browser\n files: [\n \"dist-test/index.browser.js\",\n { pattern: \"dist-test/index.browser.js.map\", type: \"html\", included: false, served: true },\n ],\n\n // list of files / patterns to exclude\n exclude: [],\n\n // preprocess matching files before serving them to the browser\n // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor\n preprocessors: {\n \"**/*.js\": [\"sourcemap\", \"env\"],\n // IMPORTANT: COMMENT following line if you want to debug in your browsers!!\n // Preprocess source file to calculate code coverage, however this will make source file unreadable\n // \"dist-test/index.js\": [\"coverage\"]\n },\n\n envPreprocessor: [\n \"TEST_MODE\",\n \"ENDPOINT\",\n \"AZURE_CLIENT_SECRET\",\n \"AZURE_CLIENT_ID\",\n \"AZURE_TENANT_ID\",\n \"SUBSCRIPTION_ID\",\n \"RECORDINGS_RELATIVE_PATH\",\n ],\n\n // test results reporter to use\n // possible values: 'dots', 'progress'\n // available reporters: https://npmjs.org/browse/keyword/karma-reporter\n reporters: [\"mocha\", \"coverage\", \"junit\"],\n\n coverageReporter: {\n // specify a common output directory\n dir: \"coverage-browser/\",\n reporters: [\n { type: \"json\", subdir: \".\", file: \"coverage.json\" },\n { type: \"lcovonly\", subdir: \".\", file: \"lcov.info\" },\n { type: \"html\", subdir: \"html\" },\n { type: \"cobertura\", subdir: \".\", file: \"cobertura-coverage.xml\" },\n ],\n },\n\n junitReporter: {\n outputDir: \"\", // results will be saved as $outputDir/$browserName.xml\n outputFile: \"test-results.browser.xml\", // if included, results will be saved as $outputDir/$browserName/$outputFile\n suite: \"\", // suite will become the package name attribute in xml testsuite element\n useBrowserName: false, // add browser name to report and classes names\n nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element\n classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element\n properties: {}, // key value pair of properties to add to the <properties> section of the report\n },\n\n // web server port\n port: 9876,\n\n // enable / disable colors in the output (reporters and logs)\n colors: true,\n\n // level of logging\n // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG\n logLevel: config.LOG_INFO,\n\n // enable / disable watching file and executing tests whenever any file changes\n autoWatch: false,\n\n // --no-sandbox allows our tests to run in Linux without having to change the system.\n // --disable-web-security allows us to authenticate from the browser without having to write tests using interactive auth, which would be far more complex.\n browsers: [\"ChromeHeadlessNoSandbox\"],\n customLaunchers: {\n ChromeHeadlessNoSandbox: {\n base: \"ChromeHeadless\",\n flags: [\"--no-sandbox\", \"--disable-web-security\"],\n },\n },\n\n // Continuous Integration mode\n // if true, Karma captures browsers, runs the tests and exits\n singleRun: false,\n\n // Concurrency level\n // how many browser should be started simultaneous\n concurrency: 1,\n\n browserNoActivityTimeout: 60000000,\n browserDisconnectTimeout: 10000,\n browserDisconnectTolerance: 3,\n\n client: {\n mocha: {\n // change Karma's debug.html to the mocha web reporter\n reporter: \"html\",\n timeout: \"600000\",\n },\n },\n });\n};\n";
|
|
4
4
|
export declare const recordedClientContent = "\nimport { Context } from \"mocha\";\nimport { Recorder, RecorderStartOptions } from \"@azure-tools/test-recorder\";\nimport \"./env\";\n\nconst envSetupForPlayback: Record<string, string> = {\n ENDPOINT: \"https://endpoint\",\n AZURE_CLIENT_ID: \"azure_client_id\",\n AZURE_CLIENT_SECRET: \"azure_client_secret\",\n AZURE_TENANT_ID: \"88888888-8888-8888-8888-888888888888\",\n SUBSCRIPTION_ID: \"azure_subscription_id\"\n};\n\nconst recorderEnvSetup: RecorderStartOptions = {\n envSetupForPlayback\n};\n\n/**\n* creates the recorder and reads the environment variables from the `.env` file.\n* Should be called first in the test suite to make sure environment variables are\n* read before they are being used.\n*/\nexport async function createRecorder(context: Context): Promise<Recorder> {\n const recorder = new Recorder(context.currentTest);\n await recorder.start(recorderEnvSetup);\n return recorder;\n}\n";
|
|
5
5
|
export declare const sampleTestContent = "\nimport { Recorder } from \"@azure-tools/test-recorder\";\nimport { assert } from \"chai\";\nimport { createRecorder } from \"./utils/recordedClient\";\nimport { Context } from \"mocha\";\n\ndescribe(\"My test\", () => {\n let recorder: Recorder;\n\n beforeEach(async function(this: Context) {\n recorder = await createRecorder(this);\n });\n\n afterEach(async function() {\n await recorder.stop();\n });\n\n it(\"sample test\", async function() {\n assert.equal(1, 1);\n });\n});\n";
|