@lifesi/genesis 0.1.1 → 0.1.3

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 (44) hide show
  1. package/dist/beacons.d.ts +46 -0
  2. package/dist/beacons.js +20 -0
  3. package/dist/client.d.ts +7669 -1635
  4. package/dist/client.js +54 -5
  5. package/dist/dials.d.ts +171 -1
  6. package/dist/dials.js +40 -0
  7. package/dist/fleets.d.ts +109 -1
  8. package/dist/fleets.js +89 -1
  9. package/dist/flocks.d.ts +73 -0
  10. package/dist/flocks.js +22 -0
  11. package/dist/generated/operations.d.ts +7669 -1635
  12. package/dist/generated/operations.js +9193 -1691
  13. package/dist/generated/schema.d.ts +16979 -5698
  14. package/dist/genesis.d.ts +795 -13
  15. package/dist/genesis.js +21 -0
  16. package/dist/genesis.openapi.json +23483 -7599
  17. package/dist/henry.d.ts +7 -0
  18. package/dist/henry.js +23 -0
  19. package/dist/hives-cells.d.ts +127 -0
  20. package/dist/hives-cells.js +151 -0
  21. package/dist/hives-environment.d.ts +28 -0
  22. package/dist/hives-environment.js +58 -0
  23. package/dist/hives-functions.d.ts +1 -1
  24. package/dist/hives-functions.js +3 -1
  25. package/dist/hives-marketplace.d.ts +128 -0
  26. package/dist/hives-marketplace.js +187 -0
  27. package/dist/hives-node.js +2 -0
  28. package/dist/hives-operations.d.ts +304 -0
  29. package/dist/hives-operations.js +39 -0
  30. package/dist/hives-queues.d.ts +121 -0
  31. package/dist/hives-queues.js +106 -0
  32. package/dist/hives-resources-transport.d.ts +18 -0
  33. package/dist/hives-resources-transport.js +165 -0
  34. package/dist/hives-runtimes.d.ts +34 -0
  35. package/dist/hives-runtimes.js +32 -0
  36. package/dist/hives-volumes.d.ts +64 -0
  37. package/dist/hives-volumes.js +117 -0
  38. package/dist/index.d.ts +8 -1
  39. package/dist/index.js +3 -0
  40. package/dist/runner-grant.d.ts +10 -0
  41. package/dist/runner-grant.js +133 -0
  42. package/dist/runner.d.ts +16 -0
  43. package/dist/runner.js +4 -0
  44. package/package.json +6 -1
package/dist/beacons.d.ts CHANGED
@@ -2,7 +2,53 @@ import type { GenesisClient } from './client.js';
2
2
  import type { OperationInput, OperationOutput } from './types.js';
3
3
  /** Beacons uses the authenticated Genesis organization; never supply an org header. */
4
4
  export declare function beaconsModule(client: GenesisClient): {
5
+ fleets: {
6
+ /** Reuse the same request ID and body after an interrupted response. Creates metadata only. */
7
+ provision: (requestId: string, body?: {
8
+ name?: string;
9
+ }) => Promise<{
10
+ data: {
11
+ fleet_id: string;
12
+ organization_id: string;
13
+ workspace_id: string;
14
+ project_id: string;
15
+ environment_id: string;
16
+ metadata_only: true;
17
+ };
18
+ }>;
19
+ };
5
20
  devices: {
21
+ revocations: (id: string) => Promise<{
22
+ data: import("./index.js").components["schemas"]["Beacons.DeviceRevocation"][];
23
+ }>;
24
+ acknowledge: (id: string, version: number, body: OperationInput<"beacons_acknowledgeBridgeDeviceRevocation">["body"]) => Promise<{
25
+ data: import("./index.js").components["schemas"]["Beacons.DeviceRevocation"];
26
+ }>;
27
+ challenge: (body: OperationInput<"beacons_issueBridgeDeviceChallenge">["body"]) => Promise<{
28
+ version: 1;
29
+ id: string;
30
+ nonce: string;
31
+ issuer: string;
32
+ organization: string;
33
+ principal: string;
34
+ workspace: string;
35
+ project: string;
36
+ environment: string;
37
+ binding_revision: string;
38
+ transport: string;
39
+ fleet_id: string;
40
+ proof_key: string;
41
+ tunnel_key: string;
42
+ issued_at: number;
43
+ expires_at: number;
44
+ }>;
45
+ enroll: (body: OperationInput<"beacons_enrollBridgeDevice">["body"]) => Promise<{
46
+ device_id: string;
47
+ fleet_id: string;
48
+ mesh: {
49
+ [key: string]: unknown;
50
+ };
51
+ }>;
6
52
  list: () => Promise<{
7
53
  data?: import("./index.js").components["schemas"]["Beacons.BridgeDevice"][];
8
54
  }>;
package/dist/beacons.js CHANGED
@@ -1,7 +1,27 @@
1
+ import { GenesisError } from './errors.js';
2
+ function provisioningInput(requestId, body) {
3
+ if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(requestId)
4
+ || requestId === '00000000-0000-0000-0000-000000000000'
5
+ || !body || typeof body !== 'object' || Array.isArray(body)
6
+ || Object.keys(body).some(key => key !== 'name')
7
+ || (body.name !== undefined && (typeof body.name !== 'string' || !body.name.trim()
8
+ || new TextEncoder().encode(body.name).length > 256 || /[\u0000-\u001f\u007f-\u009f]/.test(body.name)))) {
9
+ throw new GenesisError({ status: 0, type: 'invalid_request', operationId: 'beacons_provisionBridgeFleet', message: 'Provide a nonzero UUID request ID and an optional fleet name of up to 256 UTF-8 bytes.' });
10
+ }
11
+ return body.name === undefined ? {} : { name: body.name };
12
+ }
1
13
  /** Beacons uses the authenticated Genesis organization; never supply an org header. */
2
14
  export function beaconsModule(client) {
3
15
  return {
16
+ fleets: {
17
+ /** Reuse the same request ID and body after an interrupted response. Creates metadata only. */
18
+ provision: (requestId, body = {}) => client.request('beacons_provisionBridgeFleet', { body: provisioningInput(requestId, body) }, { headers: { 'idempotency-key': requestId } }),
19
+ },
4
20
  devices: {
21
+ revocations: (id) => client.request('beacons_listBridgeDeviceRevocations', { id }),
22
+ acknowledge: (id, version, body) => client.request('beacons_acknowledgeBridgeDeviceRevocation', { id, version, body }),
23
+ challenge: (body) => client.request('beacons_issueBridgeDeviceChallenge', { body }),
24
+ enroll: (body) => client.request('beacons_enrollBridgeDevice', { body }),
5
25
  list: () => client.request('beacons_listBridgeDevices'),
6
26
  update: (id, body) => client.request('beacons_updateBridgeDevice', { id, body }),
7
27
  revoke: (id) => client.request('beacons_revokeBridgeDevice', { id }),