@vario-software/types 2026.12.3

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/app/Api.d.ts ADDED
@@ -0,0 +1,286 @@
1
+ // -- Utility types --
2
+
3
+ type ConvertPath<S extends string> =
4
+ S extends `${infer A}{${infer B}}${infer C}`
5
+ ? `${A}:${B}${ConvertPath<C>}`
6
+ : S;
7
+
8
+ type ReversePath<S extends string> =
9
+ S extends `${infer A}:${infer B}/${infer C}`
10
+ ? `${A}{${B}}/${ReversePath<C>}`
11
+ : S extends `${infer A}:${infer B}`
12
+ ? `${A}{${B}}`
13
+ : S;
14
+
15
+ type GetOperation<PathDef, M extends string> =
16
+ M extends keyof PathDef
17
+ ? Exclude<PathDef[M], undefined> extends infer Op
18
+ ? Op extends { responses: any } ? Op : never
19
+ : never
20
+ : never;
21
+
22
+ type SuccessResponse<Op> =
23
+ Op extends { responses: { 200: { content: { 'application/json': infer R } } } } ? R :
24
+ Op extends { responses: { 201: { content: { 'application/json': infer R } } } } ? R :
25
+ Op extends { responses: { 200: { content: { '*/*': infer R } } } } ? R :
26
+ Op extends { responses: { 201: { content: { '*/*': infer R } } } } ? R :
27
+ Op extends { responses: { 200: { content: { 'application/*': infer R } } } } ? R :
28
+ Op extends { responses: { 201: { content: { 'application/*': infer R } } } } ? R :
29
+ never;
30
+
31
+ type PathParams<Op> =
32
+ Op extends { parameters: { path: infer P } } ? P : Record<string, never>;
33
+
34
+ type QueryParams<Op> =
35
+ Op extends { parameters: { query?: infer Q } }
36
+ ? [Q] extends [never] ? Record<string, never> : NonNullable<Q>
37
+ : Record<string, never>;
38
+
39
+ type RequestBody<Op> =
40
+ Op extends { requestBody: { content: { 'application/json': infer B } } } ? B :
41
+ Op extends { requestBody?: { content: { 'application/json': infer B } } } ? B :
42
+ any;
43
+
44
+ type MethodEndpoints<Paths, M extends string> = {
45
+ [P in keyof Paths as
46
+ GetOperation<Paths[P], M> extends never ? never :
47
+ [SuccessResponse<GetOperation<Paths[P], M>>] extends [never] ? never :
48
+ ConvertPath<P & string>
49
+ ]: GetOperation<Paths[P], M>;
50
+ };
51
+
52
+ // -- Per-method endpoint maps (used only for path autocomplete constraints) --
53
+
54
+ type GetEndpoints<Paths> = MethodEndpoints<Paths, 'get'>;
55
+ type PostEndpoints<Paths> = MethodEndpoints<Paths, 'post'>;
56
+ type PutEndpoints<Paths> = MethodEndpoints<Paths, 'put'>;
57
+ type DeleteEndpoints<Paths> = MethodEndpoints<Paths, 'delete'>;
58
+
59
+ // -- Direct O(1) lookup types (via ReversePath, no mapped type iteration) --
60
+
61
+ type DirectLookup<Paths, P extends string> =
62
+ ReversePath<P> extends keyof Paths ? Paths[ReversePath<P>] : never;
63
+
64
+ type DirectOperation<Paths, P extends string, M extends string> =
65
+ GetOperation<DirectLookup<Paths, P>, M>;
66
+
67
+ type DirectPathParams<Paths, P extends string> =
68
+ DirectLookup<Paths, P> extends infer Def
69
+ ? [Def] extends [never] ? Record<string, any>
70
+ : PathParams<GetOperation<Def, 'get'>> extends Record<string, never>
71
+ ? PathParams<GetOperation<Def, 'post'>> extends Record<string, never>
72
+ ? PathParams<GetOperation<Def, 'put'>> extends Record<string, never>
73
+ ? PathParams<GetOperation<Def, 'delete'>>
74
+ : PathParams<GetOperation<Def, 'put'>>
75
+ : PathParams<GetOperation<Def, 'post'>>
76
+ : PathParams<GetOperation<Def, 'get'>>
77
+ : Record<string, any>;
78
+
79
+ type ExtractBody<Op> =
80
+ Op extends { requestBody: { content: { 'application/json': infer B } } } ? B :
81
+ Op extends { requestBody?: { content: { 'application/json': infer B } } } ? B :
82
+ never;
83
+
84
+ type DirectRequestBody<Paths, P extends string> =
85
+ DirectLookup<Paths, P> extends infer Def
86
+ ? [Def] extends [never] ? any
87
+ : ExtractBody<GetOperation<Def, 'post'>> | ExtractBody<GetOperation<Def, 'put'>> extends infer B
88
+ ? [B] extends [never] ? any : B | string
89
+ : any
90
+ : any;
91
+
92
+ type DirectMethods<Paths, P extends string> =
93
+ DirectLookup<Paths, P> extends infer Def
94
+ ? [Def] extends [never] ? string
95
+ : ([GetOperation<Def, 'get'>] extends [never] ? never : 'GET')
96
+ | ([GetOperation<Def, 'post'>] extends [never] ? never : 'POST')
97
+ | ([GetOperation<Def, 'put'>] extends [never] ? never : 'PUT')
98
+ | ([GetOperation<Def, 'delete'>] extends [never] ? never : 'DELETE')
99
+ : string;
100
+
101
+ type DirectQueryParams<Paths, P extends string> =
102
+ DirectLookup<Paths, P> extends infer Def
103
+ ? [Def] extends [never] ? Record<string, any>
104
+ : QueryParams<GetOperation<Def, 'get'>> extends Record<string, never>
105
+ ? QueryParams<GetOperation<Def, 'post'>> extends Record<string, never>
106
+ ? QueryParams<GetOperation<Def, 'put'>> extends Record<string, never>
107
+ ? QueryParams<GetOperation<Def, 'delete'>>
108
+ : QueryParams<GetOperation<Def, 'put'>>
109
+ : QueryParams<GetOperation<Def, 'post'>>
110
+ : QueryParams<GetOperation<Def, 'get'>>
111
+ : Record<string, any>;
112
+
113
+ // -- Shared option shapes for generic overloads --
114
+
115
+ type GenericGetOptions<Paths, P extends string> = ErpBaseOptions & {
116
+ method: 'GET';
117
+ pathParams?: DirectPathParams<Paths, P>;
118
+ params?: QueryParams<DirectOperation<Paths, P, 'get'>>;
119
+ };
120
+
121
+ type GenericPostOptions<Paths, P extends string> = ErpBaseOptions & {
122
+ method: 'POST';
123
+ pathParams?: DirectPathParams<Paths, P>;
124
+ params?: QueryParams<DirectOperation<Paths, P, 'post'>>;
125
+ body?: DirectRequestBody<Paths, P>;
126
+ };
127
+
128
+ type GenericPutOptions<Paths, P extends string> = ErpBaseOptions & {
129
+ method: 'PUT';
130
+ pathParams?: DirectPathParams<Paths, P>;
131
+ params?: QueryParams<DirectOperation<Paths, P, 'put'>>;
132
+ body?: DirectRequestBody<Paths, P>;
133
+ };
134
+
135
+ type GenericDeleteOptions<Paths, P extends string> = ErpBaseOptions & {
136
+ method: 'DELETE';
137
+ pathParams?: DirectPathParams<Paths, P>;
138
+ params?: QueryParams<DirectOperation<Paths, P, 'delete'>>;
139
+ };
140
+
141
+ type GenericFallbackOptions<Paths, P extends string> = ErpBaseOptions & {
142
+ method?: DirectMethods<Paths, P>;
143
+ pathParams?: DirectPathParams<Paths, P>;
144
+ params?: DirectQueryParams<Paths, P>;
145
+ body?: DirectRequestBody<Paths, P>;
146
+ };
147
+
148
+ // -- Public types --
149
+
150
+ export interface ErpFetchResponse<T>
151
+ {
152
+ data: T;
153
+ response: any;
154
+ }
155
+
156
+ export interface ErpBaseOptions
157
+ {
158
+ saveResponse?: boolean;
159
+ resolveOn?: 'end' | 'response';
160
+ timeout?: number;
161
+ suppressLogs?: boolean;
162
+ secretsToMask?: string[];
163
+ followRedirects?: boolean;
164
+ headers?: Record<string, string>;
165
+ executeAsAppUser?: boolean;
166
+ }
167
+
168
+ export interface TypedErpApiFetch<Paths = Record<string, any>>
169
+ {
170
+ // Path-constrained overloads (for path autocomplete + full response typing)
171
+ <P extends keyof GetEndpoints<Paths>>(
172
+ path: P,
173
+ options: ErpBaseOptions & {
174
+ method: 'GET';
175
+ pathParams?: PathParams<DirectOperation<Paths, P & string, 'get'>>;
176
+ params?: QueryParams<DirectOperation<Paths, P & string, 'get'>>;
177
+ },
178
+ ): Promise<ErpFetchResponse<SuccessResponse<DirectOperation<Paths, P & string, 'get'>>>>;
179
+
180
+ <P extends keyof PostEndpoints<Paths>>(
181
+ path: P,
182
+ options: ErpBaseOptions & {
183
+ method: 'POST';
184
+ pathParams?: PathParams<DirectOperation<Paths, P & string, 'post'>>;
185
+ params?: QueryParams<DirectOperation<Paths, P & string, 'post'>>;
186
+ body?: RequestBody<DirectOperation<Paths, P & string, 'post'>> | string;
187
+ },
188
+ ): Promise<ErpFetchResponse<SuccessResponse<DirectOperation<Paths, P & string, 'post'>>>>;
189
+
190
+ <P extends keyof PutEndpoints<Paths>>(
191
+ path: P,
192
+ options: ErpBaseOptions & {
193
+ method: 'PUT';
194
+ pathParams?: PathParams<DirectOperation<Paths, P & string, 'put'>>;
195
+ params?: QueryParams<DirectOperation<Paths, P & string, 'put'>>;
196
+ body?: RequestBody<DirectOperation<Paths, P & string, 'put'>> | string;
197
+ },
198
+ ): Promise<ErpFetchResponse<SuccessResponse<DirectOperation<Paths, P & string, 'put'>>>>;
199
+
200
+ <P extends keyof DeleteEndpoints<Paths>>(
201
+ path: P,
202
+ options: ErpBaseOptions & {
203
+ method: 'DELETE';
204
+ pathParams?: PathParams<DirectOperation<Paths, P & string, 'delete'>>;
205
+ params?: QueryParams<DirectOperation<Paths, P & string, 'delete'>>;
206
+ },
207
+ ): Promise<ErpFetchResponse<SuccessResponse<DirectOperation<Paths, P & string, 'delete'>>>>;
208
+
209
+ // Path-constrained GET default (no method required, defaults to GET)
210
+ <P extends keyof GetEndpoints<Paths>>(
211
+ path: P,
212
+ options?: ErpBaseOptions & {
213
+ pathParams?: PathParams<DirectOperation<Paths, P & string, 'get'>>;
214
+ params?: QueryParams<DirectOperation<Paths, P & string, 'get'>>;
215
+ },
216
+ ): Promise<ErpFetchResponse<SuccessResponse<DirectOperation<Paths, P & string, 'get'>>>>;
217
+
218
+ // Generic per-method overloads (typed params/body per method, no path constraint)
219
+ <P extends string>(path: P, options: GenericGetOptions<Paths, P>): Promise<ErpFetchResponse<any>>;
220
+ <P extends string>(path: P, options: GenericPostOptions<Paths, P>): Promise<ErpFetchResponse<any>>;
221
+ <P extends string>(path: P, options: GenericPutOptions<Paths, P>): Promise<ErpFetchResponse<any>>;
222
+ <P extends string>(path: P, options: GenericDeleteOptions<Paths, P>): Promise<ErpFetchResponse<any>>;
223
+
224
+ // Fallback (no method specified)
225
+ <P extends string>(path: P, options?: GenericFallbackOptions<Paths, P>): Promise<ErpFetchResponse<any>>;
226
+ }
227
+
228
+ export interface VqlOptions
229
+ {
230
+ statement: string;
231
+ variableSubstitutions?: any[];
232
+ limit?: number | null;
233
+ offset?: number | null;
234
+ }
235
+
236
+ export interface VqlResult
237
+ {
238
+ data: Array<Record<string, any>>;
239
+ moreElements?: string;
240
+ nextOffset?: string;
241
+ [key: string]: any;
242
+ }
243
+
244
+ export interface TypedPathCallable<Paths, R>
245
+ {
246
+ // Path-constrained overloads (for path autocomplete)
247
+ <P extends keyof GetEndpoints<Paths>>(path: P, options?: GenericFallbackOptions<Paths, P & string>): Promise<R>;
248
+ <P extends keyof PostEndpoints<Paths>>(path: P, options?: GenericFallbackOptions<Paths, P & string>): Promise<R>;
249
+ <P extends keyof PutEndpoints<Paths>>(path: P, options?: GenericFallbackOptions<Paths, P & string>): Promise<R>;
250
+ <P extends keyof DeleteEndpoints<Paths>>(path: P, options?: GenericFallbackOptions<Paths, P & string>): Promise<R>;
251
+
252
+ // Generic per-method overloads (typed params/body per method)
253
+ <P extends string>(path: P, options: GenericGetOptions<Paths, P>): Promise<R>;
254
+ <P extends string>(path: P, options: GenericPostOptions<Paths, P>): Promise<R>;
255
+ <P extends string>(path: P, options: GenericPutOptions<Paths, P>): Promise<R>;
256
+ <P extends string>(path: P, options: GenericDeleteOptions<Paths, P>): Promise<R>;
257
+
258
+ // Fallback (no method specified)
259
+ <P extends string>(path: P, options?: GenericFallbackOptions<Paths, P>): Promise<R>;
260
+ }
261
+
262
+ export interface TypedApiStatic<Paths = Record<string, any>>
263
+ {
264
+ fetch: TypedErpApiFetch<Paths>;
265
+ getResponseStream: TypedPathCallable<Paths, import('stream').PassThrough>;
266
+ gateway: TypedPathCallable<Paths, void>;
267
+ redirectRequest: TypedPathCallable<Paths, import('stream').PassThrough>;
268
+ vql(options: VqlOptions): Promise<VqlResult>;
269
+
270
+ new(path: string, options?: ErpBaseOptions & {
271
+ method?: string;
272
+ pathParams?: Record<string, any>;
273
+ body?: any;
274
+ params?: Record<string, any>;
275
+ }): ApiInstance;
276
+
277
+ [key: string]: any;
278
+ }
279
+
280
+ export interface ApiInstance
281
+ {
282
+ execute(): Promise<void>;
283
+ getData(): any;
284
+ getStatusCode(): number | undefined;
285
+ getResponseHeaders(): Record<string, string> | undefined;
286
+ }
@@ -0,0 +1,13 @@
1
+ import type { paths as erpPaths } from '../schema/erp';
2
+ import type { TypedApiStatic } from './Api';
3
+ import type { Eav, Migration, TextEnum, Webhook, PermittedToken } from './modules';
4
+
5
+ declare const Api: TypedApiStatic<erpPaths> & {
6
+ migration: Migration;
7
+ eav: Eav;
8
+ textenum: TextEnum;
9
+ webhook: Webhook;
10
+ permittedToken: PermittedToken;
11
+ };
12
+
13
+ export = Api;
@@ -0,0 +1,19 @@
1
+ export declare class HttpError extends Error
2
+ {
3
+ constructor(
4
+ message: string,
5
+ statusCode?: number,
6
+ logService?: string,
7
+ logInfo?: unknown,
8
+ logId?: unknown,
9
+ logLevel?: string,
10
+ errorData?: unknown,
11
+ );
12
+
13
+ statusCode?: number;
14
+ logLevel?: string;
15
+ logService?: string;
16
+ logId?: unknown;
17
+ logInfo?: unknown;
18
+ data?: unknown;
19
+ }
@@ -0,0 +1,60 @@
1
+ import type { Request } from 'express';
2
+ import type { components } from '../schema/erp';
3
+ import type { TypedApiStatic } from './Api';
4
+ import type { VarioCloudApp } from './VarioCloudApp';
5
+ import type { EavGroup } from './modules/Eav';
6
+ import type { TextEnumGroupCreate } from './modules/TextEnum';
7
+
8
+ export type SalesChannelBackend = components["schemas"]["erp-sales_channel-SalesChannelBackend"];
9
+ export type SalesChannel = components["schemas"]["erp-sales_channel-SalesChannel"];
10
+ type FinanceBookingBackend = components["schemas"]["erp-finance-FinanceBookingBackend"];
11
+ type AppScriptingProxy = components["schemas"]["common-api-AppScriptingProxy"];
12
+ type ImportMappingRuleSet = components["schemas"]["common-data_import-ImportMappingRuleSet"];
13
+
14
+ export interface MigratorMethods
15
+ {
16
+ log(message: string, level?: string): Promise<void>;
17
+ getEavGroup(groupKey: string): Promise<EavGroup>;
18
+ createEavGroup(eavGroup: EavGroup): Promise<EavGroup>;
19
+ changeEavGroup(groupKey: string, callback: (group: EavGroup) => EavGroup): Promise<EavGroup>;
20
+ deleteEavGroup(groupKey: string): Promise<EavGroup>;
21
+ removeDataFromEavGroup(groupKey: string, attributeKeys?: string[]): Promise<EavGroup>;
22
+ createTextEnumGroup(textEnumGroup: TextEnumGroupCreate): Promise<TextEnumGroupCreate>;
23
+ registerWebhook(destinationQueue: string, url: string, destinationOwner?: string): Promise<void>;
24
+ deregisterWebhook(destinationQueue: string, url: string, destinationOwner?: string): Promise<void>;
25
+ createSalesChannelBackend(label: string, validChannelTypes?: string[]): Promise<SalesChannelBackend>;
26
+ changeSalesChannelBackend(body: SalesChannelBackend): Promise<SalesChannelBackend>;
27
+ createSalesChannel(salesChannelBackend: { id: string }, label: string, description: string, channelType?: string): Promise<SalesChannel>;
28
+ getSalesChannels(): Promise<SalesChannel[]>;
29
+ findSalesChannelBackend(): Promise<SalesChannelBackend | undefined>;
30
+ getSalesChannelBackend(salesChannelBackendId: string): Promise<SalesChannelBackend>;
31
+ activateSalesChannelBackend(salesChannelBackend: { id: string }): Promise<void>;
32
+ createMultipartImportPreset(importMultipartPresetTemplate: Record<string, unknown>): Promise<{ id: string; [key: string]: unknown }>;
33
+ createFinanceBackend(label: string): Promise<FinanceBookingBackend>;
34
+ changeFinanceBackend(label: string, description: string): Promise<FinanceBookingBackend>;
35
+ updateMultipartImportPreset(id: string, importMultipartPresetTemplate: Record<string, unknown>): Promise<{ id: string; [key: string]: unknown }>;
36
+ addAppScriptingTrigger(triggerId: string, script: string | object): Promise<void>;
37
+ updateAppScriptingTrigger(triggerId: string, script: string | object, id?: string): Promise<void>;
38
+ getAppScriptingTriggerId(triggerId: string): Promise<string | undefined>;
39
+ getMultipartImportPreset(id: string): Promise<{ id: string; [key: string]: unknown }>;
40
+ getImportMappingRuleSet(id: string): Promise<ImportMappingRuleSet>;
41
+ getOrCreateScriptModuleGroup(): Promise<{ id: string; name: string }>;
42
+ getOrCreateImportScriptPresetting(name: string, script: string | object, existingInlineScript?: string | object): Promise<{ id: string }>;
43
+ }
44
+
45
+ export type MigratorCallback = (methods: MigratorMethods, results: Record<string, unknown>) => Promise<unknown>;
46
+
47
+ export declare class Migrator
48
+ {
49
+ constructor(key: string);
50
+
51
+ key: string;
52
+ req: Request;
53
+ app: VarioCloudApp;
54
+ migrationResults: Record<string, unknown>;
55
+ ApiAdapter: TypedApiStatic;
56
+ methods: MigratorMethods;
57
+
58
+ setMigration(key: string, callback: MigratorCallback): Promise<void>;
59
+ always(key: string, callback: MigratorCallback): Promise<void>;
60
+ }
@@ -0,0 +1,4 @@
1
+ export declare class PromiseSingletonMap
2
+ {
3
+ run<T>(key: string, fn: () => Promise<T>): Promise<T>;
4
+ }
@@ -0,0 +1,91 @@
1
+ import type { Express, Router } from 'express';
2
+ import type { paths as erpPaths } from '../schema/erp';
3
+ import type { TypedApiStatic } from './Api';
4
+
5
+ // -- Token & Cache Modules --
6
+
7
+ export declare class OfflineToken
8
+ {
9
+ constructor(app: VarioCloudApp, filename?: string);
10
+
11
+ app: VarioCloudApp;
12
+ filename: string;
13
+ database: { data: Record<string, string>; update(fn: (data: Record<string, string>) => void): Promise<void> };
14
+
15
+ init(): Promise<void>;
16
+ get(tenant: string): Promise<string | undefined>;
17
+ set(tenant: string, offlineToken: string): Promise<void>;
18
+ delete(tenant: string): Promise<void>;
19
+ }
20
+
21
+ export declare class AccessToken
22
+ {
23
+ init(): Promise<void>;
24
+ get(tenant: string): Promise<string | null>;
25
+ set(tenant: string, accessToken: string, expiresAt: number): Promise<void>;
26
+ delete(tenant: string): Promise<void>;
27
+ }
28
+
29
+ export declare class BaseUrlCache
30
+ {
31
+ constructor(app: VarioCloudApp);
32
+
33
+ app: VarioCloudApp;
34
+
35
+ init(): Promise<void>;
36
+ get(): Promise<string>;
37
+ set(value: string): Promise<void>;
38
+ delete(): Promise<void>;
39
+ }
40
+
41
+ // -- App Configuration --
42
+
43
+ export interface ClientConfig
44
+ {
45
+ clientId: string;
46
+ clientSecret: string;
47
+ appIdentifier: string;
48
+ appJWK: object | string;
49
+ [key: string]: any;
50
+ }
51
+
52
+ export interface AppOptions
53
+ {
54
+ onUnhandledError?: (error: any) => void;
55
+ onMigrationError?: (error: any) => void;
56
+ onKeycloakError?: (error: any) => void;
57
+ log?: (message: string | object, loggerName?: string, level?: string) => void | Promise<void>;
58
+ offlineToken?: OfflineToken;
59
+ accessToken?: AccessToken;
60
+ baseUrlCache?: BaseUrlCache;
61
+ bodyParser?: import('body-parser').OptionsJson;
62
+ apiPrefix?: string;
63
+ [key: string]: any;
64
+ }
65
+
66
+ // -- VarioCloudApp --
67
+
68
+ export declare class VarioCloudApp
69
+ {
70
+ constructor(client: ClientConfig, options?: AppOptions);
71
+
72
+ onUnhandledError: (error: any) => void;
73
+ onMigrationError: (error: any) => void;
74
+ onKeycloakError?: (error: any) => void;
75
+
76
+ express: Express;
77
+ port: string | number;
78
+ uiPath: string | null;
79
+ uiPrefix: string;
80
+ version: string;
81
+ client: ClientConfig;
82
+ log: (message: string | object, loggerName?: string, level?: string) => void | Promise<void>;
83
+ offlineToken: OfflineToken;
84
+ accessToken: AccessToken;
85
+ baseUrlCache: BaseUrlCache;
86
+ erp: TypedApiStatic<erpPaths>;
87
+ apiServer: Router;
88
+ uiServer?: Router;
89
+
90
+ start(): Promise<VarioCloudApp>;
91
+ }
@@ -0,0 +1,44 @@
1
+ import type { Request, Response } from 'express';
2
+ import type { VarioCloudApp } from './VarioCloudApp';
3
+
4
+ export interface AccessTokenPayload
5
+ {
6
+ sub?: string;
7
+ iss?: string;
8
+ azp?: string;
9
+ aud?: string;
10
+ exp?: number;
11
+ iat?: number;
12
+ tenantSubdomain?: string;
13
+ isSuperUser?: boolean;
14
+ permissions?: string[];
15
+ tokenType?: string;
16
+ [key: string]: unknown;
17
+ }
18
+
19
+ export interface RequestContext
20
+ {
21
+ req: Request;
22
+ res: Response;
23
+ app: VarioCloudApp;
24
+ requestId: string;
25
+ startTime: number;
26
+ appToken?: string;
27
+ accessToken?: AccessTokenPayload;
28
+ runAsAppUser?: boolean;
29
+ migration?: string;
30
+ parameter?: Record<string, string>;
31
+ permittedToken?: { context: Record<string, unknown>; [key: string]: unknown };
32
+ licenses?: string[];
33
+ }
34
+
35
+ export declare function getApp(): VarioCloudApp;
36
+ export declare function getContext(): RequestContext;
37
+ export declare function getAppToken(): string | undefined;
38
+ export declare function getAccessToken(): AccessTokenPayload | undefined;
39
+ export declare function getTenant(): string | undefined;
40
+ export declare function getExternalUserId(): string | undefined;
41
+ export declare function getRequest(): Request;
42
+ export declare function getResponse(): Response;
43
+ export declare function getRequestId(): string | undefined;
44
+ export declare function runInContext(context: RequestContext, callback: () => void): void;
@@ -0,0 +1,16 @@
1
+ import type { TypedApiStatic } from '../Api';
2
+ import type { components } from '../../schema/erp';
3
+
4
+ export type EavGroup = components["schemas"]["common-eav-EavGroup"];
5
+
6
+ export declare class Eav
7
+ {
8
+ constructor(ApiAdapter: TypedApiStatic);
9
+
10
+ getGroup(groupKey: string): Promise<EavGroup>;
11
+ setGroup(eavGroup: EavGroup): Promise<EavGroup>;
12
+ changeGroup(groupKey: string, callback: (group: EavGroup) => EavGroup): Promise<EavGroup>;
13
+ deleteGroup(groupKey: string): Promise<boolean>;
14
+ removeDataFromGroup(groupKey: string, attributeKeys?: string[]): Promise<boolean>;
15
+ getGroupIdByKey(groupKey: string): Promise<string | null>;
16
+ }
@@ -0,0 +1,19 @@
1
+ import type { TypedApiStatic } from '../Api';
2
+ import type { components } from '../../schema/erp';
3
+
4
+ export type MigrationRecord = components["schemas"]["common-api-AppMigration"];
5
+
6
+ export declare class Migration
7
+ {
8
+ constructor(ApiAdapter: TypedApiStatic);
9
+
10
+ get(identifier: string): Promise<MigrationRecord | undefined>;
11
+ getAll(options: { offset?: number; limit?: number; identifier?: string }): Promise<{
12
+ data: MigrationRecord[];
13
+ moreElements?: string;
14
+ nextOffset?: string;
15
+ }>;
16
+ getNote(key: string): Promise<unknown>;
17
+ set(identifier: string, note?: string | null): Promise<MigrationRecord>;
18
+ delete(id: string): Promise<unknown>;
19
+ }
@@ -0,0 +1,8 @@
1
+ import type { TypedApiStatic } from '../Api';
2
+
3
+ export declare class PermittedToken
4
+ {
5
+ constructor(ApiAdapter: TypedApiStatic);
6
+
7
+ create(expiresAt: string, permissions: string[]): Promise<{ bearerToken: string; [key: string]: unknown }>;
8
+ }
@@ -0,0 +1,31 @@
1
+ import type { TypedApiStatic } from '../Api';
2
+ import type { components } from '../../schema/erp';
3
+
4
+ export type TextEnumGroup = components["schemas"]["common-api-TextEnumGroupGet"];
5
+ export type TextEnumGroupCreate = components["schemas"]["common-api-TextEnumGroupCreate"];
6
+ export type TextEnumEntry = components["schemas"]["common-api-TextEnumGet"];
7
+ export type TextEnumEntryCreate = components["schemas"]["common-api-TextEnumCreate"];
8
+
9
+ export declare class TextEnum
10
+ {
11
+ constructor(ApiAdapter: TypedApiStatic);
12
+
13
+ get(key: string): Promise<TextEnumGroup | undefined>;
14
+ getAll(options: { offset?: number; limit?: number; key?: string }): Promise<{
15
+ data: TextEnumGroup[];
16
+ moreElements?: string;
17
+ nextOffset?: string;
18
+ }>;
19
+ setGroup(textEnumGroupTemplate: TextEnumGroupCreate): Promise<TextEnumGroup>;
20
+ setEnums(textEnumGroupKey: string, textEnums: TextEnumEntryCreate[]): Promise<void>;
21
+ createGroup(textEnumGroup: TextEnumGroupCreate): Promise<TextEnumGroup>;
22
+ getAllEnums(options: { offset?: number; limit?: number; groupId?: string }): Promise<{
23
+ data: TextEnumEntry[];
24
+ moreElements?: string;
25
+ nextOffset?: string;
26
+ }>;
27
+ removeEnums(textEnumGroup: TextEnumGroup): Promise<boolean>;
28
+ removeEnum(textEnum: { id: string }): Promise<void>;
29
+ createEnums(customGroupKey: string, textEnums: TextEnumEntryCreate[]): Promise<boolean>;
30
+ createEnum(textEnum: TextEnumEntryCreate): Promise<void>;
31
+ }
@@ -0,0 +1,9 @@
1
+ import type { TypedApiStatic } from '../Api';
2
+
3
+ export declare class Webhook
4
+ {
5
+ constructor(ApiAdapter: TypedApiStatic);
6
+
7
+ register(destinationQueue: string, url: string, destinationOwner?: string): Promise<void>;
8
+ deregister(destinationQueue: string, url: string, destinationOwner?: string): Promise<void>;
9
+ }
@@ -0,0 +1,5 @@
1
+ export { Eav, EavGroup } from './modules/Eav';
2
+ export { Migration, MigrationRecord } from './modules/Migration';
3
+ export { TextEnum, TextEnumGroup, TextEnumGroupCreate, TextEnumEntry, TextEnumEntryCreate } from './modules/TextEnum';
4
+ export { Webhook } from './modules/Webhook';
5
+ export { PermittedToken } from './modules/PermittedToken';