@openpeepshq/common 0.8.0 → 0.9.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/dist/types/api.d.ts +13 -0
- package/dist/types/api.js +17 -0
- package/package.json +1 -1
- package/src/types/api.ts +25 -0
package/dist/types/api.d.ts
CHANGED
|
@@ -39121,6 +39121,7 @@ export type ReportCreationData = z.infer<typeof reportCreationDataSchema>;
|
|
|
39121
39121
|
export declare const jamStateSchema: z.ZodObject<{
|
|
39122
39122
|
active: z.ZodBoolean;
|
|
39123
39123
|
participants: z.ZodArray<z.ZodUUID>;
|
|
39124
|
+
observers: z.ZodOptional<z.ZodNumber>;
|
|
39124
39125
|
}, z.core.$strip>;
|
|
39125
39126
|
export type JamState = z.infer<typeof jamStateSchema>;
|
|
39126
39127
|
export declare const publicReportSchema: z.ZodObject<{
|
|
@@ -55598,6 +55599,18 @@ export declare const offsetInfiniteQueryParamsSchema: z.ZodObject<{
|
|
|
55598
55599
|
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
55599
55600
|
}, z.core.$strip>;
|
|
55600
55601
|
export type OffsetInfiniteQueryParams = z.infer<typeof offsetInfiniteQueryParamsSchema> | undefined;
|
|
55602
|
+
/** Span cap of the date-range event feeds (events calendar). */
|
|
55603
|
+
export declare const EVENT_RANGE_MAX_SPAN_MS: number;
|
|
55604
|
+
/** Default page size of the date-range event feeds (events calendar). */
|
|
55605
|
+
export declare const EVENT_RANGE_DEFAULT_LIMIT = 500;
|
|
55606
|
+
/** Query params of the date-range event feeds (events calendar). */
|
|
55607
|
+
export declare const eventRangeQueryParamsSchema: z.ZodObject<{
|
|
55608
|
+
from: z.ZodString;
|
|
55609
|
+
to: z.ZodString;
|
|
55610
|
+
offset: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
55611
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
55612
|
+
}, z.core.$strip>;
|
|
55613
|
+
export type EventRangeQueryParams = z.infer<typeof eventRangeQueryParamsSchema>;
|
|
55601
55614
|
export declare const searchResultItemSchema: (baseSchema: z.ZodType) => z.ZodObject<{
|
|
55602
55615
|
score: z.ZodNumber;
|
|
55603
55616
|
data: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
package/dist/types/api.js
CHANGED
|
@@ -474,6 +474,8 @@ export const reportCreationDataSchema = z.object({
|
|
|
474
474
|
export const jamStateSchema = z.object({
|
|
475
475
|
active: z.boolean(),
|
|
476
476
|
participants: z.uuid().array(),
|
|
477
|
+
/** Count of hidden `EG_` sessions (observer links, recording/RTMP egress). */
|
|
478
|
+
observers: z.number().optional(),
|
|
477
479
|
});
|
|
478
480
|
export const publicReportSchema = reportSchema.extend({
|
|
479
481
|
reporterProfile: publicProfileSchema,
|
|
@@ -492,6 +494,21 @@ export const offsetInfiniteQueryParamsSchema = z.object({
|
|
|
492
494
|
offset: z.coerce.number().optional(),
|
|
493
495
|
limit: z.coerce.number().optional(),
|
|
494
496
|
});
|
|
497
|
+
/** Span cap of the date-range event feeds (events calendar). */
|
|
498
|
+
export const EVENT_RANGE_MAX_SPAN_MS = 62 * 24 * 60 * 60 * 1000;
|
|
499
|
+
/** Default page size of the date-range event feeds (events calendar). */
|
|
500
|
+
export const EVENT_RANGE_DEFAULT_LIMIT = 500;
|
|
501
|
+
/** Query params of the date-range event feeds (events calendar). */
|
|
502
|
+
export const eventRangeQueryParamsSchema = z
|
|
503
|
+
.object({
|
|
504
|
+
from: z.string().datetime({ offset: true }),
|
|
505
|
+
to: z.string().datetime({ offset: true }),
|
|
506
|
+
offset: z.coerce.number().optional(),
|
|
507
|
+
limit: z.coerce.number().optional(),
|
|
508
|
+
})
|
|
509
|
+
.refine((value) => new Date(value.from).getTime() < new Date(value.to).getTime() &&
|
|
510
|
+
new Date(value.to).getTime() - new Date(value.from).getTime() <=
|
|
511
|
+
EVENT_RANGE_MAX_SPAN_MS, { message: 'from < to with a span of at most 62 days' });
|
|
495
512
|
export const searchResultItemSchema = (baseSchema) => z.object({
|
|
496
513
|
score: z.number(),
|
|
497
514
|
data: baseSchema,
|
package/package.json
CHANGED
package/src/types/api.ts
CHANGED
|
@@ -730,6 +730,8 @@ export type ReportCreationData = z.infer<typeof reportCreationDataSchema>;
|
|
|
730
730
|
export const jamStateSchema = z.object({
|
|
731
731
|
active: z.boolean(),
|
|
732
732
|
participants: z.uuid().array(),
|
|
733
|
+
/** Count of hidden `EG_` sessions (observer links, recording/RTMP egress). */
|
|
734
|
+
observers: z.number().optional(),
|
|
733
735
|
});
|
|
734
736
|
export type JamState = z.infer<typeof jamStateSchema>;
|
|
735
737
|
|
|
@@ -763,6 +765,29 @@ export type OffsetInfiniteQueryParams =
|
|
|
763
765
|
| z.infer<typeof offsetInfiniteQueryParamsSchema>
|
|
764
766
|
| undefined;
|
|
765
767
|
|
|
768
|
+
/** Span cap of the date-range event feeds (events calendar). */
|
|
769
|
+
export const EVENT_RANGE_MAX_SPAN_MS = 62 * 24 * 60 * 60 * 1000;
|
|
770
|
+
|
|
771
|
+
/** Default page size of the date-range event feeds (events calendar). */
|
|
772
|
+
export const EVENT_RANGE_DEFAULT_LIMIT = 500;
|
|
773
|
+
|
|
774
|
+
/** Query params of the date-range event feeds (events calendar). */
|
|
775
|
+
export const eventRangeQueryParamsSchema = z
|
|
776
|
+
.object({
|
|
777
|
+
from: z.string().datetime({ offset: true }),
|
|
778
|
+
to: z.string().datetime({ offset: true }),
|
|
779
|
+
offset: z.coerce.number().optional(),
|
|
780
|
+
limit: z.coerce.number().optional(),
|
|
781
|
+
})
|
|
782
|
+
.refine(
|
|
783
|
+
(value) =>
|
|
784
|
+
new Date(value.from).getTime() < new Date(value.to).getTime() &&
|
|
785
|
+
new Date(value.to).getTime() - new Date(value.from).getTime() <=
|
|
786
|
+
EVENT_RANGE_MAX_SPAN_MS,
|
|
787
|
+
{ message: 'from < to with a span of at most 62 days' },
|
|
788
|
+
);
|
|
789
|
+
export type EventRangeQueryParams = z.infer<typeof eventRangeQueryParamsSchema>;
|
|
790
|
+
|
|
766
791
|
export const searchResultItemSchema = (baseSchema: z.ZodType) =>
|
|
767
792
|
z.object({
|
|
768
793
|
score: z.number(),
|