@trayio/cdk-dsl 0.0.1-beta
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/LICENSE.txt +22 -0
- package/README.md +858 -0
- package/dist/connector/operation/CompositeOperationHandler.d.ts +9 -0
- package/dist/connector/operation/CompositeOperationHandler.d.ts.map +1 -0
- package/dist/connector/operation/CompositeOperationHandler.js +10 -0
- package/dist/connector/operation/HttpOperationHandler.d.ts +83 -0
- package/dist/connector/operation/HttpOperationHandler.d.ts.map +1 -0
- package/dist/connector/operation/HttpOperationHandler.js +187 -0
- package/dist/connector/operation/OperationHandler.d.ts +134 -0
- package/dist/connector/operation/OperationHandler.d.ts.map +1 -0
- package/dist/connector/operation/OperationHandler.js +52 -0
- package/dist/connector/operation/OperationHandlerInvocation.d.ts +3 -0
- package/dist/connector/operation/OperationHandlerInvocation.d.ts.map +1 -0
- package/dist/connector/operation/OperationHandlerInvocation.js +2 -0
- package/dist/connector/operation/OperationHandlerSetup.d.ts +50 -0
- package/dist/connector/operation/OperationHandlerSetup.d.ts.map +1 -0
- package/dist/connector/operation/OperationHandlerSetup.js +148 -0
- package/dist/connector/operation/OperationHandlerTest.d.ts +135 -0
- package/dist/connector/operation/OperationHandlerTest.d.ts.map +1 -0
- package/dist/connector/operation/OperationHandlerTest.js +238 -0
- package/dist/connector/operation/OperationHandlerValidation.d.ts +42 -0
- package/dist/connector/operation/OperationHandlerValidation.d.ts.map +1 -0
- package/dist/connector/operation/OperationHandlerValidation.js +63 -0
- package/package.json +30 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OperationHandlerAuth, OperationHandlerContext, OperationHandlerResult } from './OperationHandler';
|
|
2
|
+
import { OperationHandlerInvocation } from './OperationHandlerInvocation';
|
|
3
|
+
export type CompositeOperationHandlerFunction<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = (ctx: OperationHandlerContext<AUTH>, input: IN, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<OUT>>;
|
|
4
|
+
export declare class CompositeOperationHandler<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> {
|
|
5
|
+
readonly _tag: 'CompositeOperationHandler';
|
|
6
|
+
readonly handlerFunction: CompositeOperationHandlerFunction<AUTH, IN, OUT>;
|
|
7
|
+
constructor(handlerFunction: CompositeOperationHandlerFunction<AUTH, IN, OUT>);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=CompositeOperationHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompositeOperationHandler.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/CompositeOperationHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,MAAM,MAAM,iCAAiC,CAC5C,IAAI,SAAS,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,EACnD,EAAE,EACF,GAAG,IACA,CACH,GAAG,EAAE,uBAAuB,CAAC,IAAI,CAAC,EAClC,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,0BAA0B,CAAC,IAAI,CAAC,KACpC,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1C,qBAAa,yBAAyB,CACrC,IAAI,SAAS,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,EACnD,EAAE,EACF,GAAG;IAEH,QAAQ,CAAC,IAAI,EAAE,2BAA2B,CAA+B;IACzE,QAAQ,CAAC,eAAe,EAAE,iCAAiC,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;gBAG1E,eAAe,EAAE,iCAAiC,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC;CAIlE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompositeOperationHandler = void 0;
|
|
4
|
+
class CompositeOperationHandler {
|
|
5
|
+
constructor(handlerFunction) {
|
|
6
|
+
this._tag = 'CompositeOperationHandler';
|
|
7
|
+
this.handlerFunction = handlerFunction;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.CompositeOperationHandler = CompositeOperationHandler;
|
|
@@ -0,0 +1,83 @@
|
|
|
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 HttpOperationMultipartBody = {
|
|
6
|
+
fields: Record<string, string>;
|
|
7
|
+
files: Record<string, FileReference>;
|
|
8
|
+
};
|
|
9
|
+
export type HttpOperationBody = FileReference | string | DynamicType | HttpOperationMultipartBody | undefined;
|
|
10
|
+
export declare class HttpOperationRequestBuilder {
|
|
11
|
+
private readonly path;
|
|
12
|
+
private readonly method;
|
|
13
|
+
private readonly request;
|
|
14
|
+
constructor(method: HttpMethod, path: string, request: HttpRequest);
|
|
15
|
+
withBodyAsJson<T extends DynamicType>(body: T): HttpOperationRequest;
|
|
16
|
+
withBodyAsText(body: string): HttpOperationRequest;
|
|
17
|
+
withBodyAsMultipart(body: HttpOperationMultipartBody): HttpOperationRequest;
|
|
18
|
+
withBodyAsFile(file: FileReference): HttpOperationRequest;
|
|
19
|
+
withoutBody(): HttpOperationRequest;
|
|
20
|
+
addPathParameter(name: string, value: string): HttpOperationRequestBuilder;
|
|
21
|
+
addQueryString(name: string, value: string): HttpOperationRequestBuilder;
|
|
22
|
+
withBearerToken(token: string): HttpOperationRequestBuilder;
|
|
23
|
+
addHeader(name: string, value: HttpHeaderValue): HttpOperationRequestBuilder;
|
|
24
|
+
}
|
|
25
|
+
export declare class HttpOperationRequest {
|
|
26
|
+
readonly path: string;
|
|
27
|
+
readonly method: HttpMethod;
|
|
28
|
+
readonly request: HttpRequest;
|
|
29
|
+
readonly contentType: O.Option<HttpContentType>;
|
|
30
|
+
readonly body: HttpOperationBody;
|
|
31
|
+
constructor(path: string, method: HttpMethod, request: HttpRequest, contentType: O.Option<HttpContentType>, body: HttpOperationBody);
|
|
32
|
+
}
|
|
33
|
+
export type HttpOperationRequestHandler<AUTH extends OperationHandlerAuth<unknown, unknown>, IN> = (ctx: OperationHandlerContext<AUTH>, input: IN, request: HttpOperationRequestBuilder) => HttpOperationRequest;
|
|
34
|
+
export type HttpOperationResponseErrorHandling<OUT> = () => OperationHandlerResult<OUT>;
|
|
35
|
+
export type HttpOperationResponseParser<BODY, OUT> = (body: BODY) => OperationHandlerResult<OUT>;
|
|
36
|
+
export declare class HttpOperationResponseBuilder<OUT> {
|
|
37
|
+
private response;
|
|
38
|
+
private errorHandling;
|
|
39
|
+
constructor(response: HttpResponse, errorHandling: HttpOperationResponseErrorHandling<OUT>);
|
|
40
|
+
getStatusCode(): number;
|
|
41
|
+
getHeader(name: string): HttpHeaderValue | undefined;
|
|
42
|
+
withErrorHandling(errorHandling: HttpOperationResponseErrorHandling<OUT>): HttpOperationResponseBuilder<OUT>;
|
|
43
|
+
parseWithoutBody(responseParser: HttpOperationResponseParser<undefined, OUT>): HttpOperationResponse<OUT>;
|
|
44
|
+
parseWithBodyAsText(responseParser: HttpOperationResponseParser<string, OUT>): HttpOperationResponse<OUT>;
|
|
45
|
+
parseWithBodyAsJson<T extends DynamicType>(responseParser?: HttpOperationResponseParser<T, OUT>): HttpOperationResponse<OUT>;
|
|
46
|
+
parseWithBodyAsFile<FileReference>(responseParser: HttpOperationResponseParser<FileReference, OUT>): HttpOperationResponse<OUT>;
|
|
47
|
+
}
|
|
48
|
+
export declare class HttpOperationResponse<OUT> {
|
|
49
|
+
readonly response: HttpResponse;
|
|
50
|
+
readonly errorHandling: HttpOperationResponseErrorHandling<OUT>;
|
|
51
|
+
readonly contentType: O.Option<HttpContentType>;
|
|
52
|
+
readonly responseParser: HttpOperationResponseParser<any, OUT>;
|
|
53
|
+
constructor(response: HttpResponse, errorHandling: HttpOperationResponseErrorHandling<OUT>, contentType: O.Option<HttpContentType>, responseParser: HttpOperationResponseParser<any, OUT>);
|
|
54
|
+
}
|
|
55
|
+
export type HttpOperationResponseHandler<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = (ctx: OperationHandlerContext<AUTH>, input: IN, response: HttpOperationResponseBuilder<OUT>) => HttpOperationResponse<OUT>;
|
|
56
|
+
export declare class HttpOperationHandler<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> {
|
|
57
|
+
readonly _tag: 'HttpOperationHandler';
|
|
58
|
+
readonly request: HttpOperationRequestBuilder;
|
|
59
|
+
readonly requestHandler: HttpOperationRequestHandler<AUTH, IN>;
|
|
60
|
+
readonly responseHandler: HttpOperationResponseHandler<AUTH, IN, OUT>;
|
|
61
|
+
constructor(request: HttpOperationRequestBuilder, requestHandler: HttpOperationRequestHandler<AUTH, IN>, responseHandler: HttpOperationResponseHandler<AUTH, IN, OUT>);
|
|
62
|
+
}
|
|
63
|
+
export declare class HttpOperationHandlerResponseConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> {
|
|
64
|
+
private request;
|
|
65
|
+
private requestHandler;
|
|
66
|
+
constructor(request: HttpOperationRequestBuilder, requestHandler: HttpOperationRequestHandler<AUTH, IN>);
|
|
67
|
+
handleResponse(responseHandler: HttpOperationResponseHandler<AUTH, IN, OUT>): HttpOperationHandler<AUTH, IN, OUT>;
|
|
68
|
+
}
|
|
69
|
+
export declare class HttpOperationHandlerRequestConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> {
|
|
70
|
+
private request;
|
|
71
|
+
constructor(request: HttpOperationRequestBuilder);
|
|
72
|
+
handleRequest(requestHandler: HttpOperationRequestHandler<AUTH, IN>): HttpOperationHandlerResponseConfiguration<AUTH, IN, OUT>;
|
|
73
|
+
}
|
|
74
|
+
export declare class HttpOperationHandlerConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> {
|
|
75
|
+
get(path: string): HttpOperationHandlerRequestConfiguration<AUTH, IN, OUT>;
|
|
76
|
+
post(path: string): HttpOperationHandlerRequestConfiguration<AUTH, IN, OUT>;
|
|
77
|
+
put(path: string): HttpOperationHandlerRequestConfiguration<AUTH, IN, OUT>;
|
|
78
|
+
patch(path: string): HttpOperationHandlerRequestConfiguration<AUTH, IN, OUT>;
|
|
79
|
+
delete(path: string): HttpOperationHandlerRequestConfiguration<AUTH, IN, OUT>;
|
|
80
|
+
private initialRequest;
|
|
81
|
+
}
|
|
82
|
+
export type HttpOperationHandlerSetup<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = (http: HttpOperationHandlerConfiguration<AUTH, IN, OUT>) => HttpOperationHandler<AUTH, IN, OUT>;
|
|
83
|
+
//# sourceMappingURL=HttpOperationHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,EACZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAItE,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,aAAa,EACb,MAAM,oBAAoB,CAAC;AAiB5B,MAAM,MAAM,0BAA0B,GAAG;IACxC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,aAA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,GAAG,wCAAwC,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC;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"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.HttpOperationHandlerConfiguration = exports.HttpOperationHandlerRequestConfiguration = exports.HttpOperationHandlerResponseConfiguration = exports.HttpOperationHandler = exports.HttpOperationResponse = exports.HttpOperationResponseBuilder = exports.HttpOperationRequest = exports.HttpOperationRequestBuilder = void 0;
|
|
27
|
+
const Http_1 = require("@trayio/commons/http/Http");
|
|
28
|
+
const BufferExtensions_1 = require("@trayio/commons/buffer/BufferExtensions");
|
|
29
|
+
const fs = __importStar(require("fs"));
|
|
30
|
+
const pathLib = __importStar(require("path"));
|
|
31
|
+
const O = __importStar(require("fp-ts/Option"));
|
|
32
|
+
const OperationHandler_1 = require("./OperationHandler");
|
|
33
|
+
// TODO: move to TTM
|
|
34
|
+
const readJsonFile = (jsonFilePath) => JSON.parse(fs.readFileSync(jsonFilePath, 'utf8'));
|
|
35
|
+
// TODO: move to TTM
|
|
36
|
+
const readPackageVersion = () => {
|
|
37
|
+
const packageJsonPath = pathLib.normalize(pathLib.join(__dirname, '../../../package.json'));
|
|
38
|
+
const packageJson = readJsonFile(packageJsonPath);
|
|
39
|
+
return packageJson.version;
|
|
40
|
+
};
|
|
41
|
+
const packageVersion = readPackageVersion();
|
|
42
|
+
class HttpOperationRequestBuilder {
|
|
43
|
+
constructor(method, path, request) {
|
|
44
|
+
this.method = method;
|
|
45
|
+
this.path = path;
|
|
46
|
+
this.request = request;
|
|
47
|
+
}
|
|
48
|
+
withBodyAsJson(body) {
|
|
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);
|
|
52
|
+
}
|
|
53
|
+
withBodyAsText(body) {
|
|
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
|
+
withBodyAsMultipart(body) {
|
|
59
|
+
const contentType = Http_1.HttpContentType.MultipartRequestBody;
|
|
60
|
+
const requestWithHeader = this.addHeader(Http_1.HttpHeader.ContentType, contentType);
|
|
61
|
+
return new HttpOperationRequest(requestWithHeader.path, requestWithHeader.method, requestWithHeader.request, O.some(contentType), body);
|
|
62
|
+
}
|
|
63
|
+
withBodyAsFile(file) {
|
|
64
|
+
const contentType = Http_1.HttpContentType.OctetStream;
|
|
65
|
+
const requestWithHeader = this.addHeader(Http_1.HttpHeader.ContentType, contentType);
|
|
66
|
+
return new HttpOperationRequest(requestWithHeader.path, requestWithHeader.method, requestWithHeader.request, O.some(contentType), file);
|
|
67
|
+
}
|
|
68
|
+
withoutBody() {
|
|
69
|
+
return new HttpOperationRequest(this.path, this.method, this.request, O.none, undefined);
|
|
70
|
+
}
|
|
71
|
+
addPathParameter(name, value) {
|
|
72
|
+
return new HttpOperationRequestBuilder(this.method, this.path, Object.assign(Object.assign({}, this.request), { pathParams: Object.assign(Object.assign({}, this.request.pathParams), { [name]: value }) }));
|
|
73
|
+
}
|
|
74
|
+
addQueryString(name, value) {
|
|
75
|
+
return new HttpOperationRequestBuilder(this.method, this.path, Object.assign(Object.assign({}, this.request), { queryString: Object.assign(Object.assign({}, this.request.queryString), { [name]: value }) }));
|
|
76
|
+
}
|
|
77
|
+
withBearerToken(token) {
|
|
78
|
+
return this.addHeader(Http_1.HttpHeader.Authorization, `Bearer ${token}`);
|
|
79
|
+
}
|
|
80
|
+
addHeader(name, value) {
|
|
81
|
+
return new HttpOperationRequestBuilder(this.method, this.path, Object.assign(Object.assign({}, this.request), { headers: Object.assign(Object.assign({}, this.request.headers), { [name]: value }) }));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.HttpOperationRequestBuilder = HttpOperationRequestBuilder;
|
|
85
|
+
class HttpOperationRequest {
|
|
86
|
+
constructor(path, method, request, contentType, body) {
|
|
87
|
+
this.path = path;
|
|
88
|
+
this.method = method;
|
|
89
|
+
this.request = request;
|
|
90
|
+
this.contentType = contentType;
|
|
91
|
+
this.body = body;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.HttpOperationRequest = HttpOperationRequest;
|
|
95
|
+
class HttpOperationResponseBuilder {
|
|
96
|
+
constructor(response, errorHandling) {
|
|
97
|
+
this.response = response;
|
|
98
|
+
this.errorHandling = errorHandling;
|
|
99
|
+
}
|
|
100
|
+
getStatusCode() {
|
|
101
|
+
return this.response.statusCode;
|
|
102
|
+
}
|
|
103
|
+
getHeader(name) {
|
|
104
|
+
return this.response.headers[name];
|
|
105
|
+
}
|
|
106
|
+
withErrorHandling(errorHandling) {
|
|
107
|
+
return new HttpOperationResponseBuilder(this.response, errorHandling);
|
|
108
|
+
}
|
|
109
|
+
parseWithoutBody(responseParser) {
|
|
110
|
+
return new HttpOperationResponse(this.response, this.errorHandling, O.none, responseParser);
|
|
111
|
+
}
|
|
112
|
+
parseWithBodyAsText(responseParser) {
|
|
113
|
+
return new HttpOperationResponse(this.response, this.errorHandling, O.some(Http_1.HttpContentType.Text), responseParser);
|
|
114
|
+
}
|
|
115
|
+
parseWithBodyAsJson(responseParser = (body) => OperationHandler_1.OperationHandlerResult.success(body)) {
|
|
116
|
+
return new HttpOperationResponse(this.response, this.errorHandling, O.some(Http_1.HttpContentType.Json), responseParser);
|
|
117
|
+
}
|
|
118
|
+
parseWithBodyAsFile(responseParser) {
|
|
119
|
+
return new HttpOperationResponse(this.response, this.errorHandling, O.some(Http_1.HttpContentType.OctetStream), responseParser);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.HttpOperationResponseBuilder = HttpOperationResponseBuilder;
|
|
123
|
+
class HttpOperationResponse {
|
|
124
|
+
constructor(response, errorHandling, contentType, responseParser) {
|
|
125
|
+
this.response = response;
|
|
126
|
+
this.errorHandling = errorHandling;
|
|
127
|
+
this.contentType = contentType;
|
|
128
|
+
this.responseParser = responseParser;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.HttpOperationResponse = HttpOperationResponse;
|
|
132
|
+
class HttpOperationHandler {
|
|
133
|
+
constructor(request, requestHandler, responseHandler) {
|
|
134
|
+
this._tag = 'HttpOperationHandler';
|
|
135
|
+
this.request = request;
|
|
136
|
+
this.requestHandler = requestHandler;
|
|
137
|
+
this.responseHandler = responseHandler;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.HttpOperationHandler = HttpOperationHandler;
|
|
141
|
+
class HttpOperationHandlerResponseConfiguration {
|
|
142
|
+
constructor(request, requestHandler) {
|
|
143
|
+
this.request = request;
|
|
144
|
+
this.requestHandler = requestHandler;
|
|
145
|
+
}
|
|
146
|
+
handleResponse(responseHandler) {
|
|
147
|
+
return new HttpOperationHandler(this.request, this.requestHandler, responseHandler);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
exports.HttpOperationHandlerResponseConfiguration = HttpOperationHandlerResponseConfiguration;
|
|
151
|
+
class HttpOperationHandlerRequestConfiguration {
|
|
152
|
+
constructor(request) {
|
|
153
|
+
this.request = request;
|
|
154
|
+
}
|
|
155
|
+
handleRequest(requestHandler) {
|
|
156
|
+
return new HttpOperationHandlerResponseConfiguration(this.request, requestHandler);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
exports.HttpOperationHandlerRequestConfiguration = HttpOperationHandlerRequestConfiguration;
|
|
160
|
+
class HttpOperationHandlerConfiguration {
|
|
161
|
+
get(path) {
|
|
162
|
+
return new HttpOperationHandlerRequestConfiguration(this.initialRequest(Http_1.HttpMethod.Get, path));
|
|
163
|
+
}
|
|
164
|
+
post(path) {
|
|
165
|
+
return new HttpOperationHandlerRequestConfiguration(this.initialRequest(Http_1.HttpMethod.Post, path));
|
|
166
|
+
}
|
|
167
|
+
put(path) {
|
|
168
|
+
return new HttpOperationHandlerRequestConfiguration(this.initialRequest(Http_1.HttpMethod.Put, path));
|
|
169
|
+
}
|
|
170
|
+
patch(path) {
|
|
171
|
+
return new HttpOperationHandlerRequestConfiguration(this.initialRequest(Http_1.HttpMethod.Patch, path));
|
|
172
|
+
}
|
|
173
|
+
delete(path) {
|
|
174
|
+
return new HttpOperationHandlerRequestConfiguration(this.initialRequest(Http_1.HttpMethod.Delete, path));
|
|
175
|
+
}
|
|
176
|
+
initialRequest(method, path) {
|
|
177
|
+
return new HttpOperationRequestBuilder(method, path, {
|
|
178
|
+
headers: {
|
|
179
|
+
[Http_1.HttpHeader.UserAgent]: `TrayioCDK/${packageVersion}`,
|
|
180
|
+
},
|
|
181
|
+
pathParams: {},
|
|
182
|
+
queryString: {},
|
|
183
|
+
body: BufferExtensions_1.BufferExtensions.arrayBufferToReadable(new ArrayBuffer(0)),
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.HttpOperationHandlerConfiguration = HttpOperationHandlerConfiguration;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { Result, ResultInterface } from '@trayio/commons/result/Result';
|
|
2
|
+
import { DynamicObject } from '@trayio/commons/dynamictype/DynamicType';
|
|
3
|
+
export type OperationHandlerAuth<USER, APP> = {
|
|
4
|
+
authType: string;
|
|
5
|
+
authId: string;
|
|
6
|
+
user: USER;
|
|
7
|
+
app: APP;
|
|
8
|
+
refreshMessage?: string;
|
|
9
|
+
};
|
|
10
|
+
export type TokenOperationHandlerAuth<USER, APP> = OperationHandlerAuth<USER, APP> & {
|
|
11
|
+
authType: 'TOKEN';
|
|
12
|
+
};
|
|
13
|
+
export type Oauth1OperationHandlerAuth<USER, APP> = OperationHandlerAuth<USER, APP> & {
|
|
14
|
+
authType: 'OAUTH1';
|
|
15
|
+
};
|
|
16
|
+
export type Oauth2OperationHandlerAuth<USER, APP> = OperationHandlerAuth<USER, APP> & {
|
|
17
|
+
authType: 'OAUTH2';
|
|
18
|
+
};
|
|
19
|
+
export type Oauth2PasswordOperationHandlerAuth<USER, APP> = OperationHandlerAuth<USER, APP> & {
|
|
20
|
+
authType: 'OAUTH2_PASSWORD';
|
|
21
|
+
};
|
|
22
|
+
export type Oauth2ClientCredentialsOperationHandlerAuth<USER, APP> = OperationHandlerAuth<USER, APP> & {
|
|
23
|
+
authType: 'OAUTH2_CLIENT_CREDENTIALS';
|
|
24
|
+
};
|
|
25
|
+
export type BuiltinOperationHandlerAuth<USER, APP> = OperationHandlerAuth<USER, APP> & {
|
|
26
|
+
authType: 'BUILTIN';
|
|
27
|
+
};
|
|
28
|
+
export type OperationHandlerContext<AUTH extends OperationHandlerAuth<unknown, unknown>> = {
|
|
29
|
+
auth?: AUTH;
|
|
30
|
+
workflowId?: string;
|
|
31
|
+
workflowTitle?: string;
|
|
32
|
+
userId?: string;
|
|
33
|
+
externalUserId?: string;
|
|
34
|
+
executionId?: string;
|
|
35
|
+
organizationId?: string;
|
|
36
|
+
sourceWorkflowId?: string;
|
|
37
|
+
solutionId?: string;
|
|
38
|
+
solutionInstanceId?: string;
|
|
39
|
+
usernameHash?: string;
|
|
40
|
+
workspaceIdHash?: string;
|
|
41
|
+
datapotIdHash?: string;
|
|
42
|
+
};
|
|
43
|
+
export type OperationHandlerReference<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = {
|
|
44
|
+
name: string;
|
|
45
|
+
};
|
|
46
|
+
export type BaseTriggerOperationHttpRequest = {
|
|
47
|
+
method: string;
|
|
48
|
+
path: string;
|
|
49
|
+
headers: Record<string, string[]>;
|
|
50
|
+
query: Record<string, string[]>;
|
|
51
|
+
fragment?: string;
|
|
52
|
+
};
|
|
53
|
+
export type RegularTriggerOperationHttpRequest = BaseTriggerOperationHttpRequest & {
|
|
54
|
+
hasLargeBody: false;
|
|
55
|
+
body: string;
|
|
56
|
+
form?: Record<string, string[]>;
|
|
57
|
+
};
|
|
58
|
+
export type LargeTriggerOperationHttpRequest = BaseTriggerOperationHttpRequest & {
|
|
59
|
+
hasLargeBody: true;
|
|
60
|
+
body_size: number;
|
|
61
|
+
body_url: string;
|
|
62
|
+
body_message: string;
|
|
63
|
+
};
|
|
64
|
+
export type TriggerOperationHttpRequest = RegularTriggerOperationHttpRequest | LargeTriggerOperationHttpRequest;
|
|
65
|
+
export type TriggerOperationHttpResponse = {
|
|
66
|
+
status_code: number;
|
|
67
|
+
headers: Record<string, string[]>;
|
|
68
|
+
body?: string;
|
|
69
|
+
};
|
|
70
|
+
export interface TriggerOperationHttpResponseInterface {
|
|
71
|
+
withStatusCode: (statusCode: number) => TriggerOperationHttpResponse;
|
|
72
|
+
withStatusCodeAndHeaders: (statusCode: number, headers: Record<string, string[]>) => TriggerOperationHttpResponse;
|
|
73
|
+
withStatusCodeAndBody: (statusCode: number, body: string) => TriggerOperationHttpResponse;
|
|
74
|
+
withAllFields: (statusCode: number, headers: Record<string, string[]>, body: string) => TriggerOperationHttpResponse;
|
|
75
|
+
}
|
|
76
|
+
export declare const TriggerOperationHttpResponse: TriggerOperationHttpResponseInterface;
|
|
77
|
+
export type TriggerRequestOperationInput<T> = {
|
|
78
|
+
input: T;
|
|
79
|
+
request: TriggerOperationHttpRequest;
|
|
80
|
+
};
|
|
81
|
+
export type TriggerRequestOperationOutput<T> = {
|
|
82
|
+
output: T;
|
|
83
|
+
response?: TriggerOperationHttpResponse;
|
|
84
|
+
};
|
|
85
|
+
export type TriggerResponseOperationInput<I, R> = {
|
|
86
|
+
input: I;
|
|
87
|
+
response: R;
|
|
88
|
+
};
|
|
89
|
+
export type DDLOperationOutputElement<T extends string | number> = {
|
|
90
|
+
text: string;
|
|
91
|
+
value: T;
|
|
92
|
+
};
|
|
93
|
+
export type DDLOperationOutput<T extends string | number> = {
|
|
94
|
+
result: Array<DDLOperationOutputElement<T>>;
|
|
95
|
+
};
|
|
96
|
+
export type FileReference = {
|
|
97
|
+
name: string;
|
|
98
|
+
url: string;
|
|
99
|
+
mime_type: string;
|
|
100
|
+
expires: number;
|
|
101
|
+
};
|
|
102
|
+
export type OperationHandlerError = ConnectorError | ApiError | UserInputError | OauthRefreshError | SkipTriggerError;
|
|
103
|
+
export type BaseOperationHandlerError = {
|
|
104
|
+
message: string;
|
|
105
|
+
response?: DynamicObject;
|
|
106
|
+
};
|
|
107
|
+
export type ConnectorError = BaseOperationHandlerError & {
|
|
108
|
+
_tag: 'ConnectorError';
|
|
109
|
+
};
|
|
110
|
+
export type ApiError = BaseOperationHandlerError & {
|
|
111
|
+
_tag: 'ApiError';
|
|
112
|
+
};
|
|
113
|
+
export type UserInputError = BaseOperationHandlerError & {
|
|
114
|
+
_tag: 'UserInputError';
|
|
115
|
+
};
|
|
116
|
+
export type OauthRefreshError = BaseOperationHandlerError & {
|
|
117
|
+
_tag: 'OauthRefreshError';
|
|
118
|
+
};
|
|
119
|
+
export type SkipTriggerError = BaseOperationHandlerError & {
|
|
120
|
+
_tag: 'SkipTriggerError';
|
|
121
|
+
};
|
|
122
|
+
export interface OperationHandlerErrorInterface {
|
|
123
|
+
connectorError: (message: string, response?: DynamicObject) => OperationHandlerError;
|
|
124
|
+
apiError: (message: string, response?: DynamicObject) => OperationHandlerError;
|
|
125
|
+
userInputError: (message: string, response?: DynamicObject) => OperationHandlerError;
|
|
126
|
+
oauthRefreshError: (message: string, response?: DynamicObject) => OperationHandlerError;
|
|
127
|
+
skipTriggerError: (message: string, response?: DynamicObject) => OperationHandlerError;
|
|
128
|
+
}
|
|
129
|
+
export declare const OperationHandlerError: OperationHandlerErrorInterface;
|
|
130
|
+
export type OperationHandlerResult<T> = Result<OperationHandlerError, T>;
|
|
131
|
+
export interface OperationHandlerResultInterface extends ResultInterface {
|
|
132
|
+
}
|
|
133
|
+
export declare const OperationHandlerResult: OperationHandlerResultInterface;
|
|
134
|
+
//# sourceMappingURL=OperationHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationHandler.d.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M,EACf,QAAQ,CAAC,EAAE,aAAa,KACpB,qBAAqB,CAAC;IAC3B,QAAQ,EAAE,CACT,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,aAAa,KACpB,qBAAqB,CAAC;IAC3B,cAAc,EAAE,CACf,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,aAAa,KACpB,qBAAqB,CAAC;IAC3B,iBAAiB,EAAE,CAClB,OAAO,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"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationHandlerResult = exports.OperationHandlerError = exports.TriggerOperationHttpResponse = void 0;
|
|
4
|
+
const Result_1 = require("@trayio/commons/result/Result");
|
|
5
|
+
exports.TriggerOperationHttpResponse = {
|
|
6
|
+
withStatusCode: (statusCode) => ({
|
|
7
|
+
status_code: statusCode,
|
|
8
|
+
headers: {},
|
|
9
|
+
}),
|
|
10
|
+
withStatusCodeAndHeaders: (statusCode, headers) => ({
|
|
11
|
+
status_code: statusCode,
|
|
12
|
+
headers,
|
|
13
|
+
}),
|
|
14
|
+
withStatusCodeAndBody: (statusCode, body) => ({
|
|
15
|
+
status_code: statusCode,
|
|
16
|
+
headers: {},
|
|
17
|
+
body,
|
|
18
|
+
}),
|
|
19
|
+
withAllFields: (statusCode, headers, body) => ({
|
|
20
|
+
status_code: statusCode,
|
|
21
|
+
headers,
|
|
22
|
+
body,
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
exports.OperationHandlerError = {
|
|
26
|
+
connectorError: (message, response) => ({
|
|
27
|
+
_tag: 'ConnectorError',
|
|
28
|
+
message,
|
|
29
|
+
response,
|
|
30
|
+
}),
|
|
31
|
+
apiError: (message, response) => ({
|
|
32
|
+
_tag: 'ApiError',
|
|
33
|
+
message,
|
|
34
|
+
response,
|
|
35
|
+
}),
|
|
36
|
+
userInputError: (message, response) => ({
|
|
37
|
+
_tag: 'UserInputError',
|
|
38
|
+
message,
|
|
39
|
+
response,
|
|
40
|
+
}),
|
|
41
|
+
oauthRefreshError: (message, response) => ({
|
|
42
|
+
_tag: 'OauthRefreshError',
|
|
43
|
+
message,
|
|
44
|
+
response,
|
|
45
|
+
}),
|
|
46
|
+
skipTriggerError: (message, response) => ({
|
|
47
|
+
_tag: 'SkipTriggerError',
|
|
48
|
+
message,
|
|
49
|
+
response,
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
52
|
+
exports.OperationHandlerResult = Result_1.Result;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { OperationHandlerAuth, OperationHandlerReference, OperationHandlerResult } from './OperationHandler';
|
|
2
|
+
export type OperationHandlerInvocation<AUTH extends OperationHandlerAuth<unknown, unknown>> = <IN, OUT>(handlerReference: OperationHandlerReference<AUTH, IN, OUT>) => (input: IN) => Promise<OperationHandlerResult<OUT>>;
|
|
3
|
+
//# sourceMappingURL=OperationHandlerInvocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationHandlerInvocation.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/OperationHandlerInvocation.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,yBAAyB,EACzB,sBAAsB,EACtB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,0BAA0B,CACrC,IAAI,SAAS,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,IAChD,CAAC,EAAE,EAAE,GAAG,EACX,gBAAgB,EAAE,yBAAyB,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,KACtD,CAAC,KAAK,EAAE,EAAE,KAAK,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as O from 'fp-ts/Option';
|
|
2
|
+
import { DynamicObject } from '@trayio/commons/dynamictype/DynamicType';
|
|
3
|
+
import { CompositeOperationHandler, CompositeOperationHandlerFunction } from './CompositeOperationHandler';
|
|
4
|
+
import { HttpOperationHandler, HttpOperationHandlerSetup } from './HttpOperationHandler';
|
|
5
|
+
import { OperationHandlerValidation, OperationHandlerInputValidationSetup, OperationHandlerOutputValidationSetup } from './OperationHandlerValidation';
|
|
6
|
+
import { OperationHandlerAuth, OperationHandlerReference, TriggerOperationHttpResponse, TriggerRequestOperationInput, TriggerRequestOperationOutput, TriggerResponseOperationInput } from './OperationHandler';
|
|
7
|
+
export type OperationHandlerImplementation<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = HttpOperationHandler<AUTH, IN, OUT> | CompositeOperationHandler<AUTH, IN, OUT>;
|
|
8
|
+
export declare class OperationHandler<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly isPrivate: boolean;
|
|
11
|
+
readonly validation: O.Option<OperationHandlerValidation<AUTH, IN, OUT>>;
|
|
12
|
+
readonly implementation: OperationHandlerImplementation<AUTH, IN, OUT>;
|
|
13
|
+
constructor(name: string, isPrivate: boolean, validation: O.Option<OperationHandlerValidation<AUTH, IN, OUT>>, implementation: OperationHandlerImplementation<AUTH, IN, OUT>);
|
|
14
|
+
}
|
|
15
|
+
export declare class OperationHandlerConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> {
|
|
16
|
+
static withName<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT>(name: string): OperationHandlerConfiguration<AUTH, IN, OUT>;
|
|
17
|
+
private name;
|
|
18
|
+
private isPrivate;
|
|
19
|
+
private validation;
|
|
20
|
+
private constructor();
|
|
21
|
+
private(): OperationHandlerConfiguration<AUTH, IN, OUT>;
|
|
22
|
+
addInputValidation(inputValidationSetup: OperationHandlerInputValidationSetup<AUTH, IN>): OperationHandlerConfiguration<AUTH, IN, OUT>;
|
|
23
|
+
addOutputValidation(outputValidationSetup: OperationHandlerOutputValidationSetup<AUTH, IN, OUT>): OperationHandlerConfiguration<AUTH, IN, OUT>;
|
|
24
|
+
usingHttp(httpSetup: HttpOperationHandlerSetup<AUTH, IN, OUT>): OperationHandler<AUTH, IN, OUT>;
|
|
25
|
+
usingComposite(compositeFunction: CompositeOperationHandlerFunction<AUTH, IN, OUT>): OperationHandler<AUTH, IN, OUT>;
|
|
26
|
+
}
|
|
27
|
+
export declare class OperationHandlerRegistry {
|
|
28
|
+
private static instance;
|
|
29
|
+
static register<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT>(handler: OperationHandler<AUTH, IN, OUT>): void;
|
|
30
|
+
static resolve<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT>(reference: OperationHandlerReference<AUTH, IN, OUT>): O.Option<OperationHandler<AUTH, IN, OUT>>;
|
|
31
|
+
private registry;
|
|
32
|
+
private constructor();
|
|
33
|
+
private register;
|
|
34
|
+
private resolve;
|
|
35
|
+
}
|
|
36
|
+
export type OperationHandlerSetup<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = (handler: OperationHandlerConfiguration<AUTH, IN, OUT>) => OperationHandler<AUTH, IN, OUT>;
|
|
37
|
+
export interface OperationHandlerSetupInterface {
|
|
38
|
+
configureHandler: <AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT>(handlerSetup: OperationHandlerSetup<AUTH, IN, OUT>) => OperationHandlerReference<AUTH, IN, OUT>;
|
|
39
|
+
configureTriggerCreateHandler: <AUTH extends OperationHandlerAuth<unknown, unknown>, IN>(handlerSetup: OperationHandlerSetup<AUTH, IN, DynamicObject>) => OperationHandlerReference<AUTH, IN, DynamicObject>;
|
|
40
|
+
configureTriggerDestroyHandler: <AUTH extends OperationHandlerAuth<unknown, unknown>, IN>(handlerSetup: OperationHandlerSetup<AUTH, IN, DynamicObject>) => OperationHandlerReference<AUTH, IN, DynamicObject>;
|
|
41
|
+
configureTriggerRequestHandler: <AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT>(handlerSetup: OperationHandlerSetup<AUTH, TriggerRequestOperationInput<IN>, TriggerRequestOperationOutput<OUT>>) => OperationHandlerReference<AUTH, TriggerRequestOperationInput<IN>, TriggerRequestOperationOutput<OUT>>;
|
|
42
|
+
configureTriggerResponseHandler: <AUTH extends OperationHandlerAuth<unknown, unknown>, IN, RES>(handlerSetup: OperationHandlerSetup<AUTH, TriggerResponseOperationInput<IN, RES>, TriggerOperationHttpResponse>) => OperationHandlerReference<AUTH, TriggerResponseOperationInput<IN, RES>, TriggerOperationHttpResponse>;
|
|
43
|
+
}
|
|
44
|
+
export type OperationDescriptor = {
|
|
45
|
+
name: string;
|
|
46
|
+
title: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
};
|
|
49
|
+
export declare const OperationHandlerSetup: OperationHandlerSetupInterface;
|
|
50
|
+
//# sourceMappingURL=OperationHandlerSetup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationHandlerSetup.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/OperationHandlerSetup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,OAAO,EACN,aAAa,EAEb,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EACN,yBAAyB,EACzB,iCAAiC,EACjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,oBAAoB,EAEpB,yBAAy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