@snorreks/firestack 0.0.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 (48) hide show
  1. package/README.md +134 -0
  2. package/index.d.ts +8 -0
  3. package/index.d.ts.map +1 -0
  4. package/index.js +106 -0
  5. package/lib/constants/builders.d.ts +2 -0
  6. package/lib/constants/builders.d.ts.map +1 -0
  7. package/lib/constants/directories.d.ts +2 -0
  8. package/lib/constants/directories.d.ts.map +1 -0
  9. package/lib/constants/function-types.d.ts +8 -0
  10. package/lib/constants/function-types.d.ts.map +1 -0
  11. package/lib/constants/index.d.ts +4 -0
  12. package/lib/constants/index.d.ts.map +1 -0
  13. package/lib/helpers/auth.d.ts +31 -0
  14. package/lib/helpers/auth.d.ts.map +1 -0
  15. package/lib/helpers/database.d.ts +40 -0
  16. package/lib/helpers/database.d.ts.map +1 -0
  17. package/lib/helpers/firestore.d.ts +26 -0
  18. package/lib/helpers/firestore.d.ts.map +1 -0
  19. package/lib/helpers/https.d.ts +29 -0
  20. package/lib/helpers/https.d.ts.map +1 -0
  21. package/lib/helpers/scheduler.d.ts +4 -0
  22. package/lib/helpers/scheduler.d.ts.map +1 -0
  23. package/lib/helpers/storage.d.ts +50 -0
  24. package/lib/helpers/storage.d.ts.map +1 -0
  25. package/lib/types/build.d.ts +56 -0
  26. package/lib/types/build.d.ts.map +1 -0
  27. package/lib/types/checksum.d.ts +10 -0
  28. package/lib/types/checksum.d.ts.map +1 -0
  29. package/lib/types/core.d.ts +45 -0
  30. package/lib/types/core.d.ts.map +1 -0
  31. package/lib/types/deploy.d.ts +166 -0
  32. package/lib/types/deploy.d.ts.map +1 -0
  33. package/lib/types/firebase-auth-v2.d.ts +30 -0
  34. package/lib/types/firebase-auth-v2.d.ts.map +1 -0
  35. package/lib/types/function-types.d.ts +11 -0
  36. package/lib/types/function-types.d.ts.map +1 -0
  37. package/lib/types/functions-cache.d.ts +31 -0
  38. package/lib/types/functions-cache.d.ts.map +1 -0
  39. package/lib/types/helper-generics.d.ts +20 -0
  40. package/lib/types/helper-generics.d.ts.map +1 -0
  41. package/lib/types/helper-options.d.ts +81 -0
  42. package/lib/types/helper-options.d.ts.map +1 -0
  43. package/lib/types/index.d.ts +10 -0
  44. package/lib/types/index.d.ts.map +1 -0
  45. package/lib/types/script.d.ts +6 -0
  46. package/lib/types/script.d.ts.map +1 -0
  47. package/main.js +1661 -0
  48. package/package.json +28 -0
package/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # firestack<!-- omit in toc -->
2
+
3
+ [![npm](https://img.shields.io/npm/v/@snorreks/firestack)](https://www.npmjs.com/package/@snorreks/firestack)
4
+
5
+ Firestack is a CLI tool for deploying Firebase Cloud Functions with ease. Write your functions in TypeScript and deploy them seamlessly to Google Cloud Functions (v2), leveraging esbuild for optimal performance.
6
+
7
+ ## Features
8
+
9
+ - **TypeScript First**: Write functions in standard TypeScript.
10
+ - **Auto-Discovery**: Automatically finds and deploys functions based on your file structure.
11
+ - **Optimized Builds**: Uses esbuild to bundle functions into small, efficient packages.
12
+ - **Multi-Environment**: Robust flavor support (development/production).
13
+ - **Rules & Indexes**: Deploy Firestore and Storage rules automatically.
14
+ - **Emulator Support**: Run Firebase emulators with live reload.
15
+ - **Init Scripts**: Populate Firestore with seed data during emulation.
16
+ - **Moon Support**: Works great with moonrepo monorepos.
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ npm install @snorreks/firestack
22
+ # or
23
+ bun add @snorreks/firestack
24
+ ```
25
+
26
+ ## Quick Start
27
+
28
+ ### 1. Setup Configuration
29
+
30
+ Create a `firestack.json` in your functions directory:
31
+
32
+ ```json
33
+ {
34
+ "flavors": {
35
+ "development": "my-project-dev",
36
+ "production": "my-project-prod"
37
+ },
38
+ "region": "us-central1",
39
+ "functionsDirectory": "src/controllers",
40
+ "rulesDirectory": "src/rules",
41
+ "scriptsDirectory": "scripts",
42
+ "nodeVersion": "20"
43
+ }
44
+ ```
45
+
46
+ ### 2. Create a Function
47
+
48
+ Create a file in your functions directory (default: `src/controllers`):
49
+
50
+ ```typescript
51
+ // src/controllers/api/hello.ts
52
+ import { onRequest } from '@snorreks/firestack';
53
+
54
+ export default onRequest((req, res) => {
55
+ res.send({ message: "Hello from Firestack!" });
56
+ }, {
57
+ region: 'europe-west1'
58
+ });
59
+ ```
60
+
61
+ ### 3. Deploy
62
+
63
+ ```bash
64
+ firestack deploy --flavor development
65
+ ```
66
+
67
+ ## Commands
68
+
69
+ | Command | Description |
70
+ |---------|-------------|
71
+ | `firestack build` | Build functions for local development |
72
+ | `firestack deploy` | Build and deploy functions to Firebase |
73
+ | `firestack delete` | Delete unused functions |
74
+ | `firestack emulate` | Run Firebase emulators with live reload |
75
+ | `firestack rules` | Deploy Firestore and Storage rules |
76
+ | `firestack scripts` | Run scripts from the scripts directory |
77
+ | `firestack logs` | View function logs |
78
+
79
+ ## Folder Structure
80
+
81
+ ```
82
+ src/
83
+ ├── controllers/ # Cloud Functions
84
+ │ ├── api/ # HTTP functions
85
+ │ ├── firestore/ # Firestore triggers
86
+ │ ├── scheduler/ # Scheduled tasks
87
+ │ └── auth/ # Auth triggers
88
+ ├── rules/ # Firestore & Storage rules
89
+ │ ├── firestore.rules
90
+ │ ├── firestore.indexes.json
91
+ │ └── storage.rules
92
+ └── scripts/ # Deployment scripts
93
+ └── init.ts # Emulator init script
94
+ ```
95
+
96
+ ## Configuration
97
+
98
+ ### firestack.json Options
99
+
100
+ | Option | Type | Default | Description |
101
+ |--------|------|---------|-------------|
102
+ | `flavors` | object | `{}` | Map of flavor names to project IDs |
103
+ | `region` | string | `us-central1` | Default region for functions |
104
+ | `functionsDirectory` | string | `src/controllers` | Where functions are located |
105
+ | `rulesDirectory` | string | `src/rules` | Where rules files are located |
106
+ | `scriptsDirectory` | string | `scripts` | Where scripts are located |
107
+ | `initScript` | string | `init.ts` | Script to run before emulator |
108
+ | `nodeVersion` | string | `20` | Node.js runtime version |
109
+ | `minify` | boolean | `true` | Minify bundled functions |
110
+
111
+ ### Common CLI Options
112
+
113
+ - `--flavor`: Target environment (e.g., `production`, `development`)
114
+ - `--only`: Deploy specific functions (comma-separated)
115
+ - `--force`: Force deploy all functions, ignoring cache
116
+ - `--dry-run`: Build without deploying
117
+
118
+ ## Emulator
119
+
120
+ Run emulators with:
121
+ ```bash
122
+ firestack emulate
123
+ ```
124
+
125
+ The emulator will:
126
+ 1. Run your init script (if exists) to populate Firestore
127
+ 2. Build all functions
128
+ 3. Start Firebase emulators with live reload
129
+
130
+ Use `--no-init` to skip the init script, or `--no-watch` to disable file watching.
131
+
132
+ ## License
133
+
134
+ MIT
package/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export * from './lib/helpers/auth.js';
2
+ export * from './lib/helpers/database.js';
3
+ export * from './lib/helpers/firestore.js';
4
+ export * from './lib/helpers/https.js';
5
+ export * from './lib/helpers/scheduler.js';
6
+ export * from './lib/helpers/storage.js';
7
+ export * from './lib/types/index.js';
8
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC"}
package/index.js ADDED
@@ -0,0 +1,106 @@
1
+ // src/lib/helpers/auth.ts
2
+ var onAuthCreate = (handler, _options) => handler;
3
+ var onAuthDelete = (handler, _options) => handler;
4
+ var beforeAuthCreate = (handler, _options) => handler;
5
+ var beforeAuthSignIn = (handler, _options) => handler;
6
+
7
+ // src/lib/helpers/database.ts
8
+ var onValueCreated = (handler, _options) => handler;
9
+ var onValueDeleted = (handler, _options) => handler;
10
+ var onValueUpdated = (handler, _options) => handler;
11
+ var onValueWritten = (handler, _options) => handler;
12
+
13
+ // src/lib/helpers/firestore.ts
14
+ var onDocumentCreated = (handler, _options) => handler;
15
+ var onDocumentDeleted = (handler, _options) => handler;
16
+ var onDocumentUpdated = (handler, _options) => handler;
17
+ var onDocumentWritten = (handler, _options) => handler;
18
+ var onCreated = (handler, _options) => {
19
+ return (event) => {
20
+ if (!event.data) {
21
+ throw new Error("No data found in event");
22
+ }
23
+ return handler({
24
+ ...event,
25
+ data: toCoreData(event.data)
26
+ });
27
+ };
28
+ };
29
+ var onDeleted = (handler, _options) => {
30
+ return (event) => {
31
+ if (!event.data) {
32
+ throw new Error("No data found in event");
33
+ }
34
+ return handler({
35
+ ...event,
36
+ data: toCoreData(event.data)
37
+ });
38
+ };
39
+ };
40
+ var onUpdated = (handler, _options) => {
41
+ return (event) => {
42
+ if (!event.data?.after || !event.data?.before) {
43
+ throw new Error("No data found in event");
44
+ }
45
+ return handler({
46
+ ...event,
47
+ data: {
48
+ before: toCoreData(event.data.before),
49
+ after: toCoreData(event.data.after)
50
+ }
51
+ });
52
+ };
53
+ };
54
+ var onWritten = (handler, _options) => {
55
+ return (event) => {
56
+ return handler({
57
+ ...event,
58
+ data: {
59
+ before: event.data?.before ? toCoreData(event.data.before) : void 0,
60
+ after: event.data?.after ? toCoreData(event.data.after) : void 0
61
+ }
62
+ });
63
+ };
64
+ };
65
+ var toCoreData = (documentSnap) => ({
66
+ ...documentSnap.data(),
67
+ id: documentSnap.id
68
+ });
69
+
70
+ // src/lib/helpers/https.ts
71
+ var onRequest = (handler, _options) => handler;
72
+ var onCall = (handler, _options) => handler;
73
+
74
+ // src/lib/helpers/scheduler.ts
75
+ var onSchedule = (handler, _options) => handler;
76
+
77
+ // src/lib/helpers/storage.ts
78
+ var onObjectArchived = (handler, _options) => handler;
79
+ var onObjectDeleted = (handler, _options) => handler;
80
+ var onObjectFinalized = (handler, _options) => handler;
81
+ var onObjectMetadataUpdated = (handler, _options) => handler;
82
+ export {
83
+ beforeAuthCreate,
84
+ beforeAuthSignIn,
85
+ onAuthCreate,
86
+ onAuthDelete,
87
+ onCall,
88
+ onCreated,
89
+ onDeleted,
90
+ onDocumentCreated,
91
+ onDocumentDeleted,
92
+ onDocumentUpdated,
93
+ onDocumentWritten,
94
+ onObjectArchived,
95
+ onObjectDeleted,
96
+ onObjectFinalized,
97
+ onObjectMetadataUpdated,
98
+ onRequest,
99
+ onSchedule,
100
+ onUpdated,
101
+ onValueCreated,
102
+ onValueDeleted,
103
+ onValueUpdated,
104
+ onValueWritten,
105
+ onWritten
106
+ };
@@ -0,0 +1,2 @@
1
+ export declare const functionBuilders: readonly ["https", "firestore", "scheduler", "storage", "database", "auth"];
2
+ //# sourceMappingURL=builders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../../src/lib/constants/builders.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,6EAOnB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const deployDirectories: readonly ["api", "https", "callable", "database", "auth", "firestore", "scheduler", "storage"];
2
+ //# sourceMappingURL=directories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directories.d.ts","sourceRoot":"","sources":["../../../src/lib/constants/directories.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,gGASpB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const firestoreFunctions: readonly ["onCreated", "onUpdated", "onDeleted", "onWritten", "onDocumentCreated", "onDocumentUpdated", "onDocumentDeleted", "onDocumentWritten"];
2
+ export declare const databaseFunctions: readonly ["onValueCreated", "onValueDeleted", "onValueUpdated", "onValueWritten"];
3
+ export declare const storageFunctions: readonly ["onObjectArchived", "onObjectDeleted", "onObjectFinalized", "onObjectMetadataUpdated"];
4
+ export declare const authFunctions: readonly ["onAuthCreate", "onAuthDelete", "beforeAuthCreate", "beforeAuthSignIn"];
5
+ export declare const schedulerFunctions: readonly ["onSchedule"];
6
+ export declare const httpsFunctions: readonly ["onCall", "onRequest"];
7
+ export declare const functions: readonly ["onAuthCreate", "onAuthDelete", "beforeAuthCreate", "beforeAuthSignIn", "onValueCreated", "onValueDeleted", "onValueUpdated", "onValueWritten", "onCreated", "onUpdated", "onDeleted", "onWritten", "onDocumentCreated", "onDocumentUpdated", "onDocumentDeleted", "onDocumentWritten", "onObjectArchived", "onObjectDeleted", "onObjectFinalized", "onObjectMetadataUpdated", "onSchedule", "onCall", "onRequest"];
8
+ //# sourceMappingURL=function-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function-types.d.ts","sourceRoot":"","sources":["../../../src/lib/constants/function-types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,mJASrB,CAAC;AAEX,eAAO,MAAM,iBAAiB,mFAKpB,CAAC;AAEX,eAAO,MAAM,gBAAgB,kGAKnB,CAAC;AAEX,eAAO,MAAM,aAAa,mFAKhB,CAAC;AAEX,eAAO,MAAM,kBAAkB,yBAA0B,CAAC;AAE1D,eAAO,MAAM,cAAc,kCAAmC,CAAC;AAE/D,eAAO,MAAM,SAAS,+ZAOZ,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './builders.js';
2
+ export * from './directories.js';
3
+ export * from './function-types.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { EventContext } from 'firebase-functions/v1';
2
+ import type { UserRecord } from 'firebase-functions/v1/auth';
3
+ import type { AuthUserRecord } from 'firebase-functions/v2/identity';
4
+ import type { AuthEventContext, AuthTriggerOptions, BeforeCreateResponse, BeforeSignInResponse } from '../types/index.js';
5
+ /**
6
+ * Responds to the creation of a Firebase Auth user.
7
+ *
8
+ * @param handler Event handler that responds to the creation of a Firebase Auth
9
+ * user.
10
+ */
11
+ export declare const onAuthCreate: (handler: (user: UserRecord, context: EventContext) => PromiseLike<unknown> | unknown, _options?: AuthTriggerOptions) => (user: UserRecord, context: EventContext) => PromiseLike<unknown> | unknown;
12
+ /**
13
+ * Responds to the deletion of a Firebase Auth user.
14
+ *
15
+ * @param handler Event handler that responds to the deletion of a Firebase Auth
16
+ * user.
17
+ */
18
+ export declare const onAuthDelete: (handler: (user: UserRecord, context: EventContext) => PromiseLike<unknown> | unknown, _options?: AuthTriggerOptions) => (user: UserRecord, context: EventContext) => PromiseLike<unknown> | unknown;
19
+ /**
20
+ * Blocks request to create a Firebase Auth user.
21
+ *
22
+ * @param handler Event handler that blocks creation of a Firebase Auth user.
23
+ */
24
+ export declare const beforeAuthCreate: (handler: (user: AuthUserRecord, context: AuthEventContext) => BeforeCreateResponse | void | Promise<BeforeCreateResponse> | Promise<void>, _options?: AuthTriggerOptions) => (user: AuthUserRecord, context: AuthEventContext) => BeforeCreateResponse | void | Promise<BeforeCreateResponse> | Promise<void>;
25
+ /**
26
+ * Blocks request to sign-in a Firebase Auth user.
27
+ *
28
+ * @param handler Event handler that blocks sign-in of a Firebase Auth user.
29
+ */
30
+ export declare const beforeAuthSignIn: (handler: (user: AuthUserRecord, context: AuthEventContext) => BeforeSignInResponse | void | Promise<BeforeSignInResponse> | Promise<void>, _options?: AuthTriggerOptions) => (user: AuthUserRecord, context: AuthEventContext) => BeforeSignInResponse | void | Promise<BeforeSignInResponse> | Promise<void>;
31
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/helpers/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,C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ErE,CAAC"}
@@ -0,0 +1,40 @@
1
+ import type { Change, ParamsOf } from 'firebase-functions/v2/core';
2
+ import type { DatabaseEvent, DataSnapshot } from 'firebase-functions/v2/database';
3
+ import type { ReferenceOptions } from '../types/index.js';
4
+ /**
5
+ * Event handler that fires every time new data is created in Firebase Realtime
6
+ * Database.
7
+ *
8
+ * @param handler Event handler that runs every time new data is created in
9
+ * Firebase Realtime Database.
10
+ * @returns A Cloud DeployFunction that you can export and deploy.
11
+ */
12
+ export declare const onValueCreated: <Ref extends string = string>(handler: (event: DatabaseEvent<DataSnapshot, ParamsOf<Ref>>) => PromiseLike<unknown> | unknown, _options: ReferenceOptions) => (event: DatabaseEvent<DataSnapshot, ParamsOf<Ref>>) => PromiseLike<unknown> | unknown;
13
+ /**
14
+ * Event handler that fires every time data is deleted from Firebase Realtime
15
+ * Database.
16
+ *
17
+ * @param handler Event handler that runs every time data is deleted from
18
+ * Firebase Realtime Database.
19
+ * @returns A Cloud DeployFunction that you can export and deploy.
20
+ */
21
+ export declare const onValueDeleted: <Ref extends string = string>(handler: (event: DatabaseEvent<DataSnapshot, ParamsOf<Ref>>) => PromiseLike<unknown> | unknown, _options: ReferenceOptions) => (event: DatabaseEvent<DataSnapshot, ParamsOf<Ref>>) => PromiseLike<unknown> | unknown;
22
+ /**
23
+ * Event handler that fires every time data is updated in Firebase Realtime
24
+ * Database.
25
+ *
26
+ * @param handler Event handler which is run every time a Firebase Realtime
27
+ * Database write occurs.
28
+ * @returns A Cloud DeployFunction which you can export and deploy.
29
+ */
30
+ export declare const onValueUpdated: <Ref extends string = string>(handler: (event: DatabaseEvent<Change<DataSnapshot>, ParamsOf<Ref>>) => PromiseLike<unknown> | unknown, _options: ReferenceOptions) => (event: DatabaseEvent<Change<DataSnapshot>, ParamsOf<Ref>>) => PromiseLike<unknown> | unknown;
31
+ /**
32
+ * Event handler that fires every time a Firebase Realtime Database write of any
33
+ * kind (creation, update, or delete) occurs.
34
+ *
35
+ * @param handler Event handler that runs every time a Firebase Realtime
36
+ * Database write occurs.
37
+ * @returns A Cloud DeployFunction that you can export and deploy.
38
+ */
39
+ export declare const onValueWritten: <Ref extends string = string>(handler: (event: DatabaseEvent<Change<DataSnapshot>, ParamsOf<Ref>>) => PromiseLike<unknown> | unknown, _options: ReferenceOptions) => (event: DatabaseEvent<Change<DataSnapshot>, ParamsOf<Ref>>) => PromiseLike<unknown> | unknown;
40
+ //# sourceMappingURL=database.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../src/lib/helpers/database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,SAAS,MAAM,GAAG,MAAM,EACxD,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,EAC9F,UAAU,gBAAgB,aADT,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,OAE7E,CAAC;AAEb;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,SAAS,MAAM,GAAG,MAAM,EACxD,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,EAC9F,UAAU,gBAAgB,aADT,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,OAE7E,CAAC;AAEb;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,SAAS,MAAM,GAAG,MAAM,EACxD,SAAS,CACP,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,KACtD,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,EACnC,UAAU,gBAAgB,aAFjB,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,KACtD,WAAW,CAAC,OAAO,CAAC,GAAG,OAElB,CAAC;AAEb;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,SAAS,MAAM,GAAG,MAAM,EACxD,SAAS,CACP,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,KACtD,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,EACnC,UAAU,gBAAgB,aAFjB,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,KACtD,WAAW,CAAC,OAAO,CAAC,GAAG,OAElB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { ParamsOf } from 'firebase-functions/v2/core';
2
+ import type { Change, DocumentSnapshot, FirestoreEvent, QueryDocumentSnapshot } from 'firebase-functions/v2/firestore';
3
+ import type { CoreData, DocumentOptions } from '../types/index.js';
4
+ /** Respond only to document creations. */
5
+ export declare const onDocumentCreated: <Document extends string = string>(handler: (event: FirestoreEvent<QueryDocumentSnapshot | undefined, ParamsOf<Document>>) => PromiseLike<unknown> | unknown, _options?: DocumentOptions) => (event: FirestoreEvent<QueryDocumentSnapshot | undefined, ParamsOf<Document>>) => PromiseLike<unknown> | unknown;
6
+ /** Respond only to document deletions. */
7
+ export declare const onDocumentDeleted: <Document extends string = string>(handler: (event: FirestoreEvent<QueryDocumentSnapshot | undefined, ParamsOf<Document>>) => PromiseLike<unknown> | unknown, _options?: DocumentOptions) => (event: FirestoreEvent<QueryDocumentSnapshot | undefined, ParamsOf<Document>>) => PromiseLike<unknown> | unknown;
8
+ /** Respond only to document updates. */
9
+ export declare const onDocumentUpdated: <Document extends string = string>(handler: (event: FirestoreEvent<Change<QueryDocumentSnapshot> | undefined, ParamsOf<Document>>) => PromiseLike<unknown> | unknown, _options?: DocumentOptions) => (event: FirestoreEvent<Change<QueryDocumentSnapshot> | undefined, ParamsOf<Document>>) => PromiseLike<unknown> | unknown;
10
+ /** Respond to all document writes (creates, updates, or deletes). */
11
+ export declare const onDocumentWritten: <Document extends string = string>(handler: (event: FirestoreEvent<Change<DocumentSnapshot> | undefined, ParamsOf<Document>>) => PromiseLike<unknown> | unknown, _options?: DocumentOptions) => (event: FirestoreEvent<Change<DocumentSnapshot> | undefined, ParamsOf<Document>>) => PromiseLike<unknown> | unknown;
12
+ /** Respond only to document creations. */
13
+ export declare const onCreated: <T extends CoreData>(handler: (event: FirestoreEvent<T>) => PromiseLike<unknown> | unknown, _options?: DocumentOptions) => (event: FirestoreEvent<QueryDocumentSnapshot | undefined, ParamsOf<string>>) => unknown;
14
+ /** Respond only to document deletions. */
15
+ export declare const onDeleted: <T extends CoreData>(handler: (event: FirestoreEvent<T>) => PromiseLike<unknown> | unknown, _options?: DocumentOptions) => (event: FirestoreEvent<QueryDocumentSnapshot | undefined, ParamsOf<string>>) => unknown;
16
+ /** Respond only to document updates. */
17
+ export declare const onUpdated: <T extends CoreData>(handler: (event: FirestoreEvent<{
18
+ before: T;
19
+ after: T;
20
+ }>) => PromiseLike<unknown> | unknown, _options?: DocumentOptions) => (event: FirestoreEvent<Change<QueryDocumentSnapshot> | undefined, ParamsOf<string>>) => unknown;
21
+ /** Respond to all document writes (creates, updates, or deletes). */
22
+ export declare const onWritten: <T extends CoreData>(handler: (event: FirestoreEvent<{
23
+ before?: T;
24
+ after?: T;
25
+ }>) => PromiseLike<unknown> | unknown, _options?: DocumentOptions) => (event: FirestoreEvent<Change<DocumentSnapshot> | undefined, ParamsOf<string>>) => unknown;
26
+ //# sourceMappingURL=firestore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firestore.d.ts","sourceRoot":"","sources":["../../../src/lib/helpers/firestore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EACV,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEnE,0CAA0C;AAC1C,eAAO,MAAM,iBAAiB,GAAI,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChE,SAAS,CACP,KAAK,EAAE,cAAc,CAAC,qBAAqB,GAAG,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,KACzE,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,EACnC,WAAW,eAAe,aAFjB,cAAc,CAAC,qBAAqB,GAAG,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,KACzE,WAAW,CAAC,OAAO,CAAC,GAAG,OAElB,CAAC;AAEb,0CAA0C;AAC1C,eAAO,MAAM,iBAAiB,GAAI,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChE,SAAS,CACP,KAAK,EAAE,cAAc,CAAC,qBAAqB,GAAG,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,KACzE,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,EACnC,WAAW,eAAe,aAFjB,cAAc,CAAC,qBAAqB,GAAG,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,KACzE,WAAW,CAAC,OAAO,CAAC,GAAG,OAElB,CAAC;AAEb,wCAAwC;AACxC,eAAO,MAAM,iBAAiB,GAAI,QAAQ,SAAS,MAAM,GAAG,MAAM,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QAAQ,CAAC,MAAM,CAAC,CAAC,YAUnF,CAAC;AAEF,wCAAwC;AACxC,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,QAAQ,EAC1C,SAAS,CACP,KAAK,EAAE,cAAc,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC;IACV,KAAK,EAAE,CAAC,CAAC;CACV,CAAC,KACC,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,EACnC,WAAW,eAAe,MAElB,OAAO,cAAc,CAAC,MAAM,CAAC,qBAAqB,CAAC,GAAG,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,YAa3F,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,QAAQ,EAC1C,SAAS,CACP,KAAK,EAAE,cAAc,CAAC;IACpB,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,KAAK,CAAC,EAAE,CAAC,CAAC;CACX,CAAC,KACC,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,EACnC,WAAW,eAAe,MAElB,OAAO,cAAc,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,YAStF,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { Buffer } from 'node:buffer';
2
+ import type { Response } from 'express';
3
+ import type { CallableRequest, Request } from 'firebase-functions/v2/https';
4
+ import type { CallableFunctions, HttpsOptions, RequestFunctions } from '../types/index.js';
5
+ interface FirebaseRequest<T extends Record<string, string> = Record<string, string>, ResBody = unknown, ReqBody = unknown> extends Request {
6
+ /** The wire format representation of the request body. */
7
+ rawBody: Buffer;
8
+ body: ReqBody;
9
+ params: T;
10
+ }
11
+ /**
12
+ * Handles HTTPS requests.
13
+ *
14
+ * @param handler - A function that takes a {@link https.Request} and response
15
+ * object, same signature as an Express app.
16
+ * @param _options - Options to set on this function
17
+ * @returns A function that you can export and deploy.
18
+ */
19
+ export declare const onRequest: <AllFunctions extends RequestFunctions, FunctionName extends keyof AllFunctions, Params extends Record<string, string> = Record<string, string>>(handler: (request: FirebaseRequest<Params, AllFunctions[FunctionName][1], AllFunctions[FunctionName][0]>, response: Response<AllFunctions[FunctionName][1]>) => Promise<void> | void, _options?: HttpsOptions<FunctionName>) => (request: FirebaseRequest<Params, AllFunctions[FunctionName][1], AllFunctions[FunctionName][0]>, response: Response<AllFunctions[FunctionName][1]>) => Promise<void> | void;
20
+ /**
21
+ * Declares a callable method for clients to call using a Firebase SDK.
22
+ *
23
+ * @param handler - A function that takes a {@link https.CallableRequest}.
24
+ * @param _options - Options to set on this function.
25
+ * @returns A function that you can export and deploy.
26
+ */
27
+ export declare const onCall: <AllFunctions extends CallableFunctions, FunctionName extends keyof AllFunctions>(handler: (request: CallableRequest<AllFunctions[FunctionName][0]>) => Promise<AllFunctions[FunctionName][1]> | AllFunctions[FunctionName][1], _options?: HttpsOptions<FunctionName>) => (request: CallableRequest<AllFunctions[FunctionName][0]>) => Promise<AllFunctions[FunctionName][1]> | AllFunctions[FunctionName][1];
28
+ export {};
29
+ //# sourceMappingURL=https.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"https.d.ts","sourceRoot":"","sources":["../../../src/lib/helpers/https.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE3F,UAAU,eAAe,CACvB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACzD,OAAO,GAAG,OAAO,EACjB,OAAO,GAAG,OAAO,CACjB,SAAQ,OAAO;IACf,0DAA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AAC,CAAC,CAAC,CAAC,KACpD,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAEhE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { EventContext } from 'firebase-functions/v1';
2
+ import type { ScheduleOptions } from '../types/index.js';
3
+ export declare const onSchedule: (handler: (context: EventContext) => PromiseLike<unknown> | unknown, _options: ScheduleOptions) => (context: EventContext) => PromiseLike<unknown> | unknown;
4
+ //# sourceMappingURL=scheduler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../src/lib/helpers/scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,eAAO,MAAM,UAAU,GACrB,SAAS,CAAC,OAAO,EAAE,YAAY,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,EAClE,UAAU,eAAe,eADN,YAAY,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,OAEjD,CAAC"}
@@ -0,0 +1,50 @@
1
+ import type { StorageEvent } from 'firebase-functions/v2/storage';
2
+ import type { ObjectTriggerOptions } from '../types/index.js';
3
+ /**
4
+ * Event handler sent only when a bucket has enabled object versioning. This
5
+ * event indicates that the live version of an object has become an archived
6
+ * version, either because it was archived or because it was overwritten by the
7
+ * upload of an object of the same name.
8
+ *
9
+ * @param handler Event handler which is run every time a Google Cloud Storage
10
+ * archival occurs.
11
+ * @returns A Cloud DeployFunction which you can export and deploy.
12
+ */
13
+ export declare const onObjectArchived: (handler: (event: StorageEvent) => PromiseLike<unknown> | unknown, _options?: ObjectTriggerOptions) => (event: StorageEvent) => PromiseLike<unknown> | unknown;
14
+ /**
15
+ * Event handler which fires every time a Google Cloud Storage deletion occurs.
16
+ *
17
+ * Sent when an object has been permanently deleted. This includes objects that
18
+ * are overwritten or are deleted as part of the bucket's lifecycle
19
+ * configuration. For buckets with object versioning enabled, this is not sent
20
+ * when an object is archived, even if archival occurs via the
21
+ * `storage.objects.delete` method.
22
+ *
23
+ * @param handler Event handler which is run every time a Google Cloud Storage
24
+ * deletion occurs.
25
+ * @returns A Cloud DeployFunction which you can export and deploy.
26
+ */
27
+ export declare const onObjectDeleted: (handler: (event: StorageEvent) => PromiseLike<unknown> | unknown, _options?: ObjectTriggerOptions) => (event: StorageEvent) => PromiseLike<unknown> | unknown;
28
+ /**
29
+ * Event handler which fires every time a Google Cloud Storage object creation
30
+ * occurs.
31
+ *
32
+ * Sent when a new object (or a new generation of an existing object) is
33
+ * successfully created in the bucket. This includes copying or rewriting an
34
+ * existing object. A failed upload does not trigger this event.
35
+ *
36
+ * @param handler Event handler which is run every time a Google Cloud Storage
37
+ * object creation occurs.
38
+ * @returns A Cloud DeployFunction which you can export and deploy.
39
+ */
40
+ export declare const onObjectFinalized: (handler: (event: StorageEvent) => PromiseLike<unknown> | unknown, _options?: ObjectTriggerOptions) => (event: StorageEvent) => PromiseLike<unknown> | unknown;
41
+ /**
42
+ * Event handler which fires every time the metadata of an existing object
43
+ * changes.
44
+ *
45
+ * @param handler Event handler which is run every time a Google Cloud Storage
46
+ * metadata update occurs.
47
+ * @returns A Cloud DeployFunction which you can export and deploy.
48
+ */
49
+ export declare const onObjectMetadataUpdated: (handler: (event: StorageEvent) => PromiseLike<unknown> | unknown, _options?: ObjectTriggerOptions) => (event: StorageEvent) => PromiseLike<unknown> | unknown;
50
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/lib/helpers/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,CAAC,KAAK,EAAE,YAAY,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,EAChE,WAAW,oBAAoB,aADd,YAAY,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,OAE/C,CAAC;AACb;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,GAC1B,SAAS,CAAC,KAAK,EAAE,YAAY,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,EAChE,WAAW,oBAAoB,aADd,YAAY,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,OAE/C,CAAC;AAEb;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,GAC5B,SAAS,CAAC,KAAK,EAAE,YAAY,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,EAChE,WAAW,oBAAoB,aADd,YAAY,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,OAE/C,CAAC;AAEb;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAClC,SAAS,CAAC,KAAK,EAAE,YAAY,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,EAChE,WAAW,oBAAoB,aADd,YAAY,KAAK,WAAW,CAAC,OAAO,CAAC,GAAG,OAE/C,CAAC"}
@@ -0,0 +1,56 @@
1
+ import type { ExecutorBaseBuildOptions } from './core.js';
2
+ import type { PackageManager } from './deploy.js';
3
+ export interface BuildExecutorOptions extends ExecutorBaseBuildOptions {
4
+ /**
5
+ * Clear output directory.
6
+ *
7
+ * @default true
8
+ */
9
+ clear?: boolean;
10
+ /**
11
+ * The path to the entry file.
12
+ *
13
+ * @default 'src/index.ts'
14
+ */
15
+ inputPath?: string;
16
+ /**
17
+ * The path to the output directory.
18
+ *
19
+ * @default 'dist'
20
+ */
21
+ outputRoot?: string;
22
+ /** The external dependencies. */
23
+ external?: string[];
24
+ /**
25
+ * Create a package.json file in the output directory.
26
+ *
27
+ * @default true
28
+ */
29
+ createPackageJson?: boolean;
30
+ /**
31
+ * The name of the tsconfig file in the project root.
32
+ *
33
+ * @default 'tsconfig.json'
34
+ */
35
+ tsconfig?: string;
36
+ /**
37
+ * Will run `tsc -noEmits` to validate the build.
38
+ *
39
+ * If this is not valid the all build will fail.
40
+ *
41
+ * @default true
42
+ */
43
+ validate?: boolean;
44
+ /**
45
+ * The package manager to use when running firebase-tools.
46
+ *
47
+ * Set `global` to use the globally installed firebase-tools (`npm i -g
48
+ * firebase-tools`).
49
+ *
50
+ * @default 'pnpm'
51
+ */
52
+ packageManager: PackageManager;
53
+ minify?: boolean;
54
+ extension?: 'js' | 'mjs' | 'cjs';
55
+ }
56
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/lib/types/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,oBAAqB,SAAQ,wBAAwB;IACpE;;;;OAIG;IAEH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;OAOG;IACH,cAAc,EAAE,cAAc,CAAC;IAE/B,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,SAAS,CAAC,EAAE,IAAI,GAAG,KAAK,GAAG,KAAK,CAAC;CAClC"}
@@ -0,0 +1,10 @@
1
+ export interface ChecksumData {
2
+ functionName: string;
3
+ outputRoot: string;
4
+ flavor: string;
5
+ force?: boolean;
6
+ outputDirectory: string;
7
+ checksum?: string;
8
+ environment?: Record<string, string>;
9
+ }
10
+ //# sourceMappingURL=checksum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checksum.d.ts","sourceRoot":"","sources":["../../../src/lib/types/checksum.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC"}
@@ -0,0 +1,45 @@
1
+ import type { NodeVersion } from './helper-options.js';
2
+ export interface ExecutorBaseOptions {
3
+ /** Don't log anything */
4
+ silent?: boolean;
5
+ /** Get verbose logs */
6
+ verbose?: boolean;
7
+ debug?: boolean;
8
+ }
9
+ export interface ExecutorBaseBuildOptions extends ExecutorBaseOptions {
10
+ /**
11
+ * The name of the tsconfig file in the project root.
12
+ *
13
+ * @default 'tsconfig.json'
14
+ */
15
+ tsconfig?: string;
16
+ /**
17
+ * Will run `tsc -noEmits` to validate the build.
18
+ *
19
+ * If this is not valid the all build will fail.
20
+ *
21
+ * @default true
22
+ */
23
+ validate?: boolean;
24
+ /**
25
+ * Will import the file in the deploy script from the project root
26
+ * directory. Helpful for setting up opentelemetry.
27
+ *
28
+ * @default 'src/logger.ts'
29
+ */
30
+ includeFilePath?: string;
31
+ /**
32
+ * The node version to target.
33
+ *
34
+ * @default '20'
35
+ */
36
+ nodeVersion?: NodeVersion;
37
+ /**
38
+ * To enable sourcemaps.
39
+ *
40
+ * @default true
41
+ */
42
+ sourcemap?: boolean;
43
+ requireFix?: boolean;
44
+ }
45
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/lib/types/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,yBAAyB;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uBAAuB;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACnE;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}