@allthings/sdk 10.0.0-beta.2 → 10.0.1

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 CHANGED
@@ -20,9 +20,13 @@ yarn add -DE @allthings/sdk
20
20
  ```
21
21
 
22
22
  ```javascript
23
- const allthings = require('@allthings/sdk')
23
+ // ESM
24
+ import { restClient } from '@allthings/sdk'
24
25
 
25
- const client = allthings.restClient({
26
+ // or CJS
27
+ const { restClient } = require('@allthings/sdk')
28
+
29
+ const client = restClient({
26
30
  accessToken: '043dab7447450772example1214b552838003522',
27
31
  })
28
32
 
@@ -67,9 +71,9 @@ process.env.ALLTHINGS_OAUTH_USERNAME,
67
71
  @TODO
68
72
 
69
73
  ```javascript
70
- const allthings = require('@allthings/sdk')
74
+ import { restClient } from '@allthings/sdk'
71
75
 
72
- const client = allthings.restClient({
76
+ const client = restClient({
73
77
  accessToken: '043dab7447450772example1214b552838003522',
74
78
  })
75
79
 
@@ -83,9 +87,9 @@ client
83
87
  1. Initialize instance of `client`:
84
88
 
85
89
  ```javascript
86
- const allthings = require('@allthings/sdk')
90
+ import { restClient } from '@allthings/sdk'
87
91
 
88
- const client = allthings.restClient({
92
+ const client = restClient({
89
93
  clientId: '5d038ef2441f4de574005c54_example',
90
94
  clientSecret: '40f63f981ff082dbc8d273983ac3852c2e51e90856123156',
91
95
  redirectUri: 'https://example-app.com/callback',
@@ -176,9 +180,9 @@ const user = await client.getCurrentUser()
176
180
  Create an client instance of the SDK.
177
181
 
178
182
  ```javascript
179
- const allthings = require('@allthings/sdk')
183
+ import { restClient } from '@allthings/sdk'
180
184
 
181
- const client = allthings.restClient(configurationOptions)
185
+ const client = restClient(configurationOptions)
182
186
  ```
183
187
 
184
188
  ---
package/dist/cli.js CHANGED
@@ -12,7 +12,7 @@ function createTokenStore(initialToken) {
12
12
  };
13
13
  }
14
14
 
15
- const version = "10.0.0-beta.2";
15
+ const version = "10.0.1";
16
16
 
17
17
  const environment = typeof process !== 'undefined' && process.env ? process.env : {};
18
18
 
@@ -1102,8 +1102,8 @@ function makeApiRequest(oauthTokenStore, oauthTokenRequester, options, httpMetho
1102
1102
  'X-Allthings-Caller': `${options.serviceName
1103
1103
  ? options.serviceName
1104
1104
  :
1105
- environment.SEVICE_NAME
1106
- ? environment.SEVICE_NAME
1105
+ environment.SERVICE_NAME
1106
+ ? environment.SERVICE_NAME
1107
1107
  : 'unknown service name'} --- clientID ${options.clientId?.split('_')[0] ??
1108
1108
  options.clientId ??
1109
1109
  'no client id present'}`,
package/dist/lib.cjs.js CHANGED
@@ -11,7 +11,7 @@ function createTokenStore(initialToken) {
11
11
  };
12
12
  }
13
13
 
14
- const version = "10.0.0-beta.2";
14
+ const version = "10.0.1";
15
15
 
16
16
  const environment = typeof process !== 'undefined' && process.env ? process.env : {};
17
17
 
@@ -1101,8 +1101,8 @@ function makeApiRequest(oauthTokenStore, oauthTokenRequester, options, httpMetho
1101
1101
  'X-Allthings-Caller': `${options.serviceName
1102
1102
  ? options.serviceName
1103
1103
  :
1104
- environment.SEVICE_NAME
1105
- ? environment.SEVICE_NAME
1104
+ environment.SERVICE_NAME
1105
+ ? environment.SERVICE_NAME
1106
1106
  : 'unknown service name'} --- clientID ${options.clientId?.split('_')[0] ??
1107
1107
  options.clientId ??
1108
1108
  'no client id present'}`,
@@ -0,0 +1,172 @@
1
+ {
2
+ "name": "@allthings/sdk",
3
+ "version": "10.0.1",
4
+ "description": "",
5
+ "author": "Allthings GmbH",
6
+ "keywords": [
7
+ "allthings",
8
+ "sdk"
9
+ ],
10
+ "license": "MIT",
11
+ "repository": "git@github.com:allthings/node-sdk.git",
12
+ "bugs": {
13
+ "url": "https://github.com/allthings/node-sdk/issues"
14
+ },
15
+ "homepage": "https://github.com/allthings/node-sdk",
16
+ "engines": {
17
+ "node": "^22 || >=24"
18
+ },
19
+ "packageManager": "yarn@4.15.0",
20
+ "release": {
21
+ "repositoryUrl": "https://github.com/allthings/node-sdk.git"
22
+ },
23
+ "main": "dist/lib.cjs.js",
24
+ "module": "dist/src/index.js",
25
+ "browser": "dist/src/index.js",
26
+ "types": "dist/src/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/src/index.d.ts",
30
+ "require": "./dist/lib.cjs.js",
31
+ "browser": "./dist/src/index.js",
32
+ "import": "./dist/src/index.js"
33
+ },
34
+ "./package.json": "./package.json"
35
+ },
36
+ "sideEffects": [
37
+ "./dist/cli.js"
38
+ ],
39
+ "files": [
40
+ "dist/cli.js",
41
+ "dist/lib.cjs.js",
42
+ "dist/package.json",
43
+ "dist/src/**/*.js",
44
+ "dist/src/**/*.d.ts"
45
+ ],
46
+ "bin": {
47
+ "allthings": "dist/cli.js"
48
+ },
49
+ "scripts": {
50
+ "clean": "rimraf dist",
51
+ "test": "npm run clean && jest",
52
+ "test:ci": "jest --runInBand",
53
+ "watch:build": "tsc -d -w -p tsconfig.build.json & rollup -c --watch",
54
+ "watch:test": "jest --watch",
55
+ "lint": "yarn lint:tsc && yarn lint:eslint",
56
+ "lint:eslint": "eslint src",
57
+ "lint:tsc": "tsc --noEmit --pretty",
58
+ "build": "npm run clean && tsc -d -p tsconfig.build.json && cp package.json dist/ && rollup -c --bundleConfigAsCjs",
59
+ "dev": "tsc -w",
60
+ "prepare": "husky",
61
+ "prepublishOnly": "npm run build",
62
+ "prettier": "prettier --write",
63
+ "security-check": "yarn npm audit --severity high --environment production --recursive",
64
+ "upgrade-dependencies": "yarn upgrade-interactive",
65
+ "semantic-release": "semantic-release",
66
+ "serve": "npx serve -l 3333",
67
+ "test:implicit-flow": "open http://localhost:3333/test/fixtures/implicit-flow?clientId=$ALLTHINGS_OAUTH_CLIENT_ID",
68
+ "test:authorization-code": "open http://localhost:3333/test/fixtures/authorization-code?clientId=$ALLTHINGS_OAUTH_CLIENT_ID&clientSecret=$ALLTHINGS_OAUTH_CLIENT_SECRET"
69
+ },
70
+ "dependenciesMeta": {
71
+ "unrs-resolver": {
72
+ "built": true
73
+ }
74
+ },
75
+ "dependencies": {
76
+ "bottleneck": "2.19.5"
77
+ },
78
+ "devDependencies": {
79
+ "@allthings/eslint-config": "3.1.0",
80
+ "@commitlint/cli": "21.0.1",
81
+ "@commitlint/config-conventional": "21.0.1",
82
+ "@rollup/plugin-commonjs": "29.0.2",
83
+ "@rollup/plugin-json": "6.1.0",
84
+ "@rollup/plugin-node-resolve": "16.0.3",
85
+ "@types/jest": "30.0.0",
86
+ "@types/node": "24.12.4",
87
+ "aws-sdk-client-mock": "4.1.0",
88
+ "coveralls": "3.1.1",
89
+ "eslint": "9.39.4",
90
+ "husky": "9.1.7",
91
+ "jest": "30.4.2",
92
+ "jest-environment-jsdom": "30.4.1",
93
+ "lint-staged": "17.0.5",
94
+ "prettier": "3.8.3",
95
+ "rimraf": "6.1.3",
96
+ "rollup": "4.60.4",
97
+ "rollup-plugin-hashbang": "3.0.0",
98
+ "semantic-release": "25.0.3",
99
+ "ts-jest": "29.4.9",
100
+ "typescript": "6.0.3"
101
+ },
102
+ "prettier": {
103
+ "printWidth": 80,
104
+ "semi": false,
105
+ "singleQuote": true,
106
+ "trailingComma": "all",
107
+ "useTabs": false
108
+ },
109
+ "commitlint": {
110
+ "extends": [
111
+ "@commitlint/config-conventional"
112
+ ]
113
+ },
114
+ "lint-staged": {
115
+ "*.{ts,tsx}": [
116
+ "yarn prettier",
117
+ "yarn lint"
118
+ ],
119
+ "*.{json}": [
120
+ "yarn prettier"
121
+ ]
122
+ },
123
+ "jest": {
124
+ "bail": false,
125
+ "collectCoverage": true,
126
+ "collectCoverageFrom": [
127
+ "src/**/*.{ts,tsx}",
128
+ "!src/cli.ts",
129
+ "!src/global.d.ts",
130
+ "!src/index.ts",
131
+ "!src/aws/index.ts",
132
+ "!src/oauth/types.ts"
133
+ ],
134
+ "coverageThreshold": {
135
+ "global": {
136
+ "branches": 89,
137
+ "functions": 96,
138
+ "lines": 97,
139
+ "statements": 96
140
+ }
141
+ },
142
+ "coveragePathIgnorePatterns": [
143
+ "/node_modules/",
144
+ "/test/"
145
+ ],
146
+ "moduleFileExtensions": [
147
+ "ts",
148
+ "tsx",
149
+ "js",
150
+ "json"
151
+ ],
152
+ "preset": "ts-jest",
153
+ "roots": [
154
+ "src/"
155
+ ],
156
+ "setupFilesAfterEnv": [
157
+ "./test/setup.ts"
158
+ ],
159
+ "testEnvironment": "node",
160
+ "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx)$",
161
+ "transform": {
162
+ "^.+\\.tsx?$": [
163
+ "ts-jest",
164
+ {
165
+ "diagnostics": {
166
+ "warnOnly": true
167
+ }
168
+ }
169
+ ]
170
+ }
171
+ }
172
+ }
@@ -101,8 +101,8 @@ export function makeApiRequest(oauthTokenStore, oauthTokenRequester, options, ht
101
101
  'X-Allthings-Caller': `${options.serviceName
102
102
  ? options.serviceName
103
103
  :
104
- environment.SEVICE_NAME
105
- ? environment.SEVICE_NAME
104
+ environment.SERVICE_NAME
105
+ ? environment.SERVICE_NAME
106
106
  : 'unknown service name'} --- clientID ${options.clientId?.split('_')[0] ??
107
107
  options.clientId ??
108
108
  'no client id present'}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allthings/sdk",
3
- "version": "10.0.0-beta.2",
3
+ "version": "10.0.1",
4
4
  "description": "",
5
5
  "author": "Allthings GmbH",
6
6
  "keywords": [
@@ -39,6 +39,7 @@
39
39
  "files": [
40
40
  "dist/cli.js",
41
41
  "dist/lib.cjs.js",
42
+ "dist/package.json",
42
43
  "dist/src/**/*.js",
43
44
  "dist/src/**/*.d.ts"
44
45
  ],
@@ -54,7 +55,7 @@
54
55
  "lint": "yarn lint:tsc && yarn lint:eslint",
55
56
  "lint:eslint": "eslint src",
56
57
  "lint:tsc": "tsc --noEmit --pretty",
57
- "build": "npm run clean && tsc -d -p tsconfig.build.json && cp package.json dist/ && rollup -c --bundleConfigAsCjs && rm dist/package.json",
58
+ "build": "npm run clean && tsc -d -p tsconfig.build.json && cp package.json dist/ && rollup -c --bundleConfigAsCjs",
58
59
  "dev": "tsc -w",
59
60
  "prepare": "husky",
60
61
  "prepublishOnly": "npm run build",