@phpsandbox/sdk 0.1.20 → 0.2.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.
@@ -0,0 +1,114 @@
1
+ export type LaravelCloudRegion = 'us-east-2' | 'us-east-1' | 'ca-central-1' | 'eu-central-1' | 'eu-west-1' | 'eu-west-2' | 'me-central-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'ap-northeast-1';
2
+ export interface LaravelCloudResourceInput {
3
+ mode: 'none' | 'reuse' | 'create' | 'external';
4
+ id?: string;
5
+ type?: string;
6
+ version?: string;
7
+ size?: string;
8
+ config?: Record<string, string | number | boolean | null>;
9
+ }
10
+ export interface LaravelCloudSetupInput {
11
+ repositoryAccessConfirmed?: boolean;
12
+ database?: LaravelCloudResourceInput;
13
+ cache?: LaravelCloudResourceInput;
14
+ storage?: LaravelCloudResourceInput;
15
+ worker?: boolean;
16
+ scheduler?: boolean;
17
+ workerPlacement?: 'app' | 'separate';
18
+ workerSize?: string;
19
+ buildCommand?: string;
20
+ deployCommand?: string;
21
+ }
22
+ export interface LaravelCloudCatalogResource {
23
+ id: string;
24
+ name: string;
25
+ region: string | null;
26
+ type: string | null;
27
+ status: string | null;
28
+ clusterId?: string;
29
+ bucketId?: string;
30
+ keyName?: string;
31
+ }
32
+ export interface LaravelCloudConfigField {
33
+ name: string;
34
+ type: string;
35
+ required: boolean;
36
+ nullable?: boolean;
37
+ description?: string;
38
+ min?: number;
39
+ max?: number;
40
+ enum?: Array<string | number>;
41
+ example?: string | number;
42
+ }
43
+ export interface LaravelCloudDatabaseType {
44
+ type: string;
45
+ label: string;
46
+ versions: string[];
47
+ regions: string[];
48
+ config_schema: LaravelCloudConfigField[];
49
+ }
50
+ export interface LaravelCloudCatalog {
51
+ regions: Array<{
52
+ region: string;
53
+ label: string;
54
+ flag?: string;
55
+ }>;
56
+ databaseTypes: LaravelCloudDatabaseType[];
57
+ cacheTypes: Array<{
58
+ type: string;
59
+ label: string;
60
+ regions: string[];
61
+ sizes: Array<string | {
62
+ value?: string;
63
+ name?: string;
64
+ size?: string;
65
+ label?: string;
66
+ supports_hibernation?: boolean;
67
+ }>;
68
+ }>;
69
+ databases: LaravelCloudCatalogResource[];
70
+ caches: LaravelCloudCatalogResource[];
71
+ storage: LaravelCloudCatalogResource[];
72
+ pricingUrl: string;
73
+ }
74
+ export interface LaravelCloudSetupState {
75
+ applicationId?: string;
76
+ environmentId?: string;
77
+ applicationManaged?: boolean;
78
+ environmentManaged?: boolean;
79
+ databaseId?: string;
80
+ databaseIdManaged?: boolean;
81
+ cacheId?: string;
82
+ cacheIdManaged?: boolean;
83
+ storageId?: string;
84
+ storageIdManaged?: boolean;
85
+ workerId?: string;
86
+ backgroundInstanceId?: string;
87
+ backgroundProcessId?: string;
88
+ configuredAt?: string;
89
+ retainedResources?: Array<{
90
+ kind: string;
91
+ id: string;
92
+ providerId: string;
93
+ name: string | null;
94
+ }>;
95
+ pendingCreation?: {
96
+ resource: string;
97
+ name: string | null;
98
+ startedAt: string;
99
+ };
100
+ }
101
+ export interface LaravelCloudProviderData {
102
+ setup?: LaravelCloudSetupInput;
103
+ region?: LaravelCloudRegion;
104
+ repository?: string;
105
+ branch?: string;
106
+ expectedCommitSha?: string | null;
107
+ sourceControlProviderType?: 'github' | 'gitlab' | 'bitbucket';
108
+ }
109
+ export interface LaravelCloudProviderInput {
110
+ setup?: LaravelCloudSetupInput;
111
+ region: LaravelCloudRegion;
112
+ }
113
+ /** Keep retained resources when publishing again after removing the Cloud application. */
114
+ export declare function laravelCloudSetupForRepublish(setup?: LaravelCloudSetupInput, state?: LaravelCloudSetupState | null): LaravelCloudSetupInput;
@@ -0,0 +1,13 @@
1
+ /** Keep retained resources when publishing again after removing the Cloud application. */
2
+ export function laravelCloudSetupForRepublish(setup = {}, state = null) {
3
+ const next = { ...setup };
4
+ const ids = { database: state?.databaseId, cache: state?.cacheId, storage: state?.storageId };
5
+ const kinds = ['database', 'cache', 'storage'];
6
+ for (const kind of kinds) {
7
+ const id = ids[kind];
8
+ if (setup[kind]?.mode === 'create' && id) {
9
+ next[kind] = { mode: 'reuse', id };
10
+ }
11
+ }
12
+ return next;
13
+ }
@@ -0,0 +1,9 @@
1
+ import type { Client, PaginatedApiResponse } from '../index.js';
2
+ import type { PublicationManagedResource, PublicationResourceListOptions } from './types.js';
3
+ export declare class PublicationResources {
4
+ private readonly client;
5
+ private readonly path;
6
+ constructor(client: Client, path?: string);
7
+ inspect(id: string): Promise<PublicationManagedResource>;
8
+ list(options?: PublicationResourceListOptions): Promise<PaginatedApiResponse<PublicationManagedResource>>;
9
+ }
@@ -0,0 +1,19 @@
1
+ export class PublicationResources {
2
+ constructor(client, path = '/publication-resources') {
3
+ this.client = client;
4
+ this.path = path;
5
+ }
6
+ async inspect(id) {
7
+ return (await this.client.post(`/publication-resources/${encodeURIComponent(id)}/inspect`, {})).data;
8
+ }
9
+ async list(options = {}) {
10
+ const query = new URLSearchParams();
11
+ for (const [name, value] of Object.entries(options)) {
12
+ if (value !== undefined) {
13
+ query.set(name, String(value));
14
+ }
15
+ }
16
+ const suffix = query.size > 0 ? `?${query.toString()}` : '';
17
+ return this.client.get(`${this.path}${suffix}`);
18
+ }
19
+ }
@@ -0,0 +1,30 @@
1
+ import type { PublicationProviderName } from './types.js';
2
+ import type { Client } from '../index.js';
3
+ import type { PublishStreamEvent, PublishStreamResult } from '../schemas/publications.js';
4
+ import { PublicationInstance } from './instance.js';
5
+ export declare class PublicationRun<TProvider extends PublicationProviderName = PublicationProviderName> {
6
+ readonly initial: PublicationInstance<TProvider>;
7
+ private readonly client;
8
+ private readonly streamAbort;
9
+ private started;
10
+ private completed;
11
+ private finalError;
12
+ private finalResult;
13
+ private resultPromise;
14
+ private resolveResult;
15
+ private rejectResult;
16
+ private readonly bufferedEvents;
17
+ private readonly subscribers;
18
+ constructor(initial: PublicationInstance<TProvider>, client: Client);
19
+ events(): AsyncIterable<PublishStreamEvent>;
20
+ result(): Promise<PublishStreamResult>;
21
+ publication(): Promise<PublicationInstance<TProvider>>;
22
+ start(): this;
23
+ /** Stop observing this run. Once its stream has attached, the server-side publication continues. */
24
+ dispose(): void;
25
+ private subscribe;
26
+ private consumeStream;
27
+ private publish;
28
+ private closeSubscribers;
29
+ private fail;
30
+ }
@@ -1,34 +1,5 @@
1
- import { PublicationEventDataSchema, PublicationLogChunkDataSchema, PublishStreamSseEventNameSchema, PublishStreamSseEventSchema, } from './schemas/publications.js';
2
- export class PublicationDomains {
3
- constructor(client, publicationId) {
4
- this.client = client;
5
- this.publicationId = publicationId;
6
- }
7
- async list() {
8
- return (await this.client.get(this.path())).data;
9
- }
10
- async create(hostname) {
11
- return (await this.client.post(this.path(), { hostname })).data;
12
- }
13
- async refresh(id) {
14
- return (await this.client.post(`${this.path()}/${encodeURIComponent(id)}/refresh`)).data;
15
- }
16
- async delete(id) {
17
- await this.client.delete(`${this.path()}/${encodeURIComponent(id)}`);
18
- }
19
- path() {
20
- return `/publications/${encodeURIComponent(this.publicationId)}/domains`;
21
- }
22
- }
23
- export class PublicationApi {
24
- constructor(client) {
25
- this.client = client;
26
- }
27
- async get(id) {
28
- const response = await this.client.get(`/publications/${id}`);
29
- return new PublicationInstance(response.data, this.client);
30
- }
31
- }
1
+ import { PublishStreamSseEventNameSchema, PublishStreamSseEventSchema } from '../schemas/publications.js';
2
+ import { PHPSandboxError } from '../errors/index.js';
32
3
  export class PublicationRun {
33
4
  constructor(initial, client) {
34
5
  this.initial = initial;
@@ -59,6 +30,9 @@ export class PublicationRun {
59
30
  }
60
31
  result() {
61
32
  this.start();
33
+ if (!this.resultPromise) {
34
+ throw new PHPSandboxError('Publication stream could not start.');
35
+ }
62
36
  return this.resultPromise;
63
37
  }
64
38
  async publication() {
@@ -71,7 +45,7 @@ export class PublicationRun {
71
45
  }
72
46
  const eventStreamUrl = this.initial.data.eventStreamUrl;
73
47
  if (!eventStreamUrl) {
74
- throw new Error(`Publication ${this.initial.data.id} has no eventStreamUrl for SSE streaming`);
48
+ throw new PHPSandboxError(`Publication ${this.initial.data.id} has no eventStreamUrl for SSE streaming`);
75
49
  }
76
50
  this.started = true;
77
51
  this.resultPromise = new Promise((resolve, reject) => {
@@ -82,10 +56,11 @@ export class PublicationRun {
82
56
  void this.consumeStream(eventStreamUrl);
83
57
  return this;
84
58
  }
85
- /** Stop observing this run; the server-side publication continues. */
59
+ /** Stop observing this run. Once its stream has attached, the server-side publication continues. */
86
60
  dispose() {
87
- if (this.completed)
61
+ if (this.completed) {
88
62
  return;
63
+ }
89
64
  const error = new DOMException('Stopped observing publication; deployment continues.', 'AbortError');
90
65
  if (!this.started) {
91
66
  this.started = true;
@@ -123,12 +98,12 @@ export class PublicationRun {
123
98
  }
124
99
  }
125
100
  if (!this.finalResult) {
126
- throw new Error('Publish stream ended without result');
101
+ throw new PHPSandboxError('Publish stream ended without result');
127
102
  }
128
103
  this.closeSubscribers();
129
104
  }
130
105
  catch (err) {
131
- this.fail(err instanceof Error ? err : new Error(String(err)));
106
+ this.fail(err instanceof Error ? err : new PHPSandboxError(String(err), err));
132
107
  }
133
108
  }
134
109
  publish(event) {
@@ -154,79 +129,6 @@ export class PublicationRun {
154
129
  this.subscribers.clear();
155
130
  }
156
131
  }
157
- export class PublicationInstance {
158
- constructor(data, client, notebookId) {
159
- this.data = data;
160
- this.client = client;
161
- this.notebookId = notebookId;
162
- this.domains = new PublicationDomains(client, data.id);
163
- }
164
- async refresh() {
165
- const response = await this.client.get(`/publications/${this.data.id}`);
166
- return new PublicationInstance(response.data, this.client, this.notebookId);
167
- }
168
- async publish() {
169
- if (!this.notebookId) {
170
- return Promise.reject(new Error('Publishing requires a notebook-scoped publication instance.'));
171
- }
172
- const response = await this.client.post(`/notebook/${this.notebookId}/publication`);
173
- const run = new PublicationRun(new PublicationInstance(response.data, this.client, this.notebookId), this.client);
174
- run.start();
175
- return run;
176
- }
177
- async destroy() {
178
- await this.client.delete(`/publications/${this.data.id}`);
179
- }
180
- async wait(options = {}) {
181
- const intervalMs = options.intervalMs ?? 1000;
182
- const timeoutMs = options.timeoutMs ?? 300000;
183
- const startedAt = Date.now();
184
- let current = this;
185
- while (!publicationStatusIsTerminal(current.data.status)) {
186
- if (Date.now() - startedAt > timeoutMs) {
187
- throw new Error(`Timed out waiting for publication ${this.data.id}`);
188
- }
189
- await delay(intervalMs);
190
- current = await current.refresh();
191
- }
192
- return current;
193
- }
194
- async events() {
195
- return parseNdjsonStream(await this.client.stream(`/publications/${this.data.id}/events/stream`), PublicationEventDataSchema);
196
- }
197
- buildLogs(buildId = this.data.latestBuild?.id ?? '') {
198
- if (buildId === '') {
199
- return Promise.reject(new Error('Publication has no latest build id'));
200
- }
201
- return this.client.stream(`/publications/${this.data.id}/builds/${buildId}/logs/stream`)
202
- .then((stream) => parseNdjsonStream(stream, PublicationLogChunkDataSchema));
203
- }
204
- async logs() {
205
- return parseNdjsonStream(await this.client.stream(`/publications/${this.data.id}/logs/stream`), PublicationLogChunkDataSchema);
206
- }
207
- async setProtection(input) {
208
- const response = await this.client.put(`/publications/${this.data.id}/protection`, input);
209
- return new PublicationInstance(response.data, this.client, this.notebookId);
210
- }
211
- async protection() {
212
- const response = await this.client.get(`/publications/${this.data.id}/protection`);
213
- return response.data;
214
- }
215
- async createProtectionSession() {
216
- const response = await this.client.post(`/publications/${this.data.id}/protection/session`);
217
- return response.data;
218
- }
219
- async disableProtection() {
220
- const response = await this.client.delete(`/publications/${this.data.id}/protection`);
221
- return new PublicationInstance(response.data, this.client, this.notebookId);
222
- }
223
- }
224
- function publicationStatusIsTerminal(status) {
225
- return ['healthy', 'failed', 'stopped', 'deleted', 'delete_failed'].includes(status);
226
- }
227
- function delay(ms) {
228
- return new Promise((resolve) => setTimeout(resolve, ms));
229
- }
230
132
  class AsyncPublishEventQueue {
231
133
  constructor() {
232
134
  this.values = [];
@@ -363,27 +265,3 @@ function parseSSEBlock(block) {
363
265
  return { event: eventType, data };
364
266
  }
365
267
  }
366
- function parseNdjsonStream(input, schema) {
367
- const decoder = new TextDecoder();
368
- let buffer = '';
369
- return input.pipeThrough(new TransformStream({
370
- transform(chunk, controller) {
371
- buffer += decoder.decode(chunk, { stream: true });
372
- const lines = buffer.split('\n');
373
- buffer = lines.pop() ?? '';
374
- for (const line of lines) {
375
- const trimmed = line.trim();
376
- if (trimmed !== '') {
377
- controller.enqueue(schema.parse(JSON.parse(trimmed)));
378
- }
379
- }
380
- },
381
- flush(controller) {
382
- buffer += decoder.decode();
383
- const trimmed = buffer.trim();
384
- if (trimmed !== '') {
385
- controller.enqueue(schema.parse(JSON.parse(trimmed)));
386
- }
387
- },
388
- }));
389
- }
@@ -0,0 +1,303 @@
1
+ import type { LaravelCloudSetupState, LaravelCloudProviderData, LaravelCloudProviderInput } from './providers/laravel-cloud.js';
2
+ export type * from './providers/laravel-cloud.js';
3
+ import type { PublicationBuildStatus, PublicationJurisdiction, PublicationProtectionMode, PublicationRegion, PublicationReleaseStatus, PublicationSize, PublicationStatus } from '../schemas/publications.js';
4
+ export interface PublicationDestroyOptions {
5
+ deleteResources?: boolean;
6
+ }
7
+ export interface PublicationPlacement {
8
+ regions?: PublicationRegion[];
9
+ jurisdiction?: PublicationJurisdiction;
10
+ }
11
+ export interface PublicationProtectionData {
12
+ mode: PublicationProtectionMode;
13
+ enabled: boolean;
14
+ supported?: boolean;
15
+ token?: string;
16
+ expiresAt?: string;
17
+ url?: string;
18
+ }
19
+ export type PublicationProtectionInput = {
20
+ mode: 'none';
21
+ password?: never;
22
+ } | {
23
+ mode: 'password';
24
+ password: string;
25
+ };
26
+ export interface CloudflareContainersProviderOptions {
27
+ resources?: Partial<Record<PublicationResourceKind, PublicationResourceSelection>>;
28
+ accountId: string;
29
+ size?: PublicationSize;
30
+ sleepAfter?: string;
31
+ placement?: PublicationPlacement;
32
+ instances?: number;
33
+ }
34
+ export interface SshServerProviderOptions {
35
+ serverId: string;
36
+ resources?: Partial<Record<PublicationResourceKind, PublicationResourceSelection>>;
37
+ }
38
+ export type PublicationResourceKind = 'database' | 'cache' | 'storage' | 'worker' | 'scheduler';
39
+ export interface PublicationRequirement {
40
+ kind: PublicationResourceKind;
41
+ required?: boolean;
42
+ recommended?: boolean;
43
+ engine?: string;
44
+ reason?: string;
45
+ }
46
+ export interface PublicationReadiness {
47
+ repository: string | null;
48
+ branch: string | null;
49
+ sourceProvider: string | null;
50
+ requirements: PublicationRequirement[];
51
+ productionVariables: string[];
52
+ missingVariables: string[];
53
+ warnings: string[];
54
+ }
55
+ export type PublicationResourceMode = 'none' | 'create' | 'reuse' | 'external' | 'enable';
56
+ export interface PublicationResourceSelection {
57
+ mode: PublicationResourceMode;
58
+ id?: string;
59
+ type?: string;
60
+ version?: string;
61
+ size?: string;
62
+ config?: Record<string, string | number | boolean | null>;
63
+ }
64
+ export type PublicationPlanProviderInput<TName extends PublicationProviderName = PublicationProviderName> = {
65
+ [Name in TName]: {
66
+ name: Name;
67
+ } & Partial<PublicationProviderInputs[Name]>;
68
+ }[TName];
69
+ export interface PublicationPlanInput<TName extends PublicationProviderName = PublicationProviderName> {
70
+ slug?: string;
71
+ provider: PublicationPlanProviderInput<TName>;
72
+ requirements?: PublicationRequirement[];
73
+ resources?: Partial<Record<PublicationResourceKind, PublicationResourceSelection>>;
74
+ }
75
+ export type PlannedPublishInput = PublishInput & Pick<PublicationPlanInput, 'requirements' | 'resources'>;
76
+ export interface PublicationAccessCapabilities {
77
+ routing: 'platform' | 'provider';
78
+ protection: boolean;
79
+ feedback: boolean;
80
+ }
81
+ export interface PublicationCapabilities {
82
+ source: 'git' | 'workspace';
83
+ sourceProviders?: string[];
84
+ resourceCleanup?: boolean;
85
+ resources: Record<PublicationResourceKind, PublicationResourceMode[]>;
86
+ access: {
87
+ managed: PublicationAccessCapabilities;
88
+ custom: PublicationAccessCapabilities;
89
+ };
90
+ }
91
+ export interface PublicationCatalogConfigField {
92
+ name: string;
93
+ type: string;
94
+ required: boolean;
95
+ label?: string;
96
+ nullable?: boolean;
97
+ description?: string;
98
+ min?: number;
99
+ max?: number;
100
+ enum?: Array<string | number>;
101
+ example?: string | number;
102
+ }
103
+ export interface PublicationCatalogResourceType {
104
+ kind: PublicationResourceKind;
105
+ type: string;
106
+ label: string;
107
+ versions: string[];
108
+ regions: string[];
109
+ sizes: {
110
+ id: string;
111
+ label: string;
112
+ }[];
113
+ configFields: PublicationCatalogConfigField[];
114
+ }
115
+ export interface PublicationResourceCatalog {
116
+ provider: PublicationProviderName;
117
+ scope: string | null;
118
+ capabilities: PublicationCapabilities;
119
+ regions: {
120
+ id: string;
121
+ label: string;
122
+ flag?: string;
123
+ }[];
124
+ resourceTypes: PublicationCatalogResourceType[];
125
+ resources: {
126
+ id: string;
127
+ name: string;
128
+ kind: PublicationResourceKind;
129
+ type: string | null;
130
+ version: string | null;
131
+ region: string | null;
132
+ status: string;
133
+ }[];
134
+ pricingUrl: string | null;
135
+ }
136
+ export interface PublicationPlan<TName extends PublicationProviderName = PublicationProviderName> {
137
+ provider: TName;
138
+ capabilities: PublicationCapabilities;
139
+ readiness: PublicationReadiness;
140
+ source: {
141
+ type: 'git' | 'workspace';
142
+ repository: string | null;
143
+ branch: string | null;
144
+ commitAndPush: boolean;
145
+ providerAccess: 'verified' | 'confirmed' | 'confirmation_required' | 'not_required';
146
+ };
147
+ resources: Array<{
148
+ kind: PublicationResourceKind;
149
+ mode: PublicationResourceMode | 'unconfigured';
150
+ engine: string | null;
151
+ required: boolean;
152
+ recommended: boolean;
153
+ supported: boolean;
154
+ selection: PublicationResourceSelection | boolean | null;
155
+ }>;
156
+ blockers: Array<{
157
+ code: string;
158
+ message: string;
159
+ }>;
160
+ ready: boolean;
161
+ input: PublicationPlanInput<TName>;
162
+ cost: {
163
+ status: 'unknown';
164
+ message: string;
165
+ };
166
+ }
167
+ export interface PublicationDnsInstructions {
168
+ stage: 'ownership' | 'traffic' | 'connected';
169
+ records: PublicationDnsRecord[];
170
+ trafficRecords: PublicationDnsRecord[];
171
+ }
172
+ export interface PublicationProviderInputs {
173
+ 'cloudflare-containers': CloudflareContainersProviderOptions;
174
+ 'ssh-server': SshServerProviderOptions;
175
+ 'laravel-cloud': LaravelCloudProviderInput;
176
+ }
177
+ export interface PublicationProviderData {
178
+ 'cloudflare-containers': CloudflareContainersProviderOptions;
179
+ 'ssh-server': SshServerProviderOptions;
180
+ 'laravel-cloud': LaravelCloudProviderData;
181
+ }
182
+ export type PublicationProviderName = Extract<keyof PublicationProviderInputs, string>;
183
+ export type PublicationProviderInput<TName extends PublicationProviderName = PublicationProviderName> = {
184
+ [Name in TName]: {
185
+ name: Name;
186
+ } & PublicationProviderInputs[Name];
187
+ }[TName];
188
+ export type PublicationProvider<TName extends PublicationProviderName = PublicationProviderName> = {
189
+ [Name in TName]: {
190
+ name: Name;
191
+ } & PublicationProviderData[Name];
192
+ }[TName];
193
+ export interface PublishInput<TName extends PublicationProviderName = PublicationProviderName> {
194
+ slug: string;
195
+ provider: PublicationProviderInput<TName>;
196
+ protection?: PublicationProtectionInput;
197
+ metadata?: Record<string, unknown>;
198
+ }
199
+ export interface PublicationBuildData<TProvider extends PublicationProviderName = PublicationProviderName> {
200
+ id: string;
201
+ status: PublicationBuildStatus;
202
+ strategy: string;
203
+ provider: PublicationProvider<TProvider>;
204
+ errorMessage: string | null;
205
+ startedAt: string | null;
206
+ finishedAt: string | null;
207
+ }
208
+ export interface PublicationReleaseData {
209
+ id: string;
210
+ status: PublicationReleaseStatus;
211
+ manifest: Record<string, unknown>;
212
+ }
213
+ export interface PublicationData<TProvider extends PublicationProviderName = PublicationProviderName> {
214
+ capabilities?: PublicationCapabilities;
215
+ id: string;
216
+ slug: string;
217
+ url: string;
218
+ status: PublicationStatus;
219
+ strategy: string;
220
+ provider: PublicationProvider<TProvider>;
221
+ protection: PublicationProtectionData;
222
+ eventStreamUrl: string | null;
223
+ originUrl: string | null;
224
+ domains?: PublicationDomainData[];
225
+ setupState?: LaravelCloudSetupState | null;
226
+ currentRelease?: PublicationReleaseData | null;
227
+ latestBuild?: PublicationBuildData<TProvider> | null;
228
+ deployedAt: string | null;
229
+ createdAt: string | null;
230
+ updatedAt: string | null;
231
+ }
232
+ export interface UpdatePublicationProtectionInput {
233
+ mode: PublicationProtectionMode;
234
+ password?: string;
235
+ }
236
+ export interface PublicationProtectionSessionData {
237
+ previewSessionId: string;
238
+ token: string;
239
+ expiresAt: string;
240
+ url: string;
241
+ }
242
+ export interface PublicationDnsRecord {
243
+ type: string;
244
+ name: string;
245
+ value: string;
246
+ purpose?: 'ownership' | 'certificate' | 'traffic';
247
+ }
248
+ export interface PublicationDomainData {
249
+ id: string;
250
+ publicationId: string | null;
251
+ hostname: string;
252
+ status: string;
253
+ provider: string;
254
+ providerHostnameId: string | null;
255
+ dns: {
256
+ type: string | null;
257
+ name: string | null;
258
+ value: string | null;
259
+ };
260
+ ssl: {
261
+ status: string | null;
262
+ };
263
+ dnsInstructions: PublicationDnsInstructions;
264
+ validationErrors: unknown[];
265
+ validationRecords: unknown[];
266
+ metadata: Record<string, unknown>;
267
+ verifiedAt: string | null;
268
+ createdAt: string | null;
269
+ updatedAt: string | null;
270
+ }
271
+ export interface PublicationManagedResource {
272
+ id: string;
273
+ parentId: string | null;
274
+ provider: PublicationProviderName;
275
+ scope: string;
276
+ providerId: string;
277
+ kind: 'database' | 'cache' | 'storage';
278
+ name: string;
279
+ type: string | null;
280
+ version: string | null;
281
+ managed: boolean;
282
+ status: 'pending' | 'provisioning' | 'available' | 'unknown' | 'retained' | 'deleting' | 'delete_failed' | 'deleted';
283
+ observation?: {
284
+ status: 'present' | 'missing' | 'unreachable' | 'unauthorized' | 'unsupported';
285
+ message: string;
286
+ checkedAt: string;
287
+ } | null;
288
+ attachments: PublicationResourceAttachment[];
289
+ attachmentCount: number;
290
+ createdAt: string;
291
+ }
292
+ export interface PublicationResourceListOptions {
293
+ provider?: PublicationProviderName;
294
+ kind?: PublicationManagedResource['kind'];
295
+ type?: string;
296
+ scope?: string;
297
+ page?: number;
298
+ }
299
+ export interface PublicationResourceAttachment {
300
+ notebookId: string | null;
301
+ publicationId: string | null;
302
+ detachedAt: string | null;
303
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -7,7 +7,7 @@ export declare class RestRuntimeInvoker {
7
7
  private ticket;
8
8
  private refreshPromise;
9
9
  private readonly notebookId;
10
- constructor(data: NotebookData, fetch: typeof globalThis.fetch, refresh?: () => Promise<string>);
10
+ constructor(data: NotebookData, fetch: typeof globalThis.fetch, refresh?: (() => Promise<string>) | undefined);
11
11
  private configure;
12
12
  ready(): Promise<NotebookInitSuccessResult>;
13
13
  supports(action: string): action is RestRuntimeAction;