Browse Source

New version of shared types, started requests mod

develop
Dale 3 months ago
parent
commit
4c16b7a601
8 changed files with 65 additions and 5 deletions
  1. +1
    -1
      package.json
  2. +0
    -0
     
  3. +3
    -0
      src/store/index.ts
  4. +31
    -0
      src/store/initialState.ts
  5. +17
    -0
      src/store/interfaces/resource.ts
  6. +9
    -0
      vue.config.js
  7. +2
    -2
      yarn.lock
  8. +2
    -2
      yarn.nix

+ 1
- 1
package.json View File

@@ -28,7 +28,7 @@
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-vue": "^6.2.2",
"miracle-tv-shared": "git+https://code.gensokyo.social/Gensokyo.social/miracle-tv-shared.git#16cee9d935",
"miracle-tv-shared": "git+https://code.gensokyo.social/Gensokyo.social/miracle-tv-shared.git#c2f78e7633",
"tslib": "^2.0.1",
"typescript": "~3.9.3",
"vue": "^2.6.11",


+ 0
- 0
View File


+ 3
- 0
src/store/index.ts View File

@@ -3,8 +3,11 @@ import Vuex from 'vuex';

Vue.use(Vuex);

import initialState from '@/store/initialState';

export default new Vuex.Store({
state: {
...initialState,
},
mutations: {
},


+ 31
- 0
src/store/initialState.ts View File

@@ -0,0 +1,31 @@
import IResource from '@/store/interfaces/resource';
import { IUserSafe } from 'miracle-tv-shared/src/types/api/v1/interfaces/IUser';
import IActivity from 'miracle-tv-shared/src/types/api/v1/interfaces/IActivity';
import IChannel from 'miracle-tv-shared/src/types/api/v1/interfaces/IChannel';
import IStreamKey from 'miracle-tv-shared/src/types/api/v1/interfaces/IStreamKey';

const emptyResource = {
ids: [],
errors: [],
entities: {},
};

interface IStore {
resources: {
users: IResource<IUserSafe>;
activities: IResource<IActivity>;
channels: IResource<IChannel>;
streamKeys: IResource<IStreamKey>;
};
}

const initialStore: IStore = {
resources: {
users: { ...emptyResource },
activities: { ...emptyResource },
channels: { ...emptyResource },
streamKeys: { ...emptyResource },
}
}

export default initialStore;

+ 17
- 0
src/store/interfaces/resource.ts View File

@@ -0,0 +1,17 @@
interface IResourceEntitiesMap<T> {
[index: string]: T,
}

interface IResourceError {
status: number;
message?: string;
meta?: { [key: string]: any };
};

export interface IResource<T> {
ids: string[];
errors: IResourceError[],
entities: IResourceEntitiesMap<T>;
}

export default IResource;

+ 9
- 0
vue.config.js View File

@@ -1,3 +1,12 @@
import path from 'path';

module.exports = {
lintOnSave: false,
configureWebpack: {
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
},
};

+ 2
- 2
yarn.lock View File

@@ -5115,9 +5115,9 @@ minipass@^3.0.0, minipass@^3.1.1:
dependencies:
yallist "^4.0.0"

"miracle-tv-shared@git+https://code.gensokyo.social/Gensokyo.social/miracle-tv-shared.git#16cee9d935":
"miracle-tv-shared@git+https://code.gensokyo.social/Gensokyo.social/miracle-tv-shared.git#c2f78e7633":
version "0.1.0"
resolved "git+https://code.gensokyo.social/Gensokyo.social/miracle-tv-shared.git#16cee9d935b16f58efc6737f00e905b59a71b694"
resolved "git+https://code.gensokyo.social/Gensokyo.social/miracle-tv-shared.git#c2f78e763359cc9e456046e993768e0e85ae4f3f"
dependencies:
typescript "^3.9.7"



+ 2
- 2
yarn.nix View File

@@ -5567,8 +5567,8 @@
let
repo = fetchgit {
url = "https://code.gensokyo.social/Gensokyo.social/miracle-tv-shared.git";
rev = "16cee9d935b16f58efc6737f00e905b59a71b694";
sha256 = "17dfvc1wjycvn8zpqz844g0m33sq67wzkc0n7a887qsj94hlbhzl";
rev = "c2f78e763359cc9e456046e993768e0e85ae4f3f";
sha256 = "05k6y4zg04dd3yfbjhp98m6jzk3xnl8s50i40kjmg0sfr8r4knfi";
};
in
runCommandNoCC "miracle-tv-shared.git" { buildInputs = [gnutar]; } ''


Loading…
Cancel
Save