prompsit-cli 26.225.1206 → 26.227.2006
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -4
- package/dist/api/auth-session.d.ts +11 -11
- package/dist/api/auth-session.d.ts.map +1 -1
- package/dist/api/auth-session.js +21 -17
- package/dist/api/auth-session.js.map +1 -1
- package/dist/api/client.d.ts +4 -4
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +8 -8
- package/dist/api/client.js.map +1 -1
- package/dist/api/curl.d.ts +30 -0
- package/dist/api/curl.d.ts.map +1 -0
- package/dist/api/curl.js +115 -0
- package/dist/api/curl.js.map +1 -0
- package/dist/api/errors.d.ts +2 -3
- package/dist/api/errors.d.ts.map +1 -1
- package/dist/api/errors.js +4 -2
- package/dist/api/errors.js.map +1 -1
- package/dist/api/http-utils.d.ts +5 -0
- package/dist/api/http-utils.d.ts.map +1 -0
- package/dist/api/http-utils.js +19 -0
- package/dist/api/http-utils.js.map +1 -0
- package/dist/api/models.d.ts +135 -89
- package/dist/api/models.d.ts.map +1 -1
- package/dist/api/models.js +62 -72
- package/dist/api/models.js.map +1 -1
- package/dist/api/resources/data.d.ts +3 -5
- package/dist/api/resources/data.d.ts.map +1 -1
- package/dist/api/resources/data.js +11 -12
- package/dist/api/resources/data.js.map +1 -1
- package/dist/api/resources/discovery.d.ts +26 -0
- package/dist/api/resources/discovery.d.ts.map +1 -0
- package/dist/api/resources/discovery.js +46 -0
- package/dist/api/resources/discovery.js.map +1 -0
- package/dist/api/resources/evaluation.d.ts +9 -12
- package/dist/api/resources/evaluation.d.ts.map +1 -1
- package/dist/api/resources/evaluation.js +45 -20
- package/dist/api/resources/evaluation.js.map +1 -1
- package/dist/api/resources/formats.d.ts +1 -1
- package/dist/api/resources/formats.js +2 -2
- package/dist/api/resources/formats.js.map +1 -1
- package/dist/api/resources/jobs.d.ts +7 -8
- package/dist/api/resources/jobs.d.ts.map +1 -1
- package/dist/api/resources/jobs.js +10 -49
- package/dist/api/resources/jobs.js.map +1 -1
- package/dist/api/resources/languages.d.ts +25 -0
- package/dist/api/resources/languages.d.ts.map +1 -0
- package/dist/api/resources/languages.js +44 -0
- package/dist/api/resources/languages.js.map +1 -0
- package/dist/api/resources/translation.d.ts +8 -16
- package/dist/api/resources/translation.d.ts.map +1 -1
- package/dist/api/resources/translation.js +11 -15
- package/dist/api/resources/translation.js.map +1 -1
- package/dist/api/sse-client.d.ts +10 -16
- package/dist/api/sse-client.d.ts.map +1 -1
- package/dist/api/sse-client.js +158 -197
- package/dist/api/sse-client.js.map +1 -1
- package/dist/api/sse-models.js +1 -1
- package/dist/api/sse-models.js.map +1 -1
- package/dist/api/trace.js +1 -1
- package/dist/api/trace.js.map +1 -1
- package/dist/api/transport.d.ts +28 -1
- package/dist/api/transport.d.ts.map +1 -1
- package/dist/api/transport.js +89 -17
- package/dist/api/transport.js.map +1 -1
- package/dist/cli/arg-order.d.ts +2 -0
- package/dist/cli/arg-order.d.ts.map +1 -1
- package/dist/cli/arg-order.js +2 -0
- package/dist/cli/arg-order.js.map +1 -1
- package/dist/cli/exit-codes.d.ts +0 -2
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +0 -2
- package/dist/cli/exit-codes.js.map +1 -1
- package/dist/cli/exit.d.ts +4 -4
- package/dist/cli/exit.d.ts.map +1 -1
- package/dist/cli/exit.js +4 -4
- package/dist/cli/exit.js.map +1 -1
- package/dist/cli/prompts.d.ts +0 -2
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/prompts.js +1 -1
- package/dist/cli/prompts.js.map +1 -1
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +0 -1
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/batch-processor.d.ts +38 -0
- package/dist/commands/batch-processor.d.ts.map +1 -0
- package/dist/commands/batch-processor.js +73 -0
- package/dist/commands/batch-processor.js.map +1 -0
- package/dist/commands/config/api-url.d.ts.map +1 -1
- package/dist/commands/config/api-url.js +4 -1
- package/dist/commands/config/api-url.js.map +1 -1
- package/dist/commands/config/command.d.ts.map +1 -1
- package/dist/commands/config/command.js +3 -2
- package/dist/commands/config/command.js.map +1 -1
- package/dist/commands/config/language.d.ts.map +1 -1
- package/dist/commands/config/language.js.map +1 -1
- package/dist/commands/config/reset.d.ts.map +1 -1
- package/dist/commands/config/reset.js.map +1 -1
- package/dist/commands/config/shared.js +3 -3
- package/dist/commands/config/shared.js.map +1 -1
- package/dist/commands/config/show.d.ts.map +1 -1
- package/dist/commands/config/show.js +0 -13
- package/dist/commands/config/show.js.map +1 -1
- package/dist/commands/data.d.ts.map +1 -1
- package/dist/commands/data.js +241 -68
- package/dist/commands/data.js.map +1 -1
- package/dist/commands/evaluate.d.ts.map +1 -1
- package/dist/commands/evaluate.js +111 -29
- package/dist/commands/evaluate.js.map +1 -1
- package/dist/commands/formats.d.ts +1 -1
- package/dist/commands/formats.d.ts.map +1 -1
- package/dist/commands/formats.js +5 -12
- package/dist/commands/formats.js.map +1 -1
- package/dist/commands/health.d.ts +1 -1
- package/dist/commands/health.d.ts.map +1 -1
- package/dist/commands/health.js +3 -10
- package/dist/commands/health.js.map +1 -1
- package/dist/commands/job-tracking.d.ts +13 -5
- package/dist/commands/job-tracking.d.ts.map +1 -1
- package/dist/commands/job-tracking.js +25 -18
- package/dist/commands/job-tracking.js.map +1 -1
- package/dist/commands/languages.d.ts +12 -0
- package/dist/commands/languages.d.ts.map +1 -0
- package/dist/commands/languages.js +48 -0
- package/dist/commands/languages.js.map +1 -0
- package/dist/commands/mappers.d.ts +15 -3
- package/dist/commands/mappers.d.ts.map +1 -1
- package/dist/commands/mappers.js +38 -18
- package/dist/commands/mappers.js.map +1 -1
- package/dist/commands/progress-animator.d.ts +2 -1
- package/dist/commands/progress-animator.d.ts.map +1 -1
- package/dist/commands/progress-animator.js +4 -2
- package/dist/commands/progress-animator.js.map +1 -1
- package/dist/commands/translate.d.ts.map +1 -1
- package/dist/commands/translate.js +149 -87
- package/dist/commands/translate.js.map +1 -1
- package/dist/config/credentials.d.ts +11 -87
- package/dist/config/credentials.d.ts.map +1 -1
- package/dist/config/credentials.js +28 -87
- package/dist/config/credentials.js.map +1 -1
- package/dist/config/env-parser.d.ts.map +1 -1
- package/dist/config/env-parser.js +3 -2
- package/dist/config/env-parser.js.map +1 -1
- package/dist/config/file-utils.js +1 -1
- package/dist/config/file-utils.js.map +1 -1
- package/dist/config/index.d.ts +4 -7
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +6 -12
- package/dist/config/index.js.map +1 -1
- package/dist/config/schemas.d.ts +4 -33
- package/dist/config/schemas.d.ts.map +1 -1
- package/dist/config/schemas.js +14 -19
- package/dist/config/schemas.js.map +1 -1
- package/dist/config/settings.d.ts +4 -4
- package/dist/config/settings.d.ts.map +1 -1
- package/dist/config/settings.js +16 -21
- package/dist/config/settings.js.map +1 -1
- package/dist/config/toml-io.js +1 -1
- package/dist/config/toml-io.js.map +1 -1
- package/dist/constants.d.ts +10 -9
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +10 -9
- package/dist/constants.js.map +1 -1
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/errors/catalog.js +6 -8
- package/dist/errors/catalog.js.map +1 -1
- package/dist/errors/contracts.d.ts.map +1 -1
- package/dist/errors/contracts.js +2 -3
- package/dist/errors/contracts.js.map +1 -1
- package/dist/i18n/cache.d.ts +0 -2
- package/dist/i18n/cache.d.ts.map +1 -1
- package/dist/i18n/cache.js +4 -4
- package/dist/i18n/cache.js.map +1 -1
- package/dist/i18n/catalog.d.ts +34 -37
- package/dist/i18n/catalog.d.ts.map +1 -1
- package/dist/i18n/catalog.js +38 -40
- package/dist/i18n/catalog.js.map +1 -1
- package/dist/i18n/index.d.ts +0 -1
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +0 -3
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/translator-adapter.js +1 -1
- package/dist/i18n/translator-adapter.js.map +1 -1
- package/dist/i18n/translator.d.ts.map +1 -1
- package/dist/i18n/translator.js +1 -0
- package/dist/i18n/translator.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/logging/console-handler.js +1 -1
- package/dist/logging/console-handler.js.map +1 -1
- package/dist/logging/file-handler.d.ts.map +1 -1
- package/dist/logging/file-handler.js +4 -5
- package/dist/logging/file-handler.js.map +1 -1
- package/dist/logging/index.d.ts +2 -2
- package/dist/logging/index.d.ts.map +1 -1
- package/dist/logging/index.js +1 -1
- package/dist/logging/index.js.map +1 -1
- package/dist/logging/logger.d.ts +18 -22
- package/dist/logging/logger.d.ts.map +1 -1
- package/dist/logging/logger.js +38 -64
- package/dist/logging/logger.js.map +1 -1
- package/dist/logging/loki-handler.js +1 -1
- package/dist/logging/loki-handler.js.map +1 -1
- package/dist/logging/setup.d.ts +4 -3
- package/dist/logging/setup.d.ts.map +1 -1
- package/dist/logging/setup.js +136 -33
- package/dist/logging/setup.js.map +1 -1
- package/dist/output/ansi-utils.d.ts +13 -0
- package/dist/output/ansi-utils.d.ts.map +1 -0
- package/dist/output/ansi-utils.js +37 -0
- package/dist/output/ansi-utils.js.map +1 -0
- package/dist/output/index.d.ts +2 -5
- package/dist/output/index.d.ts.map +1 -1
- package/dist/output/index.js +3 -2
- package/dist/output/index.js.map +1 -1
- package/dist/output/output-events.d.ts +0 -1
- package/dist/output/output-events.d.ts.map +1 -1
- package/dist/output/tables/catalog.d.ts +5 -2
- package/dist/output/tables/catalog.d.ts.map +1 -1
- package/dist/output/tables/catalog.js +65 -9
- package/dist/output/tables/catalog.js.map +1 -1
- package/dist/output/tables/evaluation.d.ts.map +1 -1
- package/dist/output/tables/evaluation.js +3 -0
- package/dist/output/tables/evaluation.js.map +1 -1
- package/dist/output/tables/health-status.d.ts.map +1 -1
- package/dist/output/tables/health-status.js +11 -7
- package/dist/output/tables/health-status.js.map +1 -1
- package/dist/output/tables/index.d.ts +3 -3
- package/dist/output/tables/index.d.ts.map +1 -1
- package/dist/output/tables/index.js +2 -2
- package/dist/output/tables/index.js.map +1 -1
- package/dist/output/tables/render.d.ts.map +1 -1
- package/dist/output/tables/render.js +2 -10
- package/dist/output/tables/render.js.map +1 -1
- package/dist/output/terminal.d.ts +1 -5
- package/dist/output/terminal.d.ts.map +1 -1
- package/dist/output/terminal.js +25 -24
- package/dist/output/terminal.js.map +1 -1
- package/dist/output/view-models.d.ts +28 -2
- package/dist/output/view-models.d.ts.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +21 -29
- package/dist/program.js.map +1 -1
- package/dist/repl/controller.d.ts.map +1 -1
- package/dist/repl/controller.js +82 -47
- package/dist/repl/controller.js.map +1 -1
- package/dist/repl/core/output-bridge.d.ts.map +1 -1
- package/dist/repl/core/output-bridge.js +6 -4
- package/dist/repl/core/output-bridge.js.map +1 -1
- package/dist/repl/core/progress-types.d.ts +1 -1
- package/dist/repl/core/progress-types.d.ts.map +1 -1
- package/dist/repl/core/progress-types.js +1 -1
- package/dist/repl/core/progress-types.js.map +1 -1
- package/dist/repl/examples.d.ts +5 -7
- package/dist/repl/examples.d.ts.map +1 -1
- package/dist/repl/examples.js +27 -14
- package/dist/repl/examples.js.map +1 -1
- package/dist/repl/executor.d.ts +2 -4
- package/dist/repl/executor.d.ts.map +1 -1
- package/dist/repl/executor.js +69 -58
- package/dist/repl/executor.js.map +1 -1
- package/dist/repl/help.d.ts +10 -3
- package/dist/repl/help.d.ts.map +1 -1
- package/dist/repl/help.js +31 -4
- package/dist/repl/help.js.map +1 -1
- package/dist/repl/history/command-history.js +5 -5
- package/dist/repl/history/command-history.js.map +1 -1
- package/dist/repl/history/output-render.d.ts +1 -3
- package/dist/repl/history/output-render.d.ts.map +1 -1
- package/dist/repl/history/output-render.js +4 -6
- package/dist/repl/history/output-render.js.map +1 -1
- package/dist/repl/history/output-store.d.ts.map +1 -1
- package/dist/repl/history/output-store.js +6 -3
- package/dist/repl/history/output-store.js.map +1 -1
- package/dist/repl/input/autocomplete-provider.d.ts.map +1 -1
- package/dist/repl/input/autocomplete-provider.js +1 -2
- package/dist/repl/input/autocomplete-provider.js.map +1 -1
- package/dist/repl/input/completer.d.ts +0 -2
- package/dist/repl/input/completer.d.ts.map +1 -1
- package/dist/repl/input/completer.js +9 -7
- package/dist/repl/input/completer.js.map +1 -1
- package/dist/repl/input/ghost-text.d.ts +1 -1
- package/dist/repl/input/ghost-text.d.ts.map +1 -1
- package/dist/repl/input/ghost-text.js +1 -1
- package/dist/repl/input/ghost-text.js.map +1 -1
- package/dist/repl/input/input-handler.d.ts.map +1 -1
- package/dist/repl/input/input-handler.js +21 -15
- package/dist/repl/input/input-handler.js.map +1 -1
- package/dist/repl/input/keybindings.d.ts +0 -5
- package/dist/repl/input/keybindings.d.ts.map +1 -1
- package/dist/repl/input/keybindings.js +0 -65
- package/dist/repl/input/keybindings.js.map +1 -1
- package/dist/repl/loop.d.ts +1 -2
- package/dist/repl/loop.d.ts.map +1 -1
- package/dist/repl/loop.js +14 -14
- package/dist/repl/loop.js.map +1 -1
- package/dist/repl/registry.d.ts +28 -20
- package/dist/repl/registry.d.ts.map +1 -1
- package/dist/repl/registry.js +229 -171
- package/dist/repl/registry.js.map +1 -1
- package/dist/repl/service.d.ts +1 -10
- package/dist/repl/service.d.ts.map +1 -1
- package/dist/repl/service.js +15 -26
- package/dist/repl/service.js.map +1 -1
- package/dist/repl/ui/components/curl-panel.js +4 -4
- package/dist/repl/ui/components/curl-panel.js.map +1 -1
- package/dist/repl/ui/components/ghost-text-editor.d.ts +4 -0
- package/dist/repl/ui/components/ghost-text-editor.d.ts.map +1 -1
- package/dist/repl/ui/components/ghost-text-editor.js +17 -6
- package/dist/repl/ui/components/ghost-text-editor.js.map +1 -1
- package/dist/repl/ui/components/history-component.d.ts.map +1 -1
- package/dist/repl/ui/components/history-component.js +7 -69
- package/dist/repl/ui/components/history-component.js.map +1 -1
- package/dist/repl/ui/components/progress-bar.js.map +1 -1
- package/dist/repl/ui/components/status-bar-line.js +1 -1
- package/dist/repl/ui/components/status-bar-line.js.map +1 -1
- package/dist/repl/ui/data.js +3 -3
- package/dist/repl/ui/data.js.map +1 -1
- package/dist/repl/ui/hint-state.d.ts +0 -1
- package/dist/repl/ui/hint-state.d.ts.map +1 -1
- package/dist/repl/ui/hint-state.js +1 -1
- package/dist/repl/ui/hint-state.js.map +1 -1
- package/dist/repl/ui/selection-utils.d.ts +28 -0
- package/dist/repl/ui/selection-utils.d.ts.map +1 -0
- package/dist/repl/ui/selection-utils.js +70 -0
- package/dist/repl/ui/selection-utils.js.map +1 -0
- package/dist/repl/ui/status-bar.d.ts +1 -4
- package/dist/repl/ui/status-bar.d.ts.map +1 -1
- package/dist/repl/ui/status-bar.js +6 -33
- package/dist/repl/ui/status-bar.js.map +1 -1
- package/dist/runtime/async-utils.d.ts +16 -0
- package/dist/runtime/async-utils.d.ts.map +1 -0
- package/dist/runtime/async-utils.js +40 -0
- package/dist/runtime/async-utils.js.map +1 -0
- package/dist/runtime/clipboard-win32.d.ts.map +1 -1
- package/dist/runtime/clipboard-win32.js +2 -1
- package/dist/runtime/clipboard-win32.js.map +1 -1
- package/dist/runtime/clipboard.d.ts.map +1 -1
- package/dist/runtime/clipboard.js +6 -2
- package/dist/runtime/clipboard.js.map +1 -1
- package/dist/runtime/external-transport.d.ts.map +1 -1
- package/dist/runtime/external-transport.js +1 -1
- package/dist/runtime/external-transport.js.map +1 -1
- package/dist/runtime/file-args.d.ts +38 -0
- package/dist/runtime/file-args.d.ts.map +1 -0
- package/dist/runtime/file-args.js +133 -0
- package/dist/runtime/file-args.js.map +1 -0
- package/dist/runtime/platform.d.ts +0 -2
- package/dist/runtime/platform.d.ts.map +1 -1
- package/dist/runtime/platform.js +0 -6
- package/dist/runtime/platform.js.map +1 -1
- package/dist/tui/settings-screen.d.ts +1 -13
- package/dist/tui/settings-screen.d.ts.map +1 -1
- package/dist/tui/settings-screen.js +46 -34
- package/dist/tui/settings-screen.js.map +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +3 -2
- package/dist/version.js.map +1 -1
- package/examples/sample.tmx +6 -0
- package/package.json +18 -7
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AuthSession } from "../auth-session.ts";
|
|
2
|
+
import { type FormatInfo, type QeFormatInfo, type DataScoreFormatsResponse, type DataAnnotateFormatsResponse, type AnnotateOptionsResponse } from "../models.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Discovery API resource for format/options discovery across all services.
|
|
5
|
+
*
|
|
6
|
+
* All endpoints are public (LIGHT rate limit), but use AuthSession for
|
|
7
|
+
* consistency with the existing resource pattern.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DiscoveryResource {
|
|
10
|
+
private readonly session;
|
|
11
|
+
private readonly baseUrl;
|
|
12
|
+
constructor(session: AuthSession, baseUrl: string);
|
|
13
|
+
/** Shared GET + Zod parse. Eliminates boilerplate across 5 discovery methods. */
|
|
14
|
+
private get;
|
|
15
|
+
/** GET /v1/translation/document/formats — document translation formats. */
|
|
16
|
+
documentFormats(): Promise<FormatInfo[]>;
|
|
17
|
+
/** GET /v1/quality/score/formats — QE file scoring formats. */
|
|
18
|
+
qeFormats(): Promise<QeFormatInfo[]>;
|
|
19
|
+
/** GET /v1/data/score/formats — Bicleaner scoring formats. */
|
|
20
|
+
dataScoreFormats(): Promise<DataScoreFormatsResponse>;
|
|
21
|
+
/** GET /v1/data/annotate/formats — annotation input formats. */
|
|
22
|
+
dataAnnotateFormats(): Promise<DataAnnotateFormatsResponse>;
|
|
23
|
+
/** GET /v1/data/annotate/options — pipeline stages, LID models, defaults. */
|
|
24
|
+
annotateOptions(): Promise<AnnotateOptionsResponse>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/api/resources/discovery.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAML,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC7B,MAAM,cAAc,CAAC;AAGtB;;;;;GAKG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM;IAKjD,iFAAiF;YACnE,GAAG;IAKjB,2EAA2E;IACrE,eAAe,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;IAK9C,+DAA+D;IACzD,SAAS,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAK1C,8DAA8D;IACxD,gBAAgB,IAAI,OAAO,CAAC,wBAAwB,CAAC;IAI3D,gEAAgE;IAC1D,mBAAmB,IAAI,OAAO,CAAC,2BAA2B,CAAC;IAIjE,6EAA6E;IACvE,eAAe,IAAI,OAAO,CAAC,uBAAuB,CAAC;CAG1D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Discovery API resource — format and options endpoints for all services.
|
|
2
|
+
// Replaces FormatsResource (which only covered document translation formats).
|
|
3
|
+
import { FormatsResponseSchema, QeFormatsResponseSchema, DataScoreFormatsResponseSchema, DataAnnotateFormatsResponseSchema, AnnotateOptionsResponseSchema, } from "../models.js";
|
|
4
|
+
import { Endpoint } from "../../constants.js";
|
|
5
|
+
/**
|
|
6
|
+
* Discovery API resource for format/options discovery across all services.
|
|
7
|
+
*
|
|
8
|
+
* All endpoints are public (LIGHT rate limit), but use AuthSession for
|
|
9
|
+
* consistency with the existing resource pattern.
|
|
10
|
+
*/
|
|
11
|
+
export class DiscoveryResource {
|
|
12
|
+
session;
|
|
13
|
+
baseUrl;
|
|
14
|
+
constructor(session, baseUrl) {
|
|
15
|
+
this.session = session;
|
|
16
|
+
this.baseUrl = baseUrl;
|
|
17
|
+
}
|
|
18
|
+
/** Shared GET + Zod parse. Eliminates boilerplate across 5 discovery methods. */
|
|
19
|
+
async get(endpoint, schema) {
|
|
20
|
+
const data = await this.session.request("GET", `${this.baseUrl}${endpoint}`, {});
|
|
21
|
+
return schema.parse(data);
|
|
22
|
+
}
|
|
23
|
+
/** GET /v1/translation/document/formats — document translation formats. */
|
|
24
|
+
async documentFormats() {
|
|
25
|
+
const result = await this.get(Endpoint.DOCUMENT_FORMATS, FormatsResponseSchema);
|
|
26
|
+
return result.formats;
|
|
27
|
+
}
|
|
28
|
+
/** GET /v1/quality/score/formats — QE file scoring formats. */
|
|
29
|
+
async qeFormats() {
|
|
30
|
+
const result = await this.get(Endpoint.QE_FORMATS, QeFormatsResponseSchema);
|
|
31
|
+
return result.formats;
|
|
32
|
+
}
|
|
33
|
+
/** GET /v1/data/score/formats — Bicleaner scoring formats. */
|
|
34
|
+
async dataScoreFormats() {
|
|
35
|
+
return this.get(Endpoint.DATA_SCORE_FORMATS, DataScoreFormatsResponseSchema);
|
|
36
|
+
}
|
|
37
|
+
/** GET /v1/data/annotate/formats — annotation input formats. */
|
|
38
|
+
async dataAnnotateFormats() {
|
|
39
|
+
return this.get(Endpoint.DATA_ANNOTATE_FORMATS, DataAnnotateFormatsResponseSchema);
|
|
40
|
+
}
|
|
41
|
+
/** GET /v1/data/annotate/options — pipeline stages, LID models, defaults. */
|
|
42
|
+
async annotateOptions() {
|
|
43
|
+
return this.get(Endpoint.DATA_ANNOTATE_OPTIONS, AnnotateOptionsResponseSchema);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../../src/api/resources/discovery.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,8EAA8E;AAI9E,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,8BAA8B,EAC9B,iCAAiC,EACjC,6BAA6B,GAM9B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,OAAO,iBAAiB;IACX,OAAO,CAAc;IACrB,OAAO,CAAS;IAEjC,YAAY,OAAoB,EAAE,OAAe;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,iFAAiF;IACzE,KAAK,CAAC,GAAG,CAAI,QAAgB,EAAE,MAAoB;QACzD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAU,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,GAAG,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1F,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,2EAA2E;IAC3E,KAAK,CAAC,eAAe;QACnB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC;QAChF,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,+DAA+D;IAC/D,KAAK,CAAC,SAAS;QACb,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC,CAAC;QAC5E,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,8DAA8D;IAC9D,KAAK,CAAC,gBAAgB;QACpB,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,kBAAkB,EAAE,8BAA8B,CAAC,CAAC;IAC/E,CAAC;IAED,gEAAgE;IAChE,KAAK,CAAC,mBAAmB;QACvB,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,qBAAqB,EAAE,iCAAiC,CAAC,CAAC;IACrF,CAAC;IAED,6EAA6E;IAC7E,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,qBAAqB,EAAE,6BAA6B,CAAC,CAAC;IACjF,CAAC;CACF"}
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
import type { AuthSession } from "../auth-session.ts";
|
|
2
|
-
import { type EvaluationResponse, type
|
|
2
|
+
import { type EvaluationResponse, type EvaluateParams, type EvaluateFileParams, type EvaluateFileResult } from "../models.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Evaluation API resource.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* - evaluate(): POST /v1/quality/score (JSON inline, via AuthSession)
|
|
7
|
+
* - evaluateFile(): POST /v1/quality/score/file (multipart upload, binary response via requestRaw)
|
|
8
8
|
*/
|
|
9
9
|
export declare class EvaluationResource {
|
|
10
10
|
private readonly session;
|
|
11
11
|
private readonly baseUrl;
|
|
12
12
|
constructor(session: AuthSession, baseUrl: string);
|
|
13
|
+
/** Evaluate translation quality with specified metrics (inline segments). */
|
|
14
|
+
evaluate(params: EvaluateParams): Promise<EvaluationResponse>;
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
16
|
+
* Score a file via POST /v1/quality/score/file (multipart upload, binary response).
|
|
15
17
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @param aggregation - Aggregation mode (default "both" for corpus + segment)
|
|
19
|
-
* @returns Validated EvaluationResponse with corpus_scores and segment_scores
|
|
20
|
-
* @throws AuthenticationError if not authenticated
|
|
21
|
-
* @throws ZodError if response schema mismatch
|
|
22
|
-
* @throws APIError on API errors
|
|
18
|
+
* Uses requestRaw() (buffer + headers) because we need X-Corpus-Scores header.
|
|
19
|
+
* File size bounded by JOB_MAX_DOCUMENT_SIZE_MB (50MB) — safe to buffer.
|
|
23
20
|
*/
|
|
24
|
-
|
|
21
|
+
evaluateFile(params: EvaluateFileParams, outputPath: string, signal?: AbortSignal): Promise<EvaluateFileResult>;
|
|
25
22
|
}
|
|
26
23
|
//# sourceMappingURL=evaluation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluation.d.ts","sourceRoot":"","sources":["../../../src/api/resources/evaluation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evaluation.d.ts","sourceRoot":"","sources":["../../../src/api/resources/evaluation.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAGtB;;;;;GAKG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM;IAKjD,6EAA6E;IACvE,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAcnE;;;;;OAKG;IACG,YAAY,CAChB,MAAM,EAAE,kBAAkB,EAC1B,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,kBAAkB,CAAC;CA6B/B"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
import {
|
|
1
|
+
// Evaluation resource - POST /v1/quality/score (inline) + POST /v1/quality/score/file (file)
|
|
2
|
+
// Both methods go through AuthSession for auth, retry, hooks, and error classification.
|
|
3
|
+
import { openAsBlob } from "node:fs";
|
|
4
|
+
import { writeFile } from "node:fs/promises";
|
|
5
|
+
import { basename } from "node:path";
|
|
6
|
+
import { EvaluationResponseSchema, } from "../models.js";
|
|
4
7
|
import { Endpoint } from "../../constants.js";
|
|
5
8
|
/**
|
|
6
9
|
* Evaluation API resource.
|
|
7
10
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
11
|
+
* - evaluate(): POST /v1/quality/score (JSON inline, via AuthSession)
|
|
12
|
+
* - evaluateFile(): POST /v1/quality/score/file (multipart upload, binary response via requestRaw)
|
|
10
13
|
*/
|
|
11
14
|
export class EvaluationResource {
|
|
12
15
|
session;
|
|
@@ -15,24 +18,46 @@ export class EvaluationResource {
|
|
|
15
18
|
this.session = session;
|
|
16
19
|
this.baseUrl = baseUrl;
|
|
17
20
|
}
|
|
21
|
+
/** Evaluate translation quality with specified metrics (inline segments). */
|
|
22
|
+
async evaluate(params) {
|
|
23
|
+
const { segments, metrics, aggregation = "both" } = params;
|
|
24
|
+
const data = await this.session.request("POST", `${this.baseUrl}${Endpoint.EVALUATE}`, {
|
|
25
|
+
json: { segments, metrics, aggregation },
|
|
26
|
+
});
|
|
27
|
+
return EvaluationResponseSchema.parse(data);
|
|
28
|
+
}
|
|
18
29
|
/**
|
|
19
|
-
*
|
|
30
|
+
* Score a file via POST /v1/quality/score/file (multipart upload, binary response).
|
|
20
31
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* @param aggregation - Aggregation mode (default "both" for corpus + segment)
|
|
24
|
-
* @returns Validated EvaluationResponse with corpus_scores and segment_scores
|
|
25
|
-
* @throws AuthenticationError if not authenticated
|
|
26
|
-
* @throws ZodError if response schema mismatch
|
|
27
|
-
* @throws APIError on API errors
|
|
32
|
+
* Uses requestRaw() (buffer + headers) because we need X-Corpus-Scores header.
|
|
33
|
+
* File size bounded by JOB_MAX_DOCUMENT_SIZE_MB (50MB) — safe to buffer.
|
|
28
34
|
*/
|
|
29
|
-
async
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
async evaluateFile(params, outputPath, signal) {
|
|
36
|
+
const { filePath, metrics, aggregation = "both", outputFormat } = params;
|
|
37
|
+
const url = `${this.baseUrl}${Endpoint.EVALUATE_FILE}`;
|
|
38
|
+
// Build multipart form (openAsBlob streams from disk without buffering)
|
|
39
|
+
const fileBlob = await openAsBlob(filePath);
|
|
40
|
+
const formData = new FormData();
|
|
41
|
+
formData.append("file", fileBlob, basename(filePath));
|
|
42
|
+
if (metrics?.length)
|
|
43
|
+
formData.append("metrics", metrics.join(","));
|
|
44
|
+
formData.append("aggregation", aggregation);
|
|
45
|
+
if (outputFormat)
|
|
46
|
+
formData.append("output_format", outputFormat);
|
|
47
|
+
const response = await this.session.requestRaw("POST", url, { body: formData }, signal);
|
|
48
|
+
// Parse corpus scores from X-Corpus-Scores header
|
|
49
|
+
let corpusScores = {};
|
|
50
|
+
const scoresHeader = response.headers["x-corpus-scores"];
|
|
51
|
+
if (typeof scoresHeader === "string") {
|
|
52
|
+
try {
|
|
53
|
+
corpusScores = JSON.parse(scoresHeader);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
/* malformed header */
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
await writeFile(outputPath, response.body, { signal });
|
|
60
|
+
return { data: Buffer.alloc(0), filename: outputPath, corpusScores };
|
|
36
61
|
}
|
|
37
62
|
}
|
|
38
63
|
//# sourceMappingURL=evaluation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluation.js","sourceRoot":"","sources":["../../../src/api/resources/evaluation.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"evaluation.js","sourceRoot":"","sources":["../../../src/api/resources/evaluation.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,wFAAwF;AAExF,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,OAAO,EACL,wBAAwB,GAKzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IACZ,OAAO,CAAc;IACrB,OAAO,CAAS;IAEjC,YAAY,OAAoB,EAAE,OAAe;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,6EAA6E;IAC7E,KAAK,CAAC,QAAQ,CAAC,MAAsB;QACnC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;QAE3D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CACrC,MAAM,EACN,GAAG,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,QAAQ,EAAE,EACrC;YACE,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE;SACzC,CACF,CAAC;QAEF,OAAO,wBAAwB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,YAAY,CAChB,MAA0B,EAC1B,UAAkB,EAClB,MAAoB;QAEpB,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;QACzE,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,EAAE,CAAC;QAEvD,wEAAwE;QACxE,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC5C,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAChC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QACtD,IAAI,OAAO,EAAE,MAAM;YAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACnE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QAC5C,IAAI,YAAY;YAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;QAEjE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC;QAExF,kDAAkD;QAClD,IAAI,YAAY,GAA2B,EAAE,CAAC;QAC9C,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACzD,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;YACrC,IAAI,CAAC;gBACH,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAA2B,CAAC;YACpE,CAAC;YAAC,MAAM,CAAC;gBACP,sBAAsB;YACxB,CAAC;QACH,CAAC;QAED,MAAM,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAEvD,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;IACvE,CAAC;CACF"}
|
|
@@ -3,7 +3,7 @@ import { type FormatInfo } from "../models.ts";
|
|
|
3
3
|
/**
|
|
4
4
|
* Formats API resource.
|
|
5
5
|
*
|
|
6
|
-
* Calls GET /v1/formats via AuthSession (requires auth).
|
|
6
|
+
* Calls GET /v1/translation/document/formats via AuthSession (requires auth).
|
|
7
7
|
* Validates response with Zod schema at boundary.
|
|
8
8
|
*/
|
|
9
9
|
export declare class FormatsResource {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// See API-484: Formats resource - GET /v1/formats with Zod validation
|
|
1
|
+
// See API-484: Formats resource - GET /v1/translation/document/formats with Zod validation
|
|
2
2
|
// Uses AuthSession (authenticated requests with auto-refresh).
|
|
3
3
|
import { FormatsResponseSchema } from "../models.js";
|
|
4
4
|
import { Endpoint } from "../../constants.js";
|
|
5
5
|
/**
|
|
6
6
|
* Formats API resource.
|
|
7
7
|
*
|
|
8
|
-
* Calls GET /v1/formats via AuthSession (requires auth).
|
|
8
|
+
* Calls GET /v1/translation/document/formats via AuthSession (requires auth).
|
|
9
9
|
* Validates response with Zod schema at boundary.
|
|
10
10
|
*/
|
|
11
11
|
export class FormatsResource {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formats.js","sourceRoot":"","sources":["../../../src/api/resources/formats.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"formats.js","sourceRoot":"","sources":["../../../src/api/resources/formats.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,+DAA+D;AAG/D,OAAO,EAAE,qBAAqB,EAAmB,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,OAAO,eAAe;IACT,OAAO,CAAc;IACrB,OAAO,CAAS;IAEjC,YAAY,OAAoB,EAAE,OAAe;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI;QACR,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE7B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAU,KAAK,EAAE,GAAG,OAAO,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;QAE7F,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;CACF"}
|
|
@@ -19,17 +19,16 @@ export declare class JobsResource {
|
|
|
19
19
|
*/
|
|
20
20
|
cancel(jobId: string): Promise<void>;
|
|
21
21
|
/**
|
|
22
|
-
* Download job result to file
|
|
22
|
+
* Download job result to file via streaming.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
24
|
+
* Uses requestToFile() for memory-safe streaming (annotation jobs can be up to 10GB).
|
|
25
|
+
* Client owns output filenames — no Content-Disposition parsing.
|
|
26
26
|
*
|
|
27
27
|
* @param jobId - Job identifier
|
|
28
|
-
* @param outputPath -
|
|
29
|
-
* @
|
|
30
|
-
* @
|
|
31
|
-
* @throws APIError on API errors (404 not found, job not completed)
|
|
28
|
+
* @param outputPath - Output file path (computed by resolveOutputPaths)
|
|
29
|
+
* @param signal - Optional abort signal for cancellation
|
|
30
|
+
* @returns The output path
|
|
32
31
|
*/
|
|
33
|
-
download(jobId: string, outputPath: string): Promise<string>;
|
|
32
|
+
download(jobId: string, outputPath: string, signal?: AbortSignal): Promise<string>;
|
|
34
33
|
}
|
|
35
34
|
//# sourceMappingURL=jobs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../../../src/api/resources/jobs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../../../src/api/resources/jobs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAG/E;;;;;GAKG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM;IAKjD;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IASvD;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO1C;;;;;;;;;;OAUG;IACG,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;CAMzF"}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
// Jobs resource - status, cancel, download with Zod validation
|
|
2
2
|
// Used by translate file and data commands for job lifecycle.
|
|
3
|
-
//
|
|
4
|
-
import { createWriteStream } from "node:fs";
|
|
5
|
-
import { rename } from "node:fs/promises";
|
|
6
|
-
import { pipeline } from "node:stream/promises";
|
|
7
|
-
import { extname, dirname, basename, join } from "node:path";
|
|
8
|
-
import got from "got";
|
|
3
|
+
// All methods go through AuthSession for auth, retry, hooks, and error classification.
|
|
9
4
|
import { JobStatusResponseSchema } from "../models.js";
|
|
10
|
-
import {
|
|
11
|
-
import { Endpoint, HEADER_AUTHORIZATION, BEARER_PREFIX } from "../../constants.js";
|
|
5
|
+
import { Endpoint } from "../../constants.js";
|
|
12
6
|
/**
|
|
13
7
|
* Jobs API resource.
|
|
14
8
|
*
|
|
@@ -40,53 +34,20 @@ export class JobsResource {
|
|
|
40
34
|
await this.session.request("DELETE", url);
|
|
41
35
|
}
|
|
42
36
|
/**
|
|
43
|
-
* Download job result to file
|
|
37
|
+
* Download job result to file via streaming.
|
|
44
38
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
39
|
+
* Uses requestToFile() for memory-safe streaming (annotation jobs can be up to 10GB).
|
|
40
|
+
* Client owns output filenames — no Content-Disposition parsing.
|
|
47
41
|
*
|
|
48
42
|
* @param jobId - Job identifier
|
|
49
|
-
* @param outputPath -
|
|
50
|
-
* @
|
|
51
|
-
* @
|
|
52
|
-
* @throws APIError on API errors (404 not found, job not completed)
|
|
43
|
+
* @param outputPath - Output file path (computed by resolveOutputPaths)
|
|
44
|
+
* @param signal - Optional abort signal for cancellation
|
|
45
|
+
* @returns The output path
|
|
53
46
|
*/
|
|
54
|
-
async download(jobId, outputPath) {
|
|
47
|
+
async download(jobId, outputPath, signal) {
|
|
55
48
|
const baseUrl = this.baseUrl;
|
|
56
49
|
const url = `${baseUrl}${Endpoint.JOB_RESULT.replace("{job_id}", jobId)}`;
|
|
57
|
-
|
|
58
|
-
// Cannot use session.request because transport forces responseType:"json".
|
|
59
|
-
const token = getAccessToken();
|
|
60
|
-
const headers = {};
|
|
61
|
-
if (token) {
|
|
62
|
-
headers[HEADER_AUTHORIZATION] = `${BEARER_PREFIX} ${token}`;
|
|
63
|
-
}
|
|
64
|
-
// Stream to initial output path, then rename if Content-Disposition indicates
|
|
65
|
-
// a different extension (e.g., PDF input converted to DOCX output).
|
|
66
|
-
let actualPath = outputPath;
|
|
67
|
-
const stream = got.stream(url, { method: "GET", headers });
|
|
68
|
-
// Listen for response event to parse Content-Disposition before streaming body
|
|
69
|
-
stream.on("response", (response) => {
|
|
70
|
-
const cd = response.headers["content-disposition"] ?? "";
|
|
71
|
-
if (cd.includes("filename=")) {
|
|
72
|
-
const match = /filename="?([^";\s]+)"?/.exec(cd);
|
|
73
|
-
if (match) {
|
|
74
|
-
const serverExt = extname(match[1]);
|
|
75
|
-
if (serverExt && serverExt !== extname(outputPath)) {
|
|
76
|
-
const base = basename(outputPath, extname(outputPath));
|
|
77
|
-
actualPath = join(dirname(outputPath), `${base}${serverExt}`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
// Stream response body to file via pipeline (backpressure-aware)
|
|
83
|
-
const fileStream = createWriteStream(outputPath);
|
|
84
|
-
await pipeline(stream, fileStream);
|
|
85
|
-
// If Content-Disposition indicated a different extension, rename the file
|
|
86
|
-
if (actualPath !== outputPath) {
|
|
87
|
-
await rename(outputPath, actualPath);
|
|
88
|
-
}
|
|
89
|
-
return actualPath;
|
|
50
|
+
return this.session.requestToFile("GET", url, outputPath, {}, signal);
|
|
90
51
|
}
|
|
91
52
|
}
|
|
92
53
|
//# sourceMappingURL=jobs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../../src/api/resources/jobs.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,8DAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../../src/api/resources/jobs.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,8DAA8D;AAC9D,uFAAuF;AAGvF,OAAO,EAAE,uBAAuB,EAA0B,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,OAAO,YAAY;IACN,OAAO,CAAc;IACrB,OAAO,CAAS;IAEjC,YAAY,OAAoB,EAAE,OAAe;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,KAAa;QACxB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,MAAM,GAAG,GAAG,GAAG,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;QAEnE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAU,KAAK,EAAE,GAAG,CAAC,CAAC;QAE7D,OAAO,uBAAuB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,KAAa;QACxB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,MAAM,GAAG,GAAG,GAAG,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;QAEnE,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAU,QAAQ,EAAE,GAAG,CAAC,CAAC;IACrD,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,QAAQ,CAAC,KAAa,EAAE,UAAkB,EAAE,MAAoB;QACpE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,MAAM,GAAG,GAAG,GAAG,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;QAE1E,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;IACxE,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AuthSession } from "../auth-session.ts";
|
|
2
|
+
import { type LanguagePairDetail } from "../models.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Languages API resource.
|
|
5
|
+
*
|
|
6
|
+
* Calls GET /v1/translation/languages via AuthSession (requires auth).
|
|
7
|
+
* Validates response with Zod schema at boundary.
|
|
8
|
+
*/
|
|
9
|
+
export declare class LanguagesResource {
|
|
10
|
+
private readonly session;
|
|
11
|
+
private readonly baseUrl;
|
|
12
|
+
constructor(session: AuthSession, baseUrl: string);
|
|
13
|
+
/**
|
|
14
|
+
* List available language pairs.
|
|
15
|
+
*
|
|
16
|
+
* @param source - Optional source language code filter (BCP 47)
|
|
17
|
+
* @param target - Optional target language code filter (BCP 47)
|
|
18
|
+
* @returns Validated array of LanguagePairDetail objects
|
|
19
|
+
* @throws AuthenticationError if not authenticated
|
|
20
|
+
* @throws ZodError if response schema mismatch
|
|
21
|
+
* @throws APIError on API errors
|
|
22
|
+
*/
|
|
23
|
+
list(source?: string, target?: string): Promise<LanguagePairDetail[]>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=languages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../../src/api/resources/languages.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAA4B,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGjF;;;;;GAKG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM;IAKjD;;;;;;;;;OASG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;CAiB5E"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Languages resource - GET /v1/translation/languages with Zod validation
|
|
2
|
+
// Uses AuthSession (authenticated requests with auto-refresh).
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { LanguagePairDetailSchema } from "../models.js";
|
|
5
|
+
import { Endpoint } from "../../constants.js";
|
|
6
|
+
/**
|
|
7
|
+
* Languages API resource.
|
|
8
|
+
*
|
|
9
|
+
* Calls GET /v1/translation/languages via AuthSession (requires auth).
|
|
10
|
+
* Validates response with Zod schema at boundary.
|
|
11
|
+
*/
|
|
12
|
+
export class LanguagesResource {
|
|
13
|
+
session;
|
|
14
|
+
baseUrl;
|
|
15
|
+
constructor(session, baseUrl) {
|
|
16
|
+
this.session = session;
|
|
17
|
+
this.baseUrl = baseUrl;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* List available language pairs.
|
|
21
|
+
*
|
|
22
|
+
* @param source - Optional source language code filter (BCP 47)
|
|
23
|
+
* @param target - Optional target language code filter (BCP 47)
|
|
24
|
+
* @returns Validated array of LanguagePairDetail objects
|
|
25
|
+
* @throws AuthenticationError if not authenticated
|
|
26
|
+
* @throws ZodError if response schema mismatch
|
|
27
|
+
* @throws APIError on API errors
|
|
28
|
+
*/
|
|
29
|
+
async list(source, target) {
|
|
30
|
+
const baseUrl = this.baseUrl;
|
|
31
|
+
const params = {};
|
|
32
|
+
if (source) {
|
|
33
|
+
params.source = source;
|
|
34
|
+
}
|
|
35
|
+
if (target) {
|
|
36
|
+
params.target = target;
|
|
37
|
+
}
|
|
38
|
+
const data = await this.session.request("GET", `${baseUrl}${Endpoint.LANGUAGES}`, {
|
|
39
|
+
searchParams: params,
|
|
40
|
+
});
|
|
41
|
+
return z.array(LanguagePairDetailSchema).parse(data);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=languages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.js","sourceRoot":"","sources":["../../../src/api/resources/languages.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,+DAA+D;AAE/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,wBAAwB,EAA2B,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,OAAO,iBAAiB;IACX,OAAO,CAAc;IACrB,OAAO,CAAS;IAEjC,YAAY,OAAoB,EAAE,OAAe;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,IAAI,CAAC,MAAe,EAAE,MAAe;QACzC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE7B,MAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QACzB,CAAC;QACD,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QACzB,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAU,KAAK,EAAE,GAAG,OAAO,GAAG,QAAQ,CAAC,SAAS,EAAE,EAAE;YACzF,YAAY,EAAE,MAAM;SACrB,CAAC,CAAC;QAEH,OAAO,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { AuthSession } from "../auth-session.ts";
|
|
2
|
-
import { type TranslationResponse, type DocJobCreateResponse } from "../models.ts";
|
|
2
|
+
import { type TranslationResponse, type DocJobCreateResponse, type TranslateParams, type UploadDocumentParams } from "../models.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Translation API resource.
|
|
5
5
|
*
|
|
6
|
-
* Calls POST /v1/
|
|
6
|
+
* Calls POST /v1/translation via AuthSession (requires auth).
|
|
7
7
|
* Validates response with Zod schema at boundary.
|
|
8
|
-
* - translate(): POST /v1/
|
|
9
|
-
* - uploadDocument(): POST /v1/
|
|
8
|
+
* - translate(): POST /v1/translation (text translation)
|
|
9
|
+
* - uploadDocument(): POST /v1/translation/document (async file processing)
|
|
10
10
|
*/
|
|
11
11
|
export declare class TranslationResource {
|
|
12
12
|
private readonly session;
|
|
@@ -15,32 +15,24 @@ export declare class TranslationResource {
|
|
|
15
15
|
/**
|
|
16
16
|
* Translate texts via API.
|
|
17
17
|
*
|
|
18
|
-
* @param
|
|
19
|
-
* @param sourceLang - Source language code
|
|
20
|
-
* @param targetLang - Target language code
|
|
21
|
-
* @param enableQe - Enable quality estimation scores (default false)
|
|
18
|
+
* @param params - Translation parameters (texts, languages, QE flag)
|
|
22
19
|
* @returns Validated TranslationResponse
|
|
23
20
|
* @throws AuthenticationError if not authenticated
|
|
24
21
|
* @throws ZodError if response schema mismatch
|
|
25
22
|
* @throws APIError on API errors (422 invalid lang pair, etc.)
|
|
26
23
|
*/
|
|
27
|
-
translate(
|
|
24
|
+
translate(params: TranslateParams): Promise<TranslationResponse>;
|
|
28
25
|
/**
|
|
29
26
|
* Upload document for async translation.
|
|
30
27
|
*
|
|
31
28
|
* Sends multipart/form-data POST with file + metadata fields.
|
|
32
29
|
* Uses openAsBlob for memory-efficient streaming from disk.
|
|
33
30
|
*
|
|
34
|
-
* @param
|
|
35
|
-
* @param sourceLang - Source language code
|
|
36
|
-
* @param targetLang - Target language code
|
|
37
|
-
* @param options - Optional upload parameters
|
|
31
|
+
* @param params - Upload parameters (file path, languages, output format)
|
|
38
32
|
* @returns Validated DocJobCreateResponse with job_id for tracking
|
|
39
33
|
* @throws AuthenticationError if not authenticated
|
|
40
34
|
* @throws APIError on API errors (422 unsupported format, 413 file too large)
|
|
41
35
|
*/
|
|
42
|
-
uploadDocument(
|
|
43
|
-
outputFormat?: string;
|
|
44
|
-
}): Promise<DocJobCreateResponse>;
|
|
36
|
+
uploadDocument(params: UploadDocumentParams): Promise<DocJobCreateResponse>;
|
|
45
37
|
}
|
|
46
38
|
//# sourceMappingURL=translation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../../src/api/resources/translation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAEL,KAAK,mBAAmB,EAExB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AAKtB;;;;;;;GAOG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM;IAKjD
|
|
1
|
+
{"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../../src/api/resources/translation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAEL,KAAK,mBAAmB,EAExB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AAKtB;;;;;;;GAOG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM;IAKjD;;;;;;;;OAQG;IACG,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAqBtE;;;;;;;;;;OAUG;IACG,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAwBlF"}
|
|
@@ -7,10 +7,10 @@ import { basename } from "node:path";
|
|
|
7
7
|
/**
|
|
8
8
|
* Translation API resource.
|
|
9
9
|
*
|
|
10
|
-
* Calls POST /v1/
|
|
10
|
+
* Calls POST /v1/translation via AuthSession (requires auth).
|
|
11
11
|
* Validates response with Zod schema at boundary.
|
|
12
|
-
* - translate(): POST /v1/
|
|
13
|
-
* - uploadDocument(): POST /v1/
|
|
12
|
+
* - translate(): POST /v1/translation (text translation)
|
|
13
|
+
* - uploadDocument(): POST /v1/translation/document (async file processing)
|
|
14
14
|
*/
|
|
15
15
|
export class TranslationResource {
|
|
16
16
|
session;
|
|
@@ -22,16 +22,14 @@ export class TranslationResource {
|
|
|
22
22
|
/**
|
|
23
23
|
* Translate texts via API.
|
|
24
24
|
*
|
|
25
|
-
* @param
|
|
26
|
-
* @param sourceLang - Source language code
|
|
27
|
-
* @param targetLang - Target language code
|
|
28
|
-
* @param enableQe - Enable quality estimation scores (default false)
|
|
25
|
+
* @param params - Translation parameters (texts, languages, QE flag)
|
|
29
26
|
* @returns Validated TranslationResponse
|
|
30
27
|
* @throws AuthenticationError if not authenticated
|
|
31
28
|
* @throws ZodError if response schema mismatch
|
|
32
29
|
* @throws APIError on API errors (422 invalid lang pair, etc.)
|
|
33
30
|
*/
|
|
34
|
-
async translate(
|
|
31
|
+
async translate(params) {
|
|
32
|
+
const { texts, sourceLang, targetLang, enableQe = false } = params;
|
|
35
33
|
const baseUrl = this.baseUrl;
|
|
36
34
|
const body = {
|
|
37
35
|
texts,
|
|
@@ -52,15 +50,13 @@ export class TranslationResource {
|
|
|
52
50
|
* Sends multipart/form-data POST with file + metadata fields.
|
|
53
51
|
* Uses openAsBlob for memory-efficient streaming from disk.
|
|
54
52
|
*
|
|
55
|
-
* @param
|
|
56
|
-
* @param sourceLang - Source language code
|
|
57
|
-
* @param targetLang - Target language code
|
|
58
|
-
* @param options - Optional upload parameters
|
|
53
|
+
* @param params - Upload parameters (file path, languages, output format)
|
|
59
54
|
* @returns Validated DocJobCreateResponse with job_id for tracking
|
|
60
55
|
* @throws AuthenticationError if not authenticated
|
|
61
56
|
* @throws APIError on API errors (422 unsupported format, 413 file too large)
|
|
62
57
|
*/
|
|
63
|
-
async uploadDocument(
|
|
58
|
+
async uploadDocument(params) {
|
|
59
|
+
const { filePath, sourceLang, targetLang, outputFormat } = params;
|
|
64
60
|
const baseUrl = this.baseUrl;
|
|
65
61
|
// See API-494: openAsBlob streams from disk without buffering entire file
|
|
66
62
|
const fileBlob = await openAsBlob(filePath);
|
|
@@ -69,8 +65,8 @@ export class TranslationResource {
|
|
|
69
65
|
formData.append("file", fileBlob, fileName);
|
|
70
66
|
formData.append("source_lang", sourceLang);
|
|
71
67
|
formData.append("target_lang", targetLang);
|
|
72
|
-
if (
|
|
73
|
-
formData.append("output_format",
|
|
68
|
+
if (outputFormat) {
|
|
69
|
+
formData.append("output_format", outputFormat);
|
|
74
70
|
}
|
|
75
71
|
const data = await this.session.request("POST", `${baseUrl}${Endpoint.DOCUMENT_TRANSLATE}`, { body: formData });
|
|
76
72
|
return DocJobCreateResponseSchema.parse(data);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.js","sourceRoot":"","sources":["../../../src/api/resources/translation.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,+DAA+D;AAG/D,OAAO,EACL,yBAAyB,EAEzB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"translation.js","sourceRoot":"","sources":["../../../src/api/resources/translation.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,+DAA+D;AAG/D,OAAO,EACL,yBAAyB,EAEzB,0BAA0B,GAI3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,OAAO,mBAAmB;IACb,OAAO,CAAc;IACrB,OAAO,CAAS;IAEjC,YAAY,OAAoB,EAAE,OAAe;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,SAAS,CAAC,MAAuB;QACrC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACnE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE7B,MAAM,IAAI,GAA4B;YACpC,KAAK;YACL,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,UAAU;SACxB,CAAC;QAEF,gDAAgD;QAChD,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAE3D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAU,MAAM,EAAE,GAAG,OAAO,GAAG,QAAQ,CAAC,SAAS,EAAE,EAAE;YAC1F,IAAI,EAAE,IAAI;YACV,YAAY;SACb,CAAC,CAAC;QAEH,OAAO,yBAAyB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,cAAc,CAAC,MAA4B;QAC/C,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;QAClE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE7B,0EAA0E;QAC1E,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC5C,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEpC,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAChC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC5C,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QAC3C,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QAC3C,IAAI,YAAY,EAAE,CAAC;YACjB,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CACrC,MAAM,EACN,GAAG,OAAO,GAAG,QAAQ,CAAC,kBAAkB,EAAE,EAC1C,EAAE,IAAI,EAAE,QAAQ,EAAE,CACnB,CAAC;QAEF,OAAO,0BAA0B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;CACF"}
|