ember-data-source 2.6.0 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87dc83773f54ab8d2e6dca3aca880c6522fe8407
4
- data.tar.gz: 581a80a7da6f1bb940218c699fcee0ff6992cdb2
3
+ metadata.gz: 4a8a05d27f255d74f8d687eae0927d6b27c7c4b8
4
+ data.tar.gz: 20a399f4c80fdd5ce64955d49e4f233e415def63
5
5
  SHA512:
6
- metadata.gz: d8bfdaf61eb1ebfeaa2c4adfcc72a1ebe76697da0b3011937887ef8154f1559d1be0fbb34a5a6faf1ad69bdae7da3a569785123e0ee6f6a8d839463eade5cc94
7
- data.tar.gz: e7e6640158b7c8f1b17e301ad76d8fe4dce82afa08fdc0aac436b10cb1698667b04e14606e6eaca6dbe77479dc2ca36c5e64df66e801b69bb731c871bd7a87d4
6
+ metadata.gz: ad7afdd6ea7077b76e818d02c9b36265e0b99f27903cb15ee2c9a93a48af643adc2ca331f98c51f4f80bc44b9200aec4078d3976b9bbcd0838895ed49d524846
7
+ data.tar.gz: 8200b91e6088c639e2f392a370714260e920fa7ae339c100cbc701d2575abaf54b4341636d8bf5126209f6869668a541d98d3fd735423dbb8aadefc08784c3cf
@@ -6,7 +6,7 @@
6
6
  * @copyright Copyright 2011-2016 Tilde Inc. and contributors.
7
7
  * Portions Copyright 2011 LivingSocial Inc.
8
8
  * @license Licensed under MIT license (see license.js)
9
- * @version 2.6.0
9
+ * @version 2.6.1
10
10
  */
11
11
 
12
12
  var loader, define, requireModule, require, requirejs;
@@ -25,7 +25,14 @@ var loader, define, requireModule, require, requirejs;
25
25
 
26
26
  requirejs = require = requireModule = function(name) {
27
27
  stats.require++;
28
- return findModule(name, '(require)').module.exports;
28
+ var pending = [];
29
+ var mod = findModule(name, '(require)', pending);
30
+
31
+ for (var i = pending.length - 1; i >= 0; i--) {
32
+ pending[i].exports();
33
+ }
34
+
35
+ return mod.module.exports;
29
36
  };
30
37
 
31
38
  function resetStats() {
@@ -33,10 +40,9 @@ var loader, define, requireModule, require, requirejs;
33
40
  define: 0,
34
41
  require: 0,
35
42
  reify: 0,
36
- build: 0,
43
+ findDeps: 0,
37
44
  modules: 0,
38
45
  exports: 0,
39
- ensureBuild: 0,
40
46
  resolve: 0,
41
47
  resolveRelative: 0,
42
48
  findModule: 0,
@@ -75,8 +81,6 @@ var loader, define, requireModule, require, requirejs;
75
81
 
76
82
  var registry = {};
77
83
  var seen = {};
78
- var FAILED = false;
79
- var LOADED = true;
80
84
 
81
85
  var uuid = 0;
82
86
 
@@ -94,11 +98,11 @@ var loader, define, requireModule, require, requirejs;
94
98
  this.deps = !deps.length && callback.length ? defaultDeps : deps;
95
99
  this.module = { exports: {} };
96
100
  this.callback = callback;
97
- this.state = undefined;
98
101
  this.finalized = false;
99
102
  this.hasExportsAsDep = false;
100
103
  this.isAlias = alias;
101
104
  this.reified = new Array(deps.length);
105
+ this._foundDeps = false;
102
106
  }
103
107
 
104
108
  Module.prototype.makeDefaultExport = function() {
@@ -111,46 +115,63 @@ var loader, define, requireModule, require, requirejs;
111
115
  };
112
116
 
113
117
  Module.prototype.exports = function() {
114
- stats.exports ++;
115
- if (this.finalized) {
116
- return this.module.exports;
117
- } else {
118
- if (loader.wrapModules) {
119
- this.callback = loader.wrapModules(this.name, this.callback);
120
- }
121
- var result = this.callback.apply(this, this.reified);
122
- if (!(this.hasExportsAsDep && result === undefined)) {
123
- this.module.exports = result;
124
- }
125
- this.makeDefaultExport();
126
- this.finalized = true;
127
- return this.module.exports;
118
+ if (this.finalized) { return this.module.exports; }
119
+ stats.exports++;
120
+
121
+ this.finalized = true;
122
+
123
+ if (loader.wrapModules) {
124
+ this.callback = loader.wrapModules(this.name, this.callback);
125
+ }
126
+
127
+ this.reify();
128
+
129
+ var result = this.callback.apply(this, this.reified);
130
+
131
+ if (!(this.hasExportsAsDep && result === undefined)) {
132
+ this.module.exports = result;
128
133
  }
134
+ this.makeDefaultExport();
135
+ return this.module.exports;
129
136
  };
130
137
 
131
138
  Module.prototype.unsee = function() {
132
139
  this.finalized = false;
133
- this.state = undefined;
140
+ this._foundDeps = false;
134
141
  this.module = { exports: {}};
135
142
  };
136
143
 
137
144
  Module.prototype.reify = function() {
138
145
  stats.reify++;
139
- var deps = this.deps;
140
- var dep;
141
146
  var reified = this.reified;
147
+ for (var i = 0; i < reified.length; i++) {
148
+ var mod = reified[i];
149
+ reified[i] = mod.exports ? mod.exports : mod.module.exports();
150
+ }
151
+ };
152
+
153
+ Module.prototype.findDeps = function(pending) {
154
+ if (this._foundDeps) {
155
+ return;
156
+ }
157
+
158
+ stats.findDeps++;
159
+ this._foundDeps = true;
160
+
161
+ var deps = this.deps;
142
162
 
143
163
  for (var i = 0; i < deps.length; i++) {
144
- dep = deps[i];
164
+ var dep = deps[i];
165
+ var entry = this.reified[i] = { exports: undefined, module: undefined };
145
166
  if (dep === 'exports') {
146
167
  this.hasExportsAsDep = true;
147
- reified[i] = this.module.exports;
168
+ entry.exports = this.module.exports;
148
169
  } else if (dep === 'require') {
149
- reified[i] = this.makeRequire();
170
+ entry.exports = this.makeRequire();
150
171
  } else if (dep === 'module') {
151
- reified[i] = this.module;
172
+ entry.exports = this.module;
152
173
  } else {
153
- reified[i] = findModule(resolve(dep, this.name), this.name).module.exports;
174
+ entry.module = findModule(resolve(dep, this.name), this.name, pending);
154
175
  }
155
176
  }
156
177
  };
@@ -167,16 +188,6 @@ var loader, define, requireModule, require, requirejs;
167
188
  return r;
168
189
  };
169
190
 
170
- Module.prototype.build = function() {
171
- stats.ensureBuild++;
172
- if (this.state === FAILED || this.state === LOADED) { return; }
173
- stats.build++;
174
- this.state = FAILED;
175
- this.reify()
176
- this.exports();
177
- this.state = LOADED;
178
- };
179
-
180
191
  define = function(name, deps, callback) {
181
192
  stats.define++;
182
193
  if (arguments.length < 2) {
@@ -212,7 +223,7 @@ var loader, define, requireModule, require, requirejs;
212
223
  throw new Error('Could not find module `' + name + '` imported from `' + referrer + '`');
213
224
  }
214
225
 
215
- function findModule(name, referrer) {
226
+ function findModule(name, referrer, pending) {
216
227
  stats.findModule++;
217
228
  var mod = registry[name] || registry[name + '/index'];
218
229
 
@@ -222,7 +233,10 @@ var loader, define, requireModule, require, requirejs;
222
233
 
223
234
  if (!mod) { missingModule(name, referrer); }
224
235
 
225
- mod.build();
236
+ if (pending) {
237
+ mod.findDeps(pending);
238
+ pending.push(mod);
239
+ }
226
240
  return mod;
227
241
  }
228
242
 
@@ -258,7 +272,7 @@ var loader, define, requireModule, require, requirejs;
258
272
  requirejs.entries = requirejs._eak_seen = registry;
259
273
  requirejs.has = has;
260
274
  requirejs.unsee = function(moduleName) {
261
- findModule(moduleName, '(unsee)').unsee();
275
+ findModule(moduleName, '(unsee)', false).unsee();
262
276
  };
263
277
 
264
278
  requirejs.clear = function() {
@@ -2919,23 +2933,26 @@ define("ember-data/-private/system/model/internal-model", ["exports", "ember", "
2919
2933
  }
2920
2934
  };
2921
2935
 
2922
- InternalModel.prototype.referenceFor = function (type, name) {
2923
- var reference = this.references[name];
2936
+ if (true) {
2924
2937
 
2925
- if (!reference) {
2926
- var relationship = this._relationships.get(name);
2938
+ InternalModel.prototype.referenceFor = function (type, name) {
2939
+ var reference = this.references[name];
2927
2940
 
2928
- if (type === "belongsTo") {
2929
- reference = new _emberDataPrivateSystemReferences.BelongsToReference(this.store, this, relationship);
2930
- } else if (type === "hasMany") {
2931
- reference = new _emberDataPrivateSystemReferences.HasManyReference(this.store, this, relationship);
2932
- }
2941
+ if (!reference) {
2942
+ var relationship = this._relationships.get(name);
2933
2943
 
2934
- this.references[name] = reference;
2935
- }
2944
+ if (type === "belongsTo") {
2945
+ reference = new _emberDataPrivateSystemReferences.BelongsToReference(this.store, this, relationship);
2946
+ } else if (type === "hasMany") {
2947
+ reference = new _emberDataPrivateSystemReferences.HasManyReference(this.store, this, relationship);
2948
+ }
2936
2949
 
2937
- return reference;
2938
- };
2950
+ this.references[name] = reference;
2951
+ }
2952
+
2953
+ return reference;
2954
+ };
2955
+ }
2939
2956
  });
2940
2957
  define("ember-data/-private/system/model/model", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/system/promise-proxies", "ember-data/-private/system/model/errors", "ember-data/-private/features", "ember-data/-private/system/debug/debug-info", "ember-data/-private/system/relationships/belongs-to", "ember-data/-private/system/relationships/has-many", "ember-data/-private/system/relationships/ext", "ember-data/-private/system/model/attr"], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateSystemPromiseProxies, _emberDataPrivateSystemModelErrors, _emberDataPrivateFeatures, _emberDataPrivateSystemDebugDebugInfo, _emberDataPrivateSystemRelationshipsBelongsTo, _emberDataPrivateSystemRelationshipsHasMany, _emberDataPrivateSystemRelationshipsExt, _emberDataPrivateSystemModelAttr) {
2941
2958
 
@@ -3706,105 +3723,108 @@ define("ember-data/-private/system/model/model", ["exports", "ember", "ember-dat
3706
3723
  });
3707
3724
  }
3708
3725
 
3709
- Model.reopen({
3726
+ if (true) {
3710
3727
 
3711
- /**
3712
- Get the reference for the specified belongsTo relationship.
3713
- Example
3714
- ```javascript
3715
- // models/blog.js
3716
- export default DS.Model.extend({
3717
- user: DS.belongsTo({ async: true })
3718
- });
3719
- var blog = store.push({
3720
- type: 'blog',
3721
- id: 1,
3722
- relationships: {
3723
- user: { type: 'user', id: 1 }
3724
- }
3725
- });
3726
- var userRef = blog.belongsTo('user');
3727
- // check if the user relationship is loaded
3728
- var isLoaded = userRef.value() !== null;
3729
- // get the record of the reference (null if not yet available)
3730
- var user = userRef.value();
3731
- // get the identifier of the reference
3732
- if (userRef.remoteType() === "id") {
3733
- var id = userRef.id();
3734
- } else if (userRef.remoteType() === "link") {
3735
- var link = userRef.link();
3736
- }
3737
- // load user (via store.findRecord or store.findBelongsTo)
3738
- userRef.load().then(...)
3739
- // or trigger a reload
3740
- userRef.reload().then(...)
3741
- // provide data for reference
3742
- userRef.push({
3743
- type: 'user',
3744
- id: 1,
3745
- attributes: {
3746
- username: "@user"
3728
+ Model.reopen({
3729
+
3730
+ /**
3731
+ Get the reference for the specified belongsTo relationship.
3732
+ Example
3733
+ ```javascript
3734
+ // models/blog.js
3735
+ export default DS.Model.extend({
3736
+ user: DS.belongsTo({ async: true })
3737
+ });
3738
+ var blog = store.push({
3739
+ type: 'blog',
3740
+ id: 1,
3741
+ relationships: {
3742
+ user: { type: 'user', id: 1 }
3743
+ }
3744
+ });
3745
+ var userRef = blog.belongsTo('user');
3746
+ // check if the user relationship is loaded
3747
+ var isLoaded = userRef.value() !== null;
3748
+ // get the record of the reference (null if not yet available)
3749
+ var user = userRef.value();
3750
+ // get the identifier of the reference
3751
+ if (userRef.remoteType() === "id") {
3752
+ var id = userRef.id();
3753
+ } else if (userRef.remoteType() === "link") {
3754
+ var link = userRef.link();
3747
3755
  }
3748
- }).then(function(user) {
3749
- userRef.value() === user;
3750
- });
3751
- ```
3752
- @method belongsTo
3753
- @param {String} name of the relationship
3754
- @return {BelongsToReference} reference for this relationship
3755
- */
3756
- belongsTo: function (name) {
3757
- return this._internalModel.referenceFor('belongsTo', name);
3758
- },
3756
+ // load user (via store.findRecord or store.findBelongsTo)
3757
+ userRef.load().then(...)
3758
+ // or trigger a reload
3759
+ userRef.reload().then(...)
3760
+ // provide data for reference
3761
+ userRef.push({
3762
+ type: 'user',
3763
+ id: 1,
3764
+ attributes: {
3765
+ username: "@user"
3766
+ }
3767
+ }).then(function(user) {
3768
+ userRef.value() === user;
3769
+ });
3770
+ ```
3771
+ @method belongsTo
3772
+ @param {String} name of the relationship
3773
+ @return {BelongsToReference} reference for this relationship
3774
+ */
3775
+ belongsTo: function (name) {
3776
+ return this._internalModel.referenceFor('belongsTo', name);
3777
+ },
3759
3778
 
3760
- /**
3761
- Get the reference for the specified hasMany relationship.
3762
- Example
3763
- ```javascript
3764
- // models/blog.js
3765
- export default DS.Model.extend({
3766
- comments: DS.hasMany({ async: true })
3767
- });
3768
- var blog = store.push({
3769
- type: 'blog',
3770
- id: 1,
3771
- relationships: {
3772
- comments: {
3773
- data: [
3774
- { type: 'comment', id: 1 },
3775
- { type: 'comment', id: 2 }
3776
- ]
3779
+ /**
3780
+ Get the reference for the specified hasMany relationship.
3781
+ Example
3782
+ ```javascript
3783
+ // models/blog.js
3784
+ export default DS.Model.extend({
3785
+ comments: DS.hasMany({ async: true })
3786
+ });
3787
+ var blog = store.push({
3788
+ type: 'blog',
3789
+ id: 1,
3790
+ relationships: {
3791
+ comments: {
3792
+ data: [
3793
+ { type: 'comment', id: 1 },
3794
+ { type: 'comment', id: 2 }
3795
+ ]
3796
+ }
3777
3797
  }
3798
+ });
3799
+ var commentsRef = blog.hasMany('comments');
3800
+ // check if the comments are loaded already
3801
+ var isLoaded = commentsRef.value() !== null;
3802
+ // get the records of the reference (null if not yet available)
3803
+ var comments = commentsRef.value();
3804
+ // get the identifier of the reference
3805
+ if (commentsRef.remoteType() === "ids") {
3806
+ var ids = commentsRef.ids();
3807
+ } else if (commentsRef.remoteType() === "link") {
3808
+ var link = commentsRef.link();
3778
3809
  }
3779
- });
3780
- var commentsRef = blog.hasMany('comments');
3781
- // check if the comments are loaded already
3782
- var isLoaded = commentsRef.value() !== null;
3783
- // get the records of the reference (null if not yet available)
3784
- var comments = commentsRef.value();
3785
- // get the identifier of the reference
3786
- if (commentsRef.remoteType() === "ids") {
3787
- var ids = commentsRef.ids();
3788
- } else if (commentsRef.remoteType() === "link") {
3789
- var link = commentsRef.link();
3790
- }
3791
- // load comments (via store.findMany or store.findHasMany)
3792
- commentsRef.load().then(...)
3793
- // or trigger a reload
3794
- commentsRef.reload().then(...)
3795
- // provide data for reference
3796
- commentsRef.push([{ type: 'comment', id: 1 }, { type: 'comment', id: 2 }]).then(function(comments) {
3797
- commentsRef.value() === comments;
3798
- });
3799
- ```
3800
- @method hasMany
3801
- @param {String} name of the relationship
3802
- @return {HasManyReference} reference for this relationship
3803
- */
3804
- hasMany: function (name) {
3805
- return this._internalModel.referenceFor('hasMany', name);
3806
- }
3807
- });
3810
+ // load comments (via store.findMany or store.findHasMany)
3811
+ commentsRef.load().then(...)
3812
+ // or trigger a reload
3813
+ commentsRef.reload().then(...)
3814
+ // provide data for reference
3815
+ commentsRef.push([{ type: 'comment', id: 1 }, { type: 'comment', id: 2 }]).then(function(comments) {
3816
+ commentsRef.value() === comments;
3817
+ });
3818
+ ```
3819
+ @method hasMany
3820
+ @param {String} name of the relationship
3821
+ @return {HasManyReference} reference for this relationship
3822
+ */
3823
+ hasMany: function (name) {
3824
+ return this._internalModel.referenceFor('hasMany', name);
3825
+ }
3826
+ });
3827
+ }
3808
3828
 
3809
3829
  Model.reopenClass(_emberDataPrivateSystemRelationshipsExt.RelationshipsClassMethodsMixin);
3810
3830
  Model.reopenClass(_emberDataPrivateSystemModelAttr.AttrClassMethodsMixin);
@@ -5191,6 +5211,10 @@ define("ember-data/-private/system/record-arrays/adapter-populated-record-array"
5191
5211
  meta: (0, _emberDataPrivateSystemCloneNull.default)(payload.meta)
5192
5212
  });
5193
5213
 
5214
+ if (false) {
5215
+ this.set('links', (0, _emberDataPrivateSystemCloneNull.default)(payload.links));
5216
+ }
5217
+
5194
5218
  internalModels.forEach(function (record) {
5195
5219
  _this.manager.recordArraysForRecord(record).add(_this);
5196
5220
  });
@@ -7429,7 +7453,9 @@ define('ember-data/-private/system/snapshot-record-array', ['exports', 'ember-da
7429
7453
  */
7430
7454
  this.adapterOptions = options.adapterOptions;
7431
7455
 
7432
- this.include = options.include;
7456
+ if (true) {
7457
+ this.include = options.include;
7458
+ }
7433
7459
  }
7434
7460
 
7435
7461
  /**
@@ -7492,7 +7518,9 @@ define('ember-data/-private/system/snapshot', ['exports', 'ember', 'ember-data/-
7492
7518
  */
7493
7519
  this.adapterOptions = options.adapterOptions;
7494
7520
 
7495
- this.include = options.include;
7521
+ if (true) {
7522
+ this.include = options.include;
7523
+ }
7496
7524
 
7497
7525
  this._changedAttributes = record.changedAttributes();
7498
7526
  }
@@ -9576,10 +9604,15 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
9576
9604
  (0, _emberDataPrivateDebug.assert)('Passing classes to store methods has been removed. Please pass a dasherized string instead of ' + _ember.default.inspect(modelName), typeof modelName === 'string');
9577
9605
  serializer = this.serializerFor(modelName);
9578
9606
  }
9579
-
9580
- this._adapterRun(function () {
9581
- return serializer.pushPayload(_this3, payload);
9582
- });
9607
+ if (false) {
9608
+ return this._adapterRun(function () {
9609
+ return serializer.pushPayload(_this3, payload);
9610
+ });
9611
+ } else {
9612
+ this._adapterRun(function () {
9613
+ return serializer.pushPayload(_this3, payload);
9614
+ });
9615
+ }
9583
9616
  },
9584
9617
 
9585
9618
  /**
@@ -9772,38 +9805,41 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
9772
9805
 
9773
9806
  });
9774
9807
 
9775
- Store.reopen({
9776
- /**
9777
- Get the reference for the specified record.
9778
- Example
9779
- ```javascript
9780
- var userRef = store.getReference('user', 1);
9781
- // check if the user is loaded
9782
- var isLoaded = userRef.value() !== null;
9783
- // get the record of the reference (null if not yet available)
9784
- var user = userRef.value();
9785
- // get the identifier of the reference
9786
- if (userRef.remoteType() === "id") {
9787
- var id = userRef.id();
9788
- }
9789
- // load user (via store.find)
9790
- userRef.load().then(...)
9791
- // or trigger a reload
9792
- userRef.reload().then(...)
9793
- // provide data for reference
9794
- userRef.push({ id: 1, username: "@user" }).then(function(user) {
9795
- userRef.value() === user;
9796
- });
9797
- ```
9798
- @method getReference
9799
- @param {String} type
9800
- @param {String|Integer} id
9801
- @return {RecordReference}
9802
- */
9803
- getReference: function (type, id) {
9804
- return this._internalModelForId(type, id).recordReference;
9805
- }
9806
- });
9808
+ if (true) {
9809
+
9810
+ Store.reopen({
9811
+ /**
9812
+ Get the reference for the specified record.
9813
+ Example
9814
+ ```javascript
9815
+ var userRef = store.getReference('user', 1);
9816
+ // check if the user is loaded
9817
+ var isLoaded = userRef.value() !== null;
9818
+ // get the record of the reference (null if not yet available)
9819
+ var user = userRef.value();
9820
+ // get the identifier of the reference
9821
+ if (userRef.remoteType() === "id") {
9822
+ var id = userRef.id();
9823
+ }
9824
+ // load user (via store.find)
9825
+ userRef.load().then(...)
9826
+ // or trigger a reload
9827
+ userRef.reload().then(...)
9828
+ // provide data for reference
9829
+ userRef.push({ id: 1, username: "@user" }).then(function(user) {
9830
+ userRef.value() === user;
9831
+ });
9832
+ ```
9833
+ @method getReference
9834
+ @param {String} type
9835
+ @param {String|Integer} id
9836
+ @return {RecordReference}
9837
+ */
9838
+ getReference: function (type, id) {
9839
+ return this._internalModelForId(type, id).recordReference;
9840
+ }
9841
+ });
9842
+ }
9807
9843
 
9808
9844
  function deserializeRecordId(store, key, relationship, id) {
9809
9845
  if (isNone(id)) {
@@ -10405,6 +10441,14 @@ define('ember-data/-private/transforms/boolean', ['exports', 'ember', 'ember-dat
10405
10441
  deserialize: function (serialized, options) {
10406
10442
  var type = typeof serialized;
10407
10443
 
10444
+ if (true) {
10445
+ if (false) {
10446
+ if (isNone(serialized) && options.allowNull === true) {
10447
+ return null;
10448
+ }
10449
+ }
10450
+ }
10451
+
10408
10452
  if (type === "boolean") {
10409
10453
  return serialized;
10410
10454
  } else if (type === "string") {
@@ -10417,6 +10461,13 @@ define('ember-data/-private/transforms/boolean', ['exports', 'ember', 'ember-dat
10417
10461
  },
10418
10462
 
10419
10463
  serialize: function (deserialized, options) {
10464
+ if (true) {
10465
+ if (false) {
10466
+ if (isNone(deserialized) && options.allowNull === true) {
10467
+ return null;
10468
+ }
10469
+ }
10470
+ }
10420
10471
 
10421
10472
  return Boolean(deserialized);
10422
10473
  }
@@ -11216,6 +11267,9 @@ define('ember-data/adapters/errors', ['exports', 'ember', 'ember-data/-private/d
11216
11267
  }
11217
11268
 
11218
11269
  var extendedErrorsEnabled = false;
11270
+ if (false) {
11271
+ extendedErrorsEnabled = true;
11272
+ }
11219
11273
 
11220
11274
  function extendFn(ErrorClass) {
11221
11275
  return function () {
@@ -11503,8 +11557,12 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters
11503
11557
  @return {Promise} promise
11504
11558
  */
11505
11559
  findMany: function (store, type, ids, snapshots) {
11506
- var url = this.buildURL(type.modelName, ids, snapshots, 'findMany');
11507
- return this.ajax(url, 'GET', { data: { filter: { id: ids.join(',') } } });
11560
+ if (false) {
11561
+ return this._super.apply(this, arguments);
11562
+ } else {
11563
+ var url = this.buildURL(type.modelName, ids, snapshots, 'findMany');
11564
+ return this.ajax(url, 'GET', { data: { filter: { id: ids.join(',') } } });
11565
+ }
11508
11566
  },
11509
11567
 
11510
11568
  /**
@@ -11526,18 +11584,81 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters
11526
11584
  @return {Promise} promise
11527
11585
  */
11528
11586
  updateRecord: function (store, type, snapshot) {
11529
- var data = {};
11530
- var serializer = store.serializerFor(type.modelName);
11587
+ if (false) {
11588
+ return this._super.apply(this, arguments);
11589
+ } else {
11590
+ var data = {};
11591
+ var serializer = store.serializerFor(type.modelName);
11531
11592
 
11532
- serializer.serializeIntoHash(data, type, snapshot, { includeId: true });
11593
+ serializer.serializeIntoHash(data, type, snapshot, { includeId: true });
11533
11594
 
11534
- var id = snapshot.id;
11535
- var url = this.buildURL(type.modelName, id, snapshot, 'updateRecord');
11595
+ var id = snapshot.id;
11596
+ var url = this.buildURL(type.modelName, id, snapshot, 'updateRecord');
11536
11597
 
11537
- return this.ajax(url, 'PATCH', { data: data });
11598
+ return this.ajax(url, 'PATCH', { data: data });
11599
+ }
11538
11600
  }
11539
11601
  });
11540
11602
 
11603
+ if (false) {
11604
+
11605
+ JSONAPIAdapter.reopen({
11606
+
11607
+ methodForRequest: function (params) {
11608
+ if (params.requestType === 'updateRecord') {
11609
+ return 'PATCH';
11610
+ }
11611
+
11612
+ return this._super.apply(this, arguments);
11613
+ },
11614
+
11615
+ dataForRequest: function (params) {
11616
+ var requestType = params.requestType;
11617
+ var ids = params.ids;
11618
+
11619
+ if (requestType === 'findMany') {
11620
+ return {
11621
+ filter: { id: ids.join(',') }
11622
+ };
11623
+ }
11624
+
11625
+ if (requestType === 'updateRecord') {
11626
+ var store = params.store;
11627
+ var type = params.type;
11628
+ var snapshot = params.snapshot;
11629
+
11630
+ var data = {};
11631
+ var serializer = store.serializerFor(type.modelName);
11632
+
11633
+ serializer.serializeIntoHash(data, type, snapshot, { includeId: true });
11634
+
11635
+ return data;
11636
+ }
11637
+
11638
+ return this._super.apply(this, arguments);
11639
+ },
11640
+
11641
+ headersForRequest: function () {
11642
+ var headers = this._super.apply(this, arguments) || {};
11643
+
11644
+ headers['Accept'] = 'application/vnd.api+json';
11645
+
11646
+ return headers;
11647
+ },
11648
+
11649
+ _requestToJQueryAjaxHash: function () {
11650
+ var hash = this._super.apply(this, arguments);
11651
+
11652
+ if (hash.contentType) {
11653
+ hash.contentType = 'application/vnd.api+json';
11654
+ }
11655
+
11656
+ return hash;
11657
+ }
11658
+
11659
+ });
11660
+ }
11661
+
11541
11662
  exports.default = JSONAPIAdapter;
11542
11663
  });
11543
11664
  /**
@@ -11904,10 +12025,19 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
11904
12025
  @return {Promise} promise
11905
12026
  */
11906
12027
  findRecord: function (store, type, id, snapshot) {
11907
- var url = this.buildURL(type.modelName, id, snapshot, 'findRecord');
11908
- var query = this.buildQuery(snapshot);
12028
+ if (false) {
12029
+ var request = this._requestFor({
12030
+ store: store, type: type, id: id, snapshot: snapshot,
12031
+ requestType: 'findRecord'
12032
+ });
11909
12033
 
11910
- return this.ajax(url, 'GET', { data: query });
12034
+ return this._makeRequest(request);
12035
+ } else {
12036
+ var url = this.buildURL(type.modelName, id, snapshot, 'findRecord');
12037
+ var query = this.buildQuery(snapshot);
12038
+
12039
+ return this.ajax(url, 'GET', { data: query });
12040
+ }
11911
12041
  },
11912
12042
 
11913
12043
  /**
@@ -11925,13 +12055,23 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
11925
12055
  findAll: function (store, type, sinceToken, snapshotRecordArray) {
11926
12056
  var query = this.buildQuery(snapshotRecordArray);
11927
12057
 
11928
- var url = this.buildURL(type.modelName, null, snapshotRecordArray, 'findAll');
12058
+ if (false) {
12059
+ var request = this._requestFor({
12060
+ store: store, type: type, sinceToken: sinceToken, query: query,
12061
+ snapshots: snapshotRecordArray,
12062
+ requestType: 'findAll'
12063
+ });
12064
+
12065
+ return this._makeRequest(request);
12066
+ } else {
12067
+ var url = this.buildURL(type.modelName, null, snapshotRecordArray, 'findAll');
11929
12068
 
11930
- if (sinceToken) {
11931
- query.since = sinceToken;
11932
- }
12069
+ if (sinceToken) {
12070
+ query.since = sinceToken;
12071
+ }
11933
12072
 
11934
- return this.ajax(url, 'GET', { data: query });
12073
+ return this.ajax(url, 'GET', { data: query });
12074
+ }
11935
12075
  },
11936
12076
 
11937
12077
  /**
@@ -11949,13 +12089,22 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
11949
12089
  @return {Promise} promise
11950
12090
  */
11951
12091
  query: function (store, type, query) {
11952
- var url = this.buildURL(type.modelName, null, null, 'query', query);
12092
+ if (false) {
12093
+ var request = this._requestFor({
12094
+ store: store, type: type, query: query,
12095
+ requestType: 'query'
12096
+ });
11953
12097
 
11954
- if (this.sortQueryParams) {
11955
- query = this.sortQueryParams(query);
11956
- }
12098
+ return this._makeRequest(request);
12099
+ } else {
12100
+ var url = this.buildURL(type.modelName, null, null, 'query', query);
12101
+
12102
+ if (this.sortQueryParams) {
12103
+ query = this.sortQueryParams(query);
12104
+ }
11957
12105
 
11958
- return this.ajax(url, 'GET', { data: query });
12106
+ return this.ajax(url, 'GET', { data: query });
12107
+ }
11959
12108
  },
11960
12109
 
11961
12110
  /**
@@ -11973,13 +12122,22 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
11973
12122
  @return {Promise} promise
11974
12123
  */
11975
12124
  queryRecord: function (store, type, query) {
11976
- var url = this.buildURL(type.modelName, null, null, 'queryRecord', query);
12125
+ if (false) {
12126
+ var request = this._requestFor({
12127
+ store: store, type: type, query: query,
12128
+ requestType: 'queryRecord'
12129
+ });
11977
12130
 
11978
- if (this.sortQueryParams) {
11979
- query = this.sortQueryParams(query);
11980
- }
12131
+ return this._makeRequest(request);
12132
+ } else {
12133
+ var url = this.buildURL(type.modelName, null, null, 'queryRecord', query);
11981
12134
 
11982
- return this.ajax(url, 'GET', { data: query });
12135
+ if (this.sortQueryParams) {
12136
+ query = this.sortQueryParams(query);
12137
+ }
12138
+
12139
+ return this.ajax(url, 'GET', { data: query });
12140
+ }
11983
12141
  },
11984
12142
 
11985
12143
  /**
@@ -12009,8 +12167,17 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12009
12167
  @return {Promise} promise
12010
12168
  */
12011
12169
  findMany: function (store, type, ids, snapshots) {
12012
- var url = this.buildURL(type.modelName, ids, snapshots, 'findMany');
12013
- return this.ajax(url, 'GET', { data: { ids: ids } });
12170
+ if (false) {
12171
+ var request = this._requestFor({
12172
+ store: store, type: type, ids: ids, snapshots: snapshots,
12173
+ requestType: 'findMany'
12174
+ });
12175
+
12176
+ return this._makeRequest(request);
12177
+ } else {
12178
+ var url = this.buildURL(type.modelName, ids, snapshots, 'findMany');
12179
+ return this.ajax(url, 'GET', { data: { ids: ids } });
12180
+ }
12014
12181
  },
12015
12182
 
12016
12183
  /**
@@ -12040,12 +12207,21 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12040
12207
  @return {Promise} promise
12041
12208
  */
12042
12209
  findHasMany: function (store, snapshot, url, relationship) {
12043
- var id = snapshot.id;
12044
- var type = snapshot.modelName;
12210
+ if (false) {
12211
+ var request = this._requestFor({
12212
+ store: store, snapshot: snapshot, url: url, relationship: relationship,
12213
+ requestType: 'findHasMany'
12214
+ });
12045
12215
 
12046
- url = this.urlPrefix(url, this.buildURL(type, id, snapshot, 'findHasMany'));
12216
+ return this._makeRequest(request);
12217
+ } else {
12218
+ var id = snapshot.id;
12219
+ var type = snapshot.modelName;
12047
12220
 
12048
- return this.ajax(url, 'GET');
12221
+ url = this.urlPrefix(url, this.buildURL(type, id, snapshot, 'findHasMany'));
12222
+
12223
+ return this.ajax(url, 'GET');
12224
+ }
12049
12225
  },
12050
12226
 
12051
12227
  /**
@@ -12075,11 +12251,20 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12075
12251
  @return {Promise} promise
12076
12252
  */
12077
12253
  findBelongsTo: function (store, snapshot, url, relationship) {
12078
- var id = snapshot.id;
12079
- var type = snapshot.modelName;
12254
+ if (false) {
12255
+ var request = this._requestFor({
12256
+ store: store, snapshot: snapshot, url: url, relationship: relationship,
12257
+ requestType: 'findBelongsTo'
12258
+ });
12080
12259
 
12081
- url = this.urlPrefix(url, this.buildURL(type, id, snapshot, 'findBelongsTo'));
12082
- return this.ajax(url, 'GET');
12260
+ return this._makeRequest(request);
12261
+ } else {
12262
+ var id = snapshot.id;
12263
+ var type = snapshot.modelName;
12264
+
12265
+ url = this.urlPrefix(url, this.buildURL(type, id, snapshot, 'findBelongsTo'));
12266
+ return this.ajax(url, 'GET');
12267
+ }
12083
12268
  },
12084
12269
 
12085
12270
  /**
@@ -12096,13 +12281,22 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12096
12281
  @return {Promise} promise
12097
12282
  */
12098
12283
  createRecord: function (store, type, snapshot) {
12099
- var data = {};
12100
- var serializer = store.serializerFor(type.modelName);
12101
- var url = this.buildURL(type.modelName, null, snapshot, 'createRecord');
12284
+ if (false) {
12285
+ var request = this._requestFor({
12286
+ store: store, type: type, snapshot: snapshot,
12287
+ requestType: 'createRecord'
12288
+ });
12102
12289
 
12103
- serializer.serializeIntoHash(data, type, snapshot, { includeId: true });
12290
+ return this._makeRequest(request);
12291
+ } else {
12292
+ var data = {};
12293
+ var serializer = store.serializerFor(type.modelName);
12294
+ var url = this.buildURL(type.modelName, null, snapshot, 'createRecord');
12104
12295
 
12105
- return this.ajax(url, "POST", { data: data });
12296
+ serializer.serializeIntoHash(data, type, snapshot, { includeId: true });
12297
+
12298
+ return this.ajax(url, "POST", { data: data });
12299
+ }
12106
12300
  },
12107
12301
 
12108
12302
  /**
@@ -12119,15 +12313,24 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12119
12313
  @return {Promise} promise
12120
12314
  */
12121
12315
  updateRecord: function (store, type, snapshot) {
12122
- var data = {};
12123
- var serializer = store.serializerFor(type.modelName);
12316
+ if (false) {
12317
+ var request = this._requestFor({
12318
+ store: store, type: type, snapshot: snapshot,
12319
+ requestType: 'updateRecord'
12320
+ });
12124
12321
 
12125
- serializer.serializeIntoHash(data, type, snapshot);
12322
+ return this._makeRequest(request);
12323
+ } else {
12324
+ var data = {};
12325
+ var serializer = store.serializerFor(type.modelName);
12126
12326
 
12127
- var id = snapshot.id;
12128
- var url = this.buildURL(type.modelName, id, snapshot, 'updateRecord');
12327
+ serializer.serializeIntoHash(data, type, snapshot);
12328
+
12329
+ var id = snapshot.id;
12330
+ var url = this.buildURL(type.modelName, id, snapshot, 'updateRecord');
12129
12331
 
12130
- return this.ajax(url, "PUT", { data: data });
12332
+ return this.ajax(url, "PUT", { data: data });
12333
+ }
12131
12334
  },
12132
12335
 
12133
12336
  /**
@@ -12140,9 +12343,18 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12140
12343
  @return {Promise} promise
12141
12344
  */
12142
12345
  deleteRecord: function (store, type, snapshot) {
12143
- var id = snapshot.id;
12346
+ if (false) {
12347
+ var request = this._requestFor({
12348
+ store: store, type: type, snapshot: snapshot,
12349
+ requestType: 'deleteRecord'
12350
+ });
12144
12351
 
12145
- return this.ajax(this.buildURL(type.modelName, id, snapshot, 'deleteRecord'), "DELETE");
12352
+ return this._makeRequest(request);
12353
+ } else {
12354
+ var id = snapshot.id;
12355
+
12356
+ return this.ajax(this.buildURL(type.modelName, id, snapshot, 'deleteRecord'), "DELETE");
12357
+ }
12146
12358
  },
12147
12359
 
12148
12360
  _stripIDFromURL: function (store, snapshot) {
@@ -12262,6 +12474,23 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12262
12474
  var errors = this.normalizeErrorResponse(status, headers, payload);
12263
12475
  var detailedMessage = this.generatedDetailedMessage(status, headers, payload, requestData);
12264
12476
 
12477
+ if (false) {
12478
+ switch (status) {
12479
+ case 401:
12480
+ return new _emberDataAdaptersErrors.UnauthorizedError(errors, detailedMessage);
12481
+ case 403:
12482
+ return new _emberDataAdaptersErrors.ForbiddenError(errors, detailedMessage);
12483
+ case 404:
12484
+ return new _emberDataAdaptersErrors.NotFoundError(errors, detailedMessage);
12485
+ case 409:
12486
+ return new _emberDataAdaptersErrors.ConflictError(errors, detailedMessage);
12487
+ default:
12488
+ if (status >= 500) {
12489
+ return new _emberDataAdaptersErrors.ServerError(errors, detailedMessage);
12490
+ }
12491
+ }
12492
+ }
12493
+
12265
12494
  return new _emberDataAdaptersErrors.AdapterError(errors, detailedMessage);
12266
12495
  },
12267
12496
 
@@ -12468,11 +12697,13 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12468
12697
  buildQuery: function (snapshot) {
12469
12698
  var query = {};
12470
12699
 
12471
- if (snapshot) {
12472
- var include = snapshot.include;
12700
+ if (true) {
12701
+ if (snapshot) {
12702
+ var include = snapshot.include;
12473
12703
 
12474
- if (include) {
12475
- query.include = include;
12704
+ if (include) {
12705
+ query.include = include;
12706
+ }
12476
12707
  }
12477
12708
  }
12478
12709
 
@@ -12480,6 +12711,266 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12480
12711
  }
12481
12712
  });
12482
12713
 
12714
+ if (false) {
12715
+
12716
+ RESTAdapter.reopen({
12717
+
12718
+ /**
12719
+ * Get the data (body or query params) for a request.
12720
+ *
12721
+ * @public
12722
+ * @method dataForRequest
12723
+ * @param {Object} params
12724
+ * @return {Object} data
12725
+ */
12726
+ dataForRequest: function (params) {
12727
+ var store = params.store;
12728
+ var type = params.type;
12729
+ var snapshot = params.snapshot;
12730
+ var requestType = params.requestType;
12731
+ var query = params.query;
12732
+
12733
+ // type is not passed to findBelongsTo and findHasMany
12734
+ type = type || snapshot && snapshot.type;
12735
+
12736
+ var serializer = store.serializerFor(type.modelName);
12737
+ var data = {};
12738
+
12739
+ switch (requestType) {
12740
+ case 'createRecord':
12741
+ serializer.serializeIntoHash(data, type, snapshot, { includeId: true });
12742
+ break;
12743
+
12744
+ case 'updateRecord':
12745
+ serializer.serializeIntoHash(data, type, snapshot);
12746
+ break;
12747
+
12748
+ case 'findRecord':
12749
+ data = this.buildQuery(snapshot);
12750
+ break;
12751
+
12752
+ case 'findAll':
12753
+ if (params.sinceToken) {
12754
+ query = query || {};
12755
+ query.since = params.sinceToken;
12756
+ }
12757
+ data = query;
12758
+ break;
12759
+
12760
+ case 'query':
12761
+ case 'queryRecord':
12762
+ if (this.sortQueryParams) {
12763
+ query = this.sortQueryParams(query);
12764
+ }
12765
+ data = query;
12766
+ break;
12767
+
12768
+ case 'findMany':
12769
+ data = { ids: params.ids };
12770
+ break;
12771
+
12772
+ default:
12773
+ data = undefined;
12774
+ break;
12775
+ }
12776
+
12777
+ return data;
12778
+ },
12779
+
12780
+ /**
12781
+ * Get the HTTP method for a request.
12782
+ *
12783
+ * @public
12784
+ * @method methodForRequest
12785
+ * @param {Object} params
12786
+ * @return {String} HTTP method
12787
+ */
12788
+ methodForRequest: function (params) {
12789
+ var requestType = params.requestType;
12790
+
12791
+ switch (requestType) {
12792
+ case 'createRecord':
12793
+ return 'POST';
12794
+ case 'updateRecord':
12795
+ return 'PUT';
12796
+ case 'deleteRecord':
12797
+ return 'DELETE';
12798
+ }
12799
+
12800
+ return 'GET';
12801
+ },
12802
+
12803
+ /**
12804
+ * Get the URL for a request.
12805
+ *
12806
+ * @public
12807
+ * @method urlForRequest
12808
+ * @param {Object} params
12809
+ * @return {String} URL
12810
+ */
12811
+ urlForRequest: function (params) {
12812
+ var type = params.type;
12813
+ var id = params.id;
12814
+ var ids = params.ids;
12815
+ var snapshot = params.snapshot;
12816
+ var snapshots = params.snapshots;
12817
+ var requestType = params.requestType;
12818
+ var query = params.query;
12819
+
12820
+ // type and id are not passed from updateRecord and deleteRecord, hence they
12821
+ // are defined if not set
12822
+ type = type || snapshot && snapshot.type;
12823
+ id = id || snapshot && snapshot.id;
12824
+
12825
+ switch (requestType) {
12826
+ case 'findAll':
12827
+ return this.buildURL(type.modelName, null, snapshots, requestType);
12828
+
12829
+ case 'query':
12830
+ case 'queryRecord':
12831
+ return this.buildURL(type.modelName, null, null, requestType, query);
12832
+
12833
+ case 'findMany':
12834
+ return this.buildURL(type.modelName, ids, snapshots, requestType);
12835
+
12836
+ case 'findHasMany':
12837
+ case 'findBelongsTo':
12838
+ var url = this.buildURL(type.modelName, id, snapshot, requestType);
12839
+ return this.urlPrefix(params.url, url);
12840
+ }
12841
+
12842
+ return this.buildURL(type.modelName, id, snapshot, requestType, query);
12843
+ },
12844
+
12845
+ /**
12846
+ * Get the headers for a request.
12847
+ *
12848
+ * By default the value of the `headers` property of the adapter is
12849
+ * returned.
12850
+ *
12851
+ * @public
12852
+ * @method headersForRequest
12853
+ * @param {Object} params
12854
+ * @return {Object} headers
12855
+ */
12856
+ headersForRequest: function (params) {
12857
+ return this.get('headers');
12858
+ },
12859
+
12860
+ /**
12861
+ * Get an object which contains all properties for a request which should
12862
+ * be made.
12863
+ *
12864
+ * @private
12865
+ * @method _requestFor
12866
+ * @param {Object} params
12867
+ * @return {Object} request object
12868
+ */
12869
+ _requestFor: function (params) {
12870
+ var method = this.methodForRequest(params);
12871
+ var url = this.urlForRequest(params);
12872
+ var headers = this.headersForRequest(params);
12873
+ var data = this.dataForRequest(params);
12874
+
12875
+ return { method: method, url: url, headers: headers, data: data };
12876
+ },
12877
+
12878
+ /**
12879
+ * Convert a request object into a hash which can be passed to `jQuery.ajax`.
12880
+ *
12881
+ * @private
12882
+ * @method _requestToJQueryAjaxHash
12883
+ * @param {Object} request
12884
+ * @return {Object} jQuery ajax hash
12885
+ */
12886
+ _requestToJQueryAjaxHash: function (request) {
12887
+ var hash = {};
12888
+
12889
+ hash.type = request.method;
12890
+ hash.url = request.url;
12891
+ hash.dataType = 'json';
12892
+ hash.context = this;
12893
+
12894
+ if (request.data) {
12895
+ if (request.type !== 'GET') {
12896
+ hash.contentType = 'application/json; charset=utf-8';
12897
+ hash.data = JSON.stringify(request.data);
12898
+ } else {
12899
+ hash.data = request.data;
12900
+ }
12901
+ }
12902
+
12903
+ var headers = request.headers;
12904
+ if (headers !== undefined) {
12905
+ hash.beforeSend = function (xhr) {
12906
+ Object.keys(headers).forEach(function (key) {
12907
+ return xhr.setRequestHeader(key, headers[key]);
12908
+ });
12909
+ };
12910
+ }
12911
+
12912
+ return hash;
12913
+ },
12914
+
12915
+ /**
12916
+ * Make a request using `jQuery.ajax`.
12917
+ *
12918
+ * @private
12919
+ * @method _makeRequest
12920
+ * @param {Object} request
12921
+ * @return {Promise} promise
12922
+ */
12923
+ _makeRequest: function (request) {
12924
+ var adapter = this;
12925
+ var hash = this._requestToJQueryAjaxHash(request);
12926
+
12927
+ var method = request.method;
12928
+ var url = request.url;
12929
+
12930
+ var requestData = { method: method, url: url };
12931
+
12932
+ return new _ember.default.RSVP.Promise(function (resolve, reject) {
12933
+
12934
+ hash.success = function (payload, textStatus, jqXHR) {
12935
+ var response = adapter.handleResponse(jqXHR.status, (0, _emberDataPrivateUtilsParseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), payload, requestData);
12936
+
12937
+ if (response instanceof _emberDataAdaptersErrors.AdapterError) {
12938
+ _ember.default.run.join(null, reject, response);
12939
+ } else {
12940
+ _ember.default.run.join(null, resolve, response);
12941
+ }
12942
+ };
12943
+
12944
+ hash.error = function (jqXHR, textStatus, errorThrown) {
12945
+ (0, _emberDataPrivateDebug.runInDebug)(function () {
12946
+ var message = 'The server returned an empty string for ' + method + ' ' + url + ', which cannot be parsed into a valid JSON. Return either null or {}.';
12947
+ var validJSONString = !(textStatus === "parsererror" && jqXHR.responseText === "");
12948
+ (0, _emberDataPrivateDebug.warn)(message, validJSONString, {
12949
+ id: 'ds.adapter.returned-empty-string-as-JSON'
12950
+ });
12951
+ });
12952
+
12953
+ var error = undefined;
12954
+
12955
+ if (errorThrown instanceof Error) {
12956
+ error = errorThrown;
12957
+ } else if (textStatus === 'timeout') {
12958
+ error = new _emberDataAdaptersErrors.TimeoutError();
12959
+ } else if (textStatus === 'abort') {
12960
+ error = new _emberDataAdaptersErrors.AbortError();
12961
+ } else {
12962
+ error = adapter.handleResponse(jqXHR.status, (0, _emberDataPrivateUtilsParseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), adapter.parseErrorResponse(jqXHR.responseText) || errorThrown, requestData);
12963
+ }
12964
+
12965
+ _ember.default.run.join(null, reject, error);
12966
+ };
12967
+
12968
+ adapter._ajaxRequest(hash);
12969
+ }, 'DS: RESTAdapter#makeRequest: ' + method + ' ' + url);
12970
+ }
12971
+ });
12972
+ }
12973
+
12483
12974
  //From http://stackoverflow.com/questions/280634/endswith-in-javascript
12484
12975
  function endsWith(string, suffix) {
12485
12976
  if (typeof String.prototype.endsWith !== 'function') {
@@ -12494,78 +12985,6 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
12494
12985
  /**
12495
12986
  @module ember-data
12496
12987
  */
12497
-
12498
- /**
12499
- * Get the data (body or query params) for a request.
12500
- *
12501
- * @public
12502
- * @method dataForRequest
12503
- * @param {Object} params
12504
- * @return {Object} data
12505
- */
12506
-
12507
- // type is not passed to findBelongsTo and findHasMany
12508
-
12509
- /**
12510
- * Get the HTTP method for a request.
12511
- *
12512
- * @public
12513
- * @method methodForRequest
12514
- * @param {Object} params
12515
- * @return {String} HTTP method
12516
- */
12517
-
12518
- /**
12519
- * Get the URL for a request.
12520
- *
12521
- * @public
12522
- * @method urlForRequest
12523
- * @param {Object} params
12524
- * @return {String} URL
12525
- */
12526
-
12527
- // type and id are not passed from updateRecord and deleteRecord, hence they
12528
- // are defined if not set
12529
-
12530
- /**
12531
- * Get the headers for a request.
12532
- *
12533
- * By default the value of the `headers` property of the adapter is
12534
- * returned.
12535
- *
12536
- * @public
12537
- * @method headersForRequest
12538
- * @param {Object} params
12539
- * @return {Object} headers
12540
- */
12541
-
12542
- /**
12543
- * Get an object which contains all properties for a request which should
12544
- * be made.
12545
- *
12546
- * @private
12547
- * @method _requestFor
12548
- * @param {Object} params
12549
- * @return {Object} request object
12550
- */
12551
-
12552
- /**
12553
- * Convert a request object into a hash which can be passed to `jQuery.ajax`.
12554
- *
12555
- * @private
12556
- * @method _requestToJQueryAjaxHash
12557
- * @param {Object} request
12558
- * @return {Object} jQuery ajax hash
12559
- */
12560
-
12561
- /**
12562
- * Make a request using `jQuery.ajax`.
12563
- *
12564
- * @private
12565
- * @method _makeRequest
12566
- * @param {Object} request
12567
- * @return {Promise} promise
12568
- */
12569
12988
  define('ember-data/attr', ['exports', 'ember', 'ember-data/-private/debug'], function (exports, _ember, _emberDataPrivateDebug) {
12570
12989
  exports.default = attr;
12571
12990
 
@@ -12767,6 +13186,14 @@ define("ember-data", ["exports", "ember", "ember-data/-private/debug", "ember-da
12767
13186
  _emberDataPrivateCore.default.TimeoutError = _emberDataAdaptersErrors.TimeoutError;
12768
13187
  _emberDataPrivateCore.default.AbortError = _emberDataAdaptersErrors.AbortError;
12769
13188
 
13189
+ if (false) {
13190
+ _emberDataPrivateCore.default.UnauthorizedError = _emberDataAdaptersErrors.UnauthorizedError;
13191
+ _emberDataPrivateCore.default.ForbiddenError = _emberDataAdaptersErrors.ForbiddenError;
13192
+ _emberDataPrivateCore.default.NotFoundError = _emberDataAdaptersErrors.NotFoundError;
13193
+ _emberDataPrivateCore.default.ConflictError = _emberDataAdaptersErrors.ConflictError;
13194
+ _emberDataPrivateCore.default.ServerError = _emberDataAdaptersErrors.ServerError;
13195
+ }
13196
+
12770
13197
  _emberDataPrivateCore.default.errorsHashToArray = _emberDataAdaptersErrors.errorsHashToArray;
12771
13198
  _emberDataPrivateCore.default.errorsArrayToHash = _emberDataAdaptersErrors.errorsArrayToHash;
12772
13199
 
@@ -13257,8 +13684,10 @@ define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember', 'em
13257
13684
  } else if (this.hasSerializeRecordsOption(attr)) {
13258
13685
  this._serializeEmbeddedHasMany(snapshot, json, relationship);
13259
13686
  } else {
13260
- if (this.hasSerializeIdsAndTypesOption(attr)) {
13261
- this._serializeHasManyAsIdsAndTypes(snapshot, json, relationship);
13687
+ if (true) {
13688
+ if (this.hasSerializeIdsAndTypesOption(attr)) {
13689
+ this._serializeHasManyAsIdsAndTypes(snapshot, json, relationship);
13690
+ }
13262
13691
  }
13263
13692
  }
13264
13693
  },
@@ -13664,8 +14093,11 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
13664
14093
  */
13665
14094
  pushPayload: function (store, payload) {
13666
14095
  var normalizedPayload = this._normalizeDocumentHelper(payload);
13667
-
13668
- store.push(normalizedPayload);
14096
+ if (false) {
14097
+ return store.push(normalizedPayload);
14098
+ } else {
14099
+ store.push(normalizedPayload);
14100
+ }
13669
14101
  },
13670
14102
 
13671
14103
  /**
@@ -13902,7 +14334,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
13902
14334
  var value = snapshot.attr(key);
13903
14335
  if (type) {
13904
14336
  var transform = this.transformFor(type);
13905
- value = transform.serialize(value);
14337
+ value = transform.serialize(value, attribute.options);
13906
14338
  }
13907
14339
 
13908
14340
  var payloadKey = this._getMappedKey(key, snapshot.type);
@@ -14167,8 +14599,9 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
14167
14599
  var _this = this;
14168
14600
 
14169
14601
  var attributes = undefined;
14170
-
14171
- attributes = get(typeClass, 'attributes');
14602
+ if (true) {
14603
+ attributes = get(typeClass, 'attributes');
14604
+ }
14172
14605
 
14173
14606
  typeClass.eachTransformedAttribute(function (key, typeClass) {
14174
14607
  if (!(key in data)) {
@@ -14176,9 +14609,12 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
14176
14609
  }
14177
14610
 
14178
14611
  var transform = _this.transformFor(typeClass);
14179
-
14180
- var transformMeta = attributes.get(key);
14181
- data[key] = transform.deserialize(data[key], transformMeta.options);
14612
+ if (true) {
14613
+ var transformMeta = attributes.get(key);
14614
+ data[key] = transform.deserialize(data[key], transformMeta.options);
14615
+ } else {
14616
+ data[key] = transform.deserialize(data[key]);
14617
+ }
14182
14618
  });
14183
14619
 
14184
14620
  return data;
@@ -15022,8 +15458,11 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
15022
15458
  var value = snapshot.attr(key);
15023
15459
  if (type) {
15024
15460
  var transform = this.transformFor(type);
15025
-
15026
- value = transform.serialize(value, attribute.options);
15461
+ if (true) {
15462
+ value = transform.serialize(value, attribute.options);
15463
+ } else {
15464
+ value = transform.serialize(value);
15465
+ }
15027
15466
  }
15028
15467
 
15029
15468
  // if provided, use the mapping provided by `attrs` in
@@ -15767,7 +16206,11 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
15767
16206
  });
15768
16207
  }
15769
16208
 
15770
- store.push(documentHash);
16209
+ if (false) {
16210
+ return store.push(documentHash);
16211
+ } else {
16212
+ store.push(documentHash);
16213
+ }
15771
16214
  },
15772
16215
 
15773
16216
  /**
@@ -16190,7 +16633,7 @@ define('ember-data/transform', ['exports', 'ember'], function (exports, _ember)
16190
16633
  });
16191
16634
  });
16192
16635
  define("ember-data/version", ["exports"], function (exports) {
16193
- exports.default = "2.6.0";
16636
+ exports.default = "2.6.1";
16194
16637
  });
16195
16638
  define("ember-inflector", ["exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (exports, _ember, _emberInflectorLibSystem, _emberInflectorLibExtString) {
16196
16639