@womp/openai-plugin 0.10.1 → 0.11.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/README.md CHANGED
@@ -71,8 +71,8 @@ sign-in.
71
71
  | `finishScene(subject, { designId, title })` | marks the current build done, with this version's title; called only for a design that passed the print checks |
72
72
  | `claimLink?(subject)` | optional: a one-time link to a page that keeps the chat's designs in an account; without it the design card offers no button |
73
73
  | `getBuild(subject, { designId, buildId })` | a build's status, activity, title and picture; a build that isn't the caller's reads as empty |
74
- | `checkoutDesign(subject, { designId, items, longestSideCm?, shipTo? })` | freezes the design as quoted, at its own size or scaled to `longestSideCm`, and without its `REFERENCE` Areas, and returns the quote with one checkout link for all its `items`, each `{ parts?, material, color?, finish?, quantity? }`: the Areas `parts` names, or the whole design, priced on its own; with `shipTo`, also the order to that address as a payment-sheet session; called only when every item passed the print checks |
75
- | `completeCheckout?(subject, payment)` | optional: charges a payment made in ChatGPT's payment sheet and places the session's order; without it `checkout_design` takes no `shipTo` and there is no `complete_checkout` |
74
+ | `checkoutDesign(subject, { designId, items, longestSideCm?, shipTo? })` | freezes the design as quoted, at its own size or scaled to `longestSideCm`, and without its `REFERENCE` Areas, and returns the quote with one checkout link for all its `items`, each `{ parts?, material, color?, finish?, quantity? }`: the Areas `parts` names, or the whole design, priced on its own; with `shipTo`, also shipping to that address: from a host with `completeCheckout`, the order there as a payment-sheet `session`, else `shipping`, the cheapest shipping as the user's checkout on the web first offers it and the day it arrives; called only when every item passed the print checks |
75
+ | `completeCheckout?(subject, payment)` | optional: charges a payment made in ChatGPT's payment sheet and places the session's order; without it there is no `complete_checkout`, and a quote to an address carries `shipping` instead of a session |
76
76
  | `getOrderStatus(subject, { orderId? })` | the caller's paid orders, newest first, and the one to show, with no name, address, email or money |
77
77
 
78
78
  A build is one round of changes and has one card. Opening a new build never
package/dist/index.d.ts CHANGED
@@ -93,7 +93,7 @@ interface PrintAnalysis {
93
93
  currency: string;
94
94
  options: PrintOption[];
95
95
  }
96
- /** Where an order paid in ChatGPT's payment sheet ships. */
96
+ /** Where a quoted order ships. */
97
97
  interface ShipTo {
98
98
  name: string;
99
99
  line1: string;
@@ -132,8 +132,13 @@ interface Checkout {
132
132
  shipsBy: string;
133
133
  minimumOrder: MinimumOrder;
134
134
  link: CheckoutLink;
135
- /** Quoted with `shipTo`: the order to that address, ready to pay in ChatGPT's payment sheet. */
135
+ /** Quoted with `shipTo` by a host with `completeCheckout`: the order to that address, ready to pay in ChatGPT's payment sheet. */
136
136
  session?: CheckoutSession;
137
+ /** Quoted with `shipTo` by a host without `completeCheckout`: the cheapest shipping to that address, as the user's checkout on the web first offers it, and the day it arrives (YYYY-MM-DD). */
138
+ shipping?: {
139
+ price: number;
140
+ arrivesBy: string;
141
+ };
137
142
  }
138
143
  /** A checkout session in the shape ChatGPT's payment sheet takes (OpenAI's Checkout API). Amounts in cents. */
139
144
  interface CheckoutSession {
@@ -289,7 +294,8 @@ interface WompBackend {
289
294
  }): Promise<Build>;
290
295
  /**
291
296
  * Freezes the design as quoted, at `longestSideCm` when given, so its order prints it as it is now: every item in one
292
- * checkout, each the Areas its `parts` names or the whole design. `shipTo` comes only to a host with `completeCheckout`.
297
+ * checkout, each the Areas its `parts` names or the whole design. With `shipTo`, the quote also prices shipping there:
298
+ * as a `session` from a host with `completeCheckout`, else as `shipping`.
293
299
  */
294
300
  checkoutDesign(subject: string, input: {
295
301
  designId: string;