createRoleEntity (definitions/entities.ts)

webiny-js · packages/api-core-ddb/src/security/definitions/entities.ts · typescript · MIT
database, tag:embed-classified

Factory functions to create DynamoDB entities for roles, teams, and API keys.

// Source: https://github.com/webiny/webiny-js | License: MIT | Copyright Webiny Inc
// Provided via justclaw.it.com; keep this notice with the code.
import { createStandardEntity, standardEntityAttributes } from "@webiny/db-dynamodb";
import type { StorageApiKey, StorageRole, StorageTeam } from "@webiny/api-core/types/security.js";
import type { Table } from "@webiny/db-dynamodb/toolbox.js";
import { ENTITIES } from "../types.js";
import type { IApiKeyEntity, IRoleEntity, ITeamEntity } from "~/security/definitions/types.js";

export const createRoleEntity = (table: Table<string, string, string>): IRoleEntity => {
    return createStandardEntity<StorageRole>({
        name: ENTITIES.ROLE,
        table
    });
};

export const createTeamEntity = (table: Table<string, string, string>): ITea

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key