@joai/sdk 1.2.0 → 1.4.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 +41 -13
- package/dist/index.mjs +21 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -261,7 +261,7 @@ type AffiliateStatus = 'pending' | 'approved' | 'rejected' | 'suspended' | 'demo
|
|
|
261
261
|
//#region src/team/constants.d.ts
|
|
262
262
|
declare const teamCategories: readonly ["general", "food-drink", "retail", "beauty-wellness", "health", "sports-fitness", "trades-services", "professional-services", "education-culture", "clubs-organizations", "leisure-tourism"]; //#endregion
|
|
263
263
|
//#region src/team/types.d.ts
|
|
264
|
-
type TeamCategory = typeof teamCategories[number];
|
|
264
|
+
type TeamCategory = (typeof teamCategories)[number];
|
|
265
265
|
type TeamFeature = 'shop' | 'appointments';
|
|
266
266
|
type TeamMember = User & {
|
|
267
267
|
role: UserRole | null;
|
|
@@ -271,7 +271,7 @@ type TeamMember = User & {
|
|
|
271
271
|
type TeamMeta = {
|
|
272
272
|
'extra.messages'?: number;
|
|
273
273
|
'limit.spending'?: number | null;
|
|
274
|
-
|
|
274
|
+
currency?: string;
|
|
275
275
|
'extra.usage.enabled'?: boolean;
|
|
276
276
|
'auto.reload.enabled'?: boolean;
|
|
277
277
|
'auto.reload.threshold_cents'?: number | null;
|
|
@@ -281,9 +281,10 @@ type TeamMeta = {
|
|
|
281
281
|
'board.auto.enabled'?: boolean;
|
|
282
282
|
'payments.online'?: boolean;
|
|
283
283
|
'payments.coupons'?: boolean;
|
|
284
|
+
'kiosk.enabled'?: boolean;
|
|
284
285
|
'stock.enabled'?: boolean;
|
|
285
|
-
|
|
286
|
-
|
|
286
|
+
contactPropertyMaskWarp?: string;
|
|
287
|
+
branding?: TeamBrand | null;
|
|
287
288
|
settings: Record<string, unknown>;
|
|
288
289
|
};
|
|
289
290
|
type Team = {
|
|
@@ -304,6 +305,7 @@ type Team = {
|
|
|
304
305
|
createdAt: string;
|
|
305
306
|
blueprints?: Blueprint[];
|
|
306
307
|
flows?: Flow[];
|
|
308
|
+
coupons?: Coupon[];
|
|
307
309
|
};
|
|
308
310
|
type TeamBrand = {
|
|
309
311
|
bg?: string;
|
|
@@ -760,11 +762,17 @@ type CouponCondition = 'none' | 'onetime-use' | 'previous-purchase';
|
|
|
760
762
|
type Coupon = {
|
|
761
763
|
id: string;
|
|
762
764
|
code: string;
|
|
765
|
+
name: TranslatableValue;
|
|
763
766
|
amount: number | null;
|
|
764
767
|
percent: number | null;
|
|
768
|
+
price: number | null;
|
|
765
769
|
condition: CouponCondition;
|
|
766
770
|
usesLeft: number | null;
|
|
767
771
|
expiresAt: string | null;
|
|
772
|
+
active: boolean;
|
|
773
|
+
public: boolean;
|
|
774
|
+
sellable: boolean;
|
|
775
|
+
media: Media[];
|
|
768
776
|
};
|
|
769
777
|
type PurchaseResult = {
|
|
770
778
|
order_id?: string;
|
|
@@ -795,7 +803,7 @@ type Skill = {
|
|
|
795
803
|
screenshots: string[];
|
|
796
804
|
}; //#endregion
|
|
797
805
|
//#region src/integration/types.d.ts
|
|
798
|
-
type IntegrationType = 'none' | 'webhook' | 'api-token' | 'telegram' | 'slack' | 'whatsapp' | 'twilio' | 'sms' | 'n8n' | 'apple-health' | 'mcp' | 'x' | 'email' | 'calendar' | 'embed' | 'discord' | 'github' | 'sentry' | 'readwise';
|
|
806
|
+
type IntegrationType = 'none' | 'webhook' | 'api-token' | 'telegram' | 'slack' | 'whatsapp' | 'twilio' | 'sms' | 'n8n' | 'apple-health' | 'mcp' | 'x' | 'email' | 'calendar' | 'embed' | 'discord' | 'github' | 'push' | 'sentry' | 'readwise';
|
|
799
807
|
type IntegrationDetails = {
|
|
800
808
|
type: IntegrationType;
|
|
801
809
|
name: string;
|
|
@@ -2454,7 +2462,7 @@ type LoyaltyMember = {
|
|
|
2454
2462
|
updatedAt: string;
|
|
2455
2463
|
}; //#endregion
|
|
2456
2464
|
//#region src/segment/types.d.ts
|
|
2457
|
-
type SegmentConditionType = 'tag' | 'has_email' | 'has_phone' | 'created_after' | 'created_before' | 'email_contains';
|
|
2465
|
+
type SegmentConditionType = 'tag' | 'has_email' | 'has_phone' | 'has_user' | 'last_purchase_after' | 'last_purchase_before' | 'total_order_amount' | 'order_count_at_least' | 'never_purchased' | 'avg_order_value_at_least' | 'last_contact_after' | 'last_contact_before' | 'created_after' | 'created_before' | 'email_contains';
|
|
2458
2466
|
type SegmentCondition = {
|
|
2459
2467
|
type: SegmentConditionType;
|
|
2460
2468
|
value: string | boolean;
|
|
@@ -2485,7 +2493,7 @@ type SegmentCountResult = {
|
|
|
2485
2493
|
reachable: number | null;
|
|
2486
2494
|
}; //#endregion
|
|
2487
2495
|
//#region src/campaign/types.d.ts
|
|
2488
|
-
type CampaignChannel = 'email' | 'whatsapp' | 'sms';
|
|
2496
|
+
type CampaignChannel = 'email' | 'whatsapp' | 'sms' | 'push';
|
|
2489
2497
|
type CampaignStatus = 'draft' | 'sending' | 'completed' | 'failed';
|
|
2490
2498
|
type Campaign = {
|
|
2491
2499
|
id: string;
|
|
@@ -2590,6 +2598,13 @@ type Swarm = {
|
|
|
2590
2598
|
agents: AgentPrivate[];
|
|
2591
2599
|
};
|
|
2592
2600
|
//#endregion
|
|
2601
|
+
//#region src/tag/types.d.ts
|
|
2602
|
+
type TagType = 'contact';
|
|
2603
|
+
type Tag = {
|
|
2604
|
+
slug: string;
|
|
2605
|
+
name: string;
|
|
2606
|
+
type: TagType | null;
|
|
2607
|
+
}; //#endregion
|
|
2593
2608
|
//#region src/task/types.d.ts
|
|
2594
2609
|
type Task = {
|
|
2595
2610
|
id: string;
|
|
@@ -3075,7 +3090,7 @@ declare class CartsResource {
|
|
|
3075
3090
|
private readonly http;
|
|
3076
3091
|
constructor(http: IHttpService);
|
|
3077
3092
|
get(): Promise<IAppResponse<Cart>>;
|
|
3078
|
-
add(type: 'product' | 'service', id: string, quantity?: number, configuration?: Configuration): Promise<IAppResponse<Cart>>;
|
|
3093
|
+
add(type: 'product' | 'service' | 'coupon', id: string, quantity?: number, configuration?: Configuration): Promise<IAppResponse<Cart>>;
|
|
3079
3094
|
remove(type: 'product' | 'service', id: string): Promise<IAppResponse<Cart>>;
|
|
3080
3095
|
updateQuantity(type: 'product' | 'service', id: string, quantity: number): Promise<IAppResponse<Cart>>;
|
|
3081
3096
|
clear(): Promise<IAppResponse<Cart>>;
|
|
@@ -3085,11 +3100,16 @@ declare class CartsResource {
|
|
|
3085
3100
|
//#region src/resources/coupons.d.ts
|
|
3086
3101
|
type CouponPayload = {
|
|
3087
3102
|
code: string;
|
|
3103
|
+
name?: TranslatableValue;
|
|
3088
3104
|
percent?: number | null;
|
|
3089
3105
|
amount?: number | null;
|
|
3106
|
+
price?: number | null;
|
|
3107
|
+
active?: boolean;
|
|
3108
|
+
public?: boolean;
|
|
3090
3109
|
condition?: CouponCondition;
|
|
3091
3110
|
usesLeft?: number | null;
|
|
3092
3111
|
expiresAt?: string | null;
|
|
3112
|
+
media?: MediaLibraryAttributes[];
|
|
3093
3113
|
};
|
|
3094
3114
|
declare class CouponsResource {
|
|
3095
3115
|
private readonly http;
|
|
@@ -3616,7 +3636,7 @@ declare class OrdersResource {
|
|
|
3616
3636
|
sendConfirmation?: boolean;
|
|
3617
3637
|
items?: {
|
|
3618
3638
|
id: string;
|
|
3619
|
-
type: 'product' | 'service';
|
|
3639
|
+
type: 'product' | 'service' | 'coupon';
|
|
3620
3640
|
quantity: number;
|
|
3621
3641
|
configuration?: Configuration;
|
|
3622
3642
|
}[];
|
|
@@ -3942,6 +3962,14 @@ declare class TasksResource {
|
|
|
3942
3962
|
toggle(id: string): Promise<IAppResponse<Task>>;
|
|
3943
3963
|
}
|
|
3944
3964
|
//#endregion
|
|
3965
|
+
//#region src/resources/tags.d.ts
|
|
3966
|
+
declare class TagsResource {
|
|
3967
|
+
private readonly http;
|
|
3968
|
+
constructor(http: IHttpService);
|
|
3969
|
+
list(type?: TagType): Promise<IAppResponse<Tag[]>>;
|
|
3970
|
+
create(name: string, type?: TagType): Promise<IAppResponse<Tag[]>>;
|
|
3971
|
+
}
|
|
3972
|
+
//#endregion
|
|
3945
3973
|
//#region src/resources/teams.d.ts
|
|
3946
3974
|
type TeamInviteInfo = {
|
|
3947
3975
|
slug: string;
|
|
@@ -4026,9 +4054,6 @@ declare class SegmentsResource {
|
|
|
4026
4054
|
update(id: string, payload: SegmentCreatePayload): Promise<IAppResponse<Segment>>;
|
|
4027
4055
|
delete(id: string): Promise<IAppResponse<void>>;
|
|
4028
4056
|
count(payload: SegmentCountPayload): Promise<IAppResponse<SegmentCountResult>>;
|
|
4029
|
-
tags(): Promise<IAppResponse<{
|
|
4030
|
-
tags: string[];
|
|
4031
|
-
}>>;
|
|
4032
4057
|
}
|
|
4033
4058
|
//#endregion
|
|
4034
4059
|
//#region src/resources/updates.d.ts
|
|
@@ -4038,6 +4063,8 @@ declare class UpdatesResource {
|
|
|
4038
4063
|
listPublic(params?: {
|
|
4039
4064
|
type?: string;
|
|
4040
4065
|
tags?: string;
|
|
4066
|
+
team?: string;
|
|
4067
|
+
active?: boolean;
|
|
4041
4068
|
with?: UpdateRelation[];
|
|
4042
4069
|
}): Promise<IAppResponse<Update[]>>;
|
|
4043
4070
|
list(params?: {
|
|
@@ -4352,6 +4379,7 @@ declare class JoAiClient {
|
|
|
4352
4379
|
readonly subscriptions: SubscriptionsResource;
|
|
4353
4380
|
readonly swarms: SwarmsResource;
|
|
4354
4381
|
readonly tasks: TasksResource;
|
|
4382
|
+
readonly tags: TagsResource;
|
|
4355
4383
|
readonly teams: TeamsResource;
|
|
4356
4384
|
readonly campaigns: CampaignsResource;
|
|
4357
4385
|
readonly segments: SegmentsResource;
|
|
@@ -4400,4 +4428,4 @@ declare class DistributionResource {
|
|
|
4400
4428
|
private fetchDistribution;
|
|
4401
4429
|
}
|
|
4402
4430
|
//#endregion
|
|
4403
|
-
export { AgentsResource, AlertsResource, ApiTokensResource, AppointmentsResource, AuthResource, type AuthSendCodeRequest, type AuthVerifyResponse, type BackendWarp, type BackendWarpBrand, BillingAddressesResource, BillingResource, BlueprintsResource, type CacheConfig, CachedHttpService, CampaignsResource, CardsResource, CartsResource, ChangelogResource, CharactersResource, ContactsResource, ContractsResource, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, FlowsResource, GoalsResource, IngestionsResource, InquiriesResource, IntegrationsResource, IntentsResource, ItemsResource, JoAiClient, type JoAiClientConfig, KvResource, LinksResource, LoyaltyResource, McpResource, MeetingsResource, MemoriesResource, MessagesResource, MissionsResource, NotificationsResource, OfficeResource, type OpeningHoursEntry, type OpeningHoursFormatOptions, OrdersResource, PersonaResource, type Product, type ProductVariation, ProductsResource, ProjectsResource, RemindersResource, SegmentsResource, ServicesResource, ShortcutsResource, SitesResource, SkillsResource, StatsResource, StoreResource, SubscriptionsResource, SwarmsResource, TasksResource, type TeamInviteInfo, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, WebhooksResource, WorkspaceResource, createClient, formatOpeningHours };
|
|
4431
|
+
export { AgentsResource, AlertsResource, ApiTokensResource, AppointmentsResource, AuthResource, type AuthSendCodeRequest, type AuthVerifyResponse, type BackendWarp, type BackendWarpBrand, BillingAddressesResource, BillingResource, BlueprintsResource, type CacheConfig, CachedHttpService, CampaignsResource, CardsResource, CartsResource, ChangelogResource, CharactersResource, ContactsResource, ContractsResource, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, FlowsResource, GoalsResource, IngestionsResource, InquiriesResource, IntegrationsResource, IntentsResource, ItemsResource, JoAiClient, type JoAiClientConfig, KvResource, LinksResource, LoyaltyResource, McpResource, MeetingsResource, MemoriesResource, MessagesResource, MissionsResource, NotificationsResource, OfficeResource, type OpeningHoursEntry, type OpeningHoursFormatOptions, OrdersResource, PersonaResource, type Product, type ProductVariation, ProductsResource, ProjectsResource, RemindersResource, SegmentsResource, ServicesResource, ShortcutsResource, SitesResource, SkillsResource, StatsResource, StoreResource, SubscriptionsResource, SwarmsResource, TagsResource, TasksResource, type TeamInviteInfo, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, WebhooksResource, WorkspaceResource, createClient, formatOpeningHours };
|
package/dist/index.mjs
CHANGED
|
@@ -1946,6 +1946,23 @@ var TasksResource = class {
|
|
|
1946
1946
|
}
|
|
1947
1947
|
};
|
|
1948
1948
|
//#endregion
|
|
1949
|
+
//#region src/resources/tags.ts
|
|
1950
|
+
var TagsResource = class {
|
|
1951
|
+
constructor(http) {
|
|
1952
|
+
this.http = http;
|
|
1953
|
+
}
|
|
1954
|
+
list(type) {
|
|
1955
|
+
const qs = type ? `?type=${type}` : "";
|
|
1956
|
+
return this.http.get(`tags${qs}`);
|
|
1957
|
+
}
|
|
1958
|
+
create(name, type) {
|
|
1959
|
+
return this.http.post("tags", {
|
|
1960
|
+
name,
|
|
1961
|
+
type
|
|
1962
|
+
});
|
|
1963
|
+
}
|
|
1964
|
+
};
|
|
1965
|
+
//#endregion
|
|
1949
1966
|
//#region src/resources/teams.ts
|
|
1950
1967
|
var TeamsResource = class {
|
|
1951
1968
|
constructor(http) {
|
|
@@ -2071,9 +2088,6 @@ var SegmentsResource = class {
|
|
|
2071
2088
|
count(payload) {
|
|
2072
2089
|
return this.http.post("segments/count", payload);
|
|
2073
2090
|
}
|
|
2074
|
-
tags() {
|
|
2075
|
-
return this.http.get("segments/tags");
|
|
2076
|
-
}
|
|
2077
2091
|
};
|
|
2078
2092
|
//#endregion
|
|
2079
2093
|
//#region src/resources/updates.ts
|
|
@@ -2085,6 +2099,8 @@ var UpdatesResource = class {
|
|
|
2085
2099
|
const query = new URLSearchParams();
|
|
2086
2100
|
if (params?.type) query.set("type", params.type);
|
|
2087
2101
|
if (params?.tags) query.set("tags", params.tags);
|
|
2102
|
+
if (params?.team) query.set("team", params.team);
|
|
2103
|
+
if (params?.active != null) query.set("active", String(params.active));
|
|
2088
2104
|
if (params?.with?.length) query.set("with", params.with.join(","));
|
|
2089
2105
|
const qs = query.toString();
|
|
2090
2106
|
return this.http.get(`updates/public${qs ? "?" + qs : ""}`);
|
|
@@ -2625,6 +2641,7 @@ var JoAiClient = class {
|
|
|
2625
2641
|
this.subscriptions = new SubscriptionsResource(this.http);
|
|
2626
2642
|
this.swarms = new SwarmsResource(this.http);
|
|
2627
2643
|
this.tasks = new TasksResource(this.http);
|
|
2644
|
+
this.tags = new TagsResource(this.http);
|
|
2628
2645
|
this.teams = new TeamsResource(this.http);
|
|
2629
2646
|
this.campaigns = new CampaignsResource(this.http);
|
|
2630
2647
|
this.segments = new SegmentsResource(this.http);
|
|
@@ -2679,4 +2696,4 @@ var DistributionResource = class {
|
|
|
2679
2696
|
}
|
|
2680
2697
|
};
|
|
2681
2698
|
//#endregion
|
|
2682
|
-
export { AgentsResource, AlertsResource, ApiTokensResource, AppointmentsResource, AuthResource, BillingAddressesResource, BillingResource, BlueprintsResource, CachedHttpService, CampaignsResource, CardsResource, CartsResource, ChangelogResource, CharactersResource, ContactsResource, ContractsResource, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, FlowsResource, GoalsResource, IngestionsResource, InquiriesResource, IntegrationsResource, IntentsResource, ItemsResource, JoAiClient, KvResource, LinksResource, LoyaltyResource, McpResource, MeetingsResource, MemoriesResource, MessagesResource, MissionsResource, NotificationsResource, OfficeResource, OrdersResource, PersonaResource, ProductsResource, ProjectsResource, RemindersResource, SegmentsResource, ServicesResource, ShortcutsResource, SitesResource, SkillsResource, StatsResource, StoreResource, SubscriptionsResource, SwarmsResource, TasksResource, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, WebhooksResource, WorkspaceResource, createClient, formatOpeningHours };
|
|
2699
|
+
export { AgentsResource, AlertsResource, ApiTokensResource, AppointmentsResource, AuthResource, BillingAddressesResource, BillingResource, BlueprintsResource, CachedHttpService, CampaignsResource, CardsResource, CartsResource, ChangelogResource, CharactersResource, ContactsResource, ContractsResource, DeskResource, DistributionResource, DocumentsResource, ElementsResource, EntitiesResource, FlowsResource, GoalsResource, IngestionsResource, InquiriesResource, IntegrationsResource, IntentsResource, ItemsResource, JoAiClient, KvResource, LinksResource, LoyaltyResource, McpResource, MeetingsResource, MemoriesResource, MessagesResource, MissionsResource, NotificationsResource, OfficeResource, OrdersResource, PersonaResource, ProductsResource, ProjectsResource, RemindersResource, SegmentsResource, ServicesResource, ShortcutsResource, SitesResource, SkillsResource, StatsResource, StoreResource, SubscriptionsResource, SwarmsResource, TagsResource, TasksResource, TeamsResource, UpdatesResource, UpgradesResource, UsersResource, VoiceResource, WalletsResource, WarpsResource, WebhooksResource, WorkspaceResource, createClient, formatOpeningHours };
|