@arch-cadre/modules 0.0.54 → 0.0.56

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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@arch-cadre/modules",
3
- "version": "0.0.54",
3
+ "version": "0.0.56",
4
4
  "description": "Core Modules for Kryo framework",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.mjs",
8
- "types": "./dist/index.d.ts",
8
+ "types": "./dist/index.d.cts",
9
9
  "exports": {
10
10
  ".": {
11
11
  "import": "./dist/index.mjs",
@@ -26,15 +26,15 @@
26
26
  "switch:prod": "node scripts/switchToDist.js",
27
27
  "release": "npm publish --access public --no-git-checks",
28
28
  "dev": "tsdown --watch",
29
- "build": "unbuild"
29
+ "build": "tsdown"
30
30
  },
31
31
  "dependencies": {
32
- "@arch-cadre/core": "^0.0.28",
32
+ "@arch-cadre/core": "^0.0.30",
33
33
  "server-only": "^0.0.1",
34
34
  "zod": "^4.1.12"
35
35
  },
36
36
  "peerDependencies": {
37
- "@arch-cadre/core": "^0.0.28",
37
+ "@arch-cadre/core": "^0.0.30",
38
38
  "drizzle-orm": "1.0.0-beta.6-4414a19",
39
39
  "next": ">=15.0.0",
40
40
  "react": "^19.0.0",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "unbuild": "^3.6.1",
45
- "@arch-cadre/core": "^0.0.28",
45
+ "@arch-cadre/core": "^0.0.30",
46
46
  "@types/react": "^19",
47
47
  "@types/react-dom": "^19",
48
48
  "tsdown": "^0.20.3",
@@ -1,10 +0,0 @@
1
- import * as React from "react";
2
- interface ExtensionPointProps {
3
- module: string;
4
- point: string;
5
- className?: string;
6
- props?: any;
7
- fallback?: React.ReactNode;
8
- }
9
- export declare function ExtensionPointClient({ module, point, className, props, fallback, }: ExtensionPointProps): any;
10
- export {};
@@ -1,9 +0,0 @@
1
- interface ExtensionPointProps {
2
- module: string;
3
- point: string;
4
- className?: string;
5
- props?: any;
6
- fallback?: React.ReactNode;
7
- }
8
- export declare function ExtensionPoint({ module, point, className, props, fallback, }: ExtensionPointProps): Promise<string | number | bigint | boolean | Iterable<import("react").ReactNode> | import("react").JSX.Element | null | undefined>;
9
- export {};
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _extensionPoint = require("./extension-point.cjs");
7
- Object.keys(_extensionPoint).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _extensionPoint[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _extensionPoint[key];
14
- }
15
- });
16
- });
17
- var _extensionPointClient = require("./extension-point-client.cjs");
18
- Object.keys(_extensionPointClient).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _extensionPointClient[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _extensionPointClient[key];
25
- }
26
- });
27
- });
28
- var _widgetArea = require("./widget-area.cjs");
29
- Object.keys(_widgetArea).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _widgetArea[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _widgetArea[key];
36
- }
37
- });
38
- });
@@ -1,3 +0,0 @@
1
- export * from "./extension-point";
2
- export * from "./extension-point-client";
3
- export * from "./widget-area";
@@ -1,3 +0,0 @@
1
- export * from "./extension-point.mjs";
2
- export * from "./extension-point-client.mjs";
3
- export * from "./widget-area.mjs";
@@ -1,9 +0,0 @@
1
- import * as React from "react";
2
- interface WidgetAreaProps {
3
- area: string;
4
- className?: string;
5
- fallback?: React.ReactNode;
6
- props?: any;
7
- }
8
- export declare function WidgetArea({ area, className, fallback, props, }: WidgetAreaProps): Promise<string | number | bigint | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined>;
9
- export {};
package/dist/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export { ExtensionPoint } from "./client/extension-point";
2
- export { ExtensionPointClient } from "./client/extension-point-client";
3
- export { WidgetArea } from "./client/widget-area";
4
- export * from "./types";
@@ -1,5 +0,0 @@
1
- export declare function pushModuleSchema(moduleId: string): Promise<void>;
2
- export declare function toggleModuleState(moduleId: string, isEnabled: boolean): Promise<{
3
- success: boolean;
4
- }>;
5
- export declare function initOperationalModules(): Promise<void>;
@@ -1,12 +0,0 @@
1
- import { type IModule } from "../types";
2
- export declare function registerModules(modules: IModule[]): Promise<void>;
3
- export declare function getModules(): Promise<any[]>;
4
- export declare function getModuleStatus(moduleId: string): Promise<{
5
- enabled: any;
6
- installed: any;
7
- lastStep: any;
8
- }>;
9
- export declare function isModuleEnabled(moduleId: string): Promise<boolean>;
10
- export declare function getModuleInstance(moduleId: string): Promise<IModule | null>;
11
- export declare function getModuleConfig<T>(moduleId: string): Promise<T | null>;
12
- export declare function updateModuleConfig(moduleId: string, config: any): Promise<void>;
@@ -1 +0,0 @@
1
- export declare function initModules(force?: boolean): Promise<void>;
@@ -1,12 +0,0 @@
1
- import type { ApiRouteDefinition, ModuleExtension, ModuleNavElement, ModuleWidget, PrivateRouteDefinition, PublicRouteDefinition } from "../types";
2
- export declare function getModuleNavigationGrouped(type: "admin" | "settings"): Promise<Record<string, ModuleNavElement[]>>;
3
- export declare function getKryoPathPrefix(): Promise<string>;
4
- export declare function getKryoModuleNavigationGrouped(type: "admin" | "settings"): Promise<Record<string, ModuleNavElement[]>>;
5
- export declare function getModuleNavigation(type: "public"): Promise<ModuleNavElement[]>;
6
- export declare function getPublicModuleRoutes(): Promise<PublicRouteDefinition[]>;
7
- export declare function getPrivateModuleRoutes(): Promise<PrivateRouteDefinition[]>;
8
- export declare function getKryoModuleRoutes(): Promise<PrivateRouteDefinition[]>;
9
- export declare function getApiModuleRoutes(): Promise<ApiRouteDefinition[]>;
10
- export declare function getModuleWidgets(area: string): Promise<ModuleWidget[]>;
11
- export declare function getExtensions(targetModule: string, point?: string): Promise<ModuleExtension[]>;
12
- export declare function hasExtension(targetModule: string, point?: string): Promise<boolean>;
package/dist/server.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from "./server/lifecycle";
2
- export * from "./server/manage";
3
- export * from "./server/registry";
4
- export * from "./server/ui";
5
- export * from "./types";
package/dist/types.d.ts DELETED
@@ -1,113 +0,0 @@
1
- import type { SystemEvent, UserPermission, UserRole } from "@arch-cadre/core";
2
- export type { SystemEvent };
3
- import type { Metadata } from "next";
4
- import { z } from "zod";
5
- export type SidebarGroupType = {
6
- title: string;
7
- items: SidebarMenuType;
8
- };
9
- export type SidebarMenuItemType<T = Record<string, string>> = {
10
- id?: string;
11
- title: string;
12
- icon?: string;
13
- url: string;
14
- roles?: string[];
15
- permissions?: string[];
16
- badge?: string | number | null | undefined;
17
- badgeVariant?: "default" | "secondary" | "destructive" | "outline" | null | undefined;
18
- } & T;
19
- export type SidebarMenuType = SidebarMenuItemType<{
20
- items?: SidebarMenuItemType[];
21
- }>[];
22
- export declare const ModuleManifestSchema: z.ZodObject<{
23
- id: z.ZodString;
24
- name: z.ZodString;
25
- version: z.ZodString;
26
- description: z.ZodOptional<z.ZodString>;
27
- dependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
28
- extends: z.ZodDefault<z.ZodArray<z.ZodString>>;
29
- enabled: z.ZodDefault<z.ZodBoolean>;
30
- system: z.ZodDefault<z.ZodBoolean>;
31
- npmDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
32
- npmDevDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
- }, z.core.$strip>;
34
- export type ModuleManifest = z.infer<typeof ModuleManifestSchema>;
35
- export interface ModuleExtension {
36
- id: string;
37
- targetModule: string;
38
- point: string;
39
- component: React.ComponentType<any>;
40
- priority?: number;
41
- metadata?: any;
42
- }
43
- export interface ModulePageProps {
44
- params: any;
45
- searchParams: any;
46
- }
47
- export interface ModuleRouteDefinition {
48
- id?: string;
49
- roles?: UserRole[];
50
- permissions?: UserPermission[];
51
- component: React.ComponentType<any>;
52
- layout?: React.ComponentType<{
53
- children: React.ReactNode;
54
- }>;
55
- generateMetadata?: (props: ModulePageProps) => Promise<Metadata> | Metadata;
56
- }
57
- export interface ModuleWidget {
58
- id: string;
59
- name: string;
60
- area: "dashboard-stats" | "dashboard-main" | "sidebar-bottom" | string;
61
- component: React.ComponentType<any>;
62
- priority?: number;
63
- }
64
- export interface IModule {
65
- manifest: ModuleManifest;
66
- schema?: any;
67
- onMigrate?: () => Promise<void>;
68
- onEnable?: () => Promise<void>;
69
- onDisable?: () => Promise<void>;
70
- init?: () => Promise<void>;
71
- widgets?: ModuleWidget[];
72
- extensions?: ModuleExtension[];
73
- navigation?: ModuleNavigation;
74
- routes?: {
75
- public?: PublicRouteDefinition[];
76
- private?: PrivateRouteDefinition[];
77
- api?: ApiRouteDefinition[];
78
- };
79
- }
80
- /**
81
- * Element menu zarejestrowany przez moduł.
82
- */
83
- export type ModuleNavElement = SidebarMenuItemType<{
84
- items?: SidebarMenuItemType[];
85
- }>;
86
- /**
87
- * Mapa nawigacji modułu.
88
- * Klucz: Nazwa grupy (np. "CMS", "Platform", "Journal")
89
- * Vartość: Tablica elementów menu trafiających do tej grupy.
90
- */
91
- export type ModuleNavigationGroupMap = Record<string, ModuleNavElement[]>;
92
- export interface PublicRouteDefinition extends ModuleRouteDefinition {
93
- path: string;
94
- auth?: boolean;
95
- }
96
- export interface PrivateRouteDefinition extends ModuleRouteDefinition {
97
- path: string;
98
- auth?: boolean;
99
- }
100
- export interface ApiRouteDefinition {
101
- id?: string;
102
- path: string;
103
- handler: (request: Request, context: any) => Promise<Response> | Response;
104
- auth?: boolean;
105
- roles?: UserRole[];
106
- permissions?: UserPermission[];
107
- }
108
- export interface ModuleNavigation {
109
- public?: ModuleNavElement[];
110
- admin?: ModuleNavigationGroupMap;
111
- settings?: ModuleNavigationGroupMap;
112
- globalRoutes?: (PublicRouteDefinition | PrivateRouteDefinition | ApiRouteDefinition)[];
113
- }