@tec.pet/tecpet-sdk 0.0.112 → 0.0.114

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.
@@ -4,6 +4,7 @@ import { PaCreateClientInput } 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";
7
+ import { PaSyncClientResponse } from "./dto/pa.sync-client.dto";
7
8
  export declare class ClientService {
8
9
  private readonly api;
9
10
  constructor(api: HttpClient);
@@ -14,4 +15,5 @@ export declare class ClientService {
14
15
  summary(clientId: number, shopId: number): Promise<PaClientSummaryResponse>;
15
16
  exist(body: PaExistClientRequest, shopId: number): Promise<PaClientResponse>;
16
17
  getByExternId(externId: string, integrationShopId: number, shopId: number): Promise<PaClientResponse>;
18
+ sync(clientId: number, integrationType: string, shopId: number): Promise<PaSyncClientResponse>;
17
19
  }
@@ -32,5 +32,9 @@ class ClientService {
32
32
  async getByExternId(externId, integrationShopId, shopId) {
33
33
  return await this.api.get(`/client/byExternId/${externId}/integrationShop/${integrationShopId}`, {}, shopId);
34
34
  }
35
+ async sync(clientId, integrationType, shopId) {
36
+ const body = { integrationType };
37
+ return await this.api.post(`/client/${clientId}/sync`, body, shopId);
38
+ }
35
39
  }
36
40
  exports.ClientService = ClientService;
@@ -0,0 +1,7 @@
1
+ export interface PaSyncClientRequest {
2
+ integrationType: string;
3
+ }
4
+ export interface PaSyncClientResponse {
5
+ success: boolean;
6
+ message?: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,7 @@
1
1
  export * from '../client/dto/pa.get-client-summary.dto';
2
2
  export * from './dto/pa.edit-client.dto';
3
+ export * from './dto/pa.create-client.dto';
3
4
  export * from './dto/pa.get-client-summary.dto';
4
5
  export * from './dto/pa.get-client.dto';
5
6
  export * from './dto/pa.exist-client.dto';
7
+ export * from './dto/pa.sync-client.dto';
@@ -16,6 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("../client/dto/pa.get-client-summary.dto"), exports);
18
18
  __exportStar(require("./dto/pa.edit-client.dto"), exports);
19
+ __exportStar(require("./dto/pa.create-client.dto"), exports);
19
20
  __exportStar(require("./dto/pa.get-client-summary.dto"), exports);
20
21
  __exportStar(require("./dto/pa.get-client.dto"), exports);
21
22
  __exportStar(require("./dto/pa.exist-client.dto"), exports);
23
+ __exportStar(require("./dto/pa.sync-client.dto"), exports);
@@ -0,0 +1,12 @@
1
+ export interface PaShopWithIntegrationResponse {
2
+ id: number;
3
+ name: string;
4
+ externId: string;
5
+ login: string;
6
+ token: string;
7
+ password: string;
8
+ extraConfig: any;
9
+ chainId: string;
10
+ integrationShopId: number;
11
+ pdvPayment: boolean;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +1,11 @@
1
1
  import { HttpClient } from "infra/http/client.http";
2
2
  import { ApiIntegrationType, PaGetIntegrationShopByLoginResponse } from "./dto/pa.get-integration-shop-by-login.dto";
3
3
  import { PaEditIntegrationShopRequest, PaEditIntegrationShopResponse } from "./dto/pa.edit-integration-shop.dto";
4
+ import { PaShopWithIntegrationResponse } from "./dto/pa.get-shops-with-integration.dto";
4
5
  export declare class IntegrationShopService {
5
6
  private readonly api;
6
7
  constructor(api: HttpClient);
7
8
  getIntegrationShopByLogin(type: ApiIntegrationType | string, login: string): Promise<PaGetIntegrationShopByLoginResponse>;
8
9
  edit(body: PaEditIntegrationShopRequest, shopId: number): Promise<PaEditIntegrationShopResponse>;
10
+ getShopsWithIntegration(integrationType: string): Promise<PaShopWithIntegrationResponse[]>;
9
11
  }
@@ -14,5 +14,8 @@ class IntegrationShopService {
14
14
  async edit(body, shopId) {
15
15
  return await this.api.post(`/integrationShop`, body, shopId);
16
16
  }
17
+ async getShopsWithIntegration(integrationType) {
18
+ return await this.api.get(`/integrationShop/${integrationType}`);
19
+ }
17
20
  }
18
21
  exports.IntegrationShopService = IntegrationShopService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tec.pet/tecpet-sdk",
3
- "version": "0.0.112",
3
+ "version": "0.0.114",
4
4
  "description": "TecPet SDK for integration with TecPet services",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",