@dimo-network/data-sdk 1.2.1 → 1.2.3
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/.github/workflows/npm-publish.yml +12 -4
- package/CONTRIBUTING.md +7 -9
- package/README.md +62 -41
- package/dist/api/Method.d.ts +1 -1
- package/dist/api/Method.js +4 -4
- package/dist/api/resources/Attestation/index.js +3 -3
- package/dist/api/resources/Auth/index.js +1 -1
- package/dist/api/resources/DeviceDefinitions/index.js +17 -17
- package/dist/api/resources/Devices/index.js +1 -148
- package/dist/api/resources/DimoRestResources.d.ts +1 -2
- package/dist/api/resources/DimoRestResources.js +1 -2
- package/dist/api/resources/TokenExchange/index.js +2 -2
- package/dist/api/resources/Trips/index.js +1 -1
- package/dist/api/resources/Valuations/index.js +6 -6
- package/dist/dimo.d.ts +1 -2
- package/dist/dimo.js +1 -3
- package/dist/dimo.test.js +0 -4
- package/dist/graphql/Query.d.ts +2 -1
- package/dist/graphql/Query.js +19 -3
- package/dist/graphql/Query.test.js +6 -4
- package/dist/graphql/Resource.js +2 -1
- package/dist/graphql/functions/getVin.d.ts +5 -0
- package/dist/graphql/functions/getVin.js +33 -0
- package/dist/graphql/functions/index.d.ts +2 -0
- package/dist/graphql/functions/index.js +2 -0
- package/dist/graphql/resources/Telemetry/index.js +19 -2
- package/dist/index.cjs +143085 -0
- package/package.json +16 -3
- package/rollup.config.js +28 -0
- package/dist/api/resources/VehicleSignalDecoding/index.d.ts +0 -5
- package/dist/api/resources/VehicleSignalDecoding/index.js +0 -59
package/package.json
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dimo-network/data-sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "DIMO Data SDK for JavaScript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "James Li",
|
|
7
7
|
"contributors": [],
|
|
8
8
|
"license": "Apache-2.0",
|
|
9
9
|
"type": "module",
|
|
10
|
+
"exports": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
13
|
+
},
|
|
10
14
|
"keywords": [
|
|
11
|
-
"data-sdk"
|
|
15
|
+
"data-sdk",
|
|
16
|
+
"dimo",
|
|
17
|
+
"dimo-network"
|
|
12
18
|
],
|
|
13
19
|
"homepage": "https://dimo.org/developers",
|
|
14
20
|
"bugs": {
|
|
@@ -20,7 +26,7 @@
|
|
|
20
26
|
},
|
|
21
27
|
"scripts": {
|
|
22
28
|
"test": "jest",
|
|
23
|
-
"build": "tsc"
|
|
29
|
+
"build": "tsc && npx rollup -c"
|
|
24
30
|
},
|
|
25
31
|
"dependencies": {
|
|
26
32
|
"axios": "^1.6.7",
|
|
@@ -29,13 +35,20 @@
|
|
|
29
35
|
"web3": "^4.6.0"
|
|
30
36
|
},
|
|
31
37
|
"devDependencies": {
|
|
38
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
39
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
40
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
41
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
32
42
|
"@types/dotenv-safe": "^8.1.6",
|
|
33
43
|
"@types/jest": "^29.5.12",
|
|
34
44
|
"@types/node": "^20.11.25",
|
|
45
|
+
"@types/rollup-plugin-node-globals": "^1.4.5",
|
|
35
46
|
"eslint": "^8.56.0",
|
|
36
47
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
37
48
|
"eslint-plugin-import": "^2.29.1",
|
|
38
49
|
"jest": "^29.7.0",
|
|
50
|
+
"rollup": "^4.29.1",
|
|
51
|
+
"rollup-plugin-node-globals": "^1.4.0",
|
|
39
52
|
"ts-jest": "^29.1.4",
|
|
40
53
|
"typescript": "^5.4.5"
|
|
41
54
|
},
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
2
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
3
|
+
import typescript from '@rollup/plugin-typescript';
|
|
4
|
+
import json from '@rollup/plugin-json';
|
|
5
|
+
import globals from 'rollup-plugin-node-globals';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
input: './src/index.ts',
|
|
10
|
+
output: {
|
|
11
|
+
file: './dist/index.cjs',
|
|
12
|
+
format: 'cjs',
|
|
13
|
+
},
|
|
14
|
+
plugins: [
|
|
15
|
+
resolve({ preferBuiltins: true }), // Resolves node_modules and relative paths
|
|
16
|
+
commonjs(), // Converts CommonJS modules to ES6
|
|
17
|
+
typescript(), // Handles TypeScript (if needed)
|
|
18
|
+
json(),
|
|
19
|
+
globals(),
|
|
20
|
+
],
|
|
21
|
+
onwarn(warning, warn) {
|
|
22
|
+
// Print detailed warnings
|
|
23
|
+
if (warning.code === 'UNRESOLVED_IMPORT') {
|
|
24
|
+
throw new Error(warning.message);
|
|
25
|
+
}
|
|
26
|
+
warn(warning);
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Resource } from '../../Resource';
|
|
2
|
-
export class VehicleSignalDecoding extends Resource {
|
|
3
|
-
constructor(api, env) {
|
|
4
|
-
super(api, 'VehicleSignalDecoding', env);
|
|
5
|
-
this.setResource({
|
|
6
|
-
listConfigUrlsByVin: {
|
|
7
|
-
method: 'GET',
|
|
8
|
-
path: '/v1/device-config/vin/:vin/urls',
|
|
9
|
-
queryParams: {
|
|
10
|
-
protocol: false
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
listConfigUrlsByAddress: {
|
|
14
|
-
method: 'GET',
|
|
15
|
-
path: '/v1/device-config/eth-addr/:address/urls',
|
|
16
|
-
queryParams: {
|
|
17
|
-
protocol: false
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
getPidConfigs: {
|
|
21
|
-
method: 'GET',
|
|
22
|
-
path: '/v1/device-config/pids/:templateName',
|
|
23
|
-
},
|
|
24
|
-
getDeviceSettings: {
|
|
25
|
-
method: 'GET',
|
|
26
|
-
path: '/v1/device-config/settings/:templateName',
|
|
27
|
-
},
|
|
28
|
-
getDbcText: {
|
|
29
|
-
method: 'GET',
|
|
30
|
-
path: '/v1/device-config/dbc/:templateName'
|
|
31
|
-
},
|
|
32
|
-
getDeviceStatusByAddress: {
|
|
33
|
-
method: 'GET',
|
|
34
|
-
path: '/v1/device-config/eth-addr/:address/status',
|
|
35
|
-
},
|
|
36
|
-
setDeviceStatusByAddress: {
|
|
37
|
-
method: 'PATCH',
|
|
38
|
-
path: '/v1/device-config/eth-addr/:address/status',
|
|
39
|
-
body: {
|
|
40
|
-
config: true
|
|
41
|
-
},
|
|
42
|
-
auth: 'privilege_token'
|
|
43
|
-
},
|
|
44
|
-
getJobsByAddress: {
|
|
45
|
-
method: 'GET',
|
|
46
|
-
path: '/v1/device-config/eth-addr/:address/jobs'
|
|
47
|
-
},
|
|
48
|
-
getPendingJobsByAddress: {
|
|
49
|
-
method: 'GET',
|
|
50
|
-
path: '/v1/device-config/eth-addr/:address/jobs/pending'
|
|
51
|
-
},
|
|
52
|
-
setJobStatusByAddress: {
|
|
53
|
-
method: 'PATCH',
|
|
54
|
-
path: '/v1/device-config/eth-addr/:address/jobs/:jobId/:status',
|
|
55
|
-
auth: 'privilege_token'
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|