@angular/fire 7.5.0 → 7.6.0-canary.34e89a4

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.
Files changed (154) hide show
  1. package/README.md +95 -74
  2. package/analytics/is-analytics-supported-factory.d.ts +4 -0
  3. package/bundles/angular-fire-analytics.umd.js +41 -31
  4. package/bundles/angular-fire-analytics.umd.js.map +1 -1
  5. package/bundles/angular-fire-app-check.umd.js +14 -18
  6. package/bundles/angular-fire-app-check.umd.js.map +1 -1
  7. package/bundles/angular-fire-app.umd.js +14 -18
  8. package/bundles/angular-fire-app.umd.js.map +1 -1
  9. package/bundles/angular-fire-auth-guard.umd.js +5 -7
  10. package/bundles/angular-fire-auth-guard.umd.js.map +1 -1
  11. package/bundles/angular-fire-auth.umd.js +64 -68
  12. package/bundles/angular-fire-auth.umd.js.map +1 -1
  13. package/bundles/angular-fire-compat-analytics.umd.js +11 -13
  14. package/bundles/angular-fire-compat-analytics.umd.js.map +1 -1
  15. package/bundles/angular-fire-compat-auth-guard.umd.js +6 -8
  16. package/bundles/angular-fire-compat-auth-guard.umd.js.map +1 -1
  17. package/bundles/angular-fire-compat-auth.umd.js +11 -13
  18. package/bundles/angular-fire-compat-auth.umd.js.map +1 -1
  19. package/bundles/angular-fire-compat-database.umd.js +9 -11
  20. package/bundles/angular-fire-compat-database.umd.js.map +1 -1
  21. package/bundles/angular-fire-compat-firestore.umd.js +9 -11
  22. package/bundles/angular-fire-compat-firestore.umd.js.map +1 -1
  23. package/bundles/angular-fire-compat-functions.umd.js +9 -11
  24. package/bundles/angular-fire-compat-functions.umd.js.map +1 -1
  25. package/bundles/angular-fire-compat-messaging.umd.js +8 -10
  26. package/bundles/angular-fire-compat-messaging.umd.js.map +1 -1
  27. package/bundles/angular-fire-compat-performance.umd.js +8 -10
  28. package/bundles/angular-fire-compat-performance.umd.js.map +1 -1
  29. package/bundles/angular-fire-compat-remote-config.umd.js +9 -11
  30. package/bundles/angular-fire-compat-remote-config.umd.js.map +1 -1
  31. package/bundles/angular-fire-compat-storage.umd.js +8 -10
  32. package/bundles/angular-fire-compat-storage.umd.js.map +1 -1
  33. package/bundles/angular-fire-compat.umd.js +13 -15
  34. package/bundles/angular-fire-compat.umd.js.map +1 -1
  35. package/bundles/angular-fire-database.umd.js +59 -67
  36. package/bundles/angular-fire-database.umd.js.map +1 -1
  37. package/bundles/angular-fire-firestore-lite.umd.js +50 -54
  38. package/bundles/angular-fire-firestore-lite.umd.js.map +1 -1
  39. package/bundles/angular-fire-firestore.umd.js +67 -71
  40. package/bundles/angular-fire-firestore.umd.js.map +1 -1
  41. package/bundles/angular-fire-functions.umd.js +15 -19
  42. package/bundles/angular-fire-functions.umd.js.map +1 -1
  43. package/bundles/angular-fire-messaging.umd.js +33 -23
  44. package/bundles/angular-fire-messaging.umd.js.map +1 -1
  45. package/bundles/angular-fire-performance.umd.js +17 -21
  46. package/bundles/angular-fire-performance.umd.js.map +1 -1
  47. package/bundles/angular-fire-remote-config.umd.js +47 -37
  48. package/bundles/angular-fire-remote-config.umd.js.map +1 -1
  49. package/bundles/angular-fire-storage.umd.js +27 -31
  50. package/bundles/angular-fire-storage.umd.js.map +1 -1
  51. package/bundles/angular-fire.umd.js +16 -59
  52. package/bundles/angular-fire.umd.js.map +1 -1
  53. package/compat/firestore/interfaces.d.ts +4 -4
  54. package/core.d.ts +1 -12
  55. package/docs/analytics.md +67 -0
  56. package/docs/app-check.md +53 -0
  57. package/docs/auth.md +165 -0
  58. package/docs/{analytics → compat/analytics}/getting-started.md +2 -0
  59. package/docs/{auth → compat/auth}/getting-started.md +2 -0
  60. package/docs/{auth → compat/auth}/router-guards.md +2 -0
  61. package/docs/{emulators → compat/emulators}/emulators.md +2 -0
  62. package/docs/{firestore → compat/firestore}/collections.md +2 -0
  63. package/docs/{firestore → compat/firestore}/documents.md +2 -0
  64. package/docs/{firestore → compat/firestore}/offline-data.md +2 -0
  65. package/docs/{firestore → compat/firestore}/querying-collections.md +2 -0
  66. package/docs/{functions → compat/functions}/functions.md +2 -0
  67. package/docs/{messaging → compat/messaging}/messaging.md +2 -0
  68. package/docs/{performance → compat/performance}/getting-started.md +2 -0
  69. package/docs/{remote-config → compat/remote-config}/getting-started.md +2 -0
  70. package/docs/{rtdb → compat/rtdb}/lists.md +2 -0
  71. package/docs/{rtdb → compat/rtdb}/objects.md +2 -0
  72. package/docs/{rtdb → compat/rtdb}/querying-lists.md +2 -0
  73. package/docs/{storage → compat/storage}/storage.md +2 -0
  74. package/docs/compat.md +70 -0
  75. package/docs/database.md +175 -0
  76. package/docs/deploy/getting-started.md +2 -2
  77. package/docs/firestore.md +148 -0
  78. package/docs/functions.md +52 -0
  79. package/docs/images/analytics-illo_1x.png +0 -0
  80. package/docs/images/auth-illo_1x.png +0 -0
  81. package/docs/images/cloud-messaging-illo_1x.png +0 -0
  82. package/docs/images/database-illo_1x.png +0 -0
  83. package/docs/images/firestore-illo_1x.png +0 -0
  84. package/docs/images/functions-illo_1x.png +0 -0
  85. package/docs/images/hosting-illo_1x.png +0 -0
  86. package/docs/images/performance-illo_1x.png +0 -0
  87. package/docs/images/reCAPTCHA-logo@1x.png +0 -0
  88. package/docs/images/remote-config-illo_1x.png +0 -0
  89. package/docs/images/storage-illo_1x.png +0 -0
  90. package/docs/install-and-setup.md +39 -86
  91. package/docs/install-firebase-tools.md +78 -0
  92. package/docs/messaging.md +25 -0
  93. package/docs/performance.md +57 -0
  94. package/docs/remote-config.md +53 -0
  95. package/docs/storage.md +90 -0
  96. package/docs/universal/cloud-functions.md +27 -6
  97. package/docs/universal/getting-started.md +9 -134
  98. package/esm2015/analytics/analytics.module.js +7 -6
  99. package/esm2015/analytics/is-analytics-supported-factory.js +16 -0
  100. package/esm2015/analytics/overrides.js +3 -3
  101. package/esm2015/compat/firestore/interfaces.js +1 -1
  102. package/esm2015/core.js +3 -45
  103. package/esm2015/messaging/is-messaging-supported-factory.js +16 -0
  104. package/esm2015/messaging/messaging.module.js +7 -6
  105. package/esm2015/messaging/overrides.js +3 -3
  106. package/esm2015/remote-config/is-remote-config-supported-factory.js +16 -0
  107. package/esm2015/remote-config/overrides.js +3 -3
  108. package/esm2015/remote-config/remote-config.module.js +7 -6
  109. package/fesm2015/angular-fire-analytics.js +21 -7
  110. package/fesm2015/angular-fire-analytics.js.map +1 -1
  111. package/fesm2015/angular-fire-app-check.js.map +1 -1
  112. package/fesm2015/angular-fire-app.js.map +1 -1
  113. package/fesm2015/angular-fire-auth-guard.js.map +1 -1
  114. package/fesm2015/angular-fire-auth.js.map +1 -1
  115. package/fesm2015/angular-fire-compat-analytics.js.map +1 -1
  116. package/fesm2015/angular-fire-compat-auth-guard.js.map +1 -1
  117. package/fesm2015/angular-fire-compat-auth.js.map +1 -1
  118. package/fesm2015/angular-fire-compat-database.js +1 -1
  119. package/fesm2015/angular-fire-compat-database.js.map +1 -1
  120. package/fesm2015/angular-fire-compat-firestore.js +1 -1
  121. package/fesm2015/angular-fire-compat-firestore.js.map +1 -1
  122. package/fesm2015/angular-fire-compat-functions.js.map +1 -1
  123. package/fesm2015/angular-fire-compat-messaging.js.map +1 -1
  124. package/fesm2015/angular-fire-compat-performance.js.map +1 -1
  125. package/fesm2015/angular-fire-compat-remote-config.js.map +1 -1
  126. package/fesm2015/angular-fire-compat-storage.js.map +1 -1
  127. package/fesm2015/angular-fire-compat.js.map +1 -1
  128. package/fesm2015/angular-fire-database.js.map +1 -1
  129. package/fesm2015/angular-fire-firestore-lite.js.map +1 -1
  130. package/fesm2015/angular-fire-firestore.js.map +1 -1
  131. package/fesm2015/angular-fire-functions.js.map +1 -1
  132. package/fesm2015/angular-fire-messaging.js +21 -7
  133. package/fesm2015/angular-fire-messaging.js.map +1 -1
  134. package/fesm2015/angular-fire-performance.js.map +1 -1
  135. package/fesm2015/angular-fire-remote-config.js +22 -8
  136. package/fesm2015/angular-fire-remote-config.js.map +1 -1
  137. package/fesm2015/angular-fire-storage.js.map +1 -1
  138. package/fesm2015/angular-fire.js +3 -45
  139. package/fesm2015/angular-fire.js.map +1 -1
  140. package/messaging/is-messaging-supported-factory.d.ts +4 -0
  141. package/package.json +9 -10
  142. package/remote-config/is-remote-config-supported-factory.d.ts +4 -0
  143. package/schematics/deploy/actions.js +8 -3
  144. package/schematics/deploy/builder.js +2 -2
  145. package/schematics/firebaseTools.js +4 -2
  146. package/schematics/setup/index.js +58 -29
  147. package/schematics/setup/prompts.js +18 -46
  148. package/schematics/utils.js +32 -28
  149. package/docs/ionic/authentication.md +0 -104
  150. package/docs/ionic/cli.md +0 -218
  151. package/docs/ionic/v2.md +0 -531
  152. package/docs/ionic/v3.md +0 -705
  153. package/schematics/setup/ssr.js +0 -100
  154. package/schematics/setup/static.js +0 -78
@@ -1,100 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setupUniversalDeployment = exports.generateFirebaseJson = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const common_1 = require("../common");
6
- const versions_json_1 = require("../versions.json");
7
- const tasks_1 = require("@angular-devkit/schematics/tasks");
8
- const common_2 = require("../common");
9
- function generateHostingConfig(project, dist, functionName, projectType) {
10
- return {
11
- target: project,
12
- public: dist,
13
- ignore: ['**/.*'],
14
- headers: [{
15
- source: '*.[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].+(css|js)',
16
- headers: [{
17
- key: 'Cache-Control',
18
- value: 'public,max-age=31536000,immutable',
19
- }]
20
- }, {
21
- source: '/@(ngsw-worker.js|ngsw.json)',
22
- headers: [{
23
- key: 'Cache-Control',
24
- value: 'no-cache',
25
- }]
26
- }],
27
- rewrites: [
28
- projectType === 1 ? {
29
- source: '**',
30
- function: functionName
31
- } : {
32
- source: '**',
33
- run: { serviceId: functionName }
34
- }
35
- ]
36
- };
37
- }
38
- function generateFunctionsConfig(source) {
39
- return {
40
- source
41
- };
42
- }
43
- function generateFirebaseJson(tree, path, project, dist, functionsOutput, functionName, projectType) {
44
- const firebaseJson = tree.exists(path)
45
- ? common_1.safeReadJSON(path, tree)
46
- : {};
47
- const newConfig = generateHostingConfig(project, dist, functionName, projectType);
48
- if (firebaseJson.hosting === undefined) {
49
- firebaseJson.hosting = [newConfig];
50
- }
51
- else if (Array.isArray(firebaseJson.hosting)) {
52
- const existingConfigIndex = firebaseJson.hosting.findIndex(config => config.target === newConfig.target);
53
- if (existingConfigIndex > -1) {
54
- firebaseJson.hosting.splice(existingConfigIndex, 1, newConfig);
55
- }
56
- else {
57
- firebaseJson.hosting.push(newConfig);
58
- }
59
- }
60
- else {
61
- firebaseJson.hosting = [firebaseJson.hosting, newConfig];
62
- }
63
- if (projectType === 1) {
64
- firebaseJson.functions = generateFunctionsConfig(functionsOutput);
65
- }
66
- common_1.overwriteIfExists(tree, path, common_1.stringifyFormatted(firebaseJson));
67
- }
68
- exports.generateFirebaseJson = generateFirebaseJson;
69
- const setupUniversalDeployment = (config) => {
70
- var _a, _b, _c, _d, _e, _f;
71
- const { tree, workspacePath, workspace, options } = config;
72
- const project = workspace.projects[options.project];
73
- if (!((_c = (_b = (_a = project.architect) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.outputPath)) {
74
- throw new schematics_1.SchematicsException(`Cannot read the output path (architect.build.options.outputPath) of the Angular project "${options.project}" in angular.json`);
75
- }
76
- if (!((_f = (_e = (_d = project.architect) === null || _d === void 0 ? void 0 : _d.server) === null || _e === void 0 ? void 0 : _e.options) === null || _f === void 0 ? void 0 : _f.outputPath)) {
77
- throw new schematics_1.SchematicsException(`Cannot read the output path (architect.server.options.outputPath) of the Angular project "${options.project}" in angular.json`);
78
- }
79
- const ssrDirectory = config.projectType === 1 ? 'functions' : 'run';
80
- const staticOutput = project.architect.build.options.outputPath;
81
- const functionsOutput = `dist/${options.project}/${ssrDirectory}`;
82
- const functionName = config.projectType === 2 ?
83
- `ssr-${options.project.replace('_', '-')}` :
84
- `ssr_${options.project}`;
85
- project.architect.deploy = {
86
- builder: '@angular/fire:deploy',
87
- options: Object.assign(Object.assign(Object.assign({ ssr: config.projectType === 2 ? 'cloud-run' : 'cloud-functions', prerender: options.prerender, firebaseProject: options.firebaseProject.projectId, firebaseHostingSite: common_2.shortSiteName(options.firebaseHostingSite), functionName, functionsNodeVersion: config.nodeVersion, region: 'us-central1', browserTarget: options.browserTarget }, (options.serverTarget ? { serverTarget: options.serverTarget } : {})), (options.prerenderTarget ? { prerenderTarget: options.prerenderTarget } : {})), { outputPath: functionsOutput })
88
- };
89
- tree.overwrite(workspacePath, JSON.stringify(workspace, null, 2));
90
- common_1.addDependencies(tree, Object.entries(versions_json_1.firebaseFunctionsDependencies).reduce((acc, [dep, deets]) => {
91
- deets.dev = true;
92
- acc[dep] = deets;
93
- return acc;
94
- }, {}), config.context);
95
- config.context.addTask(new tasks_1.NodePackageInstallTask());
96
- generateFirebaseJson(tree, 'firebase.json', options.project, staticOutput, functionsOutput, functionName, config.projectType);
97
- common_1.generateFirebaseRc(tree, '.firebaserc', options.firebaseProject.projectId, options.firebaseHostingSite, options.project);
98
- return tree;
99
- };
100
- exports.setupUniversalDeployment = setupUniversalDeployment;
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setupStaticDeployment = exports.generateFirebaseJson = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const common_1 = require("../common");
6
- const common_2 = require("../common");
7
- function emptyFirebaseJson() {
8
- return {
9
- hosting: []
10
- };
11
- }
12
- function generateHostingConfig(project, dist) {
13
- return {
14
- target: project,
15
- public: dist,
16
- ignore: ['**/.*'],
17
- headers: [{
18
- source: '*.[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].+(css|js)',
19
- headers: [{
20
- key: 'Cache-Control',
21
- value: 'public,max-age=31536000,immutable',
22
- }],
23
- }, {
24
- source: '/@(ngsw-worker.js|ngsw.json)',
25
- headers: [{
26
- key: 'Cache-Control',
27
- value: 'no-cache',
28
- }],
29
- }],
30
- rewrites: [
31
- {
32
- source: '**',
33
- destination: '/index.html',
34
- }
35
- ]
36
- };
37
- }
38
- function generateFirebaseJson(tree, path, project, dist) {
39
- const firebaseJson = tree.exists(path)
40
- ? common_1.safeReadJSON(path, tree)
41
- : emptyFirebaseJson();
42
- const newConfig = generateHostingConfig(project, dist);
43
- if (firebaseJson.hosting === undefined) {
44
- firebaseJson.hosting = newConfig;
45
- }
46
- else if (Array.isArray(firebaseJson.hosting)) {
47
- const targetIndex = firebaseJson.hosting.findIndex(it => it.target === newConfig.target);
48
- if (targetIndex > -1) {
49
- firebaseJson.hosting[targetIndex] = newConfig;
50
- }
51
- else {
52
- firebaseJson.hosting.push(newConfig);
53
- }
54
- }
55
- else {
56
- firebaseJson.hosting = [firebaseJson.hosting, newConfig];
57
- }
58
- common_1.overwriteIfExists(tree, path, common_1.stringifyFormatted(firebaseJson));
59
- }
60
- exports.generateFirebaseJson = generateFirebaseJson;
61
- const setupStaticDeployment = (config) => {
62
- var _a, _b, _c;
63
- const { tree, workspacePath, workspace, options } = config;
64
- const project = workspace.projects[options.project];
65
- if (!((_c = (_b = (_a = project.architect) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.outputPath)) {
66
- throw new schematics_1.SchematicsException(`Cannot read the output path (architect.build.options.outputPath) of the Angular project "${options.project}" in angular.json`);
67
- }
68
- const outputPath = project.architect.build.options.outputPath;
69
- project.architect.deploy = {
70
- builder: '@angular/fire:deploy',
71
- options: Object.assign(Object.assign({ prerender: options.prerender, ssr: false, browserTarget: options.browserTarget, firebaseProject: options.firebaseProject.projectId, firebaseHostingSite: common_2.shortSiteName(options.firebaseHostingSite) }, (options.serverTarget ? { serverTarget: options.serverTarget } : {})), (options.prerenderTarget ? { prerenderTarget: options.prerenderTarget } : {}))
72
- };
73
- tree.overwrite(workspacePath, JSON.stringify(workspace, null, 2));
74
- generateFirebaseJson(tree, 'firebase.json', options.project, outputPath);
75
- common_1.generateFirebaseRc(tree, '.firebaserc', options.firebaseProject.projectId, options.firebaseHostingSite, options.project);
76
- return tree;
77
- };
78
- exports.setupStaticDeployment = setupStaticDeployment;