@fayz-ai/admin 0.14.0 → 0.15.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 (292) hide show
  1. package/dist/{ScheduleEditor-S3QI5MHO.js → ScheduleEditor-57AYL7B6.js} +4 -4
  2. package/dist/{ScheduleEditor-S3QI5MHO.js.map → ScheduleEditor-57AYL7B6.js.map} +1 -1
  3. package/dist/SubscriptionPage-FE2B5ZXF.js +7 -0
  4. package/dist/{SubscriptionPage-4KP7DKA2.js.map → SubscriptionPage-FE2B5ZXF.js.map} +1 -1
  5. package/dist/app/AdminShell.d.ts +11 -1
  6. package/dist/app/AdminShell.d.ts.map +1 -1
  7. package/dist/app/admin-app.d.ts.map +1 -1
  8. package/dist/app/config.d.ts +34 -3
  9. package/dist/app/config.d.ts.map +1 -1
  10. package/dist/app/core-entities.d.ts.map +1 -1
  11. package/dist/app/derive-contract.d.ts.map +1 -1
  12. package/dist/app/scaffold.d.ts.map +1 -1
  13. package/dist/{chunk-OI7RYSTM.js → chunk-45EZQW4M.js} +22 -7
  14. package/dist/chunk-45EZQW4M.js.map +1 -0
  15. package/dist/{chunk-B6NVEKAJ.js → chunk-IPWXA46H.js} +3 -3
  16. package/dist/{chunk-B6NVEKAJ.js.map → chunk-IPWXA46H.js.map} +1 -1
  17. package/dist/{chunk-PNAJODZM.js → chunk-OB7ZSTQD.js} +13 -3
  18. package/dist/chunk-OB7ZSTQD.js.map +1 -0
  19. package/dist/components/AskAI.d.ts +71 -0
  20. package/dist/components/AskAI.d.ts.map +1 -0
  21. package/dist/components/RightRail.d.ts +10 -2
  22. package/dist/components/RightRail.d.ts.map +1 -1
  23. package/dist/components/RightRailPage.d.ts +30 -0
  24. package/dist/components/RightRailPage.d.ts.map +1 -0
  25. package/dist/components/chat/AgentAvatar.d.ts +43 -0
  26. package/dist/components/chat/AgentAvatar.d.ts.map +1 -0
  27. package/dist/components/chat/AgentIntro.d.ts +25 -0
  28. package/dist/components/chat/AgentIntro.d.ts.map +1 -0
  29. package/dist/components/chat/AssistantActivityBar.d.ts +7 -2
  30. package/dist/components/chat/AssistantActivityBar.d.ts.map +1 -1
  31. package/dist/components/chat/AssistantRecordingView.d.ts +16 -0
  32. package/dist/components/chat/AssistantRecordingView.d.ts.map +1 -0
  33. package/dist/components/chat/ChatAttachments.d.ts +12 -1
  34. package/dist/components/chat/ChatAttachments.d.ts.map +1 -1
  35. package/dist/components/chat/ChatComposer.d.ts +1 -4
  36. package/dist/components/chat/ChatComposer.d.ts.map +1 -1
  37. package/dist/components/chat/ChatConversation.d.ts +1 -1
  38. package/dist/components/chat/ChatConversation.d.ts.map +1 -1
  39. package/dist/components/chat/ChatFab.d.ts.map +1 -1
  40. package/dist/components/chat/ChatHistory.d.ts.map +1 -1
  41. package/dist/components/chat/ChatMessages.d.ts +1 -1
  42. package/dist/components/chat/ChatMessages.d.ts.map +1 -1
  43. package/dist/components/chat/ChatSuggestions.d.ts.map +1 -1
  44. package/dist/components/chat/ConnectorSuggestionCard.d.ts +3 -0
  45. package/dist/components/chat/ConnectorSuggestionCard.d.ts.map +1 -1
  46. package/dist/components/chat/StaffHireView.d.ts +21 -0
  47. package/dist/components/chat/StaffHireView.d.ts.map +1 -0
  48. package/dist/components/chat/StaffPitchCard.d.ts +15 -0
  49. package/dist/components/chat/StaffPitchCard.d.ts.map +1 -0
  50. package/dist/components/chat/StaffSwitcher.d.ts +23 -0
  51. package/dist/components/chat/StaffSwitcher.d.ts.map +1 -0
  52. package/dist/components/chat/activity-icons.d.ts +16 -0
  53. package/dist/components/chat/activity-icons.d.ts.map +1 -0
  54. package/dist/components/chat/index.d.ts +2 -0
  55. package/dist/components/chat/index.d.ts.map +1 -1
  56. package/dist/components/connect/ConnectConsentPage.d.ts.map +1 -1
  57. package/dist/components/connect/ConnectorDetail.d.ts.map +1 -1
  58. package/dist/components/connect/ConnectorRuns.d.ts.map +1 -1
  59. package/dist/components/connect/ConnectorsPanel.d.ts.map +1 -1
  60. package/dist/components/connect/ConnectorsTab.d.ts.map +1 -1
  61. package/dist/components/connect/connector-map.generated.d.ts.map +1 -1
  62. package/dist/components/connect/index.d.ts +3 -0
  63. package/dist/components/connect/index.d.ts.map +1 -1
  64. package/dist/components/connect/model.d.ts +55 -0
  65. package/dist/components/connect/model.d.ts.map +1 -1
  66. package/dist/components/organization/PermissionMatrixEditor.d.ts.map +1 -1
  67. package/dist/components/organization/PermissionProfilesTab.d.ts.map +1 -1
  68. package/dist/components/organization/TeamTab.d.ts.map +1 -1
  69. package/dist/components/organization/index.d.ts +0 -2
  70. package/dist/components/organization/index.d.ts.map +1 -1
  71. package/dist/components/plugins/PluginSettingsPanel.d.ts +1 -2
  72. package/dist/components/plugins/PluginSettingsPanel.d.ts.map +1 -1
  73. package/dist/components/plugins/SettingsTabs.d.ts +33 -0
  74. package/dist/components/plugins/SettingsTabs.d.ts.map +1 -0
  75. package/dist/components/rail-pages.d.ts +17 -0
  76. package/dist/components/rail-pages.d.ts.map +1 -0
  77. package/dist/components/right-rail.d.ts +95 -1
  78. package/dist/components/right-rail.d.ts.map +1 -1
  79. package/dist/components/settings/ConnectedCompanySettings.d.ts.map +1 -1
  80. package/dist/components/settings/ConnectedUserProfile.d.ts.map +1 -1
  81. package/dist/components/settings/LocationsCrudPage.d.ts.map +1 -1
  82. package/dist/components/settings/MyRecordPanel.d.ts +3 -0
  83. package/dist/components/settings/MyRecordPanel.d.ts.map +1 -0
  84. package/dist/components/settings/MyWorkspaceCard.d.ts +3 -0
  85. package/dist/components/settings/MyWorkspaceCard.d.ts.map +1 -0
  86. package/dist/components/shared/ContactPicker.d.ts +26 -12
  87. package/dist/components/shared/ContactPicker.d.ts.map +1 -1
  88. package/dist/crud/CrudAgentSurface.d.ts +12 -0
  89. package/dist/crud/CrudAgentSurface.d.ts.map +1 -0
  90. package/dist/crud/CrudDetailPage.d.ts +19 -1
  91. package/dist/crud/CrudDetailPage.d.ts.map +1 -1
  92. package/dist/crud/CrudFormPage.d.ts +23 -1
  93. package/dist/crud/CrudFormPage.d.ts.map +1 -1
  94. package/dist/crud/CrudListView.d.ts +19 -14
  95. package/dist/crud/CrudListView.d.ts.map +1 -1
  96. package/dist/crud/CrudPage.d.ts +17 -1
  97. package/dist/crud/CrudPage.d.ts.map +1 -1
  98. package/dist/crud/CrudRecordModal.d.ts +9 -3
  99. package/dist/crud/CrudRecordModal.d.ts.map +1 -1
  100. package/dist/crud/LookupCreateInline.d.ts +15 -0
  101. package/dist/crud/LookupCreateInline.d.ts.map +1 -0
  102. package/dist/crud/archetype-lookup.d.ts +19 -6
  103. package/dist/crud/archetype-lookup.d.ts.map +1 -1
  104. package/dist/crud/archetypes/AddressesTab.d.ts.map +1 -1
  105. package/dist/crud/archetypes/LocationDetailTabs.d.ts +3 -2
  106. package/dist/crud/archetypes/LocationDetailTabs.d.ts.map +1 -1
  107. package/dist/crud/archetypes/OrderDetailView.d.ts +4 -1
  108. package/dist/crud/archetypes/OrderDetailView.d.ts.map +1 -1
  109. package/dist/crud/archetypes/OrderFormView.d.ts +13 -2
  110. package/dist/crud/archetypes/OrderFormView.d.ts.map +1 -1
  111. package/dist/crud/archetypes/PersonDetailTabs.d.ts +2 -1
  112. package/dist/crud/archetypes/PersonDetailTabs.d.ts.map +1 -1
  113. package/dist/crud/archetypes/PersonPicker.d.ts.map +1 -1
  114. package/dist/crud/createCrudPage.d.ts +8 -0
  115. package/dist/crud/createCrudPage.d.ts.map +1 -1
  116. package/dist/crud/useLookupCreate.d.ts +30 -0
  117. package/dist/crud/useLookupCreate.d.ts.map +1 -0
  118. package/dist/data/client.d.ts.map +1 -1
  119. package/dist/hooks/useAITools.d.ts +1 -0
  120. package/dist/hooks/useAITools.d.ts.map +1 -1
  121. package/dist/hooks/useChat.d.ts.map +1 -1
  122. package/dist/index.d.ts +21 -6
  123. package/dist/index.d.ts.map +1 -1
  124. package/dist/index.js +15362 -8467
  125. package/dist/index.js.map +1 -1
  126. package/dist/lib/agent-staff.d.ts +117 -0
  127. package/dist/lib/agent-staff.d.ts.map +1 -0
  128. package/dist/lib/agent-surface.d.ts +4 -0
  129. package/dist/lib/agent-surface.d.ts.map +1 -1
  130. package/dist/lib/agent-threads.d.ts +15 -0
  131. package/dist/lib/agent-threads.d.ts.map +1 -0
  132. package/dist/lib/ai-tool-handlers.d.ts.map +1 -1
  133. package/dist/lib/assistant-activity.d.ts +47 -4
  134. package/dist/lib/assistant-activity.d.ts.map +1 -1
  135. package/dist/lib/assistant-invite.d.ts +20 -1
  136. package/dist/lib/assistant-invite.d.ts.map +1 -1
  137. package/dist/lib/assistant-text.d.ts +9 -0
  138. package/dist/lib/assistant-text.d.ts.map +1 -0
  139. package/dist/lib/chat-upload.d.ts +12 -0
  140. package/dist/lib/chat-upload.d.ts.map +1 -0
  141. package/dist/lib/core-ai-tools.d.ts +17 -0
  142. package/dist/lib/core-ai-tools.d.ts.map +1 -1
  143. package/dist/lib/fayz-agent.d.ts +9 -0
  144. package/dist/lib/fayz-agent.d.ts.map +1 -1
  145. package/dist/lib/staff-cards.d.ts +11 -0
  146. package/dist/lib/staff-cards.d.ts.map +1 -0
  147. package/dist/lib/unit-ai-handlers.d.ts +2 -0
  148. package/dist/lib/unit-ai-handlers.d.ts.map +1 -0
  149. package/dist/lib/unit-ai-tools.d.ts +3 -0
  150. package/dist/lib/unit-ai-tools.d.ts.map +1 -0
  151. package/dist/onboarding/GettingStartedWidget.d.ts +13 -0
  152. package/dist/onboarding/GettingStartedWidget.d.ts.map +1 -0
  153. package/dist/onboarding/WorkspaceSetupFlow.d.ts +24 -0
  154. package/dist/onboarding/WorkspaceSetupFlow.d.ts.map +1 -0
  155. package/dist/onboarding/WorkspaceSetupGate.d.ts +25 -0
  156. package/dist/onboarding/WorkspaceSetupGate.d.ts.map +1 -0
  157. package/dist/onboarding/analyze-site.d.ts +23 -0
  158. package/dist/onboarding/analyze-site.d.ts.map +1 -0
  159. package/dist/onboarding/backend.d.ts +44 -0
  160. package/dist/onboarding/backend.d.ts.map +1 -0
  161. package/dist/onboarding/checklist.d.ts +55 -0
  162. package/dist/onboarding/checklist.d.ts.map +1 -0
  163. package/dist/onboarding/connector-options.d.ts +52 -0
  164. package/dist/onboarding/connector-options.d.ts.map +1 -0
  165. package/dist/onboarding/decide.d.ts +36 -0
  166. package/dist/onboarding/decide.d.ts.map +1 -0
  167. package/dist/onboarding/index.d.ts +19 -0
  168. package/dist/onboarding/index.d.ts.map +1 -0
  169. package/dist/onboarding/infer-vertical.d.ts +2 -0
  170. package/dist/onboarding/infer-vertical.d.ts.map +1 -0
  171. package/dist/onboarding/packs/beauty.d.ts +4 -0
  172. package/dist/onboarding/packs/beauty.d.ts.map +1 -0
  173. package/dist/onboarding/packs/food.d.ts +4 -0
  174. package/dist/onboarding/packs/food.d.ts.map +1 -0
  175. package/dist/onboarding/packs/index.d.ts +17 -0
  176. package/dist/onboarding/packs/index.d.ts.map +1 -0
  177. package/dist/onboarding/packs/retail.d.ts +8 -0
  178. package/dist/onboarding/packs/retail.d.ts.map +1 -0
  179. package/dist/onboarding/questions.d.ts +41 -0
  180. package/dist/onboarding/questions.d.ts.map +1 -0
  181. package/dist/onboarding/resolve.d.ts +12 -0
  182. package/dist/onboarding/resolve.d.ts.map +1 -0
  183. package/dist/onboarding/steps.d.ts +31 -0
  184. package/dist/onboarding/steps.d.ts.map +1 -0
  185. package/dist/onboarding/store.d.ts +17 -0
  186. package/dist/onboarding/store.d.ts.map +1 -0
  187. package/dist/onboarding/submit.d.ts +25 -0
  188. package/dist/onboarding/submit.d.ts.map +1 -0
  189. package/dist/onboarding/tasks.d.ts +28 -0
  190. package/dist/onboarding/tasks.d.ts.map +1 -0
  191. package/dist/onboarding/types.d.ts +39 -0
  192. package/dist/onboarding/types.d.ts.map +1 -0
  193. package/dist/onboarding/useWorkspaceSetupGate.d.ts +36 -0
  194. package/dist/onboarding/useWorkspaceSetupGate.d.ts.map +1 -0
  195. package/dist/org/context.d.ts +10 -0
  196. package/dist/org/context.d.ts.map +1 -1
  197. package/dist/org/index.js +2 -2
  198. package/dist/org/self.d.ts +50 -0
  199. package/dist/org/self.d.ts.map +1 -0
  200. package/dist/plugins/QuickActionsButton.d.ts.map +1 -1
  201. package/dist/stores/chat.store.d.ts +150 -2
  202. package/dist/stores/chat.store.d.ts.map +1 -1
  203. package/dist/tasks/TasksRailPanel.d.ts +4 -0
  204. package/dist/tasks/TasksRailPanel.d.ts.map +1 -0
  205. package/dist/tasks/components/TaskCard.d.ts +11 -0
  206. package/dist/tasks/components/TaskCard.d.ts.map +1 -0
  207. package/dist/tasks/components/TaskDetail.d.ts +5 -0
  208. package/dist/tasks/components/TaskDetail.d.ts.map +1 -0
  209. package/dist/tasks/components/TaskLabelBadge.d.ts +9 -0
  210. package/dist/tasks/components/TaskLabelBadge.d.ts.map +1 -0
  211. package/dist/tasks/components/TaskPriorityBadge.d.ts +7 -0
  212. package/dist/tasks/components/TaskPriorityBadge.d.ts.map +1 -0
  213. package/dist/tasks/components/TaskQuickAdd.d.ts +5 -0
  214. package/dist/tasks/components/TaskQuickAdd.d.ts.map +1 -0
  215. package/dist/tasks/components/TaskSourceBadge.d.ts +5 -0
  216. package/dist/tasks/components/TaskSourceBadge.d.ts.map +1 -0
  217. package/dist/tasks/components/TaskStatusGroup.d.ts +17 -0
  218. package/dist/tasks/components/TaskStatusGroup.d.ts.map +1 -0
  219. package/dist/tasks/components/TasksFilterBar.d.ts +3 -0
  220. package/dist/tasks/components/TasksFilterBar.d.ts.map +1 -0
  221. package/dist/tasks/components/TasksPanel.d.ts +14 -0
  222. package/dist/tasks/components/TasksPanel.d.ts.map +1 -0
  223. package/dist/tasks/data/mock.d.ts +3 -0
  224. package/dist/tasks/data/mock.d.ts.map +1 -0
  225. package/dist/tasks/data/supabase.d.ts +3 -0
  226. package/dist/tasks/data/supabase.d.ts.map +1 -0
  227. package/dist/tasks/entity.d.ts +11 -0
  228. package/dist/tasks/entity.d.ts.map +1 -0
  229. package/dist/tasks/index.d.ts +17 -0
  230. package/dist/tasks/index.d.ts.map +1 -0
  231. package/dist/tasks/registry.d.ts +3 -0
  232. package/dist/tasks/registry.d.ts.map +1 -0
  233. package/dist/tasks/store.d.ts +34 -0
  234. package/dist/tasks/store.d.ts.map +1 -0
  235. package/dist/tasks/types.d.ts +89 -0
  236. package/dist/tasks/types.d.ts.map +1 -0
  237. package/dist/theme/index.d.ts +1 -1
  238. package/dist/theme/index.d.ts.map +1 -1
  239. package/dist/theme/utils.d.ts +14 -0
  240. package/dist/theme/utils.d.ts.map +1 -1
  241. package/dist/types/index.d.ts +0 -1
  242. package/dist/types/index.d.ts.map +1 -1
  243. package/dist/types/plugins.d.ts +3 -0
  244. package/dist/types/plugins.d.ts.map +1 -1
  245. package/dist/units/MemberAccessRailPage.d.ts +19 -0
  246. package/dist/units/MemberAccessRailPage.d.ts.map +1 -0
  247. package/dist/units/MemberUnitsCell.d.ts +11 -0
  248. package/dist/units/MemberUnitsCell.d.ts.map +1 -0
  249. package/dist/units/PersonUnitsTab.d.ts +5 -0
  250. package/dist/units/PersonUnitsTab.d.ts.map +1 -0
  251. package/dist/units/UnitMembersTab.d.ts +5 -0
  252. package/dist/units/UnitMembersTab.d.ts.map +1 -0
  253. package/dist/units/UnitMenuSection.d.ts +15 -0
  254. package/dist/units/UnitMenuSection.d.ts.map +1 -0
  255. package/dist/units/UnitModeCard.d.ts +3 -0
  256. package/dist/units/UnitModeCard.d.ts.map +1 -0
  257. package/dist/units/UnitRailPage.d.ts +10 -0
  258. package/dist/units/UnitRailPage.d.ts.map +1 -0
  259. package/dist/units/UnitSwitcher.d.ts +5 -0
  260. package/dist/units/UnitSwitcher.d.ts.map +1 -0
  261. package/dist/units/UnitsSettingsPage.d.ts +3 -0
  262. package/dist/units/UnitsSettingsPage.d.ts.map +1 -0
  263. package/dist/units/cache.d.ts +26 -0
  264. package/dist/units/cache.d.ts.map +1 -0
  265. package/dist/units/data.d.ts +111 -0
  266. package/dist/units/data.d.ts.map +1 -0
  267. package/dist/units/device.d.ts +26 -0
  268. package/dist/units/device.d.ts.map +1 -0
  269. package/dist/units/entry.d.ts +52 -0
  270. package/dist/units/entry.d.ts.map +1 -0
  271. package/dist/units/geo.d.ts +18 -0
  272. package/dist/units/geo.d.ts.map +1 -0
  273. package/dist/units/index.d.ts +18 -0
  274. package/dist/units/index.d.ts.map +1 -0
  275. package/dist/units/store.d.ts +32 -0
  276. package/dist/units/store.d.ts.map +1 -0
  277. package/dist/units/useUnitBootstrap.d.ts +10 -0
  278. package/dist/units/useUnitBootstrap.d.ts.map +1 -0
  279. package/package.json +7 -7
  280. package/dist/SubscriptionPage-4KP7DKA2.js +0 -7
  281. package/dist/chunk-OI7RYSTM.js.map +0 -1
  282. package/dist/chunk-PNAJODZM.js.map +0 -1
  283. package/dist/components/organization/OrgInitializer.d.ts +0 -7
  284. package/dist/components/organization/OrgInitializer.d.ts.map +0 -1
  285. package/dist/components/organization/OrgSwitcher.d.ts +0 -7
  286. package/dist/components/organization/OrgSwitcher.d.ts.map +0 -1
  287. package/dist/components/organization/TenantOnboarding.d.ts +0 -9
  288. package/dist/components/organization/TenantOnboarding.d.ts.map +0 -1
  289. package/dist/components/shared/create-person.d.ts +0 -20
  290. package/dist/components/shared/create-person.d.ts.map +0 -1
  291. package/dist/types/entity-lookup.d.ts +0 -27
  292. package/dist/types/entity-lookup.d.ts.map +0 -1
@@ -0,0 +1,55 @@
1
+ import type { OnboardingStepInput } from '@fayz-ai/ui';
2
+ import type { Task, TaskPriority } from '../tasks/types';
3
+ /**
4
+ * The getting-started checklist.
5
+ *
6
+ * The split this file rests on: THE DATABASE HOLDS STATE, CODE HOLDS BEHAVIOUR,
7
+ * joined by `source_key`. A route cannot live in a row without pinning the app's
8
+ * routing to data; a title must, because it is what the Tasks panel shows to
9
+ * somebody who has never seen this catalog. So the row carries title, status and
10
+ * assignee, and this array carries the route, the icon and the sensor.
11
+ *
12
+ * `key` becomes `tasks.source_key` and is the idempotency key for re-seeding.
13
+ * REWORDING A TITLE IS FREE. CHANGING A KEY IS A DUPLICATE ROW.
14
+ */
15
+ export interface OnboardingTaskSeed {
16
+ key: string;
17
+ title: string;
18
+ description?: string;
19
+ icon?: string;
20
+ /** Where the step's action goes. Never stored. */
21
+ route?: string;
22
+ priority?: TaskPriority;
23
+ dueInDays?: number;
24
+ /**
25
+ * Optional sensor: "is this already true of the data?". Must be cheap — it
26
+ * runs once per open step per shell mount. Absent means the only way to
27
+ * complete the step is to tick the task.
28
+ */
29
+ check?: () => Promise<boolean>;
30
+ }
31
+ /**
32
+ * The steps for a vertical. An unknown or absent vertical returns the base set
33
+ * rather than nothing — the same call the question packs make.
34
+ */
35
+ export declare function onboardingChecklist(verticalId?: string): OnboardingTaskSeed[];
36
+ /** A due date `dueInDays` from now, as the `date` column wants it. */
37
+ export declare function dueDateFor(seed: OnboardingTaskSeed, from?: Date): string | null;
38
+ export interface MergeContext {
39
+ /** Called when a sensor fires on a step whose row is still open. */
40
+ onComplete?: (sourceKey: string) => void;
41
+ }
42
+ /**
43
+ * Rows + catalog → what the sidebar renders.
44
+ *
45
+ * The reconciliation is a MONOTONIC OR: neither source can un-complete the
46
+ * other. `useOnboardingProgress` gives `done` precedence over `check`, so
47
+ * handing it both would make the sensor dead code — instead a closed row
48
+ * resolves to `done: true` and never probes, and an open row falls through to
49
+ * the sensor exactly as it did before any of this was persisted.
50
+ *
51
+ * Pure on purpose: this is the part worth testing, and it needs neither React
52
+ * nor a database to say what it does.
53
+ */
54
+ export declare function mergeOnboardingSteps(catalog: OnboardingTaskSeed[], rows: Task[], ctx?: MergeContext): OnboardingStepInput[];
55
+ //# sourceMappingURL=checklist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checklist.d.ts","sourceRoot":"","sources":["../../src/onboarding/checklist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAExD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CAC/B;AAmED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAI7E;AAED,sEAAsE;AACtE,wBAAgB,UAAU,CAAC,IAAI,EAAE,kBAAkB,EAAE,IAAI,OAAa,GAAG,MAAM,GAAG,IAAI,CAKrF;AAED,MAAM,WAAW,YAAY;IAC3B,oEAAoE;IACpE,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;CACzC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,kBAAkB,EAAE,EAC7B,IAAI,EAAE,IAAI,EAAE,EACZ,GAAG,GAAE,YAAiB,GACrB,mBAAmB,EAAE,CA4BvB"}
@@ -0,0 +1,52 @@
1
+ import * as React from 'react';
2
+ import type { SelectableOption } from '@fayz-ai/ui';
3
+ import { type SdkIntegration } from '../components/connect/connector-map.generated';
4
+ /** The value the "not on this list" option carries. Packs key their follow-up text field off it. */
5
+ export declare const OTHER_CONNECTOR = "other";
6
+ export interface ConnectorOptionsFilter {
7
+ /** Connector categories, e.g. `['payments']` or `['marketplace']`. */
8
+ categories?: string[];
9
+ /** Which module brings it — `'shop'`, `'financial'`, `'orders'`. */
10
+ moduleIds?: string[];
11
+ /**
12
+ * Include connectors declared but not implemented yet. On by default: someone
13
+ * telling us what they use today is telling us about THEIR world, not about
14
+ * what we happen to have built.
15
+ */
16
+ includeSoon?: boolean;
17
+ /** Options appended before "other" — providers with no connector of ours. */
18
+ extras?: ReadonlyArray<{
19
+ value: string;
20
+ label: string;
21
+ }>;
22
+ /** Append an "other" card that reveals a free-text follow-up. Default true. */
23
+ other?: boolean;
24
+ otherLabel?: string;
25
+ }
26
+ /**
27
+ * The catalogue rows for a filter, deduped by slug.
28
+ *
29
+ * `SDK_INTEGRATIONS` carries one row per (slug, module) pair — Stripe appears
30
+ * under both Financeiro and Loja. As a question about which provider someone
31
+ * uses, that is one answer, so the implemented row wins and the rest collapse.
32
+ */
33
+ export declare function connectorRows(filter: ConnectorOptionsFilter): SdkIntegration[];
34
+ /**
35
+ * One provider's logo, for a hand-written option that happens to name a real app
36
+ * — "só no iFood", "Google Agenda".
37
+ *
38
+ * People recognise a logo before they finish reading the label, and a list of
39
+ * apps they use should look like the apps they use. Returns undefined for a slug
40
+ * we carry no mark for, so the option simply renders without one.
41
+ */
42
+ export declare function brandMark(slug: string): React.ReactNode | undefined;
43
+ /**
44
+ * A choice list of real providers, with their brand marks — for onboarding
45
+ * questions like "which gateway do you use today?" or "which apps do your
46
+ * orders come from?".
47
+ *
48
+ * Runs with no tenant and no database on purpose: it is asked while the
49
+ * workspace is still being created.
50
+ */
51
+ export declare function connectorOptions(filter: ConnectorOptionsFilter): SelectableOption[];
52
+ //# sourceMappingURL=connector-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector-options.d.ts","sourceRoot":"","sources":["../../src/onboarding/connector-options.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAEnD,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,+CAA+C,CAAA;AAErG,oGAAoG;AACpG,eAAO,MAAM,eAAe,UAAU,CAAA;AAEtC,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,aAAa,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACxD,+EAA+E;IAC/E,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,sBAAsB,GAAG,cAAc,EAAE,CAe9E;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,GAAG,SAAS,CAInE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,gBAAgB,EAAE,CAoBnF"}
@@ -0,0 +1,36 @@
1
+ import type { SetupSource } from './types';
2
+ export interface SetupDecisionInput {
3
+ /** `org.setup === 'wizard'`. */
4
+ enabled: boolean;
5
+ /** A signed-in account exists. */
6
+ hasUser: boolean;
7
+ /** The org provider is mounted. */
8
+ hasTenant: boolean;
9
+ /** The bootstrap has finished FOR THIS ACCOUNT. */
10
+ settled: boolean;
11
+ /** An org is on screen (from cache or from the network). */
12
+ hasOrg: boolean;
13
+ /** How many workspaces this account belongs to. */
14
+ orgCount: number;
15
+ /** Someone asked for the flow: the switcher, or the route. */
16
+ requested: SetupSource | null;
17
+ onRoute: boolean;
18
+ }
19
+ export interface SetupDecision {
20
+ active: boolean;
21
+ /** Hold the screen: we do not know yet whether this account has a workspace. */
22
+ deciding: boolean;
23
+ source: SetupSource;
24
+ /** Deliberate entry can be backed out of; a first workspace cannot. */
25
+ exitable: boolean;
26
+ }
27
+ /**
28
+ * Whether the setup flow takes the screen — as a function, so the one state
29
+ * that matters can be tested without a browser.
30
+ *
31
+ * The rule that keeps breaking is the middle one. "No org" and "no answer yet"
32
+ * look identical from the outside, and treating the second as the first is what
33
+ * flashed the setup flow over the app on every login.
34
+ */
35
+ export declare function decideWorkspaceSetup(input: SetupDecisionInput): SetupDecision;
36
+ //# sourceMappingURL=decide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decide.d.ts","sourceRoot":"","sources":["../../src/onboarding/decide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,MAAM,WAAW,kBAAkB;IACjC,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,mCAAmC;IACnC,SAAS,EAAE,OAAO,CAAA;IAClB,mDAAmD;IACnD,OAAO,EAAE,OAAO,CAAA;IAChB,4DAA4D;IAC5D,MAAM,EAAE,OAAO,CAAA;IACf,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAA;IAChB,8DAA8D;IAC9D,SAAS,EAAE,WAAW,GAAG,IAAI,CAAA;IAC7B,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,CAAA;IACf,gFAAgF;IAChF,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,WAAW,CAAA;IACnB,uEAAuE;IACvE,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAiB7E"}
@@ -0,0 +1,19 @@
1
+ export { WorkspaceSetupFlow, type WorkspaceSetupFlowProps } from './WorkspaceSetupFlow';
2
+ export { WorkspaceSetupGate, type WorkspaceSetupGateProps } from './WorkspaceSetupGate';
3
+ export { resolveSetupMode, type SetupMode } from './resolve';
4
+ export { decideWorkspaceSetup, type SetupDecision, type SetupDecisionInput } from './decide';
5
+ export { useWorkspaceSetupGate, useWorkspaceSetupBusy, WORKSPACE_SETUP_ROUTE, type WorkspaceSetupGateState, } from './useWorkspaceSetupGate';
6
+ export { useWorkspaceSetupStore } from './store';
7
+ export { buildWorkspaceSetupSteps, slugify } from './steps';
8
+ export { inferVerticalId } from './infer-vertical';
9
+ export { brandMark, connectorOptions, connectorRows, OTHER_CONNECTOR, type ConnectorOptionsFilter } from './connector-options';
10
+ export { getQuestionPack, resolveVerticalId, QUESTION_PACKS, beautyPack, foodPack, retailPack } from './packs';
11
+ export { submitWorkspaceSetup, type SubmitWorkspaceSetupInput } from './submit';
12
+ export { checkSlugAvailable, createLogoUploader, importLogoFromUrl, recordOnboardingResponse } from './backend';
13
+ export { createSiteAnalyzer, type SiteAnalyzerOptions } from './analyze-site';
14
+ export { GettingStartedWidget } from './GettingStartedWidget';
15
+ export { onboardingChecklist, mergeOnboardingSteps, dueDateFor, type OnboardingTaskSeed, type MergeContext, } from './checklist';
16
+ export { seedOnboardingTasks, listOnboardingTasks, completeOnboardingTask } from './tasks';
17
+ export { toQuestionSpecs, coerceAnswers, type QuestionSpec, type QuestionType } from './questions';
18
+ export { WORKSPACE_SETUP_FLOW_ID, WORKSPACE_SETUP_FLOW_VERSION, type QuestionPack, type SetupAnswers, type SetupContext, type SetupSource, } from './types';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/onboarding/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AACvF,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AACvF,OAAO,EAAE,gBAAgB,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAC5F,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,uBAAuB,GAC7B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAC9H,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAC9G,OAAO,EAAE,oBAAoB,EAAE,KAAK,yBAAyB,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAC/G,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EACL,mBAAmB,EAAE,oBAAoB,EAAE,UAAU,EACrD,KAAK,kBAAkB,EAAE,KAAK,YAAY,GAC3C,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAC1F,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAClG,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,SAAS,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare function inferVerticalId(pluginIds: ReadonlyArray<string>): string | undefined;
2
+ //# sourceMappingURL=infer-vertical.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infer-vertical.d.ts","sourceRoot":"","sources":["../../src/onboarding/infer-vertical.ts"],"names":[],"mappings":"AA4BA,wBAAgB,eAAe,CAAC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAQpF"}
@@ -0,0 +1,4 @@
1
+ import type { QuestionPack } from '../types';
2
+ /** Salons, barbershops, studios, clinics — everyone who sells appointments. */
3
+ export declare const beautyPack: QuestionPack;
4
+ //# sourceMappingURL=beauty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"beauty.d.ts","sourceRoot":"","sources":["../../../src/onboarding/packs/beauty.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,+EAA+E;AAC/E,eAAO,MAAM,UAAU,EAAE,YA6GxB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { QuestionPack } from '../types';
2
+ /** Restaurants, bars and anything that plates food. */
3
+ export declare const foodPack: QuestionPack;
4
+ //# sourceMappingURL=food.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"food.d.ts","sourceRoot":"","sources":["../../../src/onboarding/packs/food.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAO5C,uDAAuD;AACvD,eAAO,MAAM,QAAQ,EAAE,YAmJtB,CAAA"}
@@ -0,0 +1,17 @@
1
+ import type { QuestionPack } from '../types';
2
+ import { beautyPack } from './beauty';
3
+ import { foodPack } from './food';
4
+ import { retailPack } from './retail';
5
+ /**
6
+ * Packs are keyed by `VerticalId` — the value that lands on `tenants.vertical_id`
7
+ * and gates plugins at runtime.
8
+ */
9
+ export declare const QUESTION_PACKS: Record<string, QuestionPack>;
10
+ export declare function resolveVerticalId(verticalId: string | undefined): string | undefined;
11
+ /**
12
+ * The domain questions for a vertical. An unknown or absent vertical returns an
13
+ * empty pack, so the flow is the base steps only rather than nothing at all.
14
+ */
15
+ export declare function getQuestionPack(verticalId: string | undefined): QuestionPack;
16
+ export { beautyPack, foodPack, retailPack };
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/onboarding/packs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAIvD,CAAA;AAeD,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAIpF;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAG5E;AAED,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { QuestionPack } from '../types';
2
+ /**
3
+ * Retail / ecommerce. Reword freely — every answer lands in the `answers` jsonb
4
+ * under its field id, so changing a question costs nothing but a stale id in old
5
+ * rows (which is why the flow version is stamped alongside).
6
+ */
7
+ export declare const retailPack: QuestionPack;
8
+ //# sourceMappingURL=retail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retail.d.ts","sourceRoot":"","sources":["../../../src/onboarding/packs/retail.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,YAkKxB,CAAA"}
@@ -0,0 +1,41 @@
1
+ import type { WizardStepDef, WizardValues } from '@fayz-ai/ui';
2
+ /**
3
+ * Turning the flow into something a stranger can answer, and turning what comes
4
+ * back into something the flow can hold.
5
+ *
6
+ * Both directions are pure functions of the step list, so the platform never
7
+ * learns what this questionnaire asks and rewording a question stays what it has
8
+ * always been: editing a list.
9
+ */
10
+ /** The coarse shape a caller outside this package can reason about. */
11
+ export type QuestionType = 'text' | 'choice' | 'boolean';
12
+ export interface QuestionSpec {
13
+ id: string;
14
+ label: string;
15
+ hint?: string;
16
+ type: QuestionType;
17
+ multi?: boolean;
18
+ options?: Array<{
19
+ value: string;
20
+ label: string;
21
+ }>;
22
+ }
23
+ /**
24
+ * Every question in the flow, including the ones on steps the current answers
25
+ * keep hidden — the vertical has not been picked when this runs, so all the
26
+ * packs' questions go out together and the reply picks the vertical AND answers
27
+ * it in one round trip.
28
+ */
29
+ export declare function toQuestionSpecs(steps: ReadonlyArray<WizardStepDef>): QuestionSpec[];
30
+ /**
31
+ * Second pass over answers the server already checked.
32
+ *
33
+ * Not redundant: the server validates against the questions it was SENT, this
34
+ * validates against the fields that actually exist here — and it is the only
35
+ * place that can apply a field's own `normalize` and `validate`, which is what
36
+ * turns 14 digits into a formatted CNPJ and rejects one whose digits do not add
37
+ * up. Anything that fails is dropped rather than corrected: a blank field is
38
+ * obviously still the user's turn, a wrong one is not.
39
+ */
40
+ export declare function coerceAnswers(steps: ReadonlyArray<WizardStepDef>, raw: Record<string, unknown> | undefined): WizardValues;
41
+ //# sourceMappingURL=questions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["../../src/onboarding/questions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG9E;;;;;;;GAOG;AAEH,uEAAuE;AACvE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAA;AAExD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,YAAY,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAClD;AAqCD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,YAAY,EAAE,CA0CnF;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,EACnC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACvC,YAAY,CA0Bd"}
@@ -0,0 +1,12 @@
1
+ import type { OrgConfig } from '../app/config';
2
+ export type SetupMode = 'wizard' | 'auto' | 'off';
3
+ /**
4
+ * Which first-run behaviour an app gets.
5
+ *
6
+ * `setup` is the field; `autoCreate` is what apps written before it used, and it
7
+ * only ever meant "invent an org, or do nothing". An app that explicitly turned
8
+ * it off asked for no org to appear on its own — honour that as `'off'` rather
9
+ * than surprising it with a wizard.
10
+ */
11
+ export declare function resolveSetupMode(org: OrgConfig | undefined): SetupMode;
12
+ //# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/onboarding/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAA;AAEjD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAItE"}
@@ -0,0 +1,31 @@
1
+ import type { WizardStepDef } from '@fayz-ai/ui';
2
+ import type { SetupContext } from './types';
3
+ /**
4
+ * A workspace handle: lowercase, no accents, hyphen-joined. Mirrors the shape
5
+ * `tenant_slug_available` enforces, so what passes here is what the DB accepts.
6
+ *
7
+ * Derived from the name at submit, never asked. "Your address on Fayz" is a
8
+ * question about our URL scheme, and someone naming their business has no
9
+ * opinion about it yet — the products that do need a public link let them set
10
+ * it later, next to the page it actually addresses.
11
+ */
12
+ export declare function slugify(raw: string): string;
13
+ /** Answers the flow lifts into columns of their own when it writes the row. */
14
+ export declare const HEARD_FROM_FIELD = "meta.heardFrom";
15
+ export declare const VERTICAL_FIELD = "meta.vertical";
16
+ export declare const NAME_FIELD = "workspace.name";
17
+ export declare const LOGO_FIELD = "workspace.logoUrl";
18
+ /** Brand palette, read from their site. Never asked cold — see the field below. */
19
+ export declare const BRAND_COLORS_FIELD = "workspace.brandColors";
20
+ /** Their EXISTING site, not ours — the seed for learning about the business. */
21
+ export declare const SITE_FIELD = "workspace.existingSite";
22
+ /** BR company registration. The other seed, and the qualification signal. */
23
+ export declare const TAX_ID_FIELD = "workspace.taxId";
24
+ export declare const HAS_TAX_ID_FIELD = "workspace.hasTaxId";
25
+ /**
26
+ * The base flow: identity, contact, what they use today, then the vertical's own
27
+ * questions, then acquisition, then confirm. Everything is data — the only React
28
+ * here is the summary card on the last step.
29
+ */
30
+ export declare function buildWorkspaceSetupSteps(ctx: SetupContext): WizardStepDef[];
31
+ //# sourceMappingURL=steps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../src/onboarding/steps.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,aAAa,CAAA;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ3C;AAOD,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,mBAAmB,CAAA;AAChD,eAAO,MAAM,cAAc,kBAAkB,CAAA;AAC7C,eAAO,MAAM,UAAU,mBAAmB,CAAA;AAC1C,eAAO,MAAM,UAAU,sBAAsB,CAAA;AAC7C,mFAAmF;AACnF,eAAO,MAAM,kBAAkB,0BAA0B,CAAA;AACzD,gFAAgF;AAChF,eAAO,MAAM,UAAU,2BAA2B,CAAA;AAClD,6EAA6E;AAC7E,eAAO,MAAM,YAAY,oBAAoB,CAAA;AAC7C,eAAO,MAAM,gBAAgB,uBAAuB,CAAA;AAqDpD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,YAAY,GAAG,aAAa,EAAE,CA0S3E"}
@@ -0,0 +1,17 @@
1
+ import type { SetupSource } from './types';
2
+ interface WorkspaceSetupStore {
3
+ /** Non-null while the flow is open on purpose (the switcher's "new workspace"). */
4
+ requested: SetupSource | null;
5
+ open: (source?: SetupSource) => void;
6
+ close: () => void;
7
+ }
8
+ /**
9
+ * Opening the setup flow from anywhere in the shell.
10
+ *
11
+ * The first-workspace case needs none of this — it is derived from "this account
12
+ * belongs to no org". This store is only for the deliberate case, where someone
13
+ * who already has a workspace asks for another one.
14
+ */
15
+ export declare const useWorkspaceSetupStore: import("zustand").UseBoundStore<import("zustand").StoreApi<WorkspaceSetupStore>>;
16
+ export {};
17
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/onboarding/store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,UAAU,mBAAmB;IAC3B,mFAAmF;IACnF,SAAS,EAAE,WAAW,GAAG,IAAI,CAAA;IAC7B,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IACpC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,kFAIhC,CAAA"}
@@ -0,0 +1,25 @@
1
+ import type { Organization, OrgAdapter } from '@fayz-ai/core';
2
+ import type { WizardValues } from '@fayz-ai/ui';
3
+ import type { SetupSource } from './types';
4
+ export interface SubmitWorkspaceSetupInput {
5
+ adapter: OrgAdapter;
6
+ userId: string;
7
+ /** Display name of the person running the flow — the checklist's assignee. */
8
+ userName?: string;
9
+ values: WizardValues;
10
+ source: SetupSource;
11
+ /** Fixed by the app; when absent the flow asked for it. */
12
+ verticalId?: string;
13
+ timezone?: string;
14
+ currency?: string;
15
+ locale?: string;
16
+ }
17
+ /**
18
+ * Turn the answers into a workspace.
19
+ *
20
+ * Order matters: the org first, because everything else is decoration on top of
21
+ * a tenant that must exist. The logo is a second call (`create_tenant_with_owner`
22
+ * takes no logo), and the questionnaire row is a third that is allowed to fail.
23
+ */
24
+ export declare function submitWorkspaceSetup({ adapter, userId, userName, values, source, verticalId, timezone, currency, locale, }: SubmitWorkspaceSetupInput): Promise<Organization>;
25
+ //# sourceMappingURL=submit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submit.d.ts","sourceRoot":"","sources":["../../src/onboarding/submit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAQ/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,UAAU,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,WAAW,CAAA;IACnB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAyDD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAClF,EAAE,yBAAyB,GAAG,OAAO,CAAC,YAAY,CAAC,CAoEnD"}
@@ -0,0 +1,28 @@
1
+ import { type Task } from '../tasks/types';
2
+ import { type OnboardingTaskSeed } from './checklist';
3
+ /**
4
+ * The getting-started checklist's read/write seam.
5
+ *
6
+ * Same contract as its neighbour `backend.ts`: every function swallows its own
7
+ * failures and returns a benign value. The caller has just created a workspace,
8
+ * and a lost checklist is not a reason to tell someone their business was not
9
+ * created.
10
+ *
11
+ * These are plain inserts rather than the entity provider on purpose:
12
+ * `createSupabaseProvider` strips `ownerId`/`createdBy` from writes (the
13
+ * triggers' job), and seeding runs before the new tenant is the active one, so
14
+ * nothing that reads `getActiveTenantId()` would aim at the right rows.
15
+ */
16
+ export interface SeedOnboardingTasksInput {
17
+ tenantId: string;
18
+ /** Whoever ran the wizard. This is the only place that is reliably known. */
19
+ userId: string;
20
+ userName?: string;
21
+ items: OnboardingTaskSeed[];
22
+ }
23
+ export declare function seedOnboardingTasks(input: SeedOnboardingTasksInput): Promise<boolean>;
24
+ /** `[]` when Supabase is absent, when nothing was seeded, or on any error. */
25
+ export declare function listOnboardingTasks(tenantId: string): Promise<Task[]>;
26
+ /** The latch. Fire-and-forget; never throws. */
27
+ export declare function completeOnboardingTask(tenantId: string, sourceKey: string): Promise<void>;
28
+ //# sourceMappingURL=tasks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/onboarding/tasks.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAc,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAIjE;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAA;IAChB,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,kBAAkB,EAAE,CAAA;CAC5B;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,OAAO,CAAC,CAgC3F;AAUD,8EAA8E;AAC9E,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAmB3E;AAED,gDAAgD;AAChD,wBAAsB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB/F"}
@@ -0,0 +1,39 @@
1
+ import type { WizardMedia, WizardStepDef, WizardValues } from '@fayz-ai/ui';
2
+ /** Which questionnaire, and which revision of it, gets stamped on every answer row. */
3
+ export declare const WORKSPACE_SETUP_FLOW_ID = "workspace-setup";
4
+ export declare const WORKSPACE_SETUP_FLOW_VERSION = 1;
5
+ /** Why the flow is open. Same questions, different intent — and it is stored. */
6
+ export type SetupSource = 'signup' | 'switcher';
7
+ export interface SetupContext {
8
+ /** The app's vertical when it has one. Absent means the flow asks. */
9
+ verticalId?: string;
10
+ /** Upload handler for the logo step. Absent hides the logo field entirely. */
11
+ uploadLogo?: (file: File) => Promise<string>;
12
+ /** Slug availability probe. Absent skips the check and lets submit surface a clash. */
13
+ checkSlug?: (slug: string) => Promise<boolean>;
14
+ /** Per-step artwork, keyed by step id. This is where an app plugs its own images in. */
15
+ media?: Record<string, WizardMedia>;
16
+ /**
17
+ * ISO country of the operation, which decides the locale-specific questions.
18
+ * `'BR'` is what turns on CNPJ — asking a US salon for one is noise.
19
+ */
20
+ country?: string;
21
+ /**
22
+ * Reads the website the user already has and answers what it supports.
23
+ * Absent leaves the site field as a plain question, which is what happens when
24
+ * the app has no platform URL configured.
25
+ */
26
+ analyzeSite?: (url: string) => Promise<WizardValues | null>;
27
+ }
28
+ /**
29
+ * A vertical's questions. A plain function of context returning steps, so
30
+ * rewording is editing a list — no component, no key registry, no migration.
31
+ */
32
+ export type QuestionPack = (ctx: SetupContext) => WizardStepDef[];
33
+ /** Shape written to `plg_onboarding_responses`. */
34
+ export interface SetupAnswers {
35
+ values: WizardValues;
36
+ verticalId?: string;
37
+ heardFrom?: string;
38
+ }
39
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/onboarding/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE3E,uFAAuF;AACvF,eAAO,MAAM,uBAAuB,oBAAoB,CAAA;AACxD,eAAO,MAAM,4BAA4B,IAAI,CAAA;AAE7C,iFAAiF;AACjF,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAA;AAE/C,MAAM,WAAW,YAAY;IAC3B,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAC5C,uFAAuF;IACvF,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IAC9C,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACnC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAA;CAC5D;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,YAAY,KAAK,aAAa,EAAE,CAAA;AAEjE,mDAAmD;AACnD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,YAAY,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
@@ -0,0 +1,36 @@
1
+ import type { SetupSource } from './types';
2
+ /** Linkable entry point, so the browser's back button behaves inside the flow. */
3
+ export declare const WORKSPACE_SETUP_ROUTE = "/workspaces/new";
4
+ export interface WorkspaceSetupGateState {
5
+ /** Render the flow instead of the shell. */
6
+ active: boolean;
7
+ /**
8
+ * We do not know yet whether this account has a workspace. The shell must not
9
+ * be handed over in this state — it renders fully, then gets yanked away the
10
+ * moment the membership request lands, which is the flash.
11
+ */
12
+ deciding: boolean;
13
+ source: SetupSource;
14
+ /** Absent on the first workspace — there is nothing behind the flow to return to. */
15
+ onExit?: () => void;
16
+ }
17
+ /**
18
+ * Decides whether the setup flow takes over the screen.
19
+ *
20
+ * Two ways in, and they behave differently on the way out. A signed-in account
21
+ * with no workspace has nowhere else to be, so the flow IS the app and there is
22
+ * no exit. Someone adding a second workspace came from a working shell, so they
23
+ * can always back out to it.
24
+ */
25
+ export declare function useWorkspaceSetupGate(enabled: boolean): WorkspaceSetupGateState;
26
+ /**
27
+ * "The app is not usable yet" — the setup flow owns the screen, or we are still
28
+ * working out whether it will.
29
+ *
30
+ * For chrome mounted ABOVE the shell by the providers, which the gate cannot
31
+ * hide by not rendering: the assistant FAB floating over "name your business"
32
+ * offers help with a product the account does not have yet, and floating over
33
+ * the boot screen offers it before there is anything to help with.
34
+ */
35
+ export declare function useWorkspaceSetupBusy(enabled: boolean): boolean;
36
+ //# sourceMappingURL=useWorkspaceSetupGate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWorkspaceSetupGate.d.ts","sourceRoot":"","sources":["../../src/onboarding/useWorkspaceSetupGate.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,kFAAkF;AAClF,eAAO,MAAM,qBAAqB,oBAAoB,CAAA;AAEtD,MAAM,WAAW,uBAAuB;IACtC,4CAA4C;IAC5C,MAAM,EAAE,OAAO,CAAA;IACf;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,WAAW,CAAA;IACnB,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,uBAAuB,CAgC/E;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAK/D"}
@@ -8,6 +8,16 @@ export interface TenantContext {
8
8
  /** All orgs the current user belongs to */
9
9
  userOrgs: OrgMembership[];
10
10
  loading: boolean;
11
+ /**
12
+ * The bootstrap has finished at least once, so `org === null` now MEANS
13
+ * "belongs to no workspace" instead of "we have not looked yet".
14
+ *
15
+ * `loading` cannot answer that: it starts `false`, before the effect that
16
+ * loads anything has run. Anything deciding what to render from an empty org
17
+ * — the setup gate — reads this, or it decides during the gap and flips its
18
+ * mind a frame later.
19
+ */
20
+ settled: boolean;
11
21
  /** Switch the active org */
12
22
  switchOrg: (orgId: string) => Promise<void>;
13
23
  /** Refresh the current org from the adapter */
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/org/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAoB5E,wBAAgB,aAAa,IAAI,UAAU,CAM1C;AAED,wBAAgB,qBAAqB,IAAI,UAAU,GAAG,IAAI,CAEzD;AAMD,MAAM,WAAW,aAAa;IAC5B,wCAAwC;IACxC,GAAG,EAAE,YAAY,GAAG,IAAI,CAAA;IACxB,2CAA2C;IAC3C,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB,4BAA4B;IAC5B,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3C,+CAA+C;IAC/C,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC;AAID;;;GAGG;AACH,wBAAgB,SAAS,IAAI,aAAa,CAMzC;AAED,wBAAgB,iBAAiB,IAAI,aAAa,GAAG,IAAI,CAExD;AAMD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,UAAU,CAAA;IACnB,mEAAmE;IACnE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAKD,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,UAAkB,EAClB,UAA6B,EAC7B,QAAQ,GACT,EAAE,gBAAgB,qBAgPlB"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/org/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAoB5E,wBAAgB,aAAa,IAAI,UAAU,CAM1C;AAED,wBAAgB,qBAAqB,IAAI,UAAU,GAAG,IAAI,CAEzD;AAMD,MAAM,WAAW,aAAa;IAC5B,wCAAwC;IACxC,GAAG,EAAE,YAAY,GAAG,IAAI,CAAA;IACxB,2CAA2C;IAC3C,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB;;;;;;;;OAQG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB,4BAA4B;IAC5B,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3C,+CAA+C;IAC/C,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC;AAID;;;GAGG;AACH,wBAAgB,SAAS,IAAI,aAAa,CAMzC;AAED,wBAAgB,iBAAiB,IAAI,aAAa,GAAG,IAAI,CAExD;AAMD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,UAAU,CAAA;IACnB,mEAAmE;IACnE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAKD,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,UAAkB,EAClB,UAA6B,EAC7B,QAAQ,GACT,EAAE,gBAAgB,qBAoQlB"}
package/dist/org/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { createMockOrgAdapter, createSupabaseOrgAdapter } from '../chunk-OI7RYSTM.js';
2
- export { ORG_CACHE_TTL_MS, OrgProvider, clearOrgSnapshot, getPersistedOrgId, readOrgSnapshot, useOrgAdapter, useOrgAdapterOptional, useOrganizationStore, useTenant, useTenantOptional } from '../chunk-PNAJODZM.js';
1
+ export { createMockOrgAdapter, createSupabaseOrgAdapter } from '../chunk-45EZQW4M.js';
2
+ export { ORG_CACHE_TTL_MS, OrgProvider, clearOrgSnapshot, getPersistedOrgId, readOrgSnapshot, useOrgAdapter, useOrgAdapterOptional, useOrganizationStore, useTenant, useTenantOptional } from '../chunk-OB7ZSTQD.js';
3
3
  import '../chunk-VTEP2AQX.js';
4
4
  //# sourceMappingURL=index.js.map
5
5
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,50 @@
1
+ export interface LinkedPerson {
2
+ id: string;
3
+ name: string;
4
+ kind: string | null;
5
+ }
6
+ /** A ficha profissional deste login, se alguém já disse qual é. */
7
+ export declare function fetchMyPersonRecord(tenantId: string, userId: string): Promise<LinkedPerson | null>;
8
+ /**
9
+ * A ficha que provavelmente é você — e só quando não há dúvida.
10
+ *
11
+ * Devolve `null` se não houver nenhuma, se houver mais de uma, ou se a que
12
+ * houver já pertence a outro login. Ambiguidade aqui vira um vínculo errado
13
+ * entre uma pessoa e uma identidade, que é o tipo de erro que ninguém vai
14
+ * procurar depois.
15
+ */
16
+ export declare function findMyPersonCandidate(tenantId: string, email: string | undefined, staffKinds: string[]): Promise<LinkedPerson | null>;
17
+ /**
18
+ * Diz que este login e esta ficha são a mesma pessoa.
19
+ *
20
+ * Escrever em `tenant_members` é de administrador (policy da 001, não
21
+ * afrouxada) — e está certo assim: dizer quem é quem na equipe é uma decisão de
22
+ * quem administra a equipe, não uma preferência pessoal. Quem não é
23
+ * administrador recebe o erro do banco, e a tela traduz em "peça a um
24
+ * administrador".
25
+ */
26
+ export declare function linkPersonToLogin(tenantId: string, userId: string, personId: string | null): Promise<void>;
27
+ /** O login por trás de uma ficha, para a ficha poder dizer que a pessoa entra
28
+ * no sistema. O espelho de `fetchMyPersonRecord`. */
29
+ export declare function fetchLoginForPerson(personId: string): Promise<{
30
+ userId: string;
31
+ email: string | null;
32
+ } | null>;
33
+ /** Só o id da ficha que é este login — uma consulta, não as duas de
34
+ * `fetchMyPersonRecord`. É tudo que a ficha precisa para saber se é você. */
35
+ export declare function fetchMyPersonId(tenantId: string, userId: string): Promise<string | null>;
36
+ /**
37
+ * A ficha que é você, para a tela poder dizer "(você)" em cima dela.
38
+ *
39
+ * `undefined` enquanto não sabe, `null` quando o login não está ligado a ficha
40
+ * nenhuma — e a diferença importa: pintar "(você)" e tirar depois é pior do que
41
+ * demorar um instante para pintar.
42
+ *
43
+ * `enabled` porque a ficha de detalhe é genérica e também desenha produto,
44
+ * serviço e unidade. Um id de produto nunca casaria com uma ficha de pessoa,
45
+ * mas perguntar em toda tela de detalhe é uma requisição por tela para saber
46
+ * uma coisa que só faz sentido numa delas. Com `dedup`, quem pergunta várias
47
+ * vezes na mesma sessão pergunta uma.
48
+ */
49
+ export declare function useMyPersonId(enabled?: boolean): string | null | undefined;
50
+ //# sourceMappingURL=self.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"self.d.ts","sourceRoot":"","sources":["../../src/org/self.ts"],"names":[],"mappings":"AA8BA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAED,mEAAmE;AACnE,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAqB9B;AAED;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,UAAU,EAAE,MAAM,EAAE,GACnB,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAuB9B;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,IAAI,CAAC,CASf;AAED;sDACsD;AACtD,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,IAAI,CAAC,CAkB1D;AAED;8EAC8E;AAC9E,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,OAAO,UAAO,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAcvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"QuickActionsButton.d.ts","sourceRoot":"","sources":["../../src/plugins/QuickActionsButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAM1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEtD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE;IACtF,OAAO,EAAE,iBAAiB,EAAE,CAAA;IAC5B,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,4BA4DA"}
1
+ {"version":3,"file":"QuickActionsButton.d.ts","sourceRoot":"","sources":["../../src/plugins/QuickActionsButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAM1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEtD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE;IACtF,OAAO,EAAE,iBAAiB,EAAE,CAAA;IAC5B,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,4BA+EA"}