@tec.pet/tecpet-sdk 0.0.231 → 0.0.232

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.
@@ -14,7 +14,19 @@ export declare enum NotificationType {
14
14
  SELECTED_INVOICES = "SELECTED_INVOICES",
15
15
  CLIENT_REGISTER = "CLIENT_REGISTER",
16
16
  PAY_INVOICE_VOUCHER = "PAY_INVOICE_VOUCHER",
17
+ QUOTE_SEND = "QUOTE_SEND",
17
18
  AUTOMATION = "AUTOMATION",
18
19
  PET_CARE_DOCUMENT = "PET_CARE_DOCUMENT",
19
- CAMPAIGN = "CAMPAIGN"
20
+ CAMPAIGN = "CAMPAIGN",
21
+ NPS_SURVEY = "NPS_SURVEY",
22
+ NPS_GOOGLE_REVIEW = "NPS_GOOGLE_REVIEW",
23
+ NPS_DETRACTOR = "NPS_DETRACTOR",
24
+ CANCELED_NOT_REBOOKED = "CANCELED_NOT_REBOOKED",
25
+ INACTIVE_CLIENT = "INACTIVE_CLIENT",
26
+ WELCOME_NEW_CLIENT = "WELCOME_NEW_CLIENT",
27
+ VACCINE_DUE = "VACCINE_DUE",
28
+ CONSULTATION_RETURN = "CONSULTATION_RETURN",
29
+ PACKAGE_RUNNING_OUT = "PACKAGE_RUNNING_OUT",
30
+ PLAN_EXPIRING = "PLAN_EXPIRING",
31
+ CUSTOM = "CUSTOM"
20
32
  }
@@ -18,7 +18,19 @@ var NotificationType;
18
18
  NotificationType["SELECTED_INVOICES"] = "SELECTED_INVOICES";
19
19
  NotificationType["CLIENT_REGISTER"] = "CLIENT_REGISTER";
20
20
  NotificationType["PAY_INVOICE_VOUCHER"] = "PAY_INVOICE_VOUCHER";
21
+ NotificationType["QUOTE_SEND"] = "QUOTE_SEND";
21
22
  NotificationType["AUTOMATION"] = "AUTOMATION";
22
23
  NotificationType["PET_CARE_DOCUMENT"] = "PET_CARE_DOCUMENT";
23
24
  NotificationType["CAMPAIGN"] = "CAMPAIGN";
25
+ NotificationType["NPS_SURVEY"] = "NPS_SURVEY";
26
+ NotificationType["NPS_GOOGLE_REVIEW"] = "NPS_GOOGLE_REVIEW";
27
+ NotificationType["NPS_DETRACTOR"] = "NPS_DETRACTOR";
28
+ NotificationType["CANCELED_NOT_REBOOKED"] = "CANCELED_NOT_REBOOKED";
29
+ NotificationType["INACTIVE_CLIENT"] = "INACTIVE_CLIENT";
30
+ NotificationType["WELCOME_NEW_CLIENT"] = "WELCOME_NEW_CLIENT";
31
+ NotificationType["VACCINE_DUE"] = "VACCINE_DUE";
32
+ NotificationType["CONSULTATION_RETURN"] = "CONSULTATION_RETURN";
33
+ NotificationType["PACKAGE_RUNNING_OUT"] = "PACKAGE_RUNNING_OUT";
34
+ NotificationType["PLAN_EXPIRING"] = "PLAN_EXPIRING";
35
+ NotificationType["CUSTOM"] = "CUSTOM";
24
36
  })(NotificationType || (exports.NotificationType = NotificationType = {}));
@@ -0,0 +1,11 @@
1
+ export interface NpsSurveyOption {
2
+ score: number;
3
+ label: string;
4
+ }
5
+ export interface NpsSurveyPayload {
6
+ surveyId: number;
7
+ scale: 5;
8
+ listTitle: string;
9
+ buttonLabel: string;
10
+ options: NpsSurveyOption[];
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import { NpsAnswerStatus } from '../enum/nps-answer-status.enum';
2
+ import { NpsClassification } from '../enum/nps-classification.enum';
3
+ import { NpsReasonOption } from './pa.nps-reason.dto';
4
+ export type NpsAnswerSource = 'LIST' | 'TEXT';
5
+ export interface NpsAnswerInput {
6
+ score: number;
7
+ date: string;
8
+ source: NpsAnswerSource;
9
+ }
10
+ export interface NpsAnswerResponse {
11
+ status: NpsAnswerStatus;
12
+ classification: NpsClassification | null;
13
+ replyText: string;
14
+ awaitComment: boolean;
15
+ awaitReason: boolean;
16
+ reasonOptions: NpsReasonOption[];
17
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export interface NpsCommentInput {
2
+ text: string;
3
+ date: string;
4
+ }
5
+ export interface NpsCommentResponse {
6
+ replyText: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { NpsDetractorReason } from '../enum/nps-detractor-reason.enum';
2
+ export interface NpsReasonOption {
3
+ reason: NpsDetractorReason;
4
+ label: string;
5
+ }
6
+ export interface NpsReasonInput {
7
+ reason: NpsDetractorReason;
8
+ date: string;
9
+ }
10
+ export interface NpsReasonResponse {
11
+ replyText: string;
12
+ awaitComment: boolean;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export declare enum NpsAnswerStatus {
2
+ RECORDED = "RECORDED",
3
+ ALREADY_ANSWERED = "ALREADY_ANSWERED",
4
+ EXPIRED = "EXPIRED"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NpsAnswerStatus = void 0;
4
+ var NpsAnswerStatus;
5
+ (function (NpsAnswerStatus) {
6
+ NpsAnswerStatus["RECORDED"] = "RECORDED";
7
+ NpsAnswerStatus["ALREADY_ANSWERED"] = "ALREADY_ANSWERED";
8
+ NpsAnswerStatus["EXPIRED"] = "EXPIRED";
9
+ })(NpsAnswerStatus || (exports.NpsAnswerStatus = NpsAnswerStatus = {}));
@@ -0,0 +1,5 @@
1
+ export declare enum NpsClassification {
2
+ PROMOTER = "PROMOTER",
3
+ NEUTRAL = "NEUTRAL",
4
+ DETRACTOR = "DETRACTOR"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NpsClassification = void 0;
4
+ var NpsClassification;
5
+ (function (NpsClassification) {
6
+ NpsClassification["PROMOTER"] = "PROMOTER";
7
+ NpsClassification["NEUTRAL"] = "NEUTRAL";
8
+ NpsClassification["DETRACTOR"] = "DETRACTOR";
9
+ })(NpsClassification || (exports.NpsClassification = NpsClassification = {}));
@@ -0,0 +1,7 @@
1
+ export declare enum NpsDetractorReason {
2
+ SERVICE = "SERVICE",
3
+ PET_RESULT = "PET_RESULT",
4
+ DELAY = "DELAY",
5
+ PRICE = "PRICE",
6
+ OTHER = "OTHER"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NpsDetractorReason = void 0;
4
+ var NpsDetractorReason;
5
+ (function (NpsDetractorReason) {
6
+ NpsDetractorReason["SERVICE"] = "SERVICE";
7
+ NpsDetractorReason["PET_RESULT"] = "PET_RESULT";
8
+ NpsDetractorReason["DELAY"] = "DELAY";
9
+ NpsDetractorReason["PRICE"] = "PRICE";
10
+ NpsDetractorReason["OTHER"] = "OTHER";
11
+ })(NpsDetractorReason || (exports.NpsDetractorReason = NpsDetractorReason = {}));
@@ -0,0 +1,8 @@
1
+ export * from './dto/pa.nps-answer.dto';
2
+ export * from './dto/pa.nps-comment.dto';
3
+ export * from './dto/pa.nps-reason.dto';
4
+ export * from './dto/nps-survey-payload.dto';
5
+ export * from './enum/nps-answer-status.enum';
6
+ export * from './enum/nps-classification.enum';
7
+ export * from './enum/nps-detractor-reason.enum';
8
+ export * from './nps.service';
@@ -0,0 +1,24 @@
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/pa.nps-answer.dto"), exports);
18
+ __exportStar(require("./dto/pa.nps-comment.dto"), exports);
19
+ __exportStar(require("./dto/pa.nps-reason.dto"), exports);
20
+ __exportStar(require("./dto/nps-survey-payload.dto"), exports);
21
+ __exportStar(require("./enum/nps-answer-status.enum"), exports);
22
+ __exportStar(require("./enum/nps-classification.enum"), exports);
23
+ __exportStar(require("./enum/nps-detractor-reason.enum"), exports);
24
+ __exportStar(require("./nps.service"), exports);
@@ -0,0 +1,11 @@
1
+ import { HttpClient } from "infra/http/client.http";
2
+ import { NpsAnswerInput, NpsAnswerResponse } from "./dto/pa.nps-answer.dto";
3
+ import { NpsCommentInput, NpsCommentResponse } from "./dto/pa.nps-comment.dto";
4
+ import { NpsReasonInput, NpsReasonResponse } from "./dto/pa.nps-reason.dto";
5
+ export declare class NpsService {
6
+ private readonly api;
7
+ constructor(api: HttpClient);
8
+ answer(surveyId: number, input: NpsAnswerInput): Promise<NpsAnswerResponse>;
9
+ comment(surveyId: number, input: NpsCommentInput): Promise<NpsCommentResponse>;
10
+ reason(surveyId: number, input: NpsReasonInput): Promise<NpsReasonResponse>;
11
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NpsService = void 0;
4
+ class NpsService {
5
+ api;
6
+ constructor(api) {
7
+ this.api = api;
8
+ }
9
+ async answer(surveyId, input) {
10
+ const response = await this.api.post(`/nps/survey/${surveyId}/answer`, input);
11
+ return response;
12
+ }
13
+ async comment(surveyId, input) {
14
+ const response = await this.api.post(`/nps/survey/${surveyId}/comment`, input);
15
+ return response;
16
+ }
17
+ async reason(surveyId, input) {
18
+ const response = await this.api.post(`/nps/survey/${surveyId}/reason`, input);
19
+ return response;
20
+ }
21
+ }
22
+ exports.NpsService = NpsService;
package/dist/index.d.ts CHANGED
@@ -27,6 +27,7 @@ import { WhatsappEventService } from "./domain/whatsappEvent/whatsappEvent.servi
27
27
  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
+ import { NpsService } from "./domain/nps/nps.service";
30
31
  export declare class TecpetSDK {
31
32
  private api;
32
33
  client: ClientService;
@@ -58,6 +59,7 @@ export declare class TecpetSDK {
58
59
  aiSettings: AISettingsService;
59
60
  campaign: CampaignService;
60
61
  petPlan: PetPlanService;
62
+ nps: NpsService;
61
63
  constructor(baseURL: string, apiKey?: string);
62
64
  }
63
65
  export * from './domain/availableTimes';
@@ -92,3 +94,4 @@ export * from './domain/whatsappEvent';
92
94
  export * from './domain/aiSettings';
93
95
  export * from './domain/campaign';
94
96
  export * from './domain/notification';
97
+ export * from './domain/nps';
package/dist/index.js CHANGED
@@ -45,6 +45,7 @@ const whatsappEvent_service_1 = require("./domain/whatsappEvent/whatsappEvent.se
45
45
  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
+ const nps_service_1 = require("./domain/nps/nps.service");
48
49
  class TecpetSDK {
49
50
  api;
50
51
  client;
@@ -76,6 +77,7 @@ class TecpetSDK {
76
77
  aiSettings;
77
78
  campaign;
78
79
  petPlan;
80
+ nps;
79
81
  constructor(baseURL, apiKey) {
80
82
  this.api = new client_http_1.HttpClient(baseURL, apiKey);
81
83
  this.client = new client_service_1.ClientService(this.api);
@@ -107,6 +109,7 @@ class TecpetSDK {
107
109
  this.aiSettings = new aiSettings_service_1.AISettingsService(this.api);
108
110
  this.campaign = new campaign_service_1.CampaignService(this.api);
109
111
  this.petPlan = new petPlan_service_1.PetPlanService(this.api);
112
+ this.nps = new nps_service_1.NpsService(this.api);
110
113
  }
111
114
  }
112
115
  exports.TecpetSDK = TecpetSDK;
@@ -142,3 +145,4 @@ __exportStar(require("./domain/whatsappEvent"), exports);
142
145
  __exportStar(require("./domain/aiSettings"), exports);
143
146
  __exportStar(require("./domain/campaign"), exports);
144
147
  __exportStar(require("./domain/notification"), exports);
148
+ __exportStar(require("./domain/nps"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tec.pet/tecpet-sdk",
3
- "version": "0.0.231",
3
+ "version": "0.0.232",
4
4
  "description": "TecPet SDK for integration with TecPet services",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",