@ever-works/activepieces-plugin 1.0.0 → 1.0.6
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/dist/index.cjs +3492 -0
- package/dist/index.d.cts +157 -0
- package/dist/index.d.ts +157 -0
- package/dist/index.js +3465 -0
- package/package.json +82 -72
- package/LICENSE +0 -661
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { IPlugin, IPipelinePlugin, IFormSchemaProvider, PluginCategory, JsonSchema, PluginContext, PluginHealthCheck, ValidationResult, ConnectionValidationResult, PluginManifest, FormFieldDefinition, FormFieldGroup, PipelineStepDefinition, WorkReference, GenerationRequest, ExistingItems, PipelineExecutionOptions, PipelineProgressCallback, PipelineResult, PipelineState } from '@ever-works/plugin';
|
|
2
|
+
|
|
3
|
+
/** Step IDs for the Activepieces pipeline. */
|
|
4
|
+
type ActivepiecesStepId = 'validate-activepieces' | 'prepare-payload' | 'execute-flow' | 'collect-results' | 'capture-screenshots' | 'cleanup';
|
|
5
|
+
/** Webhook execution mode for Activepieces flows. */
|
|
6
|
+
type WebhookMode = 'sync' | 'async';
|
|
7
|
+
/** Data source types for passing data to Activepieces. */
|
|
8
|
+
type DataSourceType = 'inline' | 'github-repo';
|
|
9
|
+
/** Input payload sent to Activepieces flow webhook. */
|
|
10
|
+
interface ActivepiecesFlowInput {
|
|
11
|
+
metadata: {
|
|
12
|
+
workId: string;
|
|
13
|
+
workName: string;
|
|
14
|
+
workSlug: string;
|
|
15
|
+
workDescription?: string;
|
|
16
|
+
prompt?: string;
|
|
17
|
+
generationMethod?: string;
|
|
18
|
+
targetItems: number;
|
|
19
|
+
};
|
|
20
|
+
existingSummary?: {
|
|
21
|
+
totalItems: number;
|
|
22
|
+
categories: string[];
|
|
23
|
+
tags: string[];
|
|
24
|
+
sampleItems: Array<{
|
|
25
|
+
name: string;
|
|
26
|
+
url?: string;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
dataSource?: {
|
|
30
|
+
type: DataSourceType;
|
|
31
|
+
repoUrl?: string;
|
|
32
|
+
accessToken?: string;
|
|
33
|
+
branch?: string;
|
|
34
|
+
path?: string;
|
|
35
|
+
};
|
|
36
|
+
flowParams?: Record<string, unknown>;
|
|
37
|
+
}
|
|
38
|
+
/** Expected output from an Activepieces flow execution. */
|
|
39
|
+
interface ActivepiecesFlowOutput {
|
|
40
|
+
items: ActivepiecesOutputItem[];
|
|
41
|
+
categories?: Array<{
|
|
42
|
+
name: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
}>;
|
|
45
|
+
tags?: Array<{
|
|
46
|
+
name: string;
|
|
47
|
+
}>;
|
|
48
|
+
brands?: Array<{
|
|
49
|
+
name: string;
|
|
50
|
+
url?: string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
/** Single item in Activepieces flow output. */
|
|
54
|
+
interface ActivepiecesOutputItem {
|
|
55
|
+
name: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
url?: string;
|
|
58
|
+
source_url?: string;
|
|
59
|
+
content?: string;
|
|
60
|
+
category?: string;
|
|
61
|
+
tags?: string[];
|
|
62
|
+
brand?: string;
|
|
63
|
+
images?: string[];
|
|
64
|
+
metadata?: Record<string, unknown>;
|
|
65
|
+
}
|
|
66
|
+
/** Resolved settings for the Activepieces plugin. */
|
|
67
|
+
interface ActivepiecesSettings {
|
|
68
|
+
apiKey: string;
|
|
69
|
+
baseUrl: string;
|
|
70
|
+
projectId?: string;
|
|
71
|
+
defaultFlowId?: string;
|
|
72
|
+
webhookMode: WebhookMode;
|
|
73
|
+
timeoutMs: number;
|
|
74
|
+
}
|
|
75
|
+
/** Schema of a flow returned by the Activepieces API. */
|
|
76
|
+
interface ActivepiecesFlow {
|
|
77
|
+
id: string;
|
|
78
|
+
created?: string;
|
|
79
|
+
updated?: string;
|
|
80
|
+
projectId?: string;
|
|
81
|
+
externalId?: string;
|
|
82
|
+
status?: 'ENABLED' | 'DISABLED' | string;
|
|
83
|
+
publishedVersionId?: string | null;
|
|
84
|
+
folderId?: string | null;
|
|
85
|
+
metadata?: Record<string, unknown>;
|
|
86
|
+
}
|
|
87
|
+
/** Schema of a flow run returned by the Activepieces API. */
|
|
88
|
+
interface ActivepiecesFlowRun {
|
|
89
|
+
id: string;
|
|
90
|
+
flowId: string;
|
|
91
|
+
projectId: string;
|
|
92
|
+
flowVersionId?: string;
|
|
93
|
+
status: string;
|
|
94
|
+
environment?: string;
|
|
95
|
+
startTime?: string;
|
|
96
|
+
finishTime?: string;
|
|
97
|
+
stepsCount?: number;
|
|
98
|
+
tags?: string[];
|
|
99
|
+
steps?: Record<string, unknown>;
|
|
100
|
+
failedStep?: {
|
|
101
|
+
name?: string;
|
|
102
|
+
displayName?: string;
|
|
103
|
+
} | null;
|
|
104
|
+
}
|
|
105
|
+
/** Result of executing an Activepieces flow webhook. */
|
|
106
|
+
interface ActivepiecesExecutionResult {
|
|
107
|
+
output: unknown;
|
|
108
|
+
flowRunId?: string;
|
|
109
|
+
flowDuration?: number;
|
|
110
|
+
run?: ActivepiecesFlowRun;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Activepieces Automation Plugin
|
|
115
|
+
*
|
|
116
|
+
* Pipeline plugin that delegates work generation to Activepieces flows.
|
|
117
|
+
* Activepieces is the AI-first, open-source automation platform — this plugin
|
|
118
|
+
* triggers a flow webhook at the execute stage and collects structured items
|
|
119
|
+
* from its Return Response action.
|
|
120
|
+
*/
|
|
121
|
+
declare class ActivepiecesPlugin implements IPlugin, IPipelinePlugin, IFormSchemaProvider {
|
|
122
|
+
readonly id = "activepieces";
|
|
123
|
+
readonly name = "Activepieces Automation";
|
|
124
|
+
readonly version = "1.0.0";
|
|
125
|
+
readonly category: PluginCategory;
|
|
126
|
+
readonly capabilities: readonly ["pipeline", "form-schema-provider"];
|
|
127
|
+
readonly configurationMode: "user-required";
|
|
128
|
+
readonly handledConfigFields: readonly ["*"];
|
|
129
|
+
readonly settingsSchema: JsonSchema;
|
|
130
|
+
private context;
|
|
131
|
+
onLoad(context: PluginContext): Promise<void>;
|
|
132
|
+
onUnload(): Promise<void>;
|
|
133
|
+
healthCheck(): Promise<PluginHealthCheck>;
|
|
134
|
+
isAvailable(settings?: Record<string, unknown>): Promise<boolean>;
|
|
135
|
+
validateSettings(settings: Record<string, unknown>): Promise<ValidationResult>;
|
|
136
|
+
validateConnection(rawSettings: Record<string, unknown>): Promise<ConnectionValidationResult>;
|
|
137
|
+
getManifest(): PluginManifest;
|
|
138
|
+
getFormFields(): FormFieldDefinition[];
|
|
139
|
+
getFormGroups(): FormFieldGroup[];
|
|
140
|
+
validateFormInput(values: Record<string, unknown>): ValidationResult;
|
|
141
|
+
getDefaultValues(): Record<string, unknown>;
|
|
142
|
+
getStepDefinitions(): readonly PipelineStepDefinition[];
|
|
143
|
+
private _lastState;
|
|
144
|
+
private _lastAbortController;
|
|
145
|
+
execute(work: WorkReference, request: GenerationRequest, existing: ExistingItems, options?: PipelineExecutionOptions, onProgress?: PipelineProgressCallback): Promise<PipelineResult>;
|
|
146
|
+
cancel(): Promise<void>;
|
|
147
|
+
getState(): PipelineState<ActivepiecesStepId> | null;
|
|
148
|
+
private resolveApSettings;
|
|
149
|
+
private resolveFlowId;
|
|
150
|
+
private captureScreenshots;
|
|
151
|
+
/**
|
|
152
|
+
* Flatten a ResolvedSettings map into plain key->value pairs.
|
|
153
|
+
*/
|
|
154
|
+
private flattenSettings;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export { type ActivepiecesExecutionResult, type ActivepiecesFlow, type ActivepiecesFlowInput, type ActivepiecesFlowOutput, type ActivepiecesFlowRun, type ActivepiecesOutputItem, ActivepiecesPlugin, type ActivepiecesSettings, type ActivepiecesStepId, type WebhookMode, ActivepiecesPlugin as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { IPlugin, IPipelinePlugin, IFormSchemaProvider, PluginCategory, JsonSchema, PluginContext, PluginHealthCheck, ValidationResult, ConnectionValidationResult, PluginManifest, FormFieldDefinition, FormFieldGroup, PipelineStepDefinition, WorkReference, GenerationRequest, ExistingItems, PipelineExecutionOptions, PipelineProgressCallback, PipelineResult, PipelineState } from '@ever-works/plugin';
|
|
2
|
+
|
|
3
|
+
/** Step IDs for the Activepieces pipeline. */
|
|
4
|
+
type ActivepiecesStepId = 'validate-activepieces' | 'prepare-payload' | 'execute-flow' | 'collect-results' | 'capture-screenshots' | 'cleanup';
|
|
5
|
+
/** Webhook execution mode for Activepieces flows. */
|
|
6
|
+
type WebhookMode = 'sync' | 'async';
|
|
7
|
+
/** Data source types for passing data to Activepieces. */
|
|
8
|
+
type DataSourceType = 'inline' | 'github-repo';
|
|
9
|
+
/** Input payload sent to Activepieces flow webhook. */
|
|
10
|
+
interface ActivepiecesFlowInput {
|
|
11
|
+
metadata: {
|
|
12
|
+
workId: string;
|
|
13
|
+
workName: string;
|
|
14
|
+
workSlug: string;
|
|
15
|
+
workDescription?: string;
|
|
16
|
+
prompt?: string;
|
|
17
|
+
generationMethod?: string;
|
|
18
|
+
targetItems: number;
|
|
19
|
+
};
|
|
20
|
+
existingSummary?: {
|
|
21
|
+
totalItems: number;
|
|
22
|
+
categories: string[];
|
|
23
|
+
tags: string[];
|
|
24
|
+
sampleItems: Array<{
|
|
25
|
+
name: string;
|
|
26
|
+
url?: string;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
dataSource?: {
|
|
30
|
+
type: DataSourceType;
|
|
31
|
+
repoUrl?: string;
|
|
32
|
+
accessToken?: string;
|
|
33
|
+
branch?: string;
|
|
34
|
+
path?: string;
|
|
35
|
+
};
|
|
36
|
+
flowParams?: Record<string, unknown>;
|
|
37
|
+
}
|
|
38
|
+
/** Expected output from an Activepieces flow execution. */
|
|
39
|
+
interface ActivepiecesFlowOutput {
|
|
40
|
+
items: ActivepiecesOutputItem[];
|
|
41
|
+
categories?: Array<{
|
|
42
|
+
name: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
}>;
|
|
45
|
+
tags?: Array<{
|
|
46
|
+
name: string;
|
|
47
|
+
}>;
|
|
48
|
+
brands?: Array<{
|
|
49
|
+
name: string;
|
|
50
|
+
url?: string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
/** Single item in Activepieces flow output. */
|
|
54
|
+
interface ActivepiecesOutputItem {
|
|
55
|
+
name: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
url?: string;
|
|
58
|
+
source_url?: string;
|
|
59
|
+
content?: string;
|
|
60
|
+
category?: string;
|
|
61
|
+
tags?: string[];
|
|
62
|
+
brand?: string;
|
|
63
|
+
images?: string[];
|
|
64
|
+
metadata?: Record<string, unknown>;
|
|
65
|
+
}
|
|
66
|
+
/** Resolved settings for the Activepieces plugin. */
|
|
67
|
+
interface ActivepiecesSettings {
|
|
68
|
+
apiKey: string;
|
|
69
|
+
baseUrl: string;
|
|
70
|
+
projectId?: string;
|
|
71
|
+
defaultFlowId?: string;
|
|
72
|
+
webhookMode: WebhookMode;
|
|
73
|
+
timeoutMs: number;
|
|
74
|
+
}
|
|
75
|
+
/** Schema of a flow returned by the Activepieces API. */
|
|
76
|
+
interface ActivepiecesFlow {
|
|
77
|
+
id: string;
|
|
78
|
+
created?: string;
|
|
79
|
+
updated?: string;
|
|
80
|
+
projectId?: string;
|
|
81
|
+
externalId?: string;
|
|
82
|
+
status?: 'ENABLED' | 'DISABLED' | string;
|
|
83
|
+
publishedVersionId?: string | null;
|
|
84
|
+
folderId?: string | null;
|
|
85
|
+
metadata?: Record<string, unknown>;
|
|
86
|
+
}
|
|
87
|
+
/** Schema of a flow run returned by the Activepieces API. */
|
|
88
|
+
interface ActivepiecesFlowRun {
|
|
89
|
+
id: string;
|
|
90
|
+
flowId: string;
|
|
91
|
+
projectId: string;
|
|
92
|
+
flowVersionId?: string;
|
|
93
|
+
status: string;
|
|
94
|
+
environment?: string;
|
|
95
|
+
startTime?: string;
|
|
96
|
+
finishTime?: string;
|
|
97
|
+
stepsCount?: number;
|
|
98
|
+
tags?: string[];
|
|
99
|
+
steps?: Record<string, unknown>;
|
|
100
|
+
failedStep?: {
|
|
101
|
+
name?: string;
|
|
102
|
+
displayName?: string;
|
|
103
|
+
} | null;
|
|
104
|
+
}
|
|
105
|
+
/** Result of executing an Activepieces flow webhook. */
|
|
106
|
+
interface ActivepiecesExecutionResult {
|
|
107
|
+
output: unknown;
|
|
108
|
+
flowRunId?: string;
|
|
109
|
+
flowDuration?: number;
|
|
110
|
+
run?: ActivepiecesFlowRun;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Activepieces Automation Plugin
|
|
115
|
+
*
|
|
116
|
+
* Pipeline plugin that delegates work generation to Activepieces flows.
|
|
117
|
+
* Activepieces is the AI-first, open-source automation platform — this plugin
|
|
118
|
+
* triggers a flow webhook at the execute stage and collects structured items
|
|
119
|
+
* from its Return Response action.
|
|
120
|
+
*/
|
|
121
|
+
declare class ActivepiecesPlugin implements IPlugin, IPipelinePlugin, IFormSchemaProvider {
|
|
122
|
+
readonly id = "activepieces";
|
|
123
|
+
readonly name = "Activepieces Automation";
|
|
124
|
+
readonly version = "1.0.0";
|
|
125
|
+
readonly category: PluginCategory;
|
|
126
|
+
readonly capabilities: readonly ["pipeline", "form-schema-provider"];
|
|
127
|
+
readonly configurationMode: "user-required";
|
|
128
|
+
readonly handledConfigFields: readonly ["*"];
|
|
129
|
+
readonly settingsSchema: JsonSchema;
|
|
130
|
+
private context;
|
|
131
|
+
onLoad(context: PluginContext): Promise<void>;
|
|
132
|
+
onUnload(): Promise<void>;
|
|
133
|
+
healthCheck(): Promise<PluginHealthCheck>;
|
|
134
|
+
isAvailable(settings?: Record<string, unknown>): Promise<boolean>;
|
|
135
|
+
validateSettings(settings: Record<string, unknown>): Promise<ValidationResult>;
|
|
136
|
+
validateConnection(rawSettings: Record<string, unknown>): Promise<ConnectionValidationResult>;
|
|
137
|
+
getManifest(): PluginManifest;
|
|
138
|
+
getFormFields(): FormFieldDefinition[];
|
|
139
|
+
getFormGroups(): FormFieldGroup[];
|
|
140
|
+
validateFormInput(values: Record<string, unknown>): ValidationResult;
|
|
141
|
+
getDefaultValues(): Record<string, unknown>;
|
|
142
|
+
getStepDefinitions(): readonly PipelineStepDefinition[];
|
|
143
|
+
private _lastState;
|
|
144
|
+
private _lastAbortController;
|
|
145
|
+
execute(work: WorkReference, request: GenerationRequest, existing: ExistingItems, options?: PipelineExecutionOptions, onProgress?: PipelineProgressCallback): Promise<PipelineResult>;
|
|
146
|
+
cancel(): Promise<void>;
|
|
147
|
+
getState(): PipelineState<ActivepiecesStepId> | null;
|
|
148
|
+
private resolveApSettings;
|
|
149
|
+
private resolveFlowId;
|
|
150
|
+
private captureScreenshots;
|
|
151
|
+
/**
|
|
152
|
+
* Flatten a ResolvedSettings map into plain key->value pairs.
|
|
153
|
+
*/
|
|
154
|
+
private flattenSettings;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export { type ActivepiecesExecutionResult, type ActivepiecesFlow, type ActivepiecesFlowInput, type ActivepiecesFlowOutput, type ActivepiecesFlowRun, type ActivepiecesOutputItem, ActivepiecesPlugin, type ActivepiecesSettings, type ActivepiecesStepId, type WebhookMode, ActivepiecesPlugin as default };
|