@tweedegolf/sab-adapter-backblaze-b2 3.0.0 → 3.0.2

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/changelog.md CHANGED
@@ -1,4 +1,13 @@
1
+ # 3.0.2
2
+
3
+ - update dependencies
4
+
5
+ # 3.0.1
6
+
7
+ - added option `checkIfBucketExists` to the `addFile`, `addFileFromPath`, `addFileFromBuffer` and `addFileFromStream`
8
+
1
9
  # 3.0.0
10
+
2
11
  - version bump to match the version of Storage and the API
3
12
  - removed support for versioning (wasn't implemented consistently anyway)
4
13
  - removed `getFileAsURL`
@@ -8,15 +17,19 @@
8
17
  - see also the [migration guide](https://github.com/tweedegolf/storage-abstraction/blob/master/migration_to_api3.0.md)
9
18
 
10
19
  # 1.0.7
20
+
11
21
  - include @deprecated functions
12
22
 
13
23
  # 1.0.6
24
+
14
25
  - implemented new API methods `bucketIsPublic`, `getPublicURL` and `getSignedURL`
15
26
 
16
27
  # 1.0.5
28
+
17
29
  - fix bug in selected bucket
18
30
 
19
31
  # 1.0.3
32
+
20
33
  - revert to v1 format of config URLs
21
34
  - re-implement storing the selected bucket in local state
22
35
  - `selectBucket` and `geSelectedBucket`
@@ -3,25 +3,25 @@ import { FileBufferParams, FilePathParams, FileStreamParams } from "./types/add_
3
3
  import { ResultObject, ResultObjectBoolean, ResultObjectBuckets, ResultObjectFiles, ResultObjectNumber, ResultObjectObject, ResultObjectStream } from "./types/result";
4
4
  export declare abstract class AbstractAdapter implements IAdapter {
5
5
  protected _provider: Provider;
6
- protected _config: AdapterConfig | null;
7
- protected _configError: string | null;
8
- protected _bucketName: string;
6
+ protected _config: AdapterConfig;
9
7
  protected _client: any;
8
+ protected _configError: null | string;
9
+ protected _bucketName: null | string;
10
10
  constructor(config: string | AdapterConfig);
11
11
  get provider(): Provider;
12
12
  getProvider(): Provider;
13
13
  get config(): AdapterConfig;
14
14
  getConfig(): AdapterConfig;
15
- get configError(): string;
16
- getConfigError(): string;
15
+ get configError(): null | string;
16
+ getConfigError(): null | string;
17
17
  get serviceClient(): any;
18
18
  getServiceClient(): any;
19
- setSelectedBucket(bucketName: string | null): void;
20
- getSelectedBucket(): string | null;
21
- set selectedBucket(bucketName: string | null);
22
- get selectedBucket(): string | null;
23
- set bucketName(bucketName: string | null);
24
- get bucketName(): string | null;
19
+ setSelectedBucket(bucketName: null | string): void;
20
+ getSelectedBucket(): null | string;
21
+ set selectedBucket(bucketName: null | string);
22
+ get selectedBucket(): null | string;
23
+ set bucketName(bucketName: null | string);
24
+ get bucketName(): null | string;
25
25
  private getFileAndBucketAndOptions;
26
26
  private checkBucket;
27
27
  private checkFile;
@@ -41,76 +41,21 @@ export declare abstract class AbstractAdapter implements IAdapter {
41
41
  protected abstract _removeFile(bucketName: string, fileName: string): Promise<ResultObject>;
42
42
  protected abstract _getPresignedUploadURL(bucketName: string, fileName: string, options: Options): Promise<ResultObjectObject>;
43
43
  listBuckets(): Promise<ResultObjectBuckets>;
44
- createBucket(...args: [
45
- bucketName?: string,
46
- options?: Options
47
- ] | [
48
- options?: Options
49
- ]): Promise<ResultObject>;
44
+ createBucket(...args: [bucketName?: string, options?: Options] | [options?: Options]): Promise<ResultObject>;
50
45
  clearBucket(name?: string): Promise<ResultObject>;
51
46
  deleteBucket(name?: string): Promise<ResultObject>;
52
47
  bucketExists(name?: string): Promise<ResultObjectBoolean>;
53
48
  bucketIsPublic(name?: string): Promise<ResultObjectBoolean>;
54
- listFiles(...args: [
55
- bucketName?: string,
56
- numFiles?: number
57
- ] | [
58
- numFiles?: number
59
- ] | [
60
- bucketName?: string
61
- ]): Promise<ResultObjectFiles>;
49
+ listFiles(...args: [bucketName?: string, numFiles?: number] | [numFiles?: number] | [bucketName?: string]): Promise<ResultObjectFiles>;
62
50
  addFileFromPath(params: FilePathParams): Promise<ResultObject>;
63
51
  addFileFromBuffer(params: FileBufferParams): Promise<ResultObject>;
64
52
  addFileFromStream(params: FileStreamParams): Promise<ResultObject>;
65
53
  addFile(params: FilePathParams | FileBufferParams | FileStreamParams): Promise<ResultObject>;
66
- getFileAsStream(...args: [
67
- bucketName: string,
68
- fileName: string,
69
- options?: StreamOptions
70
- ] | [
71
- fileName: string,
72
- options?: StreamOptions
73
- ]): Promise<ResultObjectStream>;
74
- getPublicURL(...args: [
75
- bucketName: string,
76
- fileName: string,
77
- options?: Options
78
- ] | [
79
- fileName: string,
80
- options?: Options
81
- ]): Promise<ResultObject>;
82
- getSignedURL(...args: [
83
- bucketName: string,
84
- fileName: string,
85
- options?: Options
86
- ] | [
87
- fileName: string,
88
- options?: Options
89
- ]): Promise<ResultObject>;
90
- sizeOf(...args: [
91
- bucketName: string,
92
- fileName: string
93
- ] | [
94
- fileName: string
95
- ]): Promise<ResultObjectNumber>;
96
- fileExists(...args: [
97
- bucketName: string,
98
- fileName: string
99
- ] | [
100
- fileName: string
101
- ]): Promise<ResultObjectBoolean>;
102
- removeFile(...args: [
103
- bucketName: string,
104
- fileName: string
105
- ] | [
106
- fileName: string
107
- ]): Promise<ResultObject>;
108
- getPresignedUploadURL(...args: [
109
- bucketName: string,
110
- fileName: string,
111
- options?: Options
112
- ] | [
113
- fileName: string,
114
- options?: Options
115
- ]): Promise<ResultObjectObject>;
54
+ getFileAsStream(...args: [bucketName: string, fileName: string, options?: StreamOptions] | [fileName: string, options?: StreamOptions]): Promise<ResultObjectStream>;
55
+ getPublicURL(...args: [bucketName: string, fileName: string, options?: Options] | [fileName: string, options?: Options]): Promise<ResultObject>;
56
+ getSignedURL(...args: [bucketName: string, fileName: string, options?: Options] | [fileName: string, options?: Options]): Promise<ResultObject>;
57
+ sizeOf(...args: [bucketName: string, fileName: string] | [fileName: string]): Promise<ResultObjectNumber>;
58
+ fileExists(...args: [bucketName: string, fileName: string] | [fileName: string]): Promise<ResultObjectBoolean>;
59
+ removeFile(...args: [bucketName: string, fileName: string] | [fileName: string]): Promise<ResultObject>;
60
+ getPresignedUploadURL(...args: [bucketName: string, fileName: string, options?: Options] | [fileName: string, options?: Options]): Promise<ResultObjectObject>;
116
61
  }