@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.
- package/dist/browser/phpsandbox-sdk.esm.js +20 -2
- package/dist/browser/phpsandbox-sdk.esm.js.map +2 -2
- package/dist/browser/phpsandbox-sdk.esm.min.js +2 -2
- package/dist/browser/phpsandbox-sdk.esm.min.js.map +3 -3
- package/dist/browser/phpsandbox-sdk.iife.js +20 -2
- package/dist/browser/phpsandbox-sdk.iife.js.map +2 -2
- package/dist/browser/phpsandbox-sdk.iife.min.js +2 -2
- package/dist/browser/phpsandbox-sdk.iife.min.js.map +3 -3
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -4593,6 +4593,15 @@ var PHPSandbox = (() => {
|
|
|
4593
4593
|
}
|
|
4594
4594
|
|
|
4595
4595
|
// src/index.ts
|
|
4596
|
+
function normalizeNotebookSecretInputs(input) {
|
|
4597
|
+
if (Array.isArray(input)) {
|
|
4598
|
+
return input;
|
|
4599
|
+
}
|
|
4600
|
+
return Object.entries(input).map(([name, value]) => ({
|
|
4601
|
+
name,
|
|
4602
|
+
...typeof value === "string" ? { value } : value
|
|
4603
|
+
}));
|
|
4604
|
+
}
|
|
4596
4605
|
var NotebookInitError = class extends Error {
|
|
4597
4606
|
constructor(message, data = {}) {
|
|
4598
4607
|
super(message);
|
|
@@ -4705,8 +4714,14 @@ var PHPSandbox = (() => {
|
|
|
4705
4714
|
return response.data;
|
|
4706
4715
|
}
|
|
4707
4716
|
async set(id, name, input) {
|
|
4708
|
-
const payload = typeof input === "string" ? { value: input } : input;
|
|
4709
|
-
const response = await this.client.put(`/notebook/${id}/secrets
|
|
4717
|
+
const payload = typeof input === "string" ? { name, value: input } : { name, ...input };
|
|
4718
|
+
const response = await this.client.put(`/notebook/${id}/secrets`, payload);
|
|
4719
|
+
return response.data;
|
|
4720
|
+
}
|
|
4721
|
+
async setMany(id, input) {
|
|
4722
|
+
const response = await this.client.put(`/notebook/${id}/secrets`, {
|
|
4723
|
+
secrets: normalizeNotebookSecretInputs(input)
|
|
4724
|
+
});
|
|
4710
4725
|
return response.data;
|
|
4711
4726
|
}
|
|
4712
4727
|
async delete(id, name) {
|
|
@@ -4873,6 +4888,9 @@ var PHPSandbox = (() => {
|
|
|
4873
4888
|
set(name, input) {
|
|
4874
4889
|
return this.client.notebook.secrets.set(this.notebookId, name, input);
|
|
4875
4890
|
}
|
|
4891
|
+
setMany(input) {
|
|
4892
|
+
return this.client.notebook.secrets.setMany(this.notebookId, input);
|
|
4893
|
+
}
|
|
4876
4894
|
delete(name) {
|
|
4877
4895
|
return this.client.notebook.secrets.delete(this.notebookId, name);
|
|
4878
4896
|
}
|