@adaptiveworx/iac-schemas

中文文档
0.1.6发布于 2026/10/04Apache-2.0TypeScriptES Module零依赖构建来源已验证近 30 天下载 2504

Region codes and names per provider, and the standard tag keys, for AdaptiveWorX™ infrastructure-as-code. Pure data + types — no runtime dependencies.

原始使用文档
文档目录10 节
  1. Install
  2. Usage
  3. Region resolution
  4. Typed region data
  5. Standard tag keys
  6. Direct JSON import
  7. What ships
  8. Stability
  9. License
  10. Repository + contributing

@adaptiveworx/iac-schemas

Region codes and names per provider, and the standard tag keys, for AdaptiveWorX™ Flow infrastructure-as-code.

This package is pure data + types — zero runtime dependencies. It's the source-of-truth for region resolution across the @adaptiveworx/iac-* packages and is safe to import from any TypeScript project.

Install

pnpm add @adaptiveworx/iac-schemas
# or
yarn add @adaptiveworx/iac-schemas
# or
npm install @adaptiveworx/iac-schemas

Usage

Region resolution

import { regions } from "@adaptiveworx/iac-schemas";

// AWS region aliases
regions.aws.aliases.use1; // "us-east-1"
regions.aws.aliases.usw2; // "us-west-2"

// Azure region aliases
regions.azure.aliases.eus2; // "eastus2"

// Available canonical regions per provider
regions.aws.regions; // ["us-east-1", "us-west-2", ...]

// Cloudflare (no regions): the single code glb
regions.cloudflare.aliases.glb; // "global"

Typed region data

import { AWS_REGION_CODES, AWS_REGION_NAMES, REGIONS } from "@adaptiveworx/iac-schemas";
import type { AwsRegionCode, AwsRegionName } from "@adaptiveworx/iac-schemas";

REGIONS.aws.aliases.use1; // "us-east-1", typed as the literal
const code: AwsRegionCode = "usw2";

REGIONS (src/regions.ts) is the single source of region data; iac-core derives AwsRegion and AwsRegionSchema from it. config/regions.json is the same data as JSON, kept equal by a unit test.

Standard tag keys

import { STANDARD_TAG_KEYS } from "@adaptiveworx/iac-schemas";
// Environment, Tenant, AccountPurpose, StackPurpose, TargetEnvironment,
// Workload, ManagedBy, Description

Workload names the workload a resource belongs to (flow, ztna, …; shared for shared infrastructure). Permission boundaries and ABAC conditions scope access by it.

Direct JSON import

For tools that prefer raw JSON (e.g. JSON Schema validators, build pipelines):

import regions from "@adaptiveworx/iac-schemas/regions" with { type: "json" };

What ships

PathContents
dist/index.js + dist/index.d.tsLibrary entry: regions, REGIONS, AWS region code/name lists and types, STANDARD_TAG_KEYS
config/regions.jsonRegion alias data (also accessible via ./regions subpath)

The pre-generated JSON Schemas / OpenAPI / types.d.ts under generated/ were removed in 0.2: nothing consumed them and they had gone stale. For JSON Schema, use zod 4's z.toJSONSchema() on iac-core's schemas directly.

Stability

This is a 0.x release. The shape of regions.* may change in backwards-incompatible ways before 1.0. Once 1.0 ships, the package will follow Semantic Versioning.

Region aliases (use1, usw2, etc.) are considered stable identifiers and won't be renamed; new ones may be added.

License

Apache 2.0. See NOTICE.

Repository + contributing

This package is developed in the AdaptiveWorX/iac-worx monorepo at libs/iac/schemas/. See CONTRIBUTING.md for setup, workflow conventions, and the release process. File issues at https://github.com/AdaptiveWorX/iac-worx/issues.

版本与发布记录

@adaptiveworx/iac-schemas 共发布 7 个版本,首次发布于 2026/04/29;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.6latest2026/10/041 个月前
0.1.52026/10/041 个月前
0.1.42026/05/135 个月前
0.1.32026/05/026 个月前
0.1.22026/05/026 个月前
0.1.12026/04/306 个月前

关于 @adaptiveworx/iac-schemas 的常见问题

@adaptiveworx/iac-schemas 是什么?

Region codes and names per provider, and the standard tag keys, for AdaptiveWorX™ infrastructure-as-code. Pure data + types — no runtime dependencies.

如何安装 @adaptiveworx/iac-schemas?

在项目目录运行 npm install @adaptiveworx/iac-schemas,或使用 pnpm add / yarn add / bun add。

@adaptiveworx/iac-schemas 支持 TypeScript 吗?

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

@adaptiveworx/iac-schemas 支持 ESM 还是 CommonJS?

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

@adaptiveworx/iac-schemas 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=26.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@adaptiveworx/iac-schemas 可以商用吗?

@adaptiveworx/iac-schemas 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@adaptiveworx/iac-schemas 的下载量有多少?

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

@adaptiveworx/iac-schemas 还在维护吗?

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