{
  "version": 3,
  "sources": ["twenty-sdk-define-stub:__twenty-sdk-define-stub__", "../../../src/constants/universal-identifiers.ts", "../../../src/config.ts", "../../../src/meta.ts", "../../../src/handlers/status.ts", "../../../src/status.logic-function.ts"],
  "sourcesContent": ["\n// Auto-generated stub for twenty-sdk/define injected by the SDK CLI build.\n// Real implementations would pull in zod, twenty-shared and ~1MB of code; at\n// runtime only `default.config.handler` is consumed, so tiny no-ops suffice.\nconst __defineFactoryStub = (config) => ({\n  success: true,\n  config,\n  errors: [],\n});\n\nconst __anyHandler = {\n  get(_target, prop) {\n    if (prop === '__esModule') return true;\n    if (prop === Symbol.toPrimitive) return () => '';\n    if (typeof prop === 'symbol') return undefined;\n    return new Proxy(() => undefined, __anyHandler);\n  },\n  apply() {\n    return new Proxy(() => undefined, __anyHandler);\n  },\n};\nconst __anyStub = new Proxy(() => undefined, __anyHandler);\n\nexport const createValidationResult = __defineFactoryStub;\nexport const defineAgent = __defineFactoryStub;\nexport const defineApplication = __defineFactoryStub;\nexport const defineApplicationRole = __defineFactoryStub;\nexport const defineCommandMenuItem = __defineFactoryStub;\nexport const defineConnectionProvider = __defineFactoryStub;\nexport const defineField = __defineFactoryStub;\nexport const defineFrontComponent = __defineFactoryStub;\nexport const defineIndex = __defineFactoryStub;\nexport const defineLogicFunction = __defineFactoryStub;\nexport const defineNavigationMenuItem = __defineFactoryStub;\nexport const defineObject = __defineFactoryStub;\nexport const definePageLayout = __defineFactoryStub;\nexport const definePageLayoutTab = __defineFactoryStub;\nexport const definePermissionFlag = __defineFactoryStub;\nexport const definePostInstallLogicFunction = __defineFactoryStub;\nexport const definePreInstallLogicFunction = __defineFactoryStub;\nexport const defineRole = __defineFactoryStub;\nexport const defineSkill = __defineFactoryStub;\nexport const defineView = __defineFactoryStub;\nexport const defineViewField = __defineFactoryStub;\nexport const AggregateOperations = __anyStub;\nexport const DateDisplayFormat = __anyStub;\nexport const FieldMetadataSettingsOnClickAction = __anyStub;\nexport const FieldType = __anyStub;\nexport const HTTPMethod = __anyStub;\nexport const NavigationMenuItemType = __anyStub;\nexport const NumberDataType = __anyStub;\nexport const ObjectRecordGroupByDateGranularity = __anyStub;\nexport const OnDeleteAction = __anyStub;\nexport const PageLayoutTabLayoutMode = __anyStub;\nexport const RelationType = __anyStub;\nexport const STANDARD_OBJECT = __anyStub;\nexport const STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS = __anyStub;\nexport const STANDARD_PAGE_LAYOUT = __anyStub;\nexport const STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS = __anyStub;\nexport const SystemPermissionFlag = __anyStub;\nexport const ViewCalendarLayout = __anyStub;\nexport const ViewFilterGroupLogicalOperator = __anyStub;\nexport const ViewFilterOperand = __anyStub;\nexport const ViewKey = __anyStub;\nexport const ViewOpenRecordIn = __anyStub;\nexport const ViewSortDirection = __anyStub;\nexport const ViewType = __anyStub;\nexport const ViewVisibility = __anyStub;\nexport const canAccessFullAdminPanel = __anyStub;\nexport const canImpersonate = __anyStub;\nexport const every = __anyStub;\nexport const everyDefined = __anyStub;\nexport const everyEquals = __anyStub;\nexport const favoriteRecordIds = __anyStub;\nexport const featureFlags = __anyStub;\nexport const generateDefaultFieldUniversalIdentifier = __anyStub;\nexport const hasAnySoftDeleteFilterOnView = __anyStub;\nexport const includes = __anyStub;\nexport const includesEvery = __anyStub;\nexport const isDashboardPageLayoutInEditMode = __anyStub;\nexport const isDefined = __anyStub;\nexport const isInSidePanel = __anyStub;\nexport const isLayoutCustomizationModeEnabled = __anyStub;\nexport const isNonEmptyString = __anyStub;\nexport const isSelectAll = __anyStub;\nexport const none = __anyStub;\nexport const noneDefined = __anyStub;\nexport const noneEquals = __anyStub;\nexport const numberOfSelectedRecords = __anyStub;\nexport const objectMetadataItem = __anyStub;\nexport const objectMetadataLabel = __anyStub;\nexport const objectPermissions = __anyStub;\nexport const pageType = __anyStub;\nexport const selectedRecords = __anyStub;\nexport const some = __anyStub;\nexport const someDefined = __anyStub;\nexport const someEquals = __anyStub;\nexport const someNonEmptyString = __anyStub;\nexport const targetObjectReadPermissions = __anyStub;\nexport const targetObjectWritePermissions = __anyStub;\nexport const validateFields = __anyStub;\n", "export const APP_DISPLAY_NAME = \"Viginti Mobile Push\";\nexport const APP_DESCRIPTION =\n  \"Registers iOS and iPadOS devices for Viginti remote push notifications and relays task assignment events through a Cloudflare Worker to Firebase Cloud Messaging.\";\n\nexport const APPLICATION_UNIVERSAL_IDENTIFIER = \"05ce64a4-c1ee-4f4e-885c-bc1f7123a25b\";\nexport const DEFAULT_ROLE_UNIVERSAL_IDENTIFIER = \"4c8246e5-0a05-4155-816c-9ec4cb79c04b\";\nexport const RELAY_BASE_URL_VARIABLE_UNIVERSAL_IDENTIFIER =\n  \"06000b38-8fe0-413c-9b19-22afb1974ff5\";\nexport const POST_INSTALL_LOGIC_FUNCTION_UNIVERSAL_IDENTIFIER =\n  \"f9791ee7-af73-41e2-81aa-08bd9e29c876\";\nexport const STATUS_LOGIC_FUNCTION_UNIVERSAL_IDENTIFIER =\n  \"c80d22cf-ce36-485b-8bd3-07d9caf0ba33\";\nexport const REGISTER_LOGIC_FUNCTION_UNIVERSAL_IDENTIFIER =\n  \"806f4f64-9676-4af1-825c-bef656ab0fab\";\nexport const UNREGISTER_LOGIC_FUNCTION_UNIVERSAL_IDENTIFIER =\n  \"b768f8c5-e660-49ba-a302-e7b7cb7bb2c1\";\nexport const PREFERENCES_LOGIC_FUNCTION_UNIVERSAL_IDENTIFIER =\n  \"5b32dcbd-86dc-4f3b-adb6-e98eea298b69\";\nexport const TEST_LOGIC_FUNCTION_UNIVERSAL_IDENTIFIER =\n  \"ce6343cd-24f0-4faf-8c34-6ea5f5af4bda\";\nexport const TASK_CREATED_PUSH_LOGIC_FUNCTION_UNIVERSAL_IDENTIFIER =\n  \"b845b39b-aaad-42eb-82aa-97ac6742b8b4\";\nexport const TASK_UPDATED_PUSH_LOGIC_FUNCTION_UNIVERSAL_IDENTIFIER =\n  \"f7fda668-8229-427f-92f0-fb1521d2a067\";\n\nexport const PUSH_DEVICE_OBJECT_UNIVERSAL_IDENTIFIER =\n  \"9b8388f0-36f5-4cfc-8d4f-aaac5f358c05\";\nexport const PUSH_DEVICE_INDEX_UNIVERSAL_IDENTIFIER =\n  \"995bdfe7-9d9b-4e81-a8e3-f738e2ab5ded\";\nexport const PUSH_DEVICE_FIELD_UNIVERSAL_IDENTIFIERS = {\n  installationId: \"11672460-4bc9-4adc-9815-3a1e4580e4f7\",\n  workspaceMemberId: \"ea864f90-59e2-4f09-8be5-b431416731d5\",\n  fcmToken: \"91d5f03f-5fcc-417c-a97e-5d0ebf689564\",\n  tokenHash: \"7fa4054d-dd2e-4c10-b8fd-91318d1833c9\",\n  platform: \"35fde69d-4fcd-4b6d-b560-00f9bebd0d9d\",\n  environment: \"07e09c4a-d328-42fc-a0ef-d7f74c70262b\",\n  bundleIdentifier: \"4c8c1a24-36d8-4ec5-a983-8468be33f7e6\",\n  appVersion: \"ef80c428-1a95-4532-94be-bdbedea30fcc\",\n  buildNumber: \"220a51d3-a7aa-4ead-822b-7eaa0a8f0e39\",\n  deviceLocale: \"88e14f0c-511e-4671-bfb3-bd938965f893\",\n  timeZone: \"33469cde-22f6-47ca-818c-b4a4485c90d0\",\n  notificationsEnabled: \"081b6f77-1083-4d73-aff5-f210bf8e001a\",\n  taskAssignedEnabled: \"0996e12d-a6c1-4eef-a797-0d0646033736\",\n  taskDueDateChangedEnabled: \"30c399a9-2fd4-4c17-a98a-e1368f614c7e\",\n  taskCompletedEnabled: \"e0689b0a-95fd-4117-9c48-326e02830772\",\n  taskUnassignedEnabled: \"4a91a20a-199f-4f31-8e84-7f00b29e92fc\",\n  lastSeenAt: \"1f29217a-9bf6-4694-bed6-9f318941ead0\",\n  disabledAt: \"d9970b6e-ce54-4e4a-a66d-28b9ec8351d5\",\n  lastDeliveryError: \"cebc6621-f35a-4694-8f11-f04155d3081c\",\n} as const;\n", "/**\n * App configuration resolved from Twenty's injected runtime environment.\n */\nexport interface AppConfig {\n  /** Base URL of the Cloudflare relay, e.g. https://relay.example.workers.dev */\n  relayBaseUrl: string;\n  /** Twenty's application installation id, sent as X-Twenty-Push-Installation. */\n  installationId: string;\n  /** Twenty app access token injected into logic functions/install hooks. */\n  relayAuthToken: string;\n  /** Twenty API URL used by the relay to verify the app access token on install. */\n  twentyApiUrl: string;\n}\n\nexport class AppConfigError extends Error {}\n\nfunction normalizeHttpsUrl(value: string | undefined): string | null {\n  const trimmed = (value ?? \"\").trim().replace(/\\/+$/, \"\");\n  return /^https:\\/\\//.test(trimmed) ? trimmed : null;\n}\n\nfunction resolveTwentyApiUrl(env: Record<string, string | undefined>): string {\n  return (\n    normalizeHttpsUrl(env.API_URL) ??\n    normalizeHttpsUrl(env.TWENTY_API_URL) ??\n    normalizeHttpsUrl(env.SERVER_URL) ??\n    normalizeHttpsUrl(env.TWENTY_SERVER_URL) ??\n    \"https://api.twenty.com\"\n  );\n}\n\nexport function loadAppConfig(env: Record<string, string | undefined>): AppConfig {\n  const relayBaseUrl = normalizeHttpsUrl(env.RELAY_BASE_URL) ?? \"\";\n  const installationId = (env.APPLICATION_ID ?? env.RELAY_INSTALLATION_ID ?? \"\").trim();\n  const relayAuthToken = (env.APP_ACCESS_TOKEN ?? env.TWENTY_APP_ACCESS_TOKEN ?? \"\").trim();\n  const twentyApiUrl = resolveTwentyApiUrl(env);\n\n  if (!relayBaseUrl) {\n    throw new AppConfigError(\"RELAY_BASE_URL must be an https URL\");\n  }\n  if (!installationId) {\n    throw new AppConfigError(\"APPLICATION_ID is missing\");\n  }\n  if (!relayAuthToken) {\n    throw new AppConfigError(\"APP_ACCESS_TOKEN is missing\");\n  }\n  return { relayBaseUrl, installationId, relayAuthToken, twentyApiUrl };\n}\n\n/** True when the relay env is present and valid. Never throws. */\nexport function isRelayConfigured(env: Record<string, string | undefined>): boolean {\n  try {\n    loadAppConfig(env);\n    return true;\n  } catch {\n    return false;\n  }\n}\n", "/** Static metadata describing this app's push capabilities. */\n\nimport type { RemotePushEventType } from \"./types\";\n\nexport const SERVICE_NAME = \"viginti-mobile-push\";\nexport const APP_VERSION = \"1.0.5\";\n\n/** Event types the app's data model + relay understand. */\nexport const SUPPORTED_EVENTS: RemotePushEventType[] = [\n  \"task_assigned\",\n  \"task_due_date_changed\",\n  \"task_completed\",\n  \"task_unassigned\",\n];\n\n/** Event types actually wired to live triggers in this version. */\nexport const ACTIVE_EVENTS: RemotePushEventType[] = [\n  \"task_assigned\",\n  \"task_due_date_changed\",\n  \"task_completed\",\n  \"task_unassigned\",\n];\n", "/**\n * GET /push/status\n *\n * Lightweight installation/capability probe. The iOS app calls this before\n * attempting to register so it can detect whether the Viginti Mobile Push app is\n * installed in the current workspace:\n *\n *   - HTTP 200 with `{ installed: true, \u2026 }` \u2192 the app is installed.\n *   - The route is absent (Twenty returns 404) \u2192 the app is not installed.\n *\n * Returns only non-sensitive capability data: no secrets, no relay URL, no\n * tokens. `relayConfigured` reports whether the relay env is set, so an admin\n * can tell a \"installed but not configured\" state apart from a working one,\n * without exposing the configuration itself.\n */\n\nimport { ACTIVE_EVENTS, APP_VERSION, SERVICE_NAME, SUPPORTED_EVENTS } from \"../meta\";\nimport type { HandlerResult } from \"../types\";\n\nexport interface StatusDeps {\n  /** Whether RELAY_* env is present and valid (see loadAppConfig). */\n  relayConfigured: boolean;\n}\n\nexport function handleStatus(deps: StatusDeps): HandlerResult {\n  return {\n    status: 200,\n    body: {\n      installed: true,\n      service: SERVICE_NAME,\n      version: APP_VERSION,\n      supportedEvents: SUPPORTED_EVENTS,\n      activeEvents: ACTIVE_EVENTS,\n      relayConfigured: deps.relayConfigured,\n    },\n  };\n}\n", "import { defineLogicFunction } from \"twenty-sdk/define\";\n\nimport { STATUS_LOGIC_FUNCTION_UNIVERSAL_IDENTIFIER } from \"src/constants/universal-identifiers\";\nimport { isRelayConfigured } from \"src/config\";\nimport { handleStatus } from \"src/handlers/status\";\n\nconst handler = async () => {\n  return handleStatus({ relayConfigured: isRelayConfigured(process.env) }).body;\n};\n\nexport default defineLogicFunction({\n  universalIdentifier: STATUS_LOGIC_FUNCTION_UNIVERSAL_IDENTIFIER,\n  name: \"push-status\",\n  description: \"Reports Viginti mobile push installation and relay readiness.\",\n  timeoutSeconds: 2,\n  handler,\n  httpRouteTriggerSettings: {\n    path: \"/push/status\",\n    httpMethod: \"GET\",\n    isAuthRequired: true,\n  },\n});\n"],
  "mappings": ";;;;AAIA,IAAM,sBAAsB,CAAC,YAAY;AAAA,EACvC,SAAS;AAAA,EACT;AAAA,EACA,QAAQ,CAAC;AACX;AAEA,IAAM,eAAe;AAAA,EACnB,IAAI,SAAS,MAAM;AACjB,QAAI,SAAS,aAAc,QAAO;AAClC,QAAI,SAAS,OAAO,YAAa,QAAO,MAAM;AAC9C,QAAI,OAAO,SAAS,SAAU,QAAO;AACrC,WAAO,IAAI,MAAM,MAAM,QAAW,YAAY;AAAA,EAChD;AAAA,EACA,QAAQ;AACN,WAAO,IAAI,MAAM,MAAM,QAAW,YAAY;AAAA,EAChD;AACF;AACA,IAAM,YAAY,IAAI,MAAM,MAAM,QAAW,YAAY;AAWlD,IAAM,sBAAsB;;;ACtB5B,IAAM,6CACX;;;ACGK,IAAM,iBAAN,cAA6B,MAAM;AAAC;AAE3C,SAAS,kBAAkB,OAA0C;AACnE,QAAM,WAAW,SAAS,IAAI,KAAK,EAAE,QAAQ,QAAQ,EAAE;AACvD,SAAO,cAAc,KAAK,OAAO,IAAI,UAAU;AACjD;AAEA,SAAS,oBAAoB,KAAiD;AAC5E,SACE,kBAAkB,IAAI,OAAO,KAC7B,kBAAkB,IAAI,cAAc,KACpC,kBAAkB,IAAI,UAAU,KAChC,kBAAkB,IAAI,iBAAiB,KACvC;AAEJ;AAEO,SAAS,cAAc,KAAoD;AAChF,QAAM,eAAe,kBAAkB,IAAI,cAAc,KAAK;AAC9D,QAAM,kBAAkB,IAAI,kBAAkB,IAAI,yBAAyB,IAAI,KAAK;AACpF,QAAM,kBAAkB,IAAI,oBA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