@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 +1 -3
- package/esm2022/index.js.map +1 -1
- package/esm2022/lib/app-specific-providers.js +1 -7
- package/esm2022/lib/app-specific-providers.js.map +1 -1
- package/esm2022/lib/base-app.component.js +8 -49
- package/esm2022/lib/base-app.component.js.map +1 -1
- package/esm2022/lib/get-standard-sneat-providers.js +17 -60
- package/esm2022/lib/get-standard-sneat-providers.js.map +1 -1
- package/esm2022/lib/init-firebase.js +1 -84
- package/esm2022/lib/init-firebase.js.map +1 -1
- package/index.d.ts +1 -3
- package/lib/app-specific-providers.d.ts +1 -2
- package/lib/base-app.component.d.ts +1 -6
- package/lib/get-standard-sneat-providers.d.ts +2 -0
- package/lib/init-firebase.d.ts +1 -4
- package/package.json +20 -2
- package/tsconfig.lib.prod.tsbuildinfo +1 -1
- package/esm2022/lib/page-title.service.js +0 -42
- package/esm2022/lib/page-title.service.js.map +0 -1
- package/esm2022/lib/register-posthog.js +0 -11
- package/esm2022/lib/register-posthog.js.map +0 -1
- package/esm2022/lib/route-title.js +0 -24
- package/esm2022/lib/route-title.js.map +0 -1
- package/esm2022/lib/sneat-title.strategy.js +0 -28
- package/esm2022/lib/sneat-title.strategy.js.map +0 -1
- package/lib/page-title.service.d.ts +0 -10
- package/lib/register-posthog.d.ts +0 -2
- package/lib/route-title.d.ts +0 -2
- package/lib/sneat-title.strategy.d.ts +0 -8
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
|
|
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
|
package/esm2022/index.js.map
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
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,
|
|
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 {
|
|
3
|
-
import {
|
|
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
|
-
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
14
|
-
|
|
15
|
-
this.
|
|
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,
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
-
|
|
13
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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/'
|
|
52
|
-
:
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
|
|
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":"
|
|
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
|
-
|
|
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":"
|
|
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
|
|
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
|
-
|
|
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
|
|
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)[];
|
package/lib/init-firebase.d.ts
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
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.
|
|
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
|
-
"@
|
|
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"
|