@meshmakers/octo-services

中文文档
3.5.550发布于 2026/11/02TypeScriptES Module

Angular library providing services for interacting with OctoMesh backend APIs.

原始使用文档
文档目录13 节
  1. Features
  2. Build & Test
  3. Architecture
  4. Services
  5. HTTP Services
  6. GraphQL Services
  7. Quick Start
  8. 1. Implement Configuration Service
  9. 2. Register Providers
  10. 3. Use Services
  11. Detailed Documentation
  12. Dependencies
  13. Documentation and Testing Standards

@meshmakers/octo-services

Angular library providing services for interacting with OctoMesh backend APIs.

Part of the @meshmakers package ecosystem.

Features

  • HTTP Services - REST API clients for Asset Repository, Identity Service, Bot Service, Communication Controller
  • GraphQL Services - Construction Kit queries for types, attributes, and models
  • Job Management - Background job execution with progress tracking
  • TUS Upload - Resumable file uploads for large database restores
  • Error Handling - Apollo Link for GraphQL error handling with user notifications

Build & Test

# Build
npm run build:octo-services

# Lint
npm run lint:octo-services

# Run tests
npm run test:octo-services

Architecture

octo-services/
├── src/
│   ├── public-api.ts
│   └── lib/
│       ├── services/
│       │   ├── health.service.ts            # Backend health checks
│       │   ├── asset-repo.service.ts        # Tenant and model management
│       │   ├── identity-service.ts          # User, role, client management
│       │   ├── bot-service.ts               # Background job execution
│       │   ├── job-management.service.ts    # Job progress tracking with UI
│       │   ├── communication.service.ts     # Adapter and pipeline management
│       │   ├── tus-upload.service.ts        # Resumable file uploads (TUS)
│       │   ├── ck-type-selector.service.ts  # Query CK types (GraphQL)
│       │   ├── ck-type-attribute.service.ts # Query CK type attributes (GraphQL)
│       │   ├── ck-model.service.ts          # Check model availability (GraphQL)
│       │   ├── attribute-selector.service.ts # Query columns (GraphQL)
│       │   ├── configuration.service.ts     # Configuration injection token
│       │   └── tenant-provider.ts           # Tenant ID injection token
│       ├── graphQL/                         # GraphQL queries and generated types
│       ├── shared/                          # DTOs, models, and utilities
│       ├── options/                         # Configuration options
│       └── compat/                          # Backward compatibility exports

Services

HTTP Services

ServiceDescription
HealthServiceBackend health checks (Asset Repo, Identity, Bot, Communication, Mesh Adapter)
AssetRepoServiceTenant management, model import/export, user merging
IdentityServiceUser, role, and OAuth client management
BotServiceBackground job execution (fixup scripts, dump/restore)
JobManagementServiceJob progress tracking with UI dialogs
FileDownloadServiceAuthenticated blob downloads (bearer via authorizeInterceptor, real file name) for any BINARY_LINKED value or URL
FilesClientServiceFile bytes API of the platform file system (AB#6178/AB#6230): upload by path or folder rtId with progress, replace content, download/preview by path or rtId, zip, folder statistics, capabilities, problem-details codes
CommunicationServiceAdapter deployment, pipeline execution, and debugging
TusUploadServiceResumable file uploads via TUS protocol

GraphQL Services

ServiceDescription
CkTypeSelectorServiceQuery CK types with filtering, pagination, and derived types
CkTypeAttributeServiceQuery CK type and record attributes
CkModelServiceCheck model availability and versions
AttributeSelectorServiceQuery available query columns for a CK type

Quick Start

1. Implement Configuration Service

import { Injectable } from '@angular/core';
import { IConfigurationService, AddInConfiguration } from '@meshmakers/octo-services';

@Injectable({ providedIn: 'root' })
export class AppConfigurationService implements IConfigurationService {
  private _config: AddInConfiguration = {} as AddInConfiguration;

  get config(): AddInConfiguration {
    return this._config;
  }

  async loadConfigAsync(): Promise<void> {
    this._config = await fetch('/assets/config.json').then(r => r.json());
  }
}

2. Register Providers

import { CONFIGURATION_SERVICE } from '@meshmakers/octo-services';
import { AppConfigurationService } from './services/app-configuration.service';

export const appConfig: ApplicationConfig = {
  providers: [
    { provide: CONFIGURATION_SERVICE, useClass: AppConfigurationService }
  ]
};

3. Use Services

import { HealthService, CkTypeSelectorService } from '@meshmakers/octo-services';

@Component({ ... })
export class MyComponent {
  private readonly healthService = inject(HealthService);
  private readonly ckTypeSelector = inject(CkTypeSelectorService);

  async checkHealth(): Promise<void> {
    const health = await this.healthService.getAssetRepoServiceHealthAsync();
    console.log('Status:', health?.status);
  }

  loadTypes(): void {
    this.ckTypeSelector.getCkTypes({ searchText: 'Customer' })
      .subscribe(result => console.log('Types:', result.items));
  }
}

Detailed Documentation

See docs/README.md for complete API reference with all method signatures and usage examples.

See CLAUDE.md for development guidelines, CK ID types, GraphQL utilities, and testing patterns.

Dependencies

  • Angular 21 (core, common/http)
  • Apollo Angular (peer dependency, ^14.0.0)
  • @apollo/client (peer dependency, ^4.1.0 — the oldest 4.x line that has every API used here, so hosts on apollo-angular 14.1 / @apollo/client 4.1 keep installing; imported at runtime: InMemoryCache, ApolloLink, the error link)
  • graphql (peer dependency, ^16.0.0 || ^17.0.0 like apollo-angular / @apollo/client; only the DocumentNode type is imported, which the public API exposes)
  • tus-js-client (resumable uploads)
  • @meshmakers/shared-auth (AuthorizeService for TUS uploads)
  • @meshmakers/shared-services (MessageService, PagedResultDto)
  • @meshmakers/shared-ui (ProgressWindowService for job tracking)

Documentation and Testing Standards

  • All developer documentation must be written in English
  • Every code change must include updated documentation — update README.md, CLAUDE.md, docs/README.md, or inline docs when adding, modifying, or removing features
  • Unit tests and integration tests must be executed after every code change
  • Existing tests must be updated when the behavior of tested code changes
  • New tests must be added when new features, components, or services are implemented
  • Never commit code with failing tests

版本与发布记录

@meshmakers/octo-services 共发布 716 个版本,首次发布于 2022/11/14;过去 12 个月发布了 288 个版本。

版本发布日期距今
3.5.550latest2026/11/021 天前
3.5.5302026/11/012 天前
3.5.5202026/10/313 天前
3.5.5102026/10/303 天前
3.5.5002026/10/304 天前
3.5.4902026/10/304 天前

关于 @meshmakers/octo-services 的常见问题

@meshmakers/octo-services 是什么?

Angular库提供与OctoMesh后端api交互的服务。

如何安装 @meshmakers/octo-services?

在项目目录运行 npm install @meshmakers/octo-services,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:graphql(^16.0.0 || ^17.0.0)、@angular/core(^22.0.0)、tus-js-client(^4.3.1)、@apollo/client(^4.1.0)、apollo-angular(^14.0.0)、@angular/common(^22.0.0)、@meshmakers/shared-ui(*)、@meshmakers/shared-auth(*)、@meshmakers/shared-services(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@meshmakers/octo-services 支持 TypeScript 吗?

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

@meshmakers/octo-services 支持 ESM 还是 CommonJS?

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

@meshmakers/octo-services 可以商用吗?

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

@meshmakers/octo-services 还在维护吗?

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