@beredo/ngx-ion-client

中文文档
22.2.4发布于 2026/10/29TypeScriptES Module近 30 天下载 3116

This Angular library simplifies API communication with Infor M3 and Infor ION, providing utility methods for managing transactions, user context, and CSRF tokens. It abstracts common functionalities such as parameter handling, context management, and erro

原始使用文档
文档目录7 节
  1. Features
  2. Installation
  3. Add HttpClientModule to providers
  4. Import the library
  5. Making a basic m3 call
  6. User context
  7. Opening Experience Designer apps

Angular HTTP Library for Infor M3/Infor ION

This Angular library simplifies API communication with Infor M3 and Infor ION, providing utility methods for managing transactions, user context, and CSRF tokens. It abstracts common functionalities such as parameter handling, context management, and error handling to streamline API integrations.


Features

  • M3 V2 API: Supports M3 v2 endpoints.
  • M3 Bulk API: M3 Bulk API support.
  • Drop in replacement for odin: The project has a goal that migration from odin should be as simple as possible.

Installation

To install the library, add it to your Angular project:

npm install @beredo/ngx-ion-client

Getting started

Add HttpClientModule to providers

If using stand alone components, this can also be configured in the component.

Either in your app.module.ts

...
import { HttpClientModule } from '@angular/common/http';
...
@NgModule({
  ...
  providers: [
    ...
    HttpClientModule
    ...
  ]
  ...

Or in your app.config.ts

...
import { provideHttpClient } from '@angular/common/http';
export const appConfig: ApplicationConfig = {
  providers: [
    ....
    provideHttpClient(),
    ...
  ],
};

Import the library

import { HttpClientModule } from '@angular/common/http';
import { MIService, UserService } from '@beredo/ngx-ion-client';


@NgModule({
imports: [
HttpClientModule,
// Other imports
],
providers: [MIService, UserService],
})
export class AppModule {}

Using the library

Making a basic m3 call

To make a simple API call, import the service and use the execute or executeV2 methods

import { Component } from '@angular/core';
import { MIService } from "@beredo/ngx-ion-client";

@Component({
  selector: 'app-transaction',
  template: `<pre>{{ transactionResult | json }}</pre>`,
})
export class TransactionComponent {
  transactionResult: any;

  constructor(private miService: MIService) {
    this.miService
      .execute({
        program: 'MMS001MI',
        transaction: 'LstItems',
        record: { ITNO: 'ITEM001' },
      })
      .subscribe(
        (result) => {
          this.transactionResult = result;
        },
        (error) => {
          console.error('Transaction error', error);
        }
      );
  }
}

Or with V2 API

import { Component } from '@angular/core';
import { MIService } from "@beredo/ngx-ion-client";

@Component({
  selector: 'app-transaction',
  template: `<pre>{{ transactionResult | json }}</pre>`,
})
export class TransactionComponent {
  transactionResult: any;

  constructor(private miService: MIService) {
        return this.miService.executeV2<
      GetHeadInputs,
      GetHeadOutputs
    >({
      program: "OIS100MI",
      transaction: "GetHead",
      records: params,
    });
  }
}


User context

User context uses MNS150MI when developing locally.

import { Component, OnInit } from '@angular/core';
import { UserService, UserContext } from "@beredo/ngx-ion-client";

@Component({
  selector: 'app-user-context',
  template: `<pre>{{ userContext | json }}</pre>`,
})
export class UserContextComponent implements OnInit {
  userContext: UserContext | undefined;

  constructor(private userService: UserService) {}

  ngOnInit() {
    this.userService.getUserContext().subscribe((context) => {
      this.userContext = context;
    });
  }
}

Opening Experience Designer apps

EdaLauncherService opens an Experience Designer app (EDA) in H5. shortName is the app's Short name in Experience Designer Administration (not its display Name). Each parameter key is one of the app's component display ids and a field id, as Component.Field; empty values are left out and the rest are URI-encoded.

import { Component, inject } from '@angular/core';
import { EdaLauncherService } from "@beredo/ngx-ion-client";

@Component({
  selector: 'app-customer-link',
  template: `<button (click)="open('10001')">Customer info</button>`,
})
export class CustomerLinkComponent {
  private eda = inject(EdaLauncherService);

  open(cuno: string) {
    // mp://CUSTINFO?title=Customer%20info&IndexList_Customers.CUNO=10001
    this.eda.launch({
      shortName: 'CUSTINFO',
      title: 'Customer info',
      params: { 'IndexList_Customers.CUNO': cuno },
    });
  }
}

edaLink(...) returns the same link without opening it, and launchLink('mp://...') opens a link kept elsewhere.

Licensing

This library is only for non-commercial use. If you want to use this in a commercial project you can contact us to discuss licensing.

版本与发布记录

@beredo/ngx-ion-client 共发布 89 个版本,首次发布于 2025/05/28;过去 12 个月发布了 72 个版本。

版本发布日期距今
22.2.4latest2026/10/2910 天前
20.4.32026/10/2712 天前
18.4.32026/10/2712 天前
19.5.32026/10/2712 天前
21.5.32026/10/2712 天前
18.4.22026/10/2612 天前

关于 @beredo/ngx-ion-client 的常见问题

@beredo/ngx-ion-client 是什么?

This Angular library simplifies API communication with Infor M3 and Infor ION, providing utility methods for managing transactions, user context, and CSRF tokens. It abstracts common functionalities such as parameter handling, context management, and erro

如何安装 @beredo/ngx-ion-client?

在项目目录运行 npm install @beredo/ngx-ion-client,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@angular/core(~22.x)、@angular/common(~22.x)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@beredo/ngx-ion-client 支持 TypeScript 吗?

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

@beredo/ngx-ion-client 支持 ESM 还是 CommonJS?

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

@beredo/ngx-ion-client 可以商用吗?

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

@beredo/ngx-ion-client 的下载量有多少?

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

@beredo/ngx-ion-client 还在维护吗?

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