Edits history of script submission #329 for ' Create Collection (appwrite)'

  • deno
    import {
      Client,
      Databases,
      ID,
    } from "https://deno.land/x/[email protected]/mod.ts";
    
    /**
     * @param collection_id ID of the collection to be created. Leave blank to generate a unique ID.
     */
    type Appwrite = {
      endpoint: string;
      project: string;
      key: string;
      self_signed: boolean;
    };
    export async function main(
      auth: Appwrite,
      database_id: string,
      collection_name: string,
      collection_id?: string,
      collection_permissions?: string[],
      collection_document_security?: boolean,
    ) {
      const client = new Client()
        .setEndpoint(auth.endpoint)
        .setProject(auth.project)
        .setKey(auth.key);
      const db = new Databases(client);
    
      return await db.createCollection(
        database_id,
        collection_id || ID.unique(),
        collection_name,
        collection_permissions,
        collection_document_security,
      );
    }
    

    Submitted by hugo697 393 days ago

  • deno
    import {
      Client,
      Databases,
      ID,
    } from "https://deno.land/x/[email protected]/mod.ts";
    
    /**
     * @param collection_id ID of the collection to be created. Leave blank to generate a unique ID.
     */
    type Appwrite = {
      endpoint: string;
      project: string;
      key: string;
      self_signed: boolean;
    };
    export async function main(
      auth: Appwrite,
      database_id: string,
      collection_name: string,
      collection_id?: string,
      collection_permissions?: string[],
      collection_document_security?: boolean,
    ) {
      const client = new Client()
        .setEndpoint(auth.endpoint)
        .setProject(auth.project)
        .setKey(auth.key);
      const db = new Databases(client);
    
      return await db.createCollection(
        database_id,
        collection_id || ID.unique(),
        collection_name,
        collection_permissions,
        collection_document_security,
      );
    }
    

    Submitted by admin 1026 days ago

  • deno
    import { Client, Databases, ID } from "https://deno.land/x/[email protected]/mod.ts";
    
    /**
     * @param collection_id ID of the collection to be created. Leave blank to generate a unique ID.
     */
    type Appwrite = {
      endpoint: string;
      project: string;
      key: string;
      self_signed: boolean;
    };
    export async function main(
      auth: Appwrite,
      database_id: string,
      collection_name: string,
      collection_id?: string,
      collection_permissions?: string[],
      collection_document_security?: boolean,
    ) {
      const client = new Client()
        .setEndpoint(auth.endpoint)
        .setProject(auth.project)
        .setKey(auth.key)
      const db = new Databases(client);
    
      return await db.createCollection(
        database_id,
        collection_id || ID.unique(),
        collection_name,
        collection_permissions,
        collection_document_security
      )
    }
    

    Submitted by admin 1029 days ago

  • deno
    import { Resource } from "https://deno.land/x/[email protected]/mod.ts"
    import { Client, Databases, ID } from "https://deno.land/x/[email protected]/mod.ts";
    
    /**
     * @param collection_id ID of the collection to be created. Leave blank to generate a unique ID.
     */
    export async function main(
      auth: Resource<'appwrite'>,
      database_id: string,
      collection_name: string,
      collection_id?: string,
      collection_permissions?: string[],
      collection_document_security?: boolean,
    ) {
      const client = new Client()
        .setEndpoint(auth.endpoint)
        .setProject(auth.project)
        .setKey(auth.key)
      const db = new Databases(client);
    
      return await db.createCollection(
        database_id,
        collection_id || ID.unique(),
        collection_name,
        collection_permissions,
        collection_document_security
      )
    }
    

    Submitted by adam186 1144 days ago

  • deno
    import { Resource } from "https://deno.land/x/[email protected]/mod.ts"
    import { Client, Databases, ID } from "https://deno.land/x/[email protected]/mod.ts";
    
    /**
     * @param id ID of the collection to be created. Leave blank to generate a unique ID.
     */
    export async function main(
      auth: Resource<'appwrite'>,
      database_id: string,
      collection_name: string,
      collection_id?: string,
      collection_permissions?: string[],
      collection_document_security?: boolean,
    ) {
      const client = new Client()
        .setEndpoint(auth.endpoint)
        .setProject(auth.project)
        .setKey(auth.key)
      const db = new Databases(client);
    
      return await db.createCollection(
        database_id,
        collection_id || ID.unique(),
        collection_name,
        collection_permissions,
        collection_document_security
      )
    }
    

    Submitted by adam186 1144 days ago