alchemymvc 1.1.10 → 1.2.2

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.
@@ -1082,7 +1082,7 @@ Alchemy.setMethod(function downloadFile(url, options, callback) {
1082
1082
  file = fs.createWriteStream(filepath);
1083
1083
 
1084
1084
  if (res.statusCode == 404) {
1085
- err = new Error('Path does not exist');
1085
+ err = new Error('Path "' + url + '" does not exist');
1086
1086
  err.number = 404;
1087
1087
 
1088
1088
  return callback(err);
@@ -1325,7 +1325,7 @@ Alchemy.setMethod(function exposeStatic(name, value) {
1325
1325
  *
1326
1326
  * @author Jelle De Loecker <jelle@develry.be>
1327
1327
  * @since 1.1.0
1328
- * @version 1.1.0
1328
+ * @version 1.2.1
1329
1329
  */
1330
1330
  Alchemy.setMethod(function exposeDefaultStaticVariables() {
1331
1331
 
@@ -1372,6 +1372,9 @@ Alchemy.setMethod(function exposeDefaultStaticVariables() {
1372
1372
 
1373
1373
  hawkejs.exposeStatic('app_version', app_version);
1374
1374
  hawkejs.app_version = app_version;
1375
+
1376
+ // Emit as a global event so plugins can also expose their data
1377
+ this.emit('generate_static_variables', hawkejs);
1375
1378
  });
1376
1379
 
1377
1380
  /**
@@ -166,7 +166,7 @@ Alchemy.setProperty('default_use_path_options', {
166
166
  *
167
167
  * @author Jelle De Loecker <jelle@develry.be>
168
168
  * @since 0.0.1
169
- * @version 1.0.3
169
+ * @version 1.2.0
170
170
  *
171
171
  * @param {String} dir_path
172
172
  * @param {Object} options
@@ -255,7 +255,8 @@ Alchemy.setMethod(function _usePath(dir_path, options) {
255
255
  parent_path : dir_path,
256
256
  name : file_name,
257
257
  path : file_path,
258
- stat : file_stat
258
+ stat : file_stat,
259
+ local_path : file_path.slice(PATH_APP.length),
259
260
  });
260
261
 
261
262
  continue;
@@ -273,6 +274,11 @@ Alchemy.setMethod(function _usePath(dir_path, options) {
273
274
  for (i = 0; i < directories.length; i++) {
274
275
  entry = directories[i];
275
276
 
277
+ // Don't load migrations
278
+ if (entry.local_path == '/migrations') {
279
+ continue;
280
+ }
281
+
276
282
  // Do not include subfolders of the "config" directory
277
283
  // if it's a modular load
278
284
  if (options.modularParent && /\/config$/.exec(entry.parent_path)) {
@@ -807,7 +813,7 @@ Alchemy.setMethod(function startPlugins(names) {
807
813
  *
808
814
  * @author Jelle De Loecker <jelle@develry.be>
809
815
  * @since 0.0.1
810
- * @version 1.1.0
816
+ * @version 1.2.2
811
817
  *
812
818
  * @param {String|Array} names
813
819
  * @param {Boolean} attempt_require
@@ -838,8 +844,13 @@ Alchemy.setMethod(function requirePlugin(names, attempt_require) {
838
844
  temp = alchemy.usePlugin(name);
839
845
 
840
846
  if (temp) {
841
- // Also start the plugin!
842
- alchemy.startPlugins(name);
847
+ let plugin_stage = alchemy.sputnik.get('plugins');
848
+
849
+ if (!plugin_stage || plugin_stage.started) {
850
+ // If the plugin stage has already started,
851
+ // manually start this plugin now
852
+ alchemy.startPlugins(name);
853
+ }
843
854
  continue;
844
855
  }
845
856
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "alchemymvc",
3
3
  "description": "MVC framework for Node.js",
4
- "version": "1.1.10",
4
+ "version": "1.2.2",
5
5
  "author": "Jelle De Loecker <jelle@elevenways.be>",
6
6
  "keywords": [
7
7
  "alchemy",
@@ -14,29 +14,29 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "ansi-256-colors" : "~1.1.0",
17
- "autoprefixer" : "~10.2.5",
17
+ "autoprefixer" : "~10.4.2",
18
18
  "bcrypt" : "~5.0.1",
19
19
  "body" : "~5.1.0",
20
- "body-parser" : "~1.19.0",
21
- "bson" : "~4.3.0",
22
- "chokidar" : "~3.5.1",
20
+ "body-parser" : "~1.19.2",
21
+ "bson" : "~4.6.1",
22
+ "chokidar" : "~3.5.3",
23
23
  "formidable" : "~1.2.2",
24
- "graceful-fs" : "~4.2.6",
25
- "hawkejs" : "~2.1.6",
24
+ "graceful-fs" : "~4.2.9",
25
+ "hawkejs" : "~2.2.8",
26
26
  "jsondiffpatch" : "~0.4.1",
27
- "mime" : "~2.5.2",
27
+ "mime" : "~3.0.0",
28
28
  "minimist" : "~1.2.5",
29
29
  "mkdirp" : "~1.0.4",
30
30
  "mmmagic" : "~0.5.3",
31
31
  "mongodb" : "~3.6.6",
32
32
  "ncp" : "~2.0.0",
33
- "postcss" : "~8.2.13",
34
- "protoblast" : "~0.7.10",
33
+ "postcss" : "~8.4.6",
34
+ "protoblast" : "~0.7.16",
35
35
  "semver" : "~7.3.5",
36
36
  "socket.io" : "~2.4.0",
37
37
  "@11ways/socket.io-stream" : "~0.9.2",
38
38
  "sputnik" : "~0.1.0",
39
- "terser" : "~5.7.0",
39
+ "terser" : "~5.10.0",
40
40
  "toobusy-js" : "~0.5.1",
41
41
  "useragent" : "~2.3.0"
42
42
  },
@@ -47,7 +47,7 @@
47
47
  "optionalDependencies": {
48
48
  "janeway" : "~0.3.5",
49
49
  "less" : "~4.1.1",
50
- "sass" : "~1.39.2",
50
+ "sass" : "~1.49.8",
51
51
  "nodent-compiler" : "~3.2.13",
52
52
  "socket.io-client" : "~2.4.0"
53
53
  },
package/CHANGELOG.md DELETED
@@ -1,462 +0,0 @@
1
- ## 1.1.10 (2022-01-11)
2
-
3
- * Fix socket.io issues
4
-
5
- ## 1.1.9 (2021-12-06)
6
-
7
- * Fix request files not being set correctly when using a nested form path (Backport)
8
-
9
- ## 1.1.8 (2021-09-12)
10
-
11
- * Add `conduit` getter to the Base class
12
- * Use Protoblast's temp file methods instead of `temp`
13
- * Add `/hawkejs/static.js` middleware
14
- * Use `sass` instead of the deprecated `node-sass`
15
- * Use Protoblast's slug method instead of mollusc
16
- * Add some more Directory & File methods
17
-
18
- ## 1.1.7 (2021-06-11)
19
-
20
- * Add `Alchemy.Criteria.FieldConfig#getDisplayValueIn(data)` method to get a simple string representation of a value
21
- * Check field class constructor in `Schema#addField()`
22
- * Allow RegExp values for String fields during a query
23
- * Requesting a route with the wrong method will now return a 405 error (Method Not Allowed) instead of a 404
24
- * Fix client `Model` classes not being able to perform a query when running on the server in loopback mode
25
- * Fix `time-ago` element refreshing every second when counting down to a date
26
- * Fix the `Loopback` conduit sometimes setting the wrong route method
27
-
28
- ## 1.1.6 (2021-04-29)
29
-
30
- * Switch from `uglify-es` to `terser` for minifying JavaScript files
31
- * Allow overriding any setting from the command line
32
- * Use `Branch` class for clearing model cache
33
-
34
- ## 1.1.5 (2021-01-21)
35
-
36
- * Fallback to the `ENV` environment variable to set the environment
37
- * Fix rendering of segments
38
- * Fix Loopback conduits not setting the correct data when only provided with a route name
39
- * Set the `Hawkejs.Renderer` language once we have a prefix
40
- * Automatically add the `hreflang` attribute to links created with the Router helper
41
- * Fix `Conduit#url` property having the wrong path set
42
- * Load `helper_datasource` and `helper_field` folders before main `helper` folder
43
- * Add `Alchemy#checksum(value)` method
44
- * Throw an error when a class instance is used as a criteria condition
45
- * Fix breadcrumbs for routes that contain objects
46
- * Apply active-link breadcrumb classes while creating the anchors
47
-
48
- ## 1.1.4 (2020-12-10)
49
-
50
- * Fix certain socket linkup packets not being json-dry encodes
51
- * Make `Alchemy#findImagePath()` return a promise
52
- * Make `FieldConfig` class more aware of paths
53
- * Fix `Validator#validateFieldValue()` throwing an error when a field contains multiple violations
54
- * Fix Schema fields not translating translatable fields
55
- * Fix `Validations` errors always having only max 1 field error
56
-
57
- ## 1.1.3 (2020-11-12)
58
-
59
- * Add `Schema#clone()` method
60
- * Add `Schema#field_count` property
61
- * Fix `Schema#addField()` throwing an error when adding a schema field on the browser side
62
- * Added `Criteria#page(page, page_size)`
63
- * `Conduit` classes have been moved into the `Conduit` namespace
64
- * `Conduit.Loopback` now correctly sets the method & body
65
- * Added `Criteria.FieldSet` and `Criteria.FieldConfig` classes
66
- * Object responses via `Conduit.Loopback#end()` will now first be cloned with the `toHawkejs` clone option
67
- * `Model#find()` will now reject when no `datasource` property is set
68
- * Add support for `fonts` asset folders
69
- * Add `CustomElement#getCurrentUrl()` method
70
-
71
- ## 1.1.2 (2020-10-08)
72
-
73
- * Fix Client class methods not being set on the server-side for classes defined in a plugin
74
- * Add `Criteria#isEmpty()` field check
75
- * Add `Linkup#demand()` method
76
- * Add `--socket` startup argument support
77
- * When the given socket path is a directory, create a socket in that directory with the current project name
78
- * Add `--url` startup argument, which will print the url in the console
79
- * Add `--preload` startup argument, which will load the homepage & the client file on startup
80
- * Allow opening redirects in a popup window
81
-
82
- ## 1.1.1 (2020-07-24)
83
-
84
- * Add `Base.mapEventToMethod()` to register simple emitted events names to methods per class
85
- * Add `Base#issueEvent(name, args, callback)` which will use the mapped event-to-method map to execute the method first & then emit the events
86
- * Implement the new event-and-method flow in Controller & Models
87
- * Already set the Hawkejs Renderer `is_for_client_side` property before calling the middleware
88
- * All the properties of the `parameters` property will be used in the Router directive
89
-
90
- ## 1.1.0 (2020-07-21)
91
-
92
- * Add `Schema#getDatasource()` which returns a pledge that resolves to the datasource
93
- * `Alchemy#requirePlugin(name, attempt)` will now attempt to load the plugin if it hasn't been done yet
94
- * Add `Criteria` class, which replaces the messy `DbQuery` class and is a query builder to boot.
95
- * The `Datasource` & `Field` class is now also available on the client side
96
- * Typedefs in routes can now contain fields, like `/{[Model._id]custom_id_name}/`
97
- * Add `Models#load_external_schema` boolean property
98
- * Add `second_format` option to Date & Datetime fields, allowing you to save Date as a timestamp
99
- * Add `Datasource#allows(name)` to see if read/create/remove/update is allowed
100
- * Add `Inode` namespace & `File` & `Directory` classes, as our way of dealing with files
101
- * Also set the `method` property on the client-side `Conduit` instance
102
- * Replace `Document.$main` object with save result
103
- * Add `Model#findByValues` and `Model#findAllByValues`
104
- * Add `Router#serveDependencyFile()` for when you want to serve a file from within a dependency
105
- * Decode path parameters using `RURL.decodeUriSegment()`
106
- * Add `$hold` property to Document class, which are also sent to the client
107
- * `Conduit#redirect()` now has a `hard_refresh` option, to force a non-ajax redirection
108
- * `DocumentList` can now be iterated over
109
- * Removing the cached client file will no longer cause 404 errors
110
- * Conduit responses can now be ended with a buffer
111
- * Sessions will emit the `removed` event when they're being removed
112
- * Websocket messages will no longer be resent upon reconnect
113
- * Add `populate` method to `DocumentList`
114
- * When adding an association to a model, an index will automatically be made
115
- * Uploaded files now use Alchemy's `Inode.File` class
116
- * The `Criteria` class can now be asynchronously iterated over
117
- * The `Fallback` datasource will now use the `read` method instead of `_read`
118
- * Add `Schema.isSchema()` method
119
- * `Enum` values will now also be serialized for the client-side config
120
- * The `Router` helper directive will now look for a `url_attribute` property on the target element
121
- * Add custom Error classes under the Classes.Alchemy.Error namespace
122
- * Re-added validation support with the `Validator` & `Violation` classes
123
- * Use `Blast.fetch()` in the `Alchemy#request()` method
124
- * Rename `Model#findById()` to `Model#findByPk()`
125
- * Add `Document#refreshValues()` to re-query the data from the database
126
- * Allow individual associations to be resolved by the datasource itself
127
- * Throw an error when trying to set a Document's data record to an invalid value
128
- * Fix getting the path of fields in a subschema
129
- * Add `Schema#getFieldChain(path)` and `Field#getFieldChain()`
130
- * Add `FieldValue` class and use it for the new `Field#getDocumentValues(document)` method
131
- * Add `Alchemy#getPrefixes()` to get the prefixes object on the server & client
132
- * The `Alchemy#pickTranslation()` method now also accepts a conduit as prefix choices
133
- * Add source-map support
134
-
135
- ## 1.0.8 (2019-01-12)
136
-
137
- * Fix for package.json dependency version error
138
-
139
- ## 1.0.7 (2019-01-12)
140
-
141
- * Setting `prefer: "client"` and `layout` property on a Route will let the client render the action once the base layout is loaded
142
- * Add default `Conduit#notAuthorized()` and `Conduit#forbidden()` method
143
- * Add support for some basic `policy` property on a Route
144
- * Make the `Scene#interceptOpenUrl` method set the internal `breadcrumb` variable
145
- * Add appcache support
146
- * The `offline_clients` setting needs to be truthy in order to send an appcache manifest
147
- * Fix `Schema#getField()` not looking in the subschema of a SchemaFieldType
148
- * Fix `Model#find('count')` returning wrong value when result is 0
149
- * Add `Alchemy#getMedHash()` function to get a simple, non-verification hash of a file
150
- * The `Conduit#body` property can now be overwritten
151
- * Allow json-dry data from logged-in users during a readDataSource request
152
- * Add `FieldType#datasource` property
153
- * Add `Datasource.setSupport(name, value)` and `Datasource.supports(name)`
154
- * Use `Datasource.supports('objectid')` to see if it understands ObjectID instances
155
- * Add `Alchemy#statPath(path, options)` function
156
- * Allow `Model.addField()` to override already existing fields
157
- * Add pledge support to `Alchemy#openUrl()`
158
- * `Alchemy#findPathToBinarySync()` will now also look in the `/bin/` directory
159
- * Deprecate `Alchemy#List()`
160
- * Add more unit tests
161
-
162
- ## 1.0.6 (2018-12-06)
163
-
164
- * Add `Document#is_new_record` property
165
- * Fix `Document#[Symbol(alike)]` method
166
- * Fix bug in SluggableBehaviour always assuming an existing record will be found
167
- * Work around adding document methods before parent model is ready
168
- * Make client-side Document classes inherit from correct parent
169
- * Allow querying for extraneous, out-of-schema fields by passing the `extraneous` option
170
- * Fix renderings of client-side Controller actions
171
- * Use aggregate `sortByPath` in client-side IndexedDB search
172
- * Add `Alchemy.Client.Document.getClassForUndry()` method
173
- * `Model#saveRecord()` will now throw an error when a regular object is passed instead of a Document instance
174
- * Add HTML field type
175
- * Convert raw datasource data back to app-readable data after a create or update
176
- * Add `Document#getLocalVersion()` and `Document#getLocalVersionIfNewer()` for in the browser
177
- * Convert document data using `toServerSaveRecord` method before sending to server
178
- * Set a reference to the current controller on the `conduit` instance
179
-
180
- ## 1.0.5 (2018-10-18)
181
-
182
- * Submitting data over a socket will now also be JSON-DRY'd
183
- * Allow the server to use the client-side only controller if no server-side controller is found
184
- * Add validator classes
185
- * Add `Document.isDocument(obj)` static method
186
- * Make the save methods use a `Document` instance instead of a simple object
187
- * Add `Alchemy#findPathToBinarySync()` for finding a path to a binary
188
- * Fix copying & moving files on mac os
189
- * `Schema#addAssociation()` will no longer add a localKey if it already exists
190
- * Allow passing options to `Document#addAssociatedData()` and make it return a pledge
191
- * Also clear the client-side model cache when clearing the server-side class cache
192
- * Add export/import functionality
193
- * Clone object with `toHawkejs` method before stringifying when calling `Conduit#end()`
194
- * Add `undefined` "from" property to postcss options to prevent annoying warning
195
-
196
- ## 1.0.4 (2018-08-27)
197
-
198
- * Don't create a `db` instance when the MongoDatasource fails to connect
199
- * Add `Document#$attributes` property, where non-database values can be stored in
200
- * Add `Document#hasChanged(name)` method, to check if values have changed
201
- * Add `Document#resetFields()` to reset a document to its initial state
202
- * Fix SluggableBehaviour
203
- * Add `Document#needsToBeSaved()`
204
- * Make `Document#hasChanged()` detect changes in object values
205
- * Don't pass undefined `version` argument to `indexedDB.open()`
206
- * Add `Document#[Blast.alikeSymbol]` method to check for likeness
207
- * Add `Conduit#supports(feature)` to check for supported features (only async/await for now)
208
- * Add `nodent-compiler` optional dependency for compiling async/await code for IE11
209
- * The `PATH_ROOT` constant can now take its value from an environment variable
210
- * Make `loadHelpers` recursively load in a directory of helpers
211
- * Add `Alchemy#isObjectId(obj)` to see if a string or object is an object id
212
- * `Model#findById(id)` will throw an error when an invalid object id is given
213
- * Document constructor code is now moved to `setDataRecord` method, so it can be shared with the client-side instance
214
- * Add default `saveRecord` action to the Controller class, for client-side record saving
215
- * Add `getModel()` method to the custom Element class
216
- * Fix Paginate component interpreting empty filters as a regex
217
- * Fix Paginate filter inputs not showing the filtered value
218
- * Add `filtering` and `sorting` boolean property to `Pagination#getConfig()` method result
219
- * Check if manual slug values are actually valid
220
- * Add `time-ago` custom HTML element
221
-
222
- ## 1.0.3 (2018-07-12)
223
-
224
- * Update alchemy info page
225
- * `Schema#addField(name, type, options)` now allows you to directly pass a `Schema` instance as a type
226
- * Fix `DocumentList#findNextBatch` looking for the `_options` property, when it should be `options`
227
- * Also pass the `model` instance when creating a new `DocumentList` instance
228
- * Fix `Document#remove` not finding the $model property
229
- * `DocumentList` instances can now be created without any arguments
230
- * Add `DocumentList#toSimpleArray()` which returns an array of simple objects with only the wanted fields
231
- * Add `DocumentList.unDry` static method to the server-side class, because static methods don't get added by default yet
232
- * Fix `Document#conduit` causing an infinite loop
233
- * Change `Model.cacheDuration` to `Model.cache_duration`
234
- * Make `Model#save()` and `Model#findById()` also return Pledges
235
- * Make `Model#remove()`, `Document#remove()`, `Model#ensureIds()` return Pledges
236
- * Make MongoDataSource use `findOneAndDelete` to remove a record
237
- * Switched from `slug` dependency to `mollusc`, which is a fork with several fixes
238
- * When the `port` setting is `null`, a random port will be tried. All other falsy values will still not start the server.
239
- * `Alchemy#usePlugin(name, options)` now accepts a `path_to_plugin` option
240
- * `Alchemy#usePath()` will no longer load `test` folders
241
- * Fix paths equaling a prefix not working as you expect them to
242
- * Don't start socket.io when `settings.websockets` is false
243
- * Fix `Alchemy#broadcast(type, data)` not working
244
- * Add `Model#getBehaviour(name)`, which gets an existing instance on the current model
245
- * Add `Document#revert(revisions)` to revert to an earlier version of the document
246
-
247
- ## 1.0.2 (2018-07-07)
248
-
249
- * Fix `DocumentList#available` always defaulting to the length of the current set
250
- * Correctly parse `x-forwarded-for` in case there are multiple ip addresses
251
-
252
- ## 1.0.1 (2018-07-04)
253
-
254
- * Fix `mongodb` dependency version
255
-
256
- ## 1.0.0 (2018-07-04)
257
-
258
- * Split up old `Document` into `DocumentList` and `Document` class
259
- * Add client-side `Document`, `Model` and `DocumentList` classes
260
- * Class-specific `title` and `type_name` properties are now statics instead of protos
261
- * Add simple HTTP `HEAD` method support
262
- * `DbQuery` is now also available on the client side
263
- * Added query matching code from nedb to `DbQuery`
264
- * Removed nedb dependency
265
- * Model & Controller are now their own namespace
266
- * Added a Base class for the Client side + client conduit & controller
267
- * Custom elements should inherit from `Alchemy.Element` from now on
268
- * Add `Base#getClientPath` and `Base#getClientPathAfter`
269
- * Add `Conduit#chooseBestLocale(locales)` in order to get the best locale for the connection
270
- * Also check `data-breadcrumbs` when activating links
271
- * Starting the server with `--debug-requirements` will print info about which files are loaded using `alchemy.use`
272
-
273
- ## 0.5.0 (2018-01-05)
274
-
275
- * Wait for `Blast` to load before starting the `startServer` stage
276
- * `usePath` will now always first load in files and THEN directories
277
- * Renamed the `Alchemy.Command` class to `Alchemy.Task`
278
- * Added `applyButton` to `Pagination` helper
279
- * You can now set multiple `Pagination` filters
280
- * Helpers are now under the Hawkejs namespace
281
- * Added `Model#eachRecord(options, task, callback)`, which returns a `Pledge`
282
- * Setting `store_units` option on a Date field will store its unit info along with it
283
- * Parse useragents using the `useragent#lookup` method, which caches strings
284
- * Calls to `Conduit#error` will now also be emitted as a `conduit_error` event on the main `alchemy` instance
285
- * A `Route`'s options will now be stored in the `options` property
286
- * `Route#generateUrl` can now also accept a regular options object instead of a `Conduit`
287
- * Don't use `let` in the `Alchemy.Base` class, since it's also used in the browser
288
- * If a minified cached asset (stylesheet or script) gets deleted, re-minify it instead of blocking the request
289
- * The session store is now stored under `alchemy.sessions`
290
- * Request URLs ending with only a prefix, and no slash, will now also work
291
- * `Route#match` will now use `decodeURIComponent` when extracting url parameters
292
- * The helper `Router#printRoute` can now be used to only print an opening anchor when used in combination with `Router#closeRoute`
293
- * Added `PostCSS` and `autoprefixer` package
294
- * `Alchemy#pickTranslation` will give correct results when given prefix is falsy
295
- * The `StringFieldType` will now pick a translation in case the database value was an object
296
- * Add "segments", view blocks that have a specific route
297
- * Make `Model.find` return a `Pledge`
298
- * Mark the `Model` class as being an abstract class
299
- * Add UglifyJS global_defs for `Blast.isNode` and `Blast.isBrowser`
300
-
301
- ## 0.4.3 (2017-09-07)
302
-
303
- * Fix: don't set gutter on `Janeway#print` output when Janeway is not active
304
- * Fix: Client-side `Alchemy#switchLanguage` will now work when there are get queries
305
- * Add `use_found_prefix` to model search options. This used to be hard-coded yes, but now it is false by default
306
- * Calculate etag using `Object.checksum`, as fowler has too many collisions
307
- * Set the current active prefix using `internal` and `expose` as 'active_prefix' (`Conduit#prefix` will not be set, because that is only used when it's in the path!)
308
- * If header `x-alchemy-default-prefix` is set, use that as *default* prefix. This differs from `x-alchemy-prefix`, as that is a hard override.
309
- * Fix `useragent` not having the `satisfies` method
310
- * Fix `socket.io.js` not being served
311
- * Only create a dgram socket when it is needed
312
- * `getResource` of the `Alchemy` helper will now always add the data object as the second argument (it used to do 2 different things on loopback or client)
313
- * Upgrade `protoblast` dependency to 0.3.10
314
-
315
- ## 0.4.2 (2017-08-27)
316
-
317
- * Remove quotes from `content-type`'s UTF-8
318
- * Add `Controller#safeSet`, which uses `encodeHTML` to set strings
319
- * The session cookie has `httpOnly` enabled
320
- * Add `Conduit#is_secure` property
321
- * Enable the `secure` option by default when setting a cookie on a secure connection
322
- * Fix path traversal security bug in `findAssetPath`
323
- * The `scene_start_` cookie will only live for 15s in stead of 10 minutes
324
-
325
- ## 0.4.1 (2017-08-11)
326
-
327
- * Setting `sort` to false will now actually disable sorting
328
- * Fallback translations `__` will now be picked
329
- * Send hawkejs templates using regular JSON, not JSON-dry
330
- * Fix urls not being generated properly when using prefixes
331
- * Add `Controller#renderDialogIn` so dialogs can be rendered from the server side, too
332
- * Let the Mongo datasource retry to reconnect a near infinite amount of times
333
- * `Alchemy#downloadFile` now uses `Blast#fetch`
334
- * Alchemy will now exit when the parent process does
335
- * Add languageSwitcher
336
- * Number fields with value null won't be cast to 0 anymore
337
- * `Conduit#redirect` now uses temporary (301) redirects by default
338
- * Disabling a find's `recursive` will now also apply to a subschema
339
- * Hidden files (starting with ".") or the "empty" file will no longer be loaded
340
- * You can now set parameters using `Conduit#param(name, value)`
341
- * `Conduit#param(name)` will now also look in the cookies
342
- * Add support for `assume_https` config and `x-forwarded-proto` header
343
- * Alchemy won't listen to multicast address by default
344
-
345
- ## 0.4.0 (2017-04-17)
346
-
347
- * Fixed router issue in the Alchemy helper
348
- * `PATH_*` globals are now constants
349
- * Removed `APP_ROOT`, `PATH_APP` has been available for years
350
- * The version of your app and alchemy itself are added to `process.versions`
351
- * The global `alchemy` object is now an instance of the `Alchemy` class
352
- * Added `Alchemy#makeNextRequireStrict()` which adds `use strict` to the next required module
353
- * Fixed adding indexes to nested fields
354
- * Automatically add 2dsphere index to Geopoint fields
355
- * Added `qs` dependency so nested GET parameters can be decoded properly
356
- * Add cache method to client-side `alchemy#fetch` method
357
- * A model's Document class will now inherit from that model's parent's document class
358
- * Self-referencing Schema fields are no longer queried for now, this causes deadlocks to occur
359
- * Add `alchemy.__` to client-side javascript
360
- * Also emit the full linkup packets as a 'linkup_packet' event
361
- * Base class fixes
362
- * Add hawkejs multiple-template serving middleware
363
-
364
- ## 0.3.3 (2017-01-21)
365
-
366
- * Fix $or grouping during normalization of `Query` conditions
367
- * Further split up the `Conduit` class
368
- * Fix some `Resource` issues in the alchemy helper
369
- * Add a `Document#toArray()` method
370
- * Put non-translated, orphaned, strings in a '__' prefix when fetched from server
371
- * Optimize `Model#ensureIds`
372
- * Add router section identifiers (for in selects, ...)
373
- * Add `conduit` property getter to `Document`
374
- * Fix new cookies being ignored on a redirect
375
- * Set option `set_updated` to false during saving so the `updated` field won't be changed
376
- * Add `of_group_name` static property to classes
377
- * Add `count` as find option
378
- * Add `Model#beforeSave` callback support
379
- * Pass query options to `Document`
380
- * Set `x-history-url` on internal redirect (and expose to hawkejs)
381
- * Change cache-control to cache for max 1 hour (in stead of 1 year)
382
- * Add options to the `Document#save` method
383
- * Find next batch of limited find results using `Document#findNextBatch`
384
- * No longer die when trying to use a "priviliged" port
385
- * Upgrade protoblast to version 0.4.0
386
- * Upgrade hawkejs to version 1.1.2
387
-
388
- ## 0.3.2 (2016-10-19)
389
-
390
- * Forgot to upgrade the Janeway package
391
-
392
- ## 0.3.1 (2016-10-19)
393
-
394
- * Upgraded NPM packages
395
- * Set terminal title using Janeway
396
- * Fixed inheritance issues
397
- * Janeway can now also be disabled by setting the DISABLE_JANEWAY env to 1
398
- * Setting `alchemy.settings.silent` to true will disable the custom `log` calls
399
-
400
- ## 0.3.0 (2016-10-04)
401
-
402
- * Added Base class in Alchemy namespace
403
- * `alchemy.classes` has been removed in favor of `Classes`
404
- * Added Command class
405
- * Associated record data will now also be saved
406
- * Sluggable behaviour has been fixed
407
- * Add `file_path` property to `useOnce` require errors
408
- * Bugfixes in the Router helper
409
- * Allow registering modules as null
410
- * Load mmmagic on-the-fly, don't preload bcrypt and chokidar
411
- * Add `alchemy.broadcast` which broadcasts to every connected websocket scene
412
-
413
- ## 0.2.2 (2016-07-02)
414
-
415
- * Update socket.io dependencies, fixing reconnection issues
416
- * Added `log.once(id, ...)` to log a specific message only once
417
- * Added `log.less(id, ...)` to log messages only once per second
418
- * Added `log.setLessConfig` if you want to set specific limit for log.less
419
-
420
- ## 0.2.1 (2016-06-27)
421
-
422
- * ClientSocket now has an `offset` and `latency` property plus `now()` timestamp method
423
- * SocketConduit now has an `ip` property
424
- * `ModelDocument` now has an `init` method that gets called on creation
425
-
426
- ## 0.2.0 (2016-06-26)
427
-
428
- * Switched to Hawkejs v1.0.0
429
- * Removed cruft (continuation, ...)
430
- * Removed old Nuclei-way of defining classes
431
- * Added new classes:
432
- - Conduit
433
- - Schema
434
- - Router
435
- - Route
436
- - FieldType
437
- - Datasource
438
-
439
- ## 0.1.0 (2014-09-10)
440
-
441
- * Remove mongoose & MongoDB eval code (still need to add validation support)
442
- * Added sluggable behaviour
443
- * Added Object.isEmpty method
444
- * Array.cast converts array-like objects to regular arrays (but not Strings),
445
- if the variable is undefined an empty array is returned
446
- * Add 'score' method to String prototype, to determine how similar strings are
447
- * Add 'alchemy.after' method, which will do something after the given event has
448
- been emitted, even if it has been emitted in the past
449
- * Add hasValue and getValueKey to Object, also works on arrays
450
- * When saving data you can pass the 'allowedIndexes' option, which should be an
451
- array of indexes allowed to be looked through for existing records.
452
- If it's an empty array, only the _id will be used. If it's false, every index
453
- is used.
454
- * Add 'divide' method to Object, which creates a new array where every key-value
455
- pair is a new object
456
- * Spin off prototype & inflections to new module: protoblast
457
- * Added publishable behaviour
458
-
459
- ## 0.0.1 (2014-04-04)
460
-
461
- * Finalise version 0.0.1 after a year of initial development,
462
- now we can start removing mongoose.