@hardlydifficult/chat 1.0.3 → 1.1.1

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
@@ -34,13 +34,13 @@ await channel
34
34
  Post rich, formatted messages using the `@hardlydifficult/document-generator` package:
35
35
 
36
36
  ```typescript
37
- import { doc } from '@hardlydifficult/document-generator';
37
+ import { Document } from '@hardlydifficult/document-generator';
38
38
  import { createChatClient } from '@hardlydifficult/chat';
39
39
 
40
40
  const client = createChatClient({ type: 'slack' });
41
41
  const channel = await client.connect(channelId);
42
42
 
43
- const report = doc()
43
+ const report = new Document()
44
44
  .header("Daily Report")
45
45
  .text("Here are today's **highlights**:")
46
46
  .list(["Feature A completed", "Bug B fixed", "99.9% uptime"])
@@ -59,7 +59,7 @@ await channel.postMessage(report);
59
59
  ```typescript
60
60
  const msg = await channel.postMessage('Initial content');
61
61
  await msg.update('Updated content');
62
- await msg.update(doc().header('New Header').text('New body'));
62
+ await msg.update(new Document().header('New Header').text('New body'));
63
63
  ```
64
64
 
65
65
  ### Delete Messages
@@ -74,7 +74,7 @@ await msg.delete();
74
74
  ```typescript
75
75
  const msg = await channel.postMessage('Main message');
76
76
  msg.postReply('This is a thread reply');
77
- msg.postReply(doc().text('Rich reply with **formatting**'));
77
+ msg.postReply(new Document().text('Rich reply with **formatting**'));
78
78
  ```
79
79
 
80
80
  ### Reactions
@@ -179,7 +179,7 @@ Disconnect from the platform.
179
179
 
180
180
  ```typescript
181
181
  import { createChatClient } from "@hardlydifficult/chat";
182
- import { doc } from "@hardlydifficult/document-generator";
182
+ import { Document } from "@hardlydifficult/document-generator";
183
183
 
184
184
  const client = createChatClient({ type: "discord" });
185
185
  const channel = await client.connect(process.env.CHANNEL_ID);
@@ -188,7 +188,7 @@ const options = ["Pizza", "Burgers", "Salad"];
188
188
  const emojis = ["1️⃣", "2️⃣", "3️⃣"];
189
189
  const votes: Record<string, string> = {};
190
190
 
191
- const pollDoc = doc()
191
+ const pollDoc = new Document()
192
192
  .header("🗳️ Lunch Poll")
193
193
  .text("What should we order?")
194
194
  .list(options.map((o, i) => `${emojis[i]} ${o}`));
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { type User, type DiscordConfig, type SlackConfig, type ChatConfig, type Platform, type ReactionEvent, type ReactionCallback, type MessageContent, type PostMessageOptions, Document, doc, } from './types';
1
+ export { type User, type DiscordConfig, type SlackConfig, type ChatConfig, type Platform, type ReactionEvent, type ReactionCallback, type MessageContent, type PostMessageOptions, } from './types';
2
2
  export { ChatClient } from './ChatClient';
3
3
  export { Channel, type ChannelOperations } from './Channel';
4
4
  export { Message, ReplyMessage, type MessageOperations } from './Message';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,IAAI,EACT,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,QAAQ,EACR,GAAG,GACJ,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAS/D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,IAAI,EACT,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,kBAAkB,GACxB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAS/D"}
package/dist/index.js CHANGED
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SlackChatClient = exports.DiscordChatClient = exports.ReplyMessage = exports.Message = exports.Channel = exports.ChatClient = exports.doc = exports.Document = void 0;
3
+ exports.SlackChatClient = exports.DiscordChatClient = exports.ReplyMessage = exports.Message = exports.Channel = exports.ChatClient = void 0;
4
4
  exports.createChatClient = createChatClient;
5
- // Types and utilities
6
- var types_1 = require("./types");
7
- Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return types_1.Document; } });
8
- Object.defineProperty(exports, "doc", { enumerable: true, get: function () { return types_1.doc; } });
9
5
  // Core classes
10
6
  var ChatClient_1 = require("./ChatClient");
11
7
  Object.defineProperty(exports, "ChatClient", { enumerable: true, get: function () { return ChatClient_1.ChatClient; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAkDA,4CASC;AA3DD,sBAAsB;AACtB,iCAYiB;AAFf,iGAAA,QAAQ,OAAA;AACR,4FAAA,GAAG,OAAA;AAGL,eAAe;AACf,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qCAA4D;AAAnD,kGAAA,OAAO,OAAA;AAChB,qCAA0E;AAAjE,kGAAA,OAAO,OAAA;AAAE,uGAAA,YAAY,OAAA;AAE9B,2BAA2B;AAC3B,yCAAoD;AAA3C,0GAAA,iBAAiB,OAAA;AAC1B,uCAAgD;AAAvC,wGAAA,eAAe,OAAA;AAKxB,2CAAoD;AACpD,yCAAgD;AAEhD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,gBAAgB,CAAC,MAAkB;IACjD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,SAAS;YACZ,OAAO,IAAI,yBAAiB,CAAC,MAAM,CAAC,CAAC;QACvC,KAAK,OAAO;YACV,OAAO,IAAI,uBAAe,CAAC,MAAM,CAAC,CAAC;QACrC;YACE,MAAM,IAAI,KAAK,CAAC,0BAA2B,MAA2B,CAAC,IAAI,EAAE,CAAC,CAAC;IACnF,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAgDA,4CASC;AA5CD,eAAe;AACf,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qCAA4D;AAAnD,kGAAA,OAAO,OAAA;AAChB,qCAA0E;AAAjE,kGAAA,OAAO,OAAA;AAAE,uGAAA,YAAY,OAAA;AAE9B,2BAA2B;AAC3B,yCAAoD;AAA3C,0GAAA,iBAAiB,OAAA;AAC1B,uCAAgD;AAAvC,wGAAA,eAAe,OAAA;AAKxB,2CAAoD;AACpD,yCAAgD;AAEhD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,gBAAgB,CAAC,MAAkB;IACjD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,SAAS;YACZ,OAAO,IAAI,yBAAiB,CAAC,MAAM,CAAC,CAAC;QACvC,KAAK,OAAO;YACV,OAAO,IAAI,uBAAe,CAAC,MAAM,CAAC,CAAC;QACrC;YACE,MAAM,IAAI,KAAK,CAAC,0BAA2B,MAA2B,CAAC,IAAI,EAAE,CAAC,CAAC;IACnF,CAAC;AACH,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { Document } from '@hardlydifficult/document-generator';
2
- export { doc, Document } from '@hardlydifficult/document-generator';
1
+ import type { Document } from '@hardlydifficult/document-generator';
3
2
  /**
4
3
  * Configuration for Discord client
5
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,WAAW,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAE3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AAM,UAAU,GAAG,aAAa,GAAG,WAAW,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,IAAI,EAAE,IAAI,CAAC;IACX,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
package/dist/types.js CHANGED
@@ -1,8 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Document = exports.doc = void 0;
4
- // Re-export doc and Document from documentGenerator
5
- var document_generator_1 = require("@hardlydifficult/document-generator");
6
- Object.defineProperty(exports, "doc", { enumerable: true, get: function () { return document_generator_1.doc; } });
7
- Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return document_generator_1.Document; } });
8
3
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAGA,oDAAoD;AACpD,0EAAoE;AAA3D,yGAAA,GAAG,OAAA;AAAE,8GAAA,QAAQ,OAAA"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hardlydifficult/chat",
3
- "version": "1.0.3",
3
+ "version": "1.1.1",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -25,6 +25,6 @@
25
25
  "vitest": "1.6.1"
26
26
  },
27
27
  "peerDependencies": {
28
- "@hardlydifficult/document-generator": ">=1.0.0"
28
+ "@hardlydifficult/document-generator": ">=1.1.0"
29
29
  }
30
30
  }