@extrahorizon/javascript-sdk 8.2.0-test
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/CHANGELOG.md +1161 -0
- package/LICENSE +21 -0
- package/README.md +119 -0
- package/build/index.cjs.js +1 -0
- package/build/index.mjs +1 -0
- package/build/types/btoa.d.ts +6 -0
- package/build/types/client.d.ts +136 -0
- package/build/types/constants.d.ts +15 -0
- package/build/types/errorHandler.d.ts +2 -0
- package/build/types/errors.d.ts +332 -0
- package/build/types/http/client.d.ts +2 -0
- package/build/types/http/index.d.ts +4 -0
- package/build/types/http/interceptors.d.ts +9 -0
- package/build/types/http/oAuth1Signature.d.ts +14 -0
- package/build/types/http/oauth1.d.ts +3 -0
- package/build/types/http/oauth2.d.ts +3 -0
- package/build/types/http/proxy.d.ts +3 -0
- package/build/types/http/types.d.ts +331 -0
- package/build/types/http/utils.d.ts +21 -0
- package/build/types/index.d.ts +9 -0
- package/build/types/mock.d.ts +43 -0
- package/build/types/mockType.d.ts +1511 -0
- package/build/types/parseStoredCredentials.d.ts +11 -0
- package/build/types/rql/index.d.ts +16 -0
- package/build/types/rql/parser.d.ts +1 -0
- package/build/types/rql/types.d.ts +168 -0
- package/build/types/services/auth/applications/index.d.ts +5 -0
- package/build/types/services/auth/applications/types.d.ts +190 -0
- package/build/types/services/auth/index.d.ts +3 -0
- package/build/types/services/auth/oauth1/index.d.ts +5 -0
- package/build/types/services/auth/oauth1/types.d.ts +63 -0
- package/build/types/services/auth/oauth2/index.d.ts +5 -0
- package/build/types/services/auth/oauth2/types.d.ts +52 -0
- package/build/types/services/auth/oidc/index.d.ts +5 -0
- package/build/types/services/auth/oidc/loginAttempts/index.d.ts +5 -0
- package/build/types/services/auth/oidc/loginAttempts/types.d.ts +67 -0
- package/build/types/services/auth/oidc/providers/index.d.ts +5 -0
- package/build/types/services/auth/oidc/providers/types.d.ts +144 -0
- package/build/types/services/auth/oidc/types.d.ts +40 -0
- package/build/types/services/auth/types.d.ts +39 -0
- package/build/types/services/auth/users/index.d.ts +5 -0
- package/build/types/services/auth/users/types.d.ts +121 -0
- package/build/types/services/configurations/general.d.ts +5 -0
- package/build/types/services/configurations/groups.d.ts +5 -0
- package/build/types/services/configurations/index.d.ts +10 -0
- package/build/types/services/configurations/patients.d.ts +5 -0
- package/build/types/services/configurations/staff.d.ts +5 -0
- package/build/types/services/configurations/types.d.ts +222 -0
- package/build/types/services/configurations/users.d.ts +5 -0
- package/build/types/services/data/comments.d.ts +5 -0
- package/build/types/services/data/documents.d.ts +5 -0
- package/build/types/services/data/index.d.ts +13 -0
- package/build/types/services/data/indexes.d.ts +5 -0
- package/build/types/services/data/infrastructure.d.ts +10 -0
- package/build/types/services/data/json-schema.d.ts +121 -0
- package/build/types/services/data/properties.d.ts +5 -0
- package/build/types/services/data/schemas.d.ts +5 -0
- package/build/types/services/data/statuses.d.ts +5 -0
- package/build/types/services/data/transitions.d.ts +5 -0
- package/build/types/services/data/types.d.ts +899 -0
- package/build/types/services/dispatchers/actions/index.d.ts +5 -0
- package/build/types/services/dispatchers/actions/types.d.ts +78 -0
- package/build/types/services/dispatchers/dispatchers/index.d.ts +5 -0
- package/build/types/services/dispatchers/dispatchers/types.d.ts +111 -0
- package/build/types/services/dispatchers/index.d.ts +7 -0
- package/build/types/services/dispatchers/types.d.ts +2 -0
- package/build/types/services/events/events.d.ts +5 -0
- package/build/types/services/events/health.d.ts +9 -0
- package/build/types/services/events/index.d.ts +6 -0
- package/build/types/services/events/subscriptions.d.ts +5 -0
- package/build/types/services/events/types.d.ts +90 -0
- package/build/types/services/files/files.d.ts +5 -0
- package/build/types/services/files/formHelpers.d.ts +3 -0
- package/build/types/services/files/index.d.ts +6 -0
- package/build/types/services/files/settings/index.d.ts +5 -0
- package/build/types/services/files/settings/types.d.ts +38 -0
- package/build/types/services/files/tokens.d.ts +5 -0
- package/build/types/services/files/types.d.ts +185 -0
- package/build/types/services/helpers.d.ts +7 -0
- package/build/types/services/http-client.d.ts +22 -0
- package/build/types/services/index.d.ts +15 -0
- package/build/types/services/localizations/countries.d.ts +5 -0
- package/build/types/services/localizations/health.d.ts +9 -0
- package/build/types/services/localizations/index.d.ts +4 -0
- package/build/types/services/localizations/languages.d.ts +5 -0
- package/build/types/services/localizations/localizations.d.ts +5 -0
- package/build/types/services/localizations/types.d.ts +145 -0
- package/build/types/services/logs/access/index.d.ts +5 -0
- package/build/types/services/logs/access/types.d.ts +41 -0
- package/build/types/services/logs/index.d.ts +3 -0
- package/build/types/services/logs/types.d.ts +4 -0
- package/build/types/services/mails/index.d.ts +3 -0
- package/build/types/services/mails/mails.d.ts +5 -0
- package/build/types/services/mails/types.d.ts +141 -0
- package/build/types/services/notifications/health.d.ts +9 -0
- package/build/types/services/notifications/index.d.ts +7 -0
- package/build/types/services/notifications/notifications.d.ts +5 -0
- package/build/types/services/notifications/settings.d.ts +5 -0
- package/build/types/services/notifications/types.d.ts +222 -0
- package/build/types/services/payments/appStore.d.ts +5 -0
- package/build/types/services/payments/appStoreSubscriptions.d.ts +5 -0
- package/build/types/services/payments/health.d.ts +9 -0
- package/build/types/services/payments/index.d.ts +15 -0
- package/build/types/services/payments/orders.d.ts +5 -0
- package/build/types/services/payments/playStore.d.ts +5 -0
- package/build/types/services/payments/playStoreHistory.d.ts +5 -0
- package/build/types/services/payments/playStoreSubscriptions.d.ts +5 -0
- package/build/types/services/payments/products.d.ts +5 -0
- package/build/types/services/payments/stripe.d.ts +5 -0
- package/build/types/services/payments/subscriptions.d.ts +5 -0
- package/build/types/services/payments/types.d.ts +1189 -0
- package/build/types/services/profiles/groups.d.ts +5 -0
- package/build/types/services/profiles/health.d.ts +9 -0
- package/build/types/services/profiles/index.d.ts +9 -0
- package/build/types/services/profiles/logs.d.ts +5 -0
- package/build/types/services/profiles/profiles.d.ts +5 -0
- package/build/types/services/profiles/types.d.ts +369 -0
- package/build/types/services/tasks/api/index.d.ts +5 -0
- package/build/types/services/tasks/api/types.d.ts +146 -0
- package/build/types/services/tasks/apiRequests/index.d.ts +5 -0
- package/build/types/services/tasks/apiRequests/logs/index.d.ts +5 -0
- package/build/types/services/tasks/apiRequests/logs/types.d.ts +25 -0
- package/build/types/services/tasks/apiRequests/types.d.ts +83 -0
- package/build/types/services/tasks/functions/index.d.ts +5 -0
- package/build/types/services/tasks/functions/types.d.ts +27 -0
- package/build/types/services/tasks/index.d.ts +15 -0
- package/build/types/services/tasks/logs/index.d.ts +5 -0
- package/build/types/services/tasks/logs/types.d.ts +28 -0
- package/build/types/services/tasks/schedules/index.d.ts +5 -0
- package/build/types/services/tasks/schedules/types.d.ts +88 -0
- package/build/types/services/tasks/tasks.d.ts +5 -0
- package/build/types/services/tasks/types.d.ts +107 -0
- package/build/types/services/templates/index.d.ts +3 -0
- package/build/types/services/templates/templates.d.ts +5 -0
- package/build/types/services/templates/types.d.ts +202 -0
- package/build/types/services/types.d.ts +77 -0
- package/build/types/services/users/activationRequests/index.d.ts +4 -0
- package/build/types/services/users/activationRequests/types.d.ts +70 -0
- package/build/types/services/users/forgotPasswordRequests/index.d.ts +4 -0
- package/build/types/services/users/forgotPasswordRequests/types.d.ts +70 -0
- package/build/types/services/users/globalRoles.d.ts +5 -0
- package/build/types/services/users/groupRoles.d.ts +5 -0
- package/build/types/services/users/health.d.ts +9 -0
- package/build/types/services/users/index.d.ts +16 -0
- package/build/types/services/users/settings/index.d.ts +4 -0
- package/build/types/services/users/settings/types.d.ts +47 -0
- package/build/types/services/users/types.d.ts +1055 -0
- package/build/types/services/users/users.d.ts +5 -0
- package/build/types/sha1.d.ts +11 -0
- package/build/types/types.d.ts +102 -0
- package/build/types/utils.d.ts +4 -0
- package/build/types/version.d.ts +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HttpInstance } from '../../types';
|
|
2
|
+
import { HttpClient } from '../http-client';
|
|
3
|
+
import type { UsersService } from './types';
|
|
4
|
+
declare const _default: (userClient: HttpClient, httpWithAuth: HttpInstance, http: HttpInstance) => UsersService;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copied from https://github.com/pH200/hmacsha1-js/blob/master/index.js
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Computes a HMAC-SHA1 code.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} k Secret key.
|
|
8
|
+
* @param {string} d Data to be hashed.
|
|
9
|
+
* @return {string} The hashed string.
|
|
10
|
+
*/
|
|
11
|
+
export declare function HmacSHA1(k: any, d: any, _p?: any, _z?: any): string;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { TokenDataOauth2, HttpRequestConfig } from './http/types';
|
|
3
|
+
export * from './http/types';
|
|
4
|
+
export * from './services/types';
|
|
5
|
+
export * from './services/auth/types';
|
|
6
|
+
export * from './services/data/types';
|
|
7
|
+
export * from './services/files/types';
|
|
8
|
+
export * from './services/tasks/types';
|
|
9
|
+
export * from './services/users/types';
|
|
10
|
+
export * from './services/mails/types';
|
|
11
|
+
export * from './services/templates/types';
|
|
12
|
+
export * from './services/configurations/types';
|
|
13
|
+
export * from './services/dispatchers/types';
|
|
14
|
+
export * from './services/payments/types';
|
|
15
|
+
export * from './services/localizations/types';
|
|
16
|
+
export * from './services/profiles/types';
|
|
17
|
+
export * from './services/notifications/types';
|
|
18
|
+
export * from './services/events/types';
|
|
19
|
+
export interface ParamsOauth1WithEmail {
|
|
20
|
+
email: string;
|
|
21
|
+
password: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ParamsOauth1WithToken {
|
|
24
|
+
token: string;
|
|
25
|
+
tokenSecret: string;
|
|
26
|
+
skipTokenCheck?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface ParamsOauth2AuthorizationCode {
|
|
29
|
+
code: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ParamsOauth2Password {
|
|
32
|
+
username: string;
|
|
33
|
+
password: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ParamsOauth2Refresh {
|
|
36
|
+
refreshToken: string;
|
|
37
|
+
}
|
|
38
|
+
export declare type Oauth1AuthParams = ParamsOauth1WithEmail | ParamsOauth1WithToken;
|
|
39
|
+
export declare type Oauth2AuthParams = ParamsOauth2AuthorizationCode | ParamsOauth2Password | ParamsOauth2Refresh;
|
|
40
|
+
export declare type AuthParams = Oauth1AuthParams | Oauth2AuthParams;
|
|
41
|
+
interface ParamsBase {
|
|
42
|
+
host: string;
|
|
43
|
+
responseLogger?: (response: AxiosResponse | Error) => unknown;
|
|
44
|
+
requestLogger?: (request: HttpRequestConfig | Error) => unknown;
|
|
45
|
+
headers?: {
|
|
46
|
+
'X-Request-Service'?: string;
|
|
47
|
+
'X-Forwarded-Application'?: string;
|
|
48
|
+
'X-Forwarded-User'?: string;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated this property is only meant to be used for backwards compatibility when upgrading to v8.0.0.
|
|
52
|
+
*
|
|
53
|
+
* Key names that are not chosen by Extra Horizon where also affected by the data normalization before v8.0.0.
|
|
54
|
+
* They were converted from camel case to snake case before sending the request and the other way around before
|
|
55
|
+
* providing the response.
|
|
56
|
+
*
|
|
57
|
+
* Also fields ending with the name timestamp not chosen by extra horizon in custom properties where automatically
|
|
58
|
+
* converted to dates. Even though they could be just booleans, strings or numbers. Dates provided in such fields will
|
|
59
|
+
* now be converted to strings while all other types will stay as they are.
|
|
60
|
+
*
|
|
61
|
+
* 'records_affected', 'recordsAffected' as keys in custom properties were converted to affectedRecords. In v8.0.0
|
|
62
|
+
* they also stay as they are.
|
|
63
|
+
*
|
|
64
|
+
* To enable this behaviour again, set to true.
|
|
65
|
+
*/
|
|
66
|
+
normalizeCustomData?: boolean;
|
|
67
|
+
}
|
|
68
|
+
export interface ParamsOauth1Consumer extends ParamsBase {
|
|
69
|
+
consumerKey: string;
|
|
70
|
+
consumerSecret: string;
|
|
71
|
+
}
|
|
72
|
+
export interface ParamsOauth1Token extends ParamsOauth1Consumer {
|
|
73
|
+
token: string;
|
|
74
|
+
tokenSecret: string;
|
|
75
|
+
}
|
|
76
|
+
export declare type ParamsOauth1 = ParamsOauth1Consumer | ParamsOauth1Token;
|
|
77
|
+
export interface ParamsOauth2Client extends ParamsBase {
|
|
78
|
+
clientId: string;
|
|
79
|
+
clientSecret?: string;
|
|
80
|
+
freshTokensCallback?: (tokenData: TokenDataOauth2) => void;
|
|
81
|
+
}
|
|
82
|
+
export interface ParamsOauth2AccessToken extends ParamsOauth2Client {
|
|
83
|
+
refreshToken: string;
|
|
84
|
+
accessToken: string;
|
|
85
|
+
/**
|
|
86
|
+
* Can be supplied just as it is returned by the different authentication methods and the `freshTokensCallback`.
|
|
87
|
+
* Allows the SDK to continue using the supplied access token until just before it expires, then it is automatically refreshed.
|
|
88
|
+
*/
|
|
89
|
+
expiresIn?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Can be supplied just as it is returned by the different authentication methods and the `freshTokensCallback`.
|
|
92
|
+
* Allows the SDK to continue using the supplied access token until just before it expires, then it is automatically refreshed.
|
|
93
|
+
*/
|
|
94
|
+
creationTimestamp?: Date | string;
|
|
95
|
+
}
|
|
96
|
+
export declare type ParamsOauth2 = ParamsOauth2Client | ParamsOauth2AccessToken;
|
|
97
|
+
export declare type ParamsProxy = ParamsBase;
|
|
98
|
+
interface HttpClientBase {
|
|
99
|
+
packageVersion: string;
|
|
100
|
+
}
|
|
101
|
+
export declare type ClientParams = ParamsOauth1 | ParamsOauth2 | ParamsProxy;
|
|
102
|
+
export declare type HttpClientConfig = HttpClientBase & ClientParams;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ClientParams, GlobalPermissionName } from './types';
|
|
2
|
+
export declare function validateConfig<T extends ClientParams>(params: T): T;
|
|
3
|
+
export declare function delay(ms: number): Promise<void>;
|
|
4
|
+
export declare function parseGlobalPermissions(permissions: string[]): GlobalPermissionName[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const version = "8.2.0-test";
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@extrahorizon/javascript-sdk",
|
|
3
|
+
"version": "8.2.0-test",
|
|
4
|
+
"description": "This package serves as a JavaScript wrapper around all Extra Horizon cloud services.",
|
|
5
|
+
"main": "build/index.cjs.js",
|
|
6
|
+
"types": "build/types/index.d.ts",
|
|
7
|
+
"module": "build/index.mjs",
|
|
8
|
+
"author": "Qompium",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"clean": "rimraf build",
|
|
12
|
+
"start": "yarn test",
|
|
13
|
+
"start:watch": "yarn test --watch --reporters=\"default\"",
|
|
14
|
+
"create-version-file": "node -e \"require('fs').promises.writeFile('src/version.ts', 'export const version = \\'' + require('./package.json').version + '\\';\\n')\"",
|
|
15
|
+
"create-mock-sdk": "node generateMockTypes.js > src/mockType.ts",
|
|
16
|
+
"build": "yarn create-version-file && yarn clean && yarn build:library && yarn create-mock-sdk && yarn build:declarations",
|
|
17
|
+
"build:library": "rollup --config rollup.config.js",
|
|
18
|
+
"build:declarations": "tsc --project tsconfig.declarations.json",
|
|
19
|
+
"watch": "yarn create-version-file && rollup --config rollup.config.js -w",
|
|
20
|
+
"watch:declarations": "tsc -w --project tsconfig.declarations.json",
|
|
21
|
+
"prepare": "yarn build && yarn lint",
|
|
22
|
+
"test": "jest",
|
|
23
|
+
"test:e2e": "jest tests/e2e",
|
|
24
|
+
"lint": "eslint src --ext .ts"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"build"
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"axios": "0.28.1",
|
|
31
|
+
"buffer": "6.0.3",
|
|
32
|
+
"fflate": "0.8.2",
|
|
33
|
+
"form-data": "4.0.0",
|
|
34
|
+
"platform-specific": "1.1.0",
|
|
35
|
+
"qs": "6.12.0",
|
|
36
|
+
"typescript-json-decoder": "1.0.11"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@extrahorizon/eslint-config-node": "^1.6.0",
|
|
40
|
+
"@rollup/plugin-json": "^4.1.0",
|
|
41
|
+
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
42
|
+
"@rollup/plugin-typescript": "^8.3.1",
|
|
43
|
+
"@types/jest": "^29.5.12",
|
|
44
|
+
"@types/node": "^17.0.21",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^5.13.0",
|
|
46
|
+
"@typescript-eslint/parser": "^5.13.0",
|
|
47
|
+
"dotenv": "^16.4.5",
|
|
48
|
+
"eslint": "^8.57.0",
|
|
49
|
+
"jest": "^29.7.0",
|
|
50
|
+
"nock": "^13.5.4",
|
|
51
|
+
"rimraf": "^5.0.5",
|
|
52
|
+
"rollup": "^2.68.0",
|
|
53
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
54
|
+
"ts-jest": "^29.1.2",
|
|
55
|
+
"typescript": "^4.5.5"
|
|
56
|
+
}
|
|
57
|
+
}
|