chore: reorganize docs apps (#7228)
* reorganize docs apps * add README * fix directory * add condition for old docs
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
---
|
||||
displayed_sidebar: apiKeyReference
|
||||
slug: /references/api-key/authenticate
|
||||
sidebar_label: authenticate
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# authenticate - API Key Module Reference
|
||||
|
||||
This documentation provides a reference to the `authenticate` method. This belongs to the API Key Module.
|
||||
|
||||
This method verifies whether a token is valid, considering it authenticated.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
const apiKey =
|
||||
await apiKeyModuleService.authenticate("AbCD123987")
|
||||
|
||||
if (!apiKey) {
|
||||
// authentication failed
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"token","type":"`string`","description":"The token to verify.","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="authenticate"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<false \\| [ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)>","optional":false,"defaultValue":"","description":"If the token is verified successfully, the API key associated with the token is returned. Otherwise, `false` is returned.","expandable":false,"children":[{"name":"false \\| ApiKeyDTO","type":"`false` \\| [ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="authenticate"/>
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
displayed_sidebar: apiKeyReference
|
||||
slug: /references/api-key/create
|
||||
sidebar_label: create
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# create - API Key Module Reference
|
||||
|
||||
This documentation provides a reference to the `create` method. This belongs to the API Key Module.
|
||||
|
||||
## create(data, sharedContext?): Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]>
|
||||
|
||||
This method creates API keys.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
const apiKey = await apiKeyModuleService.create([
|
||||
{
|
||||
title: "Development API key",
|
||||
type: "publishable",
|
||||
created_by: "user_123",
|
||||
},
|
||||
])
|
||||
```
|
||||
|
||||
### 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"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]>","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"/>
|
||||
|
||||
## create(data, sharedContext?): Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)>
|
||||
|
||||
This method creates an API key.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
const apiKey = await apiKeyModuleService.create({
|
||||
title: "Development API key",
|
||||
type: "publishable",
|
||||
created_by: "user_123"
|
||||
})
|
||||
```
|
||||
|
||||
### 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"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)>","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"/>
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
displayed_sidebar: apiKeyReference
|
||||
slug: /references/api-key/delete
|
||||
sidebar_label: delete
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# delete - API Key Module Reference
|
||||
|
||||
This documentation provides a reference to the `delete` method. This belongs to the API Key Module.
|
||||
|
||||
## delete(ids, sharedContext?): Promise<void>
|
||||
|
||||
This method deletes API keys by their IDs.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
await apiKeyModuleService.delete(["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"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"Resolves when the API keys are deleted successfully.","expandable":false,"children":[]}]} sectionTitle="delete"/>
|
||||
|
||||
## delete(id, sharedContext?): Promise<void>
|
||||
|
||||
This method deletes an API key by its ID.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
await apiKeyModuleService.delete("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"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"Resolves when the API key is deleted successfully.","expandable":false,"children":[]}]} sectionTitle="delete"/>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,27 @@
|
||||
---
|
||||
displayed_sidebar: apiKeyReference
|
||||
slug: /references/api-key/retrieve
|
||||
sidebar_label: retrieve
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# retrieve - API Key Module Reference
|
||||
|
||||
This documentation provides a reference to the `retrieve` 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")
|
||||
```
|
||||
|
||||
## 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)<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)>","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"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)>","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"/>
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
displayed_sidebar: apiKeyReference
|
||||
slug: /references/api-key/revoke
|
||||
sidebar_label: revoke
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# revoke - API Key Module Reference
|
||||
|
||||
This documentation provides a reference to the `revoke` method. This belongs to the API Key Module.
|
||||
|
||||
## revoke(selector, data, sharedContext?): Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]>
|
||||
|
||||
This method revokes API keys based on the filters provided.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
const apiKey = await apiKeyModuleService.revoke(
|
||||
{
|
||||
id: "apk_123",
|
||||
},
|
||||
{
|
||||
revoked_by: "user_123",
|
||||
// 1 minute
|
||||
revoke_in: 60,
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"selector","type":"[FilterableApiKeyProps](../../../interfaces/api_key.FilterableApiKeyProps/page.mdx)","description":"The filters to specify which API keys should be revoked.","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)<[FilterableApiKeyProps](../../../interfaces/api_key.FilterableApiKeyProps/page.mdx)>)[]","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)<[FilterableApiKeyProps](../../../interfaces/api_key.FilterableApiKeyProps/page.mdx)>)[]","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":"[RevokeApiKeyDTO](../../../interfaces/api_key.RevokeApiKeyDTO/page.mdx)","description":"The details of revoking the API keys.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"revoked_by","type":"`string`","description":"Who revoked the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoke_in","type":"`number`","description":"When to revoke the API key (time in seconds).","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="revoke"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]>","optional":false,"defaultValue":"","description":"The revoked 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="revoke"/>
|
||||
|
||||
## revoke(id, data, sharedContext?): Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)>
|
||||
|
||||
This method revokes an API key based on the ID provided.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
const apiKey = await apiKeyModuleService.revoke("apk_123", {
|
||||
revoked_by: "user_123",
|
||||
// 1 minute
|
||||
revoke_in: 60,
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the API key to revoke.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[RevokeApiKeyDTO](../../../interfaces/api_key.RevokeApiKeyDTO/page.mdx)","description":"The details of revoking the API key.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"revoked_by","type":"`string`","description":"Who revoked the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revoke_in","type":"`number`","description":"When to revoke the API key (time in seconds).","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="revoke"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)>","optional":false,"defaultValue":"","description":"The revoked 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="revoke"/>
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
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<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)>
|
||||
|
||||
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<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)>","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<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]>
|
||||
|
||||
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)<[FilterableApiKeyProps](../../../interfaces/api_key.FilterableApiKeyProps/page.mdx)>)[]","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)<[FilterableApiKeyProps](../../../interfaces/api_key.FilterableApiKeyProps/page.mdx)>)[]","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<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]>","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"/>
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
displayed_sidebar: apiKeyReference
|
||||
slug: /references/api-key/upsert
|
||||
sidebar_label: upsert
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# upsert - API Key Module Reference
|
||||
|
||||
This documentation provides a reference to the `upsert` method. This belongs to the API Key Module.
|
||||
|
||||
## upsert(data, sharedContext?): Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]>
|
||||
|
||||
This method updates or creates API keys if they don't exist.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
const apiKey = await apiKeyModuleService.upsert([
|
||||
{
|
||||
id: "apk_123",
|
||||
title: "My development key",
|
||||
},
|
||||
{
|
||||
title: "New development key",
|
||||
type: "secret",
|
||||
created_by: "user_123",
|
||||
},
|
||||
])
|
||||
```
|
||||
|
||||
### 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"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)[]>","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"/>
|
||||
|
||||
## upsert(data, sharedContext?): Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)>
|
||||
|
||||
This method updates or creates an API key if it doesn't exist.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
const apiKey = await apiKeyModuleService.upsert({
|
||||
id: "apk_123",
|
||||
title: "My development key"
|
||||
})
|
||||
```
|
||||
|
||||
### 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"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ApiKeyDTO](../../../interfaces/api_key.ApiKeyDTO/page.mdx)>","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"/>
|
||||
Reference in New Issue
Block a user