@tec.pet/tecpet-sdk 0.0.110 → 0.0.111

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.
Files changed (49) hide show
  1. package/dist/domain/fiscalInvoice/dto/pa.change-fiscal-invoice-extern-id.dto.d.ts +6 -0
  2. package/dist/domain/fiscalInvoice/dto/pa.change-fiscal-invoice-extern-id.dto.js +2 -0
  3. package/dist/domain/fiscalInvoice/dto/pa.change-fiscal-invoice-nf-id.dto.d.ts +6 -0
  4. package/dist/domain/fiscalInvoice/dto/pa.change-fiscal-invoice-nf-id.dto.js +2 -0
  5. package/dist/domain/fiscalInvoice/dto/pa.change-fiscal-invoice-pending-payment.dto.d.ts +6 -0
  6. package/dist/domain/fiscalInvoice/dto/pa.change-fiscal-invoice-pending-payment.dto.js +2 -0
  7. package/dist/domain/fiscalInvoice/dto/pa.change-fiscal-invoice-reference.dto.d.ts +6 -0
  8. package/dist/domain/fiscalInvoice/dto/pa.change-fiscal-invoice-reference.dto.js +2 -0
  9. package/dist/domain/fiscalInvoice/dto/pa.change-fiscal-invoice-status.dto.d.ts +16 -0
  10. package/dist/domain/fiscalInvoice/dto/pa.change-fiscal-invoice-status.dto.js +13 -0
  11. package/dist/domain/fiscalInvoice/dto/pa.change-fiscal-invoice-transactions.dto.d.ts +6 -0
  12. package/dist/domain/fiscalInvoice/dto/pa.change-fiscal-invoice-transactions.dto.js +2 -0
  13. package/dist/domain/fiscalInvoice/dto/pa.create-fiscal-invoice.dto.d.ts +29 -0
  14. package/dist/domain/fiscalInvoice/dto/pa.create-fiscal-invoice.dto.js +8 -0
  15. package/dist/domain/fiscalInvoice/dto/pa.get-opened-fiscal-invoices.dto.d.ts +9 -0
  16. package/dist/domain/fiscalInvoice/dto/pa.get-opened-fiscal-invoices.dto.js +2 -0
  17. package/dist/domain/fiscalInvoice/fiscalInvoice.service.d.ts +21 -0
  18. package/dist/domain/fiscalInvoice/fiscalInvoice.service.js +34 -0
  19. package/dist/domain/fiscalInvoice/index.d.ts +9 -0
  20. package/dist/domain/fiscalInvoice/index.js +25 -0
  21. package/dist/domain/integrationClient/dto/pa.edit-integration-client.dto.d.ts +27 -0
  22. package/dist/domain/integrationClient/dto/pa.edit-integration-client.dto.js +9 -0
  23. package/dist/domain/integrationClient/dto/pa.get-integration-client-by-extern-id.dto.d.ts +19 -0
  24. package/dist/domain/integrationClient/dto/pa.get-integration-client-by-extern-id.dto.js +2 -0
  25. package/dist/domain/integrationClient/dto/pa.get-integration-client.dto.d.ts +20 -0
  26. package/dist/domain/integrationClient/dto/pa.get-integration-client.dto.js +2 -0
  27. package/dist/domain/integrationClient/index.d.ts +4 -1
  28. package/dist/domain/integrationClient/index.js +4 -1
  29. package/dist/domain/integrationClient/integrationClient.service.d.ts +6 -0
  30. package/dist/domain/integrationClient/integrationClient.service.js +9 -0
  31. package/dist/domain/integrationShop/dto/pa.edit-integration-shop.dto.d.ts +30 -0
  32. package/dist/domain/integrationShop/dto/pa.edit-integration-shop.dto.js +2 -0
  33. package/dist/domain/integrationShop/index.d.ts +2 -0
  34. package/dist/domain/integrationShop/index.js +2 -0
  35. package/dist/domain/integrationShop/integrationShop.service.d.ts +2 -0
  36. package/dist/domain/integrationShop/integrationShop.service.js +3 -0
  37. package/dist/domain/invoice/dto/pa.edit-invoice-extern-id.dto.d.ts +6 -0
  38. package/dist/domain/invoice/dto/pa.edit-invoice-extern-id.dto.js +2 -0
  39. package/dist/domain/invoice/dto/pa.register-invoice-pdv-payment.dto.d.ts +3 -0
  40. package/dist/domain/invoice/dto/pa.register-invoice-pdv-payment.dto.js +2 -0
  41. package/dist/domain/invoice/index.d.ts +3 -0
  42. package/dist/domain/invoice/index.js +19 -0
  43. package/dist/domain/invoice/invoice.service.d.ts +9 -0
  44. package/dist/domain/invoice/invoice.service.js +16 -0
  45. package/dist/index.d.ts +6 -0
  46. package/dist/index.js +8 -0
  47. package/dist/infra/http/client.http.d.ts +1 -0
  48. package/dist/infra/http/client.http.js +9 -0
  49. package/package.json +1 -1
@@ -0,0 +1,6 @@
1
+ export interface PaChangeFiscalInvoiceExternIdRequest {
2
+ externId: string;
3
+ }
4
+ export interface PaChangeFiscalInvoiceExternIdResponse {
5
+ success: boolean;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export interface PaChangeFiscalInvoiceNfIdRequest {
2
+ nfId: string;
3
+ }
4
+ export interface PaChangeFiscalInvoiceNfIdResponse {
5
+ success: boolean;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export interface PaChangeFiscalInvoicePendingPaymentRequest {
2
+ pendingPaymentId: string;
3
+ }
4
+ export interface PaChangeFiscalInvoicePendingPaymentResponse {
5
+ success: boolean;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export interface PaChangeFiscalInvoiceReferenceRequest {
2
+ reference: string;
3
+ }
4
+ export interface PaChangeFiscalInvoiceReferenceResponse {
5
+ success: boolean;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ export declare enum FiscalInvoiceStatusType {
2
+ NONE = "NONE",
3
+ AWAITING_PAYMENT = "AWAITING_PAYMENT",
4
+ AWAITING_ISSUE = "AWAITING_ISSUE",
5
+ ISSUED = "ISSUED",
6
+ INTEGRATED = "INTEGRATED",
7
+ FAILED = "FAILED",
8
+ CANCELED = "CANCELED"
9
+ }
10
+ export interface PaChangeFiscalInvoiceStatusRequest {
11
+ status: FiscalInvoiceStatusType;
12
+ description?: string;
13
+ }
14
+ export interface PaChangeFiscalInvoiceStatusResponse {
15
+ success: boolean;
16
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FiscalInvoiceStatusType = void 0;
4
+ var FiscalInvoiceStatusType;
5
+ (function (FiscalInvoiceStatusType) {
6
+ FiscalInvoiceStatusType["NONE"] = "NONE";
7
+ FiscalInvoiceStatusType["AWAITING_PAYMENT"] = "AWAITING_PAYMENT";
8
+ FiscalInvoiceStatusType["AWAITING_ISSUE"] = "AWAITING_ISSUE";
9
+ FiscalInvoiceStatusType["ISSUED"] = "ISSUED";
10
+ FiscalInvoiceStatusType["INTEGRATED"] = "INTEGRATED";
11
+ FiscalInvoiceStatusType["FAILED"] = "FAILED";
12
+ FiscalInvoiceStatusType["CANCELED"] = "CANCELED";
13
+ })(FiscalInvoiceStatusType || (exports.FiscalInvoiceStatusType = FiscalInvoiceStatusType = {}));
@@ -0,0 +1,6 @@
1
+ export interface PaChangeFiscalInvoiceTransactionsRequest {
2
+ transactions: string[];
3
+ }
4
+ export interface PaChangeFiscalInvoiceTransactionsResponse {
5
+ success: boolean;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,29 @@
1
+ export declare enum FiscalInvoiceSegment {
2
+ SERVICE = "SERVICE",
3
+ PRODUCT = "PRODUCT"
4
+ }
5
+ export interface PaCreateFiscalInvoiceRequest {
6
+ invoice: string;
7
+ employee: number;
8
+ segment?: FiscalInvoiceSegment;
9
+ aditionalInformation?: string;
10
+ }
11
+ export interface PaCreateFiscalInvoiceResponse {
12
+ id: string;
13
+ reference: string;
14
+ value: number;
15
+ status: string;
16
+ segment: FiscalInvoiceSegment;
17
+ invoice: {
18
+ id: string;
19
+ };
20
+ shop: {
21
+ id: number;
22
+ };
23
+ client: {
24
+ id: number;
25
+ };
26
+ externId?: string;
27
+ createdAt: Date;
28
+ updatedAt: Date;
29
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FiscalInvoiceSegment = void 0;
4
+ var FiscalInvoiceSegment;
5
+ (function (FiscalInvoiceSegment) {
6
+ FiscalInvoiceSegment["SERVICE"] = "SERVICE";
7
+ FiscalInvoiceSegment["PRODUCT"] = "PRODUCT";
8
+ })(FiscalInvoiceSegment || (exports.FiscalInvoiceSegment = FiscalInvoiceSegment = {}));
@@ -0,0 +1,9 @@
1
+ export interface PaGetOpenedFiscalInvoicesRequest {
2
+ externIds?: string[];
3
+ }
4
+ export interface PaGetOpenedFiscalInvoicesResponse {
5
+ fiscal_invoice_id: string;
6
+ fiscal_invoice_extern_id: string;
7
+ invoice_id: string;
8
+ shop_id: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,21 @@
1
+ import { HttpClient } from "../../infra/http/client.http";
2
+ import { PaCreateFiscalInvoiceRequest, PaCreateFiscalInvoiceResponse } from "./dto/pa.create-fiscal-invoice.dto";
3
+ import { PaChangeFiscalInvoiceStatusRequest, PaChangeFiscalInvoiceStatusResponse } from "./dto/pa.change-fiscal-invoice-status.dto";
4
+ import { PaChangeFiscalInvoiceExternIdRequest, PaChangeFiscalInvoiceExternIdResponse } from "./dto/pa.change-fiscal-invoice-extern-id.dto";
5
+ import { PaChangeFiscalInvoicePendingPaymentRequest, PaChangeFiscalInvoicePendingPaymentResponse } from "./dto/pa.change-fiscal-invoice-pending-payment.dto";
6
+ import { PaChangeFiscalInvoiceTransactionsRequest, PaChangeFiscalInvoiceTransactionsResponse } from "./dto/pa.change-fiscal-invoice-transactions.dto";
7
+ import { PaGetOpenedFiscalInvoicesRequest, PaGetOpenedFiscalInvoicesResponse } from "./dto/pa.get-opened-fiscal-invoices.dto";
8
+ import { PaChangeFiscalInvoiceReferenceRequest, PaChangeFiscalInvoiceReferenceResponse } from "./dto/pa.change-fiscal-invoice-reference.dto";
9
+ import { PaChangeFiscalInvoiceNfIdRequest, PaChangeFiscalInvoiceNfIdResponse } from "./dto/pa.change-fiscal-invoice-nf-id.dto";
10
+ export declare class FiscalInvoiceService {
11
+ private readonly api;
12
+ constructor(api: HttpClient);
13
+ create(body: PaCreateFiscalInvoiceRequest, shopId: number): Promise<PaCreateFiscalInvoiceResponse>;
14
+ getOpened(query: PaGetOpenedFiscalInvoicesRequest): Promise<PaGetOpenedFiscalInvoicesResponse[]>;
15
+ changeStatus(fiscalInvoiceId: string, body: PaChangeFiscalInvoiceStatusRequest, shopId: number): Promise<PaChangeFiscalInvoiceStatusResponse>;
16
+ changeReference(fiscalInvoiceId: string, body: PaChangeFiscalInvoiceReferenceRequest, shopId: number): Promise<PaChangeFiscalInvoiceReferenceResponse>;
17
+ changeExternId(fiscalInvoiceId: string, body: PaChangeFiscalInvoiceExternIdRequest, shopId: number): Promise<PaChangeFiscalInvoiceExternIdResponse>;
18
+ changePendingPaymentId(fiscalInvoiceId: string, body: PaChangeFiscalInvoicePendingPaymentRequest, shopId: number): Promise<PaChangeFiscalInvoicePendingPaymentResponse>;
19
+ changeTransactions(fiscalInvoiceId: string, body: PaChangeFiscalInvoiceTransactionsRequest, shopId: number): Promise<PaChangeFiscalInvoiceTransactionsResponse>;
20
+ changeNfId(fiscalInvoiceId: string, body: PaChangeFiscalInvoiceNfIdRequest, shopId: number): Promise<PaChangeFiscalInvoiceNfIdResponse>;
21
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FiscalInvoiceService = void 0;
4
+ class FiscalInvoiceService {
5
+ api;
6
+ constructor(api) {
7
+ this.api = api;
8
+ }
9
+ async create(body, shopId) {
10
+ return await this.api.post(`/v1/fiscalInvoice`, body, shopId);
11
+ }
12
+ async getOpened(query) {
13
+ return await this.api.post(`/v1/fiscalInvoice/opened`, query);
14
+ }
15
+ async changeStatus(fiscalInvoiceId, body, shopId) {
16
+ return await this.api.patch(`/v1/fiscalInvoice/${fiscalInvoiceId}/status`, body, shopId);
17
+ }
18
+ async changeReference(fiscalInvoiceId, body, shopId) {
19
+ return await this.api.patch(`/v1/fiscalInvoice/${fiscalInvoiceId}/reference`, body, shopId);
20
+ }
21
+ async changeExternId(fiscalInvoiceId, body, shopId) {
22
+ return await this.api.patch(`/v1/fiscalInvoice/${fiscalInvoiceId}/externId`, body, shopId);
23
+ }
24
+ async changePendingPaymentId(fiscalInvoiceId, body, shopId) {
25
+ return await this.api.patch(`/v1/fiscalInvoice/${fiscalInvoiceId}/pendingPaymentId`, body, shopId);
26
+ }
27
+ async changeTransactions(fiscalInvoiceId, body, shopId) {
28
+ return await this.api.patch(`/v1/fiscalInvoice/${fiscalInvoiceId}/transactions`, body, shopId);
29
+ }
30
+ async changeNfId(fiscalInvoiceId, body, shopId) {
31
+ return await this.api.patch(`/v1/fiscalInvoice/${fiscalInvoiceId}/nfId`, body, shopId);
32
+ }
33
+ }
34
+ exports.FiscalInvoiceService = FiscalInvoiceService;
@@ -0,0 +1,9 @@
1
+ export * from './fiscalInvoice.service';
2
+ export * from './dto/pa.create-fiscal-invoice.dto';
3
+ export * from './dto/pa.change-fiscal-invoice-status.dto';
4
+ export * from './dto/pa.change-fiscal-invoice-extern-id.dto';
5
+ export * from './dto/pa.change-fiscal-invoice-reference.dto';
6
+ export * from './dto/pa.change-fiscal-invoice-pending-payment.dto';
7
+ export * from './dto/pa.change-fiscal-invoice-transactions.dto';
8
+ export * from './dto/pa.get-opened-fiscal-invoices.dto';
9
+ export * from './dto/pa.change-fiscal-invoice-nf-id.dto';
@@ -0,0 +1,25 @@
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("./fiscalInvoice.service"), exports);
18
+ __exportStar(require("./dto/pa.create-fiscal-invoice.dto"), exports);
19
+ __exportStar(require("./dto/pa.change-fiscal-invoice-status.dto"), exports);
20
+ __exportStar(require("./dto/pa.change-fiscal-invoice-extern-id.dto"), exports);
21
+ __exportStar(require("./dto/pa.change-fiscal-invoice-reference.dto"), exports);
22
+ __exportStar(require("./dto/pa.change-fiscal-invoice-pending-payment.dto"), exports);
23
+ __exportStar(require("./dto/pa.change-fiscal-invoice-transactions.dto"), exports);
24
+ __exportStar(require("./dto/pa.get-opened-fiscal-invoices.dto"), exports);
25
+ __exportStar(require("./dto/pa.change-fiscal-invoice-nf-id.dto"), exports);
@@ -0,0 +1,27 @@
1
+ import { ApiIntegrationType } from "../../integrationShop";
2
+ export declare enum IntegrationClientStatusType {
3
+ PROCESSING = "PROCESSING",
4
+ INTEGRATED = "INTEGRATED",
5
+ FAILED = "FAILED"
6
+ }
7
+ export interface PaEditIntegrationClientRequest {
8
+ type: ApiIntegrationType;
9
+ clientId?: number;
10
+ externId: string;
11
+ status?: IntegrationClientStatusType;
12
+ integrationShopId?: number;
13
+ }
14
+ export interface PaEditIntegrationClientResponse {
15
+ id: number;
16
+ type: ApiIntegrationType;
17
+ externId: string;
18
+ status: IntegrationClientStatusType;
19
+ client: {
20
+ id: number;
21
+ };
22
+ integrationShop: {
23
+ id: number;
24
+ };
25
+ createdAt: Date;
26
+ updatedAt: Date;
27
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IntegrationClientStatusType = void 0;
4
+ var IntegrationClientStatusType;
5
+ (function (IntegrationClientStatusType) {
6
+ IntegrationClientStatusType["PROCESSING"] = "PROCESSING";
7
+ IntegrationClientStatusType["INTEGRATED"] = "INTEGRATED";
8
+ IntegrationClientStatusType["FAILED"] = "FAILED";
9
+ })(IntegrationClientStatusType || (exports.IntegrationClientStatusType = IntegrationClientStatusType = {}));
@@ -0,0 +1,19 @@
1
+ import { ApiIntegrationType } from "../../integrationShop";
2
+ export interface PaGetIntegrationClientByExternIdRequest {
3
+ externId: string;
4
+ type?: ApiIntegrationType;
5
+ }
6
+ export interface PaGetIntegrationClientByExternIdResponse {
7
+ id: number;
8
+ type: ApiIntegrationType;
9
+ externId: string;
10
+ status: string;
11
+ client: {
12
+ id: number;
13
+ };
14
+ integrationShop: {
15
+ id: number;
16
+ };
17
+ createdAt: Date;
18
+ updatedAt: Date;
19
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,20 @@
1
+ import { ApiIntegrationType } from "../../integrationShop";
2
+ export interface PaGetIntegrationClientRequest {
3
+ client: string;
4
+ type?: ApiIntegrationType;
5
+ integrationShopId?: number;
6
+ }
7
+ export interface PaGetIntegrationClientResponse {
8
+ id: number;
9
+ type: ApiIntegrationType;
10
+ externId: string;
11
+ status: string;
12
+ client: {
13
+ id: number;
14
+ };
15
+ integrationShop: {
16
+ id: number;
17
+ };
18
+ createdAt: Date;
19
+ updatedAt: Date;
20
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,4 @@
1
- export * from './dto/pa.upsert-integration-client.dto';
1
+ export * from './integrationClient.service';
2
+ export * from './dto/pa.get-integration-client.dto';
3
+ export * from './dto/pa.get-integration-client-by-extern-id.dto';
4
+ export * from './dto/pa.edit-integration-client.dto';
@@ -14,4 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./dto/pa.upsert-integration-client.dto"), exports);
17
+ __exportStar(require("./integrationClient.service"), exports);
18
+ __exportStar(require("./dto/pa.get-integration-client.dto"), exports);
19
+ __exportStar(require("./dto/pa.get-integration-client-by-extern-id.dto"), exports);
20
+ __exportStar(require("./dto/pa.edit-integration-client.dto"), exports);
@@ -1,7 +1,13 @@
1
1
  import { HttpClient } from "infra/http/client.http";
2
2
  import { PaIntegrationClientResponse, PaUpsertIntegrationClientRequest } from "./dto/pa.upsert-integration-client.dto";
3
+ import { PaEditIntegrationClientRequest, PaEditIntegrationClientResponse } from "./dto/pa.edit-integration-client.dto";
4
+ import { PaGetIntegrationClientRequest, PaGetIntegrationClientResponse } from "./dto/pa.get-integration-client.dto";
5
+ import { PaGetIntegrationClientByExternIdRequest, PaGetIntegrationClientByExternIdResponse } from "./dto/pa.get-integration-client-by-extern-id.dto";
3
6
  export declare class IntegrationClientService {
4
7
  private readonly api;
5
8
  constructor(api: HttpClient);
6
9
  upsert(body: PaUpsertIntegrationClientRequest): Promise<PaIntegrationClientResponse>;
10
+ edit(body: PaEditIntegrationClientRequest, shopId: number): Promise<PaEditIntegrationClientResponse>;
11
+ get(query: PaGetIntegrationClientRequest, shopId: number): Promise<PaGetIntegrationClientResponse[]>;
12
+ getByExternId(query: PaGetIntegrationClientByExternIdRequest, shopId: number): Promise<PaGetIntegrationClientByExternIdResponse[]>;
7
13
  }
@@ -9,5 +9,14 @@ class IntegrationClientService {
9
9
  async upsert(body) {
10
10
  return await this.api.post(`/integrationClient/editOrCreate`, body);
11
11
  }
12
+ async edit(body, shopId) {
13
+ return await this.api.patch(`/v1/integrationClient`, body, shopId);
14
+ }
15
+ async get(query, shopId) {
16
+ return await this.api.get(`/v1/integrationClient`, query, shopId);
17
+ }
18
+ async getByExternId(query, shopId) {
19
+ return await this.api.get(`/v1/integrationClient/byExternId`, query, shopId);
20
+ }
12
21
  }
13
22
  exports.IntegrationClientService = IntegrationClientService;
@@ -0,0 +1,30 @@
1
+ import { ApiIntegrationType } from './pa.get-integration-shop-by-login.dto';
2
+ export interface PaEditIntegrationShopRequest {
3
+ type: ApiIntegrationType;
4
+ enabled?: boolean;
5
+ externId?: string;
6
+ login?: string;
7
+ password?: string;
8
+ token?: string;
9
+ customWebhookUrl?: string;
10
+ extraConfig?: any;
11
+ configurable?: any;
12
+ configurableChoices?: any;
13
+ }
14
+ export interface PaEditIntegrationShopResponse {
15
+ id: number;
16
+ enabled: boolean;
17
+ type: ApiIntegrationType;
18
+ externId?: string;
19
+ login?: string;
20
+ token?: string;
21
+ customWebhookUrl?: string;
22
+ extraConfig?: any;
23
+ configurable?: any;
24
+ configurableChoices?: any;
25
+ shop: {
26
+ id: number;
27
+ };
28
+ createdAt: Date;
29
+ updatedAt: Date;
30
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,3 @@
1
+ export * from './integrationShop.service';
1
2
  export * from './dto/pa.get-integration-shop-by-login.dto';
3
+ export * from './dto/pa.edit-integration-shop.dto';
@@ -14,4 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./integrationShop.service"), exports);
17
18
  __exportStar(require("./dto/pa.get-integration-shop-by-login.dto"), exports);
19
+ __exportStar(require("./dto/pa.edit-integration-shop.dto"), exports);
@@ -1,7 +1,9 @@
1
1
  import { HttpClient } from "infra/http/client.http";
2
2
  import { ApiIntegrationType, PaGetIntegrationShopByLoginResponse } from "./dto/pa.get-integration-shop-by-login.dto";
3
+ import { PaEditIntegrationShopRequest, PaEditIntegrationShopResponse } from "./dto/pa.edit-integration-shop.dto";
3
4
  export declare class IntegrationShopService {
4
5
  private readonly api;
5
6
  constructor(api: HttpClient);
6
7
  getIntegrationShopByLogin(type: ApiIntegrationType | string, login: string): Promise<PaGetIntegrationShopByLoginResponse>;
8
+ edit(body: PaEditIntegrationShopRequest, shopId: number): Promise<PaEditIntegrationShopResponse>;
7
9
  }
@@ -11,5 +11,8 @@ class IntegrationShopService {
11
11
  const response = await this.api.get(path);
12
12
  return response;
13
13
  }
14
+ async edit(body, shopId) {
15
+ return await this.api.post(`/v1/integrationShop`, body, shopId);
16
+ }
14
17
  }
15
18
  exports.IntegrationShopService = IntegrationShopService;
@@ -0,0 +1,6 @@
1
+ export interface PaEditInvoiceExternIdRequest {
2
+ externId: string;
3
+ }
4
+ export interface PaEditInvoiceExternIdResponse {
5
+ success: boolean;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export interface PaRegisterInvoicePdvPaymentResponse {
2
+ success: boolean;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export * from './invoice.service';
2
+ export * from './dto/pa.edit-invoice-extern-id.dto';
3
+ export * from './dto/pa.register-invoice-pdv-payment.dto';
@@ -0,0 +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("./invoice.service"), exports);
18
+ __exportStar(require("./dto/pa.edit-invoice-extern-id.dto"), exports);
19
+ __exportStar(require("./dto/pa.register-invoice-pdv-payment.dto"), exports);
@@ -0,0 +1,9 @@
1
+ import { HttpClient } from "../../infra/http/client.http";
2
+ import { PaEditInvoiceExternIdRequest, PaEditInvoiceExternIdResponse } from "./dto/pa.edit-invoice-extern-id.dto";
3
+ import { PaRegisterInvoicePdvPaymentResponse } from "./dto/pa.register-invoice-pdv-payment.dto";
4
+ export declare class InvoiceService {
5
+ private readonly api;
6
+ constructor(api: HttpClient);
7
+ editExternId(invoiceId: string, body: PaEditInvoiceExternIdRequest, shopId: number): Promise<PaEditInvoiceExternIdResponse>;
8
+ registerPdvPayment(invoiceId: string, fiscalInvoiceId: string): Promise<PaRegisterInvoicePdvPaymentResponse>;
9
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoiceService = void 0;
4
+ class InvoiceService {
5
+ api;
6
+ constructor(api) {
7
+ this.api = api;
8
+ }
9
+ async editExternId(invoiceId, body, shopId) {
10
+ return await this.api.patch(`/v1/invoice/${invoiceId}/externId`, body, shopId);
11
+ }
12
+ async registerPdvPayment(invoiceId, fiscalInvoiceId) {
13
+ return await this.api.post(`/v1/invoice/${invoiceId}/pdvPay/${fiscalInvoiceId}`, {});
14
+ }
15
+ }
16
+ exports.InvoiceService = InvoiceService;
package/dist/index.d.ts CHANGED
@@ -14,6 +14,8 @@ import { TokenService } from "./domain/token/token.service";
14
14
  import { BookingGuardService } from "./domain/bookingGuard/bookingGuard.service";
15
15
  import { IntegrationShopService } from "./domain/integrationShop/integrationShop.service";
16
16
  import { IntegrationClientService } from "./domain/integrationClient/integrationClient.service";
17
+ import { FiscalInvoiceService } from "./domain/fiscalInvoice/fiscalInvoice.service";
18
+ import { InvoiceService } from "./domain/invoice/invoice.service";
17
19
  export declare class TecpetSDK {
18
20
  private api;
19
21
  client: ClientService;
@@ -32,6 +34,8 @@ export declare class TecpetSDK {
32
34
  bookingGuard: BookingGuardService;
33
35
  integrationShop: IntegrationShopService;
34
36
  integrationClient: IntegrationClientService;
37
+ fiscalInvoice: FiscalInvoiceService;
38
+ invoice: InvoiceService;
35
39
  constructor(baseURL: string, apiKey?: string);
36
40
  }
37
41
  export * from './domain/availableTimes';
@@ -50,5 +54,7 @@ export * from './domain/specie';
50
54
  export * from './domain/token';
51
55
  export * from './domain/integrationShop';
52
56
  export * from './domain/integrationClient';
57
+ export * from './domain/fiscalInvoice';
58
+ export * from './domain/invoice';
53
59
  export * from './utils/index';
54
60
  export * from './domain/petPlan';
package/dist/index.js CHANGED
@@ -32,6 +32,8 @@ const client_http_1 = require("./infra/http/client.http");
32
32
  const bookingGuard_service_1 = require("./domain/bookingGuard/bookingGuard.service");
33
33
  const integrationShop_service_1 = require("./domain/integrationShop/integrationShop.service");
34
34
  const integrationClient_service_1 = require("./domain/integrationClient/integrationClient.service");
35
+ const fiscalInvoice_service_1 = require("./domain/fiscalInvoice/fiscalInvoice.service");
36
+ const invoice_service_1 = require("./domain/invoice/invoice.service");
35
37
  class TecpetSDK {
36
38
  api;
37
39
  client;
@@ -50,6 +52,8 @@ class TecpetSDK {
50
52
  bookingGuard;
51
53
  integrationShop;
52
54
  integrationClient;
55
+ fiscalInvoice;
56
+ invoice;
53
57
  constructor(baseURL, apiKey) {
54
58
  this.api = new client_http_1.HttpClient(baseURL, apiKey);
55
59
  this.client = new client_service_1.ClientService(this.api);
@@ -68,6 +72,8 @@ class TecpetSDK {
68
72
  this.bookingGuard = new bookingGuard_service_1.BookingGuardService(this.api);
69
73
  this.integrationShop = new integrationShop_service_1.IntegrationShopService(this.api);
70
74
  this.integrationClient = new integrationClient_service_1.IntegrationClientService(this.api);
75
+ this.fiscalInvoice = new fiscalInvoice_service_1.FiscalInvoiceService(this.api);
76
+ this.invoice = new invoice_service_1.InvoiceService(this.api);
71
77
  }
72
78
  }
73
79
  exports.TecpetSDK = TecpetSDK;
@@ -87,5 +93,7 @@ __exportStar(require("./domain/specie"), exports);
87
93
  __exportStar(require("./domain/token"), exports);
88
94
  __exportStar(require("./domain/integrationShop"), exports);
89
95
  __exportStar(require("./domain/integrationClient"), exports);
96
+ __exportStar(require("./domain/fiscalInvoice"), exports);
97
+ __exportStar(require("./domain/invoice"), exports);
90
98
  __exportStar(require("./utils/index"), exports);
91
99
  __exportStar(require("./domain/petPlan"), exports);
@@ -6,6 +6,7 @@ export declare class HttpClient {
6
6
  get<T>(path: string, payload?: any, shopId?: number): Promise<T>;
7
7
  post<T>(path: string, payload?: any, shopId?: number): Promise<T>;
8
8
  put<T>(path: string, payload?: any, shopId?: number): Promise<T>;
9
+ patch<T>(path: string, payload?: any, shopId?: number): Promise<T>;
9
10
  private headers;
10
11
  private shop;
11
12
  }
@@ -62,6 +62,15 @@ class HttpClient {
62
62
  throw error.response.data;
63
63
  }
64
64
  }
65
+ async patch(path, payload, shopId) {
66
+ try {
67
+ const response = await this.client.patch(path, payload, { headers: this.headers({ shopId }) });
68
+ return response?.data;
69
+ }
70
+ catch (error) {
71
+ throw error.response.data;
72
+ }
73
+ }
65
74
  headers({ shopId }) {
66
75
  if (shopId) {
67
76
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tec.pet/tecpet-sdk",
3
- "version": "0.0.110",
3
+ "version": "0.0.111",
4
4
  "description": "TecPet SDK for integration with TecPet services",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",