craterview 0.4.31 → 0.4.34

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 (3) hide show
  1. package/README.md +22 -0
  2. package/index.ts +8 -4
  3. package/package.json +16 -2
package/README.md CHANGED
@@ -28,6 +28,28 @@ both: it reads an image's dimensions from its header — nothing is decoded —
28
28
  can tell the API how big your file is and `etaSeconds` is estimated for that file rather
29
29
  than for a typical one. `fetch`, `Blob` and `crypto.getRandomValues` are standard in both.
30
30
 
31
+ ## What it does
32
+
33
+ Each model has its own page on the site:
34
+
35
+ - [AI photo enhancer and upscaler](https://craterview.ai/features/enhance): `cv-enhance-v3`
36
+ enlarges a photo and rebuilds its fine detail at the new size.
37
+ - [AI photo denoiser for grainy, low-light shots](https://craterview.ai/features/denoise):
38
+ `cv-denoise-v1` takes out the grain and keeps the colours, light and detail.
39
+ - [AI photo restoration for old, damaged prints](https://craterview.ai/features/restore):
40
+ `cv-restore-v1` removes tears, creases, scratches and dust and corrects faded colour.
41
+ - [AI face enhancer for group photos](https://craterview.ai/features/small-faces):
42
+ `cv-faces-v1` redraws faces too small or blurred to look natural.
43
+ - [AI headshot generator from a snapshot](https://craterview.ai/features/headshot):
44
+ `cv-headshot-v1` turns a photo of a person into a professional headshot.
45
+ - [AI image detector](https://craterview.ai/features/real-or-ai): `cv-real-check-v2`
46
+ estimates whether an image was made by a generative model.
47
+ - [AI content moderation for images](https://craterview.ai/features/content-moderation):
48
+ `cv-content-check-v1` screens an image against the content policy.
49
+
50
+ [All features](https://craterview.ai/features) are on one page. What each model costs, its
51
+ limits and its parameters are in the catalogue: `cv.models()`.
52
+
31
53
  ## Quickstart
32
54
 
33
55
  ```ts
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.4.31";
21
+ export const VERSION = "0.4.34";
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.
@@ -1110,8 +1110,12 @@ export class CraterView {
1110
1110
  }
1111
1111
 
1112
1112
  /**
1113
- * Mint another key. **The value is in this response and nowhere else** — keys are stored
1114
- * as hashes, so one that is not written down has to be replaced rather than recovered.
1113
+ * Mint another key, named for what will use it. **The value is in this response and
1114
+ * nowhere else** — keys are stored as hashes, so one that is not written down has to be
1115
+ * replaced rather than recovered.
1116
+ *
1117
+ * The name is required: every key on the account is listed by it, with `keys()` and on the
1118
+ * account page, and it is how you tell one from another when you come to revoke one.
1115
1119
  *
1116
1120
  * Several keys on an account is the ordinary arrangement, one per service or environment.
1117
1121
  * They share the account's credits and history. This is also how you rotate without
@@ -1120,7 +1124,7 @@ export class CraterView {
1120
1124
  * An account is given a limited number of new keys an hour, whichever of its keys asks:
1121
1125
  * past it this throws `RateLimited`, whose `retryAfter` says when to ask again.
1122
1126
  */
1123
- async createKey(name = "api"): Promise<NewKey> {
1127
+ async createKey(name: string): Promise<NewKey> {
1124
1128
  return await this.request("POST", "/v1/keys", { name }) as NewKey;
1125
1129
  }
1126
1130
 
package/package.json CHANGED
@@ -1,10 +1,24 @@
1
1
  {
2
2
  "name": "craterview",
3
- "version": "0.4.31",
3
+ "version": "0.4.34",
4
4
  "dependencies": {
5
5
  "image-size": "^2.0.4"
6
6
  },
7
- "description": "TypeScript client for the CraterView.ai image enhancement API",
7
+ "description": "TypeScript client for the CraterView.ai API: AI photo upscaling, denoising, restoration, headshots and AI image detection",
8
+ "keywords": [
9
+ "upscaling",
10
+ "super-resolution",
11
+ "image-restoration",
12
+ "api-client",
13
+ "image-upscaler",
14
+ "photo-enhancer",
15
+ "denoising",
16
+ "photo-restoration",
17
+ "headshot",
18
+ "ai-image-detector",
19
+ "content-moderation",
20
+ "typescript"
21
+ ],
8
22
  "type": "module",
9
23
  "main": "index.ts",
10
24
  "types": "index.ts",