@ankhorage/contracts 22.8.1 → 22.8.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.
Files changed (90) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +22 -1
  3. package/dist/appManifest/dataSources.js +1 -1
  4. package/dist/appManifest/dataSources.js.map +1 -1
  5. package/dist/appManifest/navigator.d.ts.map +1 -1
  6. package/dist/appManifest/navigator.js +1 -1
  7. package/dist/appManifest/navigator.js.map +1 -1
  8. package/dist/appManifest.d.ts +1 -1
  9. package/dist/appManifest.d.ts.map +1 -1
  10. package/dist/appManifest.js.map +1 -1
  11. package/dist/{appManifest/data.d.ts → data/dataValidation.d.ts} +1 -1
  12. package/dist/data/dataValidation.d.ts.map +1 -0
  13. package/dist/{appManifest/data.js → data/dataValidation.js} +19 -13
  14. package/dist/data/dataValidation.js.map +1 -0
  15. package/dist/{appManifest/apis.d.ts → data/isApiDefinitionRegistry.d.ts} +2 -2
  16. package/dist/data/isApiDefinitionRegistry.d.ts.map +1 -0
  17. package/dist/{appManifest/apis.js → data/isApiDefinitionRegistry.js} +4 -4
  18. package/dist/data/isApiDefinitionRegistry.js.map +1 -0
  19. package/dist/icon.d.ts.map +1 -0
  20. package/dist/{appManifest/icon.js → icon.js} +1 -1
  21. package/dist/icon.js.map +1 -0
  22. package/dist/infra/isInfraAdapterDescriptor.d.ts.map +1 -1
  23. package/dist/infra/isInfraAdapterDescriptor.js +1 -1
  24. package/dist/infra/isInfraAdapterDescriptor.js.map +1 -1
  25. package/dist/infra/isInfraAuthSpec.js +1 -1
  26. package/dist/infra/isInfraAuthSpec.js.map +1 -1
  27. package/dist/infra/isInfraDeploymentSpec.d.ts.map +1 -1
  28. package/dist/infra/isInfraDeploymentSpec.js +1 -1
  29. package/dist/infra/isInfraDeploymentSpec.js.map +1 -1
  30. package/dist/infra/isInfraEnvironmentSpec.d.ts.map +1 -1
  31. package/dist/infra/isInfraEnvironmentSpec.js +1 -1
  32. package/dist/infra/isInfraEnvironmentSpec.js.map +1 -1
  33. package/dist/infra/isInfraManifest.js +1 -1
  34. package/dist/infra/isInfraManifest.js.map +1 -1
  35. package/dist/infra/validateInfraAdapterSelection.d.ts.map +1 -1
  36. package/dist/infra/validateInfraAdapterSelection.js +1 -1
  37. package/dist/infra/validateInfraAdapterSelection.js.map +1 -1
  38. package/dist/infra.d.ts +1 -1
  39. package/dist/infra.d.ts.map +1 -1
  40. package/dist/infra.js +1 -1
  41. package/dist/infra.js.map +1 -1
  42. package/dist/{infra/constants.d.ts → infraCatalog.d.ts} +1 -1
  43. package/dist/infraCatalog.d.ts.map +1 -0
  44. package/dist/{infra/constants.js → infraCatalog.js} +1 -1
  45. package/dist/infraCatalog.js.map +1 -0
  46. package/dist/structure/generated.d.ts +2 -2
  47. package/dist/structure/generated.js +2 -2
  48. package/dist/structure/generated.js.map +1 -1
  49. package/dist/types/infraAdapters.d.ts +1 -1
  50. package/dist/types/infraAdapters.d.ts.map +1 -1
  51. package/dist/types/infraAdapters.js.map +1 -1
  52. package/dist/types/infraManifest.d.ts +1 -1
  53. package/dist/types/infraManifest.d.ts.map +1 -1
  54. package/dist/types/infraManifest.js.map +1 -1
  55. package/dist/types.d.ts +10 -1
  56. package/dist/types.d.ts.map +1 -1
  57. package/dist/types.js.map +1 -1
  58. package/package.json +7 -7
  59. package/src/appManifest/dataSources.ts +1 -1
  60. package/src/appManifest/navigator.ts +1 -1
  61. package/src/appManifest.ts +1 -5
  62. package/src/{appManifest/data.ts → data/dataValidation.ts} +20 -10
  63. package/src/{appManifest/apis.ts → data/isApiDefinitionRegistry.ts} +4 -4
  64. package/src/{appManifest/icon.ts → icon.ts} +1 -1
  65. package/src/infra/isInfraAdapterDescriptor.ts +1 -1
  66. package/src/infra/isInfraAuthSpec.ts +1 -1
  67. package/src/infra/isInfraDeploymentSpec.ts +1 -1
  68. package/src/infra/isInfraEnvironmentSpec.ts +1 -1
  69. package/src/infra/isInfraManifest.ts +1 -1
  70. package/src/infra/validateInfraAdapterSelection.ts +1 -1
  71. package/src/infra.ts +1 -1
  72. package/src/structure/generated.ts +2 -2
  73. package/src/types/infraAdapters.ts +1 -1
  74. package/src/types/infraManifest.ts +1 -1
  75. package/src/types.ts +13 -1
  76. package/dist/appManifest/apis.d.ts.map +0 -1
  77. package/dist/appManifest/apis.js.map +0 -1
  78. package/dist/appManifest/data.d.ts.map +0 -1
  79. package/dist/appManifest/data.js.map +0 -1
  80. package/dist/appManifest/icon.d.ts.map +0 -1
  81. package/dist/appManifest/icon.js.map +0 -1
  82. package/dist/appManifest/splashScreen.d.ts +0 -12
  83. package/dist/appManifest/splashScreen.d.ts.map +0 -1
  84. package/dist/appManifest/splashScreen.js +0 -2
  85. package/dist/appManifest/splashScreen.js.map +0 -1
  86. package/dist/infra/constants.d.ts.map +0 -1
  87. package/dist/infra/constants.js.map +0 -1
  88. package/src/appManifest/splashScreen.ts +0 -14
  89. /package/dist/{appManifest/icon.d.ts → icon.d.ts} +0 -0
  90. /package/src/{infra/constants.ts → infraCatalog.ts} +0 -0
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA6IA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,eAAe;IACf,uBAAuB;IACvB,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,eAAe;IACf,YAAY;IACZ,OAAO;IACP,iBAAiB;IACjB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,kBAAkB;IAClB,QAAQ;IACR,iBAAiB;IACjB,SAAS;CACD,CAAC;AAGX,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAU,CAAC;AAGrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AAGhF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,qBAAqB,CAAU,CAAC;AAGpF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,wBAAwB;IAC3B,WAAW;IACX,UAAU;IACV,aAAa;IACb,WAAW;CACH,CAAC;AAIX,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,YAAY,CAAU,CAAC;AAG3E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAGjF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,KAAK,EAAE,KAAK,CAAU,CAAC","sourcesContent":["import type { ColorHarmony } from '@ankhorage/color-theory';\n\nimport type { SplashScreenSpec } from './appManifest/splashScreen';\nimport type { AuthIdentifierKind, AuthSignUpField } from './auth';\nimport type {\n BindingValueSource,\n ComponentDataBindingRegistry,\n ScreenDataLoaderDefinition,\n} from './bindings';\nimport type { EntityRegistry } from './collections';\nimport type { DataSourceRegistry } from './data';\nimport type { AppDeployManifest } from './deploy';\nimport type { InfraManifest } from './infra';\nimport type { MediaAssetReference, MediaManifest } from './media';\nimport type { AppNavigatorManifest } from './navigator';\nimport type { RepositoryManifest } from './repository';\nimport type { ScreenRequirements } from './requirements';\nimport type { SerializableValue } from './serializable';\nimport type { AppStateSpec } from './state';\nimport type { ThemeGlobalTokenOverrides, ThemeRecipeOverrides } from './theme';\n\nexport interface ThemeModeConfig {\n primaryColor: string;\n harmony: ColorHarmony;\n}\n\nexport type ThemeId = string;\n\nexport interface ThemeConfig {\n id: ThemeId;\n name: string;\n light: ThemeModeConfig;\n dark: ThemeModeConfig;\n /** Theme-global authored token overrides shared by light and dark mode. */\n tokens?: ThemeGlobalTokenOverrides;\n /** Component/pattern recipe override values; recipe schemas remain package-owned metadata. */\n recipes?: ThemeRecipeOverrides;\n}\n\nexport type ThemeRegistry = EntityRegistry<ThemeId, ThemeConfig, 'id'>;\n\nexport type ActionType =\n 'navigate' | 'alert' | 'console' | 'toggleDarkMode' | 'setLanguage' | 'search' | 'filter';\n\nexport interface NavigateAction {\n type: 'navigate';\n payload: {\n route: string;\n params?: Record<string, number | string>;\n };\n}\n\nexport interface AlertAction {\n type: 'alert';\n payload?: {\n message?: string;\n };\n}\n\nexport interface ConsoleAction {\n type: 'console';\n payload?: Record<string, unknown>;\n}\n\nexport interface ToggleDarkModeAction {\n type: 'toggleDarkMode';\n payload?: never;\n}\n\nexport interface SetLanguageAction {\n type: 'setLanguage';\n payload: {\n locale: string;\n };\n}\n\nexport interface SearchAction {\n type: 'search';\n payload: {\n query: string;\n scope?: string;\n };\n}\n\nexport interface FilterAction {\n type: 'filter';\n payload: {\n filterKey: string;\n filterValue: string;\n };\n}\n\nexport type Action =\n | AlertAction\n | ConsoleAction\n | FilterAction\n | NavigateAction\n | SearchAction\n | SetLanguageAction\n | ToggleDarkModeAction;\n\nexport type ManifestValue = SerializableValue;\n\nexport type ComponentEventPayloadValue = ManifestValue;\n\nexport interface ComponentEventDto<\n TType extends string = string,\n TPayload extends object = Record<string, ComponentEventPayloadValue>,\n> {\n readonly type: TType;\n readonly sourceNodeId: string;\n readonly payload: TPayload;\n}\n\nexport type FormSubmitValues = Record<string, ComponentEventPayloadValue>;\n\nexport type FormSubmitEventDto = ComponentEventDto<\n 'form.submit',\n {\n readonly values: FormSubmitValues;\n }\n>;\n\nexport type ButtonPressEventDto = ComponentEventDto<'button.press', Record<string, never>>;\n\nexport interface CollectionItemPressPayload {\n readonly itemId: string | number;\n readonly item: Record<string, ComponentEventPayloadValue>;\n}\n\nexport type CollectionItemPressEventDto = ComponentEventDto<\n 'collection.itemPress',\n CollectionItemPressPayload\n>;\n\nexport type ComponentEventDtoKind =\n ButtonPressEventDto['type'] | CollectionItemPressEventDto['type'] | FormSubmitEventDto['type'];\n\nexport type KnownComponentEventDto =\n ButtonPressEventDto | CollectionItemPressEventDto | FormSubmitEventDto;\n\nexport const APP_CATEGORIES = [\n 'books_reading',\n 'business_productivity',\n 'developer_tools',\n 'education_learning',\n 'entertainment_media',\n 'finance_money',\n 'food_drink',\n 'games',\n 'graphics_design',\n 'health_fitness',\n 'kids_family',\n 'lifestyle',\n 'medical',\n 'music_audio',\n 'navigation_travel',\n 'news_magazines',\n 'photo_video',\n 'reference',\n 'shopping_commerce',\n 'social_community',\n 'sports',\n 'utilities_tools',\n 'weather',\n] as const;\nexport type AppCategory = (typeof APP_CATEGORIES)[number];\n\nexport const AUTH_SCOPES = ['global', 'none', 'integrated'] as const;\nexport type AuthScope = (typeof AUTH_SCOPES)[number];\n\nexport const AUTH_SIGN_IN_IDENTIFIERS = ['email', 'username', 'phone'] as const;\nexport type AuthSignInIdentifier = AuthIdentifierKind;\n\nexport const AUTH_SIGN_UP_POLICIES = ['autoSignIn', 'requireVerification'] as const;\nexport type AuthSignUpPolicy = (typeof AUTH_SIGN_UP_POLICIES)[number];\n\nexport const AUTH_PROFILE_FIELDS = [\n ...AUTH_SIGN_IN_IDENTIFIERS,\n 'firstName',\n 'lastName',\n 'displayName',\n 'avatarUrl',\n] as const;\nexport type KnownAuthProfileField = (typeof AUTH_PROFILE_FIELDS)[number];\nexport type AuthProfileField = KnownAuthProfileField | (string & {});\n\nexport const AUTH_PROFILE_PRIMARY_KEY_STRATEGIES = ['authUserId'] as const;\nexport type AuthProfilePrimaryKeyStrategy = (typeof AUTH_PROFILE_PRIMARY_KEY_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_CREATE_STRATEGIES = ['trigger', 'api', 'app'] as const;\nexport type AuthProfileCreateStrategy = (typeof AUTH_PROFILE_CREATE_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_UPDATE_STRATEGIES = ['api', 'app'] as const;\nexport type AuthProfileUpdateStrategy = (typeof AUTH_PROFILE_UPDATE_STRATEGIES)[number];\n\ninterface IconPresentationSpec {\n size?: number | string;\n color?: string;\n}\n\nexport interface NamedIconSpec extends IconPresentationSpec {\n name: string;\n provider?: string;\n source?: never;\n}\n\nexport interface SvgIconSpec extends IconPresentationSpec {\n source: MediaAssetReference;\n name?: never;\n provider?: never;\n}\n\nexport type IconSpec = NamedIconSpec | SvgIconSpec;\n\nexport interface UiNodeRepeatSpec {\n source: BindingValueSource;\n itemAlias?: string;\n keyPath?: string;\n empty?: readonly UiNode[];\n}\n\nexport interface UiNode {\n id: string;\n type: string;\n alias?: string;\n props?: Record<string, unknown>;\n children?: UiNode[];\n style?: Record<string, number | string>;\n repeat?: UiNodeRepeatSpec;\n}\n\nexport interface ScreenMetadataSpec {\n id: string;\n name: string;\n title?: string;\n description?: string;\n}\n\nexport interface ScreenSpec extends ScreenMetadataSpec {\n root: UiNode;\n dataLoaders?: readonly ScreenDataLoaderDefinition[];\n requires?: ScreenRequirements;\n}\n\nexport interface AuthSignInSpec {\n identifiers: AuthSignInIdentifier[];\n}\n\nexport interface AuthSignUpSpec {\n requiredFields: AuthSignUpField[];\n optionalFields?: AuthSignUpField[];\n signUpPolicy?: AuthSignUpPolicy;\n}\n\nexport interface AuthProfileSpec {\n fields: AuthProfileField[];\n table?: string;\n primaryKey?: AuthProfilePrimaryKeyStrategy;\n createStrategy?: AuthProfileCreateStrategy;\n updateStrategy?: AuthProfileUpdateStrategy;\n}\n\nexport interface AppSettings {\n localization: {\n defaultLocale: string;\n locales: string[];\n };\n}\n\nexport interface AppManifest {\n metadata: {\n name: string;\n slug: string;\n version: string;\n category: AppCategory;\n themeId: ThemeId;\n created?: string;\n updated?: string;\n };\n themes: ThemeRegistry;\n activeThemeId: ThemeId;\n activeThemeMode?: 'dark' | 'light';\n splashScreen?: SplashScreenSpec;\n /** Studio-managed authoring media. Runtime/user uploads are intentionally separate. */\n media?: MediaManifest;\n /** App distribution desired state, separate from environment-specific infrastructure. */\n deploy?: AppDeployManifest;\n /** Application runtime state is not provisioned by Infra. */\n state?: AppStateSpec;\n infra: InfraManifest;\n navigator: AppNavigatorManifest;\n screens: EntityRegistry<string, ScreenSpec, 'id'>;\n dataSources?: DataSourceRegistry;\n dataBindings?: ComponentDataBindingRegistry;\n repository?: RepositoryManifest;\n settings: AppSettings;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA4IA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,eAAe;IACf,uBAAuB;IACvB,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,eAAe;IACf,YAAY;IACZ,OAAO;IACP,iBAAiB;IACjB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,kBAAkB;IAClB,QAAQ;IACR,iBAAiB;IACjB,SAAS;CACD,CAAC;AAGX,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAU,CAAC;AAGrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AAGhF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,qBAAqB,CAAU,CAAC;AAGpF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,wBAAwB;IAC3B,WAAW;IACX,UAAU;IACV,aAAa;IACb,WAAW;CACH,CAAC;AAIX,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,YAAY,CAAU,CAAC;AAG3E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAGjF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,KAAK,EAAE,KAAK,CAAU,CAAC","sourcesContent":["import type { ColorHarmony } from '@ankhorage/color-theory';\n\nimport type { AuthIdentifierKind, AuthSignUpField } from './auth';\nimport type {\n BindingValueSource,\n ComponentDataBindingRegistry,\n ScreenDataLoaderDefinition,\n} from './bindings';\nimport type { EntityRegistry } from './collections';\nimport type { DataSourceRegistry } from './data';\nimport type { AppDeployManifest } from './deploy';\nimport type { InfraManifest } from './infra';\nimport type { MediaAssetReference, MediaManifest } from './media';\nimport type { AppNavigatorManifest } from './navigator';\nimport type { RepositoryManifest } from './repository';\nimport type { ScreenRequirements } from './requirements';\nimport type { SerializableValue } from './serializable';\nimport type { AppStateSpec } from './state';\nimport type { ThemeGlobalTokenOverrides, ThemeRecipeOverrides } from './theme';\n\nexport interface ThemeModeConfig {\n primaryColor: string;\n harmony: ColorHarmony;\n}\n\nexport type ThemeId = string;\n\nexport interface ThemeConfig {\n id: ThemeId;\n name: string;\n light: ThemeModeConfig;\n dark: ThemeModeConfig;\n /** Theme-global authored token overrides shared by light and dark mode. */\n tokens?: ThemeGlobalTokenOverrides;\n /** Component/pattern recipe override values; recipe schemas remain package-owned metadata. */\n recipes?: ThemeRecipeOverrides;\n}\n\nexport type ThemeRegistry = EntityRegistry<ThemeId, ThemeConfig, 'id'>;\n\nexport type ActionType =\n 'navigate' | 'alert' | 'console' | 'toggleDarkMode' | 'setLanguage' | 'search' | 'filter';\n\nexport interface NavigateAction {\n type: 'navigate';\n payload: {\n route: string;\n params?: Record<string, number | string>;\n };\n}\n\nexport interface AlertAction {\n type: 'alert';\n payload?: {\n message?: string;\n };\n}\n\nexport interface ConsoleAction {\n type: 'console';\n payload?: Record<string, unknown>;\n}\n\nexport interface ToggleDarkModeAction {\n type: 'toggleDarkMode';\n payload?: never;\n}\n\nexport interface SetLanguageAction {\n type: 'setLanguage';\n payload: {\n locale: string;\n };\n}\n\nexport interface SearchAction {\n type: 'search';\n payload: {\n query: string;\n scope?: string;\n };\n}\n\nexport interface FilterAction {\n type: 'filter';\n payload: {\n filterKey: string;\n filterValue: string;\n };\n}\n\nexport type Action =\n | AlertAction\n | ConsoleAction\n | FilterAction\n | NavigateAction\n | SearchAction\n | SetLanguageAction\n | ToggleDarkModeAction;\n\nexport type ManifestValue = SerializableValue;\n\nexport type ComponentEventPayloadValue = ManifestValue;\n\nexport interface ComponentEventDto<\n TType extends string = string,\n TPayload extends object = Record<string, ComponentEventPayloadValue>,\n> {\n readonly type: TType;\n readonly sourceNodeId: string;\n readonly payload: TPayload;\n}\n\nexport type FormSubmitValues = Record<string, ComponentEventPayloadValue>;\n\nexport type FormSubmitEventDto = ComponentEventDto<\n 'form.submit',\n {\n readonly values: FormSubmitValues;\n }\n>;\n\nexport type ButtonPressEventDto = ComponentEventDto<'button.press', Record<string, never>>;\n\nexport interface CollectionItemPressPayload {\n readonly itemId: string | number;\n readonly item: Record<string, ComponentEventPayloadValue>;\n}\n\nexport type CollectionItemPressEventDto = ComponentEventDto<\n 'collection.itemPress',\n CollectionItemPressPayload\n>;\n\nexport type ComponentEventDtoKind =\n ButtonPressEventDto['type'] | CollectionItemPressEventDto['type'] | FormSubmitEventDto['type'];\n\nexport type KnownComponentEventDto =\n ButtonPressEventDto | CollectionItemPressEventDto | FormSubmitEventDto;\n\nexport const APP_CATEGORIES = [\n 'books_reading',\n 'business_productivity',\n 'developer_tools',\n 'education_learning',\n 'entertainment_media',\n 'finance_money',\n 'food_drink',\n 'games',\n 'graphics_design',\n 'health_fitness',\n 'kids_family',\n 'lifestyle',\n 'medical',\n 'music_audio',\n 'navigation_travel',\n 'news_magazines',\n 'photo_video',\n 'reference',\n 'shopping_commerce',\n 'social_community',\n 'sports',\n 'utilities_tools',\n 'weather',\n] as const;\nexport type AppCategory = (typeof APP_CATEGORIES)[number];\n\nexport const AUTH_SCOPES = ['global', 'none', 'integrated'] as const;\nexport type AuthScope = (typeof AUTH_SCOPES)[number];\n\nexport const AUTH_SIGN_IN_IDENTIFIERS = ['email', 'username', 'phone'] as const;\nexport type AuthSignInIdentifier = AuthIdentifierKind;\n\nexport const AUTH_SIGN_UP_POLICIES = ['autoSignIn', 'requireVerification'] as const;\nexport type AuthSignUpPolicy = (typeof AUTH_SIGN_UP_POLICIES)[number];\n\nexport const AUTH_PROFILE_FIELDS = [\n ...AUTH_SIGN_IN_IDENTIFIERS,\n 'firstName',\n 'lastName',\n 'displayName',\n 'avatarUrl',\n] as const;\nexport type KnownAuthProfileField = (typeof AUTH_PROFILE_FIELDS)[number];\nexport type AuthProfileField = KnownAuthProfileField | (string & {});\n\nexport const AUTH_PROFILE_PRIMARY_KEY_STRATEGIES = ['authUserId'] as const;\nexport type AuthProfilePrimaryKeyStrategy = (typeof AUTH_PROFILE_PRIMARY_KEY_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_CREATE_STRATEGIES = ['trigger', 'api', 'app'] as const;\nexport type AuthProfileCreateStrategy = (typeof AUTH_PROFILE_CREATE_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_UPDATE_STRATEGIES = ['api', 'app'] as const;\nexport type AuthProfileUpdateStrategy = (typeof AUTH_PROFILE_UPDATE_STRATEGIES)[number];\n\ninterface IconPresentationSpec {\n size?: number | string;\n color?: string;\n}\n\nexport interface NamedIconSpec extends IconPresentationSpec {\n name: string;\n provider?: string;\n source?: never;\n}\n\nexport interface SvgIconSpec extends IconPresentationSpec {\n source: MediaAssetReference;\n name?: never;\n provider?: never;\n}\n\nexport type IconSpec = NamedIconSpec | SvgIconSpec;\n\nexport interface UiNodeRepeatSpec {\n source: BindingValueSource;\n itemAlias?: string;\n keyPath?: string;\n empty?: readonly UiNode[];\n}\n\nexport interface UiNode {\n id: string;\n type: string;\n alias?: string;\n props?: Record<string, unknown>;\n children?: UiNode[];\n style?: Record<string, number | string>;\n repeat?: UiNodeRepeatSpec;\n}\n\nexport interface ScreenMetadataSpec {\n id: string;\n name: string;\n title?: string;\n description?: string;\n}\n\nexport interface ScreenSpec extends ScreenMetadataSpec {\n root: UiNode;\n dataLoaders?: readonly ScreenDataLoaderDefinition[];\n requires?: ScreenRequirements;\n}\n\nexport interface AuthSignInSpec {\n identifiers: AuthSignInIdentifier[];\n}\n\nexport interface AuthSignUpSpec {\n requiredFields: AuthSignUpField[];\n optionalFields?: AuthSignUpField[];\n signUpPolicy?: AuthSignUpPolicy;\n}\n\nexport interface AuthProfileSpec {\n fields: AuthProfileField[];\n table?: string;\n primaryKey?: AuthProfilePrimaryKeyStrategy;\n createStrategy?: AuthProfileCreateStrategy;\n updateStrategy?: AuthProfileUpdateStrategy;\n}\n\nexport interface AppSettings {\n localization: {\n defaultLocale: string;\n locales: string[];\n };\n}\n\nexport type SplashScreenResizeMode = 'contain' | 'cover' | 'native';\n\nexport interface SplashScreenModeSpec {\n readonly backgroundColor?: string;\n readonly image?: MediaAssetReference;\n}\n\nexport interface SplashScreenSpec extends SplashScreenModeSpec {\n readonly imageWidth?: number;\n readonly resizeMode?: SplashScreenResizeMode;\n readonly dark?: SplashScreenModeSpec;\n}\n\nexport interface AppManifest {\n metadata: {\n name: string;\n slug: string;\n version: string;\n category: AppCategory;\n themeId: ThemeId;\n created?: string;\n updated?: string;\n };\n themes: ThemeRegistry;\n activeThemeId: ThemeId;\n activeThemeMode?: 'dark' | 'light';\n splashScreen?: SplashScreenSpec;\n /** Studio-managed authoring media. Runtime/user uploads are intentionally separate. */\n media?: MediaManifest;\n /** App distribution desired state, separate from environment-specific infrastructure. */\n deploy?: AppDeployManifest;\n /** Application runtime state is not provisioned by Infra. */\n state?: AppStateSpec;\n infra: InfraManifest;\n navigator: AppNavigatorManifest;\n screens: EntityRegistry<string, ScreenSpec, 'id'>;\n dataSources?: DataSourceRegistry;\n dataBindings?: ComponentDataBindingRegistry;\n repository?: RepositoryManifest;\n settings: AppSettings;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/contracts",
3
- "version": "22.8.1",
3
+ "version": "22.8.3",
4
4
  "main": "./dist/index.js",
5
5
  "ankh": {
6
6
  "category": "contracts",
@@ -44,14 +44,14 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@ankhorage/color-theory": "^0.3.1",
47
- "@ankhorage/utility": "^1.6.0"
47
+ "@ankhorage/utility": "^1.9.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@ankhorage/devtools": "^1.19.10",
51
- "@ankhorage/paradox": "^0.1.26",
52
- "@types/bun": "^1.4.1",
53
- "@types/node": "^25.2.3",
54
- "typescript": "^5.9.3"
50
+ "@ankhorage/devtools": "^2.0.12",
51
+ "@ankhorage/paradox": "^0.2.6",
52
+ "@types/bun": "^1.4.2",
53
+ "@types/node": "^26.6.3",
54
+ "typescript": "^6.0.3"
55
55
  },
56
56
  "exports": {
57
57
  ".": {
@@ -6,7 +6,7 @@ import {
6
6
  isCredentialRef,
7
7
  isDataEndpointRegistry,
8
8
  isDataSchemaRegistry,
9
- } from './data';
9
+ } from '../data/dataValidation';
10
10
  import { isManifestValue } from './isManifestValue';
11
11
 
12
12
  const DATABASE_SOURCE_KEYS = [
@@ -2,8 +2,8 @@ import { isStringArray } from '@ankhorage/utility/array';
2
2
  import { hasOnlyKeys, isRecord } from '@ankhorage/utility/object';
3
3
  import { isOptionalString } from '@ankhorage/utility/string';
4
4
 
5
+ import { isIconSpec } from '../icon';
5
6
  import { type AppNavigatorManifest, NAVIGATOR_PRESETS, NAVIGATOR_TYPES } from '../navigator';
6
- import { isIconSpec } from './icon';
7
7
  import {
8
8
  isDrawerNavigatorOptions,
9
9
  isNavigatorScreenReference,
@@ -1,8 +1,4 @@
1
1
  export { isAppManifest } from './appManifest/isAppManifest';
2
2
  export { parseAppManifest } from './appManifest/parseAppManifest';
3
- export type {
4
- SplashScreenModeSpec,
5
- SplashScreenResizeMode,
6
- SplashScreenSpec,
7
- } from './appManifest/splashScreen';
3
+ export type { SplashScreenModeSpec, SplashScreenResizeMode, SplashScreenSpec } from './types';
8
4
  export type { AppManifestParseResult } from './types/appManifest';
@@ -2,7 +2,7 @@ import { isStringArray } from '@ankhorage/utility/array';
2
2
  import { isRecord, readOwnProperty } from '@ankhorage/utility/object';
3
3
  import { isOptionalString } from '@ankhorage/utility/string';
4
4
 
5
- import { isManifestValue } from './isManifestValue';
5
+ import { isSerializableValue } from '../serializable';
6
6
 
7
7
  const DATA_SCHEMA_TYPES = new Set([
8
8
  'array',
@@ -51,7 +51,7 @@ export function isAdapterRef(value: unknown): boolean {
51
51
  typeof value.kind === 'string' &&
52
52
  isOptionalString(value.packageName) &&
53
53
  isOptionalString(value.exportName) &&
54
- (value.config === undefined || isManifestValue(value.config))
54
+ (value.config === undefined || isSerializableValue(value.config))
55
55
  );
56
56
  }
57
57
 
@@ -71,14 +71,18 @@ function isDataEndpointConfig(value: unknown): boolean {
71
71
  ([operationId, operation]) =>
72
72
  isDataOperationConfig(operation) && isRecord(operation) && operation.id === operationId,
73
73
  ) &&
74
- (value.metadata === undefined || isManifestValue(value.metadata))
74
+ (value.metadata === undefined || isSerializableValue(value.metadata))
75
75
  );
76
76
  }
77
77
 
78
78
  /*** Validate operation protocol, intent, request and response configuration. */
79
79
  function isDataOperationConfig(value: unknown): boolean {
80
+ return isRecord(value) && isDataOperationIdentity(value) && isDataOperationDetails(value);
81
+ }
82
+
83
+ /*** Validate operation identity, protocol and routing fields. */
84
+ function isDataOperationIdentity(value: Record<string, unknown>): boolean {
80
85
  return (
81
- isRecord(value) &&
82
86
  typeof value.id === 'string' &&
83
87
  isOptionalString(value.endpointId) &&
84
88
  isOptionalString(value.name) &&
@@ -87,12 +91,18 @@ function isDataOperationConfig(value: unknown): boolean {
87
91
  typeof value.intent === 'string' &&
88
92
  OPERATION_INTENTS.has(value.intent) &&
89
93
  isOptionalString(value.method) &&
90
- isOptionalString(value.path) &&
94
+ isOptionalString(value.path)
95
+ );
96
+ }
97
+
98
+ /*** Validate operation request, response and authored metadata. */
99
+ function isDataOperationDetails(value: Record<string, unknown>): boolean {
100
+ return (
91
101
  (value.request === undefined || isDataOperationRequest(value.request)) &&
92
102
  (value.response === undefined || isDataOperationResponse(value.response)) &&
93
103
  (value.pagination === undefined || isRecord(value.pagination)) &&
94
104
  (value.credential === undefined || isCredentialRef(value.credential)) &&
95
- (value.metadata === undefined || isManifestValue(value.metadata))
105
+ (value.metadata === undefined || isSerializableValue(value.metadata))
96
106
  );
97
107
  }
98
108
 
@@ -117,7 +127,7 @@ function isDataOperationParameter(value: unknown): boolean {
117
127
  PARAMETER_LOCATIONS.has(value.location) &&
118
128
  (value.required === undefined || typeof value.required === 'boolean') &&
119
129
  isOptionalString(value.description) &&
120
- (value.default === undefined || isManifestValue(value.default))
130
+ (value.default === undefined || isSerializableValue(value.default))
121
131
  );
122
132
  }
123
133
 
@@ -167,10 +177,10 @@ function isOptionalSchemaScalars(value: Record<string, unknown>): boolean {
167
177
  isOptionalString(value.description) &&
168
178
  isOptionalString(value.format) &&
169
179
  (value.nullable === undefined || typeof value.nullable === 'boolean') &&
170
- (value.const === undefined || isManifestValue(value.const)) &&
171
- (value.default === undefined || isManifestValue(value.default)) &&
180
+ (value.const === undefined || isSerializableValue(value.const)) &&
181
+ (value.default === undefined || isSerializableValue(value.default)) &&
172
182
  (value.enum === undefined ||
173
- (Array.isArray(value.enum) && value.enum.every(isManifestValue))) &&
183
+ (Array.isArray(value.enum) && value.enum.every(isSerializableValue))) &&
174
184
  (value.ref === undefined || isDataSchemaRef(value.ref))
175
185
  );
176
186
  }
@@ -1,9 +1,9 @@
1
1
  import { hasOnlyKeys, isRecord } from '@ankhorage/utility/object';
2
2
  import { isNonEmptyString, isOptionalString } from '@ankhorage/utility/string';
3
3
 
4
- import type { ApiDefinition, ApiDefinitionRegistry } from '../data';
5
- import { isCredentialRef, isDataEndpointRegistry, isDataSchemaRegistry } from './data';
6
- import { isManifestValue } from './isManifestValue';
4
+ import { isSerializableValue } from '../serializable';
5
+ import type { ApiDefinition, ApiDefinitionRegistry } from './apis';
6
+ import { isCredentialRef, isDataEndpointRegistry, isDataSchemaRegistry } from './dataValidation';
7
7
 
8
8
  const API_BASE_KEYS = [
9
9
  'id',
@@ -54,7 +54,7 @@ function isApiBaseDefinition(value: unknown): value is Record<string, unknown> {
54
54
  (value.credential === undefined || isCredentialRef(value.credential)) &&
55
55
  isDataEndpointRegistry(value.endpoints) &&
56
56
  (value.schemas === undefined || isDataSchemaRegistry(value.schemas)) &&
57
- (value.metadata === undefined || isManifestValue(value.metadata))
57
+ (value.metadata === undefined || isSerializableValue(value.metadata))
58
58
  );
59
59
  }
60
60
 
@@ -1,7 +1,7 @@
1
1
  import { isRecord } from '@ankhorage/utility/object';
2
2
  import { isOptionalString } from '@ankhorage/utility/string';
3
3
 
4
- import { isMediaAssetReference } from '../media';
4
+ import { isMediaAssetReference } from './media';
5
5
 
6
6
  /*** Validate a serializable icon as either a named font glyph or an SVG media reference. */
7
7
  export function isIconSpec(value: unknown): boolean {
@@ -1,7 +1,7 @@
1
1
  import { isRecord } from '@ankhorage/utility/object';
2
2
 
3
+ import { INFRA_ADAPTER_CATALOG } from '../infraCatalog';
3
4
  import type { InfraAdapterDescriptor } from '../types/infraAdapters';
4
- import { INFRA_ADAPTER_CATALOG } from './constants';
5
5
  import { isInfraShape } from './isInfraShape';
6
6
 
7
7
  /*** Installed adapters must match the canonical identity, capabilities, targets and config version exactly. */
@@ -2,8 +2,8 @@ import { isStringArray } from '@ankhorage/utility/array';
2
2
  import { isRecordOf } from '@ankhorage/utility/object';
3
3
  import { isOptionalString } from '@ankhorage/utility/string';
4
4
 
5
- import { isIconSpec } from '../appManifest/icon';
6
5
  import { AUTH_OAUTH_PROVIDER_IDS } from '../auth';
6
+ import { isIconSpec } from '../icon';
7
7
  import {
8
8
  AUTH_PROFILE_CREATE_STRATEGIES,
9
9
  AUTH_PROFILE_PRIMARY_KEY_STRATEGIES,
@@ -1,13 +1,13 @@
1
1
  import { isRecord } from '@ankhorage/utility/object';
2
2
  import { isNonEmptyString } from '@ankhorage/utility/string';
3
3
 
4
+ import { INFRA_RUNTIME_COMPATIBILITY } from '../infraCatalog';
4
5
  import type {
5
6
  InfraComputeSelection,
6
7
  InfraDeploymentSpec,
7
8
  InfraRuntimeSelection,
8
9
  } from '../types/infraManifest';
9
10
  import type { InfraShape } from '../types/infraValidation';
10
- import { INFRA_RUNTIME_COMPATIBILITY } from './constants';
11
11
  import { infraFields } from './infraFields';
12
12
  import { isInfraCredentialRef } from './isInfraCredentialRef';
13
13
  import { isInfraShape } from './isInfraShape';
@@ -2,6 +2,7 @@ import { isRecord } from '@ankhorage/utility/object';
2
2
  import { isNonEmptyString } from '@ankhorage/utility/string';
3
3
 
4
4
  import { isSerializableSet } from '../collections';
5
+ import { INFRA_ADAPTER_CATALOG } from '../infraCatalog';
5
6
  import type {
6
7
  InfraEnvironmentSpec,
7
8
  InfraObjectStorageSpec,
@@ -9,7 +10,6 @@ import type {
9
10
  InfraScheduledDatabaseBackupSpec,
10
11
  } from '../types/infraManifest';
11
12
  import type { InfraShape } from '../types/infraValidation';
12
- import { INFRA_ADAPTER_CATALOG } from './constants';
13
13
  import { infraFields } from './infraFields';
14
14
  import { isInfraAuthSpec } from './isInfraAuthSpec';
15
15
  import { isInfraCredentialRef } from './isInfraCredentialRef';
@@ -1,6 +1,6 @@
1
1
  import { isRecord } from '@ankhorage/utility/object';
2
2
 
3
- import { isApiDefinitionRegistry } from '../appManifest/apis';
3
+ import { isApiDefinitionRegistry } from '../data/isApiDefinitionRegistry';
4
4
  import { APP_ENVIRONMENT_IDS } from '../environments';
5
5
  import { isSerializableValue } from '../serializable';
6
6
  import type { InfraManifest, InfraModuleSpec } from '../types/infraManifest';
@@ -1,7 +1,7 @@
1
+ import { INFRA_ADAPTER_CATALOG } from '../infraCatalog';
1
2
  import type { InfraAdapterDescriptor } from '../types/infraAdapters';
2
3
  import type { InfraDiagnostic, InfraResult } from '../types/infraLifecycle';
3
4
  import type { InfraEnvironmentSpec } from '../types/infraManifest';
4
- import { INFRA_ADAPTER_CATALOG } from './constants';
5
5
  import { isInfraAdapterDescriptor } from './isInfraAdapterDescriptor';
6
6
 
7
7
  /** Validate supplied installed descriptors without imports or filesystem access; only selected packages matter. */
package/src/infra.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  /** Canonical standalone infrastructure contracts, catalog and side-effect-free validation. */
2
- export { INFRA_ADAPTER_CATALOG, INFRA_RUNTIME_COMPATIBILITY } from './infra/constants';
3
2
  export { isInfraAdapterDescriptor } from './infra/isInfraAdapterDescriptor';
4
3
  export { isInfraAuthSpec } from './infra/isInfraAuthSpec';
5
4
  export { isInfraDeploymentSpec } from './infra/isInfraDeploymentSpec';
@@ -8,6 +7,7 @@ export { isInfraManifest } from './infra/isInfraManifest';
8
7
  export { isInfraWorkloadSpec } from './infra/isInfraWorkloadSpec';
9
8
  export { parseInfraManifest } from './infra/parseInfraManifest';
10
9
  export { validateInfraAdapterSelection } from './infra/validateInfraAdapterSelection';
10
+ export { INFRA_ADAPTER_CATALOG, INFRA_RUNTIME_COMPATIBILITY } from './infraCatalog';
11
11
  export type * from './types/infraAdapters';
12
12
  export type * from './types/infraLifecycle';
13
13
  export type * from './types/infraManifest';
@@ -2,12 +2,12 @@
2
2
  import type { StructureDescriptorDocument } from '@ankhorage/contracts/structure';
3
3
 
4
4
  export const STRUCTURE_DESCRIPTOR_COMPILER_VERSION = '6.0.3';
5
- export const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:1eb427768a3677ee33c89cff9bc93ddb9fbf456403a2eb022db3d2ece77fcaeb';
5
+ export const STRUCTURE_DESCRIPTOR_FINGERPRINT = 'sha256:23701b58d2d2e1f329db46aa539696971e299e7b48e620e3f39cc520cfa35312';
6
6
 
7
7
  export const STRUCTURE_DESCRIPTOR = {
8
8
  "protocolVersion": 1,
9
9
  "packageName": "@ankhorage/contracts",
10
- "packageVersion": "22.8.1",
10
+ "packageVersion": "22.8.3",
11
11
  "roots": {
12
12
  "auth-flow": "AuthFlowConfig",
13
13
  "auth-profile": "AuthProfileSpec",
@@ -1,5 +1,5 @@
1
1
  import type { AppEnvironmentId } from '../environments';
2
- import type { INFRA_ADAPTER_CATALOG } from '../infra/constants';
2
+ import type { INFRA_ADAPTER_CATALOG } from '../infraCatalog';
3
3
  import type {
4
4
  InfraDestroyRequest,
5
5
  InfraGeneratedArtifact,
@@ -2,7 +2,7 @@ import type { AuthFlowConfig, AuthOAuthConfig } from '../auth';
2
2
  import type { EntityRegistry, SerializableSet, ValueMap } from '../collections';
3
3
  import type { ApiDefinitionRegistry, DataContractValue } from '../data';
4
4
  import type { AppEnvironmentId } from '../environments';
5
- import type { INFRA_ADAPTER_CATALOG, INFRA_RUNTIME_COMPATIBILITY } from '../infra/constants';
5
+ import type { INFRA_ADAPTER_CATALOG, INFRA_RUNTIME_COMPATIBILITY } from '../infraCatalog';
6
6
  import type { AuthProfileSpec, AuthScope, AuthSignInSpec, AuthSignUpSpec } from '../types';
7
7
  import type { InfraControlPlaneCredentialRef } from './infraSecrets';
8
8
  import type { InfraWorkloadRegistry } from './infraWorkload';
package/src/types.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import type { ColorHarmony } from '@ankhorage/color-theory';
2
2
 
3
- import type { SplashScreenSpec } from './appManifest/splashScreen';
4
3
  import type { AuthIdentifierKind, AuthSignUpField } from './auth';
5
4
  import type {
6
5
  BindingValueSource,
@@ -268,6 +267,19 @@ export interface AppSettings {
268
267
  };
269
268
  }
270
269
 
270
+ export type SplashScreenResizeMode = 'contain' | 'cover' | 'native';
271
+
272
+ export interface SplashScreenModeSpec {
273
+ readonly backgroundColor?: string;
274
+ readonly image?: MediaAssetReference;
275
+ }
276
+
277
+ export interface SplashScreenSpec extends SplashScreenModeSpec {
278
+ readonly imageWidth?: number;
279
+ readonly resizeMode?: SplashScreenResizeMode;
280
+ readonly dark?: SplashScreenModeSpec;
281
+ }
282
+
271
283
  export interface AppManifest {
272
284
  metadata: {
273
285
  name: string;
@@ -1 +0,0 @@
1
- {"version":3,"file":"apis.d.ts","sourceRoot":"","sources":["../../src/appManifest/apis.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiB,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAqBpE,gGAAgG;AAChG,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,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["import { hasOnlyKeys, isRecord } from '@ankhorage/utility/object';\nimport { isNonEmptyString, isOptionalString } from '@ankhorage/utility/string';\n\nimport type { ApiDefinition, ApiDefinitionRegistry } from '../data';\nimport { isCredentialRef, isDataEndpointRegistry, isDataSchemaRegistry } from './data';\nimport { isManifestValue } from './isManifestValue';\n\nconst API_BASE_KEYS = [\n 'id',\n 'origin',\n 'protocol',\n 'name',\n 'description',\n 'credential',\n 'endpoints',\n 'schemas',\n 'metadata',\n] as const;\nconst EXTERNAL_REST_KEYS = [...API_BASE_KEYS, 'baseUrl', 'openApi'] as const;\nconst EXTERNAL_GRAPHQL_KEYS = [...API_BASE_KEYS, 'endpointUrl', 'introspection'] as const;\nconst INTERNAL_REST_KEYS = [...API_BASE_KEYS, 'basePath'] as const;\nconst OPEN_API_KEYS = ['url', 'documentId', 'version'] as const;\nconst INTROSPECTION_KEYS = ['enabled', 'schemaVersion'] as const;\n\n/*** Validate API definitions in the canonical registry and require key/identity consistency. */\nexport function isApiDefinitionRegistry(value: unknown): value is ApiDefinitionRegistry {\n return (\n isRecord(value) &&\n Object.entries(value).every(\n ([registryKey, api]) => isApiDefinition(api) && registryKey === api.id,\n )\n );\n}\n\n/*** Validate one API definition against its origin and protocol branch. */\nfunction isApiDefinition(value: unknown): value is ApiDefinition {\n if (!isApiBaseDefinition(value)) return false;\n if (value.origin === 'external' && value.protocol === 'rest') return isExternalRestApi(value);\n if (value.origin === 'external' && value.protocol === 'graphql') {\n return isExternalGraphQlApi(value);\n }\n if (value.origin === 'internal' && value.protocol === 'rest') return isInternalRestApi(value);\n return false;\n}\n\n/*** Validate common API identity, endpoint, schema and authored metadata fields. */\nfunction isApiBaseDefinition(value: unknown): value is Record<string, unknown> {\n return (\n isRecord(value) &&\n isNonEmptyString(value.id) &&\n (value.origin === 'external' || value.origin === 'internal') &&\n (value.protocol === 'graphql' || value.protocol === 'rest') &&\n [value.name, value.description].every(isOptionalString) &&\n (value.credential === undefined || isCredentialRef(value.credential)) &&\n isDataEndpointRegistry(value.endpoints) &&\n (value.schemas === undefined || isDataSchemaRegistry(value.schemas)) &&\n (value.metadata === undefined || isManifestValue(value.metadata))\n );\n}\n\n/*** Validate external REST endpoint and optional OpenAPI metadata. */\nfunction isExternalRestApi(value: Record<string, unknown>): boolean {\n return (\n hasOnlyKeys(value, EXTERNAL_REST_KEYS) &&\n isNonEmptyString(value.baseUrl) &&\n (value.openApi === undefined || isOpenApiDocumentRef(value.openApi))\n );\n}\n\n/*** Validate external GraphQL endpoint and optional introspection metadata. */\nfunction isExternalGraphQlApi(value: Record<string, unknown>): boolean {\n return (\n hasOnlyKeys(value, EXTERNAL_GRAPHQL_KEYS) &&\n isNonEmptyString(value.endpointUrl) &&\n (value.introspection === undefined || isGraphQlIntrospection(value.introspection))\n );\n}\n\n/*** Validate the supported internal REST API configuration. */\nfunction isInternalRestApi(value: Record<string, unknown>): boolean {\n return hasOnlyKeys(value, INTERNAL_REST_KEYS) && isNonEmptyString(value.basePath);\n}\n\n/*** Validate optional OpenAPI document location and version fields. */\nfunction isOpenApiDocumentRef(value: unknown): boolean {\n return (\n isRecord(value) &&\n hasOnlyKeys(value, OPEN_API_KEYS) &&\n isOptionalString(value.url) &&\n isOptionalString(value.documentId) &&\n isOptionalString(value.version)\n );\n}\n\n/*** Validate explicit GraphQL introspection settings. */\nfunction isGraphQlIntrospection(value: unknown): boolean {\n return (\n isRecord(value) &&\n hasOnlyKeys(value, INTROSPECTION_KEYS) &&\n typeof value.enabled === 'boolean' &&\n isOptionalString(value.schemaVersion)\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/appManifest/data.ts"],"names":[],"mappings":"AAkBA,8DAA8D;AAC9D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQ9D;AAED,0DAA0D;AAC1D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE5D;AAED,uEAAuE;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KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CACzD,CAAC;AACJ,CAAC;AAED,gEAAgE;AAChE,SAAS,2BAA2B,CAAC,KAA8B;IACjE,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QAC/C,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC1C,OAAO,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;AACL,CAAC;AAED,0CAA0C;AAC1C,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ,CAAC;AACzD,CAAC","sourcesContent":["import { isStringArray } from '@ankhorage/utility/array';\nimport { isRecord, readOwnProperty } from '@ankhorage/utility/object';\nimport { isOptionalString } from '@ankhorage/utility/string';\n\nimport { isManifestValue } from './isManifestValue';\n\nconst DATA_SCHEMA_TYPES = new Set([\n 'array',\n 'boolean',\n 'integer',\n 'null',\n 'number',\n 'object',\n 'string',\n]);\nconst OPERATION_INTENTS = new Set(['action', 'create', 'delete', 'read', 'update']);\nconst PARAMETER_LOCATIONS = new Set(['body', 'cookie', 'header', 'path', 'query']);\n\n/*** Validate every endpoint in the data endpoint registry. */\nexport function isDataEndpointRegistry(value: unknown): boolean {\n return (\n isRecord(value) &&\n Object.entries(value).every(\n ([endpointId, endpoint]) =>\n isDataEndpointConfig(endpoint) && isRecord(endpoint) && endpoint.id === endpointId,\n )\n );\n}\n\n/*** Validate every schema in the data schema registry. */\nexport function isDataSchemaRegistry(value: unknown): boolean {\n return isRecord(value) && Object.values(value).every(isDataSchema);\n}\n\n/*** Validate credential identity and optional descriptive metadata. */\nexport function isCredentialRef(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.id === 'string' &&\n typeof value.kind === 'string' &&\n isOptionalString(value.label) &&\n isOptionalString(value.scope)\n );\n}\n\n/*** Validate an adapter reference and its optional authored configuration. */\nexport function isAdapterRef(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.id === 'string' &&\n typeof value.kind === 'string' &&\n isOptionalString(value.packageName) &&\n isOptionalString(value.exportName) &&\n (value.config === undefined || isManifestValue(value.config))\n );\n}\n\n/*** Validate endpoint identity, operations and optional connection metadata. */\nfunction isDataEndpointConfig(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.id === 'string' &&\n typeof value.kind === 'string' &&\n isOptionalString(value.name) &&\n isOptionalString(value.description) &&\n isOptionalString(value.baseUrl) &&\n isOptionalString(value.path) &&\n (value.credential === undefined || isCredentialRef(value.credential)) &&\n isRecord(value.operations) &&\n Object.entries(value.operations).every(\n ([operationId, operation]) =>\n isDataOperationConfig(operation) && isRecord(operation) && operation.id === operationId,\n ) &&\n (value.metadata === undefined || isManifestValue(value.metadata))\n );\n}\n\n/*** Validate operation protocol, intent, request and response configuration. */\nfunction isDataOperationConfig(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.id === 'string' &&\n isOptionalString(value.endpointId) &&\n isOptionalString(value.name) &&\n isOptionalString(value.description) &&\n typeof value.protocol === 'string' &&\n typeof value.intent === 'string' &&\n OPERATION_INTENTS.has(value.intent) &&\n isOptionalString(value.method) &&\n isOptionalString(value.path) &&\n (value.request === undefined || isDataOperationRequest(value.request)) &&\n (value.response === undefined || isDataOperationResponse(value.response)) &&\n (value.pagination === undefined || isRecord(value.pagination)) &&\n (value.credential === undefined || isCredentialRef(value.credential)) &&\n (value.metadata === undefined || isManifestValue(value.metadata))\n );\n}\n\n/*** Validate request schema, parameters and optional content type. */\nfunction isDataOperationRequest(value: unknown): boolean {\n return (\n isRecord(value) &&\n isDataSchemaSlot(value) &&\n isOptionalString(value.contentType) &&\n (value.parameters === undefined ||\n (Array.isArray(value.parameters) && value.parameters.every(isDataOperationParameter)))\n );\n}\n\n/*** Validate parameter identity, location, schema and optional default value. */\nfunction isDataOperationParameter(value: unknown): boolean {\n return (\n isRecord(value) &&\n isDataSchemaSlot(value) &&\n typeof value.name === 'string' &&\n typeof value.location === 'string' &&\n PARAMETER_LOCATIONS.has(value.location) &&\n (value.required === undefined || typeof value.required === 'boolean') &&\n isOptionalString(value.description) &&\n (value.default === undefined || isManifestValue(value.default))\n );\n}\n\n/*** Validate response status, schema and optional descriptive metadata. */\nfunction isDataOperationResponse(value: unknown): boolean {\n return (\n isRecord(value) &&\n isDataSchemaSlot(value) &&\n (value.status === undefined ||\n typeof value.status === 'string' ||\n typeof value.status === 'number') &&\n isOptionalString(value.contentType) &&\n isOptionalString(value.description)\n );\n}\n\n/*** Validate inline schema and schema-reference fields. */\nfunction isDataSchemaSlot(value: Record<string, unknown>): boolean {\n return (\n (value.schema === undefined || isDataSchema(value.schema)) &&\n (value.schemaRef === undefined || isDataSchemaRef(value.schemaRef))\n );\n}\n\n/*** Validate supported schema types, constraints and compositions. */\nfunction isDataSchema(value: unknown): boolean {\n if (!isRecord(value) || !isDataSchemaType(value.type)) return false;\n if (!isOptionalSchemaScalars(value)) return false;\n if (!isOptionalSchemaCollections(value)) return false;\n return isOptionalSchemaComposition(value);\n}\n\n/*** Validate a supported schema type or an array of supported types. */\nfunction isDataSchemaType(value: unknown): boolean {\n if (value === undefined) return true;\n if (typeof value === 'string') return DATA_SCHEMA_TYPES.has(value);\n return (\n Array.isArray(value) &&\n value.every((entry) => typeof entry === 'string' && DATA_SCHEMA_TYPES.has(entry))\n );\n}\n\n/*** Validate optional scalar schema constraints. */\nfunction isOptionalSchemaScalars(value: Record<string, unknown>): boolean {\n return (\n isOptionalString(value.title) &&\n isOptionalString(value.description) &&\n isOptionalString(value.format) &&\n (value.nullable === undefined || typeof value.nullable === 'boolean') &&\n (value.const === undefined || isManifestValue(value.const)) &&\n (value.default === undefined || isManifestValue(value.default)) &&\n (value.enum === undefined ||\n (Array.isArray(value.enum) && value.enum.every(isManifestValue))) &&\n (value.ref === undefined || isDataSchemaRef(value.ref))\n );\n}\n\n/*** Validate optional schema properties, items and required fields. */\nfunction isOptionalSchemaCollections(value: Record<string, unknown>): boolean {\n return (\n (value.required === undefined || isStringArray(value.required)) &&\n (value.properties === undefined ||\n (isRecord(value.properties) && Object.values(value.properties).every(isDataSchema))) &&\n (value.additionalProperties === undefined ||\n typeof value.additionalProperties === 'boolean' ||\n isDataSchema(value.additionalProperties)) &&\n (value.items === undefined || isDataSchema(value.items))\n );\n}\n\n/*** Validate optional schema alternatives and intersections. */\nfunction isOptionalSchemaComposition(value: Record<string, unknown>): boolean {\n return ['allOf', 'anyOf', 'oneOf'].every((key) => {\n const entry = readOwnProperty(value, key);\n return entry === undefined || (Array.isArray(entry) && entry.every(isDataSchema));\n });\n}\n\n/*** Validate a named schema reference. */\nfunction isDataSchemaRef(value: unknown): boolean {\n return isRecord(value) && typeof value.id === 'string';\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/appManifest/icon.ts"],"names":[],"mappings":"AAKA,4FAA4F;AAC5F,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAqBlD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon.js","sourceRoot":"","sources":["../../src/appManifest/icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD,4FAA4F;AAC5F,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEnC,MAAM,oBAAoB,GACxB,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS;QACvB,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAC9B,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;QACjC,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChC,IAAI,CAAC,oBAAoB;QAAE,OAAO,KAAK,CAAC;IAExC,IAAI,QAAQ,IAAI,KAAK,EAAE,CAAC;QACtB,OAAO,CACL,qBAAqB,CAAC,KAAK,CAAC,MAAM,CAAC;YACnC,KAAK,CAAC,IAAI,KAAK,SAAS;YACxB,KAAK,CAAC,QAAQ,KAAK,SAAS,CAC7B,CAAC;IACJ,CAAC;IAED,OAAO,CACL,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,gBAAgB,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,CACjG,CAAC;AACJ,CAAC","sourcesContent":["import { isRecord } from '@ankhorage/utility/object';\nimport { isOptionalString } from '@ankhorage/utility/string';\n\nimport { isMediaAssetReference } from '../media';\n\n/*** Validate a serializable icon as either a named font glyph or an SVG media reference. */\nexport function isIconSpec(value: unknown): boolean {\n if (!isRecord(value)) return false;\n\n const hasValidPresentation =\n (value.size === undefined ||\n typeof value.size === 'string' ||\n typeof value.size === 'number') &&\n isOptionalString(value.color);\n if (!hasValidPresentation) return false;\n\n if ('source' in value) {\n return (\n isMediaAssetReference(value.source) &&\n value.name === undefined &&\n value.provider === undefined\n );\n }\n\n return (\n typeof value.name === 'string' && isOptionalString(value.provider) && value.source === undefined\n );\n}\n"]}
@@ -1,12 +0,0 @@
1
- import type { MediaAssetReference } from '../media';
2
- export type SplashScreenResizeMode = 'contain' | 'cover' | 'native';
3
- export interface SplashScreenModeSpec {
4
- readonly backgroundColor?: string;
5
- readonly image?: MediaAssetReference;
6
- }
7
- export interface SplashScreenSpec extends SplashScreenModeSpec {
8
- readonly imageWidth?: number;
9
- readonly resizeMode?: SplashScreenResizeMode;
10
- readonly dark?: SplashScreenModeSpec;
11
- }
12
- //# sourceMappingURL=splashScreen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"splashScreen.d.ts","sourceRoot":"","sources":["../../src/appManifest/splashScreen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEpE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,mBAAmB,CAAC;CACtC;AAED,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC5D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,sBAAsB,CAAC;IAC7C,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC;CACtC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=splashScreen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"splashScreen.js","sourceRoot":"","sources":["../../src/appManifest/splashScreen.ts"],"names":[],"mappings":"","sourcesContent":["import type { MediaAssetReference } from '../media';\n\nexport type SplashScreenResizeMode = 'contain' | 'cover' | 'native';\n\nexport interface SplashScreenModeSpec {\n readonly backgroundColor?: string;\n readonly image?: MediaAssetReference;\n}\n\nexport interface SplashScreenSpec extends SplashScreenModeSpec {\n readonly imageWidth?: number;\n readonly resizeMode?: SplashScreenResizeMode;\n readonly dark?: SplashScreenModeSpec;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/infra/constants.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,eAAO,MAAM,2BAA2B;;;;CAI9B,CAAC;AAEX,kGAAkG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a,EAAE,CAAC;QAChB,YAAY,EAAE,CAAC,aAAa,CAAC;QAC7B,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,CAAC,UAAU,CAAC;KAC3B;CACO,CAAC","sourcesContent":["/** One compatibility source for manifest types, validation, discovery and configuration UIs. */\nexport const INFRA_RUNTIME_COMPATIBILITY = {\n minikube: ['local'],\n k3s: ['local', 'hetzner'],\n 'docker-compose': ['local', 'hetzner'],\n} as const;\n\n/** Canonical package identities. Capabilities describe ownership, not eight mandatory methods. */\nexport const INFRA_ADAPTER_CATALOG = {\n local: {\n id: 'local',\n package: '@ankhorage/local',\n kind: 'compute',\n configVersion: 1,\n capabilities: ['compute'],\n targets: ['local-host'],\n dependencies: [],\n },\n hetzner: {\n id: 'hetzner',\n package: '@ankhorage/hetzner',\n kind: 'compute',\n configVersion: 1,\n capabilities: ['compute'],\n targets: ['ssh-host'],\n dependencies: [],\n },\n minikube: {\n id: 'minikube',\n package: '@ankhorage/minikube',\n kind: 'runtime',\n configVersion: 1,\n capabilities: ['runtime', 'workloads', 'networking'],\n targets: ['local-host'],\n dependencies: ['compute'],\n },\n k3s: {\n id: 'k3s',\n package: '@ankhorage/k3s',\n kind: 'runtime',\n configVersion: 1,\n capabilities: ['runtime', 'workloads', 'networking'],\n targets: ['local-host', 'ssh-host'],\n dependencies: ['compute'],\n },\n 'docker-compose': {\n id: 'docker-compose',\n package: '@ankhorage/docker-compose',\n kind: 'runtime',\n configVersion: 1,\n capabilities: ['runtime', 'workloads', 'networking'],\n targets: ['local-host', 'ssh-host'],\n dependencies: ['compute'],\n },\n supabase: {\n id: 'supabase',\n package: '@ankhorage/supabase',\n kind: 'service',\n configVersion: 1,\n capabilities: ['database', 'auth', 'objectStorage'],\n targets: [],\n dependencies: ['workloads'],\n },\n cerbos: {\n id: 'cerbos',\n package: '@ankhorage/cerbos',\n kind: 'service',\n configVersion: 1,\n capabilities: ['authz'],\n targets: [],\n dependencies: ['workloads'],\n },\n r2: {\n id: 'r2',\n package: '@ankhorage/r2',\n kind: 'service',\n configVersion: 1,\n capabilities: ['objectStorage'],\n targets: [],\n dependencies: [],\n },\n 'supabase-vault': {\n id: 'supabase-vault',\n package: '@ankhorage/supabase-vault',\n kind: 'service',\n configVersion: 1,\n capabilities: ['secretStore'],\n targets: [],\n dependencies: ['database'],\n },\n} as const;\n"]}
@@ -1,14 +0,0 @@
1
- import type { MediaAssetReference } from '../media';
2
-
3
- export type SplashScreenResizeMode = 'contain' | 'cover' | 'native';
4
-
5
- export interface SplashScreenModeSpec {
6
- readonly backgroundColor?: string;
7
- readonly image?: MediaAssetReference;
8
- }
9
-
10
- export interface SplashScreenSpec extends SplashScreenModeSpec {
11
- readonly imageWidth?: number;
12
- readonly resizeMode?: SplashScreenResizeMode;
13
- readonly dark?: SplashScreenModeSpec;
14
- }
File without changes
File without changes