-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
codegen setup fix some some some some more ? ?? SOME? ?? ? fix some? SOME ??? more some some test fix some code review! ? fix some clean! fix codegen path ??? ? ?? ? ? added scope ti auditlogmanager scheme publish & check & delete members role CLEAN MORE target project prettier fix resolver schema published lint fix code review! ? ? prettier migration fix! clean fix filters clean ?? ? resolve user eventTime: e => e.event_time, scalar DateTime user: e => { eventTime clean changes Fix up mapper names and types.next imports fix resolvers :) clean all lint clean sentry fix some code review more and more Support && Laboratory Collection CRUD query in collection User role org and target fix code review resolvers again! prettier clean revert `inviteToOrganizationByEmail` revert `updateSchemaPolicyForProject` user invite action for clickhouse remove `await` from schema fix code review lint graphql comments schema + app deployment fix some clean and clear some and some basic test fix fix rebase and conflicts fix error fix code review ? some some fixes
- Loading branch information
1 parent
a5eb78a
commit bd3caff
Showing
109 changed files
with
3,348 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { graphql } from 'testkit/gql'; | ||
import { execute } from '../../../testkit/graphql'; | ||
import { initSeed } from '../../../testkit/seed'; | ||
|
||
describe('Audit Logs Creation', () => { | ||
describe('Organization', () => { | ||
const query = graphql(` | ||
query MyQuery($selector: OrganizationSelectorInput!) { | ||
auditLogs(selector: $selector) { | ||
nodes { | ||
eventTime | ||
id | ||
__typename | ||
} | ||
} | ||
} | ||
`); | ||
test.concurrent( | ||
'Should be only one audit log for organization creation', | ||
async ({ expect }) => { | ||
const { ownerToken, createOrg } = await initSeed().createOwner(); | ||
const { organization } = await createOrg(); | ||
|
||
const result = await execute({ | ||
document: query, | ||
variables: { | ||
selector: { | ||
organization: organization.id, | ||
}, | ||
}, | ||
authToken: ownerToken, | ||
}); | ||
expect(result.rawBody.data?.auditLogs.nodes).not.toBeNull(); | ||
expect(result.rawBody.data?.auditLogs.nodes.length).toBeGreaterThan(0); | ||
expect(result.rawBody.data?.auditLogs.nodes[0].__typename).toBe( | ||
'OrganizationCreatedAuditLog', | ||
); | ||
}, | ||
); | ||
}); | ||
}); |
20 changes: 20 additions & 0 deletions
20
packages/migrations/src/clickhouse-actions/011-audit-logs.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { Action } from '../clickhouse'; | ||
|
||
export const action: Action = async exec => { | ||
await exec(` | ||
CREATE TABLE IF NOT EXISTS "audit_log" | ||
( | ||
"id" UUID DEFAULT generateUUIDv4() CODEC(ZSTD(1)), | ||
"event_time" DateTime CODEC(ZSTD(1)), | ||
"user_id" String CODEC(ZSTD(1)), | ||
"user_email" String CODEC(ZSTD(1)), | ||
"organization_id" String CODEC(ZSTD(1)), | ||
"event_action" String CODEC(ZSTD(1)), | ||
"metadata" String CODEC(ZSTD(1)) | ||
) | ||
ENGINE = ReplacingMergeTree | ||
ORDER BY ("event_time", "user_id", "organization_id") | ||
TTL event_time + INTERVAL 1 YEAR | ||
SETTINGS index_granularity = 8192 | ||
`); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...ages/services/api/src/modules/app-deployments/resolvers/Mutation/activateAppDeployment.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/services/api/src/modules/app-deployments/resolvers/Mutation/createAppDeployment.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/services/api/src/modules/app-deployments/resolvers/Mutation/retireAppDeployment.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { createModule } from 'graphql-modules'; | ||
import { ClickHouse } from '../operations/providers/clickhouse-client'; | ||
import { AuditLogManager } from './providers/audit-logs-manager'; | ||
import { resolvers } from './resolvers.generated'; | ||
import { typeDefs } from './module.graphql'; | ||
|
||
export const auditLogsModule = createModule({ | ||
id: 'audit-logs', | ||
dirname: __dirname, | ||
typeDefs, | ||
resolvers, | ||
providers: [AuditLogManager, ClickHouse], | ||
}); |
52 changes: 52 additions & 0 deletions
52
packages/services/api/src/modules/audit-logs/module.graphql.mappers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { AuditLogModel } from './providers/audit-logs-manager'; | ||
|
||
export type AuditLogMapper = AuditLogModel; | ||
// Schema | ||
export type SchemaPolicySettingsUpdatedAuditLogMapper = AuditLogModel; | ||
export type SchemaCheckedAuditLogMapper = AuditLogModel; | ||
export type SchemaPublishAuditLogMapper = AuditLogModel; | ||
export type ServiceDeletedAuditLogMapper = AuditLogModel; | ||
// Organization | ||
export type OrganizationSettingsUpdatedAuditLogMapper = AuditLogModel; | ||
export type OrganizationTransferredAuditLogMapper = AuditLogModel; | ||
export type OrganizationTransferredRequestAuditLogMapper = AuditLogModel; | ||
export type OrganizationCreatedAuditLogMapper = AuditLogModel; | ||
export type OrganizationDeletedAuditLogMapper = AuditLogModel; | ||
export type OrganizationUpdatedIntegrationAuditLogMapper = AuditLogModel; | ||
// Project | ||
export type ProjectCreatedAuditLogMapper = AuditLogModel; | ||
export type ProjectSettingsUpdatedAuditLogMapper = AuditLogModel; | ||
export type ProjectDeletedAuditLogMapper = AuditLogModel; | ||
// User Role | ||
export type RoleCreatedAuditLogMapper = AuditLogModel; | ||
export type RoleAssignedAuditLogMapper = AuditLogModel; | ||
export type RoleDeletedAuditLogMapper = AuditLogModel; | ||
export type RoleUpdatedAuditLogMapper = AuditLogModel; | ||
// Support | ||
export type SupportTicketCreatedAuditLogMapper = AuditLogModel; | ||
export type SupportTicketUpdatedAuditLogMapper = AuditLogModel; | ||
// Laboratory Collection | ||
export type CollectionCreatedAuditLogMapper = AuditLogModel; | ||
export type CollectionDeletedAuditLogMapper = AuditLogModel; | ||
export type CollectionUpdatedAuditLogMapper = AuditLogModel; | ||
// Laboratory Collection Operation | ||
export type OperationInDocumentCollectionCreatedAuditLogMapper = AuditLogModel; | ||
export type OperationInDocumentCollectionUpdatedAuditLogMapper = AuditLogModel; | ||
export type OperationInDocumentCollectionDeletedAuditLogMapper = AuditLogModel; | ||
// User | ||
export type UserInvitedAuditLogMapper = AuditLogModel; | ||
export type UserJoinedAuditLogMapper = AuditLogModel; | ||
export type UserRemovedAuditLogMapper = AuditLogModel; | ||
export type UserSettingsUpdatedAuditLogMapper = AuditLogModel; | ||
// Target | ||
export type TargetCreatedAuditLogMapper = AuditLogModel; | ||
export type TargetSettingsUpdatedAuditLogMapper = AuditLogModel; | ||
export type TargetDeletedAuditLogMapper = AuditLogModel; | ||
// Subscription | ||
export type SubscriptionCreatedAuditLogMapper = AuditLogModel; | ||
export type SubscriptionUpdatedAuditLogMapper = AuditLogModel; | ||
export type SubscriptionCanceledAuditLogMapper = AuditLogModel; | ||
// App Deployment | ||
export type AppDeploymentCreatedAuditLogMapper = AuditLogModel; | ||
export type AppDeploymentUpdatedAuditLogMapper = AuditLogModel; | ||
export type AppDeploymentPublishedAuditLogMapper = AuditLogModel; |
Oops, something went wrong.