@puckeditor/cloud-client 0.1.0-canary.c667a758 → 0.1.0-canary.cad10367

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
@@ -32,7 +32,7 @@ declare const createPuckApi: ({ apiKey, host, }?: {
32
32
  host?: string;
33
33
  apiKey?: string;
34
34
  }) => {
35
- all: <ThisEndpoint extends Endpoint | string>(path: [ThisEndpoint | string, ...string[]], body: ThisEndpoint extends Endpoint ? ApiParams[ThisEndpoint] : any) => Promise<Response>;
35
+ all: <ThisEndpoint extends Endpoint | string>(path: [ThisEndpoint | string, ...string[]] | string[] | string, body: ThisEndpoint extends Endpoint ? ApiParams[ThisEndpoint] : any) => Promise<Response>;
36
36
  ai: {
37
37
  chat: ({ chatId, context, messages: initialMessages, config, pageData, tools, }: ApiParams["chat"]) => Promise<Response>;
38
38
  };
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ declare const createPuckApi: ({ apiKey, host, }?: {
32
32
  host?: string;
33
33
  apiKey?: string;
34
34
  }) => {
35
- all: <ThisEndpoint extends Endpoint | string>(path: [ThisEndpoint | string, ...string[]], body: ThisEndpoint extends Endpoint ? ApiParams[ThisEndpoint] : any) => Promise<Response>;
35
+ all: <ThisEndpoint extends Endpoint | string>(path: [ThisEndpoint | string, ...string[]] | string[] | string, body: ThisEndpoint extends Endpoint ? ApiParams[ThisEndpoint] : any) => Promise<Response>;
36
36
  ai: {
37
37
  chat: ({ chatId, context, messages: initialMessages, config, pageData, tools, }: ApiParams["chat"]) => Promise<Response>;
38
38
  };
package/dist/index.js CHANGED
@@ -19820,7 +19820,8 @@ var createPuckApi = ({
19820
19820
  }
19821
19821
  };
19822
19822
  const all = (path, body) => __async(null, null, function* () {
19823
- const endpoint = path[0];
19823
+ const parts = typeof path === "string" ? path.split("/") : path;
19824
+ const endpoint = parts[0];
19824
19825
  if (endpoint === "chat") {
19825
19826
  return ai.chat(body);
19826
19827
  }
package/dist/index.mjs CHANGED
@@ -19788,7 +19788,8 @@ var createPuckApi = ({
19788
19788
  }
19789
19789
  };
19790
19790
  const all = (path, body) => __async(null, null, function* () {
19791
- const endpoint = path[0];
19791
+ const parts = typeof path === "string" ? path.split("/") : path;
19792
+ const endpoint = parts[0];
19792
19793
  if (endpoint === "chat") {
19793
19794
  return ai.chat(body);
19794
19795
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/cloud-client",
3
- "version": "0.1.0-canary.c667a758",
3
+ "version": "0.1.0-canary.cad10367",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
5
  "repository": "puckeditor/puck",
6
6
  "bugs": "https://github.com/puckeditor/puck/issues",