@faiber/faiber-gis

中文文档
2.7.0发布于 2026/11/05TypeScriptES Module近 30 天下载 3184

Typed GIS client for datasets, GeoJSON edits, map publication, vector tiles, area imports, private places, the public place catalog, moderation and the integration outbox.

原始使用文档

@faiber/faiber-gis

Typed GIS client for datasets, GeoJSON edits, map publication, vector tiles, area imports, private places, the public place catalog, moderation and the integration outbox.

npm install @faiber/faiber-gis @faiber/sdk-core
import { FaiberClient } from "@faiber/sdk-core";
import { GisApi } from "@faiber/faiber-gis";

const gis = new GisApi(new FaiberClient("gis", {
  domains: { gis: "https://gis.your-project.example" },
  axios: { withCredentials: true, timeout: 15_000 },
}));
const controller = new AbortController();
const response = await gis.operations.createDataset({
  name: "My map", attribution: "Original survey", license: "CC-BY-4.0",
  source: "Reviewed survey", scope: "user",
}, { signal: controller.signal });
console.log(response.status, response.data.data.id);

The browser needs an existing secure IDP cookie session and an origin allowed by the GIS deployment. GIS validates the session and checks the exact origin for cookie-authenticated mutations. A generic end-user Bearer token is not a substitute for this GIS identity flow. Trusted BFF credentials belong only on the server and must never be shipped to a browser. Public map and tile endpoints can be called without a session.

Every method returns the full Axios response, including status and headers, and accepts Axios request options. Cancellation rejects with Axios cancellation behavior; HTTP and transport failures reject with AxiosError. Authentication failures return401, permission/origin failures403, inaccessible resources commonly404, stale revisions409 and unavailable dependencies503. Inspect error.response when present; a network failure may have no response.

Feature geometry uses the six native GeoJSON types (Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon); the server checks coordinate ranges, batch sizes and PostGIS topology. Map styles expose typed sources, layers, light, center and zoom; paint/filter expressions retain JSON values. Coordinates use longitude then latitude; bbox values are west,south,east,north. Revision-checked mutations require expected_revision from the latest resource. Dataset publication and map publication are separate: a public map also requires a published, public dataset. Personal places remain private.

tile and publicTile return ArrayBuffer bytes while preserving headers. Import submission returns a queued job, not a completed or published dataset. Imports require the server's organization-specific authority configuration; missing configuration returns503. Submission and retry enforce a two-active-job limit per owner, returning429 when exceeded. imports() returns at most100 newest visible jobs; it has no pagination and omits the private lease token. Retry accepts only an owned failed current-protocol job and rechecks current authority and its original issuer binding.

Place assertions link an existing place to a social author; they do not transfer ownership. Outbox reads and acknowledgements require the dedicated integration permission.

For the complete client, install @faiber/faiber-ts-sdk and use sdk.gis. The published package's provenance.json identifies its supported backend source; deployment compatibility still depends on the project's service versions.

版本与发布记录

@faiber/faiber-gis 共发布 16 个版本,首次发布于 2026/10/21;过去 12 个月发布了 16 个版本。

版本发布日期距今
2.7.0latest2026/11/059 天前
2.6.02026/11/049 天前
2.5.02026/11/049 天前
2.4.02026/11/0310 天前
2.3.02026/11/0211 天前
2.2.02026/11/0212 天前

关于 @faiber/faiber-gis 的常见问题

@faiber/faiber-gis 是什么?

Typed GIS client for datasets, GeoJSON edits, map publication, vector tiles, area imports, private places, the public place catalog, moderation and the integration outbox.

如何安装 @faiber/faiber-gis?

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

@faiber/faiber-gis 支持 TypeScript 吗?

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

@faiber/faiber-gis 支持 ESM 还是 CommonJS?

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

@faiber/faiber-gis 可以商用吗?

@faiber/faiber-gis 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@faiber/faiber-gis 的下载量有多少?

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

@faiber/faiber-gis 还在维护吗?

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