@learncard/ceramic-plugin 1.1.31 → 1.1.32
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/dist/ceramic-plugin.cjs.development.cjs +132 -48
- package/dist/ceramic-plugin.cjs.development.cjs.map +4 -4
- package/dist/ceramic-plugin.cjs.production.min.cjs +99 -99
- package/dist/ceramic-plugin.cjs.production.min.cjs.map +4 -4
- package/dist/ceramic-plugin.esm.js +132 -48
- package/dist/ceramic-plugin.esm.js.map +4 -4
- package/dist/ceramic.d.ts.map +1 -1
- package/dist/helpers.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -4440,10 +4440,10 @@ var require_lodash = __commonJS({
|
|
|
4440
4440
|
return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
|
|
4441
4441
|
}
|
|
4442
4442
|
__name(cloneWith, "cloneWith");
|
|
4443
|
-
function
|
|
4443
|
+
function cloneDeep7(value) {
|
|
4444
4444
|
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
|
|
4445
4445
|
}
|
|
4446
|
-
__name(
|
|
4446
|
+
__name(cloneDeep7, "cloneDeep");
|
|
4447
4447
|
function cloneDeepWith(value, customizer) {
|
|
4448
4448
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
4449
4449
|
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
|
|
@@ -5693,7 +5693,7 @@ var require_lodash = __commonJS({
|
|
|
5693
5693
|
lodash.ceil = ceil;
|
|
5694
5694
|
lodash.clamp = clamp;
|
|
5695
5695
|
lodash.clone = clone2;
|
|
5696
|
-
lodash.cloneDeep =
|
|
5696
|
+
lodash.cloneDeep = cloneDeep7;
|
|
5697
5697
|
lodash.cloneDeepWith = cloneDeepWith;
|
|
5698
5698
|
lodash.cloneWith = cloneWith;
|
|
5699
5699
|
lodash.conformsTo = conformsTo;
|
|
@@ -10518,7 +10518,10 @@ var require_bn = __commonJS({
|
|
|
10518
10518
|
this.words[i2] = carry;
|
|
10519
10519
|
this.length++;
|
|
10520
10520
|
}
|
|
10521
|
-
|
|
10521
|
+
if (num === 0) {
|
|
10522
|
+
this.length = 1;
|
|
10523
|
+
this._normSign();
|
|
10524
|
+
}
|
|
10522
10525
|
return this;
|
|
10523
10526
|
}, "imuln");
|
|
10524
10527
|
BN3.prototype.muln = /* @__PURE__ */ __name(function muln(num) {
|
|
@@ -10911,12 +10914,14 @@ var require_bn = __commonJS({
|
|
|
10911
10914
|
BN3.prototype.divRound = /* @__PURE__ */ __name(function divRound(num) {
|
|
10912
10915
|
var dm = this.divmod(num);
|
|
10913
10916
|
if (dm.mod.isZero()) return dm.div;
|
|
10914
|
-
var mod = dm.
|
|
10915
|
-
var half = num.
|
|
10916
|
-
var r2 = num.
|
|
10917
|
+
var mod = dm.mod.abs();
|
|
10918
|
+
var half = num.abs().iushrn(1);
|
|
10919
|
+
var r2 = num.words[0] & 1;
|
|
10917
10920
|
var cmp = mod.cmp(half);
|
|
10918
10921
|
if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
|
|
10919
|
-
|
|
10922
|
+
var up = new BN3(1);
|
|
10923
|
+
up.negative = this.negative ^ num.negative;
|
|
10924
|
+
return dm.div.iadd(up);
|
|
10920
10925
|
}, "divRound");
|
|
10921
10926
|
BN3.prototype.modn = /* @__PURE__ */ __name(function modn(num) {
|
|
10922
10927
|
assert3(num <= 67108863);
|
|
@@ -33173,7 +33178,10 @@ var require_bn2 = __commonJS({
|
|
|
33173
33178
|
this.words[i2] = carry;
|
|
33174
33179
|
this.length++;
|
|
33175
33180
|
}
|
|
33176
|
-
|
|
33181
|
+
if (num === 0) {
|
|
33182
|
+
this.length = 1;
|
|
33183
|
+
this._normSign();
|
|
33184
|
+
}
|
|
33177
33185
|
return isNegNum ? this.ineg() : this;
|
|
33178
33186
|
}, "imuln");
|
|
33179
33187
|
BN3.prototype.muln = /* @__PURE__ */ __name(function muln(num) {
|
|
@@ -33566,12 +33574,14 @@ var require_bn2 = __commonJS({
|
|
|
33566
33574
|
BN3.prototype.divRound = /* @__PURE__ */ __name(function divRound(num) {
|
|
33567
33575
|
var dm = this.divmod(num);
|
|
33568
33576
|
if (dm.mod.isZero()) return dm.div;
|
|
33569
|
-
var mod = dm.
|
|
33570
|
-
var half = num.
|
|
33571
|
-
var r2 = num.
|
|
33577
|
+
var mod = dm.mod.abs();
|
|
33578
|
+
var half = num.abs().iushrn(1);
|
|
33579
|
+
var r2 = num.words[0] & 1;
|
|
33572
33580
|
var cmp = mod.cmp(half);
|
|
33573
33581
|
if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
|
|
33574
|
-
|
|
33582
|
+
var up = new BN3(1);
|
|
33583
|
+
up.negative = this.negative ^ num.negative;
|
|
33584
|
+
return dm.div.iadd(up);
|
|
33575
33585
|
}, "divRound");
|
|
33576
33586
|
BN3.prototype.modrn = /* @__PURE__ */ __name(function modrn(num) {
|
|
33577
33587
|
var isNegNum = num < 0;
|
|
@@ -35141,10 +35151,10 @@ var require_lodash2 = __commonJS({
|
|
|
35141
35151
|
return "";
|
|
35142
35152
|
}
|
|
35143
35153
|
__name(toSource, "toSource");
|
|
35144
|
-
function
|
|
35154
|
+
function cloneDeep7(value) {
|
|
35145
35155
|
return baseClone(value, true, true);
|
|
35146
35156
|
}
|
|
35147
|
-
__name(
|
|
35157
|
+
__name(cloneDeep7, "cloneDeep");
|
|
35148
35158
|
function eq4(value, other) {
|
|
35149
35159
|
return value === other || value !== value && other !== other;
|
|
35150
35160
|
}
|
|
@@ -35193,7 +35203,7 @@ var require_lodash2 = __commonJS({
|
|
|
35193
35203
|
return false;
|
|
35194
35204
|
}
|
|
35195
35205
|
__name(stubFalse, "stubFalse");
|
|
35196
|
-
module2.exports =
|
|
35206
|
+
module2.exports = cloneDeep7;
|
|
35197
35207
|
}
|
|
35198
35208
|
});
|
|
35199
35209
|
|
|
@@ -37096,7 +37106,7 @@ __export(index_exports, {
|
|
|
37096
37106
|
module.exports = __toCommonJS(index_exports);
|
|
37097
37107
|
|
|
37098
37108
|
// src/ceramic.ts
|
|
37099
|
-
var
|
|
37109
|
+
var import_lodash7 = __toESM(require_lodash(), 1);
|
|
37100
37110
|
|
|
37101
37111
|
// ../../../node_modules/did-resolver/lib/resolver.module.js
|
|
37102
37112
|
function _catch(body, recover) {
|
|
@@ -42829,7 +42839,7 @@ function abortable(source, signal) {
|
|
|
42829
42839
|
}
|
|
42830
42840
|
__name(abortable, "abortable");
|
|
42831
42841
|
|
|
42832
|
-
// ../../../node_modules/nanoid/index.browser.js
|
|
42842
|
+
// ../../../node_modules/rpc-utils/node_modules/nanoid/index.browser.js
|
|
42833
42843
|
var nanoid = /* @__PURE__ */ __name((size = 21) => crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
|
|
42834
42844
|
byte &= 63;
|
|
42835
42845
|
if (byte < 36) {
|
|
@@ -51018,10 +51028,10 @@ var import_random3 = __toESM(require_random(), 1);
|
|
|
51018
51028
|
|
|
51019
51029
|
// ../../../node_modules/@ceramicnetwork/common/lib/streamopts.js
|
|
51020
51030
|
var SyncOptions;
|
|
51021
|
-
(function(
|
|
51022
|
-
|
|
51023
|
-
|
|
51024
|
-
|
|
51031
|
+
(function(SyncOptions4) {
|
|
51032
|
+
SyncOptions4[SyncOptions4["PREFER_CACHE"] = 0] = "PREFER_CACHE";
|
|
51033
|
+
SyncOptions4[SyncOptions4["SYNC_ALWAYS"] = 1] = "SYNC_ALWAYS";
|
|
51034
|
+
SyncOptions4[SyncOptions4["NEVER_SYNC"] = 2] = "NEVER_SYNC";
|
|
51025
51035
|
})(SyncOptions || (SyncOptions = {}));
|
|
51026
51036
|
|
|
51027
51037
|
// ../../../node_modules/@ceramicnetwork/common/lib/stream.js
|
|
@@ -54698,10 +54708,10 @@ __name(throttle, "throttle");
|
|
|
54698
54708
|
|
|
54699
54709
|
// ../../../node_modules/@ceramicnetwork/common/lib/stream.js
|
|
54700
54710
|
var SignatureStatus;
|
|
54701
|
-
(function(
|
|
54702
|
-
|
|
54703
|
-
|
|
54704
|
-
|
|
54711
|
+
(function(SignatureStatus4) {
|
|
54712
|
+
SignatureStatus4[SignatureStatus4["GENESIS"] = 0] = "GENESIS";
|
|
54713
|
+
SignatureStatus4[SignatureStatus4["PARTIAL"] = 1] = "PARTIAL";
|
|
54714
|
+
SignatureStatus4[SignatureStatus4["SIGNED"] = 2] = "SIGNED";
|
|
54705
54715
|
})(SignatureStatus || (SignatureStatus = {}));
|
|
54706
54716
|
var AnchorStatus;
|
|
54707
54717
|
(function(AnchorStatus2) {
|
|
@@ -54712,10 +54722,10 @@ var AnchorStatus;
|
|
|
54712
54722
|
AnchorStatus2[AnchorStatus2["FAILED"] = 4] = "FAILED";
|
|
54713
54723
|
})(AnchorStatus || (AnchorStatus = {}));
|
|
54714
54724
|
var CommitType;
|
|
54715
|
-
(function(
|
|
54716
|
-
|
|
54717
|
-
|
|
54718
|
-
|
|
54725
|
+
(function(CommitType4) {
|
|
54726
|
+
CommitType4[CommitType4["GENESIS"] = 0] = "GENESIS";
|
|
54727
|
+
CommitType4[CommitType4["SIGNED"] = 1] = "SIGNED";
|
|
54728
|
+
CommitType4[CommitType4["ANCHOR"] = 2] = "ANCHOR";
|
|
54719
54729
|
})(CommitType || (CommitType = {}));
|
|
54720
54730
|
var _Stream = class _Stream extends Observable {
|
|
54721
54731
|
constructor(state$, _context) {
|
|
@@ -56346,26 +56356,26 @@ var Document = _Document;
|
|
|
56346
56356
|
|
|
56347
56357
|
// ../../../node_modules/@ceramicnetwork/stream-caip10-link/node_modules/@ceramicnetwork/common/lib/streamopts.js
|
|
56348
56358
|
var SyncOptions2;
|
|
56349
|
-
(function(
|
|
56350
|
-
|
|
56351
|
-
|
|
56352
|
-
|
|
56353
|
-
|
|
56359
|
+
(function(SyncOptions4) {
|
|
56360
|
+
SyncOptions4[SyncOptions4["PREFER_CACHE"] = 0] = "PREFER_CACHE";
|
|
56361
|
+
SyncOptions4[SyncOptions4["SYNC_ALWAYS"] = 1] = "SYNC_ALWAYS";
|
|
56362
|
+
SyncOptions4[SyncOptions4["NEVER_SYNC"] = 2] = "NEVER_SYNC";
|
|
56363
|
+
SyncOptions4[SyncOptions4["SYNC_ON_ERROR"] = 3] = "SYNC_ON_ERROR";
|
|
56354
56364
|
})(SyncOptions2 || (SyncOptions2 = {}));
|
|
56355
56365
|
|
|
56356
56366
|
// ../../../node_modules/@ceramicnetwork/stream-caip10-link/node_modules/@ceramicnetwork/common/lib/stream.js
|
|
56357
56367
|
var import_lodash4 = __toESM(require_lodash2(), 1);
|
|
56358
56368
|
var SignatureStatus2;
|
|
56359
|
-
(function(
|
|
56360
|
-
|
|
56361
|
-
|
|
56362
|
-
|
|
56369
|
+
(function(SignatureStatus4) {
|
|
56370
|
+
SignatureStatus4[SignatureStatus4["GENESIS"] = 0] = "GENESIS";
|
|
56371
|
+
SignatureStatus4[SignatureStatus4["PARTIAL"] = 1] = "PARTIAL";
|
|
56372
|
+
SignatureStatus4[SignatureStatus4["SIGNED"] = 2] = "SIGNED";
|
|
56363
56373
|
})(SignatureStatus2 || (SignatureStatus2 = {}));
|
|
56364
56374
|
var CommitType2;
|
|
56365
|
-
(function(
|
|
56366
|
-
|
|
56367
|
-
|
|
56368
|
-
|
|
56375
|
+
(function(CommitType4) {
|
|
56376
|
+
CommitType4[CommitType4["GENESIS"] = 0] = "GENESIS";
|
|
56377
|
+
CommitType4[CommitType4["SIGNED"] = 1] = "SIGNED";
|
|
56378
|
+
CommitType4[CommitType4["ANCHOR"] = 2] = "ANCHOR";
|
|
56369
56379
|
})(CommitType2 || (CommitType2 = {}));
|
|
56370
56380
|
var _Stream2 = class _Stream2 extends Observable {
|
|
56371
56381
|
constructor(state$, _context) {
|
|
@@ -56575,6 +56585,80 @@ Caip10Link = Caip10Link_1 = __decorate4([
|
|
|
56575
56585
|
StreamStatic2()
|
|
56576
56586
|
], Caip10Link);
|
|
56577
56587
|
|
|
56588
|
+
// ../../../node_modules/@ceramicnetwork/stream-model/node_modules/@ceramicnetwork/common/lib/streamopts.js
|
|
56589
|
+
var SyncOptions3;
|
|
56590
|
+
(function(SyncOptions4) {
|
|
56591
|
+
SyncOptions4[SyncOptions4["PREFER_CACHE"] = 0] = "PREFER_CACHE";
|
|
56592
|
+
SyncOptions4[SyncOptions4["SYNC_ALWAYS"] = 1] = "SYNC_ALWAYS";
|
|
56593
|
+
SyncOptions4[SyncOptions4["NEVER_SYNC"] = 2] = "NEVER_SYNC";
|
|
56594
|
+
SyncOptions4[SyncOptions4["SYNC_ON_ERROR"] = 3] = "SYNC_ON_ERROR";
|
|
56595
|
+
})(SyncOptions3 || (SyncOptions3 = {}));
|
|
56596
|
+
|
|
56597
|
+
// ../../../node_modules/@ceramicnetwork/stream-model/node_modules/@ceramicnetwork/common/lib/stream.js
|
|
56598
|
+
var import_lodash6 = __toESM(require_lodash2(), 1);
|
|
56599
|
+
var SignatureStatus3;
|
|
56600
|
+
(function(SignatureStatus4) {
|
|
56601
|
+
SignatureStatus4[SignatureStatus4["GENESIS"] = 0] = "GENESIS";
|
|
56602
|
+
SignatureStatus4[SignatureStatus4["PARTIAL"] = 1] = "PARTIAL";
|
|
56603
|
+
SignatureStatus4[SignatureStatus4["SIGNED"] = 2] = "SIGNED";
|
|
56604
|
+
})(SignatureStatus3 || (SignatureStatus3 = {}));
|
|
56605
|
+
var CommitType3;
|
|
56606
|
+
(function(CommitType4) {
|
|
56607
|
+
CommitType4[CommitType4["GENESIS"] = 0] = "GENESIS";
|
|
56608
|
+
CommitType4[CommitType4["SIGNED"] = 1] = "SIGNED";
|
|
56609
|
+
CommitType4[CommitType4["ANCHOR"] = 2] = "ANCHOR";
|
|
56610
|
+
})(CommitType3 || (CommitType3 = {}));
|
|
56611
|
+
var _Stream3 = class _Stream3 extends Observable {
|
|
56612
|
+
constructor(state$, _context) {
|
|
56613
|
+
super((subscriber) => {
|
|
56614
|
+
state$.subscribe(subscriber);
|
|
56615
|
+
});
|
|
56616
|
+
this.state$ = state$;
|
|
56617
|
+
this._context = _context;
|
|
56618
|
+
}
|
|
56619
|
+
get id() {
|
|
56620
|
+
return new StreamID(this.state$.value.type, this.state$.value.log[0].cid);
|
|
56621
|
+
}
|
|
56622
|
+
get api() {
|
|
56623
|
+
return this._context.api;
|
|
56624
|
+
}
|
|
56625
|
+
get content() {
|
|
56626
|
+
const { next, content } = this.state$.value;
|
|
56627
|
+
return (0, import_lodash6.default)(next?.content ?? content);
|
|
56628
|
+
}
|
|
56629
|
+
get tip() {
|
|
56630
|
+
return this.state$.value.log[this.state$.value.log.length - 1].cid;
|
|
56631
|
+
}
|
|
56632
|
+
get commitId() {
|
|
56633
|
+
return CommitID.make(this.id, this.tip);
|
|
56634
|
+
}
|
|
56635
|
+
get allCommitIds() {
|
|
56636
|
+
return this.state$.value.log.map(({ cid }) => CommitID.make(this.id, cid));
|
|
56637
|
+
}
|
|
56638
|
+
get anchorCommitIds() {
|
|
56639
|
+
return this.state$.value.log.filter(({ type }) => type === CommitType3.ANCHOR).map(({ cid }) => CommitID.make(this.id, cid));
|
|
56640
|
+
}
|
|
56641
|
+
get state() {
|
|
56642
|
+
return (0, import_lodash6.default)(this.state$.value);
|
|
56643
|
+
}
|
|
56644
|
+
async sync(opts = {}) {
|
|
56645
|
+
opts = { sync: SyncOptions3.PREFER_CACHE, ...opts };
|
|
56646
|
+
const stream = await this.api.loadStream(this.id, opts);
|
|
56647
|
+
this.state$.next(stream.state);
|
|
56648
|
+
}
|
|
56649
|
+
async requestAnchor() {
|
|
56650
|
+
return this.api.requestAnchor(this.id);
|
|
56651
|
+
}
|
|
56652
|
+
};
|
|
56653
|
+
__name(_Stream3, "Stream");
|
|
56654
|
+
var Stream3 = _Stream3;
|
|
56655
|
+
function StreamStatic3() {
|
|
56656
|
+
return (constructor) => {
|
|
56657
|
+
constructor;
|
|
56658
|
+
};
|
|
56659
|
+
}
|
|
56660
|
+
__name(StreamStatic3, "StreamStatic");
|
|
56661
|
+
|
|
56578
56662
|
// ../../../node_modules/@ceramicnetwork/stream-model/node_modules/multiformats/esm/vendor/varint.js
|
|
56579
56663
|
var encode_19 = encode29;
|
|
56580
56664
|
var MSB9 = 128;
|
|
@@ -57401,7 +57485,7 @@ var __decorate5 = function(decorators, target, key2, desc) {
|
|
|
57401
57485
|
return c > 3 && r2 && Object.defineProperty(target, key2, r2), r2;
|
|
57402
57486
|
};
|
|
57403
57487
|
var Model_1;
|
|
57404
|
-
var DEFAULT_LOAD_OPTS3 = { sync:
|
|
57488
|
+
var DEFAULT_LOAD_OPTS3 = { sync: SyncOptions3.PREFER_CACHE };
|
|
57405
57489
|
async function _ensureAuthenticated(signer) {
|
|
57406
57490
|
if (signer.did == null) {
|
|
57407
57491
|
throw new Error("No DID provided");
|
|
@@ -57419,7 +57503,7 @@ async function throwReadOnlyError3() {
|
|
|
57419
57503
|
}
|
|
57420
57504
|
__name(throwReadOnlyError3, "throwReadOnlyError");
|
|
57421
57505
|
var _a3;
|
|
57422
|
-
var Model = Model_1 = (_a3 = class extends
|
|
57506
|
+
var Model = Model_1 = (_a3 = class extends Stream3 {
|
|
57423
57507
|
constructor() {
|
|
57424
57508
|
super(...arguments);
|
|
57425
57509
|
this._isReadOnly = false;
|
|
@@ -57436,7 +57520,7 @@ var Model = Model_1 = (_a3 = class extends Stream {
|
|
|
57436
57520
|
publish: true,
|
|
57437
57521
|
anchor: true,
|
|
57438
57522
|
pin: true,
|
|
57439
|
-
sync:
|
|
57523
|
+
sync: SyncOptions3.NEVER_SYNC,
|
|
57440
57524
|
throwOnInvalidCommit: true
|
|
57441
57525
|
};
|
|
57442
57526
|
const commit = await Model_1._makeGenesis(ceramic, content, metadata);
|
|
@@ -57519,7 +57603,7 @@ Model.MODEL = (function() {
|
|
|
57519
57603
|
return new StreamID("UNLOADABLE", cid);
|
|
57520
57604
|
})();
|
|
57521
57605
|
Model = Model_1 = __decorate5([
|
|
57522
|
-
|
|
57606
|
+
StreamStatic3()
|
|
57523
57607
|
], Model);
|
|
57524
57608
|
|
|
57525
57609
|
// ../../../node_modules/@ceramicnetwork/stream-model-instance/lib/model-instance-document.js
|
|
@@ -72967,7 +73051,7 @@ var getCeramicPlugin = /* @__PURE__ */ __name(async (learnCard, { ceramicEndpoin
|
|
|
72967
73051
|
if (encryption?.controllersCanDecrypt) {
|
|
72968
73052
|
recipients = [...recipients, ...metadata.controllers];
|
|
72969
73053
|
}
|
|
72970
|
-
content = await ceramic?.did?.createDagJWE(content,
|
|
73054
|
+
content = await ceramic?.did?.createDagJWE(content, import_lodash7.default.uniq(recipients));
|
|
72971
73055
|
}
|
|
72972
73056
|
learnCard.debug?.(
|
|
72973
73057
|
"learnCard.store.Ceramic.upload.publishContentToCeramic - content to upload",
|