@seamapi/cli 0.8.0 → 0.9.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/bin/cli.js +10 -1
- package/bin/cli.js.map +1 -1
- package/lib/blueprint.d.ts +2 -1
- package/lib/blueprint.js +171 -26
- package/lib/blueprint.js.map +1 -1
- package/lib/get-api-blueprint.d.ts +4 -1
- package/lib/get-api-blueprint.js +3 -4
- package/lib/get-api-blueprint.js.map +1 -1
- package/lib/version.d.ts +3 -1
- package/lib/version.js +4 -1
- package/lib/version.js.map +1 -1
- package/package.json +4 -3
- package/src/bin/cli.ts +11 -1
- package/src/lib/blueprint.ts +228 -28
- package/src/lib/get-api-blueprint.ts +7 -3
- package/src/lib/version.ts +4 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { Blueprint } from '@seamapi/blueprint';
|
|
2
2
|
export type ApiBlueprint = Blueprint;
|
|
3
|
-
export
|
|
3
|
+
export interface GetApiBlueprintOptions {
|
|
4
|
+
update?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const getApiBlueprint: (useRemoteDefinitions: boolean, options?: GetApiBlueprintOptions) => Promise<ApiBlueprint>;
|
package/lib/get-api-blueprint.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import getBlueprint from './blueprint.js';
|
|
2
2
|
import { getServer } from './get-server.js';
|
|
3
|
-
export const getApiBlueprint = async (useRemoteDefinitions) => {
|
|
3
|
+
export const getApiBlueprint = async (useRemoteDefinitions, options = {}) => {
|
|
4
4
|
// Remote definitions describe whatever the server is currently running, so
|
|
5
|
-
// build them directly from the server's OpenAPI document.
|
|
6
|
-
// does not load @seamapi/types.
|
|
5
|
+
// build them directly from the server's OpenAPI document.
|
|
7
6
|
if (useRemoteDefinitions)
|
|
8
7
|
return await createRemoteBlueprint();
|
|
9
|
-
return await getBlueprint();
|
|
8
|
+
return await getBlueprint(options);
|
|
10
9
|
};
|
|
11
10
|
const createRemoteBlueprint = async () => {
|
|
12
11
|
const [{ createBlueprint }, { getOpenapiSchema }] = await Promise.all([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-api-blueprint.js","sourceRoot":"","sources":["../src/lib/get-api-blueprint.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"get-api-blueprint.js","sourceRoot":"","sources":["../src/lib/get-api-blueprint.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAQ3C,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAClC,oBAA6B,EAC7B,UAAkC,EAAE,EACb,EAAE;IACzB,2EAA2E;IAC3E,0DAA0D;IAC1D,IAAI,oBAAoB;QAAE,OAAO,MAAM,qBAAqB,EAAE,CAAA;IAE9D,OAAO,MAAM,YAAY,CAAC,OAAO,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,KAAK,IAAwB,EAAE;IAC3D,MAAM,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,gBAAgB,EAAE,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACpE,MAAM,CAAC,oBAAoB,CAAC;QAC5B,MAAM,CAAC,uBAAuB,CAAC;KAChC,CAAC,CAAA;IACF,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAA;IAEnD,OAAO,MAAM,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAA;AACvE,CAAC,CAAA"}
|
package/lib/version.d.ts
CHANGED
package/lib/version.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// Versions are replaced with generated values when the package is packed.
|
|
2
|
+
const seamapiCliVersion = '0.9.0';
|
|
3
|
+
const seamapiBlueprintVersion = '1.2.0';
|
|
4
|
+
export { seamapiBlueprintVersion };
|
|
2
5
|
export default seamapiCliVersion;
|
|
3
6
|
//# sourceMappingURL=version.js.map
|
package/lib/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/lib/version.ts"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAG,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/lib/version.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,iBAAiB,GAAG,OAAO,CAAA;AACjC,MAAM,uBAAuB,GAAG,OAAO,CAAA;AAEvC,OAAO,EAAE,uBAAuB,EAAE,CAAA;AAClC,eAAe,iBAAiB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seamapi/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "A command line interface (CLI) for interacting with the Seam API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@seamapi/blueprint": "
|
|
92
|
+
"@seamapi/blueprint": "1.2.0",
|
|
93
93
|
"@seamapi/http": "2.2.0",
|
|
94
94
|
"@seamapi/wizard": "0.5.2",
|
|
95
95
|
"chalk": "^6.0.0",
|
|
@@ -99,7 +99,8 @@
|
|
|
99
99
|
"minimist": "^1.2.8",
|
|
100
100
|
"nanospinner": "^1.2.2",
|
|
101
101
|
"open": "^11.0.0",
|
|
102
|
-
"prompts": "^2.4.2"
|
|
102
|
+
"prompts": "^2.4.2",
|
|
103
|
+
"tar": "^7.5.22"
|
|
103
104
|
},
|
|
104
105
|
"devDependencies": {
|
|
105
106
|
"@seamapi/types": "1.985.0",
|
package/src/bin/cli.ts
CHANGED
|
@@ -37,6 +37,11 @@ const sections = [
|
|
|
37
37
|
alias: 'h',
|
|
38
38
|
type: Boolean,
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
name: 'update',
|
|
42
|
+
description: 'Force an update of the cached Seam API definitions.',
|
|
43
|
+
type: Boolean,
|
|
44
|
+
},
|
|
40
45
|
],
|
|
41
46
|
},
|
|
42
47
|
{
|
|
@@ -117,7 +122,12 @@ async function cli(args: ParsedArgs) {
|
|
|
117
122
|
const use_remote_api_defs =
|
|
118
123
|
args['remote_api_defs'] ?? config.get('use_remote_api_defs')
|
|
119
124
|
|
|
120
|
-
const
|
|
125
|
+
const update = args['update'] === true
|
|
126
|
+
delete args['update']
|
|
127
|
+
|
|
128
|
+
const blueprint = await getApiBlueprint(use_remote_api_defs ?? false, {
|
|
129
|
+
update,
|
|
130
|
+
})
|
|
121
131
|
|
|
122
132
|
const commandParams: Record<string, any> = {}
|
|
123
133
|
|