@tailglow/cli 0.9.4 → 0.9.6

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/README.md CHANGED
@@ -39,7 +39,7 @@ Field names are snake_case on the wire and kebab-case on the command line: `repe
39
39
  becomes `--repeat-window-minutes`. Object and array fields take JSON:
40
40
 
41
41
  ```bash
42
- tglow views create-join --project prj_x --joins '[{"view_id":"view_b","on":"user_id"}]'
42
+ tglow views create --project prj_x --type join --base-view-id view_a --joins '[{"lookup_view_id":"view_b","alias":"b","base_field":"user_id","lookup_field":"id"}]'
43
43
  ```
44
44
 
45
45
  ## Credentials
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailglow/cli",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
4
4
  "type": "module",
5
5
  "description": "The Tailglow command line. Every command is generated from the Tailglow API reference, so the CLI and the documentation can never describe different APIs.",
6
6
  "bin": {
@@ -248,13 +248,13 @@ export const CLI_COMMANDS = [
248
248
  "query_params": [],
249
249
  "body_fields": [
250
250
  {
251
- "name": "tgl_authoring_mode",
252
- "type": "TglAuthoringMode",
251
+ "name": "ambiguity_handling",
252
+ "type": "AmbiguityHandlingMode",
253
253
  "required": false,
254
- "description": "Project-wide authoring behavior. Aggressive chooses a defensible mapping; normal requests clarification for competing meanings. Defaults to aggressive. Existing scripts are unchanged. Optional.",
254
+ "description": "What new mappings do when the source data allows more than one defensible reading. decide picks the most defensible one; ask requests a hint from you instead. Defaults to decide. Existing scripts are unchanged. Optional.",
255
255
  "allowed_values": [
256
- "normal",
257
- "aggressive"
256
+ "decide",
257
+ "ask"
258
258
  ],
259
259
  "deprecated": null
260
260
  },
@@ -1804,7 +1804,7 @@ export const CLI_COMMANDS = [
1804
1804
  "sources:read"
1805
1805
  ],
1806
1806
  "notes": [
1807
- "Documents are returned exactly as they were sent, minus Tailglow's own reserved envelope.",
1807
+ "Documents are returned as they were sent, minus Tailglow's own reserved envelope. A value sent in a JSON array or JSONL that is not an object comes back as `{\"value\": ...}`.",
1808
1808
  "Paging is forward-only. Pass `pagination.next_cursor` back as `after` to get the next page; no `prev_cursor` is issued, and `before` returns the first page.",
1809
1809
  "While the project's server is stopped this answers 409 `server_stopped`. Start the server and try again.",
1810
1810
  "`after` and `before` are mutually exclusive."
@@ -2013,7 +2013,7 @@ export const CLI_COMMANDS = [
2013
2013
  "command": "create",
2014
2014
  "operation_id": "createView",
2015
2015
  "summary": "Create View",
2016
- "description": "Create a view that transforms records from a collection or another view.",
2016
+ "description": "Create a view: a transform over one collection or view, or a join of a base view with lookups.",
2017
2017
  "method": "POST",
2018
2018
  "path": "/v1/projects/:project_id/views",
2019
2019
  "alternate_paths": [],
@@ -2021,15 +2021,19 @@ export const CLI_COMMANDS = [
2021
2021
  "views:write"
2022
2022
  ],
2023
2023
  "notes": [
2024
- "A view reads from exactly one source: a collection, or another view to derive from.",
2025
2024
  "The output schema defines the fields the view produces. A transform is created alongside the view to populate them.",
2026
2025
  "Leaving the transform script empty queues it for generation instead of rejecting it, so a view can be created before its TGL is written.",
2027
2026
  "Backfilling existing records starts shortly after creation and runs in the background. The view reports its progress while it catches up.",
2028
- "A view reads from exactly one place: set `collection_id` to derive from raw ingested records, or `parent_view_id` to derive from another view. Setting both, or neither, is rejected.",
2027
+ "A join's base view and lookup views must all be views in this project.",
2028
+ "A join whose inputs lead back to the join itself, directly or through other views, is rejected.",
2029
+ "A `transform` view reads from exactly one place: set `collection_id` to derive from raw ingested records, or `parent_view_id` to derive from another view. Setting both, or neither, is rejected, and so are `base_view_id` and `joins`.",
2030
+ "A `join` view requires `base_view_id` and `joins` (one to ten clauses), and rejects `collection_id` and `parent_view_id`. Join a collection by creating a view over it first.",
2031
+ "Each join clause's `alias` must be lowercase letters, digits and underscores, and start with a letter. It is how the clause's fields are addressed in the transform script.",
2032
+ "A join enriches each record with each joined view's latest value, by record timestamp, at the time the record is processed. Records already produced are not revisited.",
2029
2033
  "There is no `source_id` on this endpoint. One source can hold many collections, and the collection is what owns the schema and the records a view transforms. List a source's collections with `GET /v1/projects/:project/collections?source_id=...` and pass the one you want.",
2030
2034
  "`output_schema` field names must be unique by name, cannot conflict on type, and cannot collide with a reserved query key such as `limit` or `cursor`.",
2031
- "`transform_script` cannot be whitespace-only. Supplying one activates the view's first transform immediately and skips automatic TGL generation.",
2032
- "Use `hint` for rules the generator cannot read off the field names: a formatting rule (\"display_name should be Name (Type)\"), a business threshold (\"classify as high above 500\"), or a disambiguation when a source field could map more than one way. Skip it for obvious mappings like renames and type conversions, which the generator already handles."
2035
+ "`transform_script` cannot be whitespace-only. Supplying one skips automatic TGL generation; omit it entirely to have one generated.",
2036
+ "Use `hint` for rules the generator cannot read off the field names: a formatting rule (\"display_name should be Name (Type)\"), a business threshold (\"classify as high above 500\"), or a disambiguation when an input field could map more than one way. Skip it for obvious mappings like renames and type conversions, which the generator already handles."
2033
2037
  ],
2034
2038
  "path_params": [
2035
2039
  {
@@ -2043,6 +2047,17 @@ export const CLI_COMMANDS = [
2043
2047
  ],
2044
2048
  "query_params": [],
2045
2049
  "body_fields": [
2050
+ {
2051
+ "name": "type",
2052
+ "type": "ViewType",
2053
+ "required": false,
2054
+ "description": "How the view's records are produced: `transform` reads one collection or view through a script; `join` starts from a base view and attaches lookup rows. Fixed at creation. Optional. Defaults to `\"transform\"`.",
2055
+ "allowed_values": [
2056
+ "transform",
2057
+ "join"
2058
+ ],
2059
+ "deprecated": null
2060
+ },
2046
2061
  {
2047
2062
  "name": "name",
2048
2063
  "type": "string",
@@ -2166,89 +2181,19 @@ export const CLI_COMMANDS = [
2166
2181
  "allowed_values": [],
2167
2182
  "deprecated": null
2168
2183
  },
2169
- {
2170
- "name": "transform_script",
2171
- "type": "string",
2172
- "required": false,
2173
- "description": "TGL transform script. When set, the view skips automatic TGL generation. Optional. Minimum length: `1`. Maximum length: `65536`.",
2174
- "allowed_values": [],
2175
- "deprecated": null
2176
- },
2177
- {
2178
- "name": "transform_mode",
2179
- "type": "string",
2180
- "required": false,
2181
- "description": "Whether a new schema version that no existing transform covers gets a script generated for it, or waits for you to write one. Defaults to auto. Optional.",
2182
- "allowed_values": [
2183
- "auto",
2184
- "manual"
2185
- ],
2186
- "deprecated": null
2187
- }
2188
- ]
2189
- },
2190
- {
2191
- "resource": "views",
2192
- "command": "create-join",
2193
- "operation_id": "createJoinView",
2194
- "summary": "Create Join View",
2195
- "description": "Create a view that joins two existing views on a shared key.",
2196
- "method": "POST",
2197
- "path": "/v1/projects/:project_id/views/join",
2198
- "alternate_paths": [],
2199
- "scopes": [
2200
- "views:write"
2201
- ],
2202
- "notes": [
2203
- "Both sides must be views in this project. Join a collection by creating a view over it first.",
2204
- "The join key must exist in the output schema of both sides.",
2205
- "A join view rebuilds when either side produces new records, so it trails its inputs rather than updating in the same instant.",
2206
- "Records are enriched with each joined view's latest value, by record timestamp, at the time they are processed. Records already produced are not revisited.",
2207
- "Each join clause's `alias` must be lowercase letters, digits and underscores, and start with a letter. It is how the clause's fields are addressed in the transform script.",
2208
- "`transform_script` cannot be whitespace-only. Omit it entirely to have one generated.",
2209
- "Use `hint` for rules the generator cannot read off the field names: a formatting rule (\"display_name should be Name (Type)\"), a business threshold (\"classify as high above 500\"), or a disambiguation when an input field could map more than one way. Skip it for obvious mappings like renames and type conversions, which the generator already handles."
2210
- ],
2211
- "path_params": [
2212
- {
2213
- "name": "project_id",
2214
- "type": "string",
2215
- "required": true,
2216
- "description": "Unique identifier of the project.",
2217
- "allowed_values": [],
2218
- "deprecated": null
2219
- }
2220
- ],
2221
- "query_params": [],
2222
- "body_fields": [
2223
- {
2224
- "name": "name",
2225
- "type": "string",
2226
- "required": true,
2227
- "description": "Name shown for this join view. Minimum length: `1`. Maximum length: `128`.",
2228
- "allowed_values": [],
2229
- "deprecated": null
2230
- },
2231
- {
2232
- "name": "project_id",
2233
- "type": "string",
2234
- "required": false,
2235
- "description": "Project the join view belongs to. Optional.",
2236
- "allowed_values": [],
2237
- "deprecated": null
2238
- },
2239
2184
  {
2240
2185
  "name": "base_view_id",
2241
2186
  "type": "string",
2242
- "required": true,
2243
- "description": "View every output record starts from. Minimum length: `1`.",
2187
+ "required": false,
2188
+ "description": "View every output record of a join starts from. Optional. Minimum length: `1`.",
2244
2189
  "allowed_values": [],
2245
2190
  "deprecated": null
2246
2191
  },
2247
2192
  {
2248
2193
  "name": "joins",
2249
2194
  "type": "object[]",
2250
- "required": true,
2251
- "description": "Views joined onto the base view, each with its own match fields.",
2195
+ "required": false,
2196
+ "description": "Views joined onto the base view, each with its own match fields. Optional.",
2252
2197
  "allowed_values": [],
2253
2198
  "deprecated": null,
2254
2199
  "fields": [
@@ -2315,61 +2260,23 @@ export const CLI_COMMANDS = [
2315
2260
  }
2316
2261
  ]
2317
2262
  },
2318
- {
2319
- "name": "output_schema",
2320
- "type": "object[]",
2321
- "required": false,
2322
- "description": "Fields the join produces. Leave empty to have one inferred. Optional. Defaults to `[]`.",
2323
- "allowed_values": [],
2324
- "deprecated": null,
2325
- "fields": [
2326
- {
2327
- "name": "name",
2328
- "type": "string",
2329
- "required": true,
2330
- "description": "Field name as it appears on the view's records. Minimum length: `1`. Maximum length: `128`.",
2331
- "allowed_values": [],
2332
- "deprecated": null
2333
- },
2334
- {
2335
- "name": "type",
2336
- "type": "string",
2337
- "required": true,
2338
- "description": "Value type the field holds.",
2339
- "allowed_values": [
2340
- "string",
2341
- "number",
2342
- "boolean",
2343
- "date",
2344
- "array",
2345
- "null"
2346
- ],
2347
- "deprecated": null
2348
- },
2349
- {
2350
- "name": "description",
2351
- "type": "string",
2352
- "required": false,
2353
- "description": "What the field means. Used as guidance when a transform script is generated. Optional. Maximum length: `512`.",
2354
- "allowed_values": [],
2355
- "deprecated": null
2356
- }
2357
- ]
2358
- },
2359
2263
  {
2360
2264
  "name": "transform_script",
2361
2265
  "type": "string",
2362
2266
  "required": false,
2363
- "description": "TGL transform script. Omit to have one generated. Optional. Minimum length: `1`. Maximum length: `65536`.",
2267
+ "description": "TGL transform script. When set, the view skips automatic TGL generation. Optional. Minimum length: `1`. Maximum length: `65536`.",
2364
2268
  "allowed_values": [],
2365
2269
  "deprecated": null
2366
2270
  },
2367
2271
  {
2368
- "name": "hint",
2272
+ "name": "transform_mode",
2369
2273
  "type": "string",
2370
2274
  "required": false,
2371
- "description": "Instructions the generator cannot infer from field names alone, such as a formatting rule or a business threshold. Optional. Maximum length: `4096`.",
2372
- "allowed_values": [],
2275
+ "description": "Whether a new schema version that no existing transform covers gets a script generated for it, or waits for you to write one. Defaults to auto. Optional.",
2276
+ "allowed_values": [
2277
+ "auto",
2278
+ "manual"
2279
+ ],
2373
2280
  "deprecated": null
2374
2281
  }
2375
2282
  ]
@@ -8338,6 +8245,17 @@ export const CLI_COMMANDS = [
8338
8245
  ],
8339
8246
  "deprecated": null
8340
8247
  },
8248
+ {
8249
+ "name": "timezone_display",
8250
+ "type": "TimezoneDisplay",
8251
+ "required": false,
8252
+ "description": "How the user reads times in the dashboard and in emails: `local` in the time zone their browser reports, `utc` in UTC. Optional.",
8253
+ "allowed_values": [
8254
+ "local",
8255
+ "utc"
8256
+ ],
8257
+ "deprecated": null
8258
+ },
8341
8259
  {
8342
8260
  "name": "default_ai_model",
8343
8261
  "type": "AiChatSelection",