@joai/sdk 0.7.0 → 0.8.1
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 +74 -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,33 @@ 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<ProductItem[]>>;
|
|
998
|
+
get(id: string): Promise<IAppResponse<ProductItem>>;
|
|
999
|
+
create(data: {
|
|
1000
|
+
name: string;
|
|
1001
|
+
price: number;
|
|
1002
|
+
unit?: string;
|
|
1003
|
+
description?: string;
|
|
1004
|
+
tags?: string[];
|
|
1005
|
+
}): Promise<IAppResponse<ProductItem>>;
|
|
1006
|
+
update(id: string, data: Partial<Pick<ProductItem, 'name' | 'price' | 'unit' | 'description' | 'tags' | 'active'>>): Promise<IAppResponse<ProductItem>>;
|
|
1007
|
+
delete(id: string): Promise<IAppResponse<unknown>>;
|
|
1008
|
+
}
|
|
1009
|
+
//#endregion
|
|
954
1010
|
//#region src/resources/reminders.d.ts
|
|
955
1011
|
declare class RemindersResource {
|
|
956
1012
|
private readonly http;
|
|
@@ -1038,6 +1094,21 @@ declare class UpdatesResource {
|
|
|
1038
1094
|
delete(id: string): Promise<IAppResponse<unknown>>;
|
|
1039
1095
|
}
|
|
1040
1096
|
//#endregion
|
|
1097
|
+
//#region src/resources/links.d.ts
|
|
1098
|
+
declare class LinksResource {
|
|
1099
|
+
private readonly http;
|
|
1100
|
+
constructor(http: IHttpService);
|
|
1101
|
+
list(params?: {
|
|
1102
|
+
type?: string;
|
|
1103
|
+
active?: boolean;
|
|
1104
|
+
}): Promise<IAppResponse<{
|
|
1105
|
+
data: Link[];
|
|
1106
|
+
}>>;
|
|
1107
|
+
create(payload: LinkCreatePayload): Promise<IAppResponse<Link>>;
|
|
1108
|
+
update(id: string, payload: LinkUpdatePayload): any;
|
|
1109
|
+
delete(id: string): Promise<IAppResponse<unknown>>;
|
|
1110
|
+
}
|
|
1111
|
+
//#endregion
|
|
1041
1112
|
//#region src/resources/warps.d.ts
|
|
1042
1113
|
type WarpResponseData = {
|
|
1043
1114
|
id: string;
|
|
@@ -1098,11 +1169,13 @@ declare class JoAiClient {
|
|
|
1098
1169
|
readonly memories: MemoriesResource;
|
|
1099
1170
|
readonly goals: GoalsResource;
|
|
1100
1171
|
readonly reminders: RemindersResource;
|
|
1172
|
+
readonly products: ProductsResource;
|
|
1101
1173
|
readonly sites: SitesResource;
|
|
1102
1174
|
readonly documents: DocumentsResource;
|
|
1103
1175
|
readonly meetings: MeetingsResource;
|
|
1104
1176
|
readonly stores: StoresResource;
|
|
1105
1177
|
readonly updates: UpdatesResource;
|
|
1178
|
+
readonly links: LinksResource;
|
|
1106
1179
|
readonly privateWarps: WarpsResource;
|
|
1107
1180
|
constructor(config: JoAiClientConfig);
|
|
1108
1181
|
clearCache(): void;
|
|
@@ -1138,4 +1211,4 @@ declare class DistributionResource {
|
|
|
1138
1211
|
private fetchDistribution;
|
|
1139
1212
|
}
|
|
1140
1213
|
//#endregion
|
|
1141
|
-
export { BlueprintsResource, type CacheConfig, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, type JoAiClientConfig, MarketplaceResource, MeetingsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, createClient };
|
|
1214
|
+
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 };
|