cloudflare
Version:
The official TypeScript library for the Cloudflare API
28 lines • 1.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Events = exports.BaseEvents = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../core/resource.js");
const path_1 = require("../../../internal/utils/path.js");
var BaseEvents = /* @__PURE__ */ (() => {
class BaseEvents extends resource_1.APIResource {
/**
* Sends an event to a running workflow instance to trigger state transitions.
*/
create(eventType, params, options) {
const { account_id, workflow_name, instance_id, body } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/workflows/${workflow_name}/instances/${instance_id}/events/${eventType}`, { body: body, ...options })._thenUnwrap((obj) => obj.result);
}
}
BaseEvents._key = Object.freeze([
'workflows',
'instances',
'events',
]);
return BaseEvents;
})();
exports.BaseEvents = BaseEvents;
class Events extends BaseEvents {
}
exports.Events = Events;
//# sourceMappingURL=events.js.map