veloce-ts 1.0.0 → 1.0.1
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/CHANGELOG.md +30 -0
- package/README.md +23 -2
- package/dist/cjs/src/auth/index.js +2 -2
- package/dist/cjs/src/auth/index.js.map +3 -3
- package/dist/cjs/src/graphql/index.js +16 -16
- package/dist/cjs/src/graphql/index.js.map +4 -4
- package/dist/cjs/src/index.js +32 -32
- package/dist/cjs/src/index.js.map +6 -6
- package/dist/cjs/src/plugins/index.js +23 -23
- package/dist/cjs/src/plugins/index.js.map +4 -4
- package/dist/cjs/src/testing/index.js +27 -27
- package/dist/cjs/src/testing/index.js.map +5 -4
- package/dist/esm/src/auth/index.js +2 -2
- package/dist/esm/src/auth/index.js.map +3 -3
- package/dist/esm/src/graphql/index.js +15 -15
- package/dist/esm/src/graphql/index.js.map +4 -4
- package/dist/esm/src/index.js +35 -35
- package/dist/esm/src/index.js.map +6 -6
- package/dist/esm/src/plugins/index.js +23 -23
- package/dist/esm/src/plugins/index.js.map +4 -4
- package/dist/esm/src/testing/index.js +27 -27
- package/dist/esm/src/testing/index.js.map +5 -4
- package/dist/types/core/application.d.ts.map +1 -1
- package/dist/types/graphql/plugin.d.ts +12 -0
- package/dist/types/graphql/plugin.d.ts.map +1 -1
- package/dist/types/graphql/schema-builder.d.ts +4 -5
- package/dist/types/graphql/schema-builder.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.0.1] - 2026-06-26
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **GraphQL decorator pipeline wired up.** `@Resolver`, `@GQLQuery`, `@GQLMutation`, `@GQLSubscription`, and `@Arg` decorators now correctly connect to `GraphQLPlugin`. Previously the decorators wrote metadata using local symbols that `GraphQLSchemaBuilder` never read — the schema was always empty.
|
|
15
|
+
|
|
16
|
+
Pass resolver classes to the plugin via the new `resolvers` option:
|
|
17
|
+
```typescript
|
|
18
|
+
app.usePlugin(new GraphQLPlugin({ resolvers: [UserResolver, PostResolver] }));
|
|
19
|
+
```
|
|
20
|
+
Or register them with `app.include()` before calling `usePlugin()`:
|
|
21
|
+
```typescript
|
|
22
|
+
app.include(UserResolver);
|
|
23
|
+
app.usePlugin(new GraphQLPlugin());
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- **`PermissionManager.revokePermission()` bug fixed.** When called without a `resourceId`, the filter condition `resourceId ? p.resourceId !== resourceId : true` always returned `true` (kept all records, removed nothing). Now correctly removes all permissions for the user+resource pair when no `resourceId` is specified.
|
|
27
|
+
|
|
28
|
+
- **`app.include()` now recognises `@Resolver` classes.** Previously silently ignored — now registers resolver metadata into `MetadataRegistry` so `GraphQLPlugin` can pick it up automatically.
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- **89 new tests** (507 total, 0 failures) covering:
|
|
33
|
+
- GraphQL decorator metadata pipeline end-to-end
|
|
34
|
+
- `app.include()` + `resolvers: []` option merge
|
|
35
|
+
- `PermissionPlugin` construction, `PermissionManager` unit logic, management route auth guards
|
|
36
|
+
- `HealthCheckPlugin` `/health`, `/ready`, `/live` endpoints, custom check logic, `HealthCheckers` factory
|
|
37
|
+
- `OAuthPlugin` route behavior, `BaseOAuthProvider`/`GoogleOAuthProvider`/`GitHubOAuthProvider`, `OAuthStateManager`, `PKCEUtils`
|
|
38
|
+
- Logger (`createLogger`, `getLogger`, `initializeLogger`, `createChildLogger`, child context propagation)
|
|
39
|
+
|
|
10
40
|
## [1.0.0] - 2026-06-26
|
|
11
41
|
|
|
12
42
|
First stable release. Establishes a frozen public API with semver guarantees going forward.
|
package/README.md
CHANGED
|
@@ -243,7 +243,7 @@ app.listen(3000);
|
|
|
243
243
|
<summary><b>WebSocket Support</b></summary>
|
|
244
244
|
|
|
245
245
|
```typescript
|
|
246
|
-
import { WebSocket, OnConnect, OnMessage, OnDisconnect } from 'veloce-ts';
|
|
246
|
+
import { WebSocket, OnConnect, OnMessage, OnDisconnect, WebSocketConnection } from 'veloce-ts';
|
|
247
247
|
import { z } from 'zod';
|
|
248
248
|
|
|
249
249
|
const MessageSchema = z.object({
|
|
@@ -496,11 +496,32 @@ app.usePlugin(new OpenAPIPlugin({
|
|
|
496
496
|
docsPath: '/docs',
|
|
497
497
|
}));
|
|
498
498
|
|
|
499
|
-
// GraphQL support
|
|
499
|
+
// GraphQL support — pass resolver classes via the resolvers option
|
|
500
|
+
import { Resolver, GQLQuery, GQLMutation, Arg } from 'veloce-ts/graphql';
|
|
501
|
+
import { z } from 'zod';
|
|
502
|
+
|
|
503
|
+
@Resolver('user')
|
|
504
|
+
class UserResolver {
|
|
505
|
+
@GQLQuery('getUser')
|
|
506
|
+
async getUser(@Arg('id', z.string()) id: string) {
|
|
507
|
+
return { id, name: 'Alice' };
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
@GQLMutation('createUser')
|
|
511
|
+
async createUser(@Arg('name', z.string()) name: string) {
|
|
512
|
+
return { id: '1', name };
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
500
516
|
app.usePlugin(new GraphQLPlugin({
|
|
501
517
|
path: '/graphql',
|
|
502
518
|
playground: true,
|
|
519
|
+
resolvers: [UserResolver], // pass all @Resolver classes here
|
|
503
520
|
}));
|
|
521
|
+
|
|
522
|
+
// Alternatively, register via app.include() before usePlugin():
|
|
523
|
+
// app.include(UserResolver);
|
|
524
|
+
// app.usePlugin(new GraphQLPlugin({ playground: true }));
|
|
504
525
|
```
|
|
505
526
|
|
|
506
527
|
## 🌐 Multi-Runtime Support
|