diff --git a/.campaign/tgz/SHA256SUMS b/.campaign/tgz/SHA256SUMS index 18e144b..f78f4a2 100644 --- a/.campaign/tgz/SHA256SUMS +++ b/.campaign/tgz/SHA256SUMS @@ -1,5 +1,7 @@ abdbff87d78af3f605b465b1104c9a57fa859fbc14d8bb9ba396a49869269d99 antelopejs-api-6afe3e2.tgz -633ab682a1ede2ac315ace5ccbbb1d7ff130c6315267c6061a45d1949a0282cb antelopejs-interface-api-f2a99b5.tgz +0a51c9c2da58c2586bfa5095b1da92a7b74130acf1e64820bfd5f98eaa4200f9 antelopejs-core-184eb90.tgz +8e017528574748687b246df07affa6cbcfbe931cc6086fcb5dd2c7a28c1f0d8e antelopejs-interface-api-015a93a.tgz fa0a3cfa243d0c78cd29d45839ae61bbbce5615a7c8d8247755b0cd91c8bedc6 antelopejs-interface-api-util-639f38b.tgz +30391718e65481815db5b5bb10e7eabb1feac13165005ee46e54b592f3676c69 antelopejs-interface-core-f7df541.tgz ccdc833729f50825d3567047a22bf9c68f47a38ca3527117756fbd80f380fabd antelopejs-interface-database-724ff72.tgz -89d427c5fcc3c7b3c3818df1a95f686b871e571d4134a571f0ac2be84c601631 antelopejs-interface-database-decorators-e79a62b.tgz +5ed284901d3e226fd30ec1134c7fe2c44d5637a9c0f2bc198d0863c6b508ae62 antelopejs-interface-database-decorators-1234214.tgz diff --git a/.campaign/tgz/antelopejs-core-184eb90.tgz b/.campaign/tgz/antelopejs-core-184eb90.tgz new file mode 100644 index 0000000..de90b08 Binary files /dev/null and b/.campaign/tgz/antelopejs-core-184eb90.tgz differ diff --git a/.campaign/tgz/antelopejs-interface-api-015a93a.tgz b/.campaign/tgz/antelopejs-interface-api-015a93a.tgz new file mode 100644 index 0000000..a14002a Binary files /dev/null and b/.campaign/tgz/antelopejs-interface-api-015a93a.tgz differ diff --git a/.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz b/.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz deleted file mode 100644 index f7e4ad6..0000000 Binary files a/.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz and /dev/null differ diff --git a/.campaign/tgz/antelopejs-interface-core-f7df541.tgz b/.campaign/tgz/antelopejs-interface-core-f7df541.tgz new file mode 100644 index 0000000..fd9f0fa Binary files /dev/null and b/.campaign/tgz/antelopejs-interface-core-f7df541.tgz differ diff --git a/.campaign/tgz/antelopejs-interface-database-decorators-1234214.tgz b/.campaign/tgz/antelopejs-interface-database-decorators-1234214.tgz new file mode 100644 index 0000000..e5aff0e Binary files /dev/null and b/.campaign/tgz/antelopejs-interface-database-decorators-1234214.tgz differ diff --git a/.campaign/tgz/antelopejs-interface-database-decorators-e79a62b.tgz b/.campaign/tgz/antelopejs-interface-database-decorators-e79a62b.tgz deleted file mode 100644 index 3565095..0000000 Binary files a/.campaign/tgz/antelopejs-interface-database-decorators-e79a62b.tgz and /dev/null differ diff --git a/.campaign/tgz/ranges.tsv b/.campaign/tgz/ranges.tsv index 264756c..299c38e 100644 --- a/.campaign/tgz/ranges.tsv +++ b/.campaign/tgz/ranges.tsv @@ -13,5 +13,9 @@ @antelopejs/api package.json devDependencies @antelopejs/api package.json pnpm.overrides @antelopejs/api pnpm-workspace.yaml overrides -@antelopejs/api>@antelopejs/interface-core package.json pnpm.overrides -@antelopejs/api>@antelopejs/interface-core pnpm-workspace.yaml overrides +@antelopejs/interface-core package.json devDependencies ^0.2.6 +@antelopejs/interface-core package.json pnpm.overrides +@antelopejs/interface-core pnpm-workspace.yaml overrides +@antelopejs/core package.json devDependencies ~1.17.0 +@antelopejs/core package.json pnpm.overrides +@antelopejs/core pnpm-workspace.yaml overrides diff --git a/README.md b/README.md index dc9eb4f..c4b3df0 100644 --- a/README.md +++ b/README.md @@ -125,11 +125,11 @@ The package declares these `@antelopejs/*` peer dependencies: | Package | Supported | Tested with | | ------------------------------------------- | ----------------- | ------------------------------------------------------------------------- | -| `@antelopejs/interface-api` | `>=0.3.0 <1.0.0` | `file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz` | +| `@antelopejs/interface-api` | `>=0.3.0 <1.0.0` | `file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz` | | `@antelopejs/interface-api-util` | `>=0.1.3 <1.0.0` | `file:.campaign/tgz/antelopejs-interface-api-util-639f38b.tgz` | -| `@antelopejs/interface-core` | `>=0.2.4 <1.0.0` | `0.2.7` | +| `@antelopejs/interface-core` | `>=0.2.4 <1.0.0` | `file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz` | | `@antelopejs/interface-database` | `>=0.1.10 <1.0.0` | `file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz` | -| `@antelopejs/interface-database-decorators` | `>=0.1.10 <1.0.0` | `file:.campaign/tgz/antelopejs-interface-database-decorators-e79a62b.tgz` | +| `@antelopejs/interface-database-decorators` | `>=0.1.10 <1.0.0` | `file:.campaign/tgz/antelopejs-interface-database-decorators-1234214.tgz` | diff --git a/guardrails.ratchet.json b/guardrails.ratchet.json index 34fa6fb..4dbcf74 100644 --- a/guardrails.ratchet.json +++ b/guardrails.ratchet.json @@ -2,7 +2,6 @@ "pack": "0.2.17", "rules": { "anti-slop/no-unsafe-dictionary-type": 1, - "typescript/no-unsafe-argument": 12, "typescript/no-unsafe-return": 2 }, "oversizeFiles": {} diff --git a/package.json b/package.json index 51c98d9..3187272 100644 --- a/package.json +++ b/package.json @@ -74,12 +74,12 @@ }, "devDependencies": { "@antelopejs/api": "file:.campaign/tgz/antelopejs-api-6afe3e2.tgz", - "@antelopejs/core": "~1.17.0", - "@antelopejs/interface-api": "file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz", + "@antelopejs/core": "file:.campaign/tgz/antelopejs-core-184eb90.tgz", + "@antelopejs/interface-api": "file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz", "@antelopejs/interface-api-util": "file:.campaign/tgz/antelopejs-interface-api-util-639f38b.tgz", - "@antelopejs/interface-core": "^0.2.6", + "@antelopejs/interface-core": "file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz", "@antelopejs/interface-database": "file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz", - "@antelopejs/interface-database-decorators": "file:.campaign/tgz/antelopejs-interface-database-decorators-e79a62b.tgz", + "@antelopejs/interface-database-decorators": "file:.campaign/tgz/antelopejs-interface-database-decorators-1234214.tgz", "@antelopejs/tooling-configs": "^0.2.17", "@types/chai": "^4.3.20", "@types/mocha": "^10.0.10", @@ -109,11 +109,12 @@ "pnpm": { "overrides": { "@antelopejs/interface-database": "file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz", - "@antelopejs/interface-database-decorators": "file:.campaign/tgz/antelopejs-interface-database-decorators-e79a62b.tgz", - "@antelopejs/interface-api": "file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz", + "@antelopejs/interface-database-decorators": "file:.campaign/tgz/antelopejs-interface-database-decorators-1234214.tgz", + "@antelopejs/interface-api": "file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz", "@antelopejs/interface-api-util": "file:.campaign/tgz/antelopejs-interface-api-util-639f38b.tgz", "@antelopejs/api": "file:.campaign/tgz/antelopejs-api-6afe3e2.tgz", - "@antelopejs/api>@antelopejs/interface-core": "0.2.7" + "@antelopejs/interface-core": "file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz", + "@antelopejs/core": "file:.campaign/tgz/antelopejs-core-184eb90.tgz" } }, "antelopeJs": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index eec9085..8f5c19c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,38 +6,39 @@ settings: overrides: '@antelopejs/interface-database': file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz - '@antelopejs/interface-database-decorators': file:.campaign/tgz/antelopejs-interface-database-decorators-e79a62b.tgz - '@antelopejs/interface-api': file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz + '@antelopejs/interface-database-decorators': file:.campaign/tgz/antelopejs-interface-database-decorators-1234214.tgz + '@antelopejs/interface-api': file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz '@antelopejs/interface-api-util': file:.campaign/tgz/antelopejs-interface-api-util-639f38b.tgz '@antelopejs/api': file:.campaign/tgz/antelopejs-api-6afe3e2.tgz - '@antelopejs/api>@antelopejs/interface-core': 0.2.7 + '@antelopejs/interface-core': file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz + '@antelopejs/core': file:.campaign/tgz/antelopejs-core-184eb90.tgz importers: .: dependencies: '@antelopejs/interface-api': - specifier: file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz - version: file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz(@antelopejs/interface-core@0.2.7) + specifier: file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz + version: file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz) '@antelopejs/interface-api-util': specifier: file:.campaign/tgz/antelopejs-interface-api-util-639f38b.tgz - version: file:.campaign/tgz/antelopejs-interface-api-util-639f38b.tgz(@antelopejs/interface-api@file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz(@antelopejs/interface-core@0.2.7))(@antelopejs/interface-core@0.2.7) + version: file:.campaign/tgz/antelopejs-interface-api-util-639f38b.tgz(@antelopejs/interface-api@file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz))(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz) + '@antelopejs/interface-core': + specifier: file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz + version: file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz '@antelopejs/interface-database': specifier: file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz - version: file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz(@antelopejs/interface-core@0.2.7) + version: file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz) '@antelopejs/interface-database-decorators': - specifier: file:.campaign/tgz/antelopejs-interface-database-decorators-e79a62b.tgz - version: file:.campaign/tgz/antelopejs-interface-database-decorators-e79a62b.tgz(@antelopejs/interface-api@file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz(@antelopejs/interface-core@0.2.7))(@antelopejs/interface-core@0.2.7)(@antelopejs/interface-database@file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz(@antelopejs/interface-core@0.2.7)) + specifier: file:.campaign/tgz/antelopejs-interface-database-decorators-1234214.tgz + version: file:.campaign/tgz/antelopejs-interface-database-decorators-1234214.tgz(@antelopejs/interface-api@file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz))(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz)(@antelopejs/interface-database@file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz)) devDependencies: '@antelopejs/api': specifier: file:.campaign/tgz/antelopejs-api-6afe3e2.tgz - version: file:.campaign/tgz/antelopejs-api-6afe3e2.tgz(@antelopejs/core@1.17.1) + version: file:.campaign/tgz/antelopejs-api-6afe3e2.tgz(@antelopejs/core@file:.campaign/tgz/antelopejs-core-184eb90.tgz) '@antelopejs/core': - specifier: ~1.17.0 - version: 1.17.1 - '@antelopejs/interface-core': - specifier: ^0.2.6 - version: 0.2.7 + specifier: file:.campaign/tgz/antelopejs-core-184eb90.tgz + version: file:.campaign/tgz/antelopejs-core-184eb90.tgz '@antelopejs/tooling-configs': specifier: ^0.2.17 version: 0.2.17(eslint-plugin-perfectionist@5.11.0(eslint@10.10.0(jiti@2.7.0))(typescript@5.9.3))(knip@6.34.0)(oxfmt@0.66.0)(oxlint@1.81.0(oxlint-tsgolint@7.0.2001)) @@ -101,9 +102,10 @@ packages: '@antelopejs/core': optional: true - '@antelopejs/core@1.17.1': - resolution: {integrity: sha512-gul38oMJuiaLl5MEwinRbM6d08uPI2wqCmDDrI5V+VilcxJA025VF1l1CqNta3xQfszvRr/jt4RzOgUlhKJi/g==} - engines: {node: '>=20.19'} + '@antelopejs/core@file:.campaign/tgz/antelopejs-core-184eb90.tgz': + resolution: {integrity: sha512-CsiXLalRIIxX5YHjMUVDlz0+zBGSeNjSNPdBTgHwVsWpT1bIeG8izJmbCgpi5tIs8rvxkdlEZ6eKa7yH1GK8CA==, tarball: file:.campaign/tgz/antelopejs-core-184eb90.tgz} + version: 1.20.0 + engines: {node: ^20.19.0 || >=22.12.0} hasBin: true '@antelopejs/interface-api-util@file:.campaign/tgz/antelopejs-interface-api-util-639f38b.tgz': @@ -113,17 +115,18 @@ packages: '@antelopejs/interface-api': '>=0.3.0 <1.0.0' '@antelopejs/interface-core': '>=0.2.4 <1.0.0' - '@antelopejs/interface-api@file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz': - resolution: {integrity: sha512-pF423v3AMpaak5uLd/Q7TXoT+CXqxZXHQmSbEeik7eGfS+2Fsc2k1x/IR1gX4Hje8QuqLMZmkgT/eDyGXl/p2A==, tarball: file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz} + '@antelopejs/interface-api@file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz': + resolution: {integrity: sha512-G7BRef+991Dn+O4zmxGE8f8KN5Xfj5GQa+W3LQo0f+XHhRUCz2E+brTIonhjV7HJ5Z+lFNrm4StPytwNIUxA5Q==, tarball: file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz} version: 0.3.0 peerDependencies: - '@antelopejs/interface-core': '>=0.2.4 <1.0.0' + '@antelopejs/interface-core': '>=0.4.0 <1.0.0' - '@antelopejs/interface-core@0.2.7': - resolution: {integrity: sha512-2zWWTxSMutyqVbnr/xfGtjgIcx2x4zLZk6wOQkXDgX+i0DVPw6DOE/nsUHGP4uGrVAYg6b1z4oLdTV1NMAyZjA==} + '@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz': + resolution: {integrity: sha512-ur2KLvtD8h4SCZ0VSoQDc1pg+E9Bk/py3EW3qHHdoo3i6RvKWrrDKsX2khVdqQESuF2QMc1sJ6B+7ISjx5TvpQ==, tarball: file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz} + version: 0.4.0 - '@antelopejs/interface-database-decorators@file:.campaign/tgz/antelopejs-interface-database-decorators-e79a62b.tgz': - resolution: {integrity: sha512-IO3ovOrBj5yWA39lNFqgr8+oJhjy8bzBTbgFvx369afjGO2J1i3J0+riEbZZzQ5fTx1qYV5gYuyx+BdoQBf+BQ==, tarball: file:.campaign/tgz/antelopejs-interface-database-decorators-e79a62b.tgz} + '@antelopejs/interface-database-decorators@file:.campaign/tgz/antelopejs-interface-database-decorators-1234214.tgz': + resolution: {integrity: sha512-vHjhTLclmWleAEamSNcic9sl8/tZRP7xunXdAWy35dOF2KHn2UYcguREtGAp98Ph81ciVVc9ir+RTveVCaS9VA==, tarball: file:.campaign/tgz/antelopejs-interface-database-decorators-1234214.tgz} version: 0.2.0 peerDependencies: '@antelopejs/interface-api': '>=0.0.15 <1.0.0' @@ -2828,22 +2831,22 @@ packages: snapshots: - '@antelopejs/api@file:.campaign/tgz/antelopejs-api-6afe3e2.tgz(@antelopejs/core@1.17.1)': + '@antelopejs/api@file:.campaign/tgz/antelopejs-api-6afe3e2.tgz(@antelopejs/core@file:.campaign/tgz/antelopejs-core-184eb90.tgz)': dependencies: - '@antelopejs/interface-api': file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz(@antelopejs/interface-core@0.2.7) - '@antelopejs/interface-api-util': file:.campaign/tgz/antelopejs-interface-api-util-639f38b.tgz(@antelopejs/interface-api@file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz(@antelopejs/interface-core@0.2.7))(@antelopejs/interface-core@0.2.7) - '@antelopejs/interface-core': 0.2.7 + '@antelopejs/interface-api': file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz) + '@antelopejs/interface-api-util': file:.campaign/tgz/antelopejs-interface-api-util-639f38b.tgz(@antelopejs/interface-api@file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz))(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz) + '@antelopejs/interface-core': file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz reflect-metadata: 0.2.2 ws: 8.22.1 optionalDependencies: - '@antelopejs/core': 1.17.1 + '@antelopejs/core': file:.campaign/tgz/antelopejs-core-184eb90.tgz transitivePeerDependencies: - bufferutil - utf-8-validate - '@antelopejs/core@1.17.1': + '@antelopejs/core@file:.campaign/tgz/antelopejs-core-184eb90.tgz': dependencies: - '@antelopejs/interface-core': 0.2.7 + '@antelopejs/interface-core': file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz '@clack/prompts': 1.8.1 '@types/proper-lockfile': 4.1.4 commander: 13.1.0 @@ -2856,30 +2859,30 @@ snapshots: semver: 7.7.4 typescript: 5.9.3 - '@antelopejs/interface-api-util@file:.campaign/tgz/antelopejs-interface-api-util-639f38b.tgz(@antelopejs/interface-api@file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz(@antelopejs/interface-core@0.2.7))(@antelopejs/interface-core@0.2.7)': + '@antelopejs/interface-api-util@file:.campaign/tgz/antelopejs-interface-api-util-639f38b.tgz(@antelopejs/interface-api@file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz))(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz)': dependencies: - '@antelopejs/interface-api': file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz(@antelopejs/interface-core@0.2.7) - '@antelopejs/interface-core': 0.2.7 + '@antelopejs/interface-api': file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz) + '@antelopejs/interface-core': file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz - '@antelopejs/interface-api@file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz(@antelopejs/interface-core@0.2.7)': + '@antelopejs/interface-api@file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz)': dependencies: - '@antelopejs/interface-core': 0.2.7 + '@antelopejs/interface-core': file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz - '@antelopejs/interface-core@0.2.7': + '@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz': dependencies: reflect-metadata: 0.2.2 - '@antelopejs/interface-database-decorators@file:.campaign/tgz/antelopejs-interface-database-decorators-e79a62b.tgz(@antelopejs/interface-api@file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz(@antelopejs/interface-core@0.2.7))(@antelopejs/interface-core@0.2.7)(@antelopejs/interface-database@file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz(@antelopejs/interface-core@0.2.7))': + '@antelopejs/interface-database-decorators@file:.campaign/tgz/antelopejs-interface-database-decorators-1234214.tgz(@antelopejs/interface-api@file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz))(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz)(@antelopejs/interface-database@file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz))': dependencies: - '@antelopejs/interface-api': file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz(@antelopejs/interface-core@0.2.7) - '@antelopejs/interface-core': 0.2.7 - '@antelopejs/interface-database': file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz(@antelopejs/interface-core@0.2.7) + '@antelopejs/interface-api': file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz) + '@antelopejs/interface-core': file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz + '@antelopejs/interface-database': file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz) randomstring: 1.3.1 reflect-metadata: 0.2.2 - '@antelopejs/interface-database@file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz(@antelopejs/interface-core@0.2.7)': + '@antelopejs/interface-database@file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz(@antelopejs/interface-core@file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz)': dependencies: - '@antelopejs/interface-core': 0.2.7 + '@antelopejs/interface-core': file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz '@antelopejs/tooling-configs@0.2.17(eslint-plugin-perfectionist@5.11.0(eslint@10.10.0(jiti@2.7.0))(typescript@5.9.3))(knip@6.34.0)(oxfmt@0.66.0)(oxlint@1.81.0(oxlint-tsgolint@7.0.2001))': dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 0fe766f..0e3a33c 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,7 +1,8 @@ overrides: "@antelopejs/interface-database": "file:.campaign/tgz/antelopejs-interface-database-724ff72.tgz" - "@antelopejs/interface-database-decorators": "file:.campaign/tgz/antelopejs-interface-database-decorators-e79a62b.tgz" - "@antelopejs/interface-api": "file:.campaign/tgz/antelopejs-interface-api-f2a99b5.tgz" + "@antelopejs/interface-database-decorators": "file:.campaign/tgz/antelopejs-interface-database-decorators-1234214.tgz" + "@antelopejs/interface-api": "file:.campaign/tgz/antelopejs-interface-api-015a93a.tgz" "@antelopejs/interface-api-util": "file:.campaign/tgz/antelopejs-interface-api-util-639f38b.tgz" "@antelopejs/api": "file:.campaign/tgz/antelopejs-api-6afe3e2.tgz" - "@antelopejs/api>@antelopejs/interface-core": "0.2.7" + "@antelopejs/interface-core": "file:.campaign/tgz/antelopejs-interface-core-f7df541.tgz" + "@antelopejs/core": "file:.campaign/tgz/antelopejs-core-184eb90.tgz" diff --git a/src/index.ts b/src/index.ts index 7567fbe..9b1c149 100644 --- a/src/index.ts +++ b/src/index.ts @@ -25,6 +25,7 @@ import type { WriteDocument } from "@antelopejs/interface-database/common"; import { Parameters, Query, Validation } from "./components"; import { isWriteDocument, isWriteValue } from "./internal/guards"; +import { prototypeOf } from "./internal/prototypes"; import { DataAPIMeta, type DataControllerCallback, @@ -92,22 +93,21 @@ export function DataController< export const RegisterDataController = (): ClassDecorator => (target) => { const meta = GetMetadata(target, DataAPIMeta); + const prototype = prototypeOf(target); for (const [key, entry] of Object.entries(meta.endpoints)) { for (let i = 0; i < entry.callback.args.length; ++i) { const arg = entry.callback.args[i]; if (Array.isArray(arg)) { for (const step of arg) { - step(target.prototype, key, i); + step(prototype, key, i); } } else { - arg(target.prototype, key, i); + arg(prototype, key, i); } } - const meta = GetMetadata(target, ControllerMeta); - const fullLocation = `${meta.location}/${entry.endpoint ?? key}`.replace( - /\/+/g, - "/", - ); + const controllerMeta = GetMetadata(target, ControllerMeta); + const fullLocation = + `${target.location}/${entry.endpoint ?? key}`.replace(/\/+/g, "/"); RegisterRoute({ callback: (ctx: Parameters.DataRequestContext) => { ctx.dataAPIEntry = entry; @@ -116,16 +116,12 @@ export const RegisterDataController = method: entry.callback.method, mode: "prefix", parameters: [{ provider: (ctx) => ctx, modifiers: [] }], - properties: meta.computed_props, + properties: controllerMeta.computed_props, controller: target, }); - Route("handler", entry.callback.method, entry.endpoint)( - target.prototype, - key, - { - value: entry.callback.func, - }, - ); + Route("handler", entry.callback.method, entry.endpoint)(prototype, key, { + value: entry.callback.func, + }); } }; diff --git a/src/internal/guards.ts b/src/internal/guards.ts index d236515..573881d 100644 --- a/src/internal/guards.ts +++ b/src/internal/guards.ts @@ -23,9 +23,14 @@ export function isFunction(value: unknown): value is Function { return typeof value === "function"; } -/** Whether a value is a class: a function, which `new` may call. */ +/** + * Whether a value is a class: a function with an object `prototype`, which + * arrow functions, methods and bound functions lack. A generator function + * has one too, a language limit this check shares with every `prototype` + * test. + */ export function isClass(value: unknown): value is Class { - return isFunction(value); + return isFunction(value) && isObject(value.prototype); } /** Whether a value is a number. */ diff --git a/src/metadata.ts b/src/metadata.ts index 6e6d540..e7a8bc2 100644 --- a/src/metadata.ts +++ b/src/metadata.ts @@ -7,6 +7,7 @@ import { } from "@antelopejs/interface-database-decorators"; import { type Class, + type DecoratorTarget, MakeMethodAndPropertyDecorator, MakePropertyDecorator, } from "@antelopejs/interface-core/decorators"; @@ -36,7 +37,7 @@ import { rebuildPluck, targetJoinedFields, } from "./internal/meta-records"; -import { isString } from "./internal/guards"; +import { isClass, isString } from "./internal/guards"; import { classOf } from "./internal/prototypes"; import { resolveTableReference } from "./internal/table-reference"; @@ -504,12 +505,16 @@ export class DataAPIMeta { /** Declares a decorated field; a symbol-named property declares none. */ function onField( - target: { constructor: Class }, + target: DecoratorTarget, key: PropertyKey, declare: (meta: DataAPIMeta, name: string) => void, ) { if (!isString(key)) return; - declare(GetMetadata(target.constructor, DataAPIMeta), key); + const owner = target.constructor; + if (!isClass(owner)) { + throw new TypeError("A field decorator applies to a class."); + } + declare(GetMetadata(owner, DataAPIMeta), key); } /** @@ -703,7 +708,7 @@ const FilterDecoratorFactory = MakePropertyDecorator( export function Filter>( func?: FilterFunction, useIndex?: boolean, -): (target: T, propertyKey: string | symbol) => void { +) { return FilterDecoratorFactory(func, useIndex); } diff --git a/src/tests/index/field_decorator_target.test.ts b/src/tests/index/field_decorator_target.test.ts new file mode 100644 index 0000000..40656fc --- /dev/null +++ b/src/tests/index/field_decorator_target.test.ts @@ -0,0 +1,27 @@ +import { expect } from "chai"; +import { GetMetadata } from "@antelopejs/interface-core"; +import { Access, AccessMode, DataAPIMeta } from "../../metadata"; + +const REFUSAL = "A field decorator applies to a class."; + +describe("field decorators - target", () => { + it("refuses a target whose constructor is an arrow function", () => { + const target = { constructor: () => undefined }; + + expect(() => Access(AccessMode.ReadOnly)(target, "title")).to.throw( + TypeError, + REFUSAL, + ); + }); + + it("declares the field on a target whose constructor is a class", () => { + class Target { + declare title: string; + } + + Access(AccessMode.ReadOnly)(Target.prototype, "title"); + + const { fields } = GetMetadata(Target, DataAPIMeta); + expect(Object.hasOwn(fields, "title")).to.equal(true); + }); +});