@etainabl/nodejs-sdk 1.2.17 → 1.2.19

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 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;
@@ -94,6 +93,10 @@ declare const _default: (auth: AuthOptions, instanceOptions?: CreateAxiosDefault
94
93
  createInvoice: (data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
95
94
  removeInvoice: (id: string, options?: AxiosRequestConfig<any>) => Promise<any>;
96
95
  getInvoiceSchema: (options?: AxiosRequestConfig<any>) => Promise<any>;
97
- getSupplierSchema: (options?: AxiosRequestConfig<any>) => Promise<Supplier>;
96
+ getSupplierSchema: (options?: AxiosRequestConfig<any>) => Promise<any>;
97
+ getImportTemplate: (id: string, options?: AxiosRequestConfig<any>) => Promise<any>;
98
+ updateDataIngest: (id: string, data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
99
+ createDataIngest: (data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
100
+ listDataIngest: (options?: AxiosRequestConfig<any>) => Promise<ETNPagedResponse<DataIngest>>;
98
101
  };
99
102
  export default _default;
package/dist/cjs/api.js CHANGED
@@ -293,7 +293,13 @@ exports.default = (auth, instanceOptions = {}) => {
293
293
  removeInvoice: factory.remove(etainablApi, 'invoices'),
294
294
  getInvoiceSchema: factory.get(etainablApi, 'invoices', 'schema'),
295
295
  //suppliers
296
- getSupplierSchema: factory.get(etainablApi, 'suppliers', 'schema')
296
+ getSupplierSchema: factory.get(etainablApi, 'suppliers', 'schema'),
297
+ // import templates
298
+ getImportTemplate: factory.getWithId(etainablApi, 'import-templates'),
299
+ //data imports
300
+ updateDataIngest: factory.update(etainablApi, 'data-ingests'),
301
+ createDataIngest: factory.create(etainablApi, 'data-ingests'),
302
+ listDataIngest: factory.list(etainablApi, 'data-ingests'),
297
303
  };
298
304
  }
299
305
  catch (e) {
@@ -6,6 +6,6 @@ import * as units from './units.js';
6
6
  import * as consumption from './consumption.js';
7
7
  import * as monitoring from './monitoring.js';
8
8
  import * as reporting from './reporting.js';
9
- import type { Account, Asset, Automation, Company, Invoice, Log, Reading, Supplier } from '../types/index.d.js';
9
+ import type { Account, Asset, Automation, Company, DataIngest, Invoice, Log, Reading, Supplier } from '../types/index.d.js';
10
10
  export { api, logger, consumption, monitoring, db, slack, units, reporting };
11
- export type { Account, Asset, Automation, Company, Invoice, Log, Reading, Supplier };
11
+ export type { Account, Asset, Automation, Company, DataIngest, Invoice, Log, Reading, Supplier };
@@ -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;
@@ -94,6 +93,10 @@ declare const _default: (auth: AuthOptions, instanceOptions?: CreateAxiosDefault
94
93
  createInvoice: (data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
95
94
  removeInvoice: (id: string, options?: AxiosRequestConfig<any>) => Promise<any>;
96
95
  getInvoiceSchema: (options?: AxiosRequestConfig<any>) => Promise<any>;
97
- getSupplierSchema: (options?: AxiosRequestConfig<any>) => Promise<Supplier>;
96
+ getSupplierSchema: (options?: AxiosRequestConfig<any>) => Promise<any>;
97
+ getImportTemplate: (id: string, options?: AxiosRequestConfig<any>) => Promise<any>;
98
+ updateDataIngest: (id: string, data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
99
+ createDataIngest: (data: any, options?: AxiosRequestConfig<any>) => Promise<any>;
100
+ listDataIngest: (options?: AxiosRequestConfig<any>) => Promise<ETNPagedResponse<DataIngest>>;
98
101
  };
99
102
  export default _default;
package/dist/mjs/api.js CHANGED
@@ -283,7 +283,13 @@ export default (auth, instanceOptions = {}) => {
283
283
  removeInvoice: factory.remove(etainablApi, 'invoices'),
284
284
  getInvoiceSchema: factory.get(etainablApi, 'invoices', 'schema'),
285
285
  //suppliers
286
- getSupplierSchema: factory.get(etainablApi, 'suppliers', 'schema')
286
+ getSupplierSchema: factory.get(etainablApi, 'suppliers', 'schema'),
287
+ // import templates
288
+ getImportTemplate: factory.getWithId(etainablApi, 'import-templates'),
289
+ //data imports
290
+ updateDataIngest: factory.update(etainablApi, 'data-ingests'),
291
+ createDataIngest: factory.create(etainablApi, 'data-ingests'),
292
+ listDataIngest: factory.list(etainablApi, 'data-ingests'),
287
293
  };
288
294
  }
289
295
  catch (e) {
@@ -6,6 +6,6 @@ import * as units from './units.js';
6
6
  import * as consumption from './consumption.js';
7
7
  import * as monitoring from './monitoring.js';
8
8
  import * as reporting from './reporting.js';
9
- import type { Account, Asset, Automation, Company, Invoice, Log, Reading, Supplier } from '../types/index.d.js';
9
+ import type { Account, Asset, Automation, Company, DataIngest, Invoice, Log, Reading, Supplier } from '../types/index.d.js';
10
10
  export { api, logger, consumption, monitoring, db, slack, units, reporting };
11
- export type { Account, Asset, Automation, Company, Invoice, Log, Reading, Supplier };
11
+ export type { Account, Asset, Automation, Company, DataIngest, Invoice, Log, Reading, Supplier };
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etainabl/nodejs-sdk",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/mjs/index.js",
6
6
  "author": "Jonathan Lambert <jonathan@etainabl.com>",
package/src/api.ts CHANGED
@@ -4,7 +4,7 @@ import https from 'https';
4
4
 
5
5
  import logger from './logger.js';
6
6
 
7
- import type { Account, Asset, Automation, Company, Invoice, Log, Reading, Supplier } from '../types/index.js'
7
+ import type { Account, Asset, Automation, Company, DataIngest, Invoice, Log, Reading, Supplier } from '../types/index.js'
8
8
 
9
9
  const log = logger('etainablApi');
10
10
 
@@ -353,7 +353,15 @@ export default (auth: AuthOptions, instanceOptions: CreateAxiosDefaults = {}) =>
353
353
  getInvoiceSchema: factory.get(etainablApi, 'invoices', 'schema'),
354
354
 
355
355
  //suppliers
356
- getSupplierSchema: factory.get<Supplier>(etainablApi, 'suppliers', 'schema')
356
+ getSupplierSchema: factory.get(etainablApi, 'suppliers', 'schema'),
357
+
358
+ // import templates
359
+ getImportTemplate: factory.getWithId(etainablApi, 'import-templates'),
360
+
361
+ //data imports
362
+ updateDataIngest: factory.update(etainablApi, 'data-ingests'),
363
+ createDataIngest: factory.create(etainablApi, 'data-ingests'),
364
+ listDataIngest: factory.list<DataIngest>(etainablApi, 'data-ingests'),
357
365
 
358
366
  }
359
367
  } catch (e) {
package/src/index.ts CHANGED
@@ -6,7 +6,7 @@ import * as units from './units.js';
6
6
  import * as consumption from './consumption.js';
7
7
  import * as monitoring from './monitoring.js';
8
8
  import * as reporting from './reporting.js';
9
- import type { Account, Asset, Automation, Company, Invoice, Log, Reading, Supplier } from '../types/index.d.js';
9
+ import type { Account, Asset, Automation, Company, DataIngest, Invoice, Log, Reading, Supplier } from '../types/index.d.js';
10
10
 
11
11
  export {
12
12
  api,
@@ -19,4 +19,4 @@ export {
19
19
  reporting
20
20
  }
21
21
 
22
- export type { Account, Asset, Automation, Company, Invoice, Log, Reading, Supplier };
22
+ export type { Account, Asset, Automation, Company, DataIngest, Invoice, Log, Reading, Supplier };
@@ -0,0 +1,8 @@
1
+ export interface DataImport {
2
+ messageId: string;
3
+ status: 'started' | 'processing' | 'importing' | 'completed' | 'failed' | 'dlq'
4
+ context: string
5
+ startTime: string;
6
+ remainingTime: number;
7
+ context: {}
8
+ }
package/types/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { Account } from './account.d.ts'
2
2
  import type { Asset } from './asset.d.ts'
3
3
  import type { Company } from './company.d.ts'
4
4
  import type { CreateScraperRunParams, ScraperRun } from './scraperRun.d.ts';
5
+ import type { DataIngest } from './dataIngest.js'
5
6
  import type { Email } from './email.d.ts';
6
7
  import type { Invoice } from './invoice.d.ts';
7
8
  import type { Log } from './log.d.ts';
@@ -14,6 +15,7 @@ export type {
14
15
  Automation,
15
16
  Company,
16
17
  CreateScraperRunParams,
18
+ DataIngest,
17
19
  Email,
18
20
  Invoice,
19
21
  Log,
@@ -0,0 +1,5 @@
1
+ import { defineWorkspace } from 'vitest/config'
2
+
3
+ export default defineWorkspace([
4
+ "./vitest.config.js"
5
+ ])