@phpsandbox/sdk 0.6.0-canary.2 → 0.6.0-canary.3
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/README.md +3 -0
- package/dist/browser/phpsandbox-sdk.esm.js +32 -8
- package/dist/browser/phpsandbox-sdk.esm.min.js +9 -9
- package/dist/browser/phpsandbox-sdk.iife.js +32 -8
- package/dist/browser/phpsandbox-sdk.iife.min.js +9 -9
- package/dist/feedback.d.ts +19 -4
- package/dist/feedback.js +17 -5
- package/dist/index.d.ts +8 -3
- package/dist/index.js +14 -4
- package/package.json +1 -1
|
@@ -33,6 +33,8 @@ var PHPSandbox = (() => {
|
|
|
33
33
|
CustomerRuntime: () => CustomerRuntime,
|
|
34
34
|
CustomersApi: () => CustomersApi,
|
|
35
35
|
DEFAULT_PAYMENT_CALLBACK_PATH: () => DEFAULT_PAYMENT_CALLBACK_PATH,
|
|
36
|
+
Feedback: () => Feedback,
|
|
37
|
+
FeedbackApi: () => FeedbackApi,
|
|
36
38
|
FileChangeFilter: () => FileChangeFilter,
|
|
37
39
|
FileChangeType: () => FileChangeType,
|
|
38
40
|
FileType: () => FileType,
|
|
@@ -20611,9 +20613,9 @@ ${JSON.stringify(metadata, null, 2)}` : "";
|
|
|
20611
20613
|
|
|
20612
20614
|
// src/feedback.ts
|
|
20613
20615
|
var Feedback = class {
|
|
20614
|
-
constructor(client,
|
|
20616
|
+
constructor(client, identifier) {
|
|
20615
20617
|
this.client = client;
|
|
20616
|
-
this.
|
|
20618
|
+
this.identifier = identifier;
|
|
20617
20619
|
}
|
|
20618
20620
|
async configure(input) {
|
|
20619
20621
|
const response = await this.client.put(this.path("/configuration"), input);
|
|
@@ -20623,8 +20625,8 @@ ${JSON.stringify(metadata, null, 2)}` : "";
|
|
|
20623
20625
|
const response = await this.client.get(this.path("/configuration"));
|
|
20624
20626
|
return response.data;
|
|
20625
20627
|
}
|
|
20626
|
-
async submit(input) {
|
|
20627
|
-
const response = await this.client.post(this.path(), input);
|
|
20628
|
+
async submit(input, options = {}) {
|
|
20629
|
+
const response = await this.client.post(this.path(), input, options);
|
|
20628
20630
|
return response.data;
|
|
20629
20631
|
}
|
|
20630
20632
|
async list(options = {}) {
|
|
@@ -20645,7 +20647,18 @@ ${JSON.stringify(metadata, null, 2)}` : "";
|
|
|
20645
20647
|
return response.data;
|
|
20646
20648
|
}
|
|
20647
20649
|
path(suffix = "") {
|
|
20648
|
-
return `/
|
|
20650
|
+
return `/platform/projects/${encodeURIComponent(this.identifier)}/feedback${suffix}`;
|
|
20651
|
+
}
|
|
20652
|
+
};
|
|
20653
|
+
var FeedbackApi = class {
|
|
20654
|
+
constructor(client) {
|
|
20655
|
+
this.client = client;
|
|
20656
|
+
}
|
|
20657
|
+
forProject(projectId) {
|
|
20658
|
+
return new Feedback(this.client, projectId);
|
|
20659
|
+
}
|
|
20660
|
+
forNotebook(notebookId) {
|
|
20661
|
+
return new Feedback(this.client, notebookId);
|
|
20649
20662
|
}
|
|
20650
20663
|
};
|
|
20651
20664
|
|
|
@@ -20806,6 +20819,7 @@ ${JSON.stringify(metadata, null, 2)}` : "";
|
|
|
20806
20819
|
this.integrations = new IntegrationApi(this);
|
|
20807
20820
|
this.payments = new PaymentsApi(this);
|
|
20808
20821
|
this.customers = new CustomersApi(this);
|
|
20822
|
+
this.feedback = new FeedbackApi(this);
|
|
20809
20823
|
this.options = { ...options };
|
|
20810
20824
|
this.runtimeTransportValue = runtimeTransport;
|
|
20811
20825
|
this.baseUrl = normalizeApiBaseUrl(url2);
|
|
@@ -20824,8 +20838,13 @@ ${JSON.stringify(metadata, null, 2)}` : "";
|
|
|
20824
20838
|
get(path) {
|
|
20825
20839
|
return this.requireData(this.makeRequest("GET", path));
|
|
20826
20840
|
}
|
|
20827
|
-
post(path, body) {
|
|
20828
|
-
return this.requireData(
|
|
20841
|
+
post(path, body, options = {}) {
|
|
20842
|
+
return this.requireData(
|
|
20843
|
+
this.makeRequest("POST", path, {
|
|
20844
|
+
body: body === void 0 ? void 0 : JSON.stringify(body),
|
|
20845
|
+
headers: options.idempotencyKey === void 0 ? void 0 : { "Idempotency-Key": options.idempotencyKey }
|
|
20846
|
+
})
|
|
20847
|
+
);
|
|
20829
20848
|
}
|
|
20830
20849
|
delete(path) {
|
|
20831
20850
|
return this.makeRequest("DELETE", path);
|
|
@@ -20878,11 +20897,15 @@ ${JSON.stringify(metadata, null, 2)}` : "";
|
|
|
20878
20897
|
return { ...response, data: response.data };
|
|
20879
20898
|
}
|
|
20880
20899
|
async makeRequest(method, path, init) {
|
|
20900
|
+
const headers = new Headers(init?.headers);
|
|
20901
|
+
for (const [name, value] of Object.entries(this.headers)) {
|
|
20902
|
+
headers.set(name, value);
|
|
20903
|
+
}
|
|
20881
20904
|
const response = await this.fetchResponse(
|
|
20882
20905
|
authenticatedRequest(new URL(path.replace(/^\//, ""), this.baseUrl), {
|
|
20883
20906
|
method,
|
|
20884
20907
|
...init,
|
|
20885
|
-
headers
|
|
20908
|
+
headers
|
|
20886
20909
|
})
|
|
20887
20910
|
);
|
|
20888
20911
|
if (!response.ok) {
|
|
@@ -20948,6 +20971,7 @@ ${JSON.stringify(metadata, null, 2)}` : "";
|
|
|
20948
20971
|
this.integrations = client.integrations;
|
|
20949
20972
|
this.payments = client.payments;
|
|
20950
20973
|
this.customers = client.customers;
|
|
20974
|
+
this.feedback = client.feedback;
|
|
20951
20975
|
}
|
|
20952
20976
|
async whoami() {
|
|
20953
20977
|
const { data } = await this.client.get("/auth/whoami");
|