@transai/connector-runner-gpms 0.1.0 → 0.3.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.
@@ -1,7 +1,7 @@
1
- import { ActionInterface, ConnectorSDKInterface, HttpClientSDKInterface, KafkaCallbackResponse, XodBaseMessageType } from '@transai/connector-runtime-sdk';
2
- export interface GpmsActionInterface {
1
+ import { ActionInterface, ConnectorSDKInterface, HttpClientSDKInterface } from '@transai/connector-runtime-sdk';
2
+ export interface GpmsActionInterface<R = Record<string, unknown>> {
3
3
  readonly identifier: string;
4
- execute(inputs: Record<string, unknown>, action: ActionInterface): Promise<((message: XodBaseMessageType) => Promise<KafkaCallbackResponse>) | null>;
4
+ execute(inputs: Record<string, unknown>, action: ActionInterface, testRun: boolean): Promise<R | null>;
5
5
  }
6
6
  export interface GpmsActionInterfaceConstructor {
7
7
  new (connectorSDK: ConnectorSDKInterface, httpClient: HttpClientSDKInterface): GpmsActionInterface;
@@ -1,8 +1,8 @@
1
- import { ActionInterface, ConnectorSDKInterface, HttpClientSDKInterface, KafkaCallbackResponse, XodBaseMessageType } from '@transai/connector-runtime-sdk';
1
+ import { ActionInterface, ConnectorSDKInterface, HttpClientSDKInterface } from '@transai/connector-runtime-sdk';
2
2
  import { GpmsActionInterface } from './action.interface';
3
3
  export declare class CreateClientAction implements GpmsActionInterface {
4
4
  #private;
5
5
  readonly identifier = "create_client";
6
6
  constructor(connectorSDK: ConnectorSDKInterface, httpClient: HttpClientSDKInterface);
7
- execute(inputs: Record<string, string>, action: ActionInterface): Promise<((message: XodBaseMessageType) => Promise<KafkaCallbackResponse>) | null>;
7
+ execute(inputs: Record<string, string>, action: ActionInterface, testRun: boolean): Promise<Record<string, unknown> | null>;
8
8
  }
@@ -1,8 +1,8 @@
1
- import { ConnectorSDKInterface, HttpClientSDKInterface, KafkaCallbackResponse, XodBaseMessageType } from '@transai/connector-runtime-sdk';
1
+ import { ActionInterface, ConnectorSDKInterface, HttpClientSDKInterface } from '@transai/connector-runtime-sdk';
2
2
  import { GpmsActionInterface } from './action.interface';
3
3
  export declare class CreateOrderFileAction implements GpmsActionInterface {
4
4
  #private;
5
5
  readonly identifier = "create_order_file";
6
6
  constructor(connectorSDK: ConnectorSDKInterface, httpClient: HttpClientSDKInterface);
7
- execute(inputs: Record<string, string>): Promise<((message: XodBaseMessageType) => Promise<KafkaCallbackResponse>) | null>;
7
+ execute(inputs: Record<string, string>, action: ActionInterface, testRun: boolean): Promise<Record<string, unknown> | null>;
8
8
  }
@@ -1,8 +1,8 @@
1
- import { ActionInterface, ConnectorSDKInterface, HttpClientSDKInterface, KafkaCallbackResponse, XodBaseMessageType } from '@transai/connector-runtime-sdk';
1
+ import { ActionInterface, ConnectorSDKInterface, HttpClientSDKInterface } from '@transai/connector-runtime-sdk';
2
2
  import { GpmsActionInterface } from './action.interface';
3
3
  export declare class CreateOrderAction implements GpmsActionInterface {
4
4
  #private;
5
5
  readonly identifier = "create_order";
6
6
  constructor(connectorSDK: ConnectorSDKInterface, httpClient: HttpClientSDKInterface);
7
- execute(inputs: Record<string, string>, action: ActionInterface): Promise<((message: XodBaseMessageType) => Promise<KafkaCallbackResponse>) | null>;
7
+ execute(inputs: Record<string, string>, action: ActionInterface, testRun: boolean): Promise<Record<string, unknown> | null>;
8
8
  }
@@ -1,8 +1,8 @@
1
- import { ConnectorSDKInterface, HttpClientSDKInterface, KafkaCallbackResponse, XodBaseMessageType } from '@transai/connector-runtime-sdk';
1
+ import { ActionInterface, ConnectorSDKInterface, HttpClientSDKInterface } from '@transai/connector-runtime-sdk';
2
2
  import { GpmsActionInterface } from './action.interface';
3
3
  export declare class CreateQuoteFileAction implements GpmsActionInterface {
4
4
  #private;
5
5
  readonly identifier = "create_quote_file";
6
6
  constructor(connectorSDK: ConnectorSDKInterface, httpClient: HttpClientSDKInterface);
7
- execute(inputs: Record<string, string>): Promise<((message: XodBaseMessageType) => Promise<KafkaCallbackResponse>) | null>;
7
+ execute(inputs: Record<string, string>, action: ActionInterface, testRun: boolean): Promise<Record<string, unknown> | null>;
8
8
  }
@@ -1,8 +1,8 @@
1
- import { ActionInterface, ConnectorSDKInterface, HttpClientSDKInterface, KafkaCallbackResponse, XodBaseMessageType } from '@transai/connector-runtime-sdk';
1
+ import { ActionInterface, ConnectorSDKInterface, HttpClientSDKInterface } from '@transai/connector-runtime-sdk';
2
2
  import { GpmsActionInterface } from './action.interface';
3
3
  export declare class CreateQuoteAction implements GpmsActionInterface {
4
4
  #private;
5
5
  readonly identifier = "create_quote";
6
6
  constructor(connectorSDK: ConnectorSDKInterface, httpClient: HttpClientSDKInterface);
7
- execute(inputs: Record<string, string>, action: ActionInterface): Promise<((message: XodBaseMessageType) => Promise<KafkaCallbackResponse>) | null>;
7
+ execute(inputs: Record<string, string>, action: ActionInterface, testRun: boolean): Promise<Record<string, unknown> | null>;
8
8
  }
@@ -1,8 +1,8 @@
1
- import { ConnectorSDKInterface, HttpClientSDKInterface, KafkaCallbackResponse, XodBaseMessageType } from '@transai/connector-runtime-sdk';
1
+ import { ActionInterface, ConnectorSDKInterface, HttpClientSDKInterface } from '@transai/connector-runtime-sdk';
2
2
  import { GpmsActionInterface } from './action.interface';
3
3
  export declare class OrderReadyAction implements GpmsActionInterface {
4
4
  #private;
5
5
  readonly identifier = "order_ready";
6
6
  constructor(connectorSDK: ConnectorSDKInterface, httpClient: HttpClientSDKInterface);
7
- execute(inputs: Record<string, unknown>): Promise<((message: XodBaseMessageType) => Promise<KafkaCallbackResponse>) | null>;
7
+ execute(inputs: Record<string, unknown>, action: ActionInterface, testRun: boolean): Promise<Record<string, unknown> | null>;
8
8
  }
@@ -1,8 +1,8 @@
1
- import { ConnectorSDKInterface, HttpClientSDKInterface, KafkaCallbackResponse, XodBaseMessageType } from '@transai/connector-runtime-sdk';
1
+ import { ActionInterface, ConnectorSDKInterface, HttpClientSDKInterface } from '@transai/connector-runtime-sdk';
2
2
  import { GpmsActionInterface } from './action.interface';
3
3
  export declare class QuoteReadyAction implements GpmsActionInterface {
4
4
  #private;
5
5
  readonly identifier = "quote_ready";
6
6
  constructor(connectorSDK: ConnectorSDKInterface, httpClient: HttpClientSDKInterface);
7
- execute(inputs: Record<string, unknown>): Promise<((message: XodBaseMessageType) => Promise<KafkaCallbackResponse>) | null>;
7
+ execute(inputs: Record<string, unknown>, action: ActionInterface, testRun: boolean): Promise<Record<string, unknown> | null>;
8
8
  }
@@ -0,0 +1,3 @@
1
+ export declare class BadRequestError extends Error {
2
+ constructor(message: string);
3
+ }
@@ -23,13 +23,26 @@ export interface NumberOutputParameterInterface extends OutputItemParameterInter
23
23
  export interface OutputParameterInterface {
24
24
  [key: string]: OutputItemParameterInterface | ArrayOutputParameterInterface | NumberOutputParameterInterface;
25
25
  }
26
- export interface InputParameterInterface {
26
+ interface BaseInputParameter {
27
27
  name: string;
28
28
  description?: string;
29
- type: 'string' | 'number' | 'boolean' | 'array';
30
29
  required?: boolean;
31
- items?: Array<InputParameterInterface>;
32
30
  }
31
+ export interface ValueInputParameter extends BaseInputParameter {
32
+ type: 'string' | 'number' | 'boolean';
33
+ }
34
+ export interface SimpleArrayInputParameter extends BaseInputParameter {
35
+ type: 'simple-array';
36
+ itemType: 'string' | 'number' | 'boolean';
37
+ }
38
+ export interface ArrayInputParameter extends BaseInputParameter {
39
+ type: 'array';
40
+ items: Array<InputParameterInterface>;
41
+ }
42
+ export interface UnknownInputParameter extends BaseInputParameter {
43
+ type: 'unknown';
44
+ }
45
+ export type InputParameterInterface = ValueInputParameter | SimpleArrayInputParameter | ArrayInputParameter | UnknownInputParameter;
33
46
  export interface ActionInterface {
34
47
  identifier: string;
35
48
  version: string;
@@ -47,3 +60,4 @@ export interface ActionInterface {
47
60
  mode?: ConnectorOrigin;
48
61
  createdAt: Date;
49
62
  }
63
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transai/connector-runner-gpms",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },