Skip to content

Commit

Permalink
Moving api files to their own directory in td.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
lreading committed Feb 13, 2022
1 parent ec16e72 commit 773eb61
Show file tree
Hide file tree
Showing 21 changed files with 54 additions and 56 deletions.
2 changes: 1 addition & 1 deletion td.vue/src/components/ProviderLoginButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<script>
import { providerNames } from '@/service/provider/providers.js';
import { AUTH_SET_LOCAL } from '@/store/actions/auth.js';
import loginApi from '@/service/loginApi.js';
import loginApi from '@/service/api/loginApi.js';
import { PROVIDER_SELECTED } from '@/store/actions/provider.js';
export default {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import clientFactory from './httpClient.js';
import clientFactory from '../httpClient.js';

/**
* Does a GET request to the given resource
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion td.vue/src/store/modules/auth.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AUTH_CLEAR, AUTH_SET_JWT, AUTH_SET_LOCAL, LOGOUT } from '../actions/auth.js';
import { BRANCH_CLEAR } from '../actions/branch.js';
import loginApi from '../../service/loginApi.js';
import loginApi from '../../service/api/loginApi.js';
import { PROVIDER_CLEAR } from '../actions/provider.js';
import providers from '../../service/provider/providers.js';
import { REPOSITORY_CLEAR } from '../actions/repository.js';
Expand Down
2 changes: 1 addition & 1 deletion td.vue/src/store/modules/branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
BRANCH_FETCH,
BRANCH_SELECTED
} from '../actions/branch.js';
import threatmodelApi from '../../service/threatmodelApi.js';
import threatmodelApi from '../../service/api/threatmodelApi.js';

export const clearState = (state) => {
state.all.length = 0;
Expand Down
2 changes: 1 addition & 1 deletion td.vue/src/store/modules/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
REPOSITORY_FETCH,
REPOSITORY_SELECTED
} from '../actions/repository.js';
import threatmodelApi from '../../service/threatmodelApi.js';
import threatmodelApi from '../../service/api/threatmodelApi.js';

export const clearState = (state) => {
state.all.length = 0;
Expand Down
2 changes: 1 addition & 1 deletion td.vue/src/store/modules/threatmodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
THREATMODEL_SELECTED,
THREATMODEL_SET_IMMUTABLE_COPY
} from '../actions/threatmodel.js';
import threatmodelApi from '../../service/threatmodelApi.js';
import threatmodelApi from '../../service/api/threatmodelApi.js';

export const clearState = (state) => {
state.all.length = 0;
Expand Down
2 changes: 0 additions & 2 deletions td.vue/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
</style>

<script>
import { allProviders } from '@/service/provider/providers.js';
import TdProviderLoginButton from '@/components/ProviderLoginButton.vue';
Expand Down
2 changes: 1 addition & 1 deletion td.vue/src/views/OauthReturn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { mapState } from 'vuex';
import { AUTH_SET_JWT } from '@/store/actions/auth.js';
import loginApi from '@/service/loginApi.js';
import loginApi from '@/service/api/loginApi.js';
export default {
name: 'OAuthReturn',
Expand Down
2 changes: 1 addition & 1 deletion td.vue/tests/unit/components/providerLoginButton.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex';

import { AUTH_SET_LOCAL } from '@/store/actions/auth.js';
import loginApi from '@/service/loginApi.js';
import loginApi from '@/service/api/loginApi.js';
import { PROVIDER_SELECTED } from '@/store/actions/provider.js';
import TdProviderLoginButton from '@/components/ProviderLoginButton.vue';

Expand Down
2 changes: 1 addition & 1 deletion td.vue/tests/unit/service/api.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import api from '@/service/api.js';
import api from '@/service/api/api.js';
import httpClient from '@/service/httpClient.js';

describe('service/api.js', () => {
Expand Down
4 changes: 2 additions & 2 deletions td.vue/tests/unit/service/loginApi.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import api from '@/service/api.js';
import loginApi from '@/service/loginApi.js';
import api from '@/service/api/api.js';
import loginApi from '@/service/api/loginApi.js';

describe('service/loginApi.js', () => {
const provider = 'github';
Expand Down
4 changes: 2 additions & 2 deletions td.vue/tests/unit/service/threatmodelApi.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import api from '@/service/api.js';
import threatmodelApi from '@/service/threatmodelApi.js';
import api from '@/service/api/api.js';
import threatmodelApi from '@/service/api/threatmodelApi.js';

describe('service/threatmodelApi.js', () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion td.vue/tests/unit/store/modules/auth.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AUTH_CLEAR, AUTH_SET_JWT, AUTH_SET_LOCAL, LOGOUT } from '@/store/actions/auth.js';
import authModule, { clearState } from '@/store/modules/auth.js';
import { BRANCH_CLEAR } from '@/store/actions/branch.js';
import loginApi from '@/service/loginApi.js';
import loginApi from '@/service/api/loginApi.js';
import { PROVIDER_CLEAR } from '@/store/actions/provider.js';
import { REPOSITORY_CLEAR } from '@/store/actions/repository.js';
import { THREATMODEL_CLEAR } from '@/store/actions/threatmodel.js';
Expand Down
2 changes: 1 addition & 1 deletion td.vue/tests/unit/store/modules/branch.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BRANCH_CLEAR, BRANCH_FETCH, BRANCH_SELECTED } from '@/store/actions/branch.js';
import branchModule, { clearState } from '@/store/modules/branch.js';
import threatmodelApi from '@/service/threatmodelApi.js';
import threatmodelApi from '@/service/api/threatmodelApi.js';

describe('store/modules/branch.js', () => {
const mocks = {
Expand Down
2 changes: 1 addition & 1 deletion td.vue/tests/unit/store/modules/repository.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { REPOSITORY_CLEAR, REPOSITORY_FETCH, REPOSITORY_SELECTED } from '@/store/actions/repository.js';
import repoModule, { clearState } from '@/store/modules/repository.js';
import threatmodelApi from '@/service/threatmodelApi.js';
import threatmodelApi from '@/service/api/threatmodelApi.js';

describe('store/modules/repository.js', () => {
const mocks = {
Expand Down
2 changes: 1 addition & 1 deletion td.vue/tests/unit/store/modules/threatmodel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
THREATMODEL_SET_IMMUTABLE_COPY
} from '@/store/actions/threatmodel.js';
import threatmodelModule, { clearState } from '@/store/modules/threatmodel.js';
import threatmodelApi from '@/service/threatmodelApi.js';
import threatmodelApi from '@/service/api/threatmodelApi.js';
import { THREATMODEL_CONTRIBUTORS_UPDATED, THREATMODEL_RESTORE } from '../../../../src/store/actions/threatmodel';

describe('store/modules/threatmodel.js', () => {
Expand Down
2 changes: 1 addition & 1 deletion td.vue/tests/unit/views/home.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Vuex from 'vuex';

import { AUTH_SET_LOCAL } from '@/store/actions/auth.js';
import Home from '@/views/Home.vue';
import loginApi from '@/service/loginApi.js';
import loginApi from '@/service/api/loginApi.js';
import { PROVIDER_SELECTED } from '@/store/actions/provider.js';
import router from '@/router/index.js';
import TdProviderLoginButton from '@/components/ProviderLoginButton.vue';
Expand Down
2 changes: 1 addition & 1 deletion td.vue/tests/unit/views/oauthReturn.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex';

import { AUTH_SET_JWT } from '@/store/actions/auth.js';
import loginApi from '@/service/loginApi.js';
import loginApi from '@/service/api/loginApi.js';
import OAuthReturn from '@/views/OauthReturn.vue';

describe('views/OauthReturn.vue', () => {
Expand Down
70 changes: 35 additions & 35 deletions td.vue/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,51 +23,51 @@ module.exports = {
electronBuilder:{
mainProcessFile: './src/td.desktop.js',
builderOptions: {
"appId": "org.owasp.threatdragon",
"productName": "OWASP-Threat-Dragon",
"publish": {
"provider": "github"
'appId': 'org.owasp.threatdragon',
'productName': 'OWASP-Threat-Dragon',
'publish': {
'provider': 'github'
},
"afterSign": "electron-builder-notarize",
"mac": {
"category": "public.app-category.developer-tools",
"icon": "./src/icons/icon.icns",
"entitlements": "./node_modules/electron-builder-notarize/entitlements.mac.inherit.plist",
"hardenedRuntime": true,
"target": [
"dmg",
"zip"
'afterSign': 'electron-builder-notarize',
'mac': {
'category': 'public.app-category.developer-tools',
'icon': './src/icons/icon.icns',
'entitlements': './node_modules/electron-builder-notarize/entitlements.mac.inherit.plist',
'hardenedRuntime': true,
'target': [
'dmg',
'zip'
]
},
"win": {
"icon": "./src/icons/icon.ico",
"target": [
'win': {
'icon': './src/icons/icon.ico',
'target': [
{
"target": "nsis",
"arch": [
"ia32",
"x64"
'target': 'nsis',
'arch': [
'ia32',
'x64'
]
}
]
},
"linux": {
"category": "Development",
"executableName": "threat-dragon",
"icon": "./src/icons/td-256.png",
"synopsis": "OWASP Threat Dragon",
"target": [
"AppImage",
"snap",
"deb",
"rpm"
'linux': {
'category': 'Development',
'executableName': 'threat-dragon',
'icon': './src/icons/td-256.png',
'synopsis': 'OWASP Threat Dragon',
'target': [
'AppImage',
'snap',
'deb',
'rpm'
]
},
"snap": {
"grade": "stable",
"summary": "OWASP Threat Dragon, desktop version",
"description": "OWASP Threat Dragon is a free, open-source, cross-platform threat modelling application",
"title": "OWASP Threat Dragon"
'snap': {
'grade': 'stable',
'summary': 'OWASP Threat Dragon, desktop version',
'description': 'OWASP Threat Dragon is a free, open-source, cross-platform threat modelling application',
'title': 'OWASP Threat Dragon'
}
}
}
Expand Down

0 comments on commit 773eb61

Please sign in to comment.