@warlock.js/cascade 4.0.1 → 4.0.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.
- package/cjs/connection.d.ts +0 -1
- package/cjs/connection.d.ts.map +1 -1
- package/cjs/connection.js +0 -6
- package/cjs/connection.js.map +1 -1
- package/cjs/index.js +1 -1
- package/cjs/utils/index.d.ts +1 -0
- package/cjs/utils/index.d.ts.map +1 -1
- package/cjs/utils/sync-with.d.ts +27 -0
- package/cjs/utils/sync-with.d.ts.map +1 -0
- package/cjs/utils/sync-with.js +60 -0
- package/cjs/utils/sync-with.js.map +1 -0
- package/esm/connection.d.ts +0 -1
- package/esm/connection.d.ts.map +1 -1
- package/esm/connection.js +0 -6
- package/esm/connection.js.map +1 -1
- package/esm/index.js +1 -1
- package/esm/utils/index.d.ts +1 -0
- package/esm/utils/index.d.ts.map +1 -1
- package/esm/utils/sync-with.d.ts +27 -0
- package/esm/utils/sync-with.d.ts.map +1 -0
- package/esm/utils/sync-with.js +60 -0
- package/esm/utils/sync-with.js.map +1 -0
- package/package.json +2 -2
package/cjs/connection.d.ts
CHANGED
package/cjs/connection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAY,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,OAAO,GAAG,OAAO,CAAC;AAE9D,qBAAa,UAAU;IACrB;;OAEG;IACI,MAAM,EAAG,WAAW,CAAC;IAE5B;;OAEG;IACI,QAAQ,EAAG,QAAQ,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,uBAAuB,UAAS;
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAY,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,OAAO,GAAG,OAAO,CAAC;AAE9D,qBAAa,UAAU;IACrB;;OAEG;IACI,MAAM,EAAG,WAAW,CAAC;IAE5B;;OAEG;IACI,QAAQ,EAAG,QAAQ,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,uBAAuB,UAAS;IAE1C;;OAEG;IACI,cAAc,EAAE,sBAAsB,CAO3C;IAEF;;OAEG;IACU,OAAO,CAClB,sBAAsB,CAAC,EAAE,sBAAsB,GAAG,kBAAkB;IA+EtE;;OAEG;IACU,UAAU;IAUvB;;OAEG;IACI,WAAW;IAIlB;;OAEG;IACH,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAI5D;;OAEG;IACI,EAAE,CAAC,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG;IAInD;;OAEG;IACI,WAAW,CAAC,IAAI,EAAE,MAAM;CAKhC;AAED,eAAO,MAAM,UAAU,YAAmB,CAAC"}
|
package/cjs/connection.js
CHANGED
|
@@ -11,11 +11,6 @@
|
|
|
11
11
|
* A flag to check if the connection is established
|
|
12
12
|
*/
|
|
13
13
|
isConnectionEstablished = false;
|
|
14
|
-
events = {
|
|
15
|
-
connected: [],
|
|
16
|
-
error: [],
|
|
17
|
-
close: [],
|
|
18
|
-
};
|
|
19
14
|
/**
|
|
20
15
|
* Database configurations
|
|
21
16
|
*/
|
|
@@ -102,7 +97,6 @@
|
|
|
102
97
|
*/
|
|
103
98
|
on(eventName, callback) {
|
|
104
99
|
return events__default.default.subscribe(`database.connection.${eventName}`, callback);
|
|
105
|
-
// this.events[eventName].push(callback);
|
|
106
100
|
}
|
|
107
101
|
/**
|
|
108
102
|
* Use another database
|
package/cjs/connection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sources":["../src/connection.ts"],"sourcesContent":[null],"names":["setDatabaseConfigurations","log","colors","MongoClient","database","events","Database"],"mappings":"mVAWa,UAAU,CAAA;AACrB;;AAEG;AACI,IAAA,MAAM,CAAe;AAE5B;;AAEG;AACI,IAAA,QAAQ,CAAY;AAE3B;;AAEG;IACO,uBAAuB,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"connection.js","sources":["../src/connection.ts"],"sourcesContent":[null],"names":["setDatabaseConfigurations","log","colors","MongoClient","database","events","Database"],"mappings":"mVAWa,UAAU,CAAA;AACrB;;AAEG;AACI,IAAA,MAAM,CAAe;AAE5B;;AAEG;AACI,IAAA,QAAQ,CAAY;AAE3B;;AAEG;IACO,uBAAuB,GAAG,KAAK,CAAC;AAE1C;;AAEG;AACI,IAAA,cAAc,GAA2B;AAC9C,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,IAAI,EAAE,KAAK;AACX,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,MAAM,EAAE,EAAE;KACX,CAAC;AAEF;;AAEG;IACI,MAAM,OAAO,CAClB,sBAAoE,EAAA;QAEpE,IAAI,IAAI,CAAC,uBAAuB;YAAE,OAAO;AAEzC,QAAA,IAAI,sBAAsB,EAAE;YAC1B,IAAI,CAAC,cAAc,GAAG;gBACpB,GAAG,IAAI,CAAC,cAAc;AACtB,gBAAA,GAAG,sBAAsB;aAC1B,CAAC;AAEF,YAAAA,gCAAyB,CA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KACvE;AAED;;AAEG;AACI,IAAA,WAAW,CAAC,IAAY,EAAA;QAC7B,OAAO,IAAIC,iBAAQ,EAAE;aAClB,WAAW,CAAE,IAAI,CAAC,MAAsB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;aAClD,aAAa,CAAC,IAAI,CAAC,CAAC;KACxB;AACF,CAAA;AAEY,MAAA,UAAU,GAAG,IAAI,UAAU"}
|
package/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var DeselectPipeline=require('./aggregate/DeselectPipeline.js'),GeoNearPipeline=require('./aggregate/GeoNearPipeline.js'),GroupByPipeline=require('./aggregate/GroupByPipeline.js'),LimitPipeline=require('./aggregate/LimitPipeline.js'),LookupPipeline=require('./aggregate/LookupPipeline.js'),OrWherePipeline=require('./aggregate/OrWherePipeline.js'),SelectPipeline=require('./aggregate/SelectPipeline.js'),SkipPipeline=require('./aggregate/SkipPipeline.js'),SortByPipeline=require('./aggregate/SortByPipeline.js'),SortPipeline=require('./aggregate/SortPipeline.js'),SortRandomPipeline=require('./aggregate/SortRandomPipeline.js'),UnwindPipeline=require('./aggregate/UnwindPipeline.js'),WhereExpression=require('./aggregate/WhereExpression.js'),WhereExpressionPipeline=require('./aggregate/WhereExpressionPipeline.js'),WherePipeline=require('./aggregate/WherePipeline.js'),aggregate=require('./aggregate/aggregate.js'),expressions=require('./aggregate/expressions.js'),parsePipelines=require('./aggregate/parsePipelines.js'),pipeline=require('./aggregate/pipeline.js'),types=require('./aggregate/types.js'),applyFilters=require('./aggregate/filters/apply-filters.js'),blueprint=require('./blueprint/blueprint.js'),modelBlueprint=require('./blueprint/model-blueprint.js'),arrayOf=require('./casts/arrayOf.js'),castEmail=require('./casts/cast-email.js'),castModel=require('./casts/castModel.js'),expiresAfter=require('./casts/expiresAfter.js'),oneOf=require('./casts/oneOf.js'),randomString=require('./casts/random-string.js'),randomInteger=require('./casts/randomInteger.js'),shapedArray=require('./casts/shapedArray.js'),config=require('./config.js'),connection=require('./connection.js'),database=require('./database.js'),migrate=require('./migration/migrate.js'),migrationOffice=require('./migration/migration-office.js'),ModelAggregate=require('./model/ModelAggregate.js'),ModelSync=require('./model/ModelSync.js'),baseModel=require('./model/base-model.js'),crudModel=require('./model/crud-model.js'),joinable=require('./model/joinable.js'),masterMind=require('./model/master-mind.js'),model=require('./model/model.js'),types$1=require('./model/types.js'),query=require('./query/query.js'),connectToDatabase=require('./utils/connectToDatabase.js'),dropAllDatabaseIndexes=require('./utils/dropAllDatabaseIndexes.js'),listDatabaseIndexes=require('./utils/listDatabaseIndexes.js'),onceConnected=require('./utils/onceConnected.js');exports.DeselectPipeline=DeselectPipeline.DeselectPipeline;exports.deselectPipeline=DeselectPipeline.deselectPipeline;exports.GeoNearPipeline=GeoNearPipeline.GeoNearPipeline;exports.geoNearPipeline=GeoNearPipeline.geoNearPipeline;exports.GroupByPipeline=GroupByPipeline.GroupByPipeline;exports.groupByPipeline=GroupByPipeline.groupByPipeline;exports.LimitPipeline=LimitPipeline.LimitPipeline;exports.limitPipeline=LimitPipeline.limitPipeline;exports.LookupPipeline=LookupPipeline.LookupPipeline;exports.lookupPipeline=LookupPipeline.lookupPipeline;exports.OrWherePipeline=OrWherePipeline.OrWherePipeline;exports.orWherePipeline=OrWherePipeline.orWherePipeline;exports.SelectPipeline=SelectPipeline.SelectPipeline;exports.selectPipeline=SelectPipeline.selectPipeline;exports.SkipPipeline=SkipPipeline.SkipPipeline;exports.skipPipeline=SkipPipeline.skipPipeline;exports.SortByPipeline=SortByPipeline.SortByPipeline;exports.sortByPipeline=SortByPipeline.sortByPipeline;exports.SortPipeline=SortPipeline.SortPipeline;exports.sortPipeline=SortPipeline.sortPipeline;exports.SortRandomPipeline=SortRandomPipeline.SortRandomPipeline;exports.sortRandomPipeline=SortRandomPipeline.sortRandomPipeline;exports.UnwindPipeline=UnwindPipeline.UnwindPipeline;exports.unwindPipeline=UnwindPipeline.unwindPipeline;exports.WhereExpression=WhereExpression.WhereExpression;exports.parseValuesInObject=WhereExpression.parseValuesInObject;exports.toOperator=WhereExpression.toOperator;exports.WhereExpressionPipeline=WhereExpressionPipeline.WhereExpressionPipeline;exports.WherePipeline=WherePipeline.WherePipeline;exports.wherePipeline=WherePipeline.wherePipeline;exports.Aggregate=aggregate.Aggregate;exports.$agg=expressions.$agg;exports._divide=expressions._divide;exports._multiply=expressions._multiply;exports._round=expressions._round;exports.addToSet=expressions.addToSet;exports.all=expressions.all;exports.average=expressions.average;exports.avg=expressions.avg;exports.between=expressions.between;exports.booleanCond=expressions.booleanCond;exports.columnName=expressions.columnName;exports.columns=expressions.columns;exports.concat=expressions.concat;exports.concatWith=expressions.concatWith;exports.cond=expressions.cond;exports.condition=expressions.condition;exports.count=expressions.count;exports.dayOfMonth=expressions.dayOfMonth;exports.dayOfWeek=expressions.dayOfWeek;exports.divide=expressions.divide;exports.eq=expressions.eq;exports.equal=expressions.equal;exports.exists=expressions.exists;exports.expr=expressions.expr;exports.first=expressions.first;exports.firstDayOfMonth=expressions.firstDayOfMonth;exports.firstMonth=expressions.firstMonth;exports.firstYear=expressions.firstYear;exports.greaterThan=expressions.greaterThan;exports.greaterThanOrEqual=expressions.greaterThanOrEqual;exports.gt=expressions.gt;exports.gte=expressions.gte;exports.inArray=expressions.inArray;exports.isNull=expressions.isNull;exports.last=expressions.last;exports.lastDayOfMonth=expressions.lastDayOfMonth;exports.lastMonth=expressions.lastMonth;exports.lastYear=expressions.lastYear;exports.lessThan=expressions.lessThan;exports.lessThanOrEqual=expressions.lessThanOrEqual;exports.like=expressions.like;exports.lt=expressions.lt;exports.lte=expressions.lte;exports.max=expressions.max;exports.merge=expressions.merge;exports.mergeWith=expressions.mergeWith;exports.min=expressions.min;exports.month=expressions.month;exports.multiply=expressions.multiply;exports.ne=expressions.ne;exports.nin=expressions.nin;exports.notBetween=expressions.notBetween;exports.notEqual=expressions.notEqual;exports.notExists=expressions.notExists;exports.notIn=expressions.notIn;exports.notInArray=expressions.notInArray;exports.notLike=expressions.notLike;exports.notNull=expressions.notNull;exports.push=expressions.push;exports.regex=expressions.regex;exports.round=expressions.round;exports.size=expressions.size;exports.sum=expressions.sum;exports.week=expressions.week;exports.year=expressions.year;exports.parsePipeline=parsePipelines.parsePipeline;exports.parsePipelines=parsePipelines.parsePipelines;exports.Pipeline=pipeline.Pipeline;exports.whereOperators=types.whereOperators;exports.applyFilters=applyFilters.applyFilters;exports.Blueprint=blueprint.Blueprint;exports.blueprint=blueprint.blueprint;exports.ModelBlueprint=modelBlueprint.ModelBlueprint;exports.modelBlueprint=modelBlueprint.modelBlueprint;exports.arrayOf=arrayOf.arrayOf;exports.castEmail=castEmail.castEmail;exports.castModel=castModel.castModel;exports.expiresAfter=expiresAfter.expiresAfter;exports.castEnum=oneOf.castEnum;exports.oneOf=oneOf.oneOf;exports.randomString=randomString.randomString;exports.randomInteger=randomInteger.randomInteger;Object.defineProperty(exports,'ShapedArrayType',{enumerable:true,get:function(){return shapedArray.ShapedArrayType}});exports.shapedArray=shapedArray.shapedArray;exports.getDatabaseConfig=config.getDatabaseConfig;exports.getDatabaseConfigurations=config.getDatabaseConfigurations;exports.getDatabaseDebugLevel=config.getDatabaseDebugLevel;exports.setDatabaseConfigurations=config.setDatabaseConfigurations;exports.Connection=connection.Connection;exports.connection=connection.connection;exports.Database=database.Database;exports.database=database.database;exports.dropMigrations=migrate.dropMigrations;exports.listMigrations=migrate.listMigrations;exports.migrate=migrate.migrate;exports.MigrationOffice=migrationOffice.MigrationOffice;exports.migrationOffice=migrationOffice.migrationOffice;exports.ModelAggregate=ModelAggregate.ModelAggregate;exports.ModelSync=ModelSync.ModelSync;exports.BaseModel=baseModel.BaseModel;exports.CrudModel=crudModel.CrudModel;exports.Joinable=joinable.Joinable;exports.MasterMind=masterMind.MasterMind;exports.masterMind=masterMind.masterMind;exports.Model=model.Model;Object.defineProperty(exports,'ModelDeleteStrategy',{enumerable:true,get:function(){return types$1.ModelDeleteStrategy}});exports.Query=query.Query;exports.query=query.query;exports.connectToDatabase=connectToDatabase.connectToDatabase;exports.dropAllDatabaseIndexes=dropAllDatabaseIndexes.dropAllDatabaseIndexes;exports.listDatabaseIndexes=listDatabaseIndexes.listDatabaseIndexes;exports.listIndexesForCertainCollections=listDatabaseIndexes.listIndexesForCertainCollections;exports.printCollectionIndexes=listDatabaseIndexes.printCollectionIndexes;exports.onceConnected=onceConnected.onceConnected;//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';var DeselectPipeline=require('./aggregate/DeselectPipeline.js'),GeoNearPipeline=require('./aggregate/GeoNearPipeline.js'),GroupByPipeline=require('./aggregate/GroupByPipeline.js'),LimitPipeline=require('./aggregate/LimitPipeline.js'),LookupPipeline=require('./aggregate/LookupPipeline.js'),OrWherePipeline=require('./aggregate/OrWherePipeline.js'),SelectPipeline=require('./aggregate/SelectPipeline.js'),SkipPipeline=require('./aggregate/SkipPipeline.js'),SortByPipeline=require('./aggregate/SortByPipeline.js'),SortPipeline=require('./aggregate/SortPipeline.js'),SortRandomPipeline=require('./aggregate/SortRandomPipeline.js'),UnwindPipeline=require('./aggregate/UnwindPipeline.js'),WhereExpression=require('./aggregate/WhereExpression.js'),WhereExpressionPipeline=require('./aggregate/WhereExpressionPipeline.js'),WherePipeline=require('./aggregate/WherePipeline.js'),aggregate=require('./aggregate/aggregate.js'),expressions=require('./aggregate/expressions.js'),parsePipelines=require('./aggregate/parsePipelines.js'),pipeline=require('./aggregate/pipeline.js'),types=require('./aggregate/types.js'),applyFilters=require('./aggregate/filters/apply-filters.js'),blueprint=require('./blueprint/blueprint.js'),modelBlueprint=require('./blueprint/model-blueprint.js'),arrayOf=require('./casts/arrayOf.js'),castEmail=require('./casts/cast-email.js'),castModel=require('./casts/castModel.js'),expiresAfter=require('./casts/expiresAfter.js'),oneOf=require('./casts/oneOf.js'),randomString=require('./casts/random-string.js'),randomInteger=require('./casts/randomInteger.js'),shapedArray=require('./casts/shapedArray.js'),config=require('./config.js'),connection=require('./connection.js'),database=require('./database.js'),migrate=require('./migration/migrate.js'),migrationOffice=require('./migration/migration-office.js'),ModelAggregate=require('./model/ModelAggregate.js'),ModelSync=require('./model/ModelSync.js'),baseModel=require('./model/base-model.js'),crudModel=require('./model/crud-model.js'),joinable=require('./model/joinable.js'),masterMind=require('./model/master-mind.js'),model=require('./model/model.js'),types$1=require('./model/types.js'),query=require('./query/query.js'),connectToDatabase=require('./utils/connectToDatabase.js'),dropAllDatabaseIndexes=require('./utils/dropAllDatabaseIndexes.js'),listDatabaseIndexes=require('./utils/listDatabaseIndexes.js'),onceConnected=require('./utils/onceConnected.js'),syncWith=require('./utils/sync-with.js');exports.DeselectPipeline=DeselectPipeline.DeselectPipeline;exports.deselectPipeline=DeselectPipeline.deselectPipeline;exports.GeoNearPipeline=GeoNearPipeline.GeoNearPipeline;exports.geoNearPipeline=GeoNearPipeline.geoNearPipeline;exports.GroupByPipeline=GroupByPipeline.GroupByPipeline;exports.groupByPipeline=GroupByPipeline.groupByPipeline;exports.LimitPipeline=LimitPipeline.LimitPipeline;exports.limitPipeline=LimitPipeline.limitPipeline;exports.LookupPipeline=LookupPipeline.LookupPipeline;exports.lookupPipeline=LookupPipeline.lookupPipeline;exports.OrWherePipeline=OrWherePipeline.OrWherePipeline;exports.orWherePipeline=OrWherePipeline.orWherePipeline;exports.SelectPipeline=SelectPipeline.SelectPipeline;exports.selectPipeline=SelectPipeline.selectPipeline;exports.SkipPipeline=SkipPipeline.SkipPipeline;exports.skipPipeline=SkipPipeline.skipPipeline;exports.SortByPipeline=SortByPipeline.SortByPipeline;exports.sortByPipeline=SortByPipeline.sortByPipeline;exports.SortPipeline=SortPipeline.SortPipeline;exports.sortPipeline=SortPipeline.sortPipeline;exports.SortRandomPipeline=SortRandomPipeline.SortRandomPipeline;exports.sortRandomPipeline=SortRandomPipeline.sortRandomPipeline;exports.UnwindPipeline=UnwindPipeline.UnwindPipeline;exports.unwindPipeline=UnwindPipeline.unwindPipeline;exports.WhereExpression=WhereExpression.WhereExpression;exports.parseValuesInObject=WhereExpression.parseValuesInObject;exports.toOperator=WhereExpression.toOperator;exports.WhereExpressionPipeline=WhereExpressionPipeline.WhereExpressionPipeline;exports.WherePipeline=WherePipeline.WherePipeline;exports.wherePipeline=WherePipeline.wherePipeline;exports.Aggregate=aggregate.Aggregate;exports.$agg=expressions.$agg;exports._divide=expressions._divide;exports._multiply=expressions._multiply;exports._round=expressions._round;exports.addToSet=expressions.addToSet;exports.all=expressions.all;exports.average=expressions.average;exports.avg=expressions.avg;exports.between=expressions.between;exports.booleanCond=expressions.booleanCond;exports.columnName=expressions.columnName;exports.columns=expressions.columns;exports.concat=expressions.concat;exports.concatWith=expressions.concatWith;exports.cond=expressions.cond;exports.condition=expressions.condition;exports.count=expressions.count;exports.dayOfMonth=expressions.dayOfMonth;exports.dayOfWeek=expressions.dayOfWeek;exports.divide=expressions.divide;exports.eq=expressions.eq;exports.equal=expressions.equal;exports.exists=expressions.exists;exports.expr=expressions.expr;exports.first=expressions.first;exports.firstDayOfMonth=expressions.firstDayOfMonth;exports.firstMonth=expressions.firstMonth;exports.firstYear=expressions.firstYear;exports.greaterThan=expressions.greaterThan;exports.greaterThanOrEqual=expressions.greaterThanOrEqual;exports.gt=expressions.gt;exports.gte=expressions.gte;exports.inArray=expressions.inArray;exports.isNull=expressions.isNull;exports.last=expressions.last;exports.lastDayOfMonth=expressions.lastDayOfMonth;exports.lastMonth=expressions.lastMonth;exports.lastYear=expressions.lastYear;exports.lessThan=expressions.lessThan;exports.lessThanOrEqual=expressions.lessThanOrEqual;exports.like=expressions.like;exports.lt=expressions.lt;exports.lte=expressions.lte;exports.max=expressions.max;exports.merge=expressions.merge;exports.mergeWith=expressions.mergeWith;exports.min=expressions.min;exports.month=expressions.month;exports.multiply=expressions.multiply;exports.ne=expressions.ne;exports.nin=expressions.nin;exports.notBetween=expressions.notBetween;exports.notEqual=expressions.notEqual;exports.notExists=expressions.notExists;exports.notIn=expressions.notIn;exports.notInArray=expressions.notInArray;exports.notLike=expressions.notLike;exports.notNull=expressions.notNull;exports.push=expressions.push;exports.regex=expressions.regex;exports.round=expressions.round;exports.size=expressions.size;exports.sum=expressions.sum;exports.week=expressions.week;exports.year=expressions.year;exports.parsePipeline=parsePipelines.parsePipeline;exports.parsePipelines=parsePipelines.parsePipelines;exports.Pipeline=pipeline.Pipeline;exports.whereOperators=types.whereOperators;exports.applyFilters=applyFilters.applyFilters;exports.Blueprint=blueprint.Blueprint;exports.blueprint=blueprint.blueprint;exports.ModelBlueprint=modelBlueprint.ModelBlueprint;exports.modelBlueprint=modelBlueprint.modelBlueprint;exports.arrayOf=arrayOf.arrayOf;exports.castEmail=castEmail.castEmail;exports.castModel=castModel.castModel;exports.expiresAfter=expiresAfter.expiresAfter;exports.castEnum=oneOf.castEnum;exports.oneOf=oneOf.oneOf;exports.randomString=randomString.randomString;exports.randomInteger=randomInteger.randomInteger;Object.defineProperty(exports,'ShapedArrayType',{enumerable:true,get:function(){return shapedArray.ShapedArrayType}});exports.shapedArray=shapedArray.shapedArray;exports.getDatabaseConfig=config.getDatabaseConfig;exports.getDatabaseConfigurations=config.getDatabaseConfigurations;exports.getDatabaseDebugLevel=config.getDatabaseDebugLevel;exports.setDatabaseConfigurations=config.setDatabaseConfigurations;exports.Connection=connection.Connection;exports.connection=connection.connection;exports.Database=database.Database;exports.database=database.database;exports.dropMigrations=migrate.dropMigrations;exports.listMigrations=migrate.listMigrations;exports.migrate=migrate.migrate;exports.MigrationOffice=migrationOffice.MigrationOffice;exports.migrationOffice=migrationOffice.migrationOffice;exports.ModelAggregate=ModelAggregate.ModelAggregate;exports.ModelSync=ModelSync.ModelSync;exports.BaseModel=baseModel.BaseModel;exports.CrudModel=crudModel.CrudModel;exports.Joinable=joinable.Joinable;exports.MasterMind=masterMind.MasterMind;exports.masterMind=masterMind.masterMind;exports.Model=model.Model;Object.defineProperty(exports,'ModelDeleteStrategy',{enumerable:true,get:function(){return types$1.ModelDeleteStrategy}});exports.Query=query.Query;exports.query=query.query;exports.connectToDatabase=connectToDatabase.connectToDatabase;exports.dropAllDatabaseIndexes=dropAllDatabaseIndexes.dropAllDatabaseIndexes;exports.listDatabaseIndexes=listDatabaseIndexes.listDatabaseIndexes;exports.listIndexesForCertainCollections=listDatabaseIndexes.listIndexesForCertainCollections;exports.printCollectionIndexes=listDatabaseIndexes.printCollectionIndexes;exports.onceConnected=onceConnected.onceConnected;exports.registerSyncs=syncWith.registerSyncs;exports.syncMany=syncWith.syncMany;exports.syncManyOnCreateFrom=syncWith.syncManyOnCreateFrom;exports.syncUnsetOnDelete=syncWith.syncUnsetOnDelete;exports.syncWith=syncWith.syncWith;//# sourceMappingURL=index.js.map
|
package/cjs/utils/index.d.ts
CHANGED
package/cjs/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Model } from "./../model/model";
|
|
2
|
+
/**
|
|
3
|
+
* Setup bidirectional sync between two models
|
|
4
|
+
* When source model is updated, all target models with matching field are updated
|
|
5
|
+
*/
|
|
6
|
+
export declare function syncWith(sourceModel: typeof Model, targetModel: typeof Model, targetField: string, embedProperty?: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Helper to register multiple sync relationships at once
|
|
9
|
+
*/
|
|
10
|
+
export declare function registerSyncs(syncs: {
|
|
11
|
+
source: typeof Model;
|
|
12
|
+
target: typeof Model;
|
|
13
|
+
targetField: string;
|
|
14
|
+
}[]): void;
|
|
15
|
+
/**
|
|
16
|
+
* Sync multiple documents with a single model
|
|
17
|
+
*/
|
|
18
|
+
export declare function syncMany(sourceModel: typeof Model, targetModel: typeof Model, targetField: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Add a new value to the target field when the source model is created
|
|
21
|
+
*/
|
|
22
|
+
export declare function syncManyOnCreateFrom(sourceModel: typeof Model, targetModel: typeof Model, targetField: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Unset the target field when the source model is deleted
|
|
25
|
+
*/
|
|
26
|
+
export declare function syncUnsetOnDelete(sourceModel: typeof Model, targetModel: typeof Model, targetField: string): void;
|
|
27
|
+
//# sourceMappingURL=sync-with.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-with.d.ts","sourceRoot":"","sources":["../../src/utils/sync-with.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,MAAM,EACnB,aAAa,SAAc,QAwB5B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE;IACL,MAAM,EAAE,OAAO,KAAK,CAAC;IACrB,MAAM,EAAE,OAAO,KAAK,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,EAAE,QAKJ;AAED;;GAEG;AACH,wBAAgB,QAAQ,CACtB,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,MAAM,QAWpB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,MAAM,QAWpB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,MAAM,QAMpB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';/**
|
|
2
|
+
* Setup bidirectional sync between two models
|
|
3
|
+
* When source model is updated, all target models with matching field are updated
|
|
4
|
+
*/
|
|
5
|
+
function syncWith(sourceModel, targetModel, targetField, embedProperty = "embedData") {
|
|
6
|
+
sourceModel.events().onUpdated(async (model) => {
|
|
7
|
+
try {
|
|
8
|
+
const targets = await targetModel.list({
|
|
9
|
+
[targetField + ".id"]: model.id,
|
|
10
|
+
});
|
|
11
|
+
// Batch update for better performance
|
|
12
|
+
await Promise.all(targets.map(item => item.save({
|
|
13
|
+
[targetField]: embedProperty ? model[embedProperty] : model,
|
|
14
|
+
})));
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
console.error(`Failed to sync ${sourceModel.name} -> ${targetModel.name}:`, error);
|
|
18
|
+
// Optionally: emit error event, log to monitoring service, etc.
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Helper to register multiple sync relationships at once
|
|
24
|
+
*/
|
|
25
|
+
function registerSyncs(syncs) {
|
|
26
|
+
syncs.forEach(({ source, target, targetField }) => {
|
|
27
|
+
syncWith(source, target, targetField);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Sync multiple documents with a single model
|
|
32
|
+
*/
|
|
33
|
+
function syncMany(sourceModel, targetModel, targetField) {
|
|
34
|
+
sourceModel.events().onUpdated(async (model) => {
|
|
35
|
+
const targets = await targetModel.list({
|
|
36
|
+
[targetField + ".id"]: model.id,
|
|
37
|
+
});
|
|
38
|
+
await Promise.all(targets.map(item => item.reassociate(targetField, model).save()));
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Add a new value to the target field when the source model is created
|
|
43
|
+
*/
|
|
44
|
+
function syncManyOnCreateFrom(sourceModel, targetModel, targetField) {
|
|
45
|
+
sourceModel.events().onCreated(async (model) => {
|
|
46
|
+
const targets = await targetModel.list({
|
|
47
|
+
[targetField + ".id"]: model.id,
|
|
48
|
+
});
|
|
49
|
+
await Promise.all(targets.map(item => item.associate(targetField, model).save()));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Unset the target field when the source model is deleted
|
|
54
|
+
*/
|
|
55
|
+
function syncUnsetOnDelete(sourceModel, targetModel, targetField) {
|
|
56
|
+
sourceModel.events().onDeleted(async (model) => {
|
|
57
|
+
const targets = await targetModel.list({ [targetField + ".id"]: model.id });
|
|
58
|
+
await Promise.all(targets.map(item => item.unset(targetField).save()));
|
|
59
|
+
});
|
|
60
|
+
}exports.registerSyncs=registerSyncs;exports.syncMany=syncMany;exports.syncManyOnCreateFrom=syncManyOnCreateFrom;exports.syncUnsetOnDelete=syncUnsetOnDelete;exports.syncWith=syncWith;//# sourceMappingURL=sync-with.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-with.js","sources":["../../src/utils/sync-with.ts"],"sourcesContent":[null],"names":[],"mappings":"aAEA;;;AAGG;AACG,SAAU,QAAQ,CACtB,WAAyB,EACzB,WAAyB,EACzB,WAAmB,EACnB,aAAa,GAAG,WAAW,EAAA;IAE3B,WAAW,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,OAAM,KAAK,KAAG;QAC3C,IAAI;AACF,YAAA,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC;AACrC,gBAAA,CAAC,WAAW,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE;AAChC,aAAA,CAAC,CAAC;;AAGH,YAAA,MAAM,OAAO,CAAC,GAAG,CACf,OAAO,CAAC,GAAG,CAAC,IAAI,IACd,IAAI,CAAC,IAAI,CAAC;AACR,gBAAA,CAAC,WAAW,GAAG,aAAa,G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CAAC,WAAW,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE;AAChC,SAAA,CAAC,CAAC;QAEH,MAAM,OAAO,CAAC,GAAG,CACf,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAC/D,CAAC;AACJ,KAAC,CAAC,CAAC;AACL,CAAC;AAED;;AAEG;SACa,iBAAiB,CAC/B,WAAyB,EACzB,WAAyB,EACzB,WAAmB,EAAA;IAEnB,WAAW,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,OAAM,KAAK,KAAG;AAC3C,QAAA,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5E,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACzE,KAAC,CAAC,CAAC;AACL"}
|
package/esm/connection.d.ts
CHANGED
package/esm/connection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAY,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,OAAO,GAAG,OAAO,CAAC;AAE9D,qBAAa,UAAU;IACrB;;OAEG;IACI,MAAM,EAAG,WAAW,CAAC;IAE5B;;OAEG;IACI,QAAQ,EAAG,QAAQ,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,uBAAuB,UAAS;
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAY,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,OAAO,GAAG,OAAO,CAAC;AAE9D,qBAAa,UAAU;IACrB;;OAEG;IACI,MAAM,EAAG,WAAW,CAAC;IAE5B;;OAEG;IACI,QAAQ,EAAG,QAAQ,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,uBAAuB,UAAS;IAE1C;;OAEG;IACI,cAAc,EAAE,sBAAsB,CAO3C;IAEF;;OAEG;IACU,OAAO,CAClB,sBAAsB,CAAC,EAAE,sBAAsB,GAAG,kBAAkB;IA+EtE;;OAEG;IACU,UAAU;IAUvB;;OAEG;IACI,WAAW;IAIlB;;OAEG;IACH,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAI5D;;OAEG;IACI,EAAE,CAAC,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG;IAInD;;OAEG;IACI,WAAW,CAAC,IAAI,EAAE,MAAM;CAKhC;AAED,eAAO,MAAM,UAAU,YAAmB,CAAC"}
|
package/esm/connection.js
CHANGED
|
@@ -11,11 +11,6 @@ import {colors}from'@mongez/copper';import events from'@mongez/events';import {l
|
|
|
11
11
|
* A flag to check if the connection is established
|
|
12
12
|
*/
|
|
13
13
|
isConnectionEstablished = false;
|
|
14
|
-
events = {
|
|
15
|
-
connected: [],
|
|
16
|
-
error: [],
|
|
17
|
-
close: [],
|
|
18
|
-
};
|
|
19
14
|
/**
|
|
20
15
|
* Database configurations
|
|
21
16
|
*/
|
|
@@ -102,7 +97,6 @@ import {colors}from'@mongez/copper';import events from'@mongez/events';import {l
|
|
|
102
97
|
*/
|
|
103
98
|
on(eventName, callback) {
|
|
104
99
|
return events.subscribe(`database.connection.${eventName}`, callback);
|
|
105
|
-
// this.events[eventName].push(callback);
|
|
106
100
|
}
|
|
107
101
|
/**
|
|
108
102
|
* Use another database
|
package/esm/connection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sources":["../src/connection.ts"],"sourcesContent":[null],"names":[],"mappings":"sPAWa,UAAU,CAAA;AACrB;;AAEG;AACI,IAAA,MAAM,CAAe;AAE5B;;AAEG;AACI,IAAA,QAAQ,CAAY;AAE3B;;AAEG;IACO,uBAAuB,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"connection.js","sources":["../src/connection.ts"],"sourcesContent":[null],"names":[],"mappings":"sPAWa,UAAU,CAAA;AACrB;;AAEG;AACI,IAAA,MAAM,CAAe;AAE5B;;AAEG;AACI,IAAA,QAAQ,CAAY;AAE3B;;AAEG;IACO,uBAAuB,GAAG,KAAK,CAAC;AAE1C;;AAEG;AACI,IAAA,cAAc,GAA2B;AAC9C,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,IAAI,EAAE,KAAK;AACX,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,MAAM,EAAE,EAAE;KACX,CAAC;AAEF;;AAEG;IACI,MAAM,OAAO,CAClB,sBAAoE,EAAA;QAEpE,IAAI,IAAI,CAAC,uBAAuB;YAAE,OAAO;AAEzC,QAAA,IAAI,sBAAsB,EAAE;YAC1B,IAAI,CAAC,cAAc,GAAG;gBACpB,GAAG,IAAI,CAAC,cAAc;AACtB,gBAAA,GAAG,sBAAsB;aAC1B,CAAC;AAEF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C;KACvE;AAED;;AAEG;AACI,IAAA,WAAW,CAAC,IAAY,EAAA;QAC7B,OAAO,IAAI,QAAQ,EAAE;aAClB,WAAW,CAAE,IAAI,CAAC,MAAsB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;aAClD,aAAa,CAAC,IAAI,CAAC,CAAC;KACxB;AACF,CAAA;AAEY,MAAA,UAAU,GAAG,IAAI,UAAU"}
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{DeselectPipeline,deselectPipeline}from'./aggregate/DeselectPipeline.js';export{GeoNearPipeline,geoNearPipeline}from'./aggregate/GeoNearPipeline.js';export{GroupByPipeline,groupByPipeline}from'./aggregate/GroupByPipeline.js';export{LimitPipeline,limitPipeline}from'./aggregate/LimitPipeline.js';export{LookupPipeline,lookupPipeline}from'./aggregate/LookupPipeline.js';export{OrWherePipeline,orWherePipeline}from'./aggregate/OrWherePipeline.js';export{SelectPipeline,selectPipeline}from'./aggregate/SelectPipeline.js';export{SkipPipeline,skipPipeline}from'./aggregate/SkipPipeline.js';export{SortByPipeline,sortByPipeline}from'./aggregate/SortByPipeline.js';export{SortPipeline,sortPipeline}from'./aggregate/SortPipeline.js';export{SortRandomPipeline,sortRandomPipeline}from'./aggregate/SortRandomPipeline.js';export{UnwindPipeline,unwindPipeline}from'./aggregate/UnwindPipeline.js';export{WhereExpression,parseValuesInObject,toOperator}from'./aggregate/WhereExpression.js';export{WhereExpressionPipeline}from'./aggregate/WhereExpressionPipeline.js';export{WherePipeline,wherePipeline}from'./aggregate/WherePipeline.js';export{Aggregate}from'./aggregate/aggregate.js';export{$agg,_divide,_multiply,_round,addToSet,all,average,avg,between,booleanCond,columnName,columns,concat,concatWith,cond,condition,count,dayOfMonth,dayOfWeek,divide,eq,equal,exists,expr,first,firstDayOfMonth,firstMonth,firstYear,greaterThan,greaterThanOrEqual,gt,gte,inArray,isNull,last,lastDayOfMonth,lastMonth,lastYear,lessThan,lessThanOrEqual,like,lt,lte,max,merge,mergeWith,min,month,multiply,ne,nin,notBetween,notEqual,notExists,notIn,notInArray,notLike,notNull,push,regex,round,size,sum,week,year}from'./aggregate/expressions.js';export{parsePipeline,parsePipelines}from'./aggregate/parsePipelines.js';export{Pipeline}from'./aggregate/pipeline.js';export{whereOperators}from'./aggregate/types.js';export{applyFilters}from'./aggregate/filters/apply-filters.js';export{Blueprint,blueprint}from'./blueprint/blueprint.js';export{ModelBlueprint,modelBlueprint}from'./blueprint/model-blueprint.js';export{arrayOf}from'./casts/arrayOf.js';export{castEmail}from'./casts/cast-email.js';export{castModel}from'./casts/castModel.js';export{expiresAfter}from'./casts/expiresAfter.js';export{castEnum,oneOf}from'./casts/oneOf.js';export{randomString}from'./casts/random-string.js';export{randomInteger}from'./casts/randomInteger.js';export{ShapedArrayType,shapedArray}from'./casts/shapedArray.js';export{getDatabaseConfig,getDatabaseConfigurations,getDatabaseDebugLevel,setDatabaseConfigurations}from'./config.js';export{Connection,connection}from'./connection.js';export{Database,database}from'./database.js';export{dropMigrations,listMigrations,migrate}from'./migration/migrate.js';export{MigrationOffice,migrationOffice}from'./migration/migration-office.js';export{ModelAggregate}from'./model/ModelAggregate.js';export{ModelSync}from'./model/ModelSync.js';export{BaseModel}from'./model/base-model.js';export{CrudModel}from'./model/crud-model.js';export{Joinable}from'./model/joinable.js';export{MasterMind,masterMind}from'./model/master-mind.js';export{Model}from'./model/model.js';export{ModelDeleteStrategy}from'./model/types.js';export{Query,query}from'./query/query.js';export{connectToDatabase}from'./utils/connectToDatabase.js';export{dropAllDatabaseIndexes}from'./utils/dropAllDatabaseIndexes.js';export{listDatabaseIndexes,listIndexesForCertainCollections,printCollectionIndexes}from'./utils/listDatabaseIndexes.js';export{onceConnected}from'./utils/onceConnected.js';//# sourceMappingURL=index.js.map
|
|
1
|
+
export{DeselectPipeline,deselectPipeline}from'./aggregate/DeselectPipeline.js';export{GeoNearPipeline,geoNearPipeline}from'./aggregate/GeoNearPipeline.js';export{GroupByPipeline,groupByPipeline}from'./aggregate/GroupByPipeline.js';export{LimitPipeline,limitPipeline}from'./aggregate/LimitPipeline.js';export{LookupPipeline,lookupPipeline}from'./aggregate/LookupPipeline.js';export{OrWherePipeline,orWherePipeline}from'./aggregate/OrWherePipeline.js';export{SelectPipeline,selectPipeline}from'./aggregate/SelectPipeline.js';export{SkipPipeline,skipPipeline}from'./aggregate/SkipPipeline.js';export{SortByPipeline,sortByPipeline}from'./aggregate/SortByPipeline.js';export{SortPipeline,sortPipeline}from'./aggregate/SortPipeline.js';export{SortRandomPipeline,sortRandomPipeline}from'./aggregate/SortRandomPipeline.js';export{UnwindPipeline,unwindPipeline}from'./aggregate/UnwindPipeline.js';export{WhereExpression,parseValuesInObject,toOperator}from'./aggregate/WhereExpression.js';export{WhereExpressionPipeline}from'./aggregate/WhereExpressionPipeline.js';export{WherePipeline,wherePipeline}from'./aggregate/WherePipeline.js';export{Aggregate}from'./aggregate/aggregate.js';export{$agg,_divide,_multiply,_round,addToSet,all,average,avg,between,booleanCond,columnName,columns,concat,concatWith,cond,condition,count,dayOfMonth,dayOfWeek,divide,eq,equal,exists,expr,first,firstDayOfMonth,firstMonth,firstYear,greaterThan,greaterThanOrEqual,gt,gte,inArray,isNull,last,lastDayOfMonth,lastMonth,lastYear,lessThan,lessThanOrEqual,like,lt,lte,max,merge,mergeWith,min,month,multiply,ne,nin,notBetween,notEqual,notExists,notIn,notInArray,notLike,notNull,push,regex,round,size,sum,week,year}from'./aggregate/expressions.js';export{parsePipeline,parsePipelines}from'./aggregate/parsePipelines.js';export{Pipeline}from'./aggregate/pipeline.js';export{whereOperators}from'./aggregate/types.js';export{applyFilters}from'./aggregate/filters/apply-filters.js';export{Blueprint,blueprint}from'./blueprint/blueprint.js';export{ModelBlueprint,modelBlueprint}from'./blueprint/model-blueprint.js';export{arrayOf}from'./casts/arrayOf.js';export{castEmail}from'./casts/cast-email.js';export{castModel}from'./casts/castModel.js';export{expiresAfter}from'./casts/expiresAfter.js';export{castEnum,oneOf}from'./casts/oneOf.js';export{randomString}from'./casts/random-string.js';export{randomInteger}from'./casts/randomInteger.js';export{ShapedArrayType,shapedArray}from'./casts/shapedArray.js';export{getDatabaseConfig,getDatabaseConfigurations,getDatabaseDebugLevel,setDatabaseConfigurations}from'./config.js';export{Connection,connection}from'./connection.js';export{Database,database}from'./database.js';export{dropMigrations,listMigrations,migrate}from'./migration/migrate.js';export{MigrationOffice,migrationOffice}from'./migration/migration-office.js';export{ModelAggregate}from'./model/ModelAggregate.js';export{ModelSync}from'./model/ModelSync.js';export{BaseModel}from'./model/base-model.js';export{CrudModel}from'./model/crud-model.js';export{Joinable}from'./model/joinable.js';export{MasterMind,masterMind}from'./model/master-mind.js';export{Model}from'./model/model.js';export{ModelDeleteStrategy}from'./model/types.js';export{Query,query}from'./query/query.js';export{connectToDatabase}from'./utils/connectToDatabase.js';export{dropAllDatabaseIndexes}from'./utils/dropAllDatabaseIndexes.js';export{listDatabaseIndexes,listIndexesForCertainCollections,printCollectionIndexes}from'./utils/listDatabaseIndexes.js';export{onceConnected}from'./utils/onceConnected.js';export{registerSyncs,syncMany,syncManyOnCreateFrom,syncUnsetOnDelete,syncWith}from'./utils/sync-with.js';//# sourceMappingURL=index.js.map
|
package/esm/utils/index.d.ts
CHANGED
package/esm/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Model } from "./../model/model";
|
|
2
|
+
/**
|
|
3
|
+
* Setup bidirectional sync between two models
|
|
4
|
+
* When source model is updated, all target models with matching field are updated
|
|
5
|
+
*/
|
|
6
|
+
export declare function syncWith(sourceModel: typeof Model, targetModel: typeof Model, targetField: string, embedProperty?: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Helper to register multiple sync relationships at once
|
|
9
|
+
*/
|
|
10
|
+
export declare function registerSyncs(syncs: {
|
|
11
|
+
source: typeof Model;
|
|
12
|
+
target: typeof Model;
|
|
13
|
+
targetField: string;
|
|
14
|
+
}[]): void;
|
|
15
|
+
/**
|
|
16
|
+
* Sync multiple documents with a single model
|
|
17
|
+
*/
|
|
18
|
+
export declare function syncMany(sourceModel: typeof Model, targetModel: typeof Model, targetField: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Add a new value to the target field when the source model is created
|
|
21
|
+
*/
|
|
22
|
+
export declare function syncManyOnCreateFrom(sourceModel: typeof Model, targetModel: typeof Model, targetField: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Unset the target field when the source model is deleted
|
|
25
|
+
*/
|
|
26
|
+
export declare function syncUnsetOnDelete(sourceModel: typeof Model, targetModel: typeof Model, targetField: string): void;
|
|
27
|
+
//# sourceMappingURL=sync-with.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-with.d.ts","sourceRoot":"","sources":["../../src/utils/sync-with.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,MAAM,EACnB,aAAa,SAAc,QAwB5B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE;IACL,MAAM,EAAE,OAAO,KAAK,CAAC;IACrB,MAAM,EAAE,OAAO,KAAK,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,EAAE,QAKJ;AAED;;GAEG;AACH,wBAAgB,QAAQ,CACtB,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,MAAM,QAWpB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,MAAM,QAWpB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,OAAO,KAAK,EACzB,WAAW,EAAE,MAAM,QAMpB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup bidirectional sync between two models
|
|
3
|
+
* When source model is updated, all target models with matching field are updated
|
|
4
|
+
*/
|
|
5
|
+
function syncWith(sourceModel, targetModel, targetField, embedProperty = "embedData") {
|
|
6
|
+
sourceModel.events().onUpdated(async (model) => {
|
|
7
|
+
try {
|
|
8
|
+
const targets = await targetModel.list({
|
|
9
|
+
[targetField + ".id"]: model.id,
|
|
10
|
+
});
|
|
11
|
+
// Batch update for better performance
|
|
12
|
+
await Promise.all(targets.map(item => item.save({
|
|
13
|
+
[targetField]: embedProperty ? model[embedProperty] : model,
|
|
14
|
+
})));
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
console.error(`Failed to sync ${sourceModel.name} -> ${targetModel.name}:`, error);
|
|
18
|
+
// Optionally: emit error event, log to monitoring service, etc.
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Helper to register multiple sync relationships at once
|
|
24
|
+
*/
|
|
25
|
+
function registerSyncs(syncs) {
|
|
26
|
+
syncs.forEach(({ source, target, targetField }) => {
|
|
27
|
+
syncWith(source, target, targetField);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Sync multiple documents with a single model
|
|
32
|
+
*/
|
|
33
|
+
function syncMany(sourceModel, targetModel, targetField) {
|
|
34
|
+
sourceModel.events().onUpdated(async (model) => {
|
|
35
|
+
const targets = await targetModel.list({
|
|
36
|
+
[targetField + ".id"]: model.id,
|
|
37
|
+
});
|
|
38
|
+
await Promise.all(targets.map(item => item.reassociate(targetField, model).save()));
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Add a new value to the target field when the source model is created
|
|
43
|
+
*/
|
|
44
|
+
function syncManyOnCreateFrom(sourceModel, targetModel, targetField) {
|
|
45
|
+
sourceModel.events().onCreated(async (model) => {
|
|
46
|
+
const targets = await targetModel.list({
|
|
47
|
+
[targetField + ".id"]: model.id,
|
|
48
|
+
});
|
|
49
|
+
await Promise.all(targets.map(item => item.associate(targetField, model).save()));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Unset the target field when the source model is deleted
|
|
54
|
+
*/
|
|
55
|
+
function syncUnsetOnDelete(sourceModel, targetModel, targetField) {
|
|
56
|
+
sourceModel.events().onDeleted(async (model) => {
|
|
57
|
+
const targets = await targetModel.list({ [targetField + ".id"]: model.id });
|
|
58
|
+
await Promise.all(targets.map(item => item.unset(targetField).save()));
|
|
59
|
+
});
|
|
60
|
+
}export{registerSyncs,syncMany,syncManyOnCreateFrom,syncUnsetOnDelete,syncWith};//# sourceMappingURL=sync-with.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-with.js","sources":["../../src/utils/sync-with.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;AAGG;AACG,SAAU,QAAQ,CACtB,WAAyB,EACzB,WAAyB,EACzB,WAAmB,EACnB,aAAa,GAAG,WAAW,EAAA;IAE3B,WAAW,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,OAAM,KAAK,KAAG;QAC3C,IAAI;AACF,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,IAAI,EAAE,CAAC,CACjE,CAAC;AACJ,KAAC,CAAC,CAAC;AACL,CAAC;AAED;;AAEG;SACa,oBAAoB,CAClC,WAAyB,EACzB,WAAyB,EACzB,WAAmB,EAAA;IAEnB,WAAW,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,OAAM,KAAK,KAAG;AAC3C,QAAA,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC;AACrC,YAAA,CAAC,WAAW,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE;AAChC,SAAA,CAAC,CAAC;QAEH,MAAM,OAAO,CAAC,GAAG,CACf,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAC/D,CAAC;AACJ,KAAC,CAAC,CAAC;AACL,CAAC;AAED;;AAEG;SACa,iBAAiB,CAC/B,WAAyB,EACzB,WAAyB,EACzB,WAAmB,EAAA;IAEnB,WAAW,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,OAAM,KAAK,KAAG;AAC3C,QAAA,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5E,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACzE,KAAC,CAAC,CAAC;AACL"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warlock.js/cascade",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "ORM for managing databases",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@mongez/events": "^2.1.0",
|
|
8
|
-
"@warlock.js/logger": "4.0.
|
|
8
|
+
"@warlock.js/logger": "4.0.4",
|
|
9
9
|
"@mongez/reinforcements": "^2.3.12",
|
|
10
10
|
"@mongez/supportive-is": "^2.0.0",
|
|
11
11
|
"@mongez/time-wizard": "^1.0.6",
|