@fayz-ai/shop 0.9.0 → 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.
Files changed (163) hide show
  1. package/README.md +18 -1
  2. package/dist/admin.d.ts +2 -0
  3. package/dist/admin.d.ts.map +1 -0
  4. package/dist/catalog.d.ts +1 -3
  5. package/dist/catalog.d.ts.map +1 -1
  6. package/dist/catalog.js +2 -2
  7. package/dist/{chunk-IYQHKMLB.js → chunk-2WACO2TG.js} +4 -4
  8. package/dist/chunk-2WACO2TG.js.map +1 -0
  9. package/dist/chunk-3GERSY5F.js +526 -0
  10. package/dist/chunk-3GERSY5F.js.map +1 -0
  11. package/dist/chunk-6BO2TMZ5.js +93 -0
  12. package/dist/chunk-6BO2TMZ5.js.map +1 -0
  13. package/dist/chunk-FQPGE3YN.js +3 -0
  14. package/dist/{chunk-JR25TISO.js.map → chunk-FQPGE3YN.js.map} +1 -1
  15. package/dist/{chunk-CTKZ6O2J.js → chunk-IKNGCRUM.js} +41 -15
  16. package/dist/chunk-IKNGCRUM.js.map +1 -0
  17. package/dist/chunk-KLDS7IPU.js +17 -0
  18. package/dist/chunk-KLDS7IPU.js.map +1 -0
  19. package/dist/chunk-NWW3WJ7Y.js +136 -0
  20. package/dist/chunk-NWW3WJ7Y.js.map +1 -0
  21. package/dist/chunk-STRNMFC4.js +1438 -0
  22. package/dist/chunk-STRNMFC4.js.map +1 -0
  23. package/dist/chunk-U6HV3LVP.js +1170 -0
  24. package/dist/chunk-U6HV3LVP.js.map +1 -0
  25. package/dist/client.d.ts +2 -0
  26. package/dist/client.d.ts.map +1 -0
  27. package/dist/data/customer-search.d.ts +3 -0
  28. package/dist/data/customer-search.d.ts.map +1 -0
  29. package/dist/data/functions.d.ts +9 -0
  30. package/dist/data/functions.d.ts.map +1 -0
  31. package/dist/data/media.d.ts +37 -0
  32. package/dist/data/media.d.ts.map +1 -0
  33. package/dist/{mock-catalog.d.ts → data/mock-catalog.d.ts} +21 -1
  34. package/dist/data/mock-catalog.d.ts.map +1 -0
  35. package/dist/data/mock-provider.d.ts +165 -0
  36. package/dist/data/mock-provider.d.ts.map +1 -0
  37. package/dist/data/mock.d.ts +3 -0
  38. package/dist/data/mock.d.ts.map +1 -0
  39. package/dist/data/provider.d.ts +335 -0
  40. package/dist/data/provider.d.ts.map +1 -0
  41. package/dist/data/supabase-provider.d.ts +208 -0
  42. package/dist/data/supabase-provider.d.ts.map +1 -0
  43. package/dist/data/tables.d.ts +38 -0
  44. package/dist/data/tables.d.ts.map +1 -0
  45. package/dist/data/tenant.d.ts.map +1 -0
  46. package/dist/entities/entity-reconcile.d.ts +32 -0
  47. package/dist/entities/entity-reconcile.d.ts.map +1 -0
  48. package/dist/entities/entity-sql.d.ts +50 -0
  49. package/dist/entities/entity-sql.d.ts.map +1 -0
  50. package/dist/entities/entity-store.d.ts +58 -0
  51. package/dist/entities/entity-store.d.ts.map +1 -0
  52. package/dist/entities/index.d.ts +10 -0
  53. package/dist/entities/index.d.ts.map +1 -0
  54. package/dist/entities/mock-entity-store.d.ts +17 -0
  55. package/dist/entities/mock-entity-store.d.ts.map +1 -0
  56. package/dist/entities/supabase-entity-store.d.ts +8 -0
  57. package/dist/entities/supabase-entity-store.d.ts.map +1 -0
  58. package/dist/entities.js +159 -0
  59. package/dist/entities.js.map +1 -0
  60. package/dist/index.d.ts +28 -12
  61. package/dist/index.d.ts.map +1 -1
  62. package/dist/index.js +1558 -40
  63. package/dist/index.js.map +1 -1
  64. package/dist/inventory/allocation.d.ts +98 -0
  65. package/dist/inventory/allocation.d.ts.map +1 -0
  66. package/dist/inventory/index.d.ts +13 -0
  67. package/dist/inventory/index.d.ts.map +1 -0
  68. package/dist/inventory/mock-stock-store.d.ts +89 -0
  69. package/dist/inventory/mock-stock-store.d.ts.map +1 -0
  70. package/dist/inventory/postgrest-double.d.ts +65 -0
  71. package/dist/inventory/postgrest-double.d.ts.map +1 -0
  72. package/dist/inventory/shopify-mapping.d.ts +67 -0
  73. package/dist/inventory/shopify-mapping.d.ts.map +1 -0
  74. package/dist/inventory/stock-contract.d.ts +46 -0
  75. package/dist/inventory/stock-contract.d.ts.map +1 -0
  76. package/dist/inventory/stock-store.d.ts +96 -0
  77. package/dist/inventory/stock-store.d.ts.map +1 -0
  78. package/dist/inventory/stock-types.d.ts +351 -0
  79. package/dist/inventory/stock-types.d.ts.map +1 -0
  80. package/dist/inventory/supabase-stock-store.d.ts +60 -0
  81. package/dist/inventory/supabase-stock-store.d.ts.map +1 -0
  82. package/dist/inventory/vocabulary.d.ts +86 -0
  83. package/dist/inventory/vocabulary.d.ts.map +1 -0
  84. package/dist/inventory.js +4 -0
  85. package/dist/inventory.js.map +1 -0
  86. package/dist/lib/catalog.d.ts +4 -0
  87. package/dist/lib/catalog.d.ts.map +1 -0
  88. package/dist/{commerce.d.ts → lib/commerce.d.ts} +2 -2
  89. package/dist/lib/commerce.d.ts.map +1 -0
  90. package/dist/lib/document.d.ts +13 -0
  91. package/dist/lib/document.d.ts.map +1 -0
  92. package/dist/lib/emails.d.ts +50 -0
  93. package/dist/lib/emails.d.ts.map +1 -0
  94. package/dist/lib/message-events.d.ts +4 -0
  95. package/dist/lib/message-events.d.ts.map +1 -0
  96. package/dist/lib/runtime.d.ts +5 -0
  97. package/dist/lib/runtime.d.ts.map +1 -0
  98. package/dist/lib/variant-matrix.d.ts +120 -0
  99. package/dist/lib/variant-matrix.d.ts.map +1 -0
  100. package/dist/mock.d.ts +1 -2
  101. package/dist/mock.d.ts.map +1 -1
  102. package/dist/mock.js +4 -2
  103. package/dist/provider.d.ts +1 -88
  104. package/dist/provider.d.ts.map +1 -1
  105. package/dist/providers/checkout.d.ts +129 -0
  106. package/dist/providers/checkout.d.ts.map +1 -0
  107. package/dist/providers/index.d.ts +5 -0
  108. package/dist/providers/index.d.ts.map +1 -0
  109. package/dist/providers/shipping.d.ts +43 -0
  110. package/dist/providers/shipping.d.ts.map +1 -0
  111. package/dist/providers.js +70 -0
  112. package/dist/providers.js.map +1 -0
  113. package/dist/rules/adapter.d.ts +36 -0
  114. package/dist/rules/adapter.d.ts.map +1 -0
  115. package/dist/rules/attributes.d.ts +64 -0
  116. package/dist/rules/attributes.d.ts.map +1 -0
  117. package/dist/rules/context.d.ts +43 -0
  118. package/dist/rules/context.d.ts.map +1 -0
  119. package/dist/rules/evaluator.d.ts +37 -0
  120. package/dist/rules/evaluator.d.ts.map +1 -0
  121. package/dist/rules/index.d.ts +13 -0
  122. package/dist/rules/index.d.ts.map +1 -0
  123. package/dist/rules/prices.d.ts +25 -0
  124. package/dist/rules/prices.d.ts.map +1 -0
  125. package/dist/rules/rule-types.d.ts +160 -0
  126. package/dist/rules/rule-types.d.ts.map +1 -0
  127. package/dist/rules.js +22 -0
  128. package/dist/rules.js.map +1 -0
  129. package/dist/runtime.d.ts +1 -4
  130. package/dist/runtime.d.ts.map +1 -1
  131. package/dist/runtime.js +5 -3
  132. package/dist/shipping/label-provider.d.ts +43 -0
  133. package/dist/shipping/label-provider.d.ts.map +1 -0
  134. package/dist/types.d.ts +688 -0
  135. package/dist/types.d.ts.map +1 -1
  136. package/package.json +30 -20
  137. package/dist/chunk-CTKZ6O2J.js.map +0 -1
  138. package/dist/chunk-IYQHKMLB.js.map +0 -1
  139. package/dist/chunk-JR25TISO.js +0 -3
  140. package/dist/chunk-SVTCJ6HP.js +0 -440
  141. package/dist/chunk-SVTCJ6HP.js.map +0 -1
  142. package/dist/commerce.d.ts.map +0 -1
  143. package/dist/mock-catalog.d.ts.map +0 -1
  144. package/dist/mock-provider.d.ts +0 -60
  145. package/dist/mock-provider.d.ts.map +0 -1
  146. package/dist/supabase-provider.d.ts +0 -56
  147. package/dist/supabase-provider.d.ts.map +0 -1
  148. package/dist/tables.d.ts +0 -12
  149. package/dist/tables.d.ts.map +0 -1
  150. package/dist/tenant.d.ts.map +0 -1
  151. package/src/catalog.ts +0 -3
  152. package/src/commerce.ts +0 -120
  153. package/src/index.ts +0 -40
  154. package/src/mock-catalog.ts +0 -266
  155. package/src/mock-provider.ts +0 -480
  156. package/src/mock.ts +0 -2
  157. package/src/provider.ts +0 -117
  158. package/src/runtime.ts +0 -20
  159. package/src/supabase-provider.ts +0 -754
  160. package/src/tables.ts +0 -17
  161. package/src/tenant.ts +0 -21
  162. package/src/types.ts +0 -623
  163. /package/dist/{tenant.d.ts → data/tenant.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/data/mock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAC1E,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1,335 @@
1
+ import type { EntityRecord, EntityRecordInput, ListEntityRecordsOptions } from '../entities/entity-store';
2
+ import type { StockLocation, CreateStockLocationInput, UpdateStockLocationInput } from '../inventory/stock-types';
3
+ import type { ComputeAction, RuleCartSnapshot } from '../rules/rule-types';
4
+ import type { Product, ProductImage, ProductOption, ProductOptionInput, ProductVariant, ProductVariantSet, CreateProductVariantInput, UpdateProductVariantInput, Category, Order, ShopCustomer, Discount, ProductEnquiry, CreateProductInput, UpdateProductInput, ListProductsOptions, CreateProductEnquiryInput, ListProductEnquiriesOptions, CreateCategoryInput, UpdateCategoryInput, CreateOrderInput, UpdateOrderInput, ListOrdersOptions, PlaceOrderInput, CreateCustomerInput, UpdateCustomerInput, ListCustomersOptions, ResolveCustomerInput, CustomerAddress, ShippingQuoteOption, PaymentChargeMethod, PaymentChargeResult, CheckoutSessionInput, CheckoutSession, CheckoutSettlement, CreateFulfillmentInput, ShipFulfillmentInput, ShippingZone, CreateShippingZoneInput, UpdateShippingZoneInput, ShippingProfile, CreateShippingProfileInput, UpdateShippingProfileInput, ShippingPackage, CreateShippingPackageInput, UpdateShippingPackageInput, ShippingSettings, UpdateShippingSettingsInput, DeliveryCheck, StoreSettings, UpdateStoreSettingsInput, CreateDiscountInput, UpdateDiscountInput, ListDiscountsOptions, DiscountValidation, SalesChannel, CreateSalesChannelInput, UpdateSalesChannelInput, Collection, CreateCollectionInput, UpdateCollectionInput, CustomerGroup, CreateCustomerGroupInput, UpdateCustomerGroupInput, CustomerSegment, CreateCustomerSegmentInput, UpdateCustomerSegmentInput, GiftCard, CreateGiftCardInput, UpdateGiftCardInput, EmailTemplate, UpsertEmailTemplateInput, MediaFile, ShippingLabel, ShippingLabelOption, ShippingAgency } from '../types';
5
+ export interface ShopProvider {
6
+ listProducts(options?: ListProductsOptions): Promise<Product[]>;
7
+ getProduct(id: string): Promise<Product | null>;
8
+ createProduct(input: CreateProductInput): Promise<Product>;
9
+ updateProduct(id: string, input: UpdateProductInput): Promise<Product>;
10
+ deleteProduct(id: string): Promise<void>;
11
+ uploadProductImage(productId: string, file: File): Promise<ProductImage>;
12
+ deleteProductImage(imageId: string): Promise<void>;
13
+ /**
14
+ * Reorder a gallery or promote a photo to primary. Optional so a provider
15
+ * that only ever holds one image per product need not implement it.
16
+ *
17
+ * Setting `isPrimary` is exclusive: the previous primary is demoted in the
18
+ * same call, because two primaries make "the product photo" ambiguous
19
+ * everywhere it is read (card, cart line, order item, admin table).
20
+ */
21
+ updateProductImage?(imageId: string, input: {
22
+ isPrimary?: boolean;
23
+ sortOrder?: number;
24
+ altText?: string | null;
25
+ }): Promise<ProductImage>;
26
+ /**
27
+ * Swap the file behind a photo, keeping the photo.
28
+ *
29
+ * Not delete-then-upload: that loses the position in the gallery and, if it
30
+ * was the cover, which photo the storefront leads with. The row is the photo;
31
+ * only the file it points at changes.
32
+ */
33
+ replaceProductImage?(imageId: string, file: File): Promise<ProductImage>;
34
+ /**
35
+ * Option axes + variants of one product (spine M5, tables from 0028). The
36
+ * product-detail read path: products.bySlug attaches the result onto the
37
+ * Product it returns, which is where the option picker sources from — the
38
+ * DB, never the productMetadata overlay. Optional: a provider without it
39
+ * yields option-less products (list reads skip variants either way).
40
+ */
41
+ getProductVariants?(productId: string, options?: {
42
+ includeArchived?: boolean;
43
+ }): Promise<ProductVariantSet>;
44
+ /**
45
+ * Replace the product's option axes. Whole-set rather than per-axis because
46
+ * the axis NAME is the key inside every variant's `options` object (0028), so
47
+ * a rename is a rewrite of every variant that carries it — one call, one
48
+ * consistent state.
49
+ */
50
+ saveProductOptions?(productId: string, options: ProductOptionInput[]): Promise<ProductOption[]>;
51
+ createProductVariant?(productId: string, input: CreateProductVariantInput): Promise<ProductVariant>;
52
+ updateProductVariant?(variantId: string, input: UpdateProductVariantInput): Promise<ProductVariant>;
53
+ /**
54
+ * Retire a variant. ARCHIVES, never deletes: 0034 CASCADEs
55
+ * plg_shop_stock_balances from the variant, so a DELETE destroys the balance
56
+ * rows for stock the merchant still physically owns while the movements
57
+ * survive with a NULL variant_id and no way to re-attach.
58
+ */
59
+ archiveProductVariant?(variantId: string): Promise<void>;
60
+ /**
61
+ * Set a variant's stock to `count` by APPENDING the difference to the ledger.
62
+ * Never an UPDATE of inventory_count — that column is 0036's mirror, and
63
+ * writing it goes through the I10 shim only to translate back into the
64
+ * movement we would be inserting anyway. Answers the new count.
65
+ */
66
+ setVariantStock?(variantId: string, count: number, note?: string): Promise<number>;
67
+ createProductEnquiry?(input: CreateProductEnquiryInput): Promise<ProductEnquiry>;
68
+ listProductEnquiries?(options?: ListProductEnquiriesOptions): Promise<ProductEnquiry[]>;
69
+ listCategories(): Promise<Category[]>;
70
+ createCategory(input: CreateCategoryInput): Promise<Category>;
71
+ updateCategory(id: string, input: UpdateCategoryInput): Promise<Category>;
72
+ deleteCategory(id: string): Promise<void>;
73
+ listOrders(options?: ListOrdersOptions): Promise<Order[]>;
74
+ getOrder(id: string): Promise<Order | null>;
75
+ createOrder(input: CreateOrderInput): Promise<Order>;
76
+ updateOrder(id: string, input: UpdateOrderInput): Promise<Order>;
77
+ /**
78
+ * Mock/dev payment seam: pending->paid transition via a whitelisted RPC
79
+ * (anon storefronts have no UPDATE grant on the orders table). Real PSPs
80
+ * confirm via webhook with service_role instead.
81
+ */
82
+ confirmPayment?(id: string, reference?: string): Promise<Order | null>;
83
+ /**
84
+ * Opens the charge for a placed order at whichever acquirer the store
85
+ * connected, and reports whether it settled.
86
+ *
87
+ * Both are OPTIONAL and both are safe to repeat: the charge is unique per
88
+ * order, so `openCharge` on a page reload returns the code the buyer already
89
+ * has instead of a second Pix. `paymentState` never settles anything itself —
90
+ * it asks the provider and lets the server write the receipt.
91
+ *
92
+ * The storefront never learns the acquirer's name, URL or token: it holds an
93
+ * order id and gets back a code to display.
94
+ */
95
+ /**
96
+ * Abre a cobrança ANTES de existir pedido, congelando o carrinho numa sessão.
97
+ *
98
+ * É o par que sustenta "o pedido só nasce quando o pagamento entra":
99
+ * `openCheckoutSession` cobra, `settleCheckoutSession` pergunta ao provedor e,
100
+ * quando ele diz pago, o SERVIDOR cria o pedido a partir do congelado. O
101
+ * navegador nunca é a autoridade sobre isso.
102
+ */
103
+ openCheckoutSession?(input: CheckoutSessionInput): Promise<CheckoutSession>;
104
+ settleCheckoutSession?(sessionId: string): Promise<CheckoutSettlement>;
105
+ openCharge?(orderId: string, method?: PaymentChargeMethod): Promise<PaymentChargeResult>;
106
+ paymentState?(orderId: string): Promise<PaymentChargeResult>;
107
+ /**
108
+ * Cancels an order and gives back what it was holding — open shipments, the
109
+ * outstanding reservation, the open receivable — in one statement.
110
+ *
111
+ * Until 0054 this did not exist anywhere: the column accepted `cancelled`,
112
+ * RLS allowed the UPDATE, and there was no function and no button. A raw
113
+ * UPDATE left the reservation stuck forever (the storefront sells
114
+ * `inventory_count - reserved_count`) and the receivable open.
115
+ */
116
+ cancelOrder?(orderId: string, reason?: string): Promise<Order | null>;
117
+ /**
118
+ * Validates ONE coupon the shopper already holds, server-side.
119
+ *
120
+ * The fallback path validates by LISTING every active discount, which 401s
121
+ * for `anon` (no table grant) and, if it did not, would hand every
122
+ * undisclosed code to anyone who opened devtools. Optional so a provider
123
+ * without it keeps the old behaviour.
124
+ */
125
+ validateDiscountCode?(code: string, subtotal?: number): Promise<DiscountValidation>;
126
+ /**
127
+ * Dispatch, by hand — the merchant packs the box themselves and types the
128
+ * tracking the courier gave them.
129
+ *
130
+ * `createFulfillment` is the whole act: it opens the shipment, moves the stock
131
+ * off the shelf and releases the reservation the order took, in one statement.
132
+ * With a tracking code it is already in transit; without one it is picking.
133
+ */
134
+ /**
135
+ * Despatch through the connected carrier — quote, buy, print, track.
136
+ *
137
+ * `buyShippingLabel` SPENDS the merchant's balance at the carrier, so it is
138
+ * never called by anything but an explicit click, and it is idempotent per
139
+ * order: a second call answers the label already bought.
140
+ */
141
+ quoteShippingLabel?(orderId: string, carrier?: string): Promise<{
142
+ options: ShippingLabelOption[];
143
+ label: ShippingLabel | null;
144
+ }>;
145
+ buyShippingLabel?(orderId: string, serviceId: number, carrier?: string): Promise<ShippingLabel>;
146
+ printShippingLabel?(orderId: string, carrier?: string): Promise<string | null>;
147
+ /** Drop-off points near a place — for the location's own settings. */
148
+ listShippingAgencies?(query: {
149
+ state?: string;
150
+ city?: string;
151
+ carrier?: string;
152
+ }): Promise<ShippingAgency[]>;
153
+ trackShippingLabel?(orderId: string, carrier?: string): Promise<ShippingLabel['tracking']>;
154
+ createFulfillment?(input: CreateFulfillmentInput): Promise<string>;
155
+ shipFulfillment?(id: string, input: ShipFulfillmentInput): Promise<void>;
156
+ /** Marca o envio como entregue. Deriva o "pedido entregue" do conjunto. */
157
+ deliverFulfillment?(id: string, deliveredAt?: string): Promise<void>;
158
+ cancelFulfillment?(id: string, note?: string): Promise<void>;
159
+ /**
160
+ * Trusted order placement: the server re-reads product prices + stock,
161
+ * validates the discount, computes totals, and decrements inventory
162
+ * atomically. Storefront checkout MUST use this instead of createOrder so the
163
+ * browser cannot tamper with prices. createOrder remains for trusted admin entry.
164
+ */
165
+ placeOrder(input: PlaceOrderInput): Promise<Order>;
166
+ listCustomers(options?: ListCustomersOptions): Promise<ShopCustomer[]>;
167
+ getCustomer(id: string): Promise<ShopCustomer | null>;
168
+ createCustomer(input: CreateCustomerInput): Promise<ShopCustomer>;
169
+ updateCustomer(id: string, input: UpdateCustomerInput): Promise<ShopCustomer>;
170
+ deleteCustomer(id: string): Promise<void>;
171
+ /**
172
+ * Find-or-create the customer for a storefront shopper and (on Supabase) link
173
+ * it to auth.uid server-side, so order reads can be scoped to the owner by RLS.
174
+ * Optional: providers without it fall back to listCustomers+createCustomer.
175
+ */
176
+ resolveCustomer?(input: ResolveCustomerInput): Promise<ShopCustomer>;
177
+ /**
178
+ * The signed-in shopper's saved delivery addresses, so checkout can offer
179
+ * them instead of inventing a placeholder. Optional: a provider without it
180
+ * (or an anonymous request) yields an empty book and a blank form.
181
+ */
182
+ listCustomerAddresses?(customerId: string): Promise<CustomerAddress[]>;
183
+ /**
184
+ * Delivery options for a postal code at a given subtotal. An empty array
185
+ * means the store does not deliver there — shown before the buyer commits to
186
+ * a cart, which is the whole point of quoting on the product page.
187
+ *
188
+ * This is for DISPLAY. shop_place_order recomputes the freight — from the
189
+ * zones, or from the carrier quote the server itself recorded (0044b) — and
190
+ * ignores whatever the client sends, so a tampered quote changes what the
191
+ * shopper sees and nothing about what they are charged.
192
+ *
193
+ * MUST HONOUR `StoreSettings.carrierQuotes === false` (0048): the gateway is
194
+ * asked from HERE, by the browser, so this is the only place that can decline
195
+ * to ask. A store that chose "eu mesmo calculo" must get its zones even when a
196
+ * gateway is connected — otherwise connecting one silently overrides the
197
+ * merchant who delivers by car, since a gateway quote wins over the zones when
198
+ * it answers.
199
+ */
200
+ quoteShipping?(postalCode: string, subtotal: number): Promise<ShippingQuoteOption[]>;
201
+ /**
202
+ * Record which delivery option the shopper picked.
203
+ *
204
+ * Only meaningful for carrier quotes, where the price is not re-derivable
205
+ * from a zone the server can look up on its own: the choice has to be stored
206
+ * beside the quote so the order can read it back. Sends an option ID, never
207
+ * a price. A store quoting from its own zones needs no call — resolving a
208
+ * zone is arithmetic the order redoes anyway — so implementations may skip
209
+ * it, and callers must treat `false` as "the cheapest option stands".
210
+ */
211
+ selectShippingOption?(optionId: string): Promise<boolean>;
212
+ /**
213
+ * Does this store deliver to this postcode at all? (0048)
214
+ *
215
+ * Asked with the ADDRESS and before the card, because discovering at payment
216
+ * that the store refuses the region is the worst possible order for that to
217
+ * happen in. Two separate facts — see `DeliveryCheck`.
218
+ *
219
+ * Not a substitute for `quoteShipping`: this one knows nothing about price and
220
+ * nothing about carriers. A store with no zones at all answers `refused:
221
+ * false, ownZone: false`, which is correct and is what it always was.
222
+ */
223
+ checkDelivery?(postalCode: string): Promise<DeliveryCheck>;
224
+ /**
225
+ * Delivery profiles — named groups of products with their own zones (0049).
226
+ *
227
+ * Admin-only. The storefront never reads these: it asks for a quote and the
228
+ * server resolves the profile from the product ids, so a browser cannot claim
229
+ * its cart belongs to a cheaper profile.
230
+ */
231
+ listShippingProfiles?(): Promise<ShippingProfile[]>;
232
+ createShippingProfile?(input: CreateShippingProfileInput): Promise<ShippingProfile>;
233
+ updateShippingProfile?(id: string, input: UpdateShippingProfileInput): Promise<ShippingProfile>;
234
+ deleteShippingProfile?(id: string): Promise<void>;
235
+ /** Delivery zones the merchant maintains. Admin-only: the storefront reads
236
+ * quotes, never the ranges themselves. */
237
+ listShippingZones?(): Promise<ShippingZone[]>;
238
+ createShippingZone?(input: CreateShippingZoneInput): Promise<ShippingZone>;
239
+ updateShippingZone?(id: string, input: UpdateShippingZoneInput): Promise<ShippingZone>;
240
+ deleteShippingZone?(id: string): Promise<void>;
241
+ /**
242
+ * The places the store ships from (0058) — the same rows the stock ledger
243
+ * uses, edited as a merchant registry.
244
+ *
245
+ * The read overlaps `StockStore.listLocations()` on purpose: that port serves
246
+ * the ledger and stays read-only, this one is the back-office CRUD. Both go
247
+ * through the same row mapper.
248
+ */
249
+ listStockLocations?(): Promise<StockLocation[]>;
250
+ createStockLocation?(input: CreateStockLocationInput): Promise<StockLocation>;
251
+ updateStockLocation?(id: string, input: UpdateStockLocationInput): Promise<StockLocation>;
252
+ /** Refused by the database once movements reference it — history outlives a
253
+ * typo, so an unwanted location is archived, not deleted. */
254
+ deleteStockLocation?(id: string): Promise<void>;
255
+ /** The boxes the store packs in (0046). Admin-only for the same reason as
256
+ * the zones: the shopper is told a price, never the inventory behind it. */
257
+ listShippingPackages?(): Promise<ShippingPackage[]>;
258
+ createShippingPackage?(input: CreateShippingPackageInput): Promise<ShippingPackage>;
259
+ updateShippingPackage?(id: string, input: UpdateShippingPackageInput): Promise<ShippingPackage>;
260
+ deleteShippingPackage?(id: string): Promise<void>;
261
+ /** The store-wide delivery fallback, for addresses no zone covers. Null when
262
+ * the tenant has no row — which means free, not "unknown". */
263
+ getShippingSettings?(): Promise<ShippingSettings | null>;
264
+ updateShippingSettings?(input: UpdateShippingSettingsInput): Promise<ShippingSettings>;
265
+ /**
266
+ * The merchant's own read: every field, past RLS as a member.
267
+ *
268
+ * Null means the tenant has no settings row, and every consumer must read
269
+ * that as "nothing decided yet" rather than as a set of falses. The two are
270
+ * the difference between a store that kept its defaults and one that turned
271
+ * everything off.
272
+ */
273
+ getStoreSettings?(): Promise<StoreSettings | null>;
274
+ updateStoreSettings?(input: UpdateStoreSettingsInput): Promise<StoreSettings>;
275
+ /**
276
+ * The STOREFRONT's read — the same policy narrowed to what a shopper's
277
+ * browser is allowed to know, and only for a published store.
278
+ *
279
+ * Separate from getStoreSettings because the audience is: this one is served
280
+ * to `anon` through shop_store_settings(), so it can never widen to a column
281
+ * added later. Null = the store is not published (or does not exist).
282
+ */
283
+ getPublicStoreSettings?(): Promise<StoreSettings | null>;
284
+ /**
285
+ * Evaluate the store's promotions against a cart snapshot → the ordered
286
+ * compute-actions the cart applies (addItemDiscount, addShippingDiscount,
287
+ * addFreeItem). ADVISORY in the browser — a preview of what the trust
288
+ * boundary will conclude; shop_place_order revalidates server-side with the
289
+ * same semantics (migrations/0033 mirrors the TS evaluator).
290
+ *
291
+ * Optional: describeStore keys `capabilities.ruleEngine` off it, and the
292
+ * coupon surface falls back to the legacy percent path without it.
293
+ */
294
+ evaluatePromotions?(input: {
295
+ cart: RuleCartSnapshot;
296
+ }): Promise<ComputeAction[]>;
297
+ listDiscounts(options?: ListDiscountsOptions): Promise<Discount[]>;
298
+ getDiscount(id: string): Promise<Discount | null>;
299
+ createDiscount(input: CreateDiscountInput): Promise<Discount>;
300
+ updateDiscount(id: string, input: UpdateDiscountInput): Promise<Discount>;
301
+ deleteDiscount(id: string): Promise<void>;
302
+ listSalesChannels?(): Promise<SalesChannel[]>;
303
+ createSalesChannel?(input: CreateSalesChannelInput): Promise<SalesChannel>;
304
+ updateSalesChannel?(id: string, input: UpdateSalesChannelInput): Promise<SalesChannel>;
305
+ deleteSalesChannel?(id: string): Promise<void>;
306
+ listEntityRecords?(entity: string, options?: ListEntityRecordsOptions): Promise<EntityRecord[]>;
307
+ getEntityRecord?(entity: string, id: string): Promise<EntityRecord | null>;
308
+ getEntityRecordBySlug?(entity: string, slug: string): Promise<EntityRecord | null>;
309
+ createEntityRecord?(entity: string, input: EntityRecordInput): Promise<EntityRecord>;
310
+ updateEntityRecord?(entity: string, id: string, input: Partial<EntityRecordInput>): Promise<EntityRecord>;
311
+ deleteEntityRecord?(entity: string, id: string): Promise<void>;
312
+ listCollections?(): Promise<Collection[]>;
313
+ getCollection?(id: string): Promise<Collection | null>;
314
+ createCollection?(input: CreateCollectionInput): Promise<Collection>;
315
+ updateCollection?(id: string, input: UpdateCollectionInput): Promise<Collection>;
316
+ deleteCollection?(id: string): Promise<void>;
317
+ listCustomerGroups?(): Promise<CustomerGroup[]>;
318
+ createCustomerGroup?(input: CreateCustomerGroupInput): Promise<CustomerGroup>;
319
+ updateCustomerGroup?(id: string, input: UpdateCustomerGroupInput): Promise<CustomerGroup>;
320
+ deleteCustomerGroup?(id: string): Promise<void>;
321
+ listCustomerSegments?(): Promise<CustomerSegment[]>;
322
+ createCustomerSegment?(input: CreateCustomerSegmentInput): Promise<CustomerSegment>;
323
+ updateCustomerSegment?(id: string, input: UpdateCustomerSegmentInput): Promise<CustomerSegment>;
324
+ deleteCustomerSegment?(id: string): Promise<void>;
325
+ listGiftCards?(): Promise<GiftCard[]>;
326
+ createGiftCard?(input: CreateGiftCardInput): Promise<GiftCard>;
327
+ updateGiftCard?(id: string, input: UpdateGiftCardInput): Promise<GiftCard>;
328
+ deleteGiftCard?(id: string): Promise<void>;
329
+ listEmailTemplates?(): Promise<EmailTemplate[]>;
330
+ upsertEmailTemplate?(input: UpsertEmailTemplateInput): Promise<EmailTemplate>;
331
+ listMediaFiles?(): Promise<MediaFile[]>;
332
+ uploadMediaFile?(file: File): Promise<MediaFile>;
333
+ deleteMediaFile?(id: string): Promise<void>;
334
+ }
335
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/data/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AACzG,OAAO,KAAK,EACV,aAAa,EAAE,wBAAwB,EAAE,wBAAwB,EAClE,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,KAAK,EACV,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,cAAc,EAAE,iBAAiB,EAC3F,yBAAyB,EAAE,yBAAyB,EAAE,QAAQ,EAC9D,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAC7C,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAC3D,yBAAyB,EAAE,2BAA2B,EACtD,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EACtE,mBAAmB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,oBAAoB,EACpF,eAAe,EAAE,mBAAmB,EACpC,mBAAmB,EAAE,mBAAmB,EACxC,oBAAoB,EAAE,eAAe,EAAE,k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AQ,CAAC,CAAA;IAC1E,cAAc,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1C,kBAAkB,CAAC,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAAA;IAC/C,mBAAmB,CAAC,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;IAC7E,cAAc,CAAC,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAAA;IACvC,eAAe,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;IAChD,eAAe,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5C"}
@@ -0,0 +1,208 @@
1
+ import type { EntityRecord, EntityRecordInput, ListEntityRecordsOptions } from '../entities/entity-store';
2
+ import type { ShopProvider } from './provider';
3
+ import type { ComputeAction, RuleCartSnapshot } from '../rules/rule-types';
4
+ import { mediaKindOf } from './media';
5
+ import type { StockLocation, CreateStockLocationInput, UpdateStockLocationInput } from '../inventory/stock-types';
6
+ import type { Product, ProductImage, ProductOption, ProductOptionInput, ProductVariant, ProductVariantSet, CreateProductVariantInput, UpdateProductVariantInput, Category, Order, ShopCustomer, Discount, CreateProductInput, UpdateProductInput, ListProductsOptions, CreateCategoryInput, UpdateCategoryInput, CreateOrderInput, UpdateOrderInput, ListOrdersOptions, PlaceOrderInput, CreateCustomerInput, UpdateCustomerInput, ListCustomersOptions, ResolveCustomerInput, CreateDiscountInput, UpdateDiscountInput, ListDiscountsOptions, CheckoutSessionInput, CheckoutSession, CheckoutSettlement, ShippingQuoteOption, CustomerAddress, ShippingAgency, SalesChannel, CreateSalesChannelInput, UpdateSalesChannelInput, ShippingZone, CreateShippingZoneInput, UpdateShippingZoneInput, ShippingProfile, CreateShippingProfileInput, UpdateShippingProfileInput, ShippingPackage, CreateShippingPackageInput, UpdateShippingPackageInput, ShippingSettings, UpdateShippingSettingsInput, StoreSettings, UpdateStoreSettingsInput, DeliveryCheck, Collection, CreateCollectionInput, UpdateCollectionInput, CustomerGroup, CreateCustomerGroupInput, UpdateCustomerGroupInput, CustomerSegment, CreateCustomerSegmentInput, UpdateCustomerSegmentInput, GiftCard, CreateGiftCardInput, UpdateGiftCardInput, EmailTemplate, UpsertEmailTemplateInput, MediaFile } from '../types';
7
+ export { mediaKindOf };
8
+ export declare class SupabaseShopProvider implements ShopProvider {
9
+ listProducts(options?: ListProductsOptions): Promise<Product[]>;
10
+ getProduct(id: string): Promise<Product | null>;
11
+ /** Option axes + variants from the 0028 tables (spine M5). The storefront
12
+ * RLS on both tables already restricts anon reads to active variants of
13
+ * publicly readable products; the status filter here keeps the admin path
14
+ * (authenticated tenant member, who CAN see archived rows) consistent. */
15
+ getProductVariants(productId: string, opts?: {
16
+ includeArchived?: boolean;
17
+ }): Promise<ProductVariantSet>;
18
+ saveProductOptions(productId: string, input: ProductOptionInput[]): Promise<ProductOption[]>;
19
+ createProductVariant(productId: string, input: CreateProductVariantInput): Promise<ProductVariant>;
20
+ updateProductVariant(variantId: string, input: UpdateProductVariantInput): Promise<ProductVariant>;
21
+ archiveProductVariant(variantId: string): Promise<void>;
22
+ setVariantStock(variantId: string, count: number, note?: string): Promise<number>;
23
+ createProduct(input: CreateProductInput): Promise<Product>;
24
+ updateProduct(id: string, input: UpdateProductInput): Promise<Product>;
25
+ deleteProduct(id: string): Promise<void>;
26
+ uploadProductImage(productId: string, file: File): Promise<ProductImage>;
27
+ updateProductImage(imageId: string, input: {
28
+ isPrimary?: boolean;
29
+ sortOrder?: number;
30
+ altText?: string | null;
31
+ }): Promise<ProductImage>;
32
+ replaceProductImage(imageId: string, file: File): Promise<ProductImage>;
33
+ deleteProductImage(imageId: string): Promise<void>;
34
+ /**
35
+ * Drop a stored file once nothing points at it anymore.
36
+ *
37
+ * The row was the only thing keeping the object reachable, so leaving it
38
+ * behind is a file nobody can see and nobody can delete — and the bill for it
39
+ * arrives all the same. Two rows can share one URL (a duplicated product), and
40
+ * the survivor has to keep working, so the count decides.
41
+ */
42
+ private removeUnreferencedObject;
43
+ listCategories(): Promise<Category[]>;
44
+ createCategory(input: CreateCategoryInput): Promise<Category>;
45
+ updateCategory(id: string, input: UpdateCategoryInput): Promise<Category>;
46
+ deleteCategory(id: string): Promise<void>;
47
+ listOrders(options?: ListOrdersOptions): Promise<Order[]>;
48
+ getOrder(id: string): Promise<Order | null>;
49
+ createOrder(input: CreateOrderInput): Promise<Order>;
50
+ updateOrder(id: string, input: UpdateOrderInput): Promise<Order>;
51
+ listShippingZones(): Promise<ShippingZone[]>;
52
+ createShippingZone(input: CreateShippingZoneInput): Promise<ShippingZone>;
53
+ updateShippingZone(id: string, input: UpdateShippingZoneInput): Promise<ShippingZone>;
54
+ listShippingPackages(): Promise<ShippingPackage[]>;
55
+ createShippingPackage(input: CreateShippingPackageInput): Promise<ShippingPackage>;
56
+ updateShippingPackage(id: string, input: UpdateShippingPackageInput): Promise<ShippingPackage>;
57
+ deleteShippingPackage(id: string): Promise<void>;
58
+ private clearDefaultPackage;
59
+ deleteShippingZone(id: string): Promise<void>;
60
+ getShippingSettings(): Promise<ShippingSettings | null>;
61
+ updateShippingSettings(input: UpdateShippingSettingsInput): Promise<ShippingSettings>;
62
+ /**
63
+ * "Does this store deliver here?" — asked with the address, before the card.
64
+ *
65
+ * Degrades to "yes, and not our own zone" on any failure. A store that cannot
66
+ * reach the check must not stop selling: the order itself is still refused by
67
+ * the 0048 trigger if the region really is excluded, so the worst case is the
68
+ * shopper learning it one screen later instead of never selling at all.
69
+ */
70
+ listShippingProfiles(): Promise<ShippingProfile[]>;
71
+ createShippingProfile(input: CreateShippingProfileInput): Promise<ShippingProfile>;
72
+ updateShippingProfile(id: string, input: UpdateShippingProfileInput): Promise<ShippingProfile>;
73
+ deleteShippingProfile(id: string): Promise<void>;
74
+ listStockLocations(): Promise<StockLocation[]>;
75
+ createStockLocation(input: CreateStockLocationInput): Promise<StockLocation>;
76
+ updateStockLocation(id: string, input: UpdateStockLocationInput): Promise<StockLocation>;
77
+ deleteStockLocation(id: string): Promise<void>;
78
+ private clearDefaultStockLocation;
79
+ checkDelivery(postalCode: string): Promise<DeliveryCheck>;
80
+ getStoreSettings(): Promise<StoreSettings | null>;
81
+ updateStoreSettings(input: UpdateStoreSettingsInput): Promise<StoreSettings>;
82
+ /**
83
+ * The shopper's read. Through the RPC, not the table: the table is closed to
84
+ * anon on purpose (0029) and shop_store_settings() is the narrow window —
85
+ * storefront fields only, and only for a published store.
86
+ */
87
+ getPublicStoreSettings(): Promise<StoreSettings | null>;
88
+ /**
89
+ * Settle a pending order: the merchant confirming that the money arrived.
90
+ *
91
+ * Goes through the RPC rather than an UPDATE so the payment ledger row in
92
+ * public.transactions closes in the same transaction as the order — set
93
+ * financial_status by hand and the order says paid while the ledger still
94
+ * says pending. Since 0019 the RPC also enforces who may call it: a member of
95
+ * the owning tenant, or a PSP webhook with the service role.
96
+ */
97
+ confirmPayment(id: string, reference?: string): Promise<Order | null>;
98
+ private labelCall;
99
+ quoteShippingLabel(orderId: string, carrier?: string): Promise<{
100
+ options: any;
101
+ label: {
102
+ labelId: string;
103
+ labelUrl: any;
104
+ status: any;
105
+ tracking: any;
106
+ } | null;
107
+ }>;
108
+ /** Spends the merchant's balance at the carrier. Never call it on a whim. */
109
+ buyShippingLabel(orderId: string, serviceId: number, carrier?: string): Promise<{
110
+ labelId: string;
111
+ labelUrl: any;
112
+ status: string;
113
+ tracking: any;
114
+ }>;
115
+ printShippingLabel(orderId: string, carrier?: string): Promise<any>;
116
+ /** Drop-off points near a place. Store configuration — no order involved. */
117
+ listShippingAgencies(query: {
118
+ state?: string;
119
+ city?: string;
120
+ carrier?: string;
121
+ }): Promise<ShippingAgency[]>;
122
+ trackShippingLabel(orderId: string, carrier?: string): Promise<any>;
123
+ /**
124
+ * The customer's address book, for the console. `shop_place_order` files a
125
+ * new one here on every delivered order, and until now only the storefront
126
+ * read them back — so a repeat customer had their address retyped by hand.
127
+ */
128
+ listCustomerAddresses(customerId: string): Promise<CustomerAddress[]>;
129
+ /**
130
+ * What delivery costs to a postcode — the same answer the shopper gets.
131
+ *
132
+ * The console needs it to quote a price out loud while the customer is on the
133
+ * line. Carrier first (when the merchant did not turn gateway quotes off),
134
+ * zones as the fallback, exactly as the storefront resolves it. Advisory
135
+ * either way: shop_place_order requotes and ignores whatever a client sends.
136
+ */
137
+ quoteShipping(postalCode: string, subtotal: number): Promise<ShippingQuoteOption[]>;
138
+ /**
139
+ * Charge a cart that is not an order yet — the phone sale, from the counter's
140
+ * side. Same door the storefront uses, on purpose: `shop_price_cart` inside
141
+ * the function reprices everything, so the console sends products and
142
+ * quantities and never money. The order is born in `settleCheckoutSession`,
143
+ * once the acquirer says the Pix landed, so an abandoned charge leaves no
144
+ * ghost order holding stock.
145
+ */
146
+ openCheckoutSession(input: CheckoutSessionInput): Promise<CheckoutSession>;
147
+ /**
148
+ * Ask whether the money landed. Runs on a timer, so a network blip must read
149
+ * as "still waiting" (`unknown`) and never as a refused payment.
150
+ */
151
+ settleCheckoutSession(sessionId: string): Promise<CheckoutSettlement>;
152
+ placeOrder(input: PlaceOrderInput): Promise<Order>;
153
+ listCustomers(options?: ListCustomersOptions): Promise<ShopCustomer[]>;
154
+ getCustomer(id: string): Promise<ShopCustomer | null>;
155
+ createCustomer(input: CreateCustomerInput): Promise<ShopCustomer>;
156
+ updateCustomer(id: string, input: UpdateCustomerInput): Promise<ShopCustomer>;
157
+ deleteCustomer(id: string): Promise<void>;
158
+ resolveCustomer(input: ResolveCustomerInput): Promise<ShopCustomer>;
159
+ evaluatePromotions(input: {
160
+ cart: RuleCartSnapshot;
161
+ }): Promise<ComputeAction[]>;
162
+ listDiscounts(options?: ListDiscountsOptions): Promise<Discount[]>;
163
+ getDiscount(id: string): Promise<Discount | null>;
164
+ createDiscount(input: CreateDiscountInput): Promise<Discount>;
165
+ updateDiscount(id: string, input: UpdateDiscountInput): Promise<Discount>;
166
+ deleteDiscount(id: string): Promise<void>;
167
+ listSalesChannels(): Promise<SalesChannel[]>;
168
+ createSalesChannel(input: CreateSalesChannelInput): Promise<SalesChannel>;
169
+ updateSalesChannel(id: string, input: UpdateSalesChannelInput): Promise<SalesChannel>;
170
+ deleteSalesChannel(id: string): Promise<void>;
171
+ private entityStore;
172
+ listEntityRecords(entity: string, options?: ListEntityRecordsOptions): Promise<EntityRecord[]>;
173
+ getEntityRecord(entity: string, id: string): Promise<EntityRecord | null>;
174
+ getEntityRecordBySlug(entity: string, slug: string): Promise<EntityRecord | null>;
175
+ createEntityRecord(entity: string, input: EntityRecordInput): Promise<EntityRecord>;
176
+ updateEntityRecord(entity: string, id: string, input: Partial<EntityRecordInput>): Promise<EntityRecord>;
177
+ deleteEntityRecord(entity: string, id: string): Promise<void>;
178
+ listCollections(): Promise<Collection[]>;
179
+ getCollection(id: string): Promise<Collection | null>;
180
+ createCollection(input: CreateCollectionInput): Promise<Collection>;
181
+ updateCollection(id: string, input: UpdateCollectionInput): Promise<Collection>;
182
+ deleteCollection(id: string): Promise<void>;
183
+ listCustomerGroups(): Promise<CustomerGroup[]>;
184
+ createCustomerGroup(input: CreateCustomerGroupInput): Promise<CustomerGroup>;
185
+ updateCustomerGroup(id: string, input: UpdateCustomerGroupInput): Promise<CustomerGroup>;
186
+ deleteCustomerGroup(id: string): Promise<void>;
187
+ listCustomerSegments(): Promise<CustomerSegment[]>;
188
+ createCustomerSegment(input: CreateCustomerSegmentInput): Promise<CustomerSegment>;
189
+ updateCustomerSegment(id: string, input: UpdateCustomerSegmentInput): Promise<CustomerSegment>;
190
+ deleteCustomerSegment(id: string): Promise<void>;
191
+ listGiftCards(): Promise<GiftCard[]>;
192
+ createGiftCard(input: CreateGiftCardInput): Promise<GiftCard>;
193
+ updateGiftCard(id: string, input: UpdateGiftCardInput): Promise<GiftCard>;
194
+ deleteGiftCard(id: string): Promise<void>;
195
+ listEmailTemplates(): Promise<EmailTemplate[]>;
196
+ upsertEmailTemplate(input: UpsertEmailTemplateInput): Promise<EmailTemplate>;
197
+ listMediaFiles(): Promise<MediaFile[]>;
198
+ /** Every product photo in the store, each one carrying its product. */
199
+ private listAttachedMedia;
200
+ /** What the merchant uploaded straight to the library — owned by nothing. */
201
+ private listLibraryFiles;
202
+ uploadMediaFile(file: File): Promise<MediaFile>;
203
+ deleteMediaFile(id: string): Promise<void>;
204
+ private syncCollectionProducts;
205
+ private syncGroupMembers;
206
+ }
207
+ export declare function createSupabaseShopProvider(): ShopProvider;
208
+ //# sourceMappingURL=supabase-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supabase-provider.d.ts","sourceRoot":"","sources":["../../src/data/supabase-provider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AAEzG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAK1E,OAAO,EAAiB,WAAW,EAA2D,MAAM,SAAS,CAAA;AAG7G,OAAO,KAAK,EACV,aAAa,EAAE,wBAAwB,EAAE,wBAAwB,EAClE,MAAM,0BAA0B,CAAA;AAGjC,OAAO,KAAK,EACV,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,cAAc,EAAE,iBAAiB,EAC3F,yBAAyB,EAAE,yBAAyB,EAAE,QAAQ,EAC9D,KAAK,EAAE,YAAY,EAAE,QAAQ,EAC7B,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAC3D,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EACtE,mBAAmB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,oBAAoB,EACpF,mBAAmB,EAAE,mBAAmB,EAAE,oBAAoB,EAC9D,oBAAoB,EAAE,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AAI,CAAC;IAKzC,kBAAkB,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAe9C,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,aAAa,CAAC;IAmB5E,cAAc,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAgB5C,uEAAuE;YACzD,iBAAiB;IAqB/B,6EAA6E;YAC/D,gBAAgB;IA2CxB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC;IAsB/C,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAKpC,sBAAsB;YAkBpB,gBAAgB;CAiB/B;AAED,wBAAgB,0BAA0B,IAAI,YAAY,CAEzD"}
@@ -0,0 +1,38 @@
1
+ export declare const T: {
2
+ readonly products: "plg_shop_products";
3
+ readonly productImages: "plg_shop_product_images";
4
+ readonly productOptions: "plg_shop_product_options";
5
+ readonly productVariants: "plg_shop_product_variants";
6
+ readonly categories: "plg_shop_categories";
7
+ readonly orders: "plg_shop_orders";
8
+ readonly orderItems: "plg_shop_order_items";
9
+ readonly customers: "plg_shop_customers";
10
+ readonly discounts: "plg_shop_discounts";
11
+ readonly salesChannels: "plg_shop_channels";
12
+ readonly collections: "plg_shop_collections";
13
+ readonly collectionProducts: "plg_shop_collection_products";
14
+ readonly giftCards: "plg_shop_gift_cards";
15
+ readonly messageTemplates: "plg_automations_templates";
16
+ readonly customerGroups: "plg_shop_customer_groups";
17
+ readonly customerGroupMembers: "plg_shop_customer_group_members";
18
+ readonly customerSegments: "plg_shop_customer_segments";
19
+ /** Public bucket the media library and product photos both live in. */
20
+ readonly mediaBucket: "shop-images";
21
+ readonly stockMovementKinds: "plg_shop_stock_movement_kinds";
22
+ readonly stockReasonCodes: "plg_shop_stock_reason_codes";
23
+ readonly stockLocations: "plg_shop_stock_locations";
24
+ readonly stockLots: "plg_shop_stock_lots";
25
+ readonly stockMovements: "plg_shop_stock_movements";
26
+ readonly stockReservations: "plg_shop_stock_reservations";
27
+ readonly stockBalances: "plg_shop_stock_balances";
28
+ readonly stockAllocationStrategies: "plg_shop_stock_allocation_strategies";
29
+ readonly stockReservationTtls: "plg_shop_stock_reservation_ttls";
30
+ readonly stockLevels: "plg_shop_stock_levels";
31
+ readonly orderItemLots: "plg_shop_order_item_lots";
32
+ readonly settings: "plg_shop_settings";
33
+ readonly shippingZones: "shipping_zones";
34
+ readonly shippingSettings: "shipping_settings";
35
+ readonly shippingProfiles: "plg_shop_shipping_profiles";
36
+ readonly shippingPackages: "plg_shop_packages";
37
+ };
38
+ //# sourceMappingURL=tables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../src/data/tables.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;IAwBZ,uEAAuE;;;;;;;;;;;;;;;;;;CAuC/D,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenant.d.ts","sourceRoot":"","sources":["../../src/data/tenant.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,cAAc,GAAG,MAAM,MAAM,GAAG,SAAS,CAAA;AAIrD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAEpE;AAED,wBAAgB,eAAe,IAAI,MAAM,GAAG,SAAS,CAOpD"}