@tec.pet/tecpet-sdk 0.0.196 → 0.0.203
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 +12 -5
- package/dist/domain/booking/dto/pa.create-booking.dto.d.ts +1 -0
- package/dist/domain/campaign/campaign.service.d.ts +16 -0
- package/dist/domain/campaign/campaign.service.js +30 -0
- package/dist/domain/campaign/dto/campaign-context.dto.d.ts +19 -0
- package/dist/domain/campaign/dto/campaign-context.dto.js +2 -0
- package/dist/domain/campaign/dto/pa.campaign-opt-out-by-phone.dto.d.ts +15 -0
- package/dist/domain/campaign/dto/pa.campaign-opt-out-by-phone.dto.js +2 -0
- package/dist/domain/campaign/dto/pa.campaign-recipient-action.dto.d.ts +8 -0
- package/dist/domain/campaign/dto/pa.campaign-recipient-action.dto.js +2 -0
- package/dist/domain/campaign/dto/pa.campaign-recipient-answered.dto.d.ts +7 -0
- package/dist/domain/campaign/dto/pa.campaign-recipient-answered.dto.js +2 -0
- package/dist/domain/campaign/dto/pa.campaign-recipient-attribution.dto.d.ts +9 -0
- package/dist/domain/campaign/dto/pa.campaign-recipient-attribution.dto.js +2 -0
- package/dist/domain/campaign/dto/pa.campaign-recipient-opt-out.dto.d.ts +6 -0
- package/dist/domain/campaign/dto/pa.campaign-recipient-opt-out.dto.js +2 -0
- package/dist/domain/campaign/dto/pa.campaign-recipient-survey.dto.d.ts +12 -0
- package/dist/domain/campaign/dto/pa.campaign-recipient-survey.dto.js +2 -0
- package/dist/domain/campaign/enum/campaign-answered-kind.enum.d.ts +4 -0
- package/dist/domain/campaign/enum/campaign-answered-kind.enum.js +8 -0
- package/dist/domain/campaign/enum/campaign-attribution-type.enum.d.ts +6 -0
- package/dist/domain/campaign/enum/campaign-attribution-type.enum.js +10 -0
- package/dist/domain/campaign/enum/campaign-opt-out-source.enum.d.ts +5 -0
- package/dist/domain/campaign/enum/campaign-opt-out-source.enum.js +9 -0
- package/dist/domain/campaign/enum/campaign-recipient-status.enum.d.ts +13 -0
- package/dist/domain/campaign/enum/campaign-recipient-status.enum.js +17 -0
- package/dist/domain/campaign/enum/campaign-reply-kind.enum.d.ts +3 -0
- package/dist/domain/campaign/enum/campaign-reply-kind.enum.js +5 -0
- package/dist/domain/campaign/enum/campaign-survey-kind.enum.d.ts +4 -0
- package/dist/domain/campaign/enum/campaign-survey-kind.enum.js +8 -0
- package/dist/domain/campaign/index.d.ts +13 -0
- package/dist/domain/campaign/index.js +29 -0
- package/dist/domain/chatbot/dto/chatbot-settings.json.d.ts +1 -0
- package/dist/domain/chatbot/dto/pa.change-notification-status.dto.d.ts +8 -0
- package/dist/domain/chatbot/dto/pa.change-notification-status.dto.js +1 -0
- package/dist/domain/chatbot/dto/pa.handle-button-action.dto.d.ts +1 -0
- package/dist/domain/chatbot/dto/pa.start-ai-interaction.dto.d.ts +1 -0
- package/dist/domain/chatbot/enum/chatbotGuidanceEnums/chatbot-guidance-option-type.enum.d.ts +2 -1
- package/dist/domain/chatbot/enum/chatbotGuidanceEnums/chatbot-guidance-option-type.enum.js +1 -0
- package/dist/domain/notification/dto/pa.campaign-notification.dto.d.ts +32 -0
- package/dist/domain/notification/dto/pa.campaign-notification.dto.js +2 -0
- package/dist/domain/notification/enum/notification-type.enum.d.ts +20 -0
- package/dist/domain/notification/enum/notification-type.enum.js +24 -0
- package/dist/domain/notification/index.d.ts +2 -0
- package/dist/domain/notification/index.js +18 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,12 +18,19 @@ bun add @tec.pet/tecpet-sdk
|
|
|
18
18
|
## 📋 Uso
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
|
-
import {
|
|
21
|
+
import { TecpetSDK } from '@tec.pet/tecpet-sdk';
|
|
22
22
|
|
|
23
|
-
const sdk = new
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
const sdk = new TecpetSDK('https://api.tecpet.com/v1', 'sua-api-key');
|
|
24
|
+
|
|
25
|
+
await sdk.client.getById(123, 3096);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
O segundo argumento (`x-shop`) identifica a loja e é opcional nas rotas de chatbot e de campanha:
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { CampaignOptOutSource } from '@tec.pet/tecpet-sdk';
|
|
32
|
+
|
|
33
|
+
await sdk.campaign.optOutRecipient(42, { source: CampaignOptOutSource.BUTTON }, 3096);
|
|
27
34
|
```
|
|
28
35
|
|
|
29
36
|
## 📌 Informações
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HttpClient } from "infra/http/client.http";
|
|
2
|
+
import { PaCampaignOptOutByPhoneInput, PaCampaignOptOutByPhoneResponse } from "./dto/pa.campaign-opt-out-by-phone.dto";
|
|
3
|
+
import { PaCampaignRecipientActionResponse } from "./dto/pa.campaign-recipient-action.dto";
|
|
4
|
+
import { PaCampaignRecipientAnsweredInput } from "./dto/pa.campaign-recipient-answered.dto";
|
|
5
|
+
import { PaCampaignRecipientAttributionInput, PaCampaignRecipientAttributionResponse } from "./dto/pa.campaign-recipient-attribution.dto";
|
|
6
|
+
import { PaCampaignRecipientOptOutInput } from "./dto/pa.campaign-recipient-opt-out.dto";
|
|
7
|
+
import { PaCampaignRecipientSurveyInput, PaCampaignRecipientSurveyResponse } from "./dto/pa.campaign-recipient-survey.dto";
|
|
8
|
+
export declare class CampaignService {
|
|
9
|
+
private readonly api;
|
|
10
|
+
constructor(api: HttpClient);
|
|
11
|
+
optOutRecipient(recipientId: string, body: PaCampaignRecipientOptOutInput, shopId?: number): Promise<PaCampaignRecipientActionResponse>;
|
|
12
|
+
optOutByPhone(body: PaCampaignOptOutByPhoneInput, shopId?: number): Promise<PaCampaignOptOutByPhoneResponse>;
|
|
13
|
+
markRecipientAnswered(recipientId: string, body: PaCampaignRecipientAnsweredInput, shopId?: number): Promise<PaCampaignRecipientActionResponse>;
|
|
14
|
+
attributeRecipientBooking(recipientId: string, body: PaCampaignRecipientAttributionInput, shopId?: number): Promise<PaCampaignRecipientAttributionResponse>;
|
|
15
|
+
submitRecipientSurvey(recipientId: string, body: PaCampaignRecipientSurveyInput, shopId?: number): Promise<PaCampaignRecipientSurveyResponse>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CampaignService = void 0;
|
|
4
|
+
class CampaignService {
|
|
5
|
+
api;
|
|
6
|
+
constructor(api) {
|
|
7
|
+
this.api = api;
|
|
8
|
+
}
|
|
9
|
+
async optOutRecipient(recipientId, body, shopId) {
|
|
10
|
+
const response = await this.api.post(`/campaign/recipient/${recipientId}/opt-out`, body, shopId);
|
|
11
|
+
return response;
|
|
12
|
+
}
|
|
13
|
+
async optOutByPhone(body, shopId) {
|
|
14
|
+
const response = await this.api.post(`/campaign/opt-out-by-phone`, body, shopId);
|
|
15
|
+
return response;
|
|
16
|
+
}
|
|
17
|
+
async markRecipientAnswered(recipientId, body, shopId) {
|
|
18
|
+
const response = await this.api.post(`/campaign/recipient/${recipientId}/answered`, body, shopId);
|
|
19
|
+
return response;
|
|
20
|
+
}
|
|
21
|
+
async attributeRecipientBooking(recipientId, body, shopId) {
|
|
22
|
+
const response = await this.api.post(`/campaign/recipient/${recipientId}/attribution`, body, shopId);
|
|
23
|
+
return response;
|
|
24
|
+
}
|
|
25
|
+
async submitRecipientSurvey(recipientId, body, shopId) {
|
|
26
|
+
const response = await this.api.post(`/campaign/recipient/${recipientId}/survey`, body, shopId);
|
|
27
|
+
return response;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.CampaignService = CampaignService;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ShopSegment } from '../../segment/enum/segment.enum';
|
|
2
|
+
import { CampaignReplyKind } from '../enum/campaign-reply-kind.enum';
|
|
3
|
+
export interface CampaignContextOffer {
|
|
4
|
+
serviceIds: Array<number>;
|
|
5
|
+
serviceNames: Array<string>;
|
|
6
|
+
discountLabel?: string;
|
|
7
|
+
validUntil?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CampaignContext {
|
|
10
|
+
campaignId: string;
|
|
11
|
+
recipientId: string;
|
|
12
|
+
presetType: string;
|
|
13
|
+
goal: string;
|
|
14
|
+
segment: ShopSegment;
|
|
15
|
+
offer?: CampaignContextOffer;
|
|
16
|
+
targetPetIds: Array<number>;
|
|
17
|
+
messageSent: string;
|
|
18
|
+
replyKind: CampaignReplyKind;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CampaignOptOutSource } from '../enum/campaign-opt-out-source.enum';
|
|
2
|
+
export interface PaCampaignOptOutByPhoneInput {
|
|
3
|
+
phone: string;
|
|
4
|
+
ddi?: string;
|
|
5
|
+
source: CampaignOptOutSource;
|
|
6
|
+
date?: Date | string;
|
|
7
|
+
reason?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface PaCampaignOptOutByPhoneResponse {
|
|
10
|
+
success: boolean;
|
|
11
|
+
duplicated: boolean;
|
|
12
|
+
shopId?: number;
|
|
13
|
+
clientId?: number;
|
|
14
|
+
recipientIds?: Array<string>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CampaignAttributionType } from '../enum/campaign-attribution-type.enum';
|
|
2
|
+
import { PaCampaignRecipientActionResponse } from './pa.campaign-recipient-action.dto';
|
|
3
|
+
export interface PaCampaignRecipientAttributionInput {
|
|
4
|
+
bookingId: number;
|
|
5
|
+
}
|
|
6
|
+
export interface PaCampaignRecipientAttributionResponse extends PaCampaignRecipientActionResponse {
|
|
7
|
+
attributionType: CampaignAttributionType;
|
|
8
|
+
attributedValue?: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CampaignSurveyKind } from '../enum/campaign-survey-kind.enum';
|
|
2
|
+
import { PaCampaignRecipientActionResponse } from './pa.campaign-recipient-action.dto';
|
|
3
|
+
export interface PaCampaignRecipientSurveyInput {
|
|
4
|
+
kind: CampaignSurveyKind;
|
|
5
|
+
score: number;
|
|
6
|
+
comment?: string;
|
|
7
|
+
buttonId?: string;
|
|
8
|
+
date?: Date | string;
|
|
9
|
+
}
|
|
10
|
+
export interface PaCampaignRecipientSurveyResponse extends PaCampaignRecipientActionResponse {
|
|
11
|
+
detractor: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CampaignAnsweredKind = void 0;
|
|
4
|
+
var CampaignAnsweredKind;
|
|
5
|
+
(function (CampaignAnsweredKind) {
|
|
6
|
+
CampaignAnsweredKind["BUTTON"] = "BUTTON";
|
|
7
|
+
CampaignAnsweredKind["TEXT"] = "TEXT";
|
|
8
|
+
})(CampaignAnsweredKind || (exports.CampaignAnsweredKind = CampaignAnsweredKind = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CampaignAttributionType = void 0;
|
|
4
|
+
var CampaignAttributionType;
|
|
5
|
+
(function (CampaignAttributionType) {
|
|
6
|
+
CampaignAttributionType["DETERMINISTIC"] = "DETERMINISTIC";
|
|
7
|
+
CampaignAttributionType["CHANNEL_WINDOW"] = "CHANNEL_WINDOW";
|
|
8
|
+
CampaignAttributionType["ASSISTED_WINDOW"] = "ASSISTED_WINDOW";
|
|
9
|
+
CampaignAttributionType["BASELINE"] = "BASELINE";
|
|
10
|
+
})(CampaignAttributionType || (exports.CampaignAttributionType = CampaignAttributionType = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CampaignOptOutSource = void 0;
|
|
4
|
+
var CampaignOptOutSource;
|
|
5
|
+
(function (CampaignOptOutSource) {
|
|
6
|
+
CampaignOptOutSource["BUTTON"] = "BUTTON";
|
|
7
|
+
CampaignOptOutSource["KEYWORD"] = "KEYWORD";
|
|
8
|
+
CampaignOptOutSource["META_PREFERENCE"] = "META_PREFERENCE";
|
|
9
|
+
})(CampaignOptOutSource || (exports.CampaignOptOutSource = CampaignOptOutSource = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum CampaignRecipientStatus {
|
|
2
|
+
PENDING = "PENDING",
|
|
3
|
+
SCHEDULED = "SCHEDULED",
|
|
4
|
+
SENT = "SENT",
|
|
5
|
+
DELIVERED = "DELIVERED",
|
|
6
|
+
READ = "READ",
|
|
7
|
+
ANSWERED = "ANSWERED",
|
|
8
|
+
FAILED = "FAILED",
|
|
9
|
+
CANCELED = "CANCELED",
|
|
10
|
+
SKIPPED_USER_LIMIT = "SKIPPED_USER_LIMIT",
|
|
11
|
+
OPTED_OUT = "OPTED_OUT",
|
|
12
|
+
CONVERTED = "CONVERTED"
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CampaignRecipientStatus = void 0;
|
|
4
|
+
var CampaignRecipientStatus;
|
|
5
|
+
(function (CampaignRecipientStatus) {
|
|
6
|
+
CampaignRecipientStatus["PENDING"] = "PENDING";
|
|
7
|
+
CampaignRecipientStatus["SCHEDULED"] = "SCHEDULED";
|
|
8
|
+
CampaignRecipientStatus["SENT"] = "SENT";
|
|
9
|
+
CampaignRecipientStatus["DELIVERED"] = "DELIVERED";
|
|
10
|
+
CampaignRecipientStatus["READ"] = "READ";
|
|
11
|
+
CampaignRecipientStatus["ANSWERED"] = "ANSWERED";
|
|
12
|
+
CampaignRecipientStatus["FAILED"] = "FAILED";
|
|
13
|
+
CampaignRecipientStatus["CANCELED"] = "CANCELED";
|
|
14
|
+
CampaignRecipientStatus["SKIPPED_USER_LIMIT"] = "SKIPPED_USER_LIMIT";
|
|
15
|
+
CampaignRecipientStatus["OPTED_OUT"] = "OPTED_OUT";
|
|
16
|
+
CampaignRecipientStatus["CONVERTED"] = "CONVERTED";
|
|
17
|
+
})(CampaignRecipientStatus || (exports.CampaignRecipientStatus = CampaignRecipientStatus = {}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CampaignReplyKind = void 0;
|
|
4
|
+
const campaign_answered_kind_enum_1 = require("./campaign-answered-kind.enum");
|
|
5
|
+
exports.CampaignReplyKind = campaign_answered_kind_enum_1.CampaignAnsweredKind;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CampaignSurveyKind = void 0;
|
|
4
|
+
var CampaignSurveyKind;
|
|
5
|
+
(function (CampaignSurveyKind) {
|
|
6
|
+
CampaignSurveyKind["CSAT"] = "CSAT";
|
|
7
|
+
CampaignSurveyKind["NPS"] = "NPS";
|
|
8
|
+
})(CampaignSurveyKind || (exports.CampaignSurveyKind = CampaignSurveyKind = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './dto/campaign-context.dto';
|
|
2
|
+
export * from './dto/pa.campaign-opt-out-by-phone.dto';
|
|
3
|
+
export * from './dto/pa.campaign-recipient-action.dto';
|
|
4
|
+
export * from './dto/pa.campaign-recipient-answered.dto';
|
|
5
|
+
export * from './dto/pa.campaign-recipient-attribution.dto';
|
|
6
|
+
export * from './dto/pa.campaign-recipient-opt-out.dto';
|
|
7
|
+
export * from './dto/pa.campaign-recipient-survey.dto';
|
|
8
|
+
export * from './enum/campaign-answered-kind.enum';
|
|
9
|
+
export * from './enum/campaign-attribution-type.enum';
|
|
10
|
+
export * from './enum/campaign-opt-out-source.enum';
|
|
11
|
+
export * from './enum/campaign-recipient-status.enum';
|
|
12
|
+
export * from './enum/campaign-reply-kind.enum';
|
|
13
|
+
export * from './enum/campaign-survey-kind.enum';
|
|
@@ -0,0 +1,29 @@
|
|
|
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("./dto/campaign-context.dto"), exports);
|
|
18
|
+
__exportStar(require("./dto/pa.campaign-opt-out-by-phone.dto"), exports);
|
|
19
|
+
__exportStar(require("./dto/pa.campaign-recipient-action.dto"), exports);
|
|
20
|
+
__exportStar(require("./dto/pa.campaign-recipient-answered.dto"), exports);
|
|
21
|
+
__exportStar(require("./dto/pa.campaign-recipient-attribution.dto"), exports);
|
|
22
|
+
__exportStar(require("./dto/pa.campaign-recipient-opt-out.dto"), exports);
|
|
23
|
+
__exportStar(require("./dto/pa.campaign-recipient-survey.dto"), exports);
|
|
24
|
+
__exportStar(require("./enum/campaign-answered-kind.enum"), exports);
|
|
25
|
+
__exportStar(require("./enum/campaign-attribution-type.enum"), exports);
|
|
26
|
+
__exportStar(require("./enum/campaign-opt-out-source.enum"), exports);
|
|
27
|
+
__exportStar(require("./enum/campaign-recipient-status.enum"), exports);
|
|
28
|
+
__exportStar(require("./enum/campaign-reply-kind.enum"), exports);
|
|
29
|
+
__exportStar(require("./enum/campaign-survey-kind.enum"), exports);
|
|
@@ -23,13 +23,21 @@ export declare enum NotificationFailReason {
|
|
|
23
23
|
ZAPI_MEDIA_REJECTED = "ZAPI_MEDIA_REJECTED",
|
|
24
24
|
ZAPI_INVALID_PAYLOAD = "ZAPI_INVALID_PAYLOAD",
|
|
25
25
|
ZAPI_UNAVAILABLE = "ZAPI_UNAVAILABLE",
|
|
26
|
+
META_USER_OPT_OUT = "META_USER_OPT_OUT",
|
|
26
27
|
UNKNOWN = "UNKNOWN"
|
|
27
28
|
}
|
|
29
|
+
export interface PaNotificationPricing {
|
|
30
|
+
category?: string;
|
|
31
|
+
billable?: boolean;
|
|
32
|
+
pricingModel?: string;
|
|
33
|
+
type?: string;
|
|
34
|
+
}
|
|
28
35
|
export interface PaChangeNotificationStatusInput {
|
|
29
36
|
status: NotificationStatus;
|
|
30
37
|
date: Date;
|
|
31
38
|
failReason?: string;
|
|
32
39
|
failReasonType?: NotificationFailReason;
|
|
40
|
+
pricing?: PaNotificationPricing;
|
|
33
41
|
}
|
|
34
42
|
export interface PaChangeNotificationStatusResponse {
|
|
35
43
|
success: boolean;
|
|
@@ -28,5 +28,6 @@ var NotificationFailReason;
|
|
|
28
28
|
NotificationFailReason["ZAPI_MEDIA_REJECTED"] = "ZAPI_MEDIA_REJECTED";
|
|
29
29
|
NotificationFailReason["ZAPI_INVALID_PAYLOAD"] = "ZAPI_INVALID_PAYLOAD";
|
|
30
30
|
NotificationFailReason["ZAPI_UNAVAILABLE"] = "ZAPI_UNAVAILABLE";
|
|
31
|
+
NotificationFailReason["META_USER_OPT_OUT"] = "META_USER_OPT_OUT";
|
|
31
32
|
NotificationFailReason["UNKNOWN"] = "UNKNOWN";
|
|
32
33
|
})(NotificationFailReason || (exports.NotificationFailReason = NotificationFailReason = {}));
|
|
@@ -15,4 +15,5 @@ var ChatbotGuidanceOptionTypeEnum;
|
|
|
15
15
|
ChatbotGuidanceOptionTypeEnum["CALL"] = "CALL";
|
|
16
16
|
ChatbotGuidanceOptionTypeEnum["URL"] = "URL";
|
|
17
17
|
ChatbotGuidanceOptionTypeEnum["END"] = "END";
|
|
18
|
+
ChatbotGuidanceOptionTypeEnum["CAMPAIGN_OPT_OUT"] = "CAMPAIGN_OPT_OUT";
|
|
18
19
|
})(ChatbotGuidanceOptionTypeEnum || (exports.ChatbotGuidanceOptionTypeEnum = ChatbotGuidanceOptionTypeEnum = {}));
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CampaignContext } from '../../campaign/dto/campaign-context.dto';
|
|
2
|
+
import { CampaignSurveyKind } from '../../campaign/enum/campaign-survey-kind.enum';
|
|
3
|
+
import { ChatbotGuidanceOptionTypeEnum } from '../../chatbot/enum/chatbotGuidanceEnums/chatbot-guidance-option-type.enum';
|
|
4
|
+
/**
|
|
5
|
+
* Canal de entrega da campanha, espelhando CampaignNotificationDeliveryChannel do tecpet-server.
|
|
6
|
+
* MARKETING_MESSAGES_LITE ainda nao tem produtor no server: e caminho reservado, nao entregue.
|
|
7
|
+
*/
|
|
8
|
+
export type PaCampaignDeliveryChannel = 'CLOUD_API' | 'MARKETING_MESSAGES_LITE';
|
|
9
|
+
export interface PaCampaignNotificationButtonDto {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
action: ChatbotGuidanceOptionTypeEnum;
|
|
13
|
+
/** Frase em primeira pessoa que o clique envia. Espelha CampaignNotificationButtonDto.payload. */
|
|
14
|
+
payload?: string;
|
|
15
|
+
/** Nota da pesquisa CSAT/NPS carregada pelo botao. */
|
|
16
|
+
score?: number;
|
|
17
|
+
surveyKind?: CampaignSurveyKind;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Espelha CampaignNotificationBlockDto do tecpet-server
|
|
21
|
+
* (src/models/notification/dto/chatbot-notification.dto.ts).
|
|
22
|
+
* Quem tipar um consumidor por aqui precisa enxergar o bloco inteiro, senao perde
|
|
23
|
+
* o contexto da campanha e os botoes de nota em silencio.
|
|
24
|
+
*/
|
|
25
|
+
export interface PaCampaignNotificationDto {
|
|
26
|
+
id: string;
|
|
27
|
+
recipientId: string;
|
|
28
|
+
payload: string;
|
|
29
|
+
buttons: Array<PaCampaignNotificationButtonDto>;
|
|
30
|
+
deliveryChannel?: PaCampaignDeliveryChannel;
|
|
31
|
+
context?: CampaignContext;
|
|
32
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare enum NotificationType {
|
|
2
|
+
BOOKING_CREATION = "BOOKING_CREATION",
|
|
3
|
+
BOOKING_CONFIRMATION = "BOOKING_CONFIRMATION",
|
|
4
|
+
BOOKING_REMINDER = "BOOKING_REMINDER",
|
|
5
|
+
BOOKING_STATUS_DONE = "BOOKING_STATUS_DONE",
|
|
6
|
+
BOOKING_STATUS_RECEIVED = "BOOKING_STATUS_RECEIVED",
|
|
7
|
+
BOOKING_STATUS_DELIVERED = "BOOKING_STATUS_DELIVERED",
|
|
8
|
+
FOLLOW_UP = "FOLLOW_UP",
|
|
9
|
+
PET_CARE_ACTIVITY = "PET_CARE_ACTIVITY",
|
|
10
|
+
PET_CARE_MEDIA = "PET_CARE_MEDIA",
|
|
11
|
+
CLIENT_BIRTHDAY = "CLIENT_BIRTHDAY",
|
|
12
|
+
PET_BIRTHDAY = "PET_BIRTHDAY",
|
|
13
|
+
INVOICE_SEND = "INVOICE_SEND",
|
|
14
|
+
SELECTED_INVOICES = "SELECTED_INVOICES",
|
|
15
|
+
CLIENT_REGISTER = "CLIENT_REGISTER",
|
|
16
|
+
PAY_INVOICE_VOUCHER = "PAY_INVOICE_VOUCHER",
|
|
17
|
+
AUTOMATION = "AUTOMATION",
|
|
18
|
+
PET_CARE_DOCUMENT = "PET_CARE_DOCUMENT",
|
|
19
|
+
CAMPAIGN = "CAMPAIGN"
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationType = void 0;
|
|
4
|
+
var NotificationType;
|
|
5
|
+
(function (NotificationType) {
|
|
6
|
+
NotificationType["BOOKING_CREATION"] = "BOOKING_CREATION";
|
|
7
|
+
NotificationType["BOOKING_CONFIRMATION"] = "BOOKING_CONFIRMATION";
|
|
8
|
+
NotificationType["BOOKING_REMINDER"] = "BOOKING_REMINDER";
|
|
9
|
+
NotificationType["BOOKING_STATUS_DONE"] = "BOOKING_STATUS_DONE";
|
|
10
|
+
NotificationType["BOOKING_STATUS_RECEIVED"] = "BOOKING_STATUS_RECEIVED";
|
|
11
|
+
NotificationType["BOOKING_STATUS_DELIVERED"] = "BOOKING_STATUS_DELIVERED";
|
|
12
|
+
NotificationType["FOLLOW_UP"] = "FOLLOW_UP";
|
|
13
|
+
NotificationType["PET_CARE_ACTIVITY"] = "PET_CARE_ACTIVITY";
|
|
14
|
+
NotificationType["PET_CARE_MEDIA"] = "PET_CARE_MEDIA";
|
|
15
|
+
NotificationType["CLIENT_BIRTHDAY"] = "CLIENT_BIRTHDAY";
|
|
16
|
+
NotificationType["PET_BIRTHDAY"] = "PET_BIRTHDAY";
|
|
17
|
+
NotificationType["INVOICE_SEND"] = "INVOICE_SEND";
|
|
18
|
+
NotificationType["SELECTED_INVOICES"] = "SELECTED_INVOICES";
|
|
19
|
+
NotificationType["CLIENT_REGISTER"] = "CLIENT_REGISTER";
|
|
20
|
+
NotificationType["PAY_INVOICE_VOUCHER"] = "PAY_INVOICE_VOUCHER";
|
|
21
|
+
NotificationType["AUTOMATION"] = "AUTOMATION";
|
|
22
|
+
NotificationType["PET_CARE_DOCUMENT"] = "PET_CARE_DOCUMENT";
|
|
23
|
+
NotificationType["CAMPAIGN"] = "CAMPAIGN";
|
|
24
|
+
})(NotificationType || (exports.NotificationType = NotificationType = {}));
|
|
@@ -0,0 +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("./enum/notification-type.enum"), exports);
|
|
18
|
+
__exportStar(require("./dto/pa.campaign-notification.dto"), exports);
|
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { CepService } from "./domain/cep/cep.service";
|
|
|
25
25
|
import { ServiceCapacityService } from "./domain/serviceCapacity/serviceCapacity.service";
|
|
26
26
|
import { WhatsappEventService } from "./domain/whatsappEvent/whatsappEvent.service";
|
|
27
27
|
import { AISettingsService } from "./domain/aiSettings/aiSettings.service";
|
|
28
|
+
import { CampaignService } from "./domain/campaign/campaign.service";
|
|
28
29
|
export declare class TecpetSDK {
|
|
29
30
|
private api;
|
|
30
31
|
client: ClientService;
|
|
@@ -54,6 +55,7 @@ export declare class TecpetSDK {
|
|
|
54
55
|
serviceCapacity: ServiceCapacityService;
|
|
55
56
|
whatsappEvent: WhatsappEventService;
|
|
56
57
|
aiSettings: AISettingsService;
|
|
58
|
+
campaign: CampaignService;
|
|
57
59
|
constructor(baseURL: string, apiKey?: string);
|
|
58
60
|
}
|
|
59
61
|
export * from './domain/availableTimes';
|
|
@@ -86,3 +88,5 @@ export * from './domain/petPlan';
|
|
|
86
88
|
export * from './domain/chain';
|
|
87
89
|
export * from './domain/whatsappEvent';
|
|
88
90
|
export * from './domain/aiSettings';
|
|
91
|
+
export * from './domain/campaign';
|
|
92
|
+
export * from './domain/notification';
|
package/dist/index.js
CHANGED
|
@@ -43,6 +43,7 @@ const cep_service_1 = require("./domain/cep/cep.service");
|
|
|
43
43
|
const serviceCapacity_service_1 = require("./domain/serviceCapacity/serviceCapacity.service");
|
|
44
44
|
const whatsappEvent_service_1 = require("./domain/whatsappEvent/whatsappEvent.service");
|
|
45
45
|
const aiSettings_service_1 = require("./domain/aiSettings/aiSettings.service");
|
|
46
|
+
const campaign_service_1 = require("./domain/campaign/campaign.service");
|
|
46
47
|
class TecpetSDK {
|
|
47
48
|
api;
|
|
48
49
|
client;
|
|
@@ -72,6 +73,7 @@ class TecpetSDK {
|
|
|
72
73
|
serviceCapacity;
|
|
73
74
|
whatsappEvent;
|
|
74
75
|
aiSettings;
|
|
76
|
+
campaign;
|
|
75
77
|
constructor(baseURL, apiKey) {
|
|
76
78
|
this.api = new client_http_1.HttpClient(baseURL, apiKey);
|
|
77
79
|
this.client = new client_service_1.ClientService(this.api);
|
|
@@ -101,6 +103,7 @@ class TecpetSDK {
|
|
|
101
103
|
this.serviceCapacity = new serviceCapacity_service_1.ServiceCapacityService(this.api);
|
|
102
104
|
this.whatsappEvent = new whatsappEvent_service_1.WhatsappEventService(this.api);
|
|
103
105
|
this.aiSettings = new aiSettings_service_1.AISettingsService(this.api);
|
|
106
|
+
this.campaign = new campaign_service_1.CampaignService(this.api);
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
109
|
exports.TecpetSDK = TecpetSDK;
|
|
@@ -134,3 +137,5 @@ __exportStar(require("./domain/petPlan"), exports);
|
|
|
134
137
|
__exportStar(require("./domain/chain"), exports);
|
|
135
138
|
__exportStar(require("./domain/whatsappEvent"), exports);
|
|
136
139
|
__exportStar(require("./domain/aiSettings"), exports);
|
|
140
|
+
__exportStar(require("./domain/campaign"), exports);
|
|
141
|
+
__exportStar(require("./domain/notification"), exports);
|