diff --git a/app/adapters/addon.ts b/app/adapters/addon.ts new file mode 100644 index 00000000000..0d2e2a32e6f --- /dev/null +++ b/app/adapters/addon.ts @@ -0,0 +1,10 @@ +import OsfAdapter from './osf-adapter'; + +export default class AddonAdapter extends OsfAdapter { +} + +declare module 'ember-data/types/registries/adapter' { + export default interface AdapterRegistry { + addon: AddonAdapter; + } // eslint-disable-line semi +} diff --git a/app/adapters/external-account.ts b/app/adapters/external-account.ts new file mode 100644 index 00000000000..b3e85f1b5d1 --- /dev/null +++ b/app/adapters/external-account.ts @@ -0,0 +1,10 @@ +import OsfAdapter from './osf-adapter'; + +export default class ExternalAccountAdapter extends OsfAdapter { +} + +declare module 'ember-data/types/registries/adapter' { + export default interface AdapterRegistry { + 'external-account': ExternalAccountAdapter; + } // eslint-disable-line semi +} diff --git a/app/adapters/node-addon.ts b/app/adapters/node-addon.ts new file mode 100644 index 00000000000..d822a8d3aa8 --- /dev/null +++ b/app/adapters/node-addon.ts @@ -0,0 +1,10 @@ +import OsfAdapter from './osf-adapter'; + +export default class NodeAddonAdapter extends OsfAdapter { +} + +declare module 'ember-data/types/registries/adapter' { + export default interface AdapterRegistry { + 'node-addon': NodeAddonAdapter; + } // eslint-disable-line semi +} diff --git a/app/adapters/user-addon.ts b/app/adapters/user-addon.ts new file mode 100644 index 00000000000..7cf6a2c6c49 --- /dev/null +++ b/app/adapters/user-addon.ts @@ -0,0 +1,10 @@ +import OsfAdapter from './osf-adapter'; + +export default class UserAddonAdapter extends OsfAdapter { +} + +declare module 'ember-data/types/registries/adapter' { + export default interface AdapterRegistry { + 'user-addon': UserAddonAdapter; + } // eslint-disable-line semi +} diff --git a/app/models/addon.ts b/app/models/addon.ts new file mode 100644 index 00000000000..a915ed62fcb --- /dev/null +++ b/app/models/addon.ts @@ -0,0 +1,14 @@ +import { attr } from '@ember-data/model'; + +import OsfModel from './osf-model'; + +export default class AddonModel extends OsfModel { + @attr('string') name!: string; + @attr('array') categories!: string[]; +} + +declare module 'ember-data/types/registries/model' { + export default interface ModelRegistry { + addon: AddonModel; + } // eslint-disable-line semi +} diff --git a/app/models/external-accounts.ts b/app/models/external-accounts.ts new file mode 100644 index 00000000000..eb31df7eec9 --- /dev/null +++ b/app/models/external-accounts.ts @@ -0,0 +1,15 @@ +import { attr } from '@ember-data/model'; + +import OsfModel from './osf-model'; + +export default class ExternalAccountsModel extends OsfModel { + @attr('string') provider!: string; + @attr('fixstring') profileUrl?: string; + @attr('fixstring') displayName!: string; +} + +declare module 'ember-data/types/registries/model' { + export default interface ModelRegistry { + 'external-account': ExternalAccountsModel; + } // eslint-disable-line semi +} diff --git a/app/models/node-addon.ts b/app/models/node-addon.ts new file mode 100644 index 00000000000..6da8c330800 --- /dev/null +++ b/app/models/node-addon.ts @@ -0,0 +1,17 @@ +import { attr } from '@ember-data/model'; + +import OsfModel from './osf-model'; + +export default class NodeAddonModel extends OsfModel { + @attr('boolean') nodeHasAuth!: boolean; + @attr('boolean') configured!: boolean; + @attr('string') externalAccountId!: string; + @attr('string') folderId?: string; + @attr('string') folderPath?: string; +} + +declare module 'ember-data/types/registries/model' { + export default interface ModelRegistry { + 'node-addon': NodeAddonModel; + } // eslint-disable-line semi +} diff --git a/app/models/user-addon.ts b/app/models/user-addon.ts new file mode 100644 index 00000000000..e308c632253 --- /dev/null +++ b/app/models/user-addon.ts @@ -0,0 +1,19 @@ +import { AsyncHasMany, attr, hasMany } from '@ember-data/model'; + +import ExternalAccountsModel from 'ember-osf-web/models/external-accounts'; + +import OsfModel from './osf-model'; + + +export default class UserAddonModel extends OsfModel { + @attr('boolean') userHasAuth!: boolean; + + @hasMany('external-accounts', { inverse: null }) + externalAccounts!: AsyncHasMany & ExternalAccountsModel[]; +} + +declare module 'ember-data/types/registries/model' { + export default interface ModelRegistry { + 'user-addon': UserAddonModel; + } // eslint-disable-line semi +} diff --git a/app/serializers/addon.ts b/app/serializers/addon.ts new file mode 100644 index 00000000000..aa83937b2cc --- /dev/null +++ b/app/serializers/addon.ts @@ -0,0 +1,10 @@ +import OsfSerializer from './osf-serializer'; + +export default class AddonSerializer extends OsfSerializer { +} + +declare module 'ember-data/types/registries/serializer' { + export default interface SerializerRegistry { + addon: AddonSerializer; + } // eslint-disable-line semi +} diff --git a/app/serializers/external-account.ts b/app/serializers/external-account.ts new file mode 100644 index 00000000000..81eed717317 --- /dev/null +++ b/app/serializers/external-account.ts @@ -0,0 +1,10 @@ +import OsfSerializer from './osf-serializer'; + +export default class ExternalAccountSerializer extends OsfSerializer { +} + +declare module 'ember-data/types/registries/serializer' { + export default interface SerializerRegistry { + 'external-account': ExternalAccountSerializer; + } // eslint-disable-line semi +} diff --git a/app/serializers/node-addon.ts b/app/serializers/node-addon.ts new file mode 100644 index 00000000000..eef5e114dd7 --- /dev/null +++ b/app/serializers/node-addon.ts @@ -0,0 +1,10 @@ +import OsfSerializer from './osf-serializer'; + +export default class NodeAddonSerializer extends OsfSerializer { +} + +declare module 'ember-data/types/registries/serializer' { + export default interface SerializerRegistry { + 'node-addon': NodeAddonSerializer; + } // eslint-disable-line semi +} diff --git a/app/serializers/user-addon.ts b/app/serializers/user-addon.ts new file mode 100644 index 00000000000..78ced98caa6 --- /dev/null +++ b/app/serializers/user-addon.ts @@ -0,0 +1,10 @@ +import OsfSerializer from './osf-serializer'; + +export default class UserAddonSerializer extends OsfSerializer { +} + +declare module 'ember-data/types/registries/serializer' { + export default interface SerializerRegistry { + 'user-addon': UserAddonSerializer; + } // eslint-disable-line semi +}