@secrecy/lib 1.68.0 → 1.69.0-feat-anonymous-upload.2

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.
@@ -141,8 +141,9 @@ export class SecrecyCloudClient {
141
141
  const uploadData = await uploadDataCaller.mutate(uploadDataArgs, {
142
142
  signal,
143
143
  });
144
- if (uploadData.parts.length === 0) {
145
- if (uploadData.keyPair.pub !== this.#keys.publicKey) {
144
+ if (uploadData.type === 'authed' && uploadData.parts.length === 0) {
145
+ if (uploadData.keyPair &&
146
+ uploadData.keyPair.pub !== this.#keys.publicKey) {
146
147
  throw new Error('The public key does not match with cached key!');
147
148
  }
148
149
  await uploadProgress?.({
@@ -109,6 +109,9 @@ export declare class SecrecyCloudClient {
109
109
  slug: string;
110
110
  expireAt: Date | null;
111
111
  dataId: string;
112
+ createdByUserId: string | null;
113
+ createdByOrgId: string | null;
114
+ createdByAppId: string | null;
112
115
  }>;
113
116
  getPublicDataLinks(input: RouterInputs['cloud']['dataLinks']): Promise<{
114
117
  id: string;
@@ -116,6 +119,9 @@ export declare class SecrecyCloudClient {
116
119
  slug: string;
117
120
  expireAt: Date | null;
118
121
  dataId: string;
122
+ createdByUserId: string | null;
123
+ createdByOrgId: string | null;
124
+ createdByAppId: string | null;
119
125
  }[]>;
120
126
  checkAccesses(input: RouterInputs['cloud']['checkAccesses']): Promise<{
121
127
  isMatching: true;
@@ -159,6 +165,9 @@ export declare class SecrecyCloudClient {
159
165
  slug: string;
160
166
  expireAt: Date | null;
161
167
  dataId: string;
168
+ createdByUserId: string | null;
169
+ createdByOrgId: string | null;
170
+ createdByAppId: string | null;
162
171
  }>;
163
172
  updatePublicDataLink(input: RouterInputs['cloud']['updateDataLink']): Promise<{
164
173
  id: string;
@@ -166,6 +175,9 @@ export declare class SecrecyCloudClient {
166
175
  slug: string;
167
176
  expireAt: Date | null;
168
177
  dataId: string;
178
+ createdByUserId: string | null;
179
+ createdByOrgId: string | null;
180
+ createdByAppId: string | null;
169
181
  }>;
170
182
  deletePublicDataLink(input: RouterInputs['cloud']['deleteDataLink']): Promise<{
171
183
  id: string;
@@ -173,6 +185,9 @@ export declare class SecrecyCloudClient {
173
185
  slug: string;
174
186
  expireAt: Date | null;
175
187
  dataId: string;
188
+ createdByUserId: string | null;
189
+ createdByOrgId: string | null;
190
+ createdByAppId: string | null;
176
191
  }>;
177
192
  private _handleDataContent;
178
193
  }
@@ -324,7 +324,7 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
324
324
  userId: string;
325
325
  reportedDataId: string;
326
326
  } & {
327
- user: {
327
+ dataReportUser: {
328
328
  id: string;
329
329
  emails: string[];
330
330
  phones: string[];
@@ -365,7 +365,7 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
365
365
  date: Date;
366
366
  reportedDataId: string;
367
367
  } & {
368
- user: {
368
+ dataReportUser: {
369
369
  id: string;
370
370
  emails: string[];
371
371
  phones: string[];
@@ -1492,7 +1492,9 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1492
1492
  ext?: string | undefined;
1493
1493
  };
1494
1494
  output: {
1495
+ type: "authed";
1495
1496
  id: string;
1497
+ storageType: "s3" | "cold";
1496
1498
  parts: {
1497
1499
  url: string;
1498
1500
  order: number;
@@ -1504,6 +1506,16 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1504
1506
  pub: string;
1505
1507
  encPriv: string;
1506
1508
  };
1509
+ } | {
1510
+ type: "guest";
1511
+ id: string;
1512
+ storageType: "s3" | "cold";
1513
+ parts: {
1514
+ url: string;
1515
+ order: number;
1516
+ fields: Record<string, string>;
1517
+ }[];
1518
+ partSize: bigint;
1507
1519
  };
1508
1520
  meta: any;
1509
1521
  }>;
@@ -1525,7 +1537,9 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1525
1537
  ext?: string | undefined;
1526
1538
  };
1527
1539
  output: {
1540
+ type: "authed";
1528
1541
  id: string;
1542
+ storageType: "s3" | "cold";
1529
1543
  parts: {
1530
1544
  url: string;
1531
1545
  order: number;
@@ -1537,6 +1551,16 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1537
1551
  pub: string;
1538
1552
  encPriv: string;
1539
1553
  };
1554
+ } | {
1555
+ type: "guest";
1556
+ id: string;
1557
+ storageType: "s3" | "cold";
1558
+ parts: {
1559
+ url: string;
1560
+ order: number;
1561
+ fields: Record<string, string>;
1562
+ }[];
1563
+ partSize: bigint;
1540
1564
  };
1541
1565
  meta: any;
1542
1566
  }>;
@@ -1560,12 +1584,16 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1560
1584
  ext?: string | undefined;
1561
1585
  };
1562
1586
  output: {
1587
+ type: "authed";
1563
1588
  id: string;
1564
1589
  key: string | null;
1565
1590
  keyPair: {
1566
1591
  pub: string;
1567
1592
  encPriv: string;
1568
1593
  };
1594
+ } | {
1595
+ type: "guest";
1596
+ id: string;
1569
1597
  };
1570
1598
  meta: any;
1571
1599
  }>;
@@ -1590,6 +1618,9 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1590
1618
  slug: string;
1591
1619
  expireAt: Date | null;
1592
1620
  dataId: string;
1621
+ createdByUserId: string | null;
1622
+ createdByOrgId: string | null;
1623
+ createdByAppId: string | null;
1593
1624
  };
1594
1625
  meta: any;
1595
1626
  }>;
@@ -1603,6 +1634,9 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1603
1634
  slug: string;
1604
1635
  expireAt: Date | null;
1605
1636
  dataId: string;
1637
+ createdByUserId: string | null;
1638
+ createdByOrgId: string | null;
1639
+ createdByAppId: string | null;
1606
1640
  }[];
1607
1641
  meta: any;
1608
1642
  }>;
@@ -1620,6 +1654,9 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1620
1654
  slug: string;
1621
1655
  expireAt: Date | null;
1622
1656
  dataId: string;
1657
+ createdByUserId: string | null;
1658
+ createdByOrgId: string | null;
1659
+ createdByAppId: string | null;
1623
1660
  };
1624
1661
  meta: any;
1625
1662
  }>;
@@ -1637,6 +1674,9 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1637
1674
  slug: string;
1638
1675
  expireAt: Date | null;
1639
1676
  dataId: string;
1677
+ createdByUserId: string | null;
1678
+ createdByOrgId: string | null;
1679
+ createdByAppId: string | null;
1640
1680
  };
1641
1681
  meta: any;
1642
1682
  }>;
@@ -1650,6 +1690,9 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1650
1690
  slug: string;
1651
1691
  expireAt: Date | null;
1652
1692
  dataId: string;
1693
+ createdByUserId: string | null;
1694
+ createdByOrgId: string | null;
1695
+ createdByAppId: string | null;
1653
1696
  };
1654
1697
  meta: any;
1655
1698
  }>;
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.68.0",
5
+ "version": "1.69.0-feat-anonymous-upload.2",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/anonymize-org/lib.git"
@@ -75,9 +75,9 @@
75
75
  },
76
76
  "dependencies": {
77
77
  "@js-temporal/polyfill": "^0.5.1",
78
- "@secrecy/trpc-api-types": "1.33.0-feat-next15.14",
79
78
  "@trpc/client": "11.5.1",
80
79
  "@trpc/server": "11.5.1",
80
+ "@secrecy/trpc-api-types": "1.33.0-feat-unlog-upload.16",
81
81
  "@types/libsodium-wrappers-sumo": "^0.7.8",
82
82
  "axios": "^1.11.0",
83
83
  "bson": "^6.10.4",