@integraciones_doc24/sdk 1.16.34 → 1.16.35
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/lib/schemas.d.ts +17 -0
- package/lib/schemas.js +7 -0
- package/lib/types.d.ts +4 -1
- package/lib/userSdk/videoVisit.d.ts +7 -1
- package/lib/userSdk/videoVisit.js +13 -2
- package/package.json +1 -1
package/lib/schemas.d.ts
CHANGED
|
@@ -2510,6 +2510,23 @@ export declare const doc24Schemas: {
|
|
|
2510
2510
|
vcToken: string;
|
|
2511
2511
|
attachedFile: string;
|
|
2512
2512
|
}>;
|
|
2513
|
+
uploadFileConsultationResponse: import("zod").ZodObject<{
|
|
2514
|
+
fileId: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
2515
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
2516
|
+
fileId?: number | undefined;
|
|
2517
|
+
}, {
|
|
2518
|
+
fileId?: number | undefined;
|
|
2519
|
+
}>;
|
|
2520
|
+
deleteFileConsultationParams: import("zod").ZodObject<{
|
|
2521
|
+
vcToken: import("zod").ZodString;
|
|
2522
|
+
fileId: import("zod").ZodNumber;
|
|
2523
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
2524
|
+
vcToken: string;
|
|
2525
|
+
fileId: number;
|
|
2526
|
+
}, {
|
|
2527
|
+
vcToken: string;
|
|
2528
|
+
fileId: number;
|
|
2529
|
+
}>;
|
|
2513
2530
|
healthQuizParams: import("zod").ZodObject<{
|
|
2514
2531
|
patientId: import("zod").ZodNumber;
|
|
2515
2532
|
quiz: import("zod").ZodRecord<import("zod").ZodAny>;
|
package/lib/schemas.js
CHANGED
|
@@ -542,6 +542,13 @@ exports.doc24Schemas = {
|
|
|
542
542
|
attachedFile: zod_1.string(),
|
|
543
543
|
fileName: zod_1.string().optional(),
|
|
544
544
|
}),
|
|
545
|
+
uploadFileConsultationResponse: zod_1.object({
|
|
546
|
+
fileId: zod_1.number().optional(),
|
|
547
|
+
}),
|
|
548
|
+
deleteFileConsultationParams: zod_1.object({
|
|
549
|
+
vcToken: zod_1.string(),
|
|
550
|
+
fileId: zod_1.number(),
|
|
551
|
+
}),
|
|
545
552
|
healthQuizParams: zod_1.object({
|
|
546
553
|
patientId: zod_1.number(),
|
|
547
554
|
quiz: zod_1.record(zod_1.any()),
|
package/lib/types.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export declare namespace Doc24 {
|
|
|
51
51
|
type BinahWellnessResponse = TypeOf<typeof doc24Schemas.binahWellnessResponse>;
|
|
52
52
|
type ProfessionalsBySpecialtyFilter = TypeOf<typeof doc24Schemas.professionalsBySpecialtyFilter>;
|
|
53
53
|
type UploadFileConsultationParams = TypeOf<typeof doc24Schemas.uploadFileConsultationParams>;
|
|
54
|
+
type UploadFileConsultationResponse = TypeOf<typeof doc24Schemas.uploadFileConsultationResponse>;
|
|
55
|
+
type DeleteFileConsultationParams = TypeOf<typeof doc24Schemas.deleteFileConsultationParams>;
|
|
54
56
|
type HealthQuizParams = TypeOf<typeof doc24Schemas.healthQuizParams>;
|
|
55
57
|
type BaseSdk = {
|
|
56
58
|
declareUser: (params: DeclareUserParams) => Promise<DeclareUserResponse>;
|
|
@@ -103,7 +105,8 @@ export declare namespace Doc24 {
|
|
|
103
105
|
submitHealthQuiz: (params: HealthQuizParams) => Promise<void>;
|
|
104
106
|
userId: number;
|
|
105
107
|
getBinahWellnessLink: (body: BinahWellnessGetLinkParams) => Promise<BinahWellnessResponse>;
|
|
106
|
-
uploadFileConsultation: (params: UploadFileConsultationParams) => Promise<
|
|
108
|
+
uploadFileConsultation: (params: UploadFileConsultationParams) => Promise<UploadFileConsultationResponse>;
|
|
109
|
+
deleteFileConsultation: (params: DeleteFileConsultationParams) => Promise<void>;
|
|
107
110
|
};
|
|
108
111
|
namespace Webhook {
|
|
109
112
|
type StatusChangeEventStatus = 'S' | 'C' | 'F' | 'A' | 'D' | 'L';
|
|
@@ -184,5 +184,11 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
|
|
|
184
184
|
fileName?: string | undefined;
|
|
185
185
|
vcToken: string;
|
|
186
186
|
attachedFile: string;
|
|
187
|
-
}) => Promise<
|
|
187
|
+
}) => Promise<{
|
|
188
|
+
fileId?: number | undefined;
|
|
189
|
+
}>;
|
|
190
|
+
deleteFileConsultation: (params: {
|
|
191
|
+
vcToken: string;
|
|
192
|
+
fileId: number;
|
|
193
|
+
}) => Promise<void>;
|
|
188
194
|
};
|
|
@@ -196,14 +196,24 @@ const getVideoVisitMethods = (makeRequest) => {
|
|
|
196
196
|
})),
|
|
197
197
|
};
|
|
198
198
|
});
|
|
199
|
-
const uploadFileConsultation = validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.uploadFileConsultationParams]),
|
|
199
|
+
const uploadFileConsultation = validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.uploadFileConsultationParams]), schemas_1.doc24Schemas.uploadFileConsultationResponse, async (params) => {
|
|
200
200
|
const form = new form_data_1.default();
|
|
201
201
|
form.append('vc_token', params.vcToken);
|
|
202
202
|
form.append('attached_file', fs_1.default.createReadStream(params.attachedFile));
|
|
203
203
|
if (params.fileName)
|
|
204
204
|
form.append('file_name', params.fileName);
|
|
205
205
|
const response = await makeRequest('POST', '/upload-file-consultation', form);
|
|
206
|
-
|
|
206
|
+
// Unlike most doc24 endpoints, this one is not wrapped in `data`:
|
|
207
|
+
// {status, message, file_id}.
|
|
208
|
+
return {
|
|
209
|
+
fileId: response.file_id != null ? Number(response.file_id) : undefined,
|
|
210
|
+
};
|
|
211
|
+
});
|
|
212
|
+
const deleteFileConsultation = validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.deleteFileConsultationParams]), zod_1.undefined(), async (params) => {
|
|
213
|
+
await makeRequest('DELETE', '/delete-file-consultation', {
|
|
214
|
+
vc_token: params.vcToken,
|
|
215
|
+
file_id: params.fileId,
|
|
216
|
+
});
|
|
207
217
|
});
|
|
208
218
|
return {
|
|
209
219
|
scheduleVideoVisit,
|
|
@@ -215,6 +225,7 @@ const getVideoVisitMethods = (makeRequest) => {
|
|
|
215
225
|
getActiveVideoVisits,
|
|
216
226
|
getCompleteVideoVisitDetails,
|
|
217
227
|
uploadFileConsultation,
|
|
228
|
+
deleteFileConsultation,
|
|
218
229
|
};
|
|
219
230
|
};
|
|
220
231
|
exports.getVideoVisitMethods = getVideoVisitMethods;
|