From 40e6313df6c058d035620db9e6d50c95f885bde4 Mon Sep 17 00:00:00 2001 From: Akiomi Kamakura Date: Wed, 11 Aug 2021 19:33:30 +0900 Subject: [PATCH] Add v2 prefix --- src/__mocks__/api/{ => v2}/client.ts | 6 ++--- .../api/{ => v2}/indicator-property.ts | 2 +- .../api/{ => v2}/quarter-property.ts | 2 +- src/__mocks__/fixtures/{ => v2}/company.js | 0 .../fixtures/{ => v2}/indicator-property.js | 0 src/__mocks__/fixtures/{ => v2}/indicator.js | 0 .../fixtures/{ => v2}/quarter-property.js | 0 src/__mocks__/fixtures/{ => v2}/quarter.js | 0 src/api/company-service.test.ts | 4 +-- src/api/company-service.ts | 2 +- src/api/ondemand-api-period-range.test.ts | 4 +-- src/api/{ => v2}/caching-client.test.ts | 26 +++++++++---------- src/api/{ => v2}/caching-client.ts | 8 +++--- .../caching-indicator-property.test.ts | 10 +++---- .../{ => v2}/caching-indicator-property.ts | 2 +- .../{ => v2}/caching-quarter-property.test.ts | 10 +++---- src/api/{ => v2}/caching-quarter-property.ts | 2 +- src/api/{ => v2}/client.test.ts | 12 ++++----- src/api/{ => v2}/client.ts | 6 ++--- src/api/{ => v2}/indicator-property.test.ts | 4 +-- src/api/{ => v2}/indicator-property.ts | 0 src/api/{ => v2}/quarter-property.test.ts | 4 +-- src/api/{ => v2}/quarter-property.ts | 0 src/custom-functions/bcode-indicator.test.ts | 10 ++++--- src/custom-functions/bcode-indicator.ts | 4 +-- src/custom-functions/bcode-label.test.ts | 8 +++--- src/custom-functions/bcode-label.ts | 4 +-- src/custom-functions/bcode-quarter.test.ts | 10 ++++--- src/custom-functions/bcode-quarter.ts | 4 +-- src/custom-functions/bcode-unit.test.ts | 8 +++--- src/custom-functions/bcode-unit.ts | 4 +-- src/services/company-cache.test.ts | 2 +- src/services/csv-exporter.test.ts | 12 +++++---- src/services/csv-exporter.ts | 4 +-- src/services/indicator-cache.test.ts | 2 +- src/services/indicator-property-cache.test.ts | 2 +- src/services/quarter-cache.test.ts | 2 +- src/services/quarter-property-cache.test.ts | 2 +- 38 files changed, 94 insertions(+), 88 deletions(-) rename src/__mocks__/api/{ => v2}/client.ts (81%) rename src/__mocks__/api/{ => v2}/indicator-property.ts (88%) rename src/__mocks__/api/{ => v2}/quarter-property.ts (89%) rename src/__mocks__/fixtures/{ => v2}/company.js (100%) rename src/__mocks__/fixtures/{ => v2}/indicator-property.js (100%) rename src/__mocks__/fixtures/{ => v2}/indicator.js (100%) rename src/__mocks__/fixtures/{ => v2}/quarter-property.js (100%) rename src/__mocks__/fixtures/{ => v2}/quarter.js (100%) rename src/api/{ => v2}/caching-client.test.ts (85%) rename src/api/{ => v2}/caching-client.ts (85%) rename src/api/{ => v2}/caching-indicator-property.test.ts (64%) rename src/api/{ => v2}/caching-indicator-property.ts (81%) rename src/api/{ => v2}/caching-quarter-property.test.ts (64%) rename src/api/{ => v2}/caching-quarter-property.ts (81%) rename src/api/{ => v2}/client.test.ts (92%) rename src/api/{ => v2}/client.ts (94%) rename src/api/{ => v2}/indicator-property.test.ts (88%) rename src/api/{ => v2}/indicator-property.ts (100%) rename src/api/{ => v2}/quarter-property.test.ts (88%) rename src/api/{ => v2}/quarter-property.ts (100%) diff --git a/src/__mocks__/api/client.ts b/src/__mocks__/api/v2/client.ts similarity index 81% rename from src/__mocks__/api/client.ts rename to src/__mocks__/api/v2/client.ts index 1dee904..aa89b9c 100644 --- a/src/__mocks__/api/client.ts +++ b/src/__mocks__/api/v2/client.ts @@ -1,6 +1,6 @@ -import { default as company } from '../fixtures/company.js' -import { default as indicator } from '../fixtures/indicator.js' -import { default as quarter } from '../fixtures/quarter.js' +import { default as company } from '../../fixtures/v2/company.js' +import { default as indicator } from '../../fixtures/v2/indicator.js' +import { default as quarter } from '../../fixtures/v2/quarter.js' export class BuffettCodeApiClientV2 { public mockCompany = jest.fn() diff --git a/src/__mocks__/api/indicator-property.ts b/src/__mocks__/api/v2/indicator-property.ts similarity index 88% rename from src/__mocks__/api/indicator-property.ts rename to src/__mocks__/api/v2/indicator-property.ts index 432cf53..f9d7979 100644 --- a/src/__mocks__/api/indicator-property.ts +++ b/src/__mocks__/api/v2/indicator-property.ts @@ -1,4 +1,4 @@ -import { default as indicator } from '../fixtures/indicator-property' +import { default as indicator } from '../../fixtures/v2/indicator-property' export class IndicatorProperty { static fetch(): object { diff --git a/src/__mocks__/api/quarter-property.ts b/src/__mocks__/api/v2/quarter-property.ts similarity index 89% rename from src/__mocks__/api/quarter-property.ts rename to src/__mocks__/api/v2/quarter-property.ts index 09c2e37..39d7db0 100644 --- a/src/__mocks__/api/quarter-property.ts +++ b/src/__mocks__/api/v2/quarter-property.ts @@ -1,4 +1,4 @@ -import { default as quarter } from '../fixtures/quarter-property' +import { default as quarter } from '../../fixtures/v2/quarter-property' export class QuarterProperty { static fetch(): object { diff --git a/src/__mocks__/fixtures/company.js b/src/__mocks__/fixtures/v2/company.js similarity index 100% rename from src/__mocks__/fixtures/company.js rename to src/__mocks__/fixtures/v2/company.js diff --git a/src/__mocks__/fixtures/indicator-property.js b/src/__mocks__/fixtures/v2/indicator-property.js similarity index 100% rename from src/__mocks__/fixtures/indicator-property.js rename to src/__mocks__/fixtures/v2/indicator-property.js diff --git a/src/__mocks__/fixtures/indicator.js b/src/__mocks__/fixtures/v2/indicator.js similarity index 100% rename from src/__mocks__/fixtures/indicator.js rename to src/__mocks__/fixtures/v2/indicator.js diff --git a/src/__mocks__/fixtures/quarter-property.js b/src/__mocks__/fixtures/v2/quarter-property.js similarity index 100% rename from src/__mocks__/fixtures/quarter-property.js rename to src/__mocks__/fixtures/v2/quarter-property.js diff --git a/src/__mocks__/fixtures/quarter.js b/src/__mocks__/fixtures/v2/quarter.js similarity index 100% rename from src/__mocks__/fixtures/quarter.js rename to src/__mocks__/fixtures/v2/quarter.js diff --git a/src/api/company-service.test.ts b/src/api/company-service.test.ts index ef19995..d76b1e6 100644 --- a/src/api/company-service.test.ts +++ b/src/api/company-service.test.ts @@ -1,9 +1,9 @@ import { CompanyService } from './company-service' -import { CachingBuffettCodeApiClientV2 } from '../api/caching-client' +import { CachingBuffettCodeApiClientV2 } from './v2/caching-client' import { YearQuarter } from '../fiscal-periods/year-quarter' import { YearQuarterParam } from '../fiscal-periods/year-quarter-param' -jest.mock('../api/client', () => jest.requireActual('../__mocks__/api/client')) +jest.mock('./v2/client', () => jest.requireActual('../__mocks__/api/v2/client')) jest.mock('../services/company-cache', () => jest.requireActual('../__mocks__/services/company-cache') ) diff --git a/src/api/company-service.ts b/src/api/company-service.ts index 7011c28..2eb7f68 100644 --- a/src/api/company-service.ts +++ b/src/api/company-service.ts @@ -1,4 +1,4 @@ -import { BuffettCodeApiClientV2 } from '../api/client' +import { BuffettCodeApiClientV2 } from './v2/client' import { YearQuarter } from '../fiscal-periods/year-quarter' import { YearQuarterParam } from '../fiscal-periods/year-quarter-param' diff --git a/src/api/ondemand-api-period-range.test.ts b/src/api/ondemand-api-period-range.test.ts index e59b57a..227487f 100644 --- a/src/api/ondemand-api-period-range.test.ts +++ b/src/api/ondemand-api-period-range.test.ts @@ -1,10 +1,10 @@ -import { CachingBuffettCodeApiClientV2 } from './caching-client' +import { CachingBuffettCodeApiClientV2 } from './v2/caching-client' import { CompanyService } from './company-service' import { OndemandApiPeriodRange } from './ondemand-api-period-range' import { YearQuarter } from '../fiscal-periods/year-quarter' import { YearQuarterRange } from '../fiscal-periods/year-quarter-range' -jest.mock('../api/client', () => jest.requireActual('../__mocks__/api/client')) +jest.mock('./v2/client', () => jest.requireActual('../__mocks__/api/v2/client')) jest.mock('../services/company-cache', () => jest.requireActual('../__mocks__/services/company-cache') ) diff --git a/src/api/caching-client.test.ts b/src/api/v2/caching-client.test.ts similarity index 85% rename from src/api/caching-client.test.ts rename to src/api/v2/caching-client.test.ts index f0c025d..cbfdb7f 100644 --- a/src/api/caching-client.test.ts +++ b/src/api/v2/caching-client.test.ts @@ -1,19 +1,19 @@ import { CachingBuffettCodeApiClientV2 } from './caching-client' -import { YearQuarter } from '../fiscal-periods/year-quarter' -import { YearQuarterParam } from '../fiscal-periods/year-quarter-param' -import { CompanyCache } from '../__mocks__/services/company-cache' -import { IndicatorCache } from '../services/indicator-cache' -import { QuarterCache } from '../__mocks__/services/quarter-cache' - -jest.mock('./client', () => jest.requireActual('../__mocks__/api/client')) -jest.mock('../services/company-cache', () => - jest.requireActual('../__mocks__/services/company-cache') +import { YearQuarter } from '../../fiscal-periods/year-quarter' +import { YearQuarterParam } from '../../fiscal-periods/year-quarter-param' +import { CompanyCache } from '../../__mocks__/services/company-cache' +import { IndicatorCache } from '../../services/indicator-cache' +import { QuarterCache } from '../../__mocks__/services/quarter-cache' + +jest.mock('./client', () => jest.requireActual('../../__mocks__/api/v2/client')) +jest.mock('../../services/company-cache', () => + jest.requireActual('../../__mocks__/services/company-cache') ) -jest.mock('../services/indicator-cache', () => - jest.requireActual('../__mocks__/services/indicator-cache') +jest.mock('../../services/indicator-cache', () => + jest.requireActual('../../__mocks__/services/indicator-cache') ) -jest.mock('../services/quarter-cache', () => - jest.requireActual('../__mocks__/services/quarter-cache') +jest.mock('../../services/quarter-cache', () => + jest.requireActual('../../__mocks__/services/quarter-cache') ) describe('company', () => { diff --git a/src/api/caching-client.ts b/src/api/v2/caching-client.ts similarity index 85% rename from src/api/caching-client.ts rename to src/api/v2/caching-client.ts index 3263330..f881a73 100644 --- a/src/api/caching-client.ts +++ b/src/api/v2/caching-client.ts @@ -1,8 +1,8 @@ import { BuffettCodeApiClientV2 } from './client' -import { YearQuarterParam } from '../fiscal-periods/year-quarter-param' -import { CompanyCache } from '../services/company-cache' -import { IndicatorCache } from '../services/indicator-cache' -import { QuarterCache } from '../services/quarter-cache' +import { YearQuarterParam } from '../../fiscal-periods/year-quarter-param' +import { CompanyCache } from '../../services/company-cache' +import { IndicatorCache } from '../../services/indicator-cache' +import { QuarterCache } from '../../services/quarter-cache' export class CachingBuffettCodeApiClientV2 extends BuffettCodeApiClientV2 { constructor(token: string) { diff --git a/src/api/caching-indicator-property.test.ts b/src/api/v2/caching-indicator-property.test.ts similarity index 64% rename from src/api/caching-indicator-property.test.ts rename to src/api/v2/caching-indicator-property.test.ts index 00bcbe9..7f3b220 100644 --- a/src/api/caching-indicator-property.test.ts +++ b/src/api/v2/caching-indicator-property.test.ts @@ -1,12 +1,12 @@ import { CachingIndicatorProperty } from './caching-indicator-property' -import { IndicatorPropertyCache } from '../services/indicator-property-cache' +import { IndicatorPropertyCache } from '../../services/indicator-property-cache' -jest.mock('../api/indicator-property', () => - jest.requireActual('../__mocks__/api/indicator-property') +jest.mock('./indicator-property', () => + jest.requireActual('../../__mocks__/api/v2/indicator-property') ) -jest.mock('../services/indicator-property-cache', () => - jest.requireActual('../__mocks__/services/indicator-property-cache') +jest.mock('../../services/indicator-property-cache', () => + jest.requireActual('../../__mocks__/services/indicator-property-cache') ) describe('fetch', () => { diff --git a/src/api/caching-indicator-property.ts b/src/api/v2/caching-indicator-property.ts similarity index 81% rename from src/api/caching-indicator-property.ts rename to src/api/v2/caching-indicator-property.ts index 6be77f5..6bcd96f 100644 --- a/src/api/caching-indicator-property.ts +++ b/src/api/v2/caching-indicator-property.ts @@ -1,5 +1,5 @@ import { IndicatorProperty } from './indicator-property' -import { IndicatorPropertyCache } from '../services/indicator-property-cache' +import { IndicatorPropertyCache } from '../../services/indicator-property-cache' export class CachingIndicatorProperty extends IndicatorProperty { static fetch(): object { diff --git a/src/api/caching-quarter-property.test.ts b/src/api/v2/caching-quarter-property.test.ts similarity index 64% rename from src/api/caching-quarter-property.test.ts rename to src/api/v2/caching-quarter-property.test.ts index 8c73648..03a7809 100644 --- a/src/api/caching-quarter-property.test.ts +++ b/src/api/v2/caching-quarter-property.test.ts @@ -1,12 +1,12 @@ import { CachingQuarterProperty } from './caching-quarter-property' -import { QuarterPropertyCache } from '../services/quarter-property-cache' +import { QuarterPropertyCache } from '../../services/quarter-property-cache' -jest.mock('../api/quarter-property', () => - jest.requireActual('../__mocks__/api/quarter-property') +jest.mock('./quarter-property', () => + jest.requireActual('../../__mocks__/api/v2/quarter-property') ) -jest.mock('../services/quarter-property-cache', () => - jest.requireActual('../__mocks__/services/quarter-property-cache') +jest.mock('../../services/quarter-property-cache', () => + jest.requireActual('../../__mocks__/services/quarter-property-cache') ) describe('fetch', () => { diff --git a/src/api/caching-quarter-property.ts b/src/api/v2/caching-quarter-property.ts similarity index 81% rename from src/api/caching-quarter-property.ts rename to src/api/v2/caching-quarter-property.ts index 1e7aa5f..82fbb20 100644 --- a/src/api/caching-quarter-property.ts +++ b/src/api/v2/caching-quarter-property.ts @@ -1,5 +1,5 @@ import { QuarterProperty } from './quarter-property' -import { QuarterPropertyCache } from '../services/quarter-property-cache' +import { QuarterPropertyCache } from '../../services/quarter-property-cache' export class CachingQuarterProperty extends QuarterProperty { static fetch(): object { diff --git a/src/api/client.test.ts b/src/api/v2/client.test.ts similarity index 92% rename from src/api/client.test.ts rename to src/api/v2/client.test.ts index 73361ed..eb00780 100644 --- a/src/api/client.test.ts +++ b/src/api/v2/client.test.ts @@ -1,10 +1,10 @@ import { BuffettCodeApiClientV2 } from './client' -import { HttpError } from './http-error' -import { YearQuarterParam } from '../fiscal-periods/year-quarter-param' -import { useMockedUrlFetchApp } from './test-helper' -import * as company from '../__mocks__/fixtures/company' -import * as indicator from '../__mocks__/fixtures/indicator' -import * as quarter from '../__mocks__/fixtures/quarter' +import { HttpError } from '../http-error' +import { YearQuarterParam } from '../../fiscal-periods/year-quarter-param' +import { useMockedUrlFetchApp } from '../test-helper' +import * as company from '../../__mocks__/fixtures/v2/company' +import * as indicator from '../../__mocks__/fixtures/v2/indicator' +import * as quarter from '../../__mocks__/fixtures/v2/quarter' test('HttpError#isInvalidTestingRequest', () => { const res1 = useMockedUrlFetchApp( diff --git a/src/api/client.ts b/src/api/v2/client.ts similarity index 94% rename from src/api/client.ts rename to src/api/v2/client.ts index 583bde3..54a2896 100644 --- a/src/api/client.ts +++ b/src/api/v2/client.ts @@ -1,6 +1,6 @@ -import { YearQuarterParam } from '../fiscal-periods/year-quarter-param' -import { UrlBuilder } from './url-builder' -import { HttpError } from './http-error' +import { YearQuarterParam } from '../../fiscal-periods/year-quarter-param' +import { UrlBuilder } from '../url-builder' +import { HttpError } from '../http-error' export class BuffettCodeApiClientV2 { static readonly baseUrl = 'https://api.buffett-code.com/api/v2' diff --git a/src/api/indicator-property.test.ts b/src/api/v2/indicator-property.test.ts similarity index 88% rename from src/api/indicator-property.test.ts rename to src/api/v2/indicator-property.test.ts index 1ea68f2..edb5d87 100644 --- a/src/api/indicator-property.test.ts +++ b/src/api/v2/indicator-property.test.ts @@ -1,7 +1,7 @@ import { IndicatorProperty } from './indicator-property' -import { useMockedUrlFetchApp } from './test-helper' +import { useMockedUrlFetchApp } from '../test-helper' -import { default as indicator } from '../__mocks__/fixtures/indicator-property' +import { default as indicator } from '../../__mocks__/fixtures/v2/indicator-property' test('isIndicatorProperty', () => { useMockedUrlFetchApp(200, JSON.stringify(indicator)) diff --git a/src/api/indicator-property.ts b/src/api/v2/indicator-property.ts similarity index 100% rename from src/api/indicator-property.ts rename to src/api/v2/indicator-property.ts diff --git a/src/api/quarter-property.test.ts b/src/api/v2/quarter-property.test.ts similarity index 88% rename from src/api/quarter-property.test.ts rename to src/api/v2/quarter-property.test.ts index af56cc1..588539a 100644 --- a/src/api/quarter-property.test.ts +++ b/src/api/v2/quarter-property.test.ts @@ -1,7 +1,7 @@ import { QuarterProperty } from './quarter-property' -import { useMockedUrlFetchApp } from './test-helper' +import { useMockedUrlFetchApp } from '../test-helper' -import { default as quarter } from '../__mocks__/fixtures/quarter-property' +import { default as quarter } from '../../__mocks__/fixtures/v2/quarter-property' test('isQuarterProperty', () => { useMockedUrlFetchApp(200, JSON.stringify(quarter)) diff --git a/src/api/quarter-property.ts b/src/api/v2/quarter-property.ts similarity index 100% rename from src/api/quarter-property.ts rename to src/api/v2/quarter-property.ts diff --git a/src/custom-functions/bcode-indicator.test.ts b/src/custom-functions/bcode-indicator.test.ts index 5b63792..c5a073f 100644 --- a/src/custom-functions/bcode-indicator.test.ts +++ b/src/custom-functions/bcode-indicator.test.ts @@ -1,12 +1,14 @@ import { bcodeIndicator } from './bcode-indicator' -import { CachingBuffettCodeApiClientV2 } from '../api/caching-client' +import { CachingBuffettCodeApiClientV2 } from '../api/v2/caching-client' import { IndicatorCache } from '../services/indicator-cache' import { IndicatorPropertyCache } from '../services/indicator-property-cache' import { BcodeResult } from './bcode-result' -jest.mock('../api/client', () => jest.requireActual('../__mocks__/api/client')) -jest.mock('../api/indicator-property', () => - jest.requireActual('../__mocks__/api/indicator-property') +jest.mock('../api/v2/client', () => + jest.requireActual('../__mocks__/api/v2/client') +) +jest.mock('../api/v2/indicator-property', () => + jest.requireActual('../__mocks__/api/v2/indicator-property') ) jest.mock('../services/indicator-cache', () => jest.requireActual('../__mocks__/services/indicator-cache') diff --git a/src/custom-functions/bcode-indicator.ts b/src/custom-functions/bcode-indicator.ts index 5dfbaa7..1e5d2bb 100644 --- a/src/custom-functions/bcode-indicator.ts +++ b/src/custom-functions/bcode-indicator.ts @@ -1,6 +1,6 @@ import { ApiResponseError } from './error' -import { CachingBuffettCodeApiClientV2 } from '../api/caching-client' -import { CachingIndicatorProperty } from '../api/caching-indicator-property' +import { CachingBuffettCodeApiClientV2 } from '../api/v2/caching-client' +import { CachingIndicatorProperty } from '../api/v2/caching-indicator-property' import { BcodeResult } from './bcode-result' export function bcodeIndicator( diff --git a/src/custom-functions/bcode-label.test.ts b/src/custom-functions/bcode-label.test.ts index 15946d2..2e7e2af 100644 --- a/src/custom-functions/bcode-label.test.ts +++ b/src/custom-functions/bcode-label.test.ts @@ -2,11 +2,11 @@ import { bcodeLabel } from './bcode-label' import { IndicatorPropertyCache } from '../services/indicator-property-cache' import { QuarterPropertyCache } from '../services/quarter-property-cache' -jest.mock('../api/indicator-property', () => - jest.requireActual('../__mocks__/api/indicator-property') +jest.mock('../api/v2/indicator-property', () => + jest.requireActual('../__mocks__/api/v2/indicator-property') ) -jest.mock('../api/quarter-property', () => - jest.requireActual('../__mocks__/api/quarter-property') +jest.mock('../api/v2/quarter-property', () => + jest.requireActual('../__mocks__/api/v2/quarter-property') ) jest.mock('../services/indicator-property-cache', () => jest.requireActual('../__mocks__/services/indicator-property-cache') diff --git a/src/custom-functions/bcode-label.ts b/src/custom-functions/bcode-label.ts index ec004d8..9484123 100644 --- a/src/custom-functions/bcode-label.ts +++ b/src/custom-functions/bcode-label.ts @@ -1,5 +1,5 @@ -import { CachingIndicatorProperty } from '../api/caching-indicator-property' -import { CachingQuarterProperty } from '../api/caching-quarter-property' +import { CachingIndicatorProperty } from '../api/v2/caching-indicator-property' +import { CachingQuarterProperty } from '../api/v2/caching-quarter-property' export function bcodeLabel(propertyName: string): string { if (!propertyName) { diff --git a/src/custom-functions/bcode-quarter.test.ts b/src/custom-functions/bcode-quarter.test.ts index aeeecb4..9affa39 100644 --- a/src/custom-functions/bcode-quarter.test.ts +++ b/src/custom-functions/bcode-quarter.test.ts @@ -1,13 +1,15 @@ import { bcodeQuarter } from './bcode-quarter' -import { CachingBuffettCodeApiClientV2 } from '../api/caching-client' +import { CachingBuffettCodeApiClientV2 } from '../api/v2/caching-client' import { QuarterCache } from '../__mocks__/services/quarter-cache' import { QuarterPropertyCache } from '../services/quarter-property-cache' import { BcodeResult } from './bcode-result' import { YearQuarter } from '../fiscal-periods/year-quarter' -jest.mock('../api/client', () => jest.requireActual('../__mocks__/api/client')) -jest.mock('../api/quarter-property', () => - jest.requireActual('../__mocks__/api/quarter-property') +jest.mock('../api/v2/client', () => + jest.requireActual('../__mocks__/api/v2/client') +) +jest.mock('../api/v2/quarter-property', () => + jest.requireActual('../__mocks__/api/v2/quarter-property') ) jest.mock('../services/company-cache', () => jest.requireActual('../__mocks__/services/company-cache') diff --git a/src/custom-functions/bcode-quarter.ts b/src/custom-functions/bcode-quarter.ts index a27bcc4..7ca4e0b 100644 --- a/src/custom-functions/bcode-quarter.ts +++ b/src/custom-functions/bcode-quarter.ts @@ -3,8 +3,8 @@ import { OndemandApiNotEnabledError, UnsupportedTickerError } from './error' -import { CachingBuffettCodeApiClientV2 } from '../api/caching-client' -import { CachingQuarterProperty } from '../api/caching-quarter-property' +import { CachingBuffettCodeApiClientV2 } from '../api/v2/caching-client' +import { CachingQuarterProperty } from '../api/v2/caching-quarter-property' import { CompanyService } from '../api/company-service' import { BcodeResult } from './bcode-result' import { YearQuarterParam } from '../fiscal-periods/year-quarter-param' diff --git a/src/custom-functions/bcode-unit.test.ts b/src/custom-functions/bcode-unit.test.ts index 7f6d719..feccb98 100644 --- a/src/custom-functions/bcode-unit.test.ts +++ b/src/custom-functions/bcode-unit.test.ts @@ -2,11 +2,11 @@ import { bcodeUnit } from './bcode-unit' import { IndicatorPropertyCache } from '../services/indicator-property-cache' import { QuarterPropertyCache } from '../services/quarter-property-cache' -jest.mock('../api/indicator-property', () => - jest.requireActual('../__mocks__/api/indicator-property') +jest.mock('../api/v2/indicator-property', () => + jest.requireActual('../__mocks__/api/v2/indicator-property') ) -jest.mock('../api/quarter-property', () => - jest.requireActual('../__mocks__/api/quarter-property') +jest.mock('../api/v2/quarter-property', () => + jest.requireActual('../__mocks__/api/v2/quarter-property') ) jest.mock('../services/indicator-property-cache', () => jest.requireActual('../__mocks__/services/indicator-property-cache') diff --git a/src/custom-functions/bcode-unit.ts b/src/custom-functions/bcode-unit.ts index 500ec02..4390352 100644 --- a/src/custom-functions/bcode-unit.ts +++ b/src/custom-functions/bcode-unit.ts @@ -1,5 +1,5 @@ -import { CachingIndicatorProperty } from '../api/caching-indicator-property' -import { CachingQuarterProperty } from '../api/caching-quarter-property' +import { CachingIndicatorProperty } from '../api/v2/caching-indicator-property' +import { CachingQuarterProperty } from '../api/v2/caching-quarter-property' export function bcodeUnit(propertyName: string): string { if (!propertyName) { diff --git a/src/services/company-cache.test.ts b/src/services/company-cache.test.ts index bb3287e..88ff5b6 100644 --- a/src/services/company-cache.test.ts +++ b/src/services/company-cache.test.ts @@ -1,5 +1,5 @@ import { CompanyCache } from './company-cache' -import * as companyFixture from '../__mocks__/fixtures/company' +import * as companyFixture from '../__mocks__/fixtures/v2/company' import { getMock, putMock } from './cache-test-helper' const companies = companyFixture.default diff --git a/src/services/csv-exporter.test.ts b/src/services/csv-exporter.test.ts index 3e1f2f4..2465b6a 100644 --- a/src/services/csv-exporter.test.ts +++ b/src/services/csv-exporter.test.ts @@ -1,14 +1,16 @@ import { CsvExporter } from './csv-exporter' import { QuarterCache } from './quarter-cache' -import { QuarterProperty } from '../api/quarter-property' +import { QuarterProperty } from '../api/v2/quarter-property' import { YearQuarter } from '../fiscal-periods/year-quarter' -import { default as quarter } from '../__mocks__/fixtures/quarter-property' +import { default as quarter } from '../__mocks__/fixtures/v2/quarter-property' jest.mock('../setting') -jest.mock('../api/client', () => jest.requireActual('../__mocks__/api/client')) -jest.mock('../api/quarter-property', () => - jest.requireActual('../__mocks__/api/quarter-property') +jest.mock('../api/v2/client', () => + jest.requireActual('../__mocks__/api/v2/client') +) +jest.mock('../api/v2/quarter-property', () => + jest.requireActual('../__mocks__/api/v2/quarter-property') ) jest.mock('../services/quarter-property-cache', () => jest.requireActual('../__mocks__/services/quarter-property-cache') diff --git a/src/services/csv-exporter.ts b/src/services/csv-exporter.ts index 9501695..f7c2b9c 100644 --- a/src/services/csv-exporter.ts +++ b/src/services/csv-exporter.ts @@ -1,9 +1,9 @@ -import { CachingBuffettCodeApiClientV2 } from '../api/caching-client' +import { CachingBuffettCodeApiClientV2 } from '../api/v2/caching-client' import { Setting } from '../setting' import { YearQuarter } from '../fiscal-periods/year-quarter' import { YearQuarterRange } from '../fiscal-periods/year-quarter-range' import { YearQuarterParam } from '../fiscal-periods/year-quarter-param' -import { CachingQuarterProperty } from '../api/caching-quarter-property' +import { CachingQuarterProperty } from '../api/v2/caching-quarter-property' import { OndemandApiPeriodRange } from '../api/ondemand-api-period-range' import { CompanyService } from '../api/company-service' diff --git a/src/services/indicator-cache.test.ts b/src/services/indicator-cache.test.ts index 8b2f11e..733aab7 100644 --- a/src/services/indicator-cache.test.ts +++ b/src/services/indicator-cache.test.ts @@ -1,5 +1,5 @@ import { IndicatorCache } from './indicator-cache' -import * as indicatorFixture from '../__mocks__/fixtures/indicator' +import * as indicatorFixture from '../__mocks__/fixtures/v2/indicator' import { getMock, putMock } from './cache-test-helper' test('key', () => { diff --git a/src/services/indicator-property-cache.test.ts b/src/services/indicator-property-cache.test.ts index 048b9b9..2600724 100644 --- a/src/services/indicator-property-cache.test.ts +++ b/src/services/indicator-property-cache.test.ts @@ -1,5 +1,5 @@ import { IndicatorPropertyCache } from './indicator-property-cache' -import * as indicatorProperty from '../__mocks__/fixtures/indicator-property' +import * as indicatorProperty from '../__mocks__/fixtures/v2/indicator-property' import { getMock, putMock } from './cache-test-helper' test('get', () => { diff --git a/src/services/quarter-cache.test.ts b/src/services/quarter-cache.test.ts index 2b20936..4b74057 100644 --- a/src/services/quarter-cache.test.ts +++ b/src/services/quarter-cache.test.ts @@ -1,6 +1,6 @@ import { QuarterCache } from './quarter-cache' import { YearQuarter } from '../fiscal-periods/year-quarter' -import * as quarterFixture from '../__mocks__/fixtures/quarter' +import * as quarterFixture from '../__mocks__/fixtures/v2/quarter' import { getMock, putMock } from './cache-test-helper' test('key', () => { diff --git a/src/services/quarter-property-cache.test.ts b/src/services/quarter-property-cache.test.ts index efd2bfa..c31a026 100644 --- a/src/services/quarter-property-cache.test.ts +++ b/src/services/quarter-property-cache.test.ts @@ -1,5 +1,5 @@ import { QuarterPropertyCache } from './quarter-property-cache' -import * as quarterProperty from '../__mocks__/fixtures/quarter-property' +import * as quarterProperty from '../__mocks__/fixtures/v2/quarter-property' import { getMock, putMock } from './cache-test-helper' test('get', () => {