ts-japi 1.12.1 → 1.12.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 (115) hide show
  1. package/.commitlintrc.ts +1 -1
  2. package/.github/workflows/ci.yml +32 -0
  3. package/.github/workflows/release-notes.yml +53 -0
  4. package/.github/workflows/{release-please.yaml → release-please.yml} +6 -7
  5. package/.github/workflows/release.yml +147 -0
  6. package/.node-version +1 -0
  7. package/.release-please-manifest.json +1 -1
  8. package/CHANGELOG.md +14 -0
  9. package/LICENSE +2 -1
  10. package/Makefile +1 -3
  11. package/README.md +307 -209
  12. package/benchmarks/playground.benchmark.ts +12 -12
  13. package/benchmarks/serializer.benchmark.ts +10 -10
  14. package/biome.json +141 -0
  15. package/lefthook.yml +12 -0
  16. package/lib/classes/cache.d.ts +4 -4
  17. package/lib/classes/cache.d.ts.map +1 -1
  18. package/lib/classes/cache.js +7 -5
  19. package/lib/classes/cache.js.map +1 -1
  20. package/lib/classes/error-serializer.d.ts +3 -3
  21. package/lib/classes/error-serializer.d.ts.map +1 -1
  22. package/lib/classes/error-serializer.js +18 -15
  23. package/lib/classes/error-serializer.js.map +1 -1
  24. package/lib/classes/linker.d.ts +3 -3
  25. package/lib/classes/linker.d.ts.map +1 -1
  26. package/lib/classes/metaizer.d.ts +2 -2
  27. package/lib/classes/metaizer.d.ts.map +1 -1
  28. package/lib/classes/paginator.d.ts +5 -5
  29. package/lib/classes/paginator.d.ts.map +1 -1
  30. package/lib/classes/paginator.js +6 -5
  31. package/lib/classes/paginator.js.map +1 -1
  32. package/lib/classes/polymorphic-serialiser.d.ts +9 -10
  33. package/lib/classes/polymorphic-serialiser.d.ts.map +1 -1
  34. package/lib/classes/polymorphic-serialiser.js +15 -6
  35. package/lib/classes/polymorphic-serialiser.js.map +1 -1
  36. package/lib/classes/relator.d.ts +11 -11
  37. package/lib/classes/relator.d.ts.map +1 -1
  38. package/lib/classes/relator.js +15 -6
  39. package/lib/classes/relator.js.map +1 -1
  40. package/lib/classes/serializer.d.ts +9 -9
  41. package/lib/classes/serializer.d.ts.map +1 -1
  42. package/lib/classes/serializer.js +38 -27
  43. package/lib/classes/serializer.js.map +1 -1
  44. package/lib/index.d.ts +21 -21
  45. package/lib/index.d.ts.map +1 -1
  46. package/lib/index.js +9 -9
  47. package/lib/index.js.map +1 -1
  48. package/lib/interfaces/cache.interface.d.ts +1 -1
  49. package/lib/interfaces/cache.interface.d.ts.map +1 -1
  50. package/lib/interfaces/error-serializer.interface.d.ts +37 -37
  51. package/lib/interfaces/error-serializer.interface.d.ts.map +1 -1
  52. package/lib/interfaces/error.interface.d.ts +21 -21
  53. package/lib/interfaces/error.interface.d.ts.map +1 -1
  54. package/lib/interfaces/json-api.interface.d.ts +12 -12
  55. package/lib/interfaces/json-api.interface.d.ts.map +1 -1
  56. package/lib/interfaces/linker.interface.d.ts +1 -1
  57. package/lib/interfaces/linker.interface.d.ts.map +1 -1
  58. package/lib/interfaces/paginator.interface.d.ts +2 -2
  59. package/lib/interfaces/paginator.interface.d.ts.map +1 -1
  60. package/lib/interfaces/relator.interface.d.ts +3 -3
  61. package/lib/interfaces/relator.interface.d.ts.map +1 -1
  62. package/lib/interfaces/serializer.interface.d.ts +78 -78
  63. package/lib/interfaces/serializer.interface.d.ts.map +1 -1
  64. package/lib/models/error.model.d.ts +4 -4
  65. package/lib/models/error.model.d.ts.map +1 -1
  66. package/lib/models/error.model.js +29 -18
  67. package/lib/models/error.model.js.map +1 -1
  68. package/lib/models/link.model.d.ts +1 -1
  69. package/lib/models/link.model.d.ts.map +1 -1
  70. package/lib/models/relationship.model.d.ts +5 -5
  71. package/lib/models/relationship.model.d.ts.map +1 -1
  72. package/lib/models/relationship.model.js +8 -5
  73. package/lib/models/relationship.model.js.map +1 -1
  74. package/lib/models/resource-identifier.model.d.ts +1 -1
  75. package/lib/models/resource-identifier.model.d.ts.map +1 -1
  76. package/lib/models/resource-identifier.model.js +2 -1
  77. package/lib/models/resource-identifier.model.js.map +1 -1
  78. package/lib/models/resource.model.d.ts +5 -5
  79. package/lib/models/resource.model.d.ts.map +1 -1
  80. package/lib/models/resource.model.js +6 -3
  81. package/lib/models/resource.model.js.map +1 -1
  82. package/lib/types/global.types.d.ts +9 -9
  83. package/lib/types/global.types.d.ts.map +1 -1
  84. package/lib/utils/is-error-document.d.ts +1 -1
  85. package/lib/utils/is-error-document.d.ts.map +1 -1
  86. package/lib/utils/is-error-document.js +3 -4
  87. package/lib/utils/is-error-document.js.map +1 -1
  88. package/lib/utils/is-object.d.ts.map +1 -1
  89. package/lib/utils/is-object.js +3 -3
  90. package/lib/utils/is-object.js.map +1 -1
  91. package/lib/utils/is-plain-object.d.ts.map +1 -1
  92. package/lib/utils/is-plain-object.js +9 -6
  93. package/lib/utils/is-plain-object.js.map +1 -1
  94. package/lib/utils/merge.d.ts +1 -1
  95. package/lib/utils/merge.d.ts.map +1 -1
  96. package/lib/utils/merge.js +5 -3
  97. package/lib/utils/merge.js.map +1 -1
  98. package/lib/utils/serializer.utils.d.ts +4 -4
  99. package/lib/utils/serializer.utils.d.ts.map +1 -1
  100. package/lib/utils/serializer.utils.js +35 -22
  101. package/lib/utils/serializer.utils.js.map +1 -1
  102. package/package.json +48 -66
  103. package/release-please-config.json +8 -3
  104. package/tsconfig.json +4 -3
  105. package/.github/release-please.yml +0 -4
  106. package/.github/workflows/ci.yaml +0 -73
  107. package/.github/workflows/publish.yaml +0 -29
  108. package/.husky/pre-commit +0 -4
  109. package/.husky/pre-push +0 -4
  110. package/.prettierignore +0 -4
  111. package/.prettierrc +0 -10
  112. package/api-extractor.json +0 -14
  113. package/tools/generate_docs.ts +0 -33
  114. package/tools/internal/custom_markdown_action.ts +0 -32
  115. package/tools/internal/custom_markdown_documenter.ts +0 -1337
package/.commitlintrc.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export default {
2
- extends: ['@commitlint/config-conventional'],
2
+ extends: ["@commitlint/config-conventional"],
3
3
  };
@@ -0,0 +1,32 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ci-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ ci:
15
+ name: CI
16
+ runs-on: ubuntu-latest
17
+ timeout-minutes: 15
18
+ steps:
19
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20
+ - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
21
+ - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
22
+ with:
23
+ node-version-file: .node-version
24
+ cache: pnpm
25
+ - name: Install
26
+ run: pnpm install --frozen-lockfile
27
+ - name: Lint
28
+ run: pnpm lint
29
+ - name: Build
30
+ run: pnpm build
31
+ - name: Test
32
+ run: pnpm test
@@ -0,0 +1,53 @@
1
+ name: Release Notes
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ tag:
7
+ description: "Release tag (e.g. v1.12.0)"
8
+ required: true
9
+ type: string
10
+
11
+ concurrency:
12
+ group: release-notes-${{ github.event.inputs.tag }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ enhance:
17
+ name: Enhance release notes with Claude
18
+ runs-on: ubuntu-latest
19
+ permissions:
20
+ contents: write
21
+ id-token: write
22
+ steps:
23
+ - name: Checkout
24
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25
+ with:
26
+ fetch-depth: 0
27
+
28
+ - name: Write release notes with Claude
29
+ uses: anthropics/claude-code-action@26ec041249acb0a944c0a47b6c0c13f05dbc5b44 # v1
30
+ with:
31
+ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
32
+ claude_args: --allowedTools "Bash(git log:*),Bash(git describe:*),Read,Write"
33
+ prompt: |
34
+ Write an exciting, polished GitHub release body for ts-japi ${{ inputs.tag }} and save it to `release-notes.md`.
35
+
36
+ ts-japi is a highly-modular, TypeScript-friendly, framework-agnostic library for serializing data to the JSON:API specification. It provides serializers, deserializers, error handling, pagination, sorting, filtering, and full relationship support.
37
+
38
+ Steps:
39
+ 1. Run `git describe --tags --abbrev=0 HEAD^` to get the previous tag, then run `git log <previous-tag>..HEAD --oneline` to see all commits in this release.
40
+ 2. Read `src/index.ts` and key source files under `src/` to understand the API surface.
41
+ 3. Write the release body to `release-notes.md`. It should:
42
+ - Open with an enthusiastic one-paragraph summary of what's new or why this release is exciting.
43
+ - Have clearly labelled sections (e.g. **✨ New Features**, **🐛 Bug Fixes**, **⚡ Improvements**) — only include sections that actually have content.
44
+ - For any significant new feature, include a short TypeScript example snippet showing it in action.
45
+ - End with an installation snippet (`npm install ts-japi` or `pnpm add ts-japi`).
46
+ - Be written in an upbeat, developer-friendly tone — celebrate the work!
47
+ Do NOT publish it yourself — a subsequent step will do that.
48
+
49
+ - name: Publish release notes
50
+ uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
51
+ with:
52
+ tag_name: ${{ inputs.tag }}
53
+ body_path: release-notes.md
@@ -1,21 +1,20 @@
1
+ name: Release Please
2
+
1
3
  on:
2
4
  push:
3
- branches:
4
- - main
5
+ branches: [main]
5
6
 
6
7
  permissions:
7
8
  contents: write
8
- issues: write
9
9
  pull-requests: write
10
10
 
11
- name: release-please
12
-
13
11
  jobs:
14
12
  release-please:
15
13
  runs-on: ubuntu-latest
16
14
  steps:
17
- - uses: googleapis/release-please-action@v4
15
+ - name: Run Release Please
16
+ uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4
18
17
  with:
19
- token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
18
+ token: ${{ secrets.RELEASE_TOKEN }}
20
19
  config-file: release-please-config.json
21
20
  manifest-file: .release-please-manifest.json
@@ -0,0 +1,147 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ concurrency:
9
+ group: release-${{ github.workflow }}-${{ github.ref }}
10
+ cancel-in-progress: false
11
+
12
+ permissions:
13
+ contents: write
14
+ id-token: write
15
+ attestations: write
16
+
17
+ jobs:
18
+ build-artifacts:
19
+ name: Build
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24
+ - name: Set up pnpm
25
+ uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
26
+ - name: Set up Node.js
27
+ uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
28
+ with:
29
+ node-version-file: .node-version
30
+ cache: "pnpm"
31
+ - name: Install dependencies
32
+ run: pnpm install --frozen-lockfile
33
+ - name: Build
34
+ run: pnpm build
35
+ - name: Pack
36
+ run: pnpm pack
37
+ - name: Upload artifact archive
38
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
39
+ with:
40
+ name: build-artifact
41
+ path: "*.tgz"
42
+
43
+ release-assets:
44
+ name: Assemble Release Assets
45
+ needs:
46
+ - build-artifacts
47
+ runs-on: ubuntu-latest
48
+ steps:
49
+ - name: Download build artifact
50
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
51
+ with:
52
+ name: build-artifact
53
+ path: dist
54
+ - name: Upload complete release assets
55
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
56
+ with:
57
+ name: release-assets
58
+ path: dist/*
59
+
60
+ create-release:
61
+ name: Publish GitHub Release
62
+ needs:
63
+ - release-assets
64
+ runs-on: ubuntu-latest
65
+ environment: release
66
+ permissions:
67
+ contents: write
68
+ id-token: write
69
+ steps:
70
+ - name: Checkout
71
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
72
+ with:
73
+ fetch-depth: 0
74
+
75
+ - name: Download release assets
76
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
77
+ with:
78
+ name: release-assets
79
+ path: dist
80
+
81
+ - name: Create GitHub release
82
+ uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
83
+ with:
84
+ tag_name: ${{ github.ref_name }}
85
+ name: ${{ github.ref_name }}
86
+ generate_release_notes: true
87
+ prerelease: ${{ contains(github.ref_name, '-') }}
88
+ files: dist/*
89
+ fail_on_unmatched_files: true
90
+ make_latest: ${{ !contains(github.ref_name, '-') }}
91
+
92
+ - name: Trigger release notes workflow
93
+ env:
94
+ GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
95
+ run: |
96
+ gh workflow run release-notes.yml \
97
+ --field tag="${{ github.ref_name }}"
98
+
99
+ attest-provenance:
100
+ name: Attest Build Provenance
101
+ needs:
102
+ - create-release
103
+ runs-on: ubuntu-latest
104
+ permissions:
105
+ id-token: write
106
+ attestations: write
107
+ contents: read
108
+ steps:
109
+ - name: Download release assets
110
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
111
+ with:
112
+ name: release-assets
113
+ path: dist
114
+ - name: Attest release assets
115
+ uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
116
+ with:
117
+ subject-path: |
118
+ dist/*
119
+
120
+ publish-npm:
121
+ name: Publish to npm
122
+ needs:
123
+ - create-release
124
+ runs-on: ubuntu-latest
125
+ environment: release
126
+ permissions:
127
+ contents: read
128
+ id-token: write
129
+ steps:
130
+ - name: Checkout
131
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
132
+ - name: Set up pnpm
133
+ uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
134
+ - name: Set up Node.js
135
+ uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
136
+ with:
137
+ node-version-file: .node-version
138
+ cache: "pnpm"
139
+ registry-url: "https://registry.npmjs.org"
140
+ - name: Upgrade npm
141
+ run: npm install -g npm@latest
142
+ - name: Install dependencies
143
+ run: pnpm install --frozen-lockfile
144
+ - name: Build
145
+ run: pnpm build
146
+ - name: Publish
147
+ run: pnpm publish --no-git-checks
package/.node-version ADDED
@@ -0,0 +1 @@
1
+ 24
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "1.12.1"
2
+ ".": "1.12.3"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.12.3](https://github.com/mathematic-inc/ts-japi/compare/v1.12.2...v1.12.3) (2026-03-11)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * Auto-exclude relator fields from attributes ([#114](https://github.com/mathematic-inc/ts-japi/issues/114)) ([4ce44c2](https://github.com/mathematic-inc/ts-japi/commit/4ce44c225d28c364d2509925710b39da45df781a)), closes [#77](https://github.com/mathematic-inc/ts-japi/issues/77)
9
+
10
+ ## [1.12.2](https://github.com/mathematic-inc/ts-japi/compare/v1.12.1...v1.12.2) (2026-03-11)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Migrate tooling from eslint/prettier/yarn/husky to biome/pnpm/lefthook ([#110](https://github.com/mathematic-inc/ts-japi/issues/110)) ([8f18a95](https://github.com/mathematic-inc/ts-japi/commit/8f18a9507eb6fa49c778948df5970db3ec44dabd))
16
+
3
17
  ## [1.12.1](https://github.com/mathematic-inc/ts-japi/compare/v1.12.0...v1.12.1) (2025-11-05)
4
18
 
5
19
 
package/LICENSE CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  Apache License
2
3
  Version 2.0, January 2004
3
4
  http://www.apache.org/licenses/
@@ -186,7 +187,7 @@
186
187
  same "printed page" as the copyright notice for easier
187
188
  identification within third-party archives.
188
189
 
189
- Copyright [yyyy] [name of copyright owner]
190
+ Copyright 2020 Mathematic Inc
190
191
 
191
192
  Licensed under the Apache License, Version 2.0 (the "License");
192
193
  you may not use this file except in compliance with the License.
package/Makefile CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH:=$(PATH):$(PWD)/node_modules/.bin
2
2
  SHELL:=env PATH=$(PATH) /bin/bash
3
3
 
4
- clean: clean-build clean-coverage
4
+ clean: clean-lib clean-coverage
5
5
 
6
6
  clean-lib:
7
7
  @echo 'Cleaning build artifacts...'
@@ -13,7 +13,5 @@ clean-coverage:
13
13
 
14
14
  .PHONY: all
15
15
  .PHONY: clean
16
- .PHONY: clean-docs
17
- .PHONY: clean-readme
18
16
  .PHONY: clean-lib
19
17
  .PHONY: clean-coverage