@tonder.io/ionic-lite-sdk 0.0.16 → 0.0.17-beta

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.
@@ -17,12 +17,12 @@ export declare class LiteCheckout implements LiteCheckoutConstructor {
17
17
  baseUrlTonder: string;
18
18
  apiKeyTonder: string;
19
19
  constructor({ signal, baseUrlTonder, apiKeyTonder, }: LiteCheckoutConstructor);
20
- getOpenpayDeviceSessionID(merchant_id: string, public_key: string, is_sandbox: boolean): Promise<string | ErrorResponse>;
20
+ getOpenpayDeviceSessionID(merchant_id: string, public_key: string): Promise<string | ErrorResponse>;
21
21
  getBusiness(): Promise<GetBusinessResponse | ErrorResponse>;
22
22
  customerRegister(email: string): Promise<CustomerRegisterResponse | ErrorResponse>;
23
- createOrder(orderItems: CreateOrderRequest): Promise<CreateOrderResponse | ErrorResponse>;
23
+ createOrder(orderItems: CreateOrderRequest): Promise<CreateOrderResponse[] | ErrorResponse>;
24
24
  createPayment(paymentItems: CreatePaymentRequest): Promise<CreatePaymentResponse | ErrorResponse>;
25
- startCheckoutRouter(routerData: StartCheckoutRequest): Promise<StartCheckoutResponse | ErrorResponse>;
25
+ startCheckoutRouter(routerData: StartCheckoutRequest): Promise<StartCheckoutResponse[] | ErrorResponse>;
26
26
  getSkyflowTokens({ vault_id, vault_url, data, }: TokensRequest): Promise<any | ErrorResponse>;
27
27
  getVaultToken(): Promise<string>;
28
28
  getFieldsPromise(data: any, collectContainer: CollectContainer): Promise<Promise<boolean>[]>;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import e from"skyflow-js";function t(e,t,o,i){return new(o||(o=Promise))((function(r,n){function s(e){try{a(i.next(e))}catch(e){n(e)}}function d(e){try{a(i.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,d)}a((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class o{constructor({code:e,body:t,name:o,message:i,stack:r}){this.code=e,this.body=t,this.name=o,this.message=i,this.stack=r}}class i{constructor({signal:e,baseUrlTonder:t,apiKeyTonder:o}){this.baseUrlTonder=t,this.signal=e,this.apiKeyTonder=o}getOpenpayDeviceSessionID(e,o,i){return t(this,void 0,void 0,(function*(){try{let t=yield window.OpenPay;return t.setId(e),t.setApiKey(o),t.setSandboxMode(i),yield t.deviceData.setup({signal:this.signal})}catch(e){throw this.buildErrorResponseFromCatch(e)}}))}getBusiness(){return t(this,void 0,void 0,(function*(){try{const e=yield fetch(`${this.baseUrlTonder}/api/v1/payments/business/${this.apiKeyTonder}`,{headers:{Authorization:`Token ${this.apiKeyTonder}`},signal:this.signal});return e.ok?yield e.json():yield this.buildErrorResponse(e)}catch(e){return this.buildErrorResponseFromCatch(e)}}))}customerRegister(e){return t(this,void 0,void 0,(function*(){try{const t=`${this.baseUrlTonder}/api/v1/customer/`,o={email:e},i=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Token ${this.apiKeyTonder}`},signal:this.signal,body:JSON.stringify(o)});return i.ok?yield i.json():yield this.buildErrorResponse(i)}catch(e){return this.buildErrorResponseFromCatch(e)}}))}createOrder(e){return t(this,void 0,void 0,(function*(){try{const t=`${this.baseUrlTonder}/api/v1/orders/`,o=e,i=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Token ${this.apiKeyTonder}`},body:JSON.stringify(o)});return i.ok?yield i.json():yield this.buildErrorResponse(i)}catch(e){return this.buildErrorResponseFromCatch(e)}}))}createPayment(e){return t(this,void 0,void 0,(function*(){try{const t=`${this.baseUrlTonder}/api/v1/business/${e.business_pk}/payments/`,o=e,i=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Token ${this.apiKeyTonder}`},body:JSON.stringify(o)});return i.ok?yield i.json():yield this.buildErrorResponse(i)}catch(e){return this.buildErrorResponseFromCatch(e)}}))}startCheckoutRouter(e){return t(this,void 0,void 0,(function*(){try{const t=`${this.baseUrlTonder}/api/v1/checkout-router/`,o=e,i=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Token ${this.apiKeyTonder}`},body:JSON.stringify(o)});return i.ok?yield i.json():yield this.buildErrorResponse(i)}catch(e){return this.buildErrorResponseFromCatch(e)}}))}getSkyflowTokens({vault_id:o,vault_url:i,data:r}){return t(this,void 0,void 0,(function*(){const n=e.init({vaultID:o,vaultURL:i,getBearerToken:()=>t(this,void 0,void 0,(function*(){return yield this.getVaultToken()})),options:{logLevel:e.LogLevel.ERROR,env:e.Env.DEV}}).container(e.ContainerType.COLLECT),s=yield this.getFieldsPromise(r,n);if((yield Promise.all(s)).some((e=>!e)))return this.buildErrorResponseFromCatch(Error("Ocurrió un error al montar los campos de la tarjeta"));try{const e=yield n.collect();return e?e.records[0].fields:this.buildErrorResponseFromCatch(Error("Por favor, verifica todos los campos de tu tarjeta"))}catch(e){return this.buildErrorResponseFromCatch(e)}}))}getVaultToken(){var e;return t(this,void 0,void 0,(function*(){try{const t=yield fetch(`${this.baseUrlTonder}/api/v1/vault-token/`,{method:"GET",headers:{Authorization:`Token ${this.apiKeyTonder}`},signal:this.signal});if(t.ok)return null===(e=yield t.json())||void 0===e?void 0:e.token;throw new Error(`HTTPCODE: ${t.status}`)}catch(e){throw new Error(`Failed to retrieve bearer token; ${"string"==typeof e?e:e.message}`)}}))}getFieldsPromise(e,o){return t(this,void 0,void 0,(function*(){const t=yield this.getFields(e,o);return t?t.map((t=>new Promise((o=>{var i;const r=document.createElement("div");r.hidden=!0,r.id=`id-${t.key}`,null===(i=document.querySelector("body"))||void 0===i||i.appendChild(r),setTimeout((()=>{t.element.mount(`#id-${t.key}`),setInterval((()=>{if(t.element.isMounted()){const i=e[t.key];return t.element.update({value:i}),o(t.element.isMounted())}}),120)}),120)})))):[]}))}registerCustomerCard(e,o){return t(this,void 0,void 0,(function*(){try{const t=yield fetch(`${this.baseUrlTonder}/api/v1/cards/`,{method:"POST",headers:{Authorization:`Token ${e}`,"Content-Type":"application/json"},signal:this.signal,body:JSON.stringify(o)});return t.ok?yield t.json():yield this.buildErrorResponse(t)}catch(e){return this.buildErrorResponseFromCatch(e)}}))}getCustomerCards(e,o=""){return t(this,void 0,void 0,(function*(){try{const t=yield fetch(`${this.baseUrlTonder}/api/v1/cards/${o}`,{method:"GET",headers:{Authorization:`Token ${e}`,"Content-Type":"application/json"},signal:this.signal});return t.ok?yield t.json():yield this.buildErrorResponse(t)}catch(e){return this.buildErrorResponseFromCatch(e)}}))}buildErrorResponseFromCatch(e){return new o({code:void 0,body:void 0,name:"string"==typeof e?"catch":e.name,message:"string"==typeof e?e:e.message,stack:"string"==typeof e?void 0:e.stack})}buildErrorResponse(e,i=void 0){var r,n,s,d,a,l;return t(this,void 0,void 0,(function*(){return new o({code:null===(n=null===(r=e.status)||void 0===r?void 0:r.toString)||void 0===n?void 0:n.call(r),body:yield null===(s=null==e?void 0:e.json)||void 0===s?void 0:s.call(e),name:null===(a=null===(d=e.status)||void 0===d?void 0:d.toString)||void 0===a?void 0:a.call(d),message:yield null===(l=null==e?void 0:e.text)||void 0===l?void 0:l.call(e),stack:i})}))}getFields(o,i){return t(this,void 0,void 0,(function*(){return yield Promise.all(Object.keys(o).map((o=>t(this,void 0,void 0,(function*(){return{element:yield i.create({table:"cards",column:o,type:e.ElementType.INPUT_FIELD}),key:o}})))))}))}}export{i as LiteCheckout};
1
+ import e from"skyflow-js";function t(e,t,o,i){return new(o||(o=Promise))((function(r,n){function s(e){try{a(i.next(e))}catch(e){n(e)}}function d(e){try{a(i.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,d)}a((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class o{constructor({code:e,body:t,name:o,message:i,stack:r}){this.code=e,this.body=t,this.name=o,this.message=i,this.stack=r}}class i{constructor({signal:e,baseUrlTonder:t,apiKeyTonder:o}){this.baseUrlTonder=t,this.signal=e,this.apiKeyTonder=o}getOpenpayDeviceSessionID(e,o){return t(this,void 0,void 0,(function*(){try{let t=yield window.OpenPay;return t.setId(e),t.setApiKey(o),t.setSandboxMode(!0),yield t.deviceData.setup({signal:this.signal})}catch(e){throw this.buildErrorResponseFromCatch(e)}}))}getBusiness(){return t(this,void 0,void 0,(function*(){try{const e=yield fetch(`${this.baseUrlTonder}/api/v1/payments/business/${this.apiKeyTonder}`,{headers:{Authorization:`Token ${this.apiKeyTonder}`},signal:this.signal});return e.ok?yield e.json():yield this.buildErrorResponse(e)}catch(e){return this.buildErrorResponseFromCatch(e)}}))}customerRegister(e){return t(this,void 0,void 0,(function*(){try{const t=`${this.baseUrlTonder}/api/v1/customer/`,o={email:e},i=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Token ${this.apiKeyTonder}`},signal:this.signal,body:JSON.stringify(o)});return i.ok?yield i.json():yield this.buildErrorResponse(i)}catch(e){return this.buildErrorResponseFromCatch(e)}}))}createOrder(e){return t(this,void 0,void 0,(function*(){try{const t=`${this.baseUrlTonder}/api/v1/orders/`,o=e,i=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Token ${this.apiKeyTonder}`},body:JSON.stringify(o)});return i.ok?yield i.json():yield this.buildErrorResponse(i)}catch(e){return this.buildErrorResponseFromCatch(e)}}))}createPayment(e){return t(this,void 0,void 0,(function*(){try{const t=`${this.baseUrlTonder}/api/v1/business/${e.business_pk}/payments/`,o=e,i=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Token ${this.apiKeyTonder}`},body:JSON.stringify(o)});return i.ok?yield i.json():yield this.buildErrorResponse(i)}catch(e){return this.buildErrorResponseFromCatch(e)}}))}startCheckoutRouter(e){return t(this,void 0,void 0,(function*(){try{const t=`${this.baseUrlTonder}/api/v1/checkout-router/`,o=e,i=yield fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Token ${this.apiKeyTonder}`},body:JSON.stringify(o)});return i.ok?yield i.json():yield this.buildErrorResponse(i)}catch(e){return this.buildErrorResponseFromCatch(e)}}))}getSkyflowTokens({vault_id:o,vault_url:i,data:r}){return t(this,void 0,void 0,(function*(){const n=e.init({vaultID:o,vaultURL:i,getBearerToken:()=>t(this,void 0,void 0,(function*(){return yield this.getVaultToken()})),options:{logLevel:e.LogLevel.ERROR,env:e.Env.DEV}}).container(e.ContainerType.COLLECT),s=yield this.getFieldsPromise(r,n);if((yield Promise.all(s)).some((e=>!e)))return this.buildErrorResponseFromCatch(Error("Ocurrió un error al montar los campos de la tarjeta"));try{const e=yield n.collect();return e?e.records[0].fields:this.buildErrorResponseFromCatch(Error("Por favor, verifica todos los campos de tu tarjeta"))}catch(e){return this.buildErrorResponseFromCatch(e)}}))}getVaultToken(){var e;return t(this,void 0,void 0,(function*(){try{const t=yield fetch(`${this.baseUrlTonder}/api/v1/vault-token/`,{method:"GET",headers:{Authorization:`Token ${this.apiKeyTonder}`},signal:this.signal});if(t.ok)return null===(e=yield t.json())||void 0===e?void 0:e.token;throw new Error(`HTTPCODE: ${t.status}`)}catch(e){throw new Error(`Failed to retrieve bearer token; ${"string"==typeof e?e:e.message}`)}}))}getFieldsPromise(e,o){return t(this,void 0,void 0,(function*(){const t=yield this.getFields(e,o);return t?t.map((t=>new Promise((o=>{var i;const r=document.createElement("div");r.hidden=!0,r.id=`id-${t.key}`,null===(i=document.querySelector("body"))||void 0===i||i.appendChild(r),setTimeout((()=>{t.element.mount(`#id-${t.key}`),setInterval((()=>{if(t.element.isMounted()){const i=e[t.key];return t.element.update({value:i}),o(t.element.isMounted())}}),120)}),120)})))):[]}))}registerCustomerCard(e,o){return t(this,void 0,void 0,(function*(){try{const t=yield fetch(`${this.baseUrlTonder}/api/v1/cards/`,{method:"POST",headers:{Authorization:`Token ${e}`,"Content-Type":"application/json"},signal:this.signal,body:JSON.stringify(o)});return t.ok?yield t.json():yield this.buildErrorResponse(t)}catch(e){return this.buildErrorResponseFromCatch(e)}}))}getCustomerCards(e,o=""){return t(this,void 0,void 0,(function*(){try{const t=yield fetch(`${this.baseUrlTonder}/api/v1/cards/${o}`,{method:"GET",headers:{Authorization:`Token ${e}`,"Content-Type":"application/json"},signal:this.signal});return t.ok?yield t.json():yield this.buildErrorResponse(t)}catch(e){return this.buildErrorResponseFromCatch(e)}}))}buildErrorResponseFromCatch(e){return new o({code:void 0,body:void 0,name:"string"==typeof e?"catch":e.name,message:"string"==typeof e?e:e.message,stack:"string"==typeof e?void 0:e.stack})}buildErrorResponse(e,i=void 0){var r,n,s,d,a,l;return t(this,void 0,void 0,(function*(){return new o({code:null===(n=null===(r=e.status)||void 0===r?void 0:r.toString)||void 0===n?void 0:n.call(r),body:yield null===(s=null==e?void 0:e.json)||void 0===s?void 0:s.call(e),name:null===(a=null===(d=e.status)||void 0===d?void 0:d.toString)||void 0===a?void 0:a.call(d),message:yield null===(l=null==e?void 0:e.text)||void 0===l?void 0:l.call(e),stack:i})}))}getFields(o,i){return t(this,void 0,void 0,(function*(){return yield Promise.all(Object.keys(o).map((o=>t(this,void 0,void 0,(function*(){return{element:yield i.create({table:"cards",column:o,type:e.ElementType.INPUT_FIELD}),key:o}})))))}))}}export{i as LiteCheckout};
@@ -1,21 +1,9 @@
1
1
  import { OrderItem } from "./commons";
2
2
  import { SkyflowRecord } from "./skyflow";
3
- export interface CreateOrderRequest {
4
- business: string;
5
- client: string;
6
- billing_address_id?: string | null;
7
- shipping_address_id?: string | null;
8
- amount: number;
9
- status: string;
10
- reference: string | number;
11
- is_oneclick: boolean;
12
- items: OrderItem[];
3
+ export interface CreateOrderRequest extends OrderItem {
13
4
  }
14
5
  export type CreatePaymentRequest = {
15
- business_pk: string | number;
16
- amount: number;
17
- date: string;
18
- order: string | number;
6
+ business_pk: string;
19
7
  };
20
8
  export type StartCheckoutRequest = {
21
9
  card: any;
@@ -23,7 +11,7 @@ export type StartCheckoutRequest = {
23
11
  last_name: string;
24
12
  email_client: any;
25
13
  phone_number: any;
26
- return_url?: string;
14
+ return_url: string;
27
15
  id_product: string;
28
16
  quantity_product: number;
29
17
  id_ship: string;
@@ -9,12 +9,12 @@ export type GetVaultTokenResponse = {
9
9
  token: string;
10
10
  };
11
11
  export type CustomerRegisterResponse = {
12
- id: number | string;
12
+ id: number;
13
13
  email: string;
14
14
  auth_token: string;
15
15
  };
16
16
  export type CreateOrderResponse = {
17
- id: number | string;
17
+ id: number;
18
18
  created: string;
19
19
  amount: string;
20
20
  status: string;
@@ -46,7 +46,7 @@ export type CreateOrderResponse = {
46
46
  };
47
47
  };
48
48
  export type CreatePaymentResponse = {
49
- pk: number | string;
49
+ pk: number;
50
50
  order?: string;
51
51
  amount: string;
52
52
  status: string;
@@ -159,16 +159,17 @@ export type TokensResponse = {
159
159
  export type GetCustomerCardsResponse = {
160
160
  user_id: number;
161
161
  cards: {
162
- fields: {
163
- card_scheme: string;
164
- card_number: string;
165
- cardholder_name: string;
166
- cvv: string;
167
- expiration_month: string;
168
- expiration_year: string;
169
- skyflow_id: string;
170
- };
171
- }[];
162
+ records: {
163
+ fields: {
164
+ card_number: string;
165
+ cardholder_name: string;
166
+ cvv: string;
167
+ expiration_month: string;
168
+ expiration_year: string;
169
+ skyflow_id: string;
170
+ };
171
+ }[];
172
+ };
172
173
  };
173
174
  export type RegisterCustomerCardResponse = {
174
175
  skyflow_id: string;
package/jest.config.ts CHANGED
@@ -1,15 +1,15 @@
1
- import type { JestConfigWithTsJest } from 'ts-jest'
2
-
3
- const jestConfig: JestConfigWithTsJest = {
4
- testEnvironment: "jsdom",
5
- preset: 'ts-jest',
6
- transform: {
7
- '^.+\\.tsx?$': [
8
- 'ts-jest',
9
- {
10
- },
11
- ],
12
- },
13
- }
14
-
1
+ import type { JestConfigWithTsJest } from 'ts-jest'
2
+
3
+ const jestConfig: JestConfigWithTsJest = {
4
+ testEnvironment: "jsdom",
5
+ preset: 'ts-jest',
6
+ transform: {
7
+ '^.+\\.tsx?$': [
8
+ 'ts-jest',
9
+ {
10
+ },
11
+ ],
12
+ },
13
+ }
14
+
15
15
  export default jestConfig
package/package.json CHANGED
@@ -1,38 +1,38 @@
1
- {
2
- "name": "@tonder.io/ionic-lite-sdk",
3
- "version": "0.0.16",
4
- "description": "Tonder ionic lite SDK",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "scripts": {
8
- "build": "tsc -noEmit && rollup --config",
9
- "test": "jest",
10
- "ts-coverage": "typescript-coverage-report"
11
- },
12
- "author": "",
13
- "license": "ISC",
14
- "dependencies": {
15
- "skyflow-js": "^1.34.1",
16
- "ts-node": "^10.9.2"
17
- },
18
- "publishConfig": {
19
- "access": "public",
20
- "registry": "https://registry.npmjs.org/"
21
- },
22
- "devDependencies": {
23
- "@rollup/plugin-terser": "^0.4.4",
24
- "@rollup/plugin-typescript": "11.1.6",
25
- "@types/crypto-js": "^4.2.2",
26
- "@types/jest": "^29.5.11",
27
- "@types/node": "^20.11.5",
28
- "jest": "^29.7.0",
29
- "jest-environment-jsdom": "^29.7.0",
30
- "jsdom": "^24.0.0",
31
- "rollup": "4.9.6",
32
- "ts-jest": "^29.1.2",
33
- "ts-loader": "^9.5.1",
34
- "tslib": "^2.6.2",
35
- "typescript": "^5.3.3",
36
- "typescript-coverage-report": "^0.8.0"
37
- }
38
- }
1
+ {
2
+ "name": "@tonder.io/ionic-lite-sdk",
3
+ "version": "0.0.17-beta",
4
+ "description": "Tonder ionic lite SDK",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc -noEmit && rollup --config",
9
+ "test": "jest",
10
+ "ts-coverage": "typescript-coverage-report"
11
+ },
12
+ "author": "",
13
+ "license": "ISC",
14
+ "dependencies": {
15
+ "skyflow-js": "^1.34.1",
16
+ "ts-node": "^10.9.2"
17
+ },
18
+ "publishConfig": {
19
+ "access": "public",
20
+ "registry": "https://registry.npmjs.org/"
21
+ },
22
+ "devDependencies": {
23
+ "@rollup/plugin-terser": "^0.4.4",
24
+ "@rollup/plugin-typescript": "11.1.6",
25
+ "@types/crypto-js": "^4.2.2",
26
+ "@types/jest": "^29.5.11",
27
+ "@types/node": "^20.11.5",
28
+ "jest": "^29.7.0",
29
+ "jest-environment-jsdom": "^29.7.0",
30
+ "jsdom": "^24.0.0",
31
+ "rollup": "4.9.6",
32
+ "ts-jest": "^29.1.2",
33
+ "ts-loader": "^9.5.1",
34
+ "tslib": "^2.6.2",
35
+ "typescript": "^5.3.3",
36
+ "typescript-coverage-report": "^0.8.0"
37
+ }
38
+ }
package/rollup.config.js CHANGED
@@ -1,17 +1,17 @@
1
- const typescript = require('@rollup/plugin-typescript');
2
- const terser = require('@rollup/plugin-terser');
3
-
4
- module.exports = {
5
- input: './src/index.ts',
6
- output: {
7
- dir: 'dist',
8
- format: 'es',
9
- plugins: [terser()]
10
- },
11
- plugins: [
12
- typescript({
13
- exclude: ["tests/**", "jest.config.ts"]
14
- })
15
- ],
16
- external: ["skyflow-js", "crypto-js"]
1
+ const typescript = require('@rollup/plugin-typescript');
2
+ const terser = require('@rollup/plugin-terser');
3
+
4
+ module.exports = {
5
+ input: './src/index.ts',
6
+ output: {
7
+ dir: 'dist',
8
+ format: 'es',
9
+ plugins: [terser()]
10
+ },
11
+ plugins: [
12
+ typescript({
13
+ exclude: ["tests/**", "jest.config.ts"]
14
+ })
15
+ ],
16
+ external: ["skyflow-js", "crypto-js"]
17
17
  };
@@ -1,17 +1,17 @@
1
- import { IErrorResponse } from "../types/responses";
2
-
3
- export class ErrorResponse implements IErrorResponse {
4
- code?: string | undefined;
5
- body?: string | undefined;
6
- name!: string;
7
- message!: string;
8
- stack?: string | undefined;
9
-
10
- constructor({ code, body, name, message, stack }: IErrorResponse) {
11
- this.code = code;
12
- this.body = body;
13
- this.name = name;
14
- this.message = message;
15
- this.stack = stack;
16
- }
1
+ import { IErrorResponse } from "../types/responses";
2
+
3
+ export class ErrorResponse implements IErrorResponse {
4
+ code?: string | undefined;
5
+ body?: string | undefined;
6
+ name!: string;
7
+ message!: string;
8
+ stack?: string | undefined;
9
+
10
+ constructor({ code, body, name, message, stack }: IErrorResponse) {
11
+ this.code = code;
12
+ this.body = body;
13
+ this.name = name;
14
+ this.message = message;
15
+ this.stack = stack;
16
+ }
17
17
  }