@lilaquadrat/interfaces 2.0.0 → 2.2.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/lib/cjs/Design.d.ts +3 -0
  3. package/lib/cjs/DesignInput.d.ts +12 -0
  4. package/lib/cjs/DesignListOptions.d.ts +12 -0
  5. package/lib/cjs/KeycloakAdminOptions.d.ts +26 -0
  6. package/lib/cjs/KeycloakClientRepresentation.d.ts +30 -0
  7. package/lib/cjs/KeycloakClientUrls.d.ts +19 -0
  8. package/lib/cjs/KeycloakFederatedIdentity.d.ts +8 -0
  9. package/lib/cjs/KeycloakRealm.d.ts +5 -0
  10. package/lib/cjs/KeycloakUser.d.ts +10 -0
  11. package/lib/cjs/KeycloakUserRepresentation.d.ts +13 -0
  12. package/lib/cjs/Project.d.ts +5 -0
  13. package/lib/cjs/ProjectDesign.d.ts +5 -0
  14. package/lib/cjs/index.d.ts +10 -0
  15. package/lib/esm/Design.d.ts +3 -0
  16. package/lib/esm/DesignInput.d.ts +12 -0
  17. package/lib/esm/DesignInput.js +2 -0
  18. package/lib/esm/DesignInput.js.map +1 -0
  19. package/lib/esm/DesignListOptions.d.ts +12 -0
  20. package/lib/esm/DesignListOptions.js +2 -0
  21. package/lib/esm/DesignListOptions.js.map +1 -0
  22. package/lib/esm/KeycloakAdminOptions.d.ts +26 -0
  23. package/lib/esm/KeycloakAdminOptions.js +2 -0
  24. package/lib/esm/KeycloakAdminOptions.js.map +1 -0
  25. package/lib/esm/KeycloakClientRepresentation.d.ts +30 -0
  26. package/lib/esm/KeycloakClientRepresentation.js +2 -0
  27. package/lib/esm/KeycloakClientRepresentation.js.map +1 -0
  28. package/lib/esm/KeycloakClientUrls.d.ts +19 -0
  29. package/lib/esm/KeycloakClientUrls.js +2 -0
  30. package/lib/esm/KeycloakClientUrls.js.map +1 -0
  31. package/lib/esm/KeycloakFederatedIdentity.d.ts +8 -0
  32. package/lib/esm/KeycloakFederatedIdentity.js +2 -0
  33. package/lib/esm/KeycloakFederatedIdentity.js.map +1 -0
  34. package/lib/esm/KeycloakRealm.d.ts +5 -0
  35. package/lib/esm/KeycloakRealm.js +2 -0
  36. package/lib/esm/KeycloakRealm.js.map +1 -0
  37. package/lib/esm/KeycloakUser.d.ts +10 -0
  38. package/lib/esm/KeycloakUser.js +2 -0
  39. package/lib/esm/KeycloakUser.js.map +1 -0
  40. package/lib/esm/KeycloakUserRepresentation.d.ts +13 -0
  41. package/lib/esm/KeycloakUserRepresentation.js +2 -0
  42. package/lib/esm/KeycloakUserRepresentation.js.map +1 -0
  43. package/lib/esm/Project.d.ts +5 -0
  44. package/lib/esm/ProjectDesign.d.ts +5 -0
  45. package/lib/esm/ProjectDesign.js +2 -0
  46. package/lib/esm/ProjectDesign.js.map +1 -0
  47. package/lib/esm/index.d.ts +10 -0
  48. package/package.json +1 -1
  49. package/src/Design.ts +4 -1
  50. package/src/DesignInput.ts +13 -0
  51. package/src/DesignListOptions.ts +12 -0
  52. package/src/KeycloakAdminOptions.ts +33 -0
  53. package/src/KeycloakClientRepresentation.ts +47 -0
  54. package/src/KeycloakClientUrls.ts +23 -0
  55. package/src/KeycloakFederatedIdentity.ts +12 -0
  56. package/src/KeycloakRealm.ts +5 -0
  57. package/src/KeycloakUser.ts +16 -0
  58. package/src/KeycloakUserRepresentation.ts +22 -0
  59. package/src/Project.ts +6 -0
  60. package/src/ProjectDesign.ts +5 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [2.2.0](https://github.com/lilaquadrat/interfaces/compare/v2.1.0...v2.2.0) (2026-11-16)
6
+
7
+
8
+ ### Features
9
+
10
+ * **keycloak:** add admin client, client urls and realm types ([d393285](https://github.com/lilaquadrat/interfaces/commit/d393285b5e2913c4560e39160c1c23594999d00f))
11
+
12
+ ## [2.1.0](https://github.com/lilaquadrat/interfaces/compare/v2.0.0...v2.1.0) (2026-11-11)
13
+
14
+
15
+ ### Features
16
+
17
+ * **design:** address designs by id and name ([80c900d](https://github.com/lilaquadrat/interfaces/commit/80c900d7efec0fb24b3efc658c70545588e76423))
18
+
5
19
  ## [2.0.0](https://github.com/lilaquadrat/interfaces/compare/v1.57.0...v2.0.0) (2026-11-09)
6
20
 
7
21
 
@@ -2,6 +2,9 @@ import { DesignFile } from "./DesignFile";
2
2
  export interface Design {
3
3
  company: string;
4
4
  project: string;
5
+ id: string;
6
+ name: string;
7
+ description?: string;
5
8
  files: DesignFile[];
6
9
  target: 'app' | 'server';
7
10
  }
@@ -0,0 +1,12 @@
1
+ import { DesignFile } from "./DesignFile";
2
+ /**
3
+ * writes a design into the caller's project; a project's first design falls back to
4
+ * the `default` id and name, so both stay optional
5
+ */
6
+ export interface DesignInput {
7
+ id?: string;
8
+ name?: string;
9
+ description?: string;
10
+ target: 'app' | 'server';
11
+ files: DesignFile[];
12
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * one page of the designs a project may pick from: its own plus the shared library
3
+ */
4
+ export interface DesignListOptions {
5
+ company: string;
6
+ project: string;
7
+ search?: string;
8
+ sort?: string;
9
+ order?: number;
10
+ site: number;
11
+ limit: number;
12
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * credentials and realm of a keycloak admin client. the admin api is realm scoped and the
3
+ * credentials belong to a service account inside that realm, so one instance serves one realm.
4
+ */
5
+ export interface KeycloakAdminOptions {
6
+ /**
7
+ * issuer of the realm the client administers, e.g. `https://auth.lilaquadrat.dev/realms/studio`.
8
+ */
9
+ issuer: string;
10
+ /**
11
+ * confidential client with a service account in the target realm.
12
+ */
13
+ clientId?: string;
14
+ clientSecret?: string;
15
+ /**
16
+ * path to a projected kubernetes service account token used as the client assertion for
17
+ * federated client authentication. re-read on every authentication because the kubelet
18
+ * rotates the file.
19
+ */
20
+ tokenFile?: string;
21
+ /**
22
+ * master realm password grant. acceptable for a local rehearsal only.
23
+ */
24
+ adminUser?: string;
25
+ adminPassword?: string;
26
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * a keycloak client as the admin api reads and writes it.
3
+ */
4
+ export interface KeycloakClientRepresentation {
5
+ /**
6
+ * internal keycloak id. assigned by keycloak, absent on create.
7
+ */
8
+ id?: string;
9
+ /**
10
+ * the client id the browser logs in with, e.g. `company-project`.
11
+ */
12
+ clientId?: string;
13
+ name?: string;
14
+ description?: string;
15
+ enabled?: boolean;
16
+ /**
17
+ * public clients have no secret and are used from the browser.
18
+ */
19
+ publicClient?: boolean;
20
+ standardFlowEnabled?: boolean;
21
+ implicitFlowEnabled?: boolean;
22
+ directAccessGrantsEnabled?: boolean;
23
+ serviceAccountsEnabled?: boolean;
24
+ protocol?: string;
25
+ rootUrl?: string;
26
+ baseUrl?: string;
27
+ redirectUris?: string[];
28
+ webOrigins?: string[];
29
+ attributes?: Record<string, string>;
30
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * the urls a keycloak client allows. every field is optional: a field that is passed is
3
+ * replaced, an omitted field keeps its current value.
4
+ */
5
+ export interface KeycloakClientUrls {
6
+ /**
7
+ * valid redirect uris the browser may return to after login.
8
+ */
9
+ redirectUris?: string[];
10
+ /**
11
+ * origins allowed to call the token endpoint from a browser.
12
+ */
13
+ webOrigins?: string[];
14
+ /**
15
+ * uris the browser may return to after logout. stored in the client attribute
16
+ * `post.logout.redirect.uris`, not in an array of its own.
17
+ */
18
+ logoutUris?: string[];
19
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * a link between a keycloak user and an account at an identity provider.
3
+ */
4
+ export interface KeycloakFederatedIdentity {
5
+ identityProvider: string;
6
+ userId: string;
7
+ userName: string;
8
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * the keycloak realms studio writes to. staff and machine clients live in `studio`, end users of
3
+ * customer projects in `customers`.
4
+ */
5
+ export type KeycloakRealm = 'studio' | 'customers';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * a user as the keycloak admin api returns it from a lookup or a list.
3
+ */
4
+ export interface KeycloakUser {
5
+ id: string;
6
+ username?: string;
7
+ email?: string;
8
+ enabled?: boolean;
9
+ emailVerified?: boolean;
10
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * the writable fields of a keycloak user.
3
+ */
4
+ export interface KeycloakUserRepresentation {
5
+ username?: string;
6
+ email?: string;
7
+ emailVerified?: boolean;
8
+ enabled?: boolean;
9
+ firstName?: string;
10
+ lastName?: string;
11
+ requiredActions?: string[];
12
+ attributes?: Record<string, string[]>;
13
+ }
@@ -4,6 +4,7 @@ import { ProjectHead } from "./ProjectHead";
4
4
  import { ProjectLogin } from "./ProjectLogin";
5
5
  import { ProjectPayment } from "./ProjectPayment";
6
6
  import { ProjectPwa } from "./ProjectPwa";
7
+ import { ProjectDesign } from "./ProjectDesign";
7
8
  export interface Project {
8
9
  id: string;
9
10
  name: string;
@@ -16,6 +17,10 @@ export interface Project {
16
17
  apps?: string[];
17
18
  attributes?: string[];
18
19
  features?: string[];
20
+ /**
21
+ * the design the project renders with: a real design document in (company, project, id).
22
+ */
23
+ design?: ProjectDesign;
19
24
  auth0?: Auth0ProjectSettings;
20
25
  /**
21
26
  * this project behaves as an app: dynamic routes and client side navigation.
@@ -0,0 +1,5 @@
1
+ export interface ProjectDesign {
2
+ company: string;
3
+ project: string;
4
+ id: string;
5
+ }
@@ -83,6 +83,8 @@ export * from './Design';
83
83
  export * from './DesignCustomModule';
84
84
  export * from './DesignEvent';
85
85
  export * from './DesignFile';
86
+ export * from './DesignInput';
87
+ export * from './DesignListOptions';
86
88
  export * from './DesignModule';
87
89
  export * from './Domain';
88
90
  export * from './DomainConf';
@@ -148,6 +150,13 @@ export * from './InvoiceReferences';
148
150
  export * from './InvoiceTaxBreakdown';
149
151
  export * from './InvoiceTotals';
150
152
  export * from './InvoiceWithXml';
153
+ export * from './KeycloakAdminOptions';
154
+ export * from './KeycloakClientRepresentation';
155
+ export * from './KeycloakClientUrls';
156
+ export * from './KeycloakFederatedIdentity';
157
+ export * from './KeycloakRealm';
158
+ export * from './KeycloakUser';
159
+ export * from './KeycloakUserRepresentation';
151
160
  export * from './License';
152
161
  export * from './LimiterBreach';
153
162
  export * from './LimiterPluginOptions';
@@ -232,6 +241,7 @@ export * from './Project';
232
241
  export * from './ProjectAnalytics';
233
242
  export * from './ProjectAnalyticsGoogle';
234
243
  export * from './ProjectAnalyticsInternal';
244
+ export * from './ProjectDesign';
235
245
  export * from './ProjectDomain';
236
246
  export * from './ProjectDomainWithSecret';
237
247
  export * from './ProjectHead';
@@ -2,6 +2,9 @@ import { DesignFile } from "./DesignFile";
2
2
  export interface Design {
3
3
  company: string;
4
4
  project: string;
5
+ id: string;
6
+ name: string;
7
+ description?: string;
5
8
  files: DesignFile[];
6
9
  target: 'app' | 'server';
7
10
  }
@@ -0,0 +1,12 @@
1
+ import { DesignFile } from "./DesignFile";
2
+ /**
3
+ * writes a design into the caller's project; a project's first design falls back to
4
+ * the `default` id and name, so both stay optional
5
+ */
6
+ export interface DesignInput {
7
+ id?: string;
8
+ name?: string;
9
+ description?: string;
10
+ target: 'app' | 'server';
11
+ files: DesignFile[];
12
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DesignInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DesignInput.js","sourceRoot":"","sources":["../../src/DesignInput.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * one page of the designs a project may pick from: its own plus the shared library
3
+ */
4
+ export interface DesignListOptions {
5
+ company: string;
6
+ project: string;
7
+ search?: string;
8
+ sort?: string;
9
+ order?: number;
10
+ site: number;
11
+ limit: number;
12
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DesignListOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DesignListOptions.js","sourceRoot":"","sources":["../../src/DesignListOptions.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * credentials and realm of a keycloak admin client. the admin api is realm scoped and the
3
+ * credentials belong to a service account inside that realm, so one instance serves one realm.
4
+ */
5
+ export interface KeycloakAdminOptions {
6
+ /**
7
+ * issuer of the realm the client administers, e.g. `https://auth.lilaquadrat.dev/realms/studio`.
8
+ */
9
+ issuer: string;
10
+ /**
11
+ * confidential client with a service account in the target realm.
12
+ */
13
+ clientId?: string;
14
+ clientSecret?: string;
15
+ /**
16
+ * path to a projected kubernetes service account token used as the client assertion for
17
+ * federated client authentication. re-read on every authentication because the kubelet
18
+ * rotates the file.
19
+ */
20
+ tokenFile?: string;
21
+ /**
22
+ * master realm password grant. acceptable for a local rehearsal only.
23
+ */
24
+ adminUser?: string;
25
+ adminPassword?: string;
26
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=KeycloakAdminOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeycloakAdminOptions.js","sourceRoot":"","sources":["../../src/KeycloakAdminOptions.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * a keycloak client as the admin api reads and writes it.
3
+ */
4
+ export interface KeycloakClientRepresentation {
5
+ /**
6
+ * internal keycloak id. assigned by keycloak, absent on create.
7
+ */
8
+ id?: string;
9
+ /**
10
+ * the client id the browser logs in with, e.g. `company-project`.
11
+ */
12
+ clientId?: string;
13
+ name?: string;
14
+ description?: string;
15
+ enabled?: boolean;
16
+ /**
17
+ * public clients have no secret and are used from the browser.
18
+ */
19
+ publicClient?: boolean;
20
+ standardFlowEnabled?: boolean;
21
+ implicitFlowEnabled?: boolean;
22
+ directAccessGrantsEnabled?: boolean;
23
+ serviceAccountsEnabled?: boolean;
24
+ protocol?: string;
25
+ rootUrl?: string;
26
+ baseUrl?: string;
27
+ redirectUris?: string[];
28
+ webOrigins?: string[];
29
+ attributes?: Record<string, string>;
30
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=KeycloakClientRepresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeycloakClientRepresentation.js","sourceRoot":"","sources":["../../src/KeycloakClientRepresentation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * the urls a keycloak client allows. every field is optional: a field that is passed is
3
+ * replaced, an omitted field keeps its current value.
4
+ */
5
+ export interface KeycloakClientUrls {
6
+ /**
7
+ * valid redirect uris the browser may return to after login.
8
+ */
9
+ redirectUris?: string[];
10
+ /**
11
+ * origins allowed to call the token endpoint from a browser.
12
+ */
13
+ webOrigins?: string[];
14
+ /**
15
+ * uris the browser may return to after logout. stored in the client attribute
16
+ * `post.logout.redirect.uris`, not in an array of its own.
17
+ */
18
+ logoutUris?: string[];
19
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=KeycloakClientUrls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeycloakClientUrls.js","sourceRoot":"","sources":["../../src/KeycloakClientUrls.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * a link between a keycloak user and an account at an identity provider.
3
+ */
4
+ export interface KeycloakFederatedIdentity {
5
+ identityProvider: string;
6
+ userId: string;
7
+ userName: string;
8
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=KeycloakFederatedIdentity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeycloakFederatedIdentity.js","sourceRoot":"","sources":["../../src/KeycloakFederatedIdentity.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * the keycloak realms studio writes to. staff and machine clients live in `studio`, end users of
3
+ * customer projects in `customers`.
4
+ */
5
+ export type KeycloakRealm = 'studio' | 'customers';
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=KeycloakRealm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeycloakRealm.js","sourceRoot":"","sources":["../../src/KeycloakRealm.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * a user as the keycloak admin api returns it from a lookup or a list.
3
+ */
4
+ export interface KeycloakUser {
5
+ id: string;
6
+ username?: string;
7
+ email?: string;
8
+ enabled?: boolean;
9
+ emailVerified?: boolean;
10
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=KeycloakUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeycloakUser.js","sourceRoot":"","sources":["../../src/KeycloakUser.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * the writable fields of a keycloak user.
3
+ */
4
+ export interface KeycloakUserRepresentation {
5
+ username?: string;
6
+ email?: string;
7
+ emailVerified?: boolean;
8
+ enabled?: boolean;
9
+ firstName?: string;
10
+ lastName?: string;
11
+ requiredActions?: string[];
12
+ attributes?: Record<string, string[]>;
13
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=KeycloakUserRepresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeycloakUserRepresentation.js","sourceRoot":"","sources":["../../src/KeycloakUserRepresentation.ts"],"names":[],"mappings":""}
@@ -4,6 +4,7 @@ import { ProjectHead } from "./ProjectHead";
4
4
  import { ProjectLogin } from "./ProjectLogin";
5
5
  import { ProjectPayment } from "./ProjectPayment";
6
6
  import { ProjectPwa } from "./ProjectPwa";
7
+ import { ProjectDesign } from "./ProjectDesign";
7
8
  export interface Project {
8
9
  id: string;
9
10
  name: string;
@@ -16,6 +17,10 @@ export interface Project {
16
17
  apps?: string[];
17
18
  attributes?: string[];
18
19
  features?: string[];
20
+ /**
21
+ * the design the project renders with: a real design document in (company, project, id).
22
+ */
23
+ design?: ProjectDesign;
19
24
  auth0?: Auth0ProjectSettings;
20
25
  /**
21
26
  * this project behaves as an app: dynamic routes and client side navigation.
@@ -0,0 +1,5 @@
1
+ export interface ProjectDesign {
2
+ company: string;
3
+ project: string;
4
+ id: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ProjectDesign.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectDesign.js","sourceRoot":"","sources":["../../src/ProjectDesign.ts"],"names":[],"mappings":""}
@@ -83,6 +83,8 @@ export * from './Design';
83
83
  export * from './DesignCustomModule';
84
84
  export * from './DesignEvent';
85
85
  export * from './DesignFile';
86
+ export * from './DesignInput';
87
+ export * from './DesignListOptions';
86
88
  export * from './DesignModule';
87
89
  export * from './Domain';
88
90
  export * from './DomainConf';
@@ -148,6 +150,13 @@ export * from './InvoiceReferences';
148
150
  export * from './InvoiceTaxBreakdown';
149
151
  export * from './InvoiceTotals';
150
152
  export * from './InvoiceWithXml';
153
+ export * from './KeycloakAdminOptions';
154
+ export * from './KeycloakClientRepresentation';
155
+ export * from './KeycloakClientUrls';
156
+ export * from './KeycloakFederatedIdentity';
157
+ export * from './KeycloakRealm';
158
+ export * from './KeycloakUser';
159
+ export * from './KeycloakUserRepresentation';
151
160
  export * from './License';
152
161
  export * from './LimiterBreach';
153
162
  export * from './LimiterPluginOptions';
@@ -232,6 +241,7 @@ export * from './Project';
232
241
  export * from './ProjectAnalytics';
233
242
  export * from './ProjectAnalyticsGoogle';
234
243
  export * from './ProjectAnalyticsInternal';
244
+ export * from './ProjectDesign';
235
245
  export * from './ProjectDomain';
236
246
  export * from './ProjectDomainWithSecret';
237
247
  export * from './ProjectHead';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lilaquadrat/interfaces",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "interfaces in context of lilaquadrat STUDIO",
5
5
  "author": {
6
6
  "email": "m.schuebel@lila2.de",
package/src/Design.ts CHANGED
@@ -3,6 +3,9 @@ import { DesignFile } from "./DesignFile"
3
3
  export interface Design {
4
4
  company: string
5
5
  project: string
6
+ id: string
7
+ name: string
8
+ description?: string
6
9
  files: DesignFile[]
7
10
  target: 'app' | 'server'
8
- }
11
+ }
@@ -0,0 +1,13 @@
1
+ import { DesignFile } from "./DesignFile"
2
+
3
+ /**
4
+ * writes a design into the caller's project; a project's first design falls back to
5
+ * the `default` id and name, so both stay optional
6
+ */
7
+ export interface DesignInput {
8
+ id?: string
9
+ name?: string
10
+ description?: string
11
+ target: 'app' | 'server'
12
+ files: DesignFile[]
13
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * one page of the designs a project may pick from: its own plus the shared library
3
+ */
4
+ export interface DesignListOptions {
5
+ company: string
6
+ project: string
7
+ search?: string
8
+ sort?: string
9
+ order?: number
10
+ site: number
11
+ limit: number
12
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * credentials and realm of a keycloak admin client. the admin api is realm scoped and the
3
+ * credentials belong to a service account inside that realm, so one instance serves one realm.
4
+ */
5
+ export interface KeycloakAdminOptions {
6
+
7
+ /**
8
+ * issuer of the realm the client administers, e.g. `https://auth.lilaquadrat.dev/realms/studio`.
9
+ */
10
+ issuer: string
11
+
12
+ /**
13
+ * confidential client with a service account in the target realm.
14
+ */
15
+ clientId?: string
16
+
17
+ clientSecret?: string
18
+
19
+ /**
20
+ * path to a projected kubernetes service account token used as the client assertion for
21
+ * federated client authentication. re-read on every authentication because the kubelet
22
+ * rotates the file.
23
+ */
24
+ tokenFile?: string
25
+
26
+ /**
27
+ * master realm password grant. acceptable for a local rehearsal only.
28
+ */
29
+ adminUser?: string
30
+
31
+ adminPassword?: string
32
+
33
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * a keycloak client as the admin api reads and writes it.
3
+ */
4
+ export interface KeycloakClientRepresentation {
5
+
6
+ /**
7
+ * internal keycloak id. assigned by keycloak, absent on create.
8
+ */
9
+ id?: string
10
+
11
+ /**
12
+ * the client id the browser logs in with, e.g. `company-project`.
13
+ */
14
+ clientId?: string
15
+
16
+ name?: string
17
+
18
+ description?: string
19
+
20
+ enabled?: boolean
21
+
22
+ /**
23
+ * public clients have no secret and are used from the browser.
24
+ */
25
+ publicClient?: boolean
26
+
27
+ standardFlowEnabled?: boolean
28
+
29
+ implicitFlowEnabled?: boolean
30
+
31
+ directAccessGrantsEnabled?: boolean
32
+
33
+ serviceAccountsEnabled?: boolean
34
+
35
+ protocol?: string
36
+
37
+ rootUrl?: string
38
+
39
+ baseUrl?: string
40
+
41
+ redirectUris?: string[]
42
+
43
+ webOrigins?: string[]
44
+
45
+ attributes?: Record<string, string>
46
+
47
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * the urls a keycloak client allows. every field is optional: a field that is passed is
3
+ * replaced, an omitted field keeps its current value.
4
+ */
5
+ export interface KeycloakClientUrls {
6
+
7
+ /**
8
+ * valid redirect uris the browser may return to after login.
9
+ */
10
+ redirectUris?: string[]
11
+
12
+ /**
13
+ * origins allowed to call the token endpoint from a browser.
14
+ */
15
+ webOrigins?: string[]
16
+
17
+ /**
18
+ * uris the browser may return to after logout. stored in the client attribute
19
+ * `post.logout.redirect.uris`, not in an array of its own.
20
+ */
21
+ logoutUris?: string[]
22
+
23
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * a link between a keycloak user and an account at an identity provider.
3
+ */
4
+ export interface KeycloakFederatedIdentity {
5
+
6
+ identityProvider: string
7
+
8
+ userId: string
9
+
10
+ userName: string
11
+
12
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * the keycloak realms studio writes to. staff and machine clients live in `studio`, end users of
3
+ * customer projects in `customers`.
4
+ */
5
+ export type KeycloakRealm = 'studio' | 'customers';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * a user as the keycloak admin api returns it from a lookup or a list.
3
+ */
4
+ export interface KeycloakUser {
5
+
6
+ id: string
7
+
8
+ username?: string
9
+
10
+ email?: string
11
+
12
+ enabled?: boolean
13
+
14
+ emailVerified?: boolean
15
+
16
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * the writable fields of a keycloak user.
3
+ */
4
+ export interface KeycloakUserRepresentation {
5
+
6
+ username?: string
7
+
8
+ email?: string
9
+
10
+ emailVerified?: boolean
11
+
12
+ enabled?: boolean
13
+
14
+ firstName?: string
15
+
16
+ lastName?: string
17
+
18
+ requiredActions?: string[]
19
+
20
+ attributes?: Record<string, string[]>
21
+
22
+ }
package/src/Project.ts CHANGED
@@ -4,6 +4,7 @@ import {ProjectHead} from "./ProjectHead"
4
4
  import {ProjectLogin} from "./ProjectLogin"
5
5
  import {ProjectPayment} from "./ProjectPayment"
6
6
  import {ProjectPwa} from "./ProjectPwa"
7
+ import {ProjectDesign} from "./ProjectDesign"
7
8
 
8
9
  export interface Project {
9
10
 
@@ -20,6 +21,11 @@ export interface Project {
20
21
 
21
22
  features?: string[]
22
23
 
24
+ /**
25
+ * the design the project renders with: a real design document in (company, project, id).
26
+ */
27
+ design?: ProjectDesign
28
+
23
29
  auth0?: Auth0ProjectSettings
24
30
 
25
31
  /**
@@ -0,0 +1,5 @@
1
+ export interface ProjectDesign {
2
+ company: string
3
+ project: string
4
+ id: string
5
+ }