craterview 0.3.13 → 0.3.16

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.
Files changed (2) hide show
  1. package/index.ts +26 -1
  2. package/package.json +2 -1
package/index.ts CHANGED
@@ -18,7 +18,7 @@ import { imageSize } from "image-size";
18
18
  // Mirrored from package.json, which is the number a release bumps. It cannot be imported
19
19
  // from there — this ships as TypeScript, so the import would have to resolve in the
20
20
  // consumer's toolchain — so test/version.test.ts asserts the two agree.
21
- export const VERSION = "0.3.13";
21
+ export const VERSION = "0.3.16";
22
22
  const DEFAULT_BASE_URL = "https://api.craterview.ai";
23
23
  // The server rejects a longer wait outright, so asking for one costs a 422 rather than the
24
24
  // wait you asked for. `run()` clamps to this rather than letting that happen.
@@ -331,6 +331,13 @@ export interface WebhookEvent extends Required<JobData> {}
331
331
 
332
332
  export type JobStatus = "queued" | "running" | "succeeded" | "failed";
333
333
 
334
+ /** A job's standing with the public gallery: `pending` under review, `approved` once shown. */
335
+ export interface GalleryState {
336
+ status: "pending" | "approved";
337
+ /** The submission's id, which is what withdrawing it takes. */
338
+ post_id: string;
339
+ }
340
+
334
341
  /** The API's job representation, exactly as it arrives. Snake case is the wire's. */
335
342
  export interface JobData {
336
343
  id: string;
@@ -366,6 +373,18 @@ export interface JobData {
366
373
  eta_seconds?: number | null;
367
374
  /** Retained past the ordinary expiry because its owner asked, links and all. */
368
375
  kept?: boolean;
376
+ /**
377
+ * Whether the kept copy includes the image you sent as well as the result. It does when
378
+ * you kept the job while the original was still there; false when only the result is
379
+ * kept, and when nothing is.
380
+ */
381
+ kept_original?: boolean;
382
+ /**
383
+ * Where this job stands with the public gallery, when you have offered it: present while
384
+ * it is being reviewed or shown, absent or null when it is not offered — including after
385
+ * you withdraw it.
386
+ */
387
+ gallery?: GalleryState | null;
369
388
  community?: boolean;
370
389
  /**
371
390
  * Whether an automated check thought this image may fall outside what the service
@@ -427,6 +446,12 @@ export class Job {
427
446
  // checked, and `false` would say it was checked and cleared. The two are different
428
447
  // answers and only one of them is true.
429
448
  get flagged() { return this.data.flagged ?? null; }
449
+ /** Retained past the ordinary expiry because you asked. */
450
+ get kept() { return this.data.kept ?? false; }
451
+ /** Whether the kept copy holds the image you sent as well as the result. */
452
+ get keptOriginal() { return this.data.kept_original ?? false; }
453
+ /** Where this job stands with the public gallery, or null when it is not offered. */
454
+ get gallery() { return this.data.gallery ?? null; }
430
455
  /** The whole answer, including where the file is when there is one. */
431
456
  get result() { return this.data.result ?? null; }
432
457
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "craterview",
3
- "version": "0.3.13",
3
+ "version": "0.3.16",
4
4
  "dependencies": {
5
5
  "image-size": "^2.0.4"
6
6
  },
@@ -26,6 +26,7 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^26.2.0",
29
+ "esbuild": "^0.25.0",
29
30
  "typescript": "^7.0.2",
30
31
  "vitest": "^4.1.11"
31
32
  }