@sebastienrousseau/crypto-api 0.0.8 → 0.0.24

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
@@ -23,30 +23,19 @@
23
23
  "@sebastienrousseau/c8-config": "^0.0.7",
24
24
  "@sebastienrousseau/eslint-config": "^0.0.7",
25
25
  "@sebastienrousseau/jsdoc-config": "^0.0.7",
26
- "@sebastienrousseau/markdownlint-config": "^0.0.1",
27
- "@sebastienrousseau/mocha-config": "^0.0.5",
26
+ "@sebastienrousseau/markdownlint-config": "^0.0.7",
27
+ "@sebastienrousseau/mocha-config": "^0.0.7",
28
28
  "@sebastienrousseau/prettier-config": "^0.0.7",
29
- "@sebastienrousseau/remark-config": "^0.0.7",
30
- "@types/chai": "^4.3.7",
29
+ "@types/chai": "^5.2.3",
31
30
  "@types/chai-as-promised": "^8.0.2",
32
- "@types/mocha": "^10.0.2",
31
+ "@types/mocha": "^10.0.10",
33
32
  "@types/node": "^26.6.3",
34
- "@typescript-eslint/eslint-plugin": "^6.21.0",
35
- "@typescript-eslint/parser": "^6.21.0",
36
33
  "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",
34
+ "chai": "^6.3.0",
35
+ "chai-as-promised": "^8.0.2",
42
36
  "filesizes": "^0.1.2",
43
- "mocha": "^10.8.2",
44
- "prettier": "^3.9.8",
45
- "remark-cli": "^12.0.0",
46
- "remark-footnotes": "^5.0.0",
47
- "remark-preset-lint-consistent": "^6.0.1",
48
- "remark-preset-lint-markdown-style-guide": "^5.1.3",
49
- "remark-preset-lint-recommended": "^7.0.1",
37
+ "mocha": "^12.0.3",
38
+ "prettier": "^3.9.9",
50
39
  "rimraf": "^6.1.3",
51
40
  "ts-node": "^10.9.1",
52
41
  "typedoc": "^0.28.20",
@@ -86,29 +75,31 @@
86
75
  ],
87
76
  "license": "MIT OR Apache-2.0",
88
77
  "license_URI": "http://www.opensource.org/licenses/mit-license.php",
78
+ "type": "commonjs",
89
79
  "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
80
  "name": "@sebastienrousseau/crypto-api",
98
81
  "private": false,
99
82
  "publishConfig": {
100
83
  "access": "public"
101
84
  },
102
85
  "types": "./dist/index.d.ts",
86
+ "exports": {
87
+ ".": {
88
+ "types": "./dist/index.d.ts",
89
+ "require": "./dist/index.js",
90
+ "default": "./dist/index.js"
91
+ },
92
+ "./package.json": "./package.json"
93
+ },
103
94
  "sideEffects": false,
104
- "version": "0.0.8",
95
+ "version": "0.0.24",
105
96
  "scripts": {
106
97
  "build": "tsc --build tsconfig.json",
107
98
  "clean": "rimraf ./coverage ./dist ./docs",
108
99
  "format": "prettier --write src/**/*.ts",
109
100
  "format:check": "prettier --check \"src/**/*.ts\"",
110
- "lint": "eslint --ext .ts src __tests__",
111
- "lint:fix": "eslint --cache --fix --ext .ts src __tests__",
101
+ "lint": "eslint src __tests__",
102
+ "lint:fix": "eslint --cache --fix src __tests__",
112
103
  "start": "node dist/index.js",
113
104
  "test": "c8 --check-coverage --lines 100 --branches 100 --functions 100 --reporter=lcov --reporter=text mocha --config=.mocharc.cjs",
114
105
  "docs": "typedoc"