@transai/connector-runner-api 0.1.0 → 0.2.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/index.cjs +2 -0
- package/index.cjs.map +7 -0
- package/index.js +2 -0
- package/index.js.map +7 -0
- package/libs/connector-runner-api/src/lib/connector-runner-api.d.ts +8 -0
- package/libs/connector-runner-api/src/lib/extractor.service.d.ts +9 -0
- package/libs/connector-runner-api/src/lib/http-client-authentication.d.ts +8 -0
- package/libs/connector-runner-api/src/lib/result.handler.d.ts +7 -0
- package/libs/connector-runner-api/src/lib/types.d.ts +30 -0
- package/libs/connector-runtime-sdk/src/index.d.ts +3 -0
- package/libs/connector-runtime-sdk/src/lib/connector-runtime.d.ts +16 -0
- package/libs/connector-runtime-sdk/src/lib/connector-runtime.interface.d.ts +5 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/files.sdk.interface.d.ts +18 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/http-client.interface.d.ts +38 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/index.d.ts +10 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/logger.sdk.interface.d.ts +7 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/offset-store.sdk.interface.d.ts +12 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/processing.sdk.interface.d.ts +13 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/receiver.sdk.interface.d.ts +14 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/sdk.interface.d.ts +31 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/sender.sdk.interface.d.ts +22 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/telemetry.sdk.interface.d.ts +15 -0
- package/libs/connector-runtime-sdk/src/lib/sdk/templating.sdk.interface.d.ts +12 -0
- package/libs/types/src/index.d.ts +7 -0
- package/libs/types/src/lib/cube-query-config.types.d.ts +20 -0
- package/libs/types/src/lib/file-action.types.d.ts +5 -0
- package/libs/types/src/lib/http-status-codes.enum.d.ts +64 -0
- package/libs/types/src/lib/management-api/action-definition.interface.d.ts +12 -0
- package/libs/types/src/lib/management-api/chart.interface.d.ts +9 -0
- package/libs/types/src/lib/management-api/connector/connector.interface.d.ts +140 -0
- package/libs/types/src/lib/management-api/connector/connectors.interface.d.ts +126 -0
- package/libs/types/src/lib/management-api/connector-orchestrator-config.interface.d.ts +14 -0
- package/libs/types/src/lib/management-api/cube-dataset.interface.d.ts +93 -0
- package/libs/types/src/lib/management-api/dashboard.interface.d.ts +35 -0
- package/libs/types/src/lib/management-api/dataset/collection.interface.d.ts +16 -0
- package/libs/types/src/lib/management-api/dataset/dataset-record.interface.d.ts +5 -0
- package/libs/types/src/lib/management-api/dataset/dataset.interface.d.ts +730 -0
- package/libs/types/src/lib/management-api/dataset/datasets.interface.d.ts +710 -0
- package/libs/types/src/lib/management-api/dataset/dimension.interface.d.ts +205 -0
- package/libs/types/src/lib/management-api/dataset/dimensions.interface.d.ts +186 -0
- package/libs/types/src/lib/management-api/dataset/filter-group.interface.d.ts +8 -0
- package/libs/types/src/lib/management-api/dataset/filter.interface.d.ts +34 -0
- package/libs/types/src/lib/management-api/dataset/filters.interface.d.ts +7 -0
- package/libs/types/src/lib/management-api/dataset/measure.interface.d.ts +65 -0
- package/libs/types/src/lib/management-api/dataset/measures.interface.d.ts +56 -0
- package/libs/types/src/lib/management-api/dataset/meta.interface.d.ts +9 -0
- package/libs/types/src/lib/management-api/dataset/pre-aggregate.interface.d.ts +69 -0
- package/libs/types/src/lib/management-api/dataset/pre-aggregations.interface.d.ts +54 -0
- package/libs/types/src/lib/management-api/dataset/relation.interface.d.ts +40 -0
- package/libs/types/src/lib/management-api/dataset/relations.interface.d.ts +36 -0
- package/libs/types/src/lib/management-api/dataset/segment.interface.d.ts +45 -0
- package/libs/types/src/lib/management-api/dataset/segments.interface.d.ts +43 -0
- package/libs/types/src/lib/management-api/dataset/switch.interface.d.ts +70 -0
- package/libs/types/src/lib/management-api/dataset/when-item.interface.d.ts +41 -0
- package/libs/types/src/lib/management-api/dataset/when-items.interface.d.ts +40 -0
- package/libs/types/src/lib/management-api/event-origin.interface.d.ts +24 -0
- package/libs/types/src/lib/management-api/index.d.ts +39 -0
- package/libs/types/src/lib/management-api/semantic-trigger/custom-cron-trigger-record.interface.d.ts +6 -0
- package/libs/types/src/lib/management-api/semantic-trigger/index.d.ts +6 -0
- package/libs/types/src/lib/management-api/semantic-trigger/semantic-trigger-filter.interface.d.ts +20 -0
- package/libs/types/src/lib/management-api/semantic-trigger/semantic-trigger-filters.interface.d.ts +18 -0
- package/libs/types/src/lib/management-api/semantic-trigger/semantic-trigger-record.interface.d.ts +6 -0
- package/libs/types/src/lib/management-api/semantic-trigger/semantic-trigger.interface.d.ts +75 -0
- package/libs/types/src/lib/management-api/semantic-trigger/semantic-triggers.interface.d.ts +62 -0
- package/libs/types/src/lib/management-api/template-implementation-overrides.interface.d.ts +1152 -0
- package/libs/types/src/lib/management-api/template-implementation.interface.d.ts +2860 -0
- package/libs/types/src/lib/management-api/template.interface.d.ts +1191 -0
- package/libs/types/src/lib/management-api/tenant.interface.d.ts +8 -0
- package/libs/types/src/lib/management-api/type-enums.d.ts +85 -0
- package/libs/types/src/lib/management-api/web/generic-filter.dto.d.ts +37 -0
- package/libs/types/src/lib/management-api/web/index.d.ts +2 -0
- package/libs/types/src/lib/management-api/web/paginated-response.interface.d.ts +17 -0
- package/libs/types/src/lib/management-api/workflow/action.interface.d.ts +85 -0
- package/libs/types/src/lib/management-api/workflow/index.d.ts +6 -0
- package/libs/types/src/lib/management-api/workflow/offset.interface.d.ts +14 -0
- package/libs/types/src/lib/management-api/workflow/trigger-types.interface.d.ts +14 -0
- package/libs/types/src/lib/management-api/workflow/workflow-definition.interface.d.ts +57 -0
- package/libs/types/src/lib/management-api/workflow/workflow-run.d.ts +70 -0
- package/libs/types/src/lib/management-api/workflow/workflow.drawing.d.ts +102 -0
- package/libs/types/src/lib/message.types.d.ts +59 -0
- package/libs/types/src/lib/response.types.d.ts +27 -0
- package/libs/types/src/lib/types.d.ts +116 -0
- package/package.json +1 -1
- package/.eslintrc.json +0 -18
- package/jest.config.ts +0 -10
- package/project.json +0 -29
- package/src/lib/connector-runner-api.ts +0 -53
- package/src/lib/extractor.service.spec.ts +0 -90
- package/src/lib/extractor.service.ts +0 -97
- package/src/lib/http-client-authentication.ts +0 -108
- package/src/lib/result.handler.spec.ts +0 -135
- package/src/lib/result.handler.ts +0 -100
- package/src/lib/types.ts +0 -38
- package/tsconfig.json +0 -22
- package/tsconfig.lib.json +0 -10
- package/tsconfig.spec.json +0 -14
- /package/{src/index.ts → libs/connector-runner-api/src/index.d.ts} +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HttpMethod } from '@transai/connector-runtime-sdk';
|
|
2
|
+
import { BaseConnectorConfig } from '@xip-online-data/types';
|
|
3
|
+
export interface HttpClientConfig {
|
|
4
|
+
method?: HttpMethod;
|
|
5
|
+
url?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface HttpClientAuthConfig {
|
|
8
|
+
tokenUrl?: string;
|
|
9
|
+
clientId?: string;
|
|
10
|
+
clientSecret?: string;
|
|
11
|
+
authorization?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ApiConfig extends HttpClientConfig, HttpClientAuthConfig {
|
|
14
|
+
name: string;
|
|
15
|
+
interval: number;
|
|
16
|
+
body?: string;
|
|
17
|
+
batchSize?: number;
|
|
18
|
+
offsetFilePrefix?: string;
|
|
19
|
+
format?: string;
|
|
20
|
+
listField?: string;
|
|
21
|
+
keyField?: string;
|
|
22
|
+
incrementalField?: string;
|
|
23
|
+
type?: 'metric' | 'document';
|
|
24
|
+
metadata?: {
|
|
25
|
+
[key: string]: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface ConnectorConfig extends BaseConnectorConfig, HttpClientConfig, HttpClientAuthConfig {
|
|
29
|
+
apiCalls?: Array<ApiConfig>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { KafkaCallbackResponse, BaseConnectorConfig, ActionInterface, ConnectorInterface, XodJobType } from '@xip-online-data/types';
|
|
2
|
+
import { ConnectorRuntimeInterface } from './connector-runtime.interface';
|
|
3
|
+
import { ConnectorSDKInterface } from './sdk';
|
|
4
|
+
export interface IpcMessage {
|
|
5
|
+
cmd: string;
|
|
6
|
+
message: string;
|
|
7
|
+
}
|
|
8
|
+
export declare abstract class ConnectorRuntimeSDK<T extends BaseConnectorConfig = BaseConnectorConfig> implements ConnectorRuntimeInterface {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(connector: ConnectorInterface, connectorSDK: ConnectorSDKInterface);
|
|
11
|
+
init: () => Promise<void>;
|
|
12
|
+
start: () => Promise<void>;
|
|
13
|
+
stop: () => Promise<void>;
|
|
14
|
+
set callbackFunction(callback: (message: XodJobType, action: ActionInterface) => Promise<KafkaCallbackResponse>);
|
|
15
|
+
protected get connectorSDK(): ConnectorSDKInterface<T>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface FileInfo {
|
|
2
|
+
type: 'DIRECTORY' | 'FILE';
|
|
3
|
+
name: string;
|
|
4
|
+
size: number;
|
|
5
|
+
modifyTime: Date;
|
|
6
|
+
}
|
|
7
|
+
export interface FileHandleInterface {
|
|
8
|
+
get(): Buffer;
|
|
9
|
+
close(): boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface FilesSDKInterface {
|
|
12
|
+
list(path: string): Promise<Array<FileInfo>>;
|
|
13
|
+
read(filePath: string): Promise<FileHandleInterface>;
|
|
14
|
+
write(filePath: string, data: FileHandleInterface | Buffer | string): Promise<boolean>;
|
|
15
|
+
delete(path: string): Promise<boolean>;
|
|
16
|
+
exists(path: string): Promise<boolean>;
|
|
17
|
+
pathAsDsn(path: string): string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface HttpConfig {
|
|
2
|
+
baseUrl?: string;
|
|
3
|
+
contentType?: string;
|
|
4
|
+
timeout?: number;
|
|
5
|
+
}
|
|
6
|
+
export type HttpRequestOptions<D = string | object> = {
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
params?: Record<string, string | number | boolean>;
|
|
9
|
+
data?: D;
|
|
10
|
+
withCredentials?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type HttpRequestOptionsFormatter<D = string | object> = (requestOptions: HttpRequestOptions<D>, method: HttpMethod, url: string) => Promise<HttpRequestOptions<D>> | HttpRequestOptions<D>;
|
|
13
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
14
|
+
export type HttpResponseHeader = string | Array<string> | number | boolean | null;
|
|
15
|
+
export type HttpResponse<D = unknown> = {
|
|
16
|
+
status: number;
|
|
17
|
+
data: D;
|
|
18
|
+
headers?: Record<string, HttpResponseHeader>;
|
|
19
|
+
};
|
|
20
|
+
export type HttpError = {
|
|
21
|
+
status: number;
|
|
22
|
+
error?: string;
|
|
23
|
+
};
|
|
24
|
+
interface PromiseWithReason<T = unknown, R = unknown> extends Promise<T> {
|
|
25
|
+
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: R) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
|
|
26
|
+
catch<TResult = never>(onrejected?: ((reason: R) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
|
|
27
|
+
}
|
|
28
|
+
export type HttpClientPromise<T> = PromiseWithReason<HttpResponse<T>, HttpError>;
|
|
29
|
+
export interface HttpClientSDKInterface {
|
|
30
|
+
get<R = unknown>(destination: string, options?: HttpRequestOptions): HttpClientPromise<R>;
|
|
31
|
+
post<R = unknown, D = string | object>(destination: string, data: D, options?: HttpRequestOptions<D>): HttpClientPromise<R>;
|
|
32
|
+
put<R = unknown, D = string | object>(destination: string, data: D, options?: HttpRequestOptions<D>): HttpClientPromise<R>;
|
|
33
|
+
patch<R = unknown, D = string | object>(destination: string, data: D, options?: HttpRequestOptions<D>): HttpClientPromise<R>;
|
|
34
|
+
delete<R = unknown>(destination: string, options?: HttpRequestOptions): HttpClientPromise<R>;
|
|
35
|
+
request<R = unknown, D = string | object>(method: HttpMethod, url: string, options?: HttpRequestOptions<D>): HttpClientPromise<R>;
|
|
36
|
+
setRequestOptionsFormatter<D = string | object>(formatter: HttpRequestOptionsFormatter<D>): HttpClientSDKInterface;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './sdk.interface';
|
|
2
|
+
export * from './http-client.interface';
|
|
3
|
+
export * from './logger.sdk.interface';
|
|
4
|
+
export * from './offset-store.sdk.interface';
|
|
5
|
+
export * from './processing.sdk.interface';
|
|
6
|
+
export * from './receiver.sdk.interface';
|
|
7
|
+
export * from './sender.sdk.interface';
|
|
8
|
+
export * from './telemetry.sdk.interface';
|
|
9
|
+
export * from './templating.sdk.interface';
|
|
10
|
+
export * from './files.sdk.interface';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface StoredOffset {
|
|
2
|
+
timestamp: number;
|
|
3
|
+
id: number | string;
|
|
4
|
+
isoDate?: string;
|
|
5
|
+
date?: string;
|
|
6
|
+
rawTimestamp?: number | string;
|
|
7
|
+
[key: string]: string | number | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface OffsetStoreSDKInterface {
|
|
10
|
+
getOffset(identifier: string): Promise<StoredOffset>;
|
|
11
|
+
setOffset(offset: StoredOffset, identifier: string): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface IntervalHandler {
|
|
2
|
+
name?: string;
|
|
3
|
+
onInit?: () => Promise<void> | void;
|
|
4
|
+
onRun: () => Promise<void> | void;
|
|
5
|
+
onStop?: () => Promise<void> | void;
|
|
6
|
+
}
|
|
7
|
+
export type RegisterIntervalOptions = {
|
|
8
|
+
immediate?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export interface ProcessingSDKInterface {
|
|
11
|
+
registerInterval(intervalSeconds: number, handler: IntervalHandler, options?: RegisterIntervalOptions): Promise<string>;
|
|
12
|
+
stopInterval(name: string): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ActionInterface, KafkaCallbackResponse, KafkaCallbackResponseType, XodJobType } from '@xip-online-data/types';
|
|
2
|
+
export interface ReceiverSDKInterface {
|
|
3
|
+
readonly responses: {
|
|
4
|
+
readonly ok: KafkaCallbackResponseType;
|
|
5
|
+
readonly created: KafkaCallbackResponseType;
|
|
6
|
+
readonly badRequest: KafkaCallbackResponseType;
|
|
7
|
+
readonly unprocessableEntity: KafkaCallbackResponseType;
|
|
8
|
+
readonly notFound: KafkaCallbackResponseType;
|
|
9
|
+
readonly internalServerError: KafkaCallbackResponseType;
|
|
10
|
+
};
|
|
11
|
+
registerCallback<T extends XodJobType = XodJobType>(callbackFunction: (message: T) => Promise<KafkaCallbackResponse>, eventType?: string, identifier?: string): void;
|
|
12
|
+
getActionConfig(message: XodJobType): ActionInterface | null;
|
|
13
|
+
emitEventType<T extends XodJobType = XodJobType>(callbackFunction: (message: T) => Promise<KafkaCallbackResponse>): (message: T) => Promise<KafkaCallbackResponse>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseConnectorConfig } from '@xip-online-data/types';
|
|
2
|
+
import { FilesSDKInterface } from './files.sdk.interface';
|
|
3
|
+
import { HttpClientSDKInterface, HttpConfig } from './http-client.interface';
|
|
4
|
+
import { LoggerSDKInterface } from './logger.sdk.interface';
|
|
5
|
+
import { OffsetStoreSDKInterface } from './offset-store.sdk.interface';
|
|
6
|
+
import { ProcessingSDKInterface } from './processing.sdk.interface';
|
|
7
|
+
import { ReceiverSDKInterface } from './receiver.sdk.interface';
|
|
8
|
+
import { SenderSDKInterface } from './sender.sdk.interface';
|
|
9
|
+
import { TelemetrySDKInterface } from './telemetry.sdk.interface';
|
|
10
|
+
import { TemplatingSDKInterface } from './templating.sdk.interface';
|
|
11
|
+
export interface ConnectorSDKInterface<T = BaseConnectorConfig> {
|
|
12
|
+
get config(): T;
|
|
13
|
+
get logger(): LoggerSDKInterface;
|
|
14
|
+
get sender(): SenderSDKInterface;
|
|
15
|
+
get receiver(): ReceiverSDKInterface;
|
|
16
|
+
get templating(): TemplatingSDKInterface;
|
|
17
|
+
/**
|
|
18
|
+
* Service to schedule and manage processing tasks that need monitoring and retries.
|
|
19
|
+
*/
|
|
20
|
+
get processing(): ProcessingSDKInterface;
|
|
21
|
+
get offsetStore(): OffsetStoreSDKInterface;
|
|
22
|
+
/**
|
|
23
|
+
* Ability to send telemetry data such as gauges and increments on how the connector is performing.
|
|
24
|
+
*/
|
|
25
|
+
get telemetry(): TelemetrySDKInterface;
|
|
26
|
+
/**
|
|
27
|
+
* Get file service instance to access files using a specified DSN. If no DSN is provided, defaults to local file system tmp dir.
|
|
28
|
+
*/
|
|
29
|
+
files(dsn?: string): FilesSDKInterface;
|
|
30
|
+
httpClient(httpConfig?: HttpConfig): HttpClientSDKInterface;
|
|
31
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface Metric {
|
|
2
|
+
key: string;
|
|
3
|
+
value: number;
|
|
4
|
+
}
|
|
5
|
+
export type Metadata = {
|
|
6
|
+
[key: string]: string;
|
|
7
|
+
};
|
|
8
|
+
export interface Context {
|
|
9
|
+
timestamp?: Date;
|
|
10
|
+
ttl?: number;
|
|
11
|
+
extraPayload?: {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export type Result = boolean | {
|
|
16
|
+
[index: number]: boolean;
|
|
17
|
+
};
|
|
18
|
+
export interface SenderSDKInterface {
|
|
19
|
+
metrics(metrics: Array<Metric>, metadata?: Metadata, context?: Context): Promise<Result>;
|
|
20
|
+
metricsLegacy(metrics: Array<never>, metadata?: Metadata, context?: Context): Promise<Result>;
|
|
21
|
+
documents(metrics: Array<object>, metadata?: Metadata, context?: Context): Promise<Result>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface TelemetrySDKInterface {
|
|
2
|
+
/**
|
|
3
|
+
* Increment a telemetry counter by 1.
|
|
4
|
+
*/
|
|
5
|
+
increment(key: string): void;
|
|
6
|
+
/**
|
|
7
|
+
* Increment a telemetry counter by a specified value. 0 doesn't send any telemetry.
|
|
8
|
+
* A negative value will decrement the counter.
|
|
9
|
+
*/
|
|
10
|
+
increment(key: string, value: number): void;
|
|
11
|
+
/**
|
|
12
|
+
* Send a gauge telemetry metric.
|
|
13
|
+
*/
|
|
14
|
+
gauge(key: string, value: number): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type RuntimeOptions = {
|
|
2
|
+
partial?: boolean;
|
|
3
|
+
};
|
|
4
|
+
export type CompileDelegate<T = unknown> = {
|
|
5
|
+
(context: T, options?: RuntimeOptions): string;
|
|
6
|
+
};
|
|
7
|
+
export type CompileOptions = {
|
|
8
|
+
strict?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export interface TemplatingSDKInterface {
|
|
11
|
+
compile<T = unknown>(input: string, options?: CompileOptions): CompileDelegate<T>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './lib/types';
|
|
2
|
+
export * from './lib/response.types';
|
|
3
|
+
export * from './lib/message.types';
|
|
4
|
+
export * from './lib/cube-query-config.types';
|
|
5
|
+
export * from './lib/file-action.types';
|
|
6
|
+
export * from './lib/management-api';
|
|
7
|
+
export * from './lib/http-status-codes.enum';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Query } from '@cubejs-client/core';
|
|
2
|
+
export interface CubeQueryConfig {
|
|
3
|
+
tenantId: string;
|
|
4
|
+
query: Query;
|
|
5
|
+
nullable?: boolean;
|
|
6
|
+
subqueries: Array<CubeSubQueryConfig>;
|
|
7
|
+
}
|
|
8
|
+
export interface CubeSubQueryConfig {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
query: Query;
|
|
11
|
+
nullable?: boolean;
|
|
12
|
+
field: string;
|
|
13
|
+
joinConditions: Array<CubeJoinCondition>;
|
|
14
|
+
}
|
|
15
|
+
export interface CubeJoinCondition {
|
|
16
|
+
selectField: string;
|
|
17
|
+
operator: string;
|
|
18
|
+
valueField: Array<string>;
|
|
19
|
+
valueMap?: Array<any>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export declare enum HttpStatusCode {
|
|
2
|
+
Continue = 100,
|
|
3
|
+
SwitchingProtocols = 101,
|
|
4
|
+
Processing = 102,
|
|
5
|
+
OK = 200,
|
|
6
|
+
Created = 201,
|
|
7
|
+
Accepted = 202,
|
|
8
|
+
NonAuthoritativeInformation = 203,
|
|
9
|
+
NoContent = 204,
|
|
10
|
+
ResetContent = 205,
|
|
11
|
+
PartialContent = 206,
|
|
12
|
+
MultiStatus = 207,
|
|
13
|
+
AlreadyReported = 208,
|
|
14
|
+
IMUsed = 226,
|
|
15
|
+
MultipleChoices = 300,
|
|
16
|
+
MovedPermanently = 301,
|
|
17
|
+
Found = 302,
|
|
18
|
+
SeeOther = 303,
|
|
19
|
+
NotModified = 304,
|
|
20
|
+
UseProxy = 305,
|
|
21
|
+
TemporaryRedirect = 307,
|
|
22
|
+
PermanentRedirect = 308,
|
|
23
|
+
BadRequest = 400,
|
|
24
|
+
Unauthorized = 401,
|
|
25
|
+
PaymentRequired = 402,
|
|
26
|
+
Forbidden = 403,
|
|
27
|
+
NotFound = 404,
|
|
28
|
+
MethodNotAllowed = 405,
|
|
29
|
+
NotAcceptable = 406,
|
|
30
|
+
ProxyAuthenticationRequired = 407,
|
|
31
|
+
RequestTimeout = 408,
|
|
32
|
+
Conflict = 409,
|
|
33
|
+
Gone = 410,
|
|
34
|
+
LengthRequired = 411,
|
|
35
|
+
PreconditionFailed = 412,
|
|
36
|
+
PayloadTooLarge = 413,
|
|
37
|
+
URITooLong = 414,
|
|
38
|
+
UnsupportedMediaType = 415,
|
|
39
|
+
RangeNotSatisfiable = 416,
|
|
40
|
+
ExpectationFailed = 417,
|
|
41
|
+
ImATeapot = 418,
|
|
42
|
+
MisdirectedRequest = 421,
|
|
43
|
+
UnprocessableEntity = 422,
|
|
44
|
+
Locked = 423,
|
|
45
|
+
FailedDependency = 424,
|
|
46
|
+
TooEarly = 425,
|
|
47
|
+
UpgradeRequired = 426,
|
|
48
|
+
PreconditionRequired = 428,
|
|
49
|
+
TooManyRequests = 429,
|
|
50
|
+
RequestHeaderFieldsTooLarge = 431,
|
|
51
|
+
UnavailableForLegalReasons = 451,
|
|
52
|
+
InternalServerError = 500,
|
|
53
|
+
NotImplemented = 501,
|
|
54
|
+
BadGateway = 502,
|
|
55
|
+
ServiceUnavailable = 503,
|
|
56
|
+
GatewayTimeout = 504,
|
|
57
|
+
HTTPVersionNotSupported = 505,
|
|
58
|
+
VariantAlsoNegotiates = 506,
|
|
59
|
+
InsufficientStorage = 507,
|
|
60
|
+
LoopDetected = 508,
|
|
61
|
+
NotExtended = 510,
|
|
62
|
+
NetworkAuthenticationRequired = 511,
|
|
63
|
+
Aborted = 512
|
|
64
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TenantInterface } from './tenant.interface';
|
|
2
|
+
import { CubeQueryConfig } from '../cube-query-config.types';
|
|
3
|
+
export interface ActionDefinitionInterface {
|
|
4
|
+
tenant: TenantInterface;
|
|
5
|
+
eventType: string;
|
|
6
|
+
eventTopic: string;
|
|
7
|
+
destinationTopic: string;
|
|
8
|
+
actionIdentifier: string;
|
|
9
|
+
template: string;
|
|
10
|
+
fileNameTemplate: string | undefined;
|
|
11
|
+
queryConfig: CubeQueryConfig | undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseConnectorConfig, ConfiguredConnectorTypes } from '../../types';
|
|
3
|
+
import { ConnectorOrigin } from '../type-enums';
|
|
4
|
+
import { ActionInterface } from '../workflow';
|
|
5
|
+
export declare const ConnectorSchema: z.ZodObject<{
|
|
6
|
+
identifier: z.ZodString;
|
|
7
|
+
connectorType: z.ZodNativeEnum<typeof ConfiguredConnectorTypes>;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
location: z.ZodString;
|
|
10
|
+
config: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
11
|
+
enabled: z.ZodBoolean;
|
|
12
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
13
|
+
identifier: z.ZodString;
|
|
14
|
+
version: z.ZodString;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
description: z.ZodOptional<z.ZodString>;
|
|
17
|
+
config: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
18
|
+
inputParameters: z.ZodArray<z.ZodObject<{
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
type: z.ZodEnum<["string", "number", "boolean", "array"]>;
|
|
21
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
items: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
type: "string" | "number" | "boolean" | "array";
|
|
25
|
+
name: string;
|
|
26
|
+
required?: boolean | undefined;
|
|
27
|
+
items?: any[] | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
type: "string" | "number" | "boolean" | "array";
|
|
30
|
+
name: string;
|
|
31
|
+
required?: boolean | undefined;
|
|
32
|
+
items?: any[] | undefined;
|
|
33
|
+
}>, "many">;
|
|
34
|
+
outputParameters: z.ZodAny;
|
|
35
|
+
mode: z.ZodOptional<z.ZodNativeEnum<typeof ConnectorOrigin>>;
|
|
36
|
+
createdAt: z.ZodOptional<z.ZodDate>;
|
|
37
|
+
updatedAt: z.ZodOptional<z.ZodDate>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
identifier: string;
|
|
40
|
+
version: string;
|
|
41
|
+
name: string;
|
|
42
|
+
config: Record<string, any>;
|
|
43
|
+
inputParameters: {
|
|
44
|
+
type: "string" | "number" | "boolean" | "array";
|
|
45
|
+
name: string;
|
|
46
|
+
required?: boolean | undefined;
|
|
47
|
+
items?: any[] | undefined;
|
|
48
|
+
}[];
|
|
49
|
+
mode?: ConnectorOrigin | undefined;
|
|
50
|
+
createdAt?: Date | undefined;
|
|
51
|
+
description?: string | undefined;
|
|
52
|
+
outputParameters?: any;
|
|
53
|
+
updatedAt?: Date | undefined;
|
|
54
|
+
}, {
|
|
55
|
+
identifier: string;
|
|
56
|
+
version: string;
|
|
57
|
+
name: string;
|
|
58
|
+
config: Record<string, any>;
|
|
59
|
+
inputParameters: {
|
|
60
|
+
type: "string" | "number" | "boolean" | "array";
|
|
61
|
+
name: string;
|
|
62
|
+
required?: boolean | undefined;
|
|
63
|
+
items?: any[] | undefined;
|
|
64
|
+
}[];
|
|
65
|
+
mode?: ConnectorOrigin | undefined;
|
|
66
|
+
createdAt?: Date | undefined;
|
|
67
|
+
description?: string | undefined;
|
|
68
|
+
outputParameters?: any;
|
|
69
|
+
updatedAt?: Date | undefined;
|
|
70
|
+
}>, "many">>;
|
|
71
|
+
createdAt: z.ZodOptional<z.ZodDate>;
|
|
72
|
+
updatedAt: z.ZodOptional<z.ZodDate>;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
identifier: string;
|
|
75
|
+
name: string;
|
|
76
|
+
config: Record<string, any>;
|
|
77
|
+
connectorType: ConfiguredConnectorTypes;
|
|
78
|
+
location: string;
|
|
79
|
+
enabled: boolean;
|
|
80
|
+
createdAt?: Date | undefined;
|
|
81
|
+
updatedAt?: Date | undefined;
|
|
82
|
+
actions?: {
|
|
83
|
+
identifier: string;
|
|
84
|
+
version: string;
|
|
85
|
+
name: string;
|
|
86
|
+
config: Record<string, any>;
|
|
87
|
+
inputParameters: {
|
|
88
|
+
type: "string" | "number" | "boolean" | "array";
|
|
89
|
+
name: string;
|
|
90
|
+
required?: boolean | undefined;
|
|
91
|
+
items?: any[] | undefined;
|
|
92
|
+
}[];
|
|
93
|
+
mode?: ConnectorOrigin | undefined;
|
|
94
|
+
createdAt?: Date | undefined;
|
|
95
|
+
description?: string | undefined;
|
|
96
|
+
outputParameters?: any;
|
|
97
|
+
updatedAt?: Date | undefined;
|
|
98
|
+
}[] | undefined;
|
|
99
|
+
}, {
|
|
100
|
+
identifier: string;
|
|
101
|
+
name: string;
|
|
102
|
+
config: Record<string, any>;
|
|
103
|
+
connectorType: ConfiguredConnectorTypes;
|
|
104
|
+
location: string;
|
|
105
|
+
enabled: boolean;
|
|
106
|
+
createdAt?: Date | undefined;
|
|
107
|
+
updatedAt?: Date | undefined;
|
|
108
|
+
actions?: {
|
|
109
|
+
identifier: string;
|
|
110
|
+
version: string;
|
|
111
|
+
name: string;
|
|
112
|
+
config: Record<string, any>;
|
|
113
|
+
inputParameters: {
|
|
114
|
+
type: "string" | "number" | "boolean" | "array";
|
|
115
|
+
name: string;
|
|
116
|
+
required?: boolean | undefined;
|
|
117
|
+
items?: any[] | undefined;
|
|
118
|
+
}[];
|
|
119
|
+
mode?: ConnectorOrigin | undefined;
|
|
120
|
+
createdAt?: Date | undefined;
|
|
121
|
+
description?: string | undefined;
|
|
122
|
+
outputParameters?: any;
|
|
123
|
+
updatedAt?: Date | undefined;
|
|
124
|
+
}[] | undefined;
|
|
125
|
+
}>;
|
|
126
|
+
export interface ConnectorInterface<T = Partial<BaseConnectorConfig>> {
|
|
127
|
+
identifier: string;
|
|
128
|
+
connectorType: ConfiguredConnectorTypes;
|
|
129
|
+
tenantIdentifier: string;
|
|
130
|
+
name: string;
|
|
131
|
+
location: string;
|
|
132
|
+
config?: T;
|
|
133
|
+
enabled: boolean;
|
|
134
|
+
actions?: Array<ActionInterface>;
|
|
135
|
+
mode?: ConnectorOrigin;
|
|
136
|
+
createdAt?: Date;
|
|
137
|
+
updatedAt?: Date;
|
|
138
|
+
}
|
|
139
|
+
export type CreateConnectorInterface<T = Partial<BaseConnectorConfig>> = Omit<ConnectorInterface<T>, 'id' | 'createdAt' | 'updatedAt' | 'mode'>;
|
|
140
|
+
export type UpdateConnectorInterface<T = Partial<BaseConnectorConfig>> = Partial<Omit<ConnectorInterface<T>, 'id' | 'tenantIdentifier' | 'identifier' | 'createdAt' | 'mode'>>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ConnectorInterface } from '../index';
|
|
3
|
+
export declare const ConnectorsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
4
|
+
identifier: z.ZodString;
|
|
5
|
+
connectorType: z.ZodNativeEnum<typeof import("../../types").ConfiguredConnectorTypes>;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
location: z.ZodString;
|
|
8
|
+
config: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
9
|
+
enabled: z.ZodBoolean;
|
|
10
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
11
|
+
identifier: z.ZodString;
|
|
12
|
+
version: z.ZodString;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
description: z.ZodOptional<z.ZodString>;
|
|
15
|
+
config: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
16
|
+
inputParameters: z.ZodArray<z.ZodObject<{
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
type: z.ZodEnum<["string", "number", "boolean", "array"]>;
|
|
19
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
items: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
type: "string" | "number" | "boolean" | "array";
|
|
23
|
+
name: string;
|
|
24
|
+
required?: boolean | undefined;
|
|
25
|
+
items?: any[] | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
type: "string" | "number" | "boolean" | "array";
|
|
28
|
+
name: string;
|
|
29
|
+
required?: boolean | undefined;
|
|
30
|
+
items?: any[] | undefined;
|
|
31
|
+
}>, "many">;
|
|
32
|
+
outputParameters: z.ZodAny;
|
|
33
|
+
mode: z.ZodOptional<z.ZodNativeEnum<typeof import("../type-enums").ConnectorOrigin>>;
|
|
34
|
+
createdAt: z.ZodOptional<z.ZodDate>;
|
|
35
|
+
updatedAt: z.ZodOptional<z.ZodDate>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
identifier: string;
|
|
38
|
+
version: string;
|
|
39
|
+
name: string;
|
|
40
|
+
config: Record<string, any>;
|
|
41
|
+
inputParameters: {
|
|
42
|
+
type: "string" | "number" | "boolean" | "array";
|
|
43
|
+
name: string;
|
|
44
|
+
required?: boolean | undefined;
|
|
45
|
+
items?: any[] | undefined;
|
|
46
|
+
}[];
|
|
47
|
+
mode?: import("../type-enums").ConnectorOrigin | undefined;
|
|
48
|
+
createdAt?: Date | undefined;
|
|
49
|
+
description?: string | undefined;
|
|
50
|
+
outputParameters?: any;
|
|
51
|
+
updatedAt?: Date | undefined;
|
|
52
|
+
}, {
|
|
53
|
+
identifier: string;
|
|
54
|
+
version: string;
|
|
55
|
+
name: string;
|
|
56
|
+
config: Record<string, any>;
|
|
57
|
+
inputParameters: {
|
|
58
|
+
type: "string" | "number" | "boolean" | "array";
|
|
59
|
+
name: string;
|
|
60
|
+
required?: boolean | undefined;
|
|
61
|
+
items?: any[] | undefined;
|
|
62
|
+
}[];
|
|
63
|
+
mode?: import("../type-enums").ConnectorOrigin | undefined;
|
|
64
|
+
createdAt?: Date | undefined;
|
|
65
|
+
description?: string | undefined;
|
|
66
|
+
outputParameters?: any;
|
|
67
|
+
updatedAt?: Date | undefined;
|
|
68
|
+
}>, "many">>;
|
|
69
|
+
createdAt: z.ZodOptional<z.ZodDate>;
|
|
70
|
+
updatedAt: z.ZodOptional<z.ZodDate>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
identifier: string;
|
|
73
|
+
name: string;
|
|
74
|
+
config: Record<string, any>;
|
|
75
|
+
connectorType: import("../../types").ConfiguredConnectorTypes;
|
|
76
|
+
location: string;
|
|
77
|
+
enabled: boolean;
|
|
78
|
+
createdAt?: Date | undefined;
|
|
79
|
+
updatedAt?: Date | undefined;
|
|
80
|
+
actions?: {
|
|
81
|
+
identifier: string;
|
|
82
|
+
version: string;
|
|
83
|
+
name: string;
|
|
84
|
+
config: Record<string, any>;
|
|
85
|
+
inputParameters: {
|
|
86
|
+
type: "string" | "number" | "boolean" | "array";
|
|
87
|
+
name: string;
|
|
88
|
+
required?: boolean | undefined;
|
|
89
|
+
items?: any[] | undefined;
|
|
90
|
+
}[];
|
|
91
|
+
mode?: import("../type-enums").ConnectorOrigin | undefined;
|
|
92
|
+
createdAt?: Date | undefined;
|
|
93
|
+
description?: string | undefined;
|
|
94
|
+
outputParameters?: any;
|
|
95
|
+
updatedAt?: Date | undefined;
|
|
96
|
+
}[] | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
identifier: string;
|
|
99
|
+
name: string;
|
|
100
|
+
config: Record<string, any>;
|
|
101
|
+
connectorType: import("../../types").ConfiguredConnectorTypes;
|
|
102
|
+
location: string;
|
|
103
|
+
enabled: boolean;
|
|
104
|
+
createdAt?: Date | undefined;
|
|
105
|
+
updatedAt?: Date | undefined;
|
|
106
|
+
actions?: {
|
|
107
|
+
identifier: string;
|
|
108
|
+
version: string;
|
|
109
|
+
name: string;
|
|
110
|
+
config: Record<string, any>;
|
|
111
|
+
inputParameters: {
|
|
112
|
+
type: "string" | "number" | "boolean" | "array";
|
|
113
|
+
name: string;
|
|
114
|
+
required?: boolean | undefined;
|
|
115
|
+
items?: any[] | undefined;
|
|
116
|
+
}[];
|
|
117
|
+
mode?: import("../type-enums").ConnectorOrigin | undefined;
|
|
118
|
+
createdAt?: Date | undefined;
|
|
119
|
+
description?: string | undefined;
|
|
120
|
+
outputParameters?: any;
|
|
121
|
+
updatedAt?: Date | undefined;
|
|
122
|
+
}[] | undefined;
|
|
123
|
+
}>, z.ZodBoolean]>>;
|
|
124
|
+
export interface ConnectorsInterface {
|
|
125
|
+
[key: string]: ConnectorInterface | boolean;
|
|
126
|
+
}
|