@learncard/core 8.0.6 → 8.0.7
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 +12 -10
- package/dist/core.cjs.development.js +276 -209
- package/dist/core.cjs.development.js.map +4 -4
- package/dist/core.cjs.production.min.js +28 -28
- package/dist/core.cjs.production.min.js.map +4 -4
- package/dist/core.esm.js +276 -209
- package/dist/core.esm.js.map +4 -4
- package/package.json +1 -1
@@ -30005,15 +30005,15 @@ var require_from_string = __commonJS({
|
|
30005
30005
|
"../../node_modules/.pnpm/uint8arrays@2.1.10/node_modules/uint8arrays/from-string.js"(exports, module2) {
|
30006
30006
|
"use strict";
|
30007
30007
|
var bases2 = require_bases();
|
30008
|
-
function
|
30008
|
+
function fromString8(string2, encoding = "utf8") {
|
30009
30009
|
const base4 = bases2[encoding];
|
30010
30010
|
if (!base4) {
|
30011
30011
|
throw new Error(`Unsupported encoding "${encoding}"`);
|
30012
30012
|
}
|
30013
30013
|
return base4.decoder.decode(`${base4.prefix}${string2}`);
|
30014
30014
|
}
|
30015
|
-
__name(
|
30016
|
-
module2.exports =
|
30015
|
+
__name(fromString8, "fromString");
|
30016
|
+
module2.exports = fromString8;
|
30017
30017
|
}
|
30018
30018
|
});
|
30019
30019
|
|
@@ -30060,14 +30060,14 @@ var require_uint8arrays = __commonJS({
|
|
30060
30060
|
var compare4 = require_compare();
|
30061
30061
|
var concat4 = require_concat();
|
30062
30062
|
var equals4 = require_equals();
|
30063
|
-
var
|
30063
|
+
var fromString8 = require_from_string();
|
30064
30064
|
var toString10 = require_to_string2();
|
30065
30065
|
var xor2 = require_xor();
|
30066
30066
|
module2.exports = {
|
30067
30067
|
compare: compare4,
|
30068
30068
|
concat: concat4,
|
30069
30069
|
equals: equals4,
|
30070
|
-
fromString:
|
30070
|
+
fromString: fromString8,
|
30071
30071
|
toString: toString10,
|
30072
30072
|
xor: xor2
|
30073
30073
|
};
|
@@ -32791,7 +32791,7 @@ var require_buffer2 = __commonJS({
|
|
32791
32791
|
Buffer3.poolSize = 8192;
|
32792
32792
|
function from4(value, encodingOrOffset, length2) {
|
32793
32793
|
if (typeof value === "string") {
|
32794
|
-
return
|
32794
|
+
return fromString8(value, encodingOrOffset);
|
32795
32795
|
}
|
32796
32796
|
if (ArrayBuffer.isView(value)) {
|
32797
32797
|
return fromArrayView(value);
|
@@ -32869,7 +32869,7 @@ var require_buffer2 = __commonJS({
|
|
32869
32869
|
Buffer3.allocUnsafeSlow = function(size) {
|
32870
32870
|
return allocUnsafe2(size);
|
32871
32871
|
};
|
32872
|
-
function
|
32872
|
+
function fromString8(string2, encoding) {
|
32873
32873
|
if (typeof encoding !== "string" || encoding === "") {
|
32874
32874
|
encoding = "utf8";
|
32875
32875
|
}
|
@@ -32884,7 +32884,7 @@ var require_buffer2 = __commonJS({
|
|
32884
32884
|
}
|
32885
32885
|
return buf2;
|
32886
32886
|
}
|
32887
|
-
__name(
|
32887
|
+
__name(fromString8, "fromString");
|
32888
32888
|
function fromArrayLike2(array) {
|
32889
32889
|
var length2 = array.length < 0 ? 0 : checked(array.length) | 0;
|
32890
32890
|
var buf2 = createBuffer(length2);
|
@@ -41576,7 +41576,7 @@ var getVCTemplatesPlugin = /* @__PURE__ */ __name(() => {
|
|
41576
41576
|
};
|
41577
41577
|
}, "getVCTemplatesPlugin");
|
41578
41578
|
|
41579
|
-
// ../../node_modules/.pnpm/web-request-rpc@2.0.
|
41579
|
+
// ../../node_modules/.pnpm/web-request-rpc@2.0.1/node_modules/web-request-rpc/utils.js
|
41580
41580
|
var RPC_ERRORS = {
|
41581
41581
|
ParseError: {
|
41582
41582
|
message: "Parse error",
|
@@ -41734,7 +41734,7 @@ function isHandlePromise(handle) {
|
|
41734
41734
|
}
|
41735
41735
|
__name(isHandlePromise, "isHandlePromise");
|
41736
41736
|
|
41737
|
-
// ../../node_modules/.pnpm/web-request-rpc@2.0.
|
41737
|
+
// ../../node_modules/.pnpm/web-request-rpc@2.0.1/node_modules/web-request-rpc/Client.js
|
41738
41738
|
var RPC_CLIENT_CALL_TIMEOUT = 3e4;
|
41739
41739
|
var Client = class {
|
41740
41740
|
constructor() {
|
@@ -41866,7 +41866,7 @@ var Injector = class {
|
|
41866
41866
|
};
|
41867
41867
|
__name(Injector, "Injector");
|
41868
41868
|
|
41869
|
-
// ../../node_modules/.pnpm/web-request-rpc@2.0.
|
41869
|
+
// ../../node_modules/.pnpm/web-request-rpc@2.0.1/node_modules/web-request-rpc/EventEmitter.js
|
41870
41870
|
var EventEmitter = class {
|
41871
41871
|
constructor({ deserialize = /* @__PURE__ */ __name((e2) => e2, "deserialize"), waitUntil = /* @__PURE__ */ __name(async () => {
|
41872
41872
|
}, "waitUntil") } = {}) {
|
@@ -41899,7 +41899,7 @@ var EventEmitter = class {
|
|
41899
41899
|
};
|
41900
41900
|
__name(EventEmitter, "EventEmitter");
|
41901
41901
|
|
41902
|
-
// ../../node_modules/.pnpm/web-request-rpc@2.0.
|
41902
|
+
// ../../node_modules/.pnpm/web-request-rpc@2.0.1/node_modules/web-request-rpc/Server.js
|
41903
41903
|
var Server = class {
|
41904
41904
|
constructor() {
|
41905
41905
|
this.origin = null;
|
@@ -41988,7 +41988,7 @@ function sendMethodNotFound(handle, origin, message) {
|
|
41988
41988
|
}
|
41989
41989
|
__name(sendMethodNotFound, "sendMethodNotFound");
|
41990
41990
|
|
41991
|
-
// ../../node_modules/.pnpm/web-request-rpc@2.0.
|
41991
|
+
// ../../node_modules/.pnpm/web-request-rpc@2.0.1/node_modules/web-request-rpc/WebApp.js
|
41992
41992
|
var WebApp = class {
|
41993
41993
|
constructor(relyingOrigin) {
|
41994
41994
|
this.relyingOrigin = parseUrl(relyingOrigin).origin;
|
@@ -42041,7 +42041,7 @@ var WebApp = class {
|
|
42041
42041
|
};
|
42042
42042
|
__name(WebApp, "WebApp");
|
42043
42043
|
|
42044
|
-
// ../../node_modules/.pnpm/web-request-rpc@2.0.
|
42044
|
+
// ../../node_modules/.pnpm/web-request-rpc@2.0.1/node_modules/web-request-rpc/WebAppWindowDialog.js
|
42045
42045
|
var WebAppWindowDialog = class {
|
42046
42046
|
constructor() {
|
42047
42047
|
this._closeEventListeners = /* @__PURE__ */ new Set();
|
@@ -42077,7 +42077,7 @@ var WebAppWindowDialog = class {
|
|
42077
42077
|
};
|
42078
42078
|
__name(WebAppWindowDialog, "WebAppWindowDialog");
|
42079
42079
|
|
42080
|
-
// ../../node_modules/.pnpm/web-request-rpc@2.0.
|
42080
|
+
// ../../node_modules/.pnpm/web-request-rpc@2.0.1/node_modules/web-request-rpc/WebAppWindowInlineDialog.js
|
42081
42081
|
var WebAppWindowInlineDialog = class extends WebAppWindowDialog {
|
42082
42082
|
constructor({ url, handle, className }) {
|
42083
42083
|
super();
|
@@ -42100,6 +42100,7 @@ var WebAppWindowInlineDialog = class extends WebAppWindowDialog {
|
|
42100
42100
|
color: "black",
|
42101
42101
|
"box-sizing": "border-box",
|
42102
42102
|
overflow: "hidden",
|
42103
|
+
"user-select": "none",
|
42103
42104
|
"z-index": 1e6
|
42104
42105
|
});
|
42105
42106
|
this.dialog.className = "web-app-window";
|
@@ -42137,7 +42138,8 @@ var WebAppWindowInlineDialog = class extends WebAppWindowDialog {
|
|
42137
42138
|
overflow: "hidden",
|
42138
42139
|
margin: 0,
|
42139
42140
|
padding: 0,
|
42140
|
-
"flex-grow": 1
|
42141
|
+
"flex-grow": 1,
|
42142
|
+
"user-select": "none"
|
42141
42143
|
});
|
42142
42144
|
this.dialog.appendChild(style);
|
42143
42145
|
this.container.appendChild(this.iframe);
|
@@ -42179,7 +42181,7 @@ function applyStyle(element, style) {
|
|
42179
42181
|
}
|
42180
42182
|
__name(applyStyle, "applyStyle");
|
42181
42183
|
|
42182
|
-
// ../../node_modules/.pnpm/web-request-rpc@2.0.
|
42184
|
+
// ../../node_modules/.pnpm/web-request-rpc@2.0.1/node_modules/web-request-rpc/WebAppWindowPopupDialog.js
|
42183
42185
|
var WebAppWindowPopupDialog = class extends WebAppWindowDialog {
|
42184
42186
|
constructor({ url, handle, bounds = { width: 500, height: 400 } }) {
|
42185
42187
|
super();
|
@@ -42258,7 +42260,7 @@ var WebAppWindowPopupDialog = class extends WebAppWindowDialog {
|
|
42258
42260
|
};
|
42259
42261
|
__name(WebAppWindowPopupDialog, "WebAppWindowPopupDialog");
|
42260
42262
|
|
42261
|
-
// ../../node_modules/.pnpm/web-request-rpc@2.0.
|
42263
|
+
// ../../node_modules/.pnpm/web-request-rpc@2.0.1/node_modules/web-request-rpc/WebAppWindow.js
|
42262
42264
|
var LOAD_WINDOW_TIMEOUT = 6e4;
|
42263
42265
|
var WebAppWindow = class {
|
42264
42266
|
constructor(url, {
|
@@ -42389,7 +42391,7 @@ var WebAppWindow = class {
|
|
42389
42391
|
};
|
42390
42392
|
__name(WebAppWindow, "WebAppWindow");
|
42391
42393
|
|
42392
|
-
// ../../node_modules/.pnpm/web-request-rpc@2.0.
|
42394
|
+
// ../../node_modules/.pnpm/web-request-rpc@2.0.1/node_modules/web-request-rpc/WebAppContext.js
|
42393
42395
|
var WEB_APP_CONTEXT_LOAD_TIMEOUT = 1e4;
|
42394
42396
|
var WebAppContext = class {
|
42395
42397
|
constructor() {
|
@@ -42450,7 +42452,7 @@ var WebAppContext = class {
|
|
42450
42452
|
};
|
42451
42453
|
__name(WebAppContext, "WebAppContext");
|
42452
42454
|
|
42453
|
-
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.
|
42455
|
+
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.1/node_modules/credential-handler-polyfill/CredentialRequestEvent.js
|
42454
42456
|
var CredentialRequestEvent = class {
|
42455
42457
|
constructor({
|
42456
42458
|
credentialHandler,
|
@@ -42480,7 +42482,7 @@ var CredentialRequestEvent = class {
|
|
42480
42482
|
};
|
42481
42483
|
__name(CredentialRequestEvent, "CredentialRequestEvent");
|
42482
42484
|
|
42483
|
-
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.
|
42485
|
+
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.1/node_modules/credential-handler-polyfill/CredentialStoreEvent.js
|
42484
42486
|
var CredentialStoreEvent = class {
|
42485
42487
|
constructor({
|
42486
42488
|
credentialHandler,
|
@@ -42508,7 +42510,7 @@ var CredentialStoreEvent = class {
|
|
42508
42510
|
};
|
42509
42511
|
__name(CredentialStoreEvent, "CredentialStoreEvent");
|
42510
42512
|
|
42511
|
-
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.
|
42513
|
+
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.1/node_modules/credential-handler-polyfill/CredentialHandlerService.js
|
42512
42514
|
var CredentialHandlerService = class {
|
42513
42515
|
constructor(credentialHandler) {
|
42514
42516
|
this._credentialHandler = credentialHandler;
|
@@ -42532,7 +42534,7 @@ var CredentialHandlerService = class {
|
|
42532
42534
|
};
|
42533
42535
|
__name(CredentialHandlerService, "CredentialHandlerService");
|
42534
42536
|
|
42535
|
-
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.
|
42537
|
+
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.1/node_modules/credential-handler-polyfill/CredentialHandler.js
|
42536
42538
|
var EVENT_TYPES = ["credentialrequest", "credentialstore"];
|
42537
42539
|
var CredentialHandler = class extends WebApp {
|
42538
42540
|
constructor(mediatorOrigin, inline = false) {
|
@@ -42578,7 +42580,7 @@ var CredentialHandler = class extends WebApp {
|
|
42578
42580
|
};
|
42579
42581
|
__name(CredentialHandler, "CredentialHandler");
|
42580
42582
|
|
42581
|
-
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.
|
42583
|
+
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.1/node_modules/credential-handler-polyfill/CredentialHints.js
|
42582
42584
|
var CredentialHints = class {
|
42583
42585
|
constructor(url, injector) {
|
42584
42586
|
const remote = injector.get("credentialHints", {
|
@@ -42629,7 +42631,7 @@ function imageToDataUrl(url) {
|
|
42629
42631
|
}
|
42630
42632
|
__name(imageToDataUrl, "imageToDataUrl");
|
42631
42633
|
|
42632
|
-
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.
|
42634
|
+
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.1/node_modules/credential-handler-polyfill/CredentialManager.js
|
42633
42635
|
var CredentialManager = class {
|
42634
42636
|
constructor(url, injector) {
|
42635
42637
|
if (!(url && typeof url === "string")) {
|
@@ -42646,7 +42648,7 @@ var CredentialManager = class {
|
|
42646
42648
|
};
|
42647
42649
|
__name(CredentialManager, "CredentialManager");
|
42648
42650
|
|
42649
|
-
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.
|
42651
|
+
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.1/node_modules/credential-handler-polyfill/CredentialHandlerRegistration.js
|
42650
42652
|
var CredentialHandlerRegistration = class {
|
42651
42653
|
constructor(url, injector) {
|
42652
42654
|
if (!(url && typeof url === "string")) {
|
@@ -42657,7 +42659,7 @@ var CredentialHandlerRegistration = class {
|
|
42657
42659
|
};
|
42658
42660
|
__name(CredentialHandlerRegistration, "CredentialHandlerRegistration");
|
42659
42661
|
|
42660
|
-
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.
|
42662
|
+
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.1/node_modules/credential-handler-polyfill/CredentialHandlers.js
|
42661
42663
|
var CredentialHandlers = class {
|
42662
42664
|
constructor(injector) {
|
42663
42665
|
this._init = (async () => {
|
@@ -42705,7 +42707,7 @@ var CredentialHandlers = class {
|
|
42705
42707
|
};
|
42706
42708
|
__name(CredentialHandlers, "CredentialHandlers");
|
42707
42709
|
|
42708
|
-
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.
|
42710
|
+
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.1/node_modules/credential-handler-polyfill/WebCredential.js
|
42709
42711
|
var WebCredential2 = class {
|
42710
42712
|
constructor(dataType, data, { recommendedHandlerOrigins = [] } = {}) {
|
42711
42713
|
if (typeof dataType !== "string") {
|
@@ -42719,7 +42721,7 @@ var WebCredential2 = class {
|
|
42719
42721
|
};
|
42720
42722
|
__name(WebCredential2, "WebCredential");
|
42721
42723
|
|
42722
|
-
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.
|
42724
|
+
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.1/node_modules/credential-handler-polyfill/CredentialsContainer.js
|
42723
42725
|
var CREDENTIAL_GET_TIMEOUT = 0;
|
42724
42726
|
var CREDENTIAL_STORE_TIMEOUT = 0;
|
42725
42727
|
var CredentialsContainer = class {
|
@@ -42768,7 +42770,7 @@ var CredentialsContainer = class {
|
|
42768
42770
|
};
|
42769
42771
|
__name(CredentialsContainer, "CredentialsContainer");
|
42770
42772
|
|
42771
|
-
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.
|
42773
|
+
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.1/node_modules/credential-handler-polyfill/PermissionManager.js
|
42772
42774
|
var PERMISSION_REQUEST_TIMEOUT = 0;
|
42773
42775
|
var PermissionManager = class {
|
42774
42776
|
constructor(injector) {
|
@@ -42797,7 +42799,7 @@ var PermissionManager = class {
|
|
42797
42799
|
};
|
42798
42800
|
__name(PermissionManager, "PermissionManager");
|
42799
42801
|
|
42800
|
-
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.
|
42802
|
+
// ../../node_modules/.pnpm/credential-handler-polyfill@3.0.1/node_modules/credential-handler-polyfill/index.js
|
42801
42803
|
var DEFAULT_MEDIATOR_ORIGIN = "https://authn.io";
|
42802
42804
|
var loaded;
|
42803
42805
|
async function loadOnce(options) {
|
@@ -42857,7 +42859,7 @@ async function load2(options = {
|
|
42857
42859
|
}
|
42858
42860
|
__name(load2, "load");
|
42859
42861
|
|
42860
|
-
// ../../node_modules/.pnpm/web-credential-handler@2.0.
|
42862
|
+
// ../../node_modules/.pnpm/web-credential-handler@2.0.1/node_modules/web-credential-handler/CredentialEventProxy.js
|
42861
42863
|
var PROXY_EVENT_TIMEOUT = 6e4;
|
42862
42864
|
var CredentialEventProxy = class extends WebApp {
|
42863
42865
|
constructor() {
|
@@ -42891,7 +42893,7 @@ var CredentialEventProxy = class extends WebApp {
|
|
42891
42893
|
};
|
42892
42894
|
__name(CredentialEventProxy, "CredentialEventProxy");
|
42893
42895
|
|
42894
|
-
// ../../node_modules/.pnpm/web-credential-handler@2.0.
|
42896
|
+
// ../../node_modules/.pnpm/web-credential-handler@2.0.1/node_modules/web-credential-handler/index.js
|
42895
42897
|
var DEFAULT_MEDIATOR = "https://authn.io";
|
42896
42898
|
async function installHandler() {
|
42897
42899
|
const CredentialManager2 = navigator.credentialsPolyfill.CredentialManager;
|
@@ -56881,11 +56883,11 @@ var fast_json_patch_default = Object.assign({}, core_exports, duplex_exports, {
|
|
56881
56883
|
unescapePathComponent
|
56882
56884
|
});
|
56883
56885
|
|
56884
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+stream-tile@2.
|
56886
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+stream-tile@2.9.0/node_modules/@ceramicnetwork/stream-tile/lib/tile-document.js
|
56885
56887
|
var import_lodash3 = __toESM(require_lodash(), 1);
|
56886
56888
|
var import_random3 = __toESM(require_random(), 1);
|
56887
56889
|
|
56888
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.
|
56890
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.13.0/node_modules/@ceramicnetwork/common/lib/streamopts.js
|
56889
56891
|
var SyncOptions;
|
56890
56892
|
(function(SyncOptions2) {
|
56891
56893
|
SyncOptions2[SyncOptions2["PREFER_CACHE"] = 0] = "PREFER_CACHE";
|
@@ -56893,14 +56895,14 @@ var SyncOptions;
|
|
56893
56895
|
SyncOptions2[SyncOptions2["NEVER_SYNC"] = 2] = "NEVER_SYNC";
|
56894
56896
|
})(SyncOptions || (SyncOptions = {}));
|
56895
56897
|
|
56896
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.
|
56898
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.13.0/node_modules/@ceramicnetwork/common/lib/stream.js
|
56897
56899
|
var import_lodash = __toESM(require_lodash(), 1);
|
56898
56900
|
|
56899
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.
|
56901
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.7.0/node_modules/@ceramicnetwork/streamid/lib/commit-id.js
|
56900
56902
|
init_cid();
|
56901
56903
|
init_base36();
|
56902
56904
|
|
56903
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.
|
56905
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.7.0/node_modules/@ceramicnetwork/streamid/lib/stream-type.js
|
56904
56906
|
var registry = {
|
56905
56907
|
tile: 0,
|
56906
56908
|
"caip10-link": 1,
|
@@ -56932,7 +56934,7 @@ __name(StreamType, "StreamType");
|
|
56932
56934
|
StreamType.nameByCode = nameByCode;
|
56933
56935
|
StreamType.codeByName = codeByName;
|
56934
56936
|
|
56935
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.
|
56937
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.7.0/node_modules/@ceramicnetwork/streamid/lib/commit-id.js
|
56936
56938
|
var import_varint5 = __toESM(require_varint(), 1);
|
56937
56939
|
|
56938
56940
|
// ../../node_modules/.pnpm/typescript-memoize@1.1.1/node_modules/typescript-memoize/dist/es2015/memoize-decorator.js
|
@@ -57023,17 +57025,33 @@ function getNewFunction(originalMethod, hashFunction, duration = 0, tags) {
|
|
57023
57025
|
}
|
57024
57026
|
__name(getNewFunction, "getNewFunction");
|
57025
57027
|
|
57026
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.
|
57028
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.7.0/node_modules/@ceramicnetwork/streamid/lib/constants.js
|
57027
57029
|
var STREAMID_CODEC = 206;
|
57028
57030
|
|
57029
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.
|
57031
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.7.0/node_modules/@ceramicnetwork/streamid/lib/stream-id.js
|
57032
|
+
init_cid();
|
57033
|
+
init_base36();
|
57034
|
+
init_sha2_browser();
|
57035
|
+
var import_varint4 = __toESM(require_varint(), 1);
|
57036
|
+
|
57037
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.7.0/node_modules/@ceramicnetwork/streamid/lib/try-catch.util.js
|
57038
|
+
function tryCatch(fn) {
|
57039
|
+
try {
|
57040
|
+
return fn();
|
57041
|
+
} catch (e2) {
|
57042
|
+
return e2;
|
57043
|
+
}
|
57044
|
+
}
|
57045
|
+
__name(tryCatch, "tryCatch");
|
57046
|
+
|
57047
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.7.0/node_modules/@ceramicnetwork/streamid/lib/reading-bytes.js
|
57030
57048
|
init_cid();
|
57031
57049
|
var import_varint3 = __toESM(require_varint(), 1);
|
57032
57050
|
init_digest();
|
57033
57051
|
function readVarint(bytes) {
|
57034
57052
|
const value = import_varint3.default.decode(bytes);
|
57035
57053
|
const readLength = import_varint3.default.decode.bytes;
|
57036
|
-
const remainder = bytes.
|
57054
|
+
const remainder = bytes.subarray(readLength);
|
57037
57055
|
return [value, remainder, readLength];
|
57038
57056
|
}
|
57039
57057
|
__name(readVarint, "readVarint");
|
@@ -57042,32 +57060,100 @@ function isCidVersion(input) {
|
|
57042
57060
|
}
|
57043
57061
|
__name(isCidVersion, "isCidVersion");
|
57044
57062
|
function readCid(bytes) {
|
57045
|
-
const result = readCidNoThrow(bytes);
|
57046
|
-
if (result instanceof Error) {
|
57047
|
-
throw result;
|
57048
|
-
}
|
57049
|
-
return result;
|
57050
|
-
}
|
57051
|
-
__name(readCid, "readCid");
|
57052
|
-
function readCidNoThrow(bytes) {
|
57053
57063
|
const [cidVersion, cidVersionRemainder] = readVarint(bytes);
|
57054
57064
|
if (!isCidVersion(cidVersion)) {
|
57055
|
-
|
57065
|
+
throw new Error(`Unknown CID version ${cidVersion}`);
|
57056
57066
|
}
|
57057
57067
|
const [codec, codecRemainder] = readVarint(cidVersionRemainder);
|
57058
57068
|
const [, mhCodecRemainder, mhCodecLength] = readVarint(codecRemainder);
|
57059
57069
|
const [mhLength, , mhLengthLength] = readVarint(mhCodecRemainder);
|
57060
|
-
const multihashBytes = codecRemainder.
|
57061
|
-
const multihashBytesRemainder = codecRemainder.
|
57070
|
+
const multihashBytes = codecRemainder.subarray(0, mhCodecLength + mhLengthLength + mhLength);
|
57071
|
+
const multihashBytesRemainder = codecRemainder.subarray(mhCodecLength + mhLengthLength + mhLength);
|
57062
57072
|
return [CID.create(cidVersion, codec, decode5(multihashBytes)), multihashBytesRemainder];
|
57063
57073
|
}
|
57064
|
-
__name(
|
57074
|
+
__name(readCid, "readCid");
|
57065
57075
|
|
57066
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.
|
57076
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.7.0/node_modules/@ceramicnetwork/streamid/lib/stream-ref-parsing.js
|
57067
57077
|
init_cid();
|
57068
57078
|
init_base36();
|
57069
|
-
|
57070
|
-
|
57079
|
+
function fromBytes(input, title = "StreamRef") {
|
57080
|
+
const [streamCodec, streamCodecRemainder] = readVarint(input);
|
57081
|
+
if (streamCodec !== STREAMID_CODEC)
|
57082
|
+
throw new Error(`Invalid ${title}, does not include streamid codec`);
|
57083
|
+
const [type, streamtypeRemainder] = readVarint(streamCodecRemainder);
|
57084
|
+
const cidResult = readCid(streamtypeRemainder);
|
57085
|
+
const [genesis, genesisRemainder] = cidResult;
|
57086
|
+
if (genesisRemainder.length === 0) {
|
57087
|
+
return {
|
57088
|
+
kind: "stream-id",
|
57089
|
+
type,
|
57090
|
+
genesis
|
57091
|
+
};
|
57092
|
+
} else if (genesisRemainder.length === 1 && genesisRemainder[0] === 0) {
|
57093
|
+
return {
|
57094
|
+
kind: "commit-id",
|
57095
|
+
type,
|
57096
|
+
genesis,
|
57097
|
+
commit: null
|
57098
|
+
};
|
57099
|
+
} else {
|
57100
|
+
const [commit] = readCid(genesisRemainder);
|
57101
|
+
return {
|
57102
|
+
kind: "commit-id",
|
57103
|
+
type,
|
57104
|
+
genesis,
|
57105
|
+
commit
|
57106
|
+
};
|
57107
|
+
}
|
57108
|
+
}
|
57109
|
+
__name(fromBytes, "fromBytes");
|
57110
|
+
var URL_PATTERN = /(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;
|
57111
|
+
function fromString5(input, title = "StreamRef") {
|
57112
|
+
const protocolMatch = URL_PATTERN.exec(input) || [];
|
57113
|
+
const base4 = protocolMatch[2];
|
57114
|
+
if (!base4)
|
57115
|
+
throw new Error(`Malformed ${title} string: ${input}`);
|
57116
|
+
const bytes = base36.decode(base4);
|
57117
|
+
const streamRef = fromBytes(bytes);
|
57118
|
+
const commit = protocolMatch[4];
|
57119
|
+
if (commit) {
|
57120
|
+
return {
|
57121
|
+
kind: "commit-id",
|
57122
|
+
type: streamRef.type,
|
57123
|
+
genesis: streamRef.genesis,
|
57124
|
+
commit: parseCommit(streamRef.genesis, commit)
|
57125
|
+
};
|
57126
|
+
}
|
57127
|
+
return streamRef;
|
57128
|
+
}
|
57129
|
+
__name(fromString5, "fromString");
|
57130
|
+
function parseCID(input) {
|
57131
|
+
try {
|
57132
|
+
return typeof input === "string" ? CID.parse(input) : CID.asCID(input);
|
57133
|
+
} catch {
|
57134
|
+
return null;
|
57135
|
+
}
|
57136
|
+
}
|
57137
|
+
__name(parseCID, "parseCID");
|
57138
|
+
function parseCommit(genesis, commit = null) {
|
57139
|
+
if (!commit)
|
57140
|
+
return null;
|
57141
|
+
if (commit === "0")
|
57142
|
+
return null;
|
57143
|
+
const commitCID = parseCID(commit);
|
57144
|
+
if (commitCID) {
|
57145
|
+
if (genesis.equals(commitCID)) {
|
57146
|
+
return null;
|
57147
|
+
} else {
|
57148
|
+
return commitCID;
|
57149
|
+
}
|
57150
|
+
} else {
|
57151
|
+
throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)");
|
57152
|
+
}
|
57153
|
+
}
|
57154
|
+
__name(parseCommit, "parseCommit");
|
57155
|
+
|
57156
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.7.0/node_modules/@ceramicnetwork/streamid/lib/stream-id.js
|
57071
57157
|
var __decorate = function(decorators, target, key2, desc) {
|
57072
57158
|
var c2 = arguments.length, r = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key2) : desc, d3;
|
57073
57159
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
@@ -57082,43 +57168,40 @@ var __metadata = function(k2, v) {
|
|
57082
57168
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
57083
57169
|
return Reflect.metadata(k2, v);
|
57084
57170
|
};
|
57085
|
-
|
57086
|
-
|
57087
|
-
|
57088
|
-
throw result;
|
57171
|
+
var InvalidStreamIDBytesError = class extends Error {
|
57172
|
+
constructor(bytes) {
|
57173
|
+
super(`Invalid StreamID bytes ${base36.encode(bytes)}: contains commit`);
|
57089
57174
|
}
|
57090
|
-
|
57091
|
-
|
57092
|
-
|
57093
|
-
|
57094
|
-
|
57095
|
-
if (streamCodec !== STREAMID_CODEC)
|
57096
|
-
return new Error("fromBytes: invalid streamid, does not include streamid codec");
|
57097
|
-
const [type, streamTypeRemainder] = readVarint(streamCodecRemainder);
|
57098
|
-
const cidResult = readCidNoThrow(streamTypeRemainder);
|
57099
|
-
if (cidResult instanceof Error) {
|
57100
|
-
return cidResult;
|
57175
|
+
};
|
57176
|
+
__name(InvalidStreamIDBytesError, "InvalidStreamIDBytesError");
|
57177
|
+
var InvalidStreamIDStringError = class extends Error {
|
57178
|
+
constructor(input) {
|
57179
|
+
super(`Invalid StreamID string ${input}: contains commit`);
|
57101
57180
|
}
|
57102
|
-
|
57103
|
-
|
57104
|
-
|
57181
|
+
};
|
57182
|
+
__name(InvalidStreamIDStringError, "InvalidStreamIDStringError");
|
57183
|
+
function fromBytes2(bytes) {
|
57184
|
+
const parsed = fromBytes(bytes, "StreamID");
|
57185
|
+
if (parsed.kind === "stream-id") {
|
57186
|
+
return new StreamID(parsed.type, parsed.genesis);
|
57105
57187
|
}
|
57106
|
-
|
57188
|
+
throw new InvalidStreamIDBytesError(bytes);
|
57189
|
+
}
|
57190
|
+
__name(fromBytes2, "fromBytes");
|
57191
|
+
function fromBytesNoThrow(bytes) {
|
57192
|
+
return tryCatch(() => fromBytes2(bytes));
|
57107
57193
|
}
|
57108
57194
|
__name(fromBytesNoThrow, "fromBytesNoThrow");
|
57109
|
-
function
|
57110
|
-
const
|
57111
|
-
if (
|
57112
|
-
|
57195
|
+
function fromString6(input) {
|
57196
|
+
const parsed = fromString5(input, "StreamID");
|
57197
|
+
if (parsed.kind === "stream-id") {
|
57198
|
+
return new StreamID(parsed.type, parsed.genesis);
|
57113
57199
|
}
|
57114
|
-
|
57200
|
+
throw new InvalidStreamIDStringError(input);
|
57115
57201
|
}
|
57116
|
-
__name(
|
57202
|
+
__name(fromString6, "fromString");
|
57117
57203
|
function fromStringNoThrow(input) {
|
57118
|
-
|
57119
|
-
const commitFree = protocolFree.includes("commit") ? protocolFree.split("?")[0] : protocolFree;
|
57120
|
-
const bytes = base36.decode(commitFree);
|
57121
|
-
return fromBytesNoThrow(bytes);
|
57204
|
+
return tryCatch(() => fromString6(input));
|
57122
57205
|
}
|
57123
57206
|
__name(fromStringNoThrow, "fromStringNoThrow");
|
57124
57207
|
var TAG = Symbol.for("@ceramicnetwork/streamid/StreamID");
|
@@ -57126,9 +57209,9 @@ var StreamID = class {
|
|
57126
57209
|
constructor(type, cid) {
|
57127
57210
|
this._tag = TAG;
|
57128
57211
|
if (!(type || type === 0))
|
57129
|
-
throw new Error("constructor: type required");
|
57212
|
+
throw new Error("StreamID constructor: type required");
|
57130
57213
|
if (!cid)
|
57131
|
-
throw new Error("constructor: cid required");
|
57214
|
+
throw new Error("StreamID constructor: cid required");
|
57132
57215
|
this._type = typeof type === "string" ? StreamType.codeByName(type) : type;
|
57133
57216
|
this._cid = typeof cid === "string" ? CID.parse(cid) : cid;
|
57134
57217
|
}
|
@@ -57177,9 +57260,9 @@ var StreamID = class {
|
|
57177
57260
|
}
|
57178
57261
|
};
|
57179
57262
|
__name(StreamID, "StreamID");
|
57180
|
-
StreamID.fromBytes =
|
57263
|
+
StreamID.fromBytes = fromBytes2;
|
57181
57264
|
StreamID.fromBytesNoThrow = fromBytesNoThrow;
|
57182
|
-
StreamID.fromString =
|
57265
|
+
StreamID.fromString = fromString6;
|
57183
57266
|
StreamID.fromStringNoThrow = fromStringNoThrow;
|
57184
57267
|
__decorate([
|
57185
57268
|
Memoize(),
|
@@ -57209,7 +57292,7 @@ __decorate([
|
|
57209
57292
|
__metadata("design:returntype", String)
|
57210
57293
|
], StreamID.prototype, "toUrl", null);
|
57211
57294
|
|
57212
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.
|
57295
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.7.0/node_modules/@ceramicnetwork/streamid/lib/commit-id.js
|
57213
57296
|
var __decorate2 = function(decorators, target, key2, desc) {
|
57214
57297
|
var c2 = arguments.length, r = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key2) : desc, d3;
|
57215
57298
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
@@ -57243,76 +57326,40 @@ var __classPrivateFieldGet = function(receiver, state, kind, f) {
|
|
57243
57326
|
var _CommitID_type;
|
57244
57327
|
var _CommitID_cid;
|
57245
57328
|
var _CommitID_commit;
|
57246
|
-
|
57247
|
-
|
57248
|
-
|
57249
|
-
throw result;
|
57329
|
+
var InvalidCommitIDBytesError = class extends Error {
|
57330
|
+
constructor(bytes) {
|
57331
|
+
super(`Error while parsing CommitID from bytes ${base36.encode(bytes)}: no commit information provided`);
|
57250
57332
|
}
|
57251
|
-
|
57333
|
+
};
|
57334
|
+
__name(InvalidCommitIDBytesError, "InvalidCommitIDBytesError");
|
57335
|
+
var InvalidCommitIDStringError = class extends Error {
|
57336
|
+
constructor(input) {
|
57337
|
+
super(`Error while parsing CommitID from string ${input}: no commit information provided`);
|
57338
|
+
}
|
57339
|
+
};
|
57340
|
+
__name(InvalidCommitIDStringError, "InvalidCommitIDStringError");
|
57341
|
+
function fromBytes3(bytes) {
|
57342
|
+
const parsed = fromBytes(bytes, "CommitID");
|
57343
|
+
if (parsed.kind === "commit-id") {
|
57344
|
+
return new CommitID(parsed.type, parsed.genesis, parsed.commit);
|
57345
|
+
}
|
57346
|
+
throw new InvalidCommitIDBytesError(bytes);
|
57252
57347
|
}
|
57253
|
-
__name(
|
57348
|
+
__name(fromBytes3, "fromBytes");
|
57254
57349
|
function fromBytesNoThrow2(bytes) {
|
57255
|
-
|
57256
|
-
if (streamCodec !== STREAMID_CODEC)
|
57257
|
-
return new Error("fromBytes: invalid streamid, does not include streamid codec");
|
57258
|
-
const [type, streamtypeRemainder] = readVarint(streamCodecRemainder);
|
57259
|
-
const cidResult = readCid(streamtypeRemainder);
|
57260
|
-
if (cidResult instanceof Error) {
|
57261
|
-
return cidResult;
|
57262
|
-
}
|
57263
|
-
const [base4, baseRemainder] = cidResult;
|
57264
|
-
if (baseRemainder.length === 0) {
|
57265
|
-
return new Error(`No commit information provided`);
|
57266
|
-
} else if (baseRemainder.length === 1) {
|
57267
|
-
return new CommitID(type, base4, baseRemainder[0]);
|
57268
|
-
} else {
|
57269
|
-
const [commit] = readCid(baseRemainder);
|
57270
|
-
return new CommitID(type, base4, commit);
|
57271
|
-
}
|
57350
|
+
return tryCatch(() => fromBytes3(bytes));
|
57272
57351
|
}
|
57273
57352
|
__name(fromBytesNoThrow2, "fromBytesNoThrow");
|
57274
|
-
function
|
57275
|
-
|
57276
|
-
|
57277
|
-
|
57278
|
-
return void 0;
|
57279
|
-
}
|
57280
|
-
}
|
57281
|
-
__name(parseCID, "parseCID");
|
57282
|
-
function parseCommit(genesis, commit = null) {
|
57283
|
-
if (!commit)
|
57284
|
-
return null;
|
57285
|
-
const commitCID = parseCID(commit);
|
57286
|
-
if (commitCID) {
|
57287
|
-
if (genesis.equals(commitCID)) {
|
57288
|
-
return null;
|
57289
|
-
} else {
|
57290
|
-
return commitCID;
|
57291
|
-
}
|
57292
|
-
} else if (String(commit) === "0") {
|
57293
|
-
return null;
|
57294
|
-
} else {
|
57295
|
-
throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)");
|
57353
|
+
function fromString7(input) {
|
57354
|
+
const parsed = fromString5(input, "CommitID");
|
57355
|
+
if (parsed.kind === "commit-id") {
|
57356
|
+
return new CommitID(parsed.type, parsed.genesis, parsed.commit);
|
57296
57357
|
}
|
57358
|
+
throw new InvalidCommitIDStringError(input);
|
57297
57359
|
}
|
57298
|
-
__name(
|
57299
|
-
function fromString6(input) {
|
57300
|
-
const result = fromStringNoThrow2(input);
|
57301
|
-
if (result instanceof Error) {
|
57302
|
-
throw result;
|
57303
|
-
}
|
57304
|
-
return result;
|
57305
|
-
}
|
57306
|
-
__name(fromString6, "fromString");
|
57360
|
+
__name(fromString7, "fromString");
|
57307
57361
|
function fromStringNoThrow2(input) {
|
57308
|
-
|
57309
|
-
if (protocolFree.includes("commit")) {
|
57310
|
-
const commit = protocolFree.split("?")[1].split("=")[1];
|
57311
|
-
const base4 = protocolFree.split("?")[0];
|
57312
|
-
return make(StreamID.fromString(base4), commit);
|
57313
|
-
} else {
|
57314
|
-
return fromBytesNoThrow2(base36.decode(protocolFree));
|
57315
|
-
}
|
57362
|
+
return tryCatch(() => fromString7(input));
|
57316
57363
|
}
|
57317
57364
|
__name(fromStringNoThrow2, "fromStringNoThrow");
|
57318
57365
|
var TAG2 = Symbol.for("@ceramicnetwork/streamid/CommitID");
|
@@ -57375,9 +57422,9 @@ var CommitID = class {
|
|
57375
57422
|
}
|
57376
57423
|
};
|
57377
57424
|
__name(CommitID, "CommitID");
|
57378
|
-
CommitID.fromBytes =
|
57425
|
+
CommitID.fromBytes = fromBytes3;
|
57379
57426
|
CommitID.fromBytesNoThrow = fromBytesNoThrow2;
|
57380
|
-
CommitID.fromString =
|
57427
|
+
CommitID.fromString = fromString7;
|
57381
57428
|
CommitID.fromStringNoThrow = fromStringNoThrow2;
|
57382
57429
|
CommitID.make = make;
|
57383
57430
|
__decorate2([
|
@@ -57413,29 +57460,50 @@ __decorate2([
|
|
57413
57460
|
__metadata2("design:returntype", String)
|
57414
57461
|
], CommitID.prototype, "toUrl", null);
|
57415
57462
|
|
57416
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.
|
57463
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+streamid@2.7.0/node_modules/@ceramicnetwork/streamid/lib/stream-ref.js
|
57464
|
+
init_base36();
|
57417
57465
|
var StreamRef;
|
57418
57466
|
(function(StreamRef2) {
|
57467
|
+
function fromBytes4(input) {
|
57468
|
+
const parsed = fromBytes(input);
|
57469
|
+
switch (parsed.kind) {
|
57470
|
+
case "commit-id":
|
57471
|
+
return new CommitID(parsed.type, parsed.genesis, parsed.commit);
|
57472
|
+
case "stream-id":
|
57473
|
+
return new StreamID(parsed.type, parsed.genesis);
|
57474
|
+
default:
|
57475
|
+
throw new Error(`Malformed StreamRef bytes: ${base36.encode(input)}`);
|
57476
|
+
}
|
57477
|
+
}
|
57478
|
+
__name(fromBytes4, "fromBytes");
|
57479
|
+
StreamRef2.fromBytes = fromBytes4;
|
57480
|
+
function fromString8(input) {
|
57481
|
+
const parsed = fromString5(input);
|
57482
|
+
switch (parsed.kind) {
|
57483
|
+
case "commit-id":
|
57484
|
+
return new CommitID(parsed.type, parsed.genesis, parsed.commit);
|
57485
|
+
case "stream-id":
|
57486
|
+
return new StreamID(parsed.type, parsed.genesis);
|
57487
|
+
default:
|
57488
|
+
throw new Error(`Malformed StreamRef string: ${input}`);
|
57489
|
+
}
|
57490
|
+
}
|
57491
|
+
__name(fromString8, "fromString");
|
57492
|
+
StreamRef2.fromString = fromString8;
|
57419
57493
|
function from4(input) {
|
57420
57494
|
if (StreamID.isInstance(input)) {
|
57421
57495
|
return input;
|
57422
|
-
}
|
57496
|
+
}
|
57497
|
+
if (CommitID.isInstance(input)) {
|
57423
57498
|
return input;
|
57424
|
-
} else if (input instanceof Uint8Array) {
|
57425
|
-
const commitId = CommitID.fromBytesNoThrow(input);
|
57426
|
-
if (commitId instanceof Error) {
|
57427
|
-
return StreamID.fromBytes(input);
|
57428
|
-
}
|
57429
|
-
return commitId;
|
57430
|
-
} else if (typeof input === "string") {
|
57431
|
-
const commitId = CommitID.fromStringNoThrow(input);
|
57432
|
-
if (commitId instanceof Error) {
|
57433
|
-
return StreamID.fromString(input);
|
57434
|
-
}
|
57435
|
-
return commitId;
|
57436
|
-
} else {
|
57437
|
-
throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(input)}`);
|
57438
57499
|
}
|
57500
|
+
if (input instanceof Uint8Array) {
|
57501
|
+
return fromBytes4(input);
|
57502
|
+
}
|
57503
|
+
if (typeof input === "string") {
|
57504
|
+
return fromString8(input);
|
57505
|
+
}
|
57506
|
+
throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(input)}`);
|
57439
57507
|
}
|
57440
57508
|
__name(from4, "from");
|
57441
57509
|
StreamRef2.from = from4;
|
@@ -59334,7 +59402,7 @@ function throttle(durationSelector, config2) {
|
|
59334
59402
|
}
|
59335
59403
|
__name(throttle, "throttle");
|
59336
59404
|
|
59337
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.
|
59405
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.13.0/node_modules/@ceramicnetwork/common/lib/stream.js
|
59338
59406
|
var SignatureStatus;
|
59339
59407
|
(function(SignatureStatus2) {
|
59340
59408
|
SignatureStatus2[SignatureStatus2["GENESIS"] = 0] = "GENESIS";
|
@@ -59405,10 +59473,10 @@ function StreamStatic() {
|
|
59405
59473
|
}
|
59406
59474
|
__name(StreamStatic, "StreamStatic");
|
59407
59475
|
|
59408
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.
|
59476
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.13.0/node_modules/@ceramicnetwork/common/lib/utils/http-utils.js
|
59409
59477
|
var import_cross_fetch = __toESM(require("cross-fetch"), 1);
|
59410
59478
|
|
59411
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.
|
59479
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.13.0/node_modules/@ceramicnetwork/common/lib/utils/abort-signal-utils.js
|
59412
59480
|
function mergeAbortSignals(signals) {
|
59413
59481
|
const controller = new AbortController();
|
59414
59482
|
if (signals.length === 0) {
|
@@ -59455,7 +59523,7 @@ async function abortable2(original, fn) {
|
|
59455
59523
|
}
|
59456
59524
|
__name(abortable2, "abortable");
|
59457
59525
|
|
59458
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.
|
59526
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.13.0/node_modules/@ceramicnetwork/common/lib/utils/http-utils.js
|
59459
59527
|
var DEFAULT_FETCH_TIMEOUT = 60 * 1e3 * 3;
|
59460
59528
|
async function fetchJson(url, opts = {}) {
|
59461
59529
|
if (opts.body) {
|
@@ -59478,10 +59546,10 @@ async function fetchJson(url, opts = {}) {
|
|
59478
59546
|
}
|
59479
59547
|
__name(fetchJson, "fetchJson");
|
59480
59548
|
|
59481
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.
|
59549
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.13.0/node_modules/@ceramicnetwork/common/lib/utils/stream-utils.js
|
59482
59550
|
var import_lodash2 = __toESM(require_lodash(), 1);
|
59483
59551
|
|
59484
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.
|
59552
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.13.0/node_modules/@ceramicnetwork/common/lib/utils/cid-utils.js
|
59485
59553
|
init_cid();
|
59486
59554
|
function toCID(givenCid) {
|
59487
59555
|
const cid = CID.asCID(givenCid);
|
@@ -59498,7 +59566,7 @@ function toCID(givenCid) {
|
|
59498
59566
|
}
|
59499
59567
|
__name(toCID, "toCID");
|
59500
59568
|
|
59501
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.
|
59569
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.13.0/node_modules/@ceramicnetwork/common/lib/utils/stream-utils.js
|
59502
59570
|
var TILE_TYPE_ID = 0;
|
59503
59571
|
var StreamUtils = class {
|
59504
59572
|
static streamIdFromState(state) {
|
@@ -59662,7 +59730,7 @@ var StreamUtils = class {
|
|
59662
59730
|
};
|
59663
59731
|
__name(StreamUtils, "StreamUtils");
|
59664
59732
|
|
59665
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.
|
59733
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.13.0/node_modules/@ceramicnetwork/common/lib/utils/accountid-utils.js
|
59666
59734
|
function normalizeAccountId(accountId) {
|
59667
59735
|
if (typeof accountId === "string" && accountId.includes("@")) {
|
59668
59736
|
const [address, chainId] = accountId.split("@");
|
@@ -59675,7 +59743,7 @@ function normalizeAccountId(accountId) {
|
|
59675
59743
|
}
|
59676
59744
|
__name(normalizeAccountId, "normalizeAccountId");
|
59677
59745
|
|
59678
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.
|
59746
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+common@2.13.0/node_modules/@ceramicnetwork/common/lib/stream-state-subject.js
|
59679
59747
|
var StreamStateSubject = class extends BehaviorSubject {
|
59680
59748
|
next(next) {
|
59681
59749
|
const current = this.value;
|
@@ -59686,7 +59754,7 @@ var StreamStateSubject = class extends BehaviorSubject {
|
|
59686
59754
|
};
|
59687
59755
|
__name(StreamStateSubject, "StreamStateSubject");
|
59688
59756
|
|
59689
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+stream-tile@2.
|
59757
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+stream-tile@2.9.0/node_modules/@ceramicnetwork/stream-tile/lib/tile-document.js
|
59690
59758
|
var __decorate4 = function(decorators, target, key2, desc) {
|
59691
59759
|
var c2 = arguments.length, r = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key2) : desc, d3;
|
59692
59760
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
@@ -59722,10 +59790,10 @@ function headerFromMetadata(metadata, genesis) {
|
|
59722
59790
|
};
|
59723
59791
|
if (genesis) {
|
59724
59792
|
if (!metadata?.deterministic) {
|
59725
|
-
header
|
59793
|
+
header["unique"] = toString3((0, import_random3.randomBytes)(12), "base64");
|
59726
59794
|
}
|
59727
59795
|
if (metadata?.forbidControllerChange) {
|
59728
|
-
header
|
59796
|
+
header["forbidControllerChange"] = true;
|
59729
59797
|
}
|
59730
59798
|
} else {
|
59731
59799
|
if (metadata?.deterministic !== void 0 || metadata?.unique !== void 0) {
|
@@ -59739,18 +59807,18 @@ function headerFromMetadata(metadata, genesis) {
|
|
59739
59807
|
return header;
|
59740
59808
|
}
|
59741
59809
|
__name(headerFromMetadata, "headerFromMetadata");
|
59742
|
-
async function
|
59743
|
-
if (signer.did
|
59744
|
-
throw new Error(
|
59745
|
-
}
|
59810
|
+
async function getAuthenticatedDID(signer) {
|
59811
|
+
if (!signer.did)
|
59812
|
+
throw new Error(`No DID provided`);
|
59746
59813
|
if (!signer.did.authenticated) {
|
59747
59814
|
await signer.did.authenticate();
|
59748
59815
|
if (signer.loggerProvider) {
|
59749
59816
|
signer.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${signer.did.id}`);
|
59750
59817
|
}
|
59751
59818
|
}
|
59819
|
+
return signer.did;
|
59752
59820
|
}
|
59753
|
-
__name(
|
59821
|
+
__name(getAuthenticatedDID, "getAuthenticatedDID");
|
59754
59822
|
async function throwReadOnlyError() {
|
59755
59823
|
throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.");
|
59756
59824
|
}
|
@@ -59834,10 +59902,11 @@ var TileDocument = TileDocument_1 = /* @__PURE__ */ __name(class TileDocument2 e
|
|
59834
59902
|
return this._isReadOnly;
|
59835
59903
|
}
|
59836
59904
|
async makeCommit(signer, newContent, newMetadata) {
|
59837
|
-
const commit = await this._makeRawCommit(
|
59905
|
+
const commit = await this._makeRawCommit(newContent, newMetadata);
|
59838
59906
|
return TileDocument_1._signDagJWS(signer, commit);
|
59839
59907
|
}
|
59840
|
-
async _makeRawCommit(
|
59908
|
+
async _makeRawCommit(newContent, newMetadata) {
|
59909
|
+
newMetadata || (newMetadata = {});
|
59841
59910
|
const header = headerFromMetadata(newMetadata, false);
|
59842
59911
|
if (newContent == null) {
|
59843
59912
|
newContent = this.content;
|
@@ -59851,22 +59920,20 @@ var TileDocument = TileDocument_1 = /* @__PURE__ */ __name(class TileDocument2 e
|
|
59851
59920
|
}
|
59852
59921
|
}
|
59853
59922
|
const patch = fast_json_patch_default.compare(this.content, newContent);
|
59854
|
-
const
|
59923
|
+
const genesisLogEntry = this.state.log[0];
|
59924
|
+
return {
|
59855
59925
|
header,
|
59856
59926
|
data: patch,
|
59857
59927
|
prev: this.tip,
|
59858
|
-
id:
|
59928
|
+
id: genesisLogEntry.cid
|
59859
59929
|
};
|
59860
|
-
return commit;
|
59861
59930
|
}
|
59862
59931
|
static async makeGenesis(signer, content, metadata) {
|
59863
|
-
|
59864
|
-
metadata = {};
|
59865
|
-
}
|
59932
|
+
metadata || (metadata = {});
|
59866
59933
|
if (!metadata.controllers || metadata.controllers.length === 0) {
|
59867
59934
|
if (signer.did) {
|
59868
|
-
await
|
59869
|
-
metadata.controllers = [
|
59935
|
+
const did = await getAuthenticatedDID(signer);
|
59936
|
+
metadata.controllers = [did.hasParent ? did.parent : did.id];
|
59870
59937
|
} else {
|
59871
59938
|
throw new Error("No controllers specified");
|
59872
59939
|
}
|
@@ -59887,8 +59954,8 @@ var TileDocument = TileDocument_1 = /* @__PURE__ */ __name(class TileDocument2 e
|
|
59887
59954
|
return TileDocument_1._signDagJWS(signer, commit);
|
59888
59955
|
}
|
59889
59956
|
static async _signDagJWS(signer, commit) {
|
59890
|
-
await
|
59891
|
-
return
|
59957
|
+
const did = await getAuthenticatedDID(signer);
|
59958
|
+
return did.createDagJWS(commit);
|
59892
59959
|
}
|
59893
59960
|
}, "TileDocument");
|
59894
59961
|
TileDocument.STREAM_TYPE_NAME = "tile";
|
@@ -60162,7 +60229,7 @@ var Document = class extends Observable {
|
|
60162
60229
|
};
|
60163
60230
|
__name(Document, "Document");
|
60164
60231
|
|
60165
|
-
// ../../node_modules/.pnpm/@ceramicnetwork+stream-caip10-link@2.
|
60232
|
+
// ../../node_modules/.pnpm/@ceramicnetwork+stream-caip10-link@2.8.0/node_modules/@ceramicnetwork/stream-caip10-link/lib/caip10-link.js
|
60166
60233
|
var import_lodash4 = __toESM(require_lodash(), 1);
|
60167
60234
|
var __decorate5 = function(decorators, target, key2, desc) {
|
60168
60235
|
var c2 = arguments.length, r = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key2) : desc, d3;
|
@@ -60287,7 +60354,7 @@ var __decorate6 = function(decorators, target, key2, desc) {
|
|
60287
60354
|
};
|
60288
60355
|
var Model_1;
|
60289
60356
|
var DEFAULT_LOAD_OPTS3 = { sync: SyncOptions.PREFER_CACHE };
|
60290
|
-
async function
|
60357
|
+
async function _ensureAuthenticated(signer) {
|
60291
60358
|
if (signer.did == null) {
|
60292
60359
|
throw new Error("No DID provided");
|
60293
60360
|
}
|
@@ -60298,7 +60365,7 @@ async function _ensureAuthenticated2(signer) {
|
|
60298
60365
|
}
|
60299
60366
|
}
|
60300
60367
|
}
|
60301
|
-
__name(
|
60368
|
+
__name(_ensureAuthenticated, "_ensureAuthenticated");
|
60302
60369
|
async function throwReadOnlyError3() {
|
60303
60370
|
throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.");
|
60304
60371
|
}
|
@@ -60369,7 +60436,7 @@ var Model = Model_1 = /* @__PURE__ */ __name(class Model2 extends Stream {
|
|
60369
60436
|
}
|
60370
60437
|
if (!metadata || !metadata.controller) {
|
60371
60438
|
if (signer.did) {
|
60372
|
-
await
|
60439
|
+
await _ensureAuthenticated(signer);
|
60373
60440
|
metadata = { controller: signer.did.hasParent ? signer.did.parent : signer.did.id };
|
60374
60441
|
} else {
|
60375
60442
|
throw new Error("No controller specified");
|
@@ -60389,7 +60456,7 @@ var Model = Model_1 = /* @__PURE__ */ __name(class Model2 extends Stream {
|
|
60389
60456
|
return this._isReadOnly;
|
60390
60457
|
}
|
60391
60458
|
static async _signDagJWS(signer, commit) {
|
60392
|
-
await
|
60459
|
+
await _ensureAuthenticated(signer);
|
60393
60460
|
return signer.did.createDagJWS(commit);
|
60394
60461
|
}
|
60395
60462
|
}, "Model");
|
@@ -60434,7 +60501,7 @@ var DEFAULT_DETERMINISTIC_OPTS = {
|
|
60434
60501
|
};
|
60435
60502
|
var DEFAULT_LOAD_OPTS4 = { sync: SyncOptions.PREFER_CACHE };
|
60436
60503
|
var DEFAULT_UPDATE_OPTS3 = { anchor: true, publish: true, throwOnInvalidCommit: true };
|
60437
|
-
async function
|
60504
|
+
async function _ensureAuthenticated2(signer) {
|
60438
60505
|
if (signer.did == null) {
|
60439
60506
|
throw new Error("No DID provided");
|
60440
60507
|
}
|
@@ -60445,7 +60512,7 @@ async function _ensureAuthenticated3(signer) {
|
|
60445
60512
|
}
|
60446
60513
|
}
|
60447
60514
|
}
|
60448
|
-
__name(
|
60515
|
+
__name(_ensureAuthenticated2, "_ensureAuthenticated");
|
60449
60516
|
async function throwReadOnlyError4() {
|
60450
60517
|
throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.");
|
60451
60518
|
}
|
@@ -60538,7 +60605,7 @@ var ModelInstanceDocument = ModelInstanceDocument_1 = /* @__PURE__ */ __name(cla
|
|
60538
60605
|
let controller = metadata.controller;
|
60539
60606
|
if (!controller) {
|
60540
60607
|
if (signer.did) {
|
60541
|
-
await
|
60608
|
+
await _ensureAuthenticated2(signer);
|
60542
60609
|
controller = signer.did.hasParent ? signer.did.parent : signer.did.id;
|
60543
60610
|
} else {
|
60544
60611
|
throw new Error("No controller specified");
|
@@ -60554,7 +60621,7 @@ var ModelInstanceDocument = ModelInstanceDocument_1 = /* @__PURE__ */ __name(cla
|
|
60554
60621
|
return { data: content, header };
|
60555
60622
|
}
|
60556
60623
|
static async _signDagJWS(signer, commit) {
|
60557
|
-
await
|
60624
|
+
await _ensureAuthenticated2(signer);
|
60558
60625
|
return signer.did.createDagJWS(commit);
|
60559
60626
|
}
|
60560
60627
|
}, "ModelInstanceDocument");
|