diff options
Diffstat (limited to 'packages/shared/src')
-rw-r--r-- | packages/shared/src/index.ts | 5 | ||||
-rw-r--r-- | packages/shared/src/schemas/ServiceAction.ts | 4 | ||||
-rw-r--r-- | packages/shared/src/stores/Certificate.ts | 8 |
3 files changed, 16 insertions, 1 deletions
diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index e3da192..b1d05f8 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts | |||
@@ -32,7 +32,10 @@ export { ThemeSource } from './schemas/ThemeSource'; | |||
32 | 32 | ||
33 | export { Translation } from './schemas/Translation'; | 33 | export { Translation } from './schemas/Translation'; |
34 | 34 | ||
35 | export type { CertificateSnapshotIn } from './stores/Certificate'; | 35 | export type { |
36 | CertificatePrincipal, | ||
37 | CertificateSnapshotIn, | ||
38 | } from './stores/Certificate'; | ||
36 | export { default as Certificate } from './stores/Certificate'; | 39 | export { default as Certificate } from './stores/Certificate'; |
37 | 40 | ||
38 | export type { | 41 | export type { |
diff --git a/packages/shared/src/schemas/ServiceAction.ts b/packages/shared/src/schemas/ServiceAction.ts index cfaba08..c0f07d6 100644 --- a/packages/shared/src/schemas/ServiceAction.ts +++ b/packages/shared/src/schemas/ServiceAction.ts | |||
@@ -67,6 +67,10 @@ export const ServiceAction = /* @__PURE__ */ (() => | |||
67 | z.object({ | 67 | z.object({ |
68 | action: z.literal('dismiss-all-popups'), | 68 | action: z.literal('dismiss-all-popups'), |
69 | }), | 69 | }), |
70 | z.object({ | ||
71 | action: z.literal('download-certificate'), | ||
72 | fingerprint: z.string().nonempty(), | ||
73 | }), | ||
70 | ]))(); | 74 | ]))(); |
71 | 75 | ||
72 | /* | 76 | /* |
diff --git a/packages/shared/src/stores/Certificate.ts b/packages/shared/src/stores/Certificate.ts index 8b2d007..363406d 100644 --- a/packages/shared/src/stores/Certificate.ts +++ b/packages/shared/src/stores/Certificate.ts | |||
@@ -30,12 +30,20 @@ const CertificatePrincipal = /* @__PURE__ */ (() => | |||
30 | country: types.string, | 30 | country: types.string, |
31 | }))(); | 31 | }))(); |
32 | 32 | ||
33 | /* | ||
34 | eslint-disable-next-line @typescript-eslint/no-redeclare -- | ||
35 | Intentionally naming the type the same as the store definition. | ||
36 | */ | ||
37 | export interface CertificatePrincipal | ||
38 | extends Instance<typeof CertificatePrincipal> {} | ||
39 | |||
33 | const Certificate = /* @__PURE__ */ (() => | 40 | const Certificate = /* @__PURE__ */ (() => |
34 | types.model('Certificate', { | 41 | types.model('Certificate', { |
35 | data: types.string, | 42 | data: types.string, |
36 | issuer: CertificatePrincipal, | 43 | issuer: CertificatePrincipal, |
37 | issuerName: types.string, | 44 | issuerName: types.string, |
38 | issuerCert: types.maybe(types.late((): IAnyModelType => Certificate)), | 45 | issuerCert: types.maybe(types.late((): IAnyModelType => Certificate)), |
46 | subject: CertificatePrincipal, | ||
39 | subjectName: types.string, | 47 | subjectName: types.string, |
40 | serialNumber: types.string, | 48 | serialNumber: types.string, |
41 | validStart: types.number, | 49 | validStart: types.number, |