@azure-rest/ai-translation-document 1.0.0-beta.2 → 1.0.0
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/CHANGELOG.md +6 -0
- package/README.md +8 -0
- package/dist/index.js +30 -21
- package/dist/index.js.map +1 -1
- package/dist-esm/src/clientDefinitions.js +1 -1
- package/dist-esm/src/clientDefinitions.js.map +1 -1
- package/dist-esm/src/documentTranslationClient.js +20 -6
- package/dist-esm/src/documentTranslationClient.js.map +1 -1
- package/dist-esm/src/index.js +2 -1
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/isUnexpected.js +1 -1
- package/dist-esm/src/isUnexpected.js.map +1 -1
- package/dist-esm/src/logger.js +2 -0
- package/dist-esm/src/logger.js.map +1 -1
- package/dist-esm/src/models.js +1 -1
- package/dist-esm/src/models.js.map +1 -1
- package/dist-esm/src/outputModels.js +1 -1
- package/dist-esm/src/outputModels.js.map +1 -1
- package/dist-esm/src/paginateHelper.js +1 -1
- package/dist-esm/src/paginateHelper.js.map +1 -1
- package/dist-esm/src/parameters.js +1 -1
- package/dist-esm/src/parameters.js.map +1 -1
- package/dist-esm/src/pollingHelper.js +5 -5
- package/dist-esm/src/pollingHelper.js.map +1 -1
- package/dist-esm/src/responses.js +1 -1
- package/dist-esm/src/responses.js.map +1 -1
- package/package.json +30 -36
- package/types/ai-translation-document.d.ts +80 -51
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { PathUncheckedResponse } from '@azure-rest/core-client';
|
|
18
|
-
import { RawHttpHeaders } from '@azure/core-rest-pipeline';
|
|
19
|
-
import { RawHttpHeadersInput } from '@azure/core-rest-pipeline';
|
|
20
|
-
import { RequestParameters } from '@azure-rest/core-client';
|
|
21
|
-
import { StreamableMethod } from '@azure-rest/core-client';
|
|
22
|
-
import { TokenCredential } from '@azure/core-auth';
|
|
1
|
+
import type { AbortSignalLike } from '@azure/abort-controller';
|
|
2
|
+
import type { CancelOnProgress } from '@azure/core-lro';
|
|
3
|
+
import type { Client } from '@azure-rest/core-client';
|
|
4
|
+
import type { ClientOptions } from '@azure-rest/core-client';
|
|
5
|
+
import type { CreateHttpPollerOptions } from '@azure/core-lro';
|
|
6
|
+
import type { ErrorResponse } from '@azure-rest/core-client';
|
|
7
|
+
import type { HttpResponse } from '@azure-rest/core-client';
|
|
8
|
+
import type { KeyCredential } from '@azure/core-auth';
|
|
9
|
+
import type { OperationState } from '@azure/core-lro';
|
|
10
|
+
import type { PagedAsyncIterableIterator } from '@azure/core-paging';
|
|
11
|
+
import type { PathUncheckedResponse } from '@azure-rest/core-client';
|
|
12
|
+
import type { RawHttpHeaders } from '@azure/core-rest-pipeline';
|
|
13
|
+
import type { RawHttpHeadersInput } from '@azure/core-rest-pipeline';
|
|
14
|
+
import type { RequestParameters } from '@azure-rest/core-client';
|
|
15
|
+
import type { StreamableMethod } from '@azure-rest/core-client';
|
|
16
|
+
import type { TokenCredential } from '@azure/core-auth';
|
|
23
17
|
|
|
24
18
|
/** Definition for the input batch translation request */
|
|
25
19
|
export declare interface BatchRequest {
|
|
@@ -27,7 +21,11 @@ export declare interface BatchRequest {
|
|
|
27
21
|
source: SourceInput;
|
|
28
22
|
/** Location of the destination for the output */
|
|
29
23
|
targets: Array<TargetInput>;
|
|
30
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Storage type of the input documents source string
|
|
26
|
+
*
|
|
27
|
+
* Possible values: "Folder", "File"
|
|
28
|
+
*/
|
|
31
29
|
storageType?: StorageInputType;
|
|
32
30
|
}
|
|
33
31
|
|
|
@@ -56,17 +54,9 @@ export declare type CancelTranslationParameters = RequestParameters;
|
|
|
56
54
|
* @param credentials - uniquely identify client credential
|
|
57
55
|
* @param options - the parameter for all optional parameters
|
|
58
56
|
*/
|
|
59
|
-
declare function createClient(endpointParam: string, credentials: TokenCredential | KeyCredential, options?:
|
|
57
|
+
declare function createClient(endpointParam: string, credentials: TokenCredential | KeyCredential, { apiVersion, ...options }?: DocumentTranslationClientOptions): DocumentTranslationClient;
|
|
60
58
|
export default createClient;
|
|
61
59
|
|
|
62
|
-
export { createFile }
|
|
63
|
-
|
|
64
|
-
export { createFileFromStream }
|
|
65
|
-
|
|
66
|
-
export { CreateFileFromStreamOptions }
|
|
67
|
-
|
|
68
|
-
export { CreateFileOptions }
|
|
69
|
-
|
|
70
60
|
/** Document filter */
|
|
71
61
|
export declare interface DocumentFilter {
|
|
72
62
|
/**
|
|
@@ -102,7 +92,11 @@ export declare interface DocumentStatusOutput {
|
|
|
102
92
|
createdDateTimeUtc: string;
|
|
103
93
|
/** Date time in which the operation's status has been updated */
|
|
104
94
|
lastActionDateTimeUtc: string;
|
|
105
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* List of possible statuses for job or document
|
|
97
|
+
*
|
|
98
|
+
* Possible values: "NotStarted", "Running", "Succeeded", "Failed", "Cancelled", "Cancelling", "ValidationFailed"
|
|
99
|
+
*/
|
|
106
100
|
status: StatusOutput;
|
|
107
101
|
/** To language */
|
|
108
102
|
to: string;
|
|
@@ -127,6 +121,8 @@ export declare interface DocumentTranslate {
|
|
|
127
121
|
export declare interface DocumentTranslate200Headers {
|
|
128
122
|
/** An opaque, globally-unique, client-generated string identifier for the request. */
|
|
129
123
|
"x-ms-client-request-id"?: string;
|
|
124
|
+
/** response content type */
|
|
125
|
+
"content-type": "application/octet-stream";
|
|
130
126
|
}
|
|
131
127
|
|
|
132
128
|
/** The request has succeeded. */
|
|
@@ -138,7 +134,8 @@ export declare interface DocumentTranslate200Response extends HttpResponse {
|
|
|
138
134
|
}
|
|
139
135
|
|
|
140
136
|
export declare interface DocumentTranslateBodyParam {
|
|
141
|
-
|
|
137
|
+
/** Document Translate Request Content */
|
|
138
|
+
body: DocumentTranslateContent;
|
|
142
139
|
}
|
|
143
140
|
|
|
144
141
|
/** Document Translate Request Content */
|
|
@@ -219,6 +216,12 @@ export declare type DocumentTranslationClient = Client & {
|
|
|
219
216
|
path: Routes;
|
|
220
217
|
};
|
|
221
218
|
|
|
219
|
+
/** The optional parameters for the client */
|
|
220
|
+
export declare interface DocumentTranslationClientOptions extends ClientOptions {
|
|
221
|
+
/** The api version option of the client */
|
|
222
|
+
apiVersion?: string;
|
|
223
|
+
}
|
|
224
|
+
|
|
222
225
|
/** File Format */
|
|
223
226
|
export declare interface FileFormatOutput {
|
|
224
227
|
/** Name of the format */
|
|
@@ -236,7 +239,7 @@ export declare interface FileFormatOutput {
|
|
|
236
239
|
}
|
|
237
240
|
|
|
238
241
|
/** Alias for FileFormatType */
|
|
239
|
-
export declare type FileFormatType =
|
|
242
|
+
export declare type FileFormatType = string;
|
|
240
243
|
|
|
241
244
|
/**
|
|
242
245
|
* Helper type to extract the type of an array
|
|
@@ -451,7 +454,11 @@ export declare interface GetSupportedFormatsQueryParam {
|
|
|
451
454
|
}
|
|
452
455
|
|
|
453
456
|
export declare interface GetSupportedFormatsQueryParamProperties {
|
|
454
|
-
/**
|
|
457
|
+
/**
|
|
458
|
+
* the type of format like document or glossary
|
|
459
|
+
*
|
|
460
|
+
* Possible values: "document", "glossary"
|
|
461
|
+
*/
|
|
455
462
|
type?: FileFormatType;
|
|
456
463
|
}
|
|
457
464
|
|
|
@@ -588,7 +595,11 @@ export declare interface Glossary {
|
|
|
588
595
|
format: string;
|
|
589
596
|
/** Optional Version. If not specified, default is used. */
|
|
590
597
|
version?: string;
|
|
591
|
-
/**
|
|
598
|
+
/**
|
|
599
|
+
* Storage Source
|
|
600
|
+
*
|
|
601
|
+
* Possible values: "AzureBlob"
|
|
602
|
+
*/
|
|
592
603
|
storageSource?: StorageSource;
|
|
593
604
|
}
|
|
594
605
|
|
|
@@ -693,10 +704,6 @@ export declare interface SimplePollerLike<TState extends OperationState<TResult>
|
|
|
693
704
|
* Returns true if the poller has finished polling.
|
|
694
705
|
*/
|
|
695
706
|
isDone(): boolean;
|
|
696
|
-
/**
|
|
697
|
-
* Returns true if the poller is stopped.
|
|
698
|
-
*/
|
|
699
|
-
isStopped(): boolean;
|
|
700
707
|
/**
|
|
701
708
|
* Returns the state of the operation.
|
|
702
709
|
*/
|
|
@@ -747,6 +754,11 @@ export declare interface SimplePollerLike<TState extends OperationState<TResult>
|
|
|
747
754
|
* @deprecated Use abortSignal to stop polling instead.
|
|
748
755
|
*/
|
|
749
756
|
stopPolling(): void;
|
|
757
|
+
/**
|
|
758
|
+
* Returns true if the poller is stopped.
|
|
759
|
+
* @deprecated Use abortSignal status to track this instead.
|
|
760
|
+
*/
|
|
761
|
+
isStopped(): boolean;
|
|
750
762
|
}
|
|
751
763
|
|
|
752
764
|
/** Source of the input documents */
|
|
@@ -760,7 +772,11 @@ export declare interface SourceInput {
|
|
|
760
772
|
* If none is specified, we will perform auto detect on the document
|
|
761
773
|
*/
|
|
762
774
|
language?: string;
|
|
763
|
-
/**
|
|
775
|
+
/**
|
|
776
|
+
* Storage Source
|
|
777
|
+
*
|
|
778
|
+
* Possible values: "AzureBlob"
|
|
779
|
+
*/
|
|
764
780
|
storageSource?: StorageSource;
|
|
765
781
|
}
|
|
766
782
|
|
|
@@ -786,7 +802,7 @@ export declare interface StartTranslation {
|
|
|
786
802
|
* destination, it will be overwritten. The targetUrl for each target language
|
|
787
803
|
* must be unique.
|
|
788
804
|
*/
|
|
789
|
-
post(options
|
|
805
|
+
post(options: StartTranslationParameters): StreamableMethod<StartTranslation202Response | StartTranslationDefaultResponse>;
|
|
790
806
|
/**
|
|
791
807
|
* Returns a list of batch requests submitted and the status for each
|
|
792
808
|
* request.
|
|
@@ -856,7 +872,8 @@ export declare interface StartTranslation202Response extends HttpResponse {
|
|
|
856
872
|
}
|
|
857
873
|
|
|
858
874
|
export declare interface StartTranslationBodyParam {
|
|
859
|
-
|
|
875
|
+
/** Translation job submission batch request */
|
|
876
|
+
body: StartTranslationDetails;
|
|
860
877
|
}
|
|
861
878
|
|
|
862
879
|
export declare interface StartTranslationDefaultHeaders {
|
|
@@ -884,7 +901,7 @@ export declare interface StartTranslationLogicalResponse extends HttpResponse {
|
|
|
884
901
|
export declare type StartTranslationParameters = StartTranslationBodyParam & RequestParameters;
|
|
885
902
|
|
|
886
903
|
/** Alias for StatusOutput */
|
|
887
|
-
export declare type StatusOutput =
|
|
904
|
+
export declare type StatusOutput = string;
|
|
888
905
|
|
|
889
906
|
/** Status Summary */
|
|
890
907
|
export declare interface StatusSummaryOutput {
|
|
@@ -905,10 +922,10 @@ export declare interface StatusSummaryOutput {
|
|
|
905
922
|
}
|
|
906
923
|
|
|
907
924
|
/** Alias for StorageInputType */
|
|
908
|
-
export declare type StorageInputType =
|
|
925
|
+
export declare type StorageInputType = string;
|
|
909
926
|
|
|
910
927
|
/** Alias for StorageSource */
|
|
911
|
-
export declare type StorageSource =
|
|
928
|
+
export declare type StorageSource = string;
|
|
912
929
|
|
|
913
930
|
/** List of supported file formats */
|
|
914
931
|
export declare interface SupportedFileFormatsOutput {
|
|
@@ -926,19 +943,27 @@ export declare interface TargetInput {
|
|
|
926
943
|
language: string;
|
|
927
944
|
/** List of Glossary */
|
|
928
945
|
glossaries?: Array<Glossary>;
|
|
929
|
-
/**
|
|
946
|
+
/**
|
|
947
|
+
* Storage Source
|
|
948
|
+
*
|
|
949
|
+
* Possible values: "AzureBlob"
|
|
950
|
+
*/
|
|
930
951
|
storageSource?: StorageSource;
|
|
931
952
|
}
|
|
932
953
|
|
|
933
954
|
/** Alias for TranslationErrorCodeOutput */
|
|
934
|
-
export declare type TranslationErrorCodeOutput =
|
|
955
|
+
export declare type TranslationErrorCodeOutput = string;
|
|
935
956
|
|
|
936
957
|
/**
|
|
937
958
|
* This contains an outer error with error code, message, details, target and an
|
|
938
959
|
* inner error with more descriptive details.
|
|
939
960
|
*/
|
|
940
961
|
export declare interface TranslationErrorOutput {
|
|
941
|
-
/**
|
|
962
|
+
/**
|
|
963
|
+
* Enums containing high level error codes.
|
|
964
|
+
*
|
|
965
|
+
* Possible values: "InvalidRequest", "InvalidArgument", "InternalServerError", "ServiceUnavailable", "ResourceNotFound", "Unauthorized", "RequestRateTooHigh"
|
|
966
|
+
*/
|
|
942
967
|
code: TranslationErrorCodeOutput;
|
|
943
968
|
/** Gets high level error message. */
|
|
944
969
|
message: string;
|
|
@@ -975,7 +1000,11 @@ export declare interface TranslationStatusOutput {
|
|
|
975
1000
|
createdDateTimeUtc: string;
|
|
976
1001
|
/** Date time in which the operation's status has been updated */
|
|
977
1002
|
lastActionDateTimeUtc: string;
|
|
978
|
-
/**
|
|
1003
|
+
/**
|
|
1004
|
+
* List of possible statuses for job or document
|
|
1005
|
+
*
|
|
1006
|
+
* Possible values: "NotStarted", "Running", "Succeeded", "Failed", "Cancelled", "Cancelling", "ValidationFailed"
|
|
1007
|
+
*/
|
|
979
1008
|
status: StatusOutput;
|
|
980
1009
|
/**
|
|
981
1010
|
* This contains an outer error with error code, message, details, target and an
|