@keycloakify/svelte 0.1.3 → 0.1.5
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/keycloakify-svelte/bin/200.index.js +1 -1
- package/keycloakify-svelte/bin/266.index.js +1 -1
- package/keycloakify-svelte/bin/279.index.js +194 -48
- package/keycloakify-svelte/bin/709.index.js +1 -1
- package/keycloakify-svelte/bin/818.index.js +1 -1
- package/keycloakify-svelte/login/DefaultPage.svelte.d.ts +4 -4
- package/keycloakify-svelte/login/components/AddRemoveButtonsMultiValuedAttribute.svelte.d.ts +4 -3
- package/keycloakify-svelte/login/components/FieldErrors.svelte.d.ts +3 -3
- package/keycloakify-svelte/login/components/GroupLabel.svelte.d.ts +4 -4
- package/keycloakify-svelte/login/components/InputTag.svelte.d.ts +1 -1
- package/keycloakify-svelte/login/components/LogoutOtherSessions.svelte.d.ts +3 -3
- package/keycloakify-svelte/login/components/PasswordWrapper.svelte.d.ts +4 -4
- package/keycloakify-svelte/login/components/TermsAcceptance.svelte.d.ts +4 -3
- package/keycloakify-svelte/login/pages/IdpReviewUserProfile.svelte.d.ts +5 -2
- package/keycloakify-svelte/login/pages/LoginUpdateProfile.svelte.d.ts +5 -2
- package/keycloakify-svelte/login/pages/Register.svelte.d.ts +5 -2
- package/keycloakify-svelte/login/pages/UpdateEmail.svelte.d.ts +5 -2
- package/package.json +26 -24
- package/src/bin/add-story.ts +117 -0
- package/src/bin/core.ts +10 -0
- package/src/bin/eject-page.ts +233 -0
- package/src/bin/initialize-account-theme/boilerplate/KcContext.ts +11 -0
- package/src/bin/initialize-account-theme/boilerplate/KcPage.svelte +28 -0
- package/src/bin/initialize-account-theme/boilerplate/KcPageStory.svelte +9 -0
- package/src/bin/initialize-account-theme/boilerplate/KcPageStory.ts +22 -0
- package/src/bin/initialize-account-theme/boilerplate/i18n.ts +9 -0
- package/src/bin/initialize-account-theme/index.ts +1 -0
- package/src/bin/initialize-account-theme/initialize-account-theme.ts +87 -0
- package/src/bin/initialize-account-theme/updateAccountThemeImplementationInConfig.ts +93 -0
- package/src/bin/main.ts +43 -0
- package/src/bin/tools/SemVer.ts +107 -0
- package/src/bin/tools/String.prototype.replaceAll.ts +31 -0
- package/src/bin/tools/crawl.ts +32 -0
- package/src/bin/tools/fs.rmSync.ts +34 -0
- package/src/bin/tools/getThisCodebaseRootDirPath.ts +22 -0
- package/src/bin/tools/kebabCaseToSnakeCase.ts +7 -0
- package/src/bin/tools/nodeModulesBinDirPath.ts +38 -0
- package/src/bin/tools/readThisNpmPackageVersion.ts +22 -0
- package/src/bin/tools/runPrettier.ts +118 -0
- package/src/bin/tools/transformCodebase.ts +81 -0
- package/src/bin/tools/transformCodebase_async.ts +82 -0
- package/src/bin/tsconfig.json +23 -0
- package/src/bin/update-kc-gen.ts +153 -0
- package/src/tools/useConst.ts +4 -0
- package/src/tools/useInsertLinkTags.ts +81 -0
- package/src/tools/useInsertScriptTags.ts +110 -0
- package/src/tools/useReducer.ts +11 -0
- package/src/tools/useSetClassName.ts +18 -0
- package/src/tools/useState.ts +8 -0
- package/stories/login/KcPage.svelte +10 -10
|
@@ -19,7 +19,7 @@ export const modules = {
|
|
|
19
19
|
|
|
20
20
|
const __dirname = path__WEBPACK_IMPORTED_MODULE_1__.dirname(url__WEBPACK_IMPORTED_MODULE_2__.fileURLToPath(import.meta.url));
|
|
21
21
|
function getThisCodebaseRootDirPath_rec(dirPath) {
|
|
22
|
-
if (
|
|
22
|
+
if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(path__WEBPACK_IMPORTED_MODULE_1__.join(dirPath, 'LICENSE'))) {
|
|
23
23
|
return dirPath;
|
|
24
24
|
}
|
|
25
25
|
return getThisCodebaseRootDirPath_rec(path__WEBPACK_IMPORTED_MODULE_1__.join(dirPath, '..'));
|
|
@@ -695,7 +695,7 @@ async function command(params) {
|
|
|
695
695
|
|
|
696
696
|
const __dirname = path__WEBPACK_IMPORTED_MODULE_1__.dirname(url__WEBPACK_IMPORTED_MODULE_2__.fileURLToPath(import.meta.url));
|
|
697
697
|
function getThisCodebaseRootDirPath_rec(dirPath) {
|
|
698
|
-
if (
|
|
698
|
+
if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(path__WEBPACK_IMPORTED_MODULE_1__.join(dirPath, 'LICENSE'))) {
|
|
699
699
|
return dirPath;
|
|
700
700
|
}
|
|
701
701
|
return getThisCodebaseRootDirPath_rec(path__WEBPACK_IMPORTED_MODULE_1__.join(dirPath, '..'));
|
|
@@ -217,6 +217,9 @@ const quotelessJson = (obj) => {
|
|
|
217
217
|
return json.replace(/"([^"]+)":/g, "$1:");
|
|
218
218
|
};
|
|
219
219
|
class ZodError extends Error {
|
|
220
|
+
get errors() {
|
|
221
|
+
return this.issues;
|
|
222
|
+
}
|
|
220
223
|
constructor(issues) {
|
|
221
224
|
super();
|
|
222
225
|
this.issues = [];
|
|
@@ -237,9 +240,6 @@ class ZodError extends Error {
|
|
|
237
240
|
this.name = "ZodError";
|
|
238
241
|
this.issues = issues;
|
|
239
242
|
}
|
|
240
|
-
get errors() {
|
|
241
|
-
return this.issues;
|
|
242
|
-
}
|
|
243
243
|
format(_mapper) {
|
|
244
244
|
const mapper = _mapper ||
|
|
245
245
|
function (issue) {
|
|
@@ -495,9 +495,9 @@ function addIssueToContext(ctx, issueData) {
|
|
|
495
495
|
data: ctx.data,
|
|
496
496
|
path: ctx.path,
|
|
497
497
|
errorMaps: [
|
|
498
|
-
ctx.common.contextualErrorMap,
|
|
499
|
-
ctx.schemaErrorMap,
|
|
500
|
-
overrideMap,
|
|
498
|
+
ctx.common.contextualErrorMap, // contextual error map is first priority
|
|
499
|
+
ctx.schemaErrorMap, // then schema-bound map if available
|
|
500
|
+
overrideMap, // then global override map
|
|
501
501
|
overrideMap === errorMap ? undefined : errorMap, // then global default map
|
|
502
502
|
].filter((x) => !!x),
|
|
503
503
|
});
|
|
@@ -673,35 +673,6 @@ function processCreateParams(params) {
|
|
|
673
673
|
return { errorMap: customMap, description };
|
|
674
674
|
}
|
|
675
675
|
class ZodType {
|
|
676
|
-
constructor(def) {
|
|
677
|
-
/** Alias of safeParseAsync */
|
|
678
|
-
this.spa = this.safeParseAsync;
|
|
679
|
-
this._def = def;
|
|
680
|
-
this.parse = this.parse.bind(this);
|
|
681
|
-
this.safeParse = this.safeParse.bind(this);
|
|
682
|
-
this.parseAsync = this.parseAsync.bind(this);
|
|
683
|
-
this.safeParseAsync = this.safeParseAsync.bind(this);
|
|
684
|
-
this.spa = this.spa.bind(this);
|
|
685
|
-
this.refine = this.refine.bind(this);
|
|
686
|
-
this.refinement = this.refinement.bind(this);
|
|
687
|
-
this.superRefine = this.superRefine.bind(this);
|
|
688
|
-
this.optional = this.optional.bind(this);
|
|
689
|
-
this.nullable = this.nullable.bind(this);
|
|
690
|
-
this.nullish = this.nullish.bind(this);
|
|
691
|
-
this.array = this.array.bind(this);
|
|
692
|
-
this.promise = this.promise.bind(this);
|
|
693
|
-
this.or = this.or.bind(this);
|
|
694
|
-
this.and = this.and.bind(this);
|
|
695
|
-
this.transform = this.transform.bind(this);
|
|
696
|
-
this.brand = this.brand.bind(this);
|
|
697
|
-
this.default = this.default.bind(this);
|
|
698
|
-
this.catch = this.catch.bind(this);
|
|
699
|
-
this.describe = this.describe.bind(this);
|
|
700
|
-
this.pipe = this.pipe.bind(this);
|
|
701
|
-
this.readonly = this.readonly.bind(this);
|
|
702
|
-
this.isNullable = this.isNullable.bind(this);
|
|
703
|
-
this.isOptional = this.isOptional.bind(this);
|
|
704
|
-
}
|
|
705
676
|
get description() {
|
|
706
677
|
return this._def.description;
|
|
707
678
|
}
|
|
@@ -765,6 +736,48 @@ class ZodType {
|
|
|
765
736
|
const result = this._parseSync({ data, path: ctx.path, parent: ctx });
|
|
766
737
|
return handleResult(ctx, result);
|
|
767
738
|
}
|
|
739
|
+
"~validate"(data) {
|
|
740
|
+
var _a, _b;
|
|
741
|
+
const ctx = {
|
|
742
|
+
common: {
|
|
743
|
+
issues: [],
|
|
744
|
+
async: !!this["~standard"].async,
|
|
745
|
+
},
|
|
746
|
+
path: [],
|
|
747
|
+
schemaErrorMap: this._def.errorMap,
|
|
748
|
+
parent: null,
|
|
749
|
+
data,
|
|
750
|
+
parsedType: getParsedType(data),
|
|
751
|
+
};
|
|
752
|
+
if (!this["~standard"].async) {
|
|
753
|
+
try {
|
|
754
|
+
const result = this._parseSync({ data, path: [], parent: ctx });
|
|
755
|
+
return isValid(result)
|
|
756
|
+
? {
|
|
757
|
+
value: result.value,
|
|
758
|
+
}
|
|
759
|
+
: {
|
|
760
|
+
issues: ctx.common.issues,
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
catch (err) {
|
|
764
|
+
if ((_b = (_a = err === null || err === void 0 ? void 0 : err.message) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes("encountered")) {
|
|
765
|
+
this["~standard"].async = true;
|
|
766
|
+
}
|
|
767
|
+
ctx.common = {
|
|
768
|
+
issues: [],
|
|
769
|
+
async: true,
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result)
|
|
774
|
+
? {
|
|
775
|
+
value: result.value,
|
|
776
|
+
}
|
|
777
|
+
: {
|
|
778
|
+
issues: ctx.common.issues,
|
|
779
|
+
});
|
|
780
|
+
}
|
|
768
781
|
async parseAsync(data, params) {
|
|
769
782
|
const result = await this.safeParseAsync(data, params);
|
|
770
783
|
if (result.success)
|
|
@@ -851,6 +864,40 @@ class ZodType {
|
|
|
851
864
|
superRefine(refinement) {
|
|
852
865
|
return this._refinement(refinement);
|
|
853
866
|
}
|
|
867
|
+
constructor(def) {
|
|
868
|
+
/** Alias of safeParseAsync */
|
|
869
|
+
this.spa = this.safeParseAsync;
|
|
870
|
+
this._def = def;
|
|
871
|
+
this.parse = this.parse.bind(this);
|
|
872
|
+
this.safeParse = this.safeParse.bind(this);
|
|
873
|
+
this.parseAsync = this.parseAsync.bind(this);
|
|
874
|
+
this.safeParseAsync = this.safeParseAsync.bind(this);
|
|
875
|
+
this.spa = this.spa.bind(this);
|
|
876
|
+
this.refine = this.refine.bind(this);
|
|
877
|
+
this.refinement = this.refinement.bind(this);
|
|
878
|
+
this.superRefine = this.superRefine.bind(this);
|
|
879
|
+
this.optional = this.optional.bind(this);
|
|
880
|
+
this.nullable = this.nullable.bind(this);
|
|
881
|
+
this.nullish = this.nullish.bind(this);
|
|
882
|
+
this.array = this.array.bind(this);
|
|
883
|
+
this.promise = this.promise.bind(this);
|
|
884
|
+
this.or = this.or.bind(this);
|
|
885
|
+
this.and = this.and.bind(this);
|
|
886
|
+
this.transform = this.transform.bind(this);
|
|
887
|
+
this.brand = this.brand.bind(this);
|
|
888
|
+
this.default = this.default.bind(this);
|
|
889
|
+
this.catch = this.catch.bind(this);
|
|
890
|
+
this.describe = this.describe.bind(this);
|
|
891
|
+
this.pipe = this.pipe.bind(this);
|
|
892
|
+
this.readonly = this.readonly.bind(this);
|
|
893
|
+
this.isNullable = this.isNullable.bind(this);
|
|
894
|
+
this.isOptional = this.isOptional.bind(this);
|
|
895
|
+
this["~standard"] = {
|
|
896
|
+
version: 1,
|
|
897
|
+
vendor: "zod",
|
|
898
|
+
validate: (data) => this["~validate"](data),
|
|
899
|
+
};
|
|
900
|
+
}
|
|
854
901
|
optional() {
|
|
855
902
|
return ZodOptional.create(this, this._def);
|
|
856
903
|
}
|
|
@@ -861,7 +908,7 @@ class ZodType {
|
|
|
861
908
|
return this.nullable().optional();
|
|
862
909
|
}
|
|
863
910
|
array() {
|
|
864
|
-
return ZodArray.create(this
|
|
911
|
+
return ZodArray.create(this);
|
|
865
912
|
}
|
|
866
913
|
promise() {
|
|
867
914
|
return ZodPromise.create(this, this._def);
|
|
@@ -927,11 +974,12 @@ class ZodType {
|
|
|
927
974
|
}
|
|
928
975
|
const cuidRegex = /^c[^\s-]{8,}$/i;
|
|
929
976
|
const cuid2Regex = /^[0-9a-z]+$/;
|
|
930
|
-
const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}
|
|
977
|
+
const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
|
|
931
978
|
// const uuidRegex =
|
|
932
979
|
// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
933
980
|
const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
|
|
934
981
|
const nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
|
982
|
+
const jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
|
|
935
983
|
const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
936
984
|
// from https://stackoverflow.com/a/46181/1550155
|
|
937
985
|
// old version: too slow, didn't support unicode
|
|
@@ -953,9 +1001,15 @@ const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
|
953
1001
|
let emojiRegex;
|
|
954
1002
|
// faster, simpler, safer
|
|
955
1003
|
const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
956
|
-
const
|
|
1004
|
+
const ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
|
|
1005
|
+
// const ipv6Regex =
|
|
1006
|
+
// /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
|
|
1007
|
+
const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
|
|
1008
|
+
const ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
957
1009
|
// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
|
|
958
1010
|
const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
1011
|
+
// https://base64.guru/standards/base64url
|
|
1012
|
+
const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
|
|
959
1013
|
// simple
|
|
960
1014
|
// const dateRegexSource = `\\d{4}-\\d{2}-\\d{2}`;
|
|
961
1015
|
// no leap year validation
|
|
@@ -996,6 +1050,38 @@ function isValidIP(ip, version) {
|
|
|
996
1050
|
}
|
|
997
1051
|
return false;
|
|
998
1052
|
}
|
|
1053
|
+
function isValidJWT(jwt, alg) {
|
|
1054
|
+
if (!jwtRegex.test(jwt))
|
|
1055
|
+
return false;
|
|
1056
|
+
try {
|
|
1057
|
+
const [header] = jwt.split(".");
|
|
1058
|
+
// Convert base64url to base64
|
|
1059
|
+
const base64 = header
|
|
1060
|
+
.replace(/-/g, "+")
|
|
1061
|
+
.replace(/_/g, "/")
|
|
1062
|
+
.padEnd(header.length + ((4 - (header.length % 4)) % 4), "=");
|
|
1063
|
+
const decoded = JSON.parse(atob(base64));
|
|
1064
|
+
if (typeof decoded !== "object" || decoded === null)
|
|
1065
|
+
return false;
|
|
1066
|
+
if (!decoded.typ || !decoded.alg)
|
|
1067
|
+
return false;
|
|
1068
|
+
if (alg && decoded.alg !== alg)
|
|
1069
|
+
return false;
|
|
1070
|
+
return true;
|
|
1071
|
+
}
|
|
1072
|
+
catch (_a) {
|
|
1073
|
+
return false;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
function isValidCidr(ip, version) {
|
|
1077
|
+
if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
|
|
1078
|
+
return true;
|
|
1079
|
+
}
|
|
1080
|
+
if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
|
|
1081
|
+
return true;
|
|
1082
|
+
}
|
|
1083
|
+
return false;
|
|
1084
|
+
}
|
|
999
1085
|
class ZodString extends ZodType {
|
|
1000
1086
|
_parse(input) {
|
|
1001
1087
|
if (this._def.coerce) {
|
|
@@ -1277,6 +1363,28 @@ class ZodString extends ZodType {
|
|
|
1277
1363
|
status.dirty();
|
|
1278
1364
|
}
|
|
1279
1365
|
}
|
|
1366
|
+
else if (check.kind === "jwt") {
|
|
1367
|
+
if (!isValidJWT(input.data, check.alg)) {
|
|
1368
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
1369
|
+
addIssueToContext(ctx, {
|
|
1370
|
+
validation: "jwt",
|
|
1371
|
+
code: ZodIssueCode.invalid_string,
|
|
1372
|
+
message: check.message,
|
|
1373
|
+
});
|
|
1374
|
+
status.dirty();
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
else if (check.kind === "cidr") {
|
|
1378
|
+
if (!isValidCidr(input.data, check.version)) {
|
|
1379
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
1380
|
+
addIssueToContext(ctx, {
|
|
1381
|
+
validation: "cidr",
|
|
1382
|
+
code: ZodIssueCode.invalid_string,
|
|
1383
|
+
message: check.message,
|
|
1384
|
+
});
|
|
1385
|
+
status.dirty();
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1280
1388
|
else if (check.kind === "base64") {
|
|
1281
1389
|
if (!base64Regex.test(input.data)) {
|
|
1282
1390
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
@@ -1288,6 +1396,17 @@ class ZodString extends ZodType {
|
|
|
1288
1396
|
status.dirty();
|
|
1289
1397
|
}
|
|
1290
1398
|
}
|
|
1399
|
+
else if (check.kind === "base64url") {
|
|
1400
|
+
if (!base64urlRegex.test(input.data)) {
|
|
1401
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
1402
|
+
addIssueToContext(ctx, {
|
|
1403
|
+
validation: "base64url",
|
|
1404
|
+
code: ZodIssueCode.invalid_string,
|
|
1405
|
+
message: check.message,
|
|
1406
|
+
});
|
|
1407
|
+
status.dirty();
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1291
1410
|
else {
|
|
1292
1411
|
util.assertNever(check);
|
|
1293
1412
|
}
|
|
@@ -1334,9 +1453,22 @@ class ZodString extends ZodType {
|
|
|
1334
1453
|
base64(message) {
|
|
1335
1454
|
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
|
|
1336
1455
|
}
|
|
1456
|
+
base64url(message) {
|
|
1457
|
+
// base64url encoding is a modification of base64 that can safely be used in URLs and filenames
|
|
1458
|
+
return this._addCheck({
|
|
1459
|
+
kind: "base64url",
|
|
1460
|
+
...errorUtil.errToObj(message),
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1463
|
+
jwt(options) {
|
|
1464
|
+
return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
|
|
1465
|
+
}
|
|
1337
1466
|
ip(options) {
|
|
1338
1467
|
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
|
1339
1468
|
}
|
|
1469
|
+
cidr(options) {
|
|
1470
|
+
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
1471
|
+
}
|
|
1340
1472
|
datetime(options) {
|
|
1341
1473
|
var _a, _b;
|
|
1342
1474
|
if (typeof options === "string") {
|
|
@@ -1427,8 +1559,7 @@ class ZodString extends ZodType {
|
|
|
1427
1559
|
});
|
|
1428
1560
|
}
|
|
1429
1561
|
/**
|
|
1430
|
-
*
|
|
1431
|
-
* @see {@link ZodString.min}
|
|
1562
|
+
* Equivalent to `.min(1)`
|
|
1432
1563
|
*/
|
|
1433
1564
|
nonempty(message) {
|
|
1434
1565
|
return this.min(1, errorUtil.errToObj(message));
|
|
@@ -1490,9 +1621,16 @@ class ZodString extends ZodType {
|
|
|
1490
1621
|
get isIP() {
|
|
1491
1622
|
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
|
1492
1623
|
}
|
|
1624
|
+
get isCIDR() {
|
|
1625
|
+
return !!this._def.checks.find((ch) => ch.kind === "cidr");
|
|
1626
|
+
}
|
|
1493
1627
|
get isBase64() {
|
|
1494
1628
|
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
|
1495
1629
|
}
|
|
1630
|
+
get isBase64url() {
|
|
1631
|
+
// base64url encoding is a modification of base64 that can safely be used in URLs and filenames
|
|
1632
|
+
return !!this._def.checks.find((ch) => ch.kind === "base64url");
|
|
1633
|
+
}
|
|
1496
1634
|
get minLength() {
|
|
1497
1635
|
let min = null;
|
|
1498
1636
|
for (const ch of this._def.checks) {
|
|
@@ -1785,17 +1923,16 @@ class ZodBigInt extends ZodType {
|
|
|
1785
1923
|
}
|
|
1786
1924
|
_parse(input) {
|
|
1787
1925
|
if (this._def.coerce) {
|
|
1788
|
-
|
|
1926
|
+
try {
|
|
1927
|
+
input.data = BigInt(input.data);
|
|
1928
|
+
}
|
|
1929
|
+
catch (_a) {
|
|
1930
|
+
return this._getInvalidInput(input);
|
|
1931
|
+
}
|
|
1789
1932
|
}
|
|
1790
1933
|
const parsedType = this._getType(input);
|
|
1791
1934
|
if (parsedType !== ZodParsedType.bigint) {
|
|
1792
|
-
|
|
1793
|
-
addIssueToContext(ctx, {
|
|
1794
|
-
code: ZodIssueCode.invalid_type,
|
|
1795
|
-
expected: ZodParsedType.bigint,
|
|
1796
|
-
received: ctx.parsedType,
|
|
1797
|
-
});
|
|
1798
|
-
return INVALID;
|
|
1935
|
+
return this._getInvalidInput(input);
|
|
1799
1936
|
}
|
|
1800
1937
|
let ctx = undefined;
|
|
1801
1938
|
const status = new ParseStatus();
|
|
@@ -1849,6 +1986,15 @@ class ZodBigInt extends ZodType {
|
|
|
1849
1986
|
}
|
|
1850
1987
|
return { status: status.value, value: input.data };
|
|
1851
1988
|
}
|
|
1989
|
+
_getInvalidInput(input) {
|
|
1990
|
+
const ctx = this._getOrReturnCtx(input);
|
|
1991
|
+
addIssueToContext(ctx, {
|
|
1992
|
+
code: ZodIssueCode.invalid_type,
|
|
1993
|
+
expected: ZodParsedType.bigint,
|
|
1994
|
+
received: ctx.parsedType,
|
|
1995
|
+
});
|
|
1996
|
+
return INVALID;
|
|
1997
|
+
}
|
|
1852
1998
|
gte(value, message) {
|
|
1853
1999
|
return this.setLimit("min", value, true, errorUtil.toString(message));
|
|
1854
2000
|
}
|
|
@@ -160,7 +160,7 @@ async function command(params) {
|
|
|
160
160
|
|
|
161
161
|
const __dirname = path__WEBPACK_IMPORTED_MODULE_1__.dirname(url__WEBPACK_IMPORTED_MODULE_2__.fileURLToPath(import.meta.url));
|
|
162
162
|
function getThisCodebaseRootDirPath_rec(dirPath) {
|
|
163
|
-
if (
|
|
163
|
+
if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(path__WEBPACK_IMPORTED_MODULE_1__.join(dirPath, 'LICENSE'))) {
|
|
164
164
|
return dirPath;
|
|
165
165
|
}
|
|
166
166
|
return getThisCodebaseRootDirPath_rec(path__WEBPACK_IMPORTED_MODULE_1__.join(dirPath, '..'));
|
|
@@ -776,7 +776,7 @@ async function command(params) {
|
|
|
776
776
|
|
|
777
777
|
const __dirname = path__WEBPACK_IMPORTED_MODULE_1__.dirname(url__WEBPACK_IMPORTED_MODULE_2__.fileURLToPath(import.meta.url));
|
|
778
778
|
function getThisCodebaseRootDirPath_rec(dirPath) {
|
|
779
|
-
if (
|
|
779
|
+
if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(path__WEBPACK_IMPORTED_MODULE_1__.join(dirPath, 'LICENSE'))) {
|
|
780
780
|
return dirPath;
|
|
781
781
|
}
|
|
782
782
|
return getThisCodebaseRootDirPath_rec(path__WEBPACK_IMPORTED_MODULE_1__.join(dirPath, '..'));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
type DefaultPageProps = PageProps<KcContext, I18n> & {
|
|
2
|
-
UserProfileFormFields: Component<UserProfileFormFieldsProps>;
|
|
3
|
-
doMakeUserConfirmPassword: boolean;
|
|
4
|
-
};
|
|
5
1
|
import type { UserProfileFormFieldsProps } from './components/UserProfileFormFieldsProps';
|
|
6
2
|
import type { PageProps } from './pages/PageProps';
|
|
7
3
|
import type { Component } from 'svelte';
|
|
8
4
|
import type { I18n } from './i18n';
|
|
9
5
|
import type { KcContext } from './KcContext';
|
|
6
|
+
type DefaultPageProps = PageProps<KcContext, I18n> & {
|
|
7
|
+
UserProfileFormFields: Component<UserProfileFormFieldsProps>;
|
|
8
|
+
doMakeUserConfirmPassword: boolean;
|
|
9
|
+
};
|
|
10
10
|
declare const DefaultPage: Component<DefaultPageProps, {}, "">;
|
|
11
11
|
type DefaultPage = ReturnType<typeof DefaultPage>;
|
|
12
12
|
export default DefaultPage;
|
package/keycloakify-svelte/login/components/AddRemoveButtonsMultiValuedAttribute.svelte.d.ts
CHANGED
|
@@ -3,16 +3,17 @@ import type { Attribute } from 'keycloakify/login/KcContext';
|
|
|
3
3
|
import type { EventDispatcher } from 'svelte';
|
|
4
4
|
import type { Readable } from 'svelte/store';
|
|
5
5
|
import type { I18n } from '../i18n';
|
|
6
|
-
|
|
6
|
+
type AddRemoveButtonsMultiValuedAttributeProps = {
|
|
7
7
|
attribute: Attribute;
|
|
8
8
|
values: string[];
|
|
9
9
|
fieldIndex: number;
|
|
10
10
|
dispatchFormAction: EventDispatcher<{
|
|
11
11
|
formAction: Extract<FormAction, {
|
|
12
|
-
action:
|
|
12
|
+
action: 'update';
|
|
13
13
|
}>;
|
|
14
14
|
}>;
|
|
15
15
|
i18n: Readable<I18n>;
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
|
+
declare const AddRemoveButtonsMultiValuedAttribute: import("svelte").Component<AddRemoveButtonsMultiValuedAttributeProps, {}, "">;
|
|
17
18
|
type AddRemoveButtonsMultiValuedAttribute = ReturnType<typeof AddRemoveButtonsMultiValuedAttribute>;
|
|
18
19
|
export default AddRemoveButtonsMultiValuedAttribute;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { FormFieldError } from '../lib/useUserProfileForm';
|
|
2
|
+
import type { Attribute } from 'keycloakify/login/KcContext';
|
|
3
|
+
import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
|
|
1
4
|
type FieldErrorProps = {
|
|
2
5
|
attribute: Attribute;
|
|
3
6
|
displayableErrors: FormFieldError[];
|
|
4
7
|
fieldIndex?: number;
|
|
5
8
|
kcClsx: KcClsx;
|
|
6
9
|
};
|
|
7
|
-
import type { FormFieldError } from '../lib/useUserProfileForm';
|
|
8
|
-
import type { Attribute } from 'keycloakify/login/KcContext';
|
|
9
|
-
import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
|
|
10
10
|
declare const FieldErrors: import("svelte").Component<FieldErrorProps, {}, "displayableErrors">;
|
|
11
11
|
type FieldErrors = ReturnType<typeof FieldErrors>;
|
|
12
12
|
export default FieldErrors;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { Attribute } from 'keycloakify/login/KcContext';
|
|
2
|
+
import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
|
|
3
|
+
import type { I18n } from '../i18n';
|
|
4
|
+
import type { Readable } from 'svelte/store';
|
|
1
5
|
type GroupLabelProps = {
|
|
2
6
|
attribute: Attribute;
|
|
3
7
|
groupNameRef: {
|
|
@@ -6,10 +10,6 @@ type GroupLabelProps = {
|
|
|
6
10
|
i18n: Readable<I18n>;
|
|
7
11
|
kcClsx: KcClsx;
|
|
8
12
|
};
|
|
9
|
-
import type { Attribute } from 'keycloakify/login/KcContext';
|
|
10
|
-
import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
|
|
11
|
-
import type { I18n } from '../i18n';
|
|
12
|
-
import type { Readable } from 'svelte/store';
|
|
13
13
|
declare const GroupLabel: import("svelte").Component<GroupLabelProps, {}, "">;
|
|
14
14
|
type GroupLabel = ReturnType<typeof GroupLabel>;
|
|
15
15
|
export default GroupLabel;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
|
|
1
2
|
type InputTagProps = InputFieldByTypeProps & {
|
|
2
3
|
fieldIndex?: number;
|
|
3
4
|
};
|
|
4
|
-
import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
|
|
5
5
|
declare const InputTag: import("svelte").Component<InputTagProps, {}, "displayableErrors">;
|
|
6
6
|
type InputTag = ReturnType<typeof InputTag>;
|
|
7
7
|
export default InputTag;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
|
|
2
|
+
import type { I18n } from '../i18n';
|
|
3
|
+
import type { Readable } from 'svelte/store';
|
|
1
4
|
type $$ComponentProps = {
|
|
2
5
|
kcClsx: KcClsx;
|
|
3
6
|
i18n: Readable<I18n>;
|
|
4
7
|
};
|
|
5
|
-
import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
|
|
6
|
-
import type { I18n } from '../i18n';
|
|
7
|
-
import type { Readable } from 'svelte/store';
|
|
8
8
|
declare const LogoutOtherSessions: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
9
|
type LogoutOtherSessions = ReturnType<typeof LogoutOtherSessions>;
|
|
10
10
|
export default LogoutOtherSessions;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
|
|
2
|
+
import { type Snippet } from 'svelte';
|
|
3
|
+
import type { I18n } from '../i18n';
|
|
4
|
+
import type { Readable } from 'svelte/store';
|
|
1
5
|
type $$ComponentProps = {
|
|
2
6
|
kcClsx: KcClsx;
|
|
3
7
|
i18n: Readable<I18n>;
|
|
4
8
|
passwordInputId: string;
|
|
5
9
|
children: Snippet;
|
|
6
10
|
};
|
|
7
|
-
import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
|
|
8
|
-
import { type Snippet } from 'svelte';
|
|
9
|
-
import type { I18n } from '../i18n';
|
|
10
|
-
import type { Readable } from 'svelte/store';
|
|
11
11
|
declare const PasswordWrapper: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
12
12
|
type PasswordWrapper = ReturnType<typeof PasswordWrapper>;
|
|
13
13
|
export default PasswordWrapper;
|
|
@@ -2,12 +2,13 @@ import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
|
|
|
2
2
|
import type { KcContext } from '../KcContext';
|
|
3
3
|
import type { I18n } from '../i18n';
|
|
4
4
|
import type { Readable } from 'svelte/store';
|
|
5
|
-
|
|
5
|
+
type TermsAcceptanceProps = {
|
|
6
6
|
i18n: Readable<I18n>;
|
|
7
7
|
kcClsx: KcClsx;
|
|
8
|
-
messagesPerField: Pick<KcContext[
|
|
8
|
+
messagesPerField: Pick<KcContext['messagesPerField'], 'existsError' | 'get'>;
|
|
9
9
|
areTermsAccepted: boolean;
|
|
10
10
|
onAreTermsAcceptedValueChange: (areTermsAccepted: boolean) => void;
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
|
+
declare const TermsAcceptance: import("svelte").Component<TermsAcceptanceProps, {}, "">;
|
|
12
13
|
type TermsAcceptance = ReturnType<typeof TermsAcceptance>;
|
|
13
14
|
export default TermsAcceptance;
|
|
@@ -3,9 +3,12 @@ import type { PageProps } from './PageProps';
|
|
|
3
3
|
import type { Component } from 'svelte';
|
|
4
4
|
import type { KcContext } from '../KcContext';
|
|
5
5
|
import type { I18n } from '../i18n';
|
|
6
|
-
|
|
6
|
+
type IdpReviewUserProfileProps = PageProps<Extract<KcContext, {
|
|
7
|
+
pageId: 'idp-review-user-profile.ftl';
|
|
8
|
+
}>, I18n> & {
|
|
7
9
|
UserProfileFormFields: Component<UserProfileFormFieldsProps>;
|
|
8
10
|
doMakeUserConfirmPassword: boolean;
|
|
9
|
-
}
|
|
11
|
+
};
|
|
12
|
+
declare const IdpReviewUserProfile: Component<IdpReviewUserProfileProps, {}, "">;
|
|
10
13
|
type IdpReviewUserProfile = ReturnType<typeof IdpReviewUserProfile>;
|
|
11
14
|
export default IdpReviewUserProfile;
|
|
@@ -3,9 +3,12 @@ import type { PageProps } from './PageProps';
|
|
|
3
3
|
import type { Component } from 'svelte';
|
|
4
4
|
import type { I18n } from '../i18n';
|
|
5
5
|
import type { KcContext } from '../KcContext';
|
|
6
|
-
|
|
6
|
+
type LoginUpdateProfileProps = PageProps<Extract<KcContext, {
|
|
7
|
+
pageId: 'login-update-profile.ftl';
|
|
8
|
+
}>, I18n> & {
|
|
7
9
|
UserProfileFormFields: Component<UserProfileFormFieldsProps>;
|
|
8
10
|
doMakeUserConfirmPassword: boolean;
|
|
9
|
-
}
|
|
11
|
+
};
|
|
12
|
+
declare const LoginUpdateProfile: Component<LoginUpdateProfileProps, {}, "">;
|
|
10
13
|
type LoginUpdateProfile = ReturnType<typeof LoginUpdateProfile>;
|
|
11
14
|
export default LoginUpdateProfile;
|
|
@@ -3,9 +3,12 @@ import type { PageProps } from './PageProps';
|
|
|
3
3
|
import type { Component } from 'svelte';
|
|
4
4
|
import type { I18n } from '../i18n';
|
|
5
5
|
import type { KcContext } from '../KcContext';
|
|
6
|
-
|
|
6
|
+
type RegisterProps = PageProps<Extract<KcContext, {
|
|
7
|
+
pageId: 'register.ftl';
|
|
8
|
+
}>, I18n> & {
|
|
7
9
|
UserProfileFormFields: Component<UserProfileFormFieldsProps>;
|
|
8
10
|
doMakeUserConfirmPassword: boolean;
|
|
9
|
-
}
|
|
11
|
+
};
|
|
12
|
+
declare const Register: Component<RegisterProps, {}, "">;
|
|
10
13
|
type Register = ReturnType<typeof Register>;
|
|
11
14
|
export default Register;
|
|
@@ -3,9 +3,12 @@ import type { PageProps } from './PageProps';
|
|
|
3
3
|
import type { Component } from 'svelte';
|
|
4
4
|
import type { I18n } from '../i18n';
|
|
5
5
|
import type { KcContext } from '../KcContext';
|
|
6
|
-
|
|
6
|
+
type UpdateEmailProps = PageProps<Extract<KcContext, {
|
|
7
|
+
pageId: 'update-email.ftl';
|
|
8
|
+
}>, I18n> & {
|
|
7
9
|
UserProfileFormFields: Component<UserProfileFormFieldsProps>;
|
|
8
10
|
doMakeUserConfirmPassword: boolean;
|
|
9
|
-
}
|
|
11
|
+
};
|
|
12
|
+
declare const UpdateEmail: Component<UpdateEmailProps, {}, "">;
|
|
10
13
|
type UpdateEmail = ReturnType<typeof UpdateEmail>;
|
|
11
14
|
export default UpdateEmail;
|