@esposter/shared 2.26.0 → 2.28.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +19 -8
  2. package/dist/index.js +7044 -142
  3. package/package.json +11 -9
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import baseSanitizeHtml from "sanitize-html";
2
3
 
3
4
  //#region src/test/constants.d.ts
4
5
  declare const AllSpecialValues: {
@@ -69,6 +70,7 @@ declare const RoutePath: {
69
70
  readonly Index: "/";
70
71
  readonly Login: "/login";
71
72
  readonly Messages: (id: string) => string;
73
+ readonly MessagesDraftsSent: "/messages/drafts-sent";
72
74
  readonly MessagesFriends: "/messages/friends";
73
75
  readonly MessagesIndex: "/messages";
74
76
  readonly MessagesInvite: (code: string) => string;
@@ -2000,7 +2002,7 @@ interface WithMetadata<TBase extends Class<NonNullable<unknown>>> {
2000
2002
  }
2001
2003
  //#endregion
2002
2004
  //#region src/services/app/constants.d.ts
2003
- declare const MAX_READ_LIMIT = 1e3;
2005
+ declare const MAX_READ_LIMIT = 1000;
2004
2006
  declare const SITE_NAME = "Esposter";
2005
2007
  //#endregion
2006
2008
  //#region ../../node_modules/.pnpm/neverthrow@8.2.0/node_modules/neverthrow/dist/index.d.ts
@@ -2635,6 +2637,12 @@ declare const css: typeof String.raw;
2635
2637
  //#region src/services/prettier/html.d.ts
2636
2638
  declare const html: typeof String.raw;
2637
2639
  //#endregion
2640
+ //#region src/services/sanitizeHtml/sanitizeHtml.d.ts
2641
+ declare const sanitizeHtml: (...[html, options]: Parameters<typeof baseSanitizeHtml>) => string;
2642
+ //#endregion
2643
+ //#region src/services/sanitizeHtml/sanitizeMessageHtml.d.ts
2644
+ declare const sanitizeMessageHtml: (html: string) => string;
2645
+ //#endregion
2638
2646
  //#region src/services/shared/applyItemMetadataMixin.d.ts
2639
2647
  declare const applyItemMetadataMixin: <TBase extends Class<NonNullable<unknown>>>(Base: TBase) => WithMetadata<TBase>;
2640
2648
  //#endregion
@@ -2653,12 +2661,12 @@ declare const noop: () => void;
2653
2661
  //#region src/util/id/constants.d.ts
2654
2662
  declare const ID_SEPARATOR = "|";
2655
2663
  //#endregion
2664
+ //#region src/util/object/checkIsPlainObject.d.ts
2665
+ declare const checkIsPlainObject: (data: unknown) => data is object;
2666
+ //#endregion
2656
2667
  //#region src/util/object/getPropertyNames.d.ts
2657
2668
  declare const getPropertyNames: <T>() => PropertyNames<T>;
2658
2669
  //#endregion
2659
- //#region src/util/object/isPlainObject.d.ts
2660
- declare const isPlainObject: (data: unknown) => data is object;
2661
- //#endregion
2662
2670
  //#region src/util/object/jsonDateParse.d.ts
2663
2671
  declare const jsonDateParse: <T = any>(text: string) => T;
2664
2672
  //#endregion
@@ -2674,14 +2682,12 @@ declare const getRawData: <T>(data: T) => T;
2674
2682
  //#region src/util/reactivity/toRawDeep.d.ts
2675
2683
  declare const toRawDeep: <T extends object>(data: T) => T;
2676
2684
  //#endregion
2677
- //#region src/util/regex/escapeRegExp.d.ts
2678
- declare const escapeRegExp: (string: string) => string;
2679
- //#endregion
2680
2685
  //#region src/util/text/capitalize.d.ts
2681
2686
  declare const capitalize: (string: string) => string;
2682
2687
  //#endregion
2683
2688
  //#region src/util/text/normalizeString.d.ts
2684
2689
  declare const normalizeString: (value: null | string | undefined) => string;
2690
+ declare const createNormalizedStringSchema: (maxLength: number, schema?: z.ZodString) => z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
2685
2691
  //#endregion
2686
2692
  //#region src/util/text/streamToText.d.ts
2687
2693
  declare const streamToText: (readable: NodeJS.ReadableStream) => Promise<string>;
@@ -2734,6 +2740,11 @@ type TupleSplitTail<T extends unknown[], N extends number> = TupleSplit<T, N>[1]
2734
2740
  //#region src/util/validation/exhaustiveGuard.d.ts
2735
2741
  declare const exhaustiveGuard: (value: never) => never;
2736
2742
  //#endregion
2743
+ //#region src/util/zod/createUniqueArraySchema.d.ts
2744
+ type CreateUniqueArraySchema = (<TOutput extends object, TInput, TSchema extends z.ZodType<TOutput, TInput>>(schema: TSchema, key: UniqueArraySchemaKey<TSchema>) => z.ZodArray<TSchema>) & (<TSchema extends z.ZodType>(schema: TSchema) => z.ZodArray<TSchema>);
2745
+ type UniqueArraySchemaKey<TSchema extends z.ZodType> = TSchema extends z.ZodObject ? keyof TSchema["shape"] & string : keyof z.output<TSchema> & string;
2746
+ declare const createUniqueArraySchema: CreateUniqueArraySchema;
2747
+ //#endregion
2737
2748
  //#region src/util/id/uuid/constants.d.ts
2738
2749
  declare const NIL = "00000000-0000-0000-0000-000000000000";
2739
2750
  declare const UUIDV4_REGEX: RegExp;
@@ -2741,4 +2752,4 @@ declare const UUIDV4_REGEX: RegExp;
2741
2752
  //#region src/util/id/uuid/uuidValidateV4.d.ts
2742
2753
  declare const uuidValidateV4: (uuid: string) => boolean;
2743
2754
  //#endregion
2744
- export { AllSpecialValues, BuildTuple, ClassifiedMentions, DeepOmit, DeepOptionalUndefined, ExcludeFunctionProperties, ForbiddenError, FunctionProperties, GetArrayProps, GetObjectProps, GetPaths, GetPrimitiveProps, GetProperties, ID_SEPARATOR, InvalidOperationError, ItemEntityType, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, KnownKeys, MAX_READ_LIMIT, MENTION_EVERYONE_ID, MENTION_HERE_ID, MENTION_ID_ATTRIBUTE, MENTION_ITEM_TYPE_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MapValue, MentionType, MergeObjectsStrict, NIL, NotFoundError, NotInitializedError, Operation, PropertyNames, RoutePath, SITE_NAME, SURVEY_DISPLAY_NAME, Serializable, SkipFirst, TakeFirst, TakeOne, ToData, TupleSlice, TupleSplit, TupleSplitHead, TupleSplitTail, UUIDV4_REGEX, WithMetadata, applyItemMetadataMixin, capitalize, classifyMentions, createItemEntityTypeSchema, css, escapeRegExp, exhaustiveGuard, getIsServer, getMentions, getPropertyNames, getRawData, getResult, getResultAsync, hrtime, html, isPlainObject, itemMetadataSchema, jsonDateParse, mergeObjectsStrict, noop, normalizeString, now, streamToText, takeOne, toAppError, toKebabCase, toRawDeep, truncate, uncapitalize, uuidValidateV4, withFinalizer, withFinalizerAsync };
2755
+ export { AllSpecialValues, BuildTuple, ClassifiedMentions, CreateUniqueArraySchema, DeepOmit, DeepOptionalUndefined, ExcludeFunctionProperties, ForbiddenError, FunctionProperties, GetArrayProps, GetObjectProps, GetPaths, GetPrimitiveProps, GetProperties, ID_SEPARATOR, InvalidOperationError, ItemEntityType, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, KnownKeys, MAX_READ_LIMIT, MENTION_EVERYONE_ID, MENTION_HERE_ID, MENTION_ID_ATTRIBUTE, MENTION_ITEM_TYPE_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MapValue, MentionType, MergeObjectsStrict, NIL, NotFoundError, NotInitializedError, Operation, PropertyNames, RoutePath, SITE_NAME, SURVEY_DISPLAY_NAME, Serializable, SkipFirst, TakeFirst, TakeOne, ToData, TupleSlice, TupleSplit, TupleSplitHead, TupleSplitTail, UUIDV4_REGEX, UniqueArraySchemaKey, WithMetadata, applyItemMetadataMixin, capitalize, checkIsPlainObject, classifyMentions, createItemEntityTypeSchema, createNormalizedStringSchema, createUniqueArraySchema, css, exhaustiveGuard, getIsServer, getMentions, getPropertyNames, getRawData, getResult, getResultAsync, hrtime, html, itemMetadataSchema, jsonDateParse, mergeObjectsStrict, noop, normalizeString, now, sanitizeHtml, sanitizeMessageHtml, streamToText, takeOne, toAppError, toKebabCase, toRawDeep, truncate, uncapitalize, uuidValidateV4, withFinalizer, withFinalizerAsync };