@sentry/junior-plugin-api 0.85.0 → 0.86.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/context.d.ts CHANGED
@@ -85,6 +85,8 @@ export declare function createSlackSource(input: {
85
85
  messageTs?: string;
86
86
  teamId: string;
87
87
  threadTs?: string;
88
+ /** Runtime-normalized source visibility. */
89
+ type: SourceType;
88
90
  }): SlackSource;
89
91
  /** Build a normalized local source from a local conversation id. */
90
92
  export declare function createLocalSource(conversationId: string): LocalSource;
package/dist/index.js CHANGED
@@ -122,18 +122,13 @@ var dispatchOptionsSchema = z.object({
122
122
  function createSlackSource(input) {
123
123
  return {
124
124
  platform: "slack",
125
- type: slackSourceType(input.channelId),
125
+ type: input.type,
126
126
  teamId: input.teamId,
127
127
  channelId: input.channelId,
128
128
  ...input.messageTs ? { messageTs: input.messageTs } : {},
129
129
  ...input.threadTs ? { threadTs: input.threadTs } : {}
130
130
  };
131
131
  }
132
- function slackSourceType(channelId) {
133
- if (channelId.startsWith("C")) return "pub";
134
- if (channelId.startsWith("D") || channelId.startsWith("G")) return "priv";
135
- throw new Error(`Unsupported Slack channel ID prefix: ${channelId}`);
136
- }
137
132
  function createLocalSource(conversationId) {
138
133
  return {
139
134
  platform: "local",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-plugin-api",
3
- "version": "0.85.0",
3
+ "version": "0.86.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/context.ts CHANGED
@@ -94,10 +94,12 @@ export function createSlackSource(input: {
94
94
  messageTs?: string;
95
95
  teamId: string;
96
96
  threadTs?: string;
97
+ /** Runtime-normalized source visibility. */
98
+ type: SourceType;
97
99
  }): SlackSource {
98
100
  return {
99
101
  platform: "slack",
100
- type: slackSourceType(input.channelId),
102
+ type: input.type,
101
103
  teamId: input.teamId,
102
104
  channelId: input.channelId,
103
105
  ...(input.messageTs ? { messageTs: input.messageTs } : {}),
@@ -105,13 +107,6 @@ export function createSlackSource(input: {
105
107
  };
106
108
  }
107
109
 
108
- /** Classify Slack's documented C/D/G channel id prefixes into source visibility. */
109
- function slackSourceType(channelId: string): SourceType {
110
- if (channelId.startsWith("C")) return "pub";
111
- if (channelId.startsWith("D") || channelId.startsWith("G")) return "priv";
112
- throw new Error(`Unsupported Slack channel ID prefix: ${channelId}`);
113
- }
114
-
115
110
  /** Build a normalized local source from a local conversation id. */
116
111
  export function createLocalSource(conversationId: string): LocalSource {
117
112
  return {