@azure-rest/purview-administration 1.0.0-beta.1 → 1.0.0-beta.3
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/CHANGELOG.md +16 -0
- package/LICENSE +3 -3
- package/README.md +62 -36
- package/dist/browser/account/clientDefinitions.d.ts +73 -0
- package/dist/browser/account/clientDefinitions.d.ts.map +1 -0
- package/dist/browser/account/clientDefinitions.js +4 -0
- package/dist/browser/account/clientDefinitions.js.map +1 -0
- package/dist/browser/account/index.d.ts +10 -0
- package/dist/browser/account/index.d.ts.map +1 -0
- package/dist/browser/account/index.js +12 -0
- package/dist/browser/account/index.js.map +1 -0
- package/dist/browser/account/isUnexpected.d.ts +16 -0
- package/dist/browser/account/isUnexpected.d.ts.map +1 -0
- package/dist/browser/account/isUnexpected.js +82 -0
- package/dist/browser/account/isUnexpected.js.map +1 -0
- package/dist/browser/account/models.d.ts +130 -0
- package/dist/browser/account/models.d.ts.map +1 -0
- package/dist/browser/account/models.js +4 -0
- package/dist/browser/account/models.js.map +1 -0
- package/dist/browser/account/outputModels.d.ts +337 -0
- package/dist/browser/account/outputModels.d.ts.map +1 -0
- package/dist/browser/account/outputModels.js +4 -0
- package/dist/browser/account/outputModels.js.map +1 -0
- package/dist/browser/account/paginateHelper.d.ts +68 -0
- package/dist/browser/account/paginateHelper.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/account/paginateHelper.js +70 -3
- package/dist/browser/account/paginateHelper.js.map +1 -0
- package/dist/browser/account/parameters.d.ts +63 -0
- package/dist/browser/account/parameters.d.ts.map +1 -0
- package/dist/browser/account/parameters.js +4 -0
- package/dist/browser/account/parameters.js.map +1 -0
- package/dist/browser/account/purviewAccount.d.ts +16 -0
- package/dist/browser/account/purviewAccount.d.ts.map +1 -0
- package/dist/browser/account/purviewAccount.js +45 -0
- package/dist/browser/account/purviewAccount.js.map +1 -0
- package/dist/browser/account/responses.d.ts +145 -0
- package/dist/browser/account/responses.d.ts.map +1 -0
- package/dist/browser/account/responses.js +4 -0
- package/dist/browser/account/responses.js.map +1 -0
- package/dist/browser/index.d.ts +4 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +6 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.d.ts.map +1 -0
- package/dist/browser/logger.js +5 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/metadataPolicies/clientDefinitions.d.ts +29 -0
- package/dist/browser/metadataPolicies/clientDefinitions.d.ts.map +1 -0
- package/dist/browser/metadataPolicies/clientDefinitions.js +4 -0
- package/dist/browser/metadataPolicies/clientDefinitions.js.map +1 -0
- package/dist/browser/metadataPolicies/index.d.ts +10 -0
- package/dist/browser/metadataPolicies/index.d.ts.map +1 -0
- package/dist/browser/metadataPolicies/index.js +12 -0
- package/dist/browser/metadataPolicies/index.js.map +1 -0
- package/dist/browser/metadataPolicies/isUnexpected.d.ts +6 -0
- package/dist/browser/metadataPolicies/isUnexpected.d.ts.map +1 -0
- package/dist/browser/metadataPolicies/isUnexpected.js +72 -0
- package/dist/browser/metadataPolicies/isUnexpected.js.map +1 -0
- package/dist/browser/metadataPolicies/models.d.ts +58 -0
- package/dist/browser/metadataPolicies/models.d.ts.map +1 -0
- package/dist/browser/metadataPolicies/models.js +4 -0
- package/dist/browser/metadataPolicies/models.js.map +1 -0
- package/dist/browser/metadataPolicies/outputModels.d.ts +113 -0
- package/dist/browser/metadataPolicies/outputModels.d.ts.map +1 -0
- package/dist/browser/metadataPolicies/outputModels.js +4 -0
- package/dist/browser/metadataPolicies/outputModels.js.map +1 -0
- package/dist/browser/metadataPolicies/paginateHelper.d.ts +72 -0
- package/dist/browser/metadataPolicies/paginateHelper.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/metadataPolicies/paginateHelper.js +70 -3
- package/dist/browser/metadataPolicies/paginateHelper.js.map +1 -0
- package/dist/browser/metadataPolicies/parameters.d.ts +22 -0
- package/dist/browser/metadataPolicies/parameters.d.ts.map +1 -0
- package/dist/browser/metadataPolicies/parameters.js +4 -0
- package/dist/browser/metadataPolicies/parameters.js.map +1 -0
- package/dist/browser/metadataPolicies/purviewMetadataPolicies.d.ts +16 -0
- package/dist/browser/metadataPolicies/purviewMetadataPolicies.d.ts.map +1 -0
- package/dist/browser/metadataPolicies/purviewMetadataPolicies.js +45 -0
- package/dist/browser/metadataPolicies/purviewMetadataPolicies.js.map +1 -0
- package/dist/browser/metadataPolicies/responses.d.ts +64 -0
- package/dist/browser/metadataPolicies/responses.d.ts.map +1 -0
- package/dist/browser/metadataPolicies/responses.js +4 -0
- package/dist/browser/metadataPolicies/responses.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/commonjs/account/clientDefinitions.d.ts +73 -0
- package/dist/commonjs/account/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/account/clientDefinitions.js +5 -0
- package/dist/commonjs/account/clientDefinitions.js.map +1 -0
- package/dist/commonjs/account/index.d.ts +10 -0
- package/dist/commonjs/account/index.d.ts.map +1 -0
- package/dist/commonjs/account/index.js +23 -0
- package/dist/commonjs/account/index.js.map +1 -0
- package/dist/commonjs/account/isUnexpected.d.ts +16 -0
- package/dist/commonjs/account/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/account/isUnexpected.js +85 -0
- package/dist/commonjs/account/isUnexpected.js.map +1 -0
- package/dist/commonjs/account/models.d.ts +130 -0
- package/dist/commonjs/account/models.d.ts.map +1 -0
- package/dist/commonjs/account/models.js +5 -0
- package/dist/commonjs/account/models.js.map +1 -0
- package/dist/commonjs/account/outputModels.d.ts +337 -0
- package/dist/commonjs/account/outputModels.d.ts.map +1 -0
- package/dist/commonjs/account/outputModels.js +5 -0
- package/dist/commonjs/account/outputModels.js.map +1 -0
- package/dist/commonjs/account/paginateHelper.d.ts +68 -0
- package/dist/commonjs/account/paginateHelper.d.ts.map +1 -0
- package/dist/commonjs/account/paginateHelper.js +140 -0
- package/dist/commonjs/account/paginateHelper.js.map +1 -0
- package/dist/commonjs/account/parameters.d.ts +63 -0
- package/dist/commonjs/account/parameters.d.ts.map +1 -0
- package/dist/commonjs/account/parameters.js +5 -0
- package/dist/commonjs/account/parameters.js.map +1 -0
- package/dist/commonjs/account/purviewAccount.d.ts +16 -0
- package/dist/commonjs/account/purviewAccount.d.ts.map +1 -0
- package/dist/commonjs/account/purviewAccount.js +48 -0
- package/dist/commonjs/account/purviewAccount.js.map +1 -0
- package/dist/commonjs/account/responses.d.ts +145 -0
- package/dist/commonjs/account/responses.d.ts.map +1 -0
- package/dist/commonjs/account/responses.js +5 -0
- package/dist/commonjs/account/responses.js.map +1 -0
- package/dist/commonjs/index.d.ts +4 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +11 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.d.ts.map +1 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/metadataPolicies/clientDefinitions.d.ts +29 -0
- package/dist/commonjs/metadataPolicies/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/metadataPolicies/clientDefinitions.js +5 -0
- package/dist/commonjs/metadataPolicies/clientDefinitions.js.map +1 -0
- package/dist/commonjs/metadataPolicies/index.d.ts +10 -0
- package/dist/commonjs/metadataPolicies/index.d.ts.map +1 -0
- package/dist/commonjs/metadataPolicies/index.js +23 -0
- package/dist/commonjs/metadataPolicies/index.js.map +1 -0
- package/dist/commonjs/metadataPolicies/isUnexpected.d.ts +6 -0
- package/dist/commonjs/metadataPolicies/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/metadataPolicies/isUnexpected.js +75 -0
- package/dist/commonjs/metadataPolicies/isUnexpected.js.map +1 -0
- package/dist/commonjs/metadataPolicies/models.d.ts +58 -0
- package/dist/commonjs/metadataPolicies/models.d.ts.map +1 -0
- package/dist/commonjs/metadataPolicies/models.js +5 -0
- package/dist/commonjs/metadataPolicies/models.js.map +1 -0
- package/dist/commonjs/metadataPolicies/outputModels.d.ts +113 -0
- package/dist/commonjs/metadataPolicies/outputModels.d.ts.map +1 -0
- package/dist/commonjs/metadataPolicies/outputModels.js +5 -0
- package/dist/commonjs/metadataPolicies/outputModels.js.map +1 -0
- package/dist/commonjs/metadataPolicies/paginateHelper.d.ts +72 -0
- package/dist/commonjs/metadataPolicies/paginateHelper.d.ts.map +1 -0
- package/dist/commonjs/metadataPolicies/paginateHelper.js +173 -0
- package/dist/commonjs/metadataPolicies/paginateHelper.js.map +1 -0
- package/dist/commonjs/metadataPolicies/parameters.d.ts +22 -0
- package/dist/commonjs/metadataPolicies/parameters.d.ts.map +1 -0
- package/dist/commonjs/metadataPolicies/parameters.js +5 -0
- package/dist/commonjs/metadataPolicies/parameters.js.map +1 -0
- package/dist/commonjs/metadataPolicies/purviewMetadataPolicies.d.ts +16 -0
- package/dist/commonjs/metadataPolicies/purviewMetadataPolicies.d.ts.map +1 -0
- package/dist/commonjs/metadataPolicies/purviewMetadataPolicies.js +48 -0
- package/dist/commonjs/metadataPolicies/purviewMetadataPolicies.js.map +1 -0
- package/dist/commonjs/metadataPolicies/responses.d.ts +64 -0
- package/dist/commonjs/metadataPolicies/responses.d.ts.map +1 -0
- package/dist/commonjs/metadataPolicies/responses.js +5 -0
- package/dist/commonjs/metadataPolicies/responses.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/account/clientDefinitions.d.ts +73 -0
- package/dist/esm/account/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/account/clientDefinitions.js +4 -0
- package/dist/esm/account/clientDefinitions.js.map +1 -0
- package/dist/esm/account/index.d.ts +10 -0
- package/dist/esm/account/index.d.ts.map +1 -0
- package/dist/esm/account/index.js +12 -0
- package/dist/esm/account/index.js.map +1 -0
- package/dist/esm/account/isUnexpected.d.ts +16 -0
- package/dist/esm/account/isUnexpected.d.ts.map +1 -0
- package/dist/esm/account/isUnexpected.js +82 -0
- package/dist/esm/account/isUnexpected.js.map +1 -0
- package/dist/esm/account/models.d.ts +130 -0
- package/dist/esm/account/models.d.ts.map +1 -0
- package/dist/esm/account/models.js +4 -0
- package/dist/esm/account/models.js.map +1 -0
- package/dist/esm/account/outputModels.d.ts +337 -0
- package/dist/esm/account/outputModels.d.ts.map +1 -0
- package/dist/esm/account/outputModels.js +4 -0
- package/dist/esm/account/outputModels.js.map +1 -0
- package/dist/esm/account/paginateHelper.d.ts +68 -0
- package/dist/esm/account/paginateHelper.d.ts.map +1 -0
- package/dist/esm/account/paginateHelper.js +137 -0
- package/dist/esm/account/paginateHelper.js.map +1 -0
- package/dist/esm/account/parameters.d.ts +63 -0
- package/dist/esm/account/parameters.d.ts.map +1 -0
- package/dist/esm/account/parameters.js +4 -0
- package/dist/esm/account/parameters.js.map +1 -0
- package/dist/esm/account/purviewAccount.d.ts +16 -0
- package/dist/esm/account/purviewAccount.d.ts.map +1 -0
- package/dist/esm/account/purviewAccount.js +45 -0
- package/dist/esm/account/purviewAccount.js.map +1 -0
- package/dist/esm/account/responses.d.ts +145 -0
- package/dist/esm/account/responses.d.ts.map +1 -0
- package/dist/esm/account/responses.js +4 -0
- package/dist/esm/account/responses.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/metadataPolicies/clientDefinitions.d.ts +29 -0
- package/dist/esm/metadataPolicies/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/metadataPolicies/clientDefinitions.js +4 -0
- package/dist/esm/metadataPolicies/clientDefinitions.js.map +1 -0
- package/dist/esm/metadataPolicies/index.d.ts +10 -0
- package/dist/esm/metadataPolicies/index.d.ts.map +1 -0
- package/dist/esm/metadataPolicies/index.js +12 -0
- package/dist/esm/metadataPolicies/index.js.map +1 -0
- package/dist/esm/metadataPolicies/isUnexpected.d.ts +6 -0
- package/dist/esm/metadataPolicies/isUnexpected.d.ts.map +1 -0
- package/dist/esm/metadataPolicies/isUnexpected.js +72 -0
- package/dist/esm/metadataPolicies/isUnexpected.js.map +1 -0
- package/dist/esm/metadataPolicies/models.d.ts +58 -0
- package/dist/esm/metadataPolicies/models.d.ts.map +1 -0
- package/dist/esm/metadataPolicies/models.js +4 -0
- package/dist/esm/metadataPolicies/models.js.map +1 -0
- package/dist/esm/metadataPolicies/outputModels.d.ts +113 -0
- package/dist/esm/metadataPolicies/outputModels.d.ts.map +1 -0
- package/dist/esm/metadataPolicies/outputModels.js +4 -0
- package/dist/esm/metadataPolicies/outputModels.js.map +1 -0
- package/dist/esm/metadataPolicies/paginateHelper.d.ts +72 -0
- package/dist/esm/metadataPolicies/paginateHelper.d.ts.map +1 -0
- package/dist/esm/metadataPolicies/paginateHelper.js +170 -0
- package/dist/esm/metadataPolicies/paginateHelper.js.map +1 -0
- package/dist/esm/metadataPolicies/parameters.d.ts +22 -0
- package/dist/esm/metadataPolicies/parameters.d.ts.map +1 -0
- package/dist/esm/metadataPolicies/parameters.js +4 -0
- package/dist/esm/metadataPolicies/parameters.js.map +1 -0
- package/dist/esm/metadataPolicies/purviewMetadataPolicies.d.ts +16 -0
- package/dist/esm/metadataPolicies/purviewMetadataPolicies.d.ts.map +1 -0
- package/dist/esm/metadataPolicies/purviewMetadataPolicies.js +45 -0
- package/dist/esm/metadataPolicies/purviewMetadataPolicies.js.map +1 -0
- package/dist/esm/metadataPolicies/responses.d.ts +64 -0
- package/dist/esm/metadataPolicies/responses.d.ts.map +1 -0
- package/dist/esm/metadataPolicies/responses.js +4 -0
- package/dist/esm/metadataPolicies/responses.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/react-native/account/clientDefinitions.d.ts +73 -0
- package/dist/react-native/account/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/account/clientDefinitions.js +4 -0
- package/dist/react-native/account/clientDefinitions.js.map +1 -0
- package/dist/react-native/account/index.d.ts +10 -0
- package/dist/react-native/account/index.d.ts.map +1 -0
- package/dist/react-native/account/index.js +12 -0
- package/dist/react-native/account/index.js.map +1 -0
- package/dist/react-native/account/isUnexpected.d.ts +16 -0
- package/dist/react-native/account/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/account/isUnexpected.js +82 -0
- package/dist/react-native/account/isUnexpected.js.map +1 -0
- package/dist/react-native/account/models.d.ts +130 -0
- package/dist/react-native/account/models.d.ts.map +1 -0
- package/dist/react-native/account/models.js +4 -0
- package/dist/react-native/account/models.js.map +1 -0
- package/dist/react-native/account/outputModels.d.ts +337 -0
- package/dist/react-native/account/outputModels.d.ts.map +1 -0
- package/dist/react-native/account/outputModels.js +4 -0
- package/dist/react-native/account/outputModels.js.map +1 -0
- package/dist/react-native/account/paginateHelper.d.ts +68 -0
- package/dist/react-native/account/paginateHelper.d.ts.map +1 -0
- package/dist/react-native/account/paginateHelper.js +137 -0
- package/dist/react-native/account/paginateHelper.js.map +1 -0
- package/dist/react-native/account/parameters.d.ts +63 -0
- package/dist/react-native/account/parameters.d.ts.map +1 -0
- package/dist/react-native/account/parameters.js +4 -0
- package/dist/react-native/account/parameters.js.map +1 -0
- package/dist/react-native/account/purviewAccount.d.ts +16 -0
- package/dist/react-native/account/purviewAccount.d.ts.map +1 -0
- package/dist/react-native/account/purviewAccount.js +45 -0
- package/dist/react-native/account/purviewAccount.js.map +1 -0
- package/dist/react-native/account/responses.d.ts +145 -0
- package/dist/react-native/account/responses.d.ts.map +1 -0
- package/dist/react-native/account/responses.js +4 -0
- package/dist/react-native/account/responses.js.map +1 -0
- package/dist/react-native/index.d.ts +4 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +6 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.d.ts.map +1 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/metadataPolicies/clientDefinitions.d.ts +29 -0
- package/dist/react-native/metadataPolicies/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/metadataPolicies/clientDefinitions.js +4 -0
- package/dist/react-native/metadataPolicies/clientDefinitions.js.map +1 -0
- package/dist/react-native/metadataPolicies/index.d.ts +10 -0
- package/dist/react-native/metadataPolicies/index.d.ts.map +1 -0
- package/dist/react-native/metadataPolicies/index.js +12 -0
- package/dist/react-native/metadataPolicies/index.js.map +1 -0
- package/dist/react-native/metadataPolicies/isUnexpected.d.ts +6 -0
- package/dist/react-native/metadataPolicies/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/metadataPolicies/isUnexpected.js +72 -0
- package/dist/react-native/metadataPolicies/isUnexpected.js.map +1 -0
- package/dist/react-native/metadataPolicies/models.d.ts +58 -0
- package/dist/react-native/metadataPolicies/models.d.ts.map +1 -0
- package/dist/react-native/metadataPolicies/models.js +4 -0
- package/dist/react-native/metadataPolicies/models.js.map +1 -0
- package/dist/react-native/metadataPolicies/outputModels.d.ts +113 -0
- package/dist/react-native/metadataPolicies/outputModels.d.ts.map +1 -0
- package/dist/react-native/metadataPolicies/outputModels.js +4 -0
- package/dist/react-native/metadataPolicies/outputModels.js.map +1 -0
- package/dist/react-native/metadataPolicies/paginateHelper.d.ts +72 -0
- package/dist/react-native/metadataPolicies/paginateHelper.d.ts.map +1 -0
- package/dist/react-native/metadataPolicies/paginateHelper.js +170 -0
- package/dist/react-native/metadataPolicies/paginateHelper.js.map +1 -0
- package/dist/react-native/metadataPolicies/parameters.d.ts +22 -0
- package/dist/react-native/metadataPolicies/parameters.d.ts.map +1 -0
- package/dist/react-native/metadataPolicies/parameters.js +4 -0
- package/dist/react-native/metadataPolicies/parameters.js.map +1 -0
- package/dist/react-native/metadataPolicies/purviewMetadataPolicies.d.ts +16 -0
- package/dist/react-native/metadataPolicies/purviewMetadataPolicies.d.ts.map +1 -0
- package/dist/react-native/metadataPolicies/purviewMetadataPolicies.js +45 -0
- package/dist/react-native/metadataPolicies/purviewMetadataPolicies.js.map +1 -0
- package/dist/react-native/metadataPolicies/responses.d.ts +64 -0
- package/dist/react-native/metadataPolicies/responses.d.ts.map +1 -0
- package/dist/react-native/metadataPolicies/responses.js +4 -0
- package/dist/react-native/metadataPolicies/responses.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/package.json +89 -83
- package/review/purview-administration-node.api.md +1722 -0
- package/dist/index.js +0 -283
- package/dist/index.js.map +0 -1
- package/dist-esm/src/account/clientDefinitions.js +0 -4
- package/dist-esm/src/account/clientDefinitions.js.map +0 -1
- package/dist-esm/src/account/index.js +0 -10
- package/dist-esm/src/account/index.js.map +0 -1
- package/dist-esm/src/account/models.js +0 -4
- package/dist-esm/src/account/models.js.map +0 -1
- package/dist-esm/src/account/paginateHelper.js.map +0 -1
- package/dist-esm/src/account/parameters.js +0 -4
- package/dist-esm/src/account/parameters.js.map +0 -1
- package/dist-esm/src/account/purviewAccount.js +0 -13
- package/dist-esm/src/account/purviewAccount.js.map +0 -1
- package/dist-esm/src/account/responses.js +0 -4
- package/dist-esm/src/account/responses.js.map +0 -1
- package/dist-esm/src/index.js +0 -9
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/metadataPolicies/clientDefinitions.js +0 -4
- package/dist-esm/src/metadataPolicies/clientDefinitions.js.map +0 -1
- package/dist-esm/src/metadataPolicies/index.js +0 -10
- package/dist-esm/src/metadataPolicies/index.js.map +0 -1
- package/dist-esm/src/metadataPolicies/models.js +0 -4
- package/dist-esm/src/metadataPolicies/models.js.map +0 -1
- package/dist-esm/src/metadataPolicies/paginateHelper.js.map +0 -1
- package/dist-esm/src/metadataPolicies/parameters.js +0 -4
- package/dist-esm/src/metadataPolicies/parameters.js.map +0 -1
- package/dist-esm/src/metadataPolicies/purviewMetadataPolicies.js +0 -13
- package/dist-esm/src/metadataPolicies/purviewMetadataPolicies.js.map +0 -1
- package/dist-esm/src/metadataPolicies/responses.js +0 -4
- package/dist-esm/src/metadataPolicies/responses.js.map +0 -1
- package/types/purview-administration-rest.d.ts +0 -1248
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Attribute matcher for a rule */
|
|
2
|
+
export interface AttributeMatcher {
|
|
3
|
+
/** AttributeName */
|
|
4
|
+
attributeName?: string;
|
|
5
|
+
/** Value for attribute */
|
|
6
|
+
attributeValueIncludes?: string;
|
|
7
|
+
/** List of values for attribute */
|
|
8
|
+
attributeValueIncludedIn?: Array<string>;
|
|
9
|
+
/** Value excluded for attribute */
|
|
10
|
+
attributeValueExcludes?: string;
|
|
11
|
+
/** List of values excluded for attribute */
|
|
12
|
+
attributeValueExcludedIn?: Array<string>;
|
|
13
|
+
}
|
|
14
|
+
export interface MetadataPolicy {
|
|
15
|
+
/** The name of policy */
|
|
16
|
+
name?: string;
|
|
17
|
+
/** The id of policy */
|
|
18
|
+
id?: string;
|
|
19
|
+
/** The version of policy */
|
|
20
|
+
version?: number;
|
|
21
|
+
properties?: MetadataPolicyProperties;
|
|
22
|
+
}
|
|
23
|
+
export interface MetadataPolicyProperties {
|
|
24
|
+
/** The description of policy */
|
|
25
|
+
description?: string;
|
|
26
|
+
/** The DecisionRules of policy */
|
|
27
|
+
decisionRules?: Array<DecisionRule>;
|
|
28
|
+
/** The AttributeRules of policy */
|
|
29
|
+
attributeRules?: Array<AttributeRule>;
|
|
30
|
+
/** The collection reference for a policy */
|
|
31
|
+
collection?: CollectionReference;
|
|
32
|
+
/** The parent collection of the policy */
|
|
33
|
+
parentCollectionName?: string;
|
|
34
|
+
}
|
|
35
|
+
/** The decision rule for a policy */
|
|
36
|
+
export interface DecisionRule {
|
|
37
|
+
/** The effect for rule */
|
|
38
|
+
effect?: "Deny" | "Permit";
|
|
39
|
+
/** The dnf Condition for a rule */
|
|
40
|
+
dnfCondition?: Array<Array<AttributeMatcher>>;
|
|
41
|
+
}
|
|
42
|
+
/** The attribute rule for a policy */
|
|
43
|
+
export interface AttributeRule {
|
|
44
|
+
/** The id for rule */
|
|
45
|
+
id?: string;
|
|
46
|
+
/** The name for rule */
|
|
47
|
+
name?: string;
|
|
48
|
+
/** The dnf Condition for a rule */
|
|
49
|
+
dnfCondition?: Array<Array<AttributeMatcher>>;
|
|
50
|
+
}
|
|
51
|
+
/** The collection reference for a policy */
|
|
52
|
+
export interface CollectionReference {
|
|
53
|
+
/** The type of reference */
|
|
54
|
+
type?: string;
|
|
55
|
+
/** The name of reference */
|
|
56
|
+
referenceName?: string;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/metadataPolicies/models.ts"],"names":[],"mappings":"AAGA,mCAAmC;AACnC,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0BAA0B;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mCAAmC;IACnC,wBAAwB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzC,mCAAmC;IACnC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,4CAA4C;IAC5C,wBAAwB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,cAAc;IAC7B,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,wBAAwB,CAAC;CACvC;AAED,MAAM,WAAW,wBAAwB;IACvC,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,aAAa,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IACpC,mCAAmC;IACnC,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IACtC,4CAA4C;IAC5C,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,0CAA0C;IAC1C,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,qCAAqC;AACrC,MAAM,WAAW,YAAY;IAC3B,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC3B,mCAAmC;IACnC,YAAY,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;CAC/C;AAED,sCAAsC;AACtC,MAAM,WAAW,aAAa;IAC5B,sBAAsB;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,YAAY,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;CAC/C;AAED,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/metadataPolicies/models.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** Attribute matcher for a rule */\nexport interface AttributeMatcher {\n /** AttributeName */\n attributeName?: string;\n /** Value for attribute */\n attributeValueIncludes?: string;\n /** List of values for attribute */\n attributeValueIncludedIn?: Array<string>;\n /** Value excluded for attribute */\n attributeValueExcludes?: string;\n /** List of values excluded for attribute */\n attributeValueExcludedIn?: Array<string>;\n}\n\nexport interface MetadataPolicy {\n /** The name of policy */\n name?: string;\n /** The id of policy */\n id?: string;\n /** The version of policy */\n version?: number;\n properties?: MetadataPolicyProperties;\n}\n\nexport interface MetadataPolicyProperties {\n /** The description of policy */\n description?: string;\n /** The DecisionRules of policy */\n decisionRules?: Array<DecisionRule>;\n /** The AttributeRules of policy */\n attributeRules?: Array<AttributeRule>;\n /** The collection reference for a policy */\n collection?: CollectionReference;\n /** The parent collection of the policy */\n parentCollectionName?: string;\n}\n\n/** The decision rule for a policy */\nexport interface DecisionRule {\n /** The effect for rule */\n effect?: \"Deny\" | \"Permit\";\n /** The dnf Condition for a rule */\n dnfCondition?: Array<Array<AttributeMatcher>>;\n}\n\n/** The attribute rule for a policy */\nexport interface AttributeRule {\n /** The id for rule */\n id?: string;\n /** The name for rule */\n name?: string;\n /** The dnf Condition for a rule */\n dnfCondition?: Array<Array<AttributeMatcher>>;\n}\n\n/** The collection reference for a policy */\nexport interface CollectionReference {\n /** The type of reference */\n type?: string;\n /** The name of reference */\n referenceName?: string;\n}\n"]}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/** List of Metadata roles */
|
|
2
|
+
export interface MetadataRoleListOutput {
|
|
3
|
+
values: Array<MetadataRoleOutput>;
|
|
4
|
+
nextLink?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface MetadataRoleOutput {
|
|
7
|
+
/** The Id of role */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** The name of role */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** The type of role */
|
|
12
|
+
type?: string;
|
|
13
|
+
properties?: MetadataRolePropertiesOutput;
|
|
14
|
+
}
|
|
15
|
+
export interface MetadataRolePropertiesOutput {
|
|
16
|
+
/** The provisioningState of role */
|
|
17
|
+
provisioningState?: string;
|
|
18
|
+
/** The type of role */
|
|
19
|
+
roleType?: string;
|
|
20
|
+
/** The friendly name of role */
|
|
21
|
+
friendlyName?: string;
|
|
22
|
+
/** The description of role */
|
|
23
|
+
description?: string;
|
|
24
|
+
/** The cnf Condition for a rule */
|
|
25
|
+
cnfCondition?: Array<Array<AttributeMatcherOutput>>;
|
|
26
|
+
/** The dnf Condition for a rule */
|
|
27
|
+
dnfCondition?: Array<Array<AttributeMatcherOutput>>;
|
|
28
|
+
/** The version of role */
|
|
29
|
+
version?: number;
|
|
30
|
+
}
|
|
31
|
+
/** Attribute matcher for a rule */
|
|
32
|
+
export interface AttributeMatcherOutput {
|
|
33
|
+
/** AttributeName */
|
|
34
|
+
attributeName?: string;
|
|
35
|
+
/** Value for attribute */
|
|
36
|
+
attributeValueIncludes?: string;
|
|
37
|
+
/** List of values for attribute */
|
|
38
|
+
attributeValueIncludedIn?: Array<string>;
|
|
39
|
+
/** Value excluded for attribute */
|
|
40
|
+
attributeValueExcludes?: string;
|
|
41
|
+
/** List of values excluded for attribute */
|
|
42
|
+
attributeValueExcludedIn?: Array<string>;
|
|
43
|
+
}
|
|
44
|
+
/** The error response model for metadata policy */
|
|
45
|
+
export interface ErrorResponseModelOutput {
|
|
46
|
+
/** The error model for metadata policy */
|
|
47
|
+
error: ErrorModelOutput;
|
|
48
|
+
}
|
|
49
|
+
/** The error model for metadata policy */
|
|
50
|
+
export interface ErrorModelOutput {
|
|
51
|
+
/** The error code */
|
|
52
|
+
code: string;
|
|
53
|
+
/** The error message */
|
|
54
|
+
message: string;
|
|
55
|
+
/** The error target */
|
|
56
|
+
target?: string;
|
|
57
|
+
/** The error details */
|
|
58
|
+
details?: Array<ErrorModelOutput>;
|
|
59
|
+
}
|
|
60
|
+
/** List of Metadata Policies */
|
|
61
|
+
export interface MetadataPolicyListOutput {
|
|
62
|
+
values: Array<MetadataPolicyOutput>;
|
|
63
|
+
nextLink?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface MetadataPolicyOutput {
|
|
66
|
+
/** The name of policy */
|
|
67
|
+
name?: string;
|
|
68
|
+
/** The id of policy */
|
|
69
|
+
id?: string;
|
|
70
|
+
/** The version of policy */
|
|
71
|
+
version?: number;
|
|
72
|
+
properties?: MetadataPolicyPropertiesOutput;
|
|
73
|
+
}
|
|
74
|
+
export interface MetadataPolicyPropertiesOutput {
|
|
75
|
+
/** The description of policy */
|
|
76
|
+
description?: string;
|
|
77
|
+
/** The DecisionRules of policy */
|
|
78
|
+
decisionRules?: Array<DecisionRuleOutput>;
|
|
79
|
+
/** The AttributeRules of policy */
|
|
80
|
+
attributeRules?: Array<AttributeRuleOutput>;
|
|
81
|
+
/** The collection reference for a policy */
|
|
82
|
+
collection?: CollectionReferenceOutput;
|
|
83
|
+
/** The parent collection of the policy */
|
|
84
|
+
parentCollectionName?: string;
|
|
85
|
+
}
|
|
86
|
+
/** The decision rule for a policy */
|
|
87
|
+
export interface DecisionRuleOutput {
|
|
88
|
+
/** The kind of rule */
|
|
89
|
+
readonly kind?: "decisionrule" | "attributerule";
|
|
90
|
+
/** The effect for rule */
|
|
91
|
+
effect?: "Deny" | "Permit";
|
|
92
|
+
/** The dnf Condition for a rule */
|
|
93
|
+
dnfCondition?: Array<Array<AttributeMatcherOutput>>;
|
|
94
|
+
}
|
|
95
|
+
/** The attribute rule for a policy */
|
|
96
|
+
export interface AttributeRuleOutput {
|
|
97
|
+
/** The kind of rule */
|
|
98
|
+
readonly kind?: "decisionrule" | "attributerule";
|
|
99
|
+
/** The id for rule */
|
|
100
|
+
id?: string;
|
|
101
|
+
/** The name for rule */
|
|
102
|
+
name?: string;
|
|
103
|
+
/** The dnf Condition for a rule */
|
|
104
|
+
dnfCondition?: Array<Array<AttributeMatcherOutput>>;
|
|
105
|
+
}
|
|
106
|
+
/** The collection reference for a policy */
|
|
107
|
+
export interface CollectionReferenceOutput {
|
|
108
|
+
/** The type of reference */
|
|
109
|
+
type?: string;
|
|
110
|
+
/** The name of reference */
|
|
111
|
+
referenceName?: string;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=outputModels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputModels.d.ts","sourceRoot":"","sources":["../../../src/metadataPolicies/outputModels.ts"],"names":[],"m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AC,sBAAsB,CAAC,CAAC,CAAC;CACrD;AAED,sCAAsC;AACtC,MAAM,WAAW,mBAAmB;IAClC,uBAAuB;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,eAAe,CAAC;IACjD,sBAAsB;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,YAAY,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;CACrD;AAED,4CAA4C;AAC5C,MAAM,WAAW,yBAAyB;IACxC,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../../src/metadataPolicies/outputModels.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** List of Metadata roles */\nexport interface MetadataRoleListOutput {\n values: Array<MetadataRoleOutput>;\n nextLink?: string;\n}\n\nexport interface MetadataRoleOutput {\n /** The Id of role */\n id?: string;\n /** The name of role */\n name?: string;\n /** The type of role */\n type?: string;\n properties?: MetadataRolePropertiesOutput;\n}\n\nexport interface MetadataRolePropertiesOutput {\n /** The provisioningState of role */\n provisioningState?: string;\n /** The type of role */\n roleType?: string;\n /** The friendly name of role */\n friendlyName?: string;\n /** The description of role */\n description?: string;\n /** The cnf Condition for a rule */\n cnfCondition?: Array<Array<AttributeMatcherOutput>>;\n /** The dnf Condition for a rule */\n dnfCondition?: Array<Array<AttributeMatcherOutput>>;\n /** The version of role */\n version?: number;\n}\n\n/** Attribute matcher for a rule */\nexport interface AttributeMatcherOutput {\n /** AttributeName */\n attributeName?: string;\n /** Value for attribute */\n attributeValueIncludes?: string;\n /** List of values for attribute */\n attributeValueIncludedIn?: Array<string>;\n /** Value excluded for attribute */\n attributeValueExcludes?: string;\n /** List of values excluded for attribute */\n attributeValueExcludedIn?: Array<string>;\n}\n\n/** The error response model for metadata policy */\nexport interface ErrorResponseModelOutput {\n /** The error model for metadata policy */\n error: ErrorModelOutput;\n}\n\n/** The error model for metadata policy */\nexport interface ErrorModelOutput {\n /** The error code */\n code: string;\n /** The error message */\n message: string;\n /** The error target */\n target?: string;\n /** The error details */\n details?: Array<ErrorModelOutput>;\n}\n\n/** List of Metadata Policies */\nexport interface MetadataPolicyListOutput {\n values: Array<MetadataPolicyOutput>;\n nextLink?: string;\n}\n\nexport interface MetadataPolicyOutput {\n /** The name of policy */\n name?: string;\n /** The id of policy */\n id?: string;\n /** The version of policy */\n version?: number;\n properties?: MetadataPolicyPropertiesOutput;\n}\n\nexport interface MetadataPolicyPropertiesOutput {\n /** The description of policy */\n description?: string;\n /** The DecisionRules of policy */\n decisionRules?: Array<DecisionRuleOutput>;\n /** The AttributeRules of policy */\n attributeRules?: Array<AttributeRuleOutput>;\n /** The collection reference for a policy */\n collection?: CollectionReferenceOutput;\n /** The parent collection of the policy */\n parentCollectionName?: string;\n}\n\n/** The decision rule for a policy */\nexport interface DecisionRuleOutput {\n /** The kind of rule */\n readonly kind?: \"decisionrule\" | \"attributerule\";\n /** The effect for rule */\n effect?: \"Deny\" | \"Permit\";\n /** The dnf Condition for a rule */\n dnfCondition?: Array<Array<AttributeMatcherOutput>>;\n}\n\n/** The attribute rule for a policy */\nexport interface AttributeRuleOutput {\n /** The kind of rule */\n readonly kind?: \"decisionrule\" | \"attributerule\";\n /** The id for rule */\n id?: string;\n /** The name for rule */\n name?: string;\n /** The dnf Condition for a rule */\n dnfCondition?: Array<Array<AttributeMatcherOutput>>;\n}\n\n/** The collection reference for a policy */\nexport interface CollectionReferenceOutput {\n /** The type of reference */\n type?: string;\n /** The name of reference */\n referenceName?: string;\n}\n"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Client, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
2
|
+
/**
|
|
3
|
+
* An interface that tracks the settings for paged iteration
|
|
4
|
+
*/
|
|
5
|
+
export interface PageSettings {
|
|
6
|
+
/**
|
|
7
|
+
* The token that keeps track of where to continue the iterator
|
|
8
|
+
*/
|
|
9
|
+
continuationToken?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* An interface that allows async iterable iteration both to completion and by page.
|
|
13
|
+
*/
|
|
14
|
+
export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings = PageSettings> {
|
|
15
|
+
/**
|
|
16
|
+
* The next method, part of the iteration protocol
|
|
17
|
+
*/
|
|
18
|
+
next(): Promise<IteratorResult<TElement>>;
|
|
19
|
+
/**
|
|
20
|
+
* The connection to the async iterator, part of the iteration protocol
|
|
21
|
+
*/
|
|
22
|
+
[Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
23
|
+
/**
|
|
24
|
+
* Return an AsyncIterableIterator that works a page at a time
|
|
25
|
+
*/
|
|
26
|
+
byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Helper type to extract the type of an array
|
|
30
|
+
*/
|
|
31
|
+
export type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
|
|
32
|
+
/**
|
|
33
|
+
* The type of a custom function that defines how to get a page and a link to the next one if any.
|
|
34
|
+
*/
|
|
35
|
+
export type GetPage<TPage> = (pageLink: string) => Promise<{
|
|
36
|
+
page: TPage;
|
|
37
|
+
nextPageLink?: string;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Options for the paging helper
|
|
41
|
+
*/
|
|
42
|
+
export interface PagingOptions<TResponse> {
|
|
43
|
+
/**
|
|
44
|
+
* Custom function to extract pagination details for crating the PagedAsyncIterableIterator
|
|
45
|
+
*/
|
|
46
|
+
customGetPage?: GetPage<PaginateReturn<TResponse>[]>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Helper type to infer the Type of the paged elements from the response type
|
|
50
|
+
* This type is generated based on the swagger information for x-ms-pageable
|
|
51
|
+
* specifically on the itemName property which indicates the property of the response
|
|
52
|
+
* where the page items are found. The default value is `value`.
|
|
53
|
+
* This type will allow us to provide strongly typed Iterator based on the response we get as second parameter
|
|
54
|
+
*/
|
|
55
|
+
export type PaginateReturn<TResult> = TResult extends {
|
|
56
|
+
body: {
|
|
57
|
+
value?: infer TPage;
|
|
58
|
+
};
|
|
59
|
+
} | {
|
|
60
|
+
body: {
|
|
61
|
+
values?: infer TPage;
|
|
62
|
+
};
|
|
63
|
+
} ? GetArrayType<TPage> : Array<unknown>;
|
|
64
|
+
/**
|
|
65
|
+
* Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
|
|
66
|
+
* @param client - Client to use for sending the next page requests
|
|
67
|
+
* @param initialResponse - Initial response containing the nextLink and current page of elements
|
|
68
|
+
* @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
|
|
69
|
+
* @returns - PagedAsyncIterableIterator to iterate the elements
|
|
70
|
+
*/
|
|
71
|
+
export declare function paginate<TResponse extends PathUncheckedResponse>(client: Client, initialResponse: TResponse, options?: PagingOptions<TResponse>): PagedAsyncIterableIterator<PaginateReturn<TResponse>>;
|
|
72
|
+
//# sourceMappingURL=paginateHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginateHelper.d.ts","sourceRoot":"","sources":["../../../src/metadataPolicies/paginateHelper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAuF7E;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B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EAC1B,OAAO,GAAE,aAAa,CAAC,SAAS,CAAM,GACrC,0BAA0B,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CA4BvD"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.paginate = paginate;
|
|
6
|
+
const core_client_1 = require("@azure-rest/core-client");
|
|
7
|
+
/**
|
|
8
|
+
* returns an async iterator that iterates over results. It also has a `byPage`
|
|
9
|
+
* method that returns pages of items at once.
|
|
10
|
+
*
|
|
11
|
+
* @param pagedResult - an object that specifies how to get pages.
|
|
12
|
+
* @returns a paged async iterator that iterates over results.
|
|
13
|
+
*/
|
|
14
|
+
function getPagedAsyncIterator(pagedResult) {
|
|
15
|
+
const iter = getItemAsyncIterator(pagedResult);
|
|
16
|
+
return {
|
|
17
|
+
next() {
|
|
18
|
+
return iter.next();
|
|
19
|
+
},
|
|
20
|
+
[Symbol.asyncIterator]() {
|
|
21
|
+
return this;
|
|
22
|
+
},
|
|
23
|
+
byPage: pagedResult?.byPage ??
|
|
24
|
+
((settings) => {
|
|
25
|
+
const { continuationToken } = settings ?? {};
|
|
26
|
+
return getPageAsyncIterator(pagedResult, {
|
|
27
|
+
pageLink: continuationToken,
|
|
28
|
+
});
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
async function* getItemAsyncIterator(pagedResult) {
|
|
33
|
+
const pages = getPageAsyncIterator(pagedResult);
|
|
34
|
+
const firstVal = await pages.next();
|
|
35
|
+
// if the result does not have an array shape, i.e. TPage = TElement, then we return it as is
|
|
36
|
+
if (!Array.isArray(firstVal.value)) {
|
|
37
|
+
// can extract elements from this page
|
|
38
|
+
const { toElements } = pagedResult;
|
|
39
|
+
if (toElements) {
|
|
40
|
+
yield* toElements(firstVal.value);
|
|
41
|
+
for await (const page of pages) {
|
|
42
|
+
yield* toElements(page);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
yield firstVal.value;
|
|
47
|
+
// `pages` is of type `AsyncIterableIterator<TPage>` but TPage = TElement in this case
|
|
48
|
+
yield* pages;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
yield* firstVal.value;
|
|
53
|
+
for await (const page of pages) {
|
|
54
|
+
// pages is of type `AsyncIterableIterator<TPage>` so `page` is of type `TPage`. In this branch,
|
|
55
|
+
// it must be the case that `TPage = TElement[]`
|
|
56
|
+
yield* page;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async function* getPageAsyncIterator(pagedResult, options = {}) {
|
|
61
|
+
const { pageLink } = options;
|
|
62
|
+
let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);
|
|
63
|
+
if (!response) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
yield response.page;
|
|
67
|
+
while (response.nextPageLink) {
|
|
68
|
+
response = await pagedResult.getPage(response.nextPageLink);
|
|
69
|
+
if (!response) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
yield response.page;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
|
|
77
|
+
* @param client - Client to use for sending the next page requests
|
|
78
|
+
* @param initialResponse - Initial response containing the nextLink and current page of elements
|
|
79
|
+
* @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
|
|
80
|
+
* @returns - PagedAsyncIterableIterator to iterate the elements
|
|
81
|
+
*/
|
|
82
|
+
function paginate(client, initialResponse, options = {}) {
|
|
83
|
+
let firstRun = true;
|
|
84
|
+
// We need to check the response for success before trying to inspect it looking for
|
|
85
|
+
// the properties to use for nextLink and itemName
|
|
86
|
+
checkPagingRequest(initialResponse);
|
|
87
|
+
const { itemName, nextLinkName } = getPaginationProperties(initialResponse);
|
|
88
|
+
const { customGetPage } = options;
|
|
89
|
+
const pagedResult = {
|
|
90
|
+
firstPageLink: "",
|
|
91
|
+
getPage: typeof customGetPage === "function"
|
|
92
|
+
? customGetPage
|
|
93
|
+
: async (pageLink) => {
|
|
94
|
+
const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();
|
|
95
|
+
firstRun = false;
|
|
96
|
+
checkPagingRequest(result);
|
|
97
|
+
const nextLink = getNextLink(result.body, nextLinkName);
|
|
98
|
+
const values = getElements(result.body, itemName);
|
|
99
|
+
return {
|
|
100
|
+
page: values,
|
|
101
|
+
nextPageLink: nextLink,
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
return getPagedAsyncIterator(pagedResult);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Gets for the value of nextLink in the body
|
|
109
|
+
*/
|
|
110
|
+
function getNextLink(body, nextLinkName) {
|
|
111
|
+
if (!nextLinkName) {
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
const nextLink = body[nextLinkName];
|
|
115
|
+
if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
|
|
116
|
+
throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);
|
|
117
|
+
}
|
|
118
|
+
return nextLink;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Gets the elements of the current request in the body.
|
|
122
|
+
*/
|
|
123
|
+
function getElements(body, itemName) {
|
|
124
|
+
const value = body[itemName];
|
|
125
|
+
// value has to be an array according to the x-ms-pageable extension.
|
|
126
|
+
// The fact that this must be an array is used above to calculate the
|
|
127
|
+
// type of elements in the page in PaginateReturn
|
|
128
|
+
if (!Array.isArray(value)) {
|
|
129
|
+
throw new Error(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
|
|
130
|
+
}
|
|
131
|
+
return value ?? [];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Checks if a request failed
|
|
135
|
+
*/
|
|
136
|
+
function checkPagingRequest(response) {
|
|
137
|
+
const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"];
|
|
138
|
+
if (!Http2xxStatusCodes.includes(response.status)) {
|
|
139
|
+
throw (0, core_client_1.createRestError)(`Pagination failed with unexpected statusCode ${response.status}`, response);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Extracts the itemName and nextLinkName from the initial response to use them for pagination
|
|
144
|
+
*/
|
|
145
|
+
function getPaginationProperties(initialResponse) {
|
|
146
|
+
// Build a set with the passed custom nextLinkNames
|
|
147
|
+
const nextLinkNames = new Set(["nextLink"]);
|
|
148
|
+
// Build a set with the passed custom set of itemNames
|
|
149
|
+
const itemNames = new Set(["value", "values"]);
|
|
150
|
+
let nextLinkName;
|
|
151
|
+
let itemName;
|
|
152
|
+
for (const name of nextLinkNames) {
|
|
153
|
+
const nextLink = initialResponse.body[name];
|
|
154
|
+
if (nextLink) {
|
|
155
|
+
nextLinkName = name;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
for (const name of itemNames) {
|
|
160
|
+
const item = initialResponse.body[name];
|
|
161
|
+
if (item) {
|
|
162
|
+
itemName = name;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (!itemName) {
|
|
167
|
+
throw new Error(`Couldn't paginate response\n Body doesn't contain an array property with name: ${[
|
|
168
|
+
...itemNames,
|
|
169
|
+
].join(" OR ")}`);
|
|
170
|
+
}
|
|
171
|
+
return { itemName, nextLinkName };
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=paginateHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../../src/metadataPolicies/paginateHelper.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA+L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CACb,kFAAkF;YAChF,GAAG,SAAS;SACb,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CACjB,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;AACpC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError } from \"@azure-rest/core-client\";\n\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings = PageSettings,\n TLink = string,\n>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, TLink, TPageSettings>(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage:\n pagedResult?.byPage ??\n (((settings?: PageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken as unknown as TLink | undefined,\n });\n }) as unknown as (settings?: TPageSettings) => AsyncIterableIterator<TPage>),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TLink, TPageSettings>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n const firstVal = await pages.next();\n // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is\n if (!Array.isArray(firstVal.value)) {\n // can extract elements from this page\n const { toElements } = pagedResult;\n if (toElements) {\n yield* toElements(firstVal.value) as TElement[];\n for await (const page of pages) {\n yield* toElements(page) as TElement[];\n }\n } else {\n yield firstVal.value;\n // `pages` is of type `AsyncIterableIterator<TPage>` but TPage = TElement in this case\n yield* pages as unknown as AsyncIterableIterator<TElement>;\n }\n } else {\n yield* firstVal.value;\n for await (const page of pages) {\n // pages is of type `AsyncIterableIterator<TPage>` so `page` is of type `TPage`. In this branch,\n // it must be the case that `TPage = TElement[]`\n yield* page as unknown as TElement[];\n }\n }\n}\n\nasync function* getPageAsyncIterator<TPage, TLink, TPageSettings>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n options: {\n pageLink?: TLink;\n } = {},\n): AsyncIterableIterator<TPage> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);\n if (!response) {\n return;\n }\n yield response.page;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n yield response.page;\n }\n}\n\n/**\n * An interface that tracks the settings for paged iteration\n */\nexport interface PageSettings {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings = PageSettings,\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\ninterface PagedResult<TPage, TPageSettings = PageSettings, TLink = string> {\n /**\n * Link to the first page of results.\n */\n firstPageLink: TLink;\n /**\n * A method that returns a page of results.\n */\n getPage: (pageLink: TLink) => Promise<{ page: TPage; nextPageLink?: TLink } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => unknown[];\n}\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (pageLink: string) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends\n | {\n body: { value?: infer TPage };\n }\n | {\n body: { values?: infer TPage };\n }\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {},\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n // We need to check the response for success before trying to inspect it looking for\n // the properties to use for nextLink and itemName\n checkPagingRequest(initialResponse);\n const { itemName, nextLinkName } = getPaginationProperties(initialResponse);\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n\n/**\n * Extracts the itemName and nextLinkName from the initial response to use them for pagination\n */\nfunction getPaginationProperties(initialResponse: PathUncheckedResponse): {\n itemName: string;\n nextLinkName: string | undefined;\n} {\n // Build a set with the passed custom nextLinkNames\n const nextLinkNames = new Set([\"nextLink\"]);\n\n // Build a set with the passed custom set of itemNames\n const itemNames = new Set([\"value\", \"values\"]);\n\n let nextLinkName: string | undefined;\n let itemName: string | undefined;\n\n for (const name of nextLinkNames) {\n const nextLink = (initialResponse.body as Record<string, unknown>)[name] as string;\n if (nextLink) {\n nextLinkName = name;\n break;\n }\n }\n\n for (const name of itemNames) {\n const item = (initialResponse.body as Record<string, unknown>)[name] as string;\n if (item) {\n itemName = name;\n break;\n }\n }\n\n if (!itemName) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${[\n ...itemNames,\n ].join(\" OR \")}`,\n );\n }\n\n return { itemName, nextLinkName };\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { RequestParameters } from "@azure-rest/core-client";
|
|
2
|
+
import type { MetadataPolicy } from "./models.js";
|
|
3
|
+
export type MetadataRolesListParameters = RequestParameters;
|
|
4
|
+
export interface MetadataPolicyListAllQueryParamProperties {
|
|
5
|
+
/** The name of an existing collection for which one policy needs to be fetched. */
|
|
6
|
+
collectionName?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface MetadataPolicyListAllQueryParam {
|
|
9
|
+
queryParameters?: MetadataPolicyListAllQueryParamProperties;
|
|
10
|
+
}
|
|
11
|
+
export type MetadataPolicyListAllParameters = MetadataPolicyListAllQueryParam & RequestParameters;
|
|
12
|
+
export interface MetadataPolicyUpdateBodyParam {
|
|
13
|
+
/** Policy to be updated. */
|
|
14
|
+
body?: MetadataPolicy;
|
|
15
|
+
}
|
|
16
|
+
export interface MetadataPolicyUpdateMediaTypesParam {
|
|
17
|
+
/** Request content type */
|
|
18
|
+
contentType?: "application/json";
|
|
19
|
+
}
|
|
20
|
+
export type MetadataPolicyUpdateParameters = MetadataPolicyUpdateMediaTypesParam & MetadataPolicyUpdateBodyParam & RequestParameters;
|
|
21
|
+
export type MetadataPolicyGetParameters = RequestParameters;
|
|
22
|
+
//# sourceMappingURL=parameters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/metadataPolicies/parameters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,CAAC;AAE5D,MAAM,WAAW,yCAAyC;IACxD,mFAAmF;IACnF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,+BAA+B;IAC9C,eAAe,CAAC,EAAE,yCAAyC,CAAC;CAC7D;AAED,MAAM,MAAM,+BAA+B,GAAG,+BAA+B,GAAG,iBAAiB,CAAC;AAElG,MAAM,WAAW,6BAA6B;IAC5C,4BAA4B;IAC5B,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED,MAAM,WAAW,mCAAmC;IAClD,2BAA2B;IAC3B,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC;AAED,MAAM,MAAM,8BAA8B,GAAG,mCAAmC,GAC9E,6BAA6B,GAC7B,iBAAiB,CAAC;AACpB,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../src/metadataPolicies/parameters.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RequestParameters } from \"@azure-rest/core-client\";\nimport type { MetadataPolicy } from \"./models.js\";\n\nexport type MetadataRolesListParameters = RequestParameters;\n\nexport interface MetadataPolicyListAllQueryParamProperties {\n /** The name of an existing collection for which one policy needs to be fetched. */\n collectionName?: string;\n}\n\nexport interface MetadataPolicyListAllQueryParam {\n queryParameters?: MetadataPolicyListAllQueryParamProperties;\n}\n\nexport type MetadataPolicyListAllParameters = MetadataPolicyListAllQueryParam & RequestParameters;\n\nexport interface MetadataPolicyUpdateBodyParam {\n /** Policy to be updated. */\n body?: MetadataPolicy;\n}\n\nexport interface MetadataPolicyUpdateMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type MetadataPolicyUpdateParameters = MetadataPolicyUpdateMediaTypesParam &\n MetadataPolicyUpdateBodyParam &\n RequestParameters;\nexport type MetadataPolicyGetParameters = RequestParameters;\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ClientOptions } from "@azure-rest/core-client";
|
|
2
|
+
import type { TokenCredential } from "@azure/core-auth";
|
|
3
|
+
import type { PurviewMetadataPoliciesClient } from "./clientDefinitions.js";
|
|
4
|
+
/** The optional parameters for the client */
|
|
5
|
+
export interface PurviewMetadataPoliciesClientOptions extends ClientOptions {
|
|
6
|
+
/** The api version option of the client */
|
|
7
|
+
apiVersion?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Initialize a new instance of `PurviewMetadataPoliciesClient`
|
|
11
|
+
* @param endpoint - The endpoint of your Purview account. Example: https://\{accountName\}.purview.azure.com.
|
|
12
|
+
* @param credentials - uniquely identify client credential
|
|
13
|
+
* @param options - the parameter for all optional parameters
|
|
14
|
+
*/
|
|
15
|
+
export declare function createClient(endpoint: string, credentials: TokenCredential, { apiVersion, ...options }?: PurviewMetadataPoliciesClientOptions): PurviewMetadataPoliciesClient;
|
|
16
|
+
//# sourceMappingURL=purviewMetadataPolicies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purviewMetadataPolicies.d.ts","sourceRoot":"","sources":["../../../src/metadataPolicies/purviewMetadataPolicies.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAE5E,6CAA6C;AAC7C,MAAM,WAAW,oCAAqC,SAAQ,aAAa;IACzE,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,eAAe,EAC5B,EAAE,UAAiC,EAAE,GAAG,OAAO,EAAE,GAAE,oCAAyC,GAC3F,6BAA6B,CAuC/B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.createClient = createClient;
|
|
6
|
+
const core_client_1 = require("@azure-rest/core-client");
|
|
7
|
+
const logger_js_1 = require("../logger.js");
|
|
8
|
+
/**
|
|
9
|
+
* Initialize a new instance of `PurviewMetadataPoliciesClient`
|
|
10
|
+
* @param endpoint - The endpoint of your Purview account. Example: https://\{accountName\}.purview.azure.com.
|
|
11
|
+
* @param credentials - uniquely identify client credential
|
|
12
|
+
* @param options - the parameter for all optional parameters
|
|
13
|
+
*/
|
|
14
|
+
function createClient(endpoint, credentials, { apiVersion = "2021-07-01-preview", ...options } = {}) {
|
|
15
|
+
const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpoint}/policyStore`;
|
|
16
|
+
const userAgentInfo = `azsdk-js-purview-administration-rest/1.0.0-beta.2`;
|
|
17
|
+
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
18
|
+
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
19
|
+
: `${userAgentInfo}`;
|
|
20
|
+
options = {
|
|
21
|
+
...options,
|
|
22
|
+
userAgentOptions: {
|
|
23
|
+
userAgentPrefix,
|
|
24
|
+
},
|
|
25
|
+
loggingOptions: {
|
|
26
|
+
logger: options.loggingOptions?.logger ?? logger_js_1.logger.info,
|
|
27
|
+
},
|
|
28
|
+
credentials: {
|
|
29
|
+
scopes: ["https://purview.azure.net/.default"],
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
const client = (0, core_client_1.getClient)(endpointUrl, credentials, options);
|
|
33
|
+
client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
|
|
34
|
+
client.pipeline.addPolicy({
|
|
35
|
+
name: "ClientApiVersionPolicy",
|
|
36
|
+
sendRequest: (req, next) => {
|
|
37
|
+
// Use the apiVersion defined in request url directly
|
|
38
|
+
// Append one if there is no apiVersion and we have one at client options
|
|
39
|
+
const url = new URL(req.url);
|
|
40
|
+
if (!url.searchParams.get("api-version") && apiVersion) {
|
|
41
|
+
req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
|
|
42
|
+
}
|
|
43
|
+
return next(req);
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
return client;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=purviewMetadataPolicies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purviewMetadataPolicies.js","sourceRoot":"","sources":["../../../src/metadataPolicies/purviewMetadataPolicies.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAoBlC,oCA2CC;AA5DD,yDAAoD;AACpD,4CAAsC;AAUtC;;;;;GAKG;AACH,SAAgB,YAAY,CAC1B,QAAgB,EAChB,WAA4B,EAC5B,EAAE,UAAU,GAAG,oBAAoB,EAAE,GAAG,OAAO,KAA2C,EAAE;IAE5F,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,GAAG,QAAQ,cAAc,CAAC;IACrF,MAAM,aAAa,GAAG,mDAAmD,CAAC;IAC1E,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,GAAG;QACR,GAAG,OAAO;QACV,gBAAgB,EAAE;YAChB,eAAe;SAChB;QACD,cAAc,EAAE;YACd,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,IAAI,kBAAM,CAAC,IAAI;SACtD;QACD,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,oCAAoC,CAAC;SAC/C;KACF,CAAC;IACF,MAAM,MAAM,GAAG,IAAA,uBAAS,EAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAkC,CAAC;IAE7F,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"../logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { PurviewMetadataPoliciesClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface PurviewMetadataPoliciesClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `PurviewMetadataPoliciesClient`\n * @param endpoint - The endpoint of your Purview account. Example: https://\\{accountName\\}.purview.azure.com.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport function createClient(\n endpoint: string,\n credentials: TokenCredential,\n { apiVersion = \"2021-07-01-preview\", ...options }: PurviewMetadataPoliciesClientOptions = {},\n): PurviewMetadataPoliciesClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpoint}/policyStore`;\n const userAgentInfo = `azsdk-js-purview-administration-rest/1.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: [\"https://purview.azure.net/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as PurviewMetadataPoliciesClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.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 if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
|