@h3ravel/arquebus 0.1.4 → 0.1.6

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.
@@ -114,7 +114,7 @@ var import_radashi7 = require("radashi");
114
114
 
115
115
  // src/utils.js
116
116
  var import_radashi = require("radashi");
117
- var import_advancedFormat = __toESM(require("dayjs/plugin/advancedFormat"), 1);
117
+ var import_advancedFormat = __toESM(require("dayjs/plugin/advancedFormat.js"), 1);
118
118
  var import_dayjs = __toESM(require("dayjs"), 1);
119
119
  import_dayjs.default.extend(import_advancedFormat.default);
120
120
  var now = (format = "YYYY-MM-DD HH:mm:ss") => (0, import_dayjs.default)().format(format);
@@ -1402,4 +1402,3 @@ var index_default = {
1402
1402
  snakeCase,
1403
1403
  tap
1404
1404
  });
1405
- //# sourceMappingURL=index.cjs.map
@@ -224,6 +224,4 @@ declare function make(model: any, data: any, options?: {}): any;
224
224
  declare function makeCollection(model: any, data: any): Collection;
225
225
  declare function makePaginator(model: any, data: any): Paginator;
226
226
 
227
- // @ts-ignore
228
- export = _default;
229
- export { Attribute, CastsAttributes, Collection, HasUniqueIds, InvalidArgumentError, Model, ModelNotFoundError, Paginator, Pivot, RelationNotFoundError, compose, flattenDeep, getAttrMethod, getAttrName, getGetterMethod, getRelationMethod, getRelationName, getScopeMethod, getScopeName, getSetterMethod, isBrowser, kebabCase, make, makeCollection, makePaginator, now, snakeCase, tap };
227
+ export { Attribute, CastsAttributes, Collection, HasUniqueIds, InvalidArgumentError, Model, ModelNotFoundError, Paginator, Pivot, RelationNotFoundError, compose, _default as default, flattenDeep, getAttrMethod, getAttrName, getGetterMethod, getRelationMethod, getRelationName, getScopeMethod, getScopeName, getSetterMethod, isBrowser, kebabCase, make, makeCollection, makePaginator, now, snakeCase, tap };
@@ -50,7 +50,7 @@ import { isArray as isArray2, isEmpty, omit as omit3, pick } from "radashi";
50
50
 
51
51
  // src/utils.js
52
52
  import { camel, dash, snake, trim } from "radashi";
53
- import advancedFormat from "dayjs/plugin/advancedFormat";
53
+ import advancedFormat from "dayjs/plugin/advancedFormat.js";
54
54
  import dayjs from "dayjs";
55
55
  dayjs.extend(advancedFormat);
56
56
  var now = (format = "YYYY-MM-DD HH:mm:ss") => dayjs().format(format);
@@ -1338,4 +1338,3 @@ export {
1338
1338
  snakeCase,
1339
1339
  tap
1340
1340
  };
1341
- //# sourceMappingURL=index.js.map
package/dist/index.cjs CHANGED
@@ -361,7 +361,7 @@ var migrator_default = Migrator;
361
361
 
362
362
  // src/utils.js
363
363
  var import_radashi = require("radashi");
364
- var import_advancedFormat = __toESM(require("dayjs/plugin/advancedFormat"), 1);
364
+ var import_advancedFormat = __toESM(require("dayjs/plugin/advancedFormat.js"), 1);
365
365
  var import_dayjs = __toESM(require("dayjs"), 1);
366
366
  import_dayjs.default.extend(import_advancedFormat.default);
367
367
  var now = (format = "YYYY-MM-DD HH:mm:ss") => (0, import_dayjs.default)().format(format);
@@ -4582,4 +4582,3 @@ var makePaginator = (model, data) => new paginator_default(
4582
4582
  snakeCase,
4583
4583
  tap
4584
4584
  });
4585
- //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -290,7 +290,7 @@ var migrator_default = Migrator;
290
290
 
291
291
  // src/utils.js
292
292
  import { camel, dash, snake, trim } from "radashi";
293
- import advancedFormat from "dayjs/plugin/advancedFormat";
293
+ import advancedFormat from "dayjs/plugin/advancedFormat.js";
294
294
  import dayjs from "dayjs";
295
295
  dayjs.extend(advancedFormat);
296
296
  var now = (format = "YYYY-MM-DD HH:mm:ss") => dayjs().format(format);
@@ -4510,4 +4510,3 @@ export {
4510
4510
  snakeCase,
4511
4511
  tap
4512
4512
  };
4513
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h3ravel/arquebus",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Arquebus ORM is a Beautiful, expressive ORM inspired by Laravel's Eloquent, designed for TypeScript applications and for the H3ravel Framework.",
5
5
  "homepage": "https://h3ravel.net/arquebus",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/browser/index.js","../../src/casts/attribute.js","../../src/casts-attributes.js","../../src/browser/collection.js","../../src/utils.js","../../src/browser/relations/relation.js","../../src/browser/relations/belongs-to.js","../../src/browser/relations/belongs-to-many.js","../../src/concerns/has-attributes.js","../../src/browser/relations/has-many.js","../../src/browser/relations/has-one.js","../../src/browser/relations/has-many-through.js","../../src/browser/relations/has-one-through.js","../../src/errors.js","../../src/browser/concerns/has-relations.js","../../src/concerns/has-timestamps.js","../../src/concerns/hides-attributes.js","../../src/browser/model.js","../../src/concerns/has-unique-ids.js","../../src/browser/paginator.js","../../src/browser/pivot.js"],"sourcesContent":["import Attribute from '../casts/attribute'\nimport CastsAttributes from '../casts-attributes'\nimport Collection from './collection'\nimport HasUniqueIds from '../concerns/has-unique-ids'\nimport Model from './model'\nimport Paginator from './paginator'\nimport Pivot from './pivot'\nimport { isArray } from 'radashi'\nconst make = (model, data, options = {}) => {\n const { paginated } = options\n if (paginated) {\n return new Paginator(data.data.map(item => model.make(item)), data.total, data.per_page, data.current_page)\n }\n if (isArray(data)) {\n return new Collection(data.map(item => model.make(item)))\n }\n return model.make(data)\n}\nconst makeCollection = (model, data) => new Collection(data.map(item => model.make(item)))\nconst makePaginator = (model, data) => new Paginator(data.data.map(item => model.make(item)), data.total, data.per_page, data.current_page)\nconst isBrowser = true\nexport { isBrowser }\nexport { Paginator }\nexport { Collection }\nexport { Model }\nexport { Pivot }\nexport { Attribute }\nexport { CastsAttributes }\nexport { HasUniqueIds }\nexport { make }\nexport { makeCollection }\nexport { makePaginator }\nexport * from '../utils'\nexport * from '../errors'\nexport default {\n isBrowser,\n Paginator,\n Collection,\n Model,\n Pivot,\n Attribute,\n CastsAttributes,\n HasUniqueIds,\n make,\n makeCollection,\n makePaginator,\n}\n","class Attribute {\n get;\n set;\n withCaching = false\n withObjectCaching = true\n constructor({ get = null, set = null }) {\n this.get = get\n this.set = set\n }\n static make(get = null, set = null) {\n return new Attribute(get, set)\n }\n static get(get) {\n return new Attribute(get)\n }\n static set(set) {\n return new Attribute(null, set)\n }\n withoutObjectCaching() {\n this.withObjectCaching = false\n return this\n }\n shouldCache() {\n this.withCaching = true\n return this\n }\n}\nexport default Attribute\n","class CastsAttributes {\n constructor() {\n if (this.constructor === CastsAttributes) {\n throw new Error('CastsAttributes cannot be instantiated')\n }\n }\n static get() {\n throw new Error('get not implemented')\n }\n static set() {\n throw new Error('set not implemented')\n }\n}\nexport default CastsAttributes\n","import { Collection as BaseCollection, collect } from 'collect.js'\nimport { isArray, isEmpty, omit, pick } from 'radashi'\n\nimport Model from './model'\n\nclass Collection extends BaseCollection {\n mapThen (callback) {\n return Promise.all(this.map(callback))\n }\n modelKeys () {\n return this.all().map(item => item.getKey())\n }\n contains (key, operator = null, value = null) {\n if (arguments.length > 1) {\n return super.contains(key, operator, value)\n }\n if (key instanceof Model) {\n return super.contains(model => {\n return model.is(key)\n })\n }\n return super.contains(model => {\n return model.getKey() == key\n })\n }\n diff (items) {\n const diff = new this.constructor\n const dictionary = this.getDictionary(items)\n this.items.map(item => {\n if (dictionary[item.getKey()] === undefined) {\n diff.add(item)\n }\n })\n return diff\n }\n except (keys) {\n const dictionary = omit(this.getDictionary(), keys)\n return new this.constructor(Object.values(dictionary))\n }\n intersect (items) {\n const intersect = new this.constructor\n if (isEmpty(items)) {\n return intersect\n }\n const dictionary = this.getDictionary(items)\n for (let item of this.items) {\n if (dictionary[item.getKey()] !== undefined) {\n intersect.add(item)\n }\n }\n return intersect\n }\n unique (key = null, strict = false) {\n if (key !== null) {\n return super.unique(key, strict)\n }\n return new this.constructor(Object.values(this.getDictionary()))\n }\n find (key, defaultValue = null) {\n const Model = Model\n if (key instanceof Model) {\n key = key.getKey()\n }\n if (isArray(key)) {\n if (this.isEmpty()) {\n return new this.constructor\n }\n return this.whereIn(this.first().getKeyName(), key)\n }\n collect(this.items).first(model => {\n return model.getKey() == key\n })\n return this.items.filter(model => {\n return model.getKey() == key\n })[0] || defaultValue\n }\n makeVisible (attributes) {\n return this.each(item => {\n item.makeVisible(attributes)\n })\n }\n makeHidden (attributes) {\n return this.each(item => {\n item.makeHidden(attributes)\n })\n }\n append (attributes) {\n return this.each(item => {\n item.append(attributes)\n })\n }\n only (keys) {\n if (keys === null) {\n return new Collection(this.items)\n }\n const dictionary = pick(this.getDictionary(), keys)\n return new this.constructor(Object.values(dictionary))\n }\n getDictionary (items = null) {\n items = items === null ? this.items : items\n const dictionary = {}\n items.map(value => {\n dictionary[value.getKey()] = value\n })\n return dictionary\n }\n toData () {\n return this.all().map(item => typeof item.toData == 'function' ? item.toData() : item)\n }\n toJSON () {\n return this.toData()\n }\n toJson (...args) {\n return JSON.stringify(this.toData(), ...args)\n }\n [Symbol.iterator] () {\n const items = this.items\n let length = this.items.length\n let n = 0\n return {\n next () {\n return n < length ? {\n value: items[n++],\n done: false\n } : {\n done: true\n }\n }\n }\n }\n}\nexport default Collection\n","import { camel, dash, snake, trim } from 'radashi'\n\nimport advancedFormat from 'dayjs/plugin/advancedFormat'\nimport dayjs from 'dayjs'\n\ndayjs.extend(advancedFormat)\n\nexport const now = (format = 'YYYY-MM-DD HH:mm:ss') => dayjs().format(format)\n\nexport const getRelationName = (relationMethod) => {\n // 'relation' length 8\n return snake(relationMethod.substring(8))\n}\n\nexport const getScopeName = (scopeMethod) => {\n // 'scope' length 5\n return snake(scopeMethod.substring(5))\n}\n\nexport const getRelationMethod = (relation) => {\n return camel(`relation_${relation}`)\n}\n\nexport const getScopeMethod = (scope) => {\n return camel(`scope_${scope}`)\n}\n\nexport const getAttrMethod = (attr) => {\n return camel(`attribute_${attr}`)\n}\n\nexport const getGetterMethod = (attr) => {\n return camel(`get_${attr}_attribute`)\n}\n\nexport const getSetterMethod = (attr) => {\n return camel(`set_${attr}_attribute`)\n}\n\nexport const getAttrName = (attrMethod) => {\n return attrMethod.substring(3, attrMethod.length - 9).toLowerCase()\n}\n\n/**\n * Tap into a model a collection instance\n * \n * @param instance \n * @param callback \n * @returns \n */\nexport const tap = (instance, callback) => {\n const result = callback(instance)\n return result instanceof Promise ? result.then(() => instance) : instance\n}\n\n/**\n * Compose functional mixins\n * \n * @param Base \n * @param mixins \n * @returns \n */\nexport function compose (\n Base,\n ...mixins\n) {\n /**\n * Apply each mixin in sequence\n */\n return mixins.reduce(\n (cls, mixin) => mixin(cls),\n Base)\n}\n\nexport const flattenDeep = (arr) => Array.isArray(arr)\n ? arr.reduce((a, b) => a.concat(flattenDeep(b)), [])\n : [arr]\n\nexport const kebabCase = (str) => trim(dash(str.replace(/[^a-zA-Z0-9_-]/g, '-')), '_-')\nexport const snakeCase = (str) => trim(snake(str.replace(/[^a-zA-Z0-9_-]/g, '-')), '_-')\n\nexport default {\n now,\n getRelationName,\n getScopeName,\n getRelationMethod,\n getScopeMethod,\n getAttrMethod,\n getGetterMethod,\n getSetterMethod,\n getAttrName,\n compose,\n tap\n}\n","class Relation {\n parent\n related\n eagerKeysWereEmpty = false\n static constraints = true\n constructor(related, parent) {\n this.parent = parent\n this.related = related\n }\n asProxy() {\n const handler = {\n get: function (target, prop) {\n if (typeof target[prop] !== 'undefined') {\n return target[prop]\n }\n if (typeof prop === 'string') {\n return () => target.asProxy()\n }\n },\n }\n return new Proxy(this, handler)\n }\n getRelated() {\n return this.related\n }\n}\nexport default Relation\n","import Relation from './relation'\nclass BelongsTo extends Relation {\n foreignKey\n ownerKey\n child\n relationName\n constructor(related, child, foreignKey, ownerKey, relationName) {\n super(related, child)\n this.foreignKey = foreignKey\n this.ownerKey = ownerKey\n this.child = child\n this.relationName = relationName\n return this.asProxy()\n }\n}\nexport default BelongsTo\n","import Relation from './relation'\nclass BelongsToMany extends Relation {\n table\n foreignPivotKey\n relatedPivotKey\n parentKey\n relatedKey\n pivotColumns = []\n pivotValues = []\n pivotWheres = []\n pivotWhereIns = []\n pivotWhereNulls = []\n accessor = 'pivot'\n // withTimestamps = false;\n using\n pivotCreatedAt\n pivotUpdatedAt\n constructor(related, parent, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey) {\n super(related, parent)\n this.table = table\n this.foreignPivotKey = foreignPivotKey\n this.relatedPivotKey = relatedPivotKey\n this.parentKey = parentKey\n this.relatedKey = relatedKey\n return this.asProxy()\n }\n}\nexport default BelongsToMany\n","import { flat as flatten, omit } from 'radashi'\nimport { flattenDeep, getAttrMethod, getGetterMethod, getSetterMethod } from '../utils'\n\nimport CastsAttributes from '../casts-attributes'\nimport collect from 'collect.js'\nimport dayjs from 'dayjs'\n\nconst HasAttributes = (Model) => {\n return class extends Model {\n static castTypeCache = {}\n attributes = {}\n original = {}\n casts = {}\n changes = {}\n appends = []\n setAppends (appends) {\n this.appends = appends\n return this\n }\n append (...keys) {\n const appends = flattenDeep(keys)\n this.appends = [...this.appends, ...appends]\n return this\n }\n normalizeCastClassResponse (key, value) {\n return value?.constructor?.name === 'Object'\n ? value\n : {\n [key]: value\n }\n }\n syncOriginal () {\n this.original = this.getAttributes()\n return this\n }\n syncChanges () {\n this.changes = this.getDirty()\n return this\n }\n syncOriginalAttribute (attribute) {\n this.syncOriginalAttributes(attribute)\n }\n syncOriginalAttributes (...attributes) {\n attributes = flattenDeep(attributes)\n const modelAttributes = this.getAttributes()\n for (const attribute of attributes) {\n this.original[attribute] = modelAttributes[attribute]\n }\n return this\n }\n isDirty (...attributes) {\n const changes = this.getDirty()\n attributes = flattenDeep(attributes)\n if (attributes.length === 0) {\n return Object.keys(changes).length > 0\n }\n for (const attribute of attributes) {\n if (attribute in changes) {\n return true\n }\n }\n return false\n }\n getDirty () {\n const dirty = {}\n const attributes = this.getAttributes()\n for (const key in attributes) {\n const value = attributes[key]\n if (!this.originalIsEquivalent(key)) {\n dirty[key] = value\n }\n }\n return dirty\n }\n originalIsEquivalent (key) {\n if (this.original[key] === undefined) {\n return false\n }\n const attribute = this.attributes[key]\n const original = this.original[key]\n if (attribute === original) {\n return true\n }\n else {\n return false\n }\n }\n setAttributes (attributes) {\n this.attributes = { ...attributes }\n }\n setRawAttributes (attributes, sync = false) {\n this.attributes = attributes\n if (sync) {\n this.syncOriginal()\n }\n return this\n }\n getAttributes () {\n return { ...this.attributes }\n }\n setAttribute (key, value) {\n const setterMethod = getSetterMethod(key)\n if (typeof this[setterMethod] === 'function') {\n this[setterMethod](value)\n return this\n }\n const attrMethod = getAttrMethod(key)\n if (typeof this[attrMethod] === 'function') {\n const attribute = this[attrMethod]()\n const callback = attribute.set || ((value) => {\n this.attributes[key] = value\n })\n this.attributes = {\n ...this.attributes,\n ...this.normalizeCastClassResponse(key, callback(value, this.attributes))\n }\n return this\n }\n const casts = this.getCasts()\n const castType = casts[key]\n if (this.isCustomCast(castType)) {\n value = castType.set(this, key, value, this.attributes)\n }\n if (castType === 'json') {\n value = JSON.stringify(value)\n }\n if (castType === 'collection') {\n value = JSON.stringify(value)\n }\n if (value !== null && this.isDateAttribute(key)) {\n value = this.fromDateTime(value)\n }\n this.attributes[key] = value\n return this\n }\n getAttribute (key) {\n if (!key) {\n return\n }\n const getterMethod = getGetterMethod(key)\n if (typeof this[getterMethod] === 'function') {\n return this[getterMethod](this.attributes[key], this.attributes)\n }\n const attrMethod = getAttrMethod(key)\n if (typeof this[attrMethod] === 'function') {\n const caster = this[attrMethod]()\n return caster.get(this.attributes[key], this.attributes)\n }\n if (key in this.attributes) {\n if (this.hasCast(key)) {\n return this.castAttribute(key, this.attributes[key])\n }\n if (this.getDates().includes(key)) {\n return this.asDateTime(this.attributes[key])\n }\n return this.attributes[key]\n }\n if (key in this.relations) {\n return this.relations[key]\n }\n return\n }\n castAttribute (key, value) {\n const castType = this.getCastType(key)\n if (!castType) {\n return value\n }\n if (value === null) {\n return value\n }\n switch (castType) {\n case 'int':\n case 'integer':\n return parseInt(value)\n case 'real':\n case 'float':\n case 'double':\n return parseFloat(value)\n case 'decimal':\n return this.asDecimal(value, castType.split(':')[1])\n case 'string':\n return String(value)\n case 'bool':\n case 'boolean':\n return Boolean(value)\n case 'object':\n case 'json':\n try {\n return JSON.parse(value)\n }\n catch (e) {\n return null\n }\n case 'collection':\n try {\n return collect(JSON.parse(value))\n }\n catch (e) {\n return collect([])\n }\n case 'date':\n return this.asDate(value)\n case 'datetime':\n case 'custom_datetime':\n return this.asDateTime(value)\n case 'timestamp':\n return this.asTimestamp(value)\n }\n if (this.isCustomCast(castType)) {\n return castType.get(this, key, value, this.attributes)\n }\n return value\n }\n attributesToData () {\n let attributes = { ...this.attributes }\n for (const key in attributes) {\n if (this.hidden.includes(key)) {\n attributes = omit(attributes, [key])\n }\n if (this.visible.length > 0 && this.visible.includes(key) === false) {\n attributes = omit(attributes, [key])\n }\n }\n for (const key of this.getDates()) {\n if (attributes[key] === undefined) {\n continue\n }\n attributes[key] = this.serializeDate(this.asDateTime(attributes[key]))\n }\n const casts = this.getCasts()\n for (const key in casts) {\n const value = casts[key]\n if ((key in attributes) === false) {\n continue\n }\n attributes[key] = this.castAttribute(key, attributes[key])\n if (key in attributes && ['date', 'datetime'].includes(value)) {\n attributes[key] = this.serializeDate(attributes[key])\n }\n if (key in attributes && this.isCustomDateTimeCast(value)) {\n attributes[key] = dayjs(attributes[key]).format(value.split(':')[1])\n }\n }\n for (const key of this.appends) {\n attributes[key] = this.mutateAttribute(key, null)\n }\n return attributes\n }\n mutateAttribute (key, value) {\n if (typeof this[getGetterMethod(key)] === 'function') {\n return this[getGetterMethod(key)](value)\n }\n else if (typeof this[getAttrMethod(key)] === 'function') {\n const caster = this[getAttrMethod(key)]()\n return caster.get(key, this.attributes)\n }\n else if (key in this) {\n return this[key]\n }\n return value\n }\n mutateAttributeForArray (key, value) {\n }\n isDateAttribute (key) {\n return this.getDates().includes(key) || this.isDateCastable(key)\n }\n serializeDate (date) {\n return date ? dayjs(date).toISOString() : null\n }\n getDates () {\n return this.usesTimestamps() ? [\n this.getCreatedAtColumn(),\n this.getUpdatedAtColumn(),\n ] : []\n }\n getCasts () {\n if (this.getIncrementing()) {\n return {\n [this.getKeyName()]: this.getKeyType(),\n ...this.casts\n }\n }\n return this.casts\n }\n getCastType (key) {\n const castType = this.getCasts()[key]\n let castTypeCacheKey\n if (typeof castType === 'string') {\n castTypeCacheKey = castType\n }\n else if ((new castType) instanceof CastsAttributes) {\n castTypeCacheKey = castType.name\n }\n if (castTypeCacheKey && this.constructor.castTypeCache[castTypeCacheKey] !== undefined) {\n return this.constructor.castTypeCache[castTypeCacheKey]\n }\n let convertedCastType\n if (this.isCustomDateTimeCast(castType)) {\n convertedCastType = 'custom_datetime'\n }\n else if (this.isDecimalCast(castType)) {\n convertedCastType = 'decimal'\n }\n else if (this.isCustomCast(castType)) {\n convertedCastType = castType\n }\n else {\n convertedCastType = castType.toLocaleLowerCase().trim()\n }\n return this.constructor.castTypeCache[castTypeCacheKey] = convertedCastType\n }\n hasCast (key, types = []) {\n if (key in this.casts) {\n types = flatten(types)\n return types.length > 0 ? types.includes(this.getCastType(key)) : true\n }\n return false\n }\n withDayjs (date) {\n return dayjs(date)\n }\n isCustomCast (cast) {\n return typeof cast === 'function' && (new cast) instanceof CastsAttributes\n }\n isCustomDateTimeCast (cast) {\n if (typeof cast !== 'string') {\n return false\n }\n return cast.startsWith('date:') || cast.startsWith('datetime:')\n }\n isDecimalCast (cast) {\n if (typeof cast !== 'string') {\n return false\n }\n return cast.startsWith('decimal:')\n }\n isDateCastable (key) {\n return this.hasCast(key, ['date', 'datetime'])\n }\n fromDateTime (value) {\n return dayjs(this.asDateTime(value)).format(this.getDateFormat())\n }\n getDateFormat () {\n return this.dateFormat || 'YYYY-MM-DD HH:mm:ss'\n }\n asDecimal (value, decimals) {\n return parseFloat(value).toFixed(decimals)\n }\n asDateTime (value) {\n if (value === null) {\n return null\n }\n if (value instanceof Date) {\n return value\n }\n if (typeof value === 'number') {\n return new Date(value * 1000)\n }\n return new Date(value)\n }\n asDate (value) {\n const date = this.asDateTime(value)\n return dayjs(date).startOf('day').toDate()\n }\n }\n}\nexport default HasAttributes\n","import Relation from './relation'\nclass HasMany extends Relation {\n foreignKey\n localKey\n constructor(related, parent, foreignKey, localKey) {\n super(related, parent)\n this.foreignKey = foreignKey\n this.localKey = localKey\n return this.asProxy()\n }\n}\nexport default HasMany\n","import Relation from './relation'\nclass HasOne extends Relation {\n foreignKey\n localKey\n constructor(related, parent, foreignKey, localKey) {\n super(related, parent)\n this.foreignKey = foreignKey\n this.localKey = localKey\n return this.asProxy()\n }\n}\nexport default HasOne\n","import Relation from './relation'\nclass HasManyThrough extends Relation {\n throughParent\n farParent\n firstKey\n secondKey\n localKey\n secondLocalKey\n constructor(query, farParent, throughParent, firstKey, secondKey, localKey, secondLocalKey) {\n super(query, throughParent)\n this.localKey = localKey\n this.firstKey = firstKey\n this.secondKey = secondKey\n this.farParent = farParent\n this.throughParent = throughParent\n this.secondLocalKey = secondLocalKey\n return this.asProxy()\n }\n}\nexport default HasManyThrough\n","import HasManyThrough from './has-many-through'\nclass HasOneThrough extends HasManyThrough {\n}\nexport default HasOneThrough\n","import { isArray } from 'radashi'\nclass BaseError extends Error {\n constructor(message, entity) {\n super(message)\n Error.captureStackTrace(this, this.constructor)\n this.name = this.constructor.name\n this.message = message\n }\n}\nclass ModelNotFoundError extends BaseError {\n model\n ids\n setModel (model, ids = []) {\n this.model = model\n this.ids = isArray(ids) ? ids : [ids]\n this.message = `No query results for model [${model}]`\n if (this.ids.length > 0) {\n this.message += ' ' + this.ids.join(', ')\n }\n else {\n this.message += '.'\n }\n return this\n }\n getModel () {\n return this.model\n }\n getIds () {\n return this.ids\n }\n}\nclass RelationNotFoundError extends BaseError {\n}\nclass InvalidArgumentError extends BaseError {\n}\nexport { ModelNotFoundError }\nexport { RelationNotFoundError }\nexport { InvalidArgumentError }\nexport default {\n ModelNotFoundError,\n RelationNotFoundError,\n InvalidArgumentError\n}\n","import { getRelationMethod, getRelationName, snakeCase } from '../../utils'\n\nimport BelongsTo from '../../browser/relations/belongs-to'\nimport BelongsToMany from '../../browser/relations/belongs-to-many'\nimport HasMany from '../../browser/relations/has-many'\nimport HasManyThrough from '../../browser/relations/has-many-through'\nimport HasOne from '../../browser/relations/has-one'\nimport HasOneThrough from '../../browser/relations/has-one-through'\nimport { RelationNotFoundError } from '../../errors'\nimport { omit } from 'radashi'\n\nconst HasRelations = (Model) => {\n return class extends Model {\n relations = {}\n getRelation (relation) {\n return this.relations[relation]\n }\n setRelation (relation, value) {\n this.relations[relation] = value\n return this\n }\n unsetRelation (relation) {\n this.relations = omit(this.relations, [relation])\n return this\n }\n relationLoaded (relation) {\n return this.relations[relation] !== undefined\n }\n related (relation) {\n if (typeof this[getRelationMethod(relation)] !== 'function') {\n const message = `Model [${this.constructor.name}]'s relation [${relation}] doesn't exist.`\n throw new RelationNotFoundError(message)\n }\n return this[getRelationMethod(relation)]()\n }\n async getRelated (relation) {\n return await this.related(relation).getResults()\n }\n relationsToData () {\n const data = {}\n for (const key in this.relations) {\n if (this.hidden.includes(key)) {\n continue\n }\n if (this.visible.length > 0 && this.visible.includes(key) === false) {\n continue\n }\n data[key] = this.relations[key] instanceof Array\n ? this.relations[key].map(item => item.toData())\n : this.relations[key] === null\n ? null\n : this.relations[key].toData()\n }\n return data\n }\n guessBelongsToRelation () {\n let e = new Error()\n let frame = e.stack.split('\\n')[2]\n // let lineNumber = frame.split(\":\").reverse()[1];\n let functionName = frame.split(' ')[5]\n return getRelationName(functionName)\n }\n joiningTable (related, instance = null) {\n const segments = [\n instance ? instance.joiningTableSegment() : snakeCase(related.name),\n this.joiningTableSegment(),\n ]\n return segments.sort().join('_').toLocaleLowerCase()\n }\n joiningTableSegment () {\n return snakeCase(this.constructor.name)\n }\n hasOne (related, foreignKey = null, localKey = null) {\n const instance = new related\n foreignKey = foreignKey || this.getForeignKey()\n localKey = localKey || this.getKeyName()\n return (new HasOne(related, this, instance.getTable() + '.' + foreignKey, localKey))\n }\n hasMany (related, foreignKey = null, localKey = null) {\n const instance = new related\n foreignKey = foreignKey || this.getForeignKey()\n localKey = localKey || this.getKeyName()\n return (new HasMany(related, this, instance.getTable() + '.' + foreignKey, localKey))\n }\n belongsTo (related, foreignKey = null, ownerKey = null, relation = null) {\n const instance = new related\n foreignKey = foreignKey || instance.getForeignKey()\n ownerKey = ownerKey || instance.getKeyName()\n relation = relation || this.guessBelongsToRelation()\n return (new BelongsTo(related, this, foreignKey, ownerKey, relation))\n }\n belongsToMany (related, table = null, foreignPivotKey = null, relatedPivotKey = null, parentKey = null, relatedKey = null) {\n const instance = new related\n const query = related.query()\n table = table || this.joiningTable(related, instance)\n foreignPivotKey = foreignPivotKey || this.getForeignKey()\n relatedPivotKey = relatedPivotKey || instance.getForeignKey()\n parentKey = parentKey || this.getKeyName()\n relatedKey = relatedKey || instance.getKeyName()\n return (new BelongsToMany(query, this, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey))\n }\n hasOneThrough (related, through, firstKey = null, secondKey = null, localKey = null, secondLocalKey = null) {\n through = new through\n const query = related.query()\n firstKey = firstKey || this.getForeignKey()\n secondKey = secondKey || through.getForeignKey()\n return (new HasOneThrough(query, this, through, firstKey, secondKey, localKey || this.getKeyName(), secondLocalKey || through.getKeyName()))\n }\n hasManyThrough (related, through, firstKey = null, secondKey = null, localKey = null, secondLocalKey = null) {\n through = new through\n const query = related.query()\n firstKey = firstKey || this.getForeignKey()\n secondKey = secondKey || through.getForeignKey()\n return (new HasManyThrough(query, this, through, firstKey, secondKey, localKey || this.getKeyName(), secondLocalKey || through.getKeyName()))\n }\n }\n}\nexport default HasRelations\n","const HasTimestamps = (Model) => {\n return class extends Model {\n static CREATED_AT = 'created_at'\n static UPDATED_AT = 'updated_at'\n static DELETED_AT = 'deleted_at'\n timestamps = true\n dateFormat = 'YYYY-MM-DD HH:mm:ss'\n usesTimestamps() {\n return this.timestamps\n }\n updateTimestamps() {\n const time = this.freshTimestampString()\n const updatedAtColumn = this.getUpdatedAtColumn()\n if (updatedAtColumn && !this.isDirty(updatedAtColumn)) {\n this.setUpdatedAt(time)\n }\n const createdAtColumn = this.getCreatedAtColumn()\n if (!this.exists && createdAtColumn && !this.isDirty(createdAtColumn)) {\n this.setCreatedAt(time)\n }\n return this\n }\n getCreatedAtColumn() {\n return this.constructor.CREATED_AT\n }\n getUpdatedAtColumn() {\n return this.constructor.UPDATED_AT\n }\n setCreatedAt(value) {\n this.attributes[this.getCreatedAtColumn()] = value\n return this\n }\n setUpdatedAt(value) {\n this.attributes[this.getUpdatedAtColumn()] = value\n return this\n }\n freshTimestamp() {\n const time = new Date\n time.setMilliseconds(0)\n return time\n }\n freshTimestampString() {\n return this.fromDateTime(this.freshTimestamp())\n }\n }\n}\nexport default HasTimestamps\n","import { diff as difference } from 'radashi'\nimport { flattenDeep } from '../utils'\n\nconst HidesAttributes = (Model) => {\n return class extends Model {\n hidden = []\n visible = []\n makeVisible (...keys) {\n const visible = flattenDeep(keys)\n if (this.visible.length > 0) {\n this.visible = [...this.visible, ...visible]\n }\n this.hidden = difference(this.hidden, visible)\n return this\n }\n makeHidden (...keys) {\n const hidden = flattenDeep(keys)\n if (this.hidden.length > 0) {\n this.hidden = [...this.hidden, ...hidden]\n }\n return this\n }\n getHidden () {\n return this.hidden\n }\n getVisible () {\n return this.visible\n }\n setHidden (hidden) {\n this.hidden = hidden\n return this\n }\n setVisible (visible) {\n this.visible = visible\n return this\n }\n }\n}\nexport default HidesAttributes\n","import { compose, getRelationMethod, getScopeMethod, snakeCase } from '../utils'\n\nimport BelongsTo from './relations/belongs-to'\nimport BelongsToMany from './relations/belongs-to-many'\nimport Collection from './collection'\nimport HasAttributes from '../concerns/has-attributes'\nimport HasMany from './relations/has-many'\nimport HasOne from './relations/has-one'\nimport HasRelations from './concerns/has-relations'\nimport HasTimestamps from '../concerns/has-timestamps'\nimport HidesAttributes from '../concerns/hides-attributes'\nimport { assign as merge } from 'radashi'\nimport pluralize from 'pluralize'\n\nconst BaseModel = compose(class {\n}, HasAttributes, HidesAttributes, HasRelations, HasTimestamps)\nclass Model extends BaseModel {\n primaryKey = 'id' // protected\n table = null // protected\n keyType = 'int' // protected\n perPage = 15 // protected\n static globalScopes = {}\n static pluginInitializers = {}\n static _booted = {}\n static resolver = null\n static browser = true\n static init (attributes = {}) {\n return new this(attributes)\n }\n static extend (plugin, options) {\n plugin(this, options)\n }\n static make (attributes = {}) {\n const instance = new this()\n for (let attribute in attributes) {\n if (typeof instance[getRelationMethod(attribute)] !== 'function') {\n instance.setAttribute(attribute, attributes[attribute])\n }\n else {\n const relation = instance[getRelationMethod(attribute)]()\n if (relation instanceof HasOne\n || relation instanceof BelongsTo) {\n instance.setRelation(attribute, relation.related.make(attributes[attribute]))\n }\n else if ((relation instanceof HasMany || relation instanceof BelongsToMany)\n && Array.isArray(attributes[attribute])) {\n instance.setRelation(attribute, new Collection(attributes[attribute].map(item => relation.related.make(item))))\n }\n }\n }\n return instance\n }\n constructor(attributes = {}) {\n super()\n this.bootIfNotBooted()\n this.initializePlugins()\n this.syncOriginal()\n this.fill(attributes)\n return this.asProxy()\n }\n bootIfNotBooted () {\n if (this.constructor._booted[this.constructor.name] === undefined) {\n this.constructor._booted[this.constructor.name] = true\n this.constructor.booting()\n this.initialize()\n this.constructor.boot()\n this.constructor.booted()\n }\n }\n static booting () {\n }\n static boot () {\n }\n static booted () {\n }\n static setConnectionResolver (resolver) {\n this.resolver = resolver\n }\n initialize () {\n }\n initializePlugins () {\n if (typeof this.constructor.pluginInitializers[this.constructor.name] === 'undefined') {\n return\n }\n for (const method of this.constructor.pluginInitializers[this.constructor.name]) {\n this[method]()\n }\n }\n addPluginInitializer (method) {\n if (!this.constructor.pluginInitializers[this.constructor.name]) {\n this.constructor.pluginInitializers[this.constructor.name] = []\n }\n this.constructor.pluginInitializers[this.constructor.name].push(method)\n }\n newInstance (attributes = {}, exists = false) {\n const model = new this.constructor\n model.exists = exists\n model.setTable(this.getTable())\n model.fill(attributes)\n return model\n }\n asProxy () {\n const handler = {\n get: function (target, prop) {\n if (target[prop] !== undefined) {\n return target[prop]\n }\n // get model column\n if (typeof prop === 'string') {\n // get custom attribute\n return target.getAttribute(prop)\n }\n },\n set: function (target, prop, value) {\n if (target[prop] !== undefined && typeof target !== 'function') {\n target[prop] = value\n return target\n }\n if (typeof prop === 'string') {\n return target.setAttribute(prop, value)\n }\n return target\n }\n }\n return new Proxy(this, handler)\n }\n getKey () {\n return this.getAttribute(this.getKeyName())\n }\n getKeyName () {\n return this.primaryKey\n }\n getForeignKey () {\n return snakeCase(this.constructor.name) + '_' + this.getKeyName()\n }\n getConnectionName () {\n return this.connection\n }\n getTable () {\n return this.table || pluralize(snakeCase(this.constructor.name))\n }\n setConnection (connection) {\n this.connection = connection\n return this\n }\n getKeyType () {\n return this.keyType\n }\n hasNamedScope (name) {\n const scope = getScopeMethod(name)\n return typeof this[scope] === 'function'\n }\n callNamedScope (scope, parameters) {\n const scopeMethod = getScopeMethod(scope)\n return this[scopeMethod](...parameters)\n }\n setTable (table) {\n this.table = table\n return this\n }\n newCollection (models = []) {\n return new Collection(models)\n }\n getIncrementing () {\n return this.incrementing\n }\n setIncrementing (value) {\n this.incrementing = value\n return this\n }\n toData () {\n return merge(this.attributesToData(), this.relationsToData())\n }\n toJSON () {\n return this.toData()\n }\n toJson (...args) {\n return JSON.stringify(this.toData(), ...args)\n }\n toString () {\n return this.toJson()\n }\n fill (attributes) {\n for (const key in attributes) {\n this.setAttribute(key, attributes[key])\n }\n return this\n }\n transacting (trx) {\n this.trx = trx\n return this\n }\n trashed () {\n return this[this.getDeletedAtColumn()] !== null\n }\n newPivot (parent, attributes, table, exists, using = null) {\n return using ? using.fromRawAttributes(parent, attributes, table, exists)\n : Pivot.fromAttributes(parent, attributes, table, exists)\n }\n qualifyColumn (column) {\n if (column.includes('.')) {\n return column\n }\n return `${this.getTable()}.${column}`\n }\n getQualifiedKeyName () {\n return this.qualifyColumn(this.getKeyName())\n }\n is (model) {\n return model && model instanceof Model &&\n this.getKey() === model.getKey() &&\n this.getTable() === model.getTable()\n }\n isNot (model) {\n return !this.is(model)\n }\n}\n\n\nexport class Pivot extends Model {\n incrementing = false\n guarded = []\n pivotParent = null\n foreignKey = null\n relatedKey = null\n setPivotKeys (foreignKey, relatedKey) {\n this.foreignKey = foreignKey\n this.relatedKey = relatedKey\n return this\n }\n static fromRawAttributes (parent, attributes, table, exists = false) {\n const instance = this.fromAttributes(parent, {}, table, exists)\n instance.timestamps = instance.hasTimestampAttributes(attributes)\n instance.attributes = attributes\n instance.exists = exists\n return instance\n }\n static fromAttributes (parent, attributes, table, exists = false) {\n const instance = new this\n instance.timestamps = instance.hasTimestampAttributes(attributes)\n instance.setConnection(parent.connection)\n .setTable(table)\n .fill(attributes)\n .syncOriginal()\n instance.pivotParent = parent\n instance.exists = exists\n return instance\n }\n hasTimestampAttributes (attributes = null) {\n return (attributes || this.attributes)[this.constructor.CREATED_AT] !== undefined\n }\n}\n\nexport default Model\n","const HasUniqueIds = (Model) => {\n return class extends Model {\n useUniqueIds = true\n uniqueIds() {\n return [this.getKeyName()]\n }\n getKeyType() {\n if (this.uniqueIds().includes(this.getKeyName())) {\n return 'string'\n }\n return this.keyType\n }\n getIncrementing() {\n if (this.uniqueIds().includes(this.getKeyName())) {\n return false\n }\n return this.incrementing\n }\n }\n}\nexport default HasUniqueIds\n","import Collection from './collection'\nclass Paginator {\n static formatter = null\n _items\n _total\n _perPage\n _lastPage\n _currentPage\n static setFormatter(formatter) {\n if (typeof formatter !== 'function' && formatter !== null && formatter !== undefined) {\n throw new Error('Paginator formatter must be a function or null')\n }\n this.formatter = formatter\n }\n constructor(items, total, perPage, currentPage = null, options = {}) {\n this.options = options\n for (const key in options) {\n const value = options[key]\n this[key] = value\n }\n this._total = total\n this._perPage = parseInt(perPage)\n this._lastPage = Math.max(Math.ceil(total / perPage), 1)\n this._currentPage = currentPage\n this.setItems(items)\n }\n setItems(items) {\n this._items = items instanceof Collection ? items : new Collection(items)\n this.hasMore = this._items.count() > this._perPage\n this._items = this._items.slice(0, this._perPage)\n }\n firstItem() {\n return this.count() > 0 ? (this._currentPage - 1) * this._perPage + 1 : null\n }\n lastItem() {\n return this.count() > 0 ? this.firstItem() + this.count() - 1 : null\n }\n hasMorePages() {\n return this._currentPage < this._lastPage\n }\n get(index) {\n return this._items.get(index)\n }\n count() {\n return this._items.count()\n }\n items() {\n return this._items\n }\n map(callback) {\n return this._items.map(callback)\n }\n currentPage() {\n return this._currentPage\n }\n onFirstPage() {\n return this._currentPage === 1\n }\n perPage() {\n return this._perPage\n }\n lastPage() {\n return this._lastPage\n }\n total() {\n return this._total\n }\n toData() {\n if (this.constructor.formatter && typeof this.constructor.formatter === 'function') {\n return this.constructor.formatter(this)\n }\n return {\n current_page: this._currentPage,\n data: this._items.toData(),\n per_page: this._perPage,\n total: this._total,\n last_page: this._lastPage,\n count: this.count(),\n }\n }\n toJSON() {\n return this.toData()\n }\n toJson(...args) {\n return JSON.stringify(this.toData(), ...args)\n }\n}\nexport default Paginator\n","import { Pivot } from './model'\nexport { Pivot } from './model'\n\nexport default Pivot\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAM,YAAN,MAAM,WAAU;AAAA,EACZ;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,YAAY,EAAE,MAAM,MAAM,MAAM,KAAK,GAAG;AACpC,SAAK,MAAM;AACX,SAAK,MAAM;AAAA,EACf;AAAA,EACA,OAAO,KAAK,MAAM,MAAM,MAAM,MAAM;AAChC,WAAO,IAAI,WAAU,KAAK,GAAG;AAAA,EACjC;AAAA,EACA,OAAO,IAAI,KAAK;AACZ,WAAO,IAAI,WAAU,GAAG;AAAA,EAC5B;AAAA,EACA,OAAO,IAAI,KAA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BAAU,KAAK,KAAK,IAAI,UAAQ,MAAM,KAAK,IAAI,CAAC,GAAG,KAAK,OAAO,KAAK,UAAU,KAAK,YAAY;AAAA,EAC5G;AACA,UAAI,yBAAQ,IAAI,GAAG;AACjB,WAAO,IAAI,mBAAW,KAAK,IAAI,UAAQ,MAAM,KAAK,IAAI,CAAC,CAAC;AAAA,EAC1D;AACA,SAAO,MAAM,KAAK,IAAI;AACxB;AACA,IAAM,iBAAiB,CAAC,OAAO,SAAS,IAAI,mBAAW,KAAK,IAAI,UAAQ,MAAM,KAAK,IAAI,CAAC,CAAC;AACzF,IAAM,gBAAgB,CAAC,OAAO,SAAS,IAAI,kBAAU,KAAK,KAAK,IAAI,UAAQ,MAAM,KAAK,IAAI,CAAC,GAAG,KAAK,OAAO,KAAK,UAAU,KAAK,YAAY;AAC1I,IAAM,YAAY;AAclB,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["import_collect","import_radashi","dayjs","advancedFormat","import_radashi","import_dayjs","Model","value","collect","dayjs","flatten","import_radashi","import_radashi","Model","Model","import_radashi","Model","difference","import_radashi","pluralize","merge","BaseCollection","Model","Model","import_radashi"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/casts/attribute.js","../../src/casts-attributes.js","../../src/browser/collection.js","../../src/utils.js","../../src/browser/relations/relation.js","../../src/browser/relations/belongs-to.js","../../src/browser/relations/belongs-to-many.js","../../src/concerns/has-attributes.js","../../src/browser/relations/has-many.js","../../src/browser/relations/has-one.js","../../src/browser/relations/has-many-through.js","../../src/browser/relations/has-one-through.js","../../src/errors.js","../../src/browser/concerns/has-relations.js","../../src/concerns/has-timestamps.js","../../src/concerns/hides-attributes.js","../../src/browser/model.js","../../src/concerns/has-unique-ids.js","../../src/browser/paginator.js","../../src/browser/pivot.js","../../src/browser/index.js"],"sourcesContent":["class Attribute {\n get;\n set;\n withCaching = false\n withObjectCaching = true\n constructor({ get = null, set = null }) {\n this.get = get\n this.set = set\n }\n static make(get = null, set = null) {\n return new Attribute(get, set)\n }\n static get(get) {\n return new Attribute(get)\n }\n static set(set) {\n return new Attribute(null, set)\n }\n withoutObjectCaching() {\n this.withObjectCaching = false\n return this\n }\n shouldCache() {\n this.withCaching = true\n return this\n }\n}\nexport default Attribute\n","class CastsAttributes {\n constructor() {\n if (this.constructor === CastsAttributes) {\n throw new Error('CastsAttributes cannot be instantiated')\n }\n }\n static get() {\n throw new Error('get not implemented')\n }\n static set() {\n throw new Error('set not implemented')\n }\n}\nexport default CastsAttributes\n","import { Collection as BaseCollection, collect } from 'collect.js'\nimport { isArray, isEmpty, omit, pick } from 'radashi'\n\nimport Model from './model'\n\nclass Collection extends BaseCollection {\n mapThen (callback) {\n return Promise.all(this.map(callback))\n }\n modelKeys () {\n return this.all().map(item => item.getKey())\n }\n contains (key, operator = null, value = null) {\n if (arguments.length > 1) {\n return super.contains(key, operator, value)\n }\n if (key instanceof Model) {\n return super.contains(model => {\n return model.is(key)\n })\n }\n return super.contains(model => {\n return model.getKey() == key\n })\n }\n diff (items) {\n const diff = new this.constructor\n const dictionary = this.getDictionary(items)\n this.items.map(item => {\n if (dictionary[item.getKey()] === undefined) {\n diff.add(item)\n }\n })\n return diff\n }\n except (keys) {\n const dictionary = omit(this.getDictionary(), keys)\n return new this.constructor(Object.values(dictionary))\n }\n intersect (items) {\n const intersect = new this.constructor\n if (isEmpty(items)) {\n return intersect\n }\n const dictionary = this.getDictionary(items)\n for (let item of this.items) {\n if (dictionary[item.getKey()] !== undefined) {\n intersect.add(item)\n }\n }\n return intersect\n }\n unique (key = null, strict = false) {\n if (key !== null) {\n return super.unique(key, strict)\n }\n return new this.constructor(Object.values(this.getDictionary()))\n }\n find (key, defaultValue = null) {\n const Model = Model\n if (key instanceof Model) {\n key = key.getKey()\n }\n if (isArray(key)) {\n if (this.isEmpty()) {\n return new this.constructor\n }\n return this.whereIn(this.first().getKeyName(), key)\n }\n collect(this.items).first(model => {\n return model.getKey() == key\n })\n return this.items.filter(model => {\n return model.getKey() == key\n })[0] || defaultValue\n }\n makeVisible (attributes) {\n return this.each(item => {\n item.makeVisible(attributes)\n })\n }\n makeHidden (attributes) {\n return this.each(item => {\n item.makeHidden(attributes)\n })\n }\n append (attributes) {\n return this.each(item => {\n item.append(attributes)\n })\n }\n only (keys) {\n if (keys === null) {\n return new Collection(this.items)\n }\n const dictionary = pick(this.getDictionary(), keys)\n return new this.constructor(Object.values(dictionary))\n }\n getDictionary (items = null) {\n items = items === null ? this.items : items\n const dictionary = {}\n items.map(value => {\n dictionary[value.getKey()] = value\n })\n return dictionary\n }\n toData () {\n return this.all().map(item => typeof item.toData == 'function' ? item.toData() : item)\n }\n toJSON () {\n return this.toData()\n }\n toJson (...args) {\n return JSON.stringify(this.toData(), ...args)\n }\n [Symbol.iterator] () {\n const items = this.items\n let length = this.items.length\n let n = 0\n return {\n next () {\n return n < length ? {\n value: items[n++],\n done: false\n } : {\n done: true\n }\n }\n }\n }\n}\nexport default Collection\n","import { camel, dash, snake, trim } from 'radashi'\n\nimport advancedFormat from 'dayjs/plugin/advancedFormat'\nimport dayjs from 'dayjs'\n\ndayjs.extend(advancedFormat)\n\nexport const now = (format = 'YYYY-MM-DD HH:mm:ss') => dayjs().format(format)\n\nexport const getRelationName = (relationMethod) => {\n // 'relation' length 8\n return snake(relationMethod.substring(8))\n}\n\nexport const getScopeName = (scopeMethod) => {\n // 'scope' length 5\n return snake(scopeMethod.substring(5))\n}\n\nexport const getRelationMethod = (relation) => {\n return camel(`relation_${relation}`)\n}\n\nexport const getScopeMethod = (scope) => {\n return camel(`scope_${scope}`)\n}\n\nexport const getAttrMethod = (attr) => {\n return camel(`attribute_${attr}`)\n}\n\nexport const getGetterMethod = (attr) => {\n return camel(`get_${attr}_attribute`)\n}\n\nexport const getSetterMethod = (attr) => {\n return camel(`set_${attr}_attribute`)\n}\n\nexport const getAttrName = (attrMethod) => {\n return attrMethod.substring(3, attrMethod.length - 9).toLowerCase()\n}\n\n/**\n * Tap into a model a collection instance\n * \n * @param instance \n * @param callback \n * @returns \n */\nexport const tap = (instance, callback) => {\n const result = callback(instance)\n return result instanceof Promise ? result.then(() => instance) : instance\n}\n\n/**\n * Compose functional mixins\n * \n * @param Base \n * @param mixins \n * @returns \n */\nexport function compose (\n Base,\n ...mixins\n) {\n /**\n * Apply each mixin in sequence\n */\n return mixins.reduce(\n (cls, mixin) => mixin(cls),\n Base)\n}\n\nexport const flattenDeep = (arr) => Array.isArray(arr)\n ? arr.reduce((a, b) => a.concat(flattenDeep(b)), [])\n : [arr]\n\nexport const kebabCase = (str) => trim(dash(str.replace(/[^a-zA-Z0-9_-]/g, '-')), '_-')\nexport const snakeCase = (str) => trim(snake(str.replace(/[^a-zA-Z0-9_-]/g, '-')), '_-')\n\nexport default {\n now,\n getRelationName,\n getScopeName,\n getRelationMethod,\n getScopeMethod,\n getAttrMethod,\n getGetterMethod,\n getSetterMethod,\n getAttrName,\n compose,\n tap\n}\n","class Relation {\n parent\n related\n eagerKeysWereEmpty = false\n static constraints = true\n constructor(related, parent) {\n this.parent = parent\n this.related = related\n }\n asProxy() {\n const handler = {\n get: function (target, prop) {\n if (typeof target[prop] !== 'undefined') {\n return target[prop]\n }\n if (typeof prop === 'string') {\n return () => target.asProxy()\n }\n },\n }\n return new Proxy(this, handler)\n }\n getRelated() {\n return this.related\n }\n}\nexport default Relation\n","import Relation from './relation'\nclass BelongsTo extends Relation {\n foreignKey\n ownerKey\n child\n relationName\n constructor(related, child, foreignKey, ownerKey, relationName) {\n super(related, child)\n this.foreignKey = foreignKey\n this.ownerKey = ownerKey\n this.child = child\n this.relationName = relationName\n return this.asProxy()\n }\n}\nexport default BelongsTo\n","import Relation from './relation'\nclass BelongsToMany extends Relation {\n table\n foreignPivotKey\n relatedPivotKey\n parentKey\n relatedKey\n pivotColumns = []\n pivotValues = []\n pivotWheres = []\n pivotWhereIns = []\n pivotWhereNulls = []\n accessor = 'pivot'\n // withTimestamps = false;\n using\n pivotCreatedAt\n pivotUpdatedAt\n constructor(related, parent, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey) {\n super(related, parent)\n this.table = table\n this.foreignPivotKey = foreignPivotKey\n this.relatedPivotKey = relatedPivotKey\n this.parentKey = parentKey\n this.relatedKey = relatedKey\n return this.asProxy()\n }\n}\nexport default BelongsToMany\n","import { flat as flatten, omit } from 'radashi'\nimport { flattenDeep, getAttrMethod, getGetterMethod, getSetterMethod } from '../utils'\n\nimport CastsAttributes from '../casts-attributes'\nimport collect from 'collect.js'\nimport dayjs from 'dayjs'\n\nconst HasAttributes = (Model) => {\n return class extends Model {\n static castTypeCache = {}\n attributes = {}\n original = {}\n casts = {}\n changes = {}\n appends = []\n setAppends (appends) {\n this.appends = appends\n return this\n }\n append (...keys) {\n const appends = flattenDeep(keys)\n this.appends = [...this.appends, ...appends]\n return this\n }\n normalizeCastClassResponse (key, value) {\n return value?.constructor?.name === 'Object'\n ? value\n : {\n [key]: value\n }\n }\n syncOriginal () {\n this.original = this.getAttributes()\n return this\n }\n syncChanges () {\n this.changes = this.getDirty()\n return this\n }\n syncOriginalAttribute (attribute) {\n this.syncOriginalAttributes(attribute)\n }\n syncOriginalAttributes (...attributes) {\n attributes = flattenDeep(attributes)\n const modelAttributes = this.getAttributes()\n for (const attribute of attributes) {\n this.original[attribute] = modelAttributes[attribute]\n }\n return this\n }\n isDirty (...attributes) {\n const changes = this.getDirty()\n attributes = flattenDeep(attributes)\n if (attributes.length === 0) {\n return Object.keys(changes).length > 0\n }\n for (const attribute of attributes) {\n if (attribute in changes) {\n return true\n }\n }\n return false\n }\n getDirty () {\n const dirty = {}\n const attributes = this.getAttributes()\n for (const key in attributes) {\n const value = attributes[key]\n if (!this.originalIsEquivalent(key)) {\n dirty[key] = value\n }\n }\n return dirty\n }\n originalIsEquivalent (key) {\n if (this.original[key] === undefined) {\n return false\n }\n const attribute = this.attributes[key]\n const original = this.original[key]\n if (attribute === original) {\n return true\n }\n else {\n return false\n }\n }\n setAttributes (attributes) {\n this.attributes = { ...attributes }\n }\n setRawAttributes (attributes, sync = false) {\n this.attributes = attributes\n if (sync) {\n this.syncOriginal()\n }\n return this\n }\n getAttributes () {\n return { ...this.attributes }\n }\n setAttribute (key, value) {\n const setterMethod = getSetterMethod(key)\n if (typeof this[setterMethod] === 'function') {\n this[setterMethod](value)\n return this\n }\n const attrMethod = getAttrMethod(key)\n if (typeof this[attrMethod] === 'function') {\n const attribute = this[attrMethod]()\n const callback = attribute.set || ((value) => {\n this.attributes[key] = value\n })\n this.attributes = {\n ...this.attributes,\n ...this.normalizeCastClassResponse(key, callback(value, this.attributes))\n }\n return this\n }\n const casts = this.getCasts()\n const castType = casts[key]\n if (this.isCustomCast(castType)) {\n value = castType.set(this, key, value, this.attributes)\n }\n if (castType === 'json') {\n value = JSON.stringify(value)\n }\n if (castType === 'collection') {\n value = JSON.stringify(value)\n }\n if (value !== null && this.isDateAttribute(key)) {\n value = this.fromDateTime(value)\n }\n this.attributes[key] = value\n return this\n }\n getAttribute (key) {\n if (!key) {\n return\n }\n const getterMethod = getGetterMethod(key)\n if (typeof this[getterMethod] === 'function') {\n return this[getterMethod](this.attributes[key], this.attributes)\n }\n const attrMethod = getAttrMethod(key)\n if (typeof this[attrMethod] === 'function') {\n const caster = this[attrMethod]()\n return caster.get(this.attributes[key], this.attributes)\n }\n if (key in this.attributes) {\n if (this.hasCast(key)) {\n return this.castAttribute(key, this.attributes[key])\n }\n if (this.getDates().includes(key)) {\n return this.asDateTime(this.attributes[key])\n }\n return this.attributes[key]\n }\n if (key in this.relations) {\n return this.relations[key]\n }\n return\n }\n castAttribute (key, value) {\n const castType = this.getCastType(key)\n if (!castType) {\n return value\n }\n if (value === null) {\n return value\n }\n switch (castType) {\n case 'int':\n case 'integer':\n return parseInt(value)\n case 'real':\n case 'float':\n case 'double':\n return parseFloat(value)\n case 'decimal':\n return this.asDecimal(value, castType.split(':')[1])\n case 'string':\n return String(value)\n case 'bool':\n case 'boolean':\n return Boolean(value)\n case 'object':\n case 'json':\n try {\n return JSON.parse(value)\n }\n catch (e) {\n return null\n }\n case 'collection':\n try {\n return collect(JSON.parse(value))\n }\n catch (e) {\n return collect([])\n }\n case 'date':\n return this.asDate(value)\n case 'datetime':\n case 'custom_datetime':\n return this.asDateTime(value)\n case 'timestamp':\n return this.asTimestamp(value)\n }\n if (this.isCustomCast(castType)) {\n return castType.get(this, key, value, this.attributes)\n }\n return value\n }\n attributesToData () {\n let attributes = { ...this.attributes }\n for (const key in attributes) {\n if (this.hidden.includes(key)) {\n attributes = omit(attributes, [key])\n }\n if (this.visible.length > 0 && this.visible.includes(key) === false) {\n attributes = omit(attributes, [key])\n }\n }\n for (const key of this.getDates()) {\n if (attributes[key] === undefined) {\n continue\n }\n attributes[key] = this.serializeDate(this.asDateTime(attributes[key]))\n }\n const casts = this.getCasts()\n for (const key in casts) {\n const value = casts[key]\n if ((key in attributes) === false) {\n continue\n }\n attributes[key] = this.castAttribute(key, attributes[key])\n if (key in attributes && ['date', 'datetime'].includes(value)) {\n attributes[key] = this.serializeDate(attributes[key])\n }\n if (key in attributes && this.isCustomDateTimeCast(value)) {\n attributes[key] = dayjs(attributes[key]).format(value.split(':')[1])\n }\n }\n for (const key of this.appends) {\n attributes[key] = this.mutateAttribute(key, null)\n }\n return attributes\n }\n mutateAttribute (key, value) {\n if (typeof this[getGetterMethod(key)] === 'function') {\n return this[getGetterMethod(key)](value)\n }\n else if (typeof this[getAttrMethod(key)] === 'function') {\n const caster = this[getAttrMethod(key)]()\n return caster.get(key, this.attributes)\n }\n else if (key in this) {\n return this[key]\n }\n return value\n }\n mutateAttributeForArray (key, value) {\n }\n isDateAttribute (key) {\n return this.getDates().includes(key) || this.isDateCastable(key)\n }\n serializeDate (date) {\n return date ? dayjs(date).toISOString() : null\n }\n getDates () {\n return this.usesTimestamps() ? [\n this.getCreatedAtColumn(),\n this.getUpdatedAtColumn(),\n ] : []\n }\n getCasts () {\n if (this.getIncrementing()) {\n return {\n [this.getKeyName()]: this.getKeyType(),\n ...this.casts\n }\n }\n return this.casts\n }\n getCastType (key) {\n const castType = this.getCasts()[key]\n let castTypeCacheKey\n if (typeof castType === 'string') {\n castTypeCacheKey = castType\n }\n else if ((new castType) instanceof CastsAttributes) {\n castTypeCacheKey = castType.name\n }\n if (castTypeCacheKey && this.constructor.castTypeCache[castTypeCacheKey] !== undefined) {\n return this.constructor.castTypeCache[castTypeCacheKey]\n }\n let convertedCastType\n if (this.isCustomDateTimeCast(castType)) {\n convertedCastType = 'custom_datetime'\n }\n else if (this.isDecimalCast(castType)) {\n convertedCastType = 'decimal'\n }\n else if (this.isCustomCast(castType)) {\n convertedCastType = castType\n }\n else {\n convertedCastType = castType.toLocaleLowerCase().trim()\n }\n return this.constructor.castTypeCache[castTypeCacheKey] = convertedCastType\n }\n hasCast (key, types = []) {\n if (key in this.casts) {\n types = flatten(types)\n return types.length > 0 ? types.includes(this.getCastType(key)) : true\n }\n return false\n }\n withDayjs (date) {\n return dayjs(date)\n }\n isCustomCast (cast) {\n return typeof cast === 'function' && (new cast) instanceof CastsAttributes\n }\n isCustomDateTimeCast (cast) {\n if (typeof cast !== 'string') {\n return false\n }\n return cast.startsWith('date:') || cast.startsWith('datetime:')\n }\n isDecimalCast (cast) {\n if (typeof cast !== 'string') {\n return false\n }\n return cast.startsWith('decimal:')\n }\n isDateCastable (key) {\n return this.hasCast(key, ['date', 'datetime'])\n }\n fromDateTime (value) {\n return dayjs(this.asDateTime(value)).format(this.getDateFormat())\n }\n getDateFormat () {\n return this.dateFormat || 'YYYY-MM-DD HH:mm:ss'\n }\n asDecimal (value, decimals) {\n return parseFloat(value).toFixed(decimals)\n }\n asDateTime (value) {\n if (value === null) {\n return null\n }\n if (value instanceof Date) {\n return value\n }\n if (typeof value === 'number') {\n return new Date(value * 1000)\n }\n return new Date(value)\n }\n asDate (value) {\n const date = this.asDateTime(value)\n return dayjs(date).startOf('day').toDate()\n }\n }\n}\nexport default HasAttributes\n","import Relation from './relation'\nclass HasMany extends Relation {\n foreignKey\n localKey\n constructor(related, parent, foreignKey, localKey) {\n super(related, parent)\n this.foreignKey = foreignKey\n this.localKey = localKey\n return this.asProxy()\n }\n}\nexport default HasMany\n","import Relation from './relation'\nclass HasOne extends Relation {\n foreignKey\n localKey\n constructor(related, parent, foreignKey, localKey) {\n super(related, parent)\n this.foreignKey = foreignKey\n this.localKey = localKey\n return this.asProxy()\n }\n}\nexport default HasOne\n","import Relation from './relation'\nclass HasManyThrough extends Relation {\n throughParent\n farParent\n firstKey\n secondKey\n localKey\n secondLocalKey\n constructor(query, farParent, throughParent, firstKey, secondKey, localKey, secondLocalKey) {\n super(query, throughParent)\n this.localKey = localKey\n this.firstKey = firstKey\n this.secondKey = secondKey\n this.farParent = farParent\n this.throughParent = throughParent\n this.secondLocalKey = secondLocalKey\n return this.asProxy()\n }\n}\nexport default HasManyThrough\n","import HasManyThrough from './has-many-through'\nclass HasOneThrough extends HasManyThrough {\n}\nexport default HasOneThrough\n","import { isArray } from 'radashi'\nclass BaseError extends Error {\n constructor(message, entity) {\n super(message)\n Error.captureStackTrace(this, this.constructor)\n this.name = this.constructor.name\n this.message = message\n }\n}\nclass ModelNotFoundError extends BaseError {\n model\n ids\n setModel (model, ids = []) {\n this.model = model\n this.ids = isArray(ids) ? ids : [ids]\n this.message = `No query results for model [${model}]`\n if (this.ids.length > 0) {\n this.message += ' ' + this.ids.join(', ')\n }\n else {\n this.message += '.'\n }\n return this\n }\n getModel () {\n return this.model\n }\n getIds () {\n return this.ids\n }\n}\nclass RelationNotFoundError extends BaseError {\n}\nclass InvalidArgumentError extends BaseError {\n}\nexport { ModelNotFoundError }\nexport { RelationNotFoundError }\nexport { InvalidArgumentError }\nexport default {\n ModelNotFoundError,\n RelationNotFoundError,\n InvalidArgumentError\n}\n","import { getRelationMethod, getRelationName, snakeCase } from '../../utils'\n\nimport BelongsTo from '../../browser/relations/belongs-to'\nimport BelongsToMany from '../../browser/relations/belongs-to-many'\nimport HasMany from '../../browser/relations/has-many'\nimport HasManyThrough from '../../browser/relations/has-many-through'\nimport HasOne from '../../browser/relations/has-one'\nimport HasOneThrough from '../../browser/relations/has-one-through'\nimport { RelationNotFoundError } from '../../errors'\nimport { omit } from 'radashi'\n\nconst HasRelations = (Model) => {\n return class extends Model {\n relations = {}\n getRelation (relation) {\n return this.relations[relation]\n }\n setRelation (relation, value) {\n this.relations[relation] = value\n return this\n }\n unsetRelation (relation) {\n this.relations = omit(this.relations, [relation])\n return this\n }\n relationLoaded (relation) {\n return this.relations[relation] !== undefined\n }\n related (relation) {\n if (typeof this[getRelationMethod(relation)] !== 'function') {\n const message = `Model [${this.constructor.name}]'s relation [${relation}] doesn't exist.`\n throw new RelationNotFoundError(message)\n }\n return this[getRelationMethod(relation)]()\n }\n async getRelated (relation) {\n return await this.related(relation).getResults()\n }\n relationsToData () {\n const data = {}\n for (const key in this.relations) {\n if (this.hidden.includes(key)) {\n continue\n }\n if (this.visible.length > 0 && this.visible.includes(key) === false) {\n continue\n }\n data[key] = this.relations[key] instanceof Array\n ? this.relations[key].map(item => item.toData())\n : this.relations[key] === null\n ? null\n : this.relations[key].toData()\n }\n return data\n }\n guessBelongsToRelation () {\n let e = new Error()\n let frame = e.stack.split('\\n')[2]\n // let lineNumber = frame.split(\":\").reverse()[1];\n let functionName = frame.split(' ')[5]\n return getRelationName(functionName)\n }\n joiningTable (related, instance = null) {\n const segments = [\n instance ? instance.joiningTableSegment() : snakeCase(related.name),\n this.joiningTableSegment(),\n ]\n return segments.sort().join('_').toLocaleLowerCase()\n }\n joiningTableSegment () {\n return snakeCase(this.constructor.name)\n }\n hasOne (related, foreignKey = null, localKey = null) {\n const instance = new related\n foreignKey = foreignKey || this.getForeignKey()\n localKey = localKey || this.getKeyName()\n return (new HasOne(related, this, instance.getTable() + '.' + foreignKey, localKey))\n }\n hasMany (related, foreignKey = null, localKey = null) {\n const instance = new related\n foreignKey = foreignKey || this.getForeignKey()\n localKey = localKey || this.getKeyName()\n return (new HasMany(related, this, instance.getTable() + '.' + foreignKey, localKey))\n }\n belongsTo (related, foreignKey = null, ownerKey = null, relation = null) {\n const instance = new related\n foreignKey = foreignKey || instance.getForeignKey()\n ownerKey = ownerKey || instance.getKeyName()\n relation = relation || this.guessBelongsToRelation()\n return (new BelongsTo(related, this, foreignKey, ownerKey, relation))\n }\n belongsToMany (related, table = null, foreignPivotKey = null, relatedPivotKey = null, parentKey = null, relatedKey = null) {\n const instance = new related\n const query = related.query()\n table = table || this.joiningTable(related, instance)\n foreignPivotKey = foreignPivotKey || this.getForeignKey()\n relatedPivotKey = relatedPivotKey || instance.getForeignKey()\n parentKey = parentKey || this.getKeyName()\n relatedKey = relatedKey || instance.getKeyName()\n return (new BelongsToMany(query, this, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey))\n }\n hasOneThrough (related, through, firstKey = null, secondKey = null, localKey = null, secondLocalKey = null) {\n through = new through\n const query = related.query()\n firstKey = firstKey || this.getForeignKey()\n secondKey = secondKey || through.getForeignKey()\n return (new HasOneThrough(query, this, through, firstKey, secondKey, localKey || this.getKeyName(), secondLocalKey || through.getKeyName()))\n }\n hasManyThrough (related, through, firstKey = null, secondKey = null, localKey = null, secondLocalKey = null) {\n through = new through\n const query = related.query()\n firstKey = firstKey || this.getForeignKey()\n secondKey = secondKey || through.getForeignKey()\n return (new HasManyThrough(query, this, through, firstKey, secondKey, localKey || this.getKeyName(), secondLocalKey || through.getKeyName()))\n }\n }\n}\nexport default HasRelations\n","const HasTimestamps = (Model) => {\n return class extends Model {\n static CREATED_AT = 'created_at'\n static UPDATED_AT = 'updated_at'\n static DELETED_AT = 'deleted_at'\n timestamps = true\n dateFormat = 'YYYY-MM-DD HH:mm:ss'\n usesTimestamps() {\n return this.timestamps\n }\n updateTimestamps() {\n const time = this.freshTimestampString()\n const updatedAtColumn = this.getUpdatedAtColumn()\n if (updatedAtColumn && !this.isDirty(updatedAtColumn)) {\n this.setUpdatedAt(time)\n }\n const createdAtColumn = this.getCreatedAtColumn()\n if (!this.exists && createdAtColumn && !this.isDirty(createdAtColumn)) {\n this.setCreatedAt(time)\n }\n return this\n }\n getCreatedAtColumn() {\n return this.constructor.CREATED_AT\n }\n getUpdatedAtColumn() {\n return this.constructor.UPDATED_AT\n }\n setCreatedAt(value) {\n this.attributes[this.getCreatedAtColumn()] = value\n return this\n }\n setUpdatedAt(value) {\n this.attributes[this.getUpdatedAtColumn()] = value\n return this\n }\n freshTimestamp() {\n const time = new Date\n time.setMilliseconds(0)\n return time\n }\n freshTimestampString() {\n return this.fromDateTime(this.freshTimestamp())\n }\n }\n}\nexport default HasTimestamps\n","import { diff as difference } from 'radashi'\nimport { flattenDeep } from '../utils'\n\nconst HidesAttributes = (Model) => {\n return class extends Model {\n hidden = []\n visible = []\n makeVisible (...keys) {\n const visible = flattenDeep(keys)\n if (this.visible.length > 0) {\n this.visible = [...this.visible, ...visible]\n }\n this.hidden = difference(this.hidden, visible)\n return this\n }\n makeHidden (...keys) {\n const hidden = flattenDeep(keys)\n if (this.hidden.length > 0) {\n this.hidden = [...this.hidden, ...hidden]\n }\n return this\n }\n getHidden () {\n return this.hidden\n }\n getVisible () {\n return this.visible\n }\n setHidden (hidden) {\n this.hidden = hidden\n return this\n }\n setVisible (visible) {\n this.visible = visible\n return this\n }\n }\n}\nexport default HidesAttributes\n","import { compose, getRelationMethod, getScopeMethod, snakeCase } from '../utils'\n\nimport BelongsTo from './relations/belongs-to'\nimport BelongsToMany from './relations/belongs-to-many'\nimport Collection from './collection'\nimport HasAttributes from '../concerns/has-attributes'\nimport HasMany from './relations/has-many'\nimport HasOne from './relations/has-one'\nimport HasRelations from './concerns/has-relations'\nimport HasTimestamps from '../concerns/has-timestamps'\nimport HidesAttributes from '../concerns/hides-attributes'\nimport { assign as merge } from 'radashi'\nimport pluralize from 'pluralize'\n\nconst BaseModel = compose(class {\n}, HasAttributes, HidesAttributes, HasRelations, HasTimestamps)\nclass Model extends BaseModel {\n primaryKey = 'id' // protected\n table = null // protected\n keyType = 'int' // protected\n perPage = 15 // protected\n static globalScopes = {}\n static pluginInitializers = {}\n static _booted = {}\n static resolver = null\n static browser = true\n static init (attributes = {}) {\n return new this(attributes)\n }\n static extend (plugin, options) {\n plugin(this, options)\n }\n static make (attributes = {}) {\n const instance = new this()\n for (let attribute in attributes) {\n if (typeof instance[getRelationMethod(attribute)] !== 'function') {\n instance.setAttribute(attribute, attributes[attribute])\n }\n else {\n const relation = instance[getRelationMethod(attribute)]()\n if (relation instanceof HasOne\n || relation instanceof BelongsTo) {\n instance.setRelation(attribute, relation.related.make(attributes[attribute]))\n }\n else if ((relation instanceof HasMany || relation instanceof BelongsToMany)\n && Array.isArray(attributes[attribute])) {\n instance.setRelation(attribute, new Collection(attributes[attribute].map(item => relation.related.make(item))))\n }\n }\n }\n return instance\n }\n constructor(attributes = {}) {\n super()\n this.bootIfNotBooted()\n this.initializePlugins()\n this.syncOriginal()\n this.fill(attributes)\n return this.asProxy()\n }\n bootIfNotBooted () {\n if (this.constructor._booted[this.constructor.name] === undefined) {\n this.constructor._booted[this.constructor.name] = true\n this.constructor.booting()\n this.initialize()\n this.constructor.boot()\n this.constructor.booted()\n }\n }\n static booting () {\n }\n static boot () {\n }\n static booted () {\n }\n static setConnectionResolver (resolver) {\n this.resolver = resolver\n }\n initialize () {\n }\n initializePlugins () {\n if (typeof this.constructor.pluginInitializers[this.constructor.name] === 'undefined') {\n return\n }\n for (const method of this.constructor.pluginInitializers[this.constructor.name]) {\n this[method]()\n }\n }\n addPluginInitializer (method) {\n if (!this.constructor.pluginInitializers[this.constructor.name]) {\n this.constructor.pluginInitializers[this.constructor.name] = []\n }\n this.constructor.pluginInitializers[this.constructor.name].push(method)\n }\n newInstance (attributes = {}, exists = false) {\n const model = new this.constructor\n model.exists = exists\n model.setTable(this.getTable())\n model.fill(attributes)\n return model\n }\n asProxy () {\n const handler = {\n get: function (target, prop) {\n if (target[prop] !== undefined) {\n return target[prop]\n }\n // get model column\n if (typeof prop === 'string') {\n // get custom attribute\n return target.getAttribute(prop)\n }\n },\n set: function (target, prop, value) {\n if (target[prop] !== undefined && typeof target !== 'function') {\n target[prop] = value\n return target\n }\n if (typeof prop === 'string') {\n return target.setAttribute(prop, value)\n }\n return target\n }\n }\n return new Proxy(this, handler)\n }\n getKey () {\n return this.getAttribute(this.getKeyName())\n }\n getKeyName () {\n return this.primaryKey\n }\n getForeignKey () {\n return snakeCase(this.constructor.name) + '_' + this.getKeyName()\n }\n getConnectionName () {\n return this.connection\n }\n getTable () {\n return this.table || pluralize(snakeCase(this.constructor.name))\n }\n setConnection (connection) {\n this.connection = connection\n return this\n }\n getKeyType () {\n return this.keyType\n }\n hasNamedScope (name) {\n const scope = getScopeMethod(name)\n return typeof this[scope] === 'function'\n }\n callNamedScope (scope, parameters) {\n const scopeMethod = getScopeMethod(scope)\n return this[scopeMethod](...parameters)\n }\n setTable (table) {\n this.table = table\n return this\n }\n newCollection (models = []) {\n return new Collection(models)\n }\n getIncrementing () {\n return this.incrementing\n }\n setIncrementing (value) {\n this.incrementing = value\n return this\n }\n toData () {\n return merge(this.attributesToData(), this.relationsToData())\n }\n toJSON () {\n return this.toData()\n }\n toJson (...args) {\n return JSON.stringify(this.toData(), ...args)\n }\n toString () {\n return this.toJson()\n }\n fill (attributes) {\n for (const key in attributes) {\n this.setAttribute(key, attributes[key])\n }\n return this\n }\n transacting (trx) {\n this.trx = trx\n return this\n }\n trashed () {\n return this[this.getDeletedAtColumn()] !== null\n }\n newPivot (parent, attributes, table, exists, using = null) {\n return using ? using.fromRawAttributes(parent, attributes, table, exists)\n : Pivot.fromAttributes(parent, attributes, table, exists)\n }\n qualifyColumn (column) {\n if (column.includes('.')) {\n return column\n }\n return `${this.getTable()}.${column}`\n }\n getQualifiedKeyName () {\n return this.qualifyColumn(this.getKeyName())\n }\n is (model) {\n return model && model instanceof Model &&\n this.getKey() === model.getKey() &&\n this.getTable() === model.getTable()\n }\n isNot (model) {\n return !this.is(model)\n }\n}\n\n\nexport class Pivot extends Model {\n incrementing = false\n guarded = []\n pivotParent = null\n foreignKey = null\n relatedKey = null\n setPivotKeys (foreignKey, relatedKey) {\n this.foreignKey = foreignKey\n this.relatedKey = relatedKey\n return this\n }\n static fromRawAttributes (parent, attributes, table, exists = false) {\n const instance = this.fromAttributes(parent, {}, table, exists)\n instance.timestamps = instance.hasTimestampAttributes(attributes)\n instance.attributes = attributes\n instance.exists = exists\n return instance\n }\n static fromAttributes (parent, attributes, table, exists = false) {\n const instance = new this\n instance.timestamps = instance.hasTimestampAttributes(attributes)\n instance.setConnection(parent.connection)\n .setTable(table)\n .fill(attributes)\n .syncOriginal()\n instance.pivotParent = parent\n instance.exists = exists\n return instance\n }\n hasTimestampAttributes (attributes = null) {\n return (attributes || this.attributes)[this.constructor.CREATED_AT] !== undefined\n }\n}\n\nexport default Model\n","const HasUniqueIds = (Model) => {\n return class extends Model {\n useUniqueIds = true\n uniqueIds() {\n return [this.getKeyName()]\n }\n getKeyType() {\n if (this.uniqueIds().includes(this.getKeyName())) {\n return 'string'\n }\n return this.keyType\n }\n getIncrementing() {\n if (this.uniqueIds().includes(this.getKeyName())) {\n return false\n }\n return this.incrementing\n }\n }\n}\nexport default HasUniqueIds\n","import Collection from './collection'\nclass Paginator {\n static formatter = null\n _items\n _total\n _perPage\n _lastPage\n _currentPage\n static setFormatter(formatter) {\n if (typeof formatter !== 'function' && formatter !== null && formatter !== undefined) {\n throw new Error('Paginator formatter must be a function or null')\n }\n this.formatter = formatter\n }\n constructor(items, total, perPage, currentPage = null, options = {}) {\n this.options = options\n for (const key in options) {\n const value = options[key]\n this[key] = value\n }\n this._total = total\n this._perPage = parseInt(perPage)\n this._lastPage = Math.max(Math.ceil(total / perPage), 1)\n this._currentPage = currentPage\n this.setItems(items)\n }\n setItems(items) {\n this._items = items instanceof Collection ? items : new Collection(items)\n this.hasMore = this._items.count() > this._perPage\n this._items = this._items.slice(0, this._perPage)\n }\n firstItem() {\n return this.count() > 0 ? (this._currentPage - 1) * this._perPage + 1 : null\n }\n lastItem() {\n return this.count() > 0 ? this.firstItem() + this.count() - 1 : null\n }\n hasMorePages() {\n return this._currentPage < this._lastPage\n }\n get(index) {\n return this._items.get(index)\n }\n count() {\n return this._items.count()\n }\n items() {\n return this._items\n }\n map(callback) {\n return this._items.map(callback)\n }\n currentPage() {\n return this._currentPage\n }\n onFirstPage() {\n return this._currentPage === 1\n }\n perPage() {\n return this._perPage\n }\n lastPage() {\n return this._lastPage\n }\n total() {\n return this._total\n }\n toData() {\n if (this.constructor.formatter && typeof this.constructor.formatter === 'function') {\n return this.constructor.formatter(this)\n }\n return {\n current_page: this._currentPage,\n data: this._items.toData(),\n per_page: this._perPage,\n total: this._total,\n last_page: this._lastPage,\n count: this.count(),\n }\n }\n toJSON() {\n return this.toData()\n }\n toJson(...args) {\n return JSON.stringify(this.toData(), ...args)\n }\n}\nexport default Paginator\n","import { Pivot } from './model'\nexport { Pivot } from './model'\n\nexport default Pivot\n","import Attribute from '../casts/attribute'\nimport CastsAttributes from '../casts-attributes'\nimport Collection from './collection'\nimport HasUniqueIds from '../concerns/has-unique-ids'\nimport Model from './model'\nimport Paginator from './paginator'\nimport Pivot from './pivot'\nimport { isArray } from 'radashi'\nconst make = (model, data, options = {}) => {\n const { paginated } = options\n if (paginated) {\n return new Paginator(data.data.map(item => model.make(item)), data.total, data.per_page, data.current_page)\n }\n if (isArray(data)) {\n return new Collection(data.map(item => model.make(item)))\n }\n return model.make(data)\n}\nconst makeCollection = (model, data) => new Collection(data.map(item => model.make(item)))\nconst makePaginator = (model, data) => new Paginator(data.data.map(item => model.make(item)), data.total, data.per_page, data.current_page)\nconst isBrowser = true\nexport { isBrowser }\nexport { Paginator }\nexport { Collection }\nexport { Model }\nexport { Pivot }\nexport { Attribute }\nexport { CastsAttributes }\nexport { HasUniqueIds }\nexport { make }\nexport { makeCollection }\nexport { makePaginator }\nexport * from '../utils'\nexport * from '../errors'\nexport default {\n isBrowser,\n Paginator,\n Collection,\n Model,\n Pivot,\n Attribute,\n CastsAttributes,\n HasUniqueIds,\n make,\n makeCollection,\n makePaginator,\n}\n"],"mappings":";AAAA,IAAM,YAAN,MAAM,WAAU;AAAA,EACZ;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,YAAY,EAAE,MAAM,MAAM,MAAM,KAAK,GAAG;AACpC,SAAK,MAAM;AACX,SAAK,MAAM;AAAA,EACf;AAAA,EACA,OAAO,KAAK,MAAM,MAAM,MAAM,MAAM;AAChC,WAAO,IAAI,WAAU,KAAK,GAAG;AAAA,EACjC;AAAA,EACA,OAAO,IAAI,KAAK;AACZ,WAAO,IAAI,WAAU,GAAG;AAAA,EAC5B;AAAA,EACA,OAAO,IAAI,KAAK;AACZ,WAAO,IAAI,WAAU,MAAM,GAAG;AAAA,EAClC;AAAA,EACA,uBAAuB;AACnB,SAAK,oBAAoB;AACzB,WAAO;AAAA,EACX;AAAA,EACA,cAAc;AACV,SAAK,cAAc;AACnB,WAAO;AAAA,EACX;AACJ;AACA,IAAO,oBAAQ;;;AC3Bf,IAAM,kBAAN,MAAM,iBAAgB;AAAA,EAClB,cAAc;AACV,QAAI,KAAK,gBAAgB,kBAAiB;AACtC,YAAM,IAAI,MAAM,wCAAwC;AAAA,IAC5D;AAAA,EACJ;AAAA,EACA,OAAO,MAAM;AACT,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACzC;AAAA,EACA,OAAO,MAAM;AACT,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACzC;AACJ;AACA,IAAO,2BAAQ;;;ACbf,SAAS,cAAc,gBAAgB,WAAAA,gBAAe;AACtD,SAAS,WAAAC,UAAS,SAAS,QAAAC,OAAM,YAAY;;;ACD7C,SAAS,OAAO,MAAM,OAAO,YAAY;AAEzC,OAAO,oBAAoB;AAC3B,OAAO,WAAW;AAElB,MAAM,OAAO,cAAc;AAEpB,IAAM,MAAM,CA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AM,KAAK,OAAO,OAAO;AAAA,MACzB,UAAU,KAAK;AAAA,MACf,OAAO,KAAK;AAAA,MACZ,WAAW,KAAK;AAAA,MAChB,OAAO,KAAK,MAAM;AAAA,IACtB;AAAA,EACJ;AAAA,EACA,SAAS;AACL,WAAO,KAAK,OAAO;AAAA,EACvB;AAAA,EACA,UAAU,MAAM;AACZ,WAAO,KAAK,UAAU,KAAK,OAAO,GAAG,GAAG,IAAI;AAAA,EAChD;AACJ;AACA,IAAO,oBAAQ;;;ACpFf,IAAO,gBAAQ;;;ACIf,SAAS,WAAAC,gBAAe;AACxB,IAAM,OAAO,CAAC,OAAO,MAAM,UAAU,CAAC,MAAM;AAC1C,QAAM,EAAE,UAAU,IAAI;AACtB,MAAI,WAAW;AACb,WAAO,IAAI,kBAAU,KAAK,KAAK,IAAI,UAAQ,MAAM,KAAK,IAAI,CAAC,GAAG,KAAK,OAAO,KAAK,UAAU,KAAK,YAAY;AAAA,EAC5G;AACA,MAAIA,SAAQ,IAAI,GAAG;AACjB,WAAO,IAAI,mBAAW,KAAK,IAAI,UAAQ,MAAM,KAAK,IAAI,CAAC,CAAC;AAAA,EAC1D;AACA,SAAO,MAAM,KAAK,IAAI;AACxB;AACA,IAAM,iBAAiB,CAAC,OAAO,SAAS,IAAI,mBAAW,KAAK,IAAI,UAAQ,MAAM,KAAK,IAAI,CAAC,CAAC;AACzF,IAAM,gBAAgB,CAAC,OAAO,SAAS,IAAI,kBAAU,KAAK,KAAK,IAAI,UAAQ,MAAM,KAAK,IAAI,CAAC,GAAG,KAAK,OAAO,KAAK,UAAU,KAAK,YAAY;AAC1I,IAAM,YAAY;AAclB,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["collect","isArray","omit","dayjs","Model","value","omit","Model","Model","Model","omit","Model","isArray","collect","Model","isArray"]}