@secrecy/lib 1.7.0-integration-trpc-client.35 → 1.7.0-integration-trpc-client.36

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.
@@ -41,18 +41,14 @@ export function getSecrecyClient(session) {
41
41
  }
42
42
  return new SecrecyClient(uaSession, uaKeys, uaJwt);
43
43
  }
44
- export async function login({ appCode, path, redirect, scopes, backPath, session, }) {
44
+ export async function login({ appId, path, redirect, scopes, backPath, session, }) {
45
45
  return await new Promise((resolve, reject) => {
46
46
  const appUrl = window.location.origin;
47
- if (typeof appCode === 'string' && !appUrl.includes('localhost')) {
48
- reject(new Error('appCode is only available on localhost'));
49
- return;
50
- }
51
47
  const client = getSecrecyClient();
52
48
  if (client === null) {
53
49
  const infos = {
54
50
  appUrl,
55
- appCode,
51
+ appId,
56
52
  redirect,
57
53
  path,
58
54
  scopes,
@@ -24,7 +24,5 @@ export declare class BaseClient {
24
24
  static getPaymentRequest: ({ paymentRequestId, secrecyIdSeller, }: {
25
25
  paymentRequestId: string;
26
26
  secrecyIdSeller: string;
27
- secrecyId?: string | undefined;
28
- appCode?: string | undefined;
29
27
  }) => Promise<RouterOutputs['stripe']['paymentRequestToPay']>;
30
28
  }
@@ -7,9 +7,9 @@ export declare const getUrl: ({ hash, path, }: {
7
7
  path: string;
8
8
  }) => string;
9
9
  export interface HashInfos {
10
+ appId: string;
10
11
  appUrl: string;
11
12
  backPath?: string;
12
- appCode?: string | null | undefined;
13
13
  path?: string | null | undefined;
14
14
  redirect?: boolean;
15
15
  scopes?: {
@@ -23,5 +23,5 @@ export declare function getSecrecyClient<Schema extends DatabaseSchema = Databas
23
23
  type LoginResponse<Params extends UseSecrecyParams, Schema extends DatabaseSchema> = Params extends {
24
24
  redirect: true;
25
25
  } ? SecrecyClient<Schema> | null : SecrecyClient<Schema>;
26
- export declare function login<Params extends UseSecrecyParams, Schema extends DatabaseSchema = DatabaseSchema>({ appCode, path, redirect, scopes, backPath, session, }: Params): Promise<LoginResponse<Params, Schema>>;
26
+ export declare function login<Params extends UseSecrecyParams, Schema extends DatabaseSchema = DatabaseSchema>({ appId, path, redirect, scopes, backPath, session, }: Params): Promise<LoginResponse<Params, Schema>>;
27
27
  export {};
@@ -6034,7 +6034,27 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
6034
6034
  transformer: typeof superjson;
6035
6035
  }>;
6036
6036
  _meta: object;
6037
- _ctx_out: {};
6037
+ _ctx_out: {
6038
+ session: {
6039
+ appId: string;
6040
+ appPlanId: string | null;
6041
+ appFakeUserId: string | undefined;
6042
+ sessionId: string;
6043
+ accountId: string;
6044
+ accountRole: _prisma_client.$Enums.AccountRole;
6045
+ userId: string;
6046
+ userRole: _prisma_client.$Enums.UserRole;
6047
+ userPlan: _prisma_client.$Enums.PlanKind;
6048
+ };
6049
+ req: {
6050
+ headers: Headers;
6051
+ };
6052
+ res: {
6053
+ headers: Headers;
6054
+ };
6055
+ locale: Locales;
6056
+ ls: TranslationFunctions;
6057
+ };
6038
6058
  _input_in: {
6039
6059
  data: Record<string, unknown>;
6040
6060
  appEnv: string;
@@ -6074,7 +6094,27 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
6074
6094
  transformer: typeof superjson;
6075
6095
  }>;
6076
6096
  _meta: object;
6077
- _ctx_out: {};
6097
+ _ctx_out: {
6098
+ session: {
6099
+ appId: string;
6100
+ appPlanId: string | null;
6101
+ appFakeUserId: string | undefined;
6102
+ sessionId: string;
6103
+ accountId: string;
6104
+ accountRole: _prisma_client.$Enums.AccountRole;
6105
+ userId: string;
6106
+ userRole: _prisma_client.$Enums.UserRole;
6107
+ userPlan: _prisma_client.$Enums.PlanKind;
6108
+ };
6109
+ req: {
6110
+ headers: Headers;
6111
+ };
6112
+ res: {
6113
+ headers: Headers;
6114
+ };
6115
+ locale: Locales;
6116
+ ls: TranslationFunctions;
6117
+ };
6078
6118
  _input_in: {
6079
6119
  data: Record<string, unknown>[];
6080
6120
  appEnv: string;
@@ -6118,7 +6158,27 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
6118
6158
  transformer: typeof superjson;
6119
6159
  }>;
6120
6160
  _meta: object;
6121
- _ctx_out: {};
6161
+ _ctx_out: {
6162
+ session: {
6163
+ appId: string;
6164
+ appPlanId: string | null;
6165
+ appFakeUserId: string | undefined;
6166
+ sessionId: string;
6167
+ accountId: string;
6168
+ accountRole: _prisma_client.$Enums.AccountRole;
6169
+ userId: string;
6170
+ userRole: _prisma_client.$Enums.UserRole;
6171
+ userPlan: _prisma_client.$Enums.PlanKind;
6172
+ };
6173
+ req: {
6174
+ headers: Headers;
6175
+ };
6176
+ res: {
6177
+ headers: Headers;
6178
+ };
6179
+ locale: Locales;
6180
+ ls: TranslationFunctions;
6181
+ };
6122
6182
  _input_in: {
6123
6183
  where: Record<string, unknown>;
6124
6184
  appEnv: string;
@@ -6162,7 +6222,27 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
6162
6222
  transformer: typeof superjson;
6163
6223
  }>;
6164
6224
  _meta: object;
6165
- _ctx_out: {};
6225
+ _ctx_out: {
6226
+ session: {
6227
+ appId: string;
6228
+ appPlanId: string | null;
6229
+ appFakeUserId: string | undefined;
6230
+ sessionId: string;
6231
+ accountId: string;
6232
+ accountRole: _prisma_client.$Enums.AccountRole;
6233
+ userId: string;
6234
+ userRole: _prisma_client.$Enums.UserRole;
6235
+ userPlan: _prisma_client.$Enums.PlanKind;
6236
+ };
6237
+ req: {
6238
+ headers: Headers;
6239
+ };
6240
+ res: {
6241
+ headers: Headers;
6242
+ };
6243
+ locale: Locales;
6244
+ ls: TranslationFunctions;
6245
+ };
6166
6246
  _input_in: {
6167
6247
  appEnv: string;
6168
6248
  appTable: string;
@@ -6206,7 +6286,27 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
6206
6286
  transformer: typeof superjson;
6207
6287
  }>;
6208
6288
  _meta: object;
6209
- _ctx_out: {};
6289
+ _ctx_out: {
6290
+ session: {
6291
+ appId: string;
6292
+ appPlanId: string | null;
6293
+ appFakeUserId: string | undefined;
6294
+ sessionId: string;
6295
+ accountId: string;
6296
+ accountRole: _prisma_client.$Enums.AccountRole;
6297
+ userId: string;
6298
+ userRole: _prisma_client.$Enums.UserRole;
6299
+ userPlan: _prisma_client.$Enums.PlanKind;
6300
+ };
6301
+ req: {
6302
+ headers: Headers;
6303
+ };
6304
+ res: {
6305
+ headers: Headers;
6306
+ };
6307
+ locale: Locales;
6308
+ ls: TranslationFunctions;
6309
+ };
6210
6310
  _input_in: {
6211
6311
  where: Record<string, unknown>;
6212
6312
  appEnv: string;
@@ -6248,7 +6348,27 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
6248
6348
  transformer: typeof superjson;
6249
6349
  }>;
6250
6350
  _meta: object;
6251
- _ctx_out: {};
6351
+ _ctx_out: {
6352
+ session: {
6353
+ appId: string;
6354
+ appPlanId: string | null;
6355
+ appFakeUserId: string | undefined;
6356
+ sessionId: string;
6357
+ accountId: string;
6358
+ accountRole: _prisma_client.$Enums.AccountRole;
6359
+ userId: string;
6360
+ userRole: _prisma_client.$Enums.UserRole;
6361
+ userPlan: _prisma_client.$Enums.PlanKind;
6362
+ };
6363
+ req: {
6364
+ headers: Headers;
6365
+ };
6366
+ res: {
6367
+ headers: Headers;
6368
+ };
6369
+ locale: Locales;
6370
+ ls: TranslationFunctions;
6371
+ };
6252
6372
  _input_in: {
6253
6373
  appEnv: string;
6254
6374
  appTable: string;
@@ -6296,7 +6416,27 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
6296
6416
  transformer: typeof superjson;
6297
6417
  }>;
6298
6418
  _meta: object;
6299
- _ctx_out: {};
6419
+ _ctx_out: {
6420
+ session: {
6421
+ appId: string;
6422
+ appPlanId: string | null;
6423
+ appFakeUserId: string | undefined;
6424
+ sessionId: string;
6425
+ accountId: string;
6426
+ accountRole: _prisma_client.$Enums.AccountRole;
6427
+ userId: string;
6428
+ userRole: _prisma_client.$Enums.UserRole;
6429
+ userPlan: _prisma_client.$Enums.PlanKind;
6430
+ };
6431
+ req: {
6432
+ headers: Headers;
6433
+ };
6434
+ res: {
6435
+ headers: Headers;
6436
+ };
6437
+ locale: Locales;
6438
+ ls: TranslationFunctions;
6439
+ };
6300
6440
  _input_in: {
6301
6441
  where: Record<string, unknown>;
6302
6442
  data: Record<string, unknown>;
@@ -6340,7 +6480,27 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
6340
6480
  transformer: typeof superjson;
6341
6481
  }>;
6342
6482
  _meta: object;
6343
- _ctx_out: {};
6483
+ _ctx_out: {
6484
+ session: {
6485
+ appId: string;
6486
+ appPlanId: string | null;
6487
+ appFakeUserId: string | undefined;
6488
+ sessionId: string;
6489
+ accountId: string;
6490
+ accountRole: _prisma_client.$Enums.AccountRole;
6491
+ userId: string;
6492
+ userRole: _prisma_client.$Enums.UserRole;
6493
+ userPlan: _prisma_client.$Enums.PlanKind;
6494
+ };
6495
+ req: {
6496
+ headers: Headers;
6497
+ };
6498
+ res: {
6499
+ headers: Headers;
6500
+ };
6501
+ locale: Locales;
6502
+ ls: TranslationFunctions;
6503
+ };
6344
6504
  _input_in: {
6345
6505
  data: Record<string, unknown>;
6346
6506
  appEnv: string;
@@ -8222,14 +8382,14 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
8222
8382
  _ctx_out: {};
8223
8383
  _input_in: {
8224
8384
  appUrl: string;
8225
- appCode?: string | undefined;
8385
+ appId?: string | undefined;
8226
8386
  scopes?: {
8227
8387
  email: boolean;
8228
8388
  } | undefined;
8229
8389
  };
8230
8390
  _input_out: {
8231
8391
  appUrl: string;
8232
- appCode?: string | undefined;
8392
+ appId?: string | undefined;
8233
8393
  scopes?: {
8234
8394
  email: boolean;
8235
8395
  } | undefined;
@@ -9641,7 +9801,6 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
9641
9801
  appId: string;
9642
9802
  };
9643
9803
  _output_in: {
9644
- code: string;
9645
9804
  plan: {
9646
9805
  id: string;
9647
9806
  kind: string;
@@ -9712,7 +9871,6 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
9712
9871
  } | null)[];
9713
9872
  };
9714
9873
  _output_out: {
9715
- code: string;
9716
9874
  plan: {
9717
9875
  id: string;
9718
9876
  kind: string;
@@ -9815,7 +9973,6 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
9815
9973
  sortBy: "users" | "updatedAt" | "updatedAt_desc" | "updatedAt_asc" | "users_desc" | "users_asc";
9816
9974
  };
9817
9975
  _output_in: {
9818
- code: string;
9819
9976
  plan: {
9820
9977
  id: string;
9821
9978
  kind: string;
@@ -9886,7 +10043,6 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
9886
10043
  } | null)[];
9887
10044
  }[];
9888
10045
  _output_out: {
9889
- code: string;
9890
10046
  plan: {
9891
10047
  id: string;
9892
10048
  kind: string;
@@ -10306,64 +10462,6 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
10306
10462
  }[];
10307
10463
  }, unknown>>;
10308
10464
  };
10309
- renewAppCode: {
10310
- mutate: import("@trpc/client").Resolver<import("@trpc/server").BuildProcedure<"mutation", {
10311
- _config: import("@trpc/server").RootConfig<{
10312
- ctx: {};
10313
- meta: object;
10314
- errorShape: {
10315
- message: string;
10316
- code: _trpc_server_dist_rpc.TRPC_ERROR_CODE_NUMBER;
10317
- data: _trpc_server_dist_error_formatter.DefaultErrorData;
10318
- } | {
10319
- data: {
10320
- zodError: import("zod").typeToFlattenedError<any, string> | null;
10321
- code: "UNAUTHORIZED" | "NOT_FOUND" | "PARSE_ERROR" | "BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "FORBIDDEN" | "METHOD_NOT_SUPPORTED" | "TIMEOUT" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNPROCESSABLE_CONTENT" | "TOO_MANY_REQUESTS" | "CLIENT_CLOSED_REQUEST";
10322
- httpStatus: number;
10323
- path?: string | undefined;
10324
- stack?: string | undefined;
10325
- };
10326
- message: string;
10327
- code: _trpc_server_dist_rpc.TRPC_ERROR_CODE_NUMBER;
10328
- };
10329
- transformer: typeof superjson;
10330
- }>;
10331
- _meta: object;
10332
- _ctx_out: {
10333
- session: {
10334
- appId: string;
10335
- appPlanId: string | null;
10336
- appFakeUserId: string | undefined;
10337
- sessionId: string;
10338
- accountId: string;
10339
- accountRole: _prisma_client.$Enums.AccountRole;
10340
- userId: string;
10341
- userRole: _prisma_client.$Enums.UserRole;
10342
- userPlan: _prisma_client.$Enums.PlanKind;
10343
- };
10344
- req: {
10345
- headers: Headers;
10346
- };
10347
- res: {
10348
- headers: Headers;
10349
- };
10350
- locale: Locales;
10351
- ls: TranslationFunctions;
10352
- };
10353
- _input_in: {
10354
- appCode: string;
10355
- };
10356
- _input_out: {
10357
- appCode: string;
10358
- };
10359
- _output_in: {
10360
- isRenewed: boolean;
10361
- };
10362
- _output_out: {
10363
- isRenewed: boolean;
10364
- };
10365
- }, unknown>>;
10366
- };
10367
10465
  setOrigins: {
10368
10466
  mutate: import("@trpc/client").Resolver<import("@trpc/server").BuildProcedure<"mutation", {
10369
10467
  _config: import("@trpc/server").RootConfig<{
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@secrecy/lib",
3
3
  "author": "Anonymize <anonymize@gmail.com>",
4
4
  "description": "Anonymize Secrecy Library",
5
- "version": "1.7.0-integration-trpc-client.35",
5
+ "version": "1.7.0-integration-trpc-client.36",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/anonymize-org/lib.git"
@@ -74,7 +74,7 @@
74
74
  },
75
75
  "dependencies": {
76
76
  "@secrecy/lib-utils": "^1.0.18",
77
- "@secrecy/trpc-api-types": "1.12.0-integration-remove-appcode.2",
77
+ "@secrecy/trpc-api-types": "1.12.0-integration-delete-appcode.1",
78
78
  "@trpc/client": "10.45.0",
79
79
  "@trpc/server": "10.45.0",
80
80
  "@types/libsodium-wrappers-sumo": "^0.7.6",