@rebasepro/types 0.10.1-canary.gdaf6ba4 → 0.11.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.
@@ -265,6 +265,26 @@ export interface SDKQueryBuilderInterface<M extends Record<string, unknown> = Re
265
265
  *
266
266
  * @group Data
267
267
  */
268
+ /**
269
+ * Per-request options for a write.
270
+ * @group Data
271
+ */
272
+ export interface WriteOptions {
273
+ /**
274
+ * Names this write, so re-sending it is recognised instead of repeated.
275
+ *
276
+ * A client that does not see a response cannot know whether the write
277
+ * committed. Retrying is therefore the only option, and without a key the
278
+ * server has no way to tell a retry from a second, genuinely new write — so
279
+ * it performs it again. On a table with a server-assigned id that is a
280
+ * duplicate row, because the id the client chose was never used.
281
+ *
282
+ * Set by the offline queue on every replay. Honoured for 24 hours and scoped
283
+ * to the authenticated user; a server that cannot store keys ignores it
284
+ * rather than refusing the write.
285
+ */
286
+ idempotencyKey?: string;
287
+ }
268
288
  export interface SDKCollectionClient<M extends Record<string, unknown> = Record<string, unknown>, I = Partial<M>, U = Partial<M>> {
269
289
  /**
270
290
  * Find multiple records with optional filtering, pagination, and sorting.
@@ -284,7 +304,7 @@ export interface SDKCollectionClient<M extends Record<string, unknown> = Record<
284
304
  * columns.
285
305
  * @returns The created row
286
306
  */
287
- create(data: I, id?: string | number): Promise<M>;
307
+ create(data: I, id?: string | number, options?: WriteOptions): Promise<M>;
288
308
  /**
289
309
  * Write many records in a single request and a single transaction.
290
310
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rebasepro/types",
3
3
  "type": "module",
4
- "version": "0.10.1-canary.gdaf6ba4",
4
+ "version": "0.11.0",
5
5
  "description": "Rebase type definitions — shared interfaces and controller types",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/rebaseco"
@@ -290,6 +290,27 @@ export interface SDKQueryBuilderInterface<M extends Record<string, unknown> = Re
290
290
  *
291
291
  * @group Data
292
292
  */
293
+ /**
294
+ * Per-request options for a write.
295
+ * @group Data
296
+ */
297
+ export interface WriteOptions {
298
+ /**
299
+ * Names this write, so re-sending it is recognised instead of repeated.
300
+ *
301
+ * A client that does not see a response cannot know whether the write
302
+ * committed. Retrying is therefore the only option, and without a key the
303
+ * server has no way to tell a retry from a second, genuinely new write — so
304
+ * it performs it again. On a table with a server-assigned id that is a
305
+ * duplicate row, because the id the client chose was never used.
306
+ *
307
+ * Set by the offline queue on every replay. Honoured for 24 hours and scoped
308
+ * to the authenticated user; a server that cannot store keys ignores it
309
+ * rather than refusing the write.
310
+ */
311
+ idempotencyKey?: string;
312
+ }
313
+
293
314
  export interface SDKCollectionClient<
294
315
  M extends Record<string, unknown> = Record<string, unknown>,
295
316
  I = Partial<M>,
@@ -315,7 +336,7 @@ export interface SDKCollectionClient<
315
336
  * columns.
316
337
  * @returns The created row
317
338
  */
318
- create(data: I, id?: string | number): Promise<M>;
339
+ create(data: I, id?: string | number, options?: WriteOptions): Promise<M>;
319
340
 
320
341
  /**
321
342
  * Write many records in a single request and a single transaction.