@fleetless/contracts 14.0.0 → 15.0.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.
- package/CHANGELOG.md +163 -0
- package/artifacts/openapi.json +19842 -11398
- package/artifacts/routes.json +1160 -39
- package/artifacts/schema/addon-catalogue-entry.schema.json +3 -1
- package/artifacts/schema/admin-plan-change-request.schema.json +26 -0
- package/artifacts/schema/app-deletion-summary.schema.json +15 -1
- package/artifacts/schema/asset-plan-limit-details.schema.json +3 -1
- package/artifacts/schema/cloud-config.schema.json +5 -5
- package/artifacts/schema/collection-actor.schema.json +35 -0
- package/artifacts/schema/collection-definitions-response.schema.json +612 -0
- package/artifacts/schema/collection-event.schema.json +216 -0
- package/artifacts/schema/collection-export-query.schema.json +56 -0
- package/artifacts/schema/collection-filter.schema.json +9 -0
- package/artifacts/schema/collection-import-preview.schema.json +143 -0
- package/artifacts/schema/collection-import-request.schema.json +105 -0
- package/artifacts/schema/collection-import-result.schema.json +38 -0
- package/artifacts/schema/collection-list-response.schema.json +119 -0
- package/artifacts/schema/collection-record-get-query.schema.json +12 -0
- package/artifacts/schema/collection-record-history-query.schema.json +35 -0
- package/artifacts/schema/collection-record-history-response.schema.json +389 -0
- package/artifacts/schema/collection-record-list-query.schema.json +67 -0
- package/artifacts/schema/collection-record-list-response.schema.json +212 -0
- package/artifacts/schema/collection-record-restore-request.schema.json +14 -0
- package/artifacts/schema/collection-record-write.schema.json +31 -0
- package/artifacts/schema/collection-record.schema.json +180 -0
- package/artifacts/schema/collection-revision.schema.json +295 -0
- package/artifacts/schema/collection-subscribe-error.schema.json +31 -0
- package/artifacts/schema/collection-subscribe.schema.json +48 -0
- package/artifacts/schema/collection-subscribed.schema.json +22 -0
- package/artifacts/schema/collection-summary.schema.json +92 -0
- package/artifacts/schema/collection-unsubscribe.schema.json +22 -0
- package/artifacts/schema/collections-access-change.schema.json +34 -0
- package/artifacts/schema/collections-document.schema.json +732 -0
- package/artifacts/schema/collections-draft-response.schema.json +845 -0
- package/artifacts/schema/collections-effect.schema.json +384 -0
- package/artifacts/schema/collections-issue.schema.json +36 -0
- package/artifacts/schema/collections-publish-request.schema.json +18 -0
- package/artifacts/schema/collections-publish-response.schema.json +450 -0
- package/artifacts/schema/collections-purge-preview.schema.json +60 -0
- package/artifacts/schema/collections-purge-request.schema.json +27 -0
- package/artifacts/schema/collections-purge-response.schema.json +30 -0
- package/artifacts/schema/collections-restore-preview-query.schema.json +20 -0
- package/artifacts/schema/collections-restore-preview.schema.json +581 -0
- package/artifacts/schema/collections-restore-request.schema.json +27 -0
- package/artifacts/schema/collections-restore-response.schema.json +455 -0
- package/artifacts/schema/collections-schema-preview.schema.json +519 -0
- package/artifacts/schema/collections-schema-published.schema.json +22 -0
- package/artifacts/schema/collections-version-response.schema.json +869 -0
- package/artifacts/schema/collections-version-summary.schema.json +139 -0
- package/artifacts/schema/collections-versions-response.schema.json +167 -0
- package/artifacts/schema/config-draft-response.schema.json +5 -5
- package/artifacts/schema/config-version-response.schema.json +5 -5
- package/artifacts/schema/confirmation-required-details.schema.json +13 -0
- package/artifacts/schema/dangling-reference.schema.json +7 -6
- package/artifacts/schema/datapoint-list-response.schema.json +2 -2
- package/artifacts/schema/effective-rights-response.schema.json +87 -1
- package/artifacts/schema/org-plan.schema.json +29 -1
- package/artifacts/schema/org-quota-usage-counts.schema.json +18 -0
- package/artifacts/schema/org-quota-usage.schema.json +47 -1
- package/artifacts/schema/org-quotas.schema.json +29 -1
- package/artifacts/schema/org-role-list-response.schema.json +8 -7
- package/artifacts/schema/org-role.schema.json +1 -1
- package/artifacts/schema/plan-catalogue-entry.schema.json +29 -1
- package/artifacts/schema/plan-change-decision-status-response.schema.json +29 -1
- package/artifacts/schema/plan-limit-details.schema.json +3 -1
- package/artifacts/schema/plan-limits.schema.json +29 -1
- package/artifacts/schema/plan-overrides.schema.json +26 -0
- package/artifacts/schema/put-collections-draft-request.schema.json +16 -0
- package/artifacts/schema/record-changed-details.schema.json +16 -0
- package/artifacts/schema/record-referenced-details.schema.json +35 -0
- package/artifacts/schema/reference-invalid-details.schema.json +25 -0
- package/artifacts/schema/reference-place.schema.json +7 -6
- package/artifacts/schema/required-missing-details.schema.json +19 -0
- package/artifacts/schema/robot-config-doc.schema.json +5 -5
- package/artifacts/schema/robot-deletion-summary.schema.json +33 -1
- package/artifacts/schema/role-collection-rights.schema.json +82 -0
- package/artifacts/schema/role-rename-preview.schema.json +7 -6
- package/dist/apps.d.ts +18 -2
- package/dist/apps.js +12 -2
- package/dist/audit.d.ts +32 -2
- package/dist/audit.js +40 -2
- package/dist/collections-issues.d.ts +67 -0
- package/dist/collections-issues.js +340 -0
- package/dist/collections-records.d.ts +562 -0
- package/dist/collections-records.js +525 -0
- package/dist/collections-rights.d.ts +17 -0
- package/dist/collections-rights.js +41 -0
- package/dist/collections-schema.d.ts +1064 -0
- package/dist/collections-schema.js +386 -0
- package/dist/collections-templates.d.ts +55 -0
- package/dist/collections-templates.js +137 -0
- package/dist/collections-transfer.d.ts +101 -0
- package/dist/collections-transfer.js +206 -0
- package/dist/collections-values.d.ts +67 -0
- package/dist/collections-values.js +284 -0
- package/dist/collections.d.ts +568 -0
- package/dist/collections.js +332 -0
- package/dist/config.d.ts +8 -8
- package/dist/config.js +13 -13
- package/dist/errors.d.ts +50 -1
- package/dist/errors.js +115 -0
- package/dist/index.d.ts +24 -8
- package/dist/index.js +13 -3
- package/dist/org-roles.d.ts +4 -0
- package/dist/org-roles.js +10 -9
- package/dist/plans.d.ts +19 -1
- package/dist/plans.js +21 -1
- package/dist/realtime.d.ts +166 -0
- package/dist/realtime.js +163 -0
- package/dist/rest.d.ts +28 -28
- package/dist/rest.js +39 -27
- package/dist/rights.d.ts +2 -2
- package/dist/rights.js +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +495 -21
- package/package.json +1 -1
- package/artifacts/schema/put-robot-details-request.schema.json +0 -41
- package/artifacts/schema/put-robot-details-response.schema.json +0 -43
- package/artifacts/schema/robot-details-doc.schema.json +0 -33
package/dist/realtime.js
CHANGED
|
@@ -5,6 +5,8 @@ import { MAX_PATIENCE_MS, MIN_PATIENCE_MS } from './protocol.js';
|
|
|
5
5
|
import { slug } from './common.js';
|
|
6
6
|
import { clientIdentity } from './client-auth.js';
|
|
7
7
|
import { job } from './jobs.js';
|
|
8
|
+
import { collectionKey } from './collections.js';
|
|
9
|
+
import { collectionFilter, collectionRecord } from './collections-records.js';
|
|
8
10
|
/**
|
|
9
11
|
* Client realtime protocol: WebSocket subscriptions on datapoints, the
|
|
10
12
|
* datapoint event stream, and full command parity with REST.
|
|
@@ -490,3 +492,164 @@ export const orgEventDropped = z
|
|
|
490
492
|
dropped: z.number().int().positive(),
|
|
491
493
|
})
|
|
492
494
|
.strict();
|
|
495
|
+
// ---------------------------------------------------------------------------
|
|
496
|
+
// App collections
|
|
497
|
+
// ---------------------------------------------------------------------------
|
|
498
|
+
/**
|
|
499
|
+
* The name a client gives one of its collection subscriptions. Every event and
|
|
500
|
+
* every refusal of that subscription carries it back, so one socket can hold
|
|
501
|
+
* several subscriptions, to the same collection with different filters
|
|
502
|
+
* included, and tell their events apart.
|
|
503
|
+
*/
|
|
504
|
+
const collectionRequestId = z.string().min(1).max(64).meta({
|
|
505
|
+
description: 'Chosen by the client, unique among the collection subscriptions open on this socket: a `request_id` that is already in use is refused with `validation_error`. Every frame about the subscription carries it.',
|
|
506
|
+
});
|
|
507
|
+
/**
|
|
508
|
+
* Subscribe to the changes of one collection's records.
|
|
509
|
+
*
|
|
510
|
+
* **The cloud answers with `collection_subscribed` once the subscription is
|
|
511
|
+
* registered, and with `collection_subscribe_error` when it is refused. There
|
|
512
|
+
* is no first snapshot.** To show the records that exist, subscribe, wait for
|
|
513
|
+
* `collection_subscribed` and list then: from that frame on every change the
|
|
514
|
+
* subscription covers is delivered as an event, so none can fall between the
|
|
515
|
+
* list and the events. An event that arrives while the list is still being
|
|
516
|
+
* read may or may not be in its result; apply it to the result by `id` and
|
|
517
|
+
* `revision`. A subscription is registered afresh on every connection, so a
|
|
518
|
+
* client that reconnects and subscribes again gets a new `collection_subscribed`
|
|
519
|
+
* and lists again; changes made while it was disconnected are not replayed.
|
|
520
|
+
*
|
|
521
|
+
* The caller's rights are checked on every event, not only on subscribe: a
|
|
522
|
+
* record that the caller may no longer see, because its values changed, the
|
|
523
|
+
* role lost the right or the robot was detached, is announced once as
|
|
524
|
+
* `removed`, and one that comes into view as `entered`.
|
|
525
|
+
*
|
|
526
|
+
* **When a subscription is judged.** At the frame, with the role and status an
|
|
527
|
+
* app user has then and not as at `auth`: a user who was re-roled is answered
|
|
528
|
+
* for the new role (`collection_not_found` when it has no right on the
|
|
529
|
+
* collection, `forbidden` when it may not read it), and one who was blocked or
|
|
530
|
+
* removed is answered `forbidden` and stays unsubscribed. A frame sent before
|
|
531
|
+
* `auth` is answered with `collection_subscribe_error` and code `unauthorized`;
|
|
532
|
+
* the socket stays open. A socket holds at most 50 subscriptions.
|
|
533
|
+
*/
|
|
534
|
+
export const collectionSubscribe = z
|
|
535
|
+
.object({
|
|
536
|
+
type: z.literal('collection_subscribe'),
|
|
537
|
+
request_id: collectionRequestId,
|
|
538
|
+
app_id: z
|
|
539
|
+
.uuid()
|
|
540
|
+
.meta({
|
|
541
|
+
description: 'The app whose collection to follow. Required on the connection of a developer, whose token belongs to the organization and so to no app: without it the subscribe is refused with `validation_error`. On the connection of an app user or a server key it can be left out, because the token names the app; if it is sent, it must be that app, otherwise `validation_error`. An app that does not exist or belongs to another organization is answered `collection_not_found`.',
|
|
542
|
+
})
|
|
543
|
+
.optional(),
|
|
544
|
+
collection: collectionKey.meta({ description: 'The key of the collection.' }),
|
|
545
|
+
robot_id: z.uuid().meta({ description: 'Only the records of this robot, in a collection that belongs to robots.' }).optional(),
|
|
546
|
+
filter: collectionFilter
|
|
547
|
+
.meta({
|
|
548
|
+
description: 'Only records matching this filter are delivered, with the grammar of the `filter` of the record list but as an object, not JSON text. The whole frame is at most 16,384 bytes; a larger frame closes the socket with code 1009 (message too big) instead of being answered, so a filter with many long values may not fit.',
|
|
549
|
+
})
|
|
550
|
+
.optional(),
|
|
551
|
+
})
|
|
552
|
+
.strict()
|
|
553
|
+
.meta({
|
|
554
|
+
description: 'Subscribes to the changes of the records of one collection. The cloud answers an accepted subscription with `collection_subscribed` and a refused one with `collection_subscribe_error`.',
|
|
555
|
+
});
|
|
556
|
+
/**
|
|
557
|
+
* A collection subscription is registered. Sent once for every
|
|
558
|
+
* `collection_subscribe` that is accepted, after the cloud has judged it (the
|
|
559
|
+
* collection exists, the caller may read it, the robot and the filter fit) and
|
|
560
|
+
* registered it, and before the first `collection_event` of that
|
|
561
|
+
* subscription: a client that lists the records now misses no change, because
|
|
562
|
+
* every change from this frame on reaches it as an event.
|
|
563
|
+
*
|
|
564
|
+
* The frame is sent again for every subscribe, so a client that reconnects and
|
|
565
|
+
* subscribes again receives it again. It does not say that anything exists or
|
|
566
|
+
* changed; it carries only the `request_id`.
|
|
567
|
+
*/
|
|
568
|
+
export const collectionSubscribed = z
|
|
569
|
+
.object({
|
|
570
|
+
type: z.literal('collection_subscribed'),
|
|
571
|
+
request_id: collectionRequestId.meta({ description: 'The `request_id` of the subscription that is now registered.' }),
|
|
572
|
+
})
|
|
573
|
+
.strict()
|
|
574
|
+
.meta({ description: 'A collection subscription is registered: every change it covers is delivered from now on.' });
|
|
575
|
+
export const collectionUnsubscribe = z
|
|
576
|
+
.object({
|
|
577
|
+
type: z.literal('collection_unsubscribe'),
|
|
578
|
+
request_id: collectionRequestId.meta({ description: 'The `request_id` of the subscription to end.' }),
|
|
579
|
+
})
|
|
580
|
+
.strict()
|
|
581
|
+
.meta({ description: 'Ends a collection subscription.' });
|
|
582
|
+
/**
|
|
583
|
+
* One change to a record the subscriber can see. `record` is the whole record,
|
|
584
|
+
* up to 1 MB, in the shape the REST routes answer.
|
|
585
|
+
*
|
|
586
|
+
* **A client that cannot keep up is disconnected, not skipped.** A socket whose
|
|
587
|
+
* send buffer holds more than 8 MiB, or that has more than 2,000 collection
|
|
588
|
+
* changes waiting to be delivered (a bulk import into a big collection does
|
|
589
|
+
* that), is closed with code 1013 ("try again later"). The client reconnects,
|
|
590
|
+
* subscribes again and lists again.
|
|
591
|
+
*/
|
|
592
|
+
export const collectionEvent = z
|
|
593
|
+
.object({
|
|
594
|
+
type: z.literal('collection_event'),
|
|
595
|
+
request_id: collectionRequestId.meta({ description: 'The `request_id` of the subscription the event belongs to.' }),
|
|
596
|
+
event: z.enum(['created', 'updated', 'deleted', 'removed', 'entered']).meta({
|
|
597
|
+
description: '`created`, `updated` and `deleted`: the record was written. `removed`: the record left the view of this subscription without being deleted, because its values no longer match the filter, the role lost the right to read it or its robot was detached. `entered`: the record came into view the same way.',
|
|
598
|
+
}),
|
|
599
|
+
id: z.uuid().meta({ description: 'The id of the record.' }),
|
|
600
|
+
record: collectionRecord
|
|
601
|
+
.meta({
|
|
602
|
+
description: 'The record: as it is now for `created`, `updated`, `entered` and `removed`, and as it was for `deleted`. Absent only on a `removed` event for a record the subscriber may no longer read, so that its values are not told: that is the case when the robot of the record was detached, or when the role lost the right to read the collection.',
|
|
603
|
+
})
|
|
604
|
+
.optional(),
|
|
605
|
+
})
|
|
606
|
+
.strict()
|
|
607
|
+
.meta({ description: 'A record came into view, changed or went away.' });
|
|
608
|
+
/**
|
|
609
|
+
* Refusal of a collection subscription, or the end of one. The codes are those
|
|
610
|
+
* of REST: `collection_not_found`, `forbidden`, `robot_not_attached` and
|
|
611
|
+
* `validation_error` when the subscribe is refused; `collection_removed`,
|
|
612
|
+
* `forbidden`, `robot_not_attached`, `validation_error` and `internal_error`
|
|
613
|
+
* when a running subscription ends:
|
|
614
|
+
*
|
|
615
|
+
* - `collection_removed`: a publish or restore removed its collection;
|
|
616
|
+
* - `forbidden`: the user was re-roled, blocked or removed, or the role lost the
|
|
617
|
+
* right to read the collection;
|
|
618
|
+
* - `robot_not_attached`: the robot the subscription follows was detached, or a
|
|
619
|
+
* robot with more than 5,000 records was detached (when a robot is attached
|
|
620
|
+
* or detached, at most 5,000 of its records are announced to a subscription,
|
|
621
|
+
* as `entered` or `removed`);
|
|
622
|
+
* - `validation_error`: its `filter` no longer fits the collection after a
|
|
623
|
+
* publish;
|
|
624
|
+
* - `internal_error`: it could not be judged again (the database or the rights
|
|
625
|
+
* check failed), or a robot coming or going could not be announced. The cloud
|
|
626
|
+
* ends the subscription rather than go on telling a caller what it may no
|
|
627
|
+
* longer see; subscribing again is the way back.
|
|
628
|
+
*
|
|
629
|
+
* `request_id` echoes what the client sent and is a plain string for the reason
|
|
630
|
+
* `subscribeError`'s ids are: the refusal must be constructible when the id
|
|
631
|
+
* itself was what was wrong.
|
|
632
|
+
*/
|
|
633
|
+
export const collectionSubscribeError = z
|
|
634
|
+
.object({
|
|
635
|
+
type: z.literal('collection_subscribe_error'),
|
|
636
|
+
request_id: z.string().meta({ description: 'The `request_id` of the subscription, as the client sent it.' }),
|
|
637
|
+
code: z.string().min(1).meta({ description: 'A stable error code, as in REST; `unauthorized` is also possible here, for a subscribe sent before `auth`.' }),
|
|
638
|
+
message: z.string().min(1),
|
|
639
|
+
})
|
|
640
|
+
.strict()
|
|
641
|
+
.meta({ description: 'A collection subscription was refused or has ended.' });
|
|
642
|
+
/**
|
|
643
|
+
* Sent to every socket that holds a collection subscription in the app after a
|
|
644
|
+
* schema version was published or restored. Rights and collections may have
|
|
645
|
+
* changed, so a client that cached definitions reads them again. Subscriptions
|
|
646
|
+
* whose collection or right is gone end with their own
|
|
647
|
+
* `collection_subscribe_error`.
|
|
648
|
+
*/
|
|
649
|
+
export const collectionsSchemaPublished = z
|
|
650
|
+
.object({
|
|
651
|
+
type: z.literal('collections_schema_published'),
|
|
652
|
+
version: z.number().int().min(1).meta({ description: 'The version that is in force now.' }),
|
|
653
|
+
})
|
|
654
|
+
.strict()
|
|
655
|
+
.meta({ description: 'A new schema version is in force for the app.' });
|
package/dist/rest.d.ts
CHANGED
|
@@ -77,19 +77,19 @@ export type JointStatePutResponse = z.infer<typeof jointStatePutResponse>;
|
|
|
77
77
|
* same call for the same reason: fold cameras in and the sentence "this deletes
|
|
78
78
|
* N slugs and M cameras" counts them twice. A list row has the same problem.
|
|
79
79
|
*
|
|
80
|
-
* **Counted from the published configuration, and excluding the built-
|
|
80
|
+
* **Counted from the published configuration, and excluding the built-in datapoint.**
|
|
81
81
|
* `GET /api/robots/:id/exposures` answers *which* slugs and prepends the
|
|
82
|
-
* built-in
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* The number was "three" while `bridge_pressure` existed and
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
82
|
+
* built-in datapoint, `bridge_state`, as `builtin: true`; this answers *how
|
|
83
|
+
* many* and counts only what somebody configured. So a robot with an empty
|
|
84
|
+
* published config reports `datapoints: 0` here and one entry there. That is
|
|
85
|
+
* intentional, and it is written on both sides so the disagreement is never
|
|
86
|
+
* mistaken for a bug.
|
|
87
|
+
*
|
|
88
|
+
* The number was "three" while `bridge_pressure` existed and has only gone
|
|
89
|
+
* down since; the cloud builds that prefix from its own built-in set rather
|
|
90
|
+
* than a literal, so the next built-in moves this count again. Read the count
|
|
91
|
+
* off that set, not off this sentence, before filing the bug this comment
|
|
92
|
+
* exists to prevent.
|
|
93
93
|
*/
|
|
94
94
|
export declare const exposureCounts: z.ZodObject<{
|
|
95
95
|
datapoints: z.ZodNumber;
|
|
@@ -870,7 +870,7 @@ export declare const fetchTypesResponse: z.ZodObject<{
|
|
|
870
870
|
}, z.core.$strip>;
|
|
871
871
|
export type FetchTypesResponse = z.infer<typeof fetchTypesResponse>;
|
|
872
872
|
/**
|
|
873
|
-
* What a client can read on this robot: the built-
|
|
873
|
+
* What a client can read on this robot: the built-in plus everything the
|
|
874
874
|
* published configuration exposes. This is the seed of the generated
|
|
875
875
|
* per-robot API.
|
|
876
876
|
*
|
|
@@ -894,21 +894,6 @@ export declare const datapointListResponse: z.ZodObject<{
|
|
|
894
894
|
}, z.core.$strip>>;
|
|
895
895
|
}, z.core.$strip>;
|
|
896
896
|
export type DatapointListResponse = z.infer<typeof datapointListResponse>;
|
|
897
|
-
/**
|
|
898
|
-
* The built-in `robot_details` datapoint: static properties the developer
|
|
899
|
-
* maintains. Bounded so one robot cannot become a document store.
|
|
900
|
-
*/
|
|
901
|
-
export declare const robotDetailsDoc: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
902
|
-
export type RobotDetailsDoc = z.infer<typeof robotDetailsDoc>;
|
|
903
|
-
/** What `PUT /api/robots/:id/details` answers: the stored document, which is the one that was sent. */
|
|
904
|
-
export declare const putRobotDetailsResponse: z.ZodObject<{
|
|
905
|
-
details: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
906
|
-
}, z.core.$strip>;
|
|
907
|
-
export type PutRobotDetailsResponse = z.infer<typeof putRobotDetailsResponse>;
|
|
908
|
-
export declare const putRobotDetailsRequest: z.ZodObject<{
|
|
909
|
-
details: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
910
|
-
}, z.core.$strip>;
|
|
911
|
-
export type PutRobotDetailsRequest = z.infer<typeof putRobotDetailsRequest>;
|
|
912
897
|
/**
|
|
913
898
|
* Invoke an action or call a service; parameters by field path.
|
|
914
899
|
*
|
|
@@ -1639,6 +1624,11 @@ export declare const robotDeletionSummary: z.ZodObject<{
|
|
|
1639
1624
|
job_run_count: z.ZodNumber;
|
|
1640
1625
|
had_live_session: z.ZodBoolean;
|
|
1641
1626
|
had_unpublished_draft: z.ZodBoolean;
|
|
1627
|
+
collection_records: z.ZodArray<z.ZodObject<{
|
|
1628
|
+
app_id: z.ZodUUID;
|
|
1629
|
+
app_name: z.ZodString;
|
|
1630
|
+
records: z.ZodNumber;
|
|
1631
|
+
}, z.core.$strip>>;
|
|
1642
1632
|
}, z.core.$strip>;
|
|
1643
1633
|
export type RobotDeletionSummary = z.infer<typeof robotDeletionSummary>;
|
|
1644
1634
|
/**
|
|
@@ -1775,6 +1765,8 @@ export declare const orgQuotas: z.ZodObject<{
|
|
|
1775
1765
|
max_retention_bytes: z.ZodNumber;
|
|
1776
1766
|
max_retention_writes_per_minute: z.ZodNumber;
|
|
1777
1767
|
max_realtime_connections: z.ZodNumber;
|
|
1768
|
+
collection_records: z.ZodNullable<z.ZodNumber>;
|
|
1769
|
+
collection_bytes: z.ZodNullable<z.ZodNumber>;
|
|
1778
1770
|
}, z.core.$strip>;
|
|
1779
1771
|
export type OrgQuotas = z.infer<typeof orgQuotas>;
|
|
1780
1772
|
/**
|
|
@@ -1799,6 +1791,9 @@ export declare const orgQuotaUsageCounts: z.ZodObject<{
|
|
|
1799
1791
|
max_retention_bytes: z.ZodOptional<z.ZodNumber>;
|
|
1800
1792
|
max_retention_writes_per_minute: z.ZodOptional<z.ZodNumber>;
|
|
1801
1793
|
max_realtime_connections: z.ZodOptional<z.ZodNumber>;
|
|
1794
|
+
collection_records: z.ZodOptional<z.ZodNumber>;
|
|
1795
|
+
collection_bytes: z.ZodOptional<z.ZodNumber>;
|
|
1796
|
+
collection_history_bytes: z.ZodOptional<z.ZodNumber>;
|
|
1802
1797
|
}, z.core.$strip>;
|
|
1803
1798
|
export type OrgQuotaUsageCounts = z.infer<typeof orgQuotaUsageCounts>;
|
|
1804
1799
|
/** Limits beside what is actually used — a limit alone tells nobody where they stand. */
|
|
@@ -1810,6 +1805,8 @@ export declare const orgQuotaUsage: z.ZodObject<{
|
|
|
1810
1805
|
max_retention_bytes: z.ZodNumber;
|
|
1811
1806
|
max_retention_writes_per_minute: z.ZodNumber;
|
|
1812
1807
|
max_realtime_connections: z.ZodNumber;
|
|
1808
|
+
collection_records: z.ZodNullable<z.ZodNumber>;
|
|
1809
|
+
collection_bytes: z.ZodNullable<z.ZodNumber>;
|
|
1813
1810
|
}, z.core.$strip>;
|
|
1814
1811
|
usage: z.ZodObject<{
|
|
1815
1812
|
max_robots: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1818,6 +1815,9 @@ export declare const orgQuotaUsage: z.ZodObject<{
|
|
|
1818
1815
|
max_retention_bytes: z.ZodOptional<z.ZodNumber>;
|
|
1819
1816
|
max_retention_writes_per_minute: z.ZodOptional<z.ZodNumber>;
|
|
1820
1817
|
max_realtime_connections: z.ZodOptional<z.ZodNumber>;
|
|
1818
|
+
collection_records: z.ZodOptional<z.ZodNumber>;
|
|
1819
|
+
collection_bytes: z.ZodOptional<z.ZodNumber>;
|
|
1820
|
+
collection_history_bytes: z.ZodOptional<z.ZodNumber>;
|
|
1821
1821
|
}, z.core.$strip>;
|
|
1822
1822
|
}, z.core.$strip>;
|
|
1823
1823
|
export type OrgQuotaUsage = z.infer<typeof orgQuotaUsage>;
|
package/dist/rest.js
CHANGED
|
@@ -81,19 +81,19 @@ export const jointStatePutResponse = z.object({
|
|
|
81
81
|
* same call for the same reason: fold cameras in and the sentence "this deletes
|
|
82
82
|
* N slugs and M cameras" counts them twice. A list row has the same problem.
|
|
83
83
|
*
|
|
84
|
-
* **Counted from the published configuration, and excluding the built-
|
|
84
|
+
* **Counted from the published configuration, and excluding the built-in datapoint.**
|
|
85
85
|
* `GET /api/robots/:id/exposures` answers *which* slugs and prepends the
|
|
86
|
-
* built-in
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* The number was "three" while `bridge_pressure` existed and
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
86
|
+
* built-in datapoint, `bridge_state`, as `builtin: true`; this answers *how
|
|
87
|
+
* many* and counts only what somebody configured. So a robot with an empty
|
|
88
|
+
* published config reports `datapoints: 0` here and one entry there. That is
|
|
89
|
+
* intentional, and it is written on both sides so the disagreement is never
|
|
90
|
+
* mistaken for a bug.
|
|
91
|
+
*
|
|
92
|
+
* The number was "three" while `bridge_pressure` existed and has only gone
|
|
93
|
+
* down since; the cloud builds that prefix from its own built-in set rather
|
|
94
|
+
* than a literal, so the next built-in moves this count again. Read the count
|
|
95
|
+
* off that set, not off this sentence, before filing the bug this comment
|
|
96
|
+
* exists to prevent.
|
|
97
97
|
*/
|
|
98
98
|
export const exposureCounts = z.object({
|
|
99
99
|
datapoints: z.number().int().nonnegative(),
|
|
@@ -307,7 +307,7 @@ export const fetchTypesResponse = z.object({
|
|
|
307
307
|
unresolved: z.array(z.string()),
|
|
308
308
|
});
|
|
309
309
|
/**
|
|
310
|
-
* What a client can read on this robot: the built-
|
|
310
|
+
* What a client can read on this robot: the built-in plus everything the
|
|
311
311
|
* published configuration exposes. This is the seed of the generated
|
|
312
312
|
* per-robot API.
|
|
313
313
|
*
|
|
@@ -318,7 +318,7 @@ export const fetchTypesResponse = z.object({
|
|
|
318
318
|
export const datapointDescriptor = z.object({
|
|
319
319
|
slug: slug.meta({ description: 'The name a client reads this datapoint by.' }),
|
|
320
320
|
builtin: z.boolean().meta({
|
|
321
|
-
description: '`true` for the
|
|
321
|
+
description: '`true` for the datapoint every robot has, `bridge_state`, and `false` for everything the published configuration adds.',
|
|
322
322
|
}),
|
|
323
323
|
unit: z.string().nullable().meta({
|
|
324
324
|
description: 'The unit the value carries **after** any scale and offset, shown beside the number so nobody has to guess whether `15` means percent, volts or minutes. `null` when the configuration names none.',
|
|
@@ -336,21 +336,9 @@ export const datapointDescriptor = z.object({
|
|
|
336
336
|
});
|
|
337
337
|
export const datapointListResponse = z.object({
|
|
338
338
|
datapoints: z.array(datapointDescriptor).meta({
|
|
339
|
-
description: 'Everything a client may read on this robot: the
|
|
340
|
-
}),
|
|
341
|
-
});
|
|
342
|
-
/**
|
|
343
|
-
* The built-in `robot_details` datapoint: static properties the developer
|
|
344
|
-
* maintains. Bounded so one robot cannot become a document store.
|
|
345
|
-
*/
|
|
346
|
-
export const robotDetailsDoc = z.record(z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/), z.union([z.string().max(4096), z.number(), z.boolean(), z.array(z.unknown()), z.record(z.string(), z.unknown())]));
|
|
347
|
-
/** What `PUT /api/robots/:id/details` answers: the stored document, which is the one that was sent. */
|
|
348
|
-
export const putRobotDetailsResponse = z.object({
|
|
349
|
-
details: robotDetailsDoc.meta({
|
|
350
|
-
description: 'The stored `robot_details` document, which is the one that was just sent — this route **replaces** the document rather than merging into it. Keys are the developer\'s own, lowercase and at most 64 characters; a value is a string of at most 4096 characters, a number, a boolean, an array or an object.',
|
|
339
|
+
description: 'Everything a client may read on this robot: the built-in `bridge_state`, plus every datapoint the published configuration exposes and the caller\'s role may read.',
|
|
351
340
|
}),
|
|
352
341
|
});
|
|
353
|
-
export const putRobotDetailsRequest = z.object({ details: robotDetailsDoc });
|
|
354
342
|
/* ------------------------------------------------------------------------
|
|
355
343
|
* The command surface, and what a role may be required to use.
|
|
356
344
|
*
|
|
@@ -1386,6 +1374,15 @@ export const robotDeletionSummary = z.object({
|
|
|
1386
1374
|
* was there at all.
|
|
1387
1375
|
*/
|
|
1388
1376
|
had_unpublished_draft: z.boolean(),
|
|
1377
|
+
collection_records: z
|
|
1378
|
+
.array(z.object({
|
|
1379
|
+
app_id: z.uuid().meta({ description: 'The app whose collections hold records of the robot.' }),
|
|
1380
|
+
app_name: z.string().meta({ description: 'The app\'s name.' }),
|
|
1381
|
+
records: z.number().int().nonnegative().meta({ description: 'How many records of the robot the app\'s collections hold, deleted with the robot.' }),
|
|
1382
|
+
}))
|
|
1383
|
+
.meta({
|
|
1384
|
+
description: 'App collection records that go with the robot, per app. A robot\'s records are kept in every app it was attached to, also in one it was detached from, and are deleted with their history when the robot is; apps without records of this robot are left out.',
|
|
1385
|
+
}),
|
|
1389
1386
|
});
|
|
1390
1387
|
/**
|
|
1391
1388
|
* The query of `DELETE /api/robots/:id`.
|
|
@@ -1555,6 +1552,12 @@ export const orgQuotas = z.object({
|
|
|
1555
1552
|
max_retention_bytes: z.number().int().nonnegative(),
|
|
1556
1553
|
max_retention_writes_per_minute: z.number().int().nonnegative(),
|
|
1557
1554
|
max_realtime_connections: z.number().int().positive(),
|
|
1555
|
+
collection_records: z.number().int().positive().nullable().meta({
|
|
1556
|
+
description: 'The most records the app collections of all the org\'s apps may hold together: the plan limit `collection_records`, or the operator\'s override of it. `null` is by contract (Enterprise).',
|
|
1557
|
+
}),
|
|
1558
|
+
collection_bytes: z.number().int().positive().nullable().meta({
|
|
1559
|
+
description: 'The most bytes the current records of the org\'s app collections may occupy together: the plan limit `collection_bytes`, or the operator\'s override of it. `null` is by contract (Enterprise).',
|
|
1560
|
+
}),
|
|
1558
1561
|
});
|
|
1559
1562
|
/**
|
|
1560
1563
|
* What an org is **actually using**, per quota.
|
|
@@ -1578,6 +1581,15 @@ export const orgQuotaUsageCounts = z.object({
|
|
|
1578
1581
|
max_retention_bytes: z.number().int().nonnegative(),
|
|
1579
1582
|
max_retention_writes_per_minute: z.number().int().nonnegative(),
|
|
1580
1583
|
max_realtime_connections: z.number().int().nonnegative(),
|
|
1584
|
+
collection_records: z.number().int().nonnegative().meta({
|
|
1585
|
+
description: 'Current records in the app collections of all the org\'s apps. Deleted records do not count.',
|
|
1586
|
+
}),
|
|
1587
|
+
collection_bytes: z.number().int().nonnegative().meta({
|
|
1588
|
+
description: 'Bytes the current records of the org\'s app collections occupy, as stored JSON.',
|
|
1589
|
+
}),
|
|
1590
|
+
collection_history_bytes: z.number().int().nonnegative().meta({
|
|
1591
|
+
description: 'Bytes the history of the org\'s app collections occupies: revisions of current and deleted records. Information only; no limit applies to it.',
|
|
1592
|
+
}),
|
|
1581
1593
|
}).partial();
|
|
1582
1594
|
/** Limits beside what is actually used — a limit alone tells nobody where they stand. */
|
|
1583
1595
|
export const orgQuotaUsage = z.object({ quotas: orgQuotas, usage: orgQuotaUsageCounts });
|
package/dist/rights.d.ts
CHANGED
|
@@ -123,7 +123,7 @@ export declare function findCycle(graph: RoleGraph, key: string, inherits: reado
|
|
|
123
123
|
* relative, with an empty segment or with a trailing slash fits nothing.
|
|
124
124
|
*/
|
|
125
125
|
export declare function matchRosGlob(pattern: string, rosName: string): boolean;
|
|
126
|
-
/** One exposed entry of a document, as the rights resolver sees it.
|
|
126
|
+
/** One exposed entry of a document, as the rights resolver sees it. The built-in datapoint, `bridge_state`, is not listed. */
|
|
127
127
|
export interface ExposureRef {
|
|
128
128
|
slug: string;
|
|
129
129
|
section: ExposureSection;
|
|
@@ -192,6 +192,6 @@ export declare function collectRoleRefs(doc: RobotConfigDoc | null): RoleRefUse[
|
|
|
192
192
|
* - `rule_matches_nothing`: an `access.rules` rule that fits no exposed entry
|
|
193
193
|
* of this document, so it changes nothing. A rule's `kinds` are honoured,
|
|
194
194
|
* and an entry without a ROS name — a camera that is not a ROS topic — is
|
|
195
|
-
* never matched. The built-in
|
|
195
|
+
* never matched. The built-in datapoint, `bridge_state`, is not an entry.
|
|
196
196
|
*/
|
|
197
197
|
export declare function roleIssues(doc: RobotConfigDoc | null, graph: RoleGraph): ValidationIssue[];
|
package/dist/rights.js
CHANGED
|
@@ -362,7 +362,7 @@ const subjectOf = (path) => {
|
|
|
362
362
|
* - `rule_matches_nothing`: an `access.rules` rule that fits no exposed entry
|
|
363
363
|
* of this document, so it changes nothing. A rule's `kinds` are honoured,
|
|
364
364
|
* and an entry without a ROS name — a camera that is not a ROS topic — is
|
|
365
|
-
* never matched. The built-in
|
|
365
|
+
* never matched. The built-in datapoint, `bridge_state`, is not an entry.
|
|
366
366
|
*/
|
|
367
367
|
export function roleIssues(doc, graph) {
|
|
368
368
|
if (doc === null)
|
package/dist/routes.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type RouteAudience = 'developer' | 'client' | 'internal';
|
|
|
36
36
|
*/
|
|
37
37
|
export type RouteAuth = 'developer' | 'developer_or_client' | 'none' | 'robot_upload' | 'in_handler' | 'ops';
|
|
38
38
|
export type RouteTransport = 'http' | 'websocket';
|
|
39
|
-
export type RouteSection = 'health' | 'developer-auth' | 'client-auth' | 'org' | 'billing' | 'users' | 'apps' | 'robots' | 'config' | 'alerts' | 'commands' | 'cameras' | 'assets' | 'mcp' | 'transports';
|
|
39
|
+
export type RouteSection = 'health' | 'developer-auth' | 'client-auth' | 'org' | 'billing' | 'users' | 'apps' | 'collections' | 'robots' | 'config' | 'alerts' | 'commands' | 'cameras' | 'assets' | 'mcp' | 'transports';
|
|
40
40
|
export interface RouteParam {
|
|
41
41
|
readonly name: string;
|
|
42
42
|
/** One sentence: what the segment identifies and where a caller gets it. */
|