@fireproof/core-protocols-dashboard 0.24.5 → 0.24.7-dev-deploy-t1

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.
@@ -1,25 +1,9 @@
1
1
  import { Result } from "@adviser/cement";
2
- import { ReqEnsureUser, ResEnsureUser, ReqFindUser, ResFindUser, ReqCreateTenant, ResCreateTenant, ReqUpdateTenant, ResUpdateTenant, ReqDeleteTenant, ResDeleteTenant, ReqRedeemInvite, ResRedeemInvite, ReqListTenantsByUser, ResListTenantsByUser, ReqInviteUser, ResInviteUser, ReqListInvites, ResListInvites, ReqDeleteInvite, ResDeleteInvite, ReqUpdateUserTenant, ResUpdateUserTenant, ReqCreateLedger, ResCreateLedger, ReqUpdateLedger, ResUpdateLedger, ReqDeleteLedger, ResDeleteLedger, ReqListLedgersByUser, ResListLedgersByUser, ReqCloudSessionToken, ResCloudSessionToken, ReqCertFromCsr, ResCertFromCsr, ReqExtendToken, ReqTokenByResultId, ResExtendToken, ResTokenByResultId, ReqEnsureCloudToken, ResEnsureCloudToken, DashAuthType } from "./msg-types.js";
3
- import { FPApiInterface } from "./fp-api-interface.js";
2
+ import { ReqEnsureUser, ResEnsureUser, ReqFindUser, ResFindUser, ReqCreateTenant, ResCreateTenant, ReqUpdateTenant, ResUpdateTenant, ReqDeleteTenant, ResDeleteTenant, ReqRedeemInvite, ResRedeemInvite, ReqListTenantsByUser, ResListTenantsByUser, ReqInviteUser, ResInviteUser, ReqListInvites, ResListInvites, ReqDeleteInvite, ResDeleteInvite, ReqUpdateUserTenant, ResUpdateUserTenant, ReqCreateLedger, ResCreateLedger, ReqUpdateLedger, ResUpdateLedger, ReqDeleteLedger, ResDeleteLedger, ReqListLedgersByUser, ResListLedgersByUser, ReqCloudSessionToken, ResCloudSessionToken, ReqCertFromCsr, ResCertFromCsr, ReqExtendToken, ReqTokenByResultId, ResExtendToken, ResTokenByResultId, ReqEnsureCloudToken, ResEnsureCloudToken, ClerkDashboardApiConfig, DashboardApiConfigIntern, FPApiInterface, DashboardApiConfig, WithoutTypeAndAuth } from "@fireproof/core-types-protocols-dashboard";
4
3
  import type { Clerk } from "@clerk/shared/types";
5
- export type WithoutTypeAndAuth<T> = Omit<T, "type" | "auth">;
6
- export interface ClerkDashboardApiConfig<T> {
7
- readonly apiUrl: string;
8
- readonly getTokenCtx?: T;
9
- readonly template?: string;
10
- readonly gracePeriodMs?: number;
11
- fetch?(input: RequestInfo, init?: RequestInit): Promise<Response>;
12
- }
13
- export interface DashboardApiConfig<T> {
14
- readonly apiUrl: string;
15
- readonly getTokenCtx?: T;
16
- readonly gracePeriodMs: number;
17
- fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
18
- getToken: (ctx: never) => Promise<Result<DashAuthType>>;
19
- }
20
4
  export declare class DashboardApiImpl<T> implements FPApiInterface {
21
5
  #private;
22
- readonly cfg: DashboardApiConfig<T>;
6
+ readonly cfg: DashboardApiConfigIntern<T>;
23
7
  constructor(cfg: DashboardApiConfig<T>);
24
8
  private request;
25
9
  ensureUser(req: WithoutTypeAndAuth<ReqEnsureUser>): Promise<Result<ResEnsureUser>>;
package/dashboard-api.js CHANGED
@@ -3,17 +3,22 @@ export class DashboardApiImpl {
3
3
  cfg;
4
4
  constructor(cfg) {
5
5
  this.cfg = {
6
+ gracePeriodMs: 5000,
6
7
  ...cfg,
7
8
  };
8
9
  }
9
10
  async request(req) {
10
- const rAuth = await this.cfg.getToken(this.cfg.getTokenCtx);
11
- if (rAuth.isErr()) {
12
- return Result.Err(rAuth.Err());
11
+ let auth = req.auth;
12
+ if (!req.auth) {
13
+ const rAuth = await this.cfg.getToken(this.cfg.getTokenCtx);
14
+ if (rAuth.isErr()) {
15
+ return Result.Err(rAuth.Err());
16
+ }
17
+ auth = rAuth.Ok();
13
18
  }
14
19
  const reqBody = JSON.stringify({
15
20
  ...req,
16
- auth: rAuth.Ok(),
21
+ auth,
17
22
  });
18
23
  const res = await this.cfg.fetch(this.cfg.api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IAAI,OAAO,OAAO,CAAC,QAAQ,IAAI,UAAU,CAAC,EAAE,CAAC;gBACxD,OAAO;YACT,CAAC;YAED,gBAAgB,CAAC,GAAG,EAAE,CAAC,OAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,WAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC;gBAC9F,IAAI,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC;oBACtB,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC;oBACvC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;oBAChC,OAAO;gBACT,CAAC;gBACD,MAAM,KAAK,GAAG,SAAS,CAAC,EAAE,EAAE,CAAC;gBAC7B,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YAAA,CAC3C,CAAC,CAAC;QAAA,CACJ,CAAC,CAAC;QACH,OAAO,OAAoC,CAAC;IAAA,CAC7C,CAAwB,CAAC;AAAA,CAC3B"}
package/index.d.ts CHANGED
@@ -1,37 +1,2 @@
1
- import { z } from "zod/v4";
2
- export * from "./msg-types.js";
3
- export * from "./msg-is.js";
4
1
  export * from "./msg-api.js";
5
- export * from "./fp-api-interface.js";
6
2
  export * from "./dashboard-api.js";
7
- export declare const FPClerkClaimSchema: z.ZodObject<{
8
- payload: z.ZodObject<{
9
- azp: z.ZodOptional<z.ZodString>;
10
- exp: z.ZodOptional<z.ZodNumber>;
11
- iat: z.ZodOptional<z.ZodNumber>;
12
- iss: z.ZodOptional<z.ZodString>;
13
- jti: z.ZodOptional<z.ZodString>;
14
- nbf: z.ZodOptional<z.ZodNumber>;
15
- params: z.ZodObject<{
16
- email: z.ZodOptional<z.ZodString>;
17
- email_verified: z.ZodOptional<z.ZodBoolean>;
18
- first: z.ZodOptional<z.ZodString>;
19
- image_url: z.ZodOptional<z.ZodString>;
20
- last: z.ZodOptional<z.ZodString>;
21
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
- public_meta: z.ZodOptional<z.ZodUnknown>;
23
- }, z.core.$strip>;
24
- role: z.ZodString;
25
- sub: z.ZodString;
26
- userId: z.ZodString;
27
- aud: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
28
- app_metadata: z.ZodOptional<z.ZodUnknown>;
29
- }, z.core.$strip>;
30
- protectedHeader: z.ZodObject<{
31
- alg: z.ZodOptional<z.ZodString>;
32
- cat: z.ZodOptional<z.ZodString>;
33
- kid: z.ZodOptional<z.ZodString>;
34
- typ: z.ZodOptional<z.ZodString>;
35
- }, z.core.$strip>;
36
- }, z.core.$strip>;
37
- export type FPClerkClaim = z.infer<typeof FPClerkClaimSchema>;
package/index.js CHANGED
@@ -1,41 +1,3 @@
1
- import { z } from "zod/v4";
2
- export * from "./msg-types.js";
3
- export * from "./msg-is.js";
4
1
  export * from "./msg-api.js";
5
- export * from "./fp-api-interface.js";
6
2
  export * from "./dashboard-api.js";
7
- export const FPClerkClaimSchema = z.object({
8
- payload: z.object({
9
- azp: z.string().optional(), // authorized party
10
- exp: z.number().int().optional(), // expiration time
11
- iat: z.number().int().optional(), // issued at
12
- iss: z.string().optional(), // issuer
13
- jti: z.string().optional(), // JWT ID
14
- nbf: z.number().int().optional(), // not before
15
- params: z
16
- .object({
17
- email: z.string(),
18
- email_verified: z.boolean(),
19
- first: z.string(),
20
- image_url: z.string(),
21
- last: z.string(),
22
- name: z.string().nullable(),
23
- public_meta: z.unknown(),
24
- })
25
- .partial(),
26
- role: z.string(),
27
- sub: z.string(),
28
- userId: z.string(),
29
- aud: z.union([z.string(), z.array(z.string())]).optional(), // audience
30
- app_metadata: z.unknown().optional(),
31
- }),
32
- protectedHeader: z
33
- .object({
34
- alg: z.string(),
35
- cat: z.string(),
36
- kid: z.string(),
37
- typ: z.string(),
38
- })
39
- .partial(),
40
- });
41
3
  //# sourceMappingURL=index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AC,OAAO,EAAE;SACzB,CAAC;aACD,OAAO,EAAE;QAEZ,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAElB,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,WAAW;QACvE,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;KACrC,CAAC;IACF,eAAe,EAAE,CAAC;SACf,MAAM,CAAC;QACN,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;KAChB,CAAC;SACD,OAAO,EAAE;CACb,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../jsr/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
package/msg-api.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { Logger, Result } from "@adviser/cement";
2
- import { ReqTokenByResultId, ResTokenByResultId } from "./msg-types.js";
3
- import { FAPIMsgImpl } from "./msg-is.js";
2
+ import { ReqTokenByResultId, ResTokenByResultId, FAPIMsgImpl } from "@fireproof/core-types-protocols-dashboard";
4
3
  export declare class Api {
5
4
  readonly apiUrl: string;
6
5
  readonly isser: FAPIMsgImpl;
package/msg-api.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { exception2Result, Result } from "@adviser/cement";
2
- import { FAPIMsgImpl } from "./msg-is.js";
2
+ import { FAPIMsgImpl } from "@fireproof/core-types-protocols-dashboard";
3
3
  export class Api {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MAAM,KAAK,OAAO,EAAE,CAAC;gBACvC,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC;gBACpC,OAAO,MAAM,CAAC,EAAE,CAAC;oBACf,IAAI,EAAE,oBAAoB;oBAC1B,MAAM,EAAE,OAAO;oBACf,QAAQ,EAAE,GAAG,CAAC,QAAQ;oBACtB,KAAK;iBACN,CAAC,CAAC;YACL,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QAChF,CAAC;QACD,OAAO,MAAM,CAAC,EAAE,CAAC;YACf,IAAI,EAAE,oBAAoB;YAC1B,MAAM,EAAE,WAAW;YACnB,QAAQ,EAAE,GAAG,CAAC,QAAQ;SACvB,CAAC,CAAC;IAAA,CACJ;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fireproof/core-protocols-dashboard",
3
- "version": "0.24.5",
3
+ "version": "0.24.7-dev-deploy-t1",
4
4
  "description": "Live ledger for the web.",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -34,13 +34,14 @@
34
34
  "url": "https://github.com/fireproof-storage/fireproof/issues"
35
35
  },
36
36
  "dependencies": {
37
- "@adviser/cement": "0.5.8",
37
+ "@adviser/cement": "0.5.15",
38
38
  "@clerk/shared": "3.41.1",
39
- "@fireproof/core-device-id": "0.24.5",
40
- "@fireproof/core-runtime": "0.24.5",
41
- "@fireproof/core-types-base": "0.24.5",
42
- "@fireproof/core-types-protocols-cloud": "0.24.5",
43
- "@fireproof/vendor": "0.24.5",
39
+ "@fireproof/core-device-id": "0.24.7-dev-deploy-t1",
40
+ "@fireproof/core-runtime": "0.24.7-dev-deploy-t1",
41
+ "@fireproof/core-types-base": "0.24.7-dev-deploy-t1",
42
+ "@fireproof/core-types-protocols-cloud": "0.24.7-dev-deploy-t1",
43
+ "@fireproof/core-types-protocols-dashboard": "0.24.7-dev-deploy-t1",
44
+ "@fireproof/vendor": "0.24.7-dev-deploy-t1",
44
45
  "zod": "4.3.5"
45
46
  }
46
47
  }
@@ -1,24 +0,0 @@
1
- import { Result } from "@adviser/cement";
2
- import { ReqEnsureUser, ResEnsureUser, ReqFindUser, ResFindUser, ReqCreateTenant, ResCreateTenant, ReqUpdateTenant, ResUpdateTenant, ReqDeleteTenant, ResDeleteTenant, ReqRedeemInvite, ResRedeemInvite, ReqListTenantsByUser, ResListTenantsByUser, ReqUpdateUserTenant, ResUpdateUserTenant, ReqInviteUser, ResInviteUser, ReqListInvites, ResListInvites, ReqDeleteInvite, ResDeleteInvite, ReqCreateLedger, ResCreateLedger, ReqListLedgersByUser, ResListLedgersByUser, ReqUpdateLedger, ResUpdateLedger, ReqDeleteLedger, ResDeleteLedger, ReqCloudSessionToken, ResCloudSessionToken, ReqTokenByResultId, ResTokenByResultId, ReqExtendToken, ResExtendToken, ReqCertFromCsr, ResCertFromCsr, ReqEnsureCloudToken, ResEnsureCloudToken } from "./msg-types.js";
3
- export interface FPApiInterface {
4
- ensureUser(req: ReqEnsureUser): Promise<Result<ResEnsureUser>>;
5
- findUser(req: ReqFindUser): Promise<Result<ResFindUser>>;
6
- createTenant(req: ReqCreateTenant): Promise<Result<ResCreateTenant>>;
7
- updateTenant(req: ReqUpdateTenant): Promise<Result<ResUpdateTenant>>;
8
- deleteTenant(req: ReqDeleteTenant): Promise<Result<ResDeleteTenant>>;
9
- redeemInvite(req: ReqRedeemInvite): Promise<Result<ResRedeemInvite>>;
10
- listTenantsByUser(req: ReqListTenantsByUser): Promise<Result<ResListTenantsByUser>>;
11
- updateUserTenant(req: ReqUpdateUserTenant): Promise<Result<ResUpdateUserTenant>>;
12
- inviteUser(req: ReqInviteUser): Promise<Result<ResInviteUser>>;
13
- listInvites(req: ReqListInvites): Promise<Result<ResListInvites>>;
14
- deleteInvite(req: ReqDeleteInvite): Promise<Result<ResDeleteInvite>>;
15
- createLedger(req: ReqCreateLedger): Promise<Result<ResCreateLedger>>;
16
- listLedgersByUser(req: ReqListLedgersByUser): Promise<Result<ResListLedgersByUser>>;
17
- updateLedger(req: ReqUpdateLedger): Promise<Result<ResUpdateLedger>>;
18
- deleteLedger(req: ReqDeleteLedger): Promise<Result<ResDeleteLedger>>;
19
- getCloudSessionToken(req: ReqCloudSessionToken): Promise<Result<ResCloudSessionToken>>;
20
- getTokenByResultId(req: ReqTokenByResultId): Promise<Result<ResTokenByResultId>>;
21
- extendToken(req: ReqExtendToken): Promise<Result<ResExtendToken>>;
22
- getCertFromCsr(req: ReqCertFromCsr): Promise<Result<ResCertFromCsr>>;
23
- ensureCloudToken(req: ReqEnsureCloudToken): Promise<Result<ResEnsureCloudToken>>;
24
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=fp-api-interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fp-api-interface.js","sourceRoot":"","sources":["../jsr/fp-api-interface.ts"],"names":[],"mappings":""}
package/msg-is.d.ts DELETED
@@ -1,48 +0,0 @@
1
- import { ReqDeleteTenant, ReqUpdateTenant, ReqCreateTenant, ReqDeleteInvite, ReqListInvites, ReqInviteUser, ReqFindUser, ReqRedeemInvite, ReqEnsureUser, ReqListTenantsByUser, ReqUpdateUserTenant, ReqCloudSessionToken, ReqTokenByResultId, ReqListLedgersByUser, ReqCreateLedger, ReqUpdateLedger, ReqDeleteLedger, ResTokenByResultId, ReqExtendToken, ReqCertFromCsr, ReqEnsureCloudToken } from "./msg-types.js";
2
- interface FPApiMsgInterface {
3
- isDeleteTenant(jso: unknown): jso is ReqDeleteTenant;
4
- isUpdateTenant(jso: unknown): jso is ReqUpdateTenant;
5
- isCreateTenant(jso: unknown): jso is ReqCreateTenant;
6
- isDeleteInvite(jso: unknown): jso is ReqDeleteInvite;
7
- isListInvites(jso: unknown): jso is ReqListInvites;
8
- isInviteUser(jso: unknown): jso is ReqInviteUser;
9
- isFindUser(jso: unknown): jso is ReqFindUser;
10
- isRedeemInvite(jso: unknown): jso is ReqRedeemInvite;
11
- isEnsureUser(jso: unknown): jso is ReqEnsureUser;
12
- isListTenantsByUser(jso: unknown): jso is ReqListTenantsByUser;
13
- isUpdateUserTenant(jso: unknown): jso is ReqUpdateUserTenant;
14
- isCloudSessionToken(jso: unknown): jso is ReqCloudSessionToken;
15
- isReqTokenByResultId(jso: unknown): jso is ReqTokenByResultId;
16
- isResTokenByResultId(jso: unknown): jso is ResTokenByResultId;
17
- isListLedgersByUser(jso: unknown): jso is ReqListLedgersByUser;
18
- isCreateLedger(jso: unknown): jso is ReqCreateLedger;
19
- isUpdateLedger(jso: unknown): jso is ReqUpdateLedger;
20
- isDeleteLedger(jso: unknown): jso is ReqDeleteLedger;
21
- isReqExtendToken(jso: unknown): jso is ReqExtendToken;
22
- isReqCertFromCsr(jso: unknown): jso is ReqCertFromCsr;
23
- isEnsureCloudToken(jso: unknown): jso is ReqEnsureCloudToken;
24
- }
25
- export declare class FAPIMsgImpl implements FPApiMsgInterface {
26
- isDeleteTenant(jso: unknown): jso is ReqDeleteTenant;
27
- isUpdateTenant(jso: unknown): jso is ReqUpdateTenant;
28
- isCreateTenant(jso: unknown): jso is ReqCreateTenant;
29
- isDeleteInvite(jso: unknown): jso is ReqDeleteInvite;
30
- isListInvites(jso: unknown): jso is ReqListInvites;
31
- isInviteUser(jso: unknown): jso is ReqInviteUser;
32
- isFindUser(jso: unknown): jso is ReqFindUser;
33
- isRedeemInvite(jso: unknown): jso is ReqRedeemInvite;
34
- isEnsureUser(jso: unknown): jso is ReqEnsureUser;
35
- isListTenantsByUser(jso: unknown): jso is ReqListTenantsByUser;
36
- isUpdateUserTenant(jso: unknown): jso is ReqUpdateUserTenant;
37
- isListLedgersByUser(jso: unknown): jso is ReqListLedgersByUser;
38
- isCreateLedger(jso: unknown): jso is ReqCreateLedger;
39
- isUpdateLedger(jso: unknown): jso is ReqUpdateLedger;
40
- isDeleteLedger(jso: unknown): jso is ReqDeleteLedger;
41
- isCloudSessionToken(jso: unknown): jso is ReqCloudSessionToken;
42
- isReqTokenByResultId(jso: unknown): jso is ReqTokenByResultId;
43
- isResTokenByResultId(jso: unknown): jso is ResTokenByResultId;
44
- isReqExtendToken(jso: unknown): jso is ReqExtendToken;
45
- isReqCertFromCsr(jso: unknown): jso is ReqCertFromCsr;
46
- isEnsureCloudToken(jso: unknown): jso is ReqEnsureCloudToken;
47
- }
48
- export {};
package/msg-is.js DELETED
@@ -1,69 +0,0 @@
1
- function hasType(jso, t) {
2
- return typeof jso === "object" && jso !== null && jso.type === t;
3
- }
4
- export class FAPIMsgImpl {
5
- isDeleteTenant(jso) {
6
- return hasType(jso, "reqDeleteTenant");
7
- }
8
- isUpdateTenant(jso) {
9
- return hasType(jso, "reqUpdateTenant");
10
- }
11
- isCreateTenant(jso) {
12
- return hasType(jso, "reqCreateTenant");
13
- }
14
- isDeleteInvite(jso) {
15
- return hasType(jso, "reqDeleteInvite");
16
- }
17
- isListInvites(jso) {
18
- return hasType(jso, "reqListInvites");
19
- }
20
- isInviteUser(jso) {
21
- return hasType(jso, "reqInviteUser");
22
- }
23
- isFindUser(jso) {
24
- return hasType(jso, "reqFindUser");
25
- }
26
- isRedeemInvite(jso) {
27
- return hasType(jso, "reqRedeemInvite");
28
- }
29
- isEnsureUser(jso) {
30
- return hasType(jso, "reqEnsureUser");
31
- }
32
- isListTenantsByUser(jso) {
33
- return hasType(jso, "reqListTenantsByUser");
34
- }
35
- isUpdateUserTenant(jso) {
36
- return hasType(jso, "reqUpdateUserTenant");
37
- }
38
- isListLedgersByUser(jso) {
39
- return hasType(jso, "reqListLedgersByUser");
40
- }
41
- isCreateLedger(jso) {
42
- return hasType(jso, "reqCreateLedger");
43
- }
44
- isUpdateLedger(jso) {
45
- return hasType(jso, "reqUpdateLedger");
46
- }
47
- isDeleteLedger(jso) {
48
- return hasType(jso, "reqDeleteLedger");
49
- }
50
- isCloudSessionToken(jso) {
51
- return hasType(jso, "reqCloudSessionToken");
52
- }
53
- isReqTokenByResultId(jso) {
54
- return hasType(jso, "reqTokenByResultId");
55
- }
56
- isResTokenByResultId(jso) {
57
- return hasType(jso, "resTokenByResultId");
58
- }
59
- isReqExtendToken(jso) {
60
- return hasType(jso, "reqExtendToken");
61
- }
62
- isReqCertFromCsr(jso) {
63
- return hasType(jso, "reqCertFromCsr");
64
- }
65
- isEnsureCloudToken(jso) {
66
- return hasType(jso, "reqEnsureCloudToken");
67
- }
68
- }
69
- //# sourceMappingURL=msg-is.js.map
package/msg-is.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"msg-is.js","sourceRoot":"","sources":["../jsr/msg-is.ts"],"names":[],"mappings":"AAgDA,SAAS,OAAO,CAAC,GAAY,EAAE,CAAS,EAA2B;IACjE,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAK,GAA0B,CAAC,IAAI,KAAK,CAAC,CAAC;AAAA,CAC1F;AACD,MAAM,OAAO,WAAW;IACtB,cAAc,CAAC,GAAY,EAA0B;QACnD,OAAO,OAAO,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IAAA,CACxC;IACD,cAAc,CAAC,GAAY,EAA0B;QACnD,OAAO,OAAO,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IAAA,CACxC;IACD,cAAc,CAAC,GAAY,EAA0B;QACnD,OAAO,OAAO,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IAAA,CACxC;IACD,cAAc,CAAC,GAAY,EAA0B;QACnD,OAAO,OAAO,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IAAA,CACxC;IACD,aAAa,CAAC,GAAY,EAAyB;QACjD,OAAO,OAAO,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAAA,CACvC;IACD,YAAY,CAAC,GAAY,EAAwB;QAC/C,OAAO,OAAO,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAAA,CACtC;IACD,UAAU,C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ACpD,OAAO,OAAO,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAAA,CACvC;IACD,gBAAgB,CAAC,GAAY,EAAyB;QACpD,OAAO,OAAO,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAAA,CACvC;IACD,kBAAkB,CAAC,GAAY,EAA8B;QAC3D,OAAO,OAAO,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAC;IAAA,CAC5C;CACF"}
package/msg-types.d.ts DELETED
@@ -1,447 +0,0 @@
1
- import { JWKPublic } from "@fireproof/core-types-base";
2
- import { FPCloudClaim, ReadWrite, Role, TenantLedger } from "@fireproof/core-types-protocols-cloud";
3
- import type { DeviceIdCA } from "@fireproof/core-device-id";
4
- export type AuthProvider = "github" | "google" | "fp" | "invite-per-email";
5
- export interface Queryable {
6
- readonly userId?: string;
7
- readonly queryProvider?: AuthProvider;
8
- readonly queryEmail?: string;
9
- readonly queryNick?: string;
10
- }
11
- export interface QueryUser {
12
- readonly byString?: string;
13
- readonly existingUserId?: string;
14
- readonly byEmail?: string;
15
- readonly byNick?: string;
16
- readonly andProvider?: AuthProvider;
17
- }
18
- export interface Tenant {
19
- readonly tenantId: string;
20
- readonly name: string;
21
- readonly ownerUserId: string;
22
- readonly adminUserIds: string[];
23
- readonly memberUserIds: string[];
24
- readonly maxAdminUsers: number;
25
- readonly maxMemberUsers: number;
26
- readonly maxLedgers: number;
27
- readonly createdAt: Date;
28
- readonly updatedAt: Date;
29
- }
30
- export type InviteTicketStatus = "pending" | "accepted" | "rejected" | "expired";
31
- export interface SqlInvitedParams {
32
- readonly tenant?: {
33
- readonly role: "admin" | "member";
34
- };
35
- readonly ledger?: {
36
- readonly role: "admin" | "member";
37
- readonly right: "read" | "write";
38
- };
39
- }
40
- export interface InvitedParams {
41
- readonly tenant?: SqlInvitedParams["tenant"] & {
42
- readonly id: string;
43
- };
44
- readonly ledger?: SqlInvitedParams["ledger"] & {
45
- readonly id: string;
46
- };
47
- }
48
- export interface InviteTicket {
49
- readonly inviteId: string;
50
- readonly sendEmailCount: number;
51
- readonly inviterUserId: string;
52
- readonly query: QueryUser;
53
- readonly status: InviteTicketStatus;
54
- readonly statusReason: string;
55
- readonly invitedUserId?: string;
56
- readonly invitedParams: InvitedParams;
57
- readonly expiresAfter: Date;
58
- readonly createdAt: Date;
59
- readonly updatedAt: Date;
60
- }
61
- export type UserStatus = "active" | "inactive" | "banned" | "invited";
62
- export interface DashAuthType {
63
- readonly type: "ucan" | "clerk" | "better" | "device-id";
64
- readonly token: string;
65
- }
66
- export interface VerifiedAuth {
67
- readonly type: "clerk" | "better" | "device-id";
68
- readonly token: string;
69
- readonly userId: string;
70
- readonly provider: string;
71
- }
72
- export interface ClerkClaim {
73
- readonly email: string;
74
- readonly first: string;
75
- readonly last: string;
76
- readonly nick?: string;
77
- readonly name?: string;
78
- readonly image_url?: string;
79
- }
80
- export interface ClerkVerifyAuth extends VerifiedAuth {
81
- readonly params: ClerkClaim;
82
- }
83
- export interface User {
84
- readonly userId: string;
85
- readonly maxTenants: number;
86
- readonly status: UserStatus;
87
- readonly statusReason?: string;
88
- readonly createdAt: Date;
89
- readonly updatedAt: Date;
90
- readonly byProviders: UserByProvider[];
91
- }
92
- export interface UserByProvider extends Queryable {
93
- readonly providerUserId: string;
94
- readonly cleanEmail?: string;
95
- readonly cleanNick?: string;
96
- readonly queryProvider: AuthProvider;
97
- readonly queryEmail?: string;
98
- readonly queryNick?: string;
99
- readonly params: ClerkClaim;
100
- readonly used: Date;
101
- readonly createdAt: Date;
102
- readonly updatedAt: Date;
103
- }
104
- export interface ResCreateTenant {
105
- readonly type: "resCreateTenant";
106
- readonly tenant: OutTenantParams;
107
- }
108
- export interface FPApiParameters {
109
- readonly cloudPublicKeys: JWKPublic[];
110
- readonly clerkPublishableKey: string;
111
- readonly maxTenants: number;
112
- readonly maxAdminUsers: number;
113
- readonly maxMemberUsers: number;
114
- readonly maxInvites: number;
115
- readonly maxLedgers: number;
116
- readonly maxAppIdBindings: number;
117
- readonly deviceCA: DeviceIdCA;
118
- }
119
- export interface InCreateTenantParams {
120
- readonly name?: string;
121
- readonly ownerUserId: string;
122
- readonly defaultTenant?: boolean;
123
- }
124
- export interface ReqCreateTenant {
125
- readonly type: "reqCreateTenant";
126
- readonly auth: DashAuthType;
127
- readonly tenant: Omit<InCreateTenantParams, "ownerUserId">;
128
- }
129
- export interface InUpdateTenantParams {
130
- readonly tenantId: string;
131
- readonly name?: string;
132
- readonly maxAdminUsers?: number;
133
- readonly maxMemberUsers?: number;
134
- readonly maxInvites?: number;
135
- }
136
- export interface ResUpdateTenant {
137
- readonly type: "resUpdateTenant";
138
- readonly tenant: OutTenantParams;
139
- }
140
- export interface ReqUpdateTenant {
141
- readonly type: "reqUpdateTenant";
142
- readonly auth: DashAuthType;
143
- readonly tenant: InUpdateTenantParams;
144
- }
145
- export interface ResEnsureTenant {
146
- readonly type: "resEnsureTenant";
147
- readonly tenant: Tenant;
148
- }
149
- export interface ReqRedeemInvite {
150
- readonly type: "reqRedeemInvite";
151
- readonly auth: DashAuthType;
152
- }
153
- export interface ResRedeemInvite {
154
- readonly type: "resRedeemInvite";
155
- readonly invites?: InviteTicket[];
156
- }
157
- export interface ReqListLedgersByUser {
158
- readonly type: "reqListLedgersByUser";
159
- readonly auth: DashAuthType;
160
- readonly tenantIds?: string[];
161
- }
162
- interface LedgerUserRight {
163
- readonly userId: string;
164
- readonly role: Role;
165
- readonly right: ReadWrite;
166
- readonly name?: string;
167
- readonly default: boolean;
168
- readonly createdAt: Date;
169
- readonly updatedAt: Date;
170
- }
171
- export interface LedgerUser {
172
- readonly ledgerId: string;
173
- readonly tenantId: string;
174
- readonly name: string;
175
- readonly ownerId: string;
176
- readonly maxShares: number;
177
- readonly users: LedgerUserRight[];
178
- readonly createdAt: Date;
179
- readonly updatedAt: Date;
180
- }
181
- export interface ResListLedgersByUser {
182
- readonly type: "resListLedgersByUser";
183
- readonly userId: string;
184
- readonly ledgers: LedgerUser[];
185
- }
186
- export interface ReqListTenantsByUser {
187
- readonly type: "reqListTenantsByUser";
188
- readonly auth: DashAuthType;
189
- }
190
- export interface UserTenantCommon {
191
- readonly name?: string;
192
- readonly status: UserStatus;
193
- readonly statusReason: string;
194
- readonly createdAt: Date;
195
- readonly updatedAt: Date;
196
- }
197
- export interface TenantLimits {
198
- readonly maxAdminUsers: number;
199
- readonly maxMemberUsers: number;
200
- readonly maxInvites: number;
201
- readonly maxLedgers: number;
202
- }
203
- export interface UserTenant {
204
- readonly tenantId: string;
205
- readonly role: Role;
206
- readonly default: boolean;
207
- readonly user: UserTenantCommon & {
208
- readonly limits: {
209
- readonly maxTenants: number;
210
- };
211
- };
212
- readonly tenant: UserTenantCommon & {
213
- readonly limits: TenantLimits;
214
- };
215
- }
216
- export declare function isAdmin(ut: UserTenant): boolean;
217
- export interface AdminTenant extends UserTenant {
218
- readonly role: "admin";
219
- readonly adminUserIds: string[];
220
- readonly memberUserIds: string[];
221
- readonly maxAdminUsers: number;
222
- readonly maxMemberUsers: number;
223
- }
224
- export interface ResListTenantsByUser {
225
- readonly type: "resListTenantsByUser";
226
- readonly userId: string;
227
- readonly authUserId: string;
228
- readonly tenants: (AdminTenant | UserTenant)[];
229
- }
230
- export interface ReqFindUser {
231
- readonly type: "reqFindUser";
232
- readonly auth: DashAuthType;
233
- readonly query: QueryUser;
234
- }
235
- export interface ResFindUser {
236
- readonly type: "resFindUser";
237
- readonly query: QueryUser;
238
- readonly results: User[];
239
- }
240
- export interface QueryInviteTicket {
241
- readonly incSendEmailCount?: boolean;
242
- readonly inviteId?: string;
243
- readonly query: QueryUser;
244
- readonly invitedParams: InvitedParams;
245
- }
246
- export interface ReqInviteUser {
247
- readonly type: "reqInviteUser";
248
- readonly auth: DashAuthType;
249
- readonly ticket: QueryInviteTicket;
250
- }
251
- export interface ResInviteUser {
252
- readonly type: "resInviteUser";
253
- readonly invite: InviteTicket;
254
- }
255
- export interface ReqDeleteInvite {
256
- readonly type: "reqDeleteInvite";
257
- readonly auth: DashAuthType;
258
- readonly inviteId: string;
259
- }
260
- export interface ResDeleteInvite {
261
- readonly type: "resDeleteInvite";
262
- readonly inviteId: string;
263
- }
264
- export interface ReqListInvites {
265
- readonly type: "reqListInvites";
266
- readonly auth: DashAuthType;
267
- readonly tenantIds?: string[];
268
- readonly ledgerIds?: string[];
269
- }
270
- export interface ResListInvites {
271
- readonly type: "resListInvites";
272
- readonly tickets: InviteTicket[];
273
- }
274
- export interface ReqUpdateUserTenant {
275
- readonly type: "reqUpdateUserTenant";
276
- readonly auth: DashAuthType;
277
- readonly tenantId: string;
278
- readonly userId?: string;
279
- readonly role: Role;
280
- readonly default?: boolean;
281
- readonly name?: string;
282
- }
283
- export interface ResUpdateUserTenant {
284
- readonly type: "resUpdateUserTenant";
285
- readonly tenantId: string;
286
- readonly userId: string;
287
- readonly role: Role;
288
- readonly default: boolean;
289
- readonly name?: string;
290
- }
291
- export interface CreateLedger {
292
- readonly tenantId: string;
293
- readonly name: string;
294
- }
295
- export interface ReqCreateLedger {
296
- readonly type: "reqCreateLedger";
297
- readonly auth: DashAuthType;
298
- readonly ledger: CreateLedger;
299
- }
300
- export interface ResCreateLedger {
301
- readonly type: "resCreateLedger";
302
- readonly ledger: LedgerUser;
303
- }
304
- export interface UpdateLedger {
305
- readonly ledgerId: string;
306
- readonly tenantId: string;
307
- readonly right?: ReadWrite;
308
- readonly role?: Role;
309
- readonly name?: string;
310
- readonly default?: boolean;
311
- }
312
- export interface ReqUpdateLedger {
313
- readonly type: "reqUpdateLedger";
314
- readonly auth: DashAuthType;
315
- readonly ledger: UpdateLedger;
316
- }
317
- export interface ResUpdateLedger {
318
- readonly type: "resUpdateLedger";
319
- readonly ledger: LedgerUser;
320
- }
321
- export interface DeleteLedger {
322
- readonly ledgerId: string;
323
- readonly tenantId: string;
324
- }
325
- export interface ReqDeleteLedger {
326
- readonly type: "reqDeleteLedger";
327
- readonly auth: DashAuthType;
328
- readonly ledger: DeleteLedger;
329
- }
330
- export interface ResDeleteLedger {
331
- readonly type: "resDeleteLedger";
332
- }
333
- export interface ReqCloudSessionToken {
334
- readonly type: "reqCloudSessionToken";
335
- readonly auth: DashAuthType;
336
- readonly selected?: Partial<TenantLedger>;
337
- readonly resultId?: string;
338
- }
339
- export interface ResCloudSessionToken {
340
- readonly type: "resCloudSessionToken";
341
- readonly token: string;
342
- }
343
- export interface ReqTokenByResultId {
344
- readonly type: "reqTokenByResultId";
345
- readonly resultId: string;
346
- }
347
- export interface ResTokenByResultId {
348
- readonly type: "resTokenByResultId";
349
- readonly status: "found" | "not-found";
350
- readonly resultId: string;
351
- readonly token?: string;
352
- }
353
- export interface ResDeleteTenant {
354
- readonly type: "resDeleteTenant";
355
- readonly tenantId: string;
356
- }
357
- export interface ReqDeleteTenant {
358
- readonly type: "reqDeleteTenant";
359
- readonly auth: DashAuthType;
360
- readonly tenantId: string;
361
- }
362
- export interface OutTenantParams {
363
- readonly tenantId: string;
364
- readonly name: string;
365
- readonly ownerUserId: string;
366
- readonly maxAdminUsers: number;
367
- readonly maxMemberUsers: number;
368
- readonly maxInvites: number;
369
- readonly maxLedgers: number;
370
- readonly status: UserStatus;
371
- readonly statusReason: string;
372
- readonly createdAt: Date;
373
- readonly updatedAt: Date;
374
- }
375
- export interface ResEnsureUser {
376
- readonly type: "resEnsureUser";
377
- readonly user: User;
378
- readonly tenants: UserTenant[];
379
- }
380
- export interface ReqEnsureUser {
381
- readonly type: "reqEnsureUser";
382
- readonly auth: DashAuthType;
383
- }
384
- interface RoleBase {
385
- readonly tenantId?: string;
386
- readonly ledgerId?: string;
387
- readonly userId: string;
388
- readonly role: Role;
389
- readonly adminUserIds: string[];
390
- readonly memberUserIds: string[];
391
- }
392
- interface TenantRole extends RoleBase {
393
- readonly tenantId: string;
394
- }
395
- interface LedgerRole extends RoleBase {
396
- readonly ledgerId: string;
397
- readonly right: ReadWrite;
398
- }
399
- export type RoleType = TenantRole | LedgerRole;
400
- export interface ReqInsertTenant {
401
- readonly tenantId: string;
402
- readonly name?: string;
403
- readonly ownerUserId: string;
404
- readonly adminUserIds?: string[];
405
- readonly memberUserIds?: string[];
406
- readonly maxAdminUsers?: number;
407
- readonly maxMemberUsers?: number;
408
- readonly createdAt?: Date;
409
- readonly updatedAt?: Date;
410
- }
411
- export interface ReqExtendToken {
412
- readonly type: "reqExtendToken";
413
- readonly token: string;
414
- }
415
- export interface ResExtendToken {
416
- readonly type: "resExtendToken";
417
- readonly token: string;
418
- }
419
- export interface ReqCertFromCsr {
420
- readonly type: "reqCertFromCsr";
421
- readonly auth: DashAuthType;
422
- readonly csr: string;
423
- }
424
- export interface ResCertFromCsr {
425
- readonly type: "resCertFromCsr";
426
- readonly certificate: string;
427
- }
428
- export interface ReqEnsureCloudToken {
429
- readonly type: "reqEnsureCloudToken";
430
- readonly auth: DashAuthType;
431
- readonly appId: string;
432
- readonly env?: string;
433
- readonly tenant?: string;
434
- readonly ledger?: string;
435
- readonly prevCloudToken?: string;
436
- }
437
- export interface ResEnsureCloudToken {
438
- readonly type: "resEnsureCloudToken";
439
- readonly cloudToken: string;
440
- readonly appId: string;
441
- readonly tenant: string;
442
- readonly ledger: string;
443
- readonly expiresInSec: number;
444
- readonly expiresDate: string;
445
- readonly claims: FPCloudClaim;
446
- }
447
- export {};
package/msg-types.js DELETED
@@ -1,4 +0,0 @@
1
- export function isAdmin(ut) {
2
- return ut.role === "admin";
3
- }
4
- //# sourceMappingURL=msg-types.js.map
package/msg-types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"msg-types.js","sourceRoot":"","sources":["../jsr/msg-types.ts"],"names":[],"mappings":"AAwPA,MAAM,UAAU,OAAO,CAAC,EAAc,EAAE;IACtC,OAAO,EAAE,CAAC,IAAI,KAAK,OAAO,CAAC;AAAA,CAC5B"}