@joai/sdk 0.8.1 → 0.9.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 +34 -7
- package/dist/index.mjs +24 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -134,6 +134,22 @@ type Wallet = {
|
|
|
134
134
|
privateKey?: string;
|
|
135
135
|
mnemonic?: string;
|
|
136
136
|
};
|
|
137
|
+
type SubscriptionStatus = 'active' | 'canceled' | 'past_due';
|
|
138
|
+
type SubscriptionInterval = 'weekly' | 'monthly' | 'yearly';
|
|
139
|
+
type AppSubscription = {
|
|
140
|
+
id: string;
|
|
141
|
+
orderId: string;
|
|
142
|
+
teamId: string;
|
|
143
|
+
contactId: string | null;
|
|
144
|
+
status: SubscriptionStatus;
|
|
145
|
+
interval: SubscriptionInterval | null;
|
|
146
|
+
renewsAt: string | null;
|
|
147
|
+
cancelledAt: string | null;
|
|
148
|
+
locale: string | null;
|
|
149
|
+
meta: Record<string, any> | null;
|
|
150
|
+
createdAt: string;
|
|
151
|
+
updatedAt: string;
|
|
152
|
+
};
|
|
137
153
|
type Team = {
|
|
138
154
|
slug: string;
|
|
139
155
|
name: string;
|
|
@@ -491,6 +507,7 @@ type Contact = {
|
|
|
491
507
|
notes: string | null;
|
|
492
508
|
tags: string[] | null;
|
|
493
509
|
userId: string | null;
|
|
510
|
+
locale?: string | null;
|
|
494
511
|
props?: Record<string, string> | null;
|
|
495
512
|
};
|
|
496
513
|
type ContactActivity = {
|
|
@@ -513,6 +530,7 @@ type ContactFormData = {
|
|
|
513
530
|
socials?: Record<string, string> | null;
|
|
514
531
|
notes?: string | null;
|
|
515
532
|
tags?: string[] | null;
|
|
533
|
+
locale?: string | null;
|
|
516
534
|
props?: Record<string, string> | null;
|
|
517
535
|
}; //#endregion
|
|
518
536
|
//#region src/contract/types.d.ts
|
|
@@ -703,14 +721,11 @@ type BrandSiteConfig = {
|
|
|
703
721
|
};
|
|
704
722
|
//#endregion
|
|
705
723
|
//#region src/link/types.d.ts
|
|
706
|
-
declare const LINK_TYPES: readonly ["short", "qr", "nfc"];
|
|
707
|
-
type LinkTypeName = (typeof LINK_TYPES)[number];
|
|
708
724
|
type Link = {
|
|
709
725
|
id: string;
|
|
710
726
|
slug: string;
|
|
711
727
|
url: string;
|
|
712
728
|
shortUrl: string;
|
|
713
|
-
type: LinkTypeName;
|
|
714
729
|
status: 'active' | 'paused' | 'expired';
|
|
715
730
|
title: string | null;
|
|
716
731
|
scanCount: number;
|
|
@@ -722,9 +737,7 @@ type Link = {
|
|
|
722
737
|
};
|
|
723
738
|
type LinkCreatePayload = {
|
|
724
739
|
url: string;
|
|
725
|
-
|
|
726
|
-
title?: string;
|
|
727
|
-
slug?: string;
|
|
740
|
+
title: string;
|
|
728
741
|
maxScans?: number;
|
|
729
742
|
startsAt?: string;
|
|
730
743
|
expiresAt?: string;
|
|
@@ -1134,6 +1147,19 @@ declare class WarpsResource {
|
|
|
1134
1147
|
id: string;
|
|
1135
1148
|
}>>;
|
|
1136
1149
|
destroy(identifier: string): Promise<IAppResponse<unknown>>;
|
|
1150
|
+
execute(identifier: string, inputs: Record<string, any>): Promise<IAppResponse<any>>;
|
|
1151
|
+
}
|
|
1152
|
+
//#endregion
|
|
1153
|
+
//#region src/resources/subscriptions.d.ts
|
|
1154
|
+
declare class SubscriptionsResource {
|
|
1155
|
+
private readonly http;
|
|
1156
|
+
constructor(http: IHttpService);
|
|
1157
|
+
list(team: string): Promise<IAppResponse<{
|
|
1158
|
+
data: AppSubscription[];
|
|
1159
|
+
}>>;
|
|
1160
|
+
get(id: string): Promise<IAppResponse<AppSubscription>>;
|
|
1161
|
+
cancel(id: string): Promise<IAppResponse<AppSubscription>>;
|
|
1162
|
+
resume(id: string): Promise<IAppResponse<AppSubscription>>;
|
|
1137
1163
|
}
|
|
1138
1164
|
//#endregion
|
|
1139
1165
|
//#region src/cache/types.d.ts
|
|
@@ -1177,6 +1203,7 @@ declare class JoAiClient {
|
|
|
1177
1203
|
readonly updates: UpdatesResource;
|
|
1178
1204
|
readonly links: LinksResource;
|
|
1179
1205
|
readonly privateWarps: WarpsResource;
|
|
1206
|
+
readonly subscriptions: SubscriptionsResource;
|
|
1180
1207
|
constructor(config: JoAiClientConfig);
|
|
1181
1208
|
clearCache(): void;
|
|
1182
1209
|
warps(locale?: WarpLocale): WarpClient;
|
|
@@ -1211,4 +1238,4 @@ declare class DistributionResource {
|
|
|
1211
1238
|
private fetchDistribution;
|
|
1212
1239
|
}
|
|
1213
1240
|
//#endregion
|
|
1214
|
-
export { BlueprintsResource, type CacheConfig, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, type JoAiClientConfig, MarketplaceResource, MeetingsResource, type ProductItem, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, createClient };
|
|
1241
|
+
export { BlueprintsResource, type CacheConfig, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, type JoAiClientConfig, MarketplaceResource, MeetingsResource, type ProductItem, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, createClient };
|
package/dist/index.mjs
CHANGED
|
@@ -578,6 +578,28 @@ var WarpsResource = class {
|
|
|
578
578
|
destroy(identifier) {
|
|
579
579
|
return this.http.delete(`warps/${identifier}`);
|
|
580
580
|
}
|
|
581
|
+
execute(identifier, inputs) {
|
|
582
|
+
return this.http.post(`warps/${identifier}/execute`, { inputs });
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
//#endregion
|
|
586
|
+
//#region src/resources/subscriptions.ts
|
|
587
|
+
var SubscriptionsResource = class {
|
|
588
|
+
constructor(http) {
|
|
589
|
+
this.http = http;
|
|
590
|
+
}
|
|
591
|
+
list(team) {
|
|
592
|
+
return this.http.get(`subscriptions?team=${encodeURIComponent(team)}`);
|
|
593
|
+
}
|
|
594
|
+
get(id) {
|
|
595
|
+
return this.http.get(`subscriptions/${id}`);
|
|
596
|
+
}
|
|
597
|
+
cancel(id) {
|
|
598
|
+
return this.http.post(`subscriptions/${id}/cancel`);
|
|
599
|
+
}
|
|
600
|
+
resume(id) {
|
|
601
|
+
return this.http.post(`subscriptions/${id}/resume`);
|
|
602
|
+
}
|
|
581
603
|
};
|
|
582
604
|
//#endregion
|
|
583
605
|
//#region src/cache/memory-cache.ts
|
|
@@ -719,6 +741,7 @@ var JoAiClient = class {
|
|
|
719
741
|
this.updates = new UpdatesResource(this.http);
|
|
720
742
|
this.links = new LinksResource(this.http);
|
|
721
743
|
this.privateWarps = new WarpsResource(this.http);
|
|
744
|
+
this.subscriptions = new SubscriptionsResource(this.http);
|
|
722
745
|
}
|
|
723
746
|
clearCache() {
|
|
724
747
|
if (this.http instanceof CachedHttpService) this.http.clearCache();
|
|
@@ -762,4 +785,4 @@ var DistributionResource = class {
|
|
|
762
785
|
}
|
|
763
786
|
};
|
|
764
787
|
//#endregion
|
|
765
|
-
export { BlueprintsResource, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, MarketplaceResource, MeetingsResource, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, createClient };
|
|
788
|
+
export { BlueprintsResource, CachedHttpService, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, MarketplaceResource, MeetingsResource, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, createClient };
|