aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/shared/src')
-rw-r--r--packages/shared/src/index.ts5
-rw-r--r--packages/shared/src/schemas/ServiceAction.ts4
-rw-r--r--packages/shared/src/stores/Certificate.ts8
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
33export { Translation } from './schemas/Translation'; 33export { Translation } from './schemas/Translation';
34 34
35export type { CertificateSnapshotIn } from './stores/Certificate'; 35export type {
36 CertificatePrincipal,
37 CertificateSnapshotIn,
38} from './stores/Certificate';
36export { default as Certificate } from './stores/Certificate'; 39export { default as Certificate } from './stores/Certificate';
37 40
38export type { 41export 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*/
37export interface CertificatePrincipal
38 extends Instance<typeof CertificatePrincipal> {}
39
33const Certificate = /* @__PURE__ */ (() => 40const 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,