// Copyright Abridged, Inc. 2023,2024. All Rights Reserved. // Node module: @collabland/sdk // This file is licensed under the MIT License. // License text available at https://opensource.org/license/mit/ import {inject, Provider} from '@loopback/core'; import {getService, RestDataSource} from '../datasources/index.js'; import {SnapshotExcludingPkSkClassifierIdClassifierGroupCreatedTimeSpace} from '../models/snapshot-excluding-pk-sk-classifier-id-classifier-group-created-time-space.model.js'; import {Snapshot} from '../models/snapshot.model.js'; import {SnapshotExcludingPkSkClassifierIdClassifierGroupCreatedTime} from '../models/snapshot-excluding-pk-sk-classifier-id-classifier-group-created-time.model.js'; /** * The service interface is generated from OpenAPI spec with operations tagged * by SnapshotController. */ export interface SnapshotService { /** * @param communityId * @param space * @param _requestBody * @returns OK */ updateSubscribedChannels( communityId: string, space: string, _requestBody: SnapshotExcludingPkSkClassifierIdClassifierGroupCreatedTimeSpace, ): Promise; /** * @param communityId * @param space */ uninstallMiniApp(communityId: string, space: string): Promise; /** * @param communityId * @param _requestBody * @returns OK */ subscribe( communityId: string, _requestBody: SnapshotExcludingPkSkClassifierIdClassifierGroupCreatedTime, ): Promise; /** * @param communityId * @returns OK */ getSubscribedSpaces(communityId: string): Promise; } export class SnapshotServiceProvider implements Provider { constructor( // rest must match the name property in the datasource json file @inject('datasources.rest') protected dataSource: RestDataSource = new RestDataSource(), ) {} async value(): Promise { const service = await getService<{ apis: {SnapshotController: SnapshotService}; }>(this.dataSource); return service.apis['SnapshotController']; } }