chofex-cli 0.1.21 → 0.1.22
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/index.js +73 -37
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30876,16 +30876,21 @@ var applicationSemanticRequirements = (input) => {
|
|
|
30876
30876
|
}
|
|
30877
30877
|
return [];
|
|
30878
30878
|
};
|
|
30879
|
-
var
|
|
30880
|
-
const
|
|
30881
|
-
|
|
30882
|
-
|
|
30883
|
-
if (exports_Option.isNone(birthDate) || exports_DateTime.formatIsoDateUtc(birthDate.value) !== input.dateOfBirth || !exports_DateTime.isPastUnsafe(birthDate.value)) {
|
|
30884
|
-
requirements.push({
|
|
30879
|
+
var dateOfBirthRequirement = (dateOfBirth) => {
|
|
30880
|
+
const birthDate = exports_DateTime.make(`${dateOfBirth}T00:00:00.000Z`);
|
|
30881
|
+
if (exports_Option.isNone(birthDate) || exports_DateTime.formatIsoDateUtc(birthDate.value) !== dateOfBirth || !exports_DateTime.isPastUnsafe(birthDate.value)) {
|
|
30882
|
+
return {
|
|
30885
30883
|
field: "dateOfBirth",
|
|
30886
30884
|
reason: "Must be a valid date in the past"
|
|
30887
|
-
}
|
|
30885
|
+
};
|
|
30888
30886
|
}
|
|
30887
|
+
};
|
|
30888
|
+
var acceptedDetailsSemanticRequirements = (input, participationMode) => {
|
|
30889
|
+
const requirements = [];
|
|
30890
|
+
addShirtSizeRequirement(requirements, participationMode, input.shirtSize);
|
|
30891
|
+
const invalidDateOfBirth = dateOfBirthRequirement(input.dateOfBirth);
|
|
30892
|
+
if (invalidDateOfBirth)
|
|
30893
|
+
requirements.push(invalidDateOfBirth);
|
|
30889
30894
|
return requirements;
|
|
30890
30895
|
};
|
|
30891
30896
|
var RegistrationViewSchema = exports_Schema.Struct({
|
|
@@ -31493,7 +31498,7 @@ var insertInput = (state, input) => {
|
|
|
31493
31498
|
value: `${beforeCursor}${input}${afterCursor}`
|
|
31494
31499
|
});
|
|
31495
31500
|
};
|
|
31496
|
-
var processProfileUsername = (input, state) => {
|
|
31501
|
+
var processProfileUsername = (input, state, validate3) => {
|
|
31497
31502
|
if (input.key.ctrl) {
|
|
31498
31503
|
if (input.key.name === "u") {
|
|
31499
31504
|
return exports_Effect.succeed(nextFrame({ cursor: 0, value: "" }));
|
|
@@ -31536,7 +31541,7 @@ var processProfileUsername = (input, state) => {
|
|
|
31536
31541
|
}
|
|
31537
31542
|
if (input.key.name === "enter" || input.key.name === "return") {
|
|
31538
31543
|
if (state.value === "" || /^[A-Za-z0-9._-]+$/.test(state.value)) {
|
|
31539
|
-
return exports_Effect.
|
|
31544
|
+
return validate3(state.value).pipe(exports_Effect.map((value3) => ({ _tag: "Submit", value: value3 })), exports_Effect.catch((error2) => exports_Effect.succeed(nextFrame({ ...state, error: error2 }))));
|
|
31540
31545
|
}
|
|
31541
31546
|
return exports_Effect.succeed(nextFrame({ ...state, error: "Enter only your username" }));
|
|
31542
31547
|
}
|
|
@@ -31547,26 +31552,41 @@ var processProfileUsername = (input, state) => {
|
|
|
31547
31552
|
onSome: (value3) => insertInput(state, value3)
|
|
31548
31553
|
}));
|
|
31549
31554
|
};
|
|
31550
|
-
var profileUsernamePrompt = (message, profilePrefix) => exports_Prompt.custom({ cursor: 0, value: "" }, {
|
|
31555
|
+
var profileUsernamePrompt = (message, profilePrefix, validate3 = exports_Effect.succeed) => exports_Prompt.custom({ cursor: 0, value: "" }, {
|
|
31551
31556
|
render: (state, action2) => {
|
|
31552
31557
|
if (action2._tag === "Beep")
|
|
31553
31558
|
return exports_Effect.succeed(ansi.beep);
|
|
31554
31559
|
return exports_Effect.succeed(renderProfileUsername(state, message, profilePrefix, action2._tag === "Submit"));
|
|
31555
31560
|
},
|
|
31556
|
-
process: processProfileUsername,
|
|
31561
|
+
process: (input, state) => processProfileUsername(input, state, validate3),
|
|
31557
31562
|
clear: (state) => exports_Effect.succeed(clearProfileUsername(state))
|
|
31558
31563
|
});
|
|
31559
31564
|
|
|
31560
31565
|
// src/input.ts
|
|
31561
|
-
var
|
|
31566
|
+
var validatePromptValue = (schema, value3) => exports_Schema.decodeUnknownEffect(schema)(value3).pipe(exports_Effect.asVoid, exports_Effect.mapError((error2) => error2.message));
|
|
31567
|
+
var requiredText = (message, schema) => exports_Prompt.text({
|
|
31568
|
+
message,
|
|
31569
|
+
validate: (value3) => validatePromptValue(schema, value3).pipe(exports_Effect.as(value3))
|
|
31570
|
+
});
|
|
31571
|
+
var optionalText2 = (message, schema) => exports_Prompt.text({
|
|
31562
31572
|
message,
|
|
31573
|
+
default: "",
|
|
31563
31574
|
validate: (value3) => {
|
|
31564
|
-
if (value3
|
|
31575
|
+
if (value3 === "")
|
|
31565
31576
|
return exports_Effect.succeed(value3);
|
|
31566
|
-
return exports_Effect.
|
|
31577
|
+
return validatePromptValue(schema, value3).pipe(exports_Effect.as(value3));
|
|
31567
31578
|
}
|
|
31568
31579
|
});
|
|
31569
|
-
var
|
|
31580
|
+
var dateOfBirthPrompt = () => exports_Prompt.text({
|
|
31581
|
+
message: "Date of birth (YYYY-MM-DD)",
|
|
31582
|
+
validate: exports_Effect.fn("validateDateOfBirth")(function* (value3) {
|
|
31583
|
+
yield* validatePromptValue(acceptedDetailsInputFields.dateOfBirth, value3);
|
|
31584
|
+
const requirement = dateOfBirthRequirement(value3);
|
|
31585
|
+
if (requirement)
|
|
31586
|
+
return yield* exports_Effect.fail(requirement.reason);
|
|
31587
|
+
return value3;
|
|
31588
|
+
})
|
|
31589
|
+
});
|
|
31570
31590
|
var githubProfilePrefix = "github.com/";
|
|
31571
31591
|
var linkedInProfilePrefix = "linkedin.com/in/";
|
|
31572
31592
|
var withoutEmptyStrings = (input) => Object.fromEntries(Object.entries(input).filter(([, value3]) => value3 !== "" && value3 !== undefined));
|
|
@@ -31601,20 +31621,36 @@ var validateSemantics = (input, requirements) => {
|
|
|
31601
31621
|
}));
|
|
31602
31622
|
};
|
|
31603
31623
|
var applicationDetailsPrompts = exports_Prompt.all({
|
|
31604
|
-
firstName: requiredText("First name"),
|
|
31605
|
-
lastName: requiredText("Last name"),
|
|
31606
|
-
pronouns: optionalText2("Pronouns (optional)"),
|
|
31607
|
-
city: requiredText("City of residence in Peru"),
|
|
31608
|
-
organization: optionalText2("Organization (optional)"),
|
|
31609
|
-
role: optionalText2("Role (optional)"),
|
|
31610
|
-
fieldOfStudy: optionalText2("Field of study (optional)"),
|
|
31611
|
-
graduationYear:
|
|
31612
|
-
|
|
31613
|
-
|
|
31614
|
-
|
|
31615
|
-
|
|
31616
|
-
|
|
31617
|
-
|
|
31624
|
+
firstName: requiredText("First name", applicationInputFields.firstName),
|
|
31625
|
+
lastName: requiredText("Last name", applicationInputFields.lastName),
|
|
31626
|
+
pronouns: optionalText2("Pronouns (optional)", applicationInputFields.pronouns),
|
|
31627
|
+
city: requiredText("City of residence in Peru", applicationInputFields.city),
|
|
31628
|
+
organization: optionalText2("Organization (optional)", applicationInputFields.organization),
|
|
31629
|
+
role: optionalText2("Role (optional)", applicationInputFields.role),
|
|
31630
|
+
fieldOfStudy: optionalText2("Field of study (optional)", applicationInputFields.fieldOfStudy),
|
|
31631
|
+
graduationYear: exports_Prompt.text({
|
|
31632
|
+
message: "Graduation year (optional)",
|
|
31633
|
+
default: "",
|
|
31634
|
+
validate: (value3) => {
|
|
31635
|
+
if (value3 === "")
|
|
31636
|
+
return exports_Effect.succeed(value3);
|
|
31637
|
+
return validatePromptValue(applicationInputFields.graduationYear, Number(value3)).pipe(exports_Effect.as(value3));
|
|
31638
|
+
}
|
|
31639
|
+
}),
|
|
31640
|
+
shippedProject: requiredText("What have you shipped?", applicationInputFields.shippedProject),
|
|
31641
|
+
hackathonProject: requiredText("What do you want to ship at the hackathon?", applicationInputFields.hackathonProject),
|
|
31642
|
+
bio: requiredText("Short bio", applicationInputFields.bio),
|
|
31643
|
+
githubUsername: profileUsernamePrompt("GitHub username (optional)", githubProfilePrefix, (value3) => {
|
|
31644
|
+
if (value3 === "")
|
|
31645
|
+
return exports_Effect.succeed(value3);
|
|
31646
|
+
return validatePromptValue(applicationInputFields.githubUrl, `${githubProfilePrefix}${value3}`).pipe(exports_Effect.as(value3));
|
|
31647
|
+
}),
|
|
31648
|
+
linkedInUsername: profileUsernamePrompt("LinkedIn username (optional)", linkedInProfilePrefix, (value3) => {
|
|
31649
|
+
if (value3 === "")
|
|
31650
|
+
return exports_Effect.succeed(value3);
|
|
31651
|
+
return validatePromptValue(applicationInputFields.linkedInUrl, `${linkedInProfilePrefix}${value3}`).pipe(exports_Effect.as(value3));
|
|
31652
|
+
}),
|
|
31653
|
+
portfolioUrl: optionalText2("Portfolio URL (optional)", applicationInputFields.portfolioUrl)
|
|
31618
31654
|
});
|
|
31619
31655
|
var teamPreferencePrompt = exports_Prompt.select({
|
|
31620
31656
|
message: "Team preference",
|
|
@@ -31650,7 +31686,7 @@ var interactiveApplication = (publicBaseUrl) => exports_Effect.gen(function* ()
|
|
|
31650
31686
|
const teamPreference = yield* exports_Prompt.run(teamPreferencePrompt);
|
|
31651
31687
|
let teamName;
|
|
31652
31688
|
if (teamPreference === "have_team") {
|
|
31653
|
-
teamName = yield* exports_Prompt.run(requiredText("Team name"));
|
|
31689
|
+
teamName = yield* exports_Prompt.run(requiredText("Team name", applicationInputFields.teamName));
|
|
31654
31690
|
}
|
|
31655
31691
|
const codeOfConductAccepted = yield* requiredAgreement("Terms and Code of Conduct", publicDocumentUrl(publicBaseUrl, "/terms"));
|
|
31656
31692
|
const privacyPolicyAccepted = yield* requiredAgreement("Privacy Policy", publicDocumentUrl(publicBaseUrl, "/privacy"));
|
|
@@ -31688,14 +31724,14 @@ var shirtSizePrompt = (participationMode) => {
|
|
|
31688
31724
|
});
|
|
31689
31725
|
};
|
|
31690
31726
|
var interactiveAcceptedDetails = (participationMode) => exports_Prompt.run(exports_Prompt.all({
|
|
31691
|
-
phone: requiredText("Phone number"),
|
|
31692
|
-
dateOfBirth:
|
|
31693
|
-
nationalIdNumber: requiredText("National ID or passport number"),
|
|
31727
|
+
phone: requiredText("Phone number", acceptedDetailsInputFields.phone),
|
|
31728
|
+
dateOfBirth: dateOfBirthPrompt(),
|
|
31729
|
+
nationalIdNumber: requiredText("National ID or passport number", acceptedDetailsInputFields.nationalIdNumber),
|
|
31694
31730
|
shirtSize: shirtSizePrompt(participationMode),
|
|
31695
|
-
dietaryRestrictions: optionalText2("Dietary restrictions (optional)"),
|
|
31696
|
-
accessibilityNeeds: optionalText2("Accessibility needs (optional)"),
|
|
31697
|
-
emergencyContactName: requiredText("Emergency contact name"),
|
|
31698
|
-
emergencyContactPhone: requiredText("Emergency contact phone"),
|
|
31731
|
+
dietaryRestrictions: optionalText2("Dietary restrictions (optional)", acceptedDetailsInputFields.dietaryRestrictions),
|
|
31732
|
+
accessibilityNeeds: optionalText2("Accessibility needs (optional)", acceptedDetailsInputFields.accessibilityNeeds),
|
|
31733
|
+
emergencyContactName: requiredText("Emergency contact name", acceptedDetailsInputFields.emergencyContactName),
|
|
31734
|
+
emergencyContactPhone: requiredText("Emergency contact phone", acceptedDetailsInputFields.emergencyContactPhone),
|
|
31699
31735
|
mediaConsent: exports_Prompt.confirm({
|
|
31700
31736
|
message: "Do you consent to appearing in event media?"
|
|
31701
31737
|
})
|