cloudflare
Version:
The official TypeScript library for the Cloudflare API
23 lines • 959 B
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { path } from "../../../internal/utils/path.mjs";
export var BaseEvents = /* @__PURE__ */ (() => {
class BaseEvents extends 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(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;
})();
export class Events extends BaseEvents {
}
//# sourceMappingURL=events.mjs.map