@acmekit/api-key 2.13.15 → 2.13.16

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
  import { Migration } from "@acmekit/framework/mikro-orm/migrations";
2
- export declare class Migration20240604080145 extends Migration {
2
+ export declare class Migration20260205065417 extends Migration {
3
3
  up(): Promise<void>;
4
4
  down(): Promise<void>;
5
5
  }
6
- //# sourceMappingURL=Migration20240604080145.d.ts.map
6
+ //# sourceMappingURL=Migration20260205065417.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20260205065417.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20260205065417.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IAErC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAUnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAIrC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20260205065417 = void 0;
4
+ const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
+ class Migration20260205065417 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`alter table if exists "api_key" drop constraint if exists "api_key_token_unique";`);
8
+ this.addSql(`create table if not exists "api_key" ("id" text not null, "token" text not null, "salt" text not null, "redacted" text not null, "title" text not null, "type" text check ("type" in ('client', 'secret')) not null, "last_used_at" timestamptz null, "created_by" text not null, "revoked_by" text null, "revoked_at" timestamptz null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "api_key_pkey" primary key ("id"));`);
9
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_api_key_deleted_at" ON "api_key" ("deleted_at") WHERE deleted_at IS NULL;`);
10
+ this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_api_key_token_unique" ON "api_key" ("token") WHERE deleted_at IS NULL;`);
11
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_api_key_revoked_at" ON "api_key" ("revoked_at") WHERE deleted_at IS NULL;`);
12
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_api_key_redacted" ON "api_key" ("redacted") WHERE deleted_at IS NULL;`);
13
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_api_key_type" ON "api_key" ("type") WHERE deleted_at IS NULL;`);
14
+ }
15
+ async down() {
16
+ this.addSql(`drop table if exists "api_key" cascade;`);
17
+ }
18
+ }
19
+ exports.Migration20260205065417 = Migration20260205065417;
20
+ //# sourceMappingURL=Migration20260205065417.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20260205065417.js","sourceRoot":"","sources":["../../src/migrations/Migration20260205065417.ts"],"names":[],"mappings":";;;AAAA,wEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IAE3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CAAC,mFAAmF,CAAC,CAAC;QACjG,IAAI,CAAC,MAAM,CAAC,0fAA0f,CAAC,CAAC;QACxgB,IAAI,CAAC,MAAM,CAAC,2GAA2G,CAAC,CAAC;QACzH,IAAI,CAAC,MAAM,CAAC,+GAA+G,CAAC,CAAC;QAC7H,IAAI,CAAC,MAAM,CAAC,2GAA2G,CAAC,CAAC;QACzH,IAAI,CAAC,MAAM,CAAC,uGAAuG,CAAC,CAAC;QACrH,IAAI,CAAC,MAAM,CAAC,+FAA+F,CAAC,CAAC;IAC/G,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,yCAAyC,CAAC,CAAC;IACzD,CAAC;CAEF;AAhBD,0DAgBC"}
@@ -1 +1 @@
1
- {"root":["../src/index.ts","../src/joiner-config.ts","../src/migrations/initialsetup20240221144943.ts","../src/migrations/migration20240604080145.ts","../src/migrations/migration20241205122700.ts","../src/migrations/migration20251015123842.ts","../src/models/api-key.ts","../src/models/index.ts","../src/services/api-key-module-service.ts","../src/services/index.ts","../src/services/__tests__/noop.ts","../src/types/index.ts"],"version":"5.9.3"}
1
+ {"root":["../src/index.ts","../src/joiner-config.ts","../src/migrations/migration20260205065417.ts","../src/models/api-key.ts","../src/models/index.ts","../src/services/api-key-module-service.ts","../src/services/index.ts","../src/services/__tests__/noop.ts","../src/types/index.ts"],"version":"5.9.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acmekit/api-key",
3
- "version": "2.13.15",
3
+ "version": "2.13.16",
4
4
  "description": "AcmeKit API Key module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,10 +36,10 @@
36
36
  "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true acmekit-mikro-orm cache:clear"
37
37
  },
38
38
  "devDependencies": {
39
- "@acmekit/framework": "2.13.15",
40
- "@acmekit/test-utils": "2.13.15"
39
+ "@acmekit/framework": "2.13.16",
40
+ "@acmekit/test-utils": "2.13.16"
41
41
  },
42
42
  "peerDependencies": {
43
- "@acmekit/framework": "2.13.15"
43
+ "@acmekit/framework": "2.13.16"
44
44
  }
45
45
  }
@@ -1,5 +0,0 @@
1
- import { Migration } from "@acmekit/framework/mikro-orm/migrations";
2
- export declare class InitialSetup20240221144943 extends Migration {
3
- up(): Promise<void>;
4
- }
5
- //# sourceMappingURL=InitialSetup20240221144943.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InitialSetup20240221144943.d.ts","sourceRoot":"","sources":["../../src/migrations/InitialSetup20240221144943.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAEnE,qBAAa,0BAA2B,SAAQ,SAAS;IACjD,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAW1B"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InitialSetup20240221144943 = void 0;
4
- const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
- class InitialSetup20240221144943 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql('create table if not exists "api_key" ("id" text not null, "token" text not null, "salt" text not null, "redacted" text not null, "title" text not null, "type" text not null, "last_used_at" timestamptz null, "created_by" text not null, "created_at" timestamptz not null default now(), "revoked_by" text null, "revoked_at" timestamptz null, constraint "api_key_pkey" primary key ("id"));');
8
- this.addSql('CREATE UNIQUE INDEX IF NOT EXISTS "IDX_api_key_token_unique" ON "api_key" (token);');
9
- this.addSql('CREATE INDEX IF NOT EXISTS "IDX_api_key_type" ON "api_key" (type);');
10
- }
11
- }
12
- exports.InitialSetup20240221144943 = InitialSetup20240221144943;
13
- //# sourceMappingURL=InitialSetup20240221144943.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InitialSetup20240221144943.js","sourceRoot":"","sources":["../../src/migrations/InitialSetup20240221144943.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AAEnE,MAAa,0BAA2B,SAAQ,sBAAS;IACvD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CACT,mYAAmY,CACpY,CAAA;QACD,IAAI,CAAC,MAAM,CACT,oFAAoF,CACrF,CAAA;QACD,IAAI,CAAC,MAAM,CACT,oEAAoE,CACrE,CAAA;IACH,CAAC;CACF;AAZD,gEAYC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Migration20240604080145.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20240604080145.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAEnE,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAMnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAK5B"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20240604080145 = void 0;
4
- const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
- class Migration20240604080145 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql('alter table if exists "api_key" add column if not exists "updated_at" timestamptz not null default now();');
8
- }
9
- async down() {
10
- this.addSql('alter table if exists "api_key" drop column if exists "updated_at";');
11
- }
12
- }
13
- exports.Migration20240604080145 = Migration20240604080145;
14
- //# sourceMappingURL=Migration20240604080145.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Migration20240604080145.js","sourceRoot":"","sources":["../../src/migrations/Migration20240604080145.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AAEnE,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CACT,2GAA2G,CAC5G,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CACT,qEAAqE,CACtE,CAAA;IACH,CAAC;CACF;AAZD,0DAYC"}
@@ -1,6 +0,0 @@
1
- import { Migration } from "@acmekit/framework/mikro-orm/migrations";
2
- export declare class Migration20241205122700 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
6
- //# sourceMappingURL=Migration20241205122700.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Migration20241205122700.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20241205122700.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAEnE,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAenB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAa5B"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20241205122700 = void 0;
4
- const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
- class Migration20241205122700 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql('alter table if exists "api_key" add column if not exists "deleted_at" timestamptz null;');
8
- this.addSql('alter table if exists "api_key" alter column "type" type text using ("type"::text);');
9
- this.addSql('alter table if exists "api_key" add constraint "api_key_type_check" check ("type" in (\'publishable\', \'secret\'));');
10
- this.addSql('CREATE INDEX IF NOT EXISTS "IDX_api_key_deleted_at" ON "api_key" (deleted_at) WHERE deleted_at IS NULL;');
11
- }
12
- async down() {
13
- this.addSql('alter table if exists "api_key" drop constraint if exists "api_key_type_check";');
14
- this.addSql('alter table if exists "api_key" alter column "type" type text using ("type"::text);');
15
- this.addSql('drop index if exists "IDX_api_key_deleted_at";');
16
- this.addSql('alter table if exists "api_key" drop column if exists "deleted_at";');
17
- }
18
- }
19
- exports.Migration20241205122700 = Migration20241205122700;
20
- //# sourceMappingURL=Migration20241205122700.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Migration20241205122700.js","sourceRoot":"","sources":["../../src/migrations/Migration20241205122700.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AAEnE,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CACT,yFAAyF,CAC1F,CAAA;QACD,IAAI,CAAC,MAAM,CACT,qFAAqF,CACtF,CAAA;QACD,IAAI,CAAC,MAAM,CACT,sHAAsH,CACvH,CAAA;QACD,IAAI,CAAC,MAAM,CACT,yGAAyG,CAC1G,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CACT,iFAAiF,CAClF,CAAA;QAED,IAAI,CAAC,MAAM,CACT,qFAAqF,CACtF,CAAA;QACD,IAAI,CAAC,MAAM,CAAC,gDAAgD,CAAC,CAAA;QAC7D,IAAI,CAAC,MAAM,CACT,qEAAqE,CACtE,CAAA;IACH,CAAC;CACF;AA7BD,0DA6BC"}
@@ -1,6 +0,0 @@
1
- import { Migration } from "@acmekit/framework/mikro-orm/migrations";
2
- export declare class Migration20251015123842 extends Migration {
3
- up(): Promise<void>;
4
- down(): Promise<void>;
5
- }
6
- //# sourceMappingURL=Migration20251015123842.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Migration20251015123842.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20251015123842.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAEnE,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IASnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAIrC"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Migration20251015123842 = void 0;
4
- const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
- class Migration20251015123842 extends migrations_1.Migration {
6
- async up() {
7
- this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_api_key_revoked_at" ON "api_key" (revoked_at) WHERE deleted_at IS NULL;`);
8
- this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_api_key_redacted" ON "api_key" (redacted) WHERE deleted_at IS NULL;`);
9
- }
10
- async down() {
11
- this.addSql(`drop index if exists "IDX_api_key_revoked_at";`);
12
- this.addSql(`drop index if exists "IDX_api_key_redacted";`);
13
- }
14
- }
15
- exports.Migration20251015123842 = Migration20251015123842;
16
- //# sourceMappingURL=Migration20251015123842.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Migration20251015123842.js","sourceRoot":"","sources":["../../src/migrations/Migration20251015123842.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AAEnE,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CACT,yGAAyG,CAC1G,CAAA;QACD,IAAI,CAAC,MAAM,CACT,qGAAqG,CACtG,CAAA;IACH,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,gDAAgD,CAAC,CAAA;QAC7D,IAAI,CAAC,MAAM,CAAC,8CAA8C,CAAC,CAAA;IAC7D,CAAC;CACF;AAdD,0DAcC"}