@osdk/cli 0.0.16 → 0.0.18
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 +18 -0
- package/build/js/chunk-2DZBTS5E.cjs +129 -0
- package/build/js/chunk-2DZBTS5E.cjs.map +1 -0
- package/build/js/chunk-CIVC2ZV3.mjs +175 -0
- package/build/js/chunk-CIVC2ZV3.mjs.map +1 -0
- package/build/js/chunk-E2SEJZTC.mjs +9 -0
- package/build/js/chunk-GTNZA5UY.mjs +11 -0
- package/build/js/chunk-GTNZA5UY.mjs.map +1 -0
- package/build/js/chunk-HQDDGVB7.cjs +11 -0
- package/build/js/chunk-HYF3CTKZ.cjs +13 -0
- package/build/js/chunk-HYF3CTKZ.cjs.map +1 -0
- package/build/js/chunk-JFDXL5SV.mjs +122 -0
- package/build/js/chunk-JFDXL5SV.mjs.map +1 -0
- package/build/js/chunk-VZM34PGO.cjs +180 -0
- package/build/js/chunk-VZM34PGO.cjs.map +1 -0
- package/build/js/handleGenerate-ER4YF43Z.mjs +89 -0
- package/build/js/handleGenerate-ER4YF43Z.mjs.map +1 -0
- package/build/js/handleGenerate-UTCLNZQO.cjs +111 -0
- package/build/js/handleGenerate-UTCLNZQO.cjs.map +1 -0
- package/build/js/handleSiteDeploy-7E5BNDQO.cjs +30 -0
- package/build/js/handleSiteDeploy-7E5BNDQO.cjs.map +1 -0
- package/build/js/handleSiteDeploy-ZFWLLEFU.mjs +28 -0
- package/build/js/handleSiteDeploy-ZFWLLEFU.mjs.map +1 -0
- package/build/js/index.cjs +290 -23
- package/build/js/index.cjs.map +1 -1
- package/build/js/index.mjs +273 -6
- package/build/js/index.mjs.map +1 -1
- package/build/js/loginFlow-BZDDHHT5.cjs +10 -0
- package/build/js/loginFlow-KGLTXVZ6.mjs +4 -0
- package/build/js/siteDeleteCommand-FIB7KBAY.mjs +13 -0
- package/build/js/siteDeleteCommand-FIB7KBAY.mjs.map +1 -0
- package/build/js/siteDeleteCommand-UGHBNEC4.cjs +15 -0
- package/build/js/siteDeleteCommand-UGHBNEC4.cjs.map +1 -0
- package/build/js/siteUploadCommand-5VEJTNOQ.mjs +33 -0
- package/build/js/siteUploadCommand-5VEJTNOQ.mjs.map +1 -0
- package/build/js/siteUploadCommand-OEM2U44I.cjs +58 -0
- package/build/js/siteUploadCommand-OEM2U44I.cjs.map +1 -0
- package/build/js/siteVersionsCommand-HP4IUW56.cjs +29 -0
- package/build/js/siteVersionsCommand-HP4IUW56.cjs.map +1 -0
- package/build/js/siteVersionsCommand-X666N6ZP.mjs +27 -0
- package/build/js/siteVersionsCommand-X666N6ZP.mjs.map +1 -0
- package/build/types/commands/typescript/generate/TypescriptGenerateArgs.d.ts +1 -0
- package/package.json +2 -2
- package/build/js/chunk-MGT3UGXW.mjs +0 -5
- package/build/js/chunk-MGT3UGXW.mjs.map +0 -1
- package/build/js/chunk-TSZWWATC.mjs +0 -12
- package/build/js/chunk-TSZWWATC.mjs.map +0 -1
- package/build/js/chunk-UOKM237I.cjs +0 -17
- package/build/js/chunk-UOKM237I.cjs.map +0 -1
- package/build/js/chunk-V4QJCMF6.cjs +0 -7
- package/build/js/chunk-V4QJCMF6.cjs.map +0 -1
- package/build/js/chunk-X6QW63OH.cjs +0 -7
- package/build/js/chunk-XIJ2ZQRX.mjs +0 -5
- package/build/js/chunk-YHQGXNMB.mjs +0 -13
- package/build/js/chunk-YHQGXNMB.mjs.map +0 -1
- package/build/js/chunk-Z6SJPM6K.cjs +0 -20
- package/build/js/chunk-Z6SJPM6K.cjs.map +0 -1
- package/build/js/handleGenerate-4RFQDCQF.mjs +0 -13
- package/build/js/handleGenerate-4RFQDCQF.mjs.map +0 -1
- package/build/js/handleGenerate-6FGD7TOT.cjs +0 -35
- package/build/js/handleGenerate-6FGD7TOT.cjs.map +0 -1
- package/build/js/handleSiteDeploy-257ZNTYA.cjs +0 -12
- package/build/js/handleSiteDeploy-257ZNTYA.cjs.map +0 -1
- package/build/js/handleSiteDeploy-QCMJWAYI.mjs +0 -10
- package/build/js/handleSiteDeploy-QCMJWAYI.mjs.map +0 -1
- package/build/js/loginFlow-JIH374QN.mjs +0 -4
- package/build/js/loginFlow-MPM6J3CY.cjs +0 -10
- package/build/js/siteDeleteCommand-NY5W7NE3.cjs +0 -12
- package/build/js/siteDeleteCommand-NY5W7NE3.cjs.map +0 -1
- package/build/js/siteDeleteCommand-ZKHKGVVF.mjs +0 -10
- package/build/js/siteDeleteCommand-ZKHKGVVF.mjs.map +0 -1
- package/build/js/siteUploadCommand-OHSOCUL6.cjs +0 -38
- package/build/js/siteUploadCommand-OHSOCUL6.cjs.map +0 -1
- package/build/js/siteUploadCommand-PZEJVKRE.mjs +0 -13
- package/build/js/siteUploadCommand-PZEJVKRE.mjs.map +0 -1
- package/build/js/siteVersionsCommand-IE5QH56U.cjs +0 -13
- package/build/js/siteVersionsCommand-IE5QH56U.cjs.map +0 -1
- package/build/js/siteVersionsCommand-NVJD5BDH.mjs +0 -11
- package/build/js/siteVersionsCommand-NVJD5BDH.mjs.map +0 -1
- /package/build/js/{chunk-X6QW63OH.cjs.map → chunk-E2SEJZTC.mjs.map} +0 -0
- /package/build/js/{chunk-XIJ2ZQRX.mjs.map → chunk-HQDDGVB7.cjs.map} +0 -0
- /package/build/js/{loginFlow-JIH374QN.mjs.map → loginFlow-BZDDHHT5.cjs.map} +0 -0
- /package/build/js/{loginFlow-MPM6J3CY.cjs.map → loginFlow-KGLTXVZ6.mjs.map} +0 -0
package/build/js/index.mjs
CHANGED
|
@@ -1,11 +1,278 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './chunk-
|
|
3
|
-
import
|
|
1
|
+
import { ExitProcessError } from './chunk-GTNZA5UY.mjs';
|
|
2
|
+
import './chunk-E2SEJZTC.mjs';
|
|
3
|
+
import yargs from 'yargs';
|
|
4
4
|
import { hideBin } from 'yargs/helpers';
|
|
5
|
-
import * as
|
|
5
|
+
import * as fs from 'fs';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/commands/auth/login/index.ts
|
|
8
|
+
var command = {
|
|
9
|
+
command: "login",
|
|
10
|
+
describe: "Authenticate with an application ID",
|
|
11
|
+
builder: (argv) => {
|
|
12
|
+
return argv.option("applicationId", {
|
|
13
|
+
type: "string",
|
|
14
|
+
demandOption: true
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
handler: async (args) => {
|
|
18
|
+
const command7 = await import('./loginFlow-KGLTXVZ6.mjs');
|
|
19
|
+
await command7.default(args);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var login_default = command;
|
|
8
23
|
|
|
9
|
-
|
|
24
|
+
// src/commands/auth/index.ts
|
|
25
|
+
var site = {
|
|
26
|
+
command: "auth",
|
|
27
|
+
describe: "Manage your session",
|
|
28
|
+
builder: (argv) => {
|
|
29
|
+
return argv.options({
|
|
30
|
+
baseUrl: {
|
|
31
|
+
type: "string",
|
|
32
|
+
demandOption: true
|
|
33
|
+
}
|
|
34
|
+
}).command(login_default).demandCommand();
|
|
35
|
+
},
|
|
36
|
+
handler: async (args) => {
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var auth_default = site;
|
|
40
|
+
|
|
41
|
+
// src/commands/site/delete/index.ts
|
|
42
|
+
var command2 = {
|
|
43
|
+
command: "delete",
|
|
44
|
+
describe: "Delete an uploaded version",
|
|
45
|
+
builder: (argv) => {
|
|
46
|
+
return argv.option("siteVersion", {
|
|
47
|
+
type: "string",
|
|
48
|
+
demandOption: true
|
|
49
|
+
}).option("dir", {
|
|
50
|
+
type: "string"
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
handler: async (args) => {
|
|
54
|
+
const command7 = await import('./siteDeleteCommand-FIB7KBAY.mjs');
|
|
55
|
+
await command7.default(args);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
var delete_default = command2;
|
|
59
|
+
|
|
60
|
+
// src/commands/site/deploy/index.ts
|
|
61
|
+
var command3 = {
|
|
62
|
+
command: "deploy",
|
|
63
|
+
describe: "Deploy an uploaded version",
|
|
64
|
+
builder: (argv) => {
|
|
65
|
+
return argv.options({
|
|
66
|
+
"siteVersion": {
|
|
67
|
+
type: "string",
|
|
68
|
+
conflicts: "clearVersion"
|
|
69
|
+
// group: "Deploy Version",
|
|
70
|
+
// implies: { "clearVersion": "false" },
|
|
71
|
+
},
|
|
72
|
+
undeploy: {
|
|
73
|
+
alias: "clearVersion",
|
|
74
|
+
description: "Causes the site to no longer be deployed",
|
|
75
|
+
type: "boolean",
|
|
76
|
+
conflicts: "siteVersion"
|
|
77
|
+
// group: "Deploy Version",
|
|
78
|
+
// implies: { "siteVersion": "" },
|
|
79
|
+
}
|
|
80
|
+
}).group(["siteVersion", "clearVersion"], "Version To Deploy (requires one of)");
|
|
81
|
+
},
|
|
82
|
+
handler: async (args) => {
|
|
83
|
+
const command7 = await import('./handleSiteDeploy-ZFWLLEFU.mjs');
|
|
84
|
+
await command7.default(args);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var deploy_default = command3;
|
|
88
|
+
|
|
89
|
+
// src/commands/site/upload/index.ts
|
|
90
|
+
var command4 = {
|
|
91
|
+
command: "upload",
|
|
92
|
+
describe: "Upload an application version",
|
|
93
|
+
builder: (argv) => {
|
|
94
|
+
return argv.option("siteVersion", {
|
|
95
|
+
type: "string",
|
|
96
|
+
demandOption: true
|
|
97
|
+
}).option("dir", {
|
|
98
|
+
type: "string"
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
handler: async (args) => {
|
|
102
|
+
const command7 = await import('./siteUploadCommand-5VEJTNOQ.mjs');
|
|
103
|
+
await command7.default(args);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
var upload_default = command4;
|
|
107
|
+
|
|
108
|
+
// src/commands/site/versions/index.ts
|
|
109
|
+
var command5 = {
|
|
110
|
+
command: "versions",
|
|
111
|
+
describe: "List application versions",
|
|
112
|
+
builder: (argv) => {
|
|
113
|
+
return argv;
|
|
114
|
+
},
|
|
115
|
+
handler: async (args) => {
|
|
116
|
+
const command7 = await import('./siteVersionsCommand-X666N6ZP.mjs');
|
|
117
|
+
await command7.default(args);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
var versions_default = command5;
|
|
121
|
+
|
|
122
|
+
// src/commands/site/index.ts
|
|
123
|
+
var site2 = {
|
|
124
|
+
command: "site",
|
|
125
|
+
describe: "Manage your site",
|
|
126
|
+
builder: (argv) => {
|
|
127
|
+
return argv.options({
|
|
128
|
+
appRid: {
|
|
129
|
+
type: "string",
|
|
130
|
+
demandOption: true,
|
|
131
|
+
coerce: (a) => a
|
|
132
|
+
},
|
|
133
|
+
baseUrl: {
|
|
134
|
+
type: "string",
|
|
135
|
+
demandOption: true
|
|
136
|
+
}
|
|
137
|
+
}).group(["appRid", "baseUrl"], "Common Arguments").command(versions_default).command(upload_default).command(delete_default).command(deploy_default).demandCommand();
|
|
138
|
+
},
|
|
139
|
+
handler: async (args) => {
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
var site_default = site2;
|
|
143
|
+
|
|
144
|
+
// src/commands/typescript/generate/generate.ts
|
|
145
|
+
var command6 = {
|
|
146
|
+
command: "generate",
|
|
147
|
+
describe: "Generate typescript from ontology",
|
|
148
|
+
builder: (argv) => {
|
|
149
|
+
return argv.options({
|
|
150
|
+
"outDir": {
|
|
151
|
+
type: "string",
|
|
152
|
+
description: "Where to place the generated files",
|
|
153
|
+
demandOption: true
|
|
154
|
+
},
|
|
155
|
+
ontologyPath: {
|
|
156
|
+
description: "path to the ontology wire json",
|
|
157
|
+
type: "string",
|
|
158
|
+
demandOption: false,
|
|
159
|
+
conflicts: ["stack", "clientId"]
|
|
160
|
+
},
|
|
161
|
+
stack: {
|
|
162
|
+
description: "the URL to the stack that contains the ontology",
|
|
163
|
+
type: "string",
|
|
164
|
+
demandOption: false,
|
|
165
|
+
conflicts: "ontologyPath",
|
|
166
|
+
implies: "clientId"
|
|
167
|
+
},
|
|
168
|
+
clientId: {
|
|
169
|
+
description: "the application's client id",
|
|
170
|
+
type: "string",
|
|
171
|
+
demandOption: false,
|
|
172
|
+
conflicts: "ontologyPath",
|
|
173
|
+
implies: "stack"
|
|
174
|
+
},
|
|
175
|
+
ontologyWritePath: {
|
|
176
|
+
description: "path to write the ontology wire json",
|
|
177
|
+
type: "string",
|
|
178
|
+
demandOption: false,
|
|
179
|
+
conflicts: ["ontologyPath"]
|
|
180
|
+
},
|
|
181
|
+
beta: {
|
|
182
|
+
type: "boolean",
|
|
183
|
+
description: "Should generate beta sdk",
|
|
184
|
+
demandOption: false
|
|
185
|
+
},
|
|
186
|
+
packageType: {
|
|
187
|
+
default: "commonjs",
|
|
188
|
+
choices: ["commonjs", "module"]
|
|
189
|
+
}
|
|
190
|
+
}).group(["ontologyPath", "outDir"], "Generate from a local file").group(["stack", "clientId", "outDir", "ontologyWritePath"], "OR Generate from a stack").check((argv2) => {
|
|
191
|
+
if (argv2.ontologyPath || argv2.stack) {
|
|
192
|
+
return true;
|
|
193
|
+
} else {
|
|
194
|
+
throw new Error("Error: Must specify either ontologyPath or stack and clientId");
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
handler: async (args) => {
|
|
199
|
+
const command7 = await import('./handleGenerate-ER4YF43Z.mjs');
|
|
200
|
+
await command7.default(args);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
var generate_default = command6;
|
|
204
|
+
|
|
205
|
+
// src/commands/typescript/index.ts
|
|
206
|
+
var site3 = {
|
|
207
|
+
command: "typescript",
|
|
208
|
+
describe: "Manage code",
|
|
209
|
+
builder: (argv) => {
|
|
210
|
+
return argv.command(generate_default).demandCommand();
|
|
211
|
+
},
|
|
212
|
+
handler: async (args) => {
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
var typescript_default = site3;
|
|
216
|
+
async function readCliVersionFromPackageJson() {
|
|
217
|
+
const {
|
|
218
|
+
findUp
|
|
219
|
+
} = await import('find-up');
|
|
220
|
+
const result = await findUp("package.json", {
|
|
221
|
+
cwd: import.meta.url
|
|
222
|
+
});
|
|
223
|
+
if (!result) {
|
|
224
|
+
return "(unknown version. No package.json found)";
|
|
225
|
+
}
|
|
226
|
+
const packageJson = JSON.parse(await fs.promises.readFile(result, "utf-8"));
|
|
227
|
+
if (packageJson.version) {
|
|
228
|
+
return `v${packageJson.version}`;
|
|
229
|
+
} else {
|
|
230
|
+
return "(unknown version. No version in package.json found)";
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// src/yargs/logVersionMiddleware.ts
|
|
235
|
+
var firstTime = true;
|
|
236
|
+
async function logVersionMiddleware(args) {
|
|
237
|
+
if (firstTime) {
|
|
238
|
+
const Consola = await import('consola');
|
|
239
|
+
const consola = Consola.consola;
|
|
240
|
+
consola.info(`Palantir OSDK CLI ${await readCliVersionFromPackageJson()}`);
|
|
241
|
+
consola.level = 3 + args.verbose;
|
|
242
|
+
if (consola.level > 3) {
|
|
243
|
+
consola.debug(`Verbose logging enabled (${consola.level === 4 ? "debug" : "trace"})`);
|
|
244
|
+
}
|
|
245
|
+
console.log();
|
|
246
|
+
firstTime = false;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// src/cli.ts
|
|
251
|
+
async function cli(args = process.argv) {
|
|
252
|
+
const base = yargs(hideBin(args)).env("OSDK").version(false).option("verbose", {
|
|
253
|
+
alias: "v",
|
|
254
|
+
type: "boolean",
|
|
255
|
+
description: "Enable verbose logging",
|
|
256
|
+
count: true
|
|
257
|
+
}).demandCommand().middleware(logVersionMiddleware, true).strict().command({
|
|
258
|
+
command: "unstable",
|
|
259
|
+
aliases: ["experimental"],
|
|
260
|
+
builder: async (argv) => {
|
|
261
|
+
return argv.command(site_default).command(typescript_default).command(auth_default).demandCommand();
|
|
262
|
+
},
|
|
263
|
+
handler: (_args) => {
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
try {
|
|
267
|
+
return base.parseAsync();
|
|
268
|
+
} catch (e) {
|
|
269
|
+
if (e instanceof ExitProcessError) {
|
|
270
|
+
const Consola = await import('consola');
|
|
271
|
+
Consola.consola.error(e.message);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export { cli };
|
|
10
277
|
//# sourceMappingURL=out.js.map
|
|
11
278
|
//# sourceMappingURL=index.mjs.map
|
package/build/js/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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":["yargs","hideBin","command","argv","args","login_default","site","auth_default","delete_default","deploy_default","upload_default","versions_default","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,QACT,SAAU,sCACV,QAASC,GACAA,EAAK,OAAO,gBAAiB,CAClC,KAAM,SACN,aAAc,EAChB,CAAC,EAEH,QAAS,MAAMC,GAAQ,CAErB,MADgB,KAAM,QAAO,0BAAgB,GAC/B,QAAQA,CAAI,CAC5B,CACF,EACOC,EAAQH,ECbf,IAAMI,EAAO,CACX,QAAS,OACT,SAAU,sBACV,QAASH,GACAA,EAAK,QAAQ,CAClB,QAAS,CACP,KAAM,SACN,aAAc,EAChB,CACF,CAAC,EAAE,QAAQE,CAAK,EAAE,cAAc,EAElC,QAAS,MAAMD,GAAQ,CAAC,CAC1B,EACOG,EAAQD,ECd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B,CAAC,EACD,GAAI,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,EAAqBlB,EAAM,CAC/C,GAAIiB,EAAW,CAGb,IAAME,GAFU,KAAM,QAAO,SAAS,GAEd,QACxBA,EAAQ,KAAK,qBAAqB,MAAMN,EAA8B,CAAC,EAAE,EACzEM,EAAQ,MAAQ,EAAInB,EAAK,QACrBmB,EAAQ,MAAQ,GAClBA,EAAQ,MAAM,4BAA4BA,EAAQ,QAAU,EAAI,QAAU,OAAO,GAAG,EAItF,QAAQ,IAAI,EACZF,EAAY,EACd,CACF,CXVA,eAAsBG,EAAIpB,EAAO,QAAQ,KAAM,CAC7C,IAAMqB,EAAOzB,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,WAAWkB,EAAsB,EAAI,EAAE,OAAO,EAAE,QAAQ,CACzE,QAAS,WACT,QAAS,CAAC,cAAc,EACxB,QAAS,MAAMnB,GACNA,EAAK,QAAQU,CAAI,EAAE,QAAQE,CAAU,EAAE,QAAQR,CAAI,EAAE,cAAc,EAE5E,QAASmB,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 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 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\"], \"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}"]}
|
|
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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A4B,QAAQ,UAAU,IAAI,UAAU,OAAO,GAAG;AAAA,IACtF;AAGA,YAAQ,IAAI;AACZ,gBAAY;AAAA,EACd;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}"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { artifacts_exports } from './chunk-CIVC2ZV3.mjs';
|
|
2
|
+
import './chunk-GTNZA5UY.mjs';
|
|
3
|
+
import './chunk-E2SEJZTC.mjs';
|
|
4
|
+
import { consola } from 'consola';
|
|
5
|
+
|
|
6
|
+
async function siteDeleteCommand(args) {
|
|
7
|
+
await artifacts_exports.SiteAssetArtifactsService.deleteSiteVersion(args.baseUrl, args.appRid, args.siteVersion);
|
|
8
|
+
consola.success("Delete successful");
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { siteDeleteCommand as default };
|
|
12
|
+
//# sourceMappingURL=out.js.map
|
|
13
|
+
//# sourceMappingURL=siteDeleteCommand-FIB7KBAY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/delete/siteDeleteCommand.mts"],"names":[],"mappings":";;;;;;;AAgBA,SAAS,eAAe;AAExB,eAAO,kBAAyC,MAAM;AACpD,QAAM,kBAAU,0BAA0B,kBAAkB,KAAK,SAAS,KAAK,QAAQ,KAAK,WAAW;AACvG,UAAQ,QAAQ,mBAAmB;AACrC","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 { consola } from \"consola\";\nimport { artifacts } from \"../../../net/index.mjs\";\nexport default async function siteDeleteCommand(args) {\n await artifacts.SiteAssetArtifactsService.deleteSiteVersion(args.baseUrl, args.appRid, args.siteVersion);\n consola.success(\"Delete successful\");\n}"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkVZM34PGO_cjs = require('./chunk-VZM34PGO.cjs');
|
|
4
|
+
require('./chunk-HYF3CTKZ.cjs');
|
|
5
|
+
require('./chunk-HQDDGVB7.cjs');
|
|
6
|
+
var consola = require('consola');
|
|
7
|
+
|
|
8
|
+
async function siteDeleteCommand(args) {
|
|
9
|
+
await chunkVZM34PGO_cjs.artifacts_exports.SiteAssetArtifactsService.deleteSiteVersion(args.baseUrl, args.appRid, args.siteVersion);
|
|
10
|
+
consola.consola.success("Delete successful");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
module.exports = siteDeleteCommand;
|
|
14
|
+
//# sourceMappingURL=out.js.map
|
|
15
|
+
//# sourceMappingURL=siteDeleteCommand-UGHBNEC4.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/delete/siteDeleteCommand.mts"],"names":[],"mappings":";;;;;;;AAgBA,SAAS,eAAe;AAExB,eAAO,kBAAyC,MAAM;AACpD,QAAM,kBAAU,0BAA0B,kBAAkB,KAAK,SAAS,KAAK,QAAQ,KAAK,WAAW;AACvG,UAAQ,QAAQ,mBAAmB;AACrC","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 { consola } from \"consola\";\nimport { artifacts } from \"../../../net/index.mjs\";\nexport default async function siteDeleteCommand(args) {\n await artifacts.SiteAssetArtifactsService.deleteSiteVersion(args.baseUrl, args.appRid, args.siteVersion);\n consola.success(\"Delete successful\");\n}"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { artifacts_exports } from './chunk-CIVC2ZV3.mjs';
|
|
2
|
+
import { ExitProcessError } from './chunk-GTNZA5UY.mjs';
|
|
3
|
+
import './chunk-E2SEJZTC.mjs';
|
|
4
|
+
import archiver from 'archiver';
|
|
5
|
+
import { consola } from 'consola';
|
|
6
|
+
import * as fs from 'fs';
|
|
7
|
+
import { Readable } from 'stream';
|
|
8
|
+
|
|
9
|
+
async function invokeSiteUpload(args) {
|
|
10
|
+
if (args.dir == null) {
|
|
11
|
+
consola.error("No directory specified");
|
|
12
|
+
throw new ExitProcessError(1);
|
|
13
|
+
}
|
|
14
|
+
const stat = await fs.promises.stat(args.dir);
|
|
15
|
+
if (!stat.isDirectory()) {
|
|
16
|
+
consola.error("Specified path is not a directory");
|
|
17
|
+
throw new ExitProcessError(2);
|
|
18
|
+
}
|
|
19
|
+
consola.start("Zippping site files");
|
|
20
|
+
const archive = archiver("zip").directory(args.dir, false);
|
|
21
|
+
await Promise.all([artifacts_exports.SiteAssetArtifactsService.uploadZippedSiteAsset(
|
|
22
|
+
args.baseUrl,
|
|
23
|
+
args.appRid,
|
|
24
|
+
args.siteVersion,
|
|
25
|
+
Readable.toWeb(archive)
|
|
26
|
+
// This cast is because the dom fetch doesnt align type wise with streams
|
|
27
|
+
), archive.finalize()]);
|
|
28
|
+
consola.success("Upload complete");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { invokeSiteUpload as default };
|
|
32
|
+
//# sourceMappingURL=out.js.map
|
|
33
|
+
//# sourceMappingURL=siteUploadCommand-5VEJTNOQ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/upload/siteUploadCommand.mts"],"names":[],"mappings":";;;;;;;;;AAgBA,OAAO,cAAc;AACrB,SAAS,eAAe;AACxB,YAAY,QAAQ;AACpB,SAAS,gBAAgB;AAGzB,eAAO,iBAAwC,MAAM;AACnD,MAAI,KAAK,OAAO,MAAM;AACpB,YAAQ,MAAM,wBAAwB;AACtC,UAAM,IAAI,iBAAiB,CAAC;AAAA,EAC9B;AACA,QAAM,OAAO,MAAS,YAAS,KAAK,KAAK,GAAG;AAC5C,MAAI,CAAC,KAAK,YAAY,GAAG;AACvB,YAAQ,MAAM,mCAAmC;AACjD,UAAM,IAAI,iBAAiB,CAAC;AAAA,EAC9B;AACA,UAAQ,MAAM,qBAAqB;AACnC,QAAM,UAAU,SAAS,KAAK,EAAE,UAAU,KAAK,KAAK,KAAK;AACzD,QAAM,QAAQ,IAAI,CAAC,kBAAU,0BAA0B;AAAA,IAAsB,KAAK;AAAA,IAAS,KAAK;AAAA,IAAQ,KAAK;AAAA,IAAa,SAAS,MAAM,OAAO;AAAA;AAAA,EAChJ,GAAG,QAAQ,SAAS,CAAC,CAAC;AACtB,UAAQ,QAAQ,iBAAiB;AACnC","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 archiver from \"archiver\";\nimport { consola } from \"consola\";\nimport * as fs from \"node:fs\";\nimport { Readable } from \"node:stream\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { artifacts } from \"../../../net/index.mjs\";\nexport default async function invokeSiteUpload(args) {\n if (args.dir == null) {\n consola.error(\"No directory specified\");\n throw new ExitProcessError(1);\n }\n const stat = await fs.promises.stat(args.dir);\n if (!stat.isDirectory()) {\n consola.error(\"Specified path is not a directory\");\n throw new ExitProcessError(2);\n }\n consola.start(\"Zippping site files\");\n const archive = archiver(\"zip\").directory(args.dir, false);\n await Promise.all([artifacts.SiteAssetArtifactsService.uploadZippedSiteAsset(args.baseUrl, args.appRid, args.siteVersion, Readable.toWeb(archive) // This cast is because the dom fetch doesnt align type wise with streams\n ), archive.finalize()]);\n consola.success(\"Upload complete\");\n}"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkVZM34PGO_cjs = require('./chunk-VZM34PGO.cjs');
|
|
4
|
+
var chunkHYF3CTKZ_cjs = require('./chunk-HYF3CTKZ.cjs');
|
|
5
|
+
require('./chunk-HQDDGVB7.cjs');
|
|
6
|
+
var archiver = require('archiver');
|
|
7
|
+
var consola = require('consola');
|
|
8
|
+
var fs = require('fs');
|
|
9
|
+
var stream = require('stream');
|
|
10
|
+
|
|
11
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
function _interopNamespace(e) {
|
|
14
|
+
if (e && e.__esModule) return e;
|
|
15
|
+
var n = Object.create(null);
|
|
16
|
+
if (e) {
|
|
17
|
+
Object.keys(e).forEach(function (k) {
|
|
18
|
+
if (k !== 'default') {
|
|
19
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return e[k]; }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
n.default = e;
|
|
28
|
+
return Object.freeze(n);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var archiver__default = /*#__PURE__*/_interopDefault(archiver);
|
|
32
|
+
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
33
|
+
|
|
34
|
+
async function invokeSiteUpload(args) {
|
|
35
|
+
if (args.dir == null) {
|
|
36
|
+
consola.consola.error("No directory specified");
|
|
37
|
+
throw new chunkHYF3CTKZ_cjs.ExitProcessError(1);
|
|
38
|
+
}
|
|
39
|
+
const stat = await fs__namespace.promises.stat(args.dir);
|
|
40
|
+
if (!stat.isDirectory()) {
|
|
41
|
+
consola.consola.error("Specified path is not a directory");
|
|
42
|
+
throw new chunkHYF3CTKZ_cjs.ExitProcessError(2);
|
|
43
|
+
}
|
|
44
|
+
consola.consola.start("Zippping site files");
|
|
45
|
+
const archive = archiver__default.default("zip").directory(args.dir, false);
|
|
46
|
+
await Promise.all([chunkVZM34PGO_cjs.artifacts_exports.SiteAssetArtifactsService.uploadZippedSiteAsset(
|
|
47
|
+
args.baseUrl,
|
|
48
|
+
args.appRid,
|
|
49
|
+
args.siteVersion,
|
|
50
|
+
stream.Readable.toWeb(archive)
|
|
51
|
+
// This cast is because the dom fetch doesnt align type wise with streams
|
|
52
|
+
), archive.finalize()]);
|
|
53
|
+
consola.consola.success("Upload complete");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
module.exports = invokeSiteUpload;
|
|
57
|
+
//# sourceMappingURL=out.js.map
|
|
58
|
+
//# sourceMappingURL=siteUploadCommand-OEM2U44I.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/upload/siteUploadCommand.mts"],"names":[],"mappings":";;;;;;;;;AAgBA,OAAO,cAAc;AACrB,SAAS,eAAe;AACxB,YAAY,QAAQ;AACpB,SAAS,gBAAgB;AAGzB,eAAO,iBAAwC,MAAM;AACnD,MAAI,KAAK,OAAO,MAAM;AACpB,YAAQ,MAAM,wBAAwB;AACtC,UAAM,IAAI,iBAAiB,CAAC;AAAA,EAC9B;AACA,QAAM,OAAO,MAAS,YAAS,KAAK,KAAK,GAAG;AAC5C,MAAI,CAAC,KAAK,YAAY,GAAG;AACvB,YAAQ,MAAM,mCAAmC;AACjD,UAAM,IAAI,iBAAiB,CAAC;AAAA,EAC9B;AACA,UAAQ,MAAM,qBAAqB;AACnC,QAAM,UAAU,SAAS,KAAK,EAAE,UAAU,KAAK,KAAK,KAAK;AACzD,QAAM,QAAQ,IAAI,CAAC,kBAAU,0BAA0B;AAAA,IAAsB,KAAK;AAAA,IAAS,KAAK;AAAA,IAAQ,KAAK;AAAA,IAAa,SAAS,MAAM,OAAO;AAAA;AAAA,EAChJ,GAAG,QAAQ,SAAS,CAAC,CAAC;AACtB,UAAQ,QAAQ,iBAAiB;AACnC","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 archiver from \"archiver\";\nimport { consola } from \"consola\";\nimport * as fs from \"node:fs\";\nimport { Readable } from \"node:stream\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { artifacts } from \"../../../net/index.mjs\";\nexport default async function invokeSiteUpload(args) {\n if (args.dir == null) {\n consola.error(\"No directory specified\");\n throw new ExitProcessError(1);\n }\n const stat = await fs.promises.stat(args.dir);\n if (!stat.isDirectory()) {\n consola.error(\"Specified path is not a directory\");\n throw new ExitProcessError(2);\n }\n consola.start(\"Zippping site files\");\n const archive = archiver(\"zip\").directory(args.dir, false);\n await Promise.all([artifacts.SiteAssetArtifactsService.uploadZippedSiteAsset(args.baseUrl, args.appRid, args.siteVersion, Readable.toWeb(archive) // This cast is because the dom fetch doesnt align type wise with streams\n ), archive.finalize()]);\n consola.success(\"Upload complete\");\n}"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkVZM34PGO_cjs = require('./chunk-VZM34PGO.cjs');
|
|
4
|
+
require('./chunk-HYF3CTKZ.cjs');
|
|
5
|
+
require('./chunk-HQDDGVB7.cjs');
|
|
6
|
+
var consola = require('consola');
|
|
7
|
+
var utils = require('consola/utils');
|
|
8
|
+
|
|
9
|
+
async function siteVersionsCommand({
|
|
10
|
+
baseUrl,
|
|
11
|
+
appRid
|
|
12
|
+
}) {
|
|
13
|
+
consola.consola.start("Fetching versions & deployed version");
|
|
14
|
+
const repositoryRid = await chunkVZM34PGO_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(baseUrl, appRid);
|
|
15
|
+
const ctx = chunkVZM34PGO_cjs.createConjureContext(baseUrl, "/artifacts/api");
|
|
16
|
+
const [versions, deployedVersion] = await Promise.all([chunkVZM34PGO_cjs.artifacts_exports.SiteAssetArtifactsService.fetchSiteVersions(baseUrl, appRid), chunkVZM34PGO_cjs.ArtifactsSitesAdminV2Service_exports.getDeployedVersion(ctx, repositoryRid)]);
|
|
17
|
+
if (versions.length == 0) {
|
|
18
|
+
consola.consola.warn("Successfully connected to server, but no versions were found.");
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
consola.consola.success("Found versions:");
|
|
22
|
+
for (const version of versions) {
|
|
23
|
+
consola.consola.log(` - ${version}${deployedVersion && version === deployedVersion.version ? utils.colorize("green", ` (deployed)`) : ""}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
module.exports = siteVersionsCommand;
|
|
28
|
+
//# sourceMappingURL=out.js.map
|
|
29
|
+
//# sourceMappingURL=siteVersionsCommand-HP4IUW56.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/versions/siteVersionsCommand.mts"],"names":[],"mappings":";;;;;;;;;;AAiBA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AACzB,eAAO,oBAA2C;AAAA,EAChD;AAAA,EACA;AACF,GAAG;AACD,UAAQ,MAAM,sCAAsC;AACpD,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,SAAS,MAAM;AAClG,QAAM,MAAM,qBAAqB,SAAS,gBAAgB;AAC1D,QAAM,CAAC,UAAU,eAAe,IAAI,MAAM,QAAQ,IAAI,CAAC,kBAAU,0BAA0B,kBAAkB,SAAS,MAAM,GAAG,qCAA6B,mBAAmB,KAAK,aAAa,CAAC,CAAC;AACnM,MAAI,SAAS,UAAU,GAAG;AACxB,YAAQ,KAAK,+DAA+D;AAC5E;AAAA,EACF;AACA,UAAQ,QAAQ,iBAAiB;AACjC,aAAW,WAAW,UAAU;AAC9B,YAAQ,IAAI,SAAS,OAAO,GAAG,mBAAmB,YAAY,gBAAgB,UAAU,SAAS,SAAS,aAAa,IAAI,EAAE,EAAE;AAAA,EACjI;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 { artifacts, ArtifactsSitesAdminV2Service, createConjureContext, thirdPartyApplicationService } from \"#net\";\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nexport default async function siteVersionsCommand({\n baseUrl,\n appRid\n}) {\n consola.start(\"Fetching versions & deployed version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(baseUrl, appRid);\n const ctx = createConjureContext(baseUrl, \"/artifacts/api\");\n const [versions, deployedVersion] = await Promise.all([artifacts.SiteAssetArtifactsService.fetchSiteVersions(baseUrl, appRid), ArtifactsSitesAdminV2Service.getDeployedVersion(ctx, repositoryRid)]);\n if (versions.length == 0) {\n consola.warn(\"Successfully connected to server, but no versions were found.\");\n return;\n }\n consola.success(\"Found versions:\");\n for (const version of versions) {\n consola.log(` - ${version}${deployedVersion && version === deployedVersion.version ? colorize(\"green\", ` (deployed)`) : \"\"}`);\n }\n}"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { third_party_application_service_exports, createConjureContext, artifacts_exports, ArtifactsSitesAdminV2Service_exports } from './chunk-CIVC2ZV3.mjs';
|
|
2
|
+
import './chunk-GTNZA5UY.mjs';
|
|
3
|
+
import './chunk-E2SEJZTC.mjs';
|
|
4
|
+
import { consola } from 'consola';
|
|
5
|
+
import { colorize } from 'consola/utils';
|
|
6
|
+
|
|
7
|
+
async function siteVersionsCommand({
|
|
8
|
+
baseUrl,
|
|
9
|
+
appRid
|
|
10
|
+
}) {
|
|
11
|
+
consola.start("Fetching versions & deployed version");
|
|
12
|
+
const repositoryRid = await third_party_application_service_exports.fetchWebsiteRepositoryRid(baseUrl, appRid);
|
|
13
|
+
const ctx = createConjureContext(baseUrl, "/artifacts/api");
|
|
14
|
+
const [versions, deployedVersion] = await Promise.all([artifacts_exports.SiteAssetArtifactsService.fetchSiteVersions(baseUrl, appRid), ArtifactsSitesAdminV2Service_exports.getDeployedVersion(ctx, repositoryRid)]);
|
|
15
|
+
if (versions.length == 0) {
|
|
16
|
+
consola.warn("Successfully connected to server, but no versions were found.");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
consola.success("Found versions:");
|
|
20
|
+
for (const version of versions) {
|
|
21
|
+
consola.log(` - ${version}${deployedVersion && version === deployedVersion.version ? colorize("green", ` (deployed)`) : ""}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { siteVersionsCommand as default };
|
|
26
|
+
//# sourceMappingURL=out.js.map
|
|
27
|
+
//# sourceMappingURL=siteVersionsCommand-X666N6ZP.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/versions/siteVersionsCommand.mts"],"names":[],"mappings":";;;;;;;;;;AAiBA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AACzB,eAAO,oBAA2C;AAAA,EAChD;AAAA,EACA;AACF,GAAG;AACD,UAAQ,MAAM,sCAAsC;AACpD,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,SAAS,MAAM;AAClG,QAAM,MAAM,qBAAqB,SAAS,gBAAgB;AAC1D,QAAM,CAAC,UAAU,eAAe,IAAI,MAAM,QAAQ,IAAI,CAAC,kBAAU,0BAA0B,kBAAkB,SAAS,MAAM,GAAG,qCAA6B,mBAAmB,KAAK,aAAa,CAAC,CAAC;AACnM,MAAI,SAAS,UAAU,GAAG;AACxB,YAAQ,KAAK,+DAA+D;AAC5E;AAAA,EACF;AACA,UAAQ,QAAQ,iBAAiB;AACjC,aAAW,WAAW,UAAU;AAC9B,YAAQ,IAAI,SAAS,OAAO,GAAG,mBAAmB,YAAY,gBAAgB,UAAU,SAAS,SAAS,aAAa,IAAI,EAAE,EAAE;AAAA,EACjI;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 { artifacts, ArtifactsSitesAdminV2Service, createConjureContext, thirdPartyApplicationService } from \"#net\";\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nexport default async function siteVersionsCommand({\n baseUrl,\n appRid\n}) {\n consola.start(\"Fetching versions & deployed version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(baseUrl, appRid);\n const ctx = createConjureContext(baseUrl, \"/artifacts/api\");\n const [versions, deployedVersion] = await Promise.all([artifacts.SiteAssetArtifactsService.fetchSiteVersions(baseUrl, appRid), ArtifactsSitesAdminV2Service.getDeployedVersion(ctx, repositoryRid)]);\n if (versions.length == 0) {\n consola.warn(\"Successfully connected to server, but no versions were found.\");\n return;\n }\n consola.success(\"Found versions:\");\n for (const version of versions) {\n consola.log(` - ${version}${deployedVersion && version === deployedVersion.version ? colorize(\"green\", ` (deployed)`) : \"\"}`);\n }\n}"]}
|