@seamapi/types 0.0.4 → 0.0.6

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/README.md CHANGED
@@ -7,10 +7,45 @@ TypeScript types for the Seam API.
7
7
 
8
8
  ## Description
9
9
 
10
- TODO
10
+ This repository aggregates the latest route schemas and type definitions for the Seam API.
11
+ Upstream Seam repositories automatically contribute updates on every deployment
12
+ via a Pull Request opened by Seam Bot.
13
+ This ensures downstream consumers, e.g., the SDK, fakes, documentation generators, etc.,
14
+ have a single source of truth that stays up to date with the API.
15
+
16
+ ### Structure
17
+
18
+ The main entrypoint for this module is empty: there is dedicated entrypoint for each Seam API namespace.
19
+
20
+ Each directory under `src/lib/seam/*` is owned by an upstream Seam repository.
21
+ These files should not be edited manually as they will be overridden by automation.
22
+
23
+ Each entrypoint may export one or more of the following:
24
+
25
+ - Zod schemas: collectively exported as a single object named `schemas`.
26
+ - Types: derived directly from the [Zod Schemas][zod] and exported at the top level.
27
+ - A separate collection of Zod schmeas named `routes`.
28
+ - A type named `Routes` that implements the
29
+ [Route Definition interface from typed-axios][typed-axios Route Definition].
30
+ - The OpenAPI schema as a plain object named `openapi`.
31
+
32
+ [nextlove]: https://github.com/seamapi/nextlove
33
+ [typed-axios Route Definition]: https://github.com/seamapi/typed-axios#route-definition
34
+ [OpenAPI]: https://www.openapis.org/
35
+ [zod]: https://zod.dev/
11
36
 
12
37
  ## Installation
13
38
 
39
+ ### Types Only
40
+
41
+ Add this as a development dependency to your project using [npm] with
42
+
43
+ ```
44
+ $ npm install --save-dev @seamapi/types
45
+ ```
46
+
47
+ ### Types and Zod Schemas
48
+
14
49
  Add this as a dependency to your project using [npm] with
15
50
 
16
51
  ```
@@ -28,7 +63,6 @@ $ git clone https://github.com/seamapi/types.git
28
63
  $ cd types
29
64
  $ nvm install
30
65
  $ npm install
31
- $ npm run test:watch
32
66
  ```
33
67
 
34
68
  Primary development tasks are defined under `scripts` in `package.json`
package/connect.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './lib/seam/connect/index.js';
package/connect.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './lib/seam/connect/index.js';
2
+ //# sourceMappingURL=connect.js.map
package/connect.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect.js","sourceRoot":"","sources":["src/connect.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA"}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var zod = require('zod');
4
+
5
+ // src/lib/seam/connect/models/workspace.ts
6
+ var workspace = zod.z.object({
7
+ workspace_id: zod.z.string().uuid()
8
+ });
9
+
10
+ exports.workspace = workspace;
11
+ //# sourceMappingURL=out.js.map
12
+ //# sourceMappingURL=connect.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/seam/connect/models/workspace.ts"],"names":[],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,YAAY,EAAE,OAAO;AAAA,EAChC,cAAc,EAAE,OAAO,EAAE,KAAK;AAChC,CAAC","sourcesContent":["import { z } from \"zod\"\n\nexport const workspace = z.object({\n workspace_id: z.string().uuid(),\n})\nexport type Workspace = z.infer<typeof workspace>\n"]}
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const workspace: z.ZodObject<{
4
+ workspace_id: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ workspace_id: string;
7
+ }, {
8
+ workspace_id: string;
9
+ }>;
10
+ type Workspace = z.infer<typeof workspace>;
11
+
12
+ export { Workspace, workspace };
package/dist/index.cjs ADDED
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ // src/index.ts
4
+ var src_default = null;
5
+
6
+ module.exports = src_default;
7
+ //# sourceMappingURL=out.js.map
8
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAAA,IAAO,cAAQ","sourcesContent":["export default null\n"]}
@@ -0,0 +1,3 @@
1
+ declare const _default: null;
2
+
3
+ export { _default as default };
package/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { default } from './lib/index.js';
2
- export * from './lib/index.js';
1
+ declare const _default: null;
2
+ export default _default;
package/index.js CHANGED
@@ -1,3 +1,2 @@
1
- export { default } from './lib/index.js';
2
- export * from './lib/index.js';
1
+ export default null;
3
2
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,eAAe,IAAI,CAAA"}
@@ -0,0 +1 @@
1
+ export * from "./models/index.js";
@@ -0,0 +1,2 @@
1
+ export * from "./models/index.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
@@ -0,0 +1 @@
1
+ export * from "./workspace.js";
@@ -0,0 +1,2 @@
1
+ export * from "./workspace.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+ export declare const workspace: z.ZodObject<{
3
+ workspace_id: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ workspace_id: string;
6
+ }, {
7
+ workspace_id: string;
8
+ }>;
9
+ export type Workspace = z.infer<typeof workspace>;
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+ export const workspace = z.object({
3
+ workspace_id: z.string().uuid(),
4
+ });
5
+ //# sourceMappingURL=workspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/models/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;CAChC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -8,7 +8,13 @@
8
8
  "exports": {
9
9
  ".": {
10
10
  "import": "./index.js",
11
+ "require": "./dist/index.cjs",
11
12
  "types": "./index.d.ts"
13
+ },
14
+ "./connect": {
15
+ "import": "./connect.js",
16
+ "require": "./dist/connect.cjs",
17
+ "types": "./connect.d.ts"
12
18
  }
13
19
  },
14
20
  "module": "index.js",
@@ -28,50 +34,54 @@
28
34
  "index.js",
29
35
  "index.js.map",
30
36
  "index.d.ts",
37
+ "connect.js",
38
+ "connect.js.map",
39
+ "connect.d.ts",
40
+ "dist",
31
41
  "lib",
32
- "src",
33
- "!**/*.test.ts"
42
+ "src"
34
43
  ],
35
44
  "scripts": {
36
- "build": "npm run build:ts",
37
- "postbuild": "node ./index.js",
45
+ "build": "npm run build:entrypoints",
46
+ "prebuild": "concurrently --raw --group 'tsx src/index.ts' 'tsx src/connect.ts'",
47
+ "postbuild": "concurrently --raw --group 'node ./index.js' 'node ./connect.js'",
48
+ "build:entrypoints": "npm run build:ts",
49
+ "postbuild:entrypoints": "tsup",
38
50
  "build:ts": "tsc --project tsconfig.build.json",
39
- "prebuild:ts": "del 'index.*' lib",
51
+ "prebuild:ts": "del 'index.*' 'connect.*' 'lib'",
40
52
  "postbuild:ts": "tsc-alias --project tsconfig.build.json",
41
53
  "typecheck": "tsc",
42
- "test": "c8 ava",
43
- "pretest": "tsx src/index.ts",
44
- "test:update": "ava --update-snapshots",
45
- "test:watch": "ava --watch",
46
- "test:debug": "ava debug --break",
47
54
  "lint": "eslint --ignore-path .gitignore .",
48
55
  "prelint": "prettier --check --ignore-path .gitignore .",
49
56
  "postversion": "git push --follow-tags",
50
- "example": "tsx examples",
51
- "example:inspect": "tsx --inspect examples",
52
- "format": "eslint --ignore-path .gitignore --fix .",
53
- "preformat": "prettier --write --ignore-path .gitignore .",
54
- "report": "c8 report"
57
+ "format": "prettier --write --ignore-path .gitignore .",
58
+ "preformat": "patch-package",
59
+ "postformat": "eslint --ignore-path .gitignore --fix ."
55
60
  },
56
61
  "engines": {
57
62
  "node": ">=16.13.0",
58
63
  "npm": ">= 8.1.0"
59
64
  },
65
+ "peerDependencies": {
66
+ "zod": "^3.21.4"
67
+ },
60
68
  "devDependencies": {
61
69
  "@types/node": "^18.11.18",
62
- "ava": "^5.0.1",
63
- "c8": "^8.0.0",
70
+ "concurrently": "^8.2.0",
64
71
  "del-cli": "^5.0.0",
65
72
  "eslint": "^8.9.0",
66
73
  "eslint-config-prettier": "^8.4.0",
67
74
  "eslint-config-standard": "^17.1.0",
68
75
  "eslint-config-standard-with-typescript": "^36.0.0",
76
+ "eslint-plugin-node": "^11.1.0",
69
77
  "eslint-plugin-simple-import-sort": "^10.0.0",
70
78
  "eslint-plugin-unused-imports": "^2.0.0",
71
- "landlubber": "^1.0.0",
79
+ "patch-package": "^7.0.1",
72
80
  "prettier": "^3.0.0",
73
81
  "tsc-alias": "^1.8.2",
82
+ "tsup": "^7.1.0",
74
83
  "tsx": "^3.12.1",
75
- "typescript": "^5.0.2"
84
+ "typescript": "^5.0.2",
85
+ "zod": "^3.21.4"
76
86
  }
77
87
  }
package/src/connect.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './lib/seam/connect/index.js'
package/src/index.ts CHANGED
@@ -1,2 +1 @@
1
- export { default } from 'lib/index.js'
2
- export * from 'lib/index.js'
1
+ export default null
@@ -0,0 +1,5 @@
1
+ {
2
+ "semi": false,
3
+ "trailingComma": "es5",
4
+ "endOfLine": "lf"
5
+ }
@@ -0,0 +1 @@
1
+ export * from "./models/index.js"
@@ -0,0 +1 @@
1
+ export * from "./workspace.js"
@@ -0,0 +1,6 @@
1
+ import { z } from "zod"
2
+
3
+ export const workspace = z.object({
4
+ workspace_id: z.string().uuid(),
5
+ })
6
+ export type Workspace = z.infer<typeof workspace>
package/lib/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { todo as default } from './todo.js';
2
- export { todo } from './todo.js';
package/lib/index.js DELETED
@@ -1,3 +0,0 @@
1
- export { todo as default } from './todo.js';
2
- export { todo } from './todo.js';
3
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA"}
package/lib/todo.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const todo: (x: string) => string;
package/lib/todo.js DELETED
@@ -1,2 +0,0 @@
1
- export const todo = (x) => x;
2
- //# sourceMappingURL=todo.js.map
package/lib/todo.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"todo.js","sourceRoot":"","sources":["../src/lib/todo.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAA"}
package/src/lib/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export { todo as default } from './todo.js'
2
- export { todo } from './todo.js'
package/src/lib/todo.ts DELETED
@@ -1 +0,0 @@
1
- export const todo = (x: string): string => x