-
Notifications
You must be signed in to change notification settings - Fork 3
/
reloads.d.ts
211 lines (209 loc) · 7.5 KB
/
reloads.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
import { A as ApiCallOptions } from './global.types-qsBNouXJ.js';
import './auth-types-PkN9CAF_.js';
type Error = {
/** The error code is in form of 'RELOADS-xxx'. ranges from 'RELOADS-001' to 'RELOADS-013'. */
code: string;
detail?: string;
title: string;
};
type Errors = {
errors?: Error[];
};
type Href = {
href?: string;
};
/**
* The boolean value used to present the reload is partial or not.
*/
type Partial = boolean;
type Reload = {
/** The ID of the app. */
appId: string;
/** The time the reload job was created. */
creationTime: string;
/** The time the reload job finished. */
endTime?: string;
/** The timestamp returned from the Sense engine upon successful reload. */
engineTime?: string;
/** The error code when the status is FAILED. */
errorCode?: string;
/** The error message when the status is FAILED. */
errorMessage?: string;
/** The ID of the reload. */
id: string;
links?: ReloadLinks;
/** The log describing the result of the latest reload execution from the request. */
log?: string;
/** The boolean value used to present the reload is partial or not. */
partial?: Partial;
/** The time the reload job was consumed from the queue. */
startTime?: string;
/** The status of the reload. There are seven statuses. `QUEUED`, `RELOADING`, `CANCELING` are the active statuses. `SUCCEEDED`, `FAILED`, `CANCELED`, `EXCEEDED_LIMIT` are the end statuses. */
status: Status;
/** The ID of the tenant who owns the reload. */
tenantId: string;
/** What initiated the reload: hub = one-time reload manually triggered in hub, chronos = time based scheduled reload triggered by chronos, external = reload triggered via external API request, automations = reload triggered in automation, data-refresh = reload triggered by refresh of data, choreographer = reload triggered by choreographer. */
type: Type;
/** The ID of the user who created the reload. */
userId: string;
};
type ReloadLinks = {
self?: Href;
};
type ReloadRequest = {
/** The ID of the app to be reloaded. */
appId: string;
/** The boolean value used to present the reload is partial or not */
partial?: boolean;
};
type Reloads = {
data: Reload[];
links: ReloadsLinks;
};
type ReloadsLinks = ReloadLinks & {
next?: Href;
prev?: Href;
};
/**
* The status of the reload. There are seven statuses. `QUEUED`, `RELOADING`, `CANCELING` are the active statuses. `SUCCEEDED`, `FAILED`, `CANCELED`, `EXCEEDED_LIMIT` are the end statuses.
*/
type Status = "QUEUED" | "RELOADING" | "CANCELING" | "SUCCEEDED" | "FAILED" | "CANCELED" | "EXCEEDED_LIMIT";
/**
* What initiated the reload: hub = one-time reload manually triggered in hub, chronos = time based scheduled reload triggered by chronos, external = reload triggered via external API request, automations = reload triggered in automation, data-refresh = reload triggered by refresh of data, choreographer = reload triggered by choreographer.
*/
type Type = "hub" | "external" | "chronos" | "automations" | "data-refresh" | "choreographer";
/**
* Finds and returns the reloads that the user has access to.
*
* @param query an object with query parameters
* @throws GetReloadsHttpError
*/
declare const getReloads: (query: {
/** The UUID formatted string used to search for an app's reload history entries. TenantAdmin users may omit this parameter to list all reload history in the tenant. */
appId?: string;
/** SCIM filter expression used to search for reloads.
* The filter syntax is defined in RFC 7644 section 3.4.2.2
*
* Supported attributes:
* - status: see #schemas/Status
* - partial: see #schemas/Partial
* - type: see #schemas/Type
*
* Supported operators:
* - eq */
filter?: string;
/** The maximum number of resources to return for a request. The limit must be an integer between 1 and 100 (inclusive). */
limit?: number;
/** The boolean value used to include the log field or not, set log=true to include the log field. */
log?: boolean;
/** The cursor to the next page of resources. Provide either the next or prev cursor, but not both. */
next?: string;
/** The boolean value used to search for a reload is partial or not. */
partial?: boolean;
/** The cursor to the previous page of resources. Provide either the next or prev cursor, but not both. */
prev?: string;
}, options?: ApiCallOptions) => Promise<GetReloadsHttpResponse>;
type GetReloadsHttpResponse = {
data: Reloads;
headers: Headers;
status: number;
};
type GetReloadsHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Reloads an app specified by an app ID.
*
* @param body an object with the body content
* @throws QueueReloadHttpError
*/
declare const queueReload: (body: ReloadRequest, options?: ApiCallOptions) => Promise<QueueReloadHttpResponse>;
type QueueReloadHttpResponse = {
data: Reload;
headers: Headers;
status: number;
};
type QueueReloadHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Finds and returns a reload record.
*
* @param reloadId The unique identifier of the reload.
* @throws GetReloadHttpError
*/
declare const getReload: (reloadId: string, options?: ApiCallOptions) => Promise<GetReloadHttpResponse>;
type GetReloadHttpResponse = {
data: Reload;
headers: Headers;
status: number;
};
type GetReloadHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Cancels a reload that is in progress or has been queued
*
* @param reloadId The unique identifier of the reload.
* @throws CancelReloadHttpError
*/
declare const cancelReload: (reloadId: string, options?: ApiCallOptions) => Promise<CancelReloadHttpResponse>;
type CancelReloadHttpResponse = {
data: void;
headers: Headers;
status: number;
};
type CancelReloadHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Clears the cache for reloads api requests.
*/
declare function clearCache(): void;
interface ReloadsAPI {
/**
* Finds and returns the reloads that the user has access to.
*
* @param query an object with query parameters
* @throws GetReloadsHttpError
*/
getReloads: typeof getReloads;
/**
* Reloads an app specified by an app ID.
*
* @param body an object with the body content
* @throws QueueReloadHttpError
*/
queueReload: typeof queueReload;
/**
* Finds and returns a reload record.
*
* @param reloadId The unique identifier of the reload.
* @throws GetReloadHttpError
*/
getReload: typeof getReload;
/**
* Cancels a reload that is in progress or has been queued
*
* @param reloadId The unique identifier of the reload.
* @throws CancelReloadHttpError
*/
cancelReload: typeof cancelReload;
/**
* Clears the cache for reloads api requests.
*/
clearCache: typeof clearCache;
}
/**
* Functions for the reloads api
*/
declare const reloadsExport: ReloadsAPI;
export { type CancelReloadHttpError, type CancelReloadHttpResponse, type Error, type Errors, type GetReloadHttpError, type GetReloadHttpResponse, type GetReloadsHttpError, type GetReloadsHttpResponse, type Href, type Partial, type QueueReloadHttpError, type QueueReloadHttpResponse, type Reload, type ReloadLinks, type ReloadRequest, type Reloads, type ReloadsAPI, type ReloadsLinks, type Status, type Type, cancelReload, clearCache, reloadsExport as default, getReload, getReloads, queueReload };