@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.
- 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 +44 -44
- package/dist/interfaces/IApiMetaConfig.d.ts +3 -0
- package/dist/interfaces/IApiMetaConfig.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 -45
- 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/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 +6 -6
- package/dist/useCases/index.js +16 -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 -62
- package/dist/useCases/message/whatsappResponse.js +405 -405
- 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/README.md
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
# SDK MICROSSERVIÇO SECRETARIA NATY / META
|
|
2
|
-
|
|
3
|
-
## `_UNDER DEVELOPMENT_ `
|
|
4
|
-
|
|
5
|
-
<!-- `(Will not work until March, please wait the Release)` -->
|
|
6
|
-
|
|
7
|
-
<!-- ## HOW WILL WORK -->
|
|
8
|
-
|
|
9
|
-
##### First we will import and Initialize the sdk package
|
|
10
|
-
|
|
11
|
-
1. importing the package
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
import SDKMeta from "NatyMeta"
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
2. initialize the class
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
const SDK = new NatyMeta()
|
|
21
|
-
// you can use new sdk(`YOUR-APP-TOKEN`) to connect right on the class creation
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
3. connect your app token (if you dont use your token on class creation)
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
const connectSDK = await SDK.connect( {apptoken: { `YOUR-APP-TOKEN` } } )
|
|
28
|
-
|
|
29
|
-
if(connectSDK.isError) throw new Error(connectSDK.isError.message)
|
|
30
|
-
|
|
31
|
-
console.log(connectSDK.isSuccess)
|
|
32
|
-
// Do what you need with the data... (connectSDK.isSuccess)
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
4. connect your app token (if you dont use your token on class creation)
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
SDK.on('message', (res) => {
|
|
39
|
-
res.sendTextMessage("teste");
|
|
40
|
-
});
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
3. than set your application context to use all the individual classes
|
|
44
|
-
|
|
45
|
-
#### In this example:
|
|
46
|
-
|
|
47
|
-
- Retun of any Promise is {isSuccess:AuthReturnType, isError:ErrorHandlingType}
|
|
48
|
-
- If successed method (like the SDK.connect example too),
|
|
49
|
-
the sdk will abstract and will handle properly with the token for you,
|
|
50
|
-
the token will be automatic joined into axios instance header
|
|
51
|
-
- ErrorHandling type { code: number, message: string | Object }
|
|
52
|
-
- On the exemple, we are using "throw new Error" on every ErrorHandling to
|
|
53
|
-
stop and handle it on a simple way, but u can work at your way like
|
|
54
|
-
returning an alert using some alert lib like toastfy for the user.
|
|
55
|
-
|
|
56
|
-
<!-- ## Click on [NatyMeta](https://whatsapp.secretarianaty.com) for more information. -->
|
|
57
|
-
|
|
58
|
-
##### (The link will be avalible soon)
|
|
59
|
-
|
|
60
|
-
###### All Rights Reserved for Ikiradev
|
|
1
|
+
# SDK MICROSSERVIÇO SECRETARIA NATY / META
|
|
2
|
+
|
|
3
|
+
## `_UNDER DEVELOPMENT_ `
|
|
4
|
+
|
|
5
|
+
<!-- `(Will not work until March, please wait the Release)` -->
|
|
6
|
+
|
|
7
|
+
<!-- ## HOW WILL WORK -->
|
|
8
|
+
|
|
9
|
+
##### First we will import and Initialize the sdk package
|
|
10
|
+
|
|
11
|
+
1. importing the package
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
import SDKMeta from "NatyMeta"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. initialize the class
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
const SDK = new NatyMeta()
|
|
21
|
+
// you can use new sdk(`YOUR-APP-TOKEN`) to connect right on the class creation
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
3. connect your app token (if you dont use your token on class creation)
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
const connectSDK = await SDK.connect( {apptoken: { `YOUR-APP-TOKEN` } } )
|
|
28
|
+
|
|
29
|
+
if(connectSDK.isError) throw new Error(connectSDK.isError.message)
|
|
30
|
+
|
|
31
|
+
console.log(connectSDK.isSuccess)
|
|
32
|
+
// Do what you need with the data... (connectSDK.isSuccess)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
4. connect your app token (if you dont use your token on class creation)
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
SDK.on('message', (res) => {
|
|
39
|
+
res.sendTextMessage("teste");
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
3. than set your application context to use all the individual classes
|
|
44
|
+
|
|
45
|
+
#### In this example:
|
|
46
|
+
|
|
47
|
+
- Retun of any Promise is {isSuccess:AuthReturnType, isError:ErrorHandlingType}
|
|
48
|
+
- If successed method (like the SDK.connect example too),
|
|
49
|
+
the sdk will abstract and will handle properly with the token for you,
|
|
50
|
+
the token will be automatic joined into axios instance header
|
|
51
|
+
- ErrorHandling type { code: number, message: string | Object }
|
|
52
|
+
- On the exemple, we are using "throw new Error" on every ErrorHandling to
|
|
53
|
+
stop and handle it on a simple way, but u can work at your way like
|
|
54
|
+
returning an alert using some alert lib like toastfy for the user.
|
|
55
|
+
|
|
56
|
+
<!-- ## Click on [NatyMeta](https://whatsapp.secretarianaty.com) for more information. -->
|
|
57
|
+
|
|
58
|
+
##### (The link will be avalible soon)
|
|
59
|
+
|
|
60
|
+
###### All Rights Reserved for Ikiradev
|
package/dist/Entities/Logs.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { typeLog } from "../types/logs";
|
|
2
|
-
export declare class LogsEntity {
|
|
3
|
-
id: string;
|
|
4
|
-
_id: string;
|
|
5
|
-
type: typeLog;
|
|
6
|
-
owner?: string;
|
|
7
|
-
url?: string;
|
|
8
|
-
method?: string;
|
|
9
|
-
remoteIP?: string;
|
|
10
|
-
errorCode?: string;
|
|
11
|
-
objectData?: object;
|
|
12
|
-
isActive: boolean;
|
|
13
|
-
updatedAt: string;
|
|
14
|
-
createdAt: string;
|
|
15
|
-
constructor(props: Omit<LogsEntity, "_id" | "updatedAt" | "createdAt" | "id" | "isActive">, id?: string);
|
|
16
|
-
}
|
|
1
|
+
import { typeLog } from "../types/logs";
|
|
2
|
+
export declare class LogsEntity {
|
|
3
|
+
id: string;
|
|
4
|
+
_id: string;
|
|
5
|
+
type: typeLog;
|
|
6
|
+
owner?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
method?: string;
|
|
9
|
+
remoteIP?: string;
|
|
10
|
+
errorCode?: string;
|
|
11
|
+
objectData?: object;
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
constructor(props: Omit<LogsEntity, "_id" | "updatedAt" | "createdAt" | "id" | "isActive">, id?: string);
|
|
16
|
+
}
|
package/dist/Entities/Logs.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LogsEntity = void 0;
|
|
4
|
-
const genUuid_1 = require("../utils/genUuid");
|
|
5
|
-
class LogsEntity {
|
|
6
|
-
constructor(props, id) {
|
|
7
|
-
this.isActive = true;
|
|
8
|
-
if (!id)
|
|
9
|
-
this.id = (0, genUuid_1.genId)("LOG");
|
|
10
|
-
Object.assign(this, props);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.LogsEntity = LogsEntity;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogsEntity = void 0;
|
|
4
|
+
const genUuid_1 = require("../utils/genUuid");
|
|
5
|
+
class LogsEntity {
|
|
6
|
+
constructor(props, id) {
|
|
7
|
+
this.isActive = true;
|
|
8
|
+
if (!id)
|
|
9
|
+
this.id = (0, genUuid_1.genId)("LOG");
|
|
10
|
+
Object.assign(this, props);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.LogsEntity = LogsEntity;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export declare class ConnectionEntity {
|
|
2
|
-
id: string;
|
|
3
|
-
companyId: string;
|
|
4
|
-
appId: string;
|
|
5
|
-
appSecret: string;
|
|
6
|
-
accessToken: string;
|
|
7
|
-
businessId: string;
|
|
8
|
-
phoneNumberId: string;
|
|
9
|
-
phoneNumber: number;
|
|
10
|
-
isActive: boolean;
|
|
11
|
-
_id: string;
|
|
12
|
-
updatedAt: string;
|
|
13
|
-
createdAt: string;
|
|
14
|
-
constructor(props: Omit<ConnectionEntity, "_id" | "updatedAt" | "createdAt" | "id" | "isActive">, id?: string);
|
|
15
|
-
}
|
|
1
|
+
export declare class ConnectionEntity {
|
|
2
|
+
id: string;
|
|
3
|
+
companyId: string;
|
|
4
|
+
appId: string;
|
|
5
|
+
appSecret: string;
|
|
6
|
+
accessToken: string;
|
|
7
|
+
businessId: string;
|
|
8
|
+
phoneNumberId: string;
|
|
9
|
+
phoneNumber: number;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
_id: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
constructor(props: Omit<ConnectionEntity, "_id" | "updatedAt" | "createdAt" | "id" | "isActive">, id?: string);
|
|
15
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConnectionEntity = void 0;
|
|
4
|
-
const genUuid_1 = require("../utils/genUuid");
|
|
5
|
-
class ConnectionEntity {
|
|
6
|
-
constructor(props, id) {
|
|
7
|
-
this.isActive = true;
|
|
8
|
-
if (!id)
|
|
9
|
-
this.id = (0, genUuid_1.genId)("connection");
|
|
10
|
-
Object.assign(this, props);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.ConnectionEntity = ConnectionEntity;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectionEntity = void 0;
|
|
4
|
+
const genUuid_1 = require("../utils/genUuid");
|
|
5
|
+
class ConnectionEntity {
|
|
6
|
+
constructor(props, id) {
|
|
7
|
+
this.isActive = true;
|
|
8
|
+
if (!id)
|
|
9
|
+
this.id = (0, genUuid_1.genId)("connection");
|
|
10
|
+
Object.assign(this, props);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.ConnectionEntity = ConnectionEntity;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare class ErrorLogEntity {
|
|
2
|
-
id: string;
|
|
3
|
-
connectionId: string;
|
|
4
|
-
errorFrom: string;
|
|
5
|
-
statusCode: number;
|
|
6
|
-
error: Error;
|
|
7
|
-
isActive: boolean;
|
|
8
|
-
constructor(props: Omit<ErrorLogEntity, "id" | "isActive">, id?: string);
|
|
9
|
-
}
|
|
1
|
+
export declare class ErrorLogEntity {
|
|
2
|
+
id: string;
|
|
3
|
+
connectionId: string;
|
|
4
|
+
errorFrom: string;
|
|
5
|
+
statusCode: number;
|
|
6
|
+
error: Error;
|
|
7
|
+
isActive: boolean;
|
|
8
|
+
constructor(props: Omit<ErrorLogEntity, "id" | "isActive">, id?: string);
|
|
9
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorLogEntity = void 0;
|
|
4
|
-
const genUuid_1 = require("../utils/genUuid");
|
|
5
|
-
class ErrorLogEntity {
|
|
6
|
-
constructor(props, id) {
|
|
7
|
-
this.isActive = true;
|
|
8
|
-
if (!id)
|
|
9
|
-
this.id = (0, genUuid_1.genId)("error");
|
|
10
|
-
Object.assign(this, props);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.ErrorLogEntity = ErrorLogEntity;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorLogEntity = void 0;
|
|
4
|
+
const genUuid_1 = require("../utils/genUuid");
|
|
5
|
+
class ErrorLogEntity {
|
|
6
|
+
constructor(props, id) {
|
|
7
|
+
this.isActive = true;
|
|
8
|
+
if (!id)
|
|
9
|
+
this.id = (0, genUuid_1.genId)("error");
|
|
10
|
+
Object.assign(this, props);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.ErrorLogEntity = ErrorLogEntity;
|
package/dist/Entities/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./Logs";
|
|
2
|
-
export * from "./connection";
|
|
3
|
-
export * from "./errorLogs";
|
|
4
|
-
export * from "./webhooks";
|
|
5
|
-
export * from "./whatsappMessage";
|
|
1
|
+
export * from "./Logs";
|
|
2
|
+
export * from "./connection";
|
|
3
|
+
export * from "./errorLogs";
|
|
4
|
+
export * from "./webhooks";
|
|
5
|
+
export * from "./whatsappMessage";
|
package/dist/Entities/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
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("./connection"), exports);
|
|
19
|
-
__exportStar(require("./errorLogs"), exports);
|
|
20
|
-
__exportStar(require("./webhooks"), exports);
|
|
21
|
-
__exportStar(require("./whatsappMessage"), 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("./connection"), exports);
|
|
19
|
+
__exportStar(require("./errorLogs"), exports);
|
|
20
|
+
__exportStar(require("./webhooks"), exports);
|
|
21
|
+
__exportStar(require("./whatsappMessage"), exports);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare class MessageEntity {
|
|
2
|
-
id: string;
|
|
3
|
-
companyId: string;
|
|
4
|
-
phoneNumberId: string;
|
|
5
|
-
sender: string;
|
|
6
|
-
message: [object];
|
|
7
|
-
isActive: boolean;
|
|
8
|
-
constructor(props: Omit<MessageEntity, "id" | "isActive">, id?: string);
|
|
9
|
-
}
|
|
1
|
+
export declare class MessageEntity {
|
|
2
|
+
id: string;
|
|
3
|
+
companyId: string;
|
|
4
|
+
phoneNumberId: string;
|
|
5
|
+
sender: string;
|
|
6
|
+
message: [object];
|
|
7
|
+
isActive: boolean;
|
|
8
|
+
constructor(props: Omit<MessageEntity, "id" | "isActive">, id?: string);
|
|
9
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MessageEntity = void 0;
|
|
4
|
-
const genUuid_1 = require("../utils/genUuid");
|
|
5
|
-
class MessageEntity {
|
|
6
|
-
constructor(props, id) {
|
|
7
|
-
this.isActive = true;
|
|
8
|
-
if (!id)
|
|
9
|
-
this.id = (0, genUuid_1.genId)("connection");
|
|
10
|
-
Object.assign(this, props);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.MessageEntity = MessageEntity;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageEntity = void 0;
|
|
4
|
+
const genUuid_1 = require("../utils/genUuid");
|
|
5
|
+
class MessageEntity {
|
|
6
|
+
constructor(props, id) {
|
|
7
|
+
this.isActive = true;
|
|
8
|
+
if (!id)
|
|
9
|
+
this.id = (0, genUuid_1.genId)("connection");
|
|
10
|
+
Object.assign(this, props);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.MessageEntity = MessageEntity;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export declare class WebhooksEntity {
|
|
2
|
-
id: string;
|
|
3
|
-
companyId: string;
|
|
4
|
-
connection: {
|
|
5
|
-
url: string;
|
|
6
|
-
active: boolean;
|
|
7
|
-
};
|
|
8
|
-
messages: {
|
|
9
|
-
url: string;
|
|
10
|
-
active: boolean;
|
|
11
|
-
};
|
|
12
|
-
isActive: boolean;
|
|
13
|
-
_id: string;
|
|
14
|
-
updatedAt: string;
|
|
15
|
-
createdAt: string;
|
|
16
|
-
constructor(props: Omit<WebhooksEntity, "_id" | "updatedAt" | "createdAt" | "id" | "isActive">, id?: string);
|
|
17
|
-
}
|
|
1
|
+
export declare class WebhooksEntity {
|
|
2
|
+
id: string;
|
|
3
|
+
companyId: string;
|
|
4
|
+
connection: {
|
|
5
|
+
url: string;
|
|
6
|
+
active: boolean;
|
|
7
|
+
};
|
|
8
|
+
messages: {
|
|
9
|
+
url: string;
|
|
10
|
+
active: boolean;
|
|
11
|
+
};
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
_id: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
constructor(props: Omit<WebhooksEntity, "_id" | "updatedAt" | "createdAt" | "id" | "isActive">, id?: string);
|
|
17
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebhooksEntity = void 0;
|
|
4
|
-
const genUuid_1 = require("../utils/genUuid");
|
|
5
|
-
class WebhooksEntity {
|
|
6
|
-
constructor(props, id) {
|
|
7
|
-
this.isActive = true;
|
|
8
|
-
if (!id)
|
|
9
|
-
this.id = (0, genUuid_1.genId)("queue");
|
|
10
|
-
Object.assign(this, props);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.WebhooksEntity = WebhooksEntity;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebhooksEntity = void 0;
|
|
4
|
+
const genUuid_1 = require("../utils/genUuid");
|
|
5
|
+
class WebhooksEntity {
|
|
6
|
+
constructor(props, id) {
|
|
7
|
+
this.isActive = true;
|
|
8
|
+
if (!id)
|
|
9
|
+
this.id = (0, genUuid_1.genId)("queue");
|
|
10
|
+
Object.assign(this, props);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.WebhooksEntity = WebhooksEntity;
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
export declare class WhatsappMessage {
|
|
2
|
-
object: "whatsapp_business_account";
|
|
3
|
-
entry: entryType[];
|
|
4
|
-
constructor(props: WhatsappMessage);
|
|
5
|
-
}
|
|
6
|
-
type entryType = {
|
|
7
|
-
id: string;
|
|
8
|
-
changes: changes[];
|
|
9
|
-
};
|
|
10
|
-
type changes = {
|
|
11
|
-
value: {
|
|
12
|
-
messaging_product: "whatsapp";
|
|
13
|
-
metadata: {
|
|
14
|
-
display_phone_number: string;
|
|
15
|
-
phone_number_id: string;
|
|
16
|
-
};
|
|
17
|
-
contacts: contactType[];
|
|
18
|
-
messages: messageType[];
|
|
19
|
-
statuses?: statusesType;
|
|
20
|
-
};
|
|
21
|
-
field: "messages";
|
|
22
|
-
};
|
|
23
|
-
type contactType = {
|
|
24
|
-
profile: {
|
|
25
|
-
name: string;
|
|
26
|
-
};
|
|
27
|
-
wa_id: string;
|
|
28
|
-
};
|
|
29
|
-
type messageType = {
|
|
30
|
-
from: string;
|
|
31
|
-
id: string;
|
|
32
|
-
timestamp: string;
|
|
33
|
-
text: {
|
|
34
|
-
body: string;
|
|
35
|
-
};
|
|
36
|
-
type: "text" | "interactive";
|
|
37
|
-
interactive?: {
|
|
38
|
-
button_reply?: {
|
|
39
|
-
id: string;
|
|
40
|
-
};
|
|
41
|
-
list_reply?: {
|
|
42
|
-
id: string;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
type statusesType = {
|
|
47
|
-
id: string;
|
|
48
|
-
status: string;
|
|
49
|
-
timestamp: string;
|
|
50
|
-
recipient_id: string;
|
|
51
|
-
conversation: {
|
|
52
|
-
id: string;
|
|
53
|
-
origin: {
|
|
54
|
-
type: string;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
pricing: {
|
|
58
|
-
billable: true;
|
|
59
|
-
pricing_model: string;
|
|
60
|
-
category: string;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
export {};
|
|
1
|
+
export declare class WhatsappMessage {
|
|
2
|
+
object: "whatsapp_business_account";
|
|
3
|
+
entry: entryType[];
|
|
4
|
+
constructor(props: WhatsappMessage);
|
|
5
|
+
}
|
|
6
|
+
type entryType = {
|
|
7
|
+
id: string;
|
|
8
|
+
changes: changes[];
|
|
9
|
+
};
|
|
10
|
+
type changes = {
|
|
11
|
+
value: {
|
|
12
|
+
messaging_product: "whatsapp";
|
|
13
|
+
metadata: {
|
|
14
|
+
display_phone_number: string;
|
|
15
|
+
phone_number_id: string;
|
|
16
|
+
};
|
|
17
|
+
contacts: contactType[];
|
|
18
|
+
messages: messageType[];
|
|
19
|
+
statuses?: statusesType;
|
|
20
|
+
};
|
|
21
|
+
field: "messages";
|
|
22
|
+
};
|
|
23
|
+
type contactType = {
|
|
24
|
+
profile: {
|
|
25
|
+
name: string;
|
|
26
|
+
};
|
|
27
|
+
wa_id: string;
|
|
28
|
+
};
|
|
29
|
+
type messageType = {
|
|
30
|
+
from: string;
|
|
31
|
+
id: string;
|
|
32
|
+
timestamp: string;
|
|
33
|
+
text: {
|
|
34
|
+
body: string;
|
|
35
|
+
};
|
|
36
|
+
type: "text" | "interactive";
|
|
37
|
+
interactive?: {
|
|
38
|
+
button_reply?: {
|
|
39
|
+
id: string;
|
|
40
|
+
};
|
|
41
|
+
list_reply?: {
|
|
42
|
+
id: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
type statusesType = {
|
|
47
|
+
id: string;
|
|
48
|
+
status: string;
|
|
49
|
+
timestamp: string;
|
|
50
|
+
recipient_id: string;
|
|
51
|
+
conversation: {
|
|
52
|
+
id: string;
|
|
53
|
+
origin: {
|
|
54
|
+
type: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
pricing: {
|
|
58
|
+
billable: true;
|
|
59
|
+
pricing_model: string;
|
|
60
|
+
category: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WhatsappMessage = void 0;
|
|
4
|
-
class WhatsappMessage {
|
|
5
|
-
constructor(props) {
|
|
6
|
-
Object.assign(this, props);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
exports.WhatsappMessage = WhatsappMessage;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WhatsappMessage = void 0;
|
|
4
|
+
class WhatsappMessage {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
Object.assign(this, props);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.WhatsappMessage = WhatsappMessage;
|
package/dist/Errors/Either.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export type isError<T> = {
|
|
2
|
-
isError: T;
|
|
3
|
-
isSuccess?: never;
|
|
4
|
-
};
|
|
5
|
-
export type isSuccess<U> = {
|
|
6
|
-
isError?: never;
|
|
7
|
-
isSuccess: U;
|
|
8
|
-
};
|
|
9
|
-
export type Either<T, U> = NonNullable<isError<T> | isSuccess<U>>;
|
|
10
|
-
export type UnwrapEither = <T, U>(e: Either<T, U>) => NonNullable<T | U>;
|
|
11
|
-
export declare const unwrapEither: UnwrapEither;
|
|
12
|
-
export declare const isError: <T, U>(e: Either<T, U>) => e is isError<T>;
|
|
13
|
-
export declare const isSuccess: <T, U>(e: Either<T, U>) => e is isSuccess<U>;
|
|
14
|
-
export declare const throwError: <T>(value: T) => isError<T>;
|
|
15
|
-
export declare const throwSuccess: <U>(value: U) => isSuccess<U>;
|
|
1
|
+
export type isError<T> = {
|
|
2
|
+
isError: T;
|
|
3
|
+
isSuccess?: never;
|
|
4
|
+
};
|
|
5
|
+
export type isSuccess<U> = {
|
|
6
|
+
isError?: never;
|
|
7
|
+
isSuccess: U;
|
|
8
|
+
};
|
|
9
|
+
export type Either<T, U> = NonNullable<isError<T> | isSuccess<U>>;
|
|
10
|
+
export type UnwrapEither = <T, U>(e: Either<T, U>) => NonNullable<T | U>;
|
|
11
|
+
export declare const unwrapEither: UnwrapEither;
|
|
12
|
+
export declare const isError: <T, U>(e: Either<T, U>) => e is isError<T>;
|
|
13
|
+
export declare const isSuccess: <T, U>(e: Either<T, U>) => e is isSuccess<U>;
|
|
14
|
+
export declare const throwError: <T>(value: T) => isError<T>;
|
|
15
|
+
export declare const throwSuccess: <U>(value: U) => isSuccess<U>;
|