@azure/ai-projects 1.0.0-beta.9 → 1.0.1-alpha.20250924.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -136
- package/dist/browser/aiProjectClient.d.ts +10 -15
- package/dist/browser/aiProjectClient.d.ts.map +1 -1
- package/dist/browser/aiProjectClient.js +48 -18
- package/dist/browser/aiProjectClient.js.map +1 -1
- package/dist/browser/api/aiProjectContext.js +20 -12
- package/dist/browser/api/aiProjectContext.js.map +1 -1
- package/dist/browser/api/connections/operations.js +41 -37
- package/dist/browser/api/connections/operations.js.map +1 -1
- package/dist/browser/api/datasets/operations.d.ts +4 -4
- package/dist/browser/api/datasets/operations.d.ts.map +1 -1
- package/dist/browser/api/datasets/operations.js +72 -34
- package/dist/browser/api/datasets/operations.js.map +1 -1
- package/dist/browser/api/deployments/operations.js +25 -13
- package/dist/browser/api/deployments/operations.js.map +1 -1
- package/dist/browser/api/indexes/operations.d.ts +2 -2
- package/dist/browser/api/indexes/operations.d.ts.map +1 -1
- package/dist/browser/api/indexes/operations.js +45 -18
- package/dist/browser/api/indexes/operations.js.map +1 -1
- package/dist/browser/api/inference/operations.d.ts +0 -40
- package/dist/browser/api/inference/operations.d.ts.map +1 -1
- package/dist/browser/api/inference/operations.js +6 -87
- package/dist/browser/api/inference/operations.js.map +1 -1
- package/dist/browser/api/inference/options.d.ts +4 -1
- package/dist/browser/api/inference/options.d.ts.map +1 -1
- package/dist/browser/api/inference/options.js.map +1 -1
- package/dist/browser/api/telemetry/operations.d.ts +1 -1
- package/dist/browser/api/telemetry/operations.d.ts.map +1 -1
- package/dist/browser/api/telemetry/operations.js +8 -23
- package/dist/browser/api/telemetry/operations.js.map +1 -1
- package/dist/browser/classic/connections/index.js +3 -1
- package/dist/browser/classic/connections/index.js.map +1 -1
- package/dist/browser/classic/datasets/index.d.ts +2 -2
- package/dist/browser/classic/datasets/index.d.ts.map +1 -1
- package/dist/browser/classic/datasets/index.js +7 -5
- package/dist/browser/classic/datasets/index.js.map +1 -1
- package/dist/browser/classic/deployments/index.js +3 -1
- package/dist/browser/classic/deployments/index.js.map +1 -1
- package/dist/browser/classic/index.d.ts +0 -2
- package/dist/browser/classic/index.d.ts.map +1 -1
- package/dist/browser/classic/index.js.map +1 -1
- package/dist/browser/classic/indexes/index.d.ts +1 -1
- package/dist/browser/classic/indexes/index.d.ts.map +1 -1
- package/dist/browser/classic/indexes/index.js +4 -2
- package/dist/browser/classic/indexes/index.js.map +1 -1
- package/dist/browser/classic/inference/index.d.ts +0 -7
- package/dist/browser/classic/inference/index.d.ts.map +1 -1
- package/dist/browser/classic/inference/index.js +4 -5
- package/dist/browser/classic/inference/index.js.map +1 -1
- package/dist/browser/classic/telemetry/index.d.ts +1 -4
- package/dist/browser/classic/telemetry/index.d.ts.map +1 -1
- package/dist/browser/classic/telemetry/index.js +1 -2
- package/dist/browser/classic/telemetry/index.js.map +1 -1
- package/dist/browser/constants.d.ts +1 -1
- package/dist/browser/constants.d.ts.map +1 -1
- package/dist/browser/constants.js +1 -1
- package/dist/browser/constants.js.map +1 -1
- package/dist/browser/index.d.ts +5 -5
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/models/index.d.ts +1 -2
- package/dist/browser/models/index.d.ts.map +1 -1
- package/dist/browser/models/index.js +0 -1
- package/dist/browser/models/index.js.map +1 -1
- package/dist/browser/models/models.d.ts +3 -203
- package/dist/browser/models/models.d.ts.map +1 -1
- package/dist/browser/models/models.js +2 -249
- package/dist/browser/models/models.js.map +1 -1
- package/dist/browser/static-helpers/pagingHelpers.js +31 -50
- package/dist/browser/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/browser/static-helpers/urlTemplate.js +2 -2
- package/dist/browser/static-helpers/urlTemplate.js.map +1 -1
- package/dist/commonjs/aiProjectClient.d.ts +10 -15
- package/dist/commonjs/aiProjectClient.d.ts.map +1 -1
- package/dist/commonjs/aiProjectClient.js +58 -28
- package/dist/commonjs/aiProjectClient.js.map +1 -1
- package/dist/commonjs/api/aiProjectContext.js +20 -12
- package/dist/commonjs/api/aiProjectContext.js.map +1 -1
- package/dist/commonjs/api/connections/operations.js +41 -37
- package/dist/commonjs/api/connections/operations.js.map +1 -1
- package/dist/commonjs/api/datasets/operations.d.ts +4 -4
- package/dist/commonjs/api/datasets/operations.d.ts.map +1 -1
- package/dist/commonjs/api/datasets/operations.js +82 -44
- package/dist/commonjs/api/datasets/operations.js.map +1 -1
- package/dist/commonjs/api/deployments/operations.js +25 -13
- package/dist/commonjs/api/deployments/operations.js.map +1 -1
- package/dist/commonjs/api/indexes/operations.d.ts +2 -2
- package/dist/commonjs/api/indexes/operations.d.ts.map +1 -1
- package/dist/commonjs/api/indexes/operations.js +45 -18
- package/dist/commonjs/api/indexes/operations.js.map +1 -1
- package/dist/commonjs/api/inference/operations.d.ts +0 -40
- package/dist/commonjs/api/inference/operations.d.ts.map +1 -1
- package/dist/commonjs/api/inference/operations.js +6 -93
- package/dist/commonjs/api/inference/operations.js.map +1 -1
- package/dist/commonjs/api/inference/options.d.ts +4 -1
- package/dist/commonjs/api/inference/options.d.ts.map +1 -1
- package/dist/commonjs/api/inference/options.js.map +1 -1
- package/dist/commonjs/api/telemetry/operations.d.ts +1 -1
- package/dist/commonjs/api/telemetry/operations.d.ts.map +1 -1
- package/dist/commonjs/api/telemetry/operations.js +8 -23
- package/dist/commonjs/api/telemetry/operations.js.map +1 -1
- package/dist/commonjs/classic/connections/index.js +3 -1
- package/dist/commonjs/classic/connections/index.js.map +1 -1
- package/dist/commonjs/classic/datasets/index.d.ts +2 -2
- package/dist/commonjs/classic/datasets/index.d.ts.map +1 -1
- package/dist/commonjs/classic/datasets/index.js +7 -5
- package/dist/commonjs/classic/datasets/index.js.map +1 -1
- package/dist/commonjs/classic/deployments/index.js +3 -1
- package/dist/commonjs/classic/deployments/index.js.map +1 -1
- package/dist/commonjs/classic/index.d.ts +0 -2
- package/dist/commonjs/classic/index.d.ts.map +1 -1
- package/dist/commonjs/classic/index.js.map +1 -1
- package/dist/commonjs/classic/indexes/index.d.ts +1 -1
- package/dist/commonjs/classic/indexes/index.d.ts.map +1 -1
- package/dist/commonjs/classic/indexes/index.js +4 -2
- package/dist/commonjs/classic/indexes/index.js.map +1 -1
- package/dist/commonjs/classic/inference/index.d.ts +0 -7
- package/dist/commonjs/classic/inference/index.d.ts.map +1 -1
- package/dist/commonjs/classic/inference/index.js +3 -4
- package/dist/commonjs/classic/inference/index.js.map +1 -1
- package/dist/commonjs/classic/telemetry/index.d.ts +1 -4
- package/dist/commonjs/classic/telemetry/index.d.ts.map +1 -1
- package/dist/commonjs/classic/telemetry/index.js +1 -4
- package/dist/commonjs/classic/telemetry/index.js.map +1 -1
- package/dist/commonjs/constants.d.ts +1 -1
- package/dist/commonjs/constants.d.ts.map +1 -1
- package/dist/commonjs/constants.js +1 -1
- package/dist/commonjs/constants.js.map +1 -1
- package/dist/commonjs/index.d.ts +5 -5
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +1 -2
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +1 -2
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +1 -3
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/models.d.ts +3 -203
- package/dist/commonjs/models/models.d.ts.map +1 -1
- package/dist/commonjs/models/models.js +2 -281
- package/dist/commonjs/models/models.js.map +1 -1
- package/dist/commonjs/static-helpers/pagingHelpers.js +31 -50
- package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/commonjs/static-helpers/urlTemplate.js +2 -2
- package/dist/commonjs/static-helpers/urlTemplate.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/esm/aiProjectClient.d.ts +10 -15
- package/dist/esm/aiProjectClient.d.ts.map +1 -1
- package/dist/esm/aiProjectClient.js +48 -18
- package/dist/esm/aiProjectClient.js.map +1 -1
- package/dist/esm/api/aiProjectContext.js +20 -12
- package/dist/esm/api/aiProjectContext.js.map +1 -1
- package/dist/esm/api/connections/operations.js +41 -37
- package/dist/esm/api/connections/operations.js.map +1 -1
- package/dist/esm/api/datasets/operations.d.ts +4 -4
- package/dist/esm/api/datasets/operations.d.ts.map +1 -1
- package/dist/esm/api/datasets/operations.js +72 -34
- package/dist/esm/api/datasets/operations.js.map +1 -1
- package/dist/esm/api/deployments/operations.js +25 -13
- package/dist/esm/api/deployments/operations.js.map +1 -1
- package/dist/esm/api/indexes/operations.d.ts +2 -2
- package/dist/esm/api/indexes/operations.d.ts.map +1 -1
- package/dist/esm/api/indexes/operations.js +45 -18
- package/dist/esm/api/indexes/operations.js.map +1 -1
- package/dist/esm/api/inference/operations.d.ts +0 -40
- package/dist/esm/api/inference/operations.d.ts.map +1 -1
- package/dist/esm/api/inference/operations.js +6 -87
- package/dist/esm/api/inference/operations.js.map +1 -1
- package/dist/esm/api/inference/options.d.ts +4 -1
- package/dist/esm/api/inference/options.d.ts.map +1 -1
- package/dist/esm/api/inference/options.js.map +1 -1
- package/dist/esm/api/telemetry/operations.d.ts +1 -1
- package/dist/esm/api/telemetry/operations.d.ts.map +1 -1
- package/dist/esm/api/telemetry/operations.js +8 -23
- package/dist/esm/api/telemetry/operations.js.map +1 -1
- package/dist/esm/classic/connections/index.js +3 -1
- package/dist/esm/classic/connections/index.js.map +1 -1
- package/dist/esm/classic/datasets/index.d.ts +2 -2
- package/dist/esm/classic/datasets/index.d.ts.map +1 -1
- package/dist/esm/classic/datasets/index.js +7 -5
- package/dist/esm/classic/datasets/index.js.map +1 -1
- package/dist/esm/classic/deployments/index.js +3 -1
- package/dist/esm/classic/deployments/index.js.map +1 -1
- package/dist/esm/classic/index.d.ts +0 -2
- package/dist/esm/classic/index.d.ts.map +1 -1
- package/dist/esm/classic/index.js.map +1 -1
- package/dist/esm/classic/indexes/index.d.ts +1 -1
- package/dist/esm/classic/indexes/index.d.ts.map +1 -1
- package/dist/esm/classic/indexes/index.js +4 -2
- package/dist/esm/classic/indexes/index.js.map +1 -1
- package/dist/esm/classic/inference/index.d.ts +0 -7
- package/dist/esm/classic/inference/index.d.ts.map +1 -1
- package/dist/esm/classic/inference/index.js +4 -5
- package/dist/esm/classic/inference/index.js.map +1 -1
- package/dist/esm/classic/telemetry/index.d.ts +1 -4
- package/dist/esm/classic/telemetry/index.d.ts.map +1 -1
- package/dist/esm/classic/telemetry/index.js +1 -2
- package/dist/esm/classic/telemetry/index.js.map +1 -1
- package/dist/esm/constants.d.ts +1 -1
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/index.d.ts +5 -5
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/models/index.d.ts +1 -2
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +0 -1
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/models.d.ts +3 -203
- package/dist/esm/models/models.d.ts.map +1 -1
- package/dist/esm/models/models.js +2 -249
- package/dist/esm/models/models.js.map +1 -1
- package/dist/esm/static-helpers/pagingHelpers.js +31 -50
- package/dist/esm/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/esm/static-helpers/urlTemplate.js +2 -2
- package/dist/esm/static-helpers/urlTemplate.js.map +1 -1
- package/dist/react-native/aiProjectClient.d.ts +10 -15
- package/dist/react-native/aiProjectClient.d.ts.map +1 -1
- package/dist/react-native/aiProjectClient.js +48 -18
- package/dist/react-native/aiProjectClient.js.map +1 -1
- package/dist/react-native/api/aiProjectContext.js +20 -12
- package/dist/react-native/api/aiProjectContext.js.map +1 -1
- package/dist/react-native/api/connections/operations.js +41 -37
- package/dist/react-native/api/connections/operations.js.map +1 -1
- package/dist/react-native/api/datasets/operations.d.ts +4 -4
- package/dist/react-native/api/datasets/operations.d.ts.map +1 -1
- package/dist/react-native/api/datasets/operations.js +72 -34
- package/dist/react-native/api/datasets/operations.js.map +1 -1
- package/dist/react-native/api/deployments/operations.js +25 -13
- package/dist/react-native/api/deployments/operations.js.map +1 -1
- package/dist/react-native/api/indexes/operations.d.ts +2 -2
- package/dist/react-native/api/indexes/operations.d.ts.map +1 -1
- package/dist/react-native/api/indexes/operations.js +45 -18
- package/dist/react-native/api/indexes/operations.js.map +1 -1
- package/dist/react-native/api/inference/operations.d.ts +0 -40
- package/dist/react-native/api/inference/operations.d.ts.map +1 -1
- package/dist/react-native/api/inference/operations.js +6 -87
- package/dist/react-native/api/inference/operations.js.map +1 -1
- package/dist/react-native/api/inference/options.d.ts +4 -1
- package/dist/react-native/api/inference/options.d.ts.map +1 -1
- package/dist/react-native/api/inference/options.js.map +1 -1
- package/dist/react-native/api/telemetry/operations.d.ts +1 -1
- package/dist/react-native/api/telemetry/operations.d.ts.map +1 -1
- package/dist/react-native/api/telemetry/operations.js +8 -23
- package/dist/react-native/api/telemetry/operations.js.map +1 -1
- package/dist/react-native/classic/connections/index.js +3 -1
- package/dist/react-native/classic/connections/index.js.map +1 -1
- package/dist/react-native/classic/datasets/index.d.ts +2 -2
- package/dist/react-native/classic/datasets/index.d.ts.map +1 -1
- package/dist/react-native/classic/datasets/index.js +7 -5
- package/dist/react-native/classic/datasets/index.js.map +1 -1
- package/dist/react-native/classic/deployments/index.js +3 -1
- package/dist/react-native/classic/deployments/index.js.map +1 -1
- package/dist/react-native/classic/index.d.ts +0 -2
- package/dist/react-native/classic/index.d.ts.map +1 -1
- package/dist/react-native/classic/index.js.map +1 -1
- package/dist/react-native/classic/indexes/index.d.ts +1 -1
- package/dist/react-native/classic/indexes/index.d.ts.map +1 -1
- package/dist/react-native/classic/indexes/index.js +4 -2
- package/dist/react-native/classic/indexes/index.js.map +1 -1
- package/dist/react-native/classic/inference/index.d.ts +0 -7
- package/dist/react-native/classic/inference/index.d.ts.map +1 -1
- package/dist/react-native/classic/inference/index.js +4 -5
- package/dist/react-native/classic/inference/index.js.map +1 -1
- package/dist/react-native/classic/telemetry/index.d.ts +1 -4
- package/dist/react-native/classic/telemetry/index.d.ts.map +1 -1
- package/dist/react-native/classic/telemetry/index.js +1 -2
- package/dist/react-native/classic/telemetry/index.js.map +1 -1
- package/dist/react-native/constants.d.ts +1 -1
- package/dist/react-native/constants.d.ts.map +1 -1
- package/dist/react-native/constants.js +1 -1
- package/dist/react-native/constants.js.map +1 -1
- package/dist/react-native/index.d.ts +5 -5
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +1 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/models/index.d.ts +1 -2
- package/dist/react-native/models/index.d.ts.map +1 -1
- package/dist/react-native/models/index.js +0 -1
- package/dist/react-native/models/index.js.map +1 -1
- package/dist/react-native/models/models.d.ts +3 -203
- package/dist/react-native/models/models.d.ts.map +1 -1
- package/dist/react-native/models/models.js +2 -249
- package/dist/react-native/models/models.js.map +1 -1
- package/dist/react-native/static-helpers/pagingHelpers.js +31 -50
- package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/react-native/static-helpers/urlTemplate.js +2 -2
- package/dist/react-native/static-helpers/urlTemplate.js.map +1 -1
- package/package.json +46 -72
- package/dist/browser/api/evaluations/index.d.ts +0 -3
- package/dist/browser/api/evaluations/index.d.ts.map +0 -1
- package/dist/browser/api/evaluations/index.js +0 -4
- package/dist/browser/api/evaluations/index.js.map +0 -1
- package/dist/browser/api/evaluations/operations.d.ts +0 -22
- package/dist/browser/api/evaluations/operations.d.ts.map +0 -1
- package/dist/browser/api/evaluations/operations.js +0 -99
- package/dist/browser/api/evaluations/operations.js.map +0 -1
- package/dist/browser/api/evaluations/options.d.ts +0 -18
- package/dist/browser/api/evaluations/options.d.ts.map +0 -1
- package/dist/browser/api/evaluations/options.js +0 -4
- package/dist/browser/api/evaluations/options.js.map +0 -1
- package/dist/browser/api/inference/enableTelemetry.d.ts +0 -21
- package/dist/browser/api/inference/enableTelemetry.d.ts.map +0 -1
- package/dist/browser/api/inference/enableTelemetry.js +0 -185
- package/dist/browser/api/inference/enableTelemetry.js.map +0 -1
- package/dist/browser/api/inference/index.d.ts +0 -5
- package/dist/browser/api/inference/index.d.ts.map +0 -1
- package/dist/browser/api/inference/index.js +0 -7
- package/dist/browser/api/inference/index.js.map +0 -1
- package/dist/browser/api/redTeams/index.d.ts +0 -3
- package/dist/browser/api/redTeams/index.d.ts.map +0 -1
- package/dist/browser/api/redTeams/index.js +0 -4
- package/dist/browser/api/redTeams/index.js.map +0 -1
- package/dist/browser/api/redTeams/operations.d.ts +0 -18
- package/dist/browser/api/redTeams/operations.d.ts.map +0 -1
- package/dist/browser/api/redTeams/operations.js +0 -74
- package/dist/browser/api/redTeams/operations.js.map +0 -1
- package/dist/browser/api/redTeams/options.d.ts +0 -15
- package/dist/browser/api/redTeams/options.d.ts.map +0 -1
- package/dist/browser/api/redTeams/options.js +0 -4
- package/dist/browser/api/redTeams/options.js.map +0 -1
- package/dist/browser/classic/evaluations/index.d.ts +0 -17
- package/dist/browser/classic/evaluations/index.d.ts.map +0 -1
- package/dist/browser/classic/evaluations/index.js +0 -15
- package/dist/browser/classic/evaluations/index.js.map +0 -1
- package/dist/browser/classic/redTeams/index.d.ts +0 -15
- package/dist/browser/classic/redTeams/index.d.ts.map +0 -1
- package/dist/browser/classic/redTeams/index.js +0 -14
- package/dist/browser/classic/redTeams/index.js.map +0 -1
- package/dist/browser/models/evaluations.d.ts +0 -55
- package/dist/browser/models/evaluations.d.ts.map +0 -1
- package/dist/browser/models/evaluations.js +0 -56
- package/dist/browser/models/evaluations.js.map +0 -1
- package/dist/commonjs/api/evaluations/index.d.ts +0 -3
- package/dist/commonjs/api/evaluations/index.d.ts.map +0 -1
- package/dist/commonjs/api/evaluations/index.js +0 -11
- package/dist/commonjs/api/evaluations/index.js.map +0 -1
- package/dist/commonjs/api/evaluations/operations.d.ts +0 -22
- package/dist/commonjs/api/evaluations/operations.d.ts.map +0 -1
- package/dist/commonjs/api/evaluations/operations.js +0 -113
- package/dist/commonjs/api/evaluations/operations.js.map +0 -1
- package/dist/commonjs/api/evaluations/options.d.ts +0 -18
- package/dist/commonjs/api/evaluations/options.d.ts.map +0 -1
- package/dist/commonjs/api/evaluations/options.js +0 -5
- package/dist/commonjs/api/evaluations/options.js.map +0 -1
- package/dist/commonjs/api/inference/enableTelemetry.d.ts +0 -21
- package/dist/commonjs/api/inference/enableTelemetry.d.ts.map +0 -1
- package/dist/commonjs/api/inference/enableTelemetry.js +0 -189
- package/dist/commonjs/api/inference/enableTelemetry.js.map +0 -1
- package/dist/commonjs/api/inference/index.d.ts +0 -5
- package/dist/commonjs/api/inference/index.d.ts.map +0 -1
- package/dist/commonjs/api/inference/index.js +0 -11
- package/dist/commonjs/api/inference/index.js.map +0 -1
- package/dist/commonjs/api/redTeams/index.d.ts +0 -3
- package/dist/commonjs/api/redTeams/index.d.ts.map +0 -1
- package/dist/commonjs/api/redTeams/index.js +0 -10
- package/dist/commonjs/api/redTeams/index.js.map +0 -1
- package/dist/commonjs/api/redTeams/operations.d.ts +0 -18
- package/dist/commonjs/api/redTeams/operations.d.ts.map +0 -1
- package/dist/commonjs/api/redTeams/operations.js +0 -85
- package/dist/commonjs/api/redTeams/operations.js.map +0 -1
- package/dist/commonjs/api/redTeams/options.d.ts +0 -15
- package/dist/commonjs/api/redTeams/options.d.ts.map +0 -1
- package/dist/commonjs/api/redTeams/options.js +0 -5
- package/dist/commonjs/api/redTeams/options.js.map +0 -1
- package/dist/commonjs/classic/evaluations/index.d.ts +0 -17
- package/dist/commonjs/classic/evaluations/index.d.ts.map +0 -1
- package/dist/commonjs/classic/evaluations/index.js +0 -18
- package/dist/commonjs/classic/evaluations/index.js.map +0 -1
- package/dist/commonjs/classic/redTeams/index.d.ts +0 -15
- package/dist/commonjs/classic/redTeams/index.d.ts.map +0 -1
- package/dist/commonjs/classic/redTeams/index.js +0 -17
- package/dist/commonjs/classic/redTeams/index.js.map +0 -1
- package/dist/commonjs/models/evaluations.d.ts +0 -55
- package/dist/commonjs/models/evaluations.d.ts.map +0 -1
- package/dist/commonjs/models/evaluations.js +0 -59
- package/dist/commonjs/models/evaluations.js.map +0 -1
- package/dist/esm/api/evaluations/index.d.ts +0 -3
- package/dist/esm/api/evaluations/index.d.ts.map +0 -1
- package/dist/esm/api/evaluations/index.js +0 -4
- package/dist/esm/api/evaluations/index.js.map +0 -1
- package/dist/esm/api/evaluations/operations.d.ts +0 -22
- package/dist/esm/api/evaluations/operations.d.ts.map +0 -1
- package/dist/esm/api/evaluations/operations.js +0 -99
- package/dist/esm/api/evaluations/operations.js.map +0 -1
- package/dist/esm/api/evaluations/options.d.ts +0 -18
- package/dist/esm/api/evaluations/options.d.ts.map +0 -1
- package/dist/esm/api/evaluations/options.js +0 -4
- package/dist/esm/api/evaluations/options.js.map +0 -1
- package/dist/esm/api/inference/enableTelemetry.d.ts +0 -21
- package/dist/esm/api/inference/enableTelemetry.d.ts.map +0 -1
- package/dist/esm/api/inference/enableTelemetry.js +0 -185
- package/dist/esm/api/inference/enableTelemetry.js.map +0 -1
- package/dist/esm/api/inference/index.d.ts +0 -5
- package/dist/esm/api/inference/index.d.ts.map +0 -1
- package/dist/esm/api/inference/index.js +0 -7
- package/dist/esm/api/inference/index.js.map +0 -1
- package/dist/esm/api/redTeams/index.d.ts +0 -3
- package/dist/esm/api/redTeams/index.d.ts.map +0 -1
- package/dist/esm/api/redTeams/index.js +0 -4
- package/dist/esm/api/redTeams/index.js.map +0 -1
- package/dist/esm/api/redTeams/operations.d.ts +0 -18
- package/dist/esm/api/redTeams/operations.d.ts.map +0 -1
- package/dist/esm/api/redTeams/operations.js +0 -74
- package/dist/esm/api/redTeams/operations.js.map +0 -1
- package/dist/esm/api/redTeams/options.d.ts +0 -15
- package/dist/esm/api/redTeams/options.d.ts.map +0 -1
- package/dist/esm/api/redTeams/options.js +0 -4
- package/dist/esm/api/redTeams/options.js.map +0 -1
- package/dist/esm/classic/evaluations/index.d.ts +0 -17
- package/dist/esm/classic/evaluations/index.d.ts.map +0 -1
- package/dist/esm/classic/evaluations/index.js +0 -15
- package/dist/esm/classic/evaluations/index.js.map +0 -1
- package/dist/esm/classic/redTeams/index.d.ts +0 -15
- package/dist/esm/classic/redTeams/index.d.ts.map +0 -1
- package/dist/esm/classic/redTeams/index.js +0 -14
- package/dist/esm/classic/redTeams/index.js.map +0 -1
- package/dist/esm/models/evaluations.d.ts +0 -55
- package/dist/esm/models/evaluations.d.ts.map +0 -1
- package/dist/esm/models/evaluations.js +0 -56
- package/dist/esm/models/evaluations.js.map +0 -1
- package/dist/react-native/api/evaluations/index.d.ts +0 -3
- package/dist/react-native/api/evaluations/index.d.ts.map +0 -1
- package/dist/react-native/api/evaluations/index.js +0 -4
- package/dist/react-native/api/evaluations/index.js.map +0 -1
- package/dist/react-native/api/evaluations/operations.d.ts +0 -22
- package/dist/react-native/api/evaluations/operations.d.ts.map +0 -1
- package/dist/react-native/api/evaluations/operations.js +0 -99
- package/dist/react-native/api/evaluations/operations.js.map +0 -1
- package/dist/react-native/api/evaluations/options.d.ts +0 -18
- package/dist/react-native/api/evaluations/options.d.ts.map +0 -1
- package/dist/react-native/api/evaluations/options.js +0 -4
- package/dist/react-native/api/evaluations/options.js.map +0 -1
- package/dist/react-native/api/inference/enableTelemetry.d.ts +0 -21
- package/dist/react-native/api/inference/enableTelemetry.d.ts.map +0 -1
- package/dist/react-native/api/inference/enableTelemetry.js +0 -185
- package/dist/react-native/api/inference/enableTelemetry.js.map +0 -1
- package/dist/react-native/api/inference/index.d.ts +0 -5
- package/dist/react-native/api/inference/index.d.ts.map +0 -1
- package/dist/react-native/api/inference/index.js +0 -7
- package/dist/react-native/api/inference/index.js.map +0 -1
- package/dist/react-native/api/redTeams/index.d.ts +0 -3
- package/dist/react-native/api/redTeams/index.d.ts.map +0 -1
- package/dist/react-native/api/redTeams/index.js +0 -4
- package/dist/react-native/api/redTeams/index.js.map +0 -1
- package/dist/react-native/api/redTeams/operations.d.ts +0 -18
- package/dist/react-native/api/redTeams/operations.d.ts.map +0 -1
- package/dist/react-native/api/redTeams/operations.js +0 -74
- package/dist/react-native/api/redTeams/operations.js.map +0 -1
- package/dist/react-native/api/redTeams/options.d.ts +0 -15
- package/dist/react-native/api/redTeams/options.d.ts.map +0 -1
- package/dist/react-native/api/redTeams/options.js +0 -4
- package/dist/react-native/api/redTeams/options.js.map +0 -1
- package/dist/react-native/classic/evaluations/index.d.ts +0 -17
- package/dist/react-native/classic/evaluations/index.d.ts.map +0 -1
- package/dist/react-native/classic/evaluations/index.js +0 -15
- package/dist/react-native/classic/evaluations/index.js.map +0 -1
- package/dist/react-native/classic/redTeams/index.d.ts +0 -15
- package/dist/react-native/classic/redTeams/index.d.ts.map +0 -1
- package/dist/react-native/classic/redTeams/index.js +0 -14
- package/dist/react-native/classic/redTeams/index.js.map +0 -1
- package/dist/react-native/models/evaluations.d.ts +0 -55
- package/dist/react-native/models/evaluations.d.ts.map +0 -1
- package/dist/react-native/models/evaluations.js +0 -56
- package/dist/react-native/models/evaluations.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiProjectClient.d.ts","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"aiProjectClient.d.ts","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAqC,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAA6B,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAyB,MAAM,4BAA4B,CA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IxF;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CACjB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAE,6BAAkC,GAC1C,eAAe;IAIlB;;;;OAIG;IAEH,IAAW,MAAM,IAAI,YAAY,CAUhC;CACF"}
|
|
@@ -4,17 +4,14 @@
|
|
|
4
4
|
/* eslint-disable tsdoc/syntax */
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AIProjectClient = void 0;
|
|
7
|
-
const tslib_1 = require("tslib");
|
|
8
7
|
const ai_agents_1 = require("@azure/ai-agents");
|
|
9
8
|
const index_js_1 = require("./api/index.js");
|
|
10
|
-
const index_js_2 = require("./classic/
|
|
11
|
-
const index_js_3 = require("./classic/
|
|
12
|
-
const index_js_4 = require("./classic/
|
|
13
|
-
const index_js_5 = require("./classic/
|
|
14
|
-
const index_js_6 = require("./classic/
|
|
15
|
-
const index_js_7 = require("./classic/
|
|
16
|
-
const index_js_8 = require("./classic/inference/index.js");
|
|
17
|
-
const index_js_9 = require("./classic/telemetry/index.js");
|
|
9
|
+
const index_js_2 = require("./classic/deployments/index.js");
|
|
10
|
+
const index_js_3 = require("./classic/indexes/index.js");
|
|
11
|
+
const index_js_4 = require("./classic/datasets/index.js");
|
|
12
|
+
const index_js_5 = require("./classic/connections/index.js");
|
|
13
|
+
const index_js_6 = require("./classic/inference/index.js");
|
|
14
|
+
const index_js_7 = require("./classic/telemetry/index.js");
|
|
18
15
|
/**
|
|
19
16
|
* The main client for the AIProjectClient service. It provides access to the various operations available in the service.
|
|
20
17
|
* @class AIProjectClient
|
|
@@ -24,39 +21,62 @@ const index_js_9 = require("./classic/telemetry/index.js");
|
|
|
24
21
|
* @param {string} endpoint - The endpoint to use
|
|
25
22
|
* @param {TokenCredential} credential - The credential to use
|
|
26
23
|
* @param {AIProjectClientOptionalParams} [options] - Optional parameters for the client.
|
|
27
|
-
* @property {RedTeamsOperations} redTeams - The operation groups for redTeams
|
|
28
24
|
* @property {DeploymentsOperations} deployments - The operation groups for deployments
|
|
29
25
|
* @property {IndexesOperations} indexes - The operation groups for indexes
|
|
30
26
|
* @property {DatasetsOperations} datasets - The operation groups for datasets
|
|
31
|
-
* @property {EvaluationsOperations} evaluations - The operation groups for evaluations
|
|
32
27
|
* @property {ConnectionsOperations} connections - The operation groups for connections
|
|
33
|
-
* @
|
|
28
|
+
* @method {getAzureOpenAIClient} getAzureOpenAIClient - get the Azure OpenAI client for the project
|
|
34
29
|
* @property {TelemetryOperations} telemetry - The operation groups for telemetry
|
|
35
|
-
* @property {EnableTelemetryType} enableTelemetry - The operation groups for enabling telemetry
|
|
36
30
|
*/
|
|
37
31
|
class AIProjectClient {
|
|
32
|
+
_cognitiveScopeClient;
|
|
33
|
+
_azureScopeClient;
|
|
34
|
+
_endpoint;
|
|
35
|
+
_credential;
|
|
36
|
+
_agents;
|
|
37
|
+
_options;
|
|
38
|
+
_inference;
|
|
39
|
+
/** The pipeline used by this client to make requests */
|
|
40
|
+
pipeline;
|
|
38
41
|
constructor(endpointParam, credential, options = {}) {
|
|
39
|
-
var _a;
|
|
40
42
|
this._endpoint = endpointParam;
|
|
41
43
|
this._credential = credential;
|
|
42
44
|
this._options = options;
|
|
43
|
-
const prefixFromOptions =
|
|
45
|
+
const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
|
|
44
46
|
const userAgentPrefix = prefixFromOptions
|
|
45
47
|
? `${prefixFromOptions} azsdk-js-client`
|
|
46
48
|
: `azsdk-js-client`;
|
|
47
|
-
this._cognitiveScopeClient = (0, index_js_1.createAIProject)(endpointParam, credential,
|
|
48
|
-
|
|
49
|
+
this._cognitiveScopeClient = (0, index_js_1.createAIProject)(endpointParam, credential, {
|
|
50
|
+
...options,
|
|
51
|
+
userAgentOptions: { userAgentPrefix },
|
|
52
|
+
});
|
|
53
|
+
this._azureScopeClient = (0, index_js_1.createAIProject)(endpointParam, credential, {
|
|
54
|
+
...options,
|
|
55
|
+
credentials: {
|
|
56
|
+
...options.credentials,
|
|
57
|
+
scopes: ["https://ai.azure.com/.default"],
|
|
58
|
+
},
|
|
59
|
+
userAgentOptions: { userAgentPrefix },
|
|
60
|
+
});
|
|
49
61
|
this.pipeline = this._cognitiveScopeClient.pipeline;
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
55
|
-
this.
|
|
56
|
-
this.inference = (0, index_js_8._getInferenceOperations)(this._cognitiveScopeClient, this.connections);
|
|
57
|
-
this.telemetry = (0, index_js_9._getTelemetryOperations)(this.connections);
|
|
58
|
-
this.enableTelemetry = index_js_9.enableTelemetry;
|
|
62
|
+
this.deployments = (0, index_js_2._getDeploymentsOperations)(this._azureScopeClient);
|
|
63
|
+
this.indexes = (0, index_js_3._getIndexesOperations)(this._azureScopeClient);
|
|
64
|
+
this.datasets = (0, index_js_4._getDatasetsOperations)(this._azureScopeClient, this._options);
|
|
65
|
+
this.connections = (0, index_js_5._getConnectionsOperations)(this._azureScopeClient);
|
|
66
|
+
this._inference = (0, index_js_6._getInferenceOperations)(this._cognitiveScopeClient, this.connections);
|
|
67
|
+
this.telemetry = (0, index_js_7._getTelemetryOperations)(this.connections);
|
|
59
68
|
}
|
|
69
|
+
/** The operation groups for deployments */
|
|
70
|
+
deployments;
|
|
71
|
+
/** The operation groups for indexes */
|
|
72
|
+
indexes;
|
|
73
|
+
/** The operation groups for datasets */
|
|
74
|
+
datasets;
|
|
75
|
+
/** The operation groups for connections */
|
|
76
|
+
connections;
|
|
77
|
+
/** The operation groups for inference */
|
|
78
|
+
/** The operation groups for telemetry */
|
|
79
|
+
telemetry;
|
|
60
80
|
/**
|
|
61
81
|
* gets the endpoint of the client
|
|
62
82
|
* @returns the endpoint of the client
|
|
@@ -64,6 +84,13 @@ class AIProjectClient {
|
|
|
64
84
|
getEndpointUrl() {
|
|
65
85
|
return this._endpoint;
|
|
66
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Gets the Azure OpenAI client for the project.
|
|
89
|
+
* @returns The Azure OpenAI client for the project.
|
|
90
|
+
*/
|
|
91
|
+
getAzureOpenAIClient(options) {
|
|
92
|
+
return this._inference.azureOpenAI(options);
|
|
93
|
+
}
|
|
67
94
|
/**
|
|
68
95
|
* Creates a new instance of AzureAIProjectClient
|
|
69
96
|
* @param endpoint - The endpoint to use
|
|
@@ -80,9 +107,12 @@ class AIProjectClient {
|
|
|
80
107
|
*/
|
|
81
108
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients
|
|
82
109
|
get agents() {
|
|
83
|
-
const
|
|
110
|
+
const { apiVersion, ...clientOptions } = this._options;
|
|
84
111
|
if (!this._agents) {
|
|
85
|
-
this._agents = new ai_agents_1.AgentsClient(this._endpoint, this._credential,
|
|
112
|
+
this._agents = new ai_agents_1.AgentsClient(this._endpoint, this._credential, {
|
|
113
|
+
...clientOptions,
|
|
114
|
+
userAgentOptions: this._cognitiveScopeClient.getUserAgent(),
|
|
115
|
+
});
|
|
86
116
|
}
|
|
87
117
|
return this._agents;
|
|
88
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC
|
|
1
|
+
{"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;;;AAEjC,gDAAgD;AAEhD,6CAAkG;AAClG,6DAAkG;AAClG,yDAAsF;AACtF,0DAAyF;AACzF,6DAAkG;AAClG,2DAA4F;AAC5F,2DAA4F;AAO5F;;;;;;;;;;;;;;;GAeG;AACH,MAAa,eAAe;IAClB,qBAAqB,CAAmB;IACxC,iBAAiB,CAAmB;IACpC,SAAS,CAAS;IAClB,WAAW,CAAkB;IAC7B,OAAO,CAA2B;I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":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* eslint-disable tsdoc/syntax */\n\nimport { AgentsClient } from \"@azure/ai-agents\";\nimport type { AzureOpenAI } from \"openai\";\nimport { createAIProject, AIProjectContext, AIProjectClientOptionalParams } from \"./api/index.js\";\nimport { DeploymentsOperations, _getDeploymentsOperations } from \"./classic/deployments/index.js\";\nimport { IndexesOperations, _getIndexesOperations } from \"./classic/indexes/index.js\";\nimport { DatasetsOperations, _getDatasetsOperations } from \"./classic/datasets/index.js\";\nimport { ConnectionsOperations, _getConnectionsOperations } from \"./classic/connections/index.js\";\nimport { InferenceOperations, _getInferenceOperations } from \"./classic/inference/index.js\";\nimport { TelemetryOperations, _getTelemetryOperations } from \"./classic/telemetry/index.js\";\nimport { GetAzureOpenAIClientOptions } from \"./api/inference/options.js\";\nimport type { Pipeline } from \"@azure/core-rest-pipeline\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport { AIProjectClientOptionalParams } from \"./api/aiProjectContext.js\";\n\n/**\n * The main client for the AIProjectClient service. It provides access to the various operations available in the service.\n * @class AIProjectClient\n * @extends {AIProjectContext}\n * @description The main client for the AIProjectClient\n * @constructor\n * @param {string} endpoint - The endpoint to use\n * @param {TokenCredential} credential - The credential to use\n * @param {AIProjectClientOptionalParams} [options] - Optional parameters for the client.\n * @property {DeploymentsOperations} deployments - The operation groups for deployments\n * @property {IndexesOperations} indexes - The operation groups for indexes\n * @property {DatasetsOperations} datasets - The operation groups for datasets\n * @property {ConnectionsOperations} connections - The operation groups for connections\n * @method {getAzureOpenAIClient} getAzureOpenAIClient - get the Azure OpenAI client for the project\n * @property {TelemetryOperations} telemetry - The operation groups for telemetry\n */\nexport class AIProjectClient {\n private _cognitiveScopeClient: AIProjectContext;\n private _azureScopeClient: AIProjectContext;\n private _endpoint: string;\n private _credential: TokenCredential;\n private _agents: AgentsClient | undefined;\n private _options: AIProjectClientOptionalParams;\n private readonly _inference: InferenceOperations;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n constructor(\n endpointParam: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n ) {\n this._endpoint = endpointParam;\n this._credential = credential;\n this._options = options;\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._cognitiveScopeClient = createAIProject(endpointParam, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n\n this._azureScopeClient = createAIProject(endpointParam, credential, {\n ...options,\n credentials: {\n ...options.credentials,\n scopes: [\"https://ai.azure.com/.default\"],\n },\n userAgentOptions: { userAgentPrefix },\n });\n\n this.pipeline = this._cognitiveScopeClient.pipeline;\n this.deployments = _getDeploymentsOperations(this._azureScopeClient);\n this.indexes = _getIndexesOperations(this._azureScopeClient);\n this.datasets = _getDatasetsOperations(this._azureScopeClient, this._options);\n this.connections = _getConnectionsOperations(this._azureScopeClient);\n this._inference = _getInferenceOperations(this._cognitiveScopeClient, this.connections);\n this.telemetry = _getTelemetryOperations(this.connections);\n }\n\n /** The operation groups for deployments */\n public readonly deployments: DeploymentsOperations;\n /** The operation groups for indexes */\n public readonly indexes: IndexesOperations;\n /** The operation groups for datasets */\n public readonly datasets: DatasetsOperations;\n /** The operation groups for connections */\n public readonly connections: ConnectionsOperations;\n /** The operation groups for inference */\n /** The operation groups for telemetry */\n public readonly telemetry: TelemetryOperations;\n /**\n * gets the endpoint of the client\n * @returns the endpoint of the client\n */\n public getEndpointUrl(): string {\n return this._endpoint;\n }\n\n /**\n * Gets the Azure OpenAI client for the project.\n * @returns The Azure OpenAI client for the project.\n */\n public getAzureOpenAIClient(options?: GetAzureOpenAIClientOptions): Promise<AzureOpenAI> {\n return this._inference.azureOpenAI(options);\n }\n\n /**\n * Creates a new instance of AzureAIProjectClient\n * @param endpoint - The endpoint to use\n * @param credential - The credential to use\n * @param options - The parameter for all optional parameters\n */\n static fromEndpoint(\n endpoint: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n ): AIProjectClient {\n return new AIProjectClient(endpoint, credential, options);\n }\n\n /**\n * Get the AgentsClient associated with this AIProjectClient.\n *\n * @returns The AgentsClient associated with this AIProjectClient\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients\n public get agents(): AgentsClient {\n const { apiVersion, ...clientOptions } = this._options;\n\n if (!this._agents) {\n this._agents = new AgentsClient(this._endpoint, this._credential, {\n ...clientOptions,\n userAgentOptions: this._cognitiveScopeClient.getUserAgent(),\n });\n }\n return this._agents;\n }\n}\n"]}
|
|
@@ -3,31 +3,33 @@
|
|
|
3
3
|
// Licensed under the MIT License.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.createAIProject = createAIProject;
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
6
|
const logger_js_1 = require("../logger.js");
|
|
8
7
|
const core_client_1 = require("@azure-rest/core-client");
|
|
9
8
|
function createAIProject(endpointParam, credential, options = {}) {
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const userAgentInfo = `azsdk-js-ai-projects/1.0.0-beta.8`;
|
|
9
|
+
const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);
|
|
10
|
+
const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
|
|
11
|
+
const userAgentInfo = `azsdk-js-ai-projects/1.0.0`;
|
|
14
12
|
const userAgentPrefix = prefixFromOptions
|
|
15
13
|
? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`
|
|
16
14
|
: `azsdk-js-api ${userAgentInfo}`;
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const { apiVersion: _, ...updatedOptions } = {
|
|
16
|
+
...options,
|
|
17
|
+
userAgentOptions: { userAgentPrefix },
|
|
18
|
+
loggingOptions: { logger: options.loggingOptions?.logger ?? logger_js_1.logger.info },
|
|
19
|
+
credentials: {
|
|
20
|
+
scopes: options.credentials?.scopes ?? ["https://cognitiveservices.azure.com/.default"],
|
|
21
|
+
},
|
|
22
|
+
};
|
|
20
23
|
const clientContext = (0, core_client_1.getClient)(endpointUrl, credential, updatedOptions);
|
|
21
24
|
clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" });
|
|
22
|
-
const apiVersion =
|
|
25
|
+
const apiVersion = options.apiVersion ?? "v1";
|
|
23
26
|
clientContext.pipeline.addPolicy({
|
|
24
27
|
name: "ClientApiVersionPolicy",
|
|
25
28
|
sendRequest: (req, next) => {
|
|
26
|
-
var _a;
|
|
27
29
|
// Use the apiVersion defined in request url directly
|
|
28
30
|
// Append one if there is no apiVersion and we have one at client options
|
|
29
31
|
const url = new URL(req.url);
|
|
30
|
-
const defaultApiVersion =
|
|
32
|
+
const defaultApiVersion = url.searchParams.get("api-version") ?? apiVersion;
|
|
31
33
|
// remove api-version from url
|
|
32
34
|
url.searchParams.delete("api-version");
|
|
33
35
|
// add api-version to url
|
|
@@ -35,6 +37,12 @@ function createAIProject(endpointParam, credential, options = {}) {
|
|
|
35
37
|
return next(req);
|
|
36
38
|
},
|
|
37
39
|
});
|
|
38
|
-
return
|
|
40
|
+
return {
|
|
41
|
+
...clientContext,
|
|
42
|
+
apiVersion,
|
|
43
|
+
getEndpointUrl: () => endpointUrl,
|
|
44
|
+
getUserAgent: () => ({ userAgentPrefix }),
|
|
45
|
+
getCredential: () => credential,
|
|
46
|
+
};
|
|
39
47
|
}
|
|
40
48
|
//# sourceMappingURL=aiProjectContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiProjectContext.js","sourceRoot":"","sources":["../../../src/api/aiProjectContext.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA0BlC,0CA6CC
|
|
1
|
+
{"version":3,"file":"aiProjectContext.js","sourceRoot":"","sources":["../../../src/api/aiProjectContext.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;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AAC,CAAC;YAC7B,MAAM,iBAAiB,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,CAAC;YAC5E,8BAA8B;YAC9B,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YACvC,yBAAyB;YACzB,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,GACzB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,iBAAiB,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO;QACL,GAAG,aAAa;QAChB,UAAU;QACV,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW;QACjC,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC;QACzC,aAAa,EAAE,GAAG,EAAE,CAAC,UAAU;KACZ,CAAC;AACxB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport { Client, ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport interface AIProjectContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n /** The endpoint URL used to construct AIProjectClient. */\n getEndpointUrl(): string;\n /** The user agent string used to construct AIProjectClient. */\n getUserAgent(): { userAgentPrefix: string };\n /** The credential used to construct AIProjectClient. */\n getCredential(): TokenCredential;\n}\n\n/** Optional parameters for the client. */\nexport interface AIProjectClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\nexport function createAIProject(\n endpointParam: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n): AIProjectContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-ai-projects/1.0.0`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://cognitiveservices.azure.com/.default\"],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"v1\";\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n const defaultApiVersion = url.searchParams.get(\"api-version\") ?? apiVersion;\n // remove api-version from url\n url.searchParams.delete(\"api-version\");\n // add api-version to url\n req.url = `${url.toString()}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${defaultApiVersion}`;\n return next(req);\n },\n });\n return {\n ...clientContext,\n apiVersion,\n getEndpointUrl: () => endpointUrl,\n getUserAgent: () => ({ userAgentPrefix }),\n getCredential: () => credential,\n } as AIProjectContext;\n}\n"]}
|
|
@@ -12,23 +12,28 @@ exports._getSend = _getSend;
|
|
|
12
12
|
exports._getDeserialize = _getDeserialize;
|
|
13
13
|
exports.get = get;
|
|
14
14
|
exports.getDefault = getDefault;
|
|
15
|
-
const tslib_1 = require("tslib");
|
|
16
15
|
const models_js_1 = require("../../models/models.js");
|
|
17
16
|
const urlTemplate_js_1 = require("../../static-helpers/urlTemplate.js");
|
|
18
17
|
const pagingHelpers_js_1 = require("../../static-helpers/pagingHelpers.js");
|
|
19
18
|
const core_client_1 = require("@azure-rest/core-client");
|
|
20
19
|
function _listSend(context, options = { requestOptions: {} }) {
|
|
21
|
-
var _a, _b;
|
|
22
20
|
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/connections{?api-version,connectionType,defaultConnection}", {
|
|
23
21
|
"api-version": context.apiVersion,
|
|
24
|
-
connectionType: options
|
|
25
|
-
defaultConnection: options
|
|
22
|
+
connectionType: options?.connectionType,
|
|
23
|
+
defaultConnection: options?.defaultConnection,
|
|
26
24
|
}, {
|
|
27
|
-
allowReserved:
|
|
25
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
26
|
+
});
|
|
27
|
+
return context.path(path).get({
|
|
28
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
29
|
+
headers: {
|
|
30
|
+
...(options?.clientRequestId !== undefined
|
|
31
|
+
? { "x-ms-client-request-id": options?.clientRequestId }
|
|
32
|
+
: {}),
|
|
33
|
+
accept: "application/json",
|
|
34
|
+
...options.requestOptions?.headers,
|
|
35
|
+
},
|
|
28
36
|
});
|
|
29
|
-
return context.path(path).get(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { headers: Object.assign(Object.assign(Object.assign({}, ((options === null || options === void 0 ? void 0 : options.clientRequestId) !== undefined
|
|
30
|
-
? { "x-ms-client-request-id": options === null || options === void 0 ? void 0 : options.clientRequestId }
|
|
31
|
-
: {})), { accept: "application/json" }), (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers) }));
|
|
32
37
|
}
|
|
33
38
|
async function _listDeserialize(result) {
|
|
34
39
|
const expectedStatuses = ["200"];
|
|
@@ -42,16 +47,22 @@ function list(context, options = { requestOptions: {} }) {
|
|
|
42
47
|
return (0, pagingHelpers_js_1.buildPagedAsyncIterator)(context, () => _listSend(context, options), _listDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink" });
|
|
43
48
|
}
|
|
44
49
|
function _getWithCredentialsSend(context, name, options = { requestOptions: {} }) {
|
|
45
|
-
var _a, _b;
|
|
46
50
|
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/connections/{name}/getConnectionWithCredentials{?api-version}", {
|
|
47
51
|
name: name,
|
|
48
52
|
"api-version": context.apiVersion,
|
|
49
53
|
}, {
|
|
50
|
-
allowReserved:
|
|
54
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
55
|
+
});
|
|
56
|
+
return context.path(path).post({
|
|
57
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
58
|
+
headers: {
|
|
59
|
+
...(options?.clientRequestId !== undefined
|
|
60
|
+
? { "x-ms-client-request-id": options?.clientRequestId }
|
|
61
|
+
: {}),
|
|
62
|
+
accept: "application/json",
|
|
63
|
+
...options.requestOptions?.headers,
|
|
64
|
+
},
|
|
51
65
|
});
|
|
52
|
-
return context.path(path).post(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { headers: Object.assign(Object.assign(Object.assign({}, ((options === null || options === void 0 ? void 0 : options.clientRequestId) !== undefined
|
|
53
|
-
? { "x-ms-client-request-id": options === null || options === void 0 ? void 0 : options.clientRequestId }
|
|
54
|
-
: {})), { accept: "application/json" }), (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers) }));
|
|
55
66
|
}
|
|
56
67
|
async function _getWithCredentialsDeserialize(result) {
|
|
57
68
|
const expectedStatuses = ["200"];
|
|
@@ -66,16 +77,22 @@ async function getWithCredentials(context, name, options = { requestOptions: {}
|
|
|
66
77
|
return _getWithCredentialsDeserialize(result);
|
|
67
78
|
}
|
|
68
79
|
function _getSend(context, name, options = { requestOptions: {} }) {
|
|
69
|
-
var _a, _b;
|
|
70
80
|
const path = (0, urlTemplate_js_1.expandUrlTemplate)("/connections/{name}{?api-version}", {
|
|
71
81
|
name: name,
|
|
72
82
|
"api-version": context.apiVersion,
|
|
73
83
|
}, {
|
|
74
|
-
allowReserved:
|
|
84
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
85
|
+
});
|
|
86
|
+
return context.path(path).get({
|
|
87
|
+
...(0, core_client_1.operationOptionsToRequestParameters)(options),
|
|
88
|
+
headers: {
|
|
89
|
+
...(options?.clientRequestId !== undefined
|
|
90
|
+
? { "x-ms-client-request-id": options?.clientRequestId }
|
|
91
|
+
: {}),
|
|
92
|
+
accept: "application/json",
|
|
93
|
+
...options.requestOptions?.headers,
|
|
94
|
+
},
|
|
75
95
|
});
|
|
76
|
-
return context.path(path).get(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { headers: Object.assign(Object.assign(Object.assign({}, ((options === null || options === void 0 ? void 0 : options.clientRequestId) !== undefined
|
|
77
|
-
? { "x-ms-client-request-id": options === null || options === void 0 ? void 0 : options.clientRequestId }
|
|
78
|
-
: {})), { accept: "application/json" }), (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers) }));
|
|
79
96
|
}
|
|
80
97
|
async function _getDeserialize(result) {
|
|
81
98
|
const expectedStatuses = ["200"];
|
|
@@ -102,32 +119,19 @@ async function get(context, name, includeCredentials, options = { requestOptions
|
|
|
102
119
|
* @throws Error if no default connection is found for the given type.
|
|
103
120
|
*/
|
|
104
121
|
async function getDefault(context, connectionType, includeCredentials = false) {
|
|
105
|
-
var _a, e_1, _b, _c;
|
|
106
122
|
const listOptions = {
|
|
107
123
|
connectionType,
|
|
108
124
|
defaultConnection: true,
|
|
109
125
|
};
|
|
110
126
|
// Use the list function to find default connections of the specified type
|
|
111
127
|
const connections = list(context, listOptions);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const connection = _c;
|
|
118
|
-
if (includeCredentials) {
|
|
119
|
-
// If credentials are requested, get the connection with credentials
|
|
120
|
-
return getWithCredentials(context, connection.name);
|
|
121
|
-
}
|
|
122
|
-
return connection;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
126
|
-
finally {
|
|
127
|
-
try {
|
|
128
|
-
if (!_d && !_a && (_b = connections_1.return)) await _b.call(connections_1);
|
|
128
|
+
// Find the first default connection
|
|
129
|
+
for await (const connection of connections) {
|
|
130
|
+
if (includeCredentials) {
|
|
131
|
+
// If credentials are requested, get the connection with credentials
|
|
132
|
+
return getWithCredentials(context, connection.name);
|
|
129
133
|
}
|
|
130
|
-
|
|
134
|
+
return connection;
|
|
131
135
|
}
|
|
132
136
|
throw new Error(`No default connection found for type: ${connectionType}.`);
|
|
133
137
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/connections/operations.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA2BlC,8BAyBC;AAED,4CAOC;AAGD,oBAWC;AAED,0DAyBC;AAED,wEASC;AAGD,gDAOC;AAED,4BAyBC;AAED,0CAOC;AAGD,kBAWC;AAWD,gCAuBC;;AA5MD,sDAMgC;AAMhC,wEAAwE;AACxE,4EAG+C;AAC/C,yDAKiC;AAEjC,SAAgB,SAAS,CACvB,OAAe,EACf,UAAyC,EAAE,cAAc,EAAE,EAAE,EAAE;;IAE/D,MAAM,IAAI,GAAG,IAAA,kCAAiB,EAC5B,6DAA6D,EAC7D;QACE,aAAa,EAAE,OAAO,CAAC,UAAU;QACjC,cAAc,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc;QACvC,iBAAiB,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB;KAC9C,EACD;QACE,aAAa,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,0CAAE,eAAe;KACxD,CACF,CAAC;IACF,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,iCACxB,IAAA,iDAA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,WAAW,GAAG;QAClB,cAAc;QACd,iBAAiB,EAAE,IAAI;KACxB,CAAC;IAEF,0EAA0E;IAC1E,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;;QAE/C,oCAAoC;QACpC,KAA+B,eAAA,gBAAA,sBAAA,WAAW,CAAA,iBAAA,2FAAE,CAAC;YAAd,2BAAW;YAAX,WAAW;YAA/B,MAAM,UAAU,KAAA,CAAA;YACzB,IAAI,kBAAkB,EAAE,CAAC;gBACvB,oEAAoE;gBACpE,OAAO,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;YACtD,CAAC;YACD,OAAO,UAAU,CAAC;QACpB,CAAC;;;;;;;;;IAED,MAAM,IAAI,KAAK,CAAC,yCAAyC,cAAc,GAAG,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AIProjectContext as Client } from \"../index.js\";\nimport {\n Connection,\n connectionDeserializer,\n _PagedConnection,\n _pagedConnectionDeserializer,\n ConnectionType,\n} from \"../../models/models.js\";\nimport {\n ConnectionsListOptionalParams,\n ConnectionsGetWithCredentialsOptionalParams,\n ConnectionsGetOptionalParams,\n} from \"./options.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _listSend(\n context: Client,\n options: ConnectionsListOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/connections{?api-version,connectionType,defaultConnection}\",\n {\n \"api-version\": context.apiVersion,\n connectionType: options?.connectionType,\n defaultConnection: options?.defaultConnection,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listDeserialize(result: PathUncheckedResponse): Promise<_PagedConnection> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedConnectionDeserializer(result.body);\n}\n\n/** List all connections in the project, without populating connection credentials */\nexport function list(\n context: Client,\n options: ConnectionsListOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<Connection> {\n return buildPagedAsyncIterator(\n context,\n () => _listSend(context, options),\n _listDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n\nexport function _getWithCredentialsSend(\n context: Client,\n name: string,\n options: ConnectionsGetWithCredentialsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/connections/{name}/getConnectionWithCredentials{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getWithCredentialsDeserialize(\n result: PathUncheckedResponse,\n): Promise<Connection> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return connectionDeserializer(result.body);\n}\n\n/** Get a connection by name, with its connection credentials */\nexport async function getWithCredentials(\n context: Client,\n name: string,\n options: ConnectionsGetWithCredentialsOptionalParams = { requestOptions: {} },\n): Promise<Connection> {\n const result = await _getWithCredentialsSend(context, name, options);\n return _getWithCredentialsDeserialize(result);\n}\n\nexport function _getSend(\n context: Client,\n name: string,\n options: ConnectionsGetOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/connections/{name}{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getDeserialize(result: PathUncheckedResponse): Promise<Connection> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return connectionDeserializer(result.body);\n}\n\n/** Get a connection by name, without populating connection credentials */\nexport async function get(\n context: Client,\n name: string,\n includeCredentials?: boolean,\n options: ConnectionsGetOptionalParams = { requestOptions: {} },\n): Promise<Connection> {\n if (includeCredentials) {\n return getWithCredentials(context, name, options);\n }\n const result = await _getSend(context, name, options);\n return _getDeserialize(result);\n}\n\n/**\n * Get the default connection for a given connection type.\n *\n * @param context - The AIProjectContext client\n * @param connectionType - The type of the connection. Required.\n * @param includeCredentials - Whether to include credentials in the response. Default is false.\n * @returns A Connection object\n * @throws Error if no default connection is found for the given type.\n */\nexport async function getDefault(\n context: Client,\n connectionType: ConnectionType,\n includeCredentials: boolean = false,\n): Promise<Connection> {\n const listOptions = {\n connectionType,\n defaultConnection: true,\n };\n\n // Use the list function to find default connections of the specified type\n const connections = list(context, listOptions);\n\n // Find the first default connection\n for await (const connection of connections) {\n if (includeCredentials) {\n // If credentials are requested, get the connection with credentials\n return getWithCredentials(context, connection.name);\n }\n return connection;\n }\n\n throw new Error(`No default connection found for type: ${connectionType}.`);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/connections/operations.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA2BlC,8BAy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,UAAU,GAAG,CACvB,OAAe,EACf,IAAY,EACZ,kBAA4B,EAC5B,UAAwC,EAAE,cAAc,EAAE,EAAE,EAAE;IAE9D,IAAI,kBAAkB,EAAE,CAAC;QACvB,OAAO,kBAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,UAAU,CAC9B,OAAe,EACf,cAA8B,EAC9B,qBAA8B,KAAK;IAEnC,MAAM,WAAW,GAAG;QAClB,cAAc;QACd,iBAAiB,EAAE,IAAI;KACxB,CAAC;IAEF,0EAA0E;IAC1E,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAE/C,oCAAoC;IACpC,IAAI,KAAK,EAAE,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QAC3C,IAAI,kBAAkB,EAAE,CAAC;YACvB,oEAAoE;YACpE,OAAO,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,yCAAyC,cAAc,GAAG,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AIProjectContext as Client } from \"../index.js\";\nimport {\n Connection,\n connectionDeserializer,\n _PagedConnection,\n _pagedConnectionDeserializer,\n ConnectionType,\n} from \"../../models/models.js\";\nimport {\n ConnectionsListOptionalParams,\n ConnectionsGetWithCredentialsOptionalParams,\n ConnectionsGetOptionalParams,\n} from \"./options.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _listSend(\n context: Client,\n options: ConnectionsListOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/connections{?api-version,connectionType,defaultConnection}\",\n {\n \"api-version\": context.apiVersion,\n connectionType: options?.connectionType,\n defaultConnection: options?.defaultConnection,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listDeserialize(result: PathUncheckedResponse): Promise<_PagedConnection> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedConnectionDeserializer(result.body);\n}\n\n/** List all connections in the project, without populating connection credentials */\nexport function list(\n context: Client,\n options: ConnectionsListOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<Connection> {\n return buildPagedAsyncIterator(\n context,\n () => _listSend(context, options),\n _listDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n\nexport function _getWithCredentialsSend(\n context: Client,\n name: string,\n options: ConnectionsGetWithCredentialsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/connections/{name}/getConnectionWithCredentials{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getWithCredentialsDeserialize(\n result: PathUncheckedResponse,\n): Promise<Connection> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return connectionDeserializer(result.body);\n}\n\n/** Get a connection by name, with its connection credentials */\nexport async function getWithCredentials(\n context: Client,\n name: string,\n options: ConnectionsGetWithCredentialsOptionalParams = { requestOptions: {} },\n): Promise<Connection> {\n const result = await _getWithCredentialsSend(context, name, options);\n return _getWithCredentialsDeserialize(result);\n}\n\nexport function _getSend(\n context: Client,\n name: string,\n options: ConnectionsGetOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/connections/{name}{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getDeserialize(result: PathUncheckedResponse): Promise<Connection> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return connectionDeserializer(result.body);\n}\n\n/** Get a connection by name, without populating connection credentials */\nexport async function get(\n context: Client,\n name: string,\n includeCredentials?: boolean,\n options: ConnectionsGetOptionalParams = { requestOptions: {} },\n): Promise<Connection> {\n if (includeCredentials) {\n return getWithCredentials(context, name, options);\n }\n const result = await _getSend(context, name, options);\n return _getDeserialize(result);\n}\n\n/**\n * Get the default connection for a given connection type.\n *\n * @param context - The AIProjectContext client\n * @param connectionType - The type of the connection. Required.\n * @param includeCredentials - Whether to include credentials in the response. Default is false.\n * @returns A Connection object\n * @throws Error if no default connection is found for the given type.\n */\nexport async function getDefault(\n context: Client,\n connectionType: ConnectionType,\n includeCredentials: boolean = false,\n): Promise<Connection> {\n const listOptions = {\n connectionType,\n defaultConnection: true,\n };\n\n // Use the list function to find default connections of the specified type\n const connections = list(context, listOptions);\n\n // Find the first default connection\n for await (const connection of connections) {\n if (includeCredentials) {\n // If credentials are requested, get the connection with credentials\n return getWithCredentials(context, connection.name);\n }\n return connection;\n }\n\n throw new Error(`No default connection found for type: ${connectionType}.`);\n}\n"]}
|
|
@@ -7,16 +7,16 @@ export declare function _getCredentialsSend(context: Client, name: string, versi
|
|
|
7
7
|
export declare function _getCredentialsDeserialize(result: PathUncheckedResponse): Promise<AssetCredentialResponse>;
|
|
8
8
|
/** Get the SAS credential to access the storage account associated with a Dataset version. */
|
|
9
9
|
export declare function getCredentials(context: Client, name: string, version: string, options?: DatasetsGetCredentialsOptionalParams): Promise<AssetCredentialResponse>;
|
|
10
|
-
export declare function _pendingUploadSend(context: Client, name: string, version: string,
|
|
10
|
+
export declare function _pendingUploadSend(context: Client, name: string, version: string, pendingUploadRequest: PendingUploadRequest, options?: DatasetsPendingUploadOptionalParams): StreamableMethod;
|
|
11
11
|
export declare function _pendingUploadDeserialize(result: PathUncheckedResponse): Promise<PendingUploadResponse>;
|
|
12
12
|
/** Start a new or get an existing pending upload of a dataset for a specific version. */
|
|
13
|
-
export declare function pendingUpload(context: Client, name: string, version: string,
|
|
13
|
+
export declare function pendingUpload(context: Client, name: string, version: string, pendingUploadRequest: PendingUploadRequest, options?: DatasetsPendingUploadOptionalParams): Promise<PendingUploadResponse>;
|
|
14
14
|
export declare function uploadFile(context: Client, name: string, version: string, filePath: string, options?: DatasetUploadInternalOptions): Promise<DatasetVersionUnion>;
|
|
15
15
|
export declare function uploadFolder(context: Client, name: string, version: string, folderPath: string, options?: DatasetUploadInternalOptions): Promise<DatasetVersionUnion>;
|
|
16
|
-
export declare function _createOrUpdateSend(context: Client, name: string, version: string,
|
|
16
|
+
export declare function _createOrUpdateSend(context: Client, name: string, version: string, datasetVersion: DatasetVersionUnion, options?: DatasetsCreateOrUpdateOptionalParams): StreamableMethod;
|
|
17
17
|
export declare function _createOrUpdateDeserialize(result: PathUncheckedResponse): Promise<DatasetVersionUnion>;
|
|
18
18
|
/** Create a new or update an existing DatasetVersion with the given version id */
|
|
19
|
-
export declare function createOrUpdate(context: Client, name: string, version: string,
|
|
19
|
+
export declare function createOrUpdate(context: Client, name: string, version: string, datasetVersion: DatasetVersionUnion, options?: DatasetsCreateOrUpdateOptionalParams): Promise<DatasetVersionUnion>;
|
|
20
20
|
export declare function _$deleteSend(context: Client, name: string, version: string, options?: DatasetsDeleteOptionalParams): StreamableMethod;
|
|
21
21
|
export declare function _$deleteDeserialize(result: PathUncheckedResponse): Promise<void>;
|
|
22
22
|
/** Delete the specific version of the DatasetVersion */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/api/datasets/operations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,4BAA4B,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EACL,oBAAoB,EAIpB,mBAAmB,EACnB,oBAAoB,EAEpB,qBAAqB,EAErB,uBAAuB,EAExB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oCAAoC,EACpC,mCAAmC,EACnC,oCAAoC,EACpC,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,kCAAkC,EACnC,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,0BAA0B,EAE3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EAGtB,MAAM,yBAAyB,CAAC;AAGjC,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,oCAA6D,GACrE,gBAAgB,CAmBlB;AAED,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,uBAAuB,CAAC,CAOlC;AAED,8FAA8F;AAC9F,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,oCAA6D,GACrE,OAAO,CAAC,uBAAuB,CAAC,CAGlC;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/api/datasets/operations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,4BAA4B,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EACL,oBAAoB,EAIpB,mBAAmB,EACnB,oBAAoB,EAEpB,qBAAqB,EAErB,uBAAuB,EAExB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oCAAoC,EACpC,mCAAmC,EACnC,oCAAoC,EACpC,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,kCAAkC,EACnC,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,0BAA0B,EAE3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EAGtB,MAAM,yBAAyB,CAAC;AAGjC,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,oCAA6D,GACrE,gBAAgB,CAmBlB;AAED,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,uBAAuB,CAAC,CAOlC;AAED,8FAA8F;AAC9F,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,oCAA6D,GACrE,OAAO,CAAC,uBAAuB,CAAC,CAGlC;AAED,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