@dropthis/cli 0.4.1 → 0.6.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.
@@ -1,353 +1,5 @@
1
- type DropthisClientOptions = {
2
- apiKey?: string;
3
- baseUrl?: string;
4
- timeoutMs?: number;
5
- fetch?: typeof globalThis.fetch;
6
- };
7
- type RequestOptions = {
8
- authenticated?: boolean;
9
- idempotencyKey?: string;
10
- ifRevision?: number;
11
- timeoutMs?: number;
12
- };
13
- type DropthisErrorResponse = {
14
- code: string;
15
- message: string;
16
- statusCode: number | null;
17
- type?: string;
18
- detail?: unknown;
19
- param?: string | null;
20
- currentRevision?: number;
21
- requestId?: string | null;
22
- suggestion?: string | null;
23
- retryable?: boolean | null;
24
- };
25
- type DropthisResult<T> = {
26
- data: T;
27
- error: null;
28
- headers: Record<string, string>;
29
- } | {
30
- data: null;
31
- error: DropthisErrorResponse;
32
- headers: Record<string, string>;
33
- };
34
- type ActionResolve = {
35
- method: string;
36
- url?: string | null;
37
- endpoint?: string | null;
38
- };
39
- type DropAction = {
40
- code: string;
41
- kind: "api" | "human";
42
- priority: "required" | "suggested";
43
- message: string;
44
- resolve?: ActionResolve | null;
45
- };
46
- type TierInfo = {
47
- name: string;
48
- maxSizeBytes: number;
49
- ttlDays: number | null;
50
- persistent: boolean;
51
- badge: boolean;
52
- };
53
- type Limitations = {
54
- actions: DropAction[];
55
- };
56
- type DropResponse = {
57
- id: string;
58
- slug: string;
59
- url: string;
60
- canonicalHost: string;
61
- deploymentId: string | null;
62
- title: string;
63
- contentType: string;
64
- visibility: string;
65
- status: string;
66
- revision: number;
67
- contentRevision: number;
68
- accessRevision: number;
69
- sizeBytes: number;
70
- renderMode: string;
71
- warnings: Array<Record<string, unknown>>;
72
- createdAt: string;
73
- expiresAt: string | null;
74
- object: string;
75
- accessible: boolean;
76
- persistent: boolean;
77
- badgeApplied: boolean;
78
- tier: TierInfo;
79
- limitations: Limitations;
80
- };
81
- type DropDeploymentResponse = {
82
- id: string;
83
- dropId: string;
84
- revision: number;
85
- status: string;
86
- storagePrefix: string;
87
- entry: string | null;
88
- contentType: string;
89
- renderMode: string;
90
- files: Array<Record<string, unknown>>;
91
- warnings: Array<Record<string, unknown>>;
92
- sizeBytes: number;
93
- classificationVersion: number;
94
- classificationReason: string;
95
- errorCode: string | null;
96
- errorMessage: string | null;
97
- createdAt: string;
98
- readyAt: string | null;
99
- publishedAt: string | null;
100
- };
101
- type ListDeploymentsParams = {
102
- cursor?: string | null;
103
- limit?: number;
104
- };
105
- type ListDeploymentsResponse = {
106
- deployments: DropDeploymentResponse[];
107
- nextCursor: string | null;
108
- };
109
- type ListPage<T> = {
110
- object: "list";
111
- data: T[];
112
- hasMore: boolean;
113
- nextCursor: string | null;
114
- autoPagingToArray(options?: {
115
- limit?: number;
116
- }): Promise<T[]>;
117
- [Symbol.asyncIterator](): AsyncIterableIterator<T>;
118
- };
119
- type Action = {
120
- code: string;
121
- kind: string;
122
- method?: string | null;
123
- endpoint?: string | null;
124
- message: string;
125
- };
126
- type EmailOtpResponse = {
127
- ok: true;
128
- expiresIn: number;
129
- nextAction?: Action | null;
130
- };
131
- type SessionResponse = {
132
- object: "session";
133
- token: string;
134
- accountId: string;
135
- isNewAccount: boolean;
136
- expiresIn: number;
137
- };
138
- type ApiKeyResponse = {
139
- object: "api_key";
140
- id: string;
141
- keyLast4: string;
142
- label: string;
143
- createdAt: string;
144
- };
145
- type ApiKeyCreatedResponse = ApiKeyResponse & {
146
- key: string;
147
- accountId?: string | null;
148
- isNewAccount?: boolean;
149
- };
150
- type AccountResponse = {
151
- id: string;
152
- email: string;
153
- displayName: string | null;
154
- plan: string;
155
- status: string;
156
- createdAt: string;
157
- };
158
- type ListDropsParams = {
159
- cursor?: string | null;
160
- limit?: number;
161
- };
162
- type UploadManifestFile = {
163
- path: string;
164
- contentType: string;
165
- sizeBytes: number;
166
- checksumSha256?: string | null;
167
- };
168
- type CreateUploadSessionRequest = {
169
- schemaVersion?: 1;
170
- files: UploadManifestFile[];
171
- entry?: string | null;
172
- };
173
- type UploadTarget = {
174
- strategy: "single_put" | "multipart";
175
- url: string;
176
- headers: Record<string, string>;
177
- expiresAt: string;
178
- partSize?: number;
179
- partCount?: number;
180
- };
181
- type CreateUploadSessionFileResponse = {
182
- fileId: string;
183
- path: string;
184
- objectKey: string;
185
- upload: UploadTarget;
186
- };
187
- type UploadSessionFileResponse = {
188
- fileId: string;
189
- path: string;
190
- contentType: string;
191
- sizeBytes: number;
192
- objectKey: string;
193
- verified: boolean;
194
- };
195
- type UploadSessionResponse = {
196
- uploadId: string;
197
- status: string;
198
- expiresAt: string;
199
- entry?: string | null;
200
- files: UploadSessionFileResponse[];
201
- nextAction?: Action | null;
202
- };
203
- type CreateUploadSessionResponse = {
204
- uploadId: string;
205
- expiresAt: string;
206
- files: CreateUploadSessionFileResponse[];
207
- nextAction?: Action | null;
208
- };
209
- type CreateUploadPartTargetsRequest = {
210
- fileId: string;
211
- partNumbers: number[];
212
- };
213
- type UploadPartTarget = {
214
- partNumber: number;
215
- url: string;
216
- headers: Record<string, string>;
217
- expiresAt: string;
218
- };
219
- type CreateUploadPartTargetsResponse = {
220
- fileId: string;
221
- urlExpiresAt?: string | null;
222
- parts: UploadPartTarget[];
223
- };
224
- type CompleteUploadSessionRequest = {
225
- files?: Record<string, {
226
- parts?: Array<{
227
- partNumber: number;
228
- etag: string;
229
- }> | null;
230
- }>;
231
- };
232
- type DropOptions = {
233
- /** Change the vanity slug (update only). */
234
- slug?: string;
235
- /** Drop title. */
236
- title?: string;
237
- /** public (default) or unlisted. */
238
- visibility?: "public" | "unlisted";
239
- /** Require password to view. Pass `null` to remove password protection. */
240
- password?: string | null;
241
- /** Prevent search-engine indexing. Pass `null` to allow indexing (default). */
242
- noindex?: boolean | null;
243
- /** Auto-delete after this ISO 8601 date. Pass `null` to clear. */
244
- expiresAt?: string | Date | null;
245
- /** Entry file for multi-file bundles (default: index.html). */
246
- entry?: string;
247
- /** Attach JSON key-value pairs, e.g. `{ source: "ci" }`. */
248
- metadata?: Record<string, unknown>;
249
- };
250
- type PrepareOptions = {
251
- /** Glob patterns to ignore when publishing directories. */
252
- ignore?: string[];
253
- /** Disable default ignore patterns. */
254
- ignoreDefaults?: boolean;
255
- /** Override MIME type (auto-detected from extension). */
256
- contentType?: string;
257
- /** Set filename when publishing from stdin or bytes. */
258
- path?: string;
259
- };
260
- type RequestControls = {
261
- /** Prevent duplicate publishes on retry (auto-generated by CLI). */
262
- idempotencyKey?: string;
263
- /** Fail if current revision doesn't match -- optimistic lock (update only). */
264
- ifRevision?: number;
265
- };
266
- type PublishOptions = DropOptions & PrepareOptions & RequestControls;
267
- type ExplicitPublishInput = {
268
- content: string;
269
- contentType?: string;
270
- title?: string;
271
- visibility?: "public" | "unlisted";
272
- metadata?: Record<string, unknown>;
273
- entry?: string;
274
- } | {
275
- files: Array<{
276
- path: string;
277
- content?: string;
278
- contentBase64?: string;
279
- bytes?: Uint8Array;
280
- contentType: string;
281
- }>;
282
- title?: string;
283
- visibility?: "public" | "unlisted";
284
- metadata?: Record<string, unknown>;
285
- entry?: string;
286
- };
287
- type PublishInput = string | Uint8Array | ExplicitPublishInput;
288
-
289
- type PreparedUploadFile = {
290
- path: string;
291
- contentType: string;
292
- sizeBytes: number;
293
- checksumSha256?: string;
294
- source: {
295
- kind: "path";
296
- path: string;
297
- } | {
298
- kind: "bytes";
299
- bytes: Uint8Array;
300
- };
301
- };
302
- type PreparedPublishRequest = {
303
- kind: "staged";
304
- manifest: CreateUploadSessionRequest;
305
- files: PreparedUploadFile[];
306
- options: Record<string, unknown>;
307
- metadata?: Record<string, unknown>;
308
- };
309
-
310
- declare class Transport {
311
- readonly apiKey: string | undefined;
312
- readonly baseUrl: string;
313
- readonly timeoutMs: number;
314
- readonly fetchImpl: typeof globalThis.fetch;
315
- constructor(options?: DropthisClientOptions | string);
316
- multipart<T>(method: string, path: string, form: FormData, options?: RequestOptions): Promise<DropthisResult<T>>;
317
- putSignedUrl(url: string, body: Uint8Array | Blob | ReadableStream, headers: Record<string, string>): Promise<DropthisResult<{
318
- etag: string | null;
319
- }>>;
320
- request<T>(method: string, path: string, options?: RequestOptions & {
321
- body?: unknown;
322
- bodyCase?: "snake" | "raw";
323
- params?: Record<string, string | number | boolean | null | undefined>;
324
- }): Promise<DropthisResult<T>>;
325
- }
326
-
327
- declare class AccountResource {
328
- private readonly transport;
329
- constructor(transport: Transport);
330
- get(): Promise<DropthisResult<AccountResponse>>;
331
- update(input: {
332
- displayName: string | null;
333
- }): Promise<DropthisResult<AccountResponse>>;
334
- delete(): Promise<DropthisResult<null>>;
335
- }
336
-
337
- declare class ApiKeysResource {
338
- private readonly transport;
339
- constructor(transport: Transport);
340
- list(): Promise<DropthisResult<{
341
- object: "list";
342
- data: ApiKeyResponse[];
343
- }>>;
344
- create(input: {
345
- label: string;
346
- }): Promise<DropthisResult<ApiKeyCreatedResponse>>;
347
- delete(keyId: string): Promise<DropthisResult<{
348
- ok: true;
349
- }>>;
350
- }
1
+ import { w as Transport, m as DropthisResult, E as EmailOtpResponse, S as SessionResponse, c as CreateUploadSessionRequest, d as CreateUploadSessionResponse, y as UploadSessionResponse, C as CompleteUploadSessionRequest, k as DropthisClientOptions, b as ApiKeysResource, A as AccountResource, j as DropsResource, D as DeploymentsResource, t as PublishInput, u as PublishOptions, q as PreparedPublishRequest, i as DropResponse, h as DropOptions, R as RequestControls } from './drops-BPdmUPCT.js';
2
+ export { a as ActionResolve, e as CursorPage, f as DropAction, g as DropDeploymentResponse, l as DropthisErrorResponse, I as InMemoryPublishInput, L as Limitations, n as ListDeploymentsParams, o as ListDeploymentsResponse, p as ListPage, P as PrepareOptions, r as PreparedUploadFile, s as PublishFileInput, v as RequestOptions, T as TierInfo, U as UploadManifestFile, x as UploadSessionFileResponse, z as UploadTarget } from './drops-BPdmUPCT.js';
351
3
 
352
4
  declare class AuthResource {
353
5
  private readonly transport;
@@ -364,54 +16,6 @@ declare class AuthResource {
364
16
  }>>;
365
17
  }
366
18
 
367
- declare class DeploymentsResource {
368
- private readonly transport;
369
- constructor(transport: Transport);
370
- create(dropId: string, body: Record<string, unknown>, options?: {
371
- idempotencyKey?: string;
372
- ifRevision?: number;
373
- }): Promise<DropthisResult<DropResponse>>;
374
- createRaw(dropId: string, body: unknown, options?: {
375
- idempotencyKey?: string;
376
- ifRevision?: number;
377
- }): Promise<DropthisResult<DropResponse>>;
378
- list(dropId: string, params?: ListDeploymentsParams): Promise<DropthisResult<ListDeploymentsResponse>>;
379
- get(dropId: string, deploymentId: string): Promise<DropthisResult<DropDeploymentResponse>>;
380
- }
381
-
382
- declare class CursorPage<T> implements ListPage<T> {
383
- readonly object: "list";
384
- readonly data: T[];
385
- readonly hasMore: boolean;
386
- readonly nextCursor: string | null;
387
- private readonly fetchNextPage;
388
- constructor(input: {
389
- data: T[];
390
- hasMore: boolean;
391
- nextCursor: string | null;
392
- fetchNextPage?: (() => Promise<DropthisResult<CursorPage<T>>>) | undefined;
393
- });
394
- autoPagingToArray(options?: {
395
- limit?: number;
396
- }): Promise<T[]>;
397
- [Symbol.asyncIterator](): AsyncIterableIterator<T>;
398
- }
399
-
400
- declare class DropsResource {
401
- private readonly transport;
402
- constructor(transport: Transport);
403
- create(body: unknown, options?: {
404
- idempotencyKey?: string;
405
- }): Promise<DropthisResult<DropResponse>>;
406
- createRaw(body: unknown, options?: {
407
- idempotencyKey?: string;
408
- }): Promise<DropthisResult<DropResponse>>;
409
- list(params?: ListDropsParams): Promise<DropthisResult<CursorPage<DropResponse>>>;
410
- get(dropId: string): Promise<DropthisResult<DropResponse>>;
411
- update(dropId: string, options?: DropOptions & RequestControls): Promise<DropthisResult<DropResponse>>;
412
- delete(dropId: string): Promise<DropthisResult<null>>;
413
- }
414
-
415
19
  declare class UploadsResource {
416
20
  private readonly transport;
417
21
  constructor(transport: Transport);
@@ -419,7 +23,6 @@ declare class UploadsResource {
419
23
  idempotencyKey?: string;
420
24
  }): Promise<DropthisResult<CreateUploadSessionResponse>>;
421
25
  get(uploadId: string): Promise<DropthisResult<UploadSessionResponse>>;
422
- createPartTargets(uploadId: string, body: CreateUploadPartTargetsRequest): Promise<DropthisResult<CreateUploadPartTargetsResponse>>;
423
26
  complete(uploadId: string, body: CompleteUploadSessionRequest, options?: {
424
27
  idempotencyKey?: string;
425
28
  }): Promise<DropthisResult<UploadSessionResponse>>;
@@ -445,25 +48,27 @@ declare class Dropthis {
445
48
  publish(input: PublishInput, options?: PublishOptions): Promise<DropthisResult<DropResponse>>;
446
49
  deploy(dropId: string, input: PublishInput, options?: PublishOptions): Promise<DropthisResult<DropResponse>>;
447
50
  update(dropId: string, options?: DropOptions & RequestControls): Promise<DropthisResult<DropResponse>>;
448
- request<T>(method: string, path: string, options?: RequestOptions & {
449
- body?: unknown;
450
- params?: Record<string, string | number | boolean | null | undefined>;
451
- }): Promise<DropthisResult<T>>;
452
- requestSignedUpload(url: string, bytes: Uint8Array | Blob | ReadableStream, headers: Record<string, string>): Promise<DropthisResult<{
453
- etag: string | null;
454
- }>>;
455
51
  }
456
52
 
457
53
  declare function redactSecrets(message: string): string;
458
54
  declare function createErrorResult<T>(code: string, message: string, statusCode: number | null, extra?: {
459
55
  type?: string;
460
- detail?: unknown;
56
+ title?: string;
57
+ detail?: string | null;
58
+ instance?: string | null;
461
59
  param?: string | null;
462
60
  currentRevision?: number;
463
61
  requestId?: string | null;
464
62
  headers?: Record<string, string>;
465
63
  suggestion?: string | null;
466
64
  retryable?: boolean | null;
65
+ body?: unknown;
467
66
  }): DropthisResult<T>;
67
+ declare class PublishInputError extends Error {
68
+ readonly code: string;
69
+ readonly param?: string | undefined;
70
+ readonly suggestion?: string | undefined;
71
+ constructor(code: string, message: string, param?: string | undefined, suggestion?: string | undefined);
72
+ }
468
73
 
469
- export { type ActionResolve, type CompleteUploadSessionRequest, type CreateUploadPartTargetsRequest, type CreateUploadPartTargetsResponse, type CreateUploadSessionRequest, type CreateUploadSessionResponse, CursorPage, DeploymentsResource, type DropAction, type DropDeploymentResponse, type DropOptions, type DropResponse, Dropthis, type DropthisClientOptions, type DropthisErrorResponse, type DropthisResult, type Limitations, type ListDeploymentsParams, type ListDeploymentsResponse, type ListPage, type PrepareOptions, type PreparedPublishRequest, type PreparedUploadFile, type PublishOptions, type RequestControls, type RequestOptions, type TierInfo, type UploadManifestFile, type UploadPartTarget, type UploadSessionFileResponse, type UploadSessionResponse, type UploadTarget, UploadsResource, createErrorResult, redactSecrets };
74
+ export { CompleteUploadSessionRequest, CreateUploadSessionRequest, CreateUploadSessionResponse, DeploymentsResource, DropOptions, DropResponse, Dropthis, DropthisClientOptions, DropthisResult, PreparedPublishRequest, PublishInput, PublishInputError, PublishOptions, RequestControls, UploadSessionResponse, UploadsResource, createErrorResult, redactSecrets };