oauth-init 0.5.0 → 0.7.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/bun.lock +0 -104
- package/dist/index.js +288 -112
- package/package.json +1 -3
package/bun.lock
CHANGED
|
@@ -7,9 +7,7 @@
|
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@clack/prompts": "^1.0.1",
|
|
9
9
|
"@types/bun": "^1.3.9",
|
|
10
|
-
"chalk": "^5.3.0",
|
|
11
10
|
"execa": "^9.6.1",
|
|
12
|
-
"inquirer": "^9.2.12",
|
|
13
11
|
"open": "^11.0.0",
|
|
14
12
|
},
|
|
15
13
|
"devDependencies": {
|
|
@@ -22,10 +20,6 @@
|
|
|
22
20
|
|
|
23
21
|
"@clack/prompts": ["@clack/prompts@1.0.1", "", { "dependencies": { "@clack/core": "1.0.1", "picocolors": "^1.0.0", "sisteransi": "^1.0.5" } }, "sha512-/42G73JkuYdyWZ6m8d/CJtBrGl1Hegyc7Fy78m5Ob+jF85TOUmLR5XLce/U3LxYAw0kJ8CT5aI99RIvPHcGp/Q=="],
|
|
24
22
|
|
|
25
|
-
"@inquirer/external-editor": ["@inquirer/external-editor@1.0.3", "", { "dependencies": { "chardet": "^2.1.1", "iconv-lite": "^0.7.0" }, "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA=="],
|
|
26
|
-
|
|
27
|
-
"@inquirer/figures": ["@inquirer/figures@1.0.15", "", {}, "sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g=="],
|
|
28
|
-
|
|
29
23
|
"@sec-ant/readable-stream": ["@sec-ant/readable-stream@0.4.1", "", {}, "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg=="],
|
|
30
24
|
|
|
31
25
|
"@sindresorhus/merge-streams": ["@sindresorhus/merge-streams@4.0.0", "", {}, "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ=="],
|
|
@@ -34,78 +28,32 @@
|
|
|
34
28
|
|
|
35
29
|
"@types/node": ["@types/node@25.3.2", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-RpV6r/ij22zRRdyBPcxDeKAzH43phWVKEjL2iksqo1Vz3CuBUrgmPpPhALKiRfU7OMCmeeO9vECBMsV0hMTG8Q=="],
|
|
36
30
|
|
|
37
|
-
"ansi-escapes": ["ansi-escapes@4.3.2", "", { "dependencies": { "type-fest": "^0.21.3" } }, "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ=="],
|
|
38
|
-
|
|
39
|
-
"ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
|
|
40
|
-
|
|
41
|
-
"ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
|
|
42
|
-
|
|
43
|
-
"base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],
|
|
44
|
-
|
|
45
|
-
"bl": ["bl@4.1.0", "", { "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } }, "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="],
|
|
46
|
-
|
|
47
|
-
"buffer": ["buffer@5.7.1", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="],
|
|
48
|
-
|
|
49
31
|
"bun-types": ["bun-types@1.3.10", "", { "dependencies": { "@types/node": "*" } }, "sha512-tcpfCCl6XWo6nCVnpcVrxQ+9AYN1iqMIzgrSKYMB/fjLtV2eyAVEg7AxQJuCq/26R6HpKWykQXuSOq/21RYcbg=="],
|
|
50
32
|
|
|
51
33
|
"bundle-name": ["bundle-name@4.1.0", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q=="],
|
|
52
34
|
|
|
53
|
-
"chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="],
|
|
54
|
-
|
|
55
|
-
"chardet": ["chardet@2.1.1", "", {}, "sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ=="],
|
|
56
|
-
|
|
57
|
-
"cli-cursor": ["cli-cursor@3.1.0", "", { "dependencies": { "restore-cursor": "^3.1.0" } }, "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw=="],
|
|
58
|
-
|
|
59
|
-
"cli-spinners": ["cli-spinners@2.9.2", "", {}, "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg=="],
|
|
60
|
-
|
|
61
|
-
"cli-width": ["cli-width@4.1.0", "", {}, "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ=="],
|
|
62
|
-
|
|
63
|
-
"clone": ["clone@1.0.4", "", {}, "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg=="],
|
|
64
|
-
|
|
65
|
-
"color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="],
|
|
66
|
-
|
|
67
|
-
"color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="],
|
|
68
|
-
|
|
69
35
|
"cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
|
|
70
36
|
|
|
71
37
|
"default-browser": ["default-browser@5.5.0", "", { "dependencies": { "bundle-name": "^4.1.0", "default-browser-id": "^5.0.0" } }, "sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw=="],
|
|
72
38
|
|
|
73
39
|
"default-browser-id": ["default-browser-id@5.0.1", "", {}, "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q=="],
|
|
74
40
|
|
|
75
|
-
"defaults": ["defaults@1.0.4", "", { "dependencies": { "clone": "^1.0.2" } }, "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A=="],
|
|
76
|
-
|
|
77
41
|
"define-lazy-prop": ["define-lazy-prop@3.0.0", "", {}, "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg=="],
|
|
78
42
|
|
|
79
|
-
"emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
|
|
80
|
-
|
|
81
43
|
"execa": ["execa@9.6.1", "", { "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", "cross-spawn": "^7.0.6", "figures": "^6.1.0", "get-stream": "^9.0.0", "human-signals": "^8.0.1", "is-plain-obj": "^4.1.0", "is-stream": "^4.0.1", "npm-run-path": "^6.0.0", "pretty-ms": "^9.2.0", "signal-exit": "^4.1.0", "strip-final-newline": "^4.0.0", "yoctocolors": "^2.1.1" } }, "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA=="],
|
|
82
44
|
|
|
83
45
|
"figures": ["figures@6.1.0", "", { "dependencies": { "is-unicode-supported": "^2.0.0" } }, "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg=="],
|
|
84
46
|
|
|
85
47
|
"get-stream": ["get-stream@9.0.1", "", { "dependencies": { "@sec-ant/readable-stream": "^0.4.1", "is-stream": "^4.0.1" } }, "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA=="],
|
|
86
48
|
|
|
87
|
-
"has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="],
|
|
88
|
-
|
|
89
49
|
"human-signals": ["human-signals@8.0.1", "", {}, "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ=="],
|
|
90
50
|
|
|
91
|
-
"iconv-lite": ["iconv-lite@0.7.2", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw=="],
|
|
92
|
-
|
|
93
|
-
"ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="],
|
|
94
|
-
|
|
95
|
-
"inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],
|
|
96
|
-
|
|
97
|
-
"inquirer": ["inquirer@9.3.8", "", { "dependencies": { "@inquirer/external-editor": "^1.0.2", "@inquirer/figures": "^1.0.3", "ansi-escapes": "^4.3.2", "cli-width": "^4.1.0", "mute-stream": "1.0.0", "ora": "^5.4.1", "run-async": "^3.0.0", "rxjs": "^7.8.1", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "wrap-ansi": "^6.2.0", "yoctocolors-cjs": "^2.1.2" } }, "sha512-pFGGdaHrmRKMh4WoDDSowddgjT1Vkl90atobmTeSmcPGdYiwikch/m/Ef5wRaiamHejtw0cUUMMerzDUXCci2w=="],
|
|
98
|
-
|
|
99
51
|
"is-docker": ["is-docker@3.0.0", "", { "bin": { "is-docker": "cli.js" } }, "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ=="],
|
|
100
52
|
|
|
101
|
-
"is-fullwidth-code-point": ["is-fullwidth-code-point@3.0.0", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="],
|
|
102
|
-
|
|
103
53
|
"is-in-ssh": ["is-in-ssh@1.0.0", "", {}, "sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw=="],
|
|
104
54
|
|
|
105
55
|
"is-inside-container": ["is-inside-container@1.0.0", "", { "dependencies": { "is-docker": "^3.0.0" }, "bin": { "is-inside-container": "cli.js" } }, "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA=="],
|
|
106
56
|
|
|
107
|
-
"is-interactive": ["is-interactive@1.0.0", "", {}, "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w=="],
|
|
108
|
-
|
|
109
57
|
"is-plain-obj": ["is-plain-obj@4.1.0", "", {}, "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg=="],
|
|
110
58
|
|
|
111
59
|
"is-stream": ["is-stream@4.0.1", "", {}, "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A=="],
|
|
@@ -116,20 +64,10 @@
|
|
|
116
64
|
|
|
117
65
|
"isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="],
|
|
118
66
|
|
|
119
|
-
"log-symbols": ["log-symbols@4.1.0", "", { "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" } }, "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg=="],
|
|
120
|
-
|
|
121
|
-
"mimic-fn": ["mimic-fn@2.1.0", "", {}, "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="],
|
|
122
|
-
|
|
123
|
-
"mute-stream": ["mute-stream@1.0.0", "", {}, "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA=="],
|
|
124
|
-
|
|
125
67
|
"npm-run-path": ["npm-run-path@6.0.0", "", { "dependencies": { "path-key": "^4.0.0", "unicorn-magic": "^0.3.0" } }, "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA=="],
|
|
126
68
|
|
|
127
|
-
"onetime": ["onetime@5.1.2", "", { "dependencies": { "mimic-fn": "^2.1.0" } }, "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg=="],
|
|
128
|
-
|
|
129
69
|
"open": ["open@11.0.0", "", { "dependencies": { "default-browser": "^5.4.0", "define-lazy-prop": "^3.0.0", "is-in-ssh": "^1.0.0", "is-inside-container": "^1.0.0", "powershell-utils": "^0.1.0", "wsl-utils": "^0.3.0" } }, "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw=="],
|
|
130
70
|
|
|
131
|
-
"ora": ["ora@5.4.1", "", { "dependencies": { "bl": "^4.1.0", "chalk": "^4.1.0", "cli-cursor": "^3.1.0", "cli-spinners": "^2.5.0", "is-interactive": "^1.0.0", "is-unicode-supported": "^0.1.0", "log-symbols": "^4.1.0", "strip-ansi": "^6.0.0", "wcwidth": "^1.0.1" } }, "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ=="],
|
|
132
|
-
|
|
133
71
|
"parse-ms": ["parse-ms@4.0.0", "", {}, "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw=="],
|
|
134
72
|
|
|
135
73
|
"path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],
|
|
@@ -140,20 +78,8 @@
|
|
|
140
78
|
|
|
141
79
|
"pretty-ms": ["pretty-ms@9.3.0", "", { "dependencies": { "parse-ms": "^4.0.0" } }, "sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ=="],
|
|
142
80
|
|
|
143
|
-
"readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="],
|
|
144
|
-
|
|
145
|
-
"restore-cursor": ["restore-cursor@3.1.0", "", { "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" } }, "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA=="],
|
|
146
|
-
|
|
147
81
|
"run-applescript": ["run-applescript@7.1.0", "", {}, "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q=="],
|
|
148
82
|
|
|
149
|
-
"run-async": ["run-async@3.0.0", "", {}, "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q=="],
|
|
150
|
-
|
|
151
|
-
"rxjs": ["rxjs@7.8.2", "", { "dependencies": { "tslib": "^2.1.0" } }, "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA=="],
|
|
152
|
-
|
|
153
|
-
"safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
|
|
154
|
-
|
|
155
|
-
"safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],
|
|
156
|
-
|
|
157
83
|
"shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
|
|
158
84
|
|
|
159
85
|
"shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="],
|
|
@@ -162,50 +88,20 @@
|
|
|
162
88
|
|
|
163
89
|
"sisteransi": ["sisteransi@1.0.5", "", {}, "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg=="],
|
|
164
90
|
|
|
165
|
-
"string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
|
|
166
|
-
|
|
167
|
-
"string_decoder": ["string_decoder@1.3.0", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="],
|
|
168
|
-
|
|
169
|
-
"strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],
|
|
170
|
-
|
|
171
91
|
"strip-final-newline": ["strip-final-newline@4.0.0", "", {}, "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw=="],
|
|
172
92
|
|
|
173
|
-
"supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],
|
|
174
|
-
|
|
175
|
-
"tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
|
176
|
-
|
|
177
|
-
"type-fest": ["type-fest@0.21.3", "", {}, "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w=="],
|
|
178
|
-
|
|
179
93
|
"undici-types": ["undici-types@7.18.2", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="],
|
|
180
94
|
|
|
181
95
|
"unicorn-magic": ["unicorn-magic@0.3.0", "", {}, "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA=="],
|
|
182
96
|
|
|
183
|
-
"util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],
|
|
184
|
-
|
|
185
|
-
"wcwidth": ["wcwidth@1.0.1", "", { "dependencies": { "defaults": "^1.0.3" } }, "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg=="],
|
|
186
|
-
|
|
187
97
|
"which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],
|
|
188
98
|
|
|
189
|
-
"wrap-ansi": ["wrap-ansi@6.2.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA=="],
|
|
190
|
-
|
|
191
99
|
"wsl-utils": ["wsl-utils@0.3.1", "", { "dependencies": { "is-wsl": "^3.1.0", "powershell-utils": "^0.1.0" } }, "sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg=="],
|
|
192
100
|
|
|
193
101
|
"yoctocolors": ["yoctocolors@2.1.2", "", {}, "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug=="],
|
|
194
102
|
|
|
195
|
-
"yoctocolors-cjs": ["yoctocolors-cjs@2.1.3", "", {}, "sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw=="],
|
|
196
|
-
|
|
197
103
|
"@types/bun/bun-types": ["bun-types@1.3.9", "", { "dependencies": { "@types/node": "*" } }, "sha512-+UBWWOakIP4Tswh0Bt0QD0alpTY8cb5hvgiYeWCMet9YukHbzuruIEeXC2D7nMJPB12kbh8C7XJykSexEqGKJg=="],
|
|
198
104
|
|
|
199
|
-
"log-symbols/chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
|
|
200
|
-
|
|
201
|
-
"log-symbols/is-unicode-supported": ["is-unicode-supported@0.1.0", "", {}, "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="],
|
|
202
|
-
|
|
203
105
|
"npm-run-path/path-key": ["path-key@4.0.0", "", {}, "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ=="],
|
|
204
|
-
|
|
205
|
-
"ora/chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
|
|
206
|
-
|
|
207
|
-
"ora/is-unicode-supported": ["is-unicode-supported@0.1.0", "", {}, "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="],
|
|
208
|
-
|
|
209
|
-
"restore-cursor/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="],
|
|
210
106
|
}
|
|
211
107
|
}
|
package/dist/index.js
CHANGED
|
@@ -7785,6 +7785,25 @@ class Vt extends x {
|
|
|
7785
7785
|
}
|
|
7786
7786
|
}
|
|
7787
7787
|
}
|
|
7788
|
+
|
|
7789
|
+
class kt extends x {
|
|
7790
|
+
get cursor() {
|
|
7791
|
+
return this.value ? 0 : 1;
|
|
7792
|
+
}
|
|
7793
|
+
get _value() {
|
|
7794
|
+
return this.cursor === 0;
|
|
7795
|
+
}
|
|
7796
|
+
constructor(e) {
|
|
7797
|
+
super(e, false), this.value = !!e.initialValue, this.on("userInput", () => {
|
|
7798
|
+
this.value = this._value;
|
|
7799
|
+
}), this.on("confirm", (s) => {
|
|
7800
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
|
|
7801
|
+
}), this.on("cursor", () => {
|
|
7802
|
+
this.value = !this.value;
|
|
7803
|
+
});
|
|
7804
|
+
}
|
|
7805
|
+
}
|
|
7806
|
+
|
|
7788
7807
|
class yt extends x {
|
|
7789
7808
|
options;
|
|
7790
7809
|
cursor = 0;
|
|
@@ -8232,6 +8251,33 @@ var X2 = (t) => {
|
|
|
8232
8251
|
B2.push(w);
|
|
8233
8252
|
return h2 && B2.push(g), B2;
|
|
8234
8253
|
};
|
|
8254
|
+
var Re = (t) => {
|
|
8255
|
+
const r = t.active ?? "Yes", s = t.inactive ?? "No";
|
|
8256
|
+
return new kt({ active: r, inactive: s, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue ?? true, render() {
|
|
8257
|
+
const i2 = t.withGuide ?? _.withGuide, a2 = `${i2 ? `${import_picocolors2.default.gray(d)}
|
|
8258
|
+
` : ""}${W2(this.state)} ${t.message}
|
|
8259
|
+
`, o2 = this.value ? r : s;
|
|
8260
|
+
switch (this.state) {
|
|
8261
|
+
case "submit": {
|
|
8262
|
+
const u2 = i2 ? `${import_picocolors2.default.gray(d)} ` : "";
|
|
8263
|
+
return `${a2}${u2}${import_picocolors2.default.dim(o2)}`;
|
|
8264
|
+
}
|
|
8265
|
+
case "cancel": {
|
|
8266
|
+
const u2 = i2 ? `${import_picocolors2.default.gray(d)} ` : "";
|
|
8267
|
+
return `${a2}${u2}${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(o2))}${i2 ? `
|
|
8268
|
+
${import_picocolors2.default.gray(d)}` : ""}`;
|
|
8269
|
+
}
|
|
8270
|
+
default: {
|
|
8271
|
+
const u2 = i2 ? `${import_picocolors2.default.cyan(d)} ` : "", l = i2 ? import_picocolors2.default.cyan(x2) : "";
|
|
8272
|
+
return `${a2}${u2}${this.value ? `${import_picocolors2.default.green(Q2)} ${r}` : `${import_picocolors2.default.dim(H2)} ${import_picocolors2.default.dim(r)}`}${t.vertical ? i2 ? `
|
|
8273
|
+
${import_picocolors2.default.cyan(d)} ` : `
|
|
8274
|
+
` : ` ${import_picocolors2.default.dim("/")} `}${this.value ? `${import_picocolors2.default.dim(H2)} ${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.green(Q2)} ${s}`}
|
|
8275
|
+
${l}
|
|
8276
|
+
`;
|
|
8277
|
+
}
|
|
8278
|
+
}
|
|
8279
|
+
} }).prompt();
|
|
8280
|
+
};
|
|
8235
8281
|
var R2 = { message: (t = [], { symbol: r = import_picocolors2.default.gray(d), secondarySymbol: s = import_picocolors2.default.gray(d), output: i2 = process.stdout, spacing: a2 = 1, withGuide: o2 } = {}) => {
|
|
8236
8282
|
const u2 = [], l = o2 ?? _.withGuide, n2 = l ? s : "", c3 = l ? `${r} ` : "", g = l ? `${s} ` : "";
|
|
8237
8283
|
for (let p = 0;p < a2; p++)
|
|
@@ -9128,9 +9174,49 @@ var open_default = open;
|
|
|
9128
9174
|
import { writeFile, access, readFile, unlink } from "fs/promises";
|
|
9129
9175
|
import path7 from "path";
|
|
9130
9176
|
import http from "http";
|
|
9177
|
+
var globalConfig = {
|
|
9178
|
+
quiet: false,
|
|
9179
|
+
noOpen: false
|
|
9180
|
+
};
|
|
9181
|
+
async function saveCredentials(clientId, clientSecret, provider, saveOption) {
|
|
9182
|
+
const envKeyId = `${provider.toUpperCase()}_CLIENT_ID`;
|
|
9183
|
+
const envKeySecret = `${provider.toUpperCase()}_CLIENT_SECRET`;
|
|
9184
|
+
const newEnvContent = `${envKeyId}=${clientId}
|
|
9185
|
+
${envKeySecret}=${clientSecret}`;
|
|
9186
|
+
if (saveOption === "print") {
|
|
9187
|
+
R2.message(newEnvContent);
|
|
9188
|
+
R2.success("Credentials printed to console");
|
|
9189
|
+
return;
|
|
9190
|
+
}
|
|
9191
|
+
if (saveOption === "json") {
|
|
9192
|
+
const jsonContent = JSON.stringify({ clientId, clientSecret }, null, 2);
|
|
9193
|
+
const jsonPath = `${provider}-credentials.json`;
|
|
9194
|
+
await writeFile(jsonPath, jsonContent);
|
|
9195
|
+
R2.success(`Credentials saved to ${jsonPath}`);
|
|
9196
|
+
return;
|
|
9197
|
+
}
|
|
9198
|
+
const envPath = saveOption === "dot-env" ? ".env" : ".env.local";
|
|
9199
|
+
try {
|
|
9200
|
+
await access(envPath);
|
|
9201
|
+
const shouldAppend = await Re({
|
|
9202
|
+
message: `${envPath} already exists. Append credentials?`,
|
|
9203
|
+
initialValue: true
|
|
9204
|
+
});
|
|
9205
|
+
if (Ct(shouldAppend) || !shouldAppend) {
|
|
9206
|
+
R2.warn("Credentials not saved.");
|
|
9207
|
+
return;
|
|
9208
|
+
}
|
|
9209
|
+
const existingContent = await readFile(envPath, "utf-8");
|
|
9210
|
+
await writeFile(envPath, existingContent + `
|
|
9211
|
+
` + newEnvContent);
|
|
9212
|
+
} catch {
|
|
9213
|
+
await writeFile(envPath, newEnvContent);
|
|
9214
|
+
}
|
|
9215
|
+
R2.success(`Credentials saved to ${envPath}`);
|
|
9216
|
+
}
|
|
9131
9217
|
|
|
9132
9218
|
class GoogleAuthProvider {
|
|
9133
|
-
async run(
|
|
9219
|
+
async run(_appName) {
|
|
9134
9220
|
try {
|
|
9135
9221
|
const googleLoading = bt2();
|
|
9136
9222
|
googleLoading.start("Fetching google cloud projects");
|
|
@@ -9166,7 +9252,9 @@ class GoogleAuthProvider {
|
|
|
9166
9252
|
const brandUrl = `https://console.cloud.google.com/apis/credentials/consent?project=${projectId}`;
|
|
9167
9253
|
R2.message(`Google requires manual setup for personal projects.
|
|
9168
9254
|
Opening: ${brandUrl}`);
|
|
9169
|
-
|
|
9255
|
+
if (!globalConfig.noOpen) {
|
|
9256
|
+
await open_default(brandUrl);
|
|
9257
|
+
}
|
|
9170
9258
|
Ve(`1. Choose 'External'
|
|
9171
9259
|
2. Fill App Name & Email
|
|
9172
9260
|
3. Click 'Save and Continue' through to the end.`, "Action Required");
|
|
@@ -9178,7 +9266,9 @@ Opening: ${brandUrl}`);
|
|
|
9178
9266
|
R2.step("Step 2: Create OAuth Client ID");
|
|
9179
9267
|
const clientUrl = `https://console.cloud.google.com/apis/credentials/oauthclient?project=${projectId}`;
|
|
9180
9268
|
R2.message(`Opening: ${clientUrl}`);
|
|
9181
|
-
|
|
9269
|
+
if (!globalConfig.noOpen) {
|
|
9270
|
+
await open_default(clientUrl);
|
|
9271
|
+
}
|
|
9182
9272
|
Ve(`1. Select 'Web Application'
|
|
9183
9273
|
2. Add your Redirect URIs
|
|
9184
9274
|
3. Click 'Create'`, "Action Required");
|
|
@@ -9194,7 +9284,7 @@ Opening: ${brandUrl}`);
|
|
|
9194
9284
|
});
|
|
9195
9285
|
if (Ct(clientSecret))
|
|
9196
9286
|
return Ne("Setup aborted.");
|
|
9197
|
-
R2.step("Step 3: Save credentials
|
|
9287
|
+
R2.step("Step 3: Save credentials");
|
|
9198
9288
|
const saveOption = await Je({
|
|
9199
9289
|
message: "Where do you want to save the credentials?",
|
|
9200
9290
|
options: [
|
|
@@ -9216,17 +9306,9 @@ Opening: ${brandUrl}`);
|
|
|
9216
9306
|
}
|
|
9217
9307
|
]
|
|
9218
9308
|
});
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
try {
|
|
9223
|
-
await access(envPath);
|
|
9224
|
-
const existingContent = await readFile(envPath, "utf-8");
|
|
9225
|
-
await writeFile(envPath, existingContent + `
|
|
9226
|
-
` + newEnvContent);
|
|
9227
|
-
} catch {
|
|
9228
|
-
await writeFile(envPath, newEnvContent);
|
|
9229
|
-
}
|
|
9309
|
+
if (Ct(saveOption))
|
|
9310
|
+
return Ne("Setup aborted.");
|
|
9311
|
+
await saveCredentials(clientId, clientSecret, "google", saveOption);
|
|
9230
9312
|
} catch (err) {
|
|
9231
9313
|
R2.error(`Setup Failed: ${err.message}`);
|
|
9232
9314
|
process.exit(1);
|
|
@@ -9237,8 +9319,13 @@ GOOGLE_CLIENT_SECRET=${clientSecret}`;
|
|
|
9237
9319
|
s.start("Verifying Client ID with Google...");
|
|
9238
9320
|
try {
|
|
9239
9321
|
const res = await fetch(`https://oauth2.googleapis.com/tokeninfo?client_id=${clientId}`);
|
|
9240
|
-
|
|
9241
|
-
|
|
9322
|
+
const isValid = res.status === 200;
|
|
9323
|
+
if (isValid) {
|
|
9324
|
+
s.stop("Client ID verified.");
|
|
9325
|
+
} else {
|
|
9326
|
+
s.stop("Invalid Client ID.");
|
|
9327
|
+
}
|
|
9328
|
+
return isValid;
|
|
9242
9329
|
} catch {
|
|
9243
9330
|
s.stop("Validation service unreachable.");
|
|
9244
9331
|
return false;
|
|
@@ -9246,120 +9333,206 @@ GOOGLE_CLIENT_SECRET=${clientSecret}`;
|
|
|
9246
9333
|
}
|
|
9247
9334
|
}
|
|
9248
9335
|
|
|
9336
|
+
class GitHubAuthProvider {
|
|
9337
|
+
async run(callbackUrl) {
|
|
9338
|
+
try {
|
|
9339
|
+
const appType = await Je({
|
|
9340
|
+
message: "What type of GitHub app you want to create?",
|
|
9341
|
+
options: [
|
|
9342
|
+
{
|
|
9343
|
+
value: "gh-app",
|
|
9344
|
+
label: "GitHub App (One click setup)"
|
|
9345
|
+
},
|
|
9346
|
+
{
|
|
9347
|
+
value: "oauth-app",
|
|
9348
|
+
label: "OAuth App (You need to fill a form for this)"
|
|
9349
|
+
}
|
|
9350
|
+
]
|
|
9351
|
+
});
|
|
9352
|
+
if (Ct(appType))
|
|
9353
|
+
return Ne("Setup aborted.");
|
|
9354
|
+
if (appType === "gh-app") {
|
|
9355
|
+
await this.setupGitHubApp(callbackUrl);
|
|
9356
|
+
} else if (appType === "oauth-app") {
|
|
9357
|
+
await this.setupOAuthApp(callbackUrl);
|
|
9358
|
+
}
|
|
9359
|
+
} catch (err) {
|
|
9360
|
+
R2.error(`Setup Failed: ${err.message}`);
|
|
9361
|
+
process.exit(1);
|
|
9362
|
+
}
|
|
9363
|
+
}
|
|
9364
|
+
async setupGitHubApp(callbackUrl) {
|
|
9365
|
+
const saveOption = await this.askSaveOption();
|
|
9366
|
+
if (Ct(saveOption))
|
|
9367
|
+
return Ne("Setup aborted.");
|
|
9368
|
+
const PORT = 3001;
|
|
9369
|
+
const REDIRECT_URI = `http://localhost:${PORT}/callback`;
|
|
9370
|
+
const manifest = {
|
|
9371
|
+
name: "oauth-init-app",
|
|
9372
|
+
url: "http://localhost:3000",
|
|
9373
|
+
callback_url: callbackUrl,
|
|
9374
|
+
public: false,
|
|
9375
|
+
default_permissions: {
|
|
9376
|
+
contents: "read",
|
|
9377
|
+
metadata: "read"
|
|
9378
|
+
},
|
|
9379
|
+
redirect_url: REDIRECT_URI
|
|
9380
|
+
};
|
|
9381
|
+
const htmlContent = `
|
|
9382
|
+
<html>
|
|
9383
|
+
<body>
|
|
9384
|
+
<form id="gh-form" action="https://github.com/settings/apps/new" method="post">
|
|
9385
|
+
<input type="hidden" name="manifest" value='${JSON.stringify(manifest)}'>
|
|
9386
|
+
</form>
|
|
9387
|
+
<script>document.getElementById("gh-form").submit();</script>
|
|
9388
|
+
</body>
|
|
9389
|
+
</html>
|
|
9390
|
+
`;
|
|
9391
|
+
const tempPath = path7.join(process.cwd(), "github-setup.html");
|
|
9392
|
+
await writeFile(tempPath, htmlContent);
|
|
9393
|
+
R2.step("GitHub App Configuration");
|
|
9394
|
+
R2.message("Opening GitHub with your manifest...");
|
|
9395
|
+
if (!globalConfig.noOpen) {
|
|
9396
|
+
await open_default(tempPath);
|
|
9397
|
+
}
|
|
9398
|
+
return new Promise((resolve) => {
|
|
9399
|
+
const server = http.createServer(async (req, res) => {
|
|
9400
|
+
const url = new URL(req.url, `http://localhost:${PORT}`);
|
|
9401
|
+
const code = url.searchParams.get("code");
|
|
9402
|
+
if (code) {
|
|
9403
|
+
res.end("<h1>Success!</h1><p>You can close this tab and return to the CLI.</p>");
|
|
9404
|
+
const s = bt2();
|
|
9405
|
+
s.start("Exchanging code for secrets...");
|
|
9406
|
+
try {
|
|
9407
|
+
const { stdout } = await execa("curl", [
|
|
9408
|
+
"-X",
|
|
9409
|
+
"POST",
|
|
9410
|
+
`https://api.github.com/app-manifests/${code}/conversions`
|
|
9411
|
+
]);
|
|
9412
|
+
const credentials = JSON.parse(stdout);
|
|
9413
|
+
const { client_id, client_secret } = credentials;
|
|
9414
|
+
s.stop("Credentials received!");
|
|
9415
|
+
await unlink(tempPath);
|
|
9416
|
+
await saveCredentials(client_id, client_secret, "github", saveOption);
|
|
9417
|
+
server.close();
|
|
9418
|
+
resolve();
|
|
9419
|
+
} catch {
|
|
9420
|
+
s.error("Failed to convert manifest code.");
|
|
9421
|
+
server.close();
|
|
9422
|
+
resolve();
|
|
9423
|
+
}
|
|
9424
|
+
}
|
|
9425
|
+
}).listen(PORT);
|
|
9426
|
+
});
|
|
9427
|
+
}
|
|
9428
|
+
async setupOAuthApp(callbackUrl) {
|
|
9429
|
+
R2.step("Step 1: Create OAuth App on GitHub");
|
|
9430
|
+
const oauthAppUrl = "https://github.com/settings/applications/new";
|
|
9431
|
+
R2.message(`Opening: ${oauthAppUrl}`);
|
|
9432
|
+
if (!globalConfig.noOpen) {
|
|
9433
|
+
await open_default(oauthAppUrl);
|
|
9434
|
+
}
|
|
9435
|
+
Ve(`1. Fill Application Name and Homepage URL
|
|
9436
|
+
2. Enter Authorization callback URL: ` + callbackUrl + `
|
|
9437
|
+
3. Click 'Register application'`, "Action Required");
|
|
9438
|
+
const brandDone = await Ze({
|
|
9439
|
+
message: "Press Enter once you've created the OAuth App (or type 'skip' if done previously)"
|
|
9440
|
+
});
|
|
9441
|
+
if (Ct(brandDone))
|
|
9442
|
+
return Ne("Setup aborted.");
|
|
9443
|
+
R2.step("Step 2: Save credentials");
|
|
9444
|
+
const clientId = await Ze({
|
|
9445
|
+
message: "Paste your Client ID:",
|
|
9446
|
+
placeholder: "Iv1.xxx"
|
|
9447
|
+
});
|
|
9448
|
+
if (Ct(clientId))
|
|
9449
|
+
return Ne("Setup aborted.");
|
|
9450
|
+
const clientSecret = await He({
|
|
9451
|
+
message: "Paste your Client Secret:"
|
|
9452
|
+
});
|
|
9453
|
+
if (Ct(clientSecret))
|
|
9454
|
+
return Ne("Setup aborted.");
|
|
9455
|
+
const saveOption = await this.askSaveOption();
|
|
9456
|
+
if (Ct(saveOption))
|
|
9457
|
+
return Ne("Setup aborted.");
|
|
9458
|
+
await saveCredentials(clientId, clientSecret, "github", saveOption);
|
|
9459
|
+
}
|
|
9460
|
+
async askSaveOption() {
|
|
9461
|
+
return Je({
|
|
9462
|
+
message: "Where do you want to save the credentials?",
|
|
9463
|
+
options: [
|
|
9464
|
+
{ label: ".env", value: "dot-env" },
|
|
9465
|
+
{ label: ".env.local", value: "dot-env-dot-local" },
|
|
9466
|
+
{ label: ".json", value: "json" },
|
|
9467
|
+
{ label: "print to the console", value: "print" }
|
|
9468
|
+
]
|
|
9469
|
+
});
|
|
9470
|
+
}
|
|
9471
|
+
}
|
|
9472
|
+
|
|
9249
9473
|
class Orchestrator {
|
|
9250
|
-
|
|
9251
|
-
constructor(
|
|
9252
|
-
this.
|
|
9474
|
+
projectName;
|
|
9475
|
+
constructor(projectName) {
|
|
9476
|
+
this.projectName = projectName;
|
|
9253
9477
|
}
|
|
9254
9478
|
async setupOAuthServices(oauthServices) {
|
|
9255
9479
|
for (const service of oauthServices) {
|
|
9256
9480
|
if (service === "google") {
|
|
9257
|
-
R2.step("Google
|
|
9481
|
+
R2.step("Google OAuth Setup");
|
|
9258
9482
|
const googleOauthCallback = await Ze({
|
|
9259
9483
|
message: "Enter the Google OAuth callback URL:",
|
|
9260
9484
|
placeholder: "https://example.com/oauth/callback",
|
|
9261
9485
|
defaultValue: `http://localhost:3000/oauth/callback/google`
|
|
9262
9486
|
});
|
|
9263
|
-
|
|
9487
|
+
if (Ct(googleOauthCallback)) {
|
|
9488
|
+
Ne("Setup aborted.");
|
|
9489
|
+
return;
|
|
9490
|
+
}
|
|
9491
|
+
const googleProvider = new GoogleAuthProvider;
|
|
9492
|
+
await googleProvider.run(googleOauthCallback);
|
|
9264
9493
|
} else if (service === "github") {
|
|
9265
|
-
R2.step("
|
|
9494
|
+
R2.step("GitHub OAuth Setup");
|
|
9266
9495
|
const githubOauthCallback = await Ze({
|
|
9267
|
-
message: "Enter the
|
|
9496
|
+
message: "Enter the GitHub OAuth callback URL:",
|
|
9268
9497
|
placeholder: "https://example.com/oauth/callback",
|
|
9269
9498
|
defaultValue: `http://localhost:3000/oauth/callback/github`
|
|
9270
9499
|
});
|
|
9271
|
-
|
|
9500
|
+
if (Ct(githubOauthCallback)) {
|
|
9501
|
+
Ne("Setup aborted.");
|
|
9502
|
+
return;
|
|
9503
|
+
}
|
|
9504
|
+
const githubProvider = new GitHubAuthProvider;
|
|
9505
|
+
await githubProvider.run(githubOauthCallback);
|
|
9272
9506
|
}
|
|
9273
9507
|
}
|
|
9274
9508
|
Le("OAuth setup completed! Thank you for using oauth-init client!");
|
|
9275
9509
|
}
|
|
9276
|
-
async setupGoogleOAuth(callbackUrl) {
|
|
9277
|
-
const googleAuthProvider = new GoogleAuthProvider;
|
|
9278
|
-
await googleAuthProvider.run(callbackUrl);
|
|
9279
|
-
}
|
|
9280
|
-
async setupGithubOAuth(callbackUrl) {
|
|
9281
|
-
const appType = await Je({
|
|
9282
|
-
message: "What type of github app you want to create?",
|
|
9283
|
-
options: [
|
|
9284
|
-
{
|
|
9285
|
-
value: "gh-app",
|
|
9286
|
-
label: "Github App (One click setup)"
|
|
9287
|
-
},
|
|
9288
|
-
{
|
|
9289
|
-
value: "oauth-app",
|
|
9290
|
-
label: "OAuth App (You need to fill a form for this)"
|
|
9291
|
-
}
|
|
9292
|
-
]
|
|
9293
|
-
});
|
|
9294
|
-
if (appType === "gh-app") {
|
|
9295
|
-
const PORT = 3001;
|
|
9296
|
-
const REDIRECT_URI = `http://localhost:${PORT}/callback`;
|
|
9297
|
-
const manifest = {
|
|
9298
|
-
name: "superblogger",
|
|
9299
|
-
url: "http://localhost:3000",
|
|
9300
|
-
callback_url: callbackUrl,
|
|
9301
|
-
public: false,
|
|
9302
|
-
default_permissions: {
|
|
9303
|
-
contents: "read",
|
|
9304
|
-
metadata: "read"
|
|
9305
|
-
},
|
|
9306
|
-
redirect_url: REDIRECT_URI
|
|
9307
|
-
};
|
|
9308
|
-
const htmlContent = `
|
|
9309
|
-
<html>
|
|
9310
|
-
<body>
|
|
9311
|
-
<form id="gh-form" action="https://github.com/settings/apps/new" method="post">
|
|
9312
|
-
<input type="hidden" name="manifest" value='${JSON.stringify(manifest)}'>
|
|
9313
|
-
</form>
|
|
9314
|
-
<script>document.getElementById("gh-form").submit();</script>
|
|
9315
|
-
</body>
|
|
9316
|
-
</html>
|
|
9317
|
-
`;
|
|
9318
|
-
const tempPath = path7.join(process.cwd(), "github-setup.html");
|
|
9319
|
-
await writeFile(tempPath, htmlContent);
|
|
9320
|
-
R2.step("GitHub App Configuration");
|
|
9321
|
-
R2.message("Opening GitHub with your manifest...");
|
|
9322
|
-
await open_default(tempPath);
|
|
9323
|
-
return new Promise((resolve) => {
|
|
9324
|
-
const server = http.createServer(async (req, res) => {
|
|
9325
|
-
const url = new URL(req.url, `http://localhost:${PORT}`);
|
|
9326
|
-
const code = url.searchParams.get("code");
|
|
9327
|
-
if (code) {
|
|
9328
|
-
res.end("<h1>Success!</h1><p>You can close this tab and return to the CLI.</p>");
|
|
9329
|
-
const s = bt2();
|
|
9330
|
-
s.start("Exchanging code for secrets...");
|
|
9331
|
-
try {
|
|
9332
|
-
const { stdout } = await execa("curl", [
|
|
9333
|
-
"-X",
|
|
9334
|
-
"POST",
|
|
9335
|
-
`https://api.github.com/app-manifests/${code}/conversions`
|
|
9336
|
-
]);
|
|
9337
|
-
const credentials = JSON.parse(stdout);
|
|
9338
|
-
const { client_id, client_secret } = credentials;
|
|
9339
|
-
s.stop("Credentials received!");
|
|
9340
|
-
await unlink(tempPath);
|
|
9341
|
-
const newEnvContent = `GITHUB_CLIENT_ID=${client_id}
|
|
9342
|
-
GITHUB_CLIENT_SECRET=${client_secret}
|
|
9343
|
-
`;
|
|
9344
|
-
await writeFile(".env", newEnvContent, { flag: "a" });
|
|
9345
|
-
R2.success("GitHub credentials saved to .env");
|
|
9346
|
-
server.close();
|
|
9347
|
-
resolve();
|
|
9348
|
-
} catch (err) {
|
|
9349
|
-
s.error("Failed to convert manifest code.");
|
|
9350
|
-
server.close();
|
|
9351
|
-
resolve();
|
|
9352
|
-
}
|
|
9353
|
-
}
|
|
9354
|
-
}).listen(PORT);
|
|
9355
|
-
});
|
|
9356
|
-
}
|
|
9357
|
-
if (appType === "oauth-app") {
|
|
9358
|
-
R2.warning("FUCK YOU");
|
|
9359
|
-
}
|
|
9360
|
-
}
|
|
9361
9510
|
}
|
|
9362
9511
|
async function main() {
|
|
9512
|
+
const args = process.argv.slice(2);
|
|
9513
|
+
const flags = {
|
|
9514
|
+
help: args.includes("--help") || args.includes("-h"),
|
|
9515
|
+
quiet: args.includes("--quiet") || args.includes("-q"),
|
|
9516
|
+
noOpen: args.includes("--no-open") || args.includes("-n")
|
|
9517
|
+
};
|
|
9518
|
+
if (flags.help) {
|
|
9519
|
+
console.log(`
|
|
9520
|
+
Usage: oauth-init [options]
|
|
9521
|
+
|
|
9522
|
+
Options:
|
|
9523
|
+
-h, --help Show this help message
|
|
9524
|
+
-q, --quiet Reduce output verbosity
|
|
9525
|
+
-n, --no-open Don't open browser URLs automatically
|
|
9526
|
+
|
|
9527
|
+
Examples:
|
|
9528
|
+
oauth-init # Run interactive setup
|
|
9529
|
+
oauth-init --quiet # Run with minimal output
|
|
9530
|
+
oauth-init --no-open # Get URLs but don't open them
|
|
9531
|
+
`);
|
|
9532
|
+
process.exit(0);
|
|
9533
|
+
}
|
|
9534
|
+
globalConfig.quiet = flags.quiet;
|
|
9535
|
+
globalConfig.noOpen = flags.noOpen;
|
|
9363
9536
|
const projectDirectoryName = path7.basename(process.cwd());
|
|
9364
9537
|
We(`
|
|
9365
9538
|
▗▄▖ ▗▄▖ ▗▖ ▗▖▗▄▄▄▖▗▖ ▗▖ ▗▄▄▄▖▗▖ ▗▖▗▄▄▄▖▗▄▄▄▖
|
|
@@ -9386,9 +9559,12 @@ async function main() {
|
|
|
9386
9559
|
Ne("Operation cancelled.");
|
|
9387
9560
|
process.exit(0);
|
|
9388
9561
|
}
|
|
9389
|
-
const orchestrator = new Orchestrator(projectName)
|
|
9562
|
+
const orchestrator = new Orchestrator(projectName);
|
|
9563
|
+
await orchestrator.setupOAuthServices(oauthToSetup);
|
|
9564
|
+
process.exit(0);
|
|
9390
9565
|
}
|
|
9391
9566
|
main();
|
|
9392
9567
|
export {
|
|
9393
|
-
GoogleAuthProvider
|
|
9568
|
+
GoogleAuthProvider,
|
|
9569
|
+
GitHubAuthProvider
|
|
9394
9570
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oauth-init",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "CLI for setting up OAuth providers for your project",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -16,9 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@clack/prompts": "^1.0.1",
|
|
18
18
|
"@types/bun": "^1.3.9",
|
|
19
|
-
"chalk": "^5.3.0",
|
|
20
19
|
"execa": "^9.6.1",
|
|
21
|
-
"inquirer": "^9.2.12",
|
|
22
20
|
"open": "^11.0.0"
|
|
23
21
|
},
|
|
24
22
|
"devDependencies": {
|