@ankhorage/studio 0.21.0 → 0.24.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.
- package/README.md +1 -1
- package/dist/contractGuards.d.ts +2 -2
- package/dist/contractGuards.d.ts.map +1 -1
- package/dist/contractGuards.js +2 -562
- package/dist/contractGuards.js.map +1 -1
- package/dist/core/StudioProvider.js +8 -8
- package/dist/core/StudioProvider.js.map +1 -1
- package/dist/host/auth/projectAuthHealthService.d.ts +1 -2
- package/dist/host/auth/projectAuthHealthService.d.ts.map +1 -1
- package/dist/host/auth/projectAuthHealthService.js +2 -10
- package/dist/host/auth/projectAuthHealthService.js.map +1 -1
- package/dist/host/auth/projectAuthRuntimeDiagnostics.d.ts.map +1 -1
- package/dist/host/auth/projectAuthRuntimeDiagnostics.js +9 -44
- package/dist/host/auth/projectAuthRuntimeDiagnostics.js.map +1 -1
- package/dist/host/createStudioHost.js +1 -1
- package/dist/host/dataSources/studioExternalApiService.d.ts +1 -2
- package/dist/host/dataSources/studioExternalApiService.d.ts.map +1 -1
- package/dist/host/dataSources/studioExternalApiService.js +3 -11
- package/dist/host/dataSources/studioExternalApiService.js.map +1 -1
- package/dist/host/http/server.d.ts.map +1 -1
- package/dist/host/http/server.js +25 -94
- package/dist/host/http/server.js.map +1 -1
- package/dist/host/layout/templates/rootLayout.d.ts.map +1 -1
- package/dist/host/layout/templates/rootLayout.js +1 -2
- package/dist/host/layout/templates/rootLayout.js.map +1 -1
- package/dist/host/orchestrator/infraSession.d.ts +15 -0
- package/dist/host/orchestrator/infraSession.d.ts.map +1 -0
- package/dist/host/orchestrator/infraSession.js +45 -0
- package/dist/host/orchestrator/infraSession.js.map +1 -0
- package/dist/host/orchestrator/moduleManager.d.ts +3 -8
- package/dist/host/orchestrator/moduleManager.d.ts.map +1 -1
- package/dist/host/orchestrator/moduleManager.js +13 -14
- package/dist/host/orchestrator/moduleManager.js.map +1 -1
- package/dist/host/orchestrator/projectManager.d.ts +11 -28
- package/dist/host/orchestrator/projectManager.d.ts.map +1 -1
- package/dist/host/orchestrator/projectManager.js +55 -167
- package/dist/host/orchestrator/projectManager.js.map +1 -1
- package/dist/host/orchestrator/projectStore.d.ts +7 -5
- package/dist/host/orchestrator/projectStore.d.ts.map +1 -1
- package/dist/host/orchestrator/projectStore.js +60 -88
- package/dist/host/orchestrator/projectStore.js.map +1 -1
- package/dist/host/orchestrator/studioInfraUp.d.ts.map +1 -1
- package/dist/host/orchestrator/studioInfraUp.js +7 -4
- package/dist/host/orchestrator/studioInfraUp.js.map +1 -1
- package/dist/host/secrets/projectSecretService.d.ts +1 -1
- package/dist/host/secrets/projectSecretService.d.ts.map +1 -1
- package/dist/host/secrets/projectSecretService.js +10 -4
- package/dist/host/secrets/projectSecretService.js.map +1 -1
- package/dist/host/secrets/resolveProjectSecretDatabaseUrl.d.ts +1 -6
- package/dist/host/secrets/resolveProjectSecretDatabaseUrl.d.ts.map +1 -1
- package/dist/host/secrets/resolveProjectSecretDatabaseUrl.js +12 -63
- package/dist/host/secrets/resolveProjectSecretDatabaseUrl.js.map +1 -1
- package/dist/host/secrets/trustedOAuthInfraEnvironment.d.ts +2 -2
- package/dist/host/secrets/trustedOAuthInfraEnvironment.d.ts.map +1 -1
- package/dist/host/secrets/trustedOAuthInfraEnvironment.js +1 -1
- package/dist/host/secrets/trustedOAuthInfraEnvironment.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/manifestState.d.ts.map +1 -1
- package/dist/manifestState.js +4 -3
- package/dist/manifestState.js.map +1 -1
- package/dist/studioAdminRouteModel.d.ts +6 -1
- package/dist/studioAdminRouteModel.d.ts.map +1 -1
- package/dist/studioAdminRouteModel.js +105 -1
- package/dist/studioAdminRouteModel.js.map +1 -1
- package/dist/studioRuntimeApi.d.ts +1 -1
- package/dist/studioRuntimeApi.d.ts.map +1 -1
- package/dist/studioRuntimeApi.js +6 -13
- package/dist/studioRuntimeApi.js.map +1 -1
- package/dist/ui/admin/AnkhAdminPage.d.ts.map +1 -1
- package/dist/ui/admin/AnkhAdminPage.js +13 -2
- package/dist/ui/admin/AnkhAdminPage.js.map +1 -1
- package/dist/ui/admin/AnkhAdminShell.js +1 -1
- package/dist/ui/admin/AnkhAdminShell.js.map +1 -1
- package/dist/ui/admin/pages/AuthAdminPage.js +2 -2
- package/dist/ui/admin/pages/AuthAdminPage.js.map +1 -1
- package/dist/ui/admin/pages/ThemeAdminPage.d.ts.map +1 -1
- package/dist/ui/admin/pages/ThemeAdminPage.js +8 -47
- package/dist/ui/admin/pages/ThemeAdminPage.js.map +1 -1
- package/dist/ui/admin/pages/ThemeColorsAdminPage.d.ts +3 -0
- package/dist/ui/admin/pages/ThemeColorsAdminPage.d.ts.map +1 -0
- package/dist/ui/admin/pages/ThemeColorsAdminPage.js +36 -0
- package/dist/ui/admin/pages/ThemeColorsAdminPage.js.map +1 -0
- package/dist/ui/admin/pages/ThemeModeEditorSelector.d.ts +3 -0
- package/dist/ui/admin/pages/ThemeModeEditorSelector.d.ts.map +1 -0
- package/dist/ui/admin/pages/ThemeModeEditorSelector.js +30 -0
- package/dist/ui/admin/pages/ThemeModeEditorSelector.js.map +1 -0
- package/dist/ui/admin/pages/ThemeNumericTokensAdminPage.d.ts +6 -0
- package/dist/ui/admin/pages/ThemeNumericTokensAdminPage.d.ts.map +1 -0
- package/dist/ui/admin/pages/ThemeNumericTokensAdminPage.js +80 -0
- package/dist/ui/admin/pages/ThemeNumericTokensAdminPage.js.map +1 -0
- package/dist/ui/admin/pages/ThemeRecipeAdminPage.d.ts +7 -0
- package/dist/ui/admin/pages/ThemeRecipeAdminPage.d.ts.map +1 -0
- package/dist/ui/admin/pages/ThemeRecipeAdminPage.js +45 -0
- package/dist/ui/admin/pages/ThemeRecipeAdminPage.js.map +1 -0
- package/dist/ui/admin/pages/ThemeRecipeCatalog.d.ts +3 -0
- package/dist/ui/admin/pages/ThemeRecipeCatalog.d.ts.map +1 -0
- package/dist/ui/admin/pages/ThemeRecipeCatalog.js +24 -0
- package/dist/ui/admin/pages/ThemeRecipeCatalog.js.map +1 -0
- package/dist/ui/admin/pages/ThemeRecipeFieldEditor.d.ts +11 -0
- package/dist/ui/admin/pages/ThemeRecipeFieldEditor.d.ts.map +1 -0
- package/dist/ui/admin/pages/ThemeRecipeFieldEditor.js +41 -0
- package/dist/ui/admin/pages/ThemeRecipeFieldEditor.js.map +1 -0
- package/dist/ui/admin/pages/ThemeTokenAction.d.ts +6 -0
- package/dist/ui/admin/pages/ThemeTokenAction.d.ts.map +1 -0
- package/dist/ui/admin/pages/ThemeTokenAction.js +20 -0
- package/dist/ui/admin/pages/ThemeTokenAction.js.map +1 -0
- package/dist/ui/admin/pages/ThemeTypographyAdminPage.d.ts +3 -0
- package/dist/ui/admin/pages/ThemeTypographyAdminPage.d.ts.map +1 -0
- package/dist/ui/admin/pages/ThemeTypographyAdminPage.js +13 -0
- package/dist/ui/admin/pages/ThemeTypographyAdminPage.js.map +1 -0
- package/dist/ui/admin/pages/ThemeTypographyHeadingEditor.d.ts +3 -0
- package/dist/ui/admin/pages/ThemeTypographyHeadingEditor.d.ts.map +1 -0
- package/dist/ui/admin/pages/ThemeTypographyHeadingEditor.js +61 -0
- package/dist/ui/admin/pages/ThemeTypographyHeadingEditor.js.map +1 -0
- package/dist/ui/admin/pages/ThemeTypographySizeEditor.d.ts +3 -0
- package/dist/ui/admin/pages/ThemeTypographySizeEditor.d.ts.map +1 -0
- package/dist/ui/admin/pages/ThemeTypographySizeEditor.js +52 -0
- package/dist/ui/admin/pages/ThemeTypographySizeEditor.js.map +1 -0
- package/dist/ui/admin/pages/ThemeTypographyWeightEditor.d.ts +3 -0
- package/dist/ui/admin/pages/ThemeTypographyWeightEditor.d.ts.map +1 -0
- package/dist/ui/admin/pages/ThemeTypographyWeightEditor.js +54 -0
- package/dist/ui/admin/pages/ThemeTypographyWeightEditor.js.map +1 -0
- package/dist/ui/admin/pages/adminThemeModel.d.ts.map +1 -1
- package/dist/ui/admin/pages/adminThemeModel.js +1 -2
- package/dist/ui/admin/pages/adminThemeModel.js.map +1 -1
- package/dist/ui/admin/pages/themeRecipeAuthoringModel.d.ts +10 -0
- package/dist/ui/admin/pages/themeRecipeAuthoringModel.d.ts.map +1 -0
- package/dist/ui/admin/pages/themeRecipeAuthoringModel.js +20 -0
- package/dist/ui/admin/pages/themeRecipeAuthoringModel.js.map +1 -0
- package/dist/ui/admin/pages/themeRecipeTokenOptions.d.ts +15 -0
- package/dist/ui/admin/pages/themeRecipeTokenOptions.d.ts.map +1 -0
- package/dist/ui/admin/pages/themeRecipeTokenOptions.js +16 -0
- package/dist/ui/admin/pages/themeRecipeTokenOptions.js.map +1 -0
- package/dist/ui/admin/pages/themeTokenAuthoringModel.d.ts +25 -0
- package/dist/ui/admin/pages/themeTokenAuthoringModel.d.ts.map +1 -0
- package/dist/ui/admin/pages/themeTokenAuthoringModel.js +52 -0
- package/dist/ui/admin/pages/themeTokenAuthoringModel.js.map +1 -0
- package/dist/ui/admin/pages/useActiveThemeAdmin.d.ts +11 -0
- package/dist/ui/admin/pages/useActiveThemeAdmin.d.ts.map +1 -0
- package/dist/ui/admin/pages/useActiveThemeAdmin.js +21 -0
- package/dist/ui/admin/pages/useActiveThemeAdmin.js.map +1 -0
- package/package.json +5 -5
- package/dist/host/orchestrator/infraGenerator.d.ts +0 -35
- package/dist/host/orchestrator/infraGenerator.d.ts.map +0 -1
- package/dist/host/orchestrator/infraGenerator.js +0 -135
- package/dist/host/orchestrator/infraGenerator.js.map +0 -1
- package/dist/host/orchestrator/infraRuntime.d.ts +0 -46
- package/dist/host/orchestrator/infraRuntime.d.ts.map +0 -1
- package/dist/host/orchestrator/infraRuntime.js +0 -185
- package/dist/host/orchestrator/infraRuntime.js.map +0 -1
- package/dist/host/orchestrator/infraValidation.d.ts +0 -3
- package/dist/host/orchestrator/infraValidation.d.ts.map +0 -1
- package/dist/host/orchestrator/infraValidation.js +0 -59
- package/dist/host/orchestrator/infraValidation.js.map +0 -1
- package/dist/host/orchestrator/projectDeletion.d.ts +0 -20
- package/dist/host/orchestrator/projectDeletion.d.ts.map +0 -1
- package/dist/host/orchestrator/projectDeletion.js +0 -191
- package/dist/host/orchestrator/projectDeletion.js.map +0 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/studio
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Standalone Studio authoring package for Ankhorage apps.
|
|
9
9
|
|
package/dist/contractGuards.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ColorHarmony } from '@ankhorage/color-theory';
|
|
2
|
-
import { type AppCategory,
|
|
2
|
+
import { type AppCategory, isAppManifest } from '@ankhorage/contracts';
|
|
3
|
+
export { isAppManifest };
|
|
3
4
|
export declare function isAppCategory(value: unknown): value is AppCategory;
|
|
4
5
|
export declare function isColorHarmony(value: unknown): value is ColorHarmony;
|
|
5
|
-
export declare function isAppManifest(value: unknown): value is AppManifest;
|
|
6
6
|
//# sourceMappingURL=contractGuards.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractGuards.d.ts","sourceRoot":"","sources":["../src/contractGuards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,
|
|
1
|
+
{"version":3,"file":"contractGuards.d.ts","sourceRoot":"","sources":["../src/contractGuards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAkB,KAAK,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKvF,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE"}
|
package/dist/contractGuards.js
CHANGED
|
@@ -1,572 +1,12 @@
|
|
|
1
1
|
import { COLOR_HARMONIES } from '@ankhorage/color-theory';
|
|
2
|
-
import { APP_CATEGORIES,
|
|
2
|
+
import { APP_CATEGORIES, isAppManifest } from '@ankhorage/contracts';
|
|
3
3
|
const APP_CATEGORY_SET = new Set(APP_CATEGORIES);
|
|
4
|
-
const AUTH_OAUTH_PROVIDER_SET = new Set(AUTH_OAUTH_PROVIDER_IDS);
|
|
5
|
-
const AUTH_PROFILE_CREATE_STRATEGY_SET = new Set(AUTH_PROFILE_CREATE_STRATEGIES);
|
|
6
|
-
const AUTH_PROFILE_PRIMARY_KEY_STRATEGY_SET = new Set(AUTH_PROFILE_PRIMARY_KEY_STRATEGIES);
|
|
7
|
-
const AUTH_PROFILE_UPDATE_STRATEGY_SET = new Set(AUTH_PROFILE_UPDATE_STRATEGIES);
|
|
8
|
-
const AUTH_SCOPE_SET = new Set(AUTH_SCOPES);
|
|
9
|
-
const AUTH_SIGN_IN_IDENTIFIER_SET = new Set(AUTH_SIGN_IN_IDENTIFIERS);
|
|
10
|
-
const AUTH_SIGN_UP_POLICY_SET = new Set(AUTH_SIGN_UP_POLICIES);
|
|
11
|
-
const AUTHZ_ENGINE_SET = new Set(AUTHZ_ENGINES);
|
|
12
|
-
const AUTHZ_KIND_SET = new Set(AUTHZ_KINDS);
|
|
13
4
|
const COLOR_HARMONY_SET = new Set(COLOR_HARMONIES);
|
|
14
|
-
|
|
15
|
-
const NAVIGATOR_TYPE_SET = new Set(NAVIGATOR_TYPES);
|
|
16
|
-
const SPLASH_SCREEN_RESIZE_MODE_SET = new Set(['contain', 'cover', 'native']);
|
|
17
|
-
const STATE_PERSISTENCE_MODE_SET = new Set(STATE_PERSISTENCE_MODES);
|
|
18
|
-
const STORAGE_PROVIDER_SET = new Set(STORAGE_PROVIDERS);
|
|
5
|
+
export { isAppManifest };
|
|
19
6
|
export function isAppCategory(value) {
|
|
20
7
|
return typeof value === 'string' && APP_CATEGORY_SET.has(value);
|
|
21
8
|
}
|
|
22
9
|
export function isColorHarmony(value) {
|
|
23
10
|
return typeof value === 'string' && COLOR_HARMONY_SET.has(value);
|
|
24
11
|
}
|
|
25
|
-
function isRecord(value) {
|
|
26
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
27
|
-
}
|
|
28
|
-
function isOptionalString(value) {
|
|
29
|
-
return value === undefined || typeof value === 'string';
|
|
30
|
-
}
|
|
31
|
-
function isOptionalNumber(value) {
|
|
32
|
-
return value === undefined || typeof value === 'number';
|
|
33
|
-
}
|
|
34
|
-
function isOptionalBoolean(value) {
|
|
35
|
-
return value === undefined || typeof value === 'boolean';
|
|
36
|
-
}
|
|
37
|
-
function isStringArray(value) {
|
|
38
|
-
return Array.isArray(value) && value.every((entry) => typeof entry === 'string');
|
|
39
|
-
}
|
|
40
|
-
function isManifestValue(value) {
|
|
41
|
-
if (value === null ||
|
|
42
|
-
typeof value === 'string' ||
|
|
43
|
-
typeof value === 'number' ||
|
|
44
|
-
typeof value === 'boolean') {
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
if (Array.isArray(value)) {
|
|
48
|
-
return value.every(isManifestValue);
|
|
49
|
-
}
|
|
50
|
-
return isRecord(value) && Object.values(value).every(isManifestValue);
|
|
51
|
-
}
|
|
52
|
-
function isNavigatorType(value) {
|
|
53
|
-
return typeof value === 'string' && NAVIGATOR_TYPE_SET.has(value);
|
|
54
|
-
}
|
|
55
|
-
function isThemeModeConfig(value) {
|
|
56
|
-
return isRecord(value) && typeof value.primaryColor === 'string' && isColorHarmony(value.harmony);
|
|
57
|
-
}
|
|
58
|
-
function isThemeConfig(value) {
|
|
59
|
-
return (isRecord(value) &&
|
|
60
|
-
typeof value.id === 'string' &&
|
|
61
|
-
typeof value.name === 'string' &&
|
|
62
|
-
isThemeModeConfig(value.light) &&
|
|
63
|
-
isThemeModeConfig(value.dark));
|
|
64
|
-
}
|
|
65
|
-
function isUiNode(value) {
|
|
66
|
-
return (isRecord(value) &&
|
|
67
|
-
typeof value.id === 'string' &&
|
|
68
|
-
typeof value.type === 'string' &&
|
|
69
|
-
(value.alias === undefined || typeof value.alias === 'string') &&
|
|
70
|
-
(value.props === undefined || isRecord(value.props)) &&
|
|
71
|
-
(value.style === undefined || isRecord(value.style)) &&
|
|
72
|
-
(value.repeat === undefined ||
|
|
73
|
-
(isRecord(value.repeat) &&
|
|
74
|
-
isBindingValueSource(value.repeat.source) &&
|
|
75
|
-
isOptionalString(value.repeat.itemAlias) &&
|
|
76
|
-
isOptionalString(value.repeat.keyPath) &&
|
|
77
|
-
(value.repeat.empty === undefined ||
|
|
78
|
-
(Array.isArray(value.repeat.empty) && value.repeat.empty.every(isUiNode))))) &&
|
|
79
|
-
(value.children === undefined ||
|
|
80
|
-
(Array.isArray(value.children) && value.children.every(isUiNode))));
|
|
81
|
-
}
|
|
82
|
-
function isScreenSpec(value) {
|
|
83
|
-
return (isRecord(value) &&
|
|
84
|
-
typeof value.id === 'string' &&
|
|
85
|
-
typeof value.name === 'string' &&
|
|
86
|
-
(value.title === undefined || typeof value.title === 'string') &&
|
|
87
|
-
(value.description === undefined || typeof value.description === 'string') &&
|
|
88
|
-
(value.dataLoaders === undefined ||
|
|
89
|
-
(Array.isArray(value.dataLoaders) &&
|
|
90
|
-
value.dataLoaders.every(isScreenDataLoaderDefinition))) &&
|
|
91
|
-
(value.requires === undefined || isScreenRequirements(value.requires)) &&
|
|
92
|
-
isUiNode(value.root));
|
|
93
|
-
}
|
|
94
|
-
function isRouteDefinition(value) {
|
|
95
|
-
return (isRecord(value) &&
|
|
96
|
-
typeof value.name === 'string' &&
|
|
97
|
-
(value.path === undefined || typeof value.path === 'string') &&
|
|
98
|
-
(value.label === undefined || typeof value.label === 'string') &&
|
|
99
|
-
(value.icon === undefined || isIconSpec(value.icon)) &&
|
|
100
|
-
(value.showInPrimaryNavigation === undefined ||
|
|
101
|
-
typeof value.showInPrimaryNavigation === 'boolean') &&
|
|
102
|
-
(value.guards === undefined ||
|
|
103
|
-
(Array.isArray(value.guards) && value.guards.every((guard) => typeof guard === 'string'))) &&
|
|
104
|
-
(value.screenId === undefined || typeof value.screenId === 'string') &&
|
|
105
|
-
(value.navigator === undefined || isNavigatorSpec(value.navigator)));
|
|
106
|
-
}
|
|
107
|
-
function isNavigatorSpec(value) {
|
|
108
|
-
return (isRecord(value) &&
|
|
109
|
-
isNavigatorType(value.type) &&
|
|
110
|
-
(value.initialRouteName === undefined || typeof value.initialRouteName === 'string') &&
|
|
111
|
-
Array.isArray(value.routes) &&
|
|
112
|
-
value.routes.every(isRouteDefinition) &&
|
|
113
|
-
(value.options === undefined || isRecord(value.options)));
|
|
114
|
-
}
|
|
115
|
-
function isSplashScreenModeSpec(value) {
|
|
116
|
-
return (isRecord(value) &&
|
|
117
|
-
isOptionalString(value.image) &&
|
|
118
|
-
isOptionalNumber(value.imageWidth) &&
|
|
119
|
-
(value.resizeMode === undefined ||
|
|
120
|
-
(typeof value.resizeMode === 'string' &&
|
|
121
|
-
SPLASH_SCREEN_RESIZE_MODE_SET.has(value.resizeMode))) &&
|
|
122
|
-
isOptionalString(value.backgroundColor));
|
|
123
|
-
}
|
|
124
|
-
function isSplashScreenSpec(value) {
|
|
125
|
-
return (isRecord(value) &&
|
|
126
|
-
isSplashScreenModeSpec(value) &&
|
|
127
|
-
(value.dark === undefined || isSplashScreenModeSpec(value.dark)));
|
|
128
|
-
}
|
|
129
|
-
function isDeploymentSpec(value) {
|
|
130
|
-
return (isRecord(value) && typeof value.target === 'string' && typeof value.monitoring === 'boolean');
|
|
131
|
-
}
|
|
132
|
-
function isDatabaseSpec(value) {
|
|
133
|
-
return (isRecord(value) &&
|
|
134
|
-
typeof value.provider === 'string' &&
|
|
135
|
-
typeof value.tier === 'string' &&
|
|
136
|
-
DATABASE_TIER_SET.has(value.tier));
|
|
137
|
-
}
|
|
138
|
-
function isStorageSpec(value) {
|
|
139
|
-
return (isRecord(value) &&
|
|
140
|
-
typeof value.provider === 'string' &&
|
|
141
|
-
STORAGE_PROVIDER_SET.has(value.provider) &&
|
|
142
|
-
isStringArray(value.buckets));
|
|
143
|
-
}
|
|
144
|
-
function isStateSpec(value) {
|
|
145
|
-
return (isRecord(value) &&
|
|
146
|
-
typeof value.provider === 'string' &&
|
|
147
|
-
(value.persistence === undefined ||
|
|
148
|
-
(typeof value.persistence === 'string' && STATE_PERSISTENCE_MODE_SET.has(value.persistence))));
|
|
149
|
-
}
|
|
150
|
-
function isNetworkingSpec(value) {
|
|
151
|
-
return isRecord(value) && isOptionalString(value.domain) && typeof value.cdn === 'boolean';
|
|
152
|
-
}
|
|
153
|
-
function isAuthSpec(value) {
|
|
154
|
-
return (isRecord(value) &&
|
|
155
|
-
typeof value.scope === 'string' &&
|
|
156
|
-
AUTH_SCOPE_SET.has(value.scope) &&
|
|
157
|
-
typeof value.provider === 'string' &&
|
|
158
|
-
(value.authorization === undefined ||
|
|
159
|
-
(isRecord(value.authorization) &&
|
|
160
|
-
typeof value.authorization.kind === 'string' &&
|
|
161
|
-
AUTHZ_KIND_SET.has(value.authorization.kind) &&
|
|
162
|
-
typeof value.authorization.engine === 'string' &&
|
|
163
|
-
AUTHZ_ENGINE_SET.has(value.authorization.engine))) &&
|
|
164
|
-
(value.flow === undefined || isAuthFlow(value.flow)) &&
|
|
165
|
-
(value.signIn === undefined ||
|
|
166
|
-
(isRecord(value.signIn) &&
|
|
167
|
-
Array.isArray(value.signIn.identifiers) &&
|
|
168
|
-
value.signIn.identifiers.every((identifier) => typeof identifier === 'string' && AUTH_SIGN_IN_IDENTIFIER_SET.has(identifier)))) &&
|
|
169
|
-
(value.signUp === undefined ||
|
|
170
|
-
(isRecord(value.signUp) &&
|
|
171
|
-
isStringArray(value.signUp.requiredFields) &&
|
|
172
|
-
(value.signUp.optionalFields === undefined || isStringArray(value.signUp.optionalFields)) &&
|
|
173
|
-
(value.signUp.signUpPolicy === undefined ||
|
|
174
|
-
(typeof value.signUp.signUpPolicy === 'string' &&
|
|
175
|
-
AUTH_SIGN_UP_POLICY_SET.has(value.signUp.signUpPolicy))))) &&
|
|
176
|
-
(value.oauth === undefined || isAuthOAuthConfig(value.oauth)) &&
|
|
177
|
-
(value.profile === undefined || isAuthProfileSpec(value.profile)));
|
|
178
|
-
}
|
|
179
|
-
function isAuthFlow(value) {
|
|
180
|
-
return (isRecord(value) &&
|
|
181
|
-
typeof value.signInRoute === 'string' &&
|
|
182
|
-
isOptionalString(value.signUpRoute) &&
|
|
183
|
-
isOptionalString(value.signOutRoute) &&
|
|
184
|
-
isOptionalString(value.forgotPasswordRoute) &&
|
|
185
|
-
isOptionalString(value.otpRoute) &&
|
|
186
|
-
typeof value.postSignInRoute === 'string' &&
|
|
187
|
-
isOptionalString(value.unauthorizedRoute));
|
|
188
|
-
}
|
|
189
|
-
function isAuthOAuthConfig(value) {
|
|
190
|
-
return (isRecord(value) &&
|
|
191
|
-
typeof value.enabled === 'boolean' &&
|
|
192
|
-
typeof value.callbackRoute === 'string' &&
|
|
193
|
-
Array.isArray(value.providers) &&
|
|
194
|
-
value.providers.every((provider) => isRecord(provider) &&
|
|
195
|
-
typeof provider.id === 'string' &&
|
|
196
|
-
(AUTH_OAUTH_PROVIDER_SET.has(provider.id) || provider.id.length > 0) &&
|
|
197
|
-
isOptionalString(provider.label) &&
|
|
198
|
-
isOptionalBoolean(provider.enabled) &&
|
|
199
|
-
(provider.scopes === undefined || isStringArray(provider.scopes)) &&
|
|
200
|
-
(provider.queryParams === undefined ||
|
|
201
|
-
(isRecord(provider.queryParams) &&
|
|
202
|
-
Object.values(provider.queryParams).every((entry) => typeof entry === 'string'))) &&
|
|
203
|
-
(provider.icon === undefined || isIconSpec(provider.icon)) &&
|
|
204
|
-
(provider.credentialsRef === undefined || isSecretRef(provider.credentialsRef))));
|
|
205
|
-
}
|
|
206
|
-
function isAuthProfileSpec(value) {
|
|
207
|
-
return (isRecord(value) &&
|
|
208
|
-
isStringArray(value.fields) &&
|
|
209
|
-
isOptionalString(value.table) &&
|
|
210
|
-
(value.primaryKey === undefined ||
|
|
211
|
-
(typeof value.primaryKey === 'string' &&
|
|
212
|
-
AUTH_PROFILE_PRIMARY_KEY_STRATEGY_SET.has(value.primaryKey))) &&
|
|
213
|
-
(value.createStrategy === undefined ||
|
|
214
|
-
(typeof value.createStrategy === 'string' &&
|
|
215
|
-
AUTH_PROFILE_CREATE_STRATEGY_SET.has(value.createStrategy))) &&
|
|
216
|
-
(value.updateStrategy === undefined ||
|
|
217
|
-
(typeof value.updateStrategy === 'string' &&
|
|
218
|
-
AUTH_PROFILE_UPDATE_STRATEGY_SET.has(value.updateStrategy))));
|
|
219
|
-
}
|
|
220
|
-
function isInfraManifest(value) {
|
|
221
|
-
return (isRecord(value) &&
|
|
222
|
-
(value.deployment === undefined || isDeploymentSpec(value.deployment)) &&
|
|
223
|
-
(value.auth === undefined || isAuthSpec(value.auth)) &&
|
|
224
|
-
(value.database === undefined || isDatabaseSpec(value.database)) &&
|
|
225
|
-
(value.storage === undefined || isStorageSpec(value.storage)) &&
|
|
226
|
-
(value.state === undefined || isStateSpec(value.state)) &&
|
|
227
|
-
(value.networking === undefined || isNetworkingSpec(value.networking)) &&
|
|
228
|
-
Array.isArray(value.modules) &&
|
|
229
|
-
value.modules.every((moduleId) => typeof moduleId === 'string') &&
|
|
230
|
-
(value.modulesConfig === undefined || isRecord(value.modulesConfig)) &&
|
|
231
|
-
!('plugins' in value) &&
|
|
232
|
-
!('pluginsConfig' in value));
|
|
233
|
-
}
|
|
234
|
-
function isAppSettings(value) {
|
|
235
|
-
return (isRecord(value) &&
|
|
236
|
-
isRecord(value.localization) &&
|
|
237
|
-
typeof value.localization.defaultLocale === 'string' &&
|
|
238
|
-
Array.isArray(value.localization.locales) &&
|
|
239
|
-
value.localization.locales.every((locale) => typeof locale === 'string') &&
|
|
240
|
-
(value.apiBaseUrl === undefined || typeof value.apiBaseUrl === 'string'));
|
|
241
|
-
}
|
|
242
|
-
function isScreenRegistry(value) {
|
|
243
|
-
return (isRecord(value) &&
|
|
244
|
-
Object.entries(value).every(([registryKey, screen]) => isScreenSpec(screen) && registryKey === screen.id));
|
|
245
|
-
}
|
|
246
|
-
function isIconSpec(value) {
|
|
247
|
-
return (isRecord(value) &&
|
|
248
|
-
typeof value.name === 'string' &&
|
|
249
|
-
isOptionalString(value.provider) &&
|
|
250
|
-
(value.size === undefined ||
|
|
251
|
-
typeof value.size === 'string' ||
|
|
252
|
-
typeof value.size === 'number') &&
|
|
253
|
-
isOptionalString(value.color));
|
|
254
|
-
}
|
|
255
|
-
function isSecretRef(value) {
|
|
256
|
-
return typeof value === 'string';
|
|
257
|
-
}
|
|
258
|
-
function isCredentialRef(value) {
|
|
259
|
-
return (isRecord(value) &&
|
|
260
|
-
typeof value.id === 'string' &&
|
|
261
|
-
typeof value.kind === 'string' &&
|
|
262
|
-
isOptionalString(value.label) &&
|
|
263
|
-
isOptionalString(value.scope));
|
|
264
|
-
}
|
|
265
|
-
function isAdapterRef(value) {
|
|
266
|
-
return (isRecord(value) &&
|
|
267
|
-
typeof value.id === 'string' &&
|
|
268
|
-
typeof value.kind === 'string' &&
|
|
269
|
-
isOptionalString(value.packageName) &&
|
|
270
|
-
isOptionalString(value.exportName) &&
|
|
271
|
-
(value.config === undefined || isManifestValue(value.config)));
|
|
272
|
-
}
|
|
273
|
-
function isScreenRequirements(value) {
|
|
274
|
-
return (isRecord(value) &&
|
|
275
|
-
(value.permissions === undefined ||
|
|
276
|
-
(Array.isArray(value.permissions) &&
|
|
277
|
-
value.permissions.every((entry) => isRecord(entry) && typeof entry.permission === 'string'))) &&
|
|
278
|
-
(value.capabilities === undefined ||
|
|
279
|
-
(Array.isArray(value.capabilities) &&
|
|
280
|
-
value.capabilities.every((entry) => isRecord(entry) && typeof entry.capability === 'string'))));
|
|
281
|
-
}
|
|
282
|
-
function isGeneratedApiRegistry(value) {
|
|
283
|
-
return isRecord(value) && Object.values(value).every(isGeneratedApiDefinition);
|
|
284
|
-
}
|
|
285
|
-
function isGeneratedApiDefinition(value) {
|
|
286
|
-
return (isRecord(value) &&
|
|
287
|
-
typeof value.id === 'string' &&
|
|
288
|
-
value.protocol === 'rest' &&
|
|
289
|
-
isOptionalString(value.name) &&
|
|
290
|
-
isOptionalString(value.description) &&
|
|
291
|
-
typeof value.basePath === 'string' &&
|
|
292
|
-
isRecord(value.database) &&
|
|
293
|
-
value.database.kind === 'database' &&
|
|
294
|
-
isAdapterRef(value.database) &&
|
|
295
|
-
Array.isArray(value.resources) &&
|
|
296
|
-
value.resources.every(isGeneratedApiResourceDefinition) &&
|
|
297
|
-
(value.auth === undefined || isGeneratedApiAuthRequirement(value.auth)) &&
|
|
298
|
-
(value.metadata === undefined || isManifestValue(value.metadata)));
|
|
299
|
-
}
|
|
300
|
-
function isGeneratedApiAuthRequirement(value) {
|
|
301
|
-
return (isRecord(value) &&
|
|
302
|
-
isOptionalBoolean(value.required) &&
|
|
303
|
-
(value.roles === undefined || isStringArray(value.roles)) &&
|
|
304
|
-
(value.permissions === undefined || isStringArray(value.permissions)) &&
|
|
305
|
-
isOptionalString(value.policy) &&
|
|
306
|
-
(value.metadata === undefined || isManifestValue(value.metadata)));
|
|
307
|
-
}
|
|
308
|
-
function isGeneratedApiResourceDefinition(value) {
|
|
309
|
-
return (isRecord(value) &&
|
|
310
|
-
typeof value.id === 'string' &&
|
|
311
|
-
isOptionalString(value.name) &&
|
|
312
|
-
isOptionalString(value.description) &&
|
|
313
|
-
typeof value.path === 'string' &&
|
|
314
|
-
isDbCollectionDefinition(value.collection) &&
|
|
315
|
-
Array.isArray(value.operations) &&
|
|
316
|
-
value.operations.every(isGeneratedApiCrudOperation) &&
|
|
317
|
-
(value.seed === undefined ||
|
|
318
|
-
(Array.isArray(value.seed) &&
|
|
319
|
-
value.seed.every((record) => isRecord(record) && Object.values(record).every(isManifestValue)))) &&
|
|
320
|
-
(value.policies === undefined ||
|
|
321
|
-
(Array.isArray(value.policies) && value.policies.every(isGeneratedApiPolicyRef))) &&
|
|
322
|
-
(value.metadata === undefined || isManifestValue(value.metadata)));
|
|
323
|
-
}
|
|
324
|
-
function isGeneratedApiCrudOperation(value) {
|
|
325
|
-
return ['create', 'delete', 'list', 'read', 'update'].includes(String(value));
|
|
326
|
-
}
|
|
327
|
-
function isGeneratedApiPolicyRef(value) {
|
|
328
|
-
return (isRecord(value) &&
|
|
329
|
-
typeof value.id === 'string' &&
|
|
330
|
-
(value.operation === undefined || isGeneratedApiCrudOperation(value.operation)));
|
|
331
|
-
}
|
|
332
|
-
function isDbCollectionDefinition(value) {
|
|
333
|
-
return (isRecord(value) &&
|
|
334
|
-
typeof value.name === 'string' &&
|
|
335
|
-
isOptionalString(value.schema) &&
|
|
336
|
-
Array.isArray(value.fields) &&
|
|
337
|
-
value.fields.every((field) => isRecord(field) &&
|
|
338
|
-
typeof field.name === 'string' &&
|
|
339
|
-
typeof field.type === 'string' &&
|
|
340
|
-
['text', 'number', 'boolean', 'datetime', 'json', 'uuid'].includes(field.type) &&
|
|
341
|
-
isOptionalBoolean(field.required) &&
|
|
342
|
-
isOptionalBoolean(field.unique) &&
|
|
343
|
-
(field.defaultValue === undefined ||
|
|
344
|
-
field.defaultValue === null ||
|
|
345
|
-
['boolean', 'number', 'string'].includes(typeof field.defaultValue))) &&
|
|
346
|
-
isOptionalString(value.primaryKey));
|
|
347
|
-
}
|
|
348
|
-
function isDataSourceRegistry(value) {
|
|
349
|
-
return isRecord(value) && Object.values(value).every(isDataSourceConfig);
|
|
350
|
-
}
|
|
351
|
-
function isDataSourceConfig(value) {
|
|
352
|
-
if (!isRecord(value) ||
|
|
353
|
-
typeof value.id !== 'string' ||
|
|
354
|
-
(value.kind !== 'api' && value.kind !== 'database') ||
|
|
355
|
-
!isOptionalString(value.name) ||
|
|
356
|
-
!isOptionalString(value.description) ||
|
|
357
|
-
(value.credential !== undefined && !isCredentialRef(value.credential)) ||
|
|
358
|
-
!isDataEndpointRegistry(value.endpoints) ||
|
|
359
|
-
(value.schemas !== undefined && !isRecord(value.schemas)) ||
|
|
360
|
-
(value.metadata !== undefined && !isManifestValue(value.metadata))) {
|
|
361
|
-
return false;
|
|
362
|
-
}
|
|
363
|
-
if (value.kind === 'database') {
|
|
364
|
-
return (isRecord(value.adapter) && value.adapter.kind === 'database' && isAdapterRef(value.adapter));
|
|
365
|
-
}
|
|
366
|
-
if (value.origin === 'generated') {
|
|
367
|
-
return (value.protocol === 'rest' &&
|
|
368
|
-
typeof value.generatedApiId === 'string' &&
|
|
369
|
-
isRecord(value.adapter) &&
|
|
370
|
-
value.adapter.kind === 'database' &&
|
|
371
|
-
isAdapterRef(value.adapter));
|
|
372
|
-
}
|
|
373
|
-
if (value.origin !== 'external')
|
|
374
|
-
return false;
|
|
375
|
-
if (value.protocol === 'rest') {
|
|
376
|
-
return (typeof value.baseUrl === 'string' &&
|
|
377
|
-
(value.openApi === undefined || isOpenApiDocumentRef(value.openApi)));
|
|
378
|
-
}
|
|
379
|
-
if (value.protocol === 'graphql') {
|
|
380
|
-
return (typeof value.endpointUrl === 'string' &&
|
|
381
|
-
(value.introspection === undefined || isGraphQlIntrospection(value.introspection)));
|
|
382
|
-
}
|
|
383
|
-
return false;
|
|
384
|
-
}
|
|
385
|
-
function isOpenApiDocumentRef(value) {
|
|
386
|
-
return (isRecord(value) &&
|
|
387
|
-
isOptionalString(value.url) &&
|
|
388
|
-
isOptionalString(value.documentId) &&
|
|
389
|
-
isOptionalString(value.version));
|
|
390
|
-
}
|
|
391
|
-
function isGraphQlIntrospection(value) {
|
|
392
|
-
return (isRecord(value) && typeof value.enabled === 'boolean' && isOptionalString(value.schemaVersion));
|
|
393
|
-
}
|
|
394
|
-
function isDataEndpointRegistry(value) {
|
|
395
|
-
return isRecord(value) && Object.values(value).every(isDataEndpointConfig);
|
|
396
|
-
}
|
|
397
|
-
function isDataEndpointConfig(value) {
|
|
398
|
-
return (isRecord(value) &&
|
|
399
|
-
typeof value.id === 'string' &&
|
|
400
|
-
typeof value.kind === 'string' &&
|
|
401
|
-
isOptionalString(value.name) &&
|
|
402
|
-
isOptionalString(value.description) &&
|
|
403
|
-
isOptionalString(value.baseUrl) &&
|
|
404
|
-
isOptionalString(value.path) &&
|
|
405
|
-
(value.credential === undefined || isCredentialRef(value.credential)) &&
|
|
406
|
-
isRecord(value.operations) &&
|
|
407
|
-
Object.values(value.operations).every(isDataOperationConfig) &&
|
|
408
|
-
(value.metadata === undefined || isManifestValue(value.metadata)));
|
|
409
|
-
}
|
|
410
|
-
function isDataOperationConfig(value) {
|
|
411
|
-
return (isRecord(value) &&
|
|
412
|
-
typeof value.id === 'string' &&
|
|
413
|
-
isOptionalString(value.endpointId) &&
|
|
414
|
-
isOptionalString(value.name) &&
|
|
415
|
-
isOptionalString(value.description) &&
|
|
416
|
-
typeof value.protocol === 'string' &&
|
|
417
|
-
typeof value.intent === 'string' &&
|
|
418
|
-
['action', 'create', 'delete', 'read', 'update'].includes(value.intent) &&
|
|
419
|
-
isOptionalString(value.method) &&
|
|
420
|
-
isOptionalString(value.path) &&
|
|
421
|
-
(value.request === undefined || isDataOperationRequest(value.request)) &&
|
|
422
|
-
(value.response === undefined || isDataOperationResponse(value.response)) &&
|
|
423
|
-
(value.pagination === undefined || isRecord(value.pagination)) &&
|
|
424
|
-
(value.credential === undefined || isCredentialRef(value.credential)) &&
|
|
425
|
-
(value.metadata === undefined || isManifestValue(value.metadata)));
|
|
426
|
-
}
|
|
427
|
-
function isDataOperationRequest(value) {
|
|
428
|
-
return (isRecord(value) &&
|
|
429
|
-
isDataSchemaSlot(value) &&
|
|
430
|
-
(value.parameters === undefined ||
|
|
431
|
-
(Array.isArray(value.parameters) && value.parameters.every(isDataOperationParameter))));
|
|
432
|
-
}
|
|
433
|
-
function isDataOperationParameter(value) {
|
|
434
|
-
return (isRecord(value) &&
|
|
435
|
-
isDataSchemaSlot(value) &&
|
|
436
|
-
typeof value.name === 'string' &&
|
|
437
|
-
typeof value.location === 'string' &&
|
|
438
|
-
['body', 'cookie', 'header', 'path', 'query'].includes(value.location) &&
|
|
439
|
-
isOptionalBoolean(value.required) &&
|
|
440
|
-
isOptionalString(value.description) &&
|
|
441
|
-
(value.default === undefined || isManifestValue(value.default)));
|
|
442
|
-
}
|
|
443
|
-
function isDataOperationResponse(value) {
|
|
444
|
-
return (isRecord(value) &&
|
|
445
|
-
isDataSchemaSlot(value) &&
|
|
446
|
-
(value.status === undefined ||
|
|
447
|
-
typeof value.status === 'string' ||
|
|
448
|
-
typeof value.status === 'number') &&
|
|
449
|
-
isOptionalString(value.contentType) &&
|
|
450
|
-
isOptionalString(value.description));
|
|
451
|
-
}
|
|
452
|
-
function isDataSchemaSlot(value) {
|
|
453
|
-
return isRecord(value) && (value.schema === undefined || isRecord(value.schema));
|
|
454
|
-
}
|
|
455
|
-
function isComponentDataBindingRegistry(value) {
|
|
456
|
-
return isRecord(value) && Object.values(value).every(isComponentDataBinding);
|
|
457
|
-
}
|
|
458
|
-
function isComponentDataBinding(value) {
|
|
459
|
-
return (isRecord(value) &&
|
|
460
|
-
typeof value.componentId === 'string' &&
|
|
461
|
-
isOptionalString(value.componentType) &&
|
|
462
|
-
(value.props === undefined ||
|
|
463
|
-
(isRecord(value.props) && Object.values(value.props).every(isPropBinding))) &&
|
|
464
|
-
(value.events === undefined ||
|
|
465
|
-
(isRecord(value.events) &&
|
|
466
|
-
Object.values(value.events).every((bindings) => Array.isArray(bindings) && bindings.every(isEventBinding)))));
|
|
467
|
-
}
|
|
468
|
-
function isPropBinding(value) {
|
|
469
|
-
return (isRecord(value) &&
|
|
470
|
-
isBindingValueSource(value.source) &&
|
|
471
|
-
(value.fallback === undefined || isBindingFallback(value.fallback)) &&
|
|
472
|
-
(value.loading === undefined || isBindingLifecycleBehavior(value.loading)) &&
|
|
473
|
-
(value.error === undefined || isBindingLifecycleBehavior(value.error)) &&
|
|
474
|
-
(value.empty === undefined || isBindingLifecycleBehavior(value.empty)) &&
|
|
475
|
-
isOptionalBindingTransforms(value.transforms));
|
|
476
|
-
}
|
|
477
|
-
function isEventBinding(value) {
|
|
478
|
-
return (isRecord(value) &&
|
|
479
|
-
((isRecord(value.target) &&
|
|
480
|
-
value.target.kind === 'action' &&
|
|
481
|
-
typeof value.target.type === 'string') ||
|
|
482
|
-
(isRecord(value.target) &&
|
|
483
|
-
value.target.kind === 'operation' &&
|
|
484
|
-
isBindingOperationRef(value.target.operation))) &&
|
|
485
|
-
(value.input === undefined || isBindingInputMap(value.input)) &&
|
|
486
|
-
(value.when === undefined ||
|
|
487
|
-
(isRecord(value.when) &&
|
|
488
|
-
isBindingValueSource(value.when.source) &&
|
|
489
|
-
['eq', 'exists', 'neq', 'notExists'].includes(String(value.when.operator)) &&
|
|
490
|
-
(value.when.value === undefined || isManifestValue(value.when.value)))));
|
|
491
|
-
}
|
|
492
|
-
function isBindingValueSource(value) {
|
|
493
|
-
return (isRecord(value) &&
|
|
494
|
-
typeof value.kind === 'string' &&
|
|
495
|
-
['context', 'event', 'literal', 'operation', 'state'].includes(value.kind) &&
|
|
496
|
-
(value.kind === 'literal'
|
|
497
|
-
? isManifestValue(value.value)
|
|
498
|
-
: value.kind === 'operation'
|
|
499
|
-
? isBindingOperationRef(value.operation) && isOptionalString(value.path)
|
|
500
|
-
: typeof value.path === 'string'));
|
|
501
|
-
}
|
|
502
|
-
function isBindingOperationRef(value) {
|
|
503
|
-
return (isRecord(value) &&
|
|
504
|
-
typeof value.dataSourceId === 'string' &&
|
|
505
|
-
typeof value.operationId === 'string' &&
|
|
506
|
-
isOptionalString(value.endpointId));
|
|
507
|
-
}
|
|
508
|
-
function isBindingFallback(value) {
|
|
509
|
-
return (isRecord(value) &&
|
|
510
|
-
(value.value === undefined || isManifestValue(value.value)) &&
|
|
511
|
-
(value.source === undefined || isBindingValueSource(value.source)));
|
|
512
|
-
}
|
|
513
|
-
function isBindingLifecycleBehavior(value) {
|
|
514
|
-
return (isRecord(value) &&
|
|
515
|
-
typeof value.state === 'string' &&
|
|
516
|
-
['empty', 'error', 'loading'].includes(value.state) &&
|
|
517
|
-
(value.fallback === undefined || isBindingFallback(value.fallback)) &&
|
|
518
|
-
isOptionalString(value.message));
|
|
519
|
-
}
|
|
520
|
-
function isOptionalBindingTransforms(value) {
|
|
521
|
-
return (value === undefined ||
|
|
522
|
-
(Array.isArray(value) &&
|
|
523
|
-
value.every((transform) => ['lowercase', 'trim', 'uppercase'].includes(String(transform)))));
|
|
524
|
-
}
|
|
525
|
-
function isScreenDataLoaderDefinition(value) {
|
|
526
|
-
return (isRecord(value) &&
|
|
527
|
-
value.kind === 'operation' &&
|
|
528
|
-
isOptionalString(value.id) &&
|
|
529
|
-
isBindingOperationRef(value.operation) &&
|
|
530
|
-
(value.input === undefined || isBindingInputMap(value.input)));
|
|
531
|
-
}
|
|
532
|
-
function isBindingInputMap(value) {
|
|
533
|
-
return isRecord(value) && Object.values(value).every(isBindingInputValue);
|
|
534
|
-
}
|
|
535
|
-
function isBindingInputValue(value) {
|
|
536
|
-
return (isRecord(value) &&
|
|
537
|
-
typeof value.kind === 'string' &&
|
|
538
|
-
((value.kind === 'array' &&
|
|
539
|
-
Array.isArray(value.items) &&
|
|
540
|
-
value.items.every(isBindingInputValue)) ||
|
|
541
|
-
(value.kind === 'literal' && isManifestValue(value.value)) ||
|
|
542
|
-
(value.kind === 'object' && isBindingInputMap(value.fields)) ||
|
|
543
|
-
(value.kind === 'source' &&
|
|
544
|
-
isBindingValueSource(value.source) &&
|
|
545
|
-
isOptionalBindingTransforms(value.transforms))));
|
|
546
|
-
}
|
|
547
|
-
export function isAppManifest(value) {
|
|
548
|
-
return (isRecord(value) &&
|
|
549
|
-
isRecord(value.metadata) &&
|
|
550
|
-
typeof value.metadata.name === 'string' &&
|
|
551
|
-
typeof value.metadata.slug === 'string' &&
|
|
552
|
-
typeof value.metadata.version === 'string' &&
|
|
553
|
-
isAppCategory(value.metadata.category) &&
|
|
554
|
-
typeof value.metadata.themeId === 'string' &&
|
|
555
|
-
(value.metadata.created === undefined || typeof value.metadata.created === 'string') &&
|
|
556
|
-
(value.metadata.updated === undefined || typeof value.metadata.updated === 'string') &&
|
|
557
|
-
Array.isArray(value.themes) &&
|
|
558
|
-
value.themes.every(isThemeConfig) &&
|
|
559
|
-
typeof value.activeThemeId === 'string' &&
|
|
560
|
-
(value.activeThemeMode === undefined ||
|
|
561
|
-
value.activeThemeMode === 'dark' ||
|
|
562
|
-
value.activeThemeMode === 'light') &&
|
|
563
|
-
(value.splashScreen === undefined || isSplashScreenSpec(value.splashScreen)) &&
|
|
564
|
-
isInfraManifest(value.infra) &&
|
|
565
|
-
isNavigatorSpec(value.navigator) &&
|
|
566
|
-
isScreenRegistry(value.screens) &&
|
|
567
|
-
(value.generatedApis === undefined || isGeneratedApiRegistry(value.generatedApis)) &&
|
|
568
|
-
(value.dataSources === undefined || isDataSourceRegistry(value.dataSources)) &&
|
|
569
|
-
(value.dataBindings === undefined || isComponentDataBindingRegistry(value.dataBindings)) &&
|
|
570
|
-
isAppSettings(value.settings));
|
|
571
|
-
}
|
|
572
12
|
//# sourceMappingURL=contractGuards.js.map
|