@calimero-network/mero-js 29.1.0 → 29.2.0

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.
@@ -576,6 +576,12 @@ export declare class CalimeroClient {
576
576
  * Create an API key for an agent or server, approved with the account's
577
577
  * `passkey` (`412 CONFIRM_REQUIRED`); needs a passkey session (an API key
578
578
  * is refused `403`). The key is returned once.
579
+ *
580
+ * `upgrades: { app, package? }` makes an upgrade key, for CI: it upgrades
581
+ * that one app to signed releases of its package (default: the one the app
582
+ * runs, by that package's pinned signer) with {@link upgradeApp} and no
583
+ * passkey, and every other request with it is refused
584
+ * `403 UPGRADE_KEY_ONLY`. It takes no other scope field.
579
585
  */
580
586
  createApiKey(options: {
581
587
  label?: string;
@@ -584,6 +590,10 @@ export declare class CalimeroClient {
584
590
  readOnly?: boolean;
585
591
  allowConfirm?: boolean;
586
592
  ttlSecs?: number;
593
+ upgrades?: {
594
+ app: string;
595
+ package?: string;
596
+ };
587
597
  }, passkey: PasskeyProvider): Promise<{
588
598
  keyId: string;
589
599
  key: string;
@@ -673,6 +683,8 @@ export declare class CalimeroClient {
673
683
  * `passkey` gives. Refused (`403`) to a session opened on an app's
674
684
  * frontend: an app asks its user with {@link requestConsent} instead. Past
675
685
  * a release deadline its approver has not met: {@link ReleaseDeadlineError}.
686
+ * With an upgrade key ({@link createApiKey} `upgrades`) pass no passkey and
687
+ * a `version` of the key's package: the key's own proof stands in for it.
676
688
  */
677
689
  upgradeApp(app: string, target: {
678
690
  version?: string;
@@ -625,6 +625,12 @@ export class CalimeroClient {
625
625
  * Create an API key for an agent or server, approved with the account's
626
626
  * `passkey` (`412 CONFIRM_REQUIRED`); needs a passkey session (an API key
627
627
  * is refused `403`). The key is returned once.
628
+ *
629
+ * `upgrades: { app, package? }` makes an upgrade key, for CI: it upgrades
630
+ * that one app to signed releases of its package (default: the one the app
631
+ * runs, by that package's pinned signer) with {@link upgradeApp} and no
632
+ * passkey, and every other request with it is refused
633
+ * `403 UPGRADE_KEY_ONLY`. It takes no other scope field.
628
634
  */
629
635
  createApiKey(options, passkey) {
630
636
  return this.postConfirmed('auth/apikeys', { ...options }, passkey);
@@ -766,6 +772,8 @@ export class CalimeroClient {
766
772
  * `passkey` gives. Refused (`403`) to a session opened on an app's
767
773
  * frontend: an app asks its user with {@link requestConsent} instead. Past
768
774
  * a release deadline its approver has not met: {@link ReleaseDeadlineError}.
775
+ * With an upgrade key ({@link createApiKey} `upgrades`) pass no passkey and
776
+ * a `version` of the key's package: the key's own proof stands in for it.
769
777
  */
770
778
  upgradeApp(app, target, passkey) {
771
779
  const path = `apps/${seg(app)}/upgrade`;