@integraciones_doc24/sdk 0.39.4 → 0.39.5

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.
Files changed (44) hide show
  1. package/README.md +93 -83
  2. package/package.json +1 -1
  3. package/lib/baseSdk/diagnostica.d.ts +0 -54
  4. package/lib/baseSdk/diagnostica.js +0 -79
  5. package/lib/baseSdk/external.d.ts +0 -177
  6. package/lib/baseSdk/external.js +0 -96
  7. package/lib/baseSdk/index.d.ts +0 -2
  8. package/lib/baseSdk/index.js +0 -70
  9. package/lib/baseSdk/user.d.ts +0 -41
  10. package/lib/baseSdk/user.js +0 -88
  11. package/lib/index.d.ts +0 -159
  12. package/lib/index.js +0 -22
  13. package/lib/request/index.d.ts +0 -3
  14. package/lib/request/index.js +0 -26
  15. package/lib/request/token.d.ts +0 -2
  16. package/lib/request/token.js +0 -34
  17. package/lib/request/validation.d.ts +0 -10
  18. package/lib/request/validation.js +0 -28
  19. package/lib/schemas.d.ts +0 -1125
  20. package/lib/schemas.js +0 -307
  21. package/lib/types.d.ts +0 -118
  22. package/lib/types.js +0 -2
  23. package/lib/userSdk/chat.d.ts +0 -57
  24. package/lib/userSdk/chat.js +0 -98
  25. package/lib/userSdk/external.d.ts +0 -34
  26. package/lib/userSdk/external.js +0 -71
  27. package/lib/userSdk/index.d.ts +0 -2
  28. package/lib/userSdk/index.js +0 -27
  29. package/lib/userSdk/patients.d.ts +0 -24
  30. package/lib/userSdk/patients.js +0 -46
  31. package/lib/userSdk/schedule.d.ts +0 -44
  32. package/lib/userSdk/schedule.js +0 -76
  33. package/lib/userSdk/specialties.d.ts +0 -7
  34. package/lib/userSdk/specialties.js +0 -19
  35. package/lib/userSdk/videoVisit.d.ts +0 -111
  36. package/lib/userSdk/videoVisit.js +0 -147
  37. package/lib/utils.d.ts +0 -4
  38. package/lib/utils.js +0 -27
  39. package/lib/webhook/index.d.ts +0 -2
  40. package/lib/webhook/index.js +0 -55
  41. package/lib/webhook/responses.d.ts +0 -35
  42. package/lib/webhook/responses.js +0 -42
  43. package/lib/webhook/token.d.ts +0 -2
  44. package/lib/webhook/token.js +0 -23
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.successResponse = exports.unexpectedErrorResponse = exports.unauthorizedErrorResponse = exports.notFoundErrorResponse = void 0;
4
- const notFoundErrorResponse = () => ({
5
- status: {
6
- code: 404,
7
- message: 'Not Found',
8
- },
9
- data: {
10
- error: 'not_found',
11
- },
12
- });
13
- exports.notFoundErrorResponse = notFoundErrorResponse;
14
- const unauthorizedErrorResponse = () => ({
15
- status: {
16
- code: 401,
17
- message: 'Unauthorized',
18
- },
19
- data: {
20
- error: 'unauthorized',
21
- },
22
- });
23
- exports.unauthorizedErrorResponse = unauthorizedErrorResponse;
24
- const unexpectedErrorResponse = (details) => ({
25
- status: {
26
- code: 500,
27
- message: 'Unhandled Error',
28
- },
29
- data: {
30
- error: 'unhandled_error',
31
- details,
32
- },
33
- });
34
- exports.unexpectedErrorResponse = unexpectedErrorResponse;
35
- const successResponse = (data) => ({
36
- status: {
37
- code: 200,
38
- message: 'Success',
39
- },
40
- data,
41
- });
42
- exports.successResponse = successResponse;
@@ -1,2 +0,0 @@
1
- import { Doc24 } from '../types';
2
- export declare const getWebhookToken: (request: Doc24.Webhook.Request, credentials: Doc24.SdkCredentials) => Promise<Record<string, unknown> | undefined>;
@@ -1,23 +0,0 @@
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
- });