@tweedegolf/sab-adapter-backblaze-b2 1.0.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.
@@ -0,0 +1,179 @@
1
+ import { ResultObject, ResultObjectBoolean, ResultObjectBuckets, ResultObjectFiles, ResultObjectNumber, ResultObjectStream } from "./result";
2
+ import { FileBufferParams, FilePathParams, FileStreamParams } from "./add_file_params";
3
+ export declare enum StorageType {
4
+ LOCAL = "local",
5
+ GCS = "gcs",// Google Cloud Storage
6
+ S3 = "s3",// Amazon S3
7
+ B2 = "b2",// BackBlaze B2
8
+ AZURE = "azure",// Azure Storage Blob
9
+ MINIO = "minio"
10
+ }
11
+ export interface AdapterConfig {
12
+ bucketName?: string;
13
+ [id: string]: any;
14
+ }
15
+ export interface StorageAdapterConfig extends AdapterConfig {
16
+ type: string;
17
+ }
18
+ export interface Options {
19
+ [id: string]: any;
20
+ }
21
+ export interface StreamOptions extends Options {
22
+ start?: number;
23
+ end?: number;
24
+ }
25
+ export interface IAdapter {
26
+ getServiceClient(): any;
27
+ serviceClient: any;
28
+ /**
29
+ * Returns the storage type, e.g. 'gcs', 'b2', 'local' etc.
30
+ */
31
+ getType(): string;
32
+ /**
33
+ * Same as `getType` but implemented as getter
34
+ * @returns adapter type, e.g. 'gcs', 'b2', 'local' etc.
35
+ */
36
+ type: string;
37
+ /**
38
+ * Returns configuration settings that you've provided when instantiating as an object.
39
+ * Use this only for debugging and with great care as it may expose sensitive information.
40
+ *
41
+ * The object contains the key `bucketName` which is the initial value that you've set during
42
+ * initialization.
43
+ *
44
+ * The object also contains the key `options` which are only the options passed in during
45
+ * initialization; if you want all options, including the default options use `getOptions()`
46
+ *
47
+ * @returns adapter configuration as object
48
+ */
49
+ getConfig(): AdapterConfig;
50
+ /**
51
+ * Same as `getConfiguration` but implemented as getter
52
+ * @returns adapter configuration as object
53
+ */
54
+ config: AdapterConfig;
55
+ getConfigError(): null | string;
56
+ configError: null | string;
57
+ /**
58
+ * Returns an object that contains both the options passed with the configuration and the
59
+ * default options of the storage type if not overruled by the options you passed in.
60
+ */
61
+ /**
62
+ * @param name name of the bucket to create, returns "ok" once the bucket has been created but
63
+ * also when the bucket already exists.
64
+ * @param options: additional options for creating a bucket such as access rights
65
+ * @returns string or error
66
+ */
67
+ createBucket(name: string, options?: Options): Promise<ResultObject>;
68
+ /**
69
+ * @param name: deletes all file in the bucket.
70
+ */
71
+ clearBucket(name: string): Promise<ResultObject>;
72
+ /**
73
+ * deletes the bucket with the provided name
74
+ * @param {string} name name of the bucket
75
+ * @returns {Promise<ResultObject>} a promise that always resolves in a ResultObject:
76
+ * ```typescript
77
+ * { error: null | string, value: null | string }
78
+ * ```
79
+ */
80
+ deleteBucket(name: string): Promise<ResultObject>;
81
+ /**
82
+ * @returns an array of the names of the buckets in this storage
83
+ */
84
+ listBuckets(): Promise<ResultObjectBuckets>;
85
+ /**
86
+ * @param {filePathParams | FileBufferParams | FileStreamParams} params related to the file to be added
87
+ * @returns the public url to the file
88
+ * Called internally by addFileFromPath, addFileFromBuffer and addFileFromReadable
89
+ */
90
+ addFile(params: FilePathParams | FileBufferParams | FileStreamParams): Promise<ResultObject>;
91
+ /**
92
+ * @param {FilePathParams} params object that has the following keys:
93
+ * ```typescript
94
+ * {
95
+ * bucketName: string
96
+ * origPath: string //path to the file that you want to add, e.g. /home/user/Pictures/image1.jpg
97
+ * targetPath: string //path on the storage, you can add a path or only provide name of the file
98
+ * options?: object
99
+ * }
100
+ * ```
101
+ * @returns {ResultObject} a promise that always resolves in a ResultObject:
102
+ * ```typescript
103
+ * {
104
+ * value: string | null
105
+ * error: string | null
106
+ * }
107
+ * ```
108
+ */
109
+ addFileFromPath(params: FilePathParams): Promise<ResultObject>;
110
+ /**
111
+ * @param {FileBufferParams} params
112
+ * @property {string} FilePath.bucketName
113
+ * @property {Buffer} FilePath.buffer - buffer
114
+ * @property {string} FilePath.targetPath - path on the storage, you can add a path or only provide name of the file
115
+ * @property {object} FilePath.options
116
+ */
117
+ addFileFromBuffer(params: FileBufferParams): Promise<ResultObject>;
118
+ /**
119
+ * @param {FileStreamParams} params object that contains the following keys:
120
+ * ```typescript
121
+ * {
122
+ * bucketName: string
123
+ * readable: Readable // stream from the local file, e.g. fs.createReadStream(path)
124
+ * targetPath: string // path on the storage, you can add a path or only provide name of the file
125
+ * options?: object
126
+ * }
127
+ * ```
128
+ * @returns {ResultObject} a promise that always resolves in a ResultObject
129
+ * ```typescript
130
+ * {
131
+ * value: string | null // if success value is the public url to the file
132
+ * error: string | null // if fails error is the error message
133
+ * }
134
+ * ```
135
+ */
136
+ addFileFromStream(params: FileStreamParams): Promise<ResultObject>;
137
+ /**
138
+ * @param bucketName name of the bucket where the file is stored
139
+ * @param name name of the file to be returned as a readable stream
140
+ * @param start? the byte of the file where the stream starts (default: 0)
141
+ * @param end? the byte in the file where the stream ends (default: last byte of file)
142
+ */
143
+ getFileAsStream(bucketName: string, fileName: string, options?: StreamOptions): Promise<ResultObjectStream>;
144
+ /**
145
+ * @param bucketName name of the bucket where the file is stored
146
+ * @param fileName name of the file
147
+ */
148
+ getFileAsURL(bucketName: string, fileName: string, options?: Options): Promise<ResultObject>;
149
+ /**
150
+ * @param {string} bucketName name of the bucket where the file is stored
151
+ * @param {string} fileName name of the file to be removed
152
+ * @param {boolean} [allVersions = true] in case there are more versions of this file you can choose to remove
153
+ * all of them in one go or delete only the latest version (only if applicable such as with Backblaze B2 and S3
154
+ * when you've enabled versioning)
155
+ */
156
+ removeFile(bucketName: string, fileName: string, allVersions?: boolean): Promise<ResultObject>;
157
+ /**
158
+ * @param bucketName name of the bucket
159
+ * @param numFiles optional, only works for S3 compatible storages: the maximal number of files to retrieve
160
+ * @returns an array of tuples containing the file path and the file size of all files in the bucket.
161
+ */
162
+ listFiles(bucketName: string, numFiles?: number): Promise<ResultObjectFiles>;
163
+ /**
164
+ * @param bucketName name of the bucket where the file is stored
165
+ * @param fileName name of the file
166
+ * @returns the size of the file in bytes
167
+ */
168
+ sizeOf(bucketName: string, fileName: string): Promise<ResultObjectNumber>;
169
+ /**
170
+ * @param bucketName name of the bucket
171
+ * @returns boolean
172
+ */
173
+ bucketExists(bucketName: string): Promise<ResultObjectBoolean>;
174
+ /**
175
+ * @param bucketName name of the bucket where the file is stored
176
+ * @param fileName name of the file
177
+ */
178
+ fileExists(bucketName: string, fileName: string): Promise<ResultObjectBoolean>;
179
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StorageType = void 0;
4
+ // add your custom type here
5
+ var StorageType;
6
+ (function (StorageType) {
7
+ StorageType["LOCAL"] = "local";
8
+ StorageType["GCS"] = "gcs";
9
+ StorageType["S3"] = "s3";
10
+ StorageType["B2"] = "b2";
11
+ StorageType["AZURE"] = "azure";
12
+ StorageType["MINIO"] = "minio";
13
+ })(StorageType || (exports.StorageType = StorageType = {}));
14
+ //# sourceMappingURL=general.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"general.js","sourceRoot":"","sources":["../../../src/types/general.ts"],"names":[],"mappings":";;;AAUA,4BAA4B;AAC5B,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,0BAAW,CAAA;IACX,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,8BAAe,CAAA;IACf,8BAAe,CAAA;AACjB,CAAC,EAPW,WAAW,2BAAX,WAAW,QAOtB"}
@@ -0,0 +1,41 @@
1
+ /// <reference types="node" />
2
+ import { AdapterConfig } from "./general";
3
+ import { Readable } from "stream";
4
+ export type ParseUrlResult = {
5
+ error: string | null;
6
+ value: AdapterConfig;
7
+ };
8
+ export interface ResultObject {
9
+ error: string | null;
10
+ value: string | null;
11
+ }
12
+ export type ResultObjectNumber = {
13
+ error: string | null;
14
+ value: number | null;
15
+ };
16
+ export type ResultObjectBoolean = {
17
+ error: string | null;
18
+ value: boolean | null;
19
+ };
20
+ export type ResultObjectFiles = {
21
+ error: string | null;
22
+ value: Array<[string, number]> | null;
23
+ };
24
+ export type ResultObjectBuckets = {
25
+ error: string | null;
26
+ value: Array<string> | null;
27
+ };
28
+ export type ResultObjectStringArray = {
29
+ error: string | null;
30
+ value: Array<string> | null;
31
+ };
32
+ export type ResultObjectKeyValue = {
33
+ error: string | null;
34
+ value: {
35
+ [key: string]: any;
36
+ } | null;
37
+ };
38
+ export type ResultObjectStream = {
39
+ error: string | null;
40
+ value: Readable | null;
41
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/types/result.ts"],"names":[],"mappings":""}
package/dist/util.d.ts ADDED
@@ -0,0 +1,98 @@
1
+ import { ParseUrlResult, ResultObjectNumber } from "./types/result";
2
+ /**
3
+ * @param: url
4
+ * Converts url with querystring into key-value object
5
+ */
6
+ export declare const parseQueryString2: (url: string) => {
7
+ [id: string]: string;
8
+ };
9
+ /**
10
+ * @param url
11
+ * Parses a url into a key-value object.
12
+ */
13
+ export declare const parseUrl: (url: string, checkType?: boolean) => ParseUrlResult;
14
+ export declare const parseQueryString: (s: string, type?: string) => {
15
+ [id: string]: string;
16
+ };
17
+ /**
18
+ * @param {string} s
19
+ *
20
+ * Parses a string that contains a radix prefix to a number
21
+ *
22
+ */
23
+ export declare const parseIntFromString: (s: string) => number;
24
+ export declare const parseMode: (mode: number | string) => ResultObjectNumber;
25
+ /**
26
+ * @param {string} url
27
+ *
28
+ * strips off the protocol of an url and returns it
29
+ */
30
+ export declare const getProtocol: (url: string) => string;
31
+ /**
32
+ * @param {string} name
33
+ *
34
+ * Checks if the value of the name is not null or undefined
35
+ */
36
+ export declare const isBlankString: (str: string) => boolean;
37
+ /**
38
+ * @param {string} name
39
+ *
40
+ * Checks if the value of the name is not null, undefined or an empty string
41
+ */
42
+ export declare const validateName: (name: string) => string;
43
+ /**
44
+ * @param url
45
+ * Parses a url string into fragments and parses the query string into a
46
+ * key-value object.
47
+
48
+ export const parseUrl = (url: string): ParseUrlResult => {
49
+ if (url.indexOf("://") === -1) {
50
+ return { value: null, error: "Please provide a valid configuration url" };
51
+ }
52
+ const type = url.substring(0, url.indexOf("://"));
53
+ // if (Object.values(StorageType).includes(type as StorageType) === false) {
54
+ // return { value: null, error: `"${type}" is not a valid storage type` };
55
+ // }
56
+ let config = url.substring(url.indexOf("://") + 3);
57
+ const at = config.indexOf("@");
58
+ const questionMark = config.indexOf("?");
59
+ const colon = config.indexOf(":");
60
+ let part1 = "";
61
+ let part2 = "";
62
+ let part3 = "";
63
+ let bucketName = "";
64
+
65
+ // parse options
66
+ const queryString: { [key: string]: string } = parseQuerystring(url);
67
+ if (questionMark !== -1) {
68
+ config = config.substring(0, questionMark);
69
+ }
70
+ // console.log("config", config);
71
+
72
+ // get bucket name and region
73
+ let bucketString = "";
74
+ if (at !== -1) {
75
+ bucketString = config.substring(at + 1);
76
+ const slash = bucketString.indexOf("/");
77
+ if (slash !== -1) {
78
+ // Amazon S3 @region/bucket
79
+ bucketName = bucketString.substring(slash + 1);
80
+ part3 = bucketString.substring(0, slash);
81
+ } else {
82
+ bucketName = bucketString;
83
+ }
84
+ // console.log(bucketName, bucketString, slash);
85
+ config = config.substring(0, at);
86
+ }
87
+
88
+ // get credentials
89
+ if (colon !== -1) {
90
+ [part1, part2] = config.split(":");
91
+ } else {
92
+ part1 = config;
93
+ }
94
+
95
+ // console.log(type, part1, part2, region, bucketName, queryString);
96
+ return { error: null, value: { type, part1, part2, part3, bucketName, queryString } };
97
+ };
98
+ */
package/dist/util.js ADDED
@@ -0,0 +1,223 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateName = exports.isBlankString = exports.getProtocol = exports.parseMode = exports.parseIntFromString = exports.parseQueryString = exports.parseUrl = exports.parseQueryString2 = void 0;
4
+ const general_1 = require("./types/general");
5
+ /**
6
+ * @param: url
7
+ * Converts url with querystring into key-value object
8
+ */
9
+ const parseQueryString2 = (url) => {
10
+ let options = {};
11
+ const questionMark = url.indexOf("?");
12
+ if (questionMark !== -1) {
13
+ options = url
14
+ .substring(questionMark + 1)
15
+ .split("&")
16
+ .map((pair) => pair.split("="))
17
+ .reduce((acc, val) => {
18
+ // acc[val[0]] = `${val[1]}`.valueOf();
19
+ acc[val[0]] = val[1];
20
+ return acc;
21
+ }, {});
22
+ }
23
+ return options;
24
+ };
25
+ exports.parseQueryString2 = parseQueryString2;
26
+ /**
27
+ * @param url
28
+ * Parses a url into a key-value object.
29
+ */
30
+ const parseUrl = (url, checkType = false) => {
31
+ const p = url.indexOf("://");
32
+ let type;
33
+ let config;
34
+ if (p === -1) {
35
+ type = url;
36
+ config = { type };
37
+ }
38
+ else {
39
+ type = url.substring(0, p);
40
+ config = (0, exports.parseQueryString)(url.substring(p + 3), type);
41
+ }
42
+ if (checkType === true && Object.values(general_1.StorageType).includes(type) === false) {
43
+ return { value: null, error: `"${type}" is not a valid storage type` };
44
+ }
45
+ return { value: config, error: null };
46
+ };
47
+ exports.parseUrl = parseUrl;
48
+ const parseQueryString = (s, type) => {
49
+ return s
50
+ .split("&")
51
+ .map((pair) => pair.split("="))
52
+ .reduce((acc, val) => {
53
+ acc[val[0]] = val[1];
54
+ return acc;
55
+ }, type ? { type } : {});
56
+ };
57
+ exports.parseQueryString = parseQueryString;
58
+ /**
59
+ * @param {string} s
60
+ *
61
+ * Parses a string that contains a radix prefix to a number
62
+ *
63
+ */
64
+ const parseIntFromString = (s) => {
65
+ if (s.startsWith("0o")) {
66
+ return parseInt(s, 8);
67
+ }
68
+ if (s.startsWith("0x") || s.startsWith("0X")) {
69
+ return parseInt(s, 16);
70
+ }
71
+ if (s.startsWith("0b") || s.startsWith("0B")) {
72
+ return parseInt(s, 2);
73
+ }
74
+ return parseInt(s);
75
+ };
76
+ exports.parseIntFromString = parseIntFromString;
77
+ const parseMode = (mode) => {
78
+ // if mode is a number, parseMode assumes it is a decimal number
79
+ if (typeof mode === "number") {
80
+ if (mode < 0) {
81
+ return {
82
+ value: null,
83
+ error: `The argument 'mode' must be a 32-bit unsigned integer or an octal string. Received ${mode}`,
84
+ };
85
+ }
86
+ return { value: mode, error: null };
87
+ }
88
+ // mode is a string
89
+ // e.g "0o755" (octal string)
90
+ if (mode.startsWith("0o")) {
91
+ return { value: parseInt(mode.substring(2), 8), error: null };
92
+ }
93
+ // e.g '511' (decimal)
94
+ const i = parseInt(mode, 10);
95
+ // quick fix for erroneously passed octal number as string (without 0o prefix)
96
+ return { value: i > 511 ? 511 : i, error: null };
97
+ };
98
+ exports.parseMode = parseMode;
99
+ /**
100
+ * @param {string} url
101
+ *
102
+ * strips off the protocol of an url and returns it
103
+ */
104
+ const getProtocol = (url) => {
105
+ return;
106
+ };
107
+ exports.getProtocol = getProtocol;
108
+ /**
109
+ * @param {string} name
110
+ *
111
+ * Checks if the value of the name is not null or undefined
112
+ */
113
+ const isBlankString = (str) => {
114
+ return !str || /^\s*$/.test(str);
115
+ };
116
+ exports.isBlankString = isBlankString;
117
+ /**
118
+ * @param {string} name
119
+ *
120
+ * Checks if the value of the name is not null, undefined or an empty string
121
+ */
122
+ const validateName = (name) => {
123
+ if (name === null) {
124
+ return "Bucket name can not be `null`";
125
+ }
126
+ if (name === "null") {
127
+ return 'Please do not use the string "null" as bucket name';
128
+ }
129
+ if (typeof name === "undefined") {
130
+ return "Bucket name can not be `undefined`";
131
+ }
132
+ if (name === "undefined") {
133
+ return 'Please do not use the string "undefined" as bucket name';
134
+ }
135
+ if ((0, exports.isBlankString)(name)) {
136
+ return "Bucket name can not be an empty string";
137
+ }
138
+ return null;
139
+ };
140
+ exports.validateName = validateName;
141
+ /*
142
+ // not in use, keep for reference
143
+ export const getGCSProjectIdAsync = async (config: string): Promise<string> => {
144
+ const data = await fs.promises.readFile(config).catch(e => {
145
+ throw e;
146
+ });
147
+ const json = JSON.parse(data.toString("utf-8"));
148
+ return json.project_id;
149
+ };
150
+
151
+ // not in use, keep for reference
152
+ export const readFilePromise = (path: string): Promise<Buffer> =>
153
+ new Promise(function(resolve, reject) {
154
+ fs.readFile(path, function(err, data) {
155
+ if (err) {
156
+ reject(err);
157
+ } else {
158
+ resolve(data);
159
+ }
160
+ });
161
+ });
162
+
163
+ export const BucketLocationConstraintAsString = (c: BucketLocationConstraint): string => {
164
+ return;
165
+ };
166
+ */
167
+ /**
168
+ * @param url
169
+ * Parses a url string into fragments and parses the query string into a
170
+ * key-value object.
171
+
172
+ export const parseUrl = (url: string): ParseUrlResult => {
173
+ if (url.indexOf("://") === -1) {
174
+ return { value: null, error: "Please provide a valid configuration url" };
175
+ }
176
+ const type = url.substring(0, url.indexOf("://"));
177
+ // if (Object.values(StorageType).includes(type as StorageType) === false) {
178
+ // return { value: null, error: `"${type}" is not a valid storage type` };
179
+ // }
180
+ let config = url.substring(url.indexOf("://") + 3);
181
+ const at = config.indexOf("@");
182
+ const questionMark = config.indexOf("?");
183
+ const colon = config.indexOf(":");
184
+ let part1 = "";
185
+ let part2 = "";
186
+ let part3 = "";
187
+ let bucketName = "";
188
+
189
+ // parse options
190
+ const queryString: { [key: string]: string } = parseQuerystring(url);
191
+ if (questionMark !== -1) {
192
+ config = config.substring(0, questionMark);
193
+ }
194
+ // console.log("config", config);
195
+
196
+ // get bucket name and region
197
+ let bucketString = "";
198
+ if (at !== -1) {
199
+ bucketString = config.substring(at + 1);
200
+ const slash = bucketString.indexOf("/");
201
+ if (slash !== -1) {
202
+ // Amazon S3 @region/bucket
203
+ bucketName = bucketString.substring(slash + 1);
204
+ part3 = bucketString.substring(0, slash);
205
+ } else {
206
+ bucketName = bucketString;
207
+ }
208
+ // console.log(bucketName, bucketString, slash);
209
+ config = config.substring(0, at);
210
+ }
211
+
212
+ // get credentials
213
+ if (colon !== -1) {
214
+ [part1, part2] = config.split(":");
215
+ } else {
216
+ part1 = config;
217
+ }
218
+
219
+ // console.log(type, part1, part2, region, bucketName, queryString);
220
+ return { error: null, value: { type, part1, part2, part3, bucketName, queryString } };
221
+ };
222
+ */
223
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";;;AAAA,6CAA6D;AAG7D;;;GAGG;AACI,MAAM,iBAAiB,GAAG,CAAC,GAAW,EAA4B,EAAE;IACzE,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,MAAM,YAAY,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,YAAY,KAAK,CAAC,CAAC,EAAE,CAAC;QACxB,OAAO,GAAG,GAAG;aACV,SAAS,CAAC,YAAY,GAAG,CAAC,CAAC;aAC3B,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aAC9B,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YACnB,uCAAuC;YACvC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;YACrB,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAE,CAAC,CAAC;IACX,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAfW,QAAA,iBAAiB,qBAe5B;AAEF;;;GAGG;AACI,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,SAAS,GAAG,KAAK,EAAkB,EAAE;IACzE,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,IAAY,CAAC;IACjB,IAAI,MAAqB,CAAC;IAE1B,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QACb,IAAI,GAAG,GAAG,CAAC;QACX,MAAM,GAAG,EAAE,IAAI,EAAE,CAAC;IACpB,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,GAAG,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AAtBW,QAAA,SAAS,aAsBpB;AAEF;;;;GAIG;AACI,MAAM,WAAW,GAAG,CAAC,GAAW,EAAU,EAAE;IACjD,OAAO;AACT,CAAC,CAAC;AAFW,QAAA,WAAW,eAEtB;AAEF;;;;GAIG;AACI,MAAM,aAAa,GAAG,CAAC,GAAW,EAAW,EAAE;IACpD,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB;AAEF;;;;GAIG;AACI,MAAM,YAAY,GAAG,CAAC,IAAY,EAAU,EAAE;IACnD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,+BAA+B,CAAC;IACzC,CAAC;IACD,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,oDAAoD,CAAC;IAC9D,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;QAChC,OAAO,oCAAoC,CAAC;IAC9C,CAAC;IACD,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;QACzB,OAAO,yDAAyD,CAAC;IACnE,CAAC;IACD,IAAI,IAAA,qBAAa,EAAC,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,wCAAwC,CAAC;IAClD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAjBW,QAAA,YAAY,gBAiBvB;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;EAyBE;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuDE"}
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@tweedegolf/sab-adapter-backblaze-b2",
3
+ "version": "1.0.0",
4
+ "description": "Provides an abstraction layer for interacting with Backblaze B2 cloud service.",
5
+ "main": "dist/index/AdapterBackblazeB2.js",
6
+ "types": "dist/index/AdapterBackblazeB2.d.ts",
7
+ "homepage": "https://github.com/tweedegolf/storage-abstraction/",
8
+ "repository": "https://github.com/tweedegolf/storage-abstraction/",
9
+ "dependencies": {
10
+ "backblaze-b2": "^1.7.0"
11
+ },
12
+ "scripts": {},
13
+ "keywords": [
14
+ "backblaze b2",
15
+ "amazon s3",
16
+ "storage",
17
+ "storage abstraction",
18
+ "cloud filesystem",
19
+ "google cloud",
20
+ "cloudflare r2",
21
+ "cubbit",
22
+ "minio",
23
+ "azure"
24
+ ],
25
+ "author": "daniel@tweedegolf.nl",
26
+ "license": "MIT",
27
+ "publishConfig": {
28
+ "access": "public"
29
+ }
30
+ }