buckyos 0.7.140 → 0.7.142
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/cli/core/auth.ts +2 -3
- package/cli/dist/cli.mjs +3 -4
- package/cli/dist/cli.mjs.map +1 -1
- package/cli/version.ts +1 -1
- package/dist/account.d.ts +0 -2
- package/dist/account.d.ts.map +1 -1
- package/dist/browser.cjs +1 -1
- package/dist/browser.mjs +14 -15
- package/dist/{executor_client-978a8e1b.js → executor_client-b3ff97ba.js} +8 -8
- package/dist/executor_client-b3ff97ba.js.map +1 -0
- package/dist/{executor_client-d2c9e854.mjs → executor_client-eb372968.mjs} +56 -152
- package/dist/executor_client-eb372968.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +14 -15
- package/dist/namelib.d.ts +1 -10
- package/dist/namelib.d.ts.map +1 -1
- package/dist/ndn_types-08dc9ef1.js +2 -0
- package/dist/ndn_types-08dc9ef1.js.map +1 -0
- package/dist/{ndn_types-dcb74613.mjs → ndn_types-bbb1f6a6.mjs} +54 -101
- package/dist/ndn_types-bbb1f6a6.mjs.map +1 -0
- package/dist/node.cjs +1 -1
- package/dist/node.mjs +14 -15
- package/dist/provision.cjs +2 -2
- package/dist/provision.cjs.map +1 -1
- package/dist/provision.mjs +18 -12
- package/dist/provision.mjs.map +1 -1
- package/dist/provision_activate.d.ts.map +1 -1
- package/dist/runtime.d.ts +1 -4
- package/dist/runtime.d.ts.map +1 -1
- package/dist/sdk_core.d.ts.map +1 -1
- package/dist/{tus_client-a2f73d53.js → tus_client-65c5fc5e.js} +2 -2
- package/dist/{tus_client-a2f73d53.js.map → tus_client-65c5fc5e.js.map} +1 -1
- package/dist/{tus_client-8fd4d937.mjs → tus_client-d313689e.mjs} +2 -2
- package/dist/{tus_client-8fd4d937.mjs.map → tus_client-d313689e.mjs.map} +1 -1
- package/dist/types.d.ts +0 -9
- package/dist/types.d.ts.map +1 -1
- package/dist/verify-hub-client.d.ts +1 -9
- package/dist/verify-hub-client.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/executor_client-978a8e1b.js.map +0 -1
- package/dist/executor_client-d2c9e854.mjs.map +0 -1
- package/dist/ndn_types-324121ae.js +0 -2
- package/dist/ndn_types-324121ae.js.map +0 -1
- package/dist/ndn_types-dcb74613.mjs.map +0 -1
|
@@ -653,22 +653,11 @@ class ht {
|
|
|
653
653
|
return this.P.getHMAC(t2, n2);
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
|
-
const LEGACY_ACCOUNT_STORAGE_KEY = "buckyos.account_info";
|
|
657
656
|
const BROWSER_USER_INFO_STORAGE_KEY = "user_info";
|
|
658
657
|
const BROWSER_IDENTITY_STORAGE_KEY = "buckyos.identity";
|
|
659
658
|
function getAccountStorageKey(appId) {
|
|
660
659
|
return `buckyos.account_info.${appId}`;
|
|
661
660
|
}
|
|
662
|
-
function parseAccountInfo(raw) {
|
|
663
|
-
if (raw == null) {
|
|
664
|
-
return null;
|
|
665
|
-
}
|
|
666
|
-
try {
|
|
667
|
-
return JSON.parse(raw);
|
|
668
|
-
} catch {
|
|
669
|
-
return null;
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
661
|
function parseBrowserUserInfo(raw) {
|
|
673
662
|
if (raw == null) {
|
|
674
663
|
return null;
|
|
@@ -690,23 +679,6 @@ function parseBrowserUserInfo(raw) {
|
|
|
690
679
|
return null;
|
|
691
680
|
}
|
|
692
681
|
}
|
|
693
|
-
function parseTokenAppId(sessionToken) {
|
|
694
|
-
const parts = sessionToken.split(".");
|
|
695
|
-
if (parts.length < 2) {
|
|
696
|
-
return null;
|
|
697
|
-
}
|
|
698
|
-
try {
|
|
699
|
-
const base64 = parts[1].replace(/-/g, "+").replace(/_/g, "/");
|
|
700
|
-
const padded = base64 + "=".repeat((4 - base64.length % 4) % 4);
|
|
701
|
-
const payload = JSON.parse(atob(padded));
|
|
702
|
-
if (typeof payload.appid === "string" && payload.appid.trim().length > 0) {
|
|
703
|
-
return payload.appid;
|
|
704
|
-
}
|
|
705
|
-
} catch {
|
|
706
|
-
return null;
|
|
707
|
-
}
|
|
708
|
-
return null;
|
|
709
|
-
}
|
|
710
682
|
function hashPassword(username, password, nonce = null) {
|
|
711
683
|
const shaObj = new ht("SHA-256", "TEXT", { encoding: "UTF8" });
|
|
712
684
|
shaObj.update(password + username + ".buckyos");
|
|
@@ -724,10 +696,6 @@ function cleanLocalAccountInfo(appId) {
|
|
|
724
696
|
localStorage.removeItem(getAccountStorageKey(appId));
|
|
725
697
|
localStorage.removeItem(BROWSER_USER_INFO_STORAGE_KEY);
|
|
726
698
|
localStorage.removeItem(BROWSER_IDENTITY_STORAGE_KEY);
|
|
727
|
-
const legacy = parseAccountInfo(localStorage.getItem(LEGACY_ACCOUNT_STORAGE_KEY));
|
|
728
|
-
if ((legacy == null ? void 0 : legacy.session_token) && parseTokenAppId(legacy.session_token) === appId) {
|
|
729
|
-
localStorage.removeItem(LEGACY_ACCOUNT_STORAGE_KEY);
|
|
730
|
-
}
|
|
731
699
|
let cookie_options = {
|
|
732
700
|
path: "/",
|
|
733
701
|
expires: /* @__PURE__ */ new Date(0),
|
|
@@ -810,9 +778,6 @@ function isBuckyOSDeviceMiniDocument(value) {
|
|
|
810
778
|
function isBuckyOSZoneBootDocument(value) {
|
|
811
779
|
return isRecord(value) && Array.isArray(value.oods) && value.oods.every((item) => typeof item === "string") && typeof value.exp === "number";
|
|
812
780
|
}
|
|
813
|
-
function isBuckyOSNodeIdentityConfig(value) {
|
|
814
|
-
return isRecord(value) && typeof value.zone_did === "string" && isRecord(value.owner_public_key) && typeof value.owner_did === "string" && typeof value.device_doc_jwt === "string" && typeof value.device_mini_doc_jwt === "string" && typeof value.zone_iat === "number";
|
|
815
|
-
}
|
|
816
781
|
function isBuckyOSLocalNodeIdentityConfig(value) {
|
|
817
782
|
return isRecord(value) && value.schema === NODE_IDENTITY_SCHEMA_V2 && typeof value.zone_did === "string" && typeof value.owner_did === "string" && isRecord(value.owner_public_key) && typeof value.device_name === "string" && typeof value.device_did === "string" && typeof value.zone_iat === "number";
|
|
818
783
|
}
|
|
@@ -1865,16 +1830,6 @@ async function deviceMiniDocumentFromJwt(jwt, publicKeyJwk) {
|
|
|
1865
1830
|
const payload = publicKeyJwk ? await verifyJwtEdDSA(jwt, publicKeyJwk) : decodeJwtClaimWithoutVerify(jwt);
|
|
1866
1831
|
return payload;
|
|
1867
1832
|
}
|
|
1868
|
-
function newNodeIdentityConfig(params) {
|
|
1869
|
-
return {
|
|
1870
|
-
zone_did: asDid(params.zoneDid).toString(),
|
|
1871
|
-
owner_public_key: params.ownerPublicKey,
|
|
1872
|
-
owner_did: asDid(params.ownerDid).toString(),
|
|
1873
|
-
device_doc_jwt: params.deviceDocJwt,
|
|
1874
|
-
device_mini_doc_jwt: params.deviceMiniDocJwt,
|
|
1875
|
-
zone_iat: params.zoneIat
|
|
1876
|
-
};
|
|
1877
|
-
}
|
|
1878
1833
|
async function encodeOwnerDocument(ownerDoc, privateKeyPem) {
|
|
1879
1834
|
if (ownerDoc.version_seq === void 0) {
|
|
1880
1835
|
throw new Error("namelib: OwnerDocument version_seq is required when encoding as JWT");
|
|
@@ -2205,7 +2160,6 @@ const namelib = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
2205
2160
|
newDeviceDocumentByMiniDocument,
|
|
2206
2161
|
newDeviceMiniDocument,
|
|
2207
2162
|
newDeviceMiniDocumentByDeviceDocument,
|
|
2208
|
-
newNodeIdentityConfig,
|
|
2209
2163
|
newOwnerDocument,
|
|
2210
2164
|
newOwnerDocumentByPkx,
|
|
2211
2165
|
newZoneBootDocument,
|
|
@@ -3763,72 +3717,71 @@ const ndn_types = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
3763
3717
|
verifyNamedObjectFromStr
|
|
3764
3718
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3765
3719
|
export {
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3720
|
+
parseOODDescription as $,
|
|
3721
|
+
clearBrowserIdentity as A,
|
|
3722
|
+
saveLocalAccountInfo as B,
|
|
3723
|
+
cleanLocalAccountInfo as C,
|
|
3770
3724
|
DID_OBJECT_SERVICE_TYPE as D,
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3725
|
+
canonicalize$1 as E,
|
|
3726
|
+
signJwtEdDSA as F,
|
|
3727
|
+
ChunkId as G,
|
|
3728
|
+
sha256Bytes as H,
|
|
3729
|
+
FileObject as I,
|
|
3730
|
+
DirObject as J,
|
|
3731
|
+
newDeviceDocumentByJwk as K,
|
|
3732
|
+
verifyJwtEdDSA as L,
|
|
3733
|
+
deviceDocumentToOrderedJson as M,
|
|
3780
3734
|
NODE_IDENTITY_SCHEMA_V2 as N,
|
|
3781
3735
|
ObjId as O,
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3736
|
+
decodeJwtClaimWithoutVerify as P,
|
|
3737
|
+
commonjsGlobal as Q,
|
|
3738
|
+
DEFAULT_EXPIRE_TIME as R,
|
|
3785
3739
|
SimpleChunkList as S,
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3740
|
+
buckyosGetUnixTimestamp as T,
|
|
3741
|
+
getPublicKeyXFromPrivatePem as U,
|
|
3742
|
+
getXFromJwk as V,
|
|
3743
|
+
createJwkByX as W,
|
|
3744
|
+
newOwnerDocument as X,
|
|
3745
|
+
ownerDocumentSetDefaultZoneDid as Y,
|
|
3746
|
+
ownerDocumentToOrderedJson as Z,
|
|
3747
|
+
oodDescriptionToString as _,
|
|
3794
3748
|
ndn_types as a,
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
getDefaultExportFromCjs as ac,
|
|
3749
|
+
encodeZoneBootDocument as a0,
|
|
3750
|
+
newZoneBootDocument as a1,
|
|
3751
|
+
encodeDeviceDocument as a2,
|
|
3752
|
+
newDeviceMiniDocumentByDeviceDocument as a3,
|
|
3753
|
+
deviceMiniDocumentToJwt as a4,
|
|
3754
|
+
newZoneDocument as a5,
|
|
3755
|
+
encodeZoneDocument as a6,
|
|
3756
|
+
zoneDocumentToOrderedJson as a7,
|
|
3757
|
+
newDeviceMiniDocument as a8,
|
|
3758
|
+
newDeviceDocumentByMiniDocument as a9,
|
|
3759
|
+
buildNamedObjectByJson as aa,
|
|
3760
|
+
getDefaultExportFromCjs as ab,
|
|
3808
3761
|
DID_OBJECT_SERVICE_ID as b,
|
|
3809
3762
|
isBuckyOSOwnerDocument as c,
|
|
3810
3763
|
isBuckyOSDeviceMiniDocument as d,
|
|
3811
3764
|
isBuckyOSZoneBootDocument as e,
|
|
3812
|
-
|
|
3813
|
-
|
|
3765
|
+
isBuckyOSLocalNodeIdentityConfig as f,
|
|
3766
|
+
isBuckyOSDeviceDocument as g,
|
|
3814
3767
|
hashPassword as h,
|
|
3815
3768
|
isW3CDIDDocumentBase as i,
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3769
|
+
isBuckyOSAgentDocument as j,
|
|
3770
|
+
isBuckyOSZoneDocument as k,
|
|
3771
|
+
isBuckyOSDIDObjectCard as l,
|
|
3772
|
+
isBuckyOSZoneConfig as m,
|
|
3820
3773
|
namelib as n,
|
|
3821
|
-
|
|
3774
|
+
parseBuckyOSOwnerDocument as o,
|
|
3822
3775
|
parseW3CDIDDocumentBase as p,
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3776
|
+
parseBuckyOSDeviceMiniDocument as q,
|
|
3777
|
+
parseBuckyOSDIDDocument as r,
|
|
3778
|
+
getDidMethod as s,
|
|
3779
|
+
getDidIdentifier as t,
|
|
3780
|
+
DID as u,
|
|
3781
|
+
getBrowserIdentityRaw as v,
|
|
3782
|
+
clearBrowserUserInfo as w,
|
|
3783
|
+
saveBrowserIdentity as x,
|
|
3784
|
+
saveBrowserUserInfo as y,
|
|
3785
|
+
getBrowserUserInfo as z
|
|
3833
3786
|
};
|
|
3834
|
-
//# sourceMappingURL=ndn_types-
|
|
3787
|
+
//# sourceMappingURL=ndn_types-bbb1f6a6.mjs.map
|