@useshortcut/client 1.0.0 → 2.0.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.
package/package.json CHANGED
@@ -1,60 +1,50 @@
1
1
  {
2
2
  "name": "@useshortcut/client",
3
- "version": "1.0.0",
4
- "description": "A Promise based library to the Shortcut (formerly Clubhouse) REST API",
5
- "main": "lib/index.js",
6
- "types": "lib/index.d.ts",
7
- "files": [
8
- "lib"
9
- ],
3
+ "version": "2.0.0",
4
+ "description": "A Promise based library to the Shortcut REST API",
5
+ "homepage": "https://github.com/useshortcut/shortcut-client-js",
10
6
  "bugs": {
11
7
  "url": "https://github.com/useshortcut/shortcut-client-js/issues"
12
8
  },
13
- "homepage": "https://github.com/useshortcut/shortcut-client-js",
14
- "readme": "https://github.com/useshortcut/shortcut-client-js#readme",
15
9
  "repository": {
16
10
  "type": "git",
17
11
  "url": "https://github.com/useshortcut/shortcut-client-js.git"
18
12
  },
19
13
  "license": "MIT",
14
+ "sideEffects": false,
15
+ "type": "commonjs",
16
+ "exports": {
17
+ ".": {
18
+ "import": {
19
+ "types": "./lib/index.d.mts",
20
+ "default": "./lib/index.mjs"
21
+ },
22
+ "require": {
23
+ "types": "./lib/index.d.ts",
24
+ "default": "./lib/index.js"
25
+ }
26
+ }
27
+ },
28
+ "main": "./lib/index.js",
29
+ "module": "./lib/index.mjs",
30
+ "types": "./lib/index.d.ts",
31
+ "files": [
32
+ "lib"
33
+ ],
20
34
  "scripts": {
21
- "build": "yarn build:client && tsc",
22
- "build:client": "swagger-typescript-api -p ./schema/shortcut.swagger.json -o ./src/generated --clean-output --axios --modular --templates ./templates && yarn add-typedoc-comments",
23
- "build:docs": "typedoc --entryPointStrategy expand ./src --exclude 'src/__tests__/**'",
24
- "sync:schema": "wget https://shortcut.com/api/rest/v3/shortcut.swagger.json --destination ./schema/shortcut.swagger.json && yarn validate:schema",
25
- "validate:schema": "swagger-cli validate ./schema/shortcut.swagger.json",
26
- "validate:examples": "npx tsc examples/*.ts --noEmit",
27
- "add-typedoc-comments": "node ./node_modules/.bin/jscodeshift -t scripts/add-typedoc-comments-transform.js src/generated/**",
35
+ "build": "yarn build:client && yarn build:add-typedoc-comments && tsup",
36
+ "build:add-typedoc-comments": "npx jscodeshift -t scripts/add-typedoc-comments.ts --extensions=ts --parser=ts src/generated/**",
37
+ "build:client": "swagger-typescript-api generate --path ./schema/shortcut.swagger.json --output ./src/generated --clean-output --axios --modular --templates ./templates",
38
+ "build:docs": "typedoc ./src --exclude 'src/__tests__/**'",
39
+ "check-exports": "attw --pack .",
40
+ "format": "prettier --write -l *.{json,md,prettierrc} '{src,scripts}/**/*.ts'",
41
+ "format:check": "prettier --check *.{json,md,prettierrc} '{src,scripts}/**/*.ts'",
28
42
  "lint": "eslint 'src/**/*.{js,ts}'",
43
+ "prepublishOnly": "yarn build",
44
+ "sync:schema": "curl --silent https://developer.shortcut.com/api/rest/v3/shortcut.swagger.json --output ./schema/shortcut.swagger.json && yarn validate:schema",
29
45
  "test": "jest",
30
- "prepublishOnly": "yarn build"
31
- },
32
- "dependencies": {
33
- "axios": "^0.21.3",
34
- "form-data": "^4.0.0"
35
- },
36
- "devDependencies": {
37
- "@types/jest": "^27.0.2",
38
- "@types/node": "^16.10.3",
39
- "@typescript-eslint/eslint-plugin": "^4.33.0",
40
- "@typescript-eslint/parser": "^4.33.0",
41
- "eslint": "^7.32.0",
42
- "eslint-config-airbnb-base": "^14.2.1",
43
- "eslint-config-prettier": "^8.3.0",
44
- "eslint-plugin-import": "^2.24.2",
45
- "eslint-plugin-jest": "^24.5.2",
46
- "eslint-plugin-prettier": "^4.0.0",
47
- "jest": "^27.2.4",
48
- "jscodeshift": "^0.13.0",
49
- "node-wget": "^0.4.3",
50
- "prettier": "2.4.1",
51
- "rimraf": "^3.0.2",
52
- "swagger-cli": "^4.0.4",
53
- "swagger-typescript-api": "9.2.0",
54
- "ts-jest": "^27.0.5",
55
- "typedoc": "0.22.5",
56
- "typedoc-plugin-merge-modules": "3.0.2",
57
- "typescript": "4.4.3"
46
+ "validate:examples": "npx tsc examples/*.ts --noEmit",
47
+ "validate:schema": "swagger-cli validate ./schema/shortcut.swagger.json"
58
48
  },
59
49
  "jest": {
60
50
  "preset": "ts-jest",
@@ -63,5 +53,37 @@
63
53
  "<rootDir>/lib/",
64
54
  "<rootDir>/node_modules/"
65
55
  ]
66
- }
56
+ },
57
+ "dependencies": {
58
+ "axios": "^1.9.0"
59
+ },
60
+ "devDependencies": {
61
+ "@arethetypeswrong/cli": "^0.18.1",
62
+ "@total-typescript/tsconfig": "^1.0.4",
63
+ "@types/glob": "^8.1.0",
64
+ "@types/jest": "^29.5.14",
65
+ "@types/jscodeshift": "17.3.0",
66
+ "@types/node": "^22.15.30",
67
+ "@typescript-eslint/eslint-plugin": "^8.33.1",
68
+ "@typescript-eslint/parser": "^8.33.1",
69
+ "eslint": "^8.57.1",
70
+ "eslint-config-airbnb-base": "^15.0.0",
71
+ "eslint-config-prettier": "^10.1.5",
72
+ "eslint-plugin-import": "^2.31.0",
73
+ "eslint-plugin-jest": "^28.12.0",
74
+ "eslint-plugin-prettier": "^5.4.1",
75
+ "glob": "^11.0.2",
76
+ "jest": "^29.7.0",
77
+ "jscodeshift": "^17.3.0",
78
+ "prettier": "^3.5.3",
79
+ "stream-to-blob": "^2.0.1",
80
+ "swagger-cli": "^4.0.4",
81
+ "swagger-typescript-api": "^13.2.0",
82
+ "ts-jest": "^29.3.4",
83
+ "tsup": "^8.5.0",
84
+ "typedoc": "0.28.5",
85
+ "typedoc-plugin-merge-modules": "7.0.0",
86
+ "typescript": "^5.8.3"
87
+ },
88
+ "readme": "https://github.com/useshortcut/shortcut-client-js#readme"
67
89
  }
@@ -1,5 +0,0 @@
1
- import { Api } from './generated/Api';
2
- import type { ApiConfig } from './generated/http-client';
3
- export declare class ShortcutApi<SecurityDataType = unknown> extends Api<SecurityDataType> {
4
- constructor(apiToken: string, config?: ApiConfig<SecurityDataType>);
5
- }
@@ -1,45 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.ShortcutApi = void 0;
30
- var Api_1 = require("./generated/Api");
31
- var ShortcutApi = /** @class */ (function (_super) {
32
- __extends(ShortcutApi, _super);
33
- function ShortcutApi(apiToken, config) {
34
- if (config === void 0) { config = {}; }
35
- var _this = this;
36
- if (apiToken == null || typeof apiToken !== 'string') {
37
- // eslint-disable-next-line no-console
38
- console.error('You need to supply an API Token.');
39
- }
40
- _this = _super.call(this, __assign({ headers: __assign({ 'Shortcut-Token': apiToken }, config.headers) }, config)) || this;
41
- return _this;
42
- }
43
- return ShortcutApi;
44
- }(Api_1.Api));
45
- exports.ShortcutApi = ShortcutApi;