diff --git a/examples/create-monitor/index.js b/examples/create-monitor/index.js index 828d059e..24aadc9d 100644 --- a/examples/create-monitor/index.js +++ b/examples/create-monitor/index.js @@ -47,9 +47,9 @@ async function main() { // optional txCondition: 'gasPrice > 0', // optional - autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964', + actionCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964', // optional - autotaskTrigger: undefined, + actionTrigger: undefined, // optional alertThreshold: { amount: 2, @@ -79,9 +79,9 @@ async function main() { // optional paused: false, // optional - autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964', + actionCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964', // optional - autotaskTrigger: undefined, + actionTrigger: undefined, // optional alertThreshold: { amount: 2, diff --git a/examples/update-monitor/index.js b/examples/update-monitor/index.js index 0f8aee31..662502a0 100644 --- a/examples/update-monitor/index.js +++ b/examples/update-monitor/index.js @@ -50,9 +50,9 @@ async function main() { // optional txCondition: 'gasPrice > 0', // optional - autotaskCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964', + actionCondition: '3dcfee82-f5bd-43e3-8480-0676e5c28964', // optional - autotaskTrigger: undefined, + actionTrigger: undefined, // optional alertThreshold: { amount: 2, diff --git a/packages/action/src/utils.ts b/packages/action/src/utils.ts index af0457fd..55a38730 100644 --- a/packages/action/src/utils.ts +++ b/packages/action/src/utils.ts @@ -55,7 +55,7 @@ export async function tailLogsFor(client: ActionClient, actionId: string) { console.log(`\n${runDetails.decodedLogs}`); } else if (status === 'throttled') { console.warn( - `\nThis autotask run was canceled since the hourly run capacity for your account has been exceeded. Contact us at defender-support@openzeppelin.com for additional capacity.`, + `\nThis action run was canceled since the hourly run capacity for your account has been exceeded. Contact us at defender-support@openzeppelin.com for additional capacity.`, ); } } diff --git a/packages/monitor/src/api/index.test.ts b/packages/monitor/src/api/index.test.ts index 99c8df7c..54509779 100644 --- a/packages/monitor/src/api/index.test.ts +++ b/packages/monitor/src/api/index.test.ts @@ -206,7 +206,7 @@ describe('MonitorClient', () => { { abi, addresses: addresses, - autotaskCondition: undefined, + actionCondition: undefined, conditions: [ { eventConditions, @@ -224,7 +224,7 @@ describe('MonitorClient', () => { alertThreshold: undefined, blockWatcherId: 'i-am-the-watcher', notifyConfig: { - autotaskId: undefined, + actionId: undefined, notifications: [], timeoutMs: 0, }, @@ -245,14 +245,14 @@ describe('MonitorClient', () => { network, alertThreshold: undefined, notifyConfig: { - autotaskId: undefined, + actionId: undefined, notifications: [], timeoutMs: 0, }, fortaRule: { addresses: addresses, agentIDs: undefined, - autotaskCondition: undefined, + actionCondition: undefined, conditions: fortaConditions, }, }; @@ -272,14 +272,14 @@ describe('MonitorClient', () => { privateFortaNodeId: '0x123', alertThreshold: undefined, notifyConfig: { - autotaskId: undefined, + actionId: undefined, notifications: [], timeoutMs: 0, }, fortaRule: { addresses: addresses, agentIDs: undefined, - autotaskCondition: undefined, + actionCondition: undefined, conditions: fortaConditions, }, }; @@ -323,7 +323,7 @@ describe('MonitorClient', () => { { abi, addresses: addresses, - autotaskCondition: undefined, + actionCondition: undefined, conditions: [ { eventConditions, @@ -341,7 +341,7 @@ describe('MonitorClient', () => { alertThreshold: undefined, blockWatcherId: 'i-am-the-watcher', notifyConfig: { - autotaskId: undefined, + actionId: undefined, notifications: [], timeoutMs: 0, }, @@ -378,14 +378,14 @@ describe('MonitorClient', () => { network, alertThreshold: undefined, notifyConfig: { - autotaskId: undefined, + actionId: undefined, notifications: [], timeoutMs: 0, }, fortaRule: { addresses: addresses, agentIDs: undefined, - autotaskCondition: undefined, + actionCondition: undefined, conditions: fortaConditions, }, }; @@ -410,14 +410,14 @@ describe('MonitorClient', () => { { abi: oldBlockMonitor.addressRules[0].abi, addresses: oldBlockMonitor.addressRules[0].addresses, - autotaskCondition: undefined, + actionCondition: undefined, conditions: [], }, ], blockWatcherId: oldBlockMonitor.blockWatcherId, network: oldBlockMonitor.network, notifyConfig: { - autotaskId: undefined, + actionId: undefined, notifications: [], timeoutMs: 0, }, diff --git a/packages/monitor/src/api/index.ts b/packages/monitor/src/api/index.ts index e7c80a8f..d4df81cb 100644 --- a/packages/monitor/src/api/index.ts +++ b/packages/monitor/src/api/index.ts @@ -178,7 +178,7 @@ export class MonitorClient extends BaseApiClient { addresses: monitor.addresses, agentIDs: monitor.agentIDs, conditions: monitor.fortaConditions, - autotaskCondition: monitor.autotaskCondition ? { autotaskId: monitor.autotaskCondition } : undefined, + actionCondition: monitor.actionCondition ? { actionId: monitor.actionCondition } : undefined, }, privateFortaNodeId: monitor.privateFortaNodeId, network: monitor.network, @@ -261,7 +261,7 @@ export class MonitorClient extends BaseApiClient { addressRules: [ { conditions: getConditionSets(conditions.txExpression, conditions.events, conditions.functions), - autotaskCondition: monitor.autotaskCondition ? { autotaskId: monitor.autotaskCondition } : undefined, + actionCondition: monitor.actionCondition ? { actionId: monitor.actionCondition } : undefined, addresses: monitor.addresses, abi: this.normaliseABI(monitor.abi), }, @@ -305,7 +305,7 @@ export class MonitorClient extends BaseApiClient { notifyConfig: { notifications: notificationChannels, notificationCategoryId: _.isEmpty(notificationChannels) ? monitor.notificationCategoryId : undefined, - autotaskId: monitor.autotaskTrigger ? monitor.autotaskTrigger : undefined, + actionId: monitor.actionTrigger ? monitor.actionTrigger : undefined, timeoutMs: monitor.alertTimeoutMs ? monitor.alertTimeoutMs : 0, messageBody: monitor.alertMessageBody ? monitor.alertMessageBody : undefined, messageSubject: monitor.alertMessageSubject ? monitor.alertMessageSubject : undefined, @@ -340,8 +340,8 @@ export class MonitorClient extends BaseApiClient { paused: monitor.paused, skipABIValidation: monitor.skipABIValidation, alertThreshold: monitor.alertThreshold, - autotaskCondition: rule.autotaskCondition?.autotaskId, - autotaskTrigger: monitor.notifyConfig?.autotaskId, + actionCondition: rule.actionCondition?.actionId, + actionTrigger: monitor.notifyConfig?.actionId, alertTimeoutMs: monitor.notifyConfig?.timeoutMs, alertMessageSubject: monitor.notifyConfig?.messageSubject, alertMessageBody: monitor.notifyConfig?.messageBody, @@ -358,8 +358,8 @@ export class MonitorClient extends BaseApiClient { name: monitor.name, paused: monitor.paused, alertThreshold: monitor.alertThreshold, - autotaskCondition: monitor.fortaRule.autotaskCondition?.autotaskId, - autotaskTrigger: monitor.notifyConfig?.autotaskId, + actionCondition: monitor.fortaRule.actionCondition?.actionId, + actionTrigger: monitor.notifyConfig?.actionId, alertTimeoutMs: monitor.notifyConfig?.timeoutMs, alertMessageSubject: monitor.notifyConfig?.messageSubject, alertMessageBody: monitor.notifyConfig?.messageBody, diff --git a/packages/monitor/src/models/monitor.ts b/packages/monitor/src/models/monitor.ts index 913df983..f5034ad9 100644 --- a/packages/monitor/src/models/monitor.ts +++ b/packages/monitor/src/models/monitor.ts @@ -8,8 +8,8 @@ export interface ExternalBaseCreateMonitorRequest { abi?: string; paused?: boolean; alertThreshold?: Threshold; - autotaskCondition?: string; - autotaskTrigger?: string; + actionCondition?: string; + actionTrigger?: string; alertTimeoutMs?: number; alertMessageBody?: string; alertMessageSubject?: string; @@ -114,7 +114,7 @@ export interface FortaRule { // agentIDs should be a list of Bot IDs agentIDs?: string[]; conditions: FortaConditionSet; - autotaskCondition?: AutotaskCondition; + actionCondition?: ActionCondition; } export interface FortaConditionSet { alertIDs?: string[]; @@ -132,7 +132,7 @@ export type MonitorRiskCategory = 'NONE' | 'GOVERNANCE' | 'ACCESS-CONTROL' | 'SU export type Address = string; export interface AddressRule { conditions: ConditionSet[]; - autotaskCondition?: AutotaskCondition; + actionCondition?: ActionCondition; addresses: Address[]; abi?: string; } @@ -153,8 +153,8 @@ export interface FunctionCondition { functionSignature: string; expression?: string | null; } -export interface AutotaskCondition { - autotaskId: string; +export interface ActionCondition { + actionId: string; } export interface Threshold { amount: number; @@ -163,7 +163,7 @@ export interface Threshold { export interface Notifications { notifications: NotificationReference[]; notificationCategoryId?: string; - autotaskId?: string; + actionId?: string; messageBody?: string; messageSubject?: string; timeoutMs: number;