@voltade/envoy-sdk 1.2.1 → 1.2.3

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.
@@ -16,52 +16,49 @@ class BaseResource {
16
16
  export class CompanyMembers extends BaseResource {
17
17
  /**
18
18
  * List all members (contacts) of a company
19
- * @param accountId - The account ID
20
19
  * @param companyId - The company ID
21
20
  * @returns List of contacts in the company
22
21
  *
23
22
  * @example
24
23
  * ```typescript
25
- * const members = await client.companyMembers.list('acc_123', 456);
24
+ * const members = await client.companyMembers.list(456);
26
25
  * console.log(members); // Array of contacts
27
26
  * ```
28
27
  */
29
- async list(accountId, companyId) {
30
- return await this.client.get(`/accounts/${accountId}/companies/${companyId}/company_members`);
28
+ async list(companyId) {
29
+ return await this.client.get(`/companies/${companyId}/company_members`);
31
30
  }
32
31
  /**
33
32
  * Add contacts to a company
34
- * @param accountId - The account ID
35
33
  * @param companyId - The company ID
36
34
  * @param params - Object containing contact_ids array
37
35
  * @returns List of contacts added to the company
38
36
  *
39
37
  * @example
40
38
  * ```typescript
41
- * const members = await client.companyMembers.add('acc_123', 456, {
39
+ * const members = await client.companyMembers.add(456, {
42
40
  * contact_ids: [101, 102, 103]
43
41
  * });
44
42
  * console.log(members); // Array of added contacts
45
43
  * ```
46
44
  */
47
- async add(accountId, companyId, params) {
48
- return await this.client.post(`/accounts/${accountId}/companies/${companyId}/company_members`, params);
45
+ async add(companyId, params) {
46
+ return await this.client.post(`/companies/${companyId}/company_members`, params);
49
47
  }
50
48
  /**
51
49
  * Remove contacts from a company
52
- * @param accountId - The account ID
53
50
  * @param companyId - The company ID
54
51
  * @param params - Object containing contact_ids array
55
52
  *
56
53
  * @example
57
54
  * ```typescript
58
- * await client.companyMembers.remove('acc_123', 456, {
55
+ * await client.companyMembers.remove(456, {
59
56
  * contact_ids: [101, 102]
60
57
  * });
61
58
  * ```
62
59
  */
63
- async remove(accountId, companyId, params) {
64
- await this.client.delete(`/accounts/${accountId}/companies/${companyId}/company_members`, params);
60
+ async remove(companyId, params) {
61
+ await this.client.delete(`/companies/${companyId}/company_members`, params);
65
62
  }
66
63
  }
67
64
  // Re-export Zod schemas
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../resources/company-members/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH;;GAEG;AACH,MAAe,YAAY;IACzB,YAA+B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,YAAY;IAC9C;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,IAAI,CACR,SAAiB,EACjB,SAAiB;QAEjB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAC1B,aAAa,SAAS,cAAc,SAAS,kBAAkB,CAChE,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,GAAG,CACP,SAAiB,EACjB,SAAiB,EACjB,MAA+B;QAE/B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAC3B,aAAa,SAAS,cAAc,SAAS,kBAAkB,EAC/D,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,MAAM,CACV,SAAiB,EACjB,SAAiB,EACjB,MAAkC;QAElC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CACtB,aAAa,SAAS,cAAc,SAAS,kBAAkB,EAC/D,MAAM,CACP,CAAC;IACJ,CAAC;CACF;AAUD,wBAAwB;AACxB,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../resources/company-members/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH;;GAEG;AACH,MAAe,YAAY;IACzB,YAA+B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,YAAY;IAC9C;;;;;;;;;;OAUG;IACH,KAAK,CAAC,IAAI,CAAC,SAAiB;QAC1B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAC1B,cAAc,SAAS,kBAAkB,CAC1C,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,GAAG,CACP,SAAiB,EACjB,MAA+B;QAE/B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAC3B,cAAc,SAAS,kBAAkB,EACzC,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,MAAM,CACV,SAAiB,EACjB,MAAkC;QAElC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CACtB,cAAc,SAAS,kBAAkB,EACzC,MAAM,CACP,CAAC;IACJ,CAAC;CACF;AAUD,wBAAwB;AACxB,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,YAAY,CAAC"}
@@ -50,12 +50,12 @@ export declare const MessageSchema: z.ZodObject<{
50
50
  }>>;
51
51
  }, "strip", z.ZodTypeAny, {
52
52
  id: number;
53
+ created_at: number;
53
54
  content: string;
54
55
  message_type: "incoming" | "outgoing";
55
56
  private: boolean;
56
57
  content_type: "text" | "input_select" | "cards" | "form" | "article";
57
58
  content_attributes: Record<string, unknown>;
58
- created_at: number;
59
59
  conversation_id: number;
60
60
  sender?: {
61
61
  id: number;
@@ -65,12 +65,12 @@ export declare const MessageSchema: z.ZodObject<{
65
65
  } | undefined;
66
66
  }, {
67
67
  id: number;
68
+ created_at: number;
68
69
  content: string;
69
70
  message_type: "incoming" | "outgoing";
70
71
  private: boolean;
71
72
  content_type: "text" | "input_select" | "cards" | "form" | "article";
72
73
  content_attributes: Record<string, unknown>;
73
- created_at: number;
74
74
  conversation_id: number;
75
75
  sender?: {
76
76
  id: number;
@@ -246,19 +246,19 @@ export declare const ContactInboxSchema: z.ZodObject<{
246
246
  }, "strip", z.ZodTypeAny, {
247
247
  id: number;
248
248
  created_at: string;
249
+ updated_at: string;
249
250
  contact_id: number;
250
251
  inbox_id: number;
251
252
  source_id: string | null;
252
- updated_at: string;
253
253
  hmac_verified: boolean;
254
254
  pubsub_token: string;
255
255
  }, {
256
256
  id: number;
257
257
  created_at: string;
258
+ updated_at: string;
258
259
  contact_id: number;
259
260
  inbox_id: number;
260
261
  source_id: string | null;
261
- updated_at: string;
262
262
  hmac_verified: boolean;
263
263
  pubsub_token: string;
264
264
  }>;
@@ -395,19 +395,19 @@ export declare const ConversationSchema: z.ZodObject<{
395
395
  }, "strip", z.ZodTypeAny, {
396
396
  id: number;
397
397
  created_at: string;
398
+ updated_at: string;
398
399
  contact_id: number;
399
400
  inbox_id: number;
400
401
  source_id: string | null;
401
- updated_at: string;
402
402
  hmac_verified: boolean;
403
403
  pubsub_token: string;
404
404
  }, {
405
405
  id: number;
406
406
  created_at: string;
407
+ updated_at: string;
407
408
  contact_id: number;
408
409
  inbox_id: number;
409
410
  source_id: string | null;
410
- updated_at: string;
411
411
  hmac_verified: boolean;
412
412
  pubsub_token: string;
413
413
  }>>;
@@ -438,12 +438,12 @@ export declare const ConversationSchema: z.ZodObject<{
438
438
  }>>;
439
439
  }, "strip", z.ZodTypeAny, {
440
440
  id: number;
441
+ created_at: number;
441
442
  content: string;
442
443
  message_type: "incoming" | "outgoing";
443
444
  private: boolean;
444
445
  content_type: "text" | "input_select" | "cards" | "form" | "article";
445
446
  content_attributes: Record<string, unknown>;
446
- created_at: number;
447
447
  conversation_id: number;
448
448
  sender?: {
449
449
  id: number;
@@ -453,12 +453,12 @@ export declare const ConversationSchema: z.ZodObject<{
453
453
  } | undefined;
454
454
  }, {
455
455
  id: number;
456
+ created_at: number;
456
457
  content: string;
457
458
  message_type: "incoming" | "outgoing";
458
459
  private: boolean;
459
460
  content_type: "text" | "input_select" | "cards" | "form" | "article";
460
461
  content_attributes: Record<string, unknown>;
461
- created_at: number;
462
462
  conversation_id: number;
463
463
  sender?: {
464
464
  id: number;
@@ -591,8 +591,31 @@ export declare const ConversationSchema: z.ZodObject<{
591
591
  status: "open" | "resolved" | "pending" | "snoozed";
592
592
  account_id: number;
593
593
  created_at: number;
594
- inbox_id: number;
595
594
  updated_at: number;
595
+ inbox_id: number;
596
+ meta?: {
597
+ sender: {
598
+ id: number;
599
+ name: string | null;
600
+ email: string | null;
601
+ phone_number: string | null;
602
+ thumbnail: string;
603
+ identifier: string | null;
604
+ additional_attributes: Record<string, unknown>;
605
+ custom_attributes: Record<string, unknown>;
606
+ blocked: boolean;
607
+ customer_stage: string;
608
+ customer_stage_explanation: string | null;
609
+ type?: string | undefined;
610
+ };
611
+ hmac_verified: boolean;
612
+ assignee: {
613
+ id: number;
614
+ name: string;
615
+ email: string;
616
+ } | null;
617
+ team?: unknown;
618
+ } | undefined;
596
619
  priority?: string | null | undefined;
597
620
  additional_attributes?: Record<string, unknown> | undefined;
598
621
  custom_attributes?: Record<string, unknown> | undefined;
@@ -601,21 +624,21 @@ export declare const ConversationSchema: z.ZodObject<{
601
624
  contact_inbox?: {
602
625
  id: number;
603
626
  created_at: string;
627
+ updated_at: string;
604
628
  contact_id: number;
605
629
  inbox_id: number;
606
630
  source_id: string | null;
607
- updated_at: string;
608
631
  hmac_verified: boolean;
609
632
  pubsub_token: string;
610
633
  } | undefined;
611
634
  messages?: {
612
635
  id: number;
636
+ created_at: number;
613
637
  content: string;
614
638
  message_type: "incoming" | "outgoing";
615
639
  private: boolean;
616
640
  content_type: "text" | "input_select" | "cards" | "form" | "article";
617
641
  content_attributes: Record<string, unknown>;
618
- created_at: number;
619
642
  conversation_id: number;
620
643
  sender?: {
621
644
  id: number;
@@ -624,6 +647,26 @@ export declare const ConversationSchema: z.ZodObject<{
624
647
  email?: string | undefined;
625
648
  } | undefined;
626
649
  }[] | undefined;
650
+ labels?: string[] | undefined;
651
+ snoozed_until?: number | null | undefined;
652
+ unread_count?: number | undefined;
653
+ first_reply_created_at?: string | number | null | undefined;
654
+ waiting_since?: number | null | undefined;
655
+ ai_disabled?: boolean | undefined;
656
+ reenable_ai_at?: number | null | undefined;
657
+ ai_summary?: string | null | undefined;
658
+ conversation_type?: string | undefined;
659
+ agent_last_seen_at?: number | undefined;
660
+ contact_last_seen_at?: number | undefined;
661
+ last_activity_at?: number | undefined;
662
+ timestamp?: number | undefined;
663
+ }, {
664
+ id: number;
665
+ status: "open" | "resolved" | "pending" | "snoozed";
666
+ account_id: number;
667
+ created_at: number;
668
+ updated_at: number;
669
+ inbox_id: number;
627
670
  meta?: {
628
671
  sender: {
629
672
  id: number;
@@ -647,26 +690,6 @@ export declare const ConversationSchema: z.ZodObject<{
647
690
  } | null;
648
691
  team?: unknown;
649
692
  } | undefined;
650
- labels?: string[] | undefined;
651
- snoozed_until?: number | null | undefined;
652
- unread_count?: number | undefined;
653
- first_reply_created_at?: string | number | null | undefined;
654
- waiting_since?: number | null | undefined;
655
- ai_disabled?: boolean | undefined;
656
- reenable_ai_at?: number | null | undefined;
657
- ai_summary?: string | null | undefined;
658
- conversation_type?: string | undefined;
659
- agent_last_seen_at?: number | undefined;
660
- contact_last_seen_at?: number | undefined;
661
- last_activity_at?: number | undefined;
662
- timestamp?: number | undefined;
663
- }, {
664
- id: number;
665
- status: "open" | "resolved" | "pending" | "snoozed";
666
- account_id: number;
667
- created_at: number;
668
- inbox_id: number;
669
- updated_at: number;
670
693
  priority?: string | null | undefined;
671
694
  additional_attributes?: Record<string, unknown> | undefined;
672
695
  custom_attributes?: Record<string, unknown> | undefined;
@@ -675,21 +698,21 @@ export declare const ConversationSchema: z.ZodObject<{
675
698
  contact_inbox?: {
676
699
  id: number;
677
700
  created_at: string;
701
+ updated_at: string;
678
702
  contact_id: number;
679
703
  inbox_id: number;
680
704
  source_id: string | null;
681
- updated_at: string;
682
705
  hmac_verified: boolean;
683
706
  pubsub_token: string;
684
707
  } | undefined;
685
708
  messages?: {
686
709
  id: number;
710
+ created_at: number;
687
711
  content: string;
688
712
  message_type: "incoming" | "outgoing";
689
713
  private: boolean;
690
714
  content_type: "text" | "input_select" | "cards" | "form" | "article";
691
715
  content_attributes: Record<string, unknown>;
692
- created_at: number;
693
716
  conversation_id: number;
694
717
  sender?: {
695
718
  id: number;
@@ -698,29 +721,6 @@ export declare const ConversationSchema: z.ZodObject<{
698
721
  email?: string | undefined;
699
722
  } | undefined;
700
723
  }[] | undefined;
701
- meta?: {
702
- sender: {
703
- id: number;
704
- name: string | null;
705
- email: string | null;
706
- phone_number: string | null;
707
- thumbnail: string;
708
- identifier: string | null;
709
- additional_attributes: Record<string, unknown>;
710
- custom_attributes: Record<string, unknown>;
711
- blocked: boolean;
712
- customer_stage: string;
713
- customer_stage_explanation: string | null;
714
- type?: string | undefined;
715
- };
716
- hmac_verified: boolean;
717
- assignee: {
718
- id: number;
719
- name: string;
720
- email: string;
721
- } | null;
722
- team?: unknown;
723
- } | undefined;
724
724
  labels?: string[] | undefined;
725
725
  snoozed_until?: number | null | undefined;
726
726
  unread_count?: number | undefined;
@@ -847,12 +847,12 @@ export declare const MessagesResponseSchema: z.ZodObject<{
847
847
  }>>;
848
848
  }, "strip", z.ZodTypeAny, {
849
849
  id: number;
850
+ created_at: number;
850
851
  content: string;
851
852
  message_type: "incoming" | "outgoing";
852
853
  private: boolean;
853
854
  content_type: "text" | "input_select" | "cards" | "form" | "article";
854
855
  content_attributes: Record<string, unknown>;
855
- created_at: number;
856
856
  conversation_id: number;
857
857
  sender?: {
858
858
  id: number;
@@ -862,12 +862,12 @@ export declare const MessagesResponseSchema: z.ZodObject<{
862
862
  } | undefined;
863
863
  }, {
864
864
  id: number;
865
+ created_at: number;
865
866
  content: string;
866
867
  message_type: "incoming" | "outgoing";
867
868
  private: boolean;
868
869
  content_type: "text" | "input_select" | "cards" | "form" | "article";
869
870
  content_attributes: Record<string, unknown>;
870
- created_at: number;
871
871
  conversation_id: number;
872
872
  sender?: {
873
873
  id: number;
@@ -891,12 +891,12 @@ export declare const MessagesResponseSchema: z.ZodObject<{
891
891
  };
892
892
  payload: {
893
893
  id: number;
894
+ created_at: number;
894
895
  content: string;
895
896
  message_type: "incoming" | "outgoing";
896
897
  private: boolean;
897
898
  content_type: "text" | "input_select" | "cards" | "form" | "article";
898
899
  content_attributes: Record<string, unknown>;
899
- created_at: number;
900
900
  conversation_id: number;
901
901
  sender?: {
902
902
  id: number;
@@ -920,12 +920,12 @@ export declare const MessagesResponseSchema: z.ZodObject<{
920
920
  };
921
921
  payload: {
922
922
  id: number;
923
+ created_at: number;
923
924
  content: string;
924
925
  message_type: "incoming" | "outgoing";
925
926
  private: boolean;
926
927
  content_type: "text" | "input_select" | "cards" | "form" | "article";
927
928
  content_attributes: Record<string, unknown>;
928
- created_at: number;
929
929
  conversation_id: number;
930
930
  sender?: {
931
931
  id: number;
@@ -11,16 +11,16 @@ export declare const ArticleSchema: z.ZodObject<{
11
11
  updated_at: z.ZodNumber;
12
12
  }, "strip", z.ZodTypeAny, {
13
13
  id: number;
14
- content: string;
15
14
  created_at: number;
16
15
  updated_at: number;
16
+ content: string;
17
17
  title: string;
18
18
  slug: string;
19
19
  }, {
20
20
  id: number;
21
- content: string;
22
21
  created_at: number;
23
22
  updated_at: number;
23
+ content: string;
24
24
  title: string;
25
25
  slug: string;
26
26
  }>;
@@ -42,16 +42,16 @@ export declare const SearchResponseSchema: z.ZodObject<{
42
42
  updated_at: z.ZodNumber;
43
43
  }, "strip", z.ZodTypeAny, {
44
44
  id: number;
45
- content: string;
46
45
  created_at: number;
47
46
  updated_at: number;
47
+ content: string;
48
48
  title: string;
49
49
  slug: string;
50
50
  }, {
51
51
  id: number;
52
- content: string;
53
52
  created_at: number;
54
53
  updated_at: number;
54
+ content: string;
55
55
  title: string;
56
56
  slug: string;
57
57
  }>, "many">>;
@@ -60,9 +60,9 @@ export declare const SearchResponseSchema: z.ZodObject<{
60
60
  success: boolean;
61
61
  payload?: {
62
62
  id: number;
63
- content: string;
64
63
  created_at: number;
65
64
  updated_at: number;
65
+ content: string;
66
66
  title: string;
67
67
  slug: string;
68
68
  }[] | undefined;
@@ -71,9 +71,9 @@ export declare const SearchResponseSchema: z.ZodObject<{
71
71
  success: boolean;
72
72
  payload?: {
73
73
  id: number;
74
- content: string;
75
74
  created_at: number;
76
75
  updated_at: number;
76
+ content: string;
77
77
  title: string;
78
78
  slug: string;
79
79
  }[] | undefined;
@@ -309,8 +309,8 @@ export declare const UpsertOrderResponsePayloadSchema: z.ZodObject<{
309
309
  }, "strip", z.ZodTypeAny, {
310
310
  id: number;
311
311
  created_at: string;
312
- source_id: string;
313
312
  updated_at: string;
313
+ source_id: string;
314
314
  source: string;
315
315
  name?: string | undefined;
316
316
  company_id?: number | undefined;
@@ -332,8 +332,8 @@ export declare const UpsertOrderResponsePayloadSchema: z.ZodObject<{
332
332
  }, {
333
333
  id: number;
334
334
  created_at: string;
335
- source_id: string;
336
335
  updated_at: string;
336
+ source_id: string;
337
337
  source: string;
338
338
  name?: string | undefined;
339
339
  company_id?: number | undefined;
@@ -404,8 +404,8 @@ export declare const UpsertOrderResponseSchema: z.ZodObject<{
404
404
  }, "strip", z.ZodTypeAny, {
405
405
  id: number;
406
406
  created_at: string;
407
- source_id: string;
408
407
  updated_at: string;
408
+ source_id: string;
409
409
  source: string;
410
410
  name?: string | undefined;
411
411
  company_id?: number | undefined;
@@ -427,8 +427,8 @@ export declare const UpsertOrderResponseSchema: z.ZodObject<{
427
427
  }, {
428
428
  id: number;
429
429
  created_at: string;
430
- source_id: string;
431
430
  updated_at: string;
431
+ source_id: string;
432
432
  source: string;
433
433
  name?: string | undefined;
434
434
  company_id?: number | undefined;
@@ -452,8 +452,8 @@ export declare const UpsertOrderResponseSchema: z.ZodObject<{
452
452
  payload: {
453
453
  id: number;
454
454
  created_at: string;
455
- source_id: string;
456
455
  updated_at: string;
456
+ source_id: string;
457
457
  source: string;
458
458
  name?: string | undefined;
459
459
  company_id?: number | undefined;
@@ -477,8 +477,8 @@ export declare const UpsertOrderResponseSchema: z.ZodObject<{
477
477
  payload: {
478
478
  id: number;
479
479
  created_at: string;
480
- source_id: string;
481
480
  updated_at: string;
481
+ source_id: string;
482
482
  source: string;
483
483
  name?: string | undefined;
484
484
  company_id?: number | undefined;