hud-sdk 1.8.10 → 1.8.11
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/THIRD_PARTY_LICENSES.txt +82 -53
- package/dist/cjs/client.js +1 -1
- package/dist/cjs/config.js +1 -1
- package/dist/cjs/dto.js +1 -1
- package/dist/cjs/instrument.js +1 -1
- package/dist/cjs/lib.js +1 -1
- package/dist/cjs/worker.js +1 -1
- package/dist/cjs/wrap.js +1 -1
- package/dist/native/hud-native.darwin-arm64.node +0 -0
- package/dist/native/hud-native.darwin-x64.node +0 -0
- package/dist/native/hud-native.win32-x64-msvc.node +0 -0
- package/dist/types/on_setup.d.ts +3 -0
- package/package.json +4 -2
- package/setup.d.ts +3 -0
package/THIRD_PARTY_LICENSES.txt
CHANGED
|
@@ -385,56 +385,85 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
385
385
|
|
|
386
386
|
--------------------------------------------------------------------------------
|
|
387
387
|
|
|
388
|
-
Package:
|
|
389
|
-
License:
|
|
390
|
-
Repository: https://github.com/
|
|
388
|
+
Package: strnum
|
|
389
|
+
License: MIT
|
|
390
|
+
Repository: https://github.com/NaturalIntelligence/strnum
|
|
391
391
|
|
|
392
|
-
|
|
392
|
+
MIT License
|
|
393
393
|
|
|
394
|
-
|
|
394
|
+
Copyright (c) 2021 Natural Intelligence
|
|
395
395
|
|
|
396
|
-
|
|
396
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
397
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
398
|
+
in the Software without restriction, including without limitation the rights
|
|
399
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
400
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
401
|
+
furnished to do so, subject to the following conditions:
|
|
397
402
|
|
|
398
|
-
|
|
403
|
+
The above copyright notice and this permission notice shall be included in all
|
|
404
|
+
copies or substantial portions of the Software.
|
|
399
405
|
|
|
400
|
-
|
|
406
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
407
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
408
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
409
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
410
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
411
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
412
|
+
SOFTWARE.
|
|
401
413
|
|
|
402
|
-
"License" shall mean the terms and conditions for use, reproduction, and
|
|
403
|
-
distribution as defined by Sections 1 through 9 of this document.
|
|
404
414
|
|
|
405
|
-
|
|
406
|
-
|
|
415
|
+
--------------------------------------------------------------------------------
|
|
416
|
+
|
|
417
|
+
Package: typescript
|
|
418
|
+
License: Apache-2.0
|
|
419
|
+
Repository: https://github.com/microsoft/TypeScript
|
|
407
420
|
|
|
421
|
+
Apache License
|
|
422
|
+
|
|
423
|
+
Version 2.0, January 2004
|
|
424
|
+
|
|
425
|
+
http://www.apache.org/licenses/
|
|
426
|
+
|
|
427
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
428
|
+
|
|
429
|
+
1. Definitions.
|
|
430
|
+
|
|
431
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
432
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
433
|
+
|
|
434
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
|
435
|
+
owner that is granting the License.
|
|
436
|
+
|
|
408
437
|
"Legal Entity" shall mean the union of the acting entity and all other entities
|
|
409
438
|
that control, are controlled by, or are under common control with that entity.
|
|
410
439
|
For the purposes of this definition, "control" means (i) the power, direct or
|
|
411
440
|
indirect, to cause the direction or management of such entity, whether by
|
|
412
441
|
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
413
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
414
|
-
|
|
442
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
443
|
+
|
|
415
444
|
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
416
|
-
permissions granted by this License.
|
|
417
|
-
|
|
445
|
+
permissions granted by this License.
|
|
446
|
+
|
|
418
447
|
"Source" form shall mean the preferred form for making modifications, including
|
|
419
448
|
but not limited to software source code, documentation source, and
|
|
420
|
-
configuration files.
|
|
421
|
-
|
|
449
|
+
configuration files.
|
|
450
|
+
|
|
422
451
|
"Object" form shall mean any form resulting from mechanical transformation or
|
|
423
452
|
translation of a Source form, including but not limited to compiled object
|
|
424
|
-
code, generated documentation, and conversions to other media types.
|
|
425
|
-
|
|
453
|
+
code, generated documentation, and conversions to other media types.
|
|
454
|
+
|
|
426
455
|
"Work" shall mean the work of authorship, whether in Source or Object form,
|
|
427
456
|
made available under the License, as indicated by a copyright notice that is
|
|
428
457
|
included in or attached to the work (an example is provided in the Appendix
|
|
429
|
-
below).
|
|
430
|
-
|
|
458
|
+
below).
|
|
459
|
+
|
|
431
460
|
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
|
432
461
|
is based on (or derived from) the Work and for which the editorial revisions,
|
|
433
462
|
annotations, elaborations, or other modifications represent, as a whole, an
|
|
434
463
|
original work of authorship. For the purposes of this License, Derivative Works
|
|
435
464
|
shall not include works that remain separable from, or merely link (or bind by
|
|
436
|
-
name) to the interfaces of, the Work and Derivative Works thereof.
|
|
437
|
-
|
|
465
|
+
name) to the interfaces of, the Work and Derivative Works thereof.
|
|
466
|
+
|
|
438
467
|
"Contribution" shall mean any work of authorship, including the original
|
|
439
468
|
version of the Work and any modifications or additions to that Work or
|
|
440
469
|
Derivative Works thereof, that is intentionally submitted to Licensor for
|
|
@@ -446,19 +475,19 @@ but not limited to communication on electronic mailing lists, source code
|
|
|
446
475
|
control systems, and issue tracking systems that are managed by, or on behalf
|
|
447
476
|
of, the Licensor for the purpose of discussing and improving the Work, but
|
|
448
477
|
excluding communication that is conspicuously marked or otherwise designated in
|
|
449
|
-
writing by the copyright owner as "Not a Contribution."
|
|
450
|
-
|
|
478
|
+
writing by the copyright owner as "Not a Contribution."
|
|
479
|
+
|
|
451
480
|
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
|
452
481
|
of whom a Contribution has been received by Licensor and subsequently
|
|
453
|
-
incorporated within the Work.
|
|
454
|
-
|
|
482
|
+
incorporated within the Work.
|
|
483
|
+
|
|
455
484
|
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
456
485
|
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
457
486
|
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
458
487
|
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
459
488
|
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
460
|
-
Object form.
|
|
461
|
-
|
|
489
|
+
Object form.
|
|
490
|
+
|
|
462
491
|
3. Grant of Patent License. Subject to the terms and conditions of this
|
|
463
492
|
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
464
493
|
non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
|
|
@@ -471,23 +500,23 @@ litigation against any entity (including a cross-claim or counterclaim in a
|
|
|
471
500
|
lawsuit) alleging that the Work or a Contribution incorporated within the Work
|
|
472
501
|
constitutes direct or contributory patent infringement, then any patent
|
|
473
502
|
licenses granted to You under this License for that Work shall terminate as of
|
|
474
|
-
the date such litigation is filed.
|
|
475
|
-
|
|
503
|
+
the date such litigation is filed.
|
|
504
|
+
|
|
476
505
|
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
477
506
|
Derivative Works thereof in any medium, with or without modifications, and in
|
|
478
|
-
Source or Object form, provided that You meet the following conditions:
|
|
479
|
-
|
|
507
|
+
Source or Object form, provided that You meet the following conditions:
|
|
508
|
+
|
|
480
509
|
You must give any other recipients of the Work or Derivative Works a copy of
|
|
481
|
-
this License; and
|
|
482
|
-
|
|
510
|
+
this License; and
|
|
511
|
+
|
|
483
512
|
You must cause any modified files to carry prominent notices stating that You
|
|
484
|
-
changed the files; and
|
|
485
|
-
|
|
513
|
+
changed the files; and
|
|
514
|
+
|
|
486
515
|
You must retain, in the Source form of any Derivative Works that You
|
|
487
516
|
distribute, all copyright, patent, trademark, and attribution notices from the
|
|
488
517
|
Source form of the Work, excluding those notices that do not pertain to any
|
|
489
|
-
part of the Derivative Works; and
|
|
490
|
-
|
|
518
|
+
part of the Derivative Works; and
|
|
519
|
+
|
|
491
520
|
If the Work includes a "NOTICE" text file as part of its distribution, then any
|
|
492
521
|
Derivative Works that You distribute must include a readable copy of the
|
|
493
522
|
attribution notices contained within such NOTICE file, excluding those notices
|
|
@@ -505,20 +534,20 @@ modifications and may provide additional or different license terms and
|
|
|
505
534
|
conditions for use, reproduction, or distribution of Your modifications, or for
|
|
506
535
|
any such Derivative Works as a whole, provided Your use, reproduction, and
|
|
507
536
|
distribution of the Work otherwise complies with the conditions stated in this
|
|
508
|
-
License.
|
|
509
|
-
|
|
537
|
+
License.
|
|
538
|
+
|
|
510
539
|
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
511
540
|
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
512
541
|
Licensor shall be under the terms and conditions of this License, without any
|
|
513
542
|
additional terms or conditions. Notwithstanding the above, nothing herein shall
|
|
514
543
|
supersede or modify the terms of any separate license agreement you may have
|
|
515
|
-
executed with Licensor regarding such Contributions.
|
|
516
|
-
|
|
544
|
+
executed with Licensor regarding such Contributions.
|
|
545
|
+
|
|
517
546
|
6. Trademarks. This License does not grant permission to use the trade names,
|
|
518
547
|
trademarks, service marks, or product names of the Licensor, except as required
|
|
519
548
|
for reasonable and customary use in describing the origin of the Work and
|
|
520
|
-
reproducing the content of the NOTICE file.
|
|
521
|
-
|
|
549
|
+
reproducing the content of the NOTICE file.
|
|
550
|
+
|
|
522
551
|
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
523
552
|
writing, Licensor provides the Work (and each Contributor provides its
|
|
524
553
|
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
@@ -526,8 +555,8 @@ KIND, either express or implied, including, without limitation, any warranties
|
|
|
526
555
|
or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
527
556
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
528
557
|
appropriateness of using or redistributing the Work and assume any risks
|
|
529
|
-
associated with Your exercise of permissions under this License.
|
|
530
|
-
|
|
558
|
+
associated with Your exercise of permissions under this License.
|
|
559
|
+
|
|
531
560
|
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
532
561
|
tort (including negligence), contract, or otherwise, unless required by
|
|
533
562
|
applicable law (such as deliberate and grossly negligent acts) or agreed to in
|
|
@@ -537,8 +566,8 @@ character arising as a result of this License or out of the use or inability to
|
|
|
537
566
|
use the Work (including but not limited to damages for loss of goodwill, work
|
|
538
567
|
stoppage, computer failure or malfunction, or any and all other commercial
|
|
539
568
|
damages or losses), even if such Contributor has been advised of the
|
|
540
|
-
possibility of such damages.
|
|
541
|
-
|
|
569
|
+
possibility of such damages.
|
|
570
|
+
|
|
542
571
|
9. Accepting Warranty or Additional Liability. While redistributing the Work or
|
|
543
572
|
Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
544
573
|
acceptance of support, warranty, indemnity, or other liability obligations
|
|
@@ -547,9 +576,9 @@ obligations, You may act only on Your own behalf and on Your sole
|
|
|
547
576
|
responsibility, not on behalf of any other Contributor, and only if You agree
|
|
548
577
|
to indemnify, defend, and hold each Contributor harmless for any liability
|
|
549
578
|
incurred by, or claims asserted against, such Contributor by reason of your
|
|
550
|
-
accepting any such warranty or additional liability.
|
|
551
|
-
|
|
552
|
-
END OF TERMS AND CONDITIONS
|
|
579
|
+
accepting any such warranty or additional liability.
|
|
580
|
+
|
|
581
|
+
END OF TERMS AND CONDITIONS
|
|
553
582
|
|
|
554
583
|
|
|
555
584
|
--------------------------------------------------------------------------------
|
package/dist/cjs/client.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var s=t();for(var n in s)("object"==typeof exports?exports:e)[n]=s[n]}}(global,()=>(()=>{"use strict";var e={523:e=>{e.exports=require("./logger")},2312:function(e,t,s){var n,r=this&&this.__createBinding||(Object.create?function(e,t,s,n){void 0===n&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){void 0===n&&(n=s),e[n]=t[s]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=n(e),i=0;i<s.length;i++)"default"!==s[i]&&r(t,e,s[i]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.HudClient=void 0;const a=s(5809),u=s(2546),d=s(523),l=i(s(8938)),c=s(6982),g=s(6261),f=s(9561),h=s(9023),p=s(3106),_=(0,h.promisify)(p.gzip),w="node-sdk",m=(0,c.randomUUID)();class y{sessionId;httpClient;extensionEventEmitter;static config={baseURL:a.hudConfig.sink.url,timeout:a.hudConfig.sink.timeout,headers:{"Content-Type":"application/json"}};static defaultRequest={version:"1.0.0",source:w,event_version:"1.0.0"};constructor(e){this.httpClient=l.default.create(y.config),this.extensionEventEmitter=e}setSession(e){const{sessionId:t,extraHeaders:s}=e;this.sessionId=t,this.httpClient.defaults.headers.common[a.hudConfig.sink.session_attr]=t;try{for(const[e,t]of Object.entries(s))try{this.httpClient.defaults.headers.common[e]=t}catch(s){d.worker_logger.error("Failed to set extra header",{msg:s instanceof Error?s.message:void 0,stack:s instanceof Error?s.stack:void 0,key:e,value:t})}}catch(e){d.worker_logger.error("Failed to set extra headers",{msg:e instanceof Error?e.message:void 0,stack:e instanceof Error?e.stack:void 0})}}setExtensionEventEmitter(e){this.extensionEventEmitter=e}async logs(e){const t={logs:e,send_time:(new Date).toISOString()};await this._requestRelentless(a.hudConfig.endpoints.logs,t,"logs"),d.worker_logger.debug("sent logs successfully",{size:e.length})}async sessionslessLogs(e,t,s,n){const r={logs:e,send_time:(new Date).toISOString(),token:t,sdk_version:a.SDK_VERSION,sdk_type:w,sdk_runtime_type:n??"sdk",run_id:s??m};await this._requestRelentless(a.hudConfig.endpoints.sessionslessLogs,r,"sessionslessLogs"),d.worker_logger.debug("sent logs successfully",{size:e.length})}async send(e,t,s={}){const n={...y.defaultRequest,type:e,raw:t,send_time:(new Date).toISOString(),...s};await this._requestRelentless(a.hudConfig.endpoints.send,n,e),d.worker_logger.debug("sent event successfully",{type:e})}async batch(e,t,s={}){const n={...y.defaultRequest,type:e,arr:t,send_time:(new Date).toISOString(),...s};await this._requestRelentless(a.hudConfig.endpoints.batch,n,e),d.worker_logger.debug("sent batched events successfully",{type:e})}async getRemoteConfig(){const e=await this._requestDataRelentless(a.hudConfig.endpoints.getRemoteConfig,{},"getRemoteConfig");return d.worker_logger.info("Received remote configuration from server",{remoteConfiguration:e}),e}async getMode(e){const t={extra:e,send_time:(new Date).toISOString()},s=await this._requestDataRelentless(a.hudConfig.endpoints.getMode,t,"getMode");return d.worker_logger.info("Received mode from server "+s),s}async getKnownDetachedFunctions(){const e={...y.defaultRequest,send_time:(new Date).toISOString()},t=await this._requestDataRelentless(a.hudConfig.endpoints.getKnownDetachedFunctions,e,"getKnownDetachedFunctions");return t?.knownDetachedFunctions||[]}async setDetachedFunctions(e){if(0===e.length)return;const t={...y.defaultRequest,arr:e,send_time:(new Date).toISOString()};await this._requestRelentless(a.hudConfig.endpoints.setDetachedFunctions,t,"setDetachedFunctions"),d.worker_logger.debug("Sent detached functions successfully",{count:e.length})}async storeObject(e,t){const s={key:e,value:t.toString("base64")},n=await this._requestDataRelentless(a.hudConfig.endpoints.storeObject,s,"storeObject");if("reference"in n)return d.worker_logger.debug("Stored object successfully",{reference:n.reference}),n.reference;d.worker_logger.error("Failed to store object",{key:e,response:n})}async validateToken(e){const t={...y.defaultRequest,token:e,send_time:(new Date).toISOString()};try{return await this._requestRelentless(a.hudConfig.endpoints.validateToken,t,"validateToken"),!0}catch(e){if(e instanceof u.HudClientUnauthorizedError)return!1}return!1}async getUploadUrls(e,t,s){const n={...y.defaultRequest,send_time:(new Date).toISOString(),build_id:e,token:t,num_urls:s};return(await this._requestRelentless(a.hudConfig.endpoints.getUploadUrls,n,"getUploadUrls")).data.urls}async triggerReingest(e){const t={...y.defaultRequest,type:"triggerReingest",send_time:(new Date).toISOString(),build_id:e};await this._requestRelentless(a.hudConfig.endpoints.triggerReingest,t,"triggerReingest")}async completed(e,t){const s={...y.defaultRequest,build_id:e,token:t,send_time:(new Date).toISOString()};await this._requestRelentless(a.hudConfig.endpoints.completed,s,"completed")}async sendFileDeclarationsCi(e,t){d.worker_logger.debug("Sending file declarations request",{count:t.length});const s={...e,files:t},n=await this._requestRelentless(a.hudConfig.endpoints.fileDeclarationsCi,s,"fileDeclarations");return{files:n.data.files,send_all:n.data.send_all}}async sendFileDeclarations(e){d.worker_logger.debug("Sending file declarations request",{count:e.length});const t={files:e},s=await this._requestRelentless(a.hudConfig.endpoints.fileDeclarations,t,"fileDeclarations");return{files:s.data.files,send_all:s.data.send_all}}async getEndpointsDurationsInvestigationThresholds(){return await this._requestDataRelentless(a.hudConfig.endpoints.endpointsDurationsInvestigationThresholds,{},"endpointsDurationsInvestigationThresholds","get")}async _requestRelentless(e,t,s,n="post",r=3){const o={"X-Hud-Type":s,"X-Hud-Request-ID":(0,c.randomUUID)()},i=[];let a;for(let c=0;c<r;c++)try{const r=await this._request(e,t,s,o,n);return(0,u.incrementSentEventsCount)(s),r}catch(t){if(t instanceof Error&&(a=t),t instanceof l.AxiosError){if(401===t.response?.status)throw d.worker_logger.error("Unauthorized request",{endpoint:e,requestType:s}),new u.HudClientUnauthorizedError(`Unauthorized request for ${e}`);const{code:n,name:r,status:o,message:a}=t;i.push({code:n,name:r,status:o,message:a})}else if(t instanceof Error){const{name:e,message:s}=t;i.push({name:e,message:s})}await new Promise(e=>setTimeout(e,1))}throw d.worker_logger.error("Exceeded max retries to request",{endpoint:e,requestType:s,failures:i,retries:r}),new u.HudClientError(`Exceeded max retries for ${e}`,a instanceof l.AxiosError?a.code:void 0)}async _requestDataRelentless(e,t,s,n="post",r=3){return(await this._requestRelentless(e,t,s,n,r)).data}async _request(e,t,s,n,r="post"){try{this.extensionEventEmitter&&await(0,g.once)(this.extensionEventEmitter,"eventloop");const s="get"===r?void 0:await this._gzipCompress(JSON.stringify(t));return n={...n,"Content-Encoding":"gzip","Content-Type":"application/json"},await(0,u.suppressTraces)(async()=>await this.httpClient.request({url:e,method:r,data:s,headers:n}))()}catch(t){if(t instanceof l.AxiosError){const{code:n,name:r,status:o,cause:i,message:a}=t;d.worker_logger.error(`${e} request failed`,{requestType:s,code:n,name:r,status:o,cause:i,msg:a})}else d.worker_logger.error("Caught an unexpected error",{msg:t instanceof Error?t.message:void 0,stack:t instanceof Error?t.stack:void 0});throw t}}async _gzipCompress(e){return _(e)}async initSession(e,t,s,n,r){const o={token:e,service:t,start_time:s.toISOString(),type:w,version:"1.0.0",sdk_version:a.SDK_VERSION,tags:n,internal_tags:r};d.worker_logger.debug("Requesting init",{data:o});const i=await this._requestRelentless(a.hudConfig.endpoints.init,o,"init");if(i.status===a.hudConfig.throttleStatusCode)throw d.worker_logger.debug("Init request throttled"),new u.HudSessionThrottle;const l=i.data.sessionId,c=i.data.extraHeaders??{};return d.worker_logger.info("Succesfuly created session with backend",{host:y.config.baseURL,service:t,sessionId:l,extraHeaders:c,tags:n}),{sessionId:l,extraHeaders:c}}async uploadDeclarationsToS3(e,t,s,n){const r=await(0,f.buffer)(e);let o=(await this.getUploadUrls(t,s,1))[0];n(`Got upload url ${o}`);for(let e=1;e<=3;e++)try{return await l.default.put(o,r,{headers:{"Content-Encoding":"gzip","Content-Type":"application/x-ndjson"}}),void n(`Uploaded requests to ${o}`)}catch(r){if(!(l.default.isAxiosError(r)&&405===r.response?.status&&e<3))throw r;n(`Upload failed with 405 status, retrying attempt ${e+1}/3, current upload url: ${o}`),o=(await this.getUploadUrls(t,s,1))[0]}}}t.HudClient=y},2546:e=>{e.exports=require("./lib")},3106:e=>{e.exports=require("zlib")},5809:e=>{e.exports=require("./config")},6261:e=>{e.exports=require("events")},6982:e=>{e.exports=require("crypto")},8938:e=>{e.exports=require("axios")},9023:e=>{e.exports=require("util")},9561:e=>{e.exports=require("stream/consumers")}},t={};return function s(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,s),o.exports}(2312)})());
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var s=t();for(var n in s)("object"==typeof exports?exports:e)[n]=s[n]}}(global,()=>(()=>{"use strict";var e={523:e=>{e.exports=require("./logger")},2312:function(e,t,s){var n,r=this&&this.__createBinding||(Object.create?function(e,t,s,n){void 0===n&&(n=s);var r=Object.getOwnPropertyDescriptor(t,s);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,r)}:function(e,t,s,n){void 0===n&&(n=s),e[n]=t[s]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=n(e),i=0;i<s.length;i++)"default"!==s[i]&&r(t,e,s[i]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.HudClient=void 0;const a=s(5809),u=s(2546),d=s(523),l=i(s(8938)),c=s(6982),g=s(6261),f=s(9561),h=s(9023),p=s(3106),_=(0,h.promisify)(p.gzip),w="node-sdk",m=(0,c.randomUUID)();class y{sessionId;httpClient;extensionEventEmitter;static config={baseURL:a.hudConfig.sink.url,timeout:a.hudConfig.sink.timeout,headers:{"Content-Type":"application/json"}};static defaultRequest={version:"1.0.0",source:w,event_version:"1.0.0"};constructor(e){this.httpClient=l.default.create(y.config),this.extensionEventEmitter=e}setSession(e){const{sessionId:t,extraHeaders:s}=e;this.sessionId=t,this.httpClient.defaults.headers.common[a.hudConfig.sink.session_attr]=t;try{for(const[e,t]of Object.entries(s))try{this.httpClient.defaults.headers.common[e]=t}catch(s){d.worker_logger.error("Failed to set extra header",{msg:s instanceof Error?s.message:void 0,stack:s instanceof Error?s.stack:void 0,key:e,value:t})}}catch(e){d.worker_logger.error("Failed to set extra headers",{msg:e instanceof Error?e.message:void 0,stack:e instanceof Error?e.stack:void 0})}}setExtensionEventEmitter(e){this.extensionEventEmitter=e}async logs(e){const t={logs:e,send_time:(new Date).toISOString()};await this._requestRelentless(a.hudConfig.endpoints.logs,t,"logs"),d.worker_logger.debug("sent logs successfully",{size:e.length})}async sessionslessLogs(e,t,s,n){const r={logs:e,send_time:(new Date).toISOString(),token:t,sdk_version:a.SDK_VERSION,sdk_type:w,sdk_runtime_type:n??"sdk",run_id:s??m};await this._requestRelentless(a.hudConfig.endpoints.sessionslessLogs,r,"sessionslessLogs"),d.worker_logger.debug("sent logs successfully",{size:e.length})}async send(e,t,s={}){const n={...y.defaultRequest,type:e,raw:t,send_time:(new Date).toISOString(),...s};await this._requestRelentless(a.hudConfig.endpoints.send,n,e),d.worker_logger.debug("sent event successfully",{type:e})}async batch(e,t,s={}){const n={...y.defaultRequest,type:e,arr:t,send_time:(new Date).toISOString(),...s};await this._requestRelentless(a.hudConfig.endpoints.batch,n,e),d.worker_logger.debug("sent batched events successfully",{type:e})}async getRemoteConfig(){const e=await this._requestDataRelentless(a.hudConfig.endpoints.getRemoteConfig,{},"getRemoteConfig");return d.worker_logger.info("Received remote configuration from server",{remoteConfiguration:e}),e}async getMode(e){const t={extra:e,send_time:(new Date).toISOString()},s=await this._requestDataRelentless(a.hudConfig.endpoints.getMode,t,"getMode");return d.worker_logger.info("Received mode from server "+s),s}async getKnownDetachedFunctions(){const e={...y.defaultRequest,send_time:(new Date).toISOString()},t=await this._requestDataRelentless(a.hudConfig.endpoints.getKnownDetachedFunctions,e,"getKnownDetachedFunctions");return t?.knownDetachedFunctions||[]}async setDetachedFunctions(e){if(0===e.length)return;const t={...y.defaultRequest,arr:e,send_time:(new Date).toISOString()};await this._requestRelentless(a.hudConfig.endpoints.setDetachedFunctions,t,"setDetachedFunctions"),d.worker_logger.debug("Sent detached functions successfully",{count:e.length})}async storeObject(e,t){const s={key:e,value:t.toString("base64")},n=await this._requestDataRelentless(a.hudConfig.endpoints.storeObject,s,"storeObject");if("reference"in n)return d.worker_logger.debug("Stored object successfully",{reference:n.reference}),n.reference;d.worker_logger.error("Failed to store object",{key:e,response:n})}async validateToken(e){const t={...y.defaultRequest,token:e,send_time:(new Date).toISOString()};try{return await this._requestRelentless(a.hudConfig.endpoints.validateToken,t,"validateToken"),!0}catch(e){if(e instanceof u.HudClientUnauthorizedError)return!1}return!1}async getUploadUrls(e,t,s){const n={...y.defaultRequest,send_time:(new Date).toISOString(),build_id:e,token:t,num_urls:s};return(await this._requestRelentless(a.hudConfig.endpoints.getUploadUrls,n,"getUploadUrls")).data.urls}async triggerReingest(e){const t={...y.defaultRequest,type:"triggerReingest",send_time:(new Date).toISOString(),build_id:e};await this._requestRelentless(a.hudConfig.endpoints.triggerReingest,t,"triggerReingest")}async completed(e,t){const s={...y.defaultRequest,build_id:e,token:t,send_time:(new Date).toISOString()};await this._requestRelentless(a.hudConfig.endpoints.completed,s,"completed")}async sendFileDeclarationsCi(e,t){d.worker_logger.debug("Sending file declarations request",{count:t.length});const s={...e,files:t},n=await this._requestRelentless(a.hudConfig.endpoints.fileDeclarationsCi,s,"fileDeclarations");return{files:n.data.files,send_all:n.data.send_all}}async sendFileDeclarations(e){d.worker_logger.debug("Sending file declarations request",{count:e.length});const t={files:e},s=await this._requestRelentless(a.hudConfig.endpoints.fileDeclarations,t,"fileDeclarations");return{files:s.data.files,send_all:s.data.send_all}}async getEndpointsDurationsInvestigationThresholds(){return await this._requestDataRelentless(a.hudConfig.endpoints.endpointsDurationsInvestigationThresholds,{},"endpointsDurationsInvestigationThresholds","get")}async _requestRelentless(e,t,s,n="post",r=3){const o={"X-Hud-Type":s,"X-Hud-Request-ID":(0,c.randomUUID)()},i=[];let a;for(let c=0;c<r;c++)try{const r=await this._request(e,t,s,o,n);return(0,u.incrementSentEventsCount)(s),r}catch(t){if(t instanceof Error&&(a=t),t instanceof l.AxiosError){if(401===t.response?.status)throw d.worker_logger.error("Unauthorized request",{endpoint:e,requestType:s}),new u.HudClientUnauthorizedError(`Unauthorized request for ${e}`);const{code:n,name:r,status:o,message:a}=t;i.push({code:n,name:r,status:o,message:a})}else if(t instanceof Error){const{name:e,message:s}=t;i.push({name:e,message:s})}await new Promise(e=>setTimeout(e,1))}throw d.worker_logger.error("Exceeded max retries to request",{endpoint:e,requestType:s,failures:i,retries:r}),new u.HudClientError(`Exceeded max retries for ${e}`,a instanceof l.AxiosError?a.code:void 0)}async _requestDataRelentless(e,t,s,n="post",r=3){return(await this._requestRelentless(e,t,s,n,r)).data}async _request(e,t,s,n,r="post"){try{this.extensionEventEmitter&&await(0,g.once)(this.extensionEventEmitter,"eventloop");const s="get"===r?void 0:await this._gzipCompress(JSON.stringify(t));return n={...n,"Content-Encoding":"gzip","Content-Type":"application/json"},await(0,u.suppressTraces)(async()=>await this.httpClient.request({url:e,method:r,data:s,headers:n}))()}catch(t){if(t instanceof l.AxiosError){const{code:n,name:r,status:o,cause:i,message:a}=t;d.worker_logger.error(`${e} request failed`,{requestType:s,code:n,name:r,status:o,cause:i,msg:a})}else d.worker_logger.error("Caught an unexpected error",{msg:t instanceof Error?t.message:void 0,stack:t instanceof Error?t.stack:void 0});throw t}}async _gzipCompress(e){return _(e)}async initSession(e,t,s,n,r){const o={token:e,service:t,start_time:s.toISOString(),type:w,version:"1.0.0",sdk_version:a.SDK_VERSION,tags:n,internal_tags:r,deployment_id:a.hudConfig.userConfig.deploymentId?.value};d.worker_logger.debug("Requesting init",{data:o});const i=await this._requestRelentless(a.hudConfig.endpoints.init,o,"init");if(i.status===a.hudConfig.throttleStatusCode)throw d.worker_logger.debug("Init request throttled"),new u.HudSessionThrottle;const l=i.data.sessionId,c=i.data.extraHeaders??{};return d.worker_logger.info("Succesfuly created session with backend",{host:y.config.baseURL,service:t,sessionId:l,extraHeaders:c,tags:n}),{sessionId:l,extraHeaders:c}}async uploadDeclarationsToS3(e,t,s,n){const r=await(0,f.buffer)(e);let o=(await this.getUploadUrls(t,s,1))[0];n(`Got upload url ${o}`);for(let e=1;e<=3;e++)try{return await l.default.put(o,r,{headers:{"Content-Encoding":"gzip","Content-Type":"application/x-ndjson"}}),void n(`Uploaded requests to ${o}`)}catch(r){if(!(l.default.isAxiosError(r)&&405===r.response?.status&&e<3))throw r;n(`Upload failed with 405 status, retrying attempt ${e+1}/3, current upload url: ${o}`),o=(await this.getUploadUrls(t,s,1))[0]}}}t.HudClient=y},2546:e=>{e.exports=require("./lib")},3106:e=>{e.exports=require("zlib")},5809:e=>{e.exports=require("./config")},6261:e=>{e.exports=require("events")},6982:e=>{e.exports=require("crypto")},8938:e=>{e.exports=require("axios")},9023:e=>{e.exports=require("util")},9561:e=>{e.exports=require("stream/consumers")}},t={};return function s(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,s),o.exports}(2312)})());
|
|
2
2
|
//# sourceMappingURL=client.js.map
|
package/dist/cjs/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var i in t)("object"==typeof exports?exports:e)[i]=t[i]}}(global,()=>(()=>{"use strict";var e={1569:e=>{e.exports=require("zod")},2210:(e,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SDK_MODULE_NAME=void 0,n.SDK_MODULE_NAME="hud-sdk"},2509:function(e,n,t){var i=this&&this.__createBinding||(Object.create?function(e,n,t,i){void 0===i&&(i=t);var a=Object.getOwnPropertyDescriptor(n,t);a&&!("get"in a?!n.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,a)}:function(e,n,t,i){void 0===i&&(i=t),e[i]=n[t]}),a=this&&this.__exportStar||function(e,n){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(n,t)||i(n,e,t)};Object.defineProperty(n,"__esModule",{value:!0}),n.SDK_VERSION=n.SDK_MODULE_NAME=void 0,a(t(2887),n),a(t(2570),n);var o=t(2210);Object.defineProperty(n,"SDK_MODULE_NAME",{enumerable:!0,get:function(){return o.SDK_MODULE_NAME}}),a(t(7089),n);var r=t(5453);Object.defineProperty(n,"SDK_VERSION",{enumerable:!0,get:function(){return r.SDK_VERSION}})},2570:(e,n,t)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.refreshInvestigationErrorStatusCodeRegex=function(e,n,t){if(null==e)return;const o=i.HudDynamicConfigSchema.deepPartial().safeParse(e);if(!o.success)return;const r=o.data?.investigationErrorStatusCodeRegex;void 0!==r&&r!==n.dynamicConfig.investigationErrorStatusCodeRegex&&a(r,n,t,"Periodic refresh - Dynamic configuration updated - investigationErrorStatusCodeRegex")},n.refreshInvestigationEnabled=function(e,n,t){if(null==e)return;const a=i.HudDynamicConfigSchema.deepPartial().safeParse(e);if(!a.success)return;const o=a.data?.enableInvestigation;if(void 0===o)return;o!==globalThis.hudEnableInvestigation&&(n.isInvestigationEnabledByEnv||(globalThis.hudEnableInvestigation=o,t.info("Periodic refresh - Dynamic configuration updated - enableInvestigation",{hudEnableInvestigation:o})))},n.updateDynamicConfig=function(e,n,t){const r=i.HudDynamicConfigSchema.deepPartial().safeParse(e);if(!r.success)return t.error("Dynamic configuration not updated - Invalid configuration override",{remoteConfigParseResult:r,remoteConfig:e}),n.dynamicConfig;const s=o(n.dynamicConfig,r.data);return void 0!==s.enableInvestigation&&s.enableInvestigation!==n.dynamicConfig.enableInvestigation&&(t.info("Dynamic configuration updated - enableInvestigation",{hudEnableInvestigation:s.enableInvestigation}),n.isInvestigationEnabledByEnv||(globalThis.hudEnableInvestigation=s.enableInvestigation)),void 0!==s.enableInvestigationArgsSending&&s.enableInvestigationArgsSending!==n.dynamicConfig.enableInvestigationArgsSending&&(t.info("Dynamic configuration updated - enableInvestigationArgsSending",{hudEnableInvestigationArgsSending:s.enableInvestigationArgsSending}),globalThis.hudEnableInvestigationArgsSending=s.enableInvestigationArgsSending),void 0!==s?.investigationRateLimits?.executionFlowMaxLength&&s?.investigationRateLimits?.executionFlowMaxLength!==n.dynamicConfig.investigationRateLimits.executionFlowMaxLength&&(globalThis.hudExecutionFlowMaxLength=s.investigationRateLimits.executionFlowMaxLength),void 0!==s?.investigationRateLimits?.exceptionMaxLength&&s?.investigationRateLimits?.exceptionMaxLength!==n.dynamicConfig.investigationRateLimits.exceptionMaxLength&&(globalThis.hudExceptionMaxLength=s.investigationRateLimits.exceptionMaxLength),void 0!==r.data.investigationErrorStatusCodeRegex&&s.investigationErrorStatusCodeRegex!==n.dynamicConfig.investigationErrorStatusCodeRegex&&a(s.investigationErrorStatusCodeRegex,n,t,"Dynamic configuration updated - investigationErrorStatusCodeRegex",s),s};const i=t(2887);function a(e,n,t,a,o){const{appliedRegex:r,usedDefault:s}=(0,i.updateInvestigationErrorStatusCodePatternGlobal)(e);n.dynamicConfig.investigationErrorStatusCodeRegex=r,o&&(o.investigationErrorStatusCodeRegex=r),s&&e!==r?t.warning("Invalid investigationErrorStatusCodeRegex, using default",{investigationErrorStatusCodeRegex:e,appliedRegex:r}):t.info(a,{investigationErrorStatusCodeRegex:r})}function o(e,n){if(null===n||"object"!=typeof n)return n;if(Array.isArray(e)&&Array.isArray(n))return n;const t={...e};for(const i in n){const a=e[i],r=n[i];t[i]=o(a,r)}return t}},2887:function(e,n,t){var i,a=this&&this.__createBinding||(Object.create?function(e,n,t,i){void 0===i&&(i=t);var a=Object.getOwnPropertyDescriptor(n,t);a&&!("get"in a?!n.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,a)}:function(e,n,t,i){void 0===i&&(i=t),e[i]=n[t]}),o=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),r=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var n=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[n.length]=t);return n},i(e)},function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var t=i(e),r=0;r<t.length;r++)"default"!==t[r]&&a(n,e,t[r]);return o(n,e),n});Object.defineProperty(n,"__esModule",{value:!0}),n.HudFailedReadConfigError=n.loggerConfig=n.hudConfig=n.HudDynamicConfigSchema=n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX=void 0,n.functionUuidToBase64=c,n.getModulesToTraceFromEnv=function(){const e=process.env.HUD_MONITOR_MODULES||process.env.HUD_INCLUDE_MODULES;if(e)return e.split(",")},n.getExcludeDirsFromEnv=function(){const e=process.env.HUD_EXCLUDE_DIRS;if(e)return e.split(",")},n.getFrameworksToEnableFromEnv=function(){const e=process.env.HUD_ENABLE_FRAMEWORKS;let n;if(e)try{n=s.availableFrameworksSchema.parse(JSON.parse(e))}catch{n=new Map}return n},n.isValidParam=function(e){return null!=e&&""!==e&&"string"==typeof e},n.updateInvestigationRateLimitGlobals=function(){globalThis.hudMaxSameInvestigations=n.hudConfig.dynamicConfig.investigationRateLimits.maxSameInvestigations,globalThis.hudMaxTotalInvestigations=n.hudConfig.dynamicConfig.investigationRateLimits.maxTotalInvestigations,globalThis.hudSameInvestigationTimeWindowNs=BigInt(n.hudConfig.dynamicConfig.investigationRateLimits.sameInvestigationTimeWindowMs)*BigInt(1e6),globalThis.hudTotalInvestigationTimeWindowNs=BigInt(n.hudConfig.dynamicConfig.investigationRateLimits.totalInvestigationTimeWindowMs)*BigInt(1e6)},n.updateInvestigationErrorStatusCodePatternGlobal=function(e=n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX){try{return globalThis.hudInvestigationErrorStatusCodePattern=new RegExp(`^(?:${e})$`),{appliedRegex:e,usedDefault:e===n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX}}catch{return globalThis.hudInvestigationErrorStatusCodePattern=new RegExp(`^(?:${n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX})$`),{appliedRegex:n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX,usedDefault:!0}}},n.matchesInvestigationErrorStatusCode=function(e){return null!=e&&globalThis.hudInvestigationErrorStatusCodePattern.test(String(e))};const s=t(8528),l=r(t(6928)),u=t(3903),d=t(1569);function c(e){return Buffer.from((0,u.parse)(e)).toString("base64").slice(0,22)}const g="globalThis._hudMark";n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX="^5\\d\\d$",n.HudDynamicConfigSchema=d.z.object({aggregationInterval:d.z.number(),aggregationFirstSendTimeout:d.z.number(),investigationInterval:d.z.number(),investigationFirstSendTimeout:d.z.number(),enableInvestigation:d.z.boolean(),investigationErrorStatusCodeRegex:d.z.string(),enableInvestigationArgsSending:d.z.boolean(),investigationRateLimits:d.z.object({maxSameInvestigations:d.z.number().int().positive(),sameInvestigationTimeWindowMs:d.z.number().int().positive(),maxTotalInvestigations:d.z.number().int().positive(),maxTotalInvestigationsErrorBased:d.z.number().int().positive(),maxTotalInvestigationsDurationBased:d.z.number().int().positive(),totalInvestigationTimeWindowMs:d.z.number().int().positive(),maxUniqLogs:d.z.number().int().positive(),maxStringLength:d.z.number().int().positive(),maxArrayLength:d.z.number().int().positive(),maxObjectDepth:d.z.number().int().positive(),maxKeyLength:d.z.number().int().positive(),executionFlowMaxLength:d.z.number().int().positive(),exceptionMaxLength:d.z.number().int().positive(),maxUniqueSetFailureErrors:d.z.number().int().positive()}),machineMetricsInterval:d.z.number().int().positive(),blacklistParams:d.z.array(d.z.string()),forensicsBlacklistFields:d.z.array(d.z.string()),forensicsWhitelistFields:d.z.array(d.z.string()),censorshipRegexes:d.z.array(d.z.object({regex:d.z.string(),replacement:d.z.string()})),reingestInterval:d.z.number().int().positive(),extraHeaders:d.z.array(d.z.string()),performanceMetricsInterval:d.z.number().int().positive(),enableOutboundData:d.z.boolean(),maxTotalOutbounds:d.z.number().int().positive(),maxOutboundCountWithData:d.z.number().int().positive(),maxHTTPRequestBodySize:d.z.number().int().positive(),maxHTTPResponseBodySize:d.z.number().int().positive(),functionDetachEnabled:d.z.boolean(),functionDetachThresholdPerSecond:d.z.number().int().positive(),enableMongoDocumentData:d.z.boolean(),enableTeardown:d.z.boolean(),flushOnUncaughtException:d.z.boolean(),fileTimestampsLogDelayMs:d.z.number().int().positive()});const m=process.env.HUD_ENABLE_INVESTIGATION,v="_HUD",p="94a210f3-861c-4e18-ab27-6b6c19437c9d",b={sink:{url:process.env.HUD_HOST||"https://api-prod.hud.io",timeout:5e3,session_attr:"X-Session-ID"},endpoints:{init:"sink/init",send:"sink/send",batch:"sink/batch",logs:"sink/logs",sessionslessLogs:"sink/sessionless-logs",fatalError:"sink/redline",getMode:"sink/getMode",getRemoteConfig:"sink/remote-config/get",fileDeclarations:"sink/file-declarations",sourceMap:"sink/sourcemap",storeObject:"sink/objects/store",getUploadUrls:"sink/registry/get-upload-urls",triggerReingest:"sink/registry/reingest",validateToken:"sink/registry/validate",fileDeclarationsCi:"sink/registry/file-declarations",completed:"sink/registry/completed",endpointsDurationsInvestigationThresholds:"sink/endpoint-configuration",getKnownDetachedFunctions:"sink/known-detached-functions/get",setDetachedFunctions:"sink/known-detached-functions/set"},logger:{default:{levels:{app:"warning",worker:"warning",instrument:"warning"}},debug:{levels:{app:"debug",worker:"debug",instrument:"debug"}}},investigation:{objectVersion:"1.0.2",store:{type:"s3"}},userConfig:{lean:{value:!1,source:"DEFAULT"},minPodMemoryMB:{value:250,source:"DEFAULT"},maxMappedFunctions:{value:5e4,source:"DEFAULT"},maxFileSizeBytes:{value:2831155,source:"DEFAULT"},maxTimeUntilInitSessionMs:{value:3e4,source:"DEFAULT"},includeModules:{value:[],source:"DEFAULT"},excludeDirs:{value:[],source:"DEFAULT"},disableRuntimeInstrumentation:{value:!1,source:"DEFAULT"},disableParametersExtraction:{value:!1,source:"DEFAULT"},disableDetachedFunctions:{value:!1,source:"DEFAULT"},enableVarHoisting:{value:!1,source:"DEFAULT"},instrumentOneLiners:{value:!0,source:"DEFAULT"}},loggerWorkerPortSizeLimit:1e4,customerLoggerLevel:"info",logDirectory:process.env.HUD_LOG_DIR,invocationSampling:new Map([[[300n,null],100],[[200n,300n],50],[[100n,200n],25],[[0n,100n],10]]),callerResetInterval:36e5,modeInterval:3e5,logsSendInterval:6e4,endpointsInterval:3e4,endpointsFirstSendWaitTime:12e4,lazyEndpointsInterval:18e5,staticNextJsEndpointsInterval:1e4,staticNextJsEndpointsMaxAttempts:12,huddBinWidth:1.2,endpointsDurationsInvestigationThresholdsInterval:6e5,remoteConfigRefreshInterval:3e5,workerStateCollectionDelay:1e4,workerGrace:6e4,teardownGrace:5e3,workerTimeout:2e4,timeoutOnRegister:6e4,timeoutOnMetrics:6e4,workerMessageTimeout:1e4,communicationBatchSize:100,writePatched:!1,defaultOff:!0,disableOnBadApiKey:!0,disableOnBadServiceName:!0,cpuTimeCollection:!1,workloadMetadata:{sendInterval:3e5,aws:{imds:{baseURL:"http://169.254.169.254/latest",tokenURI:"/api/token",identityURI:"/dynamic/instance-identity/document",lifeCycleURI:"/meta-data/instance-life-cycle",requestTimeout:5e3},metadataFile:"/run/cloud-init/instance-data.json"},kubernetes:{namespaceFile:"/var/run/secrets/kubernetes.io/serviceaccount/namespace",uuidFile:"/sys/class/dmi/id/product_uuid",podMemoryLimitFile:"/sys/fs/cgroup/memory/memory.stat",podCPULimitFile:"/sys/fs/cgroup/cpuacct/cpu.shares"}},deleteLogsAfterSending:!0,supportSourceMap:!0,editInline:!0,bundlerBuildIdVarName:"hudFileBuildID",bundlerBuildUuidNamespace:"00c1e90b-af75-4d8e-9935-68485877f759",functionUuidNamespace:p,wrapVarPrefix:v,functionInitFunctionName:`${v}i`,functionCatchFunctionName:`${v}c`,functionFinallyFunctionName:`${v}n`,callContextVarName:`${v}x`,fixStackFunctionName:`${v}s`,asyncIteratorWrapperFunctionName:`${v}w`,wrapperUserCatchFunctionName:`${v}u`,asyncWrapperFunctionName:`${v}a`,internalAsyncWrapperFunctionName:`${v}b`,frameworksToPatch:new Map([["express",{framework:s.availableFrameworks.express,enable:!0,version:"<=5",patcher:"express",enableEsbuild:!0}],[l.join("express","lib","application.js"),{framework:s.availableFrameworks.express,enable:!0,version:"<=5",patcher:"expressApplication",enableEsbuild:!0}],["router",{framework:s.availableFrameworks.express,enable:!0,version:"^2.0.0",patcher:"router",enableEsbuild:!0}],["@hapi/hapi",{framework:s.availableFrameworks.hapi,enable:!0,version:">=20.0.0 <22.0.0",patcher:"hapi"}],["koa",{framework:s.availableFrameworks.koa,enable:!0,version:"^2.0.0 || ^3.0.0",patcher:"koa"}],["fastify",{framework:s.availableFrameworks.fastify,enable:!0,version:">=4.0.0 <6",patcher:"fastify"}],["graphql/execution/execute",{framework:s.availableFrameworks.graphql,enable:!1,version:"14 - 16",patcher:"graphql"}],["http",{framework:s.availableFrameworks.http,enable:!0,version:"*",patcher:"http"}],["https",{framework:s.availableFrameworks.https,enable:!0,version:"*",patcher:"http"}],["next/dist/server/base-server",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=13.4.0",patcher:"nextjs"}],["next/dist/server/lib/module-loader/route-module-loader",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=13.4.0",patcher:"nextJsModuleLoader"}],["next/dist/compiled/next-server/pages-api.runtime.prod",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=13.4.0",patcher:"nextJsRouteModule"}],["next/dist/compiled/next-server/pages-api-turbo.runtime.prod",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=16.0.0",patcher:"nextJsRouteModule"}],["next/dist/server/config",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=13.4.0",patcher:"nextJsConfig"}],["@nestjs/core/router/router-execution-context",{framework:s.availableFrameworks.nestjs,enable:!0,version:"*",patcher:"nestjsRouterExecutionContext"}],["kafkajs",{framework:s.availableFrameworks.kafkajs,enable:"win32"!==process.platform,version:">=1.4.0",patcher:"kafkajs"}],["@confluentinc/kafka-javascript",{framework:s.availableFrameworks.confluentKafkaJs,enable:!1,version:">=1.4.0",patcher:"confluentKafkaJs"}],["@nestjs/microservices/context/rpc-context-creator",{framework:s.availableFrameworks.nestjs,enable:"win32"!==process.platform,version:">=7.0.0",patcher:"nestjsRpcContextCreator"}],[["@codegenie/serverless-express","src","frameworks","express.js"].join(l.sep),{framework:s.availableFrameworks.codegenieServerlessExpress,enable:!0,version:"^4.1.0",patcher:"codeGenieServerlessExpress",enableEsbuild:!0}],["@codegenie/serverless-express",{framework:s.availableFrameworks.codegenieServerlessExpress,enable:!0,enableEsbuild:!0}],["sqs-consumer",{framework:s.availableFrameworks.sqs,enable:!0,version:">=7.5.0",patcher:"sqsConsumer"}],[["@mondaydotcomorg/monday-sqs-consumer","sqs-consumer"].join(l.sep),{framework:s.availableFrameworks.sqs,enable:"win32"!==process.platform,version:">=5.2.2 <6",patcher:"sqsConsumer",extraInfo:{isMondayVersion:!0,srcHash:"bd9064befbf3abb9ad0e6a53b0cf721d5612d5b8d8790875c994b7ff40b951c5"}}],["serverless-http",{framework:s.availableFrameworks.serverlessHttp,enable:!0,enableEsbuild:!0}],[l.join("serverless-http","lib","framework","get-framework.js"),{framework:s.availableFrameworks.serverlessHttp,enable:!0,version:"^2.7.0",patcher:"serverlessHttp",enableEsbuild:!0}],["axios",{framework:s.availableFrameworks.axios,enable:!0,version:">0.18.0 <1.0.0 || ^1.0.0",patcher:"outbound/axios",mainFilePath:"axios/dist/node/axios.cjs",extraInfo:{isOutbound:!0}}],["node-fetch",{framework:s.availableFrameworks.nodeFetch,enable:!0,version:"^2.0.0",patcher:"outbound/nodeFetch",mainFilePath:"node-fetch/lib/index.js",extraInfo:{isOutbound:!0}}],["request",{framework:s.availableFrameworks.request,enable:!0,version:"2.88.2",patcher:"outbound/request",extraInfo:{isOutbound:!0}}],["pg",{framework:s.availableFrameworks.pg,enable:!0,version:"^8.8.0",patcher:"outbound/pg",extraInfo:{isOutbound:!0}}],["@clickhouse/client-common",{framework:s.availableFrameworks.clickhouse,enable:!1,version:"^1.10.0",patcher:"outbound/clickhouse",extraInfo:{isOutbound:!0}}],["ioredis",{framework:s.availableFrameworks.ioredis,enable:!0,version:"^4.0.0 || ^5.0.0",patcher:"outbound/ioredis",extraInfo:{isOutbound:!0}}],["mongodb",{framework:s.availableFrameworks.mongodb,enable:!0,version:">=5.0.0 <8.0.0",patcher:"outbound/mongodb",extraInfo:{isOutbound:!0}}],["mongoose",{framework:s.availableFrameworks.mongoose,enable:!0,version:">=5.0.0 <7.0.0",patcher:"outbound/mongoose",extraInfo:{isOutbound:!0,coveredByFramework:{frameworkKey:"mongodb",versionRange:">=7.0.0 <10.0.0"}}}],["p-limit",{framework:"p-limit",enable:!0,version:"^3.0.0",patcher:"internal/pLimit"}]]),communicationKeepalive:!1,communicationKeepaliveGrace:5e3,express:{routeNamesSymbol:Symbol.for("hudRoutes"),layerStateSymbol:Symbol.for("hudState"),markedSymbol:Symbol.for("hudMarked"),wrapAllCallbacks:!0},supportedNodeVersions:["18","20","21","22","24"],hudPatchedName:"hudPatched",metricSymbol:Symbol.for("hudMetric"),dynamicConfig:{aggregationInterval:3e5,aggregationFirstSendTimeout:3e4,investigationInterval:5e3,investigationFirstSendTimeout:3e4,enableInvestigation:"true"===m,investigationErrorStatusCodeRegex:n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX,enableInvestigationArgsSending:!1,investigationRateLimits:{maxSameInvestigations:2,sameInvestigationTimeWindowMs:36e5,maxTotalInvestigations:25,maxTotalInvestigationsErrorBased:25,maxTotalInvestigationsDurationBased:20,totalInvestigationTimeWindowMs:216e5,maxUniqLogs:2,executionFlowMaxLength:20,exceptionMaxLength:20,maxStringLength:1024,maxArrayLength:10,maxObjectDepth:3,maxKeyLength:30,maxUniqueSetFailureErrors:100},machineMetricsInterval:1e4,performanceMetricsInterval:6e4,reingestInterval:3e4,extraHeaders:[],enableOutboundData:"true"===process.env.HUD_ENABLE_OUTBOUND_DATA,maxHTTPRequestBodySize:1024,maxHTTPResponseBodySize:5120,blacklistParams:[],censorshipRegexes:[],forensicsBlacklistFields:[],forensicsWhitelistFields:[],maxOutboundCountWithData:process.env.HUD_MAX_OUTBOUND_WITH_DATA?parseInt(process.env.HUD_MAX_OUTBOUND_WITH_DATA):10,maxTotalOutbounds:20,functionDetachEnabled:!1,functionDetachThresholdPerSecond:5833,enableMongoDocumentData:!1,enableTeardown:!1,flushOnUncaughtException:!1,fileTimestampsLogDelayMs:12e4},machineMetricsSavedLength:2,isInvestigationEnabledByEnv:void 0!==m,suppressTraces:"true"!==process.env.HUD_DISABLE_SUPPRESS_TRACES,lambdaMinimunMemory:1024,lambdaBaseGivenTime:400,lambdaExtraGivenTimePerRequest:50,lambdaMaxGivenTime:700,throttleStatusCode:202,axiosFunctionId:c((0,u.v5)("axios",p)),nodeFetchFunctionId:c((0,u.v5)("node-fetch",p)),nodeFetchBodiesFunctionIds:{json:c((0,u.v5)("node-fetch-body-json",p)),text:c((0,u.v5)("node-fetch-body-text",p)),arrayBuffer:c((0,u.v5)("node-fetch-body-arrayBuffer",p)),blob:c((0,u.v5)("node-fetch-body-blob",p))},requestFunctionId:c((0,u.v5)("request-request",p)),requestMethodFunctionIds:{get:c((0,u.v5)("request-get",p)),head:c((0,u.v5)("request-head",p)),options:c((0,u.v5)("request-options",p)),post:c((0,u.v5)("request-post",p)),put:c((0,u.v5)("request-put",p)),patch:c((0,u.v5)("request-patch",p)),del:c((0,u.v5)("request-del",p)),delete:c((0,u.v5)("request-delete",p))},pgConnectFunctionId:c((0,u.v5)("pg-connect",p)),pgQueryFunctionId:c((0,u.v5)("pg-query",p)),pgEndFunctionId:c((0,u.v5)("pg-end",p)),clickhouseQueryFunctionId:c((0,u.v5)("clickhouse-query",p)),clickhouseExecFunctionId:c((0,u.v5)("clickhouse-exec",p)),clickhouseCommandFunctionId:c((0,u.v5)("clickhouse-command",p)),clickhouseInsertFunctionId:c((0,u.v5)("clickhouse-insert",p)),clickhouseCloseFunctionId:c((0,u.v5)("clickhouse-close",p)),functionsToInstrument:[{moduleName:"typeorm",fileToFunctionsMapping:{[l.join(l.sep,"typeorm","repository","Repository.js")]:["hasId","getId","create","merge","preload","save","remove","softRemove","recover","insert","update","upsert","delete","softDelete","restore","exist","exists","existsBy","count","countBy","sum","average","minimum","maximum","find","findBy","findAndCount","findAndCountBy","findByIds","findOne","findOneBy","findOneById","findOneOrFail","findOneByOrFail","query","clear","increment","decrement","extend"]}}],esbuildGlobalVar:"hudSGV",esbuildFunctionIdVar:"hudFI",esbuildPluginMessagePrefix:"ESBuild plugin ",esbuildMark:"modifiedByHudESBuildPlugin-",esbuildMarkLength:67,esbuildUploadSourceMapTimeout:15e3,esbuildPluginLogsChunkSize:100,esbuildPluginLogsBatchSize:10,pluginsLogEndpoint:"https://yqp37dddrsewm6wdwwpwfraxqm0shdmx.lambda-url.eu-central-1.on.aws/",uninstrumentedFilesLogThreshold:2,tsNodeConfigTimeout:1e4,allowedEditExtensions:[".ts",".cts",".mts",".js",".cjs",".mjs"],nextJsMarkVarName:g,nextJsMarkStatement:`${g} = "a"`,timeoutOnNextJsPlugin:3e4,logIntervals:{instrumentedFilesCount:5e3,sentEventsCount:12e4},cliBuildIdVarName:"hudCliBuildId",cliSdkVersionVarName:"hudCliSdkVersion"};n.hudConfig=function(e={}){return{...b,...e}}({logger:{default:{levels:{app:"info",worker:"info",instrument:"info"}},debug:{levels:{app:"debug",worker:"debug",instrument:"debug"}}},deleteLogsAfterSending:!1,communicationKeepalive:!0}),n.default=n.hudConfig;const f=process.env.HUD_DEBUG?n.hudConfig.logger.debug:n.hudConfig.logger.default;n.loggerConfig={...f,console:"true"===process.env.HUD_VERBOSE};class h extends Error{path;code;constructor(e,n){super(),this.path=e,this.code=n}}n.HudFailedReadConfigError=h},3903:e=>{e.exports=require("uuid")},5453:(e,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SDK_VERSION=void 0,n.SDK_VERSION="1.8.10"},6928:e=>{e.exports=require("path")},7089:(e,n,t)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ObjectStoreConfigSchema=void 0;const i=t(1569),a=i.z.object({type:i.z.literal("s3")}),o=i.z.object({type:i.z.literal("disk"),path:i.z.string()}),r=i.z.object({type:i.z.literal("customer_s3"),bucket:i.z.string(),region:i.z.string(),prefix:i.z.string().optional()});n.ObjectStoreConfigSchema=i.z.union([a,o,r])},8528:e=>{e.exports=require("./dto")}},n={};return function t(i){var a=n[i];if(void 0!==a)return a.exports;var o=n[i]={exports:{}};return e[i].call(o.exports,o,o.exports,t),o.exports}(2509)})());
|
|
1
|
+
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var i in t)("object"==typeof exports?exports:e)[i]=t[i]}}(global,()=>(()=>{"use strict";var e={1569:e=>{e.exports=require("zod")},2210:(e,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SDK_MODULE_NAME=void 0,n.SDK_MODULE_NAME="hud-sdk"},2509:function(e,n,t){var i=this&&this.__createBinding||(Object.create?function(e,n,t,i){void 0===i&&(i=t);var a=Object.getOwnPropertyDescriptor(n,t);a&&!("get"in a?!n.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,a)}:function(e,n,t,i){void 0===i&&(i=t),e[i]=n[t]}),a=this&&this.__exportStar||function(e,n){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(n,t)||i(n,e,t)};Object.defineProperty(n,"__esModule",{value:!0}),n.SDK_VERSION=n.SDK_MODULE_NAME=void 0,a(t(2887),n),a(t(2570),n);var o=t(2210);Object.defineProperty(n,"SDK_MODULE_NAME",{enumerable:!0,get:function(){return o.SDK_MODULE_NAME}}),a(t(7089),n);var r=t(5453);Object.defineProperty(n,"SDK_VERSION",{enumerable:!0,get:function(){return r.SDK_VERSION}})},2570:(e,n,t)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.refreshInvestigationErrorStatusCodeRegex=function(e,n,t){if(null==e)return;const o=i.HudDynamicConfigSchema.deepPartial().safeParse(e);if(!o.success)return;const r=o.data?.investigationErrorStatusCodeRegex;void 0!==r&&r!==n.dynamicConfig.investigationErrorStatusCodeRegex&&a(r,n,t,"Periodic refresh - Dynamic configuration updated - investigationErrorStatusCodeRegex")},n.refreshInvestigationEnabled=function(e,n,t){if(null==e)return;const a=i.HudDynamicConfigSchema.deepPartial().safeParse(e);if(!a.success)return;const o=a.data?.enableInvestigation;if(void 0===o)return;o!==globalThis.hudEnableInvestigation&&(n.isInvestigationEnabledByEnv||(globalThis.hudEnableInvestigation=o,t.info("Periodic refresh - Dynamic configuration updated - enableInvestigation",{hudEnableInvestigation:o})))},n.updateDynamicConfig=function(e,n,t){const r=i.HudDynamicConfigSchema.deepPartial().safeParse(e);if(!r.success)return t.error("Dynamic configuration not updated - Invalid configuration override",{remoteConfigParseResult:r,remoteConfig:e}),n.dynamicConfig;const s=o(n.dynamicConfig,r.data);return void 0!==s.enableInvestigation&&s.enableInvestigation!==n.dynamicConfig.enableInvestigation&&(t.info("Dynamic configuration updated - enableInvestigation",{hudEnableInvestigation:s.enableInvestigation}),n.isInvestigationEnabledByEnv||(globalThis.hudEnableInvestigation=s.enableInvestigation)),void 0!==s.enableInvestigationArgsSending&&s.enableInvestigationArgsSending!==n.dynamicConfig.enableInvestigationArgsSending&&(t.info("Dynamic configuration updated - enableInvestigationArgsSending",{hudEnableInvestigationArgsSending:s.enableInvestigationArgsSending}),globalThis.hudEnableInvestigationArgsSending=s.enableInvestigationArgsSending),void 0!==s?.investigationRateLimits?.executionFlowMaxLength&&s?.investigationRateLimits?.executionFlowMaxLength!==n.dynamicConfig.investigationRateLimits.executionFlowMaxLength&&(globalThis.hudExecutionFlowMaxLength=s.investigationRateLimits.executionFlowMaxLength),void 0!==s?.investigationRateLimits?.exceptionMaxLength&&s?.investigationRateLimits?.exceptionMaxLength!==n.dynamicConfig.investigationRateLimits.exceptionMaxLength&&(globalThis.hudExceptionMaxLength=s.investigationRateLimits.exceptionMaxLength),void 0!==r.data.investigationErrorStatusCodeRegex&&s.investigationErrorStatusCodeRegex!==n.dynamicConfig.investigationErrorStatusCodeRegex&&a(s.investigationErrorStatusCodeRegex,n,t,"Dynamic configuration updated - investigationErrorStatusCodeRegex",s),s};const i=t(2887);function a(e,n,t,a,o){const{appliedRegex:r,usedDefault:s}=(0,i.updateInvestigationErrorStatusCodePatternGlobal)(e);n.dynamicConfig.investigationErrorStatusCodeRegex=r,o&&(o.investigationErrorStatusCodeRegex=r),s&&e!==r?t.warning("Invalid investigationErrorStatusCodeRegex, using default",{investigationErrorStatusCodeRegex:e,appliedRegex:r}):t.info(a,{investigationErrorStatusCodeRegex:r})}function o(e,n){if(null===n||"object"!=typeof n)return n;if(Array.isArray(e)&&Array.isArray(n))return n;const t={...e};for(const i in n){const a=e[i],r=n[i];t[i]=o(a,r)}return t}},2887:function(e,n,t){var i,a=this&&this.__createBinding||(Object.create?function(e,n,t,i){void 0===i&&(i=t);var a=Object.getOwnPropertyDescriptor(n,t);a&&!("get"in a?!n.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,i,a)}:function(e,n,t,i){void 0===i&&(i=t),e[i]=n[t]}),o=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),r=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var n=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[n.length]=t);return n},i(e)},function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var t=i(e),r=0;r<t.length;r++)"default"!==t[r]&&a(n,e,t[r]);return o(n,e),n});Object.defineProperty(n,"__esModule",{value:!0}),n.HudFailedReadConfigError=n.loggerConfig=n.hudConfig=n.HudDynamicConfigSchema=n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX=void 0,n.functionUuidToBase64=c,n.getModulesToTraceFromEnv=function(){const e=process.env.HUD_MONITOR_MODULES||process.env.HUD_INCLUDE_MODULES;if(e)return e.split(",")},n.getExcludeDirsFromEnv=function(){const e=process.env.HUD_EXCLUDE_DIRS;if(e)return e.split(",")},n.getFrameworksToEnableFromEnv=function(){const e=process.env.HUD_ENABLE_FRAMEWORKS;let n;if(e)try{n=s.availableFrameworksSchema.parse(JSON.parse(e))}catch{n=new Map}return n},n.isValidParam=function(e){return null!=e&&""!==e&&"string"==typeof e},n.updateInvestigationRateLimitGlobals=function(){globalThis.hudMaxSameInvestigations=n.hudConfig.dynamicConfig.investigationRateLimits.maxSameInvestigations,globalThis.hudMaxTotalInvestigations=n.hudConfig.dynamicConfig.investigationRateLimits.maxTotalInvestigations,globalThis.hudSameInvestigationTimeWindowNs=BigInt(n.hudConfig.dynamicConfig.investigationRateLimits.sameInvestigationTimeWindowMs)*BigInt(1e6),globalThis.hudTotalInvestigationTimeWindowNs=BigInt(n.hudConfig.dynamicConfig.investigationRateLimits.totalInvestigationTimeWindowMs)*BigInt(1e6)},n.updateInvestigationErrorStatusCodePatternGlobal=function(e=n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX){try{return globalThis.hudInvestigationErrorStatusCodePattern=new RegExp(`^(?:${e})$`),{appliedRegex:e,usedDefault:e===n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX}}catch{return globalThis.hudInvestigationErrorStatusCodePattern=new RegExp(`^(?:${n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX})$`),{appliedRegex:n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX,usedDefault:!0}}},n.matchesInvestigationErrorStatusCode=function(e){return null!=e&&globalThis.hudInvestigationErrorStatusCodePattern.test(String(e))};const s=t(8528),l=r(t(6928)),u=t(3903),d=t(1569);function c(e){return Buffer.from((0,u.parse)(e)).toString("base64").slice(0,22)}const g="globalThis._hudMark";n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX="^5\\d\\d$",n.HudDynamicConfigSchema=d.z.object({aggregationInterval:d.z.number(),aggregationFirstSendTimeout:d.z.number(),investigationInterval:d.z.number(),investigationFirstSendTimeout:d.z.number(),enableInvestigation:d.z.boolean(),investigationErrorStatusCodeRegex:d.z.string(),enableInvestigationArgsSending:d.z.boolean(),investigationRateLimits:d.z.object({maxSameInvestigations:d.z.number().int().positive(),sameInvestigationTimeWindowMs:d.z.number().int().positive(),maxTotalInvestigations:d.z.number().int().positive(),maxTotalInvestigationsErrorBased:d.z.number().int().positive(),maxTotalInvestigationsDurationBased:d.z.number().int().positive(),totalInvestigationTimeWindowMs:d.z.number().int().positive(),maxUniqLogs:d.z.number().int().positive(),maxStringLength:d.z.number().int().positive(),maxArrayLength:d.z.number().int().positive(),maxObjectDepth:d.z.number().int().positive(),maxKeyLength:d.z.number().int().positive(),executionFlowMaxLength:d.z.number().int().positive(),exceptionMaxLength:d.z.number().int().positive(),maxUniqueSetFailureErrors:d.z.number().int().positive()}),machineMetricsInterval:d.z.number().int().positive(),blacklistParams:d.z.array(d.z.string()),forensicsBlacklistFields:d.z.array(d.z.string()),forensicsWhitelistFields:d.z.array(d.z.string()),censorshipRegexes:d.z.array(d.z.object({regex:d.z.string(),replacement:d.z.string()})),reingestInterval:d.z.number().int().positive(),extraHeaders:d.z.array(d.z.string()),performanceMetricsInterval:d.z.number().int().positive(),enableOutboundData:d.z.boolean(),maxTotalOutbounds:d.z.number().int().positive(),maxOutboundCountWithData:d.z.number().int().positive(),maxHTTPRequestBodySize:d.z.number().int().positive(),maxHTTPResponseBodySize:d.z.number().int().positive(),functionDetachEnabled:d.z.boolean(),functionDetachThresholdPerSecond:d.z.number().int().positive(),enableMongoDocumentData:d.z.boolean(),enableTeardown:d.z.boolean(),flushOnUncaughtException:d.z.boolean(),fileTimestampsLogDelayMs:d.z.number().int().positive()});const m=process.env.HUD_ENABLE_INVESTIGATION,v="_HUD",p="94a210f3-861c-4e18-ab27-6b6c19437c9d",b={sink:{url:process.env.HUD_HOST||"https://api-prod.hud.io",timeout:5e3,session_attr:"X-Session-ID"},endpoints:{init:"sink/init",send:"sink/send",batch:"sink/batch",logs:"sink/logs",sessionslessLogs:"sink/sessionless-logs",fatalError:"sink/redline",getMode:"sink/getMode",getRemoteConfig:"sink/remote-config/get",fileDeclarations:"sink/file-declarations",sourceMap:"sink/sourcemap",storeObject:"sink/objects/store",getUploadUrls:"sink/registry/get-upload-urls",triggerReingest:"sink/registry/reingest",validateToken:"sink/registry/validate",fileDeclarationsCi:"sink/registry/file-declarations",completed:"sink/registry/completed",endpointsDurationsInvestigationThresholds:"sink/endpoint-configuration",getKnownDetachedFunctions:"sink/known-detached-functions/get",setDetachedFunctions:"sink/known-detached-functions/set"},logger:{default:{levels:{app:"warning",worker:"warning",instrument:"warning"}},debug:{levels:{app:"debug",worker:"debug",instrument:"debug"}}},investigation:{objectVersion:"1.0.2",store:{type:"s3"}},userConfig:{lean:{value:!1,source:"DEFAULT"},minPodMemoryMB:{value:250,source:"DEFAULT"},maxMappedFunctions:{value:5e4,source:"DEFAULT"},maxFileSizeBytes:{value:2831155,source:"DEFAULT"},maxTimeUntilInitSessionMs:{value:3e4,source:"DEFAULT"},includeModules:{value:[],source:"DEFAULT"},excludeDirs:{value:[],source:"DEFAULT"},disableRuntimeInstrumentation:{value:!1,source:"DEFAULT"},disableParametersExtraction:{value:!1,source:"DEFAULT"},disableDetachedFunctions:{value:!1,source:"DEFAULT"},enableVarHoisting:{value:!1,source:"DEFAULT"},instrumentOneLiners:{value:!0,source:"DEFAULT"}},loggerWorkerPortSizeLimit:1e4,customerLoggerLevel:"info",logDirectory:process.env.HUD_LOG_DIR,invocationSampling:new Map([[[300n,null],100],[[200n,300n],50],[[100n,200n],25],[[0n,100n],10]]),callerResetInterval:36e5,modeInterval:3e5,logsSendInterval:6e4,endpointsInterval:3e4,endpointsFirstSendWaitTime:12e4,lazyEndpointsInterval:18e5,staticNextJsEndpointsInterval:1e4,staticNextJsEndpointsMaxAttempts:12,huddBinWidth:1.2,endpointsDurationsInvestigationThresholdsInterval:6e5,remoteConfigRefreshInterval:3e5,workerStateCollectionDelay:1e4,workerGrace:6e4,teardownGrace:5e3,workerTimeout:2e4,timeoutOnRegister:6e4,timeoutOnMetrics:6e4,workerMessageTimeout:1e4,communicationBatchSize:100,writePatched:!1,defaultOff:!0,disableOnBadApiKey:!0,disableOnBadServiceName:!0,cpuTimeCollection:!1,workloadMetadata:{sendInterval:3e5,aws:{imds:{baseURL:"http://169.254.169.254/latest",tokenURI:"/api/token",identityURI:"/dynamic/instance-identity/document",lifeCycleURI:"/meta-data/instance-life-cycle",requestTimeout:5e3},metadataFile:"/run/cloud-init/instance-data.json"},kubernetes:{namespaceFile:"/var/run/secrets/kubernetes.io/serviceaccount/namespace",uuidFile:"/sys/class/dmi/id/product_uuid",podMemoryLimitFile:"/sys/fs/cgroup/memory/memory.stat",podCPULimitFile:"/sys/fs/cgroup/cpuacct/cpu.shares"}},deleteLogsAfterSending:!0,supportSourceMap:!0,editInline:!0,bundlerBuildIdVarName:"hudFileBuildID",bundlerBuildUuidNamespace:"00c1e90b-af75-4d8e-9935-68485877f759",functionUuidNamespace:p,wrapVarPrefix:v,functionInitFunctionName:`${v}i`,functionCatchFunctionName:`${v}c`,functionFinallyFunctionName:`${v}n`,callContextVarName:`${v}x`,fixStackFunctionName:`${v}s`,asyncIteratorWrapperFunctionName:`${v}w`,wrapperUserCatchFunctionName:`${v}u`,asyncWrapperFunctionName:`${v}a`,internalAsyncWrapperFunctionName:`${v}b`,frameworksToPatch:new Map([["express",{framework:s.availableFrameworks.express,enable:!0,version:"<=5",patcher:"express",enableEsbuild:!0}],[l.join("express","lib","application.js"),{framework:s.availableFrameworks.express,enable:!0,version:"<=5",patcher:"expressApplication",enableEsbuild:!0}],["router",{framework:s.availableFrameworks.express,enable:!0,version:"^2.0.0",patcher:"router",enableEsbuild:!0}],["@hapi/hapi",{framework:s.availableFrameworks.hapi,enable:!0,version:">=20.0.0 <22.0.0",patcher:"hapi"}],["koa",{framework:s.availableFrameworks.koa,enable:!0,version:"^2.0.0 || ^3.0.0",patcher:"koa"}],["fastify",{framework:s.availableFrameworks.fastify,enable:!0,version:">=4.0.0 <6",patcher:"fastify"}],["graphql/execution/execute",{framework:s.availableFrameworks.graphql,enable:!1,version:"14 - 16",patcher:"graphql"}],["http",{framework:s.availableFrameworks.http,enable:!0,version:"*",patcher:"http"}],["https",{framework:s.availableFrameworks.https,enable:!0,version:"*",patcher:"http"}],["next/dist/server/base-server",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=13.4.0",patcher:"nextjs"}],["next/dist/server/lib/module-loader/route-module-loader",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=13.4.0",patcher:"nextJsModuleLoader"}],["next/dist/compiled/next-server/pages-api.runtime.prod",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=13.4.0",patcher:"nextJsRouteModule"}],["next/dist/compiled/next-server/pages-api-turbo.runtime.prod",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=16.0.0",patcher:"nextJsRouteModule"}],["next/dist/server/config",{framework:s.availableFrameworks.nextjs,enable:!1,version:">=13.4.0",patcher:"nextJsConfig"}],["@nestjs/core/router/router-execution-context",{framework:s.availableFrameworks.nestjs,enable:!0,version:"*",patcher:"nestjsRouterExecutionContext"}],["kafkajs",{framework:s.availableFrameworks.kafkajs,enable:"win32"!==process.platform,version:">=1.4.0",patcher:"kafkajs"}],["@confluentinc/kafka-javascript",{framework:s.availableFrameworks.confluentKafkaJs,enable:!1,version:">=1.4.0",patcher:"confluentKafkaJs"}],["@nestjs/microservices/context/rpc-context-creator",{framework:s.availableFrameworks.nestjs,enable:"win32"!==process.platform,version:">=7.0.0",patcher:"nestjsRpcContextCreator"}],[["@codegenie/serverless-express","src","frameworks","express.js"].join(l.sep),{framework:s.availableFrameworks.codegenieServerlessExpress,enable:!0,version:"^4.1.0",patcher:"codeGenieServerlessExpress",enableEsbuild:!0}],["@codegenie/serverless-express",{framework:s.availableFrameworks.codegenieServerlessExpress,enable:!0,enableEsbuild:!0}],["sqs-consumer",{framework:s.availableFrameworks.sqs,enable:!0,version:">=7.5.0",patcher:"sqsConsumer"}],[["@mondaydotcomorg/monday-sqs-consumer","sqs-consumer"].join(l.sep),{framework:s.availableFrameworks.sqs,enable:"win32"!==process.platform,version:">=5.2.2 <6",patcher:"sqsConsumer",extraInfo:{isMondayVersion:!0,srcHash:"bd9064befbf3abb9ad0e6a53b0cf721d5612d5b8d8790875c994b7ff40b951c5"}}],["serverless-http",{framework:s.availableFrameworks.serverlessHttp,enable:!0,enableEsbuild:!0}],[l.join("serverless-http","lib","framework","get-framework.js"),{framework:s.availableFrameworks.serverlessHttp,enable:!0,version:"^2.7.0",patcher:"serverlessHttp",enableEsbuild:!0}],["axios",{framework:s.availableFrameworks.axios,enable:!0,version:">0.18.0 <1.0.0 || ^1.0.0",patcher:"outbound/axios",mainFilePath:"axios/dist/node/axios.cjs",extraInfo:{isOutbound:!0}}],["node-fetch",{framework:s.availableFrameworks.nodeFetch,enable:!0,version:"^2.0.0",patcher:"outbound/nodeFetch",mainFilePath:"node-fetch/lib/index.js",extraInfo:{isOutbound:!0}}],["request",{framework:s.availableFrameworks.request,enable:!0,version:"2.88.2",patcher:"outbound/request",extraInfo:{isOutbound:!0}}],["pg",{framework:s.availableFrameworks.pg,enable:!0,version:"^8.8.0",patcher:"outbound/pg",extraInfo:{isOutbound:!0}}],["@clickhouse/client-common",{framework:s.availableFrameworks.clickhouse,enable:!1,version:"^1.10.0",patcher:"outbound/clickhouse",extraInfo:{isOutbound:!0}}],["ioredis",{framework:s.availableFrameworks.ioredis,enable:!0,version:"^4.0.0 || ^5.0.0",patcher:"outbound/ioredis",extraInfo:{isOutbound:!0}}],["mongodb",{framework:s.availableFrameworks.mongodb,enable:!0,version:">=5.0.0 <8.0.0",patcher:"outbound/mongodb",extraInfo:{isOutbound:!0}}],["mongoose",{framework:s.availableFrameworks.mongoose,enable:!0,version:">=5.0.0 <7.0.0",patcher:"outbound/mongoose",extraInfo:{isOutbound:!0,coveredByFramework:{frameworkKey:"mongodb",versionRange:">=7.0.0 <10.0.0"}}}],["p-limit",{framework:"p-limit",enable:!0,version:"^3.0.0",patcher:"internal/pLimit"}]]),communicationKeepalive:!1,communicationKeepaliveGrace:5e3,express:{routeNamesSymbol:Symbol.for("hudRoutes"),layerStateSymbol:Symbol.for("hudState"),markedSymbol:Symbol.for("hudMarked"),wrapAllCallbacks:!0},supportedNodeVersions:["18","20","21","22","24"],hudPatchedName:"hudPatched",metricSymbol:Symbol.for("hudMetric"),dynamicConfig:{aggregationInterval:3e5,aggregationFirstSendTimeout:3e4,investigationInterval:5e3,investigationFirstSendTimeout:3e4,enableInvestigation:"true"===m,investigationErrorStatusCodeRegex:n.DEFAULT_INVESTIGATION_ERROR_STATUS_CODE_REGEX,enableInvestigationArgsSending:!1,investigationRateLimits:{maxSameInvestigations:2,sameInvestigationTimeWindowMs:36e5,maxTotalInvestigations:25,maxTotalInvestigationsErrorBased:25,maxTotalInvestigationsDurationBased:20,totalInvestigationTimeWindowMs:216e5,maxUniqLogs:2,executionFlowMaxLength:20,exceptionMaxLength:20,maxStringLength:1024,maxArrayLength:10,maxObjectDepth:3,maxKeyLength:30,maxUniqueSetFailureErrors:100},machineMetricsInterval:1e4,performanceMetricsInterval:6e4,reingestInterval:3e4,extraHeaders:[],enableOutboundData:"true"===process.env.HUD_ENABLE_OUTBOUND_DATA,maxHTTPRequestBodySize:1024,maxHTTPResponseBodySize:5120,blacklistParams:[],censorshipRegexes:[],forensicsBlacklistFields:[],forensicsWhitelistFields:[],maxOutboundCountWithData:process.env.HUD_MAX_OUTBOUND_WITH_DATA?parseInt(process.env.HUD_MAX_OUTBOUND_WITH_DATA):10,maxTotalOutbounds:20,functionDetachEnabled:!1,functionDetachThresholdPerSecond:5833,enableMongoDocumentData:!1,enableTeardown:!1,flushOnUncaughtException:!1,fileTimestampsLogDelayMs:12e4},machineMetricsSavedLength:2,isInvestigationEnabledByEnv:void 0!==m,suppressTraces:"true"!==process.env.HUD_DISABLE_SUPPRESS_TRACES,lambdaMinimunMemory:1024,lambdaBaseGivenTime:400,lambdaExtraGivenTimePerRequest:50,lambdaMaxGivenTime:700,throttleStatusCode:202,axiosFunctionId:c((0,u.v5)("axios",p)),nodeFetchFunctionId:c((0,u.v5)("node-fetch",p)),nodeFetchBodiesFunctionIds:{json:c((0,u.v5)("node-fetch-body-json",p)),text:c((0,u.v5)("node-fetch-body-text",p)),arrayBuffer:c((0,u.v5)("node-fetch-body-arrayBuffer",p)),blob:c((0,u.v5)("node-fetch-body-blob",p))},requestFunctionId:c((0,u.v5)("request-request",p)),requestMethodFunctionIds:{get:c((0,u.v5)("request-get",p)),head:c((0,u.v5)("request-head",p)),options:c((0,u.v5)("request-options",p)),post:c((0,u.v5)("request-post",p)),put:c((0,u.v5)("request-put",p)),patch:c((0,u.v5)("request-patch",p)),del:c((0,u.v5)("request-del",p)),delete:c((0,u.v5)("request-delete",p))},pgConnectFunctionId:c((0,u.v5)("pg-connect",p)),pgQueryFunctionId:c((0,u.v5)("pg-query",p)),pgEndFunctionId:c((0,u.v5)("pg-end",p)),clickhouseQueryFunctionId:c((0,u.v5)("clickhouse-query",p)),clickhouseExecFunctionId:c((0,u.v5)("clickhouse-exec",p)),clickhouseCommandFunctionId:c((0,u.v5)("clickhouse-command",p)),clickhouseInsertFunctionId:c((0,u.v5)("clickhouse-insert",p)),clickhouseCloseFunctionId:c((0,u.v5)("clickhouse-close",p)),functionsToInstrument:[{moduleName:"typeorm",fileToFunctionsMapping:{[l.join(l.sep,"typeorm","repository","Repository.js")]:["hasId","getId","create","merge","preload","save","remove","softRemove","recover","insert","update","upsert","delete","softDelete","restore","exist","exists","existsBy","count","countBy","sum","average","minimum","maximum","find","findBy","findAndCount","findAndCountBy","findByIds","findOne","findOneBy","findOneById","findOneOrFail","findOneByOrFail","query","clear","increment","decrement","extend"]}}],esbuildGlobalVar:"hudSGV",esbuildFunctionIdVar:"hudFI",esbuildPluginMessagePrefix:"ESBuild plugin ",esbuildMark:"modifiedByHudESBuildPlugin-",esbuildMarkLength:67,esbuildUploadSourceMapTimeout:15e3,esbuildPluginLogsChunkSize:100,esbuildPluginLogsBatchSize:10,pluginsLogEndpoint:"https://yqp37dddrsewm6wdwwpwfraxqm0shdmx.lambda-url.eu-central-1.on.aws/",uninstrumentedFilesLogThreshold:2,tsNodeConfigTimeout:1e4,allowedEditExtensions:[".ts",".cts",".mts",".js",".cjs",".mjs"],nextJsMarkVarName:g,nextJsMarkStatement:`${g} = "a"`,timeoutOnNextJsPlugin:3e4,logIntervals:{instrumentedFilesCount:5e3,sentEventsCount:12e4},cliBuildIdVarName:"hudCliBuildId",cliSdkVersionVarName:"hudCliSdkVersion"};n.hudConfig=function(e={}){return{...b,...e}}({logger:{default:{levels:{app:"info",worker:"info",instrument:"info"}},debug:{levels:{app:"debug",worker:"debug",instrument:"debug"}}},deleteLogsAfterSending:!1,communicationKeepalive:!0}),n.default=n.hudConfig;const f=process.env.HUD_DEBUG?n.hudConfig.logger.debug:n.hudConfig.logger.default;n.loggerConfig={...f,console:"true"===process.env.HUD_VERBOSE};class h extends Error{path;code;constructor(e,n){super(),this.path=e,this.code=n}}n.HudFailedReadConfigError=h},3903:e=>{e.exports=require("uuid")},5453:(e,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SDK_VERSION=void 0,n.SDK_VERSION="1.8.11"},6928:e=>{e.exports=require("path")},7089:(e,n,t)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ObjectStoreConfigSchema=void 0;const i=t(1569),a=i.z.object({type:i.z.literal("s3")}),o=i.z.object({type:i.z.literal("disk"),path:i.z.string()}),r=i.z.object({type:i.z.literal("customer_s3"),bucket:i.z.string(),region:i.z.string(),prefix:i.z.string().optional()});n.ObjectStoreConfigSchema=i.z.union([a,o,r])},8528:e=>{e.exports=require("./dto")}},n={};return function t(i){var a=n[i];if(void 0!==a)return a.exports;var o=n[i]={exports:{}};return e[i].call(o.exports,o,o.exports,t),o.exports}(2509)})());
|
|
2
2
|
//# sourceMappingURL=config.js.map
|
package/dist/cjs/dto.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(global,()=>(()=>{"use strict";var e={765:(e,t)=>{var o,n;Object.defineProperty(t,"__esModule",{value:!0}),t.HudSessionInitStatus=t.HudRunningMode=t.KeepAliveMessage=void 0,t.KeepAliveMessage={msg:"keep-alive"},function(e){e[e.detached=0]="detached",e[e.disabled=1]="disabled",e[e.enabled=2]="enabled"}(o||(t.HudRunningMode=o={})),function(e){e[e.success=0]="success",e[e.throttled=1]="throttled"}(n||(t.HudSessionInitStatus=n={}))},878:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLSupportedOperations=void 0,function(e){e.query="query",e.mutation="mutation",e.subscription="subscription"}(o||(t.GraphQLSupportedOperations=o={}))},1569:e=>{e.exports=require("zod")},2176:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3487:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(t,o);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,r)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),r(o(7789),t),r(o(8086),t),r(o(7935),t),r(o(6910),t),r(o(2176),t),r(o(9107),t),r(o(7022),t),r(o(6604),t),r(o(4909),t),r(o(878),t),r(o(8377),t),r(o(8054),t),r(o(6328),t),r(o(6413),t),r(o(6364),t),r(o(765),t)},4909:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6328:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6364:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HudSessionOptionsSchema=t.HudOptionsSchema=void 0;const n=o(1569),r=o(7789);t.HudOptionsSchema=n.z.object({includeModules:n.z.array(n.z.string()).optional(),excludeDirs:n.z.array(n.z.string()).optional(),enableFrameworks:r.availableFrameworksSchema.optional(),maxMappedFunctions:n.z.number().optional(),minPodMemoryMB:n.z.number().optional(),maxFileSizeBytes:n.z.number().optional(),maxTimeUntilInitSessionMs:n.z.number().optional(),verbose:n.z.boolean().optional(),disableSourceMapsResolution:n.z.boolean().optional(),disableRuntimeInstrumentation:n.z.boolean().optional(),disableParametersExtraction:n.z.boolean().optional(),disableDetachedFunctions:n.z.boolean().optional(),customForensicsStorage:n.z.object({bucket:n.z.string(),region:n.z.string(),prefix:n.z.string().optional()}).optional(),flushOnExit:n.z.boolean().optional(),flushOnUncaughtException:n.z.boolean().optional(),customOptions:n.z.record(n.z.string(),n.z.string()).optional()}),t.HudSessionOptionsSchema=n.z.object({tags:n.z.record(n.z.string(),n.z.string()).optional()})},6413:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6604:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6910:(e,t)=>{var o,n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.EntityType=t.ArgumentTypes=t.ParameterTypes=void 0,function(e){e.Identifier="Identifier",e.RestElement="RestElement",e.ArrayPattern="ArrayPattern",e.AssignmentPattern="AssignmentPattern",e.ObjectPattern="ObjectPattern",e.ObjectProperty="ObjectProperty"}(o||(t.ParameterTypes=o={})),function(e){e.StringLiteral="StringLiteral",e.Identifier="Identifier",e.TemplateString="TemplateString"}(n||(t.ArgumentTypes=n={})),function(e){e.FunctionDeclaration="functionDeclaration",e.FunctionExpression="functionExpression",e.FunctionArrow="functionArrow",e.ClassMethod="classMethod",e.ObjectMethod="objectMethod",e.ClassPrivateMethod="classPrivateMethod",e.ClassDeclaration="classDeclaration",e.ClassExpression="classExpression",e.ObjectExpression="objectExpression",e.Program="program",e.ForLoop="forLoop",e.ForBlock="forBlock",e.ForTest="forTest",e.Block="block",e.While="while",e.DoWhile="doWhile",e.Do="Do",e.WhileTest="whileTest",e.Switch="switch",e.SwitchCase="switchCase",e.Catch="catch",e.With="with",e.If="if",e.IfTest="ifTest",e.IfConsequent="ifConsequent",e.IfAlternate="ifAlternate",e.TryCatch="tryCatch",e.Try="try",e.Finally="finally",e.Other="other",e.File="file"}(r||(t.EntityType=r={}))},7022:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.Format=t.FUNCTION_DECLARATION_VERSION=void 0,t.isSupportedFormat=function(e){return Object.values(o).includes(e)},t.FUNCTION_DECLARATION_VERSION="1.1.3",function(e){e.cjs="commonjs",e.esm="module",e.ts="typescript",e.moduleTypescript="module-typescript",e.commonjsTypescript="commonjs-typescript"}(o||(t.Format=o={}))},7789:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.availableFrameworksSchema=t.availableFrameworks=void 0;const n=o(1569);t.availableFrameworks={axios:"axios",pg:"pg",ioredis:"ioredis",nodeFetch:"nodeFetch",request:"request",express:"express",fastify:"fastify",hapi:"hapi",koa:"koa",graphql:"graphql",http:"http",https:"https",nextjs:"nextjs",nestjs:"nestjs",kafkajs:"kafkajs",confluentKafkaJs:"confluentKafkaJs",codegenieServerlessExpress:"codegenieServerlessExpress",sqs:"sqs",serverlessHttp:"serverlessHttp",mongodb:"mongodb",mongoose:"mongoose",clickhouse:"clickhouse"},t.availableFrameworksSchema=n.z.union([n.z.map(n.z.nativeEnum(t.availableFrameworks),n.z.boolean()),n.z.record(n.z.nativeEnum(t.availableFrameworks),n.z.boolean())]).transform(e=>e instanceof Map?e:new Map(Object.entries(e)))},7935:(e,t)=>{function o(e,t){return t?t instanceof RegExp?e+t.toString():("/"===t[t.length-1]&&t.length>1&&(t=t.slice(0,-1)),(t=e+t).replace(/\/{2,}/g,"/")):t}Object.defineProperty(t,"__esModule",{value:!0}),t.EndpointDeclaration=void 0,t.EndpointDeclaration=class{flow_id;methods;framework;partial_path;path;constructor(e,t,n,r,i,s){this.flow_id=e,this.methods=t,this.framework=n,this.partial_path=s,r||(r=""),this.path=o(r,i),this.partial_path=o(r,s)}}},8054:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8086:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8377:(e,t)=>{var o,n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.OutboundType=t.InvestigationType=t.InvestigationStatus=void 0,function(e){e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Cleared=3]="Cleared"}(o||(t.InvestigationStatus=o={})),function(e){e.HTTP="http",e.SQS="sqs",e.Kafka="kafka",e.GraphQL="graphql"}(n||(t.InvestigationType=n={})),function(e){e.HTTP="http",e.DB="db",e.REDIS="redis",e.MONGO="mongo"}(r||(t.OutboundType=r={}))},9107:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.HttpEndReason=void 0,function(e){e.ServerTimeout="http.server_timeout",e.ClientTimeout="http.client_timeout",e.ResponseAborted="http.response_aborted"}(o||(t.HttpEndReason=o={}))}},t={};return function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,o),i.exports}(3487)})());
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(global,()=>(()=>{"use strict";var e={765:(e,t)=>{var o,n;Object.defineProperty(t,"__esModule",{value:!0}),t.HudSessionInitStatus=t.HudRunningMode=t.KeepAliveMessage=void 0,t.KeepAliveMessage={msg:"keep-alive"},function(e){e[e.detached=0]="detached",e[e.disabled=1]="disabled",e[e.enabled=2]="enabled"}(o||(t.HudRunningMode=o={})),function(e){e[e.success=0]="success",e[e.throttled=1]="throttled"}(n||(t.HudSessionInitStatus=n={}))},878:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLSupportedOperations=void 0,function(e){e.query="query",e.mutation="mutation",e.subscription="subscription"}(o||(t.GraphQLSupportedOperations=o={}))},1569:e=>{e.exports=require("zod")},2176:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3487:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(t,o);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,r)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),r(o(7789),t),r(o(8086),t),r(o(7935),t),r(o(6910),t),r(o(2176),t),r(o(9107),t),r(o(7022),t),r(o(6604),t),r(o(4909),t),r(o(878),t),r(o(8377),t),r(o(8054),t),r(o(6328),t),r(o(6413),t),r(o(6364),t),r(o(765),t)},4909:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6328:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6364:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HudSessionOptionsSchema=t.HudOptionsSchema=void 0;const n=o(1569),r=o(7789);t.HudOptionsSchema=n.z.object({includeModules:n.z.array(n.z.string()).optional(),excludeDirs:n.z.array(n.z.string()).optional(),enableFrameworks:r.availableFrameworksSchema.optional(),maxMappedFunctions:n.z.number().optional(),minPodMemoryMB:n.z.number().optional(),maxFileSizeBytes:n.z.number().optional(),maxTimeUntilInitSessionMs:n.z.number().optional(),verbose:n.z.boolean().optional(),disableSourceMapsResolution:n.z.boolean().optional(),disableRuntimeInstrumentation:n.z.boolean().optional(),disableParametersExtraction:n.z.boolean().optional(),disableDetachedFunctions:n.z.boolean().optional(),customForensicsStorage:n.z.object({bucket:n.z.string(),region:n.z.string(),prefix:n.z.string().optional()}).optional(),flushOnExit:n.z.boolean().optional(),flushOnUncaughtException:n.z.boolean().optional(),customOptions:n.z.record(n.z.string(),n.z.string()).optional()}),t.HudSessionOptionsSchema=n.z.object({tags:n.z.record(n.z.string(),n.z.string()).optional(),deploymentId:n.z.string().optional()})},6413:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6604:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6910:(e,t)=>{var o,n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.EntityType=t.ArgumentTypes=t.ParameterTypes=void 0,function(e){e.Identifier="Identifier",e.RestElement="RestElement",e.ArrayPattern="ArrayPattern",e.AssignmentPattern="AssignmentPattern",e.ObjectPattern="ObjectPattern",e.ObjectProperty="ObjectProperty"}(o||(t.ParameterTypes=o={})),function(e){e.StringLiteral="StringLiteral",e.Identifier="Identifier",e.TemplateString="TemplateString"}(n||(t.ArgumentTypes=n={})),function(e){e.FunctionDeclaration="functionDeclaration",e.FunctionExpression="functionExpression",e.FunctionArrow="functionArrow",e.ClassMethod="classMethod",e.ObjectMethod="objectMethod",e.ClassPrivateMethod="classPrivateMethod",e.ClassDeclaration="classDeclaration",e.ClassExpression="classExpression",e.ObjectExpression="objectExpression",e.Program="program",e.ForLoop="forLoop",e.ForBlock="forBlock",e.ForTest="forTest",e.Block="block",e.While="while",e.DoWhile="doWhile",e.Do="Do",e.WhileTest="whileTest",e.Switch="switch",e.SwitchCase="switchCase",e.Catch="catch",e.With="with",e.If="if",e.IfTest="ifTest",e.IfConsequent="ifConsequent",e.IfAlternate="ifAlternate",e.TryCatch="tryCatch",e.Try="try",e.Finally="finally",e.Other="other",e.File="file"}(r||(t.EntityType=r={}))},7022:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.Format=t.FUNCTION_DECLARATION_VERSION=void 0,t.isSupportedFormat=function(e){return Object.values(o).includes(e)},t.FUNCTION_DECLARATION_VERSION="1.1.3",function(e){e.cjs="commonjs",e.esm="module",e.ts="typescript",e.moduleTypescript="module-typescript",e.commonjsTypescript="commonjs-typescript"}(o||(t.Format=o={}))},7789:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.availableFrameworksSchema=t.availableFrameworks=void 0;const n=o(1569);t.availableFrameworks={axios:"axios",pg:"pg",ioredis:"ioredis",nodeFetch:"nodeFetch",request:"request",express:"express",fastify:"fastify",hapi:"hapi",koa:"koa",graphql:"graphql",http:"http",https:"https",nextjs:"nextjs",nestjs:"nestjs",kafkajs:"kafkajs",confluentKafkaJs:"confluentKafkaJs",codegenieServerlessExpress:"codegenieServerlessExpress",sqs:"sqs",serverlessHttp:"serverlessHttp",mongodb:"mongodb",mongoose:"mongoose",clickhouse:"clickhouse"},t.availableFrameworksSchema=n.z.union([n.z.map(n.z.nativeEnum(t.availableFrameworks),n.z.boolean()),n.z.record(n.z.nativeEnum(t.availableFrameworks),n.z.boolean())]).transform(e=>e instanceof Map?e:new Map(Object.entries(e)))},7935:(e,t)=>{function o(e,t){return t?t instanceof RegExp?e+t.toString():("/"===t[t.length-1]&&t.length>1&&(t=t.slice(0,-1)),(t=e+t).replace(/\/{2,}/g,"/")):t}Object.defineProperty(t,"__esModule",{value:!0}),t.EndpointDeclaration=void 0,t.EndpointDeclaration=class{flow_id;methods;framework;partial_path;path;constructor(e,t,n,r,i,s){this.flow_id=e,this.methods=t,this.framework=n,this.partial_path=s,r||(r=""),this.path=o(r,i),this.partial_path=o(r,s)}}},8054:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8086:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8377:(e,t)=>{var o,n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.OutboundType=t.InvestigationType=t.InvestigationStatus=void 0,function(e){e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Cleared=3]="Cleared"}(o||(t.InvestigationStatus=o={})),function(e){e.HTTP="http",e.SQS="sqs",e.Kafka="kafka",e.GraphQL="graphql"}(n||(t.InvestigationType=n={})),function(e){e.HTTP="http",e.DB="db",e.REDIS="redis",e.MONGO="mongo"}(r||(t.OutboundType=r={}))},9107:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.HttpEndReason=void 0,function(e){e.ServerTimeout="http.server_timeout",e.ClientTimeout="http.client_timeout",e.ResponseAborted="http.response_aborted"}(o||(t.HttpEndReason=o={}))}},t={};return function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,o),i.exports}(3487)})());
|
|
2
2
|
//# sourceMappingURL=dto.js.map
|