firstly 0.1.3 → 0.2.1
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/CHANGELOG.md +24 -0
- package/esm/auth/Entities.js +2 -2
- package/esm/auth/server/AuthController.server.js +32 -12
- package/esm/auth/static/assets/Page-BRNWcY5Z.js +1 -0
- package/esm/auth/static/assets/Page-CFcEsGK8.d.ts +2 -0
- package/esm/auth/static/assets/Page-CFcEsGK8.js +7 -0
- package/esm/auth/static/assets/Page-tLVs5slF.js +1 -0
- package/esm/auth/static/assets/index-D38rqu4x.d.ts +201 -0
- package/esm/auth/static/assets/index-D38rqu4x.js +2 -0
- package/esm/auth/static/index.html +1 -1
- package/esm/bin/cmd.js +3 -3
- package/esm/carbone/CarboneController.d.ts +35 -0
- package/esm/carbone/CarboneController.js +155 -0
- package/esm/carbone/Roles_Carbon.d.ts +8 -0
- package/esm/carbone/Roles_Carbon.js +8 -0
- package/esm/carbone/carboneEntities.d.ts +21 -0
- package/esm/carbone/carboneEntities.js +83 -0
- package/esm/carbone/index.d.ts +29 -0
- package/esm/carbone/index.js +68 -0
- package/esm/carbone/server/CarboneServer.d.ts +19 -0
- package/esm/carbone/server/CarboneServer.js +38 -0
- package/esm/carbone/server/index.d.ts +7 -0
- package/esm/carbone/server/index.js +23 -0
- package/esm/changeLog/changeLogEntities.js +1 -1
- package/esm/cron/Cron.js +1 -1
- package/esm/feedback/FeedbackController.d.ts +6 -2
- package/esm/feedback/FeedbackController.js +145 -143
- package/esm/feedback/server/index.d.ts +2 -2
- package/esm/feedback/server/index.js +3 -3
- package/esm/feedback/types.d.ts +5 -0
- package/esm/feedback/ui/DialogIssue.svelte +5 -5
- package/esm/feedback/ui/DialogIssues.svelte +5 -5
- package/esm/feedback/ui/DialogMilestones.svelte +1 -1
- package/esm/internals/BaseEnum.d.ts +1 -0
- package/esm/internals/FF_Fields.d.ts +6 -4
- package/esm/internals/FF_Fields.js +27 -64
- package/esm/internals/cellsBuildor.d.ts +2 -1
- package/esm/internals/index.d.ts +7 -8
- package/esm/internals/storeItem.d.ts +1 -0
- package/esm/mail/Mail.js +1 -1
- package/esm/mail/server/index.d.ts +8 -2
- package/esm/mail/server/index.js +35 -7
- package/esm/server/index.d.ts +1 -1
- package/esm/svelte/FF_Cell.svelte +3 -5
- package/esm/svelte/FF_Cell.svelte.d.ts +13 -4
- package/esm/svelte/FF_Cell_Caption.svelte.d.ts +10 -3
- package/esm/svelte/FF_Cell_Display.svelte.d.ts +10 -3
- package/esm/svelte/FF_Cell_Edit.svelte.d.ts +11 -4
- package/esm/svelte/FF_Cell_Error.svelte.d.ts +10 -3
- package/esm/svelte/FF_Cell_Hint.svelte.d.ts +10 -3
- package/esm/svelte/FF_Form.svelte +4 -5
- package/esm/svelte/FF_Form.svelte.d.ts +10 -3
- package/esm/svelte/FF_Grid.svelte +2 -2
- package/esm/svelte/FF_Grid.svelte.d.ts +10 -3
- package/esm/svelte/FF_Layout.svelte +3 -3
- package/esm/svelte/FF_Layout.svelte.d.ts +10 -3
- package/esm/svelte/dialog/DialogManagement.svelte +2 -5
- package/esm/svelte/dialog/DialogPrimitive.svelte +1 -2
- package/esm/svelte/dialog/dialog.js +2 -2
- package/esm/svelte/ff_Config.svelte.js +2 -2
- package/esm/svelte/index.d.ts +2 -7
- package/esm/svelte/index.js +2 -7
- package/esm/ui/Button.svelte +40 -23
- package/esm/ui/Button.svelte.d.ts +10 -34
- package/esm/ui/Clipboardable.svelte +13 -17
- package/esm/ui/Clipboardable.svelte.d.ts +9 -33
- package/esm/ui/Field.svelte +38 -8
- package/esm/ui/FieldGroup.svelte.d.ts +1 -1
- package/esm/ui/Grid.svelte +11 -82
- package/esm/ui/Grid.svelte.d.ts +0 -1
- package/esm/ui/Grid2.svelte +25 -86
- package/esm/ui/Grid2.svelte.d.ts +1 -2
- package/esm/ui/GridPaginate.svelte +1 -1
- package/esm/ui/GridPaginate2.svelte +2 -2
- package/esm/ui/Icon.svelte +2 -18
- package/esm/ui/Icon.svelte.d.ts +0 -2
- package/esm/ui/LibIcon.js +2 -2
- package/esm/ui/Loading.svelte +1 -1
- package/esm/ui/Tooltip.svelte +3 -2
- package/esm/ui/dialog/DialogManagement.svelte +14 -5
- package/esm/ui/dialog/DialogPrimitive.svelte +4 -4
- package/esm/ui/dialog/FormEditAction.svelte +4 -4
- package/esm/ui/dialog/dialog.d.ts +5 -2
- package/esm/ui/dialog/dialog.js +2 -2
- package/esm/ui/index.d.ts +1 -0
- package/esm/ui/index.js +1 -0
- package/esm/ui/internals/FieldContainer.svelte +25 -14
- package/esm/ui/internals/FieldContainer.svelte.d.ts +9 -30
- package/esm/ui/internals/Input.svelte.d.ts +1 -1
- package/esm/ui/internals/Textarea.svelte +2 -5
- package/esm/ui/internals/select/MultiSelectMelt.svelte +6 -4
- package/esm/ui/internals/select/Select2.svelte +88 -0
- package/esm/ui/internals/select/Select2.svelte.d.ts +12 -0
- package/esm/ui/internals/select/SelectMelt.svelte +5 -5
- package/esm/ui/internals/select/SelectRadio.svelte +1 -1
- package/esm/ui/link/Link.svelte +1 -1
- package/esm/ui/link/LinkPlus.svelte +9 -5
- package/esm/ui/link/LinkPlus.svelte.d.ts +5 -19
- package/esm/virtual/Customer.js +2 -3
- package/esm/virtual/UIEntity.js +10 -6
- package/package.json +16 -9
- package/esm/auth/static/assets/Page-9Ytj29NS.js +0 -1
- package/esm/auth/static/assets/Page-C1pM-UDt.d.ts +0 -2
- package/esm/auth/static/assets/Page-C1pM-UDt.js +0 -20
- package/esm/auth/static/assets/Page-CPz6KCw_.js +0 -1
- package/esm/auth/static/assets/index-AoBb9Ds5.d.ts +0 -232
- package/esm/auth/static/assets/index-AoBb9Ds5.js +0 -2
- package/esm/svelte/FF_Display.svelte +0 -51
- package/esm/svelte/FF_Display.svelte.d.ts +0 -22
- package/esm/svelte/FF_Edit.svelte +0 -104
- package/esm/svelte/FF_Edit.svelte.d.ts +0 -25
- package/esm/svelte/FF_Error.svelte +0 -23
- package/esm/svelte/FF_Error.svelte.d.ts +0 -22
- package/esm/svelte/FF_Field.svelte +0 -62
- package/esm/svelte/FF_Field.svelte.d.ts +0 -22
- package/esm/svelte/FF_Hint.svelte +0 -21
- package/esm/svelte/FF_Hint.svelte.d.ts +0 -22
- package/esm/svelte/FF_Label.svelte +0 -23
- package/esm/svelte/FF_Label.svelte.d.ts +0 -22
- /package/esm/auth/static/assets/{Page-CPz6KCw_.d.ts → Page-BRNWcY5Z.d.ts} +0 -0
- /package/esm/auth/static/assets/{Page-9Ytj29NS.d.ts → Page-tLVs5slF.d.ts} +0 -0
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
<div>
|
|
43
43
|
<Button
|
|
44
44
|
class={issueState === 'OPEN' ? 'btn-primary' : 'btn-ghost'}
|
|
45
|
-
|
|
45
|
+
onclick={() => update('OPEN')}>En cours</Button
|
|
46
46
|
>
|
|
47
47
|
<Button
|
|
48
48
|
class={issueState === 'CLOSED' ? 'btn-primary' : 'btn-ghost'}
|
|
49
|
-
|
|
49
|
+
onclick={() => update('CLOSED')}>Clos</Button
|
|
50
50
|
>
|
|
51
51
|
</div>
|
|
52
52
|
|
|
53
53
|
<Button
|
|
54
|
-
|
|
54
|
+
onclick={async () => {
|
|
55
55
|
await dialog.show({
|
|
56
56
|
component: DialogIssue,
|
|
57
57
|
classes: { root: 'overflow-auto w-[80vh] h-[80vh]' },
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
|
|
71
71
|
{#each issues as issue}
|
|
72
72
|
<Button
|
|
73
|
-
|
|
73
|
+
onclick={async () => {
|
|
74
74
|
await dialog.show({
|
|
75
75
|
component: DialogIssue,
|
|
76
76
|
classes: { root: 'overflow-auto w-[80vh] h-[80vh]' },
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
>
|
|
87
87
|
<div class="flex w-full justify-center justify-items-center text-left">
|
|
88
88
|
<div class="flex-grow">
|
|
89
|
-
<span class="mr-2 inline-block w-8 text-right text-xs
|
|
89
|
+
<span class="mr-2 inline-block w-8 text-right text-xs text-base-content/60 italic"
|
|
90
90
|
>#{issue.number}</span
|
|
91
91
|
>
|
|
92
92
|
{@html issue.titleHTML}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ClassType, type FieldOptions } from 'remult';
|
|
2
|
+
import type { BaseEnum } from './BaseEnum';
|
|
2
3
|
export declare class FF_Fields {
|
|
3
|
-
static string<entityType = unknown, valueType = string>(o?: StringFieldOptions<entityType, valueType>): import("remult").ClassFieldDecorator<entityType, valueType | undefined>;
|
|
4
4
|
static currency<entityType = unknown>(o?: FieldOptions<entityType, number>): import("remult").ClassFieldDecorator<entityType, number | undefined>;
|
|
5
|
-
static dateOnly<entityType = any>(o?: FieldOptions<entityType, Date>): import("remult").ClassFieldDecorator<entityType, Date | undefined>;
|
|
6
5
|
static arrayEnum<enumType = any, entityType = any>(enumClass: enumType, o?: FieldOptions<entityType, any[]>): import("remult").ClassFieldDecorator<entityType, any[] | undefined>;
|
|
7
6
|
static arrayEnumToGql<enumType = any, entityType = any>(enumClass: enumType, o?: FieldOptions<entityType, any[]>): import("remult").ClassFieldDecorator<entityType, any[] | undefined>;
|
|
8
|
-
static arrayValueList<enumType = any, entityType = any>(enumClass:
|
|
7
|
+
static arrayValueList<enumType = any, entityType = any>(enumClass: ClassType<BaseEnum<any>>, o?: FieldOptions<entityType, any[]>): import("remult").ClassFieldDecorator<entityType, any[] | undefined>;
|
|
8
|
+
static vector32<entityType = unknown>(...options: (FieldOptions<entityType, number[]> & {
|
|
9
|
+
dimensions?: number;
|
|
10
|
+
})[]): import("remult").ClassFieldDecorator<entityType, number[] | undefined>;
|
|
9
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fields, Validators
|
|
1
|
+
import { Fields, Validators } from 'remult';
|
|
2
2
|
import { displayCurrency } from '../formats';
|
|
3
3
|
import { getEnums } from './helper';
|
|
4
4
|
// Translate default messages
|
|
@@ -6,52 +6,7 @@ import { getEnums } from './helper';
|
|
|
6
6
|
// It look like I have 2 remult loaded... But even trying to remove one, I still have the issue
|
|
7
7
|
Validators.unique.defaultMessage = 'Existe déjà!';
|
|
8
8
|
Validators.required.defaultMessage = 'Obligatoire!';
|
|
9
|
-
// export function addValidators(
|
|
10
|
-
// validators: FieldOptions['validate'],
|
|
11
|
-
// newValidator: FieldOptions['validate'],
|
|
12
|
-
// atStart = false,
|
|
13
|
-
// ) {
|
|
14
|
-
// if (!newValidator) return validators
|
|
15
|
-
// const newValidators = Array.isArray(newValidator) ? newValidator : [newValidator]
|
|
16
|
-
// const validatorsArray = Array.isArray(validators) ? validators : validators ? [validators] : []
|
|
17
|
-
// return atStart ? [...newValidators, ...validatorsArray] : [...validatorsArray, ...newValidators]
|
|
18
|
-
// }
|
|
19
|
-
// REMULT P2: A/ Add in the doc that allowNull is false by default
|
|
20
|
-
// B/ Would be great to have a Validators.required automatically when allowNull is not true.
|
|
21
|
-
// C/ WARNING Validators.required is also checking for empty string
|
|
22
|
-
const validate_update_when_not_allow_null = (o) => {
|
|
23
|
-
const validate = [];
|
|
24
|
-
if (o.includeInApi !== false &&
|
|
25
|
-
o.serverExpression === undefined &&
|
|
26
|
-
o.sqlExpression === undefined &&
|
|
27
|
-
(o.allowNull === undefined || o.allowNull === false) &&
|
|
28
|
-
// if require: false is explicitly set, then we don't need to add required validator
|
|
29
|
-
o.required !== false) {
|
|
30
|
-
// addValidators(o.validate, [Validators.required], true)
|
|
31
|
-
validate.push(Validators.required);
|
|
32
|
-
}
|
|
33
|
-
// let's add original validate if any
|
|
34
|
-
if (o.validate) {
|
|
35
|
-
if (Array.isArray(o.validate)) {
|
|
36
|
-
validate.push(...o.validate);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
validate.push(o.validate);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return validate;
|
|
43
|
-
};
|
|
44
9
|
export class FF_Fields {
|
|
45
|
-
static string(o) {
|
|
46
|
-
if (o === undefined) {
|
|
47
|
-
o = {};
|
|
48
|
-
}
|
|
49
|
-
// let's return the field
|
|
50
|
-
return Fields.string({
|
|
51
|
-
...o,
|
|
52
|
-
validate: validate_update_when_not_allow_null(o),
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
10
|
static currency(o) {
|
|
56
11
|
// let's return the field
|
|
57
12
|
return Fields.number({
|
|
@@ -80,15 +35,6 @@ export class FF_Fields {
|
|
|
80
35
|
},
|
|
81
36
|
});
|
|
82
37
|
}
|
|
83
|
-
static dateOnly(o) {
|
|
84
|
-
// empty if there is nothing coming here.
|
|
85
|
-
if (o === undefined) {
|
|
86
|
-
o = {};
|
|
87
|
-
}
|
|
88
|
-
o.inputType = 'dateOnly';
|
|
89
|
-
// let's return the field
|
|
90
|
-
return Fields.dateOnly({ ...o, validate: validate_update_when_not_allow_null(o) });
|
|
91
|
-
}
|
|
92
38
|
static arrayEnum(enumClass, o) {
|
|
93
39
|
return Fields.json(() => Array, {
|
|
94
40
|
...o,
|
|
@@ -155,18 +101,22 @@ export class FF_Fields {
|
|
|
155
101
|
fromDb: (v) => {
|
|
156
102
|
if (!v)
|
|
157
103
|
return [];
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
.
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
.
|
|
165
|
-
|
|
104
|
+
const arr = Array.isArray(v)
|
|
105
|
+
? v
|
|
106
|
+
: v?.split(',').flatMap((c) => c.replaceAll('{', '').replaceAll('}', ''));
|
|
107
|
+
const list = getEnums(enumClass);
|
|
108
|
+
const toRet = [];
|
|
109
|
+
for (const s of arr) {
|
|
110
|
+
const found = list.find((c) => c.id === s);
|
|
111
|
+
if (found) {
|
|
112
|
+
toRet.push(found);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return toRet;
|
|
166
116
|
},
|
|
167
117
|
toDb: (v) => {
|
|
168
118
|
const arr = Array.isArray(v) ? v : [v];
|
|
169
|
-
return `{${[...new Set((arr ?? []).map((c) => c.id))].join(',')}}`;
|
|
119
|
+
return `{${[...new Set((arr.filter((c) => c !== undefined) ?? []).map((c) => c.id))].join(',')}}`;
|
|
170
120
|
},
|
|
171
121
|
displayValue: (v) => {
|
|
172
122
|
// Nice to have a oneLiner, but if you want custom style, just take the array and do what you want
|
|
@@ -178,4 +128,17 @@ export class FF_Fields {
|
|
|
178
128
|
},
|
|
179
129
|
});
|
|
180
130
|
}
|
|
131
|
+
static vector32(...options) {
|
|
132
|
+
const dimensions = options[0].dimensions ?? 1024;
|
|
133
|
+
return Fields.object({
|
|
134
|
+
valueConverter: {
|
|
135
|
+
fieldTypeInDb: `F32_BLOB(${dimensions})`,
|
|
136
|
+
toDb: (val) => JSON.stringify(val),
|
|
137
|
+
// TODO: remove ts-ignore when remult@3.3.0-next.1 is released (that has toDbSql)
|
|
138
|
+
// @ts-ignore
|
|
139
|
+
toDbSql: (val) => `vector32(${val})`,
|
|
140
|
+
fromDb: (val) => Array.from(new Float32Array(val)),
|
|
141
|
+
},
|
|
142
|
+
}, ...options);
|
|
143
|
+
}
|
|
181
144
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SvelteComponent } from 'svelte';
|
|
1
|
+
import type { Component, SvelteComponent } from 'svelte';
|
|
2
2
|
import { type ClassType, type EntityFilter, type FieldMetadata, type Repository } from 'remult';
|
|
3
3
|
import type { UnArray } from '../utils/types.js';
|
|
4
4
|
export type VisibilityMode = 'view' | 'edit' | 'hide';
|
|
@@ -13,6 +13,7 @@ type CellInternal<Entity> = {
|
|
|
13
13
|
clipboardable?: boolean;
|
|
14
14
|
clearable?: boolean;
|
|
15
15
|
component?: new (...args: any[]) => SvelteComponent;
|
|
16
|
+
componentS5?: Component;
|
|
16
17
|
props?: any;
|
|
17
18
|
rowToProps?: (row: any) => any;
|
|
18
19
|
};
|
package/esm/internals/index.d.ts
CHANGED
|
@@ -18,20 +18,19 @@ import { default as Link } from '../ui/link/Link.svelte';
|
|
|
18
18
|
import { default as LinkPlus } from '../ui/link/LinkPlus.svelte';
|
|
19
19
|
import { default as Loading } from '../ui/Loading.svelte';
|
|
20
20
|
import { default as Tooltip } from '../ui/Tooltip.svelte';
|
|
21
|
-
import type { BaseEnum, BaseItem, FF_Icon } from './BaseEnum.js';
|
|
22
|
-
import type { CellsInput
|
|
21
|
+
import type { BaseEnum, BaseItem, BaseItemLight, FF_Icon } from './BaseEnum.js';
|
|
22
|
+
import type { CellsInput } from './cellsBuildor.js';
|
|
23
23
|
import { FF_Role } from './common.js';
|
|
24
|
-
import { storeItem } from './storeItem.js';
|
|
24
|
+
import { storeItem, type StoreItem } from './storeItem.js';
|
|
25
25
|
import { storeList } from './storeList.js';
|
|
26
26
|
export { Field, FormEditAction, Grid, Grid2, GridPaginate, GridPaginate2, FieldGroup, Icon, Link, LinkPlus, Loading, Button, Tooltip, DialogManagement, FieldContainer, SelectMelt, Clipboardable, };
|
|
27
27
|
export type { BaseEnumOptions } from './BaseEnum.js';
|
|
28
|
-
export type { BaseItem };
|
|
29
|
-
export type BaseItemLight = Partial<BaseItem>;
|
|
28
|
+
export type { BaseItem, BaseItemLight };
|
|
30
29
|
export type { DialogMetaDataInternal } from '../ui/dialog/dialog.js';
|
|
31
|
-
export type CellsInput
|
|
30
|
+
export type { CellsInput };
|
|
32
31
|
export type { Cell, VisibilityMode } from './cellsBuildor.js';
|
|
33
32
|
export type { FF_FindOptions } from './storeList.js';
|
|
34
|
-
export type StoreItem
|
|
33
|
+
export type { StoreItem };
|
|
35
34
|
export type StoreList<T> = ReturnType<typeof storeList<T>>;
|
|
36
35
|
export type { ResolvedType, UnArray, RecursivePartial } from '../utils/types.js';
|
|
37
36
|
export { FF_Fields } from './FF_Fields.js';
|
|
@@ -57,7 +56,7 @@ declare module 'remult' {
|
|
|
57
56
|
suffixEdit?: string;
|
|
58
57
|
suffixEditWithS?: boolean;
|
|
59
58
|
styleRadioUntil?: number;
|
|
60
|
-
step?: '1' | '0.1' | '0.01';
|
|
59
|
+
step?: '1' | '0.1' | '0.01' | '0.5';
|
|
61
60
|
href?: (item: entityType) => string;
|
|
62
61
|
findOptionsForEdit?: ((entity: entityType) => FindOptionsBase<valueType>) | FindOptionsBase<valueType>;
|
|
63
62
|
findOptionsLimit?: number;
|
package/esm/mail/Mail.js
CHANGED
|
@@ -29,8 +29,14 @@ export type MailOptions = GlobalEasyOptions & {
|
|
|
29
29
|
defaults?: DefaultOptions;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
declare let transporter: ReturnType<typeof typeNodemailer.createTransport>;
|
|
33
32
|
export type SendMail = typeof sendMail;
|
|
33
|
+
export type SendMailResult = {
|
|
34
|
+
data: SMTPTransport.SentMessageInfo;
|
|
35
|
+
error?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
error: any;
|
|
38
|
+
data?: undefined;
|
|
39
|
+
};
|
|
34
40
|
export declare const sendMail: (
|
|
35
41
|
/** usefull for logs, it has NO impact on the mail itself */
|
|
36
42
|
topic: string, easyOptions: GlobalEasyOptions & {
|
|
@@ -46,6 +52,6 @@ topic: string, easyOptions: GlobalEasyOptions & {
|
|
|
46
52
|
}[];
|
|
47
53
|
}, options?: {
|
|
48
54
|
nodemailer?: MailOptions['nodemailer'];
|
|
49
|
-
}) =>
|
|
55
|
+
}) => Promise<SendMailResult>;
|
|
50
56
|
export declare const mail: (o?: MailOptions) => Module<unknown>;
|
|
51
57
|
export {};
|
package/esm/mail/server/index.js
CHANGED
|
@@ -99,10 +99,10 @@ export const sendMail = async (topic, easyOptions, options) => {
|
|
|
99
99
|
}
|
|
100
100
|
try {
|
|
101
101
|
if (!globalOptions?.nodemailer?.transport) {
|
|
102
|
-
const
|
|
102
|
+
const data = await transporter.sendMail({ ...nodemailerOptions.defaults });
|
|
103
103
|
log.error(`${magenta(`[${topic}]`)} - ⚠️ ${red(`mail not configured`)} ⚠️
|
|
104
104
|
We are still nice and generated you an email preview link (the mail we not really sent):
|
|
105
|
-
👉 ${cyan(String(nodemailer.getTestMessageUrl(
|
|
105
|
+
👉 ${cyan(String(nodemailer.getTestMessageUrl(data)))}
|
|
106
106
|
|
|
107
107
|
To really send mails, check out the doc ${white(`https://firstly.fun/modules/mail`)}.
|
|
108
108
|
`);
|
|
@@ -113,10 +113,10 @@ export const sendMail = async (topic, easyOptions, options) => {
|
|
|
113
113
|
topic,
|
|
114
114
|
metadata,
|
|
115
115
|
});
|
|
116
|
-
return
|
|
116
|
+
return { data };
|
|
117
117
|
}
|
|
118
118
|
else {
|
|
119
|
-
const
|
|
119
|
+
const data = await transporter.sendMail({ ...nodemailerOptions.defaults });
|
|
120
120
|
log.success(`${magenta(`[${topic}]`)} - Sent to ${typeof nodemailerOptions.defaults?.to === 'string' ? green(nodemailerOptions.defaults?.to) : nodemailerOptions.defaults?.to}`);
|
|
121
121
|
await repo(mailEntities.Mail).insert({
|
|
122
122
|
status: 'sent',
|
|
@@ -125,7 +125,7 @@ export const sendMail = async (topic, easyOptions, options) => {
|
|
|
125
125
|
topic,
|
|
126
126
|
metadata,
|
|
127
127
|
});
|
|
128
|
-
return
|
|
128
|
+
return { data };
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
catch (error) {
|
|
@@ -138,15 +138,43 @@ ${cyan(JSON.stringify(globalOptions?.nodemailer?.transport, null, 2))}
|
|
|
138
138
|
else {
|
|
139
139
|
log.error(`${magenta(`[${topic}]`)} - Error`, error);
|
|
140
140
|
}
|
|
141
|
+
// TODO
|
|
142
|
+
// Build comprehensive error info for JSON storage
|
|
143
|
+
const errorInfoJSON = {
|
|
144
|
+
message: error instanceof Error ? error.message : String(error),
|
|
145
|
+
name: error instanceof Error ? error.name : 'Unknown',
|
|
146
|
+
// stack: error instanceof Error ? error.stack : undefined,
|
|
147
|
+
code: error?.code,
|
|
148
|
+
errno: error?.errno,
|
|
149
|
+
syscall: error?.syscall,
|
|
150
|
+
hostname: error?.hostname,
|
|
151
|
+
port: error?.port,
|
|
152
|
+
address: error?.address,
|
|
153
|
+
response: error?.response,
|
|
154
|
+
responseCode: error?.responseCode,
|
|
155
|
+
command: error?.command,
|
|
156
|
+
// Capture any other enumerable properties
|
|
157
|
+
...Object.getOwnPropertyNames(error).reduce((acc, key) => {
|
|
158
|
+
if (!['message', 'name', 'stack'].includes(key)) {
|
|
159
|
+
try {
|
|
160
|
+
acc[key] = error[key];
|
|
161
|
+
}
|
|
162
|
+
catch (e) {
|
|
163
|
+
// Ignore properties that can't be accessed
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return acc;
|
|
167
|
+
}, {}),
|
|
168
|
+
};
|
|
141
169
|
await repo(mailEntities.Mail).insert({
|
|
142
170
|
status: 'error',
|
|
143
|
-
errorInfo: JSON.stringify(
|
|
171
|
+
errorInfo: JSON.stringify(errorInfoJSON),
|
|
144
172
|
to: JSON.stringify(to),
|
|
145
173
|
html: easyOptionsToUse.saveHtml ? html : '',
|
|
146
174
|
topic,
|
|
147
175
|
metadata,
|
|
148
176
|
});
|
|
149
|
-
|
|
177
|
+
return { error };
|
|
150
178
|
}
|
|
151
179
|
};
|
|
152
180
|
const mailModule = new Module({
|
package/esm/server/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare class ModuleFF {
|
|
|
27
27
|
modulesFF?: ModuleFF[];
|
|
28
28
|
constructor(input: ModuleInput);
|
|
29
29
|
}
|
|
30
|
-
type Options = RemultServerOptions<RequestEvent<Partial<Record<string, string>>,
|
|
30
|
+
type Options = RemultServerOptions<RequestEvent<Partial<Record<string, string>>, any>> & {
|
|
31
31
|
/** @deprecated use `remult` modules instead */
|
|
32
32
|
modulesFF?: ModuleFF[] | undefined;
|
|
33
33
|
};
|
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
cell: CellMetadata<valueType, entityType>
|
|
14
14
|
r?: FF_Repo<entityType>
|
|
15
15
|
class?: string
|
|
16
|
+
value?: valueType
|
|
17
|
+
error?: string
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
let props: Props<valueType, entityType> = $props()
|
|
20
|
+
let { value = $bindable(), error, ...props }: Props<valueType, entityType> = $props()
|
|
20
21
|
|
|
21
22
|
// let classes = $derived(getClasses('field', props.classes))
|
|
22
23
|
|
|
@@ -25,9 +26,6 @@
|
|
|
25
26
|
let hint = $derived(props.cell.field?.options.ui?.hint ?? props.cell.ui?.hint)
|
|
26
27
|
// @ts-ignore
|
|
27
28
|
let ui = $derived(deepMerge(props.cell.field?.options.ui ?? {}, props.cell.ui ?? {}))
|
|
28
|
-
|
|
29
|
-
let error = ''
|
|
30
|
-
let value: any = $state('')
|
|
31
29
|
</script>
|
|
32
30
|
|
|
33
31
|
<!-- Snippets sections -->
|
|
@@ -4,12 +4,21 @@ interface Props<valueType = unknown, entityType = unknown> {
|
|
|
4
4
|
cell: CellMetadata<valueType, entityType>;
|
|
5
5
|
r?: FF_Repo<entityType>;
|
|
6
6
|
class?: string;
|
|
7
|
+
value?: valueType;
|
|
8
|
+
error?: string;
|
|
7
9
|
}
|
|
10
|
+
declare function $$render<valueType = unknown, entityType = unknown>(): {
|
|
11
|
+
props: Props<valueType, entityType>;
|
|
12
|
+
exports: {};
|
|
13
|
+
bindings: "value";
|
|
14
|
+
slots: {};
|
|
15
|
+
events: {};
|
|
16
|
+
};
|
|
8
17
|
declare class __sveltets_Render<valueType = unknown, entityType = unknown> {
|
|
9
|
-
props():
|
|
10
|
-
events():
|
|
11
|
-
slots():
|
|
12
|
-
bindings(): "";
|
|
18
|
+
props(): ReturnType<typeof $$render<valueType, entityType>>['props'];
|
|
19
|
+
events(): ReturnType<typeof $$render<valueType, entityType>>['events'];
|
|
20
|
+
slots(): ReturnType<typeof $$render<valueType, entityType>>['slots'];
|
|
21
|
+
bindings(): "value";
|
|
13
22
|
exports(): {};
|
|
14
23
|
}
|
|
15
24
|
interface $$IsomorphicComponent {
|
|
@@ -5,10 +5,17 @@ interface Props<valueType = unknown, entityType = unknown> {
|
|
|
5
5
|
caption?: string;
|
|
6
6
|
class?: string;
|
|
7
7
|
}
|
|
8
|
+
declare function $$render<valueType = unknown, entityType = unknown>(): {
|
|
9
|
+
props: Props<valueType, entityType>;
|
|
10
|
+
exports: {};
|
|
11
|
+
bindings: "";
|
|
12
|
+
slots: {};
|
|
13
|
+
events: {};
|
|
14
|
+
};
|
|
8
15
|
declare class __sveltets_Render<valueType = unknown, entityType = unknown> {
|
|
9
|
-
props():
|
|
10
|
-
events():
|
|
11
|
-
slots():
|
|
16
|
+
props(): ReturnType<typeof $$render<valueType, entityType>>['props'];
|
|
17
|
+
events(): ReturnType<typeof $$render<valueType, entityType>>['events'];
|
|
18
|
+
slots(): ReturnType<typeof $$render<valueType, entityType>>['slots'];
|
|
12
19
|
bindings(): "";
|
|
13
20
|
exports(): {};
|
|
14
21
|
}
|
|
@@ -3,10 +3,17 @@ import { type CustomFieldDefaultProps } from './customField';
|
|
|
3
3
|
interface Props extends CustomFieldDefaultProps {
|
|
4
4
|
classes?: DisplayTheme;
|
|
5
5
|
}
|
|
6
|
+
declare function $$render<valueType = unknown, entityType = unknown>(): {
|
|
7
|
+
props: Props;
|
|
8
|
+
exports: {};
|
|
9
|
+
bindings: "";
|
|
10
|
+
slots: {};
|
|
11
|
+
events: {};
|
|
12
|
+
};
|
|
6
13
|
declare class __sveltets_Render<valueType = unknown, entityType = unknown> {
|
|
7
|
-
props():
|
|
8
|
-
events():
|
|
9
|
-
slots():
|
|
14
|
+
props(): ReturnType<typeof $$render<valueType, entityType>>['props'];
|
|
15
|
+
events(): ReturnType<typeof $$render<valueType, entityType>>['events'];
|
|
16
|
+
slots(): ReturnType<typeof $$render<valueType, entityType>>['slots'];
|
|
10
17
|
bindings(): "";
|
|
11
18
|
exports(): {};
|
|
12
19
|
}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { type FieldMetadata } from 'remult';
|
|
2
2
|
import type { EditTheme } from '.';
|
|
3
|
-
declare
|
|
4
|
-
props
|
|
3
|
+
declare function $$render<valueType = unknown, entityType = unknown>(): {
|
|
4
|
+
props: {
|
|
5
5
|
uid?: string;
|
|
6
6
|
field: FieldMetadata<valueType, entityType>;
|
|
7
7
|
value: valueType;
|
|
8
8
|
error?: string;
|
|
9
9
|
classes?: EditTheme;
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
exports: {};
|
|
12
|
+
bindings: "value";
|
|
13
|
+
slots: {};
|
|
14
|
+
events: {};
|
|
15
|
+
};
|
|
16
|
+
declare class __sveltets_Render<valueType = unknown, entityType = unknown> {
|
|
17
|
+
props(): ReturnType<typeof $$render<valueType, entityType>>['props'];
|
|
18
|
+
events(): ReturnType<typeof $$render<valueType, entityType>>['events'];
|
|
19
|
+
slots(): ReturnType<typeof $$render<valueType, entityType>>['slots'];
|
|
13
20
|
bindings(): "value";
|
|
14
21
|
exports(): {};
|
|
15
22
|
}
|
|
@@ -5,10 +5,17 @@ interface Props<valueType = unknown, entityType = unknown> {
|
|
|
5
5
|
error?: string;
|
|
6
6
|
class?: string;
|
|
7
7
|
}
|
|
8
|
+
declare function $$render<valueType = unknown, entityType = unknown>(): {
|
|
9
|
+
props: Props<valueType, entityType>;
|
|
10
|
+
exports: {};
|
|
11
|
+
bindings: "";
|
|
12
|
+
slots: {};
|
|
13
|
+
events: {};
|
|
14
|
+
};
|
|
8
15
|
declare class __sveltets_Render<valueType = unknown, entityType = unknown> {
|
|
9
|
-
props():
|
|
10
|
-
events():
|
|
11
|
-
slots():
|
|
16
|
+
props(): ReturnType<typeof $$render<valueType, entityType>>['props'];
|
|
17
|
+
events(): ReturnType<typeof $$render<valueType, entityType>>['events'];
|
|
18
|
+
slots(): ReturnType<typeof $$render<valueType, entityType>>['slots'];
|
|
12
19
|
bindings(): "";
|
|
13
20
|
exports(): {};
|
|
14
21
|
}
|
|
@@ -5,10 +5,17 @@ interface Props<valueType = unknown, entityType = unknown> {
|
|
|
5
5
|
hint?: string;
|
|
6
6
|
class?: string;
|
|
7
7
|
}
|
|
8
|
+
declare function $$render<valueType = unknown, entityType = unknown>(): {
|
|
9
|
+
props: Props<valueType, entityType>;
|
|
10
|
+
exports: {};
|
|
11
|
+
bindings: "";
|
|
12
|
+
slots: {};
|
|
13
|
+
events: {};
|
|
14
|
+
};
|
|
8
15
|
declare class __sveltets_Render<valueType = unknown, entityType = unknown> {
|
|
9
|
-
props():
|
|
10
|
-
events():
|
|
11
|
-
slots():
|
|
16
|
+
props(): ReturnType<typeof $$render<valueType, entityType>>['props'];
|
|
17
|
+
events(): ReturnType<typeof $$render<valueType, entityType>>['events'];
|
|
18
|
+
slots(): ReturnType<typeof $$render<valueType, entityType>>['slots'];
|
|
12
19
|
bindings(): "";
|
|
13
20
|
exports(): {};
|
|
14
21
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" generics="entityType = unknown">
|
|
2
2
|
import { EntityError, getEntityRef } from 'remult'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { FF_Cell, getClasses } from './'
|
|
5
5
|
import type { FF_Repo, FieldGroup, FormTheme } from './'
|
|
6
6
|
|
|
7
7
|
const default_uid = $props.id()
|
|
@@ -91,11 +91,10 @@
|
|
|
91
91
|
{/if}
|
|
92
92
|
<div data-ff-form-fields class="{classes?.fields} {group.class}">
|
|
93
93
|
{#each group.fields as field}
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
{field}
|
|
94
|
+
<FF_Cell
|
|
95
|
+
cell={{ field, mode: 'edit' }}
|
|
97
96
|
bind:value={valuesToUse[field.key as keyof entityType]}
|
|
98
|
-
error={errors[field.key]}
|
|
97
|
+
error={errors[field.key ?? '']}
|
|
99
98
|
/>
|
|
100
99
|
{/each}
|
|
101
100
|
</div>
|
|
@@ -11,10 +11,17 @@ interface Props<entityType> {
|
|
|
11
11
|
};
|
|
12
12
|
onSaved?: (item: entityType) => void;
|
|
13
13
|
}
|
|
14
|
+
declare function $$render<entityType = unknown>(): {
|
|
15
|
+
props: Props<entityType>;
|
|
16
|
+
exports: {};
|
|
17
|
+
bindings: "";
|
|
18
|
+
slots: {};
|
|
19
|
+
events: {};
|
|
20
|
+
};
|
|
14
21
|
declare class __sveltets_Render<entityType = unknown> {
|
|
15
|
-
props():
|
|
16
|
-
events():
|
|
17
|
-
slots():
|
|
22
|
+
props(): ReturnType<typeof $$render<entityType>>['props'];
|
|
23
|
+
events(): ReturnType<typeof $$render<entityType>>['events'];
|
|
24
|
+
slots(): ReturnType<typeof $$render<entityType>>['slots'];
|
|
18
25
|
bindings(): "";
|
|
19
26
|
exports(): {};
|
|
20
27
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import Icon from '../ui/Icon.svelte'
|
|
5
5
|
import { LibIcon_Add, LibIcon_Delete, LibIcon_Edit } from '../ui/LibIcon'
|
|
6
|
-
import { dialog,
|
|
6
|
+
import { dialog, FF_Cell_Display, FF_Repo, getClasses, type GridTheme } from './'
|
|
7
7
|
|
|
8
8
|
interface Props<entityType> {
|
|
9
9
|
// uid?: string
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
<tr data-ff-grid-row class={classes?.row}>
|
|
101
101
|
{#each fields as f (f.key)}
|
|
102
102
|
<td data-ff-grid-row-cell class="{classes?.rowCell} td-{f.inputType}">
|
|
103
|
-
<
|
|
103
|
+
<FF_Cell_Display field={f} value={item[f.key as keyof entityType]}></FF_Cell_Display>
|
|
104
104
|
</td>
|
|
105
105
|
{/each}
|
|
106
106
|
{#if showActions}
|
|
@@ -11,10 +11,17 @@ interface Props<entityType> {
|
|
|
11
11
|
ondelete?: (item: entityType) => void;
|
|
12
12
|
classes?: GridTheme;
|
|
13
13
|
}
|
|
14
|
+
declare function $$render<entityType = unknown>(): {
|
|
15
|
+
props: Props<entityType>;
|
|
16
|
+
exports: {};
|
|
17
|
+
bindings: "";
|
|
18
|
+
slots: {};
|
|
19
|
+
events: {};
|
|
20
|
+
};
|
|
14
21
|
declare class __sveltets_Render<entityType = unknown> {
|
|
15
|
-
props():
|
|
16
|
-
events():
|
|
17
|
-
slots():
|
|
22
|
+
props(): ReturnType<typeof $$render<entityType>>['props'];
|
|
23
|
+
events(): ReturnType<typeof $$render<entityType>>['events'];
|
|
24
|
+
slots(): ReturnType<typeof $$render<entityType>>['slots'];
|
|
18
25
|
bindings(): "";
|
|
19
26
|
exports(): {};
|
|
20
27
|
}
|