@beezer-pet/instant-cli 0.0.0-stage → 1.0.67-beezer.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +4 -0
- package/LICENSE.md +202 -0
- package/README.md +34 -2
- package/__tests__/appCommands.test.ts +228 -0
- package/__tests__/args.test.ts +358 -0
- package/__tests__/auth.test.ts +128 -0
- package/__tests__/authClientAddApple.test.ts +376 -0
- package/__tests__/authClientAddClerk.test.ts +222 -0
- package/__tests__/authClientAddGithub.test.ts +245 -0
- package/__tests__/authClientAddGoogle.test.ts +373 -0
- package/__tests__/authClientAddLinkedin.test.ts +262 -0
- package/__tests__/authClientList.test.ts +90 -0
- package/__tests__/authClientUpdate.test.ts +583 -0
- package/__tests__/authOriginManagement.test.ts +308 -0
- package/__tests__/backupDownload.test.ts +206 -0
- package/__tests__/backups.test.ts +221 -0
- package/__tests__/config.test.ts +57 -0
- package/__tests__/e2e/cli.e2e.test.ts +1267 -0
- package/__tests__/e2e/helpers.ts +177 -0
- package/__tests__/effectHelpers.ts +45 -0
- package/__tests__/mergeSchema.test.ts +197 -0
- package/__tests__/multiSelect.test.ts +236 -0
- package/__tests__/oauthMock.ts +76 -0
- package/__tests__/promptOk.test.ts +44 -0
- package/__tests__/redirectUriPrompt.test.ts +40 -0
- package/__tests__/sdkInstallSpec.test.ts +36 -0
- package/__tests__/select.test.ts +224 -0
- package/__tests__/webhooks.test.ts +728 -0
- package/bin/index.js +3 -0
- package/dist/auth/index.d.ts +4 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +103 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/commands/app/delete.d.ts +7 -0
- package/dist/commands/app/delete.d.ts.map +1 -0
- package/dist/commands/app/delete.js +57 -0
- package/dist/commands/app/delete.js.map +1 -0
- package/dist/commands/app/list.d.ts +6 -0
- package/dist/commands/app/list.d.ts.map +1 -0
- package/dist/commands/app/list.js +29 -0
- package/dist/commands/app/list.js.map +1 -0
- package/dist/commands/auth/client/add.d.ts +9 -0
- package/dist/commands/auth/client/add.d.ts.map +1 -0
- package/dist/commands/auth/client/add.js +409 -0
- package/dist/commands/auth/client/add.js.map +1 -0
- package/dist/commands/auth/client/delete.d.ts +11 -0
- package/dist/commands/auth/client/delete.d.ts.map +1 -0
- package/dist/commands/auth/client/delete.js +48 -0
- package/dist/commands/auth/client/delete.js.map +1 -0
- package/dist/commands/auth/client/list.d.ts +6 -0
- package/dist/commands/auth/client/list.d.ts.map +1 -0
- package/dist/commands/auth/client/list.js +38 -0
- package/dist/commands/auth/client/list.js.map +1 -0
- package/dist/commands/auth/client/shared.d.ts +70 -0
- package/dist/commands/auth/client/shared.d.ts.map +1 -0
- package/dist/commands/auth/client/shared.js +140 -0
- package/dist/commands/auth/client/shared.js.map +1 -0
- package/dist/commands/auth/client/update.d.ts +8 -0
- package/dist/commands/auth/client/update.d.ts.map +1 -0
- package/dist/commands/auth/client/update.js +445 -0
- package/dist/commands/auth/client/update.js.map +1 -0
- package/dist/commands/auth/email/pull.d.ts +24 -0
- package/dist/commands/auth/email/pull.d.ts.map +1 -0
- package/dist/commands/auth/email/pull.js +100 -0
- package/dist/commands/auth/email/pull.js.map +1 -0
- package/dist/commands/auth/email/push.d.ts +8 -0
- package/dist/commands/auth/email/push.d.ts.map +1 -0
- package/dist/commands/auth/email/push.js +58 -0
- package/dist/commands/auth/email/push.js.map +1 -0
- package/dist/commands/auth/email/resend.d.ts +3 -0
- package/dist/commands/auth/email/resend.d.ts.map +1 -0
- package/dist/commands/auth/email/resend.js +7 -0
- package/dist/commands/auth/email/resend.js.map +1 -0
- package/dist/commands/auth/email/reset.d.ts +5 -0
- package/dist/commands/auth/email/reset.d.ts.map +1 -0
- package/dist/commands/auth/email/reset.js +25 -0
- package/dist/commands/auth/email/reset.js.map +1 -0
- package/dist/commands/auth/email/status.d.ts +57 -0
- package/dist/commands/auth/email/status.d.ts.map +1 -0
- package/dist/commands/auth/email/status.js +96 -0
- package/dist/commands/auth/email/status.js.map +1 -0
- package/dist/commands/auth/email/verify.d.ts +5 -0
- package/dist/commands/auth/email/verify.d.ts.map +1 -0
- package/dist/commands/auth/email/verify.js +12 -0
- package/dist/commands/auth/email/verify.js.map +1 -0
- package/dist/commands/auth/origin/add.d.ts +12 -0
- package/dist/commands/auth/origin/add.d.ts.map +1 -0
- package/dist/commands/auth/origin/add.js +153 -0
- package/dist/commands/auth/origin/add.js.map +1 -0
- package/dist/commands/auth/origin/delete.d.ts +8 -0
- package/dist/commands/auth/origin/delete.d.ts.map +1 -0
- package/dist/commands/auth/origin/delete.js +38 -0
- package/dist/commands/auth/origin/delete.js.map +1 -0
- package/dist/commands/auth/origin/list.d.ts +9 -0
- package/dist/commands/auth/origin/list.d.ts.map +1 -0
- package/dist/commands/auth/origin/list.js +52 -0
- package/dist/commands/auth/origin/list.js.map +1 -0
- package/dist/commands/backup/download.d.ts +10 -0
- package/dist/commands/backup/download.d.ts.map +1 -0
- package/dist/commands/backup/download.js +174 -0
- package/dist/commands/backup/download.js.map +1 -0
- package/dist/commands/backup/list.d.ts +11 -0
- package/dist/commands/backup/list.d.ts.map +1 -0
- package/dist/commands/backup/list.js +74 -0
- package/dist/commands/backup/list.js.map +1 -0
- package/dist/commands/claim.d.ts +6 -0
- package/dist/commands/claim.d.ts.map +1 -0
- package/dist/commands/claim.js +22 -0
- package/dist/commands/claim.js.map +1 -0
- package/dist/commands/explorer.d.ts +6 -0
- package/dist/commands/explorer.d.ts.map +1 -0
- package/dist/commands/explorer.js +13 -0
- package/dist/commands/explorer.js.map +1 -0
- package/dist/commands/info.d.ts +9 -0
- package/dist/commands/info.d.ts.map +1 -0
- package/dist/commands/info.js +41 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/init.d.ts +5 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +41 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/initWithoutFiles.d.ts +6 -0
- package/dist/commands/initWithoutFiles.d.ts.map +1 -0
- package/dist/commands/initWithoutFiles.js +64 -0
- package/dist/commands/initWithoutFiles.js.map +1 -0
- package/dist/commands/login.d.ts +9 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +44 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +3 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +14 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/pull.d.ts +5 -0
- package/dist/commands/pull.d.ts.map +1 -0
- package/dist/commands/pull.js +15 -0
- package/dist/commands/pull.js.map +1 -0
- package/dist/commands/push.d.ts +6 -0
- package/dist/commands/push.d.ts.map +1 -0
- package/dist/commands/push.js +20 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/query.d.ts +7 -0
- package/dist/commands/query.d.ts.map +1 -0
- package/dist/commands/query.js +52 -0
- package/dist/commands/query.js.map +1 -0
- package/dist/commands/webhooks/add.d.ts +9 -0
- package/dist/commands/webhooks/add.d.ts.map +1 -0
- package/dist/commands/webhooks/add.js +75 -0
- package/dist/commands/webhooks/add.js.map +1 -0
- package/dist/commands/webhooks/delete.d.ts +6 -0
- package/dist/commands/webhooks/delete.d.ts.map +1 -0
- package/dist/commands/webhooks/delete.js +17 -0
- package/dist/commands/webhooks/delete.js.map +1 -0
- package/dist/commands/webhooks/disable.d.ts +7 -0
- package/dist/commands/webhooks/disable.d.ts.map +1 -0
- package/dist/commands/webhooks/disable.js +18 -0
- package/dist/commands/webhooks/disable.js.map +1 -0
- package/dist/commands/webhooks/enable.d.ts +6 -0
- package/dist/commands/webhooks/enable.d.ts.map +1 -0
- package/dist/commands/webhooks/enable.js +18 -0
- package/dist/commands/webhooks/enable.js.map +1 -0
- package/dist/commands/webhooks/events/list.d.ts +7 -0
- package/dist/commands/webhooks/events/list.d.ts.map +1 -0
- package/dist/commands/webhooks/events/list.js +31 -0
- package/dist/commands/webhooks/events/list.js.map +1 -0
- package/dist/commands/webhooks/events/payload.d.ts +8 -0
- package/dist/commands/webhooks/events/payload.d.ts.map +1 -0
- package/dist/commands/webhooks/events/payload.js +39 -0
- package/dist/commands/webhooks/events/payload.js.map +1 -0
- package/dist/commands/webhooks/events/resend.d.ts +8 -0
- package/dist/commands/webhooks/events/resend.d.ts.map +1 -0
- package/dist/commands/webhooks/events/resend.js +43 -0
- package/dist/commands/webhooks/events/resend.js.map +1 -0
- package/dist/commands/webhooks/list.d.ts +8 -0
- package/dist/commands/webhooks/list.d.ts.map +1 -0
- package/dist/commands/webhooks/list.js +29 -0
- package/dist/commands/webhooks/list.js.map +1 -0
- package/dist/commands/webhooks/shared.d.ts +40 -0
- package/dist/commands/webhooks/shared.d.ts.map +1 -0
- package/dist/commands/webhooks/shared.js +248 -0
- package/dist/commands/webhooks/shared.js.map +1 -0
- package/dist/commands/webhooks/update.d.ts +10 -0
- package/dist/commands/webhooks/update.d.ts.map +1 -0
- package/dist/commands/webhooks/update.js +189 -0
- package/dist/commands/webhooks/update.js.map +1 -0
- package/dist/context/authToken.d.ts +29 -0
- package/dist/context/authToken.d.ts.map +1 -0
- package/dist/context/authToken.js +73 -0
- package/dist/context/authToken.js.map +1 -0
- package/dist/context/currentApp.d.ts +38 -0
- package/dist/context/currentApp.d.ts.map +1 -0
- package/dist/context/currentApp.js +222 -0
- package/dist/context/currentApp.js.map +1 -0
- package/dist/context/globalOpts.d.ts +11 -0
- package/dist/context/globalOpts.d.ts.map +1 -0
- package/dist/context/globalOpts.js +13 -0
- package/dist/context/globalOpts.js.map +1 -0
- package/dist/context/platformApi.d.ts +19 -0
- package/dist/context/platformApi.d.ts.map +1 -0
- package/dist/context/platformApi.js +24 -0
- package/dist/context/platformApi.js.map +1 -0
- package/dist/context/projectInfo.d.ts +30 -0
- package/dist/context/projectInfo.d.ts.map +1 -0
- package/dist/context/projectInfo.js +153 -0
- package/dist/context/projectInfo.js.map +1 -0
- package/dist/errors.d.ts +10 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +6 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +159 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +714 -0
- package/dist/index.js.map +1 -0
- package/dist/layer.d.ts +25 -0
- package/dist/layer.d.ts.map +1 -0
- package/dist/layer.js +119 -0
- package/dist/layer.js.map +1 -0
- package/dist/lib/args.d.ts +212 -0
- package/dist/lib/args.d.ts.map +1 -0
- package/dist/lib/args.js +313 -0
- package/dist/lib/args.js.map +1 -0
- package/dist/lib/backupDownload.d.ts +21 -0
- package/dist/lib/backupDownload.d.ts.map +1 -0
- package/dist/lib/backupDownload.js +151 -0
- package/dist/lib/backupDownload.js.map +1 -0
- package/dist/lib/backups.d.ts +12 -0
- package/dist/lib/backups.d.ts.map +1 -0
- package/dist/lib/backups.js +26 -0
- package/dist/lib/backups.js.map +1 -0
- package/dist/lib/config.d.ts +6 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +39 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/createApp.d.ts +12 -0
- package/dist/lib/createApp.d.ts.map +1 -0
- package/dist/lib/createApp.js +15 -0
- package/dist/lib/createApp.js.map +1 -0
- package/dist/lib/email.d.ts +47 -0
- package/dist/lib/email.d.ts.map +1 -0
- package/dist/lib/email.js +71 -0
- package/dist/lib/email.js.map +1 -0
- package/dist/lib/handleEnv.d.ts +7 -0
- package/dist/lib/handleEnv.d.ts.map +1 -0
- package/dist/lib/handleEnv.js +99 -0
- package/dist/lib/handleEnv.js.map +1 -0
- package/dist/lib/http.d.ts +30 -0
- package/dist/lib/http.d.ts.map +1 -0
- package/dist/lib/http.js +55 -0
- package/dist/lib/http.js.map +1 -0
- package/dist/lib/login.d.ts +12 -0
- package/dist/lib/login.d.ts.map +1 -0
- package/dist/lib/login.js +38 -0
- package/dist/lib/login.js.map +1 -0
- package/dist/lib/oauth.d.ts +306 -0
- package/dist/lib/oauth.d.ts.map +1 -0
- package/dist/lib/oauth.js +195 -0
- package/dist/lib/oauth.js.map +1 -0
- package/dist/lib/platformApi.d.ts +5 -0
- package/dist/lib/platformApi.d.ts.map +1 -0
- package/dist/lib/platformApi.js +11 -0
- package/dist/lib/platformApi.js.map +1 -0
- package/dist/lib/pullPerms.d.ts +7 -0
- package/dist/lib/pullPerms.d.ts.map +1 -0
- package/dist/lib/pullPerms.js +41 -0
- package/dist/lib/pullPerms.js.map +1 -0
- package/dist/lib/pullSchema.d.ts +12 -0
- package/dist/lib/pullSchema.d.ts.map +1 -0
- package/dist/lib/pullSchema.js +62 -0
- package/dist/lib/pullSchema.js.map +1 -0
- package/dist/lib/pushPerms.d.ts +13 -0
- package/dist/lib/pushPerms.d.ts.map +1 -0
- package/dist/lib/pushPerms.js +54 -0
- package/dist/lib/pushPerms.js.map +1 -0
- package/dist/lib/pushSchema.d.ts +53 -0
- package/dist/lib/pushSchema.d.ts.map +1 -0
- package/dist/lib/pushSchema.js +165 -0
- package/dist/lib/pushSchema.js.map +1 -0
- package/dist/lib/ui.d.ts +18 -0
- package/dist/lib/ui.d.ts.map +1 -0
- package/dist/lib/ui.js +32 -0
- package/dist/lib/ui.js.map +1 -0
- package/dist/lib/webhooks.d.ts +27 -0
- package/dist/lib/webhooks.d.ts.map +1 -0
- package/dist/lib/webhooks.js +95 -0
- package/dist/lib/webhooks.js.map +1 -0
- package/dist/logging.d.ts +5 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/logging.js +25 -0
- package/dist/logging.js.map +1 -0
- package/dist/old.d.ts +17 -0
- package/dist/old.d.ts.map +1 -0
- package/dist/old.js +410 -0
- package/dist/old.js.map +1 -0
- package/dist/program.d.ts +3 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +3 -0
- package/dist/program.js.map +1 -0
- package/dist/renderSchemaPlan.d.ts +19 -0
- package/dist/renderSchemaPlan.d.ts.map +1 -0
- package/dist/renderSchemaPlan.js +220 -0
- package/dist/renderSchemaPlan.js.map +1 -0
- package/dist/ui/index.d.ts +292 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +1296 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/lib.d.ts +124 -0
- package/dist/ui/lib.d.ts.map +1 -0
- package/dist/ui/lib.js +333 -0
- package/dist/ui/lib.js.map +1 -0
- package/dist/util/findConfigCandidates.d.ts +13 -0
- package/dist/util/findConfigCandidates.d.ts.map +1 -0
- package/dist/util/findConfigCandidates.js +211 -0
- package/dist/util/findConfigCandidates.js.map +1 -0
- package/dist/util/fs.d.ts +4 -0
- package/dist/util/fs.d.ts.map +1 -0
- package/dist/util/fs.js +22 -0
- package/dist/util/fs.js.map +1 -0
- package/dist/util/getAppName.d.ts +5 -0
- package/dist/util/getAppName.d.ts.map +1 -0
- package/dist/util/getAppName.js +14 -0
- package/dist/util/getAppName.js.map +1 -0
- package/dist/util/instantConfig.d.ts +9 -0
- package/dist/util/instantConfig.d.ts.map +1 -0
- package/dist/util/instantConfig.js +13 -0
- package/dist/util/instantConfig.js.map +1 -0
- package/dist/util/isHeadlessEnvironment.d.ts +4 -0
- package/dist/util/isHeadlessEnvironment.d.ts.map +1 -0
- package/dist/util/isHeadlessEnvironment.js +11 -0
- package/dist/util/isHeadlessEnvironment.js.map +1 -0
- package/dist/util/loadConfig.d.ts +3 -0
- package/dist/util/loadConfig.d.ts.map +1 -0
- package/dist/util/loadConfig.js +72 -0
- package/dist/util/loadConfig.js.map +1 -0
- package/dist/util/loadEnv.d.ts +2 -0
- package/dist/util/loadEnv.d.ts.map +1 -0
- package/dist/util/loadEnv.js +10 -0
- package/dist/util/loadEnv.js.map +1 -0
- package/dist/util/mergeSchema.d.ts +10 -0
- package/dist/util/mergeSchema.d.ts.map +1 -0
- package/dist/util/mergeSchema.js +338 -0
- package/dist/util/mergeSchema.js.map +1 -0
- package/dist/util/projectDir.d.ts +7 -0
- package/dist/util/projectDir.d.ts.map +1 -0
- package/dist/util/projectDir.js +43 -0
- package/dist/util/projectDir.js.map +1 -0
- package/dist/util/renamePrompt.d.ts +15 -0
- package/dist/util/renamePrompt.d.ts.map +1 -0
- package/dist/util/renamePrompt.js +57 -0
- package/dist/util/renamePrompt.js.map +1 -0
- package/dist/util/sdkInstallSpec.d.ts +13 -0
- package/dist/util/sdkInstallSpec.d.ts.map +1 -0
- package/dist/util/sdkInstallSpec.js +37 -0
- package/dist/util/sdkInstallSpec.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +91 -3
- package/src/auth/index.ts +125 -0
- package/src/commands/app/delete.ts +82 -0
- package/src/commands/app/list.ts +44 -0
- package/src/commands/auth/client/add.ts +744 -0
- package/src/commands/auth/client/delete.ts +60 -0
- package/src/commands/auth/client/list.ts +60 -0
- package/src/commands/auth/client/shared.ts +190 -0
- package/src/commands/auth/client/update.ts +830 -0
- package/src/commands/auth/email/pull.ts +143 -0
- package/src/commands/auth/email/push.ts +94 -0
- package/src/commands/auth/email/resend.ts +8 -0
- package/src/commands/auth/email/reset.ts +37 -0
- package/src/commands/auth/email/status.ts +154 -0
- package/src/commands/auth/email/verify.ts +20 -0
- package/src/commands/auth/origin/add.ts +237 -0
- package/src/commands/auth/origin/delete.ts +50 -0
- package/src/commands/auth/origin/list.ts +66 -0
- package/src/commands/backup/download.ts +231 -0
- package/src/commands/backup/list.ts +94 -0
- package/src/commands/claim.ts +31 -0
- package/src/commands/explorer.ts +21 -0
- package/src/commands/info.ts +57 -0
- package/src/commands/init.ts +60 -0
- package/src/commands/initWithoutFiles.ts +107 -0
- package/src/commands/login.ts +62 -0
- package/src/commands/logout.ts +22 -0
- package/src/commands/pull.ts +22 -0
- package/src/commands/push.ts +25 -0
- package/src/commands/query.ts +61 -0
- package/src/commands/webhooks/add.ts +111 -0
- package/src/commands/webhooks/delete.ts +23 -0
- package/src/commands/webhooks/disable.ts +24 -0
- package/src/commands/webhooks/enable.ts +24 -0
- package/src/commands/webhooks/events/list.ts +38 -0
- package/src/commands/webhooks/events/payload.ts +56 -0
- package/src/commands/webhooks/events/resend.ts +66 -0
- package/src/commands/webhooks/list.ts +41 -0
- package/src/commands/webhooks/shared.ts +339 -0
- package/src/commands/webhooks/update.ts +276 -0
- package/src/context/authToken.ts +134 -0
- package/src/context/currentApp.ts +301 -0
- package/src/context/globalOpts.ts +22 -0
- package/src/context/platformApi.ts +35 -0
- package/src/context/projectInfo.ts +219 -0
- package/src/errors.ts +7 -0
- package/src/index.ts +1212 -0
- package/src/layer.ts +211 -0
- package/src/lib/args.ts +453 -0
- package/src/lib/backupDownload.ts +188 -0
- package/src/lib/backups.ts +33 -0
- package/src/lib/config.ts +73 -0
- package/src/lib/createApp.ts +28 -0
- package/src/lib/email.ts +93 -0
- package/src/lib/handleEnv.ts +122 -0
- package/src/lib/http.ts +128 -0
- package/src/lib/login.ts +48 -0
- package/src/lib/oauth.ts +310 -0
- package/src/lib/platformApi.ts +11 -0
- package/src/lib/pullPerms.ts +50 -0
- package/src/lib/pullSchema.ts +95 -0
- package/src/lib/pushPerms.ts +80 -0
- package/src/lib/pushSchema.ts +248 -0
- package/src/lib/ui.ts +48 -0
- package/src/lib/webhooks.ts +118 -0
- package/src/logging.ts +41 -0
- package/src/old.js +487 -0
- package/src/program.ts +3 -0
- package/src/renderSchemaPlan.ts +324 -0
- package/src/ui/index.ts +1615 -0
- package/src/ui/lib.ts +424 -0
- package/src/util/findConfigCandidates.ts +262 -0
- package/src/util/fs.ts +26 -0
- package/src/util/getAppName.ts +14 -0
- package/src/util/instantConfig.ts +21 -0
- package/src/util/isHeadlessEnvironment.ts +15 -0
- package/src/util/loadConfig.ts +93 -0
- package/src/util/loadEnv.ts +11 -0
- package/src/util/mergeSchema.ts +374 -0
- package/src/util/projectDir.ts +54 -0
- package/src/util/renamePrompt.ts +79 -0
- package/src/util/sdkInstallSpec.ts +45 -0
- package/src/version.js +3 -0
- package/tsconfig.build.json +20 -0
- package/tsconfig.json +23 -0
- package/vitest.config.ts +22 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HttpClient,
|
|
3
|
+
HttpClientRequest,
|
|
4
|
+
HttpClientResponse,
|
|
5
|
+
} from '@effect/platform';
|
|
6
|
+
import {
|
|
7
|
+
apiSchemaToInstantSchemaDef,
|
|
8
|
+
buildAutoRenameSelector,
|
|
9
|
+
collectSystemCatalogIdentNames,
|
|
10
|
+
convertTxSteps,
|
|
11
|
+
diffSchemas,
|
|
12
|
+
SchemaValidationError as PlatformSchemaError,
|
|
13
|
+
validateSchema,
|
|
14
|
+
} from '@instantdb/platform';
|
|
15
|
+
import chalk from 'chalk';
|
|
16
|
+
import { Data, Effect, Schema } from 'effect';
|
|
17
|
+
import { CurrentApp } from '../context/currentApp.ts';
|
|
18
|
+
import {
|
|
19
|
+
readLocalSchemaFile,
|
|
20
|
+
resolveRenames,
|
|
21
|
+
waitForIndexingJobsToFinish,
|
|
22
|
+
} from '../old.js';
|
|
23
|
+
import { getBaseUrl, InstantHttpAuthed, withCommand } from './http.ts';
|
|
24
|
+
|
|
25
|
+
import boxen from 'boxen';
|
|
26
|
+
import { GlobalOpts } from '../context/globalOpts.ts';
|
|
27
|
+
import { pushDef } from '../index.ts';
|
|
28
|
+
import type { OptsFromCommand } from '../index.ts';
|
|
29
|
+
import { groupSteps, renderSchemaPlan } from '../renderSchemaPlan.ts';
|
|
30
|
+
import type { SuperMigrationTx } from '../renderSchemaPlan.ts';
|
|
31
|
+
import { promptOk } from './ui.ts';
|
|
32
|
+
import { AuthToken } from '../context/authToken.ts';
|
|
33
|
+
|
|
34
|
+
const FetchSchemaResponse = Schema.Struct({
|
|
35
|
+
schema: Schema.Struct({
|
|
36
|
+
refs: Schema.Any,
|
|
37
|
+
blobs: Schema.Any,
|
|
38
|
+
}),
|
|
39
|
+
attrs: Schema.Array(Schema.Any).pipe(Schema.mutable),
|
|
40
|
+
'app-title': Schema.String,
|
|
41
|
+
}).pipe(Schema.mutable);
|
|
42
|
+
|
|
43
|
+
export class ReadSchemaFileError extends Schema.TaggedError<ReadSchemaFileError>(
|
|
44
|
+
'ReadSchemaFileError',
|
|
45
|
+
)('ReadSchemaFileError', {
|
|
46
|
+
message: Schema.String,
|
|
47
|
+
cause: Schema.Any.pipe(Schema.optional),
|
|
48
|
+
}) {}
|
|
49
|
+
|
|
50
|
+
export class SchemaDiffError extends Schema.TaggedError<SchemaDiffError>(
|
|
51
|
+
'SchemaDiffError',
|
|
52
|
+
)('SchemaDiffError', {
|
|
53
|
+
message: Schema.String,
|
|
54
|
+
}) {}
|
|
55
|
+
|
|
56
|
+
export class GetSchemaError extends Schema.TaggedError<GetSchemaError>(
|
|
57
|
+
'GetSchemaError',
|
|
58
|
+
)('GetSchemaError', {
|
|
59
|
+
message: Schema.String,
|
|
60
|
+
}) {}
|
|
61
|
+
|
|
62
|
+
export class SchemaValidationError extends Schema.TaggedError<SchemaValidationError>(
|
|
63
|
+
'SchemaValidationError',
|
|
64
|
+
)('SchemaValidationError', {
|
|
65
|
+
message: Schema.String,
|
|
66
|
+
}) {}
|
|
67
|
+
|
|
68
|
+
export const pushSchema = (
|
|
69
|
+
rename?: OptsFromCommand<typeof pushDef>['rename'],
|
|
70
|
+
) =>
|
|
71
|
+
Effect.gen(function* () {
|
|
72
|
+
const localSchemaFile = yield* Effect.tryPromise({
|
|
73
|
+
try: readLocalSchemaFile,
|
|
74
|
+
catch: (e) =>
|
|
75
|
+
e instanceof Error
|
|
76
|
+
? ReadSchemaFileError.make({ message: e.message })
|
|
77
|
+
: ReadSchemaFileError.make({ message: String(e) }),
|
|
78
|
+
});
|
|
79
|
+
if (!localSchemaFile || !localSchemaFile?.schema) {
|
|
80
|
+
return yield* ReadSchemaFileError.make({
|
|
81
|
+
message: `We couldn't find your ${chalk.yellow('`instant.schema.ts`')} file. Make sure it's in the root directory. (Hint: You can use an INSTANT_SCHEMA_FILE_PATH environment variable to specify it.)`,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
if (localSchemaFile.schema?.constructor?.name !== 'InstantSchemaDef') {
|
|
85
|
+
return yield* SchemaValidationError.make({
|
|
86
|
+
message: `We couldn't find your schema export.\nIn your ${chalk.yellow('`instant.schema.ts`')} file, make sure you ${chalk.green('`export default schema`')}`,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const http = yield* InstantHttpAuthed;
|
|
91
|
+
const { appId } = yield* CurrentApp;
|
|
92
|
+
const res = yield* http
|
|
93
|
+
.pipe(withCommand('push'))
|
|
94
|
+
.get(`/dash/apps/${appId}/schema/pull`)
|
|
95
|
+
.pipe(
|
|
96
|
+
Effect.andThen(HttpClientResponse.schemaBodyJson(FetchSchemaResponse)),
|
|
97
|
+
Effect.mapError((e) => GetSchemaError.make({ message: e.message })),
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
const currentAttrs = res['attrs'];
|
|
101
|
+
const currentApiSchema = res['schema'];
|
|
102
|
+
const oldSchema = apiSchemaToInstantSchemaDef(currentApiSchema);
|
|
103
|
+
const systemCatalogIdentNames =
|
|
104
|
+
collectSystemCatalogIdentNames(currentAttrs);
|
|
105
|
+
|
|
106
|
+
yield* Effect.tryPromise({
|
|
107
|
+
try: async () =>
|
|
108
|
+
validateSchema(localSchemaFile.schema, systemCatalogIdentNames),
|
|
109
|
+
catch: (e) => {
|
|
110
|
+
if (e instanceof PlatformSchemaError) {
|
|
111
|
+
return SchemaValidationError.make({
|
|
112
|
+
message: 'Invalid Schema: ' + e.message,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return SchemaValidationError.make({
|
|
116
|
+
message: 'Failed to validate schema' + e,
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
const renames = rename && Array.isArray(rename) ? rename : [];
|
|
121
|
+
const globalOpts = yield* GlobalOpts;
|
|
122
|
+
const autoRenameSelector = buildAutoRenameSelector(renames as any);
|
|
123
|
+
const renameSelector = globalOpts.yes
|
|
124
|
+
? autoRenameSelector
|
|
125
|
+
: async (created: any, promptData: any, extraInfo: any) => {
|
|
126
|
+
const autoResolved = await autoRenameSelector(
|
|
127
|
+
created,
|
|
128
|
+
promptData,
|
|
129
|
+
extraInfo,
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
// If the user provided an explicit --rename match, skip the prompt.
|
|
133
|
+
if (autoResolved !== created) {
|
|
134
|
+
return autoResolved;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return resolveRenames(created, promptData, extraInfo);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const diffResult = yield* Effect.tryPromise(() =>
|
|
141
|
+
diffSchemas(
|
|
142
|
+
oldSchema,
|
|
143
|
+
localSchemaFile.schema,
|
|
144
|
+
renameSelector,
|
|
145
|
+
systemCatalogIdentNames,
|
|
146
|
+
),
|
|
147
|
+
).pipe(
|
|
148
|
+
Effect.mapError((e) => {
|
|
149
|
+
if (e.cause instanceof Error) {
|
|
150
|
+
return SchemaDiffError.make({ message: e.cause.message });
|
|
151
|
+
}
|
|
152
|
+
return SchemaDiffError.make({ message: e.message });
|
|
153
|
+
}),
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
const txSteps = convertTxSteps(diffResult, currentAttrs);
|
|
157
|
+
if (txSteps.length === 0) {
|
|
158
|
+
yield* Effect.log(chalk.bgGray('No schema changes to apply!'));
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const groupedSteps = groupSteps(diffResult);
|
|
163
|
+
yield* confirmSchemaChanges(groupedSteps, currentAttrs);
|
|
164
|
+
|
|
165
|
+
const pushRes = yield* http
|
|
166
|
+
.pipe(
|
|
167
|
+
HttpClient.mapRequestInputEffect(
|
|
168
|
+
HttpClientRequest.bodyJson({
|
|
169
|
+
steps: txSteps,
|
|
170
|
+
}),
|
|
171
|
+
),
|
|
172
|
+
)
|
|
173
|
+
.post(`/dash/apps/${appId}/schema/steps/apply`)
|
|
174
|
+
.pipe(Effect.flatMap(HttpClientResponse.schemaBodyJson(Schema.Any)));
|
|
175
|
+
|
|
176
|
+
yield* Effect.log(chalk.green('Schema updated!'));
|
|
177
|
+
|
|
178
|
+
const authToken = yield* (yield* AuthToken).getAuthToken;
|
|
179
|
+
|
|
180
|
+
if (pushRes?.['indexing-jobs']) {
|
|
181
|
+
// TODO: rewrite in effect
|
|
182
|
+
const apiURI = yield* getBaseUrl;
|
|
183
|
+
yield* Effect.tryPromise({
|
|
184
|
+
try: () =>
|
|
185
|
+
waitForIndexingJobsToFinish(
|
|
186
|
+
appId,
|
|
187
|
+
pushRes?.['indexing-jobs'] || [],
|
|
188
|
+
authToken,
|
|
189
|
+
apiURI,
|
|
190
|
+
),
|
|
191
|
+
catch: (e: any) =>
|
|
192
|
+
WaitForJobsError.make({
|
|
193
|
+
message:
|
|
194
|
+
e?.message || 'Error waiting for schema push jobs to finish',
|
|
195
|
+
}),
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
export class WaitForJobsError extends Schema.TaggedError<WaitForJobsError>(
|
|
201
|
+
'WaitForJobsError',
|
|
202
|
+
)('WaitForJobsError', {
|
|
203
|
+
message: Schema.String,
|
|
204
|
+
}) {}
|
|
205
|
+
|
|
206
|
+
export class CancelSchemaError extends Data.TaggedError('CancelSchemaError')<{
|
|
207
|
+
message: string;
|
|
208
|
+
}> {}
|
|
209
|
+
|
|
210
|
+
const confirmSchemaChanges = (steps: SuperMigrationTx[], currentAttrs: any[]) =>
|
|
211
|
+
Effect.gen(function* () {
|
|
212
|
+
const lines = renderSchemaPlan(steps, currentAttrs);
|
|
213
|
+
const globalOpts = yield* GlobalOpts;
|
|
214
|
+
if (globalOpts.yes) {
|
|
215
|
+
console.log('Applying schema changes...');
|
|
216
|
+
console.log(
|
|
217
|
+
boxen(lines.join('\n'), {
|
|
218
|
+
dimBorder: true,
|
|
219
|
+
padding: {
|
|
220
|
+
left: 1,
|
|
221
|
+
right: 1,
|
|
222
|
+
},
|
|
223
|
+
}),
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
const wantsToPush = yield* promptOk({
|
|
229
|
+
promptText: 'Push these changes?',
|
|
230
|
+
yesText: 'Push',
|
|
231
|
+
noText: 'Cancel',
|
|
232
|
+
modifyOutput: (output) => {
|
|
233
|
+
let both = lines.join('\n') + '\n\n' + output;
|
|
234
|
+
return boxen(both, {
|
|
235
|
+
dimBorder: true,
|
|
236
|
+
padding: {
|
|
237
|
+
left: 1,
|
|
238
|
+
right: 1,
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
if (!wantsToPush) {
|
|
244
|
+
return yield* new CancelSchemaError({
|
|
245
|
+
message: 'Schema Migration Cancelled',
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
});
|
package/src/lib/ui.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Data, Effect } from 'effect';
|
|
2
|
+
import { GlobalOpts } from '../context/globalOpts.ts';
|
|
3
|
+
import { Prompt, renderUnwrap } from '../ui/lib.ts';
|
|
4
|
+
import { UI } from '../ui/index.ts';
|
|
5
|
+
|
|
6
|
+
export class UIError extends Data.TaggedError('UIError')<{
|
|
7
|
+
message: string;
|
|
8
|
+
cause?: unknown;
|
|
9
|
+
}> {}
|
|
10
|
+
|
|
11
|
+
export const promptOk = Effect.fn('promptOk')(function* (
|
|
12
|
+
props: UI.ConfirmationProps,
|
|
13
|
+
defaultValue: boolean = true,
|
|
14
|
+
) {
|
|
15
|
+
const opts = yield* GlobalOpts;
|
|
16
|
+
if (opts.yes) {
|
|
17
|
+
return defaultValue;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return yield* Effect.tryPromise(() =>
|
|
21
|
+
renderUnwrap(
|
|
22
|
+
new UI.Confirmation({
|
|
23
|
+
...props,
|
|
24
|
+
defaultValue,
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const runUIEffect = <P>(prompt: Prompt<P>) =>
|
|
31
|
+
Effect.tryPromise({
|
|
32
|
+
try: () => renderUnwrap(prompt),
|
|
33
|
+
catch: (error) =>
|
|
34
|
+
new UIError({
|
|
35
|
+
message: error instanceof Error ? error.message : String(error),
|
|
36
|
+
}),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const stripFirstBlankLine = (str: string): string => {
|
|
40
|
+
const lines = str.split('\n');
|
|
41
|
+
const firstBlankIndex = lines.findIndex((line) => line.trim() === '');
|
|
42
|
+
if (firstBlankIndex === -1) return str;
|
|
43
|
+
lines.splice(firstBlankIndex, 1);
|
|
44
|
+
return lines.join('\n');
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const validateRequired = (input: string) =>
|
|
48
|
+
input.trim().length > 0 ? undefined : 'Value is required';
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import {
|
|
3
|
+
type WebhookAction,
|
|
4
|
+
type WebhookEventInfo,
|
|
5
|
+
type WebhooksManager,
|
|
6
|
+
} from '@instantdb/platform';
|
|
7
|
+
import { CurrentApp } from '../context/currentApp.ts';
|
|
8
|
+
import { PlatformApiError } from '../context/platformApi.ts';
|
|
9
|
+
import { BadArgsError } from '../errors.ts';
|
|
10
|
+
import { getAuthedPlatformApi } from './platformApi.ts';
|
|
11
|
+
|
|
12
|
+
export const WEBHOOK_ACTIONS: readonly WebhookAction[] = [
|
|
13
|
+
'create',
|
|
14
|
+
'update',
|
|
15
|
+
'delete',
|
|
16
|
+
] as const;
|
|
17
|
+
|
|
18
|
+
export const useWebhooksManager = <R>(
|
|
19
|
+
fun: (manager: WebhooksManager<any>) => Promise<R>,
|
|
20
|
+
errorMessage?: string,
|
|
21
|
+
) =>
|
|
22
|
+
Effect.gen(function* () {
|
|
23
|
+
const api = yield* getAuthedPlatformApi;
|
|
24
|
+
const { appId } = yield* CurrentApp;
|
|
25
|
+
return yield* Effect.tryPromise({
|
|
26
|
+
try: () => fun(api.webhooks(appId).manager),
|
|
27
|
+
catch: (e) =>
|
|
28
|
+
new PlatformApiError({
|
|
29
|
+
message: errorMessage ?? 'Error using webhooks api',
|
|
30
|
+
cause: e,
|
|
31
|
+
}),
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Yields a `WebhooksManager` instance scoped to the current app. Use when you
|
|
37
|
+
* need to hold on to the manager outside an Effect (e.g. to call from inside
|
|
38
|
+
* an async UI callback).
|
|
39
|
+
*/
|
|
40
|
+
export const buildWebhooksManager = Effect.gen(function* () {
|
|
41
|
+
const api = yield* getAuthedPlatformApi;
|
|
42
|
+
const { appId } = yield* CurrentApp;
|
|
43
|
+
return api.webhooks(appId).manager;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Fetches the app's schema and returns the sorted list of namespace names. Returns
|
|
48
|
+
* `null` if the schema can't be fetched (network, auth, missing app, etc.) so
|
|
49
|
+
* callers can fall back to a plain text prompt.
|
|
50
|
+
*/
|
|
51
|
+
export const getRemoteNamespaces = Effect.gen(function* () {
|
|
52
|
+
const api = yield* getAuthedPlatformApi;
|
|
53
|
+
const { appId } = yield* CurrentApp;
|
|
54
|
+
const result = yield* Effect.tryPromise(() => api.getSchema(appId)).pipe(
|
|
55
|
+
Effect.orElseSucceed(() => null),
|
|
56
|
+
);
|
|
57
|
+
if (!result) return null;
|
|
58
|
+
const entities = result.schema?.entities ?? {};
|
|
59
|
+
return Object.keys(entities).sort();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Pages through `manager.listEvents` until we have `limit` events or the server
|
|
64
|
+
* runs out. Returns the events in their natural (newest-first) order.
|
|
65
|
+
*/
|
|
66
|
+
export const fetchRecentEvents = (webhookId: string, limit: number) =>
|
|
67
|
+
Effect.gen(function* () {
|
|
68
|
+
const collected: WebhookEventInfo[] = [];
|
|
69
|
+
let after: string | undefined;
|
|
70
|
+
while (collected.length < limit) {
|
|
71
|
+
const page = yield* useWebhooksManager(
|
|
72
|
+
(m) => m.listEvents(webhookId, after ? { after } : undefined),
|
|
73
|
+
'Error listing webhook events',
|
|
74
|
+
);
|
|
75
|
+
collected.push(...page.events);
|
|
76
|
+
if (!page.pageInfo.hasNextPage || !page.pageInfo.endCursor) break;
|
|
77
|
+
after = page.pageInfo.endCursor;
|
|
78
|
+
}
|
|
79
|
+
return collected.slice(0, limit);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const splitCsv = (s: string) =>
|
|
83
|
+
s
|
|
84
|
+
.split(',')
|
|
85
|
+
.map((t) => t.trim())
|
|
86
|
+
.filter((t) => t.length > 0);
|
|
87
|
+
|
|
88
|
+
export const parseNamespaces = (raw: string | undefined) =>
|
|
89
|
+
Effect.gen(function* () {
|
|
90
|
+
if (raw === undefined) return undefined;
|
|
91
|
+
const namespaces = splitCsv(raw);
|
|
92
|
+
if (namespaces.length === 0) {
|
|
93
|
+
return yield* BadArgsError.make({
|
|
94
|
+
message: '--namespaces must include at least one namespace',
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return namespaces;
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
export const parseActions = (raw: string | undefined) =>
|
|
101
|
+
Effect.gen(function* () {
|
|
102
|
+
if (raw === undefined) return undefined;
|
|
103
|
+
const tokens = splitCsv(raw);
|
|
104
|
+
if (tokens.length === 0) {
|
|
105
|
+
return yield* BadArgsError.make({
|
|
106
|
+
message: '--actions must include at least one action',
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
const invalid = tokens.filter(
|
|
110
|
+
(t): t is string => !WEBHOOK_ACTIONS.includes(t as WebhookAction),
|
|
111
|
+
);
|
|
112
|
+
if (invalid.length > 0) {
|
|
113
|
+
return yield* BadArgsError.make({
|
|
114
|
+
message: `Invalid action${invalid.length === 1 ? '' : 's'}: ${invalid.join(', ')}. Must be one of: ${WEBHOOK_ACTIONS.join(', ')}`,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
return tokens as WebhookAction[];
|
|
118
|
+
});
|
package/src/logging.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import ansiEscapes from 'ansi-escapes';
|
|
3
|
+
import { HashMap, Logger, Match, Option } from 'effect';
|
|
4
|
+
import supportsHyperlinks from 'supports-hyperlinks';
|
|
5
|
+
|
|
6
|
+
export function warn(firstArg: string, ...rest: any[]) {
|
|
7
|
+
console.warn(chalk.yellow('[warning]') + ' ' + firstArg, ...rest);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function error(firstArg: string, ...rest: any[]) {
|
|
11
|
+
console.error(chalk.red('[error]') + ' ' + firstArg, ...rest);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const simpleLogger = Logger.make(({ logLevel, message, annotations }) => {
|
|
15
|
+
const isSilent = HashMap.get(annotations, 'silent').pipe(Option.getOrNull);
|
|
16
|
+
if (isSilent) return;
|
|
17
|
+
const formattedMessage = Array.isArray(message) ? message : [message];
|
|
18
|
+
Match.value(logLevel).pipe(
|
|
19
|
+
Match.tag('Info', () => console.log(...formattedMessage)),
|
|
20
|
+
Match.tag('Warning', () => console.warn(...formattedMessage)),
|
|
21
|
+
Match.tag('Error', () =>
|
|
22
|
+
console.error(chalk.red('[error]'), ...formattedMessage),
|
|
23
|
+
),
|
|
24
|
+
Match.tag('Debug', () => console.debug(...formattedMessage)),
|
|
25
|
+
Match.tag('Fatal', () =>
|
|
26
|
+
console.error(chalk.red('[error]'), ...formattedMessage),
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const SimpleLogLayer = Logger.replace(
|
|
32
|
+
Logger.defaultLogger,
|
|
33
|
+
simpleLogger,
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export const link = (url: string, text?: string): string => {
|
|
37
|
+
if (supportsHyperlinks.stdout) {
|
|
38
|
+
return ansiEscapes.link(text ?? url, url);
|
|
39
|
+
}
|
|
40
|
+
return text ?? url;
|
|
41
|
+
};
|