From fa621e5951d8088bb605721447fb96d83fd6852e Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Mon, 27 Jul 2026 16:04:25 -0500 Subject: [PATCH 01/16] Use object form for exports/import --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d905b4b0..4147aa17 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,10 @@ "types": "index.d.ts", "exports": { ".": { - "types": "./index.d.ts", - "import": "./index.js" + "import": { + "types": "./index.d.ts", + "default": "./index.js" + } } }, "module": "index.js", From b35e99d64c8194ecfb8fa566fe82278e9274b8c5 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Mon, 27 Jul 2026 21:31:41 +0000 Subject: [PATCH 02/16] 3.0.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ce07c97f..e5857240 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.0", + "version": "3.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.0", + "version": "3.0.1", "license": "SEE LICENSE IN LICENSE.txt", "devDependencies": { "@types/node": "^24.10.9", diff --git a/package.json b/package.json index 4147aa17..04f25a74 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.0", + "version": "3.0.1", "description": "Package skeleton for a TypeScript module.", "type": "module", "main": "index.js", From 03579fa190c6ae89da693e157c4aa40320544b72 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Mon, 27 Jul 2026 16:53:01 -0500 Subject: [PATCH 03/16] Fix ava watchMode setting --- ava.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ava.config.js b/ava.config.js index f0e4c9ac..89d4d668 100644 --- a/ava.config.js +++ b/ava.config.js @@ -1,8 +1,8 @@ export default () => { return { files: ['**/*.test.ts', '!package/**/*'], - ignoreChanges: { - watchMode: ['tmp/**/*'], + watchMode: { + ignoreChanges: ['tmp/**/*'], }, extensions: ['ts'], nodeArguments: ['--import=tsx'], From 675b305b6232c5e6c43d9fd18ef63940aaadde1a Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Mon, 27 Jul 2026 21:53:56 +0000 Subject: [PATCH 04/16] 3.0.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e5857240..d6ee9750 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.1", + "version": "3.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.1", + "version": "3.0.2", "license": "SEE LICENSE IN LICENSE.txt", "devDependencies": { "@types/node": "^24.10.9", diff --git a/package.json b/package.json index 04f25a74..1fc26670 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.1", + "version": "3.0.2", "description": "Package skeleton for a TypeScript module.", "type": "module", "main": "index.js", From 35da51cb5fbc9d9fbe6b6d91e4f72e574a4fcb7f Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Mon, 27 Jul 2026 16:58:25 -0500 Subject: [PATCH 05/16] Allow npm version 11.12.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1fc26670..2ae42292 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ }, "packageManager": { "name": "npm", - "version": "^11.16.0 || ^10.9.4" + "version": "^11.12.0 || ^10.9.4" } }, "devDependencies": { From 94f7c353433d32395d6d59bf7b1953eb5a9bd8ff Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Mon, 27 Jul 2026 21:59:05 +0000 Subject: [PATCH 06/16] 3.0.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d6ee9750..eb3b1fa7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.2", + "version": "3.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.2", + "version": "3.0.3", "license": "SEE LICENSE IN LICENSE.txt", "devDependencies": { "@types/node": "^24.10.9", diff --git a/package.json b/package.json index 2ae42292..a6e4852b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.2", + "version": "3.0.3", "description": "Package skeleton for a TypeScript module.", "type": "module", "main": "index.js", From a888cc241335357dc341e94b17cc935b373b9a2a Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Tue, 28 Jul 2026 10:53:33 -0500 Subject: [PATCH 07/16] Allow npm version to be first major version --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a6e4852b..e59c5809 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ }, "engines": { "node": ">=22.11.0", - "npm": ">=10.9.4" + "npm": ">=10.0.0" }, "devEngines": { "runtime": { @@ -69,7 +69,7 @@ }, "packageManager": { "name": "npm", - "version": "^11.12.0 || ^10.9.4" + "version": "^11.0.0 || ^10.0.0" } }, "devDependencies": { From 3b690e4c9488f8db043d554d90330ad7a6619eed Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Tue, 28 Jul 2026 15:54:26 +0000 Subject: [PATCH 08/16] ci: Generate code --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index eb3b1fa7..fa875f00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ }, "engines": { "node": ">=22.11.0", - "npm": ">=10.9.4" + "npm": ">=10.0.0" } }, "node_modules/@bcoe/v8-coverage": { From 0eb4f35ebfc0117c1d15dfbcd13dcc5cfcbd1b80 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Tue, 28 Jul 2026 15:59:07 +0000 Subject: [PATCH 09/16] 3.0.4 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fa875f00..b2d5616f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.3", + "version": "3.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.3", + "version": "3.0.4", "license": "SEE LICENSE IN LICENSE.txt", "devDependencies": { "@types/node": "^24.10.9", diff --git a/package.json b/package.json index e59c5809..796f4732 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.3", + "version": "3.0.4", "description": "Package skeleton for a TypeScript module.", "type": "module", "main": "index.js", From e72972def23207dc21ac2422be71c52aca7213ed Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Wed, 5 Aug 2026 14:59:30 -0700 Subject: [PATCH 10/16] Add eslint settings for TS import parser and resolver (#37) * Add settings for import parser and resolver * ci: Format code * Add "eslint-import-resolver-typescript": "^4.4.5", * Fix name * ci: Format code --------- Co-authored-by: Seam Bot --- eslint.config.ts | 32 ++- package-lock.json | 553 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 583 insertions(+), 3 deletions(-) diff --git a/eslint.config.ts b/eslint.config.ts index e1f108f8..ca287da2 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -22,6 +22,16 @@ export default [ 'unused-imports': unusedImports, import: importPlugin, }, + settings: { + 'import/parsers': { + '@typescript-eslint/parser': ['.ts', '.tsx'], + }, + 'import/resolver': { + typescript: { + project: './tsconfig.json', + }, + }, + }, rules: { '@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/no-import-type-side-effects': 'error', @@ -31,9 +41,25 @@ export default [ fixStyle: 'inline-type-imports', }, ], - 'import/extensions': ['error', 'ignorePackages'], 'import/no-duplicates': ['error', { 'prefer-inline': true }], - 'import/no-relative-parent-imports': 'error', + 'import/no-cycle': [ + 'error', + { + ignoreExternal: true, + }, + ], + 'no-restricted-imports': [ + 'error', + { + patterns: [ + { + group: ['..', '../**'], + message: + 'Import by path alias instead, e.g., lib/foo/bar.js or test/fixtures/blueprint.js.', + }, + ], + }, + ], 'unused-imports/no-unused-imports': 'error', 'unused-imports/no-unused-vars': [ 'error', @@ -61,7 +87,7 @@ export default [ ['^node:'], ['^@?\\w'], ['@seamapi/makenew-tsmodule'], - ['^lib/'], + ['^lib/', '^test/'], ['^'], ['^\\.'], ], diff --git a/package-lock.json b/package-lock.json index b2d5616f..146cddaf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "c8": "^12.0.0", "del-cli": "^7.0.0", "eslint": "^9.31.0", + "eslint-import-resolver-typescript": "^4.4.5", "eslint-plugin-import": "^2.32.0", "eslint-plugin-simple-import-sort": "^12.1.1", "eslint-plugin-unused-imports": "^4.1.4", @@ -50,6 +51,40 @@ "node": ">=20" } }, + "node_modules/@emnapi/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", + "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.1", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", + "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", + "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.28.1", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", @@ -786,6 +821,28 @@ "node": ">=18" } }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.2.tgz", + "integrity": "sha512-JfB4kuJQjaoHuCTseIINHtHWeJnvgEcxjwA5t/Y00ZgaOO1Crz3fjT/p8kT28zA/Caz7oiUMn3d6H2yOVCVwuw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.3", + "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.3" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -887,6 +944,17 @@ "eslint": ">=8.40.0" } }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", + "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@types/estree": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", @@ -1224,6 +1292,349 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@unrs/resolver-binding-android-arm-eabi": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.12.2.tgz", + "integrity": "sha512-g5T90pqg1bo/7mytQx6F4iBNC0Wsh9cu+z9veDbFjc7HjpesJFWD7QMS0NGStXM075+7dJPPVvBbpZlnrdpi/w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@unrs/resolver-binding-android-arm64": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.12.2.tgz", + "integrity": "sha512-YGCRZv/9GLhwmz6mYDeTsm/92BAyR28l6c2ReweVW5pWgfsitWLY8upvfRlGdoyD8HjeTHSYJWyZGD4KJA/nFQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@unrs/resolver-binding-darwin-arm64": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.12.2.tgz", + "integrity": "sha512-u9DiNT1auQMO20A9SyTuG3wUgQWB9Z7KjAg0uFuCDR1FsAY8A0CG2S6JpHS1xwm/w1G08bjXZDcyOCjv1WAm2w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@unrs/resolver-binding-darwin-x64": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.12.2.tgz", + "integrity": "sha512-f7rPLi/T1HVKZu/u6t87lroib16n8vrSzcyxI7lg4BGO9UF26KhQL44sd9eOUgrTYhvRXtWOIZT5PejdPyJfUA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@unrs/resolver-binding-freebsd-x64": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.12.2.tgz", + "integrity": "sha512-BpcOjWCJub6nRZUS2zA20pmLvjtqAtGejETaIyRLiZiQf++cbrjltLA5NN/xaXfqeOBOSlMFbemIl5/S5tljmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.12.2.tgz", + "integrity": "sha512-vZTDvdSISZjJx66OzJqtsOhzifbqRjbmI1Mnu49fQDwog5GtDI4QidRiEAYbZCRj9C8YZEW+3ZjqsyS9GR4k2A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.12.2.tgz", + "integrity": "sha512-BiPI+IrIlwcW4nLLMM21+B1dFPzd55yAVgVGrdgDjNef+ch03GdxrcyaIz8X9SsQirh/kCQ7mviyWlMxdh2D7g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm64-gnu": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.12.2.tgz", + "integrity": "sha512-zJc0H99FEPoFfSrNpa91HYfxzfAJCr502oxNK1cfdC9hlaFI43RT+JFCann9JUgZmLzzntChHyn13Sgn9ljHNg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm64-musl": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.12.2.tgz", + "integrity": "sha512-KQ3Lki6l+Pz1k/eBipN41ES+YUK30beLGb9YqcB1O542cyLCNE6GaxrfcY3T6EezmGGk84wb5XyO9loTM9tkcA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-loong64-gnu": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-loong64-gnu/-/resolver-binding-linux-loong64-gnu-1.12.2.tgz", + "integrity": "sha512-3SJGEh1DborhG6pyxvhPzCT4bbSIVihsvgJc13P1bHG7KLdNDaF9T3gsTwFc7Jw/5Y5/iWOjkEx7Zy0NvCGX3Q==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-loong64-musl": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-loong64-musl/-/resolver-binding-linux-loong64-musl-1.12.2.tgz", + "integrity": "sha512-jiuG/Obbel7uw1PwHNFfrkiKhLAF6mnyZ6aWlOAVN9WqKm8v0OFGnciJIHu8+CMvXLQ8AD51LPzAoUfT21D5Ew==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.12.2.tgz", + "integrity": "sha512-q7xRvVpmcfeL+LlZg8Pbbo6QaTZwDU5BaGZbwfhkEsXJn3Was8xYfE0RBH266xZt0rM6B7i8xAYIvjthuUIWHg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.12.2.tgz", + "integrity": "sha512-0CVdx6lcnT3Q9inOH8tsMIOJ6ImndllMjqJHg8RLVdB7Vq4SfkEXl9mCSsVNuNA4MCYycRicCUxPCabVHJRr6A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-riscv64-musl": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.12.2.tgz", + "integrity": "sha512-iOwlRo9vnp6R6ohHQS11n0NnfdXx/omhkocmIfaPRpQhKZ+3BDMkkdRVh53qjkFkpPddf+FETA28NwGN7l5l+w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-s390x-gnu": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.12.2.tgz", + "integrity": "sha512-HYJtLfXq94q8iZNFT1lknx258wlkkWhZeUXJRqzKBBUJ00CvZ+N33zgbCqimLjsyw5Va6uUxhVa12mI+kaveEw==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-x64-gnu": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.12.2.tgz", + "integrity": "sha512-mPsUhunKKDih5O96Y6enDQyHc1SqBPlY1E/SfMWDM3EdJ95Z9CArPeCVwCCqbP45ljvivdEk8Fxn+SIb1rDAJQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-x64-musl": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.12.2.tgz", + "integrity": "sha512-azrt6+5ydLd8Vt210AAFis/lZevSfPw93EJRIJG+xPu4WCJ8K0kppCTpMyLPcKT7H15M4Jnt2tMp5bOvCkRC6A==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-openharmony-arm64": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-openharmony-arm64/-/resolver-binding-openharmony-arm64-1.12.2.tgz", + "integrity": "sha512-YZ9hP4O0X9PQb8eO980qmLNGH4zT3I9+SZTdt0Pr0YyuGQhYKoOZkV02VzrzyOZJ5xIJ3UFIenKkUkGg8GjgWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@unrs/resolver-binding-wasm32-wasi": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.12.2.tgz", + "integrity": "sha512-tYFDIkMxSflfEc/h92ZWNsZlHSwgimbNHSO3PL2JWQHfCuC2q316jMyYU9TIWZsFK2bQwyK5VAdYgn8ygPj69A==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.10.0", + "@emnapi/runtime": "1.10.0", + "@napi-rs/wasm-runtime": "^1.1.4" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@unrs/resolver-binding-win32-arm64-msvc": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.12.2.tgz", + "integrity": "sha512-qzNyg3xL0VPQmCaUh+N5jSitce6k+uCBfMDesWRnlULOZaqUkaJ0ybdT+UqlAWJoQjuqfIU/0Ptx9bteN4D82g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.12.2.tgz", + "integrity": "sha512-WD9sY00OfpHVGfsnHZoA8jVT+esS/Bg8z8jzxp5BnDCjjwsuKsPQrzswwpFy4J1AUJbXPRfkpcX0mXrzeXW79g==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@unrs/resolver-binding-win32-x64-msvc": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.12.2.tgz", + "integrity": "sha512-nAB74NfSNKknqQ1RrYj6uz8FcXEomu/MATJZxh/x+BArzN2U3JbOYC0APYzUIGhVY3m5hRxA8VPNdPBoG8txlA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@vercel/nft": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-1.10.2.tgz", @@ -2897,6 +3308,31 @@ "eslint": ">=6.0.0" } }, + "node_modules/eslint-import-context": { + "version": "0.1.9", + "resolved": "https://registry.npmjs.org/eslint-import-context/-/eslint-import-context-0.1.9.tgz", + "integrity": "sha512-K9Hb+yRaGAGUbwjhFNHvSmmkZs9+zbuoe3kFQ4V1wYjrepUFYM2dZAfNtjbbj3qsPfUfsA68Bx/ICWQMi+C8Eg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-tsconfig": "^4.10.1", + "stable-hash-x": "^0.2.0" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-import-context" + }, + "peerDependencies": { + "unrs-resolver": "^1.0.0" + }, + "peerDependenciesMeta": { + "unrs-resolver": { + "optional": true + } + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.10", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.10.tgz", @@ -2919,6 +3355,41 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-import-resolver-typescript": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-4.4.5.tgz", + "integrity": "sha512-nbE5XLph6TLtGYcu/U6e6ZVXyKBhbDWK5cLGk76eJ7NdZpwf1P9EFkpt1Z01mNZNrrilsAYWKH6zUkL4reoXbw==", + "dev": true, + "license": "ISC", + "dependencies": { + "debug": "^4.4.1", + "eslint-import-context": "^0.1.8", + "get-tsconfig": "^4.10.1", + "is-bun-module": "^2.0.0", + "stable-hash-x": "^0.2.0", + "tinyglobby": "^0.2.14", + "unrs-resolver": "^1.7.11" + }, + "engines": { + "node": "^16.17.0 || >=18.6.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-import-resolver-typescript" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*", + "eslint-plugin-import-x": "*" + }, + "peerDependenciesMeta": { + "eslint-plugin-import": { + "optional": true + }, + "eslint-plugin-import-x": { + "optional": true + } + } + }, "node_modules/eslint-module-utils": { "version": "2.14.0", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.14.0.tgz", @@ -4296,6 +4767,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-bun-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-2.0.0.tgz", + "integrity": "sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.7.1" + } + }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -5330,6 +5811,22 @@ "url": "https://github.com/sponsors/raouldeheer" } }, + "node_modules/napi-postinstall": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.4.tgz", + "integrity": "sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==", + "dev": true, + "license": "MIT", + "bin": { + "napi-postinstall": "lib/cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/napi-postinstall" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -6710,6 +7207,16 @@ "dev": true, "license": "BSD-3-Clause" }, + "node_modules/stable-hash-x": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/stable-hash-x/-/stable-hash-x-0.2.0.tgz", + "integrity": "sha512-o3yWv49B/o4QZk5ZcsALc6t0+eCelPc44zZsLtCQnZPDwFpDYSWcDnrv2TtMmMbQ7uKo3J0HTURCqckw23czNQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", @@ -7232,6 +7739,14 @@ "strip-bom": "^3.0.0" } }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + }, "node_modules/tsx": { "version": "4.23.1", "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.1.tgz", @@ -7432,6 +7947,44 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/unrs-resolver": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.12.2.tgz", + "integrity": "sha512-dmlRxBJJayXjqTwC+JtF1HhJmgf3ftQ3YejFcZrf4+KKtJv0qDsK1pjqaaVjG7wJ5NJ6UVP1OqRMQ71Z4C3rxQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "napi-postinstall": "^0.3.4" + }, + "funding": { + "url": "https://opencollective.com/unrs-resolver" + }, + "optionalDependencies": { + "@unrs/resolver-binding-android-arm-eabi": "1.12.2", + "@unrs/resolver-binding-android-arm64": "1.12.2", + "@unrs/resolver-binding-darwin-arm64": "1.12.2", + "@unrs/resolver-binding-darwin-x64": "1.12.2", + "@unrs/resolver-binding-freebsd-x64": "1.12.2", + "@unrs/resolver-binding-linux-arm-gnueabihf": "1.12.2", + "@unrs/resolver-binding-linux-arm-musleabihf": "1.12.2", + "@unrs/resolver-binding-linux-arm64-gnu": "1.12.2", + "@unrs/resolver-binding-linux-arm64-musl": "1.12.2", + "@unrs/resolver-binding-linux-loong64-gnu": "1.12.2", + "@unrs/resolver-binding-linux-loong64-musl": "1.12.2", + "@unrs/resolver-binding-linux-ppc64-gnu": "1.12.2", + "@unrs/resolver-binding-linux-riscv64-gnu": "1.12.2", + "@unrs/resolver-binding-linux-riscv64-musl": "1.12.2", + "@unrs/resolver-binding-linux-s390x-gnu": "1.12.2", + "@unrs/resolver-binding-linux-x64-gnu": "1.12.2", + "@unrs/resolver-binding-linux-x64-musl": "1.12.2", + "@unrs/resolver-binding-openharmony-arm64": "1.12.2", + "@unrs/resolver-binding-wasm32-wasi": "1.12.2", + "@unrs/resolver-binding-win32-arm64-msvc": "1.12.2", + "@unrs/resolver-binding-win32-ia32-msvc": "1.12.2", + "@unrs/resolver-binding-win32-x64-msvc": "1.12.2" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", diff --git a/package.json b/package.json index 796f4732..94e61fb5 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "c8": "^12.0.0", "del-cli": "^7.0.0", "eslint": "^9.31.0", + "eslint-import-resolver-typescript": "^4.4.5", "eslint-plugin-import": "^2.32.0", "eslint-plugin-simple-import-sort": "^12.1.1", "eslint-plugin-unused-imports": "^4.1.4", From c64d898696666db659406eb98a286b61e60b63dd Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Wed, 5 Aug 2026 22:00:02 +0000 Subject: [PATCH 11/16] 3.0.5 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 146cddaf..d3193e0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.4", + "version": "3.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.4", + "version": "3.0.5", "license": "SEE LICENSE IN LICENSE.txt", "devDependencies": { "@types/node": "^24.10.9", diff --git a/package.json b/package.json index 94e61fb5..a37f7522 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.4", + "version": "3.0.5", "description": "Package skeleton for a TypeScript module.", "type": "module", "main": "index.js", From 09272cbea50935c26fbf5066e525d520e761d98a Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Wed, 5 Aug 2026 21:48:20 -0700 Subject: [PATCH 12/16] Add workflow to prune stale branches --- .github/workflows/prune.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/prune.yml diff --git a/.github/workflows/prune.yml b/.github/workflows/prune.yml new file mode 100644 index 00000000..146f2b80 --- /dev/null +++ b/.github/workflows/prune.yml @@ -0,0 +1,22 @@ +--- +name: Prune + +on: + workflow_dispatch: {} + schedule: + - cron: "0 15 * * 3" + +jobs: + tag: + name: Prune Branches + runs-on: 'ubuntu-latest' + timeout-minutes: 30 + permissions: + pull-requests: read + contents: write + steps: + - name: Prune stale branches + uses: balvajs/delete-stale-branches@v2 + with: + dry-run: false + days-to-delete: 7 From 573a2d833c257fc8c1838b7ae4361e3b485e258d Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Thu, 6 Aug 2026 04:49:04 +0000 Subject: [PATCH 13/16] 3.0.6 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d3193e0f..31d75c5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.5", + "version": "3.0.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.5", + "version": "3.0.6", "license": "SEE LICENSE IN LICENSE.txt", "devDependencies": { "@types/node": "^24.10.9", diff --git a/package.json b/package.json index a37f7522..fc6d6f78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.5", + "version": "3.0.6", "description": "Package skeleton for a TypeScript module.", "type": "module", "main": "index.js", From 2b9a19783d3837f272d81f86a42951bbf187d6d9 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Wed, 5 Aug 2026 21:51:42 -0700 Subject: [PATCH 14/16] Fix format --- .github/workflows/prune.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prune.yml b/.github/workflows/prune.yml index 146f2b80..562d16cc 100644 --- a/.github/workflows/prune.yml +++ b/.github/workflows/prune.yml @@ -4,7 +4,7 @@ name: Prune on: workflow_dispatch: {} schedule: - - cron: "0 15 * * 3" + - cron: '0 15 * * 3' jobs: tag: From 7d2ec2edcfbd60c4bb25dc9a2ad39c1ec2ec568a Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Thu, 6 Aug 2026 04:52:22 +0000 Subject: [PATCH 15/16] 3.0.7 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 31d75c5f..75cb9213 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.6", + "version": "3.0.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.6", + "version": "3.0.7", "license": "SEE LICENSE IN LICENSE.txt", "devDependencies": { "@types/node": "^24.10.9", diff --git a/package.json b/package.json index fc6d6f78..69b9d9a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@seamapi/makenew-tsmodule", - "version": "3.0.6", + "version": "3.0.7", "description": "Package skeleton for a TypeScript module.", "type": "module", "main": "index.js", From 6d3fd1ad47b727e2f8c562ebbff133dd04a23f73 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Wed, 5 Aug 2026 22:40:34 -0700 Subject: [PATCH 16/16] Fix cycles in imports --- .../layouts/partials/route-class-endpoint.hbs | 6 ++++ codegen/layouts/partials/route-imports.hbs | 3 ++ codegen/lib/layouts/route.ts | 14 ++++++-- src/lib/seam/connect/auth.ts | 6 +++- src/lib/seam/connect/options.ts | 12 +++---- src/lib/seam/connect/parse-options.ts | 10 ++---- src/lib/seam/connect/request-options.ts | 14 ++++++++ .../seam/connect/resolve-action-attempt.ts | 9 +++-- .../routes/access-methods/access-methods.ts | 13 ++++++++ .../connect/routes/acs/encoders/encoders.ts | 13 ++++++++ .../connect/routes/acs/entrances/entrances.ts | 5 +++ .../routes/action-attempts/action-attempts.ts | 4 +++ src/lib/seam/connect/routes/locks/locks.ts | 13 ++++++++ .../connect/routes/locks/simulate/simulate.ts | 9 +++++ .../daily-programs/daily-programs.ts | 5 +++ .../connect/routes/thermostats/thermostats.ts | 33 +++++++++++++++++++ .../connect/routes/workspaces/workspaces.ts | 5 +++ src/lib/seam/connect/seam-http-request.ts | 17 ++++++---- 18 files changed, 164 insertions(+), 27 deletions(-) create mode 100644 src/lib/seam/connect/request-options.ts diff --git a/codegen/layouts/partials/route-class-endpoint.hbs b/codegen/layouts/partials/route-class-endpoint.hbs index 962e784f..707d31e3 100644 --- a/codegen/layouts/partials/route-class-endpoint.hbs +++ b/codegen/layouts/partials/route-class-endpoint.hbs @@ -8,5 +8,11 @@ {{requestFormat}}: parameters, responseKey: {{#if returnsVoid}}undefined{{else}}'{{responseKey}}'{{/if}}, options, + {{#if returnsActionAttempt}} + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), + {{/if}} }) } diff --git a/codegen/layouts/partials/route-imports.hbs b/codegen/layouts/partials/route-imports.hbs index 9eab82c0..ffa773dc 100644 --- a/codegen/layouts/partials/route-imports.hbs +++ b/codegen/layouts/partials/route-imports.hbs @@ -35,6 +35,9 @@ import { import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' +{{#if needsActionAttemptsImport}} +import { SeamHttpActionAttempts } from 'lib/seam/connect/routes/action-attempts/index.js' +{{/if}} {{#unless skipClientSessionImport}} import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' {{/unless}} diff --git a/codegen/lib/layouts/route.ts b/codegen/lib/layouts/route.ts index c6882b25..4b251bd1 100644 --- a/codegen/lib/layouts/route.ts +++ b/codegen/lib/layouts/route.ts @@ -9,6 +9,7 @@ export interface RouteLayoutContext { endpoints: EndpointLayoutContext[] subroutes: SubrouteLayoutContext[] skipClientSessionImport: boolean + needsActionAttemptsImport: boolean resourceTypeImports: ResourceTypeImport[] } @@ -58,6 +59,11 @@ export const setRouteLayoutContext = ( file.className = getClassName(node?.path ?? null) file.skipClientSessionImport = node == null || node?.path === '/client_sessions' + file.needsActionAttemptsImport = + node != null && + node.path !== '/action_attempts' && + 'endpoints' in node && + node.endpoints.some(isActionAttemptEndpoint) file.resourceTypeImports = node != null && 'endpoints' in node ? [ @@ -115,9 +121,7 @@ export const getEndpointLayoutContext = ( ? 'params' : 'body' - const returnsActionAttempt = - endpoint.response.responseType === 'resource' && - endpoint.response.resourceType === 'action_attempt' + const returnsActionAttempt = isActionAttemptEndpoint(endpoint) const methodName = camelCase(endpoint.name) @@ -151,6 +155,10 @@ export const getEndpointLayoutContext = ( } } +const isActionAttemptEndpoint = (endpoint: Endpoint): boolean => + endpoint.response.responseType === 'resource' && + endpoint.response.resourceType === 'action_attempt' + const getEndpointResponseResourceTypes = (endpoint: Endpoint): string[] => { if (endpoint.response.responseType === 'void') return [] if (endpoint.response.responseType === 'resource') { diff --git a/src/lib/seam/connect/auth.ts b/src/lib/seam/connect/auth.ts index 606ec410..183aa458 100644 --- a/src/lib/seam/connect/auth.ts +++ b/src/lib/seam/connect/auth.ts @@ -6,14 +6,15 @@ import { isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken, isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken, SeamHttpInvalidOptionsError, + type SeamHttpOptions, type SeamHttpOptionsWithApiKey, type SeamHttpOptionsWithClientSessionToken, type SeamHttpOptionsWithConsoleSessionToken, type SeamHttpOptionsWithPersonalAccessToken, + type SeamHttpWithoutWorkspaceOptions, type SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken, type SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken, } from './options.js' -import type { Options } from './parse-options.js' import { accessTokenPrefix, clientSessionTokenPrefix, @@ -28,6 +29,9 @@ import { } from './token.js' type Headers = Record +type Options = + | SeamHttpWithoutWorkspaceOptions + | (SeamHttpOptions & { publishableKey?: string }) export const getAuthHeaders = (options: Options): Headers => { if ('publishableKey' in options && options.publishableKey != null) { diff --git a/src/lib/seam/connect/options.ts b/src/lib/seam/connect/options.ts index 2594ceca..a91807f9 100644 --- a/src/lib/seam/connect/options.ts +++ b/src/lib/seam/connect/options.ts @@ -1,6 +1,10 @@ import type { Client, ClientOptions } from './client.js' -import { isSeamHttpRequestOption } from './parse-options.js' -import type { ResolveActionAttemptOptions } from './resolve-action-attempt.js' +import { + isSeamHttpRequestOption, + type SeamHttpRequestOptions, +} from './request-options.js' + +export type { SeamHttpRequestOptions } from './request-options.js' export type SeamHttpWithoutWorkspaceOptions = | SeamHttpWithoutWorkspaceOptionsFromEnv @@ -20,10 +24,6 @@ interface SeamHttpCommonOptions extends ClientOptions, SeamHttpRequestOptions { endpoint?: string } -export interface SeamHttpRequestOptions { - waitForActionAttempt?: boolean | ResolveActionAttemptOptions -} - export interface SeamHttpFromPublishableKeyOptions extends SeamHttpCommonOptions {} export interface SeamHttpOptionsFromEnv extends SeamHttpCommonOptions {} diff --git a/src/lib/seam/connect/parse-options.ts b/src/lib/seam/connect/parse-options.ts index 4c94b620..0b08a2a9 100644 --- a/src/lib/seam/connect/parse-options.ts +++ b/src/lib/seam/connect/parse-options.ts @@ -12,6 +12,7 @@ import { type SeamHttpRequestOptions, type SeamHttpWithoutWorkspaceOptions, } from './options.js' +import { isSeamHttpRequestOption } from './request-options.js' export const defaultEndpoint = 'https://connect.getseam.com' @@ -177,11 +178,4 @@ export const limitToSeamHttpRequestOptions = ( ) as Required } -export const isSeamHttpRequestOption = ( - key: string, -): key is keyof SeamHttpRequestOptions => { - const keys: Record = { - waitForActionAttempt: true, - } - return Object.keys(keys).includes(key) -} +export { isSeamHttpRequestOption } from './request-options.js' diff --git a/src/lib/seam/connect/request-options.ts b/src/lib/seam/connect/request-options.ts new file mode 100644 index 00000000..e403a4f7 --- /dev/null +++ b/src/lib/seam/connect/request-options.ts @@ -0,0 +1,14 @@ +import type { ResolveActionAttemptOptions } from './resolve-action-attempt.js' + +export interface SeamHttpRequestOptions { + waitForActionAttempt?: boolean | ResolveActionAttemptOptions +} + +export const isSeamHttpRequestOption = ( + key: string, +): key is keyof SeamHttpRequestOptions => { + const keys: Record = { + waitForActionAttempt: true, + } + return Object.keys(keys).includes(key) +} diff --git a/src/lib/seam/connect/resolve-action-attempt.ts b/src/lib/seam/connect/resolve-action-attempt.ts index 49d1ae9e..3064d511 100644 --- a/src/lib/seam/connect/resolve-action-attempt.ts +++ b/src/lib/seam/connect/resolve-action-attempt.ts @@ -1,5 +1,8 @@ import type { ActionAttempt } from './resources/action-attempt.js' -import type { SeamHttpActionAttempts } from './routes/index.js' + +export interface ActionAttemptsClient { + get(parameters: { action_attempt_id: string }): PromiseLike +} export interface ResolveActionAttemptOptions { timeout?: number @@ -8,7 +11,7 @@ export interface ResolveActionAttemptOptions { export const resolveActionAttempt = async ( actionAttempt: T, - actionAttempts: SeamHttpActionAttempts, + actionAttempts: ActionAttemptsClient, { timeout = 10_000, pollingInterval = 1_000 }: ResolveActionAttemptOptions, ): Promise> => { let timeoutRef @@ -32,7 +35,7 @@ export const resolveActionAttempt = async ( const pollActionAttempt = async ( actionAttempt: T, - actionAttempts: SeamHttpActionAttempts, + actionAttempts: ActionAttemptsClient, options: Pick, ): Promise> => { if (isSuccessfulActionAttempt(actionAttempt)) { diff --git a/src/lib/seam/connect/routes/access-methods/access-methods.ts b/src/lib/seam/connect/routes/access-methods/access-methods.ts index 400f47af..5faf9729 100644 --- a/src/lib/seam/connect/routes/access-methods/access-methods.ts +++ b/src/lib/seam/connect/routes/access-methods/access-methods.ts @@ -32,6 +32,7 @@ import { import type { AccessMethod } from 'lib/seam/connect/resources/access-method.js' import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.js' import type { Batch } from 'lib/seam/connect/resources/batch.js' +import { SeamHttpActionAttempts } from 'lib/seam/connect/routes/action-attempts/index.js' import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' @@ -182,6 +183,10 @@ export class SeamHttpAccessMethods { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } @@ -214,6 +219,10 @@ export class SeamHttpAccessMethods { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } @@ -278,6 +287,10 @@ export class SeamHttpAccessMethods { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } } diff --git a/src/lib/seam/connect/routes/acs/encoders/encoders.ts b/src/lib/seam/connect/routes/acs/encoders/encoders.ts index 82d90360..5f66f3e4 100644 --- a/src/lib/seam/connect/routes/acs/encoders/encoders.ts +++ b/src/lib/seam/connect/routes/acs/encoders/encoders.ts @@ -31,6 +31,7 @@ import { } from 'lib/seam/connect/parse-options.js' import type { AcsEncoder } from 'lib/seam/connect/resources/acs-encoder.js' import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.js' +import { SeamHttpActionAttempts } from 'lib/seam/connect/routes/action-attempts/index.js' import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' @@ -181,6 +182,10 @@ export class SeamHttpAcsEncoders { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } @@ -229,6 +234,10 @@ export class SeamHttpAcsEncoders { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } @@ -245,6 +254,10 @@ export class SeamHttpAcsEncoders { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } } diff --git a/src/lib/seam/connect/routes/acs/entrances/entrances.ts b/src/lib/seam/connect/routes/acs/entrances/entrances.ts index 3c8918a0..411546cd 100644 --- a/src/lib/seam/connect/routes/acs/entrances/entrances.ts +++ b/src/lib/seam/connect/routes/acs/entrances/entrances.ts @@ -32,6 +32,7 @@ import { import type { AcsCredential } from 'lib/seam/connect/resources/acs-credential.js' import type { AcsEntrance } from 'lib/seam/connect/resources/acs-entrance.js' import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.js' +import { SeamHttpActionAttempts } from 'lib/seam/connect/routes/action-attempts/index.js' import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' @@ -240,6 +241,10 @@ export class SeamHttpAcsEntrances { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } } diff --git a/src/lib/seam/connect/routes/action-attempts/action-attempts.ts b/src/lib/seam/connect/routes/action-attempts/action-attempts.ts index e1993c51..f64fabcc 100644 --- a/src/lib/seam/connect/routes/action-attempts/action-attempts.ts +++ b/src/lib/seam/connect/routes/action-attempts/action-attempts.ts @@ -174,6 +174,10 @@ export class SeamHttpActionAttempts { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } diff --git a/src/lib/seam/connect/routes/locks/locks.ts b/src/lib/seam/connect/routes/locks/locks.ts index c75918ae..ac91fb2d 100644 --- a/src/lib/seam/connect/routes/locks/locks.ts +++ b/src/lib/seam/connect/routes/locks/locks.ts @@ -31,6 +31,7 @@ import { } from 'lib/seam/connect/parse-options.js' import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.js' import type { Device } from 'lib/seam/connect/resources/device.js' +import { SeamHttpActionAttempts } from 'lib/seam/connect/routes/action-attempts/index.js' import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' @@ -181,6 +182,10 @@ export class SeamHttpLocks { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } @@ -230,6 +235,10 @@ export class SeamHttpLocks { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } @@ -246,6 +255,10 @@ export class SeamHttpLocks { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } } diff --git a/src/lib/seam/connect/routes/locks/simulate/simulate.ts b/src/lib/seam/connect/routes/locks/simulate/simulate.ts index 34210e47..c3b1f1ab 100644 --- a/src/lib/seam/connect/routes/locks/simulate/simulate.ts +++ b/src/lib/seam/connect/routes/locks/simulate/simulate.ts @@ -30,6 +30,7 @@ import { parseOptions, } from 'lib/seam/connect/parse-options.js' import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.js' +import { SeamHttpActionAttempts } from 'lib/seam/connect/routes/action-attempts/index.js' import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' @@ -174,6 +175,10 @@ export class SeamHttpLocksSimulate { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } @@ -190,6 +195,10 @@ export class SeamHttpLocksSimulate { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } } diff --git a/src/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.ts b/src/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.ts index 6e5f43ea..4d8dfc3f 100644 --- a/src/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.ts +++ b/src/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.ts @@ -31,6 +31,7 @@ import { } from 'lib/seam/connect/parse-options.js' import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.js' import type { ThermostatDailyProgram } from 'lib/seam/connect/resources/thermostat-daily-program.js' +import { SeamHttpActionAttempts } from 'lib/seam/connect/routes/action-attempts/index.js' import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' @@ -210,6 +211,10 @@ export class SeamHttpThermostatsDailyPrograms { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } } diff --git a/src/lib/seam/connect/routes/thermostats/thermostats.ts b/src/lib/seam/connect/routes/thermostats/thermostats.ts index 34e91dd6..6f8c41b8 100644 --- a/src/lib/seam/connect/routes/thermostats/thermostats.ts +++ b/src/lib/seam/connect/routes/thermostats/thermostats.ts @@ -31,6 +31,7 @@ import { } from 'lib/seam/connect/parse-options.js' import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.js' import type { Device } from 'lib/seam/connect/resources/device.js' +import { SeamHttpActionAttempts } from 'lib/seam/connect/routes/action-attempts/index.js' import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' @@ -194,6 +195,10 @@ export class SeamHttpThermostats { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } @@ -210,6 +215,10 @@ export class SeamHttpThermostats { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } @@ -258,6 +267,10 @@ export class SeamHttpThermostats { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } @@ -274,6 +287,10 @@ export class SeamHttpThermostats { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } @@ -306,6 +323,10 @@ export class SeamHttpThermostats { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } @@ -338,6 +359,10 @@ export class SeamHttpThermostats { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } @@ -354,6 +379,10 @@ export class SeamHttpThermostats { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } @@ -402,6 +431,10 @@ export class SeamHttpThermostats { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } } diff --git a/src/lib/seam/connect/routes/workspaces/workspaces.ts b/src/lib/seam/connect/routes/workspaces/workspaces.ts index 922bdcf6..2552f360 100644 --- a/src/lib/seam/connect/routes/workspaces/workspaces.ts +++ b/src/lib/seam/connect/routes/workspaces/workspaces.ts @@ -31,6 +31,7 @@ import { } from 'lib/seam/connect/parse-options.js' import type { ActionAttempt } from 'lib/seam/connect/resources/action-attempt.js' import type { Workspace } from 'lib/seam/connect/resources/workspace.js' +import { SeamHttpActionAttempts } from 'lib/seam/connect/routes/action-attempts/index.js' import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' @@ -223,6 +224,10 @@ export class SeamHttpWorkspaces { body: parameters, responseKey: 'action_attempt', options, + actionAttempts: SeamHttpActionAttempts.fromClient(this.client, { + ...this.defaults, + waitForActionAttempt: false, + }), }) } diff --git a/src/lib/seam/connect/seam-http-request.ts b/src/lib/seam/connect/seam-http-request.ts index f83190af..bd2cb388 100644 --- a/src/lib/seam/connect/seam-http-request.ts +++ b/src/lib/seam/connect/seam-http-request.ts @@ -3,9 +3,11 @@ import type { Method } from 'axios' import type { Client } from './client.js' import type { SeamHttpRequestOptions } from './options.js' -import { resolveActionAttempt } from './resolve-action-attempt.js' +import { + type ActionAttemptsClient, + resolveActionAttempt, +} from './resolve-action-attempt.js' import type { ActionAttempt } from './resources/action-attempt.js' -import { SeamHttpActionAttempts } from './routes/index.js' interface SeamHttpRequestParent { readonly client: Client @@ -19,6 +21,7 @@ interface SeamHttpRequestConfig { readonly params?: undefined | Record readonly responseKey: TResponseKey readonly options?: Pick + readonly actionAttempts?: ActionAttemptsClient } export class SeamHttpRequest< @@ -101,12 +104,14 @@ export class SeamHttpRequest< this.#parent.defaults.waitForActionAttempt if (waitForActionAttempt !== false) { + if (this.#config.actionAttempts == null) { + throw new Error( + 'Cannot wait for an action attempt without an action attempts client', + ) + } const actionAttempt = await resolveActionAttempt( data as unknown as ActionAttempt, - SeamHttpActionAttempts.fromClient(this.#parent.client, { - ...this.#parent.defaults, - waitForActionAttempt: false, - }), + this.#config.actionAttempts, typeof waitForActionAttempt === 'boolean' ? {} : waitForActionAttempt, ) return actionAttempt as Response