interaqt 0.6.5 → 0.7.0

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.
@@ -22,7 +22,7 @@ export declare class GlobalAnyHandle implements DataBasedComputation {
22
22
  matchCount: GlobalBoundState<number>;
23
23
  isItemMatch: RecordBoundState<boolean>;
24
24
  };
25
- getDefaultValue(): boolean;
25
+ getInitialValue(): boolean;
26
26
  compute({ main: records, ...dataDeps }: {
27
27
  main: any[];
28
28
  [key: string]: any;
@@ -58,7 +58,7 @@ export declare class PropertyAnyHandle implements DataBasedComputation {
58
58
  matchCount: RecordBoundState<number>;
59
59
  isItemMatch: RecordBoundState<boolean>;
60
60
  };
61
- getDefaultValue(): boolean;
61
+ getInitialValue(): boolean;
62
62
  compute({ _current, ...dataDeps }: {
63
63
  _current: any;
64
64
  [key: string]: any;
@@ -22,7 +22,7 @@ export declare class GlobalAverageHandle implements DataBasedComputation {
22
22
  count: GlobalBoundState<number>;
23
23
  itemValue: RecordBoundState<number>;
24
24
  };
25
- getDefaultValue(): number;
25
+ getInitialValue(): number;
26
26
  resolveAvgField(record: any, avgFieldPath?: string[]): any;
27
27
  compute({ main: records }: {
28
28
  main: any[];
@@ -56,7 +56,7 @@ export declare class PropertyAverageHandle implements DataBasedComputation {
56
56
  count: RecordBoundState<number>;
57
57
  itemResult: RecordBoundState<number>;
58
58
  };
59
- getDefaultValue(): number;
59
+ getInitialValue(): number;
60
60
  resolveAvgField(record: any, avgFieldPath?: string[]): any;
61
61
  compute({ _current }: {
62
62
  _current: any;
@@ -106,7 +106,7 @@ export interface DataBasedComputation {
106
106
  dataDeps: {
107
107
  [key: string]: DataDep;
108
108
  };
109
- getDefaultValue?: (...args: any[]) => any;
109
+ getInitialValue?: (...args: any[]) => any;
110
110
  useLastValue?: boolean;
111
111
  asyncReturn?: (...args: any[]) => Promise<ComputationResultSkip | any>;
112
112
  createStateData?: (...args: any[]) => Promise<{
@@ -136,7 +136,7 @@ export interface EventBasedComputation {
136
136
  [key: string]: EventDep;
137
137
  };
138
138
  useLastValue?: boolean;
139
- getDefaultValue?: (...args: any[]) => any;
139
+ getInitialValue?: (...args: any[]) => any;
140
140
  computeDirtyRecords?: (...args: any[]) => Promise<any[] | undefined>;
141
141
  asyncReturn?: (...args: any[]) => Promise<ComputationResultSkip | any>;
142
142
  createStateData?: (...args: any[]) => Promise<{
@@ -23,7 +23,7 @@ export declare class GlobalCountHandle implements DataBasedComputation {
23
23
  count: GlobalBoundState<number>;
24
24
  isItemMatch: RecordBoundState<boolean>;
25
25
  };
26
- getDefaultValue(): number;
26
+ getInitialValue(): number;
27
27
  compute({ main: records, ...dataDeps }: {
28
28
  main: any[];
29
29
  [key: string]: any;
@@ -59,7 +59,7 @@ export declare class PropertyCountHandle implements DataBasedComputation {
59
59
  relatedAttributeQuery: AttributeQueryData;
60
60
  constructor(controller: Controller, args: CountInstance, dataContext: PropertyDataContext);
61
61
  createState(): {} | StateWithCallback;
62
- getDefaultValue(): number;
62
+ getInitialValue(): number;
63
63
  compute({ _current, ...dataDeps }: {
64
64
  _current: any;
65
65
  [key: string]: any;
@@ -17,14 +17,14 @@ declare abstract class BaseCustomComputationHandle implements DataBasedComputati
17
17
  incrementalComputeCallback?: Function;
18
18
  incrementalPatchComputeCallback?: Function;
19
19
  createStateCallback?: Function;
20
- getDefaultValueCallback?: Function;
20
+ getInitialValueCallback?: Function;
21
21
  asyncReturnCallback?: Function;
22
22
  incrementalCompute?: (...args: any[]) => Promise<ComputationResult | any>;
23
23
  incrementalPatchCompute?: (...args: any[]) => Promise<ComputationResult | ComputationResultPatch | ComputationResultPatch[] | undefined>;
24
24
  asyncReturn?: (...args: any[]) => Promise<ComputationResult | any>;
25
25
  constructor(controller: Controller, args: CustomInstance, dataContext: DataContext);
26
26
  createState(): any;
27
- getDefaultValue(): any;
27
+ getInitialValue(): any;
28
28
  compute(...args: any[]): Promise<ComputationResult | any>;
29
29
  }
30
30
  export declare class GlobalCustomHandle extends BaseCustomComputationHandle {
@@ -24,7 +24,7 @@ export declare class GlobalEveryHandle implements DataBasedComputation {
24
24
  totalCount: GlobalBoundState<number>;
25
25
  isItemMatch: RecordBoundState<boolean>;
26
26
  };
27
- getDefaultValue(): boolean;
27
+ getInitialValue(): boolean;
28
28
  compute({ main: records, ...dataDeps }: {
29
29
  main: any[];
30
30
  [key: string]: any;
@@ -61,7 +61,7 @@ export declare class PropertyEveryHandle implements DataBasedComputation {
61
61
  totalCount: RecordBoundState<number>;
62
62
  isItemMatch: RecordBoundState<boolean>;
63
63
  };
64
- getDefaultValue(): boolean;
64
+ getInitialValue(): boolean;
65
65
  compute({ _current, ...dataDeps }: {
66
66
  _current: any;
67
67
  [key: string]: any;
@@ -27,7 +27,7 @@ export declare class GlobalRealTimeComputation implements DataBasedComputation {
27
27
  lastRecomputeTime: GlobalBoundState<number>;
28
28
  nextRecomputeTime: GlobalBoundState<number>;
29
29
  };
30
- getDefaultValue(): null;
30
+ getInitialValue(): null;
31
31
  compute(dataDeps: {
32
32
  [key: string]: any;
33
33
  }): Promise<number | boolean>;
@@ -57,7 +57,7 @@ export declare class PropertyRealTimeComputation implements DataBasedComputation
57
57
  lastRecomputeTime: RecordBoundState<number>;
58
58
  nextRecomputeTime: RecordBoundState<number>;
59
59
  };
60
- getDefaultValue(): number;
60
+ getInitialValue(): number;
61
61
  compute(dataDeps: {
62
62
  [key: string]: any;
63
63
  }, record: any): Promise<number | boolean>;
@@ -19,12 +19,12 @@ export declare class GlobalStateMachineHandle implements EventBasedComputation {
19
19
  [key: string]: EventDep;
20
20
  };
21
21
  useMutationEvent: boolean;
22
- defaultState: StateNodeInstance;
22
+ initialState: StateNodeInstance;
23
23
  constructor(controller: Controller, args: StateMachineInstance, dataContext: DataContext);
24
24
  createState(): {
25
25
  currentState: GlobalBoundState<string>;
26
26
  };
27
- getDefaultValue(event: any): unknown;
27
+ getInitialValue(event: any): Promise<unknown>;
28
28
  incrementalCompute(lastValue: string, mutationEvent: EtityMutationEvent, dirtyRecord: any): Promise<any>;
29
29
  }
30
30
  export declare class PropertyStateMachineHandle implements EventBasedComputation {
@@ -40,14 +40,14 @@ export declare class PropertyStateMachineHandle implements EventBasedComputation
40
40
  eventDeps: {
41
41
  [key: string]: EventDep;
42
42
  };
43
- defaultState: StateNodeInstance;
43
+ initialState: StateNodeInstance;
44
44
  dataContext: PropertyDataContext;
45
45
  useMutationEvent: boolean;
46
46
  constructor(controller: Controller, args: StateMachineInstance, dataContext: DataContext);
47
47
  createState(): {
48
48
  currentState: RecordBoundState<string>;
49
49
  };
50
- getDefaultValue(initialRecord: any): unknown;
50
+ getInitialValue(initialRecord: any): Promise<unknown>;
51
51
  computeDirtyRecords(mutationEvent: RecordMutationEvent): Promise<any[]>;
52
52
  incrementalCompute(lastValue: string, mutationEvent: RecordMutationEvent, dirtyRecord: any): Promise<any>;
53
53
  createStateData(state: StateNodeInstance): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"StateMachine.d.ts","sourceRoot":"","sources":["../../../src/runtime/computations/StateMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAa,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAe,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAqB,qBAAqB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC1H,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQzD,qBAAa,wBAAyB,YAAW,qBAAqB;IAS/C,UAAU,EAAE,UAAU;IAAS,IAAI,EAAE,oBAAoB;IAAS,WAAW,EAAE,WAAW;IAR7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E,iBAAiB;;;CAKjD;AAED,eAAO,MAAM,eAAe,mBAG1B,CAAA;AAEF,eAAO,MAAM,iBAAiB,mBAG5B,CAAA;AAEF,eAAO,MAAM,aAAa,mBAGxB,CAAA;AAGF,eAAO,MAAM,mBAAmB,yEAAyD,CAAC"}
@@ -20,7 +20,7 @@ export declare class GlobalSumHandle implements DataBasedComputation {
20
20
  createState(): {
21
21
  itemValue: RecordBoundState<number>;
22
22
  };
23
- getDefaultValue(): number;
23
+ getInitialValue(): number;
24
24
  resolveSumField(record: any, sumFieldPath?: string[]): any;
25
25
  compute({ main: records }: {
26
26
  main: any[];
@@ -53,7 +53,7 @@ export declare class PropertySumHandle implements DataBasedComputation {
53
53
  createState(): {
54
54
  itemResult: RecordBoundState<number>;
55
55
  };
56
- getDefaultValue(): number;
56
+ getInitialValue(): number;
57
57
  resolveSumField(record: any, sumFieldPath?: string[]): any;
58
58
  compute({ _current }: {
59
59
  _current: any;
@@ -22,7 +22,7 @@ export declare class RecordsTransformHandle implements DataBasedComputation {
22
22
  sourceRecordId: RecordBoundState<any>;
23
23
  transformIndex: RecordBoundState<number>;
24
24
  };
25
- getDefaultValue(): never[];
25
+ getInitialValue(): never[];
26
26
  compute({ _source: records }: {
27
27
  _source: any[];
28
28
  }): Promise<any[]>;
@@ -20,7 +20,7 @@ export declare class GlobalWeightedSummationHandle implements DataBasedComputati
20
20
  };
21
21
  record: (EntityInstance | RelationInstance);
22
22
  constructor(controller: Controller, args: WeightedSummationInstance, dataContext: DataContext);
23
- getDefaultValue(): number;
23
+ getInitialValue(): number;
24
24
  createState(): {
25
25
  itemResult: RecordBoundState<number>;
26
26
  };
@@ -58,7 +58,7 @@ export declare class PropertyWeightedSummationHandle implements DataBasedComputa
58
58
  createState(): {
59
59
  itemResult: RecordBoundState<number>;
60
60
  };
61
- getDefaultValue(): number;
61
+ getInitialValue(): number;
62
62
  compute({ _current, ...dataDeps }: {
63
63
  _current: any;
64
64
  [key: string]: any;
@@ -9,7 +9,7 @@ export interface CustomInstance extends IInstance {
9
9
  incrementalCompute?: Function;
10
10
  incrementalPatchCompute?: Function;
11
11
  createState?: Function;
12
- getDefaultValue?: Function;
12
+ getInitialValue?: Function;
13
13
  asyncReturn?: Function;
14
14
  useLastValue?: boolean;
15
15
  }
@@ -22,7 +22,7 @@ export interface CustomCreateArgs {
22
22
  incrementalCompute?: Function;
23
23
  incrementalPatchCompute?: Function;
24
24
  createState?: Function;
25
- getDefaultValue?: Function;
25
+ getInitialValue?: Function;
26
26
  asyncReturn?: Function;
27
27
  useLastValue?: boolean;
28
28
  }
@@ -40,7 +40,7 @@ export declare class Custom implements CustomInstance {
40
40
  incrementalCompute?: Function;
41
41
  incrementalPatchCompute?: Function;
42
42
  createState?: Function;
43
- getDefaultValue?: Function;
43
+ getInitialValue?: Function;
44
44
  asyncReturn?: Function;
45
45
  useLastValue?: boolean;
46
46
  constructor(args: CustomCreateArgs, options?: {
@@ -80,7 +80,7 @@ export declare class Custom implements CustomInstance {
80
80
  collection: false;
81
81
  required: false;
82
82
  };
83
- getDefaultValue: {
83
+ getInitialValue: {
84
84
  type: "function";
85
85
  collection: false;
86
86
  required: false;
@@ -4,12 +4,12 @@ import { StateTransferInstance } from './StateTransfer.js';
4
4
  export interface StateMachineInstance extends IInstance {
5
5
  states: StateNodeInstance[];
6
6
  transfers: StateTransferInstance[];
7
- defaultState: StateNodeInstance;
7
+ initialState: StateNodeInstance;
8
8
  }
9
9
  export interface StateMachineCreateArgs {
10
10
  states: StateNodeInstance[];
11
11
  transfers: StateTransferInstance[];
12
- defaultState: StateNodeInstance;
12
+ initialState: StateNodeInstance;
13
13
  }
14
14
  export declare class StateMachine implements StateMachineInstance {
15
15
  uuid: string;
@@ -19,7 +19,7 @@ export declare class StateMachine implements StateMachineInstance {
19
19
  };
20
20
  states: StateNodeInstance[];
21
21
  transfers: StateTransferInstance[];
22
- defaultState: StateNodeInstance;
22
+ initialState: StateNodeInstance;
23
23
  constructor(args: StateMachineCreateArgs, options?: {
24
24
  uuid?: string;
25
25
  });
@@ -37,7 +37,7 @@ export declare class StateMachine implements StateMachineInstance {
37
37
  collection: true;
38
38
  required: true;
39
39
  };
40
- defaultState: {
40
+ initialState: {
41
41
  type: "StateNode";
42
42
  collection: false;
43
43
  required: true;
package/package.json CHANGED
@@ -37,7 +37,7 @@
37
37
  "sync:agent": "tsx scripts/sync-agent-files.ts",
38
38
  "release": "release-it"
39
39
  },
40
- "version": "0.6.5",
40
+ "version": "0.7.0",
41
41
  "main": "dist/index.js",
42
42
  "files": [
43
43
  "dist",