@natyapp/meta 1.5.1 → 1.5.4
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 +60 -60
- package/dist/Entities/Logs.d.ts +16 -16
- package/dist/Entities/Logs.js +13 -13
- package/dist/Entities/connection.d.ts +15 -15
- package/dist/Entities/connection.js +13 -13
- package/dist/Entities/errorLogs.d.ts +9 -9
- package/dist/Entities/errorLogs.js +13 -13
- package/dist/Entities/index.d.ts +5 -5
- package/dist/Entities/index.js +21 -21
- package/dist/Entities/messages.d.ts +9 -9
- package/dist/Entities/messages.js +13 -13
- package/dist/Entities/webhooks.d.ts +17 -17
- package/dist/Entities/webhooks.js +13 -13
- package/dist/Entities/whatsappMessage.d.ts +63 -63
- package/dist/Entities/whatsappMessage.js +9 -9
- package/dist/Errors/Either.d.ts +15 -15
- package/dist/Errors/Either.js +37 -37
- package/dist/Errors/ErrorHandling.d.ts +10 -10
- package/dist/Errors/ErrorHandling.js +15 -15
- package/dist/Errors/index.d.ts +2 -2
- package/dist/Errors/index.js +18 -18
- package/dist/configs/apiConfig.d.ts +8 -0
- package/dist/configs/apiConfig.js +15 -0
- package/dist/configs/axiosInterceptors.d.ts +7 -7
- package/dist/configs/axiosInterceptors.js +10 -10
- package/dist/elements/button.d.ts +18 -18
- package/dist/elements/button.js +11 -11
- package/dist/elements/image.d.ts +9 -9
- package/dist/elements/image.js +12 -12
- package/dist/elements/index.d.ts +3 -3
- package/dist/elements/index.js +19 -19
- package/dist/elements/list.d.ts +78 -78
- package/dist/elements/list.js +55 -55
- package/dist/elements/text.d.ts +12 -12
- package/dist/elements/text.js +13 -13
- package/dist/index.d.ts +8 -8
- package/dist/index.js +45 -44
- package/dist/interfaces/IApiMetaConfig.d.ts +3 -0
- package/dist/interfaces/IApiMetaConfig.js +2 -0
- package/dist/interfaces/IConfigureSdk.d.ts +4 -0
- package/dist/interfaces/IConfigureSdk.js +2 -0
- package/dist/interfaces/IConnection.d.ts +13 -13
- package/dist/interfaces/IConnection.js +2 -2
- package/dist/interfaces/IEventsMessage.d.ts +2 -2
- package/dist/interfaces/IEventsMessage.js +2 -2
- package/dist/interfaces/ILog.d.ts +10 -10
- package/dist/interfaces/ILog.js +2 -2
- package/dist/interfaces/IMessage.d.ts +22 -22
- package/dist/interfaces/IMessage.js +2 -2
- package/dist/interfaces/ISdk.d.ts +16 -16
- package/dist/interfaces/ISdk.js +2 -2
- package/dist/interfaces/IWebhook.d.ts +14 -14
- package/dist/interfaces/IWebhook.js +2 -2
- package/dist/interfaces/index.d.ts +5 -5
- package/dist/interfaces/index.js +21 -21
- package/dist/queue/messageQueue.d.ts +11 -11
- package/dist/queue/messageQueue.js +20 -20
- package/dist/routes/index.d.ts +3 -3
- package/dist/routes/index.js +11 -11
- package/dist/routes/webhooks/index.d.ts +3 -3
- package/dist/routes/webhooks/index.js +13 -13
- package/dist/routes/webhooks/methods/connection.d.ts +3 -3
- package/dist/routes/webhooks/methods/connection.js +42 -42
- package/dist/routes/webhooks/methods/messages.d.ts +3 -3
- package/dist/routes/webhooks/methods/messages.js +21 -21
- package/dist/services/axiosInstances.d.ts +18 -18
- package/dist/services/axiosInstances.js +45 -44
- package/dist/services/index.d.ts +3 -3
- package/dist/services/index.js +19 -19
- package/dist/services/middlewares/index.d.ts +1 -1
- package/dist/services/middlewares/index.js +5 -5
- package/dist/services/middlewares/validations.d.ts +4 -4
- package/dist/services/middlewares/validations.js +8 -8
- package/dist/services/mutations/connection.d.ts +2 -2
- package/dist/services/mutations/connection.js +49 -49
- package/dist/services/mutations/index.d.ts +3 -3
- package/dist/services/mutations/index.js +19 -19
- package/dist/services/mutations/logs.d.ts +2 -2
- package/dist/services/mutations/logs.js +25 -25
- package/dist/services/mutations/messages.d.ts +2 -2
- package/dist/services/mutations/messages.js +25 -25
- package/dist/services/mutations/validation.d.ts +5 -5
- package/dist/services/mutations/validation.js +15 -15
- package/dist/services/mutations/webhooks.d.ts +2 -2
- package/dist/services/mutations/webhooks.js +49 -49
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.js +19 -19
- package/dist/types/logs.d.ts +5 -5
- package/dist/types/logs.js +2 -2
- package/dist/types/requestTypes.d.ts +11 -11
- package/dist/types/requestTypes.js +2 -2
- package/dist/types/whatsappTypes.d.ts +68 -68
- package/dist/types/whatsappTypes.js +2 -2
- package/dist/ui/Button.d.ts +27 -27
- package/dist/ui/Button.js +95 -95
- package/dist/useCases/cadastroIncorporado/cadastroIncorporado.d.ts +1 -1
- package/dist/useCases/cadastroIncorporado/cadastroIncorporado.js +7 -7
- package/dist/useCases/configuration/index.d.ts +7 -0
- package/dist/useCases/configuration/index.js +10 -0
- package/dist/useCases/connection/index.d.ts +15 -15
- package/dist/useCases/connection/index.js +16 -16
- package/dist/useCases/events/NatyEvents.d.ts +35 -35
- package/dist/useCases/events/NatyEvents.js +13 -13
- package/dist/useCases/index.d.ts +7 -6
- package/dist/useCases/index.js +18 -16
- package/dist/useCases/log/index.d.ts +10 -10
- package/dist/useCases/log/index.js +12 -12
- package/dist/useCases/message/index.d.ts +9 -9
- package/dist/useCases/message/index.js +6 -6
- package/dist/useCases/message/whatsappResponse.d.ts +62 -63
- package/dist/useCases/message/whatsappResponse.js +405 -417
- package/dist/useCases/messages/index.d.ts +10 -10
- package/dist/useCases/messages/index.js +12 -12
- package/dist/useCases/sdk/index.d.ts +20 -19
- package/dist/useCases/sdk/index.js +50 -48
- package/dist/useCases/webhook/index.d.ts +15 -15
- package/dist/useCases/webhook/index.js +16 -16
- package/dist/utils/constants.d.ts +11 -11
- package/dist/utils/constants.js +17 -17
- package/dist/utils/genUuid.d.ts +1 -1
- package/dist/utils/genUuid.js +16 -16
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +17 -17
- package/dist/utils/tryCatch.d.ts +1 -1
- package/dist/utils/tryCatch.js +19 -19
- package/package.json +39 -39
package/dist/Errors/Either.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.throwSuccess = exports.throwError = exports.isSuccess = exports.isError = exports.unwrapEither = void 0;
|
|
4
|
-
const unwrapEither = ({ isError, isSuccess, }) => {
|
|
5
|
-
if (isSuccess !== undefined && isError !== undefined) {
|
|
6
|
-
throw new Error(`Received both isError and isSuccess values at runtime when opening an Either\nisError: ${JSON.stringify(isError)}\nisSuccess: ${JSON.stringify(isSuccess)}`);
|
|
7
|
-
/*
|
|
8
|
-
We're throwing in this function because this can only occur at runtime if something
|
|
9
|
-
happens that the TypeScript compiler couldn't anticipate. That means the application
|
|
10
|
-
is in an unexpected state and we should terminate immediately.
|
|
11
|
-
*/
|
|
12
|
-
}
|
|
13
|
-
if (isError !== undefined) {
|
|
14
|
-
return isError; // Typescript is getting confused and returning this type as `T | undefined` unless we add the type assertion
|
|
15
|
-
}
|
|
16
|
-
if (isSuccess !== undefined) {
|
|
17
|
-
return isSuccess;
|
|
18
|
-
}
|
|
19
|
-
throw new Error(`Received no isError or isSuccess values at runtime when opening Either`);
|
|
20
|
-
};
|
|
21
|
-
exports.unwrapEither = unwrapEither;
|
|
22
|
-
const isError = (e) => {
|
|
23
|
-
return e.isError !== undefined;
|
|
24
|
-
};
|
|
25
|
-
exports.isError = isError;
|
|
26
|
-
const isSuccess = (e) => {
|
|
27
|
-
return e.isSuccess !== undefined;
|
|
28
|
-
};
|
|
29
|
-
exports.isSuccess = isSuccess;
|
|
30
|
-
const throwError = (value) => ({
|
|
31
|
-
isError: value,
|
|
32
|
-
});
|
|
33
|
-
exports.throwError = throwError;
|
|
34
|
-
const throwSuccess = (value) => ({
|
|
35
|
-
isSuccess: value,
|
|
36
|
-
});
|
|
37
|
-
exports.throwSuccess = throwSuccess;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.throwSuccess = exports.throwError = exports.isSuccess = exports.isError = exports.unwrapEither = void 0;
|
|
4
|
+
const unwrapEither = ({ isError, isSuccess, }) => {
|
|
5
|
+
if (isSuccess !== undefined && isError !== undefined) {
|
|
6
|
+
throw new Error(`Received both isError and isSuccess values at runtime when opening an Either\nisError: ${JSON.stringify(isError)}\nisSuccess: ${JSON.stringify(isSuccess)}`);
|
|
7
|
+
/*
|
|
8
|
+
We're throwing in this function because this can only occur at runtime if something
|
|
9
|
+
happens that the TypeScript compiler couldn't anticipate. That means the application
|
|
10
|
+
is in an unexpected state and we should terminate immediately.
|
|
11
|
+
*/
|
|
12
|
+
}
|
|
13
|
+
if (isError !== undefined) {
|
|
14
|
+
return isError; // Typescript is getting confused and returning this type as `T | undefined` unless we add the type assertion
|
|
15
|
+
}
|
|
16
|
+
if (isSuccess !== undefined) {
|
|
17
|
+
return isSuccess;
|
|
18
|
+
}
|
|
19
|
+
throw new Error(`Received no isError or isSuccess values at runtime when opening Either`);
|
|
20
|
+
};
|
|
21
|
+
exports.unwrapEither = unwrapEither;
|
|
22
|
+
const isError = (e) => {
|
|
23
|
+
return e.isError !== undefined;
|
|
24
|
+
};
|
|
25
|
+
exports.isError = isError;
|
|
26
|
+
const isSuccess = (e) => {
|
|
27
|
+
return e.isSuccess !== undefined;
|
|
28
|
+
};
|
|
29
|
+
exports.isSuccess = isSuccess;
|
|
30
|
+
const throwError = (value) => ({
|
|
31
|
+
isError: value,
|
|
32
|
+
});
|
|
33
|
+
exports.throwError = throwError;
|
|
34
|
+
const throwSuccess = (value) => ({
|
|
35
|
+
isSuccess: value,
|
|
36
|
+
});
|
|
37
|
+
exports.throwSuccess = throwSuccess;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare const ErrorHandling: (message?: string | Object | any[], code?: number) => ErrorReturnType;
|
|
2
|
-
export type Response<E, S> = {
|
|
3
|
-
isSuccess: S;
|
|
4
|
-
isError: E;
|
|
5
|
-
};
|
|
6
|
-
type ErrorReturnType = {
|
|
7
|
-
code: number;
|
|
8
|
-
message: string | Object;
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
1
|
+
export declare const ErrorHandling: (message?: string | Object | any[], code?: number) => ErrorReturnType;
|
|
2
|
+
export type Response<E, S> = {
|
|
3
|
+
isSuccess: S;
|
|
4
|
+
isError: E;
|
|
5
|
+
};
|
|
6
|
+
type ErrorReturnType = {
|
|
7
|
+
code: number;
|
|
8
|
+
message: string | Object;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorHandling = void 0;
|
|
4
|
-
const ErrorHandling = (message, code) => {
|
|
5
|
-
if (typeof message === "object")
|
|
6
|
-
return {
|
|
7
|
-
code: 500,
|
|
8
|
-
message,
|
|
9
|
-
};
|
|
10
|
-
return {
|
|
11
|
-
code: code ? code : message ? 400 : 500,
|
|
12
|
-
message: message || "Erro interno do servidor",
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
exports.ErrorHandling = ErrorHandling;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorHandling = void 0;
|
|
4
|
+
const ErrorHandling = (message, code) => {
|
|
5
|
+
if (typeof message === "object")
|
|
6
|
+
return {
|
|
7
|
+
code: 500,
|
|
8
|
+
message,
|
|
9
|
+
};
|
|
10
|
+
return {
|
|
11
|
+
code: code ? code : message ? 400 : 500,
|
|
12
|
+
message: message || "Erro interno do servidor",
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.ErrorHandling = ErrorHandling;
|
package/dist/Errors/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./Either";
|
|
2
|
-
export * from "./ErrorHandling";
|
|
1
|
+
export * from "./Either";
|
|
2
|
+
export * from "./ErrorHandling";
|
package/dist/Errors/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
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("./Either"), exports);
|
|
18
|
-
__exportStar(require("./ErrorHandling"), 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("./Either"), exports);
|
|
18
|
+
__exportStar(require("./ErrorHandling"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiConfig = void 0;
|
|
4
|
+
class ApiConfig {
|
|
5
|
+
constructor(config) {
|
|
6
|
+
this.Url = (config === null || config === void 0 ? void 0 : config.Url) || "https://meta.api.secretarianaty.com";
|
|
7
|
+
}
|
|
8
|
+
static getInstance(config) {
|
|
9
|
+
if (!ApiConfig.instance) {
|
|
10
|
+
ApiConfig.instance = new ApiConfig(config);
|
|
11
|
+
}
|
|
12
|
+
return ApiConfig.instance;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ApiConfig = ApiConfig;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const configInterceptors: {
|
|
2
|
-
Accept: string;
|
|
3
|
-
"Content-Type": string;
|
|
4
|
-
"Access-Control-Allow-Headers": string;
|
|
5
|
-
"Access-Control-Allow-Origin": string;
|
|
6
|
-
"Access-Control-Allow-Methods": string;
|
|
7
|
-
};
|
|
1
|
+
export declare const configInterceptors: {
|
|
2
|
+
Accept: string;
|
|
3
|
+
"Content-Type": string;
|
|
4
|
+
"Access-Control-Allow-Headers": string;
|
|
5
|
+
"Access-Control-Allow-Origin": string;
|
|
6
|
+
"Access-Control-Allow-Methods": string;
|
|
7
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.configInterceptors = void 0;
|
|
4
|
-
exports.configInterceptors = {
|
|
5
|
-
["Accept"]: "application/json",
|
|
6
|
-
["Content-Type"]: "application/json; charset=utf-8",
|
|
7
|
-
["Access-Control-Allow-Headers"]: "Content-Type",
|
|
8
|
-
["Access-Control-Allow-Origin"]: "*",
|
|
9
|
-
["Access-Control-Allow-Methods"]: "OPTIONS,POST,GET,PUT,PATCH,DELETE",
|
|
10
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configInterceptors = void 0;
|
|
4
|
+
exports.configInterceptors = {
|
|
5
|
+
["Accept"]: "application/json",
|
|
6
|
+
["Content-Type"]: "application/json; charset=utf-8",
|
|
7
|
+
["Access-Control-Allow-Headers"]: "Content-Type",
|
|
8
|
+
["Access-Control-Allow-Origin"]: "*",
|
|
9
|
+
["Access-Control-Allow-Methods"]: "OPTIONS,POST,GET,PUT,PATCH,DELETE",
|
|
10
|
+
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export declare class Button {
|
|
2
|
-
type: string;
|
|
3
|
-
body: {
|
|
4
|
-
text: string;
|
|
5
|
-
};
|
|
6
|
-
action: {
|
|
7
|
-
buttons: btnType[];
|
|
8
|
-
};
|
|
9
|
-
constructor(props: Button);
|
|
10
|
-
}
|
|
11
|
-
type btnType = {
|
|
12
|
-
type: "reply";
|
|
13
|
-
reply: {
|
|
14
|
-
id: string;
|
|
15
|
-
title: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export {};
|
|
1
|
+
export declare class Button {
|
|
2
|
+
type: string;
|
|
3
|
+
body: {
|
|
4
|
+
text: string;
|
|
5
|
+
};
|
|
6
|
+
action: {
|
|
7
|
+
buttons: btnType[];
|
|
8
|
+
};
|
|
9
|
+
constructor(props: Button);
|
|
10
|
+
}
|
|
11
|
+
type btnType = {
|
|
12
|
+
type: "reply";
|
|
13
|
+
reply: {
|
|
14
|
+
id: string;
|
|
15
|
+
title: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export {};
|
package/dist/elements/button.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Button = void 0;
|
|
4
|
-
class Button {
|
|
5
|
-
constructor(props) {
|
|
6
|
-
this.type = "interactive";
|
|
7
|
-
this.body = { text: "" };
|
|
8
|
-
Object.assign(this, props);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.Button = Button;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Button = void 0;
|
|
4
|
+
class Button {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
this.type = "interactive";
|
|
7
|
+
this.body = { text: "" };
|
|
8
|
+
Object.assign(this, props);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.Button = Button;
|
package/dist/elements/image.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare class Image {
|
|
2
|
-
messaging_product: string;
|
|
3
|
-
to: number;
|
|
4
|
-
type: string;
|
|
5
|
-
text: {
|
|
6
|
-
body: string;
|
|
7
|
-
};
|
|
8
|
-
constructor(props: Image);
|
|
9
|
-
}
|
|
1
|
+
export declare class Image {
|
|
2
|
+
messaging_product: string;
|
|
3
|
+
to: number;
|
|
4
|
+
type: string;
|
|
5
|
+
text: {
|
|
6
|
+
body: string;
|
|
7
|
+
};
|
|
8
|
+
constructor(props: Image);
|
|
9
|
+
}
|
package/dist/elements/image.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Image = void 0;
|
|
4
|
-
class Image {
|
|
5
|
-
constructor(props) {
|
|
6
|
-
this.messaging_product = "whatsapp";
|
|
7
|
-
this.type = "text";
|
|
8
|
-
this.text = { body: "" };
|
|
9
|
-
Object.assign(this, props);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.Image = Image;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Image = void 0;
|
|
4
|
+
class Image {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
this.messaging_product = "whatsapp";
|
|
7
|
+
this.type = "text";
|
|
8
|
+
this.text = { body: "" };
|
|
9
|
+
Object.assign(this, props);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.Image = Image;
|
package/dist/elements/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./button";
|
|
2
|
-
export * from "./list";
|
|
3
|
-
export * from "./text";
|
|
1
|
+
export * from "./button";
|
|
2
|
+
export * from "./list";
|
|
3
|
+
export * from "./text";
|
package/dist/elements/index.js
CHANGED
|
@@ -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("./button"), exports);
|
|
18
|
-
__exportStar(require("./list"), exports);
|
|
19
|
-
__exportStar(require("./text"), 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("./button"), exports);
|
|
18
|
+
__exportStar(require("./list"), exports);
|
|
19
|
+
__exportStar(require("./text"), exports);
|
package/dist/elements/list.d.ts
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
export declare class List implements list {
|
|
2
|
-
type: "list";
|
|
3
|
-
header: {
|
|
4
|
-
type: "text";
|
|
5
|
-
text: string;
|
|
6
|
-
};
|
|
7
|
-
body: {
|
|
8
|
-
text: string;
|
|
9
|
-
};
|
|
10
|
-
footer: {
|
|
11
|
-
text: string;
|
|
12
|
-
};
|
|
13
|
-
action: actionType;
|
|
14
|
-
constructor(props: {
|
|
15
|
-
title: string;
|
|
16
|
-
subtitle: string;
|
|
17
|
-
footer?: string;
|
|
18
|
-
buttonTitle: string;
|
|
19
|
-
});
|
|
20
|
-
insertSection(title: string | undefined, btns: rowType[]): void;
|
|
21
|
-
}
|
|
22
|
-
interface list {
|
|
23
|
-
type: "list";
|
|
24
|
-
header?: {
|
|
25
|
-
type: "text";
|
|
26
|
-
text: string;
|
|
27
|
-
};
|
|
28
|
-
body?: {
|
|
29
|
-
text: string;
|
|
30
|
-
};
|
|
31
|
-
footer?: {
|
|
32
|
-
text: string;
|
|
33
|
-
};
|
|
34
|
-
action: actionType;
|
|
35
|
-
}
|
|
36
|
-
type actionType = {
|
|
37
|
-
button: string;
|
|
38
|
-
sections: sectionType[];
|
|
39
|
-
};
|
|
40
|
-
type sectionType = {
|
|
41
|
-
title: string;
|
|
42
|
-
rows: rowType[];
|
|
43
|
-
};
|
|
44
|
-
type rowType = {
|
|
45
|
-
id: string;
|
|
46
|
-
title: string;
|
|
47
|
-
description: string;
|
|
48
|
-
};
|
|
49
|
-
export declare const ListTeste: ({ subtitle, footer, buttonTitle, name, }: {
|
|
50
|
-
subtitle?: string | undefined;
|
|
51
|
-
footer?: string | undefined;
|
|
52
|
-
buttonTitle: string;
|
|
53
|
-
name: string;
|
|
54
|
-
}) => {
|
|
55
|
-
type: string;
|
|
56
|
-
header: {
|
|
57
|
-
type: string;
|
|
58
|
-
text: string;
|
|
59
|
-
};
|
|
60
|
-
body: {
|
|
61
|
-
text: string | undefined;
|
|
62
|
-
};
|
|
63
|
-
footer: {
|
|
64
|
-
text: string | undefined;
|
|
65
|
-
};
|
|
66
|
-
action: {
|
|
67
|
-
button: string;
|
|
68
|
-
sections: {
|
|
69
|
-
title: string;
|
|
70
|
-
rows: {
|
|
71
|
-
id: string;
|
|
72
|
-
title: string;
|
|
73
|
-
description: string;
|
|
74
|
-
}[];
|
|
75
|
-
}[];
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
export {};
|
|
1
|
+
export declare class List implements list {
|
|
2
|
+
type: "list";
|
|
3
|
+
header: {
|
|
4
|
+
type: "text";
|
|
5
|
+
text: string;
|
|
6
|
+
};
|
|
7
|
+
body: {
|
|
8
|
+
text: string;
|
|
9
|
+
};
|
|
10
|
+
footer: {
|
|
11
|
+
text: string;
|
|
12
|
+
};
|
|
13
|
+
action: actionType;
|
|
14
|
+
constructor(props: {
|
|
15
|
+
title: string;
|
|
16
|
+
subtitle: string;
|
|
17
|
+
footer?: string;
|
|
18
|
+
buttonTitle: string;
|
|
19
|
+
});
|
|
20
|
+
insertSection(title: string | undefined, btns: rowType[]): void;
|
|
21
|
+
}
|
|
22
|
+
interface list {
|
|
23
|
+
type: "list";
|
|
24
|
+
header?: {
|
|
25
|
+
type: "text";
|
|
26
|
+
text: string;
|
|
27
|
+
};
|
|
28
|
+
body?: {
|
|
29
|
+
text: string;
|
|
30
|
+
};
|
|
31
|
+
footer?: {
|
|
32
|
+
text: string;
|
|
33
|
+
};
|
|
34
|
+
action: actionType;
|
|
35
|
+
}
|
|
36
|
+
type actionType = {
|
|
37
|
+
button: string;
|
|
38
|
+
sections: sectionType[];
|
|
39
|
+
};
|
|
40
|
+
type sectionType = {
|
|
41
|
+
title: string;
|
|
42
|
+
rows: rowType[];
|
|
43
|
+
};
|
|
44
|
+
type rowType = {
|
|
45
|
+
id: string;
|
|
46
|
+
title: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
export declare const ListTeste: ({ subtitle, footer, buttonTitle, name, }: {
|
|
50
|
+
subtitle?: string | undefined;
|
|
51
|
+
footer?: string | undefined;
|
|
52
|
+
buttonTitle: string;
|
|
53
|
+
name: string;
|
|
54
|
+
}) => {
|
|
55
|
+
type: string;
|
|
56
|
+
header: {
|
|
57
|
+
type: string;
|
|
58
|
+
text: string;
|
|
59
|
+
};
|
|
60
|
+
body: {
|
|
61
|
+
text: string | undefined;
|
|
62
|
+
};
|
|
63
|
+
footer: {
|
|
64
|
+
text: string | undefined;
|
|
65
|
+
};
|
|
66
|
+
action: {
|
|
67
|
+
button: string;
|
|
68
|
+
sections: {
|
|
69
|
+
title: string;
|
|
70
|
+
rows: {
|
|
71
|
+
id: string;
|
|
72
|
+
title: string;
|
|
73
|
+
description: string;
|
|
74
|
+
}[];
|
|
75
|
+
}[];
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export {};
|
package/dist/elements/list.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ListTeste = exports.List = void 0;
|
|
4
|
-
class List {
|
|
5
|
-
constructor(props) {
|
|
6
|
-
this.type = "list";
|
|
7
|
-
this.header = { type: "text", text: "" };
|
|
8
|
-
this.body = { text: "" };
|
|
9
|
-
this.footer = { text: "" };
|
|
10
|
-
this.action = { button: "", sections: [] };
|
|
11
|
-
this.header.text = props.title;
|
|
12
|
-
this.body.text = props.subtitle;
|
|
13
|
-
this.footer.text = props.footer || "";
|
|
14
|
-
this.action.button = props.buttonTitle;
|
|
15
|
-
}
|
|
16
|
-
insertSection(title = "teste", btns) {
|
|
17
|
-
let newSection = { title, rows: btns };
|
|
18
|
-
this.action.sections.push(newSection);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.List = List;
|
|
22
|
-
const ListTeste = ({ subtitle, footer, buttonTitle, name, }) => ({
|
|
23
|
-
type: "list",
|
|
24
|
-
header: {
|
|
25
|
-
type: "text",
|
|
26
|
-
text: `Olá, sou ${name}`,
|
|
27
|
-
},
|
|
28
|
-
body: {
|
|
29
|
-
text: subtitle,
|
|
30
|
-
},
|
|
31
|
-
footer: {
|
|
32
|
-
text: footer,
|
|
33
|
-
},
|
|
34
|
-
action: {
|
|
35
|
-
button: buttonTitle,
|
|
36
|
-
sections: [
|
|
37
|
-
{
|
|
38
|
-
title: "Ações",
|
|
39
|
-
rows: [
|
|
40
|
-
{
|
|
41
|
-
id: "ticket",
|
|
42
|
-
title: "Abrir Ticket",
|
|
43
|
-
description: "Clique aqui para solicitar um ticket suporte.",
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
id: "suporte",
|
|
47
|
-
title: "Atendente",
|
|
48
|
-
description: "Clique aqui para solicitar um atendimento direto",
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
exports.ListTeste = ListTeste;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListTeste = exports.List = void 0;
|
|
4
|
+
class List {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
this.type = "list";
|
|
7
|
+
this.header = { type: "text", text: "" };
|
|
8
|
+
this.body = { text: "" };
|
|
9
|
+
this.footer = { text: "" };
|
|
10
|
+
this.action = { button: "", sections: [] };
|
|
11
|
+
this.header.text = props.title;
|
|
12
|
+
this.body.text = props.subtitle;
|
|
13
|
+
this.footer.text = props.footer || "";
|
|
14
|
+
this.action.button = props.buttonTitle;
|
|
15
|
+
}
|
|
16
|
+
insertSection(title = "teste", btns) {
|
|
17
|
+
let newSection = { title, rows: btns };
|
|
18
|
+
this.action.sections.push(newSection);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.List = List;
|
|
22
|
+
const ListTeste = ({ subtitle, footer, buttonTitle, name, }) => ({
|
|
23
|
+
type: "list",
|
|
24
|
+
header: {
|
|
25
|
+
type: "text",
|
|
26
|
+
text: `Olá, sou ${name}`,
|
|
27
|
+
},
|
|
28
|
+
body: {
|
|
29
|
+
text: subtitle,
|
|
30
|
+
},
|
|
31
|
+
footer: {
|
|
32
|
+
text: footer,
|
|
33
|
+
},
|
|
34
|
+
action: {
|
|
35
|
+
button: buttonTitle,
|
|
36
|
+
sections: [
|
|
37
|
+
{
|
|
38
|
+
title: "Ações",
|
|
39
|
+
rows: [
|
|
40
|
+
{
|
|
41
|
+
id: "ticket",
|
|
42
|
+
title: "Abrir Ticket",
|
|
43
|
+
description: "Clique aqui para solicitar um ticket suporte.",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "suporte",
|
|
47
|
+
title: "Atendente",
|
|
48
|
+
description: "Clique aqui para solicitar um atendimento direto",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
exports.ListTeste = ListTeste;
|