cloudcommerce 0.0.31 → 0.0.35
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 +41 -0
- package/action.yml +4 -0
- package/package.json +6 -6
- package/packages/__skeleton/package.json +4 -1
- package/packages/__skeleton/src/{index.js → index.ts} +0 -0
- package/packages/__skeleton/tsconfig.json +3 -0
- package/packages/api/{tests/fetch-polyfill.js → fetch-polyfill.js} +0 -0
- package/packages/api/lib/index.d.ts +2 -112
- package/packages/api/lib/types.d.ts +1 -1
- package/packages/api/package.json +1 -1
- package/packages/api/src/types.ts +4 -0
- package/packages/api/tests/index.test.ts +1 -1
- package/packages/apps/discounts/lib/index.js +4 -0
- package/packages/apps/discounts/lib/index.js.map +1 -0
- package/packages/apps/discounts/package.json +4 -1
- package/packages/apps/discounts/src/index.ts +7 -0
- package/packages/apps/discounts/tsconfig.json +3 -0
- package/packages/cli/lib/index.js +11 -2
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/index.ts +12 -3
- package/packages/firebase/lib/config.d.ts +15 -0
- package/packages/firebase/lib/config.js +3 -0
- package/packages/firebase/lib/config.js.map +1 -1
- package/packages/firebase/lib/defaults.d.ts +4 -0
- package/packages/firebase/lib/env.d.ts +8 -0
- package/packages/firebase/lib/env.js +19 -0
- package/packages/firebase/lib/env.js.map +1 -0
- package/packages/firebase/lib/handlers/check-store-events.d.ts +2 -0
- package/packages/firebase/lib/handlers/check-store-events.js +31 -0
- package/packages/firebase/lib/handlers/check-store-events.js.map +1 -0
- package/packages/firebase/lib/index.d.ts +5 -0
- package/packages/firebase/lib/index.js +7 -15
- package/packages/firebase/lib/index.js.map +1 -1
- package/packages/firebase/lib/types.d.ts +6 -0
- package/packages/firebase/lib/types.js +0 -1
- package/packages/firebase/lib/types.js.map +1 -1
- package/packages/firebase/package.json +4 -1
- package/packages/firebase/src/config.ts +3 -0
- package/packages/firebase/src/env.ts +30 -0
- package/packages/firebase/src/handlers/check-store-events.ts +31 -0
- package/packages/firebase/src/index.ts +7 -21
- package/packages/firebase/src/types.ts +6 -7
- package/packages/firebase/tsconfig.json +4 -1
- package/packages/modules/CHANGELOG.md +1 -0
- package/packages/modules/README.md +1 -0
- package/packages/modules/lib/firebase/index.js +16 -0
- package/packages/modules/lib/firebase/index.js.map +1 -0
- package/packages/modules/lib/index.js +21 -0
- package/packages/modules/lib/index.js.map +1 -0
- package/packages/modules/package.json +33 -0
- package/packages/modules/schemas/@checkout.cjs +1015 -0
- package/packages/modules/schemas/apply_discount.cjs +324 -0
- package/packages/modules/schemas/calculate_shipping.cjs +666 -0
- package/packages/modules/schemas/create_transaction.cjs +1001 -0
- package/packages/modules/schemas/list_payments.cjs +852 -0
- package/packages/modules/scripts/build-types.sh +33 -0
- package/packages/modules/src/firebase/index.ts +16 -0
- package/packages/modules/src/index.ts +21 -0
- package/packages/modules/tsconfig.json +3 -0
- package/packages/storefront/package.json +2 -2
- package/packages/types/CHANGELOG.md +1 -0
- package/packages/types/README.md +1 -0
- package/packages/types/index.ts +66 -0
- package/packages/types/modules/@checkout:params.d.ts +920 -0
- package/packages/types/modules/apply_discount:params.d.ts +154 -0
- package/packages/types/modules/apply_discount:response.d.ts +71 -0
- package/packages/types/modules/calculate_shipping:params.d.ts +275 -0
- package/packages/types/modules/calculate_shipping:response.d.ts +402 -0
- package/packages/types/modules/create_transaction:params.d.ts +515 -0
- package/packages/types/modules/create_transaction:response.d.ts +261 -0
- package/packages/types/modules/list_payments:params.d.ts +323 -0
- package/packages/types/modules/list_payments:response.d.ts +266 -0
- package/packages/types/package.json +21 -0
- package/pnpm-lock.yaml +505 -274
- package/packages/firebase/lib/methods/check-store-events.js +0 -18
- package/packages/firebase/lib/methods/check-store-events.js.map +0 -1
- package/packages/firebase/src/methods/check-store-events.ts +0 -18
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
function build_schema {
|
|
4
|
+
cjs_filepath=$1
|
|
5
|
+
noext_file=${cjs_filepath/.cjs/}
|
|
6
|
+
output_path=${noext_file/\/schemas/\/..\/types\/modules}
|
|
7
|
+
|
|
8
|
+
echo $noext_file
|
|
9
|
+
node -p "const { params, response } = require('$cjs_filepath'); \
|
|
10
|
+
console.error(JSON.stringify(params, null, 2)); \
|
|
11
|
+
JSON.stringify(response || {}, null, 2);" \
|
|
12
|
+
> $output_path:response.json 2> $output_path:params.json
|
|
13
|
+
|
|
14
|
+
npx json2ts -i $output_path:params.json -o $output_path:params.d.ts \
|
|
15
|
+
--ignoreMinAndMaxItems --style.singleQuote
|
|
16
|
+
if [[ ! $noext_file =~ @checkout$ ]]; then
|
|
17
|
+
npx json2ts -i $output_path:response.json -o $output_path:response.d.ts \
|
|
18
|
+
--ignoreMinAndMaxItems --style.singleQuote
|
|
19
|
+
fi
|
|
20
|
+
rm $output_path:params.json $output_path:response.json
|
|
21
|
+
echo '✓ OK'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if [[ ! -z "$1" ]]; then
|
|
25
|
+
build_schema $1
|
|
26
|
+
else
|
|
27
|
+
for filepath in $(find schemas/ -type f -print)
|
|
28
|
+
do
|
|
29
|
+
if [[ $filepath =~ \.cjs$ ]]; then
|
|
30
|
+
build_schema $(pwd)/$filepath
|
|
31
|
+
fi
|
|
32
|
+
done
|
|
33
|
+
fi
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* eslint-disable import/prefer-default-export */
|
|
2
|
+
|
|
3
|
+
import 'source-map-support/register.js';
|
|
4
|
+
import { initializeApp } from 'firebase-admin';
|
|
5
|
+
// import { logger } from 'firebase-functions';
|
|
6
|
+
// eslint-disable-next-line import/no-unresolved
|
|
7
|
+
import { onRequest } from 'firebase-functions/v2/https';
|
|
8
|
+
import config from '@cloudcommerce/firebase/lib/config';
|
|
9
|
+
|
|
10
|
+
initializeApp();
|
|
11
|
+
const options = config.get().httpsFunctionOptions;
|
|
12
|
+
|
|
13
|
+
export const modApplyDiscount = onRequest(options, (request, response) => {
|
|
14
|
+
process.env.ECOM_API_KEY = '***';
|
|
15
|
+
response.send('Hello modules!');
|
|
16
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as calculateShipping from '../schemas/calculate_shipping.cjs';
|
|
2
|
+
import * as applyDiscount from '../schemas/apply_discount.cjs';
|
|
3
|
+
import * as listPayments from '../schemas/list_payments.cjs';
|
|
4
|
+
import * as createTransaction from '../schemas/create_transaction.cjs';
|
|
5
|
+
import * as checkout from '../schemas/@checkout.cjs';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
calculateShipping,
|
|
9
|
+
applyDiscount,
|
|
10
|
+
listPayments,
|
|
11
|
+
createTransaction,
|
|
12
|
+
checkout,
|
|
13
|
+
|
|
14
|
+
schemas: {
|
|
15
|
+
calculate_shipping: calculateShipping,
|
|
16
|
+
apply_discount: applyDiscount,
|
|
17
|
+
list_payments: listPayments,
|
|
18
|
+
create_transaction: createTransaction,
|
|
19
|
+
'@checkout': checkout,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.35",
|
|
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-
|
|
23
|
+
"astro": "1.0.0-rc.1"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Please refer to GitHub [repository releases](https://github.com/ecomplus/cloud-commerce/releases) or monorepo unified [CHANGELOG.md](https://github.com/ecomplus/cloud-commerce/blob/main/CHANGELOG.md).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# `@cloudcommerce/types`
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Products,
|
|
3
|
+
Categories,
|
|
4
|
+
Brands,
|
|
5
|
+
Collections,
|
|
6
|
+
Grids,
|
|
7
|
+
Carts,
|
|
8
|
+
Orders,
|
|
9
|
+
Customers,
|
|
10
|
+
Stores,
|
|
11
|
+
Applications,
|
|
12
|
+
Authentications,
|
|
13
|
+
Resource,
|
|
14
|
+
ResourceId,
|
|
15
|
+
ResourceListResult,
|
|
16
|
+
EventsResult,
|
|
17
|
+
} from '@cloudcommerce/api/src/types';
|
|
18
|
+
import type { ApplyDiscountParams } from './modules/apply_discount:params';
|
|
19
|
+
import type { ApplyDiscountResponse } from './modules/apply_discount:response';
|
|
20
|
+
import type { CalculateShippingParams } from './modules/calculate_shipping:params';
|
|
21
|
+
import type { CalculateShippingResponse } from './modules/calculate_shipping:response';
|
|
22
|
+
import type { ListPaymentsParams } from './modules/list_payments:params';
|
|
23
|
+
import type { ListPaymentsResponse } from './modules/list_payments:response';
|
|
24
|
+
import type { CreateTransactionParams } from './modules/create_transaction:params';
|
|
25
|
+
import type { CreateTransactionResponse } from './modules/create_transaction:response';
|
|
26
|
+
import type { CheckoutBody } from './modules/@checkout:params';
|
|
27
|
+
|
|
28
|
+
type AppEventsTopic = 'orders-new'
|
|
29
|
+
| 'orders-setAnyStatus'
|
|
30
|
+
| 'orders-paid'
|
|
31
|
+
| 'orders-readyForShipping'
|
|
32
|
+
| 'orders-delivered'
|
|
33
|
+
| 'orders-cancelled'
|
|
34
|
+
| 'products-new'
|
|
35
|
+
| 'products-setQuantity'
|
|
36
|
+
| 'products-setPrice'
|
|
37
|
+
| 'carts-new'
|
|
38
|
+
| 'carts-setCustomer';
|
|
39
|
+
|
|
40
|
+
export type {
|
|
41
|
+
Products,
|
|
42
|
+
Categories,
|
|
43
|
+
Brands,
|
|
44
|
+
Collections,
|
|
45
|
+
Grids,
|
|
46
|
+
Carts,
|
|
47
|
+
Orders,
|
|
48
|
+
Customers,
|
|
49
|
+
Stores,
|
|
50
|
+
Applications,
|
|
51
|
+
Authentications,
|
|
52
|
+
Resource,
|
|
53
|
+
ResourceId,
|
|
54
|
+
ResourceListResult,
|
|
55
|
+
EventsResult,
|
|
56
|
+
AppEventsTopic,
|
|
57
|
+
ApplyDiscountParams,
|
|
58
|
+
ApplyDiscountResponse,
|
|
59
|
+
CalculateShippingParams,
|
|
60
|
+
CalculateShippingResponse,
|
|
61
|
+
ListPaymentsParams,
|
|
62
|
+
ListPaymentsResponse,
|
|
63
|
+
CreateTransactionParams,
|
|
64
|
+
CreateTransactionResponse,
|
|
65
|
+
CheckoutBody,
|
|
66
|
+
};
|