@seamapi/cli 0.4.0 → 0.5.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.
@@ -1,7 +1,6 @@
1
- import { type Blueprint, createBlueprint } from '@seamapi/blueprint'
2
- import { getOpenapiSchema } from '@seamapi/http/connect'
3
- import * as seamTypes from '@seamapi/types/connect'
1
+ import type { Blueprint } from '@seamapi/blueprint'
4
2
 
3
+ import getBlueprint from './blueprint.js'
5
4
  import { getServer } from './get-server.js'
6
5
 
7
6
  export type ApiBlueprint = Blueprint
@@ -9,9 +8,20 @@ export type ApiBlueprint = Blueprint
9
8
  export const getApiBlueprint = async (
10
9
  useRemoteDefinitions: boolean,
11
10
  ): Promise<ApiBlueprint> => {
12
- const typesModule = useRemoteDefinitions
13
- ? { ...seamTypes, openapi: await getOpenapiSchema(getServer()) }
14
- : seamTypes
11
+ // Remote definitions describe whatever the server is currently running, so
12
+ // build them directly from the server's OpenAPI document. This runtime path
13
+ // does not load @seamapi/types.
14
+ if (useRemoteDefinitions) return await createRemoteBlueprint()
15
15
 
16
- return createBlueprint(typesModule, { omitUndocumented: true })
16
+ return await getBlueprint()
17
+ }
18
+
19
+ const createRemoteBlueprint = async (): Promise<Blueprint> => {
20
+ const [{ createBlueprint }, { getOpenapiSchema }] = await Promise.all([
21
+ import('@seamapi/blueprint'),
22
+ import('@seamapi/http/connect'),
23
+ ])
24
+ const openapi = await getOpenapiSchema(getServer())
25
+
26
+ return await createBlueprint({ openapi }, { omitUndocumented: true })
17
27
  }
@@ -1,6 +1,9 @@
1
- import type { CustomMetadata } from '@seamapi/types/connect'
2
1
  import prompts from 'prompts'
3
2
 
3
+ // Structurally the CustomMetadata of @seamapi/types, spelled out here so the
4
+ // published declarations do not depend on a development-only package.
5
+ type CustomMetadata = Record<string, string | boolean>
6
+
4
7
  type UpdatedCustomMetadata = {
5
8
  [x: string]: string | boolean | null
6
9
  }
@@ -1,3 +1,3 @@
1
- const seamapiCliVersion = '0.4.0'
1
+ const seamapiCliVersion = '0.5.0'
2
2
 
3
3
  export default seamapiCliVersion