@sneat/app 0.24.0 → 0.25.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.
package/esm2022/index.js CHANGED
@@ -10,7 +10,5 @@ export * from './lib/contact-extensions';
10
10
  export * from './lib/get-standard-sneat-providers';
11
11
  export * from './lib/app-specific-providers';
12
12
  export * from './lib/capacitator-http.service';
13
- export * from './lib/page-title.service';
14
- export * from './lib/sneat-title.strategy';
15
- export * from './lib/route-title';
13
+ export { PageTitleService, SneatTitleStrategy, SNEAT_AUTHENTICATED_LIFECYCLE, } from '@sneat/app-public';
16
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/app/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './environments';\nexport * from './lib/base-app.component';\nexport * from './lib/sneat-base-app';\nexport * from './lib/get-standard-sneat-imports';\nexport * from './lib/app-component.service';\nexport * from './environments/environment.local';\nexport * from './lib/init-firebase';\nexport * from './lib/init-helpers';\nexport * from './lib/contact-extensions';\nexport * from './lib/get-standard-sneat-providers';\nexport * from './lib/app-specific-providers';\nexport * from './lib/capacitator-http.service';\nexport * from './lib/page-title.service';\nexport * from './lib/sneat-title.strategy';\nexport * from './lib/route-title';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/app/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,mBAAmB,CAAC","sourcesContent":["export * from './environments';\nexport * from './lib/base-app.component';\nexport * from './lib/sneat-base-app';\nexport * from './lib/get-standard-sneat-imports';\nexport * from './lib/app-component.service';\nexport * from './environments/environment.local';\nexport * from './lib/init-firebase';\nexport * from './lib/init-helpers';\nexport * from './lib/contact-extensions';\nexport * from './lib/get-standard-sneat-providers';\nexport * from './lib/app-specific-providers';\nexport * from './lib/capacitator-http.service';\nexport {\n PageTitleService,\n SneatTitleStrategy,\n SNEAT_AUTHENTICATED_LIFECYCLE,\n} from '@sneat/app-public';\n"]}
@@ -1,11 +1,5 @@
1
1
  import { CONTACT_ROLES_BY_TYPE, } from './contact-extensions';
2
- import { APP_INFO } from '@sneat/core';
3
- export function provideAppInfo(appInfo) {
4
- return {
5
- provide: APP_INFO,
6
- useValue: appInfo,
7
- };
8
- }
2
+ export { provideAppInfo } from '@sneat/app-public';
9
3
  export function provideRolesByType(contactRolesByType) {
10
4
  return {
11
5
  provide: CONTACT_ROLES_BY_TYPE, // at the moment this is supplied by Logistus app only
@@ -1 +1 @@
1
- {"version":3,"file":"app-specific-providers.js","sourceRoot":"","sources":["../../../../../libs/app/src/lib/app-specific-providers.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,GAEtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAY,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,cAAc,CAAC,OAAiB;IAC9C,OAAO;QACL,OAAO,EAAE,QAAQ;QACjB,QAAQ,EAAE,OAAO;KAClB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,kBAAkD;IAElD,OAAO;QACL,OAAO,EAAE,qBAAqB,EAAE,sDAAsD;QACtF,QAAQ,EAAE,kBAAkB;KAC7B,CAAC;AACJ,CAAC","sourcesContent":["import { Provider } from '@angular/core';\nimport {\n CONTACT_ROLES_BY_TYPE,\n ContactRolesByType,\n} from './contact-extensions';\nimport { APP_INFO, IAppInfo } from '@sneat/core';\n\nexport function provideAppInfo(appInfo: IAppInfo): Provider {\n return {\n provide: APP_INFO,\n useValue: appInfo,\n };\n}\n\nexport function provideRolesByType(\n contactRolesByType: ContactRolesByType | undefined,\n): Provider {\n return {\n provide: CONTACT_ROLES_BY_TYPE, // at the moment this is supplied by Logistus app only\n useValue: contactRolesByType,\n };\n}\n"]}
1
+ {"version":3,"file":"app-specific-providers.js","sourceRoot":"","sources":["../../../../../libs/app/src/lib/app-specific-providers.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,GAEtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,UAAU,kBAAkB,CAChC,kBAAkD;IAElD,OAAO;QACL,OAAO,EAAE,qBAAqB,EAAE,sDAAsD;QACtF,QAAQ,EAAE,kBAAkB;KAC7B,CAAC;AACJ,CAAC","sourcesContent":["import { Provider } from '@angular/core';\nimport {\n CONTACT_ROLES_BY_TYPE,\n ContactRolesByType,\n} from './contact-extensions';\nexport { provideAppInfo } from '@sneat/app-public';\n\nexport function provideRolesByType(\n contactRolesByType: ContactRolesByType | undefined,\n): Provider {\n return {\n provide: CONTACT_ROLES_BY_TYPE, // at the moment this is supplied by Logistus app only\n useValue: contactRolesByType,\n };\n}\n"]}
@@ -1,55 +1,14 @@
1
1
  import { inject } from '@angular/core';
2
- import { NavigationEnd, Router } from '@angular/router';
3
- import { SneatAuthStateService, TelegramAuthService, } from '@sneat/auth-core';
4
- import { AnalyticsService, clearCurrentSpace, TopMenuService, } from '@sneat/core';
5
- import { getRedirectResult } from 'firebase/auth';
6
- import { filter } from 'rxjs';
7
- import { getRouteTitle } from './route-title';
2
+ import { SNEAT_AUTHENTICATED_LIFECYCLE } from '@sneat/app-public';
3
+ import { TopMenuService } from '@sneat/core';
8
4
  export class BaseAppComponent {
9
5
  constructor() {
10
- this.telegramAuthService = inject(TelegramAuthService);
11
- this.router = inject(Router);
12
- this.analyticsService = inject(AnalyticsService);
13
- this.authStateService = inject(SneatAuthStateService);
14
- this.topMenuService = inject(TopMenuService); // used in templates
15
- this.telegramAuthService.authenticateIfTelegramWebApp();
16
- // Complete any pending signInWithRedirect when the app boots. The
17
- // authStateService's onIdTokenChanged listener then propagates the
18
- // signed-in user. Resolves to null (harmless) when sign-in used a popup or
19
- // there is no pending redirect. Lives here so every app that extends
20
- // BaseAppComponent gets redirect-based sign-in for free.
21
- getRedirectResult(this.authStateService.fbAuth).catch((err) => console.error('getRedirectResult failed', err));
22
- this.authStateService.authState.subscribe((s) => {
23
- this.authStatus = s.status;
24
- });
25
- this.router.events
26
- .pipe(filter((event) => event instanceof NavigationEnd))
27
- .subscribe((event) => {
28
- // The document title itself is owned by SneatTitleStrategy; here we only
29
- // reuse the same derived page title for the analytics pageview event.
30
- const title = getRouteTitle(this.router.routerState.snapshot);
31
- this.analyticsService.logEvent('$pageview', {
32
- page_path: event.urlAfterRedirects,
33
- title,
34
- });
35
- this.forgetCurrentSpaceIfLeftSpaces(event.urlAfterRedirects);
36
- });
37
- }
38
- // Keep the persisted current space in sync with where an authenticated user is:
39
- // once they navigate to a non-space page, forget it so login does not bounce them
40
- // back to a space they had left. Auth routes are ignored so signing out from a
41
- // space still restores it; the `authenticated` guard preserves the value during
42
- // the logged-out login flow so the login page can still read it.
43
- forgetCurrentSpaceIfLeftSpaces(url) {
44
- if (this.authStatus !== 'authenticated') {
45
- return;
46
- }
47
- if (url.startsWith('/space/') ||
48
- url.startsWith('/login') ||
49
- url.startsWith('/signed-out')) {
50
- return;
51
- }
52
- clearCurrentSpace();
6
+ // Kept protected for existing Ionic-shell templates that inherited it.
7
+ this.topMenuService = inject(TopMenuService);
8
+ this.authenticatedLifecycle = inject(SNEAT_AUTHENTICATED_LIFECYCLE, { optional: true });
9
+ // Legacy full shells install this at root. PrimeNG apps install it in the
10
+ // lazy authenticated route; its environment initializer starts it there.
11
+ this.authenticatedLifecycle?.start();
53
12
  }
54
13
  }
55
14
  //# sourceMappingURL=base-app.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-app.component.js","sourceRoot":"","sources":["../../../../../libs/app/src/lib/base-app.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAEL,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,OAAO,gBAAgB;IAS3B;QARiB,wBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;QAClD,WAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QACxB,qBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAC5C,qBAAgB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAC/C,mBAAc,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CAAC,SAAS,CAAC;YACzB,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;YACxB,GAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B,CAAC;YACD,OAAO;QACT,CAAC;QACD,iBAAiB,EAAE,CAAC;IACtB,CAAC;CACF","sourcesContent":["import { inject } from '@angular/core';\nimport { NavigationEnd, Router } from '@angular/router';\nimport {\n AuthStatus,\n SneatAuthStateService,\n TelegramAuthService,\n} from '@sneat/auth-core';\nimport {\n AnalyticsService,\n clearCurrentSpace,\n TopMenuService,\n} from '@sneat/core';\nimport { getRedirectResult } from 'firebase/auth';\nimport { filter } from 'rxjs';\nimport { getRouteTitle } from './route-title';\n\nexport class BaseAppComponent {\n private readonly telegramAuthService = inject(TelegramAuthService);\n private readonly router = inject(Router);\n private readonly analyticsService = inject(AnalyticsService);\n private readonly authStateService = inject(SneatAuthStateService);\n protected readonly topMenuService = inject(TopMenuService); // used in templates\n\n private authStatus?: AuthStatus;\n\n constructor() {\n this.telegramAuthService.authenticateIfTelegramWebApp();\n // Complete any pending signInWithRedirect when the app boots. The\n // authStateService's onIdTokenChanged listener then propagates the\n // signed-in user. Resolves to null (harmless) when sign-in used a popup or\n // there is no pending redirect. Lives here so every app that extends\n // BaseAppComponent gets redirect-based sign-in for free.\n getRedirectResult(this.authStateService.fbAuth).catch((err) =>\n console.error('getRedirectResult failed', err),\n );\n this.authStateService.authState.subscribe((s) => {\n this.authStatus = s.status;\n });\n this.router.events\n .pipe(filter((event) => event instanceof NavigationEnd))\n .subscribe((event: NavigationEnd) => {\n // The document title itself is owned by SneatTitleStrategy; here we only\n // reuse the same derived page title for the analytics pageview event.\n const title = getRouteTitle(this.router.routerState.snapshot);\n this.analyticsService.logEvent('$pageview', {\n page_path: event.urlAfterRedirects,\n title,\n });\n\n this.forgetCurrentSpaceIfLeftSpaces(event.urlAfterRedirects);\n });\n }\n\n // Keep the persisted current space in sync with where an authenticated user is:\n // once they navigate to a non-space page, forget it so login does not bounce them\n // back to a space they had left. Auth routes are ignored so signing out from a\n // space still restores it; the `authenticated` guard preserves the value during\n // the logged-out login flow so the login page can still read it.\n private forgetCurrentSpaceIfLeftSpaces(url: string): void {\n if (this.authStatus !== 'authenticated') {\n return;\n }\n if (\n url.startsWith('/space/') ||\n url.startsWith('/login') ||\n url.startsWith('/signed-out')\n ) {\n return;\n }\n clearCurrentSpace();\n }\n}\n"]}
1
+ {"version":3,"file":"base-app.component.js","sourceRoot":"","sources":["../../../../../libs/app/src/lib/base-app.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,OAAO,gBAAgB;IAQ3B;QAPA,uEAAuE;QACpD,mBAAc,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;QAC1C,2BAAsB,GAAG,MAAM,CAC9C,6BAA6B,EAC7B,EAAE,QAAQ,EAAE,IAAI,EAAE,CACnB,CAAC;QAGA,0EAA0E;QAC1E,yEAAyE;QACzE,IAAI,CAAC,sBAAsB,EAAE,KAAK,EAAE,CAAC;IACvC,CAAC;CACF","sourcesContent":["import { inject } from '@angular/core';\nimport { SNEAT_AUTHENTICATED_LIFECYCLE } from '@sneat/app-public';\nimport { TopMenuService } from '@sneat/core';\n\nexport class BaseAppComponent {\n // Kept protected for existing Ionic-shell templates that inherited it.\n protected readonly topMenuService = inject(TopMenuService);\n private readonly authenticatedLifecycle = inject(\n SNEAT_AUTHENTICATED_LIFECYCLE,\n { optional: true },\n );\n\n constructor() {\n // Legacy full shells install this at root. PrimeNG apps install it in the\n // lazy authenticated route; its environment initializer starts it there.\n this.authenticatedLifecycle?.start();\n }\n}\n"]}
@@ -1,69 +1,26 @@
1
- import { provideHttpClient } from '@angular/common/http';
2
- import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
3
- import { RouteReuseStrategy, TitleStrategy } from '@angular/router';
4
- import { IonicRouteStrategy } from '@ionic/angular/standalone';
5
- import { provideIonicAngular } from '@ionic/angular/standalone';
6
- import { DefaultSneatAppApiBaseUrl, SneatApiBaseUrl } from '@sneat/api';
7
- import { TelegramAuthService } from '@sneat/auth-core';
8
- import { LOGGER_FACTORY, loggerFactory, TopMenuService } from '@sneat/core';
9
- import { provideChunkLoadErrorRecovery, provideErrorLogger, provideSentryAppInitializer, provideSneatAnalytics, } from '@sneat/logging';
1
+ import { provideSneatAuthenticatedProviders } from '@sneat/app-auth';
2
+ import { provideSneatIonicShell } from '@sneat/app-ionic';
3
+ import { provideSneatPublicBootstrap } from '@sneat/app-public';
4
+ import { EnvConfigToken, TopMenuService } from '@sneat/core';
10
5
  import { RANDOM_ID_OPTIONS } from '@sneat/random';
11
6
  import { AppComponentService } from './app-component.service';
12
- import { EnvConfigToken } from '@sneat/core';
13
- import { getAngularFireProviders } from './init-firebase';
14
- import { SneatTitleStrategy } from './sneat-title.strategy';
15
- // import { getAngularFireImports } from './init-firebase';
16
- import { registerPosthog } from './register-posthog';
7
+ /** Legacy all-in-one bootstrap. New PrimeNG public/cockpit apps should import
8
+ * @sneat/app-public and add @sneat/app-auth only to their lazy private routes. */
17
9
  export function getStandardSneatProviders(environmentConfig) {
18
- // console.log(
19
- // 'getStandardSneatProviders(), environmentConfig:' +
20
- // JSON.stringify(environmentConfig, undefined, '\t'),
21
- // );
22
- if (environmentConfig.posthog) {
23
- registerPosthog(environmentConfig.posthog);
24
- }
25
- const providers = [
26
- provideHttpClient(),
27
- provideErrorLogger(),
28
- // Auto-reload once on a stale lazy-chunk load after a deploy. Baseline for
29
- // apps without Sentry; Sentry's own (chunk-aware) handler overrides it when
30
- // configured (pushed later below).
31
- provideChunkLoadErrorRecovery(),
32
- provideIonicAngular(),
33
- provideAnimationsAsync(),
34
- { provide: LOGGER_FACTORY, useValue: loggerFactory },
35
- { provide: EnvConfigToken, useValue: environmentConfig },
36
- {
37
- provide: RouteReuseStrategy,
38
- useClass: IonicRouteStrategy,
39
- },
40
- {
41
- // Owns document.title for every app: composes the route's data.title
42
- // with APP_INFO.appTitle, and lets pages override via PageTitleService.
43
- provide: TitleStrategy,
44
- useClass: SneatTitleStrategy,
45
- },
46
- {
47
- provide: SneatApiBaseUrl,
48
- useValue: environmentConfig.useNgrok
10
+ return [
11
+ provideSneatPublicBootstrap({
12
+ apiBaseUrl: environmentConfig.useNgrok
49
13
  ? `//${location.host}/v0/`
50
14
  : environmentConfig.firebaseConfig.emulator
51
- ? 'https://local-api.sneat.ws/v0/' // 'http://localhost:4300/v0/'
52
- : DefaultSneatAppApiBaseUrl,
53
- },
54
- {
55
- provide: RANDOM_ID_OPTIONS,
56
- useValue: { len: 9 },
57
- },
58
- getAngularFireProviders(environmentConfig.firebaseConfig),
59
- provideSneatAnalytics(environmentConfig),
60
- AppComponentService, // TODO: check if it's used and probably remove
15
+ ? 'https://local-api.sneat.ws/v0/'
16
+ : undefined,
17
+ }),
18
+ provideSneatAuthenticatedProviders(environmentConfig),
19
+ provideSneatIonicShell(),
20
+ { provide: EnvConfigToken, useValue: environmentConfig },
21
+ { provide: RANDOM_ID_OPTIONS, useValue: { len: 9 } },
22
+ AppComponentService,
61
23
  TopMenuService,
62
- TelegramAuthService,
63
24
  ];
64
- if (environmentConfig.sentry) {
65
- providers.push(provideSentryAppInitializer(environmentConfig.sentry));
66
- }
67
- return providers;
68
25
  }
69
26
  //# sourceMappingURL=get-standard-sneat-providers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-standard-sneat-providers.js","sourceRoot":"","sources":["../../../../../libs/app/src/lib/get-standard-sneat-providers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,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BAAkB;YAC3B,QAAQ,EAAE,kBAAkB;SAC7B;QACD;YACE,qEAAqE;YACrE,wEAAwE;YACxE,OAAO,EAAE,aAAa;YACtB,QAAQ,EAAE,kBAAkB;SAC7B;QACD;YACE,OAAO,EAAE,eAAe;YACxB,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;gBAClC,CAAC,CAAC,KAAK,QAAQ,CAAC,IAAI,MAAM;gBAC1B,CAAC,CAAC,iBAAiB,CAAC,cAAc,CAAC,QAAQ;oBACzC,CAAC,CAAC,gCAAgC,CAAC,8BAA8B;oBACjE,CAAC,CAAC,yBAAyB;SAChC;QACD;YACE,OAAO,EAAE,iBAAiB;YAC1B,QAAQ,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE;SACrB;QACD,uBAAuB,CAAC,iBAAiB,CAAC,cAAc,CAAC;QACzD,qBAAqB,CAAC,iBAAiB,CAAC;QACxC,mBAAmB,EAAE,+CAA+C;QACpE,cAAc;QACd,mBAAmB;KACpB,CAAC;IACF,IAAI,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAC7B,SAAS,CAAC,IAAI,CAAC,2BAA2B,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { provideHttpClient } from '@angular/common/http';\nimport { EnvironmentProviders, Provider } from '@angular/core';\nimport { provideAnimationsAsync } from '@angular/platform-browser/animations/async';\nimport { RouteReuseStrategy, TitleStrategy } from '@angular/router';\nimport { IonicRouteStrategy } from '@ionic/angular/standalone';\nimport { provideIonicAngular } from '@ionic/angular/standalone';\nimport { DefaultSneatAppApiBaseUrl, SneatApiBaseUrl } from '@sneat/api';\nimport { TelegramAuthService } from '@sneat/auth-core';\nimport { LOGGER_FACTORY, loggerFactory, TopMenuService } from '@sneat/core';\nimport {\n provideChunkLoadErrorRecovery,\n provideErrorLogger,\n provideSentryAppInitializer,\n provideSneatAnalytics,\n} from '@sneat/logging';\nimport { RANDOM_ID_OPTIONS } from '@sneat/random';\nimport { AppComponentService } from './app-component.service';\nimport { EnvConfigToken, IEnvironmentConfig } from '@sneat/core';\nimport { getAngularFireProviders } from './init-firebase';\nimport { SneatTitleStrategy } from './sneat-title.strategy';\n\n// import { getAngularFireImports } from './init-firebase';\n\nimport { registerPosthog } from './register-posthog';\n\nexport function getStandardSneatProviders(\n environmentConfig: IEnvironmentConfig,\n): readonly (Provider | EnvironmentProviders)[] {\n // console.log(\n // \t'getStandardSneatProviders(), environmentConfig:' +\n // \t\tJSON.stringify(environmentConfig, undefined, '\\t'),\n // );\n if (environmentConfig.posthog) {\n registerPosthog(environmentConfig.posthog);\n }\n\n const providers = [\n provideHttpClient(),\n provideErrorLogger(),\n // Auto-reload once on a stale lazy-chunk load after a deploy. Baseline for\n // apps without Sentry; Sentry's own (chunk-aware) handler overrides it when\n // configured (pushed later below).\n provideChunkLoadErrorRecovery(),\n provideIonicAngular(),\n provideAnimationsAsync(),\n { provide: LOGGER_FACTORY, useValue: loggerFactory },\n { provide: EnvConfigToken, useValue: environmentConfig },\n {\n provide: RouteReuseStrategy,\n useClass: IonicRouteStrategy,\n },\n {\n // Owns document.title for every app: composes the route's data.title\n // with APP_INFO.appTitle, and lets pages override via PageTitleService.\n provide: TitleStrategy,\n useClass: SneatTitleStrategy,\n },\n {\n provide: SneatApiBaseUrl,\n useValue: environmentConfig.useNgrok\n ? `//${location.host}/v0/`\n : environmentConfig.firebaseConfig.emulator\n ? 'https://local-api.sneat.ws/v0/' // 'http://localhost:4300/v0/'\n : DefaultSneatAppApiBaseUrl,\n },\n {\n provide: RANDOM_ID_OPTIONS,\n useValue: { len: 9 },\n },\n getAngularFireProviders(environmentConfig.firebaseConfig),\n provideSneatAnalytics(environmentConfig),\n AppComponentService, // TODO: check if it's used and probably remove\n TopMenuService,\n TelegramAuthService,\n ];\n if (environmentConfig.sentry) {\n providers.push(provideSentryAppInitializer(environmentConfig.sentry));\n }\n return providers;\n}\n"]}
1
+ {"version":3,"file":"get-standard-sneat-providers.js","sourceRoot":"","sources":["../../../../../libs/app/src/lib/get-standard-sneat-providers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kCAAkC,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAsB,cAAc,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D;kFACkF;AAClF,MAAM,UAAU,yBAAyB,CACvC,iBAAqC;IAErC,OAAO;QACL,2BAA2B,CAAC;YAC1B,UAAU,EAAE,iBAAiB,CAAC,QAAQ;gBACpC,CAAC,CAAC,KAAK,QAAQ,CAAC,IAAI,MAAM;gBAC1B,CAAC,CAAC,iBAAiB,CAAC,cAAc,CAAC,QAAQ;oBACzC,CAAC,CAAC,gCAAgC;oBAClC,CAAC,CAAC,SAAS;SAChB,CAAC;QACF,kCAAkC,CAAC,iBAAiB,CAAC;QACrD,sBAAsB,EAAE;QACxB,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,iBAAiB,EAAE;QACxD,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;QACpD,mBAAmB;QACnB,cAAc;KACf,CAAC;AACJ,CAAC","sourcesContent":["import { EnvironmentProviders, Provider } from '@angular/core';\nimport { provideSneatAuthenticatedProviders } from '@sneat/app-auth';\nimport { provideSneatIonicShell } from '@sneat/app-ionic';\nimport { provideSneatPublicBootstrap } from '@sneat/app-public';\nimport { EnvConfigToken, IEnvironmentConfig, TopMenuService } from '@sneat/core';\nimport { RANDOM_ID_OPTIONS } from '@sneat/random';\nimport { AppComponentService } from './app-component.service';\n\n/** Legacy all-in-one bootstrap. New PrimeNG public/cockpit apps should import\n * @sneat/app-public and add @sneat/app-auth only to their lazy private routes. */\nexport function getStandardSneatProviders(\n environmentConfig: IEnvironmentConfig,\n): readonly (Provider | EnvironmentProviders)[] {\n return [\n provideSneatPublicBootstrap({\n apiBaseUrl: environmentConfig.useNgrok\n ? `//${location.host}/v0/`\n : environmentConfig.firebaseConfig.emulator\n ? 'https://local-api.sneat.ws/v0/'\n : undefined,\n }),\n provideSneatAuthenticatedProviders(environmentConfig),\n provideSneatIonicShell(),\n { provide: EnvConfigToken, useValue: environmentConfig },\n { provide: RANDOM_ID_OPTIONS, useValue: { len: 9 } },\n AppComponentService,\n TopMenuService,\n ];\n}\n"]}
@@ -1,85 +1,2 @@
1
- import { getAnalytics, provideAnalytics } from '@angular/fire/analytics';
2
- import { connectAuthEmulator, indexedDBLocalPersistence, initializeAuth, provideAuth, } from '@angular/fire/auth';
3
- import { connectFirestoreEmulator } from '@angular/fire/firestore';
4
- import { Capacitor } from '@capacitor/core';
5
- import { provideFirebaseApp, initializeApp, FirebaseApp, } from '@angular/fire/app';
6
- import { getAuth } from 'firebase/auth';
7
- import { getFirestore, provideFirestore } from '@angular/fire/firestore';
8
- import { isLocalhost } from './init-helpers';
9
- // Defense in depth: a production bundle should never carry emulator config
10
- // (use appEnvironmentConfig()), but if one slips through, refuse to point real
11
- // users at 127.0.0.1 — that just yields "refused to connect". Warn loudly so a
12
- // post-deploy smoke test (and the console) surfaces the misconfiguration.
13
- function emulatorAllowed(hasEmulator) {
14
- if (!hasEmulator) {
15
- return false;
16
- }
17
- if (isLocalhost()) {
18
- return true;
19
- }
20
- console.error('[init-firebase] Emulator config present on a non-localhost host ' +
21
- `("${typeof location !== 'undefined' ? location.hostname : '?'}") — ` +
22
- 'ignoring it. This is a build/deploy misconfiguration: a production ' +
23
- 'build shipped the emulator environment.');
24
- return false;
25
- }
26
- export function provideFireApp(firebaseConfig) {
27
- return provideFirebaseApp(() => initFirebase(firebaseConfig));
28
- }
29
- export function getAngularFireProviders(firebaseConfig) {
30
- const providers = [
31
- provideFirebaseApp(() => initFirebase(firebaseConfig)),
32
- provideFirestore((injector) => {
33
- // console.log('AngularFire: provideFirestore');
34
- const fbApp = injector.get(FirebaseApp);
35
- const firestore = getFirestore(fbApp);
36
- const { emulator } = firebaseConfig;
37
- if (emulator && emulatorAllowed(!!emulator)) {
38
- connectFirestoreEmulator(firestore, emulator.firestoreHost || '127.0.0.1', emulator.firestorePort);
39
- if (emulator.firestorePort === 443) {
40
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
41
- // @ts-expect-error
42
- firestore['_settings']['ssl'] = true;
43
- }
44
- }
45
- return firestore;
46
- }),
47
- provideAuth((injector) => {
48
- // console.log('AngularFire: provideAuth');
49
- const fbApp = injector.get(FirebaseApp);
50
- let auth;
51
- if (Capacitor.isNativePlatform()) {
52
- auth = initializeAuth(fbApp, {
53
- persistence: indexedDBLocalPersistence,
54
- });
55
- }
56
- else {
57
- auth = getAuth(fbApp);
58
- }
59
- const { emulator } = firebaseConfig;
60
- if (emulator?.authPort && emulatorAllowed(!!emulator)) {
61
- // alert('Using firebase auth emulator');
62
- const authUrl = `${emulator.authPort === 443 ? 'https' : 'http'}://${emulator.authHost || '127.0.0.1'}:${emulator.authPort}`;
63
- // console.log('authUrl: ', authUrl);
64
- // noinspection HttpUrlsUsage
65
- connectAuthEmulator(auth, authUrl);
66
- }
67
- return auth;
68
- }),
69
- ];
70
- if (firebaseConfig?.measurementId !== 'G-PROVIDE_IF_NEEDED') {
71
- providers.push(provideAnalytics(() => {
72
- // const fbApp = injector.get<FirebaseApp>(
73
- // FirebaseApp as Type<FirebaseApp>,
74
- // );
75
- // const fbAnalytics = getAnalytics(fbApp);
76
- const fbAnalytics = getAnalytics();
77
- return fbAnalytics;
78
- }));
79
- }
80
- return providers;
81
- }
82
- function initFirebase(firebaseConfig) {
83
- return initializeApp(firebaseConfig);
84
- }
1
+ export { getAngularFireProviders, provideFireApp, } from '@sneat/app-auth';
85
2
  //# sourceMappingURL=init-firebase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-firebase.js","sourceRoot":"","sources":["../../../../../libs/app/src/lib/init-firebase.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAEL,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,EACd,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,2EAA2E;AAC3E,+EAA+E;AAC/E,+EAA+E;AAC/E,0EAA0E;AAC1E,SAAS,eAAe,CAAC,WAAoB;IAC3C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,WAAW,EAAE,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,KAAK,CACX,kEAAkE;QAChE,KAAK,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO;QACrE,qEAAqE;QACrE,yCAAyC,CAC5C,CAAC;IACF,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,cAA+B;IAC5D,OAAO,kBAAkB,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC;AAChE,CAAC;A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AC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACtD,yCAAyC;gBACzC,MAAM,OAAO,GAAG,GAAG,QAAQ,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,MAAM,QAAQ,CAAC,QAAQ,IAAI,WAAW,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBAC7H,qCAAqC;gBACrC,6BAA6B;gBAC7B,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACrC,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;KACH,CAAC;IACF,IAAI,cAAc,EAAE,aAAa,KAAK,qBAAqB,EAAE,CAAC;QAC5D,SAAS,CAAC,IAAI,CACZ,gBAAgB,CAAC,GAAG,EAAE;YACpB,2CAA2C;YAC3C,qCAAqC;YACrC,KAAK;YACL,2CAA2C;YAC3C,MAAM,WAAW,GAAG,YAAY,EAAE,CAAC;YACnC,OAAO,WAAW,CAAC;QACrB,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,YAAY,CAAC,cAA+B;IACnD,OAAO,aAAa,CAAC,cAAc,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import { EnvironmentProviders, Type } from '@angular/core';\nimport { getAnalytics, provideAnalytics } from '@angular/fire/analytics';\nimport {\n Auth,\n connectAuthEmulator,\n indexedDBLocalPersistence,\n initializeAuth,\n provideAuth,\n} from '@angular/fire/auth';\nimport { connectFirestoreEmulator } from '@angular/fire/firestore';\nimport { Capacitor } from '@capacitor/core';\nimport { IFirebaseConfig } from '@sneat/core';\nimport {\n provideFirebaseApp,\n initializeApp,\n FirebaseApp,\n} from '@angular/fire/app';\nimport { getAuth } from 'firebase/auth';\nimport { getFirestore, provideFirestore } from '@angular/fire/firestore';\nimport { isLocalhost } from './init-helpers';\n\n// Defense in depth: a production bundle should never carry emulator config\n// (use appEnvironmentConfig()), but if one slips through, refuse to point real\n// users at 127.0.0.1 — that just yields \"refused to connect\". Warn loudly so a\n// post-deploy smoke test (and the console) surfaces the misconfiguration.\nfunction emulatorAllowed(hasEmulator: boolean): boolean {\n if (!hasEmulator) {\n return false;\n }\n if (isLocalhost()) {\n return true;\n }\n console.error(\n '[init-firebase] Emulator config present on a non-localhost host ' +\n `(\"${typeof location !== 'undefined' ? location.hostname : '?'}\") — ` +\n 'ignoring it. This is a build/deploy misconfiguration: a production ' +\n 'build shipped the emulator environment.',\n );\n return false;\n}\n\nexport function provideFireApp(firebaseConfig: IFirebaseConfig) {\n return provideFirebaseApp(() => initFirebase(firebaseConfig));\n}\n\nexport function getAngularFireProviders(\n firebaseConfig: IFirebaseConfig,\n): EnvironmentProviders[] {\n const providers = [\n provideFirebaseApp(() => initFirebase(firebaseConfig)),\n provideFirestore((injector) => {\n // console.log('AngularFire: provideFirestore');\n const fbApp = injector.get(FirebaseApp);\n const firestore = getFirestore(fbApp);\n const { emulator } = firebaseConfig;\n if (emulator && emulatorAllowed(!!emulator)) {\n connectFirestoreEmulator(\n firestore,\n emulator.firestoreHost || '127.0.0.1',\n emulator.firestorePort,\n );\n if (emulator.firestorePort === 443) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n firestore['_settings']['ssl'] = true;\n }\n }\n return firestore;\n }),\n provideAuth((injector) => {\n // console.log('AngularFire: provideAuth');\n const fbApp = injector.get<FirebaseApp>(FirebaseApp as Type<FirebaseApp>);\n let auth: Auth;\n if (Capacitor.isNativePlatform()) {\n auth = initializeAuth(fbApp, {\n persistence: indexedDBLocalPersistence,\n });\n } else {\n auth = getAuth(fbApp);\n }\n const { emulator } = firebaseConfig;\n if (emulator?.authPort && emulatorAllowed(!!emulator)) {\n // alert('Using firebase auth emulator');\n const authUrl = `${emulator.authPort === 443 ? 'https' : 'http'}://${emulator.authHost || '127.0.0.1'}:${emulator.authPort}`;\n // console.log('authUrl: ', authUrl);\n // noinspection HttpUrlsUsage\n connectAuthEmulator(auth, authUrl);\n }\n return auth;\n }),\n ];\n if (firebaseConfig?.measurementId !== 'G-PROVIDE_IF_NEEDED') {\n providers.push(\n provideAnalytics(() => {\n // const fbApp = injector.get<FirebaseApp>(\n // \tFirebaseApp as Type<FirebaseApp>,\n // );\n // const fbAnalytics = getAnalytics(fbApp);\n const fbAnalytics = getAnalytics();\n return fbAnalytics;\n }),\n );\n }\n return providers;\n}\n\nfunction initFirebase(firebaseConfig: IFirebaseConfig): FirebaseApp {\n return initializeApp(firebaseConfig);\n}\n"]}
1
+ {"version":3,"file":"init-firebase.js","sourceRoot":"","sources":["../../../../../libs/app/src/lib/init-firebase.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,cAAc,GACf,MAAM,iBAAiB,CAAC","sourcesContent":["export {\n getAngularFireProviders,\n provideFireApp,\n} from '@sneat/app-auth';\n"]}
package/index.d.ts CHANGED
@@ -10,6 +10,4 @@ export * from './lib/contact-extensions';
10
10
  export * from './lib/get-standard-sneat-providers';
11
11
  export * from './lib/app-specific-providers';
12
12
  export * from './lib/capacitator-http.service';
13
- export * from './lib/page-title.service';
14
- export * from './lib/sneat-title.strategy';
15
- export * from './lib/route-title';
13
+ export { PageTitleService, SneatTitleStrategy, SNEAT_AUTHENTICATED_LIFECYCLE, } from '@sneat/app-public';
@@ -1,5 +1,4 @@
1
1
  import { Provider } from '@angular/core';
2
2
  import { ContactRolesByType } from './contact-extensions';
3
- import { IAppInfo } from '@sneat/core';
4
- export declare function provideAppInfo(appInfo: IAppInfo): Provider;
3
+ export { provideAppInfo } from '@sneat/app-public';
5
4
  export declare function provideRolesByType(contactRolesByType: ContactRolesByType | undefined): Provider;
@@ -1,11 +1,6 @@
1
1
  import { TopMenuService } from '@sneat/core';
2
2
  export declare class BaseAppComponent {
3
- private readonly telegramAuthService;
4
- private readonly router;
5
- private readonly analyticsService;
6
- private readonly authStateService;
7
3
  protected readonly topMenuService: TopMenuService;
8
- private authStatus?;
4
+ private readonly authenticatedLifecycle;
9
5
  constructor();
10
- private forgetCurrentSpaceIfLeftSpaces;
11
6
  }
@@ -1,3 +1,5 @@
1
1
  import { EnvironmentProviders, Provider } from '@angular/core';
2
2
  import { IEnvironmentConfig } from '@sneat/core';
3
+ /** Legacy all-in-one bootstrap. New PrimeNG public/cockpit apps should import
4
+ * @sneat/app-public and add @sneat/app-auth only to their lazy private routes. */
3
5
  export declare function getStandardSneatProviders(environmentConfig: IEnvironmentConfig): readonly (Provider | EnvironmentProviders)[];
@@ -1,4 +1 @@
1
- import { EnvironmentProviders } from '@angular/core';
2
- import { IFirebaseConfig } from '@sneat/core';
3
- export declare function provideFireApp(firebaseConfig: IFirebaseConfig): EnvironmentProviders;
4
- export declare function getAngularFireProviders(firebaseConfig: IFirebaseConfig): EnvironmentProviders[];
1
+ export { getAngularFireProviders, provideFireApp, } from '@sneat/app-auth';
package/package.json CHANGED
@@ -1,13 +1,31 @@
1
1
  {
2
2
  "name": "@sneat/app",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "peerDependencies": {
8
8
  "@angular/common": ">=21.0.0",
9
9
  "@angular/core": ">=21.0.0",
10
- "@sneat/extension-contactus-contract": "^0.12.0"
10
+ "@angular/fire": ">=20",
11
+ "@angular/platform-browser": ">=21.0.0",
12
+ "@angular/router": ">=21.0.0",
13
+ "@capacitor/core": ">=8.0.0",
14
+ "@ionic-native/splash-screen": "^5.36.0",
15
+ "@ionic-native/status-bar": "^5.36.0",
16
+ "@ionic/angular": ">=8.0.0",
17
+ "@sneat/app-auth": "^0.25.0",
18
+ "@sneat/app-ionic": "^0.25.0",
19
+ "@sneat/app-public": "^0.25.0",
20
+ "@sneat/auth-core": "^0.25.0",
21
+ "@sneat/core": "^0.25.0",
22
+ "@sneat/extension-contactus-contract": "^0.12.0",
23
+ "@sneat/logging": "^0.25.0",
24
+ "@sneat/random": "*",
25
+ "@sneat/space-services": "^0.25.0",
26
+ "firebase": "*",
27
+ "rxjs": ">=7.8.0",
28
+ "zone.js": ">=0.16.0"
11
29
  },
12
30
  "dependencies": {
13
31
  "tslib": "2.8.1"