From 343f20b978619803252429670901ef0d0d5a8bca Mon Sep 17 00:00:00 2001 From: XingY Date: Sun, 11 May 2025 22:07:40 -0700 Subject: [PATCH 1/4] Add detailed auditing of domain changes & comment ability --- CHANGELOG.md | 3 +++ package-lock.json | 4 ++-- package.json | 2 +- src/labkey/Domain.ts | 5 +++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5935136..f0f6965c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 1.40.X - 2025-X +- Add `auditUserComment` to `Domain.drop` and `Domain.save` + ### 1.40.0 - 2025-04-21 - Package updates diff --git a/package-lock.json b/package-lock.json index bc56a77c..aa82ab73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@labkey/api", - "version": "1.40.0", + "version": "1.40.1-fb-domainAudit.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@labkey/api", - "version": "1.40.0", + "version": "1.40.1-fb-domainAudit.1", "license": "Apache-2.0", "devDependencies": { "@babel/core": "7.26.10", diff --git a/package.json b/package.json index 39f904c3..d84c58b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@labkey/api", - "version": "1.40.0", + "version": "1.40.1-fb-domainAudit.2", "description": "JavaScript client API for LabKey Server", "scripts": { "build": "npm run build:dist && npm run build:docs", diff --git a/src/labkey/Domain.ts b/src/labkey/Domain.ts index fb49bfb0..afc16486 100644 --- a/src/labkey/Domain.ts +++ b/src/labkey/Domain.ts @@ -215,6 +215,7 @@ export interface DropDomainOptions extends RequestCallbackOptions { queryName: string; /** The domain schema name. */ schemaName: string; + auditUserComment?: string; } /** @@ -230,6 +231,7 @@ export function drop(config: DropDomainOptions): XMLHttpRequest { domainDesign: config.domainDesign, schemaName: config.schemaName, queryName: config.queryName, + auditUserComment: config.auditUserComment }, }); } @@ -370,6 +372,7 @@ export interface SaveDomainOptions extends RequestCallbackOptions { queryName?: string; /** Name of the schema. */ schemaName?: string; + auditUserComment?: string; } /** @@ -387,6 +390,7 @@ export function save(config: SaveDomainOptions): XMLHttpRequest { containerPath: arguments[5], includeWarnings: arguments[6], options: arguments[7], + auditUserComment: arguments[8], } : config; @@ -401,6 +405,7 @@ export function save(config: SaveDomainOptions): XMLHttpRequest { queryName: options.queryName, domainId: options.domainId, includeWarnings: options.includeWarnings, + auditUserComment: options.auditUserComment, options: options.options, }, }); From 103caceb28f7b5dbd2afc6246324f6e7a0268ea8 Mon Sep 17 00:00:00 2001 From: XingY Date: Wed, 14 May 2025 09:26:25 -0700 Subject: [PATCH 2/4] add comment --- src/labkey/Domain.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/labkey/Domain.ts b/src/labkey/Domain.ts index afc16486..c5944792 100644 --- a/src/labkey/Domain.ts +++ b/src/labkey/Domain.ts @@ -215,6 +215,7 @@ export interface DropDomainOptions extends RequestCallbackOptions { queryName: string; /** The domain schema name. */ schemaName: string; + /** Can be used to provide a comment from the user that will be attached to domain audit event. */ auditUserComment?: string; } @@ -372,6 +373,7 @@ export interface SaveDomainOptions extends RequestCallbackOptions { queryName?: string; /** Name of the schema. */ schemaName?: string; + /** Can be used to provide a comment from the user that will be attached to domain audit event. */ auditUserComment?: string; } From 466f0aa379483c35b75f244740708a1d6f477558 Mon Sep 17 00:00:00 2001 From: XingY Date: Wed, 14 May 2025 09:28:43 -0700 Subject: [PATCH 3/4] lint --- src/labkey/Domain.ts | 13 +++++++------ src/labkey/Exp.ts | 2 +- src/labkey/security/Container.ts | 8 ++++---- src/labkey/security/constants.ts | 1 + 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/labkey/Domain.ts b/src/labkey/Domain.ts index c5944792..7efd09fa 100644 --- a/src/labkey/Domain.ts +++ b/src/labkey/Domain.ts @@ -205,18 +205,19 @@ function mapCreateArguments(args: IArguments): CreateDomainOptions { } export interface DropDomainOptions extends RequestCallbackOptions { + /** Can be used to provide a comment from the user that will be attached to domain audit event. */ + auditUserComment?: string; /** * The container path in which the requested Domain is defined. * If not supplied, the current container path will be used. */ containerPath?: string; - domainDesign?: any; // consider removing, this doesn't appear to be needed + // consider removing, this doesn't appear to be needed + domainDesign?: any; /** The domain query name. */ queryName: string; /** The domain schema name. */ schemaName: string; - /** Can be used to provide a comment from the user that will be attached to domain audit event. */ - auditUserComment?: string; } /** @@ -232,7 +233,7 @@ export function drop(config: DropDomainOptions): XMLHttpRequest { domainDesign: config.domainDesign, schemaName: config.schemaName, queryName: config.queryName, - auditUserComment: config.auditUserComment + auditUserComment: config.auditUserComment, }, }); } @@ -349,6 +350,8 @@ export function get(config: GetDomainOptions): XMLHttpRequest { } export interface SaveDomainOptions extends RequestCallbackOptions { + /** Can be used to provide a comment from the user that will be attached to domain audit event. */ + auditUserComment?: string; /** * The container path in which the requested Domain is defined. * If not supplied, the current container path will be used. @@ -373,8 +376,6 @@ export interface SaveDomainOptions extends RequestCallbackOptions { queryName?: string; /** Name of the schema. */ schemaName?: string; - /** Can be used to provide a comment from the user that will be attached to domain audit event. */ - auditUserComment?: string; } /** diff --git a/src/labkey/Exp.ts b/src/labkey/Exp.ts index 63ca47d7..f9e9f28c 100644 --- a/src/labkey/Exp.ts +++ b/src/labkey/Exp.ts @@ -437,7 +437,7 @@ export class Data extends ExpObject { * ["StringColumn", "DateColumn"], * ["Hello", "16 May 2009 17:00:00"], * ["world", "12/21/2008 08:45AM"] - * ] + * ] * },{ * "name": "Sheet2", * "data": [ diff --git a/src/labkey/security/Container.ts b/src/labkey/security/Container.ts index d6938ba4..b2677124 100644 --- a/src/labkey/security/Container.ts +++ b/src/labkey/security/Container.ts @@ -168,6 +168,10 @@ export interface GetContainersOptions extends RequestCallbackOptions /* Date: Thu, 22 May 2025 22:07:53 -0700 Subject: [PATCH 4/4] publish --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index d07c7e88..73abe759 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@labkey/api", - "version": "1.41.0", + "version": "1.41.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@labkey/api", - "version": "1.41.0", + "version": "1.41.1", "license": "Apache-2.0", "devDependencies": { "@babel/core": "7.26.10",