@rr0/cms 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseReplaceCommand.d.ts +2 -2
- package/dist/DefaultContentVisitor.d.ts +11 -11
- package/dist/DescriptionReplaceCommand.d.ts +3 -3
- package/dist/ImageCommand.d.ts +3 -3
- package/dist/MetaLinkReplaceCommand.d.ts +3 -3
- package/dist/OpenGraphCommand.d.ts +6 -6
- package/dist/OpenGraphCommand.js +1 -1
- package/dist/RR0ContentStep.d.ts +11 -11
- package/dist/RR0ContentStep.js +2 -2
- package/dist/{RR0SsgContext.d.ts → RR0Context.d.ts} +8 -8
- package/dist/{RR0SsgContext.js → RR0Context.js} +4 -4
- package/dist/anchor/AnchorHandler.d.ts +2 -2
- package/dist/anchor/AnchorReplaceCommand.d.ts +2 -2
- package/dist/anchor/AnchorReplacer.d.ts +3 -3
- package/dist/anchor/CaseAnchorHandler.d.ts +2 -2
- package/dist/anchor/CaseAnchorHandler.js +2 -2
- package/dist/anchor/DataAnchorHandler.d.ts +6 -6
- package/dist/book/BookContentVisitor.d.ts +2 -2
- package/dist/book/BookDirectoryStep.d.ts +5 -5
- package/dist/book/BookService.d.ts +3 -1
- package/dist/book/BookService.js +4 -4
- package/dist/book/Chapters.d.ts +3 -3
- package/dist/book/Chapters.js +2 -2
- package/dist/build.js +27 -8
- package/dist/data/AbstractDataFactory.d.ts +3 -2
- package/dist/data/AbstractDataFactory.js +1 -1
- package/dist/data/AbstractDataService.d.ts +2 -3
- package/dist/data/AbstractDataService.js +2 -8
- package/dist/data/RR0Data.d.ts +4 -3
- package/dist/data/TypedDataFactory.d.ts +3 -2
- package/dist/data/TypedDataFactory.js +4 -0
- package/dist/data/index.d.ts +1 -1
- package/dist/data/index.js +1 -1
- package/dist/index/IndexedReplacer.d.ts +4 -4
- package/dist/index/IndexedReplacerFactory.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lang/LanguageReplaceCommand.d.ts +3 -3
- package/dist/lang/RR0Messages.d.ts +1 -1
- package/dist/lang/RR0Messages_en.d.ts +1 -1
- package/dist/lang/RR0Messages_en.js +1 -1
- package/dist/lang/RR0Messages_fr.d.ts +1 -1
- package/dist/lang/RR0Messages_fr.js +1 -1
- package/dist/note/NoteFileCounter.d.ts +2 -2
- package/dist/note/NoteRenderer.d.ts +2 -2
- package/dist/note/NoteReplacer.d.ts +2 -2
- package/dist/note/NoteReplacerFactory.d.ts +2 -2
- package/dist/org/OrgMessages.d.ts +2 -2
- package/dist/org/Organization.d.ts +3 -3
- package/dist/org/Organization.js +3 -3
- package/dist/org/OrganizationMessages.d.ts +3 -3
- package/dist/org/OrganizationService.d.ts +4 -3
- package/dist/org/OrganizationService.js +10 -9
- package/dist/org/au/region/vic/index.d.ts +1 -1
- package/dist/org/au/region/vic/index.js +1 -1
- package/dist/org/br/region/cw/CentralWest.js +1 -1
- package/dist/org/br/region/se/SouthEast.js +1 -1
- package/dist/org/country/region/department/city/CityService.d.ts +2 -2
- package/dist/org/country/region/department/city/CityService.js +2 -1
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanCaseSummary.d.ts +1 -1
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanCaseSummaryRR0Mapper.d.ts +4 -4
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanCaseSummaryRR0Mapper.js +1 -1
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanCaseToSummaryMapper.d.ts +3 -3
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanCaseToSummaryMapper.js +1 -1
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanDatasource.d.ts +3 -3
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanFileDatasource.d.ts +3 -3
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanHttpDatasource.d.ts +6 -5
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanSummaryToCaseMapper.d.ts +3 -3
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanTestCases.js +1 -1
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanTestimonial.d.ts +1 -1
- package/dist/org/us/region/fl/Florida.js +1 -1
- package/dist/org/us/region/hi/Hawaii.js +1 -1
- package/dist/org/us/region/in/Indiana.js +1 -1
- package/dist/org/us/region/va/Virginia.js +1 -1
- package/dist/org/us/region/wa/Washington.js +1 -1
- package/dist/org/us/region/wv/WestVirginia.js +1 -1
- package/dist/people/PeopleDirectoryStep.d.ts +4 -4
- package/dist/people/PeopleReplacer.d.ts +3 -3
- package/dist/people/PeopleReplacerFactory.d.ts +2 -2
- package/dist/people/PeopleService.d.ts +3 -4
- package/dist/people/PeopleService.js +3 -14
- package/dist/people/author/AuthorReplaceCommand.d.ts +2 -2
- package/dist/people/witness/WitnessReplacer.d.ts +2 -2
- package/dist/people/witness/WitnessReplacerFactory.d.ts +2 -2
- package/dist/place/GooglePlaceService.d.ts +1 -1
- package/dist/place/GooglePlaceService.js +1 -1
- package/dist/place/Place.d.ts +1 -1
- package/dist/place/Place.js +1 -1
- package/dist/place/PlaceService.d.ts +1 -1
- package/dist/place/PlaceService.js +1 -1
- package/dist/place/index.d.ts +0 -4
- package/dist/place/index.js +0 -4
- package/dist/science/crypto/ufo/enquete/dossier/CaseDirectoryStep.d.ts +5 -5
- package/dist/science/crypto/ufo/enquete/dossier/CaseDirectoryStep.js +1 -1
- package/dist/science/crypto/ufo/enquete/dossier/CaseService.d.ts +3 -3
- package/dist/science/crypto/ufo/enquete/dossier/CaseService.js +2 -2
- package/dist/search/SearchVisitor.d.ts +5 -5
- package/dist/source/Source.d.ts +1 -1
- package/dist/source/SourceFactory.d.ts +4 -4
- package/dist/source/SourceFactory.js +3 -2
- package/dist/source/SourceFileCounter.d.ts +2 -2
- package/dist/source/SourceRegistry.d.ts +2 -2
- package/dist/source/SourceRenderer.d.ts +3 -3
- package/dist/source/SourceRenderer.js +2 -2
- package/dist/source/SourceReplacer.d.ts +3 -3
- package/dist/source/SourceReplacerFactory.d.ts +2 -2
- package/dist/tech/info/soft/proj/impl/lang/CodeReplacer.d.ts +3 -3
- package/dist/tech/info/soft/proj/impl/lang/CodeReplacerFactory.d.ts +2 -2
- package/dist/time/CaseSummaryRenderer.d.ts +1 -1
- package/dist/time/EventRenderer.d.ts +7 -7
- package/dist/time/EventReplacerFactory.d.ts +4 -4
- package/dist/time/SsiTitleReplaceCommand.d.ts +2 -2
- package/dist/time/Time.d.ts +5 -3
- package/dist/time/Time.js +31 -5
- package/dist/time/TimeLinkDefaultHandler.d.ts +10 -9
- package/dist/time/TimeLinkDefaultHandler.js +8 -12
- package/dist/time/TimeService.d.ts +16 -7
- package/dist/time/TimeService.js +16 -22
- package/dist/time/TimeTestUtil.d.ts +16 -0
- package/dist/time/TimeTestUtil.js +29 -0
- package/dist/time/TimeUrlBuilder.d.ts +7 -3
- package/dist/time/TimeUrlBuilder.js +7 -4
- package/dist/time/datasource/AbstractDatasource.d.ts +6 -6
- package/dist/time/datasource/ChronologyReplacer.d.ts +6 -6
- package/dist/time/datasource/ChronologyReplacerFactory.d.ts +2 -2
- package/dist/time/datasource/ChronologyReplacerFactory.js +1 -1
- package/dist/time/datasource/ContextFilter.d.ts +3 -3
- package/dist/time/datasource/CsvFileSource.d.ts +2 -2
- package/dist/time/datasource/CsvMapper.d.ts +5 -5
- package/dist/time/datasource/CsvMapper.js +1 -1
- package/dist/time/datasource/Datasource.d.ts +2 -2
- package/dist/time/datasource/DatasourceTestCase.d.ts +8 -8
- package/dist/time/datasource/DatasourceTestCase.js +18 -16
- package/dist/time/datasource/FileDatasource.d.ts +2 -2
- package/dist/time/datasource/JsonMapper.d.ts +4 -4
- package/dist/time/datasource/TimeContextFilter.d.ts +3 -3
- package/dist/time/datasource/acufo/AcufoCase.d.ts +1 -1
- package/dist/time/datasource/acufo/AcufoDatasource.d.ts +3 -3
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceCaseSummary.d.ts +1 -1
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceCaseSummaryMapper.d.ts +3 -3
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceCaseSummaryMapper.js +1 -1
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceCaseSummaryRR0Mapper.d.ts +3 -3
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceCaseSummaryRR0Mapper.js +1 -1
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceDatasource.d.ts +2 -2
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceHttpDatasource.d.ts +6 -6
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceTestCases.js +1 -1
- package/dist/time/datasource/fufora/FuforaCaseSummary.d.ts +1 -1
- package/dist/time/datasource/fufora/FuforaCaseSummaryRR0Mapper.d.ts +3 -3
- package/dist/time/datasource/fufora/FuforaCaseSummaryRR0Mapper.js +1 -1
- package/dist/time/datasource/fufora/FuforaDatasource.d.ts +2 -2
- package/dist/time/datasource/fufora/FuforaHttpDatasource.d.ts +5 -5
- package/dist/time/datasource/fufora/FuforaTestCases.js +1 -1
- package/dist/time/datasource/nuforc/NuforcCaseSummary.d.ts +1 -1
- package/dist/time/datasource/nuforc/NuforcDatasource.d.ts +2 -2
- package/dist/time/datasource/nuforc/NuforcHttpDatasource.d.ts +6 -6
- package/dist/time/datasource/nuforc/NuforcRR0Mapper.d.ts +3 -3
- package/dist/time/datasource/nuforc/NuforcRR0Mapper.js +1 -1
- package/dist/time/datasource/nuforc/NuforcTestCases.js +1 -1
- package/dist/time/datasource/rr0/NamedPlace.d.ts +7 -0
- package/dist/time/datasource/rr0/RR0CaseMapping.d.ts +2 -2
- package/dist/time/datasource/rr0/RR0CaseSummary.d.ts +0 -7
- package/dist/time/datasource/rr0/RR0CaseSummaryMapper.d.ts +3 -3
- package/dist/time/datasource/rr0/RR0FileDatasource.d.ts +5 -5
- package/dist/time/datasource/rr0/RR0HttpDatasource.d.ts +10 -9
- package/dist/time/datasource/rr0/RR0HttpDatasource.js +3 -32
- package/dist/time/datasource/rr0/RR0TestCases.js +1 -1
- package/dist/time/datasource/rr0/index.d.ts +1 -0
- package/dist/time/datasource/rr0/index.js +1 -0
- package/dist/time/datasource/sceau/SceauCaseSummaryRR0Mapper.d.ts +3 -3
- package/dist/time/datasource/sceau/SceauCaseSummaryRR0Mapper.js +1 -1
- package/dist/time/datasource/sceau/SceauDatasource.d.ts +4 -4
- package/dist/time/datasource/sceau/SceauDatasource.js +1 -1
- package/dist/time/datasource/sceau/SceauHttpDatasource.d.ts +5 -5
- package/dist/time/datasource/ufo-search/UfoSearchCase.d.ts +1 -1
- package/dist/time/datasource/ufo-search/UfoSearchCaseRR0Mapper.d.ts +4 -4
- package/dist/time/datasource/ufo-search/UfoSearchCaseRR0Mapper.js +10 -10
- package/dist/time/datasource/ufo-search/UfoSearchDatasource.d.ts +2 -2
- package/dist/time/datasource/ufo-search/UfoSearchFileDatasource.d.ts +3 -3
- package/dist/time/datasource/ufo-search/UfoSearchFileDatasource.js +1 -1
- package/dist/time/datasource/ufo-search/UfoSearchHttpDatasource.d.ts +4 -4
- package/dist/time/datasource/ufo-search/UfoSearchTestCases.js +1 -1
- package/dist/time/datasource/urecat/UrecatCase.d.ts +1 -1
- package/dist/time/datasource/urecat/UrecatHttpDatasource.d.ts +5 -5
- package/dist/time/datasource/urecat/UrecatHttpDatasource.js +1 -1
- package/dist/time/datasource/urecat/UrecatRR0Mapper.d.ts +3 -3
- package/dist/time/datasource/urecat/UrecatRR0Mapper.js +1 -1
- package/dist/time/datasource/urecat/UrecatTestCases.js +1 -1
- package/dist/time/html/TimeElementFactory.d.ts +15 -0
- package/dist/time/{TimeElementFactory.js → html/TimeElementFactory.js} +16 -22
- package/dist/time/html/TimeRenderer.d.ts +18 -0
- package/dist/time/html/TimeRenderer.js +46 -0
- package/dist/time/html/TimeReplacer.d.ts +12 -0
- package/dist/time/{TimeReplacer.js → html/TimeReplacer.js} +0 -3
- package/dist/time/{TimeReplacerFactory.d.ts → html/TimeReplacerFactory.d.ts} +2 -2
- package/dist/time/{TimeReplacerFactory.js → html/TimeReplacerFactory.js} +1 -1
- package/dist/time/html/index.d.ts +4 -0
- package/dist/time/html/index.js +4 -0
- package/dist/time/index.d.ts +3 -8
- package/dist/time/index.js +3 -8
- package/dist/time/{RelativeTimeTextBuilder.d.ts → text/RelativeTimeTextBuilder.d.ts} +2 -2
- package/dist/time/text/RelativeTimeTextBuilder.js +165 -0
- package/dist/time/{TimeTextBuilder.d.ts → text/TimeTextBuilder.d.ts} +2 -2
- package/dist/time/{TimeTextBuilder.js → text/TimeTextBuilder.js} +1 -1
- package/dist/time/text/index.d.ts +2 -0
- package/dist/time/text/index.js +2 -0
- package/dist/value/UnitReplaceCommand.d.ts +2 -2
- package/package.json +12 -11
- package/tsconfig.json +2 -1
- package/dist/place/PlaceLocation.d.ts +0 -26
- package/dist/place/PlaceLocation.js +0 -48
- package/dist/place/PlaceMessages.d.ts +0 -5
- package/dist/place/PlaceMessages_en.d.ts +0 -2
- package/dist/place/PlaceMessages_en.js +0 -4
- package/dist/place/PlaceMessages_fr.d.ts +0 -2
- package/dist/place/PlaceMessages_fr.js +0 -4
- package/dist/time/RelativeTimeTextBuilder.js +0 -166
- package/dist/time/TimeContext.d.ts +0 -59
- package/dist/time/TimeContext.js +0 -267
- package/dist/time/TimeElementFactory.d.ts +0 -15
- package/dist/time/TimeRenderer.d.ts +0 -19
- package/dist/time/TimeRenderer.js +0 -63
- package/dist/time/TimeReplacer.d.ts +0 -24
- /package/dist/{place/PlaceMessages.js → time/datasource/rr0/NamedPlace.js} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { CaseMapper } from "../CaseMapper.js";
|
|
2
2
|
import { BaseOvniFranceCaseSummary } from "./BaseOvniFranceCaseSummary.js";
|
|
3
|
-
import {
|
|
3
|
+
import { RR0Context } from "../../../RR0Context.js";
|
|
4
4
|
import { BaseOvniFranceCase } from "./BaseOvniFranceCase.js";
|
|
5
5
|
/**
|
|
6
6
|
* Maps a Base OVNI France CSV case to a Base OVNI France case.
|
|
7
7
|
*/
|
|
8
|
-
export declare class BaseOvniFranceCaseSummaryMapper implements CaseMapper<
|
|
8
|
+
export declare class BaseOvniFranceCaseSummaryMapper implements CaseMapper<RR0Context, BaseOvniFranceCase, BaseOvniFranceCaseSummary> {
|
|
9
9
|
readonly baseUrl: URL;
|
|
10
10
|
readonly copyright: string;
|
|
11
11
|
readonly authors: string[];
|
|
12
12
|
constructor(baseUrl: URL, copyright: string, authors: string[]);
|
|
13
|
-
map(context:
|
|
13
|
+
map(context: RR0Context, csvCase: BaseOvniFranceCase, sourceTime: Date): BaseOvniFranceCaseSummary;
|
|
14
14
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { CaseMapper } from "../CaseMapper.js";
|
|
2
2
|
import { BaseOvniFranceCaseSummary } from "./BaseOvniFranceCaseSummary.js";
|
|
3
|
-
import {
|
|
3
|
+
import { HtmlRR0Context } from "../../../RR0Context.js";
|
|
4
4
|
import { RR0CaseSummary } from "../rr0/RR0CaseSummary.js";
|
|
5
5
|
import { DepartmentService } from "../../../org/country/region/department/DepartmentService.js";
|
|
6
6
|
import { CityService } from "../../../org/country/index.js";
|
|
7
7
|
/**
|
|
8
8
|
* Maps a Base OVNI France case to a RR0 case.
|
|
9
9
|
*/
|
|
10
|
-
export declare class BaseOvniFranceCaseSummaryRR0Mapper implements CaseMapper<
|
|
10
|
+
export declare class BaseOvniFranceCaseSummaryRR0Mapper implements CaseMapper<HtmlRR0Context, BaseOvniFranceCaseSummary, RR0CaseSummary> {
|
|
11
11
|
protected depService: DepartmentService;
|
|
12
12
|
protected cityService: CityService;
|
|
13
13
|
readonly baseUrl: URL;
|
|
14
14
|
readonly copyright: string;
|
|
15
15
|
readonly authors: string[];
|
|
16
16
|
constructor(depService: DepartmentService, cityService: CityService, baseUrl: URL, copyright: string, authors: string[]);
|
|
17
|
-
map(context:
|
|
17
|
+
map(context: HtmlRR0Context, sourceCase: BaseOvniFranceCaseSummary, sourceTime: Date): RR0CaseSummary;
|
|
18
18
|
protected getDescription(c: BaseOvniFranceCaseSummary): string;
|
|
19
19
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseOvniFranceCaseSummary } from "./BaseOvniFranceCaseSummary.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RR0Context } from "../../../RR0Context.js";
|
|
3
3
|
import { AbstractDatasource } from "../AbstractDatasource.js";
|
|
4
4
|
export declare abstract class BaseOvniFranceDatasource extends AbstractDatasource<BaseOvniFranceCaseSummary> {
|
|
5
5
|
protected constructor(authors?: string[], copyright?: string);
|
|
6
|
-
protected abstract readCases(context:
|
|
6
|
+
protected abstract readCases(context: RR0Context): Promise<BaseOvniFranceCaseSummary[]>;
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RR0Context } from "../../../RR0Context.js";
|
|
2
2
|
import { HttpSource } from "../HttpSource.js";
|
|
3
3
|
import { BaseOvniFranceCaseSummary } from "./BaseOvniFranceCaseSummary.js";
|
|
4
|
-
import { TimeContext } from "
|
|
4
|
+
import { TimeContext } from "@rr0/time";
|
|
5
5
|
import { BaseOvniFranceDatasource } from "./BaseOvniFranceDatasource.js";
|
|
6
6
|
interface FormData {
|
|
7
7
|
mois: string;
|
|
@@ -14,14 +14,14 @@ export declare class BaseOvniFranceHttpDatasource extends BaseOvniFranceDatasour
|
|
|
14
14
|
protected static readonly regExp: RegExp;
|
|
15
15
|
protected readonly http: HttpSource;
|
|
16
16
|
constructor(baseUrl?: URL, searchPath?: string);
|
|
17
|
-
queryUrl(context:
|
|
17
|
+
queryUrl(context: RR0Context): {
|
|
18
18
|
formData: FormData;
|
|
19
19
|
queryUrl: URL;
|
|
20
20
|
};
|
|
21
|
-
protected readCases(context:
|
|
21
|
+
protected readCases(context: RR0Context): Promise<BaseOvniFranceCaseSummary[]>;
|
|
22
22
|
protected getBoolean(field: HTMLTableCellElement): boolean;
|
|
23
|
-
protected getDate(context:
|
|
23
|
+
protected getDate(context: RR0Context, dateField: HTMLTableCellElement): TimeContext;
|
|
24
24
|
protected setTime(dateTime: TimeContext, timeField: HTMLTableCellElement): void;
|
|
25
|
-
protected getFromRow(context:
|
|
25
|
+
protected getFromRow(context: RR0Context, row: Element): BaseOvniFranceCaseSummary;
|
|
26
26
|
}
|
|
27
27
|
export {};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { CaseMapper } from "../CaseMapper.js";
|
|
2
2
|
import { FuforaCaseSummary } from "./FuforaCaseSummary.js";
|
|
3
|
-
import {
|
|
3
|
+
import { HtmlRR0Context } from "../../../RR0Context.js";
|
|
4
4
|
import { RR0CaseSummary } from "../rr0/RR0CaseSummary.js";
|
|
5
5
|
import { CityService } from "../../../org/country/index.js";
|
|
6
6
|
/**
|
|
7
7
|
* Maps FUFORA cases to RR0 cases.
|
|
8
8
|
*/
|
|
9
|
-
export declare class FuforaCaseSummaryRR0Mapper implements CaseMapper<
|
|
9
|
+
export declare class FuforaCaseSummaryRR0Mapper implements CaseMapper<HtmlRR0Context, FuforaCaseSummary, RR0CaseSummary> {
|
|
10
10
|
protected cityService: CityService;
|
|
11
11
|
readonly baseUrl: URL;
|
|
12
12
|
readonly copyright: string;
|
|
13
13
|
readonly authors: string[];
|
|
14
14
|
constructor(cityService: CityService, baseUrl: URL, copyright: string, authors: string[]);
|
|
15
|
-
map(context:
|
|
15
|
+
map(context: HtmlRR0Context, sourceCase: FuforaCaseSummary, sourceTime: Date): RR0CaseSummary;
|
|
16
16
|
protected getDescription(c: FuforaCaseSummary): string;
|
|
17
17
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FuforaCaseSummary } from "./FuforaCaseSummary.js";
|
|
2
2
|
import { Datasource } from "../Datasource.js";
|
|
3
|
-
import {
|
|
3
|
+
import { RR0Context } from "../../../RR0Context.js";
|
|
4
4
|
export declare abstract class FuforaDatasource implements Datasource<FuforaCaseSummary> {
|
|
5
5
|
readonly authors: string[];
|
|
6
6
|
readonly copyright = "Base de donn\u00E9es observationnelle";
|
|
7
|
-
abstract fetch(context:
|
|
7
|
+
abstract fetch(context: RR0Context): Promise<FuforaCaseSummary[]>;
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RR0Context } from "../../../RR0Context.js";
|
|
2
2
|
import { HttpSource } from "../HttpSource.js";
|
|
3
3
|
import { FuforaCaseSummary } from "./FuforaCaseSummary.js";
|
|
4
4
|
import { FuforaDatasource } from "./FuforaDatasource.js";
|
|
@@ -138,12 +138,12 @@ export declare class FuforaHttpDatasource extends FuforaDatasource {
|
|
|
138
138
|
readonly searchPath: string;
|
|
139
139
|
protected readonly http: HttpSource;
|
|
140
140
|
constructor(baseUrl: URL, searchPath: string);
|
|
141
|
-
fetch(context:
|
|
142
|
-
getFromRows(context:
|
|
143
|
-
queryUrl(context:
|
|
141
|
+
fetch(context: RR0Context): Promise<FuforaCaseSummary[]>;
|
|
142
|
+
getFromRows(context: RR0Context, rows: Element[]): FuforaCaseSummary[];
|
|
143
|
+
queryUrl(context: RR0Context): {
|
|
144
144
|
formData: FormData;
|
|
145
145
|
searchUrl: URL;
|
|
146
146
|
};
|
|
147
|
-
protected getFromRow(context:
|
|
147
|
+
protected getFromRow(context: RR0Context, row: Element): FuforaCaseSummary;
|
|
148
148
|
}
|
|
149
149
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NuforcState } from "./NuforcState.js";
|
|
2
2
|
import { NuforcCountry } from "./NuforcCountry.js";
|
|
3
3
|
import { NuforcShape } from "./NuforcShape.js";
|
|
4
|
-
import { TimeContext } from "
|
|
4
|
+
import { TimeContext } from "@rr0/time";
|
|
5
5
|
export interface NuforcCaseSummary {
|
|
6
6
|
readonly id: string;
|
|
7
7
|
readonly time: TimeContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NuforcCaseSummary } from "./NuforcCaseSummary.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RR0Context } from "../../../RR0Context.js";
|
|
3
3
|
import { AbstractDatasource } from "../AbstractDatasource.js";
|
|
4
4
|
export declare abstract class NuforcDatasource extends AbstractDatasource<NuforcCaseSummary> {
|
|
5
5
|
protected constructor(authors?: string[], copyright?: string);
|
|
6
|
-
protected abstract readCases(context:
|
|
6
|
+
protected abstract readCases(context: RR0Context): Promise<NuforcCaseSummary[]>;
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RR0Context } from "../../../RR0Context.js";
|
|
2
2
|
import { HttpSource } from "../HttpSource.js";
|
|
3
3
|
import { NuforcCaseSummary } from "./NuforcCaseSummary.js";
|
|
4
4
|
import { NuforcState } from "./NuforcState.js";
|
|
5
|
-
import { TimeContext } from "
|
|
5
|
+
import { TimeContext } from "@rr0/time";
|
|
6
6
|
import { NuforcCountry } from "./NuforcCountry.js";
|
|
7
7
|
import { NuforcShape } from "./NuforcShape.js";
|
|
8
8
|
import { NuforcDatasource } from "./NuforcDatasource.js";
|
|
@@ -12,14 +12,14 @@ export declare class NuforcHttpDatasource extends NuforcDatasource {
|
|
|
12
12
|
protected static readonly dateFormat: RegExp;
|
|
13
13
|
protected readonly http: HttpSource;
|
|
14
14
|
constructor(baseUrl?: URL, searchPath?: string);
|
|
15
|
-
protected queryUrl(context:
|
|
16
|
-
protected readCases(context:
|
|
15
|
+
protected queryUrl(context: RR0Context): URL;
|
|
16
|
+
protected readCases(context: RR0Context): Promise<NuforcCaseSummary[]>;
|
|
17
17
|
protected getShape(shapeField: HTMLTableCellElement): NuforcShape;
|
|
18
18
|
protected getCountry(countryField: HTMLTableCellElement): NuforcCountry;
|
|
19
19
|
protected getState(caseField: HTMLTableCellElement): NuforcState;
|
|
20
|
-
protected getTime(dateField: HTMLTableCellElement, context:
|
|
20
|
+
protected getTime(dateField: HTMLTableCellElement, context: RR0Context): TimeContext;
|
|
21
21
|
protected getLink(caseField: HTMLTableCellElement): URL;
|
|
22
22
|
protected dateFromField(reportField: HTMLTableCellElement): Date;
|
|
23
23
|
protected getImage(imageField: HTMLTableCellElement): boolean;
|
|
24
|
-
protected getNativeCase(context:
|
|
24
|
+
protected getNativeCase(context: RR0Context, row: Element): NuforcCaseSummary;
|
|
25
25
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CaseMapper } from "../CaseMapper.js";
|
|
2
2
|
import { NuforcCaseSummary } from "./NuforcCaseSummary.js";
|
|
3
|
-
import {
|
|
3
|
+
import { HtmlRR0Context } from "../../../RR0Context.js";
|
|
4
4
|
import { NuforcCountry } from "./NuforcCountry.js";
|
|
5
5
|
import { RR0CaseSummary } from "../rr0/RR0CaseSummary.js";
|
|
6
6
|
import { NuforcShape } from "./NuforcShape.js";
|
|
7
7
|
import { CityService } from "../../../org/country/index.js";
|
|
8
8
|
import { CountryService } from "../../../org/country/CountryService.js";
|
|
9
|
-
export declare class NuforcRR0Mapper implements CaseMapper<
|
|
9
|
+
export declare class NuforcRR0Mapper implements CaseMapper<HtmlRR0Context, NuforcCaseSummary, RR0CaseSummary> {
|
|
10
10
|
protected cityService: CityService;
|
|
11
11
|
protected countryService: CountryService;
|
|
12
12
|
readonly baseUrl: string;
|
|
@@ -20,5 +20,5 @@ export declare class NuforcRR0Mapper implements CaseMapper<HtmlRR0SsgContext, Nu
|
|
|
20
20
|
};
|
|
21
21
|
constructor(cityService: CityService, countryService: CountryService, baseUrl: string, copyright: string, authors: string[]);
|
|
22
22
|
getDescription(c: NuforcCaseSummary): string;
|
|
23
|
-
map(context:
|
|
23
|
+
map(context: HtmlRR0Context, sourceCase: NuforcCaseSummary, sourceTime: Date): RR0CaseSummary;
|
|
24
24
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
|
-
import { TimeContext } from "
|
|
2
|
+
import { TimeContext } from "@rr0/time";
|
|
3
3
|
import { NuforcShape } from "./NuforcShape.js";
|
|
4
4
|
import { australia } from "../../../org/au/Australia.js";
|
|
5
5
|
import { brazil } from "../../../org/br/Brazil.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { nuforcDatasource } from "./NuforcRR0Mapping.js";
|
|
2
|
-
import { TimeContext } from "
|
|
2
|
+
import { TimeContext } from "@rr0/time";
|
|
3
3
|
import { NuforcState } from "./NuforcState.js";
|
|
4
4
|
import { NuforcCountry } from "./NuforcCountry.js";
|
|
5
5
|
import { NuforcShape } from "./NuforcShape.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CaseMapping } from "../CaseMapping.js";
|
|
2
|
-
import {
|
|
2
|
+
import { HtmlRR0Context } from "../../../RR0Context.js";
|
|
3
3
|
import { RR0CaseSummary } from "./RR0CaseSummary.js";
|
|
4
4
|
/**
|
|
5
5
|
* Maps some datasource case to a RR0 case.
|
|
6
6
|
*
|
|
7
7
|
* @param S The source case type.
|
|
8
8
|
*/
|
|
9
|
-
export interface RR0CaseMapping<S> extends CaseMapping<
|
|
9
|
+
export interface RR0CaseMapping<S> extends CaseMapping<HtmlRR0Context, S, RR0CaseSummary> {
|
|
10
10
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import { Place } from "../../../place/index.js";
|
|
2
|
-
import { Organization } from "../../../org/index.js";
|
|
3
1
|
import { RR0Data } from "../../../data/index.js";
|
|
4
2
|
import { RR0Event } from "../../../event/index.js";
|
|
5
|
-
export type NamedPlace = {
|
|
6
|
-
readonly place?: Place;
|
|
7
|
-
readonly org?: Organization;
|
|
8
|
-
readonly name: string;
|
|
9
|
-
};
|
|
10
3
|
export interface RR0CaseSummary extends RR0Event {
|
|
11
4
|
/**
|
|
12
5
|
* A unique identifier for this data.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CaseMapper } from "../CaseMapper.js";
|
|
2
|
-
import {
|
|
2
|
+
import { HtmlRR0Context } from "../../../RR0Context.js";
|
|
3
3
|
import { RR0CaseSummary } from "./RR0CaseSummary.js";
|
|
4
|
-
export declare class RR0CaseSummaryMapper implements CaseMapper<
|
|
4
|
+
export declare class RR0CaseSummaryMapper implements CaseMapper<HtmlRR0Context, RR0CaseSummary, RR0CaseSummary> {
|
|
5
5
|
readonly baseUrl: URL;
|
|
6
6
|
readonly copyright: string;
|
|
7
7
|
readonly authors: string[];
|
|
8
8
|
constructor(baseUrl: URL, copyright: string, authors: string[]);
|
|
9
|
-
map(context:
|
|
9
|
+
map(context: HtmlRR0Context, sourceCase: RR0CaseSummary, sourceTime: Date): RR0CaseSummary;
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HtmlRR0Context, RR0Context } from "../../../RR0Context.js";
|
|
2
2
|
import { Datasource } from "../Datasource.js";
|
|
3
3
|
import { FileDatasource } from "../FileDatasource.js";
|
|
4
4
|
import { CsvFileSource } from "../CsvFileSource.js";
|
|
@@ -6,9 +6,9 @@ import { RR0CaseSummary } from "./RR0CaseSummary.js";
|
|
|
6
6
|
import { RR0Datasource } from "./RR0Datasource.js";
|
|
7
7
|
import { CaseMapper } from "../CaseMapper.js";
|
|
8
8
|
export declare class RR0FileDatasource extends RR0Datasource implements Datasource<RR0CaseSummary>, FileDatasource<RR0CaseSummary> {
|
|
9
|
-
protected mapper: CaseMapper<
|
|
9
|
+
protected mapper: CaseMapper<RR0Context, RR0CaseSummary, RR0CaseSummary>;
|
|
10
10
|
protected readonly file: CsvFileSource<unknown>;
|
|
11
|
-
constructor(mapper: CaseMapper<
|
|
12
|
-
save(context:
|
|
13
|
-
protected readCases(context:
|
|
11
|
+
constructor(mapper: CaseMapper<RR0Context, RR0CaseSummary, RR0CaseSummary>);
|
|
12
|
+
save(context: HtmlRR0Context, fetched: any[], fetchTime: Date): void;
|
|
13
|
+
protected readCases(context: HtmlRR0Context): Promise<RR0CaseSummary[]>;
|
|
14
14
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HtmlRR0Context } from "../../../RR0Context.js";
|
|
2
2
|
import { HttpSource } from "../HttpSource.js";
|
|
3
3
|
import { RR0Datasource } from "./RR0Datasource.js";
|
|
4
|
-
import { TimeContext } from "
|
|
5
|
-
import {
|
|
4
|
+
import { TimeContext } from "@rr0/time";
|
|
5
|
+
import { RR0CaseSummary } from "./RR0CaseSummary.js";
|
|
6
6
|
import { Source } from "../../../source/index.js";
|
|
7
7
|
import { CityService } from "../../../org/index.js";
|
|
8
|
+
import { NamedPlace } from "./NamedPlace";
|
|
8
9
|
export declare class RR0HttpDatasource extends RR0Datasource {
|
|
9
10
|
readonly baseUrl: URL;
|
|
10
11
|
readonly searchPath: string;
|
|
@@ -12,12 +13,12 @@ export declare class RR0HttpDatasource extends RR0Datasource {
|
|
|
12
13
|
http: HttpSource;
|
|
13
14
|
constructor(baseUrl: URL, searchPath: string, cityService: CityService);
|
|
14
15
|
id(dateTime: TimeContext, place: NamedPlace | undefined): string;
|
|
15
|
-
getFromRows(context:
|
|
16
|
+
getFromRows(context: HtmlRR0Context, rows: Element[]): RR0CaseSummary[];
|
|
16
17
|
findRows(doc: HTMLElement): Element[];
|
|
17
|
-
getFromRow(context:
|
|
18
|
-
protected readCases(context:
|
|
19
|
-
protected getSources(row: Element, itemContext:
|
|
20
|
-
protected getPlace(context:
|
|
18
|
+
getFromRow(context: HtmlRR0Context, r: Element): RR0CaseSummary;
|
|
19
|
+
protected readCases(context: HtmlRR0Context): Promise<RR0CaseSummary[]>;
|
|
20
|
+
protected getSources(row: Element, itemContext: HtmlRR0Context): Source[];
|
|
21
|
+
protected getPlace(context: HtmlRR0Context, placeEl: Element): NamedPlace;
|
|
21
22
|
protected getDescription(el: Element): string;
|
|
22
|
-
protected queryUrl(context:
|
|
23
|
+
protected queryUrl(context: HtmlRR0Context): URL;
|
|
23
24
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpSource } from "../HttpSource.js";
|
|
2
2
|
import { UrlUtil } from "../../../util/index.js";
|
|
3
3
|
import { RR0Datasource } from "./RR0Datasource.js";
|
|
4
|
-
import { TimeContext } from "
|
|
4
|
+
import { TimeContext } from "@rr0/time";
|
|
5
5
|
import { Place } from "../../../place/index.js";
|
|
6
6
|
export class RR0HttpDatasource extends RR0Datasource {
|
|
7
7
|
constructor(baseUrl, searchPath, cityService) {
|
|
@@ -75,38 +75,9 @@ export class RR0HttpDatasource extends RR0Datasource {
|
|
|
75
75
|
sourceEl.remove();
|
|
76
76
|
const pubItems = title.split(",");
|
|
77
77
|
const timeStr = pubItems[pubItems.length - 1].trim();
|
|
78
|
-
const parsedTime = TimeContext.parseDateTime(timeStr);
|
|
79
|
-
let time;
|
|
80
78
|
let publisher;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (parsedTime.yearStr) {
|
|
84
|
-
const year = parseInt(parsedTime.yearStr, 10);
|
|
85
|
-
if (!Number.isNaN(year)) {
|
|
86
|
-
time.setYear(year);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
if (parsedTime.monthStr) {
|
|
90
|
-
const month = parseInt(parsedTime.monthStr, 10);
|
|
91
|
-
if (!Number.isNaN(month)) {
|
|
92
|
-
time.setMonth(month);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (parsedTime.dayOfMonthStr) {
|
|
96
|
-
const dayOfMonth = parseInt(parsedTime.dayOfMonthStr, 10);
|
|
97
|
-
if (!Number.isNaN(dayOfMonth)) {
|
|
98
|
-
time.setDayOfMonth(dayOfMonth);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (parsedTime.hour) {
|
|
102
|
-
time.setHour(parseInt(parsedTime.hour, 10));
|
|
103
|
-
}
|
|
104
|
-
if (parsedTime.minutes) {
|
|
105
|
-
time.setMinutes(parseInt(parsedTime.minutes, 10));
|
|
106
|
-
}
|
|
107
|
-
if (parsedTime.timeZone) {
|
|
108
|
-
time.setTimeZone(parsedTime.timeZone);
|
|
109
|
-
}
|
|
79
|
+
const time = TimeContext.fromString(timeStr);
|
|
80
|
+
if (time) {
|
|
110
81
|
pubItems.pop();
|
|
111
82
|
}
|
|
112
83
|
publisher = pubItems.splice(1, pubItems.length - 1).map(item => item.trim()).join(", ").trim();
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { CaseMapper } from "../CaseMapper.js";
|
|
2
2
|
import { SceauCaseSummary } from "./SceauCaseSummary.js";
|
|
3
|
-
import {
|
|
3
|
+
import { HtmlRR0Context } from "../../../RR0Context.js";
|
|
4
4
|
import { RR0CaseSummary } from "../rr0/index.js";
|
|
5
5
|
import { CityService } from "../../../org/index.js";
|
|
6
6
|
/**
|
|
7
7
|
* Maps SCEAU cases to RR0 cases.
|
|
8
8
|
*/
|
|
9
|
-
export declare class SceauCaseSummaryRR0Mapper implements CaseMapper<
|
|
9
|
+
export declare class SceauCaseSummaryRR0Mapper implements CaseMapper<HtmlRR0Context, SceauCaseSummary, RR0CaseSummary> {
|
|
10
10
|
protected cityService: CityService;
|
|
11
11
|
readonly baseUrl: URL;
|
|
12
12
|
readonly copyright: string;
|
|
13
13
|
readonly authors: string[];
|
|
14
14
|
constructor(cityService: CityService, baseUrl: URL, copyright: string, authors: string[]);
|
|
15
|
-
map(context:
|
|
15
|
+
map(context: HtmlRR0Context, sourceCase: SceauCaseSummary, sourceTime: Date): RR0CaseSummary;
|
|
16
16
|
protected getDescription(c: SceauCaseSummary): string;
|
|
17
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SceauCaseSummary } from "./SceauCaseSummary.js";
|
|
2
2
|
import { AbstractDatasource } from "../AbstractDatasource.js";
|
|
3
|
-
import {
|
|
3
|
+
import { HtmlRR0Context, RR0Context } from "../../../RR0Context.js";
|
|
4
4
|
import { ContextFilter } from "../ContextFilter.js";
|
|
5
5
|
type SceauCaseMapping = {
|
|
6
6
|
[key in keyof SceauCaseSummary]: string;
|
|
@@ -10,13 +10,13 @@ export type FondMapping = {
|
|
|
10
10
|
mapping: SceauCaseMapping;
|
|
11
11
|
};
|
|
12
12
|
export declare class SceauContextFilter extends ContextFilter<SceauCaseSummary> {
|
|
13
|
-
constructor(context:
|
|
13
|
+
constructor(context: RR0Context);
|
|
14
14
|
filter(c: SceauCaseSummary): boolean;
|
|
15
15
|
}
|
|
16
16
|
export declare abstract class SceauDatasource extends AbstractDatasource<SceauCaseSummary> {
|
|
17
17
|
readonly pages: FondMapping[];
|
|
18
18
|
protected constructor(pages?: FondMapping[], authors?: string[], copyright?: string);
|
|
19
|
-
protected createFilter(context:
|
|
20
|
-
protected abstract readCases(context:
|
|
19
|
+
protected createFilter(context: HtmlRR0Context): SceauContextFilter;
|
|
20
|
+
protected abstract readCases(context: RR0Context): Promise<SceauCaseSummary[]>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractDatasource } from "../AbstractDatasource.js";
|
|
2
2
|
import { ContextFilter } from "../ContextFilter.js";
|
|
3
|
-
import { TimeContext } from "
|
|
3
|
+
import { TimeContext } from "@rr0/time";
|
|
4
4
|
export class SceauContextFilter extends ContextFilter {
|
|
5
5
|
constructor(context) {
|
|
6
6
|
super(context);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RR0Context } from "../../../RR0Context.js";
|
|
2
2
|
import { HttpSource } from "../HttpSource.js";
|
|
3
3
|
import { SceauDatasource } from "./SceauDatasource.js";
|
|
4
4
|
import { SceauCaseSummary } from "./SceauCaseSummary.js";
|
|
@@ -7,8 +7,8 @@ export declare class SceauHttpDatasource extends SceauDatasource {
|
|
|
7
7
|
readonly searchPath: string;
|
|
8
8
|
protected readonly http: HttpSource;
|
|
9
9
|
constructor(baseUrl: URL, searchPath?: string);
|
|
10
|
-
getFromRows(context:
|
|
11
|
-
protected queryUrl(context:
|
|
12
|
-
protected readCases(context:
|
|
13
|
-
protected getFromRow(context:
|
|
10
|
+
getFromRows(context: RR0Context, rows: Element[], fields: string[]): SceauCaseSummary[];
|
|
11
|
+
protected queryUrl(context: RR0Context, fondPath: string): URL;
|
|
12
|
+
protected readCases(context: RR0Context): Promise<SceauCaseSummary[]>;
|
|
13
|
+
protected getFromRow(context: RR0Context, row: Element, fields: string[]): SceauCaseSummary;
|
|
14
14
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { CaseMapper } from "../CaseMapper.js";
|
|
2
2
|
import { UfoSearchCase } from "./UfoSearchCase.js";
|
|
3
|
-
import {
|
|
3
|
+
import { HtmlRR0Context } from "../../../RR0Context.js";
|
|
4
4
|
import { NamedPlace, RR0CaseSummary } from "../rr0/index.js";
|
|
5
5
|
import { CityService } from "../../../org/index.js";
|
|
6
|
-
export declare class UfoSearchCaseRR0Mapper implements CaseMapper<
|
|
6
|
+
export declare class UfoSearchCaseRR0Mapper implements CaseMapper<HtmlRR0Context, UfoSearchCase, RR0CaseSummary> {
|
|
7
7
|
protected cityService: CityService;
|
|
8
8
|
readonly baseUrl: string;
|
|
9
9
|
readonly copyright: string;
|
|
10
10
|
readonly authors: string[];
|
|
11
11
|
constructor(cityService: CityService, baseUrl: string, copyright: string, authors: string[]);
|
|
12
12
|
getDescription(c: UfoSearchCase): string;
|
|
13
|
-
map(context:
|
|
14
|
-
protected getPlace(context:
|
|
13
|
+
map(context: HtmlRR0Context, sourceCase: UfoSearchCase, sourceTime: Date): RR0CaseSummary;
|
|
14
|
+
protected getPlace(context: HtmlRR0Context, placeName: string): NamedPlace;
|
|
15
15
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
|
-
import { TimeContext } from "
|
|
2
|
+
import { TimeContext } from "@rr0/time";
|
|
3
3
|
export class UfoSearchCaseRR0Mapper {
|
|
4
4
|
constructor(cityService, baseUrl, copyright, authors) {
|
|
5
5
|
this.cityService = cityService;
|
|
@@ -12,16 +12,17 @@ export class UfoSearchCaseRR0Mapper {
|
|
|
12
12
|
return description.join(" ");
|
|
13
13
|
}
|
|
14
14
|
map(context, sourceCase, sourceTime) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
const
|
|
15
|
+
const authors = this.authors;
|
|
16
|
+
const url = sourceCase.url;
|
|
17
|
+
const title = "cas n° " + sourceCase.id;
|
|
18
|
+
const publication = { publisher: this.copyright, time: TimeContext.fromDate(sourceTime) };
|
|
19
|
+
const caseSource = { url, title, authors, publication, events: [], previousSourceRefs: [] };
|
|
20
|
+
const placeName = sourceCase.location;
|
|
21
|
+
const place = placeName ? this.getPlace(context, placeName) : undefined;
|
|
21
22
|
return {
|
|
22
23
|
id: sourceCase.id,
|
|
23
24
|
type: "sighting",
|
|
24
|
-
url
|
|
25
|
+
url,
|
|
25
26
|
events: [],
|
|
26
27
|
time: sourceCase.time,
|
|
27
28
|
place,
|
|
@@ -29,8 +30,7 @@ export class UfoSearchCaseRR0Mapper {
|
|
|
29
30
|
sources: [caseSource]
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
|
-
getPlace(context,
|
|
33
|
-
const placeName = sourceCase.location;
|
|
33
|
+
getPlace(context, placeName) {
|
|
34
34
|
const org = this.cityService.find(context, placeName, undefined);
|
|
35
35
|
assert.ok(org, `Could not find place "${placeName}"}"`);
|
|
36
36
|
return { name: org.getMessages(context).toTitle(context, org, { parent: true }), org, place: org.places[0] };
|