Skip to content

Commit

Permalink
[Document Intelligence] Generate 1.0.0-beta.3 version (Azure#30373)
Browse files Browse the repository at this point in the history
- Regeneration done
- Tests in sync with latest src
- Live tests ✅
- Migrated to ESM and vitest
- Added new tests for the new features
- Added custom code to support 
- the "completed" poller status for batch analysis
`/documentModels/{modelId}:analyzeBatch`
   - getting operation id from the poller
- and the new `/documentModels/{modelId}/analyzeResults/{resultId}/pdf`
and
`/documentModels/{modelId}/analyzeResults/{resultId}/figures/{figureId}`
methods
  • Loading branch information
HarshaNalluru authored Aug 20, 2024
1 parent 4dd6647 commit 5586f99
Show file tree
Hide file tree
Showing 33 changed files with 2,612 additions and 803 deletions.
840 changes: 437 additions & 403 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"@azure/azure-sdk/ts-apiextractor-json-types": "warn",
"@azure/azure-sdk/ts-package-json-types": "warn",
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
"tsdoc/syntax": "warn"
"tsdoc/syntax": "warn",
"@azure/azure-sdk/ts-package-json-module": "off",
"@azure/azure-sdk/ts-package-json-files-required": "off",
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off"
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,41 @@
# Release History

## 1.0.0-beta.3 (Unreleased)
## 1.0.0-beta.3 (#2024-08-20)

### Features Added

### Breaking Changes

### Bugs Fixed
- Added support for the Analyze Batch Documents API with the long-running operations, `/documentModels/{modelId}:analyzeBatch`.
- Added support for method `/documentModels/{modelId}/analyzeResults/{resultId}/pdf`.
- Added support for method `/documentModels/{modelId}/analyzeResults/{resultId}/figures/{figureId}`.
- Added support for the analysis method to specify other kinds of output through `AnalyzeDocumentFromStreamBodyParam#output` param : can be `pdf` and `figures`.
- Added property `id` to `Output` model.
- Added support for the Copy Classifier API with method `/documentClassifiers:authorizeCopy`.
- Added method `/documentClassifiers/{classifierId}:copyTo`.
- Added new enum type to `DocumentBuildMode`: `generative`.
- Added property `warnings` to `AnalyzeResultOutput ` model.
- Added properties `classifierId`, `split`, and `trainingHours` to `DocumentModelDetailsOutput` model.
- Added properties `confidenceThreshold`, `features`, `maxDocumentsToAnalyze`, `modelId`, and `queryFields` to `DocumentTypeDetailsOutput` model.
- Added properties `allowOverwrite` and `maxTrainingHours` to `BuildDocumentModelRequest` model.
- Added parameter `pages` to `ClassifyDocument` overloads.
- Added properties `classifierId`, `docTypes`, and `split` to `ComposeDocumentModelRequest`.
- Added property `allowOverwrite` to `BuildDocumentClassifierRequest`.
- Added property `getOperationId()` method to the pollers.

### Other Changes

- The `@azure-rest/ai-document-intelligence` Rest Level Client Library, now targets the Azure AI Document Intelligence service API version `2024-07-31-preview`. Support for `2024-02-29-preview` has been removed.
- Removed support for extracting lists from analyzed documents:
- Removed models `DocumentListOutput` and `DocumentListItemOutput`.
- Removed property `lists` from `AnalyzeResultOutput`.
- Changes to the Compose Document API:
- Removed model `ComponentDocumentModelDetails`.
- Removed property `componentModels` from `ComposeDocumentModelRequest`.
- `ComposeDocumentModelRequest` now requires a map of `DocumentTypeDetails` and a classifier ID.
- Removed model `QuotaDetailsOutput`.
- Removed property `customNeuralDocumentModelBuilds` from `ResourceDetailsOutput`.
- Removed required property `fieldSchema` and from `DocumentTypeDetailsOuput`.
- `DocumentFieldType` is now a required property of `DocumentFieldSchema`.

## 1.0.0-beta.2 (2024-03-06)

### Features Added
Expand Down
21 changes: 21 additions & 0 deletions sdk/documentintelligence/ai-document-intelligence-rest/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ Key links:
- [Changelog](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/documentintelligence/ai-document-intelligence-rest/CHANGELOG.md)
- [Migration Guide from Form Recognizer](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/documentintelligence/ai-document-intelligence-rest/MIGRATION-FR_v4-DI_v1.md)

> This version of the client library defaults to the `"2024-02-29-preview"` version of the service.
> This version of the client library defaults to the `"2024-07-31-preview"` version of the service.
This table shows the relationship between SDK versions and supported API versions of the service:

| SDK version | Supported API version of service |
| ------------ | -------------------------------- |
| 1.0.0-beta.3 | 2024-07-31-preview |
| 1.0.0-beta.2 | 2024-02-29-preview |
| 1.0.0-beta.1 | 2023-10-31-preview |

Expand All @@ -30,6 +31,7 @@ The below table describes the relationship of each client and its supported API

| Service API version | Supported clients | Package |
| ------------------- | ------------------------------------------------------------ | ------------------------------------------------------------- |
| 2024-07-31-preview | DocumentIntelligenceClient | `@azure-rest/ai-document-intelligence` version `1.0.0-beta.3` |
| 2024-02-29-preview | DocumentIntelligenceClient | `@azure-rest/ai-document-intelligence` version `1.0.0-beta.2` |
| 2023-10-31-preview | DocumentIntelligenceClient | `@azure-rest/ai-document-intelligence` version `1.0.0-beta.1` |
| 2023-07-31 | DocumentAnalysisClient and DocumentModelAdministrationClient | `@azure/ai-form-recognizer` version `^5.0.0` |
Expand Down Expand Up @@ -75,7 +77,7 @@ import DocumentIntelligence from "@azure-rest/ai-document-intelligence";

const client = DocumentIntelligence(
process.env["DOCUMENT_INTELLIGENCE_ENDPOINT"],
new DefaultAzureCredential()
new DefaultAzureCredential(),
);
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./types/src/index.d.ts",
"mainEntryPointFilePath": "./dist/esm/index.d.ts",
"docModel": { "enabled": true },
"apiReport": { "enabled": true, "reportFolder": "./review" },
"dtsRollup": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "js",
"TagPrefix": "js/documentintelligence/ai-document-intelligence-rest",
"Tag": "js/documentintelligence/ai-document-intelligence-rest_8bf17f8b6f"
"Tag": "js/documentintelligence/ai-document-intelligence-rest_c52f06c699"
}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import azsdkEslint from "@azure/eslint-plugin-azure-sdk";

export default [
...azsdkEslint.configs.recommended,
{
rules: {
"@azure/azure-sdk/ts-modules-only-named": "warn",
"@azure/azure-sdk/ts-apiextractor-json-types": "warn",
"@azure/azure-sdk/ts-package-json-types": "warn",
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
"@azure/azure-sdk/ts-package-json-module": "off",
"@azure/azure-sdk/ts-package-json-files-required": "off",
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off",
"tsdoc/syntax": "warn",
},
},
];
193 changes: 110 additions & 83 deletions sdk/documentintelligence/ai-document-intelligence-rest/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
{
"name": "@azure-rest/ai-document-intelligence",
"sdk-type": "client",
"author": "Microsoft Corporation",
"version": "1.0.0-beta.3",
"description": "Azure Document Intelligence Rest Client",
"description": "Document Intelligence Rest Client",
"engines": {
"node": ">=18.0.0"
},
"sideEffects": false,
"autoPublish": false,
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
},
"dialects": [
"esm",
"commonjs"
],
"esmDialects": [
"browser",
"react-native"
],
"selfLink": false
},
"type": "module",
"keywords": [
"node",
"azure",
Expand All @@ -12,105 +31,113 @@
"browser",
"isomorphic"
],
"author": "Microsoft Corporation",
"license": "MIT",
"main": "dist/index.js",
"module": "./dist-esm/src/index.js",
"types": "./types/ai-document-intelligence.d.ts",
"repository": "github:Azure/azure-sdk-for-js",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/",
"dist-esm/src/",
"types/ai-document-intelligence.d.ts",
"dist",
"README.md",
"LICENSE",
"review/*"
"review/*",
"CHANGELOG.md"
],
"engines": {
"node": ">=18.0.0"
"sdk-type": "client",
"repository": "github:Azure/azure-sdk-for-js",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"scripts": {
"build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
"build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
"build:samples": "echo skipped.",
"build:test": "tsc -p . && dev-tool run bundle",
"build:debug": "tsc -p . && dev-tool run bundle && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\"",
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"execute:samples": "echo skipped",
"extract-api": "rimraf review && mkdirp ./review && dev-tool run extract-api",
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" \"test/**/*.ts\"",
"generate:client": "echo skipped",
"integration-test:browser": "echo skipped",
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json api-extractor.json src test --ext .ts",
"pack": "npm pack 2>&1",
"test:browser": "echo skipped",
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
"test": "npm run clean && npm run build:test && npm run unit-test",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
"unit-test:browser": "echo skipped",
"build": "npm run clean && tsc -p . && dev-tool run bundle && mkdirp ./review && dev-tool run extract-api"
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"//metadata": {
"constantPaths": [
{
"path": "src/documentIntelligence.ts",
"prefix": "userAgentInfo"
}
]
},
"sideEffects": false,
"autoPublish": false,
"dependencies": {
"@azure-rest/core-client": "^2.1.0",
"@azure/core-auth": "^1.6.0",
"@azure-rest/core-client": "^1.2.0",
"@azure/core-rest-pipeline": "^1.14.0",
"@azure/core-rest-pipeline": "^1.5.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.2.0",
"@azure/core-paging": "^1.5.0",
"@azure/core-lro": "^2.5.4",
"@azure/abort-controller": "^1.0.0"
"tslib": "^2.6.2",
"@azure/core-lro": "^3.0.0",
"@azure/abort-controller": "^2.1.2",
"@azure/core-paging": "^1.5.0"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.31.1",
"autorest": "latest",
"@types/node": "^18.0.0",
"dotenv": "^16.0.0",
"eslint": "^8.0.0",
"@microsoft/api-extractor": "^7.40.3",
"@types/node": "^18.0.0",
"eslint": "^8.55.0",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"mkdirp": "^3.0.1",
"rimraf": "^5.0.0",
"source-map-support": "^0.5.9",
"typescript": "~5.5.3",
"tshy": "^1.11.1",
"@azure/core-util": "^1.0.0",
"@azure/identity": "^4.2.1",
"@vitest/browser": "^2.0.5",
"@vitest/coverage-istanbul": "^2.0.5",
"playwright": "^1.41.2",
"vitest": "^2.0.5",
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-recorder": "^4.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure-tools/test-credential": "^1.0.0",
"@azure/identity": "^4.0.1",
"@azure-tools/test-recorder": "^3.0.0",
"mocha": "^10.0.0",
"@types/mocha": "^10.0.0",
"cross-env": "^7.0.2",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"karma-chrome-launcher": "^3.0.0",
"karma-coverage": "^2.0.0",
"karma-env-preprocessor": "^0.1.1",
"karma-firefox-launcher": "^2.1.2",
"karma-junit-reporter": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-mocha": "^2.0.1",
"karma-source-map-support": "~1.4.0",
"karma-sourcemap-loader": "^0.4.0",
"karma": "^6.2.0",
"nyc": "^17.0.0",
"ts-node": "^10.0.0"
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/documentintelligence/ai-document-intelligence-rest/README.md",
"//metadata": {
"constantPaths": [
{
"path": "src/documentIntelligence.ts",
"prefix": "userAgentInfo"
"scripts": {
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"extract-api": "rimraf review && mkdirp ./review && dev-tool run extract-api",
"pack": "npm pack 2>&1",
"lint": "eslint package.json api-extractor.json src test",
"lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "echo skipped",
"unit-test:node": "dev-tool run test:vitest",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build:samples": "dev-tool samples publish --force",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"execute:samples": "dev-tool samples run samples-dev",
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"generate:client": "echo skipped",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
"build:test": "npm run clean && tshy && dev-tool run build-test",
"build": "npm run clean && tshy && mkdirp ./review && dev-tool run extract-api",
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test"
},
"exports": {
"./package.json": "./package.json",
".": {
"browser": {
"source": "./src/index.ts",
"types": "./dist/browser/index.d.ts",
"default": "./dist/browser/index.js"
},
"react-native": {
"source": "./src/index.ts",
"types": "./dist/react-native/index.d.ts",
"default": "./dist/react-native/index.js"
},
"import": {
"source": "./src/index.ts",
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"source": "./src/index.ts",
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
]
}
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"module": "./dist/esm/index.js",
"//sampleConfiguration": {
"productName": "Azure Document Intelligence Rest Client",
"productSlugs": [
Expand Down
Loading

0 comments on commit 5586f99

Please sign in to comment.