@openpeepshq/common 0.16.0 → 0.17.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.
@@ -0,0 +1,9 @@
1
+ export declare const CALENDAR_FEED_PATH = "/api/openpeeps/core/v1/events/feed";
2
+ /**
3
+ * Absolute subscription URL for a calendar feed token. The token travels as a
4
+ * query param, so it must be the last (and only) component of the URL.
5
+ * The token is percent-encoded even though it is currently plain lowercase
6
+ * hex — the helper is a published export and the encoding keeps the contract
7
+ * valid for any token shape (mirrors the server-side URL builders).
8
+ */
9
+ export declare const buildCalendarFeedUrl: (origin: string, token: string) => string;
@@ -0,0 +1,11 @@
1
+ // The ICS feed endpoint lives at the application root, not under the API
2
+ // subtree — the same reason the HLS streaming URLs use the bare origin.
3
+ export const CALENDAR_FEED_PATH = '/api/openpeeps/core/v1/events/feed';
4
+ /**
5
+ * Absolute subscription URL for a calendar feed token. The token travels as a
6
+ * query param, so it must be the last (and only) component of the URL.
7
+ * The token is percent-encoded even though it is currently plain lowercase
8
+ * hex — the helper is a published export and the encoding keeps the contract
9
+ * valid for any token shape (mirrors the server-side URL builders).
10
+ */
11
+ export const buildCalendarFeedUrl = (origin, token) => `${origin.replace(/\/+$/, '')}${CALENDAR_FEED_PATH}?token=${encodeURIComponent(token)}`;
@@ -14,6 +14,7 @@ export * from './markdownHelpers';
14
14
  export * from './contentLength';
15
15
  export * from './attachmentHelpers';
16
16
  export * from './resources';
17
+ export * from './calendarFeedUrl';
17
18
  export * from './eventIcs';
18
19
  export * from './eventTime';
19
20
  export * from './timeZone';
package/dist/lib/index.js CHANGED
@@ -14,6 +14,7 @@ export * from './markdownHelpers.js';
14
14
  export * from './contentLength.js';
15
15
  export * from './attachmentHelpers.js';
16
16
  export * from './resources.js';
17
+ export * from './calendarFeedUrl.js';
17
18
  export * from './eventIcs.js';
18
19
  export * from './eventTime.js';
19
20
  export * from './timeZone.js';
@@ -39073,6 +39073,16 @@ export type JamWaitingProfile = {
39073
39073
  id: string;
39074
39074
  displayName?: string;
39075
39075
  };
39076
+ /** The waiting-room join stream emits either the admittance token or a denial. */
39077
+ export declare const jamWaitingRoomJoinEventSchema: z.ZodUnion<readonly [z.ZodObject<{
39078
+ success: z.ZodLiteral<true>;
39079
+ token: z.ZodString;
39080
+ checkoutUrl: z.ZodOptional<z.ZodString>;
39081
+ livekitUrl: z.ZodString;
39082
+ }, z.core.$strip>, z.ZodObject<{
39083
+ denied: z.ZodLiteral<true>;
39084
+ }, z.core.$strip>]>;
39085
+ export type JamWaitingRoomJoinEvent = z.infer<typeof jamWaitingRoomJoinEventSchema>;
39076
39086
  export interface Credentials {
39077
39087
  token: string;
39078
39088
  }
package/dist/types/api.js CHANGED
@@ -397,6 +397,11 @@ export const calendarFeedTokenResponseSchema = z.object({
397
397
  export const jamWaitingRoomEntrySchema = z.object({
398
398
  displayName: z.string().optional(),
399
399
  });
400
+ /** The waiting-room join stream emits either the admittance token or a denial. */
401
+ export const jamWaitingRoomJoinEventSchema = z.union([
402
+ jamTokenResponseSchema,
403
+ z.object({ denied: z.literal(true) }),
404
+ ]);
400
405
  const focusCoordinatesPattern = /^-?\d+,-?\d+$/;
401
406
  // NOTE: `file` / `thumbnail` accept a `File` (browser) or any
402
407
  // multipart body — modelled as `z.any()` for the API contract so the OpenAPI
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpeepshq/common",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -0,0 +1,15 @@
1
+ // The ICS feed endpoint lives at the application root, not under the API
2
+ // subtree — the same reason the HLS streaming URLs use the bare origin.
3
+ export const CALENDAR_FEED_PATH = '/api/openpeeps/core/v1/events/feed';
4
+
5
+ /**
6
+ * Absolute subscription URL for a calendar feed token. The token travels as a
7
+ * query param, so it must be the last (and only) component of the URL.
8
+ * The token is percent-encoded even though it is currently plain lowercase
9
+ * hex — the helper is a published export and the encoding keeps the contract
10
+ * valid for any token shape (mirrors the server-side URL builders).
11
+ */
12
+ export const buildCalendarFeedUrl = (origin: string, token: string): string =>
13
+ `${origin.replace(/\/+$/, '')}${CALENDAR_FEED_PATH}?token=${encodeURIComponent(
14
+ token,
15
+ )}`;
package/src/lib/index.ts CHANGED
@@ -14,6 +14,7 @@ export * from './markdownHelpers';
14
14
  export * from './contentLength';
15
15
  export * from './attachmentHelpers';
16
16
  export * from './resources';
17
+ export * from './calendarFeedUrl';
17
18
  export * from './eventIcs';
18
19
  export * from './eventTime';
19
20
  export * from './timeZone';
package/src/types/api.ts CHANGED
@@ -616,6 +616,15 @@ export type JamWaitingProfile = {
616
616
  displayName?: string;
617
617
  };
618
618
 
619
+ /** The waiting-room join stream emits either the admittance token or a denial. */
620
+ export const jamWaitingRoomJoinEventSchema = z.union([
621
+ jamTokenResponseSchema,
622
+ z.object({ denied: z.literal(true) }),
623
+ ]);
624
+ export type JamWaitingRoomJoinEvent = z.infer<
625
+ typeof jamWaitingRoomJoinEventSchema
626
+ >;
627
+
619
628
  export interface Credentials {
620
629
  token: string;
621
630
  }