@voxgig/sdkgen 1.5.1 → 2.0.0
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/cmp/AgentGuideContent.js +5 -0
- package/dist/cmp/AgentGuideContent.js.map +1 -1
- package/dist/cmp/Feature.js +13 -0
- package/dist/cmp/Feature.js.map +1 -1
- package/dist/helpers/canonType.d.ts +3 -1
- package/dist/helpers/canonType.js +44 -1
- package/dist/helpers/canonType.js.map +1 -1
- package/dist/helpers/packageMeta.js +7 -0
- package/dist/helpers/packageMeta.js.map +1 -1
- package/dist/sdkgen.d.ts +3 -3
- package/dist/sdkgen.js +4 -1
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/project/.sdk/model/feature/paging.aontu +7 -0
- package/project/.sdk/model/target/py-data.aontu +64 -0
- package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +89 -1
- package/project/.sdk/src/cmp/clojure/Main_clojure.ts +1 -0
- package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +97 -0
- package/project/.sdk/src/cmp/dart/fragment/Main.fragment.dart +78 -0
- package/project/.sdk/src/cmp/elixir/fragment/Main.fragment.ex +84 -0
- package/project/.sdk/src/cmp/go/fragment/Main.fragment.go +87 -0
- package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +75 -0
- package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +85 -0
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +4 -0
- package/project/.sdk/src/cmp/perl/fragment/Main.fragment.pm +80 -0
- package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +86 -0
- package/project/.sdk/src/cmp/py/Entity_py.ts +9 -2
- package/project/.sdk/src/cmp/py/MainEntity_py.ts +1 -1
- package/project/.sdk/src/cmp/py/Main_py.ts +34 -6
- package/project/.sdk/src/cmp/py/Package_py.ts +6 -9
- package/project/.sdk/src/cmp/py/TestDirect_py.ts +2 -2
- package/project/.sdk/src/cmp/py/TestEntity_py.ts +3 -3
- package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +2 -2
- package/project/.sdk/src/cmp/py/fragment/EntityCreateOp.fragment.py +2 -2
- package/project/.sdk/src/cmp/py/fragment/EntityLoadOp.fragment.py +2 -2
- package/project/.sdk/src/cmp/py/fragment/EntityRemoveOp.fragment.py +2 -2
- package/project/.sdk/src/cmp/py/fragment/EntityUpdateOp.fragment.py +2 -2
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +75 -8
- package/project/.sdk/src/cmp/py-data/Main_py-data.ts +987 -0
- package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +71 -0
- package/project/.sdk/src/cmp/rust/fragment/Main.fragment.rs +95 -0
- package/project/.sdk/src/cmp/swift/fragment/Main.fragment.swift +86 -0
- package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +75 -0
- package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +95 -0
- package/project/.sdk/tm/c/core/sdk.h +7 -0
- package/project/.sdk/tm/c/feature/paging.c +141 -2
- package/project/.sdk/tm/c/utility/graphql.c +178 -0
- package/project/.sdk/tm/c/utility/make_options.c +1 -1
- package/project/.sdk/tm/c/utility/make_response.c +6 -0
- package/project/.sdk/tm/c/utility/make_spec.c +23 -3
- package/project/.sdk/tm/clojure/src/sdk/client.clj +64 -1
- package/project/.sdk/tm/clojure/src/sdk/core.clj +126 -3
- package/project/.sdk/tm/clojure/src/sdk/features.clj +80 -14
- package/project/.sdk/tm/cpp/core/types.hpp +83 -0
- package/project/.sdk/tm/cpp/feature/paging.hpp +103 -1
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +152 -3
- package/project/.sdk/tm/csharp/core/Utility.cs +4 -0
- package/project/.sdk/tm/csharp/feature/PagingFeature.cs +118 -1
- package/project/.sdk/tm/csharp/utility/Graphql.cs +190 -0
- package/project/.sdk/tm/csharp/utility/MakeOptions.cs +1 -1
- package/project/.sdk/tm/csharp/utility/MakeResponse.cs +7 -0
- package/project/.sdk/tm/csharp/utility/MakeSpec.cs +21 -2
- package/project/.sdk/tm/csharp/utility/Register.cs +2 -0
- package/project/.sdk/tm/dart/lib/Point.dart +7 -0
- package/project/.sdk/tm/dart/lib/feature/paging/PagingFeature.dart +99 -4
- package/project/.sdk/tm/dart/lib/utility/GraphqlUtility.dart +162 -0
- package/project/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +1 -1
- package/project/.sdk/tm/dart/lib/utility/MakeResponseUtility.dart +5 -0
- package/project/.sdk/tm/dart/lib/utility/MakeSpecUtility.dart +18 -2
- package/project/.sdk/tm/dart/lib/utility/PrepareMethodUtility.dart +6 -1
- package/project/.sdk/tm/dart/lib/utility/Utility.dart +9 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/paging.ex +136 -13
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +187 -3
- package/project/.sdk/tm/go/core/utility_type.go +2 -0
- package/project/.sdk/tm/go/feature/paging_feature.go +87 -1
- package/project/.sdk/tm/go/utility/graphql.go +168 -0
- package/project/.sdk/tm/go/utility/make_options.go +1 -1
- package/project/.sdk/tm/go/utility/make_response.go +6 -0
- package/project/.sdk/tm/go/utility/make_spec.go +19 -2
- package/project/.sdk/tm/go/utility/register.go +2 -0
- package/project/.sdk/tm/haskell/src/SdkFeatures.hs +146 -7
- package/project/.sdk/tm/haskell/src/SdkRuntime.hs +153 -3
- package/project/.sdk/tm/java/core/SdkClient.java +93 -0
- package/project/.sdk/tm/java/core/Utility.java +4 -0
- package/project/.sdk/tm/java/feature/PagingFeature.java +100 -1
- package/project/.sdk/tm/java/utility/Graphql.java +191 -0
- package/project/.sdk/tm/java/utility/MakeOptions.java +1 -1
- package/project/.sdk/tm/java/utility/MakeResponse.java +6 -0
- package/project/.sdk/tm/java/utility/MakeSpec.java +17 -2
- package/project/.sdk/tm/java/utility/Register.java +2 -0
- package/project/.sdk/tm/js/src/Point.js +5 -0
- package/project/.sdk/tm/js/src/feature/paging/PagingFeature.js +82 -3
- package/project/.sdk/tm/js/src/feature/test/TestFeature.js +14 -2
- package/project/.sdk/tm/js/src/utility/GraphqlUtility.js +148 -0
- package/project/.sdk/tm/js/src/utility/MakeOptionsUtility.js +1 -1
- package/project/.sdk/tm/js/src/utility/MakeResponseUtility.js +7 -0
- package/project/.sdk/tm/js/src/utility/MakeSpecUtility.js +19 -2
- package/project/.sdk/tm/js/src/utility/Utility.js +4 -0
- package/project/.sdk/tm/kotlin/core/SdkClient.kt +84 -0
- package/project/.sdk/tm/kotlin/core/Utility.kt +2 -0
- package/project/.sdk/tm/kotlin/feature/PagingFeature.kt +92 -1
- package/project/.sdk/tm/kotlin/utility/Graphql.kt +145 -0
- package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +1 -1
- package/project/.sdk/tm/kotlin/utility/MakeReqRes.kt +6 -0
- package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +17 -2
- package/project/.sdk/tm/kotlin/utility/Register.kt +2 -0
- package/project/.sdk/tm/lean/src/SdkUtility.lean +134 -1
- package/project/.sdk/tm/lua/feature/paging_feature.lua +97 -2
- package/project/.sdk/tm/lua/utility/graphql.lua +163 -0
- package/project/.sdk/tm/lua/utility/make_options.lua +1 -1
- package/project/.sdk/tm/lua/utility/make_response.lua +6 -0
- package/project/.sdk/tm/lua/utility/make_spec.lua +18 -2
- package/project/.sdk/tm/lua/utility/register.lua +3 -0
- package/project/.sdk/tm/ocaml/sdk_features.ml +164 -20
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +143 -4
- package/project/.sdk/tm/ocaml/sdk_types.ml +2 -0
- package/project/.sdk/tm/perl/feature/paging_feature.pm +91 -3
- package/project/.sdk/tm/perl/utility/graphql.pm +150 -0
- package/project/.sdk/tm/perl/utility/make_options.pm +1 -1
- package/project/.sdk/tm/perl/utility/make_response.pm +6 -0
- package/project/.sdk/tm/perl/utility/make_spec.pm +20 -2
- package/project/.sdk/tm/perl/utility/register.pm +1 -0
- package/project/.sdk/tm/php/core/UtilityType.php +2 -0
- package/project/.sdk/tm/php/feature/PagingFeature.php +106 -4
- package/project/.sdk/tm/php/utility/Graphql.php +176 -0
- package/project/.sdk/tm/php/utility/MakeOptions.php +1 -1
- package/project/.sdk/tm/php/utility/MakeResponse.php +7 -0
- package/project/.sdk/tm/php/utility/MakeSpec.php +20 -2
- package/project/.sdk/tm/php/utility/Register.php +3 -0
- package/project/.sdk/tm/py/pkg/core/__init__.py +0 -0
- package/project/.sdk/tm/py/{core → pkg/core}/context.py +8 -8
- package/project/.sdk/tm/py/{core → pkg/core}/operation.py +1 -1
- package/project/.sdk/tm/py/{core → pkg/core}/response.py +1 -1
- package/project/.sdk/tm/py/{core → pkg/core}/result.py +1 -1
- package/project/.sdk/tm/py/{core → pkg/core}/utility_type.py +2 -0
- package/project/.sdk/tm/py/pkg/entity/__init__.py +0 -0
- package/project/.sdk/tm/py/pkg/feature/__init__.py +0 -0
- package/project/.sdk/tm/py/{feature → pkg/feature}/audit_feature.py +1 -1
- package/project/.sdk/tm/py/{feature → pkg/feature}/cache_feature.py +1 -1
- package/project/.sdk/tm/py/{feature → pkg/feature}/clienttrack_feature.py +1 -1
- package/project/.sdk/tm/py/{feature → pkg/feature}/debug_feature.py +1 -1
- package/project/.sdk/tm/py/{feature → pkg/feature}/idempotency_feature.py +1 -1
- package/project/.sdk/tm/py/{feature → pkg/feature}/log_feature.py +1 -1
- package/project/.sdk/tm/py/{feature → pkg/feature}/metrics_feature.py +1 -1
- package/project/.sdk/tm/py/{feature → pkg/feature}/netsim_feature.py +1 -1
- package/project/.sdk/tm/py/{feature → pkg/feature}/paging_feature.py +87 -6
- package/project/.sdk/tm/py/{feature → pkg/feature}/proxy_feature.py +1 -1
- package/project/.sdk/tm/py/{feature → pkg/feature}/ratelimit_feature.py +1 -1
- package/project/.sdk/tm/py/{feature → pkg/feature}/rbac_feature.py +1 -1
- package/project/.sdk/tm/py/{feature → pkg/feature}/retry_feature.py +1 -1
- package/project/.sdk/tm/py/{feature → pkg/feature}/streaming_feature.py +1 -1
- package/project/.sdk/tm/py/{feature → pkg/feature}/telemetry_feature.py +1 -1
- package/project/.sdk/tm/py/{feature → pkg/feature}/test_feature.py +2 -2
- package/project/.sdk/tm/py/{feature → pkg/feature}/timeout_feature.py +1 -1
- package/project/.sdk/tm/py/pkg/utility/__init__.py +0 -0
- package/project/.sdk/tm/py/{utility → pkg/utility}/feature_init.py +1 -1
- package/project/.sdk/tm/py/{utility → pkg/utility}/fetcher.py +1 -1
- package/project/.sdk/tm/py/pkg/utility/graphql.py +145 -0
- package/project/.sdk/tm/py/{utility → pkg/utility}/make_context.py +1 -1
- package/project/.sdk/tm/py/{utility → pkg/utility}/make_error.py +5 -5
- package/project/.sdk/tm/py/{utility → pkg/utility}/make_fetch_def.py +2 -2
- package/project/.sdk/tm/py/{utility → pkg/utility}/make_options.py +2 -2
- package/project/.sdk/tm/py/{utility → pkg/utility}/make_point.py +2 -2
- package/project/.sdk/tm/py/{utility → pkg/utility}/make_request.py +2 -2
- package/project/.sdk/tm/py/{utility → pkg/utility}/make_response.py +6 -0
- package/project/.sdk/tm/py/{utility → pkg/utility}/make_spec.py +19 -4
- package/project/.sdk/tm/py/{utility → pkg/utility}/make_url.py +1 -1
- package/project/.sdk/tm/py/{utility → pkg/utility}/param.py +2 -2
- package/project/.sdk/tm/py/{utility → pkg/utility}/prepare_auth.py +1 -1
- package/project/.sdk/tm/py/{utility → pkg/utility}/prepare_headers.py +1 -1
- package/project/.sdk/tm/py/{utility → pkg/utility}/prepare_method.py +1 -1
- package/project/.sdk/tm/py/{utility → pkg/utility}/prepare_params.py +1 -1
- package/project/.sdk/tm/py/{utility → pkg/utility}/prepare_path.py +1 -1
- package/project/.sdk/tm/py/{utility → pkg/utility}/prepare_query.py +1 -1
- package/project/.sdk/tm/py/pkg/utility/register.py +71 -0
- package/project/.sdk/tm/py/{utility → pkg/utility}/transform_request.py +2 -2
- package/project/.sdk/tm/py/{utility → pkg/utility}/transform_response.py +2 -2
- package/project/.sdk/tm/py/test/feature_harness.py +6 -6
- package/project/.sdk/tm/py/test/runner.py +1 -1
- package/project/.sdk/tm/py/test/struct_runner.py +1 -1
- package/project/.sdk/tm/py/test/test_pipeline.py +5 -5
- package/project/.sdk/tm/py/test/test_primary_utility.py +8 -8
- package/project/.sdk/tm/py/test/test_struct_utility.py +3 -3
- package/project/.sdk/tm/py-data/LICENSE +22 -0
- package/project/.sdk/tm/py-data/Makefile +57 -0
- package/project/.sdk/tm/py-data/pkg/auth.py +131 -0
- package/project/.sdk/tm/py-data/pkg/fetch.py +178 -0
- package/project/.sdk/tm/py-data/pkg/frames.py +236 -0
- package/project/.sdk/tm/py-data/src/feature/README.md +8 -0
- package/project/.sdk/tm/py-data/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/py-data/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/py-data/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/py-data/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/py-data/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/py-data/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/py-data/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/py-data/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/py-data/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/py-data/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/py-data/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/py-data/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/py-data/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/py-data/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/py-data/test/__init__.py +0 -0
- package/project/.sdk/tm/py-data/test/test_auth.py +95 -0
- package/project/.sdk/tm/py-data/test/test_fetch.py +152 -0
- package/project/.sdk/tm/py-data/test/test_frames.py +250 -0
- package/project/.sdk/tm/rb/core/utility_type.rb +1 -0
- package/project/.sdk/tm/rb/feature/paging_feature.rb +89 -3
- package/project/.sdk/tm/rb/utility/graphql.rb +131 -0
- package/project/.sdk/tm/rb/utility/make_options.rb +1 -1
- package/project/.sdk/tm/rb/utility/make_response.rb +6 -0
- package/project/.sdk/tm/rb/utility/make_spec.rb +18 -2
- package/project/.sdk/tm/rb/utility/register.rb +3 -0
- package/project/.sdk/tm/rust/feature/paging.rs +124 -2
- package/project/.sdk/tm/rust/utility/graphql.rs +193 -0
- package/project/.sdk/tm/rust/utility/make_options.rs +1 -1
- package/project/.sdk/tm/rust/utility/make_response.rs +6 -0
- package/project/.sdk/tm/rust/utility/make_spec.rs +32 -4
- package/project/.sdk/tm/rust/utility/mod.rs +1 -0
- package/project/.sdk/tm/scala/core/SdkClient.scala +90 -0
- package/project/.sdk/tm/scala/core/Utility.scala +4 -0
- package/project/.sdk/tm/scala/feature/PagingFeature.scala +104 -3
- package/project/.sdk/tm/scala/utility/Graphql.scala +160 -0
- package/project/.sdk/tm/scala/utility/Make.scala +7 -1
- package/project/.sdk/tm/scala/utility/MakeSpec.scala +22 -2
- package/project/.sdk/tm/scala/utility/Register.scala +2 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Utility.swift +4 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/PagingFeature.swift +86 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Graphql.swift +142 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Make.swift +24 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +1 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Register.swift +2 -0
- package/project/.sdk/tm/ts/src/Point.ts +7 -0
- package/project/.sdk/tm/ts/src/feature/paging/PagingFeature.ts +82 -3
- package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +14 -2
- package/project/.sdk/tm/ts/src/utility/GraphqlUtility.ts +152 -0
- package/project/.sdk/tm/ts/src/utility/MakeOptionsUtility.ts +1 -1
- package/project/.sdk/tm/ts/src/utility/MakeResponseUtility.ts +7 -0
- package/project/.sdk/tm/ts/src/utility/MakeSpecUtility.ts +19 -2
- package/project/.sdk/tm/ts/src/utility/Utility.ts +4 -0
- package/project/.sdk/tm/zig/core/utility.zig +198 -3
- package/project/.sdk/tm/zig/feature/paging.zig +128 -1
- package/src/cmp/AgentGuideContent.ts +5 -0
- package/src/cmp/Feature.ts +13 -0
- package/src/helpers/canonType.ts +46 -0
- package/src/helpers/packageMeta.ts +7 -0
- package/src/sdkgen.ts +6 -1
- package/project/.sdk/tm/py/utility/register.py +0 -68
- /package/project/.sdk/tm/py/{core → pkg/core}/control.py +0 -0
- /package/project/.sdk/tm/py/{core → pkg/core}/error.py +0 -0
- /package/project/.sdk/tm/py/{core → pkg/core}/helpers.py +0 -0
- /package/project/.sdk/tm/py/{core → pkg/core}/spec.py +0 -0
- /package/project/.sdk/tm/py/{feature → pkg/feature}/base_feature.py +0 -0
- /package/project/.sdk/tm/py/{utility → pkg/utility}/clean.py +0 -0
- /package/project/.sdk/tm/py/{utility → pkg/utility}/done.py +0 -0
- /package/project/.sdk/tm/py/{utility → pkg/utility}/feature_add.py +0 -0
- /package/project/.sdk/tm/py/{utility → pkg/utility}/feature_hook.py +0 -0
- /package/project/.sdk/tm/py/{utility → pkg/utility}/make_result.py +0 -0
- /package/project/.sdk/tm/py/{utility → pkg/utility}/prepare_body.py +0 -0
- /package/project/.sdk/tm/py/{utility → pkg/utility}/result_basic.py +0 -0
- /package/project/.sdk/tm/py/{utility → pkg/utility}/result_body.py +0 -0
- /package/project/.sdk/tm/py/{utility → pkg/utility}/result_headers.py +0 -0
- /package/project/.sdk/tm/py/{utility → pkg/utility}/voxgig_struct/__init__.py +0 -0
- /package/project/.sdk/tm/py/{utility → pkg/utility}/voxgig_struct/voxgig_struct.py +0 -0
- /package/project/.sdk/tm/{py/core/__init__.py → py-data/src/feature/audit/.gitkeep} +0 -0
- /package/project/.sdk/tm/{py/entity/__init__.py → py-data/src/feature/base/.gitkeep} +0 -0
- /package/project/.sdk/tm/{py/feature/__init__.py → py-data/src/feature/cache/.gitkeep} +0 -0
- /package/project/.sdk/tm/{py/utility/__init__.py → py-data/src/feature/clienttrack/.gitkeep} +0 -0
|
@@ -97,6 +97,19 @@ pub const PagingFeature = struct {
|
|
|
97
97
|
// A per-call cursor/page from ctrl takes priority (auto-iteration).
|
|
98
98
|
const paging = ctx.ctrl.paging;
|
|
99
99
|
|
|
100
|
+
// GraphQL paginates through operation VARIABLES, not the query
|
|
101
|
+
// string. This hook runs after make_spec, so spec.body already holds
|
|
102
|
+
// the { query, variables } envelope, and before make_fetch_def
|
|
103
|
+
// serialises it.
|
|
104
|
+
const kind: []const u8 = switch (h.getp(ctx.point, "kind")) {
|
|
105
|
+
.string => |k| k,
|
|
106
|
+
else => "",
|
|
107
|
+
};
|
|
108
|
+
if (std.mem.eql(u8, kind, "graphql")) {
|
|
109
|
+
self.graphql_pre_request(ctx, paging);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
100
113
|
const cursor = h.getp(paging, "cursor");
|
|
101
114
|
if (!h.is_noval(cursor)) {
|
|
102
115
|
h.setp(query, cursor_param, cursor);
|
|
@@ -114,6 +127,80 @@ pub const PagingFeature = struct {
|
|
|
114
127
|
}
|
|
115
128
|
}
|
|
116
129
|
|
|
130
|
+
// Relay pagination: the cursor is the `after` variable (or whatever the
|
|
131
|
+
// model named it), and the page size is `first`.
|
|
132
|
+
fn graphql_pre_request(self: *PagingFeature, ctx: *Context, paging: Value) void {
|
|
133
|
+
const sp = ctx.spec orelse return;
|
|
134
|
+
if (sp.body != .object) return;
|
|
135
|
+
|
|
136
|
+
const variables: Value = if (h.getp(sp.body, "variables") == .object)
|
|
137
|
+
h.getp(sp.body, "variables")
|
|
138
|
+
else blk: {
|
|
139
|
+
const nv = h.omap();
|
|
140
|
+
h.setp(sp.body, "variables", nv);
|
|
141
|
+
break :blk nv;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const after_var = sup.fopt_str(self.options, "afterVar", "after");
|
|
145
|
+
const first_var = sup.fopt_str(self.options, "firstVar", "first");
|
|
146
|
+
|
|
147
|
+
// Only bind variables the operation actually declares, or the server
|
|
148
|
+
// rejects the document.
|
|
149
|
+
var after_declared = false;
|
|
150
|
+
var first_declared = false;
|
|
151
|
+
const varlist = h.getpath(&.{ "graphql", "vars" }, ctx.point);
|
|
152
|
+
if (varlist == .array) {
|
|
153
|
+
for (varlist.array.data.items) |v| {
|
|
154
|
+
const name: []const u8 = switch (h.getp(v, "name")) {
|
|
155
|
+
.string => |n| n,
|
|
156
|
+
else => continue,
|
|
157
|
+
};
|
|
158
|
+
if (std.mem.eql(u8, name, after_var)) after_declared = true;
|
|
159
|
+
if (std.mem.eql(u8, name, first_var)) first_declared = true;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const cursor = h.getp(paging, "cursor");
|
|
164
|
+
if (after_declared and !h.is_noval(cursor) and !h.is_null(cursor)) {
|
|
165
|
+
h.setp(variables, after_var, cursor);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// `limit: null` reads as unset, matching the reference's `null !=
|
|
169
|
+
// limit`: fopt_int would otherwise coerce it to 0 and bind `first: 0`,
|
|
170
|
+
// which relay servers reject or answer with an empty page.
|
|
171
|
+
const limit = h.getp(self.options, "limit");
|
|
172
|
+
if (first_declared and !h.is_noval(limit) and !h.is_null(limit) and
|
|
173
|
+
h.is_noval(h.getp(variables, first_var)))
|
|
174
|
+
{
|
|
175
|
+
h.setp(variables, first_var, h.vnum(sup.fopt_int(self.options, "limit", 0)));
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// The model records connection/cursor/more as dot paths; core getpath
|
|
180
|
+
// takes pre-split segments.
|
|
181
|
+
fn getpath_dotted(path: []const u8, store: Value) Value {
|
|
182
|
+
// Segment count is bounded by dots + 1, so one pass sizes the slice
|
|
183
|
+
// exactly. A fixed array would silently stop splitting and look up a
|
|
184
|
+
// truncated path, which reads as "no cursor" — indistinguishable from
|
|
185
|
+
// a genuine end of pagination. splitScalar yields slices into `path`,
|
|
186
|
+
// so unlike the C port there is nothing to copy.
|
|
187
|
+
var nseg: usize = 1;
|
|
188
|
+
for (path) |c| {
|
|
189
|
+
if (c == '.') nseg += 1;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const segs = h.A().alloc([]const u8, nseg) catch return h.vnull();
|
|
193
|
+
|
|
194
|
+
var n: usize = 0;
|
|
195
|
+
var it = std.mem.splitScalar(u8, path, '.');
|
|
196
|
+
while (it.next()) |seg| {
|
|
197
|
+
segs[n] = seg;
|
|
198
|
+
n += 1;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return h.getpath(segs[0..n], store);
|
|
202
|
+
}
|
|
203
|
+
|
|
117
204
|
fn pre_result(self: *PagingFeature, ctx: *Context) void {
|
|
118
205
|
if (!self.active or !self.is_list(ctx)) return;
|
|
119
206
|
const result = ctx.result orelse return;
|
|
@@ -136,6 +223,40 @@ pub const PagingFeature = struct {
|
|
|
136
223
|
}
|
|
137
224
|
}
|
|
138
225
|
|
|
226
|
+
// Set when the response states hasMore outright, rather than leaving
|
|
227
|
+
// it to be inferred from the presence of a cursor.
|
|
228
|
+
var explicit_more = false;
|
|
229
|
+
|
|
230
|
+
// Relay connections carry the cursor in pageInfo, at the path the
|
|
231
|
+
// model recorded for this op.
|
|
232
|
+
const page = h.getpath(&.{ "graphql", "page" }, ctx.point);
|
|
233
|
+
if (page == .object and body == .object) {
|
|
234
|
+
// `connpath` locates the connection object inside the response
|
|
235
|
+
// envelope (data.<field>); the cursor/more paths are relative
|
|
236
|
+
// to it.
|
|
237
|
+
var conn = body;
|
|
238
|
+
const connpath = h.get_str(page, "connpath") orelse "";
|
|
239
|
+
if (connpath.len != 0) {
|
|
240
|
+
const sub = getpath_dotted(connpath, body);
|
|
241
|
+
if (!h.is_noval(sub) and !h.is_null(sub)) conn = sub;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const cursorpath = h.get_str(page, "cursor") orelse "";
|
|
245
|
+
if (cursorpath.len != 0) {
|
|
246
|
+
const c = getpath_dotted(cursorpath, conn);
|
|
247
|
+
if (!h.is_noval(c) and !h.is_null(c)) h.setp(paging, "cursor", c);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const morepath = h.get_str(page, "more") orelse "";
|
|
251
|
+
if (morepath.len != 0) {
|
|
252
|
+
const mv = getpath_dotted(morepath, conn);
|
|
253
|
+
if (mv == .bool) {
|
|
254
|
+
h.setp(paging, "hasMore", h.vbool(mv.bool));
|
|
255
|
+
explicit_more = true;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
139
260
|
// Body-level cursors.
|
|
140
261
|
if (body == .object) {
|
|
141
262
|
const next = h.getp(body, "next");
|
|
@@ -152,10 +273,16 @@ pub const PagingFeature = struct {
|
|
|
152
273
|
}
|
|
153
274
|
if (h.get_bool(body, "hasMore")) |has_more| {
|
|
154
275
|
h.setp(paging, "hasMore", h.vbool(has_more));
|
|
276
|
+
explicit_more = true;
|
|
155
277
|
}
|
|
156
278
|
}
|
|
157
279
|
|
|
158
|
-
|
|
280
|
+
// Cursor presence only INFERS another page. When the server stated
|
|
281
|
+
// the answer outright — relay's `hasNextPage: false`, or a body
|
|
282
|
+
// `hasMore` — that wins: a final page normally carries both an end
|
|
283
|
+
// cursor and hasNextPage false, and inferring from the cursor there
|
|
284
|
+
// would send the caller back for a page that does not exist, forever.
|
|
285
|
+
if (!explicit_more and (h.get_bool(paging, "hasMore") orelse false) != true and
|
|
159
286
|
(!h.is_noval(h.getp(paging, "next")) or
|
|
160
287
|
!h.is_noval(h.getp(paging, "cursor")) or
|
|
161
288
|
!h.is_noval(h.getp(paging, "nextPage"))))
|
|
@@ -33,6 +33,11 @@ const LANG_CMD: Record<string, LangCmd> = {
|
|
|
33
33
|
lua: { install: 'luarocks make', viaMake: true },
|
|
34
34
|
'go-cli': { build: 'go build ./...', note: 'A CLI surface, not an SDK client library.' },
|
|
35
35
|
'go-mcp': { build: 'go build ./...', note: 'An MCP server surface for AI agents, not an SDK client library.' },
|
|
36
|
+
'py-data': {
|
|
37
|
+
install: 'make dev',
|
|
38
|
+
viaMake: true,
|
|
39
|
+
note: 'A pandas/notebook surface layered on the sibling Python SDK, not an SDK client library.',
|
|
40
|
+
},
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
|
package/src/cmp/Feature.ts
CHANGED
|
@@ -11,6 +11,19 @@ const Feature = cmp(function Feature(props: any) {
|
|
|
11
11
|
Copy({
|
|
12
12
|
from: 'tm/' + target.name + '/src/feature/' + feature.name,
|
|
13
13
|
replace: {
|
|
14
|
+
// Feature templates reference the SDK class by placeholder — e.g.
|
|
15
|
+
// tm/ts/.../TestFeature.ts imports `ProjectNameSDK`. Without the
|
|
16
|
+
// standard replacements those placeholders reach the generated
|
|
17
|
+
// source verbatim and the target fails to COMPILE.
|
|
18
|
+
//
|
|
19
|
+
// This worked by accident everywhere it worked: Main_<lang> copies
|
|
20
|
+
// the whole tm/<lang> tree (feature dirs included) with stdrep
|
|
21
|
+
// afterwards, so the substituted version overwrote this one. Any
|
|
22
|
+
// target whose Main excludes src/ — or any consumer .sdk whose
|
|
23
|
+
// local Main_<lang> lost that Copy — got the raw placeholder.
|
|
24
|
+
// voxgig-solardemo-sdk hit exactly that and could not build its
|
|
25
|
+
// TypeScript at all.
|
|
26
|
+
...ctx$.stdrep,
|
|
14
27
|
FEATURE_VERSION: feature.version,
|
|
15
28
|
FEATURE_Name: feature.Name,
|
|
16
29
|
}
|
package/src/helpers/canonType.ts
CHANGED
|
@@ -128,6 +128,50 @@ const CANON_UNION_JOIN: Partial<Record<CanonLang, string>> = {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
|
|
131
|
+
// Canonical sentinel -> pandas dtype, for the `py-data` target's generated
|
|
132
|
+
// DataFrame accessors. Deliberately NOT a CanonLang column: py-data is a
|
|
133
|
+
// consumer target layered on `py`, not a language, and these are storage
|
|
134
|
+
// dtypes rather than type-annotation names.
|
|
135
|
+
//
|
|
136
|
+
// NULLABLE dtypes throughout ('Int64' not 'int64', 'boolean' not 'bool').
|
|
137
|
+
// The model carries no nullability beyond the `req` flag, and API payloads
|
|
138
|
+
// omit optional fields freely, so a column that looks integral in one page
|
|
139
|
+
// can arrive with nulls in the next. NumPy's int64/bool cannot hold NA and
|
|
140
|
+
// would silently upcast to float64/object mid-fetch, changing a column's
|
|
141
|
+
// dtype based on which rows came back — the pandas nullable extension types
|
|
142
|
+
// keep it stable.
|
|
143
|
+
//
|
|
144
|
+
// There is no $DATE / $DATETIME sentinel in apidef's vocabulary (the model
|
|
145
|
+
// carries no string formats), so date handling is NOT inferred here. It is
|
|
146
|
+
// an explicit runtime opt-in via the accessor's `parse_dates=` kwarg. Do not
|
|
147
|
+
// add a DATE row unless apidef starts emitting the sentinel.
|
|
148
|
+
const PANDAS_DTYPE: Record<string, string> = {
|
|
149
|
+
STRING: 'string',
|
|
150
|
+
INTEGER: 'Int64',
|
|
151
|
+
NUMBER: 'Float64',
|
|
152
|
+
BOOLEAN: 'boolean',
|
|
153
|
+
// A null-typed column has no values to hold; object is the honest floor.
|
|
154
|
+
NULL: 'object',
|
|
155
|
+
// Arrays and objects stay boxed Python values in an object column. Frames
|
|
156
|
+
// flatten one level of OBJECT into dotted columns before dtypes are
|
|
157
|
+
// applied (see frames.py), so an OBJECT column reaching here is one that
|
|
158
|
+
// survived flattening — genuinely nested, genuinely object.
|
|
159
|
+
ARRAY: 'object',
|
|
160
|
+
OBJECT: 'object',
|
|
161
|
+
ANY: 'object',
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Map a field type sentinel to a pandas dtype string. Unknown / missing /
|
|
165
|
+
// union ($ONE) sentinels fall back to 'object' — a union column can hold
|
|
166
|
+
// members of different dtypes, so object is the only correct storage.
|
|
167
|
+
function canonToDtype(sentinel: unknown): string {
|
|
168
|
+
if (Array.isArray(sentinel)) {
|
|
169
|
+
return 'object'
|
|
170
|
+
}
|
|
171
|
+
return PANDAS_DTYPE[canonKey(sentinel)] ?? 'object'
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
|
|
131
175
|
// Normalize a raw sentinel value to its bare upper-case key:
|
|
132
176
|
// '`$STRING`' / '$STRING' / 'string' -> 'STRING'.
|
|
133
177
|
function canonKey(sentinel: unknown): string {
|
|
@@ -174,10 +218,12 @@ function canonToType(sentinel: unknown, lang: string): string {
|
|
|
174
218
|
|
|
175
219
|
export {
|
|
176
220
|
canonToType,
|
|
221
|
+
canonToDtype,
|
|
177
222
|
canonKey,
|
|
178
223
|
CANON_TYPE,
|
|
179
224
|
CANON_ANY,
|
|
180
225
|
CANON_UNION_JOIN,
|
|
226
|
+
PANDAS_DTYPE,
|
|
181
227
|
}
|
|
182
228
|
|
|
183
229
|
export type {
|
|
@@ -31,6 +31,7 @@ const LANG_LABEL: Record<string, string> = {
|
|
|
31
31
|
go: 'Go',
|
|
32
32
|
'go-cli': 'Go CLI',
|
|
33
33
|
'go-mcp': 'Go MCP server',
|
|
34
|
+
'py-data': 'Python Data',
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
function langLabel(target: string): string {
|
|
@@ -151,6 +152,10 @@ function packageName(model: any, eco: string): string {
|
|
|
151
152
|
return `github.com/${origin}/${slug}-sdk/go-cli`
|
|
152
153
|
case 'go-mcp':
|
|
153
154
|
return `github.com/${origin}/${slug}-sdk/go-mcp`
|
|
155
|
+
// The notebook/analyst package layered on `py`. Distinct PyPI name so it
|
|
156
|
+
// can version and publish independently of the SDK it wraps.
|
|
157
|
+
case 'py-data':
|
|
158
|
+
return `${origin}-${base}-data`
|
|
154
159
|
default:
|
|
155
160
|
return `${origin}-${base}`
|
|
156
161
|
}
|
|
@@ -172,6 +177,8 @@ function installCommand(model: any, target: string): string {
|
|
|
172
177
|
return `npm install ${packageName(model, 'js')}`
|
|
173
178
|
case 'py':
|
|
174
179
|
return `pip install ${packageName(model, 'pypi')}`
|
|
180
|
+
case 'py-data':
|
|
181
|
+
return `pip install ${packageName(model, 'py-data')}`
|
|
175
182
|
case 'php':
|
|
176
183
|
return `composer require ${packageName(model, 'composer')}`
|
|
177
184
|
case 'rb':
|
package/src/sdkgen.ts
CHANGED
|
@@ -50,7 +50,7 @@ import { buildIdNames } from './helpers/buildIdNames'
|
|
|
50
50
|
import { getMatchEntries } from './helpers/getMatchEntries'
|
|
51
51
|
import { collectDeps } from './helpers/collectDeps'
|
|
52
52
|
import type { DepEntry } from './helpers/collectDeps'
|
|
53
|
-
import { canonToType, canonKey } from './helpers/canonType'
|
|
53
|
+
import { canonToType, canonToDtype, canonKey } from './helpers/canonType'
|
|
54
54
|
import { OP_SUFFIX, opTypeName, opParams, opRequestShape, entityIdField, entityDataIdField, entityOps, entityPrimaryOp, pickExampleEntity, entityClassName, entityTypeCollisions, warnEntityTypeCollisions, deriveEntityNames, entityCollection } from './helpers/opShape'
|
|
55
55
|
import { isReservedName, safeVarName, exampleVarName, isRbCoreConstant, rbSafeTypeName, isSwiftSdkType, swiftSafeTypeName, jsProp, jsOptProp, jsKey } from './helpers/naming'
|
|
56
56
|
import { serverVariables, hasServerVariables } from './helpers/serverVars'
|
|
@@ -456,10 +456,15 @@ export {
|
|
|
456
456
|
isAuthActive,
|
|
457
457
|
resolveAuthPrefix,
|
|
458
458
|
|
|
459
|
+
// Scaffold components need this to fail a generation with an actionable
|
|
460
|
+
// message rather than a bare Error (py-data guards on its sibling `py`).
|
|
461
|
+
SdkGenError,
|
|
462
|
+
|
|
459
463
|
buildIdNames,
|
|
460
464
|
getMatchEntries,
|
|
461
465
|
collectDeps,
|
|
462
466
|
canonToType,
|
|
467
|
+
canonToDtype,
|
|
463
468
|
canonKey,
|
|
464
469
|
|
|
465
470
|
OP_SUFFIX,
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# ProjectName SDK utility registration
|
|
2
|
-
|
|
3
|
-
from core.utility_type import ProjectNameUtility
|
|
4
|
-
|
|
5
|
-
from utility.clean import clean_util
|
|
6
|
-
from utility.done import done_util
|
|
7
|
-
from utility.make_error import make_error_util
|
|
8
|
-
from utility.feature_add import feature_add_util
|
|
9
|
-
from utility.feature_hook import feature_hook_util
|
|
10
|
-
from utility.feature_init import feature_init_util
|
|
11
|
-
from utility.fetcher import fetcher_util
|
|
12
|
-
from utility.make_fetch_def import make_fetch_def_util
|
|
13
|
-
from utility.make_context import make_context_util
|
|
14
|
-
from utility.make_options import make_options_util
|
|
15
|
-
from utility.make_request import make_request_util
|
|
16
|
-
from utility.make_response import make_response_util
|
|
17
|
-
from utility.make_result import make_result_util
|
|
18
|
-
from utility.make_point import make_point_util
|
|
19
|
-
from utility.make_spec import make_spec_util
|
|
20
|
-
from utility.make_url import make_url_util
|
|
21
|
-
from utility.param import param_util
|
|
22
|
-
from utility.prepare_auth import prepare_auth_util
|
|
23
|
-
from utility.prepare_body import prepare_body_util
|
|
24
|
-
from utility.prepare_headers import prepare_headers_util
|
|
25
|
-
from utility.prepare_method import prepare_method_util
|
|
26
|
-
from utility.prepare_params import prepare_params_util
|
|
27
|
-
from utility.prepare_path import prepare_path_util
|
|
28
|
-
from utility.prepare_query import prepare_query_util
|
|
29
|
-
from utility.result_basic import result_basic_util
|
|
30
|
-
from utility.result_body import result_body_util
|
|
31
|
-
from utility.result_headers import result_headers_util
|
|
32
|
-
from utility.transform_request import transform_request_util
|
|
33
|
-
from utility.transform_response import transform_response_util
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def register_all(u):
|
|
37
|
-
u.clean = clean_util
|
|
38
|
-
u.done = done_util
|
|
39
|
-
u.make_error = make_error_util
|
|
40
|
-
u.feature_add = feature_add_util
|
|
41
|
-
u.feature_hook = feature_hook_util
|
|
42
|
-
u.feature_init = feature_init_util
|
|
43
|
-
u.fetcher = fetcher_util
|
|
44
|
-
u.make_fetch_def = make_fetch_def_util
|
|
45
|
-
u.make_context = make_context_util
|
|
46
|
-
u.make_options = make_options_util
|
|
47
|
-
u.make_request = make_request_util
|
|
48
|
-
u.make_response = make_response_util
|
|
49
|
-
u.make_result = make_result_util
|
|
50
|
-
u.make_point = make_point_util
|
|
51
|
-
u.make_spec = make_spec_util
|
|
52
|
-
u.make_url = make_url_util
|
|
53
|
-
u.param = param_util
|
|
54
|
-
u.prepare_auth = prepare_auth_util
|
|
55
|
-
u.prepare_body = prepare_body_util
|
|
56
|
-
u.prepare_headers = prepare_headers_util
|
|
57
|
-
u.prepare_method = prepare_method_util
|
|
58
|
-
u.prepare_params = prepare_params_util
|
|
59
|
-
u.prepare_path = prepare_path_util
|
|
60
|
-
u.prepare_query = prepare_query_util
|
|
61
|
-
u.result_basic = result_basic_util
|
|
62
|
-
u.result_body = result_body_util
|
|
63
|
-
u.result_headers = result_headers_util
|
|
64
|
-
u.transform_request = transform_request_util
|
|
65
|
-
u.transform_response = transform_response_util
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
ProjectNameUtility._registrar = register_all
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/project/.sdk/tm/{py/utility/__init__.py → py-data/src/feature/clienttrack/.gitkeep}
RENAMED
|
File without changes
|