@myapihq/sdk 2.11.1 → 2.12.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.
@@ -47,5 +47,6 @@ export interface CreateFeedbackInput {
47
47
  }
48
48
  export declare function createFeedback(apiKey: string, orgId: string, input: CreateFeedbackInput): Promise<FeedbackItem>;
49
49
  export declare function resolveFeedback(apiKey: string, orgId: string, id: string): Promise<void>;
50
+ export declare function deleteFeedback(apiKey: string, orgId: string, id: string): Promise<void>;
50
51
  export declare function createWidget(apiKey: string, orgId: string, name: string, allowedOrigins?: string[]): Promise<Widget>;
51
52
  export declare function revokeWidget(apiKey: string, orgId: string, id: string): Promise<void>;
package/dist/feedback.js CHANGED
@@ -4,6 +4,7 @@ exports.EXPOSES = void 0;
4
4
  exports.listFeedback = listFeedback;
5
5
  exports.createFeedback = createFeedback;
6
6
  exports.resolveFeedback = resolveFeedback;
7
+ exports.deleteFeedback = deleteFeedback;
7
8
  exports.createWidget = createWidget;
8
9
  exports.revokeWidget = revokeWidget;
9
10
  const client_1 = require("./client");
@@ -16,6 +17,7 @@ exports.EXPOSES = [
16
17
  'GET /feedback/orgs/{org_id}/items',
17
18
  'POST /feedback/orgs/{org_id}/items',
18
19
  'POST /feedback/orgs/{org_id}/items/{id}/resolve',
20
+ 'DELETE /feedback/orgs/{org_id}/items/{id}',
19
21
  ];
20
22
  function orgBase(orgId) {
21
23
  return `${config_1.FEEDBACK_BASE}/feedback/orgs/${encodeURIComponent(orgId)}`;
@@ -41,6 +43,16 @@ async function createFeedback(apiKey, orgId, input) {
41
43
  async function resolveFeedback(apiKey, orgId, id) {
42
44
  return (0, client_1.request)('POST', `${orgBase(orgId)}/items/${encodeURIComponent(id)}/resolve`, apiKey, {});
43
45
  }
46
+ // Erases an item, as opposed to resolveFeedback which closes it and keeps it.
47
+ // Submissions arrive through a public endpoint, so an inbox collects spam and
48
+ // the occasional message where somebody typed personal details into a bug
49
+ // report — this is the way those come out.
50
+ //
51
+ // Idempotent, and like resolve it answers the same for an unknown id, so a
52
+ // success is not proof the item existed.
53
+ async function deleteFeedback(apiKey, orgId, id) {
54
+ return (0, client_1.request)('DELETE', `${orgBase(orgId)}/items/${encodeURIComponent(id)}`, apiKey);
55
+ }
44
56
  // Mints a PUBLIC widget key. It ships in your page source and authenticates
45
57
  // nobody — it names an org so a page can submit without a credential. Set
46
58
  // `allowed_origins` so another site cannot post through it, and revoke it if
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.11.1";
1
+ export declare const SDK_VERSION = "2.12.0";
package/dist/version.js CHANGED
@@ -8,4 +8,4 @@ exports.SDK_VERSION = void 0;
8
8
  // Why a constant and not a package.json read: the SDK runs inside edge
9
9
  // functions (Cloudflare Workers), so it must not import node:fs. A literal
10
10
  // is the only version source that works in every runtime we ship to.
11
- exports.SDK_VERSION = '2.11.1';
11
+ exports.SDK_VERSION = '2.12.0';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@myapihq/sdk",
3
3
  "license": "Apache-2.0",
4
- "version": "2.11.1",
4
+ "version": "2.12.0",
5
5
  "description": "TypeScript SDK for the MyAPI ecosystem",
6
6
  "repository": {
7
7
  "type": "git",