@odoro-cli/server-commerce 0.5.0 → 0.6.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.d.ts CHANGED
@@ -161,6 +161,12 @@ interface MailPort {
161
161
  }
162
162
  /** Are the accounts installed (shop 1.3.0)? */
163
163
  declare function accountsInstalled(db: Query): Promise<boolean>;
164
+ interface Customer {
165
+ readonly id: string;
166
+ readonly email: string;
167
+ readonly name: string;
168
+ readonly consent: boolean;
169
+ }
164
170
  /**
165
171
  * The link from the e-mail, opened: it serves ONCE. Returns the session to
166
172
  * set, and the cart to set when the person had one elsewhere — or `null`
@@ -173,6 +179,8 @@ declare function openSession(db: Base, token: string, cartToken: string | undefi
173
179
  session: string;
174
180
  cart: string | null;
175
181
  } | null>;
182
+ /** The person a session cookie names, or `null`. */
183
+ declare function customerOf(db: Query, session: string | undefined): Promise<Customer | null>;
176
184
 
177
185
  interface CommerceOptions {
178
186
  /** The site's shop database (`@odoro-cli/cloud-connect`, or any `Base`). */
@@ -309,4 +317,4 @@ interface StoredImage {
309
317
  */
310
318
  declare function productImage(db: Query, productId: string): Promise<StoredImage | null>;
311
319
 
312
- export { type Base, CART_COOKIE, CUSTOMER_COOKIE, type CheckoutInput, type CommerceOptions, LINKS_PER_HOUR, type MailPort, ODORO_MAIL_PATH, ODORO_PAYMENT_PATH, type OdoroMailOptions, type OdoroPaymentOptions, type PaymentPort, type PgClientLike, type PgPoolLike, type Query, SESSION_MAX_AGE, SHOP_MAJOR, type StoredImage, accountsInstalled, baseFromPool, codesInstalled, createCommerceModule, discountFor, odoroMail, odoroPayment, openSession, productImage, shopInstalled, signCallback, signRequest, storageInstalled, verifyCallback };
320
+ export { type Base, CART_COOKIE, CUSTOMER_COOKIE, type CheckoutInput, type CommerceOptions, type Customer, LINKS_PER_HOUR, type MailPort, ODORO_MAIL_PATH, ODORO_PAYMENT_PATH, type OdoroMailOptions, type OdoroPaymentOptions, type PaymentPort, type PgClientLike, type PgPoolLike, type Query, SESSION_MAX_AGE, SHOP_MAJOR, type StoredImage, accountsInstalled, baseFromPool, codesInstalled, createCommerceModule, customerOf, discountFor, odoroMail, odoroPayment, openSession, productImage, shopInstalled, signCallback, signRequest, storageInstalled, verifyCallback };
package/dist/index.js CHANGED
@@ -1268,6 +1268,6 @@ function baseFromPool(pool) {
1268
1268
  };
1269
1269
  }
1270
1270
 
1271
- export { CART_COOKIE, CUSTOMER_COOKIE, LINKS_PER_HOUR, ODORO_MAIL_PATH, ODORO_PAYMENT_PATH, SESSION_MAX_AGE, SHOP_MAJOR, accountsInstalled, baseFromPool, codesInstalled, createCommerceModule, discountFor, odoroMail, odoroPayment, openSession, productImage, shopInstalled, signCallback, signRequest, storageInstalled, verifyCallback };
1271
+ export { CART_COOKIE, CUSTOMER_COOKIE, LINKS_PER_HOUR, ODORO_MAIL_PATH, ODORO_PAYMENT_PATH, SESSION_MAX_AGE, SHOP_MAJOR, accountsInstalled, baseFromPool, codesInstalled, createCommerceModule, customerOf, discountFor, odoroMail, odoroPayment, openSession, productImage, shopInstalled, signCallback, signRequest, storageInstalled, verifyCallback };
1272
1272
  //# sourceMappingURL=index.js.map
1273
1273
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoro-cli/server-commerce",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "author": "BouBouw",