@stll/auth-model 0.1.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.
@@ -1,6 +1,6 @@
1
1
  //#region src/contract.d.ts
2
2
  /** Better Auth version whose logical schema this contract describes. */
3
- declare const BETTER_AUTH_CONTRACT_VERSION = "1.6.26";
3
+ declare const BETTER_AUTH_CONTRACT_VERSION = "1.7.1";
4
4
  declare const ORGANIZATION_ROLE_NAMES: readonly ["owner", "admin", "member", "intern", "external"];
5
5
  type OrganizationRoleName = (typeof ORGANIZATION_ROLE_NAMES)[number];
6
6
  /** Better Auth organization resources. Hosts extend this with product grants. */
@@ -61,6 +61,7 @@ declare const BETTER_AUTH_ORGANIZATION_OPTIONS: {
61
61
  readonly creatorRole: "owner";
62
62
  readonly invitationExpiresIn: number;
63
63
  readonly membershipLimit: 500;
64
+ readonly requireEmailVerificationOnInvitation: true;
64
65
  };
65
66
  /** Adapter switches which must match in every host. */
66
67
  declare const BETTER_AUTH_ADAPTER_OPTIONS: {
@@ -150,6 +151,10 @@ declare const BETTER_AUTH_CORE_SCHEMA: {
150
151
  readonly primaryKey: readonly ["id"];
151
152
  readonly fields: Record<string, BetterAuthFieldContract>;
152
153
  readonly indexes: readonly [{
154
+ readonly fields: readonly ["issuer", "accountId"];
155
+ readonly predicate: null;
156
+ readonly unique: true;
157
+ }, {
153
158
  readonly fields: readonly ["userId"];
154
159
  readonly predicate: null;
155
160
  readonly unique: false;
@@ -283,13 +288,14 @@ declare const BETTER_AUTH_PARITY_MANIFEST: {
283
288
  readonly transaction: true;
284
289
  readonly usePlural: false;
285
290
  };
286
- readonly betterAuthVersion: "1.6.26";
291
+ readonly betterAuthVersion: "1.7.1";
287
292
  readonly options: {
288
293
  readonly allowUserToCreateOrganization: true;
289
294
  readonly cancelPendingInvitationsOnReInvite: false;
290
295
  readonly creatorRole: "owner";
291
296
  readonly invitationExpiresIn: number;
292
297
  readonly membershipLimit: 500;
298
+ readonly requireEmailVerificationOnInvitation: true;
293
299
  };
294
300
  readonly roleGrants: {
295
301
  owner: {
@@ -351,6 +357,10 @@ declare const BETTER_AUTH_PARITY_MANIFEST: {
351
357
  readonly primaryKey: readonly ["id"];
352
358
  readonly fields: Record<string, BetterAuthFieldContract>;
353
359
  readonly indexes: readonly [{
360
+ readonly fields: readonly ["issuer", "accountId"];
361
+ readonly predicate: null;
362
+ readonly unique: true;
363
+ }, {
354
364
  readonly fields: readonly ["userId"];
355
365
  readonly predicate: null;
356
366
  readonly unique: false;
package/dist/contract.js CHANGED
@@ -1,6 +1,6 @@
1
1
  //#region src/contract.ts
2
2
  /** Better Auth version whose logical schema this contract describes. */
3
- const BETTER_AUTH_CONTRACT_VERSION = "1.6.26";
3
+ const BETTER_AUTH_CONTRACT_VERSION = "1.7.1";
4
4
  const ORGANIZATION_ROLE_NAMES = [
5
5
  "owner",
6
6
  "admin",
@@ -102,7 +102,8 @@ const BETTER_AUTH_ORGANIZATION_OPTIONS = {
102
102
  cancelPendingInvitationsOnReInvite: false,
103
103
  creatorRole: "owner",
104
104
  invitationExpiresIn: 172800,
105
- membershipLimit: 500
105
+ membershipLimit: 500,
106
+ requireEmailVerificationOnInvitation: true
106
107
  };
107
108
  /** Adapter switches which must match in every host. */
108
109
  const BETTER_AUTH_ADAPTER_OPTIONS = {
@@ -277,6 +278,7 @@ const BETTER_AUTH_CORE_SCHEMA = {
277
278
  primaryKey: ["id"],
278
279
  fields: withPhysicalNames({
279
280
  id: idField,
281
+ issuer: field("string", { required: true }),
280
282
  accountId: field("string", { required: true }),
281
283
  providerId: field("string", { required: true }),
282
284
  userId: field("string", {
@@ -295,6 +297,10 @@ const BETTER_AUTH_CORE_SCHEMA = {
295
297
  updatedAt: updatedDate
296
298
  }),
297
299
  indexes: [{
300
+ fields: ["issuer", "accountId"],
301
+ predicate: null,
302
+ unique: true
303
+ }, {
298
304
  fields: ["userId"],
299
305
  predicate: null,
300
306
  unique: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/auth-model",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Portable Better Auth core contract and parity checks.",
5
5
  "keywords": [
6
6
  "authentication",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "devDependencies": {
49
49
  "@stll/typescript-config": "0.0.0",
50
- "better-auth": "1.6.26",
50
+ "better-auth": "1.7.1",
51
51
  "bun-types": "1.4.0",
52
52
  "tsdown": "0.22.14"
53
53
  },