@osdk/cli 0.21.0 → 0.21.1-main-20240520153817
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/bin/osdk.mjs +1 -1
- package/build/{js/chunk-CWMSASIM.mjs → browser/chunk-2FHBRDJE.js} +2 -2
- package/build/{js/chunk-CWMSASIM.mjs.map → browser/chunk-2FHBRDJE.js.map} +1 -1
- package/build/{js/chunk-ZSTKOCBT.mjs → browser/chunk-CSAU5B4Q.js} +1 -1
- package/build/{js/chunk-IV3QY3PZ.mjs → browser/chunk-IRSUCKI2.js} +1 -1
- package/build/{js/chunk-7TH4NYPV.mjs → browser/chunk-OEF2D4DM.js} +4 -4
- package/build/browser/chunk-OEF2D4DM.js.map +1 -0
- package/build/{js/chunk-SFL6QONJ.mjs → browser/chunk-YYFW7BKO.js} +2 -2
- package/build/{js/chunk-EVW4VRJL.cjs.map → browser/chunk-YYFW7BKO.js.map} +1 -1
- package/build/{js/handleGenerate-DRFYKWQT-QCM2OHJ4.browser.mjs → browser/handleGenerate-Q7NWLXQZ-3W5T7IMO.js} +9 -9
- package/build/browser/handleGenerate-Q7NWLXQZ-3W5T7IMO.js.map +1 -0
- package/build/{js/index.mjs → browser/index.js} +12 -12
- package/build/browser/index.js.map +1 -0
- package/build/browser/loginFlow-GNJ6KQOA.js +4 -0
- package/build/{js/siteDeployCommand-YJKM6IHQ.mjs → browser/siteDeployCommand-B5W73ESD.js} +4 -4
- package/build/{js/versionDeleteCommand-6ORATPGY.mjs → browser/versionDeleteCommand-LGIRLZKW.js} +5 -5
- package/build/{js/versionGetCommand-AWJAOMOS.mjs → browser/versionGetCommand-5ALSQV3H.js} +4 -4
- package/build/{js/versionListCommand-64FKTE5A.mjs → browser/versionListCommand-MZW75OW3.js} +4 -4
- package/build/{js/versionSetCommand-3RMHGSFP.mjs → browser/versionSetCommand-4A44BU4S.js} +4 -4
- package/build/{js/versionUnsetCommand-LCVDAY3G.mjs → browser/versionUnsetCommand-RSPPJHOD.js} +5 -5
- package/build/{js/chunk-467BAS7X.cjs → cjs/chunk-KN4OGPAB.cjs} +2 -2
- package/build/{js/chunk-FRT6INSG.browser.mjs.map → cjs/chunk-KN4OGPAB.cjs.map} +1 -1
- package/build/{js/chunk-RDU2ZTMI.cjs → cjs/chunk-LGCW6EG4.cjs} +9 -9
- package/build/cjs/chunk-LGCW6EG4.cjs.map +1 -0
- package/build/{js/chunk-EVW4VRJL.cjs → cjs/chunk-V7DUQNL2.cjs} +2 -2
- package/build/{js/chunk-F6DFEGKQ.browser.mjs.map → cjs/chunk-V7DUQNL2.cjs.map} +1 -1
- package/build/{js/handleGenerate-DRFYKWQT-FDZDUHIN.cjs → cjs/handleGenerate-Q7NWLXQZ-W5BEOH43.cjs} +11 -11
- package/build/cjs/handleGenerate-Q7NWLXQZ-W5BEOH43.cjs.map +1 -0
- package/build/{js → cjs}/index.cjs +26 -26
- package/build/cjs/index.cjs.map +1 -0
- package/build/cjs/loginFlow-CZE5UISW.cjs +10 -0
- package/build/{js/siteDeployCommand-GMBGL3RG.cjs → cjs/siteDeployCommand-XFKJ2GG4.cjs} +15 -15
- package/build/{js/versionDeleteCommand-WTE2F2Q4.cjs → cjs/versionDeleteCommand-3UJFFUZU.cjs} +6 -6
- package/build/{js/versionGetCommand-224LQCV2.cjs → cjs/versionGetCommand-JHW6OPNC.cjs} +6 -6
- package/build/{js/versionListCommand-RDD36VVN.cjs → cjs/versionListCommand-BRWYWE4W.cjs} +6 -6
- package/build/{js/versionSetCommand-S6ZIZCO7.cjs → cjs/versionSetCommand-RUWXBGQT.cjs} +6 -6
- package/build/{js/versionUnsetCommand-KWJ2HTVP.cjs → cjs/versionUnsetCommand-6RAFJ764.cjs} +6 -6
- package/build/{js/chunk-FRT6INSG.browser.mjs → esm/chunk-2FHBRDJE.js} +2 -2
- package/build/{js/chunk-467BAS7X.cjs.map → esm/chunk-2FHBRDJE.js.map} +1 -1
- package/build/{js/chunk-R2RMUNCR.browser.mjs → esm/chunk-CSAU5B4Q.js} +1 -1
- package/build/{js/chunk-3NRUGBBO.browser.mjs → esm/chunk-IRSUCKI2.js} +1 -1
- package/build/{js/chunk-CEO3PNOH.browser.mjs → esm/chunk-OEF2D4DM.js} +4 -4
- package/build/esm/chunk-OEF2D4DM.js.map +1 -0
- package/build/{js/chunk-F6DFEGKQ.browser.mjs → esm/chunk-YYFW7BKO.js} +2 -2
- package/build/{js/chunk-SFL6QONJ.mjs.map → esm/chunk-YYFW7BKO.js.map} +1 -1
- package/build/{js/handleGenerate-DRFYKWQT-LRYJYXYE.mjs → esm/handleGenerate-Q7NWLXQZ-3W5T7IMO.js} +9 -9
- package/build/esm/handleGenerate-Q7NWLXQZ-3W5T7IMO.js.map +1 -0
- package/build/{js/index.browser.mjs → esm/index.js} +12 -12
- package/build/esm/index.js.map +1 -0
- package/build/esm/loginFlow-GNJ6KQOA.js +4 -0
- package/build/{js/siteDeployCommand-GFTMCO6T.browser.mjs → esm/siteDeployCommand-B5W73ESD.js} +4 -4
- package/build/{js/versionDeleteCommand-IRLMPT3T.browser.mjs → esm/versionDeleteCommand-LGIRLZKW.js} +5 -5
- package/build/{js/versionGetCommand-WFW3BKEJ.browser.mjs → esm/versionGetCommand-5ALSQV3H.js} +4 -4
- package/build/{js/versionListCommand-Q4YH4RCF.browser.mjs → esm/versionListCommand-MZW75OW3.js} +4 -4
- package/build/{js/versionSetCommand-VJWTVSSI.browser.mjs → esm/versionSetCommand-4A44BU4S.js} +4 -4
- package/build/{js/versionUnsetCommand-H3MIPGWV.browser.mjs → esm/versionUnsetCommand-RSPPJHOD.js} +5 -5
- package/package.json +17 -17
- package/build/js/chunk-7TH4NYPV.mjs.map +0 -1
- package/build/js/chunk-CEO3PNOH.browser.mjs.map +0 -1
- package/build/js/chunk-RDU2ZTMI.cjs.map +0 -1
- package/build/js/handleGenerate-DRFYKWQT-FDZDUHIN.cjs.map +0 -1
- package/build/js/handleGenerate-DRFYKWQT-LRYJYXYE.mjs.map +0 -1
- package/build/js/handleGenerate-DRFYKWQT-QCM2OHJ4.browser.mjs.map +0 -1
- package/build/js/index.browser.mjs.map +0 -1
- package/build/js/index.cjs.map +0 -1
- package/build/js/index.mjs.map +0 -1
- package/build/js/loginFlow-3V5OVOTH.cjs +0 -10
- package/build/js/loginFlow-BANHJOZG.browser.mjs +0 -4
- package/build/js/loginFlow-IBTRFIH3.mjs +0 -4
- /package/build/{js/chunk-7G2FSZUY.cjs.map → browser/chunk-CSAU5B4Q.js.map} +0 -0
- /package/build/{js/chunk-3NRUGBBO.browser.mjs.map → browser/chunk-IRSUCKI2.js.map} +0 -0
- /package/build/{js/loginFlow-3V5OVOTH.cjs.map → browser/loginFlow-GNJ6KQOA.js.map} +0 -0
- /package/build/{js/siteDeployCommand-GFTMCO6T.browser.mjs.map → browser/siteDeployCommand-B5W73ESD.js.map} +0 -0
- /package/build/{js/versionDeleteCommand-6ORATPGY.mjs.map → browser/versionDeleteCommand-LGIRLZKW.js.map} +0 -0
- /package/build/{js/versionGetCommand-224LQCV2.cjs.map → browser/versionGetCommand-5ALSQV3H.js.map} +0 -0
- /package/build/{js/versionListCommand-64FKTE5A.mjs.map → browser/versionListCommand-MZW75OW3.js.map} +0 -0
- /package/build/{js/versionSetCommand-3RMHGSFP.mjs.map → browser/versionSetCommand-4A44BU4S.js.map} +0 -0
- /package/build/{js/versionUnsetCommand-H3MIPGWV.browser.mjs.map → browser/versionUnsetCommand-RSPPJHOD.js.map} +0 -0
- /package/build/{js → cjs}/chunk-7G2FSZUY.cjs +0 -0
- /package/build/{js/chunk-R2RMUNCR.browser.mjs.map → cjs/chunk-7G2FSZUY.cjs.map} +0 -0
- /package/build/{js → cjs}/chunk-DQYIDDJN.cjs +0 -0
- /package/build/{js → cjs}/chunk-DQYIDDJN.cjs.map +0 -0
- /package/build/{js/loginFlow-BANHJOZG.browser.mjs.map → cjs/loginFlow-CZE5UISW.cjs.map} +0 -0
- /package/build/{js/siteDeployCommand-GMBGL3RG.cjs.map → cjs/siteDeployCommand-XFKJ2GG4.cjs.map} +0 -0
- /package/build/{js/versionDeleteCommand-IRLMPT3T.browser.mjs.map → cjs/versionDeleteCommand-3UJFFUZU.cjs.map} +0 -0
- /package/build/{js/versionGetCommand-AWJAOMOS.mjs.map → cjs/versionGetCommand-JHW6OPNC.cjs.map} +0 -0
- /package/build/{js/versionListCommand-Q4YH4RCF.browser.mjs.map → cjs/versionListCommand-BRWYWE4W.cjs.map} +0 -0
- /package/build/{js/versionSetCommand-S6ZIZCO7.cjs.map → cjs/versionSetCommand-RUWXBGQT.cjs.map} +0 -0
- /package/build/{js/versionUnsetCommand-KWJ2HTVP.cjs.map → cjs/versionUnsetCommand-6RAFJ764.cjs.map} +0 -0
- /package/build/{js/chunk-ZSTKOCBT.mjs.map → esm/chunk-CSAU5B4Q.js.map} +0 -0
- /package/build/{js/chunk-IV3QY3PZ.mjs.map → esm/chunk-IRSUCKI2.js.map} +0 -0
- /package/build/{types → esm}/cli.d.ts +0 -0
- /package/build/{types → esm}/cli.d.ts.map +0 -0
- /package/build/{types → esm}/commands/auth/index.d.ts +0 -0
- /package/build/{types → esm}/commands/auth/index.d.ts.map +0 -0
- /package/build/{types → esm}/commands/auth/login/index.d.ts +0 -0
- /package/build/{types → esm}/commands/auth/login/index.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/CommonSiteArgs.d.ts +0 -0
- /package/build/{types → esm}/commands/site/CommonSiteArgs.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/deploy/SiteDeployArgs.d.ts +0 -0
- /package/build/{types → esm}/commands/site/deploy/SiteDeployArgs.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/deploy/index.d.ts +0 -0
- /package/build/{types → esm}/commands/site/deploy/index.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/deploy/logDeployCommandConfigFileOverride.d.ts +0 -0
- /package/build/{types → esm}/commands/site/deploy/logDeployCommandConfigFileOverride.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/deploy/siteDeployCommand.d.mts +0 -0
- /package/build/{types → esm}/commands/site/deploy/siteDeployCommand.d.mts.map +0 -0
- /package/build/{types → esm}/commands/site/index.d.ts +0 -0
- /package/build/{types → esm}/commands/site/index.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/logSiteCommandConfigFileOverride.d.ts +0 -0
- /package/build/{types → esm}/commands/site/logSiteCommandConfigFileOverride.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/version/delete/VersionDeleteArgs.d.ts +0 -0
- /package/build/{types → esm}/commands/site/version/delete/VersionDeleteArgs.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/version/delete/index.d.ts +0 -0
- /package/build/{types → esm}/commands/site/version/delete/index.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/version/delete/versionDeleteCommand.d.mts +0 -0
- /package/build/{types → esm}/commands/site/version/delete/versionDeleteCommand.d.mts.map +0 -0
- /package/build/{types → esm}/commands/site/version/get/VersionGetArgs.d.ts +0 -0
- /package/build/{types → esm}/commands/site/version/get/VersionGetArgs.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/version/get/index.d.ts +0 -0
- /package/build/{types → esm}/commands/site/version/get/index.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/version/get/versionGetCommand.d.mts +0 -0
- /package/build/{types → esm}/commands/site/version/get/versionGetCommand.d.mts.map +0 -0
- /package/build/{types → esm}/commands/site/version/index.d.ts +0 -0
- /package/build/{types → esm}/commands/site/version/index.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/version/list/VersionListArgs.d.ts +0 -0
- /package/build/{types → esm}/commands/site/version/list/VersionListArgs.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/version/list/index.d.ts +0 -0
- /package/build/{types → esm}/commands/site/version/list/index.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/version/list/versionListCommand.d.mts +0 -0
- /package/build/{types → esm}/commands/site/version/list/versionListCommand.d.mts.map +0 -0
- /package/build/{types → esm}/commands/site/version/set/VersionSetArgs.d.ts +0 -0
- /package/build/{types → esm}/commands/site/version/set/VersionSetArgs.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/version/set/index.d.ts +0 -0
- /package/build/{types → esm}/commands/site/version/set/index.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/version/set/versionSetCommand.d.mts +0 -0
- /package/build/{types → esm}/commands/site/version/set/versionSetCommand.d.mts.map +0 -0
- /package/build/{types → esm}/commands/site/version/unset/VersionUnsetArgs.d.ts +0 -0
- /package/build/{types → esm}/commands/site/version/unset/VersionUnsetArgs.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/version/unset/index.d.ts +0 -0
- /package/build/{types → esm}/commands/site/version/unset/index.d.ts.map +0 -0
- /package/build/{types → esm}/commands/site/version/unset/versionUnsetCommand.d.mts +0 -0
- /package/build/{types → esm}/commands/site/version/unset/versionUnsetCommand.d.mts.map +0 -0
- /package/build/{types → esm}/consola/handlePromptCancel.d.ts +0 -0
- /package/build/{types → esm}/consola/handlePromptCancel.d.ts.map +0 -0
- /package/build/{types → esm}/index.d.ts +0 -0
- /package/build/{types → esm}/index.d.ts.map +0 -0
- /package/build/{js/loginFlow-IBTRFIH3.mjs.map → esm/loginFlow-GNJ6KQOA.js.map} +0 -0
- /package/build/{types → esm}/net/ThirdPartyAppRid.d.ts +0 -0
- /package/build/{types → esm}/net/ThirdPartyAppRid.d.ts.map +0 -0
- /package/build/{types → esm}/net/UserAgent.d.ts +0 -0
- /package/build/{types → esm}/net/UserAgent.d.ts.map +0 -0
- /package/build/{types → esm}/net/createFetch.d.mts +0 -0
- /package/build/{types → esm}/net/createFetch.d.mts.map +0 -0
- /package/build/{types → esm}/net/createInternalClientContext.d.mts +0 -0
- /package/build/{types → esm}/net/createInternalClientContext.d.mts.map +0 -0
- /package/build/{types → esm}/net/index.d.mts +0 -0
- /package/build/{types → esm}/net/index.d.mts.map +0 -0
- /package/build/{types → esm}/net/internalClientContext.d.mts +0 -0
- /package/build/{types → esm}/net/internalClientContext.d.mts.map +0 -0
- /package/build/{types → esm}/net/third-party-applications/DeployWebsiteRequest.d.mts +0 -0
- /package/build/{types → esm}/net/third-party-applications/DeployWebsiteRequest.d.mts.map +0 -0
- /package/build/{types → esm}/net/third-party-applications/ListVersionsResponse.d.mts +0 -0
- /package/build/{types → esm}/net/third-party-applications/ListVersionsResponse.d.mts.map +0 -0
- /package/build/{types → esm}/net/third-party-applications/Version.d.mts +0 -0
- /package/build/{types → esm}/net/third-party-applications/Version.d.mts.map +0 -0
- /package/build/{types → esm}/net/third-party-applications/Website.d.mts +0 -0
- /package/build/{types → esm}/net/third-party-applications/Website.d.mts.map +0 -0
- /package/build/{types → esm}/net/third-party-applications/deleteVersion.d.mts +0 -0
- /package/build/{types → esm}/net/third-party-applications/deleteVersion.d.mts.map +0 -0
- /package/build/{types → esm}/net/third-party-applications/deployWebsite.d.mts +0 -0
- /package/build/{types → esm}/net/third-party-applications/deployWebsite.d.mts.map +0 -0
- /package/build/{types → esm}/net/third-party-applications/getWebsite.d.mts +0 -0
- /package/build/{types → esm}/net/third-party-applications/getWebsite.d.mts.map +0 -0
- /package/build/{types → esm}/net/third-party-applications/index.d.mts +0 -0
- /package/build/{types → esm}/net/third-party-applications/index.d.mts.map +0 -0
- /package/build/{types → esm}/net/third-party-applications/listVersions.d.mts +0 -0
- /package/build/{types → esm}/net/third-party-applications/listVersions.d.mts.map +0 -0
- /package/build/{types → esm}/net/third-party-applications/undeployWebsite.d.mts +0 -0
- /package/build/{types → esm}/net/third-party-applications/undeployWebsite.d.mts.map +0 -0
- /package/build/{types → esm}/net/third-party-applications/uploadVersion.d.mts +0 -0
- /package/build/{types → esm}/net/third-party-applications/uploadVersion.d.mts.map +0 -0
- /package/build/{js/siteDeployCommand-YJKM6IHQ.mjs.map → esm/siteDeployCommand-B5W73ESD.js.map} +0 -0
- /package/build/{types → esm}/util/autoVersion.d.ts +0 -0
- /package/build/{types → esm}/util/autoVersion.d.ts.map +0 -0
- /package/build/{types → esm}/util/autoVersion.test.d.ts +0 -0
- /package/build/{types → esm}/util/autoVersion.test.d.ts.map +0 -0
- /package/build/{types → esm}/util/config.d.ts +0 -0
- /package/build/{types → esm}/util/config.d.ts.map +0 -0
- /package/build/{types → esm}/util/config.test.d.ts +0 -0
- /package/build/{types → esm}/util/config.test.d.ts.map +0 -0
- /package/build/{types → esm}/util/configLoader.d.ts +0 -0
- /package/build/{types → esm}/util/configLoader.d.ts.map +0 -0
- /package/build/{types → esm}/util/isValidSemver.test.d.ts +0 -0
- /package/build/{types → esm}/util/isValidSemver.test.d.ts.map +0 -0
- /package/build/{types → esm}/util/token.d.ts +0 -0
- /package/build/{types → esm}/util/token.d.ts.map +0 -0
- /package/build/{types → esm}/util/token.test.d.ts +0 -0
- /package/build/{types → esm}/util/token.test.d.ts.map +0 -0
- /package/build/{js/versionDeleteCommand-WTE2F2Q4.cjs.map → esm/versionDeleteCommand-LGIRLZKW.js.map} +0 -0
- /package/build/{js/versionGetCommand-WFW3BKEJ.browser.mjs.map → esm/versionGetCommand-5ALSQV3H.js.map} +0 -0
- /package/build/{js/versionListCommand-RDD36VVN.cjs.map → esm/versionListCommand-MZW75OW3.js.map} +0 -0
- /package/build/{js/versionSetCommand-VJWTVSSI.browser.mjs.map → esm/versionSetCommand-4A44BU4S.js.map} +0 -0
- /package/build/{js/versionUnsetCommand-LCVDAY3G.mjs.map → esm/versionUnsetCommand-RSPPJHOD.js.map} +0 -0
- /package/build/{types → esm}/yargs/logConfigFileMiddleware.d.ts +0 -0
- /package/build/{types → esm}/yargs/logConfigFileMiddleware.d.ts.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../cli.common/build/
|
|
1
|
+
{"version":3,"sources":["../../../cli.common/build/esm/index.js"],"names":[],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AACzB,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,SAAS,aAAa;AAGtB,IAAI,mB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AA,IACF;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AACH;AACA,SAAS,cAAc,cAAc;AACnC,SAAO,MAAM,YAAY,KAAK;AAChC","sourcesContent":["import { consola } from 'consola';\nimport { colorize } from 'consola/utils';\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\nimport { valid } from 'semver';\n\n// src/ExitProcessError.ts\nvar ExitProcessError = class extends Error {\n constructor(errorCode, msg, tip, originalError) {\n super(msg);\n this.errorCode = errorCode;\n this.msg = msg;\n this.tip = tip;\n this.originalError = originalError;\n }\n};\nvar firstTime = true;\nasync function logLevelMiddleware(args) {\n if (firstTime) {\n firstTime = false;\n consola.level = 3 + args.verbose;\n if (consola.level > 3) {\n consola.debug(`Verbose logging enabled (${consola.level === 4 ? \"debug\" : \"trace\"})\n`);\n }\n }\n}\n\n// src/YargsCheckError.ts\nvar YargsCheckError = class extends Error {\n constructor(msg) {\n super(msg);\n }\n};\n\n// src/getYargsBase.ts\nfunction getYargsBase(args) {\n return yargs(hideBin(args)).wrap(Math.min(150, yargs().terminalWidth())).env(\"OSDK\").version(false).option(\"verbose\", {\n alias: \"v\",\n type: \"boolean\",\n description: \"Enable verbose logging\",\n count: true\n }).demandCommand().middleware(logLevelMiddleware, true).strict().fail(async (msg, err, argv) => {\n if (err instanceof ExitProcessError) {\n consola.error(err.message);\n if (err.tip != null) {\n consola.log(colorize(\"bold\", `\\u{1F4A1} Tip: ${err.tip}`));\n consola.log(\"\");\n }\n consola.debug(err.stack);\n } else {\n if (err && err instanceof YargsCheckError === false) {\n throw err;\n } else {\n argv.showHelp();\n consola.log(\"\");\n consola.error(msg);\n }\n }\n process.exit(1);\n });\n}\nfunction isValidSemver(semverString) {\n return valid(semverString) != null;\n}\nexport { ExitProcessError, YargsCheckError, getYargsBase, isValidSemver };"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkKN4OGPAB_cjs = require('./chunk-KN4OGPAB.cjs');
|
|
4
4
|
var chunk7G2FSZUY_cjs = require('./chunk-7G2FSZUY.cjs');
|
|
5
5
|
var shared_net = require('@osdk/shared.net');
|
|
6
6
|
var consola = require('consola');
|
|
@@ -31,7 +31,7 @@ chunk7G2FSZUY_cjs.__export(third_party_applications_exports, {
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
// src/net/UserAgent.ts
|
|
34
|
-
var USER_AGENT = `osdk-cli/${"0.21.
|
|
34
|
+
var USER_AGENT = `osdk-cli/${"0.21.1-main-20240520153817"}`;
|
|
35
35
|
|
|
36
36
|
// src/net/createFetch.mts
|
|
37
37
|
function createFetch(tokenProvider, fetchFn = fetch) {
|
|
@@ -49,7 +49,7 @@ function createErrorExitingFetch(fetchFn = fetch) {
|
|
|
49
49
|
}
|
|
50
50
|
function handleFetchError(e) {
|
|
51
51
|
if (!(e instanceof shared_net.PalantirApiError)) {
|
|
52
|
-
throw new
|
|
52
|
+
throw new chunkKN4OGPAB_cjs.ExitProcessError(1, "Unexpected fetch error");
|
|
53
53
|
}
|
|
54
54
|
let tip;
|
|
55
55
|
if (e.statusCode === 401) {
|
|
@@ -68,7 +68,7 @@ function handleFetchError(e) {
|
|
|
68
68
|
} else if (e.errorName === "VersionNotFound") {
|
|
69
69
|
message = "The site version could not be found";
|
|
70
70
|
}
|
|
71
|
-
throw new
|
|
71
|
+
throw new chunkKN4OGPAB_cjs.ExitProcessError(1, message, tip, e);
|
|
72
72
|
}
|
|
73
73
|
function createRequestLoggingFetch(fetchFn = fetch) {
|
|
74
74
|
return function requestLoggingFetch(input, init) {
|
|
@@ -110,7 +110,7 @@ async function getWebsite(ctx, thirdPartyAppRid) {
|
|
|
110
110
|
const result = await fetch2(url);
|
|
111
111
|
return result.json();
|
|
112
112
|
} catch (e) {
|
|
113
|
-
if (e instanceof
|
|
113
|
+
if (e instanceof chunkKN4OGPAB_cjs.ExitProcessError && e.originalError != null && e.originalError instanceof shared_net.PalantirApiError && e.originalError.errorName === "WebsiteNotFound") {
|
|
114
114
|
return void 0;
|
|
115
115
|
}
|
|
116
116
|
throw e;
|
|
@@ -173,7 +173,7 @@ async function loadToken(token, tokenFile) {
|
|
|
173
173
|
return environmentToken;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
throw new
|
|
176
|
+
throw new chunkKN4OGPAB_cjs.ExitProcessError(2, `No token found.`, `You can supply a --token or --token-file option, or set the ${TOKEN_ENV_VARS[0]} environment variable`);
|
|
177
177
|
}
|
|
178
178
|
async function loadTokenFile(filePath) {
|
|
179
179
|
let token;
|
|
@@ -183,7 +183,7 @@ async function loadTokenFile(filePath) {
|
|
|
183
183
|
token = await fs.promises.readFile(resolvedPath, "utf8");
|
|
184
184
|
token = token.trim();
|
|
185
185
|
} catch (error) {
|
|
186
|
-
throw new
|
|
186
|
+
throw new chunkKN4OGPAB_cjs.ExitProcessError(2, `Unable to read token file "${filePath}": ${error}`);
|
|
187
187
|
}
|
|
188
188
|
return {
|
|
189
189
|
filePath: resolvedPath,
|
|
@@ -192,7 +192,7 @@ async function loadTokenFile(filePath) {
|
|
|
192
192
|
}
|
|
193
193
|
function validate(token) {
|
|
194
194
|
if (!isJWT(token)) {
|
|
195
|
-
throw new
|
|
195
|
+
throw new chunkKN4OGPAB_cjs.ExitProcessError(2, `Token does not appear to be a JWT`);
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
function isJWT(token) {
|
|
@@ -204,4 +204,4 @@ exports.createInternalClientContext = createInternalClientContext;
|
|
|
204
204
|
exports.loadToken = loadToken;
|
|
205
205
|
exports.third_party_applications_exports = third_party_applications_exports;
|
|
206
206
|
//# sourceMappingURL=out.js.map
|
|
207
|
-
//# sourceMappingURL=chunk-
|
|
207
|
+
//# sourceMappingURL=chunk-LGCW6EG4.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/net/createInternalClientContext.mts","../../src/net/third-party-applications/index.mts","../../src/net/createFetch.mts","../../src/net/UserAgent.ts","../../src/net/third-party-applications/deleteVersion.mts","../../src/net/third-party-applications/deployWebsite.mts","../../src/net/third-party-applications/getWebsite.mts","../../src/net/third-party-applications/listVersions.mts","../../src/net/third-party-applications/undeployWebsite.mts","../../src/net/third-party-applications/uploadVersion.mts","../../src/util/token.ts"],"names":["fetch","PalantirApiError","consola"],"mappings":";;;;;;;;AAgBO,SAAS,4BAA4B,YAAY,eAAe;AACrE,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;;;ACrBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBA,SAAS,0BAA0B,oBAAoB,wBAAwB;AAC/E,SAAS,eAAe;;;ACFjB,IAAM,aAAa,YAAY,4BAA2B;;;ADI1D,SAAS,YAAY,eAAe,UAAU,OAAO;AAC1D,SAAO,yBAAyB,0BAA0B,wBAAwB,mBAAmB,OAAO,CAAC,CAAC,GAAG,OAAM,YAAW;AAChI,UAAM,QAAQ,MAAM,cAAc;AAClC,YAAQ,IAAI,iBAAiB,UAAU,KAAK,EAAE;AAC9C,YAAQ,IAAI,oBAAoB,UAAU;AAC1C,WAAO;AAAA,EACT,CAAC;AACH;AACA,SAAS,wBAAwB,UAAU,OAAO;AAChD,SAAO,SAAS,kBAAkB,OAAO,MAAM;AAC7C,WAAO,QAAQ,OAAO,IAAI,EAAE,MAAM,gBAAgB;AAAA,EACpD;AACF;AACA,SAAS,iBAAiB,GAAG;AAC3B,MAAI,EAAE,aAAa,mBAAmB;AACpC,UAAM,IAAI,iBAAiB,GAAG,wBAAwB;AAAA,EACxD;AACA,MAAI;AACJ,MAAI,EAAE,eAAe,KAAK;AACxB,UAAM;AAAA,EACR,WAAW,EAAE,eAAe,KAAK;AAC/B,UAAM;AAAA,EACR;AACA,MAAI,UAAU,EAAE;AAChB,MAAI,EAAE,cAAc,+BAA+B;AACjD,cAAU;AACV,UAAM;AAAA,EACR,WAAW,EAAE,cAAc,kBAAkB;AAC3C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AQ,MAAM,iCAAiC;AAC/C,aAAS,KAAK;AACd,WAAO;AAAA,EACT;AACA,MAAI,WAAW;AACb,UAAM,cAAc,MAAM,cAAc,SAAS;AACjD,IAAAA,SAAQ,MAAM,gCAAgC,YAAY,QAAQ,SAAS;AAC3E,aAAS,YAAY,KAAK;AAC1B,WAAO,YAAY;AAAA,EACrB;AACA,aAAW,UAAU,gBAAgB;AACnC,UAAM,mBAAmB,QAAQ,IAAI,MAAM;AAC3C,QAAI,kBAAkB;AACpB,MAAAA,SAAQ,MAAM,oBAAoB,MAAM,uBAAuB;AAC/D,eAAS,gBAAgB;AACzB,UAAI,WAAW,0BAA0B;AACvC,QAAAA,SAAQ,KAAK,oGAAoG;AAAA,MACnH;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,IAAI,iBAAiB,GAAG,mBAAmB,+DAA+D,eAAe,CAAC,CAAC,uBAAuB;AAC1J;AAOA,eAAsB,cAAc,UAAU;AAC5C,MAAI;AACJ,MAAI;AACJ,MAAI;AACF,mBAAe,KAAK,QAAQ,QAAQ;AACpC,YAAQ,MAAM,WAAW,SAAS,cAAc,MAAM;AACtD,YAAQ,MAAM,KAAK;AAAA,EACrB,SAAS,OAAO;AACd,UAAM,IAAI,iBAAiB,GAAG,8BAA8B,QAAQ,MAAM,KAAK,EAAE;AAAA,EACnF;AACA,SAAO;AAAA,IACL,UAAU;AAAA,IACV;AAAA,EACF;AACF;AACO,SAAS,SAAS,OAAO;AAC9B,MAAI,CAAC,MAAM,KAAK,GAAG;AACjB,UAAM,IAAI,iBAAiB,GAAG,mCAAmC;AAAA,EACnE;AACF;AACA,SAAS,MAAM,OAAO;AAEpB,QAAM,aAAa;AACnB,SAAO,WAAW,KAAK,KAAK;AAC9B","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function createInternalClientContext(foundryUrl, tokenProvider) {\n return {\n tokenProvider,\n foundryUrl\n };\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { deleteVersion } from \"./deleteVersion.mjs\";\nexport { deployWebsite } from \"./deployWebsite.mjs\";\nexport { getWebsite } from \"./getWebsite.mjs\";\nexport { listVersions } from \"./listVersions.mjs\";\nexport { undeployWebsite } from \"./undeployWebsite.mjs\";\nexport { uploadVersion } from \"./uploadVersion.mjs\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { createFetchHeaderMutator, createFetchOrThrow, PalantirApiError } from \"@osdk/shared.net\";\nimport { consola } from \"consola\";\nimport { USER_AGENT } from \"./UserAgent.js\";\nexport function createFetch(tokenProvider, fetchFn = fetch) {\n return createFetchHeaderMutator(createRequestLoggingFetch(createErrorExitingFetch(createFetchOrThrow(fetchFn))), async headers => {\n const token = await tokenProvider();\n headers.set(\"Authorization\", `Bearer ${token}`);\n headers.set(\"Fetch-User-Agent\", USER_AGENT);\n return headers;\n });\n}\nfunction createErrorExitingFetch(fetchFn = fetch) {\n return function errorExitingFetch(input, init) {\n return fetchFn(input, init).catch(handleFetchError);\n };\n}\nfunction handleFetchError(e) {\n if (!(e instanceof PalantirApiError)) {\n throw new ExitProcessError(1, \"Unexpected fetch error\");\n }\n let tip;\n if (e.statusCode === 401) {\n tip = \"Check your token is valid and has not expired or been disabled\";\n } else if (e.statusCode === 403) {\n tip = \"Check your token has the required scopes for this operation\";\n }\n let message = e.message;\n if (e.errorName === \"CannotDeleteDeployedVersion\") {\n message = \"The site version to delete is live and cannot be deleted\";\n tip = \"Run the `site version set` command to change the live site version\";\n } else if (e.errorName === \"InvalidVersion\") {\n message = \"The site version is invalid and must be a valid SemVer string\";\n } else if (e.errorName === \"VersionAlreadyExists\") {\n message = \"The site version already exists\";\n } else if (e.errorName === \"VersionNotFound\") {\n message = \"The site version could not be found\";\n }\n throw new ExitProcessError(1, message, tip, e);\n}\nfunction createRequestLoggingFetch(fetchFn = fetch) {\n return function requestLoggingFetch(input, init) {\n const requestLog = typeof input === \"string\" || input instanceof URL ? `${init?.method ?? \"GET\"}: ${input.toString().trim()}` : `${input.method ?? \"GET\"}: ${input.url.toString().trim()}`;\n consola.trace(requestLog);\n return fetchFn(input, init).then(a => {\n consola.trace(`FINISH ${requestLog}`);\n return a;\n });\n };\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT = `osdk-cli/${process.env.PACKAGE_VERSION}`;","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function deleteVersion(ctx, thirdPartyAppRid, version) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/${version}?preview=true`;\n await fetch(url, {\n method: \"DELETE\"\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function deployWebsite(ctx, thirdPartyAppRid, request) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/deploy?preview=true`;\n const result = await fetch(url, {\n method: \"POST\",\n body: JSON.stringify(request),\n headers: {\n \"Content-Type\": \"application/json\"\n }\n });\n return result.json();\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { PalantirApiError } from \"@osdk/shared.net\";\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function getWebsite(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website?preview=true`;\n try {\n const result = await fetch(url);\n return result.json();\n } catch (e) {\n // Revisit this error handling in the API\n if (e instanceof ExitProcessError && e.originalError != null && e.originalError instanceof PalantirApiError && e.originalError.errorName === \"WebsiteNotFound\") {\n return undefined;\n }\n throw e;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function listVersions(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions?preview=true`;\n const result = await fetch(url);\n return result.json();\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function undeployWebsite(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/undeploy?preview=true`;\n await fetch(url, {\n method: \"POST\"\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function uploadVersion(ctx, thirdPartyAppRid, version, zipFile) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/upload?version=${version}&preview=true`;\n const result = await fetch(url, {\n method: \"POST\",\n body: zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n return result.json();\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { consola } from \"consola\";\nimport { promises as fsPromises } from \"node:fs\";\nimport path from \"node:path\";\nconst TOKEN_ENV_VARS = [\"FOUNDRY_TOKEN\", \"FOUNDRY_SDK_AUTH_TOKEN\"];\n\n/**\n * Loads a JWT Auth Token from an argument, a file, or environment variable returning the first found.\n * @param token The token as a string.\n * @param tokenFile The path to the token file.\n * @returns The token as a string.\n * @throws An error if no token is found.\n */\nexport async function loadToken(token, tokenFile) {\n if (token) {\n consola.debug(`Using token from --token option`);\n validate(token);\n return token;\n }\n if (tokenFile) {\n const loadedToken = await loadTokenFile(tokenFile);\n consola.debug(`Using token from --tokenFile=${loadedToken.filePath} option`);\n validate(loadedToken.token);\n return loadedToken.token;\n }\n for (const envVar of TOKEN_ENV_VARS) {\n const environmentToken = process.env[envVar];\n if (environmentToken) {\n consola.debug(`Using token from ${envVar} environment variable`);\n validate(environmentToken);\n if (envVar === \"FOUNDRY_SDK_AUTH_TOKEN\") {\n consola.warn(`Using FOUNDRY_SDK_AUTH_TOKEN environment variable is deprecated. Please use FOUNDRY_TOKEN instead.`);\n }\n return environmentToken;\n }\n }\n throw new ExitProcessError(2, `No token found.`, `You can supply a --token or --token-file option, or set the ${TOKEN_ENV_VARS[0]} environment variable`);\n}\n/**\n * Reads a JWT Auth Token from a file.\n * @param filePath The path to the token file.\n * @returns The token as a string.\n * @throws An error if the file cannot be read.\n */\nexport async function loadTokenFile(filePath) {\n let token;\n let resolvedPath;\n try {\n resolvedPath = path.resolve(filePath);\n token = await fsPromises.readFile(resolvedPath, \"utf8\");\n token = token.trim();\n } catch (error) {\n throw new ExitProcessError(2, `Unable to read token file \"${filePath}\": ${error}`);\n }\n return {\n filePath: resolvedPath,\n token\n };\n}\nexport function validate(token) {\n if (!isJWT(token)) {\n throw new ExitProcessError(2, `Token does not appear to be a JWT`);\n }\n}\nfunction isJWT(token) {\n // https://stackoverflow.com/a/65755789\n const jwtPattern = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\n return jwtPattern.test(token);\n}"]}
|
|
@@ -13,7 +13,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
13
13
|
var consola__default = /*#__PURE__*/_interopDefault(consola);
|
|
14
14
|
var open__default = /*#__PURE__*/_interopDefault(open);
|
|
15
15
|
|
|
16
|
-
// ../cli.common/build/
|
|
16
|
+
// ../cli.common/build/esm/public/loginFlow.js
|
|
17
17
|
function isTokenErrorResponse(response) {
|
|
18
18
|
return response.error != null;
|
|
19
19
|
}
|
|
@@ -122,4 +122,4 @@ async function getTokenWithCodeVerifier(clientId, redirectUrl, code, baseUrl, co
|
|
|
122
122
|
|
|
123
123
|
exports.invokeLoginFlow = invokeLoginFlow;
|
|
124
124
|
//# sourceMappingURL=out.js.map
|
|
125
|
-
//# sourceMappingURL=chunk-
|
|
125
|
+
//# sourceMappingURL=chunk-V7DUQNL2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../cli.common/build/
|
|
1
|
+
{"version":3,"sources":["../../../cli.common/build/esm/public/loginFlow.js"],"names":[],"mappings":";AAAA,OAAO,aAAa;AACpB,SAAS,iBAAiB,cAAc;AACxC,SAAS,oBAAoB;AAC7B,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,aAAa;AACtB,OAAO,UAAU;AAKjB,SAAS,qBAAqB,UAAU;AACtC,SAAO,SAAS,SAAS;AAC3B;AAGA,IAAI,yBAAyB,KAAK;AAClC,eAAe,gBAAgB,MAAM;AACnC,UAAQ,MAAM,wCAAwC,KAAK,QAAQ,EAAE;AACrE,QAAM,cAAc;AACpB,QAAM,OAAO,MAAM,WAAW,EAAE;AAChC,MAAI;AACJ,QAAM,WAAW,IAAI,QAAQ,UAAQ;AACnC,cAAU;AAAA,EACZ,CAAC;AACD,QAAM,SAAS,aAAa,CAAC,KAAK,QAAQ;AACxC,UAAM,QA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,MAAM,UAAU;AAAA,MACrC,MAAM,KAAK,SAAS;AAAA,MACpB,SAAS;AAAA,QACP,gBAAgB;AAAA,MAClB;AAAA,MACA,QAAQ;AAAA,IACV,CAAC;AACD,UAAM,eAAe,MAAM,SAAS,KAAK;AACzC,WAAO;AAAA,EACT,SAAS,GAAG;AACV,UAAM,IAAI,MAAM,wBAAwB,GAAG,OAAO,SAAS,KAAK,GAAG,SAAS,KAAK,eAAe,EAAE;AAAA,EACpG;AACF","sourcesContent":["import consola from 'consola';\nimport { getRandomValues, subtle } from 'crypto';\nimport { createServer } from 'http';\nimport { join } from 'path/posix';\nimport { exit } from 'process';\nimport { parse } from 'url';\nimport open from 'open';\n\n// src/commands/auth/login/loginFlow.ts\n\n// src/commands/auth/login/token.ts\nfunction isTokenErrorResponse(response) {\n return response.error != null;\n}\n\n// src/commands/auth/login/loginFlow.ts\nvar BROWSER_PROMPT_TIME_MS = 60 * 1e3;\nasync function invokeLoginFlow(args) {\n consola.start(`Authenticating using application id: ${args.clientId}`);\n const redirectUrl = \"http://localhost:8080/auth/callback\";\n const port = parse(redirectUrl).port;\n let resolve;\n const authCode = new Promise(_res => {\n resolve = _res;\n });\n const server = createServer((req, res) => {\n const query = parse(req.url, true).query;\n res.end(\"Authenticated\");\n resolve(query[\"code\"]);\n });\n server.on(\"error\", e => {\n if (e.code === \"EADDRINUSE\") {\n consola.error(`Port ${port} is already in use, unable to perform authentication flow.`);\n server.close();\n exit(1);\n }\n });\n server.listen(port);\n const clientId = args.clientId;\n const state = generateRandomString();\n const codeVerifier = generateRandomString();\n const codeChallenge = await generateCodeChallenge(codeVerifier);\n const authorizeUrl = generateAuthorizeUrl(args.foundryUrl, clientId, state, redirectUrl, codeChallenge);\n try {\n await open(authorizeUrl);\n } catch {\n consola.warn(`Unable to open browser, please open this url in your browser to to authenticate: ${authorizeUrl}`);\n }\n const browserPrompt = setTimeout(() => {\n consola.warn(`Still waiting for the authentication to complete. Please open a browser to ${authorizeUrl}`);\n }, BROWSER_PROMPT_TIME_MS);\n const code = await authCode;\n server.close();\n clearTimeout(browserPrompt);\n const token = await getTokenWithCodeVerifier(clientId, redirectUrl, code, args.foundryUrl, codeVerifier);\n if (isTokenErrorResponse(token)) {\n consola.error(\"Unable to authenticate\", token.error, token.error_description);\n exit(1);\n }\n consola.success(`Successfully authenticated!`);\n return token;\n}\nfunction generateRandomString(length = 128) {\n const characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~\";\n let output = [];\n let array = new Uint8Array(1);\n const maxIndex = 256 - 256 % characters.length;\n while (output.length < length) {\n getRandomValues(array);\n if (array[0] < maxIndex) {\n output.push(characters[array[0] % characters.length]);\n }\n }\n return output.join(\"\");\n}\nasync function generateCodeChallenge(codeVerifier) {\n const data = new TextEncoder().encode(codeVerifier);\n const digest = await subtle.digest(\"SHA-256\", data);\n const codeChallengeMethod = \"S256\";\n const codeChallenge = btoa(String.fromCharCode(...new Uint8Array(digest))).replace(/\\//g, \"_\").replace(/\\+/g, \"-\").replace(/=/g, \"\");\n return {\n codeChallenge,\n codeChallengeMethod\n };\n}\nfunction generateAuthorizeUrl(baseUrl, clientId, state, redirectUrl, codeChallenge) {\n const queryParams = new URLSearchParams();\n queryParams.append(\"client_id\", clientId);\n queryParams.append(\"response_type\", \"code\");\n queryParams.append(\"state\", state);\n queryParams.append(\"redirect_uri\", redirectUrl);\n queryParams.append(\"code_challenge\", codeChallenge.codeChallenge);\n queryParams.append(\"code_challenge_method\", codeChallenge.codeChallengeMethod);\n queryParams.append(\"scope\", [\"offline_access\", \"api:read-data\"].join(\" \"));\n return join(baseUrl, \"multipass\", \"api\", \"oauth2\", \"authorize\") + `?` + queryParams.toString();\n}\nasync function getTokenWithCodeVerifier(clientId, redirectUrl, code, baseUrl, codeVerifier) {\n const body = new URLSearchParams();\n body.append(\"client_id\", clientId);\n body.append(\"grant_type\", \"authorization_code\");\n body.append(\"code\", code);\n body.append(\"redirect_uri\", redirectUrl);\n body.append(\"code_verifier\", codeVerifier);\n const tokenUrl = join(baseUrl, \"multipass\", \"api\", \"oauth2\", \"token\") + `?state=${codeVerifier}`;\n try {\n const response = await fetch(tokenUrl, {\n body: body.toString(),\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n method: \"POST\"\n });\n const responseText = await response.json();\n return responseText;\n } catch (e) {\n throw new Error(`Failed to get token: ${e?.cause?.toString() ?? e?.toString() ?? \"Unknown error\"}`);\n }\n}\nexport { invokeLoginFlow as default };"]}
|
package/build/{js/handleGenerate-DRFYKWQT-FDZDUHIN.cjs → cjs/handleGenerate-Q7NWLXQZ-W5BEOH43.cjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkV7DUQNL2_cjs = require('./chunk-V7DUQNL2.cjs');
|
|
4
|
+
var chunkKN4OGPAB_cjs = require('./chunk-KN4OGPAB.cjs');
|
|
5
5
|
require('./chunk-7G2FSZUY.cjs');
|
|
6
6
|
var requests = require('@osdk/gateway/requests');
|
|
7
7
|
var generator = require('@osdk/generator');
|
|
@@ -34,7 +34,7 @@ function _interopNamespace(e) {
|
|
|
34
34
|
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
35
35
|
var path__namespace = /*#__PURE__*/_interopNamespace(path);
|
|
36
36
|
|
|
37
|
-
var USER_AGENT = `osdk-cli.cmd.typescript/${"0.3.
|
|
37
|
+
var USER_AGENT = `osdk-cli.cmd.typescript/${"0.3.1-main-20240520153817"}`;
|
|
38
38
|
async function handleGenerate(args) {
|
|
39
39
|
let success = false;
|
|
40
40
|
if (args.ontologyPath) {
|
|
@@ -42,12 +42,12 @@ async function handleGenerate(args) {
|
|
|
42
42
|
} else if (args.foundryUrl && args.clientId) {
|
|
43
43
|
success = await generateFromStack(args);
|
|
44
44
|
} else {
|
|
45
|
-
throw new
|
|
45
|
+
throw new chunkKN4OGPAB_cjs.YargsCheckError("Must have specified ontologyPath or stack and clientId");
|
|
46
46
|
}
|
|
47
47
|
if (success) {
|
|
48
48
|
consola.consola.info("OSDK Generated!");
|
|
49
49
|
} else {
|
|
50
|
-
throw new
|
|
50
|
+
throw new chunkKN4OGPAB_cjs.ExitProcessError(1, "Failed to generate the TypeScript SDK");
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
async function generateFromLocalFile(args) {
|
|
@@ -64,7 +64,7 @@ async function generateFromStack(args) {
|
|
|
64
64
|
clientId,
|
|
65
65
|
ontologyWritePath
|
|
66
66
|
} = args;
|
|
67
|
-
const token = await
|
|
67
|
+
const token = await chunkV7DUQNL2_cjs.invokeLoginFlow({
|
|
68
68
|
clientId,
|
|
69
69
|
foundryUrl,
|
|
70
70
|
verbose: 0
|
|
@@ -110,7 +110,7 @@ async function generateClientSdk(ontology, args) {
|
|
|
110
110
|
await generateSourceFiles(args, ontology, createNormalFs());
|
|
111
111
|
return true;
|
|
112
112
|
}
|
|
113
|
-
await generator.__UNSTABLE_generateClientSdkPackage(args.packageName, args.version, args.beta ? "2.0" : "1.1", args.outDir, ontology, minimalFs, dependencyVersions, "0.21.
|
|
113
|
+
await generator.__UNSTABLE_generateClientSdkPackage(args.packageName, args.version, args.beta ? "2.0" : "1.1", args.outDir, ontology, minimalFs, dependencyVersions, "0.21.1-main-20240520153817");
|
|
114
114
|
return true;
|
|
115
115
|
} catch (e) {
|
|
116
116
|
consola.consola.error("OSDK generation failed", e.message, e.stack);
|
|
@@ -123,9 +123,9 @@ async function getDependencyVersions() {
|
|
|
123
123
|
const typescriptVersion = ourPackageJson.devDependencies.typescript;
|
|
124
124
|
const tslibVersion = ourPackageJson.dependencies.tslib;
|
|
125
125
|
const areTheTypesWrongVersion = ourPackageJson.dependencies["@arethetypeswrong/cli"];
|
|
126
|
-
const osdkClientVersion = `^${"0.19.
|
|
127
|
-
const osdkApiVersion = `^${"1.8.
|
|
128
|
-
const osdkLegacyClientVersion = `^${"2.3.
|
|
126
|
+
const osdkClientVersion = `^${"0.19.1-main-20240520153817"}`;
|
|
127
|
+
const osdkApiVersion = `^${"1.8.1-main-20240520153817"}`;
|
|
128
|
+
const osdkLegacyClientVersion = `^${"2.3.1-main-20240520153817"}`;
|
|
129
129
|
return {
|
|
130
130
|
typescriptVersion,
|
|
131
131
|
tslibVersion,
|
|
@@ -173,4 +173,4 @@ function createNormalFs() {
|
|
|
173
173
|
exports.getDependencyVersions = getDependencyVersions;
|
|
174
174
|
exports.handleGenerate = handleGenerate;
|
|
175
175
|
//# sourceMappingURL=out.js.map
|
|
176
|
-
//# sourceMappingURL=handleGenerate-
|
|
176
|
+
//# sourceMappingURL=handleGenerate-Q7NWLXQZ-W5BEOH43.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../cli.cmd.typescript/build/esm/handleGenerate-Q7NWLXQZ.js"],"names":[],"mappings":";;;;;;;;;;AAEA,SAAS,kBAAkB,+BAA+B;AAC1D,SAAS,qCAAqC,sCAAsC,yCAAyC;AAC7H,SAAS,qBAAqB,4BAA4B;AAC1D,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,SAAS,qBAAqB;AAG9B,IAAI,aAAa,2BAA2B,2BAA2B;AACvE,eAAe,eAAe,MAAM;AAClC,MAAI,UAAU;AACd,MAAI,KAAK,cAAc;AACrB,cAAU,MAAM,sBAAsB,IAAI;AAAA,EAC5C,WAAW,KAAK,cAAc,KAAK,UAAU;AAC3C,cAAU,MAAM,kBAAkB,IAAI;AAAA,EACxC,OAAO;AACL,UAAM,IAAI,gBAAgB,wDAAwD;AAAA,EACpF;AACA,MAAI,SAAS;AACX,YAAQ,KAAK,iBAAiB;AAAA,EAChC,OAAO;AACL,UAAM,IAAI,iBAAiB,GAAG,uCAAuC;AAAA,EACvE;AACF;AACA,eAAe,sBAAsB,MAAM;AACzC,MAAI,CAAI,cAAW,KAAK,YAAY,G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uCAAuC,mCAAmC,UAAU,aAAa,KAAK,OAAO,GAAG,KAAK,KAAK,QAAQ,KAAK,WAAW;AACvK;AACA,SAAS,aAAa,SAAS;AAC7B,MAAI,YAAY,OAAO;AACrB,WAAO;AAAA,EACT,OAAO;AACL,WAAO,kBAAkB,OAAO,IAAI,UAAU;AAAA,EAChD;AACF;AACA,SAAS,iBAAiB;AACxB,SAAO;AAAA,IACL,WAAW,CAAC,OAAO,aAAa;AAC9B,aAAU,YAAS,UAAU,OAAO,UAAU,OAAO;AAAA,IACvD;AAAA,IACA,OAAO,OAAO,OAAO,YAAY;AAC/B,YAAS,YAAS,MAAM,OAAO,OAAO;AAAA,IACxC;AAAA,IACA,SAAS,OAAM,UAAY,YAAS,QAAQ,KAAK;AAAA,EACnD;AACF","sourcesContent":["import { YargsCheckError, ExitProcessError } from '@osdk/cli.common';\nimport invokeLoginFlow from '@osdk/cli.common/loginFlow';\nimport { listOntologiesV2, getOntologyFullMetadata } from '@osdk/gateway/requests';\nimport { __UNSTABLE_generateClientSdkPackage, generateClientSdkVersionTwoPointZero, generateClientSdkVersionOneDotOne } from '@osdk/generator';\nimport { createClientContext, createOpenApiRequest } from '@osdk/shared.net';\nimport { consola } from 'consola';\nimport { findUp } from 'find-up';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { fileURLToPath } from 'url';\n\n// src/generate/handleGenerate.mts\nvar USER_AGENT = `osdk-cli.cmd.typescript/${\"0.3.1-main-20240520153817\"}`;\nasync function handleGenerate(args) {\n let success = false;\n if (args.ontologyPath) {\n success = await generateFromLocalFile(args);\n } else if (args.foundryUrl && args.clientId) {\n success = await generateFromStack(args);\n } else {\n throw new YargsCheckError(\"Must have specified ontologyPath or stack and clientId\");\n }\n if (success) {\n consola.info(\"OSDK Generated!\");\n } else {\n throw new ExitProcessError(1, \"Failed to generate the TypeScript SDK\");\n }\n}\nasync function generateFromLocalFile(args) {\n if (!fs.existsSync(args.ontologyPath)) {\n consola.error(`Ontology file does not exist: ${args.ontologyPath}`);\n return false;\n }\n const ontology = JSON.parse(await fs.promises.readFile(args.ontologyPath, \"utf-8\"));\n return await generateClientSdk(ontology, args);\n}\nasync function generateFromStack(args) {\n const {\n foundryUrl,\n clientId,\n ontologyWritePath\n } = args;\n const token = await invokeLoginFlow({\n clientId,\n foundryUrl,\n verbose: 0\n });\n const {\n fetch\n } = createClientContext({\n metadata: {\n userAgent: USER_AGENT\n }\n }, args.foundryUrl, () => token.access_token, USER_AGENT);\n try {\n const ontologies = await listOntologiesV2(createOpenApiRequest(foundryUrl, fetch));\n if (args.ontologyRid) {\n ontologies.data = ontologies.data.filter(o => o.rid === args.ontologyRid);\n }\n if (ontologies.data.length !== 1) {\n consola.error(`Could not look up ontology with these credentials. Found ${ontologies.data.length} ontologies.`);\n return false;\n }\n const ontology = await getOntologyFullMetadata(createOpenApiRequest(foundryUrl, fetch), ontologies.data[0].apiName);\n if (ontologyWritePath) {\n fs.writeFileSync(ontologyWritePath, JSON.stringify(ontology, null, 2));\n }\n return await generateClientSdk(ontology, args);\n } catch (e) {\n consola.error(\"Failed to generate the ontology\", e);\n return false;\n }\n}\nasync function generateClientSdk(ontology, args) {\n const minimalFs = createNormalFs();\n const dependencyVersions = await getDependencyVersions();\n try {\n if (args.clean) {\n consola.info(\"Cleaning output directory\", args.outDir);\n await fs.promises.rm(args.outDir, {\n recursive: true,\n force: true\n });\n }\n if (!args.asPackage) {\n await generateSourceFiles(args, ontology, createNormalFs());\n return true;\n }\n await __UNSTABLE_generateClientSdkPackage(args.packageName, args.version, args.beta ? \"2.0\" : \"1.1\", args.outDir, ontology, minimalFs, dependencyVersions, \"0.21.1-main-20240520153817\");\n return true;\n } catch (e) {\n consola.error(\"OSDK generation failed\", e.message, e.stack);\n return false;\n }\n}\nasync function getDependencyVersions() {\n const ourPackageJsonPath = await getOurPackageJsonPath();\n const ourPackageJson = JSON.parse(await fs.promises.readFile(ourPackageJsonPath, \"utf-8\"));\n const typescriptVersion = ourPackageJson.devDependencies.typescript;\n const tslibVersion = ourPackageJson.dependencies.tslib;\n const areTheTypesWrongVersion = ourPackageJson.dependencies[\"@arethetypeswrong/cli\"];\n const osdkClientVersion = `^${\"0.19.1-main-20240520153817\"}`;\n const osdkApiVersion = `^${\"1.8.1-main-20240520153817\"}`;\n const osdkLegacyClientVersion = `^${\"2.3.1-main-20240520153817\"}`;\n return {\n typescriptVersion,\n tslibVersion,\n areTheTypesWrongVersion,\n osdkApiVersion,\n osdkClientVersion,\n osdkLegacyClientVersion\n };\n}\nvar cachedOurPackageJsonPath;\nasync function getOurPackageJsonPath() {\n if (cachedOurPackageJsonPath) return cachedOurPackageJsonPath;\n const __dir = path.dirname(fileURLToPath(import.meta.url));\n const ourPackageJsonPath = await findUp(\"package.json\", {\n cwd: __dir\n });\n if (!ourPackageJsonPath) {\n throw new Error(\"Could not find our package.json\");\n }\n return cachedOurPackageJsonPath = ourPackageJsonPath;\n}\nasync function generateSourceFiles(args, ontology, fs2) {\n await (args.beta ? generateClientSdkVersionTwoPointZero : generateClientSdkVersionOneDotOne)(ontology, getUserAgent(args.version), fs2, args.outDir, args.packageType);\n}\nfunction getUserAgent(version) {\n if (version === \"dev\") {\n return \"typescript-sdk/dev osdk-cli/dev\";\n } else {\n return `typescript-sdk/${version} ${USER_AGENT}`;\n }\n}\nfunction createNormalFs() {\n return {\n writeFile: (path2, contents) => {\n return fs.promises.writeFile(path2, contents, \"utf-8\");\n },\n mkdir: async (path2, options) => {\n await fs.promises.mkdir(path2, options);\n },\n readdir: async path2 => fs.promises.readdir(path2)\n };\n}\nexport { getDependencyVersions, handleGenerate };"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkKN4OGPAB_cjs = require('./chunk-KN4OGPAB.cjs');
|
|
4
4
|
require('./chunk-7G2FSZUY.cjs');
|
|
5
5
|
var consola = require('consola');
|
|
6
6
|
var fs = require('fs');
|
|
@@ -77,22 +77,22 @@ var generateCommand = {
|
|
|
77
77
|
}
|
|
78
78
|
}).group(["ontologyPath", "outDir", "version"], "Generate from a local file").group(["foundryUrl", "clientId", "outDir", "ontologyWritePath", "version"], "OR Generate from Foundry").group(["packageName", "as"], "Package generation options").check((args) => {
|
|
79
79
|
if (!args.ontologyPath && !args.foundryUrl) {
|
|
80
|
-
throw new
|
|
80
|
+
throw new chunkKN4OGPAB_cjs.YargsCheckError("Must specify either ontologyPath or foundryUrl and clientId");
|
|
81
81
|
}
|
|
82
|
-
if (args.version !== "dev" && !
|
|
83
|
-
throw new
|
|
82
|
+
if (args.version !== "dev" && !chunkKN4OGPAB_cjs.isValidSemver(args.version)) {
|
|
83
|
+
throw new chunkKN4OGPAB_cjs.YargsCheckError("Version must be 'dev' or a valid semver version");
|
|
84
84
|
}
|
|
85
85
|
if (args.asPackage && !args.packageName) {
|
|
86
|
-
throw new
|
|
86
|
+
throw new chunkKN4OGPAB_cjs.YargsCheckError("Must specify packageName when generating as a package");
|
|
87
87
|
}
|
|
88
88
|
if (args.asPackage && !args.version) {
|
|
89
|
-
throw new
|
|
89
|
+
throw new chunkKN4OGPAB_cjs.YargsCheckError("Must specify version when generating as a package");
|
|
90
90
|
}
|
|
91
91
|
return true;
|
|
92
92
|
});
|
|
93
93
|
},
|
|
94
94
|
handler: async (args) => {
|
|
95
|
-
const command10 = await import('./handleGenerate-
|
|
95
|
+
const command10 = await import('./handleGenerate-Q7NWLXQZ-W5BEOH43.cjs');
|
|
96
96
|
await command10.handleGenerate(args);
|
|
97
97
|
}
|
|
98
98
|
};
|
|
@@ -120,7 +120,7 @@ var command = {
|
|
|
120
120
|
});
|
|
121
121
|
},
|
|
122
122
|
handler: async (args) => {
|
|
123
|
-
const command10 = await import('./loginFlow-
|
|
123
|
+
const command10 = await import('./loginFlow-CZE5UISW.cjs');
|
|
124
124
|
await command10.default(args);
|
|
125
125
|
}
|
|
126
126
|
};
|
|
@@ -202,10 +202,10 @@ async function loadFoundryConfig() {
|
|
|
202
202
|
const fileContent = await fs.promises.readFile(configFilePath, "utf-8");
|
|
203
203
|
foundryConfig = parseConfigFile(fileContent, configFilePath);
|
|
204
204
|
} catch (error) {
|
|
205
|
-
throw new
|
|
205
|
+
throw new chunkKN4OGPAB_cjs.ExitProcessError(2, `Couldn't read or parse config file ${configFilePath}. Error: ${error}`);
|
|
206
206
|
}
|
|
207
207
|
if (!validate(foundryConfig)) {
|
|
208
|
-
throw new
|
|
208
|
+
throw new chunkKN4OGPAB_cjs.ExitProcessError(2, `The configuration file does not match the expected schema: ${ajv.errorsText(validate.errors)}`);
|
|
209
209
|
}
|
|
210
210
|
return {
|
|
211
211
|
foundryConfig,
|
|
@@ -220,7 +220,7 @@ function parseConfigFile(fileContent, configFilePath) {
|
|
|
220
220
|
case ".json":
|
|
221
221
|
return JSON.parse(fileContent);
|
|
222
222
|
default:
|
|
223
|
-
throw new
|
|
223
|
+
throw new chunkKN4OGPAB_cjs.ExitProcessError(2, `Unsupported file extension: ${extension} for config file.`);
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
@@ -297,24 +297,24 @@ var command2 = {
|
|
|
297
297
|
}
|
|
298
298
|
}).group(["directory", "version", "uploadOnly"], "Deploy Options").group(["autoVersion", "gitTagPrefix"], "Auto Version Options").check((args) => {
|
|
299
299
|
if (autoVersion == null && args.autoVersion == null && args.version == null) {
|
|
300
|
-
throw new
|
|
300
|
+
throw new chunkKN4OGPAB_cjs.YargsCheckError("One of --version or --autoVersion must be specified");
|
|
301
301
|
}
|
|
302
|
-
if (args.version != null && !
|
|
303
|
-
throw new
|
|
302
|
+
if (args.version != null && !chunkKN4OGPAB_cjs.isValidSemver(args.version)) {
|
|
303
|
+
throw new chunkKN4OGPAB_cjs.YargsCheckError(`--version "${args.version}" must be a valid SemVer string`);
|
|
304
304
|
}
|
|
305
305
|
const autoVersionType = args.autoVersion ?? autoVersion;
|
|
306
306
|
if (autoVersionType !== "git-describe") {
|
|
307
|
-
throw new
|
|
307
|
+
throw new chunkKN4OGPAB_cjs.YargsCheckError(`Only 'git-describe' is supported for autoVersion`);
|
|
308
308
|
}
|
|
309
309
|
const gitTagPrefixValue = args.gitTagPrefix ?? gitTagPrefix;
|
|
310
310
|
if (gitTagPrefixValue != null && autoVersionType !== "git-describe") {
|
|
311
|
-
throw new
|
|
311
|
+
throw new chunkKN4OGPAB_cjs.YargsCheckError(`--gitTagPrefix is only supported when --autoVersion=git-describe`);
|
|
312
312
|
}
|
|
313
313
|
return true;
|
|
314
314
|
}).middleware((args) => logDeployCommandConfigFileOverride(args, siteConfig));
|
|
315
315
|
},
|
|
316
316
|
handler: async (args) => {
|
|
317
|
-
const command10 = await import('./siteDeployCommand-
|
|
317
|
+
const command10 = await import('./siteDeployCommand-XFKJ2GG4.cjs');
|
|
318
318
|
const {
|
|
319
319
|
version,
|
|
320
320
|
autoVersion,
|
|
@@ -357,7 +357,7 @@ var command3 = {
|
|
|
357
357
|
}).group(["yes"], "Delete Options");
|
|
358
358
|
},
|
|
359
359
|
handler: async (args) => {
|
|
360
|
-
const command10 = await import('./versionDeleteCommand-
|
|
360
|
+
const command10 = await import('./versionDeleteCommand-3UJFFUZU.cjs');
|
|
361
361
|
await command10.default(args);
|
|
362
362
|
}
|
|
363
363
|
};
|
|
@@ -371,7 +371,7 @@ var command4 = {
|
|
|
371
371
|
return argv;
|
|
372
372
|
},
|
|
373
373
|
handler: async (args) => {
|
|
374
|
-
const command10 = await import('./versionGetCommand-
|
|
374
|
+
const command10 = await import('./versionGetCommand-JHW6OPNC.cjs');
|
|
375
375
|
await command10.default(args);
|
|
376
376
|
}
|
|
377
377
|
};
|
|
@@ -385,7 +385,7 @@ var command5 = {
|
|
|
385
385
|
return argv;
|
|
386
386
|
},
|
|
387
387
|
handler: async (args) => {
|
|
388
|
-
const command10 = await import('./versionListCommand-
|
|
388
|
+
const command10 = await import('./versionListCommand-BRWYWE4W.cjs');
|
|
389
389
|
await command10.default(args);
|
|
390
390
|
}
|
|
391
391
|
};
|
|
@@ -403,7 +403,7 @@ var command6 = {
|
|
|
403
403
|
});
|
|
404
404
|
},
|
|
405
405
|
handler: async (args) => {
|
|
406
|
-
const command10 = await import('./versionSetCommand-
|
|
406
|
+
const command10 = await import('./versionSetCommand-RUWXBGQT.cjs');
|
|
407
407
|
await command10.default(args);
|
|
408
408
|
}
|
|
409
409
|
};
|
|
@@ -421,7 +421,7 @@ var command7 = {
|
|
|
421
421
|
}).group(["yes"], "Unset Options");
|
|
422
422
|
},
|
|
423
423
|
handler: async (args) => {
|
|
424
|
-
const command10 = await import('./versionUnsetCommand-
|
|
424
|
+
const command10 = await import('./versionUnsetCommand-6RAFJ764.cjs');
|
|
425
425
|
await command10.default(args);
|
|
426
426
|
}
|
|
427
427
|
};
|
|
@@ -480,7 +480,7 @@ var command9 = {
|
|
|
480
480
|
}
|
|
481
481
|
}).group(["application", "foundryUrl", "token", "tokenFile"], "Common Options").command(version_default).command(deploy_default).check((args) => {
|
|
482
482
|
if (!args.foundryUrl.startsWith("https://")) {
|
|
483
|
-
throw new
|
|
483
|
+
throw new chunkKN4OGPAB_cjs.YargsCheckError("foundryUrl must start with https://");
|
|
484
484
|
}
|
|
485
485
|
return true;
|
|
486
486
|
}).middleware((args) => logSiteCommandConfigFileOverride(args, config?.foundryConfig)).demandCommand();
|
|
@@ -503,9 +503,9 @@ async function logConfigFileMiddleware() {
|
|
|
503
503
|
|
|
504
504
|
// src/cli.ts
|
|
505
505
|
async function cli(args = process.argv) {
|
|
506
|
-
consola.consola.info(`Palantir OSDK CLI ${"0.21.
|
|
506
|
+
consola.consola.info(`Palantir OSDK CLI ${"0.21.1-main-20240520153817"}
|
|
507
507
|
`);
|
|
508
|
-
const base =
|
|
508
|
+
const base = chunkKN4OGPAB_cjs.getYargsBase(args);
|
|
509
509
|
try {
|
|
510
510
|
return await base.middleware(logConfigFileMiddleware).command(site_default).command({
|
|
511
511
|
command: "unstable",
|
|
@@ -518,7 +518,7 @@ async function cli(args = process.argv) {
|
|
|
518
518
|
}
|
|
519
519
|
}).parseAsync();
|
|
520
520
|
} catch (err) {
|
|
521
|
-
if (err instanceof
|
|
521
|
+
if (err instanceof chunkKN4OGPAB_cjs.ExitProcessError) {
|
|
522
522
|
consola.consola.error(err);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../cli.cmd.typescript/build/esm/index.js","../../src/cli.ts","../../src/commands/auth/login/index.ts","../../src/commands/auth/index.ts","../../src/util/config.ts","../../src/util/configLoader.ts","../../src/commands/site/deploy/logDeployCommandConfigFileOverride.ts","../../src/commands/site/deploy/index.ts","../../src/commands/site/logSiteCommandConfigFileOverride.ts","../../src/commands/site/version/delete/index.ts","../../src/commands/site/version/get/index.ts","../../src/commands/site/version/list/index.ts","../../src/commands/site/version/set/index.ts","../../src/commands/site/version/unset/index.ts","../../src/commands/site/version/index.ts","../../src/commands/site/index.ts","../../src/yargs/logConfigFileMiddleware.ts"],"names":["command","consola","autoVersion","application","foundryUrl"],"mappings":";;;;;;;;;AACA,SAAS,eAAe;AAGxB,IAAI,kBAAkB;AAAA,EACpB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,UAAQ;AACf,WAAO,KAAK,QAAQ;AAAA,MAClB,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,aAAa;AAAA,QACb,cAAc;AAAA,MAChB;AAAA,MACA,cAAc;AAAA,QACZ,aAAa;AAAA,QACb,MAAM;AAAA,QACN,cAAc;AAAA,QACd,WAAW,CAAC,cAAc,UAAU;AAAA,MACtC;AAAA,MACA,YAAY;AAAA,QACV,aAAa;AAAA,QACb,MAAM;AAAA,QACN,cAAc;AAAA,QACd,WAAW;AAAA,QACX,SAAS;AAAA,QACT,OAAO;AAAA;AAAA,MAET;AAAA,MACA,UAAU;AAAA,QACR,aAAa;AAAA,QACb,MAAM;AAAA,QACN,cAAc;AAAA,QACd,WAAW;AAAA,QACX,SAAS;AAAA,MACX;AAAA,MACA,a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,aAAa,CAAC,EAAE,cAAc;AAAA,EACrG;AAAA,EACA,SAAS,OAAM,SAAQ;AAAA,EAAC;AAC1B;AACA,IAAO,eAAQJ;;;ACpDf,SAAS,WAAAC,gBAAe;AAExB,IAAI,YAAY;AAChB,eAAsB,0BAA0B;AAC9C,MAAI,WAAW;AACb,gBAAY;AACZ,UAAM,SAAS,qBAAU;AACzB,UAAM,kBAAkB,MAAM,SAAS;AACvC,QAAI,gBAAgB;AAClB,MAAAA,SAAQ,MAAM,mCAAmC,cAAc,GAAG;AAAA,IACpE;AAAA,EACF;AACF;;;AfNA,eAAsB,IAAI,OAAO,QAAQ,MAAM;AAC7C,EAAAA,SAAQ,KAAK,qBAAqB,4BAA2B;AAAA,CAAI;AACjE,QAAM,OAAO,aAAa,IAAI;AAG9B,MAAI;AACF,WAAO,MAAM,KAAK,WAAW,uBAAuB,EAAE,QAAQ,YAAI,EAAE,QAAQ;AAAA,MAC1E,SAAS;AAAA,MACT,SAAS,CAAC,cAAc;AAAA,MACxB,UAAU;AAAA,MACV,SAAS,OAAM,SAAQ;AACrB,eAAO,KAAK,QAAQ,iBAAU,EAAE,QAAQ,YAAI,EAAE,cAAc;AAAA,MAC9D;AAAA,MACA,SAAS,WAAS;AAAA,MAAC;AAAA,IACrB,CAAC,EAAE,WAAW;AAAA,EAChB,SAAS,KAAK;AACZ,QAAI,eAAe,kBAAkB;AACnC,MAAAA,SAAQ,MAAM,GAAG;AAAA,IACnB;AAAA,EACF;AACF","sourcesContent":["import { getYargsBase, ExitProcessError, YargsCheckError, isValidSemver } from '@osdk/cli.common';\nimport { consola } from 'consola';\n\n// src/cli.ts\nvar generateCommand = {\n command: \"generate\",\n describe: \"Generate TypeScript SDK from ontology\",\n builder: argv => {\n return argv.options({\n outDir: {\n type: \"string\",\n description: \"Where to place the generated files\",\n demandOption: true\n },\n ontologyPath: {\n description: \"Path to the ontology wire json\",\n type: \"string\",\n demandOption: false,\n conflicts: [\"foundryUrl\", \"clientId\"]\n },\n foundryUrl: {\n description: \"URL for the foundry stack that contains the ontology\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"clientId\",\n alias: \"stack\"\n // for backwards compatibility\n },\n clientId: {\n description: \"OAuth client ID for application\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"foundryUrl\"\n },\n ontologyRid: {\n description: \"Limit requests to this ontology rid only\",\n type: \"string\",\n demandOption: false\n },\n ontologyWritePath: {\n description: \"Path to write the ontology wire json\",\n type: \"string\",\n demandOption: false,\n conflicts: [\"ontologyPath\"]\n },\n beta: {\n type: \"boolean\",\n description: \"Should generate beta sdk\",\n demandOption: false\n },\n packageType: {\n default: \"commonjs\",\n choices: [\"commonjs\", \"module\"]\n },\n version: {\n type: \"string\",\n description: \"Version of the generated code, or 'dev'\",\n demandOption: true\n },\n packageName: {\n type: \"string\",\n description: \"Name of the package to generate\"\n },\n asPackage: {\n type: \"boolean\",\n description: \"Generate as a package (makes a package.json and co)\"\n },\n clean: {\n type: \"boolean\",\n description: \"Clean the output directory before generating\"\n }\n }).group([\"ontologyPath\", \"outDir\", \"version\"], \"Generate from a local file\").group([\"foundryUrl\", \"clientId\", \"outDir\", \"ontologyWritePath\", \"version\"], \"OR Generate from Foundry\").group([\"packageName\", \"as\"], \"Package generation options\").check(args => {\n if (!args.ontologyPath && !args.foundryUrl) {\n throw new YargsCheckError(\"Must specify either ontologyPath or foundryUrl and clientId\");\n }\n if (args.version !== \"dev\" && !isValidSemver(args.version)) {\n throw new YargsCheckError(\"Version must be 'dev' or a valid semver version\");\n }\n if (args.asPackage && !args.packageName) {\n throw new YargsCheckError(\"Must specify packageName when generating as a package\");\n }\n if (args.asPackage && !args.version) {\n throw new YargsCheckError(\"Must specify version when generating as a package\");\n }\n return true;\n });\n },\n handler: async args => {\n const command = await import('./handleGenerate-Q7NWLXQZ.js');\n await command.handleGenerate(args);\n }\n};\n\n// src/cli.ts\nasync function cli(args = process.argv) {\n consola.info(`Palantir OSDK CLI ${\"0.3.1-main-20240520153817\"}\n`);\n const base = getYargsBase(args);\n try {\n return await base.command(generateCommand).parseAsync();\n } catch (err) {\n if (err instanceof ExitProcessError) {\n consola.error(err);\n }\n }\n}\n\n// src/typescriptCommand.ts\nvar typescriptCommand = {\n command: \"typescript\",\n describe: \"Manage code\",\n builder: argv => {\n return argv.command(generateCommand).demandCommand();\n },\n handler: async args => {}\n};\nexport { cli, typescriptCommand as default };","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport typescript from \"@osdk/cli.cmd.typescript\";\nimport { ExitProcessError, getYargsBase } from \"@osdk/cli.common\";\nimport { consola } from \"consola\";\nimport auth from \"./commands/auth/index.js\";\nimport site from \"./commands/site/index.js\";\nimport { logConfigFileMiddleware } from \"./yargs/logConfigFileMiddleware.js\";\nexport async function cli(args = process.argv) {\n consola.info(`Palantir OSDK CLI ${process.env.PACKAGE_VERSION}\\n`);\n const base = getYargsBase(args);\n\n // Special handling where failures happen before yargs does its error handling within .fail\n try {\n return await base.middleware(logConfigFileMiddleware).command(site).command({\n command: \"unstable\",\n aliases: [\"experimental\"],\n describe: \"Unstable commands\",\n builder: async argv => {\n return argv.command(typescript).command(auth).demandCommand();\n },\n handler: _args => {}\n }).parseAsync();\n } catch (err) {\n if (err instanceof ExitProcessError) {\n consola.error(err);\n }\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const command = {\n command: \"login\",\n describe: \"Authenticate with an application ID\",\n builder: argv => {\n return argv.option(\"clientId\", {\n alias: \"applicationId\",\n // for backwards compatibility\n type: \"string\",\n demandOption: true,\n describe: \"OAuth client ID for application\"\n });\n },\n handler: async args => {\n const command = await import(\"@osdk/cli.common/loginFlow\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport login from \"./login/index.js\";\nconst auth = {\n command: \"auth\",\n describe: \"Manage your session\",\n builder: argv => {\n return argv.options({\n foundryUrl: {\n type: \"string\",\n demandOption: true,\n alias: \"baseUrl\",\n // for backwards compatibility\n describe: \"URL for the Foundry stack\"\n }\n }).command(login).demandCommand();\n },\n handler: async args => {}\n};\nexport default auth;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { promises as fsPromises } from \"node:fs\";\nimport { extname } from \"node:path\";\nconst CONFIG_FILE_NAMES = [\"foundry.config.json\"];\nconst CONFIG_FILE_SCHEMA = {\n type: \"object\",\n properties: {\n foundryUrl: {\n type: \"string\"\n },\n site: {\n type: \"object\",\n properties: {\n application: {\n type: \"string\"\n },\n directory: {\n type: \"string\"\n },\n autoVersion: {\n type: \"object\",\n nullable: true,\n oneOf: [{\n properties: {\n type: {\n const: \"git-describe\",\n type: \"string\"\n },\n tagPrefix: {\n type: \"string\",\n nullable: true\n }\n }\n }],\n required: [\"type\"]\n }\n },\n required: [\"application\", \"directory\"]\n }\n },\n required: [\"foundryUrl\", \"site\"],\n additionalProperties: false\n};\n\n/**\n * Asynchronously loads a configuration file. Looks for any of the CONFIG_FILE_NAMES in the current directory going up to the root directory.\n * @returns A promise that resolves to the configuration JSON object, or undefined if not found.\n * @throws Will throw an error if the configuration file is found but cannot be read or parsed.\n */\nexport async function loadFoundryConfig() {\n const ajvModule = await import(\"ajv\");\n const Ajv = ajvModule.default.default; // https://github.com/ajv-validator/ajv/issues/2132\n const ajv = new Ajv({\n allErrors: true\n });\n const validate = ajv.compile(CONFIG_FILE_SCHEMA);\n const {\n findUp\n } = await import(\"find-up\");\n const configFilePath = await findUp(CONFIG_FILE_NAMES);\n if (configFilePath) {\n let foundryConfig;\n try {\n const fileContent = await fsPromises.readFile(configFilePath, \"utf-8\");\n foundryConfig = parseConfigFile(fileContent, configFilePath);\n } catch (error) {\n throw new ExitProcessError(2, `Couldn't read or parse config file ${configFilePath}. Error: ${error}`);\n }\n if (!validate(foundryConfig)) {\n throw new ExitProcessError(2, `The configuration file does not match the expected schema: ${ajv.errorsText(validate.errors)}`);\n }\n return {\n foundryConfig,\n configFilePath\n };\n }\n return undefined;\n}\nfunction parseConfigFile(fileContent, configFilePath) {\n const extension = extname(configFilePath);\n switch (extension) {\n case \".json\":\n return JSON.parse(fileContent);\n default:\n throw new ExitProcessError(2, `Unsupported file extension: ${extension} for config file.`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { loadFoundryConfig } from \"./config.js\";\nlet configPromise = undefined;\nfunction getConfig() {\n if (configPromise == null) {\n configPromise = loadFoundryConfig();\n }\n return configPromise;\n}\nexport default getConfig;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nexport async function logDeployCommandConfigFileOverride(args, config) {\n if (config?.autoVersion != null && args.autoVersion !== config?.autoVersion.type) {\n consola.debug(`Overriding \"autoVersion\" from config file with ${args.autoVersion}`);\n }\n if (config?.directory != null && args.directory !== config?.directory) {\n consola.debug(`Overriding \"directory\" from config file with ${args.directory}`);\n }\n if (config?.autoVersion?.tagPrefix != null && args.gitTagPrefix != null && args.gitTagPrefix !== config?.autoVersion.tagPrefix) {\n consola.debug(`Overriding \"gitTagPrefix\" from config file with ${args.gitTagPrefix}`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isValidSemver, YargsCheckError } from \"@osdk/cli.common\";\nimport configLoader from \"../../../util/configLoader.js\";\nimport { logDeployCommandConfigFileOverride } from \"./logDeployCommandConfigFileOverride.js\";\nconst command = {\n command: \"deploy\",\n describe: \"Deploy a new site version\",\n builder: async argv => {\n const config = await configLoader();\n const siteConfig = config?.foundryConfig.site;\n const directory = siteConfig?.directory;\n const autoVersion = siteConfig?.autoVersion;\n const gitTagPrefix = autoVersion?.tagPrefix;\n return argv.options({\n directory: {\n type: \"string\",\n description: \"Directory containing site files\",\n ...(directory ? {\n default: directory\n } : {\n demandOption: true\n })\n },\n uploadOnly: {\n type: \"boolean\",\n description: \"Upload new site version only without setting as live\",\n default: false\n },\n version: {\n type: \"string\",\n description: \"New version of site to deploy\",\n ...(autoVersion == null ? {\n conflicts: \"autoVersion\"\n } : {})\n },\n autoVersion: {\n coerce: autoVersion => autoVersion,\n type: \"string\",\n choices: [\"git-describe\"],\n description: \"Enable auto versioning\",\n ...(autoVersion != null ? {\n default: autoVersion.type\n } : {\n conflicts: \"version\"\n })\n },\n gitTagPrefix: {\n type: \"string\",\n description: \"Prefix to match git tags on when 'git-describe' auto versioning is used. If not provided, all tags are matched and the prefix 'v' is stripped if present.\",\n ...(gitTagPrefix ? {\n default: gitTagPrefix\n } : {})\n }\n }).group([\"directory\", \"version\", \"uploadOnly\"], \"Deploy Options\").group([\"autoVersion\", \"gitTagPrefix\"], \"Auto Version Options\").check(args => {\n // This is required because we can't use demandOption with conflicts. conflicts protects us against the case where both are provided.\n // So this case is for when nothing is provided.\n if (autoVersion == null && args.autoVersion == null && args.version == null) {\n throw new YargsCheckError(\"One of --version or --autoVersion must be specified\");\n }\n if (args.version != null && !isValidSemver(args.version)) {\n throw new YargsCheckError(`--version \"${args.version}\" must be a valid SemVer string`);\n }\n const autoVersionType = args.autoVersion ?? autoVersion;\n if (autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`Only 'git-describe' is supported for autoVersion`);\n }\n const gitTagPrefixValue = args.gitTagPrefix ?? gitTagPrefix;\n // Future proofing for when we support other autoVersion types\n if (gitTagPrefixValue != null && autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`--gitTagPrefix is only supported when --autoVersion=git-describe`);\n }\n return true;\n }).middleware(args => logDeployCommandConfigFileOverride(args, siteConfig));\n },\n handler: async args => {\n const command = await import(\"./siteDeployCommand.mjs\");\n const {\n version,\n autoVersion,\n gitTagPrefix,\n ...restArgs\n } = args;\n const selectedVersion = args.version != null ? args.version : {\n type: args.autoVersion,\n tagPrefix: args.gitTagPrefix\n };\n await command.default({\n ...restArgs,\n selectedVersion\n });\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nexport async function logSiteCommandConfigFileOverride(args, config) {\n if (config?.site.application != null && args.application !== config.site.application) {\n consola.debug(`Overriding \"application\" from config file with ${args.application}`);\n }\n if (config?.foundryUrl != null && args.foundryUrl !== config.foundryUrl) {\n consola.debug(`Overriding \"foundryUrl\" from config file with ${args.foundryUrl}`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"delete <version>\",\n describe: \"Delete site version\",\n builder: argv => {\n return argv.positional(\"version\", {\n type: \"string\",\n demandOption: true,\n description: \"Version to set as live\"\n }).option(\"yes\", {\n alias: \"y\",\n type: \"boolean\",\n description: \"Automatically confirm destructive changes\"\n }).group([\"yes\"], \"Delete Options\");\n },\n handler: async args => {\n const command = await import(\"./versionDeleteCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"get\",\n describe: \"Get live site version\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./versionGetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"list\",\n describe: \"List site versions\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./versionListCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"set <version>\",\n describe: \"Set live site version\",\n builder: argv => {\n return argv.positional(\"version\", {\n type: \"string\",\n demandOption: true,\n description: \"Version to set as live\"\n });\n },\n handler: async args => {\n const command = await import(\"./versionSetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"unset\",\n describe: \"Clear live site version\",\n builder: argv => {\n return argv.option(\"yes\", {\n alias: \"y\",\n type: \"boolean\",\n description: \"Automatically confirm destructive changes\"\n }).group([\"yes\"], \"Unset Options\");\n },\n handler: async args => {\n const command = await import(\"./versionUnsetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport deleteCmd from \"./delete/index.js\";\nimport get from \"./get/index.js\";\nimport list from \"./list/index.js\";\nimport set from \"./set/index.js\";\nimport unset from \"./unset/index.js\";\nconst command = {\n command: \"version\",\n describe: \"Manage site versions\",\n builder: argv => {\n return argv.command(list).command(get).command(set).command(unset).command(deleteCmd).demandCommand();\n },\n handler: async args => {}\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { YargsCheckError } from \"@osdk/cli.common\";\nimport configLoader from \"../../util/configLoader.js\";\nimport deploy from \"./deploy/index.js\";\nimport { logSiteCommandConfigFileOverride } from \"./logSiteCommandConfigFileOverride.js\";\nimport version from \"./version/index.js\";\nconst command = {\n command: \"site\",\n describe: \"Manage your site\",\n builder: async argv => {\n const config = await configLoader();\n const application = config?.foundryConfig.site.application;\n const foundryUrl = config?.foundryConfig.foundryUrl;\n return argv.options({\n application: {\n type: \"string\",\n coerce: application => application,\n ...(application ? {\n default: application\n } : {\n demandOption: true\n }),\n description: \"Application resource identifier (rid)\"\n },\n foundryUrl: {\n coerce: foundryUrl => foundryUrl.replace(/\\/$/, \"\"),\n type: \"string\",\n ...(foundryUrl ? {\n default: foundryUrl\n } : {\n demandOption: true\n }),\n description: \"URL for the Foundry stack\"\n },\n token: {\n type: \"string\",\n conflicts: \"tokenFile\",\n description: \"Foundry API token\"\n },\n tokenFile: {\n type: \"string\",\n conflicts: \"token\",\n description: \"Path to file containing Foundry API token\"\n }\n }).group([\"application\", \"foundryUrl\", \"token\", \"tokenFile\"], \"Common Options\").command(version).command(deploy).check(args => {\n if (!args.foundryUrl.startsWith(\"https://\")) {\n throw new YargsCheckError(\"foundryUrl must start with https://\");\n }\n return true;\n }).middleware(args => logSiteCommandConfigFileOverride(args, config?.foundryConfig)).demandCommand();\n },\n handler: async args => {}\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport getConfig from \"../util/configLoader.js\";\nlet firstTime = true;\nexport async function logConfigFileMiddleware() {\n if (firstTime) {\n firstTime = false;\n const config = getConfig();\n const configFilePath = (await config)?.configFilePath;\n if (configFilePath) {\n consola.debug(`Using configuration from file: \"${configFilePath}\"`);\n }\n }\n}"]}
|