@hyphen/sdk 1.8.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -10
- package/dist/index.cjs +464 -0
- package/dist/index.d.cts +294 -2
- package/dist/index.d.ts +294 -2
- package/dist/index.js +463 -0
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -406,7 +406,470 @@ function loadEnv(options) {
|
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
__name(loadEnv, "loadEnv");
|
|
409
|
+
|
|
410
|
+
// src/hyphen.ts
|
|
411
|
+
import { Hookified as Hookified3 } from "hookified";
|
|
412
|
+
|
|
413
|
+
// src/net-info.ts
|
|
414
|
+
import process3 from "process";
|
|
415
|
+
|
|
416
|
+
// src/base-service.ts
|
|
417
|
+
import { Hookified as Hookified2 } from "hookified";
|
|
418
|
+
import { Cacheable } from "cacheable";
|
|
419
|
+
import axios from "axios";
|
|
420
|
+
import pino from "pino";
|
|
421
|
+
var ErrorMessages = /* @__PURE__ */ function(ErrorMessages2) {
|
|
422
|
+
ErrorMessages2["API_KEY_REQUIRED"] = "API key is required. Please provide it via options or set the HYPHEN_API_KEY environment variable.";
|
|
423
|
+
ErrorMessages2["PUBLIC_API_KEY_SHOULD_NOT_BE_USED"] = "The provided API key is a public API key. Please provide a valid non public API key for authentication.";
|
|
424
|
+
return ErrorMessages2;
|
|
425
|
+
}({});
|
|
426
|
+
var BaseService = class extends Hookified2 {
|
|
427
|
+
static {
|
|
428
|
+
__name(this, "BaseService");
|
|
429
|
+
}
|
|
430
|
+
_log = pino();
|
|
431
|
+
_cache = new Cacheable();
|
|
432
|
+
_throwErrors = false;
|
|
433
|
+
constructor(options) {
|
|
434
|
+
super(options);
|
|
435
|
+
if (options && options.throwErrors !== void 0) {
|
|
436
|
+
this._throwErrors = options.throwErrors;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
get log() {
|
|
440
|
+
return this._log;
|
|
441
|
+
}
|
|
442
|
+
set log(value) {
|
|
443
|
+
this._log = value;
|
|
444
|
+
}
|
|
445
|
+
get cache() {
|
|
446
|
+
return this._cache;
|
|
447
|
+
}
|
|
448
|
+
set cache(value) {
|
|
449
|
+
this._cache = value;
|
|
450
|
+
}
|
|
451
|
+
get throwErrors() {
|
|
452
|
+
return this._throwErrors;
|
|
453
|
+
}
|
|
454
|
+
set throwErrors(value) {
|
|
455
|
+
this._throwErrors = value;
|
|
456
|
+
}
|
|
457
|
+
error(message, ...args) {
|
|
458
|
+
this._log.error(message, ...args);
|
|
459
|
+
this.emit("error", message, ...args);
|
|
460
|
+
if (this.throwErrors) {
|
|
461
|
+
throw new Error(message);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
warn(message, ...args) {
|
|
465
|
+
this._log.warn(message, ...args);
|
|
466
|
+
this.emit("warn", message, ...args);
|
|
467
|
+
}
|
|
468
|
+
info(message, ...args) {
|
|
469
|
+
this._log.info(message, ...args);
|
|
470
|
+
this.emit("info", message, ...args);
|
|
471
|
+
}
|
|
472
|
+
async get(url, config2) {
|
|
473
|
+
return axios.get(url, config2);
|
|
474
|
+
}
|
|
475
|
+
async post(url, data, config2) {
|
|
476
|
+
return axios.post(url, data, config2);
|
|
477
|
+
}
|
|
478
|
+
async put(url, data, config2) {
|
|
479
|
+
return axios.put(url, data, config2);
|
|
480
|
+
}
|
|
481
|
+
async delete(url, config2) {
|
|
482
|
+
return axios.delete(url, config2);
|
|
483
|
+
}
|
|
484
|
+
async patch(url, data, config2) {
|
|
485
|
+
return axios.patch(url, data, config2);
|
|
486
|
+
}
|
|
487
|
+
createHeaders(apiKey) {
|
|
488
|
+
const headers = {
|
|
489
|
+
"content-type": "application/json",
|
|
490
|
+
accept: "application/json"
|
|
491
|
+
};
|
|
492
|
+
if (apiKey) {
|
|
493
|
+
headers["x-api-key"] = apiKey;
|
|
494
|
+
}
|
|
495
|
+
return headers;
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
// src/net-info.ts
|
|
500
|
+
loadEnv();
|
|
501
|
+
var NetInfo = class extends BaseService {
|
|
502
|
+
static {
|
|
503
|
+
__name(this, "NetInfo");
|
|
504
|
+
}
|
|
505
|
+
_apiKey;
|
|
506
|
+
_baseUri = "https://net.info";
|
|
507
|
+
constructor(options) {
|
|
508
|
+
super(options);
|
|
509
|
+
if (options?.baseUri) {
|
|
510
|
+
this._baseUri = options.baseUri;
|
|
511
|
+
}
|
|
512
|
+
this.setApiKey(options?.apiKey);
|
|
513
|
+
if (!this._apiKey && process3.env.HYPHEN_API_KEY) {
|
|
514
|
+
this.setApiKey(process3.env.HYPHEN_API_KEY);
|
|
515
|
+
}
|
|
516
|
+
if (!this._apiKey) {
|
|
517
|
+
this.error(ErrorMessages.API_KEY_REQUIRED);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* Gets or sets the API key for authentication.
|
|
522
|
+
* If not set, it will try to use the `HYPHEN_API_KEY` environment variable.
|
|
523
|
+
* @type {string | undefined}
|
|
524
|
+
*/
|
|
525
|
+
get apiKey() {
|
|
526
|
+
return this._apiKey;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Sets the API key for authentication.
|
|
530
|
+
* @param {string | undefined} value - The API key to set.
|
|
531
|
+
*/
|
|
532
|
+
set apiKey(value) {
|
|
533
|
+
this.setApiKey(value);
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Gets or sets the base URI for the API.
|
|
537
|
+
* @type {string}
|
|
538
|
+
*/
|
|
539
|
+
get baseUri() {
|
|
540
|
+
return this._baseUri;
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* Sets the base URI for the API.
|
|
544
|
+
* @param {string} value - The base URI to set.
|
|
545
|
+
*/
|
|
546
|
+
set baseUri(value) {
|
|
547
|
+
this._baseUri = value;
|
|
548
|
+
}
|
|
549
|
+
setApiKey(value) {
|
|
550
|
+
if (value?.startsWith("public_")) {
|
|
551
|
+
this.error(ErrorMessages.PUBLIC_API_KEY_SHOULD_NOT_BE_USED);
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
this._apiKey = value;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Fetches GeoIP information for a given IP address.
|
|
558
|
+
* @param {string} ip - The IP address to fetch GeoIP information for.
|
|
559
|
+
* @returns {Promise<ipInfo | ipInfoError>} - A promise that resolves to the ip information or an error.
|
|
560
|
+
*/
|
|
561
|
+
async getIpInfo(ip) {
|
|
562
|
+
try {
|
|
563
|
+
if (!this._apiKey) {
|
|
564
|
+
throw new Error(ErrorMessages.API_KEY_REQUIRED);
|
|
565
|
+
}
|
|
566
|
+
const url = `${this._baseUri}/ip/${ip}`;
|
|
567
|
+
const headers = this.createHeaders(this._apiKey);
|
|
568
|
+
const response = await this.get(url, {
|
|
569
|
+
headers
|
|
570
|
+
});
|
|
571
|
+
if (response.status !== 200) {
|
|
572
|
+
const errorResult = {
|
|
573
|
+
ip,
|
|
574
|
+
type: "error",
|
|
575
|
+
errorMessage: `Failed to fetch ip info: ${response.statusText}`
|
|
576
|
+
};
|
|
577
|
+
return errorResult;
|
|
578
|
+
}
|
|
579
|
+
return response.data;
|
|
580
|
+
} catch (error) {
|
|
581
|
+
this.error(`Failed to fetch ip info: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
582
|
+
const errorResult = {
|
|
583
|
+
ip,
|
|
584
|
+
type: "error",
|
|
585
|
+
errorMessage: error instanceof Error ? error.message : "Unknown error"
|
|
586
|
+
};
|
|
587
|
+
return errorResult;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
async getIpInfos(ips) {
|
|
591
|
+
if (!Array.isArray(ips) || ips.length === 0) {
|
|
592
|
+
this.error("The provided IPs array is invalid. It should be a non-empty array of strings.");
|
|
593
|
+
return [];
|
|
594
|
+
}
|
|
595
|
+
const errorResults = [];
|
|
596
|
+
try {
|
|
597
|
+
if (!this._apiKey) {
|
|
598
|
+
throw new Error(ErrorMessages.API_KEY_REQUIRED);
|
|
599
|
+
}
|
|
600
|
+
const url = `${this._baseUri}/ip`;
|
|
601
|
+
const headers = this.createHeaders(this._apiKey);
|
|
602
|
+
const response = await this.post(url, ips, {
|
|
603
|
+
headers
|
|
604
|
+
});
|
|
605
|
+
if (response.status !== 200) {
|
|
606
|
+
errorResults.push({
|
|
607
|
+
ip: "",
|
|
608
|
+
type: "error",
|
|
609
|
+
errorMessage: `Failed to fetch ip infos: ${response.statusText}`
|
|
610
|
+
});
|
|
611
|
+
return errorResults;
|
|
612
|
+
}
|
|
613
|
+
const responseData = response?.data;
|
|
614
|
+
return responseData.data;
|
|
615
|
+
} catch (error) {
|
|
616
|
+
this.error(`Failed to fetch ip infos: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
617
|
+
errorResults.push({
|
|
618
|
+
ip: "",
|
|
619
|
+
type: "error",
|
|
620
|
+
errorMessage: error instanceof Error ? error.message : "Unknown error"
|
|
621
|
+
});
|
|
622
|
+
return errorResults;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
// src/link.ts
|
|
628
|
+
import process4 from "process";
|
|
629
|
+
loadEnv();
|
|
630
|
+
var defaultLinkUris = [
|
|
631
|
+
"https://api.hyphen.ai/api/organizations/{organizationId}/link/codes/"
|
|
632
|
+
];
|
|
633
|
+
var Link = class extends BaseService {
|
|
634
|
+
static {
|
|
635
|
+
__name(this, "Link");
|
|
636
|
+
}
|
|
637
|
+
_uris = defaultLinkUris;
|
|
638
|
+
_organizationId;
|
|
639
|
+
_apiKey;
|
|
640
|
+
constructor(options) {
|
|
641
|
+
super(options);
|
|
642
|
+
this._uris = options?.uris ?? defaultLinkUris;
|
|
643
|
+
this._organizationId = options?.organizationId;
|
|
644
|
+
if (options?.apiKey) {
|
|
645
|
+
this.setApiKey(options.apiKey);
|
|
646
|
+
}
|
|
647
|
+
if (!this._apiKey && process4.env.HYPHEN_API_KEY) {
|
|
648
|
+
this.setApiKey(process4.env.HYPHEN_API_KEY);
|
|
649
|
+
}
|
|
650
|
+
if (!this._organizationId && process4.env.HYPHEN_ORGANIZATION_ID) {
|
|
651
|
+
this._organizationId = process4.env.HYPHEN_ORGANIZATION_ID;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Get the URIs for the link service. The default is `["https://api.hyphen.ai/api/organizations/{organizationId}/link/codes/"]`.
|
|
656
|
+
* @returns {string[]} The URIs for the link service.
|
|
657
|
+
*/
|
|
658
|
+
get uris() {
|
|
659
|
+
return this._uris;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Set the URIs for the link service. The default is `["https://api.hyphen.ai/api/organizations/{organizationId}/link/codes/"]`.
|
|
663
|
+
* @param {string[]} uris - The URIs to set.
|
|
664
|
+
*/
|
|
665
|
+
set uris(uris) {
|
|
666
|
+
this._uris = uris;
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Get the organization ID for the link service. This is required to access the link service.
|
|
670
|
+
* @returns {string | undefined} The organization ID.
|
|
671
|
+
*/
|
|
672
|
+
get organizationId() {
|
|
673
|
+
return this._organizationId;
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Set the organization ID for the link service. This is required to access the link service.
|
|
677
|
+
* @param {string | undefined} organizationId - The organization ID to set.
|
|
678
|
+
*/
|
|
679
|
+
set organizationId(organizationId) {
|
|
680
|
+
this._organizationId = organizationId;
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* Get the API key for the link service. This is required to access the link service.
|
|
684
|
+
* @returns {string | undefined} The API key.
|
|
685
|
+
*/
|
|
686
|
+
get apiKey() {
|
|
687
|
+
return this._apiKey;
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Set the API key for the link service. This is required to access the link service.
|
|
691
|
+
* @param {string | undefined} apiKey - The API key to set.
|
|
692
|
+
*/
|
|
693
|
+
set apiKey(apiKey) {
|
|
694
|
+
this.setApiKey(apiKey);
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* Set the API key for the link service. If the API key starts with 'public_', an error is thrown.
|
|
698
|
+
* This is to ensure that the API key is not a public key, which should not be used for authenticated requests.
|
|
699
|
+
* @param {string} apiKey
|
|
700
|
+
*/
|
|
701
|
+
setApiKey(apiKey) {
|
|
702
|
+
if (apiKey?.startsWith("public_")) {
|
|
703
|
+
throw new Error('API key cannot start with "public_"');
|
|
704
|
+
}
|
|
705
|
+
if (apiKey) {
|
|
706
|
+
this._apiKey = apiKey;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
async createShortCode(longUrl, domain, options) {
|
|
710
|
+
if (!this._organizationId) {
|
|
711
|
+
throw new Error("Organization ID is required to create a short code.");
|
|
712
|
+
}
|
|
713
|
+
const url = this._uris[0].replace("{organizationId}", this._organizationId);
|
|
714
|
+
const body = {
|
|
715
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
716
|
+
long_url: longUrl,
|
|
717
|
+
domain,
|
|
718
|
+
code: options?.code,
|
|
719
|
+
title: options?.title,
|
|
720
|
+
tags: options?.tags
|
|
721
|
+
};
|
|
722
|
+
const headers = this.createHeaders(this._apiKey);
|
|
723
|
+
const response = await this.post(url, body, {
|
|
724
|
+
headers
|
|
725
|
+
});
|
|
726
|
+
if (response.status === 201) {
|
|
727
|
+
return response.data;
|
|
728
|
+
}
|
|
729
|
+
throw new Error(`Failed to create short code: ${response.statusText}`);
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Delete a short code.
|
|
733
|
+
* @param {string} code The short code to delete. Example: 'code_686bed403c3991bd676bba4d'
|
|
734
|
+
* @returns {Promise<boolean>} A promise that resolves to true if the short code was deleted successfully, or false if it was not.
|
|
735
|
+
*/
|
|
736
|
+
async deleteShortCode(code) {
|
|
737
|
+
if (!this._organizationId) {
|
|
738
|
+
throw new Error("Organization ID is required to delete a short code.");
|
|
739
|
+
}
|
|
740
|
+
let url = this._uris[0].replace("{organizationId}", this._organizationId);
|
|
741
|
+
url = url.endsWith("/") ? `${url}${code}/` : `${url}/${code}/`;
|
|
742
|
+
const headers = this.createHeaders(this._apiKey);
|
|
743
|
+
delete headers["content-type"];
|
|
744
|
+
const response = await this.delete(url, {
|
|
745
|
+
headers
|
|
746
|
+
});
|
|
747
|
+
if (response.status === 204) {
|
|
748
|
+
return true;
|
|
749
|
+
}
|
|
750
|
+
throw new Error(`Failed to delete short code: ${response.statusText}`);
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
// src/hyphen.ts
|
|
755
|
+
var Hyphen = class extends Hookified3 {
|
|
756
|
+
static {
|
|
757
|
+
__name(this, "Hyphen");
|
|
758
|
+
}
|
|
759
|
+
_netInfo;
|
|
760
|
+
_toggle;
|
|
761
|
+
_link;
|
|
762
|
+
_publicApiKey;
|
|
763
|
+
_apiKey;
|
|
764
|
+
constructor(options) {
|
|
765
|
+
super(options);
|
|
766
|
+
const toggleOptions = options?.toggle ?? {};
|
|
767
|
+
const netInfoOptions = options?.netInfo ?? {};
|
|
768
|
+
const linkOptions = options?.link ?? {};
|
|
769
|
+
if (options?.publicApiKey) {
|
|
770
|
+
this._publicApiKey = options.publicApiKey;
|
|
771
|
+
toggleOptions.publicApiKey = options.publicApiKey;
|
|
772
|
+
}
|
|
773
|
+
if (options?.apiKey) {
|
|
774
|
+
this._apiKey = options.apiKey;
|
|
775
|
+
netInfoOptions.apiKey = options.apiKey;
|
|
776
|
+
linkOptions.apiKey = options.apiKey;
|
|
777
|
+
}
|
|
778
|
+
if (options?.throwErrors !== void 0) {
|
|
779
|
+
toggleOptions.throwErrors = options.throwErrors;
|
|
780
|
+
netInfoOptions.throwErrors = options.throwErrors;
|
|
781
|
+
linkOptions.throwErrors = options.throwErrors;
|
|
782
|
+
}
|
|
783
|
+
this._netInfo = new NetInfo(netInfoOptions);
|
|
784
|
+
this._netInfo.on("error", (message, ...args) => this.emit("error", message, ...args));
|
|
785
|
+
this._netInfo.on("info", (message, ...args) => this.emit("info", message, ...args));
|
|
786
|
+
this._netInfo.on("warn", (message, ...args) => this.emit("warn", message, ...args));
|
|
787
|
+
this._toggle = new Toggle(toggleOptions);
|
|
788
|
+
this._toggle.on("error", (message, ...args) => this.emit("error", message, ...args));
|
|
789
|
+
this._toggle.on("info", (message, ...args) => this.emit("info", message, ...args));
|
|
790
|
+
this._toggle.on("warn", (message, ...args) => this.emit("warn", message, ...args));
|
|
791
|
+
this._link = new Link(linkOptions);
|
|
792
|
+
this._link.on("error", (message, ...args) => this.emit("error", message, ...args));
|
|
793
|
+
this._link.on("info", (message, ...args) => this.emit("info", message, ...args));
|
|
794
|
+
this._link.on("warn", (message, ...args) => this.emit("warn", message, ...args));
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Get the NetInfo service instance.
|
|
798
|
+
* @returns {NetInfo} The NetInfo service instance.
|
|
799
|
+
*/
|
|
800
|
+
get netInfo() {
|
|
801
|
+
return this._netInfo;
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Get the Toggle service instance.
|
|
805
|
+
* @returns {Toggle} The Toggle service instance.
|
|
806
|
+
*/
|
|
807
|
+
get toggle() {
|
|
808
|
+
return this._toggle;
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Get the Link service instance.
|
|
812
|
+
* @returns {Link} The Link service instance.
|
|
813
|
+
*/
|
|
814
|
+
get link() {
|
|
815
|
+
return this._link;
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* Get the public API key for the Hyphen service.
|
|
819
|
+
* This is used for public endpoints that do not require authentication.
|
|
820
|
+
* @returns {string | undefined} The public API key.
|
|
821
|
+
*/
|
|
822
|
+
get publicApiKey() {
|
|
823
|
+
return this._publicApiKey;
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Set the public API key for the Hyphen service. If set, this will also update the underlying services.
|
|
827
|
+
* This is used for public endpoints that do not require authentication such as the Toggle service.
|
|
828
|
+
* @param {string | undefined} value - The public API key to set.
|
|
829
|
+
*/
|
|
830
|
+
set publicApiKey(value) {
|
|
831
|
+
this._publicApiKey = value;
|
|
832
|
+
this._toggle.publicApiKey = value;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Get the API key for the Hyphen service.
|
|
836
|
+
* This is used for authenticated endpoints that require an API key such as the NetInfo and Link services.
|
|
837
|
+
* @returns {string | undefined} The API key.
|
|
838
|
+
*/
|
|
839
|
+
get apiKey() {
|
|
840
|
+
return this._apiKey;
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* Set the API key for the Hyphen service. If set, this will also update the underlying services.
|
|
844
|
+
* This is used for authenticated endpoints that require an API key such as the NetInfo and Link services.
|
|
845
|
+
* @param {string | undefined} value - The API key to set.
|
|
846
|
+
*/
|
|
847
|
+
set apiKey(value) {
|
|
848
|
+
this._apiKey = value;
|
|
849
|
+
this._netInfo.apiKey = value;
|
|
850
|
+
this._link.apiKey = value;
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* Get whether to throw errors or not.
|
|
854
|
+
* If set to true, errors will be thrown instead of logged.
|
|
855
|
+
* @returns {boolean} Whether to throw errors or not.
|
|
856
|
+
*/
|
|
857
|
+
get throwErrors() {
|
|
858
|
+
return this._netInfo.throwErrors && this._toggle.throwErrors && this._link.throwErrors;
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* Set whether to throw errors or not. If set to true, errors will be thrown instead of logged.
|
|
862
|
+
* This will update the underlying services as well.
|
|
863
|
+
* @param {boolean} value - Whether to throw errors or not.
|
|
864
|
+
*/
|
|
865
|
+
set throwErrors(value) {
|
|
866
|
+
this._netInfo.throwErrors = value;
|
|
867
|
+
this._toggle.throwErrors = value;
|
|
868
|
+
this._link.throwErrors = value;
|
|
869
|
+
}
|
|
870
|
+
};
|
|
409
871
|
export {
|
|
872
|
+
Hyphen,
|
|
410
873
|
Toggle,
|
|
411
874
|
ToggleHooks,
|
|
412
875
|
loadEnv
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyphen/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Hyphen SDK for Node.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
"author": "Team Hyphen <hello@hyphen.ai>",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@swc/core": "^1.
|
|
33
|
-
"@types/node": "^
|
|
34
|
-
"@vitest/coverage-v8": "^3.
|
|
32
|
+
"@swc/core": "^1.12.9",
|
|
33
|
+
"@types/node": "^24.0.10",
|
|
34
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
35
35
|
"rimraf": "^6.0.1",
|
|
36
36
|
"tsd": "^0.32.0",
|
|
37
37
|
"tsup": "^8.5.0",
|
|
38
38
|
"typescript": "^5.8.3",
|
|
39
|
-
"vitest": "^3.
|
|
40
|
-
"xo": "^1.1.
|
|
39
|
+
"vitest": "^3.2.4",
|
|
40
|
+
"xo": "^1.1.1"
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
43
|
"dist",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"@hyphen/openfeature-server-provider": "^1.0.7",
|
|
48
48
|
"@openfeature/server-sdk": "^1.18.0",
|
|
49
49
|
"axios": "^1.10.0",
|
|
50
|
-
"cacheable": "^1.10.
|
|
51
|
-
"dotenv": "^
|
|
52
|
-
"hookified": "^1.
|
|
50
|
+
"cacheable": "^1.10.1",
|
|
51
|
+
"dotenv": "^17.0.1",
|
|
52
|
+
"hookified": "^1.10.0",
|
|
53
53
|
"pino": "^9.7.0"
|
|
54
54
|
}
|
|
55
55
|
}
|