@natyapp/meta 1.3.0 → 1.4.0

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 (117) hide show
  1. package/dist/Entities/Logs.d.ts +16 -16
  2. package/dist/Entities/Logs.js +13 -13
  3. package/dist/Entities/connection.d.ts +15 -15
  4. package/dist/Entities/connection.js +13 -13
  5. package/dist/Entities/errorLogs.d.ts +9 -9
  6. package/dist/Entities/errorLogs.js +13 -13
  7. package/dist/Entities/index.d.ts +5 -5
  8. package/dist/Entities/index.js +21 -21
  9. package/dist/Entities/messages.d.ts +9 -9
  10. package/dist/Entities/messages.js +13 -13
  11. package/dist/Entities/webhooks.d.ts +17 -17
  12. package/dist/Entities/webhooks.js +13 -13
  13. package/dist/Entities/whatsappMessage.d.ts +63 -63
  14. package/dist/Entities/whatsappMessage.js +9 -9
  15. package/dist/Errors/Either.d.ts +15 -15
  16. package/dist/Errors/Either.js +37 -37
  17. package/dist/Errors/ErrorHandling.d.ts +10 -10
  18. package/dist/Errors/ErrorHandling.js +15 -15
  19. package/dist/Errors/index.d.ts +2 -2
  20. package/dist/Errors/index.js +18 -18
  21. package/dist/configs/axiosInterceptors.d.ts +7 -7
  22. package/dist/configs/axiosInterceptors.js +10 -10
  23. package/dist/elements/button.d.ts +18 -18
  24. package/dist/elements/button.js +11 -11
  25. package/dist/elements/image.d.ts +9 -9
  26. package/dist/elements/image.js +12 -12
  27. package/dist/elements/index.d.ts +3 -3
  28. package/dist/elements/index.js +19 -19
  29. package/dist/elements/list.d.ts +78 -78
  30. package/dist/elements/list.js +55 -55
  31. package/dist/elements/text.d.ts +12 -12
  32. package/dist/elements/text.js +13 -13
  33. package/dist/index.d.ts +8 -8
  34. package/dist/index.js +44 -44
  35. package/dist/interfaces/IConnection.d.ts +13 -13
  36. package/dist/interfaces/IConnection.js +2 -2
  37. package/dist/interfaces/IEventsMessage.d.ts +2 -2
  38. package/dist/interfaces/IEventsMessage.js +2 -2
  39. package/dist/interfaces/ILog.d.ts +10 -10
  40. package/dist/interfaces/ILog.js +2 -2
  41. package/dist/interfaces/IMessage.d.ts +22 -22
  42. package/dist/interfaces/IMessage.js +2 -2
  43. package/dist/interfaces/ISdk.d.ts +16 -16
  44. package/dist/interfaces/ISdk.js +2 -2
  45. package/dist/interfaces/IWebhook.d.ts +14 -14
  46. package/dist/interfaces/IWebhook.js +2 -2
  47. package/dist/interfaces/index.d.ts +5 -5
  48. package/dist/interfaces/index.js +21 -21
  49. package/dist/queue/messageQueue.d.ts +11 -11
  50. package/dist/queue/messageQueue.js +20 -20
  51. package/dist/routes/index.d.ts +3 -3
  52. package/dist/routes/index.js +11 -11
  53. package/dist/routes/webhooks/index.d.ts +3 -3
  54. package/dist/routes/webhooks/index.js +13 -13
  55. package/dist/routes/webhooks/methods/connection.d.ts +3 -3
  56. package/dist/routes/webhooks/methods/connection.js +42 -41
  57. package/dist/routes/webhooks/methods/messages.d.ts +3 -3
  58. package/dist/routes/webhooks/methods/messages.js +21 -21
  59. package/dist/services/axiosInstances.d.ts +18 -18
  60. package/dist/services/axiosInstances.js +45 -45
  61. package/dist/services/index.d.ts +3 -3
  62. package/dist/services/index.js +19 -19
  63. package/dist/services/middlewares/index.d.ts +1 -1
  64. package/dist/services/middlewares/index.js +5 -5
  65. package/dist/services/middlewares/validations.d.ts +4 -4
  66. package/dist/services/middlewares/validations.js +8 -8
  67. package/dist/services/mutations/connection.d.ts +2 -2
  68. package/dist/services/mutations/connection.js +49 -49
  69. package/dist/services/mutations/index.d.ts +3 -3
  70. package/dist/services/mutations/index.js +19 -19
  71. package/dist/services/mutations/logs.d.ts +2 -2
  72. package/dist/services/mutations/logs.js +25 -25
  73. package/dist/services/mutations/messages.d.ts +2 -2
  74. package/dist/services/mutations/messages.js +25 -25
  75. package/dist/services/mutations/validation.d.ts +5 -5
  76. package/dist/services/mutations/validation.js +15 -15
  77. package/dist/services/mutations/webhooks.d.ts +2 -2
  78. package/dist/services/mutations/webhooks.js +49 -49
  79. package/dist/types/index.d.ts +3 -3
  80. package/dist/types/index.js +19 -19
  81. package/dist/types/logs.d.ts +5 -5
  82. package/dist/types/logs.js +2 -2
  83. package/dist/types/requestTypes.d.ts +11 -11
  84. package/dist/types/requestTypes.js +2 -2
  85. package/dist/types/whatsappTypes.d.ts +68 -68
  86. package/dist/types/whatsappTypes.js +2 -2
  87. package/dist/ui/Button.d.ts +27 -27
  88. package/dist/ui/Button.js +95 -95
  89. package/dist/useCases/cadastroIncorporado/cadastroIncorporado.d.ts +1 -1
  90. package/dist/useCases/cadastroIncorporado/cadastroIncorporado.js +7 -7
  91. package/dist/useCases/connection/index.d.ts +15 -15
  92. package/dist/useCases/connection/index.js +16 -16
  93. package/dist/useCases/events/NatyEvents.d.ts +35 -35
  94. package/dist/useCases/events/NatyEvents.js +13 -13
  95. package/dist/useCases/index.d.ts +6 -6
  96. package/dist/useCases/index.js +16 -16
  97. package/dist/useCases/log/index.d.ts +10 -10
  98. package/dist/useCases/log/index.js +12 -12
  99. package/dist/useCases/message/index.d.ts +9 -9
  100. package/dist/useCases/message/index.js +6 -6
  101. package/dist/useCases/message/whatsappResponse.d.ts +62 -62
  102. package/dist/useCases/message/whatsappResponse.js +405 -404
  103. package/dist/useCases/messages/index.d.ts +10 -10
  104. package/dist/useCases/messages/index.js +12 -12
  105. package/dist/useCases/sdk/index.d.ts +19 -19
  106. package/dist/useCases/sdk/index.js +48 -48
  107. package/dist/useCases/webhook/index.d.ts +15 -15
  108. package/dist/useCases/webhook/index.js +16 -16
  109. package/dist/utils/constants.d.ts +11 -11
  110. package/dist/utils/constants.js +17 -17
  111. package/dist/utils/genUuid.d.ts +1 -1
  112. package/dist/utils/genUuid.js +16 -16
  113. package/dist/utils/index.d.ts +1 -1
  114. package/dist/utils/index.js +17 -17
  115. package/dist/utils/tryCatch.d.ts +1 -1
  116. package/dist/utils/tryCatch.js +19 -19
  117. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./logs"), exports);
18
- __exportStar(require("./requestTypes"), exports);
19
- __exportStar(require("./whatsappTypes"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./logs"), exports);
18
+ __exportStar(require("./requestTypes"), exports);
19
+ __exportStar(require("./whatsappTypes"), exports);
@@ -1,5 +1,5 @@
1
- import { LogsEntity } from "../Entities/Logs";
2
- export type typeLog = "Error" | "Access" | "Update" | "Observer" | "Middleware";
3
- export type dataLogs = Partial<LogsEntity> & {
4
- type: typeLog;
5
- };
1
+ import { LogsEntity } from "../Entities/Logs";
2
+ export type typeLog = "Error" | "Access" | "Update" | "Observer" | "Middleware";
3
+ export type dataLogs = Partial<LogsEntity> & {
4
+ type: typeLog;
5
+ };
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +1,11 @@
1
- export type getAllProps = {
2
- page?: number;
3
- size?: number;
4
- filter?: filterProps;
5
- };
6
- export type filterProps = {
7
- key?: string;
8
- value?: any;
9
- fields?: string;
10
- };
11
- export type getAllReturn<t> = t[];
1
+ export type getAllProps = {
2
+ page?: number;
3
+ size?: number;
4
+ filter?: filterProps;
5
+ };
6
+ export type filterProps = {
7
+ key?: string;
8
+ value?: any;
9
+ fields?: string;
10
+ };
11
+ export type getAllReturn<t> = t[];
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,68 +1,68 @@
1
- export type contactType = {
2
- addresses?: {
3
- street?: string;
4
- city?: string;
5
- state?: string;
6
- zip?: string;
7
- country?: string;
8
- country_code?: string;
9
- type?: string;
10
- }[];
11
- birthday?: string;
12
- emails?: {
13
- email: string;
14
- type: string;
15
- }[];
16
- name: {
17
- formatted_name?: string;
18
- first_name: string;
19
- last_name?: string;
20
- middle_name?: string;
21
- suffix?: string;
22
- prefix?: string;
23
- };
24
- org?: {
25
- company: string;
26
- department: string;
27
- title: string;
28
- };
29
- phones: {
30
- phone: string;
31
- type: string;
32
- wa_id?: string;
33
- }[];
34
- urls?: {
35
- url: string;
36
- type: string;
37
- }[];
38
- };
39
- export type flowMessageType = {
40
- type: "flow";
41
- header: {
42
- type: "text";
43
- text: string;
44
- };
45
- body: {
46
- text: string;
47
- };
48
- footer: {
49
- text: string;
50
- };
51
- action: {
52
- name: string;
53
- parameters: {
54
- flow_message_version: "3";
55
- flow_token: "AQAAAAACS5FpgQ_cAAAAAD0QI3s";
56
- flow_id: string;
57
- flow_cta: string;
58
- flow_action: "navigate";
59
- flow_action_payload: {
60
- screen: string;
61
- data: {
62
- user_name: string;
63
- user_age: number;
64
- };
65
- };
66
- };
67
- };
68
- };
1
+ export type contactType = {
2
+ addresses?: {
3
+ street?: string;
4
+ city?: string;
5
+ state?: string;
6
+ zip?: string;
7
+ country?: string;
8
+ country_code?: string;
9
+ type?: string;
10
+ }[];
11
+ birthday?: string;
12
+ emails?: {
13
+ email: string;
14
+ type: string;
15
+ }[];
16
+ name: {
17
+ formatted_name?: string;
18
+ first_name: string;
19
+ last_name?: string;
20
+ middle_name?: string;
21
+ suffix?: string;
22
+ prefix?: string;
23
+ };
24
+ org?: {
25
+ company: string;
26
+ department: string;
27
+ title: string;
28
+ };
29
+ phones: {
30
+ phone: string;
31
+ type: string;
32
+ wa_id?: string;
33
+ }[];
34
+ urls?: {
35
+ url: string;
36
+ type: string;
37
+ }[];
38
+ };
39
+ export type flowMessageType = {
40
+ type: "flow";
41
+ header: {
42
+ type: "text";
43
+ text: string;
44
+ };
45
+ body: {
46
+ text: string;
47
+ };
48
+ footer: {
49
+ text: string;
50
+ };
51
+ action: {
52
+ name: string;
53
+ parameters: {
54
+ flow_message_version: "3";
55
+ flow_token: "AQAAAAACS5FpgQ_cAAAAAD0QI3s";
56
+ flow_id: string;
57
+ flow_cta: string;
58
+ flow_action: "navigate";
59
+ flow_action_payload: {
60
+ screen: string;
61
+ data: {
62
+ user_name: string;
63
+ user_age: number;
64
+ };
65
+ };
66
+ };
67
+ };
68
+ };
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,27 +1,27 @@
1
- import React from "react";
2
- export declare const Button: ({ userData: {}, style, children, }: React.PropsWithChildren<{
3
- userData: {
4
- business?: {
5
- name: string;
6
- email: string;
7
- phone: {
8
- code: number;
9
- number: string;
10
- };
11
- address: {
12
- streetAddress1: string;
13
- city: string;
14
- state: string;
15
- zipPostal: string;
16
- country: string;
17
- };
18
- };
19
- };
20
- style: React.CSSProperties;
21
- }>) => React.JSX.Element;
22
- declare global {
23
- interface Window {
24
- FB: any;
25
- fbAsyncInit: any;
26
- }
27
- }
1
+ import React from "react";
2
+ export declare const Button: ({ userData: {}, style, children, }: React.PropsWithChildren<{
3
+ userData: {
4
+ business?: {
5
+ name: string;
6
+ email: string;
7
+ phone: {
8
+ code: number;
9
+ number: string;
10
+ };
11
+ address: {
12
+ streetAddress1: string;
13
+ city: string;
14
+ state: string;
15
+ zipPostal: string;
16
+ country: string;
17
+ };
18
+ };
19
+ };
20
+ style: React.CSSProperties;
21
+ }>) => React.JSX.Element;
22
+ declare global {
23
+ interface Window {
24
+ FB: any;
25
+ fbAsyncInit: any;
26
+ }
27
+ }
package/dist/ui/Button.js CHANGED
@@ -1,95 +1,95 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Button = void 0;
27
- const react_1 = __importStar(require("react"));
28
- const Button = ({ userData: {}, style, children, }) => {
29
- (0, react_1.useEffect)(() => {
30
- window.fbAsyncInit = () => {
31
- window.FB.init({
32
- appId: "962010571480233",
33
- xfbml: true,
34
- version: "v16.0",
35
- autoLogAppEvents: true,
36
- });
37
- };
38
- (function (d, s, id) {
39
- var js, fjs = d.getElementsByTagName(s)[0];
40
- if (d.getElementById(id)) {
41
- return;
42
- }
43
- js = d.createElement(s);
44
- js.id = id;
45
- js.src = "https://connect.facebook.net/en_US/sdk.js";
46
- fjs.parentNode.insertBefore(js, fjs);
47
- })(document, "script", "facebook-jssdk");
48
- }, []);
49
- const launchWhatsAppSignup = () => {
50
- // Launch Facebook login
51
- window.FB.login(function (response) {
52
- if (response.authResponse) {
53
- const code = response.authResponse.code;
54
- window.FB.getLoginStatus(function (response) {
55
- return response;
56
- });
57
- return code;
58
- }
59
- else {
60
- console.log("User cancelled login or did not fully authorize.");
61
- }
62
- }, {
63
- config_id: "1078873266788273",
64
- response_type: "code",
65
- override_default_response_type: true,
66
- extras: {
67
- setup: {
68
- business: {
69
- name: "",
70
- email: "",
71
- phone: {
72
- code: 55,
73
- number: "",
74
- },
75
- address: {
76
- streetAddress1: "",
77
- city: "",
78
- state: "",
79
- zipPostal: "",
80
- country: "BR",
81
- },
82
- timezone: "UTC-03:00",
83
- },
84
- phone: {
85
- displayName: "",
86
- category: "OTHER",
87
- description: "Compania vinculada a Secretaria Naty",
88
- },
89
- },
90
- },
91
- });
92
- };
93
- return (react_1.default.createElement("button", { style: style, onClick: () => launchWhatsAppSignup() }, children));
94
- };
95
- exports.Button = Button;
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Button = void 0;
27
+ const react_1 = __importStar(require("react"));
28
+ const Button = ({ userData: {}, style, children, }) => {
29
+ (0, react_1.useEffect)(() => {
30
+ window.fbAsyncInit = () => {
31
+ window.FB.init({
32
+ appId: "962010571480233",
33
+ xfbml: true,
34
+ version: "v16.0",
35
+ autoLogAppEvents: true,
36
+ });
37
+ };
38
+ (function (d, s, id) {
39
+ var js, fjs = d.getElementsByTagName(s)[0];
40
+ if (d.getElementById(id)) {
41
+ return;
42
+ }
43
+ js = d.createElement(s);
44
+ js.id = id;
45
+ js.src = "https://connect.facebook.net/en_US/sdk.js";
46
+ fjs.parentNode.insertBefore(js, fjs);
47
+ })(document, "script", "facebook-jssdk");
48
+ }, []);
49
+ const launchWhatsAppSignup = () => {
50
+ // Launch Facebook login
51
+ window.FB.login(function (response) {
52
+ if (response.authResponse) {
53
+ const code = response.authResponse.code;
54
+ window.FB.getLoginStatus(function (response) {
55
+ return response;
56
+ });
57
+ return code;
58
+ }
59
+ else {
60
+ console.log("User cancelled login or did not fully authorize.");
61
+ }
62
+ }, {
63
+ config_id: "1078873266788273",
64
+ response_type: "code",
65
+ override_default_response_type: true,
66
+ extras: {
67
+ setup: {
68
+ business: {
69
+ name: "",
70
+ email: "",
71
+ phone: {
72
+ code: 55,
73
+ number: "",
74
+ },
75
+ address: {
76
+ streetAddress1: "",
77
+ city: "",
78
+ state: "",
79
+ zipPostal: "",
80
+ country: "BR",
81
+ },
82
+ timezone: "UTC-03:00",
83
+ },
84
+ phone: {
85
+ displayName: "",
86
+ category: "OTHER",
87
+ description: "Compania vinculada a Secretaria Naty",
88
+ },
89
+ },
90
+ },
91
+ });
92
+ };
93
+ return (react_1.default.createElement("button", { style: style, onClick: () => launchWhatsAppSignup() }, children));
94
+ };
95
+ exports.Button = Button;
@@ -1 +1 @@
1
- export declare const cadastroIncorporado: () => {};
1
+ export declare const cadastroIncorporado: () => {};
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cadastroIncorporado = void 0;
4
- const cadastroIncorporado = () => {
5
- return {};
6
- };
7
- exports.cadastroIncorporado = cadastroIncorporado;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cadastroIncorporado = void 0;
4
+ const cadastroIncorporado = () => {
5
+ return {};
6
+ };
7
+ exports.cadastroIncorporado = cadastroIncorporado;
@@ -1,15 +1,15 @@
1
- import { ConnectionEntity } from "../../Entities/connection";
2
- import { Either } from "../../Errors";
3
- import { IConnection } from "../../interfaces";
4
- import { getAllProps, getAllReturn } from "../../types/requestTypes";
5
- declare class Connections implements IConnection {
6
- getSingle: (id: string) => Promise<Either<"", ConnectionEntity>>;
7
- getAll: (props: getAllProps) => Promise<Either<"", getAllReturn<ConnectionEntity>>>;
8
- SearchOne: (key: string, value: string) => Promise<Either<"", ConnectionEntity>>;
9
- insert: (connection: Partial<ConnectionEntity>) => Promise<Either<"", ConnectionEntity>>;
10
- update: (id: string, connection: Partial<ConnectionEntity>) => Promise<Either<"", ConnectionEntity>>;
11
- updateMany: (connection: Partial<ConnectionEntity>[]) => Promise<Either<"", ConnectionEntity[]>>;
12
- deleteOne: (id: string) => Promise<Either<"", ConnectionEntity>>;
13
- }
14
- declare const _default: Connections;
15
- export default _default;
1
+ import { ConnectionEntity } from "../../Entities/connection";
2
+ import { Either } from "../../Errors";
3
+ import { IConnection } from "../../interfaces";
4
+ import { getAllProps, getAllReturn } from "../../types/requestTypes";
5
+ declare class Connections implements IConnection {
6
+ getSingle: (id: string) => Promise<Either<"", ConnectionEntity>>;
7
+ getAll: (props: getAllProps) => Promise<Either<"", getAllReturn<ConnectionEntity>>>;
8
+ SearchOne: (key: string, value: string) => Promise<Either<"", ConnectionEntity>>;
9
+ insert: (connection: Partial<ConnectionEntity>) => Promise<Either<"", ConnectionEntity>>;
10
+ update: (id: string, connection: Partial<ConnectionEntity>) => Promise<Either<"", ConnectionEntity>>;
11
+ updateMany: (connection: Partial<ConnectionEntity>[]) => Promise<Either<"", ConnectionEntity[]>>;
12
+ deleteOne: (id: string) => Promise<Either<"", ConnectionEntity>>;
13
+ }
14
+ declare const _default: Connections;
15
+ export default _default;
@@ -1,16 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const services_1 = require("../../services");
4
- const utils_1 = require("../../utils");
5
- class Connections {
6
- constructor() {
7
- this.getSingle = (id) => (0, utils_1.Try)(services_1.connectionMutations.getSingle, id);
8
- this.getAll = (props) => (0, utils_1.Try)(services_1.connectionMutations.getAll, props);
9
- this.SearchOne = (key, value) => (0, utils_1.Try)(services_1.connectionMutations.SearchOne, key, value);
10
- this.insert = (connection) => (0, utils_1.Try)(services_1.connectionMutations.insert, connection);
11
- this.update = (id, connection) => (0, utils_1.Try)(services_1.connectionMutations.update, id, connection);
12
- this.updateMany = (connection) => (0, utils_1.Try)(services_1.connectionMutations.updateMany, connection);
13
- this.deleteOne = (id) => (0, utils_1.Try)(services_1.connectionMutations.deleteOne, id);
14
- }
15
- }
16
- exports.default = new Connections();
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const services_1 = require("../../services");
4
+ const utils_1 = require("../../utils");
5
+ class Connections {
6
+ constructor() {
7
+ this.getSingle = (id) => (0, utils_1.Try)(services_1.connectionMutations.getSingle, id);
8
+ this.getAll = (props) => (0, utils_1.Try)(services_1.connectionMutations.getAll, props);
9
+ this.SearchOne = (key, value) => (0, utils_1.Try)(services_1.connectionMutations.SearchOne, key, value);
10
+ this.insert = (connection) => (0, utils_1.Try)(services_1.connectionMutations.insert, connection);
11
+ this.update = (id, connection) => (0, utils_1.Try)(services_1.connectionMutations.update, id, connection);
12
+ this.updateMany = (connection) => (0, utils_1.Try)(services_1.connectionMutations.updateMany, connection);
13
+ this.deleteOne = (id) => (0, utils_1.Try)(services_1.connectionMutations.deleteOne, id);
14
+ }
15
+ }
16
+ exports.default = new Connections();
@@ -1,35 +1,35 @@
1
- /// <reference types="node" />
2
- import EventEmitter from "events";
3
- import { WhatsappResponse } from "../message/whatsappResponse";
4
- import { ConnectionEntity } from "../../Entities";
5
- export declare interface NatyEvents {
6
- on(event: "message", listener: (props: WhatsappResponse) => void): this;
7
- on(event: "connection", listener: (name: connectionEvent) => void): this;
8
- on(event: "error", listener: (name: string) => void): this;
9
- emit(event: "message", value: WhatsappResponse): any;
10
- emit(event: "connection", value: connectionEvent): any;
11
- emit(event: "error", value: Error): any;
12
- }
13
- export declare class NatyEvents extends EventEmitter {
14
- constructor();
15
- }
16
- export interface connectionEvent {
17
- companyId: string;
18
- connection?: ConnectionEntity;
19
- message: "confirm_connection" | "initialzed_connection";
20
- data: any;
21
- accountInfo?: {
22
- verified_name: string;
23
- code_verification_status: string;
24
- display_phone_number: string;
25
- quality_rating: string;
26
- platform_type: string;
27
- throughput: {
28
- level: string;
29
- };
30
- webhook_configuration: {
31
- application: string;
32
- };
33
- id: string;
34
- };
35
- }
1
+ /// <reference types="node" />
2
+ import EventEmitter from "events";
3
+ import { WhatsappResponse } from "../message/whatsappResponse";
4
+ import { ConnectionEntity } from "../../Entities";
5
+ export declare interface NatyEvents {
6
+ on(event: "message", listener: (props: WhatsappResponse) => void): this;
7
+ on(event: "connection", listener: (name: connectionEvent) => void): this;
8
+ on(event: "error", listener: (name: string) => void): this;
9
+ emit(event: "message", value: WhatsappResponse): any;
10
+ emit(event: "connection", value: connectionEvent): any;
11
+ emit(event: "error", value: Error): any;
12
+ }
13
+ export declare class NatyEvents extends EventEmitter {
14
+ constructor();
15
+ }
16
+ export interface connectionEvent {
17
+ companyId: string;
18
+ connection?: ConnectionEntity;
19
+ message: "confirm_connection" | "initialzed_connection";
20
+ data: any;
21
+ accountInfo?: {
22
+ verified_name: string;
23
+ code_verification_status: string;
24
+ display_phone_number: string;
25
+ quality_rating: string;
26
+ platform_type: string;
27
+ throughput: {
28
+ level: string;
29
+ };
30
+ webhook_configuration: {
31
+ application: string;
32
+ };
33
+ id: string;
34
+ };
35
+ }