@integraciones_doc24/sdk 1.4.0 → 1.4.1
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/user.d.ts +5 -3
- package/lib/baseSdk/user.js +5 -4
- package/lib/index.d.ts +5 -3
- package/lib/schemas.d.ts +39 -28
- package/lib/schemas.js +16 -4
- package/lib/userSdk/patients.d.ts +5 -3
- package/lib/userSdk/patients.js +7 -6
- package/package.json +1 -1
package/lib/baseSdk/user.d.ts
CHANGED
|
@@ -17,12 +17,14 @@ export declare const getUserMethods: (makeRequest: RequestMaker, url: string, cr
|
|
|
17
17
|
code?: string | undefined;
|
|
18
18
|
channel?: "1" | "2" | undefined;
|
|
19
19
|
}) => Promise<{
|
|
20
|
-
|
|
20
|
+
askCode: true;
|
|
21
21
|
userInfo: {
|
|
22
22
|
phone: string;
|
|
23
23
|
email: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
24
|
+
};
|
|
25
|
+
} | {
|
|
26
|
+
patientId: number | null;
|
|
27
|
+
askCode: false;
|
|
26
28
|
userId: number;
|
|
27
29
|
}>;
|
|
28
30
|
getUserId: (user: {
|
package/lib/baseSdk/user.js
CHANGED
|
@@ -27,13 +27,14 @@ const getUserMethods = (makeRequest, url, credentials) => {
|
|
|
27
27
|
channel: parsedChannel,
|
|
28
28
|
code,
|
|
29
29
|
});
|
|
30
|
-
const
|
|
30
|
+
const data = response.data;
|
|
31
|
+
if (data.ask_code)
|
|
32
|
+
return { askCode: true, userInfo: data.user_info };
|
|
33
|
+
return {
|
|
34
|
+
askCode: false,
|
|
31
35
|
userId: response.data.user_id,
|
|
32
36
|
patientId: response.data.patient_id,
|
|
33
|
-
userInfo: response.data.user_info,
|
|
34
|
-
askCode: response.data.ask_code,
|
|
35
37
|
};
|
|
36
|
-
return mappedResponse;
|
|
37
38
|
};
|
|
38
39
|
const getUserId = async (user) => {
|
|
39
40
|
const path = '/search-user';
|
package/lib/index.d.ts
CHANGED
|
@@ -21,12 +21,14 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
|
|
|
21
21
|
code?: string | undefined;
|
|
22
22
|
channel?: "1" | "2" | undefined;
|
|
23
23
|
}) => Promise<{
|
|
24
|
-
|
|
24
|
+
askCode: true;
|
|
25
25
|
userInfo: {
|
|
26
26
|
phone: string;
|
|
27
27
|
email: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
28
|
+
};
|
|
29
|
+
} | {
|
|
30
|
+
patientId: number | null;
|
|
31
|
+
askCode: false;
|
|
30
32
|
userId: number;
|
|
31
33
|
}>;
|
|
32
34
|
getUserId: (user: {
|
package/lib/schemas.d.ts
CHANGED
|
@@ -1192,9 +1192,8 @@ export declare const doc24Schemas: {
|
|
|
1192
1192
|
code?: string | undefined;
|
|
1193
1193
|
channel?: "1" | "2" | undefined;
|
|
1194
1194
|
}>>;
|
|
1195
|
-
declareUserResponse: import("zod").
|
|
1196
|
-
|
|
1197
|
-
userInfo: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
1195
|
+
declareUserResponse: import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
1196
|
+
userInfo: import("zod").ZodObject<{
|
|
1198
1197
|
email: import("zod").ZodString;
|
|
1199
1198
|
phone: import("zod").ZodString;
|
|
1200
1199
|
}, "strip", import("zod").ZodTypeAny, {
|
|
@@ -1203,27 +1202,33 @@ export declare const doc24Schemas: {
|
|
|
1203
1202
|
}, {
|
|
1204
1203
|
phone: string;
|
|
1205
1204
|
email: string;
|
|
1206
|
-
}
|
|
1207
|
-
askCode: import("zod").
|
|
1208
|
-
}, {
|
|
1209
|
-
|
|
1210
|
-
}>, "strip", import("zod").ZodTypeAny, {
|
|
1211
|
-
patientId: number | null;
|
|
1205
|
+
}>;
|
|
1206
|
+
askCode: import("zod").ZodLiteral<true>;
|
|
1207
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
1208
|
+
askCode: true;
|
|
1212
1209
|
userInfo: {
|
|
1213
1210
|
phone: string;
|
|
1214
1211
|
email: string;
|
|
1215
|
-
}
|
|
1216
|
-
askCode: boolean;
|
|
1217
|
-
userId: number;
|
|
1212
|
+
};
|
|
1218
1213
|
}, {
|
|
1219
|
-
|
|
1214
|
+
askCode: true;
|
|
1220
1215
|
userInfo: {
|
|
1221
1216
|
phone: string;
|
|
1222
1217
|
email: string;
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1218
|
+
};
|
|
1219
|
+
}>, import("zod").ZodObject<{
|
|
1220
|
+
askCode: import("zod").ZodLiteral<false>;
|
|
1221
|
+
patientId: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
1222
|
+
userId: import("zod").ZodNumber;
|
|
1223
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
1224
|
+
patientId: number | null;
|
|
1225
|
+
askCode: false;
|
|
1225
1226
|
userId: number;
|
|
1226
|
-
}
|
|
1227
|
+
}, {
|
|
1228
|
+
patientId: number | null;
|
|
1229
|
+
askCode: false;
|
|
1230
|
+
userId: number;
|
|
1231
|
+
}>]>;
|
|
1227
1232
|
declarePatientParams: import("zod").ZodIntersection<import("zod").ZodObject<{
|
|
1228
1233
|
patient: import("zod").ZodObject<{
|
|
1229
1234
|
firstName: import("zod").ZodString;
|
|
@@ -1280,9 +1285,8 @@ export declare const doc24Schemas: {
|
|
|
1280
1285
|
code?: string | undefined;
|
|
1281
1286
|
channel?: "1" | "2" | undefined;
|
|
1282
1287
|
}>>;
|
|
1283
|
-
declarePatientResponse: import("zod").ZodObject<{
|
|
1284
|
-
|
|
1285
|
-
userInfo: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
1288
|
+
declarePatientResponse: import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
1289
|
+
userInfo: import("zod").ZodObject<{
|
|
1286
1290
|
email: import("zod").ZodString;
|
|
1287
1291
|
phone: import("zod").ZodString;
|
|
1288
1292
|
}, "strip", import("zod").ZodTypeAny, {
|
|
@@ -1291,23 +1295,30 @@ export declare const doc24Schemas: {
|
|
|
1291
1295
|
}, {
|
|
1292
1296
|
phone: string;
|
|
1293
1297
|
email: string;
|
|
1294
|
-
}
|
|
1295
|
-
askCode: import("zod").
|
|
1298
|
+
}>;
|
|
1299
|
+
askCode: import("zod").ZodLiteral<true>;
|
|
1296
1300
|
}, "strip", import("zod").ZodTypeAny, {
|
|
1297
|
-
|
|
1301
|
+
askCode: true;
|
|
1298
1302
|
userInfo: {
|
|
1299
1303
|
phone: string;
|
|
1300
1304
|
email: string;
|
|
1301
|
-
}
|
|
1302
|
-
askCode: boolean;
|
|
1305
|
+
};
|
|
1303
1306
|
}, {
|
|
1304
|
-
|
|
1307
|
+
askCode: true;
|
|
1305
1308
|
userInfo: {
|
|
1306
1309
|
phone: string;
|
|
1307
1310
|
email: string;
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
+
};
|
|
1312
|
+
}>, import("zod").ZodObject<{
|
|
1313
|
+
askCode: import("zod").ZodLiteral<false>;
|
|
1314
|
+
patientId: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
1315
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
1316
|
+
patientId: number | null;
|
|
1317
|
+
askCode: false;
|
|
1318
|
+
}, {
|
|
1319
|
+
patientId: number | null;
|
|
1320
|
+
askCode: false;
|
|
1321
|
+
}>]>;
|
|
1311
1322
|
verificationParams: import("zod").ZodObject<{
|
|
1312
1323
|
channel: import("zod").ZodOptional<import("zod").ZodEnum<["1", "2"]>>;
|
|
1313
1324
|
code: import("zod").ZodOptional<import("zod").ZodString>;
|
package/lib/schemas.js
CHANGED
|
@@ -190,14 +190,26 @@ const declarePatientParams = zod_1.object({
|
|
|
190
190
|
patient,
|
|
191
191
|
}).and(verificationParams);
|
|
192
192
|
const declarePatientResponse = zod_1.object({
|
|
193
|
+
userInfo: zod_1.object({
|
|
194
|
+
email: zod_1.string(),
|
|
195
|
+
phone: zod_1.string(),
|
|
196
|
+
}),
|
|
197
|
+
askCode: zod_1.literal(true),
|
|
198
|
+
}).or(zod_1.object({
|
|
199
|
+
askCode: zod_1.literal(false),
|
|
193
200
|
patientId: zod_1.number().nullable(),
|
|
201
|
+
}));
|
|
202
|
+
const declareUserResponse = zod_1.object({
|
|
194
203
|
userInfo: zod_1.object({
|
|
195
204
|
email: zod_1.string(),
|
|
196
205
|
phone: zod_1.string(),
|
|
197
|
-
})
|
|
198
|
-
askCode: zod_1.
|
|
199
|
-
})
|
|
200
|
-
|
|
206
|
+
}),
|
|
207
|
+
askCode: zod_1.literal(true),
|
|
208
|
+
}).or(zod_1.object({
|
|
209
|
+
askCode: zod_1.literal(false),
|
|
210
|
+
patientId: zod_1.number().nullable(),
|
|
211
|
+
userId: zod_1.number(),
|
|
212
|
+
}));
|
|
201
213
|
exports.doc24Schemas = {
|
|
202
214
|
identificationType,
|
|
203
215
|
sdkCredentials,
|
|
@@ -14,12 +14,14 @@ export declare const getPatientMethods: (makeRequest: RequestMaker) => {
|
|
|
14
14
|
code?: string | undefined;
|
|
15
15
|
channel?: "1" | "2" | undefined;
|
|
16
16
|
}) => Promise<{
|
|
17
|
-
|
|
17
|
+
askCode: true;
|
|
18
18
|
userInfo: {
|
|
19
19
|
phone: string;
|
|
20
20
|
email: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
21
|
+
};
|
|
22
|
+
} | {
|
|
23
|
+
patientId: number | null;
|
|
24
|
+
askCode: false;
|
|
23
25
|
}>;
|
|
24
26
|
getPatientId: (patient: {
|
|
25
27
|
firstName: string;
|
package/lib/userSdk/patients.js
CHANGED
|
@@ -24,12 +24,13 @@ const getPatientMethods = (makeRequest) => {
|
|
|
24
24
|
channel: parsedChannel,
|
|
25
25
|
code,
|
|
26
26
|
});
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
const data = response.data;
|
|
28
|
+
if (data.ask_code)
|
|
29
|
+
return {
|
|
30
|
+
userInfo: data.user_info,
|
|
31
|
+
askCode: true,
|
|
32
|
+
};
|
|
33
|
+
return { askCode: false, patientId: data.patient_id };
|
|
33
34
|
};
|
|
34
35
|
const getPatientId = async (patient) => {
|
|
35
36
|
const path = '/search-patient';
|