// Copyright Abridged, Inc. 2022,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 {CheckCommunityConfigResponse} from '../models/check-community-config-response.model.js'; /** * The service interface is generated from OpenAPI spec with operations tagged * by RedditController. */ export interface RedditService { /** */ getAdminCommunities(): Promise; /** * @param _requestBody * @returns OK */ addCommunityConfig(_requestBody: {}): Promise<{ clientId?: string; communityName?: string; }>; /** * @param communityId * @returns OK */ isCommunityConfigSet( communityId: string, ): Promise; /** * @param communityId */ unlinkToken(communityId: string): Promise; /** */ createWalletConnectionSession(): Promise; } export class RedditServiceProvider 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: {RedditController: RedditService}}>( this.dataSource, ); return service.apis['RedditController']; } }