@extrahorizon/javascript-sdk 8.10.0-dev-159-0e9a0f1 → 8.10.0-dev-161-c1dd6ca
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 +22 -0
- package/build/btoa.d.ts +6 -0
- package/build/client.d.ts +147 -0
- package/build/constants.d.ts +17 -0
- package/build/errorHandler.d.ts +1 -0
- package/build/errors.d.ts +361 -0
- package/build/http/client.d.ts +2 -0
- package/build/http/index.d.ts +4 -0
- package/build/http/interceptors.d.ts +9 -0
- package/build/http/oAuth1Signature.d.ts +18 -0
- package/build/http/oauth1.d.ts +3 -0
- package/build/http/oauth2.d.ts +3 -0
- package/build/http/proxy.d.ts +3 -0
- package/build/http/types.d.ts +331 -0
- package/build/http/utils.d.ts +21 -0
- package/build/index.cjs.js +1 -1
- package/build/index.d.ts +9 -0
- package/build/index.mjs +1 -1
- package/build/mock.d.ts +43 -0
- package/build/mockType.d.ts +1721 -0
- package/build/parseStoredCredentials.d.ts +11 -0
- package/build/rql/index.d.ts +16 -0
- package/build/rql/parser.d.ts +1 -0
- package/build/rql/types.d.ts +174 -0
- package/build/services/auth/applications/index.d.ts +5 -0
- package/build/services/auth/applications/types.d.ts +260 -0
- package/build/services/auth/index.d.ts +3 -0
- package/build/services/auth/oauth1/index.d.ts +5 -0
- package/build/services/auth/oauth1/types.d.ts +102 -0
- package/build/services/auth/oauth2/index.d.ts +5 -0
- package/build/services/auth/oauth2/types.d.ts +100 -0
- package/build/services/auth/oidc/index.d.ts +5 -0
- package/build/services/auth/oidc/loginAttempts/index.d.ts +5 -0
- package/build/services/auth/oidc/loginAttempts/types.d.ts +67 -0
- package/build/services/auth/oidc/providers/index.d.ts +5 -0
- package/build/services/auth/oidc/providers/types.d.ts +148 -0
- package/build/services/auth/oidc/types.d.ts +40 -0
- package/build/services/auth/types.d.ts +39 -0
- package/build/services/auth/users/index.d.ts +5 -0
- package/build/services/auth/users/types.d.ts +121 -0
- package/build/services/configurations/general.d.ts +5 -0
- package/build/services/configurations/groups.d.ts +5 -0
- package/build/services/configurations/index.d.ts +10 -0
- package/build/services/configurations/patients.d.ts +5 -0
- package/build/services/configurations/staff.d.ts +5 -0
- package/build/services/configurations/types.d.ts +222 -0
- package/build/services/configurations/users.d.ts +5 -0
- package/build/services/data/comments.d.ts +5 -0
- package/build/services/data/documents.d.ts +5 -0
- package/build/services/data/index.d.ts +13 -0
- package/build/services/data/indexes.d.ts +5 -0
- package/build/services/data/infrastructure.d.ts +10 -0
- package/build/services/data/json-schema.d.ts +121 -0
- package/build/services/data/properties.d.ts +5 -0
- package/build/services/data/schemas.d.ts +5 -0
- package/build/services/data/statuses.d.ts +5 -0
- package/build/services/data/transitions.d.ts +5 -0
- package/build/services/data/types.d.ts +1500 -0
- package/build/services/dispatchers/actions/index.d.ts +5 -0
- package/build/services/dispatchers/actions/types.d.ts +78 -0
- package/build/services/dispatchers/dispatchers/index.d.ts +5 -0
- package/build/services/dispatchers/dispatchers/types.d.ts +111 -0
- package/build/services/dispatchers/index.d.ts +7 -0
- package/build/services/dispatchers/types.d.ts +2 -0
- package/build/services/events/events.d.ts +5 -0
- package/build/services/events/index.d.ts +5 -0
- package/build/services/events/subscriptions.d.ts +5 -0
- package/build/services/events/types.d.ts +107 -0
- package/build/services/files/files.d.ts +5 -0
- package/build/services/files/formHelpers.d.ts +3 -0
- package/build/services/files/index.d.ts +6 -0
- package/build/services/files/settings/index.d.ts +5 -0
- package/build/services/files/settings/types.d.ts +38 -0
- package/build/services/files/tokens.d.ts +5 -0
- package/build/services/files/types.d.ts +185 -0
- package/build/services/helpers.d.ts +7 -0
- package/build/services/http-client.d.ts +22 -0
- package/build/services/index.d.ts +16 -0
- package/build/services/localizations/countries.d.ts +5 -0
- package/build/services/localizations/index.d.ts +3 -0
- package/build/services/localizations/languages.d.ts +5 -0
- package/build/services/localizations/localizations.d.ts +5 -0
- package/build/services/localizations/types.d.ts +150 -0
- package/build/services/logs/access/index.d.ts +5 -0
- package/build/services/logs/access/types.d.ts +41 -0
- package/build/services/logs/index.d.ts +3 -0
- package/build/services/logs/types.d.ts +4 -0
- package/build/services/mails/index.d.ts +3 -0
- package/build/services/mails/mails.d.ts +5 -0
- package/build/services/mails/types.d.ts +149 -0
- package/build/services/notifications/index.d.ts +6 -0
- package/build/services/notifications/notifications.d.ts +5 -0
- package/build/services/notifications/settings.d.ts +5 -0
- package/build/services/notifications/types.d.ts +235 -0
- package/build/services/notificationsV2/index.d.ts +6 -0
- package/build/services/notificationsV2/notificationsV2.d.ts +5 -0
- package/build/services/notificationsV2/types.d.ts +166 -0
- package/build/services/notificationsV2/userSettings/index.d.ts +5 -0
- package/build/services/notificationsV2/userSettings/types.d.ts +138 -0
- package/build/services/payments/appStore.d.ts +5 -0
- package/build/services/payments/appStoreSubscriptions.d.ts +5 -0
- package/build/services/payments/health.d.ts +9 -0
- package/build/services/payments/index.d.ts +15 -0
- package/build/services/payments/orders.d.ts +5 -0
- package/build/services/payments/playStore.d.ts +5 -0
- package/build/services/payments/playStoreHistory.d.ts +5 -0
- package/build/services/payments/playStoreSubscriptions.d.ts +5 -0
- package/build/services/payments/products.d.ts +5 -0
- package/build/services/payments/stripe.d.ts +5 -0
- package/build/services/payments/subscriptions.d.ts +5 -0
- package/build/services/payments/types.d.ts +1198 -0
- package/build/services/profiles/groups.d.ts +5 -0
- package/build/services/profiles/index.d.ts +8 -0
- package/build/services/profiles/logs.d.ts +5 -0
- package/build/services/profiles/profiles.d.ts +5 -0
- package/build/services/profiles/types.d.ts +375 -0
- package/build/services/tasks/api/index.d.ts +5 -0
- package/build/services/tasks/api/types.d.ts +146 -0
- package/build/services/tasks/apiRequests/index.d.ts +5 -0
- package/build/services/tasks/apiRequests/logs/index.d.ts +5 -0
- package/build/services/tasks/apiRequests/logs/types.d.ts +25 -0
- package/build/services/tasks/apiRequests/types.d.ts +83 -0
- package/build/services/tasks/functions/index.d.ts +5 -0
- package/build/services/tasks/functions/types.d.ts +171 -0
- package/build/services/tasks/index.d.ts +15 -0
- package/build/services/tasks/logs/index.d.ts +5 -0
- package/build/services/tasks/logs/types.d.ts +28 -0
- package/build/services/tasks/schedules/index.d.ts +5 -0
- package/build/services/tasks/schedules/types.d.ts +92 -0
- package/build/services/tasks/tasks.d.ts +5 -0
- package/build/services/tasks/types.d.ts +118 -0
- package/build/services/templates/index.d.ts +3 -0
- package/build/services/templates/templates.d.ts +5 -0
- package/build/services/templates/types.d.ts +237 -0
- package/build/services/templatesV2/index.d.ts +3 -0
- package/build/services/templatesV2/templatesV2.d.ts +5 -0
- package/build/services/templatesV2/types.d.ts +156 -0
- package/build/services/types.d.ts +103 -0
- package/build/services/users/activationRequests/index.d.ts +4 -0
- package/build/services/users/activationRequests/types.d.ts +70 -0
- package/build/services/users/forgotPasswordRequests/index.d.ts +4 -0
- package/build/services/users/forgotPasswordRequests/types.d.ts +70 -0
- package/build/services/users/globalRoles.d.ts +5 -0
- package/build/services/users/groupRoles.d.ts +5 -0
- package/build/services/users/index.d.ts +14 -0
- package/build/services/users/settings/index.d.ts +4 -0
- package/build/services/users/settings/types.d.ts +47 -0
- package/build/services/users/types.d.ts +1278 -0
- package/build/services/users/users.d.ts +5 -0
- package/build/sha1.d.ts +11 -0
- package/build/types/services/users/types.d.ts +69 -25
- package/build/types/version.d.ts +1 -1
- package/build/types.d.ts +104 -0
- package/build/utils.d.ts +5 -0
- package/build/version.d.ts +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { FindAllIterator } from '../../services/helpers';
|
|
3
|
+
import { ObjectId, LanguageCode, TimeZone, PagedResult, AffectedRecords, OptionsWithRql, OptionsBase } from '../types';
|
|
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;
|
|
14
|
+
}
|
|
15
|
+
export interface TemplateCreation {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
schema: TemplateObjectConfiguration;
|
|
19
|
+
fields: Record<string, string>;
|
|
20
|
+
}
|
|
21
|
+
export declare type TemplateTypeConfiguration = TemplateObjectConfiguration | TemplateArrayConfiguration | TemplateStringConfiguration | TemplateNumberConfiguration | TemplateBooleanConfiguration | TemplateObjectIdConfiguration | TemplateDateConfiguration;
|
|
22
|
+
export interface TemplateObjectConfiguration {
|
|
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[];
|
|
39
|
+
}
|
|
40
|
+
export interface TemplateBooleanConfiguration {
|
|
41
|
+
type: 'boolean';
|
|
42
|
+
}
|
|
43
|
+
export interface TemplateObjectIdConfiguration {
|
|
44
|
+
type: 'object_id';
|
|
45
|
+
}
|
|
46
|
+
export interface TemplateDateConfiguration {
|
|
47
|
+
type: 'date';
|
|
48
|
+
options?: TemplateDateOption[];
|
|
49
|
+
}
|
|
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;
|
|
76
|
+
}
|
|
77
|
+
export interface CreateFile {
|
|
78
|
+
/**
|
|
79
|
+
* If not present (or empty) we will first check the configured language in the users-service. If that is not present it will default to 'EN'
|
|
80
|
+
*/
|
|
81
|
+
language?: LanguageCode;
|
|
82
|
+
/**
|
|
83
|
+
* 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 'Europe/Brussels'
|
|
84
|
+
*/
|
|
85
|
+
timeZone?: TimeZone;
|
|
86
|
+
content: Record<string, any>;
|
|
87
|
+
}
|
|
88
|
+
export interface TemplatesService {
|
|
89
|
+
/**
|
|
90
|
+
* Perform a health check
|
|
91
|
+
* @returns {boolean} success
|
|
92
|
+
*/
|
|
93
|
+
health(): Promise<boolean>;
|
|
94
|
+
/**
|
|
95
|
+
* Get all templates the service has to offer
|
|
96
|
+
*
|
|
97
|
+
* Permission | Scope | Effect
|
|
98
|
+
* - | - | -
|
|
99
|
+
* `VIEW_TEMPLATES` | `global` | **Required** for this endpoint
|
|
100
|
+
* @param rql Add filters to the requested list.
|
|
101
|
+
* @returns PagedResult<TemplateOut>
|
|
102
|
+
*/
|
|
103
|
+
find(options?: OptionsWithRql): Promise<PagedResult<Template>>;
|
|
104
|
+
/**
|
|
105
|
+
* Request a list of all templates
|
|
106
|
+
*
|
|
107
|
+
* Do not pass in an rql with limit operator!
|
|
108
|
+
*
|
|
109
|
+
* Permission | Scope | Effect
|
|
110
|
+
* - | - | -
|
|
111
|
+
* `VIEW_TEMPLATES` | `global` | **Required** for this endpoint
|
|
112
|
+
* @param rql Add filters to the requested list.
|
|
113
|
+
* @returns TemplateOut[]
|
|
114
|
+
*/
|
|
115
|
+
findAll(options?: OptionsWithRql): Promise<Template[]>;
|
|
116
|
+
/**
|
|
117
|
+
* Request a list of all templates
|
|
118
|
+
*
|
|
119
|
+
* Permission | Scope | Effect
|
|
120
|
+
* - | - | -
|
|
121
|
+
* `VIEW_TEMPLATES` | `global` | **Required** for this endpoint
|
|
122
|
+
* @param rql Add filters to the requested list.
|
|
123
|
+
* @returns TemplateOut[]
|
|
124
|
+
*/
|
|
125
|
+
findAllIterator(options?: OptionsWithRql): FindAllIterator<Template>;
|
|
126
|
+
/**
|
|
127
|
+
* Find By Id
|
|
128
|
+
* @param id the Id to search for
|
|
129
|
+
* @returns the first element found
|
|
130
|
+
*/
|
|
131
|
+
findById(id: ObjectId, options?: OptionsWithRql): Promise<Template | undefined>;
|
|
132
|
+
/**
|
|
133
|
+
* Find By Name
|
|
134
|
+
* @param name the name to search for
|
|
135
|
+
* @returns the first element found
|
|
136
|
+
*/
|
|
137
|
+
findByName(name: string, options?: OptionsWithRql): Promise<Template | undefined>;
|
|
138
|
+
/**
|
|
139
|
+
* Find First
|
|
140
|
+
* @returns the first element found
|
|
141
|
+
*/
|
|
142
|
+
findFirst(options?: OptionsWithRql): Promise<Template | undefined>;
|
|
143
|
+
/**
|
|
144
|
+
* Create a new template
|
|
145
|
+
*
|
|
146
|
+
* Permission | Scope | Effect
|
|
147
|
+
* - | - | -
|
|
148
|
+
* `CREATE_TEMPLATES` | `global` | **Required** for this endpoint
|
|
149
|
+
* @param requestBody TemplateIn
|
|
150
|
+
* @returns TemplateOut
|
|
151
|
+
*/
|
|
152
|
+
create(requestBody: TemplateCreation, options?: OptionsBase): Promise<Template>;
|
|
153
|
+
/**
|
|
154
|
+
* Update an existing template
|
|
155
|
+
*
|
|
156
|
+
* Permission | Scope | Effect
|
|
157
|
+
* - | - | -
|
|
158
|
+
* `UPDATE_TEMPLATES` | `global` | **Required** for this endpoint
|
|
159
|
+
* @param templateId Id of the targeted template
|
|
160
|
+
* @param requestBody TemplateIn
|
|
161
|
+
* @returns TemplateOut
|
|
162
|
+
* @throws {ResourceUnknownError}
|
|
163
|
+
*/
|
|
164
|
+
update(templateId: string, requestBody: TemplateCreation, options?: OptionsBase): Promise<Template>;
|
|
165
|
+
/**
|
|
166
|
+
* Delete a template
|
|
167
|
+
*
|
|
168
|
+
* Permission | Scope | Effect
|
|
169
|
+
* - | - | -
|
|
170
|
+
* `DELETE_TEMPLATES` | `global` | **Required** for this endpoint
|
|
171
|
+
* @param templateId Id of the targeted template
|
|
172
|
+
* @returns AffectedRecords
|
|
173
|
+
* @throws {ResourceUnknownError}
|
|
174
|
+
*/
|
|
175
|
+
remove(templateId: string, options?: OptionsBase): Promise<AffectedRecords>;
|
|
176
|
+
/**
|
|
177
|
+
* Resolves a template and presents the result as a pdf file
|
|
178
|
+
*
|
|
179
|
+
* Permission | Scope | Effect
|
|
180
|
+
* - | - | -
|
|
181
|
+
* none | | Everyone can use this endpoint
|
|
182
|
+
* @param templateId Id of the targeted template
|
|
183
|
+
* @param requestBody The file data
|
|
184
|
+
* @returns Buffer
|
|
185
|
+
* @throws {LocalizationKeyMissingError}
|
|
186
|
+
* @throws {TemplateFillingError}
|
|
187
|
+
* @throws {ResourceUnknownError}
|
|
188
|
+
*/
|
|
189
|
+
resolveAsPdf(templateId: string, requestBody: CreateFile, options?: OptionsBase): Promise<Buffer>;
|
|
190
|
+
/**
|
|
191
|
+
* @deprecated
|
|
192
|
+
* Resolves a template and presents the result as a pdf file
|
|
193
|
+
*
|
|
194
|
+
* Permission | Scope | Effect
|
|
195
|
+
* - | - | -
|
|
196
|
+
* none | | Everyone can use this endpoint
|
|
197
|
+
* @param templateId Id of the targeted template
|
|
198
|
+
* @param localizationCode Specifies the language the template must be resolved in
|
|
199
|
+
* @param requestBody The file data
|
|
200
|
+
* @returns Buffer
|
|
201
|
+
* @throws {LocalizationKeyMissingError}
|
|
202
|
+
* @throws {TemplateFillingError}
|
|
203
|
+
* @throws {ResourceUnknownError}
|
|
204
|
+
*/
|
|
205
|
+
resolveAsPdfUsingCode(templateId: string, localizationCode: string, requestBody: CreateFile, options?: OptionsBase): Promise<Buffer>;
|
|
206
|
+
/**
|
|
207
|
+
* Resolves a template and presents the result as a json response
|
|
208
|
+
*
|
|
209
|
+
* Permission | Scope | Effect
|
|
210
|
+
* - | - | -
|
|
211
|
+
* none | | Everyone can use this endpoint
|
|
212
|
+
* @param templateId Id of the targeted template
|
|
213
|
+
* @param requestBody CreateFile
|
|
214
|
+
* @returns Record<string, string>
|
|
215
|
+
* @throws {LocalizationKeyMissingError}
|
|
216
|
+
* @throws {TemplateFillingError}
|
|
217
|
+
* @throws {ResourceUnknownError}
|
|
218
|
+
*/
|
|
219
|
+
resolveAsJson(templateId: string, requestBody: CreateFile, options?: OptionsBase): Promise<Record<string, string>>;
|
|
220
|
+
/**
|
|
221
|
+
* @deprecated
|
|
222
|
+
* Resolves a template and presents the result as a json response
|
|
223
|
+
*
|
|
224
|
+
* Permission | Scope | Effect
|
|
225
|
+
* - | - | -
|
|
226
|
+
* none | | Everyone can use this endpoint
|
|
227
|
+
* @param templateId Id of the targeted template
|
|
228
|
+
* @param localizationCode Specifies the language the template must be resolved in
|
|
229
|
+
* @param requestBody CreateFile
|
|
230
|
+
* @returns Record<string, string>
|
|
231
|
+
* @throws {LocalizationKeyMissingError}
|
|
232
|
+
* @throws {TemplateFillingError}
|
|
233
|
+
* @throws {ResourceUnknownError}
|
|
234
|
+
*/
|
|
235
|
+
resolveAsJsonUsingCode(templateId: string, localizationCode: string, requestBody: CreateFile, options?: OptionsBase): Promise<Record<string, string>>;
|
|
236
|
+
}
|
|
237
|
+
export {};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { ObjectId, LanguageCode, TimeZone, PagedResult, AffectedRecords, OptionsWithRql, OptionsBase } from '../types';
|
|
2
|
+
export interface TemplateV2 extends TemplateV2Creation {
|
|
3
|
+
id: ObjectId;
|
|
4
|
+
creationTimestamp: Date;
|
|
5
|
+
updateTimestamp: Date;
|
|
6
|
+
}
|
|
7
|
+
export interface TemplateV2Creation {
|
|
8
|
+
name: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
inputs?: Record<string, TemplateV2TypeConfiguration>;
|
|
11
|
+
outputs: Record<string, string>;
|
|
12
|
+
}
|
|
13
|
+
export interface TemplateV2Update {
|
|
14
|
+
name?: string;
|
|
15
|
+
description?: string | null;
|
|
16
|
+
inputs?: Record<string, TemplateV2TypeConfiguration> | null;
|
|
17
|
+
outputs?: Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
export declare type TemplateV2TypeConfiguration = TemplateV2ObjectConfiguration | TemplateV2ArrayConfiguration | TemplateV2StringConfiguration | TemplateV2NumberConfiguration | TemplateV2BooleanConfiguration;
|
|
20
|
+
export interface TemplateV2ObjectConfiguration {
|
|
21
|
+
type: 'object';
|
|
22
|
+
properties: Record<string, TemplateV2TypeConfiguration>;
|
|
23
|
+
}
|
|
24
|
+
export interface TemplateV2ArrayConfiguration {
|
|
25
|
+
type: 'array';
|
|
26
|
+
items: TemplateV2TypeConfiguration;
|
|
27
|
+
}
|
|
28
|
+
export interface TemplateV2StringConfiguration {
|
|
29
|
+
type: 'string';
|
|
30
|
+
}
|
|
31
|
+
export interface TemplateV2NumberConfiguration {
|
|
32
|
+
type: 'number';
|
|
33
|
+
}
|
|
34
|
+
export interface TemplateV2BooleanConfiguration {
|
|
35
|
+
type: 'boolean';
|
|
36
|
+
}
|
|
37
|
+
export interface TemplateV2ResolveIn<T extends Record<string, any>> {
|
|
38
|
+
/**
|
|
39
|
+
* If not present (or empty) we will first check the configured language in the users-service. If that is not present it will default to 'EN'
|
|
40
|
+
*/
|
|
41
|
+
language?: LanguageCode;
|
|
42
|
+
/**
|
|
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'
|
|
44
|
+
*/
|
|
45
|
+
timeZone?: TimeZone;
|
|
46
|
+
inputs?: T;
|
|
47
|
+
}
|
|
48
|
+
export interface TemplatesV2ErrorInfo {
|
|
49
|
+
/**
|
|
50
|
+
* The template outputs key in the request body that resulted in an error
|
|
51
|
+
*/
|
|
52
|
+
output: string;
|
|
53
|
+
/**
|
|
54
|
+
* Error message describing the syntax error
|
|
55
|
+
*/
|
|
56
|
+
message: string;
|
|
57
|
+
}
|
|
58
|
+
export interface TemplatesV2Service {
|
|
59
|
+
/**
|
|
60
|
+
* Get all templates the service has to offer
|
|
61
|
+
*
|
|
62
|
+
* Permission | Scope | Effect
|
|
63
|
+
* - | - | -
|
|
64
|
+
* `VIEW_TEMPLATES` | `global` | **Required** for this endpoint
|
|
65
|
+
* @param rql Add filters to the requested list.
|
|
66
|
+
* @returns PagedResult<TemplateV2>
|
|
67
|
+
*/
|
|
68
|
+
find(options?: OptionsWithRql): Promise<PagedResult<TemplateV2>>;
|
|
69
|
+
/**
|
|
70
|
+
* Request a list of all templates
|
|
71
|
+
*
|
|
72
|
+
* Do not pass in a rql with limit operator!
|
|
73
|
+
*
|
|
74
|
+
* Permission | Scope | Effect
|
|
75
|
+
* - | - | -
|
|
76
|
+
* `VIEW_TEMPLATES` | `global` | **Required** for this endpoint
|
|
77
|
+
* @param rql Add filters to the requested list.
|
|
78
|
+
* @returns TemplateV2[]
|
|
79
|
+
*/
|
|
80
|
+
findAll(options?: OptionsWithRql): Promise<TemplateV2[]>;
|
|
81
|
+
/**
|
|
82
|
+
* Find By Id
|
|
83
|
+
* @param id the Id to search for
|
|
84
|
+
* @returns the first element found
|
|
85
|
+
*/
|
|
86
|
+
findById(id: ObjectId, options?: OptionsWithRql): Promise<TemplateV2 | undefined>;
|
|
87
|
+
/**
|
|
88
|
+
* Find By Name
|
|
89
|
+
* @param name the name to search for
|
|
90
|
+
* @returns the first element found
|
|
91
|
+
*/
|
|
92
|
+
findByName(name: string, options?: OptionsWithRql): Promise<TemplateV2 | undefined>;
|
|
93
|
+
/**
|
|
94
|
+
* Find First
|
|
95
|
+
* @returns the first element found
|
|
96
|
+
*/
|
|
97
|
+
findFirst(options?: OptionsWithRql): Promise<TemplateV2 | undefined>;
|
|
98
|
+
/**
|
|
99
|
+
* Create a new template
|
|
100
|
+
*
|
|
101
|
+
* Permission | Scope | Effect
|
|
102
|
+
* - | - | -
|
|
103
|
+
* `CREATE_TEMPLATES` | `global` | **Required** for this endpoint
|
|
104
|
+
* @param requestBody TemplateV2Creation
|
|
105
|
+
* @returns TemplateV2
|
|
106
|
+
* @throws {ResourceAlreadyExistsError}
|
|
107
|
+
* @throws {TemplateSyntaxError}
|
|
108
|
+
*/
|
|
109
|
+
create(requestBody: TemplateV2Creation, options?: OptionsBase): Promise<TemplateV2>;
|
|
110
|
+
/**
|
|
111
|
+
* Update an existing template
|
|
112
|
+
*
|
|
113
|
+
* Permission | Scope | Effect
|
|
114
|
+
* - | - | -
|
|
115
|
+
* `UPDATE_TEMPLATES` | `global` | **Required** for this endpoint
|
|
116
|
+
* @param templateIdOrName Id or Name of the targeted template
|
|
117
|
+
* @param requestBody TemplateV2Update
|
|
118
|
+
* @returns TemplateV2
|
|
119
|
+
* @throws {ResourceAlreadyExistsError}
|
|
120
|
+
* @throws {TemplateSyntaxError}
|
|
121
|
+
* @throws {ResourceUnknownError}
|
|
122
|
+
*/
|
|
123
|
+
update(templateIdOrName: string, requestBody: TemplateV2Update, options?: OptionsBase): Promise<AffectedRecords>;
|
|
124
|
+
/**
|
|
125
|
+
* Delete a template
|
|
126
|
+
*
|
|
127
|
+
* Permission | Scope | Effect
|
|
128
|
+
* - | - | -
|
|
129
|
+
* `DELETE_TEMPLATES` | `global` | **Required** for this endpoint
|
|
130
|
+
* @param templateIdOrName Id or Name of the targeted template
|
|
131
|
+
* @returns AffectedRecords
|
|
132
|
+
* @throws {ResourceUnknownError}
|
|
133
|
+
*/
|
|
134
|
+
remove(templateIdOrName: string, options?: OptionsBase): Promise<AffectedRecords>;
|
|
135
|
+
/**
|
|
136
|
+
* Resolves a template and presents the result as a json response
|
|
137
|
+
* Permission is **required** for this endpoint
|
|
138
|
+
* Permission | Scope | Effect
|
|
139
|
+
* - | - | -
|
|
140
|
+
* `RESOLVE_TEMPLATES` | `global` | Resolve any template
|
|
141
|
+
* `RESOLVE_TEMPLATES:{TEMPLATE_NAME}` | `global` | Resolve the specified template
|
|
142
|
+
*
|
|
143
|
+
* @param templateIdOrName Id or Name of the targeted template
|
|
144
|
+
* @param requestBody CreateFile
|
|
145
|
+
* @returns TemplateV2ResolveOut
|
|
146
|
+
* @throws {TemplateResolvingError}
|
|
147
|
+
* @throws {TemplateFillingError}
|
|
148
|
+
* @throws {ResourceUnknownError}
|
|
149
|
+
*/
|
|
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>;
|
|
156
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { RQLString } from '../rql';
|
|
2
|
+
export declare type LanguageCode = string;
|
|
3
|
+
export declare type ObjectId = string;
|
|
4
|
+
export interface Entity {
|
|
5
|
+
id: ObjectId;
|
|
6
|
+
}
|
|
7
|
+
export interface Timestamps {
|
|
8
|
+
updateTimestamp: Date;
|
|
9
|
+
creationTimestamp: Date;
|
|
10
|
+
}
|
|
11
|
+
export interface ErrorResponse {
|
|
12
|
+
code?: number;
|
|
13
|
+
name?: string;
|
|
14
|
+
message?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PagedResult<T> {
|
|
17
|
+
page: {
|
|
18
|
+
total: number;
|
|
19
|
+
offset: number;
|
|
20
|
+
limit: number;
|
|
21
|
+
};
|
|
22
|
+
data: T[];
|
|
23
|
+
}
|
|
24
|
+
export interface AffectedRecords {
|
|
25
|
+
affectedRecords: number;
|
|
26
|
+
}
|
|
27
|
+
export interface ResultResponse {
|
|
28
|
+
status: number;
|
|
29
|
+
}
|
|
30
|
+
export declare enum Results {
|
|
31
|
+
Success = 200
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* IANA time zone identifier (e.g. "Europe/Brussels").
|
|
35
|
+
* We aim to stay aligned with the official IANA time zone database.
|
|
36
|
+
* In practice, supported values closely match those returned by Intl.supportedValuesOf('timeZone') in JavaScript.
|
|
37
|
+
* For an overview of IANA time zones, see: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
|
38
|
+
*/
|
|
39
|
+
export declare type TimeZone = string;
|
|
40
|
+
export declare type MailAddress = string;
|
|
41
|
+
export declare type MailAddressList = MailAddress[];
|
|
42
|
+
export interface MailRecipients {
|
|
43
|
+
to: MailAddressList;
|
|
44
|
+
cc?: MailAddressList;
|
|
45
|
+
bcc?: MailAddressList;
|
|
46
|
+
}
|
|
47
|
+
export declare type Headers = Record<string, string>;
|
|
48
|
+
export declare type OptionsBase = {
|
|
49
|
+
/** Added to all HTTP verbs */
|
|
50
|
+
headers?: Headers;
|
|
51
|
+
/** Only passed to the GET requests. Will retry 4 times on 500 errors */
|
|
52
|
+
shouldRetry?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated this property is only meant to be used for backwards compatibility when upgrading to v8.0.0.
|
|
55
|
+
*
|
|
56
|
+
* Key names that are not chosen by Extra Horizon where also affected by the data normalization before v8.0.0.
|
|
57
|
+
* They were converted from camel case to snake case before sending the request and the other way around before
|
|
58
|
+
* providing the response.
|
|
59
|
+
*
|
|
60
|
+
* Also fields ending with the name timestamp not chosen by extra horizon in custom properties where automatically
|
|
61
|
+
* converted to dates. Even though they could be just booleans, strings or numbers. Dates provided in such fields will
|
|
62
|
+
* now be converted to strings while all other types will stay as they are.
|
|
63
|
+
*
|
|
64
|
+
* To enable this behaviour again, set to true.
|
|
65
|
+
*/
|
|
66
|
+
normalizeCustomData?: boolean;
|
|
67
|
+
};
|
|
68
|
+
export declare type OptionsWithRql = OptionsBase & {
|
|
69
|
+
rql?: RQLString;
|
|
70
|
+
};
|
|
71
|
+
export interface FileUploadOptions extends OptionsBase {
|
|
72
|
+
onUploadProgress?: (progress: {
|
|
73
|
+
loaded: number;
|
|
74
|
+
total: number;
|
|
75
|
+
}) => void;
|
|
76
|
+
/**
|
|
77
|
+
* AbortSignal to cancel the file upload.
|
|
78
|
+
*
|
|
79
|
+
* Example usage:
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const controller = new AbortController();
|
|
82
|
+
* const signal = controller.signal;
|
|
83
|
+
*
|
|
84
|
+
* try {
|
|
85
|
+
* await exh.files.create(file, { signal });
|
|
86
|
+
* } catch (error) {
|
|
87
|
+
* if (error instanceof RequestAbortedError) {
|
|
88
|
+
* console.log('File upload was cancelled, ignoring error');
|
|
89
|
+
* return;
|
|
90
|
+
* }
|
|
91
|
+
* throw error; // Handle other errors
|
|
92
|
+
* }
|
|
93
|
+
*
|
|
94
|
+
* // To cancel the upload, call:
|
|
95
|
+
* controller.abort();
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
signal?: AbortSignal;
|
|
99
|
+
}
|
|
100
|
+
export declare type PagedResultWithPager<T> = PagedResult<T> & {
|
|
101
|
+
previous: () => Promise<PagedResultWithPager<T>>;
|
|
102
|
+
next: () => Promise<PagedResultWithPager<T>>;
|
|
103
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { HttpInstance } from '../../../types';
|
|
2
|
+
import { HttpClient } from '../../http-client';
|
|
3
|
+
import { ActivationRequestsService } from './types';
|
|
4
|
+
export declare const activationRequestsService: (client: HttpClient, httpWithAuth: HttpInstance) => ActivationRequestsService;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { AffectedRecords, OptionsBase, OptionsWithRql, PagedResult } from '../../types';
|
|
2
|
+
export interface ActivationRequestsService {
|
|
3
|
+
/**
|
|
4
|
+
* Retrieve a list of activation requests
|
|
5
|
+
*
|
|
6
|
+
* Permission | Scope | Effect
|
|
7
|
+
* - | - | -
|
|
8
|
+
* `VIEW_ACTIVATION_REQUESTS` | global | **Required** for this endpoint
|
|
9
|
+
*/
|
|
10
|
+
find(options?: OptionsWithRql): Promise<PagedResult<ActivationRequest>>;
|
|
11
|
+
/**
|
|
12
|
+
* Find an activation request
|
|
13
|
+
*
|
|
14
|
+
* Permission | Scope | Effect
|
|
15
|
+
* - | - | -
|
|
16
|
+
* `VIEW_ACTIVATION_REQUESTS` | global | **Required** for this endpoint
|
|
17
|
+
*/
|
|
18
|
+
findFirst(options?: OptionsWithRql): Promise<ActivationRequest | undefined>;
|
|
19
|
+
/**
|
|
20
|
+
* Find an activation request by its id
|
|
21
|
+
*
|
|
22
|
+
* Permission | Scope | Effect
|
|
23
|
+
* - | - | -
|
|
24
|
+
* `VIEW_ACTIVATION_REQUESTS` | global | **Required** for this endpoint
|
|
25
|
+
*/
|
|
26
|
+
findById(id: string, options?: OptionsWithRql): Promise<ActivationRequest | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* Find an activation request for a user id
|
|
29
|
+
*
|
|
30
|
+
* Permission | Scope | Effect
|
|
31
|
+
* - | - | -
|
|
32
|
+
* `VIEW_ACTIVATION_REQUESTS` | global | **Required** for this endpoint
|
|
33
|
+
*/
|
|
34
|
+
findByUserId(userId: string, options?: OptionsWithRql): Promise<ActivationRequest | undefined>;
|
|
35
|
+
/**
|
|
36
|
+
* Remove an activation request
|
|
37
|
+
*
|
|
38
|
+
* Permission | Scope | Effect
|
|
39
|
+
* - | - | -
|
|
40
|
+
* `DELETE_ACTIVATION_REQUEST` | global | **Required** for this endpoint
|
|
41
|
+
*/
|
|
42
|
+
remove(id: string, options?: OptionsBase): Promise<AffectedRecords>;
|
|
43
|
+
}
|
|
44
|
+
export interface ActivationRequest {
|
|
45
|
+
id: string;
|
|
46
|
+
userId: string;
|
|
47
|
+
mode?: 'hash' | 'pin_code';
|
|
48
|
+
/**
|
|
49
|
+
* The amount of times the account activation flow was initiated without completion.
|
|
50
|
+
*/
|
|
51
|
+
requestCount?: number;
|
|
52
|
+
/**
|
|
53
|
+
* The last time the account activation flow was initiated.
|
|
54
|
+
*/
|
|
55
|
+
lastRequestTimestamp?: number;
|
|
56
|
+
/**
|
|
57
|
+
* (Pin code mode only) the amount of attempts with an incorrect pin code for the current activation request.
|
|
58
|
+
*/
|
|
59
|
+
failedAttempts?: number;
|
|
60
|
+
/**
|
|
61
|
+
* (Pin code mode only) the last time an incorrect pin code for the current activation request.
|
|
62
|
+
*/
|
|
63
|
+
lastFailedAttemptTimestamp?: Date;
|
|
64
|
+
/**
|
|
65
|
+
* The time until which the activation request can be used.
|
|
66
|
+
*/
|
|
67
|
+
expiryTimestamp?: Date;
|
|
68
|
+
creationTimestamp: Date;
|
|
69
|
+
updateTimestamp: Date;
|
|
70
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { HttpInstance } from '../../../types';
|
|
2
|
+
import { HttpClient } from '../../http-client';
|
|
3
|
+
import { ForgotPasswordRequestsService } from './types';
|
|
4
|
+
export declare const forgotPasswordRequestsService: (client: HttpClient, httpWithAuth: HttpInstance) => ForgotPasswordRequestsService;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { AffectedRecords, OptionsBase, OptionsWithRql, PagedResult } from '../../types';
|
|
2
|
+
export interface ForgotPasswordRequestsService {
|
|
3
|
+
/**
|
|
4
|
+
* Retrieve a list of forgot password requests
|
|
5
|
+
*
|
|
6
|
+
* Permission | Scope | Effect
|
|
7
|
+
* - | - | -
|
|
8
|
+
* `VIEW_FORGOT_PASSWORD_REQUESTS` | global | **Required** for this endpoint
|
|
9
|
+
*/
|
|
10
|
+
find(options?: OptionsWithRql): Promise<PagedResult<ForgotPasswordRequest>>;
|
|
11
|
+
/**
|
|
12
|
+
* Find a forgot password request
|
|
13
|
+
*
|
|
14
|
+
* Permission | Scope | Effect
|
|
15
|
+
* - | - | -
|
|
16
|
+
* `VIEW_FORGOT_PASSWORD_REQUESTS` | global | **Required** for this endpoint
|
|
17
|
+
*/
|
|
18
|
+
findFirst(options?: OptionsWithRql): Promise<ForgotPasswordRequest | undefined>;
|
|
19
|
+
/**
|
|
20
|
+
* Find a forgot password request by its id
|
|
21
|
+
*
|
|
22
|
+
* Permission | Scope | Effect
|
|
23
|
+
* - | - | -
|
|
24
|
+
* `VIEW_FORGOT_PASSWORD_REQUESTS` | global | **Required** for this endpoint
|
|
25
|
+
*/
|
|
26
|
+
findById(id: string, options?: OptionsWithRql): Promise<ForgotPasswordRequest | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* Find a forgot password request for a user id
|
|
29
|
+
*
|
|
30
|
+
* Permission | Scope | Effect
|
|
31
|
+
* - | - | -
|
|
32
|
+
* `VIEW_FORGOT_PASSWORD_REQUESTS` | global | **Required** for this endpoint
|
|
33
|
+
*/
|
|
34
|
+
findByUserId(userId: string, options?: OptionsWithRql): Promise<ForgotPasswordRequest | undefined>;
|
|
35
|
+
/**
|
|
36
|
+
* Remove a forgot password request
|
|
37
|
+
*
|
|
38
|
+
* Permission | Scope | Effect
|
|
39
|
+
* - | - | -
|
|
40
|
+
* `DELETE_FORGOT_PASSWORD_REQUEST` | global | **Required** for this endpoint
|
|
41
|
+
*/
|
|
42
|
+
remove(id: string, options?: OptionsBase): Promise<AffectedRecords>;
|
|
43
|
+
}
|
|
44
|
+
export interface ForgotPasswordRequest {
|
|
45
|
+
id: string;
|
|
46
|
+
userId: string;
|
|
47
|
+
mode?: 'hash' | 'pin_code';
|
|
48
|
+
/**
|
|
49
|
+
* The amount of times the account forgot password flow was initiated without completion.
|
|
50
|
+
*/
|
|
51
|
+
requestCount?: number;
|
|
52
|
+
/**
|
|
53
|
+
* The last time the account forgot password flow was initiated.
|
|
54
|
+
*/
|
|
55
|
+
lastRequestTimestamp?: number;
|
|
56
|
+
/**
|
|
57
|
+
* (Pin code mode only) the amount of attempts with an incorrect pin code for the current forgot password request.
|
|
58
|
+
*/
|
|
59
|
+
failedAttempts?: number;
|
|
60
|
+
/**
|
|
61
|
+
* (Pin code mode only) the last time an incorrect pin code for the current forgot password request.
|
|
62
|
+
*/
|
|
63
|
+
lastFailedAttemptTimestamp?: Date;
|
|
64
|
+
/**
|
|
65
|
+
* The time until which the forgot password request can be used.
|
|
66
|
+
*/
|
|
67
|
+
expiryTimestamp?: Date;
|
|
68
|
+
creationTimestamp: Date;
|
|
69
|
+
updateTimestamp: Date;
|
|
70
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HttpInstance } from '../../types';
|
|
2
|
+
import { HttpClient } from '../http-client';
|
|
3
|
+
import type { UsersGlobalRolesService } from './types';
|
|
4
|
+
declare const _default: (client: HttpClient, httpWithAuth: HttpInstance) => UsersGlobalRolesService;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HttpInstance } from '../../types';
|
|
2
|
+
import { HttpClient } from '../http-client';
|
|
3
|
+
import type { UsersGroupRolesService } from './types';
|
|
4
|
+
declare const _default: (client: HttpClient, httpWithAuth: HttpInstance) => UsersGroupRolesService;
|
|
5
|
+
export default _default;
|