@fern-api/fdr-sdk 1.2.55-46f658b255 → 1.2.55-b3cd01f2cc
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/prune.d.ts.map +1 -1
- package/dist/api-definition/prune.js +2 -2
- package/dist/api-definition/prune.js.map +1 -1
- package/dist/api-definition/snippets/graphql-snippets.d.ts.map +1 -1
- package/dist/api-definition/snippets/graphql-snippets.js +27 -3
- package/dist/api-definition/snippets/graphql-snippets.js.map +1 -1
- package/dist/api-definition/snippets/graphql-snippets.test.js +226 -3
- package/dist/api-definition/snippets/graphql-snippets.test.js.map +1 -1
- package/dist/js/api-definition/index.js +22 -3
- package/dist/js/api-definition/index.js.map +1 -1
- package/dist/js/api-definition/index.mjs +21 -3
- package/dist/js/api-definition/index.mjs.map +1 -1
- package/dist/js/client/FdrClient.js.map +1 -1
- package/dist/js/client/FdrClient.mjs.map +1 -1
- package/dist/js/client/types.js +12 -3
- package/dist/js/client/types.js.map +1 -1
- package/dist/js/client/types.mjs +12 -3
- package/dist/js/client/types.mjs.map +1 -1
- package/dist/js/converters/index.js +53 -16
- package/dist/js/converters/index.js.map +1 -1
- package/dist/js/converters/index.mjs +53 -16
- package/dist/js/converters/index.mjs.map +1 -1
- package/dist/js/index.js +53 -16
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.mjs +53 -16
- package/dist/js/index.mjs.map +1 -1
- package/dist/js/navigation/index.js +54 -16
- package/dist/js/navigation/index.js.map +1 -1
- package/dist/js/navigation/index.mjs +54 -16
- package/dist/js/navigation/index.mjs.map +1 -1
- package/dist/js/navigation/ledger-root-builder.js.map +1 -1
- package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
- package/dist/js/orpc-client.js +7 -0
- package/dist/js/orpc-client.js.map +1 -1
- package/dist/js/orpc-client.mjs +6 -0
- package/dist/js/orpc-client.mjs.map +1 -1
- package/dist/navigation/ApiDefinitionPruner.d.ts.map +1 -1
- package/dist/navigation/ApiDefinitionPruner.js +2 -1
- package/dist/navigation/ApiDefinitionPruner.js.map +1 -1
- package/dist/navigation/versions/v1/converters/ApiReferenceNavigationConverter.d.ts.map +1 -1
- package/dist/navigation/versions/v1/converters/ApiReferenceNavigationConverter.js +28 -13
- package/dist/navigation/versions/v1/converters/ApiReferenceNavigationConverter.js.map +1 -1
- package/dist/navigation/versions/v1/converters/__test__/ApiReferenceNavigationConverter.graphql.test.js +37 -8
- package/dist/navigation/versions/v1/converters/__test__/ApiReferenceNavigationConverter.graphql.test.js.map +1 -1
- package/dist/orpc-client/api/shared.d.ts +14 -0
- package/dist/orpc-client/api/shared.d.ts.map +1 -1
- package/dist/orpc-client/api/shared.js +15 -0
- package/dist/orpc-client/api/shared.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/api-definition/prune.d.ts.map +1 -1
- package/dist/types/api-definition/snippets/graphql-snippets.d.ts.map +1 -1
- package/dist/types/navigation/ApiDefinitionPruner.d.ts.map +1 -1
- package/dist/types/navigation/versions/v1/converters/ApiReferenceNavigationConverter.d.ts.map +1 -1
- package/dist/types/orpc-client/api/shared.d.ts +14 -0
- package/dist/types/orpc-client/api/shared.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -198,6 +198,7 @@ __export(api_definition_exports, {
|
|
|
198
198
|
generateHttpSnippets: () => generateHttpSnippets,
|
|
199
199
|
generateSdkSnippetForLanguage: () => generateSdkSnippetForLanguage,
|
|
200
200
|
generateSdkSnippets: () => generateSdkSnippets,
|
|
201
|
+
getGraphqlOperationIds: () => getGraphqlOperationIds,
|
|
201
202
|
getHarRequest: () => getHarRequest,
|
|
202
203
|
getMessageForStatus: () => getMessageForStatus,
|
|
203
204
|
joiner: () => joiner,
|
|
@@ -1050,6 +1051,11 @@ var GraphQlOperationIdSchema = z2.string();
|
|
|
1050
1051
|
function GraphQlOperationId(value) {
|
|
1051
1052
|
return value;
|
|
1052
1053
|
}
|
|
1054
|
+
function getGraphqlOperationIds(node) {
|
|
1055
|
+
const ids = new Set(node.graphqlOperationIds ?? []);
|
|
1056
|
+
ids.add(node.graphqlOperationId);
|
|
1057
|
+
return [...ids];
|
|
1058
|
+
}
|
|
1053
1059
|
var GraphQlTypeCategorySchema = z2.enum(["object", "input", "enum", "scalar", "interface", "union"]);
|
|
1054
1060
|
var EnvironmentIdSchema = z2.string();
|
|
1055
1061
|
function EnvironmentId(value) {
|
|
@@ -3175,8 +3181,7 @@ var ApiDefinitionPruner = class _ApiDefinitionPruner {
|
|
|
3175
3181
|
found.namespace?.forEach((subpackageId) => namespaces.add(subpackageId));
|
|
3176
3182
|
}
|
|
3177
3183
|
} else if (node.type === "graphql") {
|
|
3178
|
-
const
|
|
3179
|
-
for (const opId of idsToInclude) {
|
|
3184
|
+
for (const opId of getGraphqlOperationIds(node)) {
|
|
3180
3185
|
const found = this.api.graphqlOperations[opId];
|
|
3181
3186
|
if (found) {
|
|
3182
3187
|
toRet.graphqlOperations[opId] = found;
|
|
@@ -5414,7 +5419,8 @@ function generateGraphQlSnippet(context) {
|
|
|
5414
5419
|
const fieldPath = operation.fieldPath;
|
|
5415
5420
|
const hasFieldPath = fieldPath != null && fieldPath.length > 0;
|
|
5416
5421
|
const selectionSetIndent = hasFieldPath ? 2 + fieldPath.length : 2;
|
|
5417
|
-
const
|
|
5422
|
+
const initialDepth = isReturnTypeNamespace(operation.returnType, types) ? DEFAULT_MAX_DEPTH + 1 : DEFAULT_MAX_DEPTH;
|
|
5423
|
+
const selectionSet = generateSelectionSet(operation.returnType, types, initialDepth, /* @__PURE__ */ new Set(), selectionSetIndent);
|
|
5418
5424
|
let query = operationKeyword;
|
|
5419
5425
|
if (operationName || variableDefinitions.length > 0) {
|
|
5420
5426
|
query += ` ${operationName}`;
|
|
@@ -5664,6 +5670,18 @@ function generateExamplePrimitiveValue(primitive) {
|
|
|
5664
5670
|
return "example";
|
|
5665
5671
|
}
|
|
5666
5672
|
}
|
|
5673
|
+
var DEFAULT_MAX_DEPTH = 2;
|
|
5674
|
+
function isReturnTypeNamespace(returnType, types) {
|
|
5675
|
+
const { shape } = unwrapReference(returnType, types);
|
|
5676
|
+
if (shape.type !== "object") {
|
|
5677
|
+
return false;
|
|
5678
|
+
}
|
|
5679
|
+
const properties = shape.properties ?? [];
|
|
5680
|
+
if (properties.length === 0) {
|
|
5681
|
+
return false;
|
|
5682
|
+
}
|
|
5683
|
+
return properties.every((prop) => prop.arguments != null && prop.arguments.length > 0);
|
|
5684
|
+
}
|
|
5667
5685
|
function generateSelectionSet(shape, types, depth, visited = /* @__PURE__ */ new Set(), indentLevel = 2) {
|
|
5668
5686
|
if (depth <= 0) {
|
|
5669
5687
|
return "";
|
|
@@ -6806,6 +6824,7 @@ var Transformer = class _Transformer {
|
|
|
6806
6824
|
generateHttpSnippets,
|
|
6807
6825
|
generateSdkSnippetForLanguage,
|
|
6808
6826
|
generateSdkSnippets,
|
|
6827
|
+
getGraphqlOperationIds,
|
|
6809
6828
|
getHarRequest,
|
|
6810
6829
|
getMessageForStatus,
|
|
6811
6830
|
joiner,
|