UNPKG

@netlify/content-engine

Version:
18 lines 791 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.makeGCPBucketWriteHandler = makeGCPBucketWriteHandler; const base_handler_1 = require("../base-handler"); // Takes in a GCP bucket and returns a ledger write handler for it // When requests come in to write to the ledger, the ledger is stored in a path inside the bucket function makeGCPBucketWriteHandler({ bucket }) { return (0, base_handler_1.makeLedgerWriteHandler)({ getWritableStream: (ledgerDetails) => { const path = (0, base_handler_1.makeLedgerFilePath)(ledgerDetails); return bucket.file(path).createWriteStream({ resumable: false, contentType: `text/plain`, }); }, }); } //# sourceMappingURL=gcp.js.map