@azure/ai-language-text 1.1.0-alpha.20230126.1 → 1.1.0-alpha.20230223.3
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/dist/index.js +23 -14
- package/dist/index.js.map +1 -1
- package/dist-esm/src/lro.js +23 -14
- package/dist-esm/src/lro.js.map +1 -1
- package/package.json +2 -2
package/dist-esm/src/lro.js
CHANGED
@@ -22,13 +22,24 @@ const jobStatusOperationSpec = {
|
|
22
22
|
queryParameters: [Parameters.top, Parameters.skip, Parameters.includeStatistics],
|
23
23
|
serializer,
|
24
24
|
};
|
25
|
+
function addOnResponse(options, cb) {
|
26
|
+
return Object.assign(Object.assign({}, options), { onResponse: (rawResponse, response, error) => {
|
27
|
+
var _a;
|
28
|
+
cb(rawResponse, response, error);
|
29
|
+
(_a = options.onResponse) === null || _a === void 0 ? void 0 : _a.call(options, rawResponse, response, error);
|
30
|
+
} });
|
31
|
+
}
|
32
|
+
function logWarnHeader(rawResponse) {
|
33
|
+
const warnHeader = rawResponse.headers.get("warn-text");
|
34
|
+
if (warnHeader) {
|
35
|
+
warnHeader.split(";").map((x) => logger.warning(x));
|
36
|
+
}
|
37
|
+
}
|
25
38
|
async function getRawResponse(getResponse, options) {
|
26
|
-
const { onResponse } = options || {};
|
27
39
|
let rawResponse;
|
28
|
-
const flatResponse = await getResponse(
|
29
|
-
|
30
|
-
|
31
|
-
} }));
|
40
|
+
const flatResponse = await getResponse(addOnResponse(options, (response) => {
|
41
|
+
rawResponse = response;
|
42
|
+
}));
|
32
43
|
return {
|
33
44
|
flatResponse,
|
34
45
|
rawResponse: {
|
@@ -51,14 +62,12 @@ function createSendPollRequest(settings) {
|
|
51
62
|
return async (path) => {
|
52
63
|
return throwError(sendRequest({
|
53
64
|
client,
|
54
|
-
opOptions:
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
(_a = options.onResponse) === null || _a === void 0 ? void 0 : _a.call(options, rawResponse, response, error);
|
61
|
-
} }),
|
65
|
+
opOptions: addOnResponse(options, (_, response) => {
|
66
|
+
const castResponse = response;
|
67
|
+
if (castResponse.status.toLowerCase() === "partiallysucceeded") {
|
68
|
+
castResponse.status = "failed";
|
69
|
+
}
|
70
|
+
}),
|
62
71
|
path,
|
63
72
|
spanStr,
|
64
73
|
spec: jobStatusOperationSpec,
|
@@ -73,7 +82,7 @@ export function createAnalyzeBatchLro(settings) {
|
|
73
82
|
const { client, commonOptions, documents, initialRequestOptions, pollRequestOptions, tasks, tracing, } = settings;
|
74
83
|
return {
|
75
84
|
async sendInitialRequest() {
|
76
|
-
return tracing.withSpan(`${clientName}.beginAnalyzeBatch`, Object.assign(Object.assign({}, commonOptions), initialRequestOptions), async (finalOptions) => throwError(getRawResponse((paramOptions) => client.analyzeBatch({
|
85
|
+
return tracing.withSpan(`${clientName}.beginAnalyzeBatch`, addOnResponse(Object.assign(Object.assign({}, commonOptions), initialRequestOptions), logWarnHeader), async (finalOptions) => throwError(getRawResponse((paramOptions) => client.analyzeBatch({
|
77
86
|
tasks,
|
78
87
|
analysisInput: {
|
79
88
|
documents,
|
package/dist-esm/src/lro.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lro.js","sourceRoot":"","sources":["../../src/lro.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAc5D,OAAO,EAIL,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAe,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAGxE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,UAAU,GAA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ACjF,YAAY,CAAC,SAAS,GAAG,SAAS,CAAC;QACnC,YAAY,CAAC,WAAW,GAAG,WAAW,CAAC;QACvC,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC;QACrB,YAAY,CAAC,oBAAoB,GAAG,KAAK,CAAC,SAAS,CAAC;QACpD,YAAY,CAAC,iBAAiB,GAAG,KAAK,CAAC,MAAM,CAAC;QAC9C,YAAY,CAAC,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAAC;QACtD,IAAI,YAAY,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE;YAC7D,YAAY,CAAC,MAAM,GAAG,MAAM,CAAC;SAC9B;IACH,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAAC,QAM5C;IACC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;IAC1D,uCACK,MAAM,KACT,uBAAuB,EAAE,KAAK,IAAI,EAAE;YAClC,MAAM,OAAO,CAAC,QAAQ,CAAC,GAAG,UAAU,oBAAoB,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,CACxF,UAAU,CACR,cAAc,CACZ,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,EAAE,YAAY,CAAC,EAChE,YAAY,CACb,CACF,CACF,CAAC;QACJ,CAAC,IACD;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as Mappers from \"./generated/models/mappers\";\nimport * as Parameters from \"./generated/models/parameters\";\nimport {\n AnalyzeBatchActionUnion,\n AnalyzeTextJobStatusOptionalParams,\n AnalyzeTextJobStatusResponse,\n GeneratedClient,\n TextDocumentInput,\n} from \"./generated\";\nimport {\n AnalyzeBatchOperationState,\n AnalyzeBatchResult,\n PagedAnalyzeBatchResult,\n PollerLike,\n} from \"./models\";\nimport {\n FullOperationResponse,\n OperationOptions,\n OperationSpec,\n createSerializer,\n} from \"@azure/core-client\";\nimport { LongRunningOperation, LroResponse, SimplePollerLike } from \"@azure/core-lro\";\nimport { PagedResult, getPagedAsyncIterator } from \"@azure/core-paging\";\nimport { throwError, transformAnalyzeBatchResults } from \"./transforms\";\nimport { HttpMethods } from \"@azure/core-rest-pipeline\";\nimport { TracingClient } from \"@azure/core-tracing\";\nimport { clientName } from \"./constants\";\nimport { logger } from \"./logger\";\n\nconst serializer = createSerializer(Mappers, /* isXml */ false);\n\nconst jobStatusOperationSpec: OperationSpec = {\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeTextJobState,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n headerParameters: [Parameters.accept],\n queryParameters: [Parameters.top, Parameters.skip, Parameters.includeStatistics],\n serializer,\n};\n\nasync function getRawResponse<TOptions extends OperationOptions, TResponse>(\n getResponse: (options: TOptions) => Promise<TResponse>,\n options: TOptions\n): Promise<LroResponse<TResponse>> {\n const { onResponse } = options || {};\n let rawResponse: FullOperationResponse;\n const flatResponse = await getResponse({\n ...options,\n onResponse: (response, flatResponseParam) => {\n rawResponse = response;\n onResponse?.(response, flatResponseParam);\n },\n });\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\nasync function sendRequest<TOptions extends OperationOptions>(settings: {\n client: GeneratedClient;\n tracing: TracingClient;\n spec: OperationSpec;\n spanStr: string;\n opOptions: TOptions;\n path: string;\n httpMethod?: HttpMethods;\n}): Promise<LroResponse<unknown>> {\n const { client, opOptions, path, spanStr, spec, tracing, httpMethod = \"GET\" } = settings;\n return tracing.withSpan(spanStr, opOptions, async (finalOptions: TOptions) =>\n throwError(\n getRawResponse(\n (options) =>\n client.sendOperationRequest(\n { options },\n {\n ...spec,\n path,\n httpMethod,\n }\n ),\n finalOptions\n )\n )\n );\n}\n\n/**\n * @internal\n */\nfunction createSendPollRequest<TOptions extends OperationOptions>(settings: {\n client: GeneratedClient;\n tracing: TracingClient;\n options: TOptions;\n spanStr: string;\n}): (path: string) => Promise<LroResponse<unknown>> {\n const { client, options, tracing, spanStr } = settings;\n return async (path: string): Promise<LroResponse<unknown>> => {\n return throwError(\n sendRequest({\n client,\n opOptions: {\n ...options,\n onResponse: (rawResponse, response, error) => {\n const castResponse = response as AnalyzeTextJobStatusResponse;\n if (castResponse.status.toLowerCase() === \"partiallysucceeded\") {\n castResponse.status = \"failed\";\n }\n\n options.onResponse?.(rawResponse, response, error);\n },\n },\n path,\n spanStr,\n spec: jobStatusOperationSpec,\n tracing,\n })\n );\n };\n}\n\n/**\n * @internal\n */\nexport function createAnalyzeBatchLro(settings: {\n client: GeneratedClient;\n tracing: TracingClient;\n commonOptions: OperationOptions;\n initialRequestOptions: {\n displayName?: string;\n };\n pollRequestOptions: {\n includeStatistics?: boolean;\n };\n documents: TextDocumentInput[];\n tasks: AnalyzeBatchActionUnion[];\n}): LongRunningOperation {\n const {\n client,\n commonOptions,\n documents,\n initialRequestOptions,\n pollRequestOptions,\n tasks,\n tracing,\n } = settings;\n return {\n async sendInitialRequest(): Promise<LroResponse<unknown>> {\n return tracing.withSpan(\n `${clientName}.beginAnalyzeBatch`,\n {\n ...commonOptions,\n ...initialRequestOptions,\n },\n async (finalOptions) =>\n throwError(\n getRawResponse(\n (paramOptions) =>\n client.analyzeBatch(\n {\n tasks,\n analysisInput: {\n documents,\n },\n displayName: initialRequestOptions.displayName,\n },\n paramOptions\n ),\n finalOptions\n )\n )\n );\n },\n sendPollRequest: createSendPollRequest({\n client,\n options: { ...commonOptions, ...pollRequestOptions },\n spanStr: `${clientName}.beginAnalyzeBatch`,\n tracing,\n }),\n };\n}\n\n/**\n * @internal\n */\nexport function getDocIDsFromState(serializedState: string): string[] {\n try {\n const { docIds } = JSON.parse(serializedState).state;\n return docIds;\n } catch (e) {\n logger.error(\n `Document IDs are not found in the LRO's state. The results may not be ordered correctly.`\n );\n return [];\n }\n}\n\n/**\n * @internal\n */\nexport function createCreateAnalyzeBatchPollerLro<OptionsT extends OperationOptions>(settings: {\n client: GeneratedClient;\n tracing: TracingClient;\n options: OptionsT;\n}): LongRunningOperation {\n const { client, options, tracing } = settings;\n return {\n async sendInitialRequest(): Promise<LroResponse<unknown>> {\n throw new Error(`The operation has already started`);\n },\n sendPollRequest: createSendPollRequest({\n client,\n options,\n spanStr: `${clientName}.beginAnalyzeBatch`,\n tracing,\n }),\n };\n}\n\n/**\n * @internal\n */\nexport function processAnalyzeResult(options: {\n client: GeneratedClient;\n tracing: TracingClient;\n docIds: string[];\n opOptions: AnalyzeTextJobStatusOptionalParams;\n state: { continuationToken: string };\n}): (result: unknown, state: AnalyzeBatchOperationState) => PagedAnalyzeBatchResult {\n return (): PagedAnalyzeBatchResult => {\n const { client, docIds, opOptions, tracing, state } = options;\n const pageURL = state.continuationToken;\n const pagedResult: PagedResult<AnalyzeBatchResult[]> = {\n firstPageLink: pageURL,\n getPage: async (pageLink: string, maxPageSize?: number) => {\n const response = await sendRequest({\n client,\n spec: jobStatusOperationSpec,\n spanStr: `${clientName}.beginAnalyzeBatch`,\n // if `top` is set to `undefined`, the default value will not be sent\n // as part of the request.\n opOptions: maxPageSize ? { ...opOptions, top: maxPageSize } : opOptions,\n path: pageLink,\n tracing,\n });\n const flatResponse = response.flatResponse as AnalyzeTextJobStatusResponse;\n return {\n page: transformAnalyzeBatchResults(docIds, flatResponse.tasks.items),\n nextPageLink: flatResponse.nextLink,\n };\n },\n };\n return getPagedAsyncIterator(pagedResult);\n };\n}\n\ntype Writable<T> = {\n -readonly [P in keyof T]: T[P];\n};\n\n/**\n * @internal\n */\nexport function createUpdateAnalyzeState(docIds?: string[]) {\n return (state: AnalyzeBatchOperationState, lastResponse: LroResponse): void => {\n const { createdOn, modifiedOn, id, displayName, expiresOn, tasks, lastUpdateDateTime } =\n lastResponse.flatResponse as AnalyzeTextJobStatusResponse & { lastUpdateDateTime: string };\n const mutableState = state as Writable<AnalyzeBatchOperationState> & {\n docIds?: string[];\n };\n mutableState.createdOn = createdOn;\n // FIXME: remove this mitigation when the service API is fixed\n mutableState.modifiedOn = modifiedOn ? modifiedOn : new Date(lastUpdateDateTime);\n mutableState.expiresOn = expiresOn;\n mutableState.displayName = displayName;\n mutableState.id = id;\n mutableState.actionSucceededCount = tasks.completed;\n mutableState.actionFailedCount = tasks.failed;\n mutableState.actionInProgressCount = tasks.inProgress;\n if (mutableState.docIds === undefined && docIds !== undefined) {\n mutableState.docIds = docIds;\n }\n };\n}\n\n/**\n * @internal\n */\nexport function createPollerWithCancellation(settings: {\n poller: SimplePollerLike<AnalyzeBatchOperationState, PagedAnalyzeBatchResult>;\n client: GeneratedClient;\n tracing: TracingClient;\n options: AnalyzeTextJobStatusOptionalParams;\n id: string;\n}): PollerLike<AnalyzeBatchOperationState, PagedAnalyzeBatchResult> {\n const { client, options, poller, id, tracing } = settings;\n return {\n ...poller,\n sendCancellationRequest: async () => {\n await tracing.withSpan(`${clientName}.beginAnalyzeBatch`, options, async (finalOptions) =>\n throwError(\n getRawResponse(\n (paramOptions) => client.analyzeText.cancelJob(id, paramOptions),\n finalOptions\n )\n )\n );\n },\n };\n}\n"]}
|
1
|
+
{"version":3,"file":"lro.js","sourceRoot":"","sources":["../../src/lro.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAc5D,OAAO,EAIL,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAe,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAGxE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO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,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,EAAE,YAAY,CAAC,EAChE,YAAY,CACb,CACF,CACF,CAAC;QACJ,CAAC,IACD;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as Mappers from \"./generated/models/mappers\";\nimport * as Parameters from \"./generated/models/parameters\";\nimport {\n AnalyzeBatchActionUnion,\n AnalyzeTextJobStatusOptionalParams,\n AnalyzeTextJobStatusResponse,\n GeneratedClient,\n TextDocumentInput,\n} from \"./generated\";\nimport {\n AnalyzeBatchOperationState,\n AnalyzeBatchResult,\n PagedAnalyzeBatchResult,\n PollerLike,\n} from \"./models\";\nimport {\n FullOperationResponse,\n OperationOptions,\n OperationSpec,\n createSerializer,\n} from \"@azure/core-client\";\nimport { LongRunningOperation, LroResponse, SimplePollerLike } from \"@azure/core-lro\";\nimport { PagedResult, getPagedAsyncIterator } from \"@azure/core-paging\";\nimport { throwError, transformAnalyzeBatchResults } from \"./transforms\";\nimport { HttpMethods } from \"@azure/core-rest-pipeline\";\nimport { TracingClient } from \"@azure/core-tracing\";\nimport { clientName } from \"./constants\";\nimport { logger } from \"./logger\";\n\nconst serializer = createSerializer(Mappers, /* isXml */ false);\n\nconst jobStatusOperationSpec: OperationSpec = {\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeTextJobState,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n headerParameters: [Parameters.accept],\n queryParameters: [Parameters.top, Parameters.skip, Parameters.includeStatistics],\n serializer,\n};\n\nfunction addOnResponse<TOptions extends OperationOptions>(\n options: TOptions,\n cb: (rawResponse: FullOperationResponse, response: unknown, error: unknown) => void\n): TOptions {\n return {\n ...options,\n onResponse: (rawResponse, response, error) => {\n cb(rawResponse, response, error);\n options.onResponse?.(rawResponse, response, error);\n },\n };\n}\n\nfunction logWarnHeader(rawResponse: FullOperationResponse) {\n const warnHeader = rawResponse.headers.get(\"warn-text\");\n if (warnHeader) {\n warnHeader.split(\";\").map((x) => logger.warning(x));\n }\n}\n\nasync function getRawResponse<TOptions extends OperationOptions, TResponse>(\n getResponse: (options: TOptions) => Promise<TResponse>,\n options: TOptions\n): Promise<LroResponse<TResponse>> {\n let rawResponse: FullOperationResponse;\n const flatResponse = await getResponse(\n addOnResponse(options, (response) => {\n rawResponse = response;\n })\n );\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\nasync function sendRequest<TOptions extends OperationOptions>(settings: {\n client: GeneratedClient;\n tracing: TracingClient;\n spec: OperationSpec;\n spanStr: string;\n opOptions: TOptions;\n path: string;\n httpMethod?: HttpMethods;\n}): Promise<LroResponse<unknown>> {\n const { client, opOptions, path, spanStr, spec, tracing, httpMethod = \"GET\" } = settings;\n return tracing.withSpan(spanStr, opOptions, async (finalOptions: TOptions) =>\n throwError(\n getRawResponse(\n (options) =>\n client.sendOperationRequest(\n { options },\n {\n ...spec,\n path,\n httpMethod,\n }\n ),\n finalOptions\n )\n )\n );\n}\n\n/**\n * @internal\n */\nfunction createSendPollRequest<TOptions extends OperationOptions>(settings: {\n client: GeneratedClient;\n tracing: TracingClient;\n options: TOptions;\n spanStr: string;\n}): (path: string) => Promise<LroResponse<unknown>> {\n const { client, options, tracing, spanStr } = settings;\n return async (path: string): Promise<LroResponse<unknown>> => {\n return throwError(\n sendRequest({\n client,\n opOptions: addOnResponse(options, (_, response) => {\n const castResponse = response as AnalyzeTextJobStatusResponse;\n if (castResponse.status.toLowerCase() === \"partiallysucceeded\") {\n castResponse.status = \"failed\";\n }\n }),\n path,\n spanStr,\n spec: jobStatusOperationSpec,\n tracing,\n })\n );\n };\n}\n\n/**\n * @internal\n */\nexport function createAnalyzeBatchLro(settings: {\n client: GeneratedClient;\n tracing: TracingClient;\n commonOptions: OperationOptions;\n initialRequestOptions: {\n displayName?: string;\n };\n pollRequestOptions: {\n includeStatistics?: boolean;\n };\n documents: TextDocumentInput[];\n tasks: AnalyzeBatchActionUnion[];\n}): LongRunningOperation {\n const {\n client,\n commonOptions,\n documents,\n initialRequestOptions,\n pollRequestOptions,\n tasks,\n tracing,\n } = settings;\n return {\n async sendInitialRequest(): Promise<LroResponse<unknown>> {\n return tracing.withSpan(\n `${clientName}.beginAnalyzeBatch`,\n addOnResponse(\n {\n ...commonOptions,\n ...initialRequestOptions,\n },\n logWarnHeader\n ),\n async (finalOptions) =>\n throwError(\n getRawResponse(\n (paramOptions) =>\n client.analyzeBatch(\n {\n tasks,\n analysisInput: {\n documents,\n },\n displayName: initialRequestOptions.displayName,\n },\n paramOptions\n ),\n finalOptions\n )\n )\n );\n },\n sendPollRequest: createSendPollRequest({\n client,\n options: { ...commonOptions, ...pollRequestOptions },\n spanStr: `${clientName}.beginAnalyzeBatch`,\n tracing,\n }),\n };\n}\n\n/**\n * @internal\n */\nexport function getDocIDsFromState(serializedState: string): string[] {\n try {\n const { docIds } = JSON.parse(serializedState).state;\n return docIds;\n } catch (e) {\n logger.error(\n `Document IDs are not found in the LRO's state. The results may not be ordered correctly.`\n );\n return [];\n }\n}\n\n/**\n * @internal\n */\nexport function createCreateAnalyzeBatchPollerLro<OptionsT extends OperationOptions>(settings: {\n client: GeneratedClient;\n tracing: TracingClient;\n options: OptionsT;\n}): LongRunningOperation {\n const { client, options, tracing } = settings;\n return {\n async sendInitialRequest(): Promise<LroResponse<unknown>> {\n throw new Error(`The operation has already started`);\n },\n sendPollRequest: createSendPollRequest({\n client,\n options,\n spanStr: `${clientName}.beginAnalyzeBatch`,\n tracing,\n }),\n };\n}\n\n/**\n * @internal\n */\nexport function processAnalyzeResult(options: {\n client: GeneratedClient;\n tracing: TracingClient;\n docIds: string[];\n opOptions: AnalyzeTextJobStatusOptionalParams;\n state: { continuationToken: string };\n}): (result: unknown, state: AnalyzeBatchOperationState) => PagedAnalyzeBatchResult {\n return (): PagedAnalyzeBatchResult => {\n const { client, docIds, opOptions, tracing, state } = options;\n const pageURL = state.continuationToken;\n const pagedResult: PagedResult<AnalyzeBatchResult[]> = {\n firstPageLink: pageURL,\n getPage: async (pageLink: string, maxPageSize?: number) => {\n const response = await sendRequest({\n client,\n spec: jobStatusOperationSpec,\n spanStr: `${clientName}.beginAnalyzeBatch`,\n // if `top` is set to `undefined`, the default value will not be sent\n // as part of the request.\n opOptions: maxPageSize ? { ...opOptions, top: maxPageSize } : opOptions,\n path: pageLink,\n tracing,\n });\n const flatResponse = response.flatResponse as AnalyzeTextJobStatusResponse;\n return {\n page: transformAnalyzeBatchResults(docIds, flatResponse.tasks.items),\n nextPageLink: flatResponse.nextLink,\n };\n },\n };\n return getPagedAsyncIterator(pagedResult);\n };\n}\n\ntype Writable<T> = {\n -readonly [P in keyof T]: T[P];\n};\n\n/**\n * @internal\n */\nexport function createUpdateAnalyzeState(docIds?: string[]) {\n return (state: AnalyzeBatchOperationState, lastResponse: LroResponse): void => {\n const { createdOn, modifiedOn, id, displayName, expiresOn, tasks, lastUpdateDateTime } =\n lastResponse.flatResponse as AnalyzeTextJobStatusResponse & { lastUpdateDateTime: string };\n const mutableState = state as Writable<AnalyzeBatchOperationState> & {\n docIds?: string[];\n };\n mutableState.createdOn = createdOn;\n // FIXME: remove this mitigation when the service API is fixed\n mutableState.modifiedOn = modifiedOn ? modifiedOn : new Date(lastUpdateDateTime);\n mutableState.expiresOn = expiresOn;\n mutableState.displayName = displayName;\n mutableState.id = id;\n mutableState.actionSucceededCount = tasks.completed;\n mutableState.actionFailedCount = tasks.failed;\n mutableState.actionInProgressCount = tasks.inProgress;\n if (mutableState.docIds === undefined && docIds !== undefined) {\n mutableState.docIds = docIds;\n }\n };\n}\n\n/**\n * @internal\n */\nexport function createPollerWithCancellation(settings: {\n poller: SimplePollerLike<AnalyzeBatchOperationState, PagedAnalyzeBatchResult>;\n client: GeneratedClient;\n tracing: TracingClient;\n options: AnalyzeTextJobStatusOptionalParams;\n id: string;\n}): PollerLike<AnalyzeBatchOperationState, PagedAnalyzeBatchResult> {\n const { client, options, poller, id, tracing } = settings;\n return {\n ...poller,\n sendCancellationRequest: async () => {\n await tracing.withSpan(`${clientName}.beginAnalyzeBatch`, options, async (finalOptions) =>\n throwError(\n getRawResponse(\n (paramOptions) => client.analyzeText.cancelJob(id, paramOptions),\n finalOptions\n )\n )\n );\n },\n };\n}\n"]}
|
package/package.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
"sdk-type": "client",
|
4
4
|
"author": "Microsoft Corporation",
|
5
5
|
"description": "An isomorphic client library for the text analysis features in the Azure Cognitive Language Service.",
|
6
|
-
"version": "1.1.0-alpha.
|
6
|
+
"version": "1.1.0-alpha.20230223.3",
|
7
7
|
"keywords": [
|
8
8
|
"node",
|
9
9
|
"azure",
|
@@ -134,6 +134,6 @@
|
|
134
134
|
"sinon": "^9.0.2",
|
135
135
|
"source-map-support": "^0.5.9",
|
136
136
|
"ts-node": "^10.0.0",
|
137
|
-
"typescript": "~4.
|
137
|
+
"typescript": "~4.8.0"
|
138
138
|
}
|
139
139
|
}
|