@shoplygg/node 0.1.0 → 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shoply
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -6867,6 +6867,16 @@ export type DisputesMarkSubmittedResult = {
6867
6867
  }[];
6868
6868
  };
6869
6869
 
6870
+ /** What add a file to a dispute's answer takes: `disputes.addFile`, the file and its fields. */
6871
+ export interface DisputesAddFileParams extends FileUpload {
6872
+ /**
6873
+ * What the file is: a chat with the buyer, a receipt, or something else.
6874
+ *
6875
+ * Left out, it is "other".
6876
+ */
6877
+ kind?: "communication" | "receipt" | "other";
6878
+ }
6879
+
6870
6880
  /** What add a file to a dispute's answer answers: `disputes.addFile`. */
6871
6881
  export type DisputesAddFileResult = unknown;
6872
6882
 
@@ -12097,7 +12107,7 @@ export interface ShoplyResourcesDisputes {
12097
12107
  *
12098
12108
  * @see https://docs.shoply.gg/api-reference/disputes/add-a-file-to-a-disputes-answer
12099
12109
  */
12100
- addFile(disputeId: string, params: FileUpload, options?: RequestOptions): Promise<DisputesAddFileResult>;
12110
+ addFile(disputeId: string, params: DisputesAddFileParams, options?: RequestOptions): Promise<DisputesAddFileResult>;
12101
12111
  /**
12102
12112
  * **Remove a file from a dispute's answer**
12103
12113
  *
package/index.js CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  import { EVENTS, OPERATIONS } from "./generated/operations.js";
14
14
 
15
- export const VERSION = "0.1.0";
15
+ export const VERSION = "0.1.1";
16
16
 
17
17
  const API = "https://api.shoply.gg/v1";
18
18
 
@@ -267,6 +267,8 @@ function prepare(op, args) {
267
267
  if (op.upload) {
268
268
  form = new FormData();
269
269
  form.append(op.upload, toBlob(params.file, params.contentType), params.filename ?? params.file?.name ?? "upload");
270
+ // What the route takes beside the file (a dispute's file says its `kind`) is in the address.
271
+ query = Object.fromEntries(op.query.filter((name) => params[name] !== undefined).map((name) => [name, params[name]]));
270
272
  } else if (op.body) {
271
273
  query = {};
272
274
  body = {};
package/package.json CHANGED
@@ -1,9 +1,16 @@
1
1
  {
2
2
  "name": "@shoplygg/node",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Shoply's API from your own server: every route as a typed method, safe retries, pages, and checking webhooks.",
5
5
  "keywords": ["shoply", "api", "sdk", "ecommerce", "webhooks", "digital-goods"],
6
6
  "homepage": "https://docs.shoply.gg/api-reference/node",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/shoplygg/shoply-node.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/shoplygg/shoply-node/issues"
13
+ },
7
14
  "license": "MIT",
8
15
  "publishConfig": {
9
16
  "access": "public"
@@ -18,8 +25,11 @@
18
25
  }
19
26
  },
20
27
  "sideEffects": false,
21
- "files": ["index.js", "index.d.ts", "generated", "README.md"],
28
+ "files": ["index.js", "index.d.ts", "generated", "README.md", "LICENSE"],
22
29
  "engines": {
23
30
  "node": ">=20"
31
+ },
32
+ "scripts": {
33
+ "test": "node --test test/client.test.mjs"
24
34
  }
25
35
  }