cloudflare
Version:
The official TypeScript library for the Cloudflare API
35 lines • 1.52 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../../core/resource.mjs";
import { SinglePage } from "../../../../../core/pagination.mjs";
import { path } from "../../../../../internal/utils/path.mjs";
export var BaseBindings = /* @__PURE__ */ (() => {
class BaseBindings extends APIResource {
/**
* Fetch bindings from a script uploaded to a Workers for Platforms dispatch
* namespace.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const bindingGetResponse of client.workersForPlatforms.dispatch.namespaces.scripts.bindings.get(
* 'this-is_my_script-01',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* dispatch_namespace: 'my-dispatch-namespace',
* },
* )) {
* // ...
* }
* ```
*/
get(scriptName, params, options) {
const { account_id, dispatch_namespace } = params;
return this._client.getAPIList(path `/accounts/${account_id}/workers/dispatch/namespaces/${dispatch_namespace}/scripts/${scriptName}/bindings`, (SinglePage), options);
}
}
BaseBindings._key = Object.freeze(['workersForPlatforms', 'dispatch', 'namespaces', 'scripts', 'bindings']);
return BaseBindings;
})();
export class Bindings extends BaseBindings {
}
//# sourceMappingURL=bindings.mjs.map