@puckeditor/cloud-client 0.1.0-canary.a2742ff6 → 0.1.0-canary.a634481a

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.
package/dist/index.d.mts CHANGED
@@ -15,9 +15,12 @@ type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTyp
15
15
  };
16
16
  declare const tool: <INPUT extends z.ZodTypeAny, OUTPUT extends z.ZodTypeAny>(t: UserTool<INPUT, OUTPUT>) => UserTool<INPUT, OUTPUT>;
17
17
  type UserToolRegistry = Record<string, UserTool>;
18
+ declare const endpoints: readonly ["chat"];
19
+ type Endpoint = (typeof endpoints)[number];
20
+ type PuckCatchAll = [Endpoint | string, ...string[]];
18
21
  type ApiParams = {
19
22
  chat: {
20
- instructions?: string;
23
+ context?: string;
21
24
  chatId?: string;
22
25
  messages: UIMessage[];
23
26
  config: Config;
@@ -29,10 +32,10 @@ declare const createPuckApi: ({ apiKey, host, }?: {
29
32
  host?: string;
30
33
  apiKey?: string;
31
34
  }) => {
32
- auto: (path: string[], request: Request) => Promise<Response>;
35
+ all: <ThisEndpoint extends Endpoint | string>(path: [ThisEndpoint | string, ...string[]] | string[] | string, body: ThisEndpoint extends Endpoint ? ApiParams[ThisEndpoint] : any) => Promise<Response>;
33
36
  ai: {
34
- chat: ({ chatId, instructions, messages: initialMessages, config, pageData, tools, }: ApiParams["chat"]) => Promise<Response>;
37
+ chat: ({ chatId, context, messages: initialMessages, config, pageData, tools, }: ApiParams["chat"]) => Promise<Response>;
35
38
  };
36
39
  };
37
40
 
38
- export { type ApiParams, createPuckApi, streamingFetch, tool };
41
+ export { type ApiParams, type Endpoint, type PuckCatchAll, createPuckApi, createPuckApi as default, streamingFetch, tool };
package/dist/index.d.ts CHANGED
@@ -15,9 +15,12 @@ type UserTool<INPUT extends z.ZodTypeAny = z.ZodTypeAny, OUTPUT extends z.ZodTyp
15
15
  };
16
16
  declare const tool: <INPUT extends z.ZodTypeAny, OUTPUT extends z.ZodTypeAny>(t: UserTool<INPUT, OUTPUT>) => UserTool<INPUT, OUTPUT>;
17
17
  type UserToolRegistry = Record<string, UserTool>;
18
+ declare const endpoints: readonly ["chat"];
19
+ type Endpoint = (typeof endpoints)[number];
20
+ type PuckCatchAll = [Endpoint | string, ...string[]];
18
21
  type ApiParams = {
19
22
  chat: {
20
- instructions?: string;
23
+ context?: string;
21
24
  chatId?: string;
22
25
  messages: UIMessage[];
23
26
  config: Config;
@@ -29,10 +32,10 @@ declare const createPuckApi: ({ apiKey, host, }?: {
29
32
  host?: string;
30
33
  apiKey?: string;
31
34
  }) => {
32
- auto: (path: string[], request: Request) => Promise<Response>;
35
+ all: <ThisEndpoint extends Endpoint | string>(path: [ThisEndpoint | string, ...string[]] | string[] | string, body: ThisEndpoint extends Endpoint ? ApiParams[ThisEndpoint] : any) => Promise<Response>;
33
36
  ai: {
34
- chat: ({ chatId, instructions, messages: initialMessages, config, pageData, tools, }: ApiParams["chat"]) => Promise<Response>;
37
+ chat: ({ chatId, context, messages: initialMessages, config, pageData, tools, }: ApiParams["chat"]) => Promise<Response>;
35
38
  };
36
39
  };
37
40
 
38
- export { type ApiParams, createPuckApi, streamingFetch, tool };
41
+ export { type ApiParams, type Endpoint, type PuckCatchAll, createPuckApi, createPuckApi as default, streamingFetch, tool };