@misiki/gocommerce-connector 0.6.0 → 0.7.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.
- package/dist/{index-1Tr-Urb_.d.cts → index-D-hnd6-D.d.cts} +213 -0
- package/dist/{index-1Tr-Urb_.d.ts → index-D-hnd6-D.d.ts} +213 -0
- package/dist/index.cjs +25 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +25 -0
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +25 -0
- package/dist/services/index.js.map +1 -1
- package/package.json +1 -1
package/dist/services/index.cjs
CHANGED
|
@@ -2034,6 +2034,31 @@ var OrderService = class extends BaseService {
|
|
|
2034
2034
|
async listPublic(_args = {}) {
|
|
2035
2035
|
return emptyPage();
|
|
2036
2036
|
}
|
|
2037
|
+
/**
|
|
2038
|
+
* Opens an order with its number and the email or phone on it, no code. The
|
|
2039
|
+
* engine answers one 404 for an unknown number and a wrong contact. The
|
|
2040
|
+
* token it answers is kept like an order placed in this browser, so the
|
|
2041
|
+
* order page and `getOrder` read it again.
|
|
2042
|
+
*/
|
|
2043
|
+
async openOrder({ orderNo, contact }) {
|
|
2044
|
+
const res = await this.data(
|
|
2045
|
+
`/api/orders/${encodeURIComponent(orderNo.trim())}/open`,
|
|
2046
|
+
{ method: "POST", body: { contact: contact.trim() } }
|
|
2047
|
+
);
|
|
2048
|
+
rememberOrder({ number: res.order.number, token: res.access_token, cartId: "" });
|
|
2049
|
+
return { data: [toOrder(res.order)] };
|
|
2050
|
+
}
|
|
2051
|
+
/**
|
|
2052
|
+
* Opens an order from the link in its emails, which carries the order's key
|
|
2053
|
+
* (`/order-tracking?order=…&key=…`). The key is kept like an order placed in
|
|
2054
|
+
* this browser, so the page can drop it from the address bar.
|
|
2055
|
+
*/
|
|
2056
|
+
async openOrderWithKey({ orderNo, key }) {
|
|
2057
|
+
const number = orderNo.trim();
|
|
2058
|
+
const order = await this.data(`/api/orders/${encodeURIComponent(number)}`, { query: { token: key.trim() } });
|
|
2059
|
+
rememberOrder({ number: order.number, token: key.trim(), cartId: "" });
|
|
2060
|
+
return { data: [toOrder(order)] };
|
|
2061
|
+
}
|
|
2037
2062
|
/**
|
|
2038
2063
|
* Sends a 4-digit code to the email or phone on the order, when `contact`
|
|
2039
2064
|
* is that email or phone. The engine answers the same either way, so this
|