@playaos/api-client 0.1.2 → 0.1.3
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/applications-schema.d.ts +17 -16
- package/dist/applications-schema.js +24 -8
- package/dist/applications-schema.js.map +1 -1
- package/dist/index.d.ts +13 -12
- package/package.json +1 -1
|
@@ -49,22 +49,22 @@ declare const step5Schema: z.ZodObject<{
|
|
|
49
49
|
agrees_to_principles: z.ZodLiteral<true>;
|
|
50
50
|
}, z.core.$strip>;
|
|
51
51
|
declare const applicationSchema: z.ZodObject<{
|
|
52
|
-
acknowledged_expectations: z.ZodLiteral<true
|
|
52
|
+
acknowledged_expectations: z.ZodOptional<z.ZodLiteral<true>>;
|
|
53
53
|
first_name: z.ZodString;
|
|
54
54
|
last_name: z.ZodString;
|
|
55
55
|
email: z.ZodString;
|
|
56
|
-
phone: z.ZodString
|
|
56
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
57
57
|
referral_code: z.ZodOptional<z.ZodString>;
|
|
58
58
|
socials: z.ZodOptional<z.ZodString>;
|
|
59
|
-
birthday: z.ZodString
|
|
60
|
-
hometown: z.ZodString
|
|
61
|
-
how_heard: z.ZodString
|
|
62
|
-
burning_man_before: z.ZodEnum<{
|
|
59
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
60
|
+
hometown: z.ZodOptional<z.ZodString>;
|
|
61
|
+
how_heard: z.ZodOptional<z.ZodString>;
|
|
62
|
+
burning_man_before: z.ZodOptional<z.ZodEnum<{
|
|
63
63
|
yes: "yes";
|
|
64
64
|
no: "no";
|
|
65
|
-
}
|
|
65
|
+
}>>;
|
|
66
66
|
burning_man_years: z.ZodOptional<z.ZodString>;
|
|
67
|
-
shelter_type: z.ZodEnum<{
|
|
67
|
+
shelter_type: z.ZodOptional<z.ZodEnum<{
|
|
68
68
|
joining_rv: "joining_rv";
|
|
69
69
|
bringing_rv: "bringing_rv";
|
|
70
70
|
shiftpod_tent: "shiftpod_tent";
|
|
@@ -72,19 +72,20 @@ declare const applicationSchema: z.ZodObject<{
|
|
|
72
72
|
truck: "truck";
|
|
73
73
|
van: "van";
|
|
74
74
|
unsure: "unsure";
|
|
75
|
-
}
|
|
76
|
-
|
|
75
|
+
}>>;
|
|
76
|
+
shelter_mates: z.ZodOptional<z.ZodString>;
|
|
77
|
+
ticket_status: z.ZodOptional<z.ZodEnum<{
|
|
77
78
|
unsure: "unsure";
|
|
78
79
|
looking: "looking";
|
|
79
80
|
have_ticket: "have_ticket";
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
build_available: z.ZodBoolean;
|
|
81
|
+
}>>;
|
|
82
|
+
build_available: z.ZodOptional<z.ZodBoolean>;
|
|
83
83
|
build_skills: z.ZodOptional<z.ZodString>;
|
|
84
|
-
strike_available: z.ZodBoolean
|
|
84
|
+
strike_available: z.ZodOptional<z.ZodBoolean>;
|
|
85
85
|
strike_help: z.ZodOptional<z.ZodString>;
|
|
86
|
-
about_yourself: z.ZodString
|
|
87
|
-
agrees_to_principles: z.ZodLiteral<true
|
|
86
|
+
about_yourself: z.ZodOptional<z.ZodString>;
|
|
87
|
+
agrees_to_principles: z.ZodOptional<z.ZodLiteral<true>>;
|
|
88
|
+
custom_fields: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
88
89
|
}, z.core.$strip>;
|
|
89
90
|
type ApplicationFormData = z.infer<typeof applicationSchema>;
|
|
90
91
|
type Step0Data = z.infer<typeof step0Schema>;
|
|
@@ -43,14 +43,30 @@ var step5Schema = z.object({
|
|
|
43
43
|
about_yourself: z.string().min(50, "Please write at least 50 characters about yourself"),
|
|
44
44
|
agrees_to_principles: z.literal(true, { error: "You must agree to the 10 Principles" })
|
|
45
45
|
});
|
|
46
|
-
var applicationSchema =
|
|
47
|
-
z.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
).
|
|
46
|
+
var applicationSchema = z.object({
|
|
47
|
+
acknowledged_expectations: z.literal(true).optional(),
|
|
48
|
+
first_name: z.string().min(1),
|
|
49
|
+
last_name: z.string().min(1),
|
|
50
|
+
email: z.string().email(),
|
|
51
|
+
phone: z.string().optional(),
|
|
52
|
+
referral_code: z.string().optional(),
|
|
53
|
+
socials: z.string().optional(),
|
|
54
|
+
birthday: z.string().optional(),
|
|
55
|
+
hometown: z.string().optional(),
|
|
56
|
+
how_heard: z.string().optional(),
|
|
57
|
+
burning_man_before: z.enum(["yes", "no"]).optional(),
|
|
58
|
+
burning_man_years: z.string().optional(),
|
|
59
|
+
shelter_type: z.enum(["joining_rv", "bringing_rv", "shiftpod_tent", "car", "truck", "van", "unsure"]).optional(),
|
|
60
|
+
shelter_mates: z.string().optional(),
|
|
61
|
+
ticket_status: z.enum(["looking", "have_ticket", "unsure"]).optional(),
|
|
62
|
+
build_available: z.boolean().optional(),
|
|
63
|
+
build_skills: z.string().optional(),
|
|
64
|
+
strike_available: z.boolean().optional(),
|
|
65
|
+
strike_help: z.string().optional(),
|
|
66
|
+
about_yourself: z.string().optional(),
|
|
67
|
+
agrees_to_principles: z.literal(true).optional(),
|
|
68
|
+
custom_fields: z.object({}).passthrough().optional()
|
|
69
|
+
});
|
|
54
70
|
export {
|
|
55
71
|
applicationSchema,
|
|
56
72
|
step0Schema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/applications-schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// Single source of truth for the apply-wizard form shape.\n// The portal apply flow and the @playaos/react <ApplicationForm> SDK both import\n// from here so the validation contract can never drift between them (PLA-483).\n// `ApplicationCreatePayload` in ./types.ts is the zod-free wire mirror; a type\n// equivalence test (applications-schema.test.ts) keeps the two locked together.\n\n// Per-step validation schemas\nexport const step0Schema = z.object({\n acknowledged_expectations: z.literal(true, {\n error: \"Please acknowledge the expectations to continue\",\n }),\n});\n\nexport const step1Schema = z.object({\n first_name: z.string().min(1, \"First name is required\"),\n last_name: z.string().min(1, \"Last name is required\"),\n email: z.string().email(\"Invalid email address\"),\n phone: z.string().min(10, \"Phone number is required\"),\n referral_code: z.string().optional(),\n socials: z.string().optional(),\n birthday: z.string().min(1, \"Birthday is required\"),\n hometown: z.string().min(1, \"Location is required\"),\n});\n\nexport const step2Schema = z.object({\n how_heard: z.string().min(1, \"Please tell us how you heard about us\"),\n burning_man_before: z.enum([\"yes\", \"no\"], { error: \"Please select an option\" }),\n burning_man_years: z.string().optional(),\n});\n\nexport const step3Schema = z.object({\n shelter_type: z.enum([\"joining_rv\", \"bringing_rv\", \"shiftpod_tent\", \"car\", \"truck\", \"van\", \"unsure\"], {\n error: \"Please select a shelter type\",\n }),\n shelter_mates: z.string().optional(),\n ticket_status: z.enum([\"looking\", \"have_ticket\", \"unsure\"], { error: \"Please select your ticket status\" }),\n});\n\nexport const step4Schema = z\n .object({\n build_available: z.boolean(),\n build_skills: z.string().optional(),\n strike_available: z.boolean(),\n strike_help: z.string().optional(),\n })\n .refine((data) => !data.build_available || data.build_skills, {\n message: \"Please tell us about your build skills\",\n path: [\"build_skills\"],\n })\n .refine((data) => !data.strike_available || data.strike_help, {\n message: \"Please tell us how you can help with strike\",\n path: [\"strike_help\"],\n });\n\nexport const step5Schema = z.object({\n about_yourself: z.string().min(50, \"Please write at least 50 characters about yourself\"),\n agrees_to_principles: z.literal(true, { error: \"You must agree to the 10 Principles\" }),\n});\n\n// Combined schema for
|
|
1
|
+
{"version":3,"sources":["../src/applications-schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// Single source of truth for the apply-wizard form shape.\n// The portal apply flow and the @playaos/react <ApplicationForm> SDK both import\n// from here so the validation contract can never drift between them (PLA-483).\n// `ApplicationCreatePayload` in ./types.ts is the zod-free wire mirror; a type\n// equivalence test (applications-schema.test.ts) keeps the two locked together.\n\n// Per-step validation schemas\nexport const step0Schema = z.object({\n acknowledged_expectations: z.literal(true, {\n error: \"Please acknowledge the expectations to continue\",\n }),\n});\n\nexport const step1Schema = z.object({\n first_name: z.string().min(1, \"First name is required\"),\n last_name: z.string().min(1, \"Last name is required\"),\n email: z.string().email(\"Invalid email address\"),\n phone: z.string().min(10, \"Phone number is required\"),\n referral_code: z.string().optional(),\n socials: z.string().optional(),\n birthday: z.string().min(1, \"Birthday is required\"),\n hometown: z.string().min(1, \"Location is required\"),\n});\n\nexport const step2Schema = z.object({\n how_heard: z.string().min(1, \"Please tell us how you heard about us\"),\n burning_man_before: z.enum([\"yes\", \"no\"], { error: \"Please select an option\" }),\n burning_man_years: z.string().optional(),\n});\n\nexport const step3Schema = z.object({\n shelter_type: z.enum([\"joining_rv\", \"bringing_rv\", \"shiftpod_tent\", \"car\", \"truck\", \"van\", \"unsure\"], {\n error: \"Please select a shelter type\",\n }),\n shelter_mates: z.string().optional(),\n ticket_status: z.enum([\"looking\", \"have_ticket\", \"unsure\"], { error: \"Please select your ticket status\" }),\n});\n\nexport const step4Schema = z\n .object({\n build_available: z.boolean(),\n build_skills: z.string().optional(),\n strike_available: z.boolean(),\n strike_help: z.string().optional(),\n })\n .refine((data) => !data.build_available || data.build_skills, {\n message: \"Please tell us about your build skills\",\n path: [\"build_skills\"],\n })\n .refine((data) => !data.strike_available || data.strike_help, {\n message: \"Please tell us how you can help with strike\",\n path: [\"strike_help\"],\n });\n\nexport const step5Schema = z.object({\n about_yourself: z.string().min(50, \"Please write at least 50 characters about yourself\"),\n agrees_to_principles: z.literal(true, { error: \"You must agree to the 10 Principles\" }),\n});\n\n// Combined schema for API-level validation — permissive so external camps\n// can submit applications with only first_name + last_name + email + custom_fields.\n// Step schemas (above) remain strict for the PlayaOS wizard UI.\nexport const applicationSchema = z.object({\n acknowledged_expectations: z.literal(true).optional(),\n first_name: z.string().min(1),\n last_name: z.string().min(1),\n email: z.string().email(),\n phone: z.string().optional(),\n referral_code: z.string().optional(),\n socials: z.string().optional(),\n birthday: z.string().optional(),\n hometown: z.string().optional(),\n how_heard: z.string().optional(),\n burning_man_before: z.enum([\"yes\", \"no\"]).optional(),\n burning_man_years: z.string().optional(),\n shelter_type: z.enum([\"joining_rv\", \"bringing_rv\", \"shiftpod_tent\", \"car\", \"truck\", \"van\", \"unsure\"]).optional(),\n shelter_mates: z.string().optional(),\n ticket_status: z.enum([\"looking\", \"have_ticket\", \"unsure\"]).optional(),\n build_available: z.boolean().optional(),\n build_skills: z.string().optional(),\n strike_available: z.boolean().optional(),\n strike_help: z.string().optional(),\n about_yourself: z.string().optional(),\n agrees_to_principles: z.literal(true).optional(),\n custom_fields: z.object({}).passthrough().optional(),\n});\n\nexport type ApplicationFormData = z.infer<typeof applicationSchema>;\nexport type Step0Data = z.infer<typeof step0Schema>;\nexport type Step1Data = z.infer<typeof step1Schema>;\nexport type Step2Data = z.infer<typeof step2Schema>;\nexport type Step3Data = z.infer<typeof step3Schema>;\nexport type Step4Data = z.infer<typeof step4Schema>;\nexport type Step5Data = z.infer<typeof step5Schema>;\n"],"mappings":";AAAA,SAAS,SAAS;AASX,IAAM,cAAc,EAAE,OAAO;AAAA,EAClC,2BAA2B,EAAE,QAAQ,MAAM;AAAA,IACzC,OAAO;AAAA,EACT,CAAC;AACH,CAAC;AAEM,IAAM,cAAc,EAAE,OAAO;AAAA,EAClC,YAAY,EAAE,OAAO,EAAE,IAAI,GAAG,wBAAwB;AAAA,EACtD,WAAW,EAAE,OAAO,EAAE,IAAI,GAAG,uBAAuB;AAAA,EACpD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB;AAAA,EAC/C,OAAO,EAAE,OAAO,EAAE,IAAI,IAAI,0BAA0B;AAAA,EACpD,eAAe,EAAE,OAAO,EAAE,SAAS;AAAA,EACnC,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,UAAU,EAAE,OAAO,EAAE,IAAI,GAAG,sBAAsB;AAAA,EAClD,UAAU,EAAE,OAAO,EAAE,IAAI,GAAG,sBAAsB;AACpD,CAAC;AAEM,IAAM,cAAc,EAAE,OAAO;AAAA,EAClC,WAAW,EAAE,OAAO,EAAE,IAAI,GAA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B,OAAO,EAAE,OAAO,EAAE,MAAM;AAAA,EACxB,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,eAAe,EAAE,OAAO,EAAE,SAAS;AAAA,EACnC,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,oBAAoB,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,EAAE,SAAS;AAAA,EACnD,mBAAmB,EAAE,OAAO,EAAE,SAAS;AAAA,EACvC,cAAc,EAAE,KAAK,CAAC,cAAc,eAAe,iBAAiB,OAAO,SAAS,OAAO,QAAQ,CAAC,EAAE,SAAS;AAAA,EAC/G,eAAe,EAAE,OAAO,EAAE,SAAS;AAAA,EACnC,eAAe,EAAE,KAAK,CAAC,WAAW,eAAe,QAAQ,CAAC,EAAE,SAAS;AAAA,EACrE,iBAAiB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACtC,cAAc,EAAE,OAAO,EAAE,SAAS;AAAA,EAClC,kBAAkB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACvC,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,gBAAgB,EAAE,OAAO,EAAE,SAAS;AAAA,EACpC,sBAAsB,EAAE,QAAQ,IAAI,EAAE,SAAS;AAAA,EAC/C,eAAe,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,SAAS;AACrD,CAAC;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -74,27 +74,28 @@ interface PaymentPageResponse {
|
|
|
74
74
|
modalSupported: boolean;
|
|
75
75
|
}
|
|
76
76
|
interface ApplicationCreatePayload {
|
|
77
|
-
acknowledged_expectations
|
|
77
|
+
acknowledged_expectations?: true;
|
|
78
78
|
first_name: string;
|
|
79
79
|
last_name: string;
|
|
80
80
|
email: string;
|
|
81
|
-
phone
|
|
81
|
+
phone?: string;
|
|
82
82
|
referral_code?: string;
|
|
83
83
|
socials?: string;
|
|
84
|
-
birthday
|
|
85
|
-
hometown
|
|
86
|
-
how_heard
|
|
87
|
-
burning_man_before
|
|
84
|
+
birthday?: string;
|
|
85
|
+
hometown?: string;
|
|
86
|
+
how_heard?: string;
|
|
87
|
+
burning_man_before?: "yes" | "no";
|
|
88
88
|
burning_man_years?: string;
|
|
89
|
-
shelter_type
|
|
89
|
+
shelter_type?: "joining_rv" | "bringing_rv" | "shiftpod_tent" | "car" | "truck" | "van" | "unsure";
|
|
90
90
|
shelter_mates?: string;
|
|
91
|
-
ticket_status
|
|
92
|
-
build_available
|
|
91
|
+
ticket_status?: "looking" | "have_ticket" | "unsure";
|
|
92
|
+
build_available?: boolean;
|
|
93
93
|
build_skills?: string;
|
|
94
|
-
strike_available
|
|
94
|
+
strike_available?: boolean;
|
|
95
95
|
strike_help?: string;
|
|
96
|
-
about_yourself
|
|
97
|
-
agrees_to_principles
|
|
96
|
+
about_yourself?: string;
|
|
97
|
+
agrees_to_principles?: true;
|
|
98
|
+
custom_fields?: Record<string, unknown>;
|
|
98
99
|
}
|
|
99
100
|
interface ApplicationCreateResponse {
|
|
100
101
|
applicationId: string;
|