diff --git a/backendless.d.ts b/backendless.d.ts index c521e6ff..a7463b49 100644 --- a/backendless.d.ts +++ b/backendless.d.ts @@ -612,10 +612,12 @@ declare module Backendless { * @type: Function */ + type Execution = 'activateAny' | 'activateAll' | string + function activateFlow(flowName: string, initialData?: object): Promise function activateFlowById(flowId: string, initialData?: object): Promise function activateFlowTrigger(flowName: string, triggerName: string, data?: object): Promise - function activateFlowTriggerById(flowId: string, triggerId: string, data?: object, execution?: string): Promise + function activateFlowTriggerById(flowId: string, triggerId: string, data?: object, execution?: Execution): Promise } /** diff --git a/src/automations/index.js b/src/automations/index.js index fedf47cc..6437dff8 100644 --- a/src/automations/index.js +++ b/src/automations/index.js @@ -74,7 +74,7 @@ export default class Automations { if (execution !== undefined && (typeof execution !== 'string' || !execution)) { throw new Error( // eslint-disable-next-line - 'The "execution" argument must be a non-empty string and must be one of this values: "activateAny", "activateAll" or executionId.' + 'The "execution" argument must be a non-empty string and must be one of this values: "activateAny", "activateAll" or Execution ID.' ) } diff --git a/test/unit/specs/automations/basic.js b/test/unit/specs/automations/basic.js index 4292a7f3..cb05d039 100644 --- a/test/unit/specs/automations/basic.js +++ b/test/unit/specs/automations/basic.js @@ -299,7 +299,7 @@ describe(' Basic', function() { it('fails when execution id is invalid', async () => { // eslint-disable-next-line - const errorMsg = 'The "execution" argument must be a non-empty string and must be one of this values: "activateAny", "activateAll" or executionId.' + const errorMsg = 'The "execution" argument must be a non-empty string and must be one of this values: "activateAny", "activateAll" or Execution ID.' await expect(Backendless.Automations.activateFlowTriggerById(FLOW_ID, TRIGGER_ID, {}, null)).to.eventually.be.rejectedWith(errorMsg) await expect(Backendless.Automations.activateFlowTriggerById(FLOW_ID, TRIGGER_ID, {}, true)).to.eventually.be.rejectedWith(errorMsg)