@nuwah/vertical-sdk 0.0.0-stage → 0.2.0-rc.1

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 (239) hide show
  1. package/LICENSE +17 -0
  2. package/README.md +229 -2
  3. package/bin/nuwah-contract-check-rules.d.mts +41 -0
  4. package/bin/nuwah-contract-check-rules.mjs +333 -0
  5. package/bin/nuwah-contract-check.mjs +64 -0
  6. package/dist/accounting.d.ts +1417 -0
  7. package/dist/accounting.js +274 -0
  8. package/dist/active-org.d.ts +13 -0
  9. package/dist/active-org.js +59 -0
  10. package/dist/actors.d.ts +448 -0
  11. package/dist/actors.js +143 -0
  12. package/dist/ai.d.ts +359 -0
  13. package/dist/ai.js +229 -0
  14. package/dist/analytics.d.ts +37 -0
  15. package/dist/analytics.js +8 -0
  16. package/dist/atlas.d.ts +291 -0
  17. package/dist/atlas.js +78 -0
  18. package/dist/audit.d.ts +193 -0
  19. package/dist/audit.js +26 -0
  20. package/dist/authentication.d.ts +119 -0
  21. package/dist/authentication.js +83 -0
  22. package/dist/awards.d.ts +38 -0
  23. package/dist/awards.js +10 -0
  24. package/dist/blueprint/document.d.ts +178 -0
  25. package/dist/blueprint/document.js +17 -0
  26. package/dist/blueprint/index.d.ts +3 -0
  27. package/dist/blueprint/index.js +5 -0
  28. package/dist/blueprint/manifest.d.ts +105 -0
  29. package/dist/blueprint/manifest.js +11 -0
  30. package/dist/blueprint/validate.d.ts +14 -0
  31. package/dist/blueprint/validate.js +416 -0
  32. package/dist/bookings-directory.d.ts +118 -0
  33. package/dist/bookings-directory.js +289 -0
  34. package/dist/bookings-extra.d.ts +1448 -0
  35. package/dist/bookings-extra.js +582 -0
  36. package/dist/bookings.d.ts +1365 -0
  37. package/dist/bookings.js +305 -0
  38. package/dist/builder-code.d.ts +164 -0
  39. package/dist/builder-code.js +12 -0
  40. package/dist/builder-core-gaps.d.ts +83 -0
  41. package/dist/builder-core-gaps.js +8 -0
  42. package/dist/builder-repos.d.ts +73 -0
  43. package/dist/builder-repos.js +37 -0
  44. package/dist/builder.d.ts +730 -0
  45. package/dist/builder.js +105 -0
  46. package/dist/campaigns.d.ts +105 -0
  47. package/dist/campaigns.js +25 -0
  48. package/dist/catalogs.d.ts +188 -0
  49. package/dist/catalogs.js +36 -0
  50. package/dist/commerce-ai.d.ts +182 -0
  51. package/dist/commerce-ai.js +27 -0
  52. package/dist/connections.d.ts +278 -0
  53. package/dist/connections.js +96 -0
  54. package/dist/content-control.d.ts +121 -0
  55. package/dist/content-control.js +23 -0
  56. package/dist/contributions.d.ts +560 -0
  57. package/dist/contributions.js +140 -0
  58. package/dist/conversation-assist.d.ts +154 -0
  59. package/dist/conversation-assist.js +51 -0
  60. package/dist/conversation-info.d.ts +219 -0
  61. package/dist/conversation-info.js +43 -0
  62. package/dist/crm.d.ts +533 -0
  63. package/dist/crm.js +142 -0
  64. package/dist/dashboards.d.ts +119 -0
  65. package/dist/dashboards.js +22 -0
  66. package/dist/delegations.d.ts +161 -0
  67. package/dist/delegations.js +39 -0
  68. package/dist/docs.d.ts +289 -0
  69. package/dist/docs.js +49 -0
  70. package/dist/documents.d.ts +317 -0
  71. package/dist/documents.js +84 -0
  72. package/dist/drafts.d.ts +132 -0
  73. package/dist/drafts.js +56 -0
  74. package/dist/engagements.d.ts +133 -0
  75. package/dist/engagements.js +15 -0
  76. package/dist/event-stream.d.ts +54 -0
  77. package/dist/event-stream.js +228 -0
  78. package/dist/exchanges.d.ts +447 -0
  79. package/dist/exchanges.js +145 -0
  80. package/dist/exports.d.ts +113 -0
  81. package/dist/exports.js +81 -0
  82. package/dist/feeds.d.ts +228 -0
  83. package/dist/feeds.js +52 -0
  84. package/dist/files.d.ts +56 -0
  85. package/dist/files.js +55 -0
  86. package/dist/finance-insights.d.ts +41 -0
  87. package/dist/finance-insights.js +61 -0
  88. package/dist/fixed-assets.d.ts +155 -0
  89. package/dist/fixed-assets.js +28 -0
  90. package/dist/fulfilment-jobs.d.ts +405 -0
  91. package/dist/fulfilment-jobs.js +76 -0
  92. package/dist/fulfilment.d.ts +205 -0
  93. package/dist/fulfilment.js +39 -0
  94. package/dist/hr.d.ts +350 -0
  95. package/dist/hr.js +94 -0
  96. package/dist/http.d.ts +124 -0
  97. package/dist/http.js +392 -0
  98. package/dist/inbox.d.ts +206 -0
  99. package/dist/inbox.js +36 -0
  100. package/dist/index.d.ts +384 -0
  101. package/dist/index.js +294 -0
  102. package/dist/insights.d.ts +176 -0
  103. package/dist/insights.js +52 -0
  104. package/dist/inventory.d.ts +797 -0
  105. package/dist/inventory.js +120 -0
  106. package/dist/list-query.d.ts +211 -0
  107. package/dist/list-query.js +158 -0
  108. package/dist/listings.d.ts +381 -0
  109. package/dist/listings.js +173 -0
  110. package/dist/location-sharing.d.ts +83 -0
  111. package/dist/location-sharing.js +20 -0
  112. package/dist/marketplace.d.ts +268 -0
  113. package/dist/marketplace.js +59 -0
  114. package/dist/matching.d.ts +103 -0
  115. package/dist/matching.js +22 -0
  116. package/dist/media.d.ts +221 -0
  117. package/dist/media.js +239 -0
  118. package/dist/metrics.d.ts +125 -0
  119. package/dist/metrics.js +45 -0
  120. package/dist/moderation.d.ts +240 -0
  121. package/dist/moderation.js +40 -0
  122. package/dist/money.d.ts +41 -0
  123. package/dist/money.js +79 -0
  124. package/dist/my-data.d.ts +266 -0
  125. package/dist/my-data.js +32 -0
  126. package/dist/names.d.ts +14 -0
  127. package/dist/names.js +17 -0
  128. package/dist/occasions.d.ts +256 -0
  129. package/dist/occasions.js +40 -0
  130. package/dist/onboarding.d.ts +88 -0
  131. package/dist/onboarding.js +38 -0
  132. package/dist/pagination.d.ts +204 -0
  133. package/dist/pagination.js +141 -0
  134. package/dist/party-baseline-attributes.d.ts +245 -0
  135. package/dist/party-baseline-attributes.js +36 -0
  136. package/dist/party.d.ts +401 -0
  137. package/dist/party.js +56 -0
  138. package/dist/patient.d.ts +161 -0
  139. package/dist/patient.js +45 -0
  140. package/dist/payroll.d.ts +378 -0
  141. package/dist/payroll.js +60 -0
  142. package/dist/person-addresses.d.ts +88 -0
  143. package/dist/person-addresses.js +18 -0
  144. package/dist/person-cart.d.ts +250 -0
  145. package/dist/person-cart.js +63 -0
  146. package/dist/person-chat-assist.d.ts +47 -0
  147. package/dist/person-chat-assist.js +13 -0
  148. package/dist/person-data-webhooks.d.ts +72 -0
  149. package/dist/person-data-webhooks.js +86 -0
  150. package/dist/person-data.d.ts +212 -0
  151. package/dist/person-data.js +162 -0
  152. package/dist/person-locations.d.ts +54 -0
  153. package/dist/person-locations.js +6 -0
  154. package/dist/person-messaging.d.ts +405 -0
  155. package/dist/person-messaging.js +112 -0
  156. package/dist/person-notifications.d.ts +319 -0
  157. package/dist/person-notifications.js +164 -0
  158. package/dist/personalisation.d.ts +21 -0
  159. package/dist/personalisation.js +8 -0
  160. package/dist/platform.d.ts +63 -0
  161. package/dist/platform.js +45 -0
  162. package/dist/portfolio.d.ts +163 -0
  163. package/dist/portfolio.js +28 -0
  164. package/dist/pos.d.ts +743 -0
  165. package/dist/pos.js +129 -0
  166. package/dist/procurement.d.ts +664 -0
  167. package/dist/procurement.js +157 -0
  168. package/dist/promotions.d.ts +169 -0
  169. package/dist/promotions.js +39 -0
  170. package/dist/publications.d.ts +583 -0
  171. package/dist/publications.js +164 -0
  172. package/dist/ranking.d.ts +43 -0
  173. package/dist/ranking.js +34 -0
  174. package/dist/ratings.d.ts +293 -0
  175. package/dist/ratings.js +109 -0
  176. package/dist/reactions.d.ts +123 -0
  177. package/dist/reactions.js +41 -0
  178. package/dist/recipient-orders.d.ts +294 -0
  179. package/dist/recipient-orders.js +73 -0
  180. package/dist/relationships.d.ts +18 -0
  181. package/dist/relationships.js +8 -0
  182. package/dist/reporting.d.ts +107 -0
  183. package/dist/reporting.js +56 -0
  184. package/dist/sales.d.ts +270 -0
  185. package/dist/sales.js +66 -0
  186. package/dist/shares.d.ts +105 -0
  187. package/dist/shares.js +27 -0
  188. package/dist/shop.d.ts +993 -0
  189. package/dist/shop.js +215 -0
  190. package/dist/shopping-assistant.d.ts +65 -0
  191. package/dist/shopping-assistant.js +14 -0
  192. package/dist/spaces.d.ts +422 -0
  193. package/dist/spaces.js +118 -0
  194. package/dist/stored-value.d.ts +754 -0
  195. package/dist/stored-value.js +177 -0
  196. package/dist/types.d.ts +83 -0
  197. package/dist/types.js +2 -0
  198. package/dist/vault.d.ts +290 -0
  199. package/dist/vault.js +55 -0
  200. package/dist/vertical-runtime.d.ts +17 -0
  201. package/dist/vertical-runtime.js +8 -0
  202. package/dist/vite/build-manifest-plugin.d.ts +42 -0
  203. package/dist/vite/build-manifest-plugin.js +42 -0
  204. package/dist/vite/first-paint-plugin.d.ts +26 -0
  205. package/dist/vite/first-paint-plugin.js +57 -0
  206. package/dist/wishlists.d.ts +591 -0
  207. package/dist/wishlists.js +188 -0
  208. package/dist/workbench.d.ts +114 -0
  209. package/dist/workbench.js +22 -0
  210. package/dist/workspace.d.ts +190 -0
  211. package/dist/workspace.js +41 -0
  212. package/package.json +52 -4
  213. package/templates/extension-image.Dockerfile +38 -0
  214. package/templates/nuwah-vertical.yml +102 -0
  215. package/templates/vertical-app/.env.example +34 -0
  216. package/templates/vertical-app/README.md +108 -0
  217. package/templates/vertical-app/github/workflows/ci.yml +51 -0
  218. package/templates/vertical-app/gitignore +5 -0
  219. package/templates/vertical-app/index.html +12 -0
  220. package/templates/vertical-app/package.json +28 -0
  221. package/templates/vertical-app/src/App.tsx +64 -0
  222. package/templates/vertical-app/src/blueprint/blueprint.ts +45 -0
  223. package/templates/vertical-app/src/blueprint/screens.ts +15 -0
  224. package/templates/vertical-app/src/env.d.ts +18 -0
  225. package/templates/vertical-app/src/index.css +139 -0
  226. package/templates/vertical-app/src/lib/i18n.ts +5 -0
  227. package/templates/vertical-app/src/lib/iam.ts +19 -0
  228. package/templates/vertical-app/src/lib/operations.ts +93 -0
  229. package/templates/vertical-app/src/lib/router.ts +24 -0
  230. package/templates/vertical-app/src/lib/sdk.ts +21 -0
  231. package/templates/vertical-app/src/lib/theme.ts +18 -0
  232. package/templates/vertical-app/src/lib/words.ts +39 -0
  233. package/templates/vertical-app/src/main.tsx +25 -0
  234. package/templates/vertical-app/src/pages/AppScreens.tsx +71 -0
  235. package/templates/vertical-app/src/pages/AuthCallback.tsx +44 -0
  236. package/templates/vertical-app/src/pages/Home.tsx +36 -0
  237. package/templates/vertical-app/tsconfig.json +24 -0
  238. package/templates/vertical-app/vite.config.ts +23 -0
  239. package/templates/vertical-ci.yml +192 -0
@@ -0,0 +1,591 @@
1
+ import { type Http } from './http.js';
2
+ import { type BilingualText, type PersonDomainCallOptions, type PersonDomainCursorPage, type PersonDomainEnvelope } from './actors.js';
3
+ /** What viewers of a shared list learn about each other's claims — the owner's policy. */
4
+ export type WishlistClaimVisibility = 'hide_claimed' | 'show_claimed_count' | 'show_claimers_to_claimers';
5
+ /** `active` until bought, released or expired; the last three are terminal. */
6
+ export type WishlistClaimStatus = 'active' | 'purchased' | 'released' | 'expired';
7
+ /** What paid for a claimed item, when the claimer says so. */
8
+ export type WishlistClaimOutcomeType = 'shop.order' | 'contributions.drive';
9
+ /** One of the CALLER's claims. Never rendered to anyone else. */
10
+ export interface WishlistClaim {
11
+ id: string;
12
+ wishlist_id: string;
13
+ wishlist_item_id: string;
14
+ quantity: number;
15
+ status: WishlistClaimStatus;
16
+ /** Set when the owner chose a claim lifetime; ISO-8601 with offset. */
17
+ expires_at: string | null;
18
+ outcome: {
19
+ type: WishlistClaimOutcomeType | (string & {});
20
+ id: string;
21
+ } | null;
22
+ purchased_at: string | null;
23
+ ended_at: string | null;
24
+ created_at: string | null;
25
+ replayed: boolean;
26
+ /**
27
+ * What was claimed — filled by `mine()` (batched by core); null on the single-claim writes,
28
+ * and when the item is no longer visible to you. Absent only from an older core.
29
+ */
30
+ item?: {
31
+ description: string;
32
+ quantity: number;
33
+ } | null;
34
+ }
35
+ /** The caller's own claim on one item, as the summary carries it. */
36
+ export interface WishlistOwnClaim {
37
+ id: string;
38
+ status: WishlistClaimStatus;
39
+ quantity: number;
40
+ }
41
+ /**
42
+ * One item of a shared list, as a VIEWER may know it. `claimed_quantity` and
43
+ * `available_quantity` are null under `hide_claimed`; `other_claimer_person_ids` is filled only
44
+ * under `show_claimers_to_claimers`, and only when the viewer holds a claim on the same item.
45
+ */
46
+ export interface WishlistClaimSummaryItem {
47
+ item_id: string;
48
+ quantity: number;
49
+ claimed_quantity: number | null;
50
+ available_quantity: number | null;
51
+ other_claimer_person_ids: string[];
52
+ my_claim: WishlistOwnClaim | null;
53
+ }
54
+ export interface WishlistClaimSummary {
55
+ visibility: WishlistClaimVisibility;
56
+ items: WishlistClaimSummaryItem[];
57
+ }
58
+ /** One item of a list shared with the caller. */
59
+ export interface SharedWishlistItem {
60
+ id: string;
61
+ description: string;
62
+ taxonomy_category_id: string | null;
63
+ quantity: number;
64
+ status: string;
65
+ created_at: string | null;
66
+ }
67
+ /** A list shared with the caller (never the caller's own — that is `/me`). */
68
+ export interface SharedWishlist {
69
+ id: string;
70
+ title: string | null;
71
+ visibility: string;
72
+ items: SharedWishlistItem[];
73
+ }
74
+ /** Stable refusal reasons of the claim routes (`body.reason`). */
75
+ export declare const WISHLIST_CLAIM_REFUSAL: {
76
+ /** Not shared with you, private, withdrawn — or YOUR OWN. One answer for all. */
77
+ readonly itemNotFound: "wishlist_item_not_found";
78
+ readonly claimNotFound: "wishlist_claim_not_found";
79
+ /** The item's quantity is fully claimed (also under `hide_claimed`). */
80
+ readonly unavailable: "wishlist_claim_unavailable";
81
+ readonly alreadyHeld: "wishlist_claim_already_held";
82
+ readonly notActive: "wishlist_claim_not_active";
83
+ readonly idempotencyKeyInvalid: "idempotency_key_invalid";
84
+ readonly idempotencyKeyReused: "idempotency_key_reused";
85
+ };
86
+ /** The most a single claim may take (the request rule is `integer|min:1|max:1000`). */
87
+ export declare const WISHLIST_CLAIM_MAXIMUM_QUANTITY = 1000;
88
+ /** `body.reason` of a refusal, else the global middleware's `body.code`, else null. See {@link refusalReason}. */
89
+ export declare function wishlistClaimRefusalReason(error: unknown): string | null;
90
+ /** An amount as core sends it: `{amount: "12.5000", currency_code: "JOD"}`. */
91
+ export interface WishlistMoney {
92
+ amount: string;
93
+ currency_code: string;
94
+ }
95
+ /** How far a list or an item reaches — the person-plane visibility lattice. */
96
+ export type WishlistVisibility = 'private' | 'circle' | 'link' | 'public';
97
+ /** When people the list is shared with are reminded of its target date. */
98
+ export type WishlistReminderSchedule = 'none' | 'one_day' | 'one_week' | 'one_week_and_one_day';
99
+ export type WishlistItemStatus = 'open' | 'fulfilled' | 'withdrawn';
100
+ /** Who the caller is to a list: its owner, or an accepted co-owner. */
101
+ export type WishlistRole = 'owner' | 'collaborator';
102
+ /** One priority level a list kind declares (`rank` orders them; higher is more wanted). */
103
+ export interface WishlistPriorityLevel {
104
+ key: string;
105
+ label: BilingualText;
106
+ rank: number;
107
+ }
108
+ /** A list kind a vertical (or core: `wishlists.general`) declares. */
109
+ export interface WishlistKind {
110
+ key: string;
111
+ label: BilingualText;
112
+ vertical_key: string | null;
113
+ allows_target_date: boolean;
114
+ default_visibility: WishlistVisibility;
115
+ priority_levels: WishlistPriorityLevel[];
116
+ default_priority: string;
117
+ list_attribute_subject: string;
118
+ item_attribute_subject: string;
119
+ }
120
+ export interface WishlistImageReference {
121
+ id: string;
122
+ /** A path on the platform's origin; fetch it with the bearer token. */
123
+ path: string;
124
+ /** A person-media picture's file id (a list cover set with `setCover`); null for a legacy upload. */
125
+ media_id?: string | null;
126
+ }
127
+ export interface WishlistList {
128
+ id: string;
129
+ kind_key: string;
130
+ title: string;
131
+ description: string | null;
132
+ cover_image: WishlistImageReference | null;
133
+ visibility: WishlistVisibility;
134
+ new_item_visibility: WishlistVisibility;
135
+ target_date: string | null;
136
+ target_timezone: string | null;
137
+ /** The list's own choice; null follows the policy (`effective_reminder_schedule`). */
138
+ reminder_schedule: WishlistReminderSchedule | null;
139
+ effective_reminder_schedule: WishlistReminderSchedule;
140
+ claim_visibility: WishlistClaimVisibility | null;
141
+ effective_claim_visibility: WishlistClaimVisibility;
142
+ /** Opaque fractional order key — compare as strings, never parse. */
143
+ position: string;
144
+ archived_at: string | null;
145
+ attributes: Record<string, unknown>;
146
+ role: WishlistRole;
147
+ /** The caller's own collaboration row id (to leave the list); null for the owner. */
148
+ my_collaborator_id: string | null;
149
+ /**
150
+ * The list's OWN currency (ISO 4217), settable on create/update; null when never chosen.
151
+ * Absent only from an older core.
152
+ */
153
+ currency_code?: string | null;
154
+ /**
155
+ * The resolved default for new prices on this list: the list's own → the person's most recent
156
+ * explicit list currency → the currency their priced items use most → null. When null the
157
+ * screen ASKS (a currency select) — it never assumes one. Absent only from an older core.
158
+ */
159
+ default_currency_code?: string | null;
160
+ item_count: number;
161
+ open_item_count: number;
162
+ share_path: string;
163
+ created_at: string | null;
164
+ updated_at: string | null;
165
+ }
166
+ /** A catalogue reference resolved by a provider (`ProvidesListableItems`) on the server. */
167
+ export interface WishlistItemSource {
168
+ type: string;
169
+ owner_id: string | null;
170
+ id: string;
171
+ variant: string | null;
172
+ }
173
+ export interface WishlistLinkPreview {
174
+ status: 'none' | 'pending' | 'ready' | 'failed';
175
+ title: string | null;
176
+ description: string | null;
177
+ image_url: string | null;
178
+ site_name: string | null;
179
+ fetched_at: string | null;
180
+ }
181
+ /** What the catalogue says about a linked item NOW. Null on the item when it cannot be resolved. */
182
+ export interface WishlistCatalogueView {
183
+ title: BilingualText;
184
+ image_url: string | null;
185
+ price: WishlistMoney | null;
186
+ compare_at_price: WishlistMoney | null;
187
+ available: boolean;
188
+ path: string | null;
189
+ owner_label: string | null;
190
+ resolved_at: string | null;
191
+ }
192
+ export interface WishlistItemImage {
193
+ id: string;
194
+ path: string;
195
+ position: number;
196
+ }
197
+ export interface WishlistItemFull {
198
+ id: string;
199
+ wishlist_id: string;
200
+ description: string;
201
+ taxonomy_category_id: string | null;
202
+ quantity: number;
203
+ quantity_received: number;
204
+ notes: string | null;
205
+ status: WishlistItemStatus;
206
+ visibility: WishlistVisibility;
207
+ priority: string;
208
+ most_wanted: boolean;
209
+ position: string;
210
+ source: WishlistItemSource | null;
211
+ external_url: string | null;
212
+ preview: WishlistLinkPreview | null;
213
+ price: WishlistMoney | null;
214
+ desired_price: WishlistMoney | null;
215
+ catalogue: WishlistCatalogueView | null;
216
+ images: WishlistItemImage[];
217
+ /** Owner view only, and only when the owner's disclosure policy allows. */
218
+ contribution?: {
219
+ funded: boolean;
220
+ } | null;
221
+ /** Owner view only, after the target date, when the surprise policy reveals. */
222
+ received_by_claims?: number | null;
223
+ attributes: Record<string, unknown>;
224
+ created_at: string | null;
225
+ updated_at: string | null;
226
+ }
227
+ export interface WishlistListInput {
228
+ kind_key?: string;
229
+ title?: string;
230
+ description?: string | null;
231
+ visibility?: WishlistVisibility;
232
+ new_item_visibility?: WishlistVisibility;
233
+ target_date?: string | null;
234
+ target_timezone?: string | null;
235
+ reminder_schedule?: WishlistReminderSchedule | null;
236
+ claim_visibility?: WishlistClaimVisibility | null;
237
+ /** Three capital letters, or null to clear the list's own choice (the default then resolves again). */
238
+ currency_code?: string | null;
239
+ attributes?: Record<string, unknown>;
240
+ }
241
+ /**
242
+ * An item write. Send ONLY the keys the person touched: an absent key leaves the column alone,
243
+ * a key present and null clears it.
244
+ */
245
+ export interface WishlistItemInput {
246
+ description?: string;
247
+ source?: WishlistItemSource | null;
248
+ external_url?: string | null;
249
+ taxonomy_category_id?: string | null;
250
+ quantity?: number;
251
+ quantity_received?: number;
252
+ notes?: string | null;
253
+ priority?: string;
254
+ most_wanted?: boolean;
255
+ price?: WishlistMoney | null;
256
+ desired_price?: WishlistMoney | null;
257
+ visibility?: WishlistVisibility;
258
+ status?: WishlistItemStatus;
259
+ attributes?: Record<string, unknown>;
260
+ }
261
+ export type WishlistListSort = 'position' | '-updated_at' | 'title' | 'target_date';
262
+ export type WishlistItemSort = 'position' | '-priority' | 'price' | '-price' | '-created_at' | 'title';
263
+ export interface WishlistListQuery {
264
+ archived?: boolean;
265
+ sort?: WishlistListSort;
266
+ search?: string;
267
+ cursor?: string | null;
268
+ limit?: number;
269
+ }
270
+ export interface WishlistItemQuery {
271
+ status?: WishlistItemStatus | 'all';
272
+ priority?: string;
273
+ most_wanted?: boolean;
274
+ search?: string;
275
+ sort?: WishlistItemSort;
276
+ cursor?: string | null;
277
+ limit?: number;
278
+ }
279
+ /** Where to put a moved list or item: between two neighbours (either may be null at an end). */
280
+ export interface WishlistMoveTarget {
281
+ after_id?: string | null;
282
+ before_id?: string | null;
283
+ }
284
+ export interface WishlistCollaborator {
285
+ id: string;
286
+ person_id: string;
287
+ role: 'editor';
288
+ status: 'invited' | 'active';
289
+ invited_at: string | null;
290
+ accepted_at: string | null;
291
+ }
292
+ export interface WishlistCollaborationInvitation {
293
+ id: string;
294
+ wishlist_id: string;
295
+ list_title: string;
296
+ invited_at: string | null;
297
+ }
298
+ export interface WishlistSharedListSummary {
299
+ id: string;
300
+ title: string;
301
+ kind_key: string;
302
+ target_date: string | null;
303
+ target_timezone: string | null;
304
+ cover_image: WishlistImageReference | null;
305
+ item_count: number;
306
+ owner_person_id: string;
307
+ }
308
+ export interface WishlistLinkPreviewResult {
309
+ url: string;
310
+ title: string | null;
311
+ description: string | null;
312
+ image_url: string | null;
313
+ site_name: string | null;
314
+ }
315
+ export interface WishlistDriveProgress {
316
+ drive_id: string;
317
+ status: string;
318
+ target: WishlistMoney | null;
319
+ pledged_total: string;
320
+ paid_total: string;
321
+ currency_code: string | null;
322
+ member_count: number;
323
+ }
324
+ export interface WishlistChipIn {
325
+ drive_id: string;
326
+ item_id: string;
327
+ progress: WishlistDriveProgress;
328
+ }
329
+ export interface WishlistItemContributionProgress {
330
+ item_id: string;
331
+ drives: WishlistDriveProgress[];
332
+ }
333
+ /** A list shared with the caller, with the upgraded item fields (additive to {@link SharedWishlist}). */
334
+ export interface SharedWishlistFull extends Omit<SharedWishlist, 'items'> {
335
+ kind_key?: string;
336
+ description?: string | null;
337
+ target_date?: string | null;
338
+ target_timezone?: string | null;
339
+ cover_image?: WishlistImageReference | null;
340
+ items: Array<SharedWishlistItem & Partial<Pick<WishlistItemFull, 'priority' | 'most_wanted' | 'position' | 'source' | 'external_url' | 'preview' | 'price' | 'catalogue' | 'images' | 'quantity_received'>>>;
341
+ }
342
+ /** Stable refusal reasons of the upgraded routes (`body.reason`). */
343
+ export declare const WISHLIST_REFUSAL: {
344
+ readonly listNotOwned: "list_not_owned";
345
+ readonly itemNotFound: "item_not_found";
346
+ readonly descriptionRequired: "description_required";
347
+ readonly unknownKind: "wishlist_kind_unknown";
348
+ readonly unknownPriority: "wishlist_priority_unknown";
349
+ readonly urlRefused: "wishlist_url_refused";
350
+ readonly linkPreviewUnavailable: "link_preview_unavailable";
351
+ readonly handleNotFound: "handle_not_found";
352
+ };
353
+ /** `{amount, currency_code}` from a typed decimal string; refuses anything that is not a plain decimal. */
354
+ export declare function wishlistMoney(amount: string, currencyCode: string): WishlistMoney;
355
+ export declare function createWishlistsNamespace(http: Http): {
356
+ /** GET /shared/{wishlistId} — a list shared with the caller; 404 for anything else. */
357
+ shared: (wishlistId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<SharedWishlist>>;
358
+ claims: {
359
+ /**
360
+ * GET /claims?cursor=&limit= — the caller's active and purchased claims, newest
361
+ * first, as a keyset page `{data, next_cursor}` (limit ≤ 100, default 25). Follow
362
+ * `next_cursor` until null. Each claim names its item.
363
+ */
364
+ mine: (query?: {
365
+ cursor?: string | null;
366
+ limit?: number;
367
+ }, options?: PersonDomainCallOptions) => Promise<PersonDomainCursorPage<WishlistClaim>>;
368
+ /**
369
+ * POST /items/{itemId}/claims `{quantity}` — claim `quantity` of an item on a list
370
+ * shared with you. Refused `wishlist_claim_unavailable` when not enough is left —
371
+ * even when the owner hides counts. Pass the SAME key when retrying this press.
372
+ */
373
+ claim: (itemId: string, quantity?: number, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistClaim>>;
374
+ /** POST /claims/{claimId}/release — let the item go back to the others. */
375
+ release: (claimId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistClaim>>;
376
+ /**
377
+ * POST /claims/{claimId}/purchased `{outcome_type?, outcome_id?}` — you bought it;
378
+ * optionally say what paid for it (an order, a contribution drive). Both or neither.
379
+ */
380
+ markPurchased: (claimId: string, outcome?: {
381
+ type: WishlistClaimOutcomeType;
382
+ id: string;
383
+ } | null, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistClaim>>;
384
+ /**
385
+ * GET /shared/{wishlistId}/claims-summary — per item, what THIS viewer may know about
386
+ * claims, shaped by the owner's `wishlists.claim_visibility`. 404 to the list's owner.
387
+ */
388
+ summary: (wishlistId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistClaimSummary>>;
389
+ };
390
+ /** GET /kinds — the list kinds declared by core and the verticals, with their priority levels. */
391
+ kinds: (options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistKind[]>>;
392
+ /** The caller's own lists and the ones they co-own. */
393
+ lists: {
394
+ page: (query?: WishlistListQuery, options?: PersonDomainCallOptions) => Promise<PersonDomainCursorPage<WishlistList>>;
395
+ one: (listId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistList>>;
396
+ /** POST /lists — pass the SAME idempotency key when retrying this create. */
397
+ create: (input: WishlistListInput & {
398
+ title: string;
399
+ }, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistList>>;
400
+ /** PATCH /lists/{id} — only the touched keys; null clears a nullable one. */
401
+ update: (listId: string, patch: WishlistListInput, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistList>>;
402
+ remove: (listId: string, options?: PersonDomainCallOptions) => Promise<void>;
403
+ archive: (listId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistList>>;
404
+ restore: (listId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistList>>;
405
+ /** Items are copied; claims never are; the copy starts private. */
406
+ duplicate: (listId: string, title?: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistList>>;
407
+ move: (listId: string, target: WishlistMoveTarget, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistList>>;
408
+ uploadCover: (listId: string, file: Blob, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistList>>;
409
+ /**
410
+ * Name an uploaded person-media file as the cover: upload on select with
411
+ * `media.upload(file, { purpose: 'wishlists.list_cover' })`, then this is instant.
412
+ * Preferred over `uploadCover`, which sends the bytes on save.
413
+ */
414
+ setCover: (listId: string, mediaId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistList>>;
415
+ removeCover: (listId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistList>>;
416
+ collaborators: (listId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistCollaborator[]>>;
417
+ /** Invite by HANDLE (never a person id); any unresolvable handle answers `handle_not_found`. */
418
+ inviteCollaborator: (listId: string, handle: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistCollaborator>>;
419
+ /** The owner removes a co-owner, or a co-owner leaves. */
420
+ removeCollaborator: (listId: string, collaboratorId: string, options?: PersonDomainCallOptions) => Promise<void>;
421
+ /**
422
+ * A co-owner leaves a list — the same DELETE with the caller's OWN collaboration row
423
+ * (`list.my_collaborator_id`). Refused here, before any request, without one: the
424
+ * owner has none (null) and cannot leave their own list.
425
+ */
426
+ leaveList: (listId: string, myCollaboratorId: string | null | undefined, options?: PersonDomainCallOptions) => Promise<void>;
427
+ };
428
+ items: {
429
+ page: (listId: string, query?: WishlistItemQuery, options?: PersonDomainCallOptions) => Promise<PersonDomainCursorPage<WishlistItemFull>>;
430
+ /** `description` may be omitted when `source` or `external_url` names the thing. */
431
+ create: (listId: string, input: WishlistItemInput, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistItemFull>>;
432
+ update: (itemId: string, patch: WishlistItemInput, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistItemFull>>;
433
+ remove: (itemId: string, options?: PersonDomainCallOptions) => Promise<void>;
434
+ /** Between two neighbours, optionally onto another list (`wishlist_id`). */
435
+ move: (itemId: string, target: WishlistMoveTarget & {
436
+ wishlist_id?: string;
437
+ }, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistItemFull>>;
438
+ uploadImage: (itemId: string, file: Blob, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistItemImage>>;
439
+ removeImage: (imageId: string, options?: PersonDomainCallOptions) => Promise<void>;
440
+ /** Queue a fresh Open Graph read of the item's link (202). */
441
+ refreshPreview: (itemId: string, options?: PersonDomainCallOptions) => Promise<void>;
442
+ /**
443
+ * POST /items/{itemId}/chip-in — start (or rejoin) a contribution drive for an item on a
444
+ * list shared with you. The owner never sees it unless their disclosure policy allows.
445
+ */
446
+ chipIn: (itemId: string, input?: {
447
+ target_amount?: string | null;
448
+ currency_code?: string | null;
449
+ closes_at?: string | null;
450
+ }, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistChipIn>>;
451
+ };
452
+ /** POST /link-preview — what a pasted URL describes, read server-side (SSRF-safe). */
453
+ linkPreview: (url: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistLinkPreviewResult>>;
454
+ assist: {
455
+ /** POST /assist/describe-item — an item's name, details, category and price range from one photo, a link or a few words. */
456
+ describeItem: (input: {
457
+ media_id?: string | null;
458
+ link?: string | null;
459
+ text?: string | null;
460
+ currency?: string | null;
461
+ locale?: "en" | "ar";
462
+ }, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistAssistAnswer<WishlistItemSuggestion>>>;
463
+ /** POST /assist/tidy — duplicates to merge, missing categories and priorities for one of your lists. */
464
+ tidy: (input: {
465
+ list_id: string;
466
+ locale?: "en" | "ar";
467
+ }, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistAssistAnswer<WishlistTidySuggestions>>>;
468
+ /** POST /assist/ideas — gift ideas inside a budget, optionally informed by a list. */
469
+ ideas: (input: {
470
+ budget: number;
471
+ currency: string;
472
+ about?: string | null;
473
+ list_id?: string | null;
474
+ locale?: "en" | "ar";
475
+ }, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistAssistAnswer<WishlistIdeaSuggestions>>>;
476
+ };
477
+ /** Invitations to co-own somebody else's list. */
478
+ collaborations: {
479
+ pending: (options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistCollaborationInvitation[]>>;
480
+ accept: (invitationId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistCollaborator>>;
481
+ decline: (invitationId: string, options?: PersonDomainCallOptions) => Promise<void>;
482
+ };
483
+ /** Lists other people shared with the caller. */
484
+ sharedLists: {
485
+ page: (query?: {
486
+ cursor?: string | null;
487
+ limit?: number;
488
+ }, options?: PersonDomainCallOptions) => Promise<PersonDomainCursorPage<WishlistSharedListSummary>>;
489
+ /** The upgraded shape of {@link createWishlistsNamespace.shared}, with the item sort/filter params. */
490
+ one: (wishlistId: string, query?: Omit<WishlistItemQuery, "cursor" | "limit">, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<SharedWishlistFull>>;
491
+ /** Per item, the drives THIS viewer is part of. */
492
+ contributionProgress: (wishlistId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistItemContributionProgress[]>>;
493
+ };
494
+ /**
495
+ * Following lists shared with the caller. Only a list visible to the caller (and not
496
+ * their own) can be followed; anything else answers 404 `wishlist_not_found`. The list's
497
+ * owner never learns who follows. Following is quiet unless the caller (or the declared
498
+ * policy `wishlists.follow_notifications`, default `notify_off`) asks to hear of new items.
499
+ */
500
+ follows: {
501
+ /** GET /following — the lists the caller follows and can still see, as the shared-list page. */
502
+ page: (query?: {
503
+ cursor?: string | null;
504
+ limit?: number;
505
+ search?: string;
506
+ }, options?: PersonDomainCallOptions) => Promise<PersonDomainCursorPage<WishlistSharedListSummary>>;
507
+ /** GET /shared/{id}/follow — whether the caller follows this list, and how it notifies them. */
508
+ state: (wishlistId: string, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistFollowState>>;
509
+ /**
510
+ * PUT /shared/{id}/follow — follow (201 the first time, 200 after), or change the
511
+ * per-list choice. Omit `notification` to keep it; `null` hands it back to the policy.
512
+ */
513
+ follow: (wishlistId: string, body?: {
514
+ notification?: WishlistFollowNotification | null;
515
+ }, options?: PersonDomainCallOptions) => Promise<PersonDomainEnvelope<WishlistFollowState>>;
516
+ /** DELETE /shared/{id}/follow — always succeeds (204), even for a list you no longer see. */
517
+ unfollow: (wishlistId: string, options?: PersonDomainCallOptions) => Promise<void>;
518
+ };
519
+ };
520
+ /** Whether a followed list tells its follower about new items. */
521
+ export type WishlistFollowNotification = 'notify_off' | 'notify_on_new_items';
522
+ /** The caller's follow of one shared list. */
523
+ export interface WishlistFollowState {
524
+ wishlist_id: string;
525
+ following: boolean;
526
+ /** The caller's own choice for this list; null = the declared policy decides. */
527
+ notification: WishlistFollowNotification | null;
528
+ /** What actually happens: the choice, else the policy. */
529
+ effective_notification: WishlistFollowNotification;
530
+ followed_at: string | null;
531
+ }
532
+ export type WishlistsNamespace = ReturnType<typeof createWishlistsNamespace>;
533
+ /** What every wishlist Assist call answers. Suggestions only — the person reviews each one. */
534
+ export interface WishlistAssistAnswer<TSuggestions> {
535
+ state: 'ready' | 'unavailable';
536
+ suggestions: TSuggestions | null;
537
+ reason: string | null;
538
+ message: {
539
+ en: string;
540
+ ar: string;
541
+ } | null;
542
+ retry_after_ms: number | null;
543
+ run_id: string | null;
544
+ ai_generated: boolean;
545
+ }
546
+ export interface WishlistAssistPriceRange {
547
+ low: number;
548
+ high: number;
549
+ currency: string | null;
550
+ }
551
+ export interface WishlistAssistCategory {
552
+ category_key: string | null;
553
+ category_label: {
554
+ en: string;
555
+ ar: string;
556
+ } | null;
557
+ category_id: string | null;
558
+ }
559
+ export interface WishlistItemSuggestion extends WishlistAssistCategory {
560
+ name: string;
561
+ details: string | null;
562
+ price_range: WishlistAssistPriceRange | null;
563
+ link: string | null;
564
+ confidence: number;
565
+ }
566
+ export interface WishlistTidySuggestions {
567
+ merges: Array<{
568
+ keep: string;
569
+ merge: string[];
570
+ reason: string | null;
571
+ }>;
572
+ categories: Array<WishlistAssistCategory & {
573
+ item_id: string;
574
+ }>;
575
+ priorities: Array<{
576
+ item_id: string;
577
+ priority: string;
578
+ reason: string | null;
579
+ }>;
580
+ }
581
+ export interface WishlistIdeaSuggestions {
582
+ ideas: Array<WishlistAssistCategory & {
583
+ name: string;
584
+ why: string | null;
585
+ price_range: WishlistAssistPriceRange;
586
+ }>;
587
+ budget: {
588
+ amount: number;
589
+ currency: string;
590
+ };
591
+ }