Skip to content

Commit 897e590

Browse files
committed
docs: add todo comments
1 parent 1d94c48 commit 897e590

50 files changed

Lines changed: 134 additions & 47 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.changeset/busy-cities-retire.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/shared": minor
3+
---
4+
5+
**plugin**: remove `.querySymbols()` method

‎packages/openapi-python/src/plugins/@hey-api/sdk/shared/operation.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ function schemaToPythonType(
2929
plugin: HeyApiSdkPlugin['Instance'],
3030
): ReturnType<typeof $.expr | typeof $.subscript> | Symbol {
3131
if (schema.$ref) {
32+
// TODO: contract (?)
3233
return plugin.referenceSymbol({
3334
category: 'schema',
3435
resourceId: schema.$ref,

‎packages/openapi-python/src/plugins/@hey-api/sdk/v1/node.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ function childToNode(
6262
resource: StructureNode,
6363
plugin: HeyApiSdkPlugin['Instance'],
6464
): ReadonlyArray<ReturnType<typeof $.method>> {
65+
// TODO: contract (self)
6566
const refChild = plugin.referenceSymbol(createShellMeta(resource));
6667
const memberNameStr = toCase(
6768
refChild.name,

‎packages/openapi-python/src/plugins/pydantic/v2/toAst/enum.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function baseNode(ctx: EnumResolverContext): PydanticType {
7777
type: $$.constrainedType($(literal).slice(...values)),
7878
};
7979
}
80-
80+
// TODO: contract (self)
8181
const refSymbol = plugin.referenceSymbol({
8282
artifact: 'pydantic',
8383
category: 'schema',

‎packages/openapi-python/src/plugins/pydantic/v2/visitor.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,9 @@ export function createVisitor(
157157
resource: 'definition',
158158
resourceId: $ref,
159159
};
160-
160+
// TODO: contract (self)
161161
const refSymbol = plugin.referenceSymbol(query);
162+
// TODO: contract (self)
162163
const isRegistered = plugin.isSymbolRegistered(query);
163164
const type = $.constrainedType(refSymbol);
164165

‎packages/openapi-ts/src/plugins/@angular/common/shared/node.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ function childToHttpRequestNode(
100100
resource: StructureNode,
101101
plugin: AngularCommonPlugin['Instance'],
102102
): ReadonlyArray<ReturnType<typeof $.field | typeof $.getter>> {
103+
// TODO: contract (self)
103104
const refChild = plugin.referenceSymbol(createHttpRequestShellMeta(resource));
104105
const memberNameStr = toCase(refChild.name, 'camelCase');
105106
const memberName = plugin.symbol(memberNameStr);
@@ -118,6 +119,7 @@ function childToHttpResourceNode(
118119
resource: StructureNode,
119120
plugin: AngularCommonPlugin['Instance'],
120121
): ReadonlyArray<ReturnType<typeof $.field | typeof $.getter>> {
122+
// TODO: contract (self)
121123
const refChild = plugin.referenceSymbol(createHttpResourceShellMeta(resource));
122124
const memberNameStr = toCase(refChild.name, 'camelCase');
123125
const memberName = plugin.symbol(memberNameStr);
@@ -201,19 +203,23 @@ function implementHttpRequestFn<T extends ReturnType<typeof $.func | typeof $.me
201203
operation,
202204
});
203205

206+
// TODO: contract (?)
204207
const symbolClient = plugin.querySymbol({ category: 'client' });
208+
// TODO: contract (cross)
205209
const symbolOptions = plugin.referenceSymbol({
206210
artifact: 'sdk',
207211
category: 'type',
208212
resource: 'client-options',
209213
});
214+
// TODO: contract (cross)
210215
const symbolDataType = plugin.querySymbol({
211216
artifact: 'types',
212217
category: 'type',
213218
resource: 'operation',
214219
resourceId: operation.id,
215220
role: 'data',
216221
});
222+
// TODO: contract (?)
217223
const symbolResponseType = plugin.querySymbol({
218224
category: 'type',
219225
resource: 'operation',
@@ -262,18 +268,21 @@ function implementHttpResourceFn<T extends ReturnType<typeof $.func | typeof $.m
262268
operation,
263269
});
264270

271+
// TODO: contract (cross)
265272
const symbolOptions = plugin.referenceSymbol({
266273
artifact: 'sdk',
267274
category: 'type',
268275
resource: 'client-options',
269276
});
277+
// TODO: contract (cross)
270278
const symbolDataType = plugin.querySymbol({
271279
artifact: 'types',
272280
category: 'type',
273281
resource: 'operation',
274282
resourceId: operation.id,
275283
role: 'data',
276284
});
285+
// TODO: contract (?)
277286
const symbolResponseType = plugin.querySymbol({
278287
category: 'type',
279288
resource: 'operation',
@@ -308,6 +317,7 @@ function implementHttpResourceFn<T extends ReturnType<typeof $.func | typeof $.m
308317
.do(
309318
$.lazy((ctx) =>
310319
ctx
320+
// TODO: contract (self)
311321
.access(plugin.referenceSymbol(createHttpRequestFnMeta(operation)), {
312322
transform: (node, index) =>
313323
index === 0

‎packages/openapi-ts/src/plugins/@hey-api/client-core/client.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const createClient: PluginHandler = ({ plugin }) => {
5757
const symbolCreateConfig = plugin.symbol('createConfig', {
5858
external: clientModule,
5959
});
60+
// TODO: contract (?)
6061
const symbolClientOptions = plugin.referenceSymbol({
6162
category: 'type',
6263
resource: 'client',

‎packages/openapi-ts/src/plugins/@hey-api/client-core/create-client-config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { PluginHandler } from './types';
55

66
export function createClientConfigType({ plugin }: Parameters<PluginHandler>[0]): void {
77
const clientModule = clientFolderAbsolutePath(getTypedConfig(plugin));
8+
// TODO: contract (?)
89
const symbolClientOptions = plugin.referenceSymbol({
910
category: 'type',
1011
resource: 'client',

‎packages/openapi-ts/src/plugins/@hey-api/sdk/shared/class.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export function createClientClass({
6565
plugin: HeyApiSdkPlugin['Instance'];
6666
symbol: Symbol;
6767
}): ReturnType<typeof $.class> {
68+
// TODO: contract (?)
6869
const symClient = plugin.querySymbol({ category: 'client' });
6970
const optionalClient = Boolean(plugin.config.client && symClient);
7071
const symbolClient = plugin.imports.Client;

‎packages/openapi-ts/src/plugins/@hey-api/sdk/shared/operation.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export function operationOptionsType({
2929
const client = getClientPlugin(getTypedConfig(plugin));
3030
const isNuxtClient = client.name === '@hey-api/client-nuxt';
3131

32+
// TODO: contract (cross)
3233
const symbolDataType = isDataAllowed
3334
? plugin.querySymbol({
3435
artifact: 'types',
@@ -38,14 +39,15 @@ export function operationOptionsType({
3839
role: 'data',
3940
})
4041
: undefined;
41-
42+
// TODO: contract (self)
4243
const symbolOptions = plugin.referenceSymbol({
4344
artifact: 'sdk',
4445
category: 'type',
4546
resource: 'client-options',
4647
});
4748

4849
if (isNuxtClient) {
50+
// TODO: contract (?)
4951
const symbolResponseType = plugin.querySymbol({
5052
category: 'type',
5153
resource: 'operation',
@@ -62,6 +64,7 @@ export function operationOptionsType({
6264
const isSse = hasOperationSse({ operation });
6365

6466
if (isSse) {
67+
// TODO: contract (?)
6568
const symbolResponseType = plugin.querySymbol({
6669
category: 'type',
6770
resource: 'operation',
@@ -215,13 +218,14 @@ export function operationStatements({
215218
const client = getClientPlugin(getTypedConfig(plugin));
216219
const isNuxtClient = client.name === '@hey-api/client-nuxt';
217220

221+
// TODO: contract (?)
218222
const symbolResponseType = plugin.querySymbol({
219223
category: 'type',
220224
resource: 'operation',
221225
resourceId: operation.id,
222226
role: isNuxtClient ? 'response' : 'responses',
223227
});
224-
228+
// TODO: contract (?)
225229
const symbolErrorType = plugin.querySymbol({
226230
category: 'type',
227231
resource: 'operation',
@@ -435,6 +439,7 @@ export function operationStatements({
435439
}
436440
}
437441

442+
// TODO: contract (?)
438443
const symbolClient = plugin.config.client
439444
? plugin.querySymbol({
440445
category: 'client',
@@ -495,6 +500,7 @@ export function operationReturnType({
495500
const isNuxt = client.name === '@hey-api/client-nuxt';
496501
const isSse = hasOperationSse({ operation });
497502

503+
// TODO: contract (?)
498504
const queryType = (role: 'response' | 'responses' | 'error' | 'errors') =>
499505
plugin.querySymbol({
500506
category: 'type',

0 commit comments

Comments
 (0)