factuplan 0.1.0 → 0.2.0
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/README.md +1 -1
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +24 -24
- package/dist/index.mjs +24 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -145,7 +145,7 @@ console.log(`Expira en ${cert.daysUntilExpiry} dias`);
|
|
|
145
145
|
|
|
146
146
|
```typescript
|
|
147
147
|
const factuplan = new Factuplan('tu-api-key', {
|
|
148
|
-
baseUrl: '
|
|
148
|
+
baseUrl: 'http://api-rest.factuplan.com.ec/api/v1', // default
|
|
149
149
|
timeout: 30000, // 30s default
|
|
150
150
|
});
|
|
151
151
|
```
|
package/dist/index.d.mts
CHANGED
|
@@ -167,21 +167,10 @@ declare class CustomersResource {
|
|
|
167
167
|
delete(id: string): Promise<void>;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
type Requester$1 = (method: string, path: string, body?: unknown
|
|
171
|
-
declare class ProductsResource {
|
|
172
|
-
private request;
|
|
173
|
-
constructor(request: Requester$1);
|
|
174
|
-
create(input: CreateProductInput): Promise<Product>;
|
|
175
|
-
list(params?: ProductListParams): Promise<PaginatedResponse<Product>>;
|
|
176
|
-
get(id: string): Promise<Product>;
|
|
177
|
-
update(id: string, input: UpdateProductInput): Promise<Product>;
|
|
178
|
-
delete(id: string): Promise<void>;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
type Requester = (method: string, path: string, body?: unknown) => Promise<unknown>;
|
|
170
|
+
type Requester$1 = (method: string, path: string, body?: unknown) => Promise<unknown>;
|
|
182
171
|
declare class InvoicesResource {
|
|
183
172
|
private request;
|
|
184
|
-
constructor(request: Requester);
|
|
173
|
+
constructor(request: Requester$1);
|
|
185
174
|
create(input: CreateInvoiceInput): Promise<Invoice>;
|
|
186
175
|
get(id: string): Promise<Record<string, unknown>>;
|
|
187
176
|
getStatus(id: string): Promise<InvoiceStatus>;
|
|
@@ -189,6 +178,17 @@ declare class InvoicesResource {
|
|
|
189
178
|
downloadPdf(id: string): Promise<DownloadUrlResponse>;
|
|
190
179
|
}
|
|
191
180
|
|
|
181
|
+
type Requester = (method: string, path: string, body?: unknown, params?: Record<string, string | number | undefined>) => Promise<unknown>;
|
|
182
|
+
declare class ProductsResource {
|
|
183
|
+
private request;
|
|
184
|
+
constructor(request: Requester);
|
|
185
|
+
create(input: CreateProductInput): Promise<Product>;
|
|
186
|
+
list(params?: ProductListParams): Promise<PaginatedResponse<Product>>;
|
|
187
|
+
get(id: string): Promise<Product>;
|
|
188
|
+
update(id: string, input: UpdateProductInput): Promise<Product>;
|
|
189
|
+
delete(id: string): Promise<void>;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
192
|
declare class Factuplan {
|
|
193
193
|
private readonly apiKey;
|
|
194
194
|
private readonly baseUrl;
|
package/dist/index.d.ts
CHANGED
|
@@ -167,21 +167,10 @@ declare class CustomersResource {
|
|
|
167
167
|
delete(id: string): Promise<void>;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
type Requester$1 = (method: string, path: string, body?: unknown
|
|
171
|
-
declare class ProductsResource {
|
|
172
|
-
private request;
|
|
173
|
-
constructor(request: Requester$1);
|
|
174
|
-
create(input: CreateProductInput): Promise<Product>;
|
|
175
|
-
list(params?: ProductListParams): Promise<PaginatedResponse<Product>>;
|
|
176
|
-
get(id: string): Promise<Product>;
|
|
177
|
-
update(id: string, input: UpdateProductInput): Promise<Product>;
|
|
178
|
-
delete(id: string): Promise<void>;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
type Requester = (method: string, path: string, body?: unknown) => Promise<unknown>;
|
|
170
|
+
type Requester$1 = (method: string, path: string, body?: unknown) => Promise<unknown>;
|
|
182
171
|
declare class InvoicesResource {
|
|
183
172
|
private request;
|
|
184
|
-
constructor(request: Requester);
|
|
173
|
+
constructor(request: Requester$1);
|
|
185
174
|
create(input: CreateInvoiceInput): Promise<Invoice>;
|
|
186
175
|
get(id: string): Promise<Record<string, unknown>>;
|
|
187
176
|
getStatus(id: string): Promise<InvoiceStatus>;
|
|
@@ -189,6 +178,17 @@ declare class InvoicesResource {
|
|
|
189
178
|
downloadPdf(id: string): Promise<DownloadUrlResponse>;
|
|
190
179
|
}
|
|
191
180
|
|
|
181
|
+
type Requester = (method: string, path: string, body?: unknown, params?: Record<string, string | number | undefined>) => Promise<unknown>;
|
|
182
|
+
declare class ProductsResource {
|
|
183
|
+
private request;
|
|
184
|
+
constructor(request: Requester);
|
|
185
|
+
create(input: CreateProductInput): Promise<Product>;
|
|
186
|
+
list(params?: ProductListParams): Promise<PaginatedResponse<Product>>;
|
|
187
|
+
get(id: string): Promise<Product>;
|
|
188
|
+
update(id: string, input: UpdateProductInput): Promise<Product>;
|
|
189
|
+
delete(id: string): Promise<void>;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
192
|
declare class Factuplan {
|
|
193
193
|
private readonly apiKey;
|
|
194
194
|
private readonly baseUrl;
|
package/dist/index.js
CHANGED
|
@@ -72,28 +72,6 @@ var CustomersResource = class {
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
// src/resources/products.ts
|
|
76
|
-
var ProductsResource = class {
|
|
77
|
-
constructor(request) {
|
|
78
|
-
this.request = request;
|
|
79
|
-
}
|
|
80
|
-
async create(input) {
|
|
81
|
-
return this.request("POST", "/developer/products", input);
|
|
82
|
-
}
|
|
83
|
-
async list(params) {
|
|
84
|
-
return this.request("GET", "/developer/products", void 0, params);
|
|
85
|
-
}
|
|
86
|
-
async get(id) {
|
|
87
|
-
return this.request("GET", `/developer/products/${id}`);
|
|
88
|
-
}
|
|
89
|
-
async update(id, input) {
|
|
90
|
-
return this.request("PATCH", `/developer/products/${id}`, input);
|
|
91
|
-
}
|
|
92
|
-
async delete(id) {
|
|
93
|
-
await this.request("DELETE", `/developer/products/${id}`);
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
|
|
97
75
|
// src/resources/invoices.ts
|
|
98
76
|
var InvoicesResource = class {
|
|
99
77
|
constructor(request) {
|
|
@@ -116,8 +94,30 @@ var InvoicesResource = class {
|
|
|
116
94
|
}
|
|
117
95
|
};
|
|
118
96
|
|
|
97
|
+
// src/resources/products.ts
|
|
98
|
+
var ProductsResource = class {
|
|
99
|
+
constructor(request) {
|
|
100
|
+
this.request = request;
|
|
101
|
+
}
|
|
102
|
+
async create(input) {
|
|
103
|
+
return this.request("POST", "/developer/products", input);
|
|
104
|
+
}
|
|
105
|
+
async list(params) {
|
|
106
|
+
return this.request("GET", "/developer/products", void 0, params);
|
|
107
|
+
}
|
|
108
|
+
async get(id) {
|
|
109
|
+
return this.request("GET", `/developer/products/${id}`);
|
|
110
|
+
}
|
|
111
|
+
async update(id, input) {
|
|
112
|
+
return this.request("PATCH", `/developer/products/${id}`, input);
|
|
113
|
+
}
|
|
114
|
+
async delete(id) {
|
|
115
|
+
await this.request("DELETE", `/developer/products/${id}`);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
119
|
// src/client.ts
|
|
120
|
-
var DEFAULT_BASE_URL = "
|
|
120
|
+
var DEFAULT_BASE_URL = "http://api-rest.factuplan.com.ec/api/v1";
|
|
121
121
|
var DEFAULT_TIMEOUT = 3e4;
|
|
122
122
|
var Factuplan = class {
|
|
123
123
|
constructor(apiKey, options) {
|
|
@@ -150,7 +150,7 @@ var Factuplan = class {
|
|
|
150
150
|
}
|
|
151
151
|
const headers = {
|
|
152
152
|
"x-api-key": this.apiKey,
|
|
153
|
-
|
|
153
|
+
Accept: "application/json"
|
|
154
154
|
};
|
|
155
155
|
if (body !== void 0) {
|
|
156
156
|
headers["Content-Type"] = "application/json";
|
package/dist/index.mjs
CHANGED
|
@@ -43,28 +43,6 @@ var CustomersResource = class {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
// src/resources/products.ts
|
|
47
|
-
var ProductsResource = class {
|
|
48
|
-
constructor(request) {
|
|
49
|
-
this.request = request;
|
|
50
|
-
}
|
|
51
|
-
async create(input) {
|
|
52
|
-
return this.request("POST", "/developer/products", input);
|
|
53
|
-
}
|
|
54
|
-
async list(params) {
|
|
55
|
-
return this.request("GET", "/developer/products", void 0, params);
|
|
56
|
-
}
|
|
57
|
-
async get(id) {
|
|
58
|
-
return this.request("GET", `/developer/products/${id}`);
|
|
59
|
-
}
|
|
60
|
-
async update(id, input) {
|
|
61
|
-
return this.request("PATCH", `/developer/products/${id}`, input);
|
|
62
|
-
}
|
|
63
|
-
async delete(id) {
|
|
64
|
-
await this.request("DELETE", `/developer/products/${id}`);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
46
|
// src/resources/invoices.ts
|
|
69
47
|
var InvoicesResource = class {
|
|
70
48
|
constructor(request) {
|
|
@@ -87,8 +65,30 @@ var InvoicesResource = class {
|
|
|
87
65
|
}
|
|
88
66
|
};
|
|
89
67
|
|
|
68
|
+
// src/resources/products.ts
|
|
69
|
+
var ProductsResource = class {
|
|
70
|
+
constructor(request) {
|
|
71
|
+
this.request = request;
|
|
72
|
+
}
|
|
73
|
+
async create(input) {
|
|
74
|
+
return this.request("POST", "/developer/products", input);
|
|
75
|
+
}
|
|
76
|
+
async list(params) {
|
|
77
|
+
return this.request("GET", "/developer/products", void 0, params);
|
|
78
|
+
}
|
|
79
|
+
async get(id) {
|
|
80
|
+
return this.request("GET", `/developer/products/${id}`);
|
|
81
|
+
}
|
|
82
|
+
async update(id, input) {
|
|
83
|
+
return this.request("PATCH", `/developer/products/${id}`, input);
|
|
84
|
+
}
|
|
85
|
+
async delete(id) {
|
|
86
|
+
await this.request("DELETE", `/developer/products/${id}`);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
90
|
// src/client.ts
|
|
91
|
-
var DEFAULT_BASE_URL = "
|
|
91
|
+
var DEFAULT_BASE_URL = "http://api-rest.factuplan.com.ec/api/v1";
|
|
92
92
|
var DEFAULT_TIMEOUT = 3e4;
|
|
93
93
|
var Factuplan = class {
|
|
94
94
|
constructor(apiKey, options) {
|
|
@@ -121,7 +121,7 @@ var Factuplan = class {
|
|
|
121
121
|
}
|
|
122
122
|
const headers = {
|
|
123
123
|
"x-api-key": this.apiKey,
|
|
124
|
-
|
|
124
|
+
Accept: "application/json"
|
|
125
125
|
};
|
|
126
126
|
if (body !== void 0) {
|
|
127
127
|
headers["Content-Type"] = "application/json";
|
package/package.json
CHANGED