Skip to content

Commit 4290c6d

Browse files
authored
Release v0.8.2
- feat(zone_record): added GET, POST, and DELETE formats - feat(zone): added GET, POST, and DELETE formats - feat(session): can return a token - feat(perm): name ca be empty - feat(ns): GET always returns an array of items - feat(ns): address6 can be empty - meta: add [files] to package.json, deleted .npmignore
1 parent febef73 commit 4290c6d

13 files changed

Lines changed: 124 additions & 67 deletions

.npmignore

Lines changed: 0 additions & 14 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
66

77
### Unreleased
88

9+
### [0.8.2] - 2025-04-08
10+
11+
- feat(zone_record): added GET, POST, and DELETE formats
12+
- feat(zone): added GET, POST, and DELETE formats
13+
- feat(session): can return a token
14+
- feat(perm): name ca be empty
15+
- feat(ns): GET always returns an array of items
16+
- feat(ns): address6 can be empty
17+
- meta: add [files] to package.json, deleted .npmignore
18+
919
### [0.8.1] - 2024-12-16
1020

1121
- doc(CONTRIBUTORS): added
@@ -75,3 +85,5 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
7585
[0.7.4]: https://github.com/NicTool/validate/releases/tag/0.7.4
7686
[0.8.0]: https://github.com/NicTool/validate/releases/tag/0.8.0
7787
[0.8.1]: https://github.com/NicTool/validate/releases/tag/v0.8.1
88+
[0.8.2]: https://github.com/NicTool/validate/releases/tag/v0.8.2
89+
[1.0.0]: https://github.com/NicTool/validate/releases/tag/1.0.0

CONTRIBUTORS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
This handcrafted artisinal software is brought to you by:
44

5-
| <img height="80" src="https://avatars.githubusercontent.com/u/261635?v=4"><br><a href="https://github.com/msimerson">msimerson</a> (<a href="https://github.com/NicTool/validate/commits?author=msimerson">20</a>)|
6-
| :---: |
5+
| <img height="80" src="https://avatars.githubusercontent.com/u/261635?v=4"><br><a href="https://github.com/msimerson">msimerson</a> (<a href="https://github.com/NicTool/validate/commits?author=msimerson">21</a>) |
6+
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
77

88
<sub>this file is generated by [.release](https://github.com/msimerson/.release).
99
Contribute to this project to get your GitHub profile included here.</sub>

eslint.config.mjs

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
import globals from "globals";
2-
import path from "node:path";
3-
import { fileURLToPath } from "node:url";
4-
import js from "@eslint/js";
5-
import { FlatCompat } from "@eslint/eslintrc";
1+
import globals from 'globals'
2+
import path from 'node:path'
3+
import { fileURLToPath } from 'node:url'
4+
import js from '@eslint/js'
5+
import { FlatCompat } from '@eslint/eslintrc'
66

7-
const __filename = fileURLToPath(import.meta.url);
8-
const __dirname = path.dirname(__filename);
7+
const __filename = fileURLToPath(import.meta.url)
8+
const __dirname = path.dirname(__filename)
99
const compat = new FlatCompat({
10-
baseDirectory: __dirname,
11-
recommendedConfig: js.configs.recommended,
12-
allConfig: js.configs.all
13-
});
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all,
13+
})
1414

15-
export default [{
16-
ignores: ["**/package-lock.json"],
17-
}, ...compat.extends("eslint:recommended", "prettier"), {
15+
export default [
16+
{
17+
ignores: ['**/package-lock.json'],
18+
},
19+
...compat.extends('eslint:recommended', 'prettier'),
20+
{
1821
languageOptions: {
19-
globals: {
20-
...globals.node,
21-
...globals.mocha,
22-
},
22+
globals: {
23+
...globals.node,
24+
...globals.mocha,
25+
},
2326
},
24-
}];
27+
},
28+
]

lib/nameserver.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ exports.v3 = Joi.object({
2929
ttl: shared.ttl.required(),
3030
description: Joi.string().empty('').max(255),
3131
address: shared.ipv4.required(),
32-
address6: shared.ipv6,
32+
address6: shared.ipv6.empty(''),
3333
remote_login: exports.remote_login,
3434
logdir: Joi.string().empty('').max(255),
3535
datadir: Joi.string().empty('').min(2).max(255),
@@ -49,7 +49,7 @@ exports.GET_req = Joi.object({
4949
})
5050

5151
exports.GET_res = Joi.object({
52-
nameserver: exports.v3,
52+
nameserver: Joi.array().items(exports.v3),
5353
meta: shared.meta,
5454
})
5555

lib/permission.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ exports.id = Joi.number().integer().min(1).max(4294967295)
66

77
exports.v3 = Joi.object({
88
id: exports.id,
9-
name: Joi.string(),
9+
name: Joi.string().empty(''),
1010
inherit: Joi.boolean(),
1111
self_write: Joi.boolean(),
1212
deleted: Joi.boolean(),

lib/session.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ exports.GET_res = Joi.object({
1616
group: group.v3,
1717
session: Joi.object({
1818
id: Joi.number().integer().min(1).max(4294967295),
19+
token: Joi.string(),
1920
last_access: Joi.number().integer().min(1).max(4294967295),
2021
}),
2122
meta: shared.meta,

lib/test/zone_record.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": 1,
33
"zid": 1,
4-
"name": "a",
4+
"owner": "a",
55
"ttl": 86400,
66
"type": "A",
77
"address": "1.1.1.1"

lib/zone.js

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@ const Joi = require('joi')
22

33
const shared = require('./shared')
44

5+
exports.id = shared.uint32
6+
7+
exports.zone = Joi.string()
8+
.min(3)
9+
.max(255)
10+
.domain({ allowFullyQualified: true, tlds: false })
11+
.required()
12+
513
exports.v3 = Joi.object({
6-
id: shared.uint32,
14+
id: exports.id,
715

816
gid: shared.uint32.required(),
917

10-
zone: Joi.string()
11-
.min(3)
12-
.max(255)
13-
.domain({ allowFullyQualified: true, tlds: false })
14-
.required(),
18+
zone: exports.zone,
1519

1620
description: Joi.string().empty(''),
1721

@@ -31,5 +35,27 @@ exports.v3 = Joi.object({
3135

3236
ttl: shared.ttl.required(),
3337

38+
last_modified: Joi.date(),
39+
40+
last_publish: Joi.date().allow('', null),
41+
42+
deleted: Joi.boolean(),
43+
})
44+
45+
exports.GET_req = Joi.object({
46+
id: exports.id,
47+
zone: exports.zone,
48+
deleted: Joi.boolean(),
49+
})
50+
51+
exports.GET_res = Joi.object({
52+
zone: Joi.array().items(exports.v3),
53+
meta: shared.meta,
54+
})
55+
56+
exports.POST = exports.v3
57+
58+
exports.DELETE = Joi.object({
59+
id: exports.id,
3460
deleted: Joi.boolean(),
3561
})

0 commit comments

Comments
 (0)