@joai/sdk 0.7.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 +76 -1
- package/dist/index.mjs +48 -1
- package/package.json +1 -1
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 = {
|
|
@@ -951,6 +980,35 @@ declare class MemoriesResource {
|
|
|
951
980
|
delete(id: string): Promise<IAppResponse<unknown>>;
|
|
952
981
|
}
|
|
953
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
|
|
954
1012
|
//#region src/resources/reminders.d.ts
|
|
955
1013
|
declare class RemindersResource {
|
|
956
1014
|
private readonly http;
|
|
@@ -1038,6 +1096,21 @@ declare class UpdatesResource {
|
|
|
1038
1096
|
delete(id: string): Promise<IAppResponse<unknown>>;
|
|
1039
1097
|
}
|
|
1040
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
|
|
1041
1114
|
//#region src/resources/warps.d.ts
|
|
1042
1115
|
type WarpResponseData = {
|
|
1043
1116
|
id: string;
|
|
@@ -1098,11 +1171,13 @@ declare class JoAiClient {
|
|
|
1098
1171
|
readonly memories: MemoriesResource;
|
|
1099
1172
|
readonly goals: GoalsResource;
|
|
1100
1173
|
readonly reminders: RemindersResource;
|
|
1174
|
+
readonly products: ProductsResource;
|
|
1101
1175
|
readonly sites: SitesResource;
|
|
1102
1176
|
readonly documents: DocumentsResource;
|
|
1103
1177
|
readonly meetings: MeetingsResource;
|
|
1104
1178
|
readonly stores: StoresResource;
|
|
1105
1179
|
readonly updates: UpdatesResource;
|
|
1180
|
+
readonly links: LinksResource;
|
|
1106
1181
|
readonly privateWarps: WarpsResource;
|
|
1107
1182
|
constructor(config: JoAiClientConfig);
|
|
1108
1183
|
clearCache(): void;
|
|
@@ -1138,4 +1213,4 @@ declare class DistributionResource {
|
|
|
1138
1213
|
private fetchDistribution;
|
|
1139
1214
|
}
|
|
1140
1215
|
//#endregion
|
|
1141
|
-
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) {
|
|
@@ -515,6 +537,29 @@ var UpdatesResource = class {
|
|
|
515
537
|
}
|
|
516
538
|
};
|
|
517
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
|
|
518
563
|
//#region src/resources/warps.ts
|
|
519
564
|
var WarpsResource = class {
|
|
520
565
|
constructor(http) {
|
|
@@ -670,7 +715,9 @@ var JoAiClient = class {
|
|
|
670
715
|
this.documents = new DocumentsResource(this.http);
|
|
671
716
|
this.meetings = new MeetingsResource(this.http);
|
|
672
717
|
this.stores = new StoresResource(this.http);
|
|
718
|
+
this.products = new ProductsResource(this.http);
|
|
673
719
|
this.updates = new UpdatesResource(this.http);
|
|
720
|
+
this.links = new LinksResource(this.http);
|
|
674
721
|
this.privateWarps = new WarpsResource(this.http);
|
|
675
722
|
}
|
|
676
723
|
clearCache() {
|
|
@@ -715,4 +762,4 @@ var DistributionResource = class {
|
|
|
715
762
|
}
|
|
716
763
|
};
|
|
717
764
|
//#endregion
|
|
718
|
-
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 };
|