Initial commit

This commit is contained in:
root
2025-12-21 09:57:43 -05:00
committed by Sebastian Krupinski
commit db42b6699c
35 changed files with 6458 additions and 0 deletions

57
src/models/service.ts Normal file
View File

@@ -0,0 +1,57 @@
/**
* Class model for Service Interface
*/
import type { ServiceInterface } from "@/types/service";
export class ServiceObject implements ServiceInterface {
_data!: ServiceInterface;
constructor() {
this._data = {
'@type': 'files:service',
id: '',
provider: '',
label: '',
rootId: '',
};
}
fromJson(data: ServiceInterface): ServiceObject {
this._data = data;
return this;
}
toJson(): ServiceInterface {
return this._data;
}
clone(): ServiceObject {
const cloned = new ServiceObject();
cloned._data = JSON.parse(JSON.stringify(this._data));
return cloned;
}
/** Immutable Properties */
get '@type'(): string {
return this._data['@type'];
}
get id(): string {
return this._data.id;
}
get provider(): string {
return this._data.provider;
}
get label(): string {
return this._data.label;
}
get rootId(): string {
return this._data.rootId;
}
}