@fern-api/fdr-sdk 1.2.56-4cf0b0d54d → 1.2.56-d742990ae1
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/api-definition/snippets/backfill.d.ts.map +1 -1
- package/dist/api-definition/snippets/backfill.js +20 -37
- package/dist/api-definition/snippets/backfill.js.map +1 -1
- package/dist/js/api-definition/snippets/server.js +25 -27
- package/dist/js/api-definition/snippets/server.js.map +1 -1
- package/dist/js/api-definition/snippets/server.mjs +25 -27
- package/dist/js/api-definition/snippets/server.mjs.map +1 -1
- package/dist/js/navigation/ledger-root-builder.js +4 -18
- package/dist/js/navigation/ledger-root-builder.js.map +1 -1
- package/dist/js/navigation/ledger-root-builder.mjs +4 -18
- package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
- package/dist/navigation/__test__/ledger-root-builder.rootChildOrder.test.js +5 -7
- package/dist/navigation/__test__/ledger-root-builder.rootChildOrder.test.js.map +1 -1
- package/dist/navigation/ledger-root-builder.d.ts.map +1 -1
- package/dist/navigation/ledger-root-builder.js +14 -44
- package/dist/navigation/ledger-root-builder.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/api-definition/snippets/backfill.d.ts.map +1 -1
- package/dist/types/navigation/ledger-root-builder.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -43708,35 +43708,33 @@ function shouldIncludeHttpSnippetLanguage(language, flags) {
|
|
|
43708
43708
|
}
|
|
43709
43709
|
|
|
43710
43710
|
// src/api-definition/snippets/backfill.ts
|
|
43711
|
-
var YIELD_BUDGET_MS = 20;
|
|
43712
|
-
var yieldToEventLoop = () => new Promise((resolve) => typeof setImmediate === "function" ? setImmediate(resolve) : setTimeout(resolve, 0));
|
|
43713
43711
|
async function backfillSnippets(apiDefinition, dynamicIr, flags) {
|
|
43714
|
-
|
|
43715
|
-
|
|
43716
|
-
|
|
43717
|
-
|
|
43718
|
-
|
|
43719
|
-
|
|
43712
|
+
return {
|
|
43713
|
+
...apiDefinition,
|
|
43714
|
+
endpoints: await Promise.all(
|
|
43715
|
+
Object.entries(apiDefinition.endpoints).map(async ([id2, endpoint]) => {
|
|
43716
|
+
let dynamicGenerators = {};
|
|
43717
|
+
try {
|
|
43718
|
+
if (dynamicIr) {
|
|
43719
|
+
dynamicGenerators = createSnippetGenerators({ endpoint, dynamicIr });
|
|
43720
|
+
}
|
|
43721
|
+
} catch (error) {
|
|
43722
|
+
console.log("[backfill] error creating dynamic snippet generators:", error);
|
|
43723
|
+
}
|
|
43724
|
+
return [
|
|
43725
|
+
id2,
|
|
43726
|
+
{
|
|
43727
|
+
...endpoint,
|
|
43728
|
+
examples: await Promise.all(
|
|
43729
|
+
endpoint.examples?.map(
|
|
43730
|
+
(example) => backfillSnippetsForExample(apiDefinition, dynamicGenerators, endpoint, example, flags)
|
|
43731
|
+
) ?? []
|
|
43732
|
+
)
|
|
43733
|
+
}
|
|
43734
|
+
];
|
|
43735
|
+
})
|
|
43736
|
+
).then((entries) => Object.fromEntries(entries))
|
|
43720
43737
|
};
|
|
43721
|
-
const endpoints = {};
|
|
43722
|
-
for (const [id2, endpoint] of Object.entries(apiDefinition.endpoints)) {
|
|
43723
|
-
await maybeYield();
|
|
43724
|
-
let dynamicGenerators = {};
|
|
43725
|
-
try {
|
|
43726
|
-
if (dynamicIr) {
|
|
43727
|
-
dynamicGenerators = createSnippetGenerators({ endpoint, dynamicIr });
|
|
43728
|
-
}
|
|
43729
|
-
} catch (error) {
|
|
43730
|
-
console.log("[backfill] error creating dynamic snippet generators:", error);
|
|
43731
|
-
}
|
|
43732
|
-
const examples = [];
|
|
43733
|
-
for (const example of endpoint.examples ?? []) {
|
|
43734
|
-
await maybeYield();
|
|
43735
|
-
examples.push(await backfillSnippetsForExample(apiDefinition, dynamicGenerators, endpoint, example, flags));
|
|
43736
|
-
}
|
|
43737
|
-
endpoints[id2] = { ...endpoint, examples };
|
|
43738
|
-
}
|
|
43739
|
-
return { ...apiDefinition, endpoints };
|
|
43740
43738
|
}
|
|
43741
43739
|
async function backfillSnippetsForExample(apiDefinition, dynamicGenerators, endpoint, example, flags) {
|
|
43742
43740
|
const snippets = { ...example.snippets };
|