@mdbase-dev/sdk 0.2.7 → 0.2.9

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.
@@ -487,7 +487,7 @@ export class AppCpCloudCopyBootstrap {
487
487
  ? "/v1/next/collections/cloud-copy"
488
488
  : `/v1/next/collections/${this.scope.collection}/devices`, bearer, JSON.stringify({
489
489
  device_id: this.scope.deviceId,
490
- capabilities: ["collection_mode_switch_v1"],
490
+ capabilities: ["collection_mode_switch_v2"],
491
491
  challenge: challenge.challenge,
492
492
  sig: hex(signature),
493
493
  ...(create
@@ -209,7 +209,7 @@ export class AppCpLogAuthority {
209
209
  this.check(options.signal);
210
210
  if (!(signature instanceof Uint8Array) || signature.length !== 64)
211
211
  throw fail("response");
212
- const body = JSON.stringify({ device_id: this.deviceId, challenge: issued.challenge, sig: hex(signature), capabilities: ["collection_mode_switch_v1"] });
212
+ const body = JSON.stringify({ device_id: this.deviceId, challenge: issued.challenge, sig: hex(signature), capabilities: ["collection_mode_switch_v2"] });
213
213
  const minted = await this.json(`/v1/next/collections/${this.collection}/log-token`, bearer, body, options.signal);
214
214
  this.check(options.signal);
215
215
  if (typeof minted.token !== "string" || !minted.token || minted.token.length > 16 * 1024 || /[^\x21-\x7e]/.test(minted.token) || typeof minted.expires_at !== "number" || !Number.isSafeInteger(minted.expires_at) || minted.expires_at - this.now() <= 5_000 || minted.expires_at - this.now() > 16 * 60_000)
@@ -153,7 +153,7 @@ export class AppCpDeviceRegistration {
153
153
  const proof = this.runtime.signCpEnrol(challenge);
154
154
  this.check(options.signal);
155
155
  signature = proof.signature;
156
- const result = await this.json("/v1/next/devices", bearer, JSON.stringify({ device_id: this.scope.deviceId, kind: this.scope.kind, capabilities: ["collection_mode_switch_v1"], challenge: issued.challenge, sign_pk: hex(proof.signPublicKey), kem_pk: hex(proof.kemPublicKey), noise_pk: hex(proof.noisePublicKey), sig: hex(signature) }), options.signal);
156
+ const result = await this.json("/v1/next/devices", bearer, JSON.stringify({ device_id: this.scope.deviceId, kind: this.scope.kind, capabilities: ["collection_mode_switch_v2"], challenge: issued.challenge, sign_pk: hex(proof.signPublicKey), kem_pk: hex(proof.kemPublicKey), noise_pk: hex(proof.noisePublicKey), sig: hex(signature) }), options.signal);
157
157
  this.check(options.signal);
158
158
  if (result.device_id !== this.scope.deviceId)
159
159
  throw fail("response");
@@ -181,7 +181,7 @@ export class AppCpPrivateBootstrap {
181
181
  const enrol = this.scope.purpose === "enrol";
182
182
  signature = enrol ? this.runtime.signPrivateDeviceEnrol(nonce).signature : this.runtime.signPrivateCreate(nonce);
183
183
  this.check(options.signal);
184
- const result = await this.json(enrol ? `/v1/next/collections/${this.scope.collection}/private/devices` : "/v1/next/collections/private", bearer, JSON.stringify({ device_id: this.scope.deviceId, capabilities: ["collection_mode_switch_v1"], challenge: issued.challenge, sig: hex(signature), ...(enrol ? { sas_commit: hex(this.marker.sasCommitment) } : { collection_id: this.scope.collection, ...(this.displayName === undefined ? {} : { display_name: this.displayName }) }) }), options.signal);
184
+ const result = await this.json(enrol ? `/v1/next/collections/${this.scope.collection}/private/devices` : "/v1/next/collections/private", bearer, JSON.stringify({ device_id: this.scope.deviceId, capabilities: ["collection_mode_switch_v2"], challenge: issued.challenge, sig: hex(signature), ...(enrol ? { sas_commit: hex(this.marker.sasCommitment) } : { collection_id: this.scope.collection, ...(this.displayName === undefined ? {} : { display_name: this.displayName }) }) }), options.signal);
185
185
  this.check(options.signal);
186
186
  if (result.collection_id !== this.scope.collection || this.origin(result.log_url) !== this.origin(this.scope.logOrigin))
187
187
  throw fail("response");
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "runtime": {
3
- "sha256": "3206e1ff63ead62454b2729041d7ba4669d847003984830b71977342cd63a2a0",
4
- "bytes": 4010478,
5
- "maxBytes": 4010478,
3
+ "sha256": "c00fbf2ac399f6a0a66e8da9850e3aff1c12f07715d6e6b65d53f170dbdf77d3",
4
+ "bytes": 4011062,
5
+ "maxBytes": 4011062,
6
6
  "source": {
7
7
  "repository": "mdbase-dev/mdbase-connect",
8
- "commit": "a9b48b9c025fc54577d6c24dc720427703b8cf6d"
8
+ "commit": "d614bdf25a261a06cf54406f2ddc43e1ff383bf8"
9
9
  }
10
10
  },
11
11
  "sqlite": {
@@ -15693,12 +15693,12 @@ function appReleaseTrust() {
15693
15693
  // src/application/asset-pins.json
15694
15694
  var asset_pins_default = {
15695
15695
  runtime: {
15696
- sha256: "3206e1ff63ead62454b2729041d7ba4669d847003984830b71977342cd63a2a0",
15697
- bytes: 4010478,
15698
- maxBytes: 4010478,
15696
+ sha256: "c00fbf2ac399f6a0a66e8da9850e3aff1c12f07715d6e6b65d53f170dbdf77d3",
15697
+ bytes: 4011062,
15698
+ maxBytes: 4011062,
15699
15699
  source: {
15700
15700
  repository: "mdbase-dev/mdbase-connect",
15701
- commit: "a9b48b9c025fc54577d6c24dc720427703b8cf6d"
15701
+ commit: "d614bdf25a261a06cf54406f2ddc43e1ff383bf8"
15702
15702
  }
15703
15703
  },
15704
15704
  sqlite: {
@@ -19053,7 +19053,7 @@ var AppCpLogAuthority = class {
19053
19053
  signature = this.runtime.signCpLogToken(challenge);
19054
19054
  this.check(options.signal);
19055
19055
  if (!(signature instanceof Uint8Array) || signature.length !== 64) throw fail4("response");
19056
- const body = JSON.stringify({ device_id: this.deviceId, challenge: issued.challenge, sig: hex3(signature), capabilities: ["collection_mode_switch_v1"] });
19056
+ const body = JSON.stringify({ device_id: this.deviceId, challenge: issued.challenge, sig: hex3(signature), capabilities: ["collection_mode_switch_v2"] });
19057
19057
  const minted = await this.json(`/v1/next/collections/${this.collection}/log-token`, bearer, body, options.signal);
19058
19058
  this.check(options.signal);
19059
19059
  if (typeof minted.token !== "string" || !minted.token || minted.token.length > 16 * 1024 || /[^\x21-\x7e]/.test(minted.token) || typeof minted.expires_at !== "number" || !Number.isSafeInteger(minted.expires_at) || minted.expires_at - this.now() <= 5e3 || minted.expires_at - this.now() > 16 * 6e4) throw fail4("response");
@@ -19506,7 +19506,7 @@ var AppCpCloudCopyBootstrap = class {
19506
19506
  bearer,
19507
19507
  JSON.stringify({
19508
19508
  device_id: this.scope.deviceId,
19509
- capabilities: ["collection_mode_switch_v1"],
19509
+ capabilities: ["collection_mode_switch_v2"],
19510
19510
  challenge: challenge.challenge,
19511
19511
  sig: hex4(signature),
19512
19512
  ...create ? {
@@ -28173,7 +28173,7 @@ var AppCpPrivateBootstrap = class {
28173
28173
  const enrol = this.scope.purpose === "enrol";
28174
28174
  signature = enrol ? this.runtime.signPrivateDeviceEnrol(nonce).signature : this.runtime.signPrivateCreate(nonce);
28175
28175
  this.check(options.signal);
28176
- const result2 = await this.json(enrol ? `/v1/next/collections/${this.scope.collection}/private/devices` : "/v1/next/collections/private", bearer, JSON.stringify({ device_id: this.scope.deviceId, capabilities: ["collection_mode_switch_v1"], challenge: issued.challenge, sig: hex7(signature), ...enrol ? { sas_commit: hex7(this.marker.sasCommitment) } : { collection_id: this.scope.collection, ...this.displayName === void 0 ? {} : { display_name: this.displayName } } }), options.signal);
28176
+ const result2 = await this.json(enrol ? `/v1/next/collections/${this.scope.collection}/private/devices` : "/v1/next/collections/private", bearer, JSON.stringify({ device_id: this.scope.deviceId, capabilities: ["collection_mode_switch_v2"], challenge: issued.challenge, sig: hex7(signature), ...enrol ? { sas_commit: hex7(this.marker.sasCommitment) } : { collection_id: this.scope.collection, ...this.displayName === void 0 ? {} : { display_name: this.displayName } } }), options.signal);
28177
28177
  this.check(options.signal);
28178
28178
  if (result2.collection_id !== this.scope.collection || this.origin(result2.log_url) !== this.origin(this.scope.logOrigin)) throw fail7("response");
28179
28179
  if (enrol) {
@@ -37074,7 +37074,7 @@ var AppCpDeviceRegistration = class {
37074
37074
  const proof2 = this.runtime.signCpEnrol(challenge);
37075
37075
  this.check(options.signal);
37076
37076
  signature = proof2.signature;
37077
- const result2 = await this.json("/v1/next/devices", bearer, JSON.stringify({ device_id: this.scope.deviceId, kind: this.scope.kind, capabilities: ["collection_mode_switch_v1"], challenge: issued.challenge, sign_pk: hex11(proof2.signPublicKey), kem_pk: hex11(proof2.kemPublicKey), noise_pk: hex11(proof2.noisePublicKey), sig: hex11(signature) }), options.signal);
37077
+ const result2 = await this.json("/v1/next/devices", bearer, JSON.stringify({ device_id: this.scope.deviceId, kind: this.scope.kind, capabilities: ["collection_mode_switch_v2"], challenge: issued.challenge, sign_pk: hex11(proof2.signPublicKey), kem_pk: hex11(proof2.kemPublicKey), noise_pk: hex11(proof2.noisePublicKey), sig: hex11(signature) }), options.signal);
37078
37078
  this.check(options.signal);
37079
37079
  if (result2.device_id !== this.scope.deviceId) throw fail14("response");
37080
37080
  const receipt3 = Object.freeze({ connectorId: this.scope.connectorId, deviceId: this.scope.deviceId, installationId: this.scope.installationId, signPublicKey: new Uint8Array(proof2.signPublicKey), kemPublicKey: new Uint8Array(proof2.kemPublicKey), noisePublicKey: new Uint8Array(proof2.noisePublicKey) });
@@ -28846,7 +28846,7 @@ ${end.comment}` : end.comment;
28846
28846
  signature = this.runtime.signCpLogToken(challenge);
28847
28847
  this.check(options.signal);
28848
28848
  if (!(signature instanceof Uint8Array) || signature.length !== 64) throw fail4("response");
28849
- const body = JSON.stringify({ device_id: this.deviceId, challenge: issued.challenge, sig: hex4(signature), capabilities: ["collection_mode_switch_v1"] });
28849
+ const body = JSON.stringify({ device_id: this.deviceId, challenge: issued.challenge, sig: hex4(signature), capabilities: ["collection_mode_switch_v2"] });
28850
28850
  const minted = await this.json(`/v1/next/collections/${this.collection}/log-token`, bearer, body, options.signal);
28851
28851
  this.check(options.signal);
28852
28852
  if (typeof minted.token !== "string" || !minted.token || minted.token.length > 16 * 1024 || /[^\x21-\x7e]/.test(minted.token) || typeof minted.expires_at !== "number" || !Number.isSafeInteger(minted.expires_at) || minted.expires_at - this.now() <= 5e3 || minted.expires_at - this.now() > 16 * 6e4) throw fail4("response");
@@ -29309,7 +29309,7 @@ ${end.comment}` : end.comment;
29309
29309
  bearer,
29310
29310
  JSON.stringify({
29311
29311
  device_id: this.scope.deviceId,
29312
- capabilities: ["collection_mode_switch_v1"],
29312
+ capabilities: ["collection_mode_switch_v2"],
29313
29313
  challenge: challenge.challenge,
29314
29314
  sig: hex5(signature),
29315
29315
  ...create ? {
@@ -40614,7 +40614,7 @@ ${end.comment}` : end.comment;
40614
40614
  const enrol = this.scope.purpose === "enrol";
40615
40615
  signature = enrol ? this.runtime.signPrivateDeviceEnrol(nonce).signature : this.runtime.signPrivateCreate(nonce);
40616
40616
  this.check(options.signal);
40617
- const result2 = await this.json(enrol ? `/v1/next/collections/${this.scope.collection}/private/devices` : "/v1/next/collections/private", bearer, JSON.stringify({ device_id: this.scope.deviceId, capabilities: ["collection_mode_switch_v1"], challenge: issued.challenge, sig: hex9(signature), ...enrol ? { sas_commit: hex9(this.marker.sasCommitment) } : { collection_id: this.scope.collection, ...this.displayName === void 0 ? {} : { display_name: this.displayName } } }), options.signal);
40617
+ const result2 = await this.json(enrol ? `/v1/next/collections/${this.scope.collection}/private/devices` : "/v1/next/collections/private", bearer, JSON.stringify({ device_id: this.scope.deviceId, capabilities: ["collection_mode_switch_v2"], challenge: issued.challenge, sig: hex9(signature), ...enrol ? { sas_commit: hex9(this.marker.sasCommitment) } : { collection_id: this.scope.collection, ...this.displayName === void 0 ? {} : { display_name: this.displayName } } }), options.signal);
40618
40618
  this.check(options.signal);
40619
40619
  if (result2.collection_id !== this.scope.collection || this.origin(result2.log_url) !== this.origin(this.scope.logOrigin)) throw fail10("response");
40620
40620
  if (enrol) {
@@ -44723,7 +44723,7 @@ ${end.comment}` : end.comment;
44723
44723
  const proof2 = this.runtime.signCpEnrol(challenge);
44724
44724
  this.check(options.signal);
44725
44725
  signature = proof2.signature;
44726
- const result2 = await this.json("/v1/next/devices", bearer, JSON.stringify({ device_id: this.scope.deviceId, kind: this.scope.kind, capabilities: ["collection_mode_switch_v1"], challenge: issued.challenge, sign_pk: hex13(proof2.signPublicKey), kem_pk: hex13(proof2.kemPublicKey), noise_pk: hex13(proof2.noisePublicKey), sig: hex13(signature) }), options.signal);
44726
+ const result2 = await this.json("/v1/next/devices", bearer, JSON.stringify({ device_id: this.scope.deviceId, kind: this.scope.kind, capabilities: ["collection_mode_switch_v2"], challenge: issued.challenge, sign_pk: hex13(proof2.signPublicKey), kem_pk: hex13(proof2.kemPublicKey), noise_pk: hex13(proof2.noisePublicKey), sig: hex13(signature) }), options.signal);
44727
44727
  this.check(options.signal);
44728
44728
  if (result2.device_id !== this.scope.deviceId) throw fail15("response");
44729
44729
  const receipt4 = Object.freeze({ connectorId: this.scope.connectorId, deviceId: this.scope.deviceId, installationId: this.scope.installationId, signPublicKey: new Uint8Array(proof2.signPublicKey), kemPublicKey: new Uint8Array(proof2.kemPublicKey), noisePublicKey: new Uint8Array(proof2.noisePublicKey) });
@@ -50941,12 +50941,12 @@ ${end.comment}` : end.comment;
50941
50941
  // src/application/asset-pins.json
50942
50942
  var asset_pins_default = {
50943
50943
  runtime: {
50944
- sha256: "3206e1ff63ead62454b2729041d7ba4669d847003984830b71977342cd63a2a0",
50945
- bytes: 4010478,
50946
- maxBytes: 4010478,
50944
+ sha256: "c00fbf2ac399f6a0a66e8da9850e3aff1c12f07715d6e6b65d53f170dbdf77d3",
50945
+ bytes: 4011062,
50946
+ maxBytes: 4011062,
50947
50947
  source: {
50948
50948
  repository: "mdbase-dev/mdbase-connect",
50949
- commit: "a9b48b9c025fc54577d6c24dc720427703b8cf6d"
50949
+ commit: "d614bdf25a261a06cf54406f2ddc43e1ff383bf8"
50950
50950
  }
50951
50951
  },
50952
50952
  sqlite: {