@allthings/sdk 7.3.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.
- package/dist/cli.js +400 -330
- package/dist/lib.cjs.js +398 -328
- package/dist/lib.esm.js +398 -328
- package/dist/lib.umd.min.js +1 -1
- package/dist/src/oauth/authorizationCodeGrant.d.ts +4 -4
- package/dist/src/oauth/implicitGrant.d.ts +2 -2
- package/dist/src/oauth/makeFetchTokenRequester.d.ts +1 -1
- package/dist/src/oauth/passwordGrant.d.ts +2 -2
- package/dist/src/oauth/refreshTokenGrant.d.ts +2 -2
- package/dist/src/oauth/types.d.ts +1 -1
- package/dist/src/rest/delete.d.ts +2 -6
- package/dist/src/rest/get.d.ts +2 -6
- package/dist/src/rest/methods/idLookup.d.ts +1 -3
- package/dist/src/rest/methods/user.d.ts +2 -6
- package/dist/src/rest/patch.d.ts +2 -6
- package/dist/src/rest/post.d.ts +2 -6
- package/dist/src/rest/put.d.ts +2 -6
- package/dist/src/rest/request.d.ts +2 -6
- package/dist/src/rest/types.d.ts +1 -1
- package/dist/src/utils/functional.d.ts +3 -3
- package/dist/src/utils/logger.d.ts +0 -1
- package/dist/src/utils/object.d.ts +1 -5
- package/package.json +32 -29
|
@@ -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: (
|
|
5
|
-
export declare const getRedirectUrl: (
|
|
6
|
-
export declare const isEligible: (
|
|
7
|
-
export declare const requestToken: (tokenRequester: TokenRequester,
|
|
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: (
|
|
3
|
-
export declare const getRedirectUrl: (
|
|
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) => (
|
|
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: (
|
|
4
|
-
export declare const requestToken: (tokenRequester: TokenRequester,
|
|
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: (
|
|
4
|
-
export declare const requestToken: (tokenRequester: TokenRequester,
|
|
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 = (
|
|
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
|
-
|
|
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;
|
package/dist/src/rest/get.d.ts
CHANGED
|
@@ -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
|
-
|
|
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;
|
package/dist/src/rest/patch.d.ts
CHANGED
|
@@ -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
|
-
|
|
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;
|
package/dist/src/rest/post.d.ts
CHANGED
|
@@ -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
|
-
|
|
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;
|
package/dist/src/rest/put.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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';
|
package/dist/src/rest/types.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export declare enum EnumLookupUserType {
|
|
|
76
76
|
agent = "agent",
|
|
77
77
|
tenant = "tenant"
|
|
78
78
|
}
|
|
79
|
-
export type EntityResultList<Entity, ExtensionInterface =
|
|
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: (
|
|
4
|
-
export declare function times<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
|
|
6
|
+
export declare function clearIntervalFunction(intervalId: NodeJS.Timeout): true;
|
|
@@ -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": "
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Allthings GmbH",
|
|
6
6
|
"keywords": [
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
},
|
|
15
15
|
"homepage": "https://github.com/allthings/node-sdk",
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": "
|
|
17
|
+
"node": ">20.10"
|
|
18
18
|
},
|
|
19
|
+
"packageManager": "yarn@1.22.22",
|
|
19
20
|
"main": "dist/lib.cjs.js",
|
|
20
21
|
"module": "dist/lib.esm.js",
|
|
21
22
|
"browser": "dist/lib.umd.min.js",
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"prettier": "prettier --write",
|
|
47
48
|
"security-check": "yarn audit --groups dependencies --level high || test $? -lt 7",
|
|
48
49
|
"upgrade-dependencies": "yarn upgrade-interactive --latest --exact",
|
|
49
|
-
"semantic-release": "
|
|
50
|
+
"semantic-release": "semantic-release",
|
|
50
51
|
"serve": "npx serve -l 3333",
|
|
51
52
|
"test:implicit-flow": "open http://localhost:3333/test/fixtures/implicit-flow?clientId=$ALLTHINGS_OAUTH_CLIENT_ID",
|
|
52
53
|
"test:authorization-code": "open http://localhost:3333/test/fixtures/authorization-code?clientId=$ALLTHINGS_OAUTH_CLIENT_ID&clientSecret=$ALLTHINGS_OAUTH_CLIENT_SECRET"
|
|
@@ -57,32 +58,32 @@
|
|
|
57
58
|
"query-string": "7.1.3"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
|
-
"@allthings/eslint-config": "
|
|
61
|
-
"@commitlint/cli": "
|
|
62
|
-
"@commitlint/config-conventional": "
|
|
63
|
-
"@rollup/plugin-commonjs": "
|
|
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",
|
|
64
65
|
"@rollup/plugin-json": "6.1.0",
|
|
65
|
-
"@rollup/plugin-node-resolve": "16.0.
|
|
66
|
-
"@rollup/plugin-replace": "6.0.
|
|
66
|
+
"@rollup/plugin-node-resolve": "16.0.3",
|
|
67
|
+
"@rollup/plugin-replace": "6.0.3",
|
|
67
68
|
"@rollup/plugin-terser": "0.4.4",
|
|
68
69
|
"@types/form-data": "2.5.2",
|
|
69
|
-
"@types/jest": "
|
|
70
|
-
"@types/node": "
|
|
70
|
+
"@types/jest": "30.0.0",
|
|
71
|
+
"@types/node": "24.10.9",
|
|
71
72
|
"@types/query-string": "6.3.0",
|
|
72
73
|
"aws-sdk-client-mock": "4.1.0",
|
|
73
74
|
"coveralls": "3.1.1",
|
|
74
75
|
"eslint": "8.57.1",
|
|
75
|
-
"form-data": "4.0.
|
|
76
|
+
"form-data": "4.0.5",
|
|
76
77
|
"husky": "9.1.7",
|
|
77
|
-
"jest": "
|
|
78
|
-
"jest-environment-jsdom": "
|
|
79
|
-
"lint-staged": "
|
|
80
|
-
"prettier": "3.
|
|
81
|
-
"rimraf": "
|
|
82
|
-
"rollup": "4.
|
|
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",
|
|
83
84
|
"rollup-plugin-hashbang": "2.2.2",
|
|
84
|
-
"semantic-release": "
|
|
85
|
-
"ts-jest": "
|
|
85
|
+
"semantic-release": "25.0.2",
|
|
86
|
+
"ts-jest": "29.4.6",
|
|
86
87
|
"typescript": "4.9.5"
|
|
87
88
|
},
|
|
88
89
|
"prettier": {
|
|
@@ -129,13 +130,6 @@
|
|
|
129
130
|
"/node_modules/",
|
|
130
131
|
"/test/"
|
|
131
132
|
],
|
|
132
|
-
"globals": {
|
|
133
|
-
"ts-jest": {
|
|
134
|
-
"diagnostics": {
|
|
135
|
-
"warnOnly": true
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
133
|
"moduleFileExtensions": [
|
|
140
134
|
"ts",
|
|
141
135
|
"tsx",
|
|
@@ -152,11 +146,20 @@
|
|
|
152
146
|
"testEnvironment": "node",
|
|
153
147
|
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx)$",
|
|
154
148
|
"transform": {
|
|
155
|
-
"^.+\\.tsx?$":
|
|
149
|
+
"^.+\\.tsx?$": [
|
|
150
|
+
"ts-jest",
|
|
151
|
+
{
|
|
152
|
+
"diagnostics": {
|
|
153
|
+
"warnOnly": true
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
]
|
|
156
157
|
}
|
|
157
158
|
},
|
|
158
159
|
"release": {
|
|
159
|
-
"
|
|
160
|
+
"branches": [
|
|
161
|
+
"master"
|
|
162
|
+
],
|
|
160
163
|
"repositoryUrl": "https://github.com/allthings/node-sdk.git"
|
|
161
164
|
}
|
|
162
165
|
}
|