@learncard/ceramic-plugin 1.1.31 → 1.1.33
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
|
@@ -4445,10 +4445,10 @@ var require_lodash = __commonJS({
|
|
|
4445
4445
|
return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
|
|
4446
4446
|
}
|
|
4447
4447
|
__name(cloneWith, "cloneWith");
|
|
4448
|
-
function
|
|
4448
|
+
function cloneDeep7(value) {
|
|
4449
4449
|
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
|
|
4450
4450
|
}
|
|
4451
|
-
__name(
|
|
4451
|
+
__name(cloneDeep7, "cloneDeep");
|
|
4452
4452
|
function cloneDeepWith(value, customizer) {
|
|
4453
4453
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
4454
4454
|
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
|
|
@@ -5698,7 +5698,7 @@ var require_lodash = __commonJS({
|
|
|
5698
5698
|
lodash.ceil = ceil;
|
|
5699
5699
|
lodash.clamp = clamp;
|
|
5700
5700
|
lodash.clone = clone2;
|
|
5701
|
-
lodash.cloneDeep =
|
|
5701
|
+
lodash.cloneDeep = cloneDeep7;
|
|
5702
5702
|
lodash.cloneDeepWith = cloneDeepWith;
|
|
5703
5703
|
lodash.cloneWith = cloneWith;
|
|
5704
5704
|
lodash.conformsTo = conformsTo;
|
|
@@ -10523,7 +10523,10 @@ var require_bn = __commonJS({
|
|
|
10523
10523
|
this.words[i2] = carry;
|
|
10524
10524
|
this.length++;
|
|
10525
10525
|
}
|
|
10526
|
-
|
|
10526
|
+
if (num === 0) {
|
|
10527
|
+
this.length = 1;
|
|
10528
|
+
this._normSign();
|
|
10529
|
+
}
|
|
10527
10530
|
return this;
|
|
10528
10531
|
}, "imuln");
|
|
10529
10532
|
BN3.prototype.muln = /* @__PURE__ */ __name(function muln(num) {
|
|
@@ -10916,12 +10919,14 @@ var require_bn = __commonJS({
|
|
|
10916
10919
|
BN3.prototype.divRound = /* @__PURE__ */ __name(function divRound(num) {
|
|
10917
10920
|
var dm = this.divmod(num);
|
|
10918
10921
|
if (dm.mod.isZero()) return dm.div;
|
|
10919
|
-
var mod = dm.
|
|
10920
|
-
var half = num.
|
|
10921
|
-
var r2 = num.
|
|
10922
|
+
var mod = dm.mod.abs();
|
|
10923
|
+
var half = num.abs().iushrn(1);
|
|
10924
|
+
var r2 = num.words[0] & 1;
|
|
10922
10925
|
var cmp = mod.cmp(half);
|
|
10923
10926
|
if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
|
|
10924
|
-
|
|
10927
|
+
var up = new BN3(1);
|
|
10928
|
+
up.negative = this.negative ^ num.negative;
|
|
10929
|
+
return dm.div.iadd(up);
|
|
10925
10930
|
}, "divRound");
|
|
10926
10931
|
BN3.prototype.modn = /* @__PURE__ */ __name(function modn(num) {
|
|
10927
10932
|
assert3(num <= 67108863);
|
|
@@ -33178,7 +33183,10 @@ var require_bn2 = __commonJS({
|
|
|
33178
33183
|
this.words[i2] = carry;
|
|
33179
33184
|
this.length++;
|
|
33180
33185
|
}
|
|
33181
|
-
|
|
33186
|
+
if (num === 0) {
|
|
33187
|
+
this.length = 1;
|
|
33188
|
+
this._normSign();
|
|
33189
|
+
}
|
|
33182
33190
|
return isNegNum ? this.ineg() : this;
|
|
33183
33191
|
}, "imuln");
|
|
33184
33192
|
BN3.prototype.muln = /* @__PURE__ */ __name(function muln(num) {
|
|
@@ -33571,12 +33579,14 @@ var require_bn2 = __commonJS({
|
|
|
33571
33579
|
BN3.prototype.divRound = /* @__PURE__ */ __name(function divRound(num) {
|
|
33572
33580
|
var dm = this.divmod(num);
|
|
33573
33581
|
if (dm.mod.isZero()) return dm.div;
|
|
33574
|
-
var mod = dm.
|
|
33575
|
-
var half = num.
|
|
33576
|
-
var r2 = num.
|
|
33582
|
+
var mod = dm.mod.abs();
|
|
33583
|
+
var half = num.abs().iushrn(1);
|
|
33584
|
+
var r2 = num.words[0] & 1;
|
|
33577
33585
|
var cmp = mod.cmp(half);
|
|
33578
33586
|
if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
|
|
33579
|
-
|
|
33587
|
+
var up = new BN3(1);
|
|
33588
|
+
up.negative = this.negative ^ num.negative;
|
|
33589
|
+
return dm.div.iadd(up);
|
|
33580
33590
|
}, "divRound");
|
|
33581
33591
|
BN3.prototype.modrn = /* @__PURE__ */ __name(function modrn(num) {
|
|
33582
33592
|
var isNegNum = num < 0;
|
|
@@ -35146,10 +35156,10 @@ var require_lodash2 = __commonJS({
|
|
|
35146
35156
|
return "";
|
|
35147
35157
|
}
|
|
35148
35158
|
__name(toSource, "toSource");
|
|
35149
|
-
function
|
|
35159
|
+
function cloneDeep7(value) {
|
|
35150
35160
|
return baseClone(value, true, true);
|
|
35151
35161
|
}
|
|
35152
|
-
__name(
|
|
35162
|
+
__name(cloneDeep7, "cloneDeep");
|
|
35153
35163
|
function eq4(value, other) {
|
|
35154
35164
|
return value === other || value !== value && other !== other;
|
|
35155
35165
|
}
|
|
@@ -35198,7 +35208,7 @@ var require_lodash2 = __commonJS({
|
|
|
35198
35208
|
return false;
|
|
35199
35209
|
}
|
|
35200
35210
|
__name(stubFalse, "stubFalse");
|
|
35201
|
-
module.exports =
|
|
35211
|
+
module.exports = cloneDeep7;
|
|
35202
35212
|
}
|
|
35203
35213
|
});
|
|
35204
35214
|
|
|
@@ -37091,7 +37101,7 @@ var require_src3 = __commonJS({
|
|
|
37091
37101
|
});
|
|
37092
37102
|
|
|
37093
37103
|
// src/ceramic.ts
|
|
37094
|
-
var
|
|
37104
|
+
var import_lodash7 = __toESM(require_lodash(), 1);
|
|
37095
37105
|
|
|
37096
37106
|
// ../../../node_modules/did-resolver/lib/resolver.module.js
|
|
37097
37107
|
function _catch(body, recover) {
|
|
@@ -42824,7 +42834,7 @@ function abortable(source, signal) {
|
|
|
42824
42834
|
}
|
|
42825
42835
|
__name(abortable, "abortable");
|
|
42826
42836
|
|
|
42827
|
-
// ../../../node_modules/nanoid/index.browser.js
|
|
42837
|
+
// ../../../node_modules/rpc-utils/node_modules/nanoid/index.browser.js
|
|
42828
42838
|
var nanoid = /* @__PURE__ */ __name((size = 21) => crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
|
|
42829
42839
|
byte &= 63;
|
|
42830
42840
|
if (byte < 36) {
|
|
@@ -51013,10 +51023,10 @@ var import_random3 = __toESM(require_random(), 1);
|
|
|
51013
51023
|
|
|
51014
51024
|
// ../../../node_modules/@ceramicnetwork/common/lib/streamopts.js
|
|
51015
51025
|
var SyncOptions;
|
|
51016
|
-
(function(
|
|
51017
|
-
|
|
51018
|
-
|
|
51019
|
-
|
|
51026
|
+
(function(SyncOptions4) {
|
|
51027
|
+
SyncOptions4[SyncOptions4["PREFER_CACHE"] = 0] = "PREFER_CACHE";
|
|
51028
|
+
SyncOptions4[SyncOptions4["SYNC_ALWAYS"] = 1] = "SYNC_ALWAYS";
|
|
51029
|
+
SyncOptions4[SyncOptions4["NEVER_SYNC"] = 2] = "NEVER_SYNC";
|
|
51020
51030
|
})(SyncOptions || (SyncOptions = {}));
|
|
51021
51031
|
|
|
51022
51032
|
// ../../../node_modules/@ceramicnetwork/common/lib/stream.js
|
|
@@ -54693,10 +54703,10 @@ __name(throttle, "throttle");
|
|
|
54693
54703
|
|
|
54694
54704
|
// ../../../node_modules/@ceramicnetwork/common/lib/stream.js
|
|
54695
54705
|
var SignatureStatus;
|
|
54696
|
-
(function(
|
|
54697
|
-
|
|
54698
|
-
|
|
54699
|
-
|
|
54706
|
+
(function(SignatureStatus4) {
|
|
54707
|
+
SignatureStatus4[SignatureStatus4["GENESIS"] = 0] = "GENESIS";
|
|
54708
|
+
SignatureStatus4[SignatureStatus4["PARTIAL"] = 1] = "PARTIAL";
|
|
54709
|
+
SignatureStatus4[SignatureStatus4["SIGNED"] = 2] = "SIGNED";
|
|
54700
54710
|
})(SignatureStatus || (SignatureStatus = {}));
|
|
54701
54711
|
var AnchorStatus;
|
|
54702
54712
|
(function(AnchorStatus2) {
|
|
@@ -54707,10 +54717,10 @@ var AnchorStatus;
|
|
|
54707
54717
|
AnchorStatus2[AnchorStatus2["FAILED"] = 4] = "FAILED";
|
|
54708
54718
|
})(AnchorStatus || (AnchorStatus = {}));
|
|
54709
54719
|
var CommitType;
|
|
54710
|
-
(function(
|
|
54711
|
-
|
|
54712
|
-
|
|
54713
|
-
|
|
54720
|
+
(function(CommitType4) {
|
|
54721
|
+
CommitType4[CommitType4["GENESIS"] = 0] = "GENESIS";
|
|
54722
|
+
CommitType4[CommitType4["SIGNED"] = 1] = "SIGNED";
|
|
54723
|
+
CommitType4[CommitType4["ANCHOR"] = 2] = "ANCHOR";
|
|
54714
54724
|
})(CommitType || (CommitType = {}));
|
|
54715
54725
|
var _Stream = class _Stream extends Observable {
|
|
54716
54726
|
constructor(state$, _context) {
|
|
@@ -56341,26 +56351,26 @@ var Document = _Document;
|
|
|
56341
56351
|
|
|
56342
56352
|
// ../../../node_modules/@ceramicnetwork/stream-caip10-link/node_modules/@ceramicnetwork/common/lib/streamopts.js
|
|
56343
56353
|
var SyncOptions2;
|
|
56344
|
-
(function(
|
|
56345
|
-
|
|
56346
|
-
|
|
56347
|
-
|
|
56348
|
-
|
|
56354
|
+
(function(SyncOptions4) {
|
|
56355
|
+
SyncOptions4[SyncOptions4["PREFER_CACHE"] = 0] = "PREFER_CACHE";
|
|
56356
|
+
SyncOptions4[SyncOptions4["SYNC_ALWAYS"] = 1] = "SYNC_ALWAYS";
|
|
56357
|
+
SyncOptions4[SyncOptions4["NEVER_SYNC"] = 2] = "NEVER_SYNC";
|
|
56358
|
+
SyncOptions4[SyncOptions4["SYNC_ON_ERROR"] = 3] = "SYNC_ON_ERROR";
|
|
56349
56359
|
})(SyncOptions2 || (SyncOptions2 = {}));
|
|
56350
56360
|
|
|
56351
56361
|
// ../../../node_modules/@ceramicnetwork/stream-caip10-link/node_modules/@ceramicnetwork/common/lib/stream.js
|
|
56352
56362
|
var import_lodash4 = __toESM(require_lodash2(), 1);
|
|
56353
56363
|
var SignatureStatus2;
|
|
56354
|
-
(function(
|
|
56355
|
-
|
|
56356
|
-
|
|
56357
|
-
|
|
56364
|
+
(function(SignatureStatus4) {
|
|
56365
|
+
SignatureStatus4[SignatureStatus4["GENESIS"] = 0] = "GENESIS";
|
|
56366
|
+
SignatureStatus4[SignatureStatus4["PARTIAL"] = 1] = "PARTIAL";
|
|
56367
|
+
SignatureStatus4[SignatureStatus4["SIGNED"] = 2] = "SIGNED";
|
|
56358
56368
|
})(SignatureStatus2 || (SignatureStatus2 = {}));
|
|
56359
56369
|
var CommitType2;
|
|
56360
|
-
(function(
|
|
56361
|
-
|
|
56362
|
-
|
|
56363
|
-
|
|
56370
|
+
(function(CommitType4) {
|
|
56371
|
+
CommitType4[CommitType4["GENESIS"] = 0] = "GENESIS";
|
|
56372
|
+
CommitType4[CommitType4["SIGNED"] = 1] = "SIGNED";
|
|
56373
|
+
CommitType4[CommitType4["ANCHOR"] = 2] = "ANCHOR";
|
|
56364
56374
|
})(CommitType2 || (CommitType2 = {}));
|
|
56365
56375
|
var _Stream2 = class _Stream2 extends Observable {
|
|
56366
56376
|
constructor(state$, _context) {
|
|
@@ -56570,6 +56580,80 @@ Caip10Link = Caip10Link_1 = __decorate4([
|
|
|
56570
56580
|
StreamStatic2()
|
|
56571
56581
|
], Caip10Link);
|
|
56572
56582
|
|
|
56583
|
+
// ../../../node_modules/@ceramicnetwork/stream-model/node_modules/@ceramicnetwork/common/lib/streamopts.js
|
|
56584
|
+
var SyncOptions3;
|
|
56585
|
+
(function(SyncOptions4) {
|
|
56586
|
+
SyncOptions4[SyncOptions4["PREFER_CACHE"] = 0] = "PREFER_CACHE";
|
|
56587
|
+
SyncOptions4[SyncOptions4["SYNC_ALWAYS"] = 1] = "SYNC_ALWAYS";
|
|
56588
|
+
SyncOptions4[SyncOptions4["NEVER_SYNC"] = 2] = "NEVER_SYNC";
|
|
56589
|
+
SyncOptions4[SyncOptions4["SYNC_ON_ERROR"] = 3] = "SYNC_ON_ERROR";
|
|
56590
|
+
})(SyncOptions3 || (SyncOptions3 = {}));
|
|
56591
|
+
|
|
56592
|
+
// ../../../node_modules/@ceramicnetwork/stream-model/node_modules/@ceramicnetwork/common/lib/stream.js
|
|
56593
|
+
var import_lodash6 = __toESM(require_lodash2(), 1);
|
|
56594
|
+
var SignatureStatus3;
|
|
56595
|
+
(function(SignatureStatus4) {
|
|
56596
|
+
SignatureStatus4[SignatureStatus4["GENESIS"] = 0] = "GENESIS";
|
|
56597
|
+
SignatureStatus4[SignatureStatus4["PARTIAL"] = 1] = "PARTIAL";
|
|
56598
|
+
SignatureStatus4[SignatureStatus4["SIGNED"] = 2] = "SIGNED";
|
|
56599
|
+
})(SignatureStatus3 || (SignatureStatus3 = {}));
|
|
56600
|
+
var CommitType3;
|
|
56601
|
+
(function(CommitType4) {
|
|
56602
|
+
CommitType4[CommitType4["GENESIS"] = 0] = "GENESIS";
|
|
56603
|
+
CommitType4[CommitType4["SIGNED"] = 1] = "SIGNED";
|
|
56604
|
+
CommitType4[CommitType4["ANCHOR"] = 2] = "ANCHOR";
|
|
56605
|
+
})(CommitType3 || (CommitType3 = {}));
|
|
56606
|
+
var _Stream3 = class _Stream3 extends Observable {
|
|
56607
|
+
constructor(state$, _context) {
|
|
56608
|
+
super((subscriber) => {
|
|
56609
|
+
state$.subscribe(subscriber);
|
|
56610
|
+
});
|
|
56611
|
+
this.state$ = state$;
|
|
56612
|
+
this._context = _context;
|
|
56613
|
+
}
|
|
56614
|
+
get id() {
|
|
56615
|
+
return new StreamID(this.state$.value.type, this.state$.value.log[0].cid);
|
|
56616
|
+
}
|
|
56617
|
+
get api() {
|
|
56618
|
+
return this._context.api;
|
|
56619
|
+
}
|
|
56620
|
+
get content() {
|
|
56621
|
+
const { next, content } = this.state$.value;
|
|
56622
|
+
return (0, import_lodash6.default)(next?.content ?? content);
|
|
56623
|
+
}
|
|
56624
|
+
get tip() {
|
|
56625
|
+
return this.state$.value.log[this.state$.value.log.length - 1].cid;
|
|
56626
|
+
}
|
|
56627
|
+
get commitId() {
|
|
56628
|
+
return CommitID.make(this.id, this.tip);
|
|
56629
|
+
}
|
|
56630
|
+
get allCommitIds() {
|
|
56631
|
+
return this.state$.value.log.map(({ cid }) => CommitID.make(this.id, cid));
|
|
56632
|
+
}
|
|
56633
|
+
get anchorCommitIds() {
|
|
56634
|
+
return this.state$.value.log.filter(({ type }) => type === CommitType3.ANCHOR).map(({ cid }) => CommitID.make(this.id, cid));
|
|
56635
|
+
}
|
|
56636
|
+
get state() {
|
|
56637
|
+
return (0, import_lodash6.default)(this.state$.value);
|
|
56638
|
+
}
|
|
56639
|
+
async sync(opts = {}) {
|
|
56640
|
+
opts = { sync: SyncOptions3.PREFER_CACHE, ...opts };
|
|
56641
|
+
const stream = await this.api.loadStream(this.id, opts);
|
|
56642
|
+
this.state$.next(stream.state);
|
|
56643
|
+
}
|
|
56644
|
+
async requestAnchor() {
|
|
56645
|
+
return this.api.requestAnchor(this.id);
|
|
56646
|
+
}
|
|
56647
|
+
};
|
|
56648
|
+
__name(_Stream3, "Stream");
|
|
56649
|
+
var Stream3 = _Stream3;
|
|
56650
|
+
function StreamStatic3() {
|
|
56651
|
+
return (constructor) => {
|
|
56652
|
+
constructor;
|
|
56653
|
+
};
|
|
56654
|
+
}
|
|
56655
|
+
__name(StreamStatic3, "StreamStatic");
|
|
56656
|
+
|
|
56573
56657
|
// ../../../node_modules/@ceramicnetwork/stream-model/node_modules/multiformats/esm/vendor/varint.js
|
|
56574
56658
|
var encode_19 = encode29;
|
|
56575
56659
|
var MSB9 = 128;
|
|
@@ -57396,7 +57480,7 @@ var __decorate5 = function(decorators, target, key2, desc) {
|
|
|
57396
57480
|
return c > 3 && r2 && Object.defineProperty(target, key2, r2), r2;
|
|
57397
57481
|
};
|
|
57398
57482
|
var Model_1;
|
|
57399
|
-
var DEFAULT_LOAD_OPTS3 = { sync:
|
|
57483
|
+
var DEFAULT_LOAD_OPTS3 = { sync: SyncOptions3.PREFER_CACHE };
|
|
57400
57484
|
async function _ensureAuthenticated(signer) {
|
|
57401
57485
|
if (signer.did == null) {
|
|
57402
57486
|
throw new Error("No DID provided");
|
|
@@ -57414,7 +57498,7 @@ async function throwReadOnlyError3() {
|
|
|
57414
57498
|
}
|
|
57415
57499
|
__name(throwReadOnlyError3, "throwReadOnlyError");
|
|
57416
57500
|
var _a3;
|
|
57417
|
-
var Model = Model_1 = (_a3 = class extends
|
|
57501
|
+
var Model = Model_1 = (_a3 = class extends Stream3 {
|
|
57418
57502
|
constructor() {
|
|
57419
57503
|
super(...arguments);
|
|
57420
57504
|
this._isReadOnly = false;
|
|
@@ -57431,7 +57515,7 @@ var Model = Model_1 = (_a3 = class extends Stream {
|
|
|
57431
57515
|
publish: true,
|
|
57432
57516
|
anchor: true,
|
|
57433
57517
|
pin: true,
|
|
57434
|
-
sync:
|
|
57518
|
+
sync: SyncOptions3.NEVER_SYNC,
|
|
57435
57519
|
throwOnInvalidCommit: true
|
|
57436
57520
|
};
|
|
57437
57521
|
const commit = await Model_1._makeGenesis(ceramic, content, metadata);
|
|
@@ -57514,7 +57598,7 @@ Model.MODEL = (function() {
|
|
|
57514
57598
|
return new StreamID("UNLOADABLE", cid);
|
|
57515
57599
|
})();
|
|
57516
57600
|
Model = Model_1 = __decorate5([
|
|
57517
|
-
|
|
57601
|
+
StreamStatic3()
|
|
57518
57602
|
], Model);
|
|
57519
57603
|
|
|
57520
57604
|
// ../../../node_modules/@ceramicnetwork/stream-model-instance/lib/model-instance-document.js
|
|
@@ -72962,7 +73046,7 @@ var getCeramicPlugin = /* @__PURE__ */ __name(async (learnCard, { ceramicEndpoin
|
|
|
72962
73046
|
if (encryption?.controllersCanDecrypt) {
|
|
72963
73047
|
recipients = [...recipients, ...metadata.controllers];
|
|
72964
73048
|
}
|
|
72965
|
-
content = await ceramic?.did?.createDagJWE(content,
|
|
73049
|
+
content = await ceramic?.did?.createDagJWE(content, import_lodash7.default.uniq(recipients));
|
|
72966
73050
|
}
|
|
72967
73051
|
learnCard.debug?.(
|
|
72968
73052
|
"learnCard.store.Ceramic.upload.publishContentToCeramic - content to upload",
|