@esposter/azure 2.38.1 → 2.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +201 -201
  2. package/dist/index.d.ts +33 -38
  3. package/dist/index.js +26 -30
  4. package/package.json +13 -14
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
@@ -1,9 +1,8 @@
1
1
  import { z } from "zod";
2
- import baseDayjs from "dayjs";
3
2
  import { PropertyNames } from "@esposter/shared";
4
3
  import { TableEntity } from "@azure/data-tables";
5
4
  //#region src/models/BinaryOperator.d.ts
6
- declare enum BinaryOperator {
5
+ export declare enum BinaryOperator {
7
6
  eq = "eq",
8
7
  ge = "ge",
9
8
  gt = "gt",
@@ -11,21 +10,21 @@ declare enum BinaryOperator {
11
10
  lt = "lt",
12
11
  ne = "ne"
13
12
  }
14
- declare const BinaryOperators: readonly BinaryOperator[];
13
+ export declare const BinaryOperators: readonly BinaryOperator[];
15
14
  //#endregion
16
15
  //#region src/models/search/SearchOperator.d.ts
17
- declare enum SearchOperator {
16
+ export declare enum SearchOperator {
18
17
  arrayAny = "arrayAny",
19
18
  arrayContains = "arrayContains"
20
19
  }
21
20
  //#endregion
22
21
  //#region src/models/SerializableValue.d.ts
23
- declare const SERIALIZABLE_VALUE_MAX_LENGTH = 100;
24
- type SerializableValue = boolean | Date | null | number | string;
25
- declare const serializableValueSchema: z.ZodType<SerializableValue, SerializableValue>;
22
+ export declare const SERIALIZABLE_VALUE_MAX_LENGTH = 100;
23
+ export type SerializableValue = boolean | Date | null | number | string;
24
+ export declare const serializableValueSchema: z.ZodType<SerializableValue, SerializableValue>;
26
25
  //#endregion
27
26
  //#region src/models/Clause.d.ts
28
- type Clause<T extends object> = {
27
+ export type Clause<T extends object> = {
29
28
  key: keyof T & string;
30
29
  not?: boolean;
31
30
  } & ({
@@ -39,18 +38,18 @@ type Clause<T extends object> = {
39
38
  });
40
39
  //#endregion
41
40
  //#region src/models/UnaryOperator.d.ts
42
- declare enum UnaryOperator {
41
+ export declare enum UnaryOperator {
43
42
  and = "and",
44
43
  not = "not",
45
44
  or = "or"
46
45
  }
47
46
  //#endregion
48
47
  //#region src/services/constants.d.ts
49
- declare const AZURE_MAX_BATCH_SIZE = 100;
50
- declare const AZURE_MAX_PAGE_SIZE = 1e3;
51
- declare const AZURE_MAX_QUEUE_VISIBILITY_TIMEOUT_MS: number;
48
+ export declare const AZURE_MAX_BATCH_SIZE = 100;
49
+ export declare const AZURE_MAX_PAGE_SIZE = 1e3;
50
+ export declare const AZURE_MAX_QUEUE_VISIBILITY_TIMEOUT_MS: number;
52
51
  //#endregion
53
- //#region ../../node_modules/.pnpm/type-fest@5.8.0/node_modules/type-fest/source/omit-index-signature.d.ts
52
+ //#region ../../node_modules/.pnpm/type-fest@5.9.0/node_modules/type-fest/source/omit-index-signature.d.ts
54
53
  /**
55
54
  Omit any index signatures from the given object type, leaving only explicitly defined properties.
56
55
 
@@ -145,67 +144,63 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
145
144
  type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType]; };
146
145
  //#endregion
147
146
  //#region src/models/table/CompositeKey.d.ts
148
- declare class CompositeKey implements OmitIndexSignature<TableEntity> {
147
+ export declare class CompositeKey implements OmitIndexSignature<TableEntity> {
149
148
  partitionKey: string;
150
149
  rowKey: string;
151
150
  }
152
- declare const CompositeKeyPropertyNames: PropertyNames<CompositeKey>;
153
- //#endregion
154
- //#region src/services/dayjs/index.d.ts
155
- declare const dayjs: typeof baseDayjs;
151
+ export declare const CompositeKeyPropertyNames: PropertyNames<CompositeKey>;
156
152
  //#endregion
157
153
  //#region src/services/search/getSearchNonNullClause.d.ts
158
- declare const getSearchNonNullClause: <T extends object>(key: keyof T & string) => Clause<T>;
154
+ export declare const getSearchNonNullClause: <T extends object>(key: keyof T & string) => Clause<T>;
159
155
  //#endregion
160
156
  //#region src/services/search/getSearchNullClause.d.ts
161
- declare const getSearchNullClause: <T extends object>(key: keyof T & string) => Clause<T>;
157
+ export declare const getSearchNullClause: <T extends object>(key: keyof T & string) => Clause<T>;
162
158
  //#endregion
163
159
  //#region src/services/table/constants.d.ts
164
- declare const KeysToCapitalize: Set<string>;
165
- declare const KeysToUncapitalize: Set<string>;
160
+ export declare const KeysToCapitalize: Set<string>;
161
+ export declare const KeysToUncapitalize: Set<string>;
166
162
  //#endregion
167
163
  //#region src/services/table/deserializeKey.d.ts
168
- declare const deserializeKey: (key: string) => string;
164
+ export declare const deserializeKey: (key: string) => string;
169
165
  //#endregion
170
166
  //#region src/services/table/getTableNullClause.d.ts
171
- declare const getTableNullClause: <T extends object>(key: keyof T & string) => Clause<T>;
167
+ export declare const getTableNullClause: <T extends object>(key: keyof T & string) => Clause<T>;
172
168
  //#endregion
173
169
  //#region src/services/table/serializeKey.d.ts
174
- declare const serializeKey: (key: string) => string;
170
+ export declare const serializeKey: (key: string) => string;
175
171
  //#endregion
176
172
  //#region src/services/transformer/constants.d.ts
177
- declare const CLAUSE_REGEX: RegExp;
173
+ export declare const CLAUSE_REGEX: RegExp;
178
174
  //#endregion
179
175
  //#region src/services/transformer/deserializeClause.d.ts
180
- declare const deserializeClause: (string: string) => Extract<Clause<Record<string, unknown>>, {
176
+ export declare const deserializeClause: (serializedClause: string) => Extract<Clause<Record<string, unknown>>, {
181
177
  operator: BinaryOperator;
182
178
  }>;
183
179
  //#endregion
184
180
  //#region src/services/transformer/deserializeValue.d.ts
185
- declare const deserializeValue: (string: string) => SerializableValue;
181
+ export declare const deserializeValue: (serializedValue: string) => SerializableValue;
186
182
  //#endregion
187
183
  //#region src/services/transformer/escapeValue.d.ts
188
- declare const escapeValue: (value: string) => string;
184
+ export declare const escapeValue: (value: string) => string;
189
185
  //#endregion
190
186
  //#region src/services/transformer/getPartitionKeyFilter.d.ts
191
- declare const getPartitionKeyFilter: (partitionKey: CompositeKey["partitionKey"]) => string;
187
+ export declare const getPartitionKeyFilter: (partitionKey: CompositeKey["partitionKey"]) => string;
192
188
  //#endregion
193
189
  //#region src/services/transformer/RangeOperators.d.ts
194
- declare const RangeOperators: (BinaryOperator | SearchOperator)[];
190
+ export declare const RangeOperators: (BinaryOperator | SearchOperator)[];
195
191
  //#endregion
196
192
  //#region src/services/transformer/serializeClause.d.ts
197
- declare const serializeClause: (clause: Clause<Record<string, unknown>>, isTableFilter?: boolean) => string;
193
+ export declare const serializeClause: (clause: Clause<Record<string, unknown>>, isTableFilter?: boolean) => string;
198
194
  //#endregion
199
195
  //#region src/services/transformer/serializeClauses.d.ts
200
- declare const serializeClauses: (clauses: Clause<Record<string, unknown>>[]) => string;
196
+ export declare const serializeClauses: (clauses: Clause<Record<string, unknown>>[]) => string;
201
197
  //#endregion
202
198
  //#region src/services/transformer/serializeClausesCore.d.ts
203
- declare const serializeClausesCore: (clauses: Clause<Record<string, unknown>>[], isTableFilter: boolean) => string;
199
+ export declare const serializeClausesCore: (clauses: Clause<Record<string, unknown>>[], isTableFilter: boolean) => string;
204
200
  //#endregion
205
201
  //#region src/services/transformer/serializeSearchClauses.d.ts
206
- declare const serializeSearchClauses: (clauses: Clause<Record<string, unknown>>[]) => string;
202
+ export declare const serializeSearchClauses: (clauses: Clause<Record<string, unknown>>[]) => string;
207
203
  //#endregion
208
204
  //#region src/services/transformer/serializeValue.d.ts
209
- declare const serializeValue: (value: SerializableValue, isTableFilter?: boolean) => string;
210
- //#endregion
211
- export { AZURE_MAX_BATCH_SIZE, AZURE_MAX_PAGE_SIZE, AZURE_MAX_QUEUE_VISIBILITY_TIMEOUT_MS, BinaryOperator, BinaryOperators, CLAUSE_REGEX, Clause, CompositeKey, CompositeKeyPropertyNames, KeysToCapitalize, KeysToUncapitalize, RangeOperators, SERIALIZABLE_VALUE_MAX_LENGTH, SearchOperator, SerializableValue, UnaryOperator, dayjs, deserializeClause, deserializeKey, deserializeValue, escapeValue, getPartitionKeyFilter, getSearchNonNullClause, getSearchNullClause, getTableNullClause, serializableValueSchema, serializeClause, serializeClauses, serializeClausesCore, serializeKey, serializeSearchClauses, serializeValue };
205
+ export declare const serializeValue: (value: SerializableValue, isTableFilter?: boolean) => string;
206
+ //#endregion
package/dist/index.js CHANGED
@@ -1,6 +1,4 @@
1
1
  import { z } from "zod";
2
- import baseDayjs from "dayjs";
3
- import duration from "dayjs/plugin/duration.js";
4
2
  import { ID_SEPARATOR, InvalidOperationError, NotFoundError, Operation, capitalize, getPropertyNames, normalizeString, takeOne, uncapitalize } from "@esposter/shared";
5
3
  //#region src/models/BinaryOperator.ts
6
4
  let BinaryOperator = /* @__PURE__ */ function(BinaryOperator) {
@@ -32,14 +30,10 @@ let UnaryOperator = /* @__PURE__ */ function(UnaryOperator) {
32
30
  return UnaryOperator;
33
31
  }({});
34
32
  //#endregion
35
- //#region src/services/dayjs/index.ts
36
- baseDayjs.extend(duration);
37
- const dayjs = baseDayjs;
38
- //#endregion
39
33
  //#region src/services/constants.ts
40
34
  const AZURE_MAX_BATCH_SIZE = 100;
41
35
  const AZURE_MAX_PAGE_SIZE = 1e3;
42
- const AZURE_MAX_QUEUE_VISIBILITY_TIMEOUT_MS = dayjs.duration(7, "days").asMilliseconds();
36
+ const AZURE_MAX_QUEUE_VISIBILITY_TIMEOUT_MS = Temporal.Duration.from({ days: 7 }).total("milliseconds");
43
37
  //#endregion
44
38
  //#region src/models/search/SearchOperator.ts
45
39
  let SearchOperator = /* @__PURE__ */ function(SearchOperator) {
@@ -98,28 +92,28 @@ const VALUE_REGEX = [
98
92
  const CLAUSE_REGEX = new RegExp(String.raw`^(?<not>not\s+)?(?<key>[A-Za-z0-9_]*)\s*(?<operator>${BinaryOperators.join(ID_SEPARATOR)})\s+(?<value>${VALUE_REGEX})$`, "iu");
99
93
  //#endregion
100
94
  //#region src/services/transformer/deserializeValue.ts
101
- const deserializeValue = (string) => {
102
- if (string === String(true)) return true;
103
- else if (string === String(false)) return false;
104
- else if (string === String(null)) return null;
105
- else if (Number.isFinite(Number(string))) return Number(string);
106
- else if (string === String(NaN)) return NaN;
107
- else if (string.startsWith("datetime'") && string.endsWith("'")) return new Date(string.slice(9, -1));
108
- else if (string.startsWith("'") && string.endsWith("'")) return string.slice(1, -1).replaceAll("''", "'");
95
+ const deserializeValue = (serializedValue) => {
96
+ if (serializedValue === String(true)) return true;
97
+ else if (serializedValue === String(false)) return false;
98
+ else if (serializedValue === String(null)) return null;
99
+ else if (Number.isFinite(Number(serializedValue))) return Number(serializedValue);
100
+ else if (serializedValue === String(NaN)) return NaN;
101
+ else if (serializedValue.startsWith("datetime'") && serializedValue.endsWith("'")) return new Date(serializedValue.slice(9, -1));
102
+ else if (serializedValue.startsWith("'") && serializedValue.endsWith("'")) return serializedValue.slice(1, -1).replaceAll("''", "'");
109
103
  else {
110
- const date = new Date(string);
111
- if (Number.isNaN(date)) return string;
104
+ const date = new Date(serializedValue);
105
+ if (Number.isNaN(date)) return serializedValue;
112
106
  else return date;
113
107
  }
114
108
  };
115
109
  //#endregion
116
110
  //#region src/services/transformer/deserializeClause.ts
117
- const deserializeClause = (string) => {
118
- const normalizedString = normalizeString(string);
119
- const match = CLAUSE_REGEX.exec(normalizedString);
120
- if (!match) throw new NotFoundError(deserializeClause.name, normalizedString);
111
+ const deserializeClause = (serializedClause) => {
112
+ const normalizedClause = normalizeString(serializedClause);
113
+ const match = CLAUSE_REGEX.exec(normalizedClause);
114
+ if (!match) throw new NotFoundError(deserializeClause.name, normalizedClause);
121
115
  const groups = match.groups;
122
- if (!groups) throw new NotFoundError(deserializeClause.name, normalizedString);
116
+ if (!groups) throw new NotFoundError(deserializeClause.name, normalizedClause);
123
117
  return {
124
118
  key: deserializeKey(groups.key),
125
119
  not: Boolean(groups.not),
@@ -168,15 +162,17 @@ const serializeClause = (clause, isTableFilter = false) => {
168
162
  const serializeClausesCore = (clauses, isTableFilter) => {
169
163
  if (clauses.length === 0) return "";
170
164
  else if (clauses.length === 1) return serializeClause(takeOne(clauses), isTableFilter);
171
- const groupedClauses = Object.groupBy(clauses, ({ key }) => key);
172
- const groupedStrings = [];
173
- for (const clauseGroup of Object.values(groupedClauses)) if (clauseGroup.length === 1) groupedStrings.push(serializeClause(takeOne(clauseGroup), isTableFilter));
174
165
  else {
175
- const serializedClauses = clauseGroup.map((c) => serializeClause(c, isTableFilter));
176
- const groupedString = clauseGroup.some(({ operator }) => RangeOperators.includes(operator)) ? serializedClauses.join(` and `) : `(${serializedClauses.join(` or `)})`;
177
- groupedStrings.push(groupedString);
166
+ const groupedClauses = Object.groupBy(clauses, ({ key }) => key);
167
+ const groupedStrings = [];
168
+ for (const clauseGroup of Object.values(groupedClauses)) if (clauseGroup.length === 1) groupedStrings.push(serializeClause(takeOne(clauseGroup), isTableFilter));
169
+ else {
170
+ const serializedClauses = clauseGroup.map((clause) => serializeClause(clause, isTableFilter));
171
+ const groupedString = clauseGroup.some(({ operator }) => RangeOperators.includes(operator)) ? serializedClauses.join(` and `) : `(${serializedClauses.join(` or `)})`;
172
+ groupedStrings.push(groupedString);
173
+ }
174
+ return groupedStrings.join(` and `);
178
175
  }
179
- return groupedStrings.join(` and `);
180
176
  };
181
177
  //#endregion
182
178
  //#region src/services/transformer/serializeClauses.ts
@@ -192,4 +188,4 @@ const getPartitionKeyFilter = (partitionKey) => serializeClauses([{
192
188
  //#region src/services/transformer/serializeSearchClauses.ts
193
189
  const serializeSearchClauses = (clauses) => serializeClausesCore(clauses, false);
194
190
  //#endregion
195
- export { AZURE_MAX_BATCH_SIZE, AZURE_MAX_PAGE_SIZE, AZURE_MAX_QUEUE_VISIBILITY_TIMEOUT_MS, BinaryOperator, BinaryOperators, CLAUSE_REGEX, CompositeKey, CompositeKeyPropertyNames, KeysToCapitalize, KeysToUncapitalize, RangeOperators, SERIALIZABLE_VALUE_MAX_LENGTH, SearchOperator, UnaryOperator, dayjs, deserializeClause, deserializeKey, deserializeValue, escapeValue, getPartitionKeyFilter, getSearchNonNullClause, getSearchNullClause, getTableNullClause, serializableValueSchema, serializeClause, serializeClauses, serializeClausesCore, serializeKey, serializeSearchClauses, serializeValue };
191
+ export { AZURE_MAX_BATCH_SIZE, AZURE_MAX_PAGE_SIZE, AZURE_MAX_QUEUE_VISIBILITY_TIMEOUT_MS, BinaryOperator, BinaryOperators, CLAUSE_REGEX, CompositeKey, CompositeKeyPropertyNames, KeysToCapitalize, KeysToUncapitalize, RangeOperators, SERIALIZABLE_VALUE_MAX_LENGTH, SearchOperator, UnaryOperator, deserializeClause, deserializeKey, deserializeValue, escapeValue, getPartitionKeyFilter, getSearchNonNullClause, getSearchNullClause, getTableNullClause, serializableValueSchema, serializeClause, serializeClauses, serializeClausesCore, serializeKey, serializeSearchClauses, serializeValue };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esposter/azure",
3
- "version": "2.38.1",
3
+ "version": "2.40.0",
4
4
  "description": "The Azure wire conventions Esposter's clients and its mocks both speak — OData filter clauses, entity key casing, and service limits.",
5
5
  "keywords": [
6
6
  "azure",
@@ -24,6 +24,7 @@
24
24
  "dist"
25
25
  ],
26
26
  "type": "module",
27
+ "sideEffects": false,
27
28
  "types": "dist/index.d.ts",
28
29
  "imports": {
29
30
  "#src/*": "./src/*.ts"
@@ -36,34 +37,32 @@
36
37
  "access": "public"
37
38
  },
38
39
  "scripts": {
39
- "build": "pnpm export:gen && tsdown",
40
- "export:gen": "ctix build --config ../configuration/.ctirc-ts",
40
+ "build": "tsdown",
41
+ "export:gen": "generate-exports",
41
42
  "format": "oxfmt",
42
43
  "format:check": "oxfmt --check",
43
44
  "lint": "eslint .",
44
45
  "lint:fix": "eslint --fix .",
45
46
  "test": "vitest",
46
- "typecheck": "tsgo"
47
+ "typecheck": "tsc"
47
48
  },
48
49
  "dependencies": {
49
- "@esposter/shared": "2.38.1",
50
- "dayjs": "^1.11.23"
50
+ "@esposter/shared": "2.40.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@arethetypeswrong/core": "^0.18.5",
54
- "@esposter/configuration": "2.38.1",
55
- "ctix": "^2.8.2",
54
+ "@esposter/configuration": "2.40.0",
56
55
  "publint": "^0.3.24",
57
- "tsdown": "^0.22.14",
58
- "type-fest": "^5.8.0",
59
- "vitest": "^4.1.11"
56
+ "tsdown": "^0.23.0",
57
+ "type-fest": "^5.9.0",
58
+ "vitest": "^5.0.0"
60
59
  },
61
60
  "peerDependencies": {
62
61
  "@azure/data-tables": "^13.3.2",
63
- "zod": "^4.4.3"
62
+ "zod": "^4.6.1"
64
63
  },
65
64
  "inlinedDependencies": {
66
- "type-fest": "5.8.0"
65
+ "type-fest": "5.9.0"
67
66
  },
68
- "gitHead": "b4c56347a01ac26a5e447c934a0c3c3308161bb5"
67
+ "gitHead": "09506078db97923eeecb4ff602cf01015f237dc8"
69
68
  }