@osdk/cli 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/js/chunk-DQYIDDJN.cjs +17 -0
- package/build/js/chunk-DQYIDDJN.cjs.map +1 -0
- package/build/js/chunk-IV3QY3PZ.mjs +15 -0
- package/build/js/chunk-IV3QY3PZ.mjs.map +1 -0
- package/build/js/{handleGenerate-A7X2XAGW.mjs → handleGenerate-7QGFIWKO.mjs} +2 -2
- package/build/js/{handleGenerate-WOW33WYG.cjs → handleGenerate-FHM4MFPH.cjs} +2 -2
- package/build/js/index.cjs +72 -85
- package/build/js/index.cjs.map +1 -1
- package/build/js/index.mjs +67 -80
- package/build/js/index.mjs.map +1 -1
- package/build/js/{siteDeployCommand-HSR3QDAT.mjs → siteDeployCommand-4S2UQKJP.mjs} +60 -9
- package/build/js/siteDeployCommand-4S2UQKJP.mjs.map +1 -0
- package/build/js/{siteDeployCommand-MXKGJFFB.cjs → siteDeployCommand-QKPJEL4X.cjs} +60 -8
- package/build/js/siteDeployCommand-QKPJEL4X.cjs.map +1 -0
- package/build/js/{versionDeleteCommand-6BJL5XLG.mjs → versionDeleteCommand-DGB5NTFM.mjs} +11 -1
- package/build/js/versionDeleteCommand-DGB5NTFM.mjs.map +1 -0
- package/build/js/{versionDeleteCommand-RLU7UUYD.cjs → versionDeleteCommand-S7AXTY46.cjs} +11 -1
- package/build/js/versionDeleteCommand-S7AXTY46.cjs.map +1 -0
- package/build/js/{versionUnsetCommand-IJT4JWBN.mjs → versionUnsetCommand-ISMMMWWZ.mjs} +11 -1
- package/build/js/versionUnsetCommand-ISMMMWWZ.mjs.map +1 -0
- package/build/js/{versionUnsetCommand-XYBUQ6XB.cjs → versionUnsetCommand-V3ZVCGSI.cjs} +11 -1
- package/build/js/versionUnsetCommand-V3ZVCGSI.cjs.map +1 -0
- package/build/types/commands/site/deploy/logDeployCommandConfigFileOverride.d.ts +1 -1
- package/build/types/commands/site/logSiteCommandConfigFileOverride.d.ts +1 -1
- package/build/types/commands/site/version/delete/VersionDeleteArgs.d.ts +5 -0
- package/build/types/commands/site/version/delete/index.d.ts +2 -2
- package/build/types/commands/site/version/delete/versionDeleteCommand.d.mts +2 -2
- package/build/types/commands/site/version/get/VersionGetArgs.d.ts +3 -0
- package/build/types/commands/site/version/get/index.d.ts +2 -1
- package/build/types/commands/site/version/get/versionGetCommand.d.mts +2 -2
- package/build/types/commands/site/version/list/VersionListArgs.d.ts +3 -0
- package/build/types/commands/site/version/list/index.d.ts +2 -1
- package/build/types/commands/site/version/list/versionListCommand.d.mts +2 -2
- package/build/types/commands/site/version/set/VersionSetArgs.d.ts +4 -0
- package/build/types/commands/site/version/set/index.d.ts +2 -2
- package/build/types/commands/site/version/set/versionSetCommand.d.mts +2 -2
- package/build/types/commands/site/version/unset/VersionUnsetArgs.d.ts +4 -0
- package/build/types/commands/site/version/unset/index.d.ts +2 -1
- package/build/types/commands/site/version/unset/versionUnsetCommand.d.mts +2 -2
- package/build/types/consola/handlePromptCancel.d.ts +1 -0
- package/build/types/net/index.d.mts +1 -0
- package/changelog/0.5.0/pr-47.v2.yml +5 -0
- package/changelog/0.5.0/pr-49.v2.yml +5 -0
- package/changelog/0.5.0/pr-51.v2.yml +5 -0
- package/changelog/0.6.0/pr-54.v2.yml +5 -0
- package/changelog/0.6.0/pr-56.v2.yml +5 -0
- package/changelog/0.6.0/pr-58.v2.yml +5 -0
- package/package.json +3 -3
- package/build/js/siteDeployCommand-HSR3QDAT.mjs.map +0 -1
- package/build/js/siteDeployCommand-MXKGJFFB.cjs.map +0 -1
- package/build/js/versionDeleteCommand-6BJL5XLG.mjs.map +0 -1
- package/build/js/versionDeleteCommand-RLU7UUYD.cjs.map +0 -1
- package/build/js/versionUnsetCommand-IJT4JWBN.mjs.map +0 -1
- package/build/js/versionUnsetCommand-XYBUQ6XB.cjs.map +0 -1
- package/build/types/commands/site/version/SiteVersionArgs.d.ts +0 -4
- /package/build/js/{handleGenerate-A7X2XAGW.mjs.map → handleGenerate-7QGFIWKO.mjs.map} +0 -0
- /package/build/js/{handleGenerate-WOW33WYG.cjs.map → handleGenerate-FHM4MFPH.cjs.map} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var consola = require('consola');
|
|
4
|
+
|
|
5
|
+
// src/consola/handlePromptCancel.ts
|
|
6
|
+
function handlePromptCancel(promptResponse) {
|
|
7
|
+
const isFalse = typeof promptResponse === "boolean" && !promptResponse;
|
|
8
|
+
const isSigInt = typeof promptResponse === "symbol" && promptResponse.toString() === "Symbol(clack:cancel)";
|
|
9
|
+
if (isSigInt || isFalse) {
|
|
10
|
+
consola.consola.fail("Operation cancelled");
|
|
11
|
+
process.exit(0);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.handlePromptCancel = handlePromptCancel;
|
|
16
|
+
//# sourceMappingURL=out.js.map
|
|
17
|
+
//# sourceMappingURL=chunk-DQYIDDJN.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/consola/handlePromptCancel.ts"],"names":[],"mappings":";AAgBA,SAAS,eAAe;AACjB,SAAS,mBAAmB,gBAAgB;AACjD,QAAM,UAAU,OAAO,mBAAmB,aAAa,CAAC;AAExD,QAAM,WAAW,OAAO,mBAAmB,YAAY,eAAe,SAAS,MAAM;AACrF,MAAI,YAAY,SAAS;AACvB,YAAQ,KAAK,qBAAqB;AAClC,YAAQ,KAAK,CAAC;AAAA,EAChB;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 { consola } from \"consola\";\nexport function handlePromptCancel(promptResponse) {\n const isFalse = typeof promptResponse === \"boolean\" && !promptResponse;\n // https://github.com/unjs/consola/issues/251\n const isSigInt = typeof promptResponse === \"symbol\" && promptResponse.toString() === \"Symbol(clack:cancel)\";\n if (isSigInt || isFalse) {\n consola.fail(\"Operation cancelled\");\n process.exit(0);\n }\n}"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { consola } from 'consola';
|
|
2
|
+
|
|
3
|
+
// src/consola/handlePromptCancel.ts
|
|
4
|
+
function handlePromptCancel(promptResponse) {
|
|
5
|
+
const isFalse = typeof promptResponse === "boolean" && !promptResponse;
|
|
6
|
+
const isSigInt = typeof promptResponse === "symbol" && promptResponse.toString() === "Symbol(clack:cancel)";
|
|
7
|
+
if (isSigInt || isFalse) {
|
|
8
|
+
consola.fail("Operation cancelled");
|
|
9
|
+
process.exit(0);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { handlePromptCancel };
|
|
14
|
+
//# sourceMappingURL=out.js.map
|
|
15
|
+
//# sourceMappingURL=chunk-IV3QY3PZ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/consola/handlePromptCancel.ts"],"names":[],"mappings":";AAgBA,SAAS,eAAe;AACjB,SAAS,mBAAmB,gBAAgB;AACjD,QAAM,UAAU,OAAO,mBAAmB,aAAa,CAAC;AAExD,QAAM,WAAW,OAAO,mBAAmB,YAAY,eAAe,SAAS,MAAM;AACrF,MAAI,YAAY,SAAS;AACvB,YAAQ,KAAK,qBAAqB;AAClC,YAAQ,KAAK,CAAC;AAAA,EAChB;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 { consola } from \"consola\";\nexport function handlePromptCancel(promptResponse) {\n const isFalse = typeof promptResponse === \"boolean\" && !promptResponse;\n // https://github.com/unjs/consola/issues/251\n const isSigInt = typeof promptResponse === \"symbol\" && promptResponse.toString() === \"Symbol(clack:cancel)\";\n if (isSigInt || isFalse) {\n consola.fail(\"Operation cancelled\");\n process.exit(0);\n }\n}"]}
|
|
@@ -6,7 +6,7 @@ import { createClientContext, createOpenApiRequest } from '@osdk/shared.net';
|
|
|
6
6
|
import { consola } from 'consola';
|
|
7
7
|
import * as fs from 'fs';
|
|
8
8
|
|
|
9
|
-
var USER_AGENT = `osdk-cli/${"0.
|
|
9
|
+
var USER_AGENT = `osdk-cli/${"0.6.0"}`;
|
|
10
10
|
async function handleGenerate(args) {
|
|
11
11
|
let success = false;
|
|
12
12
|
if (args.ontologyPath) {
|
|
@@ -94,4 +94,4 @@ function getUserAgent(version) {
|
|
|
94
94
|
|
|
95
95
|
export { handleGenerate as default };
|
|
96
96
|
//# sourceMappingURL=out.js.map
|
|
97
|
-
//# sourceMappingURL=handleGenerate-
|
|
97
|
+
//# sourceMappingURL=handleGenerate-7QGFIWKO.mjs.map
|
|
@@ -28,7 +28,7 @@ function _interopNamespace(e) {
|
|
|
28
28
|
|
|
29
29
|
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
30
30
|
|
|
31
|
-
var USER_AGENT = `osdk-cli/${"0.
|
|
31
|
+
var USER_AGENT = `osdk-cli/${"0.6.0"}`;
|
|
32
32
|
async function handleGenerate(args) {
|
|
33
33
|
let success = false;
|
|
34
34
|
if (args.ontologyPath) {
|
|
@@ -116,4 +116,4 @@ function getUserAgent(version) {
|
|
|
116
116
|
|
|
117
117
|
module.exports = handleGenerate;
|
|
118
118
|
//# sourceMappingURL=out.js.map
|
|
119
|
-
//# sourceMappingURL=handleGenerate-
|
|
119
|
+
//# sourceMappingURL=handleGenerate-FHM4MFPH.cjs.map
|
package/build/js/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var chunkX2S4O5ZR_cjs = require('./chunk-X2S4O5ZR.cjs');
|
|
4
4
|
var chunkHYF3CTKZ_cjs = require('./chunk-HYF3CTKZ.cjs');
|
|
5
5
|
require('./chunk-HQDDGVB7.cjs');
|
|
6
|
+
var consola = require('consola');
|
|
6
7
|
var yargs = require('yargs');
|
|
7
8
|
var helpers = require('yargs/helpers');
|
|
8
9
|
var fs = require('fs');
|
|
@@ -91,8 +92,6 @@ async function loadFoundryConfig() {
|
|
|
91
92
|
allErrors: true
|
|
92
93
|
});
|
|
93
94
|
const validate = ajv.compile(CONFIG_FILE_SCHEMA);
|
|
94
|
-
const Consola = await import('consola');
|
|
95
|
-
Consola.consola;
|
|
96
95
|
const {
|
|
97
96
|
findUp
|
|
98
97
|
} = await import('find-up');
|
|
@@ -132,26 +131,22 @@ var YargsCheckError = class extends Error {
|
|
|
132
131
|
super(msg);
|
|
133
132
|
}
|
|
134
133
|
};
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const Consola = await import('consola');
|
|
139
|
-
const consola = Consola.consola;
|
|
140
|
-
if (config?.autoVersion != null && argv.autoVersion !== config?.autoVersion.type) {
|
|
141
|
-
consola.debug(`Overriding "autoVersion" from config file with ${argv.autoVersion}`);
|
|
134
|
+
async function logDeployCommandConfigFileOverride(args, config) {
|
|
135
|
+
if (config?.autoVersion != null && args.autoVersion !== config?.autoVersion.type) {
|
|
136
|
+
consola.consola.debug(`Overriding "autoVersion" from config file with ${args.autoVersion}`);
|
|
142
137
|
}
|
|
143
|
-
if (config?.directory != null &&
|
|
144
|
-
consola.debug(`Overriding "directory" from config file with ${
|
|
138
|
+
if (config?.directory != null && args.directory !== config?.directory) {
|
|
139
|
+
consola.consola.debug(`Overriding "directory" from config file with ${args.directory}`);
|
|
145
140
|
}
|
|
146
|
-
if (config?.autoVersion?.tagPrefix != null &&
|
|
147
|
-
consola.debug(`Overriding "gitTagPrefix" from config file with ${
|
|
141
|
+
if (config?.autoVersion?.tagPrefix != null && args.gitTagPrefix != null && args.gitTagPrefix !== config?.autoVersion.tagPrefix) {
|
|
142
|
+
consola.consola.debug(`Overriding "gitTagPrefix" from config file with ${args.gitTagPrefix}`);
|
|
148
143
|
}
|
|
149
144
|
}
|
|
150
145
|
|
|
151
146
|
// src/commands/site/deploy/index.ts
|
|
152
147
|
var command2 = {
|
|
153
148
|
command: "deploy",
|
|
154
|
-
describe: "Deploy
|
|
149
|
+
describe: "Deploy a new site version",
|
|
155
150
|
builder: async (argv) => {
|
|
156
151
|
const config = await configLoader_default();
|
|
157
152
|
const siteConfig = config?.foundryConfig.site;
|
|
@@ -161,7 +156,7 @@ var command2 = {
|
|
|
161
156
|
return argv.options({
|
|
162
157
|
directory: {
|
|
163
158
|
type: "string",
|
|
164
|
-
description: "Directory
|
|
159
|
+
description: "Directory containing site files",
|
|
165
160
|
...directory ? {
|
|
166
161
|
default: directory
|
|
167
162
|
} : {
|
|
@@ -170,19 +165,20 @@ var command2 = {
|
|
|
170
165
|
},
|
|
171
166
|
uploadOnly: {
|
|
172
167
|
type: "boolean",
|
|
173
|
-
description: "Upload
|
|
168
|
+
description: "Upload new site version only without setting as live",
|
|
174
169
|
default: false
|
|
175
170
|
},
|
|
176
171
|
version: {
|
|
177
172
|
type: "string",
|
|
178
|
-
description: "
|
|
173
|
+
description: "New version of site to deploy",
|
|
179
174
|
...autoVersion == null ? {
|
|
180
175
|
conflicts: "autoVersion"
|
|
181
176
|
} : {}
|
|
182
177
|
},
|
|
183
178
|
autoVersion: {
|
|
184
179
|
type: "string",
|
|
185
|
-
|
|
180
|
+
choices: ["git-describe"],
|
|
181
|
+
description: "Enable auto versioning",
|
|
186
182
|
...autoVersion != null ? {
|
|
187
183
|
default: autoVersion.type
|
|
188
184
|
} : {
|
|
@@ -191,58 +187,58 @@ var command2 = {
|
|
|
191
187
|
},
|
|
192
188
|
gitTagPrefix: {
|
|
193
189
|
type: "string",
|
|
194
|
-
description: "Prefix to match git tags
|
|
190
|
+
description: "Prefix to match git tags on when 'git-describe' auto versioning is used. If not provided, all tags are matched and the prefix 'v' is stripped if present.",
|
|
195
191
|
...gitTagPrefix ? {
|
|
196
192
|
default: gitTagPrefix
|
|
197
193
|
} : {}
|
|
198
194
|
}
|
|
199
|
-
}).group(["
|
|
200
|
-
if (autoVersion == null &&
|
|
195
|
+
}).group(["directory", "version", "uploadOnly"], "Deploy Options").group(["autoVersion", "gitTagPrefix"], "Auto Version Options").check((args) => {
|
|
196
|
+
if (autoVersion == null && args.autoVersion == null && args.version == null) {
|
|
201
197
|
throw new YargsCheckError("One of --version or --autoVersion must be specified");
|
|
202
198
|
}
|
|
203
|
-
const autoVersionType =
|
|
199
|
+
const autoVersionType = args.autoVersion ?? autoVersion;
|
|
204
200
|
if (autoVersionType !== "git-describe") {
|
|
205
201
|
throw new YargsCheckError(`Only 'git-describe' is supported for autoVersion`);
|
|
206
202
|
}
|
|
207
|
-
const gitTagPrefixValue =
|
|
203
|
+
const gitTagPrefixValue = args.gitTagPrefix ?? gitTagPrefix;
|
|
208
204
|
if (gitTagPrefixValue != null && autoVersionType !== "git-describe") {
|
|
209
205
|
throw new YargsCheckError(`--gitTagPrefix is only supported when --autoVersion=git-describe`);
|
|
210
206
|
}
|
|
211
207
|
return true;
|
|
212
|
-
}).middleware((
|
|
208
|
+
}).middleware((args) => logDeployCommandConfigFileOverride(args, siteConfig));
|
|
213
209
|
},
|
|
214
210
|
handler: async (args) => {
|
|
215
|
-
const command11 = await import('./siteDeployCommand-
|
|
211
|
+
const command11 = await import('./siteDeployCommand-QKPJEL4X.cjs');
|
|
216
212
|
await command11.default(args);
|
|
217
213
|
}
|
|
218
214
|
};
|
|
219
215
|
var deploy_default = command2;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
const Consola = await import('consola');
|
|
224
|
-
const consola = Consola.consola;
|
|
225
|
-
if (config?.site.application != null && argv.application !== config.site.application) {
|
|
226
|
-
consola.debug(`Overriding "application" from config file with ${argv.application}`);
|
|
216
|
+
async function logSiteCommandConfigFileOverride(args, config) {
|
|
217
|
+
if (config?.site.application != null && args.application !== config.site.application) {
|
|
218
|
+
consola.consola.debug(`Overriding "application" from config file with ${args.application}`);
|
|
227
219
|
}
|
|
228
|
-
if (config?.foundryUrl != null &&
|
|
229
|
-
consola.debug(`Overriding "foundryUrl" from config file with ${
|
|
220
|
+
if (config?.foundryUrl != null && args.foundryUrl !== config.foundryUrl) {
|
|
221
|
+
consola.consola.debug(`Overriding "foundryUrl" from config file with ${args.foundryUrl}`);
|
|
230
222
|
}
|
|
231
223
|
}
|
|
232
224
|
|
|
233
225
|
// src/commands/site/version/delete/index.ts
|
|
234
226
|
var command3 = {
|
|
235
227
|
command: "delete <version>",
|
|
236
|
-
describe: "Delete
|
|
228
|
+
describe: "Delete site version",
|
|
237
229
|
builder: (argv) => {
|
|
238
230
|
return argv.positional("version", {
|
|
239
231
|
type: "string",
|
|
240
232
|
demandOption: true,
|
|
241
233
|
description: "Version to set as live"
|
|
242
|
-
})
|
|
234
|
+
}).option("yes", {
|
|
235
|
+
alias: "y",
|
|
236
|
+
type: "boolean",
|
|
237
|
+
description: "Automatically confirm destructive changes"
|
|
238
|
+
}).group(["yes"], "Delete Options");
|
|
243
239
|
},
|
|
244
240
|
handler: async (args) => {
|
|
245
|
-
const command11 = await import('./versionDeleteCommand-
|
|
241
|
+
const command11 = await import('./versionDeleteCommand-S7AXTY46.cjs');
|
|
246
242
|
await command11.default(args);
|
|
247
243
|
}
|
|
248
244
|
};
|
|
@@ -251,7 +247,7 @@ var delete_default = command3;
|
|
|
251
247
|
// src/commands/site/version/get/index.ts
|
|
252
248
|
var command4 = {
|
|
253
249
|
command: "get",
|
|
254
|
-
describe: "Get
|
|
250
|
+
describe: "Get live site version",
|
|
255
251
|
builder: (argv) => {
|
|
256
252
|
return argv;
|
|
257
253
|
},
|
|
@@ -265,7 +261,7 @@ var get_default = command4;
|
|
|
265
261
|
// src/commands/site/version/list/index.ts
|
|
266
262
|
var command5 = {
|
|
267
263
|
command: "list",
|
|
268
|
-
describe: "List
|
|
264
|
+
describe: "List site versions",
|
|
269
265
|
builder: (argv) => {
|
|
270
266
|
return argv;
|
|
271
267
|
},
|
|
@@ -279,7 +275,7 @@ var list_default = command5;
|
|
|
279
275
|
// src/commands/site/version/set/index.ts
|
|
280
276
|
var command6 = {
|
|
281
277
|
command: "set <version>",
|
|
282
|
-
describe: "Set
|
|
278
|
+
describe: "Set live site version",
|
|
283
279
|
builder: (argv) => {
|
|
284
280
|
return argv.positional("version", {
|
|
285
281
|
type: "string",
|
|
@@ -297,12 +293,16 @@ var set_default = command6;
|
|
|
297
293
|
// src/commands/site/version/unset/index.ts
|
|
298
294
|
var command7 = {
|
|
299
295
|
command: "unset",
|
|
300
|
-
describe: "Clear
|
|
296
|
+
describe: "Clear live site version",
|
|
301
297
|
builder: (argv) => {
|
|
302
|
-
return argv
|
|
298
|
+
return argv.option("yes", {
|
|
299
|
+
alias: "y",
|
|
300
|
+
type: "boolean",
|
|
301
|
+
description: "Automatically confirm destructive changes"
|
|
302
|
+
}).group(["yes"], "Unset Options");
|
|
303
303
|
},
|
|
304
304
|
handler: async (args) => {
|
|
305
|
-
const command11 = await import('./versionUnsetCommand-
|
|
305
|
+
const command11 = await import('./versionUnsetCommand-V3ZVCGSI.cjs');
|
|
306
306
|
await command11.default(args);
|
|
307
307
|
}
|
|
308
308
|
};
|
|
@@ -311,9 +311,9 @@ var unset_default = command7;
|
|
|
311
311
|
// src/commands/site/version/index.ts
|
|
312
312
|
var command8 = {
|
|
313
313
|
command: "version",
|
|
314
|
-
describe: "Manage
|
|
314
|
+
describe: "Manage site versions",
|
|
315
315
|
builder: (argv) => {
|
|
316
|
-
return argv.command(list_default).command(
|
|
316
|
+
return argv.command(list_default).command(get_default).command(set_default).command(unset_default).command(delete_default).demandCommand();
|
|
317
317
|
},
|
|
318
318
|
handler: async (args) => {
|
|
319
319
|
}
|
|
@@ -337,7 +337,7 @@ var command9 = {
|
|
|
337
337
|
} : {
|
|
338
338
|
demandOption: true
|
|
339
339
|
},
|
|
340
|
-
description: "Application
|
|
340
|
+
description: "Application resource identifier (rid)"
|
|
341
341
|
},
|
|
342
342
|
foundryUrl: {
|
|
343
343
|
coerce: (foundryUrl2) => foundryUrl2.replace(/\/$/, ""),
|
|
@@ -347,24 +347,24 @@ var command9 = {
|
|
|
347
347
|
} : {
|
|
348
348
|
demandOption: true
|
|
349
349
|
},
|
|
350
|
-
description: "Foundry
|
|
350
|
+
description: "Foundry URL including protocol"
|
|
351
351
|
},
|
|
352
352
|
token: {
|
|
353
353
|
type: "string",
|
|
354
354
|
conflicts: "tokenFile",
|
|
355
|
-
description: "Foundry API
|
|
355
|
+
description: "Foundry API token"
|
|
356
356
|
},
|
|
357
357
|
tokenFile: {
|
|
358
358
|
type: "string",
|
|
359
359
|
conflicts: "token",
|
|
360
|
-
description: "Path to
|
|
360
|
+
description: "Path to file containing Foundry API token"
|
|
361
361
|
}
|
|
362
|
-
}).group(["application", "foundryUrl", "token", "tokenFile"], "Common
|
|
363
|
-
if (!
|
|
362
|
+
}).group(["application", "foundryUrl", "token", "tokenFile"], "Common Options").command(version_default).command(deploy_default).check((args) => {
|
|
363
|
+
if (!args.foundryUrl.startsWith("https://")) {
|
|
364
364
|
throw new YargsCheckError("foundryUrl must start with https://");
|
|
365
365
|
}
|
|
366
366
|
return true;
|
|
367
|
-
}).middleware((
|
|
367
|
+
}).middleware((args) => logSiteCommandConfigFileOverride(args, config?.foundryConfig)).demandCommand();
|
|
368
368
|
},
|
|
369
369
|
handler: async (args) => {
|
|
370
370
|
}
|
|
@@ -374,7 +374,7 @@ var site_default = command9;
|
|
|
374
374
|
// src/commands/typescript/generate/generate.ts
|
|
375
375
|
var command10 = {
|
|
376
376
|
command: "generate",
|
|
377
|
-
describe: "Generate
|
|
377
|
+
describe: "Generate TypeScript SDK from ontology",
|
|
378
378
|
builder: (argv) => {
|
|
379
379
|
return argv.options({
|
|
380
380
|
"outDir": {
|
|
@@ -422,18 +422,18 @@ var command10 = {
|
|
|
422
422
|
description: "Version of the generated code, or 'dev'",
|
|
423
423
|
demandOption: true
|
|
424
424
|
}
|
|
425
|
-
}).group(["ontologyPath", "outDir", "version"], "Generate from a local file").group(["stack", "clientId", "outDir", "ontologyWritePath", "version"], "OR Generate from a stack").check((
|
|
426
|
-
if (!
|
|
425
|
+
}).group(["ontologyPath", "outDir", "version"], "Generate from a local file").group(["stack", "clientId", "outDir", "ontologyWritePath", "version"], "OR Generate from a stack").check((args) => {
|
|
426
|
+
if (!args.ontologyPath && !args.stack) {
|
|
427
427
|
throw new Error("Error: Must specify either ontologyPath or stack and clientId");
|
|
428
428
|
}
|
|
429
|
-
if (
|
|
429
|
+
if (args.version !== "dev" && !chunkX2S4O5ZR_cjs.isValidSemver(args.version)) {
|
|
430
430
|
throw new Error("Error: Version must be 'dev' or a valid semver version");
|
|
431
431
|
}
|
|
432
432
|
return true;
|
|
433
433
|
});
|
|
434
434
|
},
|
|
435
435
|
handler: async (args) => {
|
|
436
|
-
const command11 = await import('./handleGenerate-
|
|
436
|
+
const command11 = await import('./handleGenerate-FHM4MFPH.cjs');
|
|
437
437
|
await command11.default(args);
|
|
438
438
|
}
|
|
439
439
|
};
|
|
@@ -450,8 +450,6 @@ var site2 = {
|
|
|
450
450
|
}
|
|
451
451
|
};
|
|
452
452
|
var typescript_default = site2;
|
|
453
|
-
|
|
454
|
-
// src/yargs/logConfigFileMiddleware.ts
|
|
455
453
|
var firstTime = true;
|
|
456
454
|
async function logConfigFileMiddleware() {
|
|
457
455
|
if (firstTime) {
|
|
@@ -459,32 +457,26 @@ async function logConfigFileMiddleware() {
|
|
|
459
457
|
const config = configLoader_default();
|
|
460
458
|
const configFilePath = (await config)?.configFilePath;
|
|
461
459
|
if (configFilePath) {
|
|
462
|
-
|
|
463
|
-
const consola = Consola.consola;
|
|
464
|
-
consola.debug(`Using configuration from file: "${configFilePath}"`);
|
|
460
|
+
consola.consola.debug(`Using configuration from file: "${configFilePath}"`);
|
|
465
461
|
}
|
|
466
462
|
}
|
|
467
463
|
}
|
|
468
|
-
|
|
469
|
-
// src/yargs/logVersionMiddleware.ts
|
|
470
464
|
var firstTime2 = true;
|
|
471
465
|
async function logVersionMiddleware(args) {
|
|
472
466
|
if (firstTime2) {
|
|
473
467
|
firstTime2 = false;
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
consola.
|
|
477
|
-
|
|
478
|
-
if (consola.level > 3) {
|
|
479
|
-
consola.debug(`Verbose logging enabled (${consola.level === 4 ? "debug" : "trace"})`);
|
|
468
|
+
consola.consola.info(`Palantir OSDK CLI ${"0.6.0"}`);
|
|
469
|
+
consola.consola.level = 3 + args.verbose;
|
|
470
|
+
if (consola.consola.level > 3) {
|
|
471
|
+
consola.consola.debug(`Verbose logging enabled (${consola.consola.level === 4 ? "debug" : "trace"})`);
|
|
480
472
|
}
|
|
481
|
-
consola.log("");
|
|
473
|
+
consola.consola.log("");
|
|
482
474
|
}
|
|
483
475
|
}
|
|
484
476
|
|
|
485
477
|
// src/cli.ts
|
|
486
478
|
async function cli(args = process.argv) {
|
|
487
|
-
const base = yargs__default.default(helpers.hideBin(args)).env("OSDK").version(false).option("verbose", {
|
|
479
|
+
const base = yargs__default.default(helpers.hideBin(args)).wrap(Math.min(150, yargs__default.default().terminalWidth())).env("OSDK").version(false).option("verbose", {
|
|
488
480
|
alias: "v",
|
|
489
481
|
type: "boolean",
|
|
490
482
|
description: "Enable verbose logging",
|
|
@@ -492,27 +484,23 @@ async function cli(args = process.argv) {
|
|
|
492
484
|
}).demandCommand().middleware(logVersionMiddleware, true).middleware(logConfigFileMiddleware).strict().command({
|
|
493
485
|
command: "unstable",
|
|
494
486
|
aliases: ["experimental"],
|
|
487
|
+
describe: "Unstable commands",
|
|
495
488
|
builder: async (argv) => {
|
|
496
489
|
return argv.command(site_default).command(typescript_default).command(auth_default).demandCommand();
|
|
497
490
|
},
|
|
498
491
|
handler: (_args) => {
|
|
499
492
|
}
|
|
500
|
-
}).fail(async (msg, err,
|
|
501
|
-
const Consola = await import('consola');
|
|
502
|
-
const isVerbose = args.some((arg) => ["-v", "--v", "--verbose"].includes(arg));
|
|
493
|
+
}).fail(async (msg, err, argv) => {
|
|
503
494
|
if (err instanceof chunkHYF3CTKZ_cjs.ExitProcessError) {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
} else {
|
|
507
|
-
Consola.consola.error(err.message);
|
|
508
|
-
}
|
|
495
|
+
consola.consola.error(err.message);
|
|
496
|
+
consola.consola.debug(err.stack);
|
|
509
497
|
} else {
|
|
510
498
|
if (err && err instanceof YargsCheckError === false) {
|
|
511
499
|
throw err;
|
|
512
500
|
} else {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
501
|
+
argv.showHelp();
|
|
502
|
+
consola.consola.log("");
|
|
503
|
+
consola.consola.error(msg);
|
|
516
504
|
}
|
|
517
505
|
}
|
|
518
506
|
process.exit(1);
|
|
@@ -521,8 +509,7 @@ async function cli(args = process.argv) {
|
|
|
521
509
|
return await base.parseAsync();
|
|
522
510
|
} catch (err) {
|
|
523
511
|
if (err instanceof chunkHYF3CTKZ_cjs.ExitProcessError) {
|
|
524
|
-
|
|
525
|
-
Consola.consola.error(err);
|
|
512
|
+
consola.consola.error(err);
|
|
526
513
|
}
|
|
527
514
|
}
|
|
528
515
|
}
|