@kya-os/contracts 1.6.0 → 1.6.2-canary.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.
@@ -132,8 +132,7 @@ exports.oauthIdentitySchema = zod_1.z.object({
132
132
  /**
133
133
  * Consent Page Config Schema
134
134
  */
135
- exports.consentPageConfigSchema = zod_1.z
136
- .object({
135
+ exports.consentPageConfigSchema = zod_1.z.object({
137
136
  tool: zod_1.z.string().min(1, "Tool name is required"),
138
137
  toolDescription: zod_1.z
139
138
  .string()
@@ -142,7 +141,6 @@ exports.consentPageConfigSchema = zod_1.z
142
141
  agentDid: zod_1.z.string().min(1, "Agent DID is required"),
143
142
  sessionId: zod_1.z.string().min(1, "Session ID is required"),
144
143
  projectId: zod_1.z.string().min(1, "Project ID is required"),
145
- provider: zod_1.z.string().optional(), // Phase 2: OAuth provider name (e.g., "github", "google")
146
144
  branding: exports.consentBrandingSchema.optional(),
147
145
  terms: exports.consentTermsSchema.optional(),
148
146
  customFields: zod_1.z
@@ -151,42 +149,6 @@ exports.consentPageConfigSchema = zod_1.z
151
149
  .optional(),
152
150
  serverUrl: zod_1.z.string().url("Server URL must be a valid URL"),
153
151
  autoClose: zod_1.z.boolean().optional(),
154
- /**
155
- * Whether OAuth authorization is required immediately
156
- * If true, the consent page will act as a landing page before redirecting
157
- */
158
- oauthRequired: zod_1.z.boolean().optional(),
159
- /**
160
- * The OAuth authorization URL to redirect to
161
- * Required if oauthRequired is true
162
- */
163
- oauthUrl: zod_1.z
164
- .union([
165
- zod_1.z.string().url(),
166
- zod_1.z.literal(""), // Allow empty string to catch it in refine with better error
167
- ])
168
- .optional(),
169
- })
170
- .superRefine((data, ctx) => {
171
- // If oauthRequired is true, oauthUrl must be provided and non-empty
172
- if (data.oauthRequired === true) {
173
- if (data.oauthUrl === undefined || data.oauthUrl === "") {
174
- ctx.addIssue({
175
- code: zod_1.z.ZodIssueCode.custom,
176
- message: "oauthUrl is required when oauthRequired is true",
177
- path: ["oauthUrl"],
178
- });
179
- return;
180
- }
181
- }
182
- // If oauthUrl is provided (not undefined), it must be a valid URL (not empty)
183
- if (data.oauthUrl !== undefined && data.oauthUrl === "") {
184
- ctx.addIssue({
185
- code: zod_1.z.ZodIssueCode.custom,
186
- message: "oauthUrl must be a valid URL",
187
- path: ["oauthUrl"],
188
- });
189
- }
190
152
  });
191
153
  /**
192
154
  * Consent Approval Request Schema