cloudflare
Version:
The official TypeScript library for the Cloudflare API
40 lines • 1.73 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Bindings = exports.BaseBindings = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../../../core/resource.js");
const pagination_1 = require("../../../../../core/pagination.js");
const path_1 = require("../../../../../internal/utils/path.js");
var BaseBindings = /* @__PURE__ */ (() => {
class BaseBindings extends resource_1.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((0, path_1.path) `/accounts/${account_id}/workers/dispatch/namespaces/${dispatch_namespace}/scripts/${scriptName}/bindings`, (pagination_1.SinglePage), options);
}
}
BaseBindings._key = Object.freeze(['workersForPlatforms', 'dispatch', 'namespaces', 'scripts', 'bindings']);
return BaseBindings;
})();
exports.BaseBindings = BaseBindings;
class Bindings extends BaseBindings {
}
exports.Bindings = Bindings;
//# sourceMappingURL=bindings.js.map