@jsb188/mday 1.1.8 → 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.
- package/package.json +105 -35
- package/src/constants/agentDoc.ts +12 -0
- package/src/constants/agentMemory.ts +154 -0
- package/src/constants/aiChat.ts +5 -0
- package/src/constants/campaign.ts +127 -0
- package/src/constants/dataTable.ts +48 -0
- package/src/constants/dataTableFieldTypes.generated.ts +63 -0
- package/src/constants/docAccess.ts +32 -0
- package/src/constants/email.ts +44 -0
- package/src/constants/fieldDoc.ts +34 -0
- package/src/constants/graphqlReactivity.ts +113 -0
- package/src/constants/inboundContact.ts +8 -0
- package/src/constants/integration.ts +13 -0
- package/src/constants/log.ts +7 -366
- package/src/constants/logActivityGroupColors.generated.ts +19 -0
- package/src/constants/logTaxonomy.generated.ts +1103 -0
- package/src/constants/noteDoc.ts +77 -0
- package/src/constants/organization.ts +18 -11
- package/src/constants/pageRoute.ts +23 -0
- package/src/constants/schedule.ts +220 -0
- package/src/constants/scheduleRuleTemplateSeed.ts +138 -0
- package/src/constants/scheduleRuleTemplates.generated.ts +145 -0
- package/src/constants/sheet.ts +168 -0
- package/src/constants/sheetRegionSources.generated.ts +578 -0
- package/src/constants/square.ts +16 -0
- package/src/constants/storage.ts +61 -0
- package/src/constants/usage.ts +79 -0
- package/src/schemas/editLogEntry.ts +1017 -738
- package/src/schemas/fieldDocsQuery.ts +12 -0
- package/src/schemas/inboundContact.ts +77 -0
- package/src/schemas/logsQuery.ts +57 -316
- package/src/schemas/organization.ts +53 -213
- package/src/types/account.d.ts +81 -0
- package/src/types/agentDoc.d.ts +64 -0
- package/src/types/agentMemory.d.ts +74 -0
- package/src/types/campaign.d.ts +683 -0
- package/src/types/dataTable.d.ts +366 -0
- package/src/types/docAccess.d.ts +96 -0
- package/src/types/email.d.ts +142 -0
- package/src/types/fieldDoc.d.ts +273 -0
- package/src/types/inboundContact.d.ts +57 -0
- package/src/types/integration.d.ts +42 -0
- package/src/types/log.d.ts +169 -190
- package/src/types/noteDoc.d.ts +86 -0
- package/src/types/organization.d.ts +175 -76
- package/src/types/pageRoute.d.ts +48 -0
- package/src/types/schedule.d.ts +391 -0
- package/src/types/sheet.d.ts +1130 -0
- package/src/types/storage.d.ts +242 -0
- package/src/types/usage.d.ts +106 -0
- package/src/types/workflow.d.ts +305 -0
- package/src/utils/agentDoc.ts +109 -0
- package/src/utils/aiChat.ts +26 -0
- package/src/utils/campaign.ts +741 -0
- package/src/utils/campaignFormEditor.ts +871 -0
- package/src/utils/dataTable.ts +849 -0
- package/src/utils/dataTableFieldTypeRegistry.ts +105 -0
- package/src/utils/dataTableRealtimeAuthority.ts +209 -0
- package/src/utils/dataTableRealtimeSelection.ts +134 -0
- package/src/utils/dataTableRowDocument.ts +508 -0
- package/src/utils/dataTableSource.ts +230 -0
- package/src/utils/docAccess.ts +383 -0
- package/src/utils/documentName.ts +53 -0
- package/src/utils/email.ts +172 -0
- package/src/utils/fieldDoc.ts +113 -0
- package/src/utils/log.ts +173 -778
- package/src/utils/logRegistryValue.ts +90 -0
- package/src/utils/logStoreRead.ts +266 -0
- package/src/utils/logTaxonomy.ts +76 -0
- package/src/utils/logTaxonomyDisplay.ts +439 -0
- package/src/utils/noteDoc.ts +827 -0
- package/src/utils/organization.ts +683 -81
- package/src/utils/pageRoute.ts +71 -0
- package/src/utils/schedule.ts +799 -0
- package/src/utils/scheduleEvaluation.ts +1994 -0
- package/src/utils/scheduleICS.ts +246 -0
- package/src/utils/scheduleRuleTemplates.ts +188 -0
- package/src/utils/sheet.ts +4973 -0
- package/src/utils/sheetAxisMove.ts +830 -0
- package/src/utils/sheetBootstrap.ts +1769 -0
- package/src/utils/sheetCommand.ts +423 -0
- package/src/utils/sheetExport.ts +238 -0
- package/src/utils/sheetFormulaEvaluation.ts +914 -0
- package/src/utils/sheetFormulaEvaluator.ts +852 -0
- package/src/utils/sheetJournal.ts +78 -0
- package/src/utils/sheetNumberFormat.ts +1211 -0
- package/src/utils/sheetRegion.ts +374 -0
- package/src/utils/sheetRegionFilter.ts +1259 -0
- package/src/utils/sheetRegionSourceRegistry.ts +594 -0
- package/src/utils/sheetSequence.ts +148 -0
- package/src/utils/sheetSnapshot.ts +992 -0
- package/src/utils/sheetStructureEdit.ts +1284 -0
- package/src/utils/square.ts +32 -0
- package/src/utils/storage.ts +152 -0
- package/src/utils/table-route.ts +262 -0
- package/src/utils/workflow.ts +380 -0
- package/tests/dataTableFieldTypeRegistry.test.ts +110 -0
- package/tests/docAccess.test.ts +525 -0
- package/tests/editLogEntry.test.ts +112 -0
- package/tests/noteDoc.test.ts +669 -0
- package/tests/schedule.test.ts +693 -0
- package/tests/scheduleEvaluation.test.ts +1970 -0
- package/tests/scheduleICS.test.ts +208 -0
- package/tests/scheduleRuleTemplates.test.ts +176 -0
- package/tests/scheduleSweepInvariants.test.ts +428 -0
- package/tests/sheetAxisMove.test.ts +343 -0
- package/tests/sheetFormulaEvaluator.test.ts +575 -0
- package/tests/sheetRegionFilter.test.ts +1135 -0
- package/tests/sheetSequence.test.ts +41 -0
- package/tests/sheetStructureEdit.test.ts +82 -0
- package/tsconfig.json +12 -0
- package/vitest.config.ts +8 -0
- package/src/constants/log-activityTexts.ts +0 -209
- package/src/constants/product.ts +0 -66
- package/src/constants/report.ts +0 -25
- package/src/schemas/childOrganizationsQuery.ts +0 -44
- package/src/schemas/productsQuery.ts +0 -145
- package/src/schemas/reportsQuery.ts +0 -107
- package/src/types/action.d.ts +0 -42
- package/src/types/product.d.ts +0 -173
- package/src/types/report.d.ts +0 -203
- package/src/utils/product-calEvent.ts +0 -508
- package/src/utils/route-helpers.ts +0 -583
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import z from 'zod';
|
|
2
|
-
import type { OrganizationOperationEnum } from '../types/organization';
|
|
3
|
-
import type { ReportsFilterArgs } from '../types/report';
|
|
4
|
-
import { convertDigitToProductType } from './productsQuery';
|
|
5
|
-
import { REPORT_TYPES } from '../constants/report';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Zod schema for query params to filter
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export const ReportsFilterSchema = z.object({
|
|
12
|
-
preset: z.string()
|
|
13
|
-
.optional()
|
|
14
|
-
.nullable(),
|
|
15
|
-
reportType: z.enum(REPORT_TYPES as [string]),
|
|
16
|
-
query: z.string()
|
|
17
|
-
.nullable(),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Create a filter object for reports() query from the URL search query.
|
|
22
|
-
* @param operationType - The organization operation type
|
|
23
|
-
* @param searchQuery - The search query string from the URL
|
|
24
|
-
* @param otherFiltersObj - Additional filter properties to merge into the result
|
|
25
|
-
* @returns ReportsFilterArgs - The filter object to be used in the productsList() query
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
export function getReportsFilterFromURL(
|
|
29
|
-
_operationType: OrganizationOperationEnum | null,
|
|
30
|
-
searchQuery: string,
|
|
31
|
-
otherFiltersObj?: {
|
|
32
|
-
withoutPreset?: Partial<ReportsFilterArgs>,
|
|
33
|
-
withPreset?: Partial<ReportsFilterArgs>
|
|
34
|
-
}
|
|
35
|
-
) {
|
|
36
|
-
if (!searchQuery && otherFiltersObj?.withPreset) {
|
|
37
|
-
return otherFiltersObj.withPreset;
|
|
38
|
-
} else if (searchQuery === '?preset=none' && otherFiltersObj?.withoutPreset) {
|
|
39
|
-
return otherFiltersObj.withoutPreset;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const urlParams = new URLSearchParams(searchQuery);
|
|
43
|
-
|
|
44
|
-
// let startDate = urlParams.get('sd');
|
|
45
|
-
// let endDate = urlParams.get('ed');
|
|
46
|
-
// if (startDate && !endDate) {
|
|
47
|
-
// endDate = startDate;
|
|
48
|
-
// } else if (endDate && !startDate) {
|
|
49
|
-
// startDate = endDate;
|
|
50
|
-
// }
|
|
51
|
-
|
|
52
|
-
const filter: ReportsFilterArgs = {
|
|
53
|
-
reportType: convertDigitToProductType(urlParams.get('t'))!,
|
|
54
|
-
period: urlParams.get('p') || '',
|
|
55
|
-
// startDate,
|
|
56
|
-
// endDate,
|
|
57
|
-
query: urlParams.get('q') || '',
|
|
58
|
-
...otherFiltersObj?.withoutPreset,
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const validation = ReportsFilterSchema.safeParse(filter);
|
|
62
|
-
|
|
63
|
-
// console.log(otherFiltersObj);
|
|
64
|
-
// console.log('filter', filter);
|
|
65
|
-
// console.log('validation', validation);
|
|
66
|
-
|
|
67
|
-
if (!validation.success) {
|
|
68
|
-
// console.log('validation error', validation.error);
|
|
69
|
-
// Return null and force the client to go to a valid page
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return filter;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Test if URL search query is valid against actual filter object
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
export function reportsSearchQueryIsValid(
|
|
81
|
-
searchQuery: string,
|
|
82
|
-
filter: ReportsFilterArgs | null
|
|
83
|
-
) {
|
|
84
|
-
if (!filter) {
|
|
85
|
-
return !searchQuery; // If no filter, searchQuery must be empty to be valid
|
|
86
|
-
} else if (!searchQuery || searchQuery === '?preset=none') {
|
|
87
|
-
return true; // If no searchQuery, any filter is valid
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const urlParams = new URLSearchParams(searchQuery);
|
|
91
|
-
// const operation = urlParams.get('o');
|
|
92
|
-
const reportType = urlParams.get('t');
|
|
93
|
-
// const accountId = urlParams.get('a');
|
|
94
|
-
// const startDate = urlParams.get('sd');
|
|
95
|
-
// const endDate = urlParams.get('ed');
|
|
96
|
-
const query = urlParams.get('q');
|
|
97
|
-
|
|
98
|
-
return (
|
|
99
|
-
// operation is allowed to pass through
|
|
100
|
-
// !!filter.operation === !!operation &&
|
|
101
|
-
!!filter.reportType === !!reportType &&
|
|
102
|
-
// !!filter.accountId === !!accountId &&
|
|
103
|
-
// !!filter.startDate === !!startDate &&
|
|
104
|
-
// !!filter.endDate === !!endDate &&
|
|
105
|
-
!!filter.query === !!query
|
|
106
|
-
);
|
|
107
|
-
}
|
package/src/types/action.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Actions data object
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export interface ActionTaskObj {
|
|
6
|
-
id?: number | bigint; // Optional for updates/inserts
|
|
7
|
-
logId: number | bigint;
|
|
8
|
-
queue?: string | null;
|
|
9
|
-
|
|
10
|
-
title: string;
|
|
11
|
-
instruction: string;
|
|
12
|
-
message?: string | null;
|
|
13
|
-
|
|
14
|
-
scheduledAt: Date | null;
|
|
15
|
-
delay: number | null; // seconds
|
|
16
|
-
completed: boolean;
|
|
17
|
-
|
|
18
|
-
createdAt?: Date;
|
|
19
|
-
updatedAt?: Date;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Actions GraphQL data
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
export interface ActionTaskGQL {
|
|
27
|
-
__deleted?: boolean;
|
|
28
|
-
|
|
29
|
-
id: string;
|
|
30
|
-
logId: string;
|
|
31
|
-
|
|
32
|
-
title: string;
|
|
33
|
-
instruction: string;
|
|
34
|
-
message: string | null;
|
|
35
|
-
|
|
36
|
-
scheduledAt: string; // ISO date string
|
|
37
|
-
delay: number; // seconds
|
|
38
|
-
completed: boolean;
|
|
39
|
-
|
|
40
|
-
createdAt?: string; // ISO date string
|
|
41
|
-
updatedAt?: string; // ISO date string
|
|
42
|
-
}
|
package/src/types/product.d.ts
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { PRODUCT_LIVESTOCK_STATUS, PRODUCT_LIVESTOCK_TYPES, PRODUCT_TYPES } from '../constants/product';
|
|
2
|
-
import type { AccountData } from '@jsb188/app/types/account.d';
|
|
3
|
-
import type { OrganizationData, OrganizationGQL } from './types/organization.d';
|
|
4
|
-
import type { AddressObj, ScheduleObj } from '@jsb188/app/types/other.d';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Enums
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export type ProductTypeEnum = typeof PRODUCT_TYPES[number];
|
|
11
|
-
export type ProductLivestockTypeEnum = typeof PRODUCT_LIVESTOCK_TYPES[number];
|
|
12
|
-
export type ProductLivestockStatusEnum = typeof PRODUCT_LIVESTOCK_STATUS[number];
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Filters
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
export interface ProductsFilterArgs {
|
|
19
|
-
preset?: '?' | null;
|
|
20
|
-
productType: ProductTypeEnum;
|
|
21
|
-
query?: string | null;
|
|
22
|
-
calDate?: string | null; // "YYYY-MM-DD"
|
|
23
|
-
timeZone?: string | null; // Server only for now
|
|
24
|
-
// status: ProductLivestockStatusEnum;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Product details; Livestock
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
export interface ProductLivestockObj {
|
|
32
|
-
// This interface is not ready yet; old system has to be migrated.
|
|
33
|
-
'?': '?';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface ProductLivestockData {
|
|
37
|
-
__table: 'products_livestock';
|
|
38
|
-
id?: number | bigint;
|
|
39
|
-
productId: number | bigint;
|
|
40
|
-
type: ProductLivestockTypeEnum;
|
|
41
|
-
status: ProductLivestockStatusEnum;
|
|
42
|
-
birthDate?: string | null; // "YYYY-MM-DD"
|
|
43
|
-
deathDate?: string | null; // "YYYY-MM-DD"
|
|
44
|
-
damIdentifier?: string | null;
|
|
45
|
-
livestockIdentifier: string;
|
|
46
|
-
livestockGroup?: string | null;
|
|
47
|
-
metadata: {
|
|
48
|
-
overview: string;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface ProductLivestockGQL {
|
|
53
|
-
__typename: 'ProductLivestock';
|
|
54
|
-
|
|
55
|
-
id: string;
|
|
56
|
-
organizationId: string;
|
|
57
|
-
damIdentifier: string | null;
|
|
58
|
-
livestockIdentifier: string | null;
|
|
59
|
-
livestockGroup: string | null;
|
|
60
|
-
|
|
61
|
-
type: ProductLivestockTypeEnum;
|
|
62
|
-
status: ProductLivestockStatusEnum;
|
|
63
|
-
livestockClass: string;
|
|
64
|
-
|
|
65
|
-
birthDate: string | null; // "YYYY-MM-DD"
|
|
66
|
-
deathDate: string | null; // "YYYY-MM-DD"
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Product details; Calendar event
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
|
-
export interface ProductCalEventObj {
|
|
74
|
-
name: string;
|
|
75
|
-
metadata: Partial<{
|
|
76
|
-
schedule: ScheduleObj | null;
|
|
77
|
-
address: Partial<AddressObj> | null;
|
|
78
|
-
}>;
|
|
79
|
-
|
|
80
|
-
startAt: Date | string; // ISO Date string
|
|
81
|
-
endAt?: Date | string | null; // ISO Date string
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface ProductCalEventData extends ProductCalEventObj {
|
|
85
|
-
__table: 'products_calendar_events';
|
|
86
|
-
productId: number | bigint;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface ProductCalEventGQL {
|
|
90
|
-
__typename: 'ProductCalEvent';
|
|
91
|
-
|
|
92
|
-
id: string;
|
|
93
|
-
organizationId: string;
|
|
94
|
-
|
|
95
|
-
name: string;
|
|
96
|
-
schedule: ScheduleObj | null;
|
|
97
|
-
address: AddressObj | null;
|
|
98
|
-
startAt: Date;
|
|
99
|
-
endAt: Date;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export type ProductDetailsObj = ProductLivestockObj | ProductCalEventObj;
|
|
103
|
-
export type ProductDetailsData = ProductLivestockData | ProductCalEventData;
|
|
104
|
-
export type ProductDetailsGQL = ProductLivestockGQL | ProductCalEventGQL;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* CalEvent; attendance
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
export interface ProductAttendanceObj {
|
|
111
|
-
productId: number | bigint;
|
|
112
|
-
organizationId: number | bigint;
|
|
113
|
-
accountId: number | bigint;
|
|
114
|
-
attended: boolean | null;
|
|
115
|
-
calDate: string; // "YYYY-MM-DD" format
|
|
116
|
-
history?: [string, '0' | '1'][] | null; // [YYYY-MM-DD, '0' | '1'][]
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export interface ProductAttendanceData extends ProductAttendanceObj {
|
|
120
|
-
__table: 'products_attendance';
|
|
121
|
-
organization: OrganizationData;
|
|
122
|
-
account: AccountData; // account data
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export interface ProductAttendanceGQL {
|
|
126
|
-
__deleted: boolean; // For client-side only
|
|
127
|
-
id: string;
|
|
128
|
-
productId: string;
|
|
129
|
-
organizationId: string;
|
|
130
|
-
attended: boolean | null;
|
|
131
|
-
calDate: string; // "YYYY-MM-DD" format
|
|
132
|
-
organization: OrganizationGQL;
|
|
133
|
-
checkedBy: any; // account data
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* CalEvent; load list
|
|
138
|
-
*/
|
|
139
|
-
|
|
140
|
-
export interface ProductLoadListData {
|
|
141
|
-
__table: 'products_load_list';
|
|
142
|
-
organizationId: number | bigint;
|
|
143
|
-
productId: number | bigint;
|
|
144
|
-
calDate: Date; // Postgres returns "date" as JS Date, but it's safe to convert "YYYY-MM-DD" without time zone.
|
|
145
|
-
items: string[][]; // [ [itemName, quantity, unit], ... ]
|
|
146
|
-
createdAt: Date;
|
|
147
|
-
updatedAt: Date;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Product data objects
|
|
152
|
-
*/
|
|
153
|
-
|
|
154
|
-
export interface ProductData {
|
|
155
|
-
__table: 'products';
|
|
156
|
-
productId: number | bigint;
|
|
157
|
-
organizationId: number | bigint;
|
|
158
|
-
details: ProductDetailsData;
|
|
159
|
-
createdAt: Date;
|
|
160
|
-
updatedAt: Date;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export interface ProductGQL {
|
|
164
|
-
__deleted?: boolean; // For client-side only
|
|
165
|
-
|
|
166
|
-
id: string;
|
|
167
|
-
organizationId: string;
|
|
168
|
-
cursor: string | null; // Cursor for pagination
|
|
169
|
-
details: ProductDetailsGQL | null;
|
|
170
|
-
|
|
171
|
-
createdAt: string; // ISO Date
|
|
172
|
-
updatedAt: string; // ISO Date
|
|
173
|
-
}
|
package/src/types/report.d.ts
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { REPORT_SORT_OPTS, REPORT_TYPES, REPORT_ROW_PRESETS } from '../constants/report';
|
|
2
|
-
import type { StorageData, StorageGQL } from '@jsb188/app/types/storage.d';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Enums
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
type ReportTypeEnum = typeof REPORT_TYPES[number];
|
|
9
|
-
type ReportRowPresetEnum = typeof REPORT_ROW_PRESETS[number];
|
|
10
|
-
type ReportsSortEnum = typeof REPORT_SORT_OPTS[number];
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Filters
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
export interface ReportsFilterArgs {
|
|
17
|
-
preset?: '?' | null;
|
|
18
|
-
reportType: ReportTypeEnum;
|
|
19
|
-
period: string; // YYYY-MM-DD
|
|
20
|
-
query?: string | null;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Report; fields
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
interface ReportFieldsObj {
|
|
28
|
-
__allowMultiples?: boolean; // Allow multiple copies of the same report (from 1 report template)
|
|
29
|
-
__notAutomated?: boolean; // If true, report is not skipped during automation
|
|
30
|
-
__prompt: string; // Server-only, this prompt used on the entire report as a whole (ie. OSP generation)
|
|
31
|
-
gridLayoutStyle?: string;
|
|
32
|
-
sections?: ReportFieldsSection[];
|
|
33
|
-
rows?: ReportFieldsRow[];
|
|
34
|
-
metadata?: ReportFieldsRow[];
|
|
35
|
-
variables: {
|
|
36
|
-
month?: number; // Used for MONTH presets (required for all preset="MONTH" rows)
|
|
37
|
-
[key: string]: any;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
interface ReportFieldsSection {
|
|
42
|
-
id?: string; // GraphQL Cursor, client-side only, but if present in Server, it will be an Array
|
|
43
|
-
key: string; // Every section must have a unique string UID
|
|
44
|
-
isGroupTitle?: boolean;
|
|
45
|
-
sectionKey: string;
|
|
46
|
-
sectionName: string;
|
|
47
|
-
title: string;
|
|
48
|
-
description: string;
|
|
49
|
-
rows?: ReportFieldsRow[];
|
|
50
|
-
requireFileUploads?: boolean;
|
|
51
|
-
files?: StorageData[];
|
|
52
|
-
|
|
53
|
-
__prompt_section?: string; // Server-only; full prompt for this section - this is the only prompt that allows {{variable}} regex
|
|
54
|
-
__prompt_examples?: string; // Server-only; for examples of what the output should be
|
|
55
|
-
__prompt_topics?: string; // Server-only; for topics this section should cover
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
interface ReportFieldsRow {
|
|
59
|
-
id?: string; // GraphQL Cursor, client-side only, but if present in Server, it will be an Array
|
|
60
|
-
key: string; // Key is used to map row/columns to answers
|
|
61
|
-
preset?: ReportRowPresetEnum;
|
|
62
|
-
className?: string;
|
|
63
|
-
isHeader?: boolean;
|
|
64
|
-
columns: Partial<ReportFieldsColumn>[];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
type ReportRowGQL = Omit<ReportFieldsRow, 'key'> & {
|
|
68
|
-
id: string; // GraphQL Cursor, client-side only, but if present in Server, it will be an Array
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
interface ReportFieldsColumn {
|
|
72
|
-
id: string; // GraphQL Cursor, client-side only, but if present in Server, it will be an Array
|
|
73
|
-
key: string; // Key is used to map column to answers
|
|
74
|
-
className?: string;
|
|
75
|
-
labelClassName?: string;
|
|
76
|
-
label: string;
|
|
77
|
-
text: string;
|
|
78
|
-
placeholder: string | null;
|
|
79
|
-
value: string | null; // Available only in server; this value has the indexes to map answers to directly without keys
|
|
80
|
-
checked: boolean | null;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Report data
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
export interface ReportData {
|
|
88
|
-
__table: 'reports';
|
|
89
|
-
|
|
90
|
-
id: number;
|
|
91
|
-
type: ReportTypeEnum;
|
|
92
|
-
documentName: string;
|
|
93
|
-
title: string;
|
|
94
|
-
description: string;
|
|
95
|
-
order: number;
|
|
96
|
-
|
|
97
|
-
fields: ReportFieldsObj;
|
|
98
|
-
submission?: ReportSubmissionData | null;
|
|
99
|
-
|
|
100
|
-
template?: {
|
|
101
|
-
__table: 'report_templates';
|
|
102
|
-
id: number;
|
|
103
|
-
fields: ReportFieldsObj;
|
|
104
|
-
description: string | null;
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface ReportGQL {
|
|
109
|
-
__deleted?: boolean;
|
|
110
|
-
|
|
111
|
-
id: string;
|
|
112
|
-
organizationId: string;
|
|
113
|
-
documentName: string;
|
|
114
|
-
title: string;
|
|
115
|
-
description: string;
|
|
116
|
-
type: ReportTypeEnum;
|
|
117
|
-
period: string; // YYYY-MM-DD
|
|
118
|
-
evidencesCount: number;
|
|
119
|
-
activityAt: string | null; // ISO date string
|
|
120
|
-
|
|
121
|
-
sections?: ReportSectionGQL[];
|
|
122
|
-
rows?: ReportRowGQL[];
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
interface ReportSectionGQL {
|
|
126
|
-
id: string;
|
|
127
|
-
isGroupTitle?: boolean;
|
|
128
|
-
sectionKey: string;
|
|
129
|
-
sectionName: string;
|
|
130
|
-
title: string;
|
|
131
|
-
description: string;
|
|
132
|
-
rows?: ReportRowGQL[];
|
|
133
|
-
requireFileUploads?: boolean;
|
|
134
|
-
files?: StorageGQL[];
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Report submission data
|
|
139
|
-
*/
|
|
140
|
-
|
|
141
|
-
export interface ReportEvidenceGQL {
|
|
142
|
-
__deleted?: boolean;
|
|
143
|
-
|
|
144
|
-
id: string; // GraphQL Cursor
|
|
145
|
-
reportSubmissionId: string;
|
|
146
|
-
sectionKey: string;
|
|
147
|
-
log: any; // LogEntryGQL
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export interface ReportSubmissionGQL {
|
|
151
|
-
__deleted?: boolean;
|
|
152
|
-
|
|
153
|
-
id: string;
|
|
154
|
-
reportId: string;
|
|
155
|
-
organizationId: string;
|
|
156
|
-
sectionKey: string;
|
|
157
|
-
documentName: string;
|
|
158
|
-
sectionName: string;
|
|
159
|
-
title: string;
|
|
160
|
-
period: string; // YYYY-MM-DD
|
|
161
|
-
activityAt: string | null; // ISO date string
|
|
162
|
-
rows: ReportRowGQL[];
|
|
163
|
-
evidences: string[];
|
|
164
|
-
requireFileUploads: boolean;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export interface ReportLogRelData {
|
|
168
|
-
__table: 'report_log_rels';
|
|
169
|
-
reportSubmissionId: number | bigint;
|
|
170
|
-
logId: number | bigint;
|
|
171
|
-
sectionKey: string;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export interface ReportStorageRelData {
|
|
175
|
-
__table: 'report_storage_rels';
|
|
176
|
-
reportSubmissionId: number | bigint;
|
|
177
|
-
storageId: number | bigint;
|
|
178
|
-
sectionKey: string;
|
|
179
|
-
order: number;
|
|
180
|
-
file: StorageData;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export interface ReportSubmissionData {
|
|
184
|
-
__table: 'report_submissions';
|
|
185
|
-
id: number;
|
|
186
|
-
organizationId: number;
|
|
187
|
-
reportId: number;
|
|
188
|
-
period: Date; // YYYY-MM-DD in database, Date object in server via ORM
|
|
189
|
-
answers: Record<string, any>; // key-value pairs of answers
|
|
190
|
-
logRels?: ReportLogRelData[];
|
|
191
|
-
storageRels?: ReportStorageRelData[];
|
|
192
|
-
activityAt: Date;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Available reports
|
|
197
|
-
*/
|
|
198
|
-
|
|
199
|
-
export interface ReportAvailabilityGQL {
|
|
200
|
-
id: string;
|
|
201
|
-
type: ReportTypeEnum;
|
|
202
|
-
periods: string[]; // YYYY-MM-DD
|
|
203
|
-
}
|