@webiny/api-audit-logs 6.6.0-alpha.4 → 6.6.0-alpha.6
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/AuditLogsFeature.js +1 -1
- package/AuditLogsFeature.js.map +1 -1
- package/package.json +20 -20
package/AuditLogsFeature.js
CHANGED
package/AuditLogsFeature.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuditLogsFeature.js","sources":["../src/AuditLogsFeature.ts"],"sourcesContent":["import { createFeature, type Container } from \"@webiny/feature/api\";\nimport { GraphQLContextualSchema } from \"@webiny/api-graphql\";\nimport { makeExecutableSchema } from \"@graphql-tools/schema\";\nimport { EventPublisher } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport { FeatureFlags } from \"@webiny/api-core/features/featureFlags/abstractions.js\";\nimport { AuditLogsContext, AuditLogsStorage } from \"./abstractions.js\";\nimport type { GraphQLSchema } from \"graphql\";\nimport { createAuditLogsContextValue } from \"./context/AuditLogsContextValue.js\";\nimport { createSubscriptionHooks } from \"./subscriptions/index.js\";\nimport { AuditLogsGraphQLSchema } from \"./graphql/AuditLogsGraphQLSchema.js\";\n\nexport interface AuditLogsFeatureConfig {\n deleteLogsAfterDays?: number;\n}\n\nconst getDeleteLogsAfterDays = (days?: number): number => {\n return days && days > 0 ? days : 60;\n};\n\nexport const AuditLogsFeature = createFeature({\n name: \"AuditLogs\",\n register(container: Container, config: AuditLogsFeatureConfig = {}) {\n // Audit logs are license-gated — check at register time (license is fresh pre-register) so\n // nothing wires up without the entitlement.\n if (!container.resolve(FeatureFlags).get().isEnabled(\"auditLogs\")) {\n return;\n }\n\n container.register(AuditLogsGraphQLSchema);\n\n let initialized = false;\n\n const STUB_SCHEMA: GraphQLSchema = makeExecutableSchema({\n typeDefs: \"type Query\\ntype Mutation\",\n assumeValidSDL: true\n });\n\n container.registerInstance(GraphQLContextualSchema, {\n async build(ctx: Record<string, any>): Promise<GraphQLSchema> {\n if (initialized) {\n return STUB_SCHEMA;\n }\n initialized = true;\n\n const storage = container.resolve(AuditLogsStorage);\n const eventPublisher = container.resolve(EventPublisher);\n\n ctx.auditLogs = createAuditLogsContextValue({\n getContext: () => ctx as any,\n deleteLogsAfterDays: getDeleteLogsAfterDays(config.deleteLogsAfterDays),\n storage,\n eventPublisher\n });\n\n container.registerInstance(AuditLogsContext, ctx.
|
|
1
|
+
{"version":3,"file":"AuditLogsFeature.js","sources":["../src/AuditLogsFeature.ts"],"sourcesContent":["import { createFeature, type Container } from \"@webiny/feature/api\";\nimport { GraphQLContextualSchema } from \"@webiny/api-graphql\";\nimport { makeExecutableSchema } from \"@graphql-tools/schema\";\nimport { EventPublisher } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport { FeatureFlags } from \"@webiny/api-core/features/featureFlags/abstractions.js\";\nimport { AuditLogsContext, AuditLogsStorage } from \"./abstractions.js\";\nimport type { GraphQLSchema } from \"graphql\";\nimport { createAuditLogsContextValue } from \"./context/AuditLogsContextValue.js\";\nimport { createSubscriptionHooks } from \"./subscriptions/index.js\";\nimport { AuditLogsGraphQLSchema } from \"./graphql/AuditLogsGraphQLSchema.js\";\n\nexport interface AuditLogsFeatureConfig {\n deleteLogsAfterDays?: number;\n}\n\nconst getDeleteLogsAfterDays = (days?: number): number => {\n return days && days > 0 ? days : 60;\n};\n\nexport const AuditLogsFeature = createFeature({\n name: \"AuditLogs\",\n register(container: Container, config: AuditLogsFeatureConfig = {}) {\n // Audit logs are license-gated — check at register time (license is fresh pre-register) so\n // nothing wires up without the entitlement.\n if (!container.resolve(FeatureFlags).get().isEnabled(\"auditLogs\")) {\n return;\n }\n\n container.register(AuditLogsGraphQLSchema);\n\n let initialized = false;\n\n const STUB_SCHEMA: GraphQLSchema = makeExecutableSchema({\n typeDefs: \"type Query\\ntype Mutation\",\n assumeValidSDL: true\n });\n\n container.registerInstance(GraphQLContextualSchema, {\n async build(ctx: Record<string, any>): Promise<GraphQLSchema> {\n if (initialized) {\n return STUB_SCHEMA;\n }\n initialized = true;\n\n const storage = container.resolve(AuditLogsStorage);\n const eventPublisher = container.resolve(EventPublisher);\n\n ctx.auditLogs = createAuditLogsContextValue({\n getContext: () => ctx as any,\n deleteLogsAfterDays: getDeleteLogsAfterDays(config.deleteLogsAfterDays),\n storage,\n eventPublisher\n });\n\n // Handlers read `.auditLogs` and `.container` off this token, so it has to be the\n // whole request context, not the `auditLogs` value on it.\n container.registerInstance(AuditLogsContext, ctx as AuditLogsContext.Interface);\n createSubscriptionHooks(ctx as any);\n\n return STUB_SCHEMA;\n }\n });\n }\n});\n"],"names":["getDeleteLogsAfterDays","days","AuditLogsFeature","createFeature","container","config","FeatureFlags","AuditLogsGraphQLSchema","initialized","STUB_SCHEMA","makeExecutableSchema","GraphQLContextualSchema","ctx","storage","AuditLogsStorage","eventPublisher","EventPublisher","createAuditLogsContextValue","AuditLogsContext","createSubscriptionHooks"],"mappings":";;;;;;;;;AAeA,MAAMA,yBAAyB,CAACC,OACrBA,QAAQA,OAAO,IAAIA,OAAO;AAG9B,MAAMC,mBAAmBC,cAAc;IAC1C,MAAM;IACN,UAASC,SAAoB,EAAEC,SAAiC,CAAC,CAAC;QAG9D,IAAI,CAACD,UAAU,OAAO,CAACE,cAAc,GAAG,GAAG,SAAS,CAAC,cACjD;QAGJF,UAAU,QAAQ,CAACG;QAEnB,IAAIC,cAAc;QAElB,MAAMC,cAA6BC,qBAAqB;YACpD,UAAU;YACV,gBAAgB;QACpB;QAEAN,UAAU,gBAAgB,CAACO,yBAAyB;YAChD,MAAM,OAAMC,GAAwB;gBAChC,IAAIJ,aACA,OAAOC;gBAEXD,cAAc;gBAEd,MAAMK,UAAUT,UAAU,OAAO,CAACU;gBAClC,MAAMC,iBAAiBX,UAAU,OAAO,CAACY;gBAEzCJ,IAAI,SAAS,GAAGK,4BAA4B;oBACxC,YAAY,IAAML;oBAClB,qBAAqBZ,uBAAuBK,OAAO,mBAAmB;oBACtEQ;oBACAE;gBACJ;gBAIAX,UAAU,gBAAgB,CAACc,kBAAkBN;gBAC7CO,wBAAwBP;gBAExB,OAAOH;YACX;QACJ;IACJ;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-audit-logs",
|
|
3
|
-
"version": "6.6.0-alpha.
|
|
3
|
+
"version": "6.6.0-alpha.6",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": "./index.js",
|
|
6
6
|
"./*": "./*"
|
|
@@ -22,32 +22,32 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@webiny/api-headless-cms-testing": "6.6.0-alpha.
|
|
26
|
-
"@webiny/db-dynamodb": "6.6.0-alpha.
|
|
25
|
+
"@webiny/api-headless-cms-testing": "6.6.0-alpha.6",
|
|
26
|
+
"@webiny/db-dynamodb": "6.6.0-alpha.6",
|
|
27
27
|
"@webiny/di": "1.1.0",
|
|
28
|
-
"@webiny/event-handler-core": "6.6.0-alpha.
|
|
29
|
-
"@webiny/handler": "6.6.0-alpha.
|
|
30
|
-
"@webiny/plugins": "6.6.0-alpha.
|
|
28
|
+
"@webiny/event-handler-core": "6.6.0-alpha.6",
|
|
29
|
+
"@webiny/handler": "6.6.0-alpha.6",
|
|
30
|
+
"@webiny/plugins": "6.6.0-alpha.6",
|
|
31
31
|
"graphql": "16.14.2",
|
|
32
32
|
"typescript": "7.0.2",
|
|
33
33
|
"vitest": "4.1.11"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@graphql-tools/schema": "10.1.0",
|
|
37
|
-
"@webiny/api": "6.6.0-alpha.
|
|
38
|
-
"@webiny/api-aco": "6.6.0-alpha.
|
|
39
|
-
"@webiny/api-core": "6.6.0-alpha.
|
|
40
|
-
"@webiny/api-file-manager": "6.6.0-alpha.
|
|
41
|
-
"@webiny/api-graphql": "6.6.0-alpha.
|
|
42
|
-
"@webiny/api-headless-cms": "6.6.0-alpha.
|
|
43
|
-
"@webiny/api-mailer": "6.6.0-alpha.
|
|
44
|
-
"@webiny/api-website-builder": "6.6.0-alpha.
|
|
45
|
-
"@webiny/build-tools": "6.6.0-alpha.
|
|
46
|
-
"@webiny/common-audit-logs": "6.6.0-alpha.
|
|
47
|
-
"@webiny/error": "6.6.0-alpha.
|
|
48
|
-
"@webiny/feature": "6.6.0-alpha.
|
|
49
|
-
"@webiny/utils": "6.6.0-alpha.
|
|
50
|
-
"@webiny/wcp": "6.6.0-alpha.
|
|
37
|
+
"@webiny/api": "6.6.0-alpha.6",
|
|
38
|
+
"@webiny/api-aco": "6.6.0-alpha.6",
|
|
39
|
+
"@webiny/api-core": "6.6.0-alpha.6",
|
|
40
|
+
"@webiny/api-file-manager": "6.6.0-alpha.6",
|
|
41
|
+
"@webiny/api-graphql": "6.6.0-alpha.6",
|
|
42
|
+
"@webiny/api-headless-cms": "6.6.0-alpha.6",
|
|
43
|
+
"@webiny/api-mailer": "6.6.0-alpha.6",
|
|
44
|
+
"@webiny/api-website-builder": "6.6.0-alpha.6",
|
|
45
|
+
"@webiny/build-tools": "6.6.0-alpha.6",
|
|
46
|
+
"@webiny/common-audit-logs": "6.6.0-alpha.6",
|
|
47
|
+
"@webiny/error": "6.6.0-alpha.6",
|
|
48
|
+
"@webiny/feature": "6.6.0-alpha.6",
|
|
49
|
+
"@webiny/utils": "6.6.0-alpha.6",
|
|
50
|
+
"@webiny/wcp": "6.6.0-alpha.6",
|
|
51
51
|
"zod": "4.4.3"
|
|
52
52
|
},
|
|
53
53
|
"webiny": {
|