@nest-boot/auth 8.0.7-beta.3 → 8.0.7-beta.4

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 (79) hide show
  1. package/README.md +8 -0
  2. package/dist/auth.guard.d.ts +12 -16
  3. package/dist/auth.guard.js +31 -54
  4. package/dist/auth.guard.js.map +1 -1
  5. package/dist/decorators/can.decorator.d.ts +3 -3
  6. package/dist/decorators/can.decorator.js +5 -5
  7. package/dist/decorators/can.decorator.js.map +1 -1
  8. package/dist/features/invitations/invitation.service.d.ts +4 -3
  9. package/dist/features/invitations/invitation.service.js +4 -2
  10. package/dist/features/invitations/invitation.service.js.map +1 -1
  11. package/dist/index.d.ts +3 -2
  12. package/dist/index.js +2 -2
  13. package/dist/index.js.map +1 -1
  14. package/dist/infrastructure/api-key-authentication.service.d.ts +3 -3
  15. package/dist/infrastructure/api-key-authentication.service.js.map +1 -1
  16. package/dist/infrastructure/api-key-lifecycle.d.ts +3 -3
  17. package/dist/infrastructure/request-identity.d.ts +4 -4
  18. package/dist/infrastructure/request-identity.js.map +1 -1
  19. package/dist/interfaces/can-metadata.interface.d.ts +3 -3
  20. package/dist/interfaces/request-identity-patch.interface.d.ts +2 -2
  21. package/dist/objects/password-policy.object.d.ts +7 -0
  22. package/dist/objects/password-policy.object.js +30 -0
  23. package/dist/objects/password-policy.object.js.map +1 -0
  24. package/dist/resolvers/auth.resolver.d.ts +3 -0
  25. package/dist/resolvers/auth.resolver.js +12 -0
  26. package/dist/resolvers/auth.resolver.js.map +1 -1
  27. package/dist/resolvers/user-api-key.resolver.d.ts +3 -2
  28. package/dist/resolvers/user-api-key.resolver.js.map +1 -1
  29. package/dist/resolvers/user.resolver.d.ts +9 -7
  30. package/dist/resolvers/user.resolver.js +25 -19
  31. package/dist/resolvers/user.resolver.js.map +1 -1
  32. package/dist/resolvers/workspace-api-key.resolver.d.ts +3 -2
  33. package/dist/resolvers/workspace-api-key.resolver.js.map +1 -1
  34. package/dist/resolvers/workspace.resolver.d.ts +6 -4
  35. package/dist/resolvers/workspace.resolver.js +13 -10
  36. package/dist/resolvers/workspace.resolver.js.map +1 -1
  37. package/dist/services/account.service.d.ts +3 -2
  38. package/dist/services/account.service.js +16 -2
  39. package/dist/services/account.service.js.map +1 -1
  40. package/dist/services/auth.service.d.ts +3 -0
  41. package/dist/services/auth.service.js +4 -0
  42. package/dist/services/auth.service.js.map +1 -1
  43. package/dist/services/member.service.d.ts +3 -2
  44. package/dist/services/member.service.js +2 -2
  45. package/dist/services/member.service.js.map +1 -1
  46. package/dist/services/session.service.d.ts +3 -2
  47. package/dist/services/session.service.js +10 -2
  48. package/dist/services/session.service.js.map +1 -1
  49. package/dist/services/user-api-key.service.d.ts +7 -5
  50. package/dist/services/user-api-key.service.js +13 -5
  51. package/dist/services/user-api-key.service.js.map +1 -1
  52. package/dist/services/user.service.d.ts +6 -2
  53. package/dist/services/user.service.js +13 -4
  54. package/dist/services/user.service.js.map +1 -1
  55. package/dist/services/workspace-api-key.service.d.ts +7 -5
  56. package/dist/services/workspace-api-key.service.js +13 -5
  57. package/dist/services/workspace-api-key.service.js.map +1 -1
  58. package/dist/services/workspace.service.d.ts +3 -2
  59. package/dist/services/workspace.service.js +2 -1
  60. package/dist/services/workspace.service.js.map +1 -1
  61. package/dist/tsconfig.tsbuildinfo +1 -1
  62. package/dist/types/api-key-metadata.type.d.ts +6 -0
  63. package/dist/types/api-key-metadata.type.js +2 -0
  64. package/dist/types/api-key-metadata.type.js.map +1 -0
  65. package/dist/types/can-subject-callback.type.d.ts +3 -0
  66. package/dist/types/can-subject-callback.type.js +2 -0
  67. package/dist/types/can-subject-callback.type.js.map +1 -0
  68. package/dist/utils/get-current-api-key.util.d.ts +2 -2
  69. package/dist/utils/get-current-api-key.util.js.map +1 -1
  70. package/dist/utils/omit-credentials.util.d.ts +2 -0
  71. package/dist/utils/omit-credentials.util.js +10 -0
  72. package/dist/utils/omit-credentials.util.js.map +1 -0
  73. package/package.json +10 -10
  74. package/dist/types/can-subject-factory.type.d.ts +0 -3
  75. package/dist/types/can-subject-factory.type.js +0 -2
  76. package/dist/types/can-subject-factory.type.js.map +0 -1
  77. package/dist/types/can-subject.type.d.ts +0 -5
  78. package/dist/types/can-subject.type.js +0 -2
  79. package/dist/types/can-subject.type.js.map +0 -1
@@ -0,0 +1,6 @@
1
+ import type { ApiKey } from "./api-key.type.js";
2
+ /**
3
+ * API-key fields without the credential hash.
4
+ * Management services return snapshots; use service methods to persist changes.
5
+ */
6
+ export type ApiKeyMetadata<Key extends ApiKey = ApiKey> = Key extends ApiKey ? Omit<Key, "key"> : never;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=api-key-metadata.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-key-metadata.type.js","sourceRoot":"","sources":["../../src/types/api-key-metadata.type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { Subject } from "@casl/ability";
2
+ /** Callback that resolves a permission subject from the current handler instance and decorated method parameters. */
3
+ export type CanSubjectCallback<T extends Subject = Subject, TSelf = unknown, TArgs extends unknown[] = unknown[]> = (self: TSelf, ...args: TArgs) => T | Promise<T>;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=can-subject-callback.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"can-subject-callback.type.js","sourceRoot":"","sources":["../../src/types/can-subject-callback.type.ts"],"names":[],"mappings":""}
@@ -1,3 +1,3 @@
1
- import type { ApiKey } from "../types/api-key.type.js";
1
+ import type { ApiKeyMetadata } from "../types/api-key-metadata.type.js";
2
2
  /** Returns the current API credential without resolving a database entity. @internal */
3
- export declare function getCurrentApiKey(): ApiKey | null;
3
+ export declare function getCurrentApiKey(): ApiKeyMetadata | null;
@@ -1 +1 @@
1
- {"version":3,"file":"get-current-api-key.util.js","sourceRoot":"","sources":["../../src/utils/get-current-api-key.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C,wFAAwF;AACxF,MAAM,UAAU,gBAAgB;IAC9B,OAAO,cAAc,CAAC,QAAQ,EAAE;QAC9B,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAS,OAAO,CAAC,IAAI,IAAI,CAAC;QAC/C,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
1
+ {"version":3,"file":"get-current-api-key.util.js","sourceRoot":"","sources":["../../src/utils/get-current-api-key.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C,wFAAwF;AACxF,MAAM,UAAU,gBAAgB;IAC9B,OAAO,cAAc,CAAC,QAAQ,EAAE;QAC9B,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAiB,OAAO,CAAC,IAAI,IAAI,CAAC;QACvD,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** Copies public entity fields without credentials or ORM identity-map state. @internal */
2
+ export declare function omitCredentials<Entity extends object, Key extends PropertyKey>(entity: Entity, keys: readonly Key[]): Omit<Entity, Key>;
@@ -0,0 +1,10 @@
1
+ /** Copies public entity fields without credentials or ORM identity-map state. @internal */
2
+ export function omitCredentials(entity, keys) {
3
+ const result = { ...entity };
4
+ for (const key of keys)
5
+ Reflect.deleteProperty(result, key);
6
+ // Keep entity prototypes for GraphQL and consumers that discriminate ownership by class.
7
+ Object.setPrototypeOf(result, Object.getPrototypeOf(entity));
8
+ return result;
9
+ }
10
+ //# sourceMappingURL=omit-credentials.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omit-credentials.util.js","sourceRoot":"","sources":["../../src/utils/omit-credentials.util.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,MAAM,UAAU,eAAe,CAC7B,MAAc,EACd,IAAoB;IAEpB,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,IAAI;QAAE,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5D,yFAAyF;IACzF,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nest-boot/auth",
3
- "version": "8.0.7-beta.3",
3
+ "version": "8.0.7-beta.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/nest-boot/nest-boot.git",
@@ -52,15 +52,15 @@
52
52
  "graphql": "^16.11.0",
53
53
  "zod": "^4.3.6",
54
54
  "@nest-boot/eslint-config": "^8.0.2-beta.0",
55
- "@nest-boot/eslint-plugin": "^8.0.1-beta.1",
56
55
  "@nest-boot/graphql-connection": "^8.0.2-beta.1",
56
+ "@nest-boot/eslint-plugin": "^8.0.1-beta.1",
57
+ "@nest-boot/hash": "^8.0.2-beta.0",
58
+ "@nest-boot/middleware": "^8.0.2-beta.0",
59
+ "@nest-boot/mailer": "^8.0.2-beta.0",
57
60
  "@nest-boot/tsconfig": "^8.0.0-beta.4",
58
- "@nest-boot/graphql": "^8.0.2-beta.0",
59
61
  "@nest-boot/request-context": "^8.0.2-beta.0",
60
62
  "@nest-boot/validator": "^8.0.5-beta.0",
61
- "@nest-boot/hash": "^8.0.2-beta.0",
62
- "@nest-boot/mailer": "^8.0.2-beta.0",
63
- "@nest-boot/middleware": "^8.0.2-beta.0"
63
+ "@nest-boot/graphql": "^8.0.2-beta.0"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@casl/ability": "^7.0.0",
@@ -77,12 +77,12 @@
77
77
  "graphql": "^16.0.0",
78
78
  "zod": "^4.0.0",
79
79
  "@nest-boot/graphql-connection": "^8.0.2-beta.1",
80
- "@nest-boot/mailer": "^8.0.2-beta.0",
81
80
  "@nest-boot/hash": "^8.0.2-beta.0",
82
- "@nest-boot/request-context": "^8.0.2-beta.0",
83
- "@nest-boot/validator": "^8.0.5-beta.0",
84
81
  "@nest-boot/middleware": "^8.0.2-beta.0",
85
- "@nest-boot/graphql": "^8.0.2-beta.0"
82
+ "@nest-boot/mailer": "^8.0.2-beta.0",
83
+ "@nest-boot/validator": "^8.0.5-beta.0",
84
+ "@nest-boot/graphql": "^8.0.2-beta.0",
85
+ "@nest-boot/request-context": "^8.0.2-beta.0"
86
86
  },
87
87
  "publishConfig": {
88
88
  "access": "public"
@@ -1,3 +0,0 @@
1
- import type { Subject } from "@casl/ability";
2
- /** Factory that resolves a permission subject from the current handler instance and decorated method parameters. */
3
- export type CanSubjectFactory<T extends Subject = Subject, TSelf = unknown, TArgs extends unknown[] = unknown[]> = (self: TSelf, ...args: TArgs) => T | Promise<T>;
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=can-subject-factory.type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"can-subject-factory.type.js","sourceRoot":"","sources":["../../src/types/can-subject-factory.type.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- import type { Subject } from "@casl/ability";
2
- import type { Type } from "@nestjs/common";
3
- import type { CanSubjectFactory } from "./can-subject-factory.type.js";
4
- /** Permission subject type or subject resolver factory. */
5
- export type CanSubject<T extends Subject = Subject> = Type<T> | CanSubjectFactory<T>;
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=can-subject.type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"can-subject.type.js","sourceRoot":"","sources":["../../src/types/can-subject.type.ts"],"names":[],"mappings":""}