@esposter/shared 2.26.0 → 2.27.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/index.d.ts +11 -8
- package/dist/index.js +9 -8
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -2000,7 +2000,7 @@ interface WithMetadata<TBase extends Class<NonNullable<unknown>>> {
|
|
|
2000
2000
|
}
|
|
2001
2001
|
//#endregion
|
|
2002
2002
|
//#region src/services/app/constants.d.ts
|
|
2003
|
-
declare const MAX_READ_LIMIT =
|
|
2003
|
+
declare const MAX_READ_LIMIT = 1000;
|
|
2004
2004
|
declare const SITE_NAME = "Esposter";
|
|
2005
2005
|
//#endregion
|
|
2006
2006
|
//#region ../../node_modules/.pnpm/neverthrow@8.2.0/node_modules/neverthrow/dist/index.d.ts
|
|
@@ -2653,12 +2653,12 @@ declare const noop: () => void;
|
|
|
2653
2653
|
//#region src/util/id/constants.d.ts
|
|
2654
2654
|
declare const ID_SEPARATOR = "|";
|
|
2655
2655
|
//#endregion
|
|
2656
|
+
//#region src/util/object/checkIsPlainObject.d.ts
|
|
2657
|
+
declare const checkIsPlainObject: (data: unknown) => data is object;
|
|
2658
|
+
//#endregion
|
|
2656
2659
|
//#region src/util/object/getPropertyNames.d.ts
|
|
2657
2660
|
declare const getPropertyNames: <T>() => PropertyNames<T>;
|
|
2658
2661
|
//#endregion
|
|
2659
|
-
//#region src/util/object/isPlainObject.d.ts
|
|
2660
|
-
declare const isPlainObject: (data: unknown) => data is object;
|
|
2661
|
-
//#endregion
|
|
2662
2662
|
//#region src/util/object/jsonDateParse.d.ts
|
|
2663
2663
|
declare const jsonDateParse: <T = any>(text: string) => T;
|
|
2664
2664
|
//#endregion
|
|
@@ -2674,14 +2674,12 @@ declare const getRawData: <T>(data: T) => T;
|
|
|
2674
2674
|
//#region src/util/reactivity/toRawDeep.d.ts
|
|
2675
2675
|
declare const toRawDeep: <T extends object>(data: T) => T;
|
|
2676
2676
|
//#endregion
|
|
2677
|
-
//#region src/util/regex/escapeRegExp.d.ts
|
|
2678
|
-
declare const escapeRegExp: (string: string) => string;
|
|
2679
|
-
//#endregion
|
|
2680
2677
|
//#region src/util/text/capitalize.d.ts
|
|
2681
2678
|
declare const capitalize: (string: string) => string;
|
|
2682
2679
|
//#endregion
|
|
2683
2680
|
//#region src/util/text/normalizeString.d.ts
|
|
2684
2681
|
declare const normalizeString: (value: null | string | undefined) => string;
|
|
2682
|
+
declare const createNormalizedStringSchema: (maxLength: number, schema?: z.ZodString) => z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
2685
2683
|
//#endregion
|
|
2686
2684
|
//#region src/util/text/streamToText.d.ts
|
|
2687
2685
|
declare const streamToText: (readable: NodeJS.ReadableStream) => Promise<string>;
|
|
@@ -2734,6 +2732,11 @@ type TupleSplitTail<T extends unknown[], N extends number> = TupleSplit<T, N>[1]
|
|
|
2734
2732
|
//#region src/util/validation/exhaustiveGuard.d.ts
|
|
2735
2733
|
declare const exhaustiveGuard: (value: never) => never;
|
|
2736
2734
|
//#endregion
|
|
2735
|
+
//#region src/util/zod/createUniqueArraySchema.d.ts
|
|
2736
|
+
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>);
|
|
2737
|
+
type UniqueArraySchemaKey<TSchema extends z.ZodType> = TSchema extends z.ZodObject ? keyof TSchema["shape"] & string : keyof z.output<TSchema> & string;
|
|
2738
|
+
declare const createUniqueArraySchema: CreateUniqueArraySchema;
|
|
2739
|
+
//#endregion
|
|
2737
2740
|
//#region src/util/id/uuid/constants.d.ts
|
|
2738
2741
|
declare const NIL = "00000000-0000-0000-0000-000000000000";
|
|
2739
2742
|
declare const UUIDV4_REGEX: RegExp;
|
|
@@ -2741,4 +2744,4 @@ declare const UUIDV4_REGEX: RegExp;
|
|
|
2741
2744
|
//#region src/util/id/uuid/uuidValidateV4.d.ts
|
|
2742
2745
|
declare const uuidValidateV4: (uuid: string) => boolean;
|
|
2743
2746
|
//#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,
|
|
2747
|
+
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, streamToText, takeOne, toAppError, toKebabCase, toRawDeep, truncate, uncapitalize, uuidValidateV4, withFinalizer, withFinalizerAsync };
|
package/dist/index.js
CHANGED
|
@@ -12750,16 +12750,16 @@ const getIsServer = () => typeof window === "undefined";
|
|
|
12750
12750
|
//#region src/util/id/constants.ts
|
|
12751
12751
|
const ID_SEPARATOR = "|";
|
|
12752
12752
|
//#endregion
|
|
12753
|
-
//#region src/util/object/
|
|
12754
|
-
const
|
|
12753
|
+
//#region src/util/object/checkIsPlainObject.ts
|
|
12754
|
+
const checkIsPlainObject = (data) => {
|
|
12755
12755
|
if (typeof data !== "object" || data === null) return false;
|
|
12756
12756
|
const prototype = Object.getPrototypeOf(data);
|
|
12757
12757
|
return prototype === null || prototype === Object.prototype;
|
|
12758
12758
|
};
|
|
12759
12759
|
//#endregion
|
|
12760
12760
|
//#region src/util/object/jsonDateParse.ts
|
|
12761
|
-
const ISO_DATE_REGEX = /^(
|
|
12762
|
-
const MS_AJAX_DATE_REGEX = /^\/Date\((
|
|
12761
|
+
const ISO_DATE_REGEX = /^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2}(?:\.{0,1}\d*))(?:Z|(?<sign>\+|-)(?<offset>[\d|:]*))?$/u;
|
|
12762
|
+
const MS_AJAX_DATE_REGEX = /^\/Date\((?<timestamp>-?\d+(?:[-+]\d+)?)\)[/\\]$/u;
|
|
12763
12763
|
const jsonDateParse = (text) => JSON.parse(text, (_key, value) => {
|
|
12764
12764
|
let parsedValue = value;
|
|
12765
12765
|
if (typeof value === "string") {
|
|
@@ -12779,14 +12779,12 @@ const jsonDateParse = (text) => JSON.parse(text, (_key, value) => {
|
|
|
12779
12779
|
//#region src/util/object/mergeObjectsStrict.ts
|
|
12780
12780
|
const mergeObjectsStrict = (...objects) => Object.assign({}, ...objects);
|
|
12781
12781
|
//#endregion
|
|
12782
|
-
//#region src/util/regex/escapeRegExp.ts
|
|
12783
|
-
const escapeRegExp = (string) => string.replaceAll(/[.*+?^${}()|[\]\\]/gu, String.raw`\$&`);
|
|
12784
|
-
//#endregion
|
|
12785
12782
|
//#region src/util/text/capitalize.ts
|
|
12786
12783
|
const capitalize = (string) => `${string.charAt(0).toUpperCase()}${string.slice(1)}`;
|
|
12787
12784
|
//#endregion
|
|
12788
12785
|
//#region src/util/text/normalizeString.ts
|
|
12789
12786
|
const normalizeString = (value) => value?.trim() ?? "";
|
|
12787
|
+
const createNormalizedStringSchema = (maxLength, schema = z.string()) => schema.transform(normalizeString).pipe(z.string().max(maxLength));
|
|
12790
12788
|
//#endregion
|
|
12791
12789
|
//#region src/util/text/streamToText.ts
|
|
12792
12790
|
const streamToText = async (readable) => {
|
|
@@ -12832,6 +12830,9 @@ const exhaustiveGuard = (value) => {
|
|
|
12832
12830
|
throw new InvalidOperationError("Read", exhaustiveGuard.name, JSON.stringify(value));
|
|
12833
12831
|
};
|
|
12834
12832
|
//#endregion
|
|
12833
|
+
//#region src/util/zod/createUniqueArraySchema.ts
|
|
12834
|
+
const createUniqueArraySchema = (schema, key) => schema.array().refine((array) => new Set(key === void 0 ? array : array.map((item) => item[key])).size === array.length, "Array items must be unique");
|
|
12835
|
+
//#endregion
|
|
12835
12836
|
//#region src/util/id/uuid/constants.ts
|
|
12836
12837
|
const NIL = "00000000-0000-0000-0000-000000000000";
|
|
12837
12838
|
const UUIDV4_REGEX = /^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/iu;
|
|
@@ -12839,4 +12840,4 @@ const UUIDV4_REGEX = /^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-
|
|
|
12839
12840
|
//#region src/util/id/uuid/uuidValidateV4.ts
|
|
12840
12841
|
const uuidValidateV4 = (uuid) => UUIDV4_REGEX.test(uuid);
|
|
12841
12842
|
//#endregion
|
|
12842
|
-
export { AllSpecialValues, ForbiddenError, ID_SEPARATOR, InvalidOperationError, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, MAX_READ_LIMIT, MENTION_EVERYONE_ID, MENTION_HERE_ID, MENTION_ID_ATTRIBUTE, MENTION_ITEM_TYPE_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MentionType, NIL, NotFoundError, NotInitializedError, Operation, RoutePath, SITE_NAME, SURVEY_DISPLAY_NAME, Serializable, UUIDV4_REGEX, applyItemMetadataMixin, capitalize, classifyMentions, createItemEntityTypeSchema,
|
|
12843
|
+
export { AllSpecialValues, ForbiddenError, ID_SEPARATOR, InvalidOperationError, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, MAX_READ_LIMIT, MENTION_EVERYONE_ID, MENTION_HERE_ID, MENTION_ID_ATTRIBUTE, MENTION_ITEM_TYPE_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MentionType, NIL, NotFoundError, NotInitializedError, Operation, RoutePath, SITE_NAME, SURVEY_DISPLAY_NAME, Serializable, UUIDV4_REGEX, applyItemMetadataMixin, capitalize, checkIsPlainObject, classifyMentions, createItemEntityTypeSchema, createNormalizedStringSchema, createUniqueArraySchema, css, exhaustiveGuard, getIsServer, getMentions, getPropertyNames, getRawData, getResult, getResultAsync, hrtime, html, itemMetadataSchema, jsonDateParse, mergeObjectsStrict, noop, normalizeString, now, streamToText, takeOne, toAppError, toKebabCase, toRawDeep, truncate, uncapitalize, uuidValidateV4, withFinalizer, withFinalizerAsync };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esposter/shared",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.27.0",
|
|
4
4
|
"description": "A library that contains shared typescript code.",
|
|
5
5
|
"homepage": "https://github.com/Esposter/Esposter/blob/main/packages/shared#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -38,18 +38,18 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@azure/data-tables": "^13.3.2",
|
|
41
|
-
"@esposter/configuration": "2.
|
|
41
|
+
"@esposter/configuration": "2.27.0",
|
|
42
42
|
"@types/node": "^25.9.1",
|
|
43
|
-
"@vitest/coverage-v8": "^4.1.
|
|
43
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
44
44
|
"ctix": "^2.8.1",
|
|
45
|
-
"rolldown": "^1.0
|
|
45
|
+
"rolldown": "^1.1.0",
|
|
46
46
|
"type-fest": "^5.7.0",
|
|
47
|
-
"vitest": "^4.1.
|
|
47
|
+
"vitest": "^4.1.8"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@vueuse/core": "^14.3.0",
|
|
51
51
|
"vue": "^3.5.35",
|
|
52
52
|
"zod": "^4.4.3"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "910d6b733310e882713270963a6f3d30314b865e"
|
|
55
55
|
}
|