@xxmachina/common 19.140.3 → 19.144.4

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.
@@ -30,7 +30,6 @@ class QuickJsService {
30
30
  allowFs: false,
31
31
  allowFetch: false,
32
32
  }).then((result) => {
33
- console.debug('[QuickJsService] result:', result);
34
33
  if (result.ok)
35
34
  return result.data;
36
35
  const error = result.error;
@@ -40,6 +39,24 @@ class QuickJsService {
40
39
  throw new Error(errorMessage);
41
40
  });
42
41
  }
42
+ async applyWithDebug(script, functionName, args = []) {
43
+ const safeArgs = encodeURIComponent(JSON.stringify(args));
44
+ const normalized = script.replace(/export\s+default\s+/, 'const __default__ = ');
45
+ const wrapped = `
46
+ const __debug__ = [];
47
+ const debug = (...a) => { __debug__.push(a.length === 1 ? a[0] : a); };
48
+
49
+ ${normalized}
50
+
51
+ const fn = typeof __default__ !== 'undefined' ? __default__
52
+ : (typeof ${functionName} !== 'undefined' ? ${functionName}
53
+ : (typeof transformer !== 'undefined' ? transformer : transform));
54
+ const args = JSON.parse(decodeURIComponent("${safeArgs}"));
55
+ export default { value: fn(...args), debug: __debug__ };
56
+ `;
57
+ const result = (await this.execute(wrapped));
58
+ return { value: result?.value, debug: result?.debug ?? [] };
59
+ }
43
60
  async apply(script, functionName, args = []) {
44
61
  const safeArgs = encodeURIComponent(JSON.stringify(args));
45
62
  const scriptWithFunction = `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xxmachina/common",
3
- "version": "19.140.3",
3
+ "version": "19.144.4",
4
4
  "license": "MIT",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -13,11 +13,11 @@
13
13
  "@nestjs/common": "10.2.8",
14
14
  "@nestjs/graphql": "^11.0.0",
15
15
  "@nestjs/passport": "^9.0.3",
16
- "@ng-atomic/common": "19.140.3",
17
- "@ng-atomic/components": "19.140.3",
18
- "@ng-atomic/core": "19.140.3",
19
- "@nx-ddd/common": "19.140.3",
20
- "@nx-ddd/core": "19.140.3",
16
+ "@ng-atomic/common": "19.144.4",
17
+ "@ng-atomic/components": "19.144.4",
18
+ "@ng-atomic/core": "19.144.4",
19
+ "@nx-ddd/common": "19.144.4",
20
+ "@nx-ddd/core": "19.144.4",
21
21
  "@tfarras/nestjs-firebase-auth": "^2.0.0",
22
22
  "apollo-angular": "^7.0.2",
23
23
  "class-transformer": "^0.5.1",
@@ -43,11 +43,11 @@
43
43
  "validate-azure-ad-token": "^2.2.0"
44
44
  },
45
45
  "optionalDependencies": {
46
- "@nx-ddd/any-func": "19.140.3",
47
- "@nx-ddd/firestore": "19.140.3",
48
- "@nx-ddd/google": "19.140.3",
49
- "@nx-ddd/hasura": "19.140.3",
50
- "@nx-ddd/notion": "19.140.3",
46
+ "@nx-ddd/any-func": "19.144.4",
47
+ "@nx-ddd/firestore": "19.144.4",
48
+ "@nx-ddd/google": "19.144.4",
49
+ "@nx-ddd/hasura": "19.144.4",
50
+ "@nx-ddd/notion": "19.144.4",
51
51
  "@notionhq/client": "^2.2.15"
52
52
  },
53
53
  "dependencies": {
@@ -15,6 +15,7 @@ interface PresenterInput<T = unknown> {
15
15
  timestamp: Date;
16
16
  executionTime: number;
17
17
  totalWritten?: number;
18
+ mirror?: unknown;
18
19
  };
19
20
  data: T;
20
21
  options?: Record<string, unknown>;
@@ -23,6 +24,8 @@ interface TerminalPresenterData {
23
24
  content: string;
24
25
  ansiEnabled?: boolean;
25
26
  totalWritten?: number;
27
+ ptyCols?: number;
28
+ ptyRows?: number;
26
29
  }
27
30
  interface DiffPresenterData {
28
31
  before: string;
@@ -74,7 +77,8 @@ interface IPresenterDefinition<TData = unknown> {
74
77
  readonly icon: string;
75
78
  readonly description: string;
76
79
  readonly inputSchema: JSONSchema;
77
- canPresent(data: unknown): boolean;
80
+ readonly fragment: string;
81
+ readonly operation?: 'query' | 'subscription';
78
82
  readonly component: Type<any>;
79
83
  }
80
84
 
@@ -223,6 +223,7 @@ interface PresenterInput<T = unknown> {
223
223
  timestamp: Date;
224
224
  executionTime: number;
225
225
  totalWritten?: number;
226
+ mirror?: unknown;
226
227
  };
227
228
  data: T;
228
229
  options?: Record<string, unknown>;
@@ -231,6 +232,8 @@ interface TerminalPresenterData {
231
232
  content: string;
232
233
  ansiEnabled?: boolean;
233
234
  totalWritten?: number;
235
+ ptyCols?: number;
236
+ ptyRows?: number;
234
237
  }
235
238
  interface DiffPresenterData {
236
239
  before: string;
@@ -282,7 +285,8 @@ interface IPresenterDefinition<TData = unknown> {
282
285
  readonly icon: string;
283
286
  readonly description: string;
284
287
  readonly inputSchema: JSONSchema;
285
- canPresent(data: unknown): boolean;
288
+ readonly fragment: string;
289
+ readonly operation?: 'query' | 'subscription';
286
290
  readonly component: Type<any>;
287
291
  }
288
292
 
@@ -12,6 +12,10 @@ declare class QuickJsService {
12
12
  protected loadQuickJs(): Promise<QuickJs>;
13
13
  private doLoadQuickJs;
14
14
  execute(script: string): Promise<unknown>;
15
+ applyWithDebug(script: string, functionName: any, args?: any[]): Promise<{
16
+ value: any;
17
+ debug: any[];
18
+ }>;
15
19
  apply(script: string, functionName: any, args?: any[]): Promise<unknown>;
16
20
  static ɵfac: i0.ɵɵFactoryDeclaration<QuickJsService, never>;
17
21
  static ɵprov: i0.ɵɵInjectableDeclaration<QuickJsService>;