@integraciones_doc24/sdk 1.15.19 → 1.16.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/README.md +203 -202
- package/lib/baseSdk/diagnostica.d.ts +54 -54
- package/lib/baseSdk/diagnostica.js +82 -82
- package/lib/baseSdk/external.d.ts +177 -177
- package/lib/baseSdk/external.js +96 -96
- package/lib/baseSdk/index.d.ts +2 -2
- package/lib/baseSdk/index.js +74 -76
- package/lib/baseSdk/user.d.ts +91 -91
- package/lib/baseSdk/user.js +136 -136
- package/lib/index.d.ts +365 -367
- package/lib/index.js +22 -22
- package/lib/request/index.d.ts +3 -3
- package/lib/request/index.js +26 -26
- package/lib/request/token.d.ts +2 -2
- package/lib/request/token.js +34 -34
- package/lib/request/validation.d.ts +10 -10
- package/lib/request/validation.js +28 -28
- package/lib/schemas.d.ts +1816 -1878
- package/lib/schemas.js +420 -444
- package/lib/types.d.ts +146 -149
- package/lib/types.js +2 -2
- package/lib/userSdk/chat.d.ts +57 -57
- package/lib/userSdk/chat.js +98 -98
- package/lib/userSdk/external.d.ts +34 -34
- package/lib/userSdk/external.js +72 -72
- package/lib/userSdk/index.d.ts +2 -2
- package/lib/userSdk/index.js +30 -30
- package/lib/userSdk/patients.d.ts +38 -38
- package/lib/userSdk/patients.js +67 -67
- package/lib/userSdk/schedule.d.ts +47 -49
- package/lib/userSdk/schedule.js +81 -83
- package/lib/userSdk/specialties.d.ts +7 -16
- package/lib/userSdk/specialties.js +19 -45
- package/lib/userSdk/videoVisit.d.ts +113 -115
- package/lib/userSdk/videoVisit.js +154 -155
- package/lib/utils.d.ts +2 -2
- package/lib/utils.js +16 -16
- package/lib/webhook/index.d.ts +2 -2
- package/lib/webhook/index.js +56 -56
- package/lib/webhook/responses.d.ts +35 -35
- package/lib/webhook/responses.js +42 -42
- package/lib/webhook/token.d.ts +2 -2
- package/lib/webhook/token.js +23 -23
- package/package.json +36 -36
package/lib/webhook/token.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getWebhookToken = void 0;
|
|
7
|
-
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
8
|
-
const getWebhookToken = async (request, credentials) => {
|
|
9
|
-
if (request.headers.authentication === undefined)
|
|
10
|
-
return;
|
|
11
|
-
const decoded = await decodeJwt(request.headers.authentication, credentials.key);
|
|
12
|
-
if (!decoded || decoded.iss !== credentials.iss)
|
|
13
|
-
return;
|
|
14
|
-
return decoded;
|
|
15
|
-
};
|
|
16
|
-
exports.getWebhookToken = getWebhookToken;
|
|
17
|
-
const decodeJwt = (token, key) => new Promise((resolve, reject) => {
|
|
18
|
-
jsonwebtoken_1.default.verify(token, key, (err, result) => {
|
|
19
|
-
if (!result || err)
|
|
20
|
-
return reject(err);
|
|
21
|
-
resolve(result);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getWebhookToken = void 0;
|
|
7
|
+
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
8
|
+
const getWebhookToken = async (request, credentials) => {
|
|
9
|
+
if (request.headers.authentication === undefined)
|
|
10
|
+
return;
|
|
11
|
+
const decoded = await decodeJwt(request.headers.authentication, credentials.key);
|
|
12
|
+
if (!decoded || decoded.iss !== credentials.iss)
|
|
13
|
+
return;
|
|
14
|
+
return decoded;
|
|
15
|
+
};
|
|
16
|
+
exports.getWebhookToken = getWebhookToken;
|
|
17
|
+
const decodeJwt = (token, key) => new Promise((resolve, reject) => {
|
|
18
|
+
jsonwebtoken_1.default.verify(token, key, (err, result) => {
|
|
19
|
+
if (!result || err)
|
|
20
|
+
return reject(err);
|
|
21
|
+
resolve(result);
|
|
22
|
+
});
|
|
23
|
+
});
|
package/package.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@integraciones_doc24/sdk",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"publishConfig": {
|
|
5
|
-
"tag": "latest"
|
|
6
|
-
},
|
|
7
|
-
"description": "",
|
|
8
|
-
"main": "lib/index.js",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"build": "tsc",
|
|
11
|
-
"prepublish": "npm run build",
|
|
12
|
-
"test": "npx tsx test"
|
|
13
|
-
},
|
|
14
|
-
"keywords": [],
|
|
15
|
-
"author": "",
|
|
16
|
-
"license": "ISC",
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"axios": "^0.21.0",
|
|
19
|
-
"date-fns": "^2.16.1",
|
|
20
|
-
"jsonwebtoken": "^8.5.1",
|
|
21
|
-
"zod": "^3.8.1"
|
|
22
|
-
},
|
|
23
|
-
"devDependencies": {
|
|
24
|
-
"@types/debug": "^4.1.7",
|
|
25
|
-
"@types/jsonwebtoken": "^8.5.0",
|
|
26
|
-
"typescript": "^4.1.3",
|
|
27
|
-
"debug": "^4.3.4"
|
|
28
|
-
},
|
|
29
|
-
"peerDependencies": {
|
|
30
|
-
"debug": "*"
|
|
31
|
-
},
|
|
32
|
-
"types": "lib/index.d.ts",
|
|
33
|
-
"files": [
|
|
34
|
-
"lib"
|
|
35
|
-
]
|
|
36
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@integraciones_doc24/sdk",
|
|
3
|
+
"version": "1.16.1",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"tag": "latest"
|
|
6
|
+
},
|
|
7
|
+
"description": "",
|
|
8
|
+
"main": "lib/index.js",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"prepublish": "npm run build",
|
|
12
|
+
"test": "npx tsx test"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [],
|
|
15
|
+
"author": "",
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"axios": "^0.21.0",
|
|
19
|
+
"date-fns": "^2.16.1",
|
|
20
|
+
"jsonwebtoken": "^8.5.1",
|
|
21
|
+
"zod": "^3.8.1"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/debug": "^4.1.7",
|
|
25
|
+
"@types/jsonwebtoken": "^8.5.0",
|
|
26
|
+
"typescript": "^4.1.3",
|
|
27
|
+
"debug": "^4.3.4"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"debug": "*"
|
|
31
|
+
},
|
|
32
|
+
"types": "lib/index.d.ts",
|
|
33
|
+
"files": [
|
|
34
|
+
"lib"
|
|
35
|
+
]
|
|
36
|
+
}
|