@instafy/cli 0.2.3 → 0.3.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.
Files changed (53) hide show
  1. package/README.md +4 -0
  2. package/dist/bind/LICENSE +661 -0
  3. package/dist/bind/bin/instafy-bind.mjs +542 -0
  4. package/dist/bind/client/bind-client.js +1219 -0
  5. package/dist/bind/src/apply.mjs +293 -0
  6. package/dist/bind/src/bound.mjs +202 -0
  7. package/dist/bind/src/budget.mjs +58 -0
  8. package/dist/bind/src/check.mjs +176 -0
  9. package/dist/bind/src/config.mjs +169 -0
  10. package/dist/bind/src/controller.mjs +244 -0
  11. package/dist/bind/src/detached-env.mjs +27 -0
  12. package/dist/bind/src/executors/agent.mjs +336 -0
  13. package/dist/bind/src/executors/script.mjs +163 -0
  14. package/dist/bind/src/handler-kit.mjs +150 -0
  15. package/dist/bind/src/init.mjs +238 -0
  16. package/dist/bind/src/jobs.mjs +316 -0
  17. package/dist/bind/src/net.mjs +281 -0
  18. package/dist/bind/src/page-fetch.mjs +43 -0
  19. package/dist/bind/src/preview-host.mjs +114 -0
  20. package/dist/bind/src/protocol.mjs +103 -0
  21. package/dist/bind/src/records-schema.mjs +580 -0
  22. package/dist/bind/src/records.mjs +161 -0
  23. package/dist/bind/src/save-owner.mjs +492 -0
  24. package/dist/bind/src/schema-lite.mjs +212 -0
  25. package/dist/bind/src/server.mjs +908 -0
  26. package/dist/bind/src/sse.mjs +119 -0
  27. package/dist/bind/src/starters/blank/app.js +17 -0
  28. package/dist/bind/src/starters/blank/index.html +22 -0
  29. package/dist/bind/src/starters/checklist/app.js +171 -0
  30. package/dist/bind/src/starters/checklist/bound.json +29 -0
  31. package/dist/bind/src/starters/checklist/data.json +26 -0
  32. package/dist/bind/src/starters/checklist/index.html +23 -0
  33. package/dist/bind/src/starters/compare/app.js +316 -0
  34. package/dist/bind/src/starters/compare/bound.json +26 -0
  35. package/dist/bind/src/starters/compare/data.json +170 -0
  36. package/dist/bind/src/starters/compare/index.html +23 -0
  37. package/dist/bind/src/starters/handlers/read_offer.mjs +55 -0
  38. package/dist/bind/src/starters/handlers/set_check.mjs +41 -0
  39. package/dist/bind/src/starters/ranked/app.js +166 -0
  40. package/dist/bind/src/starters/ranked/bound.json +26 -0
  41. package/dist/bind/src/starters/ranked/data.json +142 -0
  42. package/dist/bind/src/starters/ranked/index.html +23 -0
  43. package/dist/bind/src/starters/site.js +888 -0
  44. package/dist/bind/src/starters/theme.css +492 -0
  45. package/dist/bind/src/starters/timeline/app.js +143 -0
  46. package/dist/bind/src/starters/timeline/data.json +41 -0
  47. package/dist/bind/src/starters/timeline/index.html +22 -0
  48. package/dist/bind/src/static.mjs +141 -0
  49. package/dist/bind/src/tokens.mjs +102 -0
  50. package/dist/bind/src/try.mjs +139 -0
  51. package/dist/bind/src/web.mjs +191 -0
  52. package/dist/cli.js +2261 -387
  53. package/package.json +3 -2
@@ -0,0 +1,580 @@
1
+ // instafy.records@1: the records file every executor's results are checked against and the binder writes.
2
+ // Validated with schema-lite (oneOf, $ref, $defs, maxProperties and additionalProperties-as-schema).
3
+ export const RECORDS_SCHEMA = Object.freeze({
4
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
5
+ "$id": "https://instafy.dev/schemas/instafy.records@1.json",
6
+ "type": "object",
7
+ "required": [
8
+ "schema",
9
+ "records"
10
+ ],
11
+ "properties": {
12
+ "schema": {
13
+ "const": "instafy.records@1"
14
+ },
15
+ "writer": {
16
+ "type": "object"
17
+ },
18
+ "attribution": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "string",
22
+ "maxLength": 300
23
+ },
24
+ "maxItems": 10
25
+ },
26
+ "records": {
27
+ "type": "array",
28
+ "maxItems": 2000,
29
+ "items": {
30
+ "oneOf": [
31
+ {
32
+ "$ref": "#/$defs/claim"
33
+ },
34
+ {
35
+ "$ref": "#/$defs/offer"
36
+ },
37
+ {
38
+ "$ref": "#/$defs/item"
39
+ }
40
+ ]
41
+ }
42
+ }
43
+ },
44
+ "$defs": {
45
+ "rid": {
46
+ "type": "string",
47
+ "pattern": "^[A-Za-z0-9_.:-]{1,96}$"
48
+ },
49
+ "ref": {
50
+ "type": "string",
51
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,47}:[^\\s]{1,120}$"
52
+ },
53
+ "basis": {
54
+ "enum": [
55
+ "measured",
56
+ "routed",
57
+ "counted",
58
+ "estimated",
59
+ "registry",
60
+ "filed",
61
+ "live",
62
+ "brand",
63
+ "user_note",
64
+ "editorial",
65
+ "modelled",
66
+ "inferred"
67
+ ]
68
+ },
69
+ "confidence": {
70
+ "enum": [
71
+ "high",
72
+ "medium",
73
+ "low"
74
+ ]
75
+ },
76
+ "text": {
77
+ "type": "string",
78
+ "maxLength": 140
79
+ },
80
+ "https": {
81
+ "type": "string",
82
+ "maxLength": 2000,
83
+ "pattern": "^https://|^http://(localhost|127\\.0\\.0\\.1)(:|/)"
84
+ },
85
+ "prov": {
86
+ "type": "object",
87
+ "required": [
88
+ "source",
89
+ "lane",
90
+ "observed_at",
91
+ "ttl_s"
92
+ ],
93
+ "additionalProperties": false,
94
+ "properties": {
95
+ "source": {
96
+ "type": "string",
97
+ "maxLength": 80
98
+ },
99
+ "source_label": {
100
+ "type": "string",
101
+ "maxLength": 80
102
+ },
103
+ "lane": {
104
+ "enum": [
105
+ "link",
106
+ "official",
107
+ "open",
108
+ "capture",
109
+ "feed",
110
+ "assist",
111
+ "local"
112
+ ]
113
+ },
114
+ "url": {
115
+ "$ref": "#/$defs/https"
116
+ },
117
+ "observed_at": {
118
+ "type": "string",
119
+ "format": "date-time"
120
+ },
121
+ "observed_by": {
122
+ "type": "string",
123
+ "maxLength": 80
124
+ },
125
+ "observer": {
126
+ "type": "string",
127
+ "maxLength": 80
128
+ },
129
+ "as_of": {
130
+ "type": "string",
131
+ "maxLength": 32
132
+ },
133
+ "ttl_s": {
134
+ "type": "integer",
135
+ "minimum": 0
136
+ },
137
+ "ttl": {
138
+ "type": "integer",
139
+ "minimum": 0
140
+ },
141
+ "class": {
142
+ "enum": [
143
+ "stored",
144
+ "live"
145
+ ]
146
+ },
147
+ "license": {
148
+ "type": "object",
149
+ "additionalProperties": false,
150
+ "properties": {
151
+ "store": {
152
+ "enum": [
153
+ "none",
154
+ "ids",
155
+ "ttl",
156
+ "full"
157
+ ]
158
+ },
159
+ "attribution": {
160
+ "type": "string",
161
+ "maxLength": 300
162
+ },
163
+ "url": {
164
+ "$ref": "#/$defs/https"
165
+ }
166
+ }
167
+ },
168
+ "adapter": {
169
+ "type": "string",
170
+ "maxLength": 60
171
+ },
172
+ "job": {
173
+ "type": "string",
174
+ "maxLength": 80
175
+ },
176
+ "intent": {
177
+ "type": "object",
178
+ "required": [
179
+ "name"
180
+ ],
181
+ "properties": {
182
+ "name": {
183
+ "type": "string",
184
+ "pattern": "^[a-z][a-z0-9_]{0,47}$"
185
+ },
186
+ "params": {
187
+ "type": "object"
188
+ },
189
+ "id": {
190
+ "type": "string",
191
+ "maxLength": 40
192
+ }
193
+ }
194
+ },
195
+ "snapshot_sha256": {
196
+ "type": "string",
197
+ "pattern": "^[0-9a-f]{64}$"
198
+ },
199
+ "sandbox": {
200
+ "type": "boolean"
201
+ },
202
+ "logged_in": {
203
+ "const": false
204
+ },
205
+ "refresh_days": {
206
+ "type": "number",
207
+ "minimum": 1,
208
+ "maximum": 3650
209
+ },
210
+ "tier": {
211
+ "type": "string",
212
+ "maxLength": 20
213
+ },
214
+ "requested_by": {
215
+ "type": "string",
216
+ "maxLength": 80
217
+ },
218
+ "task": {
219
+ "type": "string",
220
+ "maxLength": 80
221
+ },
222
+ "rid": {
223
+ "type": "string",
224
+ "maxLength": 120
225
+ }
226
+ }
227
+ },
228
+ "claim": {
229
+ "type": "object",
230
+ "required": [
231
+ "type",
232
+ "cid",
233
+ "ref",
234
+ "attr",
235
+ "basis",
236
+ "prov"
237
+ ],
238
+ "additionalProperties": false,
239
+ "properties": {
240
+ "type": {
241
+ "const": "claim"
242
+ },
243
+ "cid": {
244
+ "$ref": "#/$defs/rid"
245
+ },
246
+ "ref": {
247
+ "$ref": "#/$defs/ref"
248
+ },
249
+ "attr": {
250
+ "type": "string",
251
+ "pattern": "^[a-z][a-z0-9_]{0,47}$"
252
+ },
253
+ "value": {
254
+ "type": [
255
+ "string",
256
+ "number",
257
+ "boolean",
258
+ "null"
259
+ ],
260
+ "maxLength": 140
261
+ },
262
+ "unit": {
263
+ "type": "string",
264
+ "maxLength": 12
265
+ },
266
+ "label": {
267
+ "type": "string",
268
+ "maxLength": 60
269
+ },
270
+ "note": {
271
+ "$ref": "#/$defs/text"
272
+ },
273
+ "status": {
274
+ "enum": [
275
+ "ok",
276
+ "not_found",
277
+ "uncertain",
278
+ "error"
279
+ ]
280
+ },
281
+ "basis": {
282
+ "$ref": "#/$defs/basis"
283
+ },
284
+ "confidence": {
285
+ "$ref": "#/$defs/confidence"
286
+ },
287
+ "match": {
288
+ "type": "object",
289
+ "additionalProperties": false,
290
+ "properties": {
291
+ "confidence": {
292
+ "$ref": "#/$defs/confidence"
293
+ },
294
+ "by": {
295
+ "type": "array",
296
+ "items": {
297
+ "enum": [
298
+ "id",
299
+ "phone",
300
+ "address",
301
+ "name",
302
+ "geo"
303
+ ]
304
+ },
305
+ "maxItems": 5
306
+ },
307
+ "dist_m": {
308
+ "type": "number",
309
+ "minimum": 0
310
+ },
311
+ "candidate": {
312
+ "type": "string",
313
+ "maxLength": 120
314
+ }
315
+ }
316
+ },
317
+ "prov": {
318
+ "$ref": "#/$defs/prov"
319
+ }
320
+ }
321
+ },
322
+ "offer": {
323
+ "type": "object",
324
+ "required": [
325
+ "type",
326
+ "oid",
327
+ "ref",
328
+ "price",
329
+ "prov"
330
+ ],
331
+ "additionalProperties": false,
332
+ "properties": {
333
+ "type": {
334
+ "const": "offer"
335
+ },
336
+ "oid": {
337
+ "$ref": "#/$defs/rid"
338
+ },
339
+ "ref": {
340
+ "$ref": "#/$defs/ref"
341
+ },
342
+ "vid": {
343
+ "$ref": "#/$defs/rid"
344
+ },
345
+ "variant": {
346
+ "type": "object",
347
+ "additionalProperties": false,
348
+ "properties": {
349
+ "checkin": {
350
+ "type": "string",
351
+ "format": "date"
352
+ },
353
+ "checkout": {
354
+ "type": "string",
355
+ "format": "date"
356
+ },
357
+ "guests": {
358
+ "type": "integer",
359
+ "minimum": 1,
360
+ "maximum": 30
361
+ },
362
+ "rooms": {
363
+ "type": "integer",
364
+ "minimum": 1,
365
+ "maximum": 10
366
+ },
367
+ "label": {
368
+ "type": "string",
369
+ "maxLength": 80
370
+ }
371
+ }
372
+ },
373
+ "seller": {
374
+ "type": "object",
375
+ "required": [
376
+ "name"
377
+ ],
378
+ "additionalProperties": false,
379
+ "properties": {
380
+ "name": {
381
+ "type": "string",
382
+ "maxLength": 80
383
+ },
384
+ "trust": {
385
+ "enum": [
386
+ "curated",
387
+ "unknown"
388
+ ]
389
+ }
390
+ }
391
+ },
392
+ "price": {
393
+ "type": "object",
394
+ "required": [
395
+ "amount",
396
+ "currency"
397
+ ],
398
+ "additionalProperties": false,
399
+ "properties": {
400
+ "amount": {
401
+ "type": "number",
402
+ "minimum": 0
403
+ },
404
+ "currency": {
405
+ "type": "string",
406
+ "pattern": "^[A-Z]{3}$"
407
+ },
408
+ "kind": {
409
+ "enum": [
410
+ "total",
411
+ "nightly",
412
+ "from",
413
+ "regular",
414
+ "sale",
415
+ "member"
416
+ ]
417
+ },
418
+ "taxes_included": {
419
+ "enum": [
420
+ "yes",
421
+ "no",
422
+ "unknown"
423
+ ]
424
+ }
425
+ }
426
+ },
427
+ "refundable": {
428
+ "type": [
429
+ "boolean",
430
+ "null"
431
+ ]
432
+ },
433
+ "availability": {
434
+ "enum": [
435
+ "in_stock",
436
+ "out",
437
+ "unknown"
438
+ ]
439
+ },
440
+ "handoff": {
441
+ "type": "object",
442
+ "required": [
443
+ "url"
444
+ ],
445
+ "additionalProperties": false,
446
+ "properties": {
447
+ "url": {
448
+ "$ref": "#/$defs/https"
449
+ },
450
+ "label": {
451
+ "type": "string",
452
+ "maxLength": 40
453
+ },
454
+ "affiliate": {
455
+ "type": "boolean"
456
+ }
457
+ }
458
+ },
459
+ "label": {
460
+ "type": "string",
461
+ "maxLength": 80
462
+ },
463
+ "basis": {
464
+ "$ref": "#/$defs/basis"
465
+ },
466
+ "prov": {
467
+ "$ref": "#/$defs/prov"
468
+ },
469
+ "expires_at": {
470
+ "type": "string",
471
+ "format": "date-time"
472
+ },
473
+ "free_until": {
474
+ "type": "string",
475
+ "format": "date-time"
476
+ },
477
+ "display": {
478
+ "type": "object",
479
+ "additionalProperties": false,
480
+ "properties": {
481
+ "photos": {
482
+ "type": "boolean"
483
+ },
484
+ "reviews": {
485
+ "type": "boolean"
486
+ },
487
+ "ai_summary": {
488
+ "type": "boolean"
489
+ }
490
+ }
491
+ }
492
+ }
493
+ },
494
+ "item": {
495
+ "type": "object",
496
+ "required": [
497
+ "type",
498
+ "iid",
499
+ "kind",
500
+ "name",
501
+ "geo",
502
+ "prov"
503
+ ],
504
+ "additionalProperties": false,
505
+ "properties": {
506
+ "type": {
507
+ "const": "item"
508
+ },
509
+ "iid": {
510
+ "$ref": "#/$defs/rid"
511
+ },
512
+ "layer": {
513
+ "type": "string",
514
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,47}$"
515
+ },
516
+ "kind": {
517
+ "type": "string",
518
+ "maxLength": 40
519
+ },
520
+ "name": {
521
+ "type": "object",
522
+ "additionalProperties": false,
523
+ "properties": {
524
+ "local": {
525
+ "type": "string",
526
+ "maxLength": 120
527
+ },
528
+ "en": {
529
+ "type": "string",
530
+ "maxLength": 120
531
+ }
532
+ }
533
+ },
534
+ "geo": {
535
+ "type": "object",
536
+ "required": [
537
+ "lng",
538
+ "lat"
539
+ ],
540
+ "additionalProperties": false,
541
+ "properties": {
542
+ "lng": {
543
+ "type": "number",
544
+ "minimum": -180,
545
+ "maximum": 180
546
+ },
547
+ "lat": {
548
+ "type": "number",
549
+ "minimum": -90,
550
+ "maximum": 90
551
+ }
552
+ }
553
+ },
554
+ "keys": {
555
+ "type": "object",
556
+ "additionalProperties": {
557
+ "type": "string",
558
+ "maxLength": 120
559
+ }
560
+ },
561
+ "props": {
562
+ "type": "object",
563
+ "maxProperties": 30,
564
+ "additionalProperties": {
565
+ "type": [
566
+ "string",
567
+ "number",
568
+ "boolean",
569
+ "null"
570
+ ],
571
+ "maxLength": 140
572
+ }
573
+ },
574
+ "prov": {
575
+ "$ref": "#/$defs/prov"
576
+ }
577
+ }
578
+ }
579
+ }
580
+ });