@nibgat/ncli 0.0.0-stage → 2.0.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/LICENSE +21 -0
- package/README.md +156 -2
- package/dist/bin/ncli.d.ts +2 -0
- package/dist/bin/ncli.js +9 -0
- package/dist/bin/ncli.js.map +1 -0
- package/dist/commands/auth.d.ts +2 -0
- package/dist/commands/auth.js +723 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/buyment.d.ts +2 -0
- package/dist/commands/buyment.js +174 -0
- package/dist/commands/buyment.js.map +1 -0
- package/dist/commands/cloud.d.ts +2 -0
- package/dist/commands/cloud.js +281 -0
- package/dist/commands/cloud.js.map +1 -0
- package/dist/commands/context.d.ts +25 -0
- package/dist/commands/context.js +92 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/front.d.ts +2 -0
- package/dist/commands/front.js +135 -0
- package/dist/commands/front.js.map +1 -0
- package/dist/commands/git.d.ts +2 -0
- package/dist/commands/git.js +726 -0
- package/dist/commands/git.js.map +1 -0
- package/dist/commands/health.d.ts +2 -0
- package/dist/commands/health.js +99 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/mail.d.ts +2 -0
- package/dist/commands/mail.js +265 -0
- package/dist/commands/mail.js.map +1 -0
- package/dist/commands/pipeline.d.ts +2 -0
- package/dist/commands/pipeline.js +333 -0
- package/dist/commands/pipeline.js.map +1 -0
- package/dist/commands/profile.d.ts +2 -0
- package/dist/commands/profile.js +229 -0
- package/dist/commands/profile.js.map +1 -0
- package/dist/commands/runner.d.ts +2 -0
- package/dist/commands/runner.js +266 -0
- package/dist/commands/runner.js.map +1 -0
- package/dist/commands/support.d.ts +2 -0
- package/dist/commands/support.js +133 -0
- package/dist/commands/support.js.map +1 -0
- package/dist/constants/index.d.ts +26 -0
- package/dist/constants/index.js +40 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/http/client.d.ts +46 -0
- package/dist/http/client.js +262 -0
- package/dist/http/client.js.map +1 -0
- package/dist/http/coreApi.d.ts +136 -0
- package/dist/http/coreApi.js +485 -0
- package/dist/http/coreApi.js.map +1 -0
- package/dist/http/gitApi.d.ts +128 -0
- package/dist/http/gitApi.js +255 -0
- package/dist/http/gitApi.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/pipeline/detect.d.ts +13 -0
- package/dist/pipeline/detect.js +90 -0
- package/dist/pipeline/detect.js.map +1 -0
- package/dist/pipeline/release.d.ts +36 -0
- package/dist/pipeline/release.js +250 -0
- package/dist/pipeline/release.js.map +1 -0
- package/dist/pipeline/schema.d.ts +10 -0
- package/dist/pipeline/schema.js +155 -0
- package/dist/pipeline/schema.js.map +1 -0
- package/dist/runner/config.d.ts +21 -0
- package/dist/runner/config.js +235 -0
- package/dist/runner/config.js.map +1 -0
- package/dist/runner/server.d.ts +25 -0
- package/dist/runner/server.js +803 -0
- package/dist/runner/server.js.map +1 -0
- package/dist/runner/systemd.d.ts +14 -0
- package/dist/runner/systemd.js +82 -0
- package/dist/runner/systemd.js.map +1 -0
- package/dist/runner/tarExtract.d.ts +4 -0
- package/dist/runner/tarExtract.js +215 -0
- package/dist/runner/tarExtract.js.map +1 -0
- package/dist/security/execSafe.d.ts +20 -0
- package/dist/security/execSafe.js +216 -0
- package/dist/security/execSafe.js.map +1 -0
- package/dist/security/pkce.d.ts +9 -0
- package/dist/security/pkce.js +35 -0
- package/dist/security/pkce.js.map +1 -0
- package/dist/security/redact.d.ts +3 -0
- package/dist/security/redact.js +76 -0
- package/dist/security/redact.js.map +1 -0
- package/dist/security/sanitize.d.ts +18 -0
- package/dist/security/sanitize.js +216 -0
- package/dist/security/sanitize.js.map +1 -0
- package/dist/security/vault.d.ts +34 -0
- package/dist/security/vault.js +291 -0
- package/dist/security/vault.js.map +1 -0
- package/dist/types/index.d.ts +116 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ui/output.d.ts +25 -0
- package/dist/ui/output.js +100 -0
- package/dist/ui/output.js.map +1 -0
- package/dist/ui/prompt.d.ts +4 -0
- package/dist/ui/prompt.js +100 -0
- package/dist/ui/prompt.js.map +1 -0
- package/package.json +54 -5
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { DEFAULT_HTTP_TIMEOUT_MS, SSO_COOKIE_CANDIDATES, DEVICE_COOKIE_NAME, NCLI_USER_AGENT } from "../constants/index.js";
|
|
2
|
+
export class ApiHttpError extends Error {
|
|
3
|
+
payload;
|
|
4
|
+
status;
|
|
5
|
+
constructor(message, status, payload) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = "ApiHttpError";
|
|
8
|
+
this.status = status;
|
|
9
|
+
this.payload = payload;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export const parseSetCookieHeaders = (headers) => {
|
|
13
|
+
const rawList = typeof headers.getSetCookie === "function"
|
|
14
|
+
? headers.getSetCookie()
|
|
15
|
+
: [];
|
|
16
|
+
if (rawList.length === 0) {
|
|
17
|
+
const single = headers.get("set-cookie");
|
|
18
|
+
if (single) {
|
|
19
|
+
rawList.push(single);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const all = {};
|
|
23
|
+
let sessionCookieName;
|
|
24
|
+
let sessionCookie;
|
|
25
|
+
let deviceCookie;
|
|
26
|
+
for (const entry of rawList) {
|
|
27
|
+
const firstPart = entry.split(";")[0]?.trim() || "";
|
|
28
|
+
const eqIdx = firstPart.indexOf("=");
|
|
29
|
+
if (eqIdx <= 0) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const key = firstPart.slice(0, eqIdx).trim();
|
|
33
|
+
const rawVal = firstPart.slice(eqIdx + 1).trim();
|
|
34
|
+
if (!key) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
let decodedVal = rawVal;
|
|
38
|
+
try {
|
|
39
|
+
decodedVal = decodeURIComponent(rawVal);
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
decodedVal = rawVal;
|
|
43
|
+
}
|
|
44
|
+
all[key] = decodedVal;
|
|
45
|
+
if (SSO_COOKIE_CANDIDATES.includes(key) && decodedVal) {
|
|
46
|
+
sessionCookieName = key;
|
|
47
|
+
sessionCookie = decodedVal;
|
|
48
|
+
}
|
|
49
|
+
if (key === DEVICE_COOKIE_NAME && decodedVal) {
|
|
50
|
+
deviceCookie = decodedVal;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
sessionCookieName,
|
|
55
|
+
sessionCookie,
|
|
56
|
+
deviceCookie,
|
|
57
|
+
all
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export const buildCookieHeader = (auth) => {
|
|
61
|
+
if (!auth) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const parts = [];
|
|
65
|
+
if (auth.sessionCookie) {
|
|
66
|
+
const trimmed = auth.sessionCookie.trim();
|
|
67
|
+
if (trimmed.includes("=")) {
|
|
68
|
+
parts.push(trimmed);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const cookieName = auth.sessionCookieName || SSO_COOKIE_CANDIDATES[0];
|
|
72
|
+
parts.push(`${cookieName}=${encodeURIComponent(trimmed)}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (auth.deviceCookie) {
|
|
76
|
+
parts.push(`${DEVICE_COOKIE_NAME}=${encodeURIComponent(auth.deviceCookie)}`);
|
|
77
|
+
}
|
|
78
|
+
return parts.length > 0 ? parts.join("; ") : null;
|
|
79
|
+
};
|
|
80
|
+
export class HttpClient {
|
|
81
|
+
baseUrl;
|
|
82
|
+
defaultAuth;
|
|
83
|
+
constructor(baseUrl, defaultAuth) {
|
|
84
|
+
this.baseUrl = String(baseUrl || "").trim().replace(/\/+$/, "");
|
|
85
|
+
this.defaultAuth = defaultAuth;
|
|
86
|
+
}
|
|
87
|
+
setDefaultAuth(auth) {
|
|
88
|
+
this.defaultAuth = auth;
|
|
89
|
+
}
|
|
90
|
+
async request(endpointPath, options) {
|
|
91
|
+
const normalizedPath = endpointPath.startsWith("/") ? endpointPath : `/${endpointPath}`;
|
|
92
|
+
const url = new URL(`${this.baseUrl}${normalizedPath}`);
|
|
93
|
+
if (options?.query) {
|
|
94
|
+
for (const [key, val] of Object.entries(options.query)) {
|
|
95
|
+
if (val !== undefined && val !== "") {
|
|
96
|
+
url.searchParams.set(key, String(val));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const method = options?.method || "GET";
|
|
101
|
+
const headers = {
|
|
102
|
+
"User-Agent": NCLI_USER_AGENT,
|
|
103
|
+
"x-nauth-csrf": "1",
|
|
104
|
+
Accept: "application/json",
|
|
105
|
+
...(options?.headers || {})
|
|
106
|
+
};
|
|
107
|
+
const includeAuth = options?.includeAuth !== false;
|
|
108
|
+
const auth = options?.auth || this.defaultAuth;
|
|
109
|
+
if (includeAuth && auth) {
|
|
110
|
+
if (auth.bearerToken && !headers.Authorization && !headers.authorization) {
|
|
111
|
+
headers.Authorization = auth.bearerToken.startsWith("Bearer ")
|
|
112
|
+
? auth.bearerToken
|
|
113
|
+
: `Bearer ${auth.bearerToken}`;
|
|
114
|
+
}
|
|
115
|
+
const cookieHeader = buildCookieHeader(auth);
|
|
116
|
+
if (cookieHeader && !headers.Cookie && !headers.cookie) {
|
|
117
|
+
headers.Cookie = cookieHeader;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
let bodyStr;
|
|
121
|
+
if (options?.body !== undefined && method !== "GET") {
|
|
122
|
+
headers["Content-Type"] = "application/json";
|
|
123
|
+
bodyStr = JSON.stringify(options.body);
|
|
124
|
+
}
|
|
125
|
+
const controller = new AbortController();
|
|
126
|
+
const timeoutMs = options?.timeoutMs ?? DEFAULT_HTTP_TIMEOUT_MS;
|
|
127
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
128
|
+
timer.unref();
|
|
129
|
+
let response;
|
|
130
|
+
try {
|
|
131
|
+
response = await fetch(url.toString(), {
|
|
132
|
+
signal: controller.signal,
|
|
133
|
+
redirect: "follow",
|
|
134
|
+
body: bodyStr,
|
|
135
|
+
headers,
|
|
136
|
+
method
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
catch (err) {
|
|
140
|
+
clearTimeout(timer);
|
|
141
|
+
const reason = err instanceof Error ? err.message : "network-error";
|
|
142
|
+
throw new ApiHttpError(`Network request failed (${method} ${url.pathname}): ${reason}`, 0);
|
|
143
|
+
}
|
|
144
|
+
finally {
|
|
145
|
+
clearTimeout(timer);
|
|
146
|
+
}
|
|
147
|
+
const cookies = parseSetCookieHeaders(response.headers);
|
|
148
|
+
const contentType = response.headers.get("content-type") || "";
|
|
149
|
+
let raw = null;
|
|
150
|
+
if (contentType.includes("application/json")) {
|
|
151
|
+
try {
|
|
152
|
+
raw = await response.json();
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
raw = null;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
const text = await response.text();
|
|
160
|
+
if (text) {
|
|
161
|
+
try {
|
|
162
|
+
raw = JSON.parse(text);
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
raw = text;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
const envelope = raw && typeof raw === "object"
|
|
170
|
+
? raw
|
|
171
|
+
: null;
|
|
172
|
+
const envelopeCode = typeof envelope?.code === "number" ? envelope.code : response.status;
|
|
173
|
+
if (response.status >= 400 || envelope?.isError || envelopeCode >= 400) {
|
|
174
|
+
const errorMessage = envelope?.message
|
|
175
|
+
? String(envelope.message)
|
|
176
|
+
: `HTTP ${response.status} ${response.statusText || "request-failed"}`;
|
|
177
|
+
const errorPayload = envelope?.payload && typeof envelope.payload === "object"
|
|
178
|
+
? envelope.payload
|
|
179
|
+
: undefined;
|
|
180
|
+
throw new ApiHttpError(errorMessage, envelopeCode || response.status, errorPayload);
|
|
181
|
+
}
|
|
182
|
+
const unwrapped = envelope && envelope.payload !== undefined
|
|
183
|
+
? envelope.payload
|
|
184
|
+
: raw;
|
|
185
|
+
return {
|
|
186
|
+
headers: response.headers,
|
|
187
|
+
status: response.status,
|
|
188
|
+
data: unwrapped,
|
|
189
|
+
cookies,
|
|
190
|
+
raw
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
async downloadBuffer(endpointPath, maxBytes, options) {
|
|
194
|
+
const normalizedPath = endpointPath.startsWith("/") ? endpointPath : `/${endpointPath}`;
|
|
195
|
+
const url = `${this.baseUrl}${normalizedPath}`;
|
|
196
|
+
const headers = {
|
|
197
|
+
"User-Agent": NCLI_USER_AGENT,
|
|
198
|
+
Accept: "application/gzip, application/octet-stream, */*"
|
|
199
|
+
};
|
|
200
|
+
const auth = options?.auth || this.defaultAuth;
|
|
201
|
+
if (auth?.bearerToken) {
|
|
202
|
+
headers.Authorization = auth.bearerToken.startsWith("Bearer ")
|
|
203
|
+
? auth.bearerToken
|
|
204
|
+
: `Bearer ${auth.bearerToken}`;
|
|
205
|
+
}
|
|
206
|
+
const cookieHeader = buildCookieHeader(auth);
|
|
207
|
+
if (cookieHeader) {
|
|
208
|
+
headers.Cookie = cookieHeader;
|
|
209
|
+
}
|
|
210
|
+
const controller = new AbortController();
|
|
211
|
+
const timer = setTimeout(() => controller.abort(), options?.timeoutMs ?? 120_000);
|
|
212
|
+
timer.unref();
|
|
213
|
+
let response;
|
|
214
|
+
try {
|
|
215
|
+
response = await fetch(url, {
|
|
216
|
+
signal: controller.signal,
|
|
217
|
+
method: "GET",
|
|
218
|
+
headers
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
catch (err) {
|
|
222
|
+
clearTimeout(timer);
|
|
223
|
+
throw new ApiHttpError(`Archive download failed: ${err instanceof Error ? err.message : "network-error"}`, 0);
|
|
224
|
+
}
|
|
225
|
+
finally {
|
|
226
|
+
clearTimeout(timer);
|
|
227
|
+
}
|
|
228
|
+
if (!response.ok) {
|
|
229
|
+
throw new ApiHttpError(`Archive download failed with HTTP ${response.status}`, response.status);
|
|
230
|
+
}
|
|
231
|
+
const contentLength = Number(response.headers.get("content-length") || "0");
|
|
232
|
+
if (Number.isFinite(contentLength) && contentLength > maxBytes) {
|
|
233
|
+
throw new ApiHttpError(`Archive exceeds maximum allowed size (${maxBytes} bytes).`, 413);
|
|
234
|
+
}
|
|
235
|
+
if (!response.body) {
|
|
236
|
+
const arr = await response.arrayBuffer();
|
|
237
|
+
if (arr.byteLength > maxBytes) {
|
|
238
|
+
throw new ApiHttpError(`Archive exceeds maximum allowed size (${maxBytes} bytes).`, 413);
|
|
239
|
+
}
|
|
240
|
+
return Buffer.from(arr);
|
|
241
|
+
}
|
|
242
|
+
const chunks = [];
|
|
243
|
+
let total = 0;
|
|
244
|
+
const reader = response.body.getReader();
|
|
245
|
+
while (true) {
|
|
246
|
+
const { value, done } = await reader.read();
|
|
247
|
+
if (done) {
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
if (value) {
|
|
251
|
+
total += value.byteLength;
|
|
252
|
+
if (total > maxBytes) {
|
|
253
|
+
await reader.cancel();
|
|
254
|
+
throw new ApiHttpError(`Archive exceeds maximum allowed size (${maxBytes} bytes).`, 413);
|
|
255
|
+
}
|
|
256
|
+
chunks.push(value);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return Buffer.concat(chunks);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/http/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EAClB,MAAM,uBAAuB,CAAC;AAqC/B,MAAM,OAAO,YAAa,SAAQ,KAAK;IACnB,OAAO,CAA2B;IAClC,MAAM,CAA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C;QAED,MAAM,MAAM,GAAiB,EAAE,CAAC;QAChC,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;QAEzC,OAAM,IAAI,EAAE,CAAC;YACT,MAAM,EACF,KAAK,EACL,IAAI,EACP,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YAExB,IAAG,IAAI,EAAE,CAAC;gBACN,MAAM;YACV,CAAC;YAED,IAAG,KAAK,EAAE,CAAC;gBACP,KAAK,IAAI,KAAK,CAAC,UAAU,CAAC;gBAE1B,IAAG,KAAK,GAAG,QAAQ,EAAE,CAAC;oBAClB,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;oBACtB,MAAM,IAAI,YAAY,CAAC,yCAAyC,QAAQ,UAAU,EAAE,GAAG,CAAC,CAAC;gBAC7F,CAAC;gBAED,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACvB,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;CACJ"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { HttpClient, type IHttpAuthMaterial, type IHttpResponse } from "./client.js";
|
|
2
|
+
import type { NAuthTwoFactorChannel } from "../types/index.js";
|
|
3
|
+
export interface INAuthLoginResponse {
|
|
4
|
+
availableChannels?: NAuthTwoFactorChannel[];
|
|
5
|
+
preferredChannel?: NAuthTwoFactorChannel;
|
|
6
|
+
requiresTwoFactor?: boolean;
|
|
7
|
+
challengeToken?: string;
|
|
8
|
+
requiresOtp?: boolean;
|
|
9
|
+
ssoSessionID?: string;
|
|
10
|
+
authenticated?: boolean;
|
|
11
|
+
expiresAt?: string;
|
|
12
|
+
user?: {
|
|
13
|
+
profilePhotoURL?: string | null;
|
|
14
|
+
firstName?: string;
|
|
15
|
+
lastName?: string;
|
|
16
|
+
fullName?: string;
|
|
17
|
+
userName?: string;
|
|
18
|
+
userID?: string;
|
|
19
|
+
mail?: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface IOAuthTokenResponse {
|
|
23
|
+
refreshToken?: string | null;
|
|
24
|
+
refresh_token?: string | null;
|
|
25
|
+
accessToken?: string;
|
|
26
|
+
access_token?: string;
|
|
27
|
+
tokenType?: string;
|
|
28
|
+
token_type?: string;
|
|
29
|
+
expiresIn?: number;
|
|
30
|
+
expires_in?: number;
|
|
31
|
+
sessionID?: string | null;
|
|
32
|
+
idToken?: string;
|
|
33
|
+
scope?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare const buildIdentifierBody: (identifier: string) => Record<string, unknown>;
|
|
36
|
+
export declare class CoreApiClient {
|
|
37
|
+
readonly http: HttpClient;
|
|
38
|
+
constructor(baseUrl: string, auth?: IHttpAuthMaterial);
|
|
39
|
+
healthcheck(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
40
|
+
ssoLogin(identifier: string, password: string): Promise<IHttpResponse<INAuthLoginResponse>>;
|
|
41
|
+
ssoRequestTwoFactor(challengeToken: string, channel: "sms" | "mail"): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
42
|
+
ssoVerifyTwoFactor(challengeToken: string, channel: NAuthTwoFactorChannel, code: string): Promise<IHttpResponse<INAuthLoginResponse>>;
|
|
43
|
+
ssoVerifySmsOtp(mail: string, code: string): Promise<IHttpResponse<INAuthLoginResponse>>;
|
|
44
|
+
ssoGetSession(): Promise<IHttpResponse<INAuthLoginResponse>>;
|
|
45
|
+
ssoLogout(options?: {
|
|
46
|
+
logoutAllDevices?: boolean;
|
|
47
|
+
revokeAllApps?: boolean;
|
|
48
|
+
}): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
49
|
+
ssoListSessions(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
50
|
+
ssoRevokeSession(targetType: "sso_session" | "app_session" | "app_consent", targetID: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
51
|
+
ssoTwoFactorStatus(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
52
|
+
exchangeOAuthToken(params: {
|
|
53
|
+
codeVerifier: string;
|
|
54
|
+
redirectUri: string;
|
|
55
|
+
clientId: string;
|
|
56
|
+
code: string;
|
|
57
|
+
}): Promise<IHttpResponse<IOAuthTokenResponse>>;
|
|
58
|
+
profileShow(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
59
|
+
profileUpdate(body: Record<string, unknown>): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
60
|
+
profileUsernameHistory(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
61
|
+
profileMails(): Promise<IHttpResponse<unknown>>;
|
|
62
|
+
profileAddMail(mail: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
63
|
+
profileDeleteMail(mail: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
64
|
+
profilePhones(): Promise<IHttpResponse<unknown>>;
|
|
65
|
+
profileAddPhone(phoneAreaCode: string, phone: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
66
|
+
profileDeletePhone(phoneAreaCode: string, phone: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
67
|
+
profilePublic(userName: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
68
|
+
mailHealth(domain?: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
69
|
+
mailOrganizations(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
70
|
+
mailListDomains(organizationID?: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
71
|
+
mailAddDomain(body: Record<string, unknown>): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
72
|
+
mailVerifyDomain(domainID: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
73
|
+
mailRotateDkim(domainID: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
74
|
+
mailListMailboxes(domain?: string, includeUsage?: boolean): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
75
|
+
mailProvisionMe(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
76
|
+
mailCreateMailbox(body: Record<string, unknown>): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
77
|
+
mailListAliases(domain?: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
78
|
+
mailCreateAlias(body: Record<string, unknown>): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
79
|
+
mailNotifications(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
80
|
+
mailInboxSnapshot(params: {
|
|
81
|
+
unseenOnly?: boolean;
|
|
82
|
+
folder?: string;
|
|
83
|
+
search?: string;
|
|
84
|
+
email: string;
|
|
85
|
+
limit?: number;
|
|
86
|
+
page?: number;
|
|
87
|
+
}): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
88
|
+
supportTicketsQuota(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
89
|
+
supportTicketsList(query?: Record<string, string | number | undefined>): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
90
|
+
supportTicketShow(id: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
91
|
+
supportTicketCreate(body: Record<string, unknown>): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
92
|
+
supportTicketReply(id: string, message: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
93
|
+
frontProducts(query?: Record<string, string | number | undefined>): Promise<IHttpResponse<unknown>>;
|
|
94
|
+
frontServices(query?: Record<string, string | number | undefined>): Promise<IHttpResponse<unknown>>;
|
|
95
|
+
frontNews(query?: Record<string, string | number | undefined>): Promise<IHttpResponse<unknown>>;
|
|
96
|
+
frontAnnouncements(query?: Record<string, string | number | undefined>): Promise<IHttpResponse<unknown>>;
|
|
97
|
+
buymentCatalog(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
98
|
+
buymentWallet(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
99
|
+
buymentTopUp(body: {
|
|
100
|
+
paymentMethod: "paytr_card" | "bank_transfer";
|
|
101
|
+
billingProfileId?: string;
|
|
102
|
+
amountKurus: number;
|
|
103
|
+
}): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
104
|
+
buymentOrders(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
105
|
+
buymentCreateOrder(body: Record<string, unknown>): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
106
|
+
buymentSubscriptions(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
107
|
+
buymentCancelSubscription(id: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
108
|
+
buymentInvoices(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
109
|
+
buymentEntitlements(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
110
|
+
cloudRegions(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
111
|
+
cloudCatalog(region?: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
112
|
+
cloudOverview(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
113
|
+
cloudResources(type?: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
114
|
+
cloudCreateServer(body: {
|
|
115
|
+
billingMode: "hourly_wallet" | "monthly_wallet";
|
|
116
|
+
regionCode: string;
|
|
117
|
+
planCode: string;
|
|
118
|
+
image: string;
|
|
119
|
+
name: string;
|
|
120
|
+
}): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
121
|
+
cloudServerPower(id: string, action: "start" | "stop" | "reboot" | "poweroff"): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
122
|
+
cloudCreateResource(body: {
|
|
123
|
+
resourceType: "container" | "storage" | "vpc" | "dns" | "backup";
|
|
124
|
+
regionCode: string;
|
|
125
|
+
planCode?: string;
|
|
126
|
+
name: string;
|
|
127
|
+
}): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
128
|
+
cloudDeleteResource(id: string): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
129
|
+
cloudHardwareOrders(): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
130
|
+
cloudCreateHardwareOrder(body: {
|
|
131
|
+
deliveryOption: "shipping" | "colocation_ist1";
|
|
132
|
+
hardwareItemId: string;
|
|
133
|
+
quantity: number;
|
|
134
|
+
notes?: string;
|
|
135
|
+
}): Promise<IHttpResponse<Record<string, unknown>>>;
|
|
136
|
+
}
|