@joai/sdk 0.6.0 → 0.7.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 +43 -0
- package/dist/index.mjs +24 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -746,6 +746,33 @@ type StoreToggleResult = {
|
|
|
746
746
|
value: number | string | boolean;
|
|
747
747
|
previous: number | string | boolean;
|
|
748
748
|
}; //#endregion
|
|
749
|
+
//#region src/update/types.d.ts
|
|
750
|
+
type UpdateType = 'deal' | 'event' | 'update';
|
|
751
|
+
type UpdateStatus = 'draft' | 'published' | 'archived';
|
|
752
|
+
type Update = {
|
|
753
|
+
id: string;
|
|
754
|
+
type: UpdateType;
|
|
755
|
+
status: UpdateStatus;
|
|
756
|
+
title: string;
|
|
757
|
+
body: string | null;
|
|
758
|
+
imageUrl: string | null;
|
|
759
|
+
linkUrl: string | null;
|
|
760
|
+
startsAt: string | null;
|
|
761
|
+
endsAt: string | null;
|
|
762
|
+
createdAt: string;
|
|
763
|
+
updatedAt: string;
|
|
764
|
+
};
|
|
765
|
+
type UpdateCreatePayload = {
|
|
766
|
+
title: string;
|
|
767
|
+
type: UpdateType;
|
|
768
|
+
body?: string;
|
|
769
|
+
imageUrl?: string;
|
|
770
|
+
linkUrl?: string;
|
|
771
|
+
startsAt?: string;
|
|
772
|
+
endsAt?: string;
|
|
773
|
+
status?: UpdateStatus;
|
|
774
|
+
};
|
|
775
|
+
type UpdateUpdatePayload = Partial<UpdateCreatePayload>; //#endregion
|
|
749
776
|
//#region src/swarm/types.d.ts
|
|
750
777
|
//#endregion
|
|
751
778
|
//#region src/resources/agents.d.ts
|
|
@@ -996,6 +1023,21 @@ declare class StoresResource {
|
|
|
996
1023
|
delete(storeName: string): Promise<IAppResponse<unknown>>;
|
|
997
1024
|
}
|
|
998
1025
|
//#endregion
|
|
1026
|
+
//#region src/resources/updates.d.ts
|
|
1027
|
+
declare class UpdatesResource {
|
|
1028
|
+
private readonly http;
|
|
1029
|
+
constructor(http: IHttpService);
|
|
1030
|
+
list(params?: {
|
|
1031
|
+
type?: UpdateType;
|
|
1032
|
+
active?: boolean;
|
|
1033
|
+
}): Promise<IAppResponse<{
|
|
1034
|
+
data: Update[];
|
|
1035
|
+
}>>;
|
|
1036
|
+
create(payload: UpdateCreatePayload): Promise<IAppResponse<Update>>;
|
|
1037
|
+
update(id: string, payload: UpdateUpdatePayload): any;
|
|
1038
|
+
delete(id: string): Promise<IAppResponse<unknown>>;
|
|
1039
|
+
}
|
|
1040
|
+
//#endregion
|
|
999
1041
|
//#region src/resources/warps.d.ts
|
|
1000
1042
|
type WarpResponseData = {
|
|
1001
1043
|
id: string;
|
|
@@ -1060,6 +1102,7 @@ declare class JoAiClient {
|
|
|
1060
1102
|
readonly documents: DocumentsResource;
|
|
1061
1103
|
readonly meetings: MeetingsResource;
|
|
1062
1104
|
readonly stores: StoresResource;
|
|
1105
|
+
readonly updates: UpdatesResource;
|
|
1063
1106
|
readonly privateWarps: WarpsResource;
|
|
1064
1107
|
constructor(config: JoAiClientConfig);
|
|
1065
1108
|
clearCache(): void;
|
package/dist/index.mjs
CHANGED
|
@@ -492,6 +492,29 @@ var StoresResource = class {
|
|
|
492
492
|
}
|
|
493
493
|
};
|
|
494
494
|
//#endregion
|
|
495
|
+
//#region src/resources/updates.ts
|
|
496
|
+
var UpdatesResource = class {
|
|
497
|
+
constructor(http) {
|
|
498
|
+
this.http = http;
|
|
499
|
+
}
|
|
500
|
+
list(params) {
|
|
501
|
+
const query = new URLSearchParams();
|
|
502
|
+
if (params?.type) query.set("type", params.type);
|
|
503
|
+
if (params?.active != null) query.set("active", String(params.active));
|
|
504
|
+
const qs = query.toString();
|
|
505
|
+
return this.http.get(`updates${qs ? "?" + qs : ""}`);
|
|
506
|
+
}
|
|
507
|
+
create(payload) {
|
|
508
|
+
return this.http.post("updates", payload);
|
|
509
|
+
}
|
|
510
|
+
update(id, payload) {
|
|
511
|
+
return this.http.patch(`updates/${id}`, payload);
|
|
512
|
+
}
|
|
513
|
+
delete(id) {
|
|
514
|
+
return this.http.delete(`updates/${id}`);
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
//#endregion
|
|
495
518
|
//#region src/resources/warps.ts
|
|
496
519
|
var WarpsResource = class {
|
|
497
520
|
constructor(http) {
|
|
@@ -647,6 +670,7 @@ var JoAiClient = class {
|
|
|
647
670
|
this.documents = new DocumentsResource(this.http);
|
|
648
671
|
this.meetings = new MeetingsResource(this.http);
|
|
649
672
|
this.stores = new StoresResource(this.http);
|
|
673
|
+
this.updates = new UpdatesResource(this.http);
|
|
650
674
|
this.privateWarps = new WarpsResource(this.http);
|
|
651
675
|
}
|
|
652
676
|
clearCache() {
|