Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,12 @@
|
||||
# @toolctrl/api-types
|
||||
|
||||
Types-only re-export of the toolctrl boilerplate REST API surface.
|
||||
|
||||
This package is dependency-free at runtime: it re-exports `type` declarations
|
||||
from `@toolctrl/api-client-ts` plus the generated OpenAPI types. Use it in
|
||||
consumers that only need compile-time types (e.g. shared interfaces in another
|
||||
TypeScript service) without pulling in the SDK's fetch + crypto runtime.
|
||||
|
||||
```ts
|
||||
import type { ToolctrlClientConfig, PaginatedResponse } from "@toolctrl/api-types";
|
||||
```
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "@toolctrl/api-types",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"description": "Types-only re-export of the toolctrl boilerplate REST API surface. Zero runtime, zero dependencies — for consumers that need OpenAPI-derived TypeScript types without pulling in fetch / crypto code.",
|
||||
"type": "module",
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"files": [
|
||||
"src",
|
||||
"README.md"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "pnpm run typecheck",
|
||||
"test": "vitest run src",
|
||||
"typecheck": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@toolctrl/api-client-ts": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^25.0.0",
|
||||
"typescript": "^5.3.2",
|
||||
"vitest": "^3.2.4"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { describe, it, expectTypeOf } from "vitest";
|
||||
import type { ToolctrlClientConfig, PaginatedResponse, GetHealthzData, LoginWithPasswordData } from "./index.js";
|
||||
|
||||
describe("@toolctrl/api-types", () => {
|
||||
it("re-exports the wrapper ToolctrlClientConfig", () => {
|
||||
expectTypeOf<ToolctrlClientConfig>().toHaveProperty("baseUrl").toEqualTypeOf<string>();
|
||||
});
|
||||
it("re-exports PaginatedResponse<T>", () => {
|
||||
expectTypeOf<PaginatedResponse<number>>().toHaveProperty("data").toEqualTypeOf<number[]>();
|
||||
});
|
||||
it("re-exports OpenAPI-derived operation types", () => {
|
||||
// url should be the literal path captured by the generator.
|
||||
expectTypeOf<GetHealthzData["url"]>().toEqualTypeOf<"/healthz">();
|
||||
expectTypeOf<LoginWithPasswordData["url"]>().toEqualTypeOf<"/v1/auth/login">();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @toolctrl/api-types
|
||||
*
|
||||
* Types-only re-export of the toolctrl boilerplate REST API surface.
|
||||
* No runtime code, no dependencies that emit code at runtime.
|
||||
*
|
||||
* Consumers can import OpenAPI-derived TypeScript types without pulling in the
|
||||
* SDK's fetch + crypto runtime.
|
||||
*
|
||||
* Refs: docs/improvement-plan/08-mobile-cli-storybook-sdk/ts-sdk.md
|
||||
*/
|
||||
|
||||
// Higher-level wrapper types (auth config, retry config, pagination, etc.).
|
||||
export type {
|
||||
ToolctrlClient,
|
||||
ToolctrlClientConfig,
|
||||
ToolctrlAuthConfig,
|
||||
ToolctrlRetryConfig,
|
||||
ToolctrlIdempotencyConfig,
|
||||
PaginatedResponse,
|
||||
PaginateOptions,
|
||||
} from "@toolctrl/api-client-ts";
|
||||
|
||||
// OpenAPI-derived request/response types for every operation.
|
||||
// Re-exported as a `*` namespace to keep the surface area discoverable while
|
||||
// preserving the original generated names (GetHealthzData, LoginWithPasswordData, …).
|
||||
export type * from "@toolctrl/api-client-ts/types";
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"allowJs": false,
|
||||
"allowImportingTsExtensions": false,
|
||||
"lib": ["ES2022"],
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"noEmit": true,
|
||||
"types": ["node"],
|
||||
"paths": {}
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
environment: "node",
|
||||
include: ["src/**/*.test.ts"],
|
||||
globals: false,
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user