@etainabl/nodejs-sdk 1.2.36 → 1.2.38
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/.prettierrc +11 -0
- package/dist/cjs/index.js +17 -7
- package/eslint.config.js +60 -0
- package/package.json +10 -1
- package/src/types/{account.d.ts → account.ts} +2 -2
- package/src/types/{asset.d.ts → asset.ts} +1 -1
- package/src/types/{automation.d.ts → automation.ts} +3 -5
- package/src/types/{company.d.ts → company.ts} +1 -1
- package/src/types/{dataIngest.d.ts → dataIngest.ts} +1 -2
- package/src/types/{entity.d.ts → entity.ts} +5 -6
- package/src/types/index.ts +13 -30
- package/src/types/{invoice.d.ts → invoice.ts} +20 -8
- package/.eslintrc.js +0 -29
- /package/src/types/{address.d.ts → address.ts} +0 -0
- /package/src/types/{email.d.ts → email.ts} +0 -0
- /package/src/types/{log.d.ts → log.ts} +0 -0
- /package/src/types/{portal.d.ts → portal.ts} +0 -0
- /package/src/types/{reading.d.ts → reading.ts} +0 -0
- /package/src/types/{report.d.ts → report.ts} +0 -0
- /package/src/types/{scraperRun.d.ts → scraperRun.ts} +0 -0
- /package/src/types/{statusHistory.d.ts → statusHistory.ts} +0 -0
- /package/src/types/{supplier.d.ts → supplier.ts} +0 -0
package/.prettierrc
ADDED
package/dist/cjs/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
37
|
};
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import tseslint from '@typescript-eslint/eslint-plugin';
|
|
2
|
+
import tsParser from '@typescript-eslint/parser';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
{
|
|
6
|
+
ignores: [
|
|
7
|
+
'node_modules/**',
|
|
8
|
+
'dist/**',
|
|
9
|
+
'coverage/**',
|
|
10
|
+
'logs/**',
|
|
11
|
+
'*.log',
|
|
12
|
+
'.DS_Store'
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
files: ['**/*.js', '**/*.ts'],
|
|
17
|
+
plugins: {
|
|
18
|
+
'@typescript-eslint': tseslint
|
|
19
|
+
},
|
|
20
|
+
languageOptions: {
|
|
21
|
+
parser: tsParser,
|
|
22
|
+
ecmaVersion: 2020,
|
|
23
|
+
sourceType: 'module',
|
|
24
|
+
parserOptions: {
|
|
25
|
+
ecmaVersion: 2020,
|
|
26
|
+
sourceType: 'module'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
linterOptions: {
|
|
30
|
+
reportUnusedDisableDirectives: true
|
|
31
|
+
},
|
|
32
|
+
rules: {
|
|
33
|
+
'no-console': 'off',
|
|
34
|
+
'comma-dangle': ['error', 'never'],
|
|
35
|
+
'arrow-parens': ['error', 'as-needed'],
|
|
36
|
+
'linebreak-style': 'off',
|
|
37
|
+
'padded-blocks': 'off',
|
|
38
|
+
'no-underscore-dangle': 'off',
|
|
39
|
+
'no-param-reassign': ['error', { props: false }],
|
|
40
|
+
'new-cap': ['error', { capIsNewExceptions: ['Router', 'ObjectId'] }],
|
|
41
|
+
'no-tabs': 'error',
|
|
42
|
+
'max-len': ['warn', 150],
|
|
43
|
+
'no-plusplus': 'off',
|
|
44
|
+
'generator-star-spacing': 'off',
|
|
45
|
+
'class-methods-use-this': 'off',
|
|
46
|
+
'import/extensions': 'off',
|
|
47
|
+
'import/no-unresolved': 'off',
|
|
48
|
+
'prefer-destructuring': 'off',
|
|
49
|
+
'no-use-before-define': 'off',
|
|
50
|
+
'import/prefer-default-export': 'off'
|
|
51
|
+
},
|
|
52
|
+
settings: {
|
|
53
|
+
'import/resolver': {
|
|
54
|
+
node: {
|
|
55
|
+
extensions: ['.js', '.ts']
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etainabl/nodejs-sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.38",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/mjs/index.js",
|
|
6
6
|
"types": "dist/mjs/index.d.ts",
|
|
@@ -13,7 +13,16 @@
|
|
|
13
13
|
"winston": "^3.10.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
+
"@babel/eslint-parser": "^7.27.0",
|
|
16
17
|
"@types/node": "^20.4.5",
|
|
18
|
+
"@typescript-eslint/eslint-plugin": "^8.29.0",
|
|
19
|
+
"@typescript-eslint/parser": "^8.29.0",
|
|
20
|
+
"eslint": "^9.23.0",
|
|
21
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
22
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
23
|
+
"eslint-config-prettier": "^10.1.1",
|
|
24
|
+
"eslint-plugin-import": "^2.31.0",
|
|
25
|
+
"prettier-eslint": "^16.3.0",
|
|
17
26
|
"vitest": "^2.1.1"
|
|
18
27
|
},
|
|
19
28
|
"scripts": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Portal } from './portal.
|
|
2
|
-
import type { StatusHistory } from './statusHistory.
|
|
1
|
+
import type { Portal } from './portal.js';
|
|
2
|
+
import type { StatusHistory } from './statusHistory.js'
|
|
3
3
|
|
|
4
4
|
interface PortalAccountSchema extends Portal{
|
|
5
5
|
invoiceFilenames: any[];
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Types } from 'mongoose';
|
|
2
|
-
|
|
3
1
|
interface Log {
|
|
4
2
|
message: string;
|
|
5
3
|
timestamp: Date;
|
|
@@ -29,8 +27,8 @@ export interface Automation {
|
|
|
29
27
|
data: Record<string, any>;
|
|
30
28
|
sourceData: Record<string, any>;
|
|
31
29
|
frequency?: FrequencyType;
|
|
32
|
-
accountIds?:
|
|
33
|
-
assetIds?:
|
|
30
|
+
accountIds?: string[];
|
|
31
|
+
assetIds?: string[];
|
|
34
32
|
userSub: string;
|
|
35
|
-
companyId:
|
|
33
|
+
companyId: string;
|
|
36
34
|
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Address} from './address.ts';
|
|
1
|
+
import { Address } from './address.js';
|
|
3
2
|
|
|
4
3
|
type EntityType = 'fund' | 'company' | 'charity' | 'school/university' | 'council' | 'other';
|
|
5
4
|
|
|
6
5
|
export interface Entity {
|
|
7
|
-
_id?:
|
|
6
|
+
_id?: string;
|
|
8
7
|
legalName: string;
|
|
9
8
|
type: EntityType;
|
|
10
9
|
companyNumber?: string;
|
|
11
10
|
companyLogo?: string;
|
|
12
11
|
billingAddress: Address;
|
|
13
|
-
parentEntityId?:
|
|
14
|
-
ultimateParentEntityId?:
|
|
15
|
-
companyId:
|
|
12
|
+
parentEntityId?: string;
|
|
13
|
+
ultimateParentEntityId?: string;
|
|
14
|
+
companyId: string;
|
|
16
15
|
batchId?: string;
|
|
17
16
|
userSub: string;
|
|
18
17
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -1,33 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export type {
|
|
16
|
-
Account,
|
|
17
|
-
Asset,
|
|
18
|
-
Automation,
|
|
19
|
-
Company,
|
|
20
|
-
CreateScraperRunParams,
|
|
21
|
-
DataIngest,
|
|
22
|
-
Email,
|
|
23
|
-
Entity,
|
|
24
|
-
Invoice,
|
|
25
|
-
Log,
|
|
26
|
-
Reading,
|
|
27
|
-
Report,
|
|
28
|
-
ScraperRun,
|
|
29
|
-
Supplier
|
|
30
|
-
};
|
|
1
|
+
export type { Account } from './account.js'
|
|
2
|
+
export type { Asset } from './asset.js'
|
|
3
|
+
export type { Automation } from './automation.js'
|
|
4
|
+
export type { Company } from './company.js'
|
|
5
|
+
export type { CreateScraperRunParams, ScraperRun } from './scraperRun.js';
|
|
6
|
+
export type { DataIngest } from './dataIngest.js'
|
|
7
|
+
export type { Entity } from './entity.js'
|
|
8
|
+
export type { Email } from './email.js';
|
|
9
|
+
export type { Invoice } from './invoice.js';
|
|
10
|
+
export type { Log } from './log.js';
|
|
11
|
+
export type { Reading } from './reading.js'
|
|
12
|
+
export type { Report } from './report.js'
|
|
13
|
+
export type { Supplier } from './supplier.js'
|
|
31
14
|
|
|
32
15
|
export interface ETNPagedResponse<T = any> {
|
|
33
16
|
data: T[];
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Types } from 'mongoose';
|
|
2
|
-
|
|
3
1
|
interface Values {
|
|
4
2
|
friendlyInvoiceNumber?: string;
|
|
5
3
|
friendlySupplierRef?: string;
|
|
@@ -61,9 +59,23 @@ interface Values {
|
|
|
61
59
|
endRead?: string;
|
|
62
60
|
}
|
|
63
61
|
|
|
62
|
+
interface Rate {
|
|
63
|
+
consumption?: string;
|
|
64
|
+
cost?: string;
|
|
65
|
+
endDate?: Date | null;
|
|
66
|
+
endRead?: string | null;
|
|
67
|
+
endReadType?: string | null;
|
|
68
|
+
rateName?: string | null;
|
|
69
|
+
startDate?: Date | null;
|
|
70
|
+
startRead?: string | null;
|
|
71
|
+
startReadType?: string | null;
|
|
72
|
+
type: RateType | null;
|
|
73
|
+
unitRate?: string | null;
|
|
74
|
+
}
|
|
75
|
+
|
|
64
76
|
type InvoiceStatus = 'processing' | 'pending' | 'uploading' | 'queued' | 'captured' | 'error' | 'completed';
|
|
65
77
|
type FinancialStatus = 'approved' | 'new' | 'not-approved' | 'paid' | 'sent-for-payment';
|
|
66
|
-
|
|
78
|
+
type RateType = 'unitRate' | 'daily' | 'levy' | 'tax' | 'kva' | 'waterRate' | 'wasteRate' | 'discount'
|
|
67
79
|
export interface Invoice {
|
|
68
80
|
jobId?: string | null;
|
|
69
81
|
startTime?: Date;
|
|
@@ -79,7 +91,7 @@ export interface Invoice {
|
|
|
79
91
|
tags?: string[];
|
|
80
92
|
manualResults?: Record<string, any>;
|
|
81
93
|
values?: Values;
|
|
82
|
-
rates?:
|
|
94
|
+
rates?: Rate[];
|
|
83
95
|
detailedResults?: Record<string, any>;
|
|
84
96
|
templateVersion?: string | null;
|
|
85
97
|
error?: Record<string, any>;
|
|
@@ -95,12 +107,12 @@ export interface Invoice {
|
|
|
95
107
|
scraperInvoiceId?: string;
|
|
96
108
|
confirmedAt?: Date | null;
|
|
97
109
|
confirmedBy?: string | null;
|
|
98
|
-
supplierId?:
|
|
110
|
+
supplierId?: string | null;
|
|
99
111
|
sisterId?: string | null;
|
|
100
112
|
batchId?: string | null;
|
|
101
|
-
accountId?:
|
|
102
|
-
entityId?:
|
|
103
|
-
companyId:
|
|
113
|
+
accountId?: string | null;
|
|
114
|
+
entityId?: string;
|
|
115
|
+
companyId: string;
|
|
104
116
|
userSub: string;
|
|
105
117
|
validation?: any[];
|
|
106
118
|
}
|
package/.eslintrc.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['airbnb-base'],
|
|
3
|
-
parser: '@typescript-eslint/parser',
|
|
4
|
-
rules: {
|
|
5
|
-
'no-console': 'off',
|
|
6
|
-
'comma-dangle': [2, 'never'],
|
|
7
|
-
'arrow-parens': [2, 'as-needed'],
|
|
8
|
-
'linebreak-style': 0,
|
|
9
|
-
'padded-blocks': 0,
|
|
10
|
-
'no-underscore-dangle': [0],
|
|
11
|
-
'no-param-reassign': [2, { props: false }],
|
|
12
|
-
'new-cap': [2, { capIsNewExceptions: ['Router', 'ObjectId'] }],
|
|
13
|
-
'no-tabs': 2,
|
|
14
|
-
'max-len': [1, 150],
|
|
15
|
-
'no-plusplus': 0,
|
|
16
|
-
'generator-star-spacing': 0,
|
|
17
|
-
'class-methods-use-this': 0,
|
|
18
|
-
'import/extensions': 0,
|
|
19
|
-
'import/no-unresolved': 0,
|
|
20
|
-
'prefer-destructuring': 0,
|
|
21
|
-
'no-use-before-define': 0,
|
|
22
|
-
'import/prefer-default-export': 'off'
|
|
23
|
-
},
|
|
24
|
-
env: {
|
|
25
|
-
node: true,
|
|
26
|
-
browser: true
|
|
27
|
-
},
|
|
28
|
-
parserOptions: { ecmaVersion: 2020 }
|
|
29
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|