-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #475 from mocks-server/refactor/typescript-migration
5.0.0 beta version
- Loading branch information
Showing
397 changed files
with
14,630 additions
and
6,979 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ on: | |
pull_request: | ||
branches: | ||
- master | ||
- pre-release | ||
jobs: | ||
check-affected: | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ yarn-error.log* | |
# ides | ||
.idea | ||
.vs | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
packages/admin-api-client-data-provider/.vscode/settings.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
module.exports = { | ||
parser: "@babel/eslint-parser", | ||
parserOptions: { | ||
sourceType: "module", | ||
allowImportExportEverywhere: true, | ||
requireConfigFile: false, | ||
}, | ||
globals: { | ||
module: true, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["*.js"], | ||
parser: "@babel/eslint-parser", | ||
parserOptions: { | ||
sourceType: "module", | ||
allowImportExportEverywhere: true, | ||
requireConfigFile: false, | ||
}, | ||
globals: { | ||
module: true, | ||
}, | ||
}, | ||
], | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import type { ConfigurationObject } from "@mocks-server/config"; | ||
|
||
import type { AdminApiClientInterface, AdminApiClientConstructor } from "./AdminApiClient.types"; | ||
import { AdminApiClientEntities } from "./AdminApiClientEntities"; | ||
import type { | ||
ApiClientConfig, | ||
ApiResponseBody, | ||
AdminApiClientEntitiesInterface, | ||
} from "./AdminApiClientEntities.types"; | ||
import type { EntityId } from "./Common.types"; | ||
|
||
export const AdminApiClient: AdminApiClientConstructor = class AdminApiClient | ||
implements AdminApiClientInterface | ||
{ | ||
private _adminApiClient: AdminApiClientEntitiesInterface; | ||
|
||
constructor() { | ||
this._adminApiClient = new AdminApiClientEntities(); | ||
} | ||
|
||
public readAbout(): Promise<ApiResponseBody> { | ||
return this._adminApiClient.about.read(); | ||
} | ||
|
||
public readConfig(): Promise<ConfigurationObject> { | ||
return this._adminApiClient.config.read() as Promise<ConfigurationObject>; | ||
} | ||
|
||
public updateConfig(newConfig: ConfigurationObject): Promise<void> { | ||
return this._adminApiClient.config.update(newConfig) as Promise<void>; | ||
} | ||
|
||
public readAlerts(): Promise<ApiResponseBody> { | ||
return this._adminApiClient.alerts.read(); | ||
} | ||
|
||
public readAlert(id: EntityId): Promise<ApiResponseBody> { | ||
return this._adminApiClient.alert(id).read(); | ||
} | ||
|
||
public readCollections(): Promise<ApiResponseBody> { | ||
return this._adminApiClient.collections.read(); | ||
} | ||
|
||
public readCollection(id: EntityId): Promise<ApiResponseBody> { | ||
return this._adminApiClient.collection(id).read(); | ||
} | ||
|
||
public readRoutes(): Promise<ApiResponseBody> { | ||
return this._adminApiClient.routes.read(); | ||
} | ||
|
||
public readRoute(id: EntityId): Promise<ApiResponseBody> { | ||
return this._adminApiClient.route(id).read(); | ||
} | ||
|
||
public readVariants(): Promise<ApiResponseBody> { | ||
return this._adminApiClient.variants.read(); | ||
} | ||
|
||
public readVariant(id: EntityId): Promise<ApiResponseBody> { | ||
return this._adminApiClient.variant(id).read(); | ||
} | ||
|
||
public readCustomRouteVariants(): Promise<ApiResponseBody> { | ||
return this._adminApiClient.customRouteVariants.read(); | ||
} | ||
|
||
public useRouteVariant(id: EntityId): Promise<void> { | ||
return this._adminApiClient.customRouteVariants.create({ | ||
id, | ||
}) as Promise<void>; | ||
} | ||
|
||
public restoreRouteVariants(): Promise<void> { | ||
return this._adminApiClient.customRouteVariants.delete() as Promise<void>; | ||
} | ||
|
||
public configClient(config: ApiClientConfig): void { | ||
return this._adminApiClient.configClient(config); | ||
} | ||
}; |
Oops, something went wrong.