@azure/ai-form-recognizer 5.1.0-alpha.20250619.1 → 5.1.0-alpha.20250718.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.
Files changed (146) hide show
  1. package/dist/browser/bin/defaultFields.js +14 -13
  2. package/dist/browser/bin/defaultFields.js.map +1 -1
  3. package/dist/browser/bin/writeModelCode.js +19 -19
  4. package/dist/browser/bin/writeModelCode.js.map +1 -1
  5. package/dist/browser/documentAnalysisClient.js +29 -13
  6. package/dist/browser/documentAnalysisClient.js.map +1 -1
  7. package/dist/browser/documentModel.js +20 -10
  8. package/dist/browser/documentModel.js.map +1 -1
  9. package/dist/browser/documentModelAdministrationClient.js +33 -10
  10. package/dist/browser/documentModelAdministrationClient.js.map +1 -1
  11. package/dist/browser/error.js +15 -2
  12. package/dist/browser/error.js.map +1 -1
  13. package/dist/browser/generated/generatedClient.js +14 -4
  14. package/dist/browser/generated/generatedClient.js.map +1 -1
  15. package/dist/browser/generated/models/mappers.js +20 -8
  16. package/dist/browser/generated/models/mappers.js.map +1 -1
  17. package/dist/browser/generated/operations/documentClassifiers.js +14 -31
  18. package/dist/browser/generated/operations/documentClassifiers.js.map +1 -1
  19. package/dist/browser/generated/operations/documentModels.js +14 -31
  20. package/dist/browser/generated/operations/documentModels.js.map +1 -1
  21. package/dist/browser/generated/operations/miscellaneous.js +14 -31
  22. package/dist/browser/generated/operations/miscellaneous.js.map +1 -1
  23. package/dist/browser/lro/administration.js +1 -2
  24. package/dist/browser/lro/administration.js.map +1 -1
  25. package/dist/browser/lro/analysis.js +37 -17
  26. package/dist/browser/lro/analysis.js.map +1 -1
  27. package/dist/browser/lro/util/delayMs.js +3 -3
  28. package/dist/browser/lro/util/delayMs.js.map +1 -1
  29. package/dist/browser/lro/util/poller.js +7 -7
  30. package/dist/browser/lro/util/poller.js.map +1 -1
  31. package/dist/browser/models/fields.js +11 -5
  32. package/dist/browser/models/fields.js.map +1 -1
  33. package/dist/browser/transforms/polygon.js +16 -5
  34. package/dist/browser/transforms/polygon.js.map +1 -1
  35. package/dist/browser/util.js +6 -3
  36. package/dist/browser/util.js.map +1 -1
  37. package/dist/commonjs/bin/defaultFields.js +14 -13
  38. package/dist/commonjs/bin/defaultFields.js.map +1 -1
  39. package/dist/commonjs/bin/writeModelCode.js +19 -19
  40. package/dist/commonjs/bin/writeModelCode.js.map +1 -1
  41. package/dist/commonjs/documentAnalysisClient.js +29 -13
  42. package/dist/commonjs/documentAnalysisClient.js.map +1 -1
  43. package/dist/commonjs/documentModel.js +20 -10
  44. package/dist/commonjs/documentModel.js.map +1 -1
  45. package/dist/commonjs/documentModelAdministrationClient.js +33 -10
  46. package/dist/commonjs/documentModelAdministrationClient.js.map +1 -1
  47. package/dist/commonjs/error.js +15 -2
  48. package/dist/commonjs/error.js.map +1 -1
  49. package/dist/commonjs/generated/generatedClient.js +14 -4
  50. package/dist/commonjs/generated/generatedClient.js.map +1 -1
  51. package/dist/commonjs/generated/models/mappers.js +20 -8
  52. package/dist/commonjs/generated/models/mappers.js.map +1 -1
  53. package/dist/commonjs/generated/operations/documentClassifiers.js +14 -30
  54. package/dist/commonjs/generated/operations/documentClassifiers.js.map +1 -1
  55. package/dist/commonjs/generated/operations/documentModels.js +14 -30
  56. package/dist/commonjs/generated/operations/documentModels.js.map +1 -1
  57. package/dist/commonjs/generated/operations/miscellaneous.js +14 -30
  58. package/dist/commonjs/generated/operations/miscellaneous.js.map +1 -1
  59. package/dist/commonjs/lro/administration.js +1 -2
  60. package/dist/commonjs/lro/administration.js.map +1 -1
  61. package/dist/commonjs/lro/analysis.js +37 -17
  62. package/dist/commonjs/lro/analysis.js.map +1 -1
  63. package/dist/commonjs/lro/util/delayMs.js +3 -3
  64. package/dist/commonjs/lro/util/delayMs.js.map +1 -1
  65. package/dist/commonjs/lro/util/poller.js +7 -7
  66. package/dist/commonjs/lro/util/poller.js.map +1 -1
  67. package/dist/commonjs/models/fields.js +11 -5
  68. package/dist/commonjs/models/fields.js.map +1 -1
  69. package/dist/commonjs/transforms/polygon.js +16 -5
  70. package/dist/commonjs/transforms/polygon.js.map +1 -1
  71. package/dist/commonjs/tsdoc-metadata.json +11 -11
  72. package/dist/commonjs/util.js +6 -3
  73. package/dist/commonjs/util.js.map +1 -1
  74. package/dist/esm/bin/defaultFields.js +14 -13
  75. package/dist/esm/bin/defaultFields.js.map +1 -1
  76. package/dist/esm/bin/writeModelCode.js +19 -19
  77. package/dist/esm/bin/writeModelCode.js.map +1 -1
  78. package/dist/esm/documentAnalysisClient.js +29 -13
  79. package/dist/esm/documentAnalysisClient.js.map +1 -1
  80. package/dist/esm/documentModel.js +20 -10
  81. package/dist/esm/documentModel.js.map +1 -1
  82. package/dist/esm/documentModelAdministrationClient.js +33 -10
  83. package/dist/esm/documentModelAdministrationClient.js.map +1 -1
  84. package/dist/esm/error.js +15 -2
  85. package/dist/esm/error.js.map +1 -1
  86. package/dist/esm/generated/generatedClient.js +14 -4
  87. package/dist/esm/generated/generatedClient.js.map +1 -1
  88. package/dist/esm/generated/models/mappers.js +20 -8
  89. package/dist/esm/generated/models/mappers.js.map +1 -1
  90. package/dist/esm/generated/operations/documentClassifiers.js +14 -31
  91. package/dist/esm/generated/operations/documentClassifiers.js.map +1 -1
  92. package/dist/esm/generated/operations/documentModels.js +14 -31
  93. package/dist/esm/generated/operations/documentModels.js.map +1 -1
  94. package/dist/esm/generated/operations/miscellaneous.js +14 -31
  95. package/dist/esm/generated/operations/miscellaneous.js.map +1 -1
  96. package/dist/esm/lro/administration.js +1 -2
  97. package/dist/esm/lro/administration.js.map +1 -1
  98. package/dist/esm/lro/analysis.js +37 -17
  99. package/dist/esm/lro/analysis.js.map +1 -1
  100. package/dist/esm/lro/util/delayMs.js +3 -3
  101. package/dist/esm/lro/util/delayMs.js.map +1 -1
  102. package/dist/esm/lro/util/poller.js +7 -7
  103. package/dist/esm/lro/util/poller.js.map +1 -1
  104. package/dist/esm/models/fields.js +11 -5
  105. package/dist/esm/models/fields.js.map +1 -1
  106. package/dist/esm/transforms/polygon.js +16 -5
  107. package/dist/esm/transforms/polygon.js.map +1 -1
  108. package/dist/esm/util.js +6 -3
  109. package/dist/esm/util.js.map +1 -1
  110. package/dist/react-native/bin/defaultFields.js +14 -13
  111. package/dist/react-native/bin/defaultFields.js.map +1 -1
  112. package/dist/react-native/bin/writeModelCode.js +19 -19
  113. package/dist/react-native/bin/writeModelCode.js.map +1 -1
  114. package/dist/react-native/documentAnalysisClient.js +29 -13
  115. package/dist/react-native/documentAnalysisClient.js.map +1 -1
  116. package/dist/react-native/documentModel.js +20 -10
  117. package/dist/react-native/documentModel.js.map +1 -1
  118. package/dist/react-native/documentModelAdministrationClient.js +33 -10
  119. package/dist/react-native/documentModelAdministrationClient.js.map +1 -1
  120. package/dist/react-native/error.js +15 -2
  121. package/dist/react-native/error.js.map +1 -1
  122. package/dist/react-native/generated/generatedClient.js +14 -4
  123. package/dist/react-native/generated/generatedClient.js.map +1 -1
  124. package/dist/react-native/generated/models/mappers.js +20 -8
  125. package/dist/react-native/generated/models/mappers.js.map +1 -1
  126. package/dist/react-native/generated/operations/documentClassifiers.js +14 -31
  127. package/dist/react-native/generated/operations/documentClassifiers.js.map +1 -1
  128. package/dist/react-native/generated/operations/documentModels.js +14 -31
  129. package/dist/react-native/generated/operations/documentModels.js.map +1 -1
  130. package/dist/react-native/generated/operations/miscellaneous.js +14 -31
  131. package/dist/react-native/generated/operations/miscellaneous.js.map +1 -1
  132. package/dist/react-native/lro/administration.js +1 -2
  133. package/dist/react-native/lro/administration.js.map +1 -1
  134. package/dist/react-native/lro/analysis.js +37 -17
  135. package/dist/react-native/lro/analysis.js.map +1 -1
  136. package/dist/react-native/lro/util/delayMs.js +3 -3
  137. package/dist/react-native/lro/util/delayMs.js.map +1 -1
  138. package/dist/react-native/lro/util/poller.js +7 -7
  139. package/dist/react-native/lro/util/poller.js.map +1 -1
  140. package/dist/react-native/models/fields.js +11 -5
  141. package/dist/react-native/models/fields.js.map +1 -1
  142. package/dist/react-native/transforms/polygon.js +16 -5
  143. package/dist/react-native/transforms/polygon.js.map +1 -1
  144. package/dist/react-native/util.js +6 -3
  145. package/dist/react-native/util.js.map +1 -1
  146. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"documentClassifiers.js","sourceRoot":"","sources":["../../../../src/generated/operations/documentClassifiers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAIH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAuBtD,4CAA4C;AAC5C,uDAAuD;AACvD,MAAM,OAAO,uBAAuB;IAGlC;;;OAGG;IACH,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,eAAe,CACpB,OAA0D;QAE1D,MAAM,IAAI,GAAG,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACpD,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,GAAG,EAAE;gBACX,OAAO,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;YACjD,CAAC;SACF,CAAC;IACJ,CAAC;IAEc,yBAAyB,CACtC,OAA0D;;YAE1D,IAAI,MAAM,GAAG,cAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA,CAAC;YAClD,oBAAM,MAAM,CAAC,KAAK,IAAI,EAAE,CAAA,CAAC;YACzB,IAAI,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC;YACxC,OAAO,iBAAiB,EAAE,CAAC;gBACzB,MAAM,GAAG,cAAM,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,EA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CAAC;IACtC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { DocumentClassifiers } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { GeneratedClient } from \"../generatedClient.js\";\nimport {\n DocumentClassifierDetails,\n DocumentClassifiersListClassifiersNextOptionalParams,\n DocumentClassifiersListClassifiersOptionalParams,\n BuildDocumentClassifierRequest,\n DocumentClassifiersBuildClassifierOptionalParams,\n DocumentClassifiersBuildClassifierResponse,\n DocumentClassifiersListClassifiersResponse,\n DocumentClassifiersGetClassifierOptionalParams,\n DocumentClassifiersGetClassifierResponse,\n DocumentClassifiersDeleteClassifierOptionalParams,\n ContentType,\n DocumentClassifiersClassifyDocument$binaryOptionalParams,\n DocumentClassifiersClassifyDocument$textOptionalParams,\n DocumentClassifiersClassifyDocument$jsonOptionalParams,\n DocumentClassifiersClassifyDocumentResponse,\n DocumentClassifiersGetClassifyResultOptionalParams,\n DocumentClassifiersGetClassifyResultResponse,\n DocumentClassifiersListClassifiersNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing DocumentClassifiers operations. */\nexport class DocumentClassifiersImpl implements DocumentClassifiers {\n private readonly client: GeneratedClient;\n\n /**\n * Initialize a new instance of the class DocumentClassifiers class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClient) {\n this.client = client;\n }\n\n /**\n * List all document classifiers.\n * @param options The options parameters.\n */\n public listClassifiers(\n options?: DocumentClassifiersListClassifiersOptionalParams\n ): PagedAsyncIterableIterator<DocumentClassifierDetails> {\n const iter = this.listClassifiersPagingAll(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listClassifiersPagingPage(options);\n }\n };\n }\n\n private async *listClassifiersPagingPage(\n options?: DocumentClassifiersListClassifiersOptionalParams\n ): AsyncIterableIterator<DocumentClassifierDetails[]> {\n let result = await this._listClassifiers(options);\n yield result.value || [];\n let continuationToken = result.nextLink;\n while (continuationToken) {\n result = await this._listClassifiersNext(continuationToken, options);\n continuationToken = result.nextLink;\n yield result.value || [];\n }\n }\n\n private async *listClassifiersPagingAll(\n options?: DocumentClassifiersListClassifiersOptionalParams\n ): AsyncIterableIterator<DocumentClassifierDetails> {\n for await (const page of this.listClassifiersPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Builds a custom document classifier.\n * @param buildRequest Building request parameters.\n * @param options The options parameters.\n */\n buildClassifier(\n buildRequest: BuildDocumentClassifierRequest,\n options?: DocumentClassifiersBuildClassifierOptionalParams\n ): Promise<DocumentClassifiersBuildClassifierResponse> {\n return this.client.sendOperationRequest(\n { buildRequest, options },\n buildClassifierOperationSpec\n );\n }\n\n /**\n * List all document classifiers.\n * @param options The options parameters.\n */\n private _listClassifiers(\n options?: DocumentClassifiersListClassifiersOptionalParams\n ): Promise<DocumentClassifiersListClassifiersResponse> {\n return this.client.sendOperationRequest(\n { options },\n listClassifiersOperationSpec\n );\n }\n\n /**\n * Gets detailed document classifier information.\n * @param classifierId Unique document classifier name.\n * @param options The options parameters.\n */\n getClassifier(\n classifierId: string,\n options?: DocumentClassifiersGetClassifierOptionalParams\n ): Promise<DocumentClassifiersGetClassifierResponse> {\n return this.client.sendOperationRequest(\n { classifierId, options },\n getClassifierOperationSpec\n );\n }\n\n /**\n * Deletes document classifier.\n * @param classifierId Unique document classifier name.\n * @param options The options parameters.\n */\n deleteClassifier(\n classifierId: string,\n options?: DocumentClassifiersDeleteClassifierOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { classifierId, options },\n deleteClassifierOperationSpec\n );\n }\n\n /**\n * Classifies document with document classifier.\n * @param classifierId Unique document classifier name.\n * @param contentType Upload file type\n * @param options The options parameters.\n */\n classifyDocument(\n classifierId: string,\n contentType: ContentType,\n options?: DocumentClassifiersClassifyDocument$binaryOptionalParams\n ): Promise<DocumentClassifiersClassifyDocumentResponse>;\n /**\n * Classifies document with document classifier.\n * @param classifierId Unique document classifier name.\n * @param contentType Upload file type\n * @param options The options parameters.\n */\n classifyDocument(\n classifierId: string,\n contentType: \"text/html\",\n options?: DocumentClassifiersClassifyDocument$textOptionalParams\n ): Promise<DocumentClassifiersClassifyDocumentResponse>;\n /**\n * Classifies document with document classifier.\n * @param classifierId Unique document classifier name.\n * @param contentType Body Parameter content-type\n * @param options The options parameters.\n */\n classifyDocument(\n classifierId: string,\n contentType: \"application/json\",\n options?: DocumentClassifiersClassifyDocument$jsonOptionalParams\n ): Promise<DocumentClassifiersClassifyDocumentResponse>;\n /**\n * Classifies document with document classifier.\n * @param args Includes all the parameters for this operation.\n */\n classifyDocument(\n ...args:\n | [\n string,\n ContentType,\n DocumentClassifiersClassifyDocument$binaryOptionalParams?\n ]\n | [\n string,\n \"text/html\",\n DocumentClassifiersClassifyDocument$textOptionalParams?\n ]\n | [\n string,\n \"application/json\",\n DocumentClassifiersClassifyDocument$jsonOptionalParams?\n ]\n ): Promise<DocumentClassifiersClassifyDocumentResponse> {\n let operationSpec: coreClient.OperationSpec;\n let operationArguments: coreClient.OperationArguments;\n let options;\n if (\n args[1] === \"application/octet-stream\" ||\n args[1] === \"application/pdf\" ||\n args[1] ===\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\" ||\n args[1] ===\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" ||\n args[1] ===\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" ||\n args[1] === \"image/bmp\" ||\n args[1] === \"image/heif\" ||\n args[1] === \"image/jpeg\" ||\n args[1] === \"image/png\" ||\n args[1] === \"image/tiff\"\n ) {\n operationSpec = classifyDocument$binaryOperationSpec;\n operationArguments = {\n classifierId: args[0],\n contentType: args[1],\n options: args[2]\n };\n options = args[2];\n } else if (args[1] === \"text/html\") {\n operationSpec = classifyDocument$textOperationSpec;\n operationArguments = {\n classifierId: args[0],\n contentType: args[1],\n options: args[2]\n };\n options = args[2];\n } else if (args[1] === \"application/json\") {\n operationSpec = classifyDocument$jsonOperationSpec;\n operationArguments = {\n classifierId: args[0],\n contentType: args[1],\n options: args[2]\n };\n options = args[2];\n } else {\n throw new TypeError(\n `\"contentType\" must be a valid value but instead was \"${args[1]}\".`\n );\n }\n operationArguments.options = options || {};\n return this.client.sendOperationRequest(operationArguments, operationSpec);\n }\n\n /**\n * Gets the result of document classifier.\n * @param classifierId Unique document classifier name.\n * @param resultId Analyze operation result ID.\n * @param options The options parameters.\n */\n getClassifyResult(\n classifierId: string,\n resultId: string,\n options?: DocumentClassifiersGetClassifyResultOptionalParams\n ): Promise<DocumentClassifiersGetClassifyResultResponse> {\n return this.client.sendOperationRequest(\n { classifierId, resultId, options },\n getClassifyResultOperationSpec\n );\n }\n\n /**\n * ListClassifiersNext\n * @param nextLink The nextLink from the previous successful call to the ListClassifiers method.\n * @param options The options parameters.\n */\n private _listClassifiersNext(\n nextLink: string,\n options?: DocumentClassifiersListClassifiersNextOptionalParams\n ): Promise<DocumentClassifiersListClassifiersNextResponse> {\n return this.client.sendOperationRequest(\n { nextLink, options },\n listClassifiersNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst buildClassifierOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers:build\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentClassifiersBuildClassifierHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.buildRequest1,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2, Parameters.contentType3],\n mediaType: \"json\",\n serializer\n};\nconst listClassifiersOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GetDocumentClassifiersResponse\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst getClassifierOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers/{classifierId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.DocumentClassifierDetails\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.classifierId],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst deleteClassifierOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers/{classifierId}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.classifierId],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst classifyDocument$binaryOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers/{classifierId}:analyze\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentClassifiersClassifyDocumentHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.classifyRequest,\n queryParameters: [Parameters.stringIndexType, Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.classifierId],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"binary\",\n serializer\n};\nconst classifyDocument$textOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers/{classifierId}:analyze\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentClassifiersClassifyDocumentHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.classifyRequest1,\n queryParameters: [Parameters.stringIndexType, Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.classifierId],\n headerParameters: [Parameters.contentType1, Parameters.accept1],\n mediaType: \"text\",\n serializer\n};\nconst classifyDocument$jsonOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers/{classifierId}:analyze\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentClassifiersClassifyDocumentHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.classifyRequest2,\n queryParameters: [Parameters.stringIndexType, Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.classifierId],\n headerParameters: [Parameters.contentType2, Parameters.accept2],\n mediaType: \"json\",\n serializer\n};\nconst getClassifyResultOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers/{classifierId}/analyzeResults/{resultId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeResultOperation\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.endpoint,\n Parameters.resultId,\n Parameters.classifierId\n ],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst listClassifiersNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GetDocumentClassifiersResponse\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.nextLink],\n headerParameters: [Parameters.accept2],\n serializer\n};\n"]}
1
+ {"version":3,"file":"documentClassifiers.js","sourceRoot":"","sources":["../../../../src/generated/operations/documentClassifiers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAA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8BAA8B,GAA6B;IAC/D,IAAI,EAAE,+DAA+D;IACrE,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,sBAAsB;SAC3C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE;QACb,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,YAAY;KACxB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;IACtC,UAAU;CACX,CAAC;AACF,MAAM,gCAAgC,GAA6B;IACjE,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,8BAA8B;SACnD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IACzD,gBAAgB,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;IACtC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { DocumentClassifiers } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { GeneratedClient } from \"../generatedClient.js\";\nimport {\n DocumentClassifierDetails,\n DocumentClassifiersListClassifiersNextOptionalParams,\n DocumentClassifiersListClassifiersOptionalParams,\n BuildDocumentClassifierRequest,\n DocumentClassifiersBuildClassifierOptionalParams,\n DocumentClassifiersBuildClassifierResponse,\n DocumentClassifiersListClassifiersResponse,\n DocumentClassifiersGetClassifierOptionalParams,\n DocumentClassifiersGetClassifierResponse,\n DocumentClassifiersDeleteClassifierOptionalParams,\n ContentType,\n DocumentClassifiersClassifyDocument$binaryOptionalParams,\n DocumentClassifiersClassifyDocument$textOptionalParams,\n DocumentClassifiersClassifyDocument$jsonOptionalParams,\n DocumentClassifiersClassifyDocumentResponse,\n DocumentClassifiersGetClassifyResultOptionalParams,\n DocumentClassifiersGetClassifyResultResponse,\n DocumentClassifiersListClassifiersNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing DocumentClassifiers operations. */\nexport class DocumentClassifiersImpl implements DocumentClassifiers {\n private readonly client: GeneratedClient;\n\n /**\n * Initialize a new instance of the class DocumentClassifiers class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClient) {\n this.client = client;\n }\n\n /**\n * List all document classifiers.\n * @param options The options parameters.\n */\n public listClassifiers(\n options?: DocumentClassifiersListClassifiersOptionalParams\n ): PagedAsyncIterableIterator<DocumentClassifierDetails> {\n const iter = this.listClassifiersPagingAll(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listClassifiersPagingPage(options);\n }\n };\n }\n\n private async *listClassifiersPagingPage(\n options?: DocumentClassifiersListClassifiersOptionalParams\n ): AsyncIterableIterator<DocumentClassifierDetails[]> {\n let result = await this._listClassifiers(options);\n yield result.value || [];\n let continuationToken = result.nextLink;\n while (continuationToken) {\n result = await this._listClassifiersNext(continuationToken, options);\n continuationToken = result.nextLink;\n yield result.value || [];\n }\n }\n\n private async *listClassifiersPagingAll(\n options?: DocumentClassifiersListClassifiersOptionalParams\n ): AsyncIterableIterator<DocumentClassifierDetails> {\n for await (const page of this.listClassifiersPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Builds a custom document classifier.\n * @param buildRequest Building request parameters.\n * @param options The options parameters.\n */\n buildClassifier(\n buildRequest: BuildDocumentClassifierRequest,\n options?: DocumentClassifiersBuildClassifierOptionalParams\n ): Promise<DocumentClassifiersBuildClassifierResponse> {\n return this.client.sendOperationRequest(\n { buildRequest, options },\n buildClassifierOperationSpec\n );\n }\n\n /**\n * List all document classifiers.\n * @param options The options parameters.\n */\n private _listClassifiers(\n options?: DocumentClassifiersListClassifiersOptionalParams\n ): Promise<DocumentClassifiersListClassifiersResponse> {\n return this.client.sendOperationRequest(\n { options },\n listClassifiersOperationSpec\n );\n }\n\n /**\n * Gets detailed document classifier information.\n * @param classifierId Unique document classifier name.\n * @param options The options parameters.\n */\n getClassifier(\n classifierId: string,\n options?: DocumentClassifiersGetClassifierOptionalParams\n ): Promise<DocumentClassifiersGetClassifierResponse> {\n return this.client.sendOperationRequest(\n { classifierId, options },\n getClassifierOperationSpec\n );\n }\n\n /**\n * Deletes document classifier.\n * @param classifierId Unique document classifier name.\n * @param options The options parameters.\n */\n deleteClassifier(\n classifierId: string,\n options?: DocumentClassifiersDeleteClassifierOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { classifierId, options },\n deleteClassifierOperationSpec\n );\n }\n\n /**\n * Classifies document with document classifier.\n * @param classifierId Unique document classifier name.\n * @param contentType Upload file type\n * @param options The options parameters.\n */\n classifyDocument(\n classifierId: string,\n contentType: ContentType,\n options?: DocumentClassifiersClassifyDocument$binaryOptionalParams\n ): Promise<DocumentClassifiersClassifyDocumentResponse>;\n /**\n * Classifies document with document classifier.\n * @param classifierId Unique document classifier name.\n * @param contentType Upload file type\n * @param options The options parameters.\n */\n classifyDocument(\n classifierId: string,\n contentType: \"text/html\",\n options?: DocumentClassifiersClassifyDocument$textOptionalParams\n ): Promise<DocumentClassifiersClassifyDocumentResponse>;\n /**\n * Classifies document with document classifier.\n * @param classifierId Unique document classifier name.\n * @param contentType Body Parameter content-type\n * @param options The options parameters.\n */\n classifyDocument(\n classifierId: string,\n contentType: \"application/json\",\n options?: DocumentClassifiersClassifyDocument$jsonOptionalParams\n ): Promise<DocumentClassifiersClassifyDocumentResponse>;\n /**\n * Classifies document with document classifier.\n * @param args Includes all the parameters for this operation.\n */\n classifyDocument(\n ...args:\n | [\n string,\n ContentType,\n DocumentClassifiersClassifyDocument$binaryOptionalParams?\n ]\n | [\n string,\n \"text/html\",\n DocumentClassifiersClassifyDocument$textOptionalParams?\n ]\n | [\n string,\n \"application/json\",\n DocumentClassifiersClassifyDocument$jsonOptionalParams?\n ]\n ): Promise<DocumentClassifiersClassifyDocumentResponse> {\n let operationSpec: coreClient.OperationSpec;\n let operationArguments: coreClient.OperationArguments;\n let options;\n if (\n args[1] === \"application/octet-stream\" ||\n args[1] === \"application/pdf\" ||\n args[1] ===\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\" ||\n args[1] ===\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" ||\n args[1] ===\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" ||\n args[1] === \"image/bmp\" ||\n args[1] === \"image/heif\" ||\n args[1] === \"image/jpeg\" ||\n args[1] === \"image/png\" ||\n args[1] === \"image/tiff\"\n ) {\n operationSpec = classifyDocument$binaryOperationSpec;\n operationArguments = {\n classifierId: args[0],\n contentType: args[1],\n options: args[2]\n };\n options = args[2];\n } else if (args[1] === \"text/html\") {\n operationSpec = classifyDocument$textOperationSpec;\n operationArguments = {\n classifierId: args[0],\n contentType: args[1],\n options: args[2]\n };\n options = args[2];\n } else if (args[1] === \"application/json\") {\n operationSpec = classifyDocument$jsonOperationSpec;\n operationArguments = {\n classifierId: args[0],\n contentType: args[1],\n options: args[2]\n };\n options = args[2];\n } else {\n throw new TypeError(\n `\"contentType\" must be a valid value but instead was \"${args[1]}\".`\n );\n }\n operationArguments.options = options || {};\n return this.client.sendOperationRequest(operationArguments, operationSpec);\n }\n\n /**\n * Gets the result of document classifier.\n * @param classifierId Unique document classifier name.\n * @param resultId Analyze operation result ID.\n * @param options The options parameters.\n */\n getClassifyResult(\n classifierId: string,\n resultId: string,\n options?: DocumentClassifiersGetClassifyResultOptionalParams\n ): Promise<DocumentClassifiersGetClassifyResultResponse> {\n return this.client.sendOperationRequest(\n { classifierId, resultId, options },\n getClassifyResultOperationSpec\n );\n }\n\n /**\n * ListClassifiersNext\n * @param nextLink The nextLink from the previous successful call to the ListClassifiers method.\n * @param options The options parameters.\n */\n private _listClassifiersNext(\n nextLink: string,\n options?: DocumentClassifiersListClassifiersNextOptionalParams\n ): Promise<DocumentClassifiersListClassifiersNextResponse> {\n return this.client.sendOperationRequest(\n { nextLink, options },\n listClassifiersNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst buildClassifierOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers:build\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentClassifiersBuildClassifierHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.buildRequest1,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2, Parameters.contentType3],\n mediaType: \"json\",\n serializer\n};\nconst listClassifiersOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GetDocumentClassifiersResponse\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst getClassifierOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers/{classifierId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.DocumentClassifierDetails\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.classifierId],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst deleteClassifierOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers/{classifierId}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.classifierId],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst classifyDocument$binaryOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers/{classifierId}:analyze\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentClassifiersClassifyDocumentHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.classifyRequest,\n queryParameters: [Parameters.stringIndexType, Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.classifierId],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"binary\",\n serializer\n};\nconst classifyDocument$textOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers/{classifierId}:analyze\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentClassifiersClassifyDocumentHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.classifyRequest1,\n queryParameters: [Parameters.stringIndexType, Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.classifierId],\n headerParameters: [Parameters.contentType1, Parameters.accept1],\n mediaType: \"text\",\n serializer\n};\nconst classifyDocument$jsonOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers/{classifierId}:analyze\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentClassifiersClassifyDocumentHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.classifyRequest2,\n queryParameters: [Parameters.stringIndexType, Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.classifierId],\n headerParameters: [Parameters.contentType2, Parameters.accept2],\n mediaType: \"json\",\n serializer\n};\nconst getClassifyResultOperationSpec: coreClient.OperationSpec = {\n path: \"/documentClassifiers/{classifierId}/analyzeResults/{resultId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeResultOperation\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.endpoint,\n Parameters.resultId,\n Parameters.classifierId\n ],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst listClassifiersNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GetDocumentClassifiersResponse\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.nextLink],\n headerParameters: [Parameters.accept2],\n serializer\n};\n"]}
@@ -5,13 +5,13 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import * as coreClient from "@azure/core-client";
10
9
  import * as Mappers from "../models/mappers.js";
11
10
  import * as Parameters from "../models/parameters.js";
12
11
  /// <reference lib="esnext.asynciterable" />
13
12
  /** Class containing DocumentModels operations. */
14
13
  export class DocumentModelsImpl {
14
+ client;
15
15
  /**
16
16
  * Initialize a new instance of the class DocumentModels class.
17
17
  * @param client Reference to the service client
@@ -37,37 +37,20 @@ export class DocumentModelsImpl {
37
37
  }
38
38
  };
39
39
  }
40
- listModelsPagingPage(options) {
41
- return __asyncGenerator(this, arguments, function* listModelsPagingPage_1() {
42
- let result = yield __await(this._listModels(options));
43
- yield yield __await(result.value || []);
44
- let continuationToken = result.nextLink;
45
- while (continuationToken) {
46
- result = yield __await(this._listModelsNext(continuationToken, options));
47
- continuationToken = result.nextLink;
48
- yield yield __await(result.value || []);
49
- }
50
- });
40
+ async *listModelsPagingPage(options) {
41
+ let result = await this._listModels(options);
42
+ yield result.value || [];
43
+ let continuationToken = result.nextLink;
44
+ while (continuationToken) {
45
+ result = await this._listModelsNext(continuationToken, options);
46
+ continuationToken = result.nextLink;
47
+ yield result.value || [];
48
+ }
51
49
  }
52
- listModelsPagingAll(options) {
53
- return __asyncGenerator(this, arguments, function* listModelsPagingAll_1() {
54
- var _a, e_1, _b, _c;
55
- try {
56
- for (var _d = true, _e = __asyncValues(this.listModelsPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
57
- _c = _f.value;
58
- _d = false;
59
- const page = _c;
60
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
61
- }
62
- }
63
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
64
- finally {
65
- try {
66
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
67
- }
68
- finally { if (e_1) throw e_1.error; }
69
- }
70
- });
50
+ async *listModelsPagingAll(options) {
51
+ for await (const page of this.listModelsPagingPage(options)) {
52
+ yield* page;
53
+ }
71
54
  }
72
55
  /**
73
56
  * Analyzes document with document model.
@@ -1 +1 @@
1
- {"version":3,"file":"documentModels.js","sourceRoot":"","sources":["../../../../src/generated/operations/documentModels.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAIH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAgCtD,4CAA4C;AAC5C,kDAAkD;AAClD,MAAM,OAAO,kBAAkB;IAG7B;;;OAGG;IACH,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,UAAU,CACf,OAAgD;QA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A2B,GAA6B;IAC5D,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,yBAAyB;SAC9C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IACzD,gBAAgB,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;IACtC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { DocumentModels } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { GeneratedClient } from \"../generatedClient.js\";\nimport {\n DocumentModelSummary,\n DocumentModelsListModelsNextOptionalParams,\n DocumentModelsListModelsOptionalParams,\n ContentType,\n DocumentModelsAnalyzeDocument$binaryOptionalParams,\n DocumentModelsAnalyzeDocument$textOptionalParams,\n DocumentModelsAnalyzeDocument$jsonOptionalParams,\n DocumentModelsAnalyzeDocumentResponse,\n DocumentModelsGetAnalyzeResultOptionalParams,\n DocumentModelsGetAnalyzeResultResponse,\n BuildDocumentModelRequest,\n DocumentModelsBuildModelOptionalParams,\n DocumentModelsBuildModelResponse,\n ComposeDocumentModelRequest,\n DocumentModelsComposeModelOptionalParams,\n DocumentModelsComposeModelResponse,\n AuthorizeCopyRequest,\n DocumentModelsAuthorizeModelCopyOptionalParams,\n DocumentModelsAuthorizeModelCopyResponse,\n CopyAuthorization,\n DocumentModelsCopyModelToOptionalParams,\n DocumentModelsCopyModelToResponse,\n DocumentModelsListModelsResponse,\n DocumentModelsGetModelOptionalParams,\n DocumentModelsGetModelResponse,\n DocumentModelsDeleteModelOptionalParams,\n DocumentModelsListModelsNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing DocumentModels operations. */\nexport class DocumentModelsImpl implements DocumentModels {\n private readonly client: GeneratedClient;\n\n /**\n * Initialize a new instance of the class DocumentModels class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClient) {\n this.client = client;\n }\n\n /**\n * List all document models\n * @param options The options parameters.\n */\n public listModels(\n options?: DocumentModelsListModelsOptionalParams\n ): PagedAsyncIterableIterator<DocumentModelSummary> {\n const iter = this.listModelsPagingAll(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listModelsPagingPage(options);\n }\n };\n }\n\n private async *listModelsPagingPage(\n options?: DocumentModelsListModelsOptionalParams\n ): AsyncIterableIterator<DocumentModelSummary[]> {\n let result = await this._listModels(options);\n yield result.value || [];\n let continuationToken = result.nextLink;\n while (continuationToken) {\n result = await this._listModelsNext(continuationToken, options);\n continuationToken = result.nextLink;\n yield result.value || [];\n }\n }\n\n private async *listModelsPagingAll(\n options?: DocumentModelsListModelsOptionalParams\n ): AsyncIterableIterator<DocumentModelSummary> {\n for await (const page of this.listModelsPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Analyzes document with document model.\n * @param modelId Unique document model name.\n * @param contentType Upload file type\n * @param options The options parameters.\n */\n analyzeDocument(\n modelId: string,\n contentType: ContentType,\n options?: DocumentModelsAnalyzeDocument$binaryOptionalParams\n ): Promise<DocumentModelsAnalyzeDocumentResponse>;\n /**\n * Analyzes document with document model.\n * @param modelId Unique document model name.\n * @param contentType Upload file type\n * @param options The options parameters.\n */\n analyzeDocument(\n modelId: string,\n contentType: \"text/html\",\n options?: DocumentModelsAnalyzeDocument$textOptionalParams\n ): Promise<DocumentModelsAnalyzeDocumentResponse>;\n /**\n * Analyzes document with document model.\n * @param modelId Unique document model name.\n * @param contentType Body Parameter content-type\n * @param options The options parameters.\n */\n analyzeDocument(\n modelId: string,\n contentType: \"application/json\",\n options?: DocumentModelsAnalyzeDocument$jsonOptionalParams\n ): Promise<DocumentModelsAnalyzeDocumentResponse>;\n /**\n * Analyzes document with document model.\n * @param args Includes all the parameters for this operation.\n */\n analyzeDocument(\n ...args:\n | [\n string,\n ContentType,\n DocumentModelsAnalyzeDocument$binaryOptionalParams?\n ]\n | [string, \"text/html\", DocumentModelsAnalyzeDocument$textOptionalParams?]\n | [\n string,\n \"application/json\",\n DocumentModelsAnalyzeDocument$jsonOptionalParams?\n ]\n ): Promise<DocumentModelsAnalyzeDocumentResponse> {\n let operationSpec: coreClient.OperationSpec;\n let operationArguments: coreClient.OperationArguments;\n let options;\n if (\n args[1] === \"application/octet-stream\" ||\n args[1] === \"application/pdf\" ||\n args[1] ===\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\" ||\n args[1] ===\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" ||\n args[1] ===\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" ||\n args[1] === \"image/bmp\" ||\n args[1] === \"image/heif\" ||\n args[1] === \"image/jpeg\" ||\n args[1] === \"image/png\" ||\n args[1] === \"image/tiff\"\n ) {\n operationSpec = analyzeDocument$binaryOperationSpec;\n operationArguments = {\n modelId: args[0],\n contentType: args[1],\n options: args[2]\n };\n options = args[2];\n } else if (args[1] === \"text/html\") {\n operationSpec = analyzeDocument$textOperationSpec;\n operationArguments = {\n modelId: args[0],\n contentType: args[1],\n options: args[2]\n };\n options = args[2];\n } else if (args[1] === \"application/json\") {\n operationSpec = analyzeDocument$jsonOperationSpec;\n operationArguments = {\n modelId: args[0],\n contentType: args[1],\n options: args[2]\n };\n options = args[2];\n } else {\n throw new TypeError(\n `\"contentType\" must be a valid value but instead was \"${args[1]}\".`\n );\n }\n operationArguments.options = options || {};\n return this.client.sendOperationRequest(operationArguments, operationSpec);\n }\n\n /**\n * Gets the result of document analysis.\n * @param modelId Unique document model name.\n * @param resultId Analyze operation result ID.\n * @param options The options parameters.\n */\n getAnalyzeResult(\n modelId: string,\n resultId: string,\n options?: DocumentModelsGetAnalyzeResultOptionalParams\n ): Promise<DocumentModelsGetAnalyzeResultResponse> {\n return this.client.sendOperationRequest(\n { modelId, resultId, options },\n getAnalyzeResultOperationSpec\n );\n }\n\n /**\n * Builds a custom document analysis model.\n * @param buildRequest Building request parameters.\n * @param options The options parameters.\n */\n buildModel(\n buildRequest: BuildDocumentModelRequest,\n options?: DocumentModelsBuildModelOptionalParams\n ): Promise<DocumentModelsBuildModelResponse> {\n return this.client.sendOperationRequest(\n { buildRequest, options },\n buildModelOperationSpec\n );\n }\n\n /**\n * Creates a new document model from document types of existing document models.\n * @param composeRequest Compose request parameters.\n * @param options The options parameters.\n */\n composeModel(\n composeRequest: ComposeDocumentModelRequest,\n options?: DocumentModelsComposeModelOptionalParams\n ): Promise<DocumentModelsComposeModelResponse> {\n return this.client.sendOperationRequest(\n { composeRequest, options },\n composeModelOperationSpec\n );\n }\n\n /**\n * Generates authorization to copy a document model to this location with specified modelId and\n * optional description.\n * @param authorizeCopyRequest Authorize copy request parameters.\n * @param options The options parameters.\n */\n authorizeModelCopy(\n authorizeCopyRequest: AuthorizeCopyRequest,\n options?: DocumentModelsAuthorizeModelCopyOptionalParams\n ): Promise<DocumentModelsAuthorizeModelCopyResponse> {\n return this.client.sendOperationRequest(\n { authorizeCopyRequest, options },\n authorizeModelCopyOperationSpec\n );\n }\n\n /**\n * Copies document model to the target resource, region, and modelId.\n * @param modelId Unique document model name.\n * @param copyToRequest Copy to request parameters.\n * @param options The options parameters.\n */\n copyModelTo(\n modelId: string,\n copyToRequest: CopyAuthorization,\n options?: DocumentModelsCopyModelToOptionalParams\n ): Promise<DocumentModelsCopyModelToResponse> {\n return this.client.sendOperationRequest(\n { modelId, copyToRequest, options },\n copyModelToOperationSpec\n );\n }\n\n /**\n * List all document models\n * @param options The options parameters.\n */\n private _listModels(\n options?: DocumentModelsListModelsOptionalParams\n ): Promise<DocumentModelsListModelsResponse> {\n return this.client.sendOperationRequest(\n { options },\n listModelsOperationSpec\n );\n }\n\n /**\n * Gets detailed document model information.\n * @param modelId Unique document model name.\n * @param options The options parameters.\n */\n getModel(\n modelId: string,\n options?: DocumentModelsGetModelOptionalParams\n ): Promise<DocumentModelsGetModelResponse> {\n return this.client.sendOperationRequest(\n { modelId, options },\n getModelOperationSpec\n );\n }\n\n /**\n * Deletes document model.\n * @param modelId Unique document model name.\n * @param options The options parameters.\n */\n deleteModel(\n modelId: string,\n options?: DocumentModelsDeleteModelOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { modelId, options },\n deleteModelOperationSpec\n );\n }\n\n /**\n * ListModelsNext\n * @param nextLink The nextLink from the previous successful call to the ListModels method.\n * @param options The options parameters.\n */\n private _listModelsNext(\n nextLink: string,\n options?: DocumentModelsListModelsNextOptionalParams\n ): Promise<DocumentModelsListModelsNextResponse> {\n return this.client.sendOperationRequest(\n { nextLink, options },\n listModelsNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst analyzeDocument$binaryOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels/{modelId}:analyze\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentModelsAnalyzeDocumentHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.analyzeRequest,\n queryParameters: [\n Parameters.pages,\n Parameters.locale,\n Parameters.stringIndexType,\n Parameters.apiVersion,\n Parameters.features\n ],\n urlParameters: [Parameters.endpoint, Parameters.modelId],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"binary\",\n serializer\n};\nconst analyzeDocument$textOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels/{modelId}:analyze\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentModelsAnalyzeDocumentHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.analyzeRequest1,\n queryParameters: [\n Parameters.pages,\n Parameters.locale,\n Parameters.stringIndexType,\n Parameters.apiVersion,\n Parameters.features\n ],\n urlParameters: [Parameters.endpoint, Parameters.modelId],\n headerParameters: [Parameters.contentType1, Parameters.accept1],\n mediaType: \"text\",\n serializer\n};\nconst analyzeDocument$jsonOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels/{modelId}:analyze\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentModelsAnalyzeDocumentHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.analyzeRequest2,\n queryParameters: [\n Parameters.pages,\n Parameters.locale,\n Parameters.stringIndexType,\n Parameters.apiVersion,\n Parameters.features\n ],\n urlParameters: [Parameters.endpoint, Parameters.modelId],\n headerParameters: [Parameters.contentType2, Parameters.accept2],\n mediaType: \"json\",\n serializer\n};\nconst getAnalyzeResultOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels/{modelId}/analyzeResults/{resultId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeResultOperation\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.modelId, Parameters.resultId],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst buildModelOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels:build\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentModelsBuildModelHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.buildRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2, Parameters.contentType3],\n mediaType: \"json\",\n serializer\n};\nconst composeModelOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels:compose\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentModelsComposeModelHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.composeRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2, Parameters.contentType3],\n mediaType: \"json\",\n serializer\n};\nconst authorizeModelCopyOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels:authorizeCopy\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CopyAuthorization\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.authorizeCopyRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2, Parameters.contentType3],\n mediaType: \"json\",\n serializer\n};\nconst copyModelToOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels/{modelId}:copyTo\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentModelsCopyModelToHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.copyToRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.modelId],\n headerParameters: [Parameters.accept2, Parameters.contentType3],\n mediaType: \"json\",\n serializer\n};\nconst listModelsOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GetDocumentModelsResponse\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst getModelOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels/{modelId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.DocumentModelDetails\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.modelId],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst deleteModelOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels/{modelId}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.modelId],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst listModelsNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GetDocumentModelsResponse\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.nextLink],\n headerParameters: [Parameters.accept2],\n serializer\n};\n"]}
1
+ {"version":3,"file":"documentModels.js","sourceRoot":"","sources":["../../../../src/generated/operations/documentModels.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAgCtD,4CAA4C;AAC5C,kDAAkD;AAClD,MAAM,OAAO,kBAAkB;IACZ,MAAM,CAAkB;IAEzC;;;OAGG;IACH,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,UAAU,CACf,OAAgD;QAEhD,MAAM,IAAI,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAC/C,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB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AAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IACzD,gBAAgB,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;IACtC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { DocumentModels } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { GeneratedClient } from \"../generatedClient.js\";\nimport {\n DocumentModelSummary,\n DocumentModelsListModelsNextOptionalParams,\n DocumentModelsListModelsOptionalParams,\n ContentType,\n DocumentModelsAnalyzeDocument$binaryOptionalParams,\n DocumentModelsAnalyzeDocument$textOptionalParams,\n DocumentModelsAnalyzeDocument$jsonOptionalParams,\n DocumentModelsAnalyzeDocumentResponse,\n DocumentModelsGetAnalyzeResultOptionalParams,\n DocumentModelsGetAnalyzeResultResponse,\n BuildDocumentModelRequest,\n DocumentModelsBuildModelOptionalParams,\n DocumentModelsBuildModelResponse,\n ComposeDocumentModelRequest,\n DocumentModelsComposeModelOptionalParams,\n DocumentModelsComposeModelResponse,\n AuthorizeCopyRequest,\n DocumentModelsAuthorizeModelCopyOptionalParams,\n DocumentModelsAuthorizeModelCopyResponse,\n CopyAuthorization,\n DocumentModelsCopyModelToOptionalParams,\n DocumentModelsCopyModelToResponse,\n DocumentModelsListModelsResponse,\n DocumentModelsGetModelOptionalParams,\n DocumentModelsGetModelResponse,\n DocumentModelsDeleteModelOptionalParams,\n DocumentModelsListModelsNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing DocumentModels operations. */\nexport class DocumentModelsImpl implements DocumentModels {\n private readonly client: GeneratedClient;\n\n /**\n * Initialize a new instance of the class DocumentModels class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClient) {\n this.client = client;\n }\n\n /**\n * List all document models\n * @param options The options parameters.\n */\n public listModels(\n options?: DocumentModelsListModelsOptionalParams\n ): PagedAsyncIterableIterator<DocumentModelSummary> {\n const iter = this.listModelsPagingAll(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listModelsPagingPage(options);\n }\n };\n }\n\n private async *listModelsPagingPage(\n options?: DocumentModelsListModelsOptionalParams\n ): AsyncIterableIterator<DocumentModelSummary[]> {\n let result = await this._listModels(options);\n yield result.value || [];\n let continuationToken = result.nextLink;\n while (continuationToken) {\n result = await this._listModelsNext(continuationToken, options);\n continuationToken = result.nextLink;\n yield result.value || [];\n }\n }\n\n private async *listModelsPagingAll(\n options?: DocumentModelsListModelsOptionalParams\n ): AsyncIterableIterator<DocumentModelSummary> {\n for await (const page of this.listModelsPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Analyzes document with document model.\n * @param modelId Unique document model name.\n * @param contentType Upload file type\n * @param options The options parameters.\n */\n analyzeDocument(\n modelId: string,\n contentType: ContentType,\n options?: DocumentModelsAnalyzeDocument$binaryOptionalParams\n ): Promise<DocumentModelsAnalyzeDocumentResponse>;\n /**\n * Analyzes document with document model.\n * @param modelId Unique document model name.\n * @param contentType Upload file type\n * @param options The options parameters.\n */\n analyzeDocument(\n modelId: string,\n contentType: \"text/html\",\n options?: DocumentModelsAnalyzeDocument$textOptionalParams\n ): Promise<DocumentModelsAnalyzeDocumentResponse>;\n /**\n * Analyzes document with document model.\n * @param modelId Unique document model name.\n * @param contentType Body Parameter content-type\n * @param options The options parameters.\n */\n analyzeDocument(\n modelId: string,\n contentType: \"application/json\",\n options?: DocumentModelsAnalyzeDocument$jsonOptionalParams\n ): Promise<DocumentModelsAnalyzeDocumentResponse>;\n /**\n * Analyzes document with document model.\n * @param args Includes all the parameters for this operation.\n */\n analyzeDocument(\n ...args:\n | [\n string,\n ContentType,\n DocumentModelsAnalyzeDocument$binaryOptionalParams?\n ]\n | [string, \"text/html\", DocumentModelsAnalyzeDocument$textOptionalParams?]\n | [\n string,\n \"application/json\",\n DocumentModelsAnalyzeDocument$jsonOptionalParams?\n ]\n ): Promise<DocumentModelsAnalyzeDocumentResponse> {\n let operationSpec: coreClient.OperationSpec;\n let operationArguments: coreClient.OperationArguments;\n let options;\n if (\n args[1] === \"application/octet-stream\" ||\n args[1] === \"application/pdf\" ||\n args[1] ===\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\" ||\n args[1] ===\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" ||\n args[1] ===\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" ||\n args[1] === \"image/bmp\" ||\n args[1] === \"image/heif\" ||\n args[1] === \"image/jpeg\" ||\n args[1] === \"image/png\" ||\n args[1] === \"image/tiff\"\n ) {\n operationSpec = analyzeDocument$binaryOperationSpec;\n operationArguments = {\n modelId: args[0],\n contentType: args[1],\n options: args[2]\n };\n options = args[2];\n } else if (args[1] === \"text/html\") {\n operationSpec = analyzeDocument$textOperationSpec;\n operationArguments = {\n modelId: args[0],\n contentType: args[1],\n options: args[2]\n };\n options = args[2];\n } else if (args[1] === \"application/json\") {\n operationSpec = analyzeDocument$jsonOperationSpec;\n operationArguments = {\n modelId: args[0],\n contentType: args[1],\n options: args[2]\n };\n options = args[2];\n } else {\n throw new TypeError(\n `\"contentType\" must be a valid value but instead was \"${args[1]}\".`\n );\n }\n operationArguments.options = options || {};\n return this.client.sendOperationRequest(operationArguments, operationSpec);\n }\n\n /**\n * Gets the result of document analysis.\n * @param modelId Unique document model name.\n * @param resultId Analyze operation result ID.\n * @param options The options parameters.\n */\n getAnalyzeResult(\n modelId: string,\n resultId: string,\n options?: DocumentModelsGetAnalyzeResultOptionalParams\n ): Promise<DocumentModelsGetAnalyzeResultResponse> {\n return this.client.sendOperationRequest(\n { modelId, resultId, options },\n getAnalyzeResultOperationSpec\n );\n }\n\n /**\n * Builds a custom document analysis model.\n * @param buildRequest Building request parameters.\n * @param options The options parameters.\n */\n buildModel(\n buildRequest: BuildDocumentModelRequest,\n options?: DocumentModelsBuildModelOptionalParams\n ): Promise<DocumentModelsBuildModelResponse> {\n return this.client.sendOperationRequest(\n { buildRequest, options },\n buildModelOperationSpec\n );\n }\n\n /**\n * Creates a new document model from document types of existing document models.\n * @param composeRequest Compose request parameters.\n * @param options The options parameters.\n */\n composeModel(\n composeRequest: ComposeDocumentModelRequest,\n options?: DocumentModelsComposeModelOptionalParams\n ): Promise<DocumentModelsComposeModelResponse> {\n return this.client.sendOperationRequest(\n { composeRequest, options },\n composeModelOperationSpec\n );\n }\n\n /**\n * Generates authorization to copy a document model to this location with specified modelId and\n * optional description.\n * @param authorizeCopyRequest Authorize copy request parameters.\n * @param options The options parameters.\n */\n authorizeModelCopy(\n authorizeCopyRequest: AuthorizeCopyRequest,\n options?: DocumentModelsAuthorizeModelCopyOptionalParams\n ): Promise<DocumentModelsAuthorizeModelCopyResponse> {\n return this.client.sendOperationRequest(\n { authorizeCopyRequest, options },\n authorizeModelCopyOperationSpec\n );\n }\n\n /**\n * Copies document model to the target resource, region, and modelId.\n * @param modelId Unique document model name.\n * @param copyToRequest Copy to request parameters.\n * @param options The options parameters.\n */\n copyModelTo(\n modelId: string,\n copyToRequest: CopyAuthorization,\n options?: DocumentModelsCopyModelToOptionalParams\n ): Promise<DocumentModelsCopyModelToResponse> {\n return this.client.sendOperationRequest(\n { modelId, copyToRequest, options },\n copyModelToOperationSpec\n );\n }\n\n /**\n * List all document models\n * @param options The options parameters.\n */\n private _listModels(\n options?: DocumentModelsListModelsOptionalParams\n ): Promise<DocumentModelsListModelsResponse> {\n return this.client.sendOperationRequest(\n { options },\n listModelsOperationSpec\n );\n }\n\n /**\n * Gets detailed document model information.\n * @param modelId Unique document model name.\n * @param options The options parameters.\n */\n getModel(\n modelId: string,\n options?: DocumentModelsGetModelOptionalParams\n ): Promise<DocumentModelsGetModelResponse> {\n return this.client.sendOperationRequest(\n { modelId, options },\n getModelOperationSpec\n );\n }\n\n /**\n * Deletes document model.\n * @param modelId Unique document model name.\n * @param options The options parameters.\n */\n deleteModel(\n modelId: string,\n options?: DocumentModelsDeleteModelOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { modelId, options },\n deleteModelOperationSpec\n );\n }\n\n /**\n * ListModelsNext\n * @param nextLink The nextLink from the previous successful call to the ListModels method.\n * @param options The options parameters.\n */\n private _listModelsNext(\n nextLink: string,\n options?: DocumentModelsListModelsNextOptionalParams\n ): Promise<DocumentModelsListModelsNextResponse> {\n return this.client.sendOperationRequest(\n { nextLink, options },\n listModelsNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst analyzeDocument$binaryOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels/{modelId}:analyze\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentModelsAnalyzeDocumentHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.analyzeRequest,\n queryParameters: [\n Parameters.pages,\n Parameters.locale,\n Parameters.stringIndexType,\n Parameters.apiVersion,\n Parameters.features\n ],\n urlParameters: [Parameters.endpoint, Parameters.modelId],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"binary\",\n serializer\n};\nconst analyzeDocument$textOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels/{modelId}:analyze\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentModelsAnalyzeDocumentHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.analyzeRequest1,\n queryParameters: [\n Parameters.pages,\n Parameters.locale,\n Parameters.stringIndexType,\n Parameters.apiVersion,\n Parameters.features\n ],\n urlParameters: [Parameters.endpoint, Parameters.modelId],\n headerParameters: [Parameters.contentType1, Parameters.accept1],\n mediaType: \"text\",\n serializer\n};\nconst analyzeDocument$jsonOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels/{modelId}:analyze\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentModelsAnalyzeDocumentHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.analyzeRequest2,\n queryParameters: [\n Parameters.pages,\n Parameters.locale,\n Parameters.stringIndexType,\n Parameters.apiVersion,\n Parameters.features\n ],\n urlParameters: [Parameters.endpoint, Parameters.modelId],\n headerParameters: [Parameters.contentType2, Parameters.accept2],\n mediaType: \"json\",\n serializer\n};\nconst getAnalyzeResultOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels/{modelId}/analyzeResults/{resultId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AnalyzeResultOperation\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.modelId, Parameters.resultId],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst buildModelOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels:build\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentModelsBuildModelHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.buildRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2, Parameters.contentType3],\n mediaType: \"json\",\n serializer\n};\nconst composeModelOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels:compose\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentModelsComposeModelHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.composeRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2, Parameters.contentType3],\n mediaType: \"json\",\n serializer\n};\nconst authorizeModelCopyOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels:authorizeCopy\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CopyAuthorization\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.authorizeCopyRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2, Parameters.contentType3],\n mediaType: \"json\",\n serializer\n};\nconst copyModelToOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels/{modelId}:copyTo\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.DocumentModelsCopyModelToHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n requestBody: Parameters.copyToRequest,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.modelId],\n headerParameters: [Parameters.accept2, Parameters.contentType3],\n mediaType: \"json\",\n serializer\n};\nconst listModelsOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GetDocumentModelsResponse\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst getModelOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels/{modelId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.DocumentModelDetails\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.modelId],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst deleteModelOperationSpec: coreClient.OperationSpec = {\n path: \"/documentModels/{modelId}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.modelId],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst listModelsNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GetDocumentModelsResponse\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.nextLink],\n headerParameters: [Parameters.accept2],\n serializer\n};\n"]}
@@ -5,13 +5,13 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import * as coreClient from "@azure/core-client";
10
9
  import * as Mappers from "../models/mappers.js";
11
10
  import * as Parameters from "../models/parameters.js";
12
11
  /// <reference lib="esnext.asynciterable" />
13
12
  /** Class containing Miscellaneous operations. */
14
13
  export class MiscellaneousImpl {
14
+ client;
15
15
  /**
16
16
  * Initialize a new instance of the class Miscellaneous class.
17
17
  * @param client Reference to the service client
@@ -37,37 +37,20 @@ export class MiscellaneousImpl {
37
37
  }
38
38
  };
39
39
  }
40
- listOperationsPagingPage(options) {
41
- return __asyncGenerator(this, arguments, function* listOperationsPagingPage_1() {
42
- let result = yield __await(this._listOperations(options));
43
- yield yield __await(result.value || []);
44
- let continuationToken = result.nextLink;
45
- while (continuationToken) {
46
- result = yield __await(this._listOperationsNext(continuationToken, options));
47
- continuationToken = result.nextLink;
48
- yield yield __await(result.value || []);
49
- }
50
- });
40
+ async *listOperationsPagingPage(options) {
41
+ let result = await this._listOperations(options);
42
+ yield result.value || [];
43
+ let continuationToken = result.nextLink;
44
+ while (continuationToken) {
45
+ result = await this._listOperationsNext(continuationToken, options);
46
+ continuationToken = result.nextLink;
47
+ yield result.value || [];
48
+ }
51
49
  }
52
- listOperationsPagingAll(options) {
53
- return __asyncGenerator(this, arguments, function* listOperationsPagingAll_1() {
54
- var _a, e_1, _b, _c;
55
- try {
56
- for (var _d = true, _e = __asyncValues(this.listOperationsPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
57
- _c = _f.value;
58
- _d = false;
59
- const page = _c;
60
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
61
- }
62
- }
63
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
64
- finally {
65
- try {
66
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
67
- }
68
- finally { if (e_1) throw e_1.error; }
69
- }
70
- });
50
+ async *listOperationsPagingAll(options) {
51
+ for await (const page of this.listOperationsPagingPage(options)) {
52
+ yield* page;
53
+ }
71
54
  }
72
55
  /**
73
56
  * Lists all operations.
@@ -1 +1 @@
1
- {"version":3,"file":"miscellaneous.js","sourceRoot":"","sources":["../../../../src/generated/operations/miscellaneous.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAIH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AActD,4CAA4C;AAC5C,iDAAiD;AACjD,MAAM,OAAO,iBAAiB;IAG5B;;;OAGG;IACH,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,cAAc,CACnB,OAAmD;QAEnD,MAAM,IAAI,GAAG,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACnD,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,GAAG,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I,EAAE,OAAO;IACb,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,eAAe;SACpC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;IACtC,UAAU;CACX,CAAC;AACF,MAAM,+BAA+B,GAA6B;IAChE,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,qBAAqB;SAC1C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IACzD,gBAAgB,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;IACtC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { Miscellaneous } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { GeneratedClient } from \"../generatedClient.js\";\nimport {\n OperationSummary,\n MiscellaneousListOperationsNextOptionalParams,\n MiscellaneousListOperationsOptionalParams,\n MiscellaneousListOperationsResponse,\n MiscellaneousGetOperationOptionalParams,\n MiscellaneousGetOperationResponse,\n MiscellaneousGetResourceInfoOptionalParams,\n MiscellaneousGetResourceInfoResponse,\n MiscellaneousListOperationsNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing Miscellaneous operations. */\nexport class MiscellaneousImpl implements Miscellaneous {\n private readonly client: GeneratedClient;\n\n /**\n * Initialize a new instance of the class Miscellaneous class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClient) {\n this.client = client;\n }\n\n /**\n * Lists all operations.\n * @param options The options parameters.\n */\n public listOperations(\n options?: MiscellaneousListOperationsOptionalParams\n ): PagedAsyncIterableIterator<OperationSummary> {\n const iter = this.listOperationsPagingAll(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listOperationsPagingPage(options);\n }\n };\n }\n\n private async *listOperationsPagingPage(\n options?: MiscellaneousListOperationsOptionalParams\n ): AsyncIterableIterator<OperationSummary[]> {\n let result = await this._listOperations(options);\n yield result.value || [];\n let continuationToken = result.nextLink;\n while (continuationToken) {\n result = await this._listOperationsNext(continuationToken, options);\n continuationToken = result.nextLink;\n yield result.value || [];\n }\n }\n\n private async *listOperationsPagingAll(\n options?: MiscellaneousListOperationsOptionalParams\n ): AsyncIterableIterator<OperationSummary> {\n for await (const page of this.listOperationsPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Lists all operations.\n * @param options The options parameters.\n */\n private _listOperations(\n options?: MiscellaneousListOperationsOptionalParams\n ): Promise<MiscellaneousListOperationsResponse> {\n return this.client.sendOperationRequest(\n { options },\n listOperationsOperationSpec\n );\n }\n\n /**\n * Gets operation info.\n * @param operationId Unique operation ID.\n * @param options The options parameters.\n */\n getOperation(\n operationId: string,\n options?: MiscellaneousGetOperationOptionalParams\n ): Promise<MiscellaneousGetOperationResponse> {\n return this.client.sendOperationRequest(\n { operationId, options },\n getOperationOperationSpec\n );\n }\n\n /**\n * Return information about the current resource.\n * @param options The options parameters.\n */\n getResourceInfo(\n options?: MiscellaneousGetResourceInfoOptionalParams\n ): Promise<MiscellaneousGetResourceInfoResponse> {\n return this.client.sendOperationRequest(\n { options },\n getResourceInfoOperationSpec\n );\n }\n\n /**\n * ListOperationsNext\n * @param nextLink The nextLink from the previous successful call to the ListOperations method.\n * @param options The options parameters.\n */\n private _listOperationsNext(\n nextLink: string,\n options?: MiscellaneousListOperationsNextOptionalParams\n ): Promise<MiscellaneousListOperationsNextResponse> {\n return this.client.sendOperationRequest(\n { nextLink, options },\n listOperationsNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationsOperationSpec: coreClient.OperationSpec = {\n path: \"/operations\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GetOperationsResponse\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst getOperationOperationSpec: coreClient.OperationSpec = {\n path: \"/operations/{operationId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OperationDetails\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.operationId],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst getResourceInfoOperationSpec: coreClient.OperationSpec = {\n path: \"/info\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ResourceDetails\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst listOperationsNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GetOperationsResponse\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.nextLink],\n headerParameters: [Parameters.accept2],\n serializer\n};\n"]}
1
+ {"version":3,"file":"miscellaneous.js","sourceRoot":"","sources":["../../../../src/generated/operations/miscellaneous.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AActD,4CAA4C;AAC5C,iDAAiD;AACjD,MAAM,OAAO,iBAAiB;IACX,MAAM,CAAkB;IAEzC;;;OAGG;IACH,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,cAAc,CACnB,OAAmD;QAEnD,MAAM,IAAI,GAAG,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACnD,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,GAAG,EAAE;gBACX,OAAO,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;YAChD,CAAC;SACF,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,CAAC,wBAAwB,CACrC,OAAmD;QAEnD,IAAI,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;QACzB,IAAI,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC;QACxC,OAAO,iBAAiB,EAAE,CAAC;YACzB,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;YACpE,iBAAiB,GAAG,MAAM,CAAC,Q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AAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IACzD,gBAAgB,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;IACtC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { Miscellaneous } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { GeneratedClient } from \"../generatedClient.js\";\nimport {\n OperationSummary,\n MiscellaneousListOperationsNextOptionalParams,\n MiscellaneousListOperationsOptionalParams,\n MiscellaneousListOperationsResponse,\n MiscellaneousGetOperationOptionalParams,\n MiscellaneousGetOperationResponse,\n MiscellaneousGetResourceInfoOptionalParams,\n MiscellaneousGetResourceInfoResponse,\n MiscellaneousListOperationsNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing Miscellaneous operations. */\nexport class MiscellaneousImpl implements Miscellaneous {\n private readonly client: GeneratedClient;\n\n /**\n * Initialize a new instance of the class Miscellaneous class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClient) {\n this.client = client;\n }\n\n /**\n * Lists all operations.\n * @param options The options parameters.\n */\n public listOperations(\n options?: MiscellaneousListOperationsOptionalParams\n ): PagedAsyncIterableIterator<OperationSummary> {\n const iter = this.listOperationsPagingAll(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listOperationsPagingPage(options);\n }\n };\n }\n\n private async *listOperationsPagingPage(\n options?: MiscellaneousListOperationsOptionalParams\n ): AsyncIterableIterator<OperationSummary[]> {\n let result = await this._listOperations(options);\n yield result.value || [];\n let continuationToken = result.nextLink;\n while (continuationToken) {\n result = await this._listOperationsNext(continuationToken, options);\n continuationToken = result.nextLink;\n yield result.value || [];\n }\n }\n\n private async *listOperationsPagingAll(\n options?: MiscellaneousListOperationsOptionalParams\n ): AsyncIterableIterator<OperationSummary> {\n for await (const page of this.listOperationsPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Lists all operations.\n * @param options The options parameters.\n */\n private _listOperations(\n options?: MiscellaneousListOperationsOptionalParams\n ): Promise<MiscellaneousListOperationsResponse> {\n return this.client.sendOperationRequest(\n { options },\n listOperationsOperationSpec\n );\n }\n\n /**\n * Gets operation info.\n * @param operationId Unique operation ID.\n * @param options The options parameters.\n */\n getOperation(\n operationId: string,\n options?: MiscellaneousGetOperationOptionalParams\n ): Promise<MiscellaneousGetOperationResponse> {\n return this.client.sendOperationRequest(\n { operationId, options },\n getOperationOperationSpec\n );\n }\n\n /**\n * Return information about the current resource.\n * @param options The options parameters.\n */\n getResourceInfo(\n options?: MiscellaneousGetResourceInfoOptionalParams\n ): Promise<MiscellaneousGetResourceInfoResponse> {\n return this.client.sendOperationRequest(\n { options },\n getResourceInfoOperationSpec\n );\n }\n\n /**\n * ListOperationsNext\n * @param nextLink The nextLink from the previous successful call to the ListOperations method.\n * @param options The options parameters.\n */\n private _listOperationsNext(\n nextLink: string,\n options?: MiscellaneousListOperationsNextOptionalParams\n ): Promise<MiscellaneousListOperationsNextResponse> {\n return this.client.sendOperationRequest(\n { nextLink, options },\n listOperationsNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationsOperationSpec: coreClient.OperationSpec = {\n path: \"/operations\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GetOperationsResponse\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst getOperationOperationSpec: coreClient.OperationSpec = {\n path: \"/operations/{operationId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OperationDetails\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.operationId],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst getResourceInfoOperationSpec: coreClient.OperationSpec = {\n path: \"/info\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ResourceDetails\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept2],\n serializer\n};\nconst listOperationsNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GetOperationsResponse\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.nextLink],\n headerParameters: [Parameters.accept2],\n serializer\n};\n"]}
@@ -6,12 +6,11 @@ import { FormRecognizerError } from "../error.js";
6
6
  * @internal
7
7
  */
8
8
  export async function toTrainingPollOperationState(response) {
9
- var _a;
10
9
  return {
11
10
  operationId: response.operationId,
12
11
  status: response.status,
13
12
  apiVersion: response.apiVersion,
14
- percentCompleted: (_a = response.percentCompleted) !== null && _a !== void 0 ? _a : 0,
13
+ percentCompleted: response.percentCompleted ?? 0,
15
14
  lastUpdatedOn: response.lastUpdatedOn,
16
15
  createdOn: response.createdOn,
17
16
  error: response.error && new FormRecognizerError(response.error),
@@ -1 +1 @@
1
- {"version":3,"file":"administration.js","sourceRoot":"","sources":["../../../src/lro/administration.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AA2FlD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,QAA6C;;IAE7C,OAAO;QACL,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,gBAAgB,EAAE,MAAA,QAAQ,CAAC,gBAAgB,mCAAI,CAAC;QAChD,aAAa,EAAE,QAAQ,CAAC,aAAa;QACrC,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,IAAI,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC;QAChE,WAAW,EAAE,QAAQ,CAAC,MAAM,KAAK,UAAU;QAC3C,WAAW,EAAE,QAAQ,CAAC,MAAM,KAAK,WAAW;QAC5C,SAAS,EAAE,QAAQ,CAAC,MAAM,KAAK,YAAY;QAC3C,IAAI,EAAE,QAAQ,CAAC,IAAI;QAEnB,oFAAoF;QACpF,wGAAwG;QACxG,mHAAmH;QACnH,gEAAgE;QAChE,MAAM,EAAE,QAAQ,CAAC,MAAM;KAC0C,CAAC;AACtE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PollOperationState, PollerLike } from \"@azure/core-lro\";\nimport type { OperationOptions } from \"@azure/core-client\";\nimport { FormRecognizerError } from \"../error.js\";\nimport type {\n DocumentModelDetails,\n OperationStatus,\n DocumentModelBuildOperationDetails,\n DocumentModelCopyToOperationDetails,\n DocumentModelComposeOperationDetails,\n DocumentClassifierDetails,\n DocumentClassifierBuildOperationDetails,\n} from \"../generated/index.js\";\nimport type { PollerOptions } from \"../options/PollerOptions.js\";\nimport type { OperationContext } from \"./util/poller.js\";\n\n/**\n * The possible types of all administration operation states.\n * @internal\n */\nexport type AdministrationOperationState =\n | DocumentModelOperationState\n | DocumentClassifierOperationState;\n\n/**\n * The set of fields common to all administration operations.\n */\nexport interface ModelAdministrationOperationStateCommon {\n /**\n * The status of the operation. One of:\n *\n * - \"notStarted\"\n * - \"running\"\n * - \"succeeded\"\n * - \"failed\"\n * - \"canceled\"\n */\n status: OperationStatus;\n\n /**\n * The API version used to train this model.\n */\n apiVersion?: string;\n\n /**\n * The unique ID of this operation.\n */\n operationId: string;\n\n /**\n * A number between 0 and 100 representing the progress of the operation.\n */\n percentCompleted: number;\n\n /**\n * The Date and Time that the operation was created.\n */\n createdOn: Date;\n\n /**\n * The date & time that the operation state was last modified.\n */\n lastUpdatedOn: Date;\n\n /**\n * Additional, user-defined key-value pairs associated with the model as metadata.\n */\n tags?: Record<string, string>;\n}\n\n/**\n * The state of a model creation operation.\n */\nexport interface DocumentModelOperationState\n extends PollOperationState<DocumentModelDetails>,\n ModelAdministrationOperationStateCommon {}\n\n/**\n * The respones of a model creation operation.\n * @internal\n */\nexport type DocumentModelBuildResponse =\n | DocumentModelBuildOperationDetails\n | DocumentModelCopyToOperationDetails\n | DocumentModelComposeOperationDetails;\n\n/**\n * The possible responses of an administration operation.\n * @internal\n */\nexport type DocumentModelAdministrationResponse =\n | DocumentModelBuildResponse\n | DocumentClassifierBuildOperationDetails;\n\n/**\n * Convert an operation result into a training poller state.\n * @internal\n */\nexport async function toTrainingPollOperationState(\n response: DocumentModelAdministrationResponse,\n): Promise<DocumentModelOperationState | DocumentClassifierOperationState> {\n return {\n operationId: response.operationId,\n status: response.status,\n apiVersion: response.apiVersion,\n percentCompleted: response.percentCompleted ?? 0,\n lastUpdatedOn: response.lastUpdatedOn,\n createdOn: response.createdOn,\n error: response.error && new FormRecognizerError(response.error),\n isCancelled: response.status === \"canceled\",\n isCompleted: response.status === \"succeeded\",\n isStarted: response.status !== \"notStarted\",\n tags: response.tags,\n\n // The following assertion is required. Technically the type of `response.result` is\n // `DocumentModelDetails | DocumentClassifierDetails | undefined`, which isn't assignable to the type of\n // either operation state's result. We would need some kind of dependent typing to express how the type of `result`\n // actually _determines_ the type of the resulting return value.\n result: response.result,\n } as DocumentModelOperationState | DocumentClassifierOperationState;\n}\n\n/**\n * A long-running operation (poller) that tracks the state of a model creation operation, eventually producing a\n * {@link DocumentModelDetails}.\n */\nexport type DocumentModelPoller = PollerLike<DocumentModelOperationState, DocumentModelDetails>;\n\n/**\n * Defines a training operation.\n * @internal\n */\nexport interface TrainingOperationDefinition<State extends AdministrationOperationState> {\n /**\n * A function to start the operation, producing an operationLocation.\n */\n start: (ctx: OperationContext) => Promise<{ operationLocation?: string }>;\n /**\n * Options for the poller and requests.\n */\n options: PollerOptions<State> & OperationOptions;\n}\n\n/**\n * A long-running operation (poller) that tracks the state of a custom classifier creation operation, eventually\n * producing a {@link DocumentClassifierDetails}.\n */\nexport type DocumentClassifierPoller = PollerLike<\n DocumentClassifierOperationState,\n DocumentClassifierDetails\n>;\n\n/**\n * The state of a model creation operation.\n */\nexport interface DocumentClassifierOperationState\n extends PollOperationState<DocumentClassifierDetails>,\n ModelAdministrationOperationStateCommon {}\n"]}
1
+ {"version":3,"file":"administration.js","sourceRoot":"","sources":["../../../src/lro/administration.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AA2FlD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,QAA6C;IAE7C,OAAO;QACL,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,IAAI,CAAC;QAChD,aAAa,EAAE,QAAQ,CAAC,aAAa;QACrC,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,IAAI,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC;QAChE,WAAW,EAAE,QAAQ,CAAC,MAAM,KAAK,UAAU;QAC3C,WAAW,EAAE,QAAQ,CAAC,MAAM,KAAK,WAAW;QAC5C,SAAS,EAAE,QAAQ,CAAC,MAAM,KAAK,YAAY;QAC3C,IAAI,EAAE,QAAQ,CAAC,IAAI;QAEnB,oFAAoF;QACpF,wGAAwG;QACxG,mHAAmH;QACnH,gEAAgE;QAChE,MAAM,EAAE,QAAQ,CAAC,MAAM;KAC0C,CAAC;AACtE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PollOperationState, PollerLike } from \"@azure/core-lro\";\nimport type { OperationOptions } from \"@azure/core-client\";\nimport { FormRecognizerError } from \"../error.js\";\nimport type {\n DocumentModelDetails,\n OperationStatus,\n DocumentModelBuildOperationDetails,\n DocumentModelCopyToOperationDetails,\n DocumentModelComposeOperationDetails,\n DocumentClassifierDetails,\n DocumentClassifierBuildOperationDetails,\n} from \"../generated/index.js\";\nimport type { PollerOptions } from \"../options/PollerOptions.js\";\nimport type { OperationContext } from \"./util/poller.js\";\n\n/**\n * The possible types of all administration operation states.\n * @internal\n */\nexport type AdministrationOperationState =\n | DocumentModelOperationState\n | DocumentClassifierOperationState;\n\n/**\n * The set of fields common to all administration operations.\n */\nexport interface ModelAdministrationOperationStateCommon {\n /**\n * The status of the operation. One of:\n *\n * - \"notStarted\"\n * - \"running\"\n * - \"succeeded\"\n * - \"failed\"\n * - \"canceled\"\n */\n status: OperationStatus;\n\n /**\n * The API version used to train this model.\n */\n apiVersion?: string;\n\n /**\n * The unique ID of this operation.\n */\n operationId: string;\n\n /**\n * A number between 0 and 100 representing the progress of the operation.\n */\n percentCompleted: number;\n\n /**\n * The Date and Time that the operation was created.\n */\n createdOn: Date;\n\n /**\n * The date & time that the operation state was last modified.\n */\n lastUpdatedOn: Date;\n\n /**\n * Additional, user-defined key-value pairs associated with the model as metadata.\n */\n tags?: Record<string, string>;\n}\n\n/**\n * The state of a model creation operation.\n */\nexport interface DocumentModelOperationState\n extends PollOperationState<DocumentModelDetails>,\n ModelAdministrationOperationStateCommon {}\n\n/**\n * The respones of a model creation operation.\n * @internal\n */\nexport type DocumentModelBuildResponse =\n | DocumentModelBuildOperationDetails\n | DocumentModelCopyToOperationDetails\n | DocumentModelComposeOperationDetails;\n\n/**\n * The possible responses of an administration operation.\n * @internal\n */\nexport type DocumentModelAdministrationResponse =\n | DocumentModelBuildResponse\n | DocumentClassifierBuildOperationDetails;\n\n/**\n * Convert an operation result into a training poller state.\n * @internal\n */\nexport async function toTrainingPollOperationState(\n response: DocumentModelAdministrationResponse,\n): Promise<DocumentModelOperationState | DocumentClassifierOperationState> {\n return {\n operationId: response.operationId,\n status: response.status,\n apiVersion: response.apiVersion,\n percentCompleted: response.percentCompleted ?? 0,\n lastUpdatedOn: response.lastUpdatedOn,\n createdOn: response.createdOn,\n error: response.error && new FormRecognizerError(response.error),\n isCancelled: response.status === \"canceled\",\n isCompleted: response.status === \"succeeded\",\n isStarted: response.status !== \"notStarted\",\n tags: response.tags,\n\n // The following assertion is required. Technically the type of `response.result` is\n // `DocumentModelDetails | DocumentClassifierDetails | undefined`, which isn't assignable to the type of\n // either operation state's result. We would need some kind of dependent typing to express how the type of `result`\n // actually _determines_ the type of the resulting return value.\n result: response.result,\n } as DocumentModelOperationState | DocumentClassifierOperationState;\n}\n\n/**\n * A long-running operation (poller) that tracks the state of a model creation operation, eventually producing a\n * {@link DocumentModelDetails}.\n */\nexport type DocumentModelPoller = PollerLike<DocumentModelOperationState, DocumentModelDetails>;\n\n/**\n * Defines a training operation.\n * @internal\n */\nexport interface TrainingOperationDefinition<State extends AdministrationOperationState> {\n /**\n * A function to start the operation, producing an operationLocation.\n */\n start: (ctx: OperationContext) => Promise<{ operationLocation?: string }>;\n /**\n * Options for the poller and requests.\n */\n options: PollerOptions<State> & OperationOptions;\n}\n\n/**\n * A long-running operation (poller) that tracks the state of a custom classifier creation operation, eventually\n * producing a {@link DocumentClassifierDetails}.\n */\nexport type DocumentClassifierPoller = PollerLike<\n DocumentClassifierOperationState,\n DocumentClassifierDetails\n>;\n\n/**\n * The state of a model creation operation.\n */\nexport interface DocumentClassifierOperationState\n extends PollOperationState<DocumentClassifierDetails>,\n ModelAdministrationOperationStateCommon {}\n"]}
@@ -11,8 +11,11 @@ import { toBoundingPolygon, toBoundingRegions, toDocumentTableFromGenerated, toK
11
11
  * @returns an AnalyzedDocument (which has had its fields mapped to stronger DocumentField types)
12
12
  */
13
13
  export function toAnalyzedDocumentFromGenerated(document) {
14
- var _a;
15
- return Object.assign(Object.assign({}, document), { boundingRegions: toBoundingRegions(document.boundingRegions), fields: toAnalyzedDocumentFieldsFromGenerated((_a = document.fields) !== null && _a !== void 0 ? _a : {}) });
14
+ return {
15
+ ...document,
16
+ boundingRegions: toBoundingRegions(document.boundingRegions),
17
+ fields: toAnalyzedDocumentFieldsFromGenerated(document.fields ?? {}),
18
+ };
16
19
  }
17
20
  /**
18
21
  * Tests if one span contains another, by testing that the outer span starts before or at the same character as the
@@ -46,12 +49,9 @@ export function* iterFrom(items, idx) {
46
49
  }
47
50
  }
48
51
  export function toDocumentLineFromGenerated(generated, page) {
49
- generated.words = () => {
50
- var _a, _b;
51
- return fastGetChildren(iterFrom(generated.spans, 0), (_b = (_a = page.words) === null || _a === void 0 ? void 0 : _a.map((word) => {
52
- return Object.assign(Object.assign({}, word), { polygon: toBoundingPolygon(word.polygon) });
53
- })) !== null && _b !== void 0 ? _b : []);
54
- };
52
+ generated.words = () => fastGetChildren(iterFrom(generated.spans, 0), page.words?.map((word) => {
53
+ return { ...word, polygon: toBoundingPolygon(word.polygon) };
54
+ }) ?? []);
55
55
  generated.polygon = toBoundingPolygon(generated.polygon);
56
56
  Object.defineProperty(generated, "words", {
57
57
  enumerable: false,
@@ -59,8 +59,26 @@ export function toDocumentLineFromGenerated(generated, page) {
59
59
  return generated;
60
60
  }
61
61
  export function toDocumentPageFromGenerated(generated) {
62
- var _a, _b, _c, _d, _e;
63
- return Object.assign(Object.assign({}, generated), { lines: (_a = generated.lines) === null || _a === void 0 ? void 0 : _a.map((line) => toDocumentLineFromGenerated(line, generated)), selectionMarks: (_b = generated.selectionMarks) === null || _b === void 0 ? void 0 : _b.map((mark) => (Object.assign(Object.assign({}, mark), { polygon: toBoundingPolygon(mark.polygon) }))), words: (_c = generated.words) === null || _c === void 0 ? void 0 : _c.map((word) => (Object.assign(Object.assign({}, word), { polygon: toBoundingPolygon(word.polygon) }))), barcodes: (_d = generated.barcodes) === null || _d === void 0 ? void 0 : _d.map((barcode) => (Object.assign(Object.assign({}, barcode), { polygon: toBoundingPolygon(barcode.polygon) }))), formulas: (_e = generated.formulas) === null || _e === void 0 ? void 0 : _e.map((formula) => (Object.assign(Object.assign({}, formula), { polygon: toBoundingPolygon(formula.polygon) }))) });
62
+ return {
63
+ ...generated,
64
+ lines: generated.lines?.map((line) => toDocumentLineFromGenerated(line, generated)),
65
+ selectionMarks: generated.selectionMarks?.map((mark) => ({
66
+ ...mark,
67
+ polygon: toBoundingPolygon(mark.polygon),
68
+ })),
69
+ words: generated.words?.map((word) => ({
70
+ ...word,
71
+ polygon: toBoundingPolygon(word.polygon),
72
+ })),
73
+ barcodes: generated.barcodes?.map((barcode) => ({
74
+ ...barcode,
75
+ polygon: toBoundingPolygon(barcode.polygon),
76
+ })),
77
+ formulas: generated.formulas?.map((formula) => ({
78
+ ...formula,
79
+ polygon: toBoundingPolygon(formula.polygon),
80
+ })),
81
+ };
64
82
  }
65
83
  /**
66
84
  * Binary search through an array of items to find the first item that could possibly be contained by the given span,
@@ -79,10 +97,10 @@ export function iteratorFromFirstMatchBinarySearch(span, items) {
79
97
  let prevIdx = idx;
80
98
  let min = 0;
81
99
  let max = items.length;
82
- const found = () => { var _a, _b, _c;
100
+ const found = () =>
83
101
  // The item is found if it starts after the current span and the item before it does not. That means it is the first
84
102
  // item in the array that could be a child if the spans are sorted.
85
- return items[idx].span.offset >= span.offset && ((_c = (_b = (_a = items[idx - 1]) === null || _a === void 0 ? void 0 : _a.span) === null || _b === void 0 ? void 0 : _b.offset) !== null && _c !== void 0 ? _c : -1) < span.offset; };
103
+ items[idx].span.offset >= span.offset && (items[idx - 1]?.span?.offset ?? -1) < span.offset;
86
104
  // Binary search to find the first element that could be a child
87
105
  do {
88
106
  if (found()) {
@@ -140,18 +158,20 @@ export function* fastGetChildren(spans, childrenArray) {
140
158
  * @internal
141
159
  */
142
160
  export function toAnalyzeResultFromGenerated(result) {
143
- var _a, _b, _c, _d;
144
161
  return {
145
162
  apiVersion: result.apiVersion,
146
163
  modelId: result.modelId,
147
164
  content: result.content,
148
165
  pages: result.pages.map((page) => toDocumentPageFromGenerated(page)),
149
- tables: (_a = result.tables) === null || _a === void 0 ? void 0 : _a.map((table) => toDocumentTableFromGenerated(table)),
150
- keyValuePairs: (_b = result.keyValuePairs) === null || _b === void 0 ? void 0 : _b.map((pair) => toKeyValuePairFromGenerated(pair)),
166
+ tables: result.tables?.map((table) => toDocumentTableFromGenerated(table)),
167
+ keyValuePairs: result.keyValuePairs?.map((pair) => toKeyValuePairFromGenerated(pair)),
151
168
  languages: result.languages,
152
169
  styles: result.styles,
153
- paragraphs: (_c = result.paragraphs) === null || _c === void 0 ? void 0 : _c.map((para) => (Object.assign(Object.assign({}, para), { boundingRegions: toBoundingRegions(para.boundingRegions) }))),
154
- documents: (_d = result.documents) === null || _d === void 0 ? void 0 : _d.map(toAnalyzedDocumentFromGenerated),
170
+ paragraphs: result.paragraphs?.map((para) => ({
171
+ ...para,
172
+ boundingRegions: toBoundingRegions(para.boundingRegions),
173
+ })),
174
+ documents: result.documents?.map(toAnalyzedDocumentFromGenerated),
155
175
  };
156
176
  }
157
177
  /**