@azure/arm-devhub 1.0.0-beta.1 → 1.0.0-beta.2
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/CHANGELOG.md +7 -0
- package/LICENSE +1 -1
- package/dist/index.js +73 -23
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/samples-dev/gitHubOAuthCallbackSample.js +9 -2
- package/dist-esm/samples-dev/gitHubOAuthCallbackSample.js.map +1 -1
- package/dist-esm/samples-dev/gitHubOAuthSample.js +9 -2
- package/dist-esm/samples-dev/gitHubOAuthSample.js.map +1 -1
- package/dist-esm/samples-dev/listGitHubOAuthSample.js +9 -2
- package/dist-esm/samples-dev/listGitHubOAuthSample.js.map +1 -1
- package/dist-esm/samples-dev/operationsListSample.js +10 -2
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
- package/dist-esm/samples-dev/workflowCreateOrUpdateSample.js +10 -3
- package/dist-esm/samples-dev/workflowCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/workflowDeleteSample.js +10 -3
- package/dist-esm/samples-dev/workflowDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/workflowGetSample.js +10 -3
- package/dist-esm/samples-dev/workflowGetSample.js.map +1 -1
- package/dist-esm/samples-dev/workflowListByResourceGroupSample.js +10 -3
- package/dist-esm/samples-dev/workflowListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/workflowListSample.js +9 -2
- package/dist-esm/samples-dev/workflowListSample.js.map +1 -1
- package/dist-esm/samples-dev/workflowUpdateTagsSample.js +10 -3
- package/dist-esm/samples-dev/workflowUpdateTagsSample.js.map +1 -1
- package/dist-esm/src/developerHubServiceClient.d.ts.map +1 -1
- package/dist-esm/src/developerHubServiceClient.js +4 -7
- package/dist-esm/src/developerHubServiceClient.js.map +1 -1
- package/dist-esm/src/index.d.ts +1 -0
- package/dist-esm/src/index.d.ts.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +0 -2
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/operations/workflowOperations.d.ts.map +1 -1
- package/dist-esm/src/operations/workflowOperations.js +37 -16
- package/dist-esm/src/operations/workflowOperations.js.map +1 -1
- package/dist-esm/src/pagingHelper.d.ts +13 -0
- package/dist-esm/src/pagingHelper.d.ts.map +1 -0
- package/dist-esm/src/pagingHelper.js +32 -0
- package/dist-esm/src/pagingHelper.js.map +1 -0
- package/package.json +7 -6
- package/review/arm-devhub.api.md +3 -1
- package/src/developerHubServiceClient.ts +5 -6
- package/src/index.ts +1 -0
- package/src/models/index.ts +1 -4
- package/src/operations/workflowOperations.ts +45 -18
- package/src/pagingHelper.ts +39 -0
- package/types/arm-devhub.d.ts +9 -2
- package/types/tsdoc-metadata.json +1 -1
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
9
|
+
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
|
10
|
+
import { setContinuationToken } from "../pagingHelper";
|
|
10
11
|
import { WorkflowOperations } from "../operationsInterfaces";
|
|
11
12
|
import * as coreClient from "@azure/core-client";
|
|
12
13
|
import * as Mappers from "../models/mappers";
|
|
@@ -16,9 +17,9 @@ import {
|
|
|
16
17
|
Workflow,
|
|
17
18
|
WorkflowListNextOptionalParams,
|
|
18
19
|
WorkflowListOptionalParams,
|
|
20
|
+
WorkflowListResponse,
|
|
19
21
|
WorkflowListByResourceGroupNextOptionalParams,
|
|
20
22
|
WorkflowListByResourceGroupOptionalParams,
|
|
21
|
-
WorkflowListResponse,
|
|
22
23
|
WorkflowListByResourceGroupResponse,
|
|
23
24
|
WorkflowGetOptionalParams,
|
|
24
25
|
WorkflowGetResponse,
|
|
@@ -61,22 +62,34 @@ export class WorkflowOperationsImpl implements WorkflowOperations {
|
|
|
61
62
|
[Symbol.asyncIterator]() {
|
|
62
63
|
return this;
|
|
63
64
|
},
|
|
64
|
-
byPage: () => {
|
|
65
|
-
|
|
65
|
+
byPage: (settings?: PageSettings) => {
|
|
66
|
+
if (settings?.maxPageSize) {
|
|
67
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
68
|
+
}
|
|
69
|
+
return this.listPagingPage(options, settings);
|
|
66
70
|
}
|
|
67
71
|
};
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
private async *listPagingPage(
|
|
71
|
-
options?: WorkflowListOptionalParams
|
|
75
|
+
options?: WorkflowListOptionalParams,
|
|
76
|
+
settings?: PageSettings
|
|
72
77
|
): AsyncIterableIterator<Workflow[]> {
|
|
73
|
-
let result
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
let result: WorkflowListResponse;
|
|
79
|
+
let continuationToken = settings?.continuationToken;
|
|
80
|
+
if (!continuationToken) {
|
|
81
|
+
result = await this._list(options);
|
|
82
|
+
let page = result.value || [];
|
|
83
|
+
continuationToken = result.nextLink;
|
|
84
|
+
setContinuationToken(page, continuationToken);
|
|
85
|
+
yield page;
|
|
86
|
+
}
|
|
76
87
|
while (continuationToken) {
|
|
77
88
|
result = await this._listNext(continuationToken, options);
|
|
78
89
|
continuationToken = result.nextLink;
|
|
79
|
-
|
|
90
|
+
let page = result.value || [];
|
|
91
|
+
setContinuationToken(page, continuationToken);
|
|
92
|
+
yield page;
|
|
80
93
|
}
|
|
81
94
|
}
|
|
82
95
|
|
|
@@ -105,19 +118,33 @@ export class WorkflowOperationsImpl implements WorkflowOperations {
|
|
|
105
118
|
[Symbol.asyncIterator]() {
|
|
106
119
|
return this;
|
|
107
120
|
},
|
|
108
|
-
byPage: () => {
|
|
109
|
-
|
|
121
|
+
byPage: (settings?: PageSettings) => {
|
|
122
|
+
if (settings?.maxPageSize) {
|
|
123
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
|
124
|
+
}
|
|
125
|
+
return this.listByResourceGroupPagingPage(
|
|
126
|
+
resourceGroupName,
|
|
127
|
+
options,
|
|
128
|
+
settings
|
|
129
|
+
);
|
|
110
130
|
}
|
|
111
131
|
};
|
|
112
132
|
}
|
|
113
133
|
|
|
114
134
|
private async *listByResourceGroupPagingPage(
|
|
115
135
|
resourceGroupName: string,
|
|
116
|
-
options?: WorkflowListByResourceGroupOptionalParams
|
|
136
|
+
options?: WorkflowListByResourceGroupOptionalParams,
|
|
137
|
+
settings?: PageSettings
|
|
117
138
|
): AsyncIterableIterator<Workflow[]> {
|
|
118
|
-
let result
|
|
119
|
-
|
|
120
|
-
|
|
139
|
+
let result: WorkflowListByResourceGroupResponse;
|
|
140
|
+
let continuationToken = settings?.continuationToken;
|
|
141
|
+
if (!continuationToken) {
|
|
142
|
+
result = await this._listByResourceGroup(resourceGroupName, options);
|
|
143
|
+
let page = result.value || [];
|
|
144
|
+
continuationToken = result.nextLink;
|
|
145
|
+
setContinuationToken(page, continuationToken);
|
|
146
|
+
yield page;
|
|
147
|
+
}
|
|
121
148
|
while (continuationToken) {
|
|
122
149
|
result = await this._listByResourceGroupNext(
|
|
123
150
|
resourceGroupName,
|
|
@@ -125,7 +152,9 @@ export class WorkflowOperationsImpl implements WorkflowOperations {
|
|
|
125
152
|
options
|
|
126
153
|
);
|
|
127
154
|
continuationToken = result.nextLink;
|
|
128
|
-
|
|
155
|
+
let page = result.value || [];
|
|
156
|
+
setContinuationToken(page, continuationToken);
|
|
157
|
+
yield page;
|
|
129
158
|
}
|
|
130
159
|
}
|
|
131
160
|
|
|
@@ -417,7 +446,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
|
|
|
417
446
|
bodyMapper: Mappers.ErrorResponse
|
|
418
447
|
}
|
|
419
448
|
},
|
|
420
|
-
queryParameters: [Parameters.apiVersion],
|
|
421
449
|
urlParameters: [
|
|
422
450
|
Parameters.$host,
|
|
423
451
|
Parameters.subscriptionId,
|
|
@@ -437,7 +465,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
|
|
|
437
465
|
bodyMapper: Mappers.ErrorResponse
|
|
438
466
|
}
|
|
439
467
|
},
|
|
440
|
-
queryParameters: [Parameters.apiVersion, Parameters.managedClusterResource],
|
|
441
468
|
urlParameters: [
|
|
442
469
|
Parameters.$host,
|
|
443
470
|
Parameters.subscriptionId,
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
export interface PageInfo {
|
|
10
|
+
continuationToken?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const pageMap = new WeakMap<object, PageInfo>();
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Given the last `.value` produced by the `byPage` iterator,
|
|
17
|
+
* returns a continuation token that can be used to begin paging from
|
|
18
|
+
* that point later.
|
|
19
|
+
* @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
|
|
20
|
+
* @returns The continuation token that can be passed into byPage() during future calls.
|
|
21
|
+
*/
|
|
22
|
+
export function getContinuationToken(page: unknown): string | undefined {
|
|
23
|
+
if (typeof page !== "object" || page === null) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
return pageMap.get(page)?.continuationToken;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function setContinuationToken(
|
|
30
|
+
page: unknown,
|
|
31
|
+
continuationToken: string | undefined
|
|
32
|
+
): void {
|
|
33
|
+
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const pageInfo = pageMap.get(page) ?? {};
|
|
37
|
+
pageInfo.continuationToken = continuationToken;
|
|
38
|
+
pageMap.set(page, pageInfo);
|
|
39
|
+
}
|
package/types/arm-devhub.d.ts
CHANGED
|
@@ -151,6 +151,15 @@ export declare interface ErrorResponse {
|
|
|
151
151
|
error?: ErrorDetail;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
/**
|
|
155
|
+
* Given the last `.value` produced by the `byPage` iterator,
|
|
156
|
+
* returns a continuation token that can be used to begin paging from
|
|
157
|
+
* that point later.
|
|
158
|
+
* @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
|
|
159
|
+
* @returns The continuation token that can be passed into byPage() during future calls.
|
|
160
|
+
*/
|
|
161
|
+
export declare function getContinuationToken(page: unknown): string | undefined;
|
|
162
|
+
|
|
154
163
|
/** Optional parameters. */
|
|
155
164
|
export declare interface GitHubOAuthCallbackOptionalParams extends coreClient.OperationOptions {
|
|
156
165
|
}
|
|
@@ -495,8 +504,6 @@ export declare type WorkflowGetResponse = Workflow;
|
|
|
495
504
|
|
|
496
505
|
/** Optional parameters. */
|
|
497
506
|
export declare interface WorkflowListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
|
|
498
|
-
/** The ManagedCluster resource associated with the workflows. */
|
|
499
|
-
managedClusterResource?: string;
|
|
500
507
|
}
|
|
501
508
|
|
|
502
509
|
/** Contains response data for the listByResourceGroupNext operation. */
|