@ukwhatn/wikidot 1.0.10 → 4.0.3

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.
Files changed (93) hide show
  1. package/README.md +242 -78
  2. package/dist/errors.cjs +114 -0
  3. package/dist/errors.d.cts +94 -0
  4. package/dist/errors.d.ts +94 -0
  5. package/dist/errors.js +81 -0
  6. package/dist/index.cjs +4615 -0
  7. package/dist/index.d.cts +2158 -0
  8. package/dist/index.d.ts +2158 -1
  9. package/dist/index.js +4582 -6
  10. package/package.json +64 -40
  11. package/.eslintrc.js +0 -23
  12. package/.github/dependabot.yml +0 -12
  13. package/.prettierrc +0 -6
  14. package/Makefile +0 -24
  15. package/dist/common/exceptions.d.ts +0 -95
  16. package/dist/common/exceptions.js +0 -146
  17. package/dist/common/exceptions.js.map +0 -1
  18. package/dist/common/index.d.ts +0 -1
  19. package/dist/common/index.js +0 -6
  20. package/dist/common/index.js.map +0 -1
  21. package/dist/common/logger.d.ts +0 -2
  22. package/dist/common/logger.js +0 -19
  23. package/dist/common/logger.js.map +0 -1
  24. package/dist/connector/ajax.d.ts +0 -142
  25. package/dist/connector/ajax.js +0 -260
  26. package/dist/connector/ajax.js.map +0 -1
  27. package/dist/connector/api.d.ts +0 -11
  28. package/dist/connector/api.js +0 -17
  29. package/dist/connector/api.js.map +0 -1
  30. package/dist/connector/index.d.ts +0 -0
  31. package/dist/connector/index.js +0 -2
  32. package/dist/connector/index.js.map +0 -1
  33. package/dist/index.js.map +0 -1
  34. package/dist/module/auth.d.ts +0 -8
  35. package/dist/module/auth.js +0 -80
  36. package/dist/module/auth.js.map +0 -1
  37. package/dist/module/client.d.ts +0 -39
  38. package/dist/module/client.js +0 -96
  39. package/dist/module/client.js.map +0 -1
  40. package/dist/module/index.d.ts +0 -0
  41. package/dist/module/index.js +0 -2
  42. package/dist/module/index.js.map +0 -1
  43. package/dist/module/page.d.ts +0 -102
  44. package/dist/module/page.js +0 -402
  45. package/dist/module/page.js.map +0 -1
  46. package/dist/module/pageRevision.d.ts +0 -29
  47. package/dist/module/pageRevision.js +0 -114
  48. package/dist/module/pageRevision.js.map +0 -1
  49. package/dist/module/pageSource.d.ts +0 -7
  50. package/dist/module/pageSource.js +0 -11
  51. package/dist/module/pageSource.js.map +0 -1
  52. package/dist/module/pageVote.d.ts +0 -14
  53. package/dist/module/pageVote.js +0 -20
  54. package/dist/module/pageVote.js.map +0 -1
  55. package/dist/module/privateMessage.d.ts +0 -29
  56. package/dist/module/privateMessage.js +0 -132
  57. package/dist/module/privateMessage.js.map +0 -1
  58. package/dist/module/site.d.ts +0 -32
  59. package/dist/module/site.js +0 -117
  60. package/dist/module/site.js.map +0 -1
  61. package/dist/module/siteApplication.d.ts +0 -14
  62. package/dist/module/siteApplication.js +0 -100
  63. package/dist/module/siteApplication.js.map +0 -1
  64. package/dist/module/user.d.ts +0 -56
  65. package/dist/module/user.js +0 -115
  66. package/dist/module/user.js.map +0 -1
  67. package/dist/util/index.d.ts +0 -3
  68. package/dist/util/index.js +0 -10
  69. package/dist/util/index.js.map +0 -1
  70. package/dist/util/parser/index.d.ts +0 -1
  71. package/dist/util/parser/index.js +0 -18
  72. package/dist/util/parser/index.js.map +0 -1
  73. package/dist/util/parser/odate.d.ts +0 -12
  74. package/dist/util/parser/odate.js +0 -25
  75. package/dist/util/parser/odate.js.map +0 -1
  76. package/dist/util/parser/user.d.ts +0 -16
  77. package/dist/util/parser/user.js +0 -36
  78. package/dist/util/parser/user.js.map +0 -1
  79. package/dist/util/quickModule.d.ts +0 -96
  80. package/dist/util/quickModule.js +0 -137
  81. package/dist/util/quickModule.js.map +0 -1
  82. package/dist/util/requestUtil.d.ts +0 -26
  83. package/dist/util/requestUtil.js +0 -69
  84. package/dist/util/requestUtil.js.map +0 -1
  85. package/dist/util/stringUtil.d.ts +0 -21
  86. package/dist/util/stringUtil.js +0 -64
  87. package/dist/util/stringUtil.js.map +0 -1
  88. package/dist/util/table/charTable.d.ts +0 -3
  89. package/dist/util/table/charTable.js +0 -472
  90. package/dist/util/table/charTable.js.map +0 -1
  91. package/dist/util/table/index.d.ts +0 -1
  92. package/dist/util/table/index.js +0 -18
  93. package/dist/util/table/index.js.map +0 -1
package/package.json CHANGED
@@ -1,55 +1,79 @@
1
1
  {
2
2
  "name": "@ukwhatn/wikidot",
3
- "version": "1.0.10",
4
- "description": "Library for requesting data to Wikidot",
5
- "homepage": "https://github.com/ukwhatn/wikidot-ts",
6
- "bugs": {
7
- "url": "https://github.com/ukwhatn/wikidot-ts/issues",
8
- "email": "report@mail.ukwhatn.com"
3
+ "version": "4.0.3",
4
+ "description": "TypeScript library for interacting with Wikidot sites",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
+ }
19
+ },
20
+ "./errors": {
21
+ "import": {
22
+ "types": "./dist/errors.d.ts",
23
+ "default": "./dist/errors.js"
24
+ },
25
+ "require": {
26
+ "types": "./dist/errors.d.cts",
27
+ "default": "./dist/errors.cjs"
28
+ }
29
+ }
9
30
  },
10
- "main": "dist/index.js",
11
- "types": "dist/index.d.ts",
12
- "keywords": [
13
- "wikidot"
31
+ "files": [
32
+ "dist"
14
33
  ],
15
- "author": {
16
- "name": "ukwhatn",
17
- "email": "contact@mail.ukwhatn.com",
18
- "url": "https://github.com/ukwhatn"
34
+ "scripts": {
35
+ "build": "bunup",
36
+ "lint": "biome check .",
37
+ "lint:fix": "biome check --write .",
38
+ "format": "biome format --write .",
39
+ "typecheck": "tsc --noEmit",
40
+ "test": "bun test",
41
+ "test:cov": "bun test --coverage",
42
+ "prepublishOnly": "bun run build"
19
43
  },
44
+ "keywords": [
45
+ "wikidot",
46
+ "scp",
47
+ "api",
48
+ "client"
49
+ ],
50
+ "author": "ukwhatn",
20
51
  "license": "MIT",
21
52
  "repository": {
22
53
  "type": "git",
23
- "url": "https://github.com/ukwhatn/wikidot-ts.git"
54
+ "url": "git+https://github.com/ukwhatn/wikidot-ts.git"
55
+ },
56
+ "bugs": {
57
+ "url": "https://github.com/ukwhatn/wikidot-ts/issues"
58
+ },
59
+ "homepage": "https://github.com/ukwhatn/wikidot-ts#readme",
60
+ "engines": {
61
+ "node": ">=18"
24
62
  },
25
63
  "dependencies": {
26
- "async-mutex": "^0.5.0",
27
- "axios": "^1.6.8",
28
- "cheerio": "^1.0.0-rc.12",
29
- "winston": "^3.13.0"
64
+ "cheerio": "^1.0.0",
65
+ "ky": "^1.7.0",
66
+ "neverthrow": "^8.2.0",
67
+ "p-limit": "^7.2.0",
68
+ "zod": "^4.2.1"
30
69
  },
31
70
  "devDependencies": {
32
- "@typescript-eslint/eslint-plugin": "^7.7.0",
33
- "@typescript-eslint/parser": "^7.7.0",
34
- "eslint": "^8.57.0",
35
- "eslint-config-prettier": "^9.1.0",
36
- "husky": "^8.0.0",
37
- "lint-staged": "^15.2.2",
38
- "prettier": "^3.2.5",
39
- "ts-node": "^10.9.2",
40
- "typescript": "^5.4.5"
71
+ "@biomejs/biome": "^2.3.10",
72
+ "@types/bun": "^1.1.0",
73
+ "bunup": "^0.16.11",
74
+ "typescript": "^5.5.0"
41
75
  },
42
- "scripts": {
43
- "test": "echo \"Error: no test specified\" && exit 0",
44
- "build": "rm -rf dist && tsc",
45
- "prepublishOnly": "npm run lint && npm rum fix && npm run build",
46
- "postpublish": "make post-release version=$npm_package_version",
47
- "lint": "make lint",
48
- "fix": "make prettier"
49
- },
50
- "husky": {
51
- "hooks": {
52
- "pre-commit": "lint-staged"
53
- }
76
+ "peerDependencies": {
77
+ "typescript": "^5"
54
78
  }
55
79
  }
package/.eslintrc.js DELETED
@@ -1,23 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es6: true
5
- },
6
- extends: [
7
- "eslint:recommended",
8
- "plugin:@typescript-eslint/recommended",
9
- "prettier"
10
- ],
11
- plugins: [
12
- "@typescript-eslint"
13
- ],
14
- parser: "@typescript-eslint/parser",
15
- parserOptions: {
16
- "sourceType": "module",
17
- project: "./tsconfig.json"
18
- },
19
- root: true,
20
- rules: {
21
- '@typescript-eslint/no-explicit-any': 'off',
22
- }
23
- }
@@ -1,12 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: "npm"
4
- directory: "/"
5
- schedule:
6
- interval: "daily"
7
- target-branch: "develop"
8
- commit-message:
9
- prefix: "chore(deps)"
10
- labels:
11
- - "dependencies"
12
- - "automated pr"
package/.prettierrc DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "printWidth": 120,
3
- "singleQuote": true,
4
- "semi": false,
5
- "tabWidth": 4
6
- }
package/Makefile DELETED
@@ -1,24 +0,0 @@
1
- init:
2
- npm install --dev
3
- npx husky-init
4
- npx husky add .husky/pre-commit "npm run lint && npm run fix"
5
-
6
- release_from-develop:
7
- gh pr create --base main --head develop --title "Release v$(version)" --body "Released: v$(version)"
8
- gh pr merge --auto
9
- gh release create $(version) --target main --latest --generate-notes --title "$(version)"
10
-
11
- post-release:
12
- rm -rf dist
13
- git add .
14
- git commit -m 'release: $(version)'
15
- git push origin develop
16
- make release_from-develop version=$(version)
17
-
18
- lint:
19
- npx eslint --fix 'src/**/*.{js,ts}'
20
-
21
- prettier:
22
- npx prettier --write 'src/**/*.{js,ts}'
23
-
24
- PHONY: release_from-develop post-release lint prettier
@@ -1,95 +0,0 @@
1
- /**
2
- * 独自例外の基底クラス
3
- *
4
- * @param message - エラーメッセージ
5
- */
6
- declare class WikidotException extends Error {
7
- constructor(message: string);
8
- }
9
- /**
10
- * 予期せぬ例外が発生したときの例外
11
- *
12
- * @param message - エラーメッセージ
13
- */
14
- declare class UnexpectedException extends WikidotException {
15
- constructor(message: string);
16
- }
17
- /**
18
- * セッションの作成に失敗したときの例外
19
- *
20
- * @param message - エラーメッセージ
21
- */
22
- declare class SessionCreateException extends WikidotException {
23
- constructor(message: string);
24
- }
25
- /**
26
- * ログインが必要なメソッドをときの例外
27
- *
28
- * @param message - エラーメッセージ
29
- */
30
- declare class LoginRequiredException extends WikidotException {
31
- constructor(message: string);
32
- }
33
- /**
34
- * ajax-module-connector.phpへのリクエストに失敗したときの例外
35
- *
36
- * @param message - エラーメッセージ
37
- */
38
- declare class AjaxModuleConnectorException extends WikidotException {
39
- constructor(message: string);
40
- }
41
- /**
42
- * AMCから返却されたHTTPステータスが200以外だったときの例外
43
- *
44
- * @param message - エラーメッセージ
45
- * @param statusCode - HTTPステータスコード
46
- */
47
- declare class AMCHttpStatusCodeException extends AjaxModuleConnectorException {
48
- readonly statusCode: number;
49
- constructor(message: string, statusCode: number);
50
- }
51
- /**
52
- * AMCから返却されたデータ内のステータスがokではなかったときの例外
53
- *
54
- * HTTPステータスが200以外の場合はAMCHttpStatusCodeExceptionを投げる
55
- *
56
- * @param message - エラーメッセージ
57
- * @param statusCode - WikidotステータスコードAMCから返却されたデータ内のステータスがokではなかったときの例外
58
- */
59
- declare class WikidotStatusCodeException extends AjaxModuleConnectorException {
60
- readonly statusCode: string;
61
- constructor(message: string, statusCode: string);
62
- }
63
- /**
64
- * AMCから返却されたデータが不正だったときの例外
65
- *
66
- * @param message - エラーメッセージ
67
- */
68
- declare class ResponseDataException extends AjaxModuleConnectorException {
69
- constructor(message: string);
70
- }
71
- /**
72
- * サイトやページ・ユーザが見つからなかったときの例外
73
- *
74
- * @param message - エラーメッセージ
75
- */
76
- declare class NotFoundException extends WikidotException {
77
- constructor(message: string);
78
- }
79
- /**
80
- * メソッドの対象としたオブジェクトに操作が適用できないときの例外
81
- *
82
- * @param message - エラーメッセージ
83
- */
84
- declare class TargetErrorException extends WikidotException {
85
- constructor(message: string);
86
- }
87
- /**
88
- * 権限がないときの例外
89
- *
90
- * @param message - エラーメッセージ
91
- */
92
- declare class ForbiddenException extends WikidotException {
93
- constructor(message: string);
94
- }
95
- export { WikidotException, UnexpectedException, SessionCreateException, LoginRequiredException, AjaxModuleConnectorException, AMCHttpStatusCodeException, WikidotStatusCodeException, ResponseDataException, NotFoundException, TargetErrorException, ForbiddenException, };
@@ -1,146 +0,0 @@
1
- "use strict";
2
- // ---
3
- // 基底クラス
4
- // ---
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ForbiddenException = exports.TargetErrorException = exports.NotFoundException = exports.ResponseDataException = exports.WikidotStatusCodeException = exports.AMCHttpStatusCodeException = exports.AjaxModuleConnectorException = exports.LoginRequiredException = exports.SessionCreateException = exports.UnexpectedException = exports.WikidotException = void 0;
7
- /**
8
- * 独自例外の基底クラス
9
- *
10
- * @param message - エラーメッセージ
11
- */
12
- class WikidotException extends Error {
13
- constructor(message) {
14
- super(message);
15
- }
16
- }
17
- exports.WikidotException = WikidotException;
18
- // ---
19
- // ワイルドカード
20
- // ---
21
- /**
22
- * 予期せぬ例外が発生したときの例外
23
- *
24
- * @param message - エラーメッセージ
25
- */
26
- class UnexpectedException extends WikidotException {
27
- constructor(message) {
28
- super(message);
29
- }
30
- }
31
- exports.UnexpectedException = UnexpectedException;
32
- // ---
33
- // セッション関連
34
- // ---
35
- /**
36
- * セッションの作成に失敗したときの例外
37
- *
38
- * @param message - エラーメッセージ
39
- */
40
- class SessionCreateException extends WikidotException {
41
- constructor(message) {
42
- super(message);
43
- }
44
- }
45
- exports.SessionCreateException = SessionCreateException;
46
- /**
47
- * ログインが必要なメソッドをときの例外
48
- *
49
- * @param message - エラーメッセージ
50
- */
51
- class LoginRequiredException extends WikidotException {
52
- constructor(message) {
53
- super(message);
54
- }
55
- }
56
- exports.LoginRequiredException = LoginRequiredException;
57
- // ---
58
- // AMC関連
59
- // ---
60
- /**
61
- * ajax-module-connector.phpへのリクエストに失敗したときの例外
62
- *
63
- * @param message - エラーメッセージ
64
- */
65
- class AjaxModuleConnectorException extends WikidotException {
66
- constructor(message) {
67
- super(message);
68
- }
69
- }
70
- exports.AjaxModuleConnectorException = AjaxModuleConnectorException;
71
- /**
72
- * AMCから返却されたHTTPステータスが200以外だったときの例外
73
- *
74
- * @param message - エラーメッセージ
75
- * @param statusCode - HTTPステータスコード
76
- */
77
- class AMCHttpStatusCodeException extends AjaxModuleConnectorException {
78
- constructor(message, statusCode) {
79
- super(message);
80
- this.statusCode = statusCode;
81
- }
82
- }
83
- exports.AMCHttpStatusCodeException = AMCHttpStatusCodeException;
84
- /**
85
- * AMCから返却されたデータ内のステータスがokではなかったときの例外
86
- *
87
- * HTTPステータスが200以外の場合はAMCHttpStatusCodeExceptionを投げる
88
- *
89
- * @param message - エラーメッセージ
90
- * @param statusCode - WikidotステータスコードAMCから返却されたデータ内のステータスがokではなかったときの例外
91
- */
92
- class WikidotStatusCodeException extends AjaxModuleConnectorException {
93
- constructor(message, statusCode) {
94
- super(message);
95
- this.statusCode = statusCode;
96
- }
97
- }
98
- exports.WikidotStatusCodeException = WikidotStatusCodeException;
99
- /**
100
- * AMCから返却されたデータが不正だったときの例外
101
- *
102
- * @param message - エラーメッセージ
103
- */
104
- class ResponseDataException extends AjaxModuleConnectorException {
105
- constructor(message) {
106
- super(message);
107
- }
108
- }
109
- exports.ResponseDataException = ResponseDataException;
110
- // ---
111
- // ターゲットエラー関連
112
- // ---
113
- /**
114
- * サイトやページ・ユーザが見つからなかったときの例外
115
- *
116
- * @param message - エラーメッセージ
117
- */
118
- class NotFoundException extends WikidotException {
119
- constructor(message) {
120
- super(message);
121
- }
122
- }
123
- exports.NotFoundException = NotFoundException;
124
- /**
125
- * メソッドの対象としたオブジェクトに操作が適用できないときの例外
126
- *
127
- * @param message - エラーメッセージ
128
- */
129
- class TargetErrorException extends WikidotException {
130
- constructor(message) {
131
- super(message);
132
- }
133
- }
134
- exports.TargetErrorException = TargetErrorException;
135
- /**
136
- * 権限がないときの例外
137
- *
138
- * @param message - エラーメッセージ
139
- */
140
- class ForbiddenException extends WikidotException {
141
- constructor(message) {
142
- super(message);
143
- }
144
- }
145
- exports.ForbiddenException = ForbiddenException;
146
- //# sourceMappingURL=exceptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../src/common/exceptions.ts"],"names":[],"mappings":";AAAA,MAAM;AACN,QAAQ;AACR,MAAM;;;AAEN;;;;GAIG;AACH,MAAM,gBAAiB,SAAQ,KAAK;IAChC,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAA;IAClB,CAAC;CACJ;AA2IG,4CAAgB;AAzIpB,MAAM;AACN,UAAU;AACV,MAAM;AAEN;;;;GAIG;AACH,MAAM,mBAAoB,SAAQ,gBAAgB;IAC9C,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAA;IAClB,CAAC;CACJ;AA6HG,kDAAmB;AA3HvB,MAAM;AACN,UAAU;AACV,MAAM;AAEN;;;;GAIG;AACH,MAAM,sBAAuB,SAAQ,gBAAgB;IACjD,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAA;IAClB,CAAC;CACJ;AA+GG,wDAAsB;AA7G1B;;;;GAIG;AACH,MAAM,sBAAuB,SAAQ,gBAAgB;IACjD,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAA;IAClB,CAAC;CACJ;AAqGG,wDAAsB;AAnG1B,MAAM;AACN,QAAQ;AACR,MAAM;AAEN;;;;GAIG;AACH,MAAM,4BAA6B,SAAQ,gBAAgB;IACvD,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAA;IAClB,CAAC;CACJ;AAuFG,oEAA4B;AArFhC;;;;;GAKG;AACH,MAAM,0BAA2B,SAAQ,4BAA4B;IACjE,YACI,OAAe,EACC,UAAkB;QAElC,KAAK,CAAC,OAAO,CAAC,CAAA;QAFE,eAAU,GAAV,UAAU,CAAQ;IAGtC,CAAC;CACJ;AAyEG,gEAA0B;AAvE9B;;;;;;;GAOG;AACH,MAAM,0BAA2B,SAAQ,4BAA4B;IACjE,YACI,OAAe,EACC,UAAkB;QAElC,KAAK,CAAC,OAAO,CAAC,CAAA;QAFE,eAAU,GAAV,UAAU,CAAQ;IAGtC,CAAC;CACJ;AAyDG,gEAA0B;AAvD9B;;;;GAIG;AACH,MAAM,qBAAsB,SAAQ,4BAA4B;IAC5D,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAA;IAClB,CAAC;CACJ;AA+CG,sDAAqB;AA7CzB,MAAM;AACN,aAAa;AACb,MAAM;AAEN;;;;GAIG;AACH,MAAM,iBAAkB,SAAQ,gBAAgB;IAC5C,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAA;IAClB,CAAC;CACJ;AAiCG,8CAAiB;AA/BrB;;;;GAIG;AACH,MAAM,oBAAqB,SAAQ,gBAAgB;IAC/C,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAA;IAClB,CAAC;CACJ;AAuBG,oDAAoB;AArBxB;;;;GAIG;AACH,MAAM,kBAAmB,SAAQ,gBAAgB;IAC7C,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAA;IAClB,CAAC;CACJ;AAaG,gDAAkB"}
@@ -1 +0,0 @@
1
- export { logger } from './logger';
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.logger = void 0;
4
- var logger_1 = require("./logger");
5
- Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return logger_1.logger; } });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;AAAA,mCAAiC;AAAxB,gGAAA,MAAM,OAAA"}
@@ -1,2 +0,0 @@
1
- import winston from 'winston';
2
- export declare const logger: winston.Logger;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.logger = void 0;
7
- const winston_1 = __importDefault(require("winston"));
8
- // Logger設定
9
- function setupLogger(name = 'wikidot', level = 'debug') {
10
- return winston_1.default.createLogger({
11
- level,
12
- format: winston_1.default.format.combine(winston_1.default.format.timestamp(), winston_1.default.format.printf(({ timestamp, level, message }) => {
13
- return `${timestamp} [${name}/${level}] ${message}`;
14
- })),
15
- transports: [new winston_1.default.transports.Console()],
16
- });
17
- }
18
- exports.logger = setupLogger();
19
- //# sourceMappingURL=logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/common/logger.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA6B;AAE7B,WAAW;AACX,SAAS,WAAW,CAAC,OAAe,SAAS,EAAE,QAAgB,OAAO;IAClE,OAAO,iBAAO,CAAC,YAAY,CAAC;QACxB,KAAK;QACL,MAAM,EAAE,iBAAO,CAAC,MAAM,CAAC,OAAO,CAC1B,iBAAO,CAAC,MAAM,CAAC,SAAS,EAAE,EAC1B,iBAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;YACpD,OAAO,GAAG,SAAS,KAAK,IAAI,IAAI,KAAK,KAAK,OAAO,EAAE,CAAA;QACvD,CAAC,CAAC,CACL;QACD,UAAU,EAAE,CAAC,IAAI,iBAAO,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;KACjD,CAAC,CAAA;AACN,CAAC;AAEY,QAAA,MAAM,GAAG,WAAW,EAAE,CAAA"}
@@ -1,142 +0,0 @@
1
- import { AxiosResponse } from 'axios';
2
- declare module 'axios' {
3
- interface AxiosRequestConfig {
4
- retryLimit?: number;
5
- retryCount?: number;
6
- }
7
- }
8
- /**
9
- * @class AjaxRequestHeader
10
- * @description ajax-module-connector.phpへのリクエスト時に利用するヘッダの構築用クラス
11
- * @property contentType Content-Type
12
- * @property userAgent User-Agent
13
- * @property referer Referer
14
- * @property cookie Cookie
15
- * @version 1.0.0
16
- * @since 1.0.0
17
- * @public
18
- * @exports
19
- */
20
- declare class AjaxRequestHeader {
21
- private readonly contentType;
22
- private readonly userAgent;
23
- private readonly referer;
24
- private readonly cookie;
25
- /**
26
- * @constructor
27
- * @param contentType Content-Type
28
- * @param userAgent User-Agent
29
- * @param referer Referer
30
- * @param cookie Cookie
31
- */
32
- constructor(contentType?: string | null, userAgent?: string | null, referer?: string | null, cookie?: {
33
- [key: string]: any;
34
- } | null);
35
- /**
36
- * @method setCookie
37
- * @description Cookieを設定する
38
- * @param name Cookie名
39
- * @param value Cookie値
40
- * @version 1.0.0
41
- * @since 1.0.0
42
- * @public
43
- */
44
- setCookie(name: string, value: any): void;
45
- /**
46
- * @method deleteCookie
47
- * @description Cookieを削除する
48
- * @param name Cookie名
49
- * @version 1.0.0
50
- * @since 1.0.0
51
- * @public
52
- */
53
- deleteCookie(name: string): void;
54
- /**
55
- * @method getHeader
56
- * @description ヘッダを構築して返す
57
- * @returns ヘッダ
58
- * @version 1.0.0
59
- * @since 1.0.0
60
- * @public
61
- */
62
- getHeader(): {
63
- [key: string]: any;
64
- };
65
- }
66
- /**
67
- * @interface AjaxModuleConnectorConfig
68
- * @description ajax-module-connector.phpの設定
69
- * @property requestTimeout - リクエストのタイムアウト時間
70
- * @property attemptLimit - リトライ回数
71
- * @property retryInterval - リトライ間隔
72
- * @property semaphoreLimit - セマフォの上限
73
- * @version 1.0.0
74
- * @since 1.0.0
75
- * @public
76
- * @exports
77
- */
78
- interface AjaxModuleConnectorConfig {
79
- requestTimeout: number;
80
- attemptLimit: number;
81
- retryInterval: number;
82
- semaphoreLimit: number;
83
- }
84
- /**
85
- * @class AjaxModuleConnectorClient
86
- * @description ajax-module-connector.phpへのリクエストを行うクライアント
87
- * @property siteName サイト名
88
- * @property config 設定
89
- * @property sslSupported SSL対応しているか
90
- * @property header ヘッダ
91
- * @property semaphore セマフォ
92
- * @version 1.0.0
93
- * @since 1.0.0
94
- * @public
95
- * @exports
96
- */
97
- declare class AjaxModuleConnectorClient {
98
- private readonly siteName;
99
- config: AjaxModuleConnectorConfig;
100
- private sslSupported;
101
- header: AjaxRequestHeader;
102
- private isInitialized;
103
- private semaphore;
104
- /**
105
- * @constructor
106
- * @description クライアントを初期化する
107
- * @param siteName サイト名
108
- * @param config 設定
109
- * @version 1.0.0
110
- * @since 1.0.0
111
- * @public
112
- */
113
- constructor(siteName?: string | null, config?: Partial<AjaxModuleConnectorConfig> | null);
114
- /**
115
- * @method checkExistenceAndSSL
116
- * @description サイトの存在確認とSSL対応確認を行う
117
- * @returns サイトが存在し、かつSSL対応しているか
118
- * @version 1.0.0
119
- * @since 1.0.0
120
- * @private
121
- * @async
122
- * @throws {NotFoundException} サイトが見つからない場合
123
- * @throws {Error} その他のエラー
124
- * @exports
125
- */
126
- private checkExistenceAndSSL;
127
- /**
128
- * @method request
129
- * @description リクエストを送信する
130
- * @param bodies リクエストボディ
131
- * @param returnExceptions 例外を返すか
132
- * @param siteName サイト名
133
- * @param siteSSLSupported SSL対応しているか
134
- * @returns レスポンス
135
- * @version 1.0.0
136
- * @since 1.0.0
137
- * @public
138
- * @async
139
- */
140
- request: (bodies: Record<string, any>[], returnExceptions?: boolean, siteName?: string, siteSSLSupported?: boolean) => Promise<(Error | AxiosResponse)[]>;
141
- }
142
- export { AjaxModuleConnectorClient, AjaxModuleConnectorConfig, AjaxRequestHeader };