sdk-nave-nodejs 0.0.3 → 0.0.4

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/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import { NaveClient } from './lib/NaveClient';
2
+ export * from './lib/client-types';
2
3
  export { NaveClient };
package/dist/index.js CHANGED
@@ -1,6 +1,21 @@
1
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
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  exports.NaveClient = void 0;
4
18
  const NaveClient_1 = require("./lib/NaveClient");
5
19
  Object.defineProperty(exports, "NaveClient", { enumerable: true, get: function () { return NaveClient_1.NaveClient; } });
20
+ __exportStar(require("./lib/client-types"), exports);
6
21
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAErC,2FAFA,uBAAU,OAEA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iDAA8C;AAErC,2FAFA,uBAAU,OAEA;AADnB,qDAAmC"}
@@ -4,6 +4,10 @@ export interface ResponseNaveToken {
4
4
  expires_in: number;
5
5
  token_type: string;
6
6
  }
7
+ export interface NaveAmount {
8
+ currency: string;
9
+ value: string;
10
+ }
7
11
  export interface NaveBuyer {
8
12
  user_id: string;
9
13
  doc_type?: string;
@@ -13,24 +17,21 @@ export interface NaveBuyer {
13
17
  phone?: string;
14
18
  billing_address?: NaveBillingAddress;
15
19
  }
16
- export type NaveBillingAddress = {
20
+ export interface NaveBillingAddress {
17
21
  street_1: string;
18
22
  street_2?: string;
19
23
  city: string;
20
24
  region: string;
21
25
  country: string;
22
26
  zip_code: string;
23
- };
24
- export type NaveProduct = {
27
+ }
28
+ export interface NaveProduct {
25
29
  id: string;
26
30
  name: string;
27
31
  description: string;
28
32
  quantity: number;
29
- unit_price: {
30
- currency: string;
31
- value: string;
32
- };
33
- };
33
+ unit_price: NaveAmount;
34
+ }
34
35
  export interface BodyNaveCreateOrder {
35
36
  /**
36
37
  * Platform identifier: Provided by Nave
@@ -56,10 +57,7 @@ export interface BodyNaveCreateOrder {
56
57
  payment_request: {
57
58
  transactions: {
58
59
  products: NaveProduct[];
59
- amount: {
60
- currency: string;
61
- value: string;
62
- };
60
+ amount: NaveAmount;
63
61
  }[];
64
62
  buyer: NaveBuyer;
65
63
  };
@@ -74,10 +72,7 @@ export interface ResponseNaveCreateOrder {
74
72
  qr_data: string;
75
73
  payment_request_id: string;
76
74
  checkout_url: string;
77
- amount: {
78
- currency: string;
79
- value: string;
80
- };
75
+ amount: NaveAmount;
81
76
  redirect_to: string;
82
77
  };
83
78
  success: boolean;
@@ -103,3 +98,10 @@ export interface ResponseNaveCancelOrder {
103
98
  status: 'CANCELLING';
104
99
  message: string;
105
100
  }
101
+ export interface NotificationNavePayment {
102
+ payment_id: string;
103
+ payment_check_url: string;
104
+ payment_request_id: string;
105
+ order_id: string;
106
+ status: ResponseNaveGetOrder['status'];
107
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sdk-nave-nodejs",
3
3
  "description": "Nave SDK for Node.js",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "type": "commonjs",
@@ -14,6 +14,7 @@
14
14
  "scripts": {
15
15
  "test": "vitest run",
16
16
  "build": "tsc",
17
+ "prepack": "yarn clean && yarn build",
17
18
  "clean": "rm -rf ./dist/*"
18
19
  },
19
20
  "author": "Emilio Astarita (https://github.com/emilioastarita/)",