@activepieces/piece-coralogix 0.1.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.
Files changed (43) hide show
  1. package/package.json +16 -0
  2. package/src/index.d.ts +5 -0
  3. package/src/index.js +61 -0
  4. package/src/index.js.map +1 -0
  5. package/src/lib/actions/acknowledge-incidents.d.ts +7 -0
  6. package/src/lib/actions/acknowledge-incidents.js +36 -0
  7. package/src/lib/actions/acknowledge-incidents.js.map +1 -0
  8. package/src/lib/actions/assign-incidents.d.ts +8 -0
  9. package/src/lib/actions/assign-incidents.js +39 -0
  10. package/src/lib/actions/assign-incidents.js.map +1 -0
  11. package/src/lib/actions/close-incidents.d.ts +7 -0
  12. package/src/lib/actions/close-incidents.js +34 -0
  13. package/src/lib/actions/close-incidents.js.map +1 -0
  14. package/src/lib/actions/get-incident-by-id.d.ts +7 -0
  15. package/src/lib/actions/get-incident-by-id.js +30 -0
  16. package/src/lib/actions/get-incident-by-id.js.map +1 -0
  17. package/src/lib/actions/get-incident-events.d.ts +7 -0
  18. package/src/lib/actions/get-incident-events.js +28 -0
  19. package/src/lib/actions/get-incident-events.js.map +1 -0
  20. package/src/lib/actions/list-incidents.d.ts +11 -0
  21. package/src/lib/actions/list-incidents.js +83 -0
  22. package/src/lib/actions/list-incidents.js.map +1 -0
  23. package/src/lib/actions/resolve-incidents.d.ts +7 -0
  24. package/src/lib/actions/resolve-incidents.js +34 -0
  25. package/src/lib/actions/resolve-incidents.js.map +1 -0
  26. package/src/lib/actions/send-logs.d.ts +17 -0
  27. package/src/lib/actions/send-logs.js +111 -0
  28. package/src/lib/actions/send-logs.js.map +1 -0
  29. package/src/lib/actions/set-alert-active.d.ts +8 -0
  30. package/src/lib/actions/set-alert-active.js +35 -0
  31. package/src/lib/actions/set-alert-active.js.map +1 -0
  32. package/src/lib/common/auth.d.ts +5 -0
  33. package/src/lib/common/auth.js +39 -0
  34. package/src/lib/common/auth.js.map +1 -0
  35. package/src/lib/common/client.d.ts +7 -0
  36. package/src/lib/common/client.js +39 -0
  37. package/src/lib/common/client.js.map +1 -0
  38. package/src/lib/triggers/new-alert-event.d.ts +26 -0
  39. package/src/lib/triggers/new-alert-event.js +95 -0
  40. package/src/lib/triggers/new-alert-event.js.map +1 -0
  41. package/src/lib/triggers/new-incident.d.ts +26 -0
  42. package/src/lib/triggers/new-incident.js +78 -0
  43. package/src/lib/triggers/new-incident.js.map +1 -0
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@activepieces/piece-coralogix",
3
+ "version": "0.1.0",
4
+ "main": "./src/index.js",
5
+ "types": "./src/index.d.ts",
6
+ "scripts": {
7
+ "build": "tsc -p tsconfig.lib.json && cp package.json dist/",
8
+ "lint": "eslint 'src/**/*.ts'"
9
+ },
10
+ "dependencies": {
11
+ "@activepieces/pieces-common": "0.11.7",
12
+ "@activepieces/pieces-framework": "0.25.6",
13
+ "@activepieces/shared": "0.41.0",
14
+ "tslib": "2.6.2"
15
+ }
16
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export declare const coralogix: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
5
+ }>>;
package/src/index.js ADDED
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.coralogix = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("./lib/common/auth");
7
+ const send_logs_1 = require("./lib/actions/send-logs");
8
+ const list_incidents_1 = require("./lib/actions/list-incidents");
9
+ const acknowledge_incidents_1 = require("./lib/actions/acknowledge-incidents");
10
+ const resolve_incidents_1 = require("./lib/actions/resolve-incidents");
11
+ const close_incidents_1 = require("./lib/actions/close-incidents");
12
+ const assign_incidents_1 = require("./lib/actions/assign-incidents");
13
+ const get_incident_by_id_1 = require("./lib/actions/get-incident-by-id");
14
+ const get_incident_events_1 = require("./lib/actions/get-incident-events");
15
+ const set_alert_active_1 = require("./lib/actions/set-alert-active");
16
+ const pieces_common_1 = require("@activepieces/pieces-common");
17
+ const new_alert_event_1 = require("./lib/triggers/new-alert-event");
18
+ const new_incident_1 = require("./lib/triggers/new-incident");
19
+ exports.coralogix = (0, pieces_framework_1.createPiece)({
20
+ displayName: 'Coralogix',
21
+ auth: auth_1.coralogixAuth,
22
+ minimumSupportedRelease: '0.36.1',
23
+ logoUrl: 'https://cdn.activepieces.com/pieces/coralogix.png',
24
+ authors: ['sanket-a11y'],
25
+ actions: [
26
+ send_logs_1.sendLogs,
27
+ list_incidents_1.listIncidents,
28
+ acknowledge_incidents_1.acknowledgeIncidents,
29
+ resolve_incidents_1.resolveIncidents,
30
+ close_incidents_1.closeIncidents,
31
+ assign_incidents_1.assignIncidents,
32
+ get_incident_by_id_1.getIncidentById,
33
+ get_incident_events_1.getIncidentEvents,
34
+ set_alert_active_1.setAlertActive,
35
+ (0, pieces_common_1.createCustomApiCallAction)({
36
+ auth: auth_1.coralogixAuth,
37
+ baseUrl: (auth) => {
38
+ var _a, _b;
39
+ const map = {
40
+ 'eu1.coralogix.com': 'api.coralogix.com',
41
+ 'eu2.coralogix.com': 'api.eu2.coralogix.com',
42
+ 'us1.coralogix.com': 'api.coralogix.us',
43
+ 'us2.coralogix.com': 'api.cx498.coralogix.com',
44
+ 'ap1.coralogix.com': 'api.coralogix.in',
45
+ 'ap2.coralogix.com': 'api.coralogixsg.com',
46
+ 'ap3.coralogix.com': 'api.ap3.coralogix.com',
47
+ };
48
+ const domain = (_b = map[(_a = auth === null || auth === void 0 ? void 0 : auth.props) === null || _a === void 0 ? void 0 : _a.coralogixDomain]) !== null && _b !== void 0 ? _b : 'api.coralogix.com';
49
+ return `https://${domain}`;
50
+ },
51
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
52
+ return ({
53
+ 'Content-Type': 'application/json',
54
+ Authorization: `Bearer ${auth.props.personalOrTeamApiKey}`,
55
+ });
56
+ }),
57
+ }),
58
+ ],
59
+ triggers: [new_alert_event_1.newAlertEvent, new_incident_1.newIncident],
60
+ });
61
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,4CAAkD;AAClD,uDAAmD;AACnD,iEAA6D;AAC7D,+EAA2E;AAC3E,uEAAmE;AACnE,mEAA+D;AAC/D,qEAAiE;AACjE,yEAAmE;AACnE,2EAAsE;AACtE,qEAAgE;AAChE,+DAAwE;AACxE,oEAA+D;AAC/D,8DAA0D;AAE7C,QAAA,SAAS,GAAG,IAAA,8BAAW,EAAC;IACnC,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,oBAAa;IACnB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,mDAAmD;IAC5D,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,OAAO,EAAE;QACP,oBAAQ;QACR,8BAAa;QACb,4CAAoB;QACpB,oCAAgB;QAChB,gCAAc;QACd,kCAAe;QACf,oCAAe;QACf,uCAAiB;QACjB,iCAAc;QACd,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,oBAAa;YACnB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;;gBAChB,MAAM,GAAG,GAA2B;oBAClC,mBAAmB,EAAE,mBAAmB;oBACxC,mBAAmB,EAAE,uBAAuB;oBAC5C,mBAAmB,EAAE,kBAAkB;oBACvC,mBAAmB,EAAE,yBAAyB;oBAC9C,mBAAmB,EAAE,kBAAkB;oBACvC,mBAAmB,EAAE,qBAAqB;oBAC1C,mBAAmB,EAAE,uBAAuB;iBAC7C,CAAC;gBACF,MAAM,MAAM,GAAG,MAAA,GAAG,CAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,eAAyB,CAAC,mCAAI,mBAAmB,CAAC;gBAClF,OAAO,WAAW,MAAM,EAAE,CAAC;YAC7B,CAAC;YACD,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,cAAc,EAAE,kBAAkB;oBAClC,aAAa,EAAE,UAAU,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE;iBAC3D,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,+BAAa,EAAE,0BAAW,CAAC;CACvC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const acknowledgeIncidents: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
5
+ }>, {
6
+ incidentIds: import("@activepieces/pieces-framework").ArrayProperty<true>;
7
+ }>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.acknowledgeIncidents = 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 auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ exports.acknowledgeIncidents = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.coralogixAuth,
11
+ name: 'acknowledgeIncidents',
12
+ displayName: 'Acknowledge Incidents',
13
+ description: 'Acknowledge one or more Coralogix incidents by incident ID.',
14
+ requireAuth: true,
15
+ props: {
16
+ incidentIds: pieces_framework_1.Property.Array({
17
+ displayName: 'Incident IDs',
18
+ description: 'List of incident IDs to acknowledge.',
19
+ required: true,
20
+ defaultValue: [],
21
+ }),
22
+ },
23
+ run(_a) {
24
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
25
+ var _b;
26
+ const incidentIds = ((_b = propsValue.incidentIds) !== null && _b !== void 0 ? _b : []);
27
+ const queryString = incidentIds
28
+ .map((id) => `incident_ids=${encodeURIComponent(id)}`)
29
+ .join('&');
30
+ const endpoint = `/mgmt/openapi/latest/incidents/incidents/v1/acknowledge?${queryString}`;
31
+ const response = yield (0, client_1.makeRequest)(auth, 'management', pieces_common_1.HttpMethod.POST, endpoint);
32
+ return response;
33
+ });
34
+ },
35
+ });
36
+ //# sourceMappingURL=acknowledge-incidents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acknowledge-incidents.js","sourceRoot":"","sources":["../../../../src/lib/actions/acknowledge-incidents.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,yCAA+C;AAC/C,6CAA+C;AAElC,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,6DAA6D;IAC1E,WAAW,EAAE,IAAI;IACjB,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,KAAK,CAAC;YAC1B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,sCAAsC;YACnD,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,EAAE;SACjB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,MAAM,WAAW,GAAG,CAAC,MAAA,UAAU,CAAC,WAAW,mCAAI,EAAE,CAAa,CAAC;YAE/D,MAAM,WAAW,GAAG,WAAW;iBAC5B,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC;iBACrD,IAAI,CAAC,GAAG,CAAC,CAAC;YACb,MAAM,QAAQ,GAAG,2DAA2D,WAAW,EAAE,CAAC;YAE1F,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,IAAI,EACJ,YAAY,EACZ,0BAAU,CAAC,IAAI,EACf,QAAQ,CACT,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const assignIncidents: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
5
+ }>, {
6
+ incidentIds: import("@activepieces/pieces-framework").ArrayProperty<true>;
7
+ assignToUserId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
+ }>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assignIncidents = 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 auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ exports.assignIncidents = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.coralogixAuth,
11
+ name: 'assignIncidents',
12
+ displayName: 'Assign Incidents',
13
+ description: 'Assign one or more Coralogix incidents to a specific user.',
14
+ requireAuth: true,
15
+ props: {
16
+ incidentIds: pieces_framework_1.Property.Array({
17
+ displayName: 'Incident IDs',
18
+ description: 'List of incident IDs to assign. Find IDs via "List Incidents" or the Coralogix Incidents page URL.',
19
+ required: true,
20
+ defaultValue: [],
21
+ }),
22
+ assignToUserId: pieces_framework_1.Property.ShortText({
23
+ displayName: 'Assign To (User ID)',
24
+ description: 'The Coralogix user ID to assign the incidents to.',
25
+ required: true,
26
+ }),
27
+ },
28
+ run(_a) {
29
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
30
+ var _b;
31
+ const incidentIds = ((_b = propsValue.incidentIds) !== null && _b !== void 0 ? _b : []);
32
+ const queryString = incidentIds
33
+ .map((id) => `incident_ids=${encodeURIComponent(id)}`)
34
+ .join('&');
35
+ return yield (0, client_1.makeRequest)(auth, 'management', pieces_common_1.HttpMethod.POST, `/mgmt/openapi/latest/incidents/incidents/v1/by-user?${queryString}`, { assigned_to: { user_id: propsValue.assignToUserId } });
36
+ });
37
+ },
38
+ });
39
+ //# sourceMappingURL=assign-incidents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assign-incidents.js","sourceRoot":"","sources":["../../../../src/lib/actions/assign-incidents.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,yCAA+C;AAC/C,6CAA+C;AAElC,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,4DAA4D;IACzE,WAAW,EAAE,IAAI;IACjB,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,KAAK,CAAC;YAC1B,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,oGAAoG;YACtG,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,EAAE;SACjB,CAAC;QACF,cAAc,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACjC,WAAW,EAAE,qBAAqB;YAClC,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,MAAM,WAAW,GAAG,CAAC,MAAA,UAAU,CAAC,WAAW,mCAAI,EAAE,CAAa,CAAC;YAC/D,MAAM,WAAW,GAAG,WAAW;iBAC5B,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC;iBACrD,IAAI,CAAC,GAAG,CAAC,CAAC;YAEb,OAAO,MAAM,IAAA,oBAAW,EACtB,IAAI,EACJ,YAAY,EACZ,0BAAU,CAAC,IAAI,EACf,uDAAuD,WAAW,EAAE,EACpE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,cAAc,EAAE,EAAE,CACxD,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const closeIncidents: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
5
+ }>, {
6
+ incidentIds: import("@activepieces/pieces-framework").ArrayProperty<true>;
7
+ }>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.closeIncidents = 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 auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ exports.closeIncidents = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.coralogixAuth,
11
+ name: 'closeIncidents',
12
+ displayName: 'Close Incidents',
13
+ description: 'Close one or more Coralogix incidents (e.g. false positives or noise). Use Resolve for incidents that were actually fixed.',
14
+ requireAuth: true,
15
+ props: {
16
+ incidentIds: pieces_framework_1.Property.Array({
17
+ displayName: 'Incident IDs',
18
+ description: 'List of incident IDs to close. Find the ID in Coralogix → Alerts → Incidents → click an incident → copy the ID from the URL.',
19
+ required: true,
20
+ defaultValue: [],
21
+ }),
22
+ },
23
+ run(_a) {
24
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
25
+ var _b;
26
+ const incidentIds = ((_b = propsValue.incidentIds) !== null && _b !== void 0 ? _b : []);
27
+ const queryString = incidentIds
28
+ .map((id) => `incident_ids=${encodeURIComponent(id)}`)
29
+ .join('&');
30
+ return yield (0, client_1.makeRequest)(auth, 'management', pieces_common_1.HttpMethod.POST, `/mgmt/openapi/latest/incidents/incidents/v1/close?${queryString}`);
31
+ });
32
+ },
33
+ });
34
+ //# sourceMappingURL=close-incidents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"close-incidents.js","sourceRoot":"","sources":["../../../../src/lib/actions/close-incidents.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,yCAA+C;AAC/C,6CAA+C;AAElC,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,4HAA4H;IACzI,WAAW,EAAE,IAAI;IACjB,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,KAAK,CAAC;YAC1B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,8HAA8H;YAC3I,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,EAAE;SACjB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,MAAM,WAAW,GAAG,CAAC,MAAA,UAAU,CAAC,WAAW,mCAAI,EAAE,CAAa,CAAC;YAE/D,MAAM,WAAW,GAAG,WAAW;iBAC5B,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC;iBACrD,IAAI,CAAC,GAAG,CAAC,CAAC;YAEb,OAAO,MAAM,IAAA,oBAAW,EACtB,IAAI,EACJ,YAAY,EACZ,0BAAU,CAAC,IAAI,EACf,qDAAqD,WAAW,EAAE,CACnE,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const getIncidentById: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
5
+ }>, {
6
+ incidentId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ }>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getIncidentById = 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 auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ exports.getIncidentById = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.coralogixAuth,
11
+ name: 'getIncidentById',
12
+ displayName: 'Get Incident By ID',
13
+ description: 'Retrieve a Coralogix incident by its incident ID.',
14
+ requireAuth: true,
15
+ props: {
16
+ incidentId: pieces_framework_1.Property.ShortText({
17
+ displayName: 'Incident ID',
18
+ description: 'The Coralogix incident ID to retrieve.',
19
+ required: true,
20
+ }),
21
+ },
22
+ run(_a) {
23
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
24
+ const incidentId = propsValue.incidentId;
25
+ const response = yield (0, client_1.makeRequest)(auth, 'management', pieces_common_1.HttpMethod.GET, `/mgmt/openapi/latest/incidents/incidents/v1/${encodeURIComponent(incidentId)}`);
26
+ return response;
27
+ });
28
+ },
29
+ });
30
+ //# sourceMappingURL=get-incident-by-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-incident-by-id.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-incident-by-id.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,yCAA+C;AAC/C,6CAA+C;AAElC,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,mDAAmD;IAChE,WAAW,EAAE,IAAI;IACjB,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;YAEzC,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,IAAI,EACJ,YAAY,EACZ,0BAAU,CAAC,GAAG,EACd,+CAA+C,kBAAkB,CAC/D,UAAU,CACX,EAAE,CACJ,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const getIncidentEvents: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
5
+ }>, {
6
+ incidentId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ }>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getIncidentEvents = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@activepieces/pieces-common");
6
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
7
+ const auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ exports.getIncidentEvents = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.coralogixAuth,
11
+ name: 'getIncidentEvents',
12
+ displayName: 'Get Incident Events',
13
+ description: 'Get related events for a specific incident.',
14
+ requireAuth: true,
15
+ props: {
16
+ incidentId: pieces_framework_1.Property.ShortText({
17
+ displayName: 'Incident ID',
18
+ required: true,
19
+ }),
20
+ },
21
+ run(_a) {
22
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
23
+ const incidentId = propsValue.incidentId;
24
+ return yield (0, client_1.makeRequest)(auth, 'management', pieces_common_1.HttpMethod.GET, `/mgmt/openapi/latest/incidents/incidents/v1/${encodeURIComponent(incidentId)}/events`);
25
+ });
26
+ },
27
+ });
28
+ //# sourceMappingURL=get-incident-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-incident-events.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-incident-events.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AACxE,yCAA+C;AAC/C,6CAA+C;AAElC,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,6CAA6C;IAC1D,WAAW,EAAE,IAAI;IACjB,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;YAEzC,OAAO,MAAM,IAAA,oBAAW,EACtB,IAAI,EACJ,YAAY,EACZ,0BAAU,CAAC,GAAG,EACd,+CAA+C,kBAAkB,CAC/D,UAAU,CACX,SAAS,CACX,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare const listIncidents: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
5
+ }>, {
6
+ status: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, false>;
7
+ severity: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, false>;
8
+ applicationName: import("@activepieces/pieces-framework").ArrayProperty<false>;
9
+ subsystemName: import("@activepieces/pieces-framework").ArrayProperty<false>;
10
+ pageSize: import("@activepieces/pieces-framework").NumberProperty<false>;
11
+ }>;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listIncidents = 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 auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ exports.listIncidents = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.coralogixAuth,
11
+ name: 'listIncidents',
12
+ displayName: 'List Incidents',
13
+ description: 'Retrieve a filtered list of Coralogix incidents.',
14
+ requireAuth: true,
15
+ props: {
16
+ status: pieces_framework_1.Property.StaticMultiSelectDropdown({
17
+ displayName: 'Status',
18
+ description: 'Filter by incident status. Leave empty to return all.',
19
+ required: false,
20
+ options: {
21
+ options: [
22
+ { label: 'Triggered', value: 'INCIDENT_STATUS_TRIGGERED' },
23
+ { label: 'Acknowledged', value: 'INCIDENT_STATUS_ACKNOWLEDGED' },
24
+ { label: 'Resolved', value: 'INCIDENT_STATUS_RESOLVED' },
25
+ ],
26
+ },
27
+ }),
28
+ severity: pieces_framework_1.Property.StaticMultiSelectDropdown({
29
+ displayName: 'Severity',
30
+ description: 'Filter by incident severity. Leave empty to return all.',
31
+ required: false,
32
+ options: {
33
+ options: [
34
+ { label: 'Critical', value: 'INCIDENT_SEVERITY_CRITICAL' },
35
+ { label: 'Error', value: 'INCIDENT_SEVERITY_ERROR' },
36
+ { label: 'Warning', value: 'INCIDENT_SEVERITY_WARNING' },
37
+ { label: 'Info', value: 'INCIDENT_SEVERITY_INFO' },
38
+ { label: 'Low', value: 'INCIDENT_SEVERITY_LOW' },
39
+ ],
40
+ },
41
+ }),
42
+ applicationName: pieces_framework_1.Property.Array({
43
+ displayName: 'Application Names',
44
+ description: 'Filter by application name(s). Leave empty to return all.',
45
+ required: false,
46
+ defaultValue: [],
47
+ }),
48
+ subsystemName: pieces_framework_1.Property.Array({
49
+ displayName: 'Subsystem Names',
50
+ description: 'Filter by subsystem name(s). Leave empty to return all.',
51
+ required: false,
52
+ defaultValue: [],
53
+ }),
54
+ pageSize: pieces_framework_1.Property.Number({
55
+ displayName: 'Page Size',
56
+ description: 'Maximum number of incidents to return.',
57
+ required: false,
58
+ defaultValue: 20,
59
+ }),
60
+ },
61
+ run(_a) {
62
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
63
+ const { status, severity, applicationName, subsystemName, pageSize } = propsValue;
64
+ const params = [];
65
+ if (status && status.length > 0) {
66
+ status.forEach((s) => params.push(`filter.status=${encodeURIComponent(s)}`));
67
+ }
68
+ if (severity && severity.length > 0) {
69
+ severity.forEach((s) => params.push(`filter.severity=${encodeURIComponent(s)}`));
70
+ }
71
+ if (applicationName && applicationName.length > 0) {
72
+ applicationName.forEach((a) => params.push(`filter.applicationName=${encodeURIComponent(a)}`));
73
+ }
74
+ if (subsystemName && subsystemName.length > 0) {
75
+ subsystemName.forEach((s) => params.push(`filter.subsystemName=${encodeURIComponent(s)}`));
76
+ }
77
+ params.push(`pagination.pageSize=${pageSize !== null && pageSize !== void 0 ? pageSize : 20}`);
78
+ const queryString = params.join('&');
79
+ return yield (0, client_1.makeRequest)(auth, 'management', pieces_common_1.HttpMethod.POST, `/mgmt/openapi/latest/incidents/incidents/v1?${queryString}`);
80
+ });
81
+ },
82
+ });
83
+ //# sourceMappingURL=list-incidents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-incidents.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-incidents.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ export declare const resolveIncidents: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
5
+ }>, {
6
+ incidentIds: import("@activepieces/pieces-framework").ArrayProperty<true>;
7
+ }>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveIncidents = 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 auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ exports.resolveIncidents = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.coralogixAuth,
11
+ name: 'resolveIncidents',
12
+ displayName: 'Resolve Incidents',
13
+ description: 'Mark one or more Coralogix incidents as resolved.',
14
+ requireAuth: true,
15
+ props: {
16
+ incidentIds: pieces_framework_1.Property.Array({
17
+ displayName: 'Incident IDs',
18
+ description: 'List of incident IDs to resolve. Find the ID in Coralogix → Alerts → Incidents → click an incident → copy the ID from the URL.',
19
+ required: true,
20
+ defaultValue: [],
21
+ }),
22
+ },
23
+ run(_a) {
24
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
25
+ var _b;
26
+ const incidentIds = ((_b = propsValue.incidentIds) !== null && _b !== void 0 ? _b : []);
27
+ const queryString = incidentIds
28
+ .map((id) => `incident_ids=${encodeURIComponent(id)}`)
29
+ .join('&');
30
+ return yield (0, client_1.makeRequest)(auth, 'management', pieces_common_1.HttpMethod.POST, `/mgmt/openapi/latest/incidents/incidents/v1/resolve?${queryString}`);
31
+ });
32
+ },
33
+ });
34
+ //# sourceMappingURL=resolve-incidents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-incidents.js","sourceRoot":"","sources":["../../../../src/lib/actions/resolve-incidents.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,yCAA+C;AAC/C,6CAA+C;AAElC,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,mDAAmD;IAChE,WAAW,EAAE,IAAI;IACjB,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,KAAK,CAAC;YAC1B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,gIAAgI;YAC7I,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,EAAE;SACjB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,MAAM,WAAW,GAAG,CAAC,MAAA,UAAU,CAAC,WAAW,mCAAI,EAAE,CAAa,CAAC;YAE/D,MAAM,WAAW,GAAG,WAAW;iBAC5B,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC;iBACrD,IAAI,CAAC,GAAG,CAAC,CAAC;YAEb,OAAO,MAAM,IAAA,oBAAW,EACtB,IAAI,EACJ,YAAY,EACZ,0BAAU,CAAC,IAAI,EACf,uDAAuD,WAAW,EAAE,CACrE,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ export declare const sendLogs: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
5
+ }>, {
6
+ text: import("@activepieces/pieces-framework").LongTextProperty<true>;
7
+ applicationName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
+ subsystemName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
+ severity: import("@activepieces/pieces-framework").StaticDropdownProperty<number, false>;
10
+ category: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ className: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
+ computerName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
+ methodName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
+ threadId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
15
+ timestamp: import("@activepieces/pieces-framework").NumberProperty<false>;
16
+ hiResTimestamp: import("@activepieces/pieces-framework").ShortTextProperty<false>;
17
+ }>;
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendLogs = 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 auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ exports.sendLogs = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.coralogixAuth,
11
+ name: 'sendLogs',
12
+ displayName: 'Send Logs',
13
+ description: 'Send a single log to Coralogix Log Ingestion API.',
14
+ requireAuth: true,
15
+ props: {
16
+ text: pieces_framework_1.Property.LongText({
17
+ displayName: 'Log Message',
18
+ description: 'The log message text or a JSON string.',
19
+ required: true,
20
+ }),
21
+ applicationName: pieces_framework_1.Property.ShortText({
22
+ displayName: 'Application Name',
23
+ description: 'The application name for this log.',
24
+ required: true,
25
+ defaultValue: 'my-app',
26
+ }),
27
+ subsystemName: pieces_framework_1.Property.ShortText({
28
+ displayName: 'Subsystem Name',
29
+ description: 'The subsystem name for this log.',
30
+ required: true,
31
+ defaultValue: 'auth-service',
32
+ }),
33
+ severity: pieces_framework_1.Property.StaticDropdown({
34
+ displayName: 'Severity',
35
+ required: false,
36
+ options: {
37
+ options: [
38
+ { label: 'Debug (1)', value: 1 },
39
+ { label: 'Verbose (2)', value: 2 },
40
+ { label: 'Info (3)', value: 3 },
41
+ { label: 'Warn (4)', value: 4 },
42
+ { label: 'Error (5)', value: 5 },
43
+ { label: 'Critical (6)', value: 6 },
44
+ ],
45
+ },
46
+ }),
47
+ category: pieces_framework_1.Property.ShortText({
48
+ displayName: 'Category',
49
+ required: false,
50
+ }),
51
+ className: pieces_framework_1.Property.ShortText({
52
+ displayName: 'Class Name',
53
+ required: false,
54
+ }),
55
+ computerName: pieces_framework_1.Property.ShortText({
56
+ displayName: 'Computer Name',
57
+ required: false,
58
+ }),
59
+ methodName: pieces_framework_1.Property.ShortText({
60
+ displayName: 'Method Name',
61
+ required: false,
62
+ }),
63
+ threadId: pieces_framework_1.Property.ShortText({
64
+ displayName: 'Thread ID',
65
+ required: false,
66
+ }),
67
+ timestamp: pieces_framework_1.Property.Number({
68
+ displayName: 'Timestamp',
69
+ description: 'UTC milliseconds since 1970. Leave empty to use ingestion time.',
70
+ required: false,
71
+ }),
72
+ hiResTimestamp: pieces_framework_1.Property.ShortText({
73
+ displayName: 'High Resolution Timestamp',
74
+ description: 'UTC nanoseconds since 1970 as a string. Optional alternative to timestamp.',
75
+ required: false,
76
+ }),
77
+ },
78
+ run(_a) {
79
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
80
+ const { text, applicationName, subsystemName, severity, category, className, computerName, methodName, threadId, timestamp, hiResTimestamp, } = propsValue;
81
+ const logRecord = {
82
+ applicationName,
83
+ subsystemName,
84
+ };
85
+ logRecord['text'] = text;
86
+ if (severity !== undefined && severity !== null)
87
+ logRecord['severity'] = Number(severity);
88
+ if (category)
89
+ logRecord['category'] = category;
90
+ if (className)
91
+ logRecord['className'] = className;
92
+ if (computerName)
93
+ logRecord['computerName'] = computerName;
94
+ if (methodName)
95
+ logRecord['methodName'] = methodName;
96
+ if (threadId)
97
+ logRecord['threadId'] = threadId;
98
+ if (timestamp !== undefined)
99
+ logRecord['timestamp'] = timestamp;
100
+ if (hiResTimestamp)
101
+ logRecord['hiResTimestamp'] = hiResTimestamp;
102
+ const response = yield (0, client_1.makeRequest)(auth, 'ingestion', pieces_common_1.HttpMethod.POST, `/logs/v1/singles`, [logRecord]);
103
+ return {
104
+ success: true,
105
+ sent: 1,
106
+ response,
107
+ };
108
+ });
109
+ },
110
+ });
111
+ //# sourceMappingURL=send-logs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-logs.js","sourceRoot":"","sources":["../../../../src/lib/actions/send-logs.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,8 @@
1
+ export declare const setAlertActive: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
5
+ }>, {
6
+ alertId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ active: import("@activepieces/pieces-framework").CheckboxProperty<true>;
8
+ }>;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setAlertActive = 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 auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ exports.setAlertActive = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.coralogixAuth,
11
+ name: 'setAlertActive',
12
+ displayName: 'Enable / Disable Alert',
13
+ description: 'Enable or disable a Coralogix alert definition. Use this to mute alerts during maintenance windows.',
14
+ requireAuth: true,
15
+ props: {
16
+ alertId: pieces_framework_1.Property.ShortText({
17
+ displayName: 'Alert ID',
18
+ description: 'The ID of the alert to enable or disable. Use the "List Alert Definitions" action to find IDs.',
19
+ required: true,
20
+ }),
21
+ active: pieces_framework_1.Property.Checkbox({
22
+ displayName: 'Enable Alert',
23
+ description: 'Turn ON to enable the alert, turn OFF to disable it.',
24
+ required: true,
25
+ defaultValue: true,
26
+ }),
27
+ },
28
+ run(_a) {
29
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
30
+ const { alertId, active } = propsValue;
31
+ return yield (0, client_1.makeRequest)(auth, 'management', pieces_common_1.HttpMethod.POST, `/mgmt/openapi/latest/alerts/alerts-general/v3/${encodeURIComponent(alertId)}:setActive?active=${active}`);
32
+ });
33
+ },
34
+ });
35
+ //# sourceMappingURL=set-alert-active.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-alert-active.js","sourceRoot":"","sources":["../../../../src/lib/actions/set-alert-active.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,yCAA+C;AAC/C,6CAA+C;AAElC,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,wBAAwB;IACrC,WAAW,EACT,qGAAqG;IACvG,WAAW,EAAE,IAAI;IACjB,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,UAAU;YACvB,WAAW,EACT,gGAAgG;YAClG,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACxB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,sDAAsD;YACnE,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,IAAI;SACnB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;YAEvC,OAAO,MAAM,IAAA,oBAAW,EACtB,IAAI,EACJ,YAAY,EACZ,0BAAU,CAAC,IAAI,EACf,iDAAiD,kBAAkB,CAAC,OAAO,CAAC,qBAAqB,MAAM,EAAE,CAC1G,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const coralogixAuth: import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
5
+ }>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.coralogixAuth = void 0;
4
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
5
+ exports.coralogixAuth = pieces_framework_1.PieceAuth.CustomAuth({
6
+ displayName: 'Coralogix Credentials',
7
+ description: 'Management API uses api.coralogix.com. Select ingestion region domain and provide both API keys.',
8
+ required: true,
9
+ props: {
10
+ personalOrTeamApiKey: pieces_framework_1.PieceAuth.SecretText({
11
+ displayName: 'Personal/Team API Key',
12
+ description: 'Used for Coralogix management APIs (for example alert definitions, incidents, dashboards).',
13
+ required: true,
14
+ }),
15
+ sendYourDataApiKey: pieces_framework_1.PieceAuth.SecretText({
16
+ displayName: 'Send-Your-Data API Key',
17
+ description: 'Used for Coralogix ingestion APIs (for example /logs/v1/singles). Find it in Settings → API Keys → Send Your Data.',
18
+ required: false,
19
+ }),
20
+ coralogixDomain: pieces_framework_1.Property.StaticDropdown({
21
+ displayName: 'Ingestion Region Domain',
22
+ description: 'Select your Coralogix regional domain for ingestion endpoints.',
23
+ required: true,
24
+ defaultValue: 'eu1.coralogix.com',
25
+ options: {
26
+ options: [
27
+ { label: 'EU1 (eu1.coralogix.com)', value: 'eu1.coralogix.com' },
28
+ { label: 'EU2 (eu2.coralogix.com)', value: 'eu2.coralogix.com' },
29
+ { label: 'US1 (us1.coralogix.com)', value: 'us1.coralogix.com' },
30
+ { label: 'US2 (us2.coralogix.com)', value: 'us2.coralogix.com' },
31
+ { label: 'AP1 (ap1.coralogix.com)', value: 'ap1.coralogix.com' },
32
+ { label: 'AP2 (ap2.coralogix.com)', value: 'ap2.coralogix.com' },
33
+ { label: 'AP3 (ap3.coralogix.com)', value: 'ap3.coralogix.com' },
34
+ ],
35
+ },
36
+ }),
37
+ },
38
+ });
39
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../src/lib/common/auth.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AAExD,QAAA,aAAa,GAAG,4BAAS,CAAC,UAAU,CAAC;IAChD,WAAW,EAAE,uBAAuB;IACpC,WAAW,EACT,kGAAkG;IACpG,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,oBAAoB,EAAE,4BAAS,CAAC,UAAU,CAAC;YACzC,WAAW,EAAE,uBAAuB;YACpC,WAAW,EACT,4FAA4F;YAC9F,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,kBAAkB,EAAE,4BAAS,CAAC,UAAU,CAAC;YACvC,WAAW,EAAE,wBAAwB;YACrC,WAAW,EACT,oHAAoH;YACtH,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,cAAc,CAAC;YACvC,WAAW,EAAE,yBAAyB;YACtC,WAAW,EACT,gEAAgE;YAClE,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,mBAAmB;YACjC,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,mBAAmB,EAAE;oBAChE,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,mBAAmB,EAAE;oBAChE,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,mBAAmB,EAAE;oBAChE,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,mBAAmB,EAAE;oBAChE,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,mBAAmB,EAAE;oBAChE,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,mBAAmB,EAAE;oBAChE,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,mBAAmB,EAAE;iBACjE;aACF;SACF,CAAC;KACH;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { HttpMethod, QueryParams } from '@activepieces/pieces-common';
2
+ import { coralogixAuth } from './auth';
3
+ import { AppConnectionValueForAuthProperty } from '@activepieces/pieces-framework';
4
+ type CoralogixApiType = 'management' | 'ingestion';
5
+ export declare const MANAGEMENT_DOMAIN: Record<string, string>;
6
+ export declare function makeRequest(auth: AppConnectionValueForAuthProperty<typeof coralogixAuth>, apiType: CoralogixApiType, method: HttpMethod, path: string, body?: unknown, queryParams?: QueryParams): Promise<any>;
7
+ export {};
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MANAGEMENT_DOMAIN = void 0;
4
+ exports.makeRequest = makeRequest;
5
+ const tslib_1 = require("tslib");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ exports.MANAGEMENT_DOMAIN = {
8
+ 'eu1.coralogix.com': 'api.coralogix.com',
9
+ 'eu2.coralogix.com': 'api.eu2.coralogix.com',
10
+ 'us1.coralogix.com': 'api.coralogix.us',
11
+ 'us2.coralogix.com': 'api.cx498.coralogix.com',
12
+ 'ap1.coralogix.com': 'api.coralogix.in',
13
+ 'ap2.coralogix.com': 'api.coralogixsg.com',
14
+ 'ap3.coralogix.com': 'api.ap3.coralogix.com',
15
+ };
16
+ function makeRequest(auth, apiType, method, path, body, queryParams) {
17
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
18
+ var _a;
19
+ const coralogixDomain = auth.props.coralogixDomain;
20
+ const domain = apiType === 'management'
21
+ ? (_a = exports.MANAGEMENT_DOMAIN[coralogixDomain]) !== null && _a !== void 0 ? _a : 'api.coralogix.com'
22
+ : `ingress.${coralogixDomain}`;
23
+ const apiKey = apiType === 'management'
24
+ ? auth.props.personalOrTeamApiKey
25
+ : auth.props.sendYourDataApiKey;
26
+ const response = yield pieces_common_1.httpClient.sendRequest({
27
+ method,
28
+ url: `https://${domain}${path}`,
29
+ headers: {
30
+ Authorization: `Bearer ${apiKey}`,
31
+ 'Content-Type': 'application/json',
32
+ },
33
+ queryParams,
34
+ body,
35
+ });
36
+ return response.body;
37
+ });
38
+ }
39
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/lib/common/client.ts"],"names":[],"mappings":";;;AAoBA,kCA6BC;;AAjDD,+DAIqC;AAMxB,QAAA,iBAAiB,GAA2B;IACvD,mBAAmB,EAAE,mBAAmB;IACxC,mBAAmB,EAAE,uBAAuB;IAC5C,mBAAmB,EAAE,kBAAkB;IACvC,mBAAmB,EAAE,yBAAyB;IAC9C,mBAAmB,EAAE,kBAAkB;IACvC,mBAAmB,EAAE,qBAAqB;IAC1C,mBAAmB,EAAE,uBAAuB;CAC7C,CAAC;AAEF,SAAsB,WAAW,CAC/B,IAA6D,EAC7D,OAAyB,EACzB,MAAkB,EAClB,IAAY,EACZ,IAAc,EACd,WAAyB;;;QAEzB,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;QACnD,MAAM,MAAM,GACV,OAAO,KAAK,YAAY;YACtB,CAAC,CAAC,MAAA,yBAAiB,CAAC,eAAe,CAAC,mCAAI,mBAAmB;YAC3D,CAAC,CAAC,WAAW,eAAe,EAAE,CAAC;QACnC,MAAM,MAAM,GACV,OAAO,KAAK,YAAY;YACtB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB;YACjC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;QACpC,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;YAC5C,MAAM;YACN,GAAG,EAAE,WAAW,MAAM,GAAG,IAAI,EAAE;YAC/B,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,MAAM,EAAE;gBACjC,cAAc,EAAE,kBAAkB;aACnC;YACD,WAAW;YACX,IAAI;SACL,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CAAA"}
@@ -0,0 +1,26 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const newAlertEvent: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
5
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
6
+ }>, {
7
+ setupInstructions: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
8
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
9
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
10
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
11
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
12
+ }>, {
13
+ setupInstructions: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
14
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
15
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
16
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
17
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
18
+ }>, {
19
+ setupInstructions: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
20
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
21
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
22
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
23
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
24
+ }>, {
25
+ setupInstructions: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
26
+ }>;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.newAlertEvent = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../common/auth");
7
+ exports.newAlertEvent = (0, pieces_framework_1.createTrigger)({
8
+ auth: auth_1.coralogixAuth,
9
+ name: 'newAlertEvent',
10
+ displayName: 'New Alert Event',
11
+ description: 'Triggers when Coralogix sends an alert-event webhook payload to this flow.',
12
+ props: {
13
+ setupInstructions: pieces_framework_1.Property.MarkDown({
14
+ value: `
15
+ ### Webhook setup in Coralogix
16
+
17
+ 1. In Coralogix, go to **Alerts** and open the alert definition you want.
18
+ 2. Open **Outbound Webhooks** and click **Add webhook**.
19
+ 3. Select **Generic webhook**.
20
+ 4. In **Webhook URL**, paste: \`{{webhookUrl}}\`
21
+ 5. Keep method as **POST** and content type as **application/json**.
22
+ 6. Save the webhook, then trigger a test alert to verify events are received.
23
+ `,
24
+ }),
25
+ },
26
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
27
+ sampleData: {
28
+ value: '0',
29
+ source: 'S3',
30
+ schema: 'nginx',
31
+ metric: '',
32
+ log: '',
33
+ correlationId: '',
34
+ category: 'Security',
35
+ applicationName: 'Critical app',
36
+ subsystemName: 'payments',
37
+ incidentIdentifier: 'abc123',
38
+ alertDescription: 'check this out',
39
+ timestamp: 1713175564848,
40
+ tenantUrl: 'https://api.coralogix.com',
41
+ fields: [
42
+ {
43
+ key: 'coralogix.metadata.timestamp',
44
+ value: ['2024-04-15T07:26:04.848Z'],
45
+ },
46
+ {
47
+ key: 'coralogix.metadata.severity',
48
+ value: [3],
49
+ },
50
+ {
51
+ key: 'ip',
52
+ value: ['::1'],
53
+ },
54
+ {
55
+ key: 'log',
56
+ value: [
57
+ '127.0.0.1 - - [17/May/2015:08:05:12 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.64.1"',
58
+ ],
59
+ },
60
+ {
61
+ key: 'message',
62
+ value: ['test'],
63
+ },
64
+ {
65
+ key: 'metric',
66
+ value: [''],
67
+ },
68
+ {
69
+ key: 'region',
70
+ value: ['us-central1'],
71
+ },
72
+ {
73
+ key: 'source',
74
+ value: ['S3'],
75
+ },
76
+ ],
77
+ },
78
+ onEnable() {
79
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
80
+ // Coralogix outbound webhook is configured from Coralogix UI/API.
81
+ });
82
+ },
83
+ onDisable() {
84
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
85
+ // Coralogix outbound webhook is configured from Coralogix UI/API.
86
+ });
87
+ },
88
+ run(context) {
89
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
90
+ const body = context.payload.body;
91
+ return [body !== null && body !== void 0 ? body : context.payload];
92
+ });
93
+ },
94
+ });
95
+ //# sourceMappingURL=new-alert-event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-alert-event.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-alert-event.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,yCAA+C;AAElC,QAAA,aAAa,GAAG,IAAA,gCAAa,EAAC;IACzC,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EACT,4EAA4E;IAC9E,KAAK,EAAE;QACL,iBAAiB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACnC,KAAK,EAAE;;;;;;;;;OASN;SACF,CAAC;KACH;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,UAAU,EAAE;QACV,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,OAAO;QACf,MAAM,EAAE,EAAE;QACV,GAAG,EAAE,EAAE;QACP,aAAa,EAAE,EAAE;QACjB,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,cAAc;QAC/B,aAAa,EAAE,UAAU;QACzB,kBAAkB,EAAE,QAAQ;QAC5B,gBAAgB,EAAE,gBAAgB;QAClC,SAAS,EAAE,aAAa;QACxB,SAAS,EAAE,2BAA2B;QACtC,MAAM,EAAE;YACN;gBACE,GAAG,EAAE,8BAA8B;gBACnC,KAAK,EAAE,CAAC,0BAA0B,CAAC;aACpC;YACD;gBACE,GAAG,EAAE,6BAA6B;gBAClC,KAAK,EAAE,CAAC,CAAC,CAAC;aACX;YACD;gBACE,GAAG,EAAE,IAAI;gBACT,KAAK,EAAE,CAAC,KAAK,CAAC;aACf;YACD;gBACE,GAAG,EAAE,KAAK;gBACV,KAAK,EAAE;oBACL,uFAAuF;iBACxF;aACF;YACD;gBACE,GAAG,EAAE,SAAS;gBACd,KAAK,EAAE,CAAC,MAAM,CAAC;aAChB;YACD;gBACE,GAAG,EAAE,QAAQ;gBACb,KAAK,EAAE,CAAC,EAAE,CAAC;aACZ;YACD;gBACE,GAAG,EAAE,QAAQ;gBACb,KAAK,EAAE,CAAC,aAAa,CAAC;aACvB;YACD;gBACE,GAAG,EAAE,QAAQ;gBACb,KAAK,EAAE,CAAC,IAAI,CAAC;aACd;SACF;KACF;IACK,QAAQ;;YACZ,kEAAkE;QACpE,CAAC;KAAA;IACK,SAAS;;YACb,kEAAkE;QACpE,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;YAElC,OAAO,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,OAAO,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const newIncident: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
5
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
6
+ }>, {
7
+ severity: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, false>;
8
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
9
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
10
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
11
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
12
+ }>, {
13
+ severity: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, false>;
14
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
15
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
16
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
17
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
18
+ }>, {
19
+ severity: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, false>;
20
+ }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
21
+ personalOrTeamApiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
22
+ sendYourDataApiKey: import("@activepieces/pieces-framework").SecretTextProperty<false>;
23
+ coralogixDomain: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
24
+ }>, {
25
+ severity: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, false>;
26
+ }>;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.newIncident = 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 auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ const STORE_KEY = 'coralogix_seen_incident_ids';
10
+ exports.newIncident = (0, pieces_framework_1.createTrigger)({
11
+ auth: auth_1.coralogixAuth,
12
+ name: 'newIncident',
13
+ displayName: 'New Incident',
14
+ description: 'Triggers when a new incident appears in Coralogix. Polls on a schedule — ideal for paging on-call, creating Jira tickets, or posting to Slack.',
15
+ type: pieces_framework_1.TriggerStrategy.POLLING,
16
+ props: {
17
+ severity: pieces_framework_1.Property.StaticMultiSelectDropdown({
18
+ displayName: 'Severity Filter',
19
+ description: 'Only trigger for incidents with these severities. Leave empty for all.',
20
+ required: false,
21
+ options: {
22
+ options: [
23
+ { label: 'Critical', value: 'INCIDENT_SEVERITY_CRITICAL' },
24
+ { label: 'Error', value: 'INCIDENT_SEVERITY_ERROR' },
25
+ { label: 'Warning', value: 'INCIDENT_SEVERITY_WARNING' },
26
+ { label: 'Info', value: 'INCIDENT_SEVERITY_INFO' },
27
+ { label: 'Low', value: 'INCIDENT_SEVERITY_LOW' },
28
+ ],
29
+ },
30
+ }),
31
+ },
32
+ sampleData: {
33
+ id: 'incident-abc-123',
34
+ name: 'High error rate detected',
35
+ status: 'INCIDENT_STATUS_TRIGGERED',
36
+ severity: 'INCIDENT_SEVERITY_CRITICAL',
37
+ createdAt: '2024-04-15T07:26:04.848Z',
38
+ applicationName: ['my-app'],
39
+ subsystemName: ['payments'],
40
+ },
41
+ onEnable(context) {
42
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
43
+ var _a;
44
+ const response = (yield (0, client_1.makeRequest)(context.auth, 'management', pieces_common_1.HttpMethod.POST, '/mgmt/openapi/latest/incidents/incidents/v1?filter.status=INCIDENT_STATUS_TRIGGERED&pagination.pageSize=100'));
45
+ const ids = ((_a = response.incidents) !== null && _a !== void 0 ? _a : []).map((i) => i.id);
46
+ yield context.store.put(STORE_KEY, ids);
47
+ });
48
+ },
49
+ onDisable() {
50
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
51
+ // nothing to clean up
52
+ });
53
+ },
54
+ run(context) {
55
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
56
+ var _a, _b;
57
+ const seenIds = (_a = (yield context.store.get(STORE_KEY))) !== null && _a !== void 0 ? _a : [];
58
+ const severityFilter = context.propsValue.severity;
59
+ const params = [
60
+ 'filter.status=INCIDENT_STATUS_TRIGGERED',
61
+ 'pagination.pageSize=100',
62
+ ];
63
+ if (severityFilter && severityFilter.length > 0) {
64
+ severityFilter.forEach((s) => params.push(`filter.severity=${encodeURIComponent(s)}`));
65
+ }
66
+ const queryString = params.join('&');
67
+ const response = (yield (0, client_1.makeRequest)(context.auth, 'management', pieces_common_1.HttpMethod.POST, `/mgmt/openapi/latest/incidents/incidents/v1?${queryString}`));
68
+ const incidents = (_b = response.incidents) !== null && _b !== void 0 ? _b : [];
69
+ const newIncidents = incidents.filter((i) => !seenIds.includes(i.id));
70
+ const allIds = incidents.map((i) => i.id);
71
+ // merge: keep old seen IDs + new ones so we don't re-trigger if severity filter changes
72
+ const mergedIds = Array.from(new Set([...seenIds, ...allIds]));
73
+ yield context.store.put(STORE_KEY, mergedIds);
74
+ return newIncidents;
75
+ });
76
+ },
77
+ });
78
+ //# sourceMappingURL=new-incident.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-incident.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-incident.ts"],"names":[],"mappings":"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"}