xmemory 3.22.0 → 3.23.0

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/README.md CHANGED
@@ -305,6 +305,16 @@ await inst.write([
305
305
  ]);
306
306
  ```
307
307
 
308
+ ### Labels
309
+
310
+ Fields and objects may also carry labels that xmemory sets: `field_kind` on a
311
+ field (`free_text`, `state` or `value`) and `interval` on an object (`true` or
312
+ `false`). They are hints about the data that help xmemory handle writes, not
313
+ identifiers or constraints. A label you state is kept, as long as it fits the
314
+ field's other settings; one you leave out keeps its current value. See the XMD
315
+ guide's [Labels](https://xmemory.ai/xmd/#labels) section for what each value
316
+ means.
317
+
308
318
  ### Fields on a relation
309
319
 
310
320
  A relation can declare fields of its own in the schema: values that belong to
@@ -12,5 +12,5 @@ export type { ScopeObject, ReadScope, WriteScope, RelationsScope, WriteScopeMode
12
12
  export type { XmemoryClientOptions, RequestOptions, ReadOptions, WriteOptions, ExtractOptions, CreateInstanceOptions, GenerateSchemaOptions, UpdateInstanceMetadataOptions, PatchInstanceMetadataOptions, UpdateInstanceSchemaOptions, DryRunMigrationOptions, ListMigrationsOptions, GetMigrationOptions, SuggestionRequestOptions, } from "./types.js";
13
13
  export type { ClusterInfo, InstanceInfo, InstanceSchemaInfo, ReadResult, TaggedReaderResult, RelatedTypes, RelatedTypesTouched, RelatedTypesLink, RelatedTypesObjectType, RelatedTypesRelation, WriteResult, WriteChanges, SkippedOutOfScope, FieldMergeContradiction, OrphanedRecord, AsyncWriteResult, WriteStatusResult, ExtractResult, GenerateSchemaResult, ToolDescription, ToolParameterDescription, RawDescribeResult, } from "./types.js";
14
14
  export type { WriteMutation, ObjectMutationBody, ObjectCreatePayload, ObjectUpdatePayload, ObjectDeletePayload, RelationMutationBody, RelationCreatePayload, RelationUpdatePayload, RelationDeletePayload, RelationEndpoint, } from "./types.js";
15
- export type { MigrationPlan, MigrationOp, FieldSpec, AddObject, RemoveObject, RenameObject, ChangeObject, AddField, RemoveField, RenameField, ChangeField, AddRelation, RemoveRelation, RenameRelation, ChangeRelation, DefaultValue, EnumValues, } from "./types.js";
15
+ export type { MigrationPlan, MigrationOp, FieldSpec, AddObject, RemoveObject, RenameObject, ChangeObject, AddField, RemoveField, RenameField, ChangeField, AddRelation, RemoveRelation, RenameRelation, ChangeRelation, DefaultValue, EnumValues, FieldFormat, FieldKind, } from "./types.js";
16
16
  export type { EnhanceSchemaResult, PlanSummary, DryRunResult, MigrationRecord, ListMigrationsResult, GetMigrationResult, ConsolidatedProposal, ProposalItem, ReviewSuggestionsResult, DecisionInput, RecordedDecision, DependencyWarning, DecideSuggestionsResult, ApplyPendingDecisionsResult, } from "./types.js";
@@ -711,6 +711,12 @@ export type DecisionKind = "accept" | "reject" | "defer";
711
711
  export type MigrationSource = "direct" | "suggestion_engine";
712
712
  export type DefaultValue = string | number | boolean | null;
713
713
  export type EnumValues = Array<string | number | boolean> | null;
714
+ /** A field's declared format, as the server holds it. Kept open so a value a newer
715
+ * server adds, or a caller's own interface for one, still type-checks (`unknown`
716
+ * values would refuse an interface without an index signature). */
717
+ export type FieldFormat = Record<string, any>;
718
+ /** A field's label, as the server holds it. */
719
+ export type FieldKind = string;
714
720
  /** An object's or a relation's field, as a migration op adds it. */
715
721
  export interface FieldSpec {
716
722
  name: string;
@@ -719,6 +725,8 @@ export interface FieldSpec {
719
725
  description?: string | null;
720
726
  default?: DefaultValue;
721
727
  enum?: EnumValues;
728
+ format?: FieldFormat;
729
+ field_kind?: FieldKind;
722
730
  }
723
731
  export interface AddObject {
724
732
  op_type: "add_object";
@@ -727,6 +735,8 @@ export interface AddObject {
727
735
  primary_key: string[];
728
736
  fields: FieldSpec[];
729
737
  should_backfill?: boolean;
738
+ /** The object's label. */
739
+ interval?: boolean;
730
740
  }
731
741
  export interface RemoveObject {
732
742
  op_type: "remove_object";
@@ -742,6 +752,8 @@ export interface ChangeObject {
742
752
  name: string;
743
753
  new_primary_key?: string[] | null;
744
754
  new_description?: string | null;
755
+ /** Sets the object's label. */
756
+ new_interval?: boolean;
745
757
  }
746
758
  export interface AddField {
747
759
  op_type: "add_field";
@@ -753,6 +765,8 @@ export interface AddField {
753
765
  default?: DefaultValue;
754
766
  enum?: EnumValues;
755
767
  should_backfill?: boolean;
768
+ format?: FieldFormat;
769
+ field_kind?: FieldKind;
756
770
  }
757
771
  export interface RemoveField {
758
772
  op_type: "remove_field";
@@ -779,6 +793,12 @@ export interface ChangeField {
779
793
  cast_strategy?: CastStrategy | null;
780
794
  using_expression?: string | null;
781
795
  confirm_data_loss?: boolean;
796
+ /** Sets or replaces the field's declared format; `clear_format: true` removes it.
797
+ * Never both in one op. */
798
+ new_format?: FieldFormat;
799
+ clear_format?: boolean;
800
+ /** Sets the field's label. */
801
+ new_field_kind?: FieldKind;
782
802
  }
783
803
  export interface AddRelation {
784
804
  op_type: "add_relation";
@@ -1,2 +1,2 @@
1
1
  /** Package version. Kept in sync with `package.json` — a test asserts they match. */
2
- export declare const VERSION = "3.22.0";
2
+ export declare const VERSION = "3.23.0";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  /** Package version. Kept in sync with `package.json` — a test asserts they match. */
5
- exports.VERSION = "3.22.0";
5
+ exports.VERSION = "3.23.0";
@@ -12,5 +12,5 @@ export type { ScopeObject, ReadScope, WriteScope, RelationsScope, WriteScopeMode
12
12
  export type { XmemoryClientOptions, RequestOptions, ReadOptions, WriteOptions, ExtractOptions, CreateInstanceOptions, GenerateSchemaOptions, UpdateInstanceMetadataOptions, PatchInstanceMetadataOptions, UpdateInstanceSchemaOptions, DryRunMigrationOptions, ListMigrationsOptions, GetMigrationOptions, SuggestionRequestOptions, } from "./types.js";
13
13
  export type { ClusterInfo, InstanceInfo, InstanceSchemaInfo, ReadResult, TaggedReaderResult, RelatedTypes, RelatedTypesTouched, RelatedTypesLink, RelatedTypesObjectType, RelatedTypesRelation, WriteResult, WriteChanges, SkippedOutOfScope, FieldMergeContradiction, OrphanedRecord, AsyncWriteResult, WriteStatusResult, ExtractResult, GenerateSchemaResult, ToolDescription, ToolParameterDescription, RawDescribeResult, } from "./types.js";
14
14
  export type { WriteMutation, ObjectMutationBody, ObjectCreatePayload, ObjectUpdatePayload, ObjectDeletePayload, RelationMutationBody, RelationCreatePayload, RelationUpdatePayload, RelationDeletePayload, RelationEndpoint, } from "./types.js";
15
- export type { MigrationPlan, MigrationOp, FieldSpec, AddObject, RemoveObject, RenameObject, ChangeObject, AddField, RemoveField, RenameField, ChangeField, AddRelation, RemoveRelation, RenameRelation, ChangeRelation, DefaultValue, EnumValues, } from "./types.js";
15
+ export type { MigrationPlan, MigrationOp, FieldSpec, AddObject, RemoveObject, RenameObject, ChangeObject, AddField, RemoveField, RenameField, ChangeField, AddRelation, RemoveRelation, RenameRelation, ChangeRelation, DefaultValue, EnumValues, FieldFormat, FieldKind, } from "./types.js";
16
16
  export type { EnhanceSchemaResult, PlanSummary, DryRunResult, MigrationRecord, ListMigrationsResult, GetMigrationResult, ConsolidatedProposal, ProposalItem, ReviewSuggestionsResult, DecisionInput, RecordedDecision, DependencyWarning, DecideSuggestionsResult, ApplyPendingDecisionsResult, } from "./types.js";
@@ -711,6 +711,12 @@ export type DecisionKind = "accept" | "reject" | "defer";
711
711
  export type MigrationSource = "direct" | "suggestion_engine";
712
712
  export type DefaultValue = string | number | boolean | null;
713
713
  export type EnumValues = Array<string | number | boolean> | null;
714
+ /** A field's declared format, as the server holds it. Kept open so a value a newer
715
+ * server adds, or a caller's own interface for one, still type-checks (`unknown`
716
+ * values would refuse an interface without an index signature). */
717
+ export type FieldFormat = Record<string, any>;
718
+ /** A field's label, as the server holds it. */
719
+ export type FieldKind = string;
714
720
  /** An object's or a relation's field, as a migration op adds it. */
715
721
  export interface FieldSpec {
716
722
  name: string;
@@ -719,6 +725,8 @@ export interface FieldSpec {
719
725
  description?: string | null;
720
726
  default?: DefaultValue;
721
727
  enum?: EnumValues;
728
+ format?: FieldFormat;
729
+ field_kind?: FieldKind;
722
730
  }
723
731
  export interface AddObject {
724
732
  op_type: "add_object";
@@ -727,6 +735,8 @@ export interface AddObject {
727
735
  primary_key: string[];
728
736
  fields: FieldSpec[];
729
737
  should_backfill?: boolean;
738
+ /** The object's label. */
739
+ interval?: boolean;
730
740
  }
731
741
  export interface RemoveObject {
732
742
  op_type: "remove_object";
@@ -742,6 +752,8 @@ export interface ChangeObject {
742
752
  name: string;
743
753
  new_primary_key?: string[] | null;
744
754
  new_description?: string | null;
755
+ /** Sets the object's label. */
756
+ new_interval?: boolean;
745
757
  }
746
758
  export interface AddField {
747
759
  op_type: "add_field";
@@ -753,6 +765,8 @@ export interface AddField {
753
765
  default?: DefaultValue;
754
766
  enum?: EnumValues;
755
767
  should_backfill?: boolean;
768
+ format?: FieldFormat;
769
+ field_kind?: FieldKind;
756
770
  }
757
771
  export interface RemoveField {
758
772
  op_type: "remove_field";
@@ -779,6 +793,12 @@ export interface ChangeField {
779
793
  cast_strategy?: CastStrategy | null;
780
794
  using_expression?: string | null;
781
795
  confirm_data_loss?: boolean;
796
+ /** Sets or replaces the field's declared format; `clear_format: true` removes it.
797
+ * Never both in one op. */
798
+ new_format?: FieldFormat;
799
+ clear_format?: boolean;
800
+ /** Sets the field's label. */
801
+ new_field_kind?: FieldKind;
782
802
  }
783
803
  export interface AddRelation {
784
804
  op_type: "add_relation";
@@ -1,2 +1,2 @@
1
1
  /** Package version. Kept in sync with `package.json` — a test asserts they match. */
2
- export declare const VERSION = "3.22.0";
2
+ export declare const VERSION = "3.23.0";
@@ -1,2 +1,2 @@
1
1
  /** Package version. Kept in sync with `package.json` — a test asserts they match. */
2
- export const VERSION = "3.22.0";
2
+ export const VERSION = "3.23.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xmemory",
3
- "version": "3.22.0",
3
+ "version": "3.23.0",
4
4
  "description": "xmemory",
5
5
  "keywords": [
6
6
  "xmemory"