cloudcommerce 0.0.27 → 0.0.30
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/CHANGELOG.md +36 -0
- package/CONTRIBUTING.md +19 -0
- package/action.yml +10 -3
- package/package.json +9 -8
- package/packages/api/lib/index.d.ts +9988 -29
- package/packages/api/lib/index.js +47 -20
- package/packages/api/lib/index.js.map +1 -1
- package/packages/api/lib/types/applications.d.ts +1 -1
- package/packages/api/lib/types/authentications.d.ts +1 -1
- package/packages/api/lib/types/brands.d.ts +1 -1
- package/packages/api/lib/types/carts.d.ts +3 -3
- package/packages/api/lib/types/categories.d.ts +1 -1
- package/packages/api/lib/types/collections.d.ts +1 -1
- package/packages/api/lib/types/customers.d.ts +2 -2
- package/packages/api/lib/types/grids.d.ts +1 -1
- package/packages/api/lib/types/orders.d.ts +5 -5
- package/packages/api/lib/types/products.d.ts +2 -2
- package/packages/api/lib/types/stores.d.ts +1 -1
- package/packages/api/lib/types.d.ts +25 -8
- package/packages/api/package.json +1 -1
- package/packages/api/src/index.ts +78 -29
- package/packages/api/src/types/applications.d.ts +1 -1
- package/packages/api/src/types/authentications.d.ts +1 -1
- package/packages/api/src/types/brands.d.ts +1 -1
- package/packages/api/src/types/carts.d.ts +3 -3
- package/packages/api/src/types/categories.d.ts +1 -1
- package/packages/api/src/types/collections.d.ts +1 -1
- package/packages/api/src/types/customers.d.ts +2 -2
- package/packages/api/src/types/grids.d.ts +1 -1
- package/packages/api/src/types/orders.d.ts +5 -5
- package/packages/api/src/types/products.d.ts +2 -2
- package/packages/api/src/types/stores.d.ts +1 -1
- package/packages/api/src/types.ts +56 -17
- package/packages/api/tests/index.test.ts +16 -0
- package/packages/apps/discounts/package.json +1 -1
- package/packages/cli/create-auth.js +5 -0
- package/packages/cli/lib/create-auth.js +48 -0
- package/packages/cli/lib/index.js +42 -2
- package/packages/cli/lib/login.js +41 -0
- package/packages/cli/package.json +7 -1
- package/packages/cli/src/create-auth.ts +53 -0
- package/packages/cli/src/index.ts +55 -2
- package/packages/cli/src/login.ts +48 -0
- package/packages/firebase/lib/index.js +17 -2
- package/packages/firebase/lib/index.js.map +1 -1
- package/packages/firebase/lib/methods/check-store-events.js +18 -0
- package/packages/firebase/lib/methods/check-store-events.js.map +1 -0
- package/packages/firebase/lib/types.js +3 -0
- package/packages/firebase/lib/types.js.map +1 -0
- package/packages/firebase/package.json +1 -1
- package/packages/firebase/src/index.ts +23 -3
- package/packages/firebase/src/methods/check-store-events.ts +18 -0
- package/packages/firebase/src/types.ts +12 -0
- package/packages/storefront/package.json +2 -2
- package/pnpm-lock.yaml +283 -549
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACpD,gDAAgD;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,gBAAgB,MAAM,8BAA8B,CAAC;AAE5D,MAAM,EACJ,iBAAiB,EACjB,OAAO,EACP,YAAY,GACb,GAAG,OAAO,CAAC,GAAG,CAAC;AAChB,IAAI,CAAC,iBAAiB,IAAI,CAAC,OAAO,IAAI,CAAC,YAAY,EAAE;IACnD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;CAClD;AACD,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;AACrC,MAAM,GAAG,GAAQ;IACf,SAAS;IACT,gBAAgB,EAAE,iBAAiB;IACnC,MAAM,EAAE,OAAO;IACf,WAAW,EAAE,YAAY;CAC1B,CAAC;AAEF,MAAM,OAAO,GAAG;IACd,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,UAAU;CAChD,CAAC;AAEF,MAAM,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,EAAE;IACxD,IAAI,GAAG,KAAK,QAAQ,EAAE;QACpB,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE;YACzB,cAAc,EAAE,IAAI;SACrB,CAAC,CAAC;QACH,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;QAClC,OAAO;KACR;IACD,IAAI,GAAG,KAAK,MAAM,EAAE;QAClB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzB,OAAO;KACR;IACD,QAAQ,CAAC,IAAI,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE;KACrB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,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;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;IACrE,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC;AAC/B,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { logger } from 'firebase-functions';
|
|
2
|
+
import api from '@cloudcommerce/api';
|
|
3
|
+
|
|
4
|
+
export default async ({ authenticationId, apiKey }) => {
|
|
5
|
+
[
|
|
6
|
+
'orders',
|
|
7
|
+
'products',
|
|
8
|
+
'carts',
|
|
9
|
+
].forEach(async (resource) => {
|
|
10
|
+
const { data: { result } } = await api({
|
|
11
|
+
authenticationId,
|
|
12
|
+
apiKey,
|
|
13
|
+
endpoint: `events/${resource}`,
|
|
14
|
+
});
|
|
15
|
+
logger.info(`${resource} events: `, result);
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
// # sourceMappingURL=check-store-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-store-events.js","sourceRoot":"","sources":["../../src/methods/check-store-events.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,GAAG,MAAM,oBAAoB,CAAC;AAErC,eAAe,KAAK,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAO,EAAE,EAAE;IACzD;QACE,QAAQ;QACR,UAAU;QACV,OAAO;KACR,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC3B,MAAM,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,GAAG,CAAC;YACrC,gBAAgB;YAChB,MAAM;YACN,QAAQ,EAAE,UAAU,QAAoB,EAAE;SAC3C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,WAAW,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,iDAAiD"}
|
|
@@ -1,15 +1,31 @@
|
|
|
1
|
+
import type { Env } from './types';
|
|
1
2
|
import 'source-map-support/register.js';
|
|
2
|
-
import { logger } from 'firebase-functions';
|
|
3
|
+
import { pubsub, logger } from 'firebase-functions';
|
|
3
4
|
// eslint-disable-next-line import/no-unresolved
|
|
4
5
|
import { onRequest } from 'firebase-functions/v2/https';
|
|
5
6
|
import config from './config';
|
|
7
|
+
import checkStoreEvents from './methods/check-store-events';
|
|
8
|
+
|
|
9
|
+
const {
|
|
10
|
+
AUTHENTICATION_ID,
|
|
11
|
+
API_KEY,
|
|
12
|
+
GITHUB_TOKEN,
|
|
13
|
+
} = process.env;
|
|
14
|
+
if (!AUTHENTICATION_ID || !API_KEY || !GITHUB_TOKEN) {
|
|
15
|
+
throw new Error('Missing environment variables');
|
|
16
|
+
}
|
|
17
|
+
const processId = String(Date.now());
|
|
18
|
+
const env: Env = {
|
|
19
|
+
processId,
|
|
20
|
+
authenticationId: AUTHENTICATION_ID,
|
|
21
|
+
apiKey: API_KEY,
|
|
22
|
+
githubToken: GITHUB_TOKEN,
|
|
23
|
+
};
|
|
6
24
|
|
|
7
25
|
const options = {
|
|
8
26
|
region: process.env.DEPLOY_REGION || 'us-east1',
|
|
9
27
|
};
|
|
10
28
|
|
|
11
|
-
const processId = String(Date.now());
|
|
12
|
-
|
|
13
29
|
export const z = onRequest(options, ({ url }, response) => {
|
|
14
30
|
if (url === '/hello') {
|
|
15
31
|
logger.info('Hello logs!', {
|
|
@@ -30,3 +46,7 @@ export const z = onRequest(options, ({ url }, response) => {
|
|
|
30
46
|
export const ssr = onRequest(options, (request, response) => {
|
|
31
47
|
response.send('<h1>Hello SSR!</h1>');
|
|
32
48
|
});
|
|
49
|
+
|
|
50
|
+
export const cronStoreEvents = pubsub.schedule('* * * * *').onRun(() => {
|
|
51
|
+
return checkStoreEvents(env);
|
|
52
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Env } from '../types';
|
|
2
|
+
import { logger } from 'firebase-functions';
|
|
3
|
+
import api from '@cloudcommerce/api';
|
|
4
|
+
|
|
5
|
+
export default async ({ authenticationId, apiKey }: Env) => {
|
|
6
|
+
[
|
|
7
|
+
'orders',
|
|
8
|
+
'products',
|
|
9
|
+
'carts',
|
|
10
|
+
].forEach(async (resource) => {
|
|
11
|
+
const { data: { result } } = await api({
|
|
12
|
+
authenticationId,
|
|
13
|
+
apiKey,
|
|
14
|
+
endpoint: `events/${resource as 'orders'}`,
|
|
15
|
+
});
|
|
16
|
+
logger.info(`${resource} events: `, result);
|
|
17
|
+
});
|
|
18
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.30",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront with Astro",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"repository": {
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@cloudcommerce/api": "workspace:*",
|
|
23
|
-
"astro": "1.0.0-beta.
|
|
23
|
+
"astro": "1.0.0-beta.72"
|
|
24
24
|
}
|
|
25
25
|
}
|