Skip to main content

ApiKey

Defined in: domain/ApiKey.ts:16

Represents an API key entity. Extends Deletable to support soft deletion.

Remarks

Each API key is associated with a specific project.

Example

const apiKey = new ApiKey(101, 1, "key-xyz", new Date(), null);
console.log(apiKey.key);

Extends

Constructors

Constructor

new ApiKey(
project_id,
id?,
key?,
createdAt?,
deletedAt?): ApiKey;

Defined in: domain/ApiKey.ts:32

Creates a new ApiKey instance.

Parameters

project_id

number

The ID of the project this API key belongs to.

id?

number

The unique identifier for the API key.

key?

string

The API key value.

createdAt?

Date

The date the API key was created.

deletedAt?

The date the API key was deleted (if applicable).

null | Date

Returns

ApiKey

Overrides

Deletable.constructor

Properties

createdAt?

optional createdAt: Date;

Defined in: domain/ApiKey.ts:22

The creation date of the API key.


deleted

deleted: boolean;

Defined in: types/Deletable.ts:21

Indicates whether the entity is deleted.

Inherited from

Deletable.deleted


deletedAt

deletedAt: null | Date;

Defined in: types/Deletable.ts:23

The date the entity was deleted, or null if not deleted.

Inherited from

Deletable.deletedAt


id?

optional id: number;

Defined in: types/Id.ts:15

The unique identifier for the entity.

Inherited from

Deletable.id


key?

optional key: string;

Defined in: domain/ApiKey.ts:20

The API key value.


project_id

project_id: number;

Defined in: domain/ApiKey.ts:18

The ID of the project this API key belongs to.