@esposter/shared 2.40.0 → 3.2.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/LICENSE +201 -201
- package/dist/index.d.ts +111 -143
- package/dist/index.js +12 -68
- package/package.json +9 -9
package/LICENSE
CHANGED
|
@@ -1,201 +1,201 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright 2020-present Jimmy Chen
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2020-present Jimmy Chen
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/dist/index.d.ts
CHANGED
|
@@ -43,19 +43,17 @@ export declare class WordFilteredError extends Error {
|
|
|
43
43
|
constructor(message: string);
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
|
-
//#region src/models/message/ClassifiedMentions.d.ts
|
|
47
|
-
export interface ClassifiedMentions {
|
|
48
|
-
broadcastIds: string[];
|
|
49
|
-
regularUserIds: string[];
|
|
50
|
-
roleIds: string[];
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
53
46
|
//#region src/models/message/MentionType.d.ts
|
|
54
47
|
export declare enum MentionType {
|
|
55
48
|
Role = "role",
|
|
56
49
|
User = "user"
|
|
57
50
|
}
|
|
58
51
|
//#endregion
|
|
52
|
+
//#region src/models/reactivity/MaybeReactive.d.ts
|
|
53
|
+
export interface MaybeReactive {
|
|
54
|
+
__v_raw?: unknown;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
59
57
|
//#region src/models/router/RoutePath.d.ts
|
|
60
58
|
export declare const RoutePath: {
|
|
61
59
|
readonly About: "/about";
|
|
@@ -97,46 +95,10 @@ export declare const RoutePath: {
|
|
|
97
95
|
};
|
|
98
96
|
export type RoutePath = typeof RoutePath;
|
|
99
97
|
//#endregion
|
|
100
|
-
//#region src/util/types/GetArrayProps.d.ts
|
|
101
|
-
export type GetArrayProps<T extends unknown[], P extends string, D extends unknown[], R extends boolean> = (D extends [unknown, ...infer Rest] ? GetProperties<T[number], R extends true ? `${P}[number]` : `${P}.[number]`, Rest, false> : never) | {
|
|
102
|
-
path: R extends true ? "length" : `${P}.length`;
|
|
103
|
-
value: T["length"];
|
|
104
|
-
};
|
|
105
|
-
//#endregion
|
|
106
|
-
//#region src/util/types/KnownKeys.d.ts
|
|
107
|
-
export type KnownKeys<T> = { [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K]; };
|
|
108
|
-
//#endregion
|
|
109
|
-
//#region src/util/types/GetObjectProps.d.ts
|
|
110
|
-
export type GetObjectProps<T, P extends string, D extends unknown[], R extends boolean> = { [K in keyof KnownKeys<T> & (number | string)]: K extends `${number}` ? never : NonNullable<T[K]> extends Function ? never : (D extends [unknown, ...infer Rest] ? GetProperties<T[K], R extends true ? `${K}` : `${P}.${K}`, Rest, false> : never) | {
|
|
111
|
-
path: R extends true ? `${K}` : `${P}.${K}`;
|
|
112
|
-
value: T[K];
|
|
113
|
-
}; }[keyof KnownKeys<T> & (number | string)];
|
|
114
|
-
//#endregion
|
|
115
|
-
//#region src/util/types/GetPrimitiveProps.d.ts
|
|
116
|
-
export type GetPrimitiveProps<T, P extends string, D extends unknown[], R extends boolean> = T extends string ? {
|
|
117
|
-
path: R extends true ? "length" : `${P}.length`;
|
|
118
|
-
value: number;
|
|
119
|
-
} : T extends symbol ? (D extends [unknown, ...infer Rest] ? GetProperties<string | undefined, R extends true ? "description" : `${P}.description`, Rest, false> : never) | {
|
|
120
|
-
path: R extends true ? "description" : `${P}.description`;
|
|
121
|
-
value: string | undefined;
|
|
122
|
-
} : never;
|
|
123
|
-
//#endregion
|
|
124
|
-
//#region src/util/types/GetProperties.d.ts
|
|
125
|
-
export type GetProperties<T, P extends string = "", D extends unknown[] = [unknown, unknown, unknown, unknown, unknown], R extends boolean = true> = [T] extends [never] ? never : D extends [] ? never : NonNullable<T> extends (infer O) ? O extends unknown[] ? GetArrayProps<O, P, D, R> : O extends object ? GetObjectProps<O, P, D, R> : GetPrimitiveProps<O, P, D, R> : never;
|
|
126
|
-
//#endregion
|
|
127
|
-
//#region src/util/types/GetPaths.d.ts
|
|
128
|
-
export type GetPaths<T> = GetProperties<T> extends (infer U) ? (U extends {
|
|
129
|
-
path: infer Path;
|
|
130
|
-
} ? Path : never) : never;
|
|
131
|
-
//#endregion
|
|
132
|
-
//#region src/util/types/PropertyNames.d.ts
|
|
133
|
-
export type PropertyNames<T> = { [P in GetPaths<T>]: P; };
|
|
134
|
-
//#endregion
|
|
135
98
|
//#region src/models/shared/ItemEntityType.d.ts
|
|
136
99
|
export interface ItemEntityType<T extends string> {
|
|
137
100
|
type: T;
|
|
138
101
|
}
|
|
139
|
-
export declare const ItemEntityTypePropertyNames: PropertyNames<ItemEntityType<string>>;
|
|
140
102
|
export declare const createItemEntityTypeSchema: <T extends z.ZodType<string>>(schema: T) => z.ZodObject<{
|
|
141
103
|
type: T;
|
|
142
104
|
}>;
|
|
@@ -147,25 +109,8 @@ export declare class ItemMetadata {
|
|
|
147
109
|
deletedAt: Date | null;
|
|
148
110
|
updatedAt: Date;
|
|
149
111
|
}
|
|
150
|
-
export declare const ItemMetadataPropertyNames: PropertyNames<ItemMetadata>;
|
|
151
|
-
export declare const itemMetadataSchema: z.ZodObject<{
|
|
152
|
-
createdAt: z.ZodDate;
|
|
153
|
-
deletedAt: z.ZodNullable<z.ZodDate>;
|
|
154
|
-
updatedAt: z.ZodDate;
|
|
155
|
-
}>;
|
|
156
|
-
//#endregion
|
|
157
|
-
//#region src/models/shared/Serializable.d.ts
|
|
158
|
-
export declare abstract class Serializable {
|
|
159
|
-
toJSON(): this;
|
|
160
|
-
}
|
|
161
|
-
//#endregion
|
|
162
|
-
//#region src/models/shared/TakeOne.d.ts
|
|
163
|
-
export interface TakeOne {
|
|
164
|
-
<T extends readonly unknown[]>(values: T, index?: number): T[number];
|
|
165
|
-
<T extends object>(values: T, index: keyof T): T[keyof T];
|
|
166
|
-
}
|
|
167
112
|
//#endregion
|
|
168
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
113
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/primitive.d.ts
|
|
169
114
|
/**
|
|
170
115
|
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
171
116
|
|
|
@@ -173,7 +118,7 @@ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/
|
|
|
173
118
|
*/
|
|
174
119
|
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
175
120
|
//#endregion
|
|
176
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
121
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/basic.d.ts
|
|
177
122
|
/**
|
|
178
123
|
Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
|
|
179
124
|
|
|
@@ -184,7 +129,7 @@ type Class<T, Arguments extends unknown[] = any[]> = {
|
|
|
184
129
|
new (...arguments_: Arguments): T;
|
|
185
130
|
};
|
|
186
131
|
//#endregion
|
|
187
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
132
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/union-to-intersection.d.ts
|
|
188
133
|
/**
|
|
189
134
|
Convert a union type to an intersection type.
|
|
190
135
|
|
|
@@ -218,7 +163,7 @@ never
|
|
|
218
163
|
// The `& Union` is to ensure result of `UnionToIntersection<A | B>` is always assignable to `A | B`
|
|
219
164
|
Intersection & Union : never;
|
|
220
165
|
//#endregion
|
|
221
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
166
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/keys-of-union.d.ts
|
|
222
167
|
/**
|
|
223
168
|
Create a union of all keys from a given type, even those exclusive to specific union members.
|
|
224
169
|
|
|
@@ -260,7 +205,7 @@ type KeysOfUnion<ObjectType> =
|
|
|
260
205
|
// Hack to fix https://github.com/sindresorhus/type-fest/issues/1008
|
|
261
206
|
keyof UnionToIntersection<ObjectType extends unknown ? Record<keyof ObjectType, never> : never>;
|
|
262
207
|
//#endregion
|
|
263
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
208
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-any.d.ts
|
|
264
209
|
/**
|
|
265
210
|
Returns a boolean for whether the given type is `any`.
|
|
266
211
|
|
|
@@ -291,7 +236,7 @@ const anyA = get(anyObject, 'a');
|
|
|
291
236
|
*/
|
|
292
237
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
293
238
|
//#endregion
|
|
294
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
239
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
295
240
|
/**
|
|
296
241
|
Returns a boolean for whether the given key is an optional key of type.
|
|
297
242
|
|
|
@@ -334,7 +279,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
334
279
|
*/
|
|
335
280
|
type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false;
|
|
336
281
|
//#endregion
|
|
337
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
282
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
338
283
|
/**
|
|
339
284
|
Extract all optional keys from the given type.
|
|
340
285
|
|
|
@@ -372,7 +317,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
372
317
|
? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never; }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
|
|
373
318
|
: never; // Should never happen
|
|
374
319
|
//#endregion
|
|
375
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
320
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
376
321
|
/**
|
|
377
322
|
Extract all required keys from the given type.
|
|
378
323
|
|
|
@@ -406,7 +351,7 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
|
406
351
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
407
352
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never; // Should never happen
|
|
408
353
|
//#endregion
|
|
409
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
354
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-never.d.ts
|
|
410
355
|
/**
|
|
411
356
|
Returns a boolean for whether the given type is `never`.
|
|
412
357
|
|
|
@@ -462,7 +407,7 @@ type B = IsTrueFixed<never>;
|
|
|
462
407
|
*/
|
|
463
408
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
464
409
|
//#endregion
|
|
465
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
410
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/if.d.ts
|
|
466
411
|
/**
|
|
467
412
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
468
413
|
|
|
@@ -557,7 +502,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
|
557
502
|
*/
|
|
558
503
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
559
504
|
//#endregion
|
|
560
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
505
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/unknown-array.d.ts
|
|
561
506
|
/**
|
|
562
507
|
Represents an array with `unknown` value.
|
|
563
508
|
|
|
@@ -584,7 +529,7 @@ type C = IsArray<string>;
|
|
|
584
529
|
*/
|
|
585
530
|
type UnknownArray = readonly unknown[];
|
|
586
531
|
//#endregion
|
|
587
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
532
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/internal/type.d.ts
|
|
588
533
|
/**
|
|
589
534
|
Returns a boolean for whether A is false.
|
|
590
535
|
|
|
@@ -652,7 +597,7 @@ Indicates the value of `exactOptionalPropertyTypes` compiler option.
|
|
|
652
597
|
*/
|
|
653
598
|
type IsExactOptionalPropertyTypesEnabled = [(string | undefined)?] extends [string?] ? false : true;
|
|
654
599
|
//#endregion
|
|
655
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
600
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/internal/array.d.ts
|
|
656
601
|
/**
|
|
657
602
|
Transforms a tuple type by replacing it's rest element with a single element that has the same type as the rest element, while keeping all the non-rest elements intact.
|
|
658
603
|
|
|
@@ -688,16 +633,20 @@ type CollapseRestElement<TArray extends UnknownArray> = IfNotAnyOrNever<TArray,
|
|
|
688
633
|
ifNot: _CollapseRestElement<TArray>;
|
|
689
634
|
}>;
|
|
690
635
|
type _CollapseRestElement<TArray extends UnknownArray, ForwardAccumulator extends UnknownArray = [], BackwardAccumulator extends UnknownArray = []> = TArray extends UnknownArray // For distributing `TArray`
|
|
691
|
-
? keyof TArray
|
|
636
|
+
? '0' extends keyof TArray ?
|
|
637
|
+
// Enters this branch, if `TArray` starts with a non-rest element (e.g., `[string, number]` or `[string, ...number[]]`).
|
|
638
|
+
TArray extends readonly [(infer First)?, ...infer Rest] ? _CollapseRestElement<Rest, [...ForwardAccumulator,
|
|
639
|
+
// A tuple allows fewer than one element only when its first element is optional. Written in exactly this shape because equivalent ones, such as `[] extends TArray`, are several times slower.
|
|
640
|
+
TArray extends readonly [unknown, ...unknown[]] ? First : If<IsExactOptionalPropertyTypesEnabled, First, First | undefined> // Add `| undefined` for optional elements, if `exactOptionalPropertyTypes` is disabled.
|
|
641
|
+
], BackwardAccumulator> : never // Should never happen, since `[(infer First)?, ...infer Rest]` is a top-type for arrays.
|
|
642
|
+
:
|
|
692
643
|
// Enters this branch, if `TArray` is empty (e.g., []),
|
|
693
644
|
// or `TArray` contains no non-rest elements preceding the rest element (e.g., `[...string[]]` or `[...string[], string]`).
|
|
694
645
|
TArray extends readonly [...infer Rest, infer Last] ? _CollapseRestElement<Rest, ForwardAccumulator, [Last, ...BackwardAccumulator]> // Accumulate elements that are present after the rest element.
|
|
695
646
|
: TArray extends readonly [] ? [...ForwardAccumulator, ...BackwardAccumulator] : [...ForwardAccumulator, TArray[number], ...BackwardAccumulator] // Add the rest element between the accumulated elements.
|
|
696
|
-
: TArray extends readonly [(infer First)?, ...infer Rest] ? _CollapseRestElement<Rest, [...ForwardAccumulator, '0' extends OptionalKeysOf<TArray> ? If<IsExactOptionalPropertyTypesEnabled, First, First | undefined> // Add `| undefined` for optional elements, if `exactOptionalPropertyTypes` is disabled.
|
|
697
|
-
: First], BackwardAccumulator> : never // Should never happen, since `[(infer First)?, ...infer Rest]` is a top-type for arrays.
|
|
698
647
|
: never; // Should never happen
|
|
699
648
|
//#endregion
|
|
700
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
649
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/internal/characters.d.ts
|
|
701
650
|
type Whitespace = '\t' // '\t'
|
|
702
651
|
| '\n' // '\n'
|
|
703
652
|
| '\v' // '\v'
|
|
@@ -708,7 +657,7 @@ type Whitespace = '\t' // '\t'
|
|
|
708
657
|
type WordSeparators = '-' | '_' | Whitespace;
|
|
709
658
|
type AsciiPunctuation = '!' | '"' | '#' | '$' | '%' | '&' | '\'' | '(' | ')' | '*' | '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' | '=' | '>' | '?' | '@' | '[' | '\\' | ']' | '^' | '_' | '`' | '{' | '|' | '}' | '~';
|
|
710
659
|
//#endregion
|
|
711
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
660
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/simplify.d.ts
|
|
712
661
|
/**
|
|
713
662
|
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
|
714
663
|
|
|
@@ -769,7 +718,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
769
718
|
*/
|
|
770
719
|
type Simplify<T> = { [KeyType in keyof T]: T[KeyType]; } & {};
|
|
771
720
|
//#endregion
|
|
772
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
721
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-equal.d.ts
|
|
773
722
|
/**
|
|
774
723
|
Returns a boolean for whether the two given types are equal.
|
|
775
724
|
|
|
@@ -800,7 +749,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
|
|
|
800
749
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
801
750
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
802
751
|
//#endregion
|
|
803
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
752
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
804
753
|
/**
|
|
805
754
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
806
755
|
|
|
@@ -894,7 +843,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
894
843
|
*/
|
|
895
844
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType]; };
|
|
896
845
|
//#endregion
|
|
897
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
846
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
898
847
|
/**
|
|
899
848
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
900
849
|
|
|
@@ -942,7 +891,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
942
891
|
*/
|
|
943
892
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType]; };
|
|
944
893
|
//#endregion
|
|
945
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
894
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/merge.d.ts
|
|
946
895
|
// Merges two objects without worrying about index signatures.
|
|
947
896
|
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key]; } & Source>;
|
|
948
897
|
/**
|
|
@@ -1013,7 +962,7 @@ type Merge<Destination, Source> = Destination extends unknown // For distributin
|
|
|
1013
962
|
: never; // Should never happen
|
|
1014
963
|
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
1015
964
|
//#endregion
|
|
1016
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
965
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/trim.d.ts
|
|
1017
966
|
/**
|
|
1018
967
|
Remove spaces from the left side.
|
|
1019
968
|
*/
|
|
@@ -1038,7 +987,7 @@ type Example = Trim<' foo '>;
|
|
|
1038
987
|
*/
|
|
1039
988
|
type Trim<V extends string> = TrimLeft<TrimRight<V>>;
|
|
1040
989
|
//#endregion
|
|
1041
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
990
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/some-extend.d.ts
|
|
1042
991
|
/**
|
|
1043
992
|
@see {@link SomeExtend}
|
|
1044
993
|
*/
|
|
@@ -1125,16 +1074,17 @@ type B = SomeExtend<[1?, 2?, '3'?], string | undefined>;
|
|
|
1125
1074
|
@category Utilities
|
|
1126
1075
|
@category Array
|
|
1127
1076
|
*/
|
|
1128
|
-
type SomeExtend<TArray extends UnknownArray, Type, Options extends SomeExtendOptions = {}> =
|
|
1129
|
-
|
|
1130
|
-
ifNot: TArray extends readonly [infer First, ...infer Rest] ? IsNever<First> extends true ? Or<Or<IsNever<Type>, IsAny<Type>>, Not<Options['strictNever']>> extends true ?
|
|
1131
|
-
// If target `Type` is also `never`, or is `any`, or `strictNever` is disabled, return `true`.
|
|
1132
|
-
true : _SomeExtend<Rest, Type, Options> : First extends Type ? true : _SomeExtend<Rest, Type, Options> : false;
|
|
1077
|
+
type SomeExtend<TArray extends UnknownArray, Type, Options extends SomeExtendOptions = {}> = IfNotAnyOrNever<CollapseRestElement<TArray>, {
|
|
1078
|
+
ifNot: _SomeExtend<CollapseRestElement<TArray>, Type, ApplyDefaultOptions<SomeExtendOptions, DefaultSomeExtendOptions, Options>>;
|
|
1133
1079
|
ifAny: false;
|
|
1134
1080
|
ifNever: false;
|
|
1135
1081
|
}>;
|
|
1082
|
+
// Kept free of `IfNotAnyOrNever` so that it stays tail-recursive, which allows it to handle long arrays.
|
|
1083
|
+
type _SomeExtend<TArray extends UnknownArray, Type, Options extends Required<SomeExtendOptions>> = TArray extends readonly [infer First, ...infer Rest] ? IsNever<First> extends true ? Or<Or<IsNever<Type>, IsAny<Type>>, Not<Options['strictNever']>> extends true ?
|
|
1084
|
+
// If target `Type` is also `never`, or is `any`, or `strictNever` is disabled, return `true`.
|
|
1085
|
+
true : _SomeExtend<Rest, Type, Options> : First extends Type ? true : _SomeExtend<Rest, Type, Options> : false;
|
|
1136
1086
|
//#endregion
|
|
1137
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1087
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/or-all.d.ts
|
|
1138
1088
|
/**
|
|
1139
1089
|
Returns a boolean for whether any of the given elements is `true`.
|
|
1140
1090
|
|
|
@@ -1205,7 +1155,7 @@ Note: `OrAll<[]>` evaluates to `false` because there are no `true` elements in a
|
|
|
1205
1155
|
*/
|
|
1206
1156
|
type OrAll<T extends readonly boolean[]> = SomeExtend<T, true>;
|
|
1207
1157
|
//#endregion
|
|
1208
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1158
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/or.d.ts
|
|
1209
1159
|
/**
|
|
1210
1160
|
Returns a boolean for whether either of two given types is `true`.
|
|
1211
1161
|
|
|
@@ -1285,7 +1235,7 @@ type G = Or<never, never>;
|
|
|
1285
1235
|
*/
|
|
1286
1236
|
type Or<A extends boolean, B extends boolean> = OrAll<[A, B]>;
|
|
1287
1237
|
//#endregion
|
|
1288
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1238
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/internal/string.d.ts
|
|
1289
1239
|
/**
|
|
1290
1240
|
Returns a boolean for whether the given string `S` starts with the given string `SearchString`.
|
|
1291
1241
|
|
|
@@ -1315,7 +1265,7 @@ This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/mi
|
|
|
1315
1265
|
*/
|
|
1316
1266
|
type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
|
|
1317
1267
|
//#endregion
|
|
1318
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1268
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/internal/object.d.ts
|
|
1319
1269
|
/**
|
|
1320
1270
|
Merges user specified options with default options.
|
|
1321
1271
|
|
|
@@ -1424,7 +1374,7 @@ type UnwrapBrand<T> = IfNotAnyOrNever<T, {
|
|
|
1424
1374
|
}>;
|
|
1425
1375
|
type _UnwrapBrand<T, Base> = T extends Primitive ? T extends (infer U) & Pick<T, Exclude<keyof T, KeysOfUnion<Base>>> ? U : T : T;
|
|
1426
1376
|
//#endregion
|
|
1427
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1377
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-string-literal.d.ts
|
|
1428
1378
|
/**
|
|
1429
1379
|
Returns a boolean for whether the given type is a `string` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
|
|
1430
1380
|
|
|
@@ -1488,7 +1438,7 @@ type _IsStringLiteral<S> =
|
|
|
1488
1438
|
// and since `{}` extends index signatures, the result becomes `false`.
|
|
1489
1439
|
S extends string ? {} extends Record<S, never> ? false : true : false;
|
|
1490
1440
|
//#endregion
|
|
1491
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1441
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/all-extend.d.ts
|
|
1492
1442
|
/**
|
|
1493
1443
|
@see {@link AllExtend}
|
|
1494
1444
|
*/
|
|
@@ -1581,16 +1531,17 @@ type B = AllExtend<[1?, 2?, 3?], number | undefined>;
|
|
|
1581
1531
|
@category Utilities
|
|
1582
1532
|
@category Array
|
|
1583
1533
|
*/
|
|
1584
|
-
type AllExtend<TArray extends UnknownArray, Type, Options extends AllExtendOptions = {}> =
|
|
1585
|
-
|
|
1586
|
-
ifNot: TArray extends readonly [infer First, ...infer Rest] ? IsNever<First> extends true ? Or<Or<IsNever<Type>, IsAny<Type>>, Not<Options['strictNever']>> extends true ?
|
|
1587
|
-
// If target `Type` is also `never`, or is `any`, or `strictNever` is disabled, recurse further.
|
|
1588
|
-
_AllExtend<Rest, Type, Options> : false : First extends Type ? _AllExtend<Rest, Type, Options> : false : true;
|
|
1534
|
+
type AllExtend<TArray extends UnknownArray, Type, Options extends AllExtendOptions = {}> = IfNotAnyOrNever<CollapseRestElement<TArray>, {
|
|
1535
|
+
ifNot: _AllExtend<CollapseRestElement<TArray>, Type, ApplyDefaultOptions<AllExtendOptions, DefaultAllExtendOptions, Options>>;
|
|
1589
1536
|
ifAny: false;
|
|
1590
1537
|
ifNever: false;
|
|
1591
1538
|
}>;
|
|
1539
|
+
// Kept free of `IfNotAnyOrNever` so that it stays tail-recursive, which allows it to handle long arrays.
|
|
1540
|
+
type _AllExtend<TArray extends UnknownArray, Type, Options extends Required<AllExtendOptions>> = TArray extends readonly [infer First, ...infer Rest] ? IsNever<First> extends true ? Or<Or<IsNever<Type>, IsAny<Type>>, Not<Options['strictNever']>> extends true ?
|
|
1541
|
+
// If target `Type` is also `never`, or is `any`, or `strictNever` is disabled, recurse further.
|
|
1542
|
+
_AllExtend<Rest, Type, Options> : false : First extends Type ? _AllExtend<Rest, Type, Options> : false : true;
|
|
1592
1543
|
//#endregion
|
|
1593
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1544
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/except.d.ts
|
|
1594
1545
|
/**
|
|
1595
1546
|
Filter out keys from an object.
|
|
1596
1547
|
|
|
@@ -1690,7 +1641,7 @@ type PostPayloadFixed = Except<UserData, 'email'>;
|
|
|
1690
1641
|
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
|
|
1691
1642
|
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>> : {});
|
|
1692
1643
|
//#endregion
|
|
1693
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1644
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/promisable.d.ts
|
|
1694
1645
|
/**
|
|
1695
1646
|
Create a type that represents either the value or the value wrapped in `PromiseLike`.
|
|
1696
1647
|
|
|
@@ -1717,7 +1668,7 @@ await logger(() => Promise.resolve('bar'));
|
|
|
1717
1668
|
*/
|
|
1718
1669
|
type Promisable<T> = T | PromiseLike<T>;
|
|
1719
1670
|
//#endregion
|
|
1720
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1671
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-lowercase.d.ts
|
|
1721
1672
|
/**
|
|
1722
1673
|
Returns a boolean for whether the given string literal is lowercase.
|
|
1723
1674
|
|
|
@@ -1745,7 +1696,7 @@ Returns a boolean for whether an individual part of the string is lowercase.
|
|
|
1745
1696
|
*/
|
|
1746
1697
|
type IsLowercaseHelper<S extends string> = S extends Lowercase<string> ? true : S extends Uppercase<string> | Capitalize<string> | `${string}${Uppercase<string>}${string}` ? false : boolean;
|
|
1747
1698
|
//#endregion
|
|
1748
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1699
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-uppercase.d.ts
|
|
1749
1700
|
/**
|
|
1750
1701
|
Returns a boolean for whether the given string literal is uppercase.
|
|
1751
1702
|
|
|
@@ -1773,7 +1724,7 @@ Returns a boolean for whether an individual part of the string is uppercase.
|
|
|
1773
1724
|
*/
|
|
1774
1725
|
type IsUppercaseHelper<S extends string> = S extends Uppercase<string> ? true : S extends Lowercase<string> | Uncapitalize<string> | `${string}${Lowercase<string>}${string}` ? false : boolean;
|
|
1775
1726
|
//#endregion
|
|
1776
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1727
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/words.d.ts
|
|
1777
1728
|
type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
|
|
1778
1729
|
type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
|
|
1779
1730
|
/**
|
|
@@ -1889,7 +1840,7 @@ WordsImplementation<RemainingCharacters, Options, FirstCharacter, `${CurrentWord
|
|
|
1889
1840
|
// No case change: concat word
|
|
1890
1841
|
WordsImplementation<RemainingCharacters, Options, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [...SkipEmptyWord<CurrentWord>];
|
|
1891
1842
|
//#endregion
|
|
1892
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1843
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/delimiter-case.d.ts
|
|
1893
1844
|
type _DefaultDelimiterCaseOptions = Merge<_DefaultWordsOptions, {
|
|
1894
1845
|
splitOnNumbers: false;
|
|
1895
1846
|
}>;
|
|
@@ -1940,7 +1891,7 @@ const rawCliOptions: OddlyCasedProperties<SomeOptions> = {
|
|
|
1940
1891
|
type DelimiterCase<Value, Delimiter extends string, Options extends WordsOptions = {}> = Value extends string ? Delimiter extends string // For distributing `Delimiter`
|
|
1941
1892
|
? IsStringLiteral<Value> extends false ? Value : Lowercase<DelimiterCaseFromArray<Words<Value, ApplyDefaultOptions<WordsOptions, _DefaultDelimiterCaseOptions, Options>>, Delimiter>> : never : Value;
|
|
1942
1893
|
//#endregion
|
|
1943
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
1894
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/kebab-case.d.ts
|
|
1944
1895
|
/**
|
|
1945
1896
|
Convert a string literal to kebab-case.
|
|
1946
1897
|
|
|
@@ -1980,6 +1931,23 @@ const rawCliOptions: KebabCasedProperties<CliOptions> = {
|
|
|
1980
1931
|
*/
|
|
1981
1932
|
type KebabCase<Value, Options extends WordsOptions = {}> = DelimiterCase<Value, '-', ApplyDefaultOptions<WordsOptions, _DefaultDelimiterCaseOptions, Options>>;
|
|
1982
1933
|
//#endregion
|
|
1934
|
+
//#region src/models/shared/ItemMetadataClass.d.ts
|
|
1935
|
+
export interface ItemMetadataClass<TBase extends Class<NonNullable<unknown>>> {
|
|
1936
|
+
new (...args: ConstructorParameters<TBase>): InstanceType<TBase> & ItemMetadata;
|
|
1937
|
+
prototype: InstanceType<TBase> & ItemMetadata;
|
|
1938
|
+
}
|
|
1939
|
+
//#endregion
|
|
1940
|
+
//#region src/models/shared/Serializable.d.ts
|
|
1941
|
+
export declare abstract class Serializable {
|
|
1942
|
+
toJSON(): this;
|
|
1943
|
+
}
|
|
1944
|
+
//#endregion
|
|
1945
|
+
//#region src/models/shared/TakeOne.d.ts
|
|
1946
|
+
export interface TakeOne {
|
|
1947
|
+
<T extends readonly unknown[]>(values: T, index?: number): T[number];
|
|
1948
|
+
<T extends object>(values: T, index: keyof T): T[keyof T];
|
|
1949
|
+
}
|
|
1950
|
+
//#endregion
|
|
1983
1951
|
//#region src/util/types/DeepOmit.d.ts
|
|
1984
1952
|
export type DeepOmit<T, TKey extends PropertyKey> = [T] extends [Date | Function | Primitive] ? T : [Record<string, unknown>] extends [T] ? T : T extends object ? T extends unknown[] ? T extends readonly unknown[] ? { [K in keyof T]: DeepOmit<T[K], TKey>; } : DeepOmit<T[number], TKey>[] : { [P in keyof T as P extends TKey ? never : P]: DeepOmit<T[P], TKey>; } : T;
|
|
1985
1953
|
//#endregion
|
|
@@ -1989,12 +1957,6 @@ export type DeepOptionalUndefined<T> = T extends Date | Function | Primitive ? T
|
|
|
1989
1957
|
//#region src/models/shared/ToData.d.ts
|
|
1990
1958
|
export type ToData<T> = DeepOptionalUndefined<DeepOmit<T, "toJSON">>;
|
|
1991
1959
|
//#endregion
|
|
1992
|
-
//#region src/models/shared/WithMetadata.d.ts
|
|
1993
|
-
export interface WithMetadata<TBase extends Class<NonNullable<unknown>>> {
|
|
1994
|
-
new (...args: ConstructorParameters<TBase>): InstanceType<TBase> & ItemMetadata;
|
|
1995
|
-
prototype: InstanceType<TBase> & ItemMetadata;
|
|
1996
|
-
}
|
|
1997
|
-
//#endregion
|
|
1998
1960
|
//#region src/models/zod/UniqueArraySchemaKey.d.ts
|
|
1999
1961
|
export type UniqueArraySchemaKey<TSchema extends z.ZodType> = TSchema extends z.ZodObject ? keyof TSchema["shape"] & string : keyof z.output<TSchema> & string;
|
|
2000
1962
|
//#endregion
|
|
@@ -2007,9 +1969,6 @@ export declare const SITE_NAME = "Esposter";
|
|
|
2007
1969
|
export declare const KIBIBYTE: number;
|
|
2008
1970
|
export declare const GIBIBYTE: number;
|
|
2009
1971
|
//#endregion
|
|
2010
|
-
//#region src/services/error/createExponentialBackoff.d.ts
|
|
2011
|
-
export declare const createExponentialBackoff: (baseDelayMs: number, maxDelayMs: number) => (<T>(operation: () => Promise<T>) => Promise<T>);
|
|
2012
|
-
//#endregion
|
|
2013
1972
|
//#region src/services/error/getResult.d.ts
|
|
2014
1973
|
export declare const getResult: <T>(fn: () => T) => Result<T, Error>;
|
|
2015
1974
|
//#endregion
|
|
@@ -2025,9 +1984,6 @@ export declare const withFinalizer: <T>(fn: () => T, finalizer?: () => void) =>
|
|
|
2025
1984
|
//#region src/services/error/withFinalizerAsync.d.ts
|
|
2026
1985
|
export declare const withFinalizerAsync: <T>(fn: () => Promisable<T>, finalizer?: () => Promisable<void>) => Promise<T>;
|
|
2027
1986
|
//#endregion
|
|
2028
|
-
//#region src/services/message/classifyMentions.d.ts
|
|
2029
|
-
export declare const classifyMentions: (message: string) => ClassifiedMentions;
|
|
2030
|
-
//#endregion
|
|
2031
1987
|
//#region src/services/message/constants.d.ts
|
|
2032
1988
|
export declare const MENTION_ID_ATTRIBUTE = "data-id";
|
|
2033
1989
|
export declare const MENTION_ITEM_TYPE_ATTRIBUTE = "data-mention-type";
|
|
@@ -2039,7 +1995,6 @@ export declare const MENTION_HERE_ID = "@here";
|
|
|
2039
1995
|
export declare const MENTION_EVERYONE_ID = "@everyone";
|
|
2040
1996
|
export declare const CUSTOM_EMOJI_ID_ATTRIBUTE = "data-custom-emoji-id";
|
|
2041
1997
|
export declare const CUSTOM_EMOJI_NAME_ATTRIBUTE = "data-custom-emoji-name";
|
|
2042
|
-
export declare const CUSTOM_EMOJI_TYPE = "customEmoji";
|
|
2043
1998
|
//#endregion
|
|
2044
1999
|
//#region src/services/message/getMentions.d.ts
|
|
2045
2000
|
export declare const getMentions: (message: string) => HTMLElement[];
|
|
@@ -2057,7 +2012,7 @@ export declare const sanitizeHtml: (...[html, options]: Parameters<typeof baseSa
|
|
|
2057
2012
|
export declare const sanitizeTextHtml: (html: string) => string;
|
|
2058
2013
|
//#endregion
|
|
2059
2014
|
//#region src/services/shared/applyItemMetadataMixin.d.ts
|
|
2060
|
-
export declare const applyItemMetadataMixin: <TBase extends Class<NonNullable<unknown>>>(Base: TBase) =>
|
|
2015
|
+
export declare const applyItemMetadataMixin: <TBase extends Class<NonNullable<unknown>>>(Base: TBase) => ItemMetadataClass<TBase>;
|
|
2061
2016
|
//#endregion
|
|
2062
2017
|
//#region src/services/zod/createNormalizedStringSchema.d.ts
|
|
2063
2018
|
export declare const createNormalizedStringSchema: (maxLength: number, schema?: z.ZodString) => z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
@@ -2074,24 +2029,9 @@ export declare const chunkBySerializedSize: <T>(items: T[], maxBytes: number, ma
|
|
|
2074
2029
|
//#region src/util/array/takeOne.d.ts
|
|
2075
2030
|
export declare const takeOne: TakeOne;
|
|
2076
2031
|
//#endregion
|
|
2077
|
-
//#region src/util/date/checkIsSameDay.d.ts
|
|
2078
|
-
export declare const checkIsSameDay: (date: Date, otherDate: Date) => boolean;
|
|
2079
|
-
//#endregion
|
|
2080
|
-
//#region src/util/date/checkIsToday.d.ts
|
|
2081
|
-
export declare const checkIsToday: (date: Date) => boolean;
|
|
2082
|
-
//#endregion
|
|
2083
|
-
//#region src/util/date/checkIsYesterday.d.ts
|
|
2084
|
-
export declare const checkIsYesterday: (date: Date) => boolean;
|
|
2085
|
-
//#endregion
|
|
2086
2032
|
//#region src/util/date/getEndOfDay.d.ts
|
|
2087
2033
|
export declare const getEndOfDay: (date: Date) => Date;
|
|
2088
2034
|
//#endregion
|
|
2089
|
-
//#region src/util/date/getPlainDate.d.ts
|
|
2090
|
-
export declare const getPlainDate: (date: Date) => Temporal.PlainDate;
|
|
2091
|
-
//#endregion
|
|
2092
|
-
//#region src/util/date/getStartOfDay.d.ts
|
|
2093
|
-
export declare const getStartOfDay: (date: Date) => Date;
|
|
2094
|
-
//#endregion
|
|
2095
2035
|
//#region src/util/date/getZonedDateTime.d.ts
|
|
2096
2036
|
export declare const getZonedDateTime: (date: Date) => Temporal.ZonedDateTime;
|
|
2097
2037
|
//#endregion
|
|
@@ -2103,7 +2043,6 @@ export declare const noop: () => void;
|
|
|
2103
2043
|
//#endregion
|
|
2104
2044
|
//#region src/util/id/constants.d.ts
|
|
2105
2045
|
export declare const ID_SEPARATOR = "|";
|
|
2106
|
-
export declare const UUID_LENGTH = 36;
|
|
2107
2046
|
//#endregion
|
|
2108
2047
|
//#region src/util/map/getOrCreate.d.ts
|
|
2109
2048
|
export declare const getOrCreate: <TKey, TValue>(map: Map<TKey, TValue>, key: TKey, create: () => TValue) => TValue;
|
|
@@ -2111,6 +2050,41 @@ export declare const getOrCreate: <TKey, TValue>(map: Map<TKey, TValue>, key: TK
|
|
|
2111
2050
|
//#region src/util/object/checkIsPlainObject.d.ts
|
|
2112
2051
|
export declare const checkIsPlainObject: (data: unknown) => data is object;
|
|
2113
2052
|
//#endregion
|
|
2053
|
+
//#region src/util/types/GetArrayProps.d.ts
|
|
2054
|
+
export type GetArrayProps<T extends unknown[], P extends string, D extends unknown[], R extends boolean> = (D extends [unknown, ...infer Rest] ? GetProperties<T[number], R extends true ? `${P}[number]` : `${P}.[number]`, Rest, false> : never) | {
|
|
2055
|
+
path: R extends true ? "length" : `${P}.length`;
|
|
2056
|
+
value: T["length"];
|
|
2057
|
+
};
|
|
2058
|
+
//#endregion
|
|
2059
|
+
//#region src/util/types/KnownKeys.d.ts
|
|
2060
|
+
export type KnownKeys<T> = { [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K]; };
|
|
2061
|
+
//#endregion
|
|
2062
|
+
//#region src/util/types/GetObjectProps.d.ts
|
|
2063
|
+
export type GetObjectProps<T, P extends string, D extends unknown[], R extends boolean> = { [K in keyof KnownKeys<T> & (number | string)]: K extends `${number}` ? never : NonNullable<T[K]> extends Function ? never : (D extends [unknown, ...infer Rest] ? GetProperties<T[K], R extends true ? `${K}` : `${P}.${K}`, Rest, false> : never) | {
|
|
2064
|
+
path: R extends true ? `${K}` : `${P}.${K}`;
|
|
2065
|
+
value: T[K];
|
|
2066
|
+
}; }[keyof KnownKeys<T> & (number | string)];
|
|
2067
|
+
//#endregion
|
|
2068
|
+
//#region src/util/types/GetPrimitiveProps.d.ts
|
|
2069
|
+
export type GetPrimitiveProps<T, P extends string, D extends unknown[], R extends boolean> = T extends string ? {
|
|
2070
|
+
path: R extends true ? "length" : `${P}.length`;
|
|
2071
|
+
value: number;
|
|
2072
|
+
} : T extends symbol ? (D extends [unknown, ...infer Rest] ? GetProperties<string | undefined, R extends true ? "description" : `${P}.description`, Rest, false> : never) | {
|
|
2073
|
+
path: R extends true ? "description" : `${P}.description`;
|
|
2074
|
+
value: string | undefined;
|
|
2075
|
+
} : never;
|
|
2076
|
+
//#endregion
|
|
2077
|
+
//#region src/util/types/GetProperties.d.ts
|
|
2078
|
+
export type GetProperties<T, P extends string = "", D extends unknown[] = [unknown, unknown, unknown, unknown, unknown], R extends boolean = true> = [T] extends [never] ? never : D extends [] ? never : NonNullable<T> extends (infer O) ? O extends unknown[] ? GetArrayProps<O, P, D, R> : O extends object ? GetObjectProps<O, P, D, R> : GetPrimitiveProps<O, P, D, R> : never;
|
|
2079
|
+
//#endregion
|
|
2080
|
+
//#region src/util/types/GetPaths.d.ts
|
|
2081
|
+
export type GetPaths<T> = GetProperties<T> extends (infer U) ? (U extends {
|
|
2082
|
+
path: infer Path;
|
|
2083
|
+
} ? Path : never) : never;
|
|
2084
|
+
//#endregion
|
|
2085
|
+
//#region src/util/types/PropertyNames.d.ts
|
|
2086
|
+
export type PropertyNames<T> = { [P in GetPaths<T>]: P; };
|
|
2087
|
+
//#endregion
|
|
2114
2088
|
//#region src/util/object/getPropertyNames.d.ts
|
|
2115
2089
|
export declare const getPropertyNames: <T>() => PropertyNames<T>;
|
|
2116
2090
|
//#endregion
|
|
@@ -2174,9 +2148,6 @@ export type FunctionProperties<T> = { [K in keyof T]: T[K] extends Function ? K
|
|
|
2174
2148
|
//#region src/util/types/ExcludeFunctionProperties.d.ts
|
|
2175
2149
|
export type ExcludeFunctionProperties<T> = Except<T, FunctionProperties<T>[keyof T]>;
|
|
2176
2150
|
//#endregion
|
|
2177
|
-
//#region src/util/types/MapValue.d.ts
|
|
2178
|
-
export type MapValue<BaseType> = BaseType extends Map<unknown, infer ValueType> ? ValueType : never;
|
|
2179
|
-
//#endregion
|
|
2180
2151
|
//#region src/util/types/TupleSplit.d.ts
|
|
2181
2152
|
export type TupleSplit<T extends unknown[], N extends number> = T extends [...BuildTuple<N>, ...infer R] ? [T extends [...infer H, ...R] ? H : BuildTuple<N, T[number]>, R] : [T, []];
|
|
2182
2153
|
//#endregion
|
|
@@ -2192,9 +2163,6 @@ export type TupleSlice<T extends unknown[], S extends number, E extends number =
|
|
|
2192
2163
|
//#region src/util/validation/exhaustiveGuard.d.ts
|
|
2193
2164
|
export declare const exhaustiveGuard: (value: never) => never;
|
|
2194
2165
|
//#endregion
|
|
2195
|
-
//#region src/util/id/uuid/checkIsUuidV4.d.ts
|
|
2196
|
-
export declare const checkIsUuidV4: (uuid: string) => boolean;
|
|
2197
|
-
//#endregion
|
|
2198
2166
|
//#region src/util/id/uuid/constants.d.ts
|
|
2199
2167
|
export declare const UUIDV4_REGEX: RegExp;
|
|
2200
2168
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -146,11 +146,7 @@ const RoutePath = {
|
|
|
146
146
|
View: (type, id) => `/view/${type}/${id}`
|
|
147
147
|
};
|
|
148
148
|
//#endregion
|
|
149
|
-
//#region src/util/object/getPropertyNames.ts
|
|
150
|
-
const getPropertyNames = () => new Proxy({}, { get: (_target, property) => property });
|
|
151
|
-
//#endregion
|
|
152
149
|
//#region src/models/shared/ItemEntityType.ts
|
|
153
|
-
const ItemEntityTypePropertyNames = getPropertyNames();
|
|
154
150
|
const createItemEntityTypeSchema = (schema) => z.object({ type: schema });
|
|
155
151
|
//#endregion
|
|
156
152
|
//#region src/models/shared/ItemMetadata.ts
|
|
@@ -159,12 +155,6 @@ var ItemMetadata = class {
|
|
|
159
155
|
deletedAt = null;
|
|
160
156
|
updatedAt = /* @__PURE__ */ new Date();
|
|
161
157
|
};
|
|
162
|
-
const ItemMetadataPropertyNames = getPropertyNames();
|
|
163
|
-
const itemMetadataSchema = z.object({
|
|
164
|
-
createdAt: z.date(),
|
|
165
|
-
deletedAt: z.date().nullable(),
|
|
166
|
-
updatedAt: z.date()
|
|
167
|
-
});
|
|
168
158
|
//#endregion
|
|
169
159
|
//#region src/models/shared/Operation.ts
|
|
170
160
|
let Operation = /* @__PURE__ */ function(Operation) {
|
|
@@ -207,32 +197,12 @@ const toAppError = (error) => {
|
|
|
207
197
|
else return new Error(String(error), { cause: error });
|
|
208
198
|
};
|
|
209
199
|
//#endregion
|
|
210
|
-
//#region src/services/error/getResultAsync.ts
|
|
211
|
-
const getResultAsync = (fn) => ResultAsync.fromThrowable(fn, toAppError)();
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region src/util/time/sleep.ts
|
|
214
|
-
const sleep = (durationMs) => new Promise((resolve) => {
|
|
215
|
-
setTimeout(resolve, durationMs);
|
|
216
|
-
});
|
|
217
|
-
//#endregion
|
|
218
|
-
//#region src/services/error/createExponentialBackoff.ts
|
|
219
|
-
const createExponentialBackoff = (baseDelayMs, maxDelayMs) => {
|
|
220
|
-
let failureCount = 0;
|
|
221
|
-
return async (operation) => {
|
|
222
|
-
if (failureCount > 0) await sleep(Math.min(baseDelayMs * 2 ** (failureCount - 1), maxDelayMs));
|
|
223
|
-
return getResultAsync(operation).match((value) => {
|
|
224
|
-
failureCount = 0;
|
|
225
|
-
return value;
|
|
226
|
-
}, (error) => {
|
|
227
|
-
failureCount += 1;
|
|
228
|
-
throw error;
|
|
229
|
-
});
|
|
230
|
-
};
|
|
231
|
-
};
|
|
232
|
-
//#endregion
|
|
233
200
|
//#region src/services/error/getResult.ts
|
|
234
201
|
const getResult = (fn) => fromThrowable(fn, toAppError)();
|
|
235
202
|
//#endregion
|
|
203
|
+
//#region src/services/error/getResultAsync.ts
|
|
204
|
+
const getResultAsync = (fn) => ResultAsync.fromThrowable(fn, toAppError)();
|
|
205
|
+
//#endregion
|
|
236
206
|
//#region src/services/error/withFinalizer.ts
|
|
237
207
|
const withFinalizer = (fn, finalizer) => {
|
|
238
208
|
const result = getResult(fn);
|
|
@@ -270,25 +240,10 @@ const MENTION_HERE_ID = "@here";
|
|
|
270
240
|
const MENTION_EVERYONE_ID = "@everyone";
|
|
271
241
|
const CUSTOM_EMOJI_ID_ATTRIBUTE = "data-custom-emoji-id";
|
|
272
242
|
const CUSTOM_EMOJI_NAME_ATTRIBUTE = "data-custom-emoji-name";
|
|
273
|
-
const CUSTOM_EMOJI_TYPE = "customEmoji";
|
|
274
243
|
//#endregion
|
|
275
244
|
//#region src/services/message/getMentions.ts
|
|
276
245
|
const getMentions = (message) => parse(message).querySelectorAll(MENTION_SELECTOR);
|
|
277
246
|
//#endregion
|
|
278
|
-
//#region src/services/message/classifyMentions.ts
|
|
279
|
-
const BROADCAST_MENTION_IDS = /* @__PURE__ */ new Set([MENTION_EVERYONE_ID, MENTION_HERE_ID]);
|
|
280
|
-
const classifyMentions = (message) => {
|
|
281
|
-
const mentions = getMentions(message).map((mention) => ({
|
|
282
|
-
id: mention.getAttribute(MENTION_ID_ATTRIBUTE),
|
|
283
|
-
type: mention.getAttribute(MENTION_ITEM_TYPE_ATTRIBUTE)
|
|
284
|
-
})).filter((mention) => Boolean(mention.id));
|
|
285
|
-
return {
|
|
286
|
-
broadcastIds: mentions.filter(({ id }) => BROADCAST_MENTION_IDS.has(id)).map(({ id }) => id),
|
|
287
|
-
regularUserIds: mentions.filter(({ id, type }) => !BROADCAST_MENTION_IDS.has(id) && type !== "role").map(({ id }) => id),
|
|
288
|
-
roleIds: mentions.filter(({ type }) => type === "role").map(({ id }) => id)
|
|
289
|
-
};
|
|
290
|
-
};
|
|
291
|
-
//#endregion
|
|
292
247
|
//#region src/services/prettier/css.ts
|
|
293
248
|
const css = String.raw;
|
|
294
249
|
//#endregion
|
|
@@ -414,30 +369,14 @@ const takeOne = (values, index = 0) => {
|
|
|
414
369
|
//#region src/util/date/getZonedDateTime.ts
|
|
415
370
|
const getZonedDateTime = (date) => Temporal.Instant.fromEpochMilliseconds(date.getTime()).toZonedDateTimeISO(Temporal.Now.timeZoneId());
|
|
416
371
|
//#endregion
|
|
417
|
-
//#region src/util/date/getPlainDate.ts
|
|
418
|
-
const getPlainDate = (date) => getZonedDateTime(date).toPlainDate();
|
|
419
|
-
//#endregion
|
|
420
|
-
//#region src/util/date/checkIsSameDay.ts
|
|
421
|
-
const checkIsSameDay = (date, otherDate) => getPlainDate(date).equals(getPlainDate(otherDate));
|
|
422
|
-
//#endregion
|
|
423
|
-
//#region src/util/date/checkIsToday.ts
|
|
424
|
-
const checkIsToday = (date) => getPlainDate(date).equals(Temporal.Now.plainDateISO());
|
|
425
|
-
//#endregion
|
|
426
|
-
//#region src/util/date/checkIsYesterday.ts
|
|
427
|
-
const checkIsYesterday = (date) => getPlainDate(date).equals(Temporal.Now.plainDateISO().subtract({ days: 1 }));
|
|
428
|
-
//#endregion
|
|
429
372
|
//#region src/util/date/getEndOfDay.ts
|
|
430
373
|
const getEndOfDay = (date) => /* @__PURE__ */ new Date(getZonedDateTime(date).startOfDay().add({ days: 1 }).epochMilliseconds - 1);
|
|
431
374
|
//#endregion
|
|
432
|
-
//#region src/util/date/getStartOfDay.ts
|
|
433
|
-
const getStartOfDay = (date) => new Date(getZonedDateTime(date).startOfDay().epochMilliseconds);
|
|
434
|
-
//#endregion
|
|
435
375
|
//#region src/util/environment/checkIsServer.ts
|
|
436
376
|
const checkIsServer = () => typeof window === "undefined";
|
|
437
377
|
//#endregion
|
|
438
378
|
//#region src/util/id/constants.ts
|
|
439
379
|
const ID_SEPARATOR = "|";
|
|
440
|
-
const UUID_LENGTH = 36;
|
|
441
380
|
//#endregion
|
|
442
381
|
//#region src/util/map/getOrCreate.ts
|
|
443
382
|
const getOrCreate = (map, key, create) => {
|
|
@@ -454,6 +393,9 @@ const checkIsPlainObject = (data) => {
|
|
|
454
393
|
return prototype === null || prototype === Object.prototype;
|
|
455
394
|
};
|
|
456
395
|
//#endregion
|
|
396
|
+
//#region src/util/object/getPropertyNames.ts
|
|
397
|
+
const getPropertyNames = () => new Proxy({}, { get: (_target, property) => property });
|
|
398
|
+
//#endregion
|
|
457
399
|
//#region src/util/object/jsonDateParse.ts
|
|
458
400
|
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;
|
|
459
401
|
const MS_AJAX_DATE_REGEX = /^\/Date\((?<timestamp>-?\d+(?:[-+]\d+)?)\)[/\\]$/u;
|
|
@@ -547,6 +489,11 @@ const now = () => {
|
|
|
547
489
|
return (BigInt(loadMilliseconds) * 10n ** 6n + (BigInt(seconds) * 10n ** 9n + BigInt(nanoseconds))).toString();
|
|
548
490
|
};
|
|
549
491
|
//#endregion
|
|
492
|
+
//#region src/util/time/sleep.ts
|
|
493
|
+
const sleep = (durationMs) => new Promise((resolve) => {
|
|
494
|
+
setTimeout(resolve, durationMs);
|
|
495
|
+
});
|
|
496
|
+
//#endregion
|
|
550
497
|
//#region src/util/validation/exhaustiveGuard.ts
|
|
551
498
|
const exhaustiveGuard = (value) => {
|
|
552
499
|
throw new InvalidOperationError("Read", exhaustiveGuard.name, JSON.stringify(value));
|
|
@@ -555,7 +502,4 @@ const exhaustiveGuard = (value) => {
|
|
|
555
502
|
//#region src/util/id/uuid/constants.ts
|
|
556
503
|
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;
|
|
557
504
|
//#endregion
|
|
558
|
-
|
|
559
|
-
const checkIsUuidV4 = (uuid) => UUIDV4_REGEX.test(uuid);
|
|
560
|
-
//#endregion
|
|
561
|
-
export { AllSpecialValues, CUSTOM_EMOJI_ID_ATTRIBUTE, CUSTOM_EMOJI_NAME_ATTRIBUTE, CUSTOM_EMOJI_TYPE, ForbiddenError, GIBIBYTE, ID_SEPARATOR, InvalidOperationError, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, KIBIBYTE, MAX_READ_LIMIT, MENTION_EVERYONE_ID, MENTION_HERE_ID, MENTION_ID_ATTRIBUTE, MENTION_ITEM_TYPE_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_SELECTOR, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MentionType, NotFoundError, NotInitializedError, Operation, RoutePath, SITE_NAME, Serializable, UUIDV4_REGEX, UUID_LENGTH, WordFilteredError, applyItemMetadataMixin, capitalize, checkIsPlainObject, checkIsSameDay, checkIsServer, checkIsToday, checkIsUuidV4, checkIsYesterday, chunk, chunkBySerializedSize, classifyMentions, createExponentialBackoff, createItemEntityTypeSchema, createNormalizedStringSchema, createUniqueArraySchema, css, encodeUrlSubDelimiters, exhaustiveGuard, getDecodedUriComponent, getEndOfDay, getMentions, getOrCreate, getPlainDate, getPropertyNames, getRawData, getResult, getResultAsync, getStartOfDay, getZonedDateTime, hrtime, html, itemMetadataSchema, jsonDateParse, mergeObjectsStrict, noop, normalizeString, now, sanitizeHtml, sanitizeTextHtml, settleAll, sleep, streamToText, takeOne, toAppError, toKebabCase, toRawDeep, truncate, uncapitalize, withFinalizer, withFinalizerAsync };
|
|
505
|
+
export { AllSpecialValues, CUSTOM_EMOJI_ID_ATTRIBUTE, CUSTOM_EMOJI_NAME_ATTRIBUTE, ForbiddenError, GIBIBYTE, ID_SEPARATOR, InvalidOperationError, ItemMetadata, KIBIBYTE, MAX_READ_LIMIT, MENTION_EVERYONE_ID, MENTION_HERE_ID, MENTION_ID_ATTRIBUTE, MENTION_ITEM_TYPE_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_SELECTOR, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MentionType, NotFoundError, NotInitializedError, Operation, RoutePath, SITE_NAME, Serializable, UUIDV4_REGEX, WordFilteredError, applyItemMetadataMixin, capitalize, checkIsPlainObject, checkIsServer, chunk, chunkBySerializedSize, createItemEntityTypeSchema, createNormalizedStringSchema, createUniqueArraySchema, css, encodeUrlSubDelimiters, exhaustiveGuard, getDecodedUriComponent, getEndOfDay, getMentions, getOrCreate, getPropertyNames, getRawData, getResult, getResultAsync, getZonedDateTime, hrtime, html, jsonDateParse, mergeObjectsStrict, noop, normalizeString, now, sanitizeHtml, sanitizeTextHtml, settleAll, sleep, streamToText, takeOne, toAppError, toKebabCase, toRawDeep, truncate, uncapitalize, withFinalizer, withFinalizerAsync };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esposter/shared",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "A library that contains shared typescript code.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"error-handling",
|
|
@@ -56,20 +56,20 @@
|
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@arethetypeswrong/core": "^0.18.5",
|
|
58
58
|
"@azure/data-tables": "^13.3.2",
|
|
59
|
-
"@esposter/configuration": "2.
|
|
60
|
-
"@types/node": "^26.
|
|
59
|
+
"@esposter/configuration": "3.2.0",
|
|
60
|
+
"@types/node": "^26.6.1",
|
|
61
61
|
"@types/sanitize-html": "^2.16.1",
|
|
62
62
|
"publint": "^0.3.24",
|
|
63
63
|
"tsdown": "^0.23.0",
|
|
64
|
-
"type-fest": "^5.
|
|
65
|
-
"vitest": "^5.0.
|
|
66
|
-
"vue": "^3.5.
|
|
64
|
+
"type-fest": "^5.10.0",
|
|
65
|
+
"vitest": "^5.0.1",
|
|
66
|
+
"vue": "^3.5.43"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"zod": "^4.6.
|
|
69
|
+
"zod": "^4.6.5"
|
|
70
70
|
},
|
|
71
71
|
"inlinedDependencies": {
|
|
72
|
-
"type-fest": "5.
|
|
72
|
+
"type-fest": "5.10.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "bc055ed2f154eff219a355016a6b586962dbfa9c"
|
|
75
75
|
}
|