@eintrek/erp-shell 0.1.38 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +111 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +112 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/plan-features.d.ts +25 -0
- package/dist/navigation/app-registry.d.ts +19 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan feature keys (billable entitlements). Mirror of platform-apis plan.go.
|
|
3
|
+
*
|
|
4
|
+
* This lives in the shell because every app gates on the same keys, and five
|
|
5
|
+
* private copies of the same list drift: the app-switcher list did exactly
|
|
6
|
+
* that before it moved here.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PLAN_FEATURES: {
|
|
9
|
+
readonly ORG_CHART: "org_chart";
|
|
10
|
+
readonly APPROVAL_WORKFLOW: "approval_workflow";
|
|
11
|
+
readonly API_ACCESS: "api_access";
|
|
12
|
+
readonly SSO: "sso";
|
|
13
|
+
readonly BASIC_ACCOUNTING_HR: "basic_accounting_hr";
|
|
14
|
+
readonly MODULE_PLATFORM: "module.platform";
|
|
15
|
+
readonly MODULE_HR: "module.hr";
|
|
16
|
+
readonly MODULE_ACCOUNTING: "module.accounting";
|
|
17
|
+
readonly MODULE_SALES: "module.sales";
|
|
18
|
+
readonly MODULE_PURCHASING: "module.purchasing";
|
|
19
|
+
readonly MODULE_INVENTORY: "module.inventory";
|
|
20
|
+
readonly MODULE_PROJECT: "module.project";
|
|
21
|
+
readonly MODULE_SECRETARIAT: "module.secretariat";
|
|
22
|
+
};
|
|
23
|
+
export type PlanFeatureKey = (typeof PLAN_FEATURES)[keyof typeof PLAN_FEATURES];
|
|
24
|
+
/** True when plan features include key (with legacy basic_accounting_hr alias). */
|
|
25
|
+
export declare function hasPlanFeature(features: string[] | null | undefined, feature: string): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { NavUserSystemLink } from "./nav-user";
|
|
2
|
+
/** The apps a signed-in user can jump between from the "แอปพลิเคชัน" menu. */
|
|
3
|
+
export type ErpAppId = "platform" | "accounx" | "invenx" | "plannex" | "peoplx";
|
|
4
|
+
export interface BuildSystemLinksOptions {
|
|
5
|
+
/** Organisation code from the route. Without it there is nowhere to link to. */
|
|
6
|
+
orgCode?: string | null;
|
|
7
|
+
/** The app calling this — always listed, marked active, never plan-gated. */
|
|
8
|
+
activeApp: ErpAppId;
|
|
9
|
+
/** Plan features for the current org, as returned by the subscription API. */
|
|
10
|
+
features?: string[] | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Builds the cross-app link list for <NavUser systemLinks>.
|
|
14
|
+
*
|
|
15
|
+
* The current app is always present even when the org's plan no longer covers
|
|
16
|
+
* it — the user is looking at it, so hiding the link would only make the menu
|
|
17
|
+
* disagree with the screen.
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildSystemLinks({ orgCode, activeApp, features, }: BuildSystemLinksOptions): NavUserSystemLink[];
|