azureauth 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # node-azureauth
2
+
3
+ This package wraps the https://github.com/AzureAD/microsoft-authentication-cli with a node.js exec wrapper.
4
+
5
+ That way the `azureauth` CLI can be downloaded automatically, and therefore scoped to the `./node_modules/.bin` allowing for multiple versions of the AzureAuth CLI
6
+ to exist on one machine at once.
7
+
8
+ ## Usage
9
+
10
+ Install the package wiwth
11
+
12
+ ```bash
13
+ > npm i azureauth
14
+ ```
15
+
16
+ Use the `azureauth` CLI by calling it from NPM scripts.
17
+
18
+ ```json
19
+ "scripts": {
20
+ "authcli": "azureauth --version"
21
+ }
22
+ ```
23
+
24
+ ```bash
25
+ > npm run authcli
26
+ ```
27
+
28
+ Use it as a node module by importing azureauth.
29
+
30
+ ```js
31
+ import { adoPat } from "azureauth";
32
+
33
+ const pat = await adoPat({
34
+ displayName: "test",
35
+ organization: "test",
36
+ promptHint: "test",
37
+ scope: ["test"],
38
+ });
39
+ ```
@@ -0,0 +1,14 @@
1
+ import { adoPat } from "../lib/index.js";
2
+
3
+ const name = "feed-name";
4
+
5
+ const pat = await adoPat({
6
+ promptHint: `${name} .npmrc PAT`,
7
+ organization: "your-organization-name-here",
8
+ displayName: `${name}-npmrc-pat`,
9
+ scope: ["vso.packaging"],
10
+ timeout: "30",
11
+ output: "json",
12
+ });
13
+
14
+ console.log(pat);
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/azureauthcommand.ts","../node_modules/execa/index.d.ts","../src/pat.ts","../src/index.ts","../node_modules/@vitest/utils/dist/types.d.ts","../node_modules/@vitest/utils/dist/helpers.d.ts","../node_modules/@sinclair/typebox/typebox.d.ts","../node_modules/@jest/schemas/build/index.d.ts","../node_modules/pretty-format/build/index.d.ts","../node_modules/@vitest/utils/dist/index.d.ts","../node_modules/@vitest/runner/dist/tasks-abce80cc.d.ts","../node_modules/@vitest/runner/dist/types.d.ts","../node_modules/@vitest/runner/dist/index.d.ts","../node_modules/@vitest/snapshot/dist/environment-38cdead3.d.ts","../node_modules/@vitest/snapshot/dist/index-6461367c.d.ts","../node_modules/@vitest/snapshot/dist/index.d.ts","../node_modules/@types/chai/index.d.ts","../node_modules/@vitest/utils/dist/diff.d.ts","../node_modules/@vitest/utils/diff.d.ts","../node_modules/@vitest/expect/dist/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/esbuild/lib/main.d.ts","../node_modules/vite/types/metadata.d.ts","../node_modules/vite/types/hmrpayload.d.ts","../node_modules/vite/types/customevent.d.ts","../node_modules/rollup/dist/rollup.d.ts","../node_modules/vite/types/importglob.d.ts","../node_modules/source-map-js/source-map.d.ts","../node_modules/postcss/lib/previous-map.d.ts","../node_modules/postcss/lib/input.d.ts","../node_modules/postcss/lib/css-syntax-error.d.ts","../node_modules/postcss/lib/declaration.d.ts","../node_modules/postcss/lib/root.d.ts","../node_modules/postcss/lib/warning.d.ts","../node_modules/postcss/lib/lazy-result.d.ts","../node_modules/postcss/lib/no-work-result.d.ts","../node_modules/postcss/lib/processor.d.ts","../node_modules/postcss/lib/result.d.ts","../node_modules/postcss/lib/document.d.ts","../node_modules/postcss/lib/rule.d.ts","../node_modules/postcss/lib/node.d.ts","../node_modules/postcss/lib/comment.d.ts","../node_modules/postcss/lib/container.d.ts","../node_modules/postcss/lib/at-rule.d.ts","../node_modules/postcss/lib/list.d.ts","../node_modules/postcss/lib/postcss.d.ts","../node_modules/vite/dist/node/index.d.ts","../node_modules/vite/types/hot.d.ts","../node_modules/vite-node/dist/types.d-7442d07f.d.ts","../node_modules/vite-node/dist/types-e8623e9c.d.ts","../node_modules/vite-node/dist/index.d.ts","../node_modules/@vitest/runner/dist/utils.d.ts","../node_modules/@vitest/runner/utils.d.ts","../node_modules/tinybench/dist/index.d.ts","../node_modules/vite-node/dist/client.d.ts","../node_modules/@vitest/snapshot/dist/manager.d.ts","../node_modules/@vitest/snapshot/manager.d.ts","../node_modules/vite-node/dist/server.d.ts","../node_modules/vitest/dist/types-3c7dbfa5.d.ts","../node_modules/tinyspy/dist/index.d.ts","../node_modules/@vitest/spy/dist/index.d.ts","../node_modules/@vitest/snapshot/dist/environment.d.ts","../node_modules/@vitest/snapshot/environment.d.ts","../node_modules/vitest/dist/config.d.ts","../node_modules/vitest/dist/index.d.ts","../src/pat.test.ts","../node_modules/@types/chai-subset/index.d.ts"],"fileInfos":[{"version":"f59215c5f1d886b05395ee7aca73e0ac69ddfad2843aa88530e797879d511bad","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"3dda5344576193a4ae48b8d03f105c86f20b2f2aff0a1d1fd7935f5d68649654","affectsGlobalScope":true},{"version":"9d9885c728913c1d16e0d2831b40341d6ad9a0ceecaabc55209b306ad9c736a5","affectsGlobalScope":true},{"version":"17bea081b9c0541f39dd1ae9bc8c78bdd561879a682e60e2f25f688c0ecab248","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"f06948deb2a51aae25184561c9640fb66afeddb34531a9212d011792b1d19e0a","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"72b3e2515cd7ab4e9cf2480bb878c1d81f0f97506f5c79c391943e4e834acb3a","signature":"37592db11ccfa8e0dccb0762d138bcc73be92fba63dc13d6888c63adf61f863d"},"3521d628608a950d73ab0551183c301364f3604f7813e0704d271f4463c4dbb9",{"version":"25b41be519da2d3295a8961cc23278ffc43f4ed7fb0b16b67b1db248c056a56b","signature":"7697cebe89f5844986ae3c2416e31ea2fc7bf22ba20b23a95dea26e5694508d1"},{"version":"b43878830aafa77a7818544e949896874d58c9ad459c73fd89c626edada081ff","signature":"0d37be08cd27aa4c649eea3a407ff84f05d16fa80d9789371336acc20eeb9d52"},"19ce9ec982b542ef6d04d29ce678aad2fa52a67d8087e9c6cd95a4d6d98784c8","75d3b70589f5e14016a629feef0cd8deb55cab794e8c14bdbd5794c3b08a957e","c085e9aa62d1ae1375794c1fb927a445fa105fed891a7e24edbb1c3300f7384a","f315e1e65a1f80992f0509e84e4ae2df15ecd9ef73df975f7c98813b71e4c8da","5b9586e9b0b6322e5bfbd2c29bd3b8e21ab9d871f82346cb71020e3d84bae73e","64c9980a5c0f4627b7189eeece6816bb68e1c5c62a06d59ce6742f3328cfe854","acf1068cf9f861280669578ced81d6f6701609b6e8c46c983fd1c3b62ca1c129","5599d7a8727ecc5c463176c284c76b4a93ed79df3cc617548998d2d5c4b57c12","866223f4c6921da309cafb3441ff835d787ab52747825e2371b404458b1bd7b9","73b67d2e87ac7d7baaca64ca33fd1523c0b3c850cb7db5b9c014f1be7996bed1","5d5ae61fce1581fd6424269790a9071e3f8e69b029f5d0fcb46ce618c5dbc565","38a0ccc7106312a9f60e034e7cd8ac218774d8aa65f832cee3363a7e65f99325",{"version":"c3bc5d095c3c22fd20b5a6550b9c9a6d56c3ffbb87ef057ccce7764b6bed4428","affectsGlobalScope":true},"bff48cd8ff6b53727de810bd00a11e04975b1bc9c7677f3fe839159565ad1546","05c7aef6a4e496b93c2e682cced8903c0dfe6340d04f3fe616176e2782193435",{"version":"47c8c25482eb4844ac9c11758f9a6c0112ecb1c7216f91e3463772e73f989a63","affectsGlobalScope":true},"587f13f1e8157bd8cec0adda0de4ef558bb8573daa9d518d1e2af38e87ecc91f","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"d32f90e6cf32e99c86009b5f79fa50bc750fe54e17137d9bb029c377a2822ee2","affectsGlobalScope":true},"7a435e0c814f58f23e9a0979045ec0ef5909aac95a70986e8bcce30c27dff228",{"version":"c81c51f43e343b6d89114b17341fb9d381c4ccbb25e0ee77532376052c801ba7","affectsGlobalScope":true},"3dd49afd822c82b63b3905a13e22240f34cf367aea4f4dd0e6564f4bddcb8370","57135ce61976a8b1dadd01bb412406d1805b90db6e8ecb726d0d78e0b5f76050",{"version":"49479e21a040c0177d1b1bc05a124c0383df7a08a0726ad4d9457619642e875a","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","f302f3a47d7758f67f2afc753b9375d6504dde05d2e6ecdb1df50abbb131fc89","93db4c949a785a3dbef7f5e08523be538e468c580dd276178b818e761b3b68cd","5b1c0a23f464f894e7c2b2b6c56df7b9afa60ed48c5345f8618d389a636b2108","be2b092f2765222757c6441b86c53a5ea8dfed47bbc43eab4c5fe37942c866b3","8e6b05abc98adba15e1ac78e137c64576c74002e301d682e66feb77a23907ab8","1ca735bb3d407b2af4fbee7665f3a0a83be52168c728cc209755060ba7ed67bd",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"6e335a70826a634c5a1a1fa36a2dacbf3712ef2be7a517540ae1de8a1e8ea4f6","affectsGlobalScope":true},"7a2ba0c9af860ac3e77b35ed01fd96d15986f17aa22fe40f188ae556fb1070df","df8529626079d6f9d5d3cd7b6fb7db9cda5a3118d383d8cd46c52aadb59593e7","55709608060f77965c270ac10ac646286589f1bd1cb174fff1778a2dd9a7ef31","3122a3f1136508a27a229e0e4e2848299028300ffa11d0cdfe99df90c492fe20","42b40e40f2a358cda332456214fad311e1806a6abf3cebaaac72496e07556642","354612fe1d49ecc9551ea3a27d94eef2887b64ef4a71f72ca444efe0f2f0ba80",{"version":"ac0c77cd7db52b3c278bdd1452ce754014835493d05b84535f46854fdc2063b2","affectsGlobalScope":true},"fe6dba0e8c69f2b244e3da38e53dd2cc9e51b2543e647e805396af73006613f7","5e2b91328a540a0933ab5c2203f4358918e6f0fe7505d22840a891a6117735f1","3abc3512fa04aa0230f59ea1019311fd8667bd935d28306311dccc8b17e79d5d",{"version":"5810080a0da989a944d3b691b7b479a4a13c75947fb538abb8070710baa5ccee","affectsGlobalScope":true},{"version":"19da7150ca062323b1db6311a6ef058c9b0a39cc64d836b5e9b75d301869653b","affectsGlobalScope":true},"1349077576abb41f0e9c78ec30762ff75b710208aff77f5fdcc6a8c8ce6289dd","e2ce82603102b5c0563f59fb40314cc1ff95a4d521a66ad14146e130ea80d89c","a3e0395220255a350aa9c6d56f882bfcb5b85c19fddf5419ec822cf22246a26d","c27b01e8ddff5cd280711af5e13aecd9a3228d1c256ea797dd64f8fdec5f7df5","898840e876dfd21843db9f2aa6ae38ba2eab550eb780ff62b894b9fbfebfae6b","8bbe7e6c5844e38754c041b52e3d90f7bbd5a0d60739daf30805c92e4f0c65c6","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","785e5be57d4f20f290a20e7b0c6263f6c57fd6e51283050756cef07d6d651c68","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","164deb2409ac5f4da3cd139dbcee7f7d66753d90363a4d7e2db8d8874f272270",{"version":"99822adc2defda34dc1b28b727577ec7c098d878d713157dbe90d212c6bf5e58","affectsGlobalScope":true},{"version":"8a985c7d30aea82342d5017730b546bb2b734fe37a2684ca55d4734deb019d58","affectsGlobalScope":true},"ad08154d9602429522cac965a715fde27d421d69b24756c5d291877dda75353e","5bc85813bfcb6907cc3a960fec8734a29d7884e0e372515147720c5991b8bc22","812b25f798033c202baedf386a1ccc41f9191b122f089bffd10fdccce99fba11","993325544790073f77e945bee046d53988c0bc3ac5695c9cf8098166feb82661",{"version":"4d06f3abc2a6aae86f1be39e397372f74fb6e7964f594d645926b4a3419cc15d","affectsGlobalScope":true},{"version":"0e08c360c9b5961ecb0537b703e253842b3ded53151ee07024148219b61a8baf","affectsGlobalScope":true},"2ce2210032ccaff7710e2abf6a722e62c54960458e73e356b6a365c93ab6ca66","92db194ef7d208d5e4b6242a3434573fd142a621ff996d84cc9dbba3553277d0","16a3080e885ed52d4017c902227a8d0d8daf723d062bec9e45627c6fdcd6699b",{"version":"0bd9543cd8fc0959c76fb8f4f5a26626c2ed62ef4be98fd857bce268066db0a2","affectsGlobalScope":true},"1ca6858a0cbcd74d7db72d7b14c5360a928d1d16748a55ecfa6bfaff8b83071b",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"4905d61a3e1e9b12e12dbf8660fc8d2f085734da6da8d725f395bf41a04853d6","850040826cfa77593d44f44487133af21917f4f21507258bd4269501b80d32f0","8f07f2b6514744ac96e51d7cb8518c0f4de319471237ea10cf688b8d0e9d0225","bcb6ea18f23dae2c48459d7b86d3adccd6898f824fcbf9da08b935f559896580","1363ba7d52f2353d0c4306d0ecdaf171bf4509c0148842f9fd8d3986c098a2eb","11e1ca6d427a2d9472ca610ef12698684e2809ca463c5518cc9f883e96288caf","739c2c46edc112421fc023c24b4898b1f413f792bb6a02b40ba182c648e56c2f","858d0d831826c6eb563df02f7db71c90e26deadd0938652096bea3cc14899700","8885cf05f3e2abf117590bbb951dcf6359e3e5ac462af1c901cfd24c6a6472e2","e4de16da5082cd440c0e19bcf219c5c4a7f3c3104d97db3bb6ee5b9c2a9a1bdd","5e92a2e8ba5cbcdfd9e51428f94f7bd0ab6e45c9805b1c9552b64abaffad3ce3","53ca39fe70232633759dd3006fc5f467ecda540252c0c819ab53e9f6ad97b226","e7174a839d4732630d904a8b488f22380e5bcf1d6405d1f59614e10795eca17d","7ec359bbc29b69d4063fe7dad0baaf35f1856f914db16b3f4f6e3e1bca4099fa","1fa3342736ff551848cdcd8edeece95b2016448364b3e9ad1cb70e86e28f42a1","5ca9f5cc0104446228a0c6c1f353d49a9b92d40fa7096479595d62061e8279c9","4c1eed2b08adb0d98eb9551d426c43e3426282aa544559d30e05e5998e46321b","436598e80d4957d007b84bd7255394057848ab310895e2dcaebc5debb932fdbc","74f2815d9e1b8530120dcad409ed5f706df8513c4d93e99fc6213997aa4dd60e","9d1f36ccd354f2e286b909bf01d626a3a28dd6590770303a18afa7796fe50db9","c4bc6a572f9d763ac7fa0d839be3de80273a67660e2002e3225e00ef716b4f37","106e607866d6c3e9a497a696ac949c3e2ec46b6e7dda35aabe76100bf740833b","83e9c7cbe3bc85e21727c77eb6fe91c44d2076c6458729ff137eb95feebc2c10","d4514d11e7d11c53da7d43b948654d6e608a3d93d666a36f8d01e18ece04c9bd","3d65182eff7bbb16de1a69e17651c51083f740af11a1a92359be6dab939e8bcf","78537f1b16692afdddef1b5c8981cea4a1be030eaca482bd5566b44cffa5192b","5af924defa85825aa63f023b562727d5bc7f91e71363e3f7ae24392bede17066","4d5fb5d6b35f731b2ae4d9d7c592d48e91d6de531dd130628edf4eba16add893","d12ab69ace581804d4f264eabc71094ca8dadfa70ae2bf5ccd54a8d6105ab84b","d757ef86e18b87094ad733c2a1ed7acc21878f5feb931bea64643f40a84e688c","6cb8dc4e3d4357c8badd567bd090aceedcd0d2afa4987f46471ba602956af034","8b0943864dafdf38b7c8cfbc736c04c5e65653837d85177aebde0732f34be8be","e666e31d323fef5642f87db0da48a83e58f0aaf9e3823e87eabd8ec7e0441a36","caeae351358d6c5b8da971c4ba7973987cbbbe4766081d07394e51c5544c8727","a23dd1a2177fda8e2d0e79874f4a150353d10e60ea3e9c690d7ca05b4775e542","e72396ce544667ab49df38ffb91cb3f80ff17d2ad3df903ec30b1d2ca8ea68de","b7e28e06011460436d5c2ec2996846ac0c451e135357fc5a7269e5665a32fbd7","647550b021976e287be83dd5c1a0919d2d99c47ffc470c80880f670ca4f395ab","d979524749bd1873e4e7a63b9551381711855a1bd5fc4be394b64568de6adc6d","9a82b3cd322d6b46c2407c162bbfd0b13edc9d23dced719a751a481b985690a0","13446337b269b3a8fdac668f9cf831b313529aea23f26621ecf5097c3e53bb25","f63e23230f3960b712450cf08f0f31e56acdae3ce65e0bf31bfdd6442b29d115","f2d1a59a658165341b0e2b7879aa2e19ea6a709146b2d3f70ee8a07159d3d08e","46e1ed17157235f8bf123517f691d1f93c6bffda998f6cd9fee470f2968b58c9","ba88974db5ce05013d08e521d5d1c2266ed5bfafac02763d18e15b3ced925c88",{"version":"95e4683d875e99cb5a0a4d6d7a2d5ccf19780d0ec6fe6771d8fe1b7512f9fc50","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"f4c0db3a49cea9babd5d224ba14243a6a6119bf65a65198994033aaea3a60a71","affectsGlobalScope":true}],"root":[45,47,48,163],"options":{"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"jsx":2,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../src","sourceMap":true,"strict":true,"target":6,"tsBuildInfoFile":"./.tsbuildinfo"},"fileIdsList":[[51,111],[111],[61,111],[65,111],[68,111],[69,74,102,111],[70,81,82,89,99,110,111],[70,71,81,89,111],[72,111],[73,74,82,90,111],[74,99,107,111],[75,77,81,89,111],[76,111],[77,78,111],[81,111],[79,81,111],[81,82,83,99,110,111],[81,82,83,96,99,102,111],[111,115],[77,81,84,89,99,110,111],[81,82,84,85,89,99,107,110,111],[84,86,99,107,110,111],[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117],[81,87,111],[88,110,111],[77,81,89,99,111],[90,111],[91,111],[68,92,111],[93,109,111,115],[94,111],[95,111],[81,96,97,111],[96,98,111,113],[69,81,99,100,101,102,111],[69,99,101,111],[99,100,111],[102,111],[103,111],[68,99,111],[81,105,106,111],[105,106,111],[74,89,99,107,111],[108,111],[89,109,111],[69,84,95,110,111],[74,111],[99,111,112],[111,113],[111,114],[69,74,81,83,92,99,110,111,113,115],[99,111,116],[54,61,63,111],[54,55,56,111],[54,111],[54,55,111],[111,149],[58,111],[53,58,111],[53,58,59,111],[111,159],[111,153],[111,157],[62,111],[53,111],[49,111],[49,50,53,111],[69,70,99,111],[111,140],[111,138,140],[111,129,137,138,139,141],[111,127],[111,130,135,140,143],[111,126,143],[111,130,131,134,135,143],[111,130,131,132,134,135,143],[111,127,128,129,130,131,135,136,137,139,140,141,143],[111,125,127,128,129,130,131,132,134,135,136,137,138,139,140,141,142],[111,125,143],[111,130,132,133,135,143],[111,134,143],[111,135,136,140,143],[111,128,138],[52,111],[111,125],[111,145,146,147],[111,144,145,146,147,156],[111,145,146],[81,82,84,86,89,99,107,110,111,116,118,119,120,121,122,123,124,143],[111,121],[111,122],[111,123],[54,57,60,61,64,82,111,115,120,123,144,148,150,151,152,154,155,156],[54,57,60,61,64,82,111,115,120,123,144,148,150,151,152,154,155,156,158,160,161],[91,93,111],[47,111],[47,111,162],[45,46,111],[47]],"referencedMap":[[52,1],[51,2],[164,3],[61,2],[65,4],[66,4],[68,5],[69,6],[70,7],[71,8],[72,9],[73,10],[74,11],[75,12],[76,13],[77,14],[78,14],[80,15],[79,16],[81,15],[82,17],[83,18],[67,19],[117,2],[84,20],[85,21],[86,22],[118,23],[87,24],[88,25],[89,26],[90,27],[91,28],[92,29],[93,30],[94,31],[95,32],[96,33],[97,33],[98,34],[99,35],[101,36],[100,37],[102,38],[103,39],[104,40],[105,41],[106,42],[107,43],[108,44],[109,45],[110,46],[111,47],[112,48],[113,49],[114,50],[115,51],[116,52],[64,53],[57,54],[55,55],[56,56],[149,56],[150,57],[58,2],[159,58],[59,59],[60,60],[153,60],[160,61],[154,62],[158,63],[63,64],[62,65],[50,66],[54,67],[49,2],[119,2],[46,68],[141,69],[139,70],[140,71],[128,72],[129,70],[136,73],[127,74],[132,75],[142,2],[133,76],[138,77],[143,78],[126,79],[134,80],[135,81],[130,82],[137,69],[131,83],[53,84],[123,2],[125,85],[151,2],[157,2],[43,2],[44,2],[8,2],[10,2],[9,2],[2,2],[11,2],[12,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[3,2],[4,2],[22,2],[19,2],[20,2],[21,2],[23,2],[24,2],[25,2],[5,2],[26,2],[27,2],[28,2],[29,2],[6,2],[33,2],[30,2],[31,2],[32,2],[34,2],[7,2],[35,2],[40,2],[41,2],[36,2],[37,2],[38,2],[39,2],[1,2],[42,2],[152,86],[148,86],[155,87],[147,88],[146,2],[144,89],[122,90],[121,2],[145,91],[124,2],[120,92],[161,93],[162,94],[156,93],[45,95],[48,96],[163,97],[47,98]],"exportedModulesMap":[[52,1],[51,2],[164,3],[61,2],[65,4],[66,4],[68,5],[69,6],[70,7],[71,8],[72,9],[73,10],[74,11],[75,12],[76,13],[77,14],[78,14],[80,15],[79,16],[81,15],[82,17],[83,18],[67,19],[117,2],[84,20],[85,21],[86,22],[118,23],[87,24],[88,25],[89,26],[90,27],[91,28],[92,29],[93,30],[94,31],[95,32],[96,33],[97,33],[98,34],[99,35],[101,36],[100,37],[102,38],[103,39],[104,40],[105,41],[106,42],[107,43],[108,44],[109,45],[110,46],[111,47],[112,48],[113,49],[114,50],[115,51],[116,52],[64,53],[57,54],[55,55],[56,56],[149,56],[150,57],[58,2],[159,58],[59,59],[60,60],[153,60],[160,61],[154,62],[158,63],[63,64],[62,65],[50,66],[54,67],[49,2],[119,2],[46,68],[141,69],[139,70],[140,71],[128,72],[129,70],[136,73],[127,74],[132,75],[142,2],[133,76],[138,77],[143,78],[126,79],[134,80],[135,81],[130,82],[137,69],[131,83],[53,84],[123,2],[125,85],[151,2],[157,2],[43,2],[44,2],[8,2],[10,2],[9,2],[2,2],[11,2],[12,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[3,2],[4,2],[22,2],[19,2],[20,2],[21,2],[23,2],[24,2],[25,2],[5,2],[26,2],[27,2],[28,2],[29,2],[6,2],[33,2],[30,2],[31,2],[32,2],[34,2],[7,2],[35,2],[40,2],[41,2],[36,2],[37,2],[38,2],[39,2],[1,2],[42,2],[152,86],[148,86],[155,87],[147,88],[146,2],[144,89],[122,90],[121,2],[145,91],[124,2],[120,92],[161,93],[162,94],[156,93],[48,99]],"semanticDiagnosticsPerFile":[52,51,164,61,65,66,68,69,70,71,72,73,74,75,76,77,78,80,79,81,82,83,67,117,84,85,86,118,87,88,89,90,91,92,93,94,95,96,97,98,99,101,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,64,57,55,56,149,150,58,159,59,60,153,160,154,158,63,62,50,54,49,119,46,141,139,140,128,129,136,127,132,142,133,138,143,126,134,135,130,137,131,53,123,125,151,157,43,44,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,42,152,148,155,147,146,144,122,121,145,124,120,161,162,156,45,48,163,47],"latestChangedDtsFile":"./index.d.ts"},"version":"5.1.6"}
@@ -0,0 +1,2 @@
1
+ export declare const azureAuthCommand: () => string;
2
+ //# sourceMappingURL=azureAuthCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"azureAuthCommand.d.ts","sourceRoot":"","sources":["../src/azureAuthCommand.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,cAQ5B,CAAC"}
@@ -0,0 +1,11 @@
1
+ import path from "node:path";
2
+ import process from "node:process";
3
+ const __dirname = path.dirname(new URL(import.meta.url).pathname).substring(1);
4
+ export const azureAuthCommand = () => {
5
+ let azureauth = path.join(__dirname, "..", "bin", "azureauth", "azureauth");
6
+ if (process.platform === "win32") {
7
+ azureauth = azureauth + ".exe";
8
+ }
9
+ return azureauth;
10
+ };
11
+ //# sourceMappingURL=azureAuthCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"azureAuthCommand.js","sourceRoot":"","sources":["../src/azureAuthCommand.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,IAAI,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IAE5E,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;QAChC,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;KAChC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { run as adoPat } from "./pat.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { run as adoPat } from "./pat.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC"}
package/lib/pat.d.ts ADDED
@@ -0,0 +1,27 @@
1
+ export type AdoPatOptions = {
2
+ promptHint: string;
3
+ organization: string;
4
+ displayName: string;
5
+ scope: string[];
6
+ output?: string;
7
+ mode?: string;
8
+ domain?: string;
9
+ timeout?: string;
10
+ };
11
+ export type AdoPatResponse = {
12
+ displayName: string;
13
+ validTo: string;
14
+ scope: string[];
15
+ targetAccounts: string[];
16
+ validFrom: string;
17
+ authorizationId: string;
18
+ token: string;
19
+ };
20
+ export declare const args: (options: AdoPatOptions) => string[];
21
+ /**
22
+ * Wrapper for `azureauth ado pat`. Please run `azureauth ado pat --help` for full command options and description
23
+ * @param options Options for PAT generation
24
+ * @returns ADO PAT details
25
+ */
26
+ export declare const run: (options: AdoPatOptions) => Promise<AdoPatResponse | string>;
27
+ //# sourceMappingURL=pat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.d.ts","sourceRoot":"","sources":["../src/pat.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,IAAI,YAAa,aAAa,aA6B1C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,GAAG,YACL,aAAa,KACrB,QAAQ,cAAc,GAAG,MAAM,CAcjC,CAAC"}
package/lib/pat.js ADDED
@@ -0,0 +1,47 @@
1
+ import { execa } from "execa";
2
+ import { azureAuthCommand } from "./azureAuthCommand.js";
3
+ export const args = (options) => {
4
+ const args = [
5
+ "ado",
6
+ "pat",
7
+ `--prompt-hint "${options.promptHint}"`,
8
+ `--organization "${options.organization}"`,
9
+ `--display-name "${options.displayName}"`,
10
+ ...options.scope.map((scope) => `--scope ${scope}`),
11
+ ];
12
+ if (options.output) {
13
+ args.push(`--output ${options.output}`);
14
+ }
15
+ else {
16
+ args.push(`--output json`);
17
+ }
18
+ if (options.mode) {
19
+ args.push(`--mode "${options.mode}"`);
20
+ }
21
+ if (options.domain) {
22
+ args.push(`--domain "${options.domain}"`);
23
+ }
24
+ if (options.timeout) {
25
+ args.push(`--timeout ${options.timeout}`);
26
+ }
27
+ return args;
28
+ };
29
+ /**
30
+ * Wrapper for `azureauth ado pat`. Please run `azureauth ado pat --help` for full command options and description
31
+ * @param options Options for PAT generation
32
+ * @returns ADO PAT details
33
+ */
34
+ export const run = async (options) => {
35
+ const commandArgs = args(options);
36
+ try {
37
+ const result = await execa(azureAuthCommand(), commandArgs);
38
+ if (options.output === "json") {
39
+ return JSON.parse(result.stdout);
40
+ }
41
+ return result.stdout;
42
+ }
43
+ catch (error) {
44
+ throw new Error("Failed to get Ado Pat: " + error.message);
45
+ }
46
+ };
47
+ //# sourceMappingURL=pat.js.map
package/lib/pat.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.js","sourceRoot":"","sources":["../src/pat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAuBzD,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,OAAsB,EAAE,EAAE;IAC7C,MAAM,IAAI,GAAG;QACX,KAAK;QACL,KAAK;QACL,kBAAkB,OAAO,CAAC,UAAU,GAAG;QACvC,mBAAmB,OAAO,CAAC,YAAY,GAAG;QAC1C,mBAAmB,OAAO,CAAC,WAAW,GAAG;QACzC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,KAAK,EAAE,CAAC;KACpD,CAAC;IAEF,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,IAAI,CAAC,IAAI,CAAC,YAAY,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;KACzC;SAAM;QACL,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;KAC5B;IAED,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,WAAW,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC;KACvC;IAED,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,IAAI,CAAC,IAAI,CAAC,aAAa,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;KAC3C;IAED,IAAI,OAAO,CAAC,OAAO,EAAE;QACnB,IAAI,CAAC,IAAI,CAAC,aAAa,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;KAC3C;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,EACtB,OAAsB,EACY,EAAE;IACpC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAElC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,gBAAgB,EAAE,EAAE,WAAW,CAAC,CAAC;QAE5D,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE;YAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAmB,CAAC;SACpD;QAED,OAAO,MAAM,CAAC,MAAM,CAAC;KACtB;IAAC,OAAO,KAAU,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;KAC5D;AACH,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pat.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.test.d.ts","sourceRoot":"","sources":["../src/pat.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ import { run, args } from "./pat.js";
2
+ import { expect, test, vi } from "vitest";
3
+ test("adoPat", async () => {
4
+ vi.mock("execa", () => {
5
+ return {
6
+ execa: () => {
7
+ return Promise.resolve({
8
+ stdout: "test123",
9
+ });
10
+ },
11
+ };
12
+ });
13
+ const pat = await run({
14
+ displayName: "test",
15
+ organization: "test",
16
+ promptHint: "test",
17
+ scope: ["test"],
18
+ });
19
+ expect(pat).toBe("test123");
20
+ });
21
+ test("adoPat args", () => {
22
+ const commandArgs = args({
23
+ displayName: "test",
24
+ organization: "test",
25
+ promptHint: "test",
26
+ scope: ["test"],
27
+ });
28
+ expect(commandArgs).toEqual([
29
+ "ado",
30
+ "pat",
31
+ `--prompt-hint "test"`,
32
+ `--organization "test"`,
33
+ `--display-name "test"`,
34
+ `--scope "test"`,
35
+ `--output json`,
36
+ ]);
37
+ });
38
+ //# sourceMappingURL=pat.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.test.js","sourceRoot":"","sources":["../src/pat.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE1C,IAAI,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IACxB,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE;QACpB,OAAO;YACL,KAAK,EAAE,GAAG,EAAE;gBACV,OAAO,OAAO,CAAC,OAAO,CAAC;oBACrB,MAAM,EAAE,SAAS;iBAClB,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;QACpB,WAAW,EAAE,MAAM;QACnB,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,CAAC,MAAM,CAAC;KAChB,CAAC,CAAC;IAEH,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC9B,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE;IACvB,MAAM,WAAW,GAAG,IAAI,CAAC;QACvB,WAAW,EAAE,MAAM;QACnB,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,CAAC,MAAM,CAAC;KAChB,CAAC,CAAC;IAEH,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC;QAC1B,KAAK;QACL,KAAK;QACL,sBAAsB;QACtB,uBAAuB;QACvB,uBAAuB;QACvB,gBAAgB;QAChB,eAAe;KAChB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,20 +1,35 @@
1
1
  {
2
2
  "name": "azureauth",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "node-azure auth wrapps the AzureAuth CLI wrapper for performing AAD Authentication",
5
5
  "bin": {
6
6
  "azureauth": "./cli.js"
7
7
  },
8
8
  "type": "module",
9
9
  "scripts": {
10
+ "build": "tsc",
11
+ "start": "tsc --watch",
12
+ "test": "vitest src",
10
13
  "postinstall": "node ./scripts/install.js"
11
14
  },
12
- "keywords": ["node", "azureauth", "aad", "azure active directory", "authentication"],
15
+ "keywords": [
16
+ "node",
17
+ "azureauth",
18
+ "aad",
19
+ "azure active directory",
20
+ "authentication"
21
+ ],
13
22
  "author": "Jonathan Creamer",
14
23
  "license": "ISC",
15
24
  "dependencies": {
16
- "execa": "^7.2.0",
17
25
  "decompress": "^4.2.1",
26
+ "execa": "^7.2.0",
18
27
  "node-downloader-helper": "^2.1.9"
28
+ },
29
+ "devDependencies": {
30
+ "@types/node": "^20.5.0",
31
+ "typescript": "^5.1.6",
32
+ "vitest": "^0.34.1",
33
+ "vite": "^4.4.9"
19
34
  }
20
35
  }
@@ -85,25 +85,25 @@ export const install = async () => {
85
85
  arch in DOWNLOAD_MAP[platform]
86
86
  ? DOWNLOAD_MAP[platform][arch]
87
87
  : DOWNLOAD_MAP[platform].def;
88
-
89
- const url = `${AZUREAUTH_INFO.url}${AZUREAUTH_INFO.version}/${filename}`;
88
+
89
+ const url = `${AZUREAUTH_INFO.url}${AZUREAUTH_INFO.version}/${filename}`;
90
90
  const distPath = path.join(OUTPUT_DIR, "azureauth");
91
91
  const archivePath = path.join(OUTPUT_DIR, filename);
92
-
92
+
93
93
  console.log(`Downloading azureauth from ${url}`);
94
94
  await download(url, OUTPUT_DIR);
95
-
95
+
96
96
  console.log(`Downloaded in ${OUTPUT_DIR}`);
97
-
97
+
98
98
  // Make a dir to uncompress the zip or tar into
99
99
  fs.mkdirSync(distPath, {
100
100
  recursive: true,
101
101
  });
102
102
 
103
103
  const binaryPath = path.join(distPath, AZUREAUTH_NAME);
104
-
104
+
105
105
  await decompress(archivePath, distPath);
106
-
106
+
107
107
  if (fileExist(binaryPath)) {
108
108
  fs.chmodSync(binaryPath, fs.constants.S_IXUSR || 0o100);
109
109
  // Huan(202111): we need the read permission so that the build system can pack the node_modules/ folder,
@@ -116,4 +116,4 @@ export const install = async () => {
116
116
  }
117
117
  };
118
118
 
119
- await install();
119
+ await install();
package/tsconfig.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "ESNext",
4
+ "composite": true,
5
+ "target": "ES2019",
6
+ "rootDir": "src",
7
+ "outDir": "lib",
8
+ "incremental": true,
9
+ "tsBuildInfoFile": "lib/.tsbuildinfo",
10
+ "lib": ["ES2019", "dom"],
11
+ "jsx": "react",
12
+ "declaration": true,
13
+ "declarationMap": true,
14
+ "sourceMap": true,
15
+ "experimentalDecorators": true,
16
+ "moduleResolution": "node",
17
+ "strict": true,
18
+ "noFallthroughCasesInSwitch": true,
19
+ "noImplicitReturns": true,
20
+ "noUnusedLocals": true,
21
+ "noUnusedParameters": true,
22
+ "forceConsistentCasingInFileNames": true,
23
+ "importHelpers": true,
24
+ "esModuleInterop": true,
25
+ "downlevelIteration": true
26
+ },
27
+ "include": ["./src"],
28
+ "references": []
29
+ }