@nauth-toolkit/database-typeorm-postgres 0.1.23 → 0.1.24
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/entities/index.d.ts +1 -0
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +3 -0
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/social-provider-secret.entity.d.ts +16 -0
- package/dist/entities/social-provider-secret.entity.d.ts.map +1 -0
- package/dist/entities/social-provider-secret.entity.js +52 -0
- package/dist/entities/social-provider-secret.entity.js.map +1 -0
- package/dist/migrations/1766480775000-AddSocialProviderSecrets.d.ts +7 -0
- package/dist/migrations/1766480775000-AddSocialProviderSecrets.d.ts.map +1 -0
- package/dist/migrations/1766480775000-AddSocialProviderSecrets.js +16 -0
- package/dist/migrations/1766480775000-AddSocialProviderSecrets.js.map +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +2 -1
- package/dist/migrations/index.js.map +1 -1
- package/package.json +2 -2
package/dist/entities/index.d.ts
CHANGED
|
@@ -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 (excluding storage entities)
|
|
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;
|
|
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;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gBAAgB,IAAI,QAAQ,EAAE,CAa7C;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gCAAgC,IAAI,QAAQ,EAAE,CAE7D"}
|
package/dist/entities/index.js
CHANGED
|
@@ -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 (excluding storage entities)
|
|
44
46
|
*
|
|
@@ -73,6 +75,7 @@ function getNAuthEntities() {
|
|
|
73
75
|
mfa_device_entity_1.MFADevice,
|
|
74
76
|
auth_audit_entity_1.AuthAudit,
|
|
75
77
|
trusted_device_entity_1.TrustedDevice,
|
|
78
|
+
social_provider_secret_entity_1.SocialProviderSecret,
|
|
76
79
|
];
|
|
77
80
|
}
|
|
78
81
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAkDA,4CAaC;AAwBD,4EAEC;AAzFD,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;;;;;;;;;;;;;;;;;;;;;;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 PostgreSQL Social Provider Secret Entity
|
|
4
|
+
*
|
|
5
|
+
* Extends BaseSocialProviderSecret from core and adds PostgreSQL-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;IAGhB,SAAS,EAAE,IAAI,CAAC;CACzB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 PostgreSQL Social Provider Secret Entity
|
|
17
|
+
*
|
|
18
|
+
* Extends BaseSocialProviderSecret from core and adds PostgreSQL-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: 'timestamptz' }),
|
|
38
|
+
__metadata("design:type", Date)
|
|
39
|
+
], SocialProviderSecret.prototype, "expiresAt", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
|
|
42
|
+
__metadata("design:type", Date)
|
|
43
|
+
], SocialProviderSecret.prototype, "createdAt", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.UpdateDateColumn)({ type: 'timestamptz' }),
|
|
46
|
+
__metadata("design:type", Date)
|
|
47
|
+
], SocialProviderSecret.prototype, "updatedAt", void 0);
|
|
48
|
+
exports.SocialProviderSecret = SocialProviderSecret = __decorate([
|
|
49
|
+
(0, typeorm_1.Entity)('nauth_social_provider_secrets'),
|
|
50
|
+
(0, typeorm_1.Unique)(['provider']) // One record per provider
|
|
51
|
+
], SocialProviderSecret);
|
|
52
|
+
//# 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;CAkBjE,CAAA;AAlBY,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,aAAa,EAAE,CAAC;8BACb,IAAI;uDAAC;AAGhB;IADP,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BACvB,IAAI;uDAAC;AAGhB;IADP,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BACvB,IAAI;uDAAC;+BAjBb,oBAAoB;IAFhC,IAAA,gBAAM,EAAC,+BAA+B,CAAC;IACvC,IAAA,gBAAM,EAAC,CAAC,UAAU,CAAC,CAAC,CAAC,0BAA0B;GACnC,oBAAoB,CAkBhC"}
|
|
@@ -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" SERIAL NOT NULL, "provider" character varying(50) NOT NULL, "clientSecretJwt" text NOT NULL, "expiresAt" TIMESTAMP WITH TIME ZONE NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), CONSTRAINT "PK_social_provider_secrets" PRIMARY KEY ("id"))`);
|
|
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"`);
|
|
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,sXAAsX,CACvX,CAAC;QACF,MAAM,WAAW,CAAC,KAAK,CACrB,4GAA4G,CAC7G,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,WAAW,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;QAC7E,MAAM,WAAW,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;IACxE,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;
|
|
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"}
|
package/dist/migrations/index.js
CHANGED
|
@@ -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-postgres
|
|
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;
|
|
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-postgres",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"description": "PostgreSQL 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.
|
|
17
|
+
"@nauth-toolkit/core": "^0.1.24",
|
|
18
18
|
"typeorm": "^0.3.20",
|
|
19
19
|
"pg": "^8.0.0"
|
|
20
20
|
},
|