@xyo-network/xl1-protocol-sdk 3.1.0 → 3.1.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.
- package/dist/neutral/CreatableProvider/AbstractCreatableProvider.d.ts +1 -0
- package/dist/neutral/CreatableProvider/AbstractCreatableProvider.d.ts.map +1 -1
- package/dist/neutral/capabilities/resolveProviders.d.ts +4 -1
- package/dist/neutral/capabilities/resolveProviders.d.ts.map +1 -1
- package/dist/neutral/config/Actor.d.ts +6 -0
- package/dist/neutral/config/Actor.d.ts.map +1 -1
- package/dist/neutral/config/Actors.d.ts +1 -0
- package/dist/neutral/config/Actors.d.ts.map +1 -1
- package/dist/neutral/config/Base.d.ts +1 -0
- package/dist/neutral/config/Base.d.ts.map +1 -1
- package/dist/neutral/config/Config.d.ts +4 -0
- package/dist/neutral/config/Config.d.ts.map +1 -1
- package/dist/neutral/config/HostActor.d.ts +6 -0
- package/dist/neutral/config/HostActor.d.ts.map +1 -1
- package/dist/neutral/config/connections/Connection.d.ts +3 -0
- package/dist/neutral/config/connections/Connection.d.ts.map +1 -1
- package/dist/neutral/config/connections/S3.d.ts +1 -0
- package/dist/neutral/config/connections/S3.d.ts.map +1 -1
- package/dist/neutral/context/Actor.d.ts +6 -0
- package/dist/neutral/context/Actor.d.ts.map +1 -1
- package/dist/neutral/context/HostActor.d.ts +6 -0
- package/dist/neutral/context/HostActor.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.d.ts +2 -0
- package/dist/neutral/getFileConfig.d.ts.map +1 -1
- package/dist/neutral/getFileConfig.mjs +1 -0
- package/dist/neutral/getFileConfig.mjs.map +2 -2
- package/dist/neutral/index.mjs +19 -12
- package/dist/neutral/index.mjs.map +2 -2
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts +6 -0
- package/dist/neutral/model/CreatableProviderContext.zod.d.ts.map +1 -1
- package/dist/neutral/test/index.mjs +1 -0
- package/dist/neutral/test/index.mjs.map +2 -2
- package/package.json +7 -7
package/dist/neutral/index.mjs
CHANGED
|
@@ -1520,12 +1520,28 @@ function expandBindingClosure(wanted, bindings, selectedById, candidatesByMonike
|
|
|
1520
1520
|
}
|
|
1521
1521
|
}
|
|
1522
1522
|
function bindMoniker(moniker, wanted, bindings, selectedById, candidatesByMoniker, rejected, allCandidates, options) {
|
|
1523
|
+
const group = candidatesByMoniker.get(moniker) ?? [];
|
|
1524
|
+
const winner = bindsNoConnection(group) ? group[0] : selectByConnection(moniker, group, rejected, allCandidates, options);
|
|
1525
|
+
bindings[moniker] = winner.id;
|
|
1526
|
+
selectedById.set(winner.id, winner);
|
|
1527
|
+
let grew = false;
|
|
1528
|
+
for (const dep of winner.dependencies ?? []) {
|
|
1529
|
+
if (!wanted.has(dep)) {
|
|
1530
|
+
wanted.add(dep);
|
|
1531
|
+
grew = true;
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
return grew;
|
|
1535
|
+
}
|
|
1536
|
+
function bindsNoConnection(group) {
|
|
1537
|
+
return group.length === 1 && descriptorConnectionTypes(group[0]).length === 0;
|
|
1538
|
+
}
|
|
1539
|
+
function selectByConnection(moniker, group, rejected, allCandidates, options) {
|
|
1523
1540
|
const connectionName = connectionNameForMoniker(moniker, options);
|
|
1524
1541
|
const connection = options.connections?.[connectionName];
|
|
1525
1542
|
if (!isDefined4(connection)) {
|
|
1526
1543
|
throw new UnknownConnectionError(moniker, connectionName);
|
|
1527
1544
|
}
|
|
1528
|
-
const group = candidatesByMoniker.get(moniker) ?? [];
|
|
1529
1545
|
const { filtered, rejected: connectionRejected } = filterByConnection(
|
|
1530
1546
|
group,
|
|
1531
1547
|
connection.type,
|
|
@@ -1538,17 +1554,7 @@ function bindMoniker(moniker, wanted, bindings, selectedById, candidatesByMonike
|
|
|
1538
1554
|
if (filtered.length > 1) {
|
|
1539
1555
|
throw new AmbiguousProviderError(moniker, filtered);
|
|
1540
1556
|
}
|
|
1541
|
-
|
|
1542
|
-
bindings[moniker] = winner.id;
|
|
1543
|
-
selectedById.set(winner.id, winner);
|
|
1544
|
-
let grew = false;
|
|
1545
|
-
for (const dep of winner.dependencies ?? []) {
|
|
1546
|
-
if (!wanted.has(dep)) {
|
|
1547
|
-
wanted.add(dep);
|
|
1548
|
-
grew = true;
|
|
1549
|
-
}
|
|
1550
|
-
}
|
|
1551
|
-
return grew;
|
|
1557
|
+
return filtered[0];
|
|
1552
1558
|
}
|
|
1553
1559
|
function connectionNameForMoniker(moniker, options) {
|
|
1554
1560
|
const binding = options.providerBindings?.[moniker];
|
|
@@ -1757,6 +1763,7 @@ var S3BucketConfigZod = z4.object({
|
|
|
1757
1763
|
accessKeyId: z4.string().nonempty().optional().describe("S3-compatible access key id for this bucket (overrides the shared default)"),
|
|
1758
1764
|
accountId: z4.string().nonempty().optional().describe("Account id for this bucket; on Cloudflare R2 it forms the endpoint (overrides the shared default)"),
|
|
1759
1765
|
bucket: z4.string().nonempty().optional().describe("S3-compatible bucket name"),
|
|
1766
|
+
endpoint: z4.string().nonempty().optional().describe("S3-compatible API endpoint for reads and writes; when omitted, derived from accountId as a Cloudflare R2 endpoint"),
|
|
1760
1767
|
prefix: z4.string().nonempty().optional().describe("Optional key prefix within the bucket"),
|
|
1761
1768
|
readUrl: z4.string().nonempty().optional().describe("Public HTTP/CDN base URL for anonymous reads of this bucket"),
|
|
1762
1769
|
secretAccessKey: z4.string().nonempty().optional().describe("S3-compatible secret access key for this bucket (overrides the shared default)")
|