@kingironman2011/better-auth-bsky 0.2.0 → 0.2.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/README.md CHANGED
@@ -5,7 +5,7 @@ A [better-auth](https://better-auth.com) plugin that adds ATProto / Bluesky OAut
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- pnpm add @kingironman2011/better-auth-bsky better-auth @atcute/oauth-node-client
8
+ pnpm add @kingironman2011/better-auth-bsky better-auth
9
9
  ```
10
10
 
11
11
  ## Usage
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as atproto } from "./server-DO9pjTl1.js";
1
+ import { t as atproto } from "./server-Cm02cZPn.js";
2
2
 
3
3
  //#region src/client.d.ts
4
4
  declare const atprotoClient: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":[],"sources":["../src/client.ts"],"sourcesContent":["import type { BetterAuthClientPlugin } from \"better-auth/client\";\nimport type { atproto } from \"./server.js\";\n\nexport const atprotoClient = () =>\n ({\n id: \"atproto\",\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- required by better-auth plugin inference\n $InferServerPlugin: {} as ReturnType<typeof atproto>,\n getActions: ($fetch) => ({\n signIn: {\n atproto: async (data: { handle: string; callbackURL?: string }) => {\n return $fetch(\"/sign-in/atproto\", {\n method: \"POST\",\n body: data,\n });\n },\n },\n atproto: {\n getSession: async () => $fetch(\"/atproto/session\", { method: \"GET\" }),\n restore: async () => $fetch(\"/atproto/restore\", { method: \"POST\" }),\n signOut: async () => $fetch(\"/atproto/sign-out\", { method: \"POST\" }),\n },\n }),\n }) satisfies BetterAuthClientPlugin;\n"],"mappings":";AAGA,MAAa,uBACV;CACC,IAAI;CAEJ,oBAAoB,CAAC;CACrB,aAAa,YAAY;EACvB,QAAQ,EACN,SAAS,OAAO,SAAmD;GACjE,OAAO,OAAO,oBAAoB;IAChC,QAAQ;IACR,MAAM;GACR,CAAC;EACH,EACF;EACA,SAAS;GACP,YAAY,YAAY,OAAO,oBAAoB,EAAE,QAAQ,MAAM,CAAC;GACpE,SAAS,YAAY,OAAO,oBAAoB,EAAE,QAAQ,OAAO,CAAC;GAClE,SAAS,YAAY,OAAO,qBAAqB,EAAE,QAAQ,OAAO,CAAC;EACrE;CACF;AACF"}
1
+ {"version":3,"file":"client.js","names":[],"sources":["../src/client.ts"],"sourcesContent":["import type { BetterAuthClientPlugin } from \"better-auth/client\";\nimport type { atproto } from \"./server.js\";\n\nexport const atprotoClient = () =>\n ({\n id: \"atproto\",\n\n $InferServerPlugin: {} as ReturnType<typeof atproto>,\n getActions: ($fetch) => ({\n signIn: {\n atproto: async (data: { handle: string; callbackURL?: string }) => {\n return $fetch(\"/sign-in/atproto\", {\n method: \"POST\",\n body: data,\n });\n },\n },\n atproto: {\n getSession: async () => $fetch(\"/atproto/session\", { method: \"GET\" }),\n restore: async () => $fetch(\"/atproto/restore\", { method: \"POST\" }),\n signOut: async () => $fetch(\"/atproto/sign-out\", { method: \"POST\" }),\n },\n }),\n }) satisfies BetterAuthClientPlugin;\n"],"mappings":";AAGA,MAAa,uBACV;CACC,IAAI;CAEJ,oBAAoB,CAAC;CACrB,aAAa,YAAY;EACvB,QAAQ,EACN,SAAS,OAAO,SAAmD;GACjE,OAAO,OAAO,oBAAoB;IAChC,QAAQ;IACR,MAAM;GACR,CAAC;EACH,EACF;EACA,SAAS;GACP,YAAY,YAAY,OAAO,oBAAoB,EAAE,QAAQ,MAAM,CAAC;GACpE,SAAS,YAAY,OAAO,oBAAoB,EAAE,QAAQ,OAAO,CAAC;GAClE,SAAS,YAAY,OAAO,qBAAqB,EAAE,QAAQ,OAAO,CAAC;EACrE;CACF;AACF"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as AtprotoProfile, i as AtprotoPluginOptions, n as atprotoPlaceholderEmail, o as atprotoSchema, r as fetchAtprotoProfilePublic, t as atproto } from "./server-DO9pjTl1.js";
1
+ import { a as AtprotoProfile, i as AtprotoPluginOptions, n as atprotoPlaceholderEmail, o as atprotoSchema, r as fetchAtprotoProfilePublic, t as atproto } from "./server-Cm02cZPn.js";
2
2
  import { atprotoClient } from "./client.js";
3
3
  import { ClientAssertionPrivateJwk, SessionStore, StateStore, StoredSession, StoredState } from "@atcute/oauth-node-client";
4
4
  import { PublicJwk } from "@atcute/oauth-crypto";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as DbStateStore, i as DbSessionStore, n as atprotoPlaceholderEmail, o as atprotoSchema, r as fetchAtprotoProfilePublic, t as atproto } from "./server-DS4UMolW.js";
1
+ import { a as DbStateStore, i as DbSessionStore, n as atprotoPlaceholderEmail, o as atprotoSchema, r as fetchAtprotoProfilePublic, t as atproto } from "./server-Be4Cn16D.js";
2
2
  import { atprotoClient } from "./client.js";
3
3
  import { generateClientAssertionKey } from "@atcute/oauth-node-client";
4
4
  //#region src/key-utils.ts
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/key-utils.ts"],"sourcesContent":["import type { PublicJwk } from \"@atcute/oauth-crypto\";\nimport {\n type ClientAssertionPrivateJwk,\n generateClientAssertionKey,\n} from \"@atcute/oauth-node-client\";\n\n/** Private key fields to strip when extracting a public JWK. */\nconst PRIVATE_KEY_FIELDS = new Set([\"d\", \"p\", \"q\", \"dp\", \"dq\", \"qi\"]);\n\n/**\n * Generates an ES256 keypair for ATProto confidential client authentication.\n * The returned JWK includes private key material and should be stored securely.\n */\nexport async function generateAtprotoKeypair(\n kid?: string,\n): Promise<ClientAssertionPrivateJwk> {\n return generateClientAssertionKey(kid ?? \"atproto-key\", \"ES256\");\n}\n\n/**\n * Extracts the public portion of a JWK by stripping private key fields.\n * Safe to serve at the JWKS endpoint.\n */\nexport function extractPublicJwk(\n privateJwk: ClientAssertionPrivateJwk,\n): PublicJwk {\n const entries = Object.entries(privateJwk).filter(\n ([key]) => !PRIVATE_KEY_FIELDS.has(key),\n );\n // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Object.fromEntries loses type info\n return Object.fromEntries(entries) as PublicJwk;\n}\n"],"mappings":";;;;;AAOA,MAAM,qCAAqB,IAAI,IAAI;CAAC;CAAK;CAAK;CAAK;CAAM;CAAM;AAAI,CAAC;;;;;AAMpE,eAAsB,uBACpB,KACoC;CACpC,OAAO,2BAA2B,OAAO,eAAe,OAAO;AACjE;;;;;AAMA,SAAgB,iBACd,YACW;CACX,MAAM,UAAU,OAAO,QAAQ,UAAU,CAAC,CAAC,QACxC,CAAC,SAAS,CAAC,mBAAmB,IAAI,GAAG,CACxC;CAEA,OAAO,OAAO,YAAY,OAAO;AACnC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/key-utils.ts"],"sourcesContent":["import type { PublicJwk } from \"@atcute/oauth-crypto\";\nimport {\n type ClientAssertionPrivateJwk,\n generateClientAssertionKey,\n} from \"@atcute/oauth-node-client\";\n\n/** Private key fields to strip when extracting a public JWK. */\nconst PRIVATE_KEY_FIELDS = new Set([\"d\", \"p\", \"q\", \"dp\", \"dq\", \"qi\"]);\n\n/**\n * Generates an ES256 keypair for ATProto confidential client authentication.\n * The returned JWK includes private key material and should be stored securely.\n */\nexport async function generateAtprotoKeypair(\n kid?: string,\n): Promise<ClientAssertionPrivateJwk> {\n return generateClientAssertionKey(kid ?? \"atproto-key\", \"ES256\");\n}\n\n/**\n * Extracts the public portion of a JWK by stripping private key fields.\n * Safe to serve at the JWKS endpoint.\n */\nexport function extractPublicJwk(\n privateJwk: ClientAssertionPrivateJwk,\n): PublicJwk {\n const entries = Object.entries(privateJwk).filter(\n ([key]) => !PRIVATE_KEY_FIELDS.has(key),\n );\n\n return Object.fromEntries(entries) as PublicJwk;\n}\n"],"mappings":";;;;;AAOA,MAAM,qCAAqB,IAAI,IAAI;CAAC;CAAK;CAAK;CAAK;CAAM;CAAM;AAAI,CAAC;;;;;AAMpE,eAAsB,uBACpB,KACoC;CACpC,OAAO,2BAA2B,OAAO,eAAe,OAAO;AACjE;;;;;AAMA,SAAgB,iBACd,YACW;CACX,MAAM,UAAU,OAAO,QAAQ,UAAU,CAAC,CAAC,QACxC,CAAC,SAAS,CAAC,mBAAmB,IAAI,GAAG,CACxC;CAEA,OAAO,OAAO,YAAY,OAAO;AACnC"}
@@ -336,7 +336,7 @@ const atprotoSchema = {
336
336
  required: true
337
337
  },
338
338
  expiresAt: {
339
- type: "number",
339
+ type: "date",
340
340
  required: true
341
341
  }
342
342
  } }
@@ -948,4 +948,4 @@ const atproto = (options) => {
948
948
  //#endregion
949
949
  export { DbStateStore as a, DbSessionStore as i, atprotoPlaceholderEmail as n, atprotoSchema as o, fetchAtprotoProfilePublic as r, atproto as t };
950
950
 
951
- //# sourceMappingURL=server-DS4UMolW.js.map
951
+ //# sourceMappingURL=server-Be4Cn16D.js.map