@digiteers/uloba3-sdk 1.3.7
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/.eslintrc.json +29 -0
- package/.github/workflows/generate-sdk.yml +126 -0
- package/.prettierrc +11 -0
- package/MIGRATION.md +118 -0
- package/README.md +256 -0
- package/dist/api/accounts.d.ts +31 -0
- package/dist/api/accounts.d.ts.map +1 -0
- package/dist/api/accounts.js +71 -0
- package/dist/api/accounts.js.map +1 -0
- package/dist/api/admin/arrangements.d.ts +41 -0
- package/dist/api/admin/arrangements.d.ts.map +1 -0
- package/dist/api/admin/arrangements.js +60 -0
- package/dist/api/admin/arrangements.js.map +1 -0
- package/dist/api/admin/assistance-types.d.ts +41 -0
- package/dist/api/admin/assistance-types.d.ts.map +1 -0
- package/dist/api/admin/assistance-types.js +60 -0
- package/dist/api/admin/assistance-types.js.map +1 -0
- package/dist/api/admin/contract-case-workflow-states.d.ts +69 -0
- package/dist/api/admin/contract-case-workflow-states.d.ts.map +1 -0
- package/dist/api/admin/contract-case-workflow-states.js +59 -0
- package/dist/api/admin/contract-case-workflow-states.js.map +1 -0
- package/dist/api/admin/contract-types.d.ts +41 -0
- package/dist/api/admin/contract-types.d.ts.map +1 -0
- package/dist/api/admin/contract-types.js +60 -0
- package/dist/api/admin/contract-types.js.map +1 -0
- package/dist/api/admin/expectation-templates.d.ts +39 -0
- package/dist/api/admin/expectation-templates.d.ts.map +1 -0
- package/dist/api/admin/expectation-templates.js +66 -0
- package/dist/api/admin/expectation-templates.js.map +1 -0
- package/dist/api/admin/index.d.ts +11 -0
- package/dist/api/admin/index.d.ts.map +1 -0
- package/dist/api/admin/index.js +24 -0
- package/dist/api/admin/index.js.map +1 -0
- package/dist/api/admin/interest-templates.d.ts +39 -0
- package/dist/api/admin/interest-templates.d.ts.map +1 -0
- package/dist/api/admin/interest-templates.js +66 -0
- package/dist/api/admin/interest-templates.js.map +1 -0
- package/dist/api/admin/organization.d.ts +15 -0
- package/dist/api/admin/organization.d.ts.map +1 -0
- package/dist/api/admin/organization.js +25 -0
- package/dist/api/admin/organization.js.map +1 -0
- package/dist/api/admin/responsibility-templates.d.ts +39 -0
- package/dist/api/admin/responsibility-templates.d.ts.map +1 -0
- package/dist/api/admin/responsibility-templates.js +66 -0
- package/dist/api/admin/responsibility-templates.js.map +1 -0
- package/dist/api/admin/salaries.d.ts +48 -0
- package/dist/api/admin/salaries.d.ts.map +1 -0
- package/dist/api/admin/salaries.js +60 -0
- package/dist/api/admin/salaries.js.map +1 -0
- package/dist/api/admin/work-schedules.d.ts +67 -0
- package/dist/api/admin/work-schedules.d.ts.map +1 -0
- package/dist/api/admin/work-schedules.js +59 -0
- package/dist/api/admin/work-schedules.js.map +1 -0
- package/dist/api/analytics.d.ts +37 -0
- package/dist/api/analytics.d.ts.map +1 -0
- package/dist/api/analytics.js +37 -0
- package/dist/api/analytics.js.map +1 -0
- package/dist/api/applications.d.ts +166 -0
- package/dist/api/applications.d.ts.map +1 -0
- package/dist/api/applications.js +156 -0
- package/dist/api/applications.js.map +1 -0
- package/dist/api/assistants.d.ts +413 -0
- package/dist/api/assistants.d.ts.map +1 -0
- package/dist/api/assistants.js +250 -0
- package/dist/api/assistants.js.map +1 -0
- package/dist/api/auth.d.ts +57 -0
- package/dist/api/auth.d.ts.map +1 -0
- package/dist/api/auth.js +46 -0
- package/dist/api/auth.js.map +1 -0
- package/dist/api/billing.d.ts +33 -0
- package/dist/api/billing.d.ts.map +1 -0
- package/dist/api/billing.js +49 -0
- package/dist/api/billing.js.map +1 -0
- package/dist/api/contract-cases.d.ts +38 -0
- package/dist/api/contract-cases.d.ts.map +1 -0
- package/dist/api/contract-cases.js +65 -0
- package/dist/api/contract-cases.js.map +1 -0
- package/dist/api/contracts.d.ts +903 -0
- package/dist/api/contracts.d.ts.map +1 -0
- package/dist/api/contracts.js +300 -0
- package/dist/api/contracts.js.map +1 -0
- package/dist/api/documents.d.ts +20 -0
- package/dist/api/documents.d.ts.map +1 -0
- package/dist/api/documents.js +27 -0
- package/dist/api/documents.js.map +1 -0
- package/dist/api/feeds.d.ts +23 -0
- package/dist/api/feeds.d.ts.map +1 -0
- package/dist/api/feeds.js +47 -0
- package/dist/api/feeds.js.map +1 -0
- package/dist/api/gdpr.d.ts +23 -0
- package/dist/api/gdpr.d.ts.map +1 -0
- package/dist/api/gdpr.js +50 -0
- package/dist/api/gdpr.js.map +1 -0
- package/dist/api/inquiries.d.ts +190 -0
- package/dist/api/inquiries.d.ts.map +1 -0
- package/dist/api/inquiries.js +173 -0
- package/dist/api/inquiries.js.map +1 -0
- package/dist/api/jobs.d.ts +169 -0
- package/dist/api/jobs.d.ts.map +1 -0
- package/dist/api/jobs.js +294 -0
- package/dist/api/jobs.js.map +1 -0
- package/dist/api/locations.d.ts +30 -0
- package/dist/api/locations.d.ts.map +1 -0
- package/dist/api/locations.js +25 -0
- package/dist/api/locations.js.map +1 -0
- package/dist/api/meetings.d.ts +109 -0
- package/dist/api/meetings.d.ts.map +1 -0
- package/dist/api/meetings.js +75 -0
- package/dist/api/meetings.js.map +1 -0
- package/dist/api/messaging.d.ts +32 -0
- package/dist/api/messaging.d.ts.map +1 -0
- package/dist/api/messaging.js +114 -0
- package/dist/api/messaging.js.map +1 -0
- package/dist/api/notes.d.ts +21 -0
- package/dist/api/notes.d.ts.map +1 -0
- package/dist/api/notes.js +38 -0
- package/dist/api/notes.js.map +1 -0
- package/dist/api/organization.d.ts +56 -0
- package/dist/api/organization.d.ts.map +1 -0
- package/dist/api/organization.js +39 -0
- package/dist/api/organization.js.map +1 -0
- package/dist/api/salaries.d.ts +24 -0
- package/dist/api/salaries.d.ts.map +1 -0
- package/dist/api/salaries.js +39 -0
- package/dist/api/salaries.js.map +1 -0
- package/dist/api/tasks.d.ts +19 -0
- package/dist/api/tasks.d.ts.map +1 -0
- package/dist/api/tasks.js +35 -0
- package/dist/api/tasks.js.map +1 -0
- package/dist/api/users.d.ts +62 -0
- package/dist/api/users.d.ts.map +1 -0
- package/dist/api/users.js +62 -0
- package/dist/api/users.js.map +1 -0
- package/dist/api-types.d.ts +1242 -0
- package/dist/api-types.d.ts.map +1 -0
- package/dist/api-types.js +5 -0
- package/dist/api-types.js.map +1 -0
- package/dist/client.d.ts +69 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +142 -0
- package/dist/client.js.map +1 -0
- package/dist/components/contracts/forms/DirectContractForm.d.ts +1 -0
- package/dist/components/contracts/forms/DirectContractForm.d.ts.map +1 -0
- package/dist/components/contracts/forms/DirectContractForm.js +2 -0
- package/dist/components/contracts/forms/DirectContractForm.js.map +1 -0
- package/dist/constants.d.ts +133 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +139 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +85 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +36489 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/view-types.d.ts +44 -0
- package/dist/view-types.d.ts.map +1 -0
- package/dist/view-types.js +7 -0
- package/dist/view-types.js.map +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import type { Assistant, CreateAssistantInput, UpdateAssistantInput, ListAssistantsParams, PaginatedResponse } from '../api-types';
|
|
3
|
+
import type { paths } from '../types';
|
|
4
|
+
export type AssistantEnhancedResponse = paths['/api/assistants/{id}']['get']['responses']['200']['content']['application/json'];
|
|
5
|
+
export type AssistantViewEnhancedResponse = AssistantEnhancedResponse;
|
|
6
|
+
interface Location {
|
|
7
|
+
id: string;
|
|
8
|
+
assistant_id: string;
|
|
9
|
+
place_id?: string;
|
|
10
|
+
display_name: string;
|
|
11
|
+
address?: string;
|
|
12
|
+
city: string;
|
|
13
|
+
postal_code?: string;
|
|
14
|
+
country?: string;
|
|
15
|
+
lat?: number;
|
|
16
|
+
lng?: number;
|
|
17
|
+
max_distance_km?: number;
|
|
18
|
+
is_primary?: boolean;
|
|
19
|
+
sort_order?: number;
|
|
20
|
+
description?: string;
|
|
21
|
+
created_at: string;
|
|
22
|
+
updated_at: string;
|
|
23
|
+
}
|
|
24
|
+
interface AssistanceType {
|
|
25
|
+
id: string;
|
|
26
|
+
assistant_id: string;
|
|
27
|
+
assistance_type_id: string;
|
|
28
|
+
code: string;
|
|
29
|
+
title: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
sort_order: number;
|
|
32
|
+
}
|
|
33
|
+
interface Responsibility {
|
|
34
|
+
id: string;
|
|
35
|
+
assistant_id: string;
|
|
36
|
+
template_id?: string;
|
|
37
|
+
title: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
is_custom: boolean;
|
|
40
|
+
sort_order: number;
|
|
41
|
+
}
|
|
42
|
+
interface Interest {
|
|
43
|
+
id: string;
|
|
44
|
+
assistant_id: string;
|
|
45
|
+
template_id?: string;
|
|
46
|
+
title: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
is_custom: boolean;
|
|
49
|
+
sort_order: number;
|
|
50
|
+
}
|
|
51
|
+
interface WorkSchedule {
|
|
52
|
+
id: string;
|
|
53
|
+
assistant_id: string;
|
|
54
|
+
work_schedule_id?: string;
|
|
55
|
+
custom_schedule?: string;
|
|
56
|
+
title: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
is_custom: boolean;
|
|
59
|
+
sort_order: number;
|
|
60
|
+
}
|
|
61
|
+
export declare class AssistantsAPI {
|
|
62
|
+
private axios;
|
|
63
|
+
constructor(axios: AxiosInstance);
|
|
64
|
+
/**
|
|
65
|
+
* Check if current user has an assistant profile
|
|
66
|
+
*/
|
|
67
|
+
checkMyProfileExists(): Promise<{
|
|
68
|
+
exists: boolean;
|
|
69
|
+
id?: string;
|
|
70
|
+
}>;
|
|
71
|
+
/**
|
|
72
|
+
* Get current user's assistant profile status with completion details
|
|
73
|
+
*/
|
|
74
|
+
checkMyProfileStatus(): Promise<{
|
|
75
|
+
exists: boolean;
|
|
76
|
+
profileId?: string;
|
|
77
|
+
completionPercentage: number;
|
|
78
|
+
missingFields?: string[];
|
|
79
|
+
lastUpdated?: string;
|
|
80
|
+
}>;
|
|
81
|
+
/**
|
|
82
|
+
* Get current user's assistant profile with enhanced response
|
|
83
|
+
*/
|
|
84
|
+
getMyProfile(): Promise<{
|
|
85
|
+
id: string;
|
|
86
|
+
user_id: string;
|
|
87
|
+
status: "draft" | "private" | "public" | "suspended" | "deleted";
|
|
88
|
+
bio?: string | null;
|
|
89
|
+
accept_terms?: boolean | null;
|
|
90
|
+
demographic_gender?: ("male" | "female" | "other" | "prefer_not_to_say" | null) | null;
|
|
91
|
+
demographic_birth_year?: number | null;
|
|
92
|
+
demographic_marital_status?: ("single" | "married" | "partner" | "divorced" | "widowed" | "other" | null) | null;
|
|
93
|
+
demographic_citizenship?: ("norwegian" | "swedish" | "danish" | "finnish" | "icelandic" | "polish" | "lithuanian" | "german" | "british" | "american" | "other_eu" | "other" | null) | null;
|
|
94
|
+
preference_norwegian_proficiency?: ("native" | "fluent" | "good" | "basic" | "none" | null) | null;
|
|
95
|
+
preference_open_to_job_travel?: boolean | null;
|
|
96
|
+
preference_target_group?: ("adults" | "children" | "both" | null) | null;
|
|
97
|
+
preference_has_drivers_license?: boolean | null;
|
|
98
|
+
preference_willing_to_relocate?: boolean | null;
|
|
99
|
+
hours_per_week?: number | null;
|
|
100
|
+
availability_status?: string | null;
|
|
101
|
+
availability_start_date?: string | null;
|
|
102
|
+
availability_notes?: string | null;
|
|
103
|
+
employment_current_status?: ("student" | "employed" | "unemployed" | "retired" | "homemaker" | "volunteer" | "other" | null) | null;
|
|
104
|
+
police_check_can_obtain?: boolean | null;
|
|
105
|
+
police_check_has_valid?: boolean | null;
|
|
106
|
+
police_check_expiry_date?: string | null;
|
|
107
|
+
police_check_notes?: string | null;
|
|
108
|
+
visibility_show_phone?: boolean | null;
|
|
109
|
+
visibility_show_email?: boolean | null;
|
|
110
|
+
visibility_preferred_contact?: ("email" | "phone" | "both" | null) | null;
|
|
111
|
+
visibility_name_display?: ("firstOnly" | "firstAndLastInitial" | "fullName" | null) | null;
|
|
112
|
+
accept_police_check?: boolean | null;
|
|
113
|
+
generated_title?: string | null;
|
|
114
|
+
view_count?: number | null;
|
|
115
|
+
last_active_at?: string | null;
|
|
116
|
+
created_at: string;
|
|
117
|
+
updated_at: string;
|
|
118
|
+
published_at?: string | null;
|
|
119
|
+
unpublished_at?: string | null;
|
|
120
|
+
} & {
|
|
121
|
+
user?: {
|
|
122
|
+
id: string;
|
|
123
|
+
given_name?: string;
|
|
124
|
+
family_name?: string;
|
|
125
|
+
full_name?: string;
|
|
126
|
+
display_name?: string;
|
|
127
|
+
email?: string;
|
|
128
|
+
email_verified?: boolean;
|
|
129
|
+
phone?: string;
|
|
130
|
+
picture?: string;
|
|
131
|
+
};
|
|
132
|
+
responsibilities?: {
|
|
133
|
+
id: string;
|
|
134
|
+
title?: string | null;
|
|
135
|
+
description?: string;
|
|
136
|
+
is_custom: boolean;
|
|
137
|
+
template_id?: string | null;
|
|
138
|
+
sort_order: number;
|
|
139
|
+
}[];
|
|
140
|
+
interests?: {
|
|
141
|
+
id: string;
|
|
142
|
+
title?: string | null;
|
|
143
|
+
description?: string;
|
|
144
|
+
is_custom: boolean;
|
|
145
|
+
template_id?: string | null;
|
|
146
|
+
sort_order: number;
|
|
147
|
+
}[];
|
|
148
|
+
work_schedules?: {
|
|
149
|
+
id: string;
|
|
150
|
+
title?: string | null;
|
|
151
|
+
description?: string;
|
|
152
|
+
is_custom: boolean;
|
|
153
|
+
template_id?: string | null;
|
|
154
|
+
sort_order: number;
|
|
155
|
+
}[];
|
|
156
|
+
work_schedule_ids?: string[];
|
|
157
|
+
custom_work_schedules?: {
|
|
158
|
+
id: string;
|
|
159
|
+
title?: string | null;
|
|
160
|
+
description?: string;
|
|
161
|
+
is_custom: boolean;
|
|
162
|
+
sort_order: number;
|
|
163
|
+
}[];
|
|
164
|
+
responsibility_template_ids?: string[];
|
|
165
|
+
custom_responsibilities?: {
|
|
166
|
+
id: string;
|
|
167
|
+
title: string;
|
|
168
|
+
description?: string;
|
|
169
|
+
is_custom: boolean;
|
|
170
|
+
sort_order: number;
|
|
171
|
+
}[];
|
|
172
|
+
interest_template_ids?: string[];
|
|
173
|
+
custom_interests?: {
|
|
174
|
+
id: string;
|
|
175
|
+
title: string;
|
|
176
|
+
description?: string;
|
|
177
|
+
is_custom: boolean;
|
|
178
|
+
sort_order: number;
|
|
179
|
+
}[];
|
|
180
|
+
assistance_type_ids?: string[];
|
|
181
|
+
assistance_types?: {
|
|
182
|
+
id: string;
|
|
183
|
+
assistance_type_id: string;
|
|
184
|
+
code: string;
|
|
185
|
+
title: string;
|
|
186
|
+
description?: string;
|
|
187
|
+
sort_order: number;
|
|
188
|
+
}[];
|
|
189
|
+
locations?: {
|
|
190
|
+
id: string;
|
|
191
|
+
city: string;
|
|
192
|
+
postal_code?: string;
|
|
193
|
+
display_name?: string;
|
|
194
|
+
address?: string;
|
|
195
|
+
country?: string;
|
|
196
|
+
lat?: number;
|
|
197
|
+
lng?: number;
|
|
198
|
+
max_distance_km?: number;
|
|
199
|
+
is_primary?: boolean;
|
|
200
|
+
sort_order?: number;
|
|
201
|
+
description?: string;
|
|
202
|
+
}[];
|
|
203
|
+
attachments?: {
|
|
204
|
+
id: string;
|
|
205
|
+
file_name: string;
|
|
206
|
+
original_name: string;
|
|
207
|
+
mime_type: string;
|
|
208
|
+
file_size: number;
|
|
209
|
+
file_type?: string;
|
|
210
|
+
description?: string;
|
|
211
|
+
storage_bucket: string;
|
|
212
|
+
storage_path: string;
|
|
213
|
+
uploaded_by: string;
|
|
214
|
+
created_at: string;
|
|
215
|
+
updated_at: string;
|
|
216
|
+
}[];
|
|
217
|
+
}>;
|
|
218
|
+
/**
|
|
219
|
+
* Create assistant profile for current user
|
|
220
|
+
*/
|
|
221
|
+
createMyProfile(data: CreateAssistantInput): Promise<Assistant>;
|
|
222
|
+
/**
|
|
223
|
+
* Update current user's assistant profile
|
|
224
|
+
*/
|
|
225
|
+
updateMyProfile(data: UpdateAssistantInput): Promise<Assistant>;
|
|
226
|
+
/**
|
|
227
|
+
* List assistants (public endpoint)
|
|
228
|
+
* Only returns assistants with status='public'
|
|
229
|
+
*/
|
|
230
|
+
list(params?: ListAssistantsParams): Promise<PaginatedResponse<Assistant>>;
|
|
231
|
+
/**
|
|
232
|
+
* Get jobseeker profile by ID (public endpoint) with enhanced metadata
|
|
233
|
+
* Returns complete profile with user info and all related data
|
|
234
|
+
* Only accessible if profile status='public'
|
|
235
|
+
*/
|
|
236
|
+
get(id: string): Promise<AssistantEnhancedResponse>;
|
|
237
|
+
/**
|
|
238
|
+
* Get just the assistant data without metadata
|
|
239
|
+
* Convenience method for backward compatibility
|
|
240
|
+
*/
|
|
241
|
+
getData(id: string): Promise<Assistant>;
|
|
242
|
+
/**
|
|
243
|
+
* Get assistant view with enhanced data
|
|
244
|
+
*/
|
|
245
|
+
getAssistantView(id: string): Promise<AssistantViewEnhancedResponse>;
|
|
246
|
+
/**
|
|
247
|
+
* Alias for get() - Get jobseeker profile by ID
|
|
248
|
+
*/
|
|
249
|
+
getJobSeekerProfile(id: string): Promise<AssistantEnhancedResponse>;
|
|
250
|
+
/**
|
|
251
|
+
* Update assistant status (admin only)
|
|
252
|
+
* NOTE: Status changes should go through state machine for proper side effects
|
|
253
|
+
*/
|
|
254
|
+
updateStatus(id: string, status: 'draft' | 'private' | 'public' | 'suspended' | 'deleted'): Promise<Assistant>;
|
|
255
|
+
/**
|
|
256
|
+
* Update availability status
|
|
257
|
+
* This is different from profile status - indicates if assistant is available for work
|
|
258
|
+
*/
|
|
259
|
+
updateAvailability(availability_status: 'available' | 'busy' | 'unavailable'): Promise<Assistant>;
|
|
260
|
+
/**
|
|
261
|
+
* Publish assistant profile (changes status from 'private' to 'public')
|
|
262
|
+
* Uses state machine internally to handle side effects
|
|
263
|
+
* Profile will be public for 90 days
|
|
264
|
+
*/
|
|
265
|
+
publishProfile(): Promise<Assistant>;
|
|
266
|
+
/**
|
|
267
|
+
* Unpublish assistant profile (changes status from 'public' to 'private')
|
|
268
|
+
* Uses state machine internally to handle side effects
|
|
269
|
+
*/
|
|
270
|
+
unpublishProfile(): Promise<Assistant>;
|
|
271
|
+
/**
|
|
272
|
+
* Extend assistant profile by 90 days
|
|
273
|
+
* Only available for published profiles
|
|
274
|
+
*/
|
|
275
|
+
extendProfile(): Promise<Assistant>;
|
|
276
|
+
/**
|
|
277
|
+
* Get publishing info
|
|
278
|
+
*/
|
|
279
|
+
getMyPublishingInfo(): Promise<{
|
|
280
|
+
status: string;
|
|
281
|
+
published_at: string | null;
|
|
282
|
+
expires_at: string | null;
|
|
283
|
+
is_published: boolean;
|
|
284
|
+
can_extend: boolean;
|
|
285
|
+
created_at: string;
|
|
286
|
+
updated_at: string;
|
|
287
|
+
is_active: boolean;
|
|
288
|
+
is_suspended: boolean;
|
|
289
|
+
can_activate: boolean;
|
|
290
|
+
can_suspend: boolean;
|
|
291
|
+
}>;
|
|
292
|
+
/**
|
|
293
|
+
* Get my locations
|
|
294
|
+
*/
|
|
295
|
+
getMyLocations(): Promise<Location[]>;
|
|
296
|
+
/**
|
|
297
|
+
* Add location
|
|
298
|
+
*/
|
|
299
|
+
addLocation(data: {
|
|
300
|
+
place_id?: string;
|
|
301
|
+
display_name: string;
|
|
302
|
+
address?: string;
|
|
303
|
+
city: string;
|
|
304
|
+
postal_code?: string;
|
|
305
|
+
country?: string;
|
|
306
|
+
lat?: number;
|
|
307
|
+
lng?: number;
|
|
308
|
+
max_distance_km?: number;
|
|
309
|
+
is_primary?: boolean;
|
|
310
|
+
sort_order?: number;
|
|
311
|
+
description?: string;
|
|
312
|
+
}): Promise<Location>;
|
|
313
|
+
/**
|
|
314
|
+
* Update location
|
|
315
|
+
*/
|
|
316
|
+
updateLocation(locationId: string, data: Partial<Omit<Location, 'id' | 'assistant_id' | 'created_at' | 'updated_at'>>): Promise<Location>;
|
|
317
|
+
/**
|
|
318
|
+
* Delete location
|
|
319
|
+
*/
|
|
320
|
+
deleteLocation(locationId: string): Promise<void>;
|
|
321
|
+
/**
|
|
322
|
+
* Replace all locations
|
|
323
|
+
*/
|
|
324
|
+
replaceLocations(locations: Array<{
|
|
325
|
+
place_id?: string;
|
|
326
|
+
display_name: string;
|
|
327
|
+
address?: string;
|
|
328
|
+
city: string;
|
|
329
|
+
postal_code?: string;
|
|
330
|
+
country?: string;
|
|
331
|
+
lat?: number;
|
|
332
|
+
lng?: number;
|
|
333
|
+
max_distance_km?: number;
|
|
334
|
+
is_primary?: boolean;
|
|
335
|
+
sort_order?: number;
|
|
336
|
+
description?: string;
|
|
337
|
+
}>): Promise<Location[]>;
|
|
338
|
+
/**
|
|
339
|
+
* Get my assistance types
|
|
340
|
+
*/
|
|
341
|
+
getMyAssistanceTypes(): Promise<AssistanceType[]>;
|
|
342
|
+
/**
|
|
343
|
+
* Set assistance types
|
|
344
|
+
* NOTE: Backend currently expects 'interests' as field name (legacy issue)
|
|
345
|
+
* This will be fixed in future backend update
|
|
346
|
+
*/
|
|
347
|
+
setAssistanceTypes(assistanceTypeIds: string[]): Promise<{
|
|
348
|
+
success: boolean;
|
|
349
|
+
}>;
|
|
350
|
+
/**
|
|
351
|
+
* Get my responsibilities
|
|
352
|
+
*/
|
|
353
|
+
getMyResponsibilities(): Promise<Responsibility[]>;
|
|
354
|
+
/**
|
|
355
|
+
* Set responsibilities
|
|
356
|
+
*/
|
|
357
|
+
setResponsibilities(data: {
|
|
358
|
+
responsibilityTemplateIds?: string[];
|
|
359
|
+
customResponsibilities?: string[];
|
|
360
|
+
}): Promise<{
|
|
361
|
+
success: boolean;
|
|
362
|
+
}>;
|
|
363
|
+
/**
|
|
364
|
+
* Get my work schedules
|
|
365
|
+
*/
|
|
366
|
+
getMyWorkSchedules(): Promise<WorkSchedule[]>;
|
|
367
|
+
/**
|
|
368
|
+
* Set work schedules
|
|
369
|
+
*/
|
|
370
|
+
setWorkSchedules(data: {
|
|
371
|
+
workScheduleIds?: string[];
|
|
372
|
+
customWorkSchedules?: string[];
|
|
373
|
+
}): Promise<{
|
|
374
|
+
success: boolean;
|
|
375
|
+
}>;
|
|
376
|
+
/**
|
|
377
|
+
* Get my interests
|
|
378
|
+
*/
|
|
379
|
+
getMyInterests(): Promise<Interest[]>;
|
|
380
|
+
/**
|
|
381
|
+
* Set interests
|
|
382
|
+
*/
|
|
383
|
+
setInterests(data: {
|
|
384
|
+
interestTemplateIds?: string[];
|
|
385
|
+
customInterests?: string[];
|
|
386
|
+
}): Promise<{
|
|
387
|
+
success: boolean;
|
|
388
|
+
}>;
|
|
389
|
+
/**
|
|
390
|
+
* Delete assistant profile (hard delete - permanently removes profile and all related data)
|
|
391
|
+
* This is irreversible and removes all associated data
|
|
392
|
+
*/
|
|
393
|
+
deleteProfile(): Promise<{
|
|
394
|
+
success: boolean;
|
|
395
|
+
message: string;
|
|
396
|
+
deletedId?: string;
|
|
397
|
+
}>;
|
|
398
|
+
/**
|
|
399
|
+
* Check if user has an active inquiry for an assistant
|
|
400
|
+
* Returns inquiry status information including whether user can create a new inquiry
|
|
401
|
+
*/
|
|
402
|
+
checkInquiryStatus(assistantId: string): Promise<{
|
|
403
|
+
hasActiveInquiry: boolean;
|
|
404
|
+
activeInquiryId?: string;
|
|
405
|
+
inquiryStatus?: string;
|
|
406
|
+
inquiryCreatedAt?: string | null;
|
|
407
|
+
inquiryUpdatedAt?: string | null;
|
|
408
|
+
canInquire: boolean;
|
|
409
|
+
reason?: string;
|
|
410
|
+
}>;
|
|
411
|
+
}
|
|
412
|
+
export {};
|
|
413
|
+
//# sourceMappingURL=assistants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistants.d.ts","sourceRoot":"","sources":["../../src/api/assistants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,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ule", { value: true });
|
|
3
|
+
exports.AssistantsAPI = void 0;
|
|
4
|
+
class AssistantsAPI {
|
|
5
|
+
axios;
|
|
6
|
+
constructor(axios) {
|
|
7
|
+
this.axios = axios;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Check if current user has an assistant profile
|
|
11
|
+
*/
|
|
12
|
+
async checkMyProfileExists() {
|
|
13
|
+
const response = await this.axios.get('/api/assistants/me/exists');
|
|
14
|
+
return response.data;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get current user's assistant profile status with completion details
|
|
18
|
+
*/
|
|
19
|
+
async checkMyProfileStatus() {
|
|
20
|
+
const response = await this.axios.get('/api/assistants/me/status');
|
|
21
|
+
return response.data;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get current user's assistant profile with enhanced response
|
|
25
|
+
*/
|
|
26
|
+
async getMyProfile() {
|
|
27
|
+
const response = await this.axios.get('/api/assistants/me');
|
|
28
|
+
return response.data;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create assistant profile for current user
|
|
32
|
+
*/
|
|
33
|
+
async createMyProfile(data) {
|
|
34
|
+
const response = await this.axios.post('/api/assistants/me', data);
|
|
35
|
+
return response.data;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Update current user's assistant profile
|
|
39
|
+
*/
|
|
40
|
+
async updateMyProfile(data) {
|
|
41
|
+
const response = await this.axios.patch('/api/assistants/me', data);
|
|
42
|
+
return response.data;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* List assistants (public endpoint)
|
|
46
|
+
* Only returns assistants with status='public'
|
|
47
|
+
*/
|
|
48
|
+
async list(params) {
|
|
49
|
+
const response = await this.axios.get('/api/assistants', { params });
|
|
50
|
+
return response.data;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get jobseeker profile by ID (public endpoint) with enhanced metadata
|
|
54
|
+
* Returns complete profile with user info and all related data
|
|
55
|
+
* Only accessible if profile status='public'
|
|
56
|
+
*/
|
|
57
|
+
async get(id) {
|
|
58
|
+
// Don't type the response to avoid filtering out fields
|
|
59
|
+
const response = await this.axios.get(`/api/assistants/${id}`);
|
|
60
|
+
return response.data;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get just the assistant data without metadata
|
|
64
|
+
* Convenience method for backward compatibility
|
|
65
|
+
*/
|
|
66
|
+
async getData(id) {
|
|
67
|
+
const response = await this.get(id);
|
|
68
|
+
return response;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get assistant view with enhanced data
|
|
72
|
+
*/
|
|
73
|
+
async getAssistantView(id) {
|
|
74
|
+
const response = await this.axios.get(`/api/assistants/${id}/view`);
|
|
75
|
+
return response.data;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Alias for get() - Get jobseeker profile by ID
|
|
79
|
+
*/
|
|
80
|
+
async getJobSeekerProfile(id) {
|
|
81
|
+
return this.get(id);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Update assistant status (admin only)
|
|
85
|
+
* NOTE: Status changes should go through state machine for proper side effects
|
|
86
|
+
*/
|
|
87
|
+
async updateStatus(id, status) {
|
|
88
|
+
const response = await this.axios.put(`/api/assistants/${id}/status`, { status });
|
|
89
|
+
return response.data;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Update availability status
|
|
93
|
+
* This is different from profile status - indicates if assistant is available for work
|
|
94
|
+
*/
|
|
95
|
+
async updateAvailability(availability_status) {
|
|
96
|
+
const response = await this.axios.put('/api/assistants/me/availability', { availability_status });
|
|
97
|
+
return response.data;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Publish assistant profile (changes status from 'private' to 'public')
|
|
101
|
+
* Uses state machine internally to handle side effects
|
|
102
|
+
* Profile will be public for 90 days
|
|
103
|
+
*/
|
|
104
|
+
async publishProfile() {
|
|
105
|
+
const response = await this.axios.post('/api/assistants/me/publish', {});
|
|
106
|
+
return response.data;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Unpublish assistant profile (changes status from 'public' to 'private')
|
|
110
|
+
* Uses state machine internally to handle side effects
|
|
111
|
+
*/
|
|
112
|
+
async unpublishProfile() {
|
|
113
|
+
const response = await this.axios.post('/api/assistants/me/unpublish', {});
|
|
114
|
+
return response.data;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Extend assistant profile by 90 days
|
|
118
|
+
* Only available for published profiles
|
|
119
|
+
*/
|
|
120
|
+
async extendProfile() {
|
|
121
|
+
const response = await this.axios.post('/api/assistants/me/extend');
|
|
122
|
+
return response.data;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Get publishing info
|
|
126
|
+
*/
|
|
127
|
+
async getMyPublishingInfo() {
|
|
128
|
+
const response = await this.axios.get('/api/assistants/me/publishing-info');
|
|
129
|
+
return response.data;
|
|
130
|
+
}
|
|
131
|
+
// Location Management
|
|
132
|
+
/**
|
|
133
|
+
* Get my locations
|
|
134
|
+
*/
|
|
135
|
+
async getMyLocations() {
|
|
136
|
+
const response = await this.axios.get('/api/assistants/me/locations');
|
|
137
|
+
return response.data;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Add location
|
|
141
|
+
*/
|
|
142
|
+
async addLocation(data) {
|
|
143
|
+
const response = await this.axios.post('/api/assistants/me/locations', data);
|
|
144
|
+
return response.data;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Update location
|
|
148
|
+
*/
|
|
149
|
+
async updateLocation(locationId, data) {
|
|
150
|
+
const response = await this.axios.put(`/api/assistants/me/locations/${locationId}`, data);
|
|
151
|
+
return response.data;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Delete location
|
|
155
|
+
*/
|
|
156
|
+
async deleteLocation(locationId) {
|
|
157
|
+
await this.axios.delete(`/api/assistants/me/locations/${locationId}`);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Replace all locations
|
|
161
|
+
*/
|
|
162
|
+
async replaceLocations(locations) {
|
|
163
|
+
const response = await this.axios.put('/api/assistants/me/locations', locations);
|
|
164
|
+
return response.data;
|
|
165
|
+
}
|
|
166
|
+
// Assistance Types Management
|
|
167
|
+
/**
|
|
168
|
+
* Get my assistance types
|
|
169
|
+
*/
|
|
170
|
+
async getMyAssistanceTypes() {
|
|
171
|
+
const response = await this.axios.get('/api/assistants/me/assistance-types');
|
|
172
|
+
return response.data.assistance_types;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Set assistance types
|
|
176
|
+
* NOTE: Backend currently expects 'interests' as field name (legacy issue)
|
|
177
|
+
* This will be fixed in future backend update
|
|
178
|
+
*/
|
|
179
|
+
async setAssistanceTypes(assistanceTypeIds) {
|
|
180
|
+
// TODO: Change to { assistance_types: assistanceTypeIds } when backend is updated
|
|
181
|
+
const response = await this.axios.put('/api/assistants/me/assistance-types', {
|
|
182
|
+
interests: assistanceTypeIds // Legacy field name
|
|
183
|
+
});
|
|
184
|
+
return response.data;
|
|
185
|
+
}
|
|
186
|
+
// Responsibilities Management
|
|
187
|
+
/**
|
|
188
|
+
* Get my responsibilities
|
|
189
|
+
*/
|
|
190
|
+
async getMyResponsibilities() {
|
|
191
|
+
const response = await this.axios.get('/api/assistants/me/responsibilities');
|
|
192
|
+
return response.data.responsibilities;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Set responsibilities
|
|
196
|
+
*/
|
|
197
|
+
async setResponsibilities(data) {
|
|
198
|
+
const response = await this.axios.put('/api/assistants/me/responsibilities', data);
|
|
199
|
+
return response.data;
|
|
200
|
+
}
|
|
201
|
+
// Work Schedules Management
|
|
202
|
+
/**
|
|
203
|
+
* Get my work schedules
|
|
204
|
+
*/
|
|
205
|
+
async getMyWorkSchedules() {
|
|
206
|
+
const response = await this.axios.get('/api/assistants/me/work-schedules');
|
|
207
|
+
// Return the schedules array, handling case where data might be wrapped or not
|
|
208
|
+
return response.data.schedules || [];
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Set work schedules
|
|
212
|
+
*/
|
|
213
|
+
async setWorkSchedules(data) {
|
|
214
|
+
const response = await this.axios.put('/api/assistants/me/work-schedules', data);
|
|
215
|
+
return response.data;
|
|
216
|
+
}
|
|
217
|
+
// Interests Management
|
|
218
|
+
/**
|
|
219
|
+
* Get my interests
|
|
220
|
+
*/
|
|
221
|
+
async getMyInterests() {
|
|
222
|
+
const response = await this.axios.get('/api/assistants/me/interests');
|
|
223
|
+
return response.data.interests;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Set interests
|
|
227
|
+
*/
|
|
228
|
+
async setInterests(data) {
|
|
229
|
+
const response = await this.axios.put('/api/assistants/me/interests', data);
|
|
230
|
+
return response.data;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Delete assistant profile (hard delete - permanently removes profile and all related data)
|
|
234
|
+
* This is irreversible and removes all associated data
|
|
235
|
+
*/
|
|
236
|
+
async deleteProfile() {
|
|
237
|
+
const response = await this.axios.delete('/api/assistants/me');
|
|
238
|
+
return response.data;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Check if user has an active inquiry for an assistant
|
|
242
|
+
* Returns inquiry status information including whether user can create a new inquiry
|
|
243
|
+
*/
|
|
244
|
+
async checkInquiryStatus(assistantId) {
|
|
245
|
+
const response = await this.axios.get(`/api/assistants/${assistantId}/inquiry-status`);
|
|
246
|
+
return response.data;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
exports.AssistantsAPI = AssistantsAPI;
|
|
250
|
+
//# sourceMappingURL=assistants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistants.js","sourceRoot":"","sources":["../../src/api/assistants.ts"],"names":[],"mappings":";;;AAsEA,MAAa,aAAa;IACJ;IAApB,YAAoB,KAAoB;QAApB,UAAK,GAAL,KAAK,CAAe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