@causa/workspace-google 0.11.0 → 0.12.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.
@@ -82,7 +82,7 @@ export class GoogleSpannerRenderer extends TypeScriptWithDecoratorsRenderer {
82
82
  const singleTypeInfo = getSingleType(context.property.type);
83
83
  const schemaOverridesTypeInfo = TYPE_INFO_COLUMN_ATTRIBUTE_NAMES.some((name) => name in columnAttributes);
84
84
  if (!schemaOverridesTypeInfo && singleTypeInfo) {
85
- switch (singleTypeInfo.type.kind) {
85
+ switch (singleTypeInfo.type?.kind) {
86
86
  case 'class':
87
87
  case 'object':
88
88
  case 'map':
@@ -13,6 +13,10 @@ export declare class GoogleIdentityPlatformGenerateToken extends WorkspaceFuncti
13
13
  * A dictionary of custom claims that will be added to the generated JWT.
14
14
  */
15
15
  readonly claims?: Record<string, any>;
16
+ /**
17
+ * Whether to return the refresh token instead of the ID token.
18
+ */
19
+ readonly refreshToken?: boolean;
16
20
  _call(context: WorkspaceContext): Promise<string>;
17
21
  _supports(): boolean;
18
22
  }
@@ -11,7 +11,7 @@ import { CliArgument, CliCommand, CliOption } from '@causa/cli';
11
11
  import { WorkspaceContext, WorkspaceFunction } from '@causa/workspace';
12
12
  import { AllowMissing } from '@causa/workspace/validation';
13
13
  import { Transform } from 'class-transformer';
14
- import { IsObject, IsString } from 'class-validator';
14
+ import { IsBoolean, IsObject, IsString } from 'class-validator';
15
15
  import { getAuth, signInWithCustomToken } from 'firebase/auth';
16
16
  import { identityPlatformCommandDefinition } from '../../cli/index.js';
17
17
  import { FirebaseAppService } from '../../services/index.js';
@@ -30,13 +30,19 @@ let GoogleIdentityPlatformGenerateToken = class GoogleIdentityPlatformGenerateTo
30
30
  * A dictionary of custom claims that will be added to the generated JWT.
31
31
  */
32
32
  claims;
33
+ /**
34
+ * Whether to return the refresh token instead of the ID token.
35
+ */
36
+ refreshToken;
33
37
  async _call(context) {
34
38
  context.logger.info(`🛂 Signing in user '${this.user}' with a custom token.`);
35
39
  const customToken = await context.call(GoogleIdentityPlatformGenerateCustomToken, { user: this.user, claims: this.claims });
36
40
  const app = await context.service(FirebaseAppService).getApp();
37
41
  const auth = getAuth(app);
38
42
  const credentials = await signInWithCustomToken(auth, customToken);
39
- return await credentials.user.getIdToken();
43
+ return this.refreshToken
44
+ ? credentials.user.refreshToken
45
+ : await credentials.user.getIdToken();
40
46
  }
41
47
  _supports() {
42
48
  return true;
@@ -61,6 +67,15 @@ __decorate([
61
67
  Transform(({ value }) => typeof value === 'string' ? JSON.parse(value) : value),
62
68
  __metadata("design:type", Object)
63
69
  ], GoogleIdentityPlatformGenerateToken.prototype, "claims", void 0);
70
+ __decorate([
71
+ CliOption({
72
+ flags: '-r, --refresh-token',
73
+ description: 'Return the refresh token instead of the ID token.',
74
+ }),
75
+ IsBoolean(),
76
+ AllowMissing(),
77
+ __metadata("design:type", Boolean)
78
+ ], GoogleIdentityPlatformGenerateToken.prototype, "refreshToken", void 0);
64
79
  GoogleIdentityPlatformGenerateToken = __decorate([
65
80
  CliCommand({
66
81
  parent: identityPlatformCommandDefinition,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@causa/workspace-google",
3
- "version": "0.11.0",
3
+ "version": "0.12.1",
4
4
  "description": "The Causa workspace module providing many functionalities related to GCP and its services.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,47 +32,47 @@
32
32
  "test:cov": "npm run test -- --coverage"
33
33
  },
34
34
  "dependencies": {
35
- "@causa/cli": ">= 0.6.3 < 1.0.0",
36
- "@causa/workspace": ">= 0.18.1 < 1.0.0",
37
- "@causa/workspace-core": ">= 0.24.1 < 1.0.0",
38
- "@causa/workspace-typescript": ">= 0.14.0 < 1.0.0",
35
+ "@causa/cli": ">= 0.6.4 < 1.0.0",
36
+ "@causa/workspace": ">= 0.19.1 < 1.0.0",
37
+ "@causa/workspace-core": ">= 0.26.0 < 1.0.0",
38
+ "@causa/workspace-typescript": ">= 0.16.0 < 1.0.0",
39
39
  "@google-cloud/apikeys": "^2.2.1",
40
40
  "@google-cloud/bigquery": "^8.1.1",
41
41
  "@google-cloud/iam-credentials": "^4.2.1",
42
- "@google-cloud/pubsub": "^5.2.0",
42
+ "@google-cloud/pubsub": "^5.2.2",
43
43
  "@google-cloud/resource-manager": "^6.2.1",
44
- "@google-cloud/run": "^3.0.1",
44
+ "@google-cloud/run": "^3.2.0",
45
45
  "@google-cloud/secret-manager": "^6.1.1",
46
46
  "@google-cloud/service-usage": "^4.2.1",
47
- "@google-cloud/spanner": "8.2.2",
48
- "@google-cloud/storage": "^7.17.2",
49
- "class-validator": "^0.14.2",
50
- "firebase": "^12.4.0",
51
- "firebase-admin": "^13.5.0",
52
- "globby": "^15.0.0",
53
- "google-auth-library": "^10.4.1",
54
- "google-gax": "5.0.3",
55
- "googleapis": "^164.0.0",
47
+ "@google-cloud/spanner": "^8.6.0",
48
+ "@google-cloud/storage": "^7.18.0",
49
+ "class-validator": "^0.14.3",
50
+ "firebase": "^12.8.0",
51
+ "firebase-admin": "^13.6.0",
52
+ "globby": "^16.1.0",
53
+ "google-auth-library": "^10.5.0",
54
+ "google-gax": "5.0.6",
55
+ "googleapis": "^171.2.0",
56
56
  "micromatch": "^4.0.8",
57
- "pino": "^10.1.0",
57
+ "pino": "^10.3.0",
58
58
  "quicktype-core": "^23.2.6"
59
59
  },
60
60
  "devDependencies": {
61
- "@swc/core": "^1.13.5",
61
+ "@swc/core": "^1.15.11",
62
62
  "@swc/jest": "^0.2.39",
63
- "@tsconfig/node20": "^20.1.6",
63
+ "@tsconfig/node20": "^20.1.9",
64
64
  "@types/jest": "^30.0.0",
65
- "@types/micromatch": "^4.0.9",
66
- "@types/node": "^22.18.11",
65
+ "@types/micromatch": "^4.0.10",
66
+ "@types/node": "^22.19.8",
67
67
  "copyfiles": "^2.4.1",
68
- "eslint": "^9.38.0",
68
+ "eslint": "^9.39.2",
69
69
  "eslint-config-prettier": "^10.1.8",
70
- "eslint-plugin-prettier": "^5.5.4",
70
+ "eslint-plugin-prettier": "^5.5.5",
71
71
  "jest": "^30.2.0",
72
- "jest-extended": "^6.0.0",
73
- "rimraf": "^6.0.1",
72
+ "jest-extended": "^7.0.0",
73
+ "rimraf": "^6.1.2",
74
74
  "ts-node": "^10.9.2",
75
75
  "typescript": "^5.9.3",
76
- "typescript-eslint": "^8.46.1"
76
+ "typescript-eslint": "^8.54.0"
77
77
  }
78
78
  }