@supernova-studio/model 0.54.23 → 0.54.24

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.d.mts CHANGED
@@ -29711,7 +29711,7 @@ type ArrayElementType<T extends Default[], Default = any> = T extends (infer U)[
29711
29711
  declare function buildConstantEnum<Inferred extends ArrayElementType<Passed>[], Passed extends string[]>(values: Inferred): {
29712
29712
  [key in Inferred[number]]: key;
29713
29713
  };
29714
- declare function promiseWithTimeout<T>(timeoutMs: number, promise: () => Promise<T>): Promise<T>;
29714
+ declare function promiseWithTimeout<T>(timeoutMs: number, promise: () => Promise<T>, onTimeout?: () => Error): Promise<T>;
29715
29715
  declare function sleep(ms: number): Promise<void>;
29716
29716
  declare function uniqueBy<K, V>(items: V[], prop: (v: V) => K): V[];
29717
29717
  declare function areShallowObjectsEqual<T extends object>(lhs: T | undefined, rhs: T | undefined): boolean;
package/dist/index.d.ts CHANGED
@@ -29711,7 +29711,7 @@ type ArrayElementType<T extends Default[], Default = any> = T extends (infer U)[
29711
29711
  declare function buildConstantEnum<Inferred extends ArrayElementType<Passed>[], Passed extends string[]>(values: Inferred): {
29712
29712
  [key in Inferred[number]]: key;
29713
29713
  };
29714
- declare function promiseWithTimeout<T>(timeoutMs: number, promise: () => Promise<T>): Promise<T>;
29714
+ declare function promiseWithTimeout<T>(timeoutMs: number, promise: () => Promise<T>, onTimeout?: () => Error): Promise<T>;
29715
29715
  declare function sleep(ms: number): Promise<void>;
29716
29716
  declare function uniqueBy<K, V>(items: V[], prop: (v: V) => K): V[];
29717
29717
  declare function areShallowObjectsEqual<T extends object>(lhs: T | undefined, rhs: T | undefined): boolean;
package/dist/index.js CHANGED
@@ -792,10 +792,10 @@ function buildConstantEnum(values) {
792
792
  const constMap = values.reduce((acc, code) => ({ ...acc, [code]: code }), {});
793
793
  return constMap;
794
794
  }
795
- async function promiseWithTimeout(timeoutMs, promise) {
795
+ async function promiseWithTimeout(timeoutMs, promise, onTimeout) {
796
796
  let timeoutHandle;
797
797
  const timeoutPromise = new Promise((_, reject) => {
798
- timeoutHandle = setTimeout(() => reject(SupernovaException.timeout()), timeoutMs);
798
+ timeoutHandle = setTimeout(() => reject(_nullishCoalesce(_optionalChain([onTimeout, 'optionalCall', _2 => _2()]), () => ( SupernovaException.timeout()))), timeoutMs);
799
799
  });
800
800
  const result = await Promise.race([promise(), timeoutPromise]);
801
801
  clearTimeout(timeoutHandle);
@@ -917,7 +917,7 @@ function removeDiacritics(str) {
917
917
  var _slugify = require('@sindresorhus/slugify'); var _slugify2 = _interopRequireDefault(_slugify);
918
918
  function slugify(str, options) {
919
919
  const slug = _slugify2.default.call(void 0, _nullishCoalesce(str, () => ( "")), options);
920
- return _optionalChain([slug, 'optionalAccess', _2 => _2.length]) > 0 ? slug : "item";
920
+ return _optionalChain([slug, 'optionalAccess', _3 => _3.length]) > 0 ? slug : "item";
921
921
  }
922
922
  var RESERVED_SLUGS = [
923
923
  "workspaces",
@@ -1540,7 +1540,7 @@ var RESERVED_SLUGS = [
1540
1540
  ];
1541
1541
  var RESERVED_SLUGS_SET = new Set(RESERVED_SLUGS);
1542
1542
  var RESERVED_SLUG_PREFIX = "x-sn-reserved-";
1543
- var isSlugReservedInternal = (slug) => _optionalChain([slug, 'optionalAccess', _3 => _3.startsWith, 'call', _4 => _4(RESERVED_SLUG_PREFIX)]);
1543
+ var isSlugReservedInternal = (slug) => _optionalChain([slug, 'optionalAccess', _4 => _4.startsWith, 'call', _5 => _5(RESERVED_SLUG_PREFIX)]);
1544
1544
  function isSlugReserved(slug) {
1545
1545
  return RESERVED_SLUGS_SET.has(slug) || isSlugReservedInternal(slug);
1546
1546
  }
@@ -4117,8 +4117,8 @@ var ExporterPropertyValuesCollection = _zod.z.object({
4117
4117
  var SHORT_PERSISTENT_ID_LENGTH = 8;
4118
4118
  function tryParseShortPersistentId(url = "/") {
4119
4119
  const lastUrlPart = url.split("/").pop() || "";
4120
- const shortPersistentId = _optionalChain([lastUrlPart, 'access', _5 => _5.split, 'call', _6 => _6("-"), 'access', _7 => _7.pop, 'call', _8 => _8(), 'optionalAccess', _9 => _9.replaceAll, 'call', _10 => _10(".html", "")]) || null;
4121
- return _optionalChain([shortPersistentId, 'optionalAccess', _11 => _11.length]) === SHORT_PERSISTENT_ID_LENGTH ? shortPersistentId : null;
4120
+ const shortPersistentId = _optionalChain([lastUrlPart, 'access', _6 => _6.split, 'call', _7 => _7("-"), 'access', _8 => _8.pop, 'call', _9 => _9(), 'optionalAccess', _10 => _10.replaceAll, 'call', _11 => _11(".html", "")]) || null;
4121
+ return _optionalChain([shortPersistentId, 'optionalAccess', _12 => _12.length]) === SHORT_PERSISTENT_ID_LENGTH ? shortPersistentId : null;
4122
4122
  }
4123
4123
  var PublishedDocPage = _zod.z.object({
4124
4124
  id: _zod.z.string(),
@@ -4634,7 +4634,7 @@ var IntegrationToken = _zod.z.object({
4634
4634
  token_bitbucket_username: _zod.z.string().optional(),
4635
4635
  // Bitbucket only
4636
4636
  custom_url: _zod.z.string().optional().transform((value) => {
4637
- if (!_optionalChain([value, 'optionalAccess', _12 => _12.trim, 'call', _13 => _13()]))
4637
+ if (!_optionalChain([value, 'optionalAccess', _13 => _13.trim, 'call', _14 => _14()]))
4638
4638
  return void 0;
4639
4639
  return formatCustomUrl(value);
4640
4640
  })
@@ -5128,7 +5128,7 @@ var CreateWorkspaceInput = _zod.z.object({
5128
5128
  product: ProductCodeSchema,
5129
5129
  priceId: _zod.z.string(),
5130
5130
  billingEmail: _zod.z.string().email().optional(),
5131
- handle: _zod.z.string().regex(slugRegex).min(HANDLE_MIN_LENGTH).max(HANDLE_MAX_LENGTH).refine((value) => _optionalChain([value, 'optionalAccess', _14 => _14.length]) > 0).optional(),
5131
+ handle: _zod.z.string().regex(slugRegex).min(HANDLE_MIN_LENGTH).max(HANDLE_MAX_LENGTH).refine((value) => _optionalChain([value, 'optionalAccess', _15 => _15.length]) > 0).optional(),
5132
5132
  invites: UserInvites.optional(),
5133
5133
  promoCode: _zod.z.string().optional(),
5134
5134
  status: InternalStatusSchema.optional(),