cloudcommerce 0.0.6 → 0.0.9
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/.eslintrc.cjs +2 -1
- package/.github/workflows/firebase-hosting-merge.yml +20 -0
- package/.github/workflows/firebase-hosting-pull-request.yml +17 -0
- package/.gitmodules +3 -0
- package/.vscode/extensions.json +2 -1
- package/CHANGELOG.md +24 -0
- package/CONTRIBUTING.md +42 -0
- package/README.md +1 -0
- package/package.json +11 -10
- package/packages/api/lib/index.d.ts +120 -71
- package/packages/api/lib/index.js +43 -28
- package/packages/api/lib/index.js.map +1 -1
- package/packages/api/lib/types.d.ts +47 -10
- package/packages/api/package.json +2 -1
- package/packages/api/src/index.ts +48 -27
- package/packages/api/src/types.ts +93 -16
- package/packages/api/tests/index.test.ts +26 -2
- package/packages/apps/discounts/package.json +2 -1
- package/packages/firebase/CHANGELOG.md +1 -0
- package/packages/firebase/README.md +1 -0
- package/packages/firebase/package.json +24 -0
- package/packages/firebase/src/index.js +0 -0
- package/packages/storefront/package.json +2 -1
- package/pnpm-workspace.yaml +1 -0
- package/store/.firebaserc +5 -0
- package/store/LICENSE.md +230 -0
- package/store/README.md +2 -0
- package/store/firebase.json +47 -0
- package/store/firestore.indexes.json +4 -0
- package/store/firestore.rules +8 -0
- package/store/functions/index.js +12 -0
- package/store/functions/package.json +25 -0
- package/store/public/404.html +33 -0
- package/store/public/index.html +89 -0
- package/store/remoteconfig.template.json +1 -0
- package/store/storage.rules +15 -0
- package/src/index.js +0 -3
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "functions",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"build": "echo '>> deploy'",
|
|
6
|
+
"serve": "firebase emulators:start --only functions",
|
|
7
|
+
"shell": "firebase functions:shell",
|
|
8
|
+
"start": "npm run shell",
|
|
9
|
+
"deploy": "firebase deploy --only functions",
|
|
10
|
+
"logs": "firebase functions:log"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": "16"
|
|
14
|
+
},
|
|
15
|
+
"main": "index.js",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@cloudcommerce/firebase": "*",
|
|
18
|
+
"firebase-admin": "^10.3.0",
|
|
19
|
+
"firebase-functions": "^3.21.2"
|
|
20
|
+
},
|
|
21
|
+
"private": true,
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@firebase/app-types": "^0.7.0"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>Page Not Found</title>
|
|
7
|
+
|
|
8
|
+
<style media="screen">
|
|
9
|
+
body { background: #ECEFF1; color: rgba(0,0,0,0.87); font-family: Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 0; }
|
|
10
|
+
#message { background: white; max-width: 360px; margin: 100px auto 16px; padding: 32px 24px 16px; border-radius: 3px; }
|
|
11
|
+
#message h3 { color: #888; font-weight: normal; font-size: 16px; margin: 16px 0 12px; }
|
|
12
|
+
#message h2 { color: #ffa100; font-weight: bold; font-size: 16px; margin: 0 0 8px; }
|
|
13
|
+
#message h1 { font-size: 22px; font-weight: 300; color: rgba(0,0,0,0.6); margin: 0 0 16px;}
|
|
14
|
+
#message p { line-height: 140%; margin: 16px 0 24px; font-size: 14px; }
|
|
15
|
+
#message a { display: block; text-align: center; background: #039be5; text-transform: uppercase; text-decoration: none; color: white; padding: 16px; border-radius: 4px; }
|
|
16
|
+
#message, #message a { box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); }
|
|
17
|
+
#load { color: rgba(0,0,0,0.4); text-align: center; font-size: 13px; }
|
|
18
|
+
@media (max-width: 600px) {
|
|
19
|
+
body, #message { margin-top: 0; background: white; box-shadow: none; }
|
|
20
|
+
body { border-top: 16px solid #ffa100; }
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
</head>
|
|
24
|
+
<body>
|
|
25
|
+
<div id="message">
|
|
26
|
+
<h2>404</h2>
|
|
27
|
+
<h1>Page Not Found</h1>
|
|
28
|
+
<p>The specified file was not found on this website. Please check the URL for mistakes and try again.</p>
|
|
29
|
+
<h3>Why am I seeing this?</h3>
|
|
30
|
+
<p>This page was generated by the Firebase Command-Line Interface. To modify it, edit the <code>404.html</code> file in your project's configured <code>public</code> directory.</p>
|
|
31
|
+
</div>
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>Welcome to Firebase Hosting</title>
|
|
7
|
+
|
|
8
|
+
<!-- update the version number as needed -->
|
|
9
|
+
<script defer src="/__/firebase/9.8.3/firebase-app-compat.js"></script>
|
|
10
|
+
<!-- include only the Firebase features as you need -->
|
|
11
|
+
<script defer src="/__/firebase/9.8.3/firebase-auth-compat.js"></script>
|
|
12
|
+
<script defer src="/__/firebase/9.8.3/firebase-database-compat.js"></script>
|
|
13
|
+
<script defer src="/__/firebase/9.8.3/firebase-firestore-compat.js"></script>
|
|
14
|
+
<script defer src="/__/firebase/9.8.3/firebase-functions-compat.js"></script>
|
|
15
|
+
<script defer src="/__/firebase/9.8.3/firebase-messaging-compat.js"></script>
|
|
16
|
+
<script defer src="/__/firebase/9.8.3/firebase-storage-compat.js"></script>
|
|
17
|
+
<script defer src="/__/firebase/9.8.3/firebase-analytics-compat.js"></script>
|
|
18
|
+
<script defer src="/__/firebase/9.8.3/firebase-remote-config-compat.js"></script>
|
|
19
|
+
<script defer src="/__/firebase/9.8.3/firebase-performance-compat.js"></script>
|
|
20
|
+
<!--
|
|
21
|
+
initialize the SDK after all desired features are loaded, set useEmulator to false
|
|
22
|
+
to avoid connecting the SDK to running emulators.
|
|
23
|
+
-->
|
|
24
|
+
<script defer src="/__/firebase/init.js?useEmulator=true"></script>
|
|
25
|
+
|
|
26
|
+
<style media="screen">
|
|
27
|
+
body { background: #ECEFF1; color: rgba(0,0,0,0.87); font-family: Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 0; }
|
|
28
|
+
#message { background: white; max-width: 360px; margin: 100px auto 16px; padding: 32px 24px; border-radius: 3px; }
|
|
29
|
+
#message h2 { color: #ffa100; font-weight: bold; font-size: 16px; margin: 0 0 8px; }
|
|
30
|
+
#message h1 { font-size: 22px; font-weight: 300; color: rgba(0,0,0,0.6); margin: 0 0 16px;}
|
|
31
|
+
#message p { line-height: 140%; margin: 16px 0 24px; font-size: 14px; }
|
|
32
|
+
#message a { display: block; text-align: center; background: #039be5; text-transform: uppercase; text-decoration: none; color: white; padding: 16px; border-radius: 4px; }
|
|
33
|
+
#message, #message a { box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); }
|
|
34
|
+
#load { color: rgba(0,0,0,0.4); text-align: center; font-size: 13px; }
|
|
35
|
+
@media (max-width: 600px) {
|
|
36
|
+
body, #message { margin-top: 0; background: white; box-shadow: none; }
|
|
37
|
+
body { border-top: 16px solid #ffa100; }
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
40
|
+
</head>
|
|
41
|
+
<body>
|
|
42
|
+
<div id="message">
|
|
43
|
+
<h2>Welcome</h2>
|
|
44
|
+
<h1>Firebase Hosting Setup Complete</h1>
|
|
45
|
+
<p>You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary!</p>
|
|
46
|
+
<a target="_blank" href="https://firebase.google.com/docs/hosting/">Open Hosting Documentation</a>
|
|
47
|
+
</div>
|
|
48
|
+
<p id="load">Firebase SDK Loading…</p>
|
|
49
|
+
|
|
50
|
+
<script>
|
|
51
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
52
|
+
const loadEl = document.querySelector('#load');
|
|
53
|
+
// // 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
|
|
54
|
+
// // The Firebase SDK is initialized and available here!
|
|
55
|
+
//
|
|
56
|
+
// firebase.auth().onAuthStateChanged(user => { });
|
|
57
|
+
// firebase.database().ref('/path/to/ref').on('value', snapshot => { });
|
|
58
|
+
// firebase.firestore().doc('/foo/bar').get().then(() => { });
|
|
59
|
+
// firebase.functions().httpsCallable('yourFunction')().then(() => { });
|
|
60
|
+
// firebase.messaging().requestPermission().then(() => { });
|
|
61
|
+
// firebase.storage().ref('/path/to/ref').getDownloadURL().then(() => { });
|
|
62
|
+
// firebase.analytics(); // call to activate
|
|
63
|
+
// firebase.analytics().logEvent('tutorial_completed');
|
|
64
|
+
// firebase.performance(); // call to activate
|
|
65
|
+
//
|
|
66
|
+
// // 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
|
|
67
|
+
|
|
68
|
+
try {
|
|
69
|
+
let app = firebase.app();
|
|
70
|
+
let features = [
|
|
71
|
+
'auth',
|
|
72
|
+
'database',
|
|
73
|
+
'firestore',
|
|
74
|
+
'functions',
|
|
75
|
+
'messaging',
|
|
76
|
+
'storage',
|
|
77
|
+
'analytics',
|
|
78
|
+
'remoteConfig',
|
|
79
|
+
'performance',
|
|
80
|
+
].filter(feature => typeof app[feature] === 'function');
|
|
81
|
+
loadEl.textContent = `Firebase SDK loaded with ${features.join(', ')}`;
|
|
82
|
+
} catch (e) {
|
|
83
|
+
console.error(e);
|
|
84
|
+
loadEl.textContent = 'Error loading the Firebase SDK, check the console.';
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
</script>
|
|
88
|
+
</body>
|
|
89
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
rules_version = '2';
|
|
2
|
+
service firebase.storage {
|
|
3
|
+
match /b/{bucket}/o {
|
|
4
|
+
match /public/{allPaths=**} {
|
|
5
|
+
allow read;
|
|
6
|
+
allow write: if false;
|
|
7
|
+
}
|
|
8
|
+
match /usr/{userId}/{allPaths=**} {
|
|
9
|
+
allow read, write: if request.auth != null && request.auth.uid == userId;
|
|
10
|
+
}
|
|
11
|
+
match /{allPaths=**} {
|
|
12
|
+
allow read, write: if false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/index.js
DELETED