@desplega.ai/slack-mock 0.2.0 → 0.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.
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@
3
3
  import {
4
4
  SlackMock2,
5
5
  frames2
6
- } from "./index-6c88z809.js";
6
+ } from "./index-fhjq5qns.js";
7
7
  import {
8
8
  screenshot2
9
9
  } from "./index-v2hesj4s.js";
@@ -184,6 +184,7 @@ class Store2 {
184
184
  real_name_normalized: realName,
185
185
  display_name_normalized: input.name,
186
186
  email: input.email,
187
+ title: input.title,
187
188
  team: this.team.id
188
189
  }
189
190
  };
@@ -1900,12 +1901,12 @@ function indexView(store, opts) {
1900
1901
  const count = store.messages.get(c.id)?.length ?? 0;
1901
1902
  return `<tr><td><a href="${channelHref(c.id, opts)}">${escapeHtml(channelIcon(c))} ${escapeHtml(c.is_im ? channelLabel(store, c) : c.name)}</a></td><td><span class="sm-tag">${channelKind(c)}</span></td><td class="sm-muted">${c.id}</td><td>${count}</td></tr>`;
1902
1903
  }).join("");
1903
- const userRows = [...store.users.values()].map((u) => `<tr><td>${escapeHtml(u.name)}</td><td>${escapeHtml(u.real_name)}</td><td class="sm-muted">${escapeHtml(u.profile.email ?? "")}</td><td class="sm-muted">${u.id}</td><td>${u.is_bot ? `<span class="sm-tag">bot</span>` : ""}</td></tr>`).join("");
1904
+ const userRows = [...store.users.values()].map((u) => `<tr><td>${escapeHtml(u.name)}</td><td>${escapeHtml(u.real_name)}</td><td class="sm-muted">${escapeHtml(u.profile.title ?? "")}</td><td class="sm-muted">${escapeHtml(u.profile.email ?? "")}</td><td class="sm-muted">${u.id}</td><td>${u.is_bot ? `<span class="sm-tag">bot</span>` : ""}</td></tr>`).join("");
1904
1905
  const main = `<div class="sm-cards">${cards}</div>
1905
1906
  <div class="sm-h2">Channels</div>
1906
1907
  ${channels.length ? `<table class="sm-table"><tr><th>Name</th><th>Type</th><th>Id</th><th>Messages</th></tr>${channelRows}</table>` : `<div class="sm-empty">No channels yet</div>`}
1907
1908
  <div class="sm-h2">Users</div>
1908
- <table class="sm-table"><tr><th>Name</th><th>Real name</th><th>Email</th><th>Id</th><th></th></tr>${userRows}</table>`;
1909
+ <table class="sm-table"><tr><th>Name</th><th>Real name</th><th>Title</th><th>Email</th><th>Id</th><th></th></tr>${userRows}</table>`;
1909
1910
  return shell(store, opts, {
1910
1911
  title: `${store.team.name} \xB7 slack-mock`,
1911
1912
  header: topbar(escapeHtml(store.team.name), "slack-mock workspace"),
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  Store2,
5
5
  SlackMock2,
6
6
  frames2
7
- } from "./index-6c88z809.js";
7
+ } from "./index-fhjq5qns.js";
8
8
  import {
9
9
  findChrome2,
10
10
  screenshot2
package/dist/store.d.ts CHANGED
@@ -25,6 +25,7 @@ export interface AddUserInput {
25
25
  name: string;
26
26
  real_name?: string;
27
27
  email?: string;
28
+ title?: string;
28
29
  is_admin?: boolean;
29
30
  is_bot?: boolean;
30
31
  tz?: string;
package/dist/types.d.ts CHANGED
@@ -16,6 +16,7 @@ export interface SlackUser {
16
16
  email?: string;
17
17
  image_72?: string;
18
18
  team: string;
19
+ title?: string;
19
20
  };
20
21
  }
21
22
  export interface SlackChannel {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@desplega.ai/slack-mock",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Mock Slack server (Web API + Socket Mode) for end-to-end testing Slack bots",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -611,7 +611,7 @@ function indexView(store: Store, opts: RenderOptions): string {
611
611
  const userRows = [...store.users.values()]
612
612
  .map(
613
613
  (u) =>
614
- `<tr><td>${escapeHtml(u.name)}</td><td>${escapeHtml(u.real_name)}</td><td class="sm-muted">${escapeHtml(u.profile.email ?? "")}</td><td class="sm-muted">${u.id}</td><td>${u.is_bot ? `<span class="sm-tag">bot</span>` : ""}</td></tr>`,
614
+ `<tr><td>${escapeHtml(u.name)}</td><td>${escapeHtml(u.real_name)}</td><td class="sm-muted">${escapeHtml(u.profile.title ?? "")}</td><td class="sm-muted">${escapeHtml(u.profile.email ?? "")}</td><td class="sm-muted">${u.id}</td><td>${u.is_bot ? `<span class="sm-tag">bot</span>` : ""}</td></tr>`,
615
615
  )
616
616
  .join("");
617
617
 
@@ -623,7 +623,7 @@ ${
623
623
  : `<div class="sm-empty">No channels yet</div>`
624
624
  }
625
625
  <div class="sm-h2">Users</div>
626
- <table class="sm-table"><tr><th>Name</th><th>Real name</th><th>Email</th><th>Id</th><th></th></tr>${userRows}</table>`;
626
+ <table class="sm-table"><tr><th>Name</th><th>Real name</th><th>Title</th><th>Email</th><th>Id</th><th></th></tr>${userRows}</table>`;
627
627
 
628
628
  return shell(store, opts, {
629
629
  title: `${store.team.name} · slack-mock`,
package/src/store.ts CHANGED
@@ -43,6 +43,7 @@ export interface AddUserInput {
43
43
  name: string;
44
44
  real_name?: string;
45
45
  email?: string;
46
+ title?: string;
46
47
  is_admin?: boolean;
47
48
  is_bot?: boolean;
48
49
  tz?: string;
@@ -244,6 +245,7 @@ export class Store {
244
245
  real_name_normalized: realName,
245
246
  display_name_normalized: input.name,
246
247
  email: input.email,
248
+ title: input.title,
247
249
  team: this.team.id,
248
250
  },
249
251
  };
package/src/types.ts CHANGED
@@ -19,6 +19,7 @@ export interface SlackUser {
19
19
  email?: string;
20
20
  image_72?: string;
21
21
  team: string;
22
+ title?: string;
22
23
  };
23
24
  }
24
25