Skip to content

Commit

Permalink
migrate from "resource" to "service"
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinJump committed Apr 10, 2024
1 parent b7a7021 commit a40d685
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -36,7 +36,7 @@ export class ActionsResource {

}

export class MigrationsResource {
export class MigrationsService {

/**
* @returns unknown Success
Expand All @@ -52,7 +52,7 @@ export class MigrationsResource {

}

export class SettingsResource {
export class SettingsService {

/**
* @returns unknown Success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -22,11 +22,11 @@ export class uSyncActionDataSource implements SyncActionDataSource {
}

async getActions(): Promise<UmbDataSourceResponse<Array<SyncActionGroup>>> {
return await tryExecuteAndNotify(this.#host, ActionsResource.getActions());
return await tryExecuteAndNotify(this.#host, ActionsService.getActions());
}

async performAction(request : PerformActionRequest): Promise<UmbDataSourceResponse<PerformActionResponse>> {
return await tryExecuteAndNotify(this.#host, ActionsResource.performAction({
return await tryExecuteAndNotify(this.#host, ActionsService.performAction({
requestBody: request
}));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -15,6 +15,6 @@ export class uSyncMigrationDataSource {
}

async checkLegacy() : Promise<UmbDataSourceResponse<SyncLegacyCheckResponse>> {
return await tryExecuteAndNotify(this.#host, MigrationsResource.checkLegacy());
return await tryExecuteAndNotify(this.#host, MigrationsService.checkLegacy());
}
}
Original file line number Diff line number Diff line change
@@ -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<UmbDataSourceResponse<uSyncSettings>>;
Expand All @@ -18,11 +18,11 @@ export class uSyncSettingsDataSource implements SyncSettingsDataSource {
}

async getSettings(): Promise<UmbDataSourceResponse<uSyncSettings>> {
return await tryExecuteAndNotify(this.#host, SettingsResource.getSettings());
return await tryExecuteAndNotify(this.#host, SettingsService.getSettings());
}

async getHandlerSettings(setName : string) : Promise<UmbDataSourceResponse<uSyncHandlerSetSettings>> {
return await tryExecuteAndNotify(this.#host, SettingsResource.getHandlerSetSettings({ id : setName}));
return await tryExecuteAndNotify(this.#host, SettingsService.getHandlerSetSettings({ id : setName}));
}

}

0 comments on commit a40d685

Please sign in to comment.