@nekutima/biome-sdk 0.1.32 → 0.1.33
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/README.md +4 -0
- package/dist/ecosystem/ecosystem.model.d.ts +46 -3
- package/dist/ecosystem/ecosystem.model.d.ts.map +1 -1
- package/dist/ecosystem/ecosystem.model.js +2 -2
- package/dist/ecosystem/ecosystem.service.d.ts +76 -0
- package/dist/ecosystem/ecosystem.service.d.ts.map +1 -0
- package/dist/ecosystem/ecosystem.service.js +211 -0
- package/dist/ecosystem/ecosystem.service.js.map +1 -0
- package/dist/ecosystem/organization.model.d.ts +83 -0
- package/dist/ecosystem/organization.model.d.ts.map +1 -0
- package/dist/ecosystem/organization.model.js +7 -0
- package/dist/ecosystem/organization.model.js.map +1 -0
- package/dist/ecosystem/organization.service.d.ts +76 -0
- package/dist/ecosystem/organization.service.d.ts.map +1 -0
- package/dist/ecosystem/organization.service.js +213 -0
- package/dist/ecosystem/organization.service.js.map +1 -0
- package/dist/ecosystem/person.model.d.ts +75 -0
- package/dist/ecosystem/person.model.d.ts.map +1 -0
- package/dist/ecosystem/person.model.js +7 -0
- package/dist/ecosystem/person.model.js.map +1 -0
- package/dist/ecosystem/person.service.d.ts +77 -0
- package/dist/ecosystem/person.service.d.ts.map +1 -0
- package/dist/ecosystem/person.service.js +214 -0
- package/dist/ecosystem/person.service.js.map +1 -0
- package/dist/ecosystem/schemas.d.ts +30 -1
- package/dist/ecosystem/schemas.d.ts.map +1 -1
- package/dist/ecosystem/schemas.js +39 -2
- package/dist/ecosystem/schemas.js.map +1 -1
- package/dist/ecosystem/search.model.d.ts +28 -0
- package/dist/ecosystem/search.model.d.ts.map +1 -0
- package/dist/ecosystem/search.model.js +6 -0
- package/dist/ecosystem/search.model.js.map +1 -0
- package/dist/ecosystem/search.service.d.ts +30 -0
- package/dist/ecosystem/search.service.d.ts.map +1 -0
- package/dist/ecosystem/search.service.js +92 -0
- package/dist/ecosystem/search.service.js.map +1 -0
- package/dist/index.d.ts +17 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -3
- package/dist/index.js.map +1 -1
- package/dist/utils/validation.utils.d.ts +20 -0
- package/dist/utils/validation.utils.d.ts.map +1 -1
- package/dist/utils/validation.utils.js +39 -1
- package/dist/utils/validation.utils.js.map +1 -1
- package/package.json +1 -2
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BiomeOrganizations = void 0;
|
|
4
|
+
const error_handler_1 = require("../core/error-handler");
|
|
5
|
+
/**
|
|
6
|
+
* Organization management service
|
|
7
|
+
*/
|
|
8
|
+
class BiomeOrganizations {
|
|
9
|
+
constructor(http) {
|
|
10
|
+
this.http = http;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get organization by ID
|
|
14
|
+
*/
|
|
15
|
+
async getById(id) {
|
|
16
|
+
try {
|
|
17
|
+
const response = await this.http.get(`/organizations/${id}`);
|
|
18
|
+
return response.payload;
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to get organization");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get organization with all members (organizations and people)
|
|
26
|
+
*/
|
|
27
|
+
async getWithMembers(id) {
|
|
28
|
+
try {
|
|
29
|
+
const response = await this.http.get(`/organizations/${id}/members`);
|
|
30
|
+
return response.payload;
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to get organization members");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* List organizations with pagination and filters
|
|
38
|
+
*/
|
|
39
|
+
async list(params) {
|
|
40
|
+
try {
|
|
41
|
+
const queryParams = this.buildQueryParams(params);
|
|
42
|
+
const response = await this.http.get(`/organizations?${queryParams}`);
|
|
43
|
+
return response.payload;
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to list organizations");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get child organizations (1:n relationship)
|
|
51
|
+
*/
|
|
52
|
+
async getChildren(parentId) {
|
|
53
|
+
try {
|
|
54
|
+
const response = await this.http.get(`/organizations/${parentId}/children`);
|
|
55
|
+
return response.payload;
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to get child organizations");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get ecosystems the organization participates in
|
|
63
|
+
*/
|
|
64
|
+
async getEcosystems(organizationId) {
|
|
65
|
+
try {
|
|
66
|
+
const response = await this.http.get(`/organizations/${organizationId}/ecosystems`);
|
|
67
|
+
return response.payload;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to get organization ecosystems");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Create a new organization
|
|
75
|
+
*/
|
|
76
|
+
async create(organization) {
|
|
77
|
+
try {
|
|
78
|
+
const response = await this.http.post("/organizations", organization);
|
|
79
|
+
return response.payload;
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to create organization");
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Update an existing organization
|
|
87
|
+
*/
|
|
88
|
+
async update(id, updates) {
|
|
89
|
+
try {
|
|
90
|
+
const response = await this.http.put(`/organizations/${id}`, updates);
|
|
91
|
+
return response.payload;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to update organization");
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Delete an organization (soft delete)
|
|
99
|
+
*/
|
|
100
|
+
async delete(id) {
|
|
101
|
+
try {
|
|
102
|
+
await this.http.delete(`/organizations/${id}`);
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to delete organization");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Add a person to the organization
|
|
110
|
+
*/
|
|
111
|
+
async addPerson(organizationId, personId, position) {
|
|
112
|
+
try {
|
|
113
|
+
await this.http.post(`/organizations/${organizationId}/people`, { personId, position });
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to add person to organization");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Remove a person from the organization
|
|
121
|
+
*/
|
|
122
|
+
async removePerson(organizationId, personId) {
|
|
123
|
+
try {
|
|
124
|
+
await this.http.delete(`/organizations/${organizationId}/people/${personId}`);
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to remove person from organization");
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Update person's position in organization
|
|
132
|
+
*/
|
|
133
|
+
async updatePersonPosition(organizationId, personId, position) {
|
|
134
|
+
try {
|
|
135
|
+
await this.http.put(`/organizations/${organizationId}/people/${personId}`, { position });
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to update person position");
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Add the organization to an ecosystem
|
|
143
|
+
*/
|
|
144
|
+
async addToEcosystem(organizationId, ecosystemId) {
|
|
145
|
+
try {
|
|
146
|
+
await this.http.post(`/organizations/${organizationId}/ecosystems`, { ecosystemId });
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to add organization to ecosystem");
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Remove the organization from an ecosystem
|
|
154
|
+
*/
|
|
155
|
+
async removeFromEcosystem(organizationId, ecosystemId) {
|
|
156
|
+
try {
|
|
157
|
+
await this.http.delete(`/organizations/${organizationId}/ecosystems/${ecosystemId}`);
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to remove organization from ecosystem");
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Set parent organization (1:n relationship)
|
|
165
|
+
*/
|
|
166
|
+
async setParent(organizationId, parentOrganizationId) {
|
|
167
|
+
try {
|
|
168
|
+
const response = await this.http.put(`/organizations/${organizationId}/parent`, { parentOrganizationId });
|
|
169
|
+
return response.payload;
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to set parent organization");
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Remove parent organization
|
|
177
|
+
*/
|
|
178
|
+
async removeParent(organizationId) {
|
|
179
|
+
try {
|
|
180
|
+
const response = await this.http.delete(`/organizations/${organizationId}/parent`);
|
|
181
|
+
return response.payload;
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to remove parent organization");
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Build query parameters from filters
|
|
189
|
+
*/
|
|
190
|
+
buildQueryParams(params) {
|
|
191
|
+
if (!params)
|
|
192
|
+
return "";
|
|
193
|
+
const queryParams = new URLSearchParams();
|
|
194
|
+
if (params.page) {
|
|
195
|
+
queryParams.append("page", params.page.toString());
|
|
196
|
+
}
|
|
197
|
+
if (params.limit) {
|
|
198
|
+
queryParams.append("limit", params.limit.toString());
|
|
199
|
+
}
|
|
200
|
+
if (params.status) {
|
|
201
|
+
queryParams.append("status", params.status);
|
|
202
|
+
}
|
|
203
|
+
if (params.parentOrganizationId) {
|
|
204
|
+
queryParams.append("parentId", params.parentOrganizationId.toString());
|
|
205
|
+
}
|
|
206
|
+
if (params.ecosystemId) {
|
|
207
|
+
queryParams.append("ecosystemId", params.ecosystemId.toString());
|
|
208
|
+
}
|
|
209
|
+
return queryParams.toString();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
exports.BiomeOrganizations = BiomeOrganizations;
|
|
213
|
+
//# sourceMappingURL=organization.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization.service.js","sourceRoot":"","sources":["../../src/ecosystem/organization.service.ts"],"names":[],"mappings":";;;AACA,yDAAuD;AAcvD;;GAEG;AACH,MAAa,kBAAkB;IAC3B,YAAoB,IAAqB;QAArB,SAAI,GAAJ,IAAI,CAAiB;IAAG,CAAC;IAE7C;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,EAAU;QACpB,IAAI,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAChC,kBAAkB,EAAE,EAAE,CACzB,CAAC;YACF,OAAO,QAAQ,CAAC,OAAO,CAAC;QAC5B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,IAAA,8BAAc,EAAC,KAAK,EAAE,4BAA4B,CAAC,CAAC;QAC9D,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc,CAAC,EAAU;QAC3B,IAAI,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAChC,kBAAkB,EAAE,UAAU,CACjC,CAAC;YACF,OAAO,QAAQ,CAAC,OAAO,CAAC;QAC5B,CAAC;QAAC,OAAO,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MAAM,CAAC,CAAC;QAChD,CAAC;QACD,IAAI,MAAM,CAAC,oBAAoB,EAAE,CAAC;YAC9B,WAAW,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,oBAAoB,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3E,CAAC;QACD,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,WAAW,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;QACrE,CAAC;QAED,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;CACJ;AA1OD,gDA0OC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Person model for Biome platform
|
|
3
|
+
* People are profile entities that can be linked to users and participate in ecosystems/organizations
|
|
4
|
+
*/
|
|
5
|
+
export type PersonSex = 'male' | 'female' | 'prefer_not_to_say';
|
|
6
|
+
export interface Person {
|
|
7
|
+
id?: number;
|
|
8
|
+
prename?: string;
|
|
9
|
+
middleName?: string;
|
|
10
|
+
familyName?: string;
|
|
11
|
+
sex?: PersonSex;
|
|
12
|
+
birthday?: Date;
|
|
13
|
+
linkedUserId?: number;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
createdBy: number;
|
|
16
|
+
updatedAt: Date;
|
|
17
|
+
updatedBy: number;
|
|
18
|
+
}
|
|
19
|
+
export interface PersonMinimal {
|
|
20
|
+
id: number;
|
|
21
|
+
prename?: string;
|
|
22
|
+
familyName?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface CreatePersonRequest {
|
|
25
|
+
prename?: string;
|
|
26
|
+
middleName?: string;
|
|
27
|
+
familyName?: string;
|
|
28
|
+
sex?: PersonSex;
|
|
29
|
+
birthday?: Date;
|
|
30
|
+
}
|
|
31
|
+
export interface UpdatePersonRequest {
|
|
32
|
+
prename?: string;
|
|
33
|
+
middleName?: string;
|
|
34
|
+
familyName?: string;
|
|
35
|
+
sex?: PersonSex;
|
|
36
|
+
birthday?: Date;
|
|
37
|
+
}
|
|
38
|
+
export interface PersonListParams {
|
|
39
|
+
page?: number;
|
|
40
|
+
limit?: number;
|
|
41
|
+
ecosystemId?: number;
|
|
42
|
+
organizationId?: number;
|
|
43
|
+
search?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface PersonListResponse {
|
|
46
|
+
people: Person[];
|
|
47
|
+
pagination: {
|
|
48
|
+
page: number;
|
|
49
|
+
limit: number;
|
|
50
|
+
total: number;
|
|
51
|
+
totalPages: number;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface PersonWithMemberships extends Person {
|
|
55
|
+
ecosystems: EcosystemMembership[];
|
|
56
|
+
organizations: OrganizationMembership[];
|
|
57
|
+
}
|
|
58
|
+
export interface EcosystemMembership {
|
|
59
|
+
ecosystemId: number;
|
|
60
|
+
ecosystemName: string;
|
|
61
|
+
}
|
|
62
|
+
export interface OrganizationMembership {
|
|
63
|
+
organizationId: number;
|
|
64
|
+
organizationName: string;
|
|
65
|
+
position?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface EcosystemMinimal {
|
|
68
|
+
id: number;
|
|
69
|
+
name: string;
|
|
70
|
+
}
|
|
71
|
+
export interface OrganizationMinimal {
|
|
72
|
+
id: number;
|
|
73
|
+
name: string;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=person.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"person.model.d.ts","sourceRoot":"","sources":["../../src/ecosystem/person.model.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,mBAAmB,CAAC;AAEhE,MAAM,WAAW,MAAM;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;I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qBAAsB,SAAQ,MAAM;IACjD,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,aAAa,EAAE,sBAAsB,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,mBAAmB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Person model for Biome platform
|
|
4
|
+
* People are profile entities that can be linked to users and participate in ecosystems/organizations
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
//# sourceMappingURL=person.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"person.model.js","sourceRoot":"","sources":["../../src/ecosystem/person.model.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { BiomeHttpClient } from "../core/http-client";
|
|
2
|
+
import { Person, CreatePersonRequest, UpdatePersonRequest, PersonListParams, PersonListResponse, PersonWithMemberships, EcosystemMinimal, OrganizationMinimal } from "./person.model";
|
|
3
|
+
/**
|
|
4
|
+
* Person management service
|
|
5
|
+
*/
|
|
6
|
+
export declare class BiomePeople {
|
|
7
|
+
private http;
|
|
8
|
+
constructor(http: BiomeHttpClient);
|
|
9
|
+
/**
|
|
10
|
+
* Get person by ID
|
|
11
|
+
*/
|
|
12
|
+
getById(id: number): Promise<Person>;
|
|
13
|
+
/**
|
|
14
|
+
* Get person with all their ecosystem and organization memberships
|
|
15
|
+
*/
|
|
16
|
+
getWithMemberships(id: number): Promise<PersonWithMemberships>;
|
|
17
|
+
/**
|
|
18
|
+
* List people with pagination and filters
|
|
19
|
+
*/
|
|
20
|
+
list(params?: PersonListParams): Promise<PersonListResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Get ecosystems the person participates in
|
|
23
|
+
*/
|
|
24
|
+
getEcosystems(personId: number): Promise<EcosystemMinimal[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Get organizations the person participates in
|
|
27
|
+
*/
|
|
28
|
+
getOrganizations(personId: number): Promise<OrganizationMinimal[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Create a new person
|
|
31
|
+
*/
|
|
32
|
+
create(person: CreatePersonRequest): Promise<{
|
|
33
|
+
id: number;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Update an existing person
|
|
37
|
+
*/
|
|
38
|
+
update(id: number, updates: UpdatePersonRequest): Promise<Person>;
|
|
39
|
+
/**
|
|
40
|
+
* Delete a person (soft delete)
|
|
41
|
+
*/
|
|
42
|
+
delete(id: number): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Link/reclaim person to current user account
|
|
45
|
+
* This is used when a user wants to claim their person profile
|
|
46
|
+
*/
|
|
47
|
+
linkUser(personId: number): Promise<Person>;
|
|
48
|
+
/**
|
|
49
|
+
* Unlink person from user account
|
|
50
|
+
*/
|
|
51
|
+
unlinkUser(personId: number): Promise<Person>;
|
|
52
|
+
/**
|
|
53
|
+
* Add person to an ecosystem
|
|
54
|
+
*/
|
|
55
|
+
addToEcosystem(personId: number, ecosystemId: number): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Remove person from an ecosystem
|
|
58
|
+
*/
|
|
59
|
+
removeFromEcosystem(personId: number, ecosystemId: number): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Add person to an organization (optionally with position)
|
|
62
|
+
*/
|
|
63
|
+
addToOrganization(personId: number, organizationId: number, position?: string): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Remove person from an organization
|
|
66
|
+
*/
|
|
67
|
+
removeFromOrganization(personId: number, organizationId: number): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Update person's position in an organization
|
|
70
|
+
*/
|
|
71
|
+
updateOrganizationPosition(personId: number, organizationId: number, position: string): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Build query parameters from filters
|
|
74
|
+
*/
|
|
75
|
+
private buildQueryParams;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=person.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"person.service.d.ts","sourceRoot":"","sources":["../../src/ecosystem/person.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EACH,MAAM,EACN,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACtB,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,qBAAa,WAAW;IACR,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,eAAe;IAEzC;;OAEG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAW1C;;OAEG;IACG,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAWpE;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAYlE;;OAEG;IACG,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAWlE;;OAEG;IACG,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CA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
+
const error_handler_1 = require("../core/error-handler");
|
|
5
|
+
/**
|
|
6
|
+
* Person management service
|
|
7
|
+
*/
|
|
8
|
+
class BiomePeople {
|
|
9
|
+
constructor(http) {
|
|
10
|
+
this.http = http;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get person by ID
|
|
14
|
+
*/
|
|
15
|
+
async getById(id) {
|
|
16
|
+
try {
|
|
17
|
+
const response = await this.http.get(`/people/${id}`);
|
|
18
|
+
return response.payload;
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to get person");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get person with all their ecosystem and organization memberships
|
|
26
|
+
*/
|
|
27
|
+
async getWithMemberships(id) {
|
|
28
|
+
try {
|
|
29
|
+
const response = await this.http.get(`/people/${id}/memberships`);
|
|
30
|
+
return response.payload;
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to get person memberships");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* List people with pagination and filters
|
|
38
|
+
*/
|
|
39
|
+
async list(params) {
|
|
40
|
+
try {
|
|
41
|
+
const queryParams = this.buildQueryParams(params);
|
|
42
|
+
const response = await this.http.get(`/people?${queryParams}`);
|
|
43
|
+
return response.payload;
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to list people");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get ecosystems the person participates in
|
|
51
|
+
*/
|
|
52
|
+
async getEcosystems(personId) {
|
|
53
|
+
try {
|
|
54
|
+
const response = await this.http.get(`/people/${personId}/ecosystems`);
|
|
55
|
+
return response.payload;
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to get person ecosystems");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get organizations the person participates in
|
|
63
|
+
*/
|
|
64
|
+
async getOrganizations(personId) {
|
|
65
|
+
try {
|
|
66
|
+
const response = await this.http.get(`/people/${personId}/organizations`);
|
|
67
|
+
return response.payload;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to get person organizations");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Create a new person
|
|
75
|
+
*/
|
|
76
|
+
async create(person) {
|
|
77
|
+
try {
|
|
78
|
+
const response = await this.http.post("/people", person);
|
|
79
|
+
return response.payload;
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to create person");
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Update an existing person
|
|
87
|
+
*/
|
|
88
|
+
async update(id, updates) {
|
|
89
|
+
try {
|
|
90
|
+
const response = await this.http.put(`/people/${id}`, updates);
|
|
91
|
+
return response.payload;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to update person");
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Delete a person (soft delete)
|
|
99
|
+
*/
|
|
100
|
+
async delete(id) {
|
|
101
|
+
try {
|
|
102
|
+
await this.http.delete(`/people/${id}`);
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to delete person");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Link/reclaim person to current user account
|
|
110
|
+
* This is used when a user wants to claim their person profile
|
|
111
|
+
*/
|
|
112
|
+
async linkUser(personId) {
|
|
113
|
+
try {
|
|
114
|
+
const response = await this.http.post(`/people/${personId}/link-user`, {});
|
|
115
|
+
return response.payload;
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to link person to user");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Unlink person from user account
|
|
123
|
+
*/
|
|
124
|
+
async unlinkUser(personId) {
|
|
125
|
+
try {
|
|
126
|
+
const response = await this.http.delete(`/people/${personId}/link-user`);
|
|
127
|
+
return response.payload;
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to unlink person from user");
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Add person to an ecosystem
|
|
135
|
+
*/
|
|
136
|
+
async addToEcosystem(personId, ecosystemId) {
|
|
137
|
+
try {
|
|
138
|
+
await this.http.post(`/people/${personId}/ecosystems`, { ecosystemId });
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to add person to ecosystem");
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Remove person from an ecosystem
|
|
146
|
+
*/
|
|
147
|
+
async removeFromEcosystem(personId, ecosystemId) {
|
|
148
|
+
try {
|
|
149
|
+
await this.http.delete(`/people/${personId}/ecosystems/${ecosystemId}`);
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to remove person from ecosystem");
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Add person to an organization (optionally with position)
|
|
157
|
+
*/
|
|
158
|
+
async addToOrganization(personId, organizationId, position) {
|
|
159
|
+
try {
|
|
160
|
+
await this.http.post(`/people/${personId}/organizations`, { organizationId, position });
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to add person to organization");
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Remove person from an organization
|
|
168
|
+
*/
|
|
169
|
+
async removeFromOrganization(personId, organizationId) {
|
|
170
|
+
try {
|
|
171
|
+
await this.http.delete(`/people/${personId}/organizations/${organizationId}`);
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to remove person from organization");
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Update person's position in an organization
|
|
179
|
+
*/
|
|
180
|
+
async updateOrganizationPosition(personId, organizationId, position) {
|
|
181
|
+
try {
|
|
182
|
+
await this.http.put(`/people/${personId}/organizations/${organizationId}`, { position });
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
throw (0, error_handler_1.createSdkError)(error, "Failed to update person position");
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Build query parameters from filters
|
|
190
|
+
*/
|
|
191
|
+
buildQueryParams(params) {
|
|
192
|
+
if (!params)
|
|
193
|
+
return "";
|
|
194
|
+
const queryParams = new URLSearchParams();
|
|
195
|
+
if (params.page) {
|
|
196
|
+
queryParams.append("page", params.page.toString());
|
|
197
|
+
}
|
|
198
|
+
if (params.limit) {
|
|
199
|
+
queryParams.append("limit", params.limit.toString());
|
|
200
|
+
}
|
|
201
|
+
if (params.ecosystemId) {
|
|
202
|
+
queryParams.append("ecosystemId", params.ecosystemId.toString());
|
|
203
|
+
}
|
|
204
|
+
if (params.organizationId) {
|
|
205
|
+
queryParams.append("organizationId", params.organizationId.toString());
|
|
206
|
+
}
|
|
207
|
+
if (params.search) {
|
|
208
|
+
queryParams.append("q", params.search);
|
|
209
|
+
}
|
|
210
|
+
return queryParams.toString();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
exports.BiomePeople = BiomePeople;
|
|
214
|
+
//# sourceMappingURL=person.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"person.service.js","sourceRoot":"","sources":["../../src/ecosystem/person.service.ts"],"names":[],"mappings":";;;AACA,yDAAuD;AAavD;;GAEG;AACH,MAAa,WAAW;IACpB,YAAoB,IAAqB;QAArB,SAAI,GAAJ,IAAI,CAAiB;IAAG,CAAC;IAE7C;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,EAAU;QACpB,IAAI,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAChC,WAAW,EAAE,EAAE,CAClB,CAAC;YACF,OAAO,QAAQ,CAAC,OAAO,CAAC;QAC5B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,IAAA,8BAAc,EAAC,KAAK,EAAE,sBAAsB,CAAC,CAAC;QACxD,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB,CAAC,EAAU;QAC/B,IAAI,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAChC,WAAW,EAAE,cAAc,CAC9B,CAAC;YACF,OAAO,QAAQ,CAAC,OAAO,CAAC;QAC5B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,IAAA,8BAAc,EAAC,KAAK,EAAE,kCAAkC,CAAC,CAAC;QACpE,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,MAAyB;QAChC,IAAI,CAAC;YACD,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;YAClD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAChC,WAAW,WAAW,EAAE,CAC3B,CAAC;YACF,OAAO,QAAQ,CAAC,OAAO,CAAC;QAC5B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,IAAA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: {
|
|
2
2
|
name: (value: any) => boolean;
|
|
3
3
|
description: (value: any) => boolean;
|
|
4
|
-
|
|
4
|
+
type: (value: any) => boolean;
|
|
5
|
+
status: (value: any) => boolean;
|
|
6
|
+
ownerId: (value: any) => boolean;
|
|
7
|
+
parentEcosystemId: (value: any) => boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const organizationValidationSchema: {
|
|
10
|
+
name: (value: any) => boolean;
|
|
11
|
+
description: (value: any) => boolean;
|
|
12
|
+
logoFileId: (value: any) => boolean;
|
|
13
|
+
type: (value: any) => boolean;
|
|
14
|
+
size: (value: any) => boolean;
|
|
15
|
+
markets: (value: any) => any;
|
|
16
|
+
techVertical: (value: any) => any;
|
|
17
|
+
responsiblePersonId: (value: any) => boolean;
|
|
18
|
+
parentOrganizationId: (value: any) => boolean;
|
|
19
|
+
status: (value: any) => boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const personValidationSchema: {
|
|
22
|
+
prename: (value: any) => boolean;
|
|
23
|
+
middleName: (value: any) => boolean;
|
|
24
|
+
familyName: (value: any) => boolean;
|
|
25
|
+
sex: (value: any) => boolean;
|
|
26
|
+
birthday: (value: any) => boolean;
|
|
27
|
+
linkedUserId: (value: any) => boolean;
|
|
28
|
+
};
|
|
29
|
+
export declare const searchValidationSchema: {
|
|
30
|
+
query: (value: any) => boolean;
|
|
31
|
+
types: (value: any) => any;
|
|
32
|
+
limit: (value: any) => boolean;
|
|
33
|
+
page: (value: any) => boolean;
|
|
5
34
|
};
|
|
6
35
|
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/ecosystem/schemas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/ecosystem/schemas.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,yBAAyB;kBACpB,GAAG;yBACI,GAAG;kBACV,GAAG;oBACD,GAAG;qBACF,GAAG;+BACO,GAAG;CACjC,CAAC;AAEF,eAAO,MAAM,4BAA4B;kBACvB,GAAG;yBACI,GAAG;wBACJ,GAAG;kBACT,GAAG;kBACH,GAAG;qBACA,GAAG;0BACE,GAAG;iCACI,GAAG;kCACF,GAAG;oBACjB,GAAG;CACtB,CAAC;AAEF,eAAO,MAAM,sBAAsB;qBACd,GAAG;wBACA,GAAG;wBACH,GAAG;iBACV,GAAG;sBACE,GAAG;0BACC,GAAG;CAC5B,CAAC;AAEF,eAAO,MAAM,sBAAsB;mBAChB,GAAG;mBACH,GAAG;mBACH,GAAG;kBACJ,GAAG;CACpB,CAAC"}
|