From 35c723afe6d5b7a28e57a03807349d7da7ab3cf4 Mon Sep 17 00:00:00 2001 From: Rakesh P R Date: Thu, 27 Aug 2026 01:38:49 +0530 Subject: [PATCH] fix: sync API contract and typed array uploads --- .release-please-manifest.json | 2 +- CHANGELOG.md | 10 + openapi/motifuse.openapi.json | 461 ++++++++++++++++++++++++++++++++-- package-lock.json | 4 +- package.json | 2 +- scripts/check-consumer.mjs | 2 +- src/generated/schema.d.ts | 386 +++++++++++++++++++++++++++- src/resources/reconova.ts | 6 +- src/resources/spectrace.ts | 6 +- src/types.ts | 5 +- 10 files changed, 851 insertions(+), 33 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e3112f8..52d52e7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.0.0-beta.2" + ".": "1.0.0-beta.3" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 9979153..f6f11f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,15 @@ All notable SDK changes are recorded here. The SDK follows Semantic Versioning; its package version is independent from the Motifuse `/api/v1` version. +## [1.0.0-beta.3] - 2026-08-27 + +### Fixed + +- Kept Node.js `Buffer` and generic `Uint8Array` upload bodies type-safe for + consumers using newer TypeScript DOM declarations. +- Synchronized generated models and executable request examples with the corrected Motifuse + production OpenAPI contract. + ## [1.0.0-beta.2] - 2026-08-24 ### Changed @@ -25,4 +34,5 @@ is independent from the Motifuse `/api/v1` version. - ESM package output for Node.js 20 and newer with zero runtime dependencies. [1.0.0-beta.2]: https://github.com/SyntaxArchitect/motifuse-sdk-typescript/releases/tag/v1.0.0-beta.2 +[1.0.0-beta.3]: https://github.com/SyntaxArchitect/motifuse-sdk-typescript/releases/tag/v1.0.0-beta.3 [1.0.0-beta.1]: https://github.com/SyntaxArchitect/motifuse-sdk-typescript/releases/tag/v1.0.0-beta.1 diff --git a/openapi/motifuse.openapi.json b/openapi/motifuse.openapi.json index e9851d3..206a3ce 100644 --- a/openapi/motifuse.openapi.json +++ b/openapi/motifuse.openapi.json @@ -242,6 +242,20 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DocForgeGenerationRequest" + }, + "example": { + "template_id": "tpl_invoice", + "rows": [ + { + "invoice_number": "INV-1042", + "customer_name": "Example Industries", + "total": 2499.5 + } + ], + "output_format": "pdf", + "metadata": { + "source": "billing-service" + } } } } @@ -490,6 +504,9 @@ "application/json": { "schema": { "$ref": "#/components/schemas/DocForgeDownloadRequest" + }, + "example": { + "target": "archive" } } } @@ -654,6 +671,11 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ReconovaFileRequest" + }, + "example": { + "filename": "customer-master.xlsx", + "size": 62865, + "content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" } } } @@ -987,6 +1009,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/ReconovaCleanRequest" + }, + "example": { + "source_asset_id": "asset_customer_master", + "steps": [ + { + "type": "trim_whitespace", + "columns": [ + "customer_name" + ] + } + ] } } } @@ -1393,6 +1426,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SpectraceProjectRequest" + }, + "example": { + "name": "Vendor Contract Review", + "reference": "PROC-2026-042", + "tags": [ + "procurement" + ], + "priority": "high" } } } @@ -1551,6 +1592,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SpectraceProjectRequest" + }, + "example": { + "name": "Vendor Contract Review", + "reference": "PROC-2026-042", + "tags": [ + "procurement" + ], + "priority": "high" } } } @@ -1820,6 +1869,13 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SpectraceFileRequest" + }, + "example": { + "filename": "contract-v2.docx", + "content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + "size": 38356, + "version_label": "v2", + "effective_date": "2026-09-01" } } } @@ -2241,6 +2297,11 @@ "application/json": { "schema": { "$ref": "#/components/schemas/SpectraceComparisonRequest" + }, + "example": { + "baseline_version_id": "stv_baseline", + "revised_version_id": "stv_revised", + "include_furniture": false } } } @@ -2428,14 +2489,31 @@ "name": "status", "in": "query", "schema": { - "type": "string" + "type": "string", + "enum": [ + "unreviewed", + "under_review", + "needs_clarification", + "confirmed", + "rejected_noise", + "action_required", + "resolved", + "closed" + ] } }, { "name": "importance", "in": "query", "schema": { - "type": "string" + "type": "string", + "enum": [ + "INFORMATIONAL", + "LOW", + "MEDIUM", + "HIGH", + "CRITICAL" + ] } }, { @@ -2600,6 +2678,12 @@ "application/json": { "schema": { "$ref": "#/components/schemas/FindingReviewRequest" + }, + "example": { + "status": "confirmed", + "importance": "HIGH", + "note": "Validated against change notice CN-042.", + "rev": 0 } } } @@ -2982,6 +3066,14 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEndpointRequest" + }, + "example": { + "url": "https://example.com/webhooks/motifuse", + "events": [ + "spectrace.comparison.completed", + "spectrace.comparison.failed" + ], + "description": "Production comparison events" } } } @@ -3145,6 +3237,10 @@ "type": "boolean" } } + }, + "example": { + "status": "active", + "rotate_secret": false } } } @@ -3456,6 +3552,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -3503,6 +3610,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -3550,6 +3668,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -3597,6 +3726,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -3644,6 +3784,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -3691,6 +3842,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -3738,6 +3900,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -3785,6 +3958,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -3832,6 +4016,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -3879,6 +4074,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -3926,6 +4132,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -3973,6 +4190,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -4020,6 +4248,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -4067,6 +4306,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -4114,6 +4364,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -4161,6 +4422,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -4208,6 +4480,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -4255,6 +4538,17 @@ "application/json": { "schema": { "$ref": "#/components/schemas/WebhookEvent" + }, + "example": { + "id": "evt_example", + "type": "spectrace.comparison.completed", + "api_version": "2026-08-24", + "created": 1787558400, + "workspace_id": "ws_example", + "data": { + "comparison_id": "stc_example" + }, + "metadata": {} } } } @@ -5249,7 +5543,8 @@ ], "properties": { "id": { - "type": "string" + "type": "string", + "pattern": "^stf2_[0-9a-f]{28}$" }, "object": { "const": "finding" @@ -5257,6 +5552,12 @@ "comparison_id": { "type": "string" }, + "project_id": { + "type": [ + "string", + "null" + ] + }, "change_types": { "type": "array", "items": { @@ -5266,6 +5567,48 @@ "primary_change_type": { "type": "string" }, + "change_family": { + "type": [ + "string", + "null" + ] + }, + "change_type": { + "type": [ + "string", + "null" + ] + }, + "change_sub_type": { + "type": [ + "string", + "null" + ] + }, + "semantic_type": { + "type": [ + "string", + "null" + ] + }, + "semantic_sub_type": { + "type": [ + "string", + "null" + ] + }, + "structural_type": { + "type": [ + "string", + "null" + ] + }, + "reason_code": { + "type": [ + "string", + "null" + ] + }, "old_text": { "type": "string" }, @@ -5302,19 +5645,75 @@ "type": "object" } }, + "typed_delta": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, "confidence": { - "type": "number" + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "confidence_details": { + "type": [ + "object", + "null" + ], + "additionalProperties": true }, "status": { - "type": "string" + "type": "string", + "enum": [ + "unreviewed", + "under_review", + "needs_clarification", + "confirmed", + "rejected_noise", + "action_required", + "resolved", + "closed" + ] + }, + "importance": { + "type": "string", + "enum": [ + "INFORMATIONAL", + "LOW", + "MEDIUM", + "HIGH", + "CRITICAL" + ] + }, + "importance_details": { + "type": [ + "object", + "null" + ], + "additionalProperties": true }, - "importance": {}, "explanation": { "type": "string" }, "note": { "type": "string" }, + "review": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "evidence": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, "reviewed_at": { "type": [ "string", @@ -5323,15 +5722,21 @@ "format": "date-time" }, "created_at": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date-time" }, "updated_at": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date-time" } }, - "additionalProperties": true + "additionalProperties": false }, "FindingList": { "type": "object", @@ -5589,22 +5994,50 @@ "FindingReviewRequest": { "type": "object", "additionalProperties": false, + "required": [ + "rev" + ], "properties": { "status": { - "type": "string" + "type": "string", + "enum": [ + "unreviewed", + "under_review", + "needs_clarification", + "confirmed", + "rejected_noise", + "action_required", + "resolved", + "closed" + ] + }, + "importance": { + "type": [ + "string", + "null" + ], + "enum": [ + "INFORMATIONAL", + "LOW", + "MEDIUM", + "HIGH", + "CRITICAL", + null + ], + "description": "Override the engine-assigned importance. Null restores the engine value." }, - "importance": {}, "note": { "type": "string", - "maxLength": 4000 + "maxLength": 8000 }, "reason": { "type": "string", - "maxLength": 1000 + "maxLength": 2000 }, "rev": { "type": "integer", - "minimum": 1 + "minimum": 0, + "description": "Optimistic-concurrency revision returned in finding.review.rev." } } }, diff --git a/package-lock.json b/package-lock.json index 0c0d8a0..f280374 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@motifuse/sdk", - "version": "1.0.0-beta.2", + "version": "1.0.0-beta.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@motifuse/sdk", - "version": "1.0.0-beta.2", + "version": "1.0.0-beta.3", "license": "MIT", "devDependencies": { "@eslint/js": "^10.0.1", diff --git a/package.json b/package.json index 9fb4263..e5322bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@motifuse/sdk", - "version": "1.0.0-beta.2", + "version": "1.0.0-beta.3", "description": "Official TypeScript SDK for the Motifuse API", "license": "MIT", "author": "Motifuse", diff --git a/scripts/check-consumer.mjs b/scripts/check-consumer.mjs index e0013b7..6536bdf 100644 --- a/scripts/check-consumer.mjs +++ b/scripts/check-consumer.mjs @@ -44,7 +44,7 @@ try { ); await writeFile( join(consumerDirectory, "index.ts"), - 'import { Motifuse, type SpectraceComparison } from "@motifuse/sdk";\nconst client = new Motifuse({ apiKey: "mf_test_type_fixture" });\nconst comparison: SpectraceComparison | undefined = undefined;\nvoid client; void comparison;\n', + 'import { Motifuse, type SpectraceComparison } from "@motifuse/sdk";\nconst client = new Motifuse({ apiKey: "mf_test_type_fixture" });\nconst comparison: SpectraceComparison | undefined = undefined;\nconst bytes: Uint8Array = new Uint8Array(8);\nvoid client.reconova.files.upload({ filename: "qa.csv", size: bytes.byteLength, content_type: "text/csv" }, { body: bytes });\nvoid client; void comparison;\n', ); await writeFile( join(consumerDirectory, "tsconfig.json"), diff --git a/src/generated/schema.d.ts b/src/generated/schema.d.ts index 6268a84..d8db3b0 100644 --- a/src/generated/schema.d.ts +++ b/src/generated/schema.d.ts @@ -968,30 +968,53 @@ export interface components { Finding: { baseline_locator?: Record | null; baseline_spreadsheet?: Record | null; + change_family?: string | null; + change_sub_type?: string | null; + change_type?: string | null; change_types: string[]; comparison_id: string; confidence: number; + confidence_details?: { + [key: string]: unknown; + } | null; /** Format: date-time */ - created_at?: string; + created_at?: string | null; + evidence?: { + [key: string]: unknown; + } | null; explanation?: string; id: string; - importance: unknown; + /** @enum {string} */ + importance: "INFORMATIONAL" | "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"; + importance_details?: { + [key: string]: unknown; + } | null; new_text?: string; note?: string; /** @constant */ object: "finding"; old_text?: string; primary_change_type?: string; + project_id?: string | null; + reason_code?: string | null; + review?: { + [key: string]: unknown; + } | null; /** Format: date-time */ reviewed_at?: string | null; revised_locator?: Record | null; revised_spreadsheet?: Record | null; - status: string; + semantic_sub_type?: string | null; + semantic_type?: string | null; + /** @enum {string} */ + status: "unreviewed" | "under_review" | "needs_clarification" | "confirmed" | "rejected_noise" | "action_required" | "resolved" | "closed"; + structural_type?: string | null; + typed_delta?: { + [key: string]: unknown; + } | null; /** Format: date-time */ - updated_at?: string; + updated_at?: string | null; value_changes?: Record[]; - } & { - [key: string]: unknown; }; FindingList: { data: components["schemas"]["Finding"][]; @@ -999,11 +1022,17 @@ export interface components { next_cursor: string | null; }; FindingReviewRequest: { - importance?: unknown; + /** + * @description Override the engine-assigned importance. Null restores the engine value. + * @enum {string|null} + */ + importance?: "INFORMATIONAL" | "LOW" | "MEDIUM" | "HIGH" | "CRITICAL" | null; note?: string; reason?: string; - rev?: number; - status?: string; + /** @description Optimistic-concurrency revision returned in finding.review.rev. */ + rev: number; + /** @enum {string} */ + status?: "unreviewed" | "under_review" | "needs_clarification" | "confirmed" | "rejected_noise" | "action_required" | "resolved" | "closed"; }; Job: { cancellation_requested?: boolean; @@ -1540,6 +1569,22 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "template_id": "tpl_invoice", + * "rows": [ + * { + * "invoice_number": "INV-1042", + * "customer_name": "Example Industries", + * "total": 2499.5 + * } + * ], + * "output_format": "pdf", + * "metadata": { + * "source": "billing-service" + * } + * } + */ "application/json": components["schemas"]["DocForgeGenerationRequest"]; }; }; @@ -1661,6 +1706,11 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "target": "archive" + * } + */ "application/json": components["schemas"]["DocForgeDownloadRequest"]; }; }; @@ -1773,6 +1823,13 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "filename": "customer-master.xlsx", + * "size": 62865, + * "content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + * } + */ "application/json": components["schemas"]["ReconovaFileRequest"]; }; }; @@ -2049,6 +2106,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "source_asset_id": "asset_customer_master", + * "steps": [ + * { + * "type": "trim_whitespace", + * "columns": [ + * "customer_name" + * ] + * } + * ] + * } + */ "application/json": components["schemas"]["ReconovaCleanRequest"]; }; }; @@ -2163,9 +2233,9 @@ export interface operations { query?: { change_type?: string; cursor?: string | null; - importance?: string; + importance?: "INFORMATIONAL" | "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"; limit?: number; - status?: string; + status?: "unreviewed" | "under_review" | "needs_clarification" | "confirmed" | "rejected_noise" | "action_required" | "resolved" | "closed"; }; header?: { /** @description Optional caller correlation ID. Motifuse returns a request ID on every response. */ @@ -2362,6 +2432,14 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "status": "confirmed", + * "importance": "HIGH", + * "note": "Validated against change notice CN-042.", + * "rev": 0 + * } + */ "application/json": components["schemas"]["FindingReviewRequest"]; }; }; @@ -2509,6 +2587,16 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "name": "Vendor Contract Review", + * "reference": "PROC-2026-042", + * "tags": [ + * "procurement" + * ], + * "priority": "high" + * } + */ "application/json": components["schemas"]["SpectraceProjectRequest"]; }; }; @@ -2625,6 +2713,16 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "name": "Vendor Contract Review", + * "reference": "PROC-2026-042", + * "tags": [ + * "procurement" + * ], + * "priority": "high" + * } + */ "application/json": components["schemas"]["SpectraceProjectRequest"]; }; }; @@ -2706,6 +2804,13 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "baseline_version_id": "stv_baseline", + * "revised_version_id": "stv_revised", + * "include_furniture": false + * } + */ "application/json": components["schemas"]["SpectraceComparisonRequest"]; }; }; @@ -2796,6 +2901,15 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "filename": "contract-v2.docx", + * "content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + * "size": 38356, + * "version_label": "v2", + * "effective_date": "2026-09-01" + * } + */ "application/json": components["schemas"]["SpectraceFileRequest"]; }; }; @@ -2899,6 +3013,16 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "url": "https://example.com/webhooks/motifuse", + * "events": [ + * "spectrace.comparison.completed", + * "spectrace.comparison.failed" + * ], + * "description": "Production comparison events" + * } + */ "application/json": components["schemas"]["WebhookEndpointRequest"]; }; }; @@ -2973,6 +3097,12 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "status": "active", + * "rotate_secret": false + * } + */ "application/json": { rotate_secret?: boolean; /** @enum {string} */ @@ -3087,6 +3217,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3113,6 +3256,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3139,6 +3295,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3165,6 +3334,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3191,6 +3373,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3217,6 +3412,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3243,6 +3451,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3269,6 +3490,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3295,6 +3529,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3321,6 +3568,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3347,6 +3607,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3373,6 +3646,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3399,6 +3685,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3425,6 +3724,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3451,6 +3763,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3477,6 +3802,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3503,6 +3841,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; @@ -3529,6 +3880,19 @@ export interface operations { }; requestBody: { content: { + /** + * @example { + * "id": "evt_example", + * "type": "spectrace.comparison.completed", + * "api_version": "2026-08-24", + * "created": 1787558400, + * "workspace_id": "ws_example", + * "data": { + * "comparison_id": "stc_example" + * }, + * "metadata": {} + * } + */ "application/json": components["schemas"]["WebhookEvent"]; }; }; diff --git a/src/resources/reconova.ts b/src/resources/reconova.ts index abb2673..cb9c8aa 100644 --- a/src/resources/reconova.ts +++ b/src/resources/reconova.ts @@ -68,7 +68,11 @@ export class ReconovaFilesResource { } await this.client.upload( file.upload.url, - { method: file.upload.method, headers: file.upload.headers, body: uploadOptions.body }, + { + method: file.upload.method, + headers: file.upload.headers, + body: uploadOptions.body as BodyInit, + }, uploadOptions.signal, ); return this.complete(file.id, { diff --git a/src/resources/spectrace.ts b/src/resources/spectrace.ts index 34327f4..02ffad1 100644 --- a/src/resources/spectrace.ts +++ b/src/resources/spectrace.ts @@ -151,7 +151,11 @@ export class SpectraceFilesResource { } await this.client.upload( file.upload.url, - { method: file.upload.method, headers: file.upload.headers, body: uploadOptions.body }, + { + method: file.upload.method, + headers: file.upload.headers, + body: uploadOptions.body as BodyInit, + }, uploadOptions.signal, ); return this.complete(file.id, { diff --git a/src/types.ts b/src/types.ts index dee0d88..d44f339 100644 --- a/src/types.ts +++ b/src/types.ts @@ -50,7 +50,10 @@ export interface FindingListInput extends PaginationInput { } export interface FileUploadOptions { - body: BodyInit; + /** Bytes accepted by Node's native fetch. The explicit typed-array branch + * keeps consumers on newer TypeScript DOM declarations from losing the + * Node Buffer/Uint8Array upload path to ArrayBufferLike variance. */ + body: BodyInit | Uint8Array; signal?: AbortSignal | undefined; idempotencyKey?: string | undefined; }