@phpsandbox/sdk 0.0.26 → 0.0.27

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.
@@ -4551,6 +4551,15 @@ function isBeaconSupported() {
4551
4551
  }
4552
4552
 
4553
4553
  // src/index.ts
4554
+ function normalizeNotebookSecretInputs(input) {
4555
+ if (Array.isArray(input)) {
4556
+ return input;
4557
+ }
4558
+ return Object.entries(input).map(([name, value]) => ({
4559
+ name,
4560
+ ...typeof value === "string" ? { value } : value
4561
+ }));
4562
+ }
4554
4563
  var NotebookInitError = class extends Error {
4555
4564
  constructor(message, data = {}) {
4556
4565
  super(message);
@@ -4663,8 +4672,14 @@ var NotebookSecretApi = class {
4663
4672
  return response.data;
4664
4673
  }
4665
4674
  async set(id, name, input) {
4666
- const payload = typeof input === "string" ? { value: input } : input;
4667
- const response = await this.client.put(`/notebook/${id}/secrets/${encodeURIComponent(name)}`, payload);
4675
+ const payload = typeof input === "string" ? { name, value: input } : { name, ...input };
4676
+ const response = await this.client.put(`/notebook/${id}/secrets`, payload);
4677
+ return response.data;
4678
+ }
4679
+ async setMany(id, input) {
4680
+ const response = await this.client.put(`/notebook/${id}/secrets`, {
4681
+ secrets: normalizeNotebookSecretInputs(input)
4682
+ });
4668
4683
  return response.data;
4669
4684
  }
4670
4685
  async delete(id, name) {
@@ -4831,6 +4846,9 @@ var NotebookSecrets = class {
4831
4846
  set(name, input) {
4832
4847
  return this.client.notebook.secrets.set(this.notebookId, name, input);
4833
4848
  }
4849
+ setMany(input) {
4850
+ return this.client.notebook.secrets.setMany(this.notebookId, input);
4851
+ }
4834
4852
  delete(name) {
4835
4853
  return this.client.notebook.secrets.delete(this.notebookId, name);
4836
4854
  }