@jsb188/mday 1.1.10 → 1.1.12
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/package.json +140 -54
- package/src/constants/agentMemory.ts +123 -0
- package/src/constants/agentNote.ts +212 -0
- package/src/constants/aiChat.ts +10 -0
- package/src/constants/billing.ts +126 -0
- package/src/constants/campaign.ts +236 -0
- package/src/constants/contact.ts +72 -0
- package/src/constants/csvExport.ts +133 -0
- package/src/constants/dataTable.ts +21 -21
- package/src/constants/dataTableFieldTypes.generated.ts +59 -0
- package/src/constants/docAccess.ts +33 -0
- package/src/constants/dt.ts +234 -0
- package/src/constants/email.ts +125 -7
- package/src/constants/fieldDoc.ts +104 -0
- package/src/constants/graphqlReactivity.ts +196 -0
- package/src/constants/integration.ts +8 -9
- package/src/constants/log.ts +14 -408
- package/src/constants/logDisplay/README.md +88 -0
- package/src/constants/logDisplay/defaults.ts +39 -0
- package/src/constants/logDisplay/index.ts +27 -0
- package/src/constants/logDisplay/operations/arable.ts +16 -0
- package/src/constants/logDisplay/operations/farmersMarket.ts +10 -0
- package/src/constants/logDisplay/operations/foodManufacturing.ts +13 -0
- package/src/constants/logDisplay/shared/accounting.ts +13 -0
- package/src/constants/logDisplay/shared/interactions.ts +13 -0
- package/src/constants/logDisplay/shared/rackTemperatures.ts +42 -0
- package/src/constants/logTaxonomy.generated.ts +2207 -0
- package/src/constants/noteDoc.ts +77 -0
- package/src/constants/organization.ts +18 -21
- package/src/constants/pageRoute.ts +23 -0
- package/src/constants/qrCode.ts +30 -0
- package/src/constants/sheet.ts +126 -14
- package/src/constants/sms.ts +18 -0
- package/src/constants/square.ts +6 -6
- package/src/constants/storage.ts +80 -7
- package/src/constants/usage.ts +82 -0
- package/src/constants/workflowSteps.ts +60 -0
- package/src/schemas/editLogEntry.ts +836 -780
- package/src/schemas/inboundContact.ts +60 -55
- package/src/schemas/logsQuery.ts +55 -49
- package/src/types/account.d.ts +4 -1
- package/src/types/agentMemory.d.ts +98 -0
- package/src/types/agentNote.d.ts +443 -0
- package/src/types/billing.d.ts +537 -0
- package/src/types/campaign.d.ts +1533 -0
- package/src/types/contact.d.ts +15 -0
- package/src/types/csvExport.d.ts +213 -0
- package/src/types/dataAnalysis.d.ts +44 -0
- package/src/types/dataTable.d.ts +115 -403
- package/src/types/definitionElement.d.ts +35 -0
- package/src/types/docAccess.d.ts +96 -0
- package/src/types/dt.d.ts +257 -0
- package/src/types/email.d.ts +184 -24
- package/src/types/emailReplyReport.d.ts +76 -0
- package/src/types/fieldDoc.d.ts +702 -0
- package/src/types/fieldDocContract.d.ts +90 -0
- package/src/types/inboundContact.d.ts +10 -1
- package/src/types/log.d.ts +254 -295
- package/src/types/logDisplay.types.ts +85 -0
- package/src/types/organization.d.ts +91 -43
- package/src/types/pageRoute.d.ts +48 -0
- package/src/types/qrCode.d.ts +96 -0
- package/src/types/richText.d.ts +81 -0
- package/src/types/sheet.d.ts +678 -129
- package/src/types/sms.d.ts +38 -0
- package/src/types/storage.d.ts +449 -129
- package/src/types/usage.d.ts +106 -0
- package/src/types/workflow.d.ts +315 -54
- package/src/utils/agentMemory.ts +15 -0
- package/src/utils/agentNote.ts +850 -0
- package/src/utils/aiChat.ts +43 -0
- package/src/utils/aiChatWork.ts +64 -0
- package/src/utils/billing.ts +37 -0
- package/src/utils/campaign.ts +1174 -0
- package/src/utils/campaignAI.ts +72 -0
- package/src/utils/campaignAccess.ts +239 -0
- package/src/utils/campaignEmail.ts +601 -0
- package/src/utils/campaignEmailCompiler.ts +372 -0
- package/src/utils/campaignEmailImages.ts +60 -0
- package/src/utils/campaignEmailStyles.ts +544 -0
- package/src/utils/campaignLifecycle.ts +104 -0
- package/src/utils/campaignPreview.ts +285 -0
- package/src/utils/contact.ts +50 -0
- package/src/utils/csvExport.ts +19 -0
- package/src/utils/dataTable.ts +95 -618
- package/src/utils/dataTableFieldTypeRegistry.ts +106 -0
- package/src/utils/dataTableRelativeDate.ts +447 -0
- package/src/utils/definitionElement.ts +84 -0
- package/src/utils/docAccess.ts +383 -0
- package/src/utils/documentName.ts +53 -0
- package/src/utils/email.ts +317 -51
- package/src/utils/emailReplyReport.test.ts +187 -0
- package/src/utils/emailReplyReport.ts +143 -0
- package/src/utils/fieldDoc.ts +157 -0
- package/src/utils/fieldDocAnswers.ts +128 -0
- package/src/utils/fieldDocDefaults.ts +36 -0
- package/src/utils/fieldDocProgram.ts +36 -0
- package/src/utils/fieldDocSummary.ts +30 -0
- package/src/utils/log.ts +276 -192
- package/src/utils/logDisplay.helpers.ts +177 -0
- package/src/utils/logDisplay.ts +87 -0
- package/src/utils/logRegistryValue.ts +90 -0
- package/src/utils/logStoreRead.ts +262 -0
- package/src/utils/logTaxonomy.helpers.ts +17 -0
- package/src/utils/logTaxonomy.ts +76 -0
- package/src/utils/logTaxonomyDisplay.ts +395 -0
- package/src/utils/noteDoc.ts +609 -0
- package/src/utils/organization.ts +337 -84
- package/src/utils/pageRoute.ts +71 -0
- package/src/utils/qrCode.helpers.ts +189 -0
- package/src/utils/qrCode.test.ts +519 -0
- package/src/utils/qrCode.ts +273 -0
- package/src/utils/richTextHTML.ts +385 -0
- package/src/utils/sheet.ts +199 -107
- package/src/utils/sheetAxisMove.ts +616 -0
- package/src/utils/sheetBootstrap.ts +1402 -0
- package/src/utils/sheetCellLiteral.ts +101 -0
- package/src/utils/sheetCommand.ts +358 -0
- package/src/utils/sheetDesign.ts +705 -0
- package/src/utils/sheetExport.ts +186 -0
- package/src/utils/sheetFeatureReference.ts +183 -0
- package/src/utils/sheetFormulaArgs.ts +168 -0
- package/src/utils/sheetFormulaCompile.ts +475 -0
- package/src/utils/sheetFormulaConditionalAggregate.ts +254 -0
- package/src/utils/sheetFormulaCriteria.ts +656 -0
- package/src/utils/sheetFormulaDate.ts +444 -0
- package/src/utils/sheetFormulaEvaluation.ts +899 -0
- package/src/utils/sheetFormulaEvaluator.ts +997 -0
- package/src/utils/sheetFormulaFunctionHandlers.ts +403 -0
- package/src/utils/sheetFormulaLogical.ts +116 -0
- package/src/utils/sheetFormulaLookup.ts +488 -0
- package/src/utils/sheetFormulaMath.ts +48 -0
- package/src/utils/sheetFormulaParser.ts +729 -0
- package/src/utils/sheetFormulaRange.ts +330 -0
- package/src/utils/sheetFormulaReference.ts +703 -0
- package/src/utils/sheetFormulaReferenceAggregates.ts +313 -0
- package/src/utils/sheetFormulaReferenceDates.ts +237 -0
- package/src/utils/sheetFormulaReferenceLogical.ts +330 -0
- package/src/utils/sheetFormulaReferenceLookup.ts +341 -0
- package/src/utils/sheetFormulaReferenceMath.ts +95 -0
- package/src/utils/sheetFormulaReferenceRewrite.ts +220 -0
- package/src/utils/sheetFormulaReferenceText.ts +462 -0
- package/src/utils/sheetFormulaSyntax.ts +1027 -0
- package/src/utils/sheetFormulaText.ts +430 -0
- package/src/utils/sheetJournal.ts +200 -0
- package/src/utils/sheetNumberFormat.ts +1012 -0
- package/src/utils/sheetPreview.ts +68 -0
- package/src/utils/sheetSequence.ts +118 -0
- package/src/utils/sheetSnapshot.ts +739 -0
- package/src/utils/sheetStructureEdit.ts +914 -0
- package/src/utils/sheetStructureReferences.ts +389 -0
- package/src/utils/square.ts +22 -12
- package/src/utils/storage.ts +198 -0
- package/src/utils/table-route.ts +127 -11
- package/src/utils/time.ts +12 -0
- package/src/utils/workflow.ts +334 -40
- package/src/utils/workflowLogFingerprint.ts +302 -0
- package/src/utils/workflowLogRevisionSnapshot.ts +424 -0
- package/src/utils/workflowProgress.ts +280 -0
- package/src/utils/workflowTriggers.ts +61 -0
- package/tests/agentNote.test.ts +395 -0
- package/tests/campaignAI.test.ts +119 -0
- package/tests/campaignAccess.test.ts +239 -0
- package/tests/campaignEmail.test.ts +441 -0
- package/tests/campaignLifecycle.test.ts +134 -0
- package/tests/campaignPublication.test.ts +309 -0
- package/tests/dataTableFieldTypeRegistry.test.ts +111 -0
- package/tests/dataTableRelativeDate.test.ts +412 -0
- package/tests/docAccess.test.ts +525 -0
- package/tests/editLogEntry.test.ts +112 -0
- package/tests/email.test.ts +39 -0
- package/tests/fieldDocProgram.test.ts +114 -0
- package/tests/logDisplay.fixtures.ts +67 -0
- package/tests/logDisplay.test.ts +227 -0
- package/tests/noteDoc.test.ts +514 -0
- package/tests/richTextHTML.test.ts +185 -0
- package/tests/sheetAxisMove.test.ts +352 -0
- package/tests/sheetBootstrap.test.ts +1967 -0
- package/tests/sheetFeatureReference.test.ts +22 -0
- package/tests/sheetFormulaCriteria.test.ts +269 -0
- package/tests/sheetFormulaEvaluator.test.ts +468 -0
- package/tests/sheetFormulaFunctions.test.ts +538 -0
- package/tests/sheetFormulaLanguage.test.ts +361 -0
- package/tests/sheetFormulaParity.fixtures.ts +872 -0
- package/tests/sheetFormulaParity.test.ts +188 -0
- package/tests/sheetFormulaRange.test.ts +167 -0
- package/tests/sheetFormulaReference.test.ts +78 -0
- package/tests/sheetFormulaReferenceRewrite.test.ts +117 -0
- package/tests/sheetFormulaTextDate.test.ts +512 -0
- package/tests/sheetSequence.test.ts +22 -0
- package/tests/sheetSnapshot.test.ts +134 -0
- package/tests/sheetStructureEdit.test.ts +537 -0
- package/tests/sheetStructureReferences.test.ts +589 -0
- package/tests/workflowLifecycleStatus.test.ts +60 -0
- package/tests/workflowLogFingerprint.test.ts +203 -0
- package/tests/workflowLogRevisionSnapshot.test.ts +96 -0
- package/tests/workflowProgress.test.ts +180 -0
- package/tests/workflowTriggers.test.ts +29 -0
- package/tsconfig.json +10 -10
- package/vitest.config.ts +8 -0
- package/src/constants/log-activityTexts.ts +0 -235
- package/src/constants/product.ts +0 -42
- package/src/constants/report.ts +0 -44
- package/src/schemas/organization.ts +0 -65
- package/src/schemas/productsQuery.ts +0 -53
- package/src/schemas/reportsQuery.ts +0 -20
- package/src/types/product.d.ts +0 -84
- package/src/types/report.d.ts +0 -290
- package/src/utils/product-calEvent.ts +0 -455
- package/src/utils/report.ts +0 -158
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Subscription plans. Plan identity always comes from the Stripe Product
|
|
3
|
+
* (metadata.nebulaPlanKey), never from a price id.
|
|
4
|
+
*/
|
|
5
|
+
export const BILLING_PLAN_KEYS = ['BASIC', 'BUSINESS', 'ENTERPRISE'] as const;
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* Plans that can be purchased self-serve; Enterprise is always "contact us".
|
|
9
|
+
*/
|
|
10
|
+
export const BILLING_SELF_SERVE_PLAN_KEYS = ['BASIC', 'BUSINESS'] as const;
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Billing intervals offered for self-serve plan prices.
|
|
14
|
+
*/
|
|
15
|
+
export const BILLING_INTERVALS = ['MONTH', 'YEAR'] as const;
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* Every Stripe recurring interval, uppercased, as stored on billing mirrors.
|
|
19
|
+
*/
|
|
20
|
+
export const BILLING_STRIPE_INTERVALS = [
|
|
21
|
+
'DAY',
|
|
22
|
+
'WEEK',
|
|
23
|
+
'MONTH',
|
|
24
|
+
'YEAR',
|
|
25
|
+
] as const;
|
|
26
|
+
|
|
27
|
+
/*
|
|
28
|
+
* Whether an organization's access is locked when its paid period lapses.
|
|
29
|
+
*/
|
|
30
|
+
export const BILLING_ENFORCEMENT_ENUMS = ['ENFORCED', 'EXEMPT'] as const;
|
|
31
|
+
|
|
32
|
+
/*
|
|
33
|
+
* How a staff-recorded renewal outside Stripe was paid.
|
|
34
|
+
*/
|
|
35
|
+
export const BILLING_MANUAL_GRANT_METHODS = [
|
|
36
|
+
'CHECK',
|
|
37
|
+
'WIRE',
|
|
38
|
+
'ACH_TRANSFER',
|
|
39
|
+
'CASH',
|
|
40
|
+
'COMPED',
|
|
41
|
+
'OTHER',
|
|
42
|
+
] as const;
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
* Processing states of a recorded Stripe webhook event.
|
|
46
|
+
*/
|
|
47
|
+
export const BILLING_STRIPE_EVENT_STATUSES = [
|
|
48
|
+
'RECEIVED',
|
|
49
|
+
'PROCESSED',
|
|
50
|
+
'IGNORED',
|
|
51
|
+
'FAILED',
|
|
52
|
+
] as const;
|
|
53
|
+
|
|
54
|
+
/*
|
|
55
|
+
* States of one self-serve purchase attempt.
|
|
56
|
+
*/
|
|
57
|
+
export const BILLING_PURCHASE_ATTEMPT_STATUSES = [
|
|
58
|
+
'PENDING',
|
|
59
|
+
'SUBSCRIPTION_CREATED',
|
|
60
|
+
'FAILED',
|
|
61
|
+
] as const;
|
|
62
|
+
|
|
63
|
+
/*
|
|
64
|
+
* Channels that can receive a throttled "subscription expired" notice.
|
|
65
|
+
*/
|
|
66
|
+
export const BILLING_ACCESS_NOTICE_CHANNELS = ['SMS'] as const;
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
* Stripe intent the client confirms after starting a subscription.
|
|
70
|
+
*/
|
|
71
|
+
export const BILLING_INTENT_TYPES = ['PAYMENT', 'SETUP'] as const;
|
|
72
|
+
|
|
73
|
+
/*
|
|
74
|
+
* Days of access kept after the paid-through date before the lock applies.
|
|
75
|
+
*/
|
|
76
|
+
export const BILLING_GRACE_DAYS_DEFAULT = 14;
|
|
77
|
+
|
|
78
|
+
/*
|
|
79
|
+
* Minimum minutes between two lapse notices to one organization + recipient.
|
|
80
|
+
*/
|
|
81
|
+
export const BILLING_ACCESS_NOTICE_INTERVAL_MINUTES = 10;
|
|
82
|
+
|
|
83
|
+
/*
|
|
84
|
+
* Stripe payment method types accepted for subscriptions (ACH uses instant
|
|
85
|
+
* verification only).
|
|
86
|
+
*/
|
|
87
|
+
export const BILLING_PAYMENT_METHOD_TYPES = [
|
|
88
|
+
'card',
|
|
89
|
+
'us_bank_account',
|
|
90
|
+
] as const;
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
* Stripe subscription statuses that mean "the org has a live subscription".
|
|
94
|
+
*/
|
|
95
|
+
export const BILLING_LIVE_SUBSCRIPTION_STATUSES = [
|
|
96
|
+
'active',
|
|
97
|
+
'trialing',
|
|
98
|
+
'past_due',
|
|
99
|
+
'unpaid',
|
|
100
|
+
] as const;
|
|
101
|
+
|
|
102
|
+
/*
|
|
103
|
+
* Price lookup keys for the public (self-serve) prices.
|
|
104
|
+
*/
|
|
105
|
+
export const BILLING_PRICE_LOOKUP_KEYS = {
|
|
106
|
+
BASIC: { MONTH: 'basic_monthly', YEAR: 'basic_yearly' },
|
|
107
|
+
BUSINESS: { MONTH: 'business_monthly', YEAR: 'business_yearly' },
|
|
108
|
+
} as const;
|
|
109
|
+
|
|
110
|
+
/*
|
|
111
|
+
* Stripe metadata keys written on our Stripe objects (and set by staff in the
|
|
112
|
+
* Dashboard).
|
|
113
|
+
*/
|
|
114
|
+
export const BILLING_STRIPE_METADATA_KEYS = {
|
|
115
|
+
// DB organizations.id as a decimal string
|
|
116
|
+
organizationId: 'nebulaOrganizationId',
|
|
117
|
+
// On Products: BASIC | BUSINESS | ENTERPRISE
|
|
118
|
+
planKey: 'nebulaPlanKey',
|
|
119
|
+
// Always BILLING_STRIPE_METADATA_APP
|
|
120
|
+
app: 'nebulaApp',
|
|
121
|
+
} as const;
|
|
122
|
+
|
|
123
|
+
/*
|
|
124
|
+
* Value of the nebulaApp metadata key on every Stripe object we create.
|
|
125
|
+
*/
|
|
126
|
+
export const BILLING_STRIPE_METADATA_APP = 'nebula';
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Campaigns; all types
|
|
3
|
+
*
|
|
4
|
+
* A campaign template is a reusable definition; a campaign is one immutable
|
|
5
|
+
* publication or send created from it. This domain is independent of
|
|
6
|
+
* fieldDocs: it owns its own element definitions, and a response is complete
|
|
7
|
+
* in campaign_responses without writing anything to logs.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export const CAMPAIGN_KIND_ENUMS = ['PUBLIC_FORM', 'EMAIL'];
|
|
11
|
+
|
|
12
|
+
export const CAMPAIGN_AUDIENCE_ENUMS = ['ANYONE', 'CHILD_ORGS', 'INBOUND_CONTACTS'];
|
|
13
|
+
|
|
14
|
+
// access_grants."entityType" value for public-form campaign overrides; this
|
|
15
|
+
// must stay aligned with DOC_ACCESS_ENTITY_TYPE_ENUMS and the database CHECK.
|
|
16
|
+
export const CAMPAIGN_FORM_ACCESS_ENTITY_TYPE = 'CAMPAIGN_FORM' as const;
|
|
17
|
+
|
|
18
|
+
// Sheet Web form results reserve these stable response-column identities.
|
|
19
|
+
// Campaign question keys must never collide with them because response answer
|
|
20
|
+
// objects and generated Sheet columns share the same key namespace.
|
|
21
|
+
export const CAMPAIGN_WEB_FORM_RESULT_FIXED_COLUMN_KEYS = ['name', 'email', 'org_name', 'submitted_date'] as const;
|
|
22
|
+
|
|
23
|
+
// Templates retain ERROR for legacy failures. AI generation belongs to campaigns.
|
|
24
|
+
export const CAMPAIGN_TEMPLATE_STATUS_ENUMS = ['ACTIVE', 'ERROR'] as const;
|
|
25
|
+
|
|
26
|
+
// Template status has no transient websocket-only generation state.
|
|
27
|
+
export const CAMPAIGN_TEMPLATE_GRAPHQL_STATUS_ENUMS = [...CAMPAIGN_TEMPLATE_STATUS_ENUMS] as const;
|
|
28
|
+
|
|
29
|
+
// Campaign generation is independent from the publication/send lifecycle. A
|
|
30
|
+
// campaign remains a draft while its durable generation job settles.
|
|
31
|
+
export const CAMPAIGN_GENERATION_STATUS_ENUMS = ['GENERATING', 'COMPLETE', 'ERROR'] as const;
|
|
32
|
+
|
|
33
|
+
// GraphQL may briefly project GENERATED after persistence reaches COMPLETE.
|
|
34
|
+
// GENERATED is a refetch signal and is never persisted.
|
|
35
|
+
export const CAMPAIGN_GENERATION_GRAPHQL_STATUS_ENUMS = [...CAMPAIGN_GENERATION_STATUS_ENUMS, 'GENERATED'] as const;
|
|
36
|
+
|
|
37
|
+
// Realtime generation progress uses semantic stages so each client can
|
|
38
|
+
// translate the transient status in its active locale.
|
|
39
|
+
export const CAMPAIGN_GENERATION_PROGRESS_STAGES = [
|
|
40
|
+
'FORM_PLANNING',
|
|
41
|
+
'FORM_WRITING',
|
|
42
|
+
'FORM_CHOOSING_FIELDS',
|
|
43
|
+
'FORM_PREPARING',
|
|
44
|
+
'FORM_ALMOST_FINISHED',
|
|
45
|
+
'EMAIL_PLANNING',
|
|
46
|
+
'EMAIL_WRITING',
|
|
47
|
+
'EMAIL_FORMATTING',
|
|
48
|
+
'EMAIL_PREPARING',
|
|
49
|
+
'EMAIL_ALMOST_FINISHED',
|
|
50
|
+
] as const;
|
|
51
|
+
|
|
52
|
+
export const CAMPAIGN_STATUS_ENUMS = ['DRAFT', 'SCHEDULED', 'ACTIVE', 'SENDING', 'COMPLETED', 'CLOSED', 'CANCELLED', 'FAILED'];
|
|
53
|
+
|
|
54
|
+
export const CAMPAIGN_SORT_ENUMS = ['CREATED_AT_DESC', 'UPDATED_AT_DESC'] as const;
|
|
55
|
+
|
|
56
|
+
export const CAMPAIGN_PUBLISH_STATUS_ENUMS = ['DRAFT', 'SCHEDULED', 'ACTIVE', 'CLOSED'] as const;
|
|
57
|
+
|
|
58
|
+
export const CAMPAIGN_DRAFT_RESET_SOURCES = ['PUBLISHED', 'TEMPLATE'] as const;
|
|
59
|
+
|
|
60
|
+
export const CAMPAIGN_MANAGEMENT_OPERATION_ENUMS = [
|
|
61
|
+
'PUBLISH',
|
|
62
|
+
'SEND_EMAIL',
|
|
63
|
+
'RETRY_EMAIL',
|
|
64
|
+
'RESCHEDULE',
|
|
65
|
+
'OPEN_NOW',
|
|
66
|
+
'SET_CLOSE_TIME',
|
|
67
|
+
'CLOSE_NOW',
|
|
68
|
+
'CANCEL',
|
|
69
|
+
'ARCHIVE',
|
|
70
|
+
] as const;
|
|
71
|
+
|
|
72
|
+
// Email builder block kinds. These values are shared by the editor, GraphQL
|
|
73
|
+
// schema, storage adapter, and delivery renderer.
|
|
74
|
+
export const CAMPAIGN_EMAIL_BLOCK_TYPES = [
|
|
75
|
+
'HEADING',
|
|
76
|
+
'RICH_TEXT',
|
|
77
|
+
'IMAGE',
|
|
78
|
+
'BUTTON',
|
|
79
|
+
'DIVIDER',
|
|
80
|
+
'SPACER',
|
|
81
|
+
'HERO',
|
|
82
|
+
'SOCIAL',
|
|
83
|
+
'MENU',
|
|
84
|
+
'VIDEO',
|
|
85
|
+
] as const;
|
|
86
|
+
|
|
87
|
+
// Heading levels intentionally stop at H3 so generated campaigns preserve a
|
|
88
|
+
// compact, accessible hierarchy across email clients.
|
|
89
|
+
export const CAMPAIGN_EMAIL_HEADING_LEVELS = ['H1', 'H2', 'H3'] as const;
|
|
90
|
+
|
|
91
|
+
export const CAMPAIGN_EMAIL_ALIGNMENTS = ['LEFT', 'CENTER', 'RIGHT'] as const;
|
|
92
|
+
|
|
93
|
+
export const CAMPAIGN_EMAIL_BUTTON_STYLES = ['FILLED', 'OUTLINE'] as const;
|
|
94
|
+
|
|
95
|
+
export const CAMPAIGN_EMAIL_CANVAS_VERTICAL_PADDING = 70;
|
|
96
|
+
export const CAMPAIGN_EMAIL_DOCUMENT_SCHEMA_VERSION = 1;
|
|
97
|
+
export const CAMPAIGN_EMAIL_DEFAULT_CANVAS_COLOR = '#f4f4f4';
|
|
98
|
+
export const CAMPAIGN_EMAIL_DEFAULT_CONTENT_COLOR = '#ffffff';
|
|
99
|
+
export const CAMPAIGN_EMAIL_DEFAULT_CONTENT_WIDTH = 600;
|
|
100
|
+
export const CAMPAIGN_EMAIL_DEFAULT_LINK_COLOR = '#1b66c9';
|
|
101
|
+
export const CAMPAIGN_EMAIL_DEFAULT_TEXT_COLOR = '#18181b';
|
|
102
|
+
export const CAMPAIGN_EMAIL_MAX_CONTENT_WIDTH = 800;
|
|
103
|
+
export const CAMPAIGN_EMAIL_MIN_CONTENT_WIDTH = 320;
|
|
104
|
+
export const CAMPAIGN_EMAIL_RESPONSIVE_CANVAS_BOTTOM_PADDING = 20;
|
|
105
|
+
|
|
106
|
+
// The app's TT Norms Pro faces, exposed to email as ONE weight-mapped family so
|
|
107
|
+
// clients that load web fonts (Apple Mail, iOS, Outlook for Mac) show the exact
|
|
108
|
+
// preview faces while clients that do not (Gmail, Outlook for Windows) fall
|
|
109
|
+
// back to a real bold weight instead of losing emphasis entirely.
|
|
110
|
+
export const CAMPAIGN_EMAIL_FONT_FAMILY_NAME = 'ttnp';
|
|
111
|
+
export const CAMPAIGN_EMAIL_DEFAULT_FONT_FAMILY = "'ttnp', 'Helvetica Neue', Helvetica, Arial, sans-serif";
|
|
112
|
+
// Font stacks persisted by earlier editor builds as the default; rendering
|
|
113
|
+
// treats them as "no custom font" so they follow the current default.
|
|
114
|
+
export const CAMPAIGN_EMAIL_LEGACY_DEFAULT_FONT_FAMILIES = ['Arial, sans-serif', '"ttnp-normal", sans-serif'] as const;
|
|
115
|
+
// Headings use the demibold face; bold runs and H3 use the medium face.
|
|
116
|
+
export const CAMPAIGN_EMAIL_HEADING_FONT_WEIGHT = 600;
|
|
117
|
+
export const CAMPAIGN_EMAIL_EMPHASIS_FONT_WEIGHT = 700;
|
|
118
|
+
export const CAMPAIGN_EMAIL_FONT_FILE_URL = 'https://assets.chiefhappiness.co/marketday/fonts/';
|
|
119
|
+
export const CAMPAIGN_EMAIL_FONT_FILE_VERSION = '20260713';
|
|
120
|
+
export const CAMPAIGN_EMAIL_FONT_FACES = [
|
|
121
|
+
{ file: 'ttnp-c-normal', style: 'normal', weight: 400 },
|
|
122
|
+
{ file: 'ttnp-c-normal-it', style: 'italic', weight: 400 },
|
|
123
|
+
{
|
|
124
|
+
file: 'ttnp-c-demibold',
|
|
125
|
+
style: 'normal',
|
|
126
|
+
weight: CAMPAIGN_EMAIL_HEADING_FONT_WEIGHT,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
file: 'ttnp-c-medium',
|
|
130
|
+
style: 'normal',
|
|
131
|
+
weight: CAMPAIGN_EMAIL_EMPHASIS_FONT_WEIGHT,
|
|
132
|
+
},
|
|
133
|
+
] as const;
|
|
134
|
+
export const CAMPAIGN_EMAIL_INLINE_IMAGE_CONTENT_TYPES = ['image/gif', 'image/jpeg', 'image/png', 'image/webp'] as const;
|
|
135
|
+
export const CAMPAIGN_EMAIL_MAX_INLINE_IMAGE_BYTES = 7 * 1024 * 1024;
|
|
136
|
+
export const CAMPAIGN_EMAIL_MAX_INLINE_IMAGES = 20;
|
|
137
|
+
export const CAMPAIGN_EMAIL_MAX_BLOCKS_PER_ROW = 100;
|
|
138
|
+
export const CAMPAIGN_EMAIL_MAX_COLUMNS_PER_ROW = 4;
|
|
139
|
+
export const CAMPAIGN_EMAIL_MAX_LINKS_PER_BLOCK = 20;
|
|
140
|
+
export const CAMPAIGN_EMAIL_MAX_LINK_LABEL_LENGTH = 255;
|
|
141
|
+
export const CAMPAIGN_EMAIL_MAX_LINK_URL_LENGTH = 2_000;
|
|
142
|
+
export const CAMPAIGN_EMAIL_MAX_RECIPIENTS = 5000;
|
|
143
|
+
export const CAMPAIGN_EMAIL_MAX_ROWS = 100;
|
|
144
|
+
export const CAMPAIGN_EMAIL_UNSUBSCRIBE_URL_PLACEHOLDER = '{{campaign_unsubscribe_url}}';
|
|
145
|
+
|
|
146
|
+
// The structural role of one element; "type" below is how a QUESTION is
|
|
147
|
+
// answered
|
|
148
|
+
export const CAMPAIGN_ELEMENT_KINDS = [
|
|
149
|
+
'SECTION', // Top-level container; every other kind is a child of one
|
|
150
|
+
'CONTENT', // Static title/paragraph/image; renders, never answered
|
|
151
|
+
'QUESTION', // Collects exactly one answer
|
|
152
|
+
];
|
|
153
|
+
|
|
154
|
+
export const CAMPAIGN_FORM_QUESTION_TYPES = [
|
|
155
|
+
'SHORT_TEXT',
|
|
156
|
+
'LONG_TEXT',
|
|
157
|
+
'SINGLE_CHOICE',
|
|
158
|
+
'MULTI_CHOICE',
|
|
159
|
+
'NUMBER',
|
|
160
|
+
'DATE',
|
|
161
|
+
'EMAIL',
|
|
162
|
+
'PHONE',
|
|
163
|
+
'FILE',
|
|
164
|
+
];
|
|
165
|
+
|
|
166
|
+
// Retain the retired type when reading historical definitions and responses.
|
|
167
|
+
export const CAMPAIGN_ELEMENT_TYPES = ['AI_TEXT', ...CAMPAIGN_FORM_QUESTION_TYPES];
|
|
168
|
+
|
|
169
|
+
// Element types whose answer must be one of the element's options
|
|
170
|
+
export const CAMPAIGN_CHOICE_ELEMENT_TYPES = ['SINGLE_CHOICE', 'MULTI_CHOICE'];
|
|
171
|
+
|
|
172
|
+
export const CAMPAIGN_ELEMENT_VISIBLE_WHEN_OPERATORS = ['EQUALS', 'NOT_EQUALS', 'INCLUDES', 'IS_ANSWERED'] as const;
|
|
173
|
+
|
|
174
|
+
export const CAMPAIGN_TEMPLATE_TYPES = ['forms', 'emails'] as const;
|
|
175
|
+
|
|
176
|
+
// Upper bound for the AI generation instructions typed into the create-campaign
|
|
177
|
+
// modal; also caps what one locally persisted draft may hold
|
|
178
|
+
export const CAMPAIGN_INSTRUCTIONS_MAX_LENGTH = 10000;
|
|
179
|
+
|
|
180
|
+
// Public-form response limits are security and transport boundaries, not
|
|
181
|
+
// author-configurable validation defaults. Keep the aggregate comfortably
|
|
182
|
+
// below the shared AMQP payload limit after answer metadata is added.
|
|
183
|
+
export const CAMPAIGN_SHORT_TEXT_ANSWER_MAX_LENGTH = 255;
|
|
184
|
+
export const CAMPAIGN_LONG_TEXT_ANSWER_MAX_LENGTH = 6_400;
|
|
185
|
+
export const CAMPAIGN_RESPONSE_TEXT_ANSWERS_MAX_LENGTH = 50_000;
|
|
186
|
+
|
|
187
|
+
// A campaign stuck in GENERATING past this age is treated as a dead job and
|
|
188
|
+
// swept to ERROR
|
|
189
|
+
export const CAMPAIGN_GENERATION_TIMEOUT_MS = 10 * 60 * 1000;
|
|
190
|
+
|
|
191
|
+
// Bounded by the server's 12-hour sweep of "UNUSED" uploads: a resumed draft
|
|
192
|
+
// must never outlive the storage objects its file references point at
|
|
193
|
+
export const CAMPAIGN_DRAFT_TTL_HOURS = 3;
|
|
194
|
+
|
|
195
|
+
// Bump the version segment when the persisted shape changes meaning in a way
|
|
196
|
+
// the schema cannot catch; old drafts then miss and are swept
|
|
197
|
+
export const CAMPAIGN_DRAFT_KEY_PREFIX = 'createCampaign:v2';
|
|
198
|
+
|
|
199
|
+
// Public web form color presets; values must match generated bg_* color
|
|
200
|
+
// utility palette names in @jsb188/css.
|
|
201
|
+
export const CAMPAIGN_FORM_COLORS = [
|
|
202
|
+
'red',
|
|
203
|
+
'orange',
|
|
204
|
+
'brown',
|
|
205
|
+
'amber',
|
|
206
|
+
'yellow',
|
|
207
|
+
'lime',
|
|
208
|
+
'green',
|
|
209
|
+
'emerald',
|
|
210
|
+
'teal',
|
|
211
|
+
'cyan',
|
|
212
|
+
'sky',
|
|
213
|
+
'blue',
|
|
214
|
+
'indigo',
|
|
215
|
+
'violet',
|
|
216
|
+
'purple',
|
|
217
|
+
'fuchsia',
|
|
218
|
+
'pink',
|
|
219
|
+
'rose',
|
|
220
|
+
'slate',
|
|
221
|
+
'zinc',
|
|
222
|
+
];
|
|
223
|
+
|
|
224
|
+
export const CAMPAIGN_FORM_BACKGROUND_FILL_STYLES = ['FADED', 'LIGHT', 'MEDIUM', 'GRAYSCALE'];
|
|
225
|
+
|
|
226
|
+
export const CAMPAIGN_FORM_DEFAULT_BACKGROUND_FILL_STYLE = 'FADED';
|
|
227
|
+
export const CAMPAIGN_FORM_NEUTRAL_COLOR = 'zinc';
|
|
228
|
+
|
|
229
|
+
/*
|
|
230
|
+
* Shared email delivery limits. Subject uses the stricter product limit; reply-to matches the JSONB CHECK (255).
|
|
231
|
+
*/
|
|
232
|
+
export const CAMPAIGN_EMAIL_TEXT_LIMITS = {
|
|
233
|
+
subject: 255,
|
|
234
|
+
preheader: 500,
|
|
235
|
+
secondaryReplyToEmail: 255,
|
|
236
|
+
} as const;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Industries offered on the public contact form. Physical-operations industries
|
|
3
|
+
* (where Marketday's field capture matters most) sit alongside the common
|
|
4
|
+
* industry options so every visitor can find a fit; "OTHER" is always last.
|
|
5
|
+
*/
|
|
6
|
+
export const CONTACT_INDUSTRIES = [
|
|
7
|
+
'AEROSPACE_AND_DEFENSE',
|
|
8
|
+
'AGRICULTURE',
|
|
9
|
+
'AUTOMOTIVE',
|
|
10
|
+
'CONSTRUCTION',
|
|
11
|
+
'EDUCATION',
|
|
12
|
+
'ENERGY_AND_UTILITIES',
|
|
13
|
+
'ENVIRONMENTAL_SERVICES',
|
|
14
|
+
'FACILITIES_MANAGEMENT',
|
|
15
|
+
'FIELD_SERVICES',
|
|
16
|
+
'FINANCIAL_SERVICES',
|
|
17
|
+
'FISHING_AND_AQUACULTURE',
|
|
18
|
+
'FOOD_AND_BEVERAGE',
|
|
19
|
+
'FORESTRY',
|
|
20
|
+
'GOVERNMENT',
|
|
21
|
+
'HEALTHCARE',
|
|
22
|
+
'HOSPITALITY',
|
|
23
|
+
'LANDSCAPING',
|
|
24
|
+
'LOGISTICS_AND_TRANSPORTATION',
|
|
25
|
+
'MANUFACTURING',
|
|
26
|
+
'MEDIA_AND_ENTERTAINMENT',
|
|
27
|
+
'MINING',
|
|
28
|
+
'NONPROFIT',
|
|
29
|
+
'OIL_AND_GAS',
|
|
30
|
+
'PHARMACEUTICALS',
|
|
31
|
+
'PROFESSIONAL_SERVICES',
|
|
32
|
+
'REAL_ESTATE',
|
|
33
|
+
'RETAIL',
|
|
34
|
+
'TECHNOLOGY',
|
|
35
|
+
'TELECOMMUNICATIONS',
|
|
36
|
+
'WAREHOUSING_AND_DISTRIBUTION',
|
|
37
|
+
'WHOLESALE',
|
|
38
|
+
'OTHER',
|
|
39
|
+
] as const;
|
|
40
|
+
|
|
41
|
+
/*
|
|
42
|
+
* Maximum accepted length of each contact form field. Shared by the client
|
|
43
|
+
* schema and the server validation so the two never drift apart.
|
|
44
|
+
*/
|
|
45
|
+
export const CONTACT_REQUEST_FIELD_MAX_LENGTHS = {
|
|
46
|
+
email: 254,
|
|
47
|
+
firstName: 60,
|
|
48
|
+
lastName: 60,
|
|
49
|
+
jobTitle: 80,
|
|
50
|
+
companyName: 120,
|
|
51
|
+
} as const;
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
* Names, job titles and company names never legitimately contain a link. Shared
|
|
55
|
+
* by the client schema and the server validation.
|
|
56
|
+
*/
|
|
57
|
+
export const CONTACT_REQUEST_URL_PATTERN = /(https?:\/\/|www\.)/i;
|
|
58
|
+
|
|
59
|
+
/*
|
|
60
|
+
* One bare email address and nothing around it: no display name, whitespace or
|
|
61
|
+
* separators that could add a second recipient to the Reply-To of the sales
|
|
62
|
+
* notification. Checked on top of the general email rule.
|
|
63
|
+
*/
|
|
64
|
+
export const CONTACT_REQUEST_EMAIL_PATTERN = /^[^\s@<>()[\],;:"\\]+@[^\s@<>()[\],;:"\\]+\.[^\s@<>()[\],;:"\\]+$/;
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
* Field name of the contact form honeypot input. Real visitors never see or
|
|
68
|
+
* fill it; a non-empty value marks the submission as automated. Plausible to a
|
|
69
|
+
* form-filling bot, but unlike anything browsers or password managers autofill
|
|
70
|
+
* (website, url, company), so autofill never trips it for a real visitor.
|
|
71
|
+
*/
|
|
72
|
+
export const CONTACT_FORM_HONEYPOT_FIELD = 'referral_code';
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable AI CSV export execution and delivery contracts.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export const CSV_EXPORT_BATCH_STATUS_ENUMS = [
|
|
6
|
+
'PENDING',
|
|
7
|
+
'PROCESSING',
|
|
8
|
+
'COMPLETED',
|
|
9
|
+
'PARTIALLY_COMPLETED',
|
|
10
|
+
'FAILED',
|
|
11
|
+
'CANCELLED',
|
|
12
|
+
] as const;
|
|
13
|
+
|
|
14
|
+
export const CSV_EXPORT_GENERATION_STAGE_ENUMS = [
|
|
15
|
+
'QUEUED',
|
|
16
|
+
'PLANNING',
|
|
17
|
+
'VALIDATING_PLAN',
|
|
18
|
+
'READING_DATA',
|
|
19
|
+
'COMBINING_DATASETS',
|
|
20
|
+
'TRANSFORMING',
|
|
21
|
+
'CREATING_FILE',
|
|
22
|
+
'UPLOADING',
|
|
23
|
+
'FINALIZING',
|
|
24
|
+
'DELIVERY_PENDING',
|
|
25
|
+
'DELIVERING',
|
|
26
|
+
'DONE',
|
|
27
|
+
'FAILED',
|
|
28
|
+
'CANCELLED',
|
|
29
|
+
] as const;
|
|
30
|
+
|
|
31
|
+
export const CSV_EXPORT_EXECUTION_MODE_ENUMS = [
|
|
32
|
+
'LEGACY_AGENT_V1',
|
|
33
|
+
'SHADOW_PLAN_V2',
|
|
34
|
+
'PLAN_EXECUTOR_V2',
|
|
35
|
+
] as const;
|
|
36
|
+
|
|
37
|
+
export const CSV_EXPORT_DELIVERY_MODE_ENUMS = [
|
|
38
|
+
'LEGACY_INLINE_V1',
|
|
39
|
+
'SHADOW_OUTBOX_V2',
|
|
40
|
+
'OUTBOX_V2',
|
|
41
|
+
] as const;
|
|
42
|
+
|
|
43
|
+
export const CSV_EXPORT_BATCH_FILE_STATUS_ENUMS = [
|
|
44
|
+
'PENDING',
|
|
45
|
+
'PROCESSING',
|
|
46
|
+
'COMPLETED',
|
|
47
|
+
'FAILED',
|
|
48
|
+
'CANCELLED',
|
|
49
|
+
'SKIPPED',
|
|
50
|
+
] as const;
|
|
51
|
+
|
|
52
|
+
export const CSV_EXPORT_STEP_KIND_ENUMS = [
|
|
53
|
+
'READ_SOURCE',
|
|
54
|
+
'EXTRACT_TEXT_ROWS',
|
|
55
|
+
'CALENDAR',
|
|
56
|
+
'TRANSFORM',
|
|
57
|
+
'APPEND',
|
|
58
|
+
'JOIN',
|
|
59
|
+
'AGGREGATE',
|
|
60
|
+
'EXPLODE',
|
|
61
|
+
'RENDER_FILE',
|
|
62
|
+
'UPLOAD_FILE',
|
|
63
|
+
'COMPOSE_ANSWER',
|
|
64
|
+
'FINALIZE_FILE',
|
|
65
|
+
] as const;
|
|
66
|
+
|
|
67
|
+
export const CSV_EXPORT_STEP_STATUS_ENUMS = [
|
|
68
|
+
'PENDING',
|
|
69
|
+
'PROCESSING',
|
|
70
|
+
'COMPLETED',
|
|
71
|
+
'FAILED',
|
|
72
|
+
'CANCELLED',
|
|
73
|
+
'SKIPPED',
|
|
74
|
+
] as const;
|
|
75
|
+
|
|
76
|
+
export const CSV_EXPORT_DATA_COMPLETENESS_ENUMS = [
|
|
77
|
+
'COMPLETE',
|
|
78
|
+
'INTENTIONALLY_LIMITED',
|
|
79
|
+
'INCOMPLETE',
|
|
80
|
+
'UNKNOWN',
|
|
81
|
+
] as const;
|
|
82
|
+
|
|
83
|
+
export const CSV_EXPORT_ARTIFACT_KIND_ENUMS = [
|
|
84
|
+
'ANSWER_RESULT',
|
|
85
|
+
'SOURCE_SNAPSHOT',
|
|
86
|
+
'STEP_OUTPUT',
|
|
87
|
+
'CSV_FILE',
|
|
88
|
+
] as const;
|
|
89
|
+
|
|
90
|
+
export const CSV_EXPORT_ARTIFACT_COMPRESSION_ENUMS = ['NONE', 'GZIP'] as const;
|
|
91
|
+
|
|
92
|
+
export const CSV_EXPORT_DELIVERY_CHANNEL_ENUMS = [
|
|
93
|
+
'CHAT',
|
|
94
|
+
'SMS',
|
|
95
|
+
'EMAIL',
|
|
96
|
+
] as const;
|
|
97
|
+
|
|
98
|
+
export const CSV_EXPORT_REQUESTED_DELIVERY_CHANNEL_ENUMS = [
|
|
99
|
+
'CHAT',
|
|
100
|
+
'SMS',
|
|
101
|
+
'EMAIL',
|
|
102
|
+
'CHAT_AND_SMS',
|
|
103
|
+
'CHAT_AND_EMAIL',
|
|
104
|
+
'NONE',
|
|
105
|
+
] as const;
|
|
106
|
+
|
|
107
|
+
export const CSV_EXPORT_DELIVERY_STATUS_ENUMS = [
|
|
108
|
+
'PENDING',
|
|
109
|
+
'PROCESSING',
|
|
110
|
+
'SENT',
|
|
111
|
+
'FAILED',
|
|
112
|
+
'DEAD',
|
|
113
|
+
'SKIPPED',
|
|
114
|
+
] as const;
|
|
115
|
+
|
|
116
|
+
export const CSV_EXPORT_DELIVERY_SUMMARY_STATUS_ENUMS = [
|
|
117
|
+
'NOT_REQUESTED',
|
|
118
|
+
'PENDING',
|
|
119
|
+
'PROCESSING',
|
|
120
|
+
'SENT',
|
|
121
|
+
'PARTIALLY_SENT',
|
|
122
|
+
'FAILED',
|
|
123
|
+
'DEAD',
|
|
124
|
+
'SKIPPED',
|
|
125
|
+
] as const;
|
|
126
|
+
|
|
127
|
+
export const CSV_EXPORT_PROGRESS_EVENT_STATUS_ENUMS = [
|
|
128
|
+
'PENDING',
|
|
129
|
+
'PROCESSING',
|
|
130
|
+
'PROCESSED',
|
|
131
|
+
'FAILED',
|
|
132
|
+
'DEAD',
|
|
133
|
+
] as const;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
'PRICE',
|
|
7
|
-
'BOOLEAN',
|
|
8
|
-
'DATE',
|
|
9
|
-
'WEEK_OF_MON',
|
|
10
|
-
'WEEK_OF_SUN',
|
|
11
|
-
'DATETIME',
|
|
12
|
-
'SELECT',
|
|
13
|
-
'SELECT_OR_TEXT',
|
|
14
|
-
'MULTI_SELECT',
|
|
15
|
-
'JSON',
|
|
16
|
-
] as const;
|
|
1
|
+
// Registry-generated (dataTable field-type registry): the column type keys
|
|
2
|
+
// come from data_table_field_types rows; regenerate with (cwd: server/)
|
|
3
|
+
// `deno task generate:datatable-field-types`. Re-exported here so every
|
|
4
|
+
// existing import site keeps compiling unchanged.
|
|
5
|
+
export { DATA_TABLE_FIELD_TYPE_ENUMS } from './dataTableFieldTypes.generated.ts';
|
|
17
6
|
|
|
18
|
-
|
|
19
|
-
export const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
// Maximum UTF-16 length stored or relayed for one semantic DataTable text value.
|
|
8
|
+
export const DATA_TABLE_CELL_TEXT_MAX_CHARS = 10_000;
|
|
9
|
+
|
|
10
|
+
// Relative date filter values for agent data-table queries (query_data_table,
|
|
11
|
+
// saved tracker queries): { relative: { unit, offset, boundary } } is the
|
|
12
|
+
// START or END of the unit period containing the organization-local today,
|
|
13
|
+
// shifted by offset units. Weeks start on ISO Monday.
|
|
14
|
+
export const DATA_TABLE_RELATIVE_DATE_UNIT_ENUMS = ['DAY', 'WEEK', 'MONTH', 'QUARTER', 'YEAR'] as const;
|
|
15
|
+
|
|
16
|
+
export const DATA_TABLE_RELATIVE_DATE_BOUNDARY_ENUMS = ['START', 'END'] as const;
|
|
17
|
+
|
|
18
|
+
// Filter operators that accept a relative date value (DATE/DATETIME columns)
|
|
19
|
+
export const DATA_TABLE_RELATIVE_DATE_OPERATOR_ENUMS = ['EQUALS', 'BEFORE', 'AFTER', 'ON_OR_BEFORE', 'ON_OR_AFTER'] as const;
|
|
20
|
+
|
|
21
|
+
// Largest absolute offset, in units (3660 days is about ten years)
|
|
22
|
+
export const DATA_TABLE_RELATIVE_DATE_MAX_OFFSET = 3660;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// GENERATED FILE — DO NOT EDIT BY HAND.
|
|
2
|
+
// Regenerate with (cwd: server/): deno task generate:datatable-field-types (reads the data_table_field_types registry).
|
|
3
|
+
// Contract-checked by: deno task check:datatable-field-types
|
|
4
|
+
//
|
|
5
|
+
// KNOWN REMAINING PER-TYPE SITES (intentionally NOT registry-driven):
|
|
6
|
+
// - Only the NUMBER / DATE / WEEK semantics families route through the
|
|
7
|
+
// @jsb188/mday utils/dataTable.ts helpers; TEXT / ID / ID_OR_TEXT /
|
|
8
|
+
// BOOLEAN / DATETIME / SELECT / SELECT_OR_TEXT / MULTI_SELECT / JSON
|
|
9
|
+
// sites still compare fieldType literals directly (e.g. server
|
|
10
|
+
// sheet/sheetOps-regionSourceSQL.ts operator/typed-value routing). A NEW type key
|
|
11
|
+
// therefore only inherits behavior automatically when it binds to the
|
|
12
|
+
// NUMBER, DATE, or WEEK family; anything else is a code change.
|
|
13
|
+
// - Per-type UI editors/formatters and storage-column routing ARE the
|
|
14
|
+
// semantics and remain code behind the semantics keys.
|
|
15
|
+
|
|
16
|
+
import type { DataTableFieldTypeSemanticsKey } from '../utils/dataTableFieldTypeRegistry.ts';
|
|
17
|
+
|
|
18
|
+
export const DATA_TABLE_FIELD_TYPE_ENUMS = [
|
|
19
|
+
'TEXT',
|
|
20
|
+
'ID',
|
|
21
|
+
'ID_OR_TEXT',
|
|
22
|
+
'NUMBER',
|
|
23
|
+
'PRICE',
|
|
24
|
+
'BOOLEAN',
|
|
25
|
+
'DATE',
|
|
26
|
+
'WEEK_OF_MON',
|
|
27
|
+
'WEEK_OF_SUN',
|
|
28
|
+
'DATETIME',
|
|
29
|
+
'SELECT',
|
|
30
|
+
'SELECT_OR_TEXT',
|
|
31
|
+
'MULTI_SELECT',
|
|
32
|
+
'JSON',
|
|
33
|
+
'REFERENCE',
|
|
34
|
+
] as const;
|
|
35
|
+
|
|
36
|
+
// Column-type key → code-owned semantics family (registry rows; the
|
|
37
|
+
// utils/dataTable.ts helpers look types up here instead of hardcoding
|
|
38
|
+
// per-key literals). Const-asserted so the helper type predicates can
|
|
39
|
+
// derive their narrowed key unions from the registry snapshot.
|
|
40
|
+
export const DATA_TABLE_FIELD_TYPE_SEMANTICS = {
|
|
41
|
+
TEXT: 'TEXT',
|
|
42
|
+
ID: 'ID',
|
|
43
|
+
ID_OR_TEXT: 'ID_OR_TEXT',
|
|
44
|
+
NUMBER: 'NUMBER',
|
|
45
|
+
PRICE: 'NUMBER',
|
|
46
|
+
BOOLEAN: 'BOOLEAN',
|
|
47
|
+
DATE: 'DATE',
|
|
48
|
+
WEEK_OF_MON: 'WEEK',
|
|
49
|
+
WEEK_OF_SUN: 'WEEK',
|
|
50
|
+
DATETIME: 'DATETIME',
|
|
51
|
+
SELECT: 'SELECT',
|
|
52
|
+
SELECT_OR_TEXT: 'SELECT_OR_TEXT',
|
|
53
|
+
MULTI_SELECT: 'MULTI_SELECT',
|
|
54
|
+
JSON: 'JSON',
|
|
55
|
+
REFERENCE: 'REFERENCE',
|
|
56
|
+
} as const satisfies Record<
|
|
57
|
+
(typeof DATA_TABLE_FIELD_TYPE_ENUMS)[number],
|
|
58
|
+
DataTableFieldTypeSemanticsKey
|
|
59
|
+
>;
|