@esposter/shared 2.15.0 → 2.15.1
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 +33 -224
- package/dist/index.js +115 -1552
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,46 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
gt = "gt",
|
|
9
|
-
le = "le",
|
|
10
|
-
lt = "lt",
|
|
11
|
-
ne = "ne",
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/models/azure/SearchOperator.d.ts
|
|
15
|
-
declare enum SearchOperator {
|
|
16
|
-
arrayContains = "arrayContains",
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/models/azure/SerializableValue.d.ts
|
|
20
|
-
declare const SERIALIZABLE_VALUE_MAX_LENGTH = 100;
|
|
21
|
-
type SerializableValue = boolean | Date | null | number | string;
|
|
22
|
-
declare const serializableValueSchema: z.ZodType<SerializableValue>;
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region src/models/azure/Clause.d.ts
|
|
25
|
-
type Clause = {
|
|
26
|
-
key: string;
|
|
27
|
-
not?: boolean;
|
|
28
|
-
} & ({
|
|
29
|
-
operator: BinaryOperator;
|
|
30
|
-
value: SerializableValue;
|
|
31
|
-
} | {
|
|
32
|
-
operator: Exclude<SearchOperator, SearchOperator.arrayContains>;
|
|
33
|
-
value: SerializableValue;
|
|
34
|
-
} | {
|
|
35
|
-
operator: SearchOperator.arrayContains;
|
|
36
|
-
value: SerializableValue[];
|
|
37
|
-
});
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/models/azure/UnaryOperator.d.ts
|
|
40
|
-
declare enum UnaryOperator {
|
|
41
|
-
and = "and",
|
|
42
|
-
not = "not",
|
|
43
|
-
or = "or",
|
|
2
|
+
|
|
3
|
+
//#region src/models/environment/Environment.d.ts
|
|
4
|
+
declare enum Environment {
|
|
5
|
+
development = "development",
|
|
6
|
+
production = "production",
|
|
7
|
+
test = "test",
|
|
44
8
|
}
|
|
45
9
|
//#endregion
|
|
46
10
|
//#region src/models/shared/Operation.d.ts
|
|
@@ -702,7 +666,7 @@ type Filtered = Filter<'bar', 'foo'>;
|
|
|
702
666
|
|
|
703
667
|
@see {Except}
|
|
704
668
|
*/
|
|
705
|
-
type Filter
|
|
669
|
+
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
706
670
|
type ExceptOptions = {
|
|
707
671
|
/**
|
|
708
672
|
Disallow assigning non-specified properties.
|
|
@@ -769,7 +733,7 @@ type PostPayload = Except<UserData, 'email'>;
|
|
|
769
733
|
@category Object
|
|
770
734
|
*/
|
|
771
735
|
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
|
|
772
|
-
type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter
|
|
736
|
+
type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType] } & (Options['requireExactProps'] extends true ? Partial<Record<KeysType, never>> : {});
|
|
773
737
|
//#endregion
|
|
774
738
|
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/required-deep.d.ts
|
|
775
739
|
/**
|
|
@@ -819,6 +783,15 @@ type RequiredObjectDeep<ObjectType extends object> = { [KeyType in keyof ObjectT
|
|
|
819
783
|
//#region src/util/types/PropertyNames.d.ts
|
|
820
784
|
type PropertyNames<T> = RequiredDeep<{ [P in keyof T]: P }>;
|
|
821
785
|
//#endregion
|
|
786
|
+
//#region src/models/shared/ItemEntityType.d.ts
|
|
787
|
+
interface ItemEntityType<T extends string> {
|
|
788
|
+
type: T;
|
|
789
|
+
}
|
|
790
|
+
declare const ItemEntityTypePropertyNames: PropertyNames<ItemEntityType<string>>;
|
|
791
|
+
declare const createItemEntityTypeSchema: <T extends z.ZodType<string>>(schema: T) => z.ZodObject<{
|
|
792
|
+
type: T;
|
|
793
|
+
}>;
|
|
794
|
+
//#endregion
|
|
822
795
|
//#region src/models/shared/ItemMetadata.d.ts
|
|
823
796
|
declare class ItemMetadata {
|
|
824
797
|
createdAt: Date;
|
|
@@ -855,32 +828,11 @@ type DeepOptionalUndefined<T> = T extends ((...args: unknown[]) => unknown) ? T
|
|
|
855
828
|
//#region src/models/shared/ToData.d.ts
|
|
856
829
|
type ToData<T extends Serializable> = DeepOptionalUndefined<DeepOmit<T, "toJSON">>;
|
|
857
830
|
//#endregion
|
|
858
|
-
//#region src/
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
declare const deserializeClause: (string: string) => Extract<Clause, {
|
|
864
|
-
operator: BinaryOperator;
|
|
865
|
-
}>;
|
|
866
|
-
//#endregion
|
|
867
|
-
//#region src/services/azure/deserializeValue.d.ts
|
|
868
|
-
declare const deserializeValue: (string: string) => SerializableValue;
|
|
869
|
-
//#endregion
|
|
870
|
-
//#region src/services/azure/escapeValue.d.ts
|
|
871
|
-
declare const escapeValue: (value: string) => string;
|
|
872
|
-
//#endregion
|
|
873
|
-
//#region src/services/azure/serializeClause.d.ts
|
|
874
|
-
declare const serializeClause: (clause: Clause) => string;
|
|
875
|
-
//#endregion
|
|
876
|
-
//#region src/services/azure/serializeClauses.d.ts
|
|
877
|
-
declare const serializeClauses: (clauses: Clause[]) => string;
|
|
878
|
-
//#endregion
|
|
879
|
-
//#region src/services/azure/serializeValue.d.ts
|
|
880
|
-
declare const serializeValue: (value: SerializableValue) => string;
|
|
881
|
-
//#endregion
|
|
882
|
-
//#region src/services/message/constants.d.ts
|
|
883
|
-
declare const MENTION_MAX_LENGTH = 100;
|
|
831
|
+
//#region src/models/shared/WithMetadata.d.ts
|
|
832
|
+
interface WithMetadata<TBase extends Class<NonNullable<unknown>>> {
|
|
833
|
+
new (...args: ConstructorParameters<TBase>): InstanceType<TBase> & ItemMetadata;
|
|
834
|
+
prototype: InstanceType<TBase> & ItemMetadata;
|
|
835
|
+
}
|
|
884
836
|
//#endregion
|
|
885
837
|
//#region src/services/prettier/css.d.ts
|
|
886
838
|
declare const css: typeof String.raw;
|
|
@@ -889,14 +841,12 @@ declare const css: typeof String.raw;
|
|
|
889
841
|
declare const html: typeof String.raw;
|
|
890
842
|
//#endregion
|
|
891
843
|
//#region src/services/shared/applyItemMetadataMixin.d.ts
|
|
892
|
-
interface WithMetadata<TBase extends Class<NonNullable<unknown>>> {
|
|
893
|
-
new (...args: ConstructorParameters<TBase>): InstanceType<TBase> & ItemMetadata;
|
|
894
|
-
prototype: InstanceType<TBase> & ItemMetadata;
|
|
895
|
-
}
|
|
896
844
|
declare const applyItemMetadataMixin: <TBase extends Class<NonNullable<unknown>>>(Base: TBase) => WithMetadata<TBase>;
|
|
897
845
|
//#endregion
|
|
898
|
-
//#region src/
|
|
899
|
-
declare const
|
|
846
|
+
//#region src/util/environment/constants.d.ts
|
|
847
|
+
declare const IS_PRODUCTION: boolean;
|
|
848
|
+
declare const IS_TEST: boolean;
|
|
849
|
+
declare const IS_DEVELOPMENT: boolean;
|
|
900
850
|
//#endregion
|
|
901
851
|
//#region src/util/environment/getIsServer.d.ts
|
|
902
852
|
declare const getIsServer: () => boolean;
|
|
@@ -910,6 +860,9 @@ declare const getPropertyNames: <T>() => PropertyNames<T>;
|
|
|
910
860
|
//#region src/util/object/isPlainObject.d.ts
|
|
911
861
|
declare const isPlainObject: (data: unknown) => data is object;
|
|
912
862
|
//#endregion
|
|
863
|
+
//#region src/util/object/jsonDateParse.d.ts
|
|
864
|
+
declare const jsonDateParse: (text: string) => any;
|
|
865
|
+
//#endregion
|
|
913
866
|
//#region src/util/types/MergeObjectsStrict.d.ts
|
|
914
867
|
type MergeObjectsStrict<T extends object[]> = T extends [infer TFirst, infer TSecond, ...infer TRemaining] ? TSecond extends { [K in keyof TSecond]: K extends keyof TFirst ? never : TSecond[K] } ? TRemaining extends object[] ? MergeObjectsStrict<[TSecond, ...TRemaining]> & TFirst : TFirst & TSecond : never : T extends [infer TFirst] ? TFirst : never;
|
|
915
868
|
//#endregion
|
|
@@ -922,6 +875,9 @@ declare const getRawData: <T>(data: T) => T;
|
|
|
922
875
|
//#region src/util/reactivity/toRawDeep.d.ts
|
|
923
876
|
declare const toRawDeep: <T extends object>(data: T) => T;
|
|
924
877
|
//#endregion
|
|
878
|
+
//#region src/util/regex/escapeRegExp.d.ts
|
|
879
|
+
declare const escapeRegExp: (string: string) => string;
|
|
880
|
+
//#endregion
|
|
925
881
|
//#region src/util/text/capitalize.d.ts
|
|
926
882
|
declare const capitalize: (string: string) => string;
|
|
927
883
|
//#endregion
|
|
@@ -976,153 +932,6 @@ type TupleSlice<T extends unknown[], S extends number, E extends number = T["len
|
|
|
976
932
|
//#region src/util/validation/exhaustiveGuard.d.ts
|
|
977
933
|
declare const exhaustiveGuard: (value: never) => never;
|
|
978
934
|
//#endregion
|
|
979
|
-
//#region src/models/azure/table/CompositeKey.d.ts
|
|
980
|
-
declare class CompositeKey implements OmitIndexSignature<TableEntity> {
|
|
981
|
-
partitionKey: string;
|
|
982
|
-
rowKey: string;
|
|
983
|
-
}
|
|
984
|
-
declare const CompositeKeyPropertyNames: PropertyNames<CompositeKey>;
|
|
985
|
-
//#endregion
|
|
986
|
-
//#region src/models/azure/table/CompositeKeyEntity.d.ts
|
|
987
|
-
interface CompositeKeyEntityConstraint extends z.ZodRawShape {
|
|
988
|
-
partitionKey: z.ZodString | z.ZodUUID;
|
|
989
|
-
rowKey: z.ZodString | z.ZodUUID;
|
|
990
|
-
}
|
|
991
|
-
declare class CompositeKeyEntity extends Serializable implements CompositeKey {
|
|
992
|
-
partitionKey: string;
|
|
993
|
-
rowKey: string;
|
|
994
|
-
}
|
|
995
|
-
declare const createCompositeKeyEntitySchema: <TEntity extends CompositeKeyEntityConstraint>(schema: z.ZodObject<TEntity>) => z.ZodObject<TEntity>;
|
|
996
|
-
//#endregion
|
|
997
|
-
//#region src/models/azure/table/AzureEntity.d.ts
|
|
998
|
-
declare const AzureEntity: ReturnType<typeof applyItemMetadataMixin<typeof CompositeKeyEntity>>;
|
|
999
|
-
type AzureEntity = typeof AzureEntity.prototype;
|
|
1000
|
-
declare const createAzureEntitySchema: <TEntity extends CompositeKeyEntityConstraint>(schema: z.ZodObject<TEntity>) => z.ZodObject<TEntity & typeof itemMetadataSchema.shape>;
|
|
1001
|
-
//#endregion
|
|
1002
|
-
//#region src/models/azure/table/FileEntity.d.ts
|
|
1003
|
-
declare class FileEntity {
|
|
1004
|
-
filename: string;
|
|
1005
|
-
id: string;
|
|
1006
|
-
mimetype: string;
|
|
1007
|
-
size: number;
|
|
1008
|
-
constructor(init?: Partial<FileEntity>);
|
|
1009
|
-
}
|
|
1010
|
-
declare const FileEntityPropertyNames: PropertyNames<FileEntity>;
|
|
1011
|
-
declare const fileEntitySchema: z.ZodObject<{
|
|
1012
|
-
filename: z.ZodString;
|
|
1013
|
-
id: z.ZodUUID;
|
|
1014
|
-
mimetype: z.ZodString;
|
|
1015
|
-
size: z.ZodNumber;
|
|
1016
|
-
}>;
|
|
1017
|
-
//#endregion
|
|
1018
|
-
//#region src/models/message/filter/FilterType.d.ts
|
|
1019
|
-
declare enum FilterType {
|
|
1020
|
-
From = "From",
|
|
1021
|
-
Mentions = "Mentions",
|
|
1022
|
-
Has = "Has",
|
|
1023
|
-
Before = "Before",
|
|
1024
|
-
During = "During",
|
|
1025
|
-
After = "After",
|
|
1026
|
-
Pinned = "Pinned",
|
|
1027
|
-
}
|
|
1028
|
-
declare const filterTypeSchema: z.ZodType<FilterType>;
|
|
1029
|
-
//#endregion
|
|
1030
|
-
//#region src/models/message/filter/Filter.d.ts
|
|
1031
|
-
interface Filter {
|
|
1032
|
-
type: FilterType;
|
|
1033
|
-
value: SerializableValue;
|
|
1034
|
-
}
|
|
1035
|
-
declare const filterSchema: z.ZodType<Filter>;
|
|
1036
|
-
//#endregion
|
|
1037
|
-
//#region src/models/message/filter/FilterTypeHas.d.ts
|
|
1038
|
-
declare enum FilterTypeHas {
|
|
1039
|
-
Link = "Link",
|
|
1040
|
-
Embed = "Embed",
|
|
1041
|
-
Image = "Image",
|
|
1042
|
-
Video = "Video",
|
|
1043
|
-
Sound = "Sound",
|
|
1044
|
-
Forward = "Forward",
|
|
1045
|
-
}
|
|
1046
|
-
//#endregion
|
|
1047
|
-
//#region src/models/message/webhook/EmbedAuthor.d.ts
|
|
1048
|
-
interface EmbedAuthor {
|
|
1049
|
-
icon_url?: string;
|
|
1050
|
-
name: string;
|
|
1051
|
-
url?: string;
|
|
1052
|
-
}
|
|
1053
|
-
declare const embedAuthorSchema: z.ZodType<EmbedAuthor>;
|
|
1054
|
-
//#endregion
|
|
1055
|
-
//#region src/models/message/webhook/EmbedField.d.ts
|
|
1056
|
-
interface EmbedField {
|
|
1057
|
-
inline?: boolean;
|
|
1058
|
-
name: string;
|
|
1059
|
-
value: string;
|
|
1060
|
-
}
|
|
1061
|
-
declare const embedFieldSchema: z.ZodType<EmbedField>;
|
|
1062
|
-
//#endregion
|
|
1063
|
-
//#region src/models/message/webhook/EmbedFooter.d.ts
|
|
1064
|
-
interface EmbedFooter {
|
|
1065
|
-
icon_url?: string;
|
|
1066
|
-
text: string;
|
|
1067
|
-
}
|
|
1068
|
-
declare const embedFooterSchema: z.ZodType<EmbedFooter>;
|
|
1069
|
-
//#endregion
|
|
1070
|
-
//#region src/models/message/webhook/Embed.d.ts
|
|
1071
|
-
interface Embed {
|
|
1072
|
-
author?: EmbedAuthor;
|
|
1073
|
-
color?: number;
|
|
1074
|
-
description?: string;
|
|
1075
|
-
fields?: EmbedField[];
|
|
1076
|
-
footer?: EmbedFooter;
|
|
1077
|
-
image?: {
|
|
1078
|
-
url: string;
|
|
1079
|
-
};
|
|
1080
|
-
thumbnail?: {
|
|
1081
|
-
url: string;
|
|
1082
|
-
};
|
|
1083
|
-
timestamp?: string;
|
|
1084
|
-
title?: string;
|
|
1085
|
-
url?: string;
|
|
1086
|
-
}
|
|
1087
|
-
declare const embedSchema: z.ZodType<Embed>;
|
|
1088
|
-
//#endregion
|
|
1089
|
-
//#region src/models/message/webhook/WebhookPayload.d.ts
|
|
1090
|
-
interface WebhookPayload {
|
|
1091
|
-
avatarUrl?: string;
|
|
1092
|
-
content?: string;
|
|
1093
|
-
embeds?: Embed[];
|
|
1094
|
-
username?: string;
|
|
1095
|
-
}
|
|
1096
|
-
declare const webhookPayloadSchema: z.ZodType<WebhookPayload>;
|
|
1097
|
-
//#endregion
|
|
1098
|
-
//#region src/services/azure/container/constants.d.ts
|
|
1099
|
-
declare const FILENAME_MAX_LENGTH = 1e3;
|
|
1100
|
-
declare const FILE_MAX_LENGTH = 10;
|
|
1101
|
-
//#endregion
|
|
1102
|
-
//#region src/services/azure/search/getSearchNonNullClause.d.ts
|
|
1103
|
-
declare const getSearchNonNullClause: (key: Clause["key"]) => Clause;
|
|
1104
|
-
//#endregion
|
|
1105
|
-
//#region src/services/azure/search/getSearchNullClause.d.ts
|
|
1106
|
-
declare const getSearchNullClause: (key: Clause["key"]) => Clause;
|
|
1107
|
-
//#endregion
|
|
1108
|
-
//#region src/services/azure/table/constants.d.ts
|
|
1109
|
-
declare const AZURE_SELF_DESTRUCT_TIMER: string;
|
|
1110
|
-
declare const AZURE_SELF_DESTRUCT_TIMER_SMALL: string;
|
|
1111
|
-
declare const KeysToCapitalize: Set<string>;
|
|
1112
|
-
declare const KeysToUncapitalize: Set<string>;
|
|
1113
|
-
//#endregion
|
|
1114
|
-
//#region src/services/azure/table/deserializeKey.d.ts
|
|
1115
|
-
declare const deserializeKey: (key: string) => string;
|
|
1116
|
-
//#endregion
|
|
1117
|
-
//#region src/services/azure/table/getReverseTickedTimestamp.d.ts
|
|
1118
|
-
declare const getReverseTickedTimestamp: (timestamp?: string) => string;
|
|
1119
|
-
//#endregion
|
|
1120
|
-
//#region src/services/azure/table/getTableNullClause.d.ts
|
|
1121
|
-
declare const getTableNullClause: (key: Clause["key"]) => Clause;
|
|
1122
|
-
//#endregion
|
|
1123
|
-
//#region src/services/azure/table/serializeKey.d.ts
|
|
1124
|
-
declare const serializeKey: (key: string) => string;
|
|
1125
|
-
//#endregion
|
|
1126
935
|
//#region src/util/id/uuid/constants.d.ts
|
|
1127
936
|
declare const NIL = "00000000-0000-0000-0000-000000000000";
|
|
1128
937
|
declare const UUIDV4_REGEX: RegExp;
|
|
@@ -1130,4 +939,4 @@ declare const UUIDV4_REGEX: RegExp;
|
|
|
1130
939
|
//#region src/util/id/uuid/uuidValidateV4.d.ts
|
|
1131
940
|
declare const uuidValidateV4: (uuid: string) => boolean;
|
|
1132
941
|
//#endregion
|
|
1133
|
-
export {
|
|
942
|
+
export { CamelToKebab, DeepOmit, DeepOmitArray, DeepOptionalProperties, DeepOptionalUndefined, DeepRequiredProperties, Environment, ExcludeFunctionProperties, FunctionProperties, ID_SEPARATOR, IS_DEVELOPMENT, IS_PRODUCTION, IS_TEST, InvalidOperationError, ItemEntityType, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, KebabToCamel, MapValue, MergeObjectsStrict, NIL, NotFoundError, NotInitializedError, Operation, PropertyNames, Serializable, SkipFirst, TakeFirst, ToData, TupleSlice, TupleSplit, TupleSplitHead, TupleSplitTail, UUIDV4_REGEX, WithMetadata, applyItemMetadataMixin, capitalize, createItemEntityTypeSchema, css, escapeRegExp, exhaustiveGuard, getIsServer, getPropertyNames, getRawData, hrtime, html, isPlainObject, itemMetadataSchema, jsonDateParse, mergeObjectsStrict, now, streamToText, toKebabCase, toRawDeep, uncapitalize, uuidValidateV4 };
|