@etainabl/nodejs-sdk 1.2.18 → 1.2.20
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/cjs/api.d.ts +3 -2
- package/dist/cjs/api.js +3 -0
- package/dist/cjs/units.d.ts +3 -3
- package/dist/mjs/api.d.ts +3 -2
- package/dist/mjs/api.js +3 -0
- package/dist/mjs/units.d.ts +3 -3
- package/package.json +1 -1
- package/src/api.ts +5 -1
- package/vitest.workspace.js +5 -0
package/dist/cjs/api.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { AxiosRequestConfig, AxiosInstance, CreateAxiosDefaults } from 'axios';
|
|
2
|
-
import type { Account, Asset, Company, Invoice, Log, Reading, Supplier } from '../types/index.js';
|
|
3
2
|
export interface ETNPagedResponse<T = any> {
|
|
4
3
|
data: T[];
|
|
5
4
|
total: number;
|
|
@@ -22,6 +21,7 @@ declare const _default: (auth: AuthOptions, instanceOptions?: CreateAxiosDefault
|
|
|
22
21
|
createAccount: (data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
23
22
|
removeAccount: (id: string, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
24
23
|
getAccountSchema: (options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
24
|
+
invalidateAccountCache: (id: string, data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
25
25
|
getAsset: (id: string, options?: AxiosRequestConfig<any>) => Promise<Asset>;
|
|
26
26
|
listAssets: (options?: AxiosRequestConfig<any>) => Promise<ETNPagedResponse<Asset>>;
|
|
27
27
|
updateAsset: (id: string, data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
@@ -94,7 +94,8 @@ declare const _default: (auth: AuthOptions, instanceOptions?: CreateAxiosDefault
|
|
|
94
94
|
createInvoice: (data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
95
95
|
removeInvoice: (id: string, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
96
96
|
getInvoiceSchema: (options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
97
|
-
getSupplierSchema: (options?: AxiosRequestConfig<any>) => Promise<
|
|
97
|
+
getSupplierSchema: (options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
98
|
+
getImportTemplate: (id: string, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
98
99
|
updateDataIngest: (id: string, data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
99
100
|
createDataIngest: (data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
100
101
|
listDataIngest: (options?: AxiosRequestConfig<any>) => Promise<ETNPagedResponse<DataIngest>>;
|
package/dist/cjs/api.js
CHANGED
|
@@ -207,6 +207,7 @@ exports.default = (auth, instanceOptions = {}) => {
|
|
|
207
207
|
createAccount: factory.create(etainablApi, 'accounts'),
|
|
208
208
|
removeAccount: factory.remove(etainablApi, 'accounts'),
|
|
209
209
|
getAccountSchema: factory.get(etainablApi, 'accounts', 'schema'),
|
|
210
|
+
invalidateAccountCache: factory.customWithId(etainablApi, 'put', 'accounts', 'invalidate-cache'),
|
|
210
211
|
// assets
|
|
211
212
|
getAsset: factory.getWithId(etainablApi, 'assets'),
|
|
212
213
|
listAssets: factory.list(etainablApi, 'assets'),
|
|
@@ -294,6 +295,8 @@ exports.default = (auth, instanceOptions = {}) => {
|
|
|
294
295
|
getInvoiceSchema: factory.get(etainablApi, 'invoices', 'schema'),
|
|
295
296
|
//suppliers
|
|
296
297
|
getSupplierSchema: factory.get(etainablApi, 'suppliers', 'schema'),
|
|
298
|
+
// import templates
|
|
299
|
+
getImportTemplate: factory.getWithId(etainablApi, 'import-templates'),
|
|
297
300
|
//data imports
|
|
298
301
|
updateDataIngest: factory.update(etainablApi, 'data-ingests'),
|
|
299
302
|
createDataIngest: factory.create(etainablApi, 'data-ingests'),
|
package/dist/cjs/units.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ interface Item {
|
|
|
5
5
|
value: number;
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
}
|
|
8
|
-
export type AccountType = 'electricity' | 'gas' | 'water' | 'waste' | 'solar' | 'heating' | 'flow' | 'cooling' | 'temperature' | 'other';
|
|
9
|
-
export type ETNUnit = 'kwh' | 'kg' | 'm3' | 'lbs' | 'tonnes' | 'wh' | 'mwh' | 'ft3' | 'hcf' | 'm3/h' | 'qty' | 'l' | 'C' | 'mcuf' | 'hcuf' | 'tcuf' | 'ocuf' | 'hm3' | 'tm3' | 'nm3';
|
|
10
|
-
export type BaseUnit = 'kwh' | 'm3' | 'C' | 'kg' | 'm3/h';
|
|
8
|
+
export declare type AccountType = 'electricity' | 'gas' | 'water' | 'waste' | 'solar' | 'heating' | 'flow' | 'cooling' | 'temperature' | 'other';
|
|
9
|
+
export declare type ETNUnit = 'kwh' | 'kg' | 'm3' | 'lbs' | 'tonnes' | 'wh' | 'mwh' | 'ft3' | 'hcf' | 'm3/h' | 'qty' | 'l' | 'C' | 'mcuf' | 'hcuf' | 'tcuf' | 'ocuf' | 'hm3' | 'tm3' | 'nm3';
|
|
10
|
+
export declare type BaseUnit = 'kwh' | 'm3' | 'C' | 'kg' | 'm3/h';
|
|
11
11
|
export declare const accountTypeMap: {
|
|
12
12
|
[key: string]: BaseUnit;
|
|
13
13
|
};
|
package/dist/mjs/api.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { AxiosRequestConfig, AxiosInstance, CreateAxiosDefaults } from 'axios';
|
|
2
|
-
import type { Account, Asset, Company, Invoice, Log, Reading, Supplier } from '../types/index.js';
|
|
3
2
|
export interface ETNPagedResponse<T = any> {
|
|
4
3
|
data: T[];
|
|
5
4
|
total: number;
|
|
@@ -22,6 +21,7 @@ declare const _default: (auth: AuthOptions, instanceOptions?: CreateAxiosDefault
|
|
|
22
21
|
createAccount: (data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
23
22
|
removeAccount: (id: string, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
24
23
|
getAccountSchema: (options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
24
|
+
invalidateAccountCache: (id: string, data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
25
25
|
getAsset: (id: string, options?: AxiosRequestConfig<any>) => Promise<Asset>;
|
|
26
26
|
listAssets: (options?: AxiosRequestConfig<any>) => Promise<ETNPagedResponse<Asset>>;
|
|
27
27
|
updateAsset: (id: string, data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
@@ -94,7 +94,8 @@ declare const _default: (auth: AuthOptions, instanceOptions?: CreateAxiosDefault
|
|
|
94
94
|
createInvoice: (data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
95
95
|
removeInvoice: (id: string, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
96
96
|
getInvoiceSchema: (options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
97
|
-
getSupplierSchema: (options?: AxiosRequestConfig<any>) => Promise<
|
|
97
|
+
getSupplierSchema: (options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
98
|
+
getImportTemplate: (id: string, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
98
99
|
updateDataIngest: (id: string, data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
99
100
|
createDataIngest: (data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
|
|
100
101
|
listDataIngest: (options?: AxiosRequestConfig<any>) => Promise<ETNPagedResponse<DataIngest>>;
|
package/dist/mjs/api.js
CHANGED
|
@@ -197,6 +197,7 @@ export default (auth, instanceOptions = {}) => {
|
|
|
197
197
|
createAccount: factory.create(etainablApi, 'accounts'),
|
|
198
198
|
removeAccount: factory.remove(etainablApi, 'accounts'),
|
|
199
199
|
getAccountSchema: factory.get(etainablApi, 'accounts', 'schema'),
|
|
200
|
+
invalidateAccountCache: factory.customWithId(etainablApi, 'put', 'accounts', 'invalidate-cache'),
|
|
200
201
|
// assets
|
|
201
202
|
getAsset: factory.getWithId(etainablApi, 'assets'),
|
|
202
203
|
listAssets: factory.list(etainablApi, 'assets'),
|
|
@@ -284,6 +285,8 @@ export default (auth, instanceOptions = {}) => {
|
|
|
284
285
|
getInvoiceSchema: factory.get(etainablApi, 'invoices', 'schema'),
|
|
285
286
|
//suppliers
|
|
286
287
|
getSupplierSchema: factory.get(etainablApi, 'suppliers', 'schema'),
|
|
288
|
+
// import templates
|
|
289
|
+
getImportTemplate: factory.getWithId(etainablApi, 'import-templates'),
|
|
287
290
|
//data imports
|
|
288
291
|
updateDataIngest: factory.update(etainablApi, 'data-ingests'),
|
|
289
292
|
createDataIngest: factory.create(etainablApi, 'data-ingests'),
|
package/dist/mjs/units.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ interface Item {
|
|
|
5
5
|
value: number;
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
}
|
|
8
|
-
export type AccountType = 'electricity' | 'gas' | 'water' | 'waste' | 'solar' | 'heating' | 'flow' | 'cooling' | 'temperature' | 'other';
|
|
9
|
-
export type ETNUnit = 'kwh' | 'kg' | 'm3' | 'lbs' | 'tonnes' | 'wh' | 'mwh' | 'ft3' | 'hcf' | 'm3/h' | 'qty' | 'l' | 'C' | 'mcuf' | 'hcuf' | 'tcuf' | 'ocuf' | 'hm3' | 'tm3' | 'nm3';
|
|
10
|
-
export type BaseUnit = 'kwh' | 'm3' | 'C' | 'kg' | 'm3/h';
|
|
8
|
+
export declare type AccountType = 'electricity' | 'gas' | 'water' | 'waste' | 'solar' | 'heating' | 'flow' | 'cooling' | 'temperature' | 'other';
|
|
9
|
+
export declare type ETNUnit = 'kwh' | 'kg' | 'm3' | 'lbs' | 'tonnes' | 'wh' | 'mwh' | 'ft3' | 'hcf' | 'm3/h' | 'qty' | 'l' | 'C' | 'mcuf' | 'hcuf' | 'tcuf' | 'ocuf' | 'hm3' | 'tm3' | 'nm3';
|
|
10
|
+
export declare type BaseUnit = 'kwh' | 'm3' | 'C' | 'kg' | 'm3/h';
|
|
11
11
|
export declare const accountTypeMap: {
|
|
12
12
|
[key: string]: BaseUnit;
|
|
13
13
|
};
|
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -253,6 +253,7 @@ export default (auth: AuthOptions, instanceOptions: CreateAxiosDefaults = {}) =>
|
|
|
253
253
|
createAccount: factory.create(etainablApi, 'accounts'),
|
|
254
254
|
removeAccount: factory.remove(etainablApi, 'accounts'),
|
|
255
255
|
getAccountSchema: factory.get(etainablApi, 'accounts', 'schema'),
|
|
256
|
+
invalidateAccountCache: factory.customWithId(etainablApi, 'put', 'accounts', 'invalidate-cache'),
|
|
256
257
|
|
|
257
258
|
// assets
|
|
258
259
|
getAsset: factory.getWithId<Asset>(etainablApi, 'assets'),
|
|
@@ -353,7 +354,10 @@ export default (auth: AuthOptions, instanceOptions: CreateAxiosDefaults = {}) =>
|
|
|
353
354
|
getInvoiceSchema: factory.get(etainablApi, 'invoices', 'schema'),
|
|
354
355
|
|
|
355
356
|
//suppliers
|
|
356
|
-
getSupplierSchema: factory.get
|
|
357
|
+
getSupplierSchema: factory.get(etainablApi, 'suppliers', 'schema'),
|
|
358
|
+
|
|
359
|
+
// import templates
|
|
360
|
+
getImportTemplate: factory.getWithId(etainablApi, 'import-templates'),
|
|
357
361
|
|
|
358
362
|
//data imports
|
|
359
363
|
updateDataIngest: factory.update(etainablApi, 'data-ingests'),
|