azure-mock 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 +72 -70
- package/dist/index.js +54 -59
- package/package.json +8 -8
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,6 +1,5 @@
|
|
|
1
|
-
import { PipelineRequest, RestError } from "@azure/core-rest-pipeline";
|
|
2
1
|
import { HttpHeadersLike, WebResourceLike } from "@azure/core-http-compat";
|
|
3
|
-
import {
|
|
2
|
+
import { PipelineRequest, RestError } from "@azure/core-rest-pipeline";
|
|
4
3
|
import { AnonymousCredential, AppendBlobClient, BlobAbortCopyFromURLResponse, BlobBatchClient, BlobBatchDeleteBlobsResponse, BlobBeginCopyFromURLResponse, BlobClient, BlobCopyFromURLResponse, BlobCreateSnapshotResponse, BlobDeleteIfExistsResponse, BlobDeleteImmutabilityPolicyResponse, BlobDeleteOptions, BlobDeleteResponse, BlobDownloadResponseModel, BlobDownloadResponseParsed, BlobGenerateSasUrlOptions, BlobGetAccountInfoResponse, BlobGetPropertiesResponse, BlobGetTagsResponse, BlobHierarchyListSegment, BlobItem, BlobLeaseClient, BlobPrefix, BlobSetHTTPHeadersResponse, BlobSetImmutabilityPolicyResponse, BlobSetLegalHoldResponse, BlobSetMetadataResponse, BlobSetTagsResponse, BlobSetTierResponse, BlobUndeleteResponse, BlobUploadCommonResponse, BlockBlobClient, BlockBlobCommitBlockListResponse, BlockBlobGetBlockListResponse, BlockBlobPutBlobFromUrlResponse, BlockBlobStageBlockFromURLResponse, BlockBlobStageBlockResponse, BlockBlobUploadOptions, BlockBlobUploadResponse, ContainerClient, ContainerCreateIfNotExistsResponse, ContainerCreateResponse, ContainerDeleteIfExistsResponse, ContainerDeleteResponse, ContainerFindBlobsByTagsSegmentResponse, ContainerGenerateSasUrlOptions, ContainerGetAccessPolicyResponse, ContainerGetAccountInfoResponse, ContainerGetPropertiesResponse, ContainerListBlobFlatSegmentResponse, ContainerListBlobHierarchySegmentResponse, ContainerListBlobsOptions, ContainerSetAccessPolicyResponse, ContainerSetMetadataResponse, FilterBlobItem, HttpRequestBody, PageBlobClient, PollOperationState, PollerLikeWithCancellation, StorageSharedKeyCredential } from "@azure/storage-blob";
|
|
5
4
|
import { BinaryOperator, Clause } from "@esposter/azure";
|
|
6
5
|
import { EventGridEvent, EventGridPublisherClient } from "@azure/eventgrid";
|
|
@@ -16,61 +15,6 @@ export declare const MOCK_QUEUE_BASE_URL = "https://mockaccount.queue.core.windo
|
|
|
16
15
|
export declare const MOCK_SEARCH_BASE_URL = "https://mockaccount.search.windows.net";
|
|
17
16
|
export declare const MOCK_TABLE_BASE_URL = "https://mockaccount.table.core.windows.net";
|
|
18
17
|
//#endregion
|
|
19
|
-
//#region src/models/MockResponse.d.ts
|
|
20
|
-
export interface MockResponse {
|
|
21
|
-
headers: HttpHeadersLike;
|
|
22
|
-
parsedHeaders: Record<string, never>;
|
|
23
|
-
request: WebResourceLike;
|
|
24
|
-
status: number;
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/models/MockRestError.d.ts
|
|
28
|
-
export declare class MockRestError extends RestError {
|
|
29
|
-
constructor(message: string, statusCode: number);
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/models/PageSettings.d.ts
|
|
33
|
-
/**
|
|
34
|
-
* An interface that tracks the settings for paged iteration
|
|
35
|
-
*/
|
|
36
|
-
export interface PageSettings {
|
|
37
|
-
/**
|
|
38
|
-
* The token that keeps track of where to continue the iterator
|
|
39
|
-
*/
|
|
40
|
-
continuationToken?: string;
|
|
41
|
-
/**
|
|
42
|
-
* The size of the page during paged iteration
|
|
43
|
-
*/
|
|
44
|
-
maxPageSize?: number;
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region src/models/PagedAsyncIterableIterator.d.ts
|
|
48
|
-
/**
|
|
49
|
-
* An interface that allows async iterable iteration both to completion and by page.
|
|
50
|
-
*/
|
|
51
|
-
export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings = PageSettings> {
|
|
52
|
-
/**
|
|
53
|
-
* The connection to the async iterator, part of the iteration protocol
|
|
54
|
-
*/
|
|
55
|
-
[Symbol.asyncIterator]: () => PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
56
|
-
/**
|
|
57
|
-
* Return an AsyncIterableIterator that works a page at a time
|
|
58
|
-
*/
|
|
59
|
-
byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
|
|
60
|
-
/**
|
|
61
|
-
* The next method, part of the iteration protocol
|
|
62
|
-
*/
|
|
63
|
-
next: () => Promise<IteratorResult<TElement>>;
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region src/services/createMockResponse.d.ts
|
|
67
|
-
export declare const createMockResponse: (status: number, url?: string) => MockResponse;
|
|
68
|
-
//#endregion
|
|
69
|
-
//#region src/services/getMockSasUrl.d.ts
|
|
70
|
-
export declare const getMockSasUrl: (url: string, permissions: undefined | {
|
|
71
|
-
toString: () => string;
|
|
72
|
-
}, resourceType?: string) => string;
|
|
73
|
-
//#endregion
|
|
74
18
|
//#region src/models/container/MockBlobDates.d.ts
|
|
75
19
|
export interface MockBlobDates {
|
|
76
20
|
createdOn: Date;
|
|
@@ -109,6 +53,9 @@ export type BlobHierarchyItem = (BlobItem & {
|
|
|
109
53
|
kind: "prefix";
|
|
110
54
|
});
|
|
111
55
|
//#endregion
|
|
56
|
+
//#region src/util/types/MapValue.d.ts
|
|
57
|
+
export type MapValue<BaseType> = BaseType extends Map<unknown, infer ValueType> ? ValueType : never;
|
|
58
|
+
//#endregion
|
|
112
59
|
//#region src/models/container/MockBlobBatchClient.d.ts
|
|
113
60
|
export declare class MockBlobBatchClient implements BlobBatchClient {
|
|
114
61
|
#private;
|
|
@@ -124,7 +71,7 @@ export declare class MockBlobBatchClient implements BlobBatchClient {
|
|
|
124
71
|
getContainer(containerName: string): MapValue<typeof MockContainerDatabase>;
|
|
125
72
|
}
|
|
126
73
|
//#endregion
|
|
127
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
74
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-any.d.ts
|
|
128
75
|
/**
|
|
129
76
|
Returns a boolean for whether the given type is `any`.
|
|
130
77
|
|
|
@@ -155,7 +102,7 @@ const anyA = get(anyObject, 'a');
|
|
|
155
102
|
*/
|
|
156
103
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
157
104
|
//#endregion
|
|
158
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
105
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
159
106
|
/**
|
|
160
107
|
Returns a boolean for whether the given key is an optional key of type.
|
|
161
108
|
|
|
@@ -198,7 +145,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
198
145
|
*/
|
|
199
146
|
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;
|
|
200
147
|
//#endregion
|
|
201
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
148
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
202
149
|
/**
|
|
203
150
|
Extract all optional keys from the given type.
|
|
204
151
|
|
|
@@ -236,7 +183,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
236
183
|
? (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`
|
|
237
184
|
: never; // Should never happen
|
|
238
185
|
//#endregion
|
|
239
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
186
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
240
187
|
/**
|
|
241
188
|
Extract all required keys from the given type.
|
|
242
189
|
|
|
@@ -270,7 +217,7 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
|
270
217
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
271
218
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never; // Should never happen
|
|
272
219
|
//#endregion
|
|
273
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
220
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-never.d.ts
|
|
274
221
|
/**
|
|
275
222
|
Returns a boolean for whether the given type is `never`.
|
|
276
223
|
|
|
@@ -326,7 +273,7 @@ type B = IsTrueFixed<never>;
|
|
|
326
273
|
*/
|
|
327
274
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
328
275
|
//#endregion
|
|
329
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
276
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/if.d.ts
|
|
330
277
|
/**
|
|
331
278
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
332
279
|
|
|
@@ -421,7 +368,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
|
421
368
|
*/
|
|
422
369
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
423
370
|
//#endregion
|
|
424
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
371
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/simplify.d.ts
|
|
425
372
|
/**
|
|
426
373
|
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.
|
|
427
374
|
|
|
@@ -482,7 +429,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
482
429
|
*/
|
|
483
430
|
type Simplify<T> = { [KeyType in keyof T]: T[KeyType]; } & {};
|
|
484
431
|
//#endregion
|
|
485
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
432
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/is-equal.d.ts
|
|
486
433
|
/**
|
|
487
434
|
Returns a boolean for whether the two given types are equal.
|
|
488
435
|
|
|
@@ -513,7 +460,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
|
|
|
513
460
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
514
461
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
515
462
|
//#endregion
|
|
516
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
463
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
517
464
|
/**
|
|
518
465
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
519
466
|
|
|
@@ -607,7 +554,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
607
554
|
*/
|
|
608
555
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType]; };
|
|
609
556
|
//#endregion
|
|
610
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
557
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
611
558
|
/**
|
|
612
559
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
613
560
|
|
|
@@ -655,7 +602,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
655
602
|
*/
|
|
656
603
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType]; };
|
|
657
604
|
//#endregion
|
|
658
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
605
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/merge.d.ts
|
|
659
606
|
// Merges two objects without worrying about index signatures.
|
|
660
607
|
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key]; } & Source>;
|
|
661
608
|
/**
|
|
@@ -726,7 +673,7 @@ type Merge<Destination, Source> = Destination extends unknown // For distributin
|
|
|
726
673
|
: never; // Should never happen
|
|
727
674
|
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
728
675
|
//#endregion
|
|
729
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
676
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/internal/object.d.ts
|
|
730
677
|
/**
|
|
731
678
|
Merges user specified options with default options.
|
|
732
679
|
|
|
@@ -783,7 +730,7 @@ type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<
|
|
|
783
730
|
) ? Result : never;
|
|
784
731
|
type _ApplyDefaultOptions<Options, Defaults, SpecifiedOptions> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Merge<Defaults, { [Key in keyof SpecifiedOptions as undefined extends Required<Options>[Key & keyof Options] ? Key : undefined extends SpecifiedOptions[Key] ? never : Key]: SpecifiedOptions[Key]; }>>>;
|
|
785
732
|
//#endregion
|
|
786
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
733
|
+
//#region ../../node_modules/.pnpm/type-fest@5.10.0/node_modules/type-fest/source/except.d.ts
|
|
787
734
|
/**
|
|
788
735
|
Filter out keys from an object.
|
|
789
736
|
|
|
@@ -940,6 +887,40 @@ export declare class MockBlockBlobClient extends MockBlobClient implements Excep
|
|
|
940
887
|
uploadStream(): Promise<BlobUploadCommonResponse>;
|
|
941
888
|
}
|
|
942
889
|
//#endregion
|
|
890
|
+
//#region src/models/shared/PageSettings.d.ts
|
|
891
|
+
/**
|
|
892
|
+
* An interface that tracks the settings for paged iteration
|
|
893
|
+
*/
|
|
894
|
+
export interface PageSettings {
|
|
895
|
+
/**
|
|
896
|
+
* The token that keeps track of where to continue the iterator
|
|
897
|
+
*/
|
|
898
|
+
continuationToken?: string;
|
|
899
|
+
/**
|
|
900
|
+
* The size of the page during paged iteration
|
|
901
|
+
*/
|
|
902
|
+
maxPageSize?: number;
|
|
903
|
+
}
|
|
904
|
+
//#endregion
|
|
905
|
+
//#region src/models/shared/PagedAsyncIterableIterator.d.ts
|
|
906
|
+
/**
|
|
907
|
+
* An interface that allows async iterable iteration both to completion and by page.
|
|
908
|
+
*/
|
|
909
|
+
export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings = PageSettings> {
|
|
910
|
+
/**
|
|
911
|
+
* The connection to the async iterator, part of the iteration protocol
|
|
912
|
+
*/
|
|
913
|
+
[Symbol.asyncIterator]: () => PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
914
|
+
/**
|
|
915
|
+
* Return an AsyncIterableIterator that works a page at a time
|
|
916
|
+
*/
|
|
917
|
+
byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
|
|
918
|
+
/**
|
|
919
|
+
* The next method, part of the iteration protocol
|
|
920
|
+
*/
|
|
921
|
+
next: () => Promise<IteratorResult<TElement>>;
|
|
922
|
+
}
|
|
923
|
+
//#endregion
|
|
943
924
|
//#region src/models/container/MockContainerClient.d.ts
|
|
944
925
|
/**
|
|
945
926
|
* An in-memory mock of the Azure ContainerClient — no emulator and no network.
|
|
@@ -1091,6 +1072,19 @@ export declare class MockServiceBusSender implements ServiceBusSender {
|
|
|
1091
1072
|
sendMessages(messages: ServiceBusMessage | ServiceBusMessage[] | ServiceBusMessageBatch): Promise<void>;
|
|
1092
1073
|
}
|
|
1093
1074
|
//#endregion
|
|
1075
|
+
//#region src/models/shared/MockResponse.d.ts
|
|
1076
|
+
export interface MockResponse {
|
|
1077
|
+
headers: HttpHeadersLike;
|
|
1078
|
+
parsedHeaders: Record<string, never>;
|
|
1079
|
+
request: WebResourceLike;
|
|
1080
|
+
status: number;
|
|
1081
|
+
}
|
|
1082
|
+
//#endregion
|
|
1083
|
+
//#region src/models/shared/MockRestError.d.ts
|
|
1084
|
+
export declare class MockRestError extends RestError {
|
|
1085
|
+
constructor(message: string, statusCode: number);
|
|
1086
|
+
}
|
|
1087
|
+
//#endregion
|
|
1094
1088
|
//#region src/models/table/MockTableClient.d.ts
|
|
1095
1089
|
/**
|
|
1096
1090
|
* An in-memory mock of the Azure TableClient — no emulator and no network.
|
|
@@ -1223,6 +1217,14 @@ export declare const getMockQueueMessageItem: (messageText: string) => {
|
|
|
1223
1217
|
messageText: string;
|
|
1224
1218
|
};
|
|
1225
1219
|
//#endregion
|
|
1220
|
+
//#region src/services/shared/createMockResponse.d.ts
|
|
1221
|
+
export declare const createMockResponse: (status: number, url?: string) => MockResponse;
|
|
1222
|
+
//#endregion
|
|
1223
|
+
//#region src/services/shared/getMockSasUrl.d.ts
|
|
1224
|
+
export declare const getMockSasUrl: (url: string, permissions: undefined | {
|
|
1225
|
+
toString: () => string;
|
|
1226
|
+
}, resourceType?: string) => string;
|
|
1227
|
+
//#endregion
|
|
1226
1228
|
//#region src/services/table/compareByCompositeKey.d.ts
|
|
1227
1229
|
export declare const compareByCompositeKey: (firstEntity: TableEntity, secondEntity: TableEntity) => number;
|
|
1228
1230
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RestError, createHttpHeaders, createPipelineRequest } from "@azure/core-rest-pipeline";
|
|
2
|
-
import { toHttpHeadersLike } from "@azure/core-http-compat";
|
|
3
1
|
import { ID_SEPARATOR, InvalidOperationError, Operation, chunk, exhaustiveGuard, getDecodedUriComponent, getOrCreate, getResult, html, noop, streamToText, takeOne } from "@esposter/shared";
|
|
2
|
+
import { toHttpHeadersLike } from "@azure/core-http-compat";
|
|
3
|
+
import { RestError, createHttpHeaders, createPipelineRequest } from "@azure/core-rest-pipeline";
|
|
4
4
|
import { AnonymousCredential } from "@azure/storage-blob";
|
|
5
5
|
import { Readable } from "node:stream";
|
|
6
6
|
import { AZURE_MAX_PAGE_SIZE, AZURE_MAX_QUEUE_VISIBILITY_TIMEOUT_MS, BinaryOperator, deserializeClause, deserializeKey, getTableNullClause, serializeClauses } from "@esposter/azure";
|
|
@@ -13,52 +13,6 @@ const MOCK_QUEUE_BASE_URL = "https://mockaccount.queue.core.windows.net";
|
|
|
13
13
|
const MOCK_SEARCH_BASE_URL = "https://mockaccount.search.windows.net";
|
|
14
14
|
const MOCK_TABLE_BASE_URL = "https://mockaccount.table.core.windows.net";
|
|
15
15
|
//#endregion
|
|
16
|
-
//#region src/models/MockRestError.ts
|
|
17
|
-
var MockRestError = class extends RestError {
|
|
18
|
-
constructor(message, statusCode) {
|
|
19
|
-
super(message, { statusCode });
|
|
20
|
-
this.name = "MockRestError";
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region src/services/container/toWebResourceLike.ts
|
|
25
|
-
const toWebResourceLike = (request) => ({
|
|
26
|
-
abortSignal: request.abortSignal,
|
|
27
|
-
agent: request.agent,
|
|
28
|
-
body: request.body,
|
|
29
|
-
clone: () => {
|
|
30
|
-
throw new Error("Cannot clone a non-proxied WebResourceLike");
|
|
31
|
-
},
|
|
32
|
-
formData: request.formData,
|
|
33
|
-
headers: toHttpHeadersLike(request.headers),
|
|
34
|
-
keepAlive: request.disableKeepAlive,
|
|
35
|
-
method: request.method,
|
|
36
|
-
onDownloadProgress: request.onDownloadProgress,
|
|
37
|
-
onUploadProgress: request.onUploadProgress,
|
|
38
|
-
prepare: () => {
|
|
39
|
-
throw new Error("WebResourceLike.prepare() is not supported by @azure/core-http-compat");
|
|
40
|
-
},
|
|
41
|
-
proxySettings: request.proxySettings,
|
|
42
|
-
requestId: request.headers.get("x-ms-client-request-id") ?? request.requestId,
|
|
43
|
-
requestOverrides: request.requestOverrides,
|
|
44
|
-
streamResponseStatusCodes: request.streamResponseStatusCodes,
|
|
45
|
-
timeout: request.timeout,
|
|
46
|
-
url: request.url,
|
|
47
|
-
validateRequestProperties: noop,
|
|
48
|
-
withCredentials: request.withCredentials
|
|
49
|
-
});
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region src/services/createMockResponse.ts
|
|
52
|
-
const createMockResponse = (status, url = "") => ({
|
|
53
|
-
headers: toHttpHeadersLike(createHttpHeaders()),
|
|
54
|
-
parsedHeaders: {},
|
|
55
|
-
request: toWebResourceLike(createPipelineRequest({ url })),
|
|
56
|
-
status
|
|
57
|
-
});
|
|
58
|
-
//#endregion
|
|
59
|
-
//#region src/services/getMockSasUrl.ts
|
|
60
|
-
const getMockSasUrl = (url, permissions, resourceType) => `${url}?sv=2025-11-05&${resourceType ? `sr=${resourceType}&` : ""}sig=mock-signature&st=1970-01-01T00:00:00Z&se=2099-12-31T23:59:59Z&sp=${permissions?.toString() ?? "r"}`;
|
|
61
|
-
//#endregion
|
|
62
16
|
//#region src/store/MockContainerBlobDatesDatabase.ts
|
|
63
17
|
const MockContainerBlobDatesDatabase = /* @__PURE__ */ new Map();
|
|
64
18
|
//#endregion
|
|
@@ -137,6 +91,41 @@ const getBlobUrlParts = (url) => {
|
|
|
137
91
|
};
|
|
138
92
|
};
|
|
139
93
|
//#endregion
|
|
94
|
+
//#region src/services/container/toWebResourceLike.ts
|
|
95
|
+
const toWebResourceLike = (request) => ({
|
|
96
|
+
abortSignal: request.abortSignal,
|
|
97
|
+
agent: request.agent,
|
|
98
|
+
body: request.body,
|
|
99
|
+
clone: () => {
|
|
100
|
+
throw new Error("Cannot clone a non-proxied WebResourceLike");
|
|
101
|
+
},
|
|
102
|
+
formData: request.formData,
|
|
103
|
+
headers: toHttpHeadersLike(request.headers),
|
|
104
|
+
keepAlive: request.disableKeepAlive,
|
|
105
|
+
method: request.method,
|
|
106
|
+
onDownloadProgress: request.onDownloadProgress,
|
|
107
|
+
onUploadProgress: request.onUploadProgress,
|
|
108
|
+
prepare: () => {
|
|
109
|
+
throw new Error("WebResourceLike.prepare() is not supported by @azure/core-http-compat");
|
|
110
|
+
},
|
|
111
|
+
proxySettings: request.proxySettings,
|
|
112
|
+
requestId: request.headers.get("x-ms-client-request-id") ?? request.requestId,
|
|
113
|
+
requestOverrides: request.requestOverrides,
|
|
114
|
+
streamResponseStatusCodes: request.streamResponseStatusCodes,
|
|
115
|
+
timeout: request.timeout,
|
|
116
|
+
url: request.url,
|
|
117
|
+
validateRequestProperties: noop,
|
|
118
|
+
withCredentials: request.withCredentials
|
|
119
|
+
});
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/services/shared/createMockResponse.ts
|
|
122
|
+
const createMockResponse = (status, url = "") => ({
|
|
123
|
+
headers: toHttpHeadersLike(createHttpHeaders()),
|
|
124
|
+
parsedHeaders: {},
|
|
125
|
+
request: toWebResourceLike(createPipelineRequest({ url })),
|
|
126
|
+
status
|
|
127
|
+
});
|
|
128
|
+
//#endregion
|
|
140
129
|
//#region src/models/container/MockBlobBatchClient.ts
|
|
141
130
|
var MockBlobBatchClient = class {
|
|
142
131
|
url;
|
|
@@ -208,6 +197,14 @@ var MockBlobBatchClient = class {
|
|
|
208
197
|
}
|
|
209
198
|
};
|
|
210
199
|
//#endregion
|
|
200
|
+
//#region src/models/shared/MockRestError.ts
|
|
201
|
+
var MockRestError = class extends RestError {
|
|
202
|
+
constructor(message, statusCode) {
|
|
203
|
+
super(message, { statusCode });
|
|
204
|
+
this.name = "MockRestError";
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
//#endregion
|
|
211
208
|
//#region src/services/container/getBlobUrl.ts
|
|
212
209
|
const getBlobUrl = (containerName, blobName) => `${MOCK_BLOB_BASE_URL}/${containerName}/${blobName.split("/").map((segment) => encodeURIComponent(segment)).join("/")}`;
|
|
213
210
|
//#endregion
|
|
@@ -233,6 +230,9 @@ const storeMockBlobWrite = (containerName, blobName, isExisting) => {
|
|
|
233
230
|
});
|
|
234
231
|
};
|
|
235
232
|
//#endregion
|
|
233
|
+
//#region src/services/shared/getMockSasUrl.ts
|
|
234
|
+
const getMockSasUrl = (url, permissions, resourceType) => `${url}?sv=2025-11-05&${resourceType ? `sr=${resourceType}&` : ""}sig=mock-signature&st=1970-01-01T00:00:00Z&se=2099-12-31T23:59:59Z&sp=${permissions?.toString() ?? "r"}`;
|
|
235
|
+
//#endregion
|
|
236
236
|
//#region src/models/container/MockBlobClient.ts
|
|
237
237
|
var MockBlobClient = class {
|
|
238
238
|
connectionString;
|
|
@@ -841,26 +841,21 @@ var MockQueueClient = class {
|
|
|
841
841
|
sendMessage(messageText, _options) {
|
|
842
842
|
this.queue.push(messageText);
|
|
843
843
|
const { expiresOn, insertedOn, messageId } = getMockQueueMessageItem(messageText);
|
|
844
|
-
const
|
|
845
|
-
const popReceipt = crypto.randomUUID();
|
|
846
|
-
const enqueuedMessages = [{
|
|
844
|
+
const enqueuedMessage = {
|
|
847
845
|
expiresOn,
|
|
848
846
|
insertedOn,
|
|
849
847
|
messageId,
|
|
850
|
-
nextVisibleOn,
|
|
851
|
-
popReceipt
|
|
852
|
-
}
|
|
848
|
+
nextVisibleOn: insertedOn,
|
|
849
|
+
popReceipt: crypto.randomUUID()
|
|
850
|
+
};
|
|
851
|
+
const enqueuedMessages = [enqueuedMessage];
|
|
853
852
|
return Promise.resolve({
|
|
854
853
|
_response: {
|
|
855
854
|
...createMockResponse(200, this.url),
|
|
856
855
|
bodyAsText: "",
|
|
857
856
|
parsedBody: enqueuedMessages
|
|
858
857
|
},
|
|
859
|
-
|
|
860
|
-
insertedOn,
|
|
861
|
-
messageId,
|
|
862
|
-
nextVisibleOn,
|
|
863
|
-
popReceipt
|
|
858
|
+
...enqueuedMessage
|
|
864
859
|
});
|
|
865
860
|
}
|
|
866
861
|
setAccessPolicy(_identifiers) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "azure-mock",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "A library that contains azure mock classes.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"azure",
|
|
@@ -54,18 +54,18 @@
|
|
|
54
54
|
"typecheck": "tsc"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@esposter/azure": "2.
|
|
58
|
-
"@esposter/shared": "2.
|
|
57
|
+
"@esposter/azure": "3.2.0",
|
|
58
|
+
"@esposter/shared": "3.2.0",
|
|
59
59
|
"fast-deep-equal": "^3.1.3"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@arethetypeswrong/core": "^0.18.5",
|
|
63
|
-
"@esposter/configuration": "2.
|
|
63
|
+
"@esposter/configuration": "3.2.0",
|
|
64
64
|
"publint": "^0.3.24",
|
|
65
65
|
"tsdown": "^0.23.0",
|
|
66
|
-
"type-fest": "^5.
|
|
66
|
+
"type-fest": "^5.10.0",
|
|
67
67
|
"typedoc": "^0.28.20",
|
|
68
|
-
"vitest": "^5.0.
|
|
68
|
+
"vitest": "^5.0.1"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@azure/core-http-compat": "^2.5.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@azure/storage-queue": "^12.31.0"
|
|
79
79
|
},
|
|
80
80
|
"inlinedDependencies": {
|
|
81
|
-
"type-fest": "5.
|
|
81
|
+
"type-fest": "5.10.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "bc055ed2f154eff219a355016a6b586962dbfa9c"
|
|
84
84
|
}
|