@gp2f/server 0.1.3 → 0.1.5

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.
Binary file
package/index.d.ts CHANGED
@@ -0,0 +1,29 @@
1
+ // Auto-resolve library typings for GP2F
2
+
3
+ export interface PolicyNode {
4
+ kind: string;
5
+ path?: string;
6
+ value?: string;
7
+ children?: PolicyNode[];
8
+ }
9
+
10
+ export interface ActivityConfig {
11
+ policy: PolicyNode;
12
+ }
13
+
14
+ export class JsGp2FServer {
15
+ constructor(config: { port: number });
16
+ register(workflow: JsWorkflow): void;
17
+ start(): Promise<void>;
18
+ }
19
+
20
+ export class JsWorkflow {
21
+ constructor(id: string);
22
+ addActivity(
23
+ name: string,
24
+ config: ActivityConfig,
25
+ handler: (ctx: any) => Promise<void>
26
+ ): void;
27
+ activityCount(): number;
28
+ id(): string;
29
+ }
package/index.js CHANGED
@@ -38,4 +38,14 @@ function loadNative() {
38
38
  )
39
39
  }
40
40
 
41
- module.exports = loadNative()
41
+ const nativeAddon = loadNative()
42
+
43
+ module.exports = nativeAddon
44
+
45
+ // Explicitly assign named exports so Node.js CJS-ESM bridge can statically analyze them
46
+ module.exports.JsGp2FServer = nativeAddon.JsGp2FServer
47
+ module.exports.JsWorkflow = nativeAddon.JsWorkflow
48
+ module.exports.NodeKind = nativeAddon.NodeKind
49
+ module.exports.JsServerConfig = nativeAddon.JsServerConfig
50
+ module.exports.JsActivityConfig = nativeAddon.JsActivityConfig
51
+ module.exports.JsAstNode = nativeAddon.JsAstNode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gp2f/server",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Native Node.js bindings for the GP2F policy engine – powered by napi-rs",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -10,8 +10,8 @@
10
10
  "gp2f_node.*.node"
11
11
  ],
12
12
  "scripts": {
13
- "build": "napi build --platform --release",
14
- "build:debug": "napi build --platform",
13
+ "build": "napi build --platform --release --dts .napi-empty.d.ts",
14
+ "build:debug": "napi build --platform --dts .napi-empty.d.ts",
15
15
  "artifacts": "napi artifacts",
16
16
  "test": "jest --passWithNoTests"
17
17
  },