@barndoor-ai/sdk 1.2.0 → 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.
@@ -113,4 +113,137 @@ export declare class AgentToken {
113
113
  */
114
114
  static fromApiResponse(data: unknown): AgentToken;
115
115
  }
116
+ /**
117
+ * What kind of destination a channel delivers to.
118
+ *
119
+ * `in_app` and `user_email` are personal (owned by one user, always the caller);
120
+ * `email`, `webhook`, `slack` and `teams` are organization-wide.
121
+ */
122
+ export type ChannelType = 'in_app' | 'user_email' | 'email' | 'webhook' | 'slack' | 'teams';
123
+ /** One alert type a channel is subscribed to. */
124
+ export interface ChannelSubscription {
125
+ /**
126
+ * The alert type delivered to the channel (e.g. `break_glass_used`). Read the live
127
+ * vocabulary from `getChannelOptions()` rather than hardcoding it — the set grows
128
+ * over time and is gated per organization.
129
+ */
130
+ alert_type: string;
131
+ }
132
+ /**
133
+ * A notification delivery destination.
134
+ *
135
+ * Only the destination field belonging to `type` is populated; the rest are null.
136
+ * Secrets are never returned — a webhook's signing secret and a Teams workflow URL
137
+ * surface only as the `has_signing_secret` / `has_workflow_url` flags.
138
+ */
139
+ export interface Channel {
140
+ /** Server-assigned channel id. */
141
+ id: string;
142
+ type: ChannelType;
143
+ /** Whether the channel currently delivers. */
144
+ enabled: boolean;
145
+ /** Owning user for a personal channel; null for organization-wide types. */
146
+ user_id: string | null;
147
+ /** Destination for `type: 'email'`. */
148
+ email_address: string | null;
149
+ /** Destination for `type: 'webhook'`. */
150
+ url: string | null;
151
+ /** Human-readable name, set for `slack` and `teams`. */
152
+ label: string | null;
153
+ /** Slack channel id for `type: 'slack'`. */
154
+ slack_channel_id: string | null;
155
+ /** Alert types this channel delivers. Empty means it delivers nothing. */
156
+ subscriptions: ChannelSubscription[];
157
+ created_at?: string;
158
+ updated_at?: string;
159
+ /** Whether a webhook channel has a stored signing secret (never readable back). */
160
+ has_signing_secret: boolean;
161
+ /** Whether a teams channel has a stored Workflows URL (itself a secret). */
162
+ has_workflow_url: boolean;
163
+ /**
164
+ * One-time reveal of a newly generated webhook signing secret. Present ONLY on the
165
+ * response that created it, and null on every later read — store it when you receive
166
+ * it, or rotate with `regenerateChannelSecret()`.
167
+ */
168
+ signing_secret?: string | null;
169
+ }
170
+ /** Response envelope for the channel list endpoints. */
171
+ export interface ChannelListResponse {
172
+ data: Channel[];
173
+ }
174
+ /** One subscribable alert type, with its intrinsic category and severity. */
175
+ export interface AlertTypeOption {
176
+ /** What to send as a subscription's `alert_type`. */
177
+ value: string;
178
+ label: string;
179
+ /** Intrinsic to the type, not configurable. */
180
+ category: string;
181
+ /** Intrinsic to the type, not configurable. */
182
+ severity: string;
183
+ }
184
+ /** An enum value paired with its display label. */
185
+ export interface LabeledOption {
186
+ value: string;
187
+ label: string;
188
+ }
189
+ /**
190
+ * The subscription vocabulary a channel's `subscriptions` may draw from.
191
+ *
192
+ * `alertTypes` is filtered to what the caller's organization is admitted to —
193
+ * subscribing to a type absent here is accepted but never delivers.
194
+ */
195
+ export interface ChannelOptions {
196
+ alert_types: AlertTypeOption[];
197
+ /** The full category vocabulary, unfiltered. */
198
+ categories: LabeledOption[];
199
+ /** The full severity vocabulary, unfiltered. */
200
+ severities: LabeledOption[];
201
+ }
202
+ /**
203
+ * Result of sending a connectivity-test message through a channel.
204
+ *
205
+ * A transport failure is reported here as `ok: false` with a reason, not as a thrown
206
+ * error: the request to test succeeded, the delivery is what failed.
207
+ */
208
+ export interface ChannelTestResult {
209
+ ok: boolean;
210
+ error?: string | null;
211
+ }
212
+ /** The one-time reveal of a webhook channel's signing secret. */
213
+ export interface WebhookSecret {
214
+ /**
215
+ * Standard Webhooks secret (`whsec_` + base64), shown exactly once. Rotating
216
+ * invalidates the previous secret immediately, so deploy this value before the next
217
+ * alert fires.
218
+ */
219
+ signing_secret: string;
220
+ }
221
+ /** Arguments for {@link BarndoorSDK.upsertChannel}. */
222
+ export interface UpsertChannelInput {
223
+ type: ChannelType;
224
+ /**
225
+ * Existing channel to edit authoritatively. Omit to create-or-dedup on the type's
226
+ * natural identity.
227
+ */
228
+ channelId?: string;
229
+ /** Defaults to true. `false` suspends delivery without deleting the channel. */
230
+ enabled?: boolean;
231
+ /** Required for `type: 'email'`. */
232
+ emailAddress?: string;
233
+ /** Required for `type: 'webhook'`. Must be https and resolve to a public address. */
234
+ url?: string;
235
+ /** Required for `slack` and `teams`. */
236
+ label?: string;
237
+ /** Required for `type: 'slack'` — the channel id, not its name. */
238
+ slackChannelId?: string;
239
+ /**
240
+ * Required on create for `type: 'teams'`. Write-only: never returned by any endpoint.
241
+ */
242
+ teamsWorkflowUrl?: string;
243
+ /**
244
+ * The complete set of alert types to deliver. **Replaces** the channel's existing
245
+ * set — omitting it unsubscribes the channel from everything.
246
+ */
247
+ subscriptions?: string[];
248
+ }
116
249
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gCAAgC;IAChC,iBAAiB,EAAE,gBAAgB,CAAC;CACrC;AAED;;;;;;GAMG;AACH,qBAAa,aAAa;IACxB,8CAA8C;IAC9C,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,wCAAwC;IACxC,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,gDAAgD;IAChD,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,0DAA0D;IAC1D,SAAg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AAC;IACd,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,mDAAmD;AACnD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,gDAAgD;IAChD,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,gDAAgD;IAChD,UAAU,EAAE,aAAa,EAAE,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,iEAAiE;AACjE,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,uDAAuD;AACvD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,WAAW,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qFAAqF;IACrF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barndoor-ai/sdk",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "TypeScript/JavaScript client for the Barndoor Platform API",
5
5
  "author": "Barndoor AI, Inc. (https://barndoor.ai)",
6
6
  "homepage": "https://barndoor.ai",
@@ -86,6 +86,18 @@
86
86
  "type-coverage": "^2.29.7",
87
87
  "typescript": "^5.8.3"
88
88
  },
89
+ "overrides": {
90
+ "@babel/plugin-transform-modules-systemjs": "^7.29.4",
91
+ "@hono/node-server": "^1.19.17",
92
+ "body-parser": "^2.3.0",
93
+ "brace-expansion@1": "^1.1.16",
94
+ "brace-expansion@2": "^2.1.4",
95
+ "brace-expansion@5": "^5.0.9",
96
+ "fast-uri": "^3.1.5",
97
+ "hono": "^4.13.2",
98
+ "js-yaml@3": "^3.15.1",
99
+ "js-yaml@4": "^4.3.1"
100
+ },
89
101
  "typeCoverage": {
90
102
  "atLeast": 60,
91
103
  "strict": true,