// 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 {Organization} from '../models/organization.model.js'; import {OrganizationExcludingSkCreatedTimeClassifierUserIdPlanId} from '../models/organization-excluding-sk-created-time-classifier-user-id-plan-id.model.js'; /** * The service interface is generated from OpenAPI spec with operations tagged * by OrganizationController. */ export interface OrganizationService { /** * @param _requestBody * @returns OK */ verifyOrganization(_requestBody: {otp: string}): Promise; /** * @param orgId * @returns OK */ getOrganization(orgId: string): Promise; /** * @param _requestBody * @returns OK */ createOrganization( _requestBody: OrganizationExcludingSkCreatedTimeClassifierUserIdPlanId, ): Promise; /** * @returns OK */ getOrganizations(): Promise; } export class OrganizationServiceProvider 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: {OrganizationController: OrganizationService}; }>(this.dataSource); return service.apis['OrganizationController']; } }