@databutton/firebase-types 1.95.0 → 1.95.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.
@@ -37,6 +37,7 @@ export declare enum CollectionName {
37
37
  LOGS = "logs",
38
38
  ACCOUNT_MEMBERS = "members",
39
39
  ACCOUNT_CONFIGS = "configs",
40
+ ACCOUNT_APPROVAL_REQUESTS = "approval-requests",
40
41
  ROLES = "roles",
41
42
  MESSAGES = "messages",
42
43
  MODULES = "modules",
@@ -209,7 +210,8 @@ export declare enum CreateProjectErrorCode {
209
210
  }
210
211
  export declare enum ConfigTypes {
211
212
  SSO = "sso",
212
- POSTHOG = "posthog"
213
+ POSTHOG = "posthog",
214
+ GATING = "gating"
213
215
  }
214
216
  export declare enum MigrateToRiffErrorCode {
215
217
  UNKNOWN_ERROR = "UNKNOWN_ERROR"
@@ -38,6 +38,7 @@ export var CollectionName;
38
38
  CollectionName["LOGS"] = "logs";
39
39
  CollectionName["ACCOUNT_MEMBERS"] = "members";
40
40
  CollectionName["ACCOUNT_CONFIGS"] = "configs";
41
+ CollectionName["ACCOUNT_APPROVAL_REQUESTS"] = "approval-requests";
41
42
  CollectionName["ROLES"] = "roles";
42
43
  CollectionName["MESSAGES"] = "messages";
43
44
  CollectionName["MODULES"] = "modules";
@@ -228,6 +229,7 @@ export var ConfigTypes;
228
229
  (function (ConfigTypes) {
229
230
  ConfigTypes["SSO"] = "sso";
230
231
  ConfigTypes["POSTHOG"] = "posthog";
232
+ ConfigTypes["GATING"] = "gating";
231
233
  })(ConfigTypes || (ConfigTypes = {}));
232
234
  export var MigrateToRiffErrorCode;
233
235
  (function (MigrateToRiffErrorCode) {
@@ -96,11 +96,51 @@ export interface PostHogConfig extends AccountConfigBase {
96
96
  */
97
97
  host: string;
98
98
  }
99
- export type AccountConfig = SSOConfig | PostHogConfig;
99
+ export type PermissionName = "deploy";
100
+ export type ApprovalLevel = "role" | "permission" | "approval";
101
+ export interface GatingConfig extends AccountConfigBase {
102
+ type: ConfigTypes.GATING;
103
+ approvalLevelRequiredFor: Record<PermissionName, ApprovalLevel>;
104
+ }
105
+ export type AccountConfig = SSOConfig | PostHogConfig | GatingConfig;
100
106
  export interface SSOConfigLookupEntry {
101
107
  lastUpdatedAt: Timestamp;
102
108
  organizationId: string;
103
109
  }
110
+ interface Approvable {
111
+ approvalRequestRef?: string | null;
112
+ approvedBy?: PerformedBy | null;
113
+ deniedBy?: PerformedBy | null;
114
+ }
115
+ interface ApprovalRequestBase<T = string, M = Record<string, string>> {
116
+ requestedBy: PerformedBy;
117
+ requesterComment: string;
118
+ roleRequiredToApprove: "admin";
119
+ docToApproveRef: string | null;
120
+ type: T;
121
+ metadata: M;
122
+ review: {
123
+ reviewedBy: PerformedBy;
124
+ comment: string;
125
+ approved: boolean;
126
+ } | null;
127
+ }
128
+ type AddPermissionApprovalConfig = {
129
+ projectId: string;
130
+ userId: string;
131
+ permission: PermissionName;
132
+ };
133
+ export type AddPermissionApprovalRequest = ApprovalRequestBase<"add-permission", AddPermissionApprovalConfig>;
134
+ type UseIntegrationApprovalConfig = {
135
+ projectId: string;
136
+ integrationRef: string;
137
+ };
138
+ export type UseIntegrationApprovalRequest = ApprovalRequestBase<"use-integration", UseIntegrationApprovalConfig>;
139
+ type DeployProjectApprovalConfig = {
140
+ deploymentRef: string;
141
+ };
142
+ export type DeployProjectApprovalRequest = ApprovalRequestBase<"deploy-project", DeployProjectApprovalConfig>;
143
+ export type ApprovalRequest = AddPermissionApprovalRequest | UseIntegrationApprovalRequest | DeployProjectApprovalRequest;
104
144
  /**
105
145
  * A list of account IDs that the user is at least a member of
106
146
  */
@@ -1142,6 +1182,7 @@ export interface Project {
1142
1182
  markedForDeletionAt: Timestamp | null;
1143
1183
  markedForDeletionBy?: PerformedBy | null;
1144
1184
  members: string[];
1185
+ permittedUsers?: Record<PermissionName, string[]>;
1145
1186
  name: string;
1146
1187
  tags?: string[];
1147
1188
  slug?: string;
@@ -1532,7 +1573,7 @@ export type AppSnapshot<T = ComponentSnapshotBase> = {
1532
1573
  uiComponents?: UiComponentSnapshot<T>[];
1533
1574
  frontends?: FrontendSnapshot<T>[];
1534
1575
  };
1535
- export interface ProjectDeploymentBase<T = ComponentSnapshotBase> extends AppSnapshot<T> {
1576
+ export interface ProjectDeploymentBase<T = ComponentSnapshotBase> extends Approvable, AppSnapshot<T> {
1536
1577
  build: {
1537
1578
  id: string;
1538
1579
  venv?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databutton/firebase-types",
3
- "version": "1.95.0",
3
+ "version": "1.95.1",
4
4
  "main": "lib/types/published/index.js",
5
5
  "type": "module",
6
6
  "engines": {