generate references (#7882)

This commit is contained in:
Shahed Nasser
2024-07-01 16:02:36 +03:00
committed by GitHub
parent b9036eca1a
commit dd864da4e0
2424 changed files with 106679 additions and 116201 deletions

View File

@@ -1,23 +1,23 @@
---
displayed_sidebar: apiKeyReference
slug: /references/api-key/create
sidebar_label: create
slug: /references/api-key/createApiKeys
sidebar_label: createApiKeys
---
import { TypeList } from "docs-ui"
# create - API Key Module Reference
# createApiKeys - API Key Module Reference
This documentation provides a reference to the `create` method. This belongs to the API Key Module.
This documentation provides a reference to the `createApiKeys` method. This belongs to the API Key Module.
## create(data, sharedContext?): Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]>
## createApiKeys(data, sharedContext?): Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]>
This method creates API keys.
### Example
```ts
const apiKey = await apiKeyModuleService.create([
const apiKey = await apiKeyModuleService.createApiKeys([
{
title: "Development API key",
type: "publishable",
@@ -28,20 +28,20 @@ const apiKey = await apiKeyModuleService.create([
### Parameters
<TypeList types={[{"name":"data","type":"[CreateApiKeyDTO](../../../interfaces/api_key.CreateApiKeyDTO/page.mdx)[]","description":"The API keys to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The title of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="create"/>
<TypeList types={[{"name":"data","type":"[CreateApiKeyDTO](../../../interfaces/api_key.CreateApiKeyDTO/page.mdx)[]","description":"The API keys to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The title of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createApiKeys"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The created API keys.","expandable":false,"children":[{"name":"ApiKeyDTO[]","type":"[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ApiKeyDTO","type":"`object`","description":"The API key details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="create"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The created API keys.","expandable":false,"children":[{"name":"ApiKeyDTO[]","type":"[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ApiKeyDTO","type":"`object`","description":"The API key details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createApiKeys"/>
## create(data, sharedContext?): Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)&#62;
## createApiKeys(data, sharedContext?): Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)&#62;
This method creates an API key.
### Example
```ts
const apiKey = await apiKeyModuleService.create({
const apiKey = await apiKeyModuleService.createApiKeys({
title: "Development API key",
type: "publishable",
created_by: "user_123"
@@ -50,8 +50,8 @@ const apiKey = await apiKeyModuleService.create({
### Parameters
<TypeList types={[{"name":"data","type":"[CreateApiKeyDTO](../../../interfaces/api_key.CreateApiKeyDTO/page.mdx)","description":"The API key to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The title of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="create"/>
<TypeList types={[{"name":"data","type":"[CreateApiKeyDTO](../../../interfaces/api_key.CreateApiKeyDTO/page.mdx)","description":"The API key to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The title of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createApiKeys"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The created API key.","expandable":false,"children":[{"name":"ApiKeyDTO","type":"[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)","optional":false,"defaultValue":"","description":"The API key details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"token","type":"`string`","description":"The token of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"redacted","type":"`string`","description":"The redacted form of the API key's token. This is useful\nwhen showing portion of the token. For example `sk_...123`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_used_at","type":"`null` \\| `Date`","description":"The date the API key was last used.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"The date the API key was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_by","type":"`null` \\| `string`","description":"Who revoked the API key. For example,\nthe ID of the user that revoked it.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_at","type":"`null` \\| `Date`","description":"The date the API key was revoked.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="create"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The created API key.","expandable":false,"children":[{"name":"ApiKeyDTO","type":"[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)","optional":false,"defaultValue":"","description":"The API key details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"token","type":"`string`","description":"The token of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"redacted","type":"`string`","description":"The redacted form of the API key's token. This is useful\nwhen showing portion of the token. For example `sk_...123`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_used_at","type":"`null` \\| `Date`","description":"The date the API key was last used.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"The date the API key was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_by","type":"`null` \\| `string`","description":"Who revoked the API key. For example,\nthe ID of the user that revoked it.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_at","type":"`null` \\| `Date`","description":"The date the API key was revoked.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createApiKeys"/>

View File

@@ -1,47 +1,47 @@
---
displayed_sidebar: apiKeyReference
slug: /references/api-key/delete
sidebar_label: delete
slug: /references/api-key/deleteApiKeys
sidebar_label: deleteApiKeys
---
import { TypeList } from "docs-ui"
# delete - API Key Module Reference
# deleteApiKeys - API Key Module Reference
This documentation provides a reference to the `delete` method. This belongs to the API Key Module.
This documentation provides a reference to the `deleteApiKeys` method. This belongs to the API Key Module.
## delete(ids, sharedContext?): Promise&#60;void&#62;
## deleteApiKeys(ids, sharedContext?): Promise&#60;void&#62;
This method deletes API keys by their IDs.
### Example
```ts
await apiKeyModuleService.delete(["apk_123"])
await apiKeyModuleService.deleteApiKeys(["apk_123"])
```
### Parameters
<TypeList types={[{"name":"ids","type":"`string`[]","description":"The IDs of the API keys.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="delete"/>
<TypeList types={[{"name":"ids","type":"`string`[]","description":"The IDs of the API keys.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteApiKeys"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the API keys are deleted successfully.","expandable":false,"children":[]}]} sectionTitle="delete"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the API keys are deleted successfully.","expandable":false,"children":[]}]} sectionTitle="deleteApiKeys"/>
## delete(id, sharedContext?): Promise&#60;void&#62;
## deleteApiKeys(id, sharedContext?): Promise&#60;void&#62;
This method deletes an API key by its ID.
### Example
```ts
await apiKeyModuleService.delete("apk_123")
await apiKeyModuleService.deleteApiKeys("apk_123")
```
### Parameters
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="delete"/>
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteApiKeys"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the API key is deleted successfully.","expandable":false,"children":[]}]} sectionTitle="delete"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the API key is deleted successfully.","expandable":false,"children":[]}]} sectionTitle="deleteApiKeys"/>

View File

@@ -1,27 +1,27 @@
---
displayed_sidebar: apiKeyReference
slug: /references/api-key/retrieve
sidebar_label: retrieve
slug: /references/api-key/retrieveApiKey
sidebar_label: retrieveApiKey
---
import { TypeList } from "docs-ui"
# retrieve - API Key Module Reference
# retrieveApiKey - API Key Module Reference
This documentation provides a reference to the `retrieve` method. This belongs to the API Key Module.
This documentation provides a reference to the `retrieveApiKey` method. This belongs to the API Key Module.
This method retrieves an API key by its ID.
## Example
```ts
const apiKey = await apiKeyModuleService.retrieve("apk_123")
const apiKey = await apiKeyModuleService.retrieveApiKey("apk_123")
```
## Parameters
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/api_key.FindConfig/page.mdx)&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)&#62;","description":"The configurations determining how the API key is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a api key.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieve"/>
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/api_key.FindConfig/page.mdx)&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)&#62;","description":"The configurations determining how the API key is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a api key.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, any>`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieveApiKey"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The retrieved API key.","expandable":false,"children":[{"name":"ApiKeyDTO","type":"[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)","optional":false,"defaultValue":"","description":"The API key details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"token","type":"`string`","description":"The token of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"redacted","type":"`string`","description":"The redacted form of the API key's token. This is useful\nwhen showing portion of the token. For example `sk_...123`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_used_at","type":"`null` \\| `Date`","description":"The date the API key was last used.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"The date the API key was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_by","type":"`null` \\| `string`","description":"Who revoked the API key. For example,\nthe ID of the user that revoked it.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_at","type":"`null` \\| `Date`","description":"The date the API key was revoked.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="retrieve"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The retrieved API key.","expandable":false,"children":[{"name":"ApiKeyDTO","type":"[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)","optional":false,"defaultValue":"","description":"The API key details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"token","type":"`string`","description":"The token of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"redacted","type":"`string`","description":"The redacted form of the API key's token. This is useful\nwhen showing portion of the token. For example `sk_...123`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_used_at","type":"`null` \\| `Date`","description":"The date the API key was last used.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"The date the API key was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_by","type":"`null` \\| `string`","description":"Who revoked the API key. For example,\nthe ID of the user that revoked it.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_at","type":"`null` \\| `Date`","description":"The date the API key was revoked.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="retrieveApiKey"/>

View File

@@ -1,56 +0,0 @@
---
displayed_sidebar: apiKeyReference
slug: /references/api-key/update
sidebar_label: update
---
import { TypeList } from "docs-ui"
# update - API Key Module Reference
This documentation provides a reference to the `update` method. This belongs to the API Key Module.
## update(id, data, sharedContext?): Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)&#62;
This method updates an existing API key.
### Example
```ts
const apiKey = await apiKeyModuleService.update("apk_123", {
title: "My development key"
})
```
### Parameters
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[UpdateApiKeyDTO](../../../interfaces/api_key.UpdateApiKeyDTO/page.mdx)","description":"The attributes to update in the API key.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The title of the API key.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="update"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The updated API key.","expandable":false,"children":[{"name":"ApiKeyDTO","type":"[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)","optional":false,"defaultValue":"","description":"The API key details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"token","type":"`string`","description":"The token of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"redacted","type":"`string`","description":"The redacted form of the API key's token. This is useful\nwhen showing portion of the token. For example `sk_...123`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_used_at","type":"`null` \\| `Date`","description":"The date the API key was last used.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"The date the API key was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_by","type":"`null` \\| `string`","description":"Who revoked the API key. For example,\nthe ID of the user that revoked it.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_at","type":"`null` \\| `Date`","description":"The date the API key was revoked.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="update"/>
## update(selector, data, sharedContext?): Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]&#62;
This method updates existing API keys.
### Example
```ts
const apiKey = await apiKeyModuleService.update(
{
title: "Development key",
},
{
title: "My development key",
}
)
```
### Parameters
<TypeList types={[{"name":"selector","type":"[FilterableApiKeyProps](../../../interfaces/api_key.FilterableApiKeyProps/page.mdx)","description":"The filters that specify which API keys should be updated.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the API keys by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"token","type":"`string` \\| `string`[]","description":"The tokens to filter the API keys by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"The titles to filter the API keys by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"Filter the API keys by their type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([FilterableApiKeyProps](../../../interfaces/api_key.FilterableApiKeyProps/page.mdx) \\| [BaseFilterable](../../../interfaces/api_key.BaseFilterable/page.mdx)&#60;[FilterableApiKeyProps](../../../interfaces/api_key.FilterableApiKeyProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableApiKeyProps](../../../interfaces/api_key.FilterableApiKeyProps/page.mdx) \\| [BaseFilterable](../../../interfaces/api_key.BaseFilterable/page.mdx)&#60;[FilterableApiKeyProps](../../../interfaces/api_key.FilterableApiKeyProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"data","type":"[UpdateApiKeyDTO](../../../interfaces/api_key.UpdateApiKeyDTO/page.mdx)","description":"The attributes to update in the API keys.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The title of the API key.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="update"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The updated API keys.","expandable":false,"children":[{"name":"ApiKeyDTO[]","type":"[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ApiKeyDTO","type":"`object`","description":"The API key details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="update"/>

View File

@@ -1,23 +1,23 @@
---
displayed_sidebar: apiKeyReference
slug: /references/api-key/upsert
sidebar_label: upsert
slug: /references/api-key/upsertApiKeys
sidebar_label: upsertApiKeys
---
import { TypeList } from "docs-ui"
# upsert - API Key Module Reference
# upsertApiKeys - API Key Module Reference
This documentation provides a reference to the `upsert` method. This belongs to the API Key Module.
This documentation provides a reference to the `upsertApiKeys` method. This belongs to the API Key Module.
## upsert(data, sharedContext?): Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]&#62;
## upsertApiKeys(data, sharedContext?): Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]&#62;
This method updates or creates API keys if they don't exist.
### Example
```ts
const apiKey = await apiKeyModuleService.upsert([
const apiKey = await apiKeyModuleService.upsertApiKeys([
{
id: "apk_123",
title: "My development key",
@@ -32,20 +32,20 @@ const apiKey = await apiKeyModuleService.upsert([
### Parameters
<TypeList types={[{"name":"data","type":"[UpsertApiKeyDTO](../../../interfaces/api_key.UpsertApiKeyDTO/page.mdx)[]","description":"The attributes in the API keys that are created or updated.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the API key.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key. Required only when creating an API key.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key. It's only\nusable and required when creating an API key.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="upsert"/>
<TypeList types={[{"name":"data","type":"[UpsertApiKeyDTO](../../../interfaces/api_key.UpsertApiKeyDTO/page.mdx)[]","description":"The attributes in the API keys that are created or updated.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the API key.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key. Required only when creating an API key.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key. It's only\nusable and required when creating an API key.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="upsertApiKeys"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The created or updated API keys.","expandable":false,"children":[{"name":"ApiKeyDTO[]","type":"[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ApiKeyDTO","type":"`object`","description":"The API key details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="upsert"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The created or updated API keys.","expandable":false,"children":[{"name":"ApiKeyDTO[]","type":"[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ApiKeyDTO","type":"`object`","description":"The API key details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="upsertApiKeys"/>
## upsert(data, sharedContext?): Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)&#62;
## upsertApiKeys(data, sharedContext?): Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)&#62;
This method updates or creates an API key if it doesn't exist.
### Example
```ts
const apiKey = await apiKeyModuleService.upsert({
const apiKey = await apiKeyModuleService.upsertApiKeys({
id: "apk_123",
title: "My development key"
})
@@ -53,8 +53,8 @@ const apiKey = await apiKeyModuleService.upsert({
### Parameters
<TypeList types={[{"name":"data","type":"[UpsertApiKeyDTO](../../../interfaces/api_key.UpsertApiKeyDTO/page.mdx)","description":"The attributes in the API key that's created or updated.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the API key.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key. Required only when creating an API key.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key. It's only\nusable and required when creating an API key.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="upsert"/>
<TypeList types={[{"name":"data","type":"[UpsertApiKeyDTO](../../../interfaces/api_key.UpsertApiKeyDTO/page.mdx)","description":"The attributes in the API key that's created or updated.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the API key.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key. Required only when creating an API key.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key. It's only\nusable and required when creating an API key.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/api_key.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/api_key.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="upsertApiKeys"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The created or updated API key.","expandable":false,"children":[{"name":"ApiKeyDTO","type":"[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)","optional":false,"defaultValue":"","description":"The API key details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"token","type":"`string`","description":"The token of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"redacted","type":"`string`","description":"The redacted form of the API key's token. This is useful\nwhen showing portion of the token. For example `sk_...123`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_used_at","type":"`null` \\| `Date`","description":"The date the API key was last used.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"The date the API key was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_by","type":"`null` \\| `string`","description":"Who revoked the API key. For example,\nthe ID of the user that revoked it.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_at","type":"`null` \\| `Date`","description":"The date the API key was revoked.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="upsert"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The created or updated API key.","expandable":false,"children":[{"name":"ApiKeyDTO","type":"[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)","optional":false,"defaultValue":"","description":"The API key details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"token","type":"`string`","description":"The token of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"redacted","type":"`string`","description":"The redacted form of the API key's token. This is useful\nwhen showing portion of the token. For example `sk_...123`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[ApiKeyType](../../../types/api_key.ApiKeyType/page.mdx)","description":"The type of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_used_at","type":"`null` \\| `Date`","description":"The date the API key was last used.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"The date the API key was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_by","type":"`null` \\| `string`","description":"Who revoked the API key. For example,\nthe ID of the user that revoked it.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_at","type":"`null` \\| `Date`","description":"The date the API key was revoked.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="upsertApiKeys"/>