@jsb188/mday 1.1.10 → 1.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/package.json +105 -54
  2. package/src/constants/agentDoc.ts +12 -0
  3. package/src/constants/agentMemory.ts +154 -0
  4. package/src/constants/aiChat.ts +5 -0
  5. package/src/constants/campaign.ts +127 -0
  6. package/src/constants/dataTable.ts +35 -9
  7. package/src/constants/dataTableFieldTypes.generated.ts +63 -0
  8. package/src/constants/docAccess.ts +32 -0
  9. package/src/constants/email.ts +20 -4
  10. package/src/constants/fieldDoc.ts +34 -0
  11. package/src/constants/graphqlReactivity.ts +113 -0
  12. package/src/constants/integration.ts +8 -9
  13. package/src/constants/log.ts +7 -410
  14. package/src/constants/logActivityGroupColors.generated.ts +19 -0
  15. package/src/constants/logTaxonomy.generated.ts +1103 -0
  16. package/src/constants/noteDoc.ts +77 -0
  17. package/src/constants/organization.ts +13 -15
  18. package/src/constants/pageRoute.ts +23 -0
  19. package/src/constants/schedule.ts +220 -0
  20. package/src/constants/scheduleRuleTemplateSeed.ts +138 -0
  21. package/src/constants/scheduleRuleTemplates.generated.ts +145 -0
  22. package/src/constants/sheet.ts +154 -6
  23. package/src/constants/sheetRegionSources.generated.ts +578 -0
  24. package/src/constants/square.ts +6 -6
  25. package/src/constants/storage.ts +56 -7
  26. package/src/constants/usage.ts +79 -0
  27. package/src/schemas/editLogEntry.ts +1010 -777
  28. package/src/schemas/fieldDocsQuery.ts +12 -0
  29. package/src/schemas/inboundContact.ts +60 -55
  30. package/src/schemas/logsQuery.ts +55 -49
  31. package/src/schemas/organization.ts +49 -46
  32. package/src/types/account.d.ts +4 -1
  33. package/src/types/agentDoc.d.ts +64 -0
  34. package/src/types/agentMemory.d.ts +74 -0
  35. package/src/types/campaign.d.ts +683 -0
  36. package/src/types/dataTable.d.ts +175 -256
  37. package/src/types/docAccess.d.ts +96 -0
  38. package/src/types/email.d.ts +83 -12
  39. package/src/types/fieldDoc.d.ts +273 -0
  40. package/src/types/inboundContact.d.ts +2 -1
  41. package/src/types/log.d.ts +209 -341
  42. package/src/types/noteDoc.d.ts +86 -0
  43. package/src/types/organization.d.ts +83 -40
  44. package/src/types/pageRoute.d.ts +48 -0
  45. package/src/types/schedule.d.ts +391 -0
  46. package/src/types/sheet.d.ts +862 -30
  47. package/src/types/storage.d.ts +206 -125
  48. package/src/types/usage.d.ts +106 -0
  49. package/src/types/workflow.d.ts +149 -18
  50. package/src/utils/agentDoc.ts +109 -0
  51. package/src/utils/aiChat.ts +26 -0
  52. package/src/utils/campaign.ts +741 -0
  53. package/src/utils/campaignFormEditor.ts +871 -0
  54. package/src/utils/dataTable.ts +425 -410
  55. package/src/utils/dataTableFieldTypeRegistry.ts +105 -0
  56. package/src/utils/dataTableRealtimeAuthority.ts +209 -0
  57. package/src/utils/dataTableRealtimeSelection.ts +134 -0
  58. package/src/utils/dataTableRowDocument.ts +508 -0
  59. package/src/utils/dataTableSource.ts +230 -0
  60. package/src/utils/docAccess.ts +383 -0
  61. package/src/utils/documentName.ts +53 -0
  62. package/src/utils/email.ts +112 -53
  63. package/src/utils/fieldDoc.ts +113 -0
  64. package/src/utils/log.ts +169 -176
  65. package/src/utils/logRegistryValue.ts +90 -0
  66. package/src/utils/logStoreRead.ts +266 -0
  67. package/src/utils/logTaxonomy.ts +76 -0
  68. package/src/utils/logTaxonomyDisplay.ts +439 -0
  69. package/src/utils/noteDoc.ts +827 -0
  70. package/src/utils/organization.ts +510 -91
  71. package/src/utils/pageRoute.ts +71 -0
  72. package/src/utils/schedule.ts +799 -0
  73. package/src/utils/scheduleEvaluation.ts +1994 -0
  74. package/src/utils/scheduleICS.ts +246 -0
  75. package/src/utils/scheduleRuleTemplates.ts +188 -0
  76. package/src/utils/sheet.ts +4842 -39
  77. package/src/utils/sheetAxisMove.ts +830 -0
  78. package/src/utils/sheetBootstrap.ts +1769 -0
  79. package/src/utils/sheetCommand.ts +423 -0
  80. package/src/utils/sheetExport.ts +238 -0
  81. package/src/utils/sheetFormulaEvaluation.ts +914 -0
  82. package/src/utils/sheetFormulaEvaluator.ts +852 -0
  83. package/src/utils/sheetJournal.ts +78 -0
  84. package/src/utils/sheetNumberFormat.ts +1211 -0
  85. package/src/utils/sheetRegion.ts +374 -0
  86. package/src/utils/sheetRegionFilter.ts +1259 -0
  87. package/src/utils/sheetRegionSourceRegistry.ts +594 -0
  88. package/src/utils/sheetSequence.ts +148 -0
  89. package/src/utils/sheetSnapshot.ts +992 -0
  90. package/src/utils/sheetStructureEdit.ts +1284 -0
  91. package/src/utils/square.ts +22 -12
  92. package/src/utils/storage.ts +152 -0
  93. package/src/utils/table-route.ts +127 -11
  94. package/src/utils/workflow.ts +191 -23
  95. package/tests/dataTableFieldTypeRegistry.test.ts +110 -0
  96. package/tests/docAccess.test.ts +525 -0
  97. package/tests/editLogEntry.test.ts +112 -0
  98. package/tests/noteDoc.test.ts +669 -0
  99. package/tests/schedule.test.ts +693 -0
  100. package/tests/scheduleEvaluation.test.ts +1970 -0
  101. package/tests/scheduleICS.test.ts +208 -0
  102. package/tests/scheduleRuleTemplates.test.ts +176 -0
  103. package/tests/scheduleSweepInvariants.test.ts +428 -0
  104. package/tests/sheetAxisMove.test.ts +343 -0
  105. package/tests/sheetFormulaEvaluator.test.ts +575 -0
  106. package/tests/sheetRegionFilter.test.ts +1135 -0
  107. package/tests/sheetSequence.test.ts +41 -0
  108. package/tests/sheetStructureEdit.test.ts +82 -0
  109. package/tsconfig.json +10 -10
  110. package/vitest.config.ts +8 -0
  111. package/src/constants/log-activityTexts.ts +0 -235
  112. package/src/constants/product.ts +0 -42
  113. package/src/constants/report.ts +0 -44
  114. package/src/schemas/productsQuery.ts +0 -53
  115. package/src/schemas/reportsQuery.ts +0 -20
  116. package/src/types/product.d.ts +0 -84
  117. package/src/types/report.d.ts +0 -290
  118. package/src/utils/product-calEvent.ts +0 -455
  119. package/src/utils/report.ts +0 -158
@@ -0,0 +1,112 @@
1
+ import { expect, it } from 'vitest';
2
+ import { makeLogMetadataSchema } from '../src/schemas/editLogEntry.ts';
3
+ import type { LogTaxonomyGQL } from '../src/types/log.d.ts';
4
+
5
+ /*
6
+ * Build the smallest taxonomy needed to exercise accounting-field visibility.
7
+ */
8
+ function makeTaxonomy(activityKey: string, groupKey: string): LogTaxonomyGQL {
9
+ return {
10
+ operation: 'ARABLE',
11
+ groups: [
12
+ {
13
+ key: groupKey,
14
+ label: groupKey,
15
+ ordinal: 0,
16
+ requiredFields: activityKey === 'SEED_PURCHASE_INFO' ? ['item'] : [],
17
+ orRequiredFields: [],
18
+ },
19
+ ],
20
+ activities: [
21
+ {
22
+ key: activityKey,
23
+ groupKey,
24
+ agentText: activityKey,
25
+ ordinal: 0,
26
+ requiredFields: null,
27
+ orRequiredFields: null,
28
+ },
29
+ ],
30
+ fieldDefs: [
31
+ {
32
+ key: 'tax',
33
+ fieldType: 'MONEY',
34
+ required: false,
35
+ ordinal: 0,
36
+ agentHint: null,
37
+ options: null,
38
+ allowedUnits: null,
39
+ groupKey: null,
40
+ activityKey: null,
41
+ },
42
+ ],
43
+ };
44
+ }
45
+
46
+ /*
47
+ * Return the form field names emitted for one activity's editor.
48
+ */
49
+ function getSchemaFieldNames(activityKey: string, groupKey: string): string[] {
50
+ const schema = makeLogMetadataSchema(
51
+ {
52
+ details: {
53
+ activity: activityKey,
54
+ __groupKey: groupKey,
55
+ },
56
+ },
57
+ {
58
+ __typename: 'LogEntryDetails',
59
+ scrollAreaDOMId: 'test-scroll-area',
60
+ formId: 'test-form',
61
+ timeZone: 'America/Los_Angeles',
62
+ focusedName: '',
63
+ isCreateNew: false,
64
+ taxonomy: makeTaxonomy(activityKey, groupKey),
65
+ },
66
+ );
67
+
68
+ return schema
69
+ .map((schemaItem) => schemaItem?.item?.name)
70
+ .filter((fieldName): fieldName is string => typeof fieldName === 'string');
71
+ }
72
+
73
+ it('omits accounting-only fields from non-financial log editors', () => {
74
+ const fieldNames = getSchemaFieldNames(
75
+ 'EQUIPMENT_MATERIAL',
76
+ 'CLEANING_AND_SANITATION',
77
+ );
78
+
79
+ expect(
80
+ fieldNames.filter((fieldName) =>
81
+ [
82
+ 'details.price',
83
+ 'details.otherParty',
84
+ 'details.fields.tax',
85
+ 'details.referenceNumber',
86
+ 'details.voided',
87
+ ].includes(fieldName),
88
+ ),
89
+ ).toEqual([]);
90
+ });
91
+
92
+ it('retains accounting fields in financial log editors', () => {
93
+ const fieldNames = getSchemaFieldNames('SEED_PURCHASE_INFO', 'SEED');
94
+
95
+ expect(
96
+ fieldNames.filter((fieldName) =>
97
+ [
98
+ 'details.price',
99
+ 'details.otherParty',
100
+ 'details.fields.tax',
101
+ 'details.referenceNumber',
102
+ 'details.voided',
103
+ ].includes(fieldName),
104
+ ),
105
+ ).toEqual([
106
+ 'details.price',
107
+ 'details.otherParty',
108
+ 'details.fields.tax',
109
+ 'details.referenceNumber',
110
+ 'details.voided',
111
+ ]);
112
+ });