@joai/sdk 1.3.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 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
- 'currency'?: string;
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
- 'contactPropertyMaskWarp'?: string;
286
- 'branding'?: TeamBrand | null;
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;
@@ -3082,7 +3090,7 @@ declare class CartsResource {
3082
3090
  private readonly http;
3083
3091
  constructor(http: IHttpService);
3084
3092
  get(): Promise<IAppResponse<Cart>>;
3085
- 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>>;
3086
3094
  remove(type: 'product' | 'service', id: string): Promise<IAppResponse<Cart>>;
3087
3095
  updateQuantity(type: 'product' | 'service', id: string, quantity: number): Promise<IAppResponse<Cart>>;
3088
3096
  clear(): Promise<IAppResponse<Cart>>;
@@ -3092,11 +3100,16 @@ declare class CartsResource {
3092
3100
  //#region src/resources/coupons.d.ts
3093
3101
  type CouponPayload = {
3094
3102
  code: string;
3103
+ name?: TranslatableValue;
3095
3104
  percent?: number | null;
3096
3105
  amount?: number | null;
3106
+ price?: number | null;
3107
+ active?: boolean;
3108
+ public?: boolean;
3097
3109
  condition?: CouponCondition;
3098
3110
  usesLeft?: number | null;
3099
3111
  expiresAt?: string | null;
3112
+ media?: MediaLibraryAttributes[];
3100
3113
  };
3101
3114
  declare class CouponsResource {
3102
3115
  private readonly http;
@@ -3623,7 +3636,7 @@ declare class OrdersResource {
3623
3636
  sendConfirmation?: boolean;
3624
3637
  items?: {
3625
3638
  id: string;
3626
- type: 'product' | 'service';
3639
+ type: 'product' | 'service' | 'coupon';
3627
3640
  quantity: number;
3628
3641
  configuration?: Configuration;
3629
3642
  }[];
@@ -4050,6 +4063,8 @@ declare class UpdatesResource {
4050
4063
  listPublic(params?: {
4051
4064
  type?: string;
4052
4065
  tags?: string;
4066
+ team?: string;
4067
+ active?: boolean;
4053
4068
  with?: UpdateRelation[];
4054
4069
  }): Promise<IAppResponse<Update[]>>;
4055
4070
  list(params?: {
package/dist/index.mjs CHANGED
@@ -2099,6 +2099,8 @@ var UpdatesResource = class {
2099
2099
  const query = new URLSearchParams();
2100
2100
  if (params?.type) query.set("type", params.type);
2101
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));
2102
2104
  if (params?.with?.length) query.set("with", params.with.join(","));
2103
2105
  const qs = query.toString();
2104
2106
  return this.http.get(`updates/public${qs ? "?" + qs : ""}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joai/sdk",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "JoAi public API SDK — build with your AI agents",
5
5
  "license": "MIT",
6
6
  "type": "module",