Edits history of script submission #355 for ' Append Block Children (notion)'

  • deno
    import { Client } from "npm:@notionhq/client";
    import type { BlockObjectRequest } from "npm:@notionhq/client/2.2.4/build/src/api-endpoints.js";
    
    /**
     * Learn more at
     * https://developers.notion.com/reference/patch-block-children
     */
    type Notion = {
      token: string;
    };
    export async function main(
      auth: Notion,
      block_id: string,
      children: object[] = [],
    ) {
      const client = new Client({ auth: auth.token });
      return await client.blocks.children.append({
        block_id,
        children: children as BlockObjectRequest,
      });
    }
    

    Submitted by hugo697 398 days ago

  • deno
    import { Client } from "npm:@notionhq/client";
    import type { BlockObjectRequest } from "npm:@notionhq/client/2.2.4/build/src/api-endpoints.js";
    
    /**
     * Learn more at
     * https://developers.notion.com/reference/patch-block-children
     */
    type Notion = {
      token: string;
    };
    export async function main(
      auth: Notion,
      block_id: string,
      children: object[] = [],
    ) {
      const client = new Client({ auth: auth.token });
      return await client.blocks.children.append({
        block_id,
        children: children as BlockObjectRequest,
      });
    }
    

    Submitted by admin 1034 days ago

  • deno
    import { Resource } from "https://deno.land/x/[email protected]/mod.ts";
    import { Client } from "npm:@notionhq/client";
    import type { BlockObjectRequest } from "npm:@notionhq/client/2.2.4/build/src/api-endpoints.js";
    
    /**
     * Learn more at
     * https://developers.notion.com/reference/patch-block-children
     */
    export async function main(
      auth: Resource<"notion">,
      block_id: string,
      children: object[] = [],
    ) {
      const client = new Client({ auth: auth.token });
      return await client.blocks.children.append({
        block_id,
        children: children as BlockObjectRequest,
      });
    }
    

    Submitted by adam186 1141 days ago