@flowrunner/cli 0.1.9 → 0.1.10
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 +8 -8
- package/ai-docs/instructions/service-code-format/01-service-structure.md +3 -2
- package/ai-docs/instructions/service-code-format/02-zod-types.md +8 -0
- package/ai-docs/instructions/service-code-format/03-parameters.md +181 -10
- package/ai-docs/instructions/service-code-format/04-http-requests.md +2 -2
- package/ai-docs/instructions/service-code-format/05-dictionaries.md +14 -0
- package/ai-docs/instructions/service-code-format/07-actions.md +5 -4
- package/ai-docs/instructions/service-code-format/11-output-model.md +42 -6
- package/ai-docs/instructions/service-code-format/12-service-readme.md +1 -1
- package/ai-docs/instructions/service-code-format/13-runtime-contracts.md +4 -1
- package/ai-docs/instructions/service-code-format/15-unit-tests.md +2 -1
- package/ai-docs/instructions/service-code-format/16-gotchas.md +39 -1
- package/ai-docs/instructions/service-code-format/README.md +1 -1
- package/ai-docs/providers/claude/agents/flowrunner-service-test-engineer.md +1 -1
- package/dist/cli.js +276 -42
- package/dist/cli.js.map +3 -3
- package/dist/index.js +275 -41
- package/dist/index.js.map +3 -3
- package/dist/types/flow-extension-runner/src/v2/actions/action-method.d.ts +13 -9
- package/dist/types/flow-extension-runner/src/v2/loaders/loader-method.d.ts +52 -7
- package/dist/types/flow-extension-runner/src/v2/loaders/loader-owner.d.ts +4 -6
- package/dist/types/flow-extension-runner/src/v2/model/model-types.d.ts +2 -0
- package/dist/types/flow-extension-runner/src/v2/params/index.d.ts +2 -2
- package/dist/types/flow-extension-runner/src/v2/params/json/encode.d.ts +10 -2
- package/dist/types/flow-extension-runner/src/v2/params/json/types.d.ts +1 -0
- package/dist/types/flow-extension-runner/src/v2/params/zod.d.ts +29 -0
- package/dist/types/flow-extension-runner/src/v2/types.d.ts +20 -8
- package/dist/types/shared/src/constants/activity-log.d.ts +1496 -0
- package/dist/types/shared/src/constants/docs.d.ts +2 -0
- package/dist/types/shared/src/constants/notification-types.d.ts +9 -3
- package/dist/types/shared/src/scheme/activity-log-base.d.ts +35 -0
- package/dist/types/shared/src/scheme/data-types/java.dto.d.ts +2 -3
- package/dist/types/shared/src/scheme/flowrunner/custom-elements.d.ts +20 -0
- package/dist/types/shared/src/scheme/flowrunner/java.dto.d.ts +1 -0
- package/dist/types/shared/src/scheme/shared-extensions/base.d.ts +5 -0
- package/dist/types/shared/src/scheme/shared-extensions/custom-extensions.d.ts +147 -0
- package/dist/types/shared/src/scheme/shared-extensions/extension.d.ts +20 -0
- package/dist/types/shared/src/scheme/shared-extensions/methods.d.ts +33 -1
- package/dist/types/shared/src/scheme/shared-extensions/params-schema.d.ts +1 -0
- package/dist/types/shared/src/scheme/shared-extensions/resolve.d.ts +15 -0
- package/dist/types/shared/src/scheme/shared-extensions/search.d.ts +10 -0
- package/package.json +1 -1
- package/runtime/index.js +275 -41
- package/runtime/index.js.map +3 -3
- package/runtime/types/flow-extension-runner/src/v2/actions/action-method.d.ts +13 -9
- package/runtime/types/flow-extension-runner/src/v2/loaders/loader-method.d.ts +52 -7
- package/runtime/types/flow-extension-runner/src/v2/loaders/loader-owner.d.ts +4 -6
- package/runtime/types/flow-extension-runner/src/v2/model/model-types.d.ts +2 -0
- package/runtime/types/flow-extension-runner/src/v2/params/index.d.ts +2 -2
- package/runtime/types/flow-extension-runner/src/v2/params/json/encode.d.ts +10 -2
- package/runtime/types/flow-extension-runner/src/v2/params/json/types.d.ts +1 -0
- package/runtime/types/flow-extension-runner/src/v2/params/zod.d.ts +29 -0
- package/runtime/types/flow-extension-runner/src/v2/types.d.ts +20 -8
- package/runtime/types/shared/src/constants/activity-log.d.ts +1496 -0
- package/runtime/types/shared/src/constants/docs.d.ts +2 -0
- package/runtime/types/shared/src/constants/notification-types.d.ts +9 -3
- package/runtime/types/shared/src/scheme/activity-log-base.d.ts +35 -0
- package/runtime/types/shared/src/scheme/data-types/java.dto.d.ts +2 -3
- package/runtime/types/shared/src/scheme/flowrunner/custom-elements.d.ts +20 -0
- package/runtime/types/shared/src/scheme/flowrunner/java.dto.d.ts +1 -0
- package/runtime/types/shared/src/scheme/shared-extensions/base.d.ts +5 -0
- package/runtime/types/shared/src/scheme/shared-extensions/custom-extensions.d.ts +147 -0
- package/runtime/types/shared/src/scheme/shared-extensions/extension.d.ts +20 -0
- package/runtime/types/shared/src/scheme/shared-extensions/methods.d.ts +33 -1
- package/runtime/types/shared/src/scheme/shared-extensions/params-schema.d.ts +1 -0
- package/runtime/types/shared/src/scheme/shared-extensions/resolve.d.ts +15 -0
- package/runtime/types/shared/src/scheme/shared-extensions/search.d.ts +10 -0
- package/templates/demo-todo-list/files/src/index.js +6 -6
- package/templates/qa-test/files/README.md +23 -8
- package/templates/qa-test/files/src/index.js +368 -37
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import type { ExecutionContext } from '../context/execution-context';
|
|
2
2
|
import type { Extension } from '../extension';
|
|
3
|
-
import { type
|
|
3
|
+
import { type ParamsLoaderOwner } from '../loaders/loader-owner';
|
|
4
4
|
import { ExtensionMethod } from '../method';
|
|
5
5
|
import type { SharedExtensionMethod } from '../model/model-types';
|
|
6
6
|
import { MethodParams } from '../params';
|
|
7
7
|
import { ResultSpec } from '../result';
|
|
8
|
-
import type { ActionProps,
|
|
9
|
-
export declare class ActionMethod extends ExtensionMethod implements
|
|
8
|
+
import type { ActionProps, DynamicPropsDef } from '../types';
|
|
9
|
+
export declare class ActionMethod extends ExtensionMethod implements ParamsLoaderOwner {
|
|
10
|
+
#private;
|
|
10
11
|
private readonly props;
|
|
11
12
|
readonly params: MethodParams;
|
|
12
13
|
readonly result: ResultSpec;
|
|
13
|
-
readonly
|
|
14
|
+
readonly dynamicParams?: DynamicPropsDef;
|
|
14
15
|
constructor(extension: Extension, props: ActionProps);
|
|
16
|
+
/**
|
|
17
|
+
* The top-level params declared with `.dynamicProps()`, and the def each one carries. Placement and shape
|
|
18
|
+
* were checked when `params` was built (see ../params/schema/assert-supported-schema.ts).
|
|
19
|
+
*/
|
|
20
|
+
dynamicPropsFields(): [name: string, def: DynamicPropsDef][];
|
|
15
21
|
get id(): string;
|
|
16
22
|
get name(): string;
|
|
17
23
|
get registerAs(): string;
|
|
@@ -22,13 +28,11 @@ export declare class ActionMethod extends ExtensionMethod implements LoaderOwner
|
|
|
22
28
|
* Normalize, coerce and validate against the declared `params` — the same pipeline every other declared
|
|
23
29
|
* slot uses, so an author expresses optionality in the schema and nowhere else.
|
|
24
30
|
*
|
|
25
|
-
* An action with `dynamicParams` carries the input's undeclared keys through, since its
|
|
26
|
-
*
|
|
31
|
+
* An action with `dynamicParams` carries the input's undeclared keys through, since its loaded top-level
|
|
32
|
+
* fields are not in the static schema. A `.dynamicProps()` field needs nothing here: it is a loose object,
|
|
33
|
+
* which keeps the loaded keys inside it.
|
|
27
34
|
*/
|
|
28
35
|
validate(methodData: Record<string, unknown>): Record<string, unknown>;
|
|
29
36
|
execute(params: Record<string, unknown>, ctx: ExecutionContext): unknown;
|
|
30
|
-
resolveDynamicParams(bag: HandlerBag & {
|
|
31
|
-
criteria: Record<string, unknown>;
|
|
32
|
-
}): AnySchema | Promise<AnySchema>;
|
|
33
37
|
toModel(): SharedExtensionMethod;
|
|
34
38
|
}
|
|
@@ -2,13 +2,15 @@ import type { ExecutionContext } from '../context/execution-context';
|
|
|
2
2
|
import type { Extension } from '../extension';
|
|
3
3
|
import { ExtensionMethod } from '../method';
|
|
4
4
|
import type { SharedExtensionMethod, SharedExtensionParam } from '../model/model-types';
|
|
5
|
-
import { MethodParams } from '../params';
|
|
6
|
-
import {
|
|
5
|
+
import { type AnyZod, MethodParams, type ParamsSchemaJSON } from '../params';
|
|
6
|
+
import type { DynamicPropsDef, LoadedParamsSchema } from '../types';
|
|
7
|
+
import { type LoaderOwner, type ParamsLoaderOwner } from './loader-owner';
|
|
7
8
|
declare abstract class LoaderMethod extends ExtensionMethod {
|
|
8
9
|
protected readonly owner: LoaderOwner;
|
|
9
10
|
constructor(extension: Extension, owner: LoaderOwner);
|
|
10
11
|
protected abstract get criteria(): MethodParams;
|
|
11
12
|
validate(methodData: Record<string, unknown>): Record<string, unknown>;
|
|
13
|
+
protected get carryUnknown(): boolean;
|
|
12
14
|
toModel(): SharedExtensionMethod;
|
|
13
15
|
protected abstract get returnType(): string;
|
|
14
16
|
}
|
|
@@ -19,13 +21,56 @@ export declare class SampleResultLoaderMethod extends LoaderMethod {
|
|
|
19
21
|
protected get criteria(): MethodParams;
|
|
20
22
|
execute(criteria: Record<string, unknown>, ctx: ExecutionContext): unknown;
|
|
21
23
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* What a params loader responds with: the loaded fields as encoded zod — for the console forms, which build
|
|
26
|
+
* their widgets and validation from it — and the same fields as a param list with display metadata inline,
|
|
27
|
+
* for the Flow Builder, which draws every v2 action from the list. Both come from one schema, so they cannot
|
|
28
|
+
* disagree. A static action publishes the same pair (`paramsSchema`, and `bodyParams` + `args`).
|
|
29
|
+
*/
|
|
30
|
+
export interface LoadedParams {
|
|
31
|
+
paramsSchema: ParamsSchemaJSON | null;
|
|
32
|
+
params: SharedExtensionParam[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A params loader: runs a `DynamicPropsDef` and responds with the fields it returned.
|
|
36
|
+
*
|
|
37
|
+
* Its criteria are exactly the owner's params named in `dependsOn`, checked by their own schemas — so a value
|
|
38
|
+
* arrives coerced, as it would in the action's handler, and a loader cannot read a param it did not name (the
|
|
39
|
+
* console would not reload it when that param changes).
|
|
40
|
+
*/
|
|
41
|
+
declare abstract class ParamsLoaderMethod extends LoaderMethod {
|
|
42
|
+
#private;
|
|
43
|
+
protected readonly owner: ParamsLoaderOwner;
|
|
44
|
+
protected readonly def: DynamicPropsDef;
|
|
45
|
+
constructor(extension: Extension, owner: ParamsLoaderOwner, def: DynamicPropsDef);
|
|
26
46
|
get registerAs(): string;
|
|
27
47
|
protected get returnType(): string;
|
|
48
|
+
protected get carryUnknown(): boolean;
|
|
28
49
|
protected get criteria(): MethodParams;
|
|
29
|
-
|
|
50
|
+
protected abstract get slot(): string;
|
|
51
|
+
protected abstract get staticFields(): [string, AnyZod][];
|
|
52
|
+
execute(criteria: Record<string, unknown>, ctx: ExecutionContext): Promise<LoadedParams>;
|
|
53
|
+
protected toParams(loaded: LoadedParamsSchema): MethodParams;
|
|
54
|
+
}
|
|
55
|
+
export declare class DynamicParamsLoaderMethod extends ParamsLoaderMethod {
|
|
56
|
+
constructor(extension: Extension, owner: ParamsLoaderOwner);
|
|
57
|
+
get name(): string;
|
|
58
|
+
protected get slot(): string;
|
|
59
|
+
protected get staticFields(): [string, AnyZod][];
|
|
60
|
+
protected toParams(loaded: LoadedParamsSchema): MethodParams;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Loads the fields inside one top-level param declared with `.dynamicProps()` — a `z.looseObject()`, or a
|
|
64
|
+
* list of them.
|
|
65
|
+
*
|
|
66
|
+
* The field's own declared keys are published FIRST and the loaded ones after: the Flow Builder replaces the
|
|
67
|
+
* field's inner list with this response, so leaving them out would hide fields the author declared.
|
|
68
|
+
*/
|
|
69
|
+
export declare class DynamicPropsLoaderMethod extends ParamsLoaderMethod {
|
|
70
|
+
private readonly field;
|
|
71
|
+
constructor(extension: Extension, owner: ParamsLoaderOwner, field: string, def: DynamicPropsDef);
|
|
72
|
+
get name(): string;
|
|
73
|
+
protected get slot(): string;
|
|
74
|
+
protected get staticFields(): [string, AnyZod][];
|
|
30
75
|
}
|
|
31
76
|
export {};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import type { MethodParams } from '../params';
|
|
2
2
|
import type { ResultSpec } from '../result';
|
|
3
|
-
import type {
|
|
3
|
+
import type { DynamicPropsDef } from '../types';
|
|
4
4
|
export declare const sampleResultLoaderName: (ownerId: string) => string;
|
|
5
5
|
export declare const dynamicParamsLoaderName: (ownerId: string) => string;
|
|
6
|
+
export declare const dynamicPropsLoaderName: (ownerId: string, field: string) => string;
|
|
6
7
|
export interface LoaderOwner {
|
|
7
8
|
readonly id: string;
|
|
8
9
|
readonly category: string;
|
|
9
10
|
readonly params: MethodParams;
|
|
10
11
|
readonly result: ResultSpec;
|
|
11
12
|
}
|
|
12
|
-
export interface
|
|
13
|
-
readonly
|
|
14
|
-
resolveDynamicParams(bag: HandlerBag & {
|
|
15
|
-
criteria: Record<string, unknown>;
|
|
16
|
-
}): AnySchema | Promise<AnySchema>;
|
|
13
|
+
export interface ParamsLoaderOwner extends LoaderOwner {
|
|
14
|
+
readonly dynamicParams?: DynamicPropsDef;
|
|
17
15
|
}
|
|
@@ -11,6 +11,7 @@ export interface SharedExtensionParam {
|
|
|
11
11
|
};
|
|
12
12
|
uiComponent?: Record<string, unknown>;
|
|
13
13
|
dependsOn?: string[];
|
|
14
|
+
include?: string[];
|
|
14
15
|
dictionary?: string;
|
|
15
16
|
defaultValue?: unknown;
|
|
16
17
|
}
|
|
@@ -19,6 +20,7 @@ export interface SharedExtensionMetaInfoArg {
|
|
|
19
20
|
dictionary?: string;
|
|
20
21
|
dependsOn?: string[];
|
|
21
22
|
uiComponent?: Record<string, unknown>;
|
|
23
|
+
schemaLoader?: string;
|
|
22
24
|
}
|
|
23
25
|
export interface SharedExtensionMetaInfo {
|
|
24
26
|
args?: Record<string, SharedExtensionMetaInfoArg>;
|
|
@@ -12,8 +12,8 @@ export { absenceOf, type AbsencePolicy, type FieldPlan, planField } from './sche
|
|
|
12
12
|
export { type FieldResult, normalizeField } from './schema/normalize';
|
|
13
13
|
export { type FailFn, parseSchema, toIssues } from './schema/parse';
|
|
14
14
|
export { decodeField, decodeParams } from './json/decode';
|
|
15
|
-
export { encodeField, encodeParams } from './json/encode';
|
|
15
|
+
export { encodeField, encodeParams, type EncodeParamsOptions } from './json/encode';
|
|
16
16
|
export type { CheckJSON, FieldJSON, FieldType, JsonValue, MetaJSON, ParamsSchemaJSON, RegexJSON, } from './json/types';
|
|
17
17
|
export { SCHEMA_JSON_VERSION } from './json/types';
|
|
18
|
-
export { type DictionaryRef, type ExtendedZod, type FrMeta, z } from './zod';
|
|
18
|
+
export { type DictionaryRef, type DynamicPropsRef, type DynamicPropsSpec, type ExtendedZod, type FrMeta, z } from './zod';
|
|
19
19
|
export type { FilesDeleteOptionsField, FilesGetOptionsField, FilesListOptionsField, FilesUploadOptionsField, } from './files-options';
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { type AnyZod } from '../schema/introspect';
|
|
2
2
|
import { type FieldJSON, type ParamsSchemaJSON } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* What the caller knows that the framework cannot: the name of the method that loads a field's
|
|
5
|
+
* `.dynamicProps()`. The framework does not import the runner's naming (it also runs in the browser), so the
|
|
6
|
+
* runner passes it in when it publishes an owner's params.
|
|
7
|
+
*/
|
|
8
|
+
export interface EncodeParamsOptions {
|
|
9
|
+
loaderIdOf?: (fieldName: string) => string;
|
|
10
|
+
}
|
|
3
11
|
/**
|
|
4
12
|
* One declared field → its wire form.
|
|
5
13
|
*
|
|
@@ -8,7 +16,7 @@ import { type FieldJSON, type ParamsSchemaJSON } from './types';
|
|
|
8
16
|
* added before descending and removed after, which makes the check below a cycle test rather than a
|
|
9
17
|
* deduplication.
|
|
10
18
|
*/
|
|
11
|
-
export declare function encodeField(name: string, schema: AnyZod, seen?: Set<unknown
|
|
19
|
+
export declare function encodeField(name: string, schema: AnyZod, seen?: Set<unknown>, loaderId?: string): FieldJSON;
|
|
12
20
|
/**
|
|
13
21
|
* A whole declared slot → its wire form. `null` for an undeclared slot, which is legal everywhere: a method
|
|
14
22
|
* with no params publishes no schema rather than an empty one.
|
|
@@ -17,4 +25,4 @@ export declare function encodeField(name: string, schema: AnyZod, seen?: Set<unk
|
|
|
17
25
|
* have (`Params.scheme`, an author's `z.object`, a decoded rebuild), and none of those structural views are
|
|
18
26
|
* assignable to each other. Narrowing once here beats a cast at every call site.
|
|
19
27
|
*/
|
|
20
|
-
export declare function encodeParams(scheme: unknown): ParamsSchemaJSON | null;
|
|
28
|
+
export declare function encodeParams(scheme: unknown, options?: EncodeParamsOptions): ParamsSchemaJSON | null;
|
|
@@ -5,6 +5,22 @@ export interface DictionaryRef {
|
|
|
5
5
|
id: string;
|
|
6
6
|
dependsOn?: string[];
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* What `.dynamicProps()` takes: the sibling params whose values the loader receives as `criteria`, and the
|
|
10
|
+
* handler that returns the field's inner fields — a zod shape or a `z.object`.
|
|
11
|
+
*
|
|
12
|
+
* Typed loosely here on purpose: this framework is self-contained (it also runs in the browser), so it cannot
|
|
13
|
+
* name the runner's handler bag. The runner narrows `execute` where it has the extension's types
|
|
14
|
+
* (`DynamicPropsDef` in ../types.ts).
|
|
15
|
+
*/
|
|
16
|
+
export interface DynamicPropsSpec {
|
|
17
|
+
dependsOn?: string[];
|
|
18
|
+
execute: (bag: any) => unknown;
|
|
19
|
+
}
|
|
20
|
+
export interface DynamicPropsRef {
|
|
21
|
+
id: string;
|
|
22
|
+
dependsOn: string[];
|
|
23
|
+
}
|
|
8
24
|
export interface FrMeta {
|
|
9
25
|
title?: string;
|
|
10
26
|
description?: string;
|
|
@@ -20,6 +36,11 @@ export interface FrMeta {
|
|
|
20
36
|
frSecret?: boolean;
|
|
21
37
|
/** `z.json()` — the value arrives as TEXT and is parsed before the handler sees it. See `json()` below. */
|
|
22
38
|
frJson?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* `.dynamicProps()` — the spec (holding the author's function) on a declared schema, the plain ref of the
|
|
41
|
+
* method that runs it on a decoded one. Never encoded as the spec: see ./json/encode.ts.
|
|
42
|
+
*/
|
|
43
|
+
frDynamicProps?: DynamicPropsSpec | DynamicPropsRef;
|
|
23
44
|
}
|
|
24
45
|
declare module 'zod' {
|
|
25
46
|
interface ZodType {
|
|
@@ -49,6 +70,14 @@ declare module 'zod' {
|
|
|
49
70
|
* handler receives the value it declared, with no translation step anywhere.
|
|
50
71
|
*/
|
|
51
72
|
labels(byValue: Record<string, string>): this;
|
|
73
|
+
/**
|
|
74
|
+
* Load this object's inner fields at design time from the values of other params:
|
|
75
|
+
* `z.looseObject({}).dynamicProps({ dependsOn: ['tableName'], execute: async ({ criteria }) => ({ … }) })`.
|
|
76
|
+
*
|
|
77
|
+
* Top-level ACTION params only, on a `z.looseObject()` or a `z.array(z.looseObject())` — the loaded keys
|
|
78
|
+
* are not in the declared schema, so a strict object would strip them. Checked when the service loads.
|
|
79
|
+
*/
|
|
80
|
+
dynamicProps(spec: DynamicPropsSpec): this;
|
|
52
81
|
/** @deprecated Inverted and renamed — see `labels`. Throws, so the change cannot pass silently. */
|
|
53
82
|
map(mapping: Record<string, unknown>): never;
|
|
54
83
|
}
|
|
@@ -89,19 +89,31 @@ export interface DictionaryProps<TShape extends ExtensionShape = AnyShape, TCrit
|
|
|
89
89
|
criteria: Infer<TCriteria>;
|
|
90
90
|
}) => DictionaryResult | DictionaryResultItems | Promise<DictionaryResult | DictionaryResultItems>;
|
|
91
91
|
}
|
|
92
|
-
export
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
export type LoadedParamsSchema = AnySchema | Record<string, AnySchema>;
|
|
93
|
+
/**
|
|
94
|
+
* Fields loaded at design time from the values of other params (see 03-parameters.md). One shape for both
|
|
95
|
+
* places it is used:
|
|
96
|
+
*
|
|
97
|
+
* - `.dynamicProps(def)` on a top-level `z.looseObject()` param — loads the fields INSIDE that object;
|
|
98
|
+
* - an action's `dynamicParams: def` — loads extra top-level params of the action.
|
|
99
|
+
*
|
|
100
|
+
* `dependsOn` names sibling params; `execute` receives their values as `criteria` (exactly those, coerced by
|
|
101
|
+
* their own schemas) and returns the loaded fields. A def may be held in a `const` and reused: the runner
|
|
102
|
+
* generates one loader method per use and never mutates it.
|
|
103
|
+
*/
|
|
104
|
+
export interface DynamicPropsDef<TShape extends ExtensionShape = AnyShape> {
|
|
105
|
+
dependsOn?: string[];
|
|
106
|
+
execute: (bag: HandlerBag<TShape> & {
|
|
107
|
+
criteria: Record<string, unknown>;
|
|
108
|
+
}) => LoadedParamsSchema | Promise<LoadedParamsSchema>;
|
|
97
109
|
}
|
|
98
|
-
export interface ActionProps<TShape extends ExtensionShape = AnyShape, TParams extends AnySchema = AnySchema
|
|
110
|
+
export interface ActionProps<TShape extends ExtensionShape = AnyShape, TParams extends AnySchema = AnySchema> {
|
|
99
111
|
category: string;
|
|
100
112
|
id: string;
|
|
101
113
|
label: string;
|
|
102
114
|
description: string;
|
|
103
115
|
params?: TParams;
|
|
104
|
-
dynamicParams?:
|
|
116
|
+
dynamicParams?: DynamicPropsDef<TShape>;
|
|
105
117
|
result: SampleResult<TShape, TParams>;
|
|
106
118
|
logo?: string;
|
|
107
119
|
appearanceColors?: [string, string];
|
|
@@ -110,7 +122,7 @@ export interface ActionProps<TShape extends ExtensionShape = AnyShape, TParams e
|
|
|
110
122
|
}
|
|
111
123
|
export interface ExtensionApi<TShape extends ExtensionShape = AnyShape> {
|
|
112
124
|
dictionary<TCriteria extends AnySchema = AnySchema>(props: DictionaryProps<TShape, TCriteria>): DictionaryRef;
|
|
113
|
-
addAction<TParams extends AnySchema = AnySchema
|
|
125
|
+
addAction<TParams extends AnySchema = AnySchema>(props: ActionProps<TShape, TParams>): void;
|
|
114
126
|
addPollingTrigger<TParams extends AnySchema = AnySchema>(props: PollingTriggerProps<TShape, TParams>): void;
|
|
115
127
|
setupRealtimeTriggers(props: RealtimeSetupProps<TShape>): void;
|
|
116
128
|
addRealtimeTrigger<TParams extends AnySchema = AnySchema>(props: RealtimeTriggerProps<TShape, TParams>): void;
|