@causa/workspace-google 0.1.0 → 0.1.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.
- package/dist/functions/google-firebase-storage-merge-rules.d.ts +3 -1
- package/dist/functions/google-firebase-storage-merge-rules.js +14 -0
- package/dist/functions/google-firestore-merge-rules.d.ts +3 -1
- package/dist/functions/google-firestore-merge-rules.js +14 -0
- package/dist/functions/google-services-enable.d.ts +1 -0
- package/package.json +3 -3
|
@@ -11,8 +11,9 @@ type GoogleFirebaseStorageMergeRulesResult = {
|
|
|
11
11
|
configuration: GoogleConfiguration;
|
|
12
12
|
/**
|
|
13
13
|
* The path to the merged rules file.
|
|
14
|
+
* This is `null` during teardown.
|
|
14
15
|
*/
|
|
15
|
-
securityRuleFile: string;
|
|
16
|
+
securityRuleFile: string | null;
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* A function that merges all the Firebase Storage security rules found in the workspace into a single file, which can
|
|
@@ -25,6 +26,7 @@ type GoogleFirebaseStorageMergeRulesResult = {
|
|
|
25
26
|
* processor.
|
|
26
27
|
*/
|
|
27
28
|
export declare class GoogleFirebaseStorageMergeRules extends WorkspaceFunction<Promise<GoogleFirebaseStorageMergeRulesResult>> implements InfrastructureProcessor {
|
|
29
|
+
readonly tearDown?: boolean;
|
|
28
30
|
_call(context: WorkspaceContext): Promise<GoogleFirebaseStorageMergeRulesResult>;
|
|
29
31
|
_supports(): boolean;
|
|
30
32
|
}
|
|
@@ -4,8 +4,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
7
10
|
import { CliCommand } from '@causa/cli';
|
|
8
11
|
import { WorkspaceFunction } from '@causa/workspace';
|
|
12
|
+
import { AllowMissing } from '@causa/workspace/validation';
|
|
13
|
+
import { IsBoolean } from 'class-validator';
|
|
9
14
|
import { firebaseStorageCommandDefinition } from '../cli/index.js';
|
|
10
15
|
import { mergeFirebaseRulesFiles } from '../firebase/index.js';
|
|
11
16
|
/**
|
|
@@ -23,7 +28,11 @@ const DEFAULT_FIREBASE_STORAGE_SECURITY_RULE_FILE = 'storage.rules';
|
|
|
23
28
|
* processor.
|
|
24
29
|
*/
|
|
25
30
|
let GoogleFirebaseStorageMergeRules = class GoogleFirebaseStorageMergeRules extends WorkspaceFunction {
|
|
31
|
+
tearDown;
|
|
26
32
|
async _call(context) {
|
|
33
|
+
if (this.tearDown) {
|
|
34
|
+
return { configuration: {}, securityRuleFile: null };
|
|
35
|
+
}
|
|
27
36
|
const googleConf = context.asConfiguration();
|
|
28
37
|
let securityRuleFile = googleConf.get('google.firebaseStorage.securityRuleFile') ??
|
|
29
38
|
DEFAULT_FIREBASE_STORAGE_SECURITY_RULE_FILE;
|
|
@@ -45,6 +54,11 @@ ${rules}
|
|
|
45
54
|
return true;
|
|
46
55
|
}
|
|
47
56
|
};
|
|
57
|
+
__decorate([
|
|
58
|
+
IsBoolean(),
|
|
59
|
+
AllowMissing(),
|
|
60
|
+
__metadata("design:type", Boolean)
|
|
61
|
+
], GoogleFirebaseStorageMergeRules.prototype, "tearDown", void 0);
|
|
48
62
|
GoogleFirebaseStorageMergeRules = __decorate([
|
|
49
63
|
CliCommand({
|
|
50
64
|
parent: firebaseStorageCommandDefinition,
|
|
@@ -11,8 +11,9 @@ type GoogleFirestoreMergeRulesResult = {
|
|
|
11
11
|
configuration: GoogleConfiguration;
|
|
12
12
|
/**
|
|
13
13
|
* The path to the merged rules file.
|
|
14
|
+
* This is `null` during teardown.
|
|
14
15
|
*/
|
|
15
|
-
securityRuleFile: string;
|
|
16
|
+
securityRuleFile: string | null;
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* A function that merges all the Firestore security rules found in the workspace into a single file, which can be used
|
|
@@ -25,6 +26,7 @@ type GoogleFirestoreMergeRulesResult = {
|
|
|
25
26
|
* processor.
|
|
26
27
|
*/
|
|
27
28
|
export declare class GoogleFirestoreMergeRules extends WorkspaceFunction<Promise<GoogleFirestoreMergeRulesResult>> implements InfrastructureProcessor {
|
|
29
|
+
readonly tearDown?: boolean;
|
|
28
30
|
_call(context: WorkspaceContext): Promise<GoogleFirestoreMergeRulesResult>;
|
|
29
31
|
_supports(): boolean;
|
|
30
32
|
}
|
|
@@ -4,8 +4,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
7
10
|
import { CliCommand } from '@causa/cli';
|
|
8
11
|
import { WorkspaceFunction } from '@causa/workspace';
|
|
12
|
+
import { AllowMissing } from '@causa/workspace/validation';
|
|
13
|
+
import { IsBoolean } from 'class-validator';
|
|
9
14
|
import { firestoreCommandDefinition } from '../cli/index.js';
|
|
10
15
|
import { mergeFirebaseRulesFiles } from '../firebase/index.js';
|
|
11
16
|
/**
|
|
@@ -23,7 +28,11 @@ const DEFAULT_FIRESTORE_SECURITY_RULE_FILE = 'firestore.rules';
|
|
|
23
28
|
* processor.
|
|
24
29
|
*/
|
|
25
30
|
let GoogleFirestoreMergeRules = class GoogleFirestoreMergeRules extends WorkspaceFunction {
|
|
31
|
+
tearDown;
|
|
26
32
|
async _call(context) {
|
|
33
|
+
if (this.tearDown) {
|
|
34
|
+
return { configuration: {}, securityRuleFile: null };
|
|
35
|
+
}
|
|
27
36
|
const googleConf = context.asConfiguration();
|
|
28
37
|
let securityRuleFile = googleConf.get('google.firestore.securityRuleFile') ??
|
|
29
38
|
DEFAULT_FIRESTORE_SECURITY_RULE_FILE;
|
|
@@ -45,6 +54,11 @@ ${rules}
|
|
|
45
54
|
return true;
|
|
46
55
|
}
|
|
47
56
|
};
|
|
57
|
+
__decorate([
|
|
58
|
+
IsBoolean(),
|
|
59
|
+
AllowMissing(),
|
|
60
|
+
__metadata("design:type", Boolean)
|
|
61
|
+
], GoogleFirestoreMergeRules.prototype, "tearDown", void 0);
|
|
48
62
|
GoogleFirestoreMergeRules = __decorate([
|
|
49
63
|
CliCommand({
|
|
50
64
|
parent: firestoreCommandDefinition,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@causa/workspace-google",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "The Causa workspace module providing many functionalities related to GCP and its services.",
|
|
5
5
|
"repository": "github:causa-io/workspace-module-google",
|
|
6
6
|
"license": "ISC",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@causa/cli": ">= 0.2.1 < 1.0.0",
|
|
32
|
-
"@causa/workspace": ">= 0.
|
|
33
|
-
"@causa/workspace-core": ">= 0.
|
|
32
|
+
"@causa/workspace": ">= 0.6.0 < 1.0.0",
|
|
33
|
+
"@causa/workspace-core": ">= 0.3.0 < 1.0.0",
|
|
34
34
|
"@google-cloud/secret-manager": "^4.2.2",
|
|
35
35
|
"@google-cloud/service-usage": "^2.2.2",
|
|
36
36
|
"class-validator": "^0.14.0",
|