@dappworks/kit 0.4.120 → 0.4.121

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.
Files changed (41) hide show
  1. package/dist/{PromiseState-b0cc408e.d.ts → PromiseState-yojg0WLR.d.ts} +3 -3
  2. package/dist/aiem.d.mts +7 -10
  3. package/dist/aiem.mjs +25 -27
  4. package/dist/aiem.mjs.map +1 -1
  5. package/dist/{chunk-WYGQ3Y4R.mjs → chunk-AIZ7XDNV.mjs} +14 -14
  6. package/dist/chunk-AIZ7XDNV.mjs.map +1 -0
  7. package/dist/{chunk-WT2ARRCR.mjs → chunk-HRYH37UI.mjs} +2 -2
  8. package/dist/{chunk-PPYYRQDD.mjs → chunk-QWHU3HBK.mjs} +2 -2
  9. package/dist/{chunk-6F7H4PAA.mjs → chunk-R4SQKVDQ.mjs} +1 -1
  10. package/dist/{chunk-7FF4BCFW.mjs → chunk-SVPD6PC6.mjs} +4 -4
  11. package/dist/{chunk-DZMNL4BZ.mjs → chunk-WS43BV7Y.mjs} +2 -2
  12. package/dist/{chunk-HRWHDF2F.mjs → chunk-XJMRAPHI.mjs} +7 -7
  13. package/dist/{chunk-HRWHDF2F.mjs.map → chunk-XJMRAPHI.mjs.map} +1 -1
  14. package/dist/dev.d.mts +1 -1
  15. package/dist/dev.mjs +2 -2
  16. package/dist/experimental.d.mts +2 -2
  17. package/dist/experimental.mjs +3 -3
  18. package/dist/form.d.mts +4 -4
  19. package/dist/form.mjs +4 -4
  20. package/dist/index.d.mts +4 -4
  21. package/dist/index.mjs +5 -5
  22. package/dist/inspector.d.mts +1 -1
  23. package/dist/inspector.mjs +1 -1
  24. package/dist/jsontable.d.mts +2 -2
  25. package/dist/jsontable.mjs +4 -4
  26. package/dist/metrics.d.mts +1 -1
  27. package/dist/metrics.mjs +4 -4
  28. package/dist/plugins.d.mts +2 -2
  29. package/dist/plugins.mjs +4 -4
  30. package/dist/{root-766ae985.d.ts → root-C3lZnoCI.d.ts} +1 -1
  31. package/dist/ui.mjs +3 -3
  32. package/dist/utils.d.mts +8 -3
  33. package/dist/utils.mjs +1 -1
  34. package/package.json +1 -1
  35. package/dist/chunk-WYGQ3Y4R.mjs.map +0 -1
  36. /package/dist/{PaginationState-c19e621a.d.ts → PaginationState-Bmrrw0ky.d.ts} +0 -0
  37. /package/dist/{chunk-WT2ARRCR.mjs.map → chunk-HRYH37UI.mjs.map} +0 -0
  38. /package/dist/{chunk-PPYYRQDD.mjs.map → chunk-QWHU3HBK.mjs.map} +0 -0
  39. /package/dist/{chunk-6F7H4PAA.mjs.map → chunk-R4SQKVDQ.mjs.map} +0 -0
  40. /package/dist/{chunk-7FF4BCFW.mjs.map → chunk-SVPD6PC6.mjs.map} +0 -0
  41. /package/dist/{chunk-DZMNL4BZ.mjs.map → chunk-WS43BV7Y.mjs.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from 'events';
2
- import { c as BooleanState, B as BaseState } from './root-766ae985.js';
2
+ import { c as BooleanState, B as BaseState } from './root-C3lZnoCI.js';
3
3
 
4
4
  interface Events {
5
5
  data: (data: any) => void;
@@ -22,10 +22,10 @@ declare class PromiseState<T extends (...args: any[]) => Promise<any>, U = Retur
22
22
  successMsg: string;
23
23
  errMsg: string;
24
24
  loadingLock: boolean;
25
- event: EventEmitter;
25
+ event: EventEmitter<[never]>;
26
26
  on<E extends keyof Events>(event: E, listener: Events[E]): this;
27
27
  once<E extends keyof Events>(event: E, listener: Events[E]): this;
28
- use<E extends keyof Events>(event: E, listener: Events[E]): () => EventEmitter;
28
+ use<E extends keyof Events>(event: E, listener: Events[E]): () => EventEmitter<[never]>;
29
29
  emit<E extends keyof Events>(event: E, ...args: Parameters<Events[E]>): void;
30
30
  init: () => Promise<void>;
31
31
  currentIndex: BaseState;
package/dist/aiem.d.mts CHANGED
@@ -5,16 +5,13 @@ type ClassType<T> = {
5
5
  new (...args: any[]): T;
6
6
  };
7
7
 
8
- interface FieldParams {
9
- ttl?: number;
10
- }
11
- type ContractParams<T extends any = any, K extends keyof T = keyof T> = K;
12
8
  declare class Fields {
13
- static hide(options?: FieldParams): (target: any, propertyKey: any, descriptor?: PropertyDescriptor) => void;
14
- static read(options?: FieldParams): (target: any, propertyKey: any, descriptor?: PropertyDescriptor) => void;
15
- static write(options?: FieldParams): (target: any, propertyKey: any, descriptor?: PropertyDescriptor) => void;
16
- static custom(options?: FieldParams): (target: (...args: any[]) => Promise<any>, propertyKey: any, descriptor?: PropertyDescriptor) => void;
17
- static contract<T = any, R = any>(entity: () => ClassType<R>, options: ContractParams<T>): (target: any, propertyKey: any, descriptor?: PropertyDescriptor) => void;
9
+ static hide(options?: any): (target: any, propertyKey: any, descriptor?: PropertyDescriptor) => void;
10
+ static read(options?: any): (target: any, propertyKey: any, descriptor?: PropertyDescriptor) => void;
11
+ static write(options?: any): (target: any, propertyKey: any, descriptor?: PropertyDescriptor) => void;
12
+ static custom(options?: any): (target: any, propertyKey: any, descriptor?: PropertyDescriptor) => void;
13
+ static contract<T = any, R = any>(entity: () => ClassType<R>, options: any): (target: any, propertyKey: any, descriptor?: PropertyDescriptor) => void;
14
+ private static setMetadata;
18
15
  }
19
16
 
20
17
  declare class Cache {
@@ -113,4 +110,4 @@ type QueryReturnType<E, S extends QuerySelect<E>> = {
113
110
  [K in keyof E]: K extends keyof S ? E[K] extends (...args: any[]) => any ? Awaited<ReturnType<E[K]>> : E[K] extends object ? S[K] extends object ? QueryReturnType<E[K], S[K]> : E[K] : E[K] : E[K];
114
111
  };
115
112
 
116
- export { AIem, Cache, Fields, Item, QueryReturnType };
113
+ export { AIem, Cache, Fields, type Item, type QueryReturnType };
package/dist/aiem.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import './chunk-7MDKCI65.mjs';
2
2
  import { helper } from './chunk-Q3AD5RHQ.mjs';
3
3
  import './chunk-MGU3KYGC.mjs';
4
- import { __spreadProps, __spreadValues, __objRest } from './chunk-6F7H4PAA.mjs';
4
+ import { __spreadProps, __spreadValues, __objRest } from './chunk-R4SQKVDQ.mjs';
5
5
  import { createPublicClient, http, getContract, encodeFunctionData } from 'viem';
6
6
  import { mainnet, iotex, bsc, polygon, iotexTestnet } from 'viem/chains';
7
7
  import TTLCache from '@isaacs/ttlcache';
@@ -374,7 +374,7 @@ var Reflect2;
374
374
  case 5:
375
375
  return input;
376
376
  }
377
- var hint = PreferredType === 3 ? "string" : PreferredType === 5 ? "number" : "default";
377
+ var hint = "string" ;
378
378
  var exoticToPrim = GetMethod(input, toPrimitiveSymbol);
379
379
  if (exoticToPrim !== void 0) {
380
380
  var result = exoticToPrim.call(input, hint);
@@ -382,10 +382,10 @@ var Reflect2;
382
382
  throw new TypeError();
383
383
  return result;
384
384
  }
385
- return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint);
385
+ return OrdinaryToPrimitive(input);
386
386
  }
387
387
  function OrdinaryToPrimitive(O, hint) {
388
- if (hint === "string") {
388
+ var valueOf, result; {
389
389
  var toString_1 = O.toString;
390
390
  if (IsCallable(toString_1)) {
391
391
  var result = toString_1.call(O);
@@ -398,19 +398,6 @@ var Reflect2;
398
398
  if (!IsObject(result))
399
399
  return result;
400
400
  }
401
- } else {
402
- var valueOf = O.valueOf;
403
- if (IsCallable(valueOf)) {
404
- var result = valueOf.call(O);
405
- if (!IsObject(result))
406
- return result;
407
- }
408
- var toString_2 = O.toString;
409
- if (IsCallable(toString_2)) {
410
- var result = toString_2.call(O);
411
- if (!IsObject(result))
412
- return result;
413
- }
414
401
  }
415
402
  throw new TypeError();
416
403
  }
@@ -422,10 +409,7 @@ var Reflect2;
422
409
  }
423
410
  function ToPropertyKey(argument) {
424
411
  var key = ToPrimitive(
425
- argument,
426
- 3
427
- /* String */
428
- );
412
+ argument);
429
413
  if (IsSymbol(key))
430
414
  return key;
431
415
  return ToString(key);
@@ -805,34 +789,48 @@ var Reflect2;
805
789
 
806
790
  // lib/decorators.ts
807
791
  var FIELD_KEY = Symbol("aiem_field");
808
- var Fields = class {
792
+ var metadataCache = /* @__PURE__ */ new WeakMap();
793
+ var Fields = class _Fields {
809
794
  static hide(options = {}) {
810
795
  return function(target, propertyKey, descriptor) {
811
- Reflect.defineMetadata(FIELD_KEY, { type: "hide", options }, target, propertyKey);
796
+ _Fields.setMetadata(target, propertyKey, { type: "hide", options });
812
797
  };
813
798
  }
814
799
  static read(options = {}) {
815
800
  return function(target, propertyKey, descriptor) {
816
- Reflect.defineMetadata(FIELD_KEY, { type: "read", options }, target, propertyKey);
801
+ _Fields.setMetadata(target, propertyKey, { type: "read", options });
817
802
  };
818
803
  }
819
804
  static write(options = {}) {
820
805
  return function(target, propertyKey, descriptor) {
821
- Reflect.defineMetadata(FIELD_KEY, { type: "write", options }, target, propertyKey);
806
+ _Fields.setMetadata(target, propertyKey, { type: "write", options });
822
807
  };
823
808
  }
824
809
  static custom(options = {}) {
825
810
  return function(target, propertyKey, descriptor) {
826
- Reflect.defineMetadata(FIELD_KEY, { type: "custom", options }, target, propertyKey);
811
+ _Fields.setMetadata(target, propertyKey, { type: "custom", options });
827
812
  };
828
813
  }
829
814
  static contract(entity, options) {
830
815
  return function(target, propertyKey, descriptor) {
831
- Reflect.defineMetadata(FIELD_KEY, { type: "contract", entity, targetKey: options }, target, propertyKey);
816
+ _Fields.setMetadata(target, propertyKey, { type: "contract", entity, targetKey: options });
832
817
  };
833
818
  }
819
+ static setMetadata(target, propertyKey, metadata) {
820
+ let targetMetadata = metadataCache.get(target);
821
+ if (!targetMetadata) {
822
+ targetMetadata = /* @__PURE__ */ new Map();
823
+ metadataCache.set(target, targetMetadata);
824
+ }
825
+ targetMetadata.set(propertyKey, metadata);
826
+ Reflect.defineMetadata(FIELD_KEY, metadata, target, propertyKey);
827
+ }
834
828
  };
835
829
  function getFieldMetadata(target, propertyKey) {
830
+ const targetMetadata = metadataCache.get(target);
831
+ if (targetMetadata) {
832
+ return targetMetadata.get(propertyKey);
833
+ }
836
834
  return Reflect.getMetadata(FIELD_KEY, target, propertyKey);
837
835
  }
838
836
  mainnet.rpcUrls.default.http = ["https://rpc.ankr.com/eth"];