@opusdns/api 0.83.0 → 0.84.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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "@opusdns/api-spec-ts-generator": "^0.9.1"
4
4
  },
5
5
  "name": "@opusdns/api",
6
- "version": "0.83.0",
6
+ "version": "0.84.0",
7
7
  "description": "TypeScript types for the OpusDNS OpenAPI specification",
8
8
  "main": "./src/index.ts",
9
9
  "module": "./src/index.ts",
@@ -1314,9 +1314,23 @@ export type PATCH_DomainForwardsZoneNameDisable_Request_Path = PATCH_DomainForwa
1314
1314
  */
1315
1315
  export type PATCH_DomainForwardsZoneNameEnable_Request = {
1316
1316
  parameters: {
1317
+ query: operations['enable_domain_forward_v1_domain_forwards__zone_name__enable_patch']['parameters']['query'];
1317
1318
  path: operations['enable_domain_forward_v1_domain_forwards__zone_name__enable_patch']['parameters']['path'];
1318
1319
  };
1319
1320
  }
1321
+ /**
1322
+ * Query parameters for PATCH /v1/domain-forwards/{zone_name}/enable
1323
+ *
1324
+ * @remarks
1325
+ * This type defines the query parameters for the PATCH /v1/domain-forwards/{zone_name}/enable endpoint.
1326
+ * It provides type safety for all query parameters as defined in the OpenAPI specification.
1327
+ *
1328
+ * @example
1329
+ * Use this type to ensure type safety for query parameters.
1330
+ *
1331
+ * @path /v1/domain-forwards/{zone_name}/enable
1332
+ */
1333
+ export type PATCH_DomainForwardsZoneNameEnable_Request_Query = PATCH_DomainForwardsZoneNameEnable_Request['parameters']['query'];
1320
1334
  /**
1321
1335
  * Path parameters for PATCH /v1/domain-forwards/{zone_name}/enable
1322
1336
  *
@@ -2393,9 +2407,23 @@ export type PATCH_EmailForwardsZoneNameDisable_Request_Path = PATCH_EmailForward
2393
2407
  */
2394
2408
  export type PATCH_EmailForwardsZoneNameEnable_Request = {
2395
2409
  parameters: {
2410
+ query: operations['enable_email_forward_v1_email_forwards__zone_name__enable_patch']['parameters']['query'];
2396
2411
  path: operations['enable_email_forward_v1_email_forwards__zone_name__enable_patch']['parameters']['path'];
2397
2412
  };
2398
2413
  }
2414
+ /**
2415
+ * Query parameters for PATCH /v1/email-forwards/{zone_name}/enable
2416
+ *
2417
+ * @remarks
2418
+ * This type defines the query parameters for the PATCH /v1/email-forwards/{zone_name}/enable endpoint.
2419
+ * It provides type safety for all query parameters as defined in the OpenAPI specification.
2420
+ *
2421
+ * @example
2422
+ * Use this type to ensure type safety for query parameters.
2423
+ *
2424
+ * @path /v1/email-forwards/{zone_name}/enable
2425
+ */
2426
+ export type PATCH_EmailForwardsZoneNameEnable_Request_Query = PATCH_EmailForwardsZoneNameEnable_Request['parameters']['query'];
2399
2427
  /**
2400
2428
  * Path parameters for PATCH /v1/email-forwards/{zone_name}/enable
2401
2429
  *
package/src/openapi.yaml CHANGED
@@ -4909,44 +4909,151 @@ components:
4909
4909
  tokenUrl: token
4910
4910
  type: oauth2
4911
4911
  info:
4912
- description: '# Authentication
4913
-
4914
-
4915
- Describes authentication approach.
4916
-
4917
-
4918
-
4919
- # Resource IDs
4920
-
4921
-
4922
- The API uses extensively [Type IDs](https://github.com/jetify-com/typeid): type-safe,
4923
- K-sortable, globally unique identifier inspired by Stripe IDs. They can be easily
4924
- identified with a format like `prefix_01jxe1nzrmf78scaqbkjx0va0f`. The `prefix`
4925
- gives context to the ID - some examples include `user`, `organization`, `domain`.
4926
- The rest of the ID is a 128-bit UUIDv7 encoded as a 26-character string using
4927
- a modified base32 encoding. See [formal specification for details](https://github.com/jetify-com/typeid/tree/main/spec).
4928
-
4929
-
4930
- This approach allows using unique IDs (UUIDv7), preventing iteration attacks,
4931
- while also easily identifying the "namespace" of the ID. `01975c1f-a15a-7f6c-a5ce-b75fe33de079`
4932
- is hardly distuingishable from `01975c1f-f120-7874-8dc2-de7d728bf261` by humans
4933
- on first glance. However, when represented as Type IDs, they could be represented
4934
- as `user_01jxe1z8atfxpabknqbzhkvr3s` and `domain_01jxe1zw90f1t8vgpyfns8qwk1`,
4935
- immediately making it easier to differentiate between them.
4936
-
4937
-
4938
- Additionally, this gives type safety and additional validation that can be done.
4939
- There''s [libraries available for many languages to make handling Type IDs easier](https://github.com/jetify-com/typeid?tab=readme-ov-file#official-implementations-by-jetify).
4940
- We''re using them ourselves on the backend to quickly catch mistakes like passing
4941
- the wrong Type ID (passing a user ID like `user_01jxe1z8atfxpabknqbzhkvr3s` where
4942
- a domain ID `domain_01jxe1zw90f1t8vgpyfns8qwk1` was expected).
4943
-
4944
-
4945
-
4946
- '
4912
+ description: "# Authentication\n\nDescribes authentication approach.\n\n\n## DNS\
4913
+ \ validation overview (general \u2192 specific) (generated by Cursor on 15th October\
4914
+ \ 2025)\n\nThis document summarizes all DNS validation rules implemented in the\
4915
+ \ codebase and exercised by unit tests. It starts with general hostname requirements\
4916
+ \ and narrows down to zone-, RRSet-, and record-type-specific rules.\n\n### General\
4917
+ \ hostname rules\n\n- **Required trailing dot**: Hostnames must end with a period.\n\
4918
+ - **Lowercase only**: Hostnames are case-insensitive in DNS, but the system enforces\
4919
+ \ lowercase.\n- **Total length**: Must be < 255 octets.\n- **TLD recognized**:\
4920
+ \ The suffix (TLD) must be recognized by `tldextract`.\n- **Allowed characters**:\n\
4921
+ \ - For RRSet types that allow underscores: `- _ . *` plus alphanumerics\n -\
4922
+ \ For all other types: `- . *` plus alphanumerics\n - If an underscore appears\
4923
+ \ on a type that does not allow it, validation fails with a type-aware message.\n\
4924
+ - **Periods constraints**:\n - No consecutive periods (`..`).\n - Cannot start\
4925
+ \ with a period.\n- **Label-by-label checks**:\n - Labels cannot be empty (e.g.,\
4926
+ \ from `..`).\n - Leftmost wildcard `*` is allowed as its own label; any `*`\
4927
+ \ elsewhere (or combined with other chars) is invalid.\n - Each label must be\
4928
+ \ \u2264 63 octets.\n - Each label must end with a letter or digit (no trailing\
4929
+ \ `-` or `_`).\n\nTypes that allow underscores in hostnames: `CNAME`, `ALIAS`,\
4930
+ \ `TXT`, `CAA`, `SRV`, `SMIMEA`, `TLSA`, `URI`.\n\nUnit tests: `tests/unit/models/test_dns_validation.py::TestHostnameValidation`,\
4931
+ \ `::TestLabelValidation`.\n\n### Zone-level validation\n\n- **Blocklist**: Certain\
4932
+ \ hostnames are blocked (checked without the trailing dot). If the zone name matches\
4933
+ \ the blocklist, validation fails.\n- **Zone name hostname checks**: Zone name\
4934
+ \ is validated with the general hostname rules.\n- **RRSet validation aggregation**:\
4935
+ \ Each RRSet is validated; all RRSet and record errors are aggregated under `errors[\"\
4936
+ rrsets\"]` keyed by RRSet name.\n- **CNAME conflicts (RFC 1034/2181 semantics)**:\n\
4937
+ \ - A `CNAME` at a name cannot coexist with any other non-DNSSEC type at the\
4938
+ \ same name.\n - `DNSKEY`/`DS` (DNSSEC) are permitted alongside `CNAME`.\n- **MX\
4939
+ \ target validation (additional policy)**:\n - MX priority must be an integer\
4940
+ \ in [0, 65535].\n - MX target cannot be a `CNAME`.\n - MX target cannot be\
4941
+ \ an IP address (v4 or v6).\n- **Wildcard conflicts**:\n - `NS` records cannot\
4942
+ \ use wildcard names (e.g., `*.example.com.` is invalid for `NS`).\n- **ALIAS\
4943
+ \ conflicts and DNSSEC interaction (PowerDNS semantics)**:\n - If any `ALIAS`\
4944
+ \ exists in a zone that also contains DNSSEC types (`DNSKEY` or `DS`), validation\
4945
+ \ fails: ALIAS is not supported in DNSSEC-enabled zones.\n - At the zone apex,\
4946
+ \ `ALIAS` can only coexist with `SOA` and `NS` (and not with other non-DNSSEC\
4947
+ \ types).\n - At non-apex names, an `ALIAS` cannot coexist with any other record\
4948
+ \ type (behaves like `CNAME` exclusivity).\n\nUnit tests: `tests/unit/models/test_dns_validation.py::TestZoneValidation`,\
4949
+ \ `tests/unit/service/dns/test_additional_dns_validations.py` (MX, wildcard, ALIAS),\
4950
+ \ `tests/unit/service/dns/test_rrset_validation.py` (relative names and invalid\
4951
+ \ zone names).\n\n### RRSet-level validation\n\n- **Name must be inside zone**:\
4952
+ \ RRSet name must either equal the zone apex or end with `.{zone_name}`.\n- **RRSet\
4953
+ \ name hostname checks**: RRSet names are validated with general hostname rules,\
4954
+ \ taking into account RRSet type for underscore allowance.\n- **Relative name\
4955
+ \ normalization** (service-level helper):\n - `@` or empty name resolves to the\
4956
+ \ zone apex.\n - Names without a trailing dot become FQDNs relative to the zone.\n\
4957
+ \ - Already-FQDN names are preserved.\n- **Error aggregation shape for RRSet**:\n\
4958
+ \ - RRSet-level errors are listed under `errors[\"rrsets\"][<rrset_name>][\"\
4959
+ rrset\"]`.\n - Record-level errors are listed under `errors[\"rrsets\"][<rrset_name>][\"\
4960
+ records\"][<record_rdata>]`.\n\nUnit tests: `tests/unit/service/dns/test_rrset_validation.py`\
4961
+ \ (relative `@`, relative `www`, invalid `invalid-subdomain-`), `tests/unit/models/test_dns_validation.py::TestZoneValidation`\
4962
+ \ (invalid RRSet names).\n\n### Record-level validation engine\n\n- **Parsing**:\
4963
+ \ For all supported types except `ALIAS`, the system delegates RDATA parsing to\
4964
+ \ `dnspython` via `dns.rdata.from_text` for the appropriate type.\n- **Target\
4965
+ \ hostnames**: For `CNAME`, `NS`, `PTR`, `SRV`, and `MX`, the parsed target hostname\
4966
+ \ (`target` or `exchange`) is further validated with the general hostname rules\
4967
+ \ and underscore allowance for the RRSet type.\n- **RDATA normalization before\
4968
+ \ parse**:\n - `CNAME`, `NS`, `PTR`: the RDATA hostname is normalized to lowercase\
4969
+ \ with a trailing dot.\n - `SRV`: the trailing hostname portion is normalized;\
4970
+ \ numeric fields are preserved.\n - `MX`: the trailing target hostname is normalized;\
4971
+ \ the priority is preserved.\n- **ALIAS special case**: `ALIAS` RDATA is treated\
4972
+ \ as a hostname and validated directly (not parsed by `dnspython`) and must be\
4973
+ \ a valid hostname per the RRSet\u2019s underscore rules.\n- **Error mapping**:\
4974
+ \ `dnspython` exceptions are mapped to user-facing messages such as:\n - \"Invalid\
4975
+ \ <TYPE> record format: <rdata>\"\n - \"Invalid <TYPE> record data: <rdata>\"\
4976
+ \n - \"<TYPE> record validation failed: <detail>\"\n - The top-level detail\
4977
+ \ for the record error is standardized to \"<TYPE> record is not in the expected\
4978
+ \ format\".\n\nUnit tests: `tests/unit/models/test_dns_validation.py::TestRecordValidationErrors`\
4979
+ \ (A, AAAA, CNAME, MX malformed), plus aggregation and structure assertions.\n\
4980
+ \n### Type-specific rules and examples\n\n- **A**:\n - RDATA must be a valid\
4981
+ \ IPv4 address.\n - Example invalid: `not.an.ip` \u2192 parse fails.\n- **AAAA**:\n\
4982
+ \ - RDATA must be a valid IPv6 address.\n - Example invalid: `??::completely::invalid::ipv6`\
4983
+ \ \u2192 parse fails.\n- **CNAME**:\n - RDATA is a hostname; target is validated;\
4984
+ \ name-level exclusivity enforced at zone level (cannot coexist with other non-DNSSEC\
4985
+ \ types at same name).\n - Underscores allowed in name/target.\n- **MX**:\n \
4986
+ \ - RDATA: `<priority> <target-hostname>`\n - Priority range: 0\u201365535 (integer).\
4987
+ \ Invalid or out-of-range triggers errors.\n - Target hostname cannot be a CNAME\
4988
+ \ name, and cannot be an IP address.\n - Target hostname is normalized and validated.\n\
4989
+ - **NS**:\n - RDATA is a hostname; target is validated.\n - NS cannot use wildcard\
4990
+ \ names (i.e., RRSet name cannot be `*.example.com.`).\n- **PTR**:\n - RDATA\
4991
+ \ is a hostname; target is validated.\n- **SRV**:\n - RDATA: `<priority> <weight>\
4992
+ \ <port> <target-hostname>`; target hostname normalized and validated.\n - Underscores\
4993
+ \ allowed (service labels per RFC 2782).\n- **TXT**:\n - Delegated to `dnspython`\
4994
+ \ for parsing; underscores allowed in names.\n - Note: A TODO exists to enforce\
4995
+ \ quotes for TXT content in the future.\n- **CAA**, **SMIMEA**, **TLSA**, **URI**:\n\
4996
+ \ - Delegated to `dnspython` for parsing; underscores allowed in names.\n- **ALIAS**:\n\
4997
+ \ - Treated like a hostname alias (not an RFC standard RRType); normalized and\
4998
+ \ validated as a hostname.\n - Conflicts/DNSSEC rules as described in the zone-level\
4999
+ \ section.\n- **DNSKEY**, **DS** (DNSSEC):\n - Not parsed/validated here beyond\
5000
+ \ coexistence logic; allowed to coexist with `CNAME` but disallowed with `ALIAS`\
5001
+ \ when DNSSEC is present.\n\nUnit tests: cover A/AAAA/CNAME/MX malformed cases;\
5002
+ \ underscore handling across many types; ALIAS, wildcard, and DNSSEC compatibility\
5003
+ \ in `tests/unit/service/dns/test_additional_dns_validations.py`.\n\n### Wildcard\
5004
+ \ handling\n\n- `*` is allowed only as the entire leftmost label of a name (e.g.,\
5005
+ \ `*.example.com.`).\n- Any `*` embedded within a label or not in the leftmost\
5006
+ \ position is invalid.\n- `NS` records cannot be defined at wildcard names.\n\n\
5007
+ Unit tests: Wildcard NS invalid; wildcard A alongside explicit siblings and at\
5008
+ \ different levels is allowed.\n\n### Underscore handling (by RRSet type)\n\n\
5009
+ - Allowed in hostnames for types: `CNAME`, `ALIAS`, `TXT`, `CAA`, `SRV`, `SMIMEA`,\
5010
+ \ `TLSA`, `URI`.\n- Disallowed for: `A`, `AAAA`, `NS`, `MX`, `PTR`, `SOA`, `DNSKEY`,\
5011
+ \ `DS`.\n- Applies both at the start of labels (e.g., `_service`) and in the middle\
5012
+ \ (`my_service`), per tests.\n\nUnit tests: `tests/unit/models/test_dns_validation.py::TestUnderscoreHandling`\
5013
+ \ parameterized cases across types.\n\n### Blocked hostnames\n\n- A curated list\
5014
+ \ of blocked apex names (e.g., major providers\u2019 zones) cannot be added as\
5015
+ \ zones. The check is performed on the dotted-stripped value (no trailing dot).\n\
5016
+ \n### Error response shape\n\n- Zone-level failure raises `DnsZoneValidationError`\
5017
+ \ with `extras.errors` containing:\n - `zone_name`: either a string or a nested\
5018
+ \ mapping of specific hostname errors\n - `rrsets`: mapping of RRSet name \u2192\
5019
+ \ `{ \"rrset\": [..], \"records\": { rdata \u2192 [..] } }`\n - Optional sections\
5020
+ \ when relevant: `cname_conflicts`, `mx_validation`, `wildcard_conflicts`, `alias_conflicts`\n\
5021
+ - RRSet-level failure raises `DnsRrsetValidationError` with a similarly structured\
5022
+ \ `errors` mapping for that RRSet.\n- Record-level failures are aggregated into\
5023
+ \ the RRSet structure above.\n\nUnit tests: Assert shapes and representative messages\
5024
+ \ in `tests/unit/models/test_dns_validation.py::TestRecordValidationErrors::test_error_response_structure`.\n\
5025
+ \n### Key normalizers and helpers\n\n- `normalize_zone_name(s)`: lowercases and\
5026
+ \ ensures a trailing dot.\n- `convert_rrset_name(name, zone)`: resolves `@`/empty\
5027
+ \ to apex and converts relative names to FQDNs under the zone.\n- The record validator\
5028
+ \ normalizes hostnames within RDATA for `CNAME`, `NS`, `PTR`, `SRV`, and `MX`\
5029
+ \ before parsing/validation.\n\n### API behavior around trailing dots (for context)\n\
5030
+ \n- API endpoints accept both with/without trailing dot in the path; zone names\
5031
+ \ are normalized internally. This is orthogonal to validation rules but relevant\
5032
+ \ to how names are handled at the boundary.\n\n---\n\nReferences (tests):\n- `tests/unit/models/test_dns_validation.py`\n\
5033
+ - `tests/unit/service/dns/test_additional_dns_validations.py`\n- `tests/unit/service/dns/test_rrset_validation.py`\n\
5034
+ - `tests/unit/api/dns/test_v1.py`, `tests/unit/api/dns/test_dns.py` (API normalization)\n\
5035
+ \nReferences (implementation):\n- `common/models/dns/validation.py`\n- `common/services/dns/utils.py`\n\
5036
+ - `common/lib/utils/dns.py`\n- `common/models/dns/blocked_domains.py`\n\n\n\n\n\
5037
+ # Resource IDs\n\nThe API uses extensively [Type IDs](https://github.com/jetify-com/typeid):\
5038
+ \ type-safe, K-sortable, globally unique identifier inspired by Stripe IDs. They\
5039
+ \ can be easily identified with a format like `prefix_01jxe1nzrmf78scaqbkjx0va0f`.\
5040
+ \ The `prefix` gives context to the ID - some examples include `user`, `organization`,\
5041
+ \ `domain`. The rest of the ID is a 128-bit UUIDv7 encoded as a 26-character string\
5042
+ \ using a modified base32 encoding. See [formal specification for details](https://github.com/jetify-com/typeid/tree/main/spec).\n\
5043
+ \nThis approach allows using unique IDs (UUIDv7), preventing iteration attacks,\
5044
+ \ while also easily identifying the \"namespace\" of the ID. `01975c1f-a15a-7f6c-a5ce-b75fe33de079`\
5045
+ \ is hardly distuingishable from `01975c1f-f120-7874-8dc2-de7d728bf261` by humans\
5046
+ \ on first glance. However, when represented as Type IDs, they could be represented\
5047
+ \ as `user_01jxe1z8atfxpabknqbzhkvr3s` and `domain_01jxe1zw90f1t8vgpyfns8qwk1`,\
5048
+ \ immediately making it easier to differentiate between them.\n\nAdditionally,\
5049
+ \ this gives type safety and additional validation that can be done. There's [libraries\
5050
+ \ available for many languages to make handling Type IDs easier](https://github.com/jetify-com/typeid?tab=readme-ov-file#official-implementations-by-jetify).\
5051
+ \ We're using them ourselves on the backend to quickly catch mistakes like passing\
5052
+ \ the wrong Type ID (passing a user ID like `user_01jxe1z8atfxpabknqbzhkvr3s`\
5053
+ \ where a domain ID `domain_01jxe1zw90f1t8vgpyfns8qwk1` was expected).\n\n\n"
4947
5054
  summary: OpusDNS - your gateway to a seamless domain management experience.
4948
5055
  title: OpusDNS API
4949
- version: 2025-10-14-131453
5056
+ version: 2025-10-15-082524
4950
5057
  x-logo:
4951
5058
  altText: OpusDNS API Reference
4952
5059
  url: https://d24lr4zqs1tgqh.cloudfront.net/c9505a20-5ae1-406c-b060-d392569caebf.jpg
@@ -6466,6 +6573,13 @@ paths:
6466
6573
  description: DNS zone name (trailing dot optional)
6467
6574
  title: Zone Name
6468
6575
  type: string
6576
+ - in: query
6577
+ name: auto_create_zone
6578
+ required: false
6579
+ schema:
6580
+ default: false
6581
+ title: Auto Create Zone
6582
+ type: boolean
6469
6583
  responses:
6470
6584
  '204':
6471
6585
  description: Successful Response
@@ -7824,6 +7938,13 @@ paths:
7824
7938
  description: DNS zone name (trailing dot optional)
7825
7939
  title: Zone Name
7826
7940
  type: string
7941
+ - in: query
7942
+ name: auto_create_zone
7943
+ required: false
7944
+ schema:
7945
+ default: false
7946
+ title: Auto Create Zone
7947
+ type: boolean
7827
7948
  responses:
7828
7949
  '204':
7829
7950
  description: Successful Response
package/src/schema.d.ts CHANGED
@@ -5924,7 +5924,9 @@ export interface operations {
5924
5924
  };
5925
5925
  enable_domain_forward_v1_domain_forwards__zone_name__enable_patch: {
5926
5926
  parameters: {
5927
- query?: never;
5927
+ query?: {
5928
+ auto_create_zone?: boolean;
5929
+ };
5928
5930
  header?: never;
5929
5931
  path: {
5930
5932
  /** @description DNS zone name (trailing dot optional) */
@@ -7060,7 +7062,9 @@ export interface operations {
7060
7062
  };
7061
7063
  enable_email_forward_v1_email_forwards__zone_name__enable_patch: {
7062
7064
  parameters: {
7063
- query?: never;
7065
+ query?: {
7066
+ auto_create_zone?: boolean;
7067
+ };
7064
7068
  header?: never;
7065
7069
  path: {
7066
7070
  /** @description DNS zone name (trailing dot optional) */