@kash-88/alerts 1.2.1 → 1.3.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.
Files changed (110) hide show
  1. package/LICENSE +21 -0
  2. package/dist/src/Function/createCustomAlerts.d.ts +16 -0
  3. package/dist/src/Function/createCustomAlerts.js +51 -0
  4. package/dist/src/Function/createMerchandise.d.ts +22 -0
  5. package/dist/src/Function/createMerchandise.js +82 -0
  6. package/dist/src/Function/generateSignature.d.ts +13 -0
  7. package/dist/src/Function/generateSignature.js +18 -0
  8. package/dist/src/Function/getAuthorizeLink.d.ts +13 -0
  9. package/dist/src/Function/getAuthorizeLink.js +27 -0
  10. package/dist/src/Function/getDonationsAlerts.d.ts +11 -0
  11. package/dist/src/Function/getDonationsAlerts.js +30 -0
  12. package/dist/src/Function/getExternal.d.ts +6 -0
  13. package/dist/src/Function/getExternal.js +27 -0
  14. package/dist/src/Function/getOauthToken.d.ts +13 -0
  15. package/dist/src/Function/getOauthToken.js +44 -0
  16. package/dist/src/Function/getPrivateToken.d.ts +10 -0
  17. package/dist/src/Function/getPrivateToken.js +40 -0
  18. package/dist/src/Function/getUser.d.ts +10 -0
  19. package/dist/src/Function/getUser.js +26 -0
  20. package/dist/src/Function/getUserChannel.d.ts +8 -0
  21. package/dist/src/Function/getUserChannel.js +13 -0
  22. package/dist/src/Function/getUserDataFromPromocode.d.ts +11 -0
  23. package/dist/src/Function/getUserDataFromPromocode.js +39 -0
  24. package/dist/src/Function/sendSaleAlert.d.ts +20 -0
  25. package/dist/src/Function/sendSaleAlert.js +81 -0
  26. package/dist/src/Function/updateMerchandise.d.ts +21 -0
  27. package/dist/src/Function/updateMerchandise.js +76 -0
  28. package/dist/src/Function/updateOauthToken.d.ts +13 -0
  29. package/dist/src/Function/updateOauthToken.js +44 -0
  30. package/dist/src/Function/updateOrCreateMerchandise.d.ts +22 -0
  31. package/dist/src/Function/updateOrCreateMerchandise.js +80 -0
  32. package/dist/src/Types/CustomAlerts.d.ts +12 -0
  33. package/dist/src/Types/DonationsAlerts.d.ts +31 -0
  34. package/dist/src/Types/DonationsAlerts.js +1 -0
  35. package/dist/src/Types/Merchandise.d.ts +18 -0
  36. package/dist/src/Types/Merchandise.js +1 -0
  37. package/dist/src/Types/MerchandiseSale.d.ts +14 -0
  38. package/dist/src/Types/MerchandiseSale.js +1 -0
  39. package/dist/src/Types/OAuthScope.d.ts +9 -0
  40. package/dist/src/Types/OAuthScope.js +10 -0
  41. package/dist/src/Types/OAuthToken.d.ts +7 -0
  42. package/dist/src/Types/OAuthToken.js +1 -0
  43. package/dist/src/Types/User.d.ts +9 -0
  44. package/dist/src/Types/User.js +1 -0
  45. package/dist/src/Types/index.d.ts +8 -0
  46. package/dist/src/Types/index.js +2 -0
  47. package/dist/src/WebSocket/CentrifugeClient.d.ts +71 -0
  48. package/dist/src/WebSocket/CentrifugeClient.js +216 -0
  49. package/dist/src/index.d.ts +18 -9
  50. package/dist/src/index.js +18 -9
  51. package/dist/src/utils.d.ts +5 -13
  52. package/dist/src/utils.js +16 -32
  53. package/package.json +22 -18
  54. package/readme.md +502 -81
  55. package/src/Function/createCustomAlerts.ts +65 -0
  56. package/src/Function/createMerchandise.ts +105 -0
  57. package/src/Function/generateSignature.ts +23 -0
  58. package/src/Function/getAuthorizeLink.ts +37 -0
  59. package/src/Function/getDonationsAlerts.ts +37 -0
  60. package/src/Function/getExternal.ts +31 -0
  61. package/src/Function/getOauthToken.ts +54 -0
  62. package/src/Function/getPrivateToken.ts +50 -0
  63. package/src/Function/getUser.ts +32 -0
  64. package/src/Function/getUserChannel.ts +17 -0
  65. package/src/Function/getUserDataFromPromocode.ts +51 -0
  66. package/src/Function/sendSaleAlert.ts +103 -0
  67. package/src/Function/updateMerchandise.ts +98 -0
  68. package/src/Function/updateOauthToken.ts +54 -0
  69. package/src/Function/updateOrCreateMerchandise.ts +103 -0
  70. package/src/Types/CustomAlerts.ts +13 -0
  71. package/src/Types/DonationsAlerts.ts +32 -0
  72. package/src/Types/Merchandise.ts +19 -0
  73. package/src/Types/MerchandiseSale.ts +15 -0
  74. package/src/Types/OAuthScope.ts +10 -0
  75. package/src/Types/OAuthToken.ts +8 -0
  76. package/src/Types/User.ts +10 -0
  77. package/src/Types/index.ts +17 -0
  78. package/src/WebSocket/CentrifugeClient.ts +271 -0
  79. package/src/index.ts +25 -6
  80. package/src/utils.ts +22 -44
  81. package/dist/src/func/getAuthorizeLink.d.ts +0 -18
  82. package/dist/src/func/getAuthorizeLink.js +0 -29
  83. package/dist/src/func/getOauthToken.d.ts +0 -27
  84. package/dist/src/func/getOauthToken.js +0 -42
  85. package/dist/src/func/getPrivateToken.d.ts +0 -29
  86. package/dist/src/func/getPrivateToken.js +0 -46
  87. package/dist/src/func/getUser.d.ts +0 -23
  88. package/dist/src/func/getUser.js +0 -38
  89. package/dist/src/func/getUserChannel.d.ts +0 -19
  90. package/dist/src/func/getUserChannel.js +0 -32
  91. package/dist/src/func/updateAccessToken.d.ts +0 -24
  92. package/dist/src/func/updateAccessToken.js +0 -39
  93. package/dist/src/types.d.ts +0 -33
  94. package/dist/src/ws/CentrifugeClient.d.ts +0 -31
  95. package/dist/src/ws/CentrifugeClient.js +0 -71
  96. package/src/example/getAuthorizeLink.ts +0 -11
  97. package/src/example/getOauthToken.ts +0 -16
  98. package/src/example/getUser.ts +0 -12
  99. package/src/example/getUserChannel.ts +0 -10
  100. package/src/example/updateAccessToken.ts +0 -17
  101. package/src/example/wsExample.ts +0 -50
  102. package/src/func/getAuthorizeLink.ts +0 -33
  103. package/src/func/getOauthToken.ts +0 -46
  104. package/src/func/getPrivateToken.ts +0 -53
  105. package/src/func/getUser.ts +0 -42
  106. package/src/func/getUserChannel.ts +0 -34
  107. package/src/func/updateAccessToken.ts +0 -43
  108. package/src/types.ts +0 -38
  109. package/src/ws/CentrifugeClient.ts +0 -108
  110. /package/dist/src/{types.js → Types/CustomAlerts.js} +0 -0
@@ -0,0 +1,216 @@
1
+ import getPrivateToken from "../Function/getPrivateToken.js";
2
+ import getUser from "../Function/getUser.js";
3
+ import getUserChannel from "../Function/getUserChannel.js";
4
+ import { formatAxiosError } from "../utils.js";
5
+ import { WebSocket } from "ws";
6
+ import { EventEmitter } from "events";
7
+ /**
8
+ * Class for interacting with Centrifuge donationalerts
9
+ *
10
+ * @param {WSClientOptions} options - Connection options
11
+ * @param {string} options.access_token - User access token
12
+ * @param {string[]} [options.channels] - Custom channels to subscribe to (defaults to donation channel)
13
+ * @param {boolean} [options.autoReconnect=false] - Automatically reconnect on connection close
14
+ */
15
+ export default class CentrifugeClient extends EventEmitter {
16
+ constructor(options) {
17
+ super();
18
+ this.access_token = options.access_token;
19
+ this.channels = options.channels ?? [];
20
+ this.autoReconnect = options.autoReconnect ?? false;
21
+ this.isAuthorized = false;
22
+ this.reconnectTimer = null;
23
+ this.isReconnecting = false;
24
+ this.authMessageHandler = null;
25
+ this.WebSocket = null;
26
+ this.user = null;
27
+ this.userPromise = this.getUser(this.access_token).catch((error) => {
28
+ this.emit("error", error);
29
+ throw error;
30
+ });
31
+ this.createNewConnection();
32
+ this.setupEvent();
33
+ }
34
+ /**
35
+ * Obtain user data
36
+ *
37
+ * @param {string} access_token - User access token
38
+ * @returns {Promise<User>} User data
39
+ */
40
+ async getUser(access_token) {
41
+ try {
42
+ this.user = await getUser(access_token);
43
+ return this.user;
44
+ }
45
+ catch (error) {
46
+ throw new Error(formatAxiosError(error));
47
+ }
48
+ }
49
+ /**
50
+ * Get channels to subscribe to
51
+ *
52
+ * @returns {Promise<string[]>} Array of channel identifiers
53
+ */
54
+ async getChannels() {
55
+ if (!this.user?.id)
56
+ this.user = await (this.userPromise ?? this.getUser(this.access_token));
57
+ if (!this.user?.id)
58
+ throw new Error("Failed to get channels due to missing user ID");
59
+ if (this.channels.length > 0)
60
+ return this.channels;
61
+ return [getUserChannel(this.user.id)];
62
+ }
63
+ /**
64
+ * Create a new WebSocket connection
65
+ */
66
+ createNewConnection() {
67
+ try {
68
+ if (this.WebSocket)
69
+ return;
70
+ this.WebSocket = new WebSocket("wss://centrifugo.donationalerts.com/connection/websocket");
71
+ }
72
+ catch (error) {
73
+ throw new Error(error?.message || error);
74
+ }
75
+ }
76
+ /**
77
+ * Forward events through a TypedEmitter
78
+ */
79
+ setupEvent() {
80
+ if (!this.WebSocket) {
81
+ this.createNewConnection();
82
+ if (!this.WebSocket)
83
+ throw new Error("WebSocket connection failed");
84
+ }
85
+ const ws = this.WebSocket;
86
+ ws.on('open', () => {
87
+ this.emit("open");
88
+ });
89
+ ws.on('close', (code, reason) => {
90
+ this.isAuthorized = false;
91
+ this.emit("close", code, reason);
92
+ if (this.autoReconnect) {
93
+ this.WebSocket = null;
94
+ if (this.reconnectTimer)
95
+ clearTimeout(this.reconnectTimer);
96
+ this.isReconnecting = true;
97
+ this.reconnectTimer = setTimeout(() => {
98
+ this.isReconnecting = false;
99
+ this.createNewConnection();
100
+ this.setupEvent();
101
+ this.emit("reconnect");
102
+ }, 5000);
103
+ }
104
+ });
105
+ ws.on('message', (rawMessage) => {
106
+ try {
107
+ const message = JSON.parse(rawMessage.toString());
108
+ this.emit("message", message);
109
+ }
110
+ catch (error) {
111
+ this.emit("error", new Error(`Failed to parse WebSocket message: ${error?.message || error}`));
112
+ }
113
+ });
114
+ ws.on('error', (error) => {
115
+ this.emit("error", error);
116
+ });
117
+ }
118
+ /**
119
+ * Authorize WebSocket and subscribe to selected channels
120
+ */
121
+ async authorization() {
122
+ if (this.isReconnecting) {
123
+ throw new Error("Reconnection is in progress, please wait for the 'reconnect' event");
124
+ }
125
+ if (!this.WebSocket)
126
+ this.createNewConnection();
127
+ if (!this.WebSocket)
128
+ throw new Error("WebSocket connection failed");
129
+ if (this.WebSocket.readyState !== WebSocket.OPEN) {
130
+ throw new Error("WebSocket connection is not open. Call authorization() after the 'open' event");
131
+ }
132
+ if (!this.user)
133
+ this.user = await (this.userPromise ?? this.getUser(this.access_token));
134
+ if (!this.user?.socket_connection_token)
135
+ throw new Error("Failed to log in due to receiving socket connection token");
136
+ if (this.authMessageHandler) {
137
+ this.WebSocket?.removeListener('message', this.authMessageHandler);
138
+ }
139
+ const handleAuthResponse = async (rawMessage) => {
140
+ try {
141
+ const json = JSON.parse(rawMessage.toString());
142
+ if (json.id === 1) {
143
+ this.authMessageHandler = null;
144
+ this.WebSocket?.removeListener('message', handleAuthResponse);
145
+ if (!json.result?.client) {
146
+ this.emit("error", new Error("Authorization failed: missing client ID in response"));
147
+ return;
148
+ }
149
+ const channels = await this.getChannels();
150
+ for (let i = 0; i < channels.length; i++) {
151
+ const channel = channels[i];
152
+ const privateToken = await getPrivateToken(channel, json.result.client, this.access_token);
153
+ this.sendMessage(JSON.stringify({
154
+ id: 2 + i,
155
+ method: 1,
156
+ params: {
157
+ channel,
158
+ token: privateToken
159
+ }
160
+ }));
161
+ }
162
+ this.isAuthorized = true;
163
+ }
164
+ }
165
+ catch (error) {
166
+ this.authMessageHandler = null;
167
+ this.WebSocket?.removeListener('message', handleAuthResponse);
168
+ this.emit("error", new Error(`Authorization failed: ${error?.message || error}`));
169
+ }
170
+ };
171
+ this.authMessageHandler = handleAuthResponse;
172
+ this.WebSocket.on('message', handleAuthResponse);
173
+ this.sendMessage(JSON.stringify({
174
+ params: {
175
+ token: this.user.socket_connection_token
176
+ },
177
+ id: 1
178
+ }));
179
+ }
180
+ /**
181
+ * Send a message through the WebSocket connection
182
+ *
183
+ * @param {string} message - JSON-encoded message to send
184
+ */
185
+ sendMessage(message) {
186
+ try {
187
+ if (!this.WebSocket)
188
+ return;
189
+ if (this.WebSocket.readyState !== WebSocket.OPEN)
190
+ return;
191
+ this.WebSocket.send(message);
192
+ }
193
+ catch (error) {
194
+ throw new Error(error?.message || error);
195
+ }
196
+ }
197
+ /**
198
+ * Close the WebSocket connection and stop auto-reconnect
199
+ */
200
+ close() {
201
+ this.autoReconnect = false;
202
+ if (this.reconnectTimer) {
203
+ clearTimeout(this.reconnectTimer);
204
+ this.reconnectTimer = null;
205
+ }
206
+ if (this.WebSocket) {
207
+ if (this.authMessageHandler) {
208
+ this.WebSocket.removeListener('message', this.authMessageHandler);
209
+ this.authMessageHandler = null;
210
+ }
211
+ this.WebSocket.close();
212
+ this.WebSocket = null;
213
+ }
214
+ this.isAuthorized = false;
215
+ }
216
+ }
@@ -1,9 +1,18 @@
1
- import getAuthorizeLink from "./func/getAuthorizeLink.js";
2
- import getOauthToken from "./func/getOauthToken.js";
3
- import getUser from "./func/getUser.js";
4
- import updateAccessToken from "./func/updateAccessToken.js";
5
- import getUserChannel from "./func/getUserChannel.js";
6
- import { getPrivateToken } from "./func/getPrivateToken.js";
7
- import CentrifugeClient from "./ws/CentrifugeClient.js";
8
- export * from "./types.js";
9
- export { getAuthorizeLink, getOauthToken, getUser, updateAccessToken, getUserChannel, getPrivateToken, CentrifugeClient };
1
+ import getAuthorizeLink from "./Function/getAuthorizeLink.js";
2
+ import getOauthToken from "./Function/getOauthToken.js";
3
+ import getUser from "./Function/getUser.js";
4
+ import updateOauthToken from "./Function/updateOauthToken.js";
5
+ import getUserChannel from "./Function/getUserChannel.js";
6
+ import getPrivateToken from "./Function/getPrivateToken.js";
7
+ import getDonationsAlerts from "./Function/getDonationsAlerts.js";
8
+ import getExternal from "./Function/getExternal.js";
9
+ import createCustomAlerts from "./Function/createCustomAlerts.js";
10
+ import generateSignature from "./Function/generateSignature.js";
11
+ import createMerchandise from "./Function/createMerchandise.js";
12
+ import updateMerchandise from "./Function/updateMerchandise.js";
13
+ import updateOrCreateMerchandise from "./Function/updateOrCreateMerchandise.js";
14
+ import getUserDataFromPromocode from "./Function/getUserDataFromPromocode.js";
15
+ import sendSaleAlert from "./Function/sendSaleAlert.js";
16
+ import WebServer from "./WebSocket/CentrifugeClient.js";
17
+ import { OAuthScope } from "./Types/index.js";
18
+ export { getAuthorizeLink, getOauthToken, getUser, updateOauthToken, getUserChannel, getExternal, getPrivateToken, getDonationsAlerts, createCustomAlerts, generateSignature, createMerchandise, updateMerchandise, updateOrCreateMerchandise, getUserDataFromPromocode, sendSaleAlert, WebServer, OAuthScope };
package/dist/src/index.js CHANGED
@@ -1,9 +1,18 @@
1
- import getAuthorizeLink from "./func/getAuthorizeLink.js";
2
- import getOauthToken from "./func/getOauthToken.js";
3
- import getUser from "./func/getUser.js";
4
- import updateAccessToken from "./func/updateAccessToken.js";
5
- import getUserChannel from "./func/getUserChannel.js";
6
- import { getPrivateToken } from "./func/getPrivateToken.js";
7
- import CentrifugeClient from "./ws/CentrifugeClient.js";
8
- export * from "./types.js";
9
- export { getAuthorizeLink, getOauthToken, getUser, updateAccessToken, getUserChannel, getPrivateToken, CentrifugeClient };
1
+ import getAuthorizeLink from "./Function/getAuthorizeLink.js";
2
+ import getOauthToken from "./Function/getOauthToken.js";
3
+ import getUser from "./Function/getUser.js";
4
+ import updateOauthToken from "./Function/updateOauthToken.js";
5
+ import getUserChannel from "./Function/getUserChannel.js";
6
+ import getPrivateToken from "./Function/getPrivateToken.js";
7
+ import getDonationsAlerts from "./Function/getDonationsAlerts.js";
8
+ import getExternal from "./Function/getExternal.js";
9
+ import createCustomAlerts from "./Function/createCustomAlerts.js";
10
+ import generateSignature from "./Function/generateSignature.js";
11
+ import createMerchandise from "./Function/createMerchandise.js";
12
+ import updateMerchandise from "./Function/updateMerchandise.js";
13
+ import updateOrCreateMerchandise from "./Function/updateOrCreateMerchandise.js";
14
+ import getUserDataFromPromocode from "./Function/getUserDataFromPromocode.js";
15
+ import sendSaleAlert from "./Function/sendSaleAlert.js";
16
+ import WebServer from "./WebSocket/CentrifugeClient.js";
17
+ import { OAuthScope } from "./Types/index.js";
18
+ export { getAuthorizeLink, getOauthToken, getUser, updateOauthToken, getUserChannel, getExternal, getPrivateToken, getDonationsAlerts, createCustomAlerts, generateSignature, createMerchandise, updateMerchandise, updateOrCreateMerchandise, getUserDataFromPromocode, sendSaleAlert, WebServer, OAuthScope };
@@ -1,15 +1,7 @@
1
1
  /**
2
- * Checks if a value is a plain object.
3
- * @param {unknown} value The value to check.
4
- * @returns {boolean} True if the value is a plain object, false otherwise.
5
- * @private
2
+ * Format an axios error into a readable error message.
3
+ *
4
+ * @param {any} error - The error thrown by axios or any other source
5
+ * @returns {string} A formatted error message
6
6
  */
7
- /**
8
- * Validates that the provided data is an object and contains the required keys.
9
- * For each required key, it also validates that the value is a string or a number.
10
- * @param {unknown} data - The data object to validate.
11
- * @param {string[]} requiredKeys - An array of keys that must be present in the data object.
12
- * @throws {Error} If validation fails.
13
- * @private
14
- */
15
- export declare function validateDataObject(data: unknown, requiredKeys: string[]): asserts data is Record<string, string | number | string[]>;
7
+ export declare function formatAxiosError(error: any): string;
package/dist/src/utils.js CHANGED
@@ -1,37 +1,21 @@
1
1
  /**
2
- * Checks if a value is a plain object.
3
- * @param {unknown} value The value to check.
4
- * @returns {boolean} True if the value is a plain object, false otherwise.
5
- * @private
2
+ * Format an axios error into a readable error message.
3
+ *
4
+ * @param {any} error - The error thrown by axios or any other source
5
+ * @returns {string} A formatted error message
6
6
  */
7
- function isObject(value) {
8
- return typeof value === "object" && value !== null && !Array.isArray(value);
9
- }
10
- /**
11
- * Validates that the provided data is an object and contains the required keys.
12
- * For each required key, it also validates that the value is a string or a number.
13
- * @param {unknown} data - The data object to validate.
14
- * @param {string[]} requiredKeys - An array of keys that must be present in the data object.
15
- * @throws {Error} If validation fails.
16
- * @private
17
- */
18
- export function validateDataObject(data, requiredKeys) {
19
- if (!isObject(data)) {
20
- throw new Error("You must provide data as an object.");
7
+ export function formatAxiosError(error) {
8
+ if (error?.response?.data?.error_description) {
9
+ return error.response.data.error_description;
10
+ }
11
+ if (error?.response?.data?.message) {
12
+ return error.response.data.message;
13
+ }
14
+ if (error?.response?.data?.error) {
15
+ return error.response.data.error;
21
16
  }
22
- for (const key of requiredKeys) {
23
- if (!(key in data) || data[key] === undefined || data[key] === null) {
24
- throw new Error(`You must provide "${key}" in the data object.`);
25
- }
26
- const value = data[key];
27
- if (key === "scope") {
28
- if (!Array.isArray(value)) {
29
- throw new Error(`"${key}" must be an array of strings.`);
30
- }
31
- continue;
32
- }
33
- if (typeof value !== "string" && typeof value !== "number") {
34
- throw new Error(`"${key}" must be a string or a number.`);
35
- }
17
+ if (error?.message) {
18
+ return error.message;
36
19
  }
20
+ return String(error);
37
21
  }
package/package.json CHANGED
@@ -1,47 +1,50 @@
1
1
  {
2
2
  "name": "@kash-88/alerts",
3
- "version": "1.2.1",
4
- "description": "A lightweight library for easy integration with the DonationAlerts API: authorization, token management, and user info in a few lines.",
3
+ "version": "1.3.0",
4
+ "description": "A library for seamless integration with the DonationAlerts API. It provides a comprehensive set of tools for authorization, user token management, retrieving account data, and handling various other API interactions.",
5
5
  "type": "module",
6
6
  "keywords": [
7
7
  "DonationAlerts",
8
8
  "DonationAlerts API",
9
- "DonationAlerts SDK"
9
+ "DonationAlerts SDK",
10
+ "DonationAlerts WebSocket",
11
+ "DA API",
12
+ "DA SDK",
13
+ "DA WebSocket"
10
14
  ],
11
15
  "publishConfig": {
12
16
  "registry": "https://npm.pkg.github.com/",
13
17
  "access": "public"
14
18
  },
15
- "homepage": "https://github.com/kash-88/alerts-SDK#readme",
19
+ "homepage": "https://github.com/kash-ts/alerts-SDK#readme",
16
20
  "bugs": {
17
- "url": "https://github.com/kash-88/alerts-SDK/issues"
21
+ "url": "https://github.com/kash-ts/alerts-SDK/issues"
18
22
  },
19
23
  "main": "dist/src/index.js",
20
24
  "types": "dist/src/index.d.ts",
21
25
  "exports": {
22
26
  ".": {
23
- "import": "./dist/src/index.js",
24
- "require": "./dist/src/index.js"
27
+ "types": "./dist/src/index.d.ts",
28
+ "import": "./dist/src/index.js"
25
29
  }
26
30
  },
27
31
  "files": [
28
32
  "dist",
29
- "src",
30
- "ws"
33
+ "src"
31
34
  ],
32
35
  "repository": {
33
36
  "type": "git",
34
- "url": "git+https://github.com/kash-88/alerts-SDK.git"
37
+ "url": "git+https://github.com/kash-ts/alerts-SDK.git"
35
38
  },
36
- "license": "ISC",
37
- "author": "kash.88",
39
+ "license": "MIT",
40
+ "author": "kash-ts",
38
41
  "scripts": {
39
42
  "publish:github": "npm publish",
40
43
  "build": "tsc && tsc-alias",
41
44
  "prepublishOnly": "npm run build",
42
- "publish:npm-laster": "npm publish --registry=https://registry.npmjs.org/ --tag latest",
43
- "publish:npm-dev": "npm publish --registry=https://registry.npmjs.org/ --tag Dev",
44
- "publish:npm-beta": "npm publish --registry=https://registry.npmjs.org/ --tag Beta"
45
+ "publish:npm-latest": "npm publish --@kash-88:registry=https://registry.npmjs.org/ --tag latest",
46
+ "publish:npm-dev": "npm publish --@kash-88:registry=https://registry.npmjs.org/ --tag dev",
47
+ "publish:npm-beta": "npm publish --@kash-88:registry=https://registry.npmjs.org/ --tag beta"
45
48
  },
46
49
  "dependencies": {
47
50
  "axios": "^1.10.0",
@@ -51,9 +54,10 @@
51
54
  "devDependencies": {
52
55
  "@types/node": "^20.12.12",
53
56
  "@types/ws": "^8.5.10",
57
+ "dotenv": "^16.4.5",
58
+ "readline-sync": "^1.4.10",
54
59
  "ts-node": "^10.9.2",
55
60
  "tsc-alias": "^1.8.16",
56
- "tsconfig-paths": "^4.2.0",
57
- "typescript": "^5.4.5"
61
+ "typescript": "^5.9.3"
58
62
  }
59
- }
63
+ }