// Copyright Abridged, Inc. 2021,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 {ClientApplication} from '../models/client-application.model.js'; import {ClientApplicationExcludingCreatedByIdSkClassifierStatusRequestedScopesAllowedScopesDisallowedScopesTenantActionsStatusApiKeyApiKeyHashSecretIdCreatedByIdCreatedByNameCreatedTime} from '../models/client-application-excluding-created-by-id-sk-classifier-status-requested-scopes-allowed-scopes-disallowed-scopes-tenant-actions-status-api-key-api-key-hash-secret-id-created-by-id-created-by-name-created-time.model.js'; /** * The service interface is generated from OpenAPI spec with operations tagged * by ClientApplicationController. */ export interface ClientApplicationService { /** * @param organizationId * @returns OK */ getClientAppsForOrg(organizationId: string): Promise; /** * @param clientAppId * @returns OK */ resetApiKey(clientAppId: string): Promise; /** * @param id * @param _requestBody */ replaceById(id: string, _requestBody: {}): Promise; /** * @param id * @param _requestBody * @returns OK */ updateClientAppRequest( id: string, _requestBody: { name: string; }, ): Promise; /** * @param id * @returns ClientApplication model instance */ findById(id: string): Promise; /** * @param id */ deleteClientAppRequest(id: string): Promise; /** * @param _requestBody * @returns OK */ createClientAppRequest( _requestBody: ClientApplicationExcludingCreatedByIdSkClassifierStatusRequestedScopesAllowedScopesDisallowedScopesTenantActionsStatusApiKeyApiKeyHashSecretIdCreatedByIdCreatedByNameCreatedTime, ): Promise; /** * @param limit * @param paginationToken * @returns Result set of ClientApplication model instances */ find( limit?: number, paginationToken?: string, ): Promise<{ paginationToken?: string; items?: ClientApplication[]; }>; } export class ClientApplicationServiceProvider 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: {ClientApplicationController: ClientApplicationService}; }>(this.dataSource); return service.apis['ClientApplicationController']; } }