@bundleup/sdk 0.0.3 → 0.0.5
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/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -3
- package/dist/index.mjs +6 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -68,7 +68,9 @@ type ChatMessageRequest = {
|
|
|
68
68
|
channelId: string;
|
|
69
69
|
content: string;
|
|
70
70
|
};
|
|
71
|
-
declare class Chat
|
|
71
|
+
declare class Chat {
|
|
72
|
+
private req;
|
|
73
|
+
constructor(apiKey: string, connectionId: string);
|
|
72
74
|
message({ channelId, content }: ChatMessageRequest): Promise<Response>;
|
|
73
75
|
}
|
|
74
76
|
|
package/dist/index.d.ts
CHANGED
|
@@ -68,7 +68,9 @@ type ChatMessageRequest = {
|
|
|
68
68
|
channelId: string;
|
|
69
69
|
content: string;
|
|
70
70
|
};
|
|
71
|
-
declare class Chat
|
|
71
|
+
declare class Chat {
|
|
72
|
+
private req;
|
|
73
|
+
constructor(apiKey: string, connectionId: string);
|
|
72
74
|
message({ channelId, content }: ChatMessageRequest): Promise<Response>;
|
|
73
75
|
}
|
|
74
76
|
|
package/dist/index.js
CHANGED
|
@@ -158,7 +158,7 @@ var Request = class {
|
|
|
158
158
|
constructor(apiKey, connectionId) {
|
|
159
159
|
this.apiKey = apiKey;
|
|
160
160
|
this.connectionId = connectionId;
|
|
161
|
-
this.baseUrl = "https://
|
|
161
|
+
this.baseUrl = "https://req.bundleup.io";
|
|
162
162
|
}
|
|
163
163
|
get headers() {
|
|
164
164
|
return {
|
|
@@ -264,7 +264,10 @@ var Request = class {
|
|
|
264
264
|
};
|
|
265
265
|
|
|
266
266
|
// src/methods/chat.ts
|
|
267
|
-
var Chat = class
|
|
267
|
+
var Chat = class {
|
|
268
|
+
constructor(apiKey, connectionId) {
|
|
269
|
+
this.req = new Request(apiKey, connectionId);
|
|
270
|
+
}
|
|
268
271
|
message({ channelId, content }) {
|
|
269
272
|
if (!channelId) {
|
|
270
273
|
throw new Error("Channel ID is required to send a chat message.");
|
|
@@ -272,7 +275,7 @@ var Chat = class extends Request {
|
|
|
272
275
|
if (!content) {
|
|
273
276
|
throw new Error("Content is required to send a chat message.");
|
|
274
277
|
}
|
|
275
|
-
return this.post(
|
|
278
|
+
return this.req.post(
|
|
276
279
|
"/",
|
|
277
280
|
{ channelId, content },
|
|
278
281
|
{ "BU-Method": "chat.message" }
|
package/dist/index.mjs
CHANGED
|
@@ -132,7 +132,7 @@ var Request = class {
|
|
|
132
132
|
constructor(apiKey, connectionId) {
|
|
133
133
|
this.apiKey = apiKey;
|
|
134
134
|
this.connectionId = connectionId;
|
|
135
|
-
this.baseUrl = "https://
|
|
135
|
+
this.baseUrl = "https://req.bundleup.io";
|
|
136
136
|
}
|
|
137
137
|
get headers() {
|
|
138
138
|
return {
|
|
@@ -238,7 +238,10 @@ var Request = class {
|
|
|
238
238
|
};
|
|
239
239
|
|
|
240
240
|
// src/methods/chat.ts
|
|
241
|
-
var Chat = class
|
|
241
|
+
var Chat = class {
|
|
242
|
+
constructor(apiKey, connectionId) {
|
|
243
|
+
this.req = new Request(apiKey, connectionId);
|
|
244
|
+
}
|
|
242
245
|
message({ channelId, content }) {
|
|
243
246
|
if (!channelId) {
|
|
244
247
|
throw new Error("Channel ID is required to send a chat message.");
|
|
@@ -246,7 +249,7 @@ var Chat = class extends Request {
|
|
|
246
249
|
if (!content) {
|
|
247
250
|
throw new Error("Content is required to send a chat message.");
|
|
248
251
|
}
|
|
249
|
-
return this.post(
|
|
252
|
+
return this.req.post(
|
|
250
253
|
"/",
|
|
251
254
|
{ channelId, content },
|
|
252
255
|
{ "BU-Method": "chat.message" }
|