// 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 {DiscordActionMetadata} from '../models/discord-action-metadata.model.js'; /** * The service interface is generated from OpenAPI spec with operations tagged * by HelloActionController. */ export interface HelloActionService { /** * @param xSignatureTimestamp * @param xSignatureEcdsa * @param xSignatureEd25519 * @param _requestBody */ handleEvent( xSignatureTimestamp: number, xSignatureEcdsa: string | undefined, xSignatureEd25519: string | undefined, _requestBody: string, ): Promise; /** * @param xSignatureTimestamp * @param xSignatureEcdsa * @param xSignatureEd25519 * @param _requestBody * @returns OK */ handleInteraction( xSignatureTimestamp: number, xSignatureEcdsa: string | undefined, xSignatureEd25519: string | undefined, _requestBody: string, ): Promise<{}>; /** * @returns OK */ loadMetadata(): Promise; } export class HelloActionServiceProvider 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: {HelloActionController: HelloActionService}; }>(this.dataSource); return service.apis['HelloActionController']; } }