graphddb 0.5.1 → 0.5.2

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.
@@ -724,11 +724,26 @@ interface GsiDefinitionMarker<T extends Record<string, unknown> = Record<string,
724
724
  readonly segmented: SegmentedKey;
725
725
  readonly inputFieldNames: string[];
726
726
  readonly unique: U;
727
+ /**
728
+ * Optional human-readable description of the GSI (issue #166, follow-up of #154),
729
+ * from `gsi(name, key, { description })`. Pure documentation — the registry copies
730
+ * it onto {@link GsiDefinition} (→ `manifest.json` + generated Python). Absent
731
+ * unless declared.
732
+ */
733
+ readonly description?: string;
727
734
  /** @internal Phantom field for type-level input type extraction. */
728
735
  readonly _phantom?: T;
729
736
  }
730
737
  interface GsiOptions {
731
738
  unique?: boolean;
739
+ /**
740
+ * Optional human-readable description of the index (issue #166, follow-up of #154).
741
+ * Pure documentation metadata — it does NOT affect the index key, projection, or any
742
+ * runtime behaviour. Propagated to `manifest.json` ({@link ManifestGsi.description})
743
+ * and surfaces as the docstring of a generated Python query method that reads through
744
+ * this index. Omit for byte-identical output.
745
+ */
746
+ description?: string;
732
747
  }
733
748
  type GsiBuilder<T extends Record<string, unknown>> = (c: {
734
749
  readonly [K in keyof T]-?: Column<T[K], T>;
@@ -3099,6 +3114,14 @@ interface ManifestKey {
3099
3114
  interface ManifestGsi extends ManifestKey {
3100
3115
  readonly indexName: string;
3101
3116
  readonly unique: boolean;
3117
+ /**
3118
+ * Optional human-readable description of the index (issue #166, follow-up of #154),
3119
+ * from `gsi(name, key, { description })`. Pure documentation — absent unless declared,
3120
+ * so a GSI with no description serializes byte-identically to the pre-#166 manifest.
3121
+ * The Python codegen surfaces it as the docstring of a generated query method that
3122
+ * reads through this index.
3123
+ */
3124
+ readonly description?: string;
3102
3125
  }
3103
3126
  interface ManifestRelation {
3104
3127
  readonly type: 'hasMany' | 'hasOne' | 'belongsTo';
@@ -3106,6 +3129,14 @@ interface ManifestRelation {
3106
3129
  readonly target: string;
3107
3130
  /** target field → source field (on this entity). */
3108
3131
  readonly keyBinding: Readonly<Record<string, string>>;
3132
+ /**
3133
+ * Optional human-readable description of the relation (issue #166, follow-up of
3134
+ * #154), from `@hasMany/@belongsTo/@hasOne(..., { description })`. Pure documentation
3135
+ * — absent unless declared, so a relation with no description serializes
3136
+ * byte-identically to the pre-#166 manifest. The Python codegen surfaces it as a
3137
+ * trailing `# …` comment on the relation's field in the generated result type.
3138
+ */
3139
+ readonly description?: string;
3109
3140
  }
3110
3141
  interface ManifestEntity {
3111
3142
  /** Declared (logical) table name. */
@@ -6525,6 +6556,24 @@ interface MaintainedFromMetadata {
6525
6556
  when?: MembershipPredicate;
6526
6557
  consistency?: MaintainConsistency;
6527
6558
  updateMode?: MaintainUpdateMode;
6559
+ /**
6560
+ * Optional human-readable description of this maintained-from source slice (issue
6561
+ * #166, follow-up of #154), supplied via
6562
+ * `@maintainedFrom(() => Source, (self, source) => ({ description, ... }))`. Pure
6563
+ * documentation metadata — it does NOT affect the maintenance IR (`keyBind` /
6564
+ * `project` / `on` / `collection` / `when`) or any runtime behaviour.
6565
+ *
6566
+ * NOTE (representation): the maintenance IR is deliberately kept OFF the
6567
+ * serializable `manifest.json` / `operations.json` — the {@link Manifest} carries
6568
+ * only the physical shape (table / keys / GSIs / relation navigation), NOT the
6569
+ * maintenance graph (see `detectStreamMaintenance` in `src/codegen/cloudformation.ts`).
6570
+ * There is therefore no manifest / operations / generated-Python site for a
6571
+ * maintained-from source; this description is captured at the metadata layer only
6572
+ * (mirroring where #154 captured its descriptions before propagation), available to
6573
+ * any future consumer that DOES surface `@maintainedFrom` (e.g. the CDC-projection
6574
+ * typed-consumer path, #153). Absent → byte-for-byte unchanged metadata.
6575
+ */
6576
+ description?: string;
6528
6577
  }
6529
6578
  interface KeyDefinition {
6530
6579
  /** The canonical structured key (PK/SK segment lists). */
@@ -6537,6 +6586,17 @@ interface GsiDefinition {
6537
6586
  segmented: SegmentedKey;
6538
6587
  inputFieldNames: string[];
6539
6588
  unique: boolean;
6589
+ /**
6590
+ * Optional human-readable description of the GSI (issue #166, follow-up of #154),
6591
+ * supplied via `gsi(name, key, { description })`. Pure documentation metadata — it
6592
+ * does NOT affect the index key, projection, or any runtime behaviour. When present
6593
+ * it is propagated to the index entry in `manifest.json`
6594
+ * ({@link ManifestGsi.description}) and surfaces as the docstring of any generated
6595
+ * Python query method that reads through this index (a query carrying the GSI's
6596
+ * `indexName`, when the query itself declares no description). Absent →
6597
+ * byte-for-byte unchanged output (backward compatible).
6598
+ */
6599
+ description?: string;
6540
6600
  }
6541
6601
  interface RelationLimitOptions {
6542
6602
  default: number;
@@ -6635,6 +6695,16 @@ type RelationProjection = Readonly<Record<string, ProjectionTransform | string>>
6635
6695
  interface RelationOptions {
6636
6696
  limit?: RelationLimitOptions;
6637
6697
  order?: 'ASC' | 'DESC';
6698
+ /**
6699
+ * Optional human-readable description of the relation (issue #166, follow-up of
6700
+ * #154), supplied via `@hasMany/@belongsTo/@hasOne(() => T, keyBind, { description })`.
6701
+ * Pure documentation metadata — it does NOT affect navigation, key binding, or any
6702
+ * runtime behaviour. When present it is propagated to the relation entry in
6703
+ * `manifest.json` ({@link ManifestRelation.description}) and surfaces as a trailing
6704
+ * `# …` comment on the relation's field in the generated Python result TypedDict /
6705
+ * dataclass. Absent → byte-for-byte unchanged output (backward compatible).
6706
+ */
6707
+ description?: string;
6638
6708
  /**
6639
6709
  * Named maintenance preset (Epic #118). Omitted = plain read-only navigation,
6640
6710
  * fully backward compatible with the historical relation decorators.