@scalemule/nextjs 0.1.73 → 0.1.74
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/server/auth.js +12 -4
- package/dist/server/auth.mjs +12 -4
- package/dist/server/index.js +12 -4
- package/dist/server/index.mjs +12 -4
- package/package.json +1 -1
package/dist/server/auth.js
CHANGED
|
@@ -383,9 +383,10 @@ var ScaleMuleServer = class {
|
|
|
383
383
|
* ```
|
|
384
384
|
*/
|
|
385
385
|
set: async (key, value) => {
|
|
386
|
-
|
|
386
|
+
const written = await this.request("PUT", `/v1/vault/secrets/${encodeURIComponent(key)}`, {
|
|
387
387
|
body: { value }
|
|
388
388
|
});
|
|
389
|
+
return { value, version: written.version };
|
|
389
390
|
},
|
|
390
391
|
/**
|
|
391
392
|
* Delete a secret from the tenant vault
|
|
@@ -412,21 +413,27 @@ var ScaleMuleServer = class {
|
|
|
412
413
|
* Rollback to a specific version
|
|
413
414
|
*/
|
|
414
415
|
rollback: async (key, version) => {
|
|
415
|
-
|
|
416
|
+
const written = await this.request(
|
|
416
417
|
"POST",
|
|
417
418
|
`/v1/vault/actions/rollback/${encodeURIComponent(key)}`,
|
|
418
419
|
{ body: { version } }
|
|
419
420
|
);
|
|
421
|
+
const current = await this.request(
|
|
422
|
+
"GET",
|
|
423
|
+
`/v1/vault/secrets/${encodeURIComponent(key)}`
|
|
424
|
+
);
|
|
425
|
+
return { value: current.value, version: written.version ?? current.version };
|
|
420
426
|
},
|
|
421
427
|
/**
|
|
422
428
|
* Rotate a secret (copy current version as new version)
|
|
423
429
|
*/
|
|
424
430
|
rotate: async (key, newValue) => {
|
|
425
|
-
|
|
431
|
+
const rotated = await this.request(
|
|
426
432
|
"POST",
|
|
427
433
|
`/v1/vault/actions/rotate/${encodeURIComponent(key)}`,
|
|
428
434
|
{ body: { value: newValue } }
|
|
429
435
|
);
|
|
436
|
+
return { value: newValue, version: rotated.new_version ?? rotated.version };
|
|
430
437
|
}
|
|
431
438
|
};
|
|
432
439
|
// ==========================================================================
|
|
@@ -480,7 +487,7 @@ var ScaleMuleServer = class {
|
|
|
480
487
|
* ```
|
|
481
488
|
*/
|
|
482
489
|
set: async (key, type, data, inheritsFrom) => {
|
|
483
|
-
|
|
490
|
+
const written = await this.request(
|
|
484
491
|
"PUT",
|
|
485
492
|
`/v1/vault/bundles/${encodeURIComponent(key)}`,
|
|
486
493
|
{
|
|
@@ -491,6 +498,7 @@ var ScaleMuleServer = class {
|
|
|
491
498
|
}
|
|
492
499
|
}
|
|
493
500
|
);
|
|
501
|
+
return { type, data, version: written.version };
|
|
494
502
|
},
|
|
495
503
|
/**
|
|
496
504
|
* Delete a bundle
|
package/dist/server/auth.mjs
CHANGED
|
@@ -381,9 +381,10 @@ var ScaleMuleServer = class {
|
|
|
381
381
|
* ```
|
|
382
382
|
*/
|
|
383
383
|
set: async (key, value) => {
|
|
384
|
-
|
|
384
|
+
const written = await this.request("PUT", `/v1/vault/secrets/${encodeURIComponent(key)}`, {
|
|
385
385
|
body: { value }
|
|
386
386
|
});
|
|
387
|
+
return { value, version: written.version };
|
|
387
388
|
},
|
|
388
389
|
/**
|
|
389
390
|
* Delete a secret from the tenant vault
|
|
@@ -410,21 +411,27 @@ var ScaleMuleServer = class {
|
|
|
410
411
|
* Rollback to a specific version
|
|
411
412
|
*/
|
|
412
413
|
rollback: async (key, version) => {
|
|
413
|
-
|
|
414
|
+
const written = await this.request(
|
|
414
415
|
"POST",
|
|
415
416
|
`/v1/vault/actions/rollback/${encodeURIComponent(key)}`,
|
|
416
417
|
{ body: { version } }
|
|
417
418
|
);
|
|
419
|
+
const current = await this.request(
|
|
420
|
+
"GET",
|
|
421
|
+
`/v1/vault/secrets/${encodeURIComponent(key)}`
|
|
422
|
+
);
|
|
423
|
+
return { value: current.value, version: written.version ?? current.version };
|
|
418
424
|
},
|
|
419
425
|
/**
|
|
420
426
|
* Rotate a secret (copy current version as new version)
|
|
421
427
|
*/
|
|
422
428
|
rotate: async (key, newValue) => {
|
|
423
|
-
|
|
429
|
+
const rotated = await this.request(
|
|
424
430
|
"POST",
|
|
425
431
|
`/v1/vault/actions/rotate/${encodeURIComponent(key)}`,
|
|
426
432
|
{ body: { value: newValue } }
|
|
427
433
|
);
|
|
434
|
+
return { value: newValue, version: rotated.new_version ?? rotated.version };
|
|
428
435
|
}
|
|
429
436
|
};
|
|
430
437
|
// ==========================================================================
|
|
@@ -478,7 +485,7 @@ var ScaleMuleServer = class {
|
|
|
478
485
|
* ```
|
|
479
486
|
*/
|
|
480
487
|
set: async (key, type, data, inheritsFrom) => {
|
|
481
|
-
|
|
488
|
+
const written = await this.request(
|
|
482
489
|
"PUT",
|
|
483
490
|
`/v1/vault/bundles/${encodeURIComponent(key)}`,
|
|
484
491
|
{
|
|
@@ -489,6 +496,7 @@ var ScaleMuleServer = class {
|
|
|
489
496
|
}
|
|
490
497
|
}
|
|
491
498
|
);
|
|
499
|
+
return { type, data, version: written.version };
|
|
492
500
|
},
|
|
493
501
|
/**
|
|
494
502
|
* Delete a bundle
|
package/dist/server/index.js
CHANGED
|
@@ -464,9 +464,10 @@ var ScaleMuleServer = class {
|
|
|
464
464
|
* ```
|
|
465
465
|
*/
|
|
466
466
|
set: async (key, value) => {
|
|
467
|
-
|
|
467
|
+
const written = await this.request("PUT", `/v1/vault/secrets/${encodeURIComponent(key)}`, {
|
|
468
468
|
body: { value }
|
|
469
469
|
});
|
|
470
|
+
return { value, version: written.version };
|
|
470
471
|
},
|
|
471
472
|
/**
|
|
472
473
|
* Delete a secret from the tenant vault
|
|
@@ -493,21 +494,27 @@ var ScaleMuleServer = class {
|
|
|
493
494
|
* Rollback to a specific version
|
|
494
495
|
*/
|
|
495
496
|
rollback: async (key, version) => {
|
|
496
|
-
|
|
497
|
+
const written = await this.request(
|
|
497
498
|
"POST",
|
|
498
499
|
`/v1/vault/actions/rollback/${encodeURIComponent(key)}`,
|
|
499
500
|
{ body: { version } }
|
|
500
501
|
);
|
|
502
|
+
const current = await this.request(
|
|
503
|
+
"GET",
|
|
504
|
+
`/v1/vault/secrets/${encodeURIComponent(key)}`
|
|
505
|
+
);
|
|
506
|
+
return { value: current.value, version: written.version ?? current.version };
|
|
501
507
|
},
|
|
502
508
|
/**
|
|
503
509
|
* Rotate a secret (copy current version as new version)
|
|
504
510
|
*/
|
|
505
511
|
rotate: async (key, newValue) => {
|
|
506
|
-
|
|
512
|
+
const rotated = await this.request(
|
|
507
513
|
"POST",
|
|
508
514
|
`/v1/vault/actions/rotate/${encodeURIComponent(key)}`,
|
|
509
515
|
{ body: { value: newValue } }
|
|
510
516
|
);
|
|
517
|
+
return { value: newValue, version: rotated.new_version ?? rotated.version };
|
|
511
518
|
}
|
|
512
519
|
};
|
|
513
520
|
// ==========================================================================
|
|
@@ -561,7 +568,7 @@ var ScaleMuleServer = class {
|
|
|
561
568
|
* ```
|
|
562
569
|
*/
|
|
563
570
|
set: async (key, type, data, inheritsFrom) => {
|
|
564
|
-
|
|
571
|
+
const written = await this.request(
|
|
565
572
|
"PUT",
|
|
566
573
|
`/v1/vault/bundles/${encodeURIComponent(key)}`,
|
|
567
574
|
{
|
|
@@ -572,6 +579,7 @@ var ScaleMuleServer = class {
|
|
|
572
579
|
}
|
|
573
580
|
}
|
|
574
581
|
);
|
|
582
|
+
return { type, data, version: written.version };
|
|
575
583
|
},
|
|
576
584
|
/**
|
|
577
585
|
* Delete a bundle
|
package/dist/server/index.mjs
CHANGED
|
@@ -462,9 +462,10 @@ var ScaleMuleServer = class {
|
|
|
462
462
|
* ```
|
|
463
463
|
*/
|
|
464
464
|
set: async (key, value) => {
|
|
465
|
-
|
|
465
|
+
const written = await this.request("PUT", `/v1/vault/secrets/${encodeURIComponent(key)}`, {
|
|
466
466
|
body: { value }
|
|
467
467
|
});
|
|
468
|
+
return { value, version: written.version };
|
|
468
469
|
},
|
|
469
470
|
/**
|
|
470
471
|
* Delete a secret from the tenant vault
|
|
@@ -491,21 +492,27 @@ var ScaleMuleServer = class {
|
|
|
491
492
|
* Rollback to a specific version
|
|
492
493
|
*/
|
|
493
494
|
rollback: async (key, version) => {
|
|
494
|
-
|
|
495
|
+
const written = await this.request(
|
|
495
496
|
"POST",
|
|
496
497
|
`/v1/vault/actions/rollback/${encodeURIComponent(key)}`,
|
|
497
498
|
{ body: { version } }
|
|
498
499
|
);
|
|
500
|
+
const current = await this.request(
|
|
501
|
+
"GET",
|
|
502
|
+
`/v1/vault/secrets/${encodeURIComponent(key)}`
|
|
503
|
+
);
|
|
504
|
+
return { value: current.value, version: written.version ?? current.version };
|
|
499
505
|
},
|
|
500
506
|
/**
|
|
501
507
|
* Rotate a secret (copy current version as new version)
|
|
502
508
|
*/
|
|
503
509
|
rotate: async (key, newValue) => {
|
|
504
|
-
|
|
510
|
+
const rotated = await this.request(
|
|
505
511
|
"POST",
|
|
506
512
|
`/v1/vault/actions/rotate/${encodeURIComponent(key)}`,
|
|
507
513
|
{ body: { value: newValue } }
|
|
508
514
|
);
|
|
515
|
+
return { value: newValue, version: rotated.new_version ?? rotated.version };
|
|
509
516
|
}
|
|
510
517
|
};
|
|
511
518
|
// ==========================================================================
|
|
@@ -559,7 +566,7 @@ var ScaleMuleServer = class {
|
|
|
559
566
|
* ```
|
|
560
567
|
*/
|
|
561
568
|
set: async (key, type, data, inheritsFrom) => {
|
|
562
|
-
|
|
569
|
+
const written = await this.request(
|
|
563
570
|
"PUT",
|
|
564
571
|
`/v1/vault/bundles/${encodeURIComponent(key)}`,
|
|
565
572
|
{
|
|
@@ -570,6 +577,7 @@ var ScaleMuleServer = class {
|
|
|
570
577
|
}
|
|
571
578
|
}
|
|
572
579
|
);
|
|
580
|
+
return { type, data, version: written.version };
|
|
573
581
|
},
|
|
574
582
|
/**
|
|
575
583
|
* Delete a bundle
|
package/package.json
CHANGED