firstly 0.2.1 → 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.
- package/CHANGELOG.md +13 -0
- package/esm/bin/cmd.js +1 -156
- package/esm/changeLog/index.d.ts +1 -6
- package/esm/internals/BaseEnum.d.ts +1 -1
- package/esm/internals/FF_Entity.js +1 -17
- package/esm/internals/cellsBuildor.js +5 -4
- package/esm/internals/index.d.ts +2 -6
- package/esm/internals/storeItem.d.ts +12 -21
- package/esm/internals/storeItem.js +20 -6
- package/esm/svelte/FF_Repo.svelte.d.ts +9 -0
- package/esm/svelte/FF_Repo.svelte.js +39 -0
- package/esm/svelte/class/SP.svelte.js +14 -2
- package/esm/ui/Button.svelte +4 -52
- package/esm/ui/Button.svelte.d.ts +0 -2
- package/esm/ui/Field.svelte +10 -1
- package/esm/ui/Grid.svelte +2 -5
- package/esm/ui/Grid2.svelte +1 -4
- package/esm/ui/internals/select/MultiSelectMelt.svelte +4 -4
- package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +1 -1
- package/esm/ui/internals/select/SelectMelt.svelte +28 -19
- package/esm/ui/internals/select/SelectMelt.svelte.d.ts +1 -1
- package/esm/ui/internals/select/SelectRadio.svelte +1 -1
- package/esm/ui/internals/select/SelectRadio.svelte.d.ts +1 -1
- package/package.json +6 -19
- package/esm/auth/AuthController.d.ts +0 -58
- package/esm/auth/AuthController.js +0 -114
- package/esm/auth/Entities.d.ts +0 -47
- package/esm/auth/Entities.js +0 -182
- package/esm/auth/README.md +0 -3
- package/esm/auth/index.d.ts +0 -5
- package/esm/auth/index.js +0 -5
- package/esm/auth/server/AuthController.server.d.ts +0 -58
- package/esm/auth/server/AuthController.server.js +0 -518
- package/esm/auth/server/handleAuth.d.ts +0 -4
- package/esm/auth/server/handleAuth.js +0 -142
- package/esm/auth/server/handleGuard.d.ts +0 -22
- package/esm/auth/server/handleGuard.js +0 -34
- package/esm/auth/server/helperDb.d.ts +0 -10
- package/esm/auth/server/helperDb.js +0 -56
- package/esm/auth/server/helperFirstly.d.ts +0 -1
- package/esm/auth/server/helperFirstly.js +0 -9
- package/esm/auth/server/helperOslo.d.ts +0 -7
- package/esm/auth/server/helperOslo.js +0 -24
- package/esm/auth/server/helperRemultServer.d.ts +0 -5
- package/esm/auth/server/helperRemultServer.js +0 -44
- package/esm/auth/server/helperRole.d.ts +0 -19
- package/esm/auth/server/helperRole.js +0 -57
- package/esm/auth/server/index.d.ts +0 -8
- package/esm/auth/server/index.js +0 -8
- package/esm/auth/server/module.d.ts +0 -300
- package/esm/auth/server/module.js +0 -230
- package/esm/auth/server/providers/github.d.ts +0 -33
- package/esm/auth/server/providers/github.js +0 -87
- package/esm/auth/server/providers/helperProvider.d.ts +0 -1
- package/esm/auth/server/providers/helperProvider.js +0 -25
- package/esm/auth/static/assets/Page-BHW08QWz.css +0 -1
- package/esm/auth/static/assets/Page-BRNWcY5Z.d.ts +0 -2
- package/esm/auth/static/assets/Page-BRNWcY5Z.js +0 -1
- package/esm/auth/static/assets/Page-CFcEsGK8.d.ts +0 -2
- package/esm/auth/static/assets/Page-CFcEsGK8.js +0 -7
- package/esm/auth/static/assets/Page-tLVs5slF.d.ts +0 -2
- package/esm/auth/static/assets/Page-tLVs5slF.js +0 -1
- package/esm/auth/static/assets/index-D38rqu4x.d.ts +0 -201
- package/esm/auth/static/assets/index-D38rqu4x.js +0 -2
- package/esm/auth/static/assets/index-DKWpA6v7.css +0 -4
- package/esm/auth/static/favicon.svg +0 -79
- package/esm/auth/static/index.html +0 -13
- package/esm/auth/types.d.ts +0 -73
- package/esm/auth/types.js +0 -1
package/esm/auth/Entities.js
DELETED
|
@@ -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 };
|
package/esm/auth/README.md
DELETED
package/esm/auth/index.d.ts
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 };
|
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
|
-
}
|