@sebastienrousseau/crypto-api 0.0.8 → 0.0.9

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 CHANGED
@@ -87,7 +87,7 @@ import type {
87
87
  JsonRequest,
88
88
  RequestHeader,
89
89
  ResponseType,
90
- } from "@sebastienrousseau/crypto-api/dist/@types/types";
90
+ } from "@sebastienrousseau/crypto-api";
91
91
 
92
92
  // Type-safe request header
93
93
  const header: RequestHeader = {
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export type { AuthorizationToken, AuthorizationInfo, CollectionItem, JsonDocument, MethodType, JsonRequest, RequestHeader, ResponseType, } from "./@types/types";
1
2
  export declare function init(): Promise<void>;
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiCA,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAqE1C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqBA,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,UAAU,EACV,WAAW,EACX,aAAa,EACb,YAAY,GACb,MAAM,gBAAgB,CAAC;AAexB,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAqE1C"}
package/dist/index.js CHANGED
@@ -76,5 +76,7 @@ async function init() {
76
76
  }
77
77
  }
78
78
  }
79
- init();
79
+ if (require.main === module) {
80
+ void init();
81
+ }
80
82
  //# sourceMappingURL=index.js.map
@@ -117,19 +117,20 @@ const readResponse = (responses) => {
117
117
  };
118
118
  exports.readResponse = readResponse;
119
119
  const readMethods = (method) => {
120
+ const req = method.request ?? {};
120
121
  const parts = ["\n"];
121
- if (method.request?.description !== undefined) {
122
- parts.push(`#${method.request.description || ""}\n\n`);
122
+ if (req.description !== undefined) {
123
+ parts.push(`#${req.description || ""}\n\n`);
123
124
  }
124
- parts.push(`### ${method.request?.method ?? ""} ${method.name}\n\n`);
125
+ parts.push(`### ${req.method ?? ""} ${method.name}\n\n`);
125
126
  parts.push(">```\n");
126
- const urlString = typeof method.request?.url === "string" ? method.request.url : "";
127
+ const urlString = typeof req.url === "string" ? req.url : "";
127
128
  parts.push(`>${urlString}\n`);
128
129
  parts.push(">```\n\n");
129
130
  parts.push((0, exports.readRequest)(method.request));
130
- parts.push((0, exports.readFormDataBody)(method.request?.body));
131
- parts.push((0, exports.readQueryParams)(method.request?.url));
132
- parts.push((0, exports.readAuthorization)(method.request?.auth));
131
+ parts.push((0, exports.readFormDataBody)(req.body));
132
+ parts.push((0, exports.readQueryParams)(req.url));
133
+ parts.push((0, exports.readAuthorization)(req.auth));
133
134
  parts.push((0, exports.readResponse)(method.response));
134
135
  parts.push("![divider][divider]\n");
135
136
  return parts.join("");
package/package.json CHANGED
@@ -27,21 +27,16 @@
27
27
  "@sebastienrousseau/mocha-config": "^0.0.5",
28
28
  "@sebastienrousseau/prettier-config": "^0.0.7",
29
29
  "@sebastienrousseau/remark-config": "^0.0.7",
30
- "@types/chai": "^4.3.7",
30
+ "@types/chai": "^5.2.3",
31
31
  "@types/chai-as-promised": "^8.0.2",
32
- "@types/mocha": "^10.0.2",
32
+ "@types/mocha": "^10.0.10",
33
33
  "@types/node": "^26.6.3",
34
- "@typescript-eslint/eslint-plugin": "^6.21.0",
35
- "@typescript-eslint/parser": "^6.21.0",
36
34
  "c8": "^12.0.0",
37
- "chai": "^4.5.0",
38
- "chai-as-promised": "^7.1.2",
39
- "eslint": "^8.57.1",
40
- "eslint-import-resolver-typescript": "^3.10.1",
41
- "eslint-plugin-import": "^2.28.1",
35
+ "chai": "^6.3.0",
36
+ "chai-as-promised": "^8.0.2",
42
37
  "filesizes": "^0.1.2",
43
- "mocha": "^10.8.2",
44
- "prettier": "^3.9.8",
38
+ "mocha": "^12.0.3",
39
+ "prettier": "^3.9.9",
45
40
  "remark-cli": "^12.0.0",
46
41
  "remark-footnotes": "^5.0.0",
47
42
  "remark-preset-lint-consistent": "^6.0.1",
@@ -86,29 +81,31 @@
86
81
  ],
87
82
  "license": "MIT OR Apache-2.0",
88
83
  "license_URI": "http://www.opensource.org/licenses/mit-license.php",
84
+ "type": "commonjs",
89
85
  "main": "./dist/index.js",
90
- "exports": {
91
- ".": {
92
- "types": "./dist/index.d.ts",
93
- "require": "./dist/index.js",
94
- "import": "./dist/index.js"
95
- }
96
- },
97
86
  "name": "@sebastienrousseau/crypto-api",
98
87
  "private": false,
99
88
  "publishConfig": {
100
89
  "access": "public"
101
90
  },
102
91
  "types": "./dist/index.d.ts",
92
+ "exports": {
93
+ ".": {
94
+ "types": "./dist/index.d.ts",
95
+ "require": "./dist/index.js",
96
+ "default": "./dist/index.js"
97
+ },
98
+ "./package.json": "./package.json"
99
+ },
103
100
  "sideEffects": false,
104
- "version": "0.0.8",
101
+ "version": "0.0.9",
105
102
  "scripts": {
106
103
  "build": "tsc --build tsconfig.json",
107
104
  "clean": "rimraf ./coverage ./dist ./docs",
108
105
  "format": "prettier --write src/**/*.ts",
109
106
  "format:check": "prettier --check \"src/**/*.ts\"",
110
- "lint": "eslint --ext .ts src __tests__",
111
- "lint:fix": "eslint --cache --fix --ext .ts src __tests__",
107
+ "lint": "eslint src __tests__",
108
+ "lint:fix": "eslint --cache --fix src __tests__",
112
109
  "start": "node dist/index.js",
113
110
  "test": "c8 --check-coverage --lines 100 --branches 100 --functions 100 --reporter=lcov --reporter=text mocha --config=.mocharc.cjs",
114
111
  "docs": "typedoc"