poe-code 4.0.27 → 4.0.28-beta.1
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/package.json
CHANGED
|
@@ -33,6 +33,17 @@ const ignoredRoot = defineGroup({
|
|
|
33
33
|
apiKey: params.APIKey,
|
|
34
34
|
}),
|
|
35
35
|
}),
|
|
36
|
+
defineCommand({
|
|
37
|
+
name: "json-payload",
|
|
38
|
+
scope: ["sdk"],
|
|
39
|
+
params: S.Object({
|
|
40
|
+
payload_json: S.Json(),
|
|
41
|
+
items_by_id: S.Record(S.Object({
|
|
42
|
+
display_name: S.String(),
|
|
43
|
+
})),
|
|
44
|
+
}),
|
|
45
|
+
handler: async ({ params }) => params,
|
|
46
|
+
}),
|
|
36
47
|
defineCommand({
|
|
37
48
|
name: "cli-only",
|
|
38
49
|
scope: ["cli"],
|
|
@@ -116,6 +127,22 @@ const ignoredHttpServerResult = ignoredSdk.poeCode.generate.httpServer({
|
|
|
116
127
|
void ignoredHttpServerResult.then((value) => {
|
|
117
128
|
void value.apiKey;
|
|
118
129
|
});
|
|
130
|
+
void ignoredSdk.poeCode.generate.jsonPayload({
|
|
131
|
+
payloadJson: {
|
|
132
|
+
file_upload: "upload-1",
|
|
133
|
+
nested_value: { preserve_this_key: true },
|
|
134
|
+
},
|
|
135
|
+
itemsById: {
|
|
136
|
+
"item-1": { displayName: "One" },
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
ignoredSdk.poeCode.generate.jsonPayload({
|
|
140
|
+
payloadJson: null,
|
|
141
|
+
itemsById: {
|
|
142
|
+
// @ts-expect-error declared fields inside arbitrary-key records are still camel-cased
|
|
143
|
+
"item-1": { display_name: "One" },
|
|
144
|
+
},
|
|
145
|
+
});
|
|
119
146
|
const ignoredQueuedResult = ignoredSdk.poeCode.generate.queued({
|
|
120
147
|
promptText: "hello",
|
|
121
148
|
});
|
|
@@ -30,7 +30,9 @@ type CapitalizeJoinCamelWords<TWords extends readonly string[]> = TWords extends
|
|
|
30
30
|
...infer TTail extends readonly string[]
|
|
31
31
|
] ? `${Capitalize<THead>}${CapitalizeJoinCamelWords<TTail>}` : "";
|
|
32
32
|
type CamelCase<TValue extends string> = JoinCamelWords<SplitCamelWords<TValue>>;
|
|
33
|
-
type Camelize<TValue> = TValue extends Primitive ? TValue : TValue extends readonly (infer TItem)[] ? Array<Camelize<TItem>> : TValue extends object ? {
|
|
33
|
+
type Camelize<TValue> = TValue extends Primitive ? TValue : TValue extends readonly (infer TItem)[] ? Array<Camelize<TItem>> : TValue extends object ? string extends keyof TValue ? {
|
|
34
|
+
[TKey in keyof TValue]: Camelize<TValue[TKey]>;
|
|
35
|
+
} : {
|
|
34
36
|
[TKey in keyof TValue as TKey extends string ? CamelCase<TKey> : TKey]: Camelize<TValue[TKey]>;
|
|
35
37
|
} : TValue;
|
|
36
38
|
type SDKResult<TResult, THumanInLoopMode extends HumanInLoopMode | undefined> = [THumanInLoopMode] extends ["async"] ? ["async"] extends [THumanInLoopMode] ? HumanInLoopPending : TResult : TResult;
|