@hoststack.dev/sdk 0.1.1 → 0.2.1
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/dist/index.cjs +306 -80
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +200 -71
- package/dist/index.d.ts +200 -71
- package/dist/index.js +306 -80
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -37,28 +37,70 @@ interface CreateServiceInput {
|
|
|
37
37
|
buildCommand?: string;
|
|
38
38
|
startCommand?: string;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Fields that live on the `services` row — write via PATCH /services/:tid/:sid.
|
|
42
|
+
* Nullable fields accept `null` to clear; `undefined` leaves the value unchanged.
|
|
43
|
+
*/
|
|
40
44
|
interface UpdateServiceInput {
|
|
41
45
|
name?: string;
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
branch?: string;
|
|
47
|
+
rootDirectory?: string;
|
|
48
|
+
autoDeploy?: boolean;
|
|
49
|
+
installCommand?: string | null;
|
|
44
50
|
buildCommand?: string | null;
|
|
45
51
|
startCommand?: string | null;
|
|
46
|
-
branch?: string | null;
|
|
47
|
-
rootDirectory?: string | null;
|
|
48
52
|
dockerfilePath?: string | null;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
healthCheckPath?: string | null;
|
|
54
|
+
cronSchedule?: string | null;
|
|
55
|
+
publishPath?: string | null;
|
|
56
|
+
runtime?: string;
|
|
57
|
+
}
|
|
58
|
+
interface ServiceConfig {
|
|
59
|
+
memoryMb?: number;
|
|
60
|
+
cpuShares?: number;
|
|
61
|
+
diskSizeGb?: number;
|
|
62
|
+
port?: number;
|
|
63
|
+
protocol?: 'http' | 'tcp';
|
|
64
|
+
healthCheckEnabled?: boolean;
|
|
65
|
+
healthCheckInterval?: number;
|
|
66
|
+
healthCheckTimeout?: number;
|
|
67
|
+
healthCheckGracePeriodSec?: number;
|
|
68
|
+
preDeployCommand?: string | null;
|
|
69
|
+
restartPolicy?: 'always' | 'on-failure' | 'no';
|
|
70
|
+
minInstances?: number;
|
|
71
|
+
maxInstances?: number;
|
|
72
|
+
scaleCpuThreshold?: number;
|
|
73
|
+
scaleMemoryThreshold?: number;
|
|
74
|
+
scaleRequestsPerSecThreshold?: number | null;
|
|
75
|
+
dockerImage?: string | null;
|
|
76
|
+
registryUsername?: string | null;
|
|
77
|
+
registryPassword?: string | null;
|
|
52
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Fields that live on the `service_config` row — write via PATCH
|
|
81
|
+
* /services/:tid/:sid/config. Build/runtime fields (build/start command,
|
|
82
|
+
* branch, rootDirectory) belong on UpdateServiceInput, not here.
|
|
83
|
+
*/
|
|
53
84
|
interface UpdateServiceConfigInput {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
85
|
+
memoryMb?: number;
|
|
86
|
+
cpuShares?: number;
|
|
87
|
+
diskSizeGb?: number;
|
|
88
|
+
port?: number;
|
|
89
|
+
protocol?: 'http' | 'tcp';
|
|
90
|
+
healthCheckEnabled?: boolean;
|
|
91
|
+
healthCheckInterval?: number;
|
|
92
|
+
healthCheckTimeout?: number;
|
|
93
|
+
healthCheckGracePeriodSec?: number;
|
|
94
|
+
preDeployCommand?: string;
|
|
95
|
+
restartPolicy?: 'always' | 'on-failure' | 'no';
|
|
96
|
+
minInstances?: number;
|
|
97
|
+
maxInstances?: number;
|
|
98
|
+
scaleCpuThreshold?: number;
|
|
99
|
+
scaleMemoryThreshold?: number;
|
|
100
|
+
scaleRequestsPerSecThreshold?: number | null;
|
|
101
|
+
dockerImage?: string | null;
|
|
102
|
+
registryUsername?: string | null;
|
|
103
|
+
registryPassword?: string | null;
|
|
62
104
|
}
|
|
63
105
|
interface Deploy {
|
|
64
106
|
id: number;
|
|
@@ -74,22 +116,30 @@ interface Deploy {
|
|
|
74
116
|
interface TriggerDeployInput {
|
|
75
117
|
clearCache?: boolean;
|
|
76
118
|
}
|
|
119
|
+
/** Managed database engines supported by HostStack. */
|
|
120
|
+
type DatabaseEngine = 'postgres' | 'redis' | 'mysql' | 'mariadb' | 'mongodb';
|
|
77
121
|
interface Database {
|
|
78
122
|
id: number;
|
|
79
123
|
publicId: string;
|
|
80
124
|
name: string;
|
|
81
|
-
type
|
|
125
|
+
/** The engine name. The legacy `type` alias still ships in API responses
|
|
126
|
+
* but is deprecated — read `engine` going forward. */
|
|
127
|
+
engine: DatabaseEngine;
|
|
82
128
|
status: string;
|
|
83
129
|
version?: string | null;
|
|
130
|
+
plan?: string | null;
|
|
131
|
+
region?: string | null;
|
|
84
132
|
projectId: number;
|
|
85
133
|
createdAt: string;
|
|
86
134
|
updatedAt: string;
|
|
87
135
|
}
|
|
88
136
|
interface CreateDatabaseInput {
|
|
89
137
|
name: string;
|
|
90
|
-
|
|
138
|
+
engine: DatabaseEngine;
|
|
91
139
|
projectId: number;
|
|
92
140
|
version?: string;
|
|
141
|
+
plan?: 'free' | 'starter' | 'standard' | 'pro';
|
|
142
|
+
region?: string;
|
|
93
143
|
}
|
|
94
144
|
interface UpdateDatabaseInput {
|
|
95
145
|
name?: string;
|
|
@@ -104,7 +154,7 @@ interface DatabaseCredentials {
|
|
|
104
154
|
}
|
|
105
155
|
interface Domain {
|
|
106
156
|
id: number;
|
|
107
|
-
publicId
|
|
157
|
+
publicId: string;
|
|
108
158
|
domain: string;
|
|
109
159
|
status: string;
|
|
110
160
|
verified: boolean;
|
|
@@ -120,7 +170,7 @@ interface UpdateDomainInput {
|
|
|
120
170
|
}
|
|
121
171
|
interface EnvVar {
|
|
122
172
|
id: number;
|
|
123
|
-
publicId
|
|
173
|
+
publicId: string;
|
|
124
174
|
key: string;
|
|
125
175
|
value: string;
|
|
126
176
|
isSecret: boolean;
|
|
@@ -150,13 +200,20 @@ interface User {
|
|
|
150
200
|
}
|
|
151
201
|
interface Team {
|
|
152
202
|
id: number;
|
|
203
|
+
publicId: string;
|
|
153
204
|
name: string;
|
|
154
205
|
slug: string;
|
|
155
206
|
role: string;
|
|
156
207
|
}
|
|
157
208
|
interface MeResponse {
|
|
158
|
-
user
|
|
159
|
-
|
|
209
|
+
/** Null when authenticated with an API key (no associated user). */
|
|
210
|
+
user: User | null;
|
|
211
|
+
team?: Team | null;
|
|
212
|
+
apiKey?: {
|
|
213
|
+
id: number;
|
|
214
|
+
permission: string;
|
|
215
|
+
};
|
|
216
|
+
stripeMode?: string;
|
|
160
217
|
}
|
|
161
218
|
interface ServiceMetrics {
|
|
162
219
|
cpu: number;
|
|
@@ -189,17 +246,17 @@ declare class CronResource {
|
|
|
189
246
|
private client;
|
|
190
247
|
constructor(client: HostStack);
|
|
191
248
|
/** List cron executions for a service. */
|
|
192
|
-
list(teamId:
|
|
249
|
+
list(teamId: IdInput, serviceId: IdInput, options?: {
|
|
193
250
|
limit?: number;
|
|
194
251
|
}): Promise<{
|
|
195
252
|
executions: CronExecution[];
|
|
196
253
|
}>;
|
|
197
254
|
/** Get a single cron execution by ID. */
|
|
198
|
-
get(teamId:
|
|
255
|
+
get(teamId: IdInput, serviceId: IdInput, executionId: IdInput): Promise<{
|
|
199
256
|
execution: CronExecution;
|
|
200
257
|
}>;
|
|
201
258
|
/** Trigger an immediate cron execution. */
|
|
202
|
-
trigger(teamId:
|
|
259
|
+
trigger(teamId: IdInput, serviceId: IdInput): Promise<{
|
|
203
260
|
execution: CronExecution;
|
|
204
261
|
}>;
|
|
205
262
|
}
|
|
@@ -208,123 +265,154 @@ declare class DatabasesResource {
|
|
|
208
265
|
private client;
|
|
209
266
|
constructor(client: HostStack);
|
|
210
267
|
/** List all databases for a project. */
|
|
211
|
-
list(teamId:
|
|
268
|
+
list(teamId: IdInput, projectId: IdInput): Promise<{
|
|
212
269
|
databases: Database[];
|
|
213
270
|
}>;
|
|
214
271
|
/** Get a single database by ID. */
|
|
215
|
-
get(teamId:
|
|
272
|
+
get(teamId: IdInput, databaseId: IdInput): Promise<{
|
|
216
273
|
database: Database;
|
|
217
274
|
}>;
|
|
218
275
|
/** Create a new database. */
|
|
219
|
-
create(teamId:
|
|
276
|
+
create(teamId: IdInput, data: CreateDatabaseInput): Promise<{
|
|
220
277
|
database: Database;
|
|
221
278
|
}>;
|
|
222
279
|
/** Update a database. */
|
|
223
|
-
update(teamId:
|
|
280
|
+
update(teamId: IdInput, databaseId: IdInput, data: UpdateDatabaseInput): Promise<{
|
|
224
281
|
database: Database;
|
|
225
282
|
}>;
|
|
226
283
|
/** Delete a database. */
|
|
227
|
-
delete(teamId:
|
|
284
|
+
delete(teamId: IdInput, databaseId: IdInput): Promise<void>;
|
|
228
285
|
/** Suspend a database. */
|
|
229
|
-
suspend(teamId:
|
|
286
|
+
suspend(teamId: IdInput, databaseId: IdInput): Promise<void>;
|
|
230
287
|
/** Resume a suspended database. */
|
|
231
|
-
resume(teamId:
|
|
288
|
+
resume(teamId: IdInput, databaseId: IdInput): Promise<void>;
|
|
232
289
|
/** Get connection credentials. */
|
|
233
|
-
getCredentials(teamId:
|
|
290
|
+
getCredentials(teamId: IdInput, databaseId: IdInput): Promise<{
|
|
234
291
|
credentials: DatabaseCredentials;
|
|
235
292
|
}>;
|
|
236
293
|
/** Reset the database password. */
|
|
237
|
-
resetPassword(teamId:
|
|
294
|
+
resetPassword(teamId: IdInput, databaseId: IdInput): Promise<void>;
|
|
238
295
|
}
|
|
239
296
|
|
|
297
|
+
interface DeployListResponse {
|
|
298
|
+
data: Deploy[];
|
|
299
|
+
page: number;
|
|
300
|
+
perPage: number;
|
|
301
|
+
total: number;
|
|
302
|
+
totalPages: number;
|
|
303
|
+
}
|
|
240
304
|
declare class DeploysResource {
|
|
241
305
|
private client;
|
|
242
306
|
constructor(client: HostStack);
|
|
243
|
-
/**
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
307
|
+
/**
|
|
308
|
+
* List deploys for a service. Paginated — pass `page` / `perPage` to walk
|
|
309
|
+
* pages. Default page=1, perPage=25, hard cap perPage=100.
|
|
310
|
+
*/
|
|
311
|
+
list(teamId: IdInput, serviceId: IdInput, options?: {
|
|
312
|
+
page?: number;
|
|
313
|
+
perPage?: number;
|
|
314
|
+
}): Promise<DeployListResponse>;
|
|
247
315
|
/** Get a single deploy by ID. */
|
|
248
|
-
get(teamId:
|
|
316
|
+
get(teamId: IdInput, serviceId: IdInput, deployId: IdInput): Promise<{
|
|
249
317
|
deploy: Deploy;
|
|
250
318
|
}>;
|
|
251
319
|
/** Trigger a new deploy. */
|
|
252
|
-
trigger(teamId:
|
|
320
|
+
trigger(teamId: IdInput, serviceId: IdInput, data?: TriggerDeployInput): Promise<{
|
|
253
321
|
deploy: Deploy;
|
|
254
322
|
}>;
|
|
255
323
|
/** Cancel an in-progress deploy. */
|
|
256
|
-
cancel(teamId:
|
|
324
|
+
cancel(teamId: IdInput, serviceId: IdInput, deployId: IdInput): Promise<void>;
|
|
257
325
|
/** Rollback to a previous deploy. */
|
|
258
|
-
rollback(teamId:
|
|
259
|
-
/**
|
|
260
|
-
|
|
261
|
-
|
|
326
|
+
rollback(teamId: IdInput, serviceId: IdInput, deployId: IdInput): Promise<void>;
|
|
327
|
+
/**
|
|
328
|
+
* Get build logs for a deploy.
|
|
329
|
+
*
|
|
330
|
+
* Pagination: pass `afterId` from the previous response's `nextAfterId`
|
|
331
|
+
* to fetch the next page. Per-call cap is 5000; default 500.
|
|
332
|
+
*/
|
|
333
|
+
getLogs(teamId: IdInput, serviceId: IdInput, deployId: IdInput, options?: {
|
|
334
|
+
search?: string;
|
|
335
|
+
level?: string;
|
|
336
|
+
phase?: string;
|
|
337
|
+
limit?: number;
|
|
338
|
+
afterId?: number;
|
|
339
|
+
}): Promise<{
|
|
340
|
+
logs: DeployLogEntry[];
|
|
341
|
+
nextAfterId: number | null;
|
|
262
342
|
}>;
|
|
263
343
|
}
|
|
344
|
+
interface DeployLogEntry {
|
|
345
|
+
id: number;
|
|
346
|
+
deployId: number;
|
|
347
|
+
timestamp: string;
|
|
348
|
+
level: 'info' | 'warn' | 'error' | 'debug';
|
|
349
|
+
phase: string | null;
|
|
350
|
+
message: string;
|
|
351
|
+
}
|
|
264
352
|
|
|
265
353
|
declare class DomainsResource {
|
|
266
354
|
private client;
|
|
267
355
|
constructor(client: HostStack);
|
|
268
356
|
/** List all domains for the active team. */
|
|
269
|
-
list(teamId:
|
|
357
|
+
list(teamId: IdInput): Promise<{
|
|
270
358
|
domains: Domain[];
|
|
271
359
|
}>;
|
|
272
360
|
/** Add a custom domain. */
|
|
273
|
-
add(teamId:
|
|
361
|
+
add(teamId: IdInput, data: AddDomainInput): Promise<{
|
|
274
362
|
domain: Domain;
|
|
275
363
|
}>;
|
|
276
364
|
/** Update a domain. */
|
|
277
|
-
update(teamId:
|
|
365
|
+
update(teamId: IdInput, domainId: IdInput, data: UpdateDomainInput): Promise<{
|
|
278
366
|
domain: Domain;
|
|
279
367
|
}>;
|
|
280
368
|
/** Remove a domain. */
|
|
281
|
-
remove(teamId:
|
|
369
|
+
remove(teamId: IdInput, domainId: IdInput): Promise<void>;
|
|
282
370
|
/** Verify domain DNS configuration. */
|
|
283
|
-
verify(teamId:
|
|
371
|
+
verify(teamId: IdInput, domainId: IdInput): Promise<void>;
|
|
284
372
|
}
|
|
285
373
|
|
|
286
374
|
declare class EnvVarsResource {
|
|
287
375
|
private client;
|
|
288
376
|
constructor(client: HostStack);
|
|
289
377
|
/** List all environment variables for a service. */
|
|
290
|
-
list(teamId:
|
|
378
|
+
list(teamId: IdInput, serviceId: IdInput): Promise<{
|
|
291
379
|
envVars: EnvVar[];
|
|
292
380
|
}>;
|
|
293
381
|
/** Create a new environment variable. */
|
|
294
|
-
create(teamId:
|
|
382
|
+
create(teamId: IdInput, serviceId: IdInput, data: CreateEnvVarInput): Promise<{
|
|
295
383
|
envVar: EnvVar;
|
|
296
384
|
}>;
|
|
297
385
|
/** Update an environment variable. */
|
|
298
|
-
update(teamId:
|
|
386
|
+
update(teamId: IdInput, serviceId: IdInput, envVarId: IdInput, data: UpdateEnvVarInput): Promise<{
|
|
299
387
|
envVar: EnvVar;
|
|
300
388
|
}>;
|
|
301
389
|
/** Delete an environment variable. */
|
|
302
|
-
delete(teamId:
|
|
390
|
+
delete(teamId: IdInput, serviceId: IdInput, envVarId: IdInput): Promise<void>;
|
|
303
391
|
/** Bulk set environment variables (create or update). */
|
|
304
|
-
bulkSet(teamId:
|
|
392
|
+
bulkSet(teamId: IdInput, serviceId: IdInput, data: BulkSetEnvVarsInput): Promise<void>;
|
|
305
393
|
}
|
|
306
394
|
|
|
307
395
|
declare class ProjectsResource {
|
|
308
396
|
private client;
|
|
309
397
|
constructor(client: HostStack);
|
|
310
398
|
/** List all projects for the active team. */
|
|
311
|
-
list(teamId:
|
|
399
|
+
list(teamId: IdInput): Promise<{
|
|
312
400
|
projects: Project[];
|
|
313
401
|
}>;
|
|
314
402
|
/** Get a single project by ID. */
|
|
315
|
-
get(teamId:
|
|
403
|
+
get(teamId: IdInput, projectId: IdInput): Promise<{
|
|
316
404
|
project: Project;
|
|
317
405
|
}>;
|
|
318
406
|
/** Create a new project. */
|
|
319
|
-
create(teamId:
|
|
407
|
+
create(teamId: IdInput, data: CreateProjectInput): Promise<{
|
|
320
408
|
project: Project;
|
|
321
409
|
}>;
|
|
322
410
|
/** Update a project. */
|
|
323
|
-
update(teamId:
|
|
411
|
+
update(teamId: IdInput, projectId: IdInput, data: UpdateProjectInput): Promise<{
|
|
324
412
|
project: Project;
|
|
325
413
|
}>;
|
|
326
414
|
/** Delete a project. */
|
|
327
|
-
delete(teamId:
|
|
415
|
+
delete(teamId: IdInput, projectId: IdInput): Promise<void>;
|
|
328
416
|
}
|
|
329
417
|
|
|
330
418
|
interface LogEntry$1 {
|
|
@@ -354,41 +442,41 @@ declare class ServicesResource {
|
|
|
354
442
|
private client;
|
|
355
443
|
constructor(client: HostStack);
|
|
356
444
|
/** List all services for the active team. */
|
|
357
|
-
list(teamId:
|
|
445
|
+
list(teamId: IdInput): Promise<{
|
|
358
446
|
services: Service[];
|
|
359
447
|
}>;
|
|
360
448
|
/** Get a single service by ID. */
|
|
361
|
-
get(teamId:
|
|
449
|
+
get(teamId: IdInput, serviceId: IdInput): Promise<{
|
|
362
450
|
service: Service;
|
|
363
451
|
}>;
|
|
364
452
|
/** Create a new service. */
|
|
365
|
-
create(teamId:
|
|
453
|
+
create(teamId: IdInput, data: CreateServiceInput): Promise<{
|
|
366
454
|
service: Service;
|
|
367
455
|
}>;
|
|
368
456
|
/** Update a service. */
|
|
369
|
-
update(teamId:
|
|
457
|
+
update(teamId: IdInput, serviceId: IdInput, data: UpdateServiceInput): Promise<{
|
|
370
458
|
service: Service;
|
|
371
459
|
}>;
|
|
372
460
|
/** Delete a service. */
|
|
373
|
-
delete(teamId:
|
|
461
|
+
delete(teamId: IdInput, serviceId: IdInput): Promise<void>;
|
|
374
462
|
/** Suspend a service. */
|
|
375
|
-
suspend(teamId:
|
|
463
|
+
suspend(teamId: IdInput, serviceId: IdInput): Promise<void>;
|
|
376
464
|
/** Resume a suspended service. */
|
|
377
|
-
resume(teamId:
|
|
465
|
+
resume(teamId: IdInput, serviceId: IdInput): Promise<void>;
|
|
378
466
|
/** Get service metrics. */
|
|
379
|
-
getMetrics(teamId:
|
|
467
|
+
getMetrics(teamId: IdInput, serviceId: IdInput): Promise<{
|
|
380
468
|
metrics: ServiceMetrics;
|
|
381
469
|
}>;
|
|
382
470
|
/** Get service configuration. */
|
|
383
|
-
getConfig(teamId:
|
|
471
|
+
getConfig(teamId: IdInput, serviceId: IdInput): Promise<{
|
|
384
472
|
config: ServiceConfig;
|
|
385
473
|
}>;
|
|
386
474
|
/** Update service configuration. */
|
|
387
|
-
updateConfig(teamId:
|
|
475
|
+
updateConfig(teamId: IdInput, serviceId: IdInput, data: UpdateServiceConfigInput): Promise<{
|
|
388
476
|
config: ServiceConfig;
|
|
389
477
|
}>;
|
|
390
478
|
/** Get runtime logs for a service. */
|
|
391
|
-
getRuntimeLogs(teamId:
|
|
479
|
+
getRuntimeLogs(teamId: IdInput, serviceId: IdInput, options?: {
|
|
392
480
|
lines?: number;
|
|
393
481
|
since?: string;
|
|
394
482
|
stream?: 'stdout' | 'stderr';
|
|
@@ -407,18 +495,48 @@ declare class ServicesResource {
|
|
|
407
495
|
* }
|
|
408
496
|
* ```
|
|
409
497
|
*/
|
|
410
|
-
streamLogs(teamId:
|
|
498
|
+
streamLogs(teamId: IdInput, serviceId: IdInput, options?: StreamLogsOptions): AsyncGenerator<LogEntry>;
|
|
411
499
|
}
|
|
412
500
|
|
|
501
|
+
/** A numeric id or a publicId string (e.g. 42, "42", "svc_abc…"). */
|
|
502
|
+
type IdInput = number | string;
|
|
413
503
|
interface HostStackOptions {
|
|
414
504
|
/** Your HostStack API key (hs_live_... or hs_test_...). */
|
|
415
505
|
apiKey: string;
|
|
416
506
|
/** Base URL of the HostStack API. Defaults to https://hoststack.dev */
|
|
417
507
|
baseUrl?: string;
|
|
418
508
|
}
|
|
509
|
+
type ResolveScope = {
|
|
510
|
+
kind: 'team';
|
|
511
|
+
} | {
|
|
512
|
+
kind: 'project';
|
|
513
|
+
teamId: number;
|
|
514
|
+
} | {
|
|
515
|
+
kind: 'service';
|
|
516
|
+
teamId: number;
|
|
517
|
+
} | {
|
|
518
|
+
kind: 'deploy';
|
|
519
|
+
teamId: number;
|
|
520
|
+
serviceId: number;
|
|
521
|
+
} | {
|
|
522
|
+
kind: 'database';
|
|
523
|
+
teamId: number;
|
|
524
|
+
} | {
|
|
525
|
+
kind: 'domain';
|
|
526
|
+
teamId: number;
|
|
527
|
+
} | {
|
|
528
|
+
kind: 'envVar';
|
|
529
|
+
teamId: number;
|
|
530
|
+
serviceId: number;
|
|
531
|
+
} | {
|
|
532
|
+
kind: 'cronExecution';
|
|
533
|
+
teamId: number;
|
|
534
|
+
serviceId: number;
|
|
535
|
+
};
|
|
419
536
|
declare class HostStack {
|
|
420
537
|
private apiKey;
|
|
421
538
|
private baseUrl;
|
|
539
|
+
private idCache;
|
|
422
540
|
/** Manage projects. */
|
|
423
541
|
readonly projects: ProjectsResource;
|
|
424
542
|
/** Manage services (web, worker, cron). */
|
|
@@ -439,6 +557,17 @@ declare class HostStack {
|
|
|
439
557
|
* Used internally by resource classes. Can also be used for custom API calls.
|
|
440
558
|
*/
|
|
441
559
|
request<T>(method: string, path: string, body?: unknown): Promise<T>;
|
|
560
|
+
/**
|
|
561
|
+
* Resolve a publicId-or-numeric id input to a numeric database id. Numeric
|
|
562
|
+
* inputs short-circuit; publicIds (svc_xyz, dpl_xyz, etc.) are looked up
|
|
563
|
+
* via the relevant list endpoint and cached on this client instance.
|
|
564
|
+
*
|
|
565
|
+
* The API addresses everything by numeric id internally; this resolver lets
|
|
566
|
+
* SDK/MCP consumers pass either form interchangeably without burning extra
|
|
567
|
+
* round-trips on subsequent calls.
|
|
568
|
+
*/
|
|
569
|
+
resolveId(input: IdInput, scope: ResolveScope): Promise<number>;
|
|
570
|
+
private fetchForResolution;
|
|
442
571
|
}
|
|
443
572
|
|
|
444
573
|
declare class HostStackError extends Error {
|