@joai/sdk 0.4.0 → 0.5.0

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
@@ -360,6 +360,7 @@ type Blueprint = {
360
360
  description: string | null;
361
361
  avatar: string | null;
362
362
  settings: BlueprintSettings;
363
+ documentCount: number;
363
364
  verified: boolean;
364
365
  createdAt: string;
365
366
  locales: WarpLocale[];
@@ -798,10 +799,18 @@ declare class ContactsResource {
798
799
  declare class DocumentsResource {
799
800
  private readonly http;
800
801
  constructor(http: IHttpService);
801
- ingest(payload: {
802
+ list(agent: string, search?: string): Promise<IAppResponse<Document[]>>;
803
+ create(agent: string, data: {
802
804
  title: string;
803
805
  content: string;
806
+ blueprint?: string;
804
807
  }): Promise<IAppResponse<Document>>;
808
+ get(id: string): Promise<IAppResponse<Document>>;
809
+ update(id: string, data: {
810
+ title?: string;
811
+ content?: string;
812
+ }): Promise<IAppResponse<Document>>;
813
+ delete(id: string): Promise<IAppResponse<unknown>>;
805
814
  }
806
815
  //#endregion
807
816
  //#region src/resources/goals.d.ts
@@ -896,11 +905,12 @@ declare class SitesResource {
896
905
  private readonly http;
897
906
  constructor(http: IHttpService);
898
907
  listMine(teamSlug: string): Promise<IAppResponse<Site[]>>;
899
- resolve(teamSlug: string, brandSlug: string): Promise<IAppResponse<Site>>;
908
+ resolve(teamSlug: string, brandSlug?: string): Promise<IAppResponse<Site>>;
900
909
  resolveByDomain(domain: string): Promise<IAppResponse<Site>>;
901
910
  update(siteSlug: string, data: {
902
911
  customDomain?: string | null;
903
912
  enabled?: boolean;
913
+ modules?: string[];
904
914
  }): Promise<IAppResponse<{
905
915
  updated: boolean;
906
916
  }>>;
package/dist/index.mjs CHANGED
@@ -288,8 +288,22 @@ var DocumentsResource = class {
288
288
  constructor(http) {
289
289
  this.http = http;
290
290
  }
291
- ingest(payload) {
292
- return this.http.post("documents", payload);
291
+ list(agent, search) {
292
+ const params = new URLSearchParams();
293
+ if (search) params.set("search", search);
294
+ return this.http.get(`agents/${agent}/documents?${params.toString()}`);
295
+ }
296
+ create(agent, data) {
297
+ return this.http.post(`agents/${agent}/documents`, data);
298
+ }
299
+ get(id) {
300
+ return this.http.get(`documents/${id}`);
301
+ }
302
+ update(id, data) {
303
+ return this.http.put(`documents/${id}`, data);
304
+ }
305
+ delete(id) {
306
+ return this.http.delete(`documents/${id}`);
293
307
  }
294
308
  };
295
309
  //#endregion
@@ -420,7 +434,8 @@ var SitesResource = class {
420
434
  return this.http.get(`sites/mine?team=${encodeURIComponent(teamSlug)}`);
421
435
  }
422
436
  resolve(teamSlug, brandSlug) {
423
- return this.http.get(`sites/resolve?team=${encodeURIComponent(teamSlug)}&brand=${encodeURIComponent(brandSlug)}`);
437
+ const query = brandSlug ? `team=${encodeURIComponent(teamSlug)}&brand=${encodeURIComponent(brandSlug)}` : `team=${encodeURIComponent(teamSlug)}`;
438
+ return this.http.get(`sites/resolve?${query}`);
424
439
  }
425
440
  resolveByDomain(domain) {
426
441
  return this.http.get(`sites/resolve?domain=${encodeURIComponent(domain)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "JoAi public API SDK — build with your AI agents",
5
5
  "license": "MIT",
6
6
  "type": "module",