isApiScope (api/types.ts)

deplao-builder · src/services/api/types.ts · typescript · MIT
crm, CRM / Leads

TypeScript definitions and helper for API scopes and principal validation.

// Source: https://github.com/babyvibe/deplao-builder | License: MIT | Copyright 2026 babyvibe
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * types.ts — kiểu dùng chung của Public API v1.
 *
 * Nguyên tắc (docs/api/README.md):
 *  - Mọi request quy về một Principal (API key | nhân viên | plugin).
 *  - Kiểm tra quyền chạy TRƯỚC khi vào IPC; route không chứa logic nghiệp vụ,
 *    chỉ map tham số → kênh IPC mà UI đang dùng → đóng gói kết quả.
 */

import type { Schema, ObjectSchema } from './schema';

// ─── Scope ───────────────────────────────────────────────────────────────────

export const API_SCOPES = [
    { id: 'accounts:read', group: 'Tài khoản', label: 'Xem danh sách tài khoản và trạng thái' },
    { id: 'accounts:manage', group: 'Tài khoản', label: 'Kết n

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

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

Get a free API key