mirror of
https://github.com/appwrite/appwrite
synced 2026-05-22 08:28:42 +00:00
commit
4f905e06e2
16 changed files with 52 additions and 14 deletions
|
|
@ -0,0 +1,22 @@
|
|||
import { Client, Migrations } from "@appwrite.io/console";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const migrations = new Migrations(client);
|
||||
|
||||
const result = await migrations.createCSVExport({
|
||||
resourceId: '<ID1:ID2>',
|
||||
bucketId: '<BUCKET_ID>',
|
||||
filename: '<FILENAME>',
|
||||
columns: [], // optional
|
||||
queries: [], // optional
|
||||
delimiter: '<DELIMITER>', // optional
|
||||
enclosure: '<ENCLOSURE>', // optional
|
||||
escape: '<ESCAPE>', // optional
|
||||
header: false, // optional
|
||||
notify: false // optional
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
import { Client, Migrations } from "@appwrite.io/console";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
const migrations = new Migrations(client);
|
||||
|
||||
const result = await migrations.createCSVImport({
|
||||
bucketId: '<BUCKET_ID>',
|
||||
fileId: '<FILE_ID>',
|
||||
resourceId: '<ID1:ID2>',
|
||||
internalFile: false // optional
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
|
|
@ -11,7 +11,7 @@ const result = await databases.createCollection({
|
|||
databaseId: '<DATABASE_ID>',
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
name: '<NAME>',
|
||||
permissions: ["read("any")"], // optional
|
||||
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
|
||||
documentSecurity: false, // optional
|
||||
enabled: false // optional
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,6 +18,6 @@ const result = await databases.createDocument({
|
|||
"age": 30,
|
||||
"isAdmin": false
|
||||
},
|
||||
permissions: ["read("any")"], // optional
|
||||
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
|
||||
transactionId: '<TRANSACTION_ID>' // optional
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ const result = await databases.updateCollection({
|
|||
databaseId: '<DATABASE_ID>',
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
name: '<NAME>',
|
||||
permissions: ["read("any")"], // optional
|
||||
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
|
||||
documentSecurity: false, // optional
|
||||
enabled: false // optional
|
||||
});
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@ const result = await databases.updateDocument({
|
|||
collectionId: '<COLLECTION_ID>',
|
||||
documentId: '<DOCUMENT_ID>',
|
||||
data: {}, // optional
|
||||
permissions: ["read("any")"], // optional
|
||||
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
|
||||
transactionId: '<TRANSACTION_ID>' // optional
|
||||
});
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@ const result = await databases.upsertDocument({
|
|||
collectionId: '<COLLECTION_ID>',
|
||||
documentId: '<DOCUMENT_ID>',
|
||||
data: {},
|
||||
permissions: ["read("any")"], // optional
|
||||
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
|
||||
transactionId: '<TRANSACTION_ID>' // optional
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ const storage = new sdk.Storage(client);
|
|||
const result = await storage.createBucket({
|
||||
bucketId: '<BUCKET_ID>',
|
||||
name: '<NAME>',
|
||||
permissions: ["read("any")"], // optional
|
||||
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
|
||||
fileSecurity: false, // optional
|
||||
enabled: false, // optional
|
||||
maximumFileSize: 1, // optional
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@ const result = await storage.createFile({
|
|||
bucketId: '<BUCKET_ID>',
|
||||
fileId: '<FILE_ID>',
|
||||
file: InputFile.fromPath('/path/to/file', 'filename'),
|
||||
permissions: ["read("any")"] // optional
|
||||
permissions: [sdk.Permission.read(sdk.Role.any())] // optional
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ const storage = new sdk.Storage(client);
|
|||
const result = await storage.updateBucket({
|
||||
bucketId: '<BUCKET_ID>',
|
||||
name: '<NAME>',
|
||||
permissions: ["read("any")"], // optional
|
||||
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
|
||||
fileSecurity: false, // optional
|
||||
enabled: false, // optional
|
||||
maximumFileSize: 1, // optional
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@ const result = await storage.updateFile({
|
|||
bucketId: '<BUCKET_ID>',
|
||||
fileId: '<FILE_ID>',
|
||||
name: '<NAME>', // optional
|
||||
permissions: ["read("any")"] // optional
|
||||
permissions: [sdk.Permission.read(sdk.Role.any())] // optional
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,6 +18,6 @@ const result = await tablesDB.createRow({
|
|||
"age": 30,
|
||||
"isAdmin": false
|
||||
},
|
||||
permissions: ["read("any")"], // optional
|
||||
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
|
||||
transactionId: '<TRANSACTION_ID>' // optional
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ const result = await tablesDB.createTable({
|
|||
databaseId: '<DATABASE_ID>',
|
||||
tableId: '<TABLE_ID>',
|
||||
name: '<NAME>',
|
||||
permissions: ["read("any")"], // optional
|
||||
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
|
||||
rowSecurity: false, // optional
|
||||
enabled: false // optional
|
||||
});
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@ const result = await tablesDB.updateRow({
|
|||
tableId: '<TABLE_ID>',
|
||||
rowId: '<ROW_ID>',
|
||||
data: {}, // optional
|
||||
permissions: ["read("any")"], // optional
|
||||
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
|
||||
transactionId: '<TRANSACTION_ID>' // optional
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ const result = await tablesDB.updateTable({
|
|||
databaseId: '<DATABASE_ID>',
|
||||
tableId: '<TABLE_ID>',
|
||||
name: '<NAME>',
|
||||
permissions: ["read("any")"], // optional
|
||||
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
|
||||
rowSecurity: false, // optional
|
||||
enabled: false // optional
|
||||
});
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@ const result = await tablesDB.upsertRow({
|
|||
tableId: '<TABLE_ID>',
|
||||
rowId: '<ROW_ID>',
|
||||
data: {}, // optional
|
||||
permissions: ["read("any")"], // optional
|
||||
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
|
||||
transactionId: '<TRANSACTION_ID>' // optional
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue