@opengeni/contracts 2.7.0 → 2.9.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.
@@ -127,6 +127,24 @@ export const ManagedAuthLoginTransaction = z.object({
127
127
  });
128
128
  export type ManagedAuthLoginTransaction = z.infer<typeof ManagedAuthLoginTransaction>;
129
129
 
130
+ export const ManagedAuthSocialProvider = z.enum(["google", "github"]);
131
+ export type ManagedAuthSocialProvider = z.infer<typeof ManagedAuthSocialProvider>;
132
+
133
+ export const StartManagedAuthSocialTransactionRequest = ManagedAuthOperationIdentity.extend({
134
+ transactionId: z.string().uuid(),
135
+ provider: ManagedAuthSocialProvider,
136
+ });
137
+ export type StartManagedAuthSocialTransactionRequest = z.infer<
138
+ typeof StartManagedAuthSocialTransactionRequest
139
+ >;
140
+
141
+ export const StartManagedAuthSocialTransactionResponse = z.object({
142
+ url: z.string().url().max(4_096),
143
+ });
144
+ export type StartManagedAuthSocialTransactionResponse = z.infer<
145
+ typeof StartManagedAuthSocialTransactionResponse
146
+ >;
147
+
130
148
  export const CompleteManagedAuthEmailPasswordTransactionRequest =
131
149
  ManagedAuthOperationIdentity.extend({
132
150
  transactionId: z.string().uuid(),
@@ -29,6 +29,7 @@ export const Permission = z.enum([
29
29
  "api_keys:manage",
30
30
  "connections:read",
31
31
  "connections:write",
32
+ "capabilities:manage",
32
33
  /** @deprecated alias of variable-sets:manage */
33
34
  "environments:manage",
34
35
  /** @deprecated alias of variable-sets:use */
@@ -212,7 +212,13 @@ function hasVisibleAutomaticTitleContent(value: string): boolean {
212
212
  return automaticTitleDetectionValue(value).trim().length > 0;
213
213
  }
214
214
 
215
- function containsSensitiveAutomaticTitleValue(value: string): boolean {
215
+ /**
216
+ * Whether a bounded automatic-title candidate contains a credential, URL, or
217
+ * opaque identifier that must stay out of navigation and other display-title
218
+ * surfaces. Callers handling an unbounded source must bound it before invoking
219
+ * this helper.
220
+ */
221
+ export function containsSensitiveAutomaticSessionTitleValue(value: string): boolean {
216
222
  const detectionValue = automaticTitleDetectionValue(value);
217
223
 
218
224
  if (KNOWN_SENSITIVE_VALUE_PATTERNS.some((pattern) => pattern.test(detectionValue))) return true;
@@ -271,7 +277,8 @@ function automaticTitleGraphemes(value: string): string[] {
271
277
  return graphemes;
272
278
  }
273
279
 
274
- function boundAutomaticTitle(value: string): string {
280
+ /** Bound an already-normalized automatic-title candidate without splitting graphemes. */
281
+ export function boundAutomaticSessionTitle(value: string): string {
275
282
  const words = value.split(/\s+/u);
276
283
  const wordBounded = words.length > 10 ? words.slice(0, 10).join(" ") : value;
277
284
  const graphemes = automaticTitleGraphemes(wordBounded);
@@ -299,7 +306,7 @@ export function normalizeAutomaticSessionTitle(value: string): string | null {
299
306
  if (
300
307
  !firstLine ||
301
308
  !hasVisibleAutomaticTitleContent(firstLine) ||
302
- containsSensitiveAutomaticTitleValue(firstLine)
309
+ containsSensitiveAutomaticSessionTitleValue(firstLine)
303
310
  ) {
304
311
  return null;
305
312
  }
@@ -311,12 +318,12 @@ export function normalizeAutomaticSessionTitle(value: string): string | null {
311
318
  if (
312
319
  !title ||
313
320
  !hasVisibleAutomaticTitleContent(title) ||
314
- containsSensitiveAutomaticTitleValue(title)
321
+ containsSensitiveAutomaticSessionTitleValue(title)
315
322
  ) {
316
323
  return null;
317
324
  }
318
325
 
319
- title = boundAutomaticTitle(title)
326
+ title = boundAutomaticSessionTitle(title)
320
327
  .replace(/[\s.!?,;:\-–—]+$/u, "")
321
328
  .trim();
322
329
  if (!title || !hasVisibleAutomaticTitleContent(title)) return null;