firstly 0.2.0 → 0.3.0

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 (135) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/esm/bin/cmd.js +3 -158
  3. package/esm/changeLog/index.d.ts +1 -6
  4. package/esm/feedback/FeedbackController.d.ts +6 -2
  5. package/esm/feedback/FeedbackController.js +145 -143
  6. package/esm/feedback/server/index.d.ts +2 -2
  7. package/esm/feedback/server/index.js +3 -3
  8. package/esm/feedback/types.d.ts +5 -0
  9. package/esm/feedback/ui/DialogIssue.svelte +5 -5
  10. package/esm/feedback/ui/DialogIssues.svelte +5 -5
  11. package/esm/feedback/ui/DialogMilestones.svelte +1 -1
  12. package/esm/internals/BaseEnum.d.ts +2 -1
  13. package/esm/internals/FF_Entity.js +1 -17
  14. package/esm/internals/FF_Fields.d.ts +4 -3
  15. package/esm/internals/FF_Fields.js +14 -55
  16. package/esm/internals/cellsBuildor.d.ts +2 -1
  17. package/esm/internals/cellsBuildor.js +5 -4
  18. package/esm/internals/index.d.ts +7 -12
  19. package/esm/internals/storeItem.d.ts +12 -20
  20. package/esm/internals/storeItem.js +20 -6
  21. package/esm/mail/server/index.d.ts +8 -2
  22. package/esm/mail/server/index.js +35 -7
  23. package/esm/server/index.d.ts +1 -1
  24. package/esm/svelte/FF_Cell.svelte +3 -5
  25. package/esm/svelte/FF_Cell.svelte.d.ts +4 -2
  26. package/esm/svelte/FF_Form.svelte +4 -5
  27. package/esm/svelte/FF_Grid.svelte +2 -2
  28. package/esm/svelte/FF_Layout.svelte +3 -3
  29. package/esm/svelte/FF_Repo.svelte.d.ts +9 -0
  30. package/esm/svelte/FF_Repo.svelte.js +39 -0
  31. package/esm/svelte/class/SP.svelte.js +14 -2
  32. package/esm/svelte/dialog/DialogManagement.svelte +2 -5
  33. package/esm/svelte/dialog/DialogPrimitive.svelte +1 -2
  34. package/esm/svelte/dialog/dialog.js +2 -2
  35. package/esm/svelte/ff_Config.svelte.js +2 -2
  36. package/esm/svelte/index.d.ts +2 -7
  37. package/esm/svelte/index.js +2 -7
  38. package/esm/ui/Button.svelte +34 -66
  39. package/esm/ui/Button.svelte.d.ts +9 -35
  40. package/esm/ui/Clipboardable.svelte +13 -17
  41. package/esm/ui/Clipboardable.svelte.d.ts +9 -33
  42. package/esm/ui/Field.svelte +48 -9
  43. package/esm/ui/FieldGroup.svelte.d.ts +1 -1
  44. package/esm/ui/Grid.svelte +13 -87
  45. package/esm/ui/Grid.svelte.d.ts +0 -1
  46. package/esm/ui/Grid2.svelte +26 -90
  47. package/esm/ui/Grid2.svelte.d.ts +1 -2
  48. package/esm/ui/GridPaginate.svelte +1 -1
  49. package/esm/ui/GridPaginate2.svelte +2 -2
  50. package/esm/ui/Icon.svelte +2 -18
  51. package/esm/ui/Icon.svelte.d.ts +0 -2
  52. package/esm/ui/LibIcon.js +2 -2
  53. package/esm/ui/Loading.svelte +1 -1
  54. package/esm/ui/dialog/DialogManagement.svelte +14 -5
  55. package/esm/ui/dialog/DialogPrimitive.svelte +3 -3
  56. package/esm/ui/dialog/FormEditAction.svelte +4 -4
  57. package/esm/ui/dialog/dialog.d.ts +5 -2
  58. package/esm/ui/dialog/dialog.js +2 -2
  59. package/esm/ui/index.d.ts +1 -0
  60. package/esm/ui/index.js +1 -0
  61. package/esm/ui/internals/FieldContainer.svelte +25 -14
  62. package/esm/ui/internals/FieldContainer.svelte.d.ts +9 -30
  63. package/esm/ui/internals/Input.svelte.d.ts +1 -1
  64. package/esm/ui/internals/Textarea.svelte +2 -5
  65. package/esm/ui/internals/select/MultiSelectMelt.svelte +10 -8
  66. package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +1 -1
  67. package/esm/ui/internals/select/Select2.svelte +88 -0
  68. package/esm/ui/internals/select/Select2.svelte.d.ts +12 -0
  69. package/esm/ui/internals/select/SelectMelt.svelte +33 -24
  70. package/esm/ui/internals/select/SelectMelt.svelte.d.ts +1 -1
  71. package/esm/ui/internals/select/SelectRadio.svelte +2 -2
  72. package/esm/ui/internals/select/SelectRadio.svelte.d.ts +1 -1
  73. package/esm/ui/link/Link.svelte +1 -1
  74. package/esm/ui/link/LinkPlus.svelte +9 -5
  75. package/esm/ui/link/LinkPlus.svelte.d.ts +5 -19
  76. package/esm/virtual/Customer.js +1 -2
  77. package/esm/virtual/UIEntity.js +9 -5
  78. package/package.json +11 -25
  79. package/esm/auth/AuthController.d.ts +0 -58
  80. package/esm/auth/AuthController.js +0 -114
  81. package/esm/auth/Entities.d.ts +0 -47
  82. package/esm/auth/Entities.js +0 -182
  83. package/esm/auth/README.md +0 -3
  84. package/esm/auth/index.d.ts +0 -5
  85. package/esm/auth/index.js +0 -5
  86. package/esm/auth/server/AuthController.server.d.ts +0 -58
  87. package/esm/auth/server/AuthController.server.js +0 -498
  88. package/esm/auth/server/handleAuth.d.ts +0 -4
  89. package/esm/auth/server/handleAuth.js +0 -142
  90. package/esm/auth/server/handleGuard.d.ts +0 -22
  91. package/esm/auth/server/handleGuard.js +0 -34
  92. package/esm/auth/server/helperDb.d.ts +0 -10
  93. package/esm/auth/server/helperDb.js +0 -56
  94. package/esm/auth/server/helperFirstly.d.ts +0 -1
  95. package/esm/auth/server/helperFirstly.js +0 -9
  96. package/esm/auth/server/helperOslo.d.ts +0 -7
  97. package/esm/auth/server/helperOslo.js +0 -24
  98. package/esm/auth/server/helperRemultServer.d.ts +0 -5
  99. package/esm/auth/server/helperRemultServer.js +0 -44
  100. package/esm/auth/server/helperRole.d.ts +0 -19
  101. package/esm/auth/server/helperRole.js +0 -57
  102. package/esm/auth/server/index.d.ts +0 -8
  103. package/esm/auth/server/index.js +0 -8
  104. package/esm/auth/server/module.d.ts +0 -300
  105. package/esm/auth/server/module.js +0 -230
  106. package/esm/auth/server/providers/github.d.ts +0 -33
  107. package/esm/auth/server/providers/github.js +0 -87
  108. package/esm/auth/server/providers/helperProvider.d.ts +0 -1
  109. package/esm/auth/server/providers/helperProvider.js +0 -25
  110. package/esm/auth/static/assets/Page-9Ytj29NS.d.ts +0 -2
  111. package/esm/auth/static/assets/Page-9Ytj29NS.js +0 -1
  112. package/esm/auth/static/assets/Page-BHW08QWz.css +0 -1
  113. package/esm/auth/static/assets/Page-C1pM-UDt.d.ts +0 -2
  114. package/esm/auth/static/assets/Page-C1pM-UDt.js +0 -20
  115. package/esm/auth/static/assets/Page-CPz6KCw_.d.ts +0 -2
  116. package/esm/auth/static/assets/Page-CPz6KCw_.js +0 -1
  117. package/esm/auth/static/assets/index-AoBb9Ds5.d.ts +0 -232
  118. package/esm/auth/static/assets/index-AoBb9Ds5.js +0 -2
  119. package/esm/auth/static/assets/index-DKWpA6v7.css +0 -4
  120. package/esm/auth/static/favicon.svg +0 -79
  121. package/esm/auth/static/index.html +0 -13
  122. package/esm/auth/types.d.ts +0 -73
  123. package/esm/auth/types.js +0 -1
  124. package/esm/svelte/FF_Display.svelte +0 -51
  125. package/esm/svelte/FF_Display.svelte.d.ts +0 -29
  126. package/esm/svelte/FF_Edit.svelte +0 -104
  127. package/esm/svelte/FF_Edit.svelte.d.ts +0 -32
  128. package/esm/svelte/FF_Error.svelte +0 -23
  129. package/esm/svelte/FF_Error.svelte.d.ts +0 -29
  130. package/esm/svelte/FF_Field.svelte +0 -62
  131. package/esm/svelte/FF_Field.svelte.d.ts +0 -29
  132. package/esm/svelte/FF_Hint.svelte +0 -21
  133. package/esm/svelte/FF_Hint.svelte.d.ts +0 -29
  134. package/esm/svelte/FF_Label.svelte +0 -23
  135. package/esm/svelte/FF_Label.svelte.d.ts +0 -29
@@ -1,182 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var FFAuthProvider_1;
8
- import { Fields, Relations, Validators, ValueListFieldType } from 'remult';
9
- import { BaseEnum, FF_Entity, FF_Role } from '../internals';
10
- export const FF_Role_Auth = {
11
- FF_Role_Auth_Admin: 'FF_Role_Auth.Admin',
12
- FF_Role_Auth_Invite: 'FF_Role_Auth.Invite',
13
- };
14
- let FFAuthUser = class FFAuthUser {
15
- id;
16
- createdAt;
17
- updatedAt;
18
- name;
19
- roles = [];
20
- accounts;
21
- sessions;
22
- };
23
- __decorate([
24
- Fields.id()
25
- ], FFAuthUser.prototype, "id", void 0);
26
- __decorate([
27
- Fields.createdAt({ includeInApi: [FF_Role_Auth.FF_Role_Auth_Admin, FF_Role.FF_Role_Admin] })
28
- ], FFAuthUser.prototype, "createdAt", void 0);
29
- __decorate([
30
- Fields.updatedAt({ includeInApi: [FF_Role_Auth.FF_Role_Auth_Admin, FF_Role.FF_Role_Admin] })
31
- ], FFAuthUser.prototype, "updatedAt", void 0);
32
- __decorate([
33
- Fields.string({
34
- required: true,
35
- validate: [Validators.unique(), Validators.required()],
36
- })
37
- ], FFAuthUser.prototype, "name", void 0);
38
- __decorate([
39
- Fields.json(() => [], {
40
- includeInApi: [FF_Role_Auth.FF_Role_Auth_Admin, FF_Role.FF_Role_Admin],
41
- inputType: 'selectEnum',
42
- valueConverter: {
43
- toDb: (x) => {
44
- if (x === null)
45
- return null;
46
- if (Array.isArray(x))
47
- return x.join(',');
48
- return x;
49
- },
50
- //FIXME: refacto this + remove "permissions" & add a disable user!
51
- fromDb: (x) => {
52
- return x
53
- ? x
54
- .split(',')
55
- .map((c) => c.replace('{', '').replace('}', ''))
56
- .filter((c) => c !== '')
57
- : [];
58
- },
59
- },
60
- })
61
- ], FFAuthUser.prototype, "roles", void 0);
62
- __decorate([
63
- Relations.toMany(() => FFAuthAccount, 'userId')
64
- ], FFAuthUser.prototype, "accounts", void 0);
65
- __decorate([
66
- Relations.toMany(() => FFAuthUserSession, 'userId')
67
- ], FFAuthUser.prototype, "sessions", void 0);
68
- FFAuthUser = __decorate([
69
- FF_Entity('ff_auth.users', {
70
- allowApiCrud: [FF_Role_Auth.FF_Role_Auth_Admin, FF_Role.FF_Role_Admin],
71
- caption: 'FF Auth - Users',
72
- })
73
- ], FFAuthUser);
74
- export { FFAuthUser };
75
- let FFAuthAccount = class FFAuthAccount {
76
- id;
77
- createdAt;
78
- updatedAt;
79
- userId;
80
- user;
81
- provider = FFAuthProvider.PASSWORD.id;
82
- providerUserId = '';
83
- email = null;
84
- hashPassword;
85
- token;
86
- expiresAt;
87
- lastVerifiedAt;
88
- metadata;
89
- };
90
- __decorate([
91
- Fields.id()
92
- ], FFAuthAccount.prototype, "id", void 0);
93
- __decorate([
94
- Fields.createdAt()
95
- ], FFAuthAccount.prototype, "createdAt", void 0);
96
- __decorate([
97
- Fields.updatedAt()
98
- ], FFAuthAccount.prototype, "updatedAt", void 0);
99
- __decorate([
100
- Fields.string()
101
- ], FFAuthAccount.prototype, "userId", void 0);
102
- __decorate([
103
- Relations.toOne(() => FFAuthUser, 'userId')
104
- ], FFAuthAccount.prototype, "user", void 0);
105
- __decorate([
106
- Fields.string()
107
- ], FFAuthAccount.prototype, "provider", void 0);
108
- __decorate([
109
- Fields.string()
110
- ], FFAuthAccount.prototype, "providerUserId", void 0);
111
- __decorate([
112
- Fields.string({ allowNull: true })
113
- ], FFAuthAccount.prototype, "email", void 0);
114
- __decorate([
115
- Fields.string({ includeInApi: false, allowNull: true })
116
- ], FFAuthAccount.prototype, "hashPassword", void 0);
117
- __decorate([
118
- Fields.string({ includeInApi: false, allowNull: true })
119
- ], FFAuthAccount.prototype, "token", void 0);
120
- __decorate([
121
- Fields.date({ includeInApi: false, allowNull: true })
122
- ], FFAuthAccount.prototype, "expiresAt", void 0);
123
- __decorate([
124
- Fields.date({ includeInApi: false, allowNull: true })
125
- ], FFAuthAccount.prototype, "lastVerifiedAt", void 0);
126
- __decorate([
127
- Fields.json({ includeInApi: false, allowNull: true })
128
- ], FFAuthAccount.prototype, "metadata", void 0);
129
- FFAuthAccount = __decorate([
130
- FF_Entity('ff_auth.accounts', {
131
- allowApiCrud: [FF_Role_Auth.FF_Role_Auth_Admin, FF_Role.FF_Role_Admin],
132
- caption: 'FF Auth - Accounts',
133
- changeLog: {
134
- excludeColumns: (e) => {
135
- return [e.hashPassword, e.token];
136
- },
137
- },
138
- })
139
- ], FFAuthAccount);
140
- export { FFAuthAccount };
141
- let FFAuthUserSession = class FFAuthUserSession {
142
- id;
143
- expiresAt;
144
- userId;
145
- user;
146
- };
147
- __decorate([
148
- Fields.string()
149
- ], FFAuthUserSession.prototype, "id", void 0);
150
- __decorate([
151
- Fields.date()
152
- ], FFAuthUserSession.prototype, "expiresAt", void 0);
153
- __decorate([
154
- Fields.string()
155
- ], FFAuthUserSession.prototype, "userId", void 0);
156
- __decorate([
157
- Relations.toOne(() => FFAuthUser, 'userId')
158
- ], FFAuthUserSession.prototype, "user", void 0);
159
- FFAuthUserSession = __decorate([
160
- FF_Entity('ff_auth.users_sessions', {
161
- allowApiCrud: [FF_Role_Auth.FF_Role_Auth_Admin, FF_Role.FF_Role_Admin],
162
- caption: 'FF Auth - Users sessions',
163
- changeLog: false,
164
- })
165
- ], FFAuthUserSession);
166
- export { FFAuthUserSession };
167
- let FFAuthProvider = class FFAuthProvider extends BaseEnum {
168
- static { FFAuthProvider_1 = this; }
169
- static DEMO = new FFAuthProvider_1('DEMO', { caption: 'Demo' });
170
- static PASSWORD = new FFAuthProvider_1('PASSWORD', { caption: 'Password' });
171
- static OTP = new FFAuthProvider_1('OTP', { caption: 'TOTP' });
172
- static OAUTH = new FFAuthProvider_1('OAUTH', { caption: 'OAUTH' });
173
- constructor(id, o) {
174
- super(id, {
175
- ...o,
176
- });
177
- }
178
- };
179
- FFAuthProvider = FFAuthProvider_1 = __decorate([
180
- ValueListFieldType()
181
- ], FFAuthProvider);
182
- export { FFAuthProvider };
@@ -1,3 +0,0 @@
1
- # Firstly - Module - Auth
2
-
3
- ➡️ Doc available [here](https://firstly.fun/modules/auth).
@@ -1,5 +0,0 @@
1
- import { AuthController } from './AuthController';
2
- import { FFAuthAccount, FFAuthProvider, FFAuthUser, FFAuthUserSession } from './Entities';
3
- export { FF_Role_Auth } from './Entities';
4
- export { AuthController };
5
- export { FFAuthUser, FFAuthAccount, FFAuthProvider, FFAuthUserSession };
package/esm/auth/index.js DELETED
@@ -1,5 +0,0 @@
1
- import { AuthController } from './AuthController';
2
- import { FFAuthAccount, FFAuthProvider, FFAuthUser, FFAuthUserSession } from './Entities';
3
- export { FF_Role_Auth } from './Entities';
4
- export { AuthController };
5
- export { FFAuthUser, FFAuthAccount, FFAuthProvider, FFAuthUserSession };
@@ -1,58 +0,0 @@
1
- import type { AuthResponse, ProviderConfigured } from '../types.js';
2
- export declare class AuthControllerServer {
3
- /**
4
- * Sign out the current user
5
- */
6
- static signOut(): Promise<AuthResponse>;
7
- /**
8
- * Sign in with a demo account
9
- * _(The easiest way to demo & test your application)_
10
- */
11
- static signInDemo(name: string): Promise<AuthResponse>;
12
- /**
13
- * This is for login / password authentication invite
14
- */
15
- static invite(emailParam: string): Promise<AuthResponse>;
16
- /**
17
- * This is for login / password authentication SignUp
18
- * _(The first param `email` can be "anything")_
19
- */
20
- static signUpPassword(emailParam: string, password: string): Promise<AuthResponse>;
21
- /**
22
- * This is for login / password authentication SignIn
23
- * _(The first param `email` can be "anything")_
24
- */
25
- static signInPassword(emailParam: string, password: string): Promise<AuthResponse>;
26
- /**
27
- * Forgot your password ? Send a mail to reset it.
28
- */
29
- static forgotPassword(emailParam: string): Promise<AuthResponse>;
30
- /**
31
- * Reset your password with a token
32
- */
33
- static resetPassword(token: string, password: string): Promise<AuthResponse>;
34
- /** OTP */
35
- static signInOTP(emailParam: string): Promise<AuthResponse>;
36
- /**
37
- * Verify the OTP code
38
- */
39
- static verifyOtp(emailParam: string, otp: string): Promise<AuthResponse>;
40
- /** OAUTH */
41
- /**
42
- * The the url to redirect to for the OAuth provider
43
- * @param provider Has to mach one of `AUTH_OPTIONS.providers.oAuths` your configured
44
- *
45
- * To be used like this for example:
46
- * ```
47
- * const url = await Auth.signInOAuthGetUrl('github')
48
- * window.location.href = url
49
- * ```
50
- *
51
- * _(popup example should work too, and a nice example/componant would be appreciated)_
52
- */
53
- static signInOAuthGetUrl<T extends keyof ProviderConfigured>(o: {
54
- provider: T;
55
- options?: ProviderConfigured[T];
56
- redirect?: string;
57
- }): Promise<string>;
58
- }