@dropthis/cli 0.4.0 → 0.5.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/README.md +39 -21
- package/dist/cli.cjs +449 -24
- package/dist/cli.cjs.map +1 -1
- package/node_modules/@dropthis/node/README.md +5 -1
- package/node_modules/@dropthis/node/dist/drops-fK63OCk6.d.cts +385 -0
- package/node_modules/@dropthis/node/dist/drops-fK63OCk6.d.ts +385 -0
- package/node_modules/@dropthis/node/dist/edge.cjs +584 -0
- package/node_modules/@dropthis/node/dist/edge.cjs.map +1 -0
- package/node_modules/@dropthis/node/dist/edge.d.cts +49 -0
- package/node_modules/@dropthis/node/dist/edge.d.ts +49 -0
- package/node_modules/@dropthis/node/dist/edge.mjs +557 -0
- package/node_modules/@dropthis/node/dist/edge.mjs.map +1 -0
- package/node_modules/@dropthis/node/dist/index.cjs +64 -37
- package/node_modules/@dropthis/node/dist/index.cjs.map +1 -1
- package/node_modules/@dropthis/node/dist/index.d.cts +9 -378
- package/node_modules/@dropthis/node/dist/index.d.ts +9 -378
- package/node_modules/@dropthis/node/dist/index.mjs +64 -37
- package/node_modules/@dropthis/node/dist/index.mjs.map +1 -1
- package/node_modules/@dropthis/node/package.json +11 -1
- package/package.json +2 -2
|
@@ -209,7 +209,11 @@ import type {
|
|
|
209
209
|
|
|
210
210
|
## Agent skills
|
|
211
211
|
|
|
212
|
-
For AI coding agents (Cursor, Claude Code, Windsurf, etc.),
|
|
212
|
+
For AI coding agents (Cursor, Claude Code, Windsurf, etc.), install the [dropthis-skills](https://github.com/dropthis-dev/dropthis-skills) package:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
npx skills add dropthis-dev/dropthis-skills
|
|
216
|
+
```
|
|
213
217
|
|
|
214
218
|
## Links
|
|
215
219
|
|
|
@@ -0,0 +1,385 @@
|
|
|
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
|
+
sourceUrl: string;
|
|
288
|
+
title?: string;
|
|
289
|
+
visibility?: "public" | "unlisted";
|
|
290
|
+
metadata?: Record<string, unknown>;
|
|
291
|
+
entry?: string;
|
|
292
|
+
};
|
|
293
|
+
type PublishInput = string | URL | Uint8Array | ExplicitPublishInput;
|
|
294
|
+
|
|
295
|
+
declare class Transport {
|
|
296
|
+
readonly apiKey: string | undefined;
|
|
297
|
+
readonly baseUrl: string;
|
|
298
|
+
readonly timeoutMs: number;
|
|
299
|
+
readonly fetchImpl: typeof globalThis.fetch;
|
|
300
|
+
constructor(options?: DropthisClientOptions | string);
|
|
301
|
+
multipart<T>(method: string, path: string, form: FormData, options?: RequestOptions): Promise<DropthisResult<T>>;
|
|
302
|
+
putSignedUrl(url: string, body: Uint8Array | Blob | ReadableStream, headers: Record<string, string>): Promise<DropthisResult<{
|
|
303
|
+
etag: string | null;
|
|
304
|
+
}>>;
|
|
305
|
+
request<T>(method: string, path: string, options?: RequestOptions & {
|
|
306
|
+
body?: unknown;
|
|
307
|
+
bodyCase?: "snake" | "raw";
|
|
308
|
+
params?: Record<string, string | number | boolean | null | undefined>;
|
|
309
|
+
}): Promise<DropthisResult<T>>;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
declare class AccountResource {
|
|
313
|
+
private readonly transport;
|
|
314
|
+
constructor(transport: Transport);
|
|
315
|
+
get(): Promise<DropthisResult<AccountResponse>>;
|
|
316
|
+
update(input: {
|
|
317
|
+
displayName: string | null;
|
|
318
|
+
}): Promise<DropthisResult<AccountResponse>>;
|
|
319
|
+
delete(): Promise<DropthisResult<null>>;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
declare class ApiKeysResource {
|
|
323
|
+
private readonly transport;
|
|
324
|
+
constructor(transport: Transport);
|
|
325
|
+
list(): Promise<DropthisResult<{
|
|
326
|
+
object: "list";
|
|
327
|
+
data: ApiKeyResponse[];
|
|
328
|
+
}>>;
|
|
329
|
+
create(input: {
|
|
330
|
+
label: string;
|
|
331
|
+
}): Promise<DropthisResult<ApiKeyCreatedResponse>>;
|
|
332
|
+
delete(keyId: string): Promise<DropthisResult<{
|
|
333
|
+
ok: true;
|
|
334
|
+
}>>;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
declare class DeploymentsResource {
|
|
338
|
+
private readonly transport;
|
|
339
|
+
constructor(transport: Transport);
|
|
340
|
+
create(dropId: string, body: Record<string, unknown>, options?: {
|
|
341
|
+
idempotencyKey?: string;
|
|
342
|
+
ifRevision?: number;
|
|
343
|
+
}): Promise<DropthisResult<DropResponse>>;
|
|
344
|
+
createRaw(dropId: string, body: unknown, options?: {
|
|
345
|
+
idempotencyKey?: string;
|
|
346
|
+
ifRevision?: number;
|
|
347
|
+
}): Promise<DropthisResult<DropResponse>>;
|
|
348
|
+
list(dropId: string, params?: ListDeploymentsParams): Promise<DropthisResult<ListDeploymentsResponse>>;
|
|
349
|
+
get(dropId: string, deploymentId: string): Promise<DropthisResult<DropDeploymentResponse>>;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
declare class CursorPage<T> implements ListPage<T> {
|
|
353
|
+
readonly object: "list";
|
|
354
|
+
readonly data: T[];
|
|
355
|
+
readonly hasMore: boolean;
|
|
356
|
+
readonly nextCursor: string | null;
|
|
357
|
+
private readonly fetchNextPage;
|
|
358
|
+
constructor(input: {
|
|
359
|
+
data: T[];
|
|
360
|
+
hasMore: boolean;
|
|
361
|
+
nextCursor: string | null;
|
|
362
|
+
fetchNextPage?: (() => Promise<DropthisResult<CursorPage<T>>>) | undefined;
|
|
363
|
+
});
|
|
364
|
+
autoPagingToArray(options?: {
|
|
365
|
+
limit?: number;
|
|
366
|
+
}): Promise<T[]>;
|
|
367
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<T>;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
declare class DropsResource {
|
|
371
|
+
private readonly transport;
|
|
372
|
+
constructor(transport: Transport);
|
|
373
|
+
create(body: unknown, options?: {
|
|
374
|
+
idempotencyKey?: string;
|
|
375
|
+
}): Promise<DropthisResult<DropResponse>>;
|
|
376
|
+
createRaw(body: unknown, options?: {
|
|
377
|
+
idempotencyKey?: string;
|
|
378
|
+
}): Promise<DropthisResult<DropResponse>>;
|
|
379
|
+
list(params?: ListDropsParams): Promise<DropthisResult<CursorPage<DropResponse>>>;
|
|
380
|
+
get(dropId: string): Promise<DropthisResult<DropResponse>>;
|
|
381
|
+
update(dropId: string, options?: DropOptions & RequestControls): Promise<DropthisResult<DropResponse>>;
|
|
382
|
+
delete(dropId: string): Promise<DropthisResult<null>>;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export { AccountResource as A, type CompleteUploadSessionRequest as C, DeploymentsResource as D, type EmailOtpResponse as E, type Limitations as L, type PrepareOptions as P, type RequestControls as R, type SessionResponse as S, type TierInfo as T, type UploadManifestFile as U, type ActionResolve as a, ApiKeysResource as b, type CreateUploadPartTargetsRequest as c, type CreateUploadPartTargetsResponse as d, type CreateUploadSessionRequest as e, type CreateUploadSessionResponse as f, CursorPage as g, type DropAction as h, type DropDeploymentResponse as i, type DropOptions as j, type DropResponse as k, DropsResource as l, type DropthisClientOptions as m, type DropthisErrorResponse as n, type DropthisResult as o, type ListDeploymentsParams as p, type ListDeploymentsResponse as q, type ListPage as r, type PublishInput as s, type PublishOptions as t, type RequestOptions as u, Transport as v, type UploadPartTarget as w, type UploadSessionFileResponse as x, type UploadSessionResponse as y, type UploadTarget as z };
|