@xcitedbs/client 0.2.14 → 0.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AccessCheckResult, AppAuthConfig, AppEmailConfig, AppEmailTemplates, AppUser, AppUserTokenPair, EmailTestResponse, ForgotPasswordResponse, SendVerificationResponse, BranchInfo, BookmarkRecord, CheckpointRecord, CommitRecord, CompareRef, CompareResult, DatabaseContext, DiffRef, DiffResult, DocumentBatchResponse, Flags, JsonDocumentBatchItem, ListIdentifierChildrenResult, ListIdentifiersResult, LockInfo, LogEntry, MergeResult, PublishResult, WorkspaceInfo, MetaValue, PlatformRegisterResult, PolicySubjectInput, UnqueryResult, UnqueryTemplate, PolicyUpdateResponse, RealtimeEvent, SecurityConfig, SecurityPolicy, StoredTriggerResponse, TriggerDefinition, StoredPolicyResponse, SubscriptionOptions, TagRecord, TextSearchQuery, TextSearchResult, ProjectSearchSettings, ProjectSearchSettingsUpdate, ProjectDocConfResponse, PlatformDefaultDocConfResponse, VectorIndexEstimate, RagQueryOptions, RagQueryResult, RagStreamEvent, OAuthProvidersResponse, ProjectInfo, PlatformRegistrationConfig, PlatformWorkspacesResponse, TokenPair, UserInfo, ApiKeyInfo, WriteDocumentOptions, XmlDocumentBatchItem, CreateTestSessionOptions, XCiteDBClientOptions, XCiteDBJwtClaims, XCiteQuery, UserIsolationConfig } from './types';
1
+ import { AccessCheckResult, AppAuthConfig, AppEmailConfig, AppEmailTemplates, AppUser, AppUserTokenPair, EmailTestResponse, ForgotPasswordResponse, SendVerificationResponse, BranchInfo, BookmarkRecord, CheckpointRecord, CommitRecord, CompareRef, CompareResult, DatabaseContext, DiffRef, DiffResult, DocumentBatchResponse, Flags, JsonDocumentBatchItem, ListIdentifierChildrenResult, ListIdentifiersResult, LockInfo, LogEntry, MergeResult, PublishResult, WorkspaceInfo, MetaValue, PlatformRegisterResult, PolicySubjectInput, UnqueryResult, UnqueryTemplate, PolicyUpdateResponse, RealtimeEvent, SecurityConfig, SecurityPolicy, StoredTriggerResponse, TriggerDefinition, StoredPolicyResponse, SubscriptionOptions, TagRecord, TextSearchQuery, TextSearchResult, ProjectSearchSettings, ProjectSearchSettingsUpdate, ProjectDocConfResponse, PlatformDefaultDocConfResponse, VectorIndexEstimate, RagQueryOptions, RagQueryResult, RagStreamEvent, OAuthProvidersResponse, ProjectInfo, PlatformRegistrationConfig, PlatformWorkspacesResponse, TokenPair, UserInfo, ApiKeyInfo, WriteDocumentOptions, XmlDocumentBatchItem, CreateTestSessionOptions, XCiteDBClientOptions, XCiteDBJwtClaims, XCiteQuery, UserIsolationConfig, UserIsolationCreateShareParams, UserIsolationShareResult } from './types';
2
2
  import { WebSocketSubscription } from './websocket';
3
3
  export declare class XCiteDBClient {
4
4
  private baseUrl;
@@ -295,6 +295,12 @@ export declare class XCiteDBClient {
295
295
  * the server (namespace + shared paths). Does not send `X-Prefix`; identifiers in requests are rewritten.
296
296
  */
297
297
  enableUserIsolation(): Promise<UserIsolationConfig>;
298
+ /**
299
+ * Share a document from the caller’s user namespace with another app user (`POST …/user-isolation/shares`).
300
+ * Requires an **app user** session (`appUserAccessToken` / `loginAppUser`) and tenant isolation enabled.
301
+ * When {@link XCiteDBClient.enableUserIsolation} / `userIsolation` is active, `identifier` is prefixed like other document APIs.
302
+ */
303
+ createUserIsolationShare(params: UserIsolationCreateShareParams): Promise<UserIsolationShareResult>;
298
304
  createWorkspace(name: string, fromBranch?: string, fromDate?: string): Promise<void>;
299
305
  /** @deprecated Use {@link createWorkspace}. */
300
306
  createBranch(name: string, fromBranch?: string, fromDate?: string): Promise<void>;
package/dist/client.js CHANGED
@@ -976,6 +976,18 @@ class XCiteDBClient {
976
976
  }
977
977
  return cfg;
978
978
  }
979
+ /**
980
+ * Share a document from the caller’s user namespace with another app user (`POST …/user-isolation/shares`).
981
+ * Requires an **app user** session (`appUserAccessToken` / `loginAppUser`) and tenant isolation enabled.
982
+ * When {@link XCiteDBClient.enableUserIsolation} / `userIsolation` is active, `identifier` is prefixed like other document APIs.
983
+ */
984
+ async createUserIsolationShare(params) {
985
+ return this.request('POST', '/api/v1/security/user-isolation/shares', {
986
+ identifier: this.isoPrefixId(params.identifier),
987
+ target_user_id: params.target_user_id,
988
+ mode: params.mode,
989
+ });
990
+ }
979
991
  async createWorkspace(name, fromBranch, fromDate) {
980
992
  const body = { name };
981
993
  if (fromBranch)
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { XCiteDBClient } from './client';
2
2
  export { WebSocketSubscription } from './websocket';
3
- export type { AccessCheckResult, ApiKeyInfo, AppAuthConfig, AppEmailConfig, AppEmailSmtpConfig, AppEmailTemplateEntry, AppEmailTemplates, AppEmailWebhookConfig, AppUser, AppUserTokenPair, EmailTestResponse, ForgotPasswordResponse, SendVerificationResponse, BookmarkRecord, BranchInfo, BranchListItem, CheckpointRecord, CommitRecord, CompareEntry, CompareRef, CompareResult, DatabaseContext, DiffEntry, DiffRef, DiffResult, DocumentBatchResponse, DocumentBatchResultRow, Flags, JsonDocumentData, JsonDocumentBatchItem, IdentifierChildNode, ListIdentifierChildrenResult, ListIdentifiersResult, LockInfo, MergeConflict, MergeResult, OAuthProviderInfo, OAuthProvidersResponse, OwnedTenantInfo, ProjectInfo, PlatformRegistrationConfig, PlatformWorkspaceOrg, PlatformWorkspacesResponse, ProjectSearchSettings, ProjectSearchSettingsUpdate, ProjectDocConfResponse, PlatformDefaultDocConfResponse, LogEntry, MetaValue, PlatformRegisterResult, PolicyUpdateResponse, PublishConflict, PublishResult, PolicyConditions, PolicyIdentifierPattern, PolicyResources, PolicySubjectInput, PolicySubjects, RagQueryOptions, RagQueryResult, RagStreamEvent, RealtimeEvent, SearchIndexingProgress, SecurityConfig, SecurityPolicy, StoredPolicyResponse, StoredTriggerResponse, SubscriptionOptions, TagRecord, TextSearchHit, TextSearchQuery, TextSearchResult, TriggerDefinition, TokenPair, UserInfo, UserIsolationConfig, UserIsolationOptions, WorkspaceInfo, WriteDocumentOptions, XmlDocumentBatchItem, CreateTestSessionOptions, XCiteDBClientOptions, XCiteDBJwtClaims, UnqueryResult, UnqueryTemplate, XCiteQuery, } from './types';
3
+ export type { AccessCheckResult, ApiKeyInfo, AppAuthConfig, AppEmailConfig, AppEmailSmtpConfig, AppEmailTemplateEntry, AppEmailTemplates, AppEmailWebhookConfig, AppUser, AppUserTokenPair, EmailTestResponse, ForgotPasswordResponse, SendVerificationResponse, BookmarkRecord, BranchInfo, BranchListItem, CheckpointRecord, CommitRecord, CompareEntry, CompareRef, CompareResult, DatabaseContext, DiffEntry, DiffRef, DiffResult, DocumentBatchResponse, DocumentBatchResultRow, Flags, JsonDocumentData, JsonDocumentBatchItem, IdentifierChildNode, ListIdentifierChildrenResult, ListIdentifiersResult, LockInfo, MergeConflict, MergeResult, OAuthProviderInfo, OAuthProvidersResponse, OwnedTenantInfo, ProjectInfo, PlatformRegistrationConfig, PlatformWorkspaceOrg, PlatformWorkspacesResponse, ProjectSearchSettings, ProjectSearchSettingsUpdate, ProjectDocConfResponse, PlatformDefaultDocConfResponse, LogEntry, MetaValue, PlatformRegisterResult, PolicyUpdateResponse, PublishConflict, PublishResult, PolicyConditions, PolicyIdentifierPattern, PolicyResources, PolicySubjectInput, PolicySubjects, RagQueryOptions, RagQueryResult, RagStreamEvent, RealtimeEvent, SearchIndexingProgress, SecurityConfig, SecurityPolicy, StoredPolicyResponse, StoredTriggerResponse, SubscriptionOptions, TagRecord, TextSearchHit, TextSearchQuery, TextSearchResult, TriggerDefinition, TokenPair, UserInfo, UserIsolationConfig, UserIsolationCreateShareParams, UserIsolationOptions, UserIsolationShareMode, UserIsolationShareResult, WorkspaceInfo, WriteDocumentOptions, XmlDocumentBatchItem, CreateTestSessionOptions, XCiteDBClientOptions, XCiteDBJwtClaims, UnqueryResult, UnqueryTemplate, XCiteQuery, } from './types';
4
4
  export { XCiteDBError } from './types';
package/dist/types.d.ts CHANGED
@@ -420,6 +420,20 @@ export interface UserIsolationConfig {
420
420
  shared_write_groups: string[];
421
421
  generated_policies?: string[];
422
422
  }
423
+ /** `read` or `readwrite` for {@link XCiteDBClient.createUserIsolationShare}. */
424
+ export type UserIsolationShareMode = 'read' | 'readwrite';
425
+ /** Body for `POST /api/v1/security/user-isolation/shares` (app user). */
426
+ export interface UserIsolationCreateShareParams {
427
+ identifier: string;
428
+ /** Another app user id on the same tenant, or `"*"` for all app users (public alias tree). */
429
+ target_user_id: string;
430
+ mode: UserIsolationShareMode;
431
+ }
432
+ /** JSON body returned with HTTP 201 from create share. */
433
+ export interface UserIsolationShareResult {
434
+ alias: string;
435
+ mode: string;
436
+ }
423
437
  export interface XCiteDBClientOptions {
424
438
  baseUrl: string;
425
439
  apiKey?: string;
package/llms-full.txt CHANGED
@@ -613,6 +613,8 @@ Unquery supports: hierarchical navigation (self, parents, ancestors, children, d
613
613
 
614
614
  The `unquery` body is a **JSON template**: each **object key** names an output field; each **value** is either a nested object/array (recursed) or a **string parsed as an expression**. Arrays produce JSON arrays in order.
615
615
 
616
+ **Parser-faithful grammar / AST** (for syntax checking, static typing, and tooling): see **`unquery-grammar.md`** shipped next to this file in SDK packages (canonical document in the XciteDB-server repository: `docs/unquery-grammar.md`). The MCP server also exposes it as the resource URI **`xcitedb://unquery-grammar`**.
617
+
616
618
  ### Core expression builtins (string values)
617
619
 
618
620
  - **Document / path:** `$identifier`, `$identifier(n)` (path segment by index), `$key`, `$index`, `$path`
package/llms.txt CHANGED
@@ -301,7 +301,7 @@ interface XCiteDBClientOptions {
301
301
 
302
302
  - JSON **keys** = output fields; **string values** = expressions referencing meta/XML (e.g. field name `"title"` reads meta key `title`).
303
303
  - **Common builtins:** `$count`, `$sum(expr)`, `$avg(expr)`, `$min(expr)`, `$max(expr)`, `$xpath("…")`, `$identifier`, `$size(expr)`, `$length(expr)`, `$if(cond, a, b)`, `$var(name)` / `%name`.
304
- - **Example:** `{ "query": { "match_start": "/orders/" }, "unquery": { "n": "$count" } }` — count documents. Full grammar: **`llms-full.txt`** in this package.
304
+ - **Example:** `{ "query": { "match_start": "/orders/" }, "unquery": { "n": "$count" } }` — count documents. Human-oriented reference: **`llms-full.txt`** in this package. **AI-first writing guide (read this before generating any Unquery query):** **`unquery-ai-guide.md`** (canonical source in the server repo: `docs/unquery-ai-guide.md`; MCP resource `xcitedb://unquery-guide`). **Parser-faithful grammar / parse tree** (syntax + static checks for tooling): **`unquery-grammar.md`** (canonical: `docs/unquery-grammar.md`; MCP resource `xcitedb://unquery-grammar`).
305
305
 
306
306
  **App Users (admin):**
307
307
  - `listAppUsers()` / `createAppUser()` / `deleteAppUser()` — Manage end-user accounts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcitedbs/client",
3
- "version": "0.2.14",
3
+ "version": "0.2.16",
4
4
  "description": "XCiteDB BaaS client SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -41,7 +41,9 @@
41
41
  "files": [
42
42
  "dist",
43
43
  "llms.txt",
44
- "llms-full.txt"
44
+ "llms-full.txt",
45
+ "unquery-grammar.md",
46
+ "unquery-ai-guide.md"
45
47
  ],
46
48
  "license": "MIT"
47
49
  }