@payloadcms/plugin-cloud-storage 1.0.15 → 1.0.17-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +10 -10
- package/.eslintrc.js +14 -14
- package/.gitignore +248 -248
- package/.prettierignore +1 -1
- package/.prettierrc.js +8 -8
- package/.vscode/launch.json +40 -28
- package/.vscode/settings.json +9 -9
- package/LICENSE.md +22 -22
- package/README.md +196 -178
- package/azure.d.ts +1 -1
- package/azure.js +1 -1
- package/dev/.env +11 -15
- package/dev/.env.example +21 -21
- package/dev/nodemon.json +8 -8
- package/dev/package.json +34 -32
- package/dev/src/collections/Media.ts +56 -56
- package/dev/src/collections/Users.ts +23 -23
- package/dev/src/mocks/fsMock.js +1 -1
- package/dev/src/mocks/promisifyMock.js +1 -1
- package/dev/src/payload.config.ts +111 -111
- package/dev/src/server.ts +26 -26
- package/dev/tsconfig.json +20 -20
- package/dist/adapters/azure/fileStub.d.ts +2 -2
- package/dist/adapters/azure/fileStub.js +3 -3
- package/dist/adapters/azure/generateURL.d.ts +7 -7
- package/dist/adapters/azure/generateURL.js +15 -15
- package/dist/adapters/azure/handleDelete.d.ts +9 -9
- package/dist/adapters/azure/handleDelete.js +63 -63
- package/dist/adapters/azure/handleUpload.d.ts +10 -10
- package/dist/adapters/azure/handleUpload.js +80 -80
- package/dist/adapters/azure/index.d.ts +8 -8
- package/dist/adapters/azure/index.js +42 -42
- package/dist/adapters/azure/index.js.map +1 -1
- package/dist/adapters/azure/mock.d.ts +13 -13
- package/dist/adapters/azure/mock.js +12 -12
- package/dist/adapters/azure/staticHandler.d.ts +9 -9
- package/dist/adapters/azure/staticHandler.js +81 -81
- package/dist/adapters/azure/webpack.d.ts +2 -2
- package/dist/adapters/azure/webpack.js +24 -24
- package/dist/adapters/azure/webpack.js.map +1 -1
- package/dist/adapters/gcs/generateURL.d.ts +8 -8
- package/dist/adapters/gcs/generateURL.js +15 -15
- package/dist/adapters/gcs/handleDelete.d.ts +8 -8
- package/dist/adapters/gcs/handleDelete.js +62 -62
- package/dist/adapters/gcs/handleUpload.d.ts +12 -12
- package/dist/adapters/gcs/handleUpload.js +72 -72
- package/dist/adapters/gcs/index.d.ts +8 -8
- package/dist/adapters/gcs/index.js +35 -35
- package/dist/adapters/gcs/mock.d.ts +1 -1
- package/dist/adapters/gcs/mock.js +4 -4
- package/dist/adapters/gcs/staticHandler.d.ts +10 -10
- package/dist/adapters/gcs/staticHandler.js +76 -76
- package/dist/adapters/gcs/webpack.d.ts +2 -2
- package/dist/adapters/gcs/webpack.js +24 -24
- package/dist/adapters/gcs/webpack.js.map +1 -1
- package/dist/adapters/s3/fileStub.d.ts +2 -2
- package/dist/adapters/s3/fileStub.js +3 -3
- package/dist/adapters/s3/generateURL.d.ts +8 -8
- package/dist/adapters/s3/generateURL.js +15 -15
- package/dist/adapters/s3/handleDelete.d.ts +8 -8
- package/dist/adapters/s3/handleDelete.js +63 -63
- package/dist/adapters/s3/handleUpload.d.ts +12 -12
- package/dist/adapters/s3/handleUpload.js +93 -93
- package/dist/adapters/s3/index.d.ts +8 -8
- package/dist/adapters/s3/index.js +59 -59
- package/dist/adapters/s3/mock.d.ts +8 -8
- package/dist/adapters/s3/mock.js +9 -9
- package/dist/adapters/s3/staticHandler.d.ts +10 -10
- package/dist/adapters/s3/staticHandler.js +81 -80
- package/dist/adapters/s3/staticHandler.js.map +1 -1
- package/dist/adapters/s3/webpack.d.ts +2 -2
- package/dist/adapters/s3/webpack.js +24 -24
- package/dist/adapters/s3/webpack.js.map +1 -1
- package/dist/fields/getFields.d.ts +11 -11
- package/dist/fields/getFields.js +118 -118
- package/dist/hooks/afterDelete.d.ts +10 -10
- package/dist/hooks/afterDelete.js +91 -88
- package/dist/hooks/afterDelete.js.map +1 -1
- package/dist/hooks/afterRead.d.ts +12 -12
- package/dist/hooks/afterRead.js +79 -79
- package/dist/hooks/beforeChange.d.ts +10 -10
- package/dist/hooks/beforeChange.js +105 -77
- package/dist/hooks/beforeChange.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.js +130 -124
- package/dist/plugin.js.map +1 -1
- package/dist/types.d.ts +68 -62
- package/dist/types.js +2 -2
- package/dist/utilities/getFilePrefix.d.ts +5 -5
- package/dist/utilities/getFilePrefix.js +80 -80
- package/dist/utilities/getIncomingFiles.d.ts +7 -7
- package/dist/utilities/getIncomingFiles.js +37 -37
- package/dist/utilities/getRangeFromHeader.d.ts +6 -6
- package/dist/utilities/getRangeFromHeader.js +66 -66
- package/dist/webpack.d.ts +9 -9
- package/dist/webpack.js +39 -39
- package/docs/local-dev.md +47 -47
- package/eslint-config/index.js +15 -15
- package/eslint-config/rules/import.js +38 -38
- package/eslint-config/rules/prettier.js +7 -7
- package/eslint-config/rules/style.js +21 -21
- package/eslint-config/rules/typescript.js +628 -628
- package/gcs.d.ts +1 -1
- package/gcs.js +1 -1
- package/package.json +67 -67
- package/s3.d.ts +1 -1
- package/s3.js +1 -1
- package/src/adapters/azure/emulator/docker-compose.yml +16 -16
- package/src/adapters/azure/fileStub.js +1 -1
- package/src/adapters/azure/generateURL.ts +13 -13
- package/src/adapters/azure/handleDelete.ts +16 -16
- package/src/adapters/azure/handleUpload.ts +41 -41
- package/src/adapters/azure/index.ts +48 -47
- package/src/adapters/azure/mock.js +13 -13
- package/src/adapters/azure/staticHandler.ts +38 -38
- package/src/adapters/azure/webpack.ts +24 -20
- package/src/adapters/gcs/emulator/docker-compose.yml +15 -15
- package/src/adapters/gcs/generateURL.ts +16 -16
- package/src/adapters/gcs/handleDelete.ts +16 -16
- package/src/adapters/gcs/handleUpload.ts +34 -34
- package/src/adapters/gcs/index.ts +37 -37
- package/src/adapters/gcs/mock.js +3 -3
- package/src/adapters/gcs/staticHandler.ts +34 -34
- package/src/adapters/gcs/webpack.ts +21 -17
- package/src/adapters/s3/emulator/.localstack/cache/machine.json +1 -0
- package/src/adapters/s3/emulator/.localstack/cache/server.test.pem +127 -0
- package/src/adapters/s3/emulator/.localstack/cache/server.test.pem.crt +99 -0
- package/src/adapters/s3/emulator/.localstack/cache/server.test.pem.key +28 -0
- package/src/adapters/s3/emulator/.localstack/cache/service-catalog-2_1_1_dev-1_29_149.pickle +0 -0
- package/src/adapters/s3/emulator/docker-compose.yml +15 -15
- package/src/adapters/s3/generateURL.ts +14 -14
- package/src/adapters/s3/handleDelete.ts +17 -17
- package/src/adapters/s3/index.ts +38 -38
- package/src/adapters/s3/mock.js +9 -9
- package/src/adapters/s3/staticHandler.ts +41 -40
- package/src/adapters/s3/webpack.ts +4 -0
- package/src/fields/getFields.ts +155 -155
- package/src/hooks/afterDelete.ts +35 -35
- package/src/hooks/afterRead.ts +38 -38
- package/src/hooks/beforeChange.ts +59 -30
- package/src/index.ts +1 -1
- package/src/plugin.ts +101 -94
- package/src/types.ts +79 -73
- package/src/utilities/getFilePrefix.ts +26 -26
- package/src/utilities/getIncomingFiles.ts +44 -44
- package/src/utilities/getRangeFromHeader.ts +27 -27
- package/src/webpack.ts +46 -46
- package/tsconfig.json +23 -23
- package/yarn-error.log +8163 -0
- package/yarn.lock +8062 -8155
- package/.idea/.gitignore +0 -5
- package/.idea/httpRequests/2023-04-07T152957.206.png +0 -0
- package/.idea/httpRequests/2023-04-07T153025.403.html +0 -10
- package/.idea/httpRequests/2023-04-07T153146.200.png +0 -0
- package/.idea/httpRequests/http-client.cookies +0 -1
- package/.idea/httpRequests/http-requests-log.http +0 -74
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/jsLinters/eslint.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/plugin-cloud-storage.iml +0 -12
- package/.idea/vcs.xml +0 -6
- package/.idea/workspace.xml +0 -269
- package/dev/build/127.d2c2ffcfff69fabfdd1b.js +0 -1
- package/dev/build/16.17dbe03b1d0a96f3e564.js +0 -2
- package/dev/build/16.17dbe03b1d0a96f3e564.js.LICENSE.txt +0 -8
- package/dev/build/171.bbcbae3ea90468ad0cad.js +0 -2
- package/dev/build/171.bbcbae3ea90468ad0cad.js.LICENSE.txt +0 -8
- package/dev/build/18.e50c27edff6716f930d9.js +0 -1
- package/dev/build/205.33c7a29683ba98de93e0.js +0 -1
- package/dev/build/2211c49456cd07331ea9.woff +0 -0
- package/dev/build/234.79395f82c18207c13766.js +0 -1
- package/dev/build/266.9d4a240b3e0985bd7dd5.js +0 -1
- package/dev/build/296.4c5d646257b42c915834.js +0 -1
- package/dev/build/304.40dbe690de322c8f7c0d.js +0 -2
- package/dev/build/304.40dbe690de322c8f7c0d.js.LICENSE.txt +0 -37
- package/dev/build/349.446c12bffd3905085fdb.js +0 -1
- package/dev/build/354.5acd04b85b96a9839125.js +0 -1
- package/dev/build/40ad7515b8674bb854a1.woff2 +0 -0
- package/dev/build/422.086542466cdc9f6a2437.js +0 -2
- package/dev/build/422.086542466cdc9f6a2437.js.LICENSE.txt +0 -6
- package/dev/build/491.0bfe1bb0ecfe383179aa.js +0 -1
- package/dev/build/4d8845b830f4e8e2affb.png +0 -0
- package/dev/build/51922ceb71da289688d3.woff2 +0 -0
- package/dev/build/522443364fda49e9e0ed.woff2 +0 -0
- package/dev/build/531.1c6f53f3b44a3c45b444.js +0 -2
- package/dev/build/531.1c6f53f3b44a3c45b444.js.LICENSE.txt +0 -6
- package/dev/build/570.f2d9b99706765fbf0225.js +0 -1
- package/dev/build/599.570a04990d5806004f61.js +0 -1
- package/dev/build/5b718d9772de251a8c0a.woff2 +0 -0
- package/dev/build/778.41ae26bcd617861ad586.js +0 -1
- package/dev/build/783.0117995f2ff6036d6746.js +0 -1
- package/dev/build/787999a6af6a17efbc7c.woff +0 -0
- package/dev/build/78b8935fb481e11c92ce.woff +0 -0
- package/dev/build/860.7688681d3269f3f16e9a.js +0 -1
- package/dev/build/892.1a4ca5ac67d81038ceec.js +0 -1
- package/dev/build/896.d8cb1160388dc29d6364.js +0 -1
- package/dev/build/8b4ddd0d08500553efde.woff +0 -0
- package/dev/build/8f612153248094525d9d.woff +0 -0
- package/dev/build/995.cc11e738ff81a85821b4.js +0 -1
- package/dev/build/9c7dfd0036f7bd24b053.woff2 +0 -0
- package/dev/build/a1cfdc5b5250b7c4b481.woff2 +0 -0
- package/dev/build/d7aeda9e48ce098e7b48.woff +0 -0
- package/dev/build/e009f21405b4d7e89367.woff2 +0 -0
- package/dev/build/e7caa9e17af6ac87d182.woff +0 -0
- package/dev/build/ebcc1430049fddb274f8.svg +0 -15
- package/dev/build/efe8f6a3b46446cc9135.woff +0 -0
- package/dev/build/f53bb8d4b29adc903703.woff2 +0 -0
- package/dev/build/index.html +0 -1
- package/dev/build/main.a2003d502fbb9aaa3e8d.js +0 -2
- package/dev/build/main.a2003d502fbb9aaa3e8d.js.LICENSE.txt +0 -57
- package/dev/build/styles.css +0 -1
- package/dev/build/styles.fa29d16b0baf5b98a1cf.js +0 -1
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.getHandleDelete = void 0;
|
|
43
|
-
var path_1 = __importDefault(require("path"));
|
|
44
|
-
var getHandleDelete = function (_a) {
|
|
45
|
-
var getStorageClient = _a.getStorageClient;
|
|
46
|
-
return function (_a) {
|
|
47
|
-
var filename = _a.filename, _b = _a.doc.prefix, prefix = _b === void 0 ? '' : _b;
|
|
48
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
49
|
-
var blockBlobClient;
|
|
50
|
-
return __generator(this, function (_c) {
|
|
51
|
-
switch (_c.label) {
|
|
52
|
-
case 0:
|
|
53
|
-
blockBlobClient = getStorageClient().getBlockBlobClient(path_1.default.posix.join(prefix, filename));
|
|
54
|
-
return [4 /*yield*/, blockBlobClient.deleteIfExists()];
|
|
55
|
-
case 1:
|
|
56
|
-
_c.sent();
|
|
57
|
-
return [2 /*return*/];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
exports.getHandleDelete = getHandleDelete;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.getHandleDelete = void 0;
|
|
43
|
+
var path_1 = __importDefault(require("path"));
|
|
44
|
+
var getHandleDelete = function (_a) {
|
|
45
|
+
var getStorageClient = _a.getStorageClient;
|
|
46
|
+
return function (_a) {
|
|
47
|
+
var filename = _a.filename, _b = _a.doc.prefix, prefix = _b === void 0 ? '' : _b;
|
|
48
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
49
|
+
var blockBlobClient;
|
|
50
|
+
return __generator(this, function (_c) {
|
|
51
|
+
switch (_c.label) {
|
|
52
|
+
case 0:
|
|
53
|
+
blockBlobClient = getStorageClient().getBlockBlobClient(path_1.default.posix.join(prefix, filename));
|
|
54
|
+
return [4 /*yield*/, blockBlobClient.deleteIfExists()];
|
|
55
|
+
case 1:
|
|
56
|
+
_c.sent();
|
|
57
|
+
return [2 /*return*/];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
exports.getHandleDelete = getHandleDelete;
|
|
64
64
|
//# sourceMappingURL=handleDelete.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ContainerClient } from '@azure/storage-blob';
|
|
2
|
-
import type { CollectionConfig } from 'payload/types';
|
|
3
|
-
import type { HandleUpload } from '../../types';
|
|
4
|
-
interface Args {
|
|
5
|
-
collection: CollectionConfig;
|
|
6
|
-
getStorageClient: () => ContainerClient;
|
|
7
|
-
prefix?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const getHandleUpload: ({ getStorageClient, prefix }: Args) => HandleUpload;
|
|
10
|
-
export {};
|
|
1
|
+
import type { ContainerClient } from '@azure/storage-blob';
|
|
2
|
+
import type { CollectionConfig } from 'payload/types';
|
|
3
|
+
import type { HandleUpload } from '../../types';
|
|
4
|
+
interface Args {
|
|
5
|
+
collection: CollectionConfig;
|
|
6
|
+
getStorageClient: () => ContainerClient;
|
|
7
|
+
prefix?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const getHandleUpload: ({ getStorageClient, prefix }: Args) => HandleUpload;
|
|
10
|
+
export {};
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.getHandleUpload = void 0;
|
|
43
|
-
var path_1 = __importDefault(require("path"));
|
|
44
|
-
var fs_1 = __importDefault(require("fs"));
|
|
45
|
-
var stream_1 = require("stream");
|
|
46
|
-
var abort_controller_1 = require("@azure/abort-controller");
|
|
47
|
-
var multipartThreshold = 1024 * 1024 * 50; // 50MB
|
|
48
|
-
var getHandleUpload = function (_a) {
|
|
49
|
-
var getStorageClient = _a.getStorageClient, _b = _a.prefix, prefix = _b === void 0 ? '' : _b;
|
|
50
|
-
return function (_a) {
|
|
51
|
-
var data = _a.data, file = _a.file;
|
|
52
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
53
|
-
var blockBlobClient, fileBufferOrStream;
|
|
54
|
-
return __generator(this, function (_b) {
|
|
55
|
-
switch (_b.label) {
|
|
56
|
-
case 0:
|
|
57
|
-
blockBlobClient = getStorageClient().getBlockBlobClient(path_1.default.posix.join(prefix, file.filename));
|
|
58
|
-
if (!(!file.tempFilePath && file.buffer.length > 0 && file.buffer.length < multipartThreshold)) return [3 /*break*/, 2];
|
|
59
|
-
return [4 /*yield*/, blockBlobClient.upload(file.buffer, file.buffer.byteLength, {
|
|
60
|
-
blobHTTPHeaders: { blobContentType: file.mimeType },
|
|
61
|
-
})];
|
|
62
|
-
case 1:
|
|
63
|
-
_b.sent();
|
|
64
|
-
return [2 /*return*/, data];
|
|
65
|
-
case 2:
|
|
66
|
-
fileBufferOrStream = file.tempFilePath
|
|
67
|
-
? fs_1.default.createReadStream(file.tempFilePath)
|
|
68
|
-
: stream_1.Readable.from(file.buffer);
|
|
69
|
-
return [4 /*yield*/, blockBlobClient.uploadStream(fileBufferOrStream, 4 * 1024 * 1024, 4, {
|
|
70
|
-
abortSignal: abort_controller_1.AbortController.timeout(30 * 60 * 1000),
|
|
71
|
-
})];
|
|
72
|
-
case 3:
|
|
73
|
-
_b.sent();
|
|
74
|
-
return [2 /*return*/, data];
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
exports.getHandleUpload = getHandleUpload;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.getHandleUpload = void 0;
|
|
43
|
+
var path_1 = __importDefault(require("path"));
|
|
44
|
+
var fs_1 = __importDefault(require("fs"));
|
|
45
|
+
var stream_1 = require("stream");
|
|
46
|
+
var abort_controller_1 = require("@azure/abort-controller");
|
|
47
|
+
var multipartThreshold = 1024 * 1024 * 50; // 50MB
|
|
48
|
+
var getHandleUpload = function (_a) {
|
|
49
|
+
var getStorageClient = _a.getStorageClient, _b = _a.prefix, prefix = _b === void 0 ? '' : _b;
|
|
50
|
+
return function (_a) {
|
|
51
|
+
var data = _a.data, file = _a.file;
|
|
52
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
53
|
+
var blockBlobClient, fileBufferOrStream;
|
|
54
|
+
return __generator(this, function (_b) {
|
|
55
|
+
switch (_b.label) {
|
|
56
|
+
case 0:
|
|
57
|
+
blockBlobClient = getStorageClient().getBlockBlobClient(path_1.default.posix.join(prefix, file.filename));
|
|
58
|
+
if (!(!file.tempFilePath && file.buffer.length > 0 && file.buffer.length < multipartThreshold)) return [3 /*break*/, 2];
|
|
59
|
+
return [4 /*yield*/, blockBlobClient.upload(file.buffer, file.buffer.byteLength, {
|
|
60
|
+
blobHTTPHeaders: { blobContentType: file.mimeType },
|
|
61
|
+
})];
|
|
62
|
+
case 1:
|
|
63
|
+
_b.sent();
|
|
64
|
+
return [2 /*return*/, data];
|
|
65
|
+
case 2:
|
|
66
|
+
fileBufferOrStream = file.tempFilePath
|
|
67
|
+
? fs_1.default.createReadStream(file.tempFilePath)
|
|
68
|
+
: stream_1.Readable.from(file.buffer);
|
|
69
|
+
return [4 /*yield*/, blockBlobClient.uploadStream(fileBufferOrStream, 4 * 1024 * 1024, 4, {
|
|
70
|
+
abortSignal: abort_controller_1.AbortController.timeout(30 * 60 * 1000),
|
|
71
|
+
})];
|
|
72
|
+
case 3:
|
|
73
|
+
_b.sent();
|
|
74
|
+
return [2 /*return*/, data];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
exports.getHandleUpload = getHandleUpload;
|
|
81
81
|
//# sourceMappingURL=handleUpload.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Adapter } from '../../types';
|
|
2
|
-
export interface Args {
|
|
3
|
-
connectionString: string;
|
|
4
|
-
containerName: string;
|
|
5
|
-
baseURL: string;
|
|
6
|
-
allowContainerCreate: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const azureBlobStorageAdapter: ({ connectionString, allowContainerCreate, containerName, baseURL, }: Args) => Adapter;
|
|
1
|
+
import type { Adapter } from '../../types';
|
|
2
|
+
export interface Args {
|
|
3
|
+
connectionString: string;
|
|
4
|
+
containerName: string;
|
|
5
|
+
baseURL: string;
|
|
6
|
+
allowContainerCreate: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const azureBlobStorageAdapter: ({ connectionString, allowContainerCreate, containerName, baseURL, }: Args) => Adapter;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.azureBlobStorageAdapter = void 0;
|
|
15
|
-
var storage_blob_1 = require("@azure/storage-blob");
|
|
16
|
-
var staticHandler_1 = require("./staticHandler");
|
|
17
|
-
var generateURL_1 = require("./generateURL");
|
|
18
|
-
var handleDelete_1 = require("./handleDelete");
|
|
19
|
-
var handleUpload_1 = require("./handleUpload");
|
|
20
|
-
var webpack_1 = require("./webpack");
|
|
21
|
-
var azureBlobStorageAdapter = function (_a) {
|
|
22
|
-
var connectionString = _a.connectionString, allowContainerCreate = _a.allowContainerCreate, containerName = _a.containerName, baseURL = _a.baseURL;
|
|
23
|
-
var storageClient = null;
|
|
24
|
-
var getStorageClient = function () {
|
|
25
|
-
if (storageClient)
|
|
26
|
-
return storageClient;
|
|
27
|
-
var blobServiceClient = storage_blob_1.BlobServiceClient.fromConnectionString(connectionString);
|
|
28
|
-
return (storageClient = blobServiceClient.getContainerClient(containerName));
|
|
29
|
-
};
|
|
30
|
-
var createContainerIfNotExists = function () {
|
|
31
|
-
getStorageClient().createIfNotExists({ access: 'blob' });
|
|
32
|
-
};
|
|
33
|
-
return function (_a) {
|
|
34
|
-
var collection = _a.collection, prefix = _a.prefix;
|
|
35
|
-
return __assign({ handleUpload: (0, handleUpload_1.getHandleUpload)({
|
|
36
|
-
collection: collection,
|
|
37
|
-
getStorageClient: getStorageClient,
|
|
38
|
-
prefix: prefix,
|
|
39
|
-
}), handleDelete: (0, handleDelete_1.getHandleDelete)({ collection: collection, getStorageClient: getStorageClient }), generateURL: (0, generateURL_1.getGenerateURL)({ containerName: containerName, baseURL: baseURL }), staticHandler: (0, staticHandler_1.getHandler)({ getStorageClient: getStorageClient, collection: collection }), webpack: webpack_1.extendWebpackConfig }, (allowContainerCreate && { onInit: createContainerIfNotExists }));
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
exports.azureBlobStorageAdapter = azureBlobStorageAdapter;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.azureBlobStorageAdapter = void 0;
|
|
15
|
+
var storage_blob_1 = require("@azure/storage-blob");
|
|
16
|
+
var staticHandler_1 = require("./staticHandler");
|
|
17
|
+
var generateURL_1 = require("./generateURL");
|
|
18
|
+
var handleDelete_1 = require("./handleDelete");
|
|
19
|
+
var handleUpload_1 = require("./handleUpload");
|
|
20
|
+
var webpack_1 = require("./webpack");
|
|
21
|
+
var azureBlobStorageAdapter = function (_a) {
|
|
22
|
+
var connectionString = _a.connectionString, allowContainerCreate = _a.allowContainerCreate, containerName = _a.containerName, baseURL = _a.baseURL;
|
|
23
|
+
var storageClient = null;
|
|
24
|
+
var getStorageClient = function () {
|
|
25
|
+
if (storageClient)
|
|
26
|
+
return storageClient;
|
|
27
|
+
var blobServiceClient = storage_blob_1.BlobServiceClient.fromConnectionString(connectionString);
|
|
28
|
+
return (storageClient = blobServiceClient.getContainerClient(containerName));
|
|
29
|
+
};
|
|
30
|
+
var createContainerIfNotExists = function () {
|
|
31
|
+
getStorageClient().createIfNotExists({ access: 'blob' });
|
|
32
|
+
};
|
|
33
|
+
return function (_a) {
|
|
34
|
+
var collection = _a.collection, prefix = _a.prefix;
|
|
35
|
+
return __assign({ handleUpload: (0, handleUpload_1.getHandleUpload)({
|
|
36
|
+
collection: collection,
|
|
37
|
+
getStorageClient: getStorageClient,
|
|
38
|
+
prefix: prefix,
|
|
39
|
+
}), handleDelete: (0, handleDelete_1.getHandleDelete)({ collection: collection, getStorageClient: getStorageClient }), generateURL: (0, generateURL_1.getGenerateURL)({ containerName: containerName, baseURL: baseURL }), staticHandler: (0, staticHandler_1.getHandler)({ getStorageClient: getStorageClient, collection: collection }), webpack: webpack_1.extendWebpackConfig }, (allowContainerCreate && { onInit: createContainerIfNotExists }));
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
exports.azureBlobStorageAdapter = azureBlobStorageAdapter;
|
|
43
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/azure/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/azure/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,oDAAuD;AAEvD,iDAA4C;AAC5C,6CAA8C;AAC9C,+CAAgD;AAChD,+CAAgD;AAChD,qCAA+C;AASxC,IAAM,uBAAuB,GAAG,UAAC,EAKjC;QAJL,gBAAgB,sBAAA,EAChB,oBAAoB,0BAAA,EACpB,aAAa,mBAAA,EACb,OAAO,aAAA;IAEP,IAAI,aAAa,GAA2B,IAAI,CAAA;IAChD,IAAM,gBAAgB,GAAG;QACvB,IAAI,aAAa;YAAE,OAAO,aAAa,CAAA;QACvC,IAAM,iBAAiB,GAAG,gCAAiB,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;QAClF,OAAO,CAAC,aAAa,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,CAAA;IAC9E,CAAC,CAAA;IAED,IAAM,0BAA0B,GAAG;QACjC,gBAAgB,EAAE,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAC1D,CAAC,CAAA;IAED,OAAO,UAAC,EAAsB;YAApB,UAAU,gBAAA,EAAE,MAAM,YAAA;QAC1B,kBACE,YAAY,EAAE,IAAA,8BAAe,EAAC;gBAC5B,UAAU,YAAA;gBACV,gBAAgB,kBAAA;gBAChB,MAAM,QAAA;aACP,CAAC,EACF,YAAY,EAAE,IAAA,8BAAe,EAAC,EAAE,UAAU,YAAA,EAAE,gBAAgB,kBAAA,EAAE,CAAC,EAC/D,WAAW,EAAE,IAAA,4BAAc,EAAC,EAAE,aAAa,eAAA,EAAE,OAAO,SAAA,EAAE,CAAC,EACvD,aAAa,EAAE,IAAA,0BAAU,EAAC,EAAE,gBAAgB,kBAAA,EAAE,UAAU,YAAA,EAAE,CAAC,EAC3D,OAAO,EAAE,6BAAmB,IACzB,CAAC,oBAAoB,IAAI,EAAE,MAAM,EAAE,0BAA0B,EAAE,CAAC,EACpE;IACH,CAAC,CAAA;AACH,CAAC,CAAA;AA/BY,QAAA,uBAAuB,2BA+BnC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export namespace BlobServiceClient {
|
|
2
|
-
function fromConnectionString(): {
|
|
3
|
-
getContainerClient: () => {
|
|
4
|
-
createIfNotExists: () => null;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
export namespace AbortController {
|
|
9
|
-
function timeout(): null;
|
|
10
|
-
}
|
|
11
|
-
export namespace Readable {
|
|
12
|
-
function from(): null;
|
|
13
|
-
}
|
|
1
|
+
export namespace BlobServiceClient {
|
|
2
|
+
function fromConnectionString(): {
|
|
3
|
+
getContainerClient: () => {
|
|
4
|
+
createIfNotExists: () => null;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export namespace AbortController {
|
|
9
|
+
function timeout(): null;
|
|
10
|
+
}
|
|
11
|
+
export namespace Readable {
|
|
12
|
+
function from(): null;
|
|
13
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.BlobServiceClient = {
|
|
3
|
-
fromConnectionString: function () { return ({
|
|
4
|
-
getContainerClient: function () { return ({
|
|
5
|
-
createIfNotExists: function () { return null; },
|
|
6
|
-
}); },
|
|
7
|
-
}); },
|
|
8
|
-
};
|
|
9
|
-
exports.AbortController = {
|
|
10
|
-
timeout: function () { return null; },
|
|
11
|
-
};
|
|
12
|
-
exports.Readable = { from: function () { return null; } };
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.BlobServiceClient = {
|
|
3
|
+
fromConnectionString: function () { return ({
|
|
4
|
+
getContainerClient: function () { return ({
|
|
5
|
+
createIfNotExists: function () { return null; },
|
|
6
|
+
}); },
|
|
7
|
+
}); },
|
|
8
|
+
};
|
|
9
|
+
exports.AbortController = {
|
|
10
|
+
timeout: function () { return null; },
|
|
11
|
+
};
|
|
12
|
+
exports.Readable = { from: function () { return null; } };
|
|
13
13
|
//# sourceMappingURL=mock.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ContainerClient } from '@azure/storage-blob';
|
|
2
|
-
import type { CollectionConfig } from 'payload/types';
|
|
3
|
-
import type { StaticHandler } from '../../types';
|
|
4
|
-
interface Args {
|
|
5
|
-
getStorageClient: () => ContainerClient;
|
|
6
|
-
collection: CollectionConfig;
|
|
7
|
-
}
|
|
8
|
-
export declare const getHandler: ({ getStorageClient, collection }: Args) => StaticHandler;
|
|
9
|
-
export {};
|
|
1
|
+
import type { ContainerClient } from '@azure/storage-blob';
|
|
2
|
+
import type { CollectionConfig } from 'payload/types';
|
|
3
|
+
import type { StaticHandler } from '../../types';
|
|
4
|
+
interface Args {
|
|
5
|
+
getStorageClient: () => ContainerClient;
|
|
6
|
+
collection: CollectionConfig;
|
|
7
|
+
}
|
|
8
|
+
export declare const getHandler: ({ getStorageClient, collection }: Args) => StaticHandler;
|
|
9
|
+
export {};
|