@osdk/cli 0.0.15 → 0.0.17

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.
Files changed (83) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/build/js/chunk-2DZBTS5E.cjs +129 -0
  3. package/build/js/chunk-2DZBTS5E.cjs.map +1 -0
  4. package/build/js/chunk-CIVC2ZV3.mjs +175 -0
  5. package/build/js/chunk-CIVC2ZV3.mjs.map +1 -0
  6. package/build/js/chunk-E2SEJZTC.mjs +9 -0
  7. package/build/js/chunk-GTNZA5UY.mjs +11 -0
  8. package/build/js/chunk-GTNZA5UY.mjs.map +1 -0
  9. package/build/js/chunk-HQDDGVB7.cjs +11 -0
  10. package/build/js/chunk-HYF3CTKZ.cjs +13 -0
  11. package/build/js/chunk-HYF3CTKZ.cjs.map +1 -0
  12. package/build/js/chunk-JFDXL5SV.mjs +122 -0
  13. package/build/js/chunk-JFDXL5SV.mjs.map +1 -0
  14. package/build/js/chunk-VZM34PGO.cjs +180 -0
  15. package/build/js/chunk-VZM34PGO.cjs.map +1 -0
  16. package/build/js/handleGenerate-ER4YF43Z.mjs +89 -0
  17. package/build/js/handleGenerate-ER4YF43Z.mjs.map +1 -0
  18. package/build/js/handleGenerate-UTCLNZQO.cjs +111 -0
  19. package/build/js/handleGenerate-UTCLNZQO.cjs.map +1 -0
  20. package/build/js/handleSiteDeploy-7E5BNDQO.cjs +30 -0
  21. package/build/js/handleSiteDeploy-7E5BNDQO.cjs.map +1 -0
  22. package/build/js/handleSiteDeploy-ZFWLLEFU.mjs +28 -0
  23. package/build/js/handleSiteDeploy-ZFWLLEFU.mjs.map +1 -0
  24. package/build/js/index.cjs +290 -23
  25. package/build/js/index.cjs.map +1 -1
  26. package/build/js/index.mjs +273 -6
  27. package/build/js/index.mjs.map +1 -1
  28. package/build/js/loginFlow-BZDDHHT5.cjs +10 -0
  29. package/build/js/loginFlow-BZDDHHT5.cjs.map +1 -0
  30. package/build/js/loginFlow-KGLTXVZ6.mjs +4 -0
  31. package/build/js/loginFlow-KGLTXVZ6.mjs.map +1 -0
  32. package/build/js/siteDeleteCommand-FIB7KBAY.mjs +13 -0
  33. package/build/js/siteDeleteCommand-FIB7KBAY.mjs.map +1 -0
  34. package/build/js/siteDeleteCommand-UGHBNEC4.cjs +15 -0
  35. package/build/js/siteDeleteCommand-UGHBNEC4.cjs.map +1 -0
  36. package/build/js/siteUploadCommand-5VEJTNOQ.mjs +33 -0
  37. package/build/js/siteUploadCommand-5VEJTNOQ.mjs.map +1 -0
  38. package/build/js/siteUploadCommand-OEM2U44I.cjs +58 -0
  39. package/build/js/siteUploadCommand-OEM2U44I.cjs.map +1 -0
  40. package/build/js/siteVersionsCommand-HP4IUW56.cjs +29 -0
  41. package/build/js/siteVersionsCommand-HP4IUW56.cjs.map +1 -0
  42. package/build/js/siteVersionsCommand-X666N6ZP.mjs +27 -0
  43. package/build/js/siteVersionsCommand-X666N6ZP.mjs.map +1 -0
  44. package/build/types/commands/auth/CommonAuthArgs.d.ts +4 -0
  45. package/build/types/commands/auth/index.d.ts +5 -0
  46. package/build/types/commands/auth/login/LoginArgs.d.ts +4 -0
  47. package/build/types/commands/auth/login/index.d.ts +5 -0
  48. package/build/types/commands/auth/login/loginFlow.d.ts +2 -0
  49. package/build/types/commands/auth/login/token.d.ts +12 -0
  50. package/build/types/commands/typescript/generate/TypescriptGenerateArgs.d.ts +4 -1
  51. package/package.json +6 -4
  52. package/build/js/chunk-MGT3UGXW.mjs +0 -5
  53. package/build/js/chunk-MGT3UGXW.mjs.map +0 -1
  54. package/build/js/chunk-TSZWWATC.mjs +0 -12
  55. package/build/js/chunk-TSZWWATC.mjs.map +0 -1
  56. package/build/js/chunk-UOKM237I.cjs +0 -17
  57. package/build/js/chunk-UOKM237I.cjs.map +0 -1
  58. package/build/js/chunk-V4QJCMF6.cjs +0 -7
  59. package/build/js/chunk-V4QJCMF6.cjs.map +0 -1
  60. package/build/js/chunk-X6QW63OH.cjs +0 -7
  61. package/build/js/chunk-XIJ2ZQRX.mjs +0 -5
  62. package/build/js/handleGenerate-XM72AL6J.cjs +0 -32
  63. package/build/js/handleGenerate-XM72AL6J.cjs.map +0 -1
  64. package/build/js/handleGenerate-ZHO53G62.mjs +0 -10
  65. package/build/js/handleGenerate-ZHO53G62.mjs.map +0 -1
  66. package/build/js/handleSiteDeploy-257ZNTYA.cjs +0 -12
  67. package/build/js/handleSiteDeploy-257ZNTYA.cjs.map +0 -1
  68. package/build/js/handleSiteDeploy-QCMJWAYI.mjs +0 -10
  69. package/build/js/handleSiteDeploy-QCMJWAYI.mjs.map +0 -1
  70. package/build/js/siteDeleteCommand-NY5W7NE3.cjs +0 -12
  71. package/build/js/siteDeleteCommand-NY5W7NE3.cjs.map +0 -1
  72. package/build/js/siteDeleteCommand-ZKHKGVVF.mjs +0 -10
  73. package/build/js/siteDeleteCommand-ZKHKGVVF.mjs.map +0 -1
  74. package/build/js/siteUploadCommand-OHSOCUL6.cjs +0 -38
  75. package/build/js/siteUploadCommand-OHSOCUL6.cjs.map +0 -1
  76. package/build/js/siteUploadCommand-PZEJVKRE.mjs +0 -13
  77. package/build/js/siteUploadCommand-PZEJVKRE.mjs.map +0 -1
  78. package/build/js/siteVersionsCommand-IE5QH56U.cjs +0 -13
  79. package/build/js/siteVersionsCommand-IE5QH56U.cjs.map +0 -1
  80. package/build/js/siteVersionsCommand-NVJD5BDH.mjs +0 -11
  81. package/build/js/siteVersionsCommand-NVJD5BDH.mjs.map +0 -1
  82. /package/build/js/{chunk-X6QW63OH.cjs.map → chunk-E2SEJZTC.mjs.map} +0 -0
  83. /package/build/js/{chunk-XIJ2ZQRX.mjs.map → chunk-HQDDGVB7.cjs.map} +0 -0
@@ -1,37 +1,304 @@
1
1
  'use strict';
2
2
 
3
- var chunkV4QJCMF6_cjs = require('./chunk-V4QJCMF6.cjs');
4
- require('./chunk-X6QW63OH.cjs');
5
- var V = require('yargs');
3
+ var chunkHYF3CTKZ_cjs = require('./chunk-HYF3CTKZ.cjs');
4
+ require('./chunk-HQDDGVB7.cjs');
5
+ var yargs = require('yargs');
6
6
  var helpers = require('yargs/helpers');
7
- var p = require('fs');
7
+ var fs = require('fs');
8
8
 
9
9
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
10
10
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
11
 
12
12
  function _interopNamespace(e) {
13
- if (e && e.__esModule) return e;
14
- var n = Object.create(null);
15
- if (e) {
16
- Object.keys(e).forEach(function (k) {
17
- if (k !== 'default') {
18
- var d = Object.getOwnPropertyDescriptor(e, k);
19
- Object.defineProperty(n, k, d.get ? d : {
20
- enumerable: true,
21
- get: function () { return e[k]; }
22
- });
23
- }
24
- });
25
- }
26
- n.default = e;
27
- return Object.freeze(n);
13
+ if (e && e.__esModule) return e;
14
+ var n = Object.create(null);
15
+ if (e) {
16
+ Object.keys(e).forEach(function (k) {
17
+ if (k !== 'default') {
18
+ var d = Object.getOwnPropertyDescriptor(e, k);
19
+ Object.defineProperty(n, k, d.get ? d : {
20
+ enumerable: true,
21
+ get: function () { return e[k]; }
22
+ });
23
+ }
24
+ });
25
+ }
26
+ n.default = e;
27
+ return Object.freeze(n);
28
28
  }
29
29
 
30
- var V__default = /*#__PURE__*/_interopDefault(V);
31
- var p__namespace = /*#__PURE__*/_interopNamespace(p);
30
+ var yargs__default = /*#__PURE__*/_interopDefault(yargs);
31
+ var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
32
32
 
33
- var g={command:"delete",describe:"Delete an uploaded version",builder:e=>e.option("siteVersion",{type:"string",demandOption:!0}).option("dir",{type:"string"}),handler:async e=>{await(await import('./siteDeleteCommand-NY5W7NE3.cjs')).default(e);}},r=g;var y={command:"deploy",describe:"Deploy an uploaded version",builder:e=>e.options({siteVersion:{type:"string",conflicts:"clearVersion"},undeploy:{alias:"clearVersion",description:"Causes the site to no longer be deployed",type:"boolean",conflicts:"siteVersion"}}).group(["siteVersion","clearVersion"],"Version To Deploy (requires one of)"),handler:async e=>{await(await import('./handleSiteDeploy-257ZNTYA.cjs')).default(e);}},a=y;var b={command:"upload",describe:"Upload an application version",builder:e=>e.option("siteVersion",{type:"string",demandOption:!0}).option("dir",{type:"string"}),handler:async e=>{await(await import('./siteUploadCommand-OHSOCUL6.cjs')).default(e);}},i=b;var w={command:"versions",describe:"List application versions",builder:e=>e,handler:async e=>{await(await import('./siteVersionsCommand-IE5QH56U.cjs')).default(e);}},s=w;var v={command:"site",describe:"Manage your site",builder:e=>e.options({appRid:{type:"string",demandOption:!0,coerce:n=>n},baseUrl:{type:"string",demandOption:!0}}).group(["appRid","baseUrl"],"Common Arguments").command(s).command(i).command(r).command(a).demandCommand(),handler:async e=>{}},d=v;var h={command:"generate",describe:"Generate typescript from ontology",builder:e=>e.options({outDir:{type:"string",description:"Where to place the generated files",demandOption:!0},ontologyPath:{description:"path to the ontology wire json",type:"string",demandOption:!0},beta:{type:"boolean",description:"Should generate beta sdk",demandOption:!1},packageType:{default:"commonjs",choices:["commonjs","module"]}}).group(["outDir","ontologyPath"],"Version To Deploy (requires one of)"),handler:async e=>{await(await import('./handleGenerate-XM72AL6J.cjs')).default(e);}},m=h;var x={command:"typescript",describe:"Manage code",builder:e=>e.command(m).demandCommand(),handler:async e=>{}},c=x;async function l(){let{findUp:e}=await import('find-up'),n=await e("package.json",{cwd:(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('out.js', document.baseURI).href))});if(!n)return "(unknown version. No package.json found)";let o=JSON.parse(await p__namespace.promises.readFile(n,"utf-8"));return o.version?`v${o.version}`:"(unknown version. No version in package.json found)"}var u=!0;async function f(e){if(u){let o=(await import('consola')).consola;o.info(`Palantir OSDK CLI ${await l()}`),o.level=3+e.verbose,o.level>3&&o.debug(`Verbose logging enabled (${o.level===4?"debug":"trace"})`),console.log(),u=!1;}}async function k(e=process.argv){let n=V__default.default(helpers.hideBin(e)).env("OSDK").version(!1).option("verbose",{alias:"v",type:"boolean",description:"Enable verbose logging",count:!0}).demandCommand().middleware(f,!0).strict().command({command:"unstable",aliases:["experimental"],builder:async o=>o.command(d).command(c).demandCommand(),handler:o=>{}});try{return n.parseAsync()}catch(o){o instanceof chunkV4QJCMF6_cjs.a&&(await import('consola')).consola.error(o.message);}}
33
+ // src/commands/auth/login/index.ts
34
+ var command = {
35
+ command: "login",
36
+ describe: "Authenticate with an application ID",
37
+ builder: (argv) => {
38
+ return argv.option("applicationId", {
39
+ type: "string",
40
+ demandOption: true
41
+ });
42
+ },
43
+ handler: async (args) => {
44
+ const command7 = await import('./loginFlow-BZDDHHT5.cjs');
45
+ await command7.default(args);
46
+ }
47
+ };
48
+ var login_default = command;
34
49
 
35
- exports.cli = k;
50
+ // src/commands/auth/index.ts
51
+ var site = {
52
+ command: "auth",
53
+ describe: "Manage your session",
54
+ builder: (argv) => {
55
+ return argv.options({
56
+ baseUrl: {
57
+ type: "string",
58
+ demandOption: true
59
+ }
60
+ }).command(login_default).demandCommand();
61
+ },
62
+ handler: async (args) => {
63
+ }
64
+ };
65
+ var auth_default = site;
66
+
67
+ // src/commands/site/delete/index.ts
68
+ var command2 = {
69
+ command: "delete",
70
+ describe: "Delete an uploaded version",
71
+ builder: (argv) => {
72
+ return argv.option("siteVersion", {
73
+ type: "string",
74
+ demandOption: true
75
+ }).option("dir", {
76
+ type: "string"
77
+ });
78
+ },
79
+ handler: async (args) => {
80
+ const command7 = await import('./siteDeleteCommand-UGHBNEC4.cjs');
81
+ await command7.default(args);
82
+ }
83
+ };
84
+ var delete_default = command2;
85
+
86
+ // src/commands/site/deploy/index.ts
87
+ var command3 = {
88
+ command: "deploy",
89
+ describe: "Deploy an uploaded version",
90
+ builder: (argv) => {
91
+ return argv.options({
92
+ "siteVersion": {
93
+ type: "string",
94
+ conflicts: "clearVersion"
95
+ // group: "Deploy Version",
96
+ // implies: { "clearVersion": "false" },
97
+ },
98
+ undeploy: {
99
+ alias: "clearVersion",
100
+ description: "Causes the site to no longer be deployed",
101
+ type: "boolean",
102
+ conflicts: "siteVersion"
103
+ // group: "Deploy Version",
104
+ // implies: { "siteVersion": "" },
105
+ }
106
+ }).group(["siteVersion", "clearVersion"], "Version To Deploy (requires one of)");
107
+ },
108
+ handler: async (args) => {
109
+ const command7 = await import('./handleSiteDeploy-7E5BNDQO.cjs');
110
+ await command7.default(args);
111
+ }
112
+ };
113
+ var deploy_default = command3;
114
+
115
+ // src/commands/site/upload/index.ts
116
+ var command4 = {
117
+ command: "upload",
118
+ describe: "Upload an application version",
119
+ builder: (argv) => {
120
+ return argv.option("siteVersion", {
121
+ type: "string",
122
+ demandOption: true
123
+ }).option("dir", {
124
+ type: "string"
125
+ });
126
+ },
127
+ handler: async (args) => {
128
+ const command7 = await import('./siteUploadCommand-OEM2U44I.cjs');
129
+ await command7.default(args);
130
+ }
131
+ };
132
+ var upload_default = command4;
133
+
134
+ // src/commands/site/versions/index.ts
135
+ var command5 = {
136
+ command: "versions",
137
+ describe: "List application versions",
138
+ builder: (argv) => {
139
+ return argv;
140
+ },
141
+ handler: async (args) => {
142
+ const command7 = await import('./siteVersionsCommand-HP4IUW56.cjs');
143
+ await command7.default(args);
144
+ }
145
+ };
146
+ var versions_default = command5;
147
+
148
+ // src/commands/site/index.ts
149
+ var site2 = {
150
+ command: "site",
151
+ describe: "Manage your site",
152
+ builder: (argv) => {
153
+ return argv.options({
154
+ appRid: {
155
+ type: "string",
156
+ demandOption: true,
157
+ coerce: (a) => a
158
+ },
159
+ baseUrl: {
160
+ type: "string",
161
+ demandOption: true
162
+ }
163
+ }).group(["appRid", "baseUrl"], "Common Arguments").command(versions_default).command(upload_default).command(delete_default).command(deploy_default).demandCommand();
164
+ },
165
+ handler: async (args) => {
166
+ }
167
+ };
168
+ var site_default = site2;
169
+
170
+ // src/commands/typescript/generate/generate.ts
171
+ var command6 = {
172
+ command: "generate",
173
+ describe: "Generate typescript from ontology",
174
+ builder: (argv) => {
175
+ return argv.options({
176
+ "outDir": {
177
+ type: "string",
178
+ description: "Where to place the generated files",
179
+ demandOption: true
180
+ },
181
+ ontologyPath: {
182
+ description: "path to the ontology wire json",
183
+ type: "string",
184
+ demandOption: false,
185
+ conflicts: ["stack", "clientId"]
186
+ },
187
+ stack: {
188
+ description: "the URL to the stack that contains the ontology",
189
+ type: "string",
190
+ demandOption: false,
191
+ conflicts: "ontologyPath",
192
+ implies: "clientId"
193
+ },
194
+ clientId: {
195
+ description: "the application's client id",
196
+ type: "string",
197
+ demandOption: false,
198
+ conflicts: "ontologyPath",
199
+ implies: "stack"
200
+ },
201
+ ontologyWritePath: {
202
+ description: "path to write the ontology wire json",
203
+ type: "string",
204
+ demandOption: false,
205
+ conflicts: ["ontologyPath"]
206
+ },
207
+ beta: {
208
+ type: "boolean",
209
+ description: "Should generate beta sdk",
210
+ demandOption: false
211
+ },
212
+ packageType: {
213
+ default: "commonjs",
214
+ choices: ["commonjs", "module"]
215
+ }
216
+ }).group(["ontologyPath", "outDir"], "Generate from a local file").group(["stack", "clientId", "outDir", "ontologyWritePath"], "OR Generate from a stack").check((argv2) => {
217
+ if (argv2.ontologyPath || argv2.stack) {
218
+ return true;
219
+ } else {
220
+ throw new Error("Error: Must specify either ontologyPath or stack and clientId");
221
+ }
222
+ });
223
+ },
224
+ handler: async (args) => {
225
+ const command7 = await import('./handleGenerate-UTCLNZQO.cjs');
226
+ await command7.default(args);
227
+ }
228
+ };
229
+ var generate_default = command6;
230
+
231
+ // src/commands/typescript/index.ts
232
+ var site3 = {
233
+ command: "typescript",
234
+ describe: "Manage code",
235
+ builder: (argv) => {
236
+ return argv.command(generate_default).demandCommand();
237
+ },
238
+ handler: async (args) => {
239
+ }
240
+ };
241
+ var typescript_default = site3;
242
+ async function readCliVersionFromPackageJson() {
243
+ const {
244
+ findUp
245
+ } = await import('find-up');
246
+ const result = await findUp("package.json", {
247
+ cwd: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('out.js', document.baseURI).href))
248
+ });
249
+ if (!result) {
250
+ return "(unknown version. No package.json found)";
251
+ }
252
+ const packageJson = JSON.parse(await fs__namespace.promises.readFile(result, "utf-8"));
253
+ if (packageJson.version) {
254
+ return `v${packageJson.version}`;
255
+ } else {
256
+ return "(unknown version. No version in package.json found)";
257
+ }
258
+ }
259
+
260
+ // src/yargs/logVersionMiddleware.ts
261
+ var firstTime = true;
262
+ async function logVersionMiddleware(args) {
263
+ if (firstTime) {
264
+ const Consola = await import('consola');
265
+ const consola = Consola.consola;
266
+ consola.info(`Palantir OSDK CLI ${await readCliVersionFromPackageJson()}`);
267
+ consola.level = 3 + args.verbose;
268
+ if (consola.level > 3) {
269
+ consola.debug(`Verbose logging enabled (${consola.level === 4 ? "debug" : "trace"})`);
270
+ }
271
+ console.log();
272
+ firstTime = false;
273
+ }
274
+ }
275
+
276
+ // src/cli.ts
277
+ async function cli(args = process.argv) {
278
+ const base = yargs__default.default(helpers.hideBin(args)).env("OSDK").version(false).option("verbose", {
279
+ alias: "v",
280
+ type: "boolean",
281
+ description: "Enable verbose logging",
282
+ count: true
283
+ }).demandCommand().middleware(logVersionMiddleware, true).strict().command({
284
+ command: "unstable",
285
+ aliases: ["experimental"],
286
+ builder: async (argv) => {
287
+ return argv.command(site_default).command(typescript_default).command(auth_default).demandCommand();
288
+ },
289
+ handler: (_args) => {
290
+ }
291
+ });
292
+ try {
293
+ return base.parseAsync();
294
+ } catch (e) {
295
+ if (e instanceof chunkHYF3CTKZ_cjs.ExitProcessError) {
296
+ const Consola = await import('consola');
297
+ Consola.consola.error(e.message);
298
+ }
299
+ }
300
+ }
301
+
302
+ exports.cli = cli;
36
303
  //# sourceMappingURL=out.js.map
37
304
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli.ts","../../src/commands/site/delete/index.ts","../../src/commands/site/deploy/index.ts","../../src/commands/site/upload/index.ts","../../src/commands/site/versions/index.ts","../../src/commands/site/index.ts","../../src/commands/typescript/generate/generate.ts","../../src/commands/typescript/index.ts","../../src/readCliVersionFromPackageJson.ts","../../src/yargs/logVersionMiddleware.ts"],"names":["yargs","hideBin","command","argv","args","delete_default","deploy_default","upload_default","versions_default","site","a","site_default","generate_default","typescript_default","fs","readCliVersionFromPackageJson","findUp","result","packageJson","firstTime","logVersionMiddleware","consola","cli","base","_args","e","ExitProcessError"],"mappings":"sEAgBA,OAAOA,MAAW,QAClB,OAAS,WAAAC,MAAe,gBCDjB,IAAMC,EAAU,CACrB,QAAS,SACT,SAAU,6BACV,QAASC,GACAA,EAAK,OAAO,cAAe,CAChC,KAAM,SACN,aAAc,EAChB,CAAC,EAAE,OAAO,MAAO,CACf,KAAM,QACR,CAAC,EAEH,QAAS,MAAMC,GAAQ,CAErB,MADgB,KAAM,QAAO,kCAAyB,GACxC,QAAQA,CAAI,CAC5B,CACF,EACOC,EAAQH,EChBR,IAAMA,EAAU,CACrB,QAAS,SACT,SAAU,6BACV,QAASC,GACAA,EAAK,QAAQ,CAClB,YAAe,CACb,KAAM,SACN,UAAW,cAGb,EAEA,SAAU,CACR,MAAO,eACP,YAAa,2CACb,KAAM,UACN,UAAW,aAGb,CACF,CAAC,EAAE,MAAM,CAAC,cAAe,cAAc,EAAG,qCAAqC,EAejF,QAAS,MAAMC,GAAQ,CAErB,MADgB,KAAM,QAAO,iCAAwB,GACvC,QAAQA,CAAI,CAC5B,CACF,EACOE,EAAQJ,ECxCR,IAAMA,EAAU,CACrB,QAAS,SACT,SAAU,gCACV,QAASC,GACAA,EAAK,OAAO,cAAe,CAChC,KAAM,SACN,aAAc,EAChB,CAAC,EAAE,OAAO,MAAO,CACf,KAAM,QACR,CAAC,EAEH,QAAS,MAAMC,GAAQ,CAErB,MADgB,KAAM,QAAO,kCAAyB,GACxC,QAAQA,CAAI,CAC5B,CACF,EACOG,EAAQL,EChBR,IAAMA,EAAU,CACrB,QAAS,WACT,SAAU,4BACV,QAASC,GACAA,EAET,Q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AI,CAACC,EACH,MAAO,2CAET,IAAMC,EAAc,KAAK,MAAM,MAAS,WAAS,SAASD,EAAQ,OAAO,CAAC,EAC1E,OAAIC,EAAY,QACP,IAAIA,EAAY,OAAO,GAEvB,qDAEX,CChBA,IAAIC,EAAY,GAChB,eAAsBC,EAAqBhB,EAAM,CAC/C,GAAIe,EAAW,CAGb,IAAME,GAFU,KAAM,QAAO,SAAS,GAEd,QACxBA,EAAQ,KAAK,qBAAqB,MAAMN,EAA8B,CAAC,EAAE,EACzEM,EAAQ,MAAQ,EAAIjB,EAAK,QACrBiB,EAAQ,MAAQ,GAClBA,EAAQ,MAAM,4BAA4BA,EAAQ,QAAU,EAAI,QAAU,OAAO,GAAG,EAItF,QAAQ,IAAI,EACZF,EAAY,EACd,CACF,CTXA,eAAsBG,EAAIlB,EAAO,QAAQ,KAAM,CAC7C,IAAMmB,EAAOvB,EAAMC,EAAQG,CAAI,CAAC,EAAE,IAAI,MAAM,EAAE,QAAQ,EAAK,EAAE,OAAO,UAAW,CAC7E,MAAO,IACP,KAAM,UACN,YAAa,yBACb,MAAO,EACT,CAAC,EAAE,cAAc,EAAE,WAAWgB,EAAsB,EAAI,EAAE,OAAO,EAAE,QAAQ,CACzE,QAAS,WACT,QAAS,CAAC,cAAc,EACxB,QAAS,MAAMjB,GACNA,EAAK,QAAQQ,CAAI,EAAE,QAAQE,CAAU,EAAE,cAAc,EAE9D,QAASW,GAAS,CAAC,CACrB,CAAC,EACD,GAAI,CACF,OAAOD,EAAK,WAAW,CACzB,OAASE,EAAG,CACNA,aAAaC,IACC,KAAM,QAAO,SAAS,GAC9B,QAAQ,MAAMD,EAAE,OAAO,CAEnC,CACF","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\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport site from \"./commands/site/index.js\";\nimport typescript from \"./commands/typescript/index.js\";\nimport { ExitProcessError } from \"./ExitProcessError.js\";\nimport { logVersionMiddleware } from \"./yargs/logVersionMiddleware.js\";\nexport async function cli(args = process.argv) {\n const base = yargs(hideBin(args)).env(\"OSDK\").version(false).option(\"verbose\", {\n alias: \"v\",\n type: \"boolean\",\n description: \"Enable verbose logging\",\n count: true\n }).demandCommand().middleware(logVersionMiddleware, true).strict().command({\n command: \"unstable\",\n aliases: [\"experimental\"],\n builder: async argv => {\n return argv.command(site).command(typescript).demandCommand();\n },\n handler: _args => {}\n });\n try {\n return base.parseAsync();\n } catch (e) {\n if (e instanceof ExitProcessError) {\n const Consola = await import(\"consola\");\n Consola.consola.error(e.message);\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: \"delete\",\n describe: \"Delete an uploaded version\",\n builder: argv => {\n return argv.option(\"siteVersion\", {\n type: \"string\",\n demandOption: true\n }).option(\"dir\", {\n type: \"string\"\n });\n },\n handler: async args => {\n const command = await import(\"./siteDeleteCommand.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\nexport const command = {\n command: \"deploy\",\n describe: \"Deploy an uploaded version\",\n builder: argv => {\n return argv.options({\n \"siteVersion\": {\n type: \"string\",\n conflicts: \"clearVersion\"\n // group: \"Deploy Version\",\n // implies: { \"clearVersion\": \"false\" },\n },\n\n undeploy: {\n alias: \"clearVersion\",\n description: \"Causes the site to no longer be deployed\",\n type: \"boolean\",\n conflicts: \"siteVersion\"\n // group: \"Deploy Version\",\n // implies: { \"siteVersion\": \"\" },\n }\n }).group([\"siteVersion\", \"clearVersion\"], \"Version To Deploy (requires one of)\");\n\n // .check((args) => {\n // if (\n // (args.siteVersion && args.clearVersion)\n // || (!args.siteVersion && args.clearVersion == undefined)\n // ) {\n // // consola.error(\"Only one of --siteVersion or --clearVersion may be provided\");\n // throw new Error(\n // \"Only one of --siteVersion or --clearVersion may be provided\",\n // );\n // }\n // });\n },\n\n handler: async args => {\n const command = await import(\"./handleSiteDeploy.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\nexport const command = {\n command: \"upload\",\n describe: \"Upload an application version\",\n builder: argv => {\n return argv.option(\"siteVersion\", {\n type: \"string\",\n demandOption: true\n }).option(\"dir\", {\n type: \"string\"\n });\n },\n handler: async args => {\n const command = await import(\"./siteUploadCommand.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\nexport const command = {\n command: \"versions\",\n describe: \"List application versions\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./siteVersionsCommand.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 siteDelete from \"./delete/index.js\";\nimport siteDeploy from \"./deploy/index.js\";\nimport upload from \"./upload/index.js\";\nimport versions from \"./versions/index.js\";\nconst site = {\n command: \"site\",\n describe: \"Manage your site\",\n builder: argv => {\n return argv.options({\n appRid: {\n type: \"string\",\n demandOption: true,\n coerce: a => a\n },\n baseUrl: {\n type: \"string\",\n demandOption: true\n }\n }).group([\"appRid\", \"baseUrl\"], \"Common Arguments\").command(versions).command(upload).command(siteDelete).command(siteDeploy).demandCommand();\n },\n handler: async args => {}\n};\nexport default site;","/*\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: \"generate\",\n describe: \"Generate typescript 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: true\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 }).group([\"outDir\", \"ontologyPath\"], \"Version To Deploy (requires one of)\");\n },\n handler: async args => {\n const command = await import(\"./handleGenerate.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 generate from \"./generate/generate.js\";\nconst site = {\n command: \"typescript\",\n describe: \"Manage code\",\n builder: argv => {\n return argv.command(generate).demandCommand();\n },\n handler: async args => {}\n};\nexport default site;","/*\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 * as fs from \"node:fs\";\nexport async function readCliVersionFromPackageJson() {\n const {\n findUp\n } = await import(\"find-up\");\n const result = await findUp(\"package.json\", {\n cwd: import.meta.url\n });\n if (!result) {\n return \"(unknown version. No package.json found)\";\n }\n const packageJson = JSON.parse(await fs.promises.readFile(result, \"utf-8\"));\n if (packageJson.version) {\n return `v${packageJson.version}`;\n } else {\n return \"(unknown version. No version in package.json found)\";\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 { readCliVersionFromPackageJson } from \"../readCliVersionFromPackageJson.js\";\nlet firstTime = true;\nexport async function logVersionMiddleware(args) {\n if (firstTime) {\n const Consola = await import(\"consola\");\n // This will be called before any command is executed\n const consola = Consola.consola;\n consola.info(`Palantir OSDK CLI ${await readCliVersionFromPackageJson()}`);\n consola.level = 3 + args.verbose; // so 1 -v is debug logs and -vv is trace\n if (consola.level > 3) {\n consola.debug(`Verbose logging enabled (${consola.level === 4 ? \"debug\" : \"trace\"})`);\n }\n\n // eslint-disable-next-line no-console\n console.log(); // Not consola. Just want a blank line\n firstTime = false;\n }\n}"]}
1
+ {"version":3,"sources":["../../src/cli.ts","../../src/commands/auth/login/index.ts","../../src/commands/auth/index.ts","../../src/commands/site/delete/index.ts","../../src/commands/site/deploy/index.ts","../../src/commands/site/upload/index.ts","../../src/commands/site/versions/index.ts","../../src/commands/site/index.ts","../../src/commands/typescript/generate/generate.ts","../../src/commands/typescript/index.ts","../../src/readCliVersionFromPackageJson.ts","../../src/yargs/logVersionMiddleware.ts"],"names":["command","site","argv"],"mappings":";;;;;;AAgBA,OAAO,WAAW;AAClB,SAAS,eAAe;;;ACDjB,IAAM,UAAU;AAAA,EACrB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,UAAQ;AACf,WAAO,KAAK,OAAO,iBAAiB;AAAA,MAClC,MAAM;AAAA,MACN,cAAc;AAAA,IAChB,CAAC;AAAA,EACH;AAAA,EACA,SAAS,OAAM,SAAQ;AACrB,UAAMA,WAAU,MAAM,OAAO,0BAAgB;AAC7C,UAAMA,SAAQ,QAAQ,IAAI;AAAA,EAC5B;AACF;AACA,IAAO,gBAAQ;;;ACbf,IAAM,OAAO;AAAA,EACX,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,UAAQ;AACf,WAAO,KAAK,QAAQ;AAAA,MAClB,SAAS;AAAA,QACP,MAAM;AAAA,QACN,cAAc;AAAA,MAChB;AAAA,IACF,CAAC,EAAE,QAAQ,aAAK,EAAE,cAAc;AAAA,EAClC;AAAA,EACA,SAAS,OAAM,SAAQ;AAAA,EAAC;AAC1B;AACA,IAAO,eAAQ;;;ACdR,IAAMA,WAAU;AAAA,EACrB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,UAAQ;AACf,WAAO,KAAK,OAAO,eAAe;AAAA,MAChC,MAAM;AAAA,MACN,cAAc;AAAA,IAChB,CAAC,EAAE,OAAO,OAAO;AAAA,MACf,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AAAA,EACA,SAAS,OAAM,SAAQ;AACrB,UAAMA,WAAU,MAAM,OAAO,kCAAyB;AACtD,UAAMA,SAAQ,QAAQ,IAAI;AAAA,EAC5B;AACF;AACA,IAAO,iBAAQA;;;AChBR,IAAMA,WAAU;AAAA,EACrB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,UAAQ;AACf,WAAO,KAAK,QAAQ;AAAA,M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AACF;;;AXVA,eAAsB,IAAI,OAAO,QAAQ,MAAM;AAC7C,QAAM,OAAO,MAAM,QAAQ,IAAI,CAAC,EAAE,IAAI,MAAM,EAAE,QAAQ,KAAK,EAAE,OAAO,WAAW;AAAA,IAC7E,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,OAAO;AAAA,EACT,CAAC,EAAE,cAAc,EAAE,WAAW,sBAAsB,IAAI,EAAE,OAAO,EAAE,QAAQ;AAAA,IACzE,SAAS;AAAA,IACT,SAAS,CAAC,cAAc;AAAA,IACxB,SAAS,OAAM,SAAQ;AACrB,aAAO,KAAK,QAAQ,YAAI,EAAE,QAAQ,kBAAU,EAAE,QAAQ,YAAI,EAAE,cAAc;AAAA,IAC5E;AAAA,IACA,SAAS,WAAS;AAAA,IAAC;AAAA,EACrB,CAAC;AACD,MAAI;AACF,WAAO,KAAK,WAAW;AAAA,EACzB,SAAS,GAAG;AACV,QAAI,aAAa,kBAAkB;AACjC,YAAM,UAAU,MAAM,OAAO,SAAS;AACtC,cAAQ,QAAQ,MAAM,EAAE,OAAO;AAAA,IACjC;AAAA,EACF;AACF","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\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport auth from \"./commands/auth/index.js\";\nimport site from \"./commands/site/index.js\";\nimport typescript from \"./commands/typescript/index.js\";\nimport { ExitProcessError } from \"./ExitProcessError.js\";\nimport { logVersionMiddleware } from \"./yargs/logVersionMiddleware.js\";\nexport async function cli(args = process.argv) {\n const base = yargs(hideBin(args)).env(\"OSDK\").version(false).option(\"verbose\", {\n alias: \"v\",\n type: \"boolean\",\n description: \"Enable verbose logging\",\n count: true\n }).demandCommand().middleware(logVersionMiddleware, true).strict().command({\n command: \"unstable\",\n aliases: [\"experimental\"],\n builder: async argv => {\n return argv.command(site).command(typescript).command(auth).demandCommand();\n },\n handler: _args => {}\n });\n try {\n return base.parseAsync();\n } catch (e) {\n if (e instanceof ExitProcessError) {\n const Consola = await import(\"consola\");\n Consola.consola.error(e.message);\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(\"applicationId\", {\n type: \"string\",\n demandOption: true\n });\n },\n handler: async args => {\n const command = await import(\"./loginFlow.js\");\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 site = {\n command: \"auth\",\n describe: \"Manage your session\",\n builder: argv => {\n return argv.options({\n baseUrl: {\n type: \"string\",\n demandOption: true\n }\n }).command(login).demandCommand();\n },\n handler: async args => {}\n};\nexport default site;","/*\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: \"delete\",\n describe: \"Delete an uploaded version\",\n builder: argv => {\n return argv.option(\"siteVersion\", {\n type: \"string\",\n demandOption: true\n }).option(\"dir\", {\n type: \"string\"\n });\n },\n handler: async args => {\n const command = await import(\"./siteDeleteCommand.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\nexport const command = {\n command: \"deploy\",\n describe: \"Deploy an uploaded version\",\n builder: argv => {\n return argv.options({\n \"siteVersion\": {\n type: \"string\",\n conflicts: \"clearVersion\"\n // group: \"Deploy Version\",\n // implies: { \"clearVersion\": \"false\" },\n },\n\n undeploy: {\n alias: \"clearVersion\",\n description: \"Causes the site to no longer be deployed\",\n type: \"boolean\",\n conflicts: \"siteVersion\"\n // group: \"Deploy Version\",\n // implies: { \"siteVersion\": \"\" },\n }\n }).group([\"siteVersion\", \"clearVersion\"], \"Version To Deploy (requires one of)\");\n\n // .check((args) => {\n // if (\n // (args.siteVersion && args.clearVersion)\n // || (!args.siteVersion && args.clearVersion == undefined)\n // ) {\n // // consola.error(\"Only one of --siteVersion or --clearVersion may be provided\");\n // throw new Error(\n // \"Only one of --siteVersion or --clearVersion may be provided\",\n // );\n // }\n // });\n },\n\n handler: async args => {\n const command = await import(\"./handleSiteDeploy.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\nexport const command = {\n command: \"upload\",\n describe: \"Upload an application version\",\n builder: argv => {\n return argv.option(\"siteVersion\", {\n type: \"string\",\n demandOption: true\n }).option(\"dir\", {\n type: \"string\"\n });\n },\n handler: async args => {\n const command = await import(\"./siteUploadCommand.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\nexport const command = {\n command: \"versions\",\n describe: \"List application versions\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./siteVersionsCommand.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 siteDelete from \"./delete/index.js\";\nimport siteDeploy from \"./deploy/index.js\";\nimport upload from \"./upload/index.js\";\nimport versions from \"./versions/index.js\";\nconst site = {\n command: \"site\",\n describe: \"Manage your site\",\n builder: argv => {\n return argv.options({\n appRid: {\n type: \"string\",\n demandOption: true,\n coerce: a => a\n },\n baseUrl: {\n type: \"string\",\n demandOption: true\n }\n }).group([\"appRid\", \"baseUrl\"], \"Common Arguments\").command(versions).command(upload).command(siteDelete).command(siteDeploy).demandCommand();\n },\n handler: async args => {}\n};\nexport default site;","/*\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: \"generate\",\n describe: \"Generate typescript 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: [\"stack\", \"clientId\"]\n },\n stack: {\n description: \"the URL to the stack that contains the ontology\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"clientId\"\n },\n clientId: {\n description: \"the application's client id\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"stack\"\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 }).group([\"ontologyPath\", \"outDir\"], \"Generate from a local file\").group([\"stack\", \"clientId\", \"outDir\", \"ontologyWritePath\"], \"OR Generate from a stack\").check(argv => {\n if (argv.ontologyPath || argv.stack) {\n return true;\n } else {\n throw new Error(\"Error: Must specify either ontologyPath or stack and clientId\");\n }\n });\n },\n handler: async args => {\n const command = await import(\"./handleGenerate.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 generate from \"./generate/generate.js\";\nconst site = {\n command: \"typescript\",\n describe: \"Manage code\",\n builder: argv => {\n return argv.command(generate).demandCommand();\n },\n handler: async args => {}\n};\nexport default site;","/*\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 * as fs from \"node:fs\";\nexport async function readCliVersionFromPackageJson() {\n const {\n findUp\n } = await import(\"find-up\");\n const result = await findUp(\"package.json\", {\n cwd: import.meta.url\n });\n if (!result) {\n return \"(unknown version. No package.json found)\";\n }\n const packageJson = JSON.parse(await fs.promises.readFile(result, \"utf-8\"));\n if (packageJson.version) {\n return `v${packageJson.version}`;\n } else {\n return \"(unknown version. No version in package.json found)\";\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 { readCliVersionFromPackageJson } from \"../readCliVersionFromPackageJson.js\";\nlet firstTime = true;\nexport async function logVersionMiddleware(args) {\n if (firstTime) {\n const Consola = await import(\"consola\");\n // This will be called before any command is executed\n const consola = Consola.consola;\n consola.info(`Palantir OSDK CLI ${await readCliVersionFromPackageJson()}`);\n consola.level = 3 + args.verbose; // so 1 -v is debug logs and -vv is trace\n if (consola.level > 3) {\n consola.debug(`Verbose logging enabled (${consola.level === 4 ? \"debug\" : \"trace\"})`);\n }\n\n // eslint-disable-next-line no-console\n console.log(); // Not consola. Just want a blank line\n firstTime = false;\n }\n}"]}