skapi-js 1.0.43 → 1.0.45-beta.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/dist/skapi.js +1 -1
- package/dist/skapi.js.map +1 -1
- package/dist/skapi.module.js +1 -1
- package/dist/skapi.module.js.map +1 -1
- package/js/main/skapi.js +2 -2
- package/js/methods/database.js +4 -1
- package/js/methods/user.js +16 -2
- package/package.json +1 -1
package/js/main/skapi.js
CHANGED
|
@@ -23,7 +23,7 @@ export default class Skapi {
|
|
|
23
23
|
set user(value) {
|
|
24
24
|
}
|
|
25
25
|
constructor(service, owner, options, __etc) {
|
|
26
|
-
this.version = '1.0.
|
|
26
|
+
this.version = '1.0.45';
|
|
27
27
|
this.session = null;
|
|
28
28
|
this.connection = null;
|
|
29
29
|
this.host = 'skapi';
|
|
@@ -97,7 +97,7 @@ export default class Skapi {
|
|
|
97
97
|
}
|
|
98
98
|
this.service = service;
|
|
99
99
|
this.owner = owner;
|
|
100
|
-
let autoLogin = !!options
|
|
100
|
+
let autoLogin = !!options?.autoLogin;
|
|
101
101
|
this.target_cdn = __etc?.target_cdn || this.target_cdn;
|
|
102
102
|
this.hostDomain = __etc?.hostDomain || this.hostDomain;
|
|
103
103
|
const cdn_domain = `https://${this.target_cdn}.cloudfront.net`;
|
package/js/methods/database.js
CHANGED
|
@@ -718,10 +718,13 @@ export async function postRecord(form, config) {
|
|
|
718
718
|
arr.push(i.url);
|
|
719
719
|
}
|
|
720
720
|
else {
|
|
721
|
-
throw new SkapiError(`"remove_bin" should be type: <string | BinaryFile[]>`, { code: 'INVALID_PARAMETER' });
|
|
721
|
+
throw new SkapiError(`"remove_bin" should be type: <string[] | BinaryFile[]>`, { code: 'INVALID_PARAMETER' });
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
|
+
else {
|
|
726
|
+
throw new SkapiError(`"remove_bin" should be type: <string[] | BinaryFile[]>`, { code: 'INVALID_PARAMETER' });
|
|
727
|
+
}
|
|
725
728
|
return arr;
|
|
726
729
|
}
|
|
727
730
|
}, [], ['response', 'onerror', 'progress'], null);
|
package/js/methods/user.js
CHANGED
|
@@ -441,7 +441,14 @@ export async function signup(form, option) {
|
|
|
441
441
|
birthdate_public: ['boolean', () => false],
|
|
442
442
|
phone_number_public: ['boolean', () => false],
|
|
443
443
|
access_group: 'number',
|
|
444
|
-
misc: 'string'
|
|
444
|
+
misc: 'string',
|
|
445
|
+
picture: (v) => validator.Url(v),
|
|
446
|
+
profile: (v) => validator.Url(v),
|
|
447
|
+
family_name: 'string',
|
|
448
|
+
given_name: 'string',
|
|
449
|
+
middle_name: 'string',
|
|
450
|
+
nickname: 'string',
|
|
451
|
+
website: (v) => validator.Url(v),
|
|
445
452
|
}, is_admin ? ['email'] : ['email', 'password']);
|
|
446
453
|
let admin_creating_account = is_admin && params.service && this.service !== params.service;
|
|
447
454
|
if (admin_creating_account) {
|
|
@@ -681,7 +688,14 @@ export async function updateProfile(form) {
|
|
|
681
688
|
address_public: 'boolean',
|
|
682
689
|
gender_public: 'boolean',
|
|
683
690
|
birthdate_public: 'boolean',
|
|
684
|
-
misc: 'string'
|
|
691
|
+
misc: 'string',
|
|
692
|
+
picture: (v) => validator.Url(v),
|
|
693
|
+
profile: (v) => validator.Url(v),
|
|
694
|
+
family_name: 'string',
|
|
695
|
+
given_name: 'string',
|
|
696
|
+
middle_name: 'string',
|
|
697
|
+
nickname: 'string',
|
|
698
|
+
website: (v) => validator.Url(v),
|
|
685
699
|
});
|
|
686
700
|
if (params && typeof params === 'object' && !Object.keys(params).length) {
|
|
687
701
|
return this.user;
|