@joai/sdk 0.6.0 → 0.8.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
@@ -702,6 +702,35 @@ type BrandSiteConfig = {
702
702
  logoUrl?: string | null;
703
703
  };
704
704
  //#endregion
705
+ //#region src/link/types.d.ts
706
+ declare const LINK_TYPES: readonly ["short", "qr", "nfc"];
707
+ type LinkTypeName = (typeof LINK_TYPES)[number];
708
+ type Link = {
709
+ id: string;
710
+ slug: string;
711
+ url: string;
712
+ shortUrl: string;
713
+ type: LinkTypeName;
714
+ status: 'active' | 'paused' | 'expired';
715
+ title: string | null;
716
+ scanCount: number;
717
+ maxScans: number | null;
718
+ startsAt: string | null;
719
+ expiresAt: string | null;
720
+ createdAt: string;
721
+ updatedAt: string;
722
+ };
723
+ type LinkCreatePayload = {
724
+ url: string;
725
+ type: LinkTypeName;
726
+ title?: string;
727
+ slug?: string;
728
+ maxScans?: number;
729
+ startsAt?: string;
730
+ expiresAt?: string;
731
+ status?: 'active' | 'paused' | 'expired';
732
+ };
733
+ type LinkUpdatePayload = Partial<LinkCreatePayload>; //#endregion
705
734
  //#region src/store/types.d.ts
706
735
  type StoreVisibility = 'private' | 'team' | 'public';
707
736
  type StoreEntry = {
@@ -746,6 +775,33 @@ type StoreToggleResult = {
746
775
  value: number | string | boolean;
747
776
  previous: number | string | boolean;
748
777
  }; //#endregion
778
+ //#region src/update/types.d.ts
779
+ type UpdateType = 'deal' | 'event' | 'update';
780
+ type UpdateStatus = 'draft' | 'published' | 'archived';
781
+ type Update = {
782
+ id: string;
783
+ type: UpdateType;
784
+ status: UpdateStatus;
785
+ title: string;
786
+ body: string | null;
787
+ imageUrl: string | null;
788
+ linkUrl: string | null;
789
+ startsAt: string | null;
790
+ endsAt: string | null;
791
+ createdAt: string;
792
+ updatedAt: string;
793
+ };
794
+ type UpdateCreatePayload = {
795
+ title: string;
796
+ type: UpdateType;
797
+ body?: string;
798
+ imageUrl?: string;
799
+ linkUrl?: string;
800
+ startsAt?: string;
801
+ endsAt?: string;
802
+ status?: UpdateStatus;
803
+ };
804
+ type UpdateUpdatePayload = Partial<UpdateCreatePayload>; //#endregion
749
805
  //#region src/swarm/types.d.ts
750
806
  //#endregion
751
807
  //#region src/resources/agents.d.ts
@@ -924,6 +980,35 @@ declare class MemoriesResource {
924
980
  delete(id: string): Promise<IAppResponse<unknown>>;
925
981
  }
926
982
  //#endregion
983
+ //#region src/resources/products.d.ts
984
+ type ProductItem = {
985
+ id: string;
986
+ slug: string;
987
+ name: string;
988
+ price: number;
989
+ unit: string;
990
+ tags: string[];
991
+ description: string;
992
+ active: boolean;
993
+ };
994
+ declare class ProductsResource {
995
+ private readonly http;
996
+ constructor(http: IHttpService);
997
+ list(): Promise<IAppResponse<{
998
+ data: ProductItem[];
999
+ }>>;
1000
+ get(id: string): Promise<IAppResponse<ProductItem>>;
1001
+ create(data: {
1002
+ name: string;
1003
+ price: number;
1004
+ unit?: string;
1005
+ description?: string;
1006
+ tags?: string[];
1007
+ }): Promise<IAppResponse<ProductItem>>;
1008
+ update(id: string, data: Partial<Pick<ProductItem, 'name' | 'price' | 'unit' | 'description' | 'tags' | 'active'>>): Promise<IAppResponse<ProductItem>>;
1009
+ delete(id: string): Promise<IAppResponse<unknown>>;
1010
+ }
1011
+ //#endregion
927
1012
  //#region src/resources/reminders.d.ts
928
1013
  declare class RemindersResource {
929
1014
  private readonly http;
@@ -996,6 +1081,36 @@ declare class StoresResource {
996
1081
  delete(storeName: string): Promise<IAppResponse<unknown>>;
997
1082
  }
998
1083
  //#endregion
1084
+ //#region src/resources/updates.d.ts
1085
+ declare class UpdatesResource {
1086
+ private readonly http;
1087
+ constructor(http: IHttpService);
1088
+ list(params?: {
1089
+ type?: UpdateType;
1090
+ active?: boolean;
1091
+ }): Promise<IAppResponse<{
1092
+ data: Update[];
1093
+ }>>;
1094
+ create(payload: UpdateCreatePayload): Promise<IAppResponse<Update>>;
1095
+ update(id: string, payload: UpdateUpdatePayload): any;
1096
+ delete(id: string): Promise<IAppResponse<unknown>>;
1097
+ }
1098
+ //#endregion
1099
+ //#region src/resources/links.d.ts
1100
+ declare class LinksResource {
1101
+ private readonly http;
1102
+ constructor(http: IHttpService);
1103
+ list(params?: {
1104
+ type?: string;
1105
+ active?: boolean;
1106
+ }): Promise<IAppResponse<{
1107
+ data: Link[];
1108
+ }>>;
1109
+ create(payload: LinkCreatePayload): Promise<IAppResponse<Link>>;
1110
+ update(id: string, payload: LinkUpdatePayload): any;
1111
+ delete(id: string): Promise<IAppResponse<unknown>>;
1112
+ }
1113
+ //#endregion
999
1114
  //#region src/resources/warps.d.ts
1000
1115
  type WarpResponseData = {
1001
1116
  id: string;
@@ -1056,10 +1171,13 @@ declare class JoAiClient {
1056
1171
  readonly memories: MemoriesResource;
1057
1172
  readonly goals: GoalsResource;
1058
1173
  readonly reminders: RemindersResource;
1174
+ readonly products: ProductsResource;
1059
1175
  readonly sites: SitesResource;
1060
1176
  readonly documents: DocumentsResource;
1061
1177
  readonly meetings: MeetingsResource;
1062
1178
  readonly stores: StoresResource;
1179
+ readonly updates: UpdatesResource;
1180
+ readonly links: LinksResource;
1063
1181
  readonly privateWarps: WarpsResource;
1064
1182
  constructor(config: JoAiClientConfig);
1065
1183
  clearCache(): void;
@@ -1095,4 +1213,4 @@ declare class DistributionResource {
1095
1213
  private fetchDistribution;
1096
1214
  }
1097
1215
  //#endregion
1098
- export { BlueprintsResource, type CacheConfig, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, type JoAiClientConfig, MarketplaceResource, MeetingsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, createClient };
1216
+ export { BlueprintsResource, type CacheConfig, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, type JoAiClientConfig, MarketplaceResource, MeetingsResource, type ProductItem, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, createClient };
package/dist/index.mjs CHANGED
@@ -393,6 +393,28 @@ var MemoriesResource = class {
393
393
  }
394
394
  };
395
395
  //#endregion
396
+ //#region src/resources/products.ts
397
+ var ProductsResource = class {
398
+ constructor(http) {
399
+ this.http = http;
400
+ }
401
+ list() {
402
+ return this.http.get("products");
403
+ }
404
+ get(id) {
405
+ return this.http.get(`products/${id}`);
406
+ }
407
+ create(data) {
408
+ return this.http.post("products", data);
409
+ }
410
+ update(id, data) {
411
+ return this.http.put(`products/${id}`, data);
412
+ }
413
+ delete(id) {
414
+ return this.http.delete(`products/${id}`);
415
+ }
416
+ };
417
+ //#endregion
396
418
  //#region src/resources/reminders.ts
397
419
  var RemindersResource = class {
398
420
  constructor(http) {
@@ -492,6 +514,52 @@ var StoresResource = class {
492
514
  }
493
515
  };
494
516
  //#endregion
517
+ //#region src/resources/updates.ts
518
+ var UpdatesResource = class {
519
+ constructor(http) {
520
+ this.http = http;
521
+ }
522
+ list(params) {
523
+ const query = new URLSearchParams();
524
+ if (params?.type) query.set("type", params.type);
525
+ if (params?.active != null) query.set("active", String(params.active));
526
+ const qs = query.toString();
527
+ return this.http.get(`updates${qs ? "?" + qs : ""}`);
528
+ }
529
+ create(payload) {
530
+ return this.http.post("updates", payload);
531
+ }
532
+ update(id, payload) {
533
+ return this.http.patch(`updates/${id}`, payload);
534
+ }
535
+ delete(id) {
536
+ return this.http.delete(`updates/${id}`);
537
+ }
538
+ };
539
+ //#endregion
540
+ //#region src/resources/links.ts
541
+ var LinksResource = class {
542
+ constructor(http) {
543
+ this.http = http;
544
+ }
545
+ list(params) {
546
+ const query = new URLSearchParams();
547
+ if (params?.type) query.set("type", params.type);
548
+ if (params?.active != null) query.set("active", String(params.active));
549
+ const qs = query.toString();
550
+ return this.http.get(`links${qs ? "?" + qs : ""}`);
551
+ }
552
+ create(payload) {
553
+ return this.http.post("links", payload);
554
+ }
555
+ update(id, payload) {
556
+ return this.http.patch(`links/${id}`, payload);
557
+ }
558
+ delete(id) {
559
+ return this.http.delete(`links/${id}`);
560
+ }
561
+ };
562
+ //#endregion
495
563
  //#region src/resources/warps.ts
496
564
  var WarpsResource = class {
497
565
  constructor(http) {
@@ -647,6 +715,9 @@ var JoAiClient = class {
647
715
  this.documents = new DocumentsResource(this.http);
648
716
  this.meetings = new MeetingsResource(this.http);
649
717
  this.stores = new StoresResource(this.http);
718
+ this.products = new ProductsResource(this.http);
719
+ this.updates = new UpdatesResource(this.http);
720
+ this.links = new LinksResource(this.http);
650
721
  this.privateWarps = new WarpsResource(this.http);
651
722
  }
652
723
  clearCache() {
@@ -691,4 +762,4 @@ var DistributionResource = class {
691
762
  }
692
763
  };
693
764
  //#endregion
694
- export { BlueprintsResource, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, MarketplaceResource, MeetingsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, createClient };
765
+ export { BlueprintsResource, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, MarketplaceResource, MeetingsResource, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, createClient };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/sdk",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "JoAi public API SDK — build with your AI agents",
5
5
  "license": "MIT",
6
6
  "type": "module",