domeneshop-mcp 1.0.1 → 1.0.3

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 (60) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +230 -104
  3. package/dist/domeneshop/assert.d.ts +0 -7
  4. package/dist/domeneshop/assert.d.ts.map +1 -1
  5. package/dist/domeneshop/assert.js +0 -7
  6. package/dist/domeneshop/assert.js.map +1 -1
  7. package/dist/domeneshop/client.d.ts +1 -6
  8. package/dist/domeneshop/client.d.ts.map +1 -1
  9. package/dist/domeneshop/client.js +1 -5
  10. package/dist/domeneshop/client.js.map +1 -1
  11. package/dist/domeneshop/http.d.ts +2 -23
  12. package/dist/domeneshop/http.d.ts.map +1 -1
  13. package/dist/domeneshop/http.js +0 -11
  14. package/dist/domeneshop/http.js.map +1 -1
  15. package/dist/domeneshop/resources/dns.d.ts +0 -12
  16. package/dist/domeneshop/resources/dns.d.ts.map +1 -1
  17. package/dist/domeneshop/resources/dns.js +0 -4
  18. package/dist/domeneshop/resources/dns.js.map +1 -1
  19. package/dist/domeneshop/resources/domains.d.ts +0 -2
  20. package/dist/domeneshop/resources/domains.d.ts.map +1 -1
  21. package/dist/domeneshop/resources/domains.js +0 -2
  22. package/dist/domeneshop/resources/domains.js.map +1 -1
  23. package/dist/domeneshop/resources/dyndns.d.ts +1 -5
  24. package/dist/domeneshop/resources/dyndns.d.ts.map +1 -1
  25. package/dist/domeneshop/resources/dyndns.js +1 -5
  26. package/dist/domeneshop/resources/dyndns.js.map +1 -1
  27. package/dist/domeneshop/resources/forwards.d.ts +1 -12
  28. package/dist/domeneshop/resources/forwards.d.ts.map +1 -1
  29. package/dist/domeneshop/resources/forwards.js +1 -13
  30. package/dist/domeneshop/resources/forwards.js.map +1 -1
  31. package/dist/domeneshop/resources/invoices.d.ts +3 -7
  32. package/dist/domeneshop/resources/invoices.d.ts.map +1 -1
  33. package/dist/domeneshop/resources/invoices.js +3 -7
  34. package/dist/domeneshop/resources/invoices.js.map +1 -1
  35. package/dist/mcp/annotations.d.ts +4 -6
  36. package/dist/mcp/annotations.d.ts.map +1 -1
  37. package/dist/mcp/annotations.js +4 -6
  38. package/dist/mcp/annotations.js.map +1 -1
  39. package/dist/mcp/result.d.ts +1 -3
  40. package/dist/mcp/result.d.ts.map +1 -1
  41. package/dist/mcp/result.js +1 -3
  42. package/dist/mcp/result.js.map +1 -1
  43. package/dist/mcp/schema.d.ts +0 -1
  44. package/dist/mcp/schema.d.ts.map +1 -1
  45. package/dist/mcp/server.d.ts +0 -1
  46. package/dist/mcp/server.d.ts.map +1 -1
  47. package/dist/mcp/server.js +0 -1
  48. package/dist/mcp/server.js.map +1 -1
  49. package/dist/mcp/tool.d.ts +1 -4
  50. package/dist/mcp/tool.d.ts.map +1 -1
  51. package/dist/mcp/tool.js +1 -4
  52. package/dist/mcp/tool.js.map +1 -1
  53. package/dist/mcp/tools/dns.d.ts.map +1 -1
  54. package/dist/mcp/tools/dns.js +0 -2
  55. package/dist/mcp/tools/dns.js.map +1 -1
  56. package/dist/version.d.ts +0 -1
  57. package/dist/version.d.ts.map +1 -1
  58. package/dist/version.js +0 -1
  59. package/dist/version.js.map +1 -1
  60. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # domeneshop-mcp
2
2
 
3
+ ## 1.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#11](https://github.com/martinzachariassen/domeneshop-mcp/pull/11) [`fe54cb3`](https://github.com/martinzachariassen/domeneshop-mcp/commit/fe54cb30944801983814540dc4489372308d9a90) Thanks [@martinzachariassen](https://github.com/martinzachariassen)! - Refresh README structure and trim non-essential comments across the codebase.
8
+
9
+ ## 1.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#10](https://github.com/martinzachariassen/domeneshop-mcp/pull/10) [`c21008b`](https://github.com/martinzachariassen/domeneshop-mcp/commit/c21008bf12dd1c9f60aa434439dcddca3b59d499) Thanks [@martinzachariassen](https://github.com/martinzachariassen)! - Document that this is a standard MCP server usable with any MCP-compatible client, not just Claude, and add setup instructions for Claude Desktop, Cursor, VS Code, Codex and other clients alongside Claude Code.
14
+
3
15
  ## 1.0.1
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -1,96 +1,138 @@
1
- # domeneshop-mcp
1
+ <h1 align="center">domeneshop-mcp</h1>
2
2
 
3
- [![CI](https://github.com/martinzachariassen/domeneshop-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/martinzachariassen/domeneshop-mcp/actions/workflows/ci.yml)
4
- [![npm version](https://img.shields.io/npm/v/domeneshop-mcp)](https://www.npmjs.com/package/domeneshop-mcp)
3
+ <p align="center">
4
+ Manage your Domeneshop domains, DNS records, HTTP forwards and invoices from any AI assistant.
5
+ </p>
5
6
 
6
- An [MCP](https://modelcontextprotocol.io) server that exposes the
7
- [Domeneshop API](https://api.domeneshop.no/docs/) as tools, so an AI assistant can
8
- manage your domains, DNS records, HTTP forwards and invoices.
7
+ <p align="center">
8
+ <a href="https://github.com/martinzachariassen/domeneshop-mcp/actions/workflows/ci.yml"><img src="https://github.com/martinzachariassen/domeneshop-mcp/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
9
+ <a href="https://www.npmjs.com/package/domeneshop-mcp"><img src="https://img.shields.io/npm/v/domeneshop-mcp" alt="npm version"></a>
10
+ </p>
9
11
 
10
- Every operation the Domeneshop API offers is available as a tool — 15 of them,
11
- covering domains, DNS, HTTP forwarding, dynamic DNS and invoices.
12
+ <p align="center">
13
+ <a href="https://www.npmjs.com/package/domeneshop-mcp"><b>npm package</b></a>
14
+ &nbsp;·&nbsp;
15
+ <a href="https://api.domeneshop.no/docs/"><b>Domeneshop API</b></a>
16
+ &nbsp;·&nbsp;
17
+ <a href="https://www.domeneshop.no/admin?view=api"><b>Get API credentials</b></a>
18
+ </p>
12
19
 
13
- ## Quick start
14
-
15
- 1. Get an API token and secret from
16
- [domeneshop.no/admin?view=api](https://www.domeneshop.no/admin?view=api).
17
- 2. Register the server with Claude Code:
18
-
19
- ```sh
20
- claude mcp add domeneshop \
21
- --env DOMENESHOP_API_TOKEN=your-token \
22
- --env DOMENESHOP_API_SECRET=your-secret \
23
- -- npx -y domeneshop-mcp
24
- ```
25
-
26
- That's it — ask Claude to list your domains and it will pick up the new
27
- tools. This registers the server for the current project only; add `-s user`
28
- to make it available everywhere. See [Configuration](#configuration) for
29
- Claude Desktop and other MCP clients, and [Tools](#tools) for everything the
30
- server can do.
20
+ An [MCP](https://modelcontextprotocol.io) server that turns the
21
+ [Domeneshop API](https://api.domeneshop.no/docs/) into tools an assistant can call.
22
+ Every operation the API offers is covered — 15 tools across domains, DNS, HTTP
23
+ forwarding, dynamic DNS and invoices.
31
24
 
32
- ## Contents
25
+ It talks MCP over stdio, so it works with **any MCP-compatible client**: Claude
26
+ Code, Claude Desktop, Cursor, VS Code, Codex, Windsurf, Cline and others.
33
27
 
34
- - [Quick start](#quick-start)
35
- - [Requirements](#requirements)
36
- - [Installation](#installation)
37
- - [Configuration](#configuration)
38
- - [Tools](#tools)
39
- - [Notes on the Domeneshop API](#notes-on-the-domeneshop-api)
40
- - [Development](#development)
41
- - [Contributing](#contributing)
42
- - [Security](#security)
43
- - [License](#license)
28
+ ## Quick start
44
29
 
45
- ## Requirements
30
+ You need Node.js 20 or newer and a Domeneshop account.
46
31
 
47
- - A Domeneshop account with API credentials, created at
48
- [domeneshop.no/admin?view=api](https://www.domeneshop.no/admin?view=api).
49
- - Node.js 20 or newer.
32
+ **1. Create an API token and secret** at
33
+ [domeneshop.no/admin?view=api](https://www.domeneshop.no/admin?view=api).
50
34
 
51
- ## Installation
35
+ **2. Register the server.** In Claude Code:
52
36
 
53
37
  ```sh
54
- npm install -g domeneshop-mcp
38
+ claude mcp add domeneshop \
39
+ --env DOMENESHOP_API_TOKEN=your-token \
40
+ --env DOMENESHOP_API_SECRET=your-secret \
41
+ -- npx -y domeneshop-mcp
55
42
  ```
56
43
 
57
- Or run it directly without installing, via `npx`:
44
+ **3. Ask for something.** "List my domains" is enough to confirm the tools loaded.
58
45
 
59
- ```sh
60
- npx domeneshop-mcp
61
- ```
46
+ Using a different client? See [Client setup](#client-setup) below.
62
47
 
63
- ## Configuration
48
+ ## Client setup
64
49
 
65
- The server reads its credentials from two environment variables and refuses to
66
- start without them:
50
+ The server is launched by your client rather than run by hand, and reads its
51
+ credentials from two environment variables:
67
52
 
68
53
  | Variable | Description |
69
54
  | --- | --- |
70
55
  | `DOMENESHOP_API_TOKEN` | API token from the Domeneshop control panel |
71
56
  | `DOMENESHOP_API_SECRET` | The matching API secret |
72
57
 
73
- It speaks MCP over stdio, so it is launched by your MCP client rather than run
74
- directly.
58
+ Most clients take the same **standard config**. Swap in your real token and
59
+ secret wherever you see the placeholders.
60
+
61
+ ```json
62
+ {
63
+ "mcpServers": {
64
+ "domeneshop": {
65
+ "command": "npx",
66
+ "args": ["-y", "domeneshop-mcp"],
67
+ "env": {
68
+ "DOMENESHOP_API_TOKEN": "your-token",
69
+ "DOMENESHOP_API_SECRET": "your-secret"
70
+ }
71
+ }
72
+ }
73
+ }
74
+ ```
75
+
76
+ Most clients can also scope a server to the current project or make it
77
+ available everywhere, usually by choosing which config file you write to. The
78
+ blocks below note this where it applies.
79
+
80
+ <details>
81
+ <summary><strong>Claude Code</strong></summary>
82
+
83
+ Use the CLI command from [Quick start](#quick-start). It defaults to
84
+ `--scope local`, private to you and this project. Use `--scope project` to
85
+ write `<your-project>/.mcp.json` instead, shared via version control, or
86
+ `--scope user` for every project on your account.
75
87
 
76
- ### Claude Code
88
+ You can also pass the standard config as raw JSON:
77
89
 
78
90
  ```sh
79
- claude mcp add domeneshop \
80
- --env DOMENESHOP_API_TOKEN=your-token \
81
- --env DOMENESHOP_API_SECRET=your-secret \
82
- -- npx -y domeneshop-mcp
91
+ claude mcp add-json domeneshop '{"command":"npx","args":["-y","domeneshop-mcp"],"env":{"DOMENESHOP_API_TOKEN":"your-token","DOMENESHOP_API_SECRET":"your-secret"}}'
83
92
  ```
84
93
 
85
- ### Claude Desktop and other clients
94
+ Or write the standard config straight into `<your-project>/.mcp.json`.
95
+
96
+ </details>
97
+
98
+ <details>
99
+ <summary><strong>Claude Desktop</strong></summary>
100
+
101
+ Add the standard config to `claude_desktop_config.json`, reachable from
102
+ Settings → Developer → Edit Config:
103
+
104
+ | Platform | Full path |
105
+ | --- | --- |
106
+ | macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
107
+ | Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
108
+ | Linux (unofficial builds) | `~/.config/Claude/claude_desktop_config.json` |
109
+
110
+ </details>
111
+
112
+ <details>
113
+ <summary><strong>Cursor</strong></summary>
114
+
115
+ Add the standard config to an `mcp.json` file:
116
+
117
+ | Scope | Full path |
118
+ | --- | --- |
119
+ | This project only | `<your-project>/.cursor/mcp.json` |
120
+ | Every project (macOS/Linux) | `~/.cursor/mcp.json` |
121
+ | Every project (Windows) | `%USERPROFILE%\.cursor\mcp.json` |
122
+
123
+ </details>
124
+
125
+ <details>
126
+ <summary><strong>VS Code (GitHub Copilot)</strong></summary>
86
127
 
87
- Add the server to your client's MCP configuration — for Claude Desktop that is
88
- `claude_desktop_config.json`:
128
+ VS Code uses a `servers` key instead of `mcpServers`, and wants an explicit
129
+ `type`. For this project only, add it to `<your-project>/.vscode/mcp.json`:
89
130
 
90
131
  ```json
91
132
  {
92
- "mcpServers": {
133
+ "servers": {
93
134
  "domeneshop": {
135
+ "type": "stdio",
94
136
  "command": "npx",
95
137
  "args": ["-y", "domeneshop-mcp"],
96
138
  "env": {
@@ -102,28 +144,131 @@ Add the server to your client's MCP configuration — for Claude Desktop that is
102
144
  }
103
145
  ```
104
146
 
147
+ For every project, run the command palette action **MCP: Open User
148
+ Configuration** and add the same block there, or register it in one line:
149
+
150
+ ```sh
151
+ code --add-mcp '{"name":"domeneshop","command":"npx","args":["-y","domeneshop-mcp"],"env":{"DOMENESHOP_API_TOKEN":"your-token","DOMENESHOP_API_SECRET":"your-secret"}}'
152
+ ```
153
+
154
+ </details>
155
+
156
+ <details>
157
+ <summary><strong>Codex</strong></summary>
158
+
159
+ Codex CLI reads MCP servers from `mcp_servers` in its config file:
160
+
161
+ | Platform | Full path |
162
+ | --- | --- |
163
+ | macOS/Linux | `~/.codex/config.toml` |
164
+ | Windows | `%USERPROFILE%\.codex\config.toml` |
165
+
166
+ ```toml
167
+ [mcp_servers.domeneshop]
168
+ command = "npx"
169
+ args = ["-y", "domeneshop-mcp"]
170
+ env = { DOMENESHOP_API_TOKEN = "your-token", DOMENESHOP_API_SECRET = "your-secret" }
171
+ ```
172
+
173
+ `codex mcp add domeneshop -- npx -y domeneshop-mcp` registers it from the
174
+ command line, but takes no env flags, so set the two variables in the
175
+ `[mcp_servers.domeneshop]` block it creates.
176
+
177
+ </details>
178
+
179
+ <details>
180
+ <summary><strong>Any other MCP client</strong></summary>
181
+
182
+ Windsurf, Cline, Continue, LM Studio and anything else that runs MCP servers
183
+ over stdio will work. Most use the same shape as the standard config above;
184
+ check your client's documentation for the config file and key name, then point
185
+ it at:
186
+
187
+ - **command**: `npx`
188
+ - **args**: `["-y", "domeneshop-mcp"]`
189
+ - **env**: `DOMENESHOP_API_TOKEN` and `DOMENESHOP_API_SECRET`
190
+
191
+ </details>
192
+
193
+ <details>
194
+ <summary><strong>Skipping npx</strong></summary>
195
+
196
+ To avoid resolving the package on every launch, install it once and use
197
+ `domeneshop-mcp` as the command with no args:
198
+
199
+ ```sh
200
+ npm install -g domeneshop-mcp
201
+ ```
202
+
203
+ </details>
204
+
205
+ ## What you can ask for
206
+
207
+ | Area | Example prompt |
208
+ | --- | --- |
209
+ | Domains | "Which domains are on my account, and when do they renew?" |
210
+ | DNS | "Show every DNS record for example.no" |
211
+ | DNS | "Point blog.example.no at 203.0.113.10" |
212
+ | DNS | "Add the TXT record Google gave me for domain verification" |
213
+ | DNS | "Set up Fastmail's MX records on example.no" |
214
+ | Forwarding | "Forward old.example.no to https://example.no" |
215
+ | Dynamic DNS | "Update home.example.no to my current IP" |
216
+ | Invoices | "List my unpaid Domeneshop invoices" |
217
+
105
218
  ## Tools
106
219
 
107
- Read-only tools are annotated as such, and the tools that overwrite or delete
108
- state are marked destructive, so clients can decide what to run without asking
109
- you first.
220
+ Every tool declares MCP annotations, so clients know which ones are safe to run
221
+ without asking you first. The Access column below mirrors those annotations.
110
222
 
111
223
  ### Domains
112
224
 
113
- | Tool | Description |
114
- | --- | --- |
115
- | `list_domains` | List all domains on the account, optionally filtered by name |
116
- | `get_domain` | Get a single domain by its Domeneshop domain ID |
225
+ | Tool | Access | Description |
226
+ | --- | --- | --- |
227
+ | `list_domains` | Read-only | List all domains on the account, optionally filtered by name |
228
+ | `get_domain` | Read-only | Get a single domain by its Domeneshop domain ID |
117
229
 
118
230
  ### DNS
119
231
 
120
- | Tool | Description |
121
- | --- | --- |
122
- | `list_dns_records` | List a domain's records, optionally filtered by host and type |
123
- | `get_dns_record` | Get a single record by ID |
124
- | `create_dns_record` | Create a record |
125
- | `update_dns_record` | Replace a record (destructive — see the note below) |
126
- | `delete_dns_record` | Delete a record |
232
+ | Tool | Access | Description |
233
+ | --- | --- | --- |
234
+ | `list_dns_records` | Read-only | List a domain's records, optionally filtered by host and type |
235
+ | `get_dns_record` | Read-only | Get a single record by ID |
236
+ | `create_dns_record` | Adds | Create a record |
237
+ | `update_dns_record` | Overwrites | Replace a record — see the warning below |
238
+ | `delete_dns_record` | Deletes | Delete a record |
239
+
240
+ > **Heads up:** `update_dns_record` replaces the whole record rather than
241
+ > patching it. Any field left out is dropped, and omitting `ttl` resets it to
242
+ > the default 3600 seconds. Read the record first if you are only changing part
243
+ > of it.
244
+
245
+ ### HTTP forwarding
246
+
247
+ | Tool | Access | Description |
248
+ | --- | --- | --- |
249
+ | `list_forwards` | Read-only | List a domain's HTTP forwards |
250
+ | `get_forward` | Read-only | Get the forward for one host |
251
+ | `create_forward` | Adds | Create a forward |
252
+ | `update_forward` | Overwrites | Update a forward |
253
+ | `delete_forward` | Deletes | Delete a forward |
254
+
255
+ ### Dynamic DNS
256
+
257
+ | Tool | Access | Description |
258
+ | --- | --- | --- |
259
+ | `update_dyndns` | Overwrites | Point a hostname at a given IP, or at the caller's apparent IP |
260
+
261
+ ### Invoices
262
+
263
+ | Tool | Access | Description |
264
+ | --- | --- | --- |
265
+ | `list_invoices` | Read-only | List invoices from the past three years, optionally filtered by status |
266
+ | `get_invoice` | Read-only | Get a single invoice |
267
+
268
+ ## Reference
269
+
270
+ <details>
271
+ <summary><strong>Supported DNS record types</strong></summary>
127
272
 
128
273
  All eleven record types Domeneshop accepts are supported, with their
129
274
  type-specific fields:
@@ -137,34 +282,13 @@ type-specific fields:
137
282
  | `DS` | `tag`, `alg`, `digest` |
138
283
  | `CAA` | `flags`, `tag` |
139
284
 
140
- `update_dns_record` replaces the whole record rather than patching it: any field
141
- left out is dropped, and omitting `ttl` resets it to the default 3600 seconds.
142
- Read the record first if you are only changing part of it.
143
-
144
- ### HTTP forwarding
145
-
146
- | Tool | Description |
147
- | --- | --- |
148
- | `list_forwards` | List a domain's HTTP forwards |
149
- | `get_forward` | Get the forward for one host |
150
- | `create_forward` | Create a forward |
151
- | `update_forward` | Update a forward |
152
- | `delete_forward` | Delete a forward |
153
-
154
- ### Dynamic DNS
155
-
156
- | Tool | Description |
157
- | --- | --- |
158
- | `update_dyndns` | Point a hostname at a given IP, or at the caller's apparent IP |
159
-
160
- ### Invoices
285
+ The `tag` field is deliberately untyped: it is a numeric key tag for `DS` and a
286
+ property tag such as `issue` for `CAA`, and Domeneshop documents neither.
161
287
 
162
- | Tool | Description |
163
- | --- | --- |
164
- | `list_invoices` | List invoices from the past three years, optionally filtered by status |
165
- | `get_invoice` | Get a single invoice |
288
+ </details>
166
289
 
167
- ## Notes on the Domeneshop API
290
+ <details>
291
+ <summary><strong>Undocumented Domeneshop API behaviour</strong></summary>
168
292
 
169
293
  A few things this server relies on are not in Domeneshop's published OpenAPI
170
294
  spec, but are supported and used by their own client libraries:
@@ -178,8 +302,7 @@ spec, but are supported and used by their own client libraries:
178
302
  only in the `Location` header.
179
303
  - `GET /dyndns/update` answers with a plain-text status line, not JSON.
180
304
 
181
- The `tag` field is deliberately untyped: it is a numeric key tag for `DS` and a
182
- property tag such as `issue` for `CAA`, and Domeneshop documents neither.
305
+ </details>
183
306
 
184
307
  ## Development
185
308
 
@@ -197,7 +320,8 @@ The tests stub the Domeneshop API with a local `node:http` server and drive the
197
320
  MCP server over an in-memory transport, so they need no credentials and make no
198
321
  network calls.
199
322
 
200
- ### Project layout
323
+ <details>
324
+ <summary><strong>Project layout</strong></summary>
201
325
 
202
326
  ```
203
327
  src/
@@ -209,6 +333,8 @@ test/
209
333
  mcp/ End-to-end tool tests, against an in-memory MCP transport
210
334
  ```
211
335
 
336
+ </details>
337
+
212
338
  ## Contributing
213
339
 
214
340
  Issues and pull requests are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md)
@@ -1,9 +1,2 @@
1
- /**
2
- * Asserts that a value is defined, narrowing it and throwing otherwise.
3
- *
4
- * Used after requests that the Domeneshop API guarantees a body for on
5
- * success (single-resource GETs, creates and updates), so callers get a
6
- * concrete type instead of threading `| undefined` through the client.
7
- */
8
1
  export declare function assertDefined<T>(value: T | undefined, message: string): T;
9
2
  //# sourceMappingURL=assert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/domeneshop/assert.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAKzE"}
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/domeneshop/assert.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAKzE"}
@@ -1,10 +1,3 @@
1
- /**
2
- * Asserts that a value is defined, narrowing it and throwing otherwise.
3
- *
4
- * Used after requests that the Domeneshop API guarantees a body for on
5
- * success (single-resource GETs, creates and updates), so callers get a
6
- * concrete type instead of threading `| undefined` through the client.
7
- */
8
1
  export function assertDefined(value, message) {
9
2
  if (value === undefined) {
10
3
  throw new Error(message);
@@ -1 +1 @@
1
- {"version":3,"file":"assert.js","sourceRoot":"","sources":["../../src/domeneshop/assert.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAI,KAAoB,EAAE,OAAe;IACpE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"assert.js","sourceRoot":"","sources":["../../src/domeneshop/assert.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAI,KAAoB,EAAE,OAAe;IACpE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -4,14 +4,9 @@ import { DynDnsResource } from "./resources/dyndns.js";
4
4
  import { ForwardsResource } from "./resources/forwards.js";
5
5
  import { InvoicesResource } from "./resources/invoices.js";
6
6
  export interface DomeneshopClientOptions {
7
- /** Overrides the API base URL. Intended for tests. */
8
7
  baseUrl?: string;
9
8
  }
10
- /**
11
- * A Domeneshop API client (https://api.domeneshop.no/docs/), authenticated
12
- * via HTTP Basic Auth using an API token and secret from
13
- * https://www.domeneshop.no/admin?view=api.
14
- */
9
+ /** Authenticate with a token/secret pair from https://www.domeneshop.no/admin?view=api. */
15
10
  export declare class DomeneshopClient {
16
11
  readonly domains: DomainsResource;
17
12
  readonly dns: DnsResource;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/domeneshop/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,WAAW,uBAAuB;IACtC,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;gBAExB,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,uBAA4B;CAQjF"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/domeneshop/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,2FAA2F;AAC3F,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;gBAExB,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,uBAA4B;CAQjF"}
@@ -4,11 +4,7 @@ import { DomainsResource } from "./resources/domains.js";
4
4
  import { DynDnsResource } from "./resources/dyndns.js";
5
5
  import { ForwardsResource } from "./resources/forwards.js";
6
6
  import { InvoicesResource } from "./resources/invoices.js";
7
- /**
8
- * A Domeneshop API client (https://api.domeneshop.no/docs/), authenticated
9
- * via HTTP Basic Auth using an API token and secret from
10
- * https://www.domeneshop.no/admin?view=api.
11
- */
7
+ /** Authenticate with a token/secret pair from https://www.domeneshop.no/admin?view=api. */
12
8
  export class DomeneshopClient {
13
9
  domains;
14
10
  dns;
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/domeneshop/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAO3D;;;;GAIG;AACH,MAAM,OAAO,gBAAgB;IAClB,OAAO,CAAkB;IACzB,GAAG,CAAc;IACjB,QAAQ,CAAmB;IAC3B,MAAM,CAAiB;IACvB,QAAQ,CAAmB;IAEpC,YAAY,KAAa,EAAE,MAAc,EAAE,UAAmC,EAAE;QAC9E,MAAM,SAAS,GAAG,IAAI,aAA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AI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC;QAC5C,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC;CACF"}
@@ -1,40 +1,19 @@
1
- /**
2
- * Minimal HTTP transport for the Domeneshop API
3
- * (https://api.domeneshop.no/docs/), authenticated via HTTP Basic Auth using
4
- * an API token and secret from https://www.domeneshop.no/admin?view=api.
5
- */
6
- /** Thrown for non-2xx responses from the Domeneshop API. */
7
1
  export declare class DomeneshopApiError extends Error {
8
2
  readonly statusCode: number;
9
3
  readonly body: string;
10
4
  constructor(statusCode: number, body: string);
11
5
  }
12
6
  export interface RequestOptions {
13
- /** Query parameters. Undefined and empty-string values are omitted. */
14
7
  query?: Record<string, string | undefined>;
15
- /** Request body, marshalled as JSON. */
16
8
  body?: unknown;
17
- /**
18
- * Whether to parse the response body as JSON. Defaults to true; set to
19
- * false for endpoints that return a non-JSON (or irrelevant) body, such
20
- * as the dynamic DNS update protocol's plain-text response.
21
- */
9
+ /** Set false for endpoints with a non-JSON body, e.g. the dynamic DNS update protocol. */
22
10
  decodeJson?: boolean;
23
11
  }
24
12
  export interface ApiResponse<T> {
25
- /** The parsed JSON response body, or undefined if the response was empty. */
26
13
  data: T | undefined;
27
- /**
28
- * The raw response headers. Some endpoints report their result there
29
- * rather than in the body — see ForwardsResource.create.
30
- */
14
+ /** Some endpoints report their result here rather than in the body — see ForwardsResource.create. */
31
15
  headers: Headers;
32
16
  }
33
- /**
34
- * HttpTransport performs authenticated HTTP requests against the Domeneshop
35
- * API and decodes JSON responses. It has no knowledge of individual
36
- * endpoints; that lives in the resource classes built on top of it.
37
- */
38
17
  export declare class HttpTransport {
39
18
  private readonly baseUrl;
40
19
  private readonly authorization;
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","s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AAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,0FAA0F;IAC1F,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC;IACpB,qGAAqG;IACrG,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAE3B,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,MAAyB;IAKvE,OAAO,CAAC,CAAC,EACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CA8B3B"}
@@ -1,10 +1,4 @@
1
- /**
2
- * Minimal HTTP transport for the Domeneshop API
3
- * (https://api.domeneshop.no/docs/), authenticated via HTTP Basic Auth using
4
- * an API token and secret from https://www.domeneshop.no/admin?view=api.
5
- */
6
1
  const DEFAULT_BASE_URL = "https://api.domeneshop.no/v0";
7
- /** Thrown for non-2xx responses from the Domeneshop API. */
8
2
  export class DomeneshopApiError extends Error {
9
3
  statusCode;
10
4
  body;
@@ -17,11 +11,6 @@ export class DomeneshopApiError extends Error {
17
11
  this.body = body;
18
12
  }
19
13
  }
20
- /**
21
- * HttpTransport performs authenticated HTTP requests against the Domeneshop
22
- * API and decodes JSON responses. It has no knowledge of individual
23
- * endpoints; that lives in the resource classes built on top of it.
24
- */
25
14
  export class HttpTransport {
26
15
  baseUrl;
27
16
  authorization;
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/domeneshop/http.ts"],"names":[],"mappings":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ClC,CAAC,CAAC;QAEH,MAAM,IAAI,GAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;QAC9C,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;QAClD,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACxC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAEnC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,kBAAkB,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACtD,CAAC;QAED,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC;QAC9C,MAAM,IAAI,GAAG,UAAU,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAO,CAAC,CAAC,CAAC,SAAS,CAAC;QACjF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC7C,CAAC;CACF"}
@@ -10,14 +10,6 @@ import type { HttpTransport } from "../http.js";
10
10
  */
11
11
  export declare const RECORD_TYPES: readonly ["A", "AAAA", "ANAME", "CAA", "CNAME", "DS", "MX", "NS", "SRV", "TLSA", "TXT"];
12
12
  export type RecordType = (typeof RECORD_TYPES)[number];
13
- /**
14
- * A DNS record.
15
- *
16
- * `host`, `type` and `data` apply to every record type; the remaining
17
- * fields are type-specific and are omitted when unset. `data` always
18
- * carries the record's main value — the address, hostname, text or hash —
19
- * while the numeric parameters below carry the rest.
20
- */
21
13
  export interface DNSRecord {
22
14
  id?: number | undefined;
23
15
  host: string;
@@ -48,21 +40,17 @@ export interface DNSRecord {
48
40
  export declare class DnsResource {
49
41
  private readonly transport;
50
42
  constructor(transport: HttpTransport);
51
- /** Lists DNS records for a domain, optionally filtered by host and/or record type. */
52
43
  list(domainId: number, options?: {
53
44
  host?: string | undefined;
54
45
  type?: string | undefined;
55
46
  }): Promise<DNSRecord[]>;
56
- /** Retrieves a single DNS record. */
57
47
  get(domainId: number, recordId: number): Promise<DNSRecord>;
58
- /** Creates a new DNS record and returns its ID. */
59
48
  create(domainId: number, record: DNSRecord): Promise<number>;
60
49
  /**
61
50
  * Replaces an existing DNS record. Fields left unset on `record` are
62
51
  * dropped from the stored record, so callers should send it in full.
63
52
  */
64
53
  update(domainId: number, recordId: number, record: DNSRecord): Promise<void>;
65
- /** Deletes a DNS record. */
66
54
  delete(domainId: number, recordId: number): Promise<void>;
67
55
  }
68
56
  //# sourceMappingURL=dns.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dns.d.ts","sourceRoot":"","sources":["../../../src/domeneshop/resources/dns.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,yFAYf,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IAEb,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,gBAAgB;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,CAA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