graphddb 0.5.0 → 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.
package/dist/index.js CHANGED
@@ -51,7 +51,6 @@ import {
51
51
  from,
52
52
  getEdgeWrites,
53
53
  getImplicitKeyFields,
54
- hydrate,
55
54
  isCommandModelContract,
56
55
  isCommandPlan,
57
56
  isContractComposeNode,
@@ -64,7 +63,6 @@ import {
64
63
  isMutationInputRef,
65
64
  isPlannedCommandMethod,
66
65
  isQueryModelContract,
67
- isSelectBuilder,
68
66
  isTransactionRef,
69
67
  mapWithConcurrency,
70
68
  mintContractKeyFieldRef,
@@ -79,7 +77,7 @@ import {
79
77
  validateDepth,
80
78
  when,
81
79
  wholeKeysSentinel
82
- } from "./chunk-J5A665UW.js";
80
+ } from "./chunk-H5TUW2WR.js";
83
81
  import {
84
82
  CdcEmulator,
85
83
  MAINT_OUTBOX_PK_PREFIX,
@@ -91,7 +89,7 @@ import {
91
89
  orderAndTrimCollection,
92
90
  pathField,
93
91
  projectFrom
94
- } from "./chunk-7NPG5R7O.js";
92
+ } from "./chunk-QBXLQNXY.js";
95
93
  import {
96
94
  BATCH_GET_MAX_KEYS,
97
95
  BATCH_WRITE_MAX_ITEMS,
@@ -112,6 +110,7 @@ import {
112
110
  buildDeleteInput,
113
111
  buildMaintenanceGraph,
114
112
  buildPutInput,
113
+ buildSubscribeHandler,
115
114
  buildUpdateExpression,
116
115
  buildUpdateInput,
117
116
  collapseSameKeyItems,
@@ -129,6 +128,7 @@ import {
129
128
  getEntityWrites,
130
129
  gsi,
131
130
  gsiAmbiguityRule,
131
+ hydrate,
132
132
  identity,
133
133
  isColumn,
134
134
  isEntityWritesDefinition,
@@ -139,6 +139,7 @@ import {
139
139
  isRawCondition,
140
140
  isRetryableError,
141
141
  isRetryableTransactionCancellation,
142
+ isSelectBuilder,
142
143
  k,
143
144
  key,
144
145
  lifecyclePhaseForIntent,
@@ -146,6 +147,7 @@ import {
146
147
  missingGsiRule,
147
148
  noScanRule,
148
149
  param,
150
+ parseChange,
149
151
  preview,
150
152
  relationDepthRule,
151
153
  requireLimitRule,
@@ -154,7 +156,8 @@ import {
154
156
  resolveModelClass,
155
157
  segmentFieldNames,
156
158
  serializeFieldValue
157
- } from "./chunk-FMJIWFIS.js";
159
+ } from "./chunk-W3GEJPPV.js";
160
+ import "./chunk-MCKGQKYU.js";
158
161
 
159
162
  // src/metadata/prefix.ts
160
163
  function derivePrefix(customPrefix, className) {
@@ -206,6 +209,7 @@ var pendingEmbedded = [];
206
209
  var pendingRelations = [];
207
210
  var pendingAggregates = [];
208
211
  var pendingMaintainedFrom = [];
212
+ var pendingCdcProjected = false;
209
213
  function collectField(field2) {
210
214
  pendingFields.push(field2);
211
215
  }
@@ -221,6 +225,9 @@ function collectAggregate(aggregate2) {
221
225
  function collectMaintainedFrom(decl) {
222
226
  pendingMaintainedFrom.push(decl);
223
227
  }
228
+ function collectCdcProjected() {
229
+ pendingCdcProjected = true;
230
+ }
224
231
  function drainFields() {
225
232
  const result = pendingFields;
226
233
  pendingFields = [];
@@ -246,6 +253,11 @@ function drainMaintainedFrom() {
246
253
  pendingMaintainedFrom = [];
247
254
  return result;
248
255
  }
256
+ function drainCdcProjected() {
257
+ const result = pendingCdcProjected;
258
+ pendingCdcProjected = false;
259
+ return result;
260
+ }
249
261
 
250
262
  // src/decorators/model.ts
251
263
  function model(options) {
@@ -255,6 +267,7 @@ function model(options) {
255
267
  const relations = drainRelations();
256
268
  const aggregates = drainAggregates();
257
269
  const maintainedFrom2 = drainMaintainedFrom();
270
+ const cdcProjected2 = drainCdcProjected();
258
271
  const prefix = derivePrefix(options.prefix, context.name);
259
272
  const kind = options.kind ?? "entity";
260
273
  if (kind === "entity" && maintainedFrom2.length > 0) {
@@ -285,6 +298,7 @@ function model(options) {
285
298
  embeddedFields,
286
299
  kind,
287
300
  ...options.description !== void 0 ? { description: options.description } : {},
301
+ ...cdcProjected2 ? { cdcProjected: cdcProjected2 } : {},
288
302
  maintainedFrom: maintainedFrom2,
289
303
  ...ttlAttribute !== void 0 ? { ttlAttribute } : {}
290
304
  });
@@ -507,7 +521,7 @@ function belongsTo(targetFactory, keyBinding, options) {
507
521
  });
508
522
  };
509
523
  }
510
- function hasOne(targetFactory, keyBindingOrCallback) {
524
+ function hasOne(targetFactory, keyBindingOrCallback, options) {
511
525
  return function(_value, context) {
512
526
  const propertyName = String(context.name);
513
527
  assertRelationPropertyNameAllowed(propertyName);
@@ -534,7 +548,12 @@ function hasOne(targetFactory, keyBindingOrCallback) {
534
548
  type: "hasOne",
535
549
  propertyName,
536
550
  targetFactory,
537
- keyBinding: keyBindingOrCallback
551
+ keyBinding: keyBindingOrCallback,
552
+ // Legacy navigation `@hasOne` now accepts a (purely-documentary, issue #166)
553
+ // `RelationOptions` third argument, symmetric with `@hasMany`/`@belongsTo`.
554
+ // Included ONLY when supplied so an option-less `@hasOne` records metadata with
555
+ // no `options` key — byte-identical to the pre-#166 collected metadata.
556
+ ...options !== void 0 ? { options } : {}
538
557
  });
539
558
  };
540
559
  }
@@ -668,12 +687,22 @@ function maintainedFrom(source, callback) {
668
687
  ...collection ? { collection } : {},
669
688
  ...opts.when ? { when: opts.when } : {},
670
689
  ...opts.consistency !== void 0 ? { consistency: opts.consistency } : {},
671
- ...opts.updateMode !== void 0 ? { updateMode: opts.updateMode } : {}
690
+ ...opts.updateMode !== void 0 ? { updateMode: opts.updateMode } : {},
691
+ // Purely-documentary description (issue #166); recorded only when declared so an
692
+ // undescribed `@maintainedFrom` is byte-identical to the pre-#166 metadata.
693
+ ...opts.description !== void 0 ? { description: opts.description } : {}
672
694
  };
673
695
  collectMaintainedFrom(metadata);
674
696
  };
675
697
  }
676
698
 
699
+ // src/decorators/cdc-projected.ts
700
+ function cdcProjected() {
701
+ return function(_target, _context) {
702
+ collectCdcProjected();
703
+ };
704
+ }
705
+
677
706
  // src/operations/declarative-transaction.ts
678
707
  var PLACEHOLDER_RE = /\{[^{}]+\}/g;
679
708
  function resolveTemplate(template, params, element) {
@@ -1863,10 +1892,12 @@ export {
1863
1892
  buildProjection,
1864
1893
  buildPutInput,
1865
1894
  buildQuerySpec,
1895
+ buildSubscribeHandler,
1866
1896
  buildTransactionSpec,
1867
1897
  buildTransactions,
1868
1898
  buildUpdateExpression,
1869
1899
  buildUpdateInput,
1900
+ cdcProjected,
1870
1901
  collectContractBoundaryViolations,
1871
1902
  collectContractN1Violations,
1872
1903
  collectViewDefinitions,
@@ -1973,6 +2004,7 @@ export {
1973
2004
  number,
1974
2005
  numberSet,
1975
2006
  param,
2007
+ parseChange,
1976
2008
  plan,
1977
2009
  preview,
1978
2010
  publicCommandModel,
@@ -1,4 +1,4 @@
1
- import { E as Executor, D as DynamoDBOperation, R as ReadExecOptions, a as ExecutorResult, B as BatchGetExecInput, P as PutInput, W as WriteExecOptions, b as WriteResult, U as UpdateInput, c as DeleteInput, d as BatchWriteExecItem, e as BatchExecOptions, T as TransactWriteExecItem, M as ModelStatic, f as DDBModel, C as ChangeEvent } from '../types-B-F7jw9f.js';
1
+ import { E as Executor, D as DynamoDBOperation, R as ReadExecOptions, a as ExecutorResult, B as BatchGetExecInput, P as PutInput, W as WriteExecOptions, b as WriteResult, U as UpdateInput, c as DeleteInput, d as BatchWriteExecItem, e as BatchExecOptions, T as TransactWriteExecItem, M as ModelStatic, f as DDBModel, C as ChangeEvent } from '../types-m1Ect6hG.js';
2
2
  import '@aws-sdk/client-dynamodb';
3
3
 
4
4
  /**
@@ -1,12 +1,13 @@
1
1
  import {
2
2
  createCdcEmulator
3
- } from "../chunk-7NPG5R7O.js";
3
+ } from "../chunk-QBXLQNXY.js";
4
4
  import {
5
5
  ClientManager,
6
6
  MetadataRegistry,
7
7
  TableMapping,
8
8
  resolveModelClass
9
- } from "../chunk-FMJIWFIS.js";
9
+ } from "../chunk-W3GEJPPV.js";
10
+ import "../chunk-MCKGQKYU.js";
10
11
 
11
12
  // src/memory/memory-store.ts
12
13
  function deepClone(value) {