DomainSchemaClient
Defined in: js-api/src/dapi.ts:1523
Lifecycle handle for one registered domain schema (see DomainsDataSource.schema): manifest export, partial applies with dry-run change plans, whole-schema audit, and full purge. Mutations apply to user-managed schemas only (package schemas deploy on publish). A name the registry does not have (never registered, or deleted since) rejects every call with a DomainNotFoundError.
Constructors
Constructor
new DomainSchemaClient(
dart,name):DomainSchemaClient
Defined in: js-api/src/dapi.ts:1526
Parameters
| Parameter | Type |
|---|---|
dart | any |
name | string |
Returns
DomainSchemaClient
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
dart | public | any | js-api/src/dapi.ts:1524 |
name | readonly | string | js-api/src/dapi.ts:1526 |
Methods
access()
access():
Promise<DomainSchemaAccess>
Defined in: js-api/src/dapi.ts:1542
The lossless access snapshot of the schema for its editor (DomainSchemaAccess): per
table its direct grants and its core schema's, per relational column whether it is restricted
and to whom, plus the version and incarnation the snapshot was read at — all from one
transaction, so the tokens and the ACLs they stand for agree. What the caller may not Share
reads null (unknown), never empty. Requires View or Edit on the schema. The deltas an edit
derives from it travel in apply as DomainApplyBody.access.
Returns
Promise<DomainSchemaAccess>
audit()
audit(
options?):Promise<DomainAuditEntry[]>
Defined in: js-api/src/dapi.ts:1614
Whole-schema history: all tables' events + 'ddl' registry events, newest first.
Parameters
| Parameter | Type |
|---|---|
options? | { limit?: number; } |
options.limit? | number |
Returns
Promise<DomainAuditEntry[]>
delete()
delete(
options?):Promise<void>
Defined in: js-api/src/dapi.ts:1622
Fully purges a user-managed schema: data, audit partition, registry, entities, permissions.
Requires Delete on the schema. ifIncarnation (the incarnation of manifest or
access) pins the delete to the schema the caller reviewed: a name deleted and
re-created since rejects with a DomainVersionConflictError and the new schema is kept.
Parameters
| Parameter | Type |
|---|---|
options? | { ifIncarnation?: string; } |
options.ifIncarnation? | string |
Returns
Promise<void>
draft()
draft(
options?):Promise<DomainDraft>
Defined in: js-api/src/dapi.ts:1552
The live catalog of this EXTERNAL binding, shaped like DomainsDataSource.draft's
answer (DomainDraft) over the binding's own connection and remote schema — what an
editor compares the registered manifest with (tables and columns to add, drift on what is
registered); options.tables narrows it to those remote tables. Needs Edit on the schema plus
GetSchema and Query on the connection — no CreateDomainSchema: an editor need not be able to
create. A platform-stored schema has no catalog to draft (DomainUnsupportedError).
Parameters
| Parameter | Type |
|---|---|
options? | { tables?: string[]; } |
options.tables? | string[] |
Returns
Promise<DomainDraft>
grant()
grant(
group,permission):Promise<void>
Defined in: js-api/src/dapi.ts:1638
Idempotently grants [permission] on this schema's registry entity to [group] (a group
id). Schema grants gate schema-level operations (apply requires Edit, delete requires
Delete, sharing requires Share, extending a package schema requires Extend). They do
NOT grant access to row data — use table('s.t').grant() per table for that.
'Extend' is meaningful on schema entities only: granting it on a table or column
schema is a 400. Requires Share.
Parameters
| Parameter | Type |
|---|---|
group | string |
permission | DomainPermission |
Returns
Promise<void>
grants()
grants():
Promise<DomainGrant[]>
Defined in: js-api/src/dapi.ts:1628
Direct permission rows on this schema's registry entity (schema-level operation rights, not row-data access — see grant). Requires Share.
Returns
Promise<DomainGrant[]>
manifest()
manifest():
Promise<DomainRegisteredManifest>
Defined in: js-api/src/dapi.ts:1532
Full manifest reconstructed from the registry (feeds editors; doubles as export), with the
version and incarnation an apply sends back (DomainRegisteredManifest).
Returns
Promise<DomainRegisteredManifest>
revoke()
revoke(
group,permission?):Promise<void>
Defined in: js-api/src/dapi.ts:1645
Revokes [permission] (or every schema permission when omitted) from [group]. Requires Share.
Parameters
| Parameter | Type |
|---|---|
group | string |
permission? | DomainPermission |
Returns
Promise<void>
validate()
validate():
Promise<DomainSchemaValidation>
Defined in: js-api/src/dapi.ts:1559
Re-validates an external schema's binding against its warehouse and records the
outcome (DomainSchemaValidation: status 'ok' or the issues by manifest path).
Requires Edit on the schema; a platform-stored schema is a DomainUnsupportedError.
Returns
Promise<DomainSchemaValidation>