From bc1dad56caa9c00954b847a4455c9d8d36fd85f8 Mon Sep 17 00:00:00 2001 From: abouolia <2197422+abouolia@users.noreply.github.com> Date: Sun, 17 May 2026 19:20:32 +0000 Subject: [PATCH] chore(sdk): update OpenAPI spec and generated types --- shared/sdk-ts/openapi.json | 307 ++++++++++++++++++++++++++++++++++++ shared/sdk-ts/src/schema.ts | 145 +++++++++++++++++ 2 files changed, 452 insertions(+) diff --git a/shared/sdk-ts/openapi.json b/shared/sdk-ts/openapi.json index 51ce6bb5f..0d4a988fe 100644 --- a/shared/sdk-ts/openapi.json +++ b/shared/sdk-ts/openapi.json @@ -23964,6 +23964,166 @@ ] } }, + "/api/audit-logs/filter-options": { + "get": { + "operationId": "AuditLogsController_getAuditLogFilterOptions", + "summary": "Distinct subject and action values for audit log filters.", + "parameters": [ + { + "name": "Authorization", + "in": "header", + "description": "Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.", + "required": true, + "schema": { + "type": "string", + "example": "Bearer bc_1234567890abcdef" + } + }, + { + "name": "organization-id", + "in": "header", + "description": "Required if Authorization is a JWT token. The organization ID to operate within.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAuditLogFilterOptionsResponseDto" + } + } + } + } + }, + "tags": [ + "Audit logs" + ] + } + }, + "/api/audit-logs": { + "get": { + "operationId": "AuditLogsController_getAuditLogs", + "summary": "List financial audit log entries for the tenant.", + "parameters": [ + { + "name": "Authorization", + "in": "header", + "description": "Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.", + "required": true, + "schema": { + "type": "string", + "example": "Bearer bc_1234567890abcdef" + } + }, + { + "name": "organization-id", + "in": "header", + "description": "Required if Authorization is a JWT token. The organization ID to operate within.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "schema": { + "minimum": 1, + "default": 1, + "type": "number" + } + }, + { + "name": "pageSize", + "required": false, + "in": "query", + "schema": { + "minimum": 1, + "maximum": 100, + "default": 20, + "type": "number" + } + }, + { + "name": "subject", + "required": false, + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "a" + } + } + } + }, + { + "name": "action", + "required": false, + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "a" + } + } + } + }, + { + "name": "userId", + "required": false, + "in": "query", + "description": "System user id", + "schema": { + "type": "number" + } + }, + { + "name": "from", + "required": false, + "in": "query", + "description": "ISO date (inclusive), start of day", + "schema": { + "type": "string" + } + }, + { + "name": "to", + "required": false, + "in": "query", + "description": "ISO date (inclusive), end of day", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAuditLogsResponseDto" + } + } + } + } + }, + "tags": [ + "Audit logs" + ] + } + }, "/api/exchange-rates/latest": { "get": { "operationId": "ExchangeRatesController_getLatestExchangeRate", @@ -40071,6 +40231,153 @@ "password" ] }, + "AuditLogFilterOptionDto": { + "type": "object", + "properties": { + "key": { + "type": "string", + "example": "SaleInvoice" + }, + "label": { + "type": "string", + "example": "Sale Invoice" + } + }, + "required": [ + "key", + "label" + ] + }, + "GetAuditLogFilterOptionsResponseDto": { + "type": "object", + "properties": { + "subjects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AuditLogFilterOptionDto" + } + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AuditLogFilterOptionDto" + } + } + }, + "required": [ + "subjects", + "actions" + ] + }, + "AuditLogListItemDto": { + "type": "object", + "properties": { + "id": { + "type": "number", + "example": 1 + }, + "userId": { + "type": "number", + "example": 5, + "nullable": true + }, + "userName": { + "type": "string", + "example": "John Doe", + "nullable": true + }, + "userEmail": { + "type": "string", + "example": "john@example.com", + "nullable": true + }, + "action": { + "type": "string", + "example": "created" + }, + "subject": { + "type": "string", + "example": "sale_invoice" + }, + "subjectId": { + "type": "number", + "example": 42, + "nullable": true + }, + "metadata": { + "type": "object", + "nullable": true, + "example": { + "invoiceNumber": "INV-001" + } + }, + "summary": { + "type": "string", + "example": "Invoice INV-001 was created for $500.00" + }, + "ip": { + "type": "string", + "example": "192.168.1.1", + "nullable": true + }, + "createdAt": { + "type": "string", + "example": "2025-04-12T18:30:00.000Z" + }, + "createdAtFormatted": { + "type": "string", + "example": "Apr 12, 2025 at 06:30 PM" + } + }, + "required": [ + "id", + "action", + "subject", + "summary", + "createdAt", + "createdAtFormatted" + ] + }, + "PaginationMetaDto": { + "type": "object", + "properties": { + "total": { + "type": "number", + "example": 100 + }, + "page": { + "type": "number", + "example": 1 + }, + "pageSize": { + "type": "number", + "example": 20 + } + }, + "required": [ + "total", + "page", + "pageSize" + ] + }, + "GetAuditLogsResponseDto": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AuditLogListItemDto" + } + }, + "pagination": { + "$ref": "#/components/schemas/PaginationMetaDto" + } + }, + "required": [ + "data", + "pagination" + ] + }, "ExchangeRateLatestResponseDto": { "type": "object", "properties": { diff --git a/shared/sdk-ts/src/schema.ts b/shared/sdk-ts/src/schema.ts index ade9e1bcb..2b4ce2908 100644 --- a/shared/sdk-ts/src/schema.ts +++ b/shared/sdk-ts/src/schema.ts @@ -4643,6 +4643,40 @@ export interface paths { patch: operations["ContactsController_inactivateContact"]; trace?: never; }; + "/api/audit-logs/filter-options": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Distinct subject and action values for audit log filters. */ + get: operations["AuditLogsController_getAuditLogFilterOptions"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/audit-logs": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** List financial audit log entries for the tenant. */ + get: operations["AuditLogsController_getAuditLogs"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/api/exchange-rates/latest": { parameters: { query?: never; @@ -14186,6 +14220,58 @@ export interface components { */ password: string; }; + AuditLogFilterOptionDto: { + /** @example SaleInvoice */ + key: string; + /** @example Sale Invoice */ + label: string; + }; + GetAuditLogFilterOptionsResponseDto: { + subjects: components["schemas"]["AuditLogFilterOptionDto"][]; + actions: components["schemas"]["AuditLogFilterOptionDto"][]; + }; + AuditLogListItemDto: { + /** @example 1 */ + id: number; + /** @example 5 */ + userId?: number | null; + /** @example John Doe */ + userName?: string | null; + /** @example john@example.com */ + userEmail?: string | null; + /** @example created */ + action: string; + /** @example sale_invoice */ + subject: string; + /** @example 42 */ + subjectId?: number | null; + /** + * @example { + * "invoiceNumber": "INV-001" + * } + */ + metadata?: Record | null; + /** @example Invoice INV-001 was created for $500.00 */ + summary: string; + /** @example 192.168.1.1 */ + ip?: string | null; + /** @example 2025-04-12T18:30:00.000Z */ + createdAt: string; + /** @example Apr 12, 2025 at 06:30 PM */ + createdAtFormatted: string; + }; + PaginationMetaDto: { + /** @example 100 */ + total: number; + /** @example 1 */ + page: number; + /** @example 20 */ + pageSize: number; + }; + GetAuditLogsResponseDto: { + data: components["schemas"]["AuditLogListItemDto"][]; + pagination: components["schemas"]["PaginationMetaDto"]; + }; ExchangeRateLatestResponseDto: { /** * @description The base currency code @@ -29047,6 +29133,65 @@ export interface operations { }; }; }; + AuditLogsController_getAuditLogFilterOptions: { + parameters: { + query?: never; + header: { + /** @description Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token. */ + Authorization: string; + /** @description Required if Authorization is a JWT token. The organization ID to operate within. */ + "organization-id": string; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["GetAuditLogFilterOptionsResponseDto"]; + }; + }; + }; + }; + AuditLogsController_getAuditLogs: { + parameters: { + query?: { + page?: number; + pageSize?: number; + subject?: Record[][]; + action?: Record[][]; + /** @description System user id */ + userId?: number; + /** @description ISO date (inclusive), start of day */ + from?: string; + /** @description ISO date (inclusive), end of day */ + to?: string; + }; + header: { + /** @description Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token. */ + Authorization: string; + /** @description Required if Authorization is a JWT token. The organization ID to operate within. */ + "organization-id": string; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["GetAuditLogsResponseDto"]; + }; + }; + }; + }; ExchangeRatesController_getLatestExchangeRate: { parameters: { query?: {