appwrite-utils-cli 0.10.71 → 0.10.72
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.
@@ -1,12 +1,9 @@
|
|
1
1
|
import { AppwriteException, Client, Functions, Query, Runtime, } from "node-appwrite";
|
2
|
-
import {
|
3
|
-
import { join, dirname } from "node:path";
|
2
|
+
import { join } from "node:path";
|
4
3
|
import fs from "node:fs";
|
5
4
|
import {} from "appwrite-utils";
|
6
5
|
import chalk from "chalk";
|
7
6
|
import { extract as extractTar } from "tar";
|
8
|
-
const __filename = fileURLToPath(import.meta.url);
|
9
|
-
const __dirname = dirname(__filename);
|
10
7
|
export const listFunctions = async (client, queries, search) => {
|
11
8
|
const functions = new Functions(client);
|
12
9
|
const functionsList = await functions.list(queries, search);
|
@@ -84,7 +84,7 @@ export const transferStorageLocalToLocal = async (storage, fromBucketId, toBucke
|
|
84
84
|
};
|
85
85
|
export const transferStorageLocalToRemote = async (localStorage, endpoint, projectId, apiKey, fromBucketId, toBucketId) => {
|
86
86
|
console.log(`Transferring files from current storage ${fromBucketId} to ${endpoint} bucket ${toBucketId}`);
|
87
|
-
const client = getAppwriteClient(endpoint,
|
87
|
+
const client = getAppwriteClient(endpoint, projectId, apiKey);
|
88
88
|
const remoteStorage = new Storage(client);
|
89
89
|
let numberOfFiles = 0;
|
90
90
|
let lastFileId;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "appwrite-utils-cli",
|
3
3
|
"description": "Appwrite Utility Functions to help with database management, data conversion, data import, migrations, and much more. Meant to be used as a CLI tool, I do not recommend installing this in frontend environments.",
|
4
|
-
"version": "0.10.
|
4
|
+
"version": "0.10.72",
|
5
5
|
"main": "src/main.ts",
|
6
6
|
"type": "module",
|
7
7
|
"repository": {
|
package/src/functions/methods.ts
CHANGED
@@ -5,8 +5,7 @@ import {
|
|
5
5
|
Query,
|
6
6
|
Runtime,
|
7
7
|
} from "node-appwrite";
|
8
|
-
import {
|
9
|
-
import { join, dirname } from "node:path";
|
8
|
+
import { join } from "node:path";
|
10
9
|
import fs from "node:fs";
|
11
10
|
import {
|
12
11
|
type AppwriteFunction,
|
@@ -16,9 +15,6 @@ import {
|
|
16
15
|
import chalk from "chalk";
|
17
16
|
import { extract as extractTar } from "tar";
|
18
17
|
|
19
|
-
const __filename = fileURLToPath(import.meta.url);
|
20
|
-
const __dirname = dirname(__filename);
|
21
|
-
|
22
18
|
export const listFunctions = async (
|
23
19
|
client: Client,
|
24
20
|
queries?: string[],
|
@@ -158,7 +158,7 @@ export const transferStorageLocalToRemote = async (
|
|
158
158
|
console.log(
|
159
159
|
`Transferring files from current storage ${fromBucketId} to ${endpoint} bucket ${toBucketId}`
|
160
160
|
);
|
161
|
-
const client = getAppwriteClient(endpoint,
|
161
|
+
const client = getAppwriteClient(endpoint, projectId, apiKey);
|
162
162
|
const remoteStorage = new Storage(client);
|
163
163
|
let numberOfFiles = 0;
|
164
164
|
let lastFileId: string | undefined;
|