@jsb188/app 1.1.4 → 1.1.6

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/types/form.d.ts CHANGED
@@ -3,12 +3,14 @@
3
3
  * Types; form schema
4
4
  */
5
5
 
6
- interface SchemaItemSetter {
6
+ interface SchemaItemAny {
7
+ [key: string]: any;
8
+ __typename?: string;
7
9
  setter?: (currentData?: any, dataForSchema?: any) => any;
8
10
  }
9
11
 
10
12
  export interface FormItemSchemaObj {
11
- __type: 'group' | 'input' | 'password' | 'textarea' | 'select' | string;
13
+ __type: 'subtitle' | 'group' | 'input' | 'section_title' | 'input_click' | 'input_w_button' | 'input_time_from_date' | 'password' | 'textarea' | 'none' | string;
12
14
  autoFocus?: boolean;
13
15
  disabled?: boolean;
14
16
  hidden?: boolean | ((dataForSchema: any) => boolean);
@@ -16,7 +18,7 @@ export interface FormItemSchemaObj {
16
18
  labelClassName?: string;
17
19
  listenToInput?: boolean;
18
20
  value?: any;
19
- item: Record<string, any> & SchemaItemSetter;
21
+ item: SchemaItemAny;
20
22
  }
21
23
 
22
24
  interface SchemaRule {
@@ -45,6 +47,10 @@ interface FormGroupType {
45
47
 
46
48
  export interface FormItemIfaceObj extends FormItemSchemaObj {
47
49
  name: string;
50
+ preset?: string;
51
+ className?: string;
52
+ inputClassName?: string;
53
+ focusStyle?: string;
48
54
  hidden?: boolean | ((dataForSchema: any) => boolean);
49
55
  locked?: boolean | ((dataForSchema: any) => boolean);
50
56
  formValues: any;
@@ -0,0 +1,61 @@
1
+ import { DAY_OF_WEEK, SCHEDULE_FREQUENCY } from '../constants/other.ts';
2
+
3
+ /**
4
+ * Enums
5
+ */
6
+
7
+ export type DayOfWeekEnum = typeof DAY_OF_WEEK[number];
8
+ export type ScheduleFrequencyEnum = typeof SCHEDULE_FREQUENCY[number];
9
+
10
+ /**
11
+ * Storage
12
+ */
13
+
14
+ export interface StorageData {
15
+ __table: 'storage';
16
+ id: number;
17
+ organizationId: number | null;
18
+ accountId: number | null;
19
+ uri: string;
20
+ size: number;
21
+ checked: boolean;
22
+ at: Date;
23
+ contentType: string;
24
+ values: string[] | null;
25
+ }
26
+
27
+ /**
28
+ * Address
29
+ */
30
+
31
+ export interface AddressObj {
32
+ line1: string;
33
+ line2?: string | null;
34
+ city: string;
35
+ state: string;
36
+ postalCode: string;
37
+ country: string;
38
+ }
39
+
40
+ /**
41
+ * Schedule
42
+ */
43
+
44
+ export interface ScheduleObj {
45
+ frequency: ScheduleFrequencyEnum;
46
+ weeksOfMonth?: number[];
47
+ daysOfWeek?: (0 | 1 | 2 | 3 | 4 | 5 | 6)[];
48
+ time?: [
49
+ string?, // Star time "hhmm" format
50
+ string?, // End time "hhmm" format (optional)
51
+ ];
52
+ }
53
+
54
+ /**
55
+ * File object
56
+ */
57
+
58
+ export interface FileObj {
59
+ buffer: Uint8Array;
60
+ contentType: string;
61
+ }
@@ -0,0 +1,28 @@
1
+ import type { ActionCategoryEnum } from '@jsb188/mday/types/action.d';
2
+ import type { LogActivityEnum } from '@jsb188/mday/types/log.d';
3
+ import type { OrganizationOperationEnum } from '../types/organization.d.ts';
4
+
5
+ /**
6
+ * Enums
7
+ */
8
+
9
+ export const ACTION_STATUS_ENUMS = [
10
+ 'SCHEDULED',
11
+ 'STARTED',
12
+ 'COMPLETED',
13
+ 'ERRORED',
14
+ ];
15
+
16
+ /**
17
+ * Get aggregated action types to log activities
18
+ */
19
+
20
+ export function getAggregatedActivities(
21
+ operation: OrganizationOperationEnum,
22
+ actionCategory: ActionCategoryEnum,
23
+ ): LogActivityEnum[] {
24
+
25
+ return [
26
+ 'MARKET_CREDIT_RECEIPT',
27
+ ];
28
+ }
package/utils/api.ts CHANGED
@@ -72,7 +72,7 @@ export function normalizeServerError(error?: any): ServerErrorObj {
72
72
 
73
73
  if (!message) {
74
74
  if (i18nErrCodeExists(errorCode)) {
75
- message = i18n.t(`error.${errorCode}`, { value: errorValue });
75
+ message = i18n.t(`error.${errorCode}`, { value: errorValue, smart_count: Number(errorValue) });
76
76
  } else {
77
77
  message = i18n.t('error.unknown_error');
78
78
  }