@darseen/vaze 1.2.1 → 2.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.
- package/README.md +2 -2
- package/dist/index.cjs +16 -0
- package/dist/index.d.cts +15 -6
- package/dist/index.d.ts +15 -6
- package/dist/index.js +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -132,7 +132,7 @@ Folders API Access folder-related methods via `vaze.folders`. `get(options?)` Re
|
|
|
132
132
|
|
|
133
133
|
- options (optional):
|
|
134
134
|
- `id`
|
|
135
|
-
- `
|
|
135
|
+
- `key` example: "projects/work"
|
|
136
136
|
- `limit`
|
|
137
137
|
- `offset`
|
|
138
138
|
- `orderBy`
|
|
@@ -140,7 +140,7 @@ Folders API Access folder-related methods via `vaze.folders`. `get(options?)` Re
|
|
|
140
140
|
|
|
141
141
|
```ts
|
|
142
142
|
const { data, error } = await vaze.folders.get({
|
|
143
|
-
|
|
143
|
+
key: "documents/work",
|
|
144
144
|
limit: 20,
|
|
145
145
|
});
|
|
146
146
|
|
package/dist/index.cjs
CHANGED
|
@@ -163,6 +163,22 @@ var Files = class extends Base {
|
|
|
163
163
|
} : null
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
+
async getByKey(key) {
|
|
167
|
+
const url = this.apiUrl("/api/files", { key });
|
|
168
|
+
const { data, error } = await this.request(
|
|
169
|
+
"GET",
|
|
170
|
+
url
|
|
171
|
+
);
|
|
172
|
+
return {
|
|
173
|
+
error,
|
|
174
|
+
data: data ? {
|
|
175
|
+
file: constructFileUrls({
|
|
176
|
+
vazeUrl: this.vazeUrl,
|
|
177
|
+
files: [data.file]
|
|
178
|
+
})[0]
|
|
179
|
+
} : null
|
|
180
|
+
};
|
|
181
|
+
}
|
|
166
182
|
async getByName(name, options) {
|
|
167
183
|
const url = this.apiUrl("/api/files", { name, ...options });
|
|
168
184
|
const { error, data } = await this.request(
|
package/dist/index.d.cts
CHANGED
|
@@ -494,8 +494,8 @@ declare const files: SQLiteTableWithColumns<{
|
|
|
494
494
|
}, {}, {
|
|
495
495
|
length: number | undefined;
|
|
496
496
|
}>;
|
|
497
|
-
|
|
498
|
-
name: "
|
|
497
|
+
key: SQLiteColumn<{
|
|
498
|
+
name: "key";
|
|
499
499
|
tableName: "files";
|
|
500
500
|
dataType: "string";
|
|
501
501
|
columnType: "SQLiteText";
|
|
@@ -513,8 +513,8 @@ declare const files: SQLiteTableWithColumns<{
|
|
|
513
513
|
}, {}, {
|
|
514
514
|
length: number | undefined;
|
|
515
515
|
}>;
|
|
516
|
-
|
|
517
|
-
name: "
|
|
516
|
+
mimeType: SQLiteColumn<{
|
|
517
|
+
name: "mime_type";
|
|
518
518
|
tableName: "files";
|
|
519
519
|
dataType: "string";
|
|
520
520
|
columnType: "SQLiteText";
|
|
@@ -653,8 +653,8 @@ declare const folders: SQLiteTableWithColumns<{
|
|
|
653
653
|
}, {}, {
|
|
654
654
|
length: number | undefined;
|
|
655
655
|
}>;
|
|
656
|
-
|
|
657
|
-
name: "
|
|
656
|
+
key: SQLiteColumn<{
|
|
657
|
+
name: "key";
|
|
658
658
|
tableName: "folders";
|
|
659
659
|
dataType: "string";
|
|
660
660
|
columnType: "SQLiteText";
|
|
@@ -726,6 +726,14 @@ declare class Files extends Base {
|
|
|
726
726
|
file: any;
|
|
727
727
|
} | null;
|
|
728
728
|
}>;
|
|
729
|
+
getByKey(key: string): Promise<{
|
|
730
|
+
error: {
|
|
731
|
+
message: string;
|
|
732
|
+
} | null;
|
|
733
|
+
data: {
|
|
734
|
+
file: any;
|
|
735
|
+
} | null;
|
|
736
|
+
}>;
|
|
729
737
|
getByName(name: string, options?: ListOptions): Promise<{
|
|
730
738
|
error: {
|
|
731
739
|
message: string;
|
|
@@ -760,6 +768,7 @@ declare class Files extends Base {
|
|
|
760
768
|
declare class Folders extends Base {
|
|
761
769
|
get(options?: ListOptions & {
|
|
762
770
|
id?: string;
|
|
771
|
+
key?: string;
|
|
763
772
|
path?: string;
|
|
764
773
|
}): Promise<{
|
|
765
774
|
error: {
|
package/dist/index.d.ts
CHANGED
|
@@ -494,8 +494,8 @@ declare const files: SQLiteTableWithColumns<{
|
|
|
494
494
|
}, {}, {
|
|
495
495
|
length: number | undefined;
|
|
496
496
|
}>;
|
|
497
|
-
|
|
498
|
-
name: "
|
|
497
|
+
key: SQLiteColumn<{
|
|
498
|
+
name: "key";
|
|
499
499
|
tableName: "files";
|
|
500
500
|
dataType: "string";
|
|
501
501
|
columnType: "SQLiteText";
|
|
@@ -513,8 +513,8 @@ declare const files: SQLiteTableWithColumns<{
|
|
|
513
513
|
}, {}, {
|
|
514
514
|
length: number | undefined;
|
|
515
515
|
}>;
|
|
516
|
-
|
|
517
|
-
name: "
|
|
516
|
+
mimeType: SQLiteColumn<{
|
|
517
|
+
name: "mime_type";
|
|
518
518
|
tableName: "files";
|
|
519
519
|
dataType: "string";
|
|
520
520
|
columnType: "SQLiteText";
|
|
@@ -653,8 +653,8 @@ declare const folders: SQLiteTableWithColumns<{
|
|
|
653
653
|
}, {}, {
|
|
654
654
|
length: number | undefined;
|
|
655
655
|
}>;
|
|
656
|
-
|
|
657
|
-
name: "
|
|
656
|
+
key: SQLiteColumn<{
|
|
657
|
+
name: "key";
|
|
658
658
|
tableName: "folders";
|
|
659
659
|
dataType: "string";
|
|
660
660
|
columnType: "SQLiteText";
|
|
@@ -726,6 +726,14 @@ declare class Files extends Base {
|
|
|
726
726
|
file: any;
|
|
727
727
|
} | null;
|
|
728
728
|
}>;
|
|
729
|
+
getByKey(key: string): Promise<{
|
|
730
|
+
error: {
|
|
731
|
+
message: string;
|
|
732
|
+
} | null;
|
|
733
|
+
data: {
|
|
734
|
+
file: any;
|
|
735
|
+
} | null;
|
|
736
|
+
}>;
|
|
729
737
|
getByName(name: string, options?: ListOptions): Promise<{
|
|
730
738
|
error: {
|
|
731
739
|
message: string;
|
|
@@ -760,6 +768,7 @@ declare class Files extends Base {
|
|
|
760
768
|
declare class Folders extends Base {
|
|
761
769
|
get(options?: ListOptions & {
|
|
762
770
|
id?: string;
|
|
771
|
+
key?: string;
|
|
763
772
|
path?: string;
|
|
764
773
|
}): Promise<{
|
|
765
774
|
error: {
|
package/dist/index.js
CHANGED
|
@@ -163,6 +163,22 @@ var Files = class extends Base {
|
|
|
163
163
|
} : null
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
+
async getByKey(key) {
|
|
167
|
+
const url = this.apiUrl("/api/files", { key });
|
|
168
|
+
const { data, error } = await this.request(
|
|
169
|
+
"GET",
|
|
170
|
+
url
|
|
171
|
+
);
|
|
172
|
+
return {
|
|
173
|
+
error,
|
|
174
|
+
data: data ? {
|
|
175
|
+
file: constructFileUrls({
|
|
176
|
+
vazeUrl: this.vazeUrl,
|
|
177
|
+
files: [data.file]
|
|
178
|
+
})[0]
|
|
179
|
+
} : null
|
|
180
|
+
};
|
|
181
|
+
}
|
|
166
182
|
async getByName(name, options) {
|
|
167
183
|
const url = this.apiUrl("/api/files", { name, ...options });
|
|
168
184
|
const { error, data } = await this.request(
|