@typespec/http-client-js 0.4.0-dev.1 → 0.4.0-dev.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.
- package/CHANGELOG.md +0 -1
- package/dist/src/components/client-context/client-context-factory.js +1 -1
- package/dist/src/components/client-context/client-context-factory.js.map +1 -1
- package/dist/src/components/client-operation.d.ts +4 -1
- package/dist/src/components/client-operation.d.ts.map +1 -1
- package/dist/src/components/client-operation.js +68 -38
- package/dist/src/components/client-operation.js.map +1 -1
- package/dist/src/components/client.d.ts.map +1 -1
- package/dist/src/components/client.js +7 -4
- package/dist/src/components/client.js.map +1 -1
- package/dist/src/components/http-request-options.d.ts +5 -5
- package/dist/src/components/http-request-options.d.ts.map +1 -1
- package/dist/src/components/http-request-options.js +12 -12
- package/dist/src/components/http-request-options.js.map +1 -1
- package/dist/src/components/http-request-parameters-expression.d.ts +2 -1
- package/dist/src/components/http-request-parameters-expression.d.ts.map +1 -1
- package/dist/src/components/http-request-parameters-expression.js +125 -18
- package/dist/src/components/http-request-parameters-expression.js.map +1 -1
- package/dist/src/components/http-request.d.ts +3 -3
- package/dist/src/components/http-request.d.ts.map +1 -1
- package/dist/src/components/http-request.js +35 -30
- package/dist/src/components/http-request.js.map +1 -1
- package/dist/src/components/http-response.d.ts +3 -3
- package/dist/src/components/http-response.d.ts.map +1 -1
- package/dist/src/components/http-response.js +11 -6
- package/dist/src/components/http-response.js.map +1 -1
- package/dist/src/components/operation-handlers/index.d.ts +3 -0
- package/dist/src/components/operation-handlers/index.d.ts.map +1 -0
- package/dist/src/components/operation-handlers/index.js +3 -0
- package/dist/src/components/operation-handlers/index.js.map +1 -0
- package/dist/src/components/operation-handlers/operation-pipeline.d.ts +15 -0
- package/dist/src/components/operation-handlers/operation-pipeline.d.ts.map +1 -0
- package/dist/src/components/operation-handlers/operation-pipeline.js +28 -0
- package/dist/src/components/operation-handlers/operation-pipeline.js.map +1 -0
- package/dist/src/components/operation-handlers/paging/page-item.d.ts +3 -0
- package/dist/src/components/operation-handlers/paging/page-item.d.ts.map +1 -0
- package/dist/src/components/operation-handlers/paging/page-item.js +17 -0
- package/dist/src/components/operation-handlers/paging/page-item.js.map +1 -0
- package/dist/src/components/operation-handlers/paging/page-response.d.ts +10 -0
- package/dist/src/components/operation-handlers/paging/page-response.d.ts.map +1 -0
- package/dist/src/components/operation-handlers/paging/page-response.js +50 -0
- package/dist/src/components/operation-handlers/paging/page-response.js.map +1 -0
- package/dist/src/components/operation-handlers/paging/page-settings.d.ts +11 -0
- package/dist/src/components/operation-handlers/paging/page-settings.d.ts.map +1 -0
- package/dist/src/components/operation-handlers/paging/page-settings.js +52 -0
- package/dist/src/components/operation-handlers/paging/page-settings.js.map +1 -0
- package/dist/src/components/operation-handlers/paging/paginated-operation-handler.d.ts +3 -0
- package/dist/src/components/operation-handlers/paging/paginated-operation-handler.d.ts.map +1 -0
- package/dist/src/components/operation-handlers/paging/paginated-operation-handler.js +170 -0
- package/dist/src/components/operation-handlers/paging/paginated-operation-handler.js.map +1 -0
- package/dist/src/components/operation-handlers/paging/request-send.d.ts +12 -0
- package/dist/src/components/operation-handlers/paging/request-send.d.ts.map +1 -0
- package/dist/src/components/operation-handlers/paging/request-send.js +78 -0
- package/dist/src/components/operation-handlers/paging/request-send.js.map +1 -0
- package/dist/src/components/operation-handlers/paging/response-deserialize.d.ts +11 -0
- package/dist/src/components/operation-handlers/paging/response-deserialize.d.ts.map +1 -0
- package/dist/src/components/operation-handlers/paging/response-deserialize.js +51 -0
- package/dist/src/components/operation-handlers/paging/response-deserialize.js.map +1 -0
- package/dist/src/components/operation-handlers/paging/util.d.ts +17 -0
- package/dist/src/components/operation-handlers/paging/util.d.ts.map +1 -0
- package/dist/src/components/operation-handlers/paging/util.js +46 -0
- package/dist/src/components/operation-handlers/paging/util.js.map +1 -0
- package/dist/src/components/operation-handlers/types.d.ts +16 -0
- package/dist/src/components/operation-handlers/types.d.ts.map +1 -0
- package/dist/src/components/operation-handlers/types.js +1 -0
- package/dist/src/components/operation-handlers/types.js.map +1 -0
- package/dist/src/components/operation-options.d.ts +2 -0
- package/dist/src/components/operation-options.d.ts.map +1 -1
- package/dist/src/components/operation-options.js +2 -1
- package/dist/src/components/operation-options.js.map +1 -1
- package/dist/src/components/operation-parameters.d.ts +1 -1
- package/dist/src/components/operation-parameters.d.ts.map +1 -1
- package/dist/src/components/operation-parameters.js +7 -5
- package/dist/src/components/operation-parameters.js.map +1 -1
- package/dist/src/components/output.d.ts.map +1 -1
- package/dist/src/components/output.js +4 -0
- package/dist/src/components/output.js.map +1 -1
- package/dist/src/components/static-helpers/bytes-encoding.js +14 -16
- package/dist/src/components/static-helpers/bytes-encoding.js.map +1 -1
- package/dist/src/components/static-helpers/multipart-helpers.js +12 -10
- package/dist/src/components/static-helpers/multipart-helpers.js.map +1 -1
- package/dist/src/components/static-helpers/paging-helper.d.ts +5 -0
- package/dist/src/components/static-helpers/paging-helper.d.ts.map +1 -0
- package/dist/src/components/static-helpers/paging-helper.js +197 -0
- package/dist/src/components/static-helpers/paging-helper.js.map +1 -0
- package/dist/src/components/static-helpers/rest-error.d.ts.map +1 -1
- package/dist/src/components/static-helpers/rest-error.js +15 -10
- package/dist/src/components/static-helpers/rest-error.js.map +1 -1
- package/dist/src/components/testing/client-options.d.ts +1 -1
- package/dist/src/components/testing/client-options.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-array-transform.d.ts +1 -1
- package/dist/src/components/transforms/json/json-array-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-array-transform.js +6 -7
- package/dist/src/components/transforms/json/json-array-transform.js.map +1 -1
- package/dist/src/components/transforms/json/json-model-property-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-model-property-transform.js +15 -2
- package/dist/src/components/transforms/json/json-model-property-transform.js.map +1 -1
- package/dist/src/components/transforms/json/json-model-transform.js +8 -8
- package/dist/src/components/transforms/json/json-model-transform.js.map +1 -1
- package/dist/src/components/transforms/json/json-record-transform.d.ts +1 -1
- package/dist/src/components/transforms/json/json-record-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-record-transform.js +6 -7
- package/dist/src/components/transforms/json/json-record-transform.js.map +1 -1
- package/dist/src/components/transforms/json/json-transform-discriminator.js +6 -7
- package/dist/src/components/transforms/json/json-transform-discriminator.js.map +1 -1
- package/dist/src/components/transforms/json/union-transform.js +6 -7
- package/dist/src/components/transforms/json/union-transform.js.map +1 -1
- package/dist/src/components/transforms/operation-transform-declaration.d.ts.map +1 -1
- package/dist/src/components/transforms/operation-transform-declaration.js +2 -3
- package/dist/src/components/transforms/operation-transform-declaration.js.map +1 -1
- package/dist/src/components/transforms/operation-transform-expression.d.ts +2 -2
- package/dist/src/components/transforms/operation-transform-expression.d.ts.map +1 -1
- package/dist/src/components/transforms/operation-transform-expression.js +1 -1
- package/dist/src/components/transforms/operation-transform-expression.js.map +1 -1
- package/dist/src/emitter.d.ts.map +1 -1
- package/dist/src/emitter.js +2 -1
- package/dist/src/emitter.js.map +1 -1
- package/dist/src/lib.d.ts +17 -2
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +6 -0
- package/dist/src/lib.js.map +1 -1
- package/dist/src/utils/parameters.d.ts +1 -1
- package/dist/src/utils/parameters.d.ts.map +1 -1
- package/dist/src/utils/parameters.js +13 -12
- package/dist/src/utils/parameters.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/client-context/client-context-factory.tsx +1 -1
- package/src/components/client-operation.tsx +40 -16
- package/src/components/client.tsx +8 -10
- package/src/components/http-request-options.tsx +17 -13
- package/src/components/http-request-parameters-expression.tsx +142 -18
- package/src/components/http-request.tsx +22 -20
- package/src/components/http-response.tsx +8 -9
- package/src/components/operation-handlers/index.tsx +2 -0
- package/src/components/operation-handlers/operation-pipeline.tsx +33 -0
- package/src/components/operation-handlers/paging/page-item.tsx +13 -0
- package/src/components/operation-handlers/paging/page-response.tsx +55 -0
- package/src/components/operation-handlers/paging/page-settings.tsx +53 -0
- package/src/components/operation-handlers/paging/paginated-operation-handler.tsx +192 -0
- package/src/components/operation-handlers/paging/request-send.tsx +70 -0
- package/src/components/operation-handlers/paging/response-deserialize.tsx +54 -0
- package/src/components/operation-handlers/paging/util.ts +70 -0
- package/src/components/operation-handlers/types.tsx +18 -0
- package/src/components/operation-options.tsx +6 -3
- package/src/components/operation-parameters.tsx +9 -8
- package/src/components/output.tsx +2 -1
- package/src/components/static-helpers/bytes-encoding.tsx +5 -5
- package/src/components/static-helpers/multipart-helpers.tsx +7 -7
- package/src/components/static-helpers/paging-helper.tsx +195 -0
- package/src/components/static-helpers/rest-error.tsx +6 -3
- package/src/components/transforms/json/json-array-transform.tsx +3 -3
- package/src/components/transforms/json/json-model-property-transform.tsx +13 -1
- package/src/components/transforms/json/json-model-transform.tsx +3 -3
- package/src/components/transforms/json/json-record-transform.tsx +3 -3
- package/src/components/transforms/json/json-transform-discriminator.tsx +3 -3
- package/src/components/transforms/json/union-transform.tsx +3 -3
- package/src/components/transforms/operation-transform-declaration.tsx +2 -1
- package/src/components/transforms/operation-transform-expression.tsx +3 -3
- package/src/emitter.tsx +2 -0
- package/src/lib.ts +6 -0
- package/src/utils/parameters.tsx +23 -25
- package/test/e2e/http/payload/pageable/main.test.ts +78 -22
- package/test/scenarios/encoding/header_bytes.md +1 -1
- package/test/scenarios/encoding/header_date.md +1 -1
- package/test/scenarios/encoding/query_date.md +1 -1
- package/test/scenarios/http-operations/paging.md +244 -0
- package/test/scenarios/http-operations/query-parameter.md +1 -1
- package/test/scenarios/operation-parameters/body_root_anonymous.md +1 -1
- package/test/scenarios/operation-parameters/with_body_property.md +1 -1
- package/test/scenarios/operation-parameters/with_body_root.md +1 -1
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# Should emit a paging operation if it is continuationToken paging pattern
|
|
2
|
+
|
|
3
|
+
```tsp
|
|
4
|
+
@service
|
|
5
|
+
namespace Test;
|
|
6
|
+
model Pet {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@route("/link")
|
|
12
|
+
@list
|
|
13
|
+
op link(@query filter: string, @continuationToken @query nextToken?: string): {
|
|
14
|
+
@pageItems
|
|
15
|
+
pets: Pet[];
|
|
16
|
+
|
|
17
|
+
@continuationToken @header nextToken?: string;
|
|
18
|
+
};
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Operation
|
|
22
|
+
|
|
23
|
+
```ts src/api/testClientOperations.ts function link
|
|
24
|
+
export function link(
|
|
25
|
+
client: TestClientContext,
|
|
26
|
+
filter: string,
|
|
27
|
+
options?: LinkOptions,
|
|
28
|
+
): PagedAsyncIterableIterator<Pet, LinkPageResponse, LinkPageSettings> {
|
|
29
|
+
function getElements(response: LinkPageResponse) {
|
|
30
|
+
return response.pets;
|
|
31
|
+
}
|
|
32
|
+
async function getPagedResponse(nextToken?: string, settings?: LinkPageSettings) {
|
|
33
|
+
const combinedOptions = { ...options, ...settings };
|
|
34
|
+
|
|
35
|
+
if (nextToken) {
|
|
36
|
+
combinedOptions.nextToken = nextToken;
|
|
37
|
+
}
|
|
38
|
+
const response = await linkSend(client, filter, combinedOptions);
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
pagedResponse: await linkDeserialize(response, options),
|
|
42
|
+
nextToken: response.headers["next-token"],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return buildPagedAsyncIterator<Pet, LinkPageResponse, LinkPageSettings>({
|
|
46
|
+
getElements,
|
|
47
|
+
getPagedResponse,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```ts src/api/testClientOperations.ts function linkSend
|
|
53
|
+
async function linkSend(client: TestClientContext, filter: string, options?: Record<string, any>) {
|
|
54
|
+
const path = parse("/link{?filter,nextToken}").expand({
|
|
55
|
+
filter: filter,
|
|
56
|
+
...(options?.nextToken && { nextToken: options.nextToken }),
|
|
57
|
+
});
|
|
58
|
+
const httpRequestOptions = {
|
|
59
|
+
headers: {},
|
|
60
|
+
};
|
|
61
|
+
return await client.pathUnchecked(path).get(httpRequestOptions);
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```ts src/api/testClientOperations.ts function linkDeserialize
|
|
66
|
+
function linkDeserialize(response: PathUncheckedResponse, options?: LinkOptions) {
|
|
67
|
+
if (typeof options?.operationOptions?.onResponse === "function") {
|
|
68
|
+
options?.operationOptions?.onResponse(response);
|
|
69
|
+
}
|
|
70
|
+
if (+response.status === 200 && response.headers["content-type"]?.includes("application/json")) {
|
|
71
|
+
return {
|
|
72
|
+
pets: jsonArrayPetToApplicationTransform(response.body.pets),
|
|
73
|
+
}!;
|
|
74
|
+
}
|
|
75
|
+
throw createRestError(response);
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Options
|
|
80
|
+
|
|
81
|
+
The options bag should like all the optional parameters of the operation
|
|
82
|
+
|
|
83
|
+
```ts src/api/testClientOperations.ts interface LinkOptions
|
|
84
|
+
export interface LinkOptions extends OperationOptions {}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## PageSettings
|
|
88
|
+
|
|
89
|
+
Page settings and will be used as input for byPage function.
|
|
90
|
+
|
|
91
|
+
```ts src/api/testClientOperations.ts interface LinkPageSettings
|
|
92
|
+
export interface LinkPageSettings {
|
|
93
|
+
nextToken?: string;
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## LinkPageResponse
|
|
98
|
+
|
|
99
|
+
Page responses and will be used as output for byPage function.
|
|
100
|
+
|
|
101
|
+
```ts src/api/testClientOperations.ts interface LinkPageResponse
|
|
102
|
+
export interface LinkPageResponse {
|
|
103
|
+
pets: Array<Pet>;
|
|
104
|
+
nextToken?: string;
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Client
|
|
109
|
+
|
|
110
|
+
```ts src/testClient.ts class TestClient
|
|
111
|
+
export class TestClient {
|
|
112
|
+
#context: TestClientContext;
|
|
113
|
+
|
|
114
|
+
constructor(endpoint: string, options?: TestClientOptions) {
|
|
115
|
+
this.#context = createTestClientContext(endpoint, options);
|
|
116
|
+
}
|
|
117
|
+
link(filter: string, options?: LinkOptions) {
|
|
118
|
+
return link(this.#context, filter, options);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
# Should emit a paging operation if it is nextLink paging pattern
|
|
124
|
+
|
|
125
|
+
```tsp
|
|
126
|
+
@service
|
|
127
|
+
namespace Test;
|
|
128
|
+
model Pet {
|
|
129
|
+
id: string;
|
|
130
|
+
name: string;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@route("/link")
|
|
134
|
+
@list
|
|
135
|
+
op link(@query filter: string, @pageSize @query maxPageSize?: int32): {
|
|
136
|
+
@pageItems
|
|
137
|
+
pets: Pet[];
|
|
138
|
+
|
|
139
|
+
@nextLink link?: string;
|
|
140
|
+
};
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Operation
|
|
144
|
+
|
|
145
|
+
```ts src/api/testClientOperations.ts function link
|
|
146
|
+
export function link(
|
|
147
|
+
client: TestClientContext,
|
|
148
|
+
filter: string,
|
|
149
|
+
options?: LinkOptions,
|
|
150
|
+
): PagedAsyncIterableIterator<Pet, LinkPageResponse, LinkPageSettings> {
|
|
151
|
+
function getElements(response: LinkPageResponse) {
|
|
152
|
+
return response.pets;
|
|
153
|
+
}
|
|
154
|
+
async function getPagedResponse(nextToken?: string, settings?: LinkPageSettings) {
|
|
155
|
+
let response: PathUncheckedResponse;
|
|
156
|
+
if (nextToken) {
|
|
157
|
+
response = await client.pathUnchecked(nextToken).get();
|
|
158
|
+
} else {
|
|
159
|
+
const combinedOptions = { ...options, ...settings };
|
|
160
|
+
response = await linkSend(client, filter, combinedOptions);
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
pagedResponse: await linkDeserialize(response, options),
|
|
164
|
+
nextToken: response.body["link"],
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
return buildPagedAsyncIterator<Pet, LinkPageResponse, LinkPageSettings>({
|
|
168
|
+
getElements,
|
|
169
|
+
getPagedResponse,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
```ts src/api/testClientOperations.ts function linkSend
|
|
175
|
+
async function linkSend(client: TestClientContext, filter: string, options?: Record<string, any>) {
|
|
176
|
+
const path = parse("/link{?filter,maxPageSize}").expand({
|
|
177
|
+
filter: filter,
|
|
178
|
+
...(options?.maxPageSize && { maxPageSize: options.maxPageSize }),
|
|
179
|
+
});
|
|
180
|
+
const httpRequestOptions = {
|
|
181
|
+
headers: {},
|
|
182
|
+
};
|
|
183
|
+
return await client.pathUnchecked(path).get(httpRequestOptions);
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
```ts src/api/testClientOperations.ts function linkDeserialize
|
|
188
|
+
function linkDeserialize(response: PathUncheckedResponse, options?: LinkOptions) {
|
|
189
|
+
if (typeof options?.operationOptions?.onResponse === "function") {
|
|
190
|
+
options?.operationOptions?.onResponse(response);
|
|
191
|
+
}
|
|
192
|
+
if (+response.status === 200 && response.headers["content-type"]?.includes("application/json")) {
|
|
193
|
+
return {
|
|
194
|
+
pets: jsonArrayPetToApplicationTransform(response.body.pets),
|
|
195
|
+
link: response.body.link,
|
|
196
|
+
}!;
|
|
197
|
+
}
|
|
198
|
+
throw createRestError(response);
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Options
|
|
203
|
+
|
|
204
|
+
The options bag should like all the optional parameters of the operation
|
|
205
|
+
|
|
206
|
+
```ts src/api/testClientOperations.ts interface LinkOptions
|
|
207
|
+
export interface LinkOptions extends OperationOptions {}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## PageSettings
|
|
211
|
+
|
|
212
|
+
Page settings and will be used as input for byPage function.
|
|
213
|
+
|
|
214
|
+
```ts src/api/testClientOperations.ts interface LinkPageSettings
|
|
215
|
+
export interface LinkPageSettings {
|
|
216
|
+
maxPageSize?: number;
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## LinkPageResponse
|
|
221
|
+
|
|
222
|
+
Page responses and will be used as output for byPage function.
|
|
223
|
+
|
|
224
|
+
```ts src/api/testClientOperations.ts interface LinkPageResponse
|
|
225
|
+
export interface LinkPageResponse {
|
|
226
|
+
pets: Array<Pet>;
|
|
227
|
+
link?: string;
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Client
|
|
232
|
+
|
|
233
|
+
```ts src/testClient.ts class TestClient
|
|
234
|
+
export class TestClient {
|
|
235
|
+
#context: TestClientContext;
|
|
236
|
+
|
|
237
|
+
constructor(endpoint: string, options?: TestClientOptions) {
|
|
238
|
+
this.#context = createTestClientContext(endpoint, options);
|
|
239
|
+
}
|
|
240
|
+
link(filter: string, options?: LinkOptions) {
|
|
241
|
+
return link(this.#context, filter, options);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
```
|
|
@@ -24,7 +24,7 @@ export async function headModel(
|
|
|
24
24
|
const path = parse("/").expand({});
|
|
25
25
|
const httpRequestOptions = {
|
|
26
26
|
headers: {
|
|
27
|
-
...(
|
|
27
|
+
...(input.foo && { foo: input.foo }),
|
|
28
28
|
},
|
|
29
29
|
body: jsonVisibilityModelToTransportTransform(input),
|
|
30
30
|
};
|
|
@@ -26,7 +26,7 @@ export async function create(
|
|
|
26
26
|
const path = parse("/").expand({});
|
|
27
27
|
const httpRequestOptions = {
|
|
28
28
|
headers: {
|
|
29
|
-
...(options?.foo && { foo: options
|
|
29
|
+
...(options?.foo && { foo: options.foo }),
|
|
30
30
|
},
|
|
31
31
|
body: jsonWidgetToTransportTransform(widget),
|
|
32
32
|
};
|
|
@@ -27,7 +27,7 @@ export async function create(
|
|
|
27
27
|
const path = parse("/").expand({});
|
|
28
28
|
const httpRequestOptions = {
|
|
29
29
|
headers: {
|
|
30
|
-
...(
|
|
30
|
+
...(widget.foo && { foo: widget.foo }),
|
|
31
31
|
},
|
|
32
32
|
body: jsonWidgetToTransportTransform(widget),
|
|
33
33
|
};
|