@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.
- package/dist/resources/companies/index.d.ts +16 -22
- package/dist/resources/companies/index.d.ts.map +1 -1
- package/dist/resources/companies/index.js +28 -28
- package/dist/resources/companies/index.js.map +1 -1
- package/dist/resources/company-members/index.d.ts +6 -9
- package/dist/resources/company-members/index.d.ts.map +1 -1
- package/dist/resources/company-members/index.js +9 -12
- package/dist/resources/company-members/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -16,96 +16,90 @@ declare abstract class BaseResource {
|
|
|
16
16
|
*/
|
|
17
17
|
export declare class Companies extends BaseResource {
|
|
18
18
|
/**
|
|
19
|
-
* List all companies
|
|
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(
|
|
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(
|
|
29
|
+
* const companies = await client.companies.list({ page: 2, per_page: 50 });
|
|
31
30
|
* ```
|
|
32
31
|
*/
|
|
33
|
-
list(
|
|
32
|
+
list(params?: ListCompaniesParams): Promise<ListCompaniesResponse>;
|
|
34
33
|
/**
|
|
35
|
-
* Create a new company
|
|
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(
|
|
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(
|
|
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(
|
|
54
|
+
* const company = await client.companies.get(456);
|
|
58
55
|
* console.log(company); // The company
|
|
59
56
|
* ```
|
|
60
57
|
*/
|
|
61
|
-
get(
|
|
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(
|
|
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(
|
|
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('
|
|
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('
|
|
86
|
+
* const companies = await client.companies.search('Acme', { page: 2, per_page: 50 });
|
|
92
87
|
* ```
|
|
93
88
|
*/
|
|
94
|
-
search(
|
|
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(
|
|
99
|
+
* await client.companies.delete(456);
|
|
106
100
|
* ```
|
|
107
101
|
*/
|
|
108
|
-
delete(
|
|
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,qBAAq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5C,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
|
|
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(
|
|
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(
|
|
28
|
+
* const companies = await client.companies.list({ page: 2, per_page: 50 });
|
|
30
29
|
* ```
|
|
31
30
|
*/
|
|
32
|
-
async list(
|
|
33
|
-
return await this.client.get(
|
|
31
|
+
async list(params) {
|
|
32
|
+
return await this.client.get("/companies", {
|
|
33
|
+
params,
|
|
34
|
+
});
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
|
-
* Create a new company
|
|
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(
|
|
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(
|
|
50
|
-
return await this.client.post(
|
|
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(
|
|
61
|
+
* const company = await client.companies.get(456);
|
|
61
62
|
* console.log(company); // The company
|
|
62
63
|
* ```
|
|
63
64
|
*/
|
|
64
|
-
async get(
|
|
65
|
-
return await this.client.get(`/
|
|
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(
|
|
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(
|
|
83
|
-
return await this.client.patch(`/
|
|
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('
|
|
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('
|
|
97
|
+
* const companies = await client.companies.search('Acme', { page: 2, per_page: 50 });
|
|
99
98
|
* ```
|
|
100
99
|
*/
|
|
101
|
-
async search(
|
|
102
|
-
return await this.client.get(
|
|
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(
|
|
111
|
+
* await client.companies.delete(456);
|
|
112
112
|
* ```
|
|
113
113
|
*/
|
|
114
|
-
async delete(
|
|
115
|
-
await this.client.delete(`/
|
|
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;IAC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AE,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(
|
|
25
|
+
* const members = await client.companyMembers.list(456);
|
|
27
26
|
* console.log(members); // Array of contacts
|
|
28
27
|
* ```
|
|
29
28
|
*/
|
|
30
|
-
list(
|
|
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(
|
|
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(
|
|
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(
|
|
52
|
+
* await client.companyMembers.remove(456, {
|
|
56
53
|
* contact_ids: [101, 102]
|
|
57
54
|
* });
|
|
58
55
|
* ```
|
|
59
56
|
*/
|
|
60
|
-
remove(
|
|
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
|
|
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(
|
|
24
|
+
* const members = await client.companyMembers.list(456);
|
|
26
25
|
* console.log(members); // Array of contacts
|
|
27
26
|
* ```
|
|
28
27
|
*/
|
|
29
|
-
async list(
|
|
30
|
-
return await this.client.get(`/
|
|
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(
|
|
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(
|
|
48
|
-
return await this.client.post(`/
|
|
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(
|
|
55
|
+
* await client.companyMembers.remove(456, {
|
|
59
56
|
* contact_ids: [101, 102]
|
|
60
57
|
* });
|
|
61
58
|
* ```
|
|
62
59
|
*/
|
|
63
|
-
async remove(
|
|
64
|
-
await this.client.delete(`/
|
|
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
|
|
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