@secrecy/lib 1.63.0-feat-orgs.3 → 1.63.0-feat-orgs.5

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.
@@ -117,24 +117,32 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => {
117
117
  _input_in: {};
118
118
  _input_out: {};
119
119
  _output_in: {
120
- users: {
120
+ users: ({
121
121
  id: string;
122
122
  lastname: string;
123
123
  firstname: string;
124
124
  avatar: string | null;
125
125
  isSearchable: boolean;
126
- }[];
127
- currentUserId: string;
126
+ } & {
127
+ orgs: {
128
+ name: string;
129
+ id: string;
130
+ }[];
131
+ })[];
128
132
  };
129
133
  _output_out: {
130
- users: {
134
+ users: ({
131
135
  id: string;
132
136
  lastname: string;
133
137
  firstname: string;
134
138
  avatar: string | null;
135
139
  isSearchable: boolean;
136
- }[];
137
- currentUserId: string;
140
+ } & {
141
+ orgs: {
142
+ name: string;
143
+ id: string;
144
+ }[];
145
+ })[];
138
146
  };
139
147
  }, unknown>>;
140
148
  };
@@ -1517,10 +1525,18 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => {
1517
1525
  _output_in: {
1518
1526
  session: string;
1519
1527
  masterKeySalt: string;
1528
+ context: {
1529
+ userId: string;
1530
+ orgId: string;
1531
+ };
1520
1532
  };
1521
1533
  _output_out: {
1522
1534
  session: string;
1523
1535
  masterKeySalt: string;
1536
+ context: {
1537
+ userId: string;
1538
+ orgId: string;
1539
+ };
1524
1540
  };
1525
1541
  }, unknown>>;
1526
1542
  };
@@ -1729,14 +1745,20 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => {
1729
1745
  godFather?: string | undefined;
1730
1746
  };
1731
1747
  _output_in: {
1732
- userId: string;
1733
1748
  sessionId: string;
1749
+ context: {
1750
+ userId: string;
1751
+ orgId: string;
1752
+ };
1734
1753
  } & {
1735
1754
  masterKeySalt: string;
1736
1755
  };
1737
1756
  _output_out: {
1738
- userId: string;
1739
1757
  sessionId: string;
1758
+ context: {
1759
+ userId: string;
1760
+ orgId: string;
1761
+ };
1740
1762
  } & {
1741
1763
  masterKeySalt: string;
1742
1764
  };
@@ -1870,7 +1892,7 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => {
1870
1892
  _output_out: {};
1871
1893
  }, {}>>;
1872
1894
  };
1873
- changeUser: {
1895
+ changeContext: {
1874
1896
  mutate: import("@trpc/client").Resolver<import("@trpc/server").BuildProcedure<"mutation", {
1875
1897
  _config: import("@trpc/server").RootConfig<{
1876
1898
  ctx: {};
@@ -1905,16 +1927,26 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => {
1905
1927
  ls: TranslationFunctions;
1906
1928
  };
1907
1929
  _input_in: {
1908
- userId: string;
1930
+ userId?: string | undefined;
1931
+ orgId?: string | undefined;
1909
1932
  };
1910
1933
  _input_out: {
1911
- userId: string;
1934
+ userId?: string | undefined;
1935
+ orgId?: string | undefined;
1912
1936
  };
1913
1937
  _output_in: {
1914
1938
  sessionId: string;
1939
+ context: {
1940
+ userId: string;
1941
+ orgId: string;
1942
+ };
1915
1943
  };
1916
1944
  _output_out: {
1917
1945
  sessionId: string;
1946
+ context: {
1947
+ userId: string;
1948
+ orgId: string;
1949
+ };
1918
1950
  };
1919
1951
  }, unknown>>;
1920
1952
  };
@@ -12583,10 +12615,10 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => {
12583
12615
  _meta: object;
12584
12616
  _ctx_out: {};
12585
12617
  _input_in: {
12586
- planCode: "org_basic_month" | "org_basic_year" | "org_advanced_month" | "org_advanced_year" | "org_pro_month" | "org_pro_year";
12618
+ planKind: "free" | "basic" | "advanced" | "pro";
12587
12619
  };
12588
12620
  _input_out: {
12589
- planCode: "org_basic_month" | "org_basic_year" | "org_advanced_month" | "org_advanced_year" | "org_pro_month" | "org_pro_year";
12621
+ planKind: "free" | "basic" | "advanced" | "pro";
12590
12622
  };
12591
12623
  _output_in: {
12592
12624
  url: string | null;
@@ -12683,11 +12715,11 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => {
12683
12715
  description: string | null;
12684
12716
  status: "canceled" | "past_due" | "active" | "incomplete" | "incomplete_expired" | "paused" | "trialing" | "unpaid";
12685
12717
  metadata: Record<string, string>;
12718
+ created: number;
12686
12719
  billingCycleAnchor: number;
12687
12720
  cancelAt: number | null;
12688
12721
  cancelAtPeriodEnd: boolean;
12689
12722
  canceledAt: number | null;
12690
- created: number;
12691
12723
  daysUntilDue: number | null;
12692
12724
  startDate: number;
12693
12725
  endedAt: number | null;
@@ -12702,11 +12734,11 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => {
12702
12734
  description: string | null;
12703
12735
  status: "canceled" | "past_due" | "active" | "incomplete" | "incomplete_expired" | "paused" | "trialing" | "unpaid";
12704
12736
  metadata: Record<string, string>;
12737
+ created: number;
12705
12738
  billingCycleAnchor: number;
12706
12739
  cancelAt: number | null;
12707
12740
  cancelAtPeriodEnd: boolean;
12708
12741
  canceledAt: number | null;
12709
- created: number;
12710
12742
  daysUntilDue: number | null;
12711
12743
  startDate: number;
12712
12744
  endedAt: number | null;
@@ -13057,10 +13089,12 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => {
13057
13089
  _input_in: {
13058
13090
  name: string;
13059
13091
  id: string;
13092
+ billingProfileStripeCustomerId: string | null;
13060
13093
  };
13061
13094
  _input_out: {
13062
13095
  name: string;
13063
13096
  id: string;
13097
+ billingProfileStripeCustomerId: string | null;
13064
13098
  };
13065
13099
  _output_in: {
13066
13100
  name: string;
@@ -13115,7 +13149,6 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => {
13115
13149
  _input_in: {};
13116
13150
  _input_out: {};
13117
13151
  _output_in: ({
13118
- codes: string[];
13119
13152
  id: string;
13120
13153
  quotasId: string;
13121
13154
  stripePricesId: string | null;
@@ -13141,13 +13174,9 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => {
13141
13174
  };
13142
13175
  };
13143
13176
  } & {
13144
- price: {
13145
- monthly: number;
13146
- yearly: number;
13147
- };
13177
+ price: number;
13148
13178
  })[];
13149
13179
  _output_out: ({
13150
- codes: ("org_basic_month" | "org_basic_year" | "org_advanced_month" | "org_advanced_year" | "org_pro_month" | "org_pro_year")[];
13151
13180
  id: string;
13152
13181
  quotasId: string;
13153
13182
  stripePricesId: string | null;
@@ -13173,10 +13202,7 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => {
13173
13202
  };
13174
13203
  };
13175
13204
  } & {
13176
- price: {
13177
- monthly: number;
13178
- yearly: number;
13179
- };
13205
+ price: number;
13180
13206
  })[];
13181
13207
  }, unknown>>;
13182
13208
  };
@@ -14054,8 +14080,12 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => {
14054
14080
  }>;
14055
14081
  _meta: object;
14056
14082
  _ctx_out: {};
14057
- _input_in: {};
14058
- _input_out: {};
14083
+ _input_in: {
14084
+ id: string;
14085
+ };
14086
+ _input_out: {
14087
+ id: string;
14088
+ };
14059
14089
  _output_in: {
14060
14090
  url: string | null;
14061
14091
  };
@@ -15358,6 +15388,156 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => {
15358
15388
  };
15359
15389
  }, unknown>>;
15360
15390
  };
15391
+ createSubscription: {
15392
+ mutate: import("@trpc/client").Resolver<import("@trpc/server").BuildProcedure<"mutation", {
15393
+ _config: import("@trpc/server").RootConfig<{
15394
+ ctx: {};
15395
+ meta: object;
15396
+ errorShape: {
15397
+ message: string;
15398
+ code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
15399
+ data: _trpc_server_dist_error_formatter.DefaultErrorData;
15400
+ } | {
15401
+ data: {
15402
+ zodError: import("zod").typeToFlattenedError<any, string> | null;
15403
+ code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
15404
+ httpStatus: number;
15405
+ path?: string;
15406
+ stack?: string;
15407
+ };
15408
+ message: string;
15409
+ code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
15410
+ };
15411
+ transformer: typeof superjson;
15412
+ }>;
15413
+ _meta: object;
15414
+ _ctx_out: {
15415
+ session: {
15416
+ app: {
15417
+ id: string;
15418
+ planId: string;
15419
+ fakeUserId: string | undefined;
15420
+ settings: {
15421
+ id: string;
15422
+ devsLimit: bigint | null;
15423
+ usersLimit: bigint | null;
15424
+ perDataSizeLimit: bigint | null;
15425
+ bandwidthLimit: bigint | null;
15426
+ totalStorageSizeLimit: bigint | null;
15427
+ payForUsers: boolean;
15428
+ };
15429
+ };
15430
+ sessionId: string;
15431
+ accountId: string;
15432
+ accountInfosId: string;
15433
+ accountRole: _prisma_client.AccountRole;
15434
+ userId: string;
15435
+ userRole: _prisma_client.UserRole;
15436
+ org: {
15437
+ id: string;
15438
+ name: string;
15439
+ plan: _prisma_client.OrganizationPlanKind;
15440
+ role: _prisma_client.OrganizationRole;
15441
+ };
15442
+ };
15443
+ req: {
15444
+ headers: Headers;
15445
+ };
15446
+ res: {
15447
+ headers: Headers;
15448
+ };
15449
+ locale: Locales;
15450
+ ls: TranslationFunctions;
15451
+ };
15452
+ _input_in: {
15453
+ planName: string;
15454
+ };
15455
+ _input_out: {
15456
+ planName: string;
15457
+ };
15458
+ _output_in: {
15459
+ url: string | null;
15460
+ };
15461
+ _output_out: {
15462
+ url: string | null;
15463
+ };
15464
+ }, unknown>>;
15465
+ };
15466
+ cancelSubscription: {
15467
+ mutate: import("@trpc/client").Resolver<import("@trpc/server").BuildProcedure<"mutation", {
15468
+ _config: import("@trpc/server").RootConfig<{
15469
+ ctx: {};
15470
+ meta: object;
15471
+ errorShape: {
15472
+ message: string;
15473
+ code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
15474
+ data: _trpc_server_dist_error_formatter.DefaultErrorData;
15475
+ } | {
15476
+ data: {
15477
+ zodError: import("zod").typeToFlattenedError<any, string> | null;
15478
+ code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
15479
+ httpStatus: number;
15480
+ path?: string;
15481
+ stack?: string;
15482
+ };
15483
+ message: string;
15484
+ code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
15485
+ };
15486
+ transformer: typeof superjson;
15487
+ }>;
15488
+ _meta: object;
15489
+ _ctx_out: {
15490
+ session: {
15491
+ app: {
15492
+ id: string;
15493
+ planId: string;
15494
+ fakeUserId: string | undefined;
15495
+ settings: {
15496
+ id: string;
15497
+ devsLimit: bigint | null;
15498
+ usersLimit: bigint | null;
15499
+ perDataSizeLimit: bigint | null;
15500
+ bandwidthLimit: bigint | null;
15501
+ totalStorageSizeLimit: bigint | null;
15502
+ payForUsers: boolean;
15503
+ };
15504
+ };
15505
+ sessionId: string;
15506
+ accountId: string;
15507
+ accountInfosId: string;
15508
+ accountRole: _prisma_client.AccountRole;
15509
+ userId: string;
15510
+ userRole: _prisma_client.UserRole;
15511
+ org: {
15512
+ id: string;
15513
+ name: string;
15514
+ plan: _prisma_client.OrganizationPlanKind;
15515
+ role: _prisma_client.OrganizationRole;
15516
+ };
15517
+ };
15518
+ req: {
15519
+ headers: Headers;
15520
+ };
15521
+ res: {
15522
+ headers: Headers;
15523
+ };
15524
+ locale: Locales;
15525
+ ls: TranslationFunctions;
15526
+ };
15527
+ _input_in: {
15528
+ waitUntilPeriodEnd: boolean;
15529
+ };
15530
+ _input_out: {
15531
+ waitUntilPeriodEnd: boolean;
15532
+ };
15533
+ _output_in: {
15534
+ isCancelled: boolean;
15535
+ };
15536
+ _output_out: {
15537
+ isCancelled: boolean;
15538
+ };
15539
+ }, unknown>>;
15540
+ };
15361
15541
  deleteApplication: {
15362
15542
  mutate: import("@trpc/client").Resolver<import("@trpc/server").BuildProcedure<"mutation", {
15363
15543
  _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.63.0-feat-orgs.3",
5
+ "version": "1.63.0-feat-orgs.5",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/anonymize-org/lib.git"
@@ -74,7 +74,7 @@
74
74
  "typescript": "^5.7.2"
75
75
  },
76
76
  "dependencies": {
77
- "@secrecy/trpc-api-types": "1.33.0-feat-orgs.12",
77
+ "@secrecy/trpc-api-types": "1.33.0-feat-orgs.17",
78
78
  "@trpc/client": "10.45.2",
79
79
  "@trpc/server": "10.45.2",
80
80
  "@types/libsodium-wrappers-sumo": "^0.7.8",