@happyvertical/smrt-planner 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -8
- package/app/404.html +42 -49
- package/app/_app/immutable/assets/0.BvXq1Svw.css +1 -0
- package/app/_app/immutable/assets/10.CdYxvH4G.css +1 -0
- package/app/_app/immutable/assets/11.nOT5Z4Fv.css +1 -0
- package/app/_app/immutable/assets/12.F7A7zP4J.css +1 -0
- package/app/_app/immutable/assets/13.JoySu8W5.css +1 -0
- package/app/_app/immutable/assets/14.nsp62-4b.css +1 -0
- package/app/_app/immutable/assets/2.CbPiqdz5.css +1 -0
- package/app/_app/immutable/assets/3.D518dbB5.css +1 -0
- package/app/_app/immutable/assets/4.B3vt1gMJ.css +1 -0
- package/app/_app/immutable/assets/AiSetup.4fXjMpTZ.css +1 -0
- package/app/_app/immutable/assets/AppShell.DKPbJFmw.css +1 -0
- package/app/_app/immutable/assets/ConnectTools.DTleL8YA.css +1 -0
- package/app/_app/immutable/assets/FieldMapForm.C8SZ3t4N.css +1 -0
- package/app/_app/immutable/assets/ModelPage.DzDhJQz3.css +1 -0
- package/app/_app/immutable/assets/SectionActions.BE1CPmxk.css +1 -0
- package/app/_app/immutable/assets/SectionIcons.BGFcFuOf.css +1 -0
- package/app/_app/immutable/assets/SegmentedControl.T_hJQXHk.css +1 -0
- package/app/_app/immutable/assets/app.BS7nbUi0.css +1 -0
- package/app/_app/immutable/assets/currency-metadata.CJIy0Dzm.css +1 -0
- package/app/_app/immutable/assets/data.DQcbQG_b.css +1 -0
- package/app/_app/immutable/assets/feedback.FjY5wqsa.css +1 -0
- package/app/_app/immutable/assets/forms.DA06CFM9.css +1 -0
- package/app/_app/immutable/assets/labels.Dny6zd23.css +1 -0
- package/app/_app/immutable/assets/percent.CBivq97O.css +1 -0
- package/app/_app/immutable/assets/state.C9Put0ur.css +1 -0
- package/app/_app/immutable/assets/webmcp-ui-context.CC5pQLNE.css +1 -0
- package/app/_app/immutable/assets/workspace.Dtoe2fRU.css +1 -0
- package/app/_app/immutable/chunks/3ouNUakh.js +1 -0
- package/app/_app/immutable/chunks/B3FAegW4.js +4 -0
- package/app/_app/immutable/chunks/B8iReL-r.js +1 -0
- package/app/_app/immutable/chunks/BCmdRE3j.js +4 -0
- package/app/_app/immutable/chunks/BV3NwM01.js +1 -0
- package/app/_app/immutable/chunks/BVicq_6F.js +1 -0
- package/app/_app/immutable/chunks/Ba1g71Sq.js +1 -0
- package/app/_app/immutable/chunks/BdjvgMW6.js +1 -0
- package/app/_app/immutable/chunks/BiO_bqNH.js +2 -0
- package/app/_app/immutable/chunks/{DyGfbRG-.js → BrorvU4B.js} +1 -1
- package/app/_app/immutable/chunks/By-QJdbA.js +980 -0
- package/app/_app/immutable/chunks/{CyUMm_Wp.js → BzITuwgY.js} +1 -1
- package/app/_app/immutable/chunks/BzMfoxBk.js +1 -0
- package/app/_app/immutable/chunks/C-AoRalq.js +1 -0
- package/app/_app/immutable/chunks/CGKL_Nlh.js +1 -0
- package/app/_app/immutable/chunks/CNj-_B0j.js +1 -0
- package/app/_app/immutable/chunks/CU8cbxOZ.js +1 -0
- package/app/_app/immutable/chunks/CZGhPAoL.js +2 -0
- package/app/_app/immutable/chunks/CaEdOwVf.js +1 -0
- package/app/_app/immutable/chunks/Cas1hq-y.js +1 -0
- package/app/_app/immutable/chunks/CfOMUCNN.js +1 -0
- package/app/_app/immutable/chunks/Cm0VMWZu.js +1 -0
- package/app/_app/immutable/chunks/CsmXMAyE.js +1 -0
- package/app/_app/immutable/chunks/{BWPhGFHl.js → D0FW0z6R.js} +1 -1
- package/app/_app/immutable/chunks/D3nyL-ZK.js +1 -0
- package/app/_app/immutable/chunks/DEe2Vsu9.js +1 -0
- package/app/_app/immutable/chunks/DTs3DOB0.js +10 -0
- package/app/_app/immutable/chunks/Dm6R8q7G.js +1 -0
- package/app/_app/immutable/chunks/Dreozana.js +1 -0
- package/app/_app/immutable/chunks/Dx8H44Wq.js +2 -0
- package/app/_app/immutable/chunks/DxR35SQx.js +24 -0
- package/app/_app/immutable/chunks/EcFojPiU.js +11 -0
- package/app/_app/immutable/chunks/JBS2nHGN.js +1 -0
- package/app/_app/immutable/chunks/TjbilXEg.js +1 -0
- package/app/_app/immutable/chunks/ZLqixH7j.js +9 -0
- package/app/_app/immutable/chunks/auwiz8v4.js +1 -0
- package/app/_app/immutable/chunks/dbZ3U29n.js +1 -0
- package/app/_app/immutable/chunks/{D333l2GL.js → gHjidpzw.js} +2 -2
- package/app/_app/immutable/chunks/vNEnXNLV.js +3 -0
- package/app/_app/immutable/entry/app.vuScBcN4.js +2 -0
- package/app/_app/immutable/entry/start.C_vMied2.js +1 -0
- package/app/_app/immutable/nodes/0.BeNJfVow.js +9 -0
- package/app/_app/immutable/nodes/1.huiLmf4w.js +1 -0
- package/app/_app/immutable/nodes/10.B3buyRS-.js +3 -0
- package/app/_app/immutable/nodes/11.FNeDQehr.js +1 -0
- package/app/_app/immutable/nodes/12.umrKgKLQ.js +4 -0
- package/app/_app/immutable/nodes/13.DFr7i0IY.js +1 -0
- package/app/_app/immutable/nodes/14.BNgJ8cEq.js +1 -0
- package/app/_app/immutable/nodes/2.B3v0JtfB.js +24 -0
- package/app/_app/immutable/nodes/3.FLW3AkwU.js +1 -0
- package/app/_app/immutable/nodes/4.50B7EkB9.js +1 -0
- package/app/_app/immutable/nodes/5.Din7W_Et.js +1 -0
- package/app/_app/immutable/nodes/6.7dOUE7nr.js +1 -0
- package/app/_app/immutable/nodes/7.C4XsW0qI.js +1 -0
- package/app/_app/immutable/nodes/8.D_MREd8V.js +1 -0
- package/app/_app/immutable/nodes/9.cn87hhI-.js +1 -0
- package/app/_app/version.json +1 -1
- package/app/advanced-styles/index.html +84 -0
- package/app/ai/index.html +60 -52
- package/app/blueprint/index.html +46 -53
- package/app/cookbook/index.html +46 -53
- package/app/index.html +92 -64
- package/app/m/ads/AdDeliveryTier/index.html +52 -59
- package/app/m/ads/AdEvent/index.html +52 -59
- package/app/m/ads/AdFormat/index.html +52 -59
- package/app/m/ads/AdGroup/index.html +52 -59
- package/app/m/ads/AdVariation/index.html +52 -59
- package/app/m/analytics/AnalyticsDataStream/index.html +52 -59
- package/app/m/analytics/AnalyticsEvent/index.html +52 -59
- package/app/m/analytics/AnalyticsProperty/index.html +52 -59
- package/app/m/analytics/AnalyticsReport/index.html +52 -59
- package/app/m/approvals/ApprovalEvent/index.html +52 -59
- package/app/m/approvals/ApprovalPolicy/index.html +52 -59
- package/app/m/approvals/ApprovalRequest/index.html +52 -59
- package/app/m/assets/Asset/attachments/index.html +91 -0
- package/app/m/assets/Asset/index.html +52 -59
- package/app/m/assets/AssetAssociation/index.html +53 -60
- package/app/m/assets/AssetMetafield/index.html +52 -59
- package/app/m/assets/AssetStatus/index.html +52 -59
- package/app/m/assets/AssetType/index.html +52 -59
- package/app/m/assets/Folder/index.html +52 -59
- package/app/m/chat/AgentSession/index.html +52 -59
- package/app/m/chat/ChatMessage/index.html +53 -60
- package/app/m/chat/ChatParticipant/index.html +53 -60
- package/app/m/chat/ChatReaction/index.html +52 -59
- package/app/m/chat/ChatRoom/index.html +52 -59
- package/app/m/chat/ChatThread/index.html +53 -60
- package/app/m/chat/VoiceGatewayTurn/index.html +52 -59
- package/app/m/chat/VoiceSession/index.html +52 -59
- package/app/m/commerce/Agreement/index.html +52 -59
- package/app/m/commerce/Cart/index.html +52 -59
- package/app/m/commerce/Contract/index.html +52 -59
- package/app/m/commerce/ContractLineItem/index.html +53 -60
- package/app/m/commerce/Customer/index.html +52 -59
- package/app/m/commerce/DocumentTax/index.html +89 -0
- package/app/m/commerce/Estimate/index.html +52 -59
- package/app/m/commerce/Fulfillment/index.html +52 -59
- package/app/m/commerce/FulfillmentLineItem/index.html +53 -60
- package/app/m/commerce/Invoice/index.html +52 -59
- package/app/m/commerce/InvoiceLineItem/index.html +53 -60
- package/app/m/commerce/Lease/index.html +52 -59
- package/app/m/commerce/LicenseSale/index.html +52 -59
- package/app/m/commerce/Order/index.html +52 -59
- package/app/m/commerce/Payment/index.html +52 -59
- package/app/m/commerce/PaymentAllocation/index.html +53 -60
- package/app/m/commerce/PaymentInstrument/index.html +52 -59
- package/app/m/commerce/PaymentIntent/index.html +52 -59
- package/app/m/commerce/Payout/index.html +52 -59
- package/app/m/commerce/ProductionOrder/index.html +52 -59
- package/app/m/commerce/PurchaseContract/index.html +89 -0
- package/app/m/commerce/PurchaseOrder/index.html +52 -59
- package/app/m/commerce/SalesContract/index.html +89 -0
- package/app/m/commerce/SupplierQuote/index.html +89 -0
- package/app/m/commerce/TaxCode/index.html +89 -0
- package/app/m/commerce/TaxComponent/index.html +89 -0
- package/app/m/commerce/TaxSettings/index.html +89 -0
- package/app/m/commerce/TaxSummaryReport/index.html +89 -0
- package/app/m/commerce/Vendor/index.html +52 -59
- package/app/m/commerce/WholesaleOrder/index.html +52 -59
- package/app/m/content/Content/index.html +52 -59
- package/app/m/content/ContentContribution/index.html +52 -59
- package/app/m/content/ContentContributionAttachment/index.html +52 -59
- package/app/m/content/ContentContributionRevision/index.html +52 -59
- package/app/m/content/ContentContributionType/index.html +52 -59
- package/app/m/content/ContentContributor/index.html +52 -59
- package/app/m/content/ContentCorrection/index.html +52 -59
- package/app/m/content/ContentFeedSource/index.html +52 -59
- package/app/m/content/ContentGovernanceAssignment/index.html +52 -59
- package/app/m/content/ContentGovernancePolicy/index.html +52 -59
- package/app/m/content/ContentGovernanceProfile/index.html +52 -59
- package/app/m/content/ContentReference/index.html +52 -59
- package/app/m/content/ContentReview/index.html +52 -59
- package/app/m/content/ContentVersion/index.html +52 -59
- package/app/m/events/Event/index.html +52 -59
- package/app/m/events/EventParticipant/index.html +53 -60
- package/app/m/events/EventSeries/index.html +52 -59
- package/app/m/events/EventType/index.html +52 -59
- package/app/m/expenses/Expense/index.html +89 -0
- package/app/m/facts/Fact/index.html +52 -59
- package/app/m/facts/FactContent/index.html +52 -59
- package/app/m/facts/FactEvidence/index.html +52 -59
- package/app/m/facts/FactSource/index.html +52 -59
- package/app/m/facts/FactSubject/index.html +52 -59
- package/app/m/facts/FactTag/index.html +52 -59
- package/app/m/fields/FieldPolicy/index.html +52 -59
- package/app/m/fields/FieldPolicySuggestion/index.html +52 -59
- package/app/m/fields/FieldUsageCounter/index.html +52 -59
- package/app/m/images/Image/index.html +52 -59
- package/app/m/inventory/InventoryLocation/index.html +52 -59
- package/app/m/inventory/StockLevel/index.html +52 -59
- package/app/m/inventory/StockMovement/index.html +52 -59
- package/app/m/ledgers/Account/index.html +52 -59
- package/app/m/ledgers/Journal/index.html +52 -59
- package/app/m/ledgers/JournalEntry/index.html +53 -60
- package/app/m/manufacturing/Assembly/index.html +52 -59
- package/app/m/manufacturing/BillOfMaterials/index.html +52 -59
- package/app/m/manufacturing/BomLine/index.html +52 -59
- package/app/m/manufacturing/Operation/index.html +52 -59
- package/app/m/manufacturing/ProductionRun/index.html +52 -59
- package/app/m/manufacturing/ProductionRunCompletion/index.html +52 -59
- package/app/m/manufacturing/RoutingStep/index.html +52 -59
- package/app/m/marketing/Campaign/index.html +52 -59
- package/app/m/marketing/CampaignChannel/index.html +52 -59
- package/app/m/marketing/CampaignMetricSnapshot/index.html +52 -59
- package/app/m/messages/Account/index.html +52 -59
- package/app/m/messages/Attachment/index.html +52 -59
- package/app/m/messages/Blacklist/index.html +52 -59
- package/app/m/messages/Email/failed-sends/index.html +54 -59
- package/app/m/messages/Email/index.html +52 -59
- package/app/m/messages/Email/mailbox/index.html +54 -59
- package/app/m/messages/EmailAccount/index.html +52 -59
- package/app/m/messages/EmailAttachment/index.html +89 -0
- package/app/m/messages/EmailFolder/index.html +52 -59
- package/app/m/messages/Message/index.html +52 -59
- package/app/m/messages/MessagingEndpoint/index.html +52 -59
- package/app/m/messages/PersonaMessageRoute/index.html +52 -59
- package/app/m/messages/SlackAccount/index.html +52 -59
- package/app/m/messages/SlackMessage/index.html +52 -59
- package/app/m/messages/TelegramAccount/index.html +52 -59
- package/app/m/messages/Tweet/index.html +52 -59
- package/app/m/messages/TwitterAccount/index.html +52 -59
- package/app/m/messages/Whitelist/index.html +52 -59
- package/app/m/messages/ZulipAccount/index.html +52 -59
- package/app/m/places/Place/index.html +52 -59
- package/app/m/places/PlaceType/index.html +52 -59
- package/app/m/products/Category/index.html +52 -59
- package/app/m/products/Material/index.html +52 -59
- package/app/m/products/Product/index.html +52 -59
- package/app/m/products/Product/ingredients/index.html +54 -59
- package/app/m/products/ProductVariant/index.html +53 -60
- package/app/m/products/Sku/index.html +53 -60
- package/app/m/profiles/ApiKey/index.html +52 -59
- package/app/m/profiles/Bot/index.html +52 -59
- package/app/m/profiles/MagicLinkToken/index.html +52 -59
- package/app/m/profiles/NostrIdentity/index.html +52 -59
- package/app/m/profiles/OidcIdentity/index.html +52 -59
- package/app/m/profiles/Organization/index.html +52 -59
- package/app/m/profiles/Person/index.html +52 -59
- package/app/m/profiles/Profile/index.html +52 -59
- package/app/m/profiles/ProfileMetadata/index.html +52 -59
- package/app/m/profiles/ProfileMetafield/index.html +52 -59
- package/app/m/profiles/ProfileRelationship/index.html +52 -59
- package/app/m/profiles/ProfileRelationshipTerm/index.html +52 -59
- package/app/m/profiles/ProfileRelationshipType/index.html +52 -59
- package/app/m/profiles/ProfileType/index.html +52 -59
- package/app/m/projects/Comment/index.html +53 -60
- package/app/m/projects/Issue/index.html +52 -59
- package/app/m/projects/Label/index.html +52 -59
- package/app/m/projects/Project/index.html +52 -59
- package/app/m/projects/ProjectIntegration/index.html +52 -59
- package/app/m/projects/PullRequest/index.html +52 -59
- package/app/m/projects/Repository/index.html +52 -59
- package/app/m/properties/Property/index.html +52 -59
- package/app/m/properties/Zone/index.html +52 -59
- package/app/m/reports/RuntimeReport/index.html +52 -59
- package/app/m/reports/SmrtPrincipalReportRefreshTask/index.html +52 -59
- package/app/m/reports/SmrtReportLock/index.html +52 -59
- package/app/m/reports/SmrtReportRefreshTask/index.html +52 -59
- package/app/m/reports/SmrtReportRun/index.html +52 -59
- package/app/m/reports/SmrtReportSchedule/index.html +52 -59
- package/app/m/reports/SmrtReportWatermark/index.html +52 -59
- package/app/m/sales/AttributionException/index.html +52 -59
- package/app/m/sales/AttributionPolicy/index.html +52 -59
- package/app/m/sales/Commission/index.html +52 -59
- package/app/m/sales/CommissionAdjustment/index.html +52 -59
- package/app/m/sales/CommissionPayout/index.html +52 -59
- package/app/m/sales/CommissionPlan/index.html +52 -59
- package/app/m/sales/Earner/index.html +52 -59
- package/app/m/sales/EarnerSourceAttribution/index.html +52 -59
- package/app/m/sales/EarningEvent/index.html +52 -59
- package/app/m/sales/ExecutedAgreement/index.html +52 -59
- package/app/m/sales/Lead/index.html +52 -59
- package/app/m/sales/Opportunity/index.html +52 -59
- package/app/m/sales/OpportunityConversion/index.html +52 -59
- package/app/m/sales/PipelineDefinition/index.html +52 -59
- package/app/m/sales/PipelineStage/index.html +53 -60
- package/app/m/sales/Referral/index.html +52 -59
- package/app/m/sales/ReferralAgreement/index.html +52 -59
- package/app/m/sales/ReferralLink/index.html +52 -59
- package/app/m/sales/ReferralProgram/index.html +52 -59
- package/app/m/sales/ReferralTermSnapshot/index.html +52 -59
- package/app/m/sales/ReferralTouch/index.html +52 -59
- package/app/m/sales/Referrer/index.html +52 -59
- package/app/m/sales/SalesActivity/index.html +52 -59
- package/app/m/sales/SalesRepresentative/index.html +52 -59
- package/app/m/sites/Site/index.html +52 -59
- package/app/m/sites/SiteAgentBinding/index.html +52 -59
- package/app/m/social/OAuthState/index.html +52 -59
- package/app/m/social/SocialAccount/index.html +52 -59
- package/app/m/social/SocialPost/index.html +52 -59
- package/app/m/social/SocialPostAnalyticsSnapshot/index.html +52 -59
- package/app/m/subscriptions/BillingAdjustment/index.html +52 -59
- package/app/m/subscriptions/ClientCharge/index.html +52 -59
- package/app/m/subscriptions/CreditGrant/index.html +52 -59
- package/app/m/subscriptions/PricingRule/index.html +52 -59
- package/app/m/subscriptions/RetailCharge/index.html +52 -59
- package/app/m/subscriptions/SpendingPolicy/index.html +52 -59
- package/app/m/subscriptions/SubscriptionPlan/index.html +52 -59
- package/app/m/subscriptions/TenantSubscription/index.html +52 -59
- package/app/m/subscriptions/TenantUsageMetric/index.html +52 -59
- package/app/m/support/ServiceTimeEntry/index.html +52 -59
- package/app/m/support/SupportAiRun/index.html +52 -59
- package/app/m/support/SupportAvailability/index.html +52 -59
- package/app/m/support/SupportCase/index.html +52 -59
- package/app/m/support/SupportCaseEvent/index.html +52 -59
- package/app/m/support/SupportChannelBinding/index.html +52 -59
- package/app/m/support/SupportCharge/index.html +52 -59
- package/app/m/support/SupportCompensation/index.html +52 -59
- package/app/m/support/SupportCompensationPlan/index.html +52 -59
- package/app/m/support/SupportEscalation/index.html +52 -59
- package/app/m/support/SupportInteraction/index.html +52 -59
- package/app/m/support/SupportPlan/index.html +52 -59
- package/app/m/support/SupportPolicy/index.html +52 -59
- package/app/m/support/SupportQualification/index.html +52 -59
- package/app/m/support/SupportServiceTarget/index.html +52 -59
- package/app/m/support/SupportSpecialist/index.html +52 -59
- package/app/m/support/SupportWorkLink/index.html +52 -59
- package/app/m/tags/Tag/index.html +52 -59
- package/app/m/tags/TagAlias/index.html +52 -59
- package/app/m/timesheets/AttendanceBreak/index.html +52 -59
- package/app/m/timesheets/AttendancePunch/index.html +52 -59
- package/app/m/timesheets/AttendanceSegment/index.html +89 -0
- package/app/m/timesheets/ServiceChargeSnapshot/index.html +52 -59
- package/app/m/timesheets/ServiceCompensationSnapshot/index.html +52 -59
- package/app/m/timesheets/ServiceTimeEntry/index.html +52 -59
- package/app/m/users/Group/index.html +52 -59
- package/app/m/users/GroupMember/index.html +52 -59
- package/app/m/users/GroupRole/index.html +52 -59
- package/app/m/users/Membership/index.html +53 -60
- package/app/m/users/MembershipOverride/index.html +52 -59
- package/app/m/users/Permission/index.html +52 -59
- package/app/m/users/Role/index.html +52 -59
- package/app/m/users/RolePermission/index.html +52 -59
- package/app/m/users/Session/index.html +52 -59
- package/app/m/users/Tenant/index.html +52 -59
- package/app/m/users/TenantIntegration/index.html +52 -59
- package/app/m/users/TenantPermissionOverride/index.html +52 -59
- package/app/m/users/User/index.html +52 -59
- package/app/m/video/Character/index.html +52 -59
- package/app/m/video/CharacterAsset/index.html +52 -59
- package/app/m/video/CompositeJob/index.html +52 -59
- package/app/m/video/Performer/index.html +52 -59
- package/app/m/video/PerformerAsset/index.html +52 -59
- package/app/m/video/Scene/index.html +52 -59
- package/app/m/video/SceneAsset/index.html +52 -59
- package/app/m/video/VideoComposition/index.html +52 -59
- package/app/m/video/VideoCompositionAsset/index.html +52 -59
- package/app/m/video/VideoSequence/index.html +52 -59
- package/app/m/video/VideoSequenceAsset/index.html +52 -59
- package/app/m/video/VideoShot/index.html +52 -59
- package/app/m/video/VideoShotAsset/index.html +52 -59
- package/app/m/video/VideoShotCharacter/index.html +52 -59
- package/app/m/video/VideoWorkflow/index.html +52 -59
- package/app/m/voice/VoiceOutput/index.html +52 -59
- package/app/m/voice/VoiceProfile/index.html +52 -59
- package/app/m/voice/VoiceSample/index.html +52 -59
- package/app/packages/ads/index.html +50 -57
- package/app/packages/analytics/index.html +50 -57
- package/app/packages/approvals/index.html +50 -57
- package/app/packages/assets/index.html +50 -57
- package/app/packages/chat/index.html +50 -57
- package/app/packages/comments/index.html +50 -57
- package/app/packages/commerce/index.html +50 -57
- package/app/packages/content/index.html +50 -57
- package/app/packages/events/index.html +50 -57
- package/app/packages/expenses/index.html +50 -57
- package/app/packages/facts/index.html +50 -57
- package/app/packages/fields/index.html +50 -57
- package/app/packages/human-resources/index.html +50 -57
- package/app/packages/images/index.html +50 -57
- package/app/packages/index.html +49 -55
- package/app/packages/ingestion/index.html +85 -0
- package/app/packages/inventory/index.html +50 -57
- package/app/packages/ledgers/index.html +50 -57
- package/app/packages/manufacturing/index.html +50 -57
- package/app/packages/marketing/index.html +50 -57
- package/app/packages/messages/index.html +50 -57
- package/app/packages/places/index.html +50 -57
- package/app/packages/preferences/index.html +50 -57
- package/app/packages/products/index.html +50 -57
- package/app/packages/profiles/index.html +50 -57
- package/app/packages/projects/index.html +50 -57
- package/app/packages/properties/index.html +50 -57
- package/app/packages/reports/index.html +50 -57
- package/app/packages/sales/index.html +50 -57
- package/app/packages/sites/index.html +50 -57
- package/app/packages/social/index.html +50 -57
- package/app/packages/subscriptions/index.html +50 -57
- package/app/packages/support/index.html +50 -57
- package/app/packages/tags/index.html +50 -57
- package/app/packages/timesheets/index.html +50 -57
- package/app/packages/users/index.html +50 -57
- package/app/packages/video/index.html +50 -57
- package/app/packages/voice/index.html +50 -57
- package/app/packages/webhooks/index.html +85 -0
- package/app/recipes/account-access/help/index.html +52 -57
- package/app/recipes/account-access/index.html +57 -59
- package/app/recipes/activity/help/index.html +52 -57
- package/app/recipes/activity/index.html +57 -59
- package/app/recipes/agreements/help/index.html +52 -57
- package/app/recipes/agreements/index.html +57 -59
- package/app/recipes/analytics.reports/help/index.html +52 -57
- package/app/recipes/analytics.reports/index.html +57 -59
- package/app/recipes/assets/help/index.html +52 -57
- package/app/recipes/assets/index.html +57 -59
- package/app/recipes/billing/help/index.html +52 -57
- package/app/recipes/billing/index.html +57 -59
- package/app/recipes/chat.assistant/help/index.html +52 -57
- package/app/recipes/chat.assistant/index.html +57 -59
- package/app/recipes/comments/help/index.html +52 -57
- package/app/recipes/comments/index.html +57 -59
- package/app/recipes/commerce.customers/help/index.html +52 -57
- package/app/recipes/commerce.customers/index.html +57 -59
- package/app/recipes/commerce.estimates/help/index.html +52 -57
- package/app/recipes/commerce.estimates/index.html +57 -59
- package/app/recipes/commerce.purchases/help/index.html +52 -57
- package/app/recipes/commerce.purchases/index.html +57 -59
- package/app/recipes/commerce.sales/help/index.html +52 -57
- package/app/recipes/commerce.sales/index.html +57 -59
- package/app/recipes/commerce.vendors/help/index.html +52 -57
- package/app/recipes/commerce.vendors/index.html +57 -59
- package/app/recipes/commerce.wholesale/help/index.html +52 -57
- package/app/recipes/commerce.wholesale/index.html +57 -59
- package/app/recipes/events.calendar/help/index.html +52 -57
- package/app/recipes/events.calendar/index.html +57 -59
- package/app/recipes/expenses.tracking/help/index.html +88 -0
- package/app/recipes/expenses.tracking/index.html +92 -0
- package/app/recipes/fields.form-customization/help/index.html +52 -57
- package/app/recipes/fields.form-customization/index.html +57 -59
- package/app/recipes/ingestion/help/index.html +88 -0
- package/app/recipes/ingestion/index.html +93 -0
- package/app/recipes/integrations/help/index.html +88 -0
- package/app/recipes/integrations/index.html +92 -0
- package/app/recipes/inventory.stock/help/index.html +52 -57
- package/app/recipes/inventory.stock/index.html +57 -59
- package/app/recipes/ledgers.bookkeeping/help/index.html +52 -57
- package/app/recipes/ledgers.bookkeeping/index.html +57 -59
- package/app/recipes/messages/help/index.html +52 -57
- package/app/recipes/messages/index.html +57 -59
- package/app/recipes/products/help/index.html +52 -57
- package/app/recipes/products/index.html +57 -59
- package/app/recipes/projects.tracker/help/index.html +52 -57
- package/app/recipes/projects.tracker/index.html +57 -59
- package/app/recipes/reports.materialized/help/index.html +52 -57
- package/app/recipes/reports.materialized/index.html +57 -59
- package/app/recipes/reports.runtime/help/index.html +88 -0
- package/app/recipes/reports.runtime/index.html +92 -0
- package/app/recipes/sales.pipeline/help/index.html +52 -57
- package/app/recipes/sales.pipeline/index.html +57 -59
- package/app/recipes/tags.taxonomy/help/index.html +52 -57
- package/app/recipes/tags.taxonomy/index.html +57 -59
- package/app/recipes/team-collaboration/help/index.html +52 -57
- package/app/recipes/team-collaboration/index.html +57 -59
- package/app/recipes/timesheets.time-entries/help/index.html +88 -0
- package/app/recipes/timesheets.time-entries/index.html +92 -0
- package/app/s/custom-accounts/index.html +82 -0
- package/app/s/custom-appointments/index.html +82 -0
- package/app/s/custom-billing/index.html +47 -54
- package/app/s/custom-buying/index.html +47 -54
- package/app/s/custom-checkout/index.html +82 -0
- package/app/s/custom-classes/index.html +47 -54
- package/app/s/custom-clients/index.html +82 -0
- package/app/s/custom-events/index.html +82 -0
- package/app/s/custom-fleet/index.html +82 -0
- package/app/s/custom-giving/index.html +82 -0
- package/app/s/custom-jobs/index.html +47 -54
- package/app/s/custom-kitchen/index.html +47 -54
- package/app/s/custom-material/index.html +47 -54
- package/app/s/custom-meetings/index.html +82 -0
- package/app/s/custom-members/index.html +47 -54
- package/app/s/custom-parts/index.html +47 -54
- package/app/s/custom-rentals/index.html +82 -0
- package/app/s/custom-roastery/index.html +82 -0
- package/app/s/custom-schedule/index.html +47 -54
- package/app/s/custom-shelf/index.html +82 -0
- package/app/s/custom-shop/index.html +47 -54
- package/app/s/custom-wholesale/index.html +47 -54
- package/app/s/custom-work/index.html +82 -0
- package/app/s/custom-yard/index.html +82 -0
- package/app/s/section-access-control/index.html +47 -54
- package/app/s/section-account-security/index.html +47 -54
- package/app/s/section-accounting/index.html +47 -54
- package/app/s/section-activity/index.html +47 -54
- package/app/s/section-agreements/index.html +47 -54
- package/app/s/section-analytics/index.html +47 -54
- package/app/s/section-assets/index.html +47 -54
- package/app/s/section-billing/index.html +47 -54
- package/app/s/section-calendar/index.html +47 -54
- package/app/s/section-catalog/index.html +47 -54
- package/app/s/section-chat.assistant/index.html +47 -54
- package/app/s/section-comments/index.html +47 -54
- package/app/s/section-fields.form-customization/index.html +47 -54
- package/app/s/section-ingestion/index.html +82 -0
- package/app/s/section-integrations/index.html +82 -0
- package/app/s/section-messages/index.html +47 -54
- package/app/s/section-more/index.html +47 -54
- package/app/s/section-operations/index.html +47 -54
- package/app/s/section-projects/index.html +47 -54
- package/app/s/section-purchasing/index.html +47 -54
- package/app/s/section-reports.materialized/index.html +47 -54
- package/app/s/section-reports.runtime/index.html +82 -0
- package/app/s/section-sales/index.html +47 -54
- package/app/s/section-taxonomy/index.html +47 -54
- package/app/s/section-team/index.html +47 -54
- package/app/s/section-work/index.html +82 -0
- package/dist/ai/state.svelte.d.ts +22 -4
- package/dist/ai/state.svelte.js +78 -15
- package/dist/ai/status.js +8 -0
- package/dist/assistant/change.d.ts +14 -3
- package/dist/assistant/change.js +26 -3
- package/dist/assistant/engine.js +5 -1
- package/dist/assistant/prompt.js +7 -3
- package/dist/assistant/session.svelte.d.ts +1 -0
- package/dist/assistant/session.svelte.js +22 -4
- package/dist/catalog/catalog.json +11244 -14189
- package/dist/catalog/generate/exclusions.d.ts +8 -0
- package/dist/catalog/generate/exclusions.js +29 -0
- package/dist/catalog/generate/extract.js +29 -8
- package/dist/catalog/types.d.ts +7 -0
- package/dist/components/AdvancedStyles.svelte +138 -0
- package/dist/components/AdvancedStyles.svelte.d.ts +6 -0
- package/dist/components/AiModelsPage.svelte +40 -0
- package/dist/components/AiModelsPage.svelte.d.ts +7 -0
- package/dist/components/AiSetup.svelte +40 -8
- package/dist/components/AiStatusIcons.svelte +8 -5
- package/dist/components/AppSettings.svelte +105 -1
- package/dist/components/BrowserAssistant.svelte +25 -22
- package/dist/components/BrowserAssistant.svelte.d.ts +2 -0
- package/dist/components/ChildRecords.svelte +61 -14
- package/dist/components/ChildRecords.svelte.d.ts +1 -0
- package/dist/components/ConnectTools.svelte +5 -2
- package/dist/components/CookbooksPanel.svelte +56 -33
- package/dist/components/CopyButton.svelte +65 -0
- package/dist/components/CopyButton.svelte.d.ts +24 -0
- package/dist/components/ExportPanel.svelte +292 -57
- package/dist/components/ExportPanel.svelte.d.ts +10 -1
- package/dist/components/FeatureCard.svelte +21 -10
- package/dist/components/FeaturesPanel.svelte +4 -1
- package/dist/components/FieldInput.svelte +6 -3
- package/dist/components/FieldMapForm.svelte +6 -10
- package/dist/components/FieldMapForm.svelte.d.ts +1 -0
- package/dist/components/FormWorkspace.svelte +80 -9
- package/dist/components/FormWorkspace.svelte.d.ts +1 -0
- package/dist/components/HeaderIconLink.svelte +86 -0
- package/dist/components/HeaderIconLink.svelte.d.ts +14 -0
- package/dist/components/HelpView.svelte +3 -0
- package/dist/components/ModelOptions.svelte +13 -2
- package/dist/components/ModelPage.svelte +33 -5
- package/dist/components/ModelPage.svelte.d.ts +4 -0
- package/dist/components/ModelWorkspace.svelte +148 -50
- package/dist/components/ModelWorkspace.svelte.d.ts +4 -0
- package/dist/components/PackagePage.svelte +96 -0
- package/dist/components/PackagePage.svelte.d.ts +9 -0
- package/dist/components/ProductMedia.svelte +95 -0
- package/dist/components/ProductMedia.svelte.d.ts +10 -0
- package/dist/components/RecipeCards.svelte +13 -1
- package/dist/components/RecipeHelp.svelte +3 -0
- package/dist/components/RecipeOptions.svelte +13 -1
- package/dist/components/RecordFeatures.svelte +22 -8
- package/dist/components/RecordView.svelte +354 -0
- package/dist/components/RecordView.svelte.d.ts +14 -0
- package/dist/components/RelationField.svelte +5 -2
- package/dist/components/SectionActions.svelte +8 -5
- package/dist/components/SectionHeading.svelte +63 -0
- package/dist/components/SectionHeading.svelte.d.ts +11 -0
- package/dist/components/SectionIcons.svelte +15 -3
- package/dist/components/SectionOverview.svelte +33 -3
- package/dist/components/SectionOverview.svelte.d.ts +4 -0
- package/dist/components/SectionPage.svelte +25 -165
- package/dist/components/SectionView.svelte +172 -0
- package/dist/components/SectionView.svelte.d.ts +18 -0
- package/dist/components/SettingsPanel.svelte +3 -9
- package/dist/components/SettingsPanel.svelte.d.ts +1 -5
- package/dist/components/ThemeBridge.svelte +80 -4
- package/dist/components/ThemeBridge.svelte.d.ts +5 -1
- package/dist/components/ThemeSection.svelte +208 -117
- package/dist/components/ThemeSection.svelte.d.ts +3 -7
- package/dist/components/VariantGridForm.svelte +9 -13
- package/dist/components/VariantGridForm.svelte.d.ts +1 -0
- package/dist/components/VoiceTyping.svelte +3 -0
- package/dist/cookbook/describe.d.ts +29 -0
- package/dist/cookbook/describe.js +164 -0
- package/dist/cookbook/file.d.ts +6 -0
- package/dist/cookbook/file.js +18 -4
- package/dist/cookbook/prompt.d.ts +49 -0
- package/dist/cookbook/prompt.js +100 -0
- package/dist/cookbook/store.svelte.d.ts +13 -0
- package/dist/cookbook/store.svelte.js +36 -8
- package/dist/core/app.d.ts +33 -8
- package/dist/core/app.js +112 -8
- package/dist/core/prompt.js +10 -1
- package/dist/core/reply.d.ts +6 -1
- package/dist/data/children.d.ts +50 -6
- package/dist/data/children.js +146 -16
- package/dist/data/derived.d.ts +37 -29
- package/dist/data/derived.js +49 -30
- package/dist/data/display.d.ts +21 -8
- package/dist/data/display.js +74 -11
- package/dist/data/fakes.d.ts +48 -9
- package/dist/data/fakes.js +146 -22
- package/dist/data/labels.d.ts +7 -2
- package/dist/data/labels.js +12 -2
- package/dist/data/list-sort.d.ts +8 -0
- package/dist/data/list-sort.js +45 -0
- package/dist/data/money.d.ts +227 -0
- package/dist/data/money.js +413 -0
- package/dist/data/packs.d.ts +13 -0
- package/dist/data/packs.js +1224 -0
- package/dist/data/planner-source.js +123 -3
- package/dist/data/source.d.ts +13 -2
- package/dist/data/source.js +274 -40
- package/dist/features/palette.d.ts +2 -0
- package/dist/features/palette.js +1 -1
- package/dist/forms/stock.d.ts +1 -1
- package/dist/forms/stock.js +3 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.js +6 -1
- package/dist/inference/byo.svelte.d.ts +8 -4
- package/dist/inference/byo.svelte.js +36 -8
- package/dist/inference/config.d.ts +12 -5
- package/dist/inference/config.js +96 -40
- package/dist/inference/openai.js +5 -0
- package/dist/kitchen/LiveKitchenBridge.svelte +73 -0
- package/dist/kitchen/LiveKitchenBridge.svelte.d.ts +8 -0
- package/dist/kitchen/client.js +10 -4
- package/dist/kitchen/live.d.ts +7 -0
- package/dist/kitchen/live.js +51 -0
- package/dist/library/icons.js +34 -0
- package/dist/library/library.json +1546 -15
- package/dist/library/pending.json +5 -0
- package/dist/library/types.d.ts +4 -0
- package/dist/motion/tokens.d.ts +6 -0
- package/dist/motion/tokens.js +32 -0
- package/dist/motion/view-transition.d.ts +13 -0
- package/dist/motion/view-transition.js +17 -0
- package/dist/overviews/definitions.d.ts +41 -2
- package/dist/overviews/definitions.js +111 -4
- package/dist/overviews/models.d.ts +10 -0
- package/dist/overviews/models.js +19 -0
- package/dist/overviews/registry.d.ts +92 -5
- package/dist/overviews/registry.js +468 -58
- package/dist/overviews/validate.js +2 -2
- package/dist/planner/Planner.svelte +374 -166
- package/dist/planner/PlannerControls.svelte +255 -0
- package/dist/planner/PlannerControls.svelte.d.ts +17 -0
- package/dist/planner/PlannerLifecycle.svelte +73 -0
- package/dist/planner/PlannerLifecycle.svelte.d.ts +9 -0
- package/dist/planner/app.svelte.d.ts +12 -2
- package/dist/planner/app.svelte.js +13 -3
- package/dist/planner/assistant.js +21 -3
- package/dist/planner/commands/adapter.js +9 -2
- package/dist/planner/commands/types.d.ts +1 -1
- package/dist/planner/commands/types.js +1 -0
- package/dist/planner/header-icons.d.ts +12 -0
- package/dist/planner/header-icons.js +12 -0
- package/dist/planner/host/HostPlanner.svelte +70 -0
- package/dist/planner/host/HostPlanner.svelte.d.ts +17 -0
- package/dist/planner/host/session.svelte.d.ts +28 -0
- package/dist/planner/host/session.svelte.js +186 -0
- package/dist/planner/routes.d.ts +49 -0
- package/dist/planner/routes.js +64 -0
- package/dist/planner/shell.d.ts +40 -0
- package/dist/planner/shell.js +56 -0
- package/dist/planner/tab.svelte.d.ts +6 -3
- package/dist/planner/tab.svelte.js +11 -4
- package/dist/planner/title.d.ts +15 -0
- package/dist/planner/title.js +21 -0
- package/dist/planner/title.svelte.d.ts +6 -0
- package/dist/planner/title.svelte.js +11 -0
- package/dist/planner/types.d.ts +39 -7
- package/dist/products/media.d.ts +20 -0
- package/dist/products/media.js +65 -0
- package/dist/recipes/help/descriptions.json +1 -3
- package/dist/recipes/index.d.ts +2 -0
- package/dist/recipes/index.js +6 -0
- package/dist/recipes/plumbing.d.ts +35 -1
- package/dist/recipes/plumbing.js +74 -0
- package/dist/screens/definition.d.ts +35 -0
- package/dist/screens/definition.js +132 -0
- package/dist/screens/relations.d.ts +17 -0
- package/dist/screens/relations.js +98 -0
- package/dist/screens/totals.d.ts +37 -0
- package/dist/screens/totals.js +65 -0
- package/dist/sections/info.d.ts +1 -1
- package/dist/sections/info.js +2 -2
- package/dist/settings/app-settings.d.ts +17 -1
- package/dist/settings/app-settings.js +40 -3
- package/dist/smrt-version.d.ts +2 -0
- package/dist/smrt-version.js +4 -0
- package/dist/styles/planner-forms.css +53 -0
- package/dist/styles/planner-lists.css +43 -0
- package/dist/theme/css-highlight.d.ts +6 -0
- package/dist/theme/css-highlight.js +34 -0
- package/dist/theme/custom-css.svelte.d.ts +34 -0
- package/dist/theme/custom-css.svelte.js +246 -0
- package/dist/theme/runtime.js +25 -5
- package/dist/theme/theme.d.ts +26 -3
- package/dist/theme/theme.js +70 -2
- package/dist/upstream/overlay.d.ts +14 -5
- package/dist/upstream/overlay.js +20 -2
- package/package.json +13 -6
- package/app/_app/immutable/assets/0.B5zXkXe_.css +0 -1
- package/app/_app/immutable/assets/10.hpcnxvK1.css +0 -1
- package/app/_app/immutable/assets/11.D7zoXfVV.css +0 -1
- package/app/_app/immutable/assets/12.CPobm1ED.css +0 -1
- package/app/_app/immutable/assets/2.CyaWdRdI.css +0 -1
- package/app/_app/immutable/assets/3.BlPQOes8.css +0 -1
- package/app/_app/immutable/assets/8.2gQeKBp_.css +0 -1
- package/app/_app/immutable/assets/9.HOPT4xtg.css +0 -1
- package/app/_app/immutable/assets/AiSetup.Cb22AigN.css +0 -1
- package/app/_app/immutable/assets/Button.DkP0qkG9.css +0 -1
- package/app/_app/immutable/assets/ConnectTools.BgIJOOGW.css +0 -1
- package/app/_app/immutable/assets/FieldMapForm.BCU-4pO4.css +0 -1
- package/app/_app/immutable/assets/ModelPage.Dd3LcMta.css +0 -1
- package/app/_app/immutable/assets/SectionActions.CTkVuNMF.css +0 -1
- package/app/_app/immutable/assets/SectionIcons.5Udq9vN-.css +0 -1
- package/app/_app/immutable/assets/SegmentedControl.B8SrQacd.css +0 -1
- package/app/_app/immutable/assets/dist.C5nHBk_O.css +0 -1
- package/app/_app/immutable/assets/feedback.BVKAwFck.css +0 -1
- package/app/_app/immutable/assets/forms.BChZ2RWM.css +0 -1
- package/app/_app/immutable/assets/percent.LH0z-ozZ.css +0 -1
- package/app/_app/immutable/assets/store.CGDwHkkF.css +0 -1
- package/app/_app/immutable/assets/ui.B1A1Zl2p.css +0 -1
- package/app/_app/immutable/assets/workspace.BIMkuZDb.css +0 -1
- package/app/_app/immutable/chunks/1okeBSoq.js +0 -1
- package/app/_app/immutable/chunks/B32EWqI8.js +0 -9
- package/app/_app/immutable/chunks/B4Kevpe0.js +0 -1
- package/app/_app/immutable/chunks/BKwRT_1p.js +0 -1
- package/app/_app/immutable/chunks/BS4h9ES-.js +0 -1
- package/app/_app/immutable/chunks/BYde9M_U.js +0 -1
- package/app/_app/immutable/chunks/CMhpRMKg.js +0 -1
- package/app/_app/immutable/chunks/CPRHZZeW.js +0 -1
- package/app/_app/immutable/chunks/CRQ1Pmzr.js +0 -1
- package/app/_app/immutable/chunks/CV-2zt0K.js +0 -2
- package/app/_app/immutable/chunks/CWtfVMDz.js +0 -1
- package/app/_app/immutable/chunks/Chyo8rdT.js +0 -3
- package/app/_app/immutable/chunks/CmmuWmp6.js +0 -2
- package/app/_app/immutable/chunks/CrFNLK0f.js +0 -1
- package/app/_app/immutable/chunks/CygC84VT.js +0 -2
- package/app/_app/immutable/chunks/D0VgZnk1.js +0 -1
- package/app/_app/immutable/chunks/DD7gpKb2.js +0 -1
- package/app/_app/immutable/chunks/DJtH-lRi.js +0 -3
- package/app/_app/immutable/chunks/DNRgqfTx.js +0 -1
- package/app/_app/immutable/chunks/DVRKjN-E.js +0 -1
- package/app/_app/immutable/chunks/D_J_XtJy.js +0 -846
- package/app/_app/immutable/chunks/Dp9GVO-9.js +0 -1
- package/app/_app/immutable/chunks/DqcD-WtP.js +0 -1
- package/app/_app/immutable/chunks/OJ_lLTHH.js +0 -1
- package/app/_app/immutable/chunks/QukgIHDX.js +0 -1
- package/app/_app/immutable/chunks/WxSPP8QW.js +0 -4
- package/app/_app/immutable/chunks/leQCwW2d.js +0 -1
- package/app/_app/immutable/chunks/p6bgzXiY.js +0 -1
- package/app/_app/immutable/chunks/ufuM4XBq.js +0 -33
- package/app/_app/immutable/entry/app.D5JJain6.js +0 -2
- package/app/_app/immutable/entry/start.CH9DJLgI.js +0 -1
- package/app/_app/immutable/nodes/0.CL1MxOva.js +0 -10
- package/app/_app/immutable/nodes/1.BO731RRg.js +0 -1
- package/app/_app/immutable/nodes/10.1nQxyH9H.js +0 -4
- package/app/_app/immutable/nodes/11.Cw0JnQF3.js +0 -1
- package/app/_app/immutable/nodes/12.BmZyLHbM.js +0 -1
- package/app/_app/immutable/nodes/2.BEw046av.js +0 -17
- package/app/_app/immutable/nodes/3.DvwpTAQA.js +0 -1
- package/app/_app/immutable/nodes/4.qrT4bnmS.js +0 -1
- package/app/_app/immutable/nodes/5.DDLa2uhV.js +0 -1
- package/app/_app/immutable/nodes/6.DN0QTY6z.js +0 -1
- package/app/_app/immutable/nodes/7.C_8N82Wq.js +0 -1
- package/app/_app/immutable/nodes/8.D2Mszsua.js +0 -3
- package/app/_app/immutable/nodes/9.CLYsywul.js +0 -1
- package/app/m/content/Contents/index.html +0 -96
- package/app/m/preferences/UiPreferenceRecord/index.html +0 -96
- package/app/m/users/AccessRequest/index.html +0 -96
- package/app/m/users/ResourceGrant/index.html +0 -96
- package/app/m/users/UsersCliAuthRequest/index.html +0 -96
- package/app/m/users/UsersMagicLinkToken/index.html +0 -96
package/dist/core/app.js
CHANGED
|
@@ -1,15 +1,119 @@
|
|
|
1
|
+
import { cpSync, existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, renameSync, rmdirSync, rmSync, statSync, writeFileSync, } from 'node:fs';
|
|
2
|
+
import { dirname, relative, resolve, sep } from 'node:path';
|
|
1
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { validateInferenceConfig } from "../inference/config.js";
|
|
5
|
+
import { parseKitchenConfig } from "../kitchen/client.js";
|
|
2
6
|
/**
|
|
3
|
-
* Absolute path of the prerendered
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Node built-ins.
|
|
7
|
-
*
|
|
8
|
-
* Serve the files from here, and write your own `planner.config.json` next to
|
|
9
|
-
* its `index.html` (copy the directory, or answer that one path yourself).
|
|
7
|
+
* Absolute path of the root-built prerendered planner app inside this package.
|
|
8
|
+
* Node only; kept out of `./core` so that entry stays free of Node built-ins.
|
|
9
|
+
* Serve it at `/`, or use `materializeApp` for a supported subpath artifact.
|
|
10
10
|
*/
|
|
11
11
|
export const appDir = fileURLToPath(new URL('../../app/', import.meta.url));
|
|
12
|
-
/** Absolute path of one
|
|
12
|
+
/** Absolute path of one packaged app file, e.g. `appFile('index.html')`. */
|
|
13
13
|
export function appFile(relativePath) {
|
|
14
14
|
return fileURLToPath(new URL(relativePath, new URL('../../app/', import.meta.url)));
|
|
15
15
|
}
|
|
16
|
+
const sensitiveName = /^(?:api[-_]?key|key|token|authorization|secret|password)$/i;
|
|
17
|
+
/** Validate and canonicalize a non-root app mount prefix. */
|
|
18
|
+
export function normalizeAppBasePath(basePath) {
|
|
19
|
+
if (typeof basePath !== 'string' ||
|
|
20
|
+
!/^\/[A-Za-z0-9._~-]+(?:\/[A-Za-z0-9._~-]+)*$/.test(basePath) ||
|
|
21
|
+
basePath.split('/').some((segment) => segment === '.' || segment === '..')) {
|
|
22
|
+
throw new Error('basePath must start with /, contain URL-safe path segments, and have no trailing slash');
|
|
23
|
+
}
|
|
24
|
+
return basePath;
|
|
25
|
+
}
|
|
26
|
+
function assertCredentialFree(value, path = 'config') {
|
|
27
|
+
if (!value || typeof value !== 'object')
|
|
28
|
+
return;
|
|
29
|
+
if (Array.isArray(value)) {
|
|
30
|
+
value.forEach((entry, index) => {
|
|
31
|
+
assertCredentialFree(entry, `${path}[${index}]`);
|
|
32
|
+
});
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
for (const [name, entry] of Object.entries(value)) {
|
|
36
|
+
if (sensitiveName.test(name)) {
|
|
37
|
+
throw new Error(`${path}.${name} is a credential field and cannot be built into the app`);
|
|
38
|
+
}
|
|
39
|
+
assertCredentialFree(entry, `${path}.${name}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** Validate config strictly enough for an immutable public artifact. */
|
|
43
|
+
export function normalizePlannerAppConfig(config) {
|
|
44
|
+
if (!config || typeof config !== 'object' || Array.isArray(config)) {
|
|
45
|
+
throw new Error('config must be an object');
|
|
46
|
+
}
|
|
47
|
+
const unknown = Object.keys(config).filter((name) => name !== 'inference' && name !== 'kitchen');
|
|
48
|
+
if (unknown.length)
|
|
49
|
+
throw new Error(`unknown app config field: ${unknown[0]}`);
|
|
50
|
+
assertCredentialFree(config);
|
|
51
|
+
const inference = validateInferenceConfig({
|
|
52
|
+
inference: config.inference,
|
|
53
|
+
});
|
|
54
|
+
if (inference.notice)
|
|
55
|
+
throw new Error(inference.notice);
|
|
56
|
+
let kitchen;
|
|
57
|
+
if (config.kitchen !== undefined) {
|
|
58
|
+
kitchen = parseKitchenConfig(config.kitchen);
|
|
59
|
+
if (!kitchen) {
|
|
60
|
+
throw new Error('kitchen.endpoint must be a usable http(s) URL');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
inference: inference.config,
|
|
65
|
+
...(kitchen ? { kitchen } : {}),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function patchFallback(file, basePath) {
|
|
69
|
+
const source = readFileSync(file, 'utf8');
|
|
70
|
+
if (!source.includes('/_app/') || !/base:\s*""/.test(source)) {
|
|
71
|
+
throw new Error('packaged 404.html does not match the supported root fallback');
|
|
72
|
+
}
|
|
73
|
+
const patched = source
|
|
74
|
+
.replaceAll('/_app/', `${basePath}/_app/`)
|
|
75
|
+
.replace(/base:\s*""/, `base: ${JSON.stringify(basePath)}`);
|
|
76
|
+
if (patched.includes('"/_app/') || /base:\s*""/.test(patched)) {
|
|
77
|
+
throw new Error('could not make the fallback prefix-safe');
|
|
78
|
+
}
|
|
79
|
+
writeFileSync(file, patched);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Copy the published static app into a deterministic, prefix-safe deployment
|
|
83
|
+
* artifact. The copy is assembled beside `outDir` and renamed only after its
|
|
84
|
+
* fallback and config validate, so callers never receive a partial tree.
|
|
85
|
+
*/
|
|
86
|
+
export function materializeApp(options) {
|
|
87
|
+
const basePath = normalizeAppBasePath(options.basePath);
|
|
88
|
+
const config = normalizePlannerAppConfig(options.config);
|
|
89
|
+
const outDir = resolve(options.outDir);
|
|
90
|
+
const source = resolve(appDir);
|
|
91
|
+
const relation = relative(source, outDir);
|
|
92
|
+
if (!relation || (!relation.startsWith(`..${sep}`) && relation !== '..')) {
|
|
93
|
+
throw new Error('outDir must be outside the packaged app directory');
|
|
94
|
+
}
|
|
95
|
+
if (existsSync(outDir)) {
|
|
96
|
+
if (!statSync(outDir).isDirectory() || readdirSync(outDir).length > 0) {
|
|
97
|
+
throw new Error('outDir must be new or empty');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
mkdirSync(dirname(outDir), { recursive: true });
|
|
101
|
+
const temporary = mkdtempSync(resolve(dirname(outDir), '.smrt-planner-'));
|
|
102
|
+
try {
|
|
103
|
+
cpSync(source, temporary, { recursive: true });
|
|
104
|
+
patchFallback(resolve(temporary, '404.html'), basePath);
|
|
105
|
+
writeFileSync(resolve(temporary, 'planner.config.json'), `${JSON.stringify(config, null, 2)}\n`);
|
|
106
|
+
if (existsSync(outDir))
|
|
107
|
+
rmdirSync(outDir);
|
|
108
|
+
renameSync(temporary, outDir);
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
rmSync(temporary, { recursive: true, force: true });
|
|
112
|
+
throw error;
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
outDir,
|
|
116
|
+
configFile: resolve(outDir, 'planner.config.json'),
|
|
117
|
+
fallbackFile: resolve(outDir, '404.html'),
|
|
118
|
+
};
|
|
119
|
+
}
|
package/dist/core/prompt.js
CHANGED
|
@@ -16,7 +16,7 @@ function indexOf(catalog) {
|
|
|
16
16
|
}
|
|
17
17
|
/** The snapshot's theme as the setting the prompt describes. */
|
|
18
18
|
function themeOf(snapshot) {
|
|
19
|
-
const { preset, primary, colorScheme } = snapshot.theme;
|
|
19
|
+
const { preset, primary, colorScheme, borderRadius, density, contrast } = snapshot.theme;
|
|
20
20
|
const theme = {};
|
|
21
21
|
if (preset)
|
|
22
22
|
theme.preset = preset;
|
|
@@ -25,6 +25,13 @@ function themeOf(snapshot) {
|
|
|
25
25
|
if (colorScheme && colorScheme !== 'system') {
|
|
26
26
|
theme.colorScheme = colorScheme;
|
|
27
27
|
}
|
|
28
|
+
if (borderRadius) {
|
|
29
|
+
theme.borderRadius = borderRadius;
|
|
30
|
+
}
|
|
31
|
+
if (density)
|
|
32
|
+
theme.density = density;
|
|
33
|
+
if (contrast)
|
|
34
|
+
theme.contrast = contrast;
|
|
28
35
|
return Object.keys(theme).length ? theme : undefined;
|
|
29
36
|
}
|
|
30
37
|
/** `rename_item(id, label)`: required inputs bare, optional ones with `?`. */
|
|
@@ -80,6 +87,8 @@ export function buildHostPrompt(input) {
|
|
|
80
87
|
currency: snapshot.settings.currency,
|
|
81
88
|
taxRate: Number((snapshot.settings.taxRate / 100).toFixed(6)),
|
|
82
89
|
paymentTerms: snapshot.settings.paymentTerms,
|
|
90
|
+
pricesIncludeTax: snapshot.settings.pricesIncludeTax,
|
|
91
|
+
taxRounding: snapshot.settings.taxRounding,
|
|
83
92
|
}, matchText(indexOf(catalog), message), { current: themeOf(snapshot) }),
|
|
84
93
|
...commandSection(snapshot),
|
|
85
94
|
].join('\n');
|
package/dist/core/reply.d.ts
CHANGED
|
@@ -18,12 +18,17 @@ export interface HostReply {
|
|
|
18
18
|
currency?: string;
|
|
19
19
|
taxRate?: number;
|
|
20
20
|
paymentTerms?: string;
|
|
21
|
+
pricesIncludeTax?: boolean;
|
|
22
|
+
taxRounding?: 'line' | 'document';
|
|
21
23
|
};
|
|
22
|
-
/** Theme tokens: a preset or `#rrggbb`,
|
|
24
|
+
/** Theme tokens: a preset or `#rrggbb`, light or dark, corner radius, density and contrast. */
|
|
23
25
|
theme?: {
|
|
24
26
|
preset?: string;
|
|
25
27
|
primary?: string;
|
|
26
28
|
colorScheme?: string;
|
|
29
|
+
borderRadius?: string;
|
|
30
|
+
density?: string;
|
|
31
|
+
contrast?: string;
|
|
27
32
|
};
|
|
28
33
|
/** Up to 8 planner commands, run in order by the planner. */
|
|
29
34
|
commands?: {
|
package/dist/data/children.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CatalogModel } from '../catalog/types.ts';
|
|
2
2
|
import { type ModelRecord } from './fakes.ts';
|
|
3
|
+
import { type MoneyContext } from './money.ts';
|
|
3
4
|
/** A child model and the field holding its parent's id (see `childLinks`). */
|
|
4
5
|
export interface ChildOf {
|
|
5
6
|
model: CatalogModel;
|
|
@@ -9,12 +10,55 @@ export interface ChildOf {
|
|
|
9
10
|
* Sample child rows for one parent record: one to four (journals, an even
|
|
10
11
|
* number of balanced entries), each pointing at the parent through `fk`. Ids
|
|
11
12
|
* and values are seeded from the parent's id, so the same parent always gets
|
|
12
|
-
* the same children. A line
|
|
13
|
-
*
|
|
13
|
+
* the same children. A line's money (`amount`, `taxAmount`, its tax code's
|
|
14
|
+
* snapshot) is settled with its document's other lines (`settleSample`).
|
|
14
15
|
*/
|
|
15
|
-
export declare function fakeChildrenOf(child: CatalogModel, fk: string, parent: ModelRecord, seed: number): ModelRecord[];
|
|
16
|
+
export declare function fakeChildrenOf(child: CatalogModel, fk: string, parent: ModelRecord, seed: number, rows?: number): ModelRecord[];
|
|
17
|
+
/** Does a sample document give a discount (about one in three, by its id)? */
|
|
18
|
+
export declare function discounted(parent: {
|
|
19
|
+
id: string;
|
|
20
|
+
}): boolean;
|
|
16
21
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
22
|
+
* Does a sample line carry its own tax code (`taxMode: 'override'`), about one
|
|
23
|
+
* line in seven by its document and position, never a document's first line?
|
|
19
24
|
*/
|
|
20
|
-
export declare function
|
|
25
|
+
export declare function overridesTax(parent: {
|
|
26
|
+
id: string;
|
|
27
|
+
}, index: number): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The code an overriding sample line chooses, by line: in an app whose
|
|
30
|
+
* currency an example-pack code names, that code half the time (BC GST + PST
|
|
31
|
+
* for CAD, so its components show apart); otherwise exempt or zero-rated.
|
|
32
|
+
*/
|
|
33
|
+
export declare function overrideTaxCode(parent: {
|
|
34
|
+
id: string;
|
|
35
|
+
}, index: number, currency?: string): import("./money.ts").SampleTaxCode | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* A sample line once the app's hidden fields' values are applied (`carried`):
|
|
38
|
+
* where the app hides the line's `discount`, an amount discount could not be
|
|
39
|
+
* seen or entered, so the line takes its tenth off as a percentage instead,
|
|
40
|
+
* and where it hides `discountRate` too, the line has no discount.
|
|
41
|
+
*/
|
|
42
|
+
export declare function withCarried(item: ModelRecord, carried: Readonly<Record<string, unknown>>): ModelRecord;
|
|
43
|
+
/**
|
|
44
|
+
* The sample documents whose stored totals deliberately disagree with their
|
|
45
|
+
* lines, so the record page's mismatch flag has something to show: the third
|
|
46
|
+
* Order and the third Invoice (row index 2), drafts whose subtotal and total
|
|
47
|
+
* were left stale by an edit made elsewhere. Only a draft's totals are read
|
|
48
|
+
* against its lines (an issued document shows its frozen figures as they
|
|
49
|
+
* are), so these two are drafts. Their own fields stay authoritative; the
|
|
50
|
+
* page only flags the difference. Editing a line recomputes the totals and
|
|
51
|
+
* clears it.
|
|
52
|
+
*/
|
|
53
|
+
export declare const MISMATCH_MODELS: readonly string[];
|
|
54
|
+
export declare const MISMATCH_ROW = 2;
|
|
55
|
+
/** What the stale total is off by, in minor units. */
|
|
56
|
+
export declare const MISMATCH_AMOUNT = 2500;
|
|
57
|
+
/** Leave one document's total stale (see {@link MISMATCH_MODELS}). */
|
|
58
|
+
export declare function seedMismatch(parent: ModelRecord, parentModel: CatalogModel, index: number): void;
|
|
59
|
+
/**
|
|
60
|
+
* Settle the line items just generated for a parent with it (see
|
|
61
|
+
* `settleWithLines`): the parent's totals are set in place and the settled
|
|
62
|
+
* lines returned.
|
|
63
|
+
*/
|
|
64
|
+
export declare function settleSample(parent: ModelRecord, parentModel: CatalogModel, items: readonly ModelRecord[], context: MoneyContext): ModelRecord[];
|
package/dist/data/children.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { isLineModel,
|
|
2
|
-
import { createRandom, fakeId, fakeRecord, hashString, packLine, } from "./fakes.js";
|
|
3
|
-
import {
|
|
1
|
+
import { isLineModel, lineAmount, settleWithLines } from "./derived.js";
|
|
2
|
+
import { createRandom, fakeId, fakeRecord, hashString, packLine, relatedIndex, } from "./fakes.js";
|
|
3
|
+
import { examplePackCodeFor, SEEDED_TAX_CODES, } from "./money.js";
|
|
4
|
+
import { getSamplePack, getSamplePricing } from "./packs.js";
|
|
4
5
|
const MAX_CHILDREN = 4;
|
|
5
6
|
const hasField = (model, name) => model.fields.some((f) => f.name === name);
|
|
6
7
|
/**
|
|
7
8
|
* Sample child rows for one parent record: one to four (journals, an even
|
|
8
9
|
* number of balanced entries), each pointing at the parent through `fk`. Ids
|
|
9
10
|
* and values are seeded from the parent's id, so the same parent always gets
|
|
10
|
-
* the same children. A line
|
|
11
|
-
*
|
|
11
|
+
* the same children. A line's money (`amount`, `taxAmount`, its tax code's
|
|
12
|
+
* snapshot) is settled with its document's other lines (`settleSample`).
|
|
12
13
|
*/
|
|
13
|
-
export function fakeChildrenOf(child, fk, parent, seed) {
|
|
14
|
+
export function fakeChildrenOf(child, fk, parent, seed, rows) {
|
|
14
15
|
const random = createRandom(hashString(`${seed}:${child.id}:${parent.id}`));
|
|
15
16
|
const ledger = hasField(child, 'debit') && hasField(child, 'credit');
|
|
16
17
|
const count = ledger
|
|
@@ -21,7 +22,7 @@ export function fakeChildrenOf(child, fk, parent, seed) {
|
|
|
21
22
|
return Array.from({ length: count }, (_, i) => {
|
|
22
23
|
const index = hashString(`${parent.id}:${i}`) % 997;
|
|
23
24
|
const record = {
|
|
24
|
-
...fakeRecord(child, index, seed),
|
|
25
|
+
...fakeRecord(child, index, seed, rows),
|
|
25
26
|
id: fakeId(`${child.id}:${parent.id}:${i}`),
|
|
26
27
|
[fk]: parent.id,
|
|
27
28
|
};
|
|
@@ -32,7 +33,11 @@ export function fakeChildrenOf(child, fk, parent, seed) {
|
|
|
32
33
|
const productField = child.fields.find((f) => f.related?.endsWith(':Product') && f.name in record);
|
|
33
34
|
const pack = getSamplePack();
|
|
34
35
|
const { products } = pack;
|
|
35
|
-
|
|
36
|
+
// The same row the line's `productId` was pointed at (`relatedIndex`).
|
|
37
|
+
const item = productField
|
|
38
|
+
? products[relatedIndex(productField, { modelId: child.id, index, rows }) %
|
|
39
|
+
products.length]
|
|
40
|
+
: products[index % products.length];
|
|
36
41
|
const described = packLine(index);
|
|
37
42
|
if (described) {
|
|
38
43
|
// Labour and fabrication are not products: no product to point at.
|
|
@@ -57,9 +62,8 @@ export function fakeChildrenOf(child, fk, parent, seed) {
|
|
|
57
62
|
const quantity = low + Math.floor(random() * (high - low + 1));
|
|
58
63
|
if (hasField(child, 'quantity'))
|
|
59
64
|
record.quantity = quantity;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
record.amount = settleLine(record).amount;
|
|
65
|
+
Object.assign(record, sampleLineMoney(child, parent, i, quantity, Number(record.unitPrice ?? 0)));
|
|
66
|
+
record.amount = lineAmount(record);
|
|
63
67
|
}
|
|
64
68
|
if (ledger) {
|
|
65
69
|
const debit = i % 2 === 0;
|
|
@@ -69,12 +73,138 @@ export function fakeChildrenOf(child, fk, parent, seed) {
|
|
|
69
73
|
return record;
|
|
70
74
|
});
|
|
71
75
|
}
|
|
76
|
+
/** Does a sample document give a discount (about one in three, by its id)? */
|
|
77
|
+
export function discounted(parent) {
|
|
78
|
+
return hashString(`discount:${parent.id}`) % 3 === 0;
|
|
79
|
+
}
|
|
80
|
+
/** A tenth off the line's price, in whole currency units. */
|
|
81
|
+
function lineDiscount(quantity, unitPrice) {
|
|
82
|
+
return Math.round((quantity * unitPrice) / 1000) * 100;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Does a sample line carry its own tax code (`taxMode: 'override'`), about one
|
|
86
|
+
* line in seven by its document and position, never a document's first line?
|
|
87
|
+
*/
|
|
88
|
+
export function overridesTax(parent, index) {
|
|
89
|
+
return (index > 0 && hashString(`tax-override:${parent.id}:${index}`) % 7 === 0);
|
|
90
|
+
}
|
|
72
91
|
/**
|
|
73
|
-
*
|
|
74
|
-
* (
|
|
92
|
+
* The code an overriding sample line chooses, by line: in an app whose
|
|
93
|
+
* currency an example-pack code names, that code half the time (BC GST + PST
|
|
94
|
+
* for CAD, so its components show apart); otherwise exempt or zero-rated.
|
|
75
95
|
*/
|
|
76
|
-
export function
|
|
77
|
-
|
|
96
|
+
export function overrideTaxCode(parent, index, currency = getSamplePricing().currency) {
|
|
97
|
+
const draw = hashString(`tax-override-kind:${parent.id}:${index}`) % 4;
|
|
98
|
+
const pack = examplePackCodeFor(currency);
|
|
99
|
+
if (pack && draw < 2)
|
|
100
|
+
return pack;
|
|
101
|
+
const kind = draw % 2 === 0 ? 'exempt' : 'zero-rated';
|
|
102
|
+
return SEEDED_TAX_CODES.find((c) => c.kind === kind);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The money inputs of a sample line, for the fields the line has: a
|
|
106
|
+
* discounted document's first line takes a tenth off, as a percentage
|
|
107
|
+
* (`discountType: 'percent'`, `discountRate: '10'`) or a whole-unit amount
|
|
108
|
+
* (`'amount'`, `discount` in minor units), alternating by document; a few
|
|
109
|
+
* lines carry a tax code of their own (`overrideTaxCode`); every other line
|
|
110
|
+
* inherits its code. What the line then comes to is the document's to settle.
|
|
111
|
+
*/
|
|
112
|
+
function sampleLineMoney(child, parent, index, quantity, unitPrice) {
|
|
113
|
+
const money = {};
|
|
114
|
+
const discount = index === 0 && discounted(parent);
|
|
115
|
+
const percent = hashString(`discount-kind:${parent.id}`) % 2 === 0;
|
|
116
|
+
if (hasField(child, 'discountType')) {
|
|
117
|
+
money.discountType = discount ? (percent ? 'percent' : 'amount') : 'none';
|
|
118
|
+
}
|
|
119
|
+
if (hasField(child, 'discountRate')) {
|
|
120
|
+
money.discountRate = discount && percent ? '10' : null;
|
|
121
|
+
}
|
|
122
|
+
if (hasField(child, 'discount')) {
|
|
123
|
+
money.discount =
|
|
124
|
+
discount && !(percent && hasField(child, 'discountType'))
|
|
125
|
+
? lineDiscount(quantity, unitPrice)
|
|
126
|
+
: 0;
|
|
127
|
+
}
|
|
128
|
+
// A line with a `discount` but no `discountType` field cannot say which
|
|
129
|
+
// kind it is: an amount is the only one the model can read from it.
|
|
130
|
+
if (!hasField(child, 'discountType') && money.discount) {
|
|
131
|
+
money.discountType = 'amount';
|
|
132
|
+
}
|
|
133
|
+
const override = overridesTax(parent, index)
|
|
134
|
+
? overrideTaxCode(parent, index)
|
|
135
|
+
: undefined;
|
|
136
|
+
if (hasField(child, 'taxMode')) {
|
|
137
|
+
money.taxMode = override ? 'override' : 'inherit';
|
|
138
|
+
}
|
|
139
|
+
if (hasField(child, 'taxCodeId'))
|
|
140
|
+
money.taxCodeId = override?.id ?? null;
|
|
141
|
+
return money;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* A sample line once the app's hidden fields' values are applied (`carried`):
|
|
145
|
+
* where the app hides the line's `discount`, an amount discount could not be
|
|
146
|
+
* seen or entered, so the line takes its tenth off as a percentage instead,
|
|
147
|
+
* and where it hides `discountRate` too, the line has no discount.
|
|
148
|
+
*/
|
|
149
|
+
export function withCarried(item, carried) {
|
|
150
|
+
const next = { ...item, ...carried };
|
|
151
|
+
if ('discount' in carried &&
|
|
152
|
+
!('discountType' in carried) &&
|
|
153
|
+
next.discountType === 'amount') {
|
|
154
|
+
next.discountType = 'percent';
|
|
155
|
+
next.discountRate = '10';
|
|
156
|
+
next.discount = 0;
|
|
157
|
+
}
|
|
158
|
+
// Neither kind can be seen: no discount at all.
|
|
159
|
+
if ('discountRate' in carried && next.discountType === 'percent') {
|
|
160
|
+
next.discountType = 'none';
|
|
161
|
+
next.discountRate = null;
|
|
162
|
+
next.discount = 0;
|
|
163
|
+
}
|
|
164
|
+
return next;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* The sample documents whose stored totals deliberately disagree with their
|
|
168
|
+
* lines, so the record page's mismatch flag has something to show: the third
|
|
169
|
+
* Order and the third Invoice (row index 2), drafts whose subtotal and total
|
|
170
|
+
* were left stale by an edit made elsewhere. Only a draft's totals are read
|
|
171
|
+
* against its lines (an issued document shows its frozen figures as they
|
|
172
|
+
* are), so these two are drafts. Their own fields stay authoritative; the
|
|
173
|
+
* page only flags the difference. Editing a line recomputes the totals and
|
|
174
|
+
* clears it.
|
|
175
|
+
*/
|
|
176
|
+
export const MISMATCH_MODELS = [
|
|
177
|
+
'@happyvertical/smrt-commerce:Order',
|
|
178
|
+
'@happyvertical/smrt-commerce:Invoice',
|
|
179
|
+
];
|
|
180
|
+
export const MISMATCH_ROW = 2;
|
|
181
|
+
/** What the stale total is off by, in minor units. */
|
|
182
|
+
export const MISMATCH_AMOUNT = 2500;
|
|
183
|
+
/** Leave one document's total stale (see {@link MISMATCH_MODELS}). */
|
|
184
|
+
export function seedMismatch(parent, parentModel, index) {
|
|
185
|
+
if (index !== MISMATCH_ROW ||
|
|
186
|
+
!MISMATCH_MODELS.includes(parentModel.id) ||
|
|
187
|
+
typeof parent.subtotal !== 'number' ||
|
|
188
|
+
typeof parent.totalAmount !== 'number') {
|
|
78
189
|
return;
|
|
79
|
-
|
|
190
|
+
}
|
|
191
|
+
if (parentModel.fields.some((f) => f.name === 'status' && f.enum?.includes('draft'))) {
|
|
192
|
+
parent.status = 'draft';
|
|
193
|
+
}
|
|
194
|
+
// Stale but self-consistent: subtotal and total moved together.
|
|
195
|
+
parent.subtotal += MISMATCH_AMOUNT;
|
|
196
|
+
parent.totalAmount += MISMATCH_AMOUNT;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Settle the line items just generated for a parent with it (see
|
|
200
|
+
* `settleWithLines`): the parent's totals are set in place and the settled
|
|
201
|
+
* lines returned.
|
|
202
|
+
*/
|
|
203
|
+
export function settleSample(parent, parentModel, items, context) {
|
|
204
|
+
if (!items.length || !items.every((r) => 'unitPrice' in r)) {
|
|
205
|
+
return [...items];
|
|
206
|
+
}
|
|
207
|
+
const settled = settleWithLines(parentModel, parent, items, context);
|
|
208
|
+
Object.assign(parent, settled.row);
|
|
209
|
+
return settled.lines;
|
|
80
210
|
}
|
package/dist/data/derived.d.ts
CHANGED
|
@@ -1,37 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Amounts
|
|
3
|
-
*
|
|
2
|
+
* Amounts a document's lines derive rather than take as input, on
|
|
3
|
+
* smrt-commerce's money model (released in 0.56.1; `money.ts` holds the
|
|
4
|
+
* mapping to the package's own calculator):
|
|
4
5
|
*
|
|
5
|
-
* line
|
|
6
|
-
*
|
|
7
|
-
* line
|
|
6
|
+
* line amount = quantity x unitPrice - discount
|
|
7
|
+
* (prices without tax: the line's net; with tax: its gross)
|
|
8
|
+
* line tax = from the line's resolved tax code, per component
|
|
9
|
+
* subtotal = sum of the lines' net
|
|
10
|
+
* taxAmount = sum of the lines' tax
|
|
11
|
+
* totalAmount = subtotal + taxAmount
|
|
12
|
+
* discountTotal = sum of the lines' discounts, informational: already
|
|
13
|
+
* inside the line amounts, never subtracted again
|
|
8
14
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
15
|
+
* A parent with line items takes these from its lines, ignoring what a form
|
|
16
|
+
* sent. See AGENTS.md.
|
|
11
17
|
*/
|
|
12
18
|
import type { CatalogModel } from '../catalog/types.ts';
|
|
19
|
+
import { type LineAmountType, type MoneyContext, type SettledDocument, type TaxRoundingScope } from './money.ts';
|
|
20
|
+
export { lineAmount } from './money.ts';
|
|
13
21
|
type Row = Readonly<Record<string, unknown>>;
|
|
14
22
|
/** A line item: it prices a quantity of something. */
|
|
15
23
|
export declare function isLineModel(model: CatalogModel): boolean;
|
|
16
|
-
|
|
17
|
-
subtotal: number;
|
|
18
|
-
tax: number;
|
|
19
|
-
amount: number;
|
|
20
|
-
}
|
|
21
|
-
export declare function lineAmounts(line: Row): LineAmounts;
|
|
22
|
-
/** The line with its `amount` brought in line with its other fields. */
|
|
23
|
-
export declare function settleLine<T extends Row>(line: T): T & {
|
|
24
|
-
amount: number;
|
|
25
|
-
};
|
|
26
|
-
export interface ParentTotals {
|
|
27
|
-
subtotal: number;
|
|
28
|
-
taxAmount: number;
|
|
29
|
-
totalAmount: number;
|
|
30
|
-
}
|
|
31
|
-
export declare function totalsOf(lines: readonly Row[]): ParentTotals;
|
|
24
|
+
/** The totals a document's summary shows: subtotal, tax, total. */
|
|
32
25
|
export declare const TOTAL_FIELDS: readonly ["subtotal", "taxAmount", "totalAmount"];
|
|
33
|
-
/**
|
|
34
|
-
export declare
|
|
26
|
+
/** Every header field its lines decide, `discountTotal` included. */
|
|
27
|
+
export declare const DOCUMENT_MONEY_FIELDS: readonly ["subtotal", "taxAmount", "totalAmount", "discountTotal"];
|
|
28
|
+
/** The fields of a line its document's calculation writes. */
|
|
29
|
+
export declare const LINE_MONEY_FIELDS: readonly ["amount", "taxAmount", "taxRate", "taxCodeCode", "taxCodeName"];
|
|
30
|
+
/** The document's own pricing mode, else `fallback` (the app's). */
|
|
31
|
+
export declare function documentLineAmountType(row: Row, fallback: LineAmountType): LineAmountType;
|
|
32
|
+
/** The document's own rounding scope, else `fallback` (the app's). */
|
|
33
|
+
export declare function documentRoundingScope(row: Row, fallback: TaxRoundingScope): TaxRoundingScope;
|
|
34
|
+
/**
|
|
35
|
+
* `row` and its `lines` settled together: the lines' derived fields, and the
|
|
36
|
+
* model's header money fields (`subtotal`, `discountTotal`, `taxAmount`,
|
|
37
|
+
* `totalAmount`, where the model has them).
|
|
38
|
+
*/
|
|
39
|
+
export declare function settleWithLines<T extends Record<string, unknown>, L extends Row>(model: CatalogModel, row: T, lines: readonly L[], context: MoneyContext): {
|
|
40
|
+
row: T;
|
|
41
|
+
lines: SettledDocument<L>['lines'];
|
|
42
|
+
};
|
|
35
43
|
/** A record that tracks what has been paid against it (an Invoice). */
|
|
36
44
|
export declare function tracksPayments(model: CatalogModel): boolean;
|
|
37
45
|
/** The field of a payment allocation that points at its payment. */
|
|
@@ -59,9 +67,10 @@ export declare function settleInvoice(invoice: Row, counted: readonly {
|
|
|
59
67
|
at: string;
|
|
60
68
|
}[], now: number): Settlement;
|
|
61
69
|
/**
|
|
62
|
-
* The fields a form shows but does not let anyone type: a line's
|
|
63
|
-
*
|
|
64
|
-
* when) when it has payment
|
|
70
|
+
* The fields a form shows but does not let anyone type: a line's money (its
|
|
71
|
+
* amount, tax and the tax code's snapshot), a parent's totals when it has line
|
|
72
|
+
* items, and what an invoice has paid (and when) when it has payment
|
|
73
|
+
* allocations.
|
|
65
74
|
*/
|
|
66
75
|
export declare function derivedFieldNames(model: CatalogModel, hasLineChildren: boolean, hasPaymentChildren?: boolean): ReadonlySet<string>;
|
|
67
76
|
/** Does the field of a line item point at a product? */
|
|
@@ -76,4 +85,3 @@ export declare function isProductField(field: {
|
|
|
76
85
|
* editable. A product with no name or price fills nothing.
|
|
77
86
|
*/
|
|
78
87
|
export declare function productPrefill(line: CatalogModel, product: Row | undefined): Record<string, unknown>;
|
|
79
|
-
export {};
|
package/dist/data/derived.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { settleDocument, } from "./money.js";
|
|
2
|
+
export { lineAmount } from "./money.js";
|
|
1
3
|
const num = (value) => {
|
|
2
4
|
const n = Number(value ?? 0);
|
|
3
5
|
return Number.isFinite(n) ? n : 0;
|
|
@@ -7,35 +9,47 @@ const has = (model, name) => model.fields.some((f) => f.name === name);
|
|
|
7
9
|
export function isLineModel(model) {
|
|
8
10
|
return ['quantity', 'unitPrice', 'amount'].every((n) => has(model, n));
|
|
9
11
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
/** The totals a document's summary shows: subtotal, tax, total. */
|
|
13
|
+
export const TOTAL_FIELDS = ['subtotal', 'taxAmount', 'totalAmount'];
|
|
14
|
+
/** Every header field its lines decide, `discountTotal` included. */
|
|
15
|
+
export const DOCUMENT_MONEY_FIELDS = [
|
|
16
|
+
...TOTAL_FIELDS,
|
|
17
|
+
'discountTotal',
|
|
18
|
+
];
|
|
19
|
+
/** The fields of a line its document's calculation writes. */
|
|
20
|
+
export const LINE_MONEY_FIELDS = [
|
|
21
|
+
'amount',
|
|
22
|
+
'taxAmount',
|
|
23
|
+
'taxRate',
|
|
24
|
+
'taxCodeCode',
|
|
25
|
+
'taxCodeName',
|
|
26
|
+
];
|
|
27
|
+
const LINE_AMOUNT_TYPES = ['exclusive', 'inclusive', 'none'];
|
|
28
|
+
/** The document's own pricing mode, else `fallback` (the app's). */
|
|
29
|
+
export function documentLineAmountType(row, fallback) {
|
|
30
|
+
const value = row.lineAmountType;
|
|
31
|
+
return typeof value === 'string' && LINE_AMOUNT_TYPES.includes(value)
|
|
32
|
+
? value
|
|
33
|
+
: fallback;
|
|
18
34
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const parts = lineAmounts(line);
|
|
24
|
-
subtotal += parts.subtotal;
|
|
25
|
-
taxAmount += parts.tax;
|
|
26
|
-
}
|
|
27
|
-
return { subtotal, taxAmount, totalAmount: subtotal + taxAmount };
|
|
35
|
+
/** The document's own rounding scope, else `fallback` (the app's). */
|
|
36
|
+
export function documentRoundingScope(row, fallback) {
|
|
37
|
+
const value = row.taxRoundingScope;
|
|
38
|
+
return value === 'line' || value === 'document' ? value : fallback;
|
|
28
39
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
/**
|
|
41
|
+
* `row` and its `lines` settled together: the lines' derived fields, and the
|
|
42
|
+
* model's header money fields (`subtotal`, `discountTotal`, `taxAmount`,
|
|
43
|
+
* `totalAmount`, where the model has them).
|
|
44
|
+
*/
|
|
45
|
+
export function settleWithLines(model, row, lines, context) {
|
|
46
|
+
const settled = settleDocument(lines, context);
|
|
33
47
|
const next = { ...row };
|
|
34
|
-
for (const name of
|
|
48
|
+
for (const name of DOCUMENT_MONEY_FIELDS) {
|
|
35
49
|
if (has(model, name))
|
|
36
|
-
next[name] =
|
|
50
|
+
next[name] = settled[name];
|
|
37
51
|
}
|
|
38
|
-
return next;
|
|
52
|
+
return { row: next, lines: settled.lines };
|
|
39
53
|
}
|
|
40
54
|
/** A record that tracks what has been paid against it (an Invoice). */
|
|
41
55
|
export function tracksPayments(model) {
|
|
@@ -91,18 +105,23 @@ export function settleInvoice(invoice, counted, now) {
|
|
|
91
105
|
};
|
|
92
106
|
}
|
|
93
107
|
/**
|
|
94
|
-
* The fields a form shows but does not let anyone type: a line's
|
|
95
|
-
*
|
|
96
|
-
* when) when it has payment
|
|
108
|
+
* The fields a form shows but does not let anyone type: a line's money (its
|
|
109
|
+
* amount, tax and the tax code's snapshot), a parent's totals when it has line
|
|
110
|
+
* items, and what an invoice has paid (and when) when it has payment
|
|
111
|
+
* allocations.
|
|
97
112
|
*/
|
|
98
113
|
export function derivedFieldNames(model, hasLineChildren, hasPaymentChildren = false) {
|
|
99
114
|
const names = new Set();
|
|
100
|
-
if (isLineModel(model))
|
|
101
|
-
|
|
115
|
+
if (isLineModel(model)) {
|
|
116
|
+
for (const name of LINE_MONEY_FIELDS)
|
|
117
|
+
if (has(model, name))
|
|
118
|
+
names.add(name);
|
|
119
|
+
}
|
|
102
120
|
if (hasLineChildren) {
|
|
103
|
-
for (const name of
|
|
121
|
+
for (const name of DOCUMENT_MONEY_FIELDS) {
|
|
104
122
|
if (has(model, name))
|
|
105
123
|
names.add(name);
|
|
124
|
+
}
|
|
106
125
|
}
|
|
107
126
|
if (hasPaymentChildren && tracksPayments(model)) {
|
|
108
127
|
for (const name of ['amountPaid', 'paidDate']) {
|