@ai-appforge/core 1.0.0 → 1.0.1

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.
@@ -0,0 +1,22 @@
1
+ export declare class ActivityModule {
2
+ private request;
3
+ constructor(request: <T>(endpoint: string, options?: any) => Promise<T>);
4
+ list(userId: string): Promise<{
5
+ success: boolean;
6
+ data: any[];
7
+ }>;
8
+ getStats(userId: string): Promise<{
9
+ success: boolean;
10
+ data: {
11
+ stats: any;
12
+ recentActivity: any[];
13
+ };
14
+ }>;
15
+ getProjectActivity(projectId: string, options?: {
16
+ type?: string;
17
+ userId?: string;
18
+ }): Promise<{
19
+ success: boolean;
20
+ data: any[];
21
+ }>;
22
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActivityModule = void 0;
4
+ class ActivityModule {
5
+ constructor(request) {
6
+ this.request = request;
7
+ }
8
+ async list(userId) {
9
+ if (!userId)
10
+ throw new Error('userId is required');
11
+ return this.request(`/api/activity?userId=${encodeURIComponent(userId)}`, { method: 'GET' });
12
+ }
13
+ async getStats(userId) {
14
+ if (!userId)
15
+ throw new Error('userId is required');
16
+ return this.request(`/api/dashboard/stats?userId=${encodeURIComponent(userId)}`, { method: 'GET' });
17
+ }
18
+ async getProjectActivity(projectId, options) {
19
+ if (!projectId)
20
+ throw new Error('projectId is required');
21
+ const params = new URLSearchParams();
22
+ if (options?.type)
23
+ params.append('type', options.type);
24
+ if (options?.userId)
25
+ params.append('userId', options.userId);
26
+ const query = params.toString();
27
+ const endpoint = `/api/projects/${projectId}/activity-log${query ? `?${query}` : ''}`;
28
+ return this.request(endpoint, { method: 'GET' });
29
+ }
30
+ }
31
+ exports.ActivityModule = ActivityModule;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './types';
2
2
  export * from './workflows';
3
+ export * from './activity';
package/dist/index.js CHANGED
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./types"), exports);
18
18
  __exportStar(require("./workflows"), exports);
19
+ __exportStar(require("./activity"), exports);
package/dist/types.d.ts CHANGED
@@ -1,4 +1,7 @@
1
- import { Headers as FetchHeaders } from 'node-fetch';
1
+ export interface FetchHeaders {
2
+ get(name: string): string | null;
3
+ forEach(callback: (value: string, name: string, parent: any) => void): void;
4
+ }
2
5
  export interface Workflow {
3
6
  id: string;
4
7
  name: string;
@@ -82,8 +85,14 @@ export interface WaitingInput {
82
85
  workflow_id: string;
83
86
  node_id: string;
84
87
  user_id: string;
85
- status: 'waiting' | 'responded';
88
+ status: 'waiting' | 'responded' | 'completed';
89
+ prompt?: string;
90
+ config?: any;
86
91
  context: any;
92
+ response_data?: any;
93
+ workflows?: {
94
+ name: string;
95
+ };
87
96
  created_at: string;
88
97
  [key: string]: any;
89
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-appforge/core",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Core types and utilities for AI App Forge SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,4 +20,4 @@
20
20
  "ts-jest": "^29.4.6",
21
21
  "typescript": "^5.0.0"
22
22
  }
23
- }
23
+ }
@@ -0,0 +1,25 @@
1
+ export class ActivityModule {
2
+ constructor(private request: <T>(endpoint: string, options?: any) => Promise<T>) { }
3
+
4
+ async list(userId: string) {
5
+ if (!userId) throw new Error('userId is required');
6
+ return this.request<{ success: boolean; data: any[] }>(`/api/activity?userId=${encodeURIComponent(userId)}`, { method: 'GET' });
7
+ }
8
+
9
+ async getStats(userId: string) {
10
+ if (!userId) throw new Error('userId is required');
11
+ return this.request<{ success: boolean; data: { stats: any, recentActivity: any[] } }>(`/api/dashboard/stats?userId=${encodeURIComponent(userId)}`, { method: 'GET' });
12
+ }
13
+
14
+ async getProjectActivity(projectId: string, options?: { type?: string; userId?: string }) {
15
+ if (!projectId) throw new Error('projectId is required');
16
+ const params = new URLSearchParams();
17
+ if (options?.type) params.append('type', options.type);
18
+ if (options?.userId) params.append('userId', options.userId);
19
+
20
+ const query = params.toString();
21
+ const endpoint = `/api/projects/${projectId}/activity-log${query ? `?${query}` : ''}`;
22
+
23
+ return this.request<{ success: boolean; data: any[] }>(endpoint, { method: 'GET' });
24
+ }
25
+ }
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './types';
2
2
  export * from './workflows';
3
+ export * from './activity';
package/src/types.ts CHANGED
@@ -1,4 +1,8 @@
1
- import { Headers as FetchHeaders } from 'node-fetch';
1
+ // Minimal interface for headers compatibility across Node/RN/Browser
2
+ export interface FetchHeaders {
3
+ get(name: string): string | null;
4
+ forEach(callback: (value: string, name: string, parent: any) => void): void;
5
+ }
2
6
 
3
7
  export interface Workflow {
4
8
  id: string;
@@ -93,8 +97,14 @@ export interface WaitingInput {
93
97
  workflow_id: string;
94
98
  node_id: string;
95
99
  user_id: string;
96
- status: 'waiting' | 'responded';
100
+ status: 'waiting' | 'responded' | 'completed';
101
+ prompt?: string;
102
+ config?: any;
97
103
  context: any;
104
+ response_data?: any;
105
+ workflows?: {
106
+ name: string;
107
+ };
98
108
  created_at: string;
99
109
  [key: string]: any;
100
110
  }