diff --git a/CHANGELOG.md b/CHANGELOG.md index a63ac1aa..c2c5f3f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 1.43.2 - 2025-11-02 +- Command and QueryRequestOptions: add auditDetails parameter + ### 1.43.1 - 2025-10-31 - Issue 53449: resolve lineage items from container path diff --git a/package-lock.json b/package-lock.json index b8244738..169ef1b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@labkey/api", - "version": "1.43.1", + "version": "1.43.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@labkey/api", - "version": "1.43.1", + "version": "1.43.2", "license": "Apache-2.0", "devDependencies": { "@babel/core": "7.27.4", diff --git a/package.json b/package.json index eefcb091..f3cf582c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@labkey/api", - "version": "1.43.1", + "version": "1.43.2", "description": "JavaScript client API for LabKey Server", "scripts": { "build": "npm run build:dist && npm run build:docs", diff --git a/src/labkey/dom/Assay.ts b/src/labkey/dom/Assay.ts index d7d26122..6bed7faf 100644 --- a/src/labkey/dom/Assay.ts +++ b/src/labkey/dom/Assay.ts @@ -43,6 +43,7 @@ export interface ImportRunOptions extends RequestCallbackOptions { allowLookupByAlternateKey?: boolean; assayId?: number | string; auditUserComment?: string; + auditDetails?: Record; batchId?: number | string; batchProperties?: Record; comment?: string; @@ -136,6 +137,9 @@ export function importRun(options: ImportRunOptions): XMLHttpRequest { if (options.auditUserComment !== undefined) { formData.append('auditUserComment', options.auditUserComment); } + if (options.auditDetails !== undefined) { + formData.append('auditDetails', JSON.stringify(options.auditDetails)); + } appendProperties('batchProperties', formData, options.batchProperties); appendProperties('properties', formData, options.properties); diff --git a/src/labkey/dom/Query.ts b/src/labkey/dom/Query.ts index 534db722..7d131f7f 100644 --- a/src/labkey/dom/Query.ts +++ b/src/labkey/dom/Query.ts @@ -95,6 +95,7 @@ export function exportTables(options: IExportTablesOptions): void { } export interface IImportDataOptions { + auditDetails?: Record; auditUserComment?: string; containerPath?: string; failure?: Function; @@ -161,6 +162,9 @@ export function importData(options: IImportDataOptions): XMLHttpRequest { if (options.auditUserComment !== undefined) { form.append('auditUserComment', options.auditUserComment); } + if (options.auditDetails !== undefined) { + form.append('auditDetails', JSON.stringify(options.auditDetails)); + } if (options.file) { if (options.file instanceof File) { diff --git a/src/labkey/query/Rows.ts b/src/labkey/query/Rows.ts index b0d16d0b..e5465685 100644 --- a/src/labkey/query/Rows.ts +++ b/src/labkey/query/Rows.ts @@ -22,6 +22,8 @@ export interface QueryRequestOptions extends RequestCallbackOptions { apiVersion?: number | string; /** Can be used to override the audit behavior for the table the query is acting on. See {@link AuditBehaviorTypes}. */ auditBehavior?: AuditBehaviorTypes; + /** Optional audit details to record in the transaction audit log for this command. */ + auditDetails?: Record; /** Can be used to provide a comment from the user that will be attached to certain detailed audit log records. */ auditUserComment?: string; /** @@ -213,6 +215,10 @@ export interface ModifyRowsResults { export interface Command { /** Can be used to override the audit behavior for the table the Command is acting on. See{@link AuditBehaviorTypes}. */ auditBehavior?: AuditBehaviorTypes; + + /** Optional audit details to record in the transaction audit log for this command. */ + auditDetails?: Record; + /** Can be used to provide a comment from the user that will be attached to certain detailed audit log records. */ auditUserComment?: string; /** Name of the command to be performed. Must be one of "insert", "update", or "delete". */ @@ -267,6 +273,11 @@ export interface SaveRowsResponse { } export interface SaveRowsOptions extends RequestCallbackOptions { + + /** + * Optional audit details to record in the transaction audit log for this command. + */ + auditDetails?: Record; /** * Version of the API. If this is 13.2 or higher, a request that fails * validation will be returned as a successful response. Use the 'errorCount' and 'committed' properties in the @@ -364,6 +375,7 @@ export function saveRows(options: SaveRowsOptions): XMLHttpRequest { // options = queryArguments(arguments); // } const jsonData = { + auditDetails: options.auditDetails, apiVersion: options.apiVersion, commands: options.commands, containerPath: options.containerPath, @@ -449,6 +461,7 @@ function sendRequest(options: SendRequestOptions, supportsFiles?: boolean): XMLH transacted: options.transacted, extraContext: options.extraContext, auditBehavior: options.auditBehavior, + auditDetails: options.auditDetails, auditUserComment: options.auditUserComment, skipReselectRows: options.skipReselectRows, }; @@ -517,6 +530,7 @@ export function moveRows(options: MoveRowsOptions): XMLHttpRequest { queryName: options.queryName, rows: options.rows, auditBehavior: options.auditBehavior, + auditDetails: options.auditDetails, auditUserComment: options.auditUserComment, dataRegionSelectionKey: options.dataRegionSelectionKey, useSnapshotSelection: options.useSnapshotSelection,