@lynkoria/contracts 0.1.0 → 0.2.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/README.md CHANGED
@@ -1,6 +1,43 @@
1
1
  # @lynkoria/contracts
2
2
 
3
- Shared Lynkoria contract: Zod schemas for REST bodies and responses, Socket.IO event maps
3
+ [![npm](https://img.shields.io/npm/v/@lynkoria/contracts)](https://www.npmjs.com/package/@lynkoria/contracts)
4
+ [![license](https://img.shields.io/npm/l/@lynkoria/contracts)](./LICENSE)
5
+
6
+ The shared Lynkoria contract: Zod schemas for REST requests and responses, the Socket.IO event maps
4
7
  (`ServerToClientEvents`, `ClientToServerEvents`), outbound webhook types, error codes and the typed
5
- `LynkoriaError`. Used by the API and every SDK; consumers usually import it through
6
- `@lynkoria/server` or `@lynkoria/client`.
8
+ `LynkoriaError`. The API and every JavaScript SDK use it, so types match end to end.
9
+
10
+ **[Documentation](https://lynkoria.com/docs/)** · [HTTP API](https://lynkoria.com/docs/http-api/) ·
11
+ [Events](https://lynkoria.com/docs/events/) · [Errors](https://lynkoria.com/docs/errors/) ·
12
+ [Webhooks](https://lynkoria.com/docs/webhooks/)
13
+
14
+ ## Install
15
+
16
+ Most apps do not install this directly: [`@lynkoria/server`](https://www.npmjs.com/package/@lynkoria/server)
17
+ and [`@lynkoria/client`](https://www.npmjs.com/package/@lynkoria/client) depend on it and re-export what you
18
+ need (`LynkoriaError`, `ErrorCode`). Install it when you want the schemas or event types yourself, for
19
+ example to validate webhook payloads or type your own Socket.IO wrapper:
20
+
21
+ ```bash
22
+ npm install @lynkoria/contracts
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ```ts
28
+ import { ErrorCode, LynkoriaError } from '@lynkoria/contracts';
29
+
30
+ try {
31
+ await doSomething();
32
+ } catch (err) {
33
+ if (err instanceof LynkoriaError && err.code === ErrorCode.RateLimited) retryLater(err.requestId);
34
+ else throw err;
35
+ }
36
+ ```
37
+
38
+ The error codes, event names and payloads are listed in the [errors](https://lynkoria.com/docs/errors/)
39
+ and [events](https://lynkoria.com/docs/events/) references.
40
+
41
+ ## License
42
+
43
+ [Apache-2.0](./LICENSE)
package/dist/catalog.js CHANGED
@@ -304,7 +304,7 @@ const METRICS = [
304
304
  kind: "live",
305
305
  delay: "—",
306
306
  status: "unavailable",
307
- prerequisite: "A monitoring backend scraping the API metrics port (PD-5), and a platform operator role to see it (PD-1)."
307
+ prerequisite: "A monitoring backend scraping the API metrics port, and a platform operator role to see it."
308
308
  },
309
309
  {
310
310
  key: "onlineUsers",
@@ -332,7 +332,7 @@ const METRICS = [
332
332
  kind: "live",
333
333
  delay: "—",
334
334
  status: "unavailable",
335
- prerequisite: "A monitoring backend (PD-5); the gauge has no project label by design."
335
+ prerequisite: "A monitoring backend; the gauge has no project label by design."
336
336
  },
337
337
  {
338
338
  key: "infrastructure",
@@ -346,7 +346,7 @@ const METRICS = [
346
346
  kind: "live",
347
347
  delay: "—",
348
348
  status: "unavailable",
349
- prerequisite: "A monitoring backend (PD-5) and a platform operator role (PD-1)."
349
+ prerequisite: "A monitoring backend and a platform operator role."
350
350
  },
351
351
  {
352
352
  key: "bandwidth",
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ErrorBody, ErrorCode, LynkoriaError } from "./errors.js";
2
2
  import { Ack, CallSignalEvent, ClientToServerEvents, ConversationReadEvent, ConversationUpdatedEvent, PushPayloadKeys, ServerToClientEvents, SocketEvents, TypingEvent, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TOLERANCE_SECONDS, WebhookEvent, WebhookEventType } from "./events.js";
3
- import { AdminCall, AdminCallDetail, AdminCallPage, AdminCallQuery, AdminMe, AdminParticipant, Attachment, AttachmentScanStatus, AttachmentStatus, AuditEvent, AuditPage, AuditQuery, Call, CallSignalRequest, CallSignalType, CallStatus, CallType, ConnectivityStatus, ConsoleRole, ConsoleSession, Conversation, ConversationEvent, ConversationEventPage, ConversationEventType, ConversationList, ConversationType, CreateCallRequest, CreateConversationRequest, CreateEnvironmentRequest, CreateKeyRequest, CreateProjectRequest, CreatedServiceKey, DownloadUrlResponse, EditMessageRequest, Environment, EnvironmentLive, EnvironmentName, GrantRoleRequest, JoinTokenRequest, JoinTokenResponse, ManualStatus, MembersRequest, Message, MessagingTokenRequest, MessagingTokenResponse, NotificationPreferences, OpsOverview, OrganizationLive, ParticipantRole, PatchEnvironmentRequest, PatchProjectRequest, Presence, PresenceStatus, ProductId, ProductMessagingPolicy, Project, ProjectFeatures, ProjectLimits, ProjectLive, PushDeliveryView, PushDevice, PushPlatform, PushProvider, Reaction, ReactionRequest, ReadRequest, Recording, RecordingDownload, RecordingFile, RecordingKind, RecordingList, RecordingOutput, RecordingStatus, RegisterDeviceRequest, RoleGrant, ScanSummary, SendMessageRequest, SendMessageResponse, SendNotificationRequest, SendNotificationResponse, ServiceKey, ServiceScope, StartRecordingRequest, TenantId, UpdatePermissionsRequest, UploadIntentRequest, UploadIntentResponse, UsageCounts, UsageQuery, UsageRow, UsageSeries, UsageSeriesQuery, Uuid, WebhookDelivery, WebhookEventPage, WebhookSecret } from "./schemas.js";
3
+ import { AdminCall, AdminCallDetail, AdminCallPage, AdminCallQuery, AdminMe, AdminParticipant, Attachment, AttachmentScanStatus, AttachmentStatus, AuditEvent, AuditPage, AuditQuery, Call, CallSignalRequest, CallSignalType, CallStatus, CallType, ConnectivityStatus, ConsoleRole, ConsoleSession, Conversation, ConversationEvent, ConversationEventPage, ConversationEventType, ConversationList, ConversationType, CreateCallRequest, CreateConversationRequest, CreateEnvironmentRequest, CreateKeyRequest, CreateProjectRequest, CreatedServiceKey, DeploymentOptions, DownloadUrlResponse, EditMessageRequest, Environment, EnvironmentLive, EnvironmentName, GrantRoleRequest, JoinTokenRequest, JoinTokenResponse, ManualStatus, MembersRequest, Message, MessagingTokenRequest, MessagingTokenResponse, NotificationPreferences, OpsOverview, OrganizationLive, ParticipantRole, PatchEnvironmentRequest, PatchProjectRequest, Presence, PresenceStatus, ProductId, ProductMessagingPolicy, Project, ProjectFeatures, ProjectLimits, ProjectLive, PublishSource, PushDeliveryView, PushDevice, PushPlatform, PushProvider, Reaction, ReactionRequest, ReadRequest, Recording, RecordingDownload, RecordingFile, RecordingKind, RecordingList, RecordingOutput, RecordingStatus, RegisterDeviceRequest, RemoveUserResponse, RoleGrant, ScanSummary, SendMessageRequest, SendMessageResponse, SendNotificationRequest, SendNotificationResponse, ServiceKey, ServiceScope, StartRecordingRequest, TenantId, UpdatePermissionsRequest, UploadIntentRequest, UploadIntentResponse, UsageCounts, UsageQuery, UsageRow, UsageSeries, UsageSeriesQuery, Uuid, WebhookDelivery, WebhookEventPage, WebhookSecret } from "./schemas.js";
4
4
  /** Bumped when the REST/event contract changes incompatibly. */
5
5
  export declare const API_VERSION = "v1";
6
- export { Ack, AdminCall, AdminCallDetail, AdminCallPage, AdminCallQuery, AdminMe, AdminParticipant, Attachment, AttachmentScanStatus, AttachmentStatus, AuditEvent, AuditPage, AuditQuery, Call, CallSignalEvent, CallSignalRequest, CallSignalType, CallStatus, CallType, ClientToServerEvents, ConnectivityStatus, ConsoleRole, ConsoleSession, Conversation, ConversationEvent, ConversationEventPage, ConversationEventType, ConversationList, ConversationReadEvent, ConversationType, ConversationUpdatedEvent, CreateCallRequest, CreateConversationRequest, CreateEnvironmentRequest, CreateKeyRequest, CreateProjectRequest, CreatedServiceKey, DownloadUrlResponse, EditMessageRequest, Environment, EnvironmentLive, EnvironmentName, ErrorBody, ErrorCode, GrantRoleRequest, JoinTokenRequest, JoinTokenResponse, LynkoriaError, ManualStatus, MembersRequest, Message, MessagingTokenRequest, MessagingTokenResponse, NotificationPreferences, OpsOverview, OrganizationLive, ParticipantRole, PatchEnvironmentRequest, PatchProjectRequest, Presence, PresenceStatus, ProductId, ProductMessagingPolicy, Project, ProjectFeatures, ProjectLimits, ProjectLive, PushDeliveryView, PushDevice, PushPayloadKeys, PushPlatform, PushProvider, Reaction, ReactionRequest, ReadRequest, Recording, RecordingDownload, RecordingFile, RecordingKind, RecordingList, RecordingOutput, RecordingStatus, RegisterDeviceRequest, RoleGrant, ScanSummary, SendMessageRequest, SendMessageResponse, SendNotificationRequest, SendNotificationResponse, ServerToClientEvents, ServiceKey, ServiceScope, SocketEvents, StartRecordingRequest, TenantId, TypingEvent, UpdatePermissionsRequest, UploadIntentRequest, UploadIntentResponse, UsageCounts, UsageQuery, UsageRow, UsageSeries, UsageSeriesQuery, Uuid, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TOLERANCE_SECONDS, WebhookDelivery, WebhookEvent, WebhookEventPage, WebhookEventType, WebhookSecret };
6
+ export { Ack, AdminCall, AdminCallDetail, AdminCallPage, AdminCallQuery, AdminMe, AdminParticipant, Attachment, AttachmentScanStatus, AttachmentStatus, AuditEvent, AuditPage, AuditQuery, Call, CallSignalEvent, CallSignalRequest, CallSignalType, CallStatus, CallType, ClientToServerEvents, ConnectivityStatus, ConsoleRole, ConsoleSession, Conversation, ConversationEvent, ConversationEventPage, ConversationEventType, ConversationList, ConversationReadEvent, ConversationType, ConversationUpdatedEvent, CreateCallRequest, CreateConversationRequest, CreateEnvironmentRequest, CreateKeyRequest, CreateProjectRequest, CreatedServiceKey, DeploymentOptions, DownloadUrlResponse, EditMessageRequest, Environment, EnvironmentLive, EnvironmentName, ErrorBody, ErrorCode, GrantRoleRequest, JoinTokenRequest, JoinTokenResponse, LynkoriaError, ManualStatus, MembersRequest, Message, MessagingTokenRequest, MessagingTokenResponse, NotificationPreferences, OpsOverview, OrganizationLive, ParticipantRole, PatchEnvironmentRequest, PatchProjectRequest, Presence, PresenceStatus, ProductId, ProductMessagingPolicy, Project, ProjectFeatures, ProjectLimits, ProjectLive, PublishSource, PushDeliveryView, PushDevice, PushPayloadKeys, PushPlatform, PushProvider, Reaction, ReactionRequest, ReadRequest, Recording, RecordingDownload, RecordingFile, RecordingKind, RecordingList, RecordingOutput, RecordingStatus, RegisterDeviceRequest, RemoveUserResponse, RoleGrant, ScanSummary, SendMessageRequest, SendMessageResponse, SendNotificationRequest, SendNotificationResponse, ServerToClientEvents, ServiceKey, ServiceScope, SocketEvents, StartRecordingRequest, TenantId, TypingEvent, UpdatePermissionsRequest, UploadIntentRequest, UploadIntentResponse, UsageCounts, UsageQuery, UsageRow, UsageSeries, UsageSeriesQuery, Uuid, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TOLERANCE_SECONDS, WebhookDelivery, WebhookEvent, WebhookEventPage, WebhookEventType, WebhookSecret };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ErrorCode, LynkoriaError } from "./errors.js";
2
2
  import { PushPayloadKeys, SocketEvents, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TOLERANCE_SECONDS } from "./events.js";
3
- import { AdminCall, AdminCallDetail, AdminCallPage, AdminCallQuery, AdminMe, AdminParticipant, Attachment, AttachmentScanStatus, AttachmentStatus, AuditEvent, AuditPage, AuditQuery, Call, CallSignalRequest, CallSignalType, CallStatus, CallType, ConnectivityStatus, ConsoleRole, ConsoleSession, Conversation, ConversationEvent, ConversationEventPage, ConversationEventType, ConversationList, ConversationType, CreateCallRequest, CreateConversationRequest, CreateEnvironmentRequest, CreateKeyRequest, CreateProjectRequest, CreatedServiceKey, DownloadUrlResponse, EditMessageRequest, Environment, EnvironmentLive, EnvironmentName, GrantRoleRequest, JoinTokenRequest, JoinTokenResponse, ManualStatus, MembersRequest, Message, MessagingTokenRequest, MessagingTokenResponse, NotificationPreferences, OpsOverview, OrganizationLive, ParticipantRole, PatchEnvironmentRequest, PatchProjectRequest, Presence, PresenceStatus, ProductId, ProductMessagingPolicy, Project, ProjectFeatures, ProjectLimits, ProjectLive, PushDeliveryView, PushDevice, PushPlatform, PushProvider, Reaction, ReactionRequest, ReadRequest, Recording, RecordingDownload, RecordingFile, RecordingKind, RecordingList, RecordingOutput, RecordingStatus, RegisterDeviceRequest, RoleGrant, ScanSummary, SendMessageRequest, SendMessageResponse, SendNotificationRequest, SendNotificationResponse, ServiceKey, ServiceScope, StartRecordingRequest, TenantId, UpdatePermissionsRequest, UploadIntentRequest, UploadIntentResponse, UsageCounts, UsageQuery, UsageRow, UsageSeries, UsageSeriesQuery, Uuid, WebhookDelivery, WebhookEventPage, WebhookSecret } from "./schemas.js";
3
+ import { AdminCall, AdminCallDetail, AdminCallPage, AdminCallQuery, AdminMe, AdminParticipant, Attachment, AttachmentScanStatus, AttachmentStatus, AuditEvent, AuditPage, AuditQuery, Call, CallSignalRequest, CallSignalType, CallStatus, CallType, ConnectivityStatus, ConsoleRole, ConsoleSession, Conversation, ConversationEvent, ConversationEventPage, ConversationEventType, ConversationList, ConversationType, CreateCallRequest, CreateConversationRequest, CreateEnvironmentRequest, CreateKeyRequest, CreateProjectRequest, CreatedServiceKey, DeploymentOptions, DownloadUrlResponse, EditMessageRequest, Environment, EnvironmentLive, EnvironmentName, GrantRoleRequest, JoinTokenRequest, JoinTokenResponse, ManualStatus, MembersRequest, Message, MessagingTokenRequest, MessagingTokenResponse, NotificationPreferences, OpsOverview, OrganizationLive, ParticipantRole, PatchEnvironmentRequest, PatchProjectRequest, Presence, PresenceStatus, ProductId, ProductMessagingPolicy, Project, ProjectFeatures, ProjectLimits, ProjectLive, PublishSource, PushDeliveryView, PushDevice, PushPlatform, PushProvider, Reaction, ReactionRequest, ReadRequest, Recording, RecordingDownload, RecordingFile, RecordingKind, RecordingList, RecordingOutput, RecordingStatus, RegisterDeviceRequest, RemoveUserResponse, RoleGrant, ScanSummary, SendMessageRequest, SendMessageResponse, SendNotificationRequest, SendNotificationResponse, ServiceKey, ServiceScope, StartRecordingRequest, TenantId, UpdatePermissionsRequest, UploadIntentRequest, UploadIntentResponse, UsageCounts, UsageQuery, UsageRow, UsageSeries, UsageSeriesQuery, Uuid, WebhookDelivery, WebhookEventPage, WebhookSecret } from "./schemas.js";
4
4
  // src/index.ts
5
5
  /** Bumped when the REST/event contract changes incompatibly. */
6
6
  const API_VERSION = "v1";
7
- export { API_VERSION, AdminCall, AdminCallDetail, AdminCallPage, AdminCallQuery, AdminMe, AdminParticipant, Attachment, AttachmentScanStatus, AttachmentStatus, AuditEvent, AuditPage, AuditQuery, Call, CallSignalRequest, CallSignalType, CallStatus, CallType, ConnectivityStatus, ConsoleRole, ConsoleSession, Conversation, ConversationEvent, ConversationEventPage, ConversationEventType, ConversationList, ConversationType, CreateCallRequest, CreateConversationRequest, CreateEnvironmentRequest, CreateKeyRequest, CreateProjectRequest, CreatedServiceKey, DownloadUrlResponse, EditMessageRequest, Environment, EnvironmentLive, EnvironmentName, ErrorCode, GrantRoleRequest, JoinTokenRequest, JoinTokenResponse, LynkoriaError, ManualStatus, MembersRequest, Message, MessagingTokenRequest, MessagingTokenResponse, NotificationPreferences, OpsOverview, OrganizationLive, ParticipantRole, PatchEnvironmentRequest, PatchProjectRequest, Presence, PresenceStatus, ProductId, ProductMessagingPolicy, Project, ProjectFeatures, ProjectLimits, ProjectLive, PushDeliveryView, PushDevice, PushPayloadKeys, PushPlatform, PushProvider, Reaction, ReactionRequest, ReadRequest, Recording, RecordingDownload, RecordingFile, RecordingKind, RecordingList, RecordingOutput, RecordingStatus, RegisterDeviceRequest, RoleGrant, ScanSummary, SendMessageRequest, SendMessageResponse, SendNotificationRequest, SendNotificationResponse, ServiceKey, ServiceScope, SocketEvents, StartRecordingRequest, TenantId, UpdatePermissionsRequest, UploadIntentRequest, UploadIntentResponse, UsageCounts, UsageQuery, UsageRow, UsageSeries, UsageSeriesQuery, Uuid, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TOLERANCE_SECONDS, WebhookDelivery, WebhookEventPage, WebhookSecret };
7
+ export { API_VERSION, AdminCall, AdminCallDetail, AdminCallPage, AdminCallQuery, AdminMe, AdminParticipant, Attachment, AttachmentScanStatus, AttachmentStatus, AuditEvent, AuditPage, AuditQuery, Call, CallSignalRequest, CallSignalType, CallStatus, CallType, ConnectivityStatus, ConsoleRole, ConsoleSession, Conversation, ConversationEvent, ConversationEventPage, ConversationEventType, ConversationList, ConversationType, CreateCallRequest, CreateConversationRequest, CreateEnvironmentRequest, CreateKeyRequest, CreateProjectRequest, CreatedServiceKey, DeploymentOptions, DownloadUrlResponse, EditMessageRequest, Environment, EnvironmentLive, EnvironmentName, ErrorCode, GrantRoleRequest, JoinTokenRequest, JoinTokenResponse, LynkoriaError, ManualStatus, MembersRequest, Message, MessagingTokenRequest, MessagingTokenResponse, NotificationPreferences, OpsOverview, OrganizationLive, ParticipantRole, PatchEnvironmentRequest, PatchProjectRequest, Presence, PresenceStatus, ProductId, ProductMessagingPolicy, Project, ProjectFeatures, ProjectLimits, ProjectLive, PublishSource, PushDeliveryView, PushDevice, PushPayloadKeys, PushPlatform, PushProvider, Reaction, ReactionRequest, ReadRequest, Recording, RecordingDownload, RecordingFile, RecordingKind, RecordingList, RecordingOutput, RecordingStatus, RegisterDeviceRequest, RemoveUserResponse, RoleGrant, ScanSummary, SendMessageRequest, SendMessageResponse, SendNotificationRequest, SendNotificationResponse, ServiceKey, ServiceScope, SocketEvents, StartRecordingRequest, TenantId, UpdatePermissionsRequest, UploadIntentRequest, UploadIntentResponse, UsageCounts, UsageQuery, UsageRow, UsageSeries, UsageSeriesQuery, Uuid, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TOLERANCE_SECONDS, WebhookDelivery, WebhookEventPage, WebhookSecret };
package/dist/schemas.d.ts CHANGED
@@ -64,6 +64,7 @@ export declare const CreateCallRequest: z.ZodObject<{
64
64
  emptyTimeoutSec: z.ZodDefault<z.ZodNumber>;
65
65
  departureTimeoutSec: z.ZodDefault<z.ZodNumber>;
66
66
  e2ee: z.ZodDefault<z.ZodBoolean>;
67
+ restartIfEnded: z.ZodDefault<z.ZodBoolean>;
67
68
  }, z.core.$strip>;
68
69
  export type CreateCallRequest = z.input<typeof CreateCallRequest>;
69
70
  export declare const Call: z.ZodObject<{
@@ -86,6 +87,13 @@ export declare const Call: z.ZodObject<{
86
87
  endedAt: z.ZodNullable<z.ZodString>;
87
88
  }, z.core.$strip>;
88
89
  export type Call = z.infer<typeof Call>;
90
+ export declare const PublishSource: z.ZodEnum<{
91
+ camera: "camera";
92
+ microphone: "microphone";
93
+ screen_share: "screen_share";
94
+ screen_share_audio: "screen_share_audio";
95
+ }>;
96
+ export type PublishSource = z.infer<typeof PublishSource>;
89
97
  export declare const JoinTokenRequest: z.ZodObject<{
90
98
  userId: z.ZodString;
91
99
  deviceId: z.ZodString;
@@ -96,6 +104,13 @@ export declare const JoinTokenRequest: z.ZodObject<{
96
104
  speaker: "speaker";
97
105
  viewer: "viewer";
98
106
  }>>;
107
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
108
+ publishSources: z.ZodOptional<z.ZodArray<z.ZodEnum<{
109
+ camera: "camera";
110
+ microphone: "microphone";
111
+ screen_share: "screen_share";
112
+ screen_share_audio: "screen_share_audio";
113
+ }>>>;
99
114
  }, z.core.$strip>;
100
115
  export type JoinTokenRequest = z.input<typeof JoinTokenRequest>;
101
116
  export declare const JoinTokenResponse: z.ZodObject<{
@@ -105,6 +120,10 @@ export declare const JoinTokenResponse: z.ZodObject<{
105
120
  expiresAt: z.ZodString;
106
121
  }, z.core.$strip>;
107
122
  export type JoinTokenResponse = z.infer<typeof JoinTokenResponse>;
123
+ export declare const RemoveUserResponse: z.ZodObject<{
124
+ removed: z.ZodNumber;
125
+ }, z.core.$strip>;
126
+ export type RemoveUserResponse = z.infer<typeof RemoveUserResponse>;
108
127
  export declare const UpdatePermissionsRequest: z.ZodObject<{
109
128
  role: z.ZodEnum<{
110
129
  host: "host";
@@ -145,6 +164,7 @@ export type MessagingTokenRequest = z.input<typeof MessagingTokenRequest>;
145
164
  export declare const MessagingTokenResponse: z.ZodObject<{
146
165
  token: z.ZodString;
147
166
  expiresAt: z.ZodString;
167
+ apiUrl: z.ZodString;
148
168
  }, z.core.$strip>;
149
169
  export type MessagingTokenResponse = z.infer<typeof MessagingTokenResponse>;
150
170
  export declare const ConversationType: z.ZodEnum<{
@@ -892,6 +912,12 @@ export declare const AdminMe: z.ZodObject<{
892
912
  }, z.core.$strip>>;
893
913
  }, z.core.$strip>;
894
914
  export type AdminMe = z.infer<typeof AdminMe>;
915
+ /** Names (never values) of the credential references this deployment can assign to environments. */
916
+ export declare const DeploymentOptions: z.ZodObject<{
917
+ livekitKeyRefs: z.ZodArray<z.ZodString>;
918
+ pushCredentialRefs: z.ZodArray<z.ZodString>;
919
+ }, z.core.$strip>;
920
+ export type DeploymentOptions = z.infer<typeof DeploymentOptions>;
895
921
  /** One of the signed-in console user's own sessions. `id` identifies it for revocation only. */
896
922
  export declare const ConsoleSession: z.ZodObject<{
897
923
  id: z.ZodString;
package/dist/schemas.js CHANGED
@@ -63,7 +63,13 @@ const CreateCallRequest = z.object({
63
63
  * Clients will encrypt media end to end with a key the server never sees. Lynkoria records the
64
64
  * flag and refuses server-side recording/streaming for the call; it does not distribute keys.
65
65
  */
66
- e2ee: z.boolean().default(false)
66
+ e2ee: z.boolean().default(false),
67
+ /**
68
+ * When a call with this productCallId already ended, start a new call (new `id`, same
69
+ * productCallId) instead of returning 409. Use it for persistent rooms such as a meeting link
70
+ * that people rejoin; leave it off when a retry must never reopen a finished call.
71
+ */
72
+ restartIfEnded: z.boolean().default(false)
67
73
  });
68
74
  const Call = z.object({
69
75
  id: Uuid,
@@ -77,11 +83,27 @@ const Call = z.object({
77
83
  createdAt: z.string(),
78
84
  endedAt: z.string().nullable()
79
85
  });
86
+ const PublishSource = z.enum([
87
+ "camera",
88
+ "microphone",
89
+ "screen_share",
90
+ "screen_share_audio"
91
+ ]);
80
92
  const JoinTokenRequest = z.object({
81
93
  userId: ProductId,
82
94
  deviceId: ProductId,
83
95
  displayName: z.string().trim().min(1).max(128),
84
- role: ParticipantRole.default("participant")
96
+ role: ParticipantRole.default("participant"),
97
+ /**
98
+ * Seconds the token can be used to connect (30–300, default 300). A connected participant stays
99
+ * connected; remove them with `removeParticipant`/`removeUser` when access ends.
100
+ */
101
+ ttlSeconds: z.number().int().min(30).max(300).optional(),
102
+ /**
103
+ * Restricts what this participant may publish, e.g. `["camera","microphone"]` to forbid screen
104
+ * sharing. Omit to allow every source the role permits. Viewers never publish.
105
+ */
106
+ publishSources: z.array(PublishSource).min(1).max(4).optional()
85
107
  });
86
108
  const JoinTokenResponse = z.object({
87
109
  url: z.string(),
@@ -89,6 +111,9 @@ const JoinTokenResponse = z.object({
89
111
  identity: z.string(),
90
112
  expiresAt: z.string()
91
113
  });
114
+ const RemoveUserResponse = z.object({
115
+ /** Devices that were connected and have been removed (0 if the user was not in the call). */
116
+ removed: z.number().int() });
92
117
  const UpdatePermissionsRequest = z.object({ role: z.enum([
93
118
  "host",
94
119
  "speaker",
@@ -116,7 +141,9 @@ const MessagingTokenRequest = z.object({
116
141
  });
117
142
  const MessagingTokenResponse = z.object({
118
143
  token: z.string(),
119
- expiresAt: z.string()
144
+ expiresAt: z.string(),
145
+ /** The API origin clients use with this token; return it to the client unchanged. */
146
+ apiUrl: z.string()
120
147
  });
121
148
  const ConversationType = z.enum([
122
149
  "dm",
@@ -437,6 +464,11 @@ const AdminMe = z.object({
437
464
  projectId: z.string().nullable()
438
465
  }))
439
466
  });
467
+ /** Names (never values) of the credential references this deployment can assign to environments. */
468
+ const DeploymentOptions = z.object({
469
+ livekitKeyRefs: z.array(z.string()),
470
+ pushCredentialRefs: z.array(z.string())
471
+ });
440
472
  /** One of the signed-in console user's own sessions. `id` identifies it for revocation only. */
441
473
  const ConsoleSession = z.object({
442
474
  id: z.string(),
@@ -729,4 +761,4 @@ const OpsOverview = z.object({
729
761
  recordings: z.array(Recording),
730
762
  scans: ScanSummary
731
763
  });
732
- export { AdminCall, AdminCallDetail, AdminCallPage, AdminCallQuery, AdminMe, AdminParticipant, Attachment, AttachmentScanStatus, AttachmentStatus, AuditEvent, AuditPage, AuditQuery, Call, CallSignalRequest, CallSignalType, CallStatus, CallType, ConnectivityStatus, ConsoleRole, ConsoleSession, Conversation, ConversationEvent, ConversationEventPage, ConversationEventType, ConversationList, ConversationType, CreateCallRequest, CreateConversationRequest, CreateEnvironmentRequest, CreateKeyRequest, CreateProjectRequest, CreatedServiceKey, DownloadUrlResponse, EditMessageRequest, Environment, EnvironmentLive, EnvironmentName, GrantRoleRequest, JoinTokenRequest, JoinTokenResponse, ManualStatus, MembersRequest, Message, MessagingTokenRequest, MessagingTokenResponse, NotificationPreferences, OpsOverview, OrganizationLive, ParticipantRole, PatchEnvironmentRequest, PatchProjectRequest, Presence, PresenceStatus, ProductId, ProductMessagingPolicy, Project, ProjectFeatures, ProjectLimits, ProjectLive, PushDeliveryView, PushDevice, PushPlatform, PushProvider, Reaction, ReactionRequest, ReadRequest, Recording, RecordingDownload, RecordingFile, RecordingKind, RecordingList, RecordingOutput, RecordingStatus, RegisterDeviceRequest, RoleGrant, ScanSummary, SendMessageRequest, SendMessageResponse, SendNotificationRequest, SendNotificationResponse, ServiceKey, ServiceScope, StartRecordingRequest, TenantId, UpdatePermissionsRequest, UploadIntentRequest, UploadIntentResponse, UsageCounts, UsageQuery, UsageRow, UsageSeries, UsageSeriesQuery, Uuid, WebhookDelivery, WebhookEventPage, WebhookSecret };
764
+ export { AdminCall, AdminCallDetail, AdminCallPage, AdminCallQuery, AdminMe, AdminParticipant, Attachment, AttachmentScanStatus, AttachmentStatus, AuditEvent, AuditPage, AuditQuery, Call, CallSignalRequest, CallSignalType, CallStatus, CallType, ConnectivityStatus, ConsoleRole, ConsoleSession, Conversation, ConversationEvent, ConversationEventPage, ConversationEventType, ConversationList, ConversationType, CreateCallRequest, CreateConversationRequest, CreateEnvironmentRequest, CreateKeyRequest, CreateProjectRequest, CreatedServiceKey, DeploymentOptions, DownloadUrlResponse, EditMessageRequest, Environment, EnvironmentLive, EnvironmentName, GrantRoleRequest, JoinTokenRequest, JoinTokenResponse, ManualStatus, MembersRequest, Message, MessagingTokenRequest, MessagingTokenResponse, NotificationPreferences, OpsOverview, OrganizationLive, ParticipantRole, PatchEnvironmentRequest, PatchProjectRequest, Presence, PresenceStatus, ProductId, ProductMessagingPolicy, Project, ProjectFeatures, ProjectLimits, ProjectLive, PublishSource, PushDeliveryView, PushDevice, PushPlatform, PushProvider, Reaction, ReactionRequest, ReadRequest, Recording, RecordingDownload, RecordingFile, RecordingKind, RecordingList, RecordingOutput, RecordingStatus, RegisterDeviceRequest, RemoveUserResponse, RoleGrant, ScanSummary, SendMessageRequest, SendMessageResponse, SendNotificationRequest, SendNotificationResponse, ServiceKey, ServiceScope, StartRecordingRequest, TenantId, UpdatePermissionsRequest, UploadIntentRequest, UploadIntentResponse, UsageCounts, UsageQuery, UsageRow, UsageSeries, UsageSeriesQuery, Uuid, WebhookDelivery, WebhookEventPage, WebhookSecret };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynkoria/contracts",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Lynkoria shared contracts: Zod schemas, event names, error codes",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",