@firebase-function-kits/delete-user-data 0.0.1 → 0.0.2-rc.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/README.md +220 -0
  3. package/lib/config.d.ts +22 -0
  4. package/lib/config.d.ts.map +1 -0
  5. package/lib/config.js +153 -0
  6. package/lib/config.js.map +1 -0
  7. package/lib/events.d.ts +18 -0
  8. package/lib/events.d.ts.map +1 -0
  9. package/lib/events.js +71 -0
  10. package/lib/events.js.map +1 -0
  11. package/lib/export-config.d.ts +55 -0
  12. package/lib/export-config.d.ts.map +1 -0
  13. package/lib/export-config.js +56 -0
  14. package/lib/export-config.js.map +1 -0
  15. package/lib/handlers.d.ts +35 -0
  16. package/lib/handlers.d.ts.map +1 -0
  17. package/lib/handlers.js +243 -0
  18. package/lib/handlers.js.map +1 -0
  19. package/lib/helpers.d.ts +19 -0
  20. package/lib/helpers.d.ts.map +1 -0
  21. package/lib/helpers.js +39 -0
  22. package/lib/helpers.js.map +1 -0
  23. package/lib/index.d.ts +6 -0
  24. package/lib/index.d.ts.map +1 -0
  25. package/lib/index.js +112 -0
  26. package/lib/index.js.map +1 -0
  27. package/lib/lib.d.ts +23 -0
  28. package/lib/lib.d.ts.map +1 -0
  29. package/lib/lib.js +38 -0
  30. package/lib/lib.js.map +1 -0
  31. package/lib/logs.d.ts +26 -0
  32. package/lib/logs.d.ts.map +1 -0
  33. package/lib/logs.js +116 -0
  34. package/lib/logs.js.map +1 -0
  35. package/lib/recursiveDelete.d.ts +18 -0
  36. package/lib/recursiveDelete.d.ts.map +1 -0
  37. package/lib/recursiveDelete.js +37 -0
  38. package/lib/recursiveDelete.js.map +1 -0
  39. package/lib/runBatchPubSubDeletions.d.ts +27 -0
  40. package/lib/runBatchPubSubDeletions.d.ts.map +1 -0
  41. package/lib/runBatchPubSubDeletions.js +47 -0
  42. package/lib/runBatchPubSubDeletions.js.map +1 -0
  43. package/lib/runCustomSearchFunction.d.ts +18 -0
  44. package/lib/runCustomSearchFunction.d.ts.map +1 -0
  45. package/lib/runCustomSearchFunction.js +78 -0
  46. package/lib/runCustomSearchFunction.js.map +1 -0
  47. package/lib/search.d.ts +19 -0
  48. package/lib/search.d.ts.map +1 -0
  49. package/lib/search.js +29 -0
  50. package/lib/search.js.map +1 -0
  51. package/npm-shrinkwrap.json +4167 -0
  52. package/package.json +37 -4
  53. package/src/config.ts +188 -0
  54. package/src/events.ts +38 -0
  55. package/src/export-config.ts +112 -0
  56. package/src/handlers.ts +271 -0
  57. package/src/helpers.ts +42 -0
  58. package/src/index.ts +100 -0
  59. package/src/lib.ts +41 -0
  60. package/src/logs.ts +127 -0
  61. package/src/recursiveDelete.ts +42 -0
  62. package/src/runBatchPubSubDeletions.ts +66 -0
  63. package/src/runCustomSearchFunction.ts +50 -0
  64. package/src/search.ts +37 -0
  65. package/tests/config.test.ts +180 -0
  66. package/tests/export-config.test.ts +117 -0
  67. package/tests/fakes.ts +325 -0
  68. package/tests/handlers.test.ts +517 -0
  69. package/tests/helpers.test.ts +126 -0
  70. package/tests/lib.test.ts +40 -0
  71. package/tests/recursiveDelete.test.ts +102 -0
  72. package/tests/runBatchPubSubDeletions.test.ts +164 -0
  73. package/tests/runCustomSearchFunction.test.ts +125 -0
  74. package/tests/search.test.ts +127 -0
  75. package/tsconfig.json +18 -0
  76. package/tsconfig.tsbuildinfo +1 -0
  77. package/index.js +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1 @@
1
+ - Initial release of kit, see README for differences between the legacy extension and this kit
package/README.md ADDED
@@ -0,0 +1,220 @@
1
+ # @firebase/delete-user-data
2
+
3
+ Delete user data across Firestore, RTDB, and Storage on account deletion. This
4
+ is the Delete User Data Firebase Extension as an npm package you add to your own
5
+ Firebase Functions codebase and deploy.
6
+
7
+ It listens for Firebase Auth user deletions, discovers configured (and optional
8
+ auto-discovered) paths containing the user id, and clears matching data in
9
+ Firestorestore, Realtime Database, and Cloud Storage. The functions run in your own
10
+ Firebase project; there is no hosted version, so you deploy them yourself.
11
+
12
+ ## Install
13
+
14
+ ```sh
15
+ npm install @firebase/delete-user-data
16
+ ```
17
+
18
+ ## Required IAM
19
+
20
+ Deploy needs these Google Cloud roles on the function's service account.
21
+ Firebase CLI 15.23.0 or later creates that account, grants the roles below,
22
+ and attaches it to every function in this kit. Do not set a custom runtime
23
+ service account for this codebase — it conflicts with that automatic setup.
24
+
25
+ | Role | Why |
26
+ |---|---|
27
+ | `roles/datastore.owner` | discover and delete Firestore user data |
28
+ | `roles/firebasedatabase.admin` | delete Realtime Database user data |
29
+ | `roles/storage.admin` | delete Cloud Storage user objects |
30
+ | `roles/pubsub.admin` | publish/subscribe discovery and deletion topics |
31
+ | `roles/eventarc.eventReceiver` | receive Gen2 event triggers |
32
+ | `roles/run.invoker` | allow Eventarc to invoke the Gen2 Cloud Run service |
33
+
34
+ ## Usage
35
+
36
+ Export the functions from your functions codebase entry:
37
+
38
+ ```ts
39
+ // functions/src/index.ts
40
+ export {
41
+ clearData,
42
+ handleSearch,
43
+ handleDeletion,
44
+ } from "@firebase/delete-user-data";
45
+ ```
46
+
47
+ and configure with a `.env` (or `.env.<projectId>`).
48
+
49
+ Importing the package without exporting its functions deploys nothing — the CLI
50
+ only deploys what your entry file exports.
51
+
52
+ ## Deploy
53
+
54
+ The package's `firebase.json` declares a `kit` stanza (Firebase CLI 15.25.1 or
55
+ later, behind the `kits` experiment):
56
+
57
+ ```json
58
+ {
59
+ "functions": [
60
+ {
61
+ "source": ".",
62
+ "kit": "delete-user-data",
63
+ "instances": {
64
+ "default": "."
65
+ }
66
+ }
67
+ ]
68
+ }
69
+ ```
70
+
71
+ `instances` maps each instance id to the directory (relative to
72
+ `firebase.json`) holding that instance's `.env`. The CLI prefixes every
73
+ function and task queue name with `kit-<instance id>-`, so the functions above
74
+ deploy as `kit-default-clearData`, `kit-default-handleSearch`, and
75
+ `kit-default-handleDeletion`.
76
+
77
+ ```sh
78
+ firebase experiments:enable kits
79
+ firebase deploy --only functions
80
+ ```
81
+
82
+ Deploy a single instance with `firebase deploy --only functions:<instance id>`.
83
+
84
+ ## Configuration
85
+
86
+ Set these values in a `.env` (or `.env.<projectId>`) file. The Firebase CLI
87
+ loads them at deploy time and prompts for any required values that are missing.
88
+
89
+ | Field | Env var | Required | Default | Description |
90
+ |---|---|---|---|---|
91
+ | `instanceId` | `INSTANCE_ID` | yes | — | Must match this instance's key in the `instances` map |
92
+ | `firestorePaths` | `FIRESTORE_PATHS` | no | (empty) | Comma-separated Firestore paths with `{UID}` |
93
+ | `firestoreDatabaseId` | `FIRESTORE_DATABASE_ID` | no | `(default)` | Firestore database id |
94
+ | `firestoreDeleteMode` | `FIRESTORE_DELETE_MODE` | no | `shallow` | `shallow` or `recursive` |
95
+ | `rtdbInstance` | `SELECTED_DATABASE_INSTANCE` | no | (empty) | RTDB instance id |
96
+ | `rtdbLocation` | `SELECTED_DATABASE_LOCATION` | no | `us-central1` | RTDB location |
97
+ | `rtdbPaths` | `RTDB_PATHS` | no | (empty) | Comma-separated RTDB paths with `{UID}` |
98
+ | `storageBucket` | `CLOUD_STORAGE_BUCKET` | no | default Storage bucket | Bucket to clear |
99
+ | `storagePaths` | `STORAGE_PATHS` | no | (empty) | Comma-separated Storage paths with `{UID}` |
100
+ | `enableAutoDiscovery` | `ENABLE_AUTO_DISCOVERY` | no | `false` | Auto-discover user-linked docs |
101
+ | `searchDepth` | `AUTO_DISCOVERY_SEARCH_DEPTH` | no | `3` | Discovery depth |
102
+ | `searchFields` | `AUTO_DISCOVERY_SEARCH_FIELDS` | no | `id,uid,userId` | Fields treated as user ids |
103
+ | `searchFunction` | `SEARCH_FUNCTION` | no | (empty) | Optional custom search function |
104
+ | `discoveryTopicName` | `DISCOVERY_TOPIC_NAME` | no | `kit-<INSTANCE_ID>-discovery` | Pub/Sub discovery topic |
105
+ | `deletionTopicName` | `DELETION_TOPIC_NAME` | no | `kit-<INSTANCE_ID>-deletion` | Pub/Sub deletion topic |
106
+
107
+ ## Multiple instances
108
+
109
+ To run several deletion pipelines, add one entry per instance to the `instances`
110
+ map, each pointing at its own config directory with its own `.env`:
111
+
112
+ ```json
113
+ {
114
+ "functions": [
115
+ {
116
+ "source": ".",
117
+ "kit": "delete-user-data",
118
+ "instances": {
119
+ "app": "instances/app",
120
+ "admin": "instances/admin"
121
+ }
122
+ }
123
+ ]
124
+ }
125
+ ```
126
+
127
+ Instance ids must be unique across all kit stanzas in the project, and every
128
+ instance's function names are namespaced by its `kit-<instance id>-` prefix, so
129
+ the instances cannot collide. Set `INSTANCE_ID` in each config directory to the
130
+ same value as that directory's key in the `instances` map.
131
+
132
+ ## Events
133
+
134
+ When `EVENTARC_CHANNEL` is configured, the functions publish deletion events
135
+ for each backend under `firebase.extensions.delete-user-data.v1.*`
136
+ (`firestore`, `database`, and `storage`).
137
+
138
+ ## Differences from the Delete User Data extension
139
+
140
+ This kit is the extension repackaged as an npm package, but a few things behave
141
+ differently. If you are moving from an installed extension instance, read this
142
+ section before you deploy.
143
+
144
+ ### Auto-discovery uses `true` / `false`
145
+
146
+ `ENABLE_AUTO_DISCOVERY` is a boolean param, and only the literal string `true`
147
+ enables it. The extension used `yes` / `no`, so copying an old config across
148
+ leaves auto-discovery silently switched off. Change `yes` to `true` in your
149
+ `.env`.
150
+
151
+ ### You set `INSTANCE_ID` yourself
152
+
153
+ The extension derived an instance id at install time and used it to name the
154
+ Pub/Sub topics. Here it is a setting you provide, and it must match this
155
+ instance's key in the `instances` map in `firebase.json`. If the two disagree,
156
+ auto-discovery publishes to a topic nothing is listening on.
157
+
158
+ ### Pub/Sub topics are named differently
159
+
160
+ Discovery and deletion topics are now `kit-<INSTANCE_ID>-discovery` and
161
+ `kit-<INSTANCE_ID>-deletion`, where the extension used an `ext-` prefix. The
162
+ Firebase CLI creates them for you on deploy, so there is no manual setup step,
163
+ but the old topics from an extension install are not reused and can be deleted
164
+ once you have migrated.
165
+
166
+ You can also override both names with `DISCOVERY_TOPIC_NAME` and
167
+ `DELETION_TOPIC_NAME`, which the extension did not allow. Change them together,
168
+ since one function publishes to a topic the other is triggered by.
169
+
170
+ ### Realtime Database deletion no longer needs a database instance
171
+
172
+ The extension only cleared RTDB paths when both `SELECTED_DATABASE_INSTANCE`
173
+ and `SELECTED_DATABASE_LOCATION` were set. This kit clears them whenever
174
+ `RTDB_PATHS` is set, falling back to your project's default database when no
175
+ instance is named. Set `SELECTED_DATABASE_INSTANCE` explicitly if you are
176
+ targeting a secondary database, and leave `RTDB_PATHS` empty if you do not want
177
+ RTDB touched at all.
178
+
179
+ ### Functions deploy to your default region
180
+
181
+ The extension deployed to the location you picked at install time. This kit
182
+ sets no region, so its functions deploy to your codebase's default
183
+ (`us-central1` unless you have changed it).
184
+
185
+ ### Pub/Sub handlers are 2nd gen
186
+
187
+ `handleSearch` and `handleDeletion` are now 2nd gen functions. `clearData`
188
+ stays 1st gen, because the Firebase Auth `user.delete` trigger has no 2nd gen
189
+ equivalent. This mainly matters if you have infrastructure or alerting keyed to
190
+ function generation.
191
+
192
+ ### Empty search fields no longer error
193
+
194
+ Setting `AUTO_DISCOVERY_SEARCH_FIELDS` to an empty value used to raise an
195
+ invalid field path error during discovery. It is now treated as "match on the
196
+ document path only". The default is unchanged (`id,uid,userId`).
197
+
198
+ ### Unchanged
199
+
200
+ Events are the same. When `EVENTARC_CHANNEL` is configured, the functions still
201
+ publish `firebase.extensions.delete-user-data.v1.firestore`, `.database` and
202
+ `.storage` with the same payloads. Path syntax (`{UID}` substitution, comma
203
+ separated lists, `{DEFAULT}` for the default Storage bucket), the shallow and
204
+ recursive Firestore delete modes, the search depth and field matching rules,
205
+ and the custom `SEARCH_FUNCTION` contract all behave as they did.
206
+
207
+ ## API surface
208
+
209
+ - **Main entry** (`@firebase/delete-user-data`): exports `clearData`,
210
+ `handleSearch`, and `handleDeletion`. The main entry reads environment
211
+ variables when the module loads, so use it from Firebase deploy/emulator/runtime.
212
+ For your own triggers, import from `./lib` instead.
213
+ - **Library entry** (`./lib`): handlers (`handleClear`, `handleSearch`,
214
+ `handleDeletion`), path helpers, search / batch-deletion utilities, and config
215
+ types (`DeleteUserDataConfig`, `resolveDeleteUserDataConfig`) for owning
216
+ trigger registration yourself.
217
+
218
+ ## License
219
+
220
+ Apache-2.0
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright 2026 Google LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { DeleteUserDataConfig } from "./export-config";
17
+ export declare const CONFIG_EXPRESSIONS: {
18
+ readonly discoveryTopicName: import("firebase-functions/params").StringParam;
19
+ readonly deletionTopicName: import("firebase-functions/params").StringParam;
20
+ };
21
+ export declare function configFromEnv(): DeleteUserDataConfig;
22
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAoI5D,eAAO,MAAM,kBAAkB;aAC7B,kBAAkB;aAClB,iBAAiB;CACT,CAAC;AAMX,wBAAgB,aAAa,IAAI,oBAAoB,CAqBpD"}
package/lib/config.js ADDED
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright 2026 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.CONFIG_EXPRESSIONS = void 0;
19
+ exports.configFromEnv = configFromEnv;
20
+ const params_1 = require("firebase-functions/params");
21
+ const instanceId = (0, params_1.defineString)("INSTANCE_ID");
22
+ const params = {
23
+ instanceId,
24
+ firestorePaths: (0, params_1.defineString)("FIRESTORE_PATHS", {
25
+ label: "Cloud Firestore paths",
26
+ description: "Which paths in your Cloud Firestore instance contain data keyed on a user ID? Leave empty if you don't use Cloud Firestore.\nEnter the full paths, separated by commas. Use `{UID}` as a placeholder for the user's UID.\nFor example, if you have the collections `users` and `admins`, and each collection has documents with User ID as document IDs, then enter `users/{UID},admins/{UID}`.",
27
+ default: "",
28
+ input: { text: { example: "users/{UID},admins/{UID}" } },
29
+ }),
30
+ firestoreDatabaseId: (0, params_1.defineString)("FIRESTORE_DATABASE_ID", {
31
+ label: "Firestore Database ID",
32
+ description: 'The ID of the Firestore database to use. Use "(default)" for the default database. You can view your available Firestore databases at https://console.cloud.google.com/firestore/databases.',
33
+ default: "(default)",
34
+ }),
35
+ firestoreDeleteMode: (0, params_1.defineString)("FIRESTORE_DELETE_MODE", {
36
+ label: "Cloud Firestore delete mode",
37
+ description: "(Only applicable if you use the `Cloud Firestore paths` parameter.) How do you want to delete Cloud Firestore documents? To also delete documents in subcollections, set this parameter to `recursive`.",
38
+ default: "shallow",
39
+ input: (0, params_1.select)({ Recursive: "recursive", Shallow: "shallow" }),
40
+ }),
41
+ rtdbInstance: (0, params_1.defineString)("SELECTED_DATABASE_INSTANCE", {
42
+ label: "Realtime Database instance",
43
+ description: "What is the ID of the Realtime Database instance from which you want to delete user data (keyed on user ID)?",
44
+ default: "",
45
+ input: {
46
+ text: {
47
+ example: "my-instance",
48
+ // Extension regex, with an empty branch added: the param is optional.
49
+ validationRegex: /^(?:[^\.\$\#\]\[\/\x00-\x1F\x7F]+|)$/,
50
+ validationErrorMessage: "Invalid database instance. Make sure that you have entered just the instance ID, and not the entire database URL.",
51
+ },
52
+ },
53
+ }),
54
+ rtdbLocation: (0, params_1.defineString)("SELECTED_DATABASE_LOCATION", {
55
+ label: "Realtime Database location",
56
+ description: "(Only applicable if you provided the `Realtime Database instance` parameter.) From which Realtime Database location do you want to delete data keyed on a user ID?",
57
+ default: "us-central1",
58
+ input: (0, params_1.select)({
59
+ "United States": "us-central1",
60
+ Belgium: "europe-west1",
61
+ Singapore: "asia-southeast1",
62
+ }),
63
+ }),
64
+ rtdbPaths: (0, params_1.defineString)("RTDB_PATHS", {
65
+ label: "Realtime Database paths",
66
+ description: "Which paths in your Realtime Database instance contain data keyed on a user ID? Leave empty if you don't use Realtime Database.\nEnter the full paths, separated by commas. Use `{UID}` as a placeholder for the user's UID.\nFor example: `users/{UID},admins/{UID}`.",
67
+ default: "",
68
+ input: { text: { example: "users/{UID},admins/{UID}" } },
69
+ }),
70
+ storageBucket: (0, params_1.defineString)("CLOUD_STORAGE_BUCKET", {
71
+ label: "Cloud Storage bucket",
72
+ description: "Which Google Cloud Storage bucket do you want to delete files from?",
73
+ default: params_1.storageBucket,
74
+ input: {
75
+ text: {
76
+ example: "my-project-12345.appspot.com",
77
+ validationRegex: /^([0-9a-z_.-]*)$/,
78
+ validationErrorMessage: "Invalid storage bucket",
79
+ },
80
+ },
81
+ }),
82
+ storagePaths: (0, params_1.defineString)("STORAGE_PATHS", {
83
+ label: "Cloud Storage paths",
84
+ description: "Where in Google Cloud Storage do you store data keyed on a user ID? Leave empty if you don't use Cloud Storage.\nEnter the full paths to files or directories in your Storage buckets, separated by commas. Use `{UID}` to represent the User ID of the deleted user, and use `{DEFAULT}` to represent your default Storage bucket.\nHere's a series of examples. To delete all the files in your default bucket with the file naming scheme `{UID}-pic.png`, enter `{DEFAULT}/{UID}-pic.png`. To also delete all the files in another bucket called my-app-logs with the file naming scheme `{UID}-logs.txt`, enter `{DEFAULT}/{UID}-pic.png,my-app-logs/{UID}-logs.txt`. To *also* delete a User ID-labeled directory and all its files (like `media/{UID}`), enter `{DEFAULT}/{UID}-pic.png,my-app-logs/{UID}-logs.txt,{DEFAULT}/media/{UID}`.",
85
+ default: "",
86
+ input: {
87
+ text: {
88
+ example: "{DEFAULT}/{UID}-pic.png,my-awesome-app-logs/{UID}-logs.txt",
89
+ },
90
+ },
91
+ }),
92
+ enableAutoDiscovery: (0, params_1.defineBoolean)("ENABLE_AUTO_DISCOVERY", {
93
+ label: "Enable auto discovery",
94
+ description: "Enable the extension to automatically discover Firestore collections and documents to delete.",
95
+ default: false,
96
+ }),
97
+ searchDepth: (0, params_1.defineInt)("AUTO_DISCOVERY_SEARCH_DEPTH", {
98
+ label: "Auto discovery search depth",
99
+ description: "If auto discovery is enabled, how deep should auto discovery find collections and documents. For example, setting to `1` would only discover root collections and documents, whereas setting to `9` would search sub-collections 9 levels deep. Defaults to `3`.",
100
+ default: 3,
101
+ }),
102
+ searchFields: (0, params_1.defineString)("AUTO_DISCOVERY_SEARCH_FIELDS", {
103
+ label: "Auto discovery search fields",
104
+ description: "If auto discovery is enabled, specify what document fields are used to associate the UID with the document. The extension will delete documents where the value for one or more of these fields matches the deleting user’s UID. If left empty, document fields will not be used in auto discovery.",
105
+ default: "id,uid,userId",
106
+ }),
107
+ searchFunction: (0, params_1.defineString)("SEARCH_FUNCTION", {
108
+ label: "Search function URL",
109
+ description: "Specify a URL to call that will return a list of document paths to delete. The extension will send a `POST` request to the specified `URL`, with the `uid` of the deleted user will be provided in the body of the request. The endpoint specified should return an array of firestore paths to delete.",
110
+ default: "",
111
+ input: {
112
+ text: {
113
+ example: "https://us-west1-my-project-id.cloudfunctions.net/myTransformFunction",
114
+ },
115
+ },
116
+ }),
117
+ // Non-empty defaults so Pub/Sub trigger bindings resolve during deploy
118
+ // discovery without freezing an empty topic name into the manifest.
119
+ discoveryTopicName: (0, params_1.defineString)("DISCOVERY_TOPIC_NAME", {
120
+ default: (0, params_1.expr) `kit-${instanceId}-discovery`,
121
+ }),
122
+ deletionTopicName: (0, params_1.defineString)("DELETION_TOPIC_NAME", {
123
+ default: (0, params_1.expr) `kit-${instanceId}-deletion`,
124
+ }),
125
+ };
126
+ exports.CONFIG_EXPRESSIONS = {
127
+ discoveryTopicName: params.discoveryTopicName,
128
+ deletionTopicName: params.deletionTopicName,
129
+ };
130
+ function optional(value) {
131
+ return value.length > 0 ? value : undefined;
132
+ }
133
+ function configFromEnv() {
134
+ return {
135
+ firestorePaths: optional(params.firestorePaths.value()),
136
+ firestoreDatabaseId: params.firestoreDatabaseId.value(),
137
+ firestoreDeleteMode: params.firestoreDeleteMode.value(),
138
+ rtdbInstance: optional(params.rtdbInstance.value()),
139
+ rtdbLocation: optional(params.rtdbLocation.value()),
140
+ rtdbPaths: optional(params.rtdbPaths.value()),
141
+ storageBucket: optional(params.storageBucket.value()) ?? process.env.STORAGE_BUCKET,
142
+ storagePaths: optional(params.storagePaths.value()),
143
+ enableAutoDiscovery: params.enableAutoDiscovery.value(),
144
+ searchDepth: params.searchDepth.value(),
145
+ searchFields: params.searchFields.value(),
146
+ searchFunction: optional(params.searchFunction.value()),
147
+ instanceId: params.instanceId.value(),
148
+ discoveryTopicName: optional(params.discoveryTopicName.value()),
149
+ deletionTopicName: optional(params.deletionTopicName.value()),
150
+ projectId: params_1.projectID.value(),
151
+ };
152
+ }
153
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH,sDAQmC;AAGnC,MAAM,UAAU,GAAG,IAAA,qBAAY,EAAC,aAAa,CAAC,CAAC;AAE/C,MAAM,MAAM,GAAG;IACb,UAAU;IACV,cAAc,E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MAAM,CAAC,WAAW,CAAC,KAAK,EAAE;QACvC,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE;QACzC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QACvD,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE;QACrC,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAC/D,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAC7D,SAAS,EAAE,kBAAS,CAAC,KAAK,EAAE;KAC7B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2026 Google LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare const setupEventChannel: () => void;
17
+ export declare function publishDeletionEvent(target: "firestore" | "database" | "storage", data: object): Promise<unknown>;
18
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,eAAO,MAAM,iBAAiB,QAAO,IAMpC,CAAC;AAEF,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,WAAW,GAAG,UAAU,GAAG,SAAS,EAC5C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CAMlB"}
package/lib/events.js ADDED
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright 2026 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
30
+ }) : function(o, v) {
31
+ o["default"] = v;
32
+ });
33
+ var __importStar = (this && this.__importStar) || (function () {
34
+ var ownKeys = function(o) {
35
+ ownKeys = Object.getOwnPropertyNames || function (o) {
36
+ var ar = [];
37
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
38
+ return ar;
39
+ };
40
+ return ownKeys(o);
41
+ };
42
+ return function (mod) {
43
+ if (mod && mod.__esModule) return mod;
44
+ var result = {};
45
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
46
+ __setModuleDefault(result, mod);
47
+ return result;
48
+ };
49
+ })();
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.setupEventChannel = void 0;
52
+ exports.publishDeletionEvent = publishDeletionEvent;
53
+ const eventArc = __importStar(require("firebase-admin/eventarc"));
54
+ let eventChannel;
55
+ const setupEventChannel = () => {
56
+ eventChannel = process.env.EVENTARC_CHANNEL
57
+ ? eventArc.getEventarc().channel(process.env.EVENTARC_CHANNEL, {
58
+ allowedEventTypes: process.env.EXT_SELECTED_EVENTS,
59
+ })
60
+ : undefined;
61
+ };
62
+ exports.setupEventChannel = setupEventChannel;
63
+ async function publishDeletionEvent(target, data) {
64
+ if (!eventChannel)
65
+ return Promise.resolve();
66
+ return eventChannel.publish({
67
+ type: `firebase.extensions.delete-user-data.v1.${target}`,
68
+ data,
69
+ });
70
+ }
71
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,MAAY,QAAQ,oDAAgC;AAEpD,IAAI,YAA0C,CAAC;AAExC,MAAM,iBAAiB,GAAG,GAAS,EAAE;IAC1C,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB;QACzC,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE;YAC3D,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB;SACnD,CAAC;QACJ,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC,CAAC;AANW,QAAA,iBAAiB,GAAjB,iBAAiB,CAM5B;AAEK,KAAK,+BACV,MAA4C,EAC5C,IAAY;IAEZ,IAAI,CAAC,YAAY;QAAE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC5C,OAAO,YAAY,CAAC,OAAO,CAAC;QAC1B,IAAI,EAAE,2CAA2C,MAAM,EAAE;QACzD,IAAI;KACL,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Copyright 2026 Google LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export type FirestoreDeleteMode = "recursive" | "shallow";
17
+ export interface DeleteUserDataConfig {
18
+ firestorePaths?: string;
19
+ firestoreDatabaseId?: string;
20
+ firestoreDeleteMode?: FirestoreDeleteMode;
21
+ rtdbInstance?: string;
22
+ rtdbLocation?: string;
23
+ rtdbPaths?: string;
24
+ storageBucket?: string;
25
+ storagePaths?: string;
26
+ enableAutoDiscovery?: boolean;
27
+ searchDepth?: number;
28
+ searchFields?: string;
29
+ searchFunction?: string;
30
+ instanceId: string;
31
+ discoveryTopicName?: string;
32
+ deletionTopicName?: string;
33
+ projectId?: string;
34
+ }
35
+ export interface ResolvedDeleteUserDataConfig {
36
+ firestorePaths?: string;
37
+ firestoreDatabaseId: string;
38
+ firestoreDeleteMode: FirestoreDeleteMode;
39
+ rtdbInstance?: string;
40
+ rtdbLocation?: string;
41
+ rtdbPaths?: string;
42
+ storageBucket?: string;
43
+ storagePaths?: string;
44
+ enableAutoDiscovery: boolean;
45
+ searchDepth: number;
46
+ searchFields: string;
47
+ searchFunction?: string;
48
+ instanceId: string;
49
+ discoveryTopicName: string;
50
+ deletionTopicName: string;
51
+ projectId?: string;
52
+ }
53
+ export declare function resolveDeleteUserDataConfig(config: DeleteUserDataConfig): ResolvedDeleteUserDataConfig;
54
+ export declare function getDatabaseUrl(selectedDatabaseInstance: string | undefined, selectedDatabaseLocation: string | undefined): string | null;
55
+ //# sourceMappingURL=export-config.d.ts.map
@@ -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;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAcD,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,oBAAoB,GAC3B,4BAA4B,CA8B9B;AAED,wBAAgB,cAAc,CAC5B,wBAAwB,EAAE,MAAM,GAAG,SAAS,EAC5C,wBAAwB,EAAE,MAAM,GAAG,SAAS,GAC3C,MAAM,GAAG,IAAI,CAMf"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright 2026 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.resolveDeleteUserDataConfig = resolveDeleteUserDataConfig;
19
+ exports.getDatabaseUrl = getDatabaseUrl;
20
+ const DEFAULT_FIRESTORE_DATABASE_ID = "(default)";
21
+ const DEFAULT_FIRESTORE_DELETE_MODE = "shallow";
22
+ const DEFAULT_SEARCH_DEPTH = 3;
23
+ const DEFAULT_SEARCH_FIELDS = "id,uid,userId";
24
+ function topicName(name, instanceId, suffix) {
25
+ return name ?? `kit-${instanceId}-${suffix}`;
26
+ }
27
+ function resolveDeleteUserDataConfig(config) {
28
+ const instanceId = config.instanceId;
29
+ return {
30
+ firestorePaths: config.firestorePaths,
31
+ firestoreDatabaseId: config.firestoreDatabaseId ?? DEFAULT_FIRESTORE_DATABASE_ID,
32
+ firestoreDeleteMode: config.firestoreDeleteMode ?? DEFAULT_FIRESTORE_DELETE_MODE,
33
+ rtdbInstance: config.rtdbInstance,
34
+ rtdbLocation: config.rtdbLocation,
35
+ rtdbPaths: config.rtdbPaths,
36
+ storageBucket: config.storageBucket,
37
+ storagePaths: config.storagePaths,
38
+ enableAutoDiscovery: config.enableAutoDiscovery ?? false,
39
+ searchDepth: config.searchDepth ?? DEFAULT_SEARCH_DEPTH,
40
+ searchFields: config.searchFields ?? DEFAULT_SEARCH_FIELDS,
41
+ searchFunction: config.searchFunction,
42
+ instanceId,
43
+ discoveryTopicName: topicName(config.discoveryTopicName, instanceId, "discovery"),
44
+ deletionTopicName: topicName(config.deletionTopicName, instanceId, "deletion"),
45
+ projectId: config.projectId,
46
+ };
47
+ }
48
+ function getDatabaseUrl(selectedDatabaseInstance, selectedDatabaseLocation) {
49
+ if (!selectedDatabaseLocation || !selectedDatabaseInstance)
50
+ return null;
51
+ if (selectedDatabaseLocation === "us-central1") {
52
+ return `https://${selectedDatabaseInstance}.firebaseio.com`;
53
+ }
54
+ return `https://${selectedDatabaseInstance}.${selectedDatabaseLocation}.firebasedatabase.app`;
55
+ }
56
+ //# sourceMappingURL=export-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-config.js","sourceRoot":"","sources":["../src/export-config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AA0CH,MAAM,6BAA6B,GAAG,WAAW,CAAC;AAClD,MAAM,6BAA6B,GAAwB,SAAS,CAAC;AACrE,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAC9C,SAAS,SAAS,CAChB,IAAwB,EACxB,UAAkB,EAClB,MAAc;IAEd,OAAO,IAAI,IAAI,OAAO,UAAU,IAAI,MAAM,EAAE,CAAC;AAC/C,CAAC;AAED,qCACE,MAA4B;IAE5B,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IACrC,OAAO;QACL,cAAc,EAAE,MAAM,C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