@env-hopper/backend-core 2.0.1-alpha → 2.0.1-alpha.1

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 (66) hide show
  1. package/dist/index.d.ts +1584 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +1806 -0
  4. package/dist/index.js.map +1 -0
  5. package/package.json +26 -11
  6. package/prisma/migrations/20250526183023_init/migration.sql +71 -0
  7. package/prisma/migrations/migration_lock.toml +3 -0
  8. package/prisma/schema.prisma +121 -0
  9. package/src/db/client.ts +34 -0
  10. package/src/db/index.ts +17 -0
  11. package/src/db/syncAppCatalog.ts +67 -0
  12. package/src/db/tableSyncMagazine.ts +22 -0
  13. package/src/db/tableSyncPrismaAdapter.ts +202 -0
  14. package/src/index.ts +96 -3
  15. package/src/modules/admin/chat/createAdminChatHandler.ts +152 -0
  16. package/src/modules/admin/chat/createDatabaseTools.ts +261 -0
  17. package/src/modules/appCatalog/service.ts +79 -0
  18. package/src/modules/appCatalogAdmin/appCatalogAdminRouter.ts +113 -0
  19. package/src/modules/assets/assetRestController.ts +309 -0
  20. package/src/modules/assets/assetUtils.ts +81 -0
  21. package/src/modules/assets/screenshotRestController.ts +195 -0
  22. package/src/modules/assets/screenshotRouter.ts +116 -0
  23. package/src/modules/assets/syncAssets.ts +261 -0
  24. package/src/modules/auth/auth.ts +51 -0
  25. package/src/modules/auth/authProviders.ts +108 -0
  26. package/src/modules/auth/authRouter.ts +77 -0
  27. package/src/modules/auth/authorizationUtils.ts +114 -0
  28. package/src/modules/auth/registerAuthRoutes.ts +33 -0
  29. package/src/modules/icons/iconRestController.ts +190 -0
  30. package/src/modules/icons/iconRouter.ts +157 -0
  31. package/src/modules/icons/iconService.ts +73 -0
  32. package/src/server/controller.ts +102 -29
  33. package/src/server/ehStaticControllerContract.ts +8 -1
  34. package/src/server/ehTrpcContext.ts +0 -6
  35. package/src/types/backend/api.ts +1 -14
  36. package/src/types/backend/companySpecificBackend.ts +17 -0
  37. package/src/types/common/appCatalogTypes.ts +167 -0
  38. package/src/types/common/dataRootTypes.ts +72 -10
  39. package/src/types/index.ts +2 -0
  40. package/dist/esm/__tests__/dummy.test.d.ts +0 -1
  41. package/dist/esm/index.d.ts +0 -7
  42. package/dist/esm/index.js +0 -9
  43. package/dist/esm/index.js.map +0 -1
  44. package/dist/esm/server/controller.d.ts +0 -32
  45. package/dist/esm/server/controller.js +0 -35
  46. package/dist/esm/server/controller.js.map +0 -1
  47. package/dist/esm/server/db.d.ts +0 -2
  48. package/dist/esm/server/ehStaticControllerContract.d.ts +0 -9
  49. package/dist/esm/server/ehStaticControllerContract.js +0 -12
  50. package/dist/esm/server/ehStaticControllerContract.js.map +0 -1
  51. package/dist/esm/server/ehTrpcContext.d.ts +0 -8
  52. package/dist/esm/server/ehTrpcContext.js +0 -11
  53. package/dist/esm/server/ehTrpcContext.js.map +0 -1
  54. package/dist/esm/types/backend/api.d.ts +0 -71
  55. package/dist/esm/types/backend/common.d.ts +0 -9
  56. package/dist/esm/types/backend/dataSources.d.ts +0 -20
  57. package/dist/esm/types/backend/deployments.d.ts +0 -34
  58. package/dist/esm/types/common/app/appTypes.d.ts +0 -12
  59. package/dist/esm/types/common/app/ui/appUiTypes.d.ts +0 -10
  60. package/dist/esm/types/common/appCatalogTypes.d.ts +0 -16
  61. package/dist/esm/types/common/dataRootTypes.d.ts +0 -32
  62. package/dist/esm/types/common/env/envTypes.d.ts +0 -6
  63. package/dist/esm/types/common/resourceTypes.d.ts +0 -8
  64. package/dist/esm/types/common/sharedTypes.d.ts +0 -4
  65. package/dist/esm/types/index.d.ts +0 -11
  66. package/src/server/db.ts +0 -4
@@ -1,3 +1,170 @@
1
+ /**
2
+ * App Catalog Types - Universal Software Access Request Catalog
3
+ *
4
+ * These types define a standardized catalog of software applications and their
5
+ * access methods. The typing system is designed to be universal across companies,
6
+ * abstracting away specific tools (Jira, Slack, etc.) into generic categories.
7
+ */
8
+
9
+ // ============================================================================
10
+ // ACCESS METHOD PROVIDER CONFIGURATION
11
+ // ============================================================================
12
+
13
+ /**
14
+ * Bot provider configuration - for chat/AI bots that handle access requests
15
+ */
16
+ export interface BotProvider {
17
+ id: string
18
+ name: string
19
+ platform?: 'slack' | 'teams' | 'web' | 'other'
20
+ url?: string
21
+ icon?: string
22
+ instructions?: string
23
+ }
24
+
25
+ /**
26
+ * Ticketing system provider configuration
27
+ */
28
+ export interface TicketingProvider {
29
+ id: string
30
+ name: string
31
+ system: 'jira' | 'servicenow' | 'zendesk' | 'freshdesk' | 'other'
32
+ baseUrl: string
33
+ icon?: string
34
+ }
35
+
36
+ // ============================================================================
37
+ // UNIVERSAL ACCESS METHOD TYPES
38
+ // ============================================================================
39
+
40
+ /**
41
+ * Bot-based access - request access through a chat bot
42
+ */
43
+ export interface BotAccess {
44
+ type: 'bot'
45
+ providerId: string
46
+ prompt: string
47
+ }
48
+
49
+ /**
50
+ * Ticketing system access - submit a ticket/request
51
+ */
52
+ export interface TicketingAccess {
53
+ type: 'ticketing'
54
+ providerId: string
55
+ queue?: string
56
+ portalPath?: string
57
+ formId?: string
58
+ }
59
+
60
+ /**
61
+ * Email-based access - contact specific people via email
62
+ */
63
+ export interface EmailAccess {
64
+ type: 'email'
65
+ contacts: Array<{
66
+ name?: string
67
+ email: string
68
+ role?: string
69
+ }>
70
+ subject?: string
71
+ template?: string
72
+ }
73
+
74
+ /**
75
+ * Self-service access - no approval needed, just follow instructions
76
+ */
77
+ export interface SelfServiceAccess {
78
+ type: 'self-service'
79
+ url?: string
80
+ instructions: string
81
+ }
82
+
83
+ /**
84
+ * Documentation-based access - refer to external documentation
85
+ */
86
+ export interface DocumentationAccess {
87
+ type: 'documentation'
88
+ url: string
89
+ title?: string
90
+ }
91
+
92
+ /**
93
+ * Manual/custom access - step-by-step instructions
94
+ */
95
+ export interface ManualAccess {
96
+ type: 'manual'
97
+ instructions: string
98
+ steps?: Array<string>
99
+ }
100
+
101
+ /**
102
+ * Union type for all access methods
103
+ */
104
+ export type AccessMethod =
105
+ | BotAccess
106
+ | TicketingAccess
107
+ | EmailAccess
108
+ | SelfServiceAccess
109
+ | DocumentationAccess
110
+ | ManualAccess
111
+
112
+ // ============================================================================
113
+ // APP CATALOG TYPES
114
+ // ============================================================================
115
+
116
+ /**
117
+ * Approver information for apps that require specific approval
118
+ */
119
+ export interface Approver {
120
+ name: string
121
+ email: string
122
+ }
123
+
124
+ /**
125
+ * Available roles for an application
126
+ */
127
+ export interface AppRole {
128
+ id: string
129
+ name: string
130
+ description?: string
131
+ }
132
+
133
+ /**
134
+ * Application entry in the catalog
135
+ */
136
+ export interface AppForCatalog {
137
+ id: string
138
+ slug: string
139
+ displayName: string
140
+ description?: string
141
+ access?: AccessMethod
142
+ teams?: Array<string>
143
+ roles?: Array<AppRole>
144
+ approver?: Approver
145
+ notes?: string
146
+ tags?: Array<string>
147
+ appUrl?: string
148
+ links?: Array<{ url: string; title?: string }>
149
+ iconName?: string // Optional icon identifier for display
150
+ screenshotIds?: Array<string>
151
+ }
152
+
153
+ // Derived catalog data returned by backend
154
+ export interface AppCategory {
155
+ id: string
156
+ name: string
157
+ }
158
+
159
+ export interface AppCatalogData {
160
+ apps: Array<AppForCatalog>
161
+ categories: Array<AppCategory>
162
+ }
163
+
164
+ // ============================================================================
165
+ // LEGACY DATA STRUCTURES (kept for backward compatibility)
166
+ // ============================================================================
167
+
1
168
  export interface EhAppCatalogData {
2
169
  apps: Array<EhAppCatalogDto>
3
170
  }
@@ -1,8 +1,9 @@
1
+ import type { DefaultWithOverridesAndTemplate } from '@env-hopper/shared-core'
1
2
  import type { EhAppsMeta, EhContextIndexed } from '../backend/api.js'
2
- import type { EhEnvIndexed } from './env/envTypes.js'
3
3
  import type { EhAppIndexed } from './app/appTypes.js'
4
+ import type { EhEnvIndexed } from './env/envTypes.js'
4
5
 
5
- export type JumpResouceSlug = string
6
+ export type JumpResourceSlug = string
6
7
  export type EnvSlug = string
7
8
 
8
9
  export interface BootstrapConfigData {
@@ -12,13 +13,13 @@ export interface BootstrapConfigData {
12
13
  contexts: Array<EhContextIndexed>
13
14
  defaults: {
14
15
  envSlug: EnvSlug
15
- resourceJumpSlug: JumpResouceSlug
16
+ resourceJumpSlug: JumpResourceSlug
16
17
  }
17
18
  }
18
19
 
19
- export interface AvailiabilityMatrixData {
20
+ export interface AvailabilityMatrixData {
20
21
  envSlugs: Array<EnvSlug>
21
- resourceJumpSlugs: Array<JumpResouceSlug>
22
+ resourceJumpSlugs: Array<JumpResourceSlug>
22
23
  availabilityVariants: Array<AvailabilityVariant>
23
24
  matrix: Array<Array<number>>
24
25
  }
@@ -29,10 +30,71 @@ export interface AvailabilityVariant {
29
30
  hasData?: boolean
30
31
  }
31
32
 
33
+ export type ResourceJumpMetaInfo = Record<string, string>
34
+
35
+ export interface Sluggable {
36
+ slug: string
37
+ }
38
+
39
+ export interface DisplayNamable {
40
+ displayName: string
41
+ }
42
+
43
+ export interface SlugAndDisplayable extends Sluggable, DisplayNamable {
44
+ slug: string
45
+ displayName: string
46
+ }
47
+
48
+ export interface EnvBaseInfo extends SlugAndDisplayable {
49
+ slug: string
50
+ displayName: string
51
+ templateParams?: Record<string, string>
52
+ }
53
+
54
+ export interface LateResolvableParam extends SlugAndDisplayable {
55
+ slug: string
56
+ displayName: string
57
+ }
58
+
59
+ export interface ResourceJump extends SlugAndDisplayable {
60
+ slug: string
61
+ displayName: string
62
+ urlTemplate: DefaultWithOverridesAndTemplate
63
+ lateResolvableParamSlugs?: Array<string>
64
+ }
65
+
66
+ export interface ResourceJumpGroup {
67
+ slug: string
68
+ displayName: string
69
+ resourceSlugs: Array<string> // First item is primary, rest are children
70
+ }
71
+
32
72
  export interface ResourceJumpsData {
33
- // key - jump Resouce
34
- baseResouceJumpUrls: Record<JumpResouceSlug, string>
35
- resourceJumpsData: Record<JumpResouceSlug, Record<string, string>>
36
- envData: Record<EnvSlug, Record<string, string>>
37
- overrideResoucesJumpsUrls: Record<EnvSlug, Record<JumpResouceSlug, string>>
73
+ resourceJumps: Array<ResourceJump>
74
+ envs: Array<EnvBaseInfo>
75
+ lateResolvableParams: Array<LateResolvableParam>
76
+ groups?: Array<ResourceJumpGroup>
77
+ }
78
+
79
+ export interface ResourceJumpsExtendedData {
80
+ // resourceJumps: Array<Pick<ResourceJump, 'slug'>>
81
+ envs: Array<EnvInfoExtended>
82
+ // groups?: Array<ResourceJumpGroup>
83
+ }
84
+
85
+ export interface EnvInfoExtended extends Sluggable {
86
+ slug: string
87
+ description?: string
88
+ owner?: User
89
+ }
90
+
91
+ // export interface ResourceJumpExtended extends Sluggable {
92
+ // slug: string
93
+ // description?: string;
94
+ // owner?: User;
95
+ // }
96
+
97
+ export interface User {
98
+ id: string
99
+ displayName: string
38
100
  }
@@ -14,6 +14,8 @@ export * from './backend/api.js'
14
14
  export * from './backend/common.js'
15
15
  // Data source types
16
16
  export * from './backend/dataSources.js'
17
+ // Company specific backend types
18
+ export * from './backend/companySpecificBackend.js'
17
19
 
18
20
  // Deployment and version types
19
21
  export * from './backend/deployments.js'
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- export { trpcRouter } from './server/controller.js';
2
- export type { TRPCRouter } from './server/controller.js';
3
- export { createEhTrpcContext } from './server/ehTrpcContext.js';
4
- export type { EhTrpcContext, EhTrpcContextOptions, } from './server/ehTrpcContext.js';
5
- export { staticControllerContract } from './server/ehStaticControllerContract.js';
6
- export type { EhStaticControllerContract } from './server/ehStaticControllerContract.js';
7
- export * from './types/index.js';
package/dist/esm/index.js DELETED
@@ -1,9 +0,0 @@
1
- import { trpcRouter } from "./server/controller.js";
2
- import { createEhTrpcContext } from "./server/ehTrpcContext.js";
3
- import { staticControllerContract } from "./server/ehStaticControllerContract.js";
4
- export {
5
- createEhTrpcContext,
6
- staticControllerContract,
7
- trpcRouter
8
- };
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,32 +0,0 @@
1
- import { EhTrpcContext } from './ehTrpcContext.js';
2
- export declare const trpcRouter: import('@trpc/server').TRPCBuiltRouter<{
3
- ctx: EhTrpcContext;
4
- meta: {};
5
- errorShape: import('@trpc/server').TRPCDefaultErrorShape;
6
- transformer: false;
7
- }, import('@trpc/server').TRPCDecorateCreateRouterOptions<{
8
- bootstrap: import('@trpc/server').TRPCQueryProcedure<{
9
- input: void;
10
- output: import('..').BootstrapConfigData;
11
- meta: {};
12
- }>;
13
- availabilityMatrix: import('@trpc/server').TRPCQueryProcedure<{
14
- input: void;
15
- output: import('..').AvailiabilityMatrixData;
16
- meta: {};
17
- }>;
18
- tryFindRenameRule: import('@trpc/server').TRPCQueryProcedure<{
19
- input: {
20
- envSlug?: string | undefined;
21
- resourceSlug?: string | undefined;
22
- };
23
- output: false | import('..').RenameRule;
24
- meta: {};
25
- }>;
26
- resourceJumps: import('@trpc/server').TRPCQueryProcedure<{
27
- input: void;
28
- output: import('..').ResourceJumpsData;
29
- meta: {};
30
- }>;
31
- }>>;
32
- export type TRPCRouter = typeof trpcRouter;
@@ -1,35 +0,0 @@
1
- import { initTRPC } from "@trpc/server";
2
- import z from "zod";
3
- const t = initTRPC.context().create();
4
- const router = t.router;
5
- const publicProcedure = t.procedure;
6
- const trpcRouter = router({
7
- bootstrap: publicProcedure.query(async ({ ctx }) => {
8
- return await ctx.companySpecificBackend.getBootstrapData();
9
- }),
10
- availabilityMatrix: publicProcedure.query(async ({ ctx }) => {
11
- return await ctx.companySpecificBackend.getAvailabilityMatrix();
12
- }),
13
- tryFindRenameRule: publicProcedure.input(
14
- z.object({
15
- envSlug: z.string().optional(),
16
- resourceSlug: z.string().optional()
17
- })
18
- ).query(async ({ input, ctx }) => {
19
- return await ctx.companySpecificBackend.getNameMigrations(input);
20
- }),
21
- resourceJumps: publicProcedure.query(async ({ ctx }) => {
22
- return await ctx.companySpecificBackend.getResourceJumps();
23
- })
24
- // specificEnvs: publicProcedure
25
- // .query(async ({ctx}) => {
26
- // return await ctx.companySpecificBackend.getDeployments({
27
- // envNames: ['dev', 'prod'],
28
- // appNames: ['app1', 'app2'],
29
- // })
30
- // }),
31
- });
32
- export {
33
- trpcRouter
34
- };
35
- //# sourceMappingURL=controller.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"controller.js","sources":["../../../src/server/controller.ts"],"sourcesContent":["import { initTRPC } from '@trpc/server'\nimport z from 'zod'\nimport type { EhTrpcContext } from './ehTrpcContext'\nimport type { TRPCRootObject } from '@trpc/server'\n\n/**\n * Initialization of tRPC backend\n * Should be done only once per backend!\n */\nconst t: TRPCRootObject<EhTrpcContext, {}, {}> = initTRPC\n .context<EhTrpcContext>()\n .create()\n\n/**\n * Export reusable router and procedure helpers\n * that can be used throughout the router\n */\nconst router: typeof t.router = t.router\nconst publicProcedure: typeof t.procedure = t.procedure\n\nexport const trpcRouter = router({\n bootstrap: publicProcedure.query(async ({ ctx }) => {\n return await ctx.companySpecificBackend.getBootstrapData()\n }),\n\n availabilityMatrix: publicProcedure.query(async ({ ctx }) => {\n return await ctx.companySpecificBackend.getAvailabilityMatrix()\n }),\n\n tryFindRenameRule: publicProcedure\n .input(\n z.object({\n envSlug: z.string().optional(),\n resourceSlug: z.string().optional(),\n }),\n )\n .query(async ({ input, ctx }) => {\n return await ctx.companySpecificBackend.getNameMigrations(input)\n }),\n\n resourceJumps: publicProcedure.query(async ({ ctx }) => {\n return await ctx.companySpecificBackend.getResourceJumps()\n }),\n\n // specificEnvs: publicProcedure\n // .query(async ({ctx}) => {\n // return await ctx.companySpecificBackend.getDeployments({\n // envNames: ['dev', 'prod'],\n // appNames: ['app1', 'app2'],\n // })\n // }),\n})\n\nexport type TRPCRouter = typeof trpcRouter\n"],"names":[],"mappings":";;AASA,MAAM,IAA2C,SAC9C,QAAA,EACA,OAAA;AAMH,MAAM,SAA0B,EAAE;AAClC,MAAM,kBAAsC,EAAE;AAEvC,MAAM,aAAa,OAAO;AAAA,EAC/B,WAAW,gBAAgB,MAAM,OAAO,EAAE,UAAU;AAClD,WAAO,MAAM,IAAI,uBAAuB,iBAAA;AAAA,EAC1C,CAAC;AAAA,EAED,oBAAoB,gBAAgB,MAAM,OAAO,EAAE,UAAU;AAC3D,WAAO,MAAM,IAAI,uBAAuB,sBAAA;AAAA,EAC1C,CAAC;AAAA,EAED,mBAAmB,gBAChB;AAAA,IACC,EAAE,OAAO;AAAA,MACP,SAAS,EAAE,OAAA,EAAS,SAAA;AAAA,MACpB,cAAc,EAAE,OAAA,EAAS,SAAA;AAAA,IAAS,CACnC;AAAA,EAAA,EAEF,MAAM,OAAO,EAAE,OAAO,UAAU;AAC/B,WAAO,MAAM,IAAI,uBAAuB,kBAAkB,KAAK;AAAA,EACjE,CAAC;AAAA,EAEH,eAAe,gBAAgB,MAAM,OAAO,EAAE,UAAU;AACtD,WAAO,MAAM,IAAI,uBAAuB,iBAAA;AAAA,EAC1C,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASH,CAAC;"}
@@ -1,2 +0,0 @@
1
- import { PrismaClient } from '@prisma/client';
2
- export declare const db: PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import('@prisma/client/runtime/library').DefaultArgs>;
@@ -1,9 +0,0 @@
1
- export interface EhStaticControllerContract {
2
- methods: {
3
- getIcon: {
4
- method: string;
5
- url: string;
6
- };
7
- };
8
- }
9
- export declare const staticControllerContract: EhStaticControllerContract;
@@ -1,12 +0,0 @@
1
- const staticControllerContract = {
2
- methods: {
3
- getIcon: {
4
- method: "get",
5
- url: "icon/:icon"
6
- }
7
- }
8
- };
9
- export {
10
- staticControllerContract
11
- };
12
- //# sourceMappingURL=ehStaticControllerContract.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ehStaticControllerContract.js","sources":["../../../src/server/ehStaticControllerContract.ts"],"sourcesContent":["export interface EhStaticControllerContract {\n methods: { getIcon: { method: string; url: string } }\n}\n\nexport const staticControllerContract: EhStaticControllerContract = {\n methods: {\n getIcon: {\n method: 'get',\n url: 'icon/:icon',\n },\n },\n}\n"],"names":[],"mappings":"AAIO,MAAM,2BAAuD;AAAA,EAClE,SAAS;AAAA,IACP,SAAS;AAAA,MACP,QAAQ;AAAA,MACR,KAAK;AAAA,IAAA;AAAA,EACP;AAEJ;"}
@@ -1,8 +0,0 @@
1
- import { EhBackendCompanySpecificBackend } from '../types.js';
2
- export interface EhTrpcContext {
3
- companySpecificBackend: EhBackendCompanySpecificBackend;
4
- }
5
- export interface EhTrpcContextOptions {
6
- companySpecificBackend: EhBackendCompanySpecificBackend;
7
- }
8
- export declare function createEhTrpcContext({ companySpecificBackend, }: EhTrpcContextOptions): EhTrpcContext;
@@ -1,11 +0,0 @@
1
- function createEhTrpcContext({
2
- companySpecificBackend
3
- }) {
4
- return {
5
- companySpecificBackend
6
- };
7
- }
8
- export {
9
- createEhTrpcContext
10
- };
11
- //# sourceMappingURL=ehTrpcContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ehTrpcContext.js","sources":["../../../src/server/ehTrpcContext.ts"],"sourcesContent":["import type { EhBackendCompanySpecificBackend } from '../types'\n\nexport interface EhTrpcContext {\n companySpecificBackend: EhBackendCompanySpecificBackend\n}\n\nexport interface EhTrpcContextOptions {\n companySpecificBackend: EhBackendCompanySpecificBackend\n}\n\nexport function createEhTrpcContext({\n companySpecificBackend,\n}: EhTrpcContextOptions): EhTrpcContext {\n return {\n companySpecificBackend,\n }\n}\n\n// const createContext = ({\n// req,\n// res\n// }: trpcExpress.CreateExpressContextOptions) => ({}); // no context\n// type Context = Awaited<ReturnType<typeof createContext>>;\n"],"names":[],"mappings":"AAUO,SAAS,oBAAoB;AAAA,EAClC;AACF,GAAwC;AACtC,SAAO;AAAA,IACL;AAAA,EAAA;AAEJ;"}
@@ -1,71 +0,0 @@
1
- import { AvailiabilityMatrixData, BootstrapConfigData, ResourceJumpsData } from '../common/dataRootTypes.js';
2
- import { EhAppIndexed } from '../common/app/appTypes.js';
3
- import { EhAppPageIndexed, EhAppUiIndexed } from '../common/app/ui/appUiTypes.js';
4
- import { EhBackendCredentialInput, EhBackendUiDefaultsInput } from './common.js';
5
- import { EhBackendDataSourceInput } from './dataSources.js';
6
- export interface EhBackendVersionsRequestParams {
7
- envNames: Array<string>;
8
- appNames: Array<string>;
9
- }
10
- export interface EhBackendVersionsReturn {
11
- envIds: Array<string>;
12
- appIds: Array<string>;
13
- }
14
- export interface EhBackendPageInput extends EhAppPageIndexed {
15
- slug: string;
16
- title?: string;
17
- url: string;
18
- credentialsRefs?: Array<string>;
19
- }
20
- export interface EhBackendAppUIBaseInput {
21
- credentials?: Array<EhBackendCredentialInput>;
22
- defaults?: EhBackendUiDefaultsInput;
23
- }
24
- export interface EhBackendAppUIInput extends EhBackendAppUIBaseInput, EhAppUiIndexed {
25
- pages: Array<EhBackendPageInput>;
26
- }
27
- export interface EhBackendTagsDescriptionDataIndexed {
28
- descriptions: Array<EhBackendTagDescriptionDataIndexed>;
29
- }
30
- export interface EhBackendTagDescriptionDataIndexed {
31
- tagKey: string;
32
- displayName?: string;
33
- fixedTagValues?: Array<EhBackendTagFixedTagValue>;
34
- }
35
- export interface EhBackendTagFixedTagValue {
36
- tagValue: string;
37
- displayName: string;
38
- }
39
- export interface EhBackendAppInput extends EhAppIndexed {
40
- ui?: EhBackendAppUIInput;
41
- dataSources?: Array<EhBackendDataSourceInput>;
42
- }
43
- export interface EhContextIndexed {
44
- slug: string;
45
- displayName: string;
46
- /**
47
- * The value is shared across envs (By default: false)
48
- */
49
- isSharedAcrossEnvs?: boolean;
50
- defaultFixedValues?: Array<string>;
51
- }
52
- export type EhBackendAppDto = EhAppIndexed;
53
- export interface EhAppsMeta {
54
- defaultIcon?: string;
55
- tags: EhBackendTagsDescriptionDataIndexed;
56
- }
57
- export interface RenameRuleParams {
58
- envSlug?: string;
59
- resourceSlug?: string;
60
- }
61
- export interface RenameRule {
62
- type: 'resourceRename' | 'envRename';
63
- oldSlug: string;
64
- targetSlug: string;
65
- }
66
- export interface EhBackendCompanySpecificBackend {
67
- getBootstrapData: () => Promise<BootstrapConfigData>;
68
- getAvailabilityMatrix: () => Promise<AvailiabilityMatrixData>;
69
- getNameMigrations: (params: RenameRuleParams) => Promise<RenameRule | false>;
70
- getResourceJumps: () => Promise<ResourceJumpsData>;
71
- }
@@ -1,9 +0,0 @@
1
- export interface EhBackendUiDefaultsInput {
2
- credentialsRefs: Array<string>;
3
- }
4
- export interface EhBackendCredentialInput {
5
- slug: string;
6
- desc?: string;
7
- username: string;
8
- password: string;
9
- }
@@ -1,20 +0,0 @@
1
- import { EhMetaDictionary } from '../common/sharedTypes.js';
2
- export interface EhBackendDataSourceInputCommon {
3
- meta?: EhMetaDictionary;
4
- }
5
- export interface EhBackendDataSourceInputDb {
6
- slug?: string;
7
- type: 'db';
8
- url: string;
9
- username: string;
10
- password: string;
11
- }
12
- export interface EhBackendDataSourceInputKafka {
13
- slug?: string;
14
- type: 'kafka';
15
- topics: {
16
- consumer?: Array<string>;
17
- producer?: Array<string>;
18
- };
19
- }
20
- export type EhBackendDataSourceInput = EhBackendDataSourceInputCommon & (EhBackendDataSourceInputDb | EhBackendDataSourceInputKafka);
@@ -1,34 +0,0 @@
1
- import { EhMetaDictionary } from '../common/sharedTypes.js';
2
- export interface EhBackendEnvironmentInput {
3
- slug: string;
4
- displayName?: string;
5
- description?: string;
6
- meta?: EhMetaDictionary;
7
- }
8
- export interface EhBackendDeploymentInput {
9
- envId: string;
10
- appId: string;
11
- displayVersion: string;
12
- meta?: EhMetaDictionary;
13
- }
14
- export interface EhBackendDeployableInput {
15
- slug: string;
16
- meta?: {
17
- config: string;
18
- };
19
- }
20
- /**
21
- * Latest - backend returned latest data.
22
- * Cached - backend in process of updating data, but returned cached data.
23
- */
24
- export type EhBackendDataFreshness = 'latest' | 'cached';
25
- export interface EhBackendDataVersion {
26
- version: string;
27
- freshness: EhBackendDataFreshness;
28
- }
29
- export interface EhBackendDeployment {
30
- appName: string;
31
- deployableServiceName: string;
32
- envName: string;
33
- version: EhBackendDataVersion;
34
- }
@@ -1,12 +0,0 @@
1
- import { EhMetaDictionary, Tag } from '../sharedTypes.js';
2
- import { EhAppUiIndexed } from './ui/appUiTypes.js';
3
- export interface EhAppIndexed {
4
- slug: string;
5
- displayName: string;
6
- abbr?: string;
7
- aliases?: Array<string>;
8
- ui?: EhAppUiIndexed;
9
- tags?: Array<Tag>;
10
- iconName?: string;
11
- meta?: EhMetaDictionary;
12
- }
@@ -1,10 +0,0 @@
1
- import { Tag } from '../../sharedTypes.js';
2
- export interface EhAppPageIndexed {
3
- slug: string;
4
- displayName: string;
5
- url: string;
6
- tags?: Array<Tag>;
7
- }
8
- export interface EhAppUiIndexed {
9
- pages: Array<EhAppPageIndexed>;
10
- }
@@ -1,16 +0,0 @@
1
- export interface EhAppCatalogData {
2
- apps: Array<EhAppCatalogDto>;
3
- }
4
- export interface EhAppCatalogDto {
5
- slug: string;
6
- groups: Array<EhAppCatalogGroupDto>;
7
- }
8
- export interface EhAppCatalogGroupDto {
9
- slug: string;
10
- displayName: string;
11
- pages: Array<EhAppCatalogPageDto>;
12
- }
13
- export interface EhAppCatalogPageDto {
14
- slug: string;
15
- displayName: string;
16
- }
@@ -1,32 +0,0 @@
1
- import { EhAppsMeta, EhContextIndexed } from '../backend/api.js';
2
- import { EhEnvIndexed } from './env/envTypes.js';
3
- import { EhAppIndexed } from './app/appTypes.js';
4
- export type JumpResouceSlug = string;
5
- export type EnvSlug = string;
6
- export interface BootstrapConfigData {
7
- envs: Record<EnvSlug, EhEnvIndexed>;
8
- apps: Record<string, EhAppIndexed>;
9
- appsMeta: EhAppsMeta;
10
- contexts: Array<EhContextIndexed>;
11
- defaults: {
12
- envSlug: EnvSlug;
13
- resourceJumpSlug: JumpResouceSlug;
14
- };
15
- }
16
- export interface AvailiabilityMatrixData {
17
- envSlugs: Array<EnvSlug>;
18
- resourceJumpSlugs: Array<JumpResouceSlug>;
19
- availabilityVariants: Array<AvailabilityVariant>;
20
- matrix: Array<Array<number>>;
21
- }
22
- export interface AvailabilityVariant {
23
- isDeployed: boolean;
24
- isHealthy?: boolean;
25
- hasData?: boolean;
26
- }
27
- export interface ResourceJumpsData {
28
- baseResouceJumpUrls: Record<JumpResouceSlug, string>;
29
- resourceJumpsData: Record<JumpResouceSlug, Record<string, string>>;
30
- envData: Record<EnvSlug, Record<string, string>>;
31
- overrideResoucesJumpsUrls: Record<EnvSlug, Record<JumpResouceSlug, string>>;
32
- }
@@ -1,6 +0,0 @@
1
- import { EhMetaDictionary } from '../sharedTypes.js';
2
- export interface EhEnvIndexed {
3
- slug: string;
4
- displayName: string;
5
- meta?: EhMetaDictionary;
6
- }