@natyapp/meta 1.4.1 → 1.5.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.
Files changed (122) hide show
  1. package/README.md +60 -60
  2. package/dist/Entities/Logs.d.ts +16 -16
  3. package/dist/Entities/Logs.js +13 -13
  4. package/dist/Entities/connection.d.ts +15 -15
  5. package/dist/Entities/connection.js +13 -13
  6. package/dist/Entities/errorLogs.d.ts +9 -9
  7. package/dist/Entities/errorLogs.js +13 -13
  8. package/dist/Entities/index.d.ts +5 -5
  9. package/dist/Entities/index.js +21 -21
  10. package/dist/Entities/messages.d.ts +9 -9
  11. package/dist/Entities/messages.js +13 -13
  12. package/dist/Entities/webhooks.d.ts +17 -17
  13. package/dist/Entities/webhooks.js +13 -13
  14. package/dist/Entities/whatsappMessage.d.ts +63 -63
  15. package/dist/Entities/whatsappMessage.js +9 -9
  16. package/dist/Errors/Either.d.ts +15 -15
  17. package/dist/Errors/Either.js +37 -37
  18. package/dist/Errors/ErrorHandling.d.ts +10 -10
  19. package/dist/Errors/ErrorHandling.js +15 -15
  20. package/dist/Errors/index.d.ts +2 -2
  21. package/dist/Errors/index.js +18 -18
  22. package/dist/configs/apiConfig.d.ts +8 -0
  23. package/dist/configs/apiConfig.js +15 -0
  24. package/dist/configs/axiosInterceptors.d.ts +7 -7
  25. package/dist/configs/axiosInterceptors.js +10 -10
  26. package/dist/elements/button.d.ts +18 -18
  27. package/dist/elements/button.js +11 -11
  28. package/dist/elements/image.d.ts +9 -9
  29. package/dist/elements/image.js +12 -12
  30. package/dist/elements/index.d.ts +3 -3
  31. package/dist/elements/index.js +19 -19
  32. package/dist/elements/list.d.ts +78 -78
  33. package/dist/elements/list.js +55 -55
  34. package/dist/elements/text.d.ts +12 -12
  35. package/dist/elements/text.js +13 -13
  36. package/dist/index.d.ts +8 -8
  37. package/dist/index.js +44 -44
  38. package/dist/interfaces/IApiMetaConfig.d.ts +3 -0
  39. package/dist/interfaces/IApiMetaConfig.js +2 -0
  40. package/dist/interfaces/IConnection.d.ts +13 -13
  41. package/dist/interfaces/IConnection.js +2 -2
  42. package/dist/interfaces/IEventsMessage.d.ts +2 -2
  43. package/dist/interfaces/IEventsMessage.js +2 -2
  44. package/dist/interfaces/ILog.d.ts +10 -10
  45. package/dist/interfaces/ILog.js +2 -2
  46. package/dist/interfaces/IMessage.d.ts +22 -22
  47. package/dist/interfaces/IMessage.js +2 -2
  48. package/dist/interfaces/ISdk.d.ts +16 -16
  49. package/dist/interfaces/ISdk.js +2 -2
  50. package/dist/interfaces/IWebhook.d.ts +14 -14
  51. package/dist/interfaces/IWebhook.js +2 -2
  52. package/dist/interfaces/index.d.ts +5 -5
  53. package/dist/interfaces/index.js +21 -21
  54. package/dist/queue/messageQueue.d.ts +11 -11
  55. package/dist/queue/messageQueue.js +20 -20
  56. package/dist/routes/index.d.ts +3 -3
  57. package/dist/routes/index.js +11 -11
  58. package/dist/routes/webhooks/index.d.ts +3 -3
  59. package/dist/routes/webhooks/index.js +13 -13
  60. package/dist/routes/webhooks/methods/connection.d.ts +3 -3
  61. package/dist/routes/webhooks/methods/connection.js +42 -42
  62. package/dist/routes/webhooks/methods/messages.d.ts +3 -3
  63. package/dist/routes/webhooks/methods/messages.js +21 -21
  64. package/dist/services/axiosInstances.d.ts +18 -18
  65. package/dist/services/axiosInstances.js +45 -45
  66. package/dist/services/index.d.ts +3 -3
  67. package/dist/services/index.js +19 -19
  68. package/dist/services/middlewares/index.d.ts +1 -1
  69. package/dist/services/middlewares/index.js +5 -5
  70. package/dist/services/middlewares/validations.d.ts +4 -4
  71. package/dist/services/middlewares/validations.js +8 -8
  72. package/dist/services/mutations/connection.d.ts +2 -2
  73. package/dist/services/mutations/connection.js +49 -49
  74. package/dist/services/mutations/index.d.ts +3 -3
  75. package/dist/services/mutations/index.js +19 -19
  76. package/dist/services/mutations/logs.d.ts +2 -2
  77. package/dist/services/mutations/logs.js +25 -25
  78. package/dist/services/mutations/messages.d.ts +2 -2
  79. package/dist/services/mutations/messages.js +25 -25
  80. package/dist/services/mutations/validation.d.ts +5 -5
  81. package/dist/services/mutations/validation.js +15 -15
  82. package/dist/services/mutations/webhooks.d.ts +2 -2
  83. package/dist/services/mutations/webhooks.js +49 -49
  84. package/dist/types/index.d.ts +3 -3
  85. package/dist/types/index.js +19 -19
  86. package/dist/types/logs.d.ts +5 -5
  87. package/dist/types/logs.js +2 -2
  88. package/dist/types/requestTypes.d.ts +11 -11
  89. package/dist/types/requestTypes.js +2 -2
  90. package/dist/types/whatsappTypes.d.ts +68 -68
  91. package/dist/types/whatsappTypes.js +2 -2
  92. package/dist/ui/Button.d.ts +27 -27
  93. package/dist/ui/Button.js +95 -95
  94. package/dist/useCases/cadastroIncorporado/cadastroIncorporado.d.ts +1 -1
  95. package/dist/useCases/cadastroIncorporado/cadastroIncorporado.js +7 -7
  96. package/dist/useCases/connection/index.d.ts +15 -15
  97. package/dist/useCases/connection/index.js +16 -16
  98. package/dist/useCases/events/NatyEvents.d.ts +35 -35
  99. package/dist/useCases/events/NatyEvents.js +13 -13
  100. package/dist/useCases/index.d.ts +6 -6
  101. package/dist/useCases/index.js +16 -16
  102. package/dist/useCases/log/index.d.ts +10 -10
  103. package/dist/useCases/log/index.js +12 -12
  104. package/dist/useCases/message/index.d.ts +9 -9
  105. package/dist/useCases/message/index.js +6 -6
  106. package/dist/useCases/message/whatsappResponse.d.ts +62 -62
  107. package/dist/useCases/message/whatsappResponse.js +405 -405
  108. package/dist/useCases/messages/index.d.ts +10 -10
  109. package/dist/useCases/messages/index.js +12 -12
  110. package/dist/useCases/sdk/index.d.ts +20 -19
  111. package/dist/useCases/sdk/index.js +50 -48
  112. package/dist/useCases/webhook/index.d.ts +15 -15
  113. package/dist/useCases/webhook/index.js +16 -16
  114. package/dist/utils/constants.d.ts +11 -11
  115. package/dist/utils/constants.js +17 -17
  116. package/dist/utils/genUuid.d.ts +1 -1
  117. package/dist/utils/genUuid.js +16 -16
  118. package/dist/utils/index.d.ts +1 -1
  119. package/dist/utils/index.js +17 -17
  120. package/dist/utils/tryCatch.d.ts +1 -1
  121. package/dist/utils/tryCatch.js +19 -19
  122. package/package.json +39 -39
@@ -1,5 +1,5 @@
1
- import { Either } from "../../Errors/Either";
2
- export declare const validateMutations: {
3
- confirmAppToken: (appToken: string) => Promise<Either<ConfirmAppTokenErrors, boolean>>;
4
- };
5
- export type ConfirmAppTokenErrors = "Não foi possível validar";
1
+ import { Either } from "../../Errors/Either";
2
+ export declare const validateMutations: {
3
+ confirmAppToken: (appToken: string) => Promise<Either<ConfirmAppTokenErrors, boolean>>;
4
+ };
5
+ export type ConfirmAppTokenErrors = "Não foi possível validar";
@@ -1,15 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateMutations = void 0;
4
- const axiosInstances_1 = require("../axiosInstances");
5
- const Either_1 = require("../../Errors/Either");
6
- exports.validateMutations = {
7
- confirmAppToken: async (appToken) => {
8
- const confirmation = await axiosInstances_1.api.post("/validate/validateAppToken", {
9
- appToken,
10
- });
11
- if (confirmation.data)
12
- return (0, Either_1.throwSuccess)(confirmation.data);
13
- return (0, Either_1.throwError)("Não foi possível validar");
14
- },
15
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateMutations = void 0;
4
+ const axiosInstances_1 = require("../axiosInstances");
5
+ const Either_1 = require("../../Errors/Either");
6
+ exports.validateMutations = {
7
+ confirmAppToken: async (appToken) => {
8
+ const confirmation = await axiosInstances_1.api.post("/validate/validateAppToken", {
9
+ appToken,
10
+ });
11
+ if (confirmation.data)
12
+ return (0, Either_1.throwSuccess)(confirmation.data);
13
+ return (0, Either_1.throwError)("Não foi possível validar");
14
+ },
15
+ };
@@ -1,2 +1,2 @@
1
- import { IWebhook } from "../../interfaces";
2
- export declare const webhooksMutations: IWebhook;
1
+ import { IWebhook } from "../../interfaces";
2
+ export declare const webhooksMutations: IWebhook;
@@ -1,49 +1,49 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.webhooksMutations = void 0;
4
- const Either_1 = require("../../Errors/Either");
5
- const axiosInstances_1 = require("../axiosInstances");
6
- exports.webhooksMutations = {
7
- insert: async (connection) => {
8
- const call = await axiosInstances_1.api.post(`/webhooks`, connection);
9
- if (!call.data)
10
- return (0, Either_1.throwError)("");
11
- return (0, Either_1.throwSuccess)(call.data);
12
- },
13
- getSingle: async (id) => {
14
- const call = await axiosInstances_1.api.get(`/webhooks/${id}`);
15
- if (!call.data)
16
- return (0, Either_1.throwError)("");
17
- return (0, Either_1.throwSuccess)(call.data);
18
- },
19
- searchOne: async (key, value) => {
20
- const call = await axiosInstances_1.api.get(`/webhooks`, { params: { key, value } });
21
- if (!call.data)
22
- return (0, Either_1.throwError)("");
23
- return (0, Either_1.throwSuccess)(call.data);
24
- },
25
- getAll: async (props) => {
26
- const call = await axiosInstances_1.api.get(`/webhooks`, { params: props });
27
- if (!call.data)
28
- return (0, Either_1.throwError)("");
29
- return (0, Either_1.throwSuccess)(call.data);
30
- },
31
- update: async (id, connection) => {
32
- const call = await axiosInstances_1.api.patch(`/webhooks/${id}`, connection);
33
- if (!call.data)
34
- return (0, Either_1.throwError)("");
35
- return (0, Either_1.throwSuccess)(call.data);
36
- },
37
- updateMany: async (connection) => {
38
- const call = await axiosInstances_1.api.patch(`/webhooks`, connection);
39
- if (!call.data)
40
- return (0, Either_1.throwError)("");
41
- return (0, Either_1.throwSuccess)(call.data);
42
- },
43
- deleteOne: async (id) => {
44
- const call = await axiosInstances_1.api.delete(`/webhooks/${id}`);
45
- if (!call.data)
46
- return (0, Either_1.throwError)("");
47
- return (0, Either_1.throwSuccess)(call.data);
48
- },
49
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.webhooksMutations = void 0;
4
+ const Either_1 = require("../../Errors/Either");
5
+ const axiosInstances_1 = require("../axiosInstances");
6
+ exports.webhooksMutations = {
7
+ insert: async (connection) => {
8
+ const call = await axiosInstances_1.api.post(`/webhooks`, connection);
9
+ if (!call.data)
10
+ return (0, Either_1.throwError)("");
11
+ return (0, Either_1.throwSuccess)(call.data);
12
+ },
13
+ getSingle: async (id) => {
14
+ const call = await axiosInstances_1.api.get(`/webhooks/${id}`);
15
+ if (!call.data)
16
+ return (0, Either_1.throwError)("");
17
+ return (0, Either_1.throwSuccess)(call.data);
18
+ },
19
+ searchOne: async (key, value) => {
20
+ const call = await axiosInstances_1.api.get(`/webhooks`, { params: { key, value } });
21
+ if (!call.data)
22
+ return (0, Either_1.throwError)("");
23
+ return (0, Either_1.throwSuccess)(call.data);
24
+ },
25
+ getAll: async (props) => {
26
+ const call = await axiosInstances_1.api.get(`/webhooks`, { params: props });
27
+ if (!call.data)
28
+ return (0, Either_1.throwError)("");
29
+ return (0, Either_1.throwSuccess)(call.data);
30
+ },
31
+ update: async (id, connection) => {
32
+ const call = await axiosInstances_1.api.patch(`/webhooks/${id}`, connection);
33
+ if (!call.data)
34
+ return (0, Either_1.throwError)("");
35
+ return (0, Either_1.throwSuccess)(call.data);
36
+ },
37
+ updateMany: async (connection) => {
38
+ const call = await axiosInstances_1.api.patch(`/webhooks`, connection);
39
+ if (!call.data)
40
+ return (0, Either_1.throwError)("");
41
+ return (0, Either_1.throwSuccess)(call.data);
42
+ },
43
+ deleteOne: async (id) => {
44
+ const call = await axiosInstances_1.api.delete(`/webhooks/${id}`);
45
+ if (!call.data)
46
+ return (0, Either_1.throwError)("");
47
+ return (0, Either_1.throwSuccess)(call.data);
48
+ },
49
+ };
@@ -1,3 +1,3 @@
1
- export * from "./logs";
2
- export * from "./requestTypes";
3
- export * from "./whatsappTypes";
1
+ export * from "./logs";
2
+ export * from "./requestTypes";
3
+ export * from "./whatsappTypes";
@@ -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;