@nauth-toolkit/database-typeorm-mysql 0.1.23 → 0.1.25

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.
@@ -9,6 +9,7 @@ export * from './auth-audit.entity';
9
9
  export * from './trusted-device.entity';
10
10
  export * from './rate-limit.entity';
11
11
  export * from './storage-lock.entity';
12
+ export * from './social-provider-secret.entity';
12
13
  /**
13
14
  * Get all nauth-toolkit entities for TypeORM configuration (MySQL)
14
15
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AAetC;;;;;;;;;;;;;;;;;;GAkBG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gBAAgB,IAAI,QAAQ,EAAE,CAY7C;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gCAAgC,IAAI,QAAQ,EAAE,CAE7D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAgBhD;;;;;;;;;;;;;;;;;;GAkBG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gBAAgB,IAAI,QAAQ,EAAE,CAa7C;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gCAAgC,IAAI,QAAQ,EAAE,CAE7D"}
@@ -27,6 +27,7 @@ __exportStar(require("./auth-audit.entity"), exports);
27
27
  __exportStar(require("./trusted-device.entity"), exports);
28
28
  __exportStar(require("./rate-limit.entity"), exports);
29
29
  __exportStar(require("./storage-lock.entity"), exports);
30
+ __exportStar(require("./social-provider-secret.entity"), exports);
30
31
  // Import all entities for the helper function
31
32
  const user_entity_1 = require("./user.entity");
32
33
  const session_entity_1 = require("./session.entity");
@@ -39,6 +40,7 @@ const auth_audit_entity_1 = require("./auth-audit.entity");
39
40
  const trusted_device_entity_1 = require("./trusted-device.entity");
40
41
  const rate_limit_entity_1 = require("./rate-limit.entity");
41
42
  const storage_lock_entity_1 = require("./storage-lock.entity");
43
+ const social_provider_secret_entity_1 = require("./social-provider-secret.entity");
42
44
  /**
43
45
  * Get all nauth-toolkit entities for TypeORM configuration (MySQL)
44
46
  *
@@ -92,6 +94,7 @@ function getNAuthEntities() {
92
94
  mfa_device_entity_1.MFADevice,
93
95
  auth_audit_entity_1.AuthAudit,
94
96
  trusted_device_entity_1.TrustedDevice,
97
+ social_provider_secret_entity_1.SocialProviderSecret,
95
98
  ];
96
99
  }
97
100
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAmEA,4CAYC;AAwBD,4EAEC;AAzGD,gDAA8B;AAC9B,mDAAiC;AACjC,yDAAuC;AACvC,8DAA4C;AAC5C,0DAAwC;AACxC,6DAA2C;AAC3C,sDAAoC;AACpC,sDAAoC;AACpC,0DAAwC;AACxC,sDAAoC;AACpC,wDAAsC;AAEtC,8CAA8C;AAC9C,+CAAqC;AACrC,qDAA2C;AAC3C,iEAAsD;AACtD,2EAAgE;AAChE,mEAAwD;AACxD,yEAA8D;AAC9D,2DAAgD;AAChD,2DAAgD;AAChD,mEAAwD;AACxD,2DAAgD;AAChD,+DAAoD;AAEpD;;;;;;;;;;;;;;;;;;GAkBG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,gBAAgB;IAC9B,OAAO;QACL,kBAAI;QACJ,wBAAO;QACP,mCAAY;QACZ,6CAAiB;QACjB,qCAAa;QACb,2CAAgB;QAChB,6BAAS;QACT,6BAAS;QACT,qCAAa;KACd,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,gCAAgC;IAC9C,OAAO,CAAC,6BAAS,EAAE,iCAAW,CAAC,CAAC;AAClC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAqEA,4CAaC;AAwBD,4EAEC;AA5GD,gDAA8B;AAC9B,mDAAiC;AACjC,yDAAuC;AACvC,8DAA4C;AAC5C,0DAAwC;AACxC,6DAA2C;AAC3C,sDAAoC;AACpC,sDAAoC;AACpC,0DAAwC;AACxC,sDAAoC;AACpC,wDAAsC;AACtC,kEAAgD;AAEhD,8CAA8C;AAC9C,+CAAqC;AACrC,qDAA2C;AAC3C,iEAAsD;AACtD,2EAAgE;AAChE,mEAAwD;AACxD,yEAA8D;AAC9D,2DAAgD;AAChD,2DAAgD;AAChD,mEAAwD;AACxD,2DAAgD;AAChD,+DAAoD;AACpD,mFAAuE;AAEvE;;;;;;;;;;;;;;;;;;GAkBG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,gBAAgB;IAC9B,OAAO;QACL,kBAAI;QACJ,wBAAO;QACP,mCAAY;QACZ,6CAAiB;QACjB,qCAAa;QACb,2CAAgB;QAChB,6BAAS;QACT,6BAAS;QACT,qCAAa;QACb,oDAAoB;KACrB,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,gCAAgC;IAC9C,OAAO,CAAC,6BAAS,EAAE,iCAAW,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { BaseSocialProviderSecret } from '@nauth-toolkit/core';
2
+ /**
3
+ * TypeORM MySQL Social Provider Secret Entity
4
+ *
5
+ * Extends BaseSocialProviderSecret from core and adds MySQL-specific TypeORM decorators.
6
+ * Stores generated OAuth client secrets (JWTs) for social providers that require dynamic secret generation.
7
+ */
8
+ export declare class SocialProviderSecret extends BaseSocialProviderSecret {
9
+ id: number;
10
+ provider: string;
11
+ clientSecretJwt: string;
12
+ expiresAt: Date;
13
+ createdAt: Date;
14
+ updatedAt: Date;
15
+ }
16
+ //# sourceMappingURL=social-provider-secret.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-provider-secret.entity.d.ts","sourceRoot":"","sources":["../../src/entities/social-provider-secret.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;;;;GAKG;AACH,qBAEa,oBAAqB,SAAQ,wBAAwB;IAExD,EAAE,EAAE,MAAM,CAAC;IAGX,QAAQ,EAAE,MAAM,CAAC;IAGjB,eAAe,EAAE,MAAM,CAAC;IAGxB,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;CACzB"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SocialProviderSecret = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const core_1 = require("@nauth-toolkit/core");
15
+ /**
16
+ * TypeORM MySQL Social Provider Secret Entity
17
+ *
18
+ * Extends BaseSocialProviderSecret from core and adds MySQL-specific TypeORM decorators.
19
+ * Stores generated OAuth client secrets (JWTs) for social providers that require dynamic secret generation.
20
+ */
21
+ let SocialProviderSecret = class SocialProviderSecret extends core_1.BaseSocialProviderSecret {
22
+ };
23
+ exports.SocialProviderSecret = SocialProviderSecret;
24
+ __decorate([
25
+ (0, typeorm_1.PrimaryGeneratedColumn)(),
26
+ __metadata("design:type", Number)
27
+ ], SocialProviderSecret.prototype, "id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50 }),
30
+ __metadata("design:type", String)
31
+ ], SocialProviderSecret.prototype, "provider", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({ type: 'text' }),
34
+ __metadata("design:type", String)
35
+ ], SocialProviderSecret.prototype, "clientSecretJwt", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ type: 'timestamp', precision: 6 }),
38
+ __metadata("design:type", Date)
39
+ ], SocialProviderSecret.prototype, "expiresAt", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.CreateDateColumn)({ type: 'timestamp', precision: 6, default: () => 'CURRENT_TIMESTAMP(6)' }),
42
+ __metadata("design:type", Date)
43
+ ], SocialProviderSecret.prototype, "createdAt", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.UpdateDateColumn)({
46
+ type: 'timestamp',
47
+ precision: 6,
48
+ default: () => 'CURRENT_TIMESTAMP(6)',
49
+ onUpdate: 'CURRENT_TIMESTAMP(6)',
50
+ }),
51
+ __metadata("design:type", Date)
52
+ ], SocialProviderSecret.prototype, "updatedAt", void 0);
53
+ exports.SocialProviderSecret = SocialProviderSecret = __decorate([
54
+ (0, typeorm_1.Entity)('nauth_social_provider_secrets'),
55
+ (0, typeorm_1.Unique)(['provider']) // One record per provider
56
+ ], SocialProviderSecret);
57
+ //# sourceMappingURL=social-provider-secret.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-provider-secret.entity.js","sourceRoot":"","sources":["../../src/entities/social-provider-secret.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6G;AAC7G,8CAA+D;AAE/D;;;;;GAKG;AAGI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,+BAAwB;CAuBjE,CAAA;AAvBY,oDAAoB;AAEvB;IADP,IAAA,gCAAsB,GAAE;;gDACN;AAGX;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;sDACf;AAGjB;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DACO;AAGxB;IADP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;8BACzB,IAAI;uDAAC;AAGhB;IADP,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,EAAE,CAAC;8BAC1E,IAAI;uDAAC;AAQhB;IANP,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB;QACrC,QAAQ,EAAE,sBAAsB;KACjC,CAAC;8BACiB,IAAI;uDAAC;+BAtBb,oBAAoB;IAFhC,IAAA,gBAAM,EAAC,+BAA+B,CAAC;IACvC,IAAA,gBAAM,EAAC,CAAC,UAAU,CAAC,CAAC,CAAC,0BAA0B;GACnC,oBAAoB,CAuBhC"}
@@ -0,0 +1,7 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+ export declare class AddSocialProviderSecrets1766480775000 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=1766480775000-AddSocialProviderSecrets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1766480775000-AddSocialProviderSecrets.d.ts","sourceRoot":"","sources":["../../src/migrations/1766480775000-AddSocialProviderSecrets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,qCAAsC,YAAW,kBAAkB;IAC9E,IAAI,SAA2C;IAElC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAS3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAI3D"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddSocialProviderSecrets1766480775000 = void 0;
4
+ class AddSocialProviderSecrets1766480775000 {
5
+ name = 'AddSocialProviderSecrets1766480775000';
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`CREATE TABLE \`nauth_social_provider_secrets\` (\`id\` int NOT NULL AUTO_INCREMENT, \`provider\` varchar(50) NOT NULL, \`clientSecretJwt\` text NOT NULL, \`expiresAt\` timestamp(6) NOT NULL, \`createdAt\` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updatedAt\` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
8
+ await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_social_provider_secrets_provider\` ON \`nauth_social_provider_secrets\` (\`provider\`)`);
9
+ }
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`DROP INDEX \`IDX_social_provider_secrets_provider\` ON \`nauth_social_provider_secrets\``);
12
+ await queryRunner.query(`DROP TABLE \`nauth_social_provider_secrets\``);
13
+ }
14
+ }
15
+ exports.AddSocialProviderSecrets1766480775000 = AddSocialProviderSecrets1766480775000;
16
+ //# sourceMappingURL=1766480775000-AddSocialProviderSecrets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1766480775000-AddSocialProviderSecrets.js","sourceRoot":"","sources":["../../src/migrations/1766480775000-AddSocialProviderSecrets.ts"],"names":[],"mappings":";;;AAEA,MAAa,qCAAqC;IAChD,IAAI,GAAG,uCAAuC,CAAC;IAExC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,KAAK,CACrB,uYAAuY,CACxY,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,kHAAkH,CACnH,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,WAAW,CAAC,KAAK,CAAC,0FAA0F,CAAC,CAAC;QACpH,MAAM,WAAW,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAC1E,CAAC;CACF;AAhBD,sFAgBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlD,MAAM,MAAM,oBAAoB,GAAG;IAAE,QAAQ,kBAAkB,CAAA;CAAE,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,oBAAoB,EAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAIlD,MAAM,MAAM,oBAAoB,GAAG;IAAE,QAAQ,kBAAkB,CAAA;CAAE,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,oBAAoB,EAAkE,CAAC"}
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.migrations = void 0;
4
4
  const _1734600000000_Initial_1 = require("./1734600000000-Initial");
5
+ const _1766480775000_AddSocialProviderSecrets_1 = require("./1766480775000-AddSocialProviderSecrets");
5
6
  /**
6
7
  * Adapter-owned migrations for @nauth-toolkit/database-typeorm-mysql
7
8
  */
8
- exports.migrations = [_1734600000000_Initial_1.Initial1734600000000];
9
+ exports.migrations = [_1734600000000_Initial_1.Initial1734600000000, _1766480775000_AddSocialProviderSecrets_1.AddSocialProviderSecrets1766480775000];
9
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":";;;AACA,oEAA+D;AAI/D;;GAEG;AACU,QAAA,UAAU,GAA2B,CAAC,6CAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":";;;AACA,oEAA+D;AAC/D,sGAAiG;AAIjG;;GAEG;AACU,QAAA,UAAU,GAA2B,CAAC,6CAAoB,EAAE,+EAAqC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nauth-toolkit/database-typeorm-mysql",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "MySQL TypeORM adapter for nauth-toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  "format:check": "prettier --check \"src/**/*.ts\""
15
15
  },
16
16
  "peerDependencies": {
17
- "@nauth-toolkit/core": "^0.1.23",
17
+ "@nauth-toolkit/core": "^0.1.25",
18
18
  "typeorm": "^0.3.20",
19
19
  "mysql2": "^2.3.0 || ^3.0.0"
20
20
  },