ts-japi 1.6.3 → 1.7.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/.commitlintrc.ts +3 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +5 -6
- package/.github/ISSUE_TEMPLATE/feature_request.md +4 -5
- package/.github/ISSUE_TEMPLATE/request-for-comments.md +29 -42
- package/.github/release-please.yml +4 -0
- package/.github/workflows/ci.yaml +73 -0
- package/.github/workflows/publish.yaml +29 -0
- package/.husky/pre-commit +4 -0
- package/.husky/pre-push +4 -0
- package/.prettierignore +2 -0
- package/.release-please-manifest.json +3 -0
- package/CHANGELOG.md +7 -0
- package/lib/classes/relator.d.ts +1 -1
- package/lib/classes/relator.d.ts.map +1 -1
- package/lib/classes/relator.js +5 -1
- package/lib/classes/relator.js.map +1 -1
- package/lib/classes/serializer.d.ts.map +1 -1
- package/lib/classes/serializer.js +4 -1
- package/lib/classes/serializer.js.map +1 -1
- package/lib/models/error.model.d.ts.map +1 -1
- package/lib/models/error.model.js +13 -5
- package/lib/models/error.model.js.map +1 -1
- package/package.json +20 -9
- package/release-please-config.json +10 -0
- package/tsconfig.json +56 -61
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -10
- package/lib/tsdoc-metadata.json +0 -11
package/.commitlintrc.ts
ADDED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: Bug report
|
|
3
3
|
about: Create a report to help us improve
|
|
4
|
-
title:
|
|
4
|
+
title: '[BUG] {{issue name}}'
|
|
5
5
|
labels: bug
|
|
6
6
|
assignees: jun-sheaf
|
|
7
|
-
|
|
8
7
|
---
|
|
9
8
|
|
|
10
|
-
## Describe the bug<sup
|
|
9
|
+
## Describe the bug<sup>\*</sup>
|
|
11
10
|
|
|
12
11
|
{{A clear and concise description of what the bug is.}}
|
|
13
12
|
|
|
14
|
-
## To Reproduce<sup
|
|
13
|
+
## To Reproduce<sup>\*</sup>
|
|
15
14
|
|
|
16
15
|
{{Add steps/examples to reproduce the behavior.}}
|
|
17
16
|
|
|
18
|
-
## Expected behavior<sup
|
|
17
|
+
## Expected behavior<sup>\*</sup>
|
|
19
18
|
|
|
20
19
|
{{A clear and concise description of what you expected to happen.}}
|
|
21
20
|
|
|
@@ -23,7 +22,7 @@ assignees: jun-sheaf
|
|
|
23
22
|
|
|
24
23
|
{{Add screenshots to help explain your problem.}}
|
|
25
24
|
|
|
26
|
-
## Platform<sup
|
|
25
|
+
## Platform<sup>\*</sup>
|
|
27
26
|
|
|
28
27
|
- [ ] OS: {{ Write the OS name and its version }}
|
|
29
28
|
- [ ] Browser {{ Write the browser name and its version }}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: Feature request
|
|
3
3
|
about: Suggest an idea for this project
|
|
4
|
-
title:
|
|
4
|
+
title: '[FR] {{feature request name}}'
|
|
5
5
|
labels: enhancement
|
|
6
6
|
assignees: jun-sheaf
|
|
7
|
-
|
|
8
7
|
---
|
|
9
8
|
|
|
10
|
-
## Is your feature request related to a problem? <sup
|
|
9
|
+
## Is your feature request related to a problem? <sup>\*</sup>
|
|
11
10
|
|
|
12
11
|
{{A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]}}
|
|
13
12
|
|
|
14
|
-
## Describe the solution you'd like<sup
|
|
13
|
+
## Describe the solution you'd like<sup>\*</sup>
|
|
15
14
|
|
|
16
15
|
{{A clear and concise description of what you want to happen.}}
|
|
17
16
|
|
|
18
|
-
## Describe alternatives you've considered<sup
|
|
17
|
+
## Describe alternatives you've considered<sup>\*</sup>
|
|
19
18
|
|
|
20
19
|
{{A clear and concise description of any alternative solutions or features you've considered.}}
|
|
21
20
|
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: Request for comments
|
|
3
3
|
about: Request for comments around the community.
|
|
4
|
-
title:
|
|
4
|
+
title: '[RFC] {{RFC name}}'
|
|
5
5
|
labels: good first issue, question
|
|
6
6
|
assignees: jun-sheaf
|
|
7
|
-
|
|
8
7
|
---
|
|
9
8
|
|
|
10
|
-
## Summary<sup
|
|
9
|
+
## Summary<sup>\*</sup>
|
|
11
10
|
|
|
12
11
|
{{One paragraph explanation of the change}}
|
|
13
12
|
|
|
14
|
-
## Motivation<sup
|
|
13
|
+
## Motivation<sup>\*</sup>
|
|
15
14
|
|
|
16
15
|
{{
|
|
17
16
|
Why are we doing this? What use cases does it support? What is the expected
|
|
18
17
|
outcome?
|
|
19
18
|
}}
|
|
20
19
|
|
|
21
|
-
## Design Detail<sup
|
|
20
|
+
## Design Detail<sup>\*</sup>
|
|
22
21
|
|
|
23
22
|
{{
|
|
24
23
|
Explain the design in enough detail for somebody familiar with the
|
|
@@ -27,7 +26,7 @@ and can include examples of how the service is used. Any new terminology should
|
|
|
27
26
|
be defined here.
|
|
28
27
|
}}
|
|
29
28
|
|
|
30
|
-
## Drawbacks<sup
|
|
29
|
+
## Drawbacks<sup>\*</sup>
|
|
31
30
|
|
|
32
31
|
{{
|
|
33
32
|
Why should we *not* do this? Please consider the impact on users, on the
|
|
@@ -35,50 +34,38 @@ integration of this change with other existing and planned features etc. There
|
|
|
35
34
|
are tradeoffs to choosing any path, please attempt to identify them here.
|
|
36
35
|
}}
|
|
37
36
|
|
|
38
|
-
## Rationale and Alternatives<sup
|
|
37
|
+
## Rationale and Alternatives<sup>\*</sup>
|
|
39
38
|
|
|
40
|
-
{{
|
|
41
|
-
Why is this design the best in the space of possible designs?
|
|
39
|
+
{{ Why is this design the best in the space of possible designs?
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
choosing them?
|
|
41
|
+
What other designs have been considered and what is the rationale for not choosing them?
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
}}
|
|
43
|
+
What is the impact of not doing this? }}
|
|
48
44
|
|
|
49
|
-
## Prior Art<sup
|
|
45
|
+
## Prior Art<sup>\*</sup>
|
|
50
46
|
|
|
51
|
-
{{
|
|
52
|
-
|
|
53
|
-
few examples of what this can include are:
|
|
54
|
-
|
|
55
|
-
{{
|
|
56
|
-
How other services / infrastructures in the same domain have solved this
|
|
57
|
-
problem.
|
|
58
|
-
|
|
59
|
-
Are there any published papers or great posts that discuss this? If you have
|
|
60
|
-
some relevant papers to refer to, this can serve as a more detailed
|
|
61
|
-
theoretical background.
|
|
62
|
-
}}
|
|
63
|
-
|
|
64
|
-
This section is intended to encourage you as an author to think about the
|
|
65
|
-
lessons from other organisations, provide readers of your RFC with a fuller
|
|
66
|
-
picture. If there is no prior art, that is fine - your ideas are interesting
|
|
67
|
-
whether they are brand new or if it is an adaptation from other services.
|
|
68
|
-
}}
|
|
47
|
+
{{ Discuss prior art, both the good and the bad, in relation to this proposal. A few examples of
|
|
48
|
+
what this can include are:
|
|
69
49
|
|
|
70
|
-
|
|
50
|
+
{{ How other services / infrastructures in the same domain have solved this problem.
|
|
71
51
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
before this gets merged?
|
|
52
|
+
Are there any published papers or great posts that discuss this? If you have some relevant papers to
|
|
53
|
+
refer to, this can serve as a more detailed theoretical background. }}
|
|
75
54
|
|
|
76
|
-
|
|
77
|
-
|
|
55
|
+
This section is intended to encourage you as an author to think about the lessons from other
|
|
56
|
+
organisations, provide readers of your RFC with a fuller picture. If there is no prior art, that is
|
|
57
|
+
fine - your ideas are interesting whether they are brand new or if it is an adaptation from other
|
|
58
|
+
services. }}
|
|
78
59
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
RFC
|
|
82
|
-
|
|
60
|
+
## Unresolved questions<sup>\*</sup>
|
|
61
|
+
|
|
62
|
+
{{ What parts of the design do you expect to resolve through the RFC process before this gets
|
|
63
|
+
merged?
|
|
64
|
+
|
|
65
|
+
What parts of the design do you expect to resolve through the implementation of this feature before
|
|
66
|
+
stabilisation?
|
|
67
|
+
|
|
68
|
+
What related issues do you consider out of scope for this RFC that could be addressed in the future
|
|
69
|
+
independently of the solution that comes out of this RFC? }}
|
|
83
70
|
|
|
84
71
|
\* means required.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
# Declare default permissions as read only.
|
|
4
|
+
permissions: read-all
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
pull_request:
|
|
11
|
+
branches:
|
|
12
|
+
- '**'
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: ${{ github.head_ref || github.run_id }}
|
|
16
|
+
cancel-in-progress: true
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
inspect-code:
|
|
20
|
+
name: Inspect code
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout
|
|
24
|
+
uses: actions/checkout@v3
|
|
25
|
+
with:
|
|
26
|
+
fetch-depth: 2
|
|
27
|
+
- name: Set up Node.js
|
|
28
|
+
uses: actions/setup-node@v3.4.1
|
|
29
|
+
with:
|
|
30
|
+
node-version: 18
|
|
31
|
+
- name: Install dependencies
|
|
32
|
+
run: yarn install --frozen-lockfile
|
|
33
|
+
- name: Lint code
|
|
34
|
+
run: yarn lint
|
|
35
|
+
- name: Lint commits
|
|
36
|
+
run: yarn commitlint
|
|
37
|
+
if: github.event_name != 'pull_request'
|
|
38
|
+
|
|
39
|
+
tests:
|
|
40
|
+
name: ${{ matrix.spec.name }} tests (${{ matrix.spec.node }})
|
|
41
|
+
runs-on: ${{ matrix.spec.machine }}
|
|
42
|
+
continue-on-error: true
|
|
43
|
+
strategy:
|
|
44
|
+
matrix:
|
|
45
|
+
spec:
|
|
46
|
+
- name: Linux
|
|
47
|
+
machine: ubuntu-latest
|
|
48
|
+
node: 14
|
|
49
|
+
- name: Linux
|
|
50
|
+
machine: ubuntu-latest
|
|
51
|
+
node: 16
|
|
52
|
+
- name: Linux
|
|
53
|
+
machine: ubuntu-latest
|
|
54
|
+
node: 18
|
|
55
|
+
- name: macOS
|
|
56
|
+
machine: macos-latest
|
|
57
|
+
node: 14
|
|
58
|
+
- name: Windows
|
|
59
|
+
machine: windows-latest
|
|
60
|
+
node: 14
|
|
61
|
+
steps:
|
|
62
|
+
- name: Checkout
|
|
63
|
+
uses: actions/checkout@v3
|
|
64
|
+
- name: Set up Node.js
|
|
65
|
+
uses: actions/setup-node@v3.4.1
|
|
66
|
+
with:
|
|
67
|
+
node-version: ${{ matrix.spec.node }}
|
|
68
|
+
- name: Install dependencies
|
|
69
|
+
run: yarn install --frozen-lockfile
|
|
70
|
+
- name: Build
|
|
71
|
+
run: yarn build
|
|
72
|
+
- name: Test
|
|
73
|
+
run: yarn test
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
tags:
|
|
7
|
+
- v*
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v3
|
|
17
|
+
- name: Set up Node.js
|
|
18
|
+
uses: actions/setup-node@v3.4.1
|
|
19
|
+
with:
|
|
20
|
+
node-version: 18
|
|
21
|
+
registry-url: 'https://registry.npmjs.org'
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: yarn install --frozen-lockfile
|
|
24
|
+
- name: Build
|
|
25
|
+
run: yarn build
|
|
26
|
+
- name: Publish
|
|
27
|
+
run: npm publish
|
|
28
|
+
env:
|
|
29
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.husky/pre-push
ADDED
package/.prettierignore
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.7.0](https://github.com/mathematic-inc/ts-japi/compare/v1.6.3...v1.7.0) (2022-08-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* ignore relationships if they're not set to support optional relations ([#49](https://github.com/mathematic-inc/ts-japi/issues/49)) ([7bd7d53](https://github.com/mathematic-inc/ts-japi/commit/7bd7d5372c96841583dce9bd01a8bbb4cb220b8e))
|
|
9
|
+
|
|
3
10
|
## 1.6.2
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/lib/classes/relator.d.ts
CHANGED
|
@@ -50,6 +50,6 @@ export default class Relator<PrimaryType, RelatedType extends Dictionary<any> =
|
|
|
50
50
|
/** @internal Gets related meta from primary data and related data */
|
|
51
51
|
getRelatedMeta(data: PrimaryType, relatedData: RelatedType | RelatedType[] | nullish): Meta | undefined;
|
|
52
52
|
/** @internal Creates a {@link Relationship}. */
|
|
53
|
-
getRelationship(data: PrimaryType, relatedDataCache?: Dictionary<any>[]): Promise<Relationship>;
|
|
53
|
+
getRelationship(data: PrimaryType, relatedDataCache?: Dictionary<any>[]): Promise<Relationship | undefined>;
|
|
54
54
|
}
|
|
55
55
|
//# sourceMappingURL=relator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relator.d.ts","sourceRoot":"","sources":["../../src/classes/relator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,IAAI,MAAM,sBAAsB,CAAC;AACxC,OAAO,IAAI,MAAM,sBAAsB,CAAC;AACxC,OAAO,YAAqC,MAAM,8BAA8B,CAAC;AACjF,OAAO,kBAAkB,MAAM,qCAAqC,CAAC;AACrE,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM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
|
|
99
99
|
relationshipOptions.meta = meta;
|
|
100
|
-
|
|
100
|
+
let relationship;
|
|
101
|
+
if (relatedData !== undefined || meta || links) {
|
|
102
|
+
relationship = new relationship_model_1.default(relationshipOptions);
|
|
103
|
+
}
|
|
104
|
+
return relationship;
|
|
101
105
|
}
|
|
102
106
|
}
|
|
103
107
|
exports.default = Relator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relator.js","sourceRoot":"","sources":["../../src/classes/relator.ts"],"names":[],"mappings":";;;;;AAIA,sFAAiF;AAIjF,2DAAmC;AAInC;;;;;;;;GAQG;AACH,MAAqB,OAAO;IAC1B;;OAEG;IACI,MAAM,CAAC,cAAc,GAAG;QAC7B,OAAO,EAAE,EAAE;KACZ,CAAC;IAEF;;OAEG;IACK,OAAO,CAA2C;IAEnD,WAAW,CAAS;IAC3B;;;;;;OAMG;IACH,YACE,KAA4E,EAC5E,UAAmC,EACnC,UAA6D,EAAE;QAE/D,0BAA0B;QAC1B,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,UAAU,CAAC,cAAc,CAAC;QACpE,IAAI,CAAC,OAAO,GAAG,IAAA,eAAK,EAAC,EAAE,EAAE,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,IAAI,CAAC,kBAAkB,GAAG,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACrE,IAAI,CAAC,oBAAoB,GAAG,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACzE,IAAI,CAAC,kBAAkB,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpE,CAAC;IAED,qDAAqD;IAC9C,cAAc,CAAwE;IAE7F,sCAAsC;IAC/B,kBAAkB,CAA8D;IAEvF,4CAA4C;IACrC,oBAAoB,CAGH;IAExB,0CAA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iC;IAEhD;;OAEG;IACI,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAErC;;OAEG;IACI,KAAK,qBAA4B;IAExC;;;;;OAKG;gBAED,cAAc,EAAE,MAAM,EACtB,OAAO,GAAE,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAM;IAavD;;OAEG;IACI,WAAW;IAIlB;;OAEG;IACI,WAAW,CAAC,QAAQ,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC;IAKvE,kDAAkD;IAC3C,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,iBAAiB,CAAC,WAAW,CAAC;IAanF,wCAAwC;IAC3B,cAAc,CACzB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,iBAAiB,CAAC,WAAW,CAAC,EACxC,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,EAC9B,gBAAgB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;IAkDzD;;;;;OAKG;IACU,SAAS,CACpB,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,OAAO,EAC1C,OAAO,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;CA+IpD"}
|
|
@@ -112,7 +112,10 @@ class Serializer {
|
|
|
112
112
|
relatedDataCache = relatorDataCache.get(relator) || [];
|
|
113
113
|
relatorDataCache.set(relator, relatedDataCache);
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
const relationship = await relator.getRelationship(data, relatedDataCache);
|
|
116
|
+
if (relationship) {
|
|
117
|
+
relationships[name] = relationship;
|
|
118
|
+
}
|
|
116
119
|
}));
|
|
117
120
|
resourceOptions.relationships = relationships;
|
|
118
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../src/classes/serializer.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ACL,QAAQ,CAAC,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;SAC5D;QACD,IAAI,QAAQ,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,EAAE;YAC3B,QAAQ,CAAC,QAAQ,GAAG,CAAC,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM,CAClD,MAAM,IAAA,kCAAe,EAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,gBAAgB,CAAC,CACtE,CAAC;SACH;QAED,IAAI,SAAS,EAAE;YACb,QAAQ,CAAC,IAAI,GAAI,QAAQ,CAAC,IAAc,CAAC,CAAC,CAAC,CAAC;SAC7C;QAED,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;;AArSH,6BAsSC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.model.d.ts","sourceRoot":"","sources":["../../src/models/error.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"error.model.d.ts","sourceRoot":"","sources":["../../src/models/error.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,IAAI,MAAM,cAAc,CAAC;AAEhC,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B;;;;OAIG;WACW,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAAC,SAAS,CAAC;IAuB1E,gBAAgB;IACT,KAAK,EAAG,MAAM,CAAC;IAEtB;;OAEG;IACI,EAAE,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACI,MAAM,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACI,IAAI,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACI,KAAK,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACI,MAAM,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACI,MAAM,CAAC,EAAE;QACd;;;;WAIG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF;;OAEG;IACI,KAAK,CAAC,EAAE,UAAU,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;IAE1C;;OAEG;IACI,IAAI,CAAC,EAAE,IAAI,CAAC;gBAEA,OAAO,GAAE,YAAiB;CAS9C"}
|
|
@@ -10,11 +10,19 @@ class JapiError {
|
|
|
10
10
|
static isLikeJapiError(error) {
|
|
11
11
|
if (!(0, is_object_1.isObject)(error))
|
|
12
12
|
return false;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const hasErrorKeys = [
|
|
14
|
+
'id',
|
|
15
|
+
'status',
|
|
16
|
+
'code',
|
|
17
|
+
'title',
|
|
18
|
+
'detail',
|
|
19
|
+
'source',
|
|
20
|
+
'links',
|
|
21
|
+
'meta',
|
|
22
|
+
].some((attrName) => attrName in error);
|
|
23
|
+
const expectedStringKeys = ['id', 'status', 'code', 'title', 'detail'].every((attrName) => !(attrName in error) || error[attrName] === undefined || typeof error[attrName] === 'string');
|
|
24
|
+
const expectedObjectKeys = ['source', 'links', 'meta'].every((attrName) => !(attrName in error) || error[attrName] === undefined || (0, is_object_1.isObject)(error[attrName]));
|
|
25
|
+
return hasErrorKeys && [expectedStringKeys, expectedObjectKeys].every((v) => v);
|
|
18
26
|
}
|
|
19
27
|
/** @internal */
|
|
20
28
|
stack;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.model.js","sourceRoot":"","sources":["../../src/models/error.model.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"error.model.js","sourceRoot":"","sources":["../../src/models/error.model.ts"],"names":[],"mappings":";;AAEA,kDAA8C;AAI9C,MAAqB,SAAS;IAC5B;;;;OAIG;IACI,MAAM,CAAC,eAAe,CAAC,KAAc;QAC1C,IAAI,CAAC,IAAA,oBAAQ,EAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QACnC,MAAM,YAAY,GAAG;YACnB,IAAI;YACJ,QAAQ;YACR,MAAM;YACN,OAAO;YACP,QAAQ;YACR,QAAQ;YACR,OAAO;YACP,MAAM;SACP,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,IAAI,KAAK,CAAC,CAAC;QACxC,MAAM,kBAAkB,GAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAW,CAAC,KAAK,CACrF,CAAC,QAAQ,EAAE,EAAE,CACX,CAAC,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,SAAS,IAAI,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,QAAQ,CAC/F,CAAC;QACF,MAAM,kBAAkB,GAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAW,CAAC,KAAK,CACrE,CAAC,QAAQ,EAAE,EAAE,CACX,CAAC,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,SAAS,IAAI,IAAA,oBAAQ,EAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CACrF,CAAC;QACF,OAAO,YAAY,IAAI,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,gBAAgB;IACT,KAAK,CAAU;IAEtB;;OAEG;IACI,EAAE,CAAU;IAEnB;;;OAGG;IACI,MAAM,CAAU;IAEvB;;OAEG;IACI,IAAI,CAAU;IAErB;;;;OAIG;IACI,KAAK,CAAU;IAEtB;;;OAGG;IACI,MAAM,CAAU;IAEvB;;;OAGG;IACI,MAAM,CAYX;IAEF;;OAEG;IACI,KAAK,CAA8B;IAE1C;;OAEG;IACI,IAAI,CAAQ;IAEnB,YAAmB,UAAwB,EAAE;QAC3C,IAAI,OAAO,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;QACrC,IAAI,OAAO,CAAC,MAAM;YAAE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC5D,IAAI,OAAO,CAAC,IAAI;YAAE,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAC3C,IAAI,OAAO,CAAC,KAAK;YAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC9C,IAAI,OAAO,CAAC,MAAM;YAAE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QACjD,IAAI,OAAO,CAAC,MAAM;YAAE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QACjD,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvC,CAAC;CACF;AAlGD,4BAkGC"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-japi",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "A highly-modular (typescript-friendly)-framework agnostic library for serializing data to the JSON:API specification",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
"playground": "ts-node ./benchmarks/playground.benchmark",
|
|
9
|
-
"lint": "eslint .",
|
|
10
|
-
"examples": "ts-node ./examples/",
|
|
11
|
-
"docs": "npm run api-extractor && ts-node tools/generate_docs.ts",
|
|
12
|
-
"clean": "make clean",
|
|
13
|
-
"build": "tsc",
|
|
7
|
+
"api-extractor": "api-extractor run",
|
|
14
8
|
"benchmark": "ts-node ./benchmarks/serializer.benchmark",
|
|
15
|
-
"
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"clean": "make clean",
|
|
11
|
+
"commitlint": "commitlint --from=HEAD~1",
|
|
12
|
+
"docs": "npm run api-extractor && ts-node tools/generate_docs.ts",
|
|
13
|
+
"format": "run-s format:*",
|
|
14
|
+
"format:prettier": "prettier --write .",
|
|
15
|
+
"format:eslint": "eslint --fix .",
|
|
16
|
+
"examples": "ts-node ./examples/",
|
|
17
|
+
"lint": "run-s lint:*",
|
|
18
|
+
"lint:prettier": "prettier --check .",
|
|
19
|
+
"lint:eslint": "eslint .",
|
|
20
|
+
"playground": "ts-node ./benchmarks/playground.benchmark",
|
|
21
|
+
"prepare": "husky install",
|
|
22
|
+
"test": "jest --runInBand --verbose --coverage"
|
|
16
23
|
},
|
|
17
24
|
"publishConfig": {
|
|
18
25
|
"access": "public",
|
|
@@ -46,6 +53,8 @@
|
|
|
46
53
|
"@babel/preset-env": "^7.18.6",
|
|
47
54
|
"@babel/preset-typescript": "^7.18.6",
|
|
48
55
|
"@changesets/cli": "^2.23.0",
|
|
56
|
+
"@commitlint/cli": "^17.0.1",
|
|
57
|
+
"@commitlint/config-conventional": "^17.0.2",
|
|
49
58
|
"@microsoft/api-documenter": "^7.18.0",
|
|
50
59
|
"@microsoft/api-extractor": "^7.28.2",
|
|
51
60
|
"@types/benchmark": "^2.1.1",
|
|
@@ -61,8 +70,10 @@
|
|
|
61
70
|
"eslint-config-prettier": "^8.5.0",
|
|
62
71
|
"eslint-plugin-prettier": "^4.2.1",
|
|
63
72
|
"eslint-plugin-tsdoc": "^0.2.16",
|
|
73
|
+
"husky": "^8.0.1",
|
|
64
74
|
"jest": "^28.1.2",
|
|
65
75
|
"lodash": "^4.17.21",
|
|
76
|
+
"npm-run-all": "^4.1.5",
|
|
66
77
|
"prettier": "^2.7.1",
|
|
67
78
|
"regenerator-runtime": "^0.13.9",
|
|
68
79
|
"ts-node": "^10.8.2",
|
package/tsconfig.json
CHANGED
|
@@ -1,62 +1,57 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
"include": [
|
|
60
|
-
"src"
|
|
61
|
-
]
|
|
62
|
-
}
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "esnext",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": ["es2020", "dom"],
|
|
6
|
+
"declaration": true /* Generates corresponding '.d.ts' file. */,
|
|
7
|
+
"declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */,
|
|
8
|
+
"sourceMap": true /* Generates corresponding '.map' file. */,
|
|
9
|
+
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
10
|
+
"outDir": "./lib/" /* Redirect output structure to the directory. */,
|
|
11
|
+
"rootDir": "./src/" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
|
|
12
|
+
// "composite": true, /* Enable project compilation */
|
|
13
|
+
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
|
14
|
+
// "removeComments": true, /* Do not emit comments to output. */
|
|
15
|
+
// "noEmit": true, /* Do not emit outputs. */
|
|
16
|
+
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
|
17
|
+
"downlevelIteration": true /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */,
|
|
18
|
+
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
|
19
|
+
/* Strict Type-Checking Options */
|
|
20
|
+
"strict": true /* Enable all strict type-checking options. */,
|
|
21
|
+
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
|
|
22
|
+
"strictNullChecks": true /* Enable strict null checks. */,
|
|
23
|
+
"strictFunctionTypes": true /* Enable strict checking of function types. */,
|
|
24
|
+
"strictBindCallApply": true /* Enable strict 'bind', 'call', and 'apply' methods on functions. */,
|
|
25
|
+
"strictPropertyInitialization": true /* Enable strict checking of property initialization in classes. */,
|
|
26
|
+
"noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */,
|
|
27
|
+
"alwaysStrict": true /* Parse in strict mode and emit "use strict" for each source file. */,
|
|
28
|
+
/* Additional Checks */
|
|
29
|
+
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
|
30
|
+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
|
31
|
+
"noImplicitReturns": true /* Report error when not all code paths in function return a value. */,
|
|
32
|
+
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */,
|
|
33
|
+
/* Module Resolution Options */
|
|
34
|
+
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
|
35
|
+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
|
36
|
+
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
|
37
|
+
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
|
38
|
+
// "typeRoots": [], /* List of folders to include type definitions from. */
|
|
39
|
+
// "types": [], /* Type declaration files to be included in compilation. */
|
|
40
|
+
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
|
41
|
+
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
|
|
42
|
+
"resolveJsonModule": true,
|
|
43
|
+
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
|
44
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
45
|
+
/* Source Map Options */
|
|
46
|
+
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
|
47
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
48
|
+
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
|
49
|
+
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
|
50
|
+
/* Experimental Options */
|
|
51
|
+
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
|
52
|
+
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
|
53
|
+
/* Advanced Options */
|
|
54
|
+
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
|
|
55
|
+
},
|
|
56
|
+
"include": ["src"]
|
|
57
|
+
}
|
package/.changeset/README.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Changesets
|
|
2
|
-
|
|
3
|
-
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
|
4
|
-
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
|
5
|
-
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
|
6
|
-
|
|
7
|
-
We have a quick list of common questions to get you started engaging with this project in
|
|
8
|
-
[our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md)
|
package/.changeset/config.json
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://unpkg.com/@changesets/config@1.5.0/schema.json",
|
|
3
|
-
"changelog": "@changesets/cli/changelog",
|
|
4
|
-
"commit": false,
|
|
5
|
-
"linked": [],
|
|
6
|
-
"access": "restricted",
|
|
7
|
-
"baseBranch": "master",
|
|
8
|
-
"updateInternalDependencies": "patch",
|
|
9
|
-
"ignore": []
|
|
10
|
-
}
|
package/lib/tsdoc-metadata.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
-
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
-
{
|
|
4
|
-
"tsdocVersion": "0.12",
|
|
5
|
-
"toolPackages": [
|
|
6
|
-
{
|
|
7
|
-
"packageName": "@microsoft/api-extractor",
|
|
8
|
-
"packageVersion": "7.28.2"
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|