cloudcommerce 0.0.57 → 0.0.60
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 -0
- package/CHANGELOG.md +41 -0
- package/package.json +9 -8
- package/packages/api/lib/api.d.ts +5036 -0
- package/packages/api/lib/{index.js → api.js} +16 -10
- package/packages/api/lib/api.js.map +1 -0
- package/packages/api/lib/types.d.ts +1 -0
- package/packages/api/package.json +3 -3
- package/packages/api/src/{index.ts → api.ts} +21 -17
- package/packages/api/src/types.ts +1 -0
- package/packages/api/tests/index.test.ts +2 -2
- package/packages/apps/discounts/lib/discounts.js +1 -1
- package/packages/apps/discounts/lib/discounts.js.map +1 -1
- package/packages/apps/discounts/{lib-cjs/apply-discount.cjs → lib-mjs/apply-discount.mjs} +7 -9
- package/packages/apps/discounts/{lib-cjs/helpers.cjs → lib-mjs/helpers.mjs} +2 -2
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/discounts/src/discounts.ts +1 -1
- package/packages/apps/tiny-erp/CHANGELOG.md +1 -0
- package/packages/apps/tiny-erp/README.md +1 -0
- package/packages/apps/tiny-erp/lib/event-to-tiny.js +111 -0
- package/packages/apps/tiny-erp/lib/event-to-tiny.js.map +1 -0
- package/packages/apps/tiny-erp/lib/index.js +2 -0
- package/packages/apps/tiny-erp/lib/index.js.map +1 -0
- package/packages/apps/tiny-erp/lib/integration/after-tiny-queue.js +79 -0
- package/packages/apps/tiny-erp/lib/integration/after-tiny-queue.js.map +1 -0
- package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js +81 -0
- package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js.map +1 -0
- package/packages/apps/tiny-erp/lib/integration/export-product-to-tiny.js +58 -0
- package/packages/apps/tiny-erp/lib/integration/export-product-to-tiny.js.map +1 -0
- package/packages/apps/tiny-erp/lib/integration/helpers/format-tiny-date.js +7 -0
- package/packages/apps/tiny-erp/lib/integration/helpers/format-tiny-date.js.map +1 -0
- package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js +94 -0
- package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js.map +1 -0
- package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js +169 -0
- package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js.map +1 -0
- package/packages/apps/tiny-erp/lib/integration/parsers/order-from-tiny.js +46 -0
- package/packages/apps/tiny-erp/lib/integration/parsers/order-from-tiny.js.map +1 -0
- package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js +193 -0
- package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js.map +1 -0
- package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js +199 -0
- package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js.map +1 -0
- package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js +129 -0
- package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js.map +1 -0
- package/packages/apps/tiny-erp/lib/integration/parsers/status-from-tiny.js +34 -0
- package/packages/apps/tiny-erp/lib/integration/parsers/status-from-tiny.js.map +1 -0
- package/packages/apps/tiny-erp/lib/integration/parsers/status-to-tiny.js +39 -0
- package/packages/apps/tiny-erp/lib/integration/parsers/status-to-tiny.js.map +1 -0
- package/packages/apps/tiny-erp/lib/integration/post-tiny-erp.js +47 -0
- package/packages/apps/tiny-erp/lib/integration/post-tiny-erp.js.map +1 -0
- package/packages/apps/tiny-erp/lib/tiny-erp.js +17 -0
- package/packages/apps/tiny-erp/lib/tiny-erp.js.map +1 -0
- package/packages/apps/tiny-erp/lib/tiny-webhook.js +135 -0
- package/packages/apps/tiny-erp/lib/tiny-webhook.js.map +1 -0
- package/packages/apps/tiny-erp/package.json +34 -0
- package/packages/apps/tiny-erp/src/event-to-tiny.ts +129 -0
- package/packages/apps/tiny-erp/src/index.ts +1 -0
- package/packages/apps/tiny-erp/src/integration/after-tiny-queue.ts +80 -0
- package/packages/apps/tiny-erp/src/integration/export-order-to-tiny.ts +86 -0
- package/packages/apps/tiny-erp/src/integration/export-product-to-tiny.ts +60 -0
- package/packages/apps/tiny-erp/src/integration/helpers/format-tiny-date.ts +6 -0
- package/packages/apps/tiny-erp/src/integration/import-order-from-tiny.ts +104 -0
- package/packages/apps/tiny-erp/src/integration/import-product-from-tiny.ts +174 -0
- package/packages/apps/tiny-erp/src/integration/parsers/order-from-tiny.ts +49 -0
- package/packages/apps/tiny-erp/src/integration/parsers/order-to-tiny.ts +205 -0
- package/packages/apps/tiny-erp/src/integration/parsers/product-from-tiny.ts +215 -0
- package/packages/apps/tiny-erp/src/integration/parsers/product-to-tiny.ts +138 -0
- package/packages/apps/tiny-erp/src/integration/parsers/status-from-tiny.ts +35 -0
- package/packages/apps/tiny-erp/src/integration/parsers/status-to-tiny.ts +42 -0
- package/packages/apps/tiny-erp/src/integration/post-tiny-erp.ts +52 -0
- package/packages/apps/tiny-erp/src/tiny-erp.ts +23 -0
- package/packages/apps/tiny-erp/src/tiny-webhook.ts +143 -0
- package/packages/apps/tiny-erp/tsconfig.json +3 -0
- package/packages/cli/config/firebase.json +6 -3
- package/packages/cli/lib/index.js +23 -4
- package/packages/cli/lib/{config-gcloud.js → setup-gcloud.js} +2 -2
- package/packages/cli/lib/setup-gh.js +59 -0
- package/packages/cli/package.json +2 -1
- package/packages/cli/src/index.ts +30 -3
- package/packages/cli/src/{config-gcloud.ts → setup-gcloud.ts} +2 -2
- package/packages/cli/src/setup-gh.ts +83 -0
- package/packages/events/lib/firebase.js +2 -26
- package/packages/events/lib/firebase.js.map +1 -1
- package/packages/events/lib/index.js +1 -1
- package/packages/events/lib/index.js.map +1 -1
- package/packages/events/package.json +2 -1
- package/packages/events/src/firebase.ts +2 -28
- package/packages/events/src/index.ts +1 -1
- package/packages/firebase/lib/config.d.ts +2 -2
- package/packages/firebase/lib/config.js +8 -6
- package/packages/firebase/lib/config.js.map +1 -1
- package/packages/firebase/lib/const.d.ts +2 -0
- package/packages/firebase/lib/const.js +6 -0
- package/packages/firebase/lib/const.js.map +1 -0
- package/packages/firebase/lib/handlers/check-store-events.d.ts +1 -1
- package/packages/firebase/lib/handlers/check-store-events.js +86 -22
- package/packages/firebase/lib/handlers/check-store-events.js.map +1 -1
- package/packages/firebase/lib/helpers/pubsub.d.ts +9 -0
- package/packages/firebase/lib/helpers/pubsub.js +32 -0
- package/packages/firebase/lib/helpers/pubsub.js.map +1 -0
- package/packages/firebase/lib/helpers/update-app-data.d.ts +9 -0
- package/packages/firebase/lib/helpers/update-app-data.js +45 -0
- package/packages/firebase/lib/helpers/update-app-data.js.map +1 -0
- package/packages/firebase/lib/index.d.ts +1 -2
- package/packages/firebase/lib/index.js +1 -6
- package/packages/firebase/lib/index.js.map +1 -1
- package/packages/firebase/lib/init.d.ts +2 -0
- package/packages/firebase/lib/init.js +9 -0
- package/packages/firebase/lib/init.js.map +1 -0
- package/packages/firebase/package.json +6 -2
- package/packages/firebase/src/config.ts +10 -7
- package/packages/firebase/src/const.ts +5 -0
- package/packages/firebase/src/handlers/check-store-events.ts +100 -28
- package/packages/firebase/src/helpers/pubsub.ts +52 -0
- package/packages/firebase/src/helpers/update-app-data.ts +49 -0
- package/packages/firebase/src/index.ts +1 -7
- package/packages/firebase/src/init.ts +9 -0
- package/packages/modules/lib/firebase/handle-module.js +4 -5
- package/packages/modules/lib/firebase/handle-module.js.map +1 -1
- package/packages/modules/lib/firebase/serve-modules-api.js +2 -2
- package/packages/modules/lib/firebase/serve-modules-api.js.map +1 -1
- package/packages/modules/lib/firebase.js +2 -7
- package/packages/modules/lib/firebase.js.map +1 -1
- package/packages/modules/package.json +1 -1
- package/packages/modules/src/firebase/handle-module.ts +2 -5
- package/packages/modules/src/firebase/serve-modules-api.ts +2 -6
- package/packages/modules/src/firebase.ts +2 -7
- package/packages/passport/lib/firebase/handle-passport.js +12 -10
- package/packages/passport/lib/firebase/handle-passport.js.map +1 -1
- package/packages/passport/lib/firebase/serve-passport-api.js +2 -2
- package/packages/passport/lib/firebase/serve-passport-api.js.map +1 -1
- package/packages/passport/lib/firebase.js +2 -7
- package/packages/passport/lib/firebase.js.map +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/passport/src/firebase/handle-passport.ts +10 -19
- package/packages/passport/src/firebase/serve-passport-api.ts +0 -2
- package/packages/passport/src/firebase.ts +1 -7
- package/packages/ssr/lib/firebase.js +1 -4
- package/packages/ssr/lib/firebase.js.map +1 -1
- package/packages/ssr/package.json +1 -1
- package/packages/ssr/src/firebase.ts +1 -4
- package/packages/storefront/package.json +5 -4
- package/packages/types/index.ts +18 -3
- package/packages/types/package.json +1 -1
- package/packages/api/lib/index.d.ts +0 -9974
- package/packages/api/lib/index.js.map +0 -1
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
// eslint-disable-next-line import/no-unresolved
|
|
3
|
-
import { initializeApp } from 'firebase-admin/app';
|
|
1
|
+
import '@cloudcommerce/firebase/lib/init';
|
|
4
2
|
// eslint-disable-next-line import/no-unresolved
|
|
5
3
|
import { getFirestore } from 'firebase-admin/firestore';
|
|
6
4
|
// eslint-disable-next-line import/no-unresolved
|
|
@@ -8,7 +6,6 @@ import { getAuth } from 'firebase-admin/auth';
|
|
|
8
6
|
// eslint-disable-next-line import/no-unresolved
|
|
9
7
|
import { onRequest } from 'firebase-functions/v2/https';
|
|
10
8
|
import config from '@cloudcommerce/firebase/lib/config';
|
|
11
|
-
import getEnv from '@cloudcommerce/firebase/lib/env';
|
|
12
9
|
import servePassportApi from './firebase/serve-passport-api.js';
|
|
13
10
|
|
|
14
11
|
// References:
|
|
@@ -16,7 +13,6 @@ import servePassportApi from './firebase/serve-passport-api.js';
|
|
|
16
13
|
// https://itnext.io/how-to-use-firebase-auth-with-a-custom-node-backend-99a106376c8a
|
|
17
14
|
// https://www.geeksforgeeks.org/firebase-sign-in-with-google-authentication-in-node-js-using-firebase-ui-and-cookie-sessions/
|
|
18
15
|
// https://firebase.google.com/docs/reference/rest/auth
|
|
19
|
-
initializeApp();
|
|
20
16
|
const authFirebase = getAuth();
|
|
21
17
|
const firestore = getFirestore();
|
|
22
18
|
const options = {
|
|
@@ -26,8 +22,7 @@ const options = {
|
|
|
26
22
|
|
|
27
23
|
// eslint-disable-next-line import/prefer-default-export
|
|
28
24
|
export const passport = onRequest(options, (req, res) => {
|
|
29
|
-
const { apiAuth } = getEnv();
|
|
30
25
|
const { storeId } = config.get();
|
|
31
|
-
servePassportApi(req, res,
|
|
26
|
+
servePassportApi(req, res, firestore, authFirebase, storeId);
|
|
32
27
|
});
|
|
33
28
|
// # sourceMappingURL=firebase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC;AAC1C,gDAAgD;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,gDAAgD;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,gDAAgD;AAChD,OAAO,EAAgB,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,MAAM,MAAM,oCAAoC,CAAC;AACxD,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAE7D,cAAc;AACd,8DAA8D;AAC9D,qFAAqF;AACrF,8HAA8H;AAC9H,uDAAuD;AAEvD,MAAM,YAAY,GAAG,OAAO,EAAE,CAAC;AAC/B,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;AAEjC,MAAM,OAAO,GAAG;IACd,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,oBAAoB;IACpC,MAAM,EAAE,QAAQ;CACD,CAAC;AAElB,wDAAwD;AACxD,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACtD,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;IACjC,gBAAgB,CACd,GAAG,EACH,GAAG,EACH,SAAS,EACT,YAAY,EACZ,OAAO,CACR,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -5,13 +5,11 @@ import type { Firestore } from 'firebase-admin/firestore';
|
|
|
5
5
|
import { Auth } from 'firebase-admin/auth';
|
|
6
6
|
import { logger } from 'firebase-functions';
|
|
7
7
|
import api from '@cloudcommerce/api';
|
|
8
|
+
import getEnv from '@cloudcommerce/firebase/lib/env';
|
|
8
9
|
|
|
9
|
-
const findCustomerByEmail = async (
|
|
10
|
-
email: string | undefined,
|
|
11
|
-
apiAuth: { authenticationId: string, apiKey: string },
|
|
12
|
-
) => {
|
|
10
|
+
const findCustomerByEmail = async (email: string | undefined) => {
|
|
13
11
|
try {
|
|
14
|
-
const { data } = await api.get(`customers?main_email=${email}
|
|
12
|
+
const { data } = await api.get(`customers?main_email=${email}`);
|
|
15
13
|
if (data.result.length) {
|
|
16
14
|
return data.result[0];
|
|
17
15
|
}
|
|
@@ -38,12 +36,9 @@ const checkFirebaseAuth = async (
|
|
|
38
36
|
}
|
|
39
37
|
};
|
|
40
38
|
|
|
41
|
-
const createCustomer = async (
|
|
42
|
-
customer: Customers,
|
|
43
|
-
apiAuth: { authenticationId: string, apiKey: string },
|
|
44
|
-
) => {
|
|
39
|
+
const createCustomer = async (customer: Customers) => {
|
|
45
40
|
try {
|
|
46
|
-
const { data } = await api.post('customers', customer
|
|
41
|
+
const { data } = await api.post('customers', customer);
|
|
47
42
|
return data._id;
|
|
48
43
|
} catch (e) {
|
|
49
44
|
logger.error(e);
|
|
@@ -54,12 +49,12 @@ const createCustomer = async (
|
|
|
54
49
|
const generateAccessToken = async (
|
|
55
50
|
firestore: Firestore,
|
|
56
51
|
customerId: string,
|
|
57
|
-
apiAuth: { authenticationId: string, apiKey: string },
|
|
58
52
|
): Promise<null | {
|
|
59
53
|
customer_id: string,
|
|
60
54
|
access_token: string,
|
|
61
55
|
expires: string,
|
|
62
56
|
}> => {
|
|
57
|
+
const { apiAuth } = getEnv();
|
|
63
58
|
const docRef = firestore.doc(`customerTokens/${customerId}`);
|
|
64
59
|
const doc = await docRef.get();
|
|
65
60
|
const expires: string | undefined = doc.data()?.expires;
|
|
@@ -91,18 +86,14 @@ const generateAccessToken = async (
|
|
|
91
86
|
|
|
92
87
|
const getAuthCustomerApi = async (
|
|
93
88
|
firestore: Firestore,
|
|
94
|
-
apiAuth: { authenticationId: string, apiKey: string },
|
|
95
89
|
authtoken: string | string[] | undefined,
|
|
96
90
|
authFirebase: Auth,
|
|
97
91
|
) => {
|
|
98
92
|
const customerFirebaseAuth = await checkFirebaseAuth(authFirebase, authtoken);
|
|
99
93
|
if (customerFirebaseAuth !== null && customerFirebaseAuth.email) {
|
|
100
|
-
const customer = await findCustomerByEmail(
|
|
101
|
-
customerFirebaseAuth.email,
|
|
102
|
-
apiAuth,
|
|
103
|
-
);
|
|
94
|
+
const customer = await findCustomerByEmail(customerFirebaseAuth.email);
|
|
104
95
|
if (customer !== null) {
|
|
105
|
-
return generateAccessToken(firestore, customer._id
|
|
96
|
+
return generateAccessToken(firestore, customer._id);
|
|
106
97
|
}
|
|
107
98
|
const newCustomer = {
|
|
108
99
|
display_name: customerFirebaseAuth.name || '',
|
|
@@ -116,9 +107,9 @@ const getAuthCustomerApi = async (
|
|
|
116
107
|
user_id: customerFirebaseAuth.user_id,
|
|
117
108
|
}],
|
|
118
109
|
} as Customers;
|
|
119
|
-
const customerId = await createCustomer(newCustomer
|
|
110
|
+
const customerId = await createCustomer(newCustomer);
|
|
120
111
|
if (customerId) {
|
|
121
|
-
return generateAccessToken(firestore, customerId
|
|
112
|
+
return generateAccessToken(firestore, customerId);
|
|
122
113
|
}
|
|
123
114
|
}
|
|
124
115
|
// TODO: Find customer by phone number, generate token if found, otherwise unauthorize
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
export default async (
|
|
13
13
|
req: Request,
|
|
14
14
|
res: Response,
|
|
15
|
-
apiAuth: { authenticationId: string, apiKey: string },
|
|
16
15
|
firestore: Firestore,
|
|
17
16
|
authFirebase: Auth,
|
|
18
17
|
storeId: number,
|
|
@@ -44,7 +43,6 @@ export default async (
|
|
|
44
43
|
try {
|
|
45
44
|
const authCustomerApi = await getAuthCustomerApi(
|
|
46
45
|
firestore,
|
|
47
|
-
apiAuth,
|
|
48
46
|
authtoken,
|
|
49
47
|
authFirebase,
|
|
50
48
|
);
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
// eslint-disable-next-line import/no-unresolved
|
|
3
|
-
import { initializeApp } from 'firebase-admin/app';
|
|
1
|
+
import '@cloudcommerce/firebase/lib/init';
|
|
4
2
|
// eslint-disable-next-line import/no-unresolved
|
|
5
3
|
import { getFirestore } from 'firebase-admin/firestore';
|
|
6
4
|
// eslint-disable-next-line import/no-unresolved
|
|
@@ -8,7 +6,6 @@ import { getAuth } from 'firebase-admin/auth';
|
|
|
8
6
|
// eslint-disable-next-line import/no-unresolved
|
|
9
7
|
import { HttpsOptions, onRequest } from 'firebase-functions/v2/https';
|
|
10
8
|
import config from '@cloudcommerce/firebase/lib/config';
|
|
11
|
-
import getEnv from '@cloudcommerce/firebase/lib/env';
|
|
12
9
|
import servePassportApi from './firebase/serve-passport-api';
|
|
13
10
|
|
|
14
11
|
// References:
|
|
@@ -17,7 +14,6 @@ import servePassportApi from './firebase/serve-passport-api';
|
|
|
17
14
|
// https://www.geeksforgeeks.org/firebase-sign-in-with-google-authentication-in-node-js-using-firebase-ui-and-cookie-sessions/
|
|
18
15
|
// https://firebase.google.com/docs/reference/rest/auth
|
|
19
16
|
|
|
20
|
-
initializeApp();
|
|
21
17
|
const authFirebase = getAuth();
|
|
22
18
|
const firestore = getFirestore();
|
|
23
19
|
|
|
@@ -28,12 +24,10 @@ const options = {
|
|
|
28
24
|
|
|
29
25
|
// eslint-disable-next-line import/prefer-default-export
|
|
30
26
|
export const passport = onRequest(options, (req, res) => {
|
|
31
|
-
const { apiAuth } = getEnv();
|
|
32
27
|
const { storeId } = config.get();
|
|
33
28
|
servePassportApi(
|
|
34
29
|
req,
|
|
35
30
|
res,
|
|
36
|
-
apiAuth,
|
|
37
31
|
firestore,
|
|
38
32
|
authFirebase,
|
|
39
33
|
storeId,
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/* eslint-disable import/prefer-default-export */
|
|
2
|
-
import '
|
|
3
|
-
// eslint-disable-next-line import/no-unresolved
|
|
4
|
-
import { initializeApp } from 'firebase-admin/app';
|
|
2
|
+
import '@cloudcommerce/firebase/lib/init';
|
|
5
3
|
// eslint-disable-next-line import/no-unresolved
|
|
6
4
|
import { onRequest } from 'firebase-functions/v2/https';
|
|
7
5
|
import config from '@cloudcommerce/firebase/lib/config';
|
|
8
6
|
|
|
9
|
-
initializeApp();
|
|
10
7
|
const options = config.get().httpsFunctionOptions;
|
|
11
8
|
|
|
12
9
|
export const ssr = onRequest(options, (request, response) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,OAAO,
|
|
1
|
+
{"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,OAAO,kCAAkC,CAAC;AAC1C,gDAAgD;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,MAAM,MAAM,oCAAoC,CAAC;AAExD,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;IAC1D,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AACvC,CAAC,CAAC,CAAC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
/* eslint-disable import/prefer-default-export */
|
|
2
2
|
|
|
3
|
-
import '
|
|
4
|
-
// eslint-disable-next-line import/no-unresolved
|
|
5
|
-
import { initializeApp } from 'firebase-admin/app';
|
|
3
|
+
import '@cloudcommerce/firebase/lib/init';
|
|
6
4
|
// eslint-disable-next-line import/no-unresolved
|
|
7
5
|
import { onRequest } from 'firebase-functions/v2/https';
|
|
8
6
|
import config from '@cloudcommerce/firebase/lib/config';
|
|
9
7
|
|
|
10
|
-
initializeApp();
|
|
11
8
|
const options = config.get().httpsFunctionOptions;
|
|
12
9
|
|
|
13
10
|
export const ssr = onRequest(options, (request, response) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.60",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront with Astro",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"repository": {
|
|
@@ -19,17 +19,18 @@
|
|
|
19
19
|
"build": "echo '@ecomplus/storefront'"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@astrojs/mdx": "^0.10.
|
|
22
|
+
"@astrojs/mdx": "^0.10.2",
|
|
23
23
|
"@astrojs/node": "^1.0.0",
|
|
24
24
|
"@astrojs/partytown": "^1.0.0",
|
|
25
25
|
"@astrojs/prefetch": "^0.0.7",
|
|
26
26
|
"@astrojs/sitemap": "^1.0.0",
|
|
27
|
-
"@astrojs/tailwind": "^1.0.0",
|
|
28
27
|
"@astrojs/vue": "^1.0.0",
|
|
29
28
|
"@cloudcommerce/api": "workspace:*",
|
|
30
29
|
"@picocss/pico": "^1.5.3",
|
|
31
|
-
"astro": "^1.
|
|
30
|
+
"astro": "^1.1.1",
|
|
32
31
|
"rollup": "^2.78.1",
|
|
32
|
+
"unocss": "^0.45.13",
|
|
33
|
+
"vite": "^3.0.9",
|
|
33
34
|
"vue": "^3.2.37"
|
|
34
35
|
}
|
|
35
36
|
}
|
package/packages/types/index.ts
CHANGED
|
@@ -25,7 +25,7 @@ import type { CreateTransactionParams } from './modules/create_transaction:param
|
|
|
25
25
|
import type { CreateTransactionResponse } from './modules/create_transaction:response';
|
|
26
26
|
import type { CheckoutBody } from './modules/@checkout:params';
|
|
27
27
|
|
|
28
|
-
type
|
|
28
|
+
type ApiEventName = 'orders-new'
|
|
29
29
|
| 'orders-anyStatusSet'
|
|
30
30
|
| 'orders-paid'
|
|
31
31
|
| 'orders-readyForShipping'
|
|
@@ -37,7 +37,21 @@ type AppEventsTopic = 'orders-new'
|
|
|
37
37
|
| 'products-priceSet'
|
|
38
38
|
| 'carts-new'
|
|
39
39
|
| 'carts-customerSet'
|
|
40
|
-
| 'customers-new'
|
|
40
|
+
| 'customers-new'
|
|
41
|
+
| 'applications-dataSet';
|
|
42
|
+
|
|
43
|
+
type AppEventsPayload = {
|
|
44
|
+
evName: ApiEventName,
|
|
45
|
+
apiEvent: EventsResult<'events/orders'>['result'][0],
|
|
46
|
+
apiDoc: Record<string, any>,
|
|
47
|
+
app: {
|
|
48
|
+
_id: Applications['_id'],
|
|
49
|
+
app_id: Applications['app_id'],
|
|
50
|
+
data: Applications['data'],
|
|
51
|
+
hidden_data: Applications['hidden_data'],
|
|
52
|
+
},
|
|
53
|
+
isInternal?: boolean,
|
|
54
|
+
};
|
|
41
55
|
|
|
42
56
|
type AppModuleName = 'apply_discount'
|
|
43
57
|
| 'calculate_shipping'
|
|
@@ -69,7 +83,8 @@ export type {
|
|
|
69
83
|
ResourceId,
|
|
70
84
|
ResourceListResult,
|
|
71
85
|
EventsResult,
|
|
72
|
-
|
|
86
|
+
ApiEventName,
|
|
87
|
+
AppEventsPayload,
|
|
73
88
|
AppModuleName,
|
|
74
89
|
AppModuleBody,
|
|
75
90
|
ApplyDiscountParams,
|