@voltade/envoy-sdk 1.2.1 → 1.2.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.
@@ -16,96 +16,90 @@ declare abstract class BaseResource {
16
16
  */
17
17
  export declare class Companies extends BaseResource {
18
18
  /**
19
- * List all companies under an account
20
- * @param accountId - The account ID to list companies for
19
+ * List all companies
21
20
  * @param params - Pagination parameters
22
21
  * @returns List of companies
23
22
  *
24
23
  * @example
25
24
  * ```typescript
26
- * const companies = await client.companies.list('acc_123');
25
+ * const companies = await client.companies.list();
27
26
  * console.log(companies); // Array of companies
28
27
  *
29
28
  * // With pagination
30
- * const companies = await client.companies.list('acc_123', { page: 2, per_page: 50 });
29
+ * const companies = await client.companies.list({ page: 2, per_page: 50 });
31
30
  * ```
32
31
  */
33
- list(accountId: string, params?: ListCompaniesParams): Promise<ListCompaniesResponse>;
32
+ list(params?: ListCompaniesParams): Promise<ListCompaniesResponse>;
34
33
  /**
35
- * Create a new company under an account
36
- * @param accountId - The account ID to create the company under
34
+ * Create a new company
37
35
  * @param params - Company data with required name
38
36
  * @returns The created company
39
37
  *
40
38
  * @example
41
39
  * ```typescript
42
- * const company = await client.companies.create('acc_123', {
40
+ * const company = await client.companies.create({
43
41
  * name: 'Acme Corp'
44
42
  * });
45
43
  * console.log(company); // The created company
46
44
  * ```
47
45
  */
48
- create(accountId: string, params: CreateCompanyParams): Promise<CreateCompanyResponse>;
46
+ create(params: CreateCompanyParams): Promise<CreateCompanyResponse>;
49
47
  /**
50
48
  * Get a company by ID
51
- * @param accountId - The account ID the company belongs to
52
49
  * @param companyId - The company ID to retrieve
53
50
  * @returns The company
54
51
  *
55
52
  * @example
56
53
  * ```typescript
57
- * const company = await client.companies.get('acc_123', 'comp_456');
54
+ * const company = await client.companies.get(456);
58
55
  * console.log(company); // The company
59
56
  * ```
60
57
  */
61
- get(accountId: string, companyId: string): Promise<GetCompanyResponse>;
58
+ get(companyId: number): Promise<GetCompanyResponse>;
62
59
  /**
63
60
  * Update an existing company
64
- * @param accountId - The account ID the company belongs to
65
61
  * @param companyId - The company ID to update
66
62
  * @param params - Company data to update
67
63
  * @returns The updated company
68
64
  *
69
65
  * @example
70
66
  * ```typescript
71
- * const company = await client.companies.update('acc_123', 'comp_456', {
67
+ * const company = await client.companies.update(456, {
72
68
  * name: 'Acme Corp Updated'
73
69
  * });
74
70
  * console.log(company); // The updated company
75
71
  * ```
76
72
  */
77
- update(accountId: string, companyId: string, params: UpdateCompanyParams): Promise<UpdateCompanyResponse>;
73
+ update(companyId: number, params: UpdateCompanyParams): Promise<UpdateCompanyResponse>;
78
74
  /**
79
75
  * Search companies by name
80
- * @param accountId - The account ID to search within
81
76
  * @param query - The company name to search for
82
77
  * @param params - Optional pagination parameters
83
78
  * @returns List of matching companies
84
79
  *
85
80
  * @example
86
81
  * ```typescript
87
- * const companies = await client.companies.search('acc_123', 'Acme');
82
+ * const companies = await client.companies.search('Acme');
88
83
  * console.log(companies); // Array of matching companies
89
84
  *
90
85
  * // With pagination
91
- * const companies = await client.companies.search('acc_123', 'Acme', { page: 2, per_page: 50 });
86
+ * const companies = await client.companies.search('Acme', { page: 2, per_page: 50 });
92
87
  * ```
93
88
  */
94
- search(accountId: string, query: string, params?: {
89
+ search(query: string, params?: {
95
90
  page?: number;
96
91
  per_page?: number;
97
92
  }): Promise<SearchCompaniesResponse>;
98
93
  /**
99
94
  * Delete a company
100
- * @param accountId - The account ID the company belongs to
101
95
  * @param companyId - The company ID to delete
102
96
  *
103
97
  * @example
104
98
  * ```typescript
105
- * await client.companies.delete('acc_123', 'comp_456');
99
+ * await client.companies.delete(456);
106
100
  * ```
107
101
  */
108
- delete(accountId: string, companyId: string): Promise<void>;
102
+ delete(companyId: number): Promise<void>;
109
103
  }
110
104
  export type { Company, CreateCompanyParams, CreateCompanyRequest, CreateCompanyResponse, GetCompanyResponse, ListCompaniesParams, ListCompaniesResponse, SearchCompaniesParams, SearchCompaniesResponse, UpdateCompanyParams, UpdateCompanyRequest, UpdateCompanyResponse, } from "./types.js";
111
105
  export { CompanySchema, CreateCompanyParamsSchema, CreateCompanyRequestSchema, CreateCompanyResponseSchema, GetCompanyResponseSchema, ListCompaniesParamsSchema, ListCompaniesResponseSchema, SearchCompaniesParamsSchema, SearchCompaniesResponseSchema, UpdateCompanyParamsSchema, UpdateCompanyRequestSchema, UpdateCompanyResponseSchema, } from "./types.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../resources/companies/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,uBAAe,YAAY;IACb,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU;gBAAlB,MAAM,EAAE,UAAU;CAClD;AAED;;GAEG;AACH,qBAAa,SAAU,SAAQ,YAAY;IACzC;;;;;;;;;;;;;;OAcG;IACG,IAAI,CACR,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,mBAAmB,GAC3B,OAAO,CAAC,qBAAqB,CAAC;IAOjC;;;;;;;;;;;;;OAaG;IACG,MAAM,CACV,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,qBAAqB,CAAC;IAOjC;;;;;;;;;;;OAWG;IACG,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAM5E;;;;;;;;;;;;;;OAcG;IACG,MAAM,CACV,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,qBAAqB,CAAC;IAOjC;;;;;;;;;;;;;;;OAeG;IACG,MAAM,CACV,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAC5C,OAAO,CAAC,uBAAuB,CAAC;IAOnC;;;;;;;;;OASG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAKlE;AAGD,YAAY,EACV,OAAO,EACP,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../resources/companies/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,uBAAe,YAAY;IACb,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU;gBAAlB,MAAM,EAAE,UAAU;CAClD;AAED;;GAEG;AACH,qBAAa,SAAU,SAAQ,YAAY;IACzC;;;;;;;;;;;;;OAaG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAMxE;;;;;;;;;;;;OAYG;IACG,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAMzE;;;;;;;;;;OAUG;IACG,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIzD;;;;;;;;;;;;;OAaG;IACG,MAAM,CACV,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,qBAAqB,CAAC;IAOjC;;;;;;;;;;;;;;OAcG;IACG,MAAM,CACV,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAC5C,OAAO,CAAC,uBAAuB,CAAC;IAMnC;;;;;;;;OAQG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/C;AAGD,YAAY,EACV,OAAO,EACP,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,YAAY,CAAC"}
@@ -15,104 +15,104 @@ class BaseResource {
15
15
  */
16
16
  export class Companies extends BaseResource {
17
17
  /**
18
- * List all companies under an account
19
- * @param accountId - The account ID to list companies for
18
+ * List all companies
20
19
  * @param params - Pagination parameters
21
20
  * @returns List of companies
22
21
  *
23
22
  * @example
24
23
  * ```typescript
25
- * const companies = await client.companies.list('acc_123');
24
+ * const companies = await client.companies.list();
26
25
  * console.log(companies); // Array of companies
27
26
  *
28
27
  * // With pagination
29
- * const companies = await client.companies.list('acc_123', { page: 2, per_page: 50 });
28
+ * const companies = await client.companies.list({ page: 2, per_page: 50 });
30
29
  * ```
31
30
  */
32
- async list(accountId, params) {
33
- return await this.client.get(`/accounts/${accountId}/companies`, { params });
31
+ async list(params) {
32
+ return await this.client.get("/companies", {
33
+ params,
34
+ });
34
35
  }
35
36
  /**
36
- * Create a new company under an account
37
- * @param accountId - The account ID to create the company under
37
+ * Create a new company
38
38
  * @param params - Company data with required name
39
39
  * @returns The created company
40
40
  *
41
41
  * @example
42
42
  * ```typescript
43
- * const company = await client.companies.create('acc_123', {
43
+ * const company = await client.companies.create({
44
44
  * name: 'Acme Corp'
45
45
  * });
46
46
  * console.log(company); // The created company
47
47
  * ```
48
48
  */
49
- async create(accountId, params) {
50
- return await this.client.post(`/accounts/${accountId}/companies`, { company: params });
49
+ async create(params) {
50
+ return await this.client.post("/companies", {
51
+ company: params,
52
+ });
51
53
  }
52
54
  /**
53
55
  * Get a company by ID
54
- * @param accountId - The account ID the company belongs to
55
56
  * @param companyId - The company ID to retrieve
56
57
  * @returns The company
57
58
  *
58
59
  * @example
59
60
  * ```typescript
60
- * const company = await client.companies.get('acc_123', 'comp_456');
61
+ * const company = await client.companies.get(456);
61
62
  * console.log(company); // The company
62
63
  * ```
63
64
  */
64
- async get(accountId, companyId) {
65
- return await this.client.get(`/accounts/${accountId}/companies/${companyId}`);
65
+ async get(companyId) {
66
+ return await this.client.get(`/companies/${companyId}`);
66
67
  }
67
68
  /**
68
69
  * Update an existing company
69
- * @param accountId - The account ID the company belongs to
70
70
  * @param companyId - The company ID to update
71
71
  * @param params - Company data to update
72
72
  * @returns The updated company
73
73
  *
74
74
  * @example
75
75
  * ```typescript
76
- * const company = await client.companies.update('acc_123', 'comp_456', {
76
+ * const company = await client.companies.update(456, {
77
77
  * name: 'Acme Corp Updated'
78
78
  * });
79
79
  * console.log(company); // The updated company
80
80
  * ```
81
81
  */
82
- async update(accountId, companyId, params) {
83
- return await this.client.patch(`/accounts/${accountId}/companies/${companyId}`, { company: params });
82
+ async update(companyId, params) {
83
+ return await this.client.patch(`/companies/${companyId}`, { company: params });
84
84
  }
85
85
  /**
86
86
  * Search companies by name
87
- * @param accountId - The account ID to search within
88
87
  * @param query - The company name to search for
89
88
  * @param params - Optional pagination parameters
90
89
  * @returns List of matching companies
91
90
  *
92
91
  * @example
93
92
  * ```typescript
94
- * const companies = await client.companies.search('acc_123', 'Acme');
93
+ * const companies = await client.companies.search('Acme');
95
94
  * console.log(companies); // Array of matching companies
96
95
  *
97
96
  * // With pagination
98
- * const companies = await client.companies.search('acc_123', 'Acme', { page: 2, per_page: 50 });
97
+ * const companies = await client.companies.search('Acme', { page: 2, per_page: 50 });
99
98
  * ```
100
99
  */
101
- async search(accountId, query, params) {
102
- return await this.client.get(`/accounts/${accountId}/companies/search`, { params: { q: query, ...params } });
100
+ async search(query, params) {
101
+ return await this.client.get("/companies/search", {
102
+ params: { q: query, ...params },
103
+ });
103
104
  }
104
105
  /**
105
106
  * Delete a company
106
- * @param accountId - The account ID the company belongs to
107
107
  * @param companyId - The company ID to delete
108
108
  *
109
109
  * @example
110
110
  * ```typescript
111
- * await client.companies.delete('acc_123', 'comp_456');
111
+ * await client.companies.delete(456);
112
112
  * ```
113
113
  */
114
- async delete(accountId, companyId) {
115
- await this.client.delete(`/accounts/${accountId}/companies/${companyId}`);
114
+ async delete(companyId) {
115
+ await this.client.delete(`/companies/${companyId}`);
116
116
  }
117
117
  }
118
118
  // Re-export Zod schemas
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../resources/companies/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;GAEG;AACH,MAAe,YAAY;IACzB,YAA+B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,YAAY;IACzC;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,IAAI,CACR,SAAiB,EACjB,MAA4B;QAE5B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAC1B,aAAa,SAAS,YAAY,EAClC,EAAE,MAAM,EAAE,CACX,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,MAAM,CACV,SAAiB,EACjB,MAA2B;QAE3B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAC3B,aAAa,SAAS,YAAY,EAClC,EAAE,OAAO,EAAE,MAAM,EAAE,CACpB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,GAAG,CAAC,SAAiB,EAAE,SAAiB;QAC5C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAC1B,aAAa,SAAS,cAAc,SAAS,EAAE,CAChD,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAAM,CACV,SAAiB,EACjB,SAAiB,EACjB,MAA2B;QAE3B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,aAAa,SAAS,cAAc,SAAS,EAAE,EAC/C,EAAE,OAAO,EAAE,MAAM,EAAE,CACpB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,MAAM,CACV,SAAiB,EACjB,KAAa,EACb,MAA6C;QAE7C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAC1B,aAAa,SAAS,mBAAmB,EACzC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,EAAE,CACpC,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,MAAM,CAAC,SAAiB,EAAE,SAAiB;QAC/C,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CACtB,aAAa,SAAS,cAAc,SAAS,EAAE,CAChD,CAAC;IACJ,CAAC;CACF;AAkBD,wBAAwB;AACxB,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../resources/companies/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;GAEG;AACH,MAAe,YAAY;IACzB,YAA+B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,YAAY;IACzC;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,IAAI,CAAC,MAA4B;QACrC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAwB,YAAY,EAAE;YAChE,MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,MAAM,CAAC,MAA2B;QACtC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAwB,YAAY,EAAE;YACjE,OAAO,EAAE,MAAM;SAChB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,GAAG,CAAC,SAAiB;QACzB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAqB,cAAc,SAAS,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,MAAM,CACV,SAAiB,EACjB,MAA2B;QAE3B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,cAAc,SAAS,EAAE,EACzB,EAAE,OAAO,EAAE,MAAM,EAAE,CACpB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAAM,CACV,KAAa,EACb,MAA6C;QAE7C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAA0B,mBAAmB,EAAE;YACzE,MAAM,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE;SAChC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,MAAM,CAAC,SAAiB;QAC5B,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAO,cAAc,SAAS,EAAE,CAAC,CAAC;IAC5D,CAAC;CACF;AAkBD,wBAAwB;AACxB,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,YAAY,CAAC"}
@@ -17,47 +17,44 @@ declare abstract class BaseResource {
17
17
  export declare class CompanyMembers extends BaseResource {
18
18
  /**
19
19
  * List all members (contacts) of a company
20
- * @param accountId - The account ID
21
20
  * @param companyId - The company ID
22
21
  * @returns List of contacts in the company
23
22
  *
24
23
  * @example
25
24
  * ```typescript
26
- * const members = await client.companyMembers.list('acc_123', 456);
25
+ * const members = await client.companyMembers.list(456);
27
26
  * console.log(members); // Array of contacts
28
27
  * ```
29
28
  */
30
- list(accountId: string, companyId: number): Promise<ListCompanyMembersResponse>;
29
+ list(companyId: number): Promise<ListCompanyMembersResponse>;
31
30
  /**
32
31
  * Add contacts to a company
33
- * @param accountId - The account ID
34
32
  * @param companyId - The company ID
35
33
  * @param params - Object containing contact_ids array
36
34
  * @returns List of contacts added to the company
37
35
  *
38
36
  * @example
39
37
  * ```typescript
40
- * const members = await client.companyMembers.add('acc_123', 456, {
38
+ * const members = await client.companyMembers.add(456, {
41
39
  * contact_ids: [101, 102, 103]
42
40
  * });
43
41
  * console.log(members); // Array of added contacts
44
42
  * ```
45
43
  */
46
- add(accountId: string, companyId: number, params: AddCompanyMembersParams): Promise<AddCompanyMembersResponse>;
44
+ add(companyId: number, params: AddCompanyMembersParams): Promise<AddCompanyMembersResponse>;
47
45
  /**
48
46
  * Remove contacts from a company
49
- * @param accountId - The account ID
50
47
  * @param companyId - The company ID
51
48
  * @param params - Object containing contact_ids array
52
49
  *
53
50
  * @example
54
51
  * ```typescript
55
- * await client.companyMembers.remove('acc_123', 456, {
52
+ * await client.companyMembers.remove(456, {
56
53
  * contact_ids: [101, 102]
57
54
  * });
58
55
  * ```
59
56
  */
60
- remove(accountId: string, companyId: number, params: RemoveCompanyMembersParams): Promise<void>;
57
+ remove(companyId: number, params: RemoveCompanyMembersParams): Promise<void>;
61
58
  }
62
59
  export type { AddCompanyMembersParams, AddCompanyMembersResponse, ListCompanyMembersResponse, RemoveCompanyMembersParams, } from "./types.js";
63
60
  export { AddCompanyMembersParamsSchema, AddCompanyMembersResponseSchema, ListCompanyMembersResponseSchema, RemoveCompanyMembersParamsSchema, } from "./types.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../resources/company-members/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EACV,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,uBAAe,YAAY;IACb,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU;gBAAlB,MAAM,EAAE,UAAU;CAClD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,YAAY;IAC9C;;;;;;;;;;;OAWG;IACG,IAAI,CACR,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,0BAA0B,CAAC;IAMtC;;;;;;;;;;;;;;OAcG;IACG,GAAG,CACP,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,yBAAyB,CAAC;IAOrC;;;;;;;;;;;;OAYG;IACG,MAAM,CACV,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,IAAI,CAAC;CAMjB;AAGD,YAAY,EACV,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../resources/company-members/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EACV,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,uBAAe,YAAY;IACb,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU;gBAAlB,MAAM,EAAE,UAAU;CAClD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,YAAY;IAC9C;;;;;;;;;;OAUG;IACG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAMlE;;;;;;;;;;;;;OAaG;IACG,GAAG,CACP,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,yBAAyB,CAAC;IAOrC;;;;;;;;;;;OAWG;IACG,MAAM,CACV,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,IAAI,CAAC;CAMjB;AAGD,YAAY,EACV,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,YAAY,CAAC"}
@@ -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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltade/envoy-sdk",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "type": "module",
5
5
  "description": "A comprehensive TypeScript SDK for the Envoy API with built-in error handling and resource-based architecture",
6
6
  "main": "./dist/index.js",