arky-sdk 0.4.0 → 0.4.2

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/types.d.ts CHANGED
@@ -1,3 +1,11 @@
1
+ interface PaymentRefund {
2
+ id: string;
3
+ entity: string;
4
+ total: number;
5
+ providerRefundId?: string;
6
+ status: string;
7
+ createdAt: number;
8
+ }
1
9
  interface Payment {
2
10
  currency: string;
3
11
  market: string;
@@ -5,6 +13,7 @@ interface Payment {
5
13
  shipping: number;
6
14
  discount: number;
7
15
  total: number;
16
+ paid: number;
8
17
  tax?: {
9
18
  amount: number;
10
19
  modeSnapshot?: string;
@@ -29,41 +38,37 @@ interface Payment {
29
38
  subscriptionId?: string;
30
39
  priceId?: string;
31
40
  };
41
+ refunds: PaymentRefund[];
42
+ zoneId?: string;
43
+ paymentMethodId?: string;
44
+ shippingMethodId?: string;
32
45
  }
33
46
  declare enum PaymentMethodType {
34
47
  Cash = "CASH",
35
48
  CreditCard = "CREDIT_CARD",
36
49
  Free = "FREE"
37
50
  }
38
- interface QuoteLineItem {
39
- itemType: string;
40
- id: string;
41
- name: string;
42
- quantity: number;
43
- unitPrice: number;
44
- total: number;
45
- }
46
51
  interface PromoCodeValidation {
47
- id: string;
52
+ promoCodeId: string;
48
53
  code: string;
49
- discountType: any;
50
- discountValue: number;
54
+ discounts: any[];
51
55
  conditions: any[];
52
56
  }
53
57
  interface Quote {
54
- currency: string;
55
58
  market: string;
59
+ zone: Zone;
56
60
  subtotal: number;
57
61
  shipping: number;
58
62
  discount: number;
63
+ tax: number;
59
64
  total: number;
60
- lineItems: QuoteLineItem[];
61
65
  shippingMethod: ShippingMethod | null;
66
+ paymentMethod: PaymentMethod | null;
62
67
  promoCode: PromoCodeValidation | null;
63
- shippingMethods: ShippingMethod[];
64
- paymentMethods: PaymentMethod[];
65
68
  payment: Payment;
66
69
  chargeAmount: number;
70
+ id?: string;
71
+ expiresAt?: number;
67
72
  }
68
73
  interface Price {
69
74
  market: string;
@@ -74,8 +79,8 @@ interface Location {
74
79
  country?: string | null;
75
80
  address?: string | null;
76
81
  city?: string | null;
82
+ state?: string | null;
77
83
  postalCode?: string | null;
78
- countryCode?: string | null;
79
84
  coordinates?: {
80
85
  lat: number;
81
86
  lon: number;
@@ -115,12 +120,10 @@ interface ShippingWeightTier {
115
120
  }
116
121
  interface PaymentMethod {
117
122
  id: string;
118
- name: Record<string, string>;
119
123
  type: PaymentMethodType;
120
124
  }
121
125
  interface ShippingMethod {
122
126
  id: string;
123
- name: Record<string, string>;
124
127
  taxable: boolean;
125
128
  etaText: string;
126
129
  pickupLocation?: Location;
@@ -128,10 +131,11 @@ interface ShippingMethod {
128
131
  freeAbove?: number;
129
132
  weightTiers?: ShippingWeightTier[];
130
133
  }
134
+ type ZoneScope = "ORDER" | "RESERVATION";
131
135
  interface Zone {
132
136
  id: string;
133
- name: string;
134
137
  marketId: string;
138
+ scope: ZoneScope;
135
139
  countries: string[];
136
140
  states: string[];
137
141
  postalCodes: string[];
@@ -157,16 +161,29 @@ interface BusinessConfig {
157
161
  zones: Zone[];
158
162
  buildHooks: string[];
159
163
  webhooks: any[];
160
- orderBlocks: any[];
161
- reservationBlocks: any[];
162
164
  paymentProvider?: PaymentProviderConfig;
163
165
  aiProvider?: any;
164
166
  emails: BusinessEmails;
165
167
  }
168
+ interface Subscription {
169
+ id: string;
170
+ target: string;
171
+ planId: string;
172
+ pendingPlanId: string | null;
173
+ payment: any;
174
+ statuses: StatusEvent[];
175
+ endDate: number;
176
+ usage: Record<string, any>;
177
+ token: string;
178
+ }
166
179
  interface Business {
167
180
  id: string;
168
- name: string;
181
+ key: string;
182
+ networkKey: string | null;
183
+ timezone: string;
169
184
  configs?: BusinessConfig;
185
+ subscriptions?: Subscription[];
186
+ statuses?: StatusEvent[];
170
187
  }
171
188
  interface EshopStoreState {
172
189
  businessId: string;
@@ -175,10 +192,6 @@ interface EshopStoreState {
175
192
  processingCheckout: boolean;
176
193
  loading: boolean;
177
194
  error: string | null;
178
- phoneNumber: string;
179
- phoneError: string | null;
180
- verificationCode: string;
181
- verifyError: string | null;
182
195
  }
183
196
  interface Block {
184
197
  id: string;
@@ -187,6 +200,47 @@ interface Block {
187
200
  properties?: any;
188
201
  value?: any;
189
202
  }
203
+ type BlockType = "TEXT" | "LOCALIZED_TEXT" | "NUMBER" | "BOOLEAN" | "BLOCK" | "RELATIONSHIP_ENTRY" | "RELATIONSHIP_MEDIA" | "MARKDOWN" | "EMAIL" | "PHONE" | "ADDRESS";
204
+ type AddressType = "SHIPPING" | "BILLING";
205
+ interface EmailBlockProperties {
206
+ minValues?: number;
207
+ maxValues?: number;
208
+ }
209
+ interface PhoneBlockProperties {
210
+ minValues?: number;
211
+ maxValues?: number;
212
+ }
213
+ interface AddressBlockProperties {
214
+ minValues?: number;
215
+ maxValues?: number;
216
+ addressType: AddressType;
217
+ }
218
+ interface GeoLocationValue {
219
+ country?: string | null;
220
+ address?: string | null;
221
+ city?: string | null;
222
+ state?: string | null;
223
+ postalCode?: string | null;
224
+ coordinates?: {
225
+ lat: number;
226
+ lon: number;
227
+ } | null;
228
+ }
229
+ interface EmailBlock extends Block {
230
+ type: "EMAIL";
231
+ properties: EmailBlockProperties;
232
+ value: string[];
233
+ }
234
+ interface PhoneBlock extends Block {
235
+ type: "PHONE";
236
+ properties: PhoneBlockProperties;
237
+ value: string[];
238
+ }
239
+ interface AddressBlock extends Block {
240
+ type: "ADDRESS";
241
+ properties: AddressBlockProperties;
242
+ value: GeoLocationValue[];
243
+ }
190
244
  interface Seo {
191
245
  slug: Record<string, string>;
192
246
  metaTitle: Record<string, string>;
@@ -208,7 +262,7 @@ interface Media {
208
262
  title?: string | null;
209
263
  description?: string | null;
210
264
  alt?: string | null;
211
- owner: string;
265
+ entity: string;
212
266
  metadata?: string | null;
213
267
  uploadedAt: string;
214
268
  seo: Seo;
@@ -247,16 +301,6 @@ interface ReservationStoreState {
247
301
  loading: boolean;
248
302
  startDate: string | null;
249
303
  endDate: string | null;
250
- phoneNumber: string;
251
- phoneError: string | null;
252
- phoneSuccess: string | null;
253
- verificationCode: string;
254
- verifyError: string | null;
255
- isPhoneVerified: boolean;
256
- isSendingCode: boolean;
257
- isVerifying: boolean;
258
- codeSentAt: number | null;
259
- canResendAt: number | null;
260
304
  guestToken: string | null;
261
305
  service: any | null;
262
306
  business: Business | null;
@@ -273,6 +317,205 @@ interface ReservationStoreState {
273
317
  enabled: boolean;
274
318
  };
275
319
  }
320
+ interface StatusEvent {
321
+ id: string;
322
+ changedBy: 'BUSINESS' | 'USER' | 'SYSTEM';
323
+ userId?: string;
324
+ status: string;
325
+ note?: string;
326
+ timestamp: number;
327
+ }
328
+ interface ReservationItem {
329
+ id: string;
330
+ serviceId: string;
331
+ providerId: string;
332
+ businessId: string;
333
+ reservationId: string;
334
+ userId: string;
335
+ from: number;
336
+ to: number;
337
+ blocks: Block[];
338
+ price: Price;
339
+ }
340
+ interface Reservation {
341
+ id: string;
342
+ number: string;
343
+ userId: string;
344
+ blocks: Block[];
345
+ businessId: string;
346
+ statuses: StatusEvent[];
347
+ serviceIds: string[];
348
+ providerIds: string[];
349
+ payment: Payment;
350
+ business?: Business;
351
+ user?: any;
352
+ items: ReservationItem[];
353
+ createdAt: number;
354
+ lastModified: number;
355
+ }
356
+ interface NodeConfig {
357
+ parentId?: string | null;
358
+ isPubliclyReadable: boolean;
359
+ isPubliclyWritable: boolean;
360
+ }
361
+ interface Node {
362
+ id: string;
363
+ key: string;
364
+ businessId: string;
365
+ blocks: Block[];
366
+ statuses: StatusEvent[];
367
+ seo: Seo;
368
+ config: NodeConfig;
369
+ emailSubject?: Record<string, string>;
370
+ children: Node[];
371
+ createdAt: number;
372
+ updatedAt: number;
373
+ }
374
+ interface ServiceDuration {
375
+ duration: number;
376
+ isPause?: boolean;
377
+ }
378
+ interface ServiceProvider {
379
+ id: string;
380
+ providerId: string;
381
+ workingTime: {
382
+ workingDays: Array<{
383
+ day: string;
384
+ workingHours: Array<{
385
+ from: number;
386
+ to: number;
387
+ }>;
388
+ }>;
389
+ outcastDates: Array<{
390
+ month: number;
391
+ day: number;
392
+ workingHours: Array<{
393
+ from: number;
394
+ to: number;
395
+ }>;
396
+ }>;
397
+ specificDates: Array<{
398
+ date: number;
399
+ workingHours: Array<{
400
+ from: number;
401
+ to: number;
402
+ }>;
403
+ }>;
404
+ };
405
+ provider?: Provider;
406
+ }
407
+ interface Service {
408
+ id: string;
409
+ key: string;
410
+ seo: Seo;
411
+ businessId: string;
412
+ prices: Price[];
413
+ durations: ServiceDuration[];
414
+ blocks: Block[];
415
+ nodeIds: string[];
416
+ isApprovalRequired: boolean;
417
+ providers: ServiceProvider[];
418
+ createdAt: number;
419
+ updatedAt: number;
420
+ statuses: StatusEvent[];
421
+ }
422
+ interface ProviderTimelinePoint {
423
+ timestamp: number;
424
+ concurrent: number;
425
+ }
426
+ interface Provider {
427
+ id: string;
428
+ key: string;
429
+ seo: Seo;
430
+ businessId: string;
431
+ statuses: StatusEvent[];
432
+ concurrentLimit: number;
433
+ nodeIds: string[];
434
+ blocks: Block[];
435
+ timeline: ProviderTimelinePoint[];
436
+ createdAt: number;
437
+ updatedAt: number;
438
+ }
439
+ interface Workflow {
440
+ id: string;
441
+ key: string;
442
+ businessId: string;
443
+ secret: string;
444
+ statuses: StatusEvent[];
445
+ nodes: Record<string, WorkflowNode>;
446
+ edges: WorkflowEdge[];
447
+ /** Optional cron schedule expression (e.g., "0 9 * * *" for 9am daily) */
448
+ schedule?: string;
449
+ createdAt: number;
450
+ updatedAt: number;
451
+ }
452
+ interface WorkflowEdge {
453
+ id: string;
454
+ source: string;
455
+ sourceOutput: string;
456
+ target: string;
457
+ }
458
+ type WorkflowNode = WorkflowTriggerNode | WorkflowHttpNode | WorkflowIfNode | WorkflowLoopNode | WorkflowWaitNode;
459
+ interface WorkflowTriggerNode {
460
+ type: 'trigger';
461
+ event?: string;
462
+ }
463
+ interface WorkflowHttpNode {
464
+ type: 'http';
465
+ method: WorkflowHttpMethod;
466
+ url: string;
467
+ headers?: Record<string, string>;
468
+ body?: any;
469
+ timeoutMs?: number;
470
+ }
471
+ interface WorkflowIfNode {
472
+ type: 'if';
473
+ condition: string;
474
+ }
475
+ interface WorkflowLoopNode {
476
+ type: 'loop';
477
+ array: string;
478
+ }
479
+ interface WorkflowWaitNode {
480
+ type: 'wait';
481
+ duration: string;
482
+ }
483
+ type WorkflowHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
484
+ type ExecutionStatus = 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'WAITING';
485
+ interface WorkflowExecution {
486
+ id: string;
487
+ workflowId: string;
488
+ businessId: string;
489
+ status: ExecutionStatus;
490
+ input: Record<string, any>;
491
+ nodeOutputs: Record<string, any>;
492
+ currentNode?: string;
493
+ error?: string;
494
+ scheduledAt: number;
495
+ startedAt: number;
496
+ completedAt?: number;
497
+ createdAt: number;
498
+ updatedAt: number;
499
+ }
500
+ interface Audience {
501
+ id: string;
502
+ businessId: string;
503
+ key: string;
504
+ name: string;
505
+ nodeIds: string[];
506
+ prices: Price[];
507
+ statuses: StatusEvent[];
508
+ createdAt: number;
509
+ updatedAt: number;
510
+ }
511
+ interface AudienceAccessResponse {
512
+ hasAccess: boolean;
513
+ subscription?: Subscription;
514
+ }
515
+ interface AudienceSubscribeResponse {
516
+ checkoutUrl?: string;
517
+ subscription?: Subscription;
518
+ }
276
519
 
277
520
  interface RequestOptions<T = any> {
278
521
  headers?: Record<string, string>;
@@ -306,45 +549,96 @@ interface EshopItem {
306
549
  }
307
550
  interface GetQuoteParams {
308
551
  items: EshopItem[];
309
- paymentMethod: string;
552
+ paymentMethodId?: string;
310
553
  shippingMethodId?: string;
311
554
  promoCode?: string;
312
- location?: any;
555
+ blocks?: any[];
313
556
  }
314
- interface CheckoutParams {
557
+ interface OrderCheckoutParams {
315
558
  items: EshopItem[];
316
- paymentMethod: string;
559
+ paymentMethodId?: string;
317
560
  blocks?: any[];
318
561
  shippingMethodId: string;
319
- promoCode?: string;
320
- zoneId?: string;
562
+ promoCodeId?: string;
321
563
  }
322
564
  interface GetProductsParams {
323
- categoryIds?: string[] | null;
565
+ ids?: string[];
566
+ nodeIds?: string[] | null;
567
+ nodeId?: string | null;
568
+ blocks?: any[] | null;
324
569
  status?: string;
325
570
  limit?: number;
326
571
  cursor?: string;
572
+ query?: string;
573
+ statuses?: string[];
574
+ sortField?: string;
575
+ sortDirection?: string;
576
+ createdAtFrom?: number | null;
577
+ createdAtTo?: number | null;
327
578
  }
328
- interface GetCollectionEntriesParams {
329
- collectionId: string;
579
+ interface GetNodesParams {
580
+ businessId?: string;
581
+ parentId?: string;
330
582
  limit?: number;
331
583
  cursor?: string;
332
584
  ids?: string[];
585
+ query?: string;
586
+ type?: string;
587
+ key?: string;
588
+ statuses?: string[];
589
+ sortField?: string;
590
+ sortDirection?: string;
591
+ createdAtFrom?: string;
592
+ createdAtTo?: string;
593
+ includeChildren?: boolean;
333
594
  }
334
- interface CreateCollectionEntryParams {
335
- collectionId: string;
336
- blocks: any[];
595
+ interface CreateNodeParams {
596
+ businessId?: string;
597
+ key: string;
598
+ blocks?: any[];
599
+ seo?: any;
337
600
  status?: string;
601
+ config?: {
602
+ parentId?: string | null;
603
+ isPubliclyReadable?: boolean;
604
+ isPubliclyWritable?: boolean;
605
+ };
606
+ /** Email subject for email template nodes */
607
+ emailSubject?: string;
338
608
  }
339
- interface GetCollectionEntryParams {
340
- collectionId: string;
609
+ interface UpdateNodeParams {
341
610
  id: string;
611
+ businessId?: string;
612
+ key?: string;
613
+ blocks?: any[];
614
+ seo?: any;
615
+ status?: string;
616
+ config?: {
617
+ parentId?: string | null;
618
+ isPubliclyReadable?: boolean;
619
+ isPubliclyWritable?: boolean;
620
+ };
621
+ /** Email subject for email template nodes */
622
+ emailSubject?: string;
342
623
  }
343
- interface DeleteCollectionEntryParams {
344
- collectionId: string;
624
+ interface GetNodeParams {
625
+ id?: string;
626
+ slug?: string;
627
+ key?: string;
628
+ businessId?: string;
629
+ }
630
+ interface DeleteNodeParams {
631
+ id: string;
632
+ businessId?: string;
633
+ }
634
+ interface GetNodeChildrenParams {
345
635
  id: string;
636
+ businessId?: string;
637
+ limit?: number;
638
+ cursor?: string;
346
639
  }
347
640
  interface UploadBusinessMediaParams {
641
+ businessId?: string;
348
642
  files?: File[];
349
643
  urls?: string[];
350
644
  }
@@ -354,27 +648,34 @@ interface DeleteBusinessMediaParams {
354
648
  }
355
649
  interface UpdateMediaParams {
356
650
  mediaId: string;
651
+ businessId?: string;
357
652
  seo?: any;
358
653
  title?: string;
359
654
  description?: string;
360
655
  alt?: string;
361
656
  }
362
657
  interface GetBusinessMediaParams {
658
+ businessId?: string;
363
659
  cursor?: string | null;
364
- limit?: number;
660
+ limit: number;
661
+ ids?: string[];
662
+ query?: string;
663
+ mimeType?: string;
664
+ sortField?: string;
665
+ sortDirection?: 'asc' | 'desc';
365
666
  }
366
- interface LoginUserParams {
667
+ interface LoginAccountParams {
367
668
  email?: string;
368
- password?: string;
369
669
  provider: string;
370
670
  token?: string;
371
- code?: string;
372
- originUrl?: string;
373
671
  }
374
- interface RegisterUserParams {
375
- name: string;
672
+ interface MagicLinkRequestParams {
673
+ email: string;
674
+ businessId?: string;
675
+ }
676
+ interface MagicLinkVerifyParams {
376
677
  email: string;
377
- password: string;
678
+ code: string;
378
679
  }
379
680
  interface AddPhoneNumberParams {
380
681
  phoneNumber: string;
@@ -384,33 +685,42 @@ interface PhoneNumberConfirmParams {
384
685
  code: string;
385
686
  }
386
687
  interface GetServicesParams {
688
+ businessId?: string;
387
689
  providerId?: string;
388
690
  limit?: number;
389
691
  cursor?: string;
692
+ query?: string;
693
+ ids?: string[];
694
+ statuses?: string[];
695
+ nodeId?: string;
696
+ blocks?: any[];
697
+ sortField?: string;
698
+ sortDirection?: string;
699
+ priceFrom?: number;
700
+ priceTo?: number;
390
701
  }
391
702
  interface ReservationCheckoutParams {
703
+ businessId?: string;
392
704
  items: any[];
393
- paymentMethod?: string;
705
+ paymentMethodId?: string;
394
706
  blocks?: any[];
395
- promoCode?: string;
396
- zoneId?: string;
707
+ promoCodeId?: string;
708
+ location?: Location;
397
709
  }
398
- interface GetReservationQuoteParams {
399
- items: any[];
400
- paymentMethod: string;
401
- promoCode?: string;
402
- location?: any;
403
- zoneId?: string;
404
- }
405
- interface GetServiceProvidersParams {
710
+ interface ReservationQuoteItem {
406
711
  serviceId: string;
407
712
  from: number;
408
713
  to: number;
714
+ providerId: string;
715
+ }
716
+ interface GetReservationQuoteParams {
717
+ businessId?: string;
718
+ items: ReservationQuoteItem[];
719
+ paymentMethodId?: string;
720
+ promoCode?: string;
721
+ location?: Location;
409
722
  }
410
723
  interface TimelinePoint {
411
- id: string;
412
- providerId: string;
413
- businessId: string;
414
724
  timestamp: number;
415
725
  concurrent: number;
416
726
  }
@@ -438,14 +748,13 @@ interface WorkingTime {
438
748
  }
439
749
  interface ProviderWithTimeline {
440
750
  id: string;
441
- name: Record<string, string>;
751
+ key: string;
442
752
  businessId: string;
443
753
  seo: any;
444
- blocks: Block[];
445
754
  statuses: any[];
446
755
  concurrentLimit: number;
447
- categoryIds: string[];
448
- categoryFilterBlocks: Block[];
756
+ nodeIds: string[];
757
+ blocks: Block[];
449
758
  createdAt: number;
450
759
  updatedAt: number;
451
760
  workingTime: WorkingTime | null;
@@ -460,28 +769,7 @@ interface GetAnalyticsParams {
460
769
  }
461
770
  interface GetAnalyticsHealthParams {
462
771
  }
463
- interface CreateRoleParams {
464
- name: string;
465
- parentRoles?: string[];
466
- permissions?: any[];
467
- [key: string]: any;
468
- }
469
- interface UpdateRoleParams {
470
- id: string;
471
- name?: string;
472
- parentRoles?: string[];
473
- permissions?: any[];
474
- [key: string]: any;
475
- }
476
- interface DeleteRoleParams {
477
- id: string;
478
- }
479
- interface GetRoleParams {
480
- id: string;
481
- }
482
- interface GetRolesParams {
483
- action: string;
484
- }
772
+ type BusinessRole = 'Admin' | 'Owner' | 'Super';
485
773
  interface Discount {
486
774
  type: "ITEMS_PERCENTAGE" | "ITEMS_FIXED" | "SHIPPING_PERCENTAGE";
487
775
  marketId: string;
@@ -528,7 +816,7 @@ interface GetPromoCodesParams {
528
816
  expiresAtTo?: string;
529
817
  }
530
818
  interface CreateBusinessParams {
531
- name: string;
819
+ key: string;
532
820
  slug?: string;
533
821
  description?: string;
534
822
  email?: string;
@@ -540,15 +828,11 @@ interface CreateBusinessParams {
540
828
  }
541
829
  interface UpdateBusinessParams {
542
830
  id: string;
543
- name?: string;
544
- slug?: string;
545
- description?: string;
546
- email?: string;
547
- phone?: string;
548
- website?: string;
549
- address?: any;
550
- settings?: any;
551
- [key: string]: any;
831
+ key: string;
832
+ networkKey: string | null;
833
+ timezone: string;
834
+ statuses: any[];
835
+ configs: any;
552
836
  }
553
837
  interface DeleteBusinessParams {
554
838
  id: string;
@@ -572,7 +856,7 @@ interface CreatePortalSessionParams {
572
856
  }
573
857
  interface InviteUserParams {
574
858
  email: string;
575
- roleIds?: string[] | null;
859
+ role?: BusinessRole;
576
860
  }
577
861
  interface HandleInvitationParams {
578
862
  token: string;
@@ -581,71 +865,13 @@ interface HandleInvitationParams {
581
865
  interface TestWebhookParams {
582
866
  webhook: any;
583
867
  }
584
- interface CreateCollectionParams {
585
- name: string;
586
- description?: string;
587
- schema?: any;
588
- [key: string]: any;
589
- }
590
- interface UpdateCollectionParams {
591
- id: string;
592
- name?: string;
593
- description?: string;
594
- schema?: any;
595
- [key: string]: any;
596
- }
597
- interface DeleteCollectionParams {
598
- id: string;
599
- }
600
- interface GetCollectionParams {
601
- id: string;
602
- }
603
- interface GetCollectionsParams {
604
- name?: string | null;
605
- ids?: string[] | null;
606
- }
607
- interface GetEntriesParams {
608
- collectionId: string;
609
- limit?: number;
610
- cursor?: string;
611
- ids?: string[] | null;
612
- query?: string | null;
613
- type?: string | null;
614
- statuses?: string[] | null;
615
- sortField?: string | null;
616
- sortDirection?: string | null;
617
- createdAtFrom?: string | null;
618
- createdAtTo?: string | null;
619
- parentId?: string | null;
620
- }
621
- interface CreateEntryParams {
622
- collectionId: string;
623
- blocks: any[];
624
- status?: string;
625
- [key: string]: any;
626
- }
627
- interface UpdateEntryParams {
628
- collectionId: string;
629
- id: string;
630
- blocks?: any[];
631
- status?: string;
632
- [key: string]: any;
633
- }
634
868
  interface GenerateBlocksParams {
635
869
  [key: string]: any;
636
870
  }
637
871
  interface GetVariableMetadataParams {
638
- entryType: string;
639
- }
640
- interface SendEntryParams {
641
- collectionId: string;
642
- entryId: string;
643
- scheduledAt?: number;
872
+ nodeType: string;
644
873
  }
645
- interface GetCollectionSubscribersParams {
646
- id: string;
647
- }
648
- interface UserSubscribeParams {
874
+ interface AccountSubscribeParams {
649
875
  target?: string;
650
876
  identifier: string;
651
877
  planId?: string;
@@ -653,10 +879,9 @@ interface UserSubscribeParams {
653
879
  cancelUrl?: string;
654
880
  }
655
881
  interface CreateProductParams {
656
- name: string;
882
+ key: string;
657
883
  description?: string;
658
- categoryIds?: string[];
659
- categoryFilterBlocks?: any[];
884
+ nodeIds?: string[];
660
885
  blocks?: any[];
661
886
  variants?: any[];
662
887
  status?: string;
@@ -664,23 +889,23 @@ interface CreateProductParams {
664
889
  }
665
890
  interface UpdateProductParams {
666
891
  id: string;
667
- name?: string;
892
+ key?: string;
668
893
  description?: string;
669
- categoryIds?: string[];
670
- categoryFilterBlocks?: any[];
894
+ nodeIds?: string[];
671
895
  blocks?: any[];
672
896
  variants?: any[];
673
897
  status?: string;
674
898
  [key: string]: any;
675
899
  }
676
900
  interface GetProductParams {
677
- id: string;
901
+ id?: string;
902
+ slug?: string;
678
903
  }
679
904
  interface GetOrderParams {
680
905
  id: string;
681
906
  }
682
907
  interface GetOrdersParams {
683
- userId?: string | null;
908
+ accountId?: string | null;
684
909
  statuses?: string[] | null;
685
910
  productIds?: string[];
686
911
  query?: string | null;
@@ -691,24 +916,19 @@ interface GetOrdersParams {
691
916
  createdAtFrom?: string | null;
692
917
  createdAtTo?: string | null;
693
918
  }
694
- interface UpdateOrderStatusParams {
695
- id: string;
696
- status: string;
697
- [key: string]: any;
698
- }
699
- interface UpdateOrderPaymentStatusParams {
700
- id: string;
701
- paymentStatus: string;
702
- [key: string]: any;
703
- }
704
919
  interface UpdateOrderParams {
705
- id?: string;
706
- [key: string]: any;
920
+ id: string;
921
+ statuses: any[];
922
+ blocks: any[];
923
+ items: any[];
924
+ address?: any | null;
925
+ payment?: any | null;
707
926
  }
708
927
  interface CreateOrderParams {
709
928
  [key: string]: any;
710
929
  }
711
930
  interface CreateReservationParams {
931
+ businessId?: string;
712
932
  [key: string]: any;
713
933
  }
714
934
  interface UpdateReservationParams {
@@ -716,62 +936,78 @@ interface UpdateReservationParams {
716
936
  statuses?: any;
717
937
  blocks?: any;
718
938
  parts?: any;
939
+ payment?: any | null;
719
940
  [key: string]: any;
720
941
  }
721
942
  interface CreateProviderParams {
722
- name: string;
943
+ businessId?: string;
944
+ key: string;
945
+ nodeIds?: string[];
723
946
  blocks?: any[];
724
- categoryIds?: string[];
725
- categoryFilterBlocks?: any[];
726
947
  concurrentLimit?: number;
727
948
  statuses?: any[];
728
949
  [key: string]: any;
729
950
  }
730
951
  interface UpdateProviderParams {
731
952
  id: string;
732
- name?: string;
953
+ businessId?: string;
954
+ key?: string;
955
+ nodeIds?: string[];
733
956
  blocks?: any[];
734
- categoryIds?: string[];
735
- categoryFilterBlocks?: any[];
736
957
  concurrentLimit?: number;
737
958
  statuses?: any[];
738
959
  [key: string]: any;
739
960
  }
740
961
  interface DeleteProviderParams {
741
962
  id: string;
963
+ businessId?: string;
964
+ }
965
+ interface ServiceProviderInput {
966
+ id?: string;
967
+ providerId: string;
968
+ workingTime: WorkingTime;
742
969
  }
743
970
  interface CreateServiceParams {
744
- name: string;
971
+ businessId?: string;
972
+ key: string;
973
+ nodeIds?: string[];
745
974
  blocks?: any[];
746
- reservationBlocks?: any[];
747
- categoryIds?: string[];
748
- categoryFilterBlocks?: any[];
749
975
  prices?: any[];
750
976
  durations?: any[];
751
- reservationConfigs?: any;
977
+ isApprovalRequired?: boolean;
752
978
  statuses?: any[];
979
+ providers?: ServiceProviderInput[];
753
980
  [key: string]: any;
754
981
  }
755
982
  interface UpdateServiceParams {
756
983
  id: string;
757
- name?: string;
984
+ businessId?: string;
985
+ key?: string;
986
+ nodeIds?: string[];
758
987
  blocks?: any[];
759
- reservationBlocks?: any[];
760
- categoryIds?: string[];
761
- categoryFilterBlocks?: any[];
762
988
  prices?: any[];
763
989
  durations?: any[];
764
- reservationConfigs?: any;
990
+ isApprovalRequired?: boolean;
765
991
  statuses?: any[];
992
+ providers?: ServiceProviderInput[];
766
993
  [key: string]: any;
767
994
  }
768
995
  interface DeleteServiceParams {
769
996
  id: string;
997
+ businessId?: string;
998
+ }
999
+ interface BulkScheduleParams {
1000
+ serviceIds: string[];
1001
+ providerIds: string[];
1002
+ workingTime: WorkingTime;
770
1003
  }
771
1004
  interface GetServiceParams {
772
- id: string;
1005
+ id?: string;
1006
+ slug?: string;
1007
+ businessId?: string;
773
1008
  }
774
1009
  interface GetProvidersParams {
1010
+ businessId?: string;
775
1011
  serviceId?: string;
776
1012
  ids?: string[];
777
1013
  query?: string | null;
@@ -782,29 +1018,28 @@ interface GetProvidersParams {
782
1018
  sortDirection?: string | null;
783
1019
  createdAtFrom?: string | null;
784
1020
  createdAtTo?: string | null;
785
- categoryId?: string | null;
786
- categoryFilterBlocks?: string | null;
1021
+ nodeId?: string | null;
1022
+ blocks?: string | null;
787
1023
  }
788
1024
  interface GetProviderParams {
789
- id: string;
1025
+ id?: string;
1026
+ slug?: string;
1027
+ businessId?: string;
790
1028
  }
791
1029
  interface GetBusinessServiceWorkingTimeParams {
792
1030
  providerId: string;
793
1031
  serviceId?: string;
794
1032
  }
795
- interface SearchMyReservationsParams {
796
- limit?: number;
797
- status?: string;
798
- cursor?: string;
799
- }
800
1033
  interface GetReservationParams {
801
1034
  id: string;
1035
+ businessId?: string;
802
1036
  }
803
1037
  interface SearchReservationsParams {
1038
+ businessId?: string;
804
1039
  query?: string;
805
1040
  serviceIds?: string[];
806
1041
  providerIds?: string[];
807
- userId?: string;
1042
+ accountId?: string;
808
1043
  from?: number;
809
1044
  to?: number;
810
1045
  status?: string;
@@ -813,43 +1048,18 @@ interface SearchReservationsParams {
813
1048
  sortField?: string;
814
1049
  sortOrder?: string;
815
1050
  }
816
- interface UpdateUserProfileParams {
817
- name?: string;
1051
+ interface UpdateAccountProfileParams {
818
1052
  phoneNumbers?: string[];
819
1053
  addresses?: any[];
820
1054
  apiTokens?: any[] | null;
821
1055
  }
822
- interface SetRoleParams {
823
- userId: string;
824
- roleId: string;
825
- }
826
- interface SearchUsersParams {
1056
+ interface SearchAccountsParams {
827
1057
  limit?: number;
828
1058
  cursor?: string | null;
829
1059
  query?: string;
830
- roleIds?: string[];
831
1060
  owner?: string;
832
1061
  }
833
- interface ConfirmUserParams {
834
- token: string;
835
- }
836
- interface GetLoginUrlParams {
837
- provider: string;
838
- originUrl: string;
839
- redirectUrl: string;
840
- }
841
- interface ForgotPasswordParams {
842
- email: string;
843
- }
844
- interface ResetForgotPasswordParams {
845
- token: string;
846
- password: string;
847
- }
848
- interface ResetPasswordParams {
849
- newPassword: string;
850
- oldPassword?: string;
851
- }
852
- interface DeleteUserParams {
1062
+ interface DeleteAccountParams {
853
1063
  }
854
1064
  interface TrackEmailOpenParams {
855
1065
  trackingPixelId: string;
@@ -868,6 +1078,13 @@ interface GetMeParams {
868
1078
  interface LogoutParams {
869
1079
  }
870
1080
  interface GetBusinessesParams {
1081
+ query?: string;
1082
+ isNetwork?: boolean;
1083
+ statuses?: string[];
1084
+ limit?: number;
1085
+ cursor?: string;
1086
+ sortField?: string;
1087
+ sortDirection?: "asc" | "desc";
871
1088
  }
872
1089
  interface GetSubscriptionPlansParams {
873
1090
  }
@@ -877,13 +1094,12 @@ interface SetupAnalyticsParams {
877
1094
  interface GetBusinessMediaParams2 {
878
1095
  id: string;
879
1096
  cursor?: string | null;
880
- limit?: number;
881
- }
882
- interface SetProviderScheduleParams {
883
- id: string;
884
- workingTime: any;
885
- serviceIds: string[];
886
- providerIds: string[];
1097
+ limit: number;
1098
+ ids?: string[];
1099
+ query?: string;
1100
+ mimeType?: string;
1101
+ sortField?: string;
1102
+ sortDirection?: 'asc' | 'desc';
887
1103
  }
888
1104
  interface DeleteProductParams {
889
1105
  id: string;
@@ -896,86 +1112,7 @@ interface ProcessRefundParams {
896
1112
  entity: string;
897
1113
  amount: number;
898
1114
  }
899
- type FeatureFlagStatus = "DRAFT" | "ACTIVE" | "ARCHIVED";
900
- interface VariantInput {
901
- key: string;
902
- name: string;
903
- weight: number;
904
- payload?: Block[];
905
- }
906
- interface Variant extends VariantInput {
907
- assignments: number;
908
- conversions: number;
909
- }
910
- interface FeatureFlag {
911
- id: string;
912
- key: string;
913
- name: string;
914
- description?: string;
915
- businessId: string;
916
- status: FeatureFlagStatus;
917
- variants: Variant[];
918
- goalEvent?: string;
919
- createdAt: number;
920
- updatedAt: number;
921
- }
922
- interface VariantResult {
923
- variantKey: string;
924
- assignments: number;
925
- conversions: number;
926
- conversionRate: number;
927
- improvement?: number;
928
- }
929
- interface FlagResults {
930
- totalAssignments: number;
931
- totalConversions: number;
932
- variantResults: VariantResult[];
933
- }
934
- interface GetVariantResponse {
935
- flagKey: string;
936
- variantKey: string;
937
- variantName: string;
938
- payload: Block[];
939
- isNewAssignment: boolean;
940
- }
941
- interface TrackEventResponse {
942
- tracked: boolean;
943
- experimentsUpdated: number;
944
- }
945
- interface CreateFeatureFlagParams {
946
- key: string;
947
- name: string;
948
- description?: string;
949
- variants: VariantInput[];
950
- goalEvent?: string;
951
- }
952
- interface UpdateFeatureFlagParams {
953
- id: string;
954
- name?: string;
955
- description?: string;
956
- variants?: VariantInput[];
957
- goalEvent?: string;
958
- status?: FeatureFlagStatus;
959
- }
960
- interface DeleteFeatureFlagParams {
961
- id: string;
962
- }
963
- interface GetFeatureFlagParams {
964
- id: string;
965
- }
966
- interface GetFeatureFlagsParams {
967
- status?: FeatureFlagStatus;
968
- }
969
- interface GetFeatureFlagResultsParams {
970
- id: string;
971
- }
972
- interface GetVariantParams {
973
- flagKey: string;
974
- }
975
- interface TrackEventParams {
976
- eventName: string;
977
- value?: number;
978
- }
1115
+ type SystemTemplateKey = "system:reservation-business-update" | "system:reservation-customer-update" | "system:user-invitation" | "system:order-status-update" | "system:user-confirmation" | "system:forgot-password";
979
1116
  interface GetSlotsForDateParams {
980
1117
  serviceId: string;
981
1118
  date: Date;
@@ -1005,5 +1142,99 @@ interface Slot {
1005
1142
  timeText: string;
1006
1143
  dateText: string;
1007
1144
  }
1145
+ interface CreateWorkflowParams {
1146
+ businessId?: string;
1147
+ key: string;
1148
+ statuses?: StatusEvent[];
1149
+ nodes: Record<string, WorkflowNode>;
1150
+ edges: WorkflowEdge[];
1151
+ /** Optional cron schedule expression (e.g., "0 9 * * *" for 9am daily) */
1152
+ schedule?: string;
1153
+ }
1154
+ interface UpdateWorkflowParams {
1155
+ id: string;
1156
+ key: string;
1157
+ statuses?: StatusEvent[];
1158
+ nodes: Record<string, WorkflowNode>;
1159
+ edges: WorkflowEdge[];
1160
+ /** Optional cron schedule expression (e.g., "0 9 * * *" for 9am daily) */
1161
+ schedule?: string;
1162
+ }
1163
+ interface DeleteWorkflowParams {
1164
+ id: string;
1165
+ }
1166
+ interface GetWorkflowParams {
1167
+ id: string;
1168
+ }
1169
+ interface GetWorkflowsParams {
1170
+ businessId?: string;
1171
+ ids?: string[];
1172
+ query?: string;
1173
+ statuses?: string[];
1174
+ limit?: number;
1175
+ cursor?: string;
1176
+ sortField?: string;
1177
+ sortDirection?: 'asc' | 'desc';
1178
+ createdAtFrom?: number;
1179
+ createdAtTo?: number;
1180
+ }
1181
+ interface TriggerWorkflowParams {
1182
+ /** The workflow secret from the workflow's webhook URL */
1183
+ secret: string;
1184
+ /** Any additional data to pass to the workflow */
1185
+ [key: string]: any;
1186
+ }
1187
+ interface AudiencePrice {
1188
+ market: string;
1189
+ amount: number;
1190
+ compareAt?: number;
1191
+ providerPriceId?: string;
1192
+ freeThreshold?: number;
1193
+ }
1194
+ interface CreateAudienceParams {
1195
+ key: string;
1196
+ name: string;
1197
+ nodeIds?: string[];
1198
+ prices?: AudiencePrice[];
1199
+ }
1200
+ interface UpdateAudienceParams {
1201
+ id: string;
1202
+ key?: string;
1203
+ name?: string;
1204
+ nodeIds?: string[];
1205
+ prices?: AudiencePrice[];
1206
+ statuses?: any[];
1207
+ }
1208
+ interface GetAudienceParams {
1209
+ id: string;
1210
+ }
1211
+ interface GetAudiencesParams {
1212
+ ids?: string[];
1213
+ nodeId?: string;
1214
+ statuses?: string[];
1215
+ query?: string;
1216
+ limit?: number;
1217
+ cursor?: string;
1218
+ }
1219
+ interface SubscribeAudienceParams {
1220
+ id: string;
1221
+ /** Optional for free audiences, required for paid audiences */
1222
+ priceId?: string;
1223
+ successUrl: string;
1224
+ cancelUrl: string;
1225
+ }
1226
+ interface DeleteAudienceParams {
1227
+ id: string;
1228
+ }
1229
+ interface GetAudienceSubscribersParams {
1230
+ id: string;
1231
+ limit?: number;
1232
+ cursor?: string;
1233
+ }
1234
+ interface AudienceSubscriber {
1235
+ accountId: string;
1236
+ email: string;
1237
+ subscribedAt?: number;
1238
+ }
1008
1239
 
1009
- export { type AddPhoneNumberParams, type ApiResponse, type Block, type Business, type BusinessConfig, type BusinessEmails, type CheckoutParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateCollectionEntryParams, type CreateCollectionParams, type CreateEntryParams, type CreateFeatureFlagParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DayAvailability, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteCollectionEntryParams, type DeleteCollectionParams, type DeleteFeatureFlagParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type DeleteUserParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type FeatureFlag, type FeatureFlagStatus, type FlagResults, type ForgotPasswordParams, type GenerateBlocksParams, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailabilityParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetCollectionEntriesParams, type GetCollectionEntryParams, type GetCollectionParams, type GetCollectionSubscribersParams, type GetCollectionsParams, type GetDeliveryStatsParams, type GetEntriesParams, type GetFeatureFlagParams, type GetFeatureFlagResultsParams, type GetFeatureFlagsParams, type GetLoginUrlParams, type GetMeParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServiceProvidersParams, type GetServicesParams, type GetSlotsForDateParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type GetVariantParams, type GetVariantResponse, type HandleInvitationParams, type InviteUserParams, type Language, type Location, type LoginUserParams, type LogoutParams, type Market, type Media, type MediaResolution, type OutcastDate, type PaginatedResponse, type Payment, type PaymentMethod, PaymentMethodType, type PaymentProviderConfig, type PhoneNumberConfirmParams, type Price, type ProcessRefundParams, type PromoCodeValidation, type ProviderWithTimeline, type Quote, type QuoteLineItem, type RegisterUserParams, type RequestOptions, type ReservationCartItem, type ReservationCheckoutParams, type ReservationStoreState, type ResetForgotPasswordParams, type ResetPasswordParams, type SearchMyReservationsParams, type SearchReservationsParams, type SearchUsersParams, type SendEntryParams, type Seo, type SetProviderScheduleParams, type SetRoleParams, type SetupAnalyticsParams, type ShippingMethod, type ShippingWeightTier, type Slot, type SpecificDate, type SubscribeParams, type TestWebhookParams, type TimelinePoint, type TrackEmailOpenParams, type TrackEventParams, type TrackEventResponse, type TriggerBuildsParams, type UpdateBusinessParams, type UpdateCollectionParams, type UpdateEntryParams, type UpdateFeatureFlagParams, type UpdateMediaParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateOrderPaymentStatusParams, type UpdateOrderStatusParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateRoleParams, type UpdateServiceParams, type UpdateUserProfileParams, type UploadBusinessMediaParams, type UserSubscribeParams, type Variant, type VariantInput, type VariantResult, type WorkingDay, type WorkingHour, type WorkingTime, type Zone };
1240
+ export { type AccountSubscribeParams, type AddPhoneNumberParams, type AddressBlock, type AddressBlockProperties, type AddressType, type ApiResponse, type Audience, type AudienceAccessResponse, type AudiencePrice, type AudienceSubscribeResponse, type AudienceSubscriber, type Block, type BlockType, type BulkScheduleParams, type Business, type BusinessConfig, type BusinessEmails, type BusinessRole, type Condition, type CreateAudienceParams, type CreateBusinessParams, type CreateNodeParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateServiceParams, type CreateWorkflowParams, type DayAvailability, type DeleteAccountParams, type DeleteAudienceParams, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteNodeParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteServiceParams, type DeleteWorkflowParams, type Discount, type EmailBlock, type EmailBlockProperties, type EshopCartItem, type EshopItem, type EshopStoreState, type ExecutionStatus, type GenerateBlocksParams, type GeoLocationValue, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAudienceParams, type GetAudienceSubscribersParams, type GetAudiencesParams, type GetAvailabilityParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetDeliveryStatsParams, type GetMeParams, type GetNodeChildrenParams, type GetNodeParams, type GetNodesParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationQuoteParams, type GetServiceParams, type GetServicesParams, type GetSlotsForDateParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type GetWorkflowParams, type GetWorkflowsParams, type HandleInvitationParams, type InviteUserParams, type Language, type Location, type LoginAccountParams, type LogoutParams, type MagicLinkRequestParams, type MagicLinkVerifyParams, type Market, type Media, type MediaResolution, type Node, type NodeConfig, type OrderCheckoutParams, type OutcastDate, type PaginatedResponse, type Payment, type PaymentMethod, PaymentMethodType, type PaymentProviderConfig, type PaymentRefund, type PhoneBlock, type PhoneBlockProperties, type PhoneNumberConfirmParams, type Price, type ProcessRefundParams, type PromoCodeValidation, type Provider, type ProviderTimelinePoint, type ProviderWithTimeline, type Quote, type RequestOptions, type Reservation, type ReservationCartItem, type ReservationCheckoutParams, type ReservationItem, type ReservationQuoteItem, type ReservationStoreState, type SearchAccountsParams, type SearchReservationsParams, type Seo, type Service, type ServiceDuration, type ServiceProvider, type ServiceProviderInput, type SetupAnalyticsParams, type ShippingMethod, type ShippingWeightTier, type Slot, type SpecificDate, type StatusEvent, type SubscribeAudienceParams, type SubscribeParams, type Subscription, type SystemTemplateKey, type TestWebhookParams, type TimelinePoint, type TrackEmailOpenParams, type TriggerBuildsParams, type TriggerWorkflowParams, type UpdateAccountProfileParams, type UpdateAudienceParams, type UpdateBusinessParams, type UpdateMediaParams, type UpdateNodeParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateServiceParams, type UpdateWorkflowParams, type UploadBusinessMediaParams, type Workflow, type WorkflowEdge, type WorkflowExecution, type WorkflowHttpMethod, type WorkflowHttpNode, type WorkflowIfNode, type WorkflowLoopNode, type WorkflowNode, type WorkflowTriggerNode, type WorkflowWaitNode, type WorkingDay, type WorkingHour, type WorkingTime, type Zone, type ZoneScope };