@cohostvip/cohost-react 0.0.12 → 0.1.0
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.
|
@@ -7,7 +7,8 @@ export type CohostCheckoutProviderProps = {
|
|
|
7
7
|
export type CohostCheckoutContextType = {
|
|
8
8
|
cartSessionId: string;
|
|
9
9
|
cartSession: CartSession | null;
|
|
10
|
-
|
|
10
|
+
joinGroup: (groupId: string) => Promise<void>;
|
|
11
|
+
updateItem: (offeringId: string, quantity: number, options: any) => Promise<void>;
|
|
11
12
|
updateCartSession: (data: Partial<UpdatableCartSession>) => Promise<void>;
|
|
12
13
|
placeOrder: () => Promise<unknown>;
|
|
13
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CohostCheckoutContext.d.ts","sourceRoot":"","sources":["../../src/context/CohostCheckoutContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"CohostCheckoutContext.d.ts","sourceRoot":"","sources":["../../src/context/CohostCheckoutContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAY,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE1F,MAAM,MAAM,2BAA2B,GAAG;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,UAAU,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClF,iBAAiB,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,oBAAoB,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,UAAU,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACtC,CAAC;AAGF,eAAO,MAAM,qBAAqB,iDAAwD,CAAC;AAE3F,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAsFxE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAO,yBAIpC,CAAC"}
|
|
@@ -12,10 +12,11 @@ export const CohostCheckoutProvider = ({ cartSessionId, children, }) => {
|
|
|
12
12
|
throw new Error("CohostCheckoutProvider requires a cartSession");
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
-
const
|
|
15
|
+
const joinGroup = async (groupId) => { };
|
|
16
|
+
const updateItem = async (itemId, quantity, options) => {
|
|
16
17
|
assertCartSession();
|
|
17
18
|
try {
|
|
18
|
-
const updatedCart = await client.cart.updateItem(cartSessionId, {
|
|
19
|
+
const updatedCart = await client.cart.updateItem(cartSessionId, { itemId, quantity, options });
|
|
19
20
|
setCartSession(updatedCart);
|
|
20
21
|
}
|
|
21
22
|
catch (error) {
|
|
@@ -66,6 +67,7 @@ export const CohostCheckoutProvider = ({ cartSessionId, children, }) => {
|
|
|
66
67
|
updateItem,
|
|
67
68
|
updateCartSession,
|
|
68
69
|
placeOrder,
|
|
70
|
+
joinGroup,
|
|
69
71
|
}, children: children }));
|
|
70
72
|
};
|
|
71
73
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cohostvip/cohost-react",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "React bindings for the Cohost API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@cohostvip/cohost-node": "0.0
|
|
30
|
+
"@cohostvip/cohost-node": "0.1.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@testing-library/jest-dom": "6.6.3",
|