@ekanos/integration-schema

中文文档
0.27.0发布于 2026/11/12MITTypeScriptES Module零依赖近 30 天下载 6670

Canonical, dependency-pure zod schema + types for Ekanos integration definitions. Depended on by @ekanos/sdk and @kit/integrations-core; depends on neither, so there is no cycle and there is exactly one schema, one inferred type.

原始使用文档
文档目录3 节
  1. Why it exists
  2. What's here
  3. Publishing

@ekanos/integration-schema

The canonical, dependency-pure contract for Ekanos integration definitions.

One zod schema and one set of types, imported by both @ekanos/sdk (authoring — defineIntegration()) and @kit/integrations-core (the host trust boundary — registerPartnerIntegration() re-parses against the same schema). This package depends on nothing but zod, so neither consumer forms a dependency cycle and there is no hand-written structural twin to drift.

Docs: sdk.ekanos.dev/schema/overview.

Why it exists

A security review found three problems a shared schema resolves at once:

  • The host must re-parse partner exports at the trust boundary rather than trust a .d.ts. registerPartnerIntegration() calls parseIntegrationDefinition() from here, so a definition is validated twice against the same rules: once when you author it, once when the host accepts it.
  • Hand-written structural twins on the host side could not catch security-relevant drift. There are no twins now: one type, imported by both sides.
  • The SDK used to validate a weaker workspace contract than the host. The workspace-target schema lives here; the host injects icon-name validity via createWorkspaceTargetListSchema({ isValidIcon }).

Authoring an integration? Read the @ekanos/sdk README instead. It is the partner guide, and it documents every field this schema validates with a worked example. This package is the contract underneath it: you install it only if you need the schema or the types without the SDK.

What's here

  • IntegrationDefinitionSchema — the strict canonical zod schema.
  • parseIntegrationDefinition(input) — rejects non-plain containers, parses, returns sanitized result.data (never the caller's object).
  • validateIntegrationDefinitions(defs, firstParty?) — cross-definition + first-party collision detection.
  • IntegrationDefinition<Schemas> and friends — the generic authoring types.
  • The capability-context types (IntegrationContext, StorageSchemas, …) — canonical home; @ekanos/sdk re-exports them.
  • The workspace-target schema + normalizeWorkspaceTargets.

Dependency-pure by construction: zod only. No @kit/*, no React, no server-only.

Publishing

This package is a runtime dependency of @ekanos/sdk, so it must be published before the SDK — a fresh npm install @ekanos/sdk resolves @ekanos/integration-schema from the registry. (It carries private: true between releases as a deliberate publish latch; a release commit lifts it on every publishable package at once.) The compiled ESM in dist/ uses explicit .js relative specifiers so a real Node import resolves without a bundler; the SDK's pack:test exercises that path end to end.

版本与发布记录

@ekanos/integration-schema 共发布 35 个版本,首次发布于 2026/08/31;过去 12 个月发布了 35 个版本。

版本发布日期距今
0.27.0latest2026/11/121 天前
0.26.02026/11/112 天前
0.25.02026/11/094 天前
0.24.02026/11/076 天前
0.23.02026/11/049 天前
0.22.02026/11/0310 天前

关于 @ekanos/integration-schema 的常见问题

@ekanos/integration-schema 是什么?

Canonical, dependency-pure zod schema + types for Ekanos integration definitions. Depended on by @ekanos/sdk and @kit/integrations-core; depends on neither, so there is no cycle and there is exactly one schema, one inferred type.

如何安装 @ekanos/integration-schema?

在项目目录运行 npm install @ekanos/integration-schema,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:zod(^3.25.76 || ^4.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@ekanos/integration-schema 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ekanos/integration-schema 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@ekanos/integration-schema 可以商用吗?

@ekanos/integration-schema 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@ekanos/integration-schema 的下载量有多少?

根据 npm 官方下载统计,@ekanos/integration-schema 在 2026/10/13 – 2026/11/11 这 30 天内被下载 6,670 次,日均约 222 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ekanos/integration-schema 还在维护吗?

最新版本 0.27.0 发布于 2026/11/12(1 天前);至今共发布 35 个版本,其中过去 12 个月发布了 35 个;首次发布于 2026/08/31。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。