@activepieces/piece-air-ops 0.0.1
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 +7 -0
- package/package.json +25 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +55 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/get-execution.d.ts +4 -0
- package/src/lib/actions/get-execution.js +66 -0
- package/src/lib/actions/get-execution.js.map +1 -0
- package/src/lib/actions/run-workflow-async.d.ts +6 -0
- package/src/lib/actions/run-workflow-async.js +83 -0
- package/src/lib/actions/run-workflow-async.js.map +1 -0
- package/src/lib/actions/run-workflow.d.ts +6 -0
- package/src/lib/actions/run-workflow.js +83 -0
- package/src/lib/actions/run-workflow.js.map +1 -0
- package/src/lib/common/index.d.ts +3 -0
- package/src/lib/common/index.js +22 -0
- package/src/lib/common/index.js.map +1 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@activepieces/piece-air-ops",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@sinclair/typebox": "0.34.11",
|
|
6
|
+
"axios": "1.13.1",
|
|
7
|
+
"axios-retry": "4.4.1",
|
|
8
|
+
"deepmerge-ts": "7.1.0",
|
|
9
|
+
"mime-types": "2.1.35",
|
|
10
|
+
"nanoid": "3.3.8",
|
|
11
|
+
"semver": "7.6.0",
|
|
12
|
+
"socket.io-client": "4.8.1",
|
|
13
|
+
"zod": "4.1.13",
|
|
14
|
+
"@activepieces/pieces-common": "0.10.1",
|
|
15
|
+
"@activepieces/pieces-framework": "0.22.2",
|
|
16
|
+
"@activepieces/shared": "0.30.1",
|
|
17
|
+
"tslib": "2.6.2"
|
|
18
|
+
},
|
|
19
|
+
"resolutions": {
|
|
20
|
+
"rollup": "npm:@rollup/wasm-node"
|
|
21
|
+
},
|
|
22
|
+
"types": "./src/index.d.ts",
|
|
23
|
+
"main": "./src/index.js",
|
|
24
|
+
"type": "commonjs"
|
|
25
|
+
}
|
package/src/index.d.ts
ADDED
package/src/index.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.airOps = exports.airOpsAuth = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const shared_1 = require("@activepieces/shared");
|
|
8
|
+
const common_1 = require("./lib/common");
|
|
9
|
+
const run_workflow_1 = require("./lib/actions/run-workflow");
|
|
10
|
+
const run_workflow_async_1 = require("./lib/actions/run-workflow-async");
|
|
11
|
+
const get_execution_1 = require("./lib/actions/get-execution");
|
|
12
|
+
exports.airOpsAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
13
|
+
displayName: 'API Key',
|
|
14
|
+
description: 'Your API key can be found in the **Workspace Settings** section of your AirOps account.',
|
|
15
|
+
required: true,
|
|
16
|
+
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
17
|
+
try {
|
|
18
|
+
yield (0, common_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, '/public_api/airops_apps');
|
|
19
|
+
return {
|
|
20
|
+
valid: true,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
return {
|
|
25
|
+
valid: false,
|
|
26
|
+
error: 'Invalid API Key.',
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
exports.airOps = (0, pieces_framework_1.createPiece)({
|
|
32
|
+
displayName: 'AirOps',
|
|
33
|
+
description: 'Build and deploy AI-powered workflows and agents.',
|
|
34
|
+
auth: exports.airOpsAuth,
|
|
35
|
+
minimumSupportedRelease: '0.36.1',
|
|
36
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/air-ops.png',
|
|
37
|
+
categories: [shared_1.PieceCategory.ARTIFICIAL_INTELLIGENCE],
|
|
38
|
+
authors: ['onyedikachi-david'],
|
|
39
|
+
actions: [
|
|
40
|
+
run_workflow_1.runWorkflow,
|
|
41
|
+
run_workflow_async_1.runWorkflowAsync,
|
|
42
|
+
get_execution_1.getExecution,
|
|
43
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
44
|
+
auth: exports.airOpsAuth,
|
|
45
|
+
baseUrl: () => common_1.BASE_URL,
|
|
46
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
+
return ({
|
|
48
|
+
Authorization: `Bearer ${auth.secret_text}`,
|
|
49
|
+
});
|
|
50
|
+
}),
|
|
51
|
+
}),
|
|
52
|
+
],
|
|
53
|
+
triggers: [],
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/air-ops/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAGqC;AACrC,iDAAqD;AACrD,yCAAqD;AACrD,6DAAyD;AACzD,yEAAoE;AACpE,+DAA2D;AAE9C,QAAA,UAAU,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC7C,WAAW,EAAE,SAAS;IACtB,WAAW,EACT,yFAAyF;IAC3F,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,IAAA,oBAAW,EAAC,IAAI,EAAE,0BAAU,CAAC,GAAG,EAAE,yBAAyB,CAAC,CAAC;YACnE,OAAO;gBACL,KAAK,EAAE,IAAI;aACZ,CAAC;QACJ,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,kBAAkB;aAC1B,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC;AAEU,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,mDAAmD;IAChE,IAAI,EAAE,kBAAU;IAChB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,iDAAiD;IAC1D,UAAU,EAAE,CAAC,sBAAa,CAAC,uBAAuB,CAAC;IACnD,OAAO,EAAE,CAAC,mBAAmB,CAAC;IAC9B,OAAO,EAAE;QACP,0BAAW;QACX,qCAAgB;QAChB,4BAAY;QACZ,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,kBAAU;YAChB,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAQ;YACvB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;iBAC5C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const getExecution: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
app: import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
execution_uuid: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExecution = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const __1 = require("../..");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.getExecution = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.airOpsAuth,
|
|
11
|
+
name: 'get_execution',
|
|
12
|
+
displayName: 'Get Execution',
|
|
13
|
+
description: 'Get an execution by UUID.',
|
|
14
|
+
props: {
|
|
15
|
+
app: pieces_framework_1.Property.Dropdown({
|
|
16
|
+
displayName: 'Workflow',
|
|
17
|
+
description: 'Select the workflow.',
|
|
18
|
+
required: true,
|
|
19
|
+
refreshers: [],
|
|
20
|
+
auth: __1.airOpsAuth,
|
|
21
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
22
|
+
if (!auth) {
|
|
23
|
+
return {
|
|
24
|
+
disabled: true,
|
|
25
|
+
placeholder: 'Connect your AirOps account first',
|
|
26
|
+
options: [],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const apps = yield (0, common_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, '/public_api/airops_apps');
|
|
31
|
+
return {
|
|
32
|
+
disabled: false,
|
|
33
|
+
options: apps.map((app) => ({
|
|
34
|
+
label: app.name,
|
|
35
|
+
value: app.id,
|
|
36
|
+
})),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
return {
|
|
41
|
+
disabled: true,
|
|
42
|
+
placeholder: 'Failed to load workflows',
|
|
43
|
+
options: [],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}),
|
|
47
|
+
}),
|
|
48
|
+
execution_uuid: pieces_framework_1.Property.ShortText({
|
|
49
|
+
displayName: 'Execution UUID',
|
|
50
|
+
description: 'The UUID of the execution to retrieve.',
|
|
51
|
+
required: true,
|
|
52
|
+
}),
|
|
53
|
+
},
|
|
54
|
+
run(context) {
|
|
55
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const { app, execution_uuid } = context.propsValue;
|
|
57
|
+
const response = (yield (0, common_1.makeRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.GET, `/public_api/airops_apps/${app}/executions`));
|
|
58
|
+
const execution = response.data.find((e) => e.uuid === execution_uuid);
|
|
59
|
+
if (!execution) {
|
|
60
|
+
throw new Error(`Execution with UUID "${execution_uuid}" not found.`);
|
|
61
|
+
}
|
|
62
|
+
return execution;
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=get-execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-execution.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/air-ops/src/lib/actions/get-execution.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,6BAAmC;AACnC,sCAAwC;AAE3B,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,cAAU;IAChB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,2BAA2B;IACxC,KAAK,EAAE;QACL,GAAG,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACrB,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,sBAAsB;YACnC,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,EAAE;YACd,IAAI,EAAE,cAAU;YAChB,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,mCAAmC;wBAChD,OAAO,EAAE,EAAE;qBACZ,CAAC;gBACJ,CAAC;gBAED,IAAI,CAAC;oBACH,MAAM,IAAI,GAAG,MAAM,IAAA,oBAAW,EAC5B,IAAI,CAAC,WAAW,EAChB,0BAAU,CAAC,GAAG,EACd,yBAAyB,CAC1B,CAAC;oBAEF,OAAO;wBACL,QAAQ,EAAE,KAAK;wBACf,OAAO,EAAG,IAAoB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;4BAC3C,KAAK,EAAE,GAAG,CAAC,IAAI;4BACf,KAAK,EAAE,GAAG,CAAC,EAAE;yBACd,CAAC,CAAC;qBACJ,CAAC;gBACJ,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,0BAA0B;wBACvC,OAAO,EAAE,EAAE;qBACZ,CAAC;gBACJ,CAAC;YACH,CAAC,CAAA;SACF,CAAC;QACF,cAAc,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACjC,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEnD,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAA,oBAAW,EACjC,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,GAAG,EACd,2BAA2B,GAAG,aAAa,CAC5C,CAAuB,CAAC;YAEzB,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC;YAEvE,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,wBAAwB,cAAc,cAAc,CAAC,CAAC;YACxE,CAAC;YAED,OAAO,SAAS,CAAC;QACnB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const runWorkflowAsync: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
app: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
inputs: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
4
|
+
inputs_schema: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
5
|
+
definition: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runWorkflowAsync = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const __1 = require("../..");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.runWorkflowAsync = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.airOpsAuth,
|
|
11
|
+
name: 'run_workflow_async',
|
|
12
|
+
displayName: 'Run Workflow (Async)',
|
|
13
|
+
description: 'Queue an AirOps workflow for asynchronous execution.',
|
|
14
|
+
props: {
|
|
15
|
+
app: pieces_framework_1.Property.Dropdown({
|
|
16
|
+
displayName: 'Workflow',
|
|
17
|
+
description: 'Select the workflow to execute.',
|
|
18
|
+
required: true,
|
|
19
|
+
refreshers: [],
|
|
20
|
+
auth: __1.airOpsAuth,
|
|
21
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
22
|
+
if (!auth) {
|
|
23
|
+
return {
|
|
24
|
+
disabled: true,
|
|
25
|
+
placeholder: 'Connect your AirOps account first',
|
|
26
|
+
options: [],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const apps = yield (0, common_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, '/public_api/airops_apps');
|
|
31
|
+
return {
|
|
32
|
+
disabled: false,
|
|
33
|
+
options: apps.map((app) => ({
|
|
34
|
+
label: app.name,
|
|
35
|
+
value: app.uuid,
|
|
36
|
+
})),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
return {
|
|
41
|
+
disabled: true,
|
|
42
|
+
placeholder: 'Failed to load workflows',
|
|
43
|
+
options: [],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}),
|
|
47
|
+
}),
|
|
48
|
+
inputs: pieces_framework_1.Property.Json({
|
|
49
|
+
displayName: 'Inputs',
|
|
50
|
+
description: 'Input values for the workflow.',
|
|
51
|
+
required: false,
|
|
52
|
+
defaultValue: {},
|
|
53
|
+
}),
|
|
54
|
+
inputs_schema: pieces_framework_1.Property.Json({
|
|
55
|
+
displayName: 'Inputs Schema',
|
|
56
|
+
description: 'Schema defining the workflow inputs (advanced).',
|
|
57
|
+
required: false,
|
|
58
|
+
}),
|
|
59
|
+
definition: pieces_framework_1.Property.Json({
|
|
60
|
+
displayName: 'Definition',
|
|
61
|
+
description: 'Custom workflow definition steps (advanced).',
|
|
62
|
+
required: false,
|
|
63
|
+
}),
|
|
64
|
+
},
|
|
65
|
+
run(context) {
|
|
66
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const { app, inputs, inputs_schema, definition } = context.propsValue;
|
|
68
|
+
const body = {};
|
|
69
|
+
if (inputs) {
|
|
70
|
+
body['inputs'] = inputs;
|
|
71
|
+
}
|
|
72
|
+
if (inputs_schema) {
|
|
73
|
+
body['inputs_schema'] = inputs_schema;
|
|
74
|
+
}
|
|
75
|
+
if (definition) {
|
|
76
|
+
body['definition'] = definition;
|
|
77
|
+
}
|
|
78
|
+
const response = yield (0, common_1.makeRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.POST, `/public_api/airops_apps/${app}/async_execute_definition`, body);
|
|
79
|
+
return response;
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
//# sourceMappingURL=run-workflow-async.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-workflow-async.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/air-ops/src/lib/actions/run-workflow-async.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,6BAAmC;AACnC,sCAAwC;AAE3B,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,cAAU;IAChB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,sDAAsD;IACnE,KAAK,EAAE;QACL,GAAG,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACrB,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,EAAE;YACd,IAAI,EAAE,cAAU;YAChB,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,mCAAmC;wBAChD,OAAO,EAAE,EAAE;qBACZ,CAAC;gBACJ,CAAC;gBAED,IAAI,CAAC;oBACH,MAAM,IAAI,GAAG,MAAM,IAAA,oBAAW,EAC5B,IAAI,CAAC,WAAW,EAChB,0BAAU,CAAC,GAAG,EACd,yBAAyB,CAC1B,CAAC;oBAEF,OAAO;wBACL,QAAQ,EAAE,KAAK;wBACf,OAAO,EAAG,IAAoB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;4BAC3C,KAAK,EAAE,GAAG,CAAC,IAAI;4BACf,KAAK,EAAE,GAAG,CAAC,IAAI;yBAChB,CAAC,CAAC;qBACJ,CAAC;gBACJ,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,0BAA0B;wBACvC,OAAO,EAAE,EAAE;qBACZ,CAAC;gBACJ,CAAC;YACH,CAAC,CAAA;SACF,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,IAAI,CAAC;YACpB,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,EAAE;SACjB,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAC3B,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,IAAI,CAAC;YACxB,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,8CAA8C;YAC3D,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEtE,MAAM,IAAI,GAA4B,EAAE,CAAC;YAEzC,IAAI,MAAM,EAAE,CAAC;gBACX,IAAI,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;YAC1B,CAAC;YACD,IAAI,aAAa,EAAE,CAAC;gBAClB,IAAI,CAAC,eAAe,CAAC,GAAG,aAAa,CAAC;YACxC,CAAC;YACD,IAAI,UAAU,EAAE,CAAC;gBACf,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;YAClC,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,IAAI,EACf,2BAA2B,GAAG,2BAA2B,EACzD,IAAI,CACL,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const runWorkflow: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
app: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
inputs: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
4
|
+
inputs_schema: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
5
|
+
definition: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runWorkflow = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const __1 = require("../..");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.runWorkflow = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.airOpsAuth,
|
|
11
|
+
name: 'run_workflow',
|
|
12
|
+
displayName: 'Run Workflow',
|
|
13
|
+
description: 'Execute an AirOps workflow synchronously.',
|
|
14
|
+
props: {
|
|
15
|
+
app: pieces_framework_1.Property.Dropdown({
|
|
16
|
+
displayName: 'Workflow',
|
|
17
|
+
description: 'Select the workflow to execute.',
|
|
18
|
+
required: true,
|
|
19
|
+
refreshers: [],
|
|
20
|
+
auth: __1.airOpsAuth,
|
|
21
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
22
|
+
if (!auth) {
|
|
23
|
+
return {
|
|
24
|
+
disabled: true,
|
|
25
|
+
placeholder: 'Connect your AirOps account first',
|
|
26
|
+
options: [],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const apps = yield (0, common_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, '/public_api/airops_apps');
|
|
31
|
+
return {
|
|
32
|
+
disabled: false,
|
|
33
|
+
options: apps.map((app) => ({
|
|
34
|
+
label: app.name,
|
|
35
|
+
value: app.uuid,
|
|
36
|
+
})),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
return {
|
|
41
|
+
disabled: true,
|
|
42
|
+
placeholder: 'Failed to load workflows',
|
|
43
|
+
options: [],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}),
|
|
47
|
+
}),
|
|
48
|
+
inputs: pieces_framework_1.Property.Json({
|
|
49
|
+
displayName: 'Inputs',
|
|
50
|
+
description: 'Input values for the workflow.',
|
|
51
|
+
required: false,
|
|
52
|
+
defaultValue: {},
|
|
53
|
+
}),
|
|
54
|
+
inputs_schema: pieces_framework_1.Property.Json({
|
|
55
|
+
displayName: 'Inputs Schema',
|
|
56
|
+
description: 'Schema defining the workflow inputs (advanced).',
|
|
57
|
+
required: false,
|
|
58
|
+
}),
|
|
59
|
+
definition: pieces_framework_1.Property.Json({
|
|
60
|
+
displayName: 'Definition',
|
|
61
|
+
description: 'Custom workflow definition steps (advanced).',
|
|
62
|
+
required: false,
|
|
63
|
+
}),
|
|
64
|
+
},
|
|
65
|
+
run(context) {
|
|
66
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const { app, inputs, inputs_schema, definition } = context.propsValue;
|
|
68
|
+
const body = {};
|
|
69
|
+
if (inputs) {
|
|
70
|
+
body['inputs'] = inputs;
|
|
71
|
+
}
|
|
72
|
+
if (inputs_schema) {
|
|
73
|
+
body['inputs_schema'] = inputs_schema;
|
|
74
|
+
}
|
|
75
|
+
if (definition) {
|
|
76
|
+
body['definition'] = definition;
|
|
77
|
+
}
|
|
78
|
+
const response = yield (0, common_1.makeRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.POST, `/public_api/airops_apps/${app}/execute_definition`, body);
|
|
79
|
+
return response;
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
//# sourceMappingURL=run-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-workflow.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/air-ops/src/lib/actions/run-workflow.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,6BAAmC;AACnC,sCAAwC;AAE3B,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,cAAU;IAChB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,2CAA2C;IACxD,KAAK,EAAE;QACL,GAAG,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACrB,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,EAAE;YACd,IAAI,EAAE,cAAU;YAChB,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,mCAAmC;wBAChD,OAAO,EAAE,EAAE;qBACZ,CAAC;gBACJ,CAAC;gBAED,IAAI,CAAC;oBACH,MAAM,IAAI,GAAG,MAAM,IAAA,oBAAW,EAC5B,IAAI,CAAC,WAAW,EAChB,0BAAU,CAAC,GAAG,EACd,yBAAyB,CAC1B,CAAC;oBAEF,OAAO;wBACL,QAAQ,EAAE,KAAK;wBACf,OAAO,EAAG,IAAoB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;4BAC3C,KAAK,EAAE,GAAG,CAAC,IAAI;4BACf,KAAK,EAAE,GAAG,CAAC,IAAI;yBAChB,CAAC,CAAC;qBACJ,CAAC;gBACJ,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,0BAA0B;wBACvC,OAAO,EAAE,EAAE;qBACZ,CAAC;gBACJ,CAAC;YACH,CAAC,CAAA;SACF,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,IAAI,CAAC;YACpB,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,EAAE;SACjB,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAC3B,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,IAAI,CAAC;YACxB,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,8CAA8C;YAC3D,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEtE,MAAM,IAAI,GAA4B,EAAE,CAAC;YAEzC,IAAI,MAAM,EAAE,CAAC;gBACX,IAAI,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;YAC1B,CAAC;YACD,IAAI,aAAa,EAAE,CAAC;gBAClB,IAAI,CAAC,eAAe,CAAC,GAAG,aAAa,CAAC;YACxC,CAAC;YACD,IAAI,UAAU,EAAE,CAAC;gBACf,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;YAClC,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,IAAI,EACf,2BAA2B,GAAG,qBAAqB,EACnD,IAAI,CACL,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BASE_URL = void 0;
|
|
4
|
+
exports.makeRequest = makeRequest;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
exports.BASE_URL = 'https://api.airops.com';
|
|
8
|
+
function makeRequest(auth, method, path, body) {
|
|
9
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
11
|
+
method,
|
|
12
|
+
url: `${exports.BASE_URL}${path}`,
|
|
13
|
+
headers: {
|
|
14
|
+
Authorization: `Bearer ${auth}`,
|
|
15
|
+
'Content-Type': 'application/json',
|
|
16
|
+
},
|
|
17
|
+
body,
|
|
18
|
+
});
|
|
19
|
+
return response.body;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/air-ops/src/lib/common/index.ts"],"names":[],"mappings":";;;AAIA,kCAiBC;;AArBD,+DAAqE;AAExD,QAAA,QAAQ,GAAG,wBAAwB,CAAC;AAEjD,SAAsB,WAAW,CAC/B,IAAY,EACZ,MAAkB,EAClB,IAAY,EACZ,IAAc;;QAEd,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;YAC5C,MAAM;YACN,GAAG,EAAE,GAAG,gBAAQ,GAAG,IAAI,EAAE;YACzB,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,EAAE;gBAC/B,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI;SACL,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CAAA"}
|