@webiny/api-audit-logs-sql 0.0.0-unstable.3fddf667ea → 0.0.0-unstable.48a4e5b6c1
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/AuditLogsSqlSchemaSetup.js +3 -1
- package/AuditLogsSqlSchemaSetup.js.map +1 -1
- package/SqlAuditLogsStorage.d.ts +3 -2
- package/SqlAuditLogsStorage.js +4 -1
- package/SqlAuditLogsStorage.js.map +1 -1
- package/SqliteStorage.d.ts +4 -0
- package/SqliteStorage.js +14 -6
- package/SqliteStorage.js.map +1 -1
- package/package.json +9 -9
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { KnexClient, SqlSchemaConfig, SqlSchemaSetup } from "@webiny/api-core-sql";
|
|
2
|
+
import { tenantNeutralScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
|
|
2
3
|
import { SqliteStorage } from "./SqliteStorage.js";
|
|
3
4
|
import { createTableManager } from "./createTableManager.js";
|
|
4
5
|
class AuditLogsSqlSchemaSetupImpl {
|
|
@@ -11,7 +12,8 @@ class AuditLogsSqlSchemaSetupImpl {
|
|
|
11
12
|
const tableManager = createTableManager(this.knex, this.schemaConfig, false);
|
|
12
13
|
new SqliteStorage({
|
|
13
14
|
knex: this.knex.client,
|
|
14
|
-
tableManager
|
|
15
|
+
tableManager,
|
|
16
|
+
scopeTenant: tenantNeutralScopeTenant
|
|
15
17
|
});
|
|
16
18
|
await tableManager.setup();
|
|
17
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuditLogsSqlSchemaSetup.js","sources":["../src/AuditLogsSqlSchemaSetup.ts"],"sourcesContent":["import { KnexClient, SqlSchemaConfig, SqlSchemaSetup } from \"@webiny/api-core-sql\";\nimport { SqliteStorage } from \"~/SqliteStorage.js\";\nimport { createTableManager } from \"~/createTableManager.js\";\n\n/** The `auditLogs` schema setup step: the audit logs table. */\nclass AuditLogsSqlSchemaSetupImpl implements SqlSchemaSetup.Interface {\n public readonly name = \"auditLogs\";\n\n public constructor(\n private readonly knex: KnexClient.Interface,\n private readonly schemaConfig?: SqlSchemaConfig.Interface\n ) {}\n\n public async setup(): Promise<void> {\n const tableManager = createTableManager(this.knex, this.schemaConfig, false);\n // Building the storage declares its table on the manager.\n new SqliteStorage({
|
|
1
|
+
{"version":3,"file":"AuditLogsSqlSchemaSetup.js","sources":["../src/AuditLogsSqlSchemaSetup.ts"],"sourcesContent":["import { KnexClient, SqlSchemaConfig, SqlSchemaSetup } from \"@webiny/api-core-sql\";\nimport { tenantNeutralScopeTenant } from \"@webiny/api-core/features/tenancy/ScopeTenant/index.js\";\nimport { SqliteStorage } from \"~/SqliteStorage.js\";\nimport { createTableManager } from \"~/createTableManager.js\";\n\n/** The `auditLogs` schema setup step: the audit logs table. */\nclass AuditLogsSqlSchemaSetupImpl implements SqlSchemaSetup.Interface {\n public readonly name = \"auditLogs\";\n\n public constructor(\n private readonly knex: KnexClient.Interface,\n private readonly schemaConfig?: SqlSchemaConfig.Interface\n ) {}\n\n public async setup(): Promise<void> {\n const tableManager = createTableManager(this.knex, this.schemaConfig, false);\n // Building the storage declares its table on the manager.\n new SqliteStorage({\n knex: this.knex.client,\n tableManager,\n // The setup runs in no tenant, and only declares the table.\n scopeTenant: tenantNeutralScopeTenant\n });\n await tableManager.setup();\n }\n}\n\nexport const AuditLogsSqlSchemaSetup = SqlSchemaSetup.createImplementation({\n implementation: AuditLogsSqlSchemaSetupImpl,\n dependencies: [KnexClient, [SqlSchemaConfig, { optional: true }]]\n});\n"],"names":["AuditLogsSqlSchemaSetupImpl","knex","schemaConfig","tableManager","createTableManager","SqliteStorage","tenantNeutralScopeTenant","AuditLogsSqlSchemaSetup","SqlSchemaSetup","KnexClient","SqlSchemaConfig"],"mappings":";;;;AAMA,MAAMA;IAGF,YACqBC,IAA0B,EAC1BC,YAAwC,CAC3D;aAFmBD,IAAI,GAAJA;aACAC,YAAY,GAAZA;aAJL,IAAI,GAAG;IAKpB;IAEH,MAAa,QAAuB;QAChC,MAAMC,eAAeC,mBAAmB,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;QAEtE,IAAIC,cAAc;YACd,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM;YACtBF;YAEA,aAAaG;QACjB;QACA,MAAMH,aAAa,KAAK;IAC5B;AACJ;AAEO,MAAMI,0BAA0BC,eAAe,oBAAoB,CAAC;IACvE,gBAAgBR;IAChB,cAAc;QAACS;QAAY;YAACC;YAAiB;gBAAE,UAAU;YAAK;SAAE;KAAC;AACrE"}
|
package/SqlAuditLogsStorage.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { KnexClient, SqlSchemaConfig } from "@webiny/api-core-sql";
|
|
2
2
|
import { AuditLogsStorage } from "@webiny/api-audit-logs/abstractions.js";
|
|
3
3
|
import { SqliteStorage } from "./SqliteStorage.js";
|
|
4
|
-
|
|
4
|
+
import { ScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
|
|
5
|
+
/** The audit logs storage on the container's connection and table prefix, for its scope's tenant. */
|
|
5
6
|
declare class SqlAuditLogsStorageImpl extends SqliteStorage implements AuditLogsStorage.Interface {
|
|
6
|
-
constructor(knex: KnexClient.Interface, schemaConfig?: SqlSchemaConfig.Interface);
|
|
7
|
+
constructor(knex: KnexClient.Interface, scopeTenant: ScopeTenant.Interface, schemaConfig?: SqlSchemaConfig.Interface);
|
|
7
8
|
}
|
|
8
9
|
export declare const SqlAuditLogsStorage: typeof SqlAuditLogsStorageImpl & {
|
|
9
10
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-audit-logs/storage/abstractions/Storage").IStorage>;
|
package/SqlAuditLogsStorage.js
CHANGED
|
@@ -2,11 +2,13 @@ import { KnexClient, SqlSchemaConfig } from "@webiny/api-core-sql";
|
|
|
2
2
|
import { AuditLogsStorage } from "@webiny/api-audit-logs/abstractions.js";
|
|
3
3
|
import { SqliteStorage } from "./SqliteStorage.js";
|
|
4
4
|
import { createTableManager } from "./createTableManager.js";
|
|
5
|
+
import { ScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
|
|
5
6
|
class SqlAuditLogsStorageImpl extends SqliteStorage {
|
|
6
|
-
constructor(knex, schemaConfig){
|
|
7
|
+
constructor(knex, scopeTenant, schemaConfig){
|
|
7
8
|
const schemaManaged = schemaConfig?.isManaged() === true;
|
|
8
9
|
super({
|
|
9
10
|
knex: knex.client,
|
|
11
|
+
scopeTenant,
|
|
10
12
|
tableManager: createTableManager(knex, schemaConfig, schemaManaged)
|
|
11
13
|
});
|
|
12
14
|
}
|
|
@@ -15,6 +17,7 @@ const SqlAuditLogsStorage = AuditLogsStorage.createImplementation({
|
|
|
15
17
|
implementation: SqlAuditLogsStorageImpl,
|
|
16
18
|
dependencies: [
|
|
17
19
|
KnexClient,
|
|
20
|
+
ScopeTenant,
|
|
18
21
|
[
|
|
19
22
|
SqlSchemaConfig,
|
|
20
23
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SqlAuditLogsStorage.js","sources":["../src/SqlAuditLogsStorage.ts"],"sourcesContent":["import { KnexClient, SqlSchemaConfig } from \"@webiny/api-core-sql\";\nimport { AuditLogsStorage } from \"@webiny/api-audit-logs/abstractions.js\";\nimport { SqliteStorage } from \"~/SqliteStorage.js\";\nimport { createTableManager } from \"~/createTableManager.js\";\n\n/** The audit logs storage on the container's connection and table prefix. */\nclass SqlAuditLogsStorageImpl extends SqliteStorage implements AuditLogsStorage.Interface {\n public constructor(knex: KnexClient.Interface
|
|
1
|
+
{"version":3,"file":"SqlAuditLogsStorage.js","sources":["../src/SqlAuditLogsStorage.ts"],"sourcesContent":["import { KnexClient, SqlSchemaConfig } from \"@webiny/api-core-sql\";\nimport { AuditLogsStorage } from \"@webiny/api-audit-logs/abstractions.js\";\nimport { SqliteStorage } from \"~/SqliteStorage.js\";\nimport { createTableManager } from \"~/createTableManager.js\";\nimport { ScopeTenant } from \"@webiny/api-core/features/tenancy/ScopeTenant/index.js\";\n\n/** The audit logs storage on the container's connection and table prefix, for its scope's tenant. */\nclass SqlAuditLogsStorageImpl extends SqliteStorage implements AuditLogsStorage.Interface {\n public constructor(\n knex: KnexClient.Interface,\n scopeTenant: ScopeTenant.Interface,\n schemaConfig?: SqlSchemaConfig.Interface\n ) {\n const schemaManaged = schemaConfig?.isManaged() === true;\n super({\n knex: knex.client,\n scopeTenant,\n tableManager: createTableManager(knex, schemaConfig, schemaManaged)\n });\n }\n}\n\nexport const SqlAuditLogsStorage = AuditLogsStorage.createImplementation({\n implementation: SqlAuditLogsStorageImpl,\n dependencies: [KnexClient, ScopeTenant, [SqlSchemaConfig, { optional: true }]]\n});\n"],"names":["SqlAuditLogsStorageImpl","SqliteStorage","knex","scopeTenant","schemaConfig","schemaManaged","createTableManager","SqlAuditLogsStorage","AuditLogsStorage","KnexClient","ScopeTenant","SqlSchemaConfig"],"mappings":";;;;;AAOA,MAAMA,gCAAgCC;IAClC,YACIC,IAA0B,EAC1BC,WAAkC,EAClCC,YAAwC,CAC1C;QACE,MAAMC,gBAAgBD,cAAc,gBAAgB;QACpD,KAAK,CAAC;YACF,MAAMF,KAAK,MAAM;YACjBC;YACA,cAAcG,mBAAmBJ,MAAME,cAAcC;QACzD;IACJ;AACJ;AAEO,MAAME,sBAAsBC,iBAAiB,oBAAoB,CAAC;IACrE,gBAAgBR;IAChB,cAAc;QAACS;QAAYC;QAAa;YAACC;YAAiB;gBAAE,UAAU;YAAK;SAAE;KAAC;AAClF"}
|
package/SqliteStorage.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { Knex } from "knex";
|
|
2
|
+
import type { ScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
|
|
2
3
|
import type { TableManager } from "@webiny/api-core-sql/TableManager.js";
|
|
3
4
|
import type { IStorage, IStorageFetchParams, IStorageFetchResult, IStorageStoreParams, IStorageStoreResult, IStorageListParams, IStorageListResult } from "@webiny/api-audit-logs/storage/abstractions/Storage.js";
|
|
4
5
|
export declare class SqliteStorage implements IStorage {
|
|
5
6
|
private readonly knex;
|
|
6
7
|
private readonly tableManager;
|
|
7
8
|
private readonly ensureTable;
|
|
9
|
+
private readonly scopeTenant;
|
|
8
10
|
constructor(params: {
|
|
9
11
|
knex: Knex;
|
|
10
12
|
tableManager: TableManager;
|
|
13
|
+
/** The tenant the storage acts on: its tenant scope's. The schema setup runs without one. */
|
|
14
|
+
scopeTenant: ScopeTenant.Interface;
|
|
11
15
|
});
|
|
12
16
|
fetch(params: IStorageFetchParams): Promise<IStorageFetchResult>;
|
|
13
17
|
store(params: IStorageStoreParams): Promise<IStorageStoreResult>;
|
package/SqliteStorage.js
CHANGED
|
@@ -31,6 +31,7 @@ class SqliteStorage {
|
|
|
31
31
|
constructor(params){
|
|
32
32
|
this.knex = params.knex;
|
|
33
33
|
this.tableManager = params.tableManager;
|
|
34
|
+
this.scopeTenant = params.scopeTenant;
|
|
34
35
|
this.ensureTable = params.tableManager.define(TABLE_NAME, (table)=>{
|
|
35
36
|
table.text("id").primary();
|
|
36
37
|
table.text("tenant").notNullable();
|
|
@@ -49,7 +50,7 @@ class SqliteStorage {
|
|
|
49
50
|
async fetch(params) {
|
|
50
51
|
await this.ensureTable();
|
|
51
52
|
try {
|
|
52
|
-
const row = await this.knex(this.tableManager.resolve(TABLE_NAME)).where("id", params.id).andWhere("tenant",
|
|
53
|
+
const row = await this.knex(this.tableManager.resolve(TABLE_NAME)).where("id", params.id).andWhere("tenant", this.scopeTenant.getId()).first();
|
|
53
54
|
if (!row) return {
|
|
54
55
|
error: new Error(`Audit log with id "${params.id}" not found.`),
|
|
55
56
|
success: false
|
|
@@ -69,12 +70,19 @@ class SqliteStorage {
|
|
|
69
70
|
async store(params) {
|
|
70
71
|
await this.ensureTable();
|
|
71
72
|
try {
|
|
72
|
-
const
|
|
73
|
-
const
|
|
74
|
-
|
|
73
|
+
const tenant = this.scopeTenant.getId();
|
|
74
|
+
const row = toRow({
|
|
75
|
+
...params.data,
|
|
76
|
+
tenant
|
|
77
|
+
});
|
|
78
|
+
const existing = await this.knex(this.tableManager.resolve(TABLE_NAME)).where("id", params.data.id).andWhere("tenant", tenant).first();
|
|
79
|
+
if (existing) await this.knex(this.tableManager.resolve(TABLE_NAME)).where("id", params.data.id).andWhere("tenant", tenant).update(row);
|
|
75
80
|
else await this.knex(this.tableManager.resolve(TABLE_NAME)).insert(row);
|
|
76
81
|
return {
|
|
77
|
-
data:
|
|
82
|
+
data: {
|
|
83
|
+
...params.data,
|
|
84
|
+
tenant
|
|
85
|
+
},
|
|
78
86
|
success: true
|
|
79
87
|
};
|
|
80
88
|
} catch (error) {
|
|
@@ -88,7 +96,7 @@ class SqliteStorage {
|
|
|
88
96
|
await this.ensureTable();
|
|
89
97
|
try {
|
|
90
98
|
const limit = params.limit || 100;
|
|
91
|
-
const query = this.knex(this.tableManager.resolve(TABLE_NAME)).where("tenant",
|
|
99
|
+
const query = this.knex(this.tableManager.resolve(TABLE_NAME)).where("tenant", this.scopeTenant.getId());
|
|
92
100
|
if (params.app) query.andWhere("app", params.app);
|
|
93
101
|
if (params.entity) query.andWhere("entity", params.entity);
|
|
94
102
|
if (params.action) query.andWhere("action", params.action);
|
package/SqliteStorage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SqliteStorage.js","sources":["../src/SqliteStorage.ts"],"sourcesContent":["import type { Knex } from \"knex\";\nimport type { TableManager } from \"@webiny/api-core-sql/TableManager.js\";\nimport type { IAuditLog, IAuditLogCreatedBy } from \"@webiny/api-audit-logs/storage/types.js\";\nimport type {\n IStorage,\n IStorageFetchParams,\n IStorageFetchResult,\n IStorageStoreParams,\n IStorageStoreResult,\n IStorageListParams,\n IStorageListResult\n} from \"@webiny/api-audit-logs/storage/abstractions/Storage.js\";\n\ninterface AuditLogRow {\n id: string;\n tenant: string;\n createdBy: string;\n createdOn: string;\n app: string;\n action: string;\n message: string;\n entity: string;\n entityId: string;\n tags: string;\n expiresAt: string;\n content: string;\n}\n\nconst TABLE_NAME = \"webiny_audit_logs\";\n\n/* Convert an IAuditLog to a flat database row. */\nconst toRow = (data: IAuditLog): AuditLogRow => {\n return {\n id: data.id,\n tenant: data.tenant,\n createdBy: JSON.stringify(data.createdBy),\n createdOn: data.createdOn.toISOString(),\n app: data.app,\n action: data.action,\n message: data.message,\n entity: data.entity,\n entityId: data.entityId,\n tags: JSON.stringify(data.tags),\n expiresAt: data.expiresAt.toISOString(),\n content: data.content\n };\n};\n\n/* Convert a database row back to an IAuditLog. */\nconst fromRow = (row: AuditLogRow): IAuditLog => {\n return {\n id: row.id,\n tenant: row.tenant,\n createdBy: JSON.parse(row.createdBy) as IAuditLogCreatedBy,\n createdOn: new Date(row.createdOn),\n app: row.app,\n action: row.action,\n message: row.message,\n entity: row.entity,\n entityId: row.entityId,\n tags: JSON.parse(row.tags) as string[],\n expiresAt: new Date(row.expiresAt),\n content: row.content\n };\n};\n\nexport class SqliteStorage implements IStorage {\n private readonly knex: Knex;\n private readonly tableManager: TableManager;\n private readonly ensureTable: () => Promise<void>;\n\n public constructor(params: { knex: Knex; tableManager: TableManager }) {\n this.knex = params.knex;\n this.tableManager = params.tableManager;\n this.ensureTable = params.tableManager.define(TABLE_NAME, table => {\n table.text(\"id\").primary();\n table.text(\"tenant\").notNullable();\n table.text(\"createdBy\").notNullable();\n table.datetime(\"createdOn\").notNullable();\n table.text(\"app\").notNullable();\n table.text(\"action\").notNullable();\n table.text(\"message\").notNullable();\n table.text(\"entity\").notNullable();\n table.text(\"entityId\").notNullable();\n table.text(\"tags\").notNullable();\n table.datetime(\"expiresAt\").notNullable();\n table.text(\"content\").notNullable();\n });\n }\n\n public async fetch(params: IStorageFetchParams): Promise<IStorageFetchResult> {\n await this.ensureTable();\n\n try {\n const row = await this.knex<AuditLogRow>(this.tableManager.resolve(TABLE_NAME))\n .where(\"id\", params.id)\n .andWhere(\"tenant\", params.tenant)\n .first();\n\n if (!row) {\n return {\n error: new Error(`Audit log with id \"${params.id}\" not found.`),\n success: false\n };\n }\n\n const auditLog = fromRow(row);\n\n return {\n data: auditLog,\n success: true\n };\n } catch (error) {\n return {\n error: error as Error,\n success: false\n };\n }\n }\n\n public async store(params: IStorageStoreParams): Promise<IStorageStoreResult> {\n await this.ensureTable();\n\n try {\n const row = toRow(params.data);\n\n const existing = await this.knex<AuditLogRow>(this.tableManager.resolve(TABLE_NAME))\n .where(\"id\", params.data.id)\n .first();\n\n if (existing) {\n await this.knex<AuditLogRow>(this.tableManager.resolve(TABLE_NAME))\n .where(\"id\", params.data.id)\n .update(row);\n } else {\n await this.knex<AuditLogRow>(this.tableManager.resolve(TABLE_NAME)).insert(row);\n }\n\n return {\n data: params.data,\n success: true\n };\n } catch (error) {\n return {\n error: error as Error,\n success: false\n };\n }\n }\n\n public async list(params: IStorageListParams): Promise<IStorageListResult> {\n await this.ensureTable();\n\n try {\n const limit = params.limit || 100;\n\n const query = this.knex<AuditLogRow>(this.tableManager.resolve(TABLE_NAME)).where(\n \"tenant\",\n params.tenant\n );\n\n if (params.app) {\n query.andWhere(\"app\", params.app);\n }\n\n if (params.entity) {\n query.andWhere(\"entity\", params.entity);\n }\n\n if (params.action) {\n query.andWhere(\"action\", params.action);\n }\n\n if (params.entityId) {\n /* Match by entity type prefix — strip the record ID after #. */\n const entityPrefix = params.entityId.split(\"#\")[0];\n query.andWhere(\"entityId\", \"LIKE\", `${entityPrefix}%`);\n }\n\n if (params.createdBy) {\n query.andWhere(\"createdBy\", \"LIKE\", `%\"id\":\"${params.createdBy}\"%`);\n }\n\n if (\"createdOn_gte\" in params && params.createdOn_gte) {\n query.andWhere(\"createdOn\", \">=\", params.createdOn_gte.toISOString());\n }\n\n if (\"createdOn_lte\" in params && params.createdOn_lte) {\n query.andWhere(\"createdOn\", \"<=\", params.createdOn_lte.toISOString());\n }\n\n const sortDirection = params.sort === \"DESC\" ? \"desc\" : \"asc\";\n\n query.orderBy(\"createdOn\", sortDirection);\n\n // Fetch one extra row to detect if there are more items.\n query.limit(limit + 1);\n\n if (params.after) {\n const afterRow = await this.knex<AuditLogRow>(this.tableManager.resolve(TABLE_NAME))\n .where(\"id\", params.after)\n .first();\n\n if (afterRow) {\n if (sortDirection === \"asc\") {\n query.andWhere(\"createdOn\", \">\", afterRow.createdOn);\n } else {\n query.andWhere(\"createdOn\", \"<\", afterRow.createdOn);\n }\n }\n }\n\n const rows = await query;\n\n const hasMoreItems = rows.length > limit;\n\n if (hasMoreItems) {\n rows.pop();\n }\n\n const data = rows.map(fromRow);\n\n const lastItem = data[data.length - 1];\n const after = hasMoreItems && lastItem ? lastItem.id : undefined;\n\n return {\n data,\n meta: {\n after,\n hasMoreItems\n },\n success: true\n };\n } catch (error) {\n return {\n error: error as Error,\n success: false\n };\n }\n }\n}\n"],"names":["TABLE_NAME","toRow","data","JSON","fromRow","row","Date","SqliteStorage","params","table","Error","auditLog","error","existing","limit","query","entityPrefix","sortDirection","afterRow","rows","hasMoreItems","lastItem","after","undefined"],"mappings":"AA4BA,MAAMA,aAAa;AAGnB,MAAMC,QAAQ,CAACC,OACJ;QACH,IAAIA,KAAK,EAAE;QACX,QAAQA,KAAK,MAAM;QACnB,WAAWC,KAAK,SAAS,CAACD,KAAK,SAAS;QACxC,WAAWA,KAAK,SAAS,CAAC,WAAW;QACrC,KAAKA,KAAK,GAAG;QACb,QAAQA,KAAK,MAAM;QACnB,SAASA,KAAK,OAAO;QACrB,QAAQA,KAAK,MAAM;QACnB,UAAUA,KAAK,QAAQ;QACvB,MAAMC,KAAK,SAAS,CAACD,KAAK,IAAI;QAC9B,WAAWA,KAAK,SAAS,CAAC,WAAW;QACrC,SAASA,KAAK,OAAO;IACzB;AAIJ,MAAME,UAAU,CAACC,MACN;QACH,IAAIA,IAAI,EAAE;QACV,QAAQA,IAAI,MAAM;QAClB,WAAWF,KAAK,KAAK,CAACE,IAAI,SAAS;QACnC,WAAW,IAAIC,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K,MAAM,GAAG,EAAE;YACtC,MAAMoB,QAAQF,gBAAgBC,WAAWA,SAAS,EAAE,GAAGE;YAEvD,OAAO;gBACHrB;gBACA,MAAM;oBACFoB;oBACAF;gBACJ;gBACA,SAAS;YACb;QACJ,EAAE,OAAOR,OAAO;YACZ,OAAO;gBACH,OAAOA;gBACP,SAAS;YACb;QACJ;IACJ;AACJ"}
|
|
1
|
+
{"version":3,"file":"SqliteStorage.js","sources":["../src/SqliteStorage.ts"],"sourcesContent":["import type { Knex } from \"knex\";\nimport type { ScopeTenant } from \"@webiny/api-core/features/tenancy/ScopeTenant/index.js\";\nimport type { TableManager } from \"@webiny/api-core-sql/TableManager.js\";\nimport type { IAuditLog, IAuditLogCreatedBy } from \"@webiny/api-audit-logs/storage/types.js\";\nimport type {\n IStorage,\n IStorageFetchParams,\n IStorageFetchResult,\n IStorageStoreParams,\n IStorageStoreResult,\n IStorageListParams,\n IStorageListResult\n} from \"@webiny/api-audit-logs/storage/abstractions/Storage.js\";\n\ninterface AuditLogRow {\n id: string;\n tenant: string;\n createdBy: string;\n createdOn: string;\n app: string;\n action: string;\n message: string;\n entity: string;\n entityId: string;\n tags: string;\n expiresAt: string;\n content: string;\n}\n\nconst TABLE_NAME = \"webiny_audit_logs\";\n\n/* Convert an IAuditLog to a flat database row. */\nconst toRow = (data: IAuditLog): AuditLogRow => {\n return {\n id: data.id,\n tenant: data.tenant,\n createdBy: JSON.stringify(data.createdBy),\n createdOn: data.createdOn.toISOString(),\n app: data.app,\n action: data.action,\n message: data.message,\n entity: data.entity,\n entityId: data.entityId,\n tags: JSON.stringify(data.tags),\n expiresAt: data.expiresAt.toISOString(),\n content: data.content\n };\n};\n\n/* Convert a database row back to an IAuditLog. */\nconst fromRow = (row: AuditLogRow): IAuditLog => {\n return {\n id: row.id,\n tenant: row.tenant,\n createdBy: JSON.parse(row.createdBy) as IAuditLogCreatedBy,\n createdOn: new Date(row.createdOn),\n app: row.app,\n action: row.action,\n message: row.message,\n entity: row.entity,\n entityId: row.entityId,\n tags: JSON.parse(row.tags) as string[],\n expiresAt: new Date(row.expiresAt),\n content: row.content\n };\n};\n\nexport class SqliteStorage implements IStorage {\n private readonly knex: Knex;\n private readonly tableManager: TableManager;\n private readonly ensureTable: () => Promise<void>;\n private readonly scopeTenant: ScopeTenant.Interface;\n\n public constructor(params: {\n knex: Knex;\n tableManager: TableManager;\n /** The tenant the storage acts on: its tenant scope's. The schema setup runs without one. */\n scopeTenant: ScopeTenant.Interface;\n }) {\n this.knex = params.knex;\n this.tableManager = params.tableManager;\n this.scopeTenant = params.scopeTenant;\n this.ensureTable = params.tableManager.define(TABLE_NAME, table => {\n table.text(\"id\").primary();\n table.text(\"tenant\").notNullable();\n table.text(\"createdBy\").notNullable();\n table.datetime(\"createdOn\").notNullable();\n table.text(\"app\").notNullable();\n table.text(\"action\").notNullable();\n table.text(\"message\").notNullable();\n table.text(\"entity\").notNullable();\n table.text(\"entityId\").notNullable();\n table.text(\"tags\").notNullable();\n table.datetime(\"expiresAt\").notNullable();\n table.text(\"content\").notNullable();\n });\n }\n\n public async fetch(params: IStorageFetchParams): Promise<IStorageFetchResult> {\n await this.ensureTable();\n\n try {\n const row = await this.knex<AuditLogRow>(this.tableManager.resolve(TABLE_NAME))\n .where(\"id\", params.id)\n .andWhere(\"tenant\", this.scopeTenant.getId())\n .first();\n\n if (!row) {\n return {\n error: new Error(`Audit log with id \"${params.id}\" not found.`),\n success: false\n };\n }\n\n const auditLog = fromRow(row);\n\n return {\n data: auditLog,\n success: true\n };\n } catch (error) {\n return {\n error: error as Error,\n success: false\n };\n }\n }\n\n public async store(params: IStorageStoreParams): Promise<IStorageStoreResult> {\n await this.ensureTable();\n\n try {\n // Stored with its scope's tenant, whatever tenant it carries.\n const tenant = this.scopeTenant.getId();\n const row = toRow({ ...params.data, tenant });\n\n const existing = await this.knex<AuditLogRow>(this.tableManager.resolve(TABLE_NAME))\n .where(\"id\", params.data.id)\n .andWhere(\"tenant\", tenant)\n .first();\n\n if (existing) {\n await this.knex<AuditLogRow>(this.tableManager.resolve(TABLE_NAME))\n .where(\"id\", params.data.id)\n .andWhere(\"tenant\", tenant)\n .update(row);\n } else {\n await this.knex<AuditLogRow>(this.tableManager.resolve(TABLE_NAME)).insert(row);\n }\n\n return {\n data: { ...params.data, tenant },\n success: true\n };\n } catch (error) {\n return {\n error: error as Error,\n success: false\n };\n }\n }\n\n public async list(params: IStorageListParams): Promise<IStorageListResult> {\n await this.ensureTable();\n\n try {\n const limit = params.limit || 100;\n\n const query = this.knex<AuditLogRow>(this.tableManager.resolve(TABLE_NAME)).where(\n \"tenant\",\n this.scopeTenant.getId()\n );\n\n if (params.app) {\n query.andWhere(\"app\", params.app);\n }\n\n if (params.entity) {\n query.andWhere(\"entity\", params.entity);\n }\n\n if (params.action) {\n query.andWhere(\"action\", params.action);\n }\n\n if (params.entityId) {\n /* Match by entity type prefix — strip the record ID after #. */\n const entityPrefix = params.entityId.split(\"#\")[0];\n query.andWhere(\"entityId\", \"LIKE\", `${entityPrefix}%`);\n }\n\n if (params.createdBy) {\n query.andWhere(\"createdBy\", \"LIKE\", `%\"id\":\"${params.createdBy}\"%`);\n }\n\n if (\"createdOn_gte\" in params && params.createdOn_gte) {\n query.andWhere(\"createdOn\", \">=\", params.createdOn_gte.toISOString());\n }\n\n if (\"createdOn_lte\" in params && params.createdOn_lte) {\n query.andWhere(\"createdOn\", \"<=\", params.createdOn_lte.toISOString());\n }\n\n const sortDirection = params.sort === \"DESC\" ? \"desc\" : \"asc\";\n\n query.orderBy(\"createdOn\", sortDirection);\n\n // Fetch one extra row to detect if there are more items.\n query.limit(limit + 1);\n\n if (params.after) {\n const afterRow = await this.knex<AuditLogRow>(this.tableManager.resolve(TABLE_NAME))\n .where(\"id\", params.after)\n .first();\n\n if (afterRow) {\n if (sortDirection === \"asc\") {\n query.andWhere(\"createdOn\", \">\", afterRow.createdOn);\n } else {\n query.andWhere(\"createdOn\", \"<\", afterRow.createdOn);\n }\n }\n }\n\n const rows = await query;\n\n const hasMoreItems = rows.length > limit;\n\n if (hasMoreItems) {\n rows.pop();\n }\n\n const data = rows.map(fromRow);\n\n const lastItem = data[data.length - 1];\n const after = hasMoreItems && lastItem ? lastItem.id : undefined;\n\n return {\n data,\n meta: {\n after,\n hasMoreItems\n },\n success: true\n };\n } catch (error) {\n return {\n error: error as Error,\n success: false\n };\n }\n }\n}\n"],"names":["TABLE_NAME","toRow","data","JSON","fromRow","row","Date","SqliteStorage","params","table","Error","auditLog","error","tenant","existing","limit","query","entityPrefix","sortDirection","afterRow","rows","hasMoreItems","lastItem","after","undefined"],"mappings":"AA6BA,MAAMA,aAAa;AAGnB,MAAMC,QAAQ,CAACC,OACJ;QACH,IAAIA,KAAK,EAAE;QACX,QAAQA,KAAK,MAAM;QACnB,WAAWC,KAAK,SAAS,CAACD,KAAK,SAAS;QACxC,WAAWA,KAAK,SAAS,CAAC,WAAW;QACrC,KAAKA,KAAK,GAAG;QACb,QAAQA,KAAK,MAAM;QACnB,SAASA,KAAK,OAAO;QACrB,QAAQA,KAAK,MAAM;QACnB,UAAUA,KAAK,QAAQ;QACvB,MAAMC,KAAK,SAAS,CAACD,KAAK,IAAI;QAC9B,WAAWA,KAAK,SAAS,CAAC,WAAW;QACrC,SAASA,KAAK,OAAO;IACzB;AAIJ,MAAME,UAAU,CAACC,MACN;QACH,IAAIA,IAAI,EAAE;QACV,QAAQA,IAAI,MAAM;QAClB,WAAWF,KAAK,KAAK,CAACE,IAAI,SAAS;QACnC,WAAW,IAAIC,KAAKD,IAAI,SAAS;QACjC,KAAKA,IAAI,GAAG;QACZ,QAAQA,IAAI,MAAM;QAClB,SAASA,IAAI,OAAO;QACpB,QAAQA,IAAI,MAAM;QAClB,UAAUA,IAAI,QAAQ;QACtB,MAAMF,KAAK,KAAK,CAACE,IAAI,IAAI;QACzB,WAAW,IAAIC,KAAKD,IAAI,SAAS;QACjC,SAASA,IAAI,OAAO;IACxB;AAGG,MAAME;IAMT,YAAmBC,MAKlB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gBAAgBC,WAAWA,SAAS,EAAE,GAAGE;YAEvD,OAAO;gBACHtB;gBACA,MAAM;oBACFqB;oBACAF;gBACJ;gBACA,SAAS;YACb;QACJ,EAAE,OAAOT,OAAO;YACZ,OAAO;gBACH,OAAOA;gBACP,SAAS;YACb;QACJ;IACJ;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-audit-logs-sql",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.48a4e5b6c1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@webiny/api-audit-logs",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"./*": "./*"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@webiny/api-audit-logs": "0.0.0-unstable.
|
|
24
|
-
"@webiny/api-core
|
|
25
|
-
"@webiny/
|
|
26
|
-
"@webiny/
|
|
23
|
+
"@webiny/api-audit-logs": "0.0.0-unstable.48a4e5b6c1",
|
|
24
|
+
"@webiny/api-core": "0.0.0-unstable.48a4e5b6c1",
|
|
25
|
+
"@webiny/api-core-sql": "0.0.0-unstable.48a4e5b6c1",
|
|
26
|
+
"@webiny/feature": "0.0.0-unstable.48a4e5b6c1",
|
|
27
|
+
"@webiny/handler": "0.0.0-unstable.48a4e5b6c1",
|
|
27
28
|
"knex": "3.3.0"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
|
-
"@webiny/
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"rimraf": "6.1.3",
|
|
31
|
+
"@webiny/build-tools": "0.0.0-unstable.48a4e5b6c1",
|
|
32
|
+
"better-sqlite3": "13.2.0",
|
|
33
|
+
"rimraf": "6.1.4",
|
|
34
34
|
"typescript": "7.0.2"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|