@currents/cmd 1.2.1 → 1.3.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.md +4 -620
- package/dist/bin/index.js +36 -35
- package/dist/index.js +1 -1
- package/package.json +6 -6
package/LICENSE.md
CHANGED
|
@@ -1,624 +1,8 @@
|
|
|
1
|
-
Copyright
|
|
2
|
-
All rights reserved.
|
|
1
|
+
Copyright 2024 Currents Software Inc
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
9
8
|
|
|
10
|
-
Everyone is permitted to copy and distribute verbatim copies
|
|
11
|
-
of this license document, but changing it is not allowed.
|
|
12
|
-
|
|
13
|
-
## Preamble
|
|
14
|
-
|
|
15
|
-
The GNU General Public License is a free, copyleft license for
|
|
16
|
-
software and other kinds of works.
|
|
17
|
-
|
|
18
|
-
The licenses for most software and other practical works are designed
|
|
19
|
-
to take away your freedom to share and change the works. By contrast,
|
|
20
|
-
the GNU General Public License is intended to guarantee your freedom to
|
|
21
|
-
share and change all versions of a program--to make sure it remains free
|
|
22
|
-
software for all its users. We, the Free Software Foundation, use the
|
|
23
|
-
GNU General Public License for most of our software; it applies also to
|
|
24
|
-
any other work released this way by its authors. You can apply it to
|
|
25
|
-
your programs, too.
|
|
26
|
-
|
|
27
|
-
When we speak of free software, we are referring to freedom, not
|
|
28
|
-
price. Our General Public Licenses are designed to make sure that you
|
|
29
|
-
have the freedom to distribute copies of free software (and charge for
|
|
30
|
-
them if you wish), that you receive source code or can get it if you
|
|
31
|
-
want it, that you can change the software or use pieces of it in new
|
|
32
|
-
free programs, and that you know you can do these things.
|
|
33
|
-
|
|
34
|
-
To protect your rights, we need to prevent others from denying you
|
|
35
|
-
these rights or asking you to surrender the rights. Therefore, you have
|
|
36
|
-
certain responsibilities if you distribute copies of the software, or if
|
|
37
|
-
you modify it: responsibilities to respect the freedom of others.
|
|
38
|
-
|
|
39
|
-
For example, if you distribute copies of such a program, whether
|
|
40
|
-
gratis or for a fee, you must pass on to the recipients the same
|
|
41
|
-
freedoms that you received. You must make sure that they, too, receive
|
|
42
|
-
or can get the source code. And you must show them these terms so they
|
|
43
|
-
know their rights.
|
|
44
|
-
|
|
45
|
-
Developers that use the GNU GPL protect your rights with two steps:
|
|
46
|
-
(1) assert copyright on the software, and (2) offer you this License
|
|
47
|
-
giving you legal permission to copy, distribute and/or modify it.
|
|
48
|
-
|
|
49
|
-
For the developers' and authors' protection, the GPL clearly explains
|
|
50
|
-
that there is no warranty for this free software. For both users' and
|
|
51
|
-
authors' sake, the GPL requires that modified versions be marked as
|
|
52
|
-
changed, so that their problems will not be attributed erroneously to
|
|
53
|
-
authors of previous versions.
|
|
54
|
-
|
|
55
|
-
Some devices are designed to deny users access to install or run
|
|
56
|
-
modified versions of the software inside them, although the manufacturer
|
|
57
|
-
can do so. This is fundamentally incompatible with the aim of
|
|
58
|
-
protecting users' freedom to change the software. The systematic
|
|
59
|
-
pattern of such abuse occurs in the area of products for individuals to
|
|
60
|
-
use, which is precisely where it is most unacceptable. Therefore, we
|
|
61
|
-
have designed this version of the GPL to prohibit the practice for those
|
|
62
|
-
products. If such problems arise substantially in other domains, we
|
|
63
|
-
stand ready to extend this provision to those domains in future versions
|
|
64
|
-
of the GPL, as needed to protect the freedom of users.
|
|
65
|
-
|
|
66
|
-
Finally, every program is threatened constantly by software patents.
|
|
67
|
-
States should not allow patents to restrict development and use of
|
|
68
|
-
software on general-purpose computers, but in those that do, we wish to
|
|
69
|
-
avoid the special danger that patents applied to a free program could
|
|
70
|
-
make it effectively proprietary. To prevent this, the GPL assures that
|
|
71
|
-
patents cannot be used to render the program non-free.
|
|
72
|
-
|
|
73
|
-
The precise terms and conditions for copying, distribution and
|
|
74
|
-
modification follow.
|
|
75
|
-
|
|
76
|
-
## TERMS AND CONDITIONS
|
|
77
|
-
|
|
78
|
-
### 0. Definitions
|
|
79
|
-
|
|
80
|
-
"This License" refers to version 3 of the GNU General Public License.
|
|
81
|
-
|
|
82
|
-
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
83
|
-
works, such as semiconductor masks.
|
|
84
|
-
|
|
85
|
-
"The Program" refers to any copyrightable work licensed under this
|
|
86
|
-
License. Each licensee is addressed as "you". "Licensees" and
|
|
87
|
-
"recipients" may be individuals or organizations.
|
|
88
|
-
|
|
89
|
-
To "modify" a work means to copy from or adapt all or part of the work
|
|
90
|
-
in a fashion requiring copyright permission, other than the making of an
|
|
91
|
-
exact copy. The resulting work is called a "modified version" of the
|
|
92
|
-
earlier work or a work "based on" the earlier work.
|
|
93
|
-
|
|
94
|
-
A "covered work" means either the unmodified Program or a work based
|
|
95
|
-
on the Program.
|
|
96
|
-
|
|
97
|
-
To "propagate" a work means to do anything with it that, without
|
|
98
|
-
permission, would make you directly or secondarily liable for
|
|
99
|
-
infringement under applicable copyright law, except executing it on a
|
|
100
|
-
computer or modifying a private copy. Propagation includes copying,
|
|
101
|
-
distribution (with or without modification), making available to the
|
|
102
|
-
public, and in some countries other activities as well.
|
|
103
|
-
|
|
104
|
-
To "convey" a work means any kind of propagation that enables other
|
|
105
|
-
parties to make or receive copies. Mere interaction with a user through
|
|
106
|
-
a computer network, with no transfer of a copy, is not conveying.
|
|
107
|
-
|
|
108
|
-
An interactive user interface displays "Appropriate Legal Notices"
|
|
109
|
-
to the extent that it includes a convenient and prominently visible
|
|
110
|
-
feature that (1) displays an appropriate copyright notice, and (2)
|
|
111
|
-
tells the user that there is no warranty for the work (except to the
|
|
112
|
-
extent that warranties are provided), that licensees may convey the
|
|
113
|
-
work under this License, and how to view a copy of this License. If
|
|
114
|
-
the interface presents a list of user commands or options, such as a
|
|
115
|
-
menu, a prominent item in the list meets this criterion.
|
|
116
|
-
|
|
117
|
-
### 1. Source Code
|
|
118
|
-
|
|
119
|
-
The "source code" for a work means the preferred form of the work
|
|
120
|
-
for making modifications to it. "Object code" means any non-source
|
|
121
|
-
form of a work.
|
|
122
|
-
|
|
123
|
-
A "Standard Interface" means an interface that either is an official
|
|
124
|
-
standard defined by a recognized standards body, or, in the case of
|
|
125
|
-
interfaces specified for a particular programming language, one that
|
|
126
|
-
is widely used among developers working in that language.
|
|
127
|
-
|
|
128
|
-
The "System Libraries" of an executable work include anything, other
|
|
129
|
-
than the work as a whole, that (a) is included in the normal form of
|
|
130
|
-
packaging a Major Component, but which is not part of that Major
|
|
131
|
-
Component, and (b) serves only to enable use of the work with that
|
|
132
|
-
Major Component, or to implement a Standard Interface for which an
|
|
133
|
-
implementation is available to the public in source code form. A
|
|
134
|
-
"Major Component", in this context, means a major essential component
|
|
135
|
-
(kernel, window system, and so on) of the specific operating system
|
|
136
|
-
(if any) on which the executable work runs, or a compiler used to
|
|
137
|
-
produce the work, or an object code interpreter used to run it.
|
|
138
|
-
|
|
139
|
-
The "Corresponding Source" for a work in object code form means all
|
|
140
|
-
the source code needed to generate, install, and (for an executable
|
|
141
|
-
work) run the object code and to modify the work, including scripts to
|
|
142
|
-
control those activities. However, it does not include the work's
|
|
143
|
-
System Libraries, or general-purpose tools or generally available free
|
|
144
|
-
programs which are used unmodified in performing those activities but
|
|
145
|
-
which are not part of the work. For example, Corresponding Source
|
|
146
|
-
includes interface definition files associated with source files for
|
|
147
|
-
the work, and the source code for shared libraries and dynamically
|
|
148
|
-
linked subprograms that the work is specifically designed to require,
|
|
149
|
-
such as by intimate data communication or control flow between those
|
|
150
|
-
subprograms and other parts of the work.
|
|
151
|
-
|
|
152
|
-
The Corresponding Source need not include anything that users
|
|
153
|
-
can regenerate automatically from other parts of the Corresponding
|
|
154
|
-
Source.
|
|
155
|
-
|
|
156
|
-
The Corresponding Source for a work in source code form is that
|
|
157
|
-
same work.
|
|
158
|
-
|
|
159
|
-
### 2. Basic Permissions
|
|
160
|
-
|
|
161
|
-
All rights granted under this License are granted for the term of
|
|
162
|
-
copyright on the Program, and are irrevocable provided the stated
|
|
163
|
-
conditions are met. This License explicitly affirms your unlimited
|
|
164
|
-
permission to run the unmodified Program. The output from running a
|
|
165
|
-
covered work is covered by this License only if the output, given its
|
|
166
|
-
content, constitutes a covered work. This License acknowledges your
|
|
167
|
-
rights of fair use or other equivalent, as provided by copyright law.
|
|
168
|
-
|
|
169
|
-
You may make, run and propagate covered works that you do not
|
|
170
|
-
convey, without conditions so long as your license otherwise remains
|
|
171
|
-
in force. You may convey covered works to others for the sole purpose
|
|
172
|
-
of having them make modifications exclusively for you, or provide you
|
|
173
|
-
with facilities for running those works, provided that you comply with
|
|
174
|
-
the terms of this License in conveying all material for which you do
|
|
175
|
-
not control copyright. Those thus making or running the covered works
|
|
176
|
-
for you must do so exclusively on your behalf, under your direction
|
|
177
|
-
and control, on terms that prohibit them from making any copies of
|
|
178
|
-
your copyrighted material outside their relationship with you.
|
|
179
|
-
|
|
180
|
-
Conveying under any other circumstances is permitted solely under
|
|
181
|
-
the conditions stated below. Sublicensing is not allowed; section 10
|
|
182
|
-
makes it unnecessary.
|
|
183
|
-
|
|
184
|
-
### 3. Protecting Users' Legal Rights From Anti-Circumvention Law
|
|
185
|
-
|
|
186
|
-
No covered work shall be deemed part of an effective technological
|
|
187
|
-
measure under any applicable law fulfilling obligations under article
|
|
188
|
-
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
189
|
-
similar laws prohibiting or restricting circumvention of such
|
|
190
|
-
measures.
|
|
191
|
-
|
|
192
|
-
When you convey a covered work, you waive any legal power to forbid
|
|
193
|
-
circumvention of technological measures to the extent such circumvention
|
|
194
|
-
is effected by exercising rights under this License with respect to
|
|
195
|
-
the covered work, and you disclaim any intention to limit operation or
|
|
196
|
-
modification of the work as a means of enforcing, against the work's
|
|
197
|
-
users, your or third parties' legal rights to forbid circumvention of
|
|
198
|
-
technological measures.
|
|
199
|
-
|
|
200
|
-
### 4. Conveying Verbatim Copies
|
|
201
|
-
|
|
202
|
-
You may convey verbatim copies of the Program's source code as you
|
|
203
|
-
receive it, in any medium, provided that you conspicuously and
|
|
204
|
-
appropriately publish on each copy an appropriate copyright notice;
|
|
205
|
-
keep intact all notices stating that this License and any
|
|
206
|
-
non-permissive terms added in accord with section 7 apply to the code;
|
|
207
|
-
keep intact all notices of the absence of any warranty; and give all
|
|
208
|
-
recipients a copy of this License along with the Program.
|
|
209
|
-
|
|
210
|
-
You may charge any price or no price for each copy that you convey,
|
|
211
|
-
and you may offer support or warranty protection for a fee.
|
|
212
|
-
|
|
213
|
-
### 5. Conveying Modified Source Versions
|
|
214
|
-
|
|
215
|
-
You may convey a work based on the Program, or the modifications to
|
|
216
|
-
produce it from the Program, in the form of source code under the
|
|
217
|
-
terms of section 4, provided that you also meet all of these conditions:
|
|
218
|
-
|
|
219
|
-
- a) The work must carry prominent notices stating that you modified
|
|
220
|
-
it, and giving a relevant date.
|
|
221
|
-
|
|
222
|
-
- b) The work must carry prominent notices stating that it is
|
|
223
|
-
released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
|
|
224
|
-
|
|
225
|
-
- c) You must license the entire work, as a whole, under this
|
|
226
|
-
License to anyone who comes into possession of a copy. This
|
|
227
|
-
License will therefore apply, along with any applicable section 7
|
|
228
|
-
additional terms, to the whole of the work, and all its parts,
|
|
229
|
-
regardless of how they are packaged. This License gives no
|
|
230
|
-
permission to license the work in any other way, but it does not
|
|
231
|
-
invalidate such permission if you have separately received it.
|
|
232
|
-
|
|
233
|
-
- d) If the work has interactive user interfaces, each must display
|
|
234
|
-
Appropriate Legal Notices; however, if the Program has interactive
|
|
235
|
-
interfaces that do not display Appropriate Legal Notices, your
|
|
236
|
-
work need not make them do so.
|
|
237
|
-
|
|
238
|
-
A compilation of a covered work with other separate and independent
|
|
239
|
-
works, which are not by their nature extensions of the covered work,
|
|
240
|
-
and which are not combined with it such as to form a larger program,
|
|
241
|
-
in or on a volume of a storage or distribution medium, is called an
|
|
242
|
-
"aggregate" if the compilation and its resulting copyright are not
|
|
243
|
-
used to limit the access or legal rights of the compilation's users
|
|
244
|
-
beyond what the individual works permit. Inclusion of a covered work
|
|
245
|
-
in an aggregate does not cause this License to apply to the other
|
|
246
|
-
parts of the aggregate.
|
|
247
|
-
|
|
248
|
-
### 6. Conveying Non-Source Forms
|
|
249
|
-
|
|
250
|
-
You may convey a covered work in object code form under the terms
|
|
251
|
-
of sections 4 and 5, provided that you also convey the
|
|
252
|
-
machine-readable Corresponding Source under the terms of this License,
|
|
253
|
-
in one of these ways:
|
|
254
|
-
|
|
255
|
-
- a) Convey the object code in, or embodied in, a physical product
|
|
256
|
-
(including a physical distribution medium), accompanied by the
|
|
257
|
-
Corresponding Source fixed on a durable physical medium
|
|
258
|
-
customarily used for software interchange.
|
|
259
|
-
|
|
260
|
-
- b) Convey the object code in, or embodied in, a physical product
|
|
261
|
-
(including a physical distribution medium), accompanied by a
|
|
262
|
-
written offer, valid for at least three years and valid for as
|
|
263
|
-
long as you offer spare parts or customer support for that product
|
|
264
|
-
model, to give anyone who possesses the object code either (1) a
|
|
265
|
-
copy of the Corresponding Source for all the software in the
|
|
266
|
-
product that is covered by this License, on a durable physical
|
|
267
|
-
medium customarily used for software interchange, for a price no
|
|
268
|
-
more than your reasonable cost of physically performing this
|
|
269
|
-
conveying of source, or (2) access to copy the
|
|
270
|
-
Corresponding Source from a network server at no charge.
|
|
271
|
-
|
|
272
|
-
- c) Convey individual copies of the object code with a copy of the
|
|
273
|
-
written offer to provide the Corresponding Source. This
|
|
274
|
-
alternative is allowed only occasionally and noncommercially, and
|
|
275
|
-
only if you received the object code with such an offer, in accord
|
|
276
|
-
with subsection 6b.
|
|
277
|
-
|
|
278
|
-
- d) Convey the object code by offering access from a designated
|
|
279
|
-
place (gratis or for a charge), and offer equivalent access to the
|
|
280
|
-
Corresponding Source in the same way through the same place at no
|
|
281
|
-
further charge. You need not require recipients to copy the
|
|
282
|
-
Corresponding Source along with the object code. If the place to
|
|
283
|
-
copy the object code is a network server, the Corresponding Source
|
|
284
|
-
may be on a different server (operated by you or a third party)
|
|
285
|
-
that supports equivalent copying facilities, provided you maintain
|
|
286
|
-
clear directions next to the object code saying where to find the
|
|
287
|
-
Corresponding Source. Regardless of what server hosts the
|
|
288
|
-
Corresponding Source, you remain obligated to ensure that it is
|
|
289
|
-
available for as long as needed to satisfy these requirements.
|
|
290
|
-
|
|
291
|
-
- e) Convey the object code using peer-to-peer transmission, provided
|
|
292
|
-
you inform other peers where the object code and Corresponding
|
|
293
|
-
Source of the work are being offered to the general public at no
|
|
294
|
-
charge under subsection 6d.
|
|
295
|
-
|
|
296
|
-
A separable portion of the object code, whose source code is excluded
|
|
297
|
-
from the Corresponding Source as a System Library, need not be
|
|
298
|
-
included in conveying the object code work.
|
|
299
|
-
|
|
300
|
-
A "User Product" is either (1) a "consumer product", which means any
|
|
301
|
-
tangible personal property which is normally used for personal, family,
|
|
302
|
-
or household purposes, or (2) anything designed or sold for incorporation
|
|
303
|
-
into a dwelling. In determining whether a product is a consumer product,
|
|
304
|
-
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
305
|
-
product received by a particular user, "normally used" refers to a
|
|
306
|
-
typical or common use of that class of product, regardless of the status
|
|
307
|
-
of the particular user or of the way in which the particular user
|
|
308
|
-
actually uses, or expects or is expected to use, the product. A product
|
|
309
|
-
is a consumer product regardless of whether the product has substantial
|
|
310
|
-
commercial, industrial or non-consumer uses, unless such uses represent
|
|
311
|
-
the only significant mode of use of the product.
|
|
312
|
-
|
|
313
|
-
"Installation Information" for a User Product means any methods,
|
|
314
|
-
procedures, authorization keys, or other information required to install
|
|
315
|
-
and execute modified versions of a covered work in that User Product from
|
|
316
|
-
a modified version of its Corresponding Source. The information must
|
|
317
|
-
suffice to ensure that the continued functioning of the modified object
|
|
318
|
-
code is in no case prevented or interfered with solely because
|
|
319
|
-
modification has been made.
|
|
320
|
-
|
|
321
|
-
If you convey an object code work under this section in, or with, or
|
|
322
|
-
specifically for use in, a User Product, and the conveying occurs as
|
|
323
|
-
part of a transaction in which the right of possession and use of the
|
|
324
|
-
User Product is transferred to the recipient in perpetuity or for a
|
|
325
|
-
fixed term (regardless of how the transaction is characterized), the
|
|
326
|
-
Corresponding Source conveyed under this section must be accompanied
|
|
327
|
-
by the Installation Information. But this requirement does not apply
|
|
328
|
-
if neither you nor any third party retains the ability to install
|
|
329
|
-
modified object code on the User Product (for example, the work has
|
|
330
|
-
been installed in ROM).
|
|
331
|
-
|
|
332
|
-
The requirement to provide Installation Information does not include a
|
|
333
|
-
requirement to continue to provide support service, warranty, or updates
|
|
334
|
-
for a work that has been modified or installed by the recipient, or for
|
|
335
|
-
the User Product in which it has been modified or installed. Access to a
|
|
336
|
-
network may be denied when the modification itself materially and
|
|
337
|
-
adversely affects the operation of the network or violates the rules and
|
|
338
|
-
protocols for communication across the network.
|
|
339
|
-
|
|
340
|
-
Corresponding Source conveyed, and Installation Information provided,
|
|
341
|
-
in accord with this section must be in a format that is publicly
|
|
342
|
-
documented (and with an implementation available to the public in
|
|
343
|
-
source code form), and must require no special password or key for
|
|
344
|
-
unpacking, reading or copying.
|
|
345
|
-
|
|
346
|
-
### 7. Additional Terms
|
|
347
|
-
|
|
348
|
-
"Additional permissions" are terms that supplement the terms of this
|
|
349
|
-
License by making exceptions from one or more of its conditions.
|
|
350
|
-
Additional permissions that are applicable to the entire Program shall
|
|
351
|
-
be treated as though they were included in this License, to the extent
|
|
352
|
-
that they are valid under applicable law. If additional permissions
|
|
353
|
-
apply only to part of the Program, that part may be used separately
|
|
354
|
-
under those permissions, but the entire Program remains governed by
|
|
355
|
-
this License without regard to the additional permissions.
|
|
356
|
-
|
|
357
|
-
When you convey a copy of a covered work, you may at your option
|
|
358
|
-
remove any additional permissions from that copy, or from any part of
|
|
359
|
-
it. (Additional permissions may be written to require their own
|
|
360
|
-
removal in certain cases when you modify the work.) You may place
|
|
361
|
-
additional permissions on material, added by you to a covered work,
|
|
362
|
-
for which you have or can give appropriate copyright permission.
|
|
363
|
-
|
|
364
|
-
Notwithstanding any other provision of this License, for material you
|
|
365
|
-
add to a covered work, you may (if authorized by the copyright holders of
|
|
366
|
-
that material) supplement the terms of this License with terms:
|
|
367
|
-
|
|
368
|
-
- a) Disclaiming warranty or limiting liability differently from the
|
|
369
|
-
terms of sections 15 and 16 of this License; or
|
|
370
|
-
|
|
371
|
-
- b) Requiring preservation of specified reasonable legal notices or
|
|
372
|
-
author attributions in that material or in the Appropriate Legal
|
|
373
|
-
Notices displayed by works containing it; or
|
|
374
|
-
|
|
375
|
-
- c) Prohibiting misrepresentation of the origin of that material, or
|
|
376
|
-
requiring that modified versions of such material be marked in
|
|
377
|
-
reasonable ways as different from the original version; or
|
|
378
|
-
|
|
379
|
-
- d) Limiting the use for publicity purposes of names of licensors or
|
|
380
|
-
authors of the material; or
|
|
381
|
-
|
|
382
|
-
- e) Declining to grant rights under trademark law for use of some
|
|
383
|
-
trade names, trademarks, or service marks; or
|
|
384
|
-
|
|
385
|
-
- f) Requiring indemnification of licensors and authors of that
|
|
386
|
-
material by anyone who conveys the material (or modified versions of
|
|
387
|
-
it) with contractual assumptions of liability to the recipient, for
|
|
388
|
-
any liability that these contractual assumptions directly impose on
|
|
389
|
-
those licensors and authors.
|
|
390
|
-
|
|
391
|
-
All other non-permissive additional terms are considered "further
|
|
392
|
-
restrictions" within the meaning of section 10. If the Program as you
|
|
393
|
-
received it, or any part of it, contains a notice stating that it is
|
|
394
|
-
governed by this License along with a term that is a further
|
|
395
|
-
restriction, you may remove that term. If a license document contains
|
|
396
|
-
a further restriction but permits relicensing or conveying under this
|
|
397
|
-
License, you may add to a covered work material governed by the terms
|
|
398
|
-
of that license document, provided that the further restriction does
|
|
399
|
-
not survive such relicensing or conveying.
|
|
400
|
-
|
|
401
|
-
If you add terms to a covered work in accord with this section, you
|
|
402
|
-
must place, in the relevant source files, a statement of the
|
|
403
|
-
additional terms that apply to those files, or a notice indicating
|
|
404
|
-
where to find the applicable terms.
|
|
405
|
-
|
|
406
|
-
Additional terms, permissive or non-permissive, may be stated in the
|
|
407
|
-
form of a separately written license, or stated as exceptions;
|
|
408
|
-
the above requirements apply either way.
|
|
409
|
-
|
|
410
|
-
### 8. Termination
|
|
411
|
-
|
|
412
|
-
You may not propagate or modify a covered work except as expressly
|
|
413
|
-
provided under this License. Any attempt otherwise to propagate or
|
|
414
|
-
modify it is void, and will automatically terminate your rights under
|
|
415
|
-
this License (including any patent licenses granted under the third
|
|
416
|
-
paragraph of section 11).
|
|
417
|
-
|
|
418
|
-
However, if you cease all violation of this License, then your
|
|
419
|
-
license from a particular copyright holder is reinstated (a)
|
|
420
|
-
provisionally, unless and until the copyright holder explicitly and
|
|
421
|
-
finally terminates your license, and (b) permanently, if the copyright
|
|
422
|
-
holder fails to notify you of the violation by some reasonable means
|
|
423
|
-
prior to 60 days after the cessation.
|
|
424
|
-
|
|
425
|
-
Moreover, your license from a particular copyright holder is
|
|
426
|
-
reinstated permanently if the copyright holder notifies you of the
|
|
427
|
-
violation by some reasonable means, this is the first time you have
|
|
428
|
-
received notice of violation of this License (for any work) from that
|
|
429
|
-
copyright holder, and you cure the violation prior to 30 days after
|
|
430
|
-
your receipt of the notice.
|
|
431
|
-
|
|
432
|
-
Termination of your rights under this section does not terminate the
|
|
433
|
-
licenses of parties who have received copies or rights from you under
|
|
434
|
-
this License. If your rights have been terminated and not permanently
|
|
435
|
-
reinstated, you do not qualify to receive new licenses for the same
|
|
436
|
-
material under section 10.
|
|
437
|
-
|
|
438
|
-
### 9. Acceptance Not Required for Having Copies
|
|
439
|
-
|
|
440
|
-
You are not required to accept this License in order to receive or
|
|
441
|
-
run a copy of the Program. Ancillary propagation of a covered work
|
|
442
|
-
occurring solely as a consequence of using peer-to-peer transmission
|
|
443
|
-
to receive a copy likewise does not require acceptance. However,
|
|
444
|
-
nothing other than this License grants you permission to propagate or
|
|
445
|
-
modify any covered work. These actions infringe copyright if you do
|
|
446
|
-
not accept this License. Therefore, by modifying or propagating a
|
|
447
|
-
covered work, you indicate your acceptance of this License to do so.
|
|
448
|
-
|
|
449
|
-
### 10. Automatic Licensing of Downstream Recipients
|
|
450
|
-
|
|
451
|
-
Each time you convey a covered work, the recipient automatically
|
|
452
|
-
receives a license from the original licensors, to run, modify and
|
|
453
|
-
propagate that work, subject to this License. You are not responsible
|
|
454
|
-
for enforcing compliance by third parties with this License.
|
|
455
|
-
|
|
456
|
-
An "entity transaction" is a transaction transferring control of an
|
|
457
|
-
organization, or substantially all assets of one, or subdividing an
|
|
458
|
-
organization, or merging organizations. If propagation of a covered
|
|
459
|
-
work results from an entity transaction, each party to that
|
|
460
|
-
transaction who receives a copy of the work also receives whatever
|
|
461
|
-
licenses to the work the party's predecessor in interest had or could
|
|
462
|
-
give under the previous paragraph, plus a right to possession of the
|
|
463
|
-
Corresponding Source of the work from the predecessor in interest, if
|
|
464
|
-
the predecessor has it or can get it with reasonable efforts.
|
|
465
|
-
|
|
466
|
-
You may not impose any further restrictions on the exercise of the
|
|
467
|
-
rights granted or affirmed under this License. For example, you may
|
|
468
|
-
not impose a license fee, royalty, or other charge for exercise of
|
|
469
|
-
rights granted under this License, and you may not initiate litigation
|
|
470
|
-
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
471
|
-
any patent claim is infringed by making, using, selling, offering for
|
|
472
|
-
sale, or importing the Program or any portion of it.
|
|
473
|
-
|
|
474
|
-
### 11. Patents
|
|
475
|
-
|
|
476
|
-
A "contributor" is a copyright holder who authorizes use under this
|
|
477
|
-
License of the Program or a work on which the Program is based. The
|
|
478
|
-
work thus licensed is called the contributor's "contributor version".
|
|
479
|
-
|
|
480
|
-
A contributor's "essential patent claims" are all patent claims
|
|
481
|
-
owned or controlled by the contributor, whether already acquired or
|
|
482
|
-
hereafter acquired, that would be infringed by some manner, permitted
|
|
483
|
-
by this License, of making, using, or selling its contributor version,
|
|
484
|
-
but do not include claims that would be infringed only as a
|
|
485
|
-
consequence of further modification of the contributor version. For
|
|
486
|
-
purposes of this definition, "control" includes the right to grant
|
|
487
|
-
patent sublicenses in a manner consistent with the requirements of
|
|
488
|
-
this License.
|
|
489
|
-
|
|
490
|
-
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
491
|
-
patent license under the contributor's essential patent claims, to
|
|
492
|
-
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
493
|
-
propagate the contents of its contributor version.
|
|
494
|
-
|
|
495
|
-
In the following three paragraphs, a "patent license" is any express
|
|
496
|
-
agreement or commitment, however denominated, not to enforce a patent
|
|
497
|
-
(such as an express permission to practice a patent or covenant not to
|
|
498
|
-
sue for patent infringement). To "grant" such a patent license to a
|
|
499
|
-
party means to make such an agreement or commitment not to enforce a
|
|
500
|
-
patent against the party.
|
|
501
|
-
|
|
502
|
-
If you convey a covered work, knowingly relying on a patent license,
|
|
503
|
-
and the Corresponding Source of the work is not available for anyone
|
|
504
|
-
to copy, free of charge and under the terms of this License, through a
|
|
505
|
-
publicly available network server or other readily accessible means,
|
|
506
|
-
then you must either (1) cause the Corresponding Source to be so
|
|
507
|
-
available, or (2) arrange to deprive yourself of the benefit of the
|
|
508
|
-
patent license for this particular work, or (3) arrange, in a manner
|
|
509
|
-
consistent with the requirements of this License, to extend the patent
|
|
510
|
-
license to downstream recipients. "Knowingly relying" means you have
|
|
511
|
-
actual knowledge that, but for the patent license, your conveying the
|
|
512
|
-
covered work in a country, or your recipient's use of the covered work
|
|
513
|
-
in a country, would infringe one or more identifiable patents in that
|
|
514
|
-
country that you have reason to believe are valid.
|
|
515
|
-
|
|
516
|
-
If, pursuant to or in connection with a single transaction or
|
|
517
|
-
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
518
|
-
covered work, and grant a patent license to some of the parties
|
|
519
|
-
receiving the covered work authorizing them to use, propagate, modify
|
|
520
|
-
or convey a specific copy of the covered work, then the patent license
|
|
521
|
-
you grant is automatically extended to all recipients of the covered
|
|
522
|
-
work and works based on it.
|
|
523
|
-
|
|
524
|
-
A patent license is "discriminatory" if it does not include within
|
|
525
|
-
the scope of its coverage, prohibits the exercise of, or is
|
|
526
|
-
conditioned on the non-exercise of one or more of the rights that are
|
|
527
|
-
specifically granted under this License. You may not convey a covered
|
|
528
|
-
work if you are a party to an arrangement with a third party that is
|
|
529
|
-
in the business of distributing software, under which you make payment
|
|
530
|
-
to the third party based on the extent of your activity of conveying
|
|
531
|
-
the work, and under which the third party grants, to any of the
|
|
532
|
-
parties who would receive the covered work from you, a discriminatory
|
|
533
|
-
patent license (a) in connection with copies of the covered work
|
|
534
|
-
conveyed by you (or copies made from those copies), or (b) primarily
|
|
535
|
-
for and in connection with specific products or compilations that
|
|
536
|
-
contain the covered work, unless you entered into that arrangement,
|
|
537
|
-
or that patent license was granted, prior to 28 March 2007.
|
|
538
|
-
|
|
539
|
-
Nothing in this License shall be construed as excluding or limiting
|
|
540
|
-
any implied license or other defenses to infringement that may
|
|
541
|
-
otherwise be available to you under applicable patent law.
|
|
542
|
-
|
|
543
|
-
### 12. No Surrender of Others' Freedom
|
|
544
|
-
|
|
545
|
-
If conditions are imposed on you (whether by court order, agreement or
|
|
546
|
-
otherwise) that contradict the conditions of this License, they do not
|
|
547
|
-
excuse you from the conditions of this License. If you cannot convey a
|
|
548
|
-
covered work so as to satisfy simultaneously your obligations under this
|
|
549
|
-
License and any other pertinent obligations, then as a consequence you may
|
|
550
|
-
not convey it at all. For example, if you agree to terms that obligate you
|
|
551
|
-
to collect a royalty for further conveying from those to whom you convey
|
|
552
|
-
the Program, the only way you could satisfy both those terms and this
|
|
553
|
-
License would be to refrain entirely from conveying the Program.
|
|
554
|
-
|
|
555
|
-
### 13. Use with the GNU Affero General Public License
|
|
556
|
-
|
|
557
|
-
Notwithstanding any other provision of this License, you have
|
|
558
|
-
permission to link or combine any covered work with a work licensed
|
|
559
|
-
under version 3 of the GNU Affero General Public License into a single
|
|
560
|
-
combined work, and to convey the resulting work. The terms of this
|
|
561
|
-
License will continue to apply to the part which is the covered work,
|
|
562
|
-
but the special requirements of the GNU Affero General Public License,
|
|
563
|
-
section 13, concerning interaction through a network will apply to the
|
|
564
|
-
combination as such.
|
|
565
|
-
|
|
566
|
-
### 14. Revised Versions of this License
|
|
567
|
-
|
|
568
|
-
The Free Software Foundation may publish revised and/or new versions of
|
|
569
|
-
the GNU General Public License from time to time. Such new versions will
|
|
570
|
-
be similar in spirit to the present version, but may differ in detail to
|
|
571
|
-
address new problems or concerns.
|
|
572
|
-
|
|
573
|
-
Each version is given a distinguishing version number. If the
|
|
574
|
-
Program specifies that a certain numbered version of the GNU General
|
|
575
|
-
Public License "or any later version" applies to it, you have the
|
|
576
|
-
option of following the terms and conditions either of that numbered
|
|
577
|
-
version or of any later version published by the Free Software
|
|
578
|
-
Foundation. If the Program does not specify a version number of the
|
|
579
|
-
GNU General Public License, you may choose any version ever published
|
|
580
|
-
by the Free Software Foundation.
|
|
581
|
-
|
|
582
|
-
If the Program specifies that a proxy can decide which future
|
|
583
|
-
versions of the GNU General Public License can be used, that proxy's
|
|
584
|
-
public statement of acceptance of a version permanently authorizes you
|
|
585
|
-
to choose that version for the Program.
|
|
586
|
-
|
|
587
|
-
Later license versions may give you additional or different
|
|
588
|
-
permissions. However, no additional obligations are imposed on any
|
|
589
|
-
author or copyright holder as a result of your choosing to follow a
|
|
590
|
-
later version.
|
|
591
|
-
|
|
592
|
-
### 15. Disclaimer of Warranty
|
|
593
|
-
|
|
594
|
-
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
595
|
-
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
596
|
-
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
597
|
-
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
598
|
-
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
599
|
-
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
600
|
-
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
601
|
-
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
602
|
-
|
|
603
|
-
### 16. Limitation of Liability
|
|
604
|
-
|
|
605
|
-
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
606
|
-
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
607
|
-
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
608
|
-
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
609
|
-
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
610
|
-
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
611
|
-
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
612
|
-
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
613
|
-
SUCH DAMAGES.
|
|
614
|
-
|
|
615
|
-
### 17. Interpretation of Sections 15 and 16
|
|
616
|
-
|
|
617
|
-
If the disclaimer of warranty and limitation of liability provided
|
|
618
|
-
above cannot be given local legal effect according to their terms,
|
|
619
|
-
reviewing courts shall apply local law that most closely approximates
|
|
620
|
-
an absolute waiver of all civil liability in connection with the
|
|
621
|
-
Program, unless a warranty or assumption of liability accompanies a
|
|
622
|
-
copy of the Program in return for a fee.
|
|
623
|
-
|
|
624
|
-
END OF TERMS AND CONDITIONS
|
package/dist/bin/index.js
CHANGED
|
@@ -1,76 +1,77 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
`)),
|
|
4
|
-
- as environment variable: ${
|
|
5
|
-
- as CLI flag of the command: ${
|
|
6
|
-
%O`,e.message,{method:e.response?.config.method,url:e.response?.config.url,status:e.response?.status,payload:e.response?.config.data})})}function
|
|
7
|
-
%o`,r)}).with(429,()=>{
|
|
8
|
-
%O`,e.message,{method:e.response?.config.method,url:e.response?.config.url,status:e.response?.status})})}function
|
|
9
|
-
%O`,e.message,{method:e.response?.config.method,url:e.response?.config.url,status:e.response?.status})})}var
|
|
2
|
+
"use strict";var Kn=Object.create;var je=Object.defineProperty;var $n=Object.getOwnPropertyDescriptor;var Vn=Object.getOwnPropertyNames;var Jn=Object.getPrototypeOf,qn=Object.prototype.hasOwnProperty;var Yn=(e,t)=>{for(var r in t)je(e,r,{get:t[r],enumerable:!0})},Wn=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Vn(t))!qn.call(e,n)&&n!==r&&je(e,n,{get:()=>t[n],enumerable:!(o=$n(t,n))||o.enumerable});return e};var d=(e,t,r)=>(r=e!=null?Kn(Jn(e)):{},Wn(t||!e||!e.__esModule?je(r,"default",{value:e,enumerable:!0}):r,e));var Mf=require("source-map-support/register");var Gn=require("@commander-js/extra-typings");var xt={name:"@currents/cmd",version:"1.3.0",main:"./dist/index.js",author:"Currents Software Inc",license:"MIT",description:"Currents CLI tools",scripts:{test:"vitest",rm:"rimraf dist",lint:'TIMING=1 eslint "**/*.ts*"',types:"tsc --noEmit",build:"tsup-node --minify --dts",dev:"tsup-node --watch --dts",release:"release-it","publish:npm":"npm run rm && npm run build && ./publish.js"},devDependencies:{"@jest/reporters":"^29.7.0","@jest/types":"^29.6.3","@release-it/conventional-changelog":"^7.0.2","@types/archiver":"^6.0.3","@types/async-retry":"^1.4.9","@types/debug":"^4.1.12","@types/fs-extra":"^11.0.4","@types/getos":"^3.0.4","@types/lodash":"^4.17.13","@types/node":"^20.14.2","@types/proxy-from-env":"^1.0.4","@types/semver":"^7.5.8","@types/tmp":"^0.2.6","@types/unzipper":"^0.10.10","@types/uuid":"^9.0.8","@types/xml2js":"^0.4.14",jest:"^29.7.0",rimraf:"^5.0.7",tsup:"^8.1.0",typescript:"^5.7.2",vitest:"^2.1.4"},dependencies:{"@commander-js/extra-typings":"^11.1.0","@currents/commit-info":"1.0.1-beta.0",archiver:"^7.0.1","async-retry":"^1.3.3",axios:"^1.7.2","axios-retry":"^4.4.0",commander:"^11.1.0",debug:"^4.3.5",dotenv:"^16.4.5",execa:"^9.5.1","fs-extra":"^11.2.0",getos:"^3.2.1",glob:"^11.0.0","https-proxy-agent":"^7.0.4","jest-cli":"^29.7.0","jest-config":"^29.7.0",lodash:"^4.17.21",nanoid:"^3.3.4","pretty-ms":"^7.0.1","proxy-from-env":"^1.1.0",semver:"^7.6.0","source-map-support":"^0.5.21",tmp:"^0.2.3","tmp-promise":"^3.0.3","ts-pattern":"^5.5.0",unzipper:"^0.12.3",uuid:"^11.0.3",xml2js:"^0.6.2"},bin:{currents:"./dist/bin/index.js","currents-cli":"./dist/bin/index.js"},files:["dist","!**/*.map","!**/*/*.map"],keywords:["cloud test dashboard","test reporter","test results","currents","currents dashboard","ci"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js",types:"./dist/index.d.ts"},"./discovery/jest":{import:"./dist/services/upload/discovery/jest/reporter.js",require:"./dist/services/upload/discovery/jest/reporter.js",types:"./dist/services/upload/discovery/jest/reporter.d.ts"},"./package.json":"./package.json"},"release-it":{npm:{publish:!1},github:{release:!0,releaseName:"${npm.name} v${version}"},plugins:{"@release-it/conventional-changelog":{preset:"angular",header:"# Changelog",ignoreVersion:!0,infile:"./CHANGELOG.md"}},git:{commitMessage:"chore: release ${npm.name} v${version}",tagName:"${npm.name}-v${version}"}}};var ae=xt.version;var Tt=require("@commander-js/extra-typings");var zn=[];function Ke(e){zn.push(e)}var _=d(require("chalk")),N=d(require("util"));var $e=require("debug"),Xn=d(require("fs-extra")),s=(0,$e.debug)("currents"),Zn=null;function bt(){$e.debug.enable("currents,currents:*")}function At(e){Zn=e}var St=[],Ut=[];var ce=(...e)=>{let t=N.default.format(...e);Ke(t),console.log(t)},ei=(...e)=>{let t=N.default.format(...e);Ke(t),console.error(t)},y=ce,C=(...e)=>{let t=N.default.format(...e);return Ut.push(t),s("WARNING: ",t),ce(_.default.bgYellow.black(" WARNING "),t)},ee=(...e)=>{let t=N.default.format(...vt(e));return s("WARNING: ",N.default.format(...e)),ce(_.default.bgYellow.black(" WARNING "),t)},me=(...e)=>ce(_.default.green.bold(N.default.format(...e))),f=(...e)=>{let t=N.default.format(...vt(e));return St.push(t),s("ERROR: ",N.default.format(...e)),ei(_.default.bgRed.white(" ERROR "),t)};var vt=e=>e.map(t=>t instanceof Error?t.message:t),pe=(e=2)=>console.log(Array(e).fill("").join(`
|
|
3
|
+
`)),ca=_.default.cyan,ma=_.default.blueBright,pa=_.default.red,ua=_.default.yellow,da=_.default.green,la=_.default.gray,fa=_.default.white,ga=_.default.black,Ca=_.default.magenta,l=_.default.dim,ha=_.default.bold;var Jo=d(require("chalk"));var ue=class extends Error{};function Dt(e){return Object.entries(e??{}).reduce((t,[r,o])=>o===void 0?t:{...t,[r]:o},{})}function R(e,t){return"env"in e[t]&&e[t].env?e[t].env:""}function ri(e,t){return e[t].cli}function oi(e,t){return e[t].name}function L(e,t,r,o){let n={...Dt(o),...Dt(r())};return t.forEach(a=>{if(!n[a])throw f(`${oi(e,a)} is required for Currents Reporter. Use the following methods to set the value:
|
|
4
|
+
- as environment variable: ${l(R(e,a))}
|
|
5
|
+
- as CLI flag of the command: ${l(ri(e,a))}`),new ue("Missing required config variable")}),n}var ni={apiKey:{name:"Api Key",env:"CURRENTS_API_KEY",cli:"--api-key"},debug:{name:"Debug",env:"CURRENTS_DEBUG",cli:"--debug"}},ii={branch:{name:"Run Branch",cli:"--branch"},output:{name:"Output Path",env:"CURRENTS_OUTPUT",cli:"--output"},ciBuildId:{name:"CI Build ID",cli:"--ci-build-id"},projectId:{name:"Project ID",env:"CURRENTS_PROJECT_ID",cli:"--project-id"},tag:{name:"Run Tag",cli:"--tag"}},M={...ni,...ii};function Nt(){return{apiKey:process.env[M.apiKey.env],debug:!!process.env[M.debug.env]}}var si=s.extend("config"),ai=["apiKey","projectId"],Ve=null;function Lt(e){Ve=L(M,ai,Nt,e),si("Resolved config: %o",Ve)}function de(){return Ve}var q=d(require("fs-extra")),le=require("path"),Mt=require("uuid");async function $(e){try{return await q.default.readJson(e)}catch(t){throw f("Error while reading JSON file: %s",e,t),f}}async function x(e,t){try{return await q.default.writeFile(e,t,"utf8"),e}catch(r){throw f(`Error writing file at ${e}:`,r),r}}async function Bt(e,t){if(t){await q.default.ensureDir(e);return}let r=(0,le.dirname)(e);await q.default.ensureDir(r)}function ci(){let e=new Date().toISOString().replace(/[:.]/g,"-"),t=(0,Mt.v4)();return`${e}-${t}`}async function Ft(e,t){let r=ci(),o=(0,le.join)(e,t,r);return fe(o)}async function fe(e){try{return await q.default.ensureDir(e),s("Folder created",e),e}catch(t){throw f(`Failed to create folder at ${e}:`,t),t}}var kt=d(require("crypto"));function ge(e){return kt.createHash("sha256").update(e).digest("base64").slice(0,8).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Ce={};Yn(Ce,{getNanoid:()=>mi,userFacingNanoid:()=>qe});var Je=require("nanoid"),Gt="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",mi=(e=16)=>(0,Je.customAlphabet)(Gt,e)(),qe=(0,Je.customAlphabet)(Gt,12);var fr=require("fs/promises");var nr=d(require("lodash"));var Yt=d(require("axios")),Wt=d(require("axios-retry")),Qt=d(require("lodash"));var Ye=()=>process.env.CURRENTS_API_URL??"https://cy.currents.dev",Ht=()=>process.env.CURRENTS_REST_API_URL??"https://api.currents.dev",jt=()=>3e4;var We=require("axios"),Qe=d(require("pretty-ms"));var Kt=s.extend("http"),he=e=>[3*1e3,15*1e3,30*1e3][e-1],$t=e=>(Kt("isRetriableError: %o",{message:e.message,code:"code"in e?e.code:void 0,status:"response"in e?e.response?.status:void 0,headers:"response"in e?e.response?.headers:void 0,data:"response"in e?e.response?.data:void 0,isAxiosError:(0,We.isAxiosError)(e)}),"code"in e&&e.code&&["ECONNABORTED","ECONNREFUSED","ECONNRESET","ETIMEDOUT","ENETRESET"].includes(e.code)?!0:(0,We.isAxiosError)(e)?[429,502,503,504].includes(e.response?.status??0):!1),Ee=()=>3;function Vt(e,t,r){Kt("Network request '%s' failed: '%s'. Next attempt is in %s (%d/%d).",`${r.method?.toUpperCase()} ${r.url}`,t.message,(0,Qe.default)(he(e)),e,Ee()),C("Network request '%s' failed: '%s'. Next attempt is in %s (%d/%d).",`${r.method?.toUpperCase()} ${r.url}`,t.message,(0,Qe.default)(he(e)),e,Ee())}var Jt=s.extend("http");var ze={api:null,restApi:null};function pi(e){let t=Yt.default.create({baseURL:e==="api"?Ye():Ht(),timeout:jt(),transitional:{clarifyTimeoutError:!0}});return t.interceptors.request.use(r=>{let o=r["axios-retry"]?.retryCount??0;r.headers.get("Content-Type")||r.headers.set("Content-Type","application/json");let n={...Qt.default.pick(r,"method","url","headers"),data:Buffer.isBuffer(r.data)?"buffer":r.data};return o?Jt("network request retry: %o",qt({...n,isRetry:!0})):Jt("network request: %o",qt(n)),r}),(0,Wt.default)(t,{retries:Ee(),retryCondition:$t,retryDelay:he,shouldResetTimeout:!0,onRetry:Vt}),t}function zt(e){return ze[e]===null&&(ze[e]=pi(e)),ze[e]}function qt(e){return{method:e.method,baseUrl:Ye(),url:e.url,data:e.isRetry?"<retry>":ui(e.data),headers:{...e.headers,"x-currents-key":"***"}}}function ui(e){return e?.results?.raw?{...e,results:{...e.results,raw:"***"}}:e}var er=require("axios"),tr=d(require("lodash")),T=require("ts-pattern");function rr(e){(0,T.match)(e).when(er.isAxiosError,di).otherwise(()=>{C("Unexpected error while sending network request: %s",e)})}function di(e){return(0,T.match)(e).with({code:"ECONNABORTED"},()=>{C("Network connection aborted")}).with({code:"ECONNREFUSED"},()=>{C("Network connection aborted")}).with({code:"ECONNRESET"},()=>{C("Network connection reset")}).with({code:"ETIMEDOUT"},()=>{C("Network connection timeout")}).with({response:T.P.not(T.P.nullish)},t=>{li(t,{status:t.response.status,data:t.response.data})}).otherwise(t=>{C(`[currents] Unexpected network error: %s
|
|
6
|
+
%O`,e.message,{method:e.response?.config.method,url:e.response?.config.url,status:e.response?.status,payload:e.response?.config.data})})}function li(e,{status:t,data:r}){(0,T.match)(t).with(401,()=>{C(`[currents] ${e.response?.config.method} ${e.response?.config.url}} - 401 Unauthorized Request from cloud service`)}).with(400,()=>{C(`[currents] ${e.response?.config.method} ${e.response?.config.url} - 400 Bad Request from cloud service:
|
|
7
|
+
%o`,r)}).with(429,()=>{C(`[currents] ${e.response?.config.method} ${e.response?.config.url} - 429 Too Many Requests from cloud service`)}).with(422,()=>{fi(e,r)}).otherwise(()=>{C(`[currents] Unexpected network response: %s
|
|
8
|
+
%O`,e.message,{method:e.response?.config.method,url:e.response?.config.url,status:e.response?.status})})}function fi(e,t){(0,T.match)(t).with({code:Xt.MISSING_SUITE,message:T.P.string,errors:T.P.array(T.P.string)},async r=>{let{message:o,errors:n}=r;pe(1),f(...Zt(o,n))}).with({code:Xt.RUN_EXPIRED,message:T.P.string},r=>{C(r.message)}).with({message:T.P.string,errors:T.P.array(T.P.string)},r=>{let{message:o,errors:n}=r;pe(1),C(...Zt(o,n)),pe(1)}).otherwise(()=>{C(`[currents] Unexpected network response: %s
|
|
9
|
+
%O`,e.message,{method:e.response?.config.method,url:e.response?.config.url,status:e.response?.status})})}var Xt={RUN_CANCELLED:"RUN_CANCELLED",RUN_EXPIRED:"RUN_EXPIRED",MISSING_SUITE:"MISSING_SUITE"};function Zt(e,t){return tr.default.isString(e)?t?.length===0?[e]:[e,`
|
|
10
10
|
${(t??[]).map(r=>` - ${r}`).join(`
|
|
11
11
|
`)}
|
|
12
|
-
`]:["Unexpected network error"]}var er=s.extend("http");async function V(e,t,r=qt){try{let o=await r(e).request(t);return er("network response: %o",{...tr.default.omit(o,"request","config"),url:o.config.url,method:o.config.method}),o}catch(o){let n=o;throw er("network error: %o",{code:n.code,message:n.message,url:n.config?.url,method:n.config?.method,status:n.response?.status,headers:n.response?.headers,data:n.response?.data}),Zt(n),n}}var Ee=s.extend("api");async function or(e){try{return Ee("Request params: %o",e),V("api",{url:"cache/upload",method:"POST",data:e}).then(t=>t.data)}catch(t){throw Ee("Failed to create cache:",t),t}}async function nr(e){try{return Ee("Request params: %o",e),V("api",{url:"cache/download",method:"POST",data:e}).then(t=>t.data)}catch(t){throw Ee("Failed to retrieve cache:",t),t}}var sr=require("util"),ar=require("zlib");var ir=s.extend("api"),di=(0,sr.promisify)(ar.gzip);async function cr(e){try{ir("Run params: %o",e);let t=await li(JSON.stringify(e));return V("api",{url:"v1/runs",method:"POST",headers:{"Content-Type":"application/json","Content-Encoding":"gzip"},data:t}).then(r=>r.data)}catch(t){throw ir("Failed to create the run:",t),t}}async function li(e){try{return await di(e)}catch(t){throw f("Failed to compress run payload:",t),t}}var mr=s.extend("api");async function pr(e,t){try{return mr("Run params: %o",t),V("restApi",{url:"v1/runs/previous",params:t,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}).then(r=>r.data)}catch(r){throw mr("Failed to obtain run data:",r),r}}async function Xe(){try{let e=ue();if(!e)throw new Error("Config is missing!");let t=e.ciBuildId?{projectId:e.projectId,ciBuildId:e.ciBuildId,pwLastRun:e.pwLastRun}:{projectId:e.projectId,branch:e.branch,tag:e.tag,pwLastRun:e.pwLastRun},r=await pr(e.apiKey,t);await fi(e.pwLastRun&&r.data.pwLastRun?r.data.pwLastRun:r.data,e)}catch(e){throw s("Failed to get run data"),e}}async function fi(e,t){let r=JSON.stringify(e,null,2);t.output?(await Nt(t.output),await(0,ur.writeFile)(t.output,r,"utf-8")):S(r)}var Vr=require("axios");var y=require("@commander-js/extra-typings");var gi={recordKey:{name:"Record Key",env:"CURRENTS_RECORD_KEY",cli:"--key"},debug:{name:"Debug",env:"CURRENTS_DEBUG",cli:"--debug"}},Ci={id:{name:"Cache id",cli:"--id"},preset:{name:"Preset",cli:"--preset"},pwOutputDir:{name:"Playwright output directory",cli:"--pw-output-dir"},presetOutput:{name:"Preset output path",cli:"--preset-output"},path:{name:"Paths to cache",cli:"--path"},matrixIndex:{name:"Matrix index",cli:"--matrix-index"},matrixTotal:{name:"Matrix total",cli:"--matrix-total"}},hi={id:{name:"Cache id",cli:"--id"},preset:{name:"Preset",cli:"--preset"},outputDir:{name:"Custom directory to write output",cli:"--output-dir"},matrixIndex:{name:"Matrix index",cli:"--matrix-index"},matrixTotal:{name:"Matrix total",cli:"--matrix-total"},continue:{name:"Continue on cache miss",cli:"--continue"}},G={...gi,...Ci,...hi};function Ze(){return{recordKey:process.env[G.recordKey.env],debug:process.env[G.debug.env]}}var dr=s.extend("config"),lr=["recordKey"],ee;function fr(e){ee={type:"SET_COMMAND_CONFIG",values:L(G,lr,Ze,e)},dr("Resolved config: %o",ee)}function gr(e){ee={type:"GET_COMMAND_CONFIG",values:L(G,lr,Ze,e)},dr("Resolved config: %o",ee)}function H(){return ee}function Cr(e){return{recordKey:e.key,id:e.id,preset:e.preset,outputDir:e.outputDir,presetOutput:e.presetOutput,debug:e.debug,matrixIndex:e.matrixIndex,matrixTotal:e.matrixTotal,continue:e.continue}}function hr(e){return{recordKey:e.key,id:e.id,preset:e.preset,pwOutputDir:e.pwOutputDir,path:e.path,debug:e.debug,matrixIndex:e.matrixIndex,matrixTotal:e.matrixTotal}}var Er=require("@commander-js/extra-typings");function Y(e,t=[]){return e?t.concat(e.split(",").map(r=>r.trim())):t}async function U(e,t){try{t.debug&&Pt(),await e(t),process.exit(0)}catch(r){f(r.message);let o=r instanceof Er.CommanderError?r.exitCode:1;process.exit(o)}}var et=new y.Option("-k, --key <record-key>","Your secret Record Key obtained from Currents").env(R(G,"recordKey")),tt=new y.Option("--debug","Enable debug logging").env(R(G,"debug")).default(!1),rt=new y.Option("--id <id>","The ID the data is saved under in the cache"),Rr=new y.Option("--path <path>","Comma-separated list of paths to cache").argParser(Y),Re=(t=>(t.lastRun="last-run",t))(Re||{}),ot=new y.Option("--preset <preset-name>",'A set of predefined options. Use "last-run" to get the last run data').choices(Object.values(Re)),Ir=new y.Option("--output-dir <dir>","Path to the directory where output will be written"),_r=new y.Option("--pw-output-dir <dir>","Directory for artifacts produced by Playwright tests").default("test-results"),te=".currents_env",Tr=new y.Option("--preset-output <path>","Path to the file containing the preset output").default(te),nt=new y.Option("--matrix-index <number>","The index of the matrix to use").default(1).argParser(Or),it=new y.Option("--matrix-total <number>","The total number of matrices available").default(1).argParser(Or);function Or(e){let t=parseInt(e,10);if(isNaN(t)||t<=0||!Number.isInteger(t))throw new y.InvalidArgumentError("A positive integer is expected.");return t}var yr=new y.Option("--continue","Continue the script execution if the cache is not found").default(!1);var E=require("lodash");var Ie=s.extend("ci"),Ei=(e,...t)=>(0,E.chain)(t).compact().join(e).value(),Ri=(e,t)=>(0,E.set)(e,(0,E.camelCase)(t),process.env[t]),h=e=>(0,E.transform)(e,Ri,{}),Ii=()=>process.env.TF_BUILD&&process.env.TF_BUILD_BUILDNUMBER,_i=()=>process.env.TF_BUILD&&process.env.AZURE_HTTP_USER_AGENT,Ti=()=>(0,E.some)(process.env,(e,t)=>/^CODEBUILD_/.test(t)),Oi=()=>process.env.bamboo_buildNumber,yi=()=>process.env.CI_NAME&&process.env.CI_NAME==="codeship"&&process.env.CODESHIP,Pi=()=>process.env.CI_NAME&&process.env.CI_NAME==="codeship"&&!process.env.CODESHIP,wi=()=>(0,E.some)(process.env,(e,t)=>/^CONCOURSE_/.test(t)),xi=()=>process.env.GITLAB_CI||process.env.CI_SERVER_NAME&&/^GitLab/.test(process.env.CI_SERVER_NAME),bi=()=>process.env.GCP_PROJECT||process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT,Ai=()=>process.env.JENKINS_URL||process.env.JENKINS_HOME||process.env.JENKINS_VERSION||process.env.HUDSON_URL||process.env.HUDSON_HOME,Si=()=>process.env.WERCKER||process.env.WERCKER_MAIN_PIPELINE_STARTED,Ui={appveyor:"APPVEYOR",azure:_i,awsCodeBuild:Ti,bamboo:Oi,bitbucket:"BITBUCKET_BUILD_NUMBER",buildkite:"BUILDKITE",circle:"CIRCLECI",codeshipBasic:yi,codeshipPro:Pi,concourse:wi,codeFresh:"CF_BUILD_ID",drone:"DRONE",githubActions:"GITHUB_ACTIONS",gitlab:xi,goCD:"GO_JOB_NAME",googleCloud:bi,jenkins:Ai,semaphore:"SEMAPHORE",shippable:"SHIPPABLE",teamcity:"TEAMCITY_VERSION",teamfoundation:Ii,travis:"TRAVIS",wercker:Si,netlify:"NETLIFY",layerci:"LAYERCI"};function vi(){let{env:e}=process;return(0,E.findKey)(Ui,t=>{if((0,E.isString)(t))return e[t];if((0,E.isFunction)(t))return t()})}var Pr=()=>({appveyor:h(["APPVEYOR_JOB_ID","APPVEYOR_ACCOUNT_NAME","APPVEYOR_PROJECT_SLUG","APPVEYOR_BUILD_NUMBER","APPVEYOR_BUILD_VERSION","APPVEYOR_PULL_REQUEST_NUMBER","APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH"]),azure:h(["BUILD_BUILDID","BUILD_BUILDNUMBER","BUILD_CONTAINERID","BUILD_REPOSITORY_URI","SYSTEM_TEAMPROJECT","SYSTEM_COLLECTIONURI"]),awsCodeBuild:h(["CODEBUILD_BUILD_ID","CODEBUILD_BUILD_NUMBER","CODEBUILD_RESOLVED_SOURCE_VERSION","CODEBUILD_SOURCE_REPO_URL","CODEBUILD_SOURCE_VERSION"]),bamboo:h(["bamboo_buildNumber","bamboo_buildResultsUrl","bamboo_planRepository_repositoryUrl","bamboo_buildKey"]),bitbucket:h(["BITBUCKET_REPO_SLUG","BITBUCKET_REPO_OWNER","BITBUCKET_BUILD_NUMBER","BITBUCKET_PARALLEL_STEP","BITBUCKET_STEP_RUN_NUMBER","BITBUCKET_PR_ID","BITBUCKET_PR_DESTINATION_BRANCH","BITBUCKET_PR_DESTINATION_COMMIT"]),buildkite:h(["BUILDKITE_REPO","BUILDKITE_SOURCE","BUILDKITE_JOB_ID","BUILDKITE_BUILD_ID","BUILDKITE_BUILD_URL","BUILDKITE_BUILD_NUMBER","BUILDKITE_PULL_REQUEST","BUILDKITE_PULL_REQUEST_REPO","BUILDKITE_PULL_REQUEST_BASE_BRANCH"]),circle:h(["CIRCLE_JOB","CIRCLE_BUILD_NUM","CIRCLE_BUILD_URL","CIRCLE_PR_NUMBER","CIRCLE_PR_REPONAME","CIRCLE_PR_USERNAME","CIRCLE_COMPARE_URL","CIRCLE_WORKFLOW_ID","CIRCLE_WORKFLOW_WORKSPACE_ID","CIRCLE_PULL_REQUEST","CIRCLE_REPOSITORY_URL","CI_PULL_REQUEST","CIRCLE_NODE_INDEX","CIRCLE_NODE_TOTAL"]),codeshipBasic:h(["CI_BUILD_ID","CI_REPO_NAME","CI_BUILD_URL","CI_PROJECT_ID","CI_BUILD_NUMBER","CI_PULL_REQUEST"]),codeshipPro:h(["CI_BUILD_ID","CI_REPO_NAME","CI_PROJECT_ID"]),concourse:h(["BUILD_ID","BUILD_NAME","BUILD_JOB_NAME","BUILD_PIPELINE_NAME","BUILD_TEAM_NAME","ATC_EXTERNAL_URL"]),codeFresh:h(["CF_BUILD_ID","CF_BUILD_URL","CF_CURRENT_ATTEMPT","CF_STEP_NAME","CF_PIPELINE_NAME","CF_PIPELINE_TRIGGER_ID","CF_PULL_REQUEST_ID","CF_PULL_REQUEST_IS_FORK","CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_TARGET"]),drone:h(["DRONE_JOB_NUMBER","DRONE_BUILD_LINK","DRONE_BUILD_NUMBER","DRONE_PULL_REQUEST"]),githubActions:h(["GITHUB_WORKFLOW","GITHUB_ACTION","GITHUB_EVENT_NAME","GITHUB_RUN_ID","GITHUB_RUN_ATTEMPT","GITHUB_REPOSITORY"]),gitlab:h(["CI_PIPELINE_ID","CI_PIPELINE_URL","CI_BUILD_ID","CI_JOB_ID","CI_JOB_URL","CI_JOB_NAME","CI_NODE_INDEX","CI_NODE_TOTAL","GITLAB_HOST","CI_PROJECT_ID","CI_PROJECT_URL","CI_REPOSITORY_URL","CI_ENVIRONMENT_URL","CI_DEFAULT_BRANCH","RUN_ATTEMPT"]),goCD:h(["GO_SERVER_URL","GO_ENVIRONMENT_NAME","GO_PIPELINE_NAME","GO_PIPELINE_COUNTER","GO_PIPELINE_LABEL","GO_STAGE_NAME","GO_STAGE_COUNTER","GO_JOB_NAME","GO_TRIGGER_USER","GO_REVISION","GO_TO_REVISION","GO_FROM_REVISION","GO_MATERIAL_HAS_CHANGED"]),googleCloud:h(["BUILD_ID","PROJECT_ID","REPO_NAME","BRANCH_NAME","TAG_NAME","COMMIT_SHA","SHORT_SHA"]),jenkins:h(["BUILD_ID","BUILD_URL","BUILD_NUMBER","ghprbPullId"]),semaphore:h(["SEMAPHORE_BRANCH_ID","SEMAPHORE_BUILD_NUMBER","SEMAPHORE_CURRENT_JOB","SEMAPHORE_CURRENT_THREAD","SEMAPHORE_EXECUTABLE_UUID","SEMAPHORE_GIT_BRANCH","SEMAPHORE_GIT_DIR","SEMAPHORE_GIT_REF","SEMAPHORE_GIT_REF_TYPE","SEMAPHORE_GIT_REPO_SLUG","SEMAPHORE_GIT_SHA","SEMAPHORE_GIT_URL","SEMAPHORE_JOB_COUNT","SEMAPHORE_JOB_ID","SEMAPHORE_JOB_NAME","SEMAPHORE_JOB_UUID","SEMAPHORE_PIPELINE_ID","SEMAPHORE_PLATFORM","SEMAPHORE_PROJECT_DIR","SEMAPHORE_PROJECT_HASH_ID","SEMAPHORE_PROJECT_ID","SEMAPHORE_PROJECT_NAME","SEMAPHORE_PROJECT_UUID","SEMAPHORE_REPO_SLUG","SEMAPHORE_TRIGGER_SOURCE","SEMAPHORE_WORKFLOW_ID","PULL_REQUEST_NUMBER"]),shippable:h(["SHIPPABLE_BUILD_ID","SHIPPABLE_BUILD_NUMBER","SHIPPABLE_COMMIT_RANGE","SHIPPABLE_CONTAINER_NAME","SHIPPABLE_JOB_ID","SHIPPABLE_JOB_NUMBER","SHIPPABLE_REPO_SLUG","IS_FORK","IS_GIT_TAG","IS_PRERELEASE","IS_RELEASE","REPOSITORY_URL","REPO_FULL_NAME","REPO_NAME","BUILD_URL","BASE_BRANCH","HEAD_BRANCH","IS_PULL_REQUEST","PULL_REQUEST","PULL_REQUEST_BASE_BRANCH","PULL_REQUEST_REPO_FULL_NAME"]),teamcity:null,teamfoundation:h(["BUILD_BUILDID","BUILD_BUILDNUMBER","BUILD_CONTAINERID"]),travis:h(["TRAVIS_JOB_ID","TRAVIS_BUILD_ID","TRAVIS_BUILD_WEB_URL","TRAVIS_REPO_SLUG","TRAVIS_JOB_NUMBER","TRAVIS_EVENT_TYPE","TRAVIS_COMMIT_RANGE","TRAVIS_BUILD_NUMBER","TRAVIS_PULL_REQUEST","TRAVIS_PULL_REQUEST_BRANCH","TRAVIS_PULL_REQUEST_SHA"]),wercker:null,netlify:h(["BUILD_ID","CONTEXT","URL","DEPLOY_URL","DEPLOY_PRIME_URL","DEPLOY_ID"]),layerci:h(["LAYERCI_JOB_ID","LAYERCI_RUNNER_ID","RETRY_INDEX","LAYERCI_PULL_REQUEST","LAYERCI_REPO_NAME","LAYERCI_REPO_OWNER","LAYERCI_BRANCH","GIT_TAG"])}),Di=()=>{let{env:e}=process;return{appveyor:{sha:e.APPVEYOR_REPO_COMMIT,branch:e.APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH||e.APPVEYOR_REPO_BRANCH,message:Ei(`
|
|
13
|
-
`,e.APPVEYOR_REPO_COMMIT_MESSAGE,e.APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED),authorName:e.APPVEYOR_REPO_COMMIT_AUTHOR,authorEmail:e.APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL},awsCodeBuild:{sha:e.CODEBUILD_RESOLVED_SOURCE_VERSION,remoteOrigin:e.CODEBUILD_SOURCE_REPO_URL},azure:{sha:e.BUILD_SOURCEVERSION,branch:e.BUILD_SOURCEBRANCHNAME,message:e.BUILD_SOURCEVERSIONMESSAGE,authorName:e.BUILD_SOURCEVERSIONAUTHOR,authorEmail:e.BUILD_REQUESTEDFOREMAIL},bamboo:{sha:e.bamboo_planRepository_revision,branch:e.bamboo_planRepository_branch,authorName:e.bamboo_planRepository_username,remoteOrigin:e.bamboo_planRepository_repositoryURL},bitbucket:{sha:e.BITBUCKET_COMMIT,branch:e.BITBUCKET_BRANCH},buildkite:{sha:e.BUILDKITE_COMMIT,branch:e.BUILDKITE_BRANCH,message:e.BUILDKITE_MESSAGE,authorName:e.BUILDKITE_BUILD_CREATOR,authorEmail:e.BUILDKITE_BUILD_CREATOR_EMAIL,remoteOrigin:e.BUILDKITE_REPO,defaultBranch:e.BUILDKITE_PIPELINE_DEFAULT_BRANCH},circle:{sha:e.CIRCLE_SHA1,branch:e.CIRCLE_BRANCH,authorName:e.CIRCLE_USERNAME,remoteOrigin:e.CIRCLE_REPOSITORY_URL},codeshipBasic:{sha:e.CI_COMMIT_ID,branch:e.CI_BRANCH,message:e.CI_COMMIT_MESSAGE,authorName:e.CI_COMMITTER_NAME,authorEmail:e.CI_COMMITTER_EMAIL},codeshipPro:{sha:e.CI_COMMIT_ID,branch:e.CI_BRANCH,message:e.CI_COMMIT_MESSAGE,authorName:e.CI_COMMITTER_NAME,authorEmail:e.CI_COMMITTER_EMAIL},codeFresh:{sha:e.CF_REVISION,branch:e.CF_BRANCH,message:e.CF_COMMIT_MESSAGE,authorName:e.CF_COMMIT_AUTHOR},drone:{sha:e.DRONE_COMMIT_SHA,branch:e.DRONE_SOURCE_BRANCH,message:e.DRONE_COMMIT_MESSAGE,authorName:e.DRONE_COMMIT_AUTHOR,authorEmail:e.DRONE_COMMIT_AUTHOR_EMAIL,remoteOrigin:e.DRONE_GIT_HTTP_URL,defaultBranch:e.DRONE_REPO_BRANCH},githubActions:{sha:e.GITHUB_SHA,branch:e.GH_BRANCH||e.GITHUB_REF,defaultBranch:e.GITHUB_BASE_REF,remoteBranch:e.GITHUB_HEAD_REF,runAttempt:e.GITHUB_RUN_ATTEMPT},gitlab:{sha:e.CI_COMMIT_SHA,branch:e.CI_COMMIT_REF_NAME,message:e.CI_COMMIT_MESSAGE,authorName:e.GITLAB_USER_NAME,authorEmail:e.GITLAB_USER_EMAIL,remoteOrigin:e.CI_REPOSITORY_URL,defaultBranch:e.CI_DEFAULT_BRANCH},googleCloud:{sha:e.COMMIT_SHA,branch:e.BRANCH_NAME},jenkins:{sha:e.GIT_COMMIT,branch:e.GIT_BRANCH},semaphore:{sha:e.SEMAPHORE_GIT_SHA,branch:e.SEMAPHORE_GIT_BRANCH,remoteOrigin:e.SEMAPHORE_GIT_REPO_SLUG},shippable:{sha:e.COMMIT,branch:e.BRANCH,message:e.COMMIT_MESSAGE,authorName:e.COMMITTER},snap:null,teamcity:null,teamfoundation:{sha:e.BUILD_SOURCEVERSION,branch:e.BUILD_SOURCEBRANCHNAME,message:e.BUILD_SOURCEVERSIONMESSAGE,authorName:e.BUILD_SOURCEVERSIONAUTHOR},travis:{sha:e.TRAVIS_PULL_REQUEST_SHA||e.TRAVIS_COMMIT,branch:e.TRAVIS_PULL_REQUEST_BRANCH||e.TRAVIS_BRANCH,message:e.TRAVIS_COMMIT_MESSAGE},wercker:null,netlify:{sha:e.COMMIT_REF,branch:e.BRANCH,remoteOrigin:e.REPOSITORY_URL},layerci:{sha:e.GIT_COMMIT,branch:e.LAYERCI_BRANCH,message:e.GIT_COMMIT_TITLE}}},
|
|
14
|
-
EXTRA_PWCP_FLAGS="${
|
|
12
|
+
`]:["Unexpected network error"]}var or=s.extend("http");async function V(e,t,r=zt){try{let o=await r(e).request(t);return or("network response: %o",{...nr.default.omit(o,"request","config"),url:o.config.url,method:o.config.method}),o}catch(o){let n=o;throw or("network error: %o",{code:n.code,message:n.message,url:n.config?.url,method:n.config?.method,status:n.response?.status,headers:n.response?.headers,data:n.response?.data}),rr(n),n}}var Re=s.extend("api");async function sr(e){try{return Re("Request params: %o",e),V("api",{url:"cache/upload",method:"POST",data:e}).then(t=>t.data)}catch(t){throw Re("Failed to create cache:",t),t}}async function ar(e){try{return Re("Request params: %o",e),V("api",{url:"cache/download",method:"POST",data:e}).then(t=>t.data)}catch(t){throw Re("Failed to retrieve cache:",t),t}}var mr=require("util"),pr=require("zlib");var cr=s.extend("api"),gi=(0,mr.promisify)(pr.gzip);async function ur(e){try{cr("Run params: %o",e);let t=await Ci(JSON.stringify(e));return V("api",{url:"v1/runs",method:"POST",headers:{"Content-Type":"application/json","Content-Encoding":"gzip"},data:t}).then(r=>r.data)}catch(t){throw cr("Failed to create the run:",t),t}}async function Ci(e){try{return await gi(e)}catch(t){throw f("Failed to compress run payload:",t),t}}var dr=s.extend("api");async function lr(e,t){try{return dr("Run params: %o",t),V("restApi",{url:"v1/runs/previous",params:t,method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}).then(r=>r.data)}catch(r){throw dr("Failed to obtain run data:",r),r}}async function Xe(){try{let e=de();if(!e)throw new Error("Config is missing!");let t=e.ciBuildId?{projectId:e.projectId,ciBuildId:e.ciBuildId,pwLastRun:e.pwLastRun}:{projectId:e.projectId,branch:e.branch,tag:e.tag,pwLastRun:e.pwLastRun},r=await lr(e.apiKey,t);await hi(e.pwLastRun&&r.data.pwLastRun?r.data.pwLastRun:r.data,e)}catch(e){throw s("Failed to get run data"),e}}async function hi(e,t){let r=JSON.stringify(e,null,2);t.output?(await Bt(t.output),await(0,fr.writeFile)(t.output,r,"utf-8")):y(r)}var qr=require("axios"),dt=d(require("path"));var P=require("@commander-js/extra-typings");var Ei={recordKey:{name:"Record Key",env:"CURRENTS_RECORD_KEY",cli:"--key"},debug:{name:"Debug",env:"CURRENTS_DEBUG",cli:"--debug"}},Ri={id:{name:"Cache id",cli:"--id"},preset:{name:"Preset",cli:"--preset"},pwOutputDir:{name:"Playwright output directory",cli:"--pw-output-dir"},presetOutput:{name:"Preset output path",cli:"--preset-output"},path:{name:"Paths to cache",cli:"--path"},matrixIndex:{name:"Matrix index",cli:"--matrix-index"},matrixTotal:{name:"Matrix total",cli:"--matrix-total"}},Ii={id:{name:"Cache id",cli:"--id"},preset:{name:"Preset",cli:"--preset"},outputDir:{name:"Custom directory to write output",cli:"--output-dir"},matrixIndex:{name:"Matrix index",cli:"--matrix-index"},matrixTotal:{name:"Matrix total",cli:"--matrix-total"},continue:{name:"Continue on cache miss",cli:"--continue"}},G={...Ei,...Ri,...Ii};function Ze(){return{recordKey:process.env[G.recordKey.env],debug:process.env[G.debug.env]}}var gr=s.extend("config"),Cr=["recordKey"],te;function hr(e){te={type:"SET_COMMAND_CONFIG",values:L(G,Cr,Ze,e)},gr("Resolved config: %o",te)}function Er(e){te={type:"GET_COMMAND_CONFIG",values:L(G,Cr,Ze,e)},gr("Resolved config: %o",te)}function H(){return te}function Rr(e){return{recordKey:e.key,id:e.id,preset:e.preset,outputDir:e.outputDir,presetOutput:e.presetOutput,debug:e.debug,matrixIndex:e.matrixIndex,matrixTotal:e.matrixTotal,continue:e.continue}}function Ir(e){return{recordKey:e.key,id:e.id,preset:e.preset,pwOutputDir:e.pwOutputDir,path:e.path,debug:e.debug,matrixIndex:e.matrixIndex,matrixTotal:e.matrixTotal}}var _r=require("@commander-js/extra-typings");function Y(e,t=[]){return e?t.concat(e.split(",").map(r=>r.trim())):t}async function U(e,t){try{t.debug&&bt(),await e(t),process.exit(0)}catch(r){f(r.message);let o=r instanceof _r.CommanderError?r.exitCode:1;process.exit(o)}}var et=new P.Option("-k, --key <record-key>","Your secret Record Key obtained from Currents").env(R(G,"recordKey")),tt=new P.Option("--debug","Enable debug logging").env(R(G,"debug")).default(!1),rt=new P.Option("--id <id>","The ID the data is saved under in the cache"),Tr=new P.Option("--path <path>",'Comma-separated list of paths to cache, enquote for globs e.g. "dist/**/*"').argParser(Y),Ie=(t=>(t.lastRun="last-run",t))(Ie||{}),ot=new P.Option("--preset <preset-name>",'A set of predefined options. Use "last-run" to get the last run data').choices(Object.values(Ie)),Or=new P.Option("--output-dir <dir>","Path to the directory where output will be written"),yr=new P.Option("--pw-output-dir <dir>","Directory for artifacts produced by Playwright tests").default("test-results"),re=".currents_env",Pr=new P.Option("--preset-output <path>","Path to the file containing the preset output").default(re),nt=new P.Option("--matrix-index <number>","The index of the matrix to use").default(1).argParser(wr),it=new P.Option("--matrix-total <number>","The total number of matrices available").default(1).argParser(wr);function wr(e){let t=parseInt(e,10);if(isNaN(t)||t<=0||!Number.isInteger(t))throw new P.InvalidArgumentError("A positive integer is expected.");return t}var xr=new P.Option("--continue","Continue the script execution if the cache is not found").default(!1);var E=require("lodash");var _e=s.extend("ci"),_i=(e,...t)=>(0,E.chain)(t).compact().join(e).value(),Ti=(e,t)=>(0,E.set)(e,(0,E.camelCase)(t),process.env[t]),h=e=>(0,E.transform)(e,Ti,{}),Oi=()=>process.env.TF_BUILD&&process.env.TF_BUILD_BUILDNUMBER,yi=()=>process.env.TF_BUILD&&process.env.AZURE_HTTP_USER_AGENT,Pi=()=>(0,E.some)(process.env,(e,t)=>/^CODEBUILD_/.test(t)),wi=()=>process.env.bamboo_buildNumber,xi=()=>process.env.CI_NAME&&process.env.CI_NAME==="codeship"&&process.env.CODESHIP,bi=()=>process.env.CI_NAME&&process.env.CI_NAME==="codeship"&&!process.env.CODESHIP,Ai=()=>(0,E.some)(process.env,(e,t)=>/^CONCOURSE_/.test(t)),Si=()=>process.env.GITLAB_CI||process.env.CI_SERVER_NAME&&/^GitLab/.test(process.env.CI_SERVER_NAME),Ui=()=>process.env.GCP_PROJECT||process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT,vi=()=>process.env.JENKINS_URL||process.env.JENKINS_HOME||process.env.JENKINS_VERSION||process.env.HUDSON_URL||process.env.HUDSON_HOME,Di=()=>process.env.WERCKER||process.env.WERCKER_MAIN_PIPELINE_STARTED,Ni={appveyor:"APPVEYOR",azure:yi,awsCodeBuild:Pi,bamboo:wi,bitbucket:"BITBUCKET_BUILD_NUMBER",buildkite:"BUILDKITE",circle:"CIRCLECI",codeshipBasic:xi,codeshipPro:bi,concourse:Ai,codeFresh:"CF_BUILD_ID",drone:"DRONE",githubActions:"GITHUB_ACTIONS",gitlab:Si,goCD:"GO_JOB_NAME",googleCloud:Ui,jenkins:vi,semaphore:"SEMAPHORE",shippable:"SHIPPABLE",teamcity:"TEAMCITY_VERSION",teamfoundation:Oi,travis:"TRAVIS",wercker:Di,netlify:"NETLIFY",layerci:"LAYERCI"};function Li(){let{env:e}=process;return(0,E.findKey)(Ni,t=>{if((0,E.isString)(t))return e[t];if((0,E.isFunction)(t))return t()})}var br=()=>({appveyor:h(["APPVEYOR_JOB_ID","APPVEYOR_ACCOUNT_NAME","APPVEYOR_PROJECT_SLUG","APPVEYOR_BUILD_NUMBER","APPVEYOR_BUILD_VERSION","APPVEYOR_PULL_REQUEST_NUMBER","APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH"]),azure:h(["BUILD_BUILDID","BUILD_BUILDNUMBER","BUILD_CONTAINERID","BUILD_REPOSITORY_URI","SYSTEM_TEAMPROJECT","SYSTEM_COLLECTIONURI"]),awsCodeBuild:h(["CODEBUILD_BUILD_ID","CODEBUILD_BUILD_NUMBER","CODEBUILD_RESOLVED_SOURCE_VERSION","CODEBUILD_SOURCE_REPO_URL","CODEBUILD_SOURCE_VERSION"]),bamboo:h(["bamboo_buildNumber","bamboo_buildResultsUrl","bamboo_planRepository_repositoryUrl","bamboo_buildKey"]),bitbucket:h(["BITBUCKET_REPO_SLUG","BITBUCKET_REPO_OWNER","BITBUCKET_BUILD_NUMBER","BITBUCKET_PARALLEL_STEP","BITBUCKET_STEP_RUN_NUMBER","BITBUCKET_PR_ID","BITBUCKET_PR_DESTINATION_BRANCH","BITBUCKET_PR_DESTINATION_COMMIT"]),buildkite:h(["BUILDKITE_REPO","BUILDKITE_SOURCE","BUILDKITE_JOB_ID","BUILDKITE_BUILD_ID","BUILDKITE_BUILD_URL","BUILDKITE_BUILD_NUMBER","BUILDKITE_PULL_REQUEST","BUILDKITE_PULL_REQUEST_REPO","BUILDKITE_PULL_REQUEST_BASE_BRANCH"]),circle:h(["CIRCLE_JOB","CIRCLE_BUILD_NUM","CIRCLE_BUILD_URL","CIRCLE_PR_NUMBER","CIRCLE_PR_REPONAME","CIRCLE_PR_USERNAME","CIRCLE_COMPARE_URL","CIRCLE_WORKFLOW_ID","CIRCLE_WORKFLOW_WORKSPACE_ID","CIRCLE_PULL_REQUEST","CIRCLE_REPOSITORY_URL","CI_PULL_REQUEST","CIRCLE_NODE_INDEX","CIRCLE_NODE_TOTAL"]),codeshipBasic:h(["CI_BUILD_ID","CI_REPO_NAME","CI_BUILD_URL","CI_PROJECT_ID","CI_BUILD_NUMBER","CI_PULL_REQUEST"]),codeshipPro:h(["CI_BUILD_ID","CI_REPO_NAME","CI_PROJECT_ID"]),concourse:h(["BUILD_ID","BUILD_NAME","BUILD_JOB_NAME","BUILD_PIPELINE_NAME","BUILD_TEAM_NAME","ATC_EXTERNAL_URL"]),codeFresh:h(["CF_BUILD_ID","CF_BUILD_URL","CF_CURRENT_ATTEMPT","CF_STEP_NAME","CF_PIPELINE_NAME","CF_PIPELINE_TRIGGER_ID","CF_PULL_REQUEST_ID","CF_PULL_REQUEST_IS_FORK","CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_TARGET"]),drone:h(["DRONE_JOB_NUMBER","DRONE_BUILD_LINK","DRONE_BUILD_NUMBER","DRONE_PULL_REQUEST"]),githubActions:h(["GITHUB_WORKFLOW","GITHUB_ACTION","GITHUB_EVENT_NAME","GITHUB_RUN_ID","GITHUB_RUN_ATTEMPT","GITHUB_REPOSITORY"]),gitlab:h(["CI_PIPELINE_ID","CI_PIPELINE_URL","CI_BUILD_ID","CI_JOB_ID","CI_JOB_URL","CI_JOB_NAME","CI_NODE_INDEX","CI_NODE_TOTAL","GITLAB_HOST","CI_PROJECT_ID","CI_PROJECT_URL","CI_REPOSITORY_URL","CI_ENVIRONMENT_URL","CI_DEFAULT_BRANCH","RUN_ATTEMPT"]),goCD:h(["GO_SERVER_URL","GO_ENVIRONMENT_NAME","GO_PIPELINE_NAME","GO_PIPELINE_COUNTER","GO_PIPELINE_LABEL","GO_STAGE_NAME","GO_STAGE_COUNTER","GO_JOB_NAME","GO_TRIGGER_USER","GO_REVISION","GO_TO_REVISION","GO_FROM_REVISION","GO_MATERIAL_HAS_CHANGED"]),googleCloud:h(["BUILD_ID","PROJECT_ID","REPO_NAME","BRANCH_NAME","TAG_NAME","COMMIT_SHA","SHORT_SHA"]),jenkins:h(["BUILD_ID","BUILD_URL","BUILD_NUMBER","ghprbPullId"]),semaphore:h(["SEMAPHORE_BRANCH_ID","SEMAPHORE_BUILD_NUMBER","SEMAPHORE_CURRENT_JOB","SEMAPHORE_CURRENT_THREAD","SEMAPHORE_EXECUTABLE_UUID","SEMAPHORE_GIT_BRANCH","SEMAPHORE_GIT_DIR","SEMAPHORE_GIT_REF","SEMAPHORE_GIT_REF_TYPE","SEMAPHORE_GIT_REPO_SLUG","SEMAPHORE_GIT_SHA","SEMAPHORE_GIT_URL","SEMAPHORE_JOB_COUNT","SEMAPHORE_JOB_ID","SEMAPHORE_JOB_NAME","SEMAPHORE_JOB_UUID","SEMAPHORE_PIPELINE_ID","SEMAPHORE_PLATFORM","SEMAPHORE_PROJECT_DIR","SEMAPHORE_PROJECT_HASH_ID","SEMAPHORE_PROJECT_ID","SEMAPHORE_PROJECT_NAME","SEMAPHORE_PROJECT_UUID","SEMAPHORE_REPO_SLUG","SEMAPHORE_TRIGGER_SOURCE","SEMAPHORE_WORKFLOW_ID","PULL_REQUEST_NUMBER"]),shippable:h(["SHIPPABLE_BUILD_ID","SHIPPABLE_BUILD_NUMBER","SHIPPABLE_COMMIT_RANGE","SHIPPABLE_CONTAINER_NAME","SHIPPABLE_JOB_ID","SHIPPABLE_JOB_NUMBER","SHIPPABLE_REPO_SLUG","IS_FORK","IS_GIT_TAG","IS_PRERELEASE","IS_RELEASE","REPOSITORY_URL","REPO_FULL_NAME","REPO_NAME","BUILD_URL","BASE_BRANCH","HEAD_BRANCH","IS_PULL_REQUEST","PULL_REQUEST","PULL_REQUEST_BASE_BRANCH","PULL_REQUEST_REPO_FULL_NAME"]),teamcity:null,teamfoundation:h(["BUILD_BUILDID","BUILD_BUILDNUMBER","BUILD_CONTAINERID"]),travis:h(["TRAVIS_JOB_ID","TRAVIS_BUILD_ID","TRAVIS_BUILD_WEB_URL","TRAVIS_REPO_SLUG","TRAVIS_JOB_NUMBER","TRAVIS_EVENT_TYPE","TRAVIS_COMMIT_RANGE","TRAVIS_BUILD_NUMBER","TRAVIS_PULL_REQUEST","TRAVIS_PULL_REQUEST_BRANCH","TRAVIS_PULL_REQUEST_SHA"]),wercker:null,netlify:h(["BUILD_ID","CONTEXT","URL","DEPLOY_URL","DEPLOY_PRIME_URL","DEPLOY_ID"]),layerci:h(["LAYERCI_JOB_ID","LAYERCI_RUNNER_ID","RETRY_INDEX","LAYERCI_PULL_REQUEST","LAYERCI_REPO_NAME","LAYERCI_REPO_OWNER","LAYERCI_BRANCH","GIT_TAG"])}),Mi=()=>{let{env:e}=process;return{appveyor:{sha:e.APPVEYOR_REPO_COMMIT,branch:e.APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH||e.APPVEYOR_REPO_BRANCH,message:_i(`
|
|
13
|
+
`,e.APPVEYOR_REPO_COMMIT_MESSAGE,e.APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED),authorName:e.APPVEYOR_REPO_COMMIT_AUTHOR,authorEmail:e.APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL},awsCodeBuild:{sha:e.CODEBUILD_RESOLVED_SOURCE_VERSION,remoteOrigin:e.CODEBUILD_SOURCE_REPO_URL},azure:{sha:e.BUILD_SOURCEVERSION,branch:e.BUILD_SOURCEBRANCHNAME,message:e.BUILD_SOURCEVERSIONMESSAGE,authorName:e.BUILD_SOURCEVERSIONAUTHOR,authorEmail:e.BUILD_REQUESTEDFOREMAIL},bamboo:{sha:e.bamboo_planRepository_revision,branch:e.bamboo_planRepository_branch,authorName:e.bamboo_planRepository_username,remoteOrigin:e.bamboo_planRepository_repositoryURL},bitbucket:{sha:e.BITBUCKET_COMMIT,branch:e.BITBUCKET_BRANCH},buildkite:{sha:e.BUILDKITE_COMMIT,branch:e.BUILDKITE_BRANCH,message:e.BUILDKITE_MESSAGE,authorName:e.BUILDKITE_BUILD_CREATOR,authorEmail:e.BUILDKITE_BUILD_CREATOR_EMAIL,remoteOrigin:e.BUILDKITE_REPO,defaultBranch:e.BUILDKITE_PIPELINE_DEFAULT_BRANCH},circle:{sha:e.CIRCLE_SHA1,branch:e.CIRCLE_BRANCH,authorName:e.CIRCLE_USERNAME,remoteOrigin:e.CIRCLE_REPOSITORY_URL},codeshipBasic:{sha:e.CI_COMMIT_ID,branch:e.CI_BRANCH,message:e.CI_COMMIT_MESSAGE,authorName:e.CI_COMMITTER_NAME,authorEmail:e.CI_COMMITTER_EMAIL},codeshipPro:{sha:e.CI_COMMIT_ID,branch:e.CI_BRANCH,message:e.CI_COMMIT_MESSAGE,authorName:e.CI_COMMITTER_NAME,authorEmail:e.CI_COMMITTER_EMAIL},codeFresh:{sha:e.CF_REVISION,branch:e.CF_BRANCH,message:e.CF_COMMIT_MESSAGE,authorName:e.CF_COMMIT_AUTHOR},drone:{sha:e.DRONE_COMMIT_SHA,branch:e.DRONE_SOURCE_BRANCH,message:e.DRONE_COMMIT_MESSAGE,authorName:e.DRONE_COMMIT_AUTHOR,authorEmail:e.DRONE_COMMIT_AUTHOR_EMAIL,remoteOrigin:e.DRONE_GIT_HTTP_URL,defaultBranch:e.DRONE_REPO_BRANCH},githubActions:{sha:e.GITHUB_SHA,branch:e.GH_BRANCH||e.GITHUB_REF,defaultBranch:e.GITHUB_BASE_REF,remoteBranch:e.GITHUB_HEAD_REF,runAttempt:e.GITHUB_RUN_ATTEMPT},gitlab:{sha:e.CI_COMMIT_SHA,branch:e.CI_COMMIT_REF_NAME,message:e.CI_COMMIT_MESSAGE,authorName:e.GITLAB_USER_NAME,authorEmail:e.GITLAB_USER_EMAIL,remoteOrigin:e.CI_REPOSITORY_URL,defaultBranch:e.CI_DEFAULT_BRANCH},googleCloud:{sha:e.COMMIT_SHA,branch:e.BRANCH_NAME},jenkins:{sha:e.GIT_COMMIT,branch:e.GIT_BRANCH},semaphore:{sha:e.SEMAPHORE_GIT_SHA,branch:e.SEMAPHORE_GIT_BRANCH,remoteOrigin:e.SEMAPHORE_GIT_REPO_SLUG},shippable:{sha:e.COMMIT,branch:e.BRANCH,message:e.COMMIT_MESSAGE,authorName:e.COMMITTER},snap:null,teamcity:null,teamfoundation:{sha:e.BUILD_SOURCEVERSION,branch:e.BUILD_SOURCEBRANCHNAME,message:e.BUILD_SOURCEVERSIONMESSAGE,authorName:e.BUILD_SOURCEVERSIONAUTHOR},travis:{sha:e.TRAVIS_PULL_REQUEST_SHA||e.TRAVIS_COMMIT,branch:e.TRAVIS_PULL_REQUEST_BRANCH||e.TRAVIS_BRANCH,message:e.TRAVIS_COMMIT_MESSAGE},wercker:null,netlify:{sha:e.COMMIT_REF,branch:e.BRANCH,remoteOrigin:e.REPOSITORY_URL},layerci:{sha:e.GIT_COMMIT,branch:e.LAYERCI_BRANCH,message:e.GIT_COMMIT_TITLE}}},Ar=e=>{let t=Sr();return t?(0,E.chain)(e()).get(t).value():{}};function Bi(){return(0,E.chain)(br()).omitBy(E.isNull).keys().value()}function Fi(e){return e&&Bi().includes(e)}function Sr(){let e=Li();return _e("detected CI provider name: %s",e),e||null}function ki(){return Ar(br)}function Ur(){return Ar(Mi)}function W(e){let t=ki(),r=Sr(),o=Gi(e,r);return _e("detected CI provider: %s",r),_e("detected CI params: %O",t),_e("detected CI build ID: %o",o),{params:t,provider:r,ciBuildId:o}}function Gi(e,t){return e?{source:"user",value:e}:Fi(t)?{source:"server",value:null}:{source:"random",value:`auto:${qe()}`}}var vr=d(require("archiver")),Dr=d(require("fs-extra")),st=d(require("path")),Nr=d(require("unzipper"));var Hi=50*1024*1024;async function Lr(e,t=Hi){return new Promise((r,o)=>{let n=(0,vr.default)("zip",{zlib:{level:9}}),a=[],c=0;n.on("data",p=>{a.push(p),c+=p.length,c>t&&o(new Error(`Zip size exceeded the limit of ${t} bytes`))}),n.on("warning",p=>{p.code==="ENOENT"?C(p):o(p)}),n.on("error",p=>o(p)),n.on("end",()=>{let p=Buffer.concat(a);r(p)});let m=async p=>{let g=process.cwd(),O=st.default.normalize(p),A=st.default.relative(g,O),w=await Dr.default.stat(p);w.isDirectory()?n.directory(p,A):n.file(p,{name:A,stats:w})};(async p=>{for(let g of p)await m(g);await n.finalize()})(e).catch(o)})}async function Mr(e,t){return Nr.default.Open.buffer(e).then(r=>r.extract({path:t,concurrency:3}))}var Hr=d(require("async-retry")),jr=require("axios");var Br=d(require("axios")),Fr=require("https-proxy-agent"),kr=d(require("proxy-from-env"));var ji=s.extend("axios");function at(e={}){let t=Br.default.create(e);return t.interceptors.request.use(r=>{let o={...r},n=t.getUri(r),a=kr.default.getProxyForUrl(n);return a&&(ji("Using HTTP proxy %s for %s ",a,n),o.proxy=!1,o.httpsAgent=Ki(a)),o}),t}var Te=null;function Ki(e){return Te||(Te=new Fr.HttpsProxyAgent(e),Te)}var ye=s.extend("upload"),Oe=5;async function ct(e,t,r){return ye("Uploading buffer %s",e.name,{buffer:Buffer.byteLength(e.buffer)}),Vi(e.buffer,e.uploadUrl,t,r)}async function $i(e,t,r,o){return at().request({method:"put",url:t,data:e,onUploadProgress:o,headers:{"Content-Disposition":"inline","Content-Type":r}})}async function mt(e,t){try{let r=await at().get(e,{responseType:"arraybuffer",onDownloadProgress:t});return Buffer.from(r.data)}catch(r){throw(0,jr.isAxiosError)(r)&&ye("Failed to download %s: %s",e,r.message),r}}async function Vi(...e){await(0,Hr.default)(async()=>{await $i(...e)},{retries:Oe,onRetry:(t,r)=>{if(ye("Upload failed %d out of %d attempts: %s",r,Oe,t.message),r===Oe){f(`Cannot upload after ${r} times: ${t.message}`);return}C(`Upload failed ${r} out of ${Oe} attempts: ${t.message}`)}})}var pt=e=>({total:t,loaded:r})=>{};function Gr(e){return e/1e3/1e3}var ut=d(require("lodash"));async function Kr(e,t){switch(t.provider){case"githubActions":await Ji(e,t);break;case"gitlab":await Vr(e,t);break;case"circle":await Jr(e,t);break;default:break}}async function $r(e,t,r){switch(t.provider){case"gitlab":await Vr(e,t,r);break;case"circle":await Jr(e,t,r);break;default:break}}async function Vr(e,t,r=null){let o=t.params,n=r?.ci.params,c=(n?Q(n.runAttempt,0):0)+1,m=Q(o.ciNodeIndex,1),u=Q(o.ciNodeTotal,1),p=c>1?"--last-failed":"",g="";u>1&&(g=c>1?"--shard=1/1":`--shard=${m}/${u}`);let O=[p,g].filter(Boolean).join(" ");await x(e.presetOutput??re,`EXTRA_PW_FLAGS="${O}"
|
|
14
|
+
EXTRA_PWCP_FLAGS="${p}"
|
|
15
15
|
RUN_ATTEMPT="${c}"
|
|
16
|
-
`)}async function Ki(e,t){let{matrixIndex:r,matrixTotal:o}=e,n=t.params,a=Q(n.githubRunAttempt,1),c=a>1?"--last-failed":"",p="";o>1&&(p=a>1?"--shard=1/1":`--shard=${r}/${o}`);let m=[c,p].filter(Boolean).join(" "),d=e.presetOutput??te;await w(d,m),s('Dumped PW config: "%s" for GHA to %s',m,d)}async function $r(e,t,r=null){let o=t.params,n=r?.ci.params,a=n?.circleWorkflowId,c=n?.circleWorkflowWorkspaceId,p=Q(o.circleNodeIndex,0),m=Q(o.circleNodeTotal,1),d=c==o.circleWorkflowWorkspaceId&&a!==o.circleWorkflowId,l=d?"--last-failed":"",O="";m>1&&(O=d?"--shard=1/1":`--shard=${p+1}/${m}`);let b=[l,O].filter(Boolean).join(" "),P=e.presetOutput??te;await w(P,b),s('Dumped PW config: "%s" for Circle to %s',b,P)}var Q=(e,t)=>{let r=pt.default.toNumber(e);return pt.default.isNaN(r)?t:r};async function ut(){let e=H();if(e.type!=="GET_COMMAND_CONFIG"||!e.values)throw new Error("Config is missing!");let{recordKey:t,id:r,preset:o,matrixIndex:n,matrixTotal:a,continue:c}=e.values,p=e.values.outputDir,m=q();o==="last-run"&&await Hr(e.values,m);let d=await nr({recordKey:t,ci:m,id:r,config:{matrixIndex:n,matrixTotal:a}});try{await $i({readUrl:d.readUrl,outputDir:p});let l=await Vi(d.metaReadUrl);o==="last-run"&&await jr(e.values,m,l),ce("Cache restored. Cache ID: %s",d.cacheId)}catch(l){if((0,Vr.isAxiosError)(l)&&(l.response?.status===403||l.response?.status===404)){let O=`Cache with ID "${d.cacheId}" not found`;if(c){$e(O);return}throw new Error(O)}throw l}}async function $i({readUrl:e,outputDir:t}){let r=await ct(e);await Dr(r,t||"."),s("Cache downloaded")}async function Vi(e){let t=await ct(e),r=JSON.parse(t.toString("utf-8"));return s("Meta file: %O",r),r}var Jr=u(require("path"));var Yr=require("lodash");function qr({config:e,cacheId:t,orgId:r,path:o,ci:n}){let a={id:t,orgId:r,config:(0,Yr.omit)(e,"recordKey"),path:o,ci:n,createdAt:new Date().toISOString()};return Buffer.from(JSON.stringify(a))}var Wr=e=>Jr.default.resolve(e??"test-results",".last-run.json");async function dt(){let e=H();if(e.type!=="SET_COMMAND_CONFIG"||!e.values)throw new Error("Config is missing!");let{recordKey:t,id:r,preset:o,pwOutputDir:n,matrixIndex:a,matrixTotal:c}=e.values,p=e.values.path?.length?Nr(e.values.path):[],m=[];p&&p.length>0&&m.push(...p);let d=q();if(o==="last-run"){let O=Wr(n);m.push(O)}if(m.length===0)throw new Error("No paths available to upload");let l=await or({recordKey:t,ci:d,id:r,config:{matrixIndex:a,matrixTotal:c}});await Ji({archive:await vr(m),cacheId:l.cacheId,uploadUrl:l.uploadUrl}),await Yi({meta:qr({cacheId:l.cacheId,config:e.values,ci:d,orgId:l.orgId,path:m}),cacheId:l.cacheId,uploadUrl:l.metaUploadUrl}),ce("Cache uploaded. Cache ID: %s",l.cacheId)}async function Ji({archive:e,cacheId:t,uploadUrl:r}){try{let o="application/zip";await at({buffer:e,contentType:o,name:t,uploadUrl:r},o,mt(t)),s("Cache archive uploaded",{cacheId:t})}catch(o){throw s("Failed to upload cache archive",o),o}}async function Yi({meta:e,cacheId:t,uploadUrl:r}){try{let o=`${t}_meta`,n="application/json";await at({buffer:e,contentType:n,name:o,uploadUrl:r},n,mt(o)),s("Cache meta uploaded",{cacheId:t})}catch(o){throw s("Failed to upload cache meta",o),o}}var zr=require("@currents/commit-info"),Xr=require("lodash");var ye=require("lodash");var lt=s.extend("ci-git");function Qr(e){lt("git commit existing info: %O",e);let t=br();lt("commit info from provider environment variables: %O",t);let r=(0,ye.transform)(e,(o,n,a)=>{let c=n||(t?t[a]:null);return o[a]=(0,ye.defaultTo)(c,null)});return lt("combined git and environment variables from provider: %O",r),r}var qi=async()=>{let e=await(0,zr.commitInfo)();return Qr({branch:e.branch,remoteOrigin:e.remote,authorEmail:e.email,authorName:e.author,message:e.message,sha:e.sha,ghaEventData:e.ghaEventData})},Zr=(0,Xr.memoize)(qi);var eo=u(require("getos")),to=require("lodash"),x=require("os"),ro=require("util"),Wi=async()=>{if((0,x.platform)()==="linux")try{let e=await(0,ro.promisify)(eo.default)();return"dist"in e&&"release"in e?[e.dist,e.release].join(" - "):(0,x.release)()}catch{return(0,x.release)()}return(0,x.release)()},Qi=async()=>{let e=await Wi();return{osName:(0,x.platform)(),osVersion:e,osCpus:[],osMemory:{free:(0,x.freemem)(),total:(0,x.totalmem)()}}},oo=(0,to.memoize)(Qi);var vo=require("lodash"),De=u(require("path")),Do=u(require("semver"));var I={debug:{name:"Debug",env:"CURRENTS_DEBUG",cli:"--debug"},ciBuildId:{name:"CI Build ID",env:"CURRENTS_CI_BUILD_ID",cli:"--ci-build-id"},recordKey:{name:"Record Key",env:"CURRENTS_RECORD_KEY",cli:"--key"},projectId:{name:"Project ID",env:"CURRENTS_PROJECT_ID",cli:"--project-id"},tag:{name:"Currents Tag",env:"CURRENTS_TAG",cli:"--tag"},disableTitleTags:{name:"Disable Title Tags",env:"CURRENTS_DISABLE_TITLE_TAGS",cli:"--disable-title-tags"},removeTitleTags:{name:"Remove Title Tags",env:"CURRENTS_REMOVE_TITLE_TAGS",cli:"--remove-title-tags"},machineId:{name:"Machine ID",env:"CURRENTS_MACHINE_ID",cli:"--machine-id"},reportDir:{name:"Report Directory",env:"CURRENTS_REPORT_DIR",cli:"--report-dir"}};function no(){return{projectId:process.env[I.projectId.env],recordKey:process.env[I.recordKey.env],ciBuildId:process.env[I.ciBuildId.env],tag:process.env[I.tag.env]?process.env[I.tag.env]?.split(",").map(e=>e.trim()):void 0,disableTitleTags:!!process.env[I.disableTitleTags.env],removeTitleTags:!!process.env[I.removeTitleTags.env],debug:!!process.env[I.debug.env],machineId:process.env[I.machineId.env]}}var zi=s.extend("config"),Xi=["projectId","recordKey"],ft=null;function io(e){ft=L(I,Xi,no,e),zi("Resolved Currents config: %o",ft)}function Pe(){return ft}function so(e){return{ciBuildId:e.ciBuildId,projectId:e.projectId,recordKey:e.key,tag:e.tag,removeTitleTags:e.removeTitleTags,disableTitleTags:e.disableTitleTags,debug:e.debug,machineId:e.machineId,reportDir:e.reportDir}}var j=class{constructor(t){this.config=t}async getFullTestSuite(){return[]}};var Eo=u(require("fs-extra")),Ro=require("jest-cli"),Io=u(require("tmp"));var Co=require("lodash");function ao(e){let t=[];for(let[r,o]of Object.entries(e))r==="_"||r==="$0"||r.includes("-")||(typeof o=="boolean"?o&&t.push(`--${r}`):Array.isArray(o)?o.forEach(n=>{t.push(`--${r}=${n}`)}):t.push(`--${r}=${o}`));return t.join(" ")}var co=require("lodash"),Zi=["bail","clearCache","collectCoverage","collectCoverageFrom","color","colors","config","coverage","coverageDirectory","coveragePathIgnorePatterns","coverageProvider","coverageReporters","coverageThreshold","debug","detectLeaks","detectOpenHandles","errorOnDeprecated","expand","forceExit","json","listTests","logHeapUsage","noStackTrace","notify","notifyMode","openHandlesTimeout","outputFile","reporters","runner","shard","showConfig","showSeed","silent","testNamePattern","verbose","waitNextEventLoopTurnForUnhandledRejectionEvents","watch","watchAll","watchPathIgnorePatterns","watchman"];function mo(e){return(0,co.omit)(e,...Zi)}var lo=u(require("fs")),fo=require("jest-config"),gt=require("lodash"),Ct=u(require("path"));function we(e,t){return(...r)=>new Promise((o,n)=>{let a=0,c=()=>{a++;try{let p=e(...r);o(p)}catch(p){if(a>=t.length)n(p);else{let m=t[a-1];setTimeout(c,m)}}};c()})}var po=u(require("fs-extra")),es=u(require("path"));async function xe(e){let t=await po.default.pathExists(e);if(!t)throw new Error("File does not exist");return t}var uo=s.extend("jest-discovery");async function go(e){try{let{config:t,configPath:r}=await(0,fo.readInitialOptions)(e),o=["collectCoverage","collectCoverageFrom","coverageDirectory","coveragePathIgnorePatterns","coverageProvider","coverageReporters","coverageThreshold","errorOnDeprecated","forceCoverageMatch","notify","notifyMode","openHandlesTimeout","reporters","runner","showSeed","testFailureExitCode","verbose","watchPathIgnorePatterns","watchPlugins","watchman","bail","clearCache","color","colors","debug","detectLeaks","detectOpenHandles","expand","forceExit","json","listTests","logHeapUsage","noStackTrace","outputFile","shard","showConfig","silent","testNamePattern","waitNextEventLoopTurnForUnhandledRejectionEvents","watch","watchAll"],n=["collectCoverageFrom","coverageDirectory","coveragePathIgnorePatterns","detectLeaks","detectOpenHandles","errorOnDeprecated","forceCoverageMatch","openHandlesTimeout","runner","watchPathIgnorePatterns"],a=(0,gt.omit)(t,o);if(a.projects&&(a.projects=a.projects.map(m=>typeof m!="string"?(0,gt.omit)(m,n):m)),a.rootDir&&Object.keys(a).length===1)return null;let c=Ct.default.resolve(r?Ct.default.dirname(r):process.cwd(),`.jest-scanner-${new Date().getTime()}.config.js`),p=`module.exports=${JSON.stringify(a,null,2)}`;return uo("configFileContent: %O",p),lo.default.writeFileSync(c,p),await we(xe,[200,200,200,200,200,1e3])(c),c}catch(t){return f("Failed to recreate the config file"),uo("error %o",t),null}}async function ho(e){let t="!!##ThisPatternWillNotMatchAnyTestName##!!",r=e.options,o=mo(r),n=ao(o),a=r.config,c=await go(a);return{cliArgs:[n,"--testNamePattern",t,"--reporters","@currents/cmd/discovery/jest","--shard=1/1",c?`--config=${c}`:"",...e.args].filter(m=>!(0,Co.isEmpty)(m)),configFilePath:c}}var ts=s.extend("jest-discovery");async function _o(e,t){console.time(C("@currents/jest:fullTestSuite-ready"));let{cliArgs:r,configFilePath:o}=await ho(t);try{let n=Io.default.fileSync({postfix:".json"});return ts("running scanner: %o",r),process.env.CURRENTS_DISCOVERY_PATH=n.name,await(0,Ro.run)(r.concat(["--openHandlesTimeout=0"])),await we(xe,Array.from({length:300},()=>100))(n.name),console.timeEnd(C("@currents/jest:fullTestSuite-ready")),await $(n.name)}catch(n){return f("Failed to obtain the jest full test suite:",n),[]}finally{o&&Eo.default.unlinkSync(o)}}var be=class extends j{constructor(t){super(t)}async getFullTestSuite(){return _o(this.config.frameworkConfig,this.config.cliArgs)}};var Po=u(require("fs-extra"));var wo=require("path"),xo=require("xml2js");var Oo=u(require("crypto"));function yo(e,t,r){let o=Ae(e.failure),n=o.length>0;return{_t:rs(t?.timestamp??""),testId:ht(re(e.name,t.name).join(", "),z(t)),title:re(e.name,t.name),state:n?"failed":"passed",isFlaky:ns(),expectedStatus:n?"skipped":"passed",timeout:is(),location:ss(t?.file??""),retries:as(o),attempts:cs(e,o,t.timestamp??"",r)}}function ht(e,t){let r=`${e}${t}`;return Oo.default.createHash("sha256").update(r).digest("hex").substring(0,16)}function rs(e){return os(e)?new Date(e).getTime():0}function os(e){let t=new Date(e);return!isNaN(t.getTime())}function re(e,t){return[t,e].filter(Boolean)}function ns(){return!1}function is(){return 0}function ss(e){return{column:1,file:e,line:1}}function as(e){let t=0;return e.forEach(r=>{typeof r!="string"&&t++}),t}function cs(e,t,r,o){let n=Se(e.time);return t.length===0?[{_s:"passed",attempt:0,workerIndex:1,parallelIndex:1,startTime:r,steps:[],duration:n,status:"passed",stdout:To(e?.["system-out"]),stderr:[],errors:[],error:void 0}]:t.reduce((a,c,p)=>{if(c!=="true"&&c!=="false"){let m=ps(c);a.push({_s:"failed",attempt:p,workerIndex:1,parallelIndex:1,startTime:us(o,r),steps:[],duration:n,status:"passed",stdout:To(e?.["system-out"]),stderr:ms(e?.["system-err"]),errors:m,error:m?m[0]:void 0})}return a},[])}function To(e){return e?[e]:[]}function ms(e){return e?[e]:[]}function ps(e){return e==="true"||e==="false"?[]:[typeof e=="string"?{message:e}:{message:e.message,stack:e._,value:e.type}]}function us(e,t){let r=new Date(t).getTime()+e;return new Date(r).toISOString()}function z(e){return e.file??e.name??"No spec"}function Ae(e){return e?Array.isArray(e)?e:[e]:[]}function ds(e){return Math.round(e*1e3)}function Se(e){return ds(parseFloat(e??"0"))}var ls=s.extend("junit-discovery");async function bo(e){console.time(C("@currents/junit:fullTestSuite-ready"));try{ls("running scanner: %o",e);let t=(0,wo.join)(e,"currents.results.xml");process.env.CURRENTS_DISCOVERY_PATH=t;let r=Po.default.readFileSync(t,"utf-8"),o=await(0,xo.parseStringPromise)(r,{explicitArray:!1,mergeAttrs:!0});return fs(o)}catch(t){return f("Failed to obtain the junit full test suite:",t),[]}}function fs(e){let t=[],r=e.testsuites?.testsuite,o={name:e.testsuites?.name??"No name",tags:[],tests:[]};return r?.forEach(n=>{n?.testcase?.forEach(c=>{let p={title:re(c.name,n.name),spec:z(n),tags:[],testId:ht(re(c.name,n.name).join(", "),z(n))};o.tests.push(p)})}),t.push(o),t}var Ue=class extends j{constructor(t,r){super(t),this.reportDir=r}async getFullTestSuite(){return bo(this.reportDir)}};function Ao(e,t){switch(e.framework){case"jest":return new be(e);case"junit":return new Ue(e,t);default:return new j(e)}}var X=u(require("fs-extra")),B=u(require("path"));async function So(e){let t=await gs(e?.reportDir);if(!t)throw new Error("Failed to find the report dir");return{reportDir:t,configFilePath:e?.configFilePath??B.default.join(t,"config.json")}}async function gs(e){return e?(await ve(e),e):Cs((0,B.join)(process.cwd(),".currents"))}async function Cs(e){let t=await X.default.readdir(e),r=null;for(let o of t){let n=B.default.join(e,o),a=await X.default.stat(n);a.isDirectory()&&(!r||a.birthtime>r.birthtime)&&(r={name:o,birthtime:a.birthtime})}return r?(0,B.resolve)(e,r.name):null}async function ve(e){try{return await X.default.pathExists(e)}catch{return f("Error checking if path exists:",f),!1}}async function Uo(e){let t=B.default.join(e,"instances");return hs(t)}async function hs(e){let t=await X.default.readdir(e),r=[];for(let o of t){let n=B.default.join(e,o);(await X.default.stat(n)).isFile()&&r.push(n)}return r}async function Et(){let e=Pe();if(!e)throw new Error("Currents config is missing!");let t=await So(e);wt(_s(t.reportDir)),s("Reporter options: %o",t),S("Report directory: %s",t.reportDir);let r=await $(t.configFilePath);s("Report config: %o",r);let o=await Uo(t.reportDir);s("Found %d instance results in the reportDir: %s",o.length,t.reportDir);let n=Rs(t.reportDir),a=await ve(n),c=Is(t.reportDir),p=null;if(a){let A=await $(n);g("Marker file detected. The report was already uploaded: %o",{runUrl:A.response.runUrl,isoDate:A.isoDate}),await ve(c)&&(p=await $(c),s("Full test suite file detected: %s",c))}if(p)s("The discovery stage was skipped");else{if(p=await Ao(r,t.reportDir).getFullTestSuite(),Ts(p))throw new Error("Failed to discover the full test suite!");await w(c,JSON.stringify(p))}let m=p.length===1?p[0].name:null,d={currents:e},l={type:r.framework,version:r.frameworkVersion,clientVersion:se,frameworkConfig:{originFramework:r.frameworkConfig?.originFramework,originFrameworkVersion:r.frameworkConfig?.originFrameworkVersion}},O=ge.userFacingNanoid(),b=q(e.ciBuildId),P={};for await(let A of o){let D=await $(A);P[D.groupId]||(P[D.groupId]=[]),P[D.groupId].push(D)}for await(let A of Object.keys(P)){let D=P[A],Ge=A;m&&(s("Default group found: %s, overwriting the group in the results",m),Ge=m,D=D.map(K=>({...K,groupId:m})));try{let K=await Es({ci:b,group:Ge,instances:D,fullTestSuite:p,config:d,machineId:O,framework:l});s("Api response: %o",K),S("[%s] Run created: %s",Ge,K.runUrl);let kn={response:K,isoDate:new Date().toISOString()};await w(n,JSON.stringify(kn)),s("Marker file %s: %s",a?"overwritten":"created",n)}catch(K){throw s("Failed to upload the results to the dashboard"),K}}}async function Es({ci:e,group:t,instances:r,fullTestSuite:o,config:n,machineId:a,framework:c}){let p=await Zr(),m=await oo(),d={browserName:"node",browserVersion:Do.default.coerce(process.version)?.version},{currents:l}=n,b={platform:{...d,...m},ci:e,commit:p,group:t,fullTestSuite:o,config:n,projectId:l.projectId,recordKey:l.recordKey,ciBuildId:e.ciBuildId.value??void 0,tags:l.tag??[],machineId:l.machineId??a,framework:c,instances:r,previousCiBuildId:process.env.CURRENTS_PREVIOUS_CI_BUILD_ID};return s("Creating run: %o",(0,vo.mapValues)(b,(P,A)=>A==="recordKey"?"******":P)),cr(b)}function Rs(e){return De.default.join(e,"upload.marker.json")}function Is(e){return De.default.join(e,"fullTestSuite.json")}function _s(e){return De.default.join(e,`.debug-${new Date().toISOString()}.log`)}function Ts(e){return e.length===0||e.some(t=>t.tests.length===0)}var Os=s.extend("cli");async function No(e){await U(async t=>{vt(t);let r=ue();Os("Config: %o",r),await Xe()},e)}var F=require("@commander-js/extra-typings");var Lo=new F.Option("--api-key <api-key>","API key from Currents dashboard for authentication").env(R(M,"apiKey")),Mo=new F.Option("-o, --output <path>","Path to the file where output will be written").env(R(M,"output")),Bo=new F.Option("--ci-build-id <id>","Unique identifier for the run"),Fo=new F.Option("-p, --project-id <project>","Project ID from Currents associated with the run").env(R(M,"projectId")),ko=new F.Option("-t, --tag <tag>","Comma-separated list of tags for the run").argParser(Y),Go=new F.Option("--debug","Enable debug logging").env(R(M,"debug")).default(!1),Ho=new F.Option("-b, --branch <branch>","Branch name for the recorded run"),jo=new F.Option("--pw-last-run",'Generate output formatted for Playwright ".last-run.json"');var Ne="api",ys=e=>`
|
|
16
|
+
`)}async function Ji(e,t){let{matrixIndex:r,matrixTotal:o}=e,n=t.params,a=Q(n.githubRunAttempt,1),c=a>1?"--last-failed":"",m="";o>1&&(m=a>1?"--shard=1/1":`--shard=${r}/${o}`);let u=[c,m].filter(Boolean).join(" "),p=e.presetOutput??re;await x(p,u),s('Dumped PW config: "%s" for GHA to %s',u,p)}async function Jr(e,t,r=null){let o=t.params,n=r?.ci.params,a=n?.circleWorkflowId,c=n?.circleWorkflowWorkspaceId,m=Q(o.circleNodeIndex,0),u=Q(o.circleNodeTotal,1),p=c==o.circleWorkflowWorkspaceId&&a!==o.circleWorkflowId,g=p?"--last-failed":"",O="";u>1&&(O=p?"--shard=1/1":`--shard=${m+1}/${u}`);let A=[g,O].filter(Boolean).join(" "),w=e.presetOutput??re;await x(w,A),s('Dumped PW config: "%s" for Circle to %s',A,w)}var Q=(e,t)=>{let r=ut.default.toNumber(e);return ut.default.isNaN(r)?t:r};async function lt(){let e=H();if(e.type!=="GET_COMMAND_CONFIG"||!e.values)throw new Error("Config is missing!");let{recordKey:t,id:r,preset:o,matrixIndex:n,matrixTotal:a,continue:c}=e.values,m=e.values.outputDir,u=W();o==="last-run"&&await Kr(e.values,u);let p=await ar({recordKey:t,ci:u,id:r,config:{matrixIndex:n,matrixTotal:a}});try{let g=await qi({readUrl:p.readUrl,outputDir:m}),O=await Wi(p.metaReadUrl);o==="last-run"&&await $r(e.values,u,O),y(l("- restoring cache to"),g),me("Cache restored. Cache ID: %s",p.cacheId)}catch(g){if((0,qr.isAxiosError)(g)&&(g.response?.status===403||g.response?.status===404)){let O=`Cache with ID "${p.cacheId}" not found`;if(c){ee(O);return}throw new Error(O)}throw g}}async function qi({readUrl:e,outputDir:t}){let r=await mt(e),o=Yi(t);return await Mr(r,o),s("Cache downloaded"),o}function Yi(e){let t=e??process.cwd();return dt.default.isAbsolute(t)?t:dt.default.resolve(process.cwd(),t)}async function Wi(e){let t=await mt(e),r=JSON.parse(t.toString("utf-8"));return s("Meta file: %O",r),r}var Yr=require("lodash");function Wr({config:e,cacheId:t,orgId:r,path:o,ci:n}){let a={id:t,orgId:r,config:(0,Yr.omit)(e,"recordKey"),path:o,ci:n,createdAt:new Date().toISOString()};return Buffer.from(JSON.stringify(a))}function Qr(e,t){e instanceof Error?ee("%s. %s.",t,e.message):ee("%s. %s.",t,"Unknown error")}var J=d(require("path")),ft=require("glob");var zr=async e=>{let t=J.default.resolve(e??"./test-results"),r=[J.default.resolve(t,"**/.last-run.json"),J.default.resolve(t,".last-run.json")];return(0,ft.glob)(r)},Xr=async(e=[])=>{let t=Qi(e),r=[];return t.length>0&&r.push(...await(0,ft.glob)(e)),r};function Qi(e){let t=process.cwd();return e.filter(r=>{let o=J.default.resolve(r),n=J.default.relative(t,o);return r.startsWith("..")||J.default.isAbsolute(n)?(Qr(null,`Invalid path: "${r}". Path traversal detected. The path was skipped.`),!1):!0})}async function gt(){let e=H();if(e.type!=="SET_COMMAND_CONFIG"||!e.values)throw new Error("Config is missing!");let{recordKey:t,id:r,preset:o,pwOutputDir:n,matrixIndex:a,matrixTotal:c}=e.values,m=await Xr(e.values.path),u=W();if(o==="last-run"&&m.push(...await zr(n)),m.length===0)throw new Error("No paths available to upload");let p=await sr({recordKey:t,ci:u,id:r,config:{matrixIndex:a,matrixTotal:c}});s("Cache upload url created",{result:p}),await zi({archive:await Lr(m),cacheId:p.cacheId,uploadUrl:p.uploadUrl}),y(m.map(g=>`${l("- uploading")} ${g}`).join(`
|
|
17
|
+
`)),await Xi({meta:Wr({cacheId:p.cacheId,config:e.values,ci:u,orgId:p.orgId,path:m}),cacheId:p.cacheId,uploadUrl:p.metaUploadUrl}),me("Cache uploaded. Cache ID: %s",p.cacheId)}async function zi({archive:e,cacheId:t,uploadUrl:r}){try{let o="application/zip";await ct({buffer:e,contentType:o,name:t,uploadUrl:r},o,pt(t)),s("Cache archive uploaded",{cacheId:t})}catch(o){throw s("Failed to upload cache archive",o),o}}async function Xi({meta:e,cacheId:t,uploadUrl:r}){try{let o=`${t}_meta`,n="application/json";await ct({buffer:e,contentType:n,name:o,uploadUrl:r},n,pt(o)),s("Cache meta uploaded",{cacheId:t})}catch(o){throw s("Failed to upload cache meta",o),o}}var eo=require("@currents/commit-info"),to=require("lodash");var Pe=require("lodash");var Ct=s.extend("ci-git");function Zr(e){Ct("git commit existing info: %O",e);let t=Ur();Ct("commit info from provider environment variables: %O",t);let r=(0,Pe.transform)(e,(o,n,a)=>{let c=n||(t?t[a]:null);return o[a]=(0,Pe.defaultTo)(c,null)});return Ct("combined git and environment variables from provider: %O",r),r}var Zi=async()=>{let e=await(0,eo.commitInfo)();return Zr({branch:e.branch,remoteOrigin:e.remote,authorEmail:e.email,authorName:e.author,message:e.message,sha:e.sha,ghaEventData:e.ghaEventData})},ro=(0,to.memoize)(Zi);var oo=d(require("getos")),no=require("lodash"),b=require("os"),io=require("util"),es=async()=>{if((0,b.platform)()==="linux")try{let e=await(0,io.promisify)(oo.default)();return"dist"in e&&"release"in e?[e.dist,e.release].join(" - "):(0,b.release)()}catch{return(0,b.release)()}return(0,b.release)()},ts=async()=>{let e=await es();return{osName:(0,b.platform)(),osVersion:e,osCpus:[],osMemory:{free:(0,b.freemem)(),total:(0,b.totalmem)()}}},so=(0,no.memoize)(ts);var Lo=require("lodash"),Ne=d(require("path")),Mo=d(require("semver"));var I={debug:{name:"Debug",env:"CURRENTS_DEBUG",cli:"--debug"},ciBuildId:{name:"CI Build ID",env:"CURRENTS_CI_BUILD_ID",cli:"--ci-build-id"},recordKey:{name:"Record Key",env:"CURRENTS_RECORD_KEY",cli:"--key"},projectId:{name:"Project ID",env:"CURRENTS_PROJECT_ID",cli:"--project-id"},tag:{name:"Currents Tag",env:"CURRENTS_TAG",cli:"--tag"},disableTitleTags:{name:"Disable Title Tags",env:"CURRENTS_DISABLE_TITLE_TAGS",cli:"--disable-title-tags"},removeTitleTags:{name:"Remove Title Tags",env:"CURRENTS_REMOVE_TITLE_TAGS",cli:"--remove-title-tags"},machineId:{name:"Machine ID",env:"CURRENTS_MACHINE_ID",cli:"--machine-id"},reportDir:{name:"Report Directory",env:"CURRENTS_REPORT_DIR",cli:"--report-dir"}};function ao(){return{projectId:process.env[I.projectId.env],recordKey:process.env[I.recordKey.env],ciBuildId:process.env[I.ciBuildId.env],tag:process.env[I.tag.env]?process.env[I.tag.env]?.split(",").map(e=>e.trim()):void 0,disableTitleTags:!!process.env[I.disableTitleTags.env],removeTitleTags:!!process.env[I.removeTitleTags.env],debug:!!process.env[I.debug.env],machineId:process.env[I.machineId.env]}}var rs=s.extend("config"),os=["projectId","recordKey"],ht=null;function co(e){ht=L(I,os,ao,e),rs("Resolved Currents config: %o",ht)}function we(){return ht}function mo(e){return{ciBuildId:e.ciBuildId,projectId:e.projectId,recordKey:e.key,tag:e.tag,removeTitleTags:e.removeTitleTags,disableTitleTags:e.disableTitleTags,debug:e.debug,machineId:e.machineId,reportDir:e.reportDir}}var j=class{constructor(t){this.config=t}async getFullTestSuite(){return[]}};var _o=d(require("fs-extra")),To=require("jest-cli"),Oo=d(require("tmp"));var Ro=require("lodash");function po(e){let t=[];for(let[r,o]of Object.entries(e))r==="_"||r==="$0"||r.includes("-")||(typeof o=="boolean"?o&&t.push(`--${r}`):Array.isArray(o)?o.forEach(n=>{t.push(`--${r}=${n}`)}):t.push(`--${r}=${o}`));return t.join(" ")}var uo=require("lodash"),ns=["bail","clearCache","collectCoverage","collectCoverageFrom","color","colors","config","coverage","coverageDirectory","coveragePathIgnorePatterns","coverageProvider","coverageReporters","coverageThreshold","debug","detectLeaks","detectOpenHandles","errorOnDeprecated","expand","forceExit","json","listTests","logHeapUsage","noStackTrace","notify","notifyMode","openHandlesTimeout","outputFile","reporters","runner","shard","showConfig","showSeed","silent","testNamePattern","verbose","waitNextEventLoopTurnForUnhandledRejectionEvents","watch","watchAll","watchPathIgnorePatterns","watchman"];function lo(e){return(0,uo.omit)(e,...ns)}var Co=d(require("fs")),ho=require("jest-config"),Et=require("lodash"),Rt=d(require("path"));function xe(e,t){return(...r)=>new Promise((o,n)=>{let a=0,c=()=>{a++;try{let m=e(...r);o(m)}catch(m){if(a>=t.length)n(m);else{let u=t[a-1];setTimeout(c,u)}}};c()})}var fo=d(require("fs-extra")),is=d(require("path"));async function be(e){let t=await fo.default.pathExists(e);if(!t)throw new Error("File does not exist");return t}var go=s.extend("jest-discovery");async function Eo(e){try{let{config:t,configPath:r}=await(0,ho.readInitialOptions)(e),o=["collectCoverage","collectCoverageFrom","coverageDirectory","coveragePathIgnorePatterns","coverageProvider","coverageReporters","coverageThreshold","errorOnDeprecated","forceCoverageMatch","notify","notifyMode","openHandlesTimeout","reporters","runner","showSeed","testFailureExitCode","verbose","watchPathIgnorePatterns","watchPlugins","watchman","bail","clearCache","color","colors","debug","detectLeaks","detectOpenHandles","expand","forceExit","json","listTests","logHeapUsage","noStackTrace","outputFile","shard","showConfig","silent","testNamePattern","waitNextEventLoopTurnForUnhandledRejectionEvents","watch","watchAll"],n=["collectCoverageFrom","coverageDirectory","coveragePathIgnorePatterns","detectLeaks","detectOpenHandles","errorOnDeprecated","forceCoverageMatch","openHandlesTimeout","runner","watchPathIgnorePatterns"],a=(0,Et.omit)(t,o);if(a.projects&&(a.projects=a.projects.map(u=>typeof u!="string"?(0,Et.omit)(u,n):u)),a.rootDir&&Object.keys(a).length===1)return null;let c=Rt.default.resolve(r?Rt.default.dirname(r):process.cwd(),`.jest-scanner-${new Date().getTime()}.config.js`),m=`module.exports=${JSON.stringify(a,null,2)}`;return go("configFileContent: %O",m),Co.default.writeFileSync(c,m),await xe(be,[200,200,200,200,200,1e3])(c),c}catch(t){return f("Failed to recreate the config file"),go("error %o",t),null}}async function Io(e){let t="!!##ThisPatternWillNotMatchAnyTestName##!!",r=e.options,o=lo(r),n=po(o),a=r.config,c=await Eo(a);return{cliArgs:[n,"--testNamePattern",t,"--reporters","@currents/cmd/discovery/jest","--shard=1/1",c?`--config=${c}`:"",...e.args].filter(u=>!(0,Ro.isEmpty)(u)),configFilePath:c}}var ss=s.extend("jest-discovery");async function yo(e,t){console.time(l("@currents/jest:fullTestSuite-ready"));let{cliArgs:r,configFilePath:o}=await Io(t);try{let n=Oo.default.fileSync({postfix:".json"});return ss("running scanner: %o",r),process.env.CURRENTS_DISCOVERY_PATH=n.name,await(0,To.run)(r.concat(["--openHandlesTimeout=0"])),await xe(be,Array.from({length:300},()=>100))(n.name),console.timeEnd(l("@currents/jest:fullTestSuite-ready")),await $(n.name)}catch(n){return f("Failed to obtain the jest full test suite:",n),[]}finally{o&&_o.default.unlinkSync(o)}}var Ae=class extends j{constructor(t){super(t)}async getFullTestSuite(){return yo(this.config.frameworkConfig,this.config.cliArgs)}};var bo=d(require("fs-extra"));var Ao=require("path"),So=require("xml2js");var wo=d(require("crypto"));function xo(e,t,r){let o=Se(e.failure),n=o.length>0;return{_t:as(t?.timestamp??""),testId:It(oe(e.name,t.name).join(", "),z(t)),title:oe(e.name,t.name),state:n?"failed":"passed",isFlaky:ms(),expectedStatus:n?"skipped":"passed",timeout:ps(),location:us(t?.file??""),retries:ds(o),attempts:ls(e,o,t.timestamp??"",r)}}function It(e,t){let r=`${e}${t}`;return wo.default.createHash("sha256").update(r).digest("hex").substring(0,16)}function as(e){return cs(e)?new Date(e).getTime():0}function cs(e){let t=new Date(e);return!isNaN(t.getTime())}function oe(e,t){return[t,e].filter(Boolean)}function ms(){return!1}function ps(){return 0}function us(e){return{column:1,file:e,line:1}}function ds(e){let t=0;return e.forEach(r=>{typeof r!="string"&&t++}),t}function ls(e,t,r,o){let n=Ue(e.time);return t.length===0?[{_s:"passed",attempt:0,workerIndex:1,parallelIndex:1,startTime:r,steps:[],duration:n,status:"passed",stdout:Po(e?.["system-out"]),stderr:[],errors:[],error:void 0}]:t.reduce((a,c,m)=>{if(c!=="true"&&c!=="false"){let u=gs(c);a.push({_s:"failed",attempt:m,workerIndex:1,parallelIndex:1,startTime:Cs(o,r),steps:[],duration:n,status:"passed",stdout:Po(e?.["system-out"]),stderr:fs(e?.["system-err"]),errors:u,error:u?u[0]:void 0})}return a},[])}function Po(e){return e?[e]:[]}function fs(e){return e?[e]:[]}function gs(e){return e==="true"||e==="false"?[]:[typeof e=="string"?{message:e}:{message:e.message,stack:e._,value:e.type}]}function Cs(e,t){let r=new Date(t).getTime()+e;return new Date(r).toISOString()}function z(e){return e.file??e.name??"No spec"}function Se(e){return e?Array.isArray(e)?e:[e]:[]}function hs(e){return Math.round(e*1e3)}function Ue(e){return hs(parseFloat(e??"0"))}var Es=s.extend("junit-discovery");async function Uo(e){console.time(l("@currents/junit:fullTestSuite-ready"));try{Es("running scanner: %o",e);let t=(0,Ao.join)(e,"currents.results.xml");process.env.CURRENTS_DISCOVERY_PATH=t;let r=bo.default.readFileSync(t,"utf-8"),o=await(0,So.parseStringPromise)(r,{explicitArray:!1,mergeAttrs:!0});return Rs(o)}catch(t){return f("Failed to obtain the junit full test suite:",t),[]}}function Rs(e){let t=[],r=e.testsuites?.testsuite,o={name:e.testsuites?.name??"No name",tags:[],tests:[]};return r?.forEach(n=>{n?.testcase?.forEach(c=>{let m={title:oe(c.name,n.name),spec:z(n),tags:[],testId:It(oe(c.name,n.name).join(", "),z(n))};o.tests.push(m)})}),t.push(o),t}var ve=class extends j{constructor(t,r){super(t),this.reportDir=r}async getFullTestSuite(){return Uo(this.reportDir)}};function vo(e,t){switch(e.framework){case"jest":return new Ae(e);case"junit":return new ve(e,t);default:return new j(e)}}var X=d(require("fs-extra")),B=d(require("path"));async function Do(e){let t=await Is(e?.reportDir);if(!t)throw new Error("Failed to find the report dir");return{reportDir:t,configFilePath:e?.configFilePath??B.default.join(t,"config.json")}}async function Is(e){return e?(await De(e),e):_s((0,B.join)(process.cwd(),".currents"))}async function _s(e){let t=await X.default.readdir(e),r=null;for(let o of t){let n=B.default.join(e,o),a=await X.default.stat(n);a.isDirectory()&&(!r||a.birthtime>r.birthtime)&&(r={name:o,birthtime:a.birthtime})}return r?(0,B.resolve)(e,r.name):null}async function De(e){try{return await X.default.pathExists(e)}catch{return f("Error checking if path exists:",f),!1}}async function No(e){let t=B.default.join(e,"instances");return Ts(t)}async function Ts(e){let t=await X.default.readdir(e),r=[];for(let o of t){let n=B.default.join(e,o);(await X.default.stat(n)).isFile()&&r.push(n)}return r}async function _t(){let e=we();if(!e)throw new Error("Currents config is missing!");let t=await Do(e);At(ws(t.reportDir)),s("Reporter options: %o",t),y("Report directory: %s",t.reportDir);let r=await $(t.configFilePath);s("Report config: %o",r);let o=await No(t.reportDir);s("Found %d instance results in the reportDir: %s",o.length,t.reportDir);let n=ys(t.reportDir),a=await De(n),c=Ps(t.reportDir),m=null;if(a){let S=await $(n);C("Marker file detected. The report was already uploaded: %o",{runUrl:S.response.runUrl,isoDate:S.isoDate}),await De(c)&&(m=await $(c),s("Full test suite file detected: %s",c))}if(m)s("The discovery stage was skipped");else{if(m=await vo(r,t.reportDir).getFullTestSuite(),xs(m))throw new Error("Failed to discover the full test suite!");await x(c,JSON.stringify(m))}let u=m.length===1?m[0].name:null,p={currents:e},g={type:r.framework,version:r.frameworkVersion,clientVersion:ae,frameworkConfig:{originFramework:r.frameworkConfig?.originFramework,originFrameworkVersion:r.frameworkConfig?.originFrameworkVersion}},O=Ce.userFacingNanoid(),A=W(e.ciBuildId),w={};for await(let S of o){let D=await $(S);w[D.groupId]||(w[D.groupId]=[]),w[D.groupId].push(D)}for await(let S of Object.keys(w)){let D=w[S],He=S;u&&(s("Default group found: %s, overwriting the group in the results",u),He=u,D=D.map(K=>({...K,groupId:u})));try{let K=await Os({ci:A,group:He,instances:D,fullTestSuite:m,config:p,machineId:O,framework:g});s("Api response: %o",K),y("[%s] Run created: %s",He,K.runUrl);let jn={response:K,isoDate:new Date().toISOString()};await x(n,JSON.stringify(jn)),s("Marker file %s: %s",a?"overwritten":"created",n)}catch(K){throw s("Failed to upload the results to the dashboard"),K}}}async function Os({ci:e,group:t,instances:r,fullTestSuite:o,config:n,machineId:a,framework:c}){let m=await ro(),u=await so(),p={browserName:"node",browserVersion:Mo.default.coerce(process.version)?.version},{currents:g}=n,A={platform:{...p,...u},ci:e,commit:m,group:t,fullTestSuite:o,config:n,projectId:g.projectId,recordKey:g.recordKey,ciBuildId:e.ciBuildId.value??void 0,tags:g.tag??[],machineId:g.machineId??a,framework:c,instances:r,previousCiBuildId:process.env.CURRENTS_PREVIOUS_CI_BUILD_ID};return s("Creating run: %o",(0,Lo.mapValues)(A,(w,S)=>S==="recordKey"?"******":w)),ur(A)}function ys(e){return Ne.default.join(e,"upload.marker.json")}function Ps(e){return Ne.default.join(e,"fullTestSuite.json")}function ws(e){return Ne.default.join(e,`.debug-${new Date().toISOString()}.log`)}function xs(e){return e.length===0||e.some(t=>t.tests.length===0)}var bs=s.extend("cli");async function Bo(e){await U(async t=>{Lt(t);let r=de();bs("Config: %o",r),await Xe()},e)}var F=require("@commander-js/extra-typings");var Fo=new F.Option("--api-key <api-key>","API key from Currents dashboard for authentication").env(R(M,"apiKey")),ko=new F.Option("-o, --output <path>","Path to the file where output will be written").env(R(M,"output")),Go=new F.Option("--ci-build-id <id>","Unique identifier for the run"),Ho=new F.Option("-p, --project-id <project>","Project ID from Currents associated with the run").env(R(M,"projectId")),jo=new F.Option("-t, --tag <tag>","Comma-separated list of tags for the run").argParser(Y),Ko=new F.Option("--debug","Enable debug logging").env(R(M,"debug")).default(!1),$o=new F.Option("-b, --branch <branch>","Branch name for the recorded run"),Vo=new F.Option("--pw-last-run",'Generate output formatted for Playwright ".last-run.json"');var Le="api",As=e=>`
|
|
17
18
|
|
|
18
|
-
${
|
|
19
|
+
${Jo.default.bold("Examples")}
|
|
19
20
|
|
|
20
21
|
Obtain run data by --ci-build-id:
|
|
21
|
-
${
|
|
22
|
+
${l(`${e} ${Le} get-run --api-key <api-key> --ci-build-id <ci-build-id>`)}
|
|
22
23
|
|
|
23
24
|
Obtain most recent run data by filters:
|
|
24
|
-
${
|
|
25
|
+
${l(`${e} ${Le} get-run --api-key <api-key> --project-id <project-id> --branch <branch> --tag tagA,tagB`)}
|
|
25
26
|
|
|
26
27
|
Obtain last run data that matches the Playwright "test-results/.last-run.json":
|
|
27
|
-
${
|
|
28
|
+
${l(`${e} ${Le} get-run --api-key <api-key> --ci-build-id <ci-build-id> --pw-last-run --output <output-path>`)}
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
`,qo=e=>new Tt.Command().command(Le).showHelpAfterError("(add --help for additional information)").allowUnknownOption().addCommand(Ss(e)),Ss=e=>new Tt.Command().name("get-run").description(`Receive information from Currents API ${As(e)}`).allowUnknownOption().addOption(Fo).addOption(Ko).addOption(Go).addOption(Ho).addOption($o).addOption(jo).addOption(ko).addOption(Vo).action(Bo);var Me=require("@commander-js/extra-typings");var Qo=d(require("chalk"));var Us=s.extend("cli");async function Yo(e){await U(async t=>{Er(Rr(t));let r=H();Us("Config: %o",{...r.values,recordKey:r.values?.recordKey?"*****":void 0}),await lt()},e)}var vs=s.extend("cli");async function Wo(e){await U(async t=>{hr(Ir(t));let r=H();vs("Config: %o",{...r.values,recordKey:r.values?.recordKey?"*****":void 0}),await gt()},e)}var Z="cache",Ds=e=>`
|
|
30
31
|
|
|
31
|
-
${
|
|
32
|
+
${Qo.default.bold("Examples")}
|
|
32
33
|
|
|
33
34
|
Save files to the cache under a specific ID:
|
|
34
|
-
${
|
|
35
|
+
${l(`${e} ${Z} set --key <record-key> --id <id> --path <path-1,path-2,...path-n>`)}
|
|
35
36
|
|
|
36
37
|
Retrieve files from the cache saved under a specific ID:
|
|
37
|
-
${
|
|
38
|
+
${l(`${e} ${Z} get --key <record-key> --id <id>`)}
|
|
38
39
|
|
|
39
40
|
Store the last run data in the cache:
|
|
40
|
-
${
|
|
41
|
+
${l(`${e} ${Z} set --key <record-key> --preset last-run`)}
|
|
41
42
|
|
|
42
43
|
Retrieve the last run data from the cache:
|
|
43
|
-
${
|
|
44
|
+
${l(`${e} ${Z} get --key <record-key> --preset last-run`)}
|
|
44
45
|
|
|
45
46
|
Retrieve the last run data from the cache and save it to a custom directory:
|
|
46
|
-
${
|
|
47
|
+
${l(`${e} ${Z} get --key <record-key> --preset last-run --output-dir <outputDir>`)}
|
|
47
48
|
|
|
48
|
-
`,
|
|
49
|
+
`,zo=e=>new Me.Command().command(Z).description(`Cache data to Currents ${Ds(e)}`).showHelpAfterError("(add --help for additional information)").allowUnknownOption().addCommand(Ns()).addCommand(Ls()),Ns=()=>new Me.Command().name("set").allowUnknownOption().addOption(et).addOption(rt).addOption(ot).addOption(Tr).addOption(tt).addOption(yr).addOption(nt).addOption(it).action(Wo),Ls=()=>new Me.Command().name("get").allowUnknownOption().addOption(et).addOption(rt).addOption(ot).addOption(Or).addOption(Pr).addOption(tt).addOption(nt).addOption(it).addOption(xr).action(Yo);var dn=require("@commander-js/extra-typings"),ln=d(require("chalk"));var v=require("@commander-js/extra-typings");var Xo=new v.Option("--ci-build-id <id>","the unique identifier for the recorded build (run)").env(R(I,"ciBuildId")),Zo=new v.Option("-k, --key <record-key>","your secret Record Key obtained from Currents").env(R(I,"recordKey")),en=new v.Option("-p, --project-id <project>","the project ID for results reporting obtained from Currents").env(R(I,"projectId")),tn=new v.Option("-t, --tag <tag>","comma-separated tag(s) for recorded runs in Currents").argParser(Y),rn=new v.Option("--remove-title-tags","remove tags from test names in Currents, e.g. `Test name @smoke` becomes `Test name` in the dashboard").default(!1),on=new v.Option("--disable-title-tags","disable parsing tags from test title, e.g. `Test name @smoke` would not be tagged with `smoke` in the dashboard").default(!1),nn=new v.Option("--machine-id <string>","unique identifier of the machine running the tests. If not provided, it will be generated automatically. See: https://docs.currents.dev/?q=machineId").env(R(I,"machineId")),sn=new v.Option("--report-dir <string>","explicit path to the report directory").env(R(I,"reportDir")),an=new v.Option("--debug","enable debug logs").env(R(I,"debug")).default(!1);var pn=d(require("fs"));var cn=require("tmp-promise"),mn=async()=>{let{path:e}=await(0,cn.file)();return e};var Ot=s.extend("cli"),Be=class{constructor(t){this.configFilePath=null;this.cliOptions=t,Ot("CLI options: %o",this.cliOptions),this.parsedConfig=mo(this.cliOptions),Ot("Parsed config from CLI options: %o",this.parsedConfig)}async getConfigFilePath(){if(this.configFilePath)return this.configFilePath;let t=await mn();return pn.default.writeFileSync(t,JSON.stringify(this.parsedConfig)),Ot("CLI options temp file path: %s",t),this.configFilePath=t,t}};async function un(e){await U(async t=>{let r=new Be(t);co(r.parsedConfig);let o=we();y("Currents config: %o",{...o,recordKey:o?.recordKey?"*****":void 0}),await _t()},e)}var ne="upload",Ms=e=>`
|
|
49
50
|
|
|
50
|
-
${
|
|
51
|
+
${ln.default.bold("Examples")}
|
|
51
52
|
|
|
52
53
|
Upload test results to Currents:
|
|
53
|
-
${
|
|
54
|
+
${l(`${e} ${ne} --key <record-key> --project-id <id> --ci-build-id <build-id>`)}
|
|
54
55
|
|
|
55
56
|
Upload test results to Currents, add tags "tagA", "tagB" to the recorded run:
|
|
56
|
-
${
|
|
57
|
+
${l(`${e} ${ne} --key <record-key> --project-id <id> --ci-build-id <build-id> --tag tagA --tag tagB`)}
|
|
57
58
|
|
|
58
59
|
Provide a custom path to the reports directory:
|
|
59
|
-
${
|
|
60
|
+
${l(`${e} ${ne} --key <record-key> --project-id <id> --ci-build-id <build-id> --report-dir <report-dir>`)}
|
|
60
61
|
|
|
61
|
-
`,
|
|
62
|
-
${
|
|
62
|
+
`,fn=e=>new dn.Command().name(ne).command(ne).showHelpAfterError("(add --help for additional information)").allowUnknownOption().description(`Upload test results generated by Currents reporters to https://currents.dev
|
|
63
|
+
${Ms(e)}`).addOption(Xo).addOption(Zo).addOption(en).addOption(tn).addOption(rn).addOption(on).addOption(nn).addOption(an).addOption(sn).action(r=>un(r));var Bn=require("@commander-js/extra-typings");var Fn=d(require("chalk"));var ie={debug:{name:"Debug",env:"CURRENTS_DEBUG",cli:"--debug"},inputFormat:{name:"Input Format",cli:"--input-format"},inputFiles:{name:"Input File",cli:"--input-file"},outputDir:{name:"Output Dir",cli:"--output-dir"},framework:{name:"Framework",cli:"--framework"},frameworkVersion:{name:"Framework Version",cli:"--framework-version"}};function gn(){return{debug:process.env[ie.debug.env]}}var Bs=s.extend("config"),Fs=["inputFormat","inputFiles","framework"],yt=null;function Cn(e){yt=L(ie,Fs,gn,e),Bs("Resolved config: %o",yt)}function Fe(){return yt}function hn(e){return{inputFiles:e.inputFile,inputFormat:e.inputFormat,outputDir:e.outputDir,framework:e.framework,frameworkVersion:e.frameworkVersion,debug:e.debug}}var Ge=require("path");var vn=require("fs-extra");var k=require("@commander-js/extra-typings"),En=require("glob");var Rn=new k.Option("--debug","Enable debug logging").env(R(ie,"debug")).default(!1),Pt=(t=>(t.junit="junit",t))(Pt||{}),In=new k.Option("--input-format <string>","the format of the input test reports").choices(Object.values(Pt)),_n=new k.Option("--input-file <pattern>","the pattern to search for test reports").argParser(ks),Tn=new k.Option("-o, --output-dir <string>","the directory to save the converted test reports"),On=(t=>(t.postman="postman",t))(On||{}),yn=new k.Option("--framework <string>","the testing framework used to generate the test reports").choices(Object.values(On)),Pn=new k.Option("--framework-version <string>","the version of the testing framework used to generate the test reports");function ks(e){let t=En.glob.globSync(e);if(t.length===0)throw new k.InvalidArgumentError("No files found with the provided pattern");return t}var wn=require("fs-extra"),xn=require("path"),ke=d(require("xml2js"));async function bn(e){let t={testsuites:{testsuite:[]}},r=new ke.Parser({explicitArray:!1,mergeAttrs:!0});for(let n of e){let a=await(0,wn.readFile)(n,"utf-8"),c=await r.parseStringPromise(a);if(c.testsuites?.testsuite){let m=await Gs(c.testsuites.testsuite);t.testsuites={testsuite:[...t.testsuites?.testsuite||[],...m]}}}return new ke.Builder().buildObject(t)}async function An(e,t){return x((0,xn.join)(e,"currents.results.xml"),t)}async function Gs(e){return e.reduce((t,r,o)=>{let n=e[o+1];return r.name==="Root Suite"&&n?(r.file&&(n.file=r.file),t.push(n)):r.name!=="Root Suite"&&t.push(r),t},[])}var Sn=require("xml2js");async function Un(e){let t=new Map,r=await(0,Sn.parseStringPromise)(e,{explicitArray:!1,mergeAttrs:!0});if(!r)return f("Failed to parse XML input"),new Map;let o=Se(r.testsuites.testsuite),n=r.testsuites.name;return o.forEach(a=>{let c=Hs(a,n),m=ge(a?.name??"");t.set(m,c)}),t}function Hs(e,t){let r=new Date(e?.timestamp??""),o=Ue(e?.time),n=new Date(r.getTime()+o),a=Se(e.testcase),c=0;return{groupId:t,spec:z(e),worker:{workerIndex:1,parallelIndex:1},startTime:r.toISOString(),results:{stats:{suites:1,tests:parseInt(e.tests??"0"),passes:a?.filter(u=>!u?.failure).length,pending:0,skipped:0,failures:a?.filter(u=>u?.failure).length,flaky:0,wallClockStartedAt:r.toISOString(),wallClockEndedAt:n.toISOString(),wallClockDuration:o},tests:a?.map(u=>(c+=Ue(a[0]?.time),xo(u,e,c)))}}}async function Dn({inputFormat:e,inputFiles:t,outputDir:r,framework:o}){if(e==="junit"){let n="";t.length>1?n=await bn(t):t.length===1&&(n=await(0,vn.readFile)(t[0],"utf-8"));let a=n.trim();if(a)return await An(r,a),js(o,a)}return new Map}async function js(e,t){switch(e){case"postman":return Un(t);default:return C("Unsupported framework: %s",e),new Map}}function Nn(e){return{framework:e.inputFormat,frameworkVersion:e.frameworkVersion??null,cliArgs:{},frameworkConfig:{originFramework:e.framework,originFrameworkVersion:e.frameworkVersion}}}async function Ln(){try{let e=Fe();if(!e)throw new Error("Config is missing!");let t=e.outputDir?await fe(e.outputDir):await Ft(process.cwd(),".currents"),r=await fe((0,Ge.join)(t,"instances")),o=Nn(e);s("Report config:",o),y("[currents] Convertion files: %s",e.inputFiles.join(", ")),await x((0,Ge.join)(t,"config.json"),JSON.stringify(o));let n=await Dn({inputFormat:e.inputFormat,inputFiles:e.inputFiles,framework:e.framework,outputDir:t});await Promise.all(Array.from(n.entries()).map(([a,c])=>x((0,Ge.join)(r,`${ge(a)}.json`),JSON.stringify(c)))),y("[currents] Conversion completed, report saved to: %s",t)}catch(e){throw s("Failed to convert: %o",e),e}}var Ks=s.extend("cli");async function Mn(e){await U(async t=>{Cn(hn(t));let r=Fe();Ks("Config: %o",r),await Ln()},e)}var wt="convert",$s=e=>`
|
|
63
64
|
|
|
64
|
-
${
|
|
65
|
+
${Fn.default.bold("Examples")}
|
|
65
66
|
|
|
66
67
|
Convert JUnit test reports to Currents format:
|
|
67
|
-
${
|
|
68
|
-
`,
|
|
69
|
-
${
|
|
68
|
+
${l(`${e} ${wt} --input-format junit --input-file ./*.xml --framework postman`)}
|
|
69
|
+
`,kn=e=>new Bn.Command().name(wt).command(wt).showHelpAfterError("(add --help for additional information)").allowUnknownOption().description(`Convert test reports to Currents format
|
|
70
|
+
${$s(e)}`).addOption(Rn).addOption(In).addOption(_n).addOption(Tn).addOption(yn).addOption(Pn).action(r=>Mn(r));var Vs=`
|
|
70
71
|
----------------------------------------------------
|
|
71
72
|
\u{1F4D6} Documentation: https://docs.currents.dev
|
|
72
73
|
\u{1F919} Support: support@currents.dev
|
|
73
74
|
----------------------------------------------------
|
|
74
|
-
`,
|
|
75
|
+
`,se="currents",Hn=()=>new Gn.Command(se).version(ae).description(`Currents CLI ${Vs}`).addCommand(fn(se),{isDefault:!0}).addCommand(zo(se)).addCommand(qo(se)).addCommand(kn(se));import("dotenv/config");function Js(){Hn().parse()}Js();
|
|
75
76
|
/*! For license information please see index.js.LEGAL.txt */
|
|
76
77
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";var Lt=Object.create;var y=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var Bt=Object.getOwnPropertyNames;var bt=Object.getPrototypeOf,xt=Object.prototype.hasOwnProperty;var ue=(e,t)=>{for(var r in t)y(e,r,{get:t[r],enumerable:!0})},me=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Bt(t))!xt.call(e,o)&&o!==r&&y(e,o,{get:()=>t[o],enumerable:!(n=yt(t,o))||n.enumerable});return e};var c=(e,t,r)=>(r=e!=null?Lt(bt(e)):{},me(t||!e||!e.__esModule?y(r,"default",{value:e,enumerable:!0}):r,e)),vt=e=>me(y({},"__esModule",{value:!0}),e);var Mr={};ue(Mr,{handleCurrentsReport:()=>Dt});module.exports=vt(Mr);var pe=require("debug"),Mt=c(require("fs-extra")),i=(0,pe.debug)("currents"),wt=null;function le(e){wt=e}var B={};ue(B,{getNanoid:()=>Ft,userFacingNanoid:()=>q});var Y=require("nanoid"),ge="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ft=(e=16)=>(0,Y.customAlphabet)(ge,e)(),q=(0,Y.customAlphabet)(ge,12);var p=require("lodash");var b=i.extend("ci"),Ht=(e,...t)=>(0,p.chain)(t).compact().join(e).value(),kt=(e,t)=>(0,p.set)(e,(0,p.camelCase)(t),process.env[t]),u=e=>(0,p.transform)(e,kt,{}),Gt=()=>process.env.TF_BUILD&&process.env.TF_BUILD_BUILDNUMBER,jt=()=>process.env.TF_BUILD&&process.env.AZURE_HTTP_USER_AGENT,Vt=()=>(0,p.some)(process.env,(e,t)=>/^CODEBUILD_/.test(t)),Kt=()=>process.env.bamboo_buildNumber,Jt=()=>process.env.CI_NAME&&process.env.CI_NAME==="codeship"&&process.env.CODESHIP,$t=()=>process.env.CI_NAME&&process.env.CI_NAME==="codeship"&&!process.env.CODESHIP,Yt=()=>(0,p.some)(process.env,(e,t)=>/^CONCOURSE_/.test(t)),qt=()=>process.env.GITLAB_CI||process.env.CI_SERVER_NAME&&/^GitLab/.test(process.env.CI_SERVER_NAME),Qt=()=>process.env.GCP_PROJECT||process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT,Wt=()=>process.env.JENKINS_URL||process.env.JENKINS_HOME||process.env.JENKINS_VERSION||process.env.HUDSON_URL||process.env.HUDSON_HOME,zt=()=>process.env.WERCKER||process.env.WERCKER_MAIN_PIPELINE_STARTED,Xt={appveyor:"APPVEYOR",azure:jt,awsCodeBuild:Vt,bamboo:Kt,bitbucket:"BITBUCKET_BUILD_NUMBER",buildkite:"BUILDKITE",circle:"CIRCLECI",codeshipBasic:Jt,codeshipPro:$t,concourse:Yt,codeFresh:"CF_BUILD_ID",drone:"DRONE",githubActions:"GITHUB_ACTIONS",gitlab:qt,goCD:"GO_JOB_NAME",googleCloud:Qt,jenkins:Wt,semaphore:"SEMAPHORE",shippable:"SHIPPABLE",teamcity:"TEAMCITY_VERSION",teamfoundation:Gt,travis:"TRAVIS",wercker:zt,netlify:"NETLIFY",layerci:"LAYERCI"};function Zt(){let{env:e}=process;return(0,p.findKey)(Xt,t=>{if((0,p.isString)(t))return e[t];if((0,p.isFunction)(t))return t()})}var de=()=>({appveyor:u(["APPVEYOR_JOB_ID","APPVEYOR_ACCOUNT_NAME","APPVEYOR_PROJECT_SLUG","APPVEYOR_BUILD_NUMBER","APPVEYOR_BUILD_VERSION","APPVEYOR_PULL_REQUEST_NUMBER","APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH"]),azure:u(["BUILD_BUILDID","BUILD_BUILDNUMBER","BUILD_CONTAINERID","BUILD_REPOSITORY_URI","SYSTEM_TEAMPROJECT","SYSTEM_COLLECTIONURI"]),awsCodeBuild:u(["CODEBUILD_BUILD_ID","CODEBUILD_BUILD_NUMBER","CODEBUILD_RESOLVED_SOURCE_VERSION","CODEBUILD_SOURCE_REPO_URL","CODEBUILD_SOURCE_VERSION"]),bamboo:u(["bamboo_buildNumber","bamboo_buildResultsUrl","bamboo_planRepository_repositoryUrl","bamboo_buildKey"]),bitbucket:u(["BITBUCKET_REPO_SLUG","BITBUCKET_REPO_OWNER","BITBUCKET_BUILD_NUMBER","BITBUCKET_PARALLEL_STEP","BITBUCKET_STEP_RUN_NUMBER","BITBUCKET_PR_ID","BITBUCKET_PR_DESTINATION_BRANCH","BITBUCKET_PR_DESTINATION_COMMIT"]),buildkite:u(["BUILDKITE_REPO","BUILDKITE_SOURCE","BUILDKITE_JOB_ID","BUILDKITE_BUILD_ID","BUILDKITE_BUILD_URL","BUILDKITE_BUILD_NUMBER","BUILDKITE_PULL_REQUEST","BUILDKITE_PULL_REQUEST_REPO","BUILDKITE_PULL_REQUEST_BASE_BRANCH"]),circle:u(["CIRCLE_JOB","CIRCLE_BUILD_NUM","CIRCLE_BUILD_URL","CIRCLE_PR_NUMBER","CIRCLE_PR_REPONAME","CIRCLE_PR_USERNAME","CIRCLE_COMPARE_URL","CIRCLE_WORKFLOW_ID","CIRCLE_WORKFLOW_WORKSPACE_ID","CIRCLE_PULL_REQUEST","CIRCLE_REPOSITORY_URL","CI_PULL_REQUEST","CIRCLE_NODE_INDEX","CIRCLE_NODE_TOTAL"]),codeshipBasic:u(["CI_BUILD_ID","CI_REPO_NAME","CI_BUILD_URL","CI_PROJECT_ID","CI_BUILD_NUMBER","CI_PULL_REQUEST"]),codeshipPro:u(["CI_BUILD_ID","CI_REPO_NAME","CI_PROJECT_ID"]),concourse:u(["BUILD_ID","BUILD_NAME","BUILD_JOB_NAME","BUILD_PIPELINE_NAME","BUILD_TEAM_NAME","ATC_EXTERNAL_URL"]),codeFresh:u(["CF_BUILD_ID","CF_BUILD_URL","CF_CURRENT_ATTEMPT","CF_STEP_NAME","CF_PIPELINE_NAME","CF_PIPELINE_TRIGGER_ID","CF_PULL_REQUEST_ID","CF_PULL_REQUEST_IS_FORK","CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_TARGET"]),drone:u(["DRONE_JOB_NUMBER","DRONE_BUILD_LINK","DRONE_BUILD_NUMBER","DRONE_PULL_REQUEST"]),githubActions:u(["GITHUB_WORKFLOW","GITHUB_ACTION","GITHUB_EVENT_NAME","GITHUB_RUN_ID","GITHUB_RUN_ATTEMPT","GITHUB_REPOSITORY"]),gitlab:u(["CI_PIPELINE_ID","CI_PIPELINE_URL","CI_BUILD_ID","CI_JOB_ID","CI_JOB_URL","CI_JOB_NAME","CI_NODE_INDEX","CI_NODE_TOTAL","GITLAB_HOST","CI_PROJECT_ID","CI_PROJECT_URL","CI_REPOSITORY_URL","CI_ENVIRONMENT_URL","CI_DEFAULT_BRANCH","RUN_ATTEMPT"]),goCD:u(["GO_SERVER_URL","GO_ENVIRONMENT_NAME","GO_PIPELINE_NAME","GO_PIPELINE_COUNTER","GO_PIPELINE_LABEL","GO_STAGE_NAME","GO_STAGE_COUNTER","GO_JOB_NAME","GO_TRIGGER_USER","GO_REVISION","GO_TO_REVISION","GO_FROM_REVISION","GO_MATERIAL_HAS_CHANGED"]),googleCloud:u(["BUILD_ID","PROJECT_ID","REPO_NAME","BRANCH_NAME","TAG_NAME","COMMIT_SHA","SHORT_SHA"]),jenkins:u(["BUILD_ID","BUILD_URL","BUILD_NUMBER","ghprbPullId"]),semaphore:u(["SEMAPHORE_BRANCH_ID","SEMAPHORE_BUILD_NUMBER","SEMAPHORE_CURRENT_JOB","SEMAPHORE_CURRENT_THREAD","SEMAPHORE_EXECUTABLE_UUID","SEMAPHORE_GIT_BRANCH","SEMAPHORE_GIT_DIR","SEMAPHORE_GIT_REF","SEMAPHORE_GIT_REF_TYPE","SEMAPHORE_GIT_REPO_SLUG","SEMAPHORE_GIT_SHA","SEMAPHORE_GIT_URL","SEMAPHORE_JOB_COUNT","SEMAPHORE_JOB_ID","SEMAPHORE_JOB_NAME","SEMAPHORE_JOB_UUID","SEMAPHORE_PIPELINE_ID","SEMAPHORE_PLATFORM","SEMAPHORE_PROJECT_DIR","SEMAPHORE_PROJECT_HASH_ID","SEMAPHORE_PROJECT_ID","SEMAPHORE_PROJECT_NAME","SEMAPHORE_PROJECT_UUID","SEMAPHORE_REPO_SLUG","SEMAPHORE_TRIGGER_SOURCE","SEMAPHORE_WORKFLOW_ID","PULL_REQUEST_NUMBER"]),shippable:u(["SHIPPABLE_BUILD_ID","SHIPPABLE_BUILD_NUMBER","SHIPPABLE_COMMIT_RANGE","SHIPPABLE_CONTAINER_NAME","SHIPPABLE_JOB_ID","SHIPPABLE_JOB_NUMBER","SHIPPABLE_REPO_SLUG","IS_FORK","IS_GIT_TAG","IS_PRERELEASE","IS_RELEASE","REPOSITORY_URL","REPO_FULL_NAME","REPO_NAME","BUILD_URL","BASE_BRANCH","HEAD_BRANCH","IS_PULL_REQUEST","PULL_REQUEST","PULL_REQUEST_BASE_BRANCH","PULL_REQUEST_REPO_FULL_NAME"]),teamcity:null,teamfoundation:u(["BUILD_BUILDID","BUILD_BUILDNUMBER","BUILD_CONTAINERID"]),travis:u(["TRAVIS_JOB_ID","TRAVIS_BUILD_ID","TRAVIS_BUILD_WEB_URL","TRAVIS_REPO_SLUG","TRAVIS_JOB_NUMBER","TRAVIS_EVENT_TYPE","TRAVIS_COMMIT_RANGE","TRAVIS_BUILD_NUMBER","TRAVIS_PULL_REQUEST","TRAVIS_PULL_REQUEST_BRANCH","TRAVIS_PULL_REQUEST_SHA"]),wercker:null,netlify:u(["BUILD_ID","CONTEXT","URL","DEPLOY_URL","DEPLOY_PRIME_URL","DEPLOY_ID"]),layerci:u(["LAYERCI_JOB_ID","LAYERCI_RUNNER_ID","RETRY_INDEX","LAYERCI_PULL_REQUEST","LAYERCI_REPO_NAME","LAYERCI_REPO_OWNER","LAYERCI_BRANCH","GIT_TAG"])}),er=()=>{let{env:e}=process;return{appveyor:{sha:e.APPVEYOR_REPO_COMMIT,branch:e.APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH||e.APPVEYOR_REPO_BRANCH,message:Ht(`
|
|
2
|
-
`,e.APPVEYOR_REPO_COMMIT_MESSAGE,e.APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED),authorName:e.APPVEYOR_REPO_COMMIT_AUTHOR,authorEmail:e.APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL},awsCodeBuild:{sha:e.CODEBUILD_RESOLVED_SOURCE_VERSION,remoteOrigin:e.CODEBUILD_SOURCE_REPO_URL},azure:{sha:e.BUILD_SOURCEVERSION,branch:e.BUILD_SOURCEBRANCHNAME,message:e.BUILD_SOURCEVERSIONMESSAGE,authorName:e.BUILD_SOURCEVERSIONAUTHOR,authorEmail:e.BUILD_REQUESTEDFOREMAIL},bamboo:{sha:e.bamboo_planRepository_revision,branch:e.bamboo_planRepository_branch,authorName:e.bamboo_planRepository_username,remoteOrigin:e.bamboo_planRepository_repositoryURL},bitbucket:{sha:e.BITBUCKET_COMMIT,branch:e.BITBUCKET_BRANCH},buildkite:{sha:e.BUILDKITE_COMMIT,branch:e.BUILDKITE_BRANCH,message:e.BUILDKITE_MESSAGE,authorName:e.BUILDKITE_BUILD_CREATOR,authorEmail:e.BUILDKITE_BUILD_CREATOR_EMAIL,remoteOrigin:e.BUILDKITE_REPO,defaultBranch:e.BUILDKITE_PIPELINE_DEFAULT_BRANCH},circle:{sha:e.CIRCLE_SHA1,branch:e.CIRCLE_BRANCH,authorName:e.CIRCLE_USERNAME,remoteOrigin:e.CIRCLE_REPOSITORY_URL},codeshipBasic:{sha:e.CI_COMMIT_ID,branch:e.CI_BRANCH,message:e.CI_COMMIT_MESSAGE,authorName:e.CI_COMMITTER_NAME,authorEmail:e.CI_COMMITTER_EMAIL},codeshipPro:{sha:e.CI_COMMIT_ID,branch:e.CI_BRANCH,message:e.CI_COMMIT_MESSAGE,authorName:e.CI_COMMITTER_NAME,authorEmail:e.CI_COMMITTER_EMAIL},codeFresh:{sha:e.CF_REVISION,branch:e.CF_BRANCH,message:e.CF_COMMIT_MESSAGE,authorName:e.CF_COMMIT_AUTHOR},drone:{sha:e.DRONE_COMMIT_SHA,branch:e.DRONE_SOURCE_BRANCH,message:e.DRONE_COMMIT_MESSAGE,authorName:e.DRONE_COMMIT_AUTHOR,authorEmail:e.DRONE_COMMIT_AUTHOR_EMAIL,remoteOrigin:e.DRONE_GIT_HTTP_URL,defaultBranch:e.DRONE_REPO_BRANCH},githubActions:{sha:e.GITHUB_SHA,branch:e.GH_BRANCH||e.GITHUB_REF,defaultBranch:e.GITHUB_BASE_REF,remoteBranch:e.GITHUB_HEAD_REF,runAttempt:e.GITHUB_RUN_ATTEMPT},gitlab:{sha:e.CI_COMMIT_SHA,branch:e.CI_COMMIT_REF_NAME,message:e.CI_COMMIT_MESSAGE,authorName:e.GITLAB_USER_NAME,authorEmail:e.GITLAB_USER_EMAIL,remoteOrigin:e.CI_REPOSITORY_URL,defaultBranch:e.CI_DEFAULT_BRANCH},googleCloud:{sha:e.COMMIT_SHA,branch:e.BRANCH_NAME},jenkins:{sha:e.GIT_COMMIT,branch:e.GIT_BRANCH},semaphore:{sha:e.SEMAPHORE_GIT_SHA,branch:e.SEMAPHORE_GIT_BRANCH,remoteOrigin:e.SEMAPHORE_GIT_REPO_SLUG},shippable:{sha:e.COMMIT,branch:e.BRANCH,message:e.COMMIT_MESSAGE,authorName:e.COMMITTER},snap:null,teamcity:null,teamfoundation:{sha:e.BUILD_SOURCEVERSION,branch:e.BUILD_SOURCEBRANCHNAME,message:e.BUILD_SOURCEVERSIONMESSAGE,authorName:e.BUILD_SOURCEVERSIONAUTHOR},travis:{sha:e.TRAVIS_PULL_REQUEST_SHA||e.TRAVIS_COMMIT,branch:e.TRAVIS_PULL_REQUEST_BRANCH||e.TRAVIS_BRANCH,message:e.TRAVIS_COMMIT_MESSAGE},wercker:null,netlify:{sha:e.COMMIT_REF,branch:e.BRANCH,remoteOrigin:e.REPOSITORY_URL},layerci:{sha:e.GIT_COMMIT,branch:e.LAYERCI_BRANCH,message:e.GIT_COMMIT_TITLE}}},Ee=e=>{let t=fe();return t?(0,p.chain)(e()).get(t).value():{}};function tr(){return(0,p.chain)(de()).omitBy(p.isNull).keys().value()}function rr(e){return e&&tr().includes(e)}function fe(){let e=Zt();return b("detected CI provider name: %s",e),e||null}function or(){return Ee(de)}function _e(){return Ee(er)}function Re(e){let t=or(),r=fe(),n=nr(e,r);return b("detected CI provider: %s",r),b("detected CI params: %O",t),b("detected CI build ID: %o",n),{params:t,provider:r,ciBuildId:n}}function nr(e,t){return e?{source:"user",value:e}:rr(t)?{source:"server",value:null}:{source:"random",value:`auto:${q()}`}}var Te=require("@currents/commit-info"),Ce=require("lodash");var x=require("lodash");var Q=i.extend("ci-git");function Ie(e){Q("git commit existing info: %O",e);let t=_e();Q("commit info from provider environment variables: %O",t);let r=(0,x.transform)(e,(n,o,a)=>{let m=o||(t?t[a]:null);return n[a]=(0,x.defaultTo)(m,null)});return Q("combined git and environment variables from provider: %O",r),r}var sr=async()=>{let e=await(0,Te.commitInfo)();return Ie({branch:e.branch,remoteOrigin:e.remote,authorEmail:e.email,authorName:e.author,message:e.message,sha:e.sha,ghaEventData:e.ghaEventData})},he=(0,Ce.memoize)(sr);var Oe=c(require("getos")),Se=require("lodash"),R=require("os"),Pe=require("util"),ir=async()=>{if((0,R.platform)()==="linux")try{let e=await(0,Pe.promisify)(Oe.default)();return"dist"in e&&"release"in e?[e.dist,e.release].join(" - "):(0,R.release)()}catch{return(0,R.release)()}return(0,R.release)()},ar=async()=>{let e=await ir();return{osName:(0,R.platform)(),osVersion:e,osCpus:[],osMemory:{free:(0,R.freemem)(),total:(0,R.totalmem)()}}},Ue=(0,Se.memoize)(ar);var Ae={name:"@currents/cmd",version:"1.
|
|
2
|
+
`,e.APPVEYOR_REPO_COMMIT_MESSAGE,e.APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED),authorName:e.APPVEYOR_REPO_COMMIT_AUTHOR,authorEmail:e.APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL},awsCodeBuild:{sha:e.CODEBUILD_RESOLVED_SOURCE_VERSION,remoteOrigin:e.CODEBUILD_SOURCE_REPO_URL},azure:{sha:e.BUILD_SOURCEVERSION,branch:e.BUILD_SOURCEBRANCHNAME,message:e.BUILD_SOURCEVERSIONMESSAGE,authorName:e.BUILD_SOURCEVERSIONAUTHOR,authorEmail:e.BUILD_REQUESTEDFOREMAIL},bamboo:{sha:e.bamboo_planRepository_revision,branch:e.bamboo_planRepository_branch,authorName:e.bamboo_planRepository_username,remoteOrigin:e.bamboo_planRepository_repositoryURL},bitbucket:{sha:e.BITBUCKET_COMMIT,branch:e.BITBUCKET_BRANCH},buildkite:{sha:e.BUILDKITE_COMMIT,branch:e.BUILDKITE_BRANCH,message:e.BUILDKITE_MESSAGE,authorName:e.BUILDKITE_BUILD_CREATOR,authorEmail:e.BUILDKITE_BUILD_CREATOR_EMAIL,remoteOrigin:e.BUILDKITE_REPO,defaultBranch:e.BUILDKITE_PIPELINE_DEFAULT_BRANCH},circle:{sha:e.CIRCLE_SHA1,branch:e.CIRCLE_BRANCH,authorName:e.CIRCLE_USERNAME,remoteOrigin:e.CIRCLE_REPOSITORY_URL},codeshipBasic:{sha:e.CI_COMMIT_ID,branch:e.CI_BRANCH,message:e.CI_COMMIT_MESSAGE,authorName:e.CI_COMMITTER_NAME,authorEmail:e.CI_COMMITTER_EMAIL},codeshipPro:{sha:e.CI_COMMIT_ID,branch:e.CI_BRANCH,message:e.CI_COMMIT_MESSAGE,authorName:e.CI_COMMITTER_NAME,authorEmail:e.CI_COMMITTER_EMAIL},codeFresh:{sha:e.CF_REVISION,branch:e.CF_BRANCH,message:e.CF_COMMIT_MESSAGE,authorName:e.CF_COMMIT_AUTHOR},drone:{sha:e.DRONE_COMMIT_SHA,branch:e.DRONE_SOURCE_BRANCH,message:e.DRONE_COMMIT_MESSAGE,authorName:e.DRONE_COMMIT_AUTHOR,authorEmail:e.DRONE_COMMIT_AUTHOR_EMAIL,remoteOrigin:e.DRONE_GIT_HTTP_URL,defaultBranch:e.DRONE_REPO_BRANCH},githubActions:{sha:e.GITHUB_SHA,branch:e.GH_BRANCH||e.GITHUB_REF,defaultBranch:e.GITHUB_BASE_REF,remoteBranch:e.GITHUB_HEAD_REF,runAttempt:e.GITHUB_RUN_ATTEMPT},gitlab:{sha:e.CI_COMMIT_SHA,branch:e.CI_COMMIT_REF_NAME,message:e.CI_COMMIT_MESSAGE,authorName:e.GITLAB_USER_NAME,authorEmail:e.GITLAB_USER_EMAIL,remoteOrigin:e.CI_REPOSITORY_URL,defaultBranch:e.CI_DEFAULT_BRANCH},googleCloud:{sha:e.COMMIT_SHA,branch:e.BRANCH_NAME},jenkins:{sha:e.GIT_COMMIT,branch:e.GIT_BRANCH},semaphore:{sha:e.SEMAPHORE_GIT_SHA,branch:e.SEMAPHORE_GIT_BRANCH,remoteOrigin:e.SEMAPHORE_GIT_REPO_SLUG},shippable:{sha:e.COMMIT,branch:e.BRANCH,message:e.COMMIT_MESSAGE,authorName:e.COMMITTER},snap:null,teamcity:null,teamfoundation:{sha:e.BUILD_SOURCEVERSION,branch:e.BUILD_SOURCEBRANCHNAME,message:e.BUILD_SOURCEVERSIONMESSAGE,authorName:e.BUILD_SOURCEVERSIONAUTHOR},travis:{sha:e.TRAVIS_PULL_REQUEST_SHA||e.TRAVIS_COMMIT,branch:e.TRAVIS_PULL_REQUEST_BRANCH||e.TRAVIS_BRANCH,message:e.TRAVIS_COMMIT_MESSAGE},wercker:null,netlify:{sha:e.COMMIT_REF,branch:e.BRANCH,remoteOrigin:e.REPOSITORY_URL},layerci:{sha:e.GIT_COMMIT,branch:e.LAYERCI_BRANCH,message:e.GIT_COMMIT_TITLE}}},Ee=e=>{let t=fe();return t?(0,p.chain)(e()).get(t).value():{}};function tr(){return(0,p.chain)(de()).omitBy(p.isNull).keys().value()}function rr(e){return e&&tr().includes(e)}function fe(){let e=Zt();return b("detected CI provider name: %s",e),e||null}function or(){return Ee(de)}function _e(){return Ee(er)}function Re(e){let t=or(),r=fe(),n=nr(e,r);return b("detected CI provider: %s",r),b("detected CI params: %O",t),b("detected CI build ID: %o",n),{params:t,provider:r,ciBuildId:n}}function nr(e,t){return e?{source:"user",value:e}:rr(t)?{source:"server",value:null}:{source:"random",value:`auto:${q()}`}}var Te=require("@currents/commit-info"),Ce=require("lodash");var x=require("lodash");var Q=i.extend("ci-git");function Ie(e){Q("git commit existing info: %O",e);let t=_e();Q("commit info from provider environment variables: %O",t);let r=(0,x.transform)(e,(n,o,a)=>{let m=o||(t?t[a]:null);return n[a]=(0,x.defaultTo)(m,null)});return Q("combined git and environment variables from provider: %O",r),r}var sr=async()=>{let e=await(0,Te.commitInfo)();return Ie({branch:e.branch,remoteOrigin:e.remote,authorEmail:e.email,authorName:e.author,message:e.message,sha:e.sha,ghaEventData:e.ghaEventData})},he=(0,Ce.memoize)(sr);var Oe=c(require("getos")),Se=require("lodash"),R=require("os"),Pe=require("util"),ir=async()=>{if((0,R.platform)()==="linux")try{let e=await(0,Pe.promisify)(Oe.default)();return"dist"in e&&"release"in e?[e.dist,e.release].join(" - "):(0,R.release)()}catch{return(0,R.release)()}return(0,R.release)()},ar=async()=>{let e=await ir();return{osName:(0,R.platform)(),osVersion:e,osCpus:[],osMemory:{free:(0,R.freemem)(),total:(0,R.totalmem)()}}},Ue=(0,Se.memoize)(ar);var Ae={name:"@currents/cmd",version:"1.3.0",main:"./dist/index.js",author:"Currents Software Inc",license:"MIT",description:"Currents CLI tools",scripts:{test:"vitest",rm:"rimraf dist",lint:'TIMING=1 eslint "**/*.ts*"',types:"tsc --noEmit",build:"tsup-node --minify --dts",dev:"tsup-node --watch --dts",release:"release-it","publish:npm":"npm run rm && npm run build && ./publish.js"},devDependencies:{"@jest/reporters":"^29.7.0","@jest/types":"^29.6.3","@release-it/conventional-changelog":"^7.0.2","@types/archiver":"^6.0.3","@types/async-retry":"^1.4.9","@types/debug":"^4.1.12","@types/fs-extra":"^11.0.4","@types/getos":"^3.0.4","@types/lodash":"^4.17.13","@types/node":"^20.14.2","@types/proxy-from-env":"^1.0.4","@types/semver":"^7.5.8","@types/tmp":"^0.2.6","@types/unzipper":"^0.10.10","@types/uuid":"^9.0.8","@types/xml2js":"^0.4.14",jest:"^29.7.0",rimraf:"^5.0.7",tsup:"^8.1.0",typescript:"^5.7.2",vitest:"^2.1.4"},dependencies:{"@commander-js/extra-typings":"^11.1.0","@currents/commit-info":"1.0.1-beta.0",archiver:"^7.0.1","async-retry":"^1.3.3",axios:"^1.7.2","axios-retry":"^4.4.0",commander:"^11.1.0",debug:"^4.3.5",dotenv:"^16.4.5",execa:"^9.5.1","fs-extra":"^11.2.0",getos:"^3.2.1",glob:"^11.0.0","https-proxy-agent":"^7.0.4","jest-cli":"^29.7.0","jest-config":"^29.7.0",lodash:"^4.17.21",nanoid:"^3.3.4","pretty-ms":"^7.0.1","proxy-from-env":"^1.1.0",semver:"^7.6.0","source-map-support":"^0.5.21",tmp:"^0.2.3","tmp-promise":"^3.0.3","ts-pattern":"^5.5.0",unzipper:"^0.12.3",uuid:"^11.0.3",xml2js:"^0.6.2"},bin:{currents:"./dist/bin/index.js","currents-cli":"./dist/bin/index.js"},files:["dist","!**/*.map","!**/*/*.map"],keywords:["cloud test dashboard","test reporter","test results","currents","currents dashboard","ci"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js",types:"./dist/index.d.ts"},"./discovery/jest":{import:"./dist/services/upload/discovery/jest/reporter.js",require:"./dist/services/upload/discovery/jest/reporter.js",types:"./dist/services/upload/discovery/jest/reporter.d.ts"},"./package.json":"./package.json"},"release-it":{npm:{publish:!1},github:{release:!0,releaseName:"${npm.name} v${version}"},plugins:{"@release-it/conventional-changelog":{preset:"angular",header:"# Changelog",ignoreVersion:!0,infile:"./CHANGELOG.md"}},git:{commitMessage:"chore: release ${npm.name} v${version}",tagName:"${npm.name}-v${version}"}}};var De=Ae.version;var ur=[];function W(e){ur.push(e)}var _=c(require("chalk")),A=c(require("util"));var Ne=[],Le=[];var ye=(...e)=>{let t=A.default.format(...e);W(t),console.log(t)},mr=(...e)=>{let t=A.default.format(...e);W(t),console.error(t)},z=ye,g=(...e)=>{let t=A.default.format(...e);return Le.push(t),i("WARNING: ",t),ye(_.default.bgYellow.black(" WARNING "),t)};var d=(...e)=>{let t=A.default.format(...pr(e));return Ne.push(t),i("ERROR: ",A.default.format(...e)),mr(_.default.bgRed.white(" ERROR "),t)};var pr=e=>e.map(t=>t instanceof Error?t.message:t),v=(e=2)=>console.log(Array(e).fill("").join(`
|
|
3
3
|
`)),_o=_.default.cyan,Ro=_.default.blueBright,Io=_.default.red,To=_.default.yellow,Co=_.default.green,ho=_.default.gray,Oo=_.default.white,So=_.default.black,Po=_.default.magenta,D=_.default.dim,Uo=_.default.bold;var X=c(require("fs-extra")),Be=require("path"),gr=require("uuid");async function P(e){try{return await X.default.readJson(e)}catch(t){throw d("Error while reading JSON file: %s",e,t),d}}async function Z(e,t){try{return await X.default.writeFile(e,t,"utf8"),e}catch(r){throw d(`Error writing file at ${e}:`,r),r}}var dr=c(require("crypto"));var Ut=require("lodash"),K=c(require("path")),At=c(require("semver"));var We=c(require("lodash"));var ke=c(require("axios")),Ge=c(require("axios-retry")),je=c(require("lodash"));var ee=()=>process.env.CURRENTS_API_URL??"https://cy.currents.dev",be=()=>process.env.CURRENTS_REST_API_URL??"https://api.currents.dev",xe=()=>3e4;var te=require("axios"),re=c(require("pretty-ms"));var ve=i.extend("http"),M=e=>[3*1e3,15*1e3,30*1e3][e-1],Me=e=>(ve("isRetriableError: %o",{message:e.message,code:"code"in e?e.code:void 0,status:"response"in e?e.response?.status:void 0,headers:"response"in e?e.response?.headers:void 0,data:"response"in e?e.response?.data:void 0,isAxiosError:(0,te.isAxiosError)(e)}),"code"in e&&e.code&&["ECONNABORTED","ECONNREFUSED","ECONNRESET","ETIMEDOUT","ENETRESET"].includes(e.code)?!0:(0,te.isAxiosError)(e)?[429,502,503,504].includes(e.response?.status??0):!1),w=()=>3;function we(e,t,r){ve("Network request '%s' failed: '%s'. Next attempt is in %s (%d/%d).",`${r.method?.toUpperCase()} ${r.url}`,t.message,(0,re.default)(M(e)),e,w()),g("Network request '%s' failed: '%s'. Next attempt is in %s (%d/%d).",`${r.method?.toUpperCase()} ${r.url}`,t.message,(0,re.default)(M(e)),e,w())}var Fe=i.extend("http");var oe={api:null,restApi:null};function Er(e){let t=ke.default.create({baseURL:e==="api"?ee():be(),timeout:xe(),transitional:{clarifyTimeoutError:!0}});return t.interceptors.request.use(r=>{let n=r["axios-retry"]?.retryCount??0;r.headers.get("Content-Type")||r.headers.set("Content-Type","application/json");let o={...je.default.pick(r,"method","url","headers"),data:Buffer.isBuffer(r.data)?"buffer":r.data};return n?Fe("network request retry: %o",He({...o,isRetry:!0})):Fe("network request: %o",He(o)),r}),(0,Ge.default)(t,{retries:w(),retryCondition:Me,retryDelay:M,shouldResetTimeout:!0,onRetry:we}),t}function Ve(e){return oe[e]===null&&(oe[e]=Er(e)),oe[e]}function He(e){return{method:e.method,baseUrl:ee(),url:e.url,data:e.isRetry?"<retry>":fr(e.data),headers:{...e.headers,"x-currents-key":"***"}}}function fr(e){return e?.results?.raw?{...e,results:{...e.results,raw:"***"}}:e}var $e=require("axios"),Ye=c(require("lodash")),E=require("ts-pattern");function qe(e){(0,E.match)(e).when($e.isAxiosError,_r).otherwise(()=>{g("Unexpected error while sending network request: %s",e)})}function _r(e){return(0,E.match)(e).with({code:"ECONNABORTED"},()=>{g("Network connection aborted")}).with({code:"ECONNREFUSED"},()=>{g("Network connection aborted")}).with({code:"ECONNRESET"},()=>{g("Network connection reset")}).with({code:"ETIMEDOUT"},()=>{g("Network connection timeout")}).with({response:E.P.not(E.P.nullish)},t=>{Rr(t,{status:t.response.status,data:t.response.data})}).otherwise(t=>{g(`[currents] Unexpected network error: %s
|
|
4
4
|
%O`,e.message,{method:e.response?.config.method,url:e.response?.config.url,status:e.response?.status,payload:e.response?.config.data})})}function Rr(e,{status:t,data:r}){(0,E.match)(t).with(401,()=>{g(`[currents] ${e.response?.config.method} ${e.response?.config.url}} - 401 Unauthorized Request from cloud service`)}).with(400,()=>{g(`[currents] ${e.response?.config.method} ${e.response?.config.url} - 400 Bad Request from cloud service:
|
|
5
5
|
%o`,r)}).with(429,()=>{g(`[currents] ${e.response?.config.method} ${e.response?.config.url} - 429 Too Many Requests from cloud service`)}).with(422,()=>{Ir(e,r)}).otherwise(()=>{g(`[currents] Unexpected network response: %s
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@currents/cmd",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"author": "Currents Software Inc",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "MIT",
|
|
7
7
|
"description": "Currents CLI tools",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"test": "vitest",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"@jest/types": "^29.6.3",
|
|
21
21
|
"@release-it/conventional-changelog": "^7.0.2",
|
|
22
22
|
"@types/archiver": "^6.0.3",
|
|
23
|
-
"@types/async-retry": "^1.4.
|
|
23
|
+
"@types/async-retry": "^1.4.9",
|
|
24
24
|
"@types/debug": "^4.1.12",
|
|
25
25
|
"@types/fs-extra": "^11.0.4",
|
|
26
26
|
"@types/getos": "^3.0.4",
|
|
27
|
-
"@types/lodash": "^4.17.
|
|
27
|
+
"@types/lodash": "^4.17.13",
|
|
28
28
|
"@types/node": "^20.14.2",
|
|
29
29
|
"@types/proxy-from-env": "^1.0.4",
|
|
30
30
|
"@types/semver": "^7.5.8",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"commander": "^11.1.0",
|
|
49
49
|
"debug": "^4.3.5",
|
|
50
50
|
"dotenv": "^16.4.5",
|
|
51
|
-
"execa": "^
|
|
51
|
+
"execa": "^9.5.1",
|
|
52
52
|
"fs-extra": "^11.2.0",
|
|
53
53
|
"getos": "^3.2.1",
|
|
54
54
|
"glob": "^11.0.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"tmp-promise": "^3.0.3",
|
|
66
66
|
"ts-pattern": "^5.5.0",
|
|
67
67
|
"unzipper": "^0.12.3",
|
|
68
|
-
"uuid": "^
|
|
68
|
+
"uuid": "^11.0.3",
|
|
69
69
|
"xml2js": "^0.6.2"
|
|
70
70
|
},
|
|
71
71
|
"bin": {
|