interaqt 0.1.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.
- package/README.md +53 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime/ActivityCall.d.ts +68 -0
- package/dist/runtime/ActivityCall.d.ts.map +1 -0
- package/dist/runtime/ActivityCall.js +379 -0
- package/dist/runtime/ActivityCall.js.map +1 -0
- package/dist/runtime/Controller.d.ts +60 -0
- package/dist/runtime/Controller.d.ts.map +1 -0
- package/dist/runtime/Controller.js +225 -0
- package/dist/runtime/Controller.js.map +1 -0
- package/dist/runtime/InteractionCall.d.ts +102 -0
- package/dist/runtime/InteractionCall.d.ts.map +1 -0
- package/dist/runtime/InteractionCall.js +385 -0
- package/dist/runtime/InteractionCall.js.map +1 -0
- package/dist/runtime/MonoSystem.d.ts +26 -0
- package/dist/runtime/MonoSystem.d.ts.map +1 -0
- package/dist/runtime/MonoSystem.js +331 -0
- package/dist/runtime/MonoSystem.js.map +1 -0
- package/dist/runtime/Mysql.d.ts +35 -0
- package/dist/runtime/Mysql.d.ts.map +1 -0
- package/dist/runtime/Mysql.js +171 -0
- package/dist/runtime/Mysql.js.map +1 -0
- package/dist/runtime/PostgreSQL.d.ts +36 -0
- package/dist/runtime/PostgreSQL.d.ts.map +1 -0
- package/dist/runtime/PostgreSQL.js +172 -0
- package/dist/runtime/PostgreSQL.js.map +1 -0
- package/dist/runtime/SQLite.d.ts +34 -0
- package/dist/runtime/SQLite.d.ts.map +1 -0
- package/dist/runtime/SQLite.js +146 -0
- package/dist/runtime/SQLite.js.map +1 -0
- package/dist/runtime/Scheduler.d.ts +81 -0
- package/dist/runtime/Scheduler.d.ts.map +1 -0
- package/dist/runtime/Scheduler.js +457 -0
- package/dist/runtime/Scheduler.js.map +1 -0
- package/dist/runtime/System.d.ts +312 -0
- package/dist/runtime/System.d.ts.map +1 -0
- package/dist/runtime/System.js +90 -0
- package/dist/runtime/System.js.map +1 -0
- package/dist/runtime/asyncInteractionContext.d.ts +3 -0
- package/dist/runtime/asyncInteractionContext.d.ts.map +1 -0
- package/dist/runtime/asyncInteractionContext.js +3 -0
- package/dist/runtime/asyncInteractionContext.js.map +1 -0
- package/dist/runtime/boolExpression.d.ts +23 -0
- package/dist/runtime/boolExpression.d.ts.map +1 -0
- package/dist/runtime/boolExpression.js +43 -0
- package/dist/runtime/boolExpression.js.map +1 -0
- package/dist/runtime/computedDataHandles/Any.d.ts +52 -0
- package/dist/runtime/computedDataHandles/Any.d.ts.map +1 -0
- package/dist/runtime/computedDataHandles/Any.js +152 -0
- package/dist/runtime/computedDataHandles/Any.js.map +1 -0
- package/dist/runtime/computedDataHandles/Computation.d.ts +108 -0
- package/dist/runtime/computedDataHandles/Computation.d.ts.map +1 -0
- package/dist/runtime/computedDataHandles/Computation.js +49 -0
- package/dist/runtime/computedDataHandles/Computation.js.map +1 -0
- package/dist/runtime/computedDataHandles/ComputedDataHandle.d.ts +42 -0
- package/dist/runtime/computedDataHandles/ComputedDataHandle.d.ts.map +1 -0
- package/dist/runtime/computedDataHandles/ComputedDataHandle.js +4 -0
- package/dist/runtime/computedDataHandles/ComputedDataHandle.js.map +1 -0
- package/dist/runtime/computedDataHandles/Count.d.ts +45 -0
- package/dist/runtime/computedDataHandles/Count.d.ts.map +1 -0
- package/dist/runtime/computedDataHandles/Count.js +85 -0
- package/dist/runtime/computedDataHandles/Count.js.map +1 -0
- package/dist/runtime/computedDataHandles/Every.d.ts +56 -0
- package/dist/runtime/computedDataHandles/Every.d.ts.map +1 -0
- package/dist/runtime/computedDataHandles/Every.js +178 -0
- package/dist/runtime/computedDataHandles/Every.js.map +1 -0
- package/dist/runtime/computedDataHandles/StateMachine.d.ts +74 -0
- package/dist/runtime/computedDataHandles/StateMachine.d.ts.map +1 -0
- package/dist/runtime/computedDataHandles/StateMachine.js +180 -0
- package/dist/runtime/computedDataHandles/StateMachine.js.map +1 -0
- package/dist/runtime/computedDataHandles/Transform.d.ts +26 -0
- package/dist/runtime/computedDataHandles/Transform.d.ts.map +1 -0
- package/dist/runtime/computedDataHandles/Transform.js +106 -0
- package/dist/runtime/computedDataHandles/Transform.js.map +1 -0
- package/dist/runtime/computedDataHandles/TransitionFinder.d.ts +57 -0
- package/dist/runtime/computedDataHandles/TransitionFinder.d.ts.map +1 -0
- package/dist/runtime/computedDataHandles/TransitionFinder.js +40 -0
- package/dist/runtime/computedDataHandles/TransitionFinder.js.map +1 -0
- package/dist/runtime/computedDataHandles/WeightedSummation.d.ts +57 -0
- package/dist/runtime/computedDataHandles/WeightedSummation.d.ts.map +1 -0
- package/dist/runtime/computedDataHandles/WeightedSummation.js +146 -0
- package/dist/runtime/computedDataHandles/WeightedSummation.js.map +1 -0
- package/dist/runtime/computedDataHandles/index.d.ts +7 -0
- package/dist/runtime/computedDataHandles/index.d.ts.map +1 -0
- package/dist/runtime/computedDataHandles/index.js +7 -0
- package/dist/runtime/computedDataHandles/index.js.map +1 -0
- package/dist/runtime/index.d.ts +15 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +15 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/server.d.ts +35 -0
- package/dist/runtime/server.d.ts.map +1 -0
- package/dist/runtime/server.js +171 -0
- package/dist/runtime/server.js.map +1 -0
- package/dist/runtime/types/boolExpression.d.ts +22 -0
- package/dist/runtime/types/boolExpression.d.ts.map +1 -0
- package/dist/runtime/types/boolExpression.js +6 -0
- package/dist/runtime/types/boolExpression.js.map +1 -0
- package/dist/runtime/util.d.ts +10 -0
- package/dist/runtime/util.d.ts.map +1 -0
- package/dist/runtime/util.js +39 -0
- package/dist/runtime/util.js.map +1 -0
- package/dist/shared/BoolExp.d.ts +97 -0
- package/dist/shared/BoolExp.d.ts.map +1 -0
- package/dist/shared/BoolExp.js +252 -0
- package/dist/shared/BoolExp.js.map +1 -0
- package/dist/shared/activity/Activity.d.ts +465 -0
- package/dist/shared/activity/Activity.d.ts.map +1 -0
- package/dist/shared/activity/Activity.js +264 -0
- package/dist/shared/activity/Activity.js.map +1 -0
- package/dist/shared/activity/Condition.d.ts +75 -0
- package/dist/shared/activity/Condition.d.ts.map +1 -0
- package/dist/shared/activity/Condition.js +51 -0
- package/dist/shared/activity/Condition.js.map +1 -0
- package/dist/shared/activity/Data.d.ts +115 -0
- package/dist/shared/activity/Data.d.ts.map +1 -0
- package/dist/shared/activity/Data.js +89 -0
- package/dist/shared/activity/Data.js.map +1 -0
- package/dist/shared/attributive.d.ts +93 -0
- package/dist/shared/attributive.d.ts.map +1 -0
- package/dist/shared/attributive.js +59 -0
- package/dist/shared/attributive.js.map +1 -0
- package/dist/shared/computed.d.ts +607 -0
- package/dist/shared/computed.d.ts.map +1 -0
- package/dist/shared/computed.js +202 -0
- package/dist/shared/computed.js.map +1 -0
- package/dist/shared/createClass.d.ts +102 -0
- package/dist/shared/createClass.d.ts.map +1 -0
- package/dist/shared/createClass.js +276 -0
- package/dist/shared/createClass.js.map +1 -0
- package/dist/shared/dictionary/Dictionary.d.ts +40 -0
- package/dist/shared/dictionary/Dictionary.d.ts.map +1 -0
- package/dist/shared/dictionary/Dictionary.js +51 -0
- package/dist/shared/dictionary/Dictionary.js.map +1 -0
- package/dist/shared/entity/Entity.d.ts +149 -0
- package/dist/shared/entity/Entity.d.ts.map +1 -0
- package/dist/shared/entity/Entity.js +226 -0
- package/dist/shared/entity/Entity.js.map +1 -0
- package/dist/shared/index.d.ts +11 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +11 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/user/User.d.ts +21 -0
- package/dist/shared/user/User.d.ts.map +1 -0
- package/dist/shared/user/User.js +11 -0
- package/dist/shared/user/User.js.map +1 -0
- package/dist/shared/utils.d.ts +11 -0
- package/dist/shared/utils.d.ts.map +1 -0
- package/dist/shared/utils.js +19 -0
- package/dist/shared/utils.js.map +1 -0
- package/dist/storage/erstorage/AttributeInfo.d.ts +40 -0
- package/dist/storage/erstorage/AttributeInfo.d.ts.map +1 -0
- package/dist/storage/erstorage/AttributeInfo.js +147 -0
- package/dist/storage/erstorage/AttributeInfo.js.map +1 -0
- package/dist/storage/erstorage/AttributeQuery.d.ts +33 -0
- package/dist/storage/erstorage/AttributeQuery.d.ts.map +1 -0
- package/dist/storage/erstorage/AttributeQuery.js +190 -0
- package/dist/storage/erstorage/AttributeQuery.js.map +1 -0
- package/dist/storage/erstorage/EntityQueryHandle.d.ts +29 -0
- package/dist/storage/erstorage/EntityQueryHandle.d.ts.map +1 -0
- package/dist/storage/erstorage/EntityQueryHandle.js +78 -0
- package/dist/storage/erstorage/EntityQueryHandle.js.map +1 -0
- package/dist/storage/erstorage/EntityToTableMap.d.ts +85 -0
- package/dist/storage/erstorage/EntityToTableMap.d.ts.map +1 -0
- package/dist/storage/erstorage/EntityToTableMap.js +262 -0
- package/dist/storage/erstorage/EntityToTableMap.js.map +1 -0
- package/dist/storage/erstorage/LinkInfo.d.ts +35 -0
- package/dist/storage/erstorage/LinkInfo.d.ts.map +1 -0
- package/dist/storage/erstorage/LinkInfo.js +89 -0
- package/dist/storage/erstorage/LinkInfo.js.map +1 -0
- package/dist/storage/erstorage/MatchExp.d.ts +37 -0
- package/dist/storage/erstorage/MatchExp.d.ts.map +1 -0
- package/dist/storage/erstorage/MatchExp.js +211 -0
- package/dist/storage/erstorage/MatchExp.js.map +1 -0
- package/dist/storage/erstorage/Modifier.d.ts +23 -0
- package/dist/storage/erstorage/Modifier.d.ts.map +1 -0
- package/dist/storage/erstorage/Modifier.js +24 -0
- package/dist/storage/erstorage/Modifier.js.map +1 -0
- package/dist/storage/erstorage/NewRecordData.d.ts +42 -0
- package/dist/storage/erstorage/NewRecordData.d.ts.map +1 -0
- package/dist/storage/erstorage/NewRecordData.js +178 -0
- package/dist/storage/erstorage/NewRecordData.js.map +1 -0
- package/dist/storage/erstorage/RecordInfo.d.ts +26 -0
- package/dist/storage/erstorage/RecordInfo.d.ts.map +1 -0
- package/dist/storage/erstorage/RecordInfo.js +111 -0
- package/dist/storage/erstorage/RecordInfo.js.map +1 -0
- package/dist/storage/erstorage/RecordQuery.d.ts +73 -0
- package/dist/storage/erstorage/RecordQuery.d.ts.map +1 -0
- package/dist/storage/erstorage/RecordQuery.js +158 -0
- package/dist/storage/erstorage/RecordQuery.js.map +1 -0
- package/dist/storage/erstorage/RecordQueryAgent.d.ts +84 -0
- package/dist/storage/erstorage/RecordQueryAgent.d.ts.map +1 -0
- package/dist/storage/erstorage/RecordQueryAgent.js +1130 -0
- package/dist/storage/erstorage/RecordQueryAgent.js.map +1 -0
- package/dist/storage/erstorage/Setup.d.ts +49 -0
- package/dist/storage/erstorage/Setup.d.ts.map +1 -0
- package/dist/storage/erstorage/Setup.js +400 -0
- package/dist/storage/erstorage/Setup.js.map +1 -0
- package/dist/storage/erstorage/util.d.ts +6 -0
- package/dist/storage/erstorage/util.d.ts.map +1 -0
- package/dist/storage/erstorage/util.js +25 -0
- package/dist/storage/erstorage/util.js.map +1 -0
- package/dist/storage/index.d.ts +13 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +13 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/utils.d.ts +10 -0
- package/dist/storage/utils.d.ts.map +1 -0
- package/dist/storage/utils.js +48 -0
- package/dist/storage/utils.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function flatten(arr) {
|
|
2
|
+
const result = [];
|
|
3
|
+
arr.forEach(i => result.push(...(Array.isArray(i) ? i : [i])));
|
|
4
|
+
return result;
|
|
5
|
+
}
|
|
6
|
+
export async function someAsync(arr, handle) {
|
|
7
|
+
for (let i of arr) {
|
|
8
|
+
if (await handle(i))
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
export function isRelation(relation) {
|
|
14
|
+
return relation.source !== undefined && relation.target !== undefined;
|
|
15
|
+
}
|
|
16
|
+
export function indexBy(arr, key) {
|
|
17
|
+
return Object.fromEntries(arr.map(o => [o[key], o]));
|
|
18
|
+
}
|
|
19
|
+
export function assert(condition, message) {
|
|
20
|
+
if (!condition) {
|
|
21
|
+
// if (__DEV__) debugger
|
|
22
|
+
throw new Error(message);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/storage/erstorage/util.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,OAAO,CAAI,GAAc;IACrC,MAAM,MAAM,GAAQ,EAAE,CAAA;IACtB,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC7D,OAAO,MAAM,CAAA;AACjB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,GAAU,EAAE,MAAmC;IAC3E,KAAI,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,MAAM,MAAM,CAAC,CAAC,CAAC;YAAE,OAAO,IAAI,CAAA;IACpC,CAAC;IACD,OAAO,KAAK,CAAA;AAChB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,QAAa;IACpC,OAAO,QAAQ,CAAC,MAAM,KAAK,SAAS,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAA;AACzE,CAAC;AAID,MAAM,UAAU,OAAO,CAAC,GAAU,EAAE,GAAW;IAC3C,OAAO,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AACxD,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,SAAc,EAAE,OAAe;IAClD,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,wBAAwB;QACxB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAC5B,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './erstorage/AttributeInfo.js';
|
|
2
|
+
export * from './erstorage/AttributeQuery.js';
|
|
3
|
+
export * from './erstorage/EntityQueryHandle.js';
|
|
4
|
+
export * from './erstorage/EntityToTableMap.js';
|
|
5
|
+
export * from './erstorage/LinkInfo.js';
|
|
6
|
+
export * from './erstorage/MatchExp.js';
|
|
7
|
+
export * from './erstorage/Modifier.js';
|
|
8
|
+
export * from './erstorage/NewRecordData.js';
|
|
9
|
+
export * from './erstorage/RecordInfo.js';
|
|
10
|
+
export * from './erstorage/RecordQuery.js';
|
|
11
|
+
export * from './erstorage/RecordQueryAgent.js';
|
|
12
|
+
export * from './erstorage/Setup.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,kCAAkC,CAAA;AAChD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './erstorage/AttributeInfo.js';
|
|
2
|
+
export * from './erstorage/AttributeQuery.js';
|
|
3
|
+
export * from './erstorage/EntityQueryHandle.js';
|
|
4
|
+
export * from './erstorage/EntityToTableMap.js';
|
|
5
|
+
export * from './erstorage/LinkInfo.js';
|
|
6
|
+
export * from './erstorage/MatchExp.js';
|
|
7
|
+
export * from './erstorage/Modifier.js';
|
|
8
|
+
export * from './erstorage/NewRecordData.js';
|
|
9
|
+
export * from './erstorage/RecordInfo.js';
|
|
10
|
+
export * from './erstorage/RecordQuery.js';
|
|
11
|
+
export * from './erstorage/RecordQueryAgent.js';
|
|
12
|
+
export * from './erstorage/Setup.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,kCAAkC,CAAA;AAChD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function assert(condition: any, message: string): void;
|
|
2
|
+
type ObjectContainer = {
|
|
3
|
+
[k: string]: ObjectContainer | any;
|
|
4
|
+
};
|
|
5
|
+
export declare function setByPath(root: ObjectContainer, inputPath: string[], value: any): boolean;
|
|
6
|
+
export declare function mapTree(root: ObjectContainer, iteratorKeys: string[], fn: (object: any, context: string[]) => any, context?: string[]): any;
|
|
7
|
+
export declare function deepMerge(a: ObjectContainer, b: ObjectContainer): any;
|
|
8
|
+
export declare function indexBy(arr: any[], key: string): any;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/storage/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,QAKrD;AAED,KAAK,eAAe,GAAG;IACnB,CAAC,CAAC,EAAC,MAAM,GAAG,eAAe,GAAC,GAAG,CAAA;CAClC,CAAA;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,WAY/E;AAGD,wBAAgB,OAAO,CAAC,IAAI,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,GAAG,EAAE,OAAO,GAAE,MAAM,EAAO,OAOzI;AAGD,wBAAgB,SAAS,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,eAAe,OAc/D;AAGD,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,OAE9C"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export function assert(condition, message) {
|
|
2
|
+
if (!condition) {
|
|
3
|
+
// if (__DEV__) debugger
|
|
4
|
+
throw new Error(message);
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export function setByPath(root, inputPath, value) {
|
|
8
|
+
const path = [...inputPath];
|
|
9
|
+
let pointer = root;
|
|
10
|
+
let nextAttr;
|
|
11
|
+
const lastAttr = path.pop();
|
|
12
|
+
while (nextAttr = path.shift()) {
|
|
13
|
+
if (!pointer[nextAttr])
|
|
14
|
+
pointer[nextAttr] = {};
|
|
15
|
+
pointer = pointer[nextAttr];
|
|
16
|
+
}
|
|
17
|
+
pointer[lastAttr] = value;
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
export function mapTree(root, iteratorKeys, fn, context = []) {
|
|
21
|
+
const result = fn(root, context);
|
|
22
|
+
iteratorKeys.forEach(key => {
|
|
23
|
+
if (result[key])
|
|
24
|
+
result[key] = mapTree(result[key], iteratorKeys, fn, context.concat(key));
|
|
25
|
+
});
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
export function deepMerge(a, b) {
|
|
29
|
+
const result = {};
|
|
30
|
+
const keys = new Set(Object.keys(a).concat(Object.keys(b)));
|
|
31
|
+
keys.forEach(k => {
|
|
32
|
+
if (a[k] && b[k]) {
|
|
33
|
+
assert(typeof a[k] === 'object' && typeof b[k] === 'object', `${a[k]} or ${b[k]} is not object, cannot deep merge`);
|
|
34
|
+
result[k] = deepMerge(a[k], b[k]);
|
|
35
|
+
}
|
|
36
|
+
else if (a[k]) {
|
|
37
|
+
result[k] = a[k];
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
result[k] = b[k];
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
export function indexBy(arr, key) {
|
|
46
|
+
return Object.fromEntries(arr.map(o => [o[key], o]));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/storage/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAAC,SAAc,EAAE,OAAe;IAClD,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,wBAAwB;QACxB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAC5B,CAAC;AACL,CAAC;AAMD,MAAM,UAAU,SAAS,CAAC,IAAqB,EAAE,SAAmB,EAAE,KAAU;IAC5E,MAAM,IAAI,GAAG,CAAC,GAAG,SAAS,CAAC,CAAA;IAC3B,IAAI,OAAO,GAAG,IAAI,CAAA;IAClB,IAAI,QAAQ,CAAA;IACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAG,CAAA;IAC5B,OAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;YAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAA;QAC9C,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC/B,CAAC;IAED,OAAO,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAA;IACzB,OAAO,IAAI,CAAA;AACf,CAAC;AAGD,MAAM,UAAU,OAAO,CAAC,IAAqB,EAAE,YAAsB,EAAE,EAA2C,EAAE,UAAoB,EAAE;IACtI,MAAM,MAAM,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAChC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACvB,IAAI,MAAM,CAAC,GAAG,CAAC;YAAE,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAoB,EAAE,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;IACjH,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACjB,CAAC;AAGD,MAAM,UAAU,SAAS,CAAC,CAAkB,EAAE,CAAkB;IAC5D,MAAM,MAAM,GAAQ,EAAE,CAAA;IACtB,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3D,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QACb,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACf,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,KAAI,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAA;YAClH,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACrC,CAAC;aAAM,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACd,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QACpB,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QACpB,CAAC;IACL,CAAC,CAAC,CAAA;IACF,OAAO,MAAM,CAAA;AACjB,CAAC;AAGD,MAAM,UAAU,OAAO,CAAC,GAAU,EAAE,GAAW;IAC/C,OAAO,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AACpD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "interaqt",
|
|
3
|
+
"devDependencies": {
|
|
4
|
+
"@microsoft/api-extractor": "^7.52.1",
|
|
5
|
+
"@types/acorn": "^6.0.4",
|
|
6
|
+
"@types/better-sqlite3": "^7.6.12",
|
|
7
|
+
"@types/connect": "^3.4.38",
|
|
8
|
+
"@types/cors": "^2.8.17",
|
|
9
|
+
"@types/node": "^22.13.10",
|
|
10
|
+
"@types/pg": "^8.11.11",
|
|
11
|
+
"pino-pretty": "^13.0.0",
|
|
12
|
+
"release-it": "^19.0.1",
|
|
13
|
+
"rimraf": "^6.0.1",
|
|
14
|
+
"typescript": "^5.8.3",
|
|
15
|
+
"vite": "^6.3.4",
|
|
16
|
+
"vite-plugin-dts": "^4.5.3",
|
|
17
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
18
|
+
"vitest": "^3.1.2"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "vitest run",
|
|
22
|
+
"test-runtime": "vitest run tests/runtime",
|
|
23
|
+
"test-storage": "vitest run tests/storage",
|
|
24
|
+
"test-shared": "vitest run tests/shared",
|
|
25
|
+
"build": "rimraf dist && tsc -p tsconfig.prod.json",
|
|
26
|
+
"release": "release-it",
|
|
27
|
+
"patch": "node scripts/release.js patch",
|
|
28
|
+
"minor": "node scripts/release.js minor",
|
|
29
|
+
"major": "node scripts/release.js major"
|
|
30
|
+
},
|
|
31
|
+
"version": "0.1.0",
|
|
32
|
+
"main": "dist/index.js",
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
],
|
|
36
|
+
"author": "sskyy<skyking_H@hotmail.com>",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@fastify/middie": "^9.0.3",
|
|
40
|
+
"acorn": "^8.14.1",
|
|
41
|
+
"better-sqlite3": "^11.8.1",
|
|
42
|
+
"chalk": "^5.4.1",
|
|
43
|
+
"cors": "^2.8.5",
|
|
44
|
+
"fastify": "^5.2.1",
|
|
45
|
+
"mysql2": "^3.13.0",
|
|
46
|
+
"pg": "^8.14.0",
|
|
47
|
+
"pino": "^9.6.0",
|
|
48
|
+
"winston": "^3.17.0"
|
|
49
|
+
},
|
|
50
|
+
"types": "./dist/index.d.ts",
|
|
51
|
+
"typings": "./dist/index.d.ts",
|
|
52
|
+
"exports": {
|
|
53
|
+
".": {
|
|
54
|
+
"import": "./dist/index.js",
|
|
55
|
+
"types": "./dist/index.d.ts"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"type": "module"
|
|
59
|
+
}
|