@azure-rest/communication-job-router 1.1.0-beta.1 → 1.1.0-beta.2
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 +168 -115
- package/dist/browser/azureCommunicationRoutingServiceClient.d.ts +14 -0
- package/dist/browser/azureCommunicationRoutingServiceClient.d.ts.map +1 -0
- package/dist/browser/azureCommunicationRoutingServiceClient.js +40 -0
- package/dist/browser/azureCommunicationRoutingServiceClient.js.map +1 -0
- package/dist/browser/azureCommunicationRoutingServiceCustmizedClient.d.ts +17 -0
- package/dist/browser/azureCommunicationRoutingServiceCustmizedClient.d.ts.map +1 -0
- package/dist/browser/azureCommunicationRoutingServiceCustmizedClient.js +29 -0
- package/dist/browser/azureCommunicationRoutingServiceCustmizedClient.js.map +1 -0
- package/dist/browser/clientDefinitions.d.ts +159 -0
- package/dist/browser/clientDefinitions.d.ts.map +1 -0
- package/dist/browser/clientDefinitions.js +4 -0
- package/dist/browser/clientDefinitions.js.map +1 -0
- package/dist/browser/index.d.ts +11 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +13 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/isUnexpected.d.ts +35 -0
- package/dist/browser/isUnexpected.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/isUnexpected.js +1 -1
- package/dist/browser/isUnexpected.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/logger.js +1 -1
- package/{dist-esm/src → dist/browser}/logger.js.map +1 -1
- package/dist/browser/models.d.ts +562 -0
- package/dist/browser/models.d.ts.map +1 -0
- package/dist/browser/models.js +4 -0
- package/dist/browser/models.js.map +1 -0
- package/dist/browser/outputModels.d.ts +683 -0
- package/dist/browser/outputModels.d.ts.map +1 -0
- package/dist/browser/outputModels.js +4 -0
- package/dist/browser/outputModels.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/paginateHelper.d.ts +68 -0
- package/dist/browser/paginateHelper.d.ts.map +1 -0
- package/dist/browser/paginateHelper.js +167 -0
- package/dist/browser/paginateHelper.js.map +1 -0
- package/dist/browser/parameters.d.ts +245 -0
- package/dist/browser/parameters.d.ts.map +1 -0
- package/dist/browser/parameters.js +4 -0
- package/dist/browser/parameters.js.map +1 -0
- package/dist/browser/responses.d.ts +616 -0
- package/dist/browser/responses.d.ts.map +1 -0
- package/dist/browser/responses.js +4 -0
- package/dist/browser/responses.js.map +1 -0
- package/dist/commonjs/azureCommunicationRoutingServiceClient.d.ts +14 -0
- package/dist/commonjs/azureCommunicationRoutingServiceClient.d.ts.map +1 -0
- package/dist/commonjs/azureCommunicationRoutingServiceClient.js +43 -0
- package/dist/commonjs/azureCommunicationRoutingServiceClient.js.map +1 -0
- package/dist/commonjs/azureCommunicationRoutingServiceCustmizedClient.d.ts +17 -0
- package/dist/commonjs/azureCommunicationRoutingServiceCustmizedClient.d.ts.map +1 -0
- package/dist/commonjs/azureCommunicationRoutingServiceCustmizedClient.js +33 -0
- package/dist/commonjs/azureCommunicationRoutingServiceCustmizedClient.js.map +1 -0
- package/dist/commonjs/clientDefinitions.d.ts +159 -0
- package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/clientDefinitions.js +5 -0
- package/dist/commonjs/clientDefinitions.js.map +1 -0
- package/dist/commonjs/index.d.ts +11 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +16 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/isUnexpected.d.ts +35 -0
- package/dist/commonjs/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/isUnexpected.js +105 -0
- package/dist/commonjs/isUnexpected.js.map +1 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.d.ts.map +1 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/models.d.ts +562 -0
- package/dist/commonjs/models.d.ts.map +1 -0
- package/dist/commonjs/models.js +5 -0
- package/dist/commonjs/models.js.map +1 -0
- package/dist/commonjs/outputModels.d.ts +683 -0
- package/dist/commonjs/outputModels.d.ts.map +1 -0
- package/dist/commonjs/outputModels.js +5 -0
- package/dist/commonjs/outputModels.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/paginateHelper.d.ts +68 -0
- package/dist/commonjs/paginateHelper.d.ts.map +1 -0
- package/dist/commonjs/paginateHelper.js +170 -0
- package/dist/commonjs/paginateHelper.js.map +1 -0
- package/dist/commonjs/parameters.d.ts +245 -0
- package/dist/commonjs/parameters.d.ts.map +1 -0
- package/dist/commonjs/parameters.js +5 -0
- package/dist/commonjs/parameters.js.map +1 -0
- package/dist/commonjs/responses.d.ts +616 -0
- package/dist/commonjs/responses.d.ts.map +1 -0
- package/dist/commonjs/responses.js +5 -0
- package/dist/commonjs/responses.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/azureCommunicationRoutingServiceClient.d.ts +14 -0
- package/dist/esm/azureCommunicationRoutingServiceClient.d.ts.map +1 -0
- package/dist/esm/azureCommunicationRoutingServiceClient.js +40 -0
- package/dist/esm/azureCommunicationRoutingServiceClient.js.map +1 -0
- package/dist/esm/azureCommunicationRoutingServiceCustmizedClient.d.ts +17 -0
- package/dist/esm/azureCommunicationRoutingServiceCustmizedClient.d.ts.map +1 -0
- package/dist/esm/azureCommunicationRoutingServiceCustmizedClient.js +29 -0
- package/dist/esm/azureCommunicationRoutingServiceCustmizedClient.js.map +1 -0
- package/dist/esm/clientDefinitions.d.ts +159 -0
- package/dist/esm/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/clientDefinitions.js +4 -0
- package/dist/esm/clientDefinitions.js.map +1 -0
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/isUnexpected.d.ts +35 -0
- package/dist/esm/isUnexpected.d.ts.map +1 -0
- package/dist/esm/isUnexpected.js +102 -0
- package/dist/esm/isUnexpected.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/models.d.ts +562 -0
- package/dist/esm/models.d.ts.map +1 -0
- package/dist/esm/models.js +4 -0
- package/dist/esm/models.js.map +1 -0
- package/dist/esm/outputModels.d.ts +683 -0
- package/dist/esm/outputModels.d.ts.map +1 -0
- package/dist/esm/outputModels.js +4 -0
- package/dist/esm/outputModels.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/paginateHelper.d.ts +68 -0
- package/dist/esm/paginateHelper.d.ts.map +1 -0
- package/dist/esm/paginateHelper.js +167 -0
- package/dist/esm/paginateHelper.js.map +1 -0
- package/dist/esm/parameters.d.ts +245 -0
- package/dist/esm/parameters.d.ts.map +1 -0
- package/dist/esm/parameters.js +4 -0
- package/dist/esm/parameters.js.map +1 -0
- package/dist/esm/responses.d.ts +616 -0
- package/dist/esm/responses.d.ts.map +1 -0
- package/dist/esm/responses.js +4 -0
- package/dist/esm/responses.js.map +1 -0
- package/dist/react-native/azureCommunicationRoutingServiceClient.d.ts +14 -0
- package/dist/react-native/azureCommunicationRoutingServiceClient.d.ts.map +1 -0
- package/dist/react-native/azureCommunicationRoutingServiceClient.js +40 -0
- package/dist/react-native/azureCommunicationRoutingServiceClient.js.map +1 -0
- package/dist/react-native/azureCommunicationRoutingServiceCustmizedClient.d.ts +17 -0
- package/dist/react-native/azureCommunicationRoutingServiceCustmizedClient.d.ts.map +1 -0
- package/dist/react-native/azureCommunicationRoutingServiceCustmizedClient.js +29 -0
- package/dist/react-native/azureCommunicationRoutingServiceCustmizedClient.js.map +1 -0
- package/dist/react-native/clientDefinitions.d.ts +159 -0
- package/dist/react-native/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/clientDefinitions.js +4 -0
- package/dist/react-native/clientDefinitions.js.map +1 -0
- package/dist/react-native/index.d.ts +11 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +13 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/isUnexpected.d.ts +35 -0
- package/dist/react-native/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/isUnexpected.js +102 -0
- package/dist/react-native/isUnexpected.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.d.ts.map +1 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/models.d.ts +562 -0
- package/dist/react-native/models.d.ts.map +1 -0
- package/dist/react-native/models.js +4 -0
- package/dist/react-native/models.js.map +1 -0
- package/dist/react-native/outputModels.d.ts +683 -0
- package/dist/react-native/outputModels.d.ts.map +1 -0
- package/dist/react-native/outputModels.js +4 -0
- package/dist/react-native/outputModels.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/paginateHelper.d.ts +68 -0
- package/dist/react-native/paginateHelper.d.ts.map +1 -0
- package/dist/react-native/paginateHelper.js +167 -0
- package/dist/react-native/paginateHelper.js.map +1 -0
- package/dist/react-native/parameters.d.ts +245 -0
- package/dist/react-native/parameters.d.ts.map +1 -0
- package/dist/react-native/parameters.js +4 -0
- package/dist/react-native/parameters.js.map +1 -0
- package/dist/react-native/responses.d.ts +616 -0
- package/dist/react-native/responses.d.ts.map +1 -0
- package/dist/react-native/responses.js +4 -0
- package/dist/react-native/responses.js.map +1 -0
- package/package.json +79 -63
- package/dist/index.js +0 -229
- package/dist/index.js.map +0 -1
- package/dist-esm/src/azureCommunicationRoutingServiceClient.js +0 -42
- package/dist-esm/src/azureCommunicationRoutingServiceClient.js.map +0 -1
- package/dist-esm/src/clientDefinitions.js +0 -4
- package/dist-esm/src/clientDefinitions.js.map +0 -1
- package/dist-esm/src/index.js +0 -13
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/isUnexpected.js.map +0 -1
- package/dist-esm/src/models.js +0 -4
- package/dist-esm/src/models.js.map +0 -1
- package/dist-esm/src/outputModels.js +0 -4
- package/dist-esm/src/outputModels.js.map +0 -1
- package/dist-esm/src/paginateHelper.js +0 -70
- package/dist-esm/src/paginateHelper.js.map +0 -1
- package/dist-esm/src/parameters.js +0 -4
- package/dist-esm/src/parameters.js.map +0 -1
- package/dist-esm/src/responses.js +0 -4
- package/dist-esm/src/responses.js.map +0 -1
- package/review/communication-job-router.api.md +0 -2485
- package/types/communication-job-router.d.ts +0 -2677
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputModels.d.ts","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAGA,qEAAqE;AACrE,MAAM,WAAW,0BAA0B;IACzC,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2FAA2F;IAC3F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oEAAoE;IACpE,wBAAwB,CAAC,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAChE,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;IACtC,4EAA4E;IAC5E,yBAAyB,CAAC,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;CACnE;AAED,iGAAiG;AACjG,MAAM,WAAW,mCAAmC;IAClD,IAAI,EAAE,iCAAiC,CAAC;CACzC;AAED,wGAAwG;AACxG,MAAM,WAAW,wCACf,SAAQ,mCAAmC;IAC3C,8EAA8E;IAC9E,SAAS,EAAE,gBAAgB,CAAC;IAC5B,qCAAqC;IACrC,cAAc,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACjD,+EAA+E;IAC/E,IAAI,EAAE,aA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,0CAA0C;AAC1C,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAC/C,wCAAwC;AACxC,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** A container for the rules that govern how jobs are classified. */\nexport interface ClassificationPolicyOutput {\n /** The entity tag for this resource. */\n readonly etag: string;\n /** Id of a classification policy. */\n readonly id: string;\n /** Friendly name of this policy. */\n name?: string;\n /** Id of a fallback queue to select if queue selector attachments doesn't find a match. */\n fallbackQueueId?: string;\n /** Queue selector attachments used to resolve a queue for a job. */\n queueSelectorAttachments?: Array<QueueSelectorAttachmentOutput>;\n /** A rule to determine a priority score for a job. */\n prioritizationRule?: RouterRuleOutput;\n /** Worker selector attachments used to attach worker selectors to a job. */\n workerSelectorAttachments?: Array<WorkerSelectorAttachmentOutput>;\n}\n\n/** An attachment of queue selectors to resolve a queue to a job from a classification policy. */\nexport interface QueueSelectorAttachmentOutputParent {\n kind: QueueSelectorAttachmentKindOutput;\n}\n\n/** Describes a set of queue selectors that will be attached if the given condition resolves to true. */\nexport interface ConditionalQueueSelectorAttachmentOutput\n extends QueueSelectorAttachmentOutputParent {\n /** The condition that must be true for the queue selectors to be attached. */\n condition: RouterRuleOutput;\n /** The queue selectors to attach. */\n queueSelectors: Array<RouterQueueSelectorOutput>;\n /** The type discriminator describing the type of queue selector attachment. */\n kind: \"conditional\";\n}\n\n/**\n * A rule of one of the following types:\n * StaticRule: A rule providing static rules that always return the same result, regardless of input.\n * DirectMapRule: A rule that return the same labels as the input labels.\n * ExpressionRule: A rule providing inline expression rules.\n * FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function.\n * WebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol.\n */\nexport interface RouterRuleOutputParent {\n kind: RouterRuleKindOutput;\n}\n\n/** A rule that return the same labels as the input labels. */\nexport interface DirectMapRouterRuleOutput extends RouterRuleOutputParent {\n /** The type discriminator describing a sub-type of Rule. */\n kind: \"directMap\";\n}\n\n/** A rule providing inline expression rules. */\nexport interface ExpressionRouterRuleOutput extends RouterRuleOutputParent {\n /**\n * The expression language to compile to and execute.\n *\n * Possible values: \"powerFx\"\n */\n language?: ExpressionRouterRuleLanguageOutput;\n /** An expression to evaluate. Should contain return statement with calculated values. */\n expression: string;\n /** The type discriminator describing a sub-type of Rule. */\n kind: \"expression\";\n}\n\n/** A rule providing a binding to an HTTP Triggered Azure Function. */\nexport interface FunctionRouterRuleOutput extends RouterRuleOutputParent {\n /** URL for Azure Function. */\n functionUri: string;\n /** Credentials used to access Azure function rule. */\n credential?: FunctionRouterRuleCredentialOutput;\n /** The type discriminator describing a sub-type of Rule. */\n kind: \"function\";\n}\n\n/** Credentials used to access Azure function rule. */\nexport interface FunctionRouterRuleCredentialOutput {\n /** Access key scoped to a particular function. */\n functionKey?: string;\n /** Access key scoped to a Azure Function app. This key grants access to all functions under the app. */\n appKey?: string;\n /** Client id, when AppKey is provided In context of Azure function, this is usually the name of the key. */\n clientId?: string;\n}\n\n/** A rule providing static rules that always return the same result, regardless of input. */\nexport interface StaticRouterRuleOutput extends RouterRuleOutputParent {\n /** The static value this rule always returns. Values must be primitive values - number, string, boolean. */\n value?: any;\n /** The type discriminator describing a sub-type of Rule. */\n kind: \"static\";\n}\n\n/** A rule providing a binding to an external web server. */\nexport interface WebhookRouterRuleOutput extends RouterRuleOutputParent {\n /** Uri for Authorization Server. */\n authorizationServerUri?: string;\n /** OAuth2.0 Credentials used to Contoso's Authorization server. Reference: https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ */\n clientCredential?: OAuth2WebhookClientCredentialOutput;\n /** Uri for Contoso's Web Server. */\n webhookUri?: string;\n /** The type discriminator describing a sub-type of Rule. */\n kind: \"webhook\";\n}\n\n/** OAuth2.0 Credentials used to Contoso's Authorization server. Reference: https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ */\nexport interface OAuth2WebhookClientCredentialOutput {\n /** ClientId for Contoso Authorization server. */\n clientId?: string;\n /** Client secret for Contoso Authorization server. */\n clientSecret?: string;\n}\n\n/** Describes a condition that must be met against a set of labels for queue selection. */\nexport interface RouterQueueSelectorOutput {\n /** The label key to query against. */\n key: string;\n /**\n * Describes how the value of the label is compared to the value defined on the label selector.\n *\n * Possible values: \"equal\", \"notEqual\", \"lessThan\", \"lessThanOrEqual\", \"greaterThan\", \"greaterThanOrEqual\"\n */\n labelOperator: LabelOperatorOutput;\n /** The value to compare against the actual label value with the given operator. Values must be primitive values - number, string, boolean. */\n value?: any;\n}\n\n/** Attaches a queue selector where the value is passed through from a job's label with the same key. */\nexport interface PassThroughQueueSelectorAttachmentOutput\n extends QueueSelectorAttachmentOutputParent {\n /** The label key to query against. */\n key: string;\n /**\n * Describes how the value of the label is compared to the value pass through.\n *\n * Possible values: \"equal\", \"notEqual\", \"lessThan\", \"lessThanOrEqual\", \"greaterThan\", \"greaterThanOrEqual\"\n */\n labelOperator: LabelOperatorOutput;\n /** The type discriminator describing the type of queue selector attachment. */\n kind: \"passThrough\";\n}\n\n/** Attaches queue selectors to a job when the RouterRule is resolved. */\nexport interface RuleEngineQueueSelectorAttachmentOutput\n extends QueueSelectorAttachmentOutputParent {\n /** A RouterRule that resolves a collection of queue selectors to attach. */\n rule: RouterRuleOutput;\n /** The type discriminator describing the type of queue selector attachment. */\n kind: \"ruleEngine\";\n}\n\n/** Describes a queue selector that will be attached to a job. */\nexport interface StaticQueueSelectorAttachmentOutput extends QueueSelectorAttachmentOutputParent {\n /** The queue selector to attach. */\n queueSelector: RouterQueueSelectorOutput;\n /** The type discriminator describing the type of queue selector attachment. */\n kind: \"static\";\n}\n\n/** Describes multiple sets of queue selectors, of which one will be selected and attached according to a weighting. */\nexport interface WeightedAllocationQueueSelectorAttachmentOutput\n extends QueueSelectorAttachmentOutputParent {\n /** A collection of percentage based weighted allocations. */\n allocations: Array<QueueWeightedAllocationOutput>;\n /** The type discriminator describing the type of queue selector attachment. */\n kind: \"weightedAllocation\";\n}\n\n/** Contains the weight percentage and queue selectors to be applied if selected for weighted distributions. */\nexport interface QueueWeightedAllocationOutput {\n /** The percentage of this weight, expressed as a fraction of 1. */\n weight: number;\n /** A collection of queue selectors that will be applied if this allocation is selected. */\n queueSelectors: Array<RouterQueueSelectorOutput>;\n}\n\n/** An attachment which attaches worker selectors to a job. */\nexport interface WorkerSelectorAttachmentOutputParent {\n kind: WorkerSelectorAttachmentKindOutput;\n}\n\n/** Describes a set of worker selectors that will be attached if the given condition resolves to true. */\nexport interface ConditionalWorkerSelectorAttachmentOutput\n extends WorkerSelectorAttachmentOutputParent {\n /** The condition that must be true for the worker selectors to be attached. */\n condition: RouterRuleOutput;\n /** The worker selectors to attach. */\n workerSelectors: Array<RouterWorkerSelectorOutput>;\n /** The type discriminator describing the type of worker selector attachment. */\n kind: \"conditional\";\n}\n\n/** Describes a condition that must be met against a set of labels for worker selection. */\nexport interface RouterWorkerSelectorOutput {\n /** The label key to query against. */\n key: string;\n /**\n * Describes how the value of the label is compared to the value defined on the worker selector.\n *\n * Possible values: \"equal\", \"notEqual\", \"lessThan\", \"lessThanOrEqual\", \"greaterThan\", \"greaterThanOrEqual\"\n */\n labelOperator: LabelOperatorOutput;\n /** The value to compare against the actual label value with the given operator. Values must be primitive values - number, string, boolean. */\n value?: any;\n /** Describes how long this label selector is valid in seconds. */\n expiresAfterSeconds?: number;\n /** Pushes a job to the front of the queue as long as this selector is active. */\n expedite?: boolean;\n /**\n * Status of the worker selector.\n *\n * Possible values: \"active\", \"expired\"\n */\n readonly status?: RouterWorkerSelectorStatusOutput;\n /** The time at which this worker selector expires in UTC. */\n readonly expiresAt?: string;\n}\n\n/** Attaches a worker selector where the value is passed through from a job's label with the same key. */\nexport interface PassThroughWorkerSelectorAttachmentOutput\n extends WorkerSelectorAttachmentOutputParent {\n /** The label key to query against. */\n key: string;\n /**\n * Describes how the value of the label is compared to the value pass through.\n *\n * Possible values: \"equal\", \"notEqual\", \"lessThan\", \"lessThanOrEqual\", \"greaterThan\", \"greaterThanOrEqual\"\n */\n labelOperator: LabelOperatorOutput;\n /** Describes how long the attached label selector is valid in seconds. */\n expiresAfterSeconds?: number;\n /** The type discriminator describing the type of worker selector attachment. */\n kind: \"passThrough\";\n}\n\n/** Attaches worker selectors to a job when a RouterRule is resolved. */\nexport interface RuleEngineWorkerSelectorAttachmentOutput\n extends WorkerSelectorAttachmentOutputParent {\n /** A RouterRule that resolves a collection of worker selectors to attach. */\n rule: RouterRuleOutput;\n /** The type discriminator describing the type of worker selector attachment. */\n kind: \"ruleEngine\";\n}\n\n/** Describes a worker selector that will be attached to a job. */\nexport interface StaticWorkerSelectorAttachmentOutput extends WorkerSelectorAttachmentOutputParent {\n /** The worker selector to attach. */\n workerSelector: RouterWorkerSelectorOutput;\n /** The type discriminator describing the type of worker selector attachment. */\n kind: \"static\";\n}\n\n/** Describes multiple sets of worker selectors, of which one will be selected and attached according to a weighting. */\nexport interface WeightedAllocationWorkerSelectorAttachmentOutput\n extends WorkerSelectorAttachmentOutputParent {\n /** A collection of percentage based weighted allocations. */\n allocations: Array<WorkerWeightedAllocationOutput>;\n /** The type discriminator describing the type of worker selector attachment. */\n kind: \"weightedAllocation\";\n}\n\n/** Contains the weight percentage and worker selectors to be applied if selected for weighted distributions. */\nexport interface WorkerWeightedAllocationOutput {\n /** The percentage of this weight, expressed as a fraction of 1. */\n weight: number;\n /** A collection of worker selectors that will be applied if this allocation is selected. */\n workerSelectors: Array<RouterWorkerSelectorOutput>;\n}\n\n/** Paged collection of ClassificationPolicy items */\nexport interface PagedClassificationPolicyOutput {\n /** The ClassificationPolicy items on this page */\n value: Array<ClassificationPolicyOutput>;\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** Policy governing how jobs are distributed to workers */\nexport interface DistributionPolicyOutput {\n /** The entity tag for this resource. */\n readonly etag: string;\n /** Id of a distribution policy. */\n readonly id: string;\n /** Friendly name of this policy. */\n name?: string;\n /** Number of seconds after which any offers created under this policy will be expired. */\n offerExpiresAfterSeconds?: number;\n /** Mode governing the specific distribution method. */\n mode?: DistributionModeOutput;\n}\n\n/** Abstract base class for defining a distribution mode. */\nexport interface DistributionModeOutputParent {\n /** Governs the minimum desired number of active concurrent offers a job can have. */\n minConcurrentOffers?: number;\n /** Governs the maximum number of active concurrent offers a job can have. */\n maxConcurrentOffers?: number;\n /** If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for a job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false. */\n bypassSelectors?: boolean;\n kind: DistributionModeKindOutput;\n}\n\n/** Jobs are distributed to the worker with the strongest abilities available. */\nexport interface BestWorkerModeOutput extends DistributionModeOutputParent {\n /** Define a scoring rule to use, when calculating a score to determine the best worker. If not set, will use a default scoring formula that uses the number of job labels that the worker labels match, as well as the number of label selectors the worker labels match and/or exceed using a logistic function (https://en.wikipedia.org/wiki/Logistic_function). */\n scoringRule?: RouterRuleOutput;\n /** Options to configure 'scoringRule'. If not set, default values are used. */\n scoringRuleOptions?: ScoringRuleOptionsOutput;\n /** The type discriminator describing a sub-type of Mode */\n kind: \"bestWorker\";\n}\n\n/** Encapsulates all options that can be passed as parameters for scoring rule with BestWorkerMode. */\nexport interface ScoringRuleOptionsOutput {\n /** Set batch size when 'isBatchScoringEnabled' is set to true. Defaults to 20 if not configured. */\n batchSize?: number;\n /** List of extra parameters from a job that will be sent as part of the payload to scoring rule. If not set, a job's labels (sent in the payload as `job`) and a job's worker selectors (sent in the payload as `selectors`) are added to the payload of the scoring rule by default. Note: Worker labels are always sent with scoring payload. */\n scoringParameters?: ScoringRuleParameterSelectorOutput[];\n /** If set to true, will score workers in batches, and the parameter name of the worker labels will be sent as `workers`. By default, set to false and the parameter name for the worker labels will be sent as `worker`. Note: If enabled, use 'batchSize' to set batch size. */\n isBatchScoringEnabled?: boolean;\n /** If false, will sort scores by ascending order. By default, set to true. */\n descendingOrder?: boolean;\n}\n\n/** Jobs are directed to the worker who has been idle longest. */\nexport interface LongestIdleModeOutput extends DistributionModeOutputParent {\n /** The type discriminator describing a sub-type of Mode. */\n kind: \"longestIdle\";\n}\n\n/** Jobs are distributed in order to workers, starting with the worker that is after the last worker to receive a job. */\nexport interface RoundRobinModeOutput extends DistributionModeOutputParent {\n /** The type discriminator describing a sub-type of Mode. */\n kind: \"roundRobin\";\n}\n\n/** Paged collection of DistributionPolicy items */\nexport interface PagedDistributionPolicyOutput {\n /** The DistributionPolicy items on this page */\n value: Array<DistributionPolicyOutput>;\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** A policy that defines actions to execute when exception are triggered. */\nexport interface ExceptionPolicyOutput {\n /** The entity tag for this resource. */\n readonly etag: string;\n /** Id of an exception policy. */\n readonly id: string;\n /** Friendly name of this policy. */\n name?: string;\n /** A collection of exception rules on the exception policy. */\n exceptionRules?: Array<ExceptionRuleOutput>;\n}\n\n/** A rule that defines actions to execute upon a specific trigger. */\nexport interface ExceptionRuleOutput {\n /** Id of an exception rule. */\n id: string;\n /** The trigger for this exception rule. */\n trigger: ExceptionTriggerOutput;\n /** A collection of actions to perform once the exception is triggered. */\n actions: Array<ExceptionActionOutput>;\n}\n\n/** Abstract base class for defining a trigger for exception rules. */\nexport interface ExceptionTriggerOutputParent {\n kind: ExceptionTriggerKindOutput;\n}\n\n/** Trigger for an exception action on exceeding queue length. */\nexport interface QueueLengthExceptionTriggerOutput extends ExceptionTriggerOutputParent {\n /** Threshold of number of jobs ahead in the queue to for this trigger to fire. */\n threshold: number;\n /** The type discriminator describing a sub-type of ExceptionTrigger. */\n kind: \"queueLength\";\n}\n\n/** Trigger for an exception action on exceeding wait time. */\nexport interface WaitTimeExceptionTriggerOutput extends ExceptionTriggerOutputParent {\n /** Threshold for wait time for this trigger. */\n thresholdSeconds: number;\n /** The type discriminator describing a sub-type of ExceptionTrigger. */\n kind: \"waitTime\";\n}\n\n/** The action to take when the exception is triggered. */\nexport interface ExceptionActionOutputParent {\n /** Unique Id of the exception action. */\n id?: string;\n kind: ExceptionActionKindOutput;\n}\n\n/** An action that marks a job as cancelled. */\nexport interface CancelExceptionActionOutput extends ExceptionActionOutputParent {\n /** A note that will be appended to a job's notes collection with the current timestamp. */\n note?: string;\n /** Indicates the outcome of a job, populate this field with your own custom values. */\n dispositionCode?: string;\n /** The type discriminator describing a sub-type of ExceptionAction. */\n kind: \"cancel\";\n}\n\n/** An action that manually reclassifies a job by providing the queue, priority and worker selectors. */\nexport interface ManualReclassifyExceptionActionOutput extends ExceptionActionOutputParent {\n /** Updated QueueId. */\n queueId?: string;\n /** Updated Priority. */\n priority?: number;\n /** Updated WorkerSelectors. */\n workerSelectors?: Array<RouterWorkerSelectorOutput>;\n /** The type discriminator describing a sub-type of ExceptionAction. */\n kind: \"manualReclassify\";\n}\n\n/** An action that modifies labels on a job and then reclassifies it. */\nexport interface ReclassifyExceptionActionOutput extends ExceptionActionOutputParent {\n /** The new classification policy that will determine queue, priority and worker selectors. */\n classificationPolicyId?: string;\n /** Dictionary containing the labels to update (or add if not existing) in key-value pairs. Values must be primitive values - number, string, boolean. */\n labelsToUpsert?: Record<string, any>;\n /** The type discriminator describing a sub-type of ExceptionAction. */\n kind: \"reclassify\";\n}\n\n/** Paged collection of ExceptionPolicy items */\nexport interface PagedExceptionPolicyOutput {\n /** The ExceptionPolicy items on this page */\n value: Array<ExceptionPolicyOutput>;\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** A queue that can contain jobs to be routed. */\nexport interface RouterQueueOutput {\n /** The entity tag for this resource. */\n readonly etag: string;\n /** Id of a queue. */\n readonly id: string;\n /** Friendly name of this queue. */\n name?: string;\n /** Id of a distribution policy that will determine how a job is distributed to workers. */\n distributionPolicyId?: string;\n /** A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean. */\n labels?: Record<string, any>;\n /** Id of an exception policy that determines various job escalation rules. */\n exceptionPolicyId?: string;\n}\n\n/** Paged collection of RouterQueue items */\nexport interface PagedRouterQueueOutput {\n /** The RouterQueue items on this page */\n value: Array<RouterQueueOutput>;\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** A unit of work to be routed */\nexport interface RouterJobOutput {\n /** The entity tag for this resource. */\n readonly etag: string;\n /** Id of a job. */\n readonly id: string;\n /** Reference to an external parent context, eg. call ID. */\n channelReference?: string;\n /**\n * The status of the job.\n *\n * Possible values: \"pendingClassification\", \"queued\", \"assigned\", \"completed\", \"closed\", \"cancelled\", \"classificationFailed\", \"created\", \"pendingSchedule\", \"scheduled\", \"scheduleFailed\", \"waitingForActivation\"\n */\n readonly status?: RouterJobStatusOutput;\n /** Timestamp a job was queued in UTC. */\n readonly enqueuedAt?: string;\n /** The channel identifier. eg. voice, chat, etc. */\n channelId?: string;\n /** Id of a classification policy used for classifying this job. */\n classificationPolicyId?: string;\n /** Id of a queue that this job is queued to. */\n queueId?: string;\n /** Priority of this job. Value must be between -100 to 100. */\n priority?: number;\n /** Reason code for cancelled or closed jobs. */\n dispositionCode?: string;\n /** A collection of manually specified worker selectors, which a worker must satisfy in order to process this job. */\n requestedWorkerSelectors?: Array<RouterWorkerSelectorOutput>;\n /** A collection of worker selectors attached by a classification policy, which a worker must satisfy in order to process this job. */\n readonly attachedWorkerSelectors?: Array<RouterWorkerSelectorOutput>;\n /** A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean. */\n labels?: Record<string, any>;\n /** A collection of the assignments of the job. Key is AssignmentId. */\n readonly assignments?: Record<string, RouterJobAssignmentOutput>;\n /** A set of non-identifying attributes attached to this job. Values must be primitive values - number, string, boolean. */\n tags?: Record<string, any>;\n /** Notes attached to a job, sorted by timestamp. */\n notes?: Array<RouterJobNoteOutput>;\n /** If set, job will be scheduled to be enqueued at a given time. */\n readonly scheduledAt?: string;\n /** If provided, will determine how job matching will be carried out. Default mode: QueueAndMatchMode. */\n matchingMode?: JobMatchingModeOutput;\n}\n\n/** Assignment details of a job to a worker. */\nexport interface RouterJobAssignmentOutput {\n /** Id of a job assignment. */\n readonly assignmentId: string;\n /** Id of the Worker assigned to the job. */\n workerId?: string;\n /** Timestamp when the job was assigned to a worker in UTC. */\n assignedAt: string;\n /** Timestamp when the job was marked as completed after being assigned in UTC. */\n completedAt?: string;\n /** Timestamp when the job was marked as closed after being completed in UTC. */\n closedAt?: string;\n}\n\n/** A note attached to a job. */\nexport interface RouterJobNoteOutput {\n /** The message contained in the note. */\n message: string;\n /** The time at which the note was added in UTC. If not provided, will default to the current time. */\n addedAt?: string;\n}\n\n/**\n * A matching mode of one of the following types:\n * QueueAndMatchMode: Used when matching worker to a job is required to be done right after job is queued.\n * ScheduleAndSuspendMode: Used for scheduling jobs to be queued at a future time. At specified time, matching of a worker to the job will not start automatically.\n * SuspendMode: Used when matching workers to a job needs to be suspended.\n */\nexport interface JobMatchingModeOutputParent {\n kind: JobMatchingModeKindOutput;\n}\n\n/** Describes a matching mode used for scheduling jobs to be queued at a future time. At the specified time, matching worker to a job will not start automatically. */\nexport interface ScheduleAndSuspendModeOutput extends JobMatchingModeOutputParent {\n /** Requested schedule time. */\n scheduleAt: string;\n /** The type discriminator describing ScheduleAndSuspendMode */\n kind: \"scheduleAndSuspend\";\n}\n\n/** Describes a matching mode where matching worker to a job is automatically started after job is queued successfully. */\nexport interface QueueAndMatchModeOutput extends JobMatchingModeOutputParent {\n /** The type discriminator describing QueueAndMatchMode */\n kind: \"queueAndMatch\";\n}\n\n/** Describes a matching mode where matching worker to a job is suspended. */\nexport interface SuspendModeOutput extends JobMatchingModeOutputParent {\n /** The type discriminator describing SuspendMode */\n kind: \"suspend\";\n}\n\n/** Response payload from reclassifying a job. */\nexport interface ReclassifyJobResultOutput {}\n\n/** Response payload from cancelling a job. */\nexport interface CancelJobResultOutput {}\n\n/** Response payload from completing a job. */\nexport interface CompleteJobResultOutput {}\n\n/** Response payload from closing a job. */\nexport interface CloseJobResultOutput {}\n\n/** Paged collection of RouterJob items */\nexport interface PagedRouterJobOutput {\n /** The RouterJob items on this page */\n value: Array<RouterJobOutput>;\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** Position and estimated wait time for a job. */\nexport interface RouterJobPositionDetailsOutput {\n /** Id of the job these details are about. */\n jobId: string;\n /** Position of the job in question within that queue. */\n position: number;\n /** Id of the queue this job is enqueued in. */\n queueId: string;\n /** Length of the queue: total number of enqueued jobs. */\n queueLength: number;\n /** Estimated wait time of the job rounded up to the nearest minute. */\n estimatedWaitTimeMinutes: number;\n}\n\n/** Response payload after a job has been successfully unassigned. */\nexport interface UnassignJobResultOutput {\n /** Id of an unassigned job. */\n jobId: string;\n /** The number of times a job is unassigned. At a maximum 3. */\n unassignmentCount: number;\n}\n\n/** Response containing ids for the worker, job, and assignment from an accepted offer. */\nexport interface AcceptJobOfferResultOutput {\n /** Id of job assignment that assigns a worker that has accepted an offer to a job. */\n assignmentId: string;\n /** Id of the job assigned. */\n jobId: string;\n /** Id of the worker that has been assigned this job. */\n workerId: string;\n}\n\n/** Response payload from declining a job. */\nexport interface DeclineJobOfferResultOutput {}\n\n/** Statistics for the queue. */\nexport interface RouterQueueStatisticsOutput {\n /** Id of the queue these details are about. */\n queueId: string;\n /** Length of the queue: total number of enqueued jobs. */\n length: number;\n /** The estimated wait time of this queue rounded up to the nearest minute, grouped by job priority. */\n estimatedWaitTimeMinutes?: Record<string, number>;\n /** The wait time of the job that has been enqueued in this queue for the longest. */\n longestJobWaitTimeMinutes?: number;\n}\n\n/** An entity for jobs to be routed to. */\nexport interface RouterWorkerOutput {\n /** The entity tag for this resource. */\n readonly etag: string;\n /** Id of a worker. */\n readonly id: string;\n /**\n * Current state of a worker.\n *\n * Possible values: \"active\", \"draining\", \"inactive\"\n */\n readonly state?: RouterWorkerStateOutput;\n /** Collection of queue(s) that this worker can receive work from. */\n queues?: string[];\n /** The total capacity score this worker has to manage multiple concurrent jobs. */\n capacity?: number;\n /** A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean. */\n labels?: Record<string, any>;\n /** A set of non-identifying attributes attached to this worker. Values must be primitive values - number, string, boolean. */\n tags?: Record<string, any>;\n /** Collection of channel(s) this worker can handle and their impact on the workers capacity. */\n channels?: Array<RouterChannelOutput>;\n /** A list of active offers issued to this worker. */\n readonly offers?: Array<RouterJobOfferOutput>;\n /** A list of assigned jobs attached to this worker. */\n readonly assignedJobs?: Array<RouterWorkerAssignmentOutput>;\n /** A value indicating the workers capacity. A value of '1' means all capacity is consumed. A value of '0' means no capacity is currently consumed. */\n readonly loadRatio?: number;\n /** A flag indicating this worker is open to receive offers or not. */\n availableForOffers?: boolean;\n /** If this is set, the worker will only receive up to this many new offers at a time. */\n maxConcurrentOffers?: number;\n}\n\n/** Represents the capacity a job in this channel will consume from a worker. */\nexport interface RouterChannelOutput {\n /** Id of a channel. */\n channelId: string;\n /** The amount of capacity that an instance of a job of this channel will consume of the total worker capacity. */\n capacityCostPerJob: number;\n /** The maximum number of jobs that can be supported concurrently for this channel. Value must be greater than zero. */\n maxNumberOfJobs?: number;\n}\n\n/** An offer of a job to a worker. */\nexport interface RouterJobOfferOutput {\n /** Id of an offer. */\n readonly offerId: string;\n /** Id of the job. */\n jobId: string;\n /** The capacity cost consumed by the job offer. */\n capacityCost: number;\n /** Timestamp when the offer was created in UTC. */\n offeredAt?: string;\n /** Timestamp when the offer will expire in UTC. */\n expiresAt?: string;\n}\n\n/** The assignment for a worker to a job. */\nexport interface RouterWorkerAssignmentOutput {\n /** Id of the assignment. */\n assignmentId: string;\n /** Id of the job assigned. */\n jobId: string;\n /** The amount of capacity this assignment has consumed on the worker. */\n capacityCost: number;\n /** The assignment time of the job in UTC. */\n assignedAt: string;\n}\n\n/** Paged collection of RouterWorker items */\nexport interface PagedRouterWorkerOutput {\n /** The RouterWorker items on this page */\n value: Array<RouterWorkerOutput>;\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** An attachment of queue selectors to resolve a queue to a job from a classification policy. */\nexport type QueueSelectorAttachmentOutput =\n | QueueSelectorAttachmentOutputParent\n | ConditionalQueueSelectorAttachmentOutput\n | PassThroughQueueSelectorAttachmentOutput\n | RuleEngineQueueSelectorAttachmentOutput\n | StaticQueueSelectorAttachmentOutput\n | WeightedAllocationQueueSelectorAttachmentOutput;\n/**\n * A rule of one of the following types:\n * StaticRule: A rule providing static rules that always return the same result, regardless of input.\n * DirectMapRule: A rule that return the same labels as the input labels.\n * ExpressionRule: A rule providing inline expression rules.\n * FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function.\n * WebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol.\n */\nexport type RouterRuleOutput =\n | RouterRuleOutputParent\n | DirectMapRouterRuleOutput\n | ExpressionRouterRuleOutput\n | FunctionRouterRuleOutput\n | StaticRouterRuleOutput\n | WebhookRouterRuleOutput;\n/** An attachment which attaches worker selectors to a job. */\nexport type WorkerSelectorAttachmentOutput =\n | WorkerSelectorAttachmentOutputParent\n | ConditionalWorkerSelectorAttachmentOutput\n | PassThroughWorkerSelectorAttachmentOutput\n | RuleEngineWorkerSelectorAttachmentOutput\n | StaticWorkerSelectorAttachmentOutput\n | WeightedAllocationWorkerSelectorAttachmentOutput;\n/** Abstract base class for defining a distribution mode. */\nexport type DistributionModeOutput =\n | DistributionModeOutputParent\n | BestWorkerModeOutput\n | LongestIdleModeOutput\n | RoundRobinModeOutput;\n/** Abstract base class for defining a trigger for exception rules. */\nexport type ExceptionTriggerOutput =\n | ExceptionTriggerOutputParent\n | QueueLengthExceptionTriggerOutput\n | WaitTimeExceptionTriggerOutput;\n/** The action to take when the exception is triggered. */\nexport type ExceptionActionOutput =\n | ExceptionActionOutputParent\n | CancelExceptionActionOutput\n | ManualReclassifyExceptionActionOutput\n | ReclassifyExceptionActionOutput;\n/**\n * A matching mode of one of the following types:\n * QueueAndMatchMode: Used when matching worker to a job is required to be done right after job is queued.\n * ScheduleAndSuspendMode: Used for scheduling jobs to be queued at a future time. At specified time, matching of a worker to the job will not start automatically.\n * SuspendMode: Used when matching workers to a job needs to be suspended.\n */\nexport type JobMatchingModeOutput =\n | JobMatchingModeOutputParent\n | ScheduleAndSuspendModeOutput\n | QueueAndMatchModeOutput\n | SuspendModeOutput;\n/** Alias for QueueSelectorAttachmentKindOutput */\nexport type QueueSelectorAttachmentKindOutput = string;\n/** Alias for RouterRuleKindOutput */\nexport type RouterRuleKindOutput = string;\n/** Alias for ExpressionRouterRuleLanguageOutput */\nexport type ExpressionRouterRuleLanguageOutput = string;\n/** Alias for LabelOperatorOutput */\nexport type LabelOperatorOutput = string;\n/** Alias for WorkerSelectorAttachmentKindOutput */\nexport type WorkerSelectorAttachmentKindOutput = string;\n/** Alias for RouterWorkerSelectorStatusOutput */\nexport type RouterWorkerSelectorStatusOutput = string;\n/** Alias for DistributionModeKindOutput */\nexport type DistributionModeKindOutput = string;\n/** Alias for ScoringRuleParameterSelectorOutput */\nexport type ScoringRuleParameterSelectorOutput = string;\n/** Alias for ExceptionTriggerKindOutput */\nexport type ExceptionTriggerKindOutput = string;\n/** Alias for ExceptionActionKindOutput */\nexport type ExceptionActionKindOutput = string;\n/** Alias for RouterJobStatusOutput */\nexport type RouterJobStatusOutput = string;\n/** Alias for JobMatchingModeKindOutput */\nexport type JobMatchingModeKindOutput = string;\n/** Alias for RouterWorkerStateOutput */\nexport type RouterWorkerStateOutput = string;\n"]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Client, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
2
|
+
/**
|
|
3
|
+
* An interface that tracks the settings for paged iteration
|
|
4
|
+
*/
|
|
5
|
+
export interface PageSettings {
|
|
6
|
+
/**
|
|
7
|
+
* The token that keeps track of where to continue the iterator
|
|
8
|
+
*/
|
|
9
|
+
continuationToken?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* An interface that allows async iterable iteration both to completion and by page.
|
|
13
|
+
*/
|
|
14
|
+
export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings = PageSettings> {
|
|
15
|
+
/**
|
|
16
|
+
* The next method, part of the iteration protocol
|
|
17
|
+
*/
|
|
18
|
+
next(): Promise<IteratorResult<TElement>>;
|
|
19
|
+
/**
|
|
20
|
+
* The connection to the async iterator, part of the iteration protocol
|
|
21
|
+
*/
|
|
22
|
+
[Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
23
|
+
/**
|
|
24
|
+
* Return an AsyncIterableIterator that works a page at a time
|
|
25
|
+
*/
|
|
26
|
+
byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Helper type to extract the type of an array
|
|
30
|
+
*/
|
|
31
|
+
export type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
|
|
32
|
+
/**
|
|
33
|
+
* The type of a custom function that defines how to get a page and a link to the next one if any.
|
|
34
|
+
*/
|
|
35
|
+
export type GetPage<TPage> = (pageLink: string) => Promise<{
|
|
36
|
+
page: TPage;
|
|
37
|
+
nextPageLink?: string;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Options for the paging helper
|
|
41
|
+
*/
|
|
42
|
+
export interface PagingOptions<TResponse> {
|
|
43
|
+
/**
|
|
44
|
+
* Custom function to extract pagination details for crating the PagedAsyncIterableIterator
|
|
45
|
+
*/
|
|
46
|
+
customGetPage?: GetPage<PaginateReturn<TResponse>[]>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Helper type to infer the Type of the paged elements from the response type
|
|
50
|
+
* This type is generated based on the swagger information for x-ms-pageable
|
|
51
|
+
* specifically on the itemName property which indicates the property of the response
|
|
52
|
+
* where the page items are found. The default value is `value`.
|
|
53
|
+
* This type will allow us to provide strongly typed Iterator based on the response we get as second parameter
|
|
54
|
+
*/
|
|
55
|
+
export type PaginateReturn<TResult> = TResult extends {
|
|
56
|
+
body: {
|
|
57
|
+
value?: infer TPage;
|
|
58
|
+
};
|
|
59
|
+
} ? GetArrayType<TPage> : Array<unknown>;
|
|
60
|
+
/**
|
|
61
|
+
* Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
|
|
62
|
+
* @param client - Client to use for sending the next page requests
|
|
63
|
+
* @param initialResponse - Initial response containing the nextLink and current page of elements
|
|
64
|
+
* @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
|
|
65
|
+
* @returns - PagedAsyncIterableIterator to iterate the elements
|
|
66
|
+
*/
|
|
67
|
+
export declare function paginate<TResponse extends PathUncheckedResponse>(client: Client, initialResponse: TResponse, options?: PagingOptions<TResponse>): PagedAsyncIterableIterator<PaginateReturn<TResponse>>;
|
|
68
|
+
//# sourceMappingURL=paginateHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginateHelper.d.ts","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAuF7E;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B,CACzC,QAAQ,EACR,KAAK,GAAG,QAAQ,EAAE,EAClB,aAAa,GAAG,YAAY;IAE5B;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1C;;OAEG;IACH,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,0BAA0B,CAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;IACrF;;OAEG;IACH,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,aAAa,KAAK,qBAAqB,CAAC,KAAK,CAAC,CAAC;CACpE;AAyBD;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,KAAK,IAAI,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IACzD,IAAI,EAAE,KAAK,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,SAAS;IACtC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;CACtD;AAED;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,CAAC,OAAO,IAAI,OAAO,SAAS;IACpD,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAA;KAAE,CAAC;CAC/B,GACG,YAAY,CAAC,KAAK,CAAC,GACnB,KAAK,CAAC,OAAO,CAAC,CAAC;AAEnB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,SAAS,SAAS,qBAAqB,EAC9D,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,SAAS,EAC1B,OAAO,GAAE,aAAa,CAAC,SAAS,CAAM,GACrC,0BAA0B,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CA0BvD"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
|
|
4
|
+
import { createRestError } from "@azure-rest/core-client";
|
|
5
|
+
/**
|
|
6
|
+
* returns an async iterator that iterates over results. It also has a `byPage`
|
|
7
|
+
* method that returns pages of items at once.
|
|
8
|
+
*
|
|
9
|
+
* @param pagedResult - an object that specifies how to get pages.
|
|
10
|
+
* @returns a paged async iterator that iterates over results.
|
|
11
|
+
*/
|
|
12
|
+
function getPagedAsyncIterator(pagedResult) {
|
|
13
|
+
var _a;
|
|
14
|
+
const iter = getItemAsyncIterator(pagedResult);
|
|
15
|
+
return {
|
|
16
|
+
next() {
|
|
17
|
+
return iter.next();
|
|
18
|
+
},
|
|
19
|
+
[Symbol.asyncIterator]() {
|
|
20
|
+
return this;
|
|
21
|
+
},
|
|
22
|
+
byPage: (_a = pagedResult === null || pagedResult === void 0 ? void 0 : pagedResult.byPage) !== null && _a !== void 0 ? _a : ((settings) => {
|
|
23
|
+
const { continuationToken } = settings !== null && settings !== void 0 ? settings : {};
|
|
24
|
+
return getPageAsyncIterator(pagedResult, {
|
|
25
|
+
pageLink: continuationToken,
|
|
26
|
+
});
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function getItemAsyncIterator(pagedResult) {
|
|
31
|
+
return __asyncGenerator(this, arguments, function* getItemAsyncIterator_1() {
|
|
32
|
+
var _a, e_1, _b, _c, _d, e_2, _e, _f;
|
|
33
|
+
const pages = getPageAsyncIterator(pagedResult);
|
|
34
|
+
const firstVal = yield __await(pages.next());
|
|
35
|
+
// if the result does not have an array shape, i.e. TPage = TElement, then we return it as is
|
|
36
|
+
if (!Array.isArray(firstVal.value)) {
|
|
37
|
+
// can extract elements from this page
|
|
38
|
+
const { toElements } = pagedResult;
|
|
39
|
+
if (toElements) {
|
|
40
|
+
yield __await(yield* __asyncDelegator(__asyncValues(toElements(firstVal.value))));
|
|
41
|
+
try {
|
|
42
|
+
for (var _g = true, pages_1 = __asyncValues(pages), pages_1_1; pages_1_1 = yield __await(pages_1.next()), _a = pages_1_1.done, !_a; _g = true) {
|
|
43
|
+
_c = pages_1_1.value;
|
|
44
|
+
_g = false;
|
|
45
|
+
const page = _c;
|
|
46
|
+
yield __await(yield* __asyncDelegator(__asyncValues(toElements(page))));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
50
|
+
finally {
|
|
51
|
+
try {
|
|
52
|
+
if (!_g && !_a && (_b = pages_1.return)) yield __await(_b.call(pages_1));
|
|
53
|
+
}
|
|
54
|
+
finally { if (e_1) throw e_1.error; }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
yield yield __await(firstVal.value);
|
|
59
|
+
// `pages` is of type `AsyncIterableIterator<TPage>` but TPage = TElement in this case
|
|
60
|
+
yield __await(yield* __asyncDelegator(__asyncValues(pages)));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
yield __await(yield* __asyncDelegator(__asyncValues(firstVal.value)));
|
|
65
|
+
try {
|
|
66
|
+
for (var _h = true, pages_2 = __asyncValues(pages), pages_2_1; pages_2_1 = yield __await(pages_2.next()), _d = pages_2_1.done, !_d; _h = true) {
|
|
67
|
+
_f = pages_2_1.value;
|
|
68
|
+
_h = false;
|
|
69
|
+
const page = _f;
|
|
70
|
+
// pages is of type `AsyncIterableIterator<TPage>` so `page` is of type `TPage`. In this branch,
|
|
71
|
+
// it must be the case that `TPage = TElement[]`
|
|
72
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
76
|
+
finally {
|
|
77
|
+
try {
|
|
78
|
+
if (!_h && !_d && (_e = pages_2.return)) yield __await(_e.call(pages_2));
|
|
79
|
+
}
|
|
80
|
+
finally { if (e_2) throw e_2.error; }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function getPageAsyncIterator(pagedResult_1) {
|
|
86
|
+
return __asyncGenerator(this, arguments, function* getPageAsyncIterator_1(pagedResult, options = {}) {
|
|
87
|
+
const { pageLink } = options;
|
|
88
|
+
let response = yield __await(pagedResult.getPage(pageLink !== null && pageLink !== void 0 ? pageLink : pagedResult.firstPageLink));
|
|
89
|
+
if (!response) {
|
|
90
|
+
return yield __await(void 0);
|
|
91
|
+
}
|
|
92
|
+
yield yield __await(response.page);
|
|
93
|
+
while (response.nextPageLink) {
|
|
94
|
+
response = yield __await(pagedResult.getPage(response.nextPageLink));
|
|
95
|
+
if (!response) {
|
|
96
|
+
return yield __await(void 0);
|
|
97
|
+
}
|
|
98
|
+
yield yield __await(response.page);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
|
|
104
|
+
* @param client - Client to use for sending the next page requests
|
|
105
|
+
* @param initialResponse - Initial response containing the nextLink and current page of elements
|
|
106
|
+
* @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
|
|
107
|
+
* @returns - PagedAsyncIterableIterator to iterate the elements
|
|
108
|
+
*/
|
|
109
|
+
export function paginate(client, initialResponse, options = {}) {
|
|
110
|
+
let firstRun = true;
|
|
111
|
+
const itemName = "value";
|
|
112
|
+
const nextLinkName = "nextLink";
|
|
113
|
+
const { customGetPage } = options;
|
|
114
|
+
const pagedResult = {
|
|
115
|
+
firstPageLink: "",
|
|
116
|
+
getPage: typeof customGetPage === "function"
|
|
117
|
+
? customGetPage
|
|
118
|
+
: async (pageLink) => {
|
|
119
|
+
const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();
|
|
120
|
+
firstRun = false;
|
|
121
|
+
checkPagingRequest(result);
|
|
122
|
+
const nextLink = getNextLink(result.body, nextLinkName);
|
|
123
|
+
const values = getElements(result.body, itemName);
|
|
124
|
+
return {
|
|
125
|
+
page: values,
|
|
126
|
+
nextPageLink: nextLink,
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
return getPagedAsyncIterator(pagedResult);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Gets for the value of nextLink in the body
|
|
134
|
+
*/
|
|
135
|
+
function getNextLink(body, nextLinkName) {
|
|
136
|
+
if (!nextLinkName) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
const nextLink = body[nextLinkName];
|
|
140
|
+
if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
|
|
141
|
+
throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);
|
|
142
|
+
}
|
|
143
|
+
return nextLink;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Gets the elements of the current request in the body.
|
|
147
|
+
*/
|
|
148
|
+
function getElements(body, itemName) {
|
|
149
|
+
const value = body[itemName];
|
|
150
|
+
// value has to be an array according to the x-ms-pageable extension.
|
|
151
|
+
// The fact that this must be an array is used above to calculate the
|
|
152
|
+
// type of elements in the page in PaginateReturn
|
|
153
|
+
if (!Array.isArray(value)) {
|
|
154
|
+
throw new Error(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
|
|
155
|
+
}
|
|
156
|
+
return value !== null && value !== void 0 ? value : [];
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Checks if a request failed
|
|
160
|
+
*/
|
|
161
|
+
function checkPagingRequest(response) {
|
|
162
|
+
const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"];
|
|
163
|
+
if (!Http2xxStatusCodes.includes(response.status)) {
|
|
164
|
+
throw createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=paginateHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;;;GAMG;AACH,SAAS,qBAAqB,CAM5B,WAAqD;;IAErD,MAAM,IAAI,GAAG,oBAAoB,CAAwC,WAAW,C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,CAAc,IAAa,EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IAEjE,qEAAqE;IACrE,qEAAqE;IACrE,iDAAiD;IACjD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B;IACzD,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError } from \"@azure-rest/core-client\";\n\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings = PageSettings,\n TLink = string,\n>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, TLink, TPageSettings>(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage:\n pagedResult?.byPage ??\n (((settings?: PageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken as unknown as TLink | undefined,\n });\n }) as unknown as (settings?: TPageSettings) => AsyncIterableIterator<TPage>),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TLink, TPageSettings>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n const firstVal = await pages.next();\n // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is\n if (!Array.isArray(firstVal.value)) {\n // can extract elements from this page\n const { toElements } = pagedResult;\n if (toElements) {\n yield* toElements(firstVal.value) as TElement[];\n for await (const page of pages) {\n yield* toElements(page) as TElement[];\n }\n } else {\n yield firstVal.value;\n // `pages` is of type `AsyncIterableIterator<TPage>` but TPage = TElement in this case\n yield* pages as unknown as AsyncIterableIterator<TElement>;\n }\n } else {\n yield* firstVal.value;\n for await (const page of pages) {\n // pages is of type `AsyncIterableIterator<TPage>` so `page` is of type `TPage`. In this branch,\n // it must be the case that `TPage = TElement[]`\n yield* page as unknown as TElement[];\n }\n }\n}\n\nasync function* getPageAsyncIterator<TPage, TLink, TPageSettings>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n options: {\n pageLink?: TLink;\n } = {},\n): AsyncIterableIterator<TPage> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);\n if (!response) {\n return;\n }\n yield response.page;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n yield response.page;\n }\n}\n\n/**\n * An interface that tracks the settings for paged iteration\n */\nexport interface PageSettings {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings = PageSettings,\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\ninterface PagedResult<TPage, TPageSettings = PageSettings, TLink = string> {\n /**\n * Link to the first page of results.\n */\n firstPageLink: TLink;\n /**\n * A method that returns a page of results.\n */\n getPage: (pageLink: TLink) => Promise<{ page: TPage; nextPageLink?: TLink } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => unknown[];\n}\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (pageLink: string) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {},\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n"]}
|