Skip to content

Commit

Permalink
[ai-form-recognizer] Added @internal to documentation strings as appr…
Browse files Browse the repository at this point in the history
…opriate. (#16181)
  • Loading branch information
witemple-msft authored Jul 8, 2021
1 parent 038eb69 commit d2d7000
Show file tree
Hide file tree
Showing 12 changed files with 153 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const API_KEY_HEADER_NAME = "Ocp-Apim-Subscription-Key";
/**
* Create an HTTP pipeline policy to authenticate a request
* using an `AzureKeyCredential` for Azure Form Recognizer
*
* @internal
*/
export function createFormRecognizerAzureKeyCredentialPolicy(
credential: KeyCredential
Expand Down
7 changes: 7 additions & 0 deletions sdk/formrecognizer/ai-form-recognizer/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ export const LIB_INFO = `azsdk-js-ai-formrecognizer/${SDK_VERSION}`;

/**
* Maximum size of input documents allowed by the Azure Form Recognizer service.
*
* @internal
*/
export const MAX_INPUT_DOCUMENT_SIZE = 50 * 1024 * 1024; // 50 MB

/**
* @internal
*/
export const FormRecognizerLoggingAllowedHeaderNames = [
"apim-request-id",
"Location",
Expand All @@ -22,6 +26,9 @@ export const FormRecognizerLoggingAllowedHeaderNames = [
"x-envoy-upstream-service-time"
];

/**
* @internal
*/
export const FormRecognizerLoggingAllowedQueryParameters = [
"includeTextDetails",
"includeKeys",
Expand Down
30 changes: 30 additions & 0 deletions sdk/formrecognizer/ai-form-recognizer/src/formTrainingClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,11 @@ export class FormTrainingClient {
}
}

/**
* (INTERNAL) Provides an async iterable of model pages.
*
* @hidden
*/
private async *listModelsPage(
settings: PageSettings,
options: ListModelsOptions = {}
Expand All @@ -370,6 +375,11 @@ export class FormTrainingClient {
}
}

/**
* (INTERNAL) Create an async iterable of all models in an account.
*
* @hidden
*/
private async *listModelsAll(
settings: PageSettings,
options: ListModelsOptions = {}
Expand Down Expand Up @@ -441,6 +451,11 @@ export class FormTrainingClient {
};
}

/**
* (INTERNAL) Get the first page of models
*
* @hidden
*/
private async list(options?: ListModelsOptions): Promise<ListCustomModelsResponse> {
const realOptions: ListModelsOptions = options || {};
const { span, updatedOptions: finalOptions } = createSpan(
Expand All @@ -465,6 +480,11 @@ export class FormTrainingClient {
}
}

/**
* (INTERNAL) Get a page of models using a nextLink
*
* @hidden
*/
private async listNextPage(
nextLink: string,
options?: ListModelsOptions
Expand Down Expand Up @@ -710,6 +730,11 @@ export class FormTrainingClient {
return poller;
}

/**
* (INTERNAL) Start a model copying operation.
*
* @hidden
*/
private async beginCopyModelInternal(
modelId: string,
copyAuthorization: CopyAuthorization,
Expand Down Expand Up @@ -745,6 +770,11 @@ export class FormTrainingClient {
}
}

/**
* (INTERNAL) Get the result of an in-progress model copying operation.
*
* @hidden
*/
private async getCopyModelResult(
modelId: string,
resultId: string,
Expand Down
6 changes: 6 additions & 0 deletions sdk/formrecognizer/ai-form-recognizer/src/internalModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { RecognizedForm, FormPage } from "./models";

/**
* Represents the result from an Recognize Content operation
*
* @internal
*/
export interface RecognizedContent {
/**
Expand Down Expand Up @@ -41,6 +43,8 @@ export interface RecognizedContent {

/**
* Contains response data for the Recognize Content operation.
*
* @internal
*/
export type RecognizeContentResultResponse = RecognizedContent & {
/**
Expand All @@ -60,6 +64,8 @@ export type RecognizeContentResultResponse = RecognizedContent & {

/**
* Represents the result from an recognize form operation using a custom model from training.
*
* @internal
*/
export interface RecognizedForms {
/**
Expand Down
2 changes: 2 additions & 0 deletions sdk/formrecognizer/ai-form-recognizer/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ import { createClientLogger } from "@azure/logger";

/**
* The \@azure/logger configuration for this package.
*
* @internal
*/
export const logger = createClientLogger("ai-form-recognizer");
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import { FormRecognizerRequestBody, FormPageArray } from "../../models";
import { RecognizeContentResultResponse } from "../../internalModels";
export { OperationStatus };

/**
* @internal
*/
export interface ContentPollerOperationOptions {
/**
* Time between each polling in milliseconds.
Expand All @@ -32,6 +35,8 @@ export interface ContentPollerOperationOptions {
/**
* Defines the operations from a analyze client that are needed for the poller
* to work
*
* @internal
*/
export type RecognizeContentPollerClient = {
// returns a result id to retrieve results
Expand All @@ -56,6 +61,9 @@ export interface BeginRecognizeContentPollState extends PollOperationState<FormP
readonly analyzeOptions?: BeginRecognizeContentOptions;
}

/**
* @internal
*/
export interface BeginRecognizeContentPollerOperation
extends PollOperation<BeginRecognizeContentPollState, FormPageArray> {}

Expand All @@ -74,6 +82,8 @@ export type BeginRecognizeContentPollerOptions = {

/**
* Class that represents a poller that waits until a model has been trained.
*
* @internal
*/
export class BeginRecognizeContentPoller extends Poller<
BeginRecognizeContentPollState,
Expand Down Expand Up @@ -121,8 +131,10 @@ export class BeginRecognizeContentPoller extends Poller<
return delay(this.updateIntervalInMs);
}
}

/**
* Creates a poll operation given the provided state.
*
* @internal
*/
function makeBeginRecognizePollOperation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { toRecognizedFormArray } from "../../transforms";

/**
* Options for Form Recognition shared between prebuilt and custom models.
* @internal
*/
export interface FormPollerOperationOptions {
/**
Expand All @@ -35,6 +36,8 @@ export interface FormPollerOperationOptions {
/**
* Encapsulates the steps to start and query the status of
* a form recognition operation
*
* @internal
*/
export interface FormRecognitionOperationClient {
/**
Expand Down Expand Up @@ -133,6 +136,7 @@ function makeFormRecognitionOperation(

/**
* Set of intrinsic properties that describe a form recognition polling operation.
* @internal
*/
export type FormPollerOperationDescription = FormPollerOperationOptions &
FormRecognitionOperationClient & {
Expand All @@ -152,6 +156,8 @@ const DEFAULT_POLLING_INTERVAL = 5000;
/**
* A poller for Form Recognition that works for all analysis endpoints
* that return the basic, weakly-typed `RecognizedFormArray` type.
*
* @internal
*/
export class FormRecognitionPoller extends Poller<
RecognizeFormsOperationState,
Expand Down
9 changes: 9 additions & 0 deletions sdk/formrecognizer/ai-form-recognizer/src/lro/copy/poller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import {
import { CopyAuthorization, CustomFormModelInfo } from "../../models";
export { OperationStatus };

/**
* @internal
*/
export interface CopyPollerOperationOptions {
/**
* Time between each polling in milliseconds.
Expand All @@ -31,6 +34,8 @@ export interface CopyPollerOperationOptions {
/**
* Defines the operations from a training client that are needed for the poller
* to work
*
* @internal
*/
export type CopyModelPollerClient = {
// returns a result id to retrieve results
Expand Down Expand Up @@ -88,6 +93,9 @@ export interface BeginCopyModelPollState extends PollOperationState<CustomFormMo
readonly copyModelOptions?: CopyModelOptions;
}

/**
* @internal
*/
export interface BeginCopyModelPollerOperation
extends PollOperation<BeginCopyModelPollState, CustomFormModelInfo> {}

Expand All @@ -108,6 +116,7 @@ export type BeginCopyModelPollerOptions = {

/**
* Class that represents a poller that waits until a model has been trained.
* @internal
*/
export class BeginCopyModelPoller extends Poller<BeginCopyModelPollState, CustomFormModelInfo> {
public updateIntervalInMs: number;
Expand Down
4 changes: 4 additions & 0 deletions sdk/formrecognizer/ai-form-recognizer/src/lro/train/poller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export { ModelStatus, TrainCustomModelAsyncResponse };
/**
* Defines the operations from a {@link FormRecognizerClient} that are needed for the poller
* returned by {@link FormRecognizerClient.beginTraining} to work.
*
* @internal
*/
export type TrainPollerClient = {
getCustomModel: (modelId: string, options: GetModelOptions) => Promise<FormModelResponse>;
Expand Down Expand Up @@ -67,6 +69,8 @@ export interface BeginTrainingPollerOptions {

/**
* Class that represents a poller that waits until a model has been trained.
*
* @internal
*/
export class BeginTrainingPoller extends Poller<BeginTrainingPollState, CustomFormModel> {
public updateIntervalInMs: number;
Expand Down
1 change: 1 addition & 0 deletions sdk/formrecognizer/ai-form-recognizer/src/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { createSpanFunction } from "@azure/core-tracing";

/**
* Creates a span using the global tracer.
*
* @internal
*/
export const createSpan = createSpanFunction({
Expand Down
Loading

0 comments on commit d2d7000

Please sign in to comment.