feat: Add skeleton for api key module (#6451)

Adds a module skeleton for the API Key module.
Implementation of functionalities will follow in separate PRs
This commit is contained in:
Stevche Radevski authored and GitHub committed 2024-02-20 12:28:57 +00:00
1 parent cfefd59249
commit 269be1b64a
30 files changed
+616

No files matched your search

@@ -0,0 +1,8 @@
import { BaseFilterable } from "../../dal"
// TODO:
export interface ApiKeyDTO {}
// TODO:
export interface FilterableApiKeyProps
extends BaseFilterable<FilterableApiKeyProps> {}
@@ -0,0 +1 @@
export * from "./api-key"
+3
View File
@@ -0,0 +1,3 @@
export * from "./common"
export * from "./mutations"
export * from "./service"
@@ -0,0 +1,5 @@
// TODO:
export interface CreateApiKeyDTO {}
// TODO:
export interface UpdateApiKeyDTO {}
@@ -0,0 +1 @@
export * from "./api-key"
+81
View File
@@ -0,0 +1,81 @@
import { IModuleService } from "../modules-sdk"
import { ApiKeyDTO, FilterableApiKeyProps } from "./common"
import { FindConfig } from "../common"
import { Context } from "../shared-context"
import { CreateApiKeyDTO, UpdateApiKeyDTO } from "./mutations"
export interface IApiKeyModuleService extends IModuleService {
/**
* Create a new api key
* @param data
* @param sharedContext
*/
create(data: CreateApiKeyDTO[], sharedContext?: Context): Promise<ApiKeyDTO[]>
create(data: CreateApiKeyDTO, sharedContext?: Context): Promise<ApiKeyDTO>
/**
* Update an api key
* @param data
* @param sharedContext
*/
update(data: UpdateApiKeyDTO[], sharedContext?: Context): Promise<ApiKeyDTO[]>
update(data: UpdateApiKeyDTO, sharedContext?: Context): Promise<ApiKeyDTO>
/**
* Delete an api key
* @param ids
* @param sharedContext
*/
delete(ids: string[], sharedContext?: Context): Promise<void>
delete(id: string, sharedContext?: Context): Promise<void>
/**
* Retrieve an api key
* @param id
* @param config
* @param sharedContext
*/
retrieve(
id: string,
config?: FindConfig<ApiKeyDTO>,
sharedContext?: Context
): Promise<ApiKeyDTO>
/**
* List api keys
* @param filters
* @param config
* @param sharedContext
*/
list(
filters?: FilterableApiKeyProps,
config?: FindConfig<ApiKeyDTO>,
sharedContext?: Context
): Promise<ApiKeyDTO[]>
/**
* List and count api keys
* @param filters
* @param config
* @param sharedContext
*/
listAndCount(
filters?: FilterableApiKeyProps,
config?: FindConfig<ApiKeyDTO>,
sharedContext?: Context
): Promise<[ApiKeyDTO[], number]>
/**
* Revokes an api key
* @param id
* @param sharedContext
*/
revoke(id: string, sharedContext?: Context): Promise<void>
/**
* Check the validity of an api key
* @param id
* @param sharedContext
*/
authenticate(id: string, sharedContext?: Context): Promise<boolean>
}
+1
View File
@@ -22,3 +22,4 @@ export * as TaxTypes from "./tax"
export * as TransactionBaseTypes from "./transaction-base"
export * as UserTypes from "./user"
export * as WorkflowTypes from "./workflow"
export * as ApiKeyTypes from "./api-key"
+1
View File
@@ -32,3 +32,4 @@ export * from "./totals"
export * from "./transaction-base"
export * from "./user"
export * from "./workflow"
export * from "./api-key"