@extrahorizon/javascript-sdk 8.9.0-feat-134-c0f5b9d → 8.9.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/CHANGELOG.md +14 -1
- package/build/index.cjs.js +75 -119
- package/build/index.mjs +74 -120
- package/build/types/errors.d.ts +6 -0
- package/build/types/http/oAuth1Signature.d.ts +4 -0
- package/build/types/mockType.d.ts +30 -24
- package/build/types/services/auth/oidc/providers/types.d.ts +4 -0
- package/build/types/services/events/index.d.ts +1 -2
- package/build/types/services/events/types.d.ts +5 -0
- package/build/types/services/localizations/index.d.ts +1 -2
- package/build/types/services/localizations/types.d.ts +5 -0
- package/build/types/services/notifications/index.d.ts +1 -2
- package/build/types/services/notifications/types.d.ts +5 -0
- package/build/types/services/notificationsV2/index.d.ts +1 -2
- package/build/types/services/notificationsV2/types.d.ts +5 -0
- package/build/types/services/profiles/index.d.ts +1 -2
- package/build/types/services/profiles/types.d.ts +5 -0
- package/build/types/services/tasks/functions/types.d.ts +1 -1
- package/build/types/services/tasks/schedules/types.d.ts +4 -0
- package/build/types/services/tasks/types.d.ts +11 -0
- package/build/types/services/templates/types.d.ts +70 -32
- package/build/types/services/templatesV2/index.d.ts +1 -2
- package/build/types/services/templatesV2/types.d.ts +16 -5
- package/build/types/services/users/index.d.ts +2 -4
- package/build/types/services/users/types.d.ts +5 -0
- package/build/types/types.d.ts +1 -0
- package/build/types/version.d.ts +1 -1
- package/package.json +3 -3
- package/build/types/services/events/health.d.ts +0 -9
- package/build/types/services/localizations/health.d.ts +0 -9
- package/build/types/services/notifications/health.d.ts +0 -9
- package/build/types/services/notificationsV2/health.d.ts +0 -9
- package/build/types/services/profiles/health.d.ts +0 -9
- package/build/types/services/templatesV2/health.d.ts +0 -9
- package/build/types/services/users/health.d.ts +0 -9
|
@@ -1,41 +1,78 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { FindAllIterator } from '../../services/helpers';
|
|
3
|
-
import { TypeConfiguration } from '../data/types';
|
|
4
3
|
import { ObjectId, LanguageCode, TimeZone, PagedResult, AffectedRecords, OptionsWithRql, OptionsBase } from '../types';
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
export declare type TemplateOut = Template;
|
|
5
|
+
export declare type TemplateIn = TemplateCreation;
|
|
6
|
+
export interface Template {
|
|
7
|
+
id: ObjectId;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
schema: TemplateObjectConfiguration;
|
|
11
|
+
fields: Record<string, string>;
|
|
12
|
+
creationTimestamp: Date;
|
|
13
|
+
updateTimestamp: Date;
|
|
13
14
|
}
|
|
14
|
-
export interface
|
|
15
|
+
export interface TemplateCreation {
|
|
15
16
|
name: string;
|
|
16
17
|
description: string;
|
|
17
18
|
schema: TemplateObjectConfiguration;
|
|
18
19
|
fields: Record<string, string>;
|
|
19
20
|
}
|
|
21
|
+
export declare type TemplateTypeConfiguration = TemplateObjectConfiguration | TemplateArrayConfiguration | TemplateStringConfiguration | TemplateNumberConfiguration | TemplateBooleanConfiguration | TemplateObjectIdConfiguration | TemplateDateConfiguration;
|
|
20
22
|
export interface TemplateObjectConfiguration {
|
|
21
|
-
type
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
type: 'object';
|
|
24
|
+
fields?: Record<string, TemplateTypeConfiguration>;
|
|
25
|
+
options?: TemplateObjectOption[];
|
|
26
|
+
}
|
|
27
|
+
export interface TemplateArrayConfiguration {
|
|
28
|
+
type: 'array';
|
|
29
|
+
type_configuration: TemplateTypeConfiguration;
|
|
30
|
+
options?: TemplateArrayOption[];
|
|
31
|
+
}
|
|
32
|
+
export interface TemplateStringConfiguration {
|
|
33
|
+
type: 'string';
|
|
34
|
+
options?: TemplateStringOption[];
|
|
35
|
+
}
|
|
36
|
+
export interface TemplateNumberConfiguration {
|
|
37
|
+
type: 'number';
|
|
38
|
+
options?: TemplateNumberOption[];
|
|
24
39
|
}
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
type?: ObjectMinBytesOptionType;
|
|
28
|
-
value: number;
|
|
40
|
+
export interface TemplateBooleanConfiguration {
|
|
41
|
+
type: 'boolean';
|
|
29
42
|
}
|
|
30
|
-
export
|
|
31
|
-
|
|
43
|
+
export interface TemplateObjectIdConfiguration {
|
|
44
|
+
type: 'object_id';
|
|
32
45
|
}
|
|
33
|
-
export interface
|
|
34
|
-
type
|
|
35
|
-
|
|
46
|
+
export interface TemplateDateConfiguration {
|
|
47
|
+
type: 'date';
|
|
48
|
+
options?: TemplateDateOption[];
|
|
36
49
|
}
|
|
37
|
-
export declare
|
|
38
|
-
|
|
50
|
+
export declare type TemplateObjectOption = TemplateObjectMinBytesOption | TemplateObjectMaxBytesOption;
|
|
51
|
+
export declare type TemplateObjectMinBytesOption = TemplateTypeOption<'min_bytes', number>;
|
|
52
|
+
export declare type TemplateObjectMaxBytesOption = TemplateTypeOption<'max_bytes', number>;
|
|
53
|
+
export declare type TemplateNumberOption = TemplateNumberInOption | TemplateNumberMaxOption | TemplateNumberMaxSizeOption | TemplateNumberMinOption | TemplateNumberMinSizeOption | TemplateNumberSizeOption;
|
|
54
|
+
export declare type TemplateNumberInOption = TemplateTypeOption<'in', number[]>;
|
|
55
|
+
export declare type TemplateNumberMaxOption = TemplateTypeOption<'max', number>;
|
|
56
|
+
export declare type TemplateNumberMaxSizeOption = TemplateTypeOption<'max_size', number>;
|
|
57
|
+
export declare type TemplateNumberMinOption = TemplateTypeOption<'min', number>;
|
|
58
|
+
export declare type TemplateNumberMinSizeOption = TemplateTypeOption<'min_size', number>;
|
|
59
|
+
export declare type TemplateNumberSizeOption = TemplateTypeOption<'size', number>;
|
|
60
|
+
export declare type TemplateArrayOption = TemplateArrayMaxSizeOption | TemplateArrayMinSizeOption | TemplateArraySizeOption;
|
|
61
|
+
export declare type TemplateArrayMaxSizeOption = TemplateTypeOption<'max_size', number>;
|
|
62
|
+
export declare type TemplateArrayMinSizeOption = TemplateTypeOption<'min_size', number>;
|
|
63
|
+
export declare type TemplateArraySizeOption = TemplateTypeOption<'size', number>;
|
|
64
|
+
export declare type TemplateStringOption = TemplateStringInOption | TemplateStringMaxSizeOption | TemplateStringMinSizeOption | TemplateStringRegexOption | TemplateStringSizeOption;
|
|
65
|
+
export declare type TemplateStringInOption = TemplateTypeOption<'in', string[]>;
|
|
66
|
+
export declare type TemplateStringRegexOption = TemplateTypeOption<'regex', string>;
|
|
67
|
+
export declare type TemplateStringMaxSizeOption = TemplateTypeOption<'max_size', number>;
|
|
68
|
+
export declare type TemplateStringMinSizeOption = TemplateTypeOption<'min_size', number>;
|
|
69
|
+
export declare type TemplateStringSizeOption = TemplateTypeOption<'size', number>;
|
|
70
|
+
export declare type TemplateDateOption = TemplateDateMaxOption | TemplateDateMinOption;
|
|
71
|
+
export declare type TemplateDateMaxOption = TemplateTypeOption<'max', number>;
|
|
72
|
+
export declare type TemplateDateMinOption = TemplateTypeOption<'min', number>;
|
|
73
|
+
interface TemplateTypeOption<T, V> {
|
|
74
|
+
type: T;
|
|
75
|
+
value: V;
|
|
39
76
|
}
|
|
40
77
|
export interface CreateFile {
|
|
41
78
|
/**
|
|
@@ -63,7 +100,7 @@ export interface TemplatesService {
|
|
|
63
100
|
* @param rql Add filters to the requested list.
|
|
64
101
|
* @returns PagedResult<TemplateOut>
|
|
65
102
|
*/
|
|
66
|
-
find(options?: OptionsWithRql): Promise<PagedResult<
|
|
103
|
+
find(options?: OptionsWithRql): Promise<PagedResult<Template>>;
|
|
67
104
|
/**
|
|
68
105
|
* Request a list of all templates
|
|
69
106
|
*
|
|
@@ -75,7 +112,7 @@ export interface TemplatesService {
|
|
|
75
112
|
* @param rql Add filters to the requested list.
|
|
76
113
|
* @returns TemplateOut[]
|
|
77
114
|
*/
|
|
78
|
-
findAll(options?: OptionsWithRql): Promise<
|
|
115
|
+
findAll(options?: OptionsWithRql): Promise<Template[]>;
|
|
79
116
|
/**
|
|
80
117
|
* Request a list of all templates
|
|
81
118
|
*
|
|
@@ -85,24 +122,24 @@ export interface TemplatesService {
|
|
|
85
122
|
* @param rql Add filters to the requested list.
|
|
86
123
|
* @returns TemplateOut[]
|
|
87
124
|
*/
|
|
88
|
-
findAllIterator(options?: OptionsWithRql): FindAllIterator<
|
|
125
|
+
findAllIterator(options?: OptionsWithRql): FindAllIterator<Template>;
|
|
89
126
|
/**
|
|
90
127
|
* Find By Id
|
|
91
128
|
* @param id the Id to search for
|
|
92
129
|
* @returns the first element found
|
|
93
130
|
*/
|
|
94
|
-
findById(id: ObjectId, options?: OptionsWithRql): Promise<
|
|
131
|
+
findById(id: ObjectId, options?: OptionsWithRql): Promise<Template | undefined>;
|
|
95
132
|
/**
|
|
96
133
|
* Find By Name
|
|
97
134
|
* @param name the name to search for
|
|
98
135
|
* @returns the first element found
|
|
99
136
|
*/
|
|
100
|
-
findByName(name: string, options?: OptionsWithRql): Promise<
|
|
137
|
+
findByName(name: string, options?: OptionsWithRql): Promise<Template | undefined>;
|
|
101
138
|
/**
|
|
102
139
|
* Find First
|
|
103
140
|
* @returns the first element found
|
|
104
141
|
*/
|
|
105
|
-
findFirst(options?: OptionsWithRql): Promise<
|
|
142
|
+
findFirst(options?: OptionsWithRql): Promise<Template | undefined>;
|
|
106
143
|
/**
|
|
107
144
|
* Create a new template
|
|
108
145
|
*
|
|
@@ -112,7 +149,7 @@ export interface TemplatesService {
|
|
|
112
149
|
* @param requestBody TemplateIn
|
|
113
150
|
* @returns TemplateOut
|
|
114
151
|
*/
|
|
115
|
-
create(requestBody:
|
|
152
|
+
create(requestBody: TemplateCreation, options?: OptionsBase): Promise<Template>;
|
|
116
153
|
/**
|
|
117
154
|
* Update an existing template
|
|
118
155
|
*
|
|
@@ -124,7 +161,7 @@ export interface TemplatesService {
|
|
|
124
161
|
* @returns TemplateOut
|
|
125
162
|
* @throws {ResourceUnknownError}
|
|
126
163
|
*/
|
|
127
|
-
update(templateId: string, requestBody:
|
|
164
|
+
update(templateId: string, requestBody: TemplateCreation, options?: OptionsBase): Promise<Template>;
|
|
128
165
|
/**
|
|
129
166
|
* Delete a template
|
|
130
167
|
*
|
|
@@ -197,3 +234,4 @@ export interface TemplatesService {
|
|
|
197
234
|
*/
|
|
198
235
|
resolveAsJsonUsingCode(templateId: string, localizationCode: string, requestBody: CreateFile, options?: OptionsBase): Promise<Record<string, string>>;
|
|
199
236
|
}
|
|
237
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { AuthHttpClient } from '../../types';
|
|
2
|
-
import health from './health';
|
|
3
2
|
import { TemplatesV2Service } from './types';
|
|
4
|
-
export declare const templatesV2Service: (httpWithAuth: AuthHttpClient) =>
|
|
3
|
+
export declare const templatesV2Service: (httpWithAuth: AuthHttpClient) => TemplatesV2Service;
|
|
@@ -7,9 +7,15 @@ export interface TemplateV2 extends TemplateV2Creation {
|
|
|
7
7
|
export interface TemplateV2Creation {
|
|
8
8
|
name: string;
|
|
9
9
|
description?: string;
|
|
10
|
-
|
|
10
|
+
inputs?: Record<string, TemplateV2TypeConfiguration>;
|
|
11
11
|
outputs: Record<string, string>;
|
|
12
12
|
}
|
|
13
|
+
export interface TemplateV2Update {
|
|
14
|
+
name?: string;
|
|
15
|
+
description?: string | null;
|
|
16
|
+
inputs?: Record<string, TemplateV2TypeConfiguration> | null;
|
|
17
|
+
outputs?: Record<string, string>;
|
|
18
|
+
}
|
|
13
19
|
export declare type TemplateV2TypeConfiguration = TemplateV2ObjectConfiguration | TemplateV2ArrayConfiguration | TemplateV2StringConfiguration | TemplateV2NumberConfiguration | TemplateV2BooleanConfiguration;
|
|
14
20
|
export interface TemplateV2ObjectConfiguration {
|
|
15
21
|
type: 'object';
|
|
@@ -37,7 +43,7 @@ export interface TemplateV2ResolveIn<T extends Record<string, any>> {
|
|
|
37
43
|
* If not present (or empty) we will first check the configured time_zone in the users-service. If that is not present it will default to 'UTC'
|
|
38
44
|
*/
|
|
39
45
|
timeZone?: TimeZone;
|
|
40
|
-
|
|
46
|
+
inputs?: T;
|
|
41
47
|
}
|
|
42
48
|
export interface TemplatesV2ErrorInfo {
|
|
43
49
|
/**
|
|
@@ -95,7 +101,7 @@ export interface TemplatesV2Service {
|
|
|
95
101
|
* Permission | Scope | Effect
|
|
96
102
|
* - | - | -
|
|
97
103
|
* `CREATE_TEMPLATES` | `global` | **Required** for this endpoint
|
|
98
|
-
* @param requestBody
|
|
104
|
+
* @param requestBody TemplateV2Creation
|
|
99
105
|
* @returns TemplateV2
|
|
100
106
|
* @throws {ResourceAlreadyExistsError}
|
|
101
107
|
* @throws {TemplateSyntaxError}
|
|
@@ -108,13 +114,13 @@ export interface TemplatesV2Service {
|
|
|
108
114
|
* - | - | -
|
|
109
115
|
* `UPDATE_TEMPLATES` | `global` | **Required** for this endpoint
|
|
110
116
|
* @param templateIdOrName Id or Name of the targeted template
|
|
111
|
-
* @param requestBody
|
|
117
|
+
* @param requestBody TemplateV2Update
|
|
112
118
|
* @returns TemplateV2
|
|
113
119
|
* @throws {ResourceAlreadyExistsError}
|
|
114
120
|
* @throws {TemplateSyntaxError}
|
|
115
121
|
* @throws {ResourceUnknownError}
|
|
116
122
|
*/
|
|
117
|
-
update(templateIdOrName: string, requestBody:
|
|
123
|
+
update(templateIdOrName: string, requestBody: TemplateV2Update, options?: OptionsBase): Promise<AffectedRecords>;
|
|
118
124
|
/**
|
|
119
125
|
* Delete a template
|
|
120
126
|
*
|
|
@@ -142,4 +148,9 @@ export interface TemplatesV2Service {
|
|
|
142
148
|
* @throws {ResourceUnknownError}
|
|
143
149
|
*/
|
|
144
150
|
resolve<InputData = Record<string, any>, Outputs = Record<string, string>>(templateIdOrName: string, requestBody: TemplateV2ResolveIn<InputData>, options?: OptionsBase): Promise<Outputs>;
|
|
151
|
+
/**
|
|
152
|
+
* Perform a health check
|
|
153
|
+
* @returns {boolean} success
|
|
154
|
+
*/
|
|
155
|
+
health(): Promise<boolean>;
|
|
145
156
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import type { HttpInstance } from '../../types';
|
|
1
|
+
import type { HttpInstance, UsersService } from '../../types';
|
|
2
2
|
import { ActivationRequestsService } from './activationRequests/types';
|
|
3
3
|
import { ForgotPasswordRequestsService } from './forgotPasswordRequests/types';
|
|
4
4
|
import globalRoles from './globalRoles';
|
|
5
5
|
import groupRoles from './groupRoles';
|
|
6
|
-
import health from './health';
|
|
7
6
|
import { SettingsService } from './settings/types';
|
|
8
7
|
import { UsersGlobalRolesService, UsersGroupRolesService } from './types';
|
|
9
|
-
|
|
10
|
-
export declare const usersService: (httpWithAuth: HttpInstance, http: HttpInstance) => ReturnType<typeof users> & ReturnType<typeof health> & {
|
|
8
|
+
export declare const usersService: (httpWithAuth: HttpInstance, http: HttpInstance) => UsersService & {
|
|
11
9
|
globalRoles: UsersGlobalRolesService;
|
|
12
10
|
groupRoles: UsersGroupRolesService;
|
|
13
11
|
activationRequests: ActivationRequestsService;
|
|
@@ -1216,4 +1216,9 @@ export interface UsersService {
|
|
|
1216
1216
|
* @returns A list of email templates {@link EmailTemplates}
|
|
1217
1217
|
*/
|
|
1218
1218
|
setEmailTemplates(templates: Partial<EmailTemplates>): Promise<EmailTemplates>;
|
|
1219
|
+
/**
|
|
1220
|
+
* Perform a health check
|
|
1221
|
+
* @returns {boolean} success
|
|
1222
|
+
*/
|
|
1223
|
+
health(): Promise<boolean>;
|
|
1219
1224
|
}
|
package/build/types/types.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './services/tasks/types';
|
|
|
9
9
|
export * from './services/users/types';
|
|
10
10
|
export * from './services/mails/types';
|
|
11
11
|
export * from './services/templates/types';
|
|
12
|
+
export * from './services/templatesV2/types';
|
|
12
13
|
export * from './services/configurations/types';
|
|
13
14
|
export * from './services/dispatchers/types';
|
|
14
15
|
export * from './services/payments/types';
|
package/build/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "8.9.0
|
|
1
|
+
export declare const version = "8.9.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@extrahorizon/javascript-sdk",
|
|
3
|
-
"version": "8.9.0
|
|
3
|
+
"version": "8.9.0",
|
|
4
4
|
"description": "This package serves as a JavaScript wrapper around all Extra Horizon cloud services.",
|
|
5
5
|
"main": "build/index.cjs.js",
|
|
6
6
|
"types": "build/types/index.d.ts",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"build"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"axios": "0.30.
|
|
35
|
+
"axios": "0.30.3",
|
|
36
36
|
"buffer": "6.0.3",
|
|
37
37
|
"fflate": "0.8.2",
|
|
38
38
|
"form-data": "4.0.4",
|
|
39
39
|
"platform-specific": "1.1.0",
|
|
40
|
-
"qs": "6.14.
|
|
40
|
+
"qs": "6.14.2",
|
|
41
41
|
"typescript-json-decoder": "1.0.11"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { HttpInstance } from '../../types';
|
|
2
|
-
declare const _default: (client: any, httpAuth: HttpInstance) => {
|
|
3
|
-
/**
|
|
4
|
-
* Perform a health check for profiles service
|
|
5
|
-
* @returns {boolean} success
|
|
6
|
-
*/
|
|
7
|
-
health(): Promise<boolean>;
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|