@integraciones_doc24/sdk 0.28.0 → 0.29.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/lib/baseSdk.js +15 -0
- package/lib/index.d.ts +11 -1
- package/lib/schemas.d.ts +34 -6
- package/lib/schemas.js +13 -2
- package/lib/types.d.ts +2 -0
- package/lib/userSdk/schedule.d.ts +1 -1
- package/package.json +1 -1
package/lib/baseSdk.js
CHANGED
|
@@ -79,6 +79,21 @@ const getBaseSdk = async (url, credentials) => {
|
|
|
79
79
|
};
|
|
80
80
|
return mapped;
|
|
81
81
|
}),
|
|
82
|
+
enroll: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.enrollmentParams]), zod_1.void(), async (params) => {
|
|
83
|
+
const path = `/enrollment`;
|
|
84
|
+
await makeRequest('POST', path, {
|
|
85
|
+
user_data: {
|
|
86
|
+
firstname: params.firstName,
|
|
87
|
+
lastname: params.lastName,
|
|
88
|
+
gender: params.gender.toUpperCase(),
|
|
89
|
+
identification_number: params.identificationNumber,
|
|
90
|
+
birthdate: date_fns_1.format(params.birthdate, 'yyyy-MM-dd'),
|
|
91
|
+
email: params.email,
|
|
92
|
+
plan: params.plan,
|
|
93
|
+
start_date: date_fns_1.format(params.startDate, 'yyyy-MM-dd'),
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
}),
|
|
82
97
|
};
|
|
83
98
|
return baseSdk;
|
|
84
99
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
|
|
|
34
34
|
lastName: string;
|
|
35
35
|
birthdate: Date;
|
|
36
36
|
gender: "m" | "f";
|
|
37
|
-
phone: string;
|
|
37
|
+
phone: string | null;
|
|
38
38
|
email: string;
|
|
39
39
|
specialties: {
|
|
40
40
|
id: number;
|
|
@@ -66,5 +66,15 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
|
|
|
66
66
|
}[];
|
|
67
67
|
}[];
|
|
68
68
|
}>;
|
|
69
|
+
enroll: (params: {
|
|
70
|
+
firstName: string;
|
|
71
|
+
lastName: string;
|
|
72
|
+
birthdate: Date;
|
|
73
|
+
gender: "m" | "f";
|
|
74
|
+
email: string;
|
|
75
|
+
startDate: Date;
|
|
76
|
+
identificationNumber: string;
|
|
77
|
+
plan: string;
|
|
78
|
+
}) => Promise<void>;
|
|
69
79
|
}>;
|
|
70
80
|
export type { Doc24 } from './types';
|
package/lib/schemas.d.ts
CHANGED
|
@@ -144,11 +144,11 @@ export declare const doc24Schemas: {
|
|
|
144
144
|
type: import("zod").ZodEnum<["appointment", "chat", "instant"]>;
|
|
145
145
|
atentions: import("zod").ZodNumber;
|
|
146
146
|
ranking: import("zod").ZodUnknown;
|
|
147
|
-
length: import("zod").ZodNullable<import("zod").ZodNumber
|
|
147
|
+
length: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
148
148
|
}, "strip", import("zod").ZodTypeAny, {
|
|
149
|
+
length?: number | null | undefined;
|
|
149
150
|
ranking?: unknown;
|
|
150
151
|
date: Date;
|
|
151
|
-
length: number | null;
|
|
152
152
|
type: "appointment" | "chat" | "instant";
|
|
153
153
|
id: string | number;
|
|
154
154
|
professional: {
|
|
@@ -164,9 +164,9 @@ export declare const doc24Schemas: {
|
|
|
164
164
|
};
|
|
165
165
|
atentions: number;
|
|
166
166
|
}, {
|
|
167
|
+
length?: number | null | undefined;
|
|
167
168
|
ranking?: unknown;
|
|
168
169
|
date: Date;
|
|
169
|
-
length: number | null;
|
|
170
170
|
type: "appointment" | "chat" | "instant";
|
|
171
171
|
id: string | number;
|
|
172
172
|
professional: {
|
|
@@ -618,7 +618,7 @@ export declare const doc24Schemas: {
|
|
|
618
618
|
birthdate: import("zod").ZodDate;
|
|
619
619
|
gender: import("zod").ZodEnum<["m", "f"]>;
|
|
620
620
|
email: import("zod").ZodString;
|
|
621
|
-
phone: import("zod").ZodString
|
|
621
|
+
phone: import("zod").ZodNullable<import("zod").ZodString>;
|
|
622
622
|
logoUrl: import("zod").ZodString;
|
|
623
623
|
matriculation: import("zod").ZodArray<import("zod").ZodObject<{
|
|
624
624
|
number: import("zod").ZodString;
|
|
@@ -659,7 +659,7 @@ export declare const doc24Schemas: {
|
|
|
659
659
|
lastName: string;
|
|
660
660
|
birthdate: Date;
|
|
661
661
|
gender: "m" | "f";
|
|
662
|
-
phone: string;
|
|
662
|
+
phone: string | null;
|
|
663
663
|
email: string;
|
|
664
664
|
specialties: {
|
|
665
665
|
id: number;
|
|
@@ -682,7 +682,7 @@ export declare const doc24Schemas: {
|
|
|
682
682
|
lastName: string;
|
|
683
683
|
birthdate: Date;
|
|
684
684
|
gender: "m" | "f";
|
|
685
|
-
phone: string;
|
|
685
|
+
phone: string | null;
|
|
686
686
|
email: string;
|
|
687
687
|
specialties: {
|
|
688
688
|
id: number;
|
|
@@ -897,4 +897,32 @@ export declare const doc24Schemas: {
|
|
|
897
897
|
id: number;
|
|
898
898
|
userType: "patient" | "professional";
|
|
899
899
|
}>;
|
|
900
|
+
enrollmentParams: import("zod").ZodObject<{
|
|
901
|
+
firstName: import("zod").ZodString;
|
|
902
|
+
lastName: import("zod").ZodString;
|
|
903
|
+
gender: import("zod").ZodEnum<["m", "f"]>;
|
|
904
|
+
identificationNumber: import("zod").ZodString;
|
|
905
|
+
birthdate: import("zod").ZodDate;
|
|
906
|
+
email: import("zod").ZodString;
|
|
907
|
+
plan: import("zod").ZodString;
|
|
908
|
+
startDate: import("zod").ZodDate;
|
|
909
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
910
|
+
firstName: string;
|
|
911
|
+
lastName: string;
|
|
912
|
+
birthdate: Date;
|
|
913
|
+
gender: "m" | "f";
|
|
914
|
+
email: string;
|
|
915
|
+
startDate: Date;
|
|
916
|
+
identificationNumber: string;
|
|
917
|
+
plan: string;
|
|
918
|
+
}, {
|
|
919
|
+
firstName: string;
|
|
920
|
+
lastName: string;
|
|
921
|
+
birthdate: Date;
|
|
922
|
+
gender: "m" | "f";
|
|
923
|
+
email: string;
|
|
924
|
+
startDate: Date;
|
|
925
|
+
identificationNumber: string;
|
|
926
|
+
plan: string;
|
|
927
|
+
}>;
|
|
900
928
|
};
|
package/lib/schemas.js
CHANGED
|
@@ -37,7 +37,7 @@ const availableAppointment = zod_1.object({
|
|
|
37
37
|
type: specialtyMode,
|
|
38
38
|
atentions: zod_1.number(),
|
|
39
39
|
ranking: zod_1.unknown(),
|
|
40
|
-
length: zod_1.number().
|
|
40
|
+
length: zod_1.number().nullish(),
|
|
41
41
|
});
|
|
42
42
|
const appointment = zod_1.object({
|
|
43
43
|
id: zod_1.number(),
|
|
@@ -114,6 +114,16 @@ const chatPost = zod_1.object({
|
|
|
114
114
|
message: zod_1.string(),
|
|
115
115
|
date: zod_1.date(),
|
|
116
116
|
});
|
|
117
|
+
const enrollmentParams = zod_1.object({
|
|
118
|
+
firstName: zod_1.string(),
|
|
119
|
+
lastName: zod_1.string(),
|
|
120
|
+
gender: gender,
|
|
121
|
+
identificationNumber: zod_1.string(),
|
|
122
|
+
birthdate: zod_1.date(),
|
|
123
|
+
email: zod_1.string().email(),
|
|
124
|
+
plan: zod_1.string(),
|
|
125
|
+
startDate: zod_1.date(),
|
|
126
|
+
});
|
|
117
127
|
exports.doc24Schemas = {
|
|
118
128
|
identificationType,
|
|
119
129
|
sdkCredentials,
|
|
@@ -205,7 +215,7 @@ exports.doc24Schemas = {
|
|
|
205
215
|
birthdate: zod_1.date(),
|
|
206
216
|
gender,
|
|
207
217
|
email: zod_1.string(),
|
|
208
|
-
phone: zod_1.string(),
|
|
218
|
+
phone: zod_1.string().nullable(),
|
|
209
219
|
logoUrl: zod_1.string(),
|
|
210
220
|
matriculation: zod_1.array(zod_1.object({ number: zod_1.string(), type: zod_1.string() })),
|
|
211
221
|
specialties: zod_1.array(specialty),
|
|
@@ -222,4 +232,5 @@ exports.doc24Schemas = {
|
|
|
222
232
|
availableChatroom,
|
|
223
233
|
chatDetails,
|
|
224
234
|
chatPost,
|
|
235
|
+
enrollmentParams,
|
|
225
236
|
};
|
package/lib/types.d.ts
CHANGED
|
@@ -23,11 +23,13 @@ export declare namespace Doc24 {
|
|
|
23
23
|
type ChatParameters = TypeOf<typeof doc24Schemas.chatParameters>;
|
|
24
24
|
type ChatDetails = TypeOf<typeof doc24Schemas.chatDetails>;
|
|
25
25
|
type ChatPost = TypeOf<typeof doc24Schemas.chatPost>;
|
|
26
|
+
type EnrollmentParams = TypeOf<typeof doc24Schemas.enrollmentParams>;
|
|
26
27
|
type BaseSdk = {
|
|
27
28
|
declareUser: (user: User) => Promise<number>;
|
|
28
29
|
getUserInstance: (user: User | number) => Promise<UserSdk>;
|
|
29
30
|
getProfessional: (professionalId: number) => Promise<Professional>;
|
|
30
31
|
getAvailableScheduleClinics: () => Promise<AvailableScheduleClinics>;
|
|
32
|
+
enroll: (params: EnrollmentParams) => Promise<void>;
|
|
31
33
|
};
|
|
32
34
|
type UserSdk = {
|
|
33
35
|
declarePatient: (patient: Patient) => Promise<number>;
|
|
@@ -9,9 +9,9 @@ export declare const getScheduleMethods: (makeRequest: RequestMaker) => {
|
|
|
9
9
|
startHour?: string | undefined;
|
|
10
10
|
finishHour?: string | undefined;
|
|
11
11
|
} | undefined) => Promise<{
|
|
12
|
+
length?: number | null | undefined;
|
|
12
13
|
ranking?: unknown;
|
|
13
14
|
date: Date;
|
|
14
|
-
length: number | null;
|
|
15
15
|
type: "appointment" | "chat" | "instant";
|
|
16
16
|
id: string | number;
|
|
17
17
|
professional: {
|