@azure/arm-trustedsigning 1.0.0-beta.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/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +100 -0
- package/dist/browser/api/certificateProfiles/index.d.ts +32 -0
- package/dist/browser/api/certificateProfiles/index.d.ts.map +1 -0
- package/dist/browser/api/certificateProfiles/index.js +331 -0
- package/dist/browser/api/certificateProfiles/index.js.map +1 -0
- package/dist/browser/api/codeSigningAccounts/index.d.ts +40 -0
- package/dist/browser/api/codeSigningAccounts/index.d.ts.map +1 -0
- package/dist/browser/api/codeSigningAccounts/index.js +325 -0
- package/dist/browser/api/codeSigningAccounts/index.js.map +1 -0
- package/dist/browser/api/codeSigningContext.d.ts +12 -0
- package/dist/browser/api/codeSigningContext.d.ts.map +1 -0
- package/dist/browser/api/codeSigningContext.js +32 -0
- package/dist/browser/api/codeSigningContext.js.map +1 -0
- package/dist/browser/api/index.d.ts +2 -0
- package/dist/browser/api/index.d.ts.map +1 -0
- package/dist/browser/api/index.js +4 -0
- package/dist/browser/api/index.js.map +1 -0
- package/dist/browser/api/operations/index.d.ts +10 -0
- package/dist/browser/api/operations/index.d.ts.map +1 -0
- package/dist/browser/api/operations/index.js +40 -0
- package/dist/browser/api/operations/index.js.map +1 -0
- package/dist/browser/classic/certificateProfiles/index.d.ts +32 -0
- package/dist/browser/classic/certificateProfiles/index.d.ts.map +1 -0
- package/dist/browser/classic/certificateProfiles/index.js +16 -0
- package/dist/browser/classic/certificateProfiles/index.js.map +1 -0
- package/dist/browser/classic/codeSigningAccounts/index.d.ts +38 -0
- package/dist/browser/classic/codeSigningAccounts/index.d.ts.map +1 -0
- package/dist/browser/classic/codeSigningAccounts/index.js +18 -0
- package/dist/browser/classic/codeSigningAccounts/index.js.map +1 -0
- package/dist/browser/classic/index.d.ts +4 -0
- package/dist/browser/classic/index.d.ts.map +1 -0
- package/dist/browser/classic/index.js +4 -0
- package/dist/browser/classic/index.js.map +1 -0
- package/dist/browser/classic/operations/index.d.ts +14 -0
- package/dist/browser/classic/operations/index.d.ts.map +1 -0
- package/dist/browser/classic/operations/index.js +12 -0
- package/dist/browser/classic/operations/index.js.map +1 -0
- package/dist/browser/codeSigningClient.d.ts +21 -0
- package/dist/browser/codeSigningClient.d.ts.map +1 -0
- package/dist/browser/codeSigningClient.js +22 -0
- package/dist/browser/codeSigningClient.js.map +1 -0
- package/dist/browser/helpers/serializerHelpers.d.ts +3 -0
- package/dist/browser/helpers/serializerHelpers.d.ts.map +1 -0
- package/dist/browser/helpers/serializerHelpers.js +24 -0
- package/dist/browser/helpers/serializerHelpers.js.map +1 -0
- package/dist/browser/index.d.ts +7 -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/models/index.d.ts +3 -0
- package/dist/browser/models/index.d.ts.map +1 -0
- package/dist/browser/models/index.js +4 -0
- package/dist/browser/models/index.js.map +1 -0
- package/dist/browser/models/models.d.ts +426 -0
- package/dist/browser/models/models.d.ts.map +1 -0
- package/dist/browser/models/models.js +184 -0
- package/dist/browser/models/models.js.map +1 -0
- package/dist/browser/models/options.d.ts +51 -0
- package/dist/browser/models/options.d.ts.map +1 -0
- package/dist/browser/models/options.js +4 -0
- package/dist/browser/models/options.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/restorePollerHelpers.d.ts +21 -0
- package/dist/browser/restorePollerHelpers.d.ts.map +1 -0
- package/dist/browser/restorePollerHelpers.js +104 -0
- package/dist/browser/restorePollerHelpers.js.map +1 -0
- package/dist/browser/static-helpers/pagingHelpers.d.ts +72 -0
- package/dist/browser/static-helpers/pagingHelpers.d.ts.map +1 -0
- package/dist/browser/static-helpers/pagingHelpers.js +137 -0
- package/dist/browser/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/browser/static-helpers/pollingHelpers.d.ts +30 -0
- package/dist/browser/static-helpers/pollingHelpers.d.ts.map +1 -0
- package/dist/browser/static-helpers/pollingHelpers.js +76 -0
- package/dist/browser/static-helpers/pollingHelpers.js.map +1 -0
- package/dist/commonjs/api/certificateProfiles/index.d.ts +32 -0
- package/dist/commonjs/api/certificateProfiles/index.d.ts.map +1 -0
- package/dist/commonjs/api/certificateProfiles/index.js +348 -0
- package/dist/commonjs/api/certificateProfiles/index.js.map +1 -0
- package/dist/commonjs/api/codeSigningAccounts/index.d.ts +40 -0
- package/dist/commonjs/api/codeSigningAccounts/index.d.ts.map +1 -0
- package/dist/commonjs/api/codeSigningAccounts/index.js +348 -0
- package/dist/commonjs/api/codeSigningAccounts/index.js.map +1 -0
- package/dist/commonjs/api/codeSigningContext.d.ts +12 -0
- package/dist/commonjs/api/codeSigningContext.d.ts.map +1 -0
- package/dist/commonjs/api/codeSigningContext.js +35 -0
- package/dist/commonjs/api/codeSigningContext.js.map +1 -0
- package/dist/commonjs/api/index.d.ts +2 -0
- package/dist/commonjs/api/index.d.ts.map +1 -0
- package/dist/commonjs/api/index.js +8 -0
- package/dist/commonjs/api/index.js.map +1 -0
- package/dist/commonjs/api/operations/index.d.ts +10 -0
- package/dist/commonjs/api/operations/index.d.ts.map +1 -0
- package/dist/commonjs/api/operations/index.js +45 -0
- package/dist/commonjs/api/operations/index.js.map +1 -0
- package/dist/commonjs/classic/certificateProfiles/index.d.ts +32 -0
- package/dist/commonjs/classic/certificateProfiles/index.d.ts.map +1 -0
- package/dist/commonjs/classic/certificateProfiles/index.js +20 -0
- package/dist/commonjs/classic/certificateProfiles/index.js.map +1 -0
- package/dist/commonjs/classic/codeSigningAccounts/index.d.ts +38 -0
- package/dist/commonjs/classic/codeSigningAccounts/index.d.ts.map +1 -0
- package/dist/commonjs/classic/codeSigningAccounts/index.js +22 -0
- package/dist/commonjs/classic/codeSigningAccounts/index.js.map +1 -0
- package/dist/commonjs/classic/index.d.ts +4 -0
- package/dist/commonjs/classic/index.d.ts.map +1 -0
- package/dist/commonjs/classic/index.js +5 -0
- package/dist/commonjs/classic/index.js.map +1 -0
- package/dist/commonjs/classic/operations/index.d.ts +14 -0
- package/dist/commonjs/classic/operations/index.d.ts.map +1 -0
- package/dist/commonjs/classic/operations/index.js +16 -0
- package/dist/commonjs/classic/operations/index.js.map +1 -0
- package/dist/commonjs/codeSigningClient.d.ts +21 -0
- package/dist/commonjs/codeSigningClient.d.ts.map +1 -0
- package/dist/commonjs/codeSigningClient.js +26 -0
- package/dist/commonjs/codeSigningClient.js.map +1 -0
- package/dist/commonjs/helpers/serializerHelpers.d.ts +3 -0
- package/dist/commonjs/helpers/serializerHelpers.d.ts.map +1 -0
- package/dist/commonjs/helpers/serializerHelpers.js +27 -0
- package/dist/commonjs/helpers/serializerHelpers.js.map +1 -0
- package/dist/commonjs/index.d.ts +7 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +21 -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/models/index.d.ts +3 -0
- package/dist/commonjs/models/index.d.ts.map +1 -0
- package/dist/commonjs/models/index.js +17 -0
- package/dist/commonjs/models/index.js.map +1 -0
- package/dist/commonjs/models/models.d.ts +426 -0
- package/dist/commonjs/models/models.d.ts.map +1 -0
- package/dist/commonjs/models/models.js +199 -0
- package/dist/commonjs/models/models.js.map +1 -0
- package/dist/commonjs/models/options.d.ts +51 -0
- package/dist/commonjs/models/options.d.ts.map +1 -0
- package/dist/commonjs/models/options.js +5 -0
- package/dist/commonjs/models/options.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/restorePollerHelpers.d.ts +21 -0
- package/dist/commonjs/restorePollerHelpers.d.ts.map +1 -0
- package/dist/commonjs/restorePollerHelpers.js +107 -0
- package/dist/commonjs/restorePollerHelpers.js.map +1 -0
- package/dist/commonjs/static-helpers/pagingHelpers.d.ts +72 -0
- package/dist/commonjs/static-helpers/pagingHelpers.d.ts.map +1 -0
- package/dist/commonjs/static-helpers/pagingHelpers.js +140 -0
- package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/commonjs/static-helpers/pollingHelpers.d.ts +30 -0
- package/dist/commonjs/static-helpers/pollingHelpers.d.ts.map +1 -0
- package/dist/commonjs/static-helpers/pollingHelpers.js +79 -0
- package/dist/commonjs/static-helpers/pollingHelpers.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/api/certificateProfiles/index.d.ts +32 -0
- package/dist/esm/api/certificateProfiles/index.d.ts.map +1 -0
- package/dist/esm/api/certificateProfiles/index.js +331 -0
- package/dist/esm/api/certificateProfiles/index.js.map +1 -0
- package/dist/esm/api/codeSigningAccounts/index.d.ts +40 -0
- package/dist/esm/api/codeSigningAccounts/index.d.ts.map +1 -0
- package/dist/esm/api/codeSigningAccounts/index.js +325 -0
- package/dist/esm/api/codeSigningAccounts/index.js.map +1 -0
- package/dist/esm/api/codeSigningContext.d.ts +12 -0
- package/dist/esm/api/codeSigningContext.d.ts.map +1 -0
- package/dist/esm/api/codeSigningContext.js +32 -0
- package/dist/esm/api/codeSigningContext.js.map +1 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/api/index.d.ts.map +1 -0
- package/dist/esm/api/index.js +4 -0
- package/dist/esm/api/index.js.map +1 -0
- package/dist/esm/api/operations/index.d.ts +10 -0
- package/dist/esm/api/operations/index.d.ts.map +1 -0
- package/dist/esm/api/operations/index.js +40 -0
- package/dist/esm/api/operations/index.js.map +1 -0
- package/dist/esm/classic/certificateProfiles/index.d.ts +32 -0
- package/dist/esm/classic/certificateProfiles/index.d.ts.map +1 -0
- package/dist/esm/classic/certificateProfiles/index.js +16 -0
- package/dist/esm/classic/certificateProfiles/index.js.map +1 -0
- package/dist/esm/classic/codeSigningAccounts/index.d.ts +38 -0
- package/dist/esm/classic/codeSigningAccounts/index.d.ts.map +1 -0
- package/dist/esm/classic/codeSigningAccounts/index.js +18 -0
- package/dist/esm/classic/codeSigningAccounts/index.js.map +1 -0
- package/dist/esm/classic/index.d.ts +4 -0
- package/dist/esm/classic/index.d.ts.map +1 -0
- package/dist/esm/classic/index.js +4 -0
- package/dist/esm/classic/index.js.map +1 -0
- package/dist/esm/classic/operations/index.d.ts +14 -0
- package/dist/esm/classic/operations/index.d.ts.map +1 -0
- package/dist/esm/classic/operations/index.js +12 -0
- package/dist/esm/classic/operations/index.js.map +1 -0
- package/dist/esm/codeSigningClient.d.ts +21 -0
- package/dist/esm/codeSigningClient.d.ts.map +1 -0
- package/dist/esm/codeSigningClient.js +22 -0
- package/dist/esm/codeSigningClient.js.map +1 -0
- package/dist/esm/helpers/serializerHelpers.d.ts +3 -0
- package/dist/esm/helpers/serializerHelpers.d.ts.map +1 -0
- package/dist/esm/helpers/serializerHelpers.js +24 -0
- package/dist/esm/helpers/serializerHelpers.js.map +1 -0
- package/dist/esm/index.d.ts +7 -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/models/index.d.ts +3 -0
- package/dist/esm/models/index.d.ts.map +1 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/models/models.d.ts +426 -0
- package/dist/esm/models/models.d.ts.map +1 -0
- package/dist/esm/models/models.js +184 -0
- package/dist/esm/models/models.js.map +1 -0
- package/dist/esm/models/options.d.ts +51 -0
- package/dist/esm/models/options.d.ts.map +1 -0
- package/dist/esm/models/options.js +4 -0
- package/dist/esm/models/options.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/restorePollerHelpers.d.ts +21 -0
- package/dist/esm/restorePollerHelpers.d.ts.map +1 -0
- package/dist/esm/restorePollerHelpers.js +104 -0
- package/dist/esm/restorePollerHelpers.js.map +1 -0
- package/dist/esm/static-helpers/pagingHelpers.d.ts +72 -0
- package/dist/esm/static-helpers/pagingHelpers.d.ts.map +1 -0
- package/dist/esm/static-helpers/pagingHelpers.js +137 -0
- package/dist/esm/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/esm/static-helpers/pollingHelpers.d.ts +30 -0
- package/dist/esm/static-helpers/pollingHelpers.d.ts.map +1 -0
- package/dist/esm/static-helpers/pollingHelpers.js +76 -0
- package/dist/esm/static-helpers/pollingHelpers.js.map +1 -0
- package/dist/react-native/api/certificateProfiles/index.d.ts +32 -0
- package/dist/react-native/api/certificateProfiles/index.d.ts.map +1 -0
- package/dist/react-native/api/certificateProfiles/index.js +331 -0
- package/dist/react-native/api/certificateProfiles/index.js.map +1 -0
- package/dist/react-native/api/codeSigningAccounts/index.d.ts +40 -0
- package/dist/react-native/api/codeSigningAccounts/index.d.ts.map +1 -0
- package/dist/react-native/api/codeSigningAccounts/index.js +325 -0
- package/dist/react-native/api/codeSigningAccounts/index.js.map +1 -0
- package/dist/react-native/api/codeSigningContext.d.ts +12 -0
- package/dist/react-native/api/codeSigningContext.d.ts.map +1 -0
- package/dist/react-native/api/codeSigningContext.js +32 -0
- package/dist/react-native/api/codeSigningContext.js.map +1 -0
- package/dist/react-native/api/index.d.ts +2 -0
- package/dist/react-native/api/index.d.ts.map +1 -0
- package/dist/react-native/api/index.js +4 -0
- package/dist/react-native/api/index.js.map +1 -0
- package/dist/react-native/api/operations/index.d.ts +10 -0
- package/dist/react-native/api/operations/index.d.ts.map +1 -0
- package/dist/react-native/api/operations/index.js +40 -0
- package/dist/react-native/api/operations/index.js.map +1 -0
- package/dist/react-native/classic/certificateProfiles/index.d.ts +32 -0
- package/dist/react-native/classic/certificateProfiles/index.d.ts.map +1 -0
- package/dist/react-native/classic/certificateProfiles/index.js +16 -0
- package/dist/react-native/classic/certificateProfiles/index.js.map +1 -0
- package/dist/react-native/classic/codeSigningAccounts/index.d.ts +38 -0
- package/dist/react-native/classic/codeSigningAccounts/index.d.ts.map +1 -0
- package/dist/react-native/classic/codeSigningAccounts/index.js +18 -0
- package/dist/react-native/classic/codeSigningAccounts/index.js.map +1 -0
- package/dist/react-native/classic/index.d.ts +4 -0
- package/dist/react-native/classic/index.d.ts.map +1 -0
- package/dist/react-native/classic/index.js +4 -0
- package/dist/react-native/classic/index.js.map +1 -0
- package/dist/react-native/classic/operations/index.d.ts +14 -0
- package/dist/react-native/classic/operations/index.d.ts.map +1 -0
- package/dist/react-native/classic/operations/index.js +12 -0
- package/dist/react-native/classic/operations/index.js.map +1 -0
- package/dist/react-native/codeSigningClient.d.ts +21 -0
- package/dist/react-native/codeSigningClient.d.ts.map +1 -0
- package/dist/react-native/codeSigningClient.js +22 -0
- package/dist/react-native/codeSigningClient.js.map +1 -0
- package/dist/react-native/helpers/serializerHelpers.d.ts +3 -0
- package/dist/react-native/helpers/serializerHelpers.d.ts.map +1 -0
- package/dist/react-native/helpers/serializerHelpers.js +24 -0
- package/dist/react-native/helpers/serializerHelpers.js.map +1 -0
- package/dist/react-native/index.d.ts +7 -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/models/index.d.ts +3 -0
- package/dist/react-native/models/index.d.ts.map +1 -0
- package/dist/react-native/models/index.js +4 -0
- package/dist/react-native/models/index.js.map +1 -0
- package/dist/react-native/models/models.d.ts +426 -0
- package/dist/react-native/models/models.d.ts.map +1 -0
- package/dist/react-native/models/models.js +184 -0
- package/dist/react-native/models/models.js.map +1 -0
- package/dist/react-native/models/options.d.ts +51 -0
- package/dist/react-native/models/options.d.ts.map +1 -0
- package/dist/react-native/models/options.js +4 -0
- package/dist/react-native/models/options.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/restorePollerHelpers.d.ts +21 -0
- package/dist/react-native/restorePollerHelpers.d.ts.map +1 -0
- package/dist/react-native/restorePollerHelpers.js +104 -0
- package/dist/react-native/restorePollerHelpers.js.map +1 -0
- package/dist/react-native/static-helpers/pagingHelpers.d.ts +72 -0
- package/dist/react-native/static-helpers/pagingHelpers.d.ts.map +1 -0
- package/dist/react-native/static-helpers/pagingHelpers.js +137 -0
- package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/react-native/static-helpers/pollingHelpers.d.ts +30 -0
- package/dist/react-native/static-helpers/pollingHelpers.d.ts.map +1 -0
- package/dist/react-native/static-helpers/pollingHelpers.js +76 -0
- package/dist/react-native/static-helpers/pollingHelpers.js.map +1 -0
- package/package.json +170 -0
- package/review/arm-trustedsigning-models.api.md +313 -0
- package/review/arm-trustedsigning.api.md +386 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/models/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAclE,MAAM,UAAU,kBAAkB,CAAC,IAAc;IAC/C,OAAO,IAAW,CAAC;AACrB,CAAC;AAkBD,sEAAsE;AACtE,MAAM,CAAN,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,WAAW;IACX,mCAAa,CAAA;IACb,kBAAkB;IAClB,iDAA2B,CAAA;IAC3B,sBAAsB;IACtB,yDAAmC,CAAA;IACnC,UAAU;IACV,iCAAW,CAAA;AACb,CAAC,EATW,kBAAkB,KAAlB,kBAAkB,QAS7B;AAiBD,MAAM,UAAU,uBAAuB,CAAC,IAAmB;IACzD,OAAO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C;IAEvC,OAAO;QACL,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC;KAC3D,CAAC;AACJ,CAAC;AAgBD,MAAM,UAAU,+BAA+B,CAC7C,IAA2B;IAE3B,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;KACnB,CAAC;AACJ,CAAC;AAYD,iFAAiF;AACjF,MAAM,CAAN,IAAY,6BAKX;AALD,WAAY,6BAA6B;IACvC,yBAAyB;IACzB,0EAAyC,CAAA;IACzC,oBAAoB;IACpB,gEAA+B,CAAA;AACjC,CAAC,EALW,6BAA6B,KAA7B,6BAA6B,QAKxC;AA8CD,+DAA+D;AAC/D,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,WAAW;IACX,4BAAa,CAAA;IACb,aAAa;IACb,gCAAiB,CAAA;IACjB,kBAAkB;IAClB,yCAA0B,CAAA;AAC5B,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB;AAaD,mEAAmE;AACnE,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,eAAe;IACf,wCAAqB,CAAA;AACvB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { serializeRecord } from \"../helpers/serializerHelpers.js\";\n\n/** Common fields that are returned in the response for all Azure Resource Manager resources */\nexport interface Resource {\n /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */\n readonly id?: string;\n /** The name of the resource */\n readonly name?: string;\n /** The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\" */\n readonly type?: string;\n /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */\n readonly systemData?: SystemData;\n}\n\nexport function resourceSerializer(item: Resource) {\n return item as any;\n}\n\n/** Metadata pertaining to creation and last modification of the resource. */\nexport interface SystemData {\n /** The identity that created the resource. */\n createdBy?: string;\n /** The type of identity that created the resource. */\n createdByType?: CreatedByType;\n /** The timestamp of resource creation (UTC). */\n createdAt?: Date;\n /** The identity that last modified the resource. */\n lastModifiedBy?: string;\n /** The type of identity that last modified the resource. */\n lastModifiedByType?: CreatedByType;\n /** The timestamp of resource last modification (UTC) */\n lastModifiedAt?: Date;\n}\n\n/** Known values of {@link CreatedByType} that the service accepts. */\nexport enum KnownCreatedByType {\n /** User */\n User = \"User\",\n /** Application */\n Application = \"Application\",\n /** ManagedIdentity */\n ManagedIdentity = \"ManagedIdentity\",\n /** Key */\n Key = \"Key\",\n}\n\n/**\n * The kind of entity that created the resource. \\\n * {@link KnownCreatedByType} can be used interchangeably with CreatedByType,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **User** \\\n * **Application** \\\n * **ManagedIdentity** \\\n * **Key**\n */\nexport type CreatedByType = string;\n\n/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */\nexport interface ProxyResource extends Resource {}\n\nexport function proxyResourceSerializer(item: ProxyResource) {\n return item as any;\n}\n\n/** Certificate profile resource. */\nexport interface CertificateProfile extends ProxyResource {\n /** The resource-specific properties for this resource. */\n properties?: CertificateProfileProperties;\n}\n\nexport function certificateProfileSerializer(item: CertificateProfile): Record<string, unknown> {\n return {\n properties: !item.properties\n ? item.properties\n : certificateProfilePropertiesSerializer(item.properties),\n };\n}\n\n/** Properties of the certificate profile. */\nexport interface CertificateProfileProperties {\n /** Profile type of the certificate. */\n profileType: ProfileType;\n /** Used as CN in the certificate subject name. */\n readonly commonName?: string;\n /** Used as O in the certificate subject name. */\n readonly organization?: string;\n /** Used as OU in the private trust certificate subject name. */\n readonly organizationUnit?: string;\n /** Used as STREET in the certificate subject name. */\n readonly streetAddress?: string;\n /** Whether to include STREET in the certificate subject name. */\n includeStreetAddress?: boolean;\n /** Used as L in the certificate subject name. */\n readonly city?: string;\n /** Whether to include L in the certificate subject name. Applicable only for private trust, private trust ci profile types */\n includeCity?: boolean;\n /** Used as S in the certificate subject name. */\n readonly state?: string;\n /** Whether to include S in the certificate subject name. Applicable only for private trust, private trust ci profile types */\n includeState?: boolean;\n /** Used as C in the certificate subject name. */\n readonly country?: string;\n /** Whether to include C in the certificate subject name. Applicable only for private trust, private trust ci profile types */\n includeCountry?: boolean;\n /** Used as PC in the certificate subject name. */\n readonly postalCode?: string;\n /** Whether to include PC in the certificate subject name. */\n includePostalCode?: boolean;\n /** Enhanced key usage of the certificate. */\n readonly enhancedKeyUsage?: string;\n /** Identity validation id used for the certificate subject name. */\n identityValidationId?: string;\n /** Status of the current operation on certificate profile. */\n readonly provisioningState?: ProvisioningState;\n /** Status of the certificate profile. */\n readonly status?: CertificateProfileStatus;\n /** List of renewed certificates. */\n readonly certificates?: Certificate[];\n}\n\nexport function certificateProfilePropertiesSerializer(\n item: CertificateProfileProperties,\n): Record<string, unknown> {\n return {\n profileType: item[\"profileType\"],\n includeStreetAddress: item[\"includeStreetAddress\"],\n includeCity: item[\"includeCity\"],\n includeState: item[\"includeState\"],\n includeCountry: item[\"includeCountry\"],\n includePostalCode: item[\"includePostalCode\"],\n identityValidationId: item[\"identityValidationId\"],\n };\n}\n\n/** Known values of {@link ProfileType} that the service accepts. */\nexport enum KnownProfileType {\n /** PublicTrust */\n PublicTrust = \"PublicTrust\",\n /** PrivateTrust */\n PrivateTrust = \"PrivateTrust\",\n /** PrivateTrustCIPolicy */\n PrivateTrustCIPolicy = \"PrivateTrustCIPolicy\",\n /** VBSEnclave */\n VBSEnclave = \"VBSEnclave\",\n /** PublicTrustTest */\n PublicTrustTest = \"PublicTrustTest\",\n}\n\n/**\n * Type of the certificate \\\n * {@link KnownProfileType} can be used interchangeably with ProfileType,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **PublicTrust** \\\n * **PrivateTrust** \\\n * **PrivateTrustCIPolicy** \\\n * **VBSEnclave** \\\n * **PublicTrustTest**\n */\nexport type ProfileType = string;\n\n/** Known values of {@link ProvisioningState} that the service accepts. */\nexport enum KnownProvisioningState {\n /** Succeeded */\n Succeeded = \"Succeeded\",\n /** Failed */\n Failed = \"Failed\",\n /** Canceled */\n Canceled = \"Canceled\",\n /** Updating */\n Updating = \"Updating\",\n /** Deleting */\n Deleting = \"Deleting\",\n /** Accepted */\n Accepted = \"Accepted\",\n}\n\n/**\n * The status of the current operation. \\\n * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Succeeded** \\\n * **Failed** \\\n * **Canceled** \\\n * **Updating** \\\n * **Deleting** \\\n * **Accepted**\n */\nexport type ProvisioningState = string;\n\n/** Known values of {@link CertificateProfileStatus} that the service accepts. */\nexport enum KnownCertificateProfileStatus {\n /** Active */\n Active = \"Active\",\n /** Disabled */\n Disabled = \"Disabled\",\n /** Suspended */\n Suspended = \"Suspended\",\n}\n\n/**\n * Status of the certificate profiles. \\\n * {@link KnownCertificateProfileStatus} can be used interchangeably with CertificateProfileStatus,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Active** \\\n * **Disabled** \\\n * **Suspended**\n */\nexport type CertificateProfileStatus = string;\n\n/** Properties of the certificate. */\nexport interface Certificate {\n /** Serial number of the certificate. */\n serialNumber?: string;\n /** Subject name of the certificate. */\n subjectName?: string;\n /** Thumbprint of the certificate. */\n thumbprint?: string;\n /** Certificate created date. */\n createdDate?: string;\n /** Certificate expiry date. */\n expiryDate?: string;\n /** Status of the certificate. */\n status?: CertificateStatus;\n /** Revocations history of a certificate. */\n revocation?: Revocation;\n}\n\n/** Known values of {@link CertificateStatus} that the service accepts. */\nexport enum KnownCertificateStatus {\n /** Active */\n Active = \"Active\",\n /** Expired */\n Expired = \"Expired\",\n /** Revoked */\n Revoked = \"Revoked\",\n}\n\n/**\n * Status of the certificate \\\n * {@link KnownCertificateStatus} can be used interchangeably with CertificateStatus,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Active** \\\n * **Expired** \\\n * **Revoked**\n */\nexport type CertificateStatus = string;\n\n/** Revocation details of the certificate. */\nexport interface Revocation {\n /** The timestamp when the revocation is requested. */\n requestedAt?: Date;\n /** The timestamp when the revocation is effective. */\n effectiveAt?: Date;\n /** Reason for revocation. */\n reason?: string;\n /** Remarks for the revocation. */\n remarks?: string;\n /** Status of the revocation. */\n status?: RevocationStatus;\n /** Reason for the revocation failure. */\n failureReason?: string;\n}\n\n/** Known values of {@link RevocationStatus} that the service accepts. */\nexport enum KnownRevocationStatus {\n /** Succeeded */\n Succeeded = \"Succeeded\",\n /** InProgress */\n InProgress = \"InProgress\",\n /** Failed */\n Failed = \"Failed\",\n}\n\n/**\n * Revocation status of the certificate. \\\n * {@link KnownRevocationStatus} can be used interchangeably with RevocationStatus,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Succeeded** \\\n * **InProgress** \\\n * **Failed**\n */\nexport type RevocationStatus = string;\n\n/** The response of a CertificateProfile list operation. */\nexport interface _CertificateProfileListResult {\n /** The CertificateProfile items on this page */\n value: CertificateProfile[];\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** Defines the certificate revocation properties. */\nexport interface RevokeCertificate {\n /** Serial number of the certificate. */\n serialNumber: string;\n /** Thumbprint of the certificate. */\n thumbprint: string;\n /** The timestamp when the revocation is effective. */\n effectiveAt: Date;\n /** Reason for the revocation. */\n reason: string;\n /** Remarks for the revocation. */\n remarks?: string;\n}\n\nexport function revokeCertificateSerializer(item: RevokeCertificate): Record<string, unknown> {\n return {\n serialNumber: item[\"serialNumber\"],\n thumbprint: item[\"thumbprint\"],\n effectiveAt: item[\"effectiveAt\"].toISOString(),\n reason: item[\"reason\"],\n remarks: item[\"remarks\"],\n };\n}\n\n/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */\nexport interface TrackedResource extends Resource {\n /** Resource tags. */\n tags?: Record<string, string>;\n /** The geo-location where the resource lives */\n location: string;\n}\n\nexport function trackedResourceSerializer(item: TrackedResource): Record<string, unknown> {\n return {\n tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any),\n location: item[\"location\"],\n };\n}\n\n/** Trusted signing account resource. */\nexport interface CodeSigningAccount extends TrackedResource {\n /** The resource-specific properties for this resource. */\n properties?: CodeSigningAccountProperties;\n}\n\nexport function codeSigningAccountSerializer(item: CodeSigningAccount): Record<string, unknown> {\n return {\n tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any),\n location: item[\"location\"],\n properties: !item.properties\n ? item.properties\n : codeSigningAccountPropertiesSerializer(item.properties),\n };\n}\n\n/** Properties of the trusted signing account. */\nexport interface CodeSigningAccountProperties {\n /** The URI of the trusted signing account which is used during signing files. */\n readonly accountUri?: string;\n /** SKU of the trusted signing account. */\n sku?: AccountSku;\n /** Status of the current operation on trusted signing account. */\n readonly provisioningState?: ProvisioningState;\n}\n\nexport function codeSigningAccountPropertiesSerializer(\n item: CodeSigningAccountProperties,\n): Record<string, unknown> {\n return {\n sku: !item.sku ? item.sku : accountSkuSerializer(item.sku),\n };\n}\n\n/** SKU of the trusted signing account. */\nexport interface AccountSku {\n /** Name of the SKU. */\n name: SkuName;\n}\n\nexport function accountSkuSerializer(item: AccountSku): Record<string, unknown> {\n return {\n name: item[\"name\"],\n };\n}\n\n/** Known values of {@link SkuName} that the service accepts. */\nexport enum KnownSkuName {\n /** Basic */\n Basic = \"Basic\",\n /** Premium */\n Premium = \"Premium\",\n}\n\n/**\n * Name of the sku. \\\n * {@link KnownSkuName} can be used interchangeably with SkuName,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Basic** \\\n * **Premium**\n */\nexport type SkuName = string;\n\n/** Parameters for creating or updating a trusted signing account. */\nexport interface CodeSigningAccountPatch {\n /** Resource tags. */\n tags?: Record<string, string>;\n /** Properties of the trusted signing account. */\n properties?: CodeSigningAccountPatchProperties;\n}\n\nexport function codeSigningAccountPatchSerializer(\n item: CodeSigningAccountPatch,\n): Record<string, unknown> {\n return {\n tags: !item.tags ? item.tags : (serializeRecord(item.tags as any) as any),\n properties: !item.properties\n ? item.properties\n : codeSigningAccountPatchPropertiesSerializer(item.properties),\n };\n}\n\n/** Properties of the trusted signing account. */\nexport interface CodeSigningAccountPatchProperties {\n /** SKU of the trusted signing account. */\n sku?: AccountSku;\n}\n\nexport function codeSigningAccountPatchPropertiesSerializer(\n item: CodeSigningAccountPatchProperties,\n): Record<string, unknown> {\n return {\n sku: !item.sku ? item.sku : accountSkuSerializer(item.sku),\n };\n}\n\n/** The response of a CodeSigningAccount list operation. */\nexport interface _CodeSigningAccountListResult {\n /** The CodeSigningAccount items on this page */\n value: CodeSigningAccount[];\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** The parameters used to check the availability of the trusted signing account name. */\nexport interface CheckNameAvailability {\n /** Trusted signing account name. */\n name: string;\n}\n\nexport function checkNameAvailabilitySerializer(\n item: CheckNameAvailability,\n): Record<string, unknown> {\n return {\n name: item[\"name\"],\n };\n}\n\n/** The CheckNameAvailability operation response. */\nexport interface CheckNameAvailabilityResult {\n /** A boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. */\n readonly nameAvailable?: boolean;\n /** The reason that a trusted signing account name could not be used. The Reason element is only returned if nameAvailable is false. */\n readonly reason?: NameUnavailabilityReason;\n /** An error message explaining the Reason value in more detail. */\n readonly message?: string;\n}\n\n/** Known values of {@link NameUnavailabilityReason} that the service accepts. */\nexport enum KnownNameUnavailabilityReason {\n /** AccountNameInvalid */\n AccountNameInvalid = \"AccountNameInvalid\",\n /** AlreadyExists */\n AlreadyExists = \"AlreadyExists\",\n}\n\n/**\n * The reason that a trusted signing account name could not be used. The Reason element is only returned if nameAvailable is false. \\\n * {@link KnownNameUnavailabilityReason} can be used interchangeably with NameUnavailabilityReason,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **AccountNameInvalid** \\\n * **AlreadyExists**\n */\nexport type NameUnavailabilityReason = string;\n\n/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */\nexport interface _OperationListResult {\n /** The Operation items on this page */\n value: Operation[];\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** Details of a REST API operation, returned from the Resource Provider Operations API */\nexport interface Operation {\n /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\" */\n readonly name?: string;\n /** Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations. */\n readonly isDataAction?: boolean;\n /** Localized display information for this particular operation. */\n readonly display?: OperationDisplay;\n /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\" */\n readonly origin?: Origin;\n /** Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. */\n actionType?: ActionType;\n}\n\n/** Localized display information for and operation. */\nexport interface OperationDisplay {\n /** The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\". */\n readonly provider?: string;\n /** The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\". */\n readonly resource?: string;\n /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\". */\n readonly operation?: string;\n /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */\n readonly description?: string;\n}\n\n/** Known values of {@link Origin} that the service accepts. */\nexport enum KnownOrigin {\n /** user */\n User = \"user\",\n /** system */\n System = \"system\",\n /** user,system */\n UserSystem = \"user,system\",\n}\n\n/**\n * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\" \\\n * {@link KnownOrigin} can be used interchangeably with Origin,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **user** \\\n * **system** \\\n * **user,system**\n */\nexport type Origin = string;\n\n/** Known values of {@link ActionType} that the service accepts. */\nexport enum KnownActionType {\n /** Internal */\n Internal = \"Internal\",\n}\n\n/**\n * Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. \\\n * {@link KnownActionType} can be used interchangeably with ActionType,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Internal**\n */\nexport type ActionType = string;\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OperationOptions } from "@azure-rest/core-client";
|
|
2
|
+
/** Optional parameters. */
|
|
3
|
+
export interface OperationsListOptionalParams extends OperationOptions {
|
|
4
|
+
}
|
|
5
|
+
/** Optional parameters. */
|
|
6
|
+
export interface CodeSigningAccountsGetOptionalParams extends OperationOptions {
|
|
7
|
+
}
|
|
8
|
+
/** Optional parameters. */
|
|
9
|
+
export interface CodeSigningAccountsCreateOptionalParams extends OperationOptions {
|
|
10
|
+
/** Delay to wait until next poll, in milliseconds. */
|
|
11
|
+
updateIntervalInMs?: number;
|
|
12
|
+
}
|
|
13
|
+
/** Optional parameters. */
|
|
14
|
+
export interface CodeSigningAccountsUpdateOptionalParams extends OperationOptions {
|
|
15
|
+
/** Delay to wait until next poll, in milliseconds. */
|
|
16
|
+
updateIntervalInMs?: number;
|
|
17
|
+
}
|
|
18
|
+
/** Optional parameters. */
|
|
19
|
+
export interface CodeSigningAccountsDeleteOptionalParams extends OperationOptions {
|
|
20
|
+
/** Delay to wait until next poll, in milliseconds. */
|
|
21
|
+
updateIntervalInMs?: number;
|
|
22
|
+
}
|
|
23
|
+
/** Optional parameters. */
|
|
24
|
+
export interface CodeSigningAccountsListByResourceGroupOptionalParams extends OperationOptions {
|
|
25
|
+
}
|
|
26
|
+
/** Optional parameters. */
|
|
27
|
+
export interface CodeSigningAccountsListBySubscriptionOptionalParams extends OperationOptions {
|
|
28
|
+
}
|
|
29
|
+
/** Optional parameters. */
|
|
30
|
+
export interface CodeSigningAccountsCheckNameAvailabilityOptionalParams extends OperationOptions {
|
|
31
|
+
}
|
|
32
|
+
/** Optional parameters. */
|
|
33
|
+
export interface CertificateProfilesGetOptionalParams extends OperationOptions {
|
|
34
|
+
}
|
|
35
|
+
/** Optional parameters. */
|
|
36
|
+
export interface CertificateProfilesCreateOptionalParams extends OperationOptions {
|
|
37
|
+
/** Delay to wait until next poll, in milliseconds. */
|
|
38
|
+
updateIntervalInMs?: number;
|
|
39
|
+
}
|
|
40
|
+
/** Optional parameters. */
|
|
41
|
+
export interface CertificateProfilesDeleteOptionalParams extends OperationOptions {
|
|
42
|
+
/** Delay to wait until next poll, in milliseconds. */
|
|
43
|
+
updateIntervalInMs?: number;
|
|
44
|
+
}
|
|
45
|
+
/** Optional parameters. */
|
|
46
|
+
export interface CertificateProfilesListByCodeSigningAccountOptionalParams extends OperationOptions {
|
|
47
|
+
}
|
|
48
|
+
/** Optional parameters. */
|
|
49
|
+
export interface CertificateProfilesRevokeCertificateOptionalParams extends OperationOptions {
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/models/options.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,2BAA2B;AAC3B,MAAM,WAAW,4BAA6B,SAAQ,gBAAgB;CAAG;AAEzE,2BAA2B;AAC3B,MAAM,WAAW,oCAAqC,SAAQ,gBAAgB;CAAG;AAEjF,2BAA2B;AAC3B,MAAM,WAAW,uCAAwC,SAAQ,gBAAgB;IAC/E,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,2BAA2B;AAC3B,MAAM,WAAW,uCAAwC,SAAQ,gBAAgB;IAC/E,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,2BAA2B;AAC3B,MAAM,WAAW,uCAAwC,SAAQ,gBAAgB;IAC/E,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,2BAA2B;AAC3B,MAAM,WAAW,oDAAqD,SAAQ,gBAAgB;CAAG;AAEjG,2BAA2B;AAC3B,MAAM,WAAW,mDAAoD,SAAQ,gBAAgB;CAAG;AAEhG,2BAA2B;AAC3B,MAAM,WAAW,sDAAuD,SAAQ,gBAAgB;CAAG;AAEnG,2BAA2B;AAC3B,MAAM,WAAW,oCAAqC,SAAQ,gBAAgB;CAAG;AAEjF,2BAA2B;AAC3B,MAAM,WAAW,uCAAwC,SAAQ,gBAAgB;IAC/E,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,2BAA2B;AAC3B,MAAM,WAAW,uCAAwC,SAAQ,gBAAgB;IAC/E,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,2BAA2B;AAC3B,MAAM,WAAW,yDACf,SAAQ,gBAAgB;CAAG;AAE7B,2BAA2B;AAC3B,MAAM,WAAW,kDAAmD,SAAQ,gBAAgB;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/models/options.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationOptions } from \"@azure-rest/core-client\";\n\n/** Optional parameters. */\nexport interface OperationsListOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface CodeSigningAccountsGetOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface CodeSigningAccountsCreateOptionalParams extends OperationOptions {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n}\n\n/** Optional parameters. */\nexport interface CodeSigningAccountsUpdateOptionalParams extends OperationOptions {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n}\n\n/** Optional parameters. */\nexport interface CodeSigningAccountsDeleteOptionalParams extends OperationOptions {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n}\n\n/** Optional parameters. */\nexport interface CodeSigningAccountsListByResourceGroupOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface CodeSigningAccountsListBySubscriptionOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface CodeSigningAccountsCheckNameAvailabilityOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface CertificateProfilesGetOptionalParams extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface CertificateProfilesCreateOptionalParams extends OperationOptions {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n}\n\n/** Optional parameters. */\nexport interface CertificateProfilesDeleteOptionalParams extends OperationOptions {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n}\n\n/** Optional parameters. */\nexport interface CertificateProfilesListByCodeSigningAccountOptionalParams\n extends OperationOptions {}\n\n/** Optional parameters. */\nexport interface CertificateProfilesRevokeCertificateOptionalParams extends OperationOptions {}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CodeSigningClient } from "./codeSigningClient.js";
|
|
2
|
+
import { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
3
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
4
|
+
import { PollerLike, OperationState } from "@azure/core-lro";
|
|
5
|
+
export interface RestorePollerOptions<TResult, TResponse extends PathUncheckedResponse = PathUncheckedResponse> extends OperationOptions {
|
|
6
|
+
/** Delay to wait until next poll, in milliseconds. */
|
|
7
|
+
updateIntervalInMs?: number;
|
|
8
|
+
/**
|
|
9
|
+
* The signal which can be used to abort requests.
|
|
10
|
+
*/
|
|
11
|
+
abortSignal?: AbortSignalLike;
|
|
12
|
+
/** Deserialization function for raw response body */
|
|
13
|
+
processResponseBody?: (result: TResponse) => Promise<TResult>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates a poller from the serialized state of another poller. This can be
|
|
17
|
+
* useful when you want to create pollers on a different host or a poller
|
|
18
|
+
* needs to be constructed after the original one is not in scope.
|
|
19
|
+
*/
|
|
20
|
+
export declare function restorePoller<TResponse extends PathUncheckedResponse, TResult>(client: CodeSigningClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike<OperationState<TResult>, TResult>, options?: RestorePollerOptions<TResult>): PollerLike<OperationState<TResult>, TResult>;
|
|
21
|
+
//# sourceMappingURL=restorePollerHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restorePollerHelpers.d.ts","sourceRoot":"","sources":["../../src/restorePollerHelpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAW3D,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,UAAU,EACV,cAAc,EAGf,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,oBAAoB,CACnC,OAAO,EACP,SAAS,SAAS,qBAAqB,GAAG,qBAAqB,CAC/D,SAAQ,gBAAgB;IACxB,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,qDAAqD;IACrD,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,SAAS,qBAAqB,EAAE,OAAO,EAC5E,MAAM,EAAE,iBAAiB,EACzB,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EACjF,OAAO,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,GACtC,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CA+B9C"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { _createDeserialize, _updateDeserialize, _$deleteDeserialize, } from "./api/codeSigningAccounts/index.js";
|
|
4
|
+
import { _createDeserialize as _createDeserializeCertificateProfiles, _$deleteDeserialize as _$deleteDeserializeCertificateProfiles, } from "./api/certificateProfiles/index.js";
|
|
5
|
+
import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js";
|
|
6
|
+
import { deserializeState, } from "@azure/core-lro";
|
|
7
|
+
/**
|
|
8
|
+
* Creates a poller from the serialized state of another poller. This can be
|
|
9
|
+
* useful when you want to create pollers on a different host or a poller
|
|
10
|
+
* needs to be constructed after the original one is not in scope.
|
|
11
|
+
*/
|
|
12
|
+
export function restorePoller(client, serializedState, sourceOperation, options) {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
const pollerConfig = deserializeState(serializedState).config;
|
|
15
|
+
const { initialRequestUrl, requestMethod, metadata } = pollerConfig;
|
|
16
|
+
if (!initialRequestUrl || !requestMethod) {
|
|
17
|
+
throw new Error(`Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation === null || sourceOperation === void 0 ? void 0 : sourceOperation.name}`);
|
|
18
|
+
}
|
|
19
|
+
const resourceLocationConfig = metadata === null || metadata === void 0 ? void 0 : metadata["resourceLocationConfig"];
|
|
20
|
+
const { deserializer, expectedStatuses = [] } = (_a = getDeserializationHelper(initialRequestUrl, requestMethod)) !== null && _a !== void 0 ? _a : {};
|
|
21
|
+
const deserializeHelper = (_b = options === null || options === void 0 ? void 0 : options.processResponseBody) !== null && _b !== void 0 ? _b : deserializer;
|
|
22
|
+
if (!deserializeHelper) {
|
|
23
|
+
throw new Error(`Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation === null || sourceOperation === void 0 ? void 0 : sourceOperation.name}.`);
|
|
24
|
+
}
|
|
25
|
+
return getLongRunningPoller((_c = client["_client"]) !== null && _c !== void 0 ? _c : client, deserializeHelper, expectedStatuses, {
|
|
26
|
+
updateIntervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
|
|
27
|
+
abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal,
|
|
28
|
+
resourceLocationConfig,
|
|
29
|
+
restoreFrom: serializedState,
|
|
30
|
+
initialRequestUrl,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const deserializeMap = {
|
|
34
|
+
"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}": { deserializer: _createDeserialize, expectedStatuses: ["200", "201"] },
|
|
35
|
+
"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}": { deserializer: _updateDeserialize, expectedStatuses: ["200", "202"] },
|
|
36
|
+
"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}": {
|
|
37
|
+
deserializer: _$deleteDeserialize,
|
|
38
|
+
expectedStatuses: ["202", "204", "200"],
|
|
39
|
+
},
|
|
40
|
+
"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}": {
|
|
41
|
+
deserializer: _createDeserializeCertificateProfiles,
|
|
42
|
+
expectedStatuses: ["200", "201"],
|
|
43
|
+
},
|
|
44
|
+
"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}": {
|
|
45
|
+
deserializer: _$deleteDeserializeCertificateProfiles,
|
|
46
|
+
expectedStatuses: ["202", "204", "200"],
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
function getDeserializationHelper(urlStr, method) {
|
|
50
|
+
var _a, _b, _c, _d;
|
|
51
|
+
const path = new URL(urlStr).pathname;
|
|
52
|
+
const pathParts = path.split("/");
|
|
53
|
+
// Traverse list to match the longest candidate
|
|
54
|
+
// matchedLen: the length of candidate path
|
|
55
|
+
// matchedValue: the matched status code array
|
|
56
|
+
let matchedLen = -1, matchedValue;
|
|
57
|
+
// Iterate the responseMap to find a match
|
|
58
|
+
for (const [key, value] of Object.entries(deserializeMap)) {
|
|
59
|
+
// Extracting the path from the map key which is in format
|
|
60
|
+
// GET /path/foo
|
|
61
|
+
if (!key.startsWith(method)) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
const candidatePath = getPathFromMapKey(key);
|
|
65
|
+
// Get each part of the url path
|
|
66
|
+
const candidateParts = candidatePath.split("/");
|
|
67
|
+
// track if we have found a match to return the values found.
|
|
68
|
+
let found = true;
|
|
69
|
+
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
70
|
+
if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
|
|
71
|
+
const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
|
|
72
|
+
// If the current part of the candidate is a "template" part
|
|
73
|
+
// Try to use the suffix of pattern to match the path
|
|
74
|
+
// {guid} ==> $
|
|
75
|
+
// {guid}:export ==> :export$
|
|
76
|
+
const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
|
|
77
|
+
if (!isMatched) {
|
|
78
|
+
found = false;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
// If the candidate part is not a template and
|
|
84
|
+
// the parts don't match mark the candidate as not found
|
|
85
|
+
// to move on with the next candidate path.
|
|
86
|
+
if (candidateParts[i] !== pathParts[j]) {
|
|
87
|
+
found = false;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// We finished evaluating the current candidate parts
|
|
92
|
+
// Update the matched value if and only if we found the longer pattern
|
|
93
|
+
if (found && candidatePath.length > matchedLen) {
|
|
94
|
+
matchedLen = candidatePath.length;
|
|
95
|
+
matchedValue = value;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return matchedValue;
|
|
99
|
+
}
|
|
100
|
+
function getPathFromMapKey(mapKey) {
|
|
101
|
+
const pathStart = mapKey.indexOf("/");
|
|
102
|
+
return mapKey.slice(pathStart);
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=restorePollerHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restorePollerHelpers.js","sourceRoot":"","sources":["../../src/restorePollerHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,kBAAkB,IAAI,qCAAqC,EAC3D,mBAAmB,IAAI,sCAAsC,GAC9D,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAG1E,OAAO,EAGL,gBAAgB,GAEjB,MAAM,iBAAiB,CAAC;AAgBzB;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAyB,EACzB,eAAuB,EACvB,eAAiF,EACjF,OAAuC;;IAEvC,MAAM,YAAY,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC;IAC9D,MAAM,EAAE,iBAAiB,EAAE,aAAa,EAAE,QAAQ,EAAE,G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,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CodeSigningClient } from \"./codeSigningClient.js\";\nimport {\n _createDeserialize,\n _updateDeserialize,\n _$deleteDeserialize,\n} from \"./api/codeSigningAccounts/index.js\";\nimport {\n _createDeserialize as _createDeserializeCertificateProfiles,\n _$deleteDeserialize as _$deleteDeserializeCertificateProfiles,\n} from \"./api/certificateProfiles/index.js\";\nimport { getLongRunningPoller } from \"./static-helpers/pollingHelpers.js\";\nimport { OperationOptions, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n PollerLike,\n OperationState,\n deserializeState,\n ResourceLocationConfig,\n} from \"@azure/core-lro\";\n\nexport interface RestorePollerOptions<\n TResult,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n> extends OperationOptions {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /** Deserialization function for raw response body */\n processResponseBody?: (result: TResponse) => Promise<TResult>;\n}\n\n/**\n * Creates a poller from the serialized state of another poller. This can be\n * useful when you want to create pollers on a different host or a poller\n * needs to be constructed after the original one is not in scope.\n */\nexport function restorePoller<TResponse extends PathUncheckedResponse, TResult>(\n client: CodeSigningClient,\n serializedState: string,\n sourceOperation: (...args: any[]) => PollerLike<OperationState<TResult>, TResult>,\n options?: RestorePollerOptions<TResult>,\n): PollerLike<OperationState<TResult>, TResult> {\n const pollerConfig = deserializeState(serializedState).config;\n const { initialRequestUrl, requestMethod, metadata } = pollerConfig;\n if (!initialRequestUrl || !requestMethod) {\n throw new Error(\n `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`,\n );\n }\n const resourceLocationConfig = metadata?.[\"resourceLocationConfig\"] as\n | ResourceLocationConfig\n | undefined;\n const { deserializer, expectedStatuses = [] } =\n getDeserializationHelper(initialRequestUrl, requestMethod) ?? {};\n const deserializeHelper = options?.processResponseBody ?? deserializer;\n if (!deserializeHelper) {\n throw new Error(\n `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`,\n );\n }\n return getLongRunningPoller(\n (client as any)[\"_client\"] ?? client,\n deserializeHelper as (result: TResponse) => Promise<TResult>,\n expectedStatuses,\n {\n updateIntervalInMs: options?.updateIntervalInMs,\n abortSignal: options?.abortSignal,\n resourceLocationConfig,\n restoreFrom: serializedState,\n initialRequestUrl,\n },\n );\n}\n\ninterface DeserializationHelper {\n deserializer: Function;\n expectedStatuses: string[];\n}\n\nconst deserializeMap: Record<string, DeserializationHelper> = {\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}\":\n { deserializer: _createDeserialize, expectedStatuses: [\"200\", \"201\"] },\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}\":\n { deserializer: _updateDeserialize, expectedStatuses: [\"200\", \"202\"] },\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}\":\n {\n deserializer: _$deleteDeserialize,\n expectedStatuses: [\"202\", \"204\", \"200\"],\n },\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}\":\n {\n deserializer: _createDeserializeCertificateProfiles,\n expectedStatuses: [\"200\", \"201\"],\n },\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}\":\n {\n deserializer: _$deleteDeserializeCertificateProfiles,\n expectedStatuses: [\"202\", \"204\", \"200\"],\n },\n};\n\nfunction getDeserializationHelper(\n urlStr: string,\n method: string,\n): DeserializationHelper | undefined {\n const path = new URL(urlStr).pathname;\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: DeserializationHelper | undefined;\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(deserializeMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Client, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the byPage method
|
|
4
|
+
*/
|
|
5
|
+
export interface PageSettings {
|
|
6
|
+
/**
|
|
7
|
+
* A reference to a specific page to start iterating from.
|
|
8
|
+
*/
|
|
9
|
+
continuationToken?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* An interface that describes a page of results.
|
|
13
|
+
*/
|
|
14
|
+
export type ContinuablePage<TElement, TPage = TElement[]> = TPage & {
|
|
15
|
+
/**
|
|
16
|
+
* The token that keeps track of where to continue the iterator
|
|
17
|
+
*/
|
|
18
|
+
continuationToken?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* An interface that allows async iterable iteration both to completion and by page.
|
|
22
|
+
*/
|
|
23
|
+
export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings> {
|
|
24
|
+
/**
|
|
25
|
+
* The next method, part of the iteration protocol
|
|
26
|
+
*/
|
|
27
|
+
next(): Promise<IteratorResult<TElement>>;
|
|
28
|
+
/**
|
|
29
|
+
* The connection to the async iterator, part of the iteration protocol
|
|
30
|
+
*/
|
|
31
|
+
[Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
32
|
+
/**
|
|
33
|
+
* Return an AsyncIterableIterator that works a page at a time
|
|
34
|
+
*/
|
|
35
|
+
byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* An interface that describes how to communicate with the service.
|
|
39
|
+
*/
|
|
40
|
+
export interface PagedResult<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings> {
|
|
41
|
+
/**
|
|
42
|
+
* Link to the first page of results.
|
|
43
|
+
*/
|
|
44
|
+
firstPageLink?: string;
|
|
45
|
+
/**
|
|
46
|
+
* A method that returns a page of results.
|
|
47
|
+
*/
|
|
48
|
+
getPage: (pageLink?: string) => Promise<{
|
|
49
|
+
page: TPage;
|
|
50
|
+
nextPageLink?: string;
|
|
51
|
+
} | undefined>;
|
|
52
|
+
/**
|
|
53
|
+
* a function to implement the `byPage` method on the paged async iterator.
|
|
54
|
+
*/
|
|
55
|
+
byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
|
|
56
|
+
/**
|
|
57
|
+
* A function to extract elements from a page.
|
|
58
|
+
*/
|
|
59
|
+
toElements?: (page: TPage) => TElement[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Options for the paging helper
|
|
63
|
+
*/
|
|
64
|
+
export interface BuildPagedAsyncIteratorOptions {
|
|
65
|
+
itemName?: string;
|
|
66
|
+
nextLinkName?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Helper to paginate results in a generic way and return a PagedAsyncIterableIterator
|
|
70
|
+
*/
|
|
71
|
+
export declare function buildPagedAsyncIterator<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings, TResponse extends PathUncheckedResponse = PathUncheckedResponse>(client: Client, getInitialResponse: () => PromiseLike<TResponse>, processResponseBody: (result: TResponse) => PromiseLike<unknown>, expectedStatuses: string[], options?: BuildPagedAsyncIteratorOptions): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
72
|
+
//# sourceMappingURL=pagingHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagingHelpers.d.ts","sourceRoot":"","sources":["../../../src/static-helpers/pagingHelpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAmB,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGzF;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,QAAQ,EAAE,KAAK,GAAG,QAAQ,EAAE,IAAI,KAAK,GAAG;IAClE;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;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AY,GAAG,YAAY,EACjD,SAAS,SAAS,qBAAqB,GAAG,qBAAqB,EAE/D,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,MAAM,WAAW,CAAC,SAAS,CAAC,EAChD,mBAAmB,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,WAAW,CAAC,OAAO,CAAC,EAChE,gBAAgB,EAAE,MAAM,EAAE,EAC1B,OAAO,GAAE,8BAAmC,GAC3C,0BAA0B,CAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC,CA0B5D"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
|
|
4
|
+
import { createRestError } from "@azure-rest/core-client";
|
|
5
|
+
import { RestError } from "@azure/core-rest-pipeline";
|
|
6
|
+
/**
|
|
7
|
+
* Helper to paginate results in a generic way and return a PagedAsyncIterableIterator
|
|
8
|
+
*/
|
|
9
|
+
export function buildPagedAsyncIterator(client, getInitialResponse, processResponseBody, expectedStatuses, options = {}) {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const itemName = (_a = options.itemName) !== null && _a !== void 0 ? _a : "value";
|
|
12
|
+
const nextLinkName = (_b = options.nextLinkName) !== null && _b !== void 0 ? _b : "nextLink";
|
|
13
|
+
const pagedResult = {
|
|
14
|
+
getPage: async (pageLink) => {
|
|
15
|
+
const result = pageLink === undefined
|
|
16
|
+
? await getInitialResponse()
|
|
17
|
+
: await client.pathUnchecked(pageLink).get();
|
|
18
|
+
checkPagingRequest(result, expectedStatuses);
|
|
19
|
+
const results = await processResponseBody(result);
|
|
20
|
+
const nextLink = getNextLink(results, nextLinkName);
|
|
21
|
+
const values = getElements(results, itemName);
|
|
22
|
+
return {
|
|
23
|
+
page: values,
|
|
24
|
+
nextPageLink: nextLink,
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
byPage: (settings) => {
|
|
28
|
+
const { continuationToken } = settings !== null && settings !== void 0 ? settings : {};
|
|
29
|
+
return getPageAsyncIterator(pagedResult, {
|
|
30
|
+
pageLink: continuationToken,
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
return getPagedAsyncIterator(pagedResult);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* returns an async iterator that iterates over results. It also has a `byPage`
|
|
38
|
+
* method that returns pages of items at once.
|
|
39
|
+
*
|
|
40
|
+
* @param pagedResult - an object that specifies how to get pages.
|
|
41
|
+
* @returns a paged async iterator that iterates over results.
|
|
42
|
+
*/
|
|
43
|
+
function getPagedAsyncIterator(pagedResult) {
|
|
44
|
+
var _a;
|
|
45
|
+
const iter = getItemAsyncIterator(pagedResult);
|
|
46
|
+
return {
|
|
47
|
+
next() {
|
|
48
|
+
return iter.next();
|
|
49
|
+
},
|
|
50
|
+
[Symbol.asyncIterator]() {
|
|
51
|
+
return this;
|
|
52
|
+
},
|
|
53
|
+
byPage: (_a = pagedResult === null || pagedResult === void 0 ? void 0 : pagedResult.byPage) !== null && _a !== void 0 ? _a : ((settings) => {
|
|
54
|
+
const { continuationToken } = settings !== null && settings !== void 0 ? settings : {};
|
|
55
|
+
return getPageAsyncIterator(pagedResult, {
|
|
56
|
+
pageLink: continuationToken,
|
|
57
|
+
});
|
|
58
|
+
}),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function getItemAsyncIterator(pagedResult) {
|
|
62
|
+
return __asyncGenerator(this, arguments, function* getItemAsyncIterator_1() {
|
|
63
|
+
var _a, e_1, _b, _c;
|
|
64
|
+
const pages = getPageAsyncIterator(pagedResult);
|
|
65
|
+
try {
|
|
66
|
+
for (var _d = true, pages_1 = __asyncValues(pages), pages_1_1; pages_1_1 = yield __await(pages_1.next()), _a = pages_1_1.done, !_a; _d = true) {
|
|
67
|
+
_c = pages_1_1.value;
|
|
68
|
+
_d = false;
|
|
69
|
+
const page = _c;
|
|
70
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
74
|
+
finally {
|
|
75
|
+
try {
|
|
76
|
+
if (!_d && !_a && (_b = pages_1.return)) yield __await(_b.call(pages_1));
|
|
77
|
+
}
|
|
78
|
+
finally { if (e_1) throw e_1.error; }
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function getPageAsyncIterator(pagedResult_1) {
|
|
83
|
+
return __asyncGenerator(this, arguments, function* getPageAsyncIterator_1(pagedResult, options = {}) {
|
|
84
|
+
const { pageLink } = options;
|
|
85
|
+
let response = yield __await(pagedResult.getPage(pageLink !== null && pageLink !== void 0 ? pageLink : pagedResult.firstPageLink));
|
|
86
|
+
if (!response) {
|
|
87
|
+
return yield __await(void 0);
|
|
88
|
+
}
|
|
89
|
+
let result = response.page;
|
|
90
|
+
result.continuationToken = response.nextPageLink;
|
|
91
|
+
yield yield __await(result);
|
|
92
|
+
while (response.nextPageLink) {
|
|
93
|
+
response = yield __await(pagedResult.getPage(response.nextPageLink));
|
|
94
|
+
if (!response) {
|
|
95
|
+
return yield __await(void 0);
|
|
96
|
+
}
|
|
97
|
+
result = response.page;
|
|
98
|
+
result.continuationToken = response.nextPageLink;
|
|
99
|
+
yield yield __await(result);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Gets for the value of nextLink in the body
|
|
105
|
+
*/
|
|
106
|
+
function getNextLink(body, nextLinkName) {
|
|
107
|
+
if (!nextLinkName) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
const nextLink = body[nextLinkName];
|
|
111
|
+
if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) {
|
|
112
|
+
throw new RestError(`Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`);
|
|
113
|
+
}
|
|
114
|
+
if (nextLink === null) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
return nextLink;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Gets the elements of the current request in the body.
|
|
121
|
+
*/
|
|
122
|
+
function getElements(body, itemName) {
|
|
123
|
+
const value = body[itemName];
|
|
124
|
+
if (!Array.isArray(value)) {
|
|
125
|
+
throw new RestError(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
|
|
126
|
+
}
|
|
127
|
+
return value !== null && value !== void 0 ? value : [];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Checks if a request failed
|
|
131
|
+
*/
|
|
132
|
+
function checkPagingRequest(response, expectedStatuses) {
|
|
133
|
+
if (!expectedStatuses.includes(response.status)) {
|
|
134
|
+
throw createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=pagingHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/pagingHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAU,eAAe,EAAyB,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AA+EtD;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAMrC,MAAc,EACd,kBAAgD,EAChD,mBAAgE,EAChE,gBAA0B,EAC1B,UAA0C,EAAE;;IAE5C,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC;IAC7C,MAAM,YAAY,GAAG,MAAA,OAAO,CAAC,YAAY,mCAAI,UAAU,CAAC;IACxD,MAAM,WAAW,GAAgD;QAC/D,OAAO,EAAE,KAAK,EAAE,QAAiB,EAAE,EAAE;YACnC,MAAM,MAAM,GACV,QAAQ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ACH,CAAC;CAAA;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,IAAa,EAAE,YAAqB;IACvD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,QAAQ,GAAI,IAAgC,CAAC,YAAY,CAAC,CAAC;IAEjE,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACzF,MAAM,IAAI,SAAS,CACjB,iBAAiB,YAAY,oDAAoD,OAAO,QAAQ,EAAE,CACnG,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAc,IAAa,EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IACjE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,SAAS,CACjB,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B,EAAE,gBAA0B;IACrF,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Client, createRestError, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\n\n/**\n * Options for the byPage method\n */\nexport interface PageSettings {\n /**\n * A reference to a specific page to start iterating from.\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that describes a page of results.\n */\nexport type ContinuablePage<TElement, TPage = TElement[]> = TPage & {\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 extends PageSettings = 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<ContinuablePage<TElement, TPage>>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\nexport interface PagedResult<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * Link to the first page of results.\n */\n firstPageLink?: string;\n /**\n * A method that returns a page of results.\n */\n getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => TElement[];\n}\n\n/**\n * Options for the paging helper\n */\nexport interface BuildPagedAsyncIteratorOptions {\n itemName?: string;\n nextLinkName?: string;\n}\n\n/**\n * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator\n */\nexport function buildPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n>(\n client: Client,\n getInitialResponse: () => PromiseLike<TResponse>,\n processResponseBody: (result: TResponse) => PromiseLike<unknown>,\n expectedStatuses: string[],\n options: BuildPagedAsyncIteratorOptions = {},\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const itemName = options.itemName ?? \"value\";\n const nextLinkName = options.nextLinkName ?? \"nextLink\";\n const pagedResult: PagedResult<TElement, TPage, TPageSettings> = {\n getPage: async (pageLink?: string) => {\n const result =\n pageLink === undefined\n ? await getInitialResponse()\n : await client.pathUnchecked(pageLink).get();\n checkPagingRequest(result, expectedStatuses);\n const results = await processResponseBody(result as TResponse);\n const nextLink = getNextLink(results, nextLinkName);\n const values = getElements<TElement>(results, itemName) as TPage;\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n byPage: (settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n },\n };\n return getPagedAsyncIterator(pagedResult);\n}\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 */\n\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, 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?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n }),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n for await (const page of pages) {\n yield* page as unknown as TElement[];\n }\n}\n\nasync function* getPageAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n options: {\n pageLink?: string;\n } = {},\n): AsyncIterableIterator<ContinuablePage<TElement, TPage>> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);\n if (!response) {\n return;\n }\n let result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n }\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\" && nextLink !== null) {\n throw new RestError(\n `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`,\n );\n }\n\n if (nextLink === null) {\n return 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 if (!Array.isArray(value)) {\n throw new RestError(\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, expectedStatuses: string[]): void {\n if (!expectedStatuses.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PollerLike, OperationState, ResourceLocationConfig } from "@azure/core-lro";
|
|
2
|
+
import { Client, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
3
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
4
|
+
export interface GetLongRunningPollerOptions<TResponse> {
|
|
5
|
+
/** Delay to wait until next poll, in milliseconds. */
|
|
6
|
+
updateIntervalInMs?: number;
|
|
7
|
+
/**
|
|
8
|
+
* The signal which can be used to abort requests.
|
|
9
|
+
*/
|
|
10
|
+
abortSignal?: AbortSignalLike;
|
|
11
|
+
/**
|
|
12
|
+
* The potential location of the result of the LRO if specified by the LRO extension in the swagger.
|
|
13
|
+
*/
|
|
14
|
+
resourceLocationConfig?: ResourceLocationConfig;
|
|
15
|
+
/**
|
|
16
|
+
* The original url of the LRO
|
|
17
|
+
* Should not be null when restoreFrom is set
|
|
18
|
+
*/
|
|
19
|
+
initialRequestUrl?: string;
|
|
20
|
+
/**
|
|
21
|
+
* A serialized poller which can be used to resume an existing paused Long-Running-Operation.
|
|
22
|
+
*/
|
|
23
|
+
restoreFrom?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The function to get the initial response
|
|
26
|
+
*/
|
|
27
|
+
getInitialResponse?: () => PromiseLike<TResponse>;
|
|
28
|
+
}
|
|
29
|
+
export declare function getLongRunningPoller<TResponse extends PathUncheckedResponse, TResult = void>(client: Client, processResponseBody: (result: TResponse) => Promise<TResult>, expectedStatuses: string[], options: GetLongRunningPollerOptions<TResponse>): PollerLike<OperationState<TResult>, TResult>;
|
|
30
|
+
//# sourceMappingURL=pollingHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pollingHelpers.d.ts","sourceRoot":"","sources":["../../../src/static-helpers/pollingHelpers.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EACV,cAAc,EACd,sBAAsB,EAIvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAmB,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,WAAW,2BAA2B,CAAC,SAAS;IACpD,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;OAEG;IACH,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAChD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,WAAW,CAAC,SAAS,CAAC,CAAC;CACnD;AACD,wBAAgB,oBAAoB,CAAC,SAAS,SAAS,qBAAqB,EAAE,OAAO,GAAG,IAAI,EAC1F,MAAM,EAAE,MAAM,EACd,mBAAmB,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC,OAAO,CAAC,EAC5D,gBAAgB,EAAE,MAAM,EAAE,EAC1B,OAAO,EAAE,2BAA2B,CAAC,SAAS,CAAC,GAC9C,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAyD9C"}
|