@taskmagic/apps-uptimerobot 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 ADDED
@@ -0,0 +1,7 @@
1
+ # apps-uptimerobot
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build apps-uptimerobot` to build the library.
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@taskmagic/apps-uptimerobot",
3
+ "version": "0.0.1",
4
+ "dependencies": {
5
+ "@anthropic-ai/sdk": "0.33.1",
6
+ "@sinclair/typebox": "0.34.11",
7
+ "axios": "1.17.0",
8
+ "axios-retry": "4.4.1",
9
+ "deepmerge-ts": "7.1.0",
10
+ "mime-types": "2.1.35",
11
+ "nanoid": "3.3.8",
12
+ "openai": "4.67.1",
13
+ "replicate": "0.34.1",
14
+ "semver": "7.6.0",
15
+ "zod": "3.25.76",
16
+ "@taskmagic/pieces-common": "0.4.4",
17
+ "@taskmagic/pieces-framework": "0.7.46",
18
+ "@taskmagic/shared": "0.10.171",
19
+ "tslib": "1.14.1"
20
+ },
21
+ "overrides": {
22
+ "cross-spawn": "7.0.6",
23
+ "elliptic": "^6.6.1",
24
+ "fast-xml-parser": "^4.4.1",
25
+ "protobufjs": "^7.5.5",
26
+ "tmp": "^0.2.4",
27
+ "koa": "^2.16.4",
28
+ "picomatch": "^4.0.4",
29
+ "langsmith": "^0.6.0",
30
+ "serialize-javascript": "^6.0.2",
31
+ "elevenlabs": {
32
+ "form-data": "^4.0.4"
33
+ },
34
+ "@tryfabric/martian": {
35
+ "@notionhq/client": "$@notionhq/client"
36
+ },
37
+ "vite": {
38
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
39
+ }
40
+ },
41
+ "resolutions": {
42
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
43
+ },
44
+ "types": "./src/index.d.ts",
45
+ "main": "./src/index.js",
46
+ "type": "commonjs"
47
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const uptimeRobot: import("@taskmagic/pieces-framework").Piece<import("@taskmagic/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uptimeRobot = void 0;
4
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
5
+ const shared_1 = require("@taskmagic/shared");
6
+ const auth_1 = require("./lib/auth");
7
+ const get_monitors_1 = require("./lib/actions/get-monitors");
8
+ const create_monitor_1 = require("./lib/actions/create-monitor");
9
+ const edit_monitor_1 = require("./lib/actions/edit-monitor");
10
+ const delete_monitor_1 = require("./lib/actions/delete-monitor");
11
+ const pause_resume_monitor_1 = require("./lib/actions/pause-resume-monitor");
12
+ exports.uptimeRobot = (0, pieces_framework_1.createPiece)({
13
+ displayName: 'UptimeRobot',
14
+ description: 'Monitor your websites, APIs, and servers. Get alerted when things go down.',
15
+ minimumSupportedRelease: '0.30.0',
16
+ logoUrl: 'https://cdn.activepieces.com/pieces/uptimerobot.png',
17
+ categories: [shared_1.PieceCategory.DEVELOPER_TOOLS],
18
+ auth: auth_1.uptimeRobotAuth,
19
+ authors: ['majewskibartosz'],
20
+ actions: [
21
+ get_monitors_1.getMonitorsAction,
22
+ create_monitor_1.createMonitorAction,
23
+ edit_monitor_1.editMonitorAction,
24
+ delete_monitor_1.deleteMonitorAction,
25
+ pause_resume_monitor_1.pauseResumeMonitorAction,
26
+ ],
27
+ triggers: [],
28
+ });
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/uptimerobot/src/index.ts"],"names":[],"mappings":";;;AAAA,kEAA0D;AAC1D,8CAAkD;AAClD,qCAA6C;AAC7C,6DAA+D;AAC/D,iEAAmE;AACnE,6DAA+D;AAC/D,iEAAmE;AACnE,6EAA8E;AAEjE,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC;IACrC,WAAW,EAAE,aAAa;IAC1B,WAAW,EACT,4EAA4E;IAC9E,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,qDAAqD;IAC9D,UAAU,EAAE,CAAC,sBAAa,CAAC,eAAe,CAAC;IAC3C,IAAI,EAAE,sBAAe;IACrB,OAAO,EAAE,CAAC,iBAAiB,CAAC;IAC5B,OAAO,EAAE;QACP,gCAAiB;QACjB,oCAAmB;QACnB,gCAAiB;QACjB,oCAAmB;QACnB,+CAAwB;KACzB;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const createMonitorAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ friendly_name: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
3
+ url: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
4
+ interval: import("@taskmagic/pieces-framework").NumberProperty<false>;
5
+ }>;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createMonitorAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const common_1 = require("../common");
7
+ const auth_1 = require("../auth");
8
+ exports.createMonitorAction = (0, pieces_framework_1.createAction)({
9
+ auth: auth_1.uptimeRobotAuth,
10
+ name: 'create_monitor',
11
+ displayName: 'Create HTTP Monitor',
12
+ description: 'Create a new HTTP uptime monitor in UptimeRobot',
13
+ props: {
14
+ friendly_name: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Monitor Name',
16
+ description: "A name for this monitor (e.g. 'Company Website' or 'API Server')",
17
+ required: true,
18
+ }),
19
+ url: pieces_framework_1.Property.ShortText({
20
+ displayName: 'URL',
21
+ description: "The full URL to monitor, including the protocol (e.g. 'https://example.com').",
22
+ required: true,
23
+ }),
24
+ interval: pieces_framework_1.Property.Number({
25
+ displayName: 'Check Interval (seconds)',
26
+ description: 'How often UptimeRobot checks this URL, in seconds. Minimum 300s (5 min) on the Free plan, 60s on Solo/Team, 30s on Enterprise.',
27
+ required: false,
28
+ defaultValue: 300,
29
+ }),
30
+ },
31
+ run(context) {
32
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
33
+ const { friendly_name, url, interval } = context.propsValue;
34
+ const body = { friendly_name, url, type: 1 };
35
+ if (interval !== undefined && interval !== null)
36
+ body['interval'] = interval;
37
+ const created = yield common_1.uptimeRobotCommon.apiCall({
38
+ apiKey: context.auth,
39
+ endpoint: 'newMonitor',
40
+ body,
41
+ });
42
+ const flat = yield common_1.uptimeRobotCommon.fetchFlatMonitorById({
43
+ apiKey: context.auth,
44
+ id: created.monitor.id,
45
+ });
46
+ if (!flat) {
47
+ throw new Error('Monitor was created but could not be retrieved.');
48
+ }
49
+ return flat;
50
+ });
51
+ },
52
+ });
53
+ //# sourceMappingURL=create-monitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-monitor.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/uptimerobot/src/lib/actions/create-monitor.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,sCAA6E;AAC7E,kCAA0C;AAE7B,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,iDAAiD;IAC9D,KAAK,EAAE;QACL,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,kEAAkE;YAC/E,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,KAAK;YAClB,WAAW,EACT,+EAA+E;YACjF,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACxB,WAAW,EAAE,0BAA0B;YACvC,WAAW,EACT,gIAAgI;YAClI,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,GAAG;SAClB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE5D,MAAM,IAAI,GAA4B,EAAE,aAAa,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;YACtE,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI;gBAAE,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC;YAE7E,MAAM,OAAO,GAAG,MAAM,0BAAiB,CAAC,OAAO,CAAgC;gBAC7E,MAAM,EAAE,OAAO,CAAC,IAAc;gBAC9B,QAAQ,EAAE,YAAY;gBACtB,IAAI;aACL,CAAC,CAAC;YAEH,MAAM,IAAI,GAAG,MAAM,0BAAiB,CAAC,oBAAoB,CAAC;gBACxD,MAAM,EAAE,OAAO,CAAC,IAAc;gBAC9B,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE;aACvB,CAAC,CAAC;YACH,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;YACrE,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const deleteMonitorAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ monitor: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
3
+ monitor_id_override: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
4
+ }>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteMonitorAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const common_1 = require("../common");
7
+ const auth_1 = require("../auth");
8
+ exports.deleteMonitorAction = (0, pieces_framework_1.createAction)({
9
+ auth: auth_1.uptimeRobotAuth,
10
+ name: 'delete_monitor',
11
+ displayName: 'Delete Monitor',
12
+ description: 'Permanently delete a monitor from UptimeRobot. This cannot be undone.',
13
+ props: {
14
+ monitor: common_1.uptimeRobotCommon.monitorDropdownOptional,
15
+ monitor_id_override: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Or Enter Monitor ID',
17
+ description: 'Use this to pass a dynamic Monitor ID from a previous step. If set, this overrides the dropdown selection above.',
18
+ required: false,
19
+ }),
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ const { monitor, monitor_id_override } = context.propsValue;
24
+ const overrideId = typeof monitor_id_override === 'string' ? monitor_id_override.trim() : '';
25
+ const monitorId = overrideId.length > 0 ? overrideId : monitor;
26
+ if (!monitorId) {
27
+ throw new Error('Please select a monitor or enter a Monitor ID.');
28
+ }
29
+ yield common_1.uptimeRobotCommon.apiCall({
30
+ apiKey: context.auth,
31
+ endpoint: 'deleteMonitor',
32
+ body: { id: Number(monitorId) },
33
+ });
34
+ return { id: String(monitorId), deleted: true };
35
+ });
36
+ },
37
+ });
38
+ //# sourceMappingURL=delete-monitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-monitor.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/uptimerobot/src/lib/actions/delete-monitor.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,sCAGmB;AACnB,kCAA0C;AAE7B,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EACT,uEAAuE;IACzE,KAAK,EAAE;QACL,OAAO,EAAE,0BAAiB,CAAC,uBAAuB;QAClD,mBAAmB,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtC,WAAW,EAAE,qBAAqB;YAClC,WAAW,EACT,kHAAkH;YACpH,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC5D,MAAM,UAAU,GACd,OAAO,mBAAmB,KAAK,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5E,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;YAE/D,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;YACpE,CAAC;YACD,MAAM,0BAAiB,CAAC,OAAO,CAAmC;gBAChE,MAAM,EAAE,OAAO,CAAC,IAAc;gBAC9B,QAAQ,EAAE,eAAe;gBACzB,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,SAAS,CAAC,EAAE;aAChC,CAAC,CAAC;YACH,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAClD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const editMonitorAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ monitor: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
3
+ monitor_id_override: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
4
+ friendly_name: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
5
+ url: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
6
+ interval: import("@taskmagic/pieces-framework").NumberProperty<false>;
7
+ }>;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.editMonitorAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const common_1 = require("../common");
7
+ const auth_1 = require("../auth");
8
+ exports.editMonitorAction = (0, pieces_framework_1.createAction)({
9
+ auth: auth_1.uptimeRobotAuth,
10
+ name: 'edit_monitor',
11
+ displayName: 'Edit Monitor',
12
+ description: 'Update the settings of an existing UptimeRobot monitor',
13
+ props: {
14
+ monitor: common_1.uptimeRobotCommon.monitorDropdownOptional,
15
+ monitor_id_override: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Or Enter Monitor ID',
17
+ description: 'Use this to pass a dynamic Monitor ID from a previous step (e.g. {{create_monitor.id}}). If set, this overrides the dropdown selection above.',
18
+ required: false,
19
+ }),
20
+ friendly_name: pieces_framework_1.Property.ShortText({
21
+ displayName: 'New Monitor Name',
22
+ description: "Update the monitor's name. Leave empty to keep the current name.",
23
+ required: false,
24
+ }),
25
+ url: pieces_framework_1.Property.ShortText({
26
+ displayName: 'New URL or IP Address',
27
+ description: 'Update the URL or IP being monitored. Leave empty to keep the current value.',
28
+ required: false,
29
+ }),
30
+ interval: pieces_framework_1.Property.Number({
31
+ displayName: 'New Check Interval (seconds)',
32
+ description: 'Minimum 300s (5 min) on the Free plan, 60s on Solo/Team, 30s on Enterprise. Values below the plan minimum are rejected by UptimeRobot. Leave empty to keep the current interval.',
33
+ required: false,
34
+ }),
35
+ },
36
+ run(context) {
37
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
38
+ const { monitor, monitor_id_override, friendly_name, url, interval } = context.propsValue;
39
+ const overrideId = typeof monitor_id_override === 'string' ? monitor_id_override.trim() : '';
40
+ const monitorId = overrideId.length > 0 ? overrideId : monitor;
41
+ if (!monitorId) {
42
+ throw new Error('Please select a monitor or enter a Monitor ID.');
43
+ }
44
+ const body = { id: Number(monitorId) };
45
+ if (friendly_name)
46
+ body['friendly_name'] = friendly_name;
47
+ if (url)
48
+ body['url'] = url;
49
+ if (interval !== undefined && interval !== null)
50
+ body['interval'] = interval;
51
+ const edited = yield common_1.uptimeRobotCommon.apiCall({
52
+ apiKey: context.auth,
53
+ endpoint: 'editMonitor',
54
+ body,
55
+ });
56
+ const flat = yield common_1.uptimeRobotCommon.fetchFlatMonitorById({
57
+ apiKey: context.auth,
58
+ id: edited.monitor.id,
59
+ });
60
+ if (!flat) {
61
+ throw new Error('Monitor was updated but could not be retrieved.');
62
+ }
63
+ return flat;
64
+ });
65
+ },
66
+ });
67
+ //# sourceMappingURL=edit-monitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-monitor.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/uptimerobot/src/lib/actions/edit-monitor.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,sCAGmB;AACnB,kCAA0C;AAE7B,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,wDAAwD;IACrE,KAAK,EAAE;QACL,OAAO,EAAE,0BAAiB,CAAC,uBAAuB;QAClD,mBAAmB,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtC,WAAW,EAAE,qBAAqB;YAClC,WAAW,EACT,+IAA+I;YACjJ,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EACT,kEAAkE;YACpE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,uBAAuB;YACpC,WAAW,EACT,8EAA8E;YAChF,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,MAAM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I,EAAE,CAAC;gBACV,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;YACrE,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const getMonitorsAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ monitor_ids: import("@taskmagic/pieces-framework").MultiSelectDropdownProperty<string, false>;
3
+ monitor_ids_csv: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
4
+ type: import("@taskmagic/pieces-framework").StaticDropdownProperty<number, false>;
5
+ status: import("@taskmagic/pieces-framework").StaticDropdownProperty<number, false>;
6
+ }>;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMonitorsAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const common_1 = require("../common");
7
+ const auth_1 = require("../auth");
8
+ exports.getMonitorsAction = (0, pieces_framework_1.createAction)({
9
+ auth: auth_1.uptimeRobotAuth,
10
+ name: 'get_monitors',
11
+ displayName: 'Get Monitors',
12
+ description: 'List and search your UptimeRobot monitors with optional filters. Leave the Monitors / Monitor IDs fields empty to return all monitors.',
13
+ props: {
14
+ monitor_ids: common_1.uptimeRobotCommon.monitorMultiSelect,
15
+ monitor_ids_csv: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Or Enter Monitor IDs (comma-separated)',
17
+ description: 'Use this to pass dynamic Monitor IDs from a previous step (e.g. "123, 456"). Merged with any selections above.',
18
+ required: false,
19
+ }),
20
+ type: pieces_framework_1.Property.StaticDropdown({
21
+ displayName: 'Monitor Type',
22
+ description: 'Only HTTP monitors are supported at the moment. Other UptimeRobot types (Keyword, Ping, Port, Heartbeat) will be added in a future release. Leave empty to return monitors of all types.',
23
+ required: false,
24
+ options: {
25
+ options: [{ label: 'HTTP', value: 1 }],
26
+ },
27
+ }),
28
+ status: pieces_framework_1.Property.StaticDropdown({
29
+ displayName: 'Status',
30
+ description: 'Only return monitors with this status. Leave empty for all statuses.',
31
+ required: false,
32
+ options: {
33
+ options: [
34
+ { label: 'Up', value: 2 },
35
+ { label: 'Down', value: 9 },
36
+ { label: 'Paused', value: 0 },
37
+ { label: 'Seems down', value: 8 },
38
+ { label: 'Not checked yet', value: 1 },
39
+ ],
40
+ },
41
+ }),
42
+ },
43
+ run(context) {
44
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
45
+ const { monitor_ids, monitor_ids_csv, type, status } = context.propsValue;
46
+ const additionalBody = {
47
+ custom_uptime_ratios: '30',
48
+ response_times: 1,
49
+ };
50
+ const selectedIds = Array.isArray(monitor_ids)
51
+ ? monitor_ids.filter((v) => typeof v === 'string')
52
+ : [];
53
+ const csvIds = typeof monitor_ids_csv === 'string'
54
+ ? monitor_ids_csv
55
+ .split(',')
56
+ .map((s) => s.trim())
57
+ .filter((s) => s.length > 0)
58
+ : [];
59
+ const allIds = Array.from(new Set([...selectedIds, ...csvIds]));
60
+ if (allIds.length > 0) {
61
+ additionalBody['monitors'] = allIds.join('-');
62
+ }
63
+ if (type !== undefined && type !== null) {
64
+ additionalBody['types'] = String(type);
65
+ }
66
+ if (status !== undefined && status !== null) {
67
+ additionalBody['statuses'] = String(status);
68
+ }
69
+ const monitors = yield common_1.uptimeRobotCommon.fetchAllMonitors({
70
+ apiKey: context.auth,
71
+ additionalBody,
72
+ });
73
+ return monitors.map((monitor) => common_1.uptimeRobotCommon.flattenMonitor({ monitor }));
74
+ });
75
+ },
76
+ });
77
+ //# sourceMappingURL=get-monitors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-monitors.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/uptimerobot/src/lib/actions/get-monitors.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,sCAA8C;AAC9C,kCAA0C;AAE7B,QAAA,iBAAiB,GAAG,I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AAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAC9B,0BAAiB,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,CAAC,CAC9C,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const pauseResumeMonitorAction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ monitor: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
3
+ monitor_id_override: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
4
+ action: import("@taskmagic/pieces-framework").StaticDropdownProperty<number, true>;
5
+ }>;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pauseResumeMonitorAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const common_1 = require("../common");
7
+ const auth_1 = require("../auth");
8
+ exports.pauseResumeMonitorAction = (0, pieces_framework_1.createAction)({
9
+ auth: auth_1.uptimeRobotAuth,
10
+ name: 'pause_resume_monitor',
11
+ displayName: 'Pause or Resume Monitor',
12
+ description: 'Temporarily pause or resume monitoring for a specific monitor.',
13
+ props: {
14
+ monitor: common_1.uptimeRobotCommon.monitorDropdownOptional,
15
+ monitor_id_override: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Or Enter Monitor ID',
17
+ description: 'Use this to pass a dynamic Monitor ID from a previous step. If set, this overrides the dropdown selection above.',
18
+ required: false,
19
+ }),
20
+ action: pieces_framework_1.Property.StaticDropdown({
21
+ displayName: 'Action',
22
+ description: 'Pause stops all checks and alerts. Resume restarts monitoring.',
23
+ required: true,
24
+ options: {
25
+ options: [
26
+ { label: 'Pause', value: 0 },
27
+ { label: 'Resume', value: 1 },
28
+ ],
29
+ },
30
+ }),
31
+ },
32
+ run(context) {
33
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
34
+ const { monitor, monitor_id_override } = context.propsValue;
35
+ const overrideId = typeof monitor_id_override === 'string' ? monitor_id_override.trim() : '';
36
+ const monitorId = overrideId.length > 0 ? overrideId : monitor;
37
+ if (!monitorId) {
38
+ throw new Error('Please select a monitor or enter a Monitor ID.');
39
+ }
40
+ const newStatus = Number(context.propsValue.action);
41
+ yield common_1.uptimeRobotCommon.apiCall({
42
+ apiKey: context.auth,
43
+ endpoint: 'editMonitor',
44
+ body: { id: Number(monitorId), status: newStatus },
45
+ });
46
+ const flat = yield common_1.uptimeRobotCommon.fetchFlatMonitorById({
47
+ apiKey: context.auth,
48
+ id: monitorId,
49
+ });
50
+ if (!flat) {
51
+ throw new Error('Monitor status changed but could not be retrieved.');
52
+ }
53
+ return Object.assign(Object.assign({}, flat), { action_performed: newStatus === 0 ? 'paused' : 'resumed' });
54
+ });
55
+ },
56
+ });
57
+ //# sourceMappingURL=pause-resume-monitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pause-resume-monitor.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/uptimerobot/src/lib/actions/pause-resume-monitor.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,sCAGmB;AACnB,kCAA0C;AAE7B,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,gEAAgE;IAC7E,KAAK,EAAE;QACL,OAAO,EAAE,0BAAiB,CAAC,uBAAuB;QAClD,mBAAmB,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtC,WAAW,EAAE,qBAAqB;YAClC,WAAW,EACT,kHAAkH;YACpH,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC9B,WAAW,EAAE,QAAQ;YACrB,WAAW,EACT,gEAAgE;YAClE,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO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ACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const uptimeRobotAuth: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uptimeRobotAuth = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const form_1 = require("./common/form");
8
+ exports.uptimeRobotAuth = pieces_framework_1.PieceAuth.SecretText({
9
+ displayName: 'API Key',
10
+ description: `To get your API key:
11
+ 1. Log in to your [UptimeRobot Dashboard](https://dashboard.uptimerobot.com/)
12
+ 2. Click **Integrations & API** in the left sidebar
13
+ 3. Scroll to the **API** section
14
+ 4. Click **Show** next to your Main API Key
15
+ 5. Copy the key and paste it here
16
+
17
+ The key starts with \`u\` followed by a long string of numbers and letters.
18
+
19
+ **Note:** Free plans are limited to 10 API requests per minute. Paid plans support up to 5,000 req/min.`,
20
+ required: true,
21
+ validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
22
+ var _b, _c;
23
+ try {
24
+ const response = yield pieces_common_1.httpClient.sendRequest({
25
+ method: pieces_common_1.HttpMethod.POST,
26
+ url: 'https://api.uptimerobot.com/v2/getAccountDetails',
27
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
28
+ body: (0, form_1.toFormUrlEncoded)({ api_key: auth, format: 'json' }),
29
+ });
30
+ if (response.body.stat === 'ok') {
31
+ return { valid: true };
32
+ }
33
+ return {
34
+ valid: false,
35
+ error: (_c = (_b = response.body.error) === null || _b === void 0 ? void 0 : _b.message) !== null && _c !== void 0 ? _c : 'Invalid API key',
36
+ };
37
+ }
38
+ catch (_d) {
39
+ return {
40
+ valid: false,
41
+ error: 'Could not validate API key. Please check your connection.',
42
+ };
43
+ }
44
+ }),
45
+ });
46
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/community/uptimerobot/src/lib/auth.ts"],"names":[],"mappings":";;;;AAAA,kEAAwD;AACxD,4DAAkE;AAClE,wCAAiD;AAEpC,QAAA,eAAe,GAAG,4BAAS,CAAC,UAAU,CAAC;IAClD,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE;;;;;;;;;wGASyF;IACtG,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;;QACvB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAG1C;gBACD,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,kDAAkD;gBACvD,OAAO,EAAE,EAAE,cAAc,EAAE,mCAAmC,EAAE;gBAChE,IAAI,EAAE,IAAA,uBAAgB,EAAC,EAAE,OAAO,EAAE,IAAc,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;aACpE,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;gBAChC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YACzB,CAAC;YACD,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,MAAA,MAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,0CAAE,OAAO,mCAAI,iBAAiB;aACzD,CAAC;QACJ,CAAC;QAAC,WAAM,CAAC;YACP,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,2DAA2D;aACnE,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function toFormUrlEncoded(obj: Record<string, unknown>): string;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toFormUrlEncoded = toFormUrlEncoded;
4
+ function toFormUrlEncoded(obj) {
5
+ return Object.entries(obj)
6
+ .filter(([, v]) => v !== undefined && v !== null)
7
+ .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`)
8
+ .join('&');
9
+ }
10
+ //# sourceMappingURL=form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/uptimerobot/src/lib/common/form.ts"],"names":[],"mappings":";;AAAA,4CAKC;AALD,SAAgB,gBAAgB,CAAC,GAA4B;IAC3D,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;SACvB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC;SAChD,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC5E,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,101 @@
1
+ export declare const uptimeRobotCommon: {
2
+ apiCall: typeof callApi;
3
+ fetchAllMonitors: typeof fetchAllMonitors;
4
+ fetchFlatMonitorById: typeof fetchFlatMonitorById;
5
+ flattenMonitor: typeof flattenMonitor;
6
+ buildMonitorOptions: typeof buildMonitorOptions;
7
+ monitorDropdown: import("@taskmagic/pieces-framework").DropdownProperty<string, true>;
8
+ monitorDropdownOptional: import("@taskmagic/pieces-framework").DropdownProperty<string, false>;
9
+ monitorMultiSelect: import("@taskmagic/pieces-framework").MultiSelectDropdownProperty<string, false>;
10
+ };
11
+ declare function callApi<T extends UptimeRobotBaseResponse>({ apiKey, endpoint, body, }: {
12
+ apiKey: string;
13
+ endpoint: string;
14
+ body?: Record<string, unknown>;
15
+ }): Promise<T>;
16
+ declare function fetchAllMonitors({ apiKey, additionalBody, shouldStop, }: {
17
+ apiKey: string;
18
+ additionalBody?: Record<string, unknown>;
19
+ shouldStop?: (all: UptimeRobotMonitor[]) => boolean;
20
+ }): Promise<UptimeRobotMonitor[]>;
21
+ declare function flattenMonitor({ monitor }: {
22
+ monitor: UptimeRobotMonitor;
23
+ }): FlatMonitor;
24
+ declare function fetchFlatMonitorById({ apiKey, id, }: {
25
+ apiKey: string;
26
+ id: number | string;
27
+ }): Promise<FlatMonitor | null>;
28
+ declare function buildMonitorOptions({ auth, searchValue, }: {
29
+ auth: string | undefined;
30
+ searchValue?: string;
31
+ }): Promise<{
32
+ disabled: boolean;
33
+ options: {
34
+ label: string;
35
+ value: string;
36
+ }[];
37
+ placeholder?: string;
38
+ }>;
39
+ export interface UptimeRobotApiError {
40
+ type: string;
41
+ message: string;
42
+ }
43
+ export interface UptimeRobotBaseResponse {
44
+ stat: 'ok' | 'fail';
45
+ error?: UptimeRobotApiError;
46
+ }
47
+ export interface UptimeRobotLog {
48
+ type: number;
49
+ datetime: number;
50
+ duration: number;
51
+ reason?: {
52
+ code: number;
53
+ detail: string;
54
+ };
55
+ }
56
+ export interface UptimeRobotMonitor {
57
+ id: number;
58
+ friendly_name: string;
59
+ url: string;
60
+ type: number;
61
+ status: number;
62
+ interval: number;
63
+ custom_uptime_ratio?: string;
64
+ average_response_time?: string;
65
+ logs?: UptimeRobotLog[];
66
+ }
67
+ export interface UptimeRobotMonitorsResponse extends UptimeRobotBaseResponse {
68
+ pagination: {
69
+ offset: number;
70
+ limit: number;
71
+ total: number;
72
+ };
73
+ monitors: UptimeRobotMonitor[];
74
+ }
75
+ export interface UptimeRobotNewMonitorResponse extends UptimeRobotBaseResponse {
76
+ monitor: {
77
+ id: number;
78
+ status: number;
79
+ };
80
+ }
81
+ export interface UptimeRobotEditMonitorResponse extends UptimeRobotBaseResponse {
82
+ monitor: {
83
+ id: number;
84
+ };
85
+ }
86
+ export interface UptimeRobotDeleteMonitorResponse extends UptimeRobotBaseResponse {
87
+ monitor: {
88
+ id: number;
89
+ };
90
+ }
91
+ export interface FlatMonitor {
92
+ id: string;
93
+ friendly_name: string;
94
+ url: string;
95
+ type: string;
96
+ status: string;
97
+ interval_seconds: number;
98
+ uptime_ratio_30d: string | null;
99
+ average_response_time_ms: number | null;
100
+ }
101
+ export {};
@@ -0,0 +1,211 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uptimeRobotCommon = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@taskmagic/pieces-common");
6
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
7
+ const form_1 = require("./form");
8
+ const BASE_URL = 'https://api.uptimerobot.com/v2';
9
+ const MAX_MONITORS_PER_PAGE = 50;
10
+ const MAX_DROPDOWN_MONITORS = 500;
11
+ const MONITOR_TYPE_MAP = {
12
+ 1: 'HTTP',
13
+ 2: 'Keyword',
14
+ 3: 'Ping',
15
+ 4: 'Port',
16
+ 5: 'Heartbeat',
17
+ };
18
+ const MONITOR_STATUS_MAP = {
19
+ 0: 'Paused',
20
+ 1: 'Not checked yet',
21
+ 2: 'Up',
22
+ 8: 'Seems down',
23
+ 9: 'Down',
24
+ };
25
+ exports.uptimeRobotCommon = {
26
+ apiCall: callApi,
27
+ fetchAllMonitors,
28
+ fetchFlatMonitorById,
29
+ flattenMonitor,
30
+ buildMonitorOptions,
31
+ monitorDropdown: pieces_framework_1.Property.Dropdown({
32
+ displayName: 'Monitor',
33
+ description: 'Select the monitor to act on',
34
+ refreshers: [],
35
+ refreshOnSearch: true,
36
+ required: true,
37
+ options: (_a, _b) => tslib_1.__awaiter(void 0, [_a, _b], void 0, function* ({ auth }, { searchValue }) {
38
+ return buildMonitorOptions({
39
+ auth: auth,
40
+ searchValue: searchValue !== null && searchValue !== void 0 ? searchValue : undefined,
41
+ });
42
+ }),
43
+ }),
44
+ monitorDropdownOptional: pieces_framework_1.Property.Dropdown({
45
+ displayName: 'Monitor (optional)',
46
+ description: 'Select the monitor to act on, or leave blank and use "Monitor ID" below to pass a dynamic value.',
47
+ refreshers: [],
48
+ refreshOnSearch: true,
49
+ required: false,
50
+ options: (_a, _b) => tslib_1.__awaiter(void 0, [_a, _b], void 0, function* ({ auth }, { searchValue }) {
51
+ return buildMonitorOptions({
52
+ auth: auth,
53
+ searchValue: searchValue !== null && searchValue !== void 0 ? searchValue : undefined,
54
+ });
55
+ }),
56
+ }),
57
+ monitorMultiSelect: pieces_framework_1.Property.MultiSelectDropdown({
58
+ displayName: 'Monitors',
59
+ description: 'Filter to specific monitors. Leave empty to include all monitors in your account.',
60
+ refreshers: [],
61
+ required: false,
62
+ options: (_a, _b) => tslib_1.__awaiter(void 0, [_a, _b], void 0, function* ({ auth }, { searchValue }) {
63
+ return buildMonitorOptions({
64
+ auth: auth,
65
+ searchValue: searchValue !== null && searchValue !== void 0 ? searchValue : undefined,
66
+ });
67
+ }),
68
+ }),
69
+ };
70
+ function statusLabel(status) {
71
+ var _a;
72
+ return (_a = MONITOR_STATUS_MAP[status]) !== null && _a !== void 0 ? _a : String(status);
73
+ }
74
+ function getHttpStatus(err) {
75
+ if (typeof err !== 'object' || err === null || !('response' in err))
76
+ return undefined;
77
+ const { response } = err;
78
+ if (typeof response !== 'object' || response === null || !('status' in response))
79
+ return undefined;
80
+ const { status } = response;
81
+ return typeof status === 'number' ? status : undefined;
82
+ }
83
+ function callApi(_a) {
84
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ apiKey, endpoint, body, }) {
85
+ var _b, _c;
86
+ const payload = Object.assign({ api_key: apiKey, format: 'json' }, body);
87
+ let response;
88
+ try {
89
+ response = yield pieces_common_1.httpClient.sendRequest({
90
+ method: pieces_common_1.HttpMethod.POST,
91
+ url: `${BASE_URL}/${endpoint}`,
92
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
93
+ body: (0, form_1.toFormUrlEncoded)(payload),
94
+ });
95
+ }
96
+ catch (error) {
97
+ const status = getHttpStatus(error);
98
+ if (status === 429) {
99
+ throw new Error('UptimeRobot rate limit exceeded (Free plan: 10 req/min). Wait a moment and retry, or upgrade your plan.');
100
+ }
101
+ if (status !== undefined && status >= 500) {
102
+ throw new Error(`UptimeRobot is unavailable (HTTP ${status}). Please try again shortly.`);
103
+ }
104
+ throw new Error(`UptimeRobot API request failed${status ? ` (HTTP ${status})` : ''}: ${endpoint}`);
105
+ }
106
+ if (response.body.stat === 'fail') {
107
+ throw new Error((_c = (_b = response.body.error) === null || _b === void 0 ? void 0 : _b.message) !== null && _c !== void 0 ? _c : 'UptimeRobot API request failed');
108
+ }
109
+ return response.body;
110
+ });
111
+ }
112
+ function fetchAllMonitors(_a) {
113
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ apiKey, additionalBody, shouldStop, }) {
114
+ const all = [];
115
+ let offset = 0;
116
+ let hasMore = true;
117
+ while (hasMore) {
118
+ const data = yield callApi({
119
+ apiKey,
120
+ endpoint: 'getMonitors',
121
+ body: Object.assign({ limit: MAX_MONITORS_PER_PAGE, offset }, additionalBody),
122
+ });
123
+ all.push(...data.monitors);
124
+ if (shouldStop && shouldStop(all))
125
+ break;
126
+ offset += MAX_MONITORS_PER_PAGE;
127
+ hasMore =
128
+ data.monitors.length >= MAX_MONITORS_PER_PAGE &&
129
+ offset < data.pagination.total;
130
+ }
131
+ return all;
132
+ });
133
+ }
134
+ function flattenMonitor({ monitor }) {
135
+ var _a, _b;
136
+ return {
137
+ id: String(monitor.id),
138
+ friendly_name: monitor.friendly_name,
139
+ url: monitor.url,
140
+ type: (_a = MONITOR_TYPE_MAP[monitor.type]) !== null && _a !== void 0 ? _a : String(monitor.type),
141
+ status: statusLabel(monitor.status),
142
+ interval_seconds: monitor.interval,
143
+ uptime_ratio_30d: (_b = monitor.custom_uptime_ratio) !== null && _b !== void 0 ? _b : null,
144
+ average_response_time_ms: monitor.average_response_time
145
+ ? Number(monitor.average_response_time)
146
+ : null,
147
+ };
148
+ }
149
+ function fetchFlatMonitorById(_a) {
150
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ apiKey, id, }) {
151
+ const data = yield callApi({
152
+ apiKey,
153
+ endpoint: 'getMonitors',
154
+ body: {
155
+ monitors: String(id),
156
+ custom_uptime_ratios: '30',
157
+ response_times: 1,
158
+ },
159
+ });
160
+ const monitor = data.monitors[0];
161
+ return monitor ? flattenMonitor({ monitor }) : null;
162
+ });
163
+ }
164
+ function buildMonitorOptions(_a) {
165
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, searchValue, }) {
166
+ if (!auth) {
167
+ return {
168
+ disabled: true,
169
+ options: [],
170
+ placeholder: 'Please connect your UptimeRobot account first',
171
+ };
172
+ }
173
+ try {
174
+ const additionalBody = {};
175
+ if (searchValue)
176
+ additionalBody['search'] = searchValue;
177
+ const monitors = yield fetchAllMonitors({
178
+ apiKey: auth,
179
+ additionalBody,
180
+ shouldStop: (all) => all.length >= MAX_DROPDOWN_MONITORS,
181
+ });
182
+ if (monitors.length === 0) {
183
+ return {
184
+ disabled: false,
185
+ options: [],
186
+ placeholder: searchValue
187
+ ? 'No monitors match your search'
188
+ : 'No monitors found. Create one in UptimeRobot first.',
189
+ };
190
+ }
191
+ const capped = monitors.slice(0, MAX_DROPDOWN_MONITORS);
192
+ const truncated = monitors.length >= MAX_DROPDOWN_MONITORS;
193
+ return Object.assign({ disabled: false, options: capped.map((m) => ({
194
+ label: `${m.friendly_name} (${m.url}) — ${statusLabel(m.status)}`,
195
+ value: String(m.id),
196
+ })) }, (truncated
197
+ ? {
198
+ placeholder: `Showing first ${MAX_DROPDOWN_MONITORS} monitors — type to search for more`,
199
+ }
200
+ : {}));
201
+ }
202
+ catch (_b) {
203
+ return {
204
+ disabled: true,
205
+ options: [],
206
+ placeholder: 'Failed to load monitors. Check your API key.',
207
+ };
208
+ }
209
+ });
210
+ }
211
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../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