@allthings/sdk 8.0.0 → 8.1.0

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.
@@ -1,7 +1,7 @@
1
1
  import { TokenRequester } from './types';
2
2
  export declare const RESPONSE_TYPE = "code";
3
3
  export declare const GRANT_TYPE = "authorization_code";
4
- export declare const isEligibleForClientRedirect: (params: Record<string, any>) => boolean;
5
- export declare const getRedirectUrl: (params: Record<string, any>) => string;
6
- export declare const isEligible: (params: Record<string, any>) => boolean;
7
- export declare const requestToken: (tokenRequester: TokenRequester, params: Record<string, any>) => Promise<import("./types").IOAuthToken>;
4
+ export declare const isEligibleForClientRedirect: (parameters: Record<string, any>) => boolean;
5
+ export declare const getRedirectUrl: (parameters: Record<string, any>) => string;
6
+ export declare const isEligible: (parameters: Record<string, any>) => boolean;
7
+ export declare const requestToken: (tokenRequester: TokenRequester, parameters: Record<string, any>) => Promise<import("./types").IOAuthToken>;
@@ -1,3 +1,3 @@
1
1
  export declare const RESPONSE_TYPE = "token";
2
- export declare const isEligibleForClientRedirect: (params: Record<string, any>) => boolean;
3
- export declare const getRedirectUrl: (params: Record<string, any>) => string;
2
+ export declare const isEligibleForClientRedirect: (parameters: Record<string, any>) => boolean;
3
+ export declare const getRedirectUrl: (parameters: Record<string, any>) => string;
@@ -1,3 +1,3 @@
1
1
  import { IOAuthToken } from './types';
2
- declare const makeFetchTokenRequester: (url: string) => (params: Record<string, any>) => Promise<IOAuthToken>;
2
+ declare const makeFetchTokenRequester: (url: string) => (parameters: Record<string, any>) => Promise<IOAuthToken>;
3
3
  export default makeFetchTokenRequester;
@@ -1,4 +1,4 @@
1
1
  import { TokenRequester } from './types';
2
2
  export declare const GRANT_TYPE = "password";
3
- export declare const isEligible: (params: Record<string, any>) => boolean;
4
- export declare const requestToken: (tokenRequester: TokenRequester, params: Record<string, any>) => Promise<import("./types").IOAuthToken>;
3
+ export declare const isEligible: (parameters: Record<string, any>) => boolean;
4
+ export declare const requestToken: (tokenRequester: TokenRequester, parameters: Record<string, any>) => Promise<import("./types").IOAuthToken>;
@@ -1,4 +1,4 @@
1
1
  import { TokenRequester } from './types';
2
2
  export declare const GRANT_TYPE = "refresh_token";
3
- export declare const isEligible: (params: Record<string, any>) => boolean;
4
- export declare const requestToken: (tokenRequester: TokenRequester, params: Record<string, any>) => Promise<import("./types").IOAuthToken>;
3
+ export declare const isEligible: (parameters: Record<string, any>) => boolean;
4
+ export declare const requestToken: (tokenRequester: TokenRequester, parameters: Record<string, any>) => Promise<import("./types").IOAuthToken>;
@@ -8,4 +8,4 @@ export interface ITokenStore {
8
8
  readonly reset: () => void;
9
9
  readonly set: (token: IOAuthToken) => void;
10
10
  }
11
- export type TokenRequester = (params: Record<string, any>) => Promise<IOAuthToken>;
11
+ export type TokenRequester = (parameters: Record<string, any>) => Promise<IOAuthToken>;
@@ -1,8 +1,4 @@
1
1
  import { MethodHttpRequest } from './request';
2
2
  export type DeleteResult = Promise<any>;
3
- export type MethodHttpDelete = (method: string, body?: Record<string, any>, returnRawResultObject?: boolean, headers?: {
4
- readonly [key: string]: string;
5
- }) => DeleteResult;
6
- export default function del(request: MethodHttpRequest, method: string, body: Record<string, any>, returnRawResultObject?: boolean, headers?: {
7
- readonly [key: string]: string;
8
- }): DeleteResult;
3
+ export type MethodHttpDelete = (method: string, body?: Record<string, any>, returnRawResultObject?: boolean, headers?: Readonly<Record<string, string>>) => DeleteResult;
4
+ export default function del(request: MethodHttpRequest, method: string, body: Record<string, any>, returnRawResultObject?: boolean, headers?: Readonly<Record<string, string>>): DeleteResult;
@@ -1,8 +1,4 @@
1
1
  import { MethodHttpRequest } from './request';
2
2
  export type GetResult = Promise<any>;
3
- export type MethodHttpGet = (method: string, query?: Record<string, any>, returnRawResultObject?: boolean, headers?: {
4
- readonly [key: string]: string;
5
- }) => GetResult;
6
- export default function get(request: MethodHttpRequest, method: string, query: Record<string, any>, returnRawResultObject?: boolean, headers?: {
7
- readonly [key: string]: string;
8
- }): GetResult;
3
+ export type MethodHttpGet = (method: string, query?: Record<string, any>, returnRawResultObject?: boolean, headers?: Readonly<Record<string, string>>) => GetResult;
4
+ export default function get(request: MethodHttpRequest, method: string, query: Record<string, any>, returnRawResultObject?: boolean, headers?: Readonly<Record<string, string>>): GetResult;
@@ -1,7 +1,5 @@
1
1
  import { EnumLookupUserType, EnumResource, IAllthingsRestClient } from '../types';
2
- export type LookupIdResult = Promise<{
3
- readonly [externalId: string]: string | null;
4
- }>;
2
+ export type LookupIdResult = Promise<Readonly<Record<string, string | null>>>;
5
3
  export type MethodLookupIds = (appId: string, data: {
6
4
  readonly dataSource?: string;
7
5
  readonly externalIds: string | readonly string[];
@@ -49,9 +49,7 @@ export interface IUser {
49
49
  readonly readOnly: boolean;
50
50
  readonly receiveAdminNotifications: boolean;
51
51
  readonly roles: readonly string[];
52
- readonly tenantIds: {
53
- readonly [key: string]: string;
54
- };
52
+ readonly tenantIds: Readonly<Record<string, string>>;
55
53
  readonly type: EnumUserType | null;
56
54
  readonly username: string;
57
55
  }
@@ -100,9 +98,7 @@ export interface IUserPermission {
100
98
  }
101
99
  export type PartialUserPermission = Partial<IUserPermission>;
102
100
  export type UserPermissionResult = Promise<IUserPermission>;
103
- export declare const remapEmbeddedUser: (embedded: {
104
- readonly [key: string]: any;
105
- }) => readonly IUser[];
101
+ export declare const remapEmbeddedUser: (embedded: Readonly<Record<string, any>>) => readonly IUser[];
106
102
  export type MethodUserCreate = (appId: string, username: string, data: PartialUser & {
107
103
  readonly email: string;
108
104
  readonly locale: EnumLocale;
@@ -1,8 +1,4 @@
1
1
  import { MethodHttpRequest } from './request';
2
2
  export type PatchResult = Promise<any>;
3
- export type MethodHttpPatch = (method: string, body?: Record<string, any>, returnRawResultObject?: boolean, headers?: {
4
- readonly [key: string]: string;
5
- }) => PatchResult;
6
- export default function patch(request: MethodHttpRequest, method: string, body: Record<string, any>, returnRawResultObject?: boolean, headers?: {
7
- readonly [key: string]: string;
8
- }): PatchResult;
3
+ export type MethodHttpPatch = (method: string, body?: Record<string, any>, returnRawResultObject?: boolean, headers?: Readonly<Record<string, string>>) => PatchResult;
4
+ export default function patch(request: MethodHttpRequest, method: string, body: Record<string, any>, returnRawResultObject?: boolean, headers?: Readonly<Record<string, string>>): PatchResult;
@@ -1,8 +1,4 @@
1
1
  import { MethodHttpRequest } from './request';
2
2
  export type PostResult = Promise<any>;
3
- export type MethodHttpPost = (method: string, body?: Record<string, any>, returnRawResultObject?: boolean, headers?: {
4
- readonly [key: string]: string;
5
- }) => PostResult;
6
- export default function post(request: MethodHttpRequest, method: string, body: Record<string, any>, returnRawResultObject?: boolean, headers?: {
7
- readonly [key: string]: string;
8
- }): PostResult;
3
+ export type MethodHttpPost = (method: string, body?: Record<string, any>, returnRawResultObject?: boolean, headers?: Readonly<Record<string, string>>) => PostResult;
4
+ export default function post(request: MethodHttpRequest, method: string, body: Record<string, any>, returnRawResultObject?: boolean, headers?: Readonly<Record<string, string>>): PostResult;
@@ -1,8 +1,4 @@
1
1
  import { MethodHttpRequest } from './request';
2
2
  export type PutResult = Promise<any>;
3
- export type MethodHttpPut = (method: string, body?: Record<string, any>, returnRawResultObject?: boolean, headers?: {
4
- readonly [key: string]: string;
5
- }) => PutResult;
6
- export default function put(request: MethodHttpRequest, method: string, body: Record<string, any>, returnRawResultObject?: boolean, headers?: {
7
- readonly [key: string]: string;
8
- }): PutResult;
3
+ export type MethodHttpPut = (method: string, body?: Record<string, any>, returnRawResultObject?: boolean, headers?: Readonly<Record<string, string>>) => PutResult;
4
+ export default function put(request: MethodHttpRequest, method: string, body: Record<string, any>, returnRawResultObject?: boolean, headers?: Readonly<Record<string, string>>): PutResult;
@@ -12,12 +12,8 @@ interface IBody {
12
12
  }
13
13
  export interface IRequestOptions {
14
14
  readonly body?: IBodyFormData | IBody;
15
- readonly headers?: {
16
- readonly [key: string]: string;
17
- };
18
- readonly query?: {
19
- readonly [parameter: string]: string;
20
- };
15
+ readonly headers?: Readonly<Record<string, string>>;
16
+ readonly query?: Readonly<Record<string, string>>;
21
17
  }
22
18
  export type RequestResult = Promise<any>;
23
19
  export type HttpVerb = 'delete' | 'get' | 'head' | 'patch' | 'post' | 'put';
@@ -76,7 +76,7 @@ export declare enum EnumLookupUserType {
76
76
  agent = "agent",
77
77
  tenant = "tenant"
78
78
  }
79
- export type EntityResultList<Entity, ExtensionInterface = {}> = Promise<{
79
+ export type EntityResultList<Entity, ExtensionInterface = object> = Promise<{
80
80
  readonly _embedded: {
81
81
  readonly items: readonly Entity[];
82
82
  };
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  export type List<T> = readonly T[];
3
- export declare const partial: (fn: (...args: any[]) => any | Promise<any>, ...partialArgs: any[]) => (...args: any[]) => any;
4
- export declare function times<T>(fn: (item: number, index: number) => T, n: number): List<T>;
3
+ export declare const partial: (function_: (...arguments_: any[]) => any | Promise<any>, ...partialArguments: any[]) => (...arguments_: any[]) => any;
4
+ export declare function times<T>(function_: (item: number, index: number) => T, n: number): List<T>;
5
5
  export declare function until<A, B>(predicate: (value: B, iteration: number) => boolean | Promise<boolean>, transformer: (value: A | B | undefined, iteration: number) => B | Promise<B>, initialValue?: A | B, iterationCount?: number): Promise<B>;
6
- export declare function fnClearInterval(intervalId: NodeJS.Timeout): true;
6
+ export declare function clearIntervalFunction(intervalId: NodeJS.Timeout): true;
@@ -1,4 +1,3 @@
1
- export type LogType = 'log' | 'info' | 'warn' | 'error';
2
1
  export interface ILogger {
3
2
  readonly [key: string]: (...logs: any[]) => boolean;
4
3
  }
@@ -1,5 +1 @@
1
- export declare function remapKeys(input: {
2
- readonly [key: string]: any;
3
- }, mapFn: (inKey: string) => string): {
4
- readonly [key: string]: any;
5
- };
1
+ export declare function remapKeys(input: Readonly<Record<string, any>>, mapFunction: (inKey: string) => string): Readonly<Record<string, any>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allthings/sdk",
3
- "version": "8.0.0",
3
+ "version": "8.1.0",
4
4
  "description": "",
5
5
  "author": "Allthings GmbH",
6
6
  "keywords": [
@@ -47,7 +47,7 @@
47
47
  "prettier": "prettier --write",
48
48
  "security-check": "yarn audit --groups dependencies --level high || test $? -lt 7",
49
49
  "upgrade-dependencies": "yarn upgrade-interactive --latest --exact",
50
- "semantic-release": "echo \"Setting npm unsafe-perm to true due to our Docker/Buildkite root permissions\" && npm set unsafe-perm true && semantic-release",
50
+ "semantic-release": "semantic-release",
51
51
  "serve": "npx serve -l 3333",
52
52
  "test:implicit-flow": "open http://localhost:3333/test/fixtures/implicit-flow?clientId=$ALLTHINGS_OAUTH_CLIENT_ID",
53
53
  "test:authorization-code": "open http://localhost:3333/test/fixtures/authorization-code?clientId=$ALLTHINGS_OAUTH_CLIENT_ID&clientSecret=$ALLTHINGS_OAUTH_CLIENT_SECRET"
@@ -58,32 +58,32 @@
58
58
  "query-string": "7.1.3"
59
59
  },
60
60
  "devDependencies": {
61
- "@allthings/eslint-config": "1.1.0",
62
- "@commitlint/cli": "19.8.0",
63
- "@commitlint/config-conventional": "19.8.0",
64
- "@rollup/plugin-commonjs": "28.0.3",
61
+ "@allthings/eslint-config": "2.2.3",
62
+ "@commitlint/cli": "20.3.1",
63
+ "@commitlint/config-conventional": "20.3.1",
64
+ "@rollup/plugin-commonjs": "29.0.0",
65
65
  "@rollup/plugin-json": "6.1.0",
66
- "@rollup/plugin-node-resolve": "16.0.1",
67
- "@rollup/plugin-replace": "6.0.2",
66
+ "@rollup/plugin-node-resolve": "16.0.3",
67
+ "@rollup/plugin-replace": "6.0.3",
68
68
  "@rollup/plugin-terser": "0.4.4",
69
69
  "@types/form-data": "2.5.2",
70
- "@types/jest": "27.5.2",
71
- "@types/node": "22.15.3",
70
+ "@types/jest": "30.0.0",
71
+ "@types/node": "24.10.9",
72
72
  "@types/query-string": "6.3.0",
73
73
  "aws-sdk-client-mock": "4.1.0",
74
74
  "coveralls": "3.1.1",
75
75
  "eslint": "8.57.1",
76
- "form-data": "4.0.2",
76
+ "form-data": "4.0.5",
77
77
  "husky": "9.1.7",
78
- "jest": "27.5.1",
79
- "jest-environment-jsdom": "27.5.1",
80
- "lint-staged": "15.5.1",
81
- "prettier": "3.5.3",
82
- "rimraf": "5.0.10",
83
- "rollup": "4.40.1",
78
+ "jest": "30.2.0",
79
+ "jest-environment-jsdom": "30.2.0",
80
+ "lint-staged": "16.2.7",
81
+ "prettier": "3.8.0",
82
+ "rimraf": "6.1.2",
83
+ "rollup": "4.55.1",
84
84
  "rollup-plugin-hashbang": "2.2.2",
85
- "semantic-release": "19.0.5",
86
- "ts-jest": "27.1.5",
85
+ "semantic-release": "25.0.2",
86
+ "ts-jest": "29.4.6",
87
87
  "typescript": "4.9.5"
88
88
  },
89
89
  "prettier": {
@@ -130,13 +130,6 @@
130
130
  "/node_modules/",
131
131
  "/test/"
132
132
  ],
133
- "globals": {
134
- "ts-jest": {
135
- "diagnostics": {
136
- "warnOnly": true
137
- }
138
- }
139
- },
140
133
  "moduleFileExtensions": [
141
134
  "ts",
142
135
  "tsx",
@@ -153,11 +146,20 @@
153
146
  "testEnvironment": "node",
154
147
  "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx)$",
155
148
  "transform": {
156
- "^.+\\.tsx?$": "ts-jest"
149
+ "^.+\\.tsx?$": [
150
+ "ts-jest",
151
+ {
152
+ "diagnostics": {
153
+ "warnOnly": true
154
+ }
155
+ }
156
+ ]
157
157
  }
158
158
  },
159
159
  "release": {
160
- "branch": "master",
160
+ "branches": [
161
+ "master"
162
+ ],
161
163
  "repositoryUrl": "https://github.com/allthings/node-sdk.git"
162
164
  }
163
165
  }