@databutton/firebase-types 1.82.34 → 1.83.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.
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare enum CollectionName {
|
|
2
|
+
ACCOUNTS = "accounts",
|
|
3
|
+
ACCOUNT_LISTS = "account-lists",
|
|
2
4
|
API_KEYS = "api-keys",
|
|
3
5
|
ADMIN_CONFIG = "admin-config",
|
|
4
6
|
AUDIT_LOGS = "audit-logs",
|
|
@@ -29,6 +31,8 @@ export declare enum CollectionName {
|
|
|
29
31
|
LAUNCH_WAITLIST = "launch-waitlist",
|
|
30
32
|
LIFE_STAGE_CHANGE_REQUESTS = "life-stage-change-requests",
|
|
31
33
|
LOGS = "logs",
|
|
34
|
+
ACCOUNT_MEMBERS = "members",
|
|
35
|
+
ROLES = "roles",
|
|
32
36
|
MESSAGES = "messages",
|
|
33
37
|
MODULES = "modules",
|
|
34
38
|
MIGRATIONS = "migrations",
|
|
@@ -75,6 +79,12 @@ export declare enum CollectionName {
|
|
|
75
79
|
LEGACY_UNUSED_JOBS = "jobs",
|
|
76
80
|
LEGACY_UNUSED_MULTIPAGE_APPS = "multipage-apps"
|
|
77
81
|
}
|
|
82
|
+
export declare enum AccountRole {
|
|
83
|
+
OWNER = "owner",
|
|
84
|
+
ADMIN = "admin",
|
|
85
|
+
COLLABORATOR = "collaborator",
|
|
86
|
+
BILLING = "billing"
|
|
87
|
+
}
|
|
78
88
|
export declare enum DatabuttonIdPrefix {
|
|
79
89
|
API_KEY = "dbtk",
|
|
80
90
|
APP_DEPLOY = "ad",
|
|
@@ -91,6 +101,7 @@ export declare enum DatabuttonIdPrefix {
|
|
|
91
101
|
LAUNCH_WAITLIST = "lw",
|
|
92
102
|
MODULE = "mo",
|
|
93
103
|
NOTEBOOK = "nb",
|
|
104
|
+
ORGANIZATION = "org",
|
|
94
105
|
FRONTEND_PACKAGES = "fp",
|
|
95
106
|
PROJECT_BUILD = "pb",
|
|
96
107
|
PROJECT_DEPLOYMENT = "pd",
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export var CollectionName;
|
|
2
2
|
(function (CollectionName) {
|
|
3
|
+
CollectionName["ACCOUNTS"] = "accounts";
|
|
4
|
+
CollectionName["ACCOUNT_LISTS"] = "account-lists";
|
|
3
5
|
CollectionName["API_KEYS"] = "api-keys";
|
|
4
6
|
CollectionName["ADMIN_CONFIG"] = "admin-config";
|
|
5
7
|
CollectionName["AUDIT_LOGS"] = "audit-logs";
|
|
@@ -30,6 +32,8 @@ export var CollectionName;
|
|
|
30
32
|
CollectionName["LAUNCH_WAITLIST"] = "launch-waitlist";
|
|
31
33
|
CollectionName["LIFE_STAGE_CHANGE_REQUESTS"] = "life-stage-change-requests";
|
|
32
34
|
CollectionName["LOGS"] = "logs";
|
|
35
|
+
CollectionName["ACCOUNT_MEMBERS"] = "members";
|
|
36
|
+
CollectionName["ROLES"] = "roles";
|
|
33
37
|
CollectionName["MESSAGES"] = "messages";
|
|
34
38
|
CollectionName["MODULES"] = "modules";
|
|
35
39
|
CollectionName["MIGRATIONS"] = "migrations";
|
|
@@ -77,6 +81,13 @@ export var CollectionName;
|
|
|
77
81
|
CollectionName["LEGACY_UNUSED_JOBS"] = "jobs";
|
|
78
82
|
CollectionName["LEGACY_UNUSED_MULTIPAGE_APPS"] = "multipage-apps";
|
|
79
83
|
})(CollectionName || (CollectionName = {}));
|
|
84
|
+
export var AccountRole;
|
|
85
|
+
(function (AccountRole) {
|
|
86
|
+
AccountRole["OWNER"] = "owner";
|
|
87
|
+
AccountRole["ADMIN"] = "admin";
|
|
88
|
+
AccountRole["COLLABORATOR"] = "collaborator";
|
|
89
|
+
AccountRole["BILLING"] = "billing";
|
|
90
|
+
})(AccountRole || (AccountRole = {}));
|
|
80
91
|
export var DatabuttonIdPrefix;
|
|
81
92
|
(function (DatabuttonIdPrefix) {
|
|
82
93
|
DatabuttonIdPrefix["API_KEY"] = "dbtk";
|
|
@@ -94,6 +105,7 @@ export var DatabuttonIdPrefix;
|
|
|
94
105
|
DatabuttonIdPrefix["LAUNCH_WAITLIST"] = "lw";
|
|
95
106
|
DatabuttonIdPrefix["MODULE"] = "mo";
|
|
96
107
|
DatabuttonIdPrefix["NOTEBOOK"] = "nb";
|
|
108
|
+
DatabuttonIdPrefix["ORGANIZATION"] = "org";
|
|
97
109
|
DatabuttonIdPrefix["FRONTEND_PACKAGES"] = "fp";
|
|
98
110
|
DatabuttonIdPrefix["PROJECT_BUILD"] = "pb";
|
|
99
111
|
DatabuttonIdPrefix["PROJECT_DEPLOYMENT"] = "pd";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Timestamp } from "firebase/firestore";
|
|
2
2
|
import type { JsonObject, Primitive } from "type-fest";
|
|
3
3
|
import type { ProjectMigration } from "../internal/enums.js";
|
|
4
|
-
import type { IntegrationType, TaskPriority, TaskRelation, ThirdPartyAuthName, ThirdPartyDatabaseName, ThirdPartyPaymentsName, ThirdPartyServiceCategory, ThirdPartyStorageName, UiComponentTag } from "./enums.js";
|
|
4
|
+
import type { AccountRole, IntegrationType, TaskPriority, TaskRelation, ThirdPartyAuthName, ThirdPartyDatabaseName, ThirdPartyPaymentsName, ThirdPartyServiceCategory, ThirdPartyStorageName, UiComponentTag } from "./enums.js";
|
|
5
5
|
/**
|
|
6
6
|
* Types here should reflect data format stored in firestore and
|
|
7
7
|
* either be backwards-compatible or migrated when needed
|
|
@@ -35,6 +35,48 @@ export interface PublicUsername {
|
|
|
35
35
|
slug: string;
|
|
36
36
|
claimedAt: Timestamp;
|
|
37
37
|
}
|
|
38
|
+
export interface AccountBase {
|
|
39
|
+
createdBy: PerformedBy;
|
|
40
|
+
lastUpdatedBy: PerformedBy;
|
|
41
|
+
/**
|
|
42
|
+
* Owner ID of the account (a user ID)
|
|
43
|
+
*/
|
|
44
|
+
owner: string;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the account has a valid plan (regardless of credits left)
|
|
47
|
+
*/
|
|
48
|
+
hasValidPlan: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A list of account IDs that the user is at least a member of
|
|
52
|
+
*/
|
|
53
|
+
export interface AccountList {
|
|
54
|
+
accountIds: string[];
|
|
55
|
+
}
|
|
56
|
+
export interface PersonalAccount extends AccountBase {
|
|
57
|
+
type: "personal";
|
|
58
|
+
}
|
|
59
|
+
export interface OrganizationAccount extends AccountBase {
|
|
60
|
+
type: "organization";
|
|
61
|
+
/**
|
|
62
|
+
* Name of the account
|
|
63
|
+
*/
|
|
64
|
+
name: string;
|
|
65
|
+
/**
|
|
66
|
+
* Parent account ID if the account is a sub-account
|
|
67
|
+
* For example used for consolidated billing, quota management and audit logs
|
|
68
|
+
*/
|
|
69
|
+
parentId: string | null;
|
|
70
|
+
}
|
|
71
|
+
export interface AccountMember {
|
|
72
|
+
createdBy: PerformedBy;
|
|
73
|
+
lastUpdatedBy: PerformedBy;
|
|
74
|
+
roles: Array<AccountRole>;
|
|
75
|
+
}
|
|
76
|
+
export interface AccountMemberRole {
|
|
77
|
+
createdBy: PerformedBy;
|
|
78
|
+
}
|
|
79
|
+
export type Account = PersonalAccount | OrganizationAccount;
|
|
38
80
|
export type ToSVersion = "2024-02-13";
|
|
39
81
|
export interface Profile {
|
|
40
82
|
displayName: string;
|