@allthings/sdk 8.0.0 → 8.1.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.
@@ -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,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { EnumCommunicationMethodType, EnumInputChannel, IAllthingsRestClient } from '../types';
4
2
  export interface IConversation {
5
3
  readonly createdAt: string;
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { IAllthingsRestClient } from '../types';
4
2
  export type FileResult = Promise<IFile>;
5
3
  interface IFileUrl {
@@ -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[];
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { IAllthingsRestClient } from '../types';
4
2
  import { IMessage } from './conversation';
5
3
  import { IFile } from './file';
@@ -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;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { ITokenStore, TokenRequester } from '../oauth/types';
3
2
  import { IAllthingsRestClientOptions } from './types';
4
3
  interface IFormOptions {
@@ -12,12 +11,8 @@ interface IBody {
12
11
  }
13
12
  export interface IRequestOptions {
14
13
  readonly body?: IBodyFormData | IBody;
15
- readonly headers?: {
16
- readonly [key: string]: string;
17
- };
18
- readonly query?: {
19
- readonly [parameter: string]: string;
20
- };
14
+ readonly headers?: Readonly<Record<string, string>>;
15
+ readonly query?: Readonly<Record<string, string>>;
21
16
  }
22
17
  export type RequestResult = Promise<any>;
23
18
  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,5 @@
1
- /// <reference types="node" />
2
1
  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>;
2
+ export declare const partial: (function_: (...arguments_: any[]) => any | Promise<any>, ...partialArguments: any[]) => (...arguments_: any[]) => any;
3
+ export declare function times<T>(function_: (item: number, index: number) => T, n: number): List<T>;
5
4
  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;
5
+ 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>>;
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { IAllthingsRestClient } from '..';
4
2
  import { IFile } from '../rest/methods/file';
5
3
  export declare const createManyFiles: (attachments: readonly {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allthings/sdk",
3
- "version": "8.0.0",
3
+ "version": "8.1.1",
4
4
  "description": "",
5
5
  "author": "Allthings GmbH",
6
6
  "keywords": [
@@ -14,9 +14,12 @@
14
14
  },
15
15
  "homepage": "https://github.com/allthings/node-sdk",
16
16
  "engines": {
17
- "node": ">20.10"
17
+ "node": "^22"
18
18
  },
19
19
  "packageManager": "yarn@1.22.22",
20
+ "release": {
21
+ "repositoryUrl": "https://github.com/allthings/node-sdk.git"
22
+ },
20
23
  "main": "dist/lib.cjs.js",
21
24
  "module": "dist/lib.esm.js",
22
25
  "browser": "dist/lib.umd.min.js",
@@ -47,7 +50,7 @@
47
50
  "prettier": "prettier --write",
48
51
  "security-check": "yarn audit --groups dependencies --level high || test $? -lt 7",
49
52
  "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",
53
+ "semantic-release": "semantic-release",
51
54
  "serve": "npx serve -l 3333",
52
55
  "test:implicit-flow": "open http://localhost:3333/test/fixtures/implicit-flow?clientId=$ALLTHINGS_OAUTH_CLIENT_ID",
53
56
  "test:authorization-code": "open http://localhost:3333/test/fixtures/authorization-code?clientId=$ALLTHINGS_OAUTH_CLIENT_ID&clientSecret=$ALLTHINGS_OAUTH_CLIENT_SECRET"
@@ -58,33 +61,33 @@
58
61
  "query-string": "7.1.3"
59
62
  },
60
63
  "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",
64
+ "@allthings/eslint-config": "3.0.0",
65
+ "@commitlint/cli": "20.4.3",
66
+ "@commitlint/config-conventional": "20.4.3",
67
+ "@rollup/plugin-commonjs": "29.0.2",
65
68
  "@rollup/plugin-json": "6.1.0",
66
- "@rollup/plugin-node-resolve": "16.0.1",
67
- "@rollup/plugin-replace": "6.0.2",
68
- "@rollup/plugin-terser": "0.4.4",
69
+ "@rollup/plugin-node-resolve": "16.0.3",
70
+ "@rollup/plugin-replace": "6.0.3",
71
+ "@rollup/plugin-terser": "1.0.0",
69
72
  "@types/form-data": "2.5.2",
70
- "@types/jest": "27.5.2",
71
- "@types/node": "22.15.3",
73
+ "@types/jest": "30.0.0",
74
+ "@types/node": "24.12.0",
72
75
  "@types/query-string": "6.3.0",
73
76
  "aws-sdk-client-mock": "4.1.0",
74
77
  "coveralls": "3.1.1",
75
- "eslint": "8.57.1",
76
- "form-data": "4.0.2",
78
+ "eslint": "9.39.4",
79
+ "form-data": "4.0.5",
77
80
  "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",
81
+ "jest": "30.2.0",
82
+ "jest-environment-jsdom": "30.2.0",
83
+ "lint-staged": "16.3.2",
84
+ "prettier": "3.8.1",
85
+ "rimraf": "6.1.3",
86
+ "rollup": "4.59.0",
84
87
  "rollup-plugin-hashbang": "2.2.2",
85
- "semantic-release": "19.0.5",
86
- "ts-jest": "27.1.5",
87
- "typescript": "4.9.5"
88
+ "semantic-release": "25.0.3",
89
+ "ts-jest": "29.4.6",
90
+ "typescript": "5.9.3"
88
91
  },
89
92
  "prettier": {
90
93
  "printWidth": 80,
@@ -121,7 +124,7 @@
121
124
  "coverageThreshold": {
122
125
  "global": {
123
126
  "branches": 89,
124
- "functions": 97,
127
+ "functions": 96,
125
128
  "lines": 97,
126
129
  "statements": 96
127
130
  }
@@ -130,13 +133,6 @@
130
133
  "/node_modules/",
131
134
  "/test/"
132
135
  ],
133
- "globals": {
134
- "ts-jest": {
135
- "diagnostics": {
136
- "warnOnly": true
137
- }
138
- }
139
- },
140
136
  "moduleFileExtensions": [
141
137
  "ts",
142
138
  "tsx",
@@ -153,11 +149,14 @@
153
149
  "testEnvironment": "node",
154
150
  "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx)$",
155
151
  "transform": {
156
- "^.+\\.tsx?$": "ts-jest"
152
+ "^.+\\.tsx?$": [
153
+ "ts-jest",
154
+ {
155
+ "diagnostics": {
156
+ "warnOnly": true
157
+ }
158
+ }
159
+ ]
157
160
  }
158
- },
159
- "release": {
160
- "branch": "master",
161
- "repositoryUrl": "https://github.com/allthings/node-sdk.git"
162
161
  }
163
162
  }