space-data-module-sdk 0.9.0 → 0.9.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "space-data-module-sdk",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Module SDK for building, validating, signing, and deploying WebAssembly modules on the Space Data Network.",
6
6
  "type": "module",
@@ -11,6 +11,10 @@
11
11
  // - a list port (e.g. "entries"): a run of aligned records of one table, back to back at a fixed stride;
12
12
  // - a raw port (e.g. "body", "records", "url", "sql", "path"): unbounded bytes, verbatim - bodies, keys, record
13
13
  // streams (size-prefixed frames concatenated), and text that may exceed an aligned string (UTF-8).
14
+ // - SQL values (raw "params" in, raw "cells" out) use FlatSQL's own tagged parameter encoding (flatsql capi
15
+ // decodeParamsNoThrow), value after value with no count: u8 tag, u32 little-endian payload length, payload.
16
+ // Tags: 0 null (length 0), 1 bool (1 byte, 0 / 1), 2 i64 (8 bytes LE), 3 f64 (8 bytes LE), 4 string (UTF-8),
17
+ // 5 bytes.
14
18
  // Aligned strings hold at most 255 bytes; a value that does not fit is refused, never truncated. Times are Unix
15
19
  // milliseconds UTC. A zero or an empty string means "not given" and the host applies the documented default: aligned records have no
16
20
  // schema defaults (an unset field reads zero), so every field here is phrased so that zero is the default.
@@ -86,7 +90,7 @@ table StoredRecordMeta {
86
90
  SOURCE_NAME: string (aligned_max_length: 128);
87
91
  BATCH_ID: string (aligned_max_length: 128);
88
92
  PRODUCER_PEER_ID: string (aligned_max_length: 128);
89
- LICENSE: string (aligned_max_length: 64);
93
+ LICENSE: string (aligned_max_length: 128);
90
94
  }
91
95
 
92
96
  /// One record on raw "data"; the result names its CID.
@@ -110,16 +114,17 @@ table StorageExpireResult { DELETED: uint64; MISSING: uint64; CAPPED: bool; }
110
114
 
111
115
  enum reconcileKind : ubyte { Duplicates, None, Current }
112
116
  /// One batch: raw "records" (size-prefixed record stream), optional raw "archive" (the source document, kept under
113
- /// ARCHIVE_SOURCE/ARCHIVE_NAME when the host has an archive root), optional "provenance" record.
117
+ /// ARCHIVE_SOURCE/ARCHIVE_NAME when the host has an archive root), optional list "provenance" (one Provenance) and
118
+ /// optional list "provenance_attributes" (ProvenanceAttribute, in order).
114
119
  table StorageIngestParams {
115
120
  SCHEMA: string (aligned_max_length: 64);
116
121
  PROVIDER_ID: string (aligned_max_length: 128);
117
122
  SOURCE_NAME: string (aligned_max_length: 128);
118
123
  BATCH_ID: string (aligned_max_length: 128);
119
124
  SOURCE_URL: string (aligned_max_length: 255);
120
- CONTENT_KEY_ID: string (aligned_max_length: 64);
125
+ CONTENT_KEY_ID: string (aligned_max_length: 128);
121
126
  SOURCE_PEER: string (aligned_max_length: 128);
122
- LICENSE: string (aligned_max_length: 64);
127
+ LICENSE: string (aligned_max_length: 128);
123
128
  LICENSE_URL: string (aligned_max_length: 255);
124
129
  CITATION: string (aligned_max_length: 255);
125
130
  SHARE_ALIKE: bool;
@@ -130,17 +135,23 @@ table StorageIngestParams {
130
135
  table Provenance {
131
136
  SOURCE_URL: string (aligned_max_length: 255);
132
137
  HTTP_STATUS: int32;
133
- ETAG: string (aligned_max_length: 128);
138
+ ETAG: string (aligned_max_length: 255);
134
139
  LAST_MODIFIED: string (aligned_max_length: 64);
135
140
  CONTENT_TYPE: string (aligned_max_length: 128);
136
141
  RETRIEVED_MS: uint64;
137
- PARSER: string (aligned_max_length: 64);
138
- PARSER_VERSION: string (aligned_max_length: 32);
142
+ PARSER: string (aligned_max_length: 128);
143
+ PARSER_VERSION: string (aligned_max_length: 64);
139
144
  SOURCE_SHA256: string (aligned_max_length: 64);
140
145
  NORMALIZED_SHA256: string (aligned_max_length: 64);
141
146
  NORMALIZED_COUNT: uint64;
142
147
  FROM_CACHE: bool;
143
148
  }
149
+ /// Descriptive provenance a parser has no Provenance field for (method, units, date range, counts), as name / value
150
+ /// pairs in order (list "provenance_attributes"; the runtime IngestRequest's Provenance.ATTRIBUTES).
151
+ table ProvenanceAttribute {
152
+ NAME: string (aligned_max_length: 128);
153
+ VALUE: string (aligned_max_length: 255);
154
+ }
144
155
  table StorageIngestResult {
145
156
  SCHEMA: string (aligned_max_length: 64);
146
157
  BATCH_ID: string (aligned_max_length: 128);
@@ -151,16 +162,7 @@ table StorageIngestResult {
151
162
  PROVENANCE_FILE: string (aligned_max_length: 255);
152
163
  }
153
164
 
154
- enum sqlValueKind : ubyte { Null, Bool, I64, F64, Str }
155
- /// One SQL parameter (list "sql_params") or result cell (list "cells", row-major).
156
- table SqlValue {
157
- KIND: sqlValueKind;
158
- BOOL_VALUE: bool;
159
- I64_VALUE: int64;
160
- F64_VALUE: double;
161
- STR_VALUE: string (aligned_max_length: 255);
162
- }
163
- /// raw "sql", list "sql_params"; the answer: a StreamResult with raw "stream" (deliver Inline) or its BodyRef.
165
+ /// raw "sql", raw "params" (tagged SQL values); the answer: a StreamResult with raw "stream" (deliver Inline) or its BodyRef.
164
166
  table SqlStreamParams { DELIVER: deliverMode; }
165
167
  table StreamResult {
166
168
  ROWS: uint64;
@@ -176,8 +178,8 @@ table EpochStreamParams {
176
178
  DELIVER: deliverMode;
177
179
  }
178
180
  enum sandboxWant : ubyte { Stream, Rows, Auto }
179
- /// raw "sql", list "sql_params"; Stream answers like SqlStream, Rows with list "columns" (TextValue) and list
180
- /// "cells" (SqlValue, row-major).
181
+ /// raw "sql", raw "params" (tagged SQL values); Stream answers like SqlStream, Rows with list "columns" (TextValue)
182
+ /// and raw "cells" (tagged SQL values, row-major: ROWS x COLUMNS of them).
181
183
  table SandboxQueryParams { WANT: sandboxWant; DELIVER: deliverMode; }
182
184
  table SandboxQueryResult { KIND: sandboxWant; ROWS: uint64; COLUMNS: uint32; REF: BodyRef; }
183
185
  /// storage.query_surface: list "tables", list "columns".
@@ -193,7 +195,7 @@ table SurfaceColumn {
193
195
  PLACEHOLDER: bool;
194
196
  }
195
197
  table QuerySurfaceLimits { TIMEOUT_MS: uint32; MAX_ROWS: uint64; MAX_BYTES: uint64; }
196
- /// raw "sql", list "sql_params", list "projection" (TextValue); the key comes back as a TextValue.
198
+ /// raw "sql", raw "params" (tagged SQL values), list "projection" (TextValue); the key comes back as a TextValue.
197
199
  table CacheKeyParams {
198
200
  SCHEMA_NAME: string (aligned_max_length: 64);
199
201
  SCHEMA_VERSION: string (aligned_max_length: 32);
@@ -302,7 +304,7 @@ table P2pPnmEntry {
302
304
  GOSSIP_PEER_ID: string (aligned_max_length: 128);
303
305
  STANDARD: string (aligned_max_length: 16);
304
306
  SCHEMA: string (aligned_max_length: 64);
305
- FILE_ID: string (aligned_max_length: 16);
307
+ FILE_ID: string (aligned_max_length: 255);
306
308
  FILE_NAME: string (aligned_max_length: 255);
307
309
  CID: string (aligned_max_length: 128);
308
310
  PUBLISH_MS: uint64;
@@ -324,7 +326,7 @@ table P2pLatestDataset {
324
326
  STANDARD: string (aligned_max_length: 16);
325
327
  SCHEMA: string (aligned_max_length: 64);
326
328
  PNM_CID: string (aligned_max_length: 128);
327
- PNM_FILE_ID: string (aligned_max_length: 16);
329
+ PNM_FILE_ID: string (aligned_max_length: 255);
328
330
  PNM_PUBLISH_MS: uint64;
329
331
  PNM_SIGNATURE_VERIFIED: bool;
330
332
  PNM_ATTRIBUTION: string (aligned_max_length: 16);
@@ -40,6 +40,9 @@ table Provenance {
40
40
  SCHEMA_COUNTS: [uint64];
41
41
  WARNINGS: [string];
42
42
  FROM_CACHE: bool;
43
+ /// Descriptive provenance the parser has no field above for - the method, units, the date range covered, counts
44
+ /// of what was dropped or filled - as name / value pairs, kept in order (a name may repeat). Values are text.
45
+ ATTRIBUTES: [Header];
43
46
  }
44
47
 
45
48
  /// A request to store one batch of records with its source tags (the storage-ingest host connector). The records
@@ -17,6 +17,8 @@ export const RecommendedCapabilityIds = Object.freeze([
17
17
  "protocol_handle",
18
18
  "protocol_dial",
19
19
  "p2p_read",
20
+ "node_status_read",
21
+ "node_activity_read",
20
22
  "database",
21
23
  "storage_adapter",
22
24
  "storage_query",
@@ -24,6 +26,7 @@ export const RecommendedCapabilityIds = Object.freeze([
24
26
  "storage_ingest",
25
27
  "context_read",
26
28
  "context_write",
29
+ "secrets",
27
30
  "process_exec",
28
31
  "crypto_hash",
29
32
  "crypto_sign",