@groton/authjs-firestore-adapter 1.0.3 → 1.0.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [1.0.4](https://github.com/groton-school/authjs/compare/firestore-adapter/1.0.3...firestore-adapter/1.0.4) (2026-11-23)
6
+
7
+ ### Bug Fixes
8
+
9
+ * undo over-zealous object clean-up ([e6a782c](https://github.com/groton-school/authjs/commit/e6a782c88f57f309bf0c8ad6d30a9aeb3999cf42))
5
10
  ## [1.0.3](https://github.com/groton-school/authjs/compare/firestore-adapter/1.0.1...firestore-adapter/1.0.3) (2026-11-15)
6
11
 
7
12
  ### Bug Fixes
@@ -1,5 +1,4 @@
1
1
  import { Collection } from '@battis/lazy-firestore';
2
- import { nullifyUndefinedProperties } from '@battis/lazy-firestore/directives/nullifyUndefinedProperties';
3
2
  import { requireUnique } from '@battis/lazy-firestore/directives/requireUnique';
4
3
  import { users } from './Users.js';
5
4
  export class Accounts extends Collection {
@@ -19,7 +18,7 @@ export function AccountsAdapter({ path = Accounts.DEFAULT.path, ...options } = A
19
18
  return {
20
19
  linkAccount: async (account) => (await accounts.create({
21
20
  ...identify(account),
22
- data: nullifyUndefinedProperties(account),
21
+ data: account,
23
22
  strict: false
24
23
  })).data,
25
24
  getAccount,
@@ -1,6 +1,5 @@
1
1
  import { Collection } from '@battis/lazy-firestore';
2
2
  import { DateConverter } from '@battis/lazy-firestore/converters/Date';
3
- import { nullifyUndefinedProperties } from '@battis/lazy-firestore/directives/nullifyUndefinedProperties';
4
3
  class Authenticators extends Collection {
5
4
  static DEFAULT = { path: 'authenticators' };
6
5
  constructor(options) {
@@ -14,7 +13,7 @@ export function AuthenticatorsAdapter({ path = Authenticators.DEFAULT.path, ...o
14
13
  });
15
14
  return {
16
15
  createAuthenticator: async (authenticator) => (await authenticators.create({
17
- data: nullifyUndefinedProperties(authenticator),
16
+ data: authenticator,
18
17
  id: authenticator.credentialID,
19
18
  strict: true
20
19
  })).data,
@@ -1,7 +1,5 @@
1
1
  import { Collection } from '@battis/lazy-firestore';
2
2
  import { DateConverter } from '@battis/lazy-firestore/converters/Date';
3
- import { deleteUndefinedProperties } from '@battis/lazy-firestore/directives/deleteUndefinedProperties';
4
- import { nullifyUndefinedProperties } from '@battis/lazy-firestore/directives/nullifyUndefinedProperties';
5
3
  import { users } from './Users.js';
6
4
  export class Sessions extends Collection {
7
5
  static DEFAULT = { path: 'sessions' };
@@ -15,11 +13,14 @@ export class Sessions extends Collection {
15
13
  export function SessionsAdapter({ path = Sessions.DEFAULT.path, ...options } = Sessions.DEFAULT) {
16
14
  const sessions = new Sessions({ path, ...options });
17
15
  return {
18
- createSession: async (session) => (await sessions.create({
19
- id: session.sessionToken,
20
- data: nullifyUndefinedProperties(session),
21
- strict: true
22
- })).data,
16
+ createSession: async (session) => {
17
+ console.log(JSON.stringify({ session }, null, 2));
18
+ return (await sessions.create({
19
+ id: session.sessionToken,
20
+ data: session,
21
+ strict: true
22
+ })).data;
23
+ },
23
24
  getSessionAndUser: async (id) => {
24
25
  const session = (await sessions.read({
25
26
  id,
@@ -36,7 +37,7 @@ export function SessionsAdapter({ path = Sessions.DEFAULT.path, ...options } = S
36
37
  },
37
38
  updateSession: async (session) => (await sessions.update({
38
39
  id: session.sessionToken,
39
- patch: deleteUndefinedProperties(session),
40
+ patch: session,
40
41
  strict: false
41
42
  })).data,
42
43
  deleteSession: async (id) => (await sessions.delete({
@@ -1,6 +1,4 @@
1
1
  import { Collection } from '@battis/lazy-firestore';
2
- import { deleteUndefinedProperties } from '@battis/lazy-firestore/directives/deleteUndefinedProperties';
3
- import { nullifyUndefinedProperties } from '@battis/lazy-firestore/directives/nullifyUndefinedProperties';
4
2
  import { requireUnique } from '@battis/lazy-firestore/directives/requireUnique';
5
3
  export class Users extends Collection {
6
4
  static DEFAULT = { path: 'users' };
@@ -27,7 +25,7 @@ export function UsersAdapter({ path = Users.DEFAULT.path, ...options } = Users.D
27
25
  _users = new Users({ path, ...options });
28
26
  return {
29
27
  createUser: async (user) => (await users().create({
30
- data: nullifyUndefinedProperties(user),
28
+ data: user,
31
29
  id: user.id,
32
30
  query: (ref) => ref.where('email', '==', user.email),
33
31
  strict: true
@@ -49,7 +47,7 @@ export function UsersAdapter({ path = Users.DEFAULT.path, ...options } = Users.D
49
47
  },
50
48
  updateUser: async (user) => (await users().update({
51
49
  id: user.id,
52
- patch: deleteUndefinedProperties(user),
50
+ patch: user,
53
51
  strict: true
54
52
  })).data,
55
53
  deleteUser: async (id) => (await users().delete({
@@ -1,6 +1,5 @@
1
1
  import { Collection } from '@battis/lazy-firestore';
2
2
  import { DateConverter } from '@battis/lazy-firestore/converters/Date';
3
- import { nullifyUndefinedProperties } from '@battis/lazy-firestore/directives/nullifyUndefinedProperties';
4
3
  export class VerificationTokens extends Collection {
5
4
  static DEFAULT = { path: 'verificationTokens' };
6
5
  constructor(options) {
@@ -12,7 +11,7 @@ export function VerificationTokensAdapter({ path = VerificationTokens.DEFAULT.pa
12
11
  return {
13
12
  createVerificationToken: async (token) => (await tokens.create({
14
13
  ...identify(token),
15
- data: nullifyUndefinedProperties(token),
14
+ data: token,
16
15
  strict: false
17
16
  })).data,
18
17
  useVerificationToken: async (token) => (await tokens.delete({ ...identify(token), strict: false })).data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groton/authjs-firestore-adapter",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "homepage": "https://github.com/groton-school/authjs/tree/main/packages/firestore-adapter#readme",
5
5
  "repository": {
6
6
  "type": "github",
@@ -42,7 +42,6 @@
42
42
  "build": "run-s build:*",
43
43
  "build:clean": "del ./dist",
44
44
  "build:compile": "tsc",
45
- "start": "echo 'noop'",
46
45
  "release": "commit-and-tag-version --noBumpWhenEmptyChanges"
47
46
  }
48
47
  }