@trayio/cdk-dsl 1.16.0 → 2.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.
- package/README.md +33 -20
- package/dist/connector/operation/HttpOperationHandler.d.ts +46 -25
- package/dist/connector/operation/HttpOperationHandler.d.ts.map +1 -1
- package/dist/connector/operation/HttpOperationHandler.js +49 -43
- package/dist/connector/operation/OperationHandler.d.ts +6 -0
- package/dist/connector/operation/OperationHandler.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -73,6 +73,7 @@ export type ExampleOperationInput = {
|
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
#### Enums (Static dropdown lists)
|
|
76
|
+
|
|
76
77
|
Enums are rendered in the Tray builder UI as dropdowns. The user will see the enum display names and the enum values are what will be passed into the handler. By default, user friendly enum display names are generated. e.g. an enum of value `my-enum-value` will be rendered in the UI with the display name `My enum value`.
|
|
77
78
|
|
|
78
79
|
```typescript
|
|
@@ -86,6 +87,7 @@ enum ActionType {
|
|
|
86
87
|
third-option = 'third-option', // User will see an auto generated display name: Third option
|
|
87
88
|
}
|
|
88
89
|
```
|
|
90
|
+
|
|
89
91
|
You may want to provide custom enum display names instead, to do so use the JSdoc annotation `@enumLabels` followed by a comma separated list of strings that matches the order you have defined your enums in.
|
|
90
92
|
|
|
91
93
|
```typescript
|
|
@@ -103,16 +105,17 @@ enum ActionType {
|
|
|
103
105
|
}
|
|
104
106
|
```
|
|
105
107
|
|
|
106
|
-
|
|
107
108
|
#### DDL (Dynamic dropdown lists)
|
|
109
|
+
|
|
108
110
|
Sometimes you want to provide the user a dropdown list, but you don't know the items to display in the list because they come from another API. For example you may want to display a list of user names in a dropdown and based on the selection send the user ID. DDL's solve this problem. Once you have created an operation for your DDL (see more on this in the Composite Implementation section) you can use this DDL in the input of many other operations.
|
|
109
111
|
|
|
110
112
|
The JSdoc annotation `@lookupOperation` specifies what operation to invoke when the user expands the dropdown. `@lookupInput` is used to describe the JSON payload to send to that DDL operation. Any inputs defined in input.ts can be passed to the DDL operation using tripple braces. In this example we send the workspaceId field value by doing `{{{workspaceId}}}`. If your DDL operation calls an authenticated endpoint you can pass along the token used in the current operation by setting `@lookupAuthRequired true`.
|
|
113
|
+
|
|
111
114
|
```typescript
|
|
112
115
|
export type ExampleOperationInput = {
|
|
113
|
-
|
|
116
|
+
workspaceId: string;
|
|
114
117
|
/**
|
|
115
|
-
|
|
118
|
+
* @title user
|
|
116
119
|
* @lookupOperation list_users_ddl
|
|
117
120
|
* @lookupInput {"includePrivateChannels": false,"workspaceId": "{{{workspaceId}}}"}
|
|
118
121
|
* @lookupAuthRequired true
|
|
@@ -122,6 +125,7 @@ export type ExampleOperationInput = {
|
|
|
122
125
|
```
|
|
123
126
|
|
|
124
127
|
#### Reusing types across multiple operations
|
|
128
|
+
|
|
125
129
|
You can reuse types by importing them and reuse sections of a schema by using TypeScript intersections.
|
|
126
130
|
|
|
127
131
|
```typescript
|
|
@@ -152,26 +156,28 @@ export type ReusableSchema = {
|
|
|
152
156
|
reusableSchemaB: string;
|
|
153
157
|
};
|
|
154
158
|
```
|
|
159
|
+
|
|
155
160
|
Once the imports and intersection are resolved the above example would look like this
|
|
161
|
+
|
|
156
162
|
```typescript
|
|
157
163
|
export type Input = {
|
|
158
|
-
|
|
164
|
+
specificField: string;
|
|
159
165
|
reusableFields: {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
166
|
+
reusableFieldA: number;
|
|
167
|
+
reusableFieldB: string;
|
|
168
|
+
};
|
|
169
|
+
reusableSchemaA: number;
|
|
164
170
|
reusableSchemaB: string;
|
|
165
|
-
}
|
|
171
|
+
};
|
|
166
172
|
```
|
|
167
173
|
|
|
168
174
|
#### Union types (Supporting multiple types)
|
|
175
|
+
|
|
169
176
|
If you want to support two or more different object types in your schema you can achieve this using TypeScript unions.
|
|
170
177
|
|
|
171
178
|
In the example below our input accepts an array of elements. Each element of this array can be either of type image or text. When the user adds an item to the array they will see a dropdown where they can select if this element will be an image or text. The JSdoc annotation `@title` on the image and text types will be displayed in the dropdown the user sees.
|
|
172
179
|
|
|
173
180
|
```typescript
|
|
174
|
-
|
|
175
181
|
export type ExampleOperationInput = {
|
|
176
182
|
elements: ImageOrText[];
|
|
177
183
|
};
|
|
@@ -182,7 +188,7 @@ type ImageOrText = Image | Text;
|
|
|
182
188
|
* @title Image
|
|
183
189
|
*/
|
|
184
190
|
type Image = {
|
|
185
|
-
|
|
191
|
+
name: string;
|
|
186
192
|
src: string;
|
|
187
193
|
};
|
|
188
194
|
|
|
@@ -195,20 +201,22 @@ type Text = {
|
|
|
195
201
|
```
|
|
196
202
|
|
|
197
203
|
#### Required/Optional fields
|
|
198
|
-
|
|
204
|
+
|
|
205
|
+
By default all input fields are mandatory, you can set any to optional with a `?` in your TypeScript type. Mandatory fields get a red \* in the Tray builder UI and will warn the user that they must be filled in before attempting to run a workflow.
|
|
199
206
|
|
|
200
207
|
```typescript
|
|
201
208
|
export type ExampleOperationInput = {
|
|
202
209
|
mandatoryField: string;
|
|
203
210
|
optionalField?: string;
|
|
204
211
|
};
|
|
205
|
-
|
|
206
212
|
```
|
|
207
213
|
|
|
208
|
-
#### Formatting fields
|
|
214
|
+
#### Formatting fields
|
|
215
|
+
|
|
209
216
|
By default properties on your input type render as simple input fields. You can select a more user friendly way to render the field based on your needs by using the JSdoc annotation `@format`.
|
|
210
217
|
|
|
211
218
|
The format options available are:
|
|
219
|
+
|
|
212
220
|
- datetime - renders a date and time picker
|
|
213
221
|
- code - renders a button which on click opens a modal with a simple code editor
|
|
214
222
|
- text - for longer text inputs, expands when you enter new lines
|
|
@@ -231,7 +239,9 @@ export type ExampleOperationInput = {
|
|
|
231
239
|
```
|
|
232
240
|
|
|
233
241
|
#### Default values
|
|
242
|
+
|
|
234
243
|
If you want to provide a default initial value for a field you can use the JSdoc annotation `@default`.
|
|
244
|
+
|
|
235
245
|
```typescript
|
|
236
246
|
export type ExampleOperationInput = {
|
|
237
247
|
/**
|
|
@@ -263,6 +273,7 @@ export type ExampleOperationInput = {
|
|
|
263
273
|
```
|
|
264
274
|
|
|
265
275
|
#### Advanced fields
|
|
276
|
+
|
|
266
277
|
If you have optional fields that are for more advanced use cases you can obscure these into the Tray builder UI's advanced fields section. This can provide a cleaner interface for your operation, but can still be accessed by the user by expanding the advanced fields section. You can add fields here by using the JSdoc annotation `@advanced true`.
|
|
267
278
|
|
|
268
279
|
```typescript
|
|
@@ -275,8 +286,6 @@ export type ExampleOperationInput = {
|
|
|
275
286
|
};
|
|
276
287
|
```
|
|
277
288
|
|
|
278
|
-
|
|
279
|
-
|
|
280
289
|
## Handler
|
|
281
290
|
|
|
282
291
|
A handler at its core, describes a function, that takes an `ctx` value with an `auth` property described by the authentication type (which is the same for all operations) and it takes an `input` value described by the input type of the operation
|
|
@@ -353,9 +362,9 @@ export const myOperationHandler =
|
|
|
353
362
|
.usingHttp((http) =>
|
|
354
363
|
http.get('https://someapi.com/someresource/:id')
|
|
355
364
|
.handleRequest((ctx, input, request) =>
|
|
356
|
-
request.addPathParameter('id', input.id.toString())
|
|
365
|
+
request.addPathParameter('id', input.id.toString()).withoutBody()
|
|
357
366
|
)
|
|
358
|
-
.handleResponse((response) => response.
|
|
367
|
+
.handleResponse((ctx, input, response) => response.parseWithBodyAsJson())
|
|
359
368
|
)
|
|
360
369
|
);
|
|
361
370
|
```
|
|
@@ -368,6 +377,7 @@ The previous handler makes a `GET` http request, which is defined by the `http.g
|
|
|
368
377
|
- `addQueryString(name, value)`: Adds a query string to the request, the value will be url encoded
|
|
369
378
|
- `withBodyAsJson(body)`: Adds a body to the request that will be sent as json.
|
|
370
379
|
- `withBodyAsText(body)`: Adds a body to the request that will be sent as a plain text.
|
|
380
|
+
- `withoutBody()`: Sends a empty body in the request.
|
|
371
381
|
|
|
372
382
|
A handler with an authenticated POST request would look like this:
|
|
373
383
|
|
|
@@ -382,7 +392,7 @@ export const myOperationHandler =
|
|
|
382
392
|
request.withBearerToken(auth.access_token)
|
|
383
393
|
.withBodyAsJson(input)
|
|
384
394
|
)
|
|
385
|
-
.handleResponse((response) => response.
|
|
395
|
+
.handleResponse((ctx, input, response) => response.parseWithBodyAsJson())
|
|
386
396
|
)
|
|
387
397
|
);
|
|
388
398
|
```
|
|
@@ -395,7 +405,10 @@ request.withBodyAsJson({ name: input.name, title: input.title });
|
|
|
395
405
|
|
|
396
406
|
So the `handlerRequest` function can transform the input in any way it needs to before sending the HTTP request and the same is true for the `handleResponse`, in the previous examples, the `handleResponse` simply read the response body as json and returned it, but it can be more complex if necessary.
|
|
397
407
|
|
|
398
|
-
|
|
408
|
+
Supported methods on the response configuration are:
|
|
409
|
+
|
|
410
|
+
- `parseWithBodyAsJson()`: Returns a the requests response as a JSON
|
|
411
|
+
- `parseWithBodyAsText((text) => { //logic to transform it to match your output.})`: Returns a requests response as a text to the callback and it can be manipulated to match the operations output schema.
|
|
399
412
|
|
|
400
413
|
Just like with the input type and the request, the type of the json body in the response can be different from the output type.
|
|
401
414
|
|
|
@@ -1,46 +1,67 @@
|
|
|
1
|
-
import { HttpMethod, HttpRequest, HttpHeaderValue, HttpResponse } from '@trayio/commons/http/Http';
|
|
2
|
-
import {
|
|
1
|
+
import { HttpContentType, HttpMethod, HttpRequest, HttpHeaderValue, HttpResponse } from '@trayio/commons/http/Http';
|
|
2
|
+
import { DynamicType } from '@trayio/commons/dynamictype/DynamicType';
|
|
3
|
+
import * as O from 'fp-ts/Option';
|
|
4
|
+
import { OperationHandlerAuth, OperationHandlerContext, OperationHandlerResult, FileReference } from './OperationHandler';
|
|
5
|
+
export type HttpOperationBody = FileReference | string | DynamicType | undefined;
|
|
6
|
+
export declare class HttpOperationRequestBuilder {
|
|
7
|
+
private readonly path;
|
|
8
|
+
private readonly method;
|
|
9
|
+
private readonly request;
|
|
10
|
+
constructor(method: HttpMethod, path: string, request: HttpRequest);
|
|
11
|
+
withBodyAsJson<T extends DynamicType>(body: T): HttpOperationRequest;
|
|
12
|
+
withBodyAsText(body: string): HttpOperationRequest;
|
|
13
|
+
withoutBody(): HttpOperationRequest;
|
|
14
|
+
addPathParameter(name: string, value: string): HttpOperationRequestBuilder;
|
|
15
|
+
addQueryString(name: string, value: string): HttpOperationRequestBuilder;
|
|
16
|
+
withBearerToken(token: string): HttpOperationRequestBuilder;
|
|
17
|
+
addHeader(name: string, value: HttpHeaderValue): HttpOperationRequestBuilder;
|
|
18
|
+
}
|
|
3
19
|
export declare class HttpOperationRequest {
|
|
4
|
-
private jsonSerialization;
|
|
5
20
|
readonly path: string;
|
|
6
21
|
readonly method: HttpMethod;
|
|
7
22
|
readonly request: HttpRequest;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export type HttpOperationRequestHandler<AUTH extends OperationHandlerAuth<unknown, unknown>, IN> = (ctx: OperationHandlerContext<AUTH>, input: IN, request: HttpOperationRequest) => HttpOperationRequest;
|
|
17
|
-
export declare class HttpOperationResponse {
|
|
18
|
-
private jsonSerialization;
|
|
23
|
+
readonly contentType: O.Option<HttpContentType>;
|
|
24
|
+
readonly body: HttpOperationBody;
|
|
25
|
+
constructor(path: string, method: HttpMethod, request: HttpRequest, contentType: O.Option<HttpContentType>, body: HttpOperationBody);
|
|
26
|
+
}
|
|
27
|
+
export type HttpOperationRequestHandler<AUTH extends OperationHandlerAuth<unknown, unknown>, IN> = (ctx: OperationHandlerContext<AUTH>, input: IN, request: HttpOperationRequestBuilder) => HttpOperationRequest;
|
|
28
|
+
export type HttpOperationResponseErrorHandling<OUT> = () => OperationHandlerResult<OUT>;
|
|
29
|
+
export type HttpOperationResponseParser<BODY, OUT> = (body: BODY) => OperationHandlerResult<OUT>;
|
|
30
|
+
export declare class HttpOperationResponseBuilder<OUT> {
|
|
19
31
|
private response;
|
|
20
|
-
|
|
32
|
+
private errorHandling;
|
|
33
|
+
constructor(response: HttpResponse, errorHandling: HttpOperationResponseErrorHandling<OUT>);
|
|
21
34
|
getStatusCode(): number;
|
|
22
35
|
getHeader(name: string): HttpHeaderValue | undefined;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
36
|
+
withErrorHandling(errorHandling: HttpOperationResponseErrorHandling<OUT>): HttpOperationResponseBuilder<OUT>;
|
|
37
|
+
parseWithoutBody(responseParser: HttpOperationResponseParser<undefined, OUT>): HttpOperationResponse<OUT>;
|
|
38
|
+
parseWithBodyAsText(responseParser: HttpOperationResponseParser<string, OUT>): HttpOperationResponse<OUT>;
|
|
39
|
+
parseWithBodyAsJson<T extends DynamicType>(responseParser?: HttpOperationResponseParser<T, OUT>): HttpOperationResponse<OUT>;
|
|
40
|
+
}
|
|
41
|
+
export declare class HttpOperationResponse<OUT> {
|
|
42
|
+
readonly response: HttpResponse;
|
|
43
|
+
readonly errorHandling: HttpOperationResponseErrorHandling<OUT>;
|
|
44
|
+
readonly contentType: O.Option<HttpContentType>;
|
|
45
|
+
readonly responseParser: HttpOperationResponseParser<any, OUT>;
|
|
46
|
+
constructor(response: HttpResponse, errorHandling: HttpOperationResponseErrorHandling<OUT>, contentType: O.Option<HttpContentType>, responseParser: HttpOperationResponseParser<any, OUT>);
|
|
26
47
|
}
|
|
27
|
-
export type HttpOperationResponseHandler<OUT> = (response:
|
|
48
|
+
export type HttpOperationResponseHandler<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = (ctx: OperationHandlerContext<AUTH>, input: IN, response: HttpOperationResponseBuilder<OUT>) => HttpOperationResponse<OUT>;
|
|
28
49
|
export declare class HttpOperationHandler<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> {
|
|
29
50
|
readonly _tag: 'HttpOperationHandler';
|
|
30
|
-
readonly request:
|
|
51
|
+
readonly request: HttpOperationRequestBuilder;
|
|
31
52
|
readonly requestHandler: HttpOperationRequestHandler<AUTH, IN>;
|
|
32
|
-
readonly responseHandler: HttpOperationResponseHandler<OUT>;
|
|
33
|
-
constructor(request:
|
|
53
|
+
readonly responseHandler: HttpOperationResponseHandler<AUTH, IN, OUT>;
|
|
54
|
+
constructor(request: HttpOperationRequestBuilder, requestHandler: HttpOperationRequestHandler<AUTH, IN>, responseHandler: HttpOperationResponseHandler<AUTH, IN, OUT>);
|
|
34
55
|
}
|
|
35
56
|
export declare class HttpOperationHandlerResponseConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> {
|
|
36
57
|
private request;
|
|
37
58
|
private requestHandler;
|
|
38
|
-
constructor(request:
|
|
39
|
-
handleResponse(responseHandler: HttpOperationResponseHandler<OUT>): HttpOperationHandler<AUTH, IN, OUT>;
|
|
59
|
+
constructor(request: HttpOperationRequestBuilder, requestHandler: HttpOperationRequestHandler<AUTH, IN>);
|
|
60
|
+
handleResponse(responseHandler: HttpOperationResponseHandler<AUTH, IN, OUT>): HttpOperationHandler<AUTH, IN, OUT>;
|
|
40
61
|
}
|
|
41
62
|
export declare class HttpOperationHandlerRequestConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> {
|
|
42
63
|
private request;
|
|
43
|
-
constructor(request:
|
|
64
|
+
constructor(request: HttpOperationRequestBuilder);
|
|
44
65
|
handleRequest(requestHandler: HttpOperationRequestHandler<AUTH, IN>): HttpOperationHandlerResponseConfiguration<AUTH, IN, OUT>;
|
|
45
66
|
}
|
|
46
67
|
export declare class HttpOperationHandlerConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpOperationHandler.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/HttpOperationHandler.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"HttpOperationHandler.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/HttpOperationHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,eAAe,EACf,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,E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C;IAM5E,MAAM,CACL,IAAI,EAAE,MAAM,GACV,wCAAwC,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC;IAM1D,OAAO,CAAC,cAAc;CAatB;AAED,MAAM,MAAM,yBAAyB,CACpC,IAAI,SAAS,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,EACnD,EAAE,EACF,GAAG,IACA,CACH,IAAI,EAAE,iCAAiC,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,KAClD,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC"}
|
|
@@ -23,13 +23,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.HttpOperationHandlerConfiguration = exports.HttpOperationHandlerRequestConfiguration = exports.HttpOperationHandlerResponseConfiguration = exports.HttpOperationHandler = exports.HttpOperationResponse = exports.HttpOperationRequest = void 0;
|
|
26
|
+
exports.HttpOperationHandlerConfiguration = exports.HttpOperationHandlerRequestConfiguration = exports.HttpOperationHandlerResponseConfiguration = exports.HttpOperationHandler = exports.HttpOperationResponse = exports.HttpOperationResponseBuilder = exports.HttpOperationRequest = exports.HttpOperationRequestBuilder = void 0;
|
|
27
27
|
const Http_1 = require("@trayio/commons/http/Http");
|
|
28
|
-
const JsonSerialization_1 = require("@trayio/commons/serialization/JsonSerialization");
|
|
29
28
|
const BufferExtensions_1 = require("@trayio/commons/buffer/BufferExtensions");
|
|
30
29
|
const fs = __importStar(require("fs"));
|
|
31
30
|
const pathLib = __importStar(require("path"));
|
|
32
|
-
const
|
|
31
|
+
const O = __importStar(require("fp-ts/Option"));
|
|
33
32
|
const OperationHandler_1 = require("./OperationHandler");
|
|
34
33
|
// TODO: move to TTM
|
|
35
34
|
const readJsonFile = (jsonFilePath) => JSON.parse(fs.readFileSync(jsonFilePath, 'utf8'));
|
|
@@ -40,38 +39,53 @@ const readPackageVersion = () => {
|
|
|
40
39
|
return packageJson.version;
|
|
41
40
|
};
|
|
42
41
|
const packageVersion = readPackageVersion();
|
|
43
|
-
class
|
|
42
|
+
class HttpOperationRequestBuilder {
|
|
44
43
|
constructor(method, path, request) {
|
|
45
|
-
this.jsonSerialization = new JsonSerialization_1.JsonSerialization();
|
|
46
44
|
this.method = method;
|
|
47
45
|
this.path = path;
|
|
48
46
|
this.request = request;
|
|
49
47
|
}
|
|
50
48
|
withBodyAsJson(body) {
|
|
51
|
-
const
|
|
52
|
-
|
|
49
|
+
const contentType = Http_1.HttpContentType.Json;
|
|
50
|
+
const requestWithHeader = this.addHeader(Http_1.HttpHeader.ContentType, contentType);
|
|
51
|
+
return new HttpOperationRequest(requestWithHeader.path, requestWithHeader.method, requestWithHeader.request, O.some(contentType), body);
|
|
53
52
|
}
|
|
54
53
|
withBodyAsText(body) {
|
|
55
|
-
|
|
54
|
+
const contentType = Http_1.HttpContentType.Text;
|
|
55
|
+
const requestWithHeader = this.addHeader(Http_1.HttpHeader.ContentType, contentType);
|
|
56
|
+
return new HttpOperationRequest(requestWithHeader.path, requestWithHeader.method, requestWithHeader.request, O.some(contentType), body);
|
|
57
|
+
}
|
|
58
|
+
withoutBody() {
|
|
59
|
+
return new HttpOperationRequest(this.path, this.method, this.request, O.none, undefined);
|
|
56
60
|
}
|
|
57
61
|
addPathParameter(name, value) {
|
|
58
|
-
return new
|
|
62
|
+
return new HttpOperationRequestBuilder(this.method, this.path, Object.assign(Object.assign({}, this.request), { pathParams: Object.assign(Object.assign({}, this.request.pathParams), { [name]: value }) }));
|
|
59
63
|
}
|
|
60
64
|
addQueryString(name, value) {
|
|
61
|
-
return new
|
|
65
|
+
return new HttpOperationRequestBuilder(this.method, this.path, Object.assign(Object.assign({}, this.request), { queryString: Object.assign(Object.assign({}, this.request.queryString), { [name]: value }) }));
|
|
62
66
|
}
|
|
63
67
|
withBearerToken(token) {
|
|
64
68
|
return this.addHeader(Http_1.HttpHeader.Authorization, `Bearer ${token}`);
|
|
65
69
|
}
|
|
66
70
|
addHeader(name, value) {
|
|
67
|
-
return new
|
|
71
|
+
return new HttpOperationRequestBuilder(this.method, this.path, Object.assign(Object.assign({}, this.request), { headers: Object.assign(Object.assign({}, this.request.headers), { [name]: value }) }));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.HttpOperationRequestBuilder = HttpOperationRequestBuilder;
|
|
75
|
+
class HttpOperationRequest {
|
|
76
|
+
constructor(path, method, request, contentType, body) {
|
|
77
|
+
this.path = path;
|
|
78
|
+
this.method = method;
|
|
79
|
+
this.request = request;
|
|
80
|
+
this.contentType = contentType;
|
|
81
|
+
this.body = body;
|
|
68
82
|
}
|
|
69
83
|
}
|
|
70
84
|
exports.HttpOperationRequest = HttpOperationRequest;
|
|
71
|
-
class
|
|
72
|
-
constructor(response) {
|
|
73
|
-
this.jsonSerialization = new JsonSerialization_1.JsonSerialization();
|
|
85
|
+
class HttpOperationResponseBuilder {
|
|
86
|
+
constructor(response, errorHandling) {
|
|
74
87
|
this.response = response;
|
|
88
|
+
this.errorHandling = errorHandling;
|
|
75
89
|
}
|
|
76
90
|
getStatusCode() {
|
|
77
91
|
return this.response.statusCode;
|
|
@@ -79,34 +93,26 @@ class HttpOperationResponse {
|
|
|
79
93
|
getHeader(name) {
|
|
80
94
|
return this.response.headers[name];
|
|
81
95
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return OperationHandler_1.OperationHandlerResult.failure(OperationHandler_1.OperationHandlerError.apiError(`API returned a status code of ${this.response.statusCode}`, {
|
|
103
|
-
statusCode: this.response.statusCode,
|
|
104
|
-
body: deserializedBody,
|
|
105
|
-
}));
|
|
106
|
-
}
|
|
107
|
-
return OperationHandler_1.OperationHandlerResult.success(deserializedBody);
|
|
108
|
-
})(deserializedBodyE);
|
|
109
|
-
return result;
|
|
96
|
+
withErrorHandling(errorHandling) {
|
|
97
|
+
return new HttpOperationResponseBuilder(this.response, errorHandling);
|
|
98
|
+
}
|
|
99
|
+
parseWithoutBody(responseParser) {
|
|
100
|
+
return new HttpOperationResponse(this.response, this.errorHandling, O.none, responseParser);
|
|
101
|
+
}
|
|
102
|
+
parseWithBodyAsText(responseParser) {
|
|
103
|
+
return new HttpOperationResponse(this.response, this.errorHandling, O.some(Http_1.HttpContentType.Text), responseParser);
|
|
104
|
+
}
|
|
105
|
+
parseWithBodyAsJson(responseParser = (body) => OperationHandler_1.OperationHandlerResult.success(body)) {
|
|
106
|
+
return new HttpOperationResponse(this.response, this.errorHandling, O.some(Http_1.HttpContentType.Json), responseParser);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.HttpOperationResponseBuilder = HttpOperationResponseBuilder;
|
|
110
|
+
class HttpOperationResponse {
|
|
111
|
+
constructor(response, errorHandling, contentType, responseParser) {
|
|
112
|
+
this.response = response;
|
|
113
|
+
this.errorHandling = errorHandling;
|
|
114
|
+
this.contentType = contentType;
|
|
115
|
+
this.responseParser = responseParser;
|
|
110
116
|
}
|
|
111
117
|
}
|
|
112
118
|
exports.HttpOperationResponse = HttpOperationResponse;
|
|
@@ -155,7 +161,7 @@ class HttpOperationHandlerConfiguration {
|
|
|
155
161
|
return new HttpOperationHandlerRequestConfiguration(this.initialRequest(Http_1.HttpMethod.Delete, path));
|
|
156
162
|
}
|
|
157
163
|
initialRequest(method, path) {
|
|
158
|
-
return new
|
|
164
|
+
return new HttpOperationRequestBuilder(method, path, {
|
|
159
165
|
headers: {
|
|
160
166
|
[Http_1.HttpHeader.UserAgent]: `TrayioCDK/${packageVersion}`,
|
|
161
167
|
},
|
|
@@ -93,6 +93,12 @@ export type DDLOperationOutputElement<T extends string | number> = {
|
|
|
93
93
|
export type DDLOperationOutput<T extends string | number> = {
|
|
94
94
|
result: Array<DDLOperationOutputElement<T>>;
|
|
95
95
|
};
|
|
96
|
+
export type FileReference = {
|
|
97
|
+
name: string;
|
|
98
|
+
url: string;
|
|
99
|
+
mime_type: string;
|
|
100
|
+
expires: number;
|
|
101
|
+
};
|
|
96
102
|
export type OperationHandlerError = ConnectorError | ApiError | UserInputError | OauthRefreshError | SkipTriggerError;
|
|
97
103
|
export type BaseOperationHandlerError = {
|
|
98
104
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationHandler.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/OperationHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,MAAM,MAAM,oBAAoB,CAAC,IAAI,EAAE,GAAG,IAAI;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,EAAE,GAAG,CAAC;IACT,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,yBAAyB,CAAC,IAAI,EAAE,GAAG,IAAI,oBAAoB,CACtE,IAAI,EACJ,GAAG,CACH,GAAG;IACH,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,IAAI,EAAE,GAAG,IAAI,oBAAoB,CACvE,IAAI,EACJ,GAAG,CACH,GAAG;IACH,QAAQ,EAAE,QAAQ,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,IAAI,EAAE,GAAG,IAAI,oBAAoB,CACvE,IAAI,EACJ,GAAG,CACH,GAAG;IACH,QAAQ,EAAE,QAAQ,CAAC;CAC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AO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,aAAa,KACpB,qBAAqB,CAAC;IAC3B,gBAAgB,EAAE,CACjB,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,aAAa,KACpB,qBAAqB,CAAC;CAC3B;AAED,eAAO,MAAM,qBAAqB,EAAE,8BAyCnC,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI,MAAM,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC;AAEzE,MAAM,WAAW,+BAAgC,SAAQ,eAAe;CAAG;AAE3E,eAAO,MAAM,sBAAsB,EAAE,+BAAwC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trayio/cdk-dsl",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A DSL for connector development",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./*": "./dist/*.js"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@trayio/commons": "
|
|
17
|
+
"@trayio/commons": "2.0.0"
|
|
18
18
|
},
|
|
19
19
|
"typesVersions": {
|
|
20
20
|
"*": {
|