@xxmachina/common 19.36.0 → 19.37.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,16 +1,30 @@
1
- import { makeEnvironmentProviders, provideAppInitializer, inject } from '@angular/core';
1
+ import { inject, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';
2
2
  import { provideEffect } from '@ng-atomic/core';
3
3
  import { AppFrameStore } from '@ng-atomic/components/frames/app';
4
- import { AuthService as AuthService$1 } from '@xxmachina/common/auth';
5
- import { AuthService } from '@ng-atomic/common/services/auth';
4
+ import { AuthService } from '@xxmachina/common/auth';
5
+ import { AuthService as AuthService$1 } from '@ng-atomic/common/services/auth';
6
6
  export { AuthService as FirebaseAuthService } from '@ng-atomic/common/services/auth';
7
7
 
8
+ const LOGOUT_CONFIRM_MESSAGE = 'ログアウトしますか?';
9
+ /**
10
+ * SIGN_OUT effect factory。window.confirm で確認ダイアログを表示し、
11
+ * OK の時のみ signOut() を実行する。
12
+ */
13
+ function createSignOutEffect() {
14
+ const auth = inject(AuthService);
15
+ return () => {
16
+ if (!window.confirm(LOGOUT_CONFIRM_MESSAGE)) {
17
+ return;
18
+ }
19
+ return auth.signOut();
20
+ };
21
+ }
8
22
  function provideAuthService(config = {}) {
9
23
  return makeEnvironmentProviders([
10
- { provide: AuthService$1, useClass: AuthService },
11
- provideAppInitializer(() => { inject(AuthService$1); }),
24
+ { provide: AuthService, useClass: AuthService$1 },
25
+ provideAppInitializer(() => { inject(AuthService); }),
12
26
  provideEffect(AppFrameStore.ActionId.SIGN_IN_WITH_MICROSOFT, () => {
13
- const auth = inject(AuthService$1);
27
+ const auth = inject(AuthService);
14
28
  return () => {
15
29
  console.debug('auth:', auth);
16
30
  if (!auth.auth()) {
@@ -21,10 +35,7 @@ function provideAuthService(config = {}) {
21
35
  }
22
36
  };
23
37
  }),
24
- provideEffect(AppFrameStore.ActionId.SIGN_OUT, () => {
25
- const auth = inject(AuthService$1);
26
- return () => auth.signOut();
27
- }),
38
+ provideEffect(AppFrameStore.ActionId.SIGN_OUT, createSignOutEffect),
28
39
  ]);
29
40
  }
30
41
 
@@ -32,5 +43,5 @@ function provideAuthService(config = {}) {
32
43
  * Generated bundle index. Do not edit.
33
44
  */
34
45
 
35
- export { provideAuthService };
46
+ export { LOGOUT_CONFIRM_MESSAGE, createSignOutEffect, provideAuthService };
36
47
  //# sourceMappingURL=xxmachina-common-auth-firebase.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"xxmachina-common-auth-firebase.mjs","sources":["../../../../../packages/@xxmachina/common/src/lib/auth/firebase/firebase-auth.di.ts","../../../../../packages/@xxmachina/common/src/lib/auth/firebase/xxmachina-common-auth-firebase.ts"],"sourcesContent":["import { EnvironmentProviders, inject, makeEnvironmentProviders, provideAppInitializer } from \"@angular/core\";\nimport { provideEffect } from \"@ng-atomic/core\";\nimport { AppFrameStore } from \"@ng-atomic/components/frames/app\";\nimport { AuthService } from \"@xxmachina/common/auth\";\nimport { FirebaseAuthService } from \"./firebase-auth.service\";\n\nexport function provideAuthService(config: {} = {}): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: AuthService, useClass: FirebaseAuthService },\n provideAppInitializer(() => { inject(AuthService) }),\n provideEffect(AppFrameStore.ActionId.SIGN_IN_WITH_MICROSOFT, () => {\n const auth = inject(AuthService);\n return () => {\n console.debug('auth:', auth);\n if (!auth.auth()) {\n auth.signIn();\n } else {\n console.log('既にログイン済みです。');\n }\n }\n }),\n provideEffect(AppFrameStore.ActionId.SIGN_OUT, () => {\n const auth = inject(AuthService);\n return () => auth.signOut();\n }),\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["AuthService","FirebaseAuthService"],"mappings":";;;;;;;AAMM,SAAU,kBAAkB,CAAC,MAAA,GAAa,EAAE,EAAA;AAChD,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA,EAAE,OAAO,EAAEA,aAAW,EAAE,QAAQ,EAAEC,WAAmB,EAAE;QACvD,qBAAqB,CAAC,MAAK,EAAG,MAAM,CAACD,aAAW,CAAC,CAAA,CAAC,CAAC,CAAC;QACpD,aAAa,CAAC,aAAa,CAAC,QAAQ,CAAC,sBAAsB,EAAE,MAAK;AAChE,YAAA,MAAM,IAAI,GAAG,MAAM,CAACA,aAAW,CAAC;AAChC,YAAA,OAAO,MAAK;AACV,gBAAA,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;AAC5B,gBAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE;oBAChB,IAAI,CAAC,MAAM,EAAE;gBACf;qBAAO;AACL,oBAAA,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;gBAC5B;AACF,YAAA,CAAC;AACH,QAAA,CAAC,CAAC;QACF,aAAa,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAK;AAClD,YAAA,MAAM,IAAI,GAAG,MAAM,CAACA,aAAW,CAAC;AAChC,YAAA,OAAO,MAAM,IAAI,CAAC,OAAO,EAAE;AAC7B,QAAA,CAAC,CAAC;AACH,KAAA,CAAC;AACJ;;AC1BA;;AAEG;;;;"}
1
+ {"version":3,"file":"xxmachina-common-auth-firebase.mjs","sources":["../../../../../packages/@xxmachina/common/src/lib/auth/firebase/firebase-auth.di.ts","../../../../../packages/@xxmachina/common/src/lib/auth/firebase/xxmachina-common-auth-firebase.ts"],"sourcesContent":["import { EnvironmentProviders, inject, makeEnvironmentProviders, provideAppInitializer } from \"@angular/core\";\nimport { provideEffect } from \"@ng-atomic/core\";\nimport { AppFrameStore } from \"@ng-atomic/components/frames/app\";\nimport { AuthService } from \"@xxmachina/common/auth\";\nimport { FirebaseAuthService } from \"./firebase-auth.service\";\n\nexport const LOGOUT_CONFIRM_MESSAGE = 'ログアウトしますか?';\n\n/**\n * SIGN_OUT effect factory。window.confirm で確認ダイアログを表示し、\n * OK の時のみ signOut() を実行する。\n */\nexport function createSignOutEffect() {\n const auth = inject(AuthService);\n return () => {\n if (!window.confirm(LOGOUT_CONFIRM_MESSAGE)) {\n return;\n }\n return auth.signOut();\n };\n}\n\nexport function provideAuthService(config: {} = {}): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: AuthService, useClass: FirebaseAuthService },\n provideAppInitializer(() => { inject(AuthService) }),\n provideEffect(AppFrameStore.ActionId.SIGN_IN_WITH_MICROSOFT, () => {\n const auth = inject(AuthService);\n return () => {\n console.debug('auth:', auth);\n if (!auth.auth()) {\n auth.signIn();\n } else {\n console.log('既にログイン済みです。');\n }\n }\n }),\n provideEffect(AppFrameStore.ActionId.SIGN_OUT, createSignOutEffect),\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["FirebaseAuthService"],"mappings":";;;;;;;AAMO,MAAM,sBAAsB,GAAG;AAEtC;;;AAGG;SACa,mBAAmB,GAAA;AACjC,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;AAChC,IAAA,OAAO,MAAK;QACV,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,EAAE;YAC3C;QACF;AACA,QAAA,OAAO,IAAI,CAAC,OAAO,EAAE;AACvB,IAAA,CAAC;AACH;AAEM,SAAU,kBAAkB,CAAC,MAAA,GAAa,EAAE,EAAA;AAChD,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAEA,aAAmB,EAAE;QACvD,qBAAqB,CAAC,MAAK,EAAG,MAAM,CAAC,WAAW,CAAC,CAAA,CAAC,CAAC,CAAC;QACpD,aAAa,CAAC,aAAa,CAAC,QAAQ,CAAC,sBAAsB,EAAE,MAAK;AAChE,YAAA,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;AAChC,YAAA,OAAO,MAAK;AACV,gBAAA,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;AAC5B,gBAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE;oBAChB,IAAI,CAAC,MAAM,EAAE;gBACf;qBAAO;AACL,oBAAA,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;gBAC5B;AACF,YAAA,CAAC;AACH,QAAA,CAAC,CAAC;QACF,aAAa,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;AACpE,KAAA,CAAC;AACJ;;ACvCA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xxmachina/common",
3
- "version": "19.36.0",
3
+ "version": "19.37.0",
4
4
  "license": "MIT",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -13,11 +13,11 @@
13
13
  "@nestjs/common": "10.2.8",
14
14
  "@nestjs/graphql": "^11.0.0",
15
15
  "@nestjs/passport": "^9.0.3",
16
- "@ng-atomic/common": "19.36.0",
17
- "@ng-atomic/components": "19.36.0",
18
- "@ng-atomic/core": "19.36.0",
19
- "@nx-ddd/common": "19.36.0",
20
- "@nx-ddd/core": "19.36.0",
16
+ "@ng-atomic/common": "19.37.0",
17
+ "@ng-atomic/components": "19.37.0",
18
+ "@ng-atomic/core": "19.37.0",
19
+ "@nx-ddd/common": "19.37.0",
20
+ "@nx-ddd/core": "19.37.0",
21
21
  "@tfarras/nestjs-firebase-auth": "^2.0.0",
22
22
  "apollo-angular": "^7.0.2",
23
23
  "class-transformer": "^0.5.1",
@@ -43,11 +43,11 @@
43
43
  "validate-azure-ad-token": "^2.2.0"
44
44
  },
45
45
  "optionalDependencies": {
46
- "@nx-ddd/any-func": "19.36.0",
47
- "@nx-ddd/firestore": "19.36.0",
48
- "@nx-ddd/google": "19.36.0",
49
- "@nx-ddd/hasura": "19.36.0",
50
- "@nx-ddd/notion": "19.36.0",
46
+ "@nx-ddd/any-func": "19.37.0",
47
+ "@nx-ddd/firestore": "19.37.0",
48
+ "@nx-ddd/google": "19.37.0",
49
+ "@nx-ddd/hasura": "19.37.0",
50
+ "@nx-ddd/notion": "19.37.0",
51
51
  "@notionhq/client": "^2.2.15"
52
52
  },
53
53
  "dependencies": {
@@ -1,7 +1,13 @@
1
1
  import { EnvironmentProviders } from '@angular/core';
2
2
  export { AuthService as FirebaseAuthService } from '@ng-atomic/common/services/auth';
3
3
 
4
+ declare const LOGOUT_CONFIRM_MESSAGE = "\u30ED\u30B0\u30A2\u30A6\u30C8\u3057\u307E\u3059\u304B\uFF1F";
5
+ /**
6
+ * SIGN_OUT effect factory。window.confirm で確認ダイアログを表示し、
7
+ * OK の時のみ signOut() を実行する。
8
+ */
9
+ declare function createSignOutEffect(): () => Promise<void> | undefined;
4
10
  declare function provideAuthService(config?: {}): EnvironmentProviders;
5
11
 
6
- export { provideAuthService };
12
+ export { LOGOUT_CONFIRM_MESSAGE, createSignOutEffect, provideAuthService };
7
13
  //# sourceMappingURL=xxmachina-common-auth-firebase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"xxmachina-common-auth-firebase.d.ts","sources":["../../../../../packages/@xxmachina/common/src/lib/auth/firebase/firebase-auth.di.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAMA,iBAAA,kBAAA,eAAA,oBAAA;;;;"}
1
+ {"version":3,"file":"xxmachina-common-auth-firebase.d.ts","sources":["../../../../../packages/@xxmachina/common/src/lib/auth/firebase/firebase-auth.di.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAMA,cAAA,sBAAA;AAEA;;;AAGG;AACH,iBAAA,mBAAA,UAAA,OAAA;AAUA,iBAAA,kBAAA,eAAA,oBAAA;;;;"}