naystack - v1.9.9
    Preparing search index...
    • Wires up the create → wait → publish flow Meta platforms share. Instagram and Threads differ only in their endpoints, so each builds one publisher and every post shape goes through it.

      Parameters

      • platform: {
            createContainer: (
                token: string,
                params: GraphParams,
            ) => Promise<string | null>;
            getStatus: (token: string, id: string) => Promise<ContainerState | null>;
            name: string;
            publish: (token: string, creationID: string) => Promise<string | null>;
        }
        • createContainer: (token: string, params: GraphParams) => Promise<string | null>

          Creates a container, resolving to its id.

        • getStatus: (token: string, id: string) => Promise<ContainerState | null>

          Reads a container's state by id.

        • name: string

          Used in error logs, e.g. "Instagram".

        • publish: (token: string, creationID: string) => Promise<string | null>

          Publishes a finished container, resolving to the post id.

      Returns {
          createChildren: (
              token: string,
              items: GraphParams[],
              wait?: PollOptions,
              retry?: RetryOptions,
          ) => Promise<string[] | null>;
          publish: (
              token: string,
              params: GraphParams,
              wait?: PollOptions,
              retry?: RetryOptions,
          ) => Promise<string | null>;
      }

      { publish, createChildren }.

      • createChildren: (
            token: string,
            items: GraphParams[],
            wait?: PollOptions,
            retry?: RetryOptions,
        ) => Promise<string[] | null>

        Creates and awaits every carousel child in parallel, resolving to their ids in input order — or null if any failed.

        Parallel because each child is an independent create-then-poll and Meta spends ~5s accepting a single container, so ten sequential children cost ~50s of mostly waiting — past what a serverless caller can fit in its timeout. Promise.all preserves input order, which the carousel's slide order depends on.

      • publish: (
            token: string,
            params: GraphParams,
            wait?: PollOptions,
            retry?: RetryOptions,
        ) => Promise<string | null>

        Creates a container, waits for it to finish processing, then publishes it.