@tec.pet/tecpet-sdk 0.0.233 → 0.0.235
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/dist/domain/chatbot/dto/pa.waiting-client.dto.d.ts +8 -0
- package/dist/domain/chatbot/enum/waitingClientEnums/whatsapp-waiting-from-attendant.enum.d.ts +4 -0
- package/dist/domain/chatbot/enum/waitingClientEnums/whatsapp-waiting-from-attendant.enum.js +8 -0
- package/dist/domain/chatbot/index.d.ts +1 -0
- package/dist/domain/chatbot/index.js +1 -0
- package/dist/domain/client/client.service.d.ts +2 -2
- package/dist/domain/client/client.service.js +3 -2
- package/dist/domain/client/dto/pa.create-client.dto.d.ts +7 -0
- package/dist/domain/conversation/conversation.service.d.ts +7 -0
- package/dist/domain/conversation/conversation.service.js +13 -0
- package/dist/domain/conversation/dto/ad-attribution.dto.d.ts +16 -0
- package/dist/domain/conversation/dto/ad-attribution.dto.js +2 -0
- package/dist/domain/conversation/dto/pa.conversation-started.dto.d.ts +15 -0
- package/dist/domain/conversation/dto/pa.conversation-started.dto.js +2 -0
- package/dist/domain/conversation/enum/ad-attribution-type.enum.d.ts +3 -0
- package/dist/domain/conversation/enum/ad-attribution-type.enum.js +7 -0
- package/dist/domain/conversation/enum/attribution-provider.enum.d.ts +5 -0
- package/dist/domain/conversation/enum/attribution-provider.enum.js +9 -0
- package/dist/domain/conversation/enum/conversation-channel.enum.d.ts +4 -0
- package/dist/domain/conversation/enum/conversation-channel.enum.js +8 -0
- package/dist/domain/conversation/index.d.ts +6 -0
- package/dist/domain/conversation/index.js +22 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/package.json +1 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { WhatsappMessageType } from "../enum/waitingClientEnums/whatsapp-message-type.enum";
|
|
2
2
|
import { WhatsappWaitingEndReason } from "../enum/waitingClientEnums/whatsapp-waiting-end-reason.enum";
|
|
3
3
|
import { WhatsappWaitingReason } from "../enum/waitingClientEnums/whatsapp-waiting-reason.enum";
|
|
4
|
+
import { WhatsappWaitingFromAttendant } from "../enum/waitingClientEnums/whatsapp-waiting-from-attendant.enum";
|
|
5
|
+
import { AttributionProvider } from "../../conversation/enum/attribution-provider.enum";
|
|
6
|
+
import { ConversationChannel } from "../../conversation/enum/conversation-channel.enum";
|
|
4
7
|
export interface PaOpenWaitingClientInput {
|
|
5
8
|
sessionId: string;
|
|
6
9
|
phone: string;
|
|
@@ -11,6 +14,11 @@ export interface PaOpenWaitingClientInput {
|
|
|
11
14
|
context?: string | null;
|
|
12
15
|
lastMessagePreview?: string | null;
|
|
13
16
|
lastMessageType?: WhatsappMessageType | null;
|
|
17
|
+
fromBot?: boolean;
|
|
18
|
+
fromAttendant?: WhatsappWaitingFromAttendant | null;
|
|
19
|
+
channel?: ConversationChannel | null;
|
|
20
|
+
provider?: AttributionProvider | null;
|
|
21
|
+
sessionKey?: string | null;
|
|
14
22
|
}
|
|
15
23
|
export interface PaCloseWaitingClientInput {
|
|
16
24
|
sessionId: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WhatsappWaitingFromAttendant = void 0;
|
|
4
|
+
var WhatsappWaitingFromAttendant;
|
|
5
|
+
(function (WhatsappWaitingFromAttendant) {
|
|
6
|
+
WhatsappWaitingFromAttendant["AI"] = "AI";
|
|
7
|
+
WhatsappWaitingFromAttendant["CHATBOT"] = "CHATBOT";
|
|
8
|
+
})(WhatsappWaitingFromAttendant || (exports.WhatsappWaitingFromAttendant = WhatsappWaitingFromAttendant = {}));
|
|
@@ -11,6 +11,7 @@ export * from './dto/pa.waiting-client.dto';
|
|
|
11
11
|
export * from './enum/waitingClientEnums/whatsapp-waiting-reason.enum';
|
|
12
12
|
export * from './enum/waitingClientEnums/whatsapp-waiting-end-reason.enum';
|
|
13
13
|
export * from './enum/waitingClientEnums/whatsapp-message-type.enum';
|
|
14
|
+
export * from './enum/waitingClientEnums/whatsapp-waiting-from-attendant.enum';
|
|
14
15
|
export * from './enum/chatbotActionEnums/chatbot-action-schedule-permission.enum';
|
|
15
16
|
export * from './enum/chatbotActionEnums/chatbot-action-type.enum';
|
|
16
17
|
export * from './enum/chatbotBehaviorEnums/chatbot-inactive-employee-action.enum';
|
|
@@ -27,6 +27,7 @@ __exportStar(require("./dto/pa.waiting-client.dto"), exports);
|
|
|
27
27
|
__exportStar(require("./enum/waitingClientEnums/whatsapp-waiting-reason.enum"), exports);
|
|
28
28
|
__exportStar(require("./enum/waitingClientEnums/whatsapp-waiting-end-reason.enum"), exports);
|
|
29
29
|
__exportStar(require("./enum/waitingClientEnums/whatsapp-message-type.enum"), exports);
|
|
30
|
+
__exportStar(require("./enum/waitingClientEnums/whatsapp-waiting-from-attendant.enum"), exports);
|
|
30
31
|
__exportStar(require("./enum/chatbotActionEnums/chatbot-action-schedule-permission.enum"), exports);
|
|
31
32
|
__exportStar(require("./enum/chatbotActionEnums/chatbot-action-type.enum"), exports);
|
|
32
33
|
__exportStar(require("./enum/chatbotBehaviorEnums/chatbot-inactive-employee-action.enum"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PaClientResponse } from "domain/client/dto/pa.get-client.dto";
|
|
2
2
|
import { HttpClient } from "infra/http/client.http";
|
|
3
|
-
import { PaCreateClientInput } from "./dto/pa.create-client.dto";
|
|
3
|
+
import { PaCreateClientInput, PaCreateClientOptions } from "./dto/pa.create-client.dto";
|
|
4
4
|
import { PaEditClientInput } from "./dto/pa.edit-client.dto";
|
|
5
5
|
import { PaClientSummaryResponse } from "./dto/pa.get-client-summary.dto";
|
|
6
6
|
import { PaExistClientRequest } from "./dto/pa.exist-client.dto";
|
|
@@ -11,7 +11,7 @@ export declare class ClientService {
|
|
|
11
11
|
getByPhone(phone: string, shopId?: number): Promise<PaClientResponse>;
|
|
12
12
|
getById(id: number, shopId?: number): Promise<PaClientResponse>;
|
|
13
13
|
edit(clientId: number, body: PaEditClientInput, shopId: number): Promise<PaClientResponse>;
|
|
14
|
-
create(body: PaCreateClientInput, shopId: number): Promise<PaClientResponse>;
|
|
14
|
+
create(body: PaCreateClientInput, shopId: number, options?: PaCreateClientOptions): Promise<PaClientResponse>;
|
|
15
15
|
summary(clientId: number, shopId: number): Promise<PaClientSummaryResponse>;
|
|
16
16
|
exist(body: PaExistClientRequest, shopId: number): Promise<PaClientResponse>;
|
|
17
17
|
getByExternId(externId: string, integrationShopId: number, shopId: number): Promise<PaClientResponse>;
|
|
@@ -20,8 +20,9 @@ class ClientService {
|
|
|
20
20
|
async edit(clientId, body, shopId) {
|
|
21
21
|
return await this.api.put(`/client/${clientId}`, body, shopId);
|
|
22
22
|
}
|
|
23
|
-
async create(body, shopId) {
|
|
24
|
-
|
|
23
|
+
async create(body, shopId, options) {
|
|
24
|
+
const payload = options ? { ...body, ...options } : body;
|
|
25
|
+
return await this.api.post(`/client`, payload, shopId);
|
|
25
26
|
}
|
|
26
27
|
async summary(clientId, shopId) {
|
|
27
28
|
return await this.api.get(`/client/${clientId}/summary`, {}, shopId);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { AddressDto } from "./pa.get-client.dto";
|
|
2
2
|
import { PersonType } from "../enum/person-type.enum";
|
|
3
|
+
import { AdAttribution } from "../../conversation/dto/ad-attribution.dto";
|
|
4
|
+
import { ConversationChannel } from "../../conversation/enum/conversation-channel.enum";
|
|
3
5
|
export interface PaCreateClientInput {
|
|
4
6
|
name: string;
|
|
5
7
|
address?: AddressDto;
|
|
@@ -13,3 +15,8 @@ export interface PaCreateClientInput {
|
|
|
13
15
|
allowOnChatbot?: boolean;
|
|
14
16
|
chatId?: string;
|
|
15
17
|
}
|
|
18
|
+
export interface PaCreateClientOptions {
|
|
19
|
+
channel?: ConversationChannel | null;
|
|
20
|
+
attribution?: AdAttribution | null;
|
|
21
|
+
sessionKey?: string | null;
|
|
22
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HttpClient } from "infra/http/client.http";
|
|
2
|
+
import { PaConversationStartedInput, PaConversationStartedResponse } from "./dto/pa.conversation-started.dto";
|
|
3
|
+
export declare class ConversationService {
|
|
4
|
+
private readonly api;
|
|
5
|
+
constructor(api: HttpClient);
|
|
6
|
+
started(body: PaConversationStartedInput, shopId: number): Promise<PaConversationStartedResponse>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConversationService = void 0;
|
|
4
|
+
class ConversationService {
|
|
5
|
+
api;
|
|
6
|
+
constructor(api) {
|
|
7
|
+
this.api = api;
|
|
8
|
+
}
|
|
9
|
+
async started(body, shopId) {
|
|
10
|
+
return await this.api.post(`/conversation/started`, body, shopId);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.ConversationService = ConversationService;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AdAttributionType } from "../enum/ad-attribution-type.enum";
|
|
2
|
+
import { AttributionProvider } from "../enum/attribution-provider.enum";
|
|
3
|
+
import { ConversationChannel } from "../enum/conversation-channel.enum";
|
|
4
|
+
export interface AdAttribution {
|
|
5
|
+
provider: AttributionProvider;
|
|
6
|
+
channel?: ConversationChannel | null;
|
|
7
|
+
type?: AdAttributionType | null;
|
|
8
|
+
adId?: string | null;
|
|
9
|
+
ctwaClid?: string | null;
|
|
10
|
+
sourceUrl?: string | null;
|
|
11
|
+
sourceType?: string | null;
|
|
12
|
+
headline?: string | null;
|
|
13
|
+
body?: string | null;
|
|
14
|
+
mediaType?: string | null;
|
|
15
|
+
touchedAt?: Date | string | null;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AttributionProvider } from "../enum/attribution-provider.enum";
|
|
2
|
+
import { ConversationChannel } from "../enum/conversation-channel.enum";
|
|
3
|
+
import { AdAttribution } from "./ad-attribution.dto";
|
|
4
|
+
export interface PaConversationStartedInput {
|
|
5
|
+
sessionKey: string;
|
|
6
|
+
clientId: number;
|
|
7
|
+
channel: ConversationChannel;
|
|
8
|
+
provider: AttributionProvider;
|
|
9
|
+
startedAt: Date | string;
|
|
10
|
+
attribution?: AdAttribution | null;
|
|
11
|
+
}
|
|
12
|
+
export interface PaConversationStartedResponse {
|
|
13
|
+
success: boolean;
|
|
14
|
+
attributionRecorded: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdAttributionType = void 0;
|
|
4
|
+
var AdAttributionType;
|
|
5
|
+
(function (AdAttributionType) {
|
|
6
|
+
AdAttributionType["AD"] = "AD";
|
|
7
|
+
})(AdAttributionType || (exports.AdAttributionType = AdAttributionType = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AttributionProvider = void 0;
|
|
4
|
+
var AttributionProvider;
|
|
5
|
+
(function (AttributionProvider) {
|
|
6
|
+
AttributionProvider["META"] = "META";
|
|
7
|
+
AttributionProvider["UAZAPI"] = "UAZAPI";
|
|
8
|
+
AttributionProvider["ZAPI"] = "ZAPI";
|
|
9
|
+
})(AttributionProvider || (exports.AttributionProvider = AttributionProvider = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConversationChannel = void 0;
|
|
4
|
+
var ConversationChannel;
|
|
5
|
+
(function (ConversationChannel) {
|
|
6
|
+
ConversationChannel["WHATSAPP"] = "WHATSAPP";
|
|
7
|
+
ConversationChannel["INSTAGRAM"] = "INSTAGRAM";
|
|
8
|
+
})(ConversationChannel || (exports.ConversationChannel = ConversationChannel = {}));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './dto/ad-attribution.dto';
|
|
2
|
+
export * from './dto/pa.conversation-started.dto';
|
|
3
|
+
export * from './enum/ad-attribution-type.enum';
|
|
4
|
+
export * from './enum/attribution-provider.enum';
|
|
5
|
+
export * from './enum/conversation-channel.enum';
|
|
6
|
+
export * from './conversation.service';
|
|
@@ -0,0 +1,22 @@
|
|
|
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/ad-attribution.dto"), exports);
|
|
18
|
+
__exportStar(require("./dto/pa.conversation-started.dto"), exports);
|
|
19
|
+
__exportStar(require("./enum/ad-attribution-type.enum"), exports);
|
|
20
|
+
__exportStar(require("./enum/attribution-provider.enum"), exports);
|
|
21
|
+
__exportStar(require("./enum/conversation-channel.enum"), exports);
|
|
22
|
+
__exportStar(require("./conversation.service"), exports);
|
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ import { AISettingsService } from "./domain/aiSettings/aiSettings.service";
|
|
|
28
28
|
import { CampaignService } from "./domain/campaign/campaign.service";
|
|
29
29
|
import { PetPlanService } from "./domain/petPlan/petPlan.service";
|
|
30
30
|
import { NpsService } from "./domain/nps/nps.service";
|
|
31
|
+
import { ConversationService } from "./domain/conversation/conversation.service";
|
|
31
32
|
export declare class TecpetSDK {
|
|
32
33
|
private api;
|
|
33
34
|
client: ClientService;
|
|
@@ -60,6 +61,7 @@ export declare class TecpetSDK {
|
|
|
60
61
|
campaign: CampaignService;
|
|
61
62
|
petPlan: PetPlanService;
|
|
62
63
|
nps: NpsService;
|
|
64
|
+
conversation: ConversationService;
|
|
63
65
|
constructor(baseURL: string, apiKey?: string);
|
|
64
66
|
}
|
|
65
67
|
export * from './domain/availableTimes';
|
|
@@ -95,3 +97,4 @@ export * from './domain/aiSettings';
|
|
|
95
97
|
export * from './domain/campaign';
|
|
96
98
|
export * from './domain/notification';
|
|
97
99
|
export * from './domain/nps';
|
|
100
|
+
export * from './domain/conversation';
|
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ const aiSettings_service_1 = require("./domain/aiSettings/aiSettings.service");
|
|
|
46
46
|
const campaign_service_1 = require("./domain/campaign/campaign.service");
|
|
47
47
|
const petPlan_service_1 = require("./domain/petPlan/petPlan.service");
|
|
48
48
|
const nps_service_1 = require("./domain/nps/nps.service");
|
|
49
|
+
const conversation_service_1 = require("./domain/conversation/conversation.service");
|
|
49
50
|
class TecpetSDK {
|
|
50
51
|
api;
|
|
51
52
|
client;
|
|
@@ -78,6 +79,7 @@ class TecpetSDK {
|
|
|
78
79
|
campaign;
|
|
79
80
|
petPlan;
|
|
80
81
|
nps;
|
|
82
|
+
conversation;
|
|
81
83
|
constructor(baseURL, apiKey) {
|
|
82
84
|
this.api = new client_http_1.HttpClient(baseURL, apiKey);
|
|
83
85
|
this.client = new client_service_1.ClientService(this.api);
|
|
@@ -110,6 +112,7 @@ class TecpetSDK {
|
|
|
110
112
|
this.campaign = new campaign_service_1.CampaignService(this.api);
|
|
111
113
|
this.petPlan = new petPlan_service_1.PetPlanService(this.api);
|
|
112
114
|
this.nps = new nps_service_1.NpsService(this.api);
|
|
115
|
+
this.conversation = new conversation_service_1.ConversationService(this.api);
|
|
113
116
|
}
|
|
114
117
|
}
|
|
115
118
|
exports.TecpetSDK = TecpetSDK;
|
|
@@ -146,3 +149,4 @@ __exportStar(require("./domain/aiSettings"), exports);
|
|
|
146
149
|
__exportStar(require("./domain/campaign"), exports);
|
|
147
150
|
__exportStar(require("./domain/notification"), exports);
|
|
148
151
|
__exportStar(require("./domain/nps"), exports);
|
|
152
|
+
__exportStar(require("./domain/conversation"), exports);
|