@databutton/firebase-types 1.113.1 → 1.114.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.
@@ -2493,4 +2493,66 @@ export interface TelemetryEvent {
2493
2493
  iteration: number | null;
2494
2494
  meta: Record<string, string | number | boolean | null>;
2495
2495
  }
2496
+ export interface SlackApp {
2497
+ projectId: string;
2498
+ appId: string;
2499
+ appName: string;
2500
+ clientId: string;
2501
+ clientSecret: string;
2502
+ signingSecret: string;
2503
+ webhookUrl: string;
2504
+ oauthCallbackUrl: string;
2505
+ installed: boolean;
2506
+ botToken: string | null;
2507
+ botUserId: string | null;
2508
+ teamId: string | null;
2509
+ teamName: string | null;
2510
+ createdAt: PerformedBy;
2511
+ installedAt: PerformedBy | null;
2512
+ }
2513
+ export type ChannelType = "slack" | "email" | "teams";
2514
+ export interface BaseChannel {
2515
+ id: string;
2516
+ projectId: string;
2517
+ type: ChannelType;
2518
+ name: string;
2519
+ enabled: boolean;
2520
+ createdBy: PerformedBy;
2521
+ updatedBy: PerformedBy;
2522
+ }
2523
+ export interface SlackChannelConfig {
2524
+ slackAppId: string;
2525
+ teamId: string;
2526
+ teamName: string;
2527
+ botUserId: string;
2528
+ defaultChannelId: string | null;
2529
+ defaultChannelName: string | null;
2530
+ }
2531
+ export interface EmailChannelConfig {
2532
+ provider: "sendgrid" | "ses" | "custom";
2533
+ fromAddress: string;
2534
+ fromName: string;
2535
+ replyToAddress: string | null;
2536
+ }
2537
+ export interface TeamsChannelConfig {
2538
+ tenantId: string;
2539
+ teamId: string;
2540
+ appId: string;
2541
+ }
2542
+ export interface SlackChannel extends BaseChannel {
2543
+ type: "slack";
2544
+ config: SlackChannelConfig;
2545
+ }
2546
+ export interface EmailChannel extends BaseChannel {
2547
+ type: "email";
2548
+ config: EmailChannelConfig;
2549
+ }
2550
+ export interface TeamsChannel extends BaseChannel {
2551
+ type: "teams";
2552
+ config: TeamsChannelConfig;
2553
+ }
2554
+ export type Channel = SlackChannel | EmailChannel | TeamsChannel;
2555
+ export declare const isSlackChannel: (channel: Channel) => channel is SlackChannel;
2556
+ export declare const isEmailChannel: (channel: Channel) => channel is EmailChannel;
2557
+ export declare const isTeamsChannel: (channel: Channel) => channel is TeamsChannel;
2496
2558
  export {};
@@ -85,4 +85,8 @@ export var CertificateStatus;
85
85
  CertificateStatus["VALIDATION_TIMED_OUT"] = "VALIDATION_TIMED_OUT";
86
86
  CertificateStatus["CERTIFICATE_NOT_FOUND"] = "CERTIFICATE_NOT_FOUND";
87
87
  })(CertificateStatus || (CertificateStatus = {}));
88
+ // Type guards for channel types
89
+ export const isSlackChannel = (channel) => channel.type === "slack";
90
+ export const isEmailChannel = (channel) => channel.type === "email";
91
+ export const isTeamsChannel = (channel) => channel.type === "teams";
88
92
  //# sourceMappingURL=persisted.js.map
@@ -500,4 +500,22 @@ export type DeleteAccountRequest = {
500
500
  export type DeleteAccountResponse = {
501
501
  success: boolean;
502
502
  };
503
+ export type RegisterSlackAppRequest = {
504
+ projectId: string;
505
+ appName: string;
506
+ webhookUrl?: string;
507
+ oauthCallbackUrl?: string;
508
+ };
509
+ export type RegisterSlackAppResponse = {
510
+ success: true;
511
+ appId: string;
512
+ clientId: string;
513
+ signingSecret: string;
514
+ installUrl: string;
515
+ webhookUrl: string;
516
+ } | {
517
+ success: false;
518
+ errorCode: string;
519
+ errorMessage?: string;
520
+ };
503
521
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databutton/firebase-types",
3
- "version": "1.113.1",
3
+ "version": "1.114.0",
4
4
  "main": "lib/types/published/index.js",
5
5
  "type": "module",
6
6
  "engines": {