@jsb188/app 1.1.11 → 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 +7 -4
- package/src/constants/agent.ts +39 -62
- package/src/constants/app.ts +17 -0
- package/src/constants/wsActions.ts +7 -15
- package/src/i18n/account.ts +1 -1
- package/src/i18n/agent.ts +326 -88
- package/src/i18n/agentToolBusiness.ts +196 -0
- package/src/i18n/agentToolGrid.ts +137 -0
- package/src/i18n/agentToolWorkflow.ts +101 -0
- package/src/i18n/agent_note.ts +109 -0
- package/src/i18n/app.ts +23 -17
- package/src/i18n/auth.ts +28 -30
- package/src/i18n/billing.ts +3 -85
- package/src/i18n/c.ts +907 -0
- package/src/i18n/campaign.ts +842 -140
- package/src/i18n/datetime.ts +6 -0
- package/src/i18n/editor.ts +58 -0
- package/src/i18n/error.ts +307 -168
- package/src/i18n/field_doc_editor.ts +21 -0
- package/src/i18n/field_doc_programs.ts +52 -0
- package/src/i18n/field_docs.ts +170 -8
- package/src/i18n/index.ts +21 -5
- package/src/i18n/log.ts +232 -38
- package/src/i18n/memory.ts +18 -4
- package/src/i18n/note.ts +5 -3
- package/src/i18n/org.ts +93 -44
- package/src/i18n/schedule.ts +209 -0
- package/src/i18n/sheet.ts +102 -145
- package/src/i18n/sheet_formula.ts +165 -0
- package/src/i18n/workflow.ts +48 -9
- package/src/main.ts +2 -2
- package/src/platform.ts +89 -49
- package/src/types/ai.d.ts +19 -0
- package/src/types/app.d.ts +50 -57
- package/src/types/other.d.ts +8 -1
- package/src/utils/api.ts +46 -0
- package/src/utils/clientIP.ts +213 -0
- package/src/utils/color.ts +77 -0
- package/src/utils/csv.ts +19 -0
- package/src/utils/datetime.ts +207 -31
- package/src/utils/deferredSave.ts +89 -0
- package/src/utils/email.ts +50 -0
- package/src/utils/expression.helpers.ts +470 -0
- package/src/utils/expression.test.ts +793 -0
- package/src/utils/expression.ts +1633 -239
- package/src/utils/language.ts +9 -0
- package/src/utils/logic.ts +9 -162
- package/src/utils/number.ts +30 -11
- package/src/utils/object.ts +29 -0
- package/src/utils/promise.ts +78 -7
- package/src/utils/queryReset.ts +101 -14
- package/src/utils/string.test.ts +24 -39
- package/src/utils/string.ts +73 -143
- package/src/utils/url_client.ts +83 -14
- package/src/constants/billing.ts +0 -146
- package/src/i18n/agentDoc.ts +0 -110
- package/src/i18n/form.ts +0 -496
- package/src/types/form.d.ts +0 -101
- package/src/utils/billing.ts +0 -141
package/src/types/form.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import type { ChangeEvent, FormEvent, KeyboardEvent, MouseEvent } from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Types; form schema
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export type FormValuesObj = {
|
|
8
|
-
[key: string]: any;
|
|
9
|
-
__errorFields?: string[];
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export type FormValueSetter<TFormValues extends FormValuesObj = any> = (
|
|
13
|
-
values: TFormValues | ((prev: TFormValues) => TFormValues),
|
|
14
|
-
) => void;
|
|
15
|
-
|
|
16
|
-
export type FormItemType =
|
|
17
|
-
| 'subtitle'
|
|
18
|
-
| 'break'
|
|
19
|
-
| 'group'
|
|
20
|
-
| 'input'
|
|
21
|
-
| 'section_title'
|
|
22
|
-
| 'input_click'
|
|
23
|
-
| 'input_w_button'
|
|
24
|
-
| 'input_time_from_date'
|
|
25
|
-
| 'password'
|
|
26
|
-
| 'textarea'
|
|
27
|
-
| 'none'
|
|
28
|
-
| (string & {});
|
|
29
|
-
|
|
30
|
-
interface SchemaItemAny<TCurrentData = any, TDataForSchema = any> {
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
__typename?: string;
|
|
33
|
-
setter?: (currentData?: TCurrentData, dataForSchema?: TDataForSchema) => any;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface FormItemSchemaObj<TCurrentData = any, TDataForSchema = any> {
|
|
37
|
-
__type: FormItemType;
|
|
38
|
-
autoFocus?: boolean;
|
|
39
|
-
disabled?: boolean;
|
|
40
|
-
hidden?: boolean | ((dataForSchema: TDataForSchema) => boolean);
|
|
41
|
-
locked?: boolean | ((dataForSchema: TDataForSchema) => boolean);
|
|
42
|
-
labelClassName?: string;
|
|
43
|
-
listenToInput?: boolean;
|
|
44
|
-
value?: any;
|
|
45
|
-
item: SchemaItemAny<TCurrentData, TDataForSchema>;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
interface SchemaRule<TFormValues extends FormValuesObj = any> {
|
|
49
|
-
for: string;
|
|
50
|
-
rule: (value: any, formValues: TFormValues) => boolean;
|
|
51
|
-
error: any;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface FormSchemaObj<
|
|
55
|
-
TFormValues extends FormValuesObj = any,
|
|
56
|
-
TCurrentData = any,
|
|
57
|
-
TDataForSchema = any,
|
|
58
|
-
> {
|
|
59
|
-
listData: FormItemSchemaObj<TCurrentData, TDataForSchema>[];
|
|
60
|
-
rules?: SchemaRule<TFormValues>[];
|
|
61
|
-
isButtonDisabled?: (formValues: TFormValues) => boolean;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Types; form items
|
|
66
|
-
*/
|
|
67
|
-
|
|
68
|
-
interface FormGroupType<
|
|
69
|
-
TFormValues extends FormValuesObj = any,
|
|
70
|
-
TCurrentData = any,
|
|
71
|
-
TDataForSchema = any,
|
|
72
|
-
> {
|
|
73
|
-
id?: string;
|
|
74
|
-
name: string;
|
|
75
|
-
label?: string;
|
|
76
|
-
value: string | number | null;
|
|
77
|
-
items: Array<FormItemIfaceObj<TFormValues, TCurrentData, TDataForSchema>>;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface FormItemIfaceObj<
|
|
81
|
-
TFormValues extends FormValuesObj = any,
|
|
82
|
-
TCurrentData = any,
|
|
83
|
-
TDataForSchema = any,
|
|
84
|
-
> extends FormItemSchemaObj<TCurrentData, TDataForSchema> {
|
|
85
|
-
name: string;
|
|
86
|
-
preset?: string;
|
|
87
|
-
className?: string;
|
|
88
|
-
inputClassName?: string;
|
|
89
|
-
focusStyle?: string;
|
|
90
|
-
hidden?: boolean | ((dataForSchema: TDataForSchema) => boolean);
|
|
91
|
-
locked?: boolean | ((dataForSchema: TDataForSchema) => boolean);
|
|
92
|
-
formValues: TFormValues;
|
|
93
|
-
setFormValues: FormValueSetter<TFormValues>;
|
|
94
|
-
onInput?: (e: FormEvent, name: string) => void;
|
|
95
|
-
onKeyDown?: (e: KeyboardEvent, name: string) => void;
|
|
96
|
-
onSubmit?: (e: MouseEvent, name: string) => void;
|
|
97
|
-
onChange?: (
|
|
98
|
-
e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
|
|
99
|
-
name: string,
|
|
100
|
-
) => void;
|
|
101
|
-
}
|
package/src/utils/billing.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SUBSCRIPTION_CATALOG,
|
|
3
|
-
SUBSCRIPTION_CATALOG_TEST,
|
|
4
|
-
} from '../constants/billing.ts';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Types
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
type SubscriptionCatalogItem = {
|
|
11
|
-
group: string;
|
|
12
|
-
notReady: boolean;
|
|
13
|
-
priceLabel: string | null;
|
|
14
|
-
startingPrice: number;
|
|
15
|
-
currency: string;
|
|
16
|
-
recurringInterval: string;
|
|
17
|
-
recurringIntervalCount: number;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
type SubscriptionPricingOption = {
|
|
21
|
-
id: string;
|
|
22
|
-
group: string;
|
|
23
|
-
notReady: boolean;
|
|
24
|
-
priceLabel: string;
|
|
25
|
-
price: number;
|
|
26
|
-
currency: string;
|
|
27
|
-
recurringInterval: string;
|
|
28
|
-
recurringIntervalCount: number;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Get development or production catalog
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
function getSubscriptionCatalog(isDev = false) {
|
|
36
|
-
return isDev ? SUBSCRIPTION_CATALOG_TEST : SUBSCRIPTION_CATALOG;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Get list of subscription catalogs
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
export function getPlatformSubscriptionCatalog(
|
|
44
|
-
platformProducts?: any[],
|
|
45
|
-
isDev?: boolean,
|
|
46
|
-
): SubscriptionCatalogItem[] {
|
|
47
|
-
return getSubscriptionCatalog(isDev).map((sub) => {
|
|
48
|
-
const [groupName, stripeProductId, stripePriceId] = sub;
|
|
49
|
-
const product = platformProducts?.find(
|
|
50
|
-
(pr: any) => pr.id === stripeProductId,
|
|
51
|
-
);
|
|
52
|
-
const startingPrice = product?.prices?.find(
|
|
53
|
-
(pc: any) => pc.id === stripePriceId,
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
if (!startingPrice) {
|
|
57
|
-
// Data is not ready; or the Stripe API Key used by the server is _not_ the live key
|
|
58
|
-
return {
|
|
59
|
-
group: groupName,
|
|
60
|
-
notReady: true,
|
|
61
|
-
priceLabel: null,
|
|
62
|
-
startingPrice: 0,
|
|
63
|
-
currency: 'USD',
|
|
64
|
-
recurringInterval: 'month',
|
|
65
|
-
recurringIntervalCount: 1,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Add locale here later
|
|
70
|
-
const locale = undefined;
|
|
71
|
-
|
|
72
|
-
const priceLabel = (startingPrice.unitAmount / 100).toLocaleString(locale, {
|
|
73
|
-
style: 'currency',
|
|
74
|
-
currency: startingPrice.currency,
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
return {
|
|
78
|
-
group: groupName,
|
|
79
|
-
notReady: false,
|
|
80
|
-
priceLabel,
|
|
81
|
-
startingPrice: startingPrice.unitAmount,
|
|
82
|
-
currency: startingPrice.currency,
|
|
83
|
-
recurringInterval: startingPrice.recurringInterval,
|
|
84
|
-
recurringIntervalCount: startingPrice.recurringIntervalCount,
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Get list of subscription options for each tier
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
export function getPlatformSubscriptionPricingOptions(
|
|
94
|
-
platformProducts?: any[],
|
|
95
|
-
subGroup?: 'PERKS' | 'PLUS' | 'PRO' | 'COINS',
|
|
96
|
-
isDev?: boolean,
|
|
97
|
-
): SubscriptionPricingOption[] {
|
|
98
|
-
const catalogItem = getSubscriptionCatalog(isDev).find(
|
|
99
|
-
(item: any) => item[0] === subGroup,
|
|
100
|
-
);
|
|
101
|
-
if (!catalogItem) {
|
|
102
|
-
console.warn('Unknown subscription group: ' + subGroup);
|
|
103
|
-
return [];
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const [, stripeProductId] = catalogItem;
|
|
107
|
-
const product = platformProducts?.find(
|
|
108
|
-
(pr: any) => pr.id === stripeProductId,
|
|
109
|
-
);
|
|
110
|
-
if (!product) {
|
|
111
|
-
if (platformProducts) {
|
|
112
|
-
console.warn('Platform product not found for: ' + stripeProductId);
|
|
113
|
-
}
|
|
114
|
-
return [];
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const pricingList = product.prices
|
|
118
|
-
.filter((pc: any) => pc.productGroup === subGroup)
|
|
119
|
-
.sort((pc: any) => (pc.recurringInterval === 'year' ? -1 : 1));
|
|
120
|
-
|
|
121
|
-
return pricingList.map((pc: any) => {
|
|
122
|
-
// Add locale here later
|
|
123
|
-
const locale = undefined;
|
|
124
|
-
|
|
125
|
-
const priceLabel = (pc.unitAmount / 100).toLocaleString(locale, {
|
|
126
|
-
style: 'currency',
|
|
127
|
-
currency: pc.currency,
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
return {
|
|
131
|
-
id: pc.id,
|
|
132
|
-
group: pc.productGroup,
|
|
133
|
-
notReady: false,
|
|
134
|
-
priceLabel,
|
|
135
|
-
price: pc.unitAmount,
|
|
136
|
-
currency: pc.currency,
|
|
137
|
-
recurringInterval: pc.recurringInterval,
|
|
138
|
-
recurringIntervalCount: pc.recurringIntervalCount,
|
|
139
|
-
};
|
|
140
|
-
});
|
|
141
|
-
}
|