From a40d685ad3164804ee6255fcb027e27a1f019a08 Mon Sep 17 00:00:00 2001 From: Kevin Jump Date: Wed, 10 Apr 2024 15:49:19 +0100 Subject: [PATCH] migrate from "resource" to "service" --- .../usync-assets/package.json | 2 +- .../usync-assets/src/api/services.ts | 6 +++--- .../src/repository/sources/SyncAction.source.ts | 6 +++--- .../src/repository/sources/SyncMigration.source.ts | 4 ++-- .../src/repository/sources/SyncSettings.source.ts | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/uSync.Backoffice.Management.Client/usync-assets/package.json b/uSync.Backoffice.Management.Client/usync-assets/package.json index 0d656e30..330fdd45 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/package.json +++ b/uSync.Backoffice.Management.Client/usync-assets/package.json @@ -36,7 +36,7 @@ "build": "tsc && vite build", "preview": "vite preview", "watch": "vite build --watch", - "generate": "openapi-ts --input %npm_package_config_server%/%npm_package_config_swagger% --output src/api --debug true --enums typescript --lint true --postfixServices Resource --schemas false", + "generate": "openapi-ts --input %npm_package_config_server%/%npm_package_config_swagger% --output src/api --debug true --enums typescript --lint true --schemas false", "dist": "tsc && vite build --config ./vite.dist.config.ts && npm pack --pack-destination ./pack " }, "dependencies": { diff --git a/uSync.Backoffice.Management.Client/usync-assets/src/api/services.ts b/uSync.Backoffice.Management.Client/usync-assets/src/api/services.ts index 71182cc0..bff2465c 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/src/api/services.ts +++ b/uSync.Backoffice.Management.Client/usync-assets/src/api/services.ts @@ -3,7 +3,7 @@ import { OpenAPI } from './core/OpenAPI'; import { request as __request } from './core/request'; import type { ActionsData, MigrationsData, SettingsData } from './models'; -export class ActionsResource { +export class ActionsService { /** * @returns unknown Success @@ -36,7 +36,7 @@ export class ActionsResource { } -export class MigrationsResource { +export class MigrationsService { /** * @returns unknown Success @@ -52,7 +52,7 @@ export class MigrationsResource { } -export class SettingsResource { +export class SettingsService { /** * @returns unknown Success diff --git a/uSync.Backoffice.Management.Client/usync-assets/src/repository/sources/SyncAction.source.ts b/uSync.Backoffice.Management.Client/usync-assets/src/repository/sources/SyncAction.source.ts index b2e4c8eb..4f84b6f0 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/src/repository/sources/SyncAction.source.ts +++ b/uSync.Backoffice.Management.Client/usync-assets/src/repository/sources/SyncAction.source.ts @@ -2,7 +2,7 @@ import { UmbControllerHost } from "@umbraco-cms/backoffice/controller-api"; import { UmbDataSourceResponse } from "@umbraco-cms/backoffice/repository"; import { tryExecuteAndNotify } from '@umbraco-cms/backoffice/resources'; import { - ActionsResource, + ActionsService, PerformActionRequest, PerformActionResponse, SyncActionGroup, @@ -22,11 +22,11 @@ export class uSyncActionDataSource implements SyncActionDataSource { } async getActions(): Promise>> { - return await tryExecuteAndNotify(this.#host, ActionsResource.getActions()); + return await tryExecuteAndNotify(this.#host, ActionsService.getActions()); } async performAction(request : PerformActionRequest): Promise> { - return await tryExecuteAndNotify(this.#host, ActionsResource.performAction({ + return await tryExecuteAndNotify(this.#host, ActionsService.performAction({ requestBody: request })); } diff --git a/uSync.Backoffice.Management.Client/usync-assets/src/repository/sources/SyncMigration.source.ts b/uSync.Backoffice.Management.Client/usync-assets/src/repository/sources/SyncMigration.source.ts index 7fbf6729..2d08cdfa 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/src/repository/sources/SyncMigration.source.ts +++ b/uSync.Backoffice.Management.Client/usync-assets/src/repository/sources/SyncMigration.source.ts @@ -1,6 +1,6 @@ import { UmbControllerHost } from "@umbraco-cms/backoffice/controller-api"; import { UmbDataSourceResponse } from "@umbraco-cms/backoffice/repository"; -import { MigrationsResource, SyncLegacyCheckResponse } from "../../api"; +import { MigrationsService, SyncLegacyCheckResponse } from "../../api"; import { tryExecuteAndNotify } from "@umbraco-cms/backoffice/resources"; export interface SyncMigrationDataSource { @@ -15,6 +15,6 @@ export class uSyncMigrationDataSource { } async checkLegacy() : Promise> { - return await tryExecuteAndNotify(this.#host, MigrationsResource.checkLegacy()); + return await tryExecuteAndNotify(this.#host, MigrationsService.checkLegacy()); } } \ No newline at end of file diff --git a/uSync.Backoffice.Management.Client/usync-assets/src/repository/sources/SyncSettings.source.ts b/uSync.Backoffice.Management.Client/usync-assets/src/repository/sources/SyncSettings.source.ts index 94cefd5b..3f746aaa 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/src/repository/sources/SyncSettings.source.ts +++ b/uSync.Backoffice.Management.Client/usync-assets/src/repository/sources/SyncSettings.source.ts @@ -1,7 +1,7 @@ import { UmbDataSourceResponse } from "@umbraco-cms/backoffice/repository"; import { UmbControllerHost } from "@umbraco-cms/backoffice/controller-api"; import { tryExecuteAndNotify } from "@umbraco-cms/backoffice/resources"; -import { SettingsResource, uSyncHandlerSetSettings, uSyncSettings } from "../../api"; +import { SettingsService, uSyncHandlerSetSettings, uSyncSettings } from "../../api"; export interface SyncSettingsDataSource { getSettings() : Promise>; @@ -18,11 +18,11 @@ export class uSyncSettingsDataSource implements SyncSettingsDataSource { } async getSettings(): Promise> { - return await tryExecuteAndNotify(this.#host, SettingsResource.getSettings()); + return await tryExecuteAndNotify(this.#host, SettingsService.getSettings()); } async getHandlerSettings(setName : string) : Promise> { - return await tryExecuteAndNotify(this.#host, SettingsResource.getHandlerSetSettings({ id : setName})); + return await tryExecuteAndNotify(this.#host, SettingsService.getHandlerSetSettings({ id : setName})); } } \ No newline at end of file