@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.
Files changed (210) hide show
  1. package/package.json +140 -54
  2. package/src/constants/agentMemory.ts +123 -0
  3. package/src/constants/agentNote.ts +212 -0
  4. package/src/constants/aiChat.ts +10 -0
  5. package/src/constants/billing.ts +126 -0
  6. package/src/constants/campaign.ts +236 -0
  7. package/src/constants/contact.ts +72 -0
  8. package/src/constants/csvExport.ts +133 -0
  9. package/src/constants/dataTable.ts +21 -21
  10. package/src/constants/dataTableFieldTypes.generated.ts +59 -0
  11. package/src/constants/docAccess.ts +33 -0
  12. package/src/constants/dt.ts +234 -0
  13. package/src/constants/email.ts +125 -7
  14. package/src/constants/fieldDoc.ts +104 -0
  15. package/src/constants/graphqlReactivity.ts +196 -0
  16. package/src/constants/integration.ts +8 -9
  17. package/src/constants/log.ts +14 -408
  18. package/src/constants/logDisplay/README.md +88 -0
  19. package/src/constants/logDisplay/defaults.ts +39 -0
  20. package/src/constants/logDisplay/index.ts +27 -0
  21. package/src/constants/logDisplay/operations/arable.ts +16 -0
  22. package/src/constants/logDisplay/operations/farmersMarket.ts +10 -0
  23. package/src/constants/logDisplay/operations/foodManufacturing.ts +13 -0
  24. package/src/constants/logDisplay/shared/accounting.ts +13 -0
  25. package/src/constants/logDisplay/shared/interactions.ts +13 -0
  26. package/src/constants/logDisplay/shared/rackTemperatures.ts +42 -0
  27. package/src/constants/logTaxonomy.generated.ts +2207 -0
  28. package/src/constants/noteDoc.ts +77 -0
  29. package/src/constants/organization.ts +18 -21
  30. package/src/constants/pageRoute.ts +23 -0
  31. package/src/constants/qrCode.ts +30 -0
  32. package/src/constants/sheet.ts +126 -14
  33. package/src/constants/sms.ts +18 -0
  34. package/src/constants/square.ts +6 -6
  35. package/src/constants/storage.ts +80 -7
  36. package/src/constants/usage.ts +82 -0
  37. package/src/constants/workflowSteps.ts +60 -0
  38. package/src/schemas/editLogEntry.ts +836 -780
  39. package/src/schemas/inboundContact.ts +60 -55
  40. package/src/schemas/logsQuery.ts +55 -49
  41. package/src/types/account.d.ts +4 -1
  42. package/src/types/agentMemory.d.ts +98 -0
  43. package/src/types/agentNote.d.ts +443 -0
  44. package/src/types/billing.d.ts +537 -0
  45. package/src/types/campaign.d.ts +1533 -0
  46. package/src/types/contact.d.ts +15 -0
  47. package/src/types/csvExport.d.ts +213 -0
  48. package/src/types/dataAnalysis.d.ts +44 -0
  49. package/src/types/dataTable.d.ts +115 -403
  50. package/src/types/definitionElement.d.ts +35 -0
  51. package/src/types/docAccess.d.ts +96 -0
  52. package/src/types/dt.d.ts +257 -0
  53. package/src/types/email.d.ts +184 -24
  54. package/src/types/emailReplyReport.d.ts +76 -0
  55. package/src/types/fieldDoc.d.ts +702 -0
  56. package/src/types/fieldDocContract.d.ts +90 -0
  57. package/src/types/inboundContact.d.ts +10 -1
  58. package/src/types/log.d.ts +254 -295
  59. package/src/types/logDisplay.types.ts +85 -0
  60. package/src/types/organization.d.ts +91 -43
  61. package/src/types/pageRoute.d.ts +48 -0
  62. package/src/types/qrCode.d.ts +96 -0
  63. package/src/types/richText.d.ts +81 -0
  64. package/src/types/sheet.d.ts +678 -129
  65. package/src/types/sms.d.ts +38 -0
  66. package/src/types/storage.d.ts +449 -129
  67. package/src/types/usage.d.ts +106 -0
  68. package/src/types/workflow.d.ts +315 -54
  69. package/src/utils/agentMemory.ts +15 -0
  70. package/src/utils/agentNote.ts +850 -0
  71. package/src/utils/aiChat.ts +43 -0
  72. package/src/utils/aiChatWork.ts +64 -0
  73. package/src/utils/billing.ts +37 -0
  74. package/src/utils/campaign.ts +1174 -0
  75. package/src/utils/campaignAI.ts +72 -0
  76. package/src/utils/campaignAccess.ts +239 -0
  77. package/src/utils/campaignEmail.ts +601 -0
  78. package/src/utils/campaignEmailCompiler.ts +372 -0
  79. package/src/utils/campaignEmailImages.ts +60 -0
  80. package/src/utils/campaignEmailStyles.ts +544 -0
  81. package/src/utils/campaignLifecycle.ts +104 -0
  82. package/src/utils/campaignPreview.ts +285 -0
  83. package/src/utils/contact.ts +50 -0
  84. package/src/utils/csvExport.ts +19 -0
  85. package/src/utils/dataTable.ts +95 -618
  86. package/src/utils/dataTableFieldTypeRegistry.ts +106 -0
  87. package/src/utils/dataTableRelativeDate.ts +447 -0
  88. package/src/utils/definitionElement.ts +84 -0
  89. package/src/utils/docAccess.ts +383 -0
  90. package/src/utils/documentName.ts +53 -0
  91. package/src/utils/email.ts +317 -51
  92. package/src/utils/emailReplyReport.test.ts +187 -0
  93. package/src/utils/emailReplyReport.ts +143 -0
  94. package/src/utils/fieldDoc.ts +157 -0
  95. package/src/utils/fieldDocAnswers.ts +128 -0
  96. package/src/utils/fieldDocDefaults.ts +36 -0
  97. package/src/utils/fieldDocProgram.ts +36 -0
  98. package/src/utils/fieldDocSummary.ts +30 -0
  99. package/src/utils/log.ts +276 -192
  100. package/src/utils/logDisplay.helpers.ts +177 -0
  101. package/src/utils/logDisplay.ts +87 -0
  102. package/src/utils/logRegistryValue.ts +90 -0
  103. package/src/utils/logStoreRead.ts +262 -0
  104. package/src/utils/logTaxonomy.helpers.ts +17 -0
  105. package/src/utils/logTaxonomy.ts +76 -0
  106. package/src/utils/logTaxonomyDisplay.ts +395 -0
  107. package/src/utils/noteDoc.ts +609 -0
  108. package/src/utils/organization.ts +337 -84
  109. package/src/utils/pageRoute.ts +71 -0
  110. package/src/utils/qrCode.helpers.ts +189 -0
  111. package/src/utils/qrCode.test.ts +519 -0
  112. package/src/utils/qrCode.ts +273 -0
  113. package/src/utils/richTextHTML.ts +385 -0
  114. package/src/utils/sheet.ts +199 -107
  115. package/src/utils/sheetAxisMove.ts +616 -0
  116. package/src/utils/sheetBootstrap.ts +1402 -0
  117. package/src/utils/sheetCellLiteral.ts +101 -0
  118. package/src/utils/sheetCommand.ts +358 -0
  119. package/src/utils/sheetDesign.ts +705 -0
  120. package/src/utils/sheetExport.ts +186 -0
  121. package/src/utils/sheetFeatureReference.ts +183 -0
  122. package/src/utils/sheetFormulaArgs.ts +168 -0
  123. package/src/utils/sheetFormulaCompile.ts +475 -0
  124. package/src/utils/sheetFormulaConditionalAggregate.ts +254 -0
  125. package/src/utils/sheetFormulaCriteria.ts +656 -0
  126. package/src/utils/sheetFormulaDate.ts +444 -0
  127. package/src/utils/sheetFormulaEvaluation.ts +899 -0
  128. package/src/utils/sheetFormulaEvaluator.ts +997 -0
  129. package/src/utils/sheetFormulaFunctionHandlers.ts +403 -0
  130. package/src/utils/sheetFormulaLogical.ts +116 -0
  131. package/src/utils/sheetFormulaLookup.ts +488 -0
  132. package/src/utils/sheetFormulaMath.ts +48 -0
  133. package/src/utils/sheetFormulaParser.ts +729 -0
  134. package/src/utils/sheetFormulaRange.ts +330 -0
  135. package/src/utils/sheetFormulaReference.ts +703 -0
  136. package/src/utils/sheetFormulaReferenceAggregates.ts +313 -0
  137. package/src/utils/sheetFormulaReferenceDates.ts +237 -0
  138. package/src/utils/sheetFormulaReferenceLogical.ts +330 -0
  139. package/src/utils/sheetFormulaReferenceLookup.ts +341 -0
  140. package/src/utils/sheetFormulaReferenceMath.ts +95 -0
  141. package/src/utils/sheetFormulaReferenceRewrite.ts +220 -0
  142. package/src/utils/sheetFormulaReferenceText.ts +462 -0
  143. package/src/utils/sheetFormulaSyntax.ts +1027 -0
  144. package/src/utils/sheetFormulaText.ts +430 -0
  145. package/src/utils/sheetJournal.ts +200 -0
  146. package/src/utils/sheetNumberFormat.ts +1012 -0
  147. package/src/utils/sheetPreview.ts +68 -0
  148. package/src/utils/sheetSequence.ts +118 -0
  149. package/src/utils/sheetSnapshot.ts +739 -0
  150. package/src/utils/sheetStructureEdit.ts +914 -0
  151. package/src/utils/sheetStructureReferences.ts +389 -0
  152. package/src/utils/square.ts +22 -12
  153. package/src/utils/storage.ts +198 -0
  154. package/src/utils/table-route.ts +127 -11
  155. package/src/utils/time.ts +12 -0
  156. package/src/utils/workflow.ts +334 -40
  157. package/src/utils/workflowLogFingerprint.ts +302 -0
  158. package/src/utils/workflowLogRevisionSnapshot.ts +424 -0
  159. package/src/utils/workflowProgress.ts +280 -0
  160. package/src/utils/workflowTriggers.ts +61 -0
  161. package/tests/agentNote.test.ts +395 -0
  162. package/tests/campaignAI.test.ts +119 -0
  163. package/tests/campaignAccess.test.ts +239 -0
  164. package/tests/campaignEmail.test.ts +441 -0
  165. package/tests/campaignLifecycle.test.ts +134 -0
  166. package/tests/campaignPublication.test.ts +309 -0
  167. package/tests/dataTableFieldTypeRegistry.test.ts +111 -0
  168. package/tests/dataTableRelativeDate.test.ts +412 -0
  169. package/tests/docAccess.test.ts +525 -0
  170. package/tests/editLogEntry.test.ts +112 -0
  171. package/tests/email.test.ts +39 -0
  172. package/tests/fieldDocProgram.test.ts +114 -0
  173. package/tests/logDisplay.fixtures.ts +67 -0
  174. package/tests/logDisplay.test.ts +227 -0
  175. package/tests/noteDoc.test.ts +514 -0
  176. package/tests/richTextHTML.test.ts +185 -0
  177. package/tests/sheetAxisMove.test.ts +352 -0
  178. package/tests/sheetBootstrap.test.ts +1967 -0
  179. package/tests/sheetFeatureReference.test.ts +22 -0
  180. package/tests/sheetFormulaCriteria.test.ts +269 -0
  181. package/tests/sheetFormulaEvaluator.test.ts +468 -0
  182. package/tests/sheetFormulaFunctions.test.ts +538 -0
  183. package/tests/sheetFormulaLanguage.test.ts +361 -0
  184. package/tests/sheetFormulaParity.fixtures.ts +872 -0
  185. package/tests/sheetFormulaParity.test.ts +188 -0
  186. package/tests/sheetFormulaRange.test.ts +167 -0
  187. package/tests/sheetFormulaReference.test.ts +78 -0
  188. package/tests/sheetFormulaReferenceRewrite.test.ts +117 -0
  189. package/tests/sheetFormulaTextDate.test.ts +512 -0
  190. package/tests/sheetSequence.test.ts +22 -0
  191. package/tests/sheetSnapshot.test.ts +134 -0
  192. package/tests/sheetStructureEdit.test.ts +537 -0
  193. package/tests/sheetStructureReferences.test.ts +589 -0
  194. package/tests/workflowLifecycleStatus.test.ts +60 -0
  195. package/tests/workflowLogFingerprint.test.ts +203 -0
  196. package/tests/workflowLogRevisionSnapshot.test.ts +96 -0
  197. package/tests/workflowProgress.test.ts +180 -0
  198. package/tests/workflowTriggers.test.ts +29 -0
  199. package/tsconfig.json +10 -10
  200. package/vitest.config.ts +8 -0
  201. package/src/constants/log-activityTexts.ts +0 -235
  202. package/src/constants/product.ts +0 -42
  203. package/src/constants/report.ts +0 -44
  204. package/src/schemas/organization.ts +0 -65
  205. package/src/schemas/productsQuery.ts +0 -53
  206. package/src/schemas/reportsQuery.ts +0 -20
  207. package/src/types/product.d.ts +0 -84
  208. package/src/types/report.d.ts +0 -290
  209. package/src/utils/product-calEvent.ts +0 -455
  210. package/src/utils/report.ts +0 -158
@@ -0,0 +1,85 @@
1
+ import type { LogEntryGQL, LogTaxonomyGQL } from './log.d.ts';
2
+
3
+ // Custom registry fields always use field:KEY, even when KEY matches an envelope field.
4
+ export type LogDisplayFieldKey =
5
+ | 'date'
6
+ | 'logType'
7
+ | 'activity'
8
+ | 'interactionType'
9
+ | 'childOrgName'
10
+ | 'item'
11
+ | 'quantity'
12
+ | 'price'
13
+ | 'values'
14
+ | 'otherParty'
15
+ | 'referenceNumber'
16
+ | 'voided'
17
+ | 'location'
18
+ | `field:${string}`;
19
+
20
+ export type LogDisplayLayout = 'metadata' | 'purchaseInvoice' | 'saleInvoice' | 'receipt';
21
+
22
+ export interface LogDisplayFieldDefinition {
23
+ labelKey?: string | null;
24
+ formatter?: 'auto' | 'temperature' | 'currency' | null;
25
+ unitField?: LogDisplayFieldKey | null;
26
+ hidden?: boolean;
27
+ span?: 'half' | 'full';
28
+ empty?: 'hide' | 'show';
29
+ }
30
+
31
+ export interface LogDisplayDefinition {
32
+ layout?: LogDisplayLayout;
33
+ order?: readonly (LogDisplayFieldKey | '*')[];
34
+ fields?: Partial<Record<LogDisplayFieldKey, LogDisplayFieldDefinition>>;
35
+ }
36
+
37
+ export interface LogDisplayScope extends LogDisplayDefinition {
38
+ // Ordered, non-recursive shared profiles; missing names are configuration errors.
39
+ profiles?: readonly string[];
40
+ }
41
+
42
+ export interface LogOperationDisplay {
43
+ defaults?: LogDisplayScope;
44
+ groups?: Readonly<Record<string, LogDisplayScope>>;
45
+ activities?: Readonly<Record<string, LogDisplayScope>>;
46
+ }
47
+
48
+ export interface LogDisplayRegistry {
49
+ defaults: LogDisplayDefinition;
50
+ shared: Readonly<Record<string, LogDisplayDefinition>>;
51
+ operations: Readonly<Record<string, LogOperationDisplay>>;
52
+ }
53
+
54
+ export interface ResolvedLogDisplayDefinition {
55
+ layout: LogDisplayLayout;
56
+ order: readonly (LogDisplayFieldKey | '*')[];
57
+ fields: Partial<Record<LogDisplayFieldKey, LogDisplayFieldDefinition>>;
58
+ }
59
+
60
+ export interface LogDisplayContext {
61
+ operation?: string | null;
62
+ groupKey?: string | null;
63
+ activityKey?: string | null;
64
+ taxonomy?: LogTaxonomyGQL | null;
65
+ }
66
+
67
+ export interface LogDisplayRow {
68
+ key: LogDisplayFieldKey;
69
+ label: string;
70
+ value: string;
71
+ span: 'half' | 'full';
72
+ badgeGroupKey?: string;
73
+ }
74
+
75
+ export interface LogEntryDisplay {
76
+ layout: LogDisplayLayout;
77
+ rows: LogDisplayRow[];
78
+ }
79
+
80
+ export interface LogDisplayInput {
81
+ logEntry: LogEntryGQL;
82
+ operation?: string | null;
83
+ taxonomy?: LogTaxonomyGQL | null;
84
+ timeZone: string | null;
85
+ }
@@ -1,27 +1,34 @@
1
- import {
2
- COMPLIANCE_DOCUMENT_TYPE_ENUMS,
3
- OPERATION_ENUMS,
4
- ORG_CONTACTS,
5
- ROLE_CATEGORY_ENUMS,
6
- ROLE_ENUMS
7
- } from '../constants/organization.ts';
8
- import { PRODUCT_FEATURES } from '../constants/product.ts';
1
+ import type { SupportedLogLanguage } from '@jsb188/app/constants/app.ts';
9
2
 
10
3
  import type { AddressObj } from '@jsb188/app/types/other.d.ts';
11
- import type { IntegrationConnectionData, IntegrationConnectionGQL } from './integration.d.ts';
12
- import type { StorageData, StorageGQL } from './storage.d.ts';
4
+ import {
5
+ COMPLIANCE_DOCUMENT_TYPE_ENUMS,
6
+ OPERATION_ENUMS,
7
+ ORG_CONTACTS,
8
+ ROLE_CATEGORY_ENUMS,
9
+ ROLE_ENUMS,
10
+ } from '../constants/organization.ts';
13
11
  import type { OrganizationRouteSettingsObj } from '../utils/table-route.ts';
12
+ import type {
13
+ IntegrationConnectionData,
14
+ IntegrationConnectionGQL,
15
+ } from './integration.d.ts';
16
+ import type { StorageData, StorageGQL } from './storage.d.ts';
14
17
 
15
18
  /*
16
19
  * Enums
17
20
  */
18
21
 
19
- export type OrganizationFeatureEnum = typeof PRODUCT_FEATURES[number];
20
- export type OrganizationRoleEnum = typeof ROLE_ENUMS[number];
21
- export type OrganizationOperationEnum = typeof OPERATION_ENUMS[number];
22
- export type OrganizationDepartmentEnum = typeof ORG_CONTACTS[number];
23
- export type OrganizationRoleCategoryEnum = typeof ROLE_CATEGORY_ENUMS[number];
24
- export type OrganizationComplianceType = typeof COMPLIANCE_DOCUMENT_TYPE_ENUMS[number];
22
+ export type OrganizationRoleEnum = (typeof ROLE_ENUMS)[number];
23
+ // Known keys retain autocomplete, while registry-launched operations remain
24
+ // valid without requiring a TypeScript/codegen change.
25
+ export type OrganizationOperationEnum =
26
+ | (typeof OPERATION_ENUMS)[number]
27
+ | (string & {});
28
+ export type OrganizationDepartmentEnum = (typeof ORG_CONTACTS)[number];
29
+ export type OrganizationRoleCategoryEnum = (typeof ROLE_CATEGORY_ENUMS)[number];
30
+ export type OrganizationComplianceType =
31
+ (typeof COMPLIANCE_DOCUMENT_TYPE_ENUMS)[number];
25
32
 
26
33
  /**
27
34
  * Query filters
@@ -76,20 +83,40 @@ export interface OrganizationData {
76
83
  __table: 'organizations';
77
84
  id: bigint;
78
85
  stripeCustomerId: string | null;
79
- inboundEmail: string | null;
86
+ emailHandle: string | null;
80
87
  name: string;
81
88
  commodities: string[] | null;
82
89
  operation: OrganizationOperationEnum;
83
- features: OrganizationFeatureEnum[];
84
90
  settings?: OrganizationSettingsObj | null;
91
+ directory?: OrgContact[] | null; // Own organization_contacts rows mapped to contacts (attached by fetch paths)
85
92
  address?:
86
93
  | null
87
- | AddressObj & {
88
- __table: 'organization_addresses';
89
- organizationId: bigint;
90
- };
94
+ | (AddressObj & {
95
+ __table: 'organization_addresses';
96
+ organizationId: bigint;
97
+ });
91
98
  integrations?: IntegrationConnectionData[] | null;
92
99
  activated: boolean;
100
+ authorizationEpoch?: number | bigint;
101
+ }
102
+
103
+ /**
104
+ * Organization directory contact row (organization_contacts table).
105
+ * "ownerOrgId" NULL means the org's own directory entry; set means a private
106
+ * per-department override maintained by that parent org for this child org.
107
+ */
108
+
109
+ export interface OrganizationContactData {
110
+ __table: 'organization_contacts';
111
+ id: bigint;
112
+ organizationId: bigint;
113
+ ownerOrgId?: bigint | null;
114
+ department: OrganizationDepartmentEnum;
115
+ name?: string | null;
116
+ emailAddress?: string | null;
117
+ phoneNumber?: string | null;
118
+ createdAt: Date;
119
+ updatedAt: Date;
93
120
  }
94
121
 
95
122
  export interface OrganizationSiteData {
@@ -119,25 +146,44 @@ export interface MergedOrgContact extends OrgContact {
119
146
  locked?: boolean;
120
147
  }
121
148
 
122
- export interface OrganizationSidebarItemObj {
149
+ export type OrganizationSidebarItemKindEnum = 'LINK' | 'BREAK' | 'GROUP';
150
+
151
+ export interface OrganizationSidebarLinkItemObj {
152
+ kind?: 'LINK' | null;
123
153
  slug: string;
124
154
  label: string;
125
155
  iconName: string | null;
156
+ order?: number | null;
157
+ }
158
+
159
+ export interface OrganizationSidebarBreakItemObj {
160
+ kind: 'BREAK';
161
+ order?: number | null;
126
162
  }
127
163
 
128
- export interface OrganizationSidebarGroupObj {
129
- title: string;
164
+ export interface OrganizationSidebarGroupItemObj {
165
+ kind: 'GROUP';
166
+ label: string;
130
167
  items: OrganizationSidebarItemObj[];
168
+ order?: number | null;
131
169
  }
132
170
 
171
+ export type OrganizationSidebarItemObj =
172
+ | OrganizationSidebarLinkItemObj
173
+ | OrganizationSidebarBreakItemObj
174
+ | OrganizationSidebarGroupItemObj;
175
+
133
176
  export interface OrganizationSettingsObj {
177
+ schedule?: { defaultSurface?: 'PROJECT' | 'COVERAGE' | null };
134
178
  timeZone: string | null;
135
179
  language: string | null;
180
+ displayTranslatedLogs: boolean;
181
+ translateLanguage: SupportedLogLanguage | null;
182
+ logRevisionsProof?: boolean;
136
183
  color: string | null;
137
184
  priorityService: boolean;
138
- directory?: OrgContact[];
139
185
  routes?: Record<string, OrganizationRouteSettingsObj>;
140
- sidebar?: OrganizationSidebarGroupObj[] | null;
186
+ sidebar?: OrganizationSidebarItemObj[] | null;
141
187
  }
142
188
 
143
189
  export interface OrganizationChildData {
@@ -145,13 +191,13 @@ export interface OrganizationChildData {
145
191
  parentId: number | bigint | null;
146
192
  childId: number | bigint;
147
193
  organization: OrganizationData;
148
- preferredContacts?: {
149
- [key: OrganizationDepartmentEnum]: Partial<{
150
- name: string | null;
151
- phoneNumber: string | null;
152
- emailAddress: string | null;
153
- }>;
154
- };
194
+ preferredContacts?: {
195
+ [key: OrganizationDepartmentEnum]: Partial<{
196
+ name: string | null;
197
+ phoneNumber: string | null;
198
+ emailAddress: string | null;
199
+ }>;
200
+ };
155
201
  memory?: string | null;
156
202
  affiliated: boolean;
157
203
  addedAt: Date;
@@ -187,18 +233,19 @@ export interface OrganizationComplianceGQL {
187
233
  }
188
234
 
189
235
  export interface OrganizationGQL {
190
- __deleted?: boolean;
236
+ __deleted?: boolean;
191
237
 
192
238
  id: string;
239
+ readableId?: string | null;
193
240
  stripeCustomerId: string | null;
194
- inboundEmail: string | null;
241
+ emailHandle: string | null;
195
242
  name: string;
196
243
  commodities: string[] | null;
197
244
  address: AddressObj;
198
245
  operation: OrganizationOperationEnum;
199
246
  compliance: OrganizationComplianceGQL[] | null;
200
247
  integrations: IntegrationConnectionGQL[] | null;
201
- features: OrganizationFeatureEnum[];
248
+ logTaxonomy?: import('./log.d.ts').LogTaxonomyGQL | null;
202
249
  settings?: OrganizationSettingsObj | null;
203
250
  directory: OrgContact[];
204
251
  activated: boolean;
@@ -246,7 +293,7 @@ export interface OrganizationRelAccountGQL {
246
293
  }
247
294
 
248
295
  export interface OrganizationRelGQL {
249
- __deleted?: boolean;
296
+ __deleted?: boolean;
250
297
 
251
298
  id: string;
252
299
  organizationId?: string;
@@ -258,13 +305,13 @@ export interface OrganizationRelGQL {
258
305
  }
259
306
 
260
307
  export interface OrganizationChildGQL {
261
- __deleted?: boolean;
308
+ __deleted?: boolean;
262
309
 
263
310
  id: string;
264
- parentId: string;
265
- cursor: string;
311
+ parentId: string;
312
+ cursor: string;
266
313
  organization: OrganizationGQL;
267
- preferredContacts: OrgContact[];
314
+ preferredContacts: OrgContact[];
268
315
  memory?: string | null;
269
316
  affiliated: boolean;
270
317
  addedAt: Date;
@@ -291,7 +338,8 @@ export interface OrganizationComplianceObj {
291
338
  notes?: string;
292
339
  }
293
340
 
294
- export interface OrganizationComplianceData extends Omit<OrganizationComplianceObj, 'expirationDate'> {
341
+ export interface OrganizationComplianceData
342
+ extends Omit<OrganizationComplianceObj, 'expirationDate'> {
295
343
  __table: 'organization_compliances';
296
344
  id: number;
297
345
  organizationId: number;
@@ -0,0 +1,48 @@
1
+ export type PageRouteQueryEnum = 'LOG_ENTRIES' | 'CHILD_ORGANIZATIONS';
2
+
3
+ export interface PageRouteLogEntriesFilterObj {
4
+ siteId?: number | string | null;
5
+ preset?: string | null;
6
+ types?: string[] | null;
7
+ activities?: string[] | null;
8
+ startDate?: string | null;
9
+ endDate?: string | null;
10
+ query?: string | null;
11
+ }
12
+
13
+ export interface PageRouteChildOrgsFilterObj {
14
+ childOrgIds?: (number | string)[] | null;
15
+ affiliated?: boolean | null;
16
+ }
17
+
18
+ export interface PageRouteFiltersObj {
19
+ logEntries?: PageRouteLogEntriesFilterObj | null;
20
+ childOrgs?: PageRouteChildOrgsFilterObj | null;
21
+ }
22
+
23
+ export interface OrganizationPageRouteData {
24
+ id: number | bigint;
25
+ organizationId: number | bigint;
26
+ slug: string;
27
+ query: PageRouteQueryEnum;
28
+ filters: PageRouteFiltersObj;
29
+ columns: string[];
30
+ iconName?: string | null;
31
+ starred: boolean;
32
+ createdAt: Date;
33
+ updatedAt: Date;
34
+ }
35
+
36
+ export interface OrgPageRouteGQL {
37
+ id: string;
38
+ organizationId: string;
39
+ slug: string;
40
+ query: PageRouteQueryEnum;
41
+ logEntriesFilter?: PageRouteLogEntriesFilterObj | null;
42
+ childOrgsFilter?: PageRouteChildOrgsFilterObj | null;
43
+ columns: string[];
44
+ iconName?: string | null;
45
+ starred?: boolean | null;
46
+ createdAt?: string | null;
47
+ updatedAt?: string | null;
48
+ }
@@ -0,0 +1,96 @@
1
+ /* JSON envelopes scanned from external QR images; issued field values use QrCodeValue below. */
2
+ export type QrCodeJSONValue = null | string | number | boolean | QrCodeJSONValue[] | { [key: string]: QrCodeJSONValue };
3
+
4
+ export type QrCodeValue = string | number | boolean;
5
+
6
+ export type QrCodeReferenceType = 'ORGANIZATION_SITE' | 'CHILD_ORGANIZATION';
7
+
8
+ export type QrCodeCodecErrorCode = 'TOO_LARGE' | 'INVALID' | 'UNSUPPORTED_VERSION';
9
+
10
+ export interface QrCodeValueField {
11
+ key: string;
12
+ description?: string;
13
+ kind: 'VALUE';
14
+ value: QrCodeValue;
15
+ }
16
+
17
+ export interface QrCodeReferenceField {
18
+ key: string;
19
+ description?: string;
20
+ kind: 'REFERENCE';
21
+ reference: {
22
+ type: QrCodeReferenceType;
23
+ /* Decimal database ID in storage; GraphQL and legacy v1 payloads use numeric GenericIDs. */
24
+ id: string;
25
+ };
26
+ displayNameSnapshot: string;
27
+ }
28
+
29
+ export type QrCodeField = QrCodeValueField | QrCodeReferenceField;
30
+
31
+ export interface QrCodePayloadReferenceField extends Omit<QrCodeReferenceField, 'reference'> {
32
+ reference: {
33
+ type: QrCodeReferenceType;
34
+ /* Typed readable site/org ID in v2/v3 public payloads; never a database ID or GenericID. */
35
+ id: string;
36
+ };
37
+ }
38
+
39
+ export type QrCodePayloadField = QrCodeValueField | QrCodePayloadReferenceField;
40
+
41
+ export type QrCodePayloadVersion = 1 | 2 | 3;
42
+
43
+ export type QrCodePayload =
44
+ | { v: 1; publicId: string; fields: QrCodeField[] }
45
+ | { v: 2; publicId: string; fields: QrCodePayloadField[] }
46
+ | { v: 3; publicId: string; organizationId: string; createdAt: string; fields: QrCodePayloadField[] };
47
+
48
+ /* Public GraphQL fields include nullable selections that the compact offline payload omits. */
49
+ export type QrCodeGQLField =
50
+ | (Omit<QrCodeValueField, 'description' | 'value'> & {
51
+ description: string | null;
52
+ value: QrCodeValue | null;
53
+ reference: null;
54
+ displayNameSnapshot: null;
55
+ })
56
+ | (Omit<QrCodeReferenceField, 'description'> & { description: string | null; value: null });
57
+
58
+ export interface QrCodeGQL {
59
+ id: string;
60
+ cursor: string;
61
+ organizationId: string;
62
+ publicId: string;
63
+ name: string;
64
+ fields: QrCodeGQLField[];
65
+ payloadVersion: number;
66
+ qrText: string;
67
+ createdByAccountId: string | null;
68
+ createdAt: string;
69
+ updatedAt: string;
70
+ archivedAt: string | null;
71
+ }
72
+
73
+ /* Reference display names are resolved on the server and cannot be supplied by callers. */
74
+ export type QrCodeFieldInput =
75
+ | (Omit<QrCodeValueField, 'description'> & { description?: string | null })
76
+ | (Omit<QrCodeReferenceField, 'displayNameSnapshot' | 'description'> & { description?: string | null });
77
+
78
+ export interface CreateQrCodeInput {
79
+ organizationId: string;
80
+ name: string;
81
+ fields: QrCodeFieldInput[];
82
+ }
83
+
84
+ export interface EditQrCodeInput {
85
+ organizationId: string;
86
+ qrCodeId: string;
87
+ name?: string;
88
+ archived?: boolean;
89
+ }
90
+
91
+ export interface QrCodesQueryArgs {
92
+ organizationId?: string | null;
93
+ filter?: { includeArchived?: boolean | null } | null;
94
+ cursor?: string | null;
95
+ limit?: number;
96
+ }
@@ -0,0 +1,81 @@
1
+ import type { NOTE_BLOCK_TYPES, NOTE_INLINE_TYPES, NOTE_MARK_TYPES } from '../constants/noteDoc.ts';
2
+
3
+ export type RichTextContentType = (typeof NOTE_BLOCK_TYPES)[number];
4
+ export type RichTextInlineContentType = (typeof NOTE_INLINE_TYPES)[number];
5
+ export type RichTextMarkType = (typeof NOTE_MARK_TYPES)[number];
6
+
7
+ // Heading depth; sanitizeNoteDoc clamps anything else into this range
8
+ export type RichTextHeadingLevel = 1 | 2 | 3;
9
+
10
+ /**
11
+ * Attributes carried by one "image" void block. storageId is the string form
12
+ * of the storage row id that owns the image. fileUri locates the GCS object
13
+ * for rendering.
14
+ */
15
+
16
+ export interface RichTextImageAttributes {
17
+ storageId: string;
18
+ fileUri: string;
19
+ alt?: string;
20
+ width?: number;
21
+ }
22
+
23
+ /**
24
+ * One inline mark on a text run. color/highlight marks carry a palette token
25
+ * from NOTE_COLOR_TOKENS; link marks carry an http(s)/mailto href; every other
26
+ * mark type carries no attributes.
27
+ */
28
+
29
+ export interface RichTextMark {
30
+ type: RichTextMarkType;
31
+ attrs?: {
32
+ token?: string;
33
+ href?: string;
34
+ };
35
+ }
36
+
37
+ /**
38
+ * One inline content node inside a text-bearing block: a styled text run, or a
39
+ * hard line break (which carries neither text nor marks).
40
+ */
41
+
42
+ export interface RichTextInlineContent {
43
+ type: RichTextInlineContentType;
44
+ text?: string;
45
+ marks?: RichTextMark[];
46
+ }
47
+
48
+ /**
49
+ * Attributes a block node may carry: "level" on headings and image attributes
50
+ * on image blocks. Every other block type carries no attributes.
51
+ */
52
+
53
+ export interface RichTextContentAttributes extends Partial<RichTextImageAttributes> {
54
+ level?: RichTextHeadingLevel;
55
+ }
56
+
57
+ /**
58
+ * One block-level content node. Containers (bulletList, orderedList, listItem,
59
+ * blockquote) hold block children; paragraph/heading hold inline children;
60
+ * divider/image hold none. _key and _uploading are client-editor-only fields,
61
+ * always stripped by sanitizeNoteDoc before persistence.
62
+ */
63
+
64
+ export interface RichTextContent {
65
+ type: RichTextContentType;
66
+ attrs?: RichTextContentAttributes;
67
+ content?: Array<RichTextContent | RichTextInlineContent>;
68
+ _key?: string;
69
+ _uploading?: boolean;
70
+ }
71
+
72
+ /**
73
+ * The root document used by persisted rich-text fields. It is always
74
+ * non-empty after sanitizing, with at least one possibly-empty paragraph.
75
+ */
76
+
77
+ export interface RichTextDocument {
78
+ type: 'doc';
79
+ version: number;
80
+ content: RichTextContent[];
81
+ }