@better-auth/electron 1.7.0-beta.9 → 1.7.0-rc.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/dist/client.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-B__xynWl.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-BDD29zmX.mjs";
2
2
  import { n as isProcessType, r as parseProtocolScheme, t as getChannelPrefixWithDelimiter } from "./utils-DxDKRT6e.mjs";
3
3
  import { BetterAuthError } from "@better-auth/core/error";
4
4
  import { base64, base64Url } from "@better-auth/utils/base64";
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-B__xynWl.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-BDD29zmX.mjs";
2
2
  import { createAuthMiddleware } from "@better-auth/core/api";
3
3
  import { APIError, BASE_ERROR_CODES } from "@better-auth/core/error";
4
4
  import { base64Url } from "@better-auth/utils/base64";
@@ -406,8 +406,14 @@ type DBAdapter<Options extends BetterAuthOptions = BetterAuthOptions> = {
406
406
  where?: Where[] | undefined;
407
407
  }) => Promise<number>;
408
408
  /**
409
- * ⚠︎ Update may not return the updated data
410
- * if multiple where clauses are provided
409
+ * Update a single row matching the where clause.
410
+ *
411
+ * Returns the updated row, or `null` when no row matched. Empty `where`
412
+ * clauses return `null`; use `updateMany` for intentional bulk updates.
413
+ *
414
+ * This is not the race-safe primitive for guarded state transitions. Use
415
+ * `incrementOne` when the predicate is both selector and guard, and use
416
+ * `consumeOne` for single-use destructive reads.
411
417
  */
412
418
  update: <T>(data: {
413
419
  model: string;
@@ -1510,8 +1516,8 @@ interface GoogleOptions extends ProviderOptions<GoogleProfile> {
1510
1516
  *
1511
1517
  * This is sent to Google as the `hd` authorization hint and, when set, is
1512
1518
  * also enforced against the `hd` claim of the returned id token/profile.
1513
- * Sign-in is rejected when the claim is missing or does not match, so this
1514
- * can be used to restrict sign-in to a Workspace domain.
1519
+ * Set `hd: "*"` to require any Workspace hosted-domain claim. Sign-in is
1520
+ * rejected when the claim is missing or does not satisfy this restriction.
1515
1521
  */
1516
1522
  hd?: string | undefined;
1517
1523
  /**
@@ -2242,6 +2248,7 @@ interface PaybinOptions extends ProviderOptions<PaybinProfile> {
2242
2248
  //#region ../core/dist/social-providers/paypal.d.mts
2243
2249
  //#region src/social-providers/paypal.d.ts
2244
2250
  interface PayPalProfile {
2251
+ sub?: string | undefined;
2245
2252
  user_id: string;
2246
2253
  name: string;
2247
2254
  given_name: string;
@@ -4380,14 +4387,14 @@ type BaseAccount = z.infer<typeof accountSchema>;
4380
4387
  */
4381
4388
  type Account<DBOptions extends BetterAuthOptions["account"] = BetterAuthOptions["account"], Plugins extends BetterAuthOptions["plugins"] = BetterAuthOptions["plugins"]> = Prettify$1<BaseAccount & InferDBFieldsFromOptions<DBOptions> & InferDBFieldsFromPlugins<"account", Plugins>>; //#endregion
4382
4389
  //#endregion
4383
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/helper.d.mts
4390
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/helper.d.mts
4384
4391
  type Prettify<T> = { [K in keyof T]: T[K] } & {};
4385
4392
  type IsEmptyObject<T> = keyof T extends never ? true : false;
4386
4393
  type UnionToIntersection<Union> = (Union extends unknown ? (distributedUnion: Union) => void : never) extends ((mergedIntersection: infer Intersection) => void) ? Intersection & Union : never;
4387
4394
  type InferParamPath<Path> = Path extends `${infer _Start}:${infer Param}/${infer Rest}` ? { [K in Param | keyof InferParamPath<Rest>]: string } : Path extends `${infer _Start}:${infer Param}` ? { [K in Param]: string } : Path extends `${infer _Start}/${infer Rest}` ? InferParamPath<Rest> : {};
4388
4395
  type InferParamWildCard<Path> = Path extends `${infer _Start}/*:${infer Param}/${infer Rest}` | `${infer _Start}/**:${infer Param}/${infer Rest}` ? { [K in Param | keyof InferParamPath<Rest>]: string } : Path extends `${infer _Start}/*` ? { [K in "_"]: string } : Path extends `${infer _Start}/${infer Rest}` ? InferParamWildCard<Rest> : {}; //#endregion
4389
4396
  //#endregion
4390
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/standard-schema.d.mts
4397
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/standard-schema.d.mts
4391
4398
  //#region src/standard-schema.d.ts
4392
4399
  /** The Standard Schema interface. */
4393
4400
  interface StandardSchemaV1$1<Input = unknown, Output = Input> {
@@ -4445,7 +4452,7 @@ declare namespace StandardSchemaV1$1 {
4445
4452
  type InferOutput<Schema extends StandardSchemaV1$1> = NonNullable<Schema["~standard"]["types"]>["output"];
4446
4453
  } //#endregion
4447
4454
  //#endregion
4448
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/error.d.mts
4455
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/error.d.mts
4449
4456
  declare const statusCodes: {
4450
4457
  OK: number;
4451
4458
  CREATED: number;
@@ -4523,7 +4530,7 @@ declare const APIError: new (status?: Status | "OK" | "CREATED" | "ACCEPTED" | "
4523
4530
  errorStack: string | undefined;
4524
4531
  }; //#endregion
4525
4532
  //#endregion
4526
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/cookies.d.mts
4533
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/cookies.d.mts
4527
4534
  //#region src/cookies.d.ts
4528
4535
  type CookiePrefixOptions = "host" | "secure";
4529
4536
  type CookieOptions = {
@@ -4613,7 +4620,7 @@ type CookieOptions = {
4613
4620
  prefix?: CookiePrefixOptions;
4614
4621
  };
4615
4622
  //#endregion
4616
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/openapi.d.mts
4623
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/openapi.d.mts
4617
4624
  //#region src/openapi.d.ts
4618
4625
  type OpenAPISchemaType = "string" | "number" | "integer" | "boolean" | "array" | "object";
4619
4626
  interface OpenAPIParameter {
@@ -4635,7 +4642,7 @@ interface OpenAPIParameter {
4635
4642
  };
4636
4643
  }
4637
4644
  //#endregion
4638
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/endpoint.d.mts
4645
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/endpoint.d.mts
4639
4646
  //#region src/endpoint.d.ts
4640
4647
  interface EndpointBaseOptions {
4641
4648
  /**
@@ -5014,7 +5021,7 @@ type Endpoint<Path extends string = string, Options extends EndpointOptions = En
5014
5021
  path: Path;
5015
5022
  }; //#endregion
5016
5023
  //#endregion
5017
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/middleware.d.mts
5024
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/middleware.d.mts
5018
5025
  //#region src/middleware.d.ts
5019
5026
  interface MiddlewareOptions extends Omit<EndpointOptions, "method"> {}
5020
5027
  type MiddlewareContext<Options extends MiddlewareOptions, Context = {}> = EndpointContext<string, Options & {
@@ -5121,7 +5128,7 @@ type Middleware<Options extends MiddlewareOptions = MiddlewareOptions, Handler e
5121
5128
  options: Options;
5122
5129
  }; //#endregion
5123
5130
  //#endregion
5124
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/context.d.mts
5131
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/context.d.mts
5125
5132
  //#region src/context.d.ts
5126
5133
  type HTTPMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
5127
5134
  type Method = HTTPMethod | "*";
@@ -6009,7 +6016,7 @@ type BetterAuthAdvancedOptions = {
6009
6016
  * @example ["x-client-ip", "x-forwarded-for", "cf-connecting-ip"]
6010
6017
  *
6011
6018
  * @default
6012
- * @link https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/utils/get-request-ip.ts#L8
6019
+ * @link https://github.com/better-auth/better-auth/blob/main/packages/core/src/utils/ip.ts
6013
6020
  */
6014
6021
  ipAddressHeaders?: string[];
6015
6022
  /**
@@ -6026,6 +6033,21 @@ type BetterAuthAdvancedOptions = {
6026
6033
  * @default 64
6027
6034
  */
6028
6035
  ipv6Subnet?: number;
6036
+ /**
6037
+ * Trusted reverse-proxy IPs or CIDR ranges. When set, a forwarded IP
6038
+ * chain is walked right to left, trusted hops are skipped, and the
6039
+ * first untrusted address is the client IP. Unset trusts only
6040
+ * single-value IP headers. Use the actual address or subnet of your
6041
+ * proxies, not a broad private range that also covers clients.
6042
+ *
6043
+ * This only interprets the forwarded header chain and cannot verify
6044
+ * the direct sender. It is safe only when your origin is reachable
6045
+ * through these proxies and clients cannot set forwarded headers
6046
+ * directly.
6047
+ *
6048
+ * @example ["192.0.2.10", "10.0.0.0/24"]
6049
+ */
6050
+ trustedProxies?: string[];
6029
6051
  } | undefined;
6030
6052
  /**
6031
6053
  * Force cookies to always use the `Secure` attribute. By default,
package/dist/preload.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import electron, { contextBridge } from "electron";
2
- //#region ../../node_modules/.pnpm/better-call@1.3.6_zod@4.3.6/node_modules/better-call/dist/error.mjs
2
+ //#region ../../node_modules/.pnpm/better-call@1.3.7_zod@4.3.6/node_modules/better-call/dist/error.mjs
3
3
  function isErrorStackTraceLimitWritable() {
4
4
  const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
5
5
  if (desc === void 0) return Object.isExtensible(Error);
package/dist/proxy.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as PACKAGE_VERSION } from "./version-B__xynWl.mjs";
1
+ import { t as PACKAGE_VERSION } from "./version-BDD29zmX.mjs";
2
2
  import { r as parseProtocolScheme } from "./utils-DxDKRT6e.mjs";
3
3
  import { parseCookies } from "better-auth/cookies";
4
4
  //#region src/proxy.ts
@@ -1,5 +1,5 @@
1
1
  //#endregion
2
2
  //#region src/version.ts
3
- const PACKAGE_VERSION = "1.7.0-beta.9";
3
+ const PACKAGE_VERSION = "1.7.0-rc.0";
4
4
  //#endregion
5
5
  export { PACKAGE_VERSION as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/electron",
3
- "version": "1.7.0-beta.9",
3
+ "version": "1.7.0-rc.0",
4
4
  "description": "Better Auth integration for Electron applications.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -77,20 +77,20 @@
77
77
  },
78
78
  "devDependencies": {
79
79
  "@types/better-sqlite3": "^7.6.13",
80
- "better-sqlite3": "^12.6.2",
81
- "electron": "^41.2.2",
80
+ "better-sqlite3": "^12.11.1",
81
+ "electron": "^42.4.1",
82
82
  "tsdown": "0.21.1",
83
- "@better-auth/core": "1.7.0-beta.9",
84
- "better-auth": "1.7.0-beta.9"
83
+ "@better-auth/core": "1.7.0-rc.0",
84
+ "better-auth": "1.7.0-rc.0"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "@better-auth/utils": "0.4.2",
88
88
  "@better-fetch/fetch": "1.3.1",
89
- "better-call": "1.3.6",
89
+ "better-call": "1.3.7",
90
90
  "conf": "^15.0.2",
91
91
  "electron": ">=36.0.0",
92
- "@better-auth/core": "^1.7.0-beta.9",
93
- "better-auth": "^1.7.0-beta.9"
92
+ "@better-auth/core": "^1.7.0-rc.0",
93
+ "better-auth": "^1.7.0-rc.0"
94
94
  },
95
95
  "peerDependenciesMeta": {
96
96
  "electron": {