ironflock 1.2.9 → 1.3.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.d.ts CHANGED
@@ -14,6 +14,12 @@ export declare type AuthPayload = {
14
14
  };
15
15
  };
16
16
 
17
+ export declare interface BulkTableParams {
18
+ tablename: string & tags.MinLength<1>;
19
+ rows: Record<string, unknown>[] & tags.MinItems<1>;
20
+ kwargs?: Record<string, unknown>;
21
+ }
22
+
17
23
  export declare interface CallParams {
18
24
  deviceKey: string & tags.MinLength<1>;
19
25
  topic: string & tags.MinLength<1>;
@@ -85,6 +91,24 @@ export declare class IronFlock {
85
91
  publish(topic: string, args?: unknown[], kwargs?: Record<string, unknown>): Promise<unknown>;
86
92
  publishToTable(tablename: string, args?: unknown[], kwargs?: Record<string, unknown>): Promise<unknown>;
87
93
  appendToTable(tablename: string, args?: unknown[], kwargs?: Record<string, unknown>): Promise<unknown>;
94
+ /**
95
+ * Publishes many rows in a single message (bulk insert) to the dedicated topic
96
+ * `bulk.{swarmKey}.{appKey}.{tablename}`. The platform inserts the whole batch
97
+ * atomically (all-or-nothing). Use for high-frequency data where one round-trip
98
+ * per row is too costly. Like publishToTable this is fire-and-forget — the ack
99
+ * confirms delivery to the router, not the DB insert. Use appendRowsToTable when
100
+ * you need the insert outcome.
101
+ */
102
+ publishRowsToTable(tablename: string, rows: Record<string, unknown>[], kwargs?: Record<string, unknown>): Promise<unknown>;
103
+ /**
104
+ * Appends many rows in a single RPC (bulk insert) by calling the dedicated
105
+ * procedure `appendBulk.{swarmKey}.{appKey}.{tablename}`. The platform inserts
106
+ * the whole batch atomically (all-or-nothing): if any row is invalid the entire
107
+ * batch is rejected and nothing is persisted. Resolves with the RPC result
108
+ * (e.g. { success: true, count: N }). Prefer over publishRowsToTable when you
109
+ * need the insert outcome.
110
+ */
111
+ appendRowsToTable(tablename: string, rows: Record<string, unknown>[], kwargs?: Record<string, unknown>): Promise<unknown>;
88
112
  subscribe(topic: string, handler: (...args: any[]) => void, options?: object): Promise<default_2.Subscription<any[], any, string> | undefined>;
89
113
  subscribeToTable(tablename: string, handler: (...args: any[]) => void, options?: object): Promise<default_2.Subscription<any[], any, string> | undefined>;
90
114
  call(topic: string, args?: unknown[], kwargs?: Record<string, unknown>, options?: object): Promise<unknown>;
@@ -167,6 +191,8 @@ export declare interface TableQueryParams {
167
191
  filterAnd?: SQLFilterAnd[];
168
192
  }
169
193
 
194
+ export declare const validateBulkTableParams: ((input: unknown) => default_3.IValidation<BulkTableParams>) & StandardSchemaV1<BulkTableParams, BulkTableParams>;
195
+
170
196
  export declare const validateCallParams: ((input: unknown) => default_3.IValidation<CallParams>) & StandardSchemaV1<CallParams, CallParams>;
171
197
 
172
198
  export declare const validateLocationParams: ((input: unknown) => default_3.IValidation<LocationParams>) & StandardSchemaV1<LocationParams, LocationParams>;