@rolster/vinegar 1.0.5 → 2.0.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/dist/cjs/index.js +63 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +61 -2
- package/dist/es/index.js.map +1 -1
- package/dist/esm/entity-manager.d.ts +1 -1
- package/dist/esm/entity-manager.js +1 -1
- package/dist/esm/entity-manager.js.map +1 -1
- package/dist/esm/repository.d.ts +1 -1
- package/package.json +7 -4
package/dist/cjs/index.js
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var helpersAdvanced = require('@rolster/helpers-advanced');
|
|
6
|
-
|
|
7
5
|
class EntityDatabase {
|
|
8
6
|
}
|
|
9
7
|
|
|
@@ -17,6 +15,67 @@ class EntityLink {
|
|
|
17
15
|
}
|
|
18
16
|
}
|
|
19
17
|
|
|
18
|
+
function itIsDefined(object) {
|
|
19
|
+
return typeof object !== 'undefined' && object !== null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
class Optional {
|
|
23
|
+
constructor(value) {
|
|
24
|
+
this.value = value;
|
|
25
|
+
}
|
|
26
|
+
present(callback) {
|
|
27
|
+
return this.isPresent() ? callback(this.get()) : undefined;
|
|
28
|
+
}
|
|
29
|
+
empty(callback) {
|
|
30
|
+
return this.isEmpty() ? callback() : undefined;
|
|
31
|
+
}
|
|
32
|
+
when(present, empty) {
|
|
33
|
+
return this.isPresent() ? present(this.get()) : empty();
|
|
34
|
+
}
|
|
35
|
+
static build(value) {
|
|
36
|
+
return itIsDefined(value) ? this.of(value) : this.empty();
|
|
37
|
+
}
|
|
38
|
+
static of(value) {
|
|
39
|
+
if (itIsDefined(value)) {
|
|
40
|
+
return new PresentOptional(value);
|
|
41
|
+
}
|
|
42
|
+
throw new Error('The passed value was null or undefined.');
|
|
43
|
+
}
|
|
44
|
+
static empty() {
|
|
45
|
+
return new EmptyOptional();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
class PresentOptional extends Optional {
|
|
49
|
+
constructor(presentValue) {
|
|
50
|
+
super(presentValue);
|
|
51
|
+
this.presentValue = presentValue;
|
|
52
|
+
}
|
|
53
|
+
isPresent() {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
isEmpty() {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
get() {
|
|
60
|
+
return this.presentValue;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
class EmptyOptional extends Optional {
|
|
64
|
+
isPresent() {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
isEmpty() {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
get() {
|
|
71
|
+
throw new Error('The optional is not present.');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function fromPromise(value) {
|
|
76
|
+
return value instanceof Promise ? value : Promise.resolve(value);
|
|
77
|
+
}
|
|
78
|
+
|
|
20
79
|
class EntityManager {
|
|
21
80
|
}
|
|
22
81
|
class RolsterEntityManager {
|
|
@@ -63,7 +122,7 @@ class RolsterEntityManager {
|
|
|
63
122
|
return entity;
|
|
64
123
|
}
|
|
65
124
|
select({ uuid }) {
|
|
66
|
-
return
|
|
125
|
+
return Optional.build(this.relations.has(uuid) ? this.relations.get(uuid) : undefined);
|
|
67
126
|
}
|
|
68
127
|
async flush() {
|
|
69
128
|
await this.persistAll();
|
|
@@ -85,7 +144,7 @@ class RolsterEntityManager {
|
|
|
85
144
|
}
|
|
86
145
|
persistAll() {
|
|
87
146
|
const { links, source } = this;
|
|
88
|
-
return Promise.all(links.map((link) =>
|
|
147
|
+
return Promise.all(links.map((link) => fromPromise(link.createModel(this)).then((model) => {
|
|
89
148
|
const { bindable, entity } = link;
|
|
90
149
|
if (bindable) {
|
|
91
150
|
this.relation(entity, model);
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../esm/database.js","../esm/datasource.js","../esm/entity-link.js","../esm/entity-manager.js","../esm/entity-sync.js","../esm/entity-update.js","../esm/entity.js","../esm/persistent-unit.js","../esm/procedure.js","../esm/repository.js"],"sourcesContent":["export class EntityDatabase {\r\n}\r\n//# sourceMappingURL=database.js.map","export class EntityDataSource {\r\n}\r\n//# sourceMappingURL=datasource.js.map","export class EntityLink {\r\n constructor(entity, bindable = true) {\r\n this.entity = entity;\r\n this.bindable = bindable;\r\n }\r\n}\r\n//# sourceMappingURL=entity-link.js.map","import { Optional, fromPromise } from '@rolster/helpers-advanced';\r\nexport class EntityManager {\r\n}\r\nexport class RolsterEntityManager {\r\n constructor(source) {\r\n this.source = source;\r\n this.links = [];\r\n this.updates = [];\r\n this.syncs = [];\r\n this.destroys = [];\r\n this.hiddens = [];\r\n this.procedures = [];\r\n this.relations = new Map();\r\n }\r\n persist(link) {\r\n this.links.push(link);\r\n }\r\n update(update) {\r\n const { bindable, entity, model } = update;\r\n if (bindable) {\r\n this.relation(entity, model);\r\n }\r\n this.updates.push(update);\r\n }\r\n sync(sync) {\r\n const { bindable, entity, model } = sync;\r\n if (bindable) {\r\n this.relation(entity, model);\r\n }\r\n this.syncs.push(sync);\r\n }\r\n destroy(entity) {\r\n this.select(entity).present((model) => {\r\n isHidden(model) ? this.hiddens.push(model) : this.destroys.push(model);\r\n });\r\n }\r\n procedure(procedure) {\r\n this.procedures.push(procedure);\r\n }\r\n relation({ uuid }, model) {\r\n this.relations.set(uuid, model);\r\n }\r\n link(entity, model) {\r\n this.relation(entity, model);\r\n return entity;\r\n }\r\n select({ uuid }) {\r\n return Optional.build(this.relations.has(uuid) ? this.relations.get(uuid) : undefined);\r\n }\r\n async flush() {\r\n await this.persistAll();\r\n await this.updateAll();\r\n await this.syncAll();\r\n await this.hiddenAll();\r\n await this.destroyAll();\r\n await this.procedureAll();\r\n this.dispose();\r\n }\r\n dispose() {\r\n this.relations.clear();\r\n this.links = [];\r\n this.updates = [];\r\n this.syncs = [];\r\n this.destroys = [];\r\n this.hiddens = [];\r\n this.procedures = [];\r\n }\r\n persistAll() {\r\n const { links, source } = this;\r\n return Promise.all(links.map((link) => fromPromise(link.createModel(this)).then((model) => {\r\n const { bindable, entity } = link;\r\n if (bindable) {\r\n this.relation(entity, model);\r\n }\r\n return source.insert(model);\r\n })));\r\n }\r\n updateAll() {\r\n const { source, updates } = this;\r\n return Promise.all(updates.map(({ model }) => source.update(model)));\r\n }\r\n syncAll() {\r\n const { destroys, source, syncs } = this;\r\n return Promise.all(syncs\r\n .filter(({ model }) => !destroys.includes(model))\r\n .reduce((syncs, sync) => {\r\n const dirty = sync.verify();\r\n if (dirty) {\r\n const { model } = sync;\r\n syncs.push({ model, dirty });\r\n }\r\n return syncs;\r\n }, [])\r\n .map(({ model, dirty }) => source.update(model, dirty)));\r\n }\r\n destroyAll() {\r\n const { destroys, source } = this;\r\n return Promise.all(destroys.map((destroy) => source.delete(destroy)));\r\n }\r\n hiddenAll() {\r\n const { hiddens, source } = this;\r\n return Promise.all(hiddens.map((hidden) => source.hidden(hidden)));\r\n }\r\n procedureAll() {\r\n const { procedures, source } = this;\r\n return Promise.all(procedures.map((procedure) => source.procedure(procedure)));\r\n }\r\n}\r\nfunction isHidden(model) {\r\n return 'hidden' in model && 'hiddenAt' in model;\r\n}\r\n//# sourceMappingURL=entity-manager.js.map","export class EntitySync {\r\n constructor(entity, model, bindable = true) {\r\n this.entity = entity;\r\n this.model = model;\r\n this.bindable = bindable;\r\n this.firstStatus = this.mapperModel(model);\r\n }\r\n verify() {\r\n this.sync();\r\n return this.createDirty();\r\n }\r\n mapperModel(model) {\r\n const dirty = {};\r\n Object.keys(model).forEach((key) => {\r\n dirty[key] = model[key];\r\n });\r\n return dirty;\r\n }\r\n createDirty() {\r\n const currentStatus = this.mapperModel(this.model);\r\n const modelDirty = {};\r\n let dirty = false;\r\n Object.keys(currentStatus).forEach((key) => {\r\n if (currentStatus[key] !== this.firstStatus[key]) {\r\n dirty = true;\r\n modelDirty[key] = currentStatus[key];\r\n }\r\n });\r\n if (isUpdated(this.model)) {\r\n modelDirty['updatedAt'] = new Date();\r\n }\r\n return dirty ? modelDirty : undefined;\r\n }\r\n}\r\nfunction isUpdated(model) {\r\n return 'updatedAt' in model;\r\n}\r\n//# sourceMappingURL=entity-sync.js.map","export class EntityUpdate {\r\n constructor(entity, model, bindable = true) {\r\n this.entity = entity;\r\n this.model = model;\r\n this.bindable = bindable;\r\n }\r\n}\r\n//# sourceMappingURL=entity-update.js.map","export class Entity {\r\n constructor(uuid) {\r\n this.uuid = uuid;\r\n }\r\n}\r\n//# sourceMappingURL=entity.js.map","export class PersistentUnit {\r\n}\r\n//# sourceMappingURL=persistent-unit.js.map","export class Procedure {\r\n}\r\n//# sourceMappingURL=procedure.js.map","export class Repository {\r\n}\r\n//# sourceMappingURL=repository.js.map"],"names":["Optional","fromPromise"],"mappings":";;;;;;AAAO,MAAM,cAAc,CAAC;AAC5B;;ACDO,MAAM,gBAAgB,CAAC;AAC9B;;ACDO,MAAM,UAAU,CAAC;AACxB,IAAI,WAAW,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,EAAE;AACzC,QAAQ,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AAC7B,QAAQ,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACjC,KAAK;AACL;;ACJO,MAAM,aAAa,CAAC;AAC3B,CAAC;AACM,MAAM,oBAAoB,CAAC;AAClC,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AAC7B,QAAQ,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;AACxB,QAAQ,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;AAC1B,QAAQ,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;AACxB,QAAQ,IAAI,CAAC,QA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IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;AAC9D,gBAAgB,KAAK,GAAG,IAAI,CAAC;AAC7B,gBAAgB,UAAU,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AACrD,aAAa;AACb,SAAS,CAAC,CAAC;AACX,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;AACnC,YAAY,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;AACjD,SAAS;AACT,QAAQ,OAAO,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;AAC9C,KAAK;AACL,CAAC;AACD,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,OAAO,WAAW,IAAI,KAAK,CAAC;AAChC;;ACpCO,MAAM,YAAY,CAAC;AAC1B,IAAI,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,IAAI,EAAE;AAChD,QAAQ,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AAC7B,QAAQ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AAC3B,QAAQ,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACjC,KAAK;AACL;;ACNO,MAAM,MAAM,CAAC;AACpB,IAAI,WAAW,CAAC,IAAI,EAAE;AACtB,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACzB,KAAK;AACL;;ACJO,MAAM,cAAc,CAAC;AAC5B;;ACDO,MAAM,SAAS,CAAC;AACvB;;ACDO,MAAM,UAAU,CAAC;AACxB;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../esm/database.js","../esm/datasource.js","../esm/entity-link.js","../../node_modules/@rolster/commons/dist/esm/helpers.js","../../node_modules/@rolster/commons/dist/esm/optional.js","../../node_modules/@rolster/commons/dist/esm/promises.js","../esm/entity-manager.js","../esm/entity-sync.js","../esm/entity-update.js","../esm/entity.js","../esm/persistent-unit.js","../esm/procedure.js","../esm/repository.js"],"sourcesContent":["export class EntityDatabase {\r\n}\r\n//# sourceMappingURL=database.js.map","export class EntityDataSource {\r\n}\r\n//# sourceMappingURL=datasource.js.map","export class EntityLink {\r\n constructor(entity, bindable = true) {\r\n this.entity = entity;\r\n this.bindable = bindable;\r\n }\r\n}\r\n//# sourceMappingURL=entity-link.js.map","const PRIMITIVES = [Date, RegExp, Function, String, Boolean, Number];\r\nconst SLICE_SIZE = 512;\r\nconst FALSY_VALUE = ['false', 'undefined', '0', 0];\r\nconst prototypeToString = Object.prototype.toString;\r\nfunction clone(object, caches) {\r\n if (typeof object !== 'object') {\r\n return object;\r\n }\r\n if (prototypeToString.call(object) === '[object Object]') {\r\n const [cacheObject] = caches.filter((cacheObject) => cacheObject === object);\r\n /* istanbul ignore if */\r\n if (cacheObject) {\r\n return cacheObject;\r\n }\r\n caches.push(object);\r\n }\r\n const prototypeObject = Object.getPrototypeOf(object);\r\n const ConstructorObject = prototypeObject.constructor;\r\n if (PRIMITIVES.includes(ConstructorObject)) {\r\n return new ConstructorObject(object);\r\n }\r\n const cloneObject = new ConstructorObject();\r\n for (const prop in object) {\r\n cloneObject[prop] = clone(object[prop], caches);\r\n }\r\n return cloneObject;\r\n}\r\nexport function itIsDefined(object) {\r\n return typeof object !== 'undefined' && object !== null;\r\n}\r\nexport function itIsUndefined(object) {\r\n return !itIsDefined(object);\r\n}\r\nexport function parseBoolean(value) {\r\n return !(itIsUndefined(value) ||\r\n value === false ||\r\n FALSY_VALUE.includes(value));\r\n}\r\nexport function parse(value) {\r\n try {\r\n return JSON.parse(value);\r\n }\r\n catch {\r\n return value;\r\n }\r\n}\r\nexport function evalValueOrFunction(value) {\r\n return typeof value === 'function' ? value() : value;\r\n}\r\nexport function deepClone(object) {\r\n return clone(object, []);\r\n}\r\nexport function deepFreeze(object) {\r\n for (const prop in object) {\r\n const value = object[prop];\r\n if (typeof value === 'object' && !Object.isFrozen(value)) {\r\n deepFreeze(value);\r\n }\r\n }\r\n return Object.freeze(object);\r\n}\r\nexport function callback(call, ...args) {\r\n return typeof call !== 'function' ? undefined : call.apply(call, args);\r\n}\r\n/* istanbul ignore next */\r\nexport function base64ToBlob(data64, mimeType) {\r\n const result64 = data64.replace(/^[^,]+,/, '').replace(/\\s/g, '');\r\n const byteCharacters = window.atob(result64);\r\n const byteArrays = [];\r\n for (let offset = 0; offset < byteCharacters.length; offset += SLICE_SIZE) {\r\n const slice = byteCharacters.slice(offset, offset + SLICE_SIZE);\r\n const byteNumbers = new Array(slice.length);\r\n for (let i = 0; i < slice.length; i++) {\r\n byteNumbers[i] = slice.charCodeAt(i);\r\n }\r\n const byteArray = new Uint8Array(byteNumbers);\r\n byteArrays.push(byteArray);\r\n }\r\n return new Blob(byteArrays, { type: mimeType });\r\n}\r\n//# sourceMappingURL=helpers.js.map","import { itIsDefined } from './helpers';\r\nexport class Optional {\r\n constructor(value) {\r\n this.value = value;\r\n }\r\n present(callback) {\r\n return this.isPresent() ? callback(this.get()) : undefined;\r\n }\r\n empty(callback) {\r\n return this.isEmpty() ? callback() : undefined;\r\n }\r\n when(present, empty) {\r\n return this.isPresent() ? present(this.get()) : empty();\r\n }\r\n static build(value) {\r\n return itIsDefined(value) ? this.of(value) : this.empty();\r\n }\r\n static of(value) {\r\n if (itIsDefined(value)) {\r\n return new PresentOptional(value);\r\n }\r\n throw new Error('The passed value was null or undefined.');\r\n }\r\n static empty() {\r\n return new EmptyOptional();\r\n }\r\n}\r\nclass PresentOptional extends Optional {\r\n constructor(presentValue) {\r\n super(presentValue);\r\n this.presentValue = presentValue;\r\n }\r\n isPresent() {\r\n return true;\r\n }\r\n isEmpty() {\r\n return false;\r\n }\r\n get() {\r\n return this.presentValue;\r\n }\r\n}\r\nclass EmptyOptional extends Optional {\r\n isPresent() {\r\n return false;\r\n }\r\n isEmpty() {\r\n return true;\r\n }\r\n get() {\r\n throw new Error('The optional is not present.');\r\n }\r\n}\r\n//# sourceMappingURL=optional.js.map","function resolvePromises(props) {\r\n const { error, index, promises, result, success } = props;\r\n if (index === promises.length) {\r\n return success(result);\r\n }\r\n const callback = promises[index];\r\n new Promise(() => {\r\n callback()\r\n .then((value) => resolvePromises({\r\n ...props,\r\n index: index + 1,\r\n result: [...result, value]\r\n }))\r\n .catch((err) => error(err));\r\n });\r\n}\r\nexport function fromPromise(value) {\r\n return value instanceof Promise ? value : Promise.resolve(value);\r\n}\r\nexport function zipPromise(promises) {\r\n return promises.length\r\n ? new Promise((resolve, reject) => {\r\n resolvePromises({\r\n error: (err) => {\r\n reject(err);\r\n },\r\n index: 0,\r\n result: [],\r\n promises,\r\n success: (result) => {\r\n resolve(result);\r\n }\r\n });\r\n })\r\n : Promise.resolve([]);\r\n}\r\nexport function thenPromise(promise, printError = false) {\r\n return promise\r\n .then(() => undefined)\r\n .catch((err) => {\r\n /* istanbul ignore if */\r\n if (printError) {\r\n console.log(err);\r\n }\r\n throw err;\r\n });\r\n}\r\nexport function voidPromise(promise, printError = false) {\r\n return promise\r\n .then(() => undefined)\r\n .catch((err) => {\r\n /* istanbul ignore if */\r\n if (printError) {\r\n console.log(err);\r\n }\r\n return undefined;\r\n });\r\n}\r\nexport function catchPromise(promise, printError = false) {\r\n return promise.catch((err) => {\r\n /* istanbul ignore if */\r\n if (printError) {\r\n console.log(err);\r\n }\r\n return undefined;\r\n });\r\n}\r\n//# sourceMappingURL=promises.js.map","import { Optional, fromPromise } from '@rolster/commons';\r\nexport class EntityManager {\r\n}\r\nexport class RolsterEntityManager {\r\n constructor(source) {\r\n this.source = source;\r\n this.links = [];\r\n this.updates = [];\r\n this.syncs = [];\r\n this.destroys = [];\r\n this.hiddens = [];\r\n this.procedures = [];\r\n this.relations = new Map();\r\n }\r\n persist(link) {\r\n this.links.push(link);\r\n }\r\n update(update) {\r\n const { bindable, entity, model } = update;\r\n if (bindable) {\r\n this.relation(entity, model);\r\n }\r\n this.updates.push(update);\r\n }\r\n sync(sync) {\r\n const { bindable, entity, model } = sync;\r\n if (bindable) {\r\n this.relation(entity, model);\r\n }\r\n this.syncs.push(sync);\r\n }\r\n destroy(entity) {\r\n this.select(entity).present((model) => {\r\n isHidden(model) ? this.hiddens.push(model) : this.destroys.push(model);\r\n });\r\n }\r\n procedure(procedure) {\r\n this.procedures.push(procedure);\r\n }\r\n relation({ uuid }, model) {\r\n this.relations.set(uuid, model);\r\n }\r\n link(entity, model) {\r\n this.relation(entity, model);\r\n return entity;\r\n }\r\n select({ uuid }) {\r\n return Optional.build(this.relations.has(uuid) ? this.relations.get(uuid) : undefined);\r\n }\r\n async flush() {\r\n await this.persistAll();\r\n await this.updateAll();\r\n await this.syncAll();\r\n await this.hiddenAll();\r\n await this.destroyAll();\r\n await this.procedureAll();\r\n this.dispose();\r\n }\r\n dispose() {\r\n this.relations.clear();\r\n this.links = [];\r\n this.updates = [];\r\n this.syncs = [];\r\n this.destroys = [];\r\n this.hiddens = [];\r\n this.procedures = [];\r\n }\r\n persistAll() {\r\n const { links, source } = this;\r\n return Promise.all(links.map((link) => fromPromise(link.createModel(this)).then((model) => {\r\n const { bindable, entity } = link;\r\n if (bindable) {\r\n this.relation(entity, model);\r\n }\r\n return source.insert(model);\r\n })));\r\n }\r\n updateAll() {\r\n const { source, updates } = this;\r\n return Promise.all(updates.map(({ model }) => source.update(model)));\r\n }\r\n syncAll() {\r\n const { destroys, source, syncs } = this;\r\n return Promise.all(syncs\r\n .filter(({ model }) => !destroys.includes(model))\r\n .reduce((syncs, sync) => {\r\n const dirty = sync.verify();\r\n if (dirty) {\r\n const { model } = sync;\r\n syncs.push({ model, dirty });\r\n }\r\n return syncs;\r\n }, [])\r\n .map(({ model, dirty }) => source.update(model, dirty)));\r\n }\r\n destroyAll() {\r\n const { destroys, source } = this;\r\n return Promise.all(destroys.map((destroy) => source.delete(destroy)));\r\n }\r\n hiddenAll() {\r\n const { hiddens, source } = this;\r\n return Promise.all(hiddens.map((hidden) => source.hidden(hidden)));\r\n }\r\n procedureAll() {\r\n const { procedures, source } = this;\r\n return Promise.all(procedures.map((procedure) => source.procedure(procedure)));\r\n }\r\n}\r\nfunction isHidden(model) {\r\n return 'hidden' in model && 'hiddenAt' in model;\r\n}\r\n//# sourceMappingURL=entity-manager.js.map","export class EntitySync {\r\n constructor(entity, model, bindable = true) {\r\n this.entity = entity;\r\n this.model = model;\r\n this.bindable = bindable;\r\n this.firstStatus = this.mapperModel(model);\r\n }\r\n verify() {\r\n this.sync();\r\n return this.createDirty();\r\n }\r\n mapperModel(model) {\r\n const dirty = {};\r\n Object.keys(model).forEach((key) => {\r\n dirty[key] = model[key];\r\n });\r\n return dirty;\r\n }\r\n createDirty() {\r\n const currentStatus = this.mapperModel(this.model);\r\n const modelDirty = {};\r\n let dirty = false;\r\n Object.keys(currentStatus).forEach((key) => {\r\n if (currentStatus[key] !== this.firstStatus[key]) {\r\n dirty = true;\r\n modelDirty[key] = currentStatus[key];\r\n }\r\n });\r\n if (isUpdated(this.model)) {\r\n modelDirty['updatedAt'] = new Date();\r\n }\r\n return dirty ? modelDirty : undefined;\r\n }\r\n}\r\nfunction isUpdated(model) {\r\n return 'updatedAt' in model;\r\n}\r\n//# sourceMappingURL=entity-sync.js.map","export class EntityUpdate {\r\n constructor(entity, model, bindable = true) {\r\n this.entity = entity;\r\n this.model = model;\r\n this.bindable = bindable;\r\n }\r\n}\r\n//# sourceMappingURL=entity-update.js.map","export class Entity {\r\n constructor(uuid) {\r\n this.uuid = uuid;\r\n }\r\n}\r\n//# sourceMappingURL=entity.js.map","export class PersistentUnit {\r\n}\r\n//# sourceMappingURL=persistent-unit.js.map","export class Procedure {\r\n}\r\n//# sourceMappingURL=procedure.js.map","export class Repository {\r\n}\r\n//# sourceMappingURL=repository.js.map"],"names":[],"mappings":";;;;AAAO,MAAM,cAAc,CAAC;AAC5B;;ACDO,MAAM,gBAAgB,CAAC;AAC9B;;ACDO,MAAM,UAAU,CAAC;AACxB,IAAI,WAAW,CAAC,MAAM,EAA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 class EntityLink {
|
|
|
13
11
|
}
|
|
14
12
|
}
|
|
15
13
|
|
|
14
|
+
function itIsDefined(object) {
|
|
15
|
+
return typeof object !== 'undefined' && object !== null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class Optional {
|
|
19
|
+
constructor(value) {
|
|
20
|
+
this.value = value;
|
|
21
|
+
}
|
|
22
|
+
present(callback) {
|
|
23
|
+
return this.isPresent() ? callback(this.get()) : undefined;
|
|
24
|
+
}
|
|
25
|
+
empty(callback) {
|
|
26
|
+
return this.isEmpty() ? callback() : undefined;
|
|
27
|
+
}
|
|
28
|
+
when(present, empty) {
|
|
29
|
+
return this.isPresent() ? present(this.get()) : empty();
|
|
30
|
+
}
|
|
31
|
+
static build(value) {
|
|
32
|
+
return itIsDefined(value) ? this.of(value) : this.empty();
|
|
33
|
+
}
|
|
34
|
+
static of(value) {
|
|
35
|
+
if (itIsDefined(value)) {
|
|
36
|
+
return new PresentOptional(value);
|
|
37
|
+
}
|
|
38
|
+
throw new Error('The passed value was null or undefined.');
|
|
39
|
+
}
|
|
40
|
+
static empty() {
|
|
41
|
+
return new EmptyOptional();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
class PresentOptional extends Optional {
|
|
45
|
+
constructor(presentValue) {
|
|
46
|
+
super(presentValue);
|
|
47
|
+
this.presentValue = presentValue;
|
|
48
|
+
}
|
|
49
|
+
isPresent() {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
isEmpty() {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
get() {
|
|
56
|
+
return this.presentValue;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
class EmptyOptional extends Optional {
|
|
60
|
+
isPresent() {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
isEmpty() {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
get() {
|
|
67
|
+
throw new Error('The optional is not present.');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function fromPromise(value) {
|
|
72
|
+
return value instanceof Promise ? value : Promise.resolve(value);
|
|
73
|
+
}
|
|
74
|
+
|
|
16
75
|
class EntityManager {
|
|
17
76
|
}
|
|
18
77
|
class RolsterEntityManager {
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../esm/database.js","../esm/datasource.js","../esm/entity-link.js","../esm/entity-manager.js","../esm/entity-sync.js","../esm/entity-update.js","../esm/entity.js","../esm/persistent-unit.js","../esm/procedure.js","../esm/repository.js"],"sourcesContent":["export class EntityDatabase {\r\n}\r\n//# sourceMappingURL=database.js.map","export class EntityDataSource {\r\n}\r\n//# sourceMappingURL=datasource.js.map","export class EntityLink {\r\n constructor(entity, bindable = true) {\r\n this.entity = entity;\r\n this.bindable = bindable;\r\n }\r\n}\r\n//# sourceMappingURL=entity-link.js.map","import { Optional, fromPromise } from '@rolster/helpers-advanced';\r\nexport class EntityManager {\r\n}\r\nexport class RolsterEntityManager {\r\n constructor(source) {\r\n this.source = source;\r\n this.links = [];\r\n this.updates = [];\r\n this.syncs = [];\r\n this.destroys = [];\r\n this.hiddens = [];\r\n this.procedures = [];\r\n this.relations = new Map();\r\n }\r\n persist(link) {\r\n this.links.push(link);\r\n }\r\n update(update) {\r\n const { bindable, entity, model } = update;\r\n if (bindable) {\r\n this.relation(entity, model);\r\n }\r\n this.updates.push(update);\r\n }\r\n sync(sync) {\r\n const { bindable, entity, model } = sync;\r\n if (bindable) {\r\n this.relation(entity, model);\r\n }\r\n this.syncs.push(sync);\r\n }\r\n destroy(entity) {\r\n this.select(entity).present((model) => {\r\n isHidden(model) ? this.hiddens.push(model) : this.destroys.push(model);\r\n });\r\n }\r\n procedure(procedure) {\r\n this.procedures.push(procedure);\r\n }\r\n relation({ uuid }, model) {\r\n this.relations.set(uuid, model);\r\n }\r\n link(entity, model) {\r\n this.relation(entity, model);\r\n return entity;\r\n }\r\n select({ uuid }) {\r\n return Optional.build(this.relations.has(uuid) ? this.relations.get(uuid) : undefined);\r\n }\r\n async flush() {\r\n await this.persistAll();\r\n await this.updateAll();\r\n await this.syncAll();\r\n await this.hiddenAll();\r\n await this.destroyAll();\r\n await this.procedureAll();\r\n this.dispose();\r\n }\r\n dispose() {\r\n this.relations.clear();\r\n this.links = [];\r\n this.updates = [];\r\n this.syncs = [];\r\n this.destroys = [];\r\n this.hiddens = [];\r\n this.procedures = [];\r\n }\r\n persistAll() {\r\n const { links, source } = this;\r\n return Promise.all(links.map((link) => fromPromise(link.createModel(this)).then((model) => {\r\n const { bindable, entity } = link;\r\n if (bindable) {\r\n this.relation(entity, model);\r\n }\r\n return source.insert(model);\r\n })));\r\n }\r\n updateAll() {\r\n const { source, updates } = this;\r\n return Promise.all(updates.map(({ model }) => source.update(model)));\r\n }\r\n syncAll() {\r\n const { destroys, source, syncs } = this;\r\n return Promise.all(syncs\r\n .filter(({ model }) => !destroys.includes(model))\r\n .reduce((syncs, sync) => {\r\n const dirty = sync.verify();\r\n if (dirty) {\r\n const { model } = sync;\r\n syncs.push({ model, dirty });\r\n }\r\n return syncs;\r\n }, [])\r\n .map(({ model, dirty }) => source.update(model, dirty)));\r\n }\r\n destroyAll() {\r\n const { destroys, source } = this;\r\n return Promise.all(destroys.map((destroy) => source.delete(destroy)));\r\n }\r\n hiddenAll() {\r\n const { hiddens, source } = this;\r\n return Promise.all(hiddens.map((hidden) => source.hidden(hidden)));\r\n }\r\n procedureAll() {\r\n const { procedures, source } = this;\r\n return Promise.all(procedures.map((procedure) => source.procedure(procedure)));\r\n }\r\n}\r\nfunction isHidden(model) {\r\n return 'hidden' in model && 'hiddenAt' in model;\r\n}\r\n//# sourceMappingURL=entity-manager.js.map","export class EntitySync {\r\n constructor(entity, model, bindable = true) {\r\n this.entity = entity;\r\n this.model = model;\r\n this.bindable = bindable;\r\n this.firstStatus = this.mapperModel(model);\r\n }\r\n verify() {\r\n this.sync();\r\n return this.createDirty();\r\n }\r\n mapperModel(model) {\r\n const dirty = {};\r\n Object.keys(model).forEach((key) => {\r\n dirty[key] = model[key];\r\n });\r\n return dirty;\r\n }\r\n createDirty() {\r\n const currentStatus = this.mapperModel(this.model);\r\n const modelDirty = {};\r\n let dirty = false;\r\n Object.keys(currentStatus).forEach((key) => {\r\n if (currentStatus[key] !== this.firstStatus[key]) {\r\n dirty = true;\r\n modelDirty[key] = currentStatus[key];\r\n }\r\n });\r\n if (isUpdated(this.model)) {\r\n modelDirty['updatedAt'] = new Date();\r\n }\r\n return dirty ? modelDirty : undefined;\r\n }\r\n}\r\nfunction isUpdated(model) {\r\n return 'updatedAt' in model;\r\n}\r\n//# sourceMappingURL=entity-sync.js.map","export class EntityUpdate {\r\n constructor(entity, model, bindable = true) {\r\n this.entity = entity;\r\n this.model = model;\r\n this.bindable = bindable;\r\n }\r\n}\r\n//# sourceMappingURL=entity-update.js.map","export class Entity {\r\n constructor(uuid) {\r\n this.uuid = uuid;\r\n }\r\n}\r\n//# sourceMappingURL=entity.js.map","export class PersistentUnit {\r\n}\r\n//# sourceMappingURL=persistent-unit.js.map","export class Procedure {\r\n}\r\n//# sourceMappingURL=procedure.js.map","export class Repository {\r\n}\r\n//# sourceMappingURL=repository.js.map"],"names":[],"mappings":";;AAAO,MAAM,cAAc,CAAC;AAC5B;;ACDO,MAAM,gBAAgB,CAAC;AAC9B;;ACDO,MAAM,UAAU,CAAC;AACxB,IAAI,WAAW,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,EAAE;AACzC,QAAQ,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AAC7B,QAAQ,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACjC,KAAK;AACL;;ACJO,MAAM,aAAa,CAAC;AAC3B,CAAC;AACM,MAAM,oBAAoB,CAAC;AAClC,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AAC7B,QAAQ,IAAI,C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ource.js","../esm/entity-link.js","../../node_modules/@rolster/commons/dist/esm/helpers.js","../../node_modules/@rolster/commons/dist/esm/optional.js","../../node_modules/@rolster/commons/dist/esm/promises.js","../esm/entity-manager.js","../esm/entity-sync.js","../esm/entity-update.js","../esm/entity.js","../esm/persistent-unit.js","../esm/procedure.js","../esm/repository.js"],"sourcesContent":["export class EntityDatabase {\r\n}\r\n//# sourceMappingURL=database.js.map","export class EntityDataSource {\r\n}\r\n//# sourceMappingURL=datasource.js.map","export class EntityLink {\r\n constructor(entity, bindable = true) {\r\n this.entity = entity;\r\n this.bindable = bindable;\r\n }\r\n}\r\n//# sourceMappingURL=entity-link.js.map","const PRIMITIVES = [Date, RegExp, Function, String, Boolean, Number];\r\nconst SLICE_SIZE = 512;\r\nconst FALSY_VALUE = ['false', 'undefined', '0', 0];\r\nconst prototypeToString = Object.prototype.toString;\r\nfunction clone(object, caches) {\r\n if (typeof object !== 'object') {\r\n return object;\r\n }\r\n if (prototypeToString.call(object) === '[object Object]') {\r\n const [cacheObject] = caches.filter((cacheObject) => cacheObject === object);\r\n /* istanbul ignore if */\r\n if (cacheObject) {\r\n return cacheObject;\r\n }\r\n caches.push(object);\r\n }\r\n const prototypeObject = Object.getPrototypeOf(object);\r\n const ConstructorObject = prototypeObject.constructor;\r\n if (PRIMITIVES.includes(ConstructorObject)) {\r\n return new ConstructorObject(object);\r\n }\r\n const cloneObject = new ConstructorObject();\r\n for (const prop in object) {\r\n cloneObject[prop] = clone(object[prop], caches);\r\n }\r\n return cloneObject;\r\n}\r\nexport function itIsDefined(object) {\r\n return typeof object !== 'undefined' && object !== null;\r\n}\r\nexport function itIsUndefined(object) {\r\n return !itIsDefined(object);\r\n}\r\nexport function parseBoolean(value) {\r\n return !(itIsUndefined(value) ||\r\n value === false ||\r\n FALSY_VALUE.includes(value));\r\n}\r\nexport function parse(value) {\r\n try {\r\n return JSON.parse(value);\r\n }\r\n catch {\r\n return value;\r\n }\r\n}\r\nexport function evalValueOrFunction(value) {\r\n return typeof value === 'function' ? value() : value;\r\n}\r\nexport function deepClone(object) {\r\n return clone(object, []);\r\n}\r\nexport function deepFreeze(object) {\r\n for (const prop in object) {\r\n const value = object[prop];\r\n if (typeof value === 'object' && !Object.isFrozen(value)) {\r\n deepFreeze(value);\r\n }\r\n }\r\n return Object.freeze(object);\r\n}\r\nexport function callback(call, ...args) {\r\n return typeof call !== 'function' ? undefined : call.apply(call, args);\r\n}\r\n/* istanbul ignore next */\r\nexport function base64ToBlob(data64, mimeType) {\r\n const result64 = data64.replace(/^[^,]+,/, '').replace(/\\s/g, '');\r\n const byteCharacters = window.atob(result64);\r\n const byteArrays = [];\r\n for (let offset = 0; offset < byteCharacters.length; offset += SLICE_SIZE) {\r\n const slice = byteCharacters.slice(offset, offset + SLICE_SIZE);\r\n const byteNumbers = new Array(slice.length);\r\n for (let i = 0; i < slice.length; i++) {\r\n byteNumbers[i] = slice.charCodeAt(i);\r\n }\r\n const byteArray = new Uint8Array(byteNumbers);\r\n byteArrays.push(byteArray);\r\n }\r\n return new Blob(byteArrays, { type: mimeType });\r\n}\r\n//# sourceMappingURL=helpers.js.map","import { itIsDefined } from './helpers';\r\nexport class Optional {\r\n constructor(value) {\r\n this.value = value;\r\n }\r\n present(callback) {\r\n return this.isPresent() ? callback(this.get()) : undefined;\r\n }\r\n empty(callback) {\r\n return this.isEmpty() ? callback() : undefined;\r\n }\r\n when(present, empty) {\r\n return this.isPresent() ? present(this.get()) : empty();\r\n }\r\n static build(value) {\r\n return itIsDefined(value) ? this.of(value) : this.empty();\r\n }\r\n static of(value) {\r\n if (itIsDefined(value)) {\r\n return new PresentOptional(value);\r\n }\r\n throw new Error('The passed value was null or undefined.');\r\n }\r\n static empty() {\r\n return new EmptyOptional();\r\n }\r\n}\r\nclass PresentOptional extends Optional {\r\n constructor(presentValue) {\r\n super(presentValue);\r\n this.presentValue = presentValue;\r\n }\r\n isPresent() {\r\n return true;\r\n }\r\n isEmpty() {\r\n return false;\r\n }\r\n get() {\r\n return this.presentValue;\r\n }\r\n}\r\nclass EmptyOptional extends Optional {\r\n isPresent() {\r\n return false;\r\n }\r\n isEmpty() {\r\n return true;\r\n }\r\n get() {\r\n throw new Error('The optional is not present.');\r\n }\r\n}\r\n//# sourceMappingURL=optional.js.map","function resolvePromises(props) {\r\n const { error, index, promises, result, success } = props;\r\n if (index === promises.length) {\r\n return success(result);\r\n }\r\n const callback = promises[index];\r\n new Promise(() => {\r\n callback()\r\n .then((value) => resolvePromises({\r\n ...props,\r\n index: index + 1,\r\n result: [...result, value]\r\n }))\r\n .catch((err) => error(err));\r\n });\r\n}\r\nexport function fromPromise(value) {\r\n return value instanceof Promise ? value : Promise.resolve(value);\r\n}\r\nexport function zipPromise(promises) {\r\n return promises.length\r\n ? new Promise((resolve, reject) => {\r\n resolvePromises({\r\n error: (err) => {\r\n reject(err);\r\n },\r\n index: 0,\r\n result: [],\r\n promises,\r\n success: (result) => {\r\n resolve(result);\r\n }\r\n });\r\n })\r\n : Promise.resolve([]);\r\n}\r\nexport function thenPromise(promise, printError = false) {\r\n return promise\r\n .then(() => undefined)\r\n .catch((err) => {\r\n /* istanbul ignore if */\r\n if (printError) {\r\n console.log(err);\r\n }\r\n throw err;\r\n });\r\n}\r\nexport function voidPromise(promise, printError = false) {\r\n return promise\r\n .then(() => undefined)\r\n .catch((err) => {\r\n /* istanbul ignore if */\r\n if (printError) {\r\n console.log(err);\r\n }\r\n return undefined;\r\n });\r\n}\r\nexport function catchPromise(promise, printError = false) {\r\n return promise.catch((err) => {\r\n /* istanbul ignore if */\r\n if (printError) {\r\n console.log(err);\r\n }\r\n return undefined;\r\n });\r\n}\r\n//# sourceMappingURL=promises.js.map","import { Optional, fromPromise } from '@rolster/commons';\r\nexport class EntityManager {\r\n}\r\nexport class RolsterEntityManager {\r\n constructor(source) {\r\n this.source = source;\r\n this.links = [];\r\n this.updates = [];\r\n this.syncs = [];\r\n this.destroys = [];\r\n this.hiddens = [];\r\n this.procedures = [];\r\n this.relations = new Map();\r\n }\r\n persist(link) {\r\n this.links.push(link);\r\n }\r\n update(update) {\r\n const { bindable, entity, model } = update;\r\n if (bindable) {\r\n this.relation(entity, model);\r\n }\r\n this.updates.push(update);\r\n }\r\n sync(sync) {\r\n const { bindable, entity, model } = sync;\r\n if (bindable) {\r\n this.relation(entity, model);\r\n }\r\n this.syncs.push(sync);\r\n }\r\n destroy(entity) {\r\n this.select(entity).present((model) => {\r\n isHidden(model) ? this.hiddens.push(model) : this.destroys.push(model);\r\n });\r\n }\r\n procedure(procedure) {\r\n this.procedures.push(procedure);\r\n }\r\n relation({ uuid }, model) {\r\n this.relations.set(uuid, model);\r\n }\r\n link(entity, model) {\r\n this.relation(entity, model);\r\n return entity;\r\n }\r\n select({ uuid }) {\r\n return Optional.build(this.relations.has(uuid) ? this.relations.get(uuid) : undefined);\r\n }\r\n async flush() {\r\n await this.persistAll();\r\n await this.updateAll();\r\n await this.syncAll();\r\n await this.hiddenAll();\r\n await this.destroyAll();\r\n await this.procedureAll();\r\n this.dispose();\r\n }\r\n dispose() {\r\n this.relations.clear();\r\n this.links = [];\r\n this.updates = [];\r\n this.syncs = [];\r\n this.destroys = [];\r\n this.hiddens = [];\r\n this.procedures = [];\r\n }\r\n persistAll() {\r\n const { links, source } = this;\r\n return Promise.all(links.map((link) => fromPromise(link.createModel(this)).then((model) => {\r\n const { bindable, entity } = link;\r\n if (bindable) {\r\n this.relation(entity, model);\r\n }\r\n return source.insert(model);\r\n })));\r\n }\r\n updateAll() {\r\n const { source, updates } = this;\r\n return Promise.all(updates.map(({ model }) => source.update(model)));\r\n }\r\n syncAll() {\r\n const { destroys, source, syncs } = this;\r\n return Promise.all(syncs\r\n .filter(({ model }) => !destroys.includes(model))\r\n .reduce((syncs, sync) => {\r\n const dirty = sync.verify();\r\n if (dirty) {\r\n const { model } = sync;\r\n syncs.push({ model, dirty });\r\n }\r\n return syncs;\r\n }, [])\r\n .map(({ model, dirty }) => source.update(model, dirty)));\r\n }\r\n destroyAll() {\r\n const { destroys, source } = this;\r\n return Promise.all(destroys.map((destroy) => source.delete(destroy)));\r\n }\r\n hiddenAll() {\r\n const { hiddens, source } = this;\r\n return Promise.all(hiddens.map((hidden) => source.hidden(hidden)));\r\n }\r\n procedureAll() {\r\n const { procedures, source } = this;\r\n return Promise.all(procedures.map((procedure) => source.procedure(procedure)));\r\n }\r\n}\r\nfunction isHidden(model) {\r\n return 'hidden' in model && 'hiddenAt' in model;\r\n}\r\n//# sourceMappingURL=entity-manager.js.map","export class EntitySync {\r\n constructor(entity, model, bindable = true) {\r\n this.entity = entity;\r\n this.model = model;\r\n this.bindable = bindable;\r\n this.firstStatus = this.mapperModel(model);\r\n }\r\n verify() {\r\n this.sync();\r\n return this.createDirty();\r\n }\r\n mapperModel(model) {\r\n const dirty = {};\r\n Object.keys(model).forEach((key) => {\r\n dirty[key] = model[key];\r\n });\r\n return dirty;\r\n }\r\n createDirty() {\r\n const currentStatus = this.mapperModel(this.model);\r\n const modelDirty = {};\r\n let dirty = false;\r\n Object.keys(currentStatus).forEach((key) => {\r\n if (currentStatus[key] !== this.firstStatus[key]) {\r\n dirty = true;\r\n modelDirty[key] = currentStatus[key];\r\n }\r\n });\r\n if (isUpdated(this.model)) {\r\n modelDirty['updatedAt'] = new Date();\r\n }\r\n return dirty ? modelDirty : undefined;\r\n }\r\n}\r\nfunction isUpdated(model) {\r\n return 'updatedAt' in model;\r\n}\r\n//# sourceMappingURL=entity-sync.js.map","export class EntityUpdate {\r\n constructor(entity, model, bindable = true) {\r\n this.entity = entity;\r\n this.model = model;\r\n this.bindable = bindable;\r\n }\r\n}\r\n//# sourceMappingURL=entity-update.js.map","export class Entity {\r\n constructor(uuid) {\r\n this.uuid = uuid;\r\n }\r\n}\r\n//# sourceMappingURL=entity.js.map","export class PersistentUnit {\r\n}\r\n//# sourceMappingURL=persistent-unit.js.map","export class Procedure {\r\n}\r\n//# sourceMappingURL=procedure.js.map","export class Repository {\r\n}\r\n//# sourceMappingURL=repository.js.map"],"names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","sourceRoot":"","sources":["../../src/entity-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"entity-manager.js","sourceRoot":"","sources":["../../src/entity-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAkBzD,MAAM,OAAgB,aAAa;CAoBlC;AAED,MAAM,OAAO,oBAAoB;IAe/B,YAAoB,MAAwB;QAAxB,WAAM,GAAN,MAAM,CAAkB;QAZpC,UAAK,GAAqB,EAAE,CAAC;QAE7B,YAAO,GAAuB,EAAE,CAAC;QAEjC,UAAK,GAAqB,EAAE,CAAC;QAE7B,aAAQ,GAAgB,EAAE,CAAC;QAE3B,YAAO,GAAkB,EAAE,CAAC;QAE5B,eAAU,GAAgB,EAAE,CAAC;QAGnC,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAqB,CAAC;IAChD,CAAC;IAEM,OAAO,CAAC,IAAoB;QACjC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAEM,MAAM,CAAC,MAAwB;QACpC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QAE3C,IAAI,QAAQ,EAAE;YACZ,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;SAC9B;QAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAEM,IAAI,CAAC,IAAoB;QAC9B,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QAEzC,IAAI,QAAQ,EAAE;YACZ,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;SAC9B;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,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AAC,SAAS,CAAC,CAAC,CAC3D,CAAC;IACJ,CAAC;CACF;AAED,SAAS,QAAQ,CAAC,KAAU;IAC1B,OAAO,QAAQ,IAAI,KAAK,IAAI,UAAU,IAAI,KAAK,CAAC;AAClD,CAAC"}
|
package/dist/esm/repository.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rolster/vinegar",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Container package of basic classes to implement a clean architecture.",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"prepublishOnly": "npm run build"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@rolster/
|
|
29
|
+
"@rolster/commons": "^2.0.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@rollup/plugin-commonjs": "^25.0.4",
|
|
33
33
|
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
34
34
|
"@rollup/plugin-typescript": "^11.1.3",
|
|
35
|
-
"@rolster/types": "^1.0.
|
|
35
|
+
"@rolster/types": "^1.0.9",
|
|
36
36
|
"@types/jest": "^29.5.1",
|
|
37
37
|
"jest": "^29.5.0",
|
|
38
38
|
"prettier": "^3.0.3",
|
|
@@ -52,5 +52,8 @@
|
|
|
52
52
|
"vinegar",
|
|
53
53
|
"hexagonal",
|
|
54
54
|
"clean-architecture"
|
|
55
|
-
]
|
|
55
|
+
],
|
|
56
|
+
"publishConfig": {
|
|
57
|
+
"access": "public"
|
|
58
|
+
}
|
|
56
59
|
}
|