@flecks/db
Advanced tools
Comparing version 4.1.2 to 4.1.3
{ | ||
"name": "@flecks/db", | ||
"version": "4.1.2", | ||
"version": "4.1.3", | ||
"author": "cha0s", | ||
@@ -30,3 +30,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"@flecks/core": "^4.2.2", | ||
"@flecks/core": "^4.2.3", | ||
"sequelize": "^6.3.5", | ||
@@ -36,5 +36,5 @@ "sqlite3": "^5.0.2" | ||
"devDependencies": { | ||
"@flecks/build": "^4.1.2", | ||
"@flecks/fleck": "^4.1.2" | ||
"@flecks/build": "^4.1.3", | ||
"@flecks/fleck": "^4.1.3" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@flecks/core"),require("sequelize")):"function"==typeof define&&define.amd?define("@flecks/db",["@flecks/core","sequelize"],t):"object"==typeof exports?exports["@flecks/db"]=t(require("@flecks/core"),require("sequelize")):e["@flecks/db"]=t(e["@flecks/core"],e.sequelize)}(global,((e,t)=>(()=>{var r={284:(e,t,r)=>{"use strict";r.r(t),r.d(t,{hook:()=>a});var s=r(344),a=(e,t,r)=>{"@flecks/db.models"===t&&(0,s.c)(e,r.db.sequelize)}},992:(e,t,r)=>{"use strict";r.r(t),r.d(t,{hook:()=>a});var s=r(592),a=r.n(s)()},672:(e,t,r)=>{"use strict";r.r(t),r.d(t,{hook:()=>l});var s=r(540),a=r(706),o=r.n(a),n=r(344);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},i.apply(this,arguments)}var c=(0,s.D)("@flecks/db/server/connection"),l=s.Flecks.priority((async e=>{e.db.sequelize=await async function(e){var t,{dialect:r,username:a,password:l,host:d,port:u,database:f}=e.get("@flecks/db");c("config: %O",i(i({},t="sqlite"===r?{dialect:"sqlite",storage:f}:{dialect:r,username:a,password:l,host:d,port:u,database:f}),t.password?{password:"*** REDACTED ***"}:{}));for(var p=new(o())(i({logging:!1},t));;)try{await p.authenticate();break}catch(e){await new Promise((e=>{setTimeout(e,250)}))}var b=e.db.Models[s.ByType];return await(0,n.c)(b,p),c("synchronizing..."),await p.sync(),c("synchronized"),p}(e)}),{after:"@flecks/docker/server"})},344:(e,t,r)=>{"use strict";function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},s.apply(this,arguments)}r.d(t,{c:()=>a});const a=async function(e,t){Object.values(e).filter((e=>e.attributes)).forEach((e=>{e.init(e.attributes,s({sequelize:t,underscored:!0},e.modelOptions||{}))}));var r={};Object.values(e).forEach((t=>{t.associate(e)})),Object.values(e).forEach((e=>{for(var t=Object.entries(e.associations),s=0;s<t.length;s++)if(!t[s][1].isSelfAssociation){if("BelongsToMany"===t[s][1].associationType&&t[s][1].through.model.isManagedByFlecks){var{name:a}=t[s][1].through.model;r[a]||(r[a]=new Set),r[a].add(e.name)}"BelongsTo"===t[s][1].associationType&&(r[e.name]||(r[e.name]=new Set),r[e.name].add(t[s][1].target.name))}}));for(var a=Object.values(e),o=a.length;a.length>0;){for(var n=0;n<a.length;n++){var i=a[n];if(!r[i.name]||0===r[i.name].length){await i.sync(),await i.sync();for(var c=Object.keys(r),l=0;l<c.length;l++){var d=c[l];r[d].has(i.name)&&(r[d].delete(i.name),0===r[d].size&&delete r[d])}a.splice(n,1);break}}if(a.length===o)throw new TypeError("@flecks/db circular dependencies: '".concat(a.join("', '"),"'"));o=a.length}}},592:e=>{e.exports=e=>{const{dialect:t,username:r,password:s,port:a,database:o}=e.get("@flecks/db");let n,i,c={app:{host:"sequelize"}},l={};switch(t){case"mysql":c={...c,sequelize:{MYSQL_USER:r,MYSQL_DATABASE:o,MYSQL_ROOT_PASSWORD:s}},n="mysql",i="/var/lib/mysql",l={[a||3306]:3306};break;case"postgres":c={...c,sequelize:{POSTGRES_USER:r,POSTGRES_DB:o,POSTGRES_PASSWORD:s}},n="postgres",i="/var/lib/postgresql/data",l={[a||5432]:5432}}return n?{sequelize:{environment:c,image:n,mount:i,ports:l}}:{}}},180:(e,t,r)=>{var s={"./@flecks/core.hmr.gathered":284,"./@flecks/core.hmr.gathered.js":284,"./@flecks/docker.containers":992,"./@flecks/docker.containers.js":992,"./@flecks/server.up":672,"./@flecks/server.up.js":672};function a(e){var t=o(e);return r(t)}function o(e){if(!r.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}a.keys=function(){return Object.keys(s)},a.resolve=o,e.exports=a,a.id=180},540:t=>{"use strict";t.exports=e},706:e=>{"use strict";e.exports=t}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return r[e](o,o.exports,a),o.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";a.r(o),a.d(o,{Model:()=>n,Op:()=>t.Op,Sequelize:()=>r(),Transaction:()=>t.Transaction,Types:()=>t.DataTypes,hooks:()=>i,mixin:()=>c});var e=a(540),t=a(706),r=a.n(t);class s extends t.Model{static associate(){}static get attributes(){return{}}static get isManagedByFlecks(){return!0}}const n=s;var i=e.Flecks.hooks(a(180)),c=e=>class extends e{constructor(e){var t;super(e),this.db||(this.db={}),Object.defineProperty(this.db,"Models",{get:()=>this.gathered("@flecks/db.models")});var r=e=>e();Object.defineProperty(this.db,"sequelize",{get:()=>t,set:e=>{t=e,r=e.transaction.bind(e)}}),Object.defineProperty(this.db,"transaction",{get:()=>r})}}})(),o})())); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@flecks/core"),require("sequelize")):"function"==typeof define&&define.amd?define("@flecks/db",["@flecks/core","sequelize"],t):"object"==typeof exports?exports["@flecks/db"]=t(require("@flecks/core"),require("sequelize")):e["@flecks/db"]=t(e["@flecks/core"],e.sequelize)}(global,((e,t)=>(()=>{var r={103:(e,t,r)=>{"use strict";r.r(t),r.d(t,{hook:()=>a});var s=r(572),a=(e,t,r)=>{"@flecks/db.models"===t&&(0,s.A)(e,r.db.sequelize)}},651:(e,t,r)=>{"use strict";r.r(t),r.d(t,{hook:()=>a});var s=r(69),a=r.n(s)()},451:(e,t,r)=>{"use strict";r.r(t),r.d(t,{hook:()=>l});var s=r(166),a=r(747),o=r.n(a),n=r(572);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},i.apply(this,arguments)}var c=(0,s.D)("@flecks/db/server/connection"),l=s.Flecks.priority((async e=>{e.db.sequelize=await async function(e){var t,{dialect:r,username:a,password:l,host:d,port:u,database:f}=e.get("@flecks/db");c("config: %O",i(i({},t="sqlite"===r?{dialect:"sqlite",storage:f}:{dialect:r,username:a,password:l,host:d,port:u,database:f}),t.password?{password:"*** REDACTED ***"}:{}));for(var p=new(o())(i({logging:!1},t));;)try{await p.authenticate();break}catch(e){await new Promise((e=>{setTimeout(e,250)}))}var b=e.db.Models[s.ByType];return await(0,n.A)(b,p),c("synchronizing..."),await p.sync(),c("synchronized"),p}(e)}),{after:"@flecks/docker/server"})},572:(e,t,r)=>{"use strict";function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},s.apply(this,arguments)}r.d(t,{A:()=>a});const a=async function(e,t){Object.values(e).filter((e=>e.attributes)).forEach((e=>{e.init(e.attributes,s({sequelize:t,underscored:!0},e.modelOptions||{}))}));var r={};Object.values(e).forEach((t=>{t.associate(e)})),Object.values(e).forEach((e=>{for(var t=Object.entries(e.associations),s=0;s<t.length;s++)if(!t[s][1].isSelfAssociation){if("BelongsToMany"===t[s][1].associationType&&t[s][1].through.model.isManagedByFlecks){var{name:a}=t[s][1].through.model;r[a]||(r[a]=new Set),r[a].add(e.name)}"BelongsTo"===t[s][1].associationType&&(r[e.name]||(r[e.name]=new Set),r[e.name].add(t[s][1].target.name))}}));for(var a=Object.values(e),o=a.length;a.length>0;){for(var n=0;n<a.length;n++){var i=a[n];if(!r[i.name]||0===r[i.name].length){await i.sync(),await i.sync();for(var c=Object.keys(r),l=0;l<c.length;l++){var d=c[l];r[d].has(i.name)&&(r[d].delete(i.name),0===r[d].size&&delete r[d])}a.splice(n,1);break}}if(a.length===o)throw new TypeError("@flecks/db circular dependencies: '".concat(a.join("', '"),"'"));o=a.length}}},69:e=>{e.exports=e=>{const{dialect:t,username:r,password:s,port:a,database:o}=e.get("@flecks/db");let n,i,c={app:{host:"sequelize"}},l={};switch(t){case"mysql":c={...c,sequelize:{MYSQL_USER:r,MYSQL_DATABASE:o,MYSQL_ROOT_PASSWORD:s}},n="mysql",i="/var/lib/mysql",l={[a||3306]:3306};break;case"postgres":c={...c,sequelize:{POSTGRES_USER:r,POSTGRES_DB:o,POSTGRES_PASSWORD:s}},n="postgres",i="/var/lib/postgresql/data",l={[a||5432]:5432}}return n?{sequelize:{environment:c,image:n,mount:i,ports:l}}:{}}},597:(e,t,r)=>{var s={"./@flecks/core.hmr.gathered":103,"./@flecks/core.hmr.gathered.js":103,"./@flecks/docker.containers":651,"./@flecks/docker.containers.js":651,"./@flecks/server.up":451,"./@flecks/server.up.js":451};function a(e){var t=o(e);return r(t)}function o(e){if(!r.o(s,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return s[e]}a.keys=function(){return Object.keys(s)},a.resolve=o,e.exports=a,a.id=597},166:t=>{"use strict";t.exports=e},747:e=>{"use strict";e.exports=t}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return r[e](o,o.exports,a),o.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";a.r(o),a.d(o,{Model:()=>n,Op:()=>t.Op,Sequelize:()=>r(),Transaction:()=>t.Transaction,Types:()=>t.DataTypes,hooks:()=>i,mixin:()=>c});var e=a(166),t=a(747),r=a.n(t);class s extends t.Model{static associate(){}static get attributes(){return{}}static get isManagedByFlecks(){return!0}}const n=s;var i=e.Flecks.hooks(a(597)),c=e=>class extends e{constructor(e){var t;super(e),this.db||(this.db={}),Object.defineProperty(this.db,"Models",{get:()=>this.gathered("@flecks/db.models")});var r=e=>e();Object.defineProperty(this.db,"sequelize",{get:()=>t,set:e=>{t=e,r=e.transaction.bind(e)}}),Object.defineProperty(this.db,"transaction",{get:()=>r})}}})(),o})())); | ||
//# sourceMappingURL=server.js.map |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35805
+ Added@types/node@22.10.0(transitive)
- Removed@types/node@22.10.1(transitive)
Updated@flecks/core@^4.2.3