Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.

Commit abb3c23

Browse files
Add BaseService class to server-core package (#9385)
1 parent efb6a48 commit abb3c23

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
CPAL-1.0 License
3+
4+
The contents of this file are subject to the Common Public Attribution License
5+
Version 1.0. (the "License"); you may not use this file except in compliance
6+
with the License. You may obtain a copy of the License at
7+
https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE.
8+
The License is based on the Mozilla Public License Version 1.1, but Sections 14
9+
and 15 have been added to cover use of software over a computer network and
10+
provide for limited attribution for the Original Developer. In addition,
11+
Exhibit A has been modified to be consistent with Exhibit B.
12+
13+
Software distributed under the License is distributed on an "AS IS" basis,
14+
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the
15+
specific language governing rights and limitations under the License.
16+
17+
The Original Code is Ethereal Engine.
18+
19+
The Original Developer is the Initial Developer. The Initial Developer of the
20+
Original Code is the Ethereal Engine team.
21+
22+
All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023
23+
Ethereal Engine. All Rights Reserved.
24+
*/
25+
26+
import { Application, Id, NullableId, PaginationParams, Params, ServiceMethods } from '@feathersjs/feathers'
27+
28+
export class BaseService<Result, Data = Partial<Result>, ServiceParams = Params, PatchData = Partial<Data>>
29+
implements ServiceMethods<Result, Data, ServiceParams, PatchData>
30+
{
31+
find(params?: (ServiceParams & { paginate?: PaginationParams | undefined }) | undefined): Promise<Result[]> {
32+
return Promise.resolve([{} as Result])
33+
}
34+
get(id: Id, params?: ServiceParams | undefined): Promise<Result> {
35+
return Promise.resolve({} as Result)
36+
}
37+
create(data: Data, params?: ServiceParams | undefined): Promise<Result> {
38+
return Promise.resolve({} as Result)
39+
}
40+
update(id: NullableId, data: Data, params?: ServiceParams | undefined): Promise<Result | Result[]> {
41+
return Promise.resolve({} as Result)
42+
}
43+
patch(id: NullableId, data: PatchData, params?: ServiceParams | undefined): Promise<Result | Result[]> {
44+
return Promise.resolve({} as Result)
45+
}
46+
remove(id: NullableId, params?: ServiceParams | undefined): Promise<Result | Result[]> {
47+
return Promise.resolve({} as Result)
48+
}
49+
setup?(app: Application<any, any>, path: string): Promise<void> {
50+
return Promise.resolve()
51+
}
52+
teardown?(app: Application<any, any>, path: string): Promise<void> {
53+
return Promise.resolve()
54+
}
55+
}

0 commit comments

Comments
 (0)