Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
application.register('adapter:-firebase', FirebaseAdapter);
application.register('serializer:-firebase', FirebaseSerializer);
const providerSettings = {instantiate: false, singleton: false};
application.register('firebase-auth-provider:twitter',
firebase.auth.TwitterAuthProvider, providerSettings);
application.register('firebase-auth-provider:facebook',
firebase.auth.FacebookAuthProvider, providerSettings);
application.register('firebase-auth-provider:github',
firebase.auth.GithubAuthProvider, providerSettings);
application.register('firebase-auth-provider:google',
firebase.auth.GoogleAuthProvider, providerSettings);
// Monkeypatch the store until ED gives us a good way to listen to push events
if (!DS.Store.prototype._emberfirePatched) {
DS.Store.reopen({
_emberfirePatched: true,
_emberfireHandleRecordPush(records) {
if (typeof records !== 'undefined') {
records.forEach((record) => {
var modelName = record.constructor.modelName;
var adapter = this.adapterFor(modelName);
if (adapter.recordWasPushed) {
adapter.recordWasPushed(this, modelName, record);
}
});
}
},
push() {
import DS from 'ember-data';
export default DS.Store.extend({
// adapter: 'application' // TODO
});
}
};
var adapter = env.adapter = (options.adapter || '-default');
delete options.adapter;
if (typeof adapter !== 'string') {
env.registry.register('adapter:-ember-data-test-custom', adapter);
adapter = '-ember-data-test-custom';
}
for (var prop in options) {
registry.register('model:' + dasherize(prop), options[prop]);
}
registry.register('service:store', DS.Store.extend({
adapter: adapter
}));
registry.optionsForType('serializer', { singleton: false });
registry.optionsForType('adapter', { singleton: false });
registry.register('adapter:-default', DS.Adapter);
registry.register('serializer:-default', DS.JSONSerializer);
registry.register('serializer:-rest', DS.RESTSerializer);
registry.register('adapter:-rest', DS.RESTAdapter);
registry.register('adapter:-json-api', DS.JSONAPIAdapter);
registry.register('serializer:-json-api', DS.JSONAPISerializer);
registry.register('adapter:-graphql', Adapter);
import DS from 'ember-data';
export default DS.Store.extend({
});
import DS from 'ember-data';
import ENV from '../config/environment';
var restAdapter = DS.RESTAdapter.extend({
namespace: 'v2',
host: ENV.API_URL,
pathForType: function(type){
return (this.__isUserPath(type) ? "users/" : "") + (type === "parser" ? "parser" : this._super(type));
},
__isUserPath: function(type) {
return ['subscription', 'suggestion'].indexOf(type) > -1;
}
});
var OnlineStore = DS.Store.extend({
adapterFor: function() {
return this.container.lookup('adapter:_online_adapter');
}
});
export function initialize(container, application) {
container.register('store:online', OnlineStore);
container.register('adapter:_online_adapter', restAdapter);
application.inject('route', 'onlineStore', 'store:online');
application.inject('controller', 'onlineStore', 'store:online');
}
export default {
name: 'online-store',
initialize: initialize
setStore(aStore) {
assert(
`[ember-data-factory-guy] FactoryGuy#setStore needs a valid store instance. You passed in [${aStore}]`,
aStore instanceof DS.Store
);
this.store = aStore;
this.fixtureBuilderFactory = new FixtureBuilderFactory(this.store);
this.afterDestroyStore(aStore);
}
export function initialize() {
DS.Store.reopen({
exportSelectedData(types, options) {
return exportSelected(this, types, options);
}
});
}
export function initialize() {
if (!DS.Store.prototype._emberLocalStoragePatched) {
DS.Store.reopen({
_emberLocalStoragePatched: true,
importData: function(json, options) {
return importData(this, json, options);
},
exportData: function(types, options) {
return exportData(this, types, options);
}
});
}
}
export function initialize() {
if (!DS.Store.prototype._emberLocalStoragePatched) {
DS.Store.reopen({
_emberLocalStoragePatched: true,
importData: function(json, options) {
return importData(this, json, options);
},
exportData: function(types, options) {
return exportData(this, types, options);
}
});
}
}