@tinycloud/sdk-core 2.2.0-beta.4 → 2.2.0-beta.6
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.
- package/dist/index.cjs +24 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -39
- package/dist/index.d.ts +39 -39
- package/dist/index.js +24 -22
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -234,7 +234,7 @@ interface PermissionEntry {
|
|
|
234
234
|
*
|
|
235
235
|
* - `false` → no auto-included permissions
|
|
236
236
|
* - `true` → standard tier (KV + SQL read/write + capabilities:read)
|
|
237
|
-
* - `"admin"` → standard + SQL ddl
|
|
237
|
+
* - `"admin"` → standard + SQL ddl
|
|
238
238
|
* - `"all"` → everything the SDK supports (including DuckDB)
|
|
239
239
|
*
|
|
240
240
|
* Unknown string values silently fall back to `true`. Values are normalized
|
|
@@ -1303,11 +1303,11 @@ declare const DelegationSchema: z.ZodObject<{
|
|
|
1303
1303
|
authHeader: z.ZodOptional<z.ZodString>;
|
|
1304
1304
|
}, "strip", z.ZodTypeAny, {
|
|
1305
1305
|
path: string;
|
|
1306
|
-
actions: string[];
|
|
1307
1306
|
expiry: Date;
|
|
1308
1307
|
spaceId: string;
|
|
1309
1308
|
cid: string;
|
|
1310
1309
|
delegateDID: string;
|
|
1310
|
+
actions: string[];
|
|
1311
1311
|
isRevoked: boolean;
|
|
1312
1312
|
createdAt?: Date | undefined;
|
|
1313
1313
|
delegatorDID?: string | undefined;
|
|
@@ -1316,11 +1316,11 @@ declare const DelegationSchema: z.ZodObject<{
|
|
|
1316
1316
|
authHeader?: string | undefined;
|
|
1317
1317
|
}, {
|
|
1318
1318
|
path: string;
|
|
1319
|
-
actions: string[];
|
|
1320
1319
|
expiry: Date;
|
|
1321
1320
|
spaceId: string;
|
|
1322
1321
|
cid: string;
|
|
1323
1322
|
delegateDID: string;
|
|
1323
|
+
actions: string[];
|
|
1324
1324
|
isRevoked: boolean;
|
|
1325
1325
|
createdAt?: Date | undefined;
|
|
1326
1326
|
delegatorDID?: string | undefined;
|
|
@@ -1461,11 +1461,11 @@ declare const CapabilityEntrySchema: z.ZodObject<{
|
|
|
1461
1461
|
authHeader: z.ZodOptional<z.ZodString>;
|
|
1462
1462
|
}, "strip", z.ZodTypeAny, {
|
|
1463
1463
|
path: string;
|
|
1464
|
-
actions: string[];
|
|
1465
1464
|
expiry: Date;
|
|
1466
1465
|
spaceId: string;
|
|
1467
1466
|
cid: string;
|
|
1468
1467
|
delegateDID: string;
|
|
1468
|
+
actions: string[];
|
|
1469
1469
|
isRevoked: boolean;
|
|
1470
1470
|
createdAt?: Date | undefined;
|
|
1471
1471
|
delegatorDID?: string | undefined;
|
|
@@ -1474,11 +1474,11 @@ declare const CapabilityEntrySchema: z.ZodObject<{
|
|
|
1474
1474
|
authHeader?: string | undefined;
|
|
1475
1475
|
}, {
|
|
1476
1476
|
path: string;
|
|
1477
|
-
actions: string[];
|
|
1478
1477
|
expiry: Date;
|
|
1479
1478
|
spaceId: string;
|
|
1480
1479
|
cid: string;
|
|
1481
1480
|
delegateDID: string;
|
|
1481
|
+
actions: string[];
|
|
1482
1482
|
isRevoked: boolean;
|
|
1483
1483
|
createdAt?: Date | undefined;
|
|
1484
1484
|
delegatorDID?: string | undefined;
|
|
@@ -1510,11 +1510,11 @@ declare const CapabilityEntrySchema: z.ZodObject<{
|
|
|
1510
1510
|
}[];
|
|
1511
1511
|
delegation: {
|
|
1512
1512
|
path: string;
|
|
1513
|
-
actions: string[];
|
|
1514
1513
|
expiry: Date;
|
|
1515
1514
|
spaceId: string;
|
|
1516
1515
|
cid: string;
|
|
1517
1516
|
delegateDID: string;
|
|
1517
|
+
actions: string[];
|
|
1518
1518
|
isRevoked: boolean;
|
|
1519
1519
|
createdAt?: Date | undefined;
|
|
1520
1520
|
delegatorDID?: string | undefined;
|
|
@@ -1547,11 +1547,11 @@ declare const CapabilityEntrySchema: z.ZodObject<{
|
|
|
1547
1547
|
}[];
|
|
1548
1548
|
delegation: {
|
|
1549
1549
|
path: string;
|
|
1550
|
-
actions: string[];
|
|
1551
1550
|
expiry: Date;
|
|
1552
1551
|
spaceId: string;
|
|
1553
1552
|
cid: string;
|
|
1554
1553
|
delegateDID: string;
|
|
1554
|
+
actions: string[];
|
|
1555
1555
|
isRevoked: boolean;
|
|
1556
1556
|
createdAt?: Date | undefined;
|
|
1557
1557
|
delegatorDID?: string | undefined;
|
|
@@ -1594,10 +1594,10 @@ declare const DelegationRecordSchema: z.ZodObject<{
|
|
|
1594
1594
|
parentCid: z.ZodOptional<z.ZodString>;
|
|
1595
1595
|
}, "strip", z.ZodTypeAny, {
|
|
1596
1596
|
path: string;
|
|
1597
|
-
actions: string[];
|
|
1598
1597
|
spaceId: string;
|
|
1599
1598
|
createdAt: Date;
|
|
1600
1599
|
cid: string;
|
|
1600
|
+
actions: string[];
|
|
1601
1601
|
isRevoked: boolean;
|
|
1602
1602
|
delegator: string;
|
|
1603
1603
|
delegatee: string;
|
|
@@ -1607,10 +1607,10 @@ declare const DelegationRecordSchema: z.ZodObject<{
|
|
|
1607
1607
|
keyId?: string | undefined;
|
|
1608
1608
|
}, {
|
|
1609
1609
|
path: string;
|
|
1610
|
-
actions: string[];
|
|
1611
1610
|
spaceId: string;
|
|
1612
1611
|
createdAt: Date;
|
|
1613
1612
|
cid: string;
|
|
1613
|
+
actions: string[];
|
|
1614
1614
|
isRevoked: boolean;
|
|
1615
1615
|
delegator: string;
|
|
1616
1616
|
delegatee: string;
|
|
@@ -1638,15 +1638,15 @@ declare const CreateDelegationParamsSchema: z.ZodObject<{
|
|
|
1638
1638
|
statement: z.ZodOptional<z.ZodString>;
|
|
1639
1639
|
}, "strip", z.ZodTypeAny, {
|
|
1640
1640
|
path: string;
|
|
1641
|
-
actions: string[];
|
|
1642
1641
|
delegateDID: string;
|
|
1642
|
+
actions: string[];
|
|
1643
1643
|
statement?: string | undefined;
|
|
1644
1644
|
expiry?: Date | undefined;
|
|
1645
1645
|
disableSubDelegation?: boolean | undefined;
|
|
1646
1646
|
}, {
|
|
1647
1647
|
path: string;
|
|
1648
|
-
actions: string[];
|
|
1649
1648
|
delegateDID: string;
|
|
1649
|
+
actions: string[];
|
|
1650
1650
|
statement?: string | undefined;
|
|
1651
1651
|
expiry?: Date | undefined;
|
|
1652
1652
|
disableSubDelegation?: boolean | undefined;
|
|
@@ -1682,11 +1682,11 @@ declare const DelegationChainSchema: z.ZodArray<z.ZodObject<{
|
|
|
1682
1682
|
authHeader: z.ZodOptional<z.ZodString>;
|
|
1683
1683
|
}, "strip", z.ZodTypeAny, {
|
|
1684
1684
|
path: string;
|
|
1685
|
-
actions: string[];
|
|
1686
1685
|
expiry: Date;
|
|
1687
1686
|
spaceId: string;
|
|
1688
1687
|
cid: string;
|
|
1689
1688
|
delegateDID: string;
|
|
1689
|
+
actions: string[];
|
|
1690
1690
|
isRevoked: boolean;
|
|
1691
1691
|
createdAt?: Date | undefined;
|
|
1692
1692
|
delegatorDID?: string | undefined;
|
|
@@ -1695,11 +1695,11 @@ declare const DelegationChainSchema: z.ZodArray<z.ZodObject<{
|
|
|
1695
1695
|
authHeader?: string | undefined;
|
|
1696
1696
|
}, {
|
|
1697
1697
|
path: string;
|
|
1698
|
-
actions: string[];
|
|
1699
1698
|
expiry: Date;
|
|
1700
1699
|
spaceId: string;
|
|
1701
1700
|
cid: string;
|
|
1702
1701
|
delegateDID: string;
|
|
1702
|
+
actions: string[];
|
|
1703
1703
|
isRevoked: boolean;
|
|
1704
1704
|
createdAt?: Date | undefined;
|
|
1705
1705
|
delegatorDID?: string | undefined;
|
|
@@ -1740,11 +1740,11 @@ declare const DelegationChainV2Schema: z.ZodObject<{
|
|
|
1740
1740
|
authHeader: z.ZodOptional<z.ZodString>;
|
|
1741
1741
|
}, "strip", z.ZodTypeAny, {
|
|
1742
1742
|
path: string;
|
|
1743
|
-
actions: string[];
|
|
1744
1743
|
expiry: Date;
|
|
1745
1744
|
spaceId: string;
|
|
1746
1745
|
cid: string;
|
|
1747
1746
|
delegateDID: string;
|
|
1747
|
+
actions: string[];
|
|
1748
1748
|
isRevoked: boolean;
|
|
1749
1749
|
createdAt?: Date | undefined;
|
|
1750
1750
|
delegatorDID?: string | undefined;
|
|
@@ -1753,11 +1753,11 @@ declare const DelegationChainV2Schema: z.ZodObject<{
|
|
|
1753
1753
|
authHeader?: string | undefined;
|
|
1754
1754
|
}, {
|
|
1755
1755
|
path: string;
|
|
1756
|
-
actions: string[];
|
|
1757
1756
|
expiry: Date;
|
|
1758
1757
|
spaceId: string;
|
|
1759
1758
|
cid: string;
|
|
1760
1759
|
delegateDID: string;
|
|
1760
|
+
actions: string[];
|
|
1761
1761
|
isRevoked: boolean;
|
|
1762
1762
|
createdAt?: Date | undefined;
|
|
1763
1763
|
delegatorDID?: string | undefined;
|
|
@@ -1793,11 +1793,11 @@ declare const DelegationChainV2Schema: z.ZodObject<{
|
|
|
1793
1793
|
authHeader: z.ZodOptional<z.ZodString>;
|
|
1794
1794
|
}, "strip", z.ZodTypeAny, {
|
|
1795
1795
|
path: string;
|
|
1796
|
-
actions: string[];
|
|
1797
1796
|
expiry: Date;
|
|
1798
1797
|
spaceId: string;
|
|
1799
1798
|
cid: string;
|
|
1800
1799
|
delegateDID: string;
|
|
1800
|
+
actions: string[];
|
|
1801
1801
|
isRevoked: boolean;
|
|
1802
1802
|
createdAt?: Date | undefined;
|
|
1803
1803
|
delegatorDID?: string | undefined;
|
|
@@ -1806,11 +1806,11 @@ declare const DelegationChainV2Schema: z.ZodObject<{
|
|
|
1806
1806
|
authHeader?: string | undefined;
|
|
1807
1807
|
}, {
|
|
1808
1808
|
path: string;
|
|
1809
|
-
actions: string[];
|
|
1810
1809
|
expiry: Date;
|
|
1811
1810
|
spaceId: string;
|
|
1812
1811
|
cid: string;
|
|
1813
1812
|
delegateDID: string;
|
|
1813
|
+
actions: string[];
|
|
1814
1814
|
isRevoked: boolean;
|
|
1815
1815
|
createdAt?: Date | undefined;
|
|
1816
1816
|
delegatorDID?: string | undefined;
|
|
@@ -1846,11 +1846,11 @@ declare const DelegationChainV2Schema: z.ZodObject<{
|
|
|
1846
1846
|
authHeader: z.ZodOptional<z.ZodString>;
|
|
1847
1847
|
}, "strip", z.ZodTypeAny, {
|
|
1848
1848
|
path: string;
|
|
1849
|
-
actions: string[];
|
|
1850
1849
|
expiry: Date;
|
|
1851
1850
|
spaceId: string;
|
|
1852
1851
|
cid: string;
|
|
1853
1852
|
delegateDID: string;
|
|
1853
|
+
actions: string[];
|
|
1854
1854
|
isRevoked: boolean;
|
|
1855
1855
|
createdAt?: Date | undefined;
|
|
1856
1856
|
delegatorDID?: string | undefined;
|
|
@@ -1859,11 +1859,11 @@ declare const DelegationChainV2Schema: z.ZodObject<{
|
|
|
1859
1859
|
authHeader?: string | undefined;
|
|
1860
1860
|
}, {
|
|
1861
1861
|
path: string;
|
|
1862
|
-
actions: string[];
|
|
1863
1862
|
expiry: Date;
|
|
1864
1863
|
spaceId: string;
|
|
1865
1864
|
cid: string;
|
|
1866
1865
|
delegateDID: string;
|
|
1866
|
+
actions: string[];
|
|
1867
1867
|
isRevoked: boolean;
|
|
1868
1868
|
createdAt?: Date | undefined;
|
|
1869
1869
|
delegatorDID?: string | undefined;
|
|
@@ -1874,11 +1874,11 @@ declare const DelegationChainV2Schema: z.ZodObject<{
|
|
|
1874
1874
|
}, "strip", z.ZodTypeAny, {
|
|
1875
1875
|
root: {
|
|
1876
1876
|
path: string;
|
|
1877
|
-
actions: string[];
|
|
1878
1877
|
expiry: Date;
|
|
1879
1878
|
spaceId: string;
|
|
1880
1879
|
cid: string;
|
|
1881
1880
|
delegateDID: string;
|
|
1881
|
+
actions: string[];
|
|
1882
1882
|
isRevoked: boolean;
|
|
1883
1883
|
createdAt?: Date | undefined;
|
|
1884
1884
|
delegatorDID?: string | undefined;
|
|
@@ -1888,11 +1888,11 @@ declare const DelegationChainV2Schema: z.ZodObject<{
|
|
|
1888
1888
|
};
|
|
1889
1889
|
chain: {
|
|
1890
1890
|
path: string;
|
|
1891
|
-
actions: string[];
|
|
1892
1891
|
expiry: Date;
|
|
1893
1892
|
spaceId: string;
|
|
1894
1893
|
cid: string;
|
|
1895
1894
|
delegateDID: string;
|
|
1895
|
+
actions: string[];
|
|
1896
1896
|
isRevoked: boolean;
|
|
1897
1897
|
createdAt?: Date | undefined;
|
|
1898
1898
|
delegatorDID?: string | undefined;
|
|
@@ -1902,11 +1902,11 @@ declare const DelegationChainV2Schema: z.ZodObject<{
|
|
|
1902
1902
|
}[];
|
|
1903
1903
|
leaf: {
|
|
1904
1904
|
path: string;
|
|
1905
|
-
actions: string[];
|
|
1906
1905
|
expiry: Date;
|
|
1907
1906
|
spaceId: string;
|
|
1908
1907
|
cid: string;
|
|
1909
1908
|
delegateDID: string;
|
|
1909
|
+
actions: string[];
|
|
1910
1910
|
isRevoked: boolean;
|
|
1911
1911
|
createdAt?: Date | undefined;
|
|
1912
1912
|
delegatorDID?: string | undefined;
|
|
@@ -1917,11 +1917,11 @@ declare const DelegationChainV2Schema: z.ZodObject<{
|
|
|
1917
1917
|
}, {
|
|
1918
1918
|
root: {
|
|
1919
1919
|
path: string;
|
|
1920
|
-
actions: string[];
|
|
1921
1920
|
expiry: Date;
|
|
1922
1921
|
spaceId: string;
|
|
1923
1922
|
cid: string;
|
|
1924
1923
|
delegateDID: string;
|
|
1924
|
+
actions: string[];
|
|
1925
1925
|
isRevoked: boolean;
|
|
1926
1926
|
createdAt?: Date | undefined;
|
|
1927
1927
|
delegatorDID?: string | undefined;
|
|
@@ -1931,11 +1931,11 @@ declare const DelegationChainV2Schema: z.ZodObject<{
|
|
|
1931
1931
|
};
|
|
1932
1932
|
chain: {
|
|
1933
1933
|
path: string;
|
|
1934
|
-
actions: string[];
|
|
1935
1934
|
expiry: Date;
|
|
1936
1935
|
spaceId: string;
|
|
1937
1936
|
cid: string;
|
|
1938
1937
|
delegateDID: string;
|
|
1938
|
+
actions: string[];
|
|
1939
1939
|
isRevoked: boolean;
|
|
1940
1940
|
createdAt?: Date | undefined;
|
|
1941
1941
|
delegatorDID?: string | undefined;
|
|
@@ -1945,11 +1945,11 @@ declare const DelegationChainV2Schema: z.ZodObject<{
|
|
|
1945
1945
|
}[];
|
|
1946
1946
|
leaf: {
|
|
1947
1947
|
path: string;
|
|
1948
|
-
actions: string[];
|
|
1949
1948
|
expiry: Date;
|
|
1950
1949
|
spaceId: string;
|
|
1951
1950
|
cid: string;
|
|
1952
1951
|
delegateDID: string;
|
|
1952
|
+
actions: string[];
|
|
1953
1953
|
isRevoked: boolean;
|
|
1954
1954
|
createdAt?: Date | undefined;
|
|
1955
1955
|
delegatorDID?: string | undefined;
|
|
@@ -2086,11 +2086,11 @@ declare const ShareLinkSchema: z.ZodObject<{
|
|
|
2086
2086
|
authHeader: z.ZodOptional<z.ZodString>;
|
|
2087
2087
|
}, "strip", z.ZodTypeAny, {
|
|
2088
2088
|
path: string;
|
|
2089
|
-
actions: string[];
|
|
2090
2089
|
expiry: Date;
|
|
2091
2090
|
spaceId: string;
|
|
2092
2091
|
cid: string;
|
|
2093
2092
|
delegateDID: string;
|
|
2093
|
+
actions: string[];
|
|
2094
2094
|
isRevoked: boolean;
|
|
2095
2095
|
createdAt?: Date | undefined;
|
|
2096
2096
|
delegatorDID?: string | undefined;
|
|
@@ -2099,11 +2099,11 @@ declare const ShareLinkSchema: z.ZodObject<{
|
|
|
2099
2099
|
authHeader?: string | undefined;
|
|
2100
2100
|
}, {
|
|
2101
2101
|
path: string;
|
|
2102
|
-
actions: string[];
|
|
2103
2102
|
expiry: Date;
|
|
2104
2103
|
spaceId: string;
|
|
2105
2104
|
cid: string;
|
|
2106
2105
|
delegateDID: string;
|
|
2106
|
+
actions: string[];
|
|
2107
2107
|
isRevoked: boolean;
|
|
2108
2108
|
createdAt?: Date | undefined;
|
|
2109
2109
|
delegatorDID?: string | undefined;
|
|
@@ -2121,11 +2121,11 @@ declare const ShareLinkSchema: z.ZodObject<{
|
|
|
2121
2121
|
url: string;
|
|
2122
2122
|
delegation: {
|
|
2123
2123
|
path: string;
|
|
2124
|
-
actions: string[];
|
|
2125
2124
|
expiry: Date;
|
|
2126
2125
|
spaceId: string;
|
|
2127
2126
|
cid: string;
|
|
2128
2127
|
delegateDID: string;
|
|
2128
|
+
actions: string[];
|
|
2129
2129
|
isRevoked: boolean;
|
|
2130
2130
|
createdAt?: Date | undefined;
|
|
2131
2131
|
delegatorDID?: string | undefined;
|
|
@@ -2141,11 +2141,11 @@ declare const ShareLinkSchema: z.ZodObject<{
|
|
|
2141
2141
|
url: string;
|
|
2142
2142
|
delegation: {
|
|
2143
2143
|
path: string;
|
|
2144
|
-
actions: string[];
|
|
2145
2144
|
expiry: Date;
|
|
2146
2145
|
spaceId: string;
|
|
2147
2146
|
cid: string;
|
|
2148
2147
|
delegateDID: string;
|
|
2148
|
+
actions: string[];
|
|
2149
2149
|
isRevoked: boolean;
|
|
2150
2150
|
createdAt?: Date | undefined;
|
|
2151
2151
|
delegatorDID?: string | undefined;
|
|
@@ -2211,16 +2211,16 @@ declare const GenerateShareParamsSchema: z.ZodObject<{
|
|
|
2211
2211
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
2212
2212
|
}, "strip", z.ZodTypeAny, {
|
|
2213
2213
|
path: string;
|
|
2214
|
-
actions?: string[] | undefined;
|
|
2215
|
-
expiry?: Date | undefined;
|
|
2216
2214
|
description?: string | undefined;
|
|
2215
|
+
expiry?: Date | undefined;
|
|
2216
|
+
actions?: string[] | undefined;
|
|
2217
2217
|
schema?: "base64" | "compact" | "ipfs" | undefined;
|
|
2218
2218
|
baseUrl?: string | undefined;
|
|
2219
2219
|
}, {
|
|
2220
2220
|
path: string;
|
|
2221
|
-
actions?: string[] | undefined;
|
|
2222
|
-
expiry?: Date | undefined;
|
|
2223
2221
|
description?: string | undefined;
|
|
2222
|
+
expiry?: Date | undefined;
|
|
2223
|
+
actions?: string[] | undefined;
|
|
2224
2224
|
schema?: "base64" | "compact" | "ipfs" | undefined;
|
|
2225
2225
|
baseUrl?: string | undefined;
|
|
2226
2226
|
}>;
|
|
@@ -2318,13 +2318,13 @@ declare const DelegatedResourceSchema: z.ZodObject<{
|
|
|
2318
2318
|
actions: z.ZodArray<z.ZodString, "many">;
|
|
2319
2319
|
}, "strip", z.ZodTypeAny, {
|
|
2320
2320
|
path: string;
|
|
2321
|
-
service: string;
|
|
2322
2321
|
space: string;
|
|
2322
|
+
service: string;
|
|
2323
2323
|
actions: string[];
|
|
2324
2324
|
}, {
|
|
2325
2325
|
path: string;
|
|
2326
|
-
service: string;
|
|
2327
2326
|
space: string;
|
|
2327
|
+
service: string;
|
|
2328
2328
|
actions: string[];
|
|
2329
2329
|
}>;
|
|
2330
2330
|
type DelegatedResource = z.infer<typeof DelegatedResourceSchema>;
|
|
@@ -2416,20 +2416,20 @@ declare const CreateDelegationWasmResultSchema: z.ZodObject<{
|
|
|
2416
2416
|
actions: z.ZodArray<z.ZodString, "many">;
|
|
2417
2417
|
}, "strip", z.ZodTypeAny, {
|
|
2418
2418
|
path: string;
|
|
2419
|
-
service: string;
|
|
2420
2419
|
space: string;
|
|
2420
|
+
service: string;
|
|
2421
2421
|
actions: string[];
|
|
2422
2422
|
}, {
|
|
2423
2423
|
path: string;
|
|
2424
|
-
service: string;
|
|
2425
2424
|
space: string;
|
|
2425
|
+
service: string;
|
|
2426
2426
|
actions: string[];
|
|
2427
2427
|
}>, "many">;
|
|
2428
2428
|
}, "strip", z.ZodTypeAny, {
|
|
2429
2429
|
resources: {
|
|
2430
2430
|
path: string;
|
|
2431
|
-
service: string;
|
|
2432
2431
|
space: string;
|
|
2432
|
+
service: string;
|
|
2433
2433
|
actions: string[];
|
|
2434
2434
|
}[];
|
|
2435
2435
|
expiry: Date;
|
|
@@ -2439,8 +2439,8 @@ declare const CreateDelegationWasmResultSchema: z.ZodObject<{
|
|
|
2439
2439
|
}, {
|
|
2440
2440
|
resources: {
|
|
2441
2441
|
path: string;
|
|
2442
|
-
service: string;
|
|
2443
2442
|
space: string;
|
|
2443
|
+
service: string;
|
|
2444
2444
|
actions: string[];
|
|
2445
2445
|
}[];
|
|
2446
2446
|
expiry: Date;
|
package/dist/index.js
CHANGED
|
@@ -2694,12 +2694,6 @@ var DEFAULT_STANDARD_ENTRIES = [
|
|
|
2694
2694
|
space: DEFAULT_MANIFEST_SPACE,
|
|
2695
2695
|
path: "/",
|
|
2696
2696
|
actions: ["read", "write"]
|
|
2697
|
-
},
|
|
2698
|
-
{
|
|
2699
|
-
service: "tinycloud.capabilities",
|
|
2700
|
-
space: DEFAULT_MANIFEST_SPACE,
|
|
2701
|
-
path: "/",
|
|
2702
|
-
actions: ["read"]
|
|
2703
2697
|
}
|
|
2704
2698
|
];
|
|
2705
2699
|
var DEFAULT_ADMIN_ENTRIES = [
|
|
@@ -2714,12 +2708,6 @@ var DEFAULT_ADMIN_ENTRIES = [
|
|
|
2714
2708
|
space: DEFAULT_MANIFEST_SPACE,
|
|
2715
2709
|
path: "/",
|
|
2716
2710
|
actions: ["read", "write", "ddl"]
|
|
2717
|
-
},
|
|
2718
|
-
{
|
|
2719
|
-
service: "tinycloud.capabilities",
|
|
2720
|
-
space: DEFAULT_MANIFEST_SPACE,
|
|
2721
|
-
path: "/",
|
|
2722
|
-
actions: ["read", "admin"]
|
|
2723
2711
|
}
|
|
2724
2712
|
];
|
|
2725
2713
|
var DEFAULT_ALL_ENTRIES = [
|
|
@@ -2740,12 +2728,6 @@ var DEFAULT_ALL_ENTRIES = [
|
|
|
2740
2728
|
space: DEFAULT_MANIFEST_SPACE,
|
|
2741
2729
|
path: "/",
|
|
2742
2730
|
actions: ["read", "write"]
|
|
2743
|
-
},
|
|
2744
|
-
{
|
|
2745
|
-
service: "tinycloud.capabilities",
|
|
2746
|
-
space: DEFAULT_MANIFEST_SPACE,
|
|
2747
|
-
path: "/",
|
|
2748
|
-
actions: ["read", "admin"]
|
|
2749
2731
|
}
|
|
2750
2732
|
];
|
|
2751
2733
|
function parseExpiry(duration) {
|
|
@@ -2895,7 +2877,8 @@ function defaultEntriesForTier(tier) {
|
|
|
2895
2877
|
service: e.service,
|
|
2896
2878
|
space: e.space,
|
|
2897
2879
|
path: e.path,
|
|
2898
|
-
actions: [...e.actions]
|
|
2880
|
+
actions: [...e.actions],
|
|
2881
|
+
...e.skipPrefix !== void 0 ? { skipPrefix: e.skipPrefix } : {}
|
|
2899
2882
|
}));
|
|
2900
2883
|
}
|
|
2901
2884
|
function resolveManifest(input) {
|
|
@@ -2908,8 +2891,8 @@ function resolveManifest(input) {
|
|
|
2908
2891
|
const defaultEntries = defaultEntriesForTier(tier);
|
|
2909
2892
|
const explicitEntries = manifest.permissions ?? [];
|
|
2910
2893
|
const allEntries = [...defaultEntries, ...explicitEntries];
|
|
2911
|
-
const resources =
|
|
2912
|
-
(entry) => resolveEntry(entry, prefix, expiryMs, space)
|
|
2894
|
+
const resources = withCapabilitiesReadForSpaces(
|
|
2895
|
+
allEntries.map((entry) => resolveEntry(entry, prefix, expiryMs, space))
|
|
2913
2896
|
);
|
|
2914
2897
|
const additionalDelegates = manifest.did === void 0 ? [] : [
|
|
2915
2898
|
{
|
|
@@ -2992,6 +2975,24 @@ function dedupeResources(resources) {
|
|
|
2992
2975
|
}
|
|
2993
2976
|
return [...byKey.values()];
|
|
2994
2977
|
}
|
|
2978
|
+
function capabilitiesReadPermission(space) {
|
|
2979
|
+
return {
|
|
2980
|
+
service: "tinycloud.capabilities",
|
|
2981
|
+
space,
|
|
2982
|
+
path: "",
|
|
2983
|
+
actions: ["tinycloud.capabilities/read"]
|
|
2984
|
+
};
|
|
2985
|
+
}
|
|
2986
|
+
function withCapabilitiesReadForSpaces(resources) {
|
|
2987
|
+
if (resources.length === 0) {
|
|
2988
|
+
return [];
|
|
2989
|
+
}
|
|
2990
|
+
const spaces = new Set(resources.map((resource) => resource.space));
|
|
2991
|
+
return dedupeResources([
|
|
2992
|
+
...resources,
|
|
2993
|
+
...[...spaces].map(capabilitiesReadPermission)
|
|
2994
|
+
]);
|
|
2995
|
+
}
|
|
2995
2996
|
function accountRegistryPermission() {
|
|
2996
2997
|
return {
|
|
2997
2998
|
service: "tinycloud.kv",
|
|
@@ -3019,6 +3020,7 @@ function composeManifestRequest(inputs, options = {}) {
|
|
|
3019
3020
|
if (includeAccountRegistryPermissions) {
|
|
3020
3021
|
resources.push(accountRegistryPermission());
|
|
3021
3022
|
}
|
|
3023
|
+
const resourcesWithImplicitCapabilities = withCapabilitiesReadForSpaces(resources);
|
|
3022
3024
|
const manifestsByAppId = /* @__PURE__ */ new Map();
|
|
3023
3025
|
for (const manifest of manifests) {
|
|
3024
3026
|
const current = manifestsByAppId.get(manifest.app_id);
|
|
@@ -3038,7 +3040,7 @@ function composeManifestRequest(inputs, options = {}) {
|
|
|
3038
3040
|
})) : [];
|
|
3039
3041
|
return {
|
|
3040
3042
|
manifests,
|
|
3041
|
-
resources:
|
|
3043
|
+
resources: resourcesWithImplicitCapabilities,
|
|
3042
3044
|
delegationTargets,
|
|
3043
3045
|
registryRecords,
|
|
3044
3046
|
expiryMs: Math.max(...resolved.map((entry) => entry.expiryMs)),
|