From b806943b700e9c3d80b253b2cbda2e7880986b0f Mon Sep 17 00:00:00 2001 From: SiRanWeb Date: Sun, 6 Nov 2022 23:36:13 +0300 Subject: [PATCH] update base model & refactor --- .../{common.constants.ts => constants.ts} | 0 src/common/{common.types.ts => types.ts} | 1 + src/common/utils.ts | 14 ++++- src/models/activity/Activity.model.ts | 2 +- src/models/activity/Activity.types.ts | 2 +- src/models/actor/Actor.model.ts | 2 +- src/models/actor/Actor.types.ts | 2 +- src/models/apBase/APBase.model.ts | 59 +++++++++++-------- src/models/apEvent/APEvent.model.ts | 2 +- src/models/apObject/APObject.model.ts | 2 +- src/models/apObject/APObject.types.ts | 2 +- src/models/application/Application.model.ts | 2 +- src/models/article/Article.model.ts | 2 +- src/models/audio/Audio.model.ts | 2 +- src/models/collection/Collection.model.ts | 2 +- src/models/collection/Collection.types.ts | 2 +- .../collectionPage/CollectionPage.model.ts | 2 +- .../collectionPage/CollectionPage.types.ts | 2 +- src/models/document/Document.model.ts | 2 +- src/models/group/Group.model.ts | 2 +- src/models/image/Image.model.ts | 2 +- .../IntransitiveActivity.model.ts | 2 +- src/models/link/Link.model.ts | 2 +- src/models/link/Link.types.ts | 3 +- src/models/mention/Mention.model.ts | 2 +- src/models/note/Note.model.ts | 2 +- .../OrderedCollection.model.ts | 2 +- .../OrderedCollection.types.ts | 2 +- .../OrderedCollectionPage.model.ts | 2 +- .../OrderedCollectionPage.types.ts | 2 +- src/models/organization/Organization.model.ts | 2 +- src/models/page/Page.model.ts | 2 +- src/models/person/Person.model.ts | 2 +- src/models/place/Place.model.ts | 2 +- src/models/place/Place.types.ts | 2 +- src/models/profile/Profile.model.ts | 2 +- src/models/profile/Profile.types.ts | 2 +- src/models/question/Question.model.ts | 2 +- src/models/question/Question.types.ts | 2 +- src/models/relationship/Relationship.model.ts | 2 +- src/models/relationship/Relationship.types.ts | 2 +- src/models/service/Service.model.ts | 2 +- src/models/tombstone/Tombstone.model.ts | 2 +- src/models/tombstone/Tombstone.types.ts | 2 +- src/models/video/Video.model.ts | 2 +- 45 files changed, 91 insertions(+), 66 deletions(-) rename src/common/{common.constants.ts => constants.ts} (100%) rename src/common/{common.types.ts => types.ts} (98%) diff --git a/src/common/common.constants.ts b/src/common/constants.ts similarity index 100% rename from src/common/common.constants.ts rename to src/common/constants.ts diff --git a/src/common/common.types.ts b/src/common/types.ts similarity index 98% rename from src/common/common.types.ts rename to src/common/types.ts index abaac84..bc44762 100644 --- a/src/common/common.types.ts +++ b/src/common/types.ts @@ -55,6 +55,7 @@ export type LanguageTag = string; export type MediaType = string; export type Duration = string; +export type ContextValue = string | Record; export type UrlValue = string | Link; export type IdValue = string; export type TypeValue = string; diff --git a/src/common/utils.ts b/src/common/utils.ts index 5852d3b..0f4ea36 100644 --- a/src/common/utils.ts +++ b/src/common/utils.ts @@ -1 +1,13 @@ -export type Modify = Omit & R; \ No newline at end of file +export type Modify = Omit & R; + +export const cloneObjDeep = (obj: T): T => { + const duplicateObj = {} as T; + for (const key in obj) { + if(typeof obj[key] === 'object') { + duplicateObj[key] = cloneObjDeep(obj[key]); + } else { + duplicateObj[key] = obj[key]; + } + } + return duplicateObj; +} \ No newline at end of file diff --git a/src/models/activity/Activity.model.ts b/src/models/activity/Activity.model.ts index 7e2ab6d..456044d 100644 --- a/src/models/activity/Activity.model.ts +++ b/src/models/activity/Activity.model.ts @@ -1,6 +1,6 @@ import {APBase} from "../apBase/APBase.model"; import { ActivityFields } from "./Activity.types"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; /** * An Activity is a subtype of Object that describes some form of action that may happen, diff --git a/src/models/activity/Activity.types.ts b/src/models/activity/Activity.types.ts index 08c906e..094dc45 100644 --- a/src/models/activity/Activity.types.ts +++ b/src/models/activity/Activity.types.ts @@ -6,7 +6,7 @@ import { OriginValue, ResultValue, TargetValue -} from "../../common/common.types"; +} from "../../common/types"; export interface ActivityFields extends APObjectFields { diff --git a/src/models/actor/Actor.model.ts b/src/models/actor/Actor.model.ts index afbc0ee..1efaf94 100644 --- a/src/models/actor/Actor.model.ts +++ b/src/models/actor/Actor.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {ActorFields} from "./Actor.types"; /** diff --git a/src/models/actor/Actor.types.ts b/src/models/actor/Actor.types.ts index ac3c35e..be1edfc 100644 --- a/src/models/actor/Actor.types.ts +++ b/src/models/actor/Actor.types.ts @@ -13,7 +13,7 @@ import { ProxyUrlValue, SharedInboxValue, SignClientKeyValue, StreamsValue -} from "../../common/common.types"; +} from "../../common/types"; export interface EndpointsValue { diff --git a/src/models/apBase/APBase.model.ts b/src/models/apBase/APBase.model.ts index f381c85..df2fa6d 100644 --- a/src/models/apBase/APBase.model.ts +++ b/src/models/apBase/APBase.model.ts @@ -1,26 +1,26 @@ -import { contexts } from "../../common/common.constants"; +import { contexts } from "../../common/constants"; +import { ContextValue } from "../../common/types"; +import { cloneObjDeep } from "../../common/utils"; -// TODO: types -// TODO: renaming/refactor -export type Context = string | any[]; - -export interface ModelBaseAPWithContext { - '@context'?: Context; +interface ContextField { + '@context'?: ContextValue | ContextValue[]; } export class APBase { - public fields: T & ModelBaseAPWithContext; + public fields: T & ContextField; - constructor(fields: T) { - // TODO: make recursive copy + constructor(fields: T & ContextField) { + const obj = cloneObjDeep(fields); this.fields = { - ...fields, - } as T & ModelBaseAPWithContext; + ...obj, + } as T & ContextField; } - // TODO: rewrite (better option to handle multiple contexts) - // some comment - public setContext(context?: Context): this { + private parseValue(value: any): any { + return value instanceof APBase ? value.toPlain() : value; + } + + public withContext(context?: ContextValue): this { this.fields = { ['@context']: context || contexts.activityStreamsV2, ...this.fields @@ -28,20 +28,33 @@ export class APBase { return this; } - public plain(): Record { + public toPlain(): Record { const result = {} as Record; - for (const [key, node] of Object.entries(this.fields)) { - if (node instanceof APBase) { - result[key] = node.plain(); + for (const [key, value] of Object.entries(this.fields)) { + const isFunction = typeof value === 'function'; + const isArray = Array.isArray(value); + const isNull = value === null; + const isUndefined = value === undefined; + const isObject = !isArray && !isNull && typeof value === 'object'; + const isPlain = !isArray && !isNull && !isUndefined && !isObject && !isFunction; + + if (isArray) { + result[key] = value.map(v => this.parseValue(v)); + } else if (isNull || isUndefined) { + result[key] = null; + } else if (isObject) { + result[key] = {}; + Object.entries(value).forEach(([k, v]) => result[key][k] = this.parseValue(v)); + } else if (isPlain) { + result[key] = this.parseValue(value); } else { - result[key] = node; + throw new Error(`Unable to convert key ${key} with value ${value}. Type of value: ${typeof value}`); } } - // TODO make recursive copy return result; } - public json() { - return JSON.stringify(this.plain()); + public toJSON(): string { + return JSON.stringify(this.toPlain()); } } \ No newline at end of file diff --git a/src/models/apEvent/APEvent.model.ts b/src/models/apEvent/APEvent.model.ts index b0d650b..346b317 100644 --- a/src/models/apEvent/APEvent.model.ts +++ b/src/models/apEvent/APEvent.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {APEventFields} from "./APEvent.types"; /** diff --git a/src/models/apObject/APObject.model.ts b/src/models/apObject/APObject.model.ts index 67d0a44..b213610 100644 --- a/src/models/apObject/APObject.model.ts +++ b/src/models/apObject/APObject.model.ts @@ -1,6 +1,6 @@ import {APBase} from "../apBase/APBase.model"; import { APObjectFields } from "./APObject.types"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; /** * Describes an object of any kind. The Object type serves as the base type for most of diff --git a/src/models/apObject/APObject.types.ts b/src/models/apObject/APObject.types.ts index 5fbdb75..5d9225d 100644 --- a/src/models/apObject/APObject.types.ts +++ b/src/models/apObject/APObject.types.ts @@ -29,7 +29,7 @@ import { SummaryMapValue, UpdatedValue, DurationValue, SourceValue, LikesValue, SharesValue, -} from "../../common/common.types"; +} from "../../common/types"; export interface APObjectFields { /** diff --git a/src/models/application/Application.model.ts b/src/models/application/Application.model.ts index 0cea4ed..44260e7 100644 --- a/src/models/application/Application.model.ts +++ b/src/models/application/Application.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {ApplicationFields} from "./Application.types"; /** diff --git a/src/models/article/Article.model.ts b/src/models/article/Article.model.ts index e373536..e43094e 100644 --- a/src/models/article/Article.model.ts +++ b/src/models/article/Article.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {ArticleFields} from "./Article.types"; /** diff --git a/src/models/audio/Audio.model.ts b/src/models/audio/Audio.model.ts index b77ca75..f1ff133 100644 --- a/src/models/audio/Audio.model.ts +++ b/src/models/audio/Audio.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {AudioFields} from "./Audio.types"; /** diff --git a/src/models/collection/Collection.model.ts b/src/models/collection/Collection.model.ts index 21ee530..094ddf8 100644 --- a/src/models/collection/Collection.model.ts +++ b/src/models/collection/Collection.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {CollectionFields} from "./Collection.types"; /** diff --git a/src/models/collection/Collection.types.ts b/src/models/collection/Collection.types.ts index 0691fe2..ebc9177 100644 --- a/src/models/collection/Collection.types.ts +++ b/src/models/collection/Collection.types.ts @@ -4,7 +4,7 @@ import { CollectionFirstValue, CollectionItemsValue, CollectionLastValue, TotalItemsValue -} from "../../common/common.types"; +} from "../../common/types"; export interface CollectionFields extends APObjectFields { diff --git a/src/models/collectionPage/CollectionPage.model.ts b/src/models/collectionPage/CollectionPage.model.ts index b5e917e..e694a9e 100644 --- a/src/models/collectionPage/CollectionPage.model.ts +++ b/src/models/collectionPage/CollectionPage.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {CollectionPageFields} from "./CollectionPage.types"; /** diff --git a/src/models/collectionPage/CollectionPage.types.ts b/src/models/collectionPage/CollectionPage.types.ts index d9427fb..2f1f55d 100644 --- a/src/models/collectionPage/CollectionPage.types.ts +++ b/src/models/collectionPage/CollectionPage.types.ts @@ -1,5 +1,5 @@ import {CollectionFields} from "../collection/Collection.types"; -import {CollectionPageNextValue, CollectionPagePartOfValue, CollectionPagePrevValue} from "../../common/common.types"; +import {CollectionPageNextValue, CollectionPagePartOfValue, CollectionPagePrevValue} from "../../common/types"; export interface CollectionPageFields extends CollectionFields { diff --git a/src/models/document/Document.model.ts b/src/models/document/Document.model.ts index 5edf538..b1b1aa2 100644 --- a/src/models/document/Document.model.ts +++ b/src/models/document/Document.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {DocumentFields} from "./Document.types"; /** diff --git a/src/models/group/Group.model.ts b/src/models/group/Group.model.ts index ff99c5b..2af642d 100644 --- a/src/models/group/Group.model.ts +++ b/src/models/group/Group.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {GroupFields} from "./Group.types"; /** diff --git a/src/models/image/Image.model.ts b/src/models/image/Image.model.ts index 58234ab..92e6e44 100644 --- a/src/models/image/Image.model.ts +++ b/src/models/image/Image.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {ImageFields} from "./Image.types"; /** diff --git a/src/models/intransitiveActivity/IntransitiveActivity.model.ts b/src/models/intransitiveActivity/IntransitiveActivity.model.ts index 2bc7821..008ffbe 100644 --- a/src/models/intransitiveActivity/IntransitiveActivity.model.ts +++ b/src/models/intransitiveActivity/IntransitiveActivity.model.ts @@ -1,6 +1,6 @@ import {APBase} from "../apBase/APBase.model"; import {IntransitiveActivityFields} from './IntransitiveActivity.types'; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; /** * Instances of intransitiveActivity are a subtype of diff --git a/src/models/link/Link.model.ts b/src/models/link/Link.model.ts index b488cfa..c97f3b4 100644 --- a/src/models/link/Link.model.ts +++ b/src/models/link/Link.model.ts @@ -1,6 +1,6 @@ import {APBase} from "../apBase/APBase.model"; import { LinkFields } from "./Link.types"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; /** * A Link is an indirect, qualified reference to a resource identified by a URL. diff --git a/src/models/link/Link.types.ts b/src/models/link/Link.types.ts index 485b7b0..785298e 100644 --- a/src/models/link/Link.types.ts +++ b/src/models/link/Link.types.ts @@ -2,12 +2,11 @@ import { HeightValue, HreflangValue, HrefValue, - IdValue, MediaTypeValue, NameMapValue, NameValue, PreviewValue, RelValue, TypeValue, WidthValue -} from "../../common/common.types"; +} from "../../common/types"; export interface LinkFields { diff --git a/src/models/mention/Mention.model.ts b/src/models/mention/Mention.model.ts index 1a09a33..d2c9286 100644 --- a/src/models/mention/Mention.model.ts +++ b/src/models/mention/Mention.model.ts @@ -1,6 +1,6 @@ import {APBase} from "../apBase/APBase.model"; import {MentionFields} from "./Mention.types"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; /** * A specialized Link that represents an @mention. * diff --git a/src/models/note/Note.model.ts b/src/models/note/Note.model.ts index 8174329..f40b22a 100644 --- a/src/models/note/Note.model.ts +++ b/src/models/note/Note.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {NoteFields} from "./Note.types"; /** diff --git a/src/models/orderedCollection/OrderedCollection.model.ts b/src/models/orderedCollection/OrderedCollection.model.ts index bf28b72..fb2ec39 100644 --- a/src/models/orderedCollection/OrderedCollection.model.ts +++ b/src/models/orderedCollection/OrderedCollection.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {OrderedCollectionFields} from "./OrderedCollection.types"; /** diff --git a/src/models/orderedCollection/OrderedCollection.types.ts b/src/models/orderedCollection/OrderedCollection.types.ts index 62f9a19..17db83d 100644 --- a/src/models/orderedCollection/OrderedCollection.types.ts +++ b/src/models/orderedCollection/OrderedCollection.types.ts @@ -2,7 +2,7 @@ import { OrderedCollectionCurrentValue, OrderedCollectionFirstValue, OrderedCollectionItemsValue, OrderedCollectionLastValue -} from "../../common/common.types"; +} from "../../common/types"; import {CollectionFields} from "../collection/Collection.types"; import {Modify} from "../../common/utils"; diff --git a/src/models/orderedCollectionPage/OrderedCollectionPage.model.ts b/src/models/orderedCollectionPage/OrderedCollectionPage.model.ts index 5b2e92c..c14a3c6 100644 --- a/src/models/orderedCollectionPage/OrderedCollectionPage.model.ts +++ b/src/models/orderedCollectionPage/OrderedCollectionPage.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {OrderedCollectionPageFields} from "./OrderedCollectionPage.types"; /** diff --git a/src/models/orderedCollectionPage/OrderedCollectionPage.types.ts b/src/models/orderedCollectionPage/OrderedCollectionPage.types.ts index 8e90d22..b8ddcab 100644 --- a/src/models/orderedCollectionPage/OrderedCollectionPage.types.ts +++ b/src/models/orderedCollectionPage/OrderedCollectionPage.types.ts @@ -4,7 +4,7 @@ import { OrderedCollectionPagePartOfValue, OrderedCollectionPagePrevValue, StartIndexValue -} from "../../common/common.types"; +} from "../../common/types"; import {CollectionPageFields} from "../collectionPage/CollectionPage.types"; import {Modify} from "../../common/utils"; diff --git a/src/models/organization/Organization.model.ts b/src/models/organization/Organization.model.ts index f02315d..50d4b23 100644 --- a/src/models/organization/Organization.model.ts +++ b/src/models/organization/Organization.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {OrganizationFields} from "./Organization.types"; /** diff --git a/src/models/page/Page.model.ts b/src/models/page/Page.model.ts index 34350a8..325672d 100644 --- a/src/models/page/Page.model.ts +++ b/src/models/page/Page.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {PageFields} from "./Page.types"; /** diff --git a/src/models/person/Person.model.ts b/src/models/person/Person.model.ts index c47aa53..a3d9dc1 100644 --- a/src/models/person/Person.model.ts +++ b/src/models/person/Person.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {PersonFields} from "./Person.types"; /** diff --git a/src/models/place/Place.model.ts b/src/models/place/Place.model.ts index f874463..2baa76d 100644 --- a/src/models/place/Place.model.ts +++ b/src/models/place/Place.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {PlaceFields} from "./Place.types"; /** diff --git a/src/models/place/Place.types.ts b/src/models/place/Place.types.ts index 9223392..c3c161d 100644 --- a/src/models/place/Place.types.ts +++ b/src/models/place/Place.types.ts @@ -6,7 +6,7 @@ import { LongitudeValue, RadiusValue, UnitsValue -} from "../../common/common.types"; +} from "../../common/types"; export interface PlaceFields extends APObjectFields { diff --git a/src/models/profile/Profile.model.ts b/src/models/profile/Profile.model.ts index c995b46..e23856c 100644 --- a/src/models/profile/Profile.model.ts +++ b/src/models/profile/Profile.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {ProfileFields} from "./Profile.types"; /** diff --git a/src/models/profile/Profile.types.ts b/src/models/profile/Profile.types.ts index 3199bdc..29897b8 100644 --- a/src/models/profile/Profile.types.ts +++ b/src/models/profile/Profile.types.ts @@ -1,6 +1,6 @@ import {APObjectFields} from "../apObject/APObject.types"; -import {DescribesValue} from "../../common/common.types"; +import {DescribesValue} from "../../common/types"; export interface ProfileFields extends APObjectFields { diff --git a/src/models/question/Question.model.ts b/src/models/question/Question.model.ts index 55016ab..ab36fc8 100644 --- a/src/models/question/Question.model.ts +++ b/src/models/question/Question.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {QuestionFields} from "./Question.types"; /** diff --git a/src/models/question/Question.types.ts b/src/models/question/Question.types.ts index c19d045..e3c9e25 100644 --- a/src/models/question/Question.types.ts +++ b/src/models/question/Question.types.ts @@ -1,5 +1,5 @@ import {IntransitiveActivityFields} from "../intransitiveActivity/IntransitiveActivity.types"; -import {AnyOfValue, ClosedValue, OneOfValue} from "../../common/common.types"; +import {AnyOfValue, ClosedValue, OneOfValue} from "../../common/types"; export interface QuestionFields extends IntransitiveActivityFields { diff --git a/src/models/relationship/Relationship.model.ts b/src/models/relationship/Relationship.model.ts index e9b1540..d10c03e 100644 --- a/src/models/relationship/Relationship.model.ts +++ b/src/models/relationship/Relationship.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {RelationshipFields} from "./Relationship.types"; /** diff --git a/src/models/relationship/Relationship.types.ts b/src/models/relationship/Relationship.types.ts index 0cbac3c..0a484f2 100644 --- a/src/models/relationship/Relationship.types.ts +++ b/src/models/relationship/Relationship.types.ts @@ -1,5 +1,5 @@ import {APObjectFields} from "../apObject/APObject.types"; -import {SubjectValue, ObjectValue, RelationshipValue} from "../../common/common.types"; +import {SubjectValue, ObjectValue, RelationshipValue} from "../../common/types"; export interface RelationshipFields extends APObjectFields { diff --git a/src/models/service/Service.model.ts b/src/models/service/Service.model.ts index 484dfa5..9c24a1c 100644 --- a/src/models/service/Service.model.ts +++ b/src/models/service/Service.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {ServiceFields} from "./Service.types"; /** diff --git a/src/models/tombstone/Tombstone.model.ts b/src/models/tombstone/Tombstone.model.ts index 347a2a4..c03fbcf 100644 --- a/src/models/tombstone/Tombstone.model.ts +++ b/src/models/tombstone/Tombstone.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {TombstoneFields} from "./Tombstone.types"; /** diff --git a/src/models/tombstone/Tombstone.types.ts b/src/models/tombstone/Tombstone.types.ts index 5831276..b6614cf 100644 --- a/src/models/tombstone/Tombstone.types.ts +++ b/src/models/tombstone/Tombstone.types.ts @@ -1,4 +1,4 @@ -import {DeletedValue, FormerTypeValue} from "../../common/common.types"; +import {DeletedValue, FormerTypeValue} from "../../common/types"; import {APObjectFields} from "../apObject/APObject.types"; export interface TombstoneFields extends APObjectFields { diff --git a/src/models/video/Video.model.ts b/src/models/video/Video.model.ts index f8080d8..18c8405 100644 --- a/src/models/video/Video.model.ts +++ b/src/models/video/Video.model.ts @@ -1,5 +1,5 @@ import {APBase} from "../apBase/APBase.model"; -import {ASModelType} from "../../common/common.types"; +import {ASModelType} from "../../common/types"; import {VideoFields} from "./Video.types"; /**