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.
Files changed (44) hide show
  1. package/cli/core/auth.ts +2 -3
  2. package/cli/dist/cli.mjs +3 -4
  3. package/cli/dist/cli.mjs.map +1 -1
  4. package/cli/version.ts +1 -1
  5. package/dist/account.d.ts +0 -2
  6. package/dist/account.d.ts.map +1 -1
  7. package/dist/browser.cjs +1 -1
  8. package/dist/browser.mjs +14 -15
  9. package/dist/{executor_client-978a8e1b.js → executor_client-b3ff97ba.js} +8 -8
  10. package/dist/executor_client-b3ff97ba.js.map +1 -0
  11. package/dist/{executor_client-d2c9e854.mjs → executor_client-eb372968.mjs} +56 -152
  12. package/dist/executor_client-eb372968.mjs.map +1 -0
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.mjs +14 -15
  15. package/dist/namelib.d.ts +1 -10
  16. package/dist/namelib.d.ts.map +1 -1
  17. package/dist/ndn_types-08dc9ef1.js +2 -0
  18. package/dist/ndn_types-08dc9ef1.js.map +1 -0
  19. package/dist/{ndn_types-dcb74613.mjs → ndn_types-bbb1f6a6.mjs} +54 -101
  20. package/dist/ndn_types-bbb1f6a6.mjs.map +1 -0
  21. package/dist/node.cjs +1 -1
  22. package/dist/node.mjs +14 -15
  23. package/dist/provision.cjs +2 -2
  24. package/dist/provision.cjs.map +1 -1
  25. package/dist/provision.mjs +18 -12
  26. package/dist/provision.mjs.map +1 -1
  27. package/dist/provision_activate.d.ts.map +1 -1
  28. package/dist/runtime.d.ts +1 -4
  29. package/dist/runtime.d.ts.map +1 -1
  30. package/dist/sdk_core.d.ts.map +1 -1
  31. package/dist/{tus_client-a2f73d53.js → tus_client-65c5fc5e.js} +2 -2
  32. package/dist/{tus_client-a2f73d53.js.map → tus_client-65c5fc5e.js.map} +1 -1
  33. package/dist/{tus_client-8fd4d937.mjs → tus_client-d313689e.mjs} +2 -2
  34. package/dist/{tus_client-8fd4d937.mjs.map → tus_client-d313689e.mjs.map} +1 -1
  35. package/dist/types.d.ts +0 -9
  36. package/dist/types.d.ts.map +1 -1
  37. package/dist/verify-hub-client.d.ts +1 -9
  38. package/dist/verify-hub-client.d.ts.map +1 -1
  39. package/package.json +1 -1
  40. package/dist/executor_client-978a8e1b.js.map +0 -1
  41. package/dist/executor_client-d2c9e854.mjs.map +0 -1
  42. package/dist/ndn_types-324121ae.js +0 -2
  43. package/dist/ndn_types-324121ae.js.map +0 -1
  44. 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
- oodDescriptionToString as $,
3767
- getBrowserUserInfo as A,
3768
- clearBrowserIdentity as B,
3769
- saveLocalAccountInfo as C,
3720
+ parseOODDescription as $,
3721
+ clearBrowserIdentity as A,
3722
+ saveLocalAccountInfo as B,
3723
+ cleanLocalAccountInfo as C,
3770
3724
  DID_OBJECT_SERVICE_TYPE as D,
3771
- cleanLocalAccountInfo as E,
3772
- canonicalize$1 as F,
3773
- signJwtEdDSA as G,
3774
- ChunkId as H,
3775
- sha256Bytes as I,
3776
- FileObject as J,
3777
- DirObject as K,
3778
- newDeviceDocumentByJwk as L,
3779
- verifyJwtEdDSA as M,
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
- deviceDocumentToOrderedJson as P,
3783
- decodeJwtClaimWithoutVerify as Q,
3784
- commonjsGlobal as R,
3736
+ decodeJwtClaimWithoutVerify as P,
3737
+ commonjsGlobal as Q,
3738
+ DEFAULT_EXPIRE_TIME as R,
3785
3739
  SimpleChunkList as S,
3786
- DEFAULT_EXPIRE_TIME as T,
3787
- buckyosGetUnixTimestamp as U,
3788
- getPublicKeyXFromPrivatePem as V,
3789
- getXFromJwk as W,
3790
- createJwkByX as X,
3791
- newOwnerDocument as Y,
3792
- ownerDocumentSetDefaultZoneDid as Z,
3793
- ownerDocumentToOrderedJson as _,
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
- parseOODDescription as a0,
3796
- encodeZoneBootDocument as a1,
3797
- newZoneBootDocument as a2,
3798
- encodeDeviceDocument as a3,
3799
- newDeviceMiniDocumentByDeviceDocument as a4,
3800
- deviceMiniDocumentToJwt as a5,
3801
- newZoneDocument as a6,
3802
- encodeZoneDocument as a7,
3803
- zoneDocumentToOrderedJson as a8,
3804
- newDeviceMiniDocument as a9,
3805
- newDeviceDocumentByMiniDocument as aa,
3806
- buildNamedObjectByJson as ab,
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
- isBuckyOSNodeIdentityConfig as f,
3813
- isBuckyOSLocalNodeIdentityConfig as g,
3765
+ isBuckyOSLocalNodeIdentityConfig as f,
3766
+ isBuckyOSDeviceDocument as g,
3814
3767
  hashPassword as h,
3815
3768
  isW3CDIDDocumentBase as i,
3816
- isBuckyOSDeviceDocument as j,
3817
- isBuckyOSAgentDocument as k,
3818
- isBuckyOSZoneDocument as l,
3819
- isBuckyOSDIDObjectCard as m,
3769
+ isBuckyOSAgentDocument as j,
3770
+ isBuckyOSZoneDocument as k,
3771
+ isBuckyOSDIDObjectCard as l,
3772
+ isBuckyOSZoneConfig as m,
3820
3773
  namelib as n,
3821
- isBuckyOSZoneConfig as o,
3774
+ parseBuckyOSOwnerDocument as o,
3822
3775
  parseW3CDIDDocumentBase as p,
3823
- parseBuckyOSOwnerDocument as q,
3824
- parseBuckyOSDeviceMiniDocument as r,
3825
- parseBuckyOSDIDDocument as s,
3826
- getDidMethod as t,
3827
- getDidIdentifier as u,
3828
- DID as v,
3829
- getBrowserIdentityRaw as w,
3830
- clearBrowserUserInfo as x,
3831
- saveBrowserIdentity as y,
3832
- saveBrowserUserInfo as z
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-dcb74613.mjs.map
3787
+ //# sourceMappingURL=ndn_types-bbb1f6a6.mjs.map