@temporary-name/server 0.0.1-alpha.123c4256a169035efa84c708de3e315d2a7f5ae1

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.
Files changed (37) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -0
  3. package/dist/adapters/aws-lambda/index.d.mts +26 -0
  4. package/dist/adapters/aws-lambda/index.d.ts +26 -0
  5. package/dist/adapters/aws-lambda/index.mjs +29 -0
  6. package/dist/adapters/fastify/index.d.mts +23 -0
  7. package/dist/adapters/fastify/index.d.ts +23 -0
  8. package/dist/adapters/fastify/index.mjs +29 -0
  9. package/dist/adapters/fetch/index.d.mts +28 -0
  10. package/dist/adapters/fetch/index.d.ts +28 -0
  11. package/dist/adapters/fetch/index.mjs +31 -0
  12. package/dist/adapters/node/index.d.mts +26 -0
  13. package/dist/adapters/node/index.d.ts +26 -0
  14. package/dist/adapters/node/index.mjs +29 -0
  15. package/dist/handler/index.d.mts +27 -0
  16. package/dist/handler/index.d.ts +27 -0
  17. package/dist/handler/index.mjs +7 -0
  18. package/dist/helpers/index.d.mts +149 -0
  19. package/dist/helpers/index.d.ts +149 -0
  20. package/dist/helpers/index.mjs +142 -0
  21. package/dist/index.d.mts +414 -0
  22. package/dist/index.d.ts +414 -0
  23. package/dist/index.mjs +696 -0
  24. package/dist/openapi/index.d.mts +166 -0
  25. package/dist/openapi/index.d.ts +166 -0
  26. package/dist/openapi/index.mjs +834 -0
  27. package/dist/shared/server.7EG6rqbI.mjs +496 -0
  28. package/dist/shared/server.B3SSI6V6.d.mts +3026 -0
  29. package/dist/shared/server.B3SSI6V6.d.ts +3026 -0
  30. package/dist/shared/server.BwXNcNk_.mjs +275 -0
  31. package/dist/shared/server.C1RJffw4.mjs +30 -0
  32. package/dist/shared/server.CjPiuQYH.d.mts +51 -0
  33. package/dist/shared/server.CjPiuQYH.d.ts +51 -0
  34. package/dist/shared/server.Cuq0WHVy.mjs +529 -0
  35. package/dist/shared/server.DmZlW6xR.d.ts +39 -0
  36. package/dist/shared/server.KW5uPnMg.d.mts +39 -0
  37. package/package.json +86 -0
@@ -0,0 +1,3026 @@
1
+ import { Simplify, Promisable, IsEqual, HTTPMethod, HTTPPath, OutputStructure, OpenAPI, Exact, HTTPEndpoint, OmitStrict, StandardResponse, StandardLazyRequest } from '@temporary-name/shared';
2
+ import * as z from '@temporary-name/zod';
3
+ import { $ZodShape } from 'zod/v4/core';
4
+
5
+ type Context = object;
6
+ type CompatibleContext<T1 extends Context, T2 extends Context> = {
7
+ [P in keyof T1 & keyof T2]: T2[P];
8
+ };
9
+ type MergedContext<T extends Context, U extends Context> = Simplify<Omit<T, keyof U> & U>;
10
+ type BuildContextWithAuth<TContext extends Context, TAuthContext> = MergedContext<TContext, {
11
+ auth: TAuthContext | ('auth' extends keyof TContext ? TContext['auth'] : never);
12
+ }>;
13
+ declare function mergeContext<T extends Context, U extends Context>(context: T, other: U): MergedContext<T, U>;
14
+
15
+ type Meta = Record<string, any>;
16
+ declare function mergeMeta<T extends Meta>(meta1: T, meta2: T): T;
17
+
18
+ type ValidatedAuthContext = {};
19
+ interface BaseAuthConfig {
20
+ oasDescription?: string;
21
+ oasName?: string;
22
+ }
23
+ interface BasicAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> extends BaseAuthConfig {
24
+ tokenPrefix?: string;
25
+ validate: (username: string, password: string, options: ProcedureHandlerOptions<TCurrentContext, TMeta>) => Promisable<TAuthContext>;
26
+ }
27
+ interface BearerAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> extends TokenAuthConfig<TAuthContext, TCurrentContext, TMeta> {
28
+ oasBearerFormat?: string;
29
+ }
30
+ interface TokenAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> extends BaseAuthConfig {
31
+ tokenPrefix?: string;
32
+ validate: (token: string, options: ProcedureHandlerOptions<TCurrentContext, TMeta>) => Promisable<TAuthContext>;
33
+ }
34
+ interface NamedTokenAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> extends TokenAuthConfig<TAuthContext, TCurrentContext, TMeta> {
35
+ name: string;
36
+ }
37
+ type AnyAuthConfig = AuthConfig<any, any, any>;
38
+ type AuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> = ({
39
+ type: 'basic';
40
+ } & BasicAuthConfig<TAuthContext, TCurrentContext, TMeta>) | ({
41
+ type: 'bearer';
42
+ } & BearerAuthConfig<TAuthContext, TCurrentContext, TMeta>) | ({
43
+ type: 'header';
44
+ } & NamedTokenAuthConfig<TAuthContext, TCurrentContext, TMeta>) | ({
45
+ type: 'query';
46
+ } & NamedTokenAuthConfig<TAuthContext, TCurrentContext, TMeta>) | ({
47
+ type: 'cookie';
48
+ } & NamedTokenAuthConfig<TAuthContext, TCurrentContext, TMeta>) | {
49
+ type: 'none';
50
+ };
51
+
52
+ type Schema<TInput, TOutput> = z.core.$ZodType<TOutput, TInput>;
53
+ type AnySchema = z.core.$ZodType<any, any>;
54
+ type AnyShape = Readonly<Record<string, AnySchema>>;
55
+ type UnionToIntersection<T extends readonly object[]> = T extends readonly [infer First, ...infer Rest] ? First & (Rest extends readonly object[] ? UnionToIntersection<Rest> : {}) : {};
56
+ type WrapShape<U extends AnySchema | AnyShape> = U extends AnySchema ? U : U extends AnyShape ? z.KrustyObject<U, z.core.$strip> : never;
57
+ type SchemaIssue = z.core.$ZodIssue;
58
+ type InferSchemaInput<T extends AnySchema> = z.input<T>;
59
+ type InferSchemaOutput<T extends AnySchema> = z.output<T>;
60
+ type InferHandlerInputs<TSchemas extends Schemas> = {
61
+ path: InferSchemaOutput<TSchemas['pathSchema']>;
62
+ query: InferSchemaOutput<TSchemas['querySchema']>;
63
+ body: InferSchemaOutput<TSchemas['bodySchema']>;
64
+ };
65
+ type InferProcedureClientInputs<TSchemas extends Schemas> = {
66
+ path: InferSchemaInput<TSchemas['pathSchema']>;
67
+ query: InferSchemaInput<TSchemas['querySchema']>;
68
+ body: InferSchemaInput<TSchemas['bodySchema']>;
69
+ };
70
+ type TypeRest<TInput, TOutput> = [map: (input: TInput) => Promisable<TOutput>] | (IsEqual<TInput, TOutput> extends true ? [] : never);
71
+ interface Schemas {
72
+ pathSchema: AnySchema;
73
+ querySchema: AnySchema;
74
+ bodySchema: AnySchema;
75
+ outputSchema: AnySchema;
76
+ }
77
+ type Schemable = AnySchema | AnyShape;
78
+ type WrapShapes<TPath extends Schemable, TQuery extends Schemable, TBody extends Schemable, TResponse extends Schemable> = {
79
+ pathSchema: WrapShape<TPath>;
80
+ querySchema: WrapShape<TQuery>;
81
+ bodySchema: WrapShape<TBody>;
82
+ outputSchema: WrapShape<TResponse>;
83
+ };
84
+ declare const initialSchemas: {
85
+ pathSchema: z.KrustyObject<{}, z.core.$strict, z.KrustyInternals<string>>;
86
+ querySchema: z.KrustyObject<{}, z.core.$strict, z.KrustyInternals<string>>;
87
+ bodySchema: z.KrustyObject<{}, z.core.$strict, z.KrustyInternals<string>>;
88
+ outputSchema: z.KrustyUnknown<z.KrustyInternals<string>>;
89
+ };
90
+ type InitialSchemas = typeof initialSchemas;
91
+
92
+ type NormalizePlaceholderName<T extends string> = T extends `+${infer Rest}` ? Rest : T;
93
+ type ExtractPlaceholders<T> = T extends `${infer _Before}{${infer Name}}${infer After}` ? NormalizePlaceholderName<Name> | ExtractPlaceholders<After> : never;
94
+ type ExactSchema<TExact, TFull> = Exact<TExact, TFull, 'ERROR: Schema keys must correspond to placeholder names in the endpoint path.'>;
95
+ type EndpointSchema<TEndpoint, TPath, _TShape extends Readonly<$ZodShape> = Readonly<Record<ExtractPlaceholders<TEndpoint>, AnySchema>>> = ExactSchema<_TShape, TPath> | z.core.$ZodObject<ExactSchema<_TShape, TPath extends z.core.$ZodObject<infer UShape> ? UShape : never>>;
96
+ type PathSchemaIfPlaceholders<TPlaceholders, TSchema> = {
97
+ path?: TSchema;
98
+ } & (ExtractPlaceholders<TPlaceholders> extends never ? unknown : {
99
+ path: TSchema;
100
+ });
101
+ type ContractOpts<TEndpoint extends HTTPEndpoint, TPath extends EndpointSchema<TEndpoint, TPath>, TQuery extends AnySchema | AnyShape, TBody extends AnySchema | AnyShape, TResponse extends AnySchema | AnyShape> = PathSchemaIfPlaceholders<TEndpoint, TPath> & OmitStrict<Endpoint, 'method' | 'path'> & {
102
+ response: TResponse;
103
+ query?: TQuery;
104
+ body?: TBody;
105
+ };
106
+ interface Endpoint {
107
+ method: HTTPMethod;
108
+ path: HTTPPath;
109
+ summary?: string;
110
+ description?: string;
111
+ deprecated?: boolean;
112
+ tags?: readonly string[];
113
+ /**
114
+ * The status code of the response when the procedure is successful.
115
+ * The status code must be in the 200-399 range.
116
+ *
117
+ * @default 200
118
+ */
119
+ successStatus?: number;
120
+ /**
121
+ * The description of the response when the procedure is successful.
122
+ *
123
+ * @default 'OK'
124
+ */
125
+ successDescription?: string;
126
+ /**
127
+ * Determines how the response should be structured based on the output.
128
+ *
129
+ * @option 'compact'
130
+ * The output data is directly returned as the response body.
131
+ *
132
+ * @option 'detailed'
133
+ * Return an object with optional properties:
134
+ * - `status`: The response status (must be in 200-399 range) if not set fallback to `successStatus`.
135
+ * - `headers`: Custom headers to merge with the response headers (`Record<string, string | string[] | undefined>`)
136
+ * - `body`: The response body.
137
+ *
138
+ * Example:
139
+ * ```ts
140
+ * const output = {
141
+ * status: 201,
142
+ * headers: { 'x-custom-header': 'value' },
143
+ * body: { message: 'Hello, world!' },
144
+ * };
145
+ * ```
146
+ *
147
+ * @default 'compact'
148
+ */
149
+ outputStructure?: OutputStructure;
150
+ /**
151
+ * Override entire auto-generated OpenAPI Operation Object Specification.
152
+ */
153
+ spec?: OpenAPI.OperationObject | ((current: OpenAPI.OperationObject) => OpenAPI.OperationObject);
154
+ }
155
+ declare function getEndpointId(endpoint: Endpoint): string;
156
+
157
+ interface ValidationErrorOptions extends ErrorOptions {
158
+ issues: readonly SchemaIssue[];
159
+ data: unknown;
160
+ }
161
+ /**
162
+ * This errors usually used for ApiError.cause when the error is a validation error.
163
+ */
164
+ declare class ValidationError extends Error {
165
+ readonly issues: readonly SchemaIssue[];
166
+ readonly data: unknown;
167
+ constructor(options: ValidationErrorOptions);
168
+ }
169
+ type Extra = Record<string, any>;
170
+ type ErrorOpts = {
171
+ message?: string;
172
+ cause?: unknown;
173
+ };
174
+ type ApiErrorConstructorArgs<TExtra extends Extra> = {} extends TExtra ? [options?: ErrorOpts & TExtra] : [options: ErrorOpts & TExtra];
175
+ type InferExtra<T extends ApiErrorStatic> = T['extraSchema'] extends z.core.$ZodShape ? $InferObjectOutput<T['extraSchema']> : {};
176
+ interface ApiErrorStatic {
177
+ status: number;
178
+ type: string;
179
+ defaultMessage: string;
180
+ extraSchema?: z.core.$ZodShape;
181
+ }
182
+ declare abstract class ApiError<TSubclass extends ApiErrorStatic> extends Error {
183
+ extra: InferExtra<TSubclass>;
184
+ constructor(...args: ApiErrorConstructorArgs<InferExtra<TSubclass>>);
185
+ static get defaultMessage(): string;
186
+ toJSON(): {
187
+ type: string;
188
+ message: string;
189
+ } & InferExtra<TSubclass>;
190
+ }
191
+ declare class BadRequestError<TSubclass extends ApiErrorStatic = typeof BadRequestError> extends ApiError<TSubclass> {
192
+ static status: number;
193
+ static type: string;
194
+ static extraSchema: {
195
+ code: z.KrustyString<z.KrustyInternals<string>>;
196
+ param: z.KrustyOptional<z.KrustyString<z.KrustyInternals<string>>, z.KrustyInternals<string>>;
197
+ };
198
+ toJSON(): {
199
+ type: string;
200
+ message: string;
201
+ } & InferExtra<TSubclass>;
202
+ }
203
+ declare class UnauthorizedError<TSubclass extends ApiErrorStatic = typeof UnauthorizedError> extends ApiError<TSubclass> {
204
+ static status: number;
205
+ static type: string;
206
+ }
207
+ declare class ForbiddenError<TSubclass extends ApiErrorStatic = typeof ForbiddenError> extends ApiError<TSubclass> {
208
+ static status: number;
209
+ static type: string;
210
+ }
211
+ declare class NotFoundError<TSubclass extends ApiErrorStatic = typeof NotFoundError> extends ApiError<TSubclass> {
212
+ static status: number;
213
+ static type: string;
214
+ }
215
+ declare class MethodNotAllowedError<TSubclass extends ApiErrorStatic = typeof MethodNotAllowedError> extends ApiError<TSubclass> {
216
+ static status: number;
217
+ static type: string;
218
+ }
219
+ declare class NotAcceptableError<TSubclass extends ApiErrorStatic = typeof NotAcceptableError> extends ApiError<TSubclass> {
220
+ static status: number;
221
+ static type: string;
222
+ }
223
+ declare class RequestTimeoutError<TSubclass extends ApiErrorStatic = typeof RequestTimeoutError> extends ApiError<TSubclass> {
224
+ static status: number;
225
+ static type: string;
226
+ }
227
+ declare class ConflictError<TSubclass extends ApiErrorStatic = typeof ConflictError> extends ApiError<TSubclass> {
228
+ static status: number;
229
+ static type: string;
230
+ }
231
+ declare class PreconditionFailedError<TSubclass extends ApiErrorStatic = typeof PreconditionFailedError> extends ApiError<TSubclass> {
232
+ static status: number;
233
+ static type: string;
234
+ }
235
+ declare class ContentTooLargeError<TSubclass extends ApiErrorStatic = typeof ContentTooLargeError> extends ApiError<TSubclass> {
236
+ static status: number;
237
+ static type: string;
238
+ }
239
+ declare class UnsupportedMediaTypeError<TSubclass extends ApiErrorStatic = typeof UnsupportedMediaTypeError> extends ApiError<TSubclass> {
240
+ static status: number;
241
+ static type: string;
242
+ }
243
+ declare class UnprocessableContentError<TSubclass extends ApiErrorStatic = typeof UnprocessableContentError> extends ApiError<TSubclass> {
244
+ static status: number;
245
+ static type: string;
246
+ }
247
+ declare class TooManyRequestsError<TSubclass extends ApiErrorStatic = typeof TooManyRequestsError> extends ApiError<TSubclass> {
248
+ static status: number;
249
+ static type: string;
250
+ }
251
+ declare class InternalServerError<TSubclass extends ApiErrorStatic = typeof InternalServerError> extends ApiError<TSubclass> {
252
+ static status: number;
253
+ static type: string;
254
+ }
255
+ declare class NotImplementedError<TSubclass extends ApiErrorStatic = typeof NotImplementedError> extends ApiError<TSubclass> {
256
+ static status: number;
257
+ static type: string;
258
+ }
259
+ declare class BadGatewayError<TSubclass extends ApiErrorStatic = typeof BadGatewayError> extends ApiError<TSubclass> {
260
+ static status: number;
261
+ static type: string;
262
+ }
263
+ declare class ServiceUnavailableError<TSubclass extends ApiErrorStatic = typeof ServiceUnavailableError> extends ApiError<TSubclass> {
264
+ static status: number;
265
+ static type: string;
266
+ }
267
+ declare class GatewayTimeoutError<TSubclass extends ApiErrorStatic = typeof GatewayTimeoutError> extends ApiError<TSubclass> {
268
+ static status: number;
269
+ static type: string;
270
+ }
271
+ type ErrorMap = Record<string, ApiErrorStatic | undefined>;
272
+ type OptionalOutSchema = {
273
+ _zod: {
274
+ optout: 'optional';
275
+ };
276
+ };
277
+ type $InferObjectOutput<T extends z.core.$ZodLooseShape> = string extends keyof T ? z.core.util.IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, z.core.output<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : z.core.util.Prettify<{
278
+ -readonly [k in keyof T as T[k] extends OptionalOutSchema ? never : k]: T[k]['_zod']['output'];
279
+ } & {
280
+ -readonly [k in keyof T as T[k] extends OptionalOutSchema ? k : never]?: T[k]['_zod']['output'];
281
+ }>;
282
+ declare function isApiErrorStatus(status: number): boolean;
283
+ declare function toApiError(error: unknown): ApiError<any>;
284
+ declare function encodeError(error: ApiError<any>): StandardResponse;
285
+
286
+ type MiddlewareResult<TOutContext extends Context, TOutput> = Promisable<{
287
+ output: TOutput;
288
+ context: TOutContext;
289
+ }>;
290
+ interface MiddlewareNextFn<TOutput> {
291
+ <U extends Context = {}>(options?: {
292
+ context?: U;
293
+ }): MiddlewareResult<U, TOutput>;
294
+ }
295
+ interface MiddlewareOutputFn<TOutput> {
296
+ (output: TOutput): MiddlewareResult<{}, TOutput>;
297
+ }
298
+ interface MiddlewareOptions<TInContext extends Context, TOutput, TMeta extends Meta> extends ProcedureHandlerOptions<TInContext, TMeta> {
299
+ next: MiddlewareNextFn<TOutput>;
300
+ }
301
+ /**
302
+ * A function that represents a middleware.
303
+ */
304
+ interface Middleware<TInContext extends Context, TOutContext extends Context, TInput, TOutput, TMeta extends Meta> {
305
+ (options: MiddlewareOptions<TInContext, TOutput, TMeta>, input: TInput, output: MiddlewareOutputFn<TOutput>): Promisable<MiddlewareResult<TOutContext, TOutput>>;
306
+ }
307
+ type AnyMiddleware = Middleware<any, any, any, any, any>;
308
+ interface MapInputMiddleware<TInput, TMappedInput> {
309
+ (input: TInput): TMappedInput;
310
+ }
311
+ declare function middlewareOutputFn<TOutput>(output: TOutput): MiddlewareResult<{}, TOutput>;
312
+
313
+ interface ProcedureHandlerOptions<TCurrentContext extends Context, TMeta extends Meta> {
314
+ context: TCurrentContext;
315
+ procedure: Procedure<Context, Context, Schemas, TMeta>;
316
+ signal?: AbortSignal;
317
+ request?: StandardLazyRequest;
318
+ lastEventId: string | undefined;
319
+ }
320
+ interface ProcedureHandler<TCurrentContext extends Context, TSchemas extends Schemas, TMeta extends Meta> {
321
+ (input: InferHandlerInputs<TSchemas>, opt: ProcedureHandlerOptions<TCurrentContext, TMeta>): Promisable<InferSchemaOutput<TSchemas['outputSchema']>>;
322
+ }
323
+ interface BaseDef<TMeta extends Meta> {
324
+ meta: TMeta;
325
+ errorMap: ErrorMap;
326
+ middlewares: readonly AnyMiddleware[];
327
+ authConfigs: AnyAuthConfig[];
328
+ }
329
+ interface ContractDef<TSchemas extends Schemas, TMeta extends Meta> extends BaseDef<TMeta> {
330
+ endpoint: Endpoint;
331
+ schemas: TSchemas;
332
+ }
333
+ type AnyContractDef = ContractDef<Schemas, Meta>;
334
+ declare class HasDef<TDef> {
335
+ /**
336
+ * This property holds the defined options.
337
+ */
338
+ '~def': TDef;
339
+ constructor(def: TDef);
340
+ }
341
+ declare class Contract<TSchemas extends Schemas = Schemas, TMeta extends Meta = Meta> extends HasDef<ContractDef<TSchemas, TMeta>> {
342
+ }
343
+ interface ProcedureDef<TCurrentContext extends Context, TSchemas extends Schemas, TMeta extends Meta> extends ContractDef<TSchemas, TMeta> {
344
+ handler: ProcedureHandler<TCurrentContext, any, any>;
345
+ }
346
+ declare class Procedure<in _TInitialContext extends Context, TCurrentContext extends Context, TSchemas extends Schemas, TMeta extends Meta> extends HasDef<ProcedureDef<TCurrentContext, TSchemas, TMeta>> implements Contract<TSchemas, TMeta> {
347
+ }
348
+ type AnyProcedure<TInitialContext extends Context = any> = Procedure<TInitialContext, any, Schemas, any>;
349
+
350
+ /**
351
+ * This file is automatically generated by generate-stainless-config-types.ts.
352
+ * DO NOT MODIFY IT BY HAND.
353
+ */
354
+ interface StainlessConfig {
355
+ edition?: "2026-01-30" | "2025-10-10" | "2025-10-08";
356
+ /**
357
+ * How the organization is represented in the SDKs, such as `name` and `github_org`.
358
+ */
359
+ organization: {
360
+ /**
361
+ * Name of your organization or company, in lowercase. Used in documentation.
362
+ * The generated client name defaults to this. To customize the capitalization,
363
+ * use `custom_casings`.
364
+ */
365
+ name: string;
366
+ /**
367
+ * Link to your API documentation.
368
+ */
369
+ docs?: string;
370
+ /**
371
+ * Contact email for bug reports, questions, and support requests.
372
+ */
373
+ contact?: string;
374
+ /**
375
+ * Security email address for reporting vulnerabilities. Will be mentioned in the generated
376
+ * SECURITY.md. Defaults to the contact email.
377
+ */
378
+ security_contact?: string;
379
+ /**
380
+ * Link to a page covering your security policy. Will be mentioned in the generated SECURITY.md.
381
+ */
382
+ security_policy_url?: string;
383
+ /**
384
+ * Terms for your security policy. Will be added to the generated SECURITY.md.
385
+ *
386
+ * Stainless always generates a default security policy covering SDKs security issues.
387
+ * This field is for additional terms you want to add and will be included in a section
388
+ * '[Your org name] Terms and Policies'.
389
+ */
390
+ security_policy_terms?: string;
391
+ /**
392
+ * Name of the GitHub organization that the production SDKs live in.
393
+ */
394
+ github_org?: string;
395
+ /**
396
+ * Whether or not to enable uploading the input openapi spec and publicly exposing it in the SDK.
397
+ *
398
+ * This allows running tests in the SDKs against a mock server, and if disabled will disable tests from automatically running in CI.
399
+ */
400
+ upload_spec?: boolean;
401
+ };
402
+ /**
403
+ * Customization for each language's repo name, package manager name, etc.
404
+ */
405
+ targets?: {
406
+ node?: {
407
+ /**
408
+ * Title for this package, typically used to display the README header in the format `<Title> API Library` (for example, "Your company language library")'
409
+ */
410
+ readme_title?: string;
411
+ production_repo?: string | null;
412
+ /**
413
+ * URL of a screencast to showcase on the project README. Must be an .mp4, .webm, or .mov file less <10MB.
414
+ */
415
+ screencast?: string;
416
+ /**
417
+ * Skip generation for this target
418
+ */
419
+ skip?: boolean;
420
+ edition?: "node.2025-10-08";
421
+ /**
422
+ * The name of the package in the import such as `import … from "<package_name>"` and the name in package.json.
423
+ */
424
+ package_name: string;
425
+ publish: {
426
+ npm: boolean;
427
+ jsr?: boolean | {
428
+ /**
429
+ * The name of the package in the jsr repository.
430
+ */
431
+ package_name: string;
432
+ /**
433
+ * By default, publishing to jsr uses GitHub Actions OIDC tokens. This should be set to true if you want to publish using an access tokens instead.
434
+ */
435
+ use_access_token?: boolean;
436
+ };
437
+ };
438
+ options?: {
439
+ /**
440
+ * Enable MCP server generation.
441
+ *
442
+ * If enabled, will create a sub-directory in the SDK under `packages/mcp-server`.
443
+ * For more information: https://modelcontextprotocol.io/introduction
444
+ */
445
+ mcp_server?: boolean | {
446
+ /**
447
+ * The name of the mcp package. Defaults to `<typescript-package>-mcp`
448
+ */
449
+ package_name?: string;
450
+ /**
451
+ * Generate a tool for the MCP server to look up documentation for your Stainless SDK.
452
+ *
453
+ * This requires you to expose the SDK docs search API for your project.
454
+ */
455
+ enable_docs_tool?: boolean;
456
+ /**
457
+ * Generates a cloudflare worker that you can deploy as a Remote MCP Server in your own
458
+ * Cloudflare account. This is useful if you want to easily set up an MCP server that handles
459
+ * OAuth for use in web clients like claude.ai.
460
+ *
461
+ * See https://www.stainless.com/docs/guides/generate-an-mcp-server#deploy-a-remote-mcp-server for more information.
462
+ */
463
+ generate_cloudflare_worker?: boolean;
464
+ /**
465
+ * Instructions for the MCP client on to use the MCP server. This is sent as a part of MCP server initialization, and enters the client's context.
466
+ * Defaults to no instructions being sent.
467
+ *
468
+ * See https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle#initialization for more information.
469
+ */
470
+ instructions?: string;
471
+ /**
472
+ * OAuth protected resource metadata to expose when running with Streamable HTTP transport.
473
+ */
474
+ oauth_resource_metadata?: {
475
+ /**
476
+ * List of OAuth authorization server URLs to advertise to MCP clients
477
+ */
478
+ authorization_servers: string[];
479
+ /**
480
+ * List of scopes to advertise to MCP clients
481
+ */
482
+ scopes_supported?: string[];
483
+ };
484
+ publish?: {
485
+ /**
486
+ * Docker image publishing configuration. Set to false to disable, string for image name, or object for full config.
487
+ */
488
+ docker?: false | string | {
489
+ /**
490
+ * The Docker image name, e.g. "myorg/my-api-mcp"
491
+ */
492
+ image_name: string;
493
+ /**
494
+ * The Docker registry to publish to
495
+ */
496
+ registry?: string;
497
+ };
498
+ };
499
+ host?: {
500
+ /**
501
+ * Whether to publish the package to the Stainless registry and host via Stainless.
502
+ */
503
+ stainless: boolean;
504
+ };
505
+ };
506
+ browser?: {
507
+ /**
508
+ * If set to `dangerous_allow` then the SDK will only be usable in the browser when passing an explicit flag.
509
+ */
510
+ state?: "allow" | "disallow" | "dangerous_allow";
511
+ /**
512
+ * The error message to throw.
513
+ */
514
+ message?: string;
515
+ };
516
+ };
517
+ custom?: {};
518
+ };
519
+ typescript?: {
520
+ /**
521
+ * Title for this package, typically used to display the README header in the format `<Title> API Library` (for example, "Your company language library")'
522
+ */
523
+ readme_title?: string;
524
+ production_repo?: string | null;
525
+ /**
526
+ * URL of a screencast to showcase on the project README. Must be an .mp4, .webm, or .mov file less <10MB.
527
+ */
528
+ screencast?: string;
529
+ /**
530
+ * Skip generation for this target
531
+ */
532
+ skip?: boolean;
533
+ edition?: "typescript.2025-10-10" | "typescript.2025-10-08";
534
+ /**
535
+ * The name of the package in the import such as `import … from "<package_name>"` and the name in package.json.
536
+ */
537
+ package_name: string;
538
+ publish: {
539
+ npm: boolean | {
540
+ /**
541
+ * By default, publishing to npm uses Access Tokens. You can instead opt to use Github Actions OIDC tokens.
542
+ */
543
+ auth_method?: "access-token" | "oidc";
544
+ };
545
+ jsr?: boolean | {
546
+ /**
547
+ * The name of the package in the jsr repository.
548
+ */
549
+ package_name: string;
550
+ /**
551
+ * By default, publishing to jsr uses GitHub Actions OIDC tokens. This should be set to true if you want to publish using an access tokens instead.
552
+ */
553
+ use_access_token?: boolean;
554
+ };
555
+ };
556
+ options?: {
557
+ /**
558
+ * Enable MCP server generation.
559
+ *
560
+ * If enabled, will create a sub-directory in the SDK under `packages/mcp-server`.
561
+ * For more information: https://modelcontextprotocol.io/introduction
562
+ */
563
+ mcp_server?: boolean | {
564
+ /**
565
+ * The name of the mcp package. Defaults to `<typescript-package>-mcp`
566
+ */
567
+ package_name?: string;
568
+ /**
569
+ * Generate a tool for the MCP server to look up documentation for your Stainless SDK.
570
+ *
571
+ * This requires you to expose the SDK docs search API for your project.
572
+ */
573
+ enable_docs_tool?: boolean;
574
+ /**
575
+ * Generates a cloudflare worker that you can deploy as a Remote MCP Server in your own
576
+ * Cloudflare account. This is useful if you want to easily set up an MCP server that handles
577
+ * OAuth for use in web clients like claude.ai.
578
+ *
579
+ * See https://www.stainless.com/docs/guides/generate-an-mcp-server#deploy-a-remote-mcp-server for more information.
580
+ */
581
+ generate_cloudflare_worker?: boolean;
582
+ /**
583
+ * Instructions for the MCP client on to use the MCP server. This is sent as a part of MCP server initialization, and enters the client's context.
584
+ * Defaults to no instructions being sent.
585
+ *
586
+ * See https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle#initialization for more information.
587
+ */
588
+ instructions?: string;
589
+ /**
590
+ * OAuth protected resource metadata to expose when running with Streamable HTTP transport.
591
+ */
592
+ oauth_resource_metadata?: {
593
+ /**
594
+ * List of OAuth authorization server URLs to advertise to MCP clients
595
+ */
596
+ authorization_servers: string[];
597
+ /**
598
+ * List of scopes to advertise to MCP clients
599
+ */
600
+ scopes_supported?: string[];
601
+ };
602
+ publish?: {
603
+ /**
604
+ * Docker image publishing configuration. Set to false to disable, string for image name, or object for full config.
605
+ */
606
+ docker?: false | string | {
607
+ /**
608
+ * The Docker image name, e.g. "myorg/my-api-mcp"
609
+ */
610
+ image_name: string;
611
+ /**
612
+ * The Docker registry to publish to
613
+ */
614
+ registry?: string;
615
+ };
616
+ };
617
+ host?: {
618
+ /**
619
+ * Whether to publish the package to the Stainless registry and host via Stainless.
620
+ */
621
+ stainless: boolean;
622
+ };
623
+ };
624
+ browser?: {
625
+ /**
626
+ * If set to `dangerous_allow` then the SDK will only be usable in the browser when passing an explicit flag.
627
+ */
628
+ state?: "allow" | "disallow" | "dangerous_allow";
629
+ /**
630
+ * The error message to throw.
631
+ */
632
+ message?: string;
633
+ };
634
+ /**
635
+ * If you're migrating from a `node` target to `typescript` you can specify 2 version strings that will be used in the migration guides and scripts.
636
+ *
637
+ * The versions will be used verbatim, such as in "Run migrations from your-sdk v{previous_version} to v{migrated_version}".
638
+ *
639
+ * If your SDK is post-1.0, we recommend to only include the major version, such as `previous_version: "2", migrated_version: "3"`.
640
+ */
641
+ node_migration?: {
642
+ previous_version: string;
643
+ migrated_version: string;
644
+ };
645
+ /**
646
+ * The package manager used to install dependencies and manage project builds.
647
+ */
648
+ package_manager?: "pnpm" | "yarn";
649
+ };
650
+ custom?: {};
651
+ };
652
+ python?: {
653
+ /**
654
+ * Title for this package, typically used to display the README header in the format `<Title> API Library` (for example, "Your company language library")'
655
+ */
656
+ readme_title?: string;
657
+ production_repo?: string | null;
658
+ /**
659
+ * URL of a screencast to showcase on the project README. Must be an .mp4, .webm, or .mov file less <10MB.
660
+ */
661
+ screencast?: string;
662
+ /**
663
+ * Skip generation for this target
664
+ */
665
+ skip?: boolean;
666
+ edition?: "python.2025-11-20" | "python.2025-10-08";
667
+ /**
668
+ * The name of the import, e.g. `from <package_name> import …`
669
+ */
670
+ package_name: string;
671
+ /**
672
+ * The Python project name, e.g. `pip install <project_name>`
673
+ */
674
+ project_name?: string;
675
+ publish: {
676
+ pypi: boolean | {
677
+ /**
678
+ * Configure the authentication strategy for publishing to PyPi. Defaults to `api-token`, specify `oidc` to enable GitHub Actions OIDC support.
679
+ */
680
+ auth_method?: "api-token" | "oidc";
681
+ /**
682
+ * The name of the package in pypi, e.g. `pip install <package_name>`
683
+ */
684
+ package_name?: string;
685
+ };
686
+ };
687
+ options?: {
688
+ use_uv?: boolean;
689
+ };
690
+ };
691
+ java?: {
692
+ /**
693
+ * Title for this package, typically used to display the README header in the format `<Title> API Library` (for example, "Your company language library")'
694
+ */
695
+ readme_title?: string;
696
+ production_repo?: string | null;
697
+ /**
698
+ * URL of a screencast to showcase on the project README. Must be an .mp4, .webm, or .mov file less <10MB.
699
+ */
700
+ screencast?: string;
701
+ /**
702
+ * Skip generation for this target
703
+ */
704
+ skip?: boolean;
705
+ edition?: "java.2025-10-08";
706
+ /**
707
+ * The reverse domain to generate the SDK under, e.g. if `reverse_domain` is "com.example.api", then you would import the client as `import com.example.api.client.okhttp.ExampleOkHttpClient`
708
+ */
709
+ reverse_domain: string;
710
+ /**
711
+ * See [our publishing guide](/docs/guides/publish#java--kotlin-sonatype-maven-central) for more information on how to publish your SDK.
712
+ */
713
+ publish: {
714
+ maven: boolean | {
715
+ /**
716
+ * The maven groupId to publish this artifact to, e.g. `com.example.api`. By default, uses the value of reverse_domain.
717
+ */
718
+ group_id?: string;
719
+ /**
720
+ * The maven artifactId to publish this artifact as, defaults to `<organization.name>-java`, e.g. `example-java`
721
+ */
722
+ artifact_id?: string;
723
+ /**
724
+ * Customers who do not already have a Sonatype OSSRH account should use the newer "portal" option.
725
+ */
726
+ sonatype_platform?: "portal" | "ossrh";
727
+ sonatype_host?: string;
728
+ };
729
+ /**
730
+ * Whether to generate and include HTML docs in the published JAR.
731
+ */
732
+ docs?: boolean;
733
+ /**
734
+ * Whether to generate and include [ProGuard keep rules](https://www.guardsquare.com/manual/configuration/usage) in the published JAR.
735
+ */
736
+ proguard?: boolean;
737
+ /**
738
+ * Whether to generate and include [GraalVM reachability metadata](https://www.graalvm.org/latest/reference-manual/native-image/metadata) in the published JAR.
739
+ */
740
+ graalvm_metadata?: boolean;
741
+ /**
742
+ * Whether to generate and publish a [Spring Boot starter](https://docs.spring.io/spring-boot/docs/2.7.18/reference/htmlsingle/#using.build-systems.starters) artifact.
743
+ */
744
+ spring_boot_starter?: boolean;
745
+ };
746
+ options?: {};
747
+ };
748
+ kotlin?: {
749
+ /**
750
+ * Title for this package, typically used to display the README header in the format `<Title> API Library` (for example, "Your company language library")'
751
+ */
752
+ readme_title?: string;
753
+ production_repo?: string | null;
754
+ /**
755
+ * URL of a screencast to showcase on the project README. Must be an .mp4, .webm, or .mov file less <10MB.
756
+ */
757
+ screencast?: string;
758
+ /**
759
+ * Skip generation for this target
760
+ */
761
+ skip?: boolean;
762
+ edition?: "kotlin.2025-10-08";
763
+ /**
764
+ * The reverse domain to generate the SDK under, e.g. if `reverse_domain` is "com.example.api", then you would import the client as `import com.example.api.client.okhttp.ExampleOkHttpClient`
765
+ */
766
+ reverse_domain: string;
767
+ /**
768
+ * See [our publishing guide](/docs/guides/publish#java--kotlin-sonatype-maven-central) for more information on how to publish your SDK.
769
+ */
770
+ publish: {
771
+ maven: boolean | {
772
+ /**
773
+ * The maven groupId to publish this artifact to, e.g. `com.example.api`. By default, uses the value of reverse_domain.
774
+ */
775
+ group_id?: string;
776
+ /**
777
+ * The maven artifactId to publish this artifact as, defaults to `<organization.name>-java`, e.g. `example-java`
778
+ */
779
+ artifact_id?: string;
780
+ /**
781
+ * Customers who do not already have a Sonatype OSSRH account should use the newer "portal" option.
782
+ */
783
+ sonatype_platform?: "portal" | "ossrh";
784
+ sonatype_host?: string;
785
+ };
786
+ /**
787
+ * Whether to generate and include HTML docs in the published JAR.
788
+ */
789
+ docs?: boolean;
790
+ /**
791
+ * Whether to generate and include [ProGuard keep rules](https://www.guardsquare.com/manual/configuration/usage) in the published JAR.
792
+ */
793
+ proguard?: boolean;
794
+ /**
795
+ * Whether to generate and include [GraalVM reachability metadata](https://www.graalvm.org/latest/reference-manual/native-image/metadata) in the published JAR.
796
+ */
797
+ graalvm_metadata?: boolean;
798
+ /**
799
+ * Whether to generate and publish a [Spring Boot starter](https://docs.spring.io/spring-boot/docs/2.7.18/reference/htmlsingle/#using.build-systems.starters) artifact.
800
+ */
801
+ spring_boot_starter?: boolean;
802
+ };
803
+ options?: {};
804
+ };
805
+ go?: {
806
+ /**
807
+ * Title for this package, typically used to display the README header in the format `<Title> API Library` (for example, "Your company language library")'
808
+ */
809
+ readme_title?: string;
810
+ production_repo?: string | null;
811
+ /**
812
+ * URL of a screencast to showcase on the project README. Must be an .mp4, .webm, or .mov file less <10MB.
813
+ */
814
+ screencast?: string;
815
+ /**
816
+ * Skip generation for this target
817
+ */
818
+ skip?: boolean;
819
+ edition?: "go.2026-2-3" | "go.2025-10-08";
820
+ /**
821
+ * The name of the root package, containing the top-level client, options, and methods.
822
+ */
823
+ package_name: string;
824
+ options?: {
825
+ /**
826
+ * Override the name used for the internal `option` package
827
+ */
828
+ option_package_name?: string;
829
+ /**
830
+ * Overrides the name used for the API client struct. This name should be pascal cased and a valid public Go identifier. By default, this is `Client`, and the constructor will be called `NewClient`.
831
+ *
832
+ * Overriding it to e.g. `APIClient` will change the struct to be `APIClient`, and the corresponding constructor will be called `NewAPIClient`.
833
+ */
834
+ client_name?: string;
835
+ /**
836
+ * Explicitly set the Go version to use
837
+ */
838
+ go_language_version?: string;
839
+ /**
840
+ * Enable the V2 Go SDK generator with "true" or "migration". **Caution:** the V2 SDK is not backwards compatible with V1.
841
+ *
842
+ * Defaults to 'false' if not specified.
843
+ */
844
+ enable_v2?: boolean;
845
+ /**
846
+ * Generates getter methods to access nested properties in unions without needing to switch on the variant.
847
+ */
848
+ union_property_getters?: boolean;
849
+ /**
850
+ * Doesn't suffix union types with '-Union', and removes the 'Of-' prefix from union variant names. This option is **not recommended** for large (or soon-to-be large) APIs, as it comes with visual clarity and forwards compatibility costs.
851
+ */
852
+ subtle_union_naming?: boolean;
853
+ /**
854
+ * Setting to false will not automatically apply URI encoding to path parameters.
855
+ */
856
+ path_param_encoding?: boolean;
857
+ /**
858
+ * In the Go Standard Library HTML in JSON is escaped by default, so this defaults to true.
859
+ */
860
+ escape_html_in_json?: boolean;
861
+ };
862
+ };
863
+ ruby?: {
864
+ /**
865
+ * Title for this package, typically used to display the README header in the format `<Title> API Library` (for example, "Your company language library")'
866
+ */
867
+ readme_title?: string;
868
+ production_repo?: string | null;
869
+ /**
870
+ * URL of a screencast to showcase on the project README. Must be an .mp4, .webm, or .mov file less <10MB.
871
+ */
872
+ screencast?: string;
873
+ /**
874
+ * Skip generation for this target
875
+ */
876
+ skip?: boolean;
877
+ edition?: "ruby.2025-10-08";
878
+ /**
879
+ * The name of the gem.
880
+ */
881
+ gem_name: string;
882
+ publish: {
883
+ rubygems: boolean;
884
+ };
885
+ options?: {
886
+ /**
887
+ * Overrides the name used for the API client struct. This name should be a valid public Ruby identifier. By default, this is `Client`.
888
+ *
889
+ * Overriding it to e.g. `APIClient` will change the class to be `APIClient`.
890
+ */
891
+ client_name?: string;
892
+ };
893
+ };
894
+ terraform?: {
895
+ /**
896
+ * Title for this package, typically used to display the README header in the format `<Title> API Library` (for example, "Your company language library")'
897
+ */
898
+ readme_title?: string;
899
+ /**
900
+ * URL of a screencast to showcase on the project README. Must be an .mp4, .webm, or .mov file less <10MB.
901
+ */
902
+ screencast?: string;
903
+ /**
904
+ * Skip generation for this target
905
+ */
906
+ skip?: boolean;
907
+ edition?: "terraform.2025-10-08";
908
+ /**
909
+ * The production repo that publishes to the Terraform Registry.
910
+ *
911
+ * The Terraform Registry requires GitHub repos to be prefixed with `terraform-provider-<providername>`, e.g. `Acme-Org/terraform-provider-acme`.
912
+ */
913
+ production_repo: string | null;
914
+ /**
915
+ * The name of the provider that users import. This is usually a single word, and is prefixed by your org name.
916
+ */
917
+ provider_name: string;
918
+ publish: {
919
+ /**
920
+ * Enable releasing to Hashicorp. See https://www.stainless.com/docs/guides/publish#terraform-terraform-registry
921
+ */
922
+ hashicorp_registry: boolean;
923
+ };
924
+ options?: {
925
+ /**
926
+ * Explicitly set the Go SDK package to depend on
927
+ */
928
+ go_sdk_package?: string;
929
+ /**
930
+ * Explicitly set the Go SDK version to depend on
931
+ */
932
+ go_sdk_version?: string;
933
+ /**
934
+ * Explicitly set the Go version to use
935
+ */
936
+ go_language_version?: string;
937
+ /**
938
+ * Automatically infer all possible resources and data sources from the stainless config
939
+ */
940
+ infer_all_services?: boolean;
941
+ /**
942
+ * whether to enable a timeout property for resources
943
+ */
944
+ timeouts?: boolean | {
945
+ /**
946
+ * Attribute name for timeout parameter
947
+ */
948
+ name?: string;
949
+ /**
950
+ * Default timeout for the resource and subresources' Terraform operations in milliseconds or ISO8601.
951
+ *
952
+ * You can override this in subresources or individual methods.
953
+ *
954
+ * This doesn't affect the request-level timeout.
955
+ */
956
+ default?: number | string;
957
+ };
958
+ };
959
+ };
960
+ cli?: {
961
+ /**
962
+ * Title for this package, typically used to display the README header in the format `<Title> API Library` (for example, "Your company language library")'
963
+ */
964
+ readme_title?: string;
965
+ production_repo?: string | null;
966
+ /**
967
+ * URL of a screencast to showcase on the project README. Must be an .mp4, .webm, or .mov file less <10MB.
968
+ */
969
+ screencast?: string;
970
+ /**
971
+ * Skip generation for this target
972
+ */
973
+ skip?: boolean;
974
+ edition?: "cli.2025-10-08";
975
+ /**
976
+ * The name of the binary, defaults to the repository name.
977
+ */
978
+ binary_name?: string;
979
+ options?: {
980
+ /**
981
+ * Set which package to use for your API's Go SDK to use
982
+ */
983
+ go_sdk_package?: string;
984
+ /**
985
+ * Set which version of your API's Go SDK to use
986
+ */
987
+ go_sdk_version?: string;
988
+ /**
989
+ * Explicitly set the Go version to use
990
+ */
991
+ go_language_version?: string;
992
+ };
993
+ /**
994
+ * The default output format for CLI methods. This can be overridden on each
995
+ * endpoint in its `cli.format` option or with the `--format` flag when
996
+ * running the command.
997
+ */
998
+ default_format?: "auto" | "explore" | "json" | "jsonl" | "pretty" | "raw" | "yaml";
999
+ /**
1000
+ * The default output format for CLI error responses. This can be overridden
1001
+ * on each endpoint in its `cli.error_format` option or with the
1002
+ * `--format-error` flag when running the command.
1003
+ */
1004
+ default_error_format?: "auto" | "explore" | "json" | "jsonl" | "pretty" | "raw" | "yaml";
1005
+ publish?: {
1006
+ macos?: boolean | {};
1007
+ /**
1008
+ * Configuration for publishing to Homebrew
1009
+ */
1010
+ homebrew?: {
1011
+ /**
1012
+ * The homebrew tap repository, e.g. AcmeOrg/homebrew-acme
1013
+ */
1014
+ tap_repo: string;
1015
+ /**
1016
+ * Homepage URL for the homebrew formula
1017
+ */
1018
+ homepage?: string;
1019
+ /**
1020
+ * Description for the homebrew formula
1021
+ */
1022
+ description?: string;
1023
+ };
1024
+ };
1025
+ };
1026
+ php?: {
1027
+ /**
1028
+ * Title for this package, typically used to display the README header in the format `<Title> API Library` (for example, "Your company language library")'
1029
+ */
1030
+ readme_title?: string;
1031
+ production_repo?: string | null;
1032
+ /**
1033
+ * URL of a screencast to showcase on the project README. Must be an .mp4, .webm, or .mov file less <10MB.
1034
+ */
1035
+ screencast?: string;
1036
+ /**
1037
+ * Skip generation for this target
1038
+ */
1039
+ skip?: boolean;
1040
+ edition?: "php.2025-10-08";
1041
+ /**
1042
+ * The name of the root package, containing the top-level client, options, and methods.
1043
+ *
1044
+ * For example, `package_name: acme` would result in `use Acme\Client` for SDK users.
1045
+ *
1046
+ * Unlike the composer_package_name, this name is only used **within the SDK library code**.
1047
+ */
1048
+ package_name: string;
1049
+ /**
1050
+ * The ecosystem name of the package as used by Composer & Packagist. The name should resemble 'acme/acme-php'.
1051
+ */
1052
+ composer_package_name?: string;
1053
+ publish?: {
1054
+ /**
1055
+ * Whether to publish the package to releases to Packagist. Use Packagist to verify the `composer_package_name` is available first.
1056
+ */
1057
+ packagist: boolean;
1058
+ };
1059
+ options?: {};
1060
+ };
1061
+ csharp?: {
1062
+ /**
1063
+ * Title for this package, typically used to display the README header in the format `<Title> API Library` (for example, "Your company language library")'
1064
+ */
1065
+ readme_title?: string;
1066
+ production_repo?: string | null;
1067
+ /**
1068
+ * URL of a screencast to showcase on the project README. Must be an .mp4, .webm, or .mov file less <10MB.
1069
+ */
1070
+ screencast?: string;
1071
+ /**
1072
+ * Skip generation for this target
1073
+ */
1074
+ skip?: boolean;
1075
+ edition?: "csharp.2025-10-08";
1076
+ /**
1077
+ * The name of the root package, containing the top-level client, options, and methods.
1078
+ */
1079
+ package_name: string;
1080
+ publish: {
1081
+ nuget: boolean;
1082
+ };
1083
+ /**
1084
+ * Configuring strong naming. For more information, see https://learn.microsoft.com/en-us/dotnet/standard/assembly/strong-named
1085
+ */
1086
+ strong_name?: {
1087
+ /**
1088
+ * The assembly originator key file (snk file), in base64 format.
1089
+ */
1090
+ originator_key: string;
1091
+ /**
1092
+ * The public key associated with the assembly originator key file.
1093
+ */
1094
+ public_key: string;
1095
+ };
1096
+ options?: {};
1097
+ };
1098
+ openapi?: {
1099
+ /**
1100
+ * Title for this package, typically used to display the README header in the format `<Title> API Library` (for example, "Your company language library")'
1101
+ */
1102
+ readme_title?: string;
1103
+ production_repo?: string | null;
1104
+ /**
1105
+ * URL of a screencast to showcase on the project README. Must be an .mp4, .webm, or .mov file less <10MB.
1106
+ */
1107
+ screencast?: string;
1108
+ /**
1109
+ * Skip generation for this target
1110
+ */
1111
+ skip?: boolean;
1112
+ edition?: "openapi.2025-10-08";
1113
+ options?: {
1114
+ files?: {
1115
+ [k: string]: {
1116
+ with: ("code-samples" | "transforms")[];
1117
+ } | undefined;
1118
+ };
1119
+ };
1120
+ };
1121
+ sql?: {
1122
+ /**
1123
+ * Title for this package, typically used to display the README header in the format `<Title> API Library` (for example, "Your company language library")'
1124
+ */
1125
+ readme_title?: string;
1126
+ production_repo?: string | null;
1127
+ /**
1128
+ * URL of a screencast to showcase on the project README. Must be an .mp4, .webm, or .mov file less <10MB.
1129
+ */
1130
+ screencast?: string;
1131
+ /**
1132
+ * Skip generation for this target
1133
+ */
1134
+ skip?: boolean;
1135
+ edition?: "sql.2025-12-08";
1136
+ /**
1137
+ * The name of the SQL extension.
1138
+ */
1139
+ extension_name: string;
1140
+ publish: {
1141
+ pgxn: boolean;
1142
+ };
1143
+ options?: {};
1144
+ };
1145
+ };
1146
+ /**
1147
+ * Map of the name of the environment which appears in the SDK to the corresponding url to use.
1148
+ * The first environment in the map will be used as the default environment.
1149
+ *
1150
+ * ~~~yaml
1151
+ * environments:
1152
+ * production: https://example.com/api
1153
+ * sandbox: https://sandbox.example.com/api
1154
+ * ~~~
1155
+ */
1156
+ environments: {
1157
+ [k: string]: string | undefined;
1158
+ };
1159
+ /**
1160
+ * Resources define the organization for your API and the endpoints that are available under which resources.
1161
+ */
1162
+ resources: {
1163
+ $shared?: ResourceConfig;
1164
+ $client?: ResourceConfig;
1165
+ [k: string]: ResourceConfig | undefined;
1166
+ };
1167
+ /**
1168
+ * Configuration of the examples in the README.md of the generated SDKs.
1169
+ *
1170
+ * Learn more: https://www.stainless.com/docs/configure/readme
1171
+ */
1172
+ readme: {
1173
+ /**
1174
+ * Configuration for the request examples used in the README.md for the various SDKs. Each example by default inherits off the default endpoint, and the default endpoint must have a response body.
1175
+ *
1176
+ * We suggest you use the most standard endpoint for the `default` example, and the most important example for the `headline` example
1177
+ */
1178
+ example_requests: {
1179
+ default: {
1180
+ type: "request";
1181
+ /**
1182
+ * Endpoint to use as the example method, in the format `post /foo/bar/{id}`
1183
+ */
1184
+ endpoint: string;
1185
+ /**
1186
+ * The request params to include in the example.
1187
+ *
1188
+ * e.g.
1189
+ *
1190
+ * params:
1191
+ * query_param: 'foo'
1192
+ * body_param: true
1193
+ * path_param: id
1194
+ */
1195
+ params: {
1196
+ [k: string]: unknown | undefined;
1197
+ };
1198
+ /**
1199
+ * The property on the response to log, e.g. `id` on a `get /accounts` endpoints adds a `console.log(account.id)` or equivalent in the example
1200
+ */
1201
+ response_property?: string;
1202
+ assign_to?: string;
1203
+ };
1204
+ headline: {
1205
+ type: "request";
1206
+ /**
1207
+ * Endpoint to use as the example method, in the format `post /foo/bar/{id}`
1208
+ */
1209
+ endpoint: string;
1210
+ /**
1211
+ * The request params to include in the example.
1212
+ *
1213
+ * e.g.
1214
+ *
1215
+ * params:
1216
+ * query_param: 'foo'
1217
+ * body_param: true
1218
+ * path_param: id
1219
+ */
1220
+ params: {
1221
+ [k: string]: unknown | undefined;
1222
+ };
1223
+ /**
1224
+ * The property on the response to log, e.g. `id` on a `get /accounts` endpoints adds a `console.log(account.id)` or equivalent in the example
1225
+ */
1226
+ response_property?: string;
1227
+ assign_to?: string;
1228
+ };
1229
+ /**
1230
+ * Example of how to handle errors in the SDK.
1231
+ *
1232
+ * NOTE: Even though this is an "error" example, it should be well-formed! (E.g. it shouldn't have missing or invalid parameters.)
1233
+ * It demonstrates how to handle network errors and the like, not how to handle malformed requests, since the SDK ensures that requests are well-formed.
1234
+ */
1235
+ errors?: {
1236
+ type: "request";
1237
+ /**
1238
+ * Endpoint to use as the example method, in the format `post /foo/bar/{id}`
1239
+ */
1240
+ endpoint: string;
1241
+ /**
1242
+ * The request params to include in the example.
1243
+ *
1244
+ * e.g.
1245
+ *
1246
+ * params:
1247
+ * query_param: 'foo'
1248
+ * body_param: true
1249
+ * path_param: id
1250
+ */
1251
+ params: {
1252
+ [k: string]: unknown | undefined;
1253
+ };
1254
+ /**
1255
+ * The property on the response to log, e.g. `id` on a `get /accounts` endpoints adds a `console.log(account.id)` or equivalent in the example
1256
+ */
1257
+ response_property?: string;
1258
+ assign_to?: string;
1259
+ } & {
1260
+ example_properties?: {
1261
+ [k: string]: unknown | undefined;
1262
+ };
1263
+ };
1264
+ retries?: {
1265
+ type: "request";
1266
+ /**
1267
+ * Endpoint to use as the example method, in the format `post /foo/bar/{id}`
1268
+ */
1269
+ endpoint: string;
1270
+ /**
1271
+ * The request params to include in the example.
1272
+ *
1273
+ * e.g.
1274
+ *
1275
+ * params:
1276
+ * query_param: 'foo'
1277
+ * body_param: true
1278
+ * path_param: id
1279
+ */
1280
+ params: {
1281
+ [k: string]: unknown | undefined;
1282
+ };
1283
+ /**
1284
+ * The property on the response to log, e.g. `id` on a `get /accounts` endpoints adds a `console.log(account.id)` or equivalent in the example
1285
+ */
1286
+ response_property?: string;
1287
+ assign_to?: string;
1288
+ };
1289
+ nested_params?: {
1290
+ type: "request";
1291
+ /**
1292
+ * Endpoint to use as the example method, in the format `post /foo/bar/{id}`
1293
+ */
1294
+ endpoint: string;
1295
+ /**
1296
+ * The request params to include in the example.
1297
+ *
1298
+ * e.g.
1299
+ *
1300
+ * params:
1301
+ * query_param: 'foo'
1302
+ * body_param: true
1303
+ * path_param: id
1304
+ */
1305
+ params: {
1306
+ [k: string]: unknown | undefined;
1307
+ };
1308
+ /**
1309
+ * The property on the response to log, e.g. `id` on a `get /accounts` endpoints adds a `console.log(account.id)` or equivalent in the example
1310
+ */
1311
+ response_property?: string;
1312
+ assign_to?: string;
1313
+ };
1314
+ http_agent?: {
1315
+ type: "request";
1316
+ /**
1317
+ * Endpoint to use as the example method, in the format `post /foo/bar/{id}`
1318
+ */
1319
+ endpoint: string;
1320
+ /**
1321
+ * The request params to include in the example.
1322
+ *
1323
+ * e.g.
1324
+ *
1325
+ * params:
1326
+ * query_param: 'foo'
1327
+ * body_param: true
1328
+ * path_param: id
1329
+ */
1330
+ params: {
1331
+ [k: string]: unknown | undefined;
1332
+ };
1333
+ /**
1334
+ * The property on the response to log, e.g. `id` on a `get /accounts` endpoints adds a `console.log(account.id)` or equivalent in the example
1335
+ */
1336
+ response_property?: string;
1337
+ assign_to?: string;
1338
+ };
1339
+ raw_response?: {
1340
+ type: "request";
1341
+ /**
1342
+ * Endpoint to use as the example method, in the format `post /foo/bar/{id}`
1343
+ */
1344
+ endpoint: string;
1345
+ /**
1346
+ * The request params to include in the example.
1347
+ *
1348
+ * e.g.
1349
+ *
1350
+ * params:
1351
+ * query_param: 'foo'
1352
+ * body_param: true
1353
+ * path_param: id
1354
+ */
1355
+ params: {
1356
+ [k: string]: unknown | undefined;
1357
+ };
1358
+ /**
1359
+ * The property on the response to log, e.g. `id` on a `get /accounts` endpoints adds a `console.log(account.id)` or equivalent in the example
1360
+ */
1361
+ response_property?: string;
1362
+ assign_to?: string;
1363
+ };
1364
+ timeouts?: {
1365
+ type: "request";
1366
+ /**
1367
+ * Endpoint to use as the example method, in the format `post /foo/bar/{id}`
1368
+ */
1369
+ endpoint: string;
1370
+ /**
1371
+ * The request params to include in the example.
1372
+ *
1373
+ * e.g.
1374
+ *
1375
+ * params:
1376
+ * query_param: 'foo'
1377
+ * body_param: true
1378
+ * path_param: id
1379
+ */
1380
+ params: {
1381
+ [k: string]: unknown | undefined;
1382
+ };
1383
+ /**
1384
+ * The property on the response to log, e.g. `id` on a `get /accounts` endpoints adds a `console.log(account.id)` or equivalent in the example
1385
+ */
1386
+ response_property?: string;
1387
+ assign_to?: string;
1388
+ };
1389
+ default_headers?: {
1390
+ type: "request";
1391
+ /**
1392
+ * Endpoint to use as the example method, in the format `post /foo/bar/{id}`
1393
+ */
1394
+ endpoint: string;
1395
+ /**
1396
+ * The request params to include in the example.
1397
+ *
1398
+ * e.g.
1399
+ *
1400
+ * params:
1401
+ * query_param: 'foo'
1402
+ * body_param: true
1403
+ * path_param: id
1404
+ */
1405
+ params: {
1406
+ [k: string]: unknown | undefined;
1407
+ };
1408
+ /**
1409
+ * The property on the response to log, e.g. `id` on a `get /accounts` endpoints adds a `console.log(account.id)` or equivalent in the example
1410
+ */
1411
+ response_property?: string;
1412
+ assign_to?: string;
1413
+ };
1414
+ pagination?: {
1415
+ type: "request";
1416
+ /**
1417
+ * Endpoint to use as the example method, in the format `post /foo/bar/{id}`
1418
+ */
1419
+ endpoint: string;
1420
+ /**
1421
+ * The request params to include in the example.
1422
+ *
1423
+ * e.g.
1424
+ *
1425
+ * params:
1426
+ * query_param: 'foo'
1427
+ * body_param: true
1428
+ * path_param: id
1429
+ */
1430
+ params: {
1431
+ [k: string]: unknown | undefined;
1432
+ };
1433
+ /**
1434
+ * The property on the response to log, e.g. `id` on a `get /accounts` endpoints adds a `console.log(account.id)` or equivalent in the example
1435
+ */
1436
+ response_property?: string;
1437
+ assign_to?: string;
1438
+ };
1439
+ streaming?: {
1440
+ type: "request";
1441
+ /**
1442
+ * Endpoint to use as the example method, in the format `post /foo/bar/{id}`
1443
+ */
1444
+ endpoint: string;
1445
+ /**
1446
+ * The request params to include in the example.
1447
+ *
1448
+ * e.g.
1449
+ *
1450
+ * params:
1451
+ * query_param: 'foo'
1452
+ * body_param: true
1453
+ * path_param: id
1454
+ */
1455
+ params: {
1456
+ [k: string]: unknown | undefined;
1457
+ };
1458
+ /**
1459
+ * The property on the response to log, e.g. `id` on a `get /accounts` endpoints adds a `console.log(account.id)` or equivalent in the example
1460
+ */
1461
+ response_property?: string;
1462
+ assign_to?: string;
1463
+ };
1464
+ file_uploads?: {
1465
+ type: "request";
1466
+ /**
1467
+ * Endpoint to use as the example method, in the format `post /foo/bar/{id}`
1468
+ */
1469
+ endpoint: string;
1470
+ /**
1471
+ * The request params to include in the example.
1472
+ *
1473
+ * e.g.
1474
+ *
1475
+ * params:
1476
+ * query_param: 'foo'
1477
+ * body_param: true
1478
+ * path_param: id
1479
+ */
1480
+ params: {
1481
+ [k: string]: unknown | undefined;
1482
+ };
1483
+ /**
1484
+ * The property on the response to log, e.g. `id` on a `get /accounts` endpoints adds a `console.log(account.id)` or equivalent in the example
1485
+ */
1486
+ response_property?: string;
1487
+ assign_to?: string;
1488
+ file_param: string;
1489
+ file_path?: string;
1490
+ };
1491
+ };
1492
+ /**
1493
+ * Configuration for the models/types to use for demonstration of how to instantiate and access different types in the SDK.
1494
+ */
1495
+ example_types?: {
1496
+ object?: {
1497
+ type: "model";
1498
+ /**
1499
+ * The dotted path to the model defined in the config.
1500
+ *
1501
+ * For example, a 'transaction' model defined in the 'cards.transactions'
1502
+ * resource would be 'cards.transactions.transaction'
1503
+ */
1504
+ model: string;
1505
+ /**
1506
+ * The property on the model schema to use as an example
1507
+ */
1508
+ property: string;
1509
+ };
1510
+ nullable?: {
1511
+ type: "model";
1512
+ /**
1513
+ * The dotted path to the model defined in the config.
1514
+ *
1515
+ * For example, a 'transaction' model defined in the 'cards.transactions'
1516
+ * resource would be 'cards.transactions.transaction'
1517
+ */
1518
+ model: string;
1519
+ /**
1520
+ * The property on the model schema to use as an example
1521
+ */
1522
+ property: string;
1523
+ };
1524
+ enum?: {
1525
+ type: "model";
1526
+ /**
1527
+ * The dotted path to the model defined in the config.
1528
+ *
1529
+ * For example, a 'transaction' model defined in the 'cards.transactions'
1530
+ * resource would be 'cards.transactions.transaction'
1531
+ */
1532
+ model: string;
1533
+ /**
1534
+ * The enum member to reference in examples
1535
+ */
1536
+ option: string;
1537
+ };
1538
+ union?: {
1539
+ type: "model";
1540
+ /**
1541
+ * The dotted path to the model defined in the config.
1542
+ *
1543
+ * For example, a 'transaction' model defined in the 'cards.transactions'
1544
+ * resource would be 'cards.transactions.transaction'
1545
+ */
1546
+ model: string;
1547
+ /**
1548
+ * The property on the model schema to use as an example
1549
+ */
1550
+ property: string;
1551
+ };
1552
+ intersection?: {
1553
+ type: "model";
1554
+ /**
1555
+ * The dotted path to the model defined in the config.
1556
+ *
1557
+ * For example, a 'transaction' model defined in the 'cards.transactions'
1558
+ * resource would be 'cards.transactions.transaction'
1559
+ */
1560
+ model: string;
1561
+ /**
1562
+ * The property on the model schema to use as an example
1563
+ */
1564
+ property: string;
1565
+ };
1566
+ };
1567
+ };
1568
+ settings?: {
1569
+ /**
1570
+ * License to use in all SDKs (defaults to Apache-2.0)
1571
+ */
1572
+ license?: ("Apache-2.0" | "MIT") | {
1573
+ /**
1574
+ * The name given to this license, should be a valid SPDX identifier
1575
+ */
1576
+ name: string;
1577
+ /**
1578
+ * The license contents.
1579
+ */
1580
+ contents: string;
1581
+ /**
1582
+ * The file extension that the LICENSE file will be generated to
1583
+ */
1584
+ extension?: string;
1585
+ };
1586
+ /**
1587
+ * When `true`, the `security` field on an operation will be respected and the SDK will only
1588
+ * send matching security schemes.
1589
+ *
1590
+ * For example:
1591
+ *
1592
+ * ```yaml
1593
+ * security: [{ BearerAuth: [] }, { APIKeyAuth }]
1594
+ * paths:
1595
+ * /accounts:
1596
+ * post:
1597
+ * security: [{ BearerAuth: [] }]
1598
+ * ```
1599
+ *
1600
+ * By default, if the SDK is given the client option for the `APIKeyAuth` scheme, then it will happily send it.
1601
+ *
1602
+ * When `per_endpoint_security` is set to `true`, the SDK will *only* try and send the `BearerAuth` header.
1603
+ */
1604
+ per_endpoint_security?: boolean;
1605
+ /**
1606
+ * Custom header to add at the top of all generated SDK files.
1607
+ *
1608
+ * The header will be added as a comment at the very top of each generated file,
1609
+ * before the "File generated from our OpenAPI spec by Stainless" line.
1610
+ * Each language will use its appropriate comment syntax automatically.
1611
+ *
1612
+ * Example usage for copyright headers:
1613
+ * ~~~yaml
1614
+ * settings:
1615
+ * file_header: |
1616
+ * Copyright (c) 2025 ACME Corporation.
1617
+ * All rights reserved.
1618
+ *
1619
+ * This source code is licensed under the terms described in the LICENSE file in
1620
+ * the root directory of this source tree.
1621
+ * ~~~
1622
+ *
1623
+ * The above will generate (in TypeScript):
1624
+ * ~~~ts
1625
+ * // Copyright (c) 2025 ACME Corporation.
1626
+ * // All rights reserved.
1627
+ * //
1628
+ * // This source code is licensed under the terms described in the LICENSE file in
1629
+ * // the root directory of this source tree.
1630
+ * // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
1631
+ * ~~~
1632
+ */
1633
+ file_header?: string;
1634
+ python?: {
1635
+ /**
1636
+ * The license classifier to use in the Python package metadata. https://pypi.org/classifiers/
1637
+ */
1638
+ license_classifier?: string;
1639
+ };
1640
+ /**
1641
+ * If set to true, all generated integration tests that hit the [prism mock http server](https://stoplight.io/open-source/prism) are marked as skipped.
1642
+ */
1643
+ disable_mock_tests?: boolean;
1644
+ /**
1645
+ * Deprecated: same as disable_mock_tests but kept around for backward compatibility reasons
1646
+ */
1647
+ disable_tests?: boolean;
1648
+ /**
1649
+ * Response envelopes, like a top-level "data" field, can be described here with [data]
1650
+ */
1651
+ unwrap_response_fields?: string[];
1652
+ /**
1653
+ * If specified as false, then we disable positional params for the entire SDK.
1654
+ */
1655
+ positional_params?: false;
1656
+ };
1657
+ /**
1658
+ * Query string serialization options.
1659
+ */
1660
+ query_settings?: {
1661
+ /**
1662
+ * Configures how query parameters with nested objects render in the query string. Accepted values are `brackets` (the default) and `dots`.
1663
+ *
1664
+ * Example object: `{ a: { b: "c" } }`
1665
+ *
1666
+ * - brackets syntax -> `a[b]=c`
1667
+ * - dot syntax -> `a.b=c`
1668
+ */
1669
+ nested_format?: "dots" | "brackets";
1670
+ /**
1671
+ * Configures how query parameters with array values render in the query string. Accepted values are `brackets`, `comma` (the default), and `repeat`.
1672
+ *
1673
+ * Example object: `{ in: ["foo", "bar"] }`
1674
+ *
1675
+ * - brackets syntax -> `in[]=foo&in[]=bar`
1676
+ * - comma syntax -> `in=foo,bar`
1677
+ * - repeat syntax -> `in=foo&in=bar`
1678
+ */
1679
+ array_format?: "comma" | "repeat" | "indices" | "brackets";
1680
+ };
1681
+ /**
1682
+ * Overrides the top-level security key in the OpenAPI spec.
1683
+ */
1684
+ security?: {
1685
+ [k: string]: string[] | undefined;
1686
+ }[];
1687
+ /**
1688
+ * Overrides the `components.securitySchemes` in the OpenAPI spec.
1689
+ */
1690
+ security_schemes?: {
1691
+ [k: string]: ({
1692
+ type: "http";
1693
+ description?: string;
1694
+ scheme: "bearer";
1695
+ bearerFormat?: string;
1696
+ "x-stainless-auth"?: {
1697
+ scheme_keyword?: string;
1698
+ };
1699
+ } | {
1700
+ type: "http";
1701
+ description?: string;
1702
+ scheme: "basic";
1703
+ "x-stainless-auth"?: {
1704
+ disable_base64?: boolean;
1705
+ scheme_keyword?: string;
1706
+ };
1707
+ } | {
1708
+ type: "http";
1709
+ description?: string;
1710
+ scheme: "digest";
1711
+ "x-stainless-auth"?: {
1712
+ scheme_keyword?: string;
1713
+ };
1714
+ } | {
1715
+ type: "apiKey";
1716
+ description?: string;
1717
+ in?: "header" | "query";
1718
+ name: string;
1719
+ } | {
1720
+ type: "oauth2";
1721
+ description?: string;
1722
+ flows: {
1723
+ implicit?: {
1724
+ authorizationUrl: string;
1725
+ refreshUrl?: string;
1726
+ scopes: {
1727
+ [k: string]: string | undefined;
1728
+ };
1729
+ };
1730
+ password?: {
1731
+ tokenUrl: string;
1732
+ refreshUrl?: string;
1733
+ scopes: {
1734
+ [k: string]: string | undefined;
1735
+ };
1736
+ };
1737
+ clientCredentials?: {
1738
+ tokenUrl: string;
1739
+ refreshUrl?: string;
1740
+ scopes: {
1741
+ [k: string]: string | undefined;
1742
+ };
1743
+ };
1744
+ authorizationCode?: {
1745
+ authorizationUrl: string;
1746
+ tokenUrl: string;
1747
+ refreshUrl?: string;
1748
+ scopes: {
1749
+ [k: string]: string | undefined;
1750
+ };
1751
+ };
1752
+ };
1753
+ }) | undefined;
1754
+ };
1755
+ /**
1756
+ * Settings for customizing the [Client class](https://www.stainless.com/docs/configure/client) in the SDKs.
1757
+ */
1758
+ client_settings?: {
1759
+ /**
1760
+ * Extra arguments that the client accepts, such as an API key.
1761
+ *
1762
+ * Learn more: https://www.stainless.com/docs/configure/client#client-opts
1763
+ */
1764
+ opts?: {
1765
+ [k: string]: {
1766
+ type: "boolean" | "number" | "string" | "integer";
1767
+ /**
1768
+ * Description used for this option in the generated SDKs
1769
+ */
1770
+ description?: string;
1771
+ /**
1772
+ * Example value used in tests or example snippets
1773
+ */
1774
+ example?: {
1775
+ [k: string]: unknown | undefined;
1776
+ };
1777
+ /**
1778
+ * Default value to use if no value provided by the user
1779
+ */
1780
+ default?: {
1781
+ [k: string]: unknown | undefined;
1782
+ };
1783
+ /**
1784
+ * Whether this client option is required
1785
+ */
1786
+ nullable?: boolean;
1787
+ /**
1788
+ * Environment variable that this option should read from
1789
+ */
1790
+ read_env?: string;
1791
+ /**
1792
+ * Configure [authentication](https://www.stainless.com/docs/guides/configure#authentication) for this client option.
1793
+ */
1794
+ auth?: {
1795
+ security_scheme: string;
1796
+ role?: "value" | "username" | "password" | "client_id" | "client_secret";
1797
+ };
1798
+ /**
1799
+ * Links this client option to a variable in the url configured by `environments`.
1800
+ *
1801
+ * ~~~yaml
1802
+ * environments:
1803
+ * production: https://{region}.acme.com
1804
+ * ~~~
1805
+ *
1806
+ * Then `server_variable: "region"` will mean the value of the `{region}` will be replaced by the value of this client option.
1807
+ */
1808
+ server_variable?: string;
1809
+ /**
1810
+ * Send the value given to this option in a header on every request
1811
+ */
1812
+ send_in_header?: string;
1813
+ /**
1814
+ * Whether to provide this argument in unit tests. Set to true if this argument is required for internal request tests to run successfully
1815
+ */
1816
+ required_in_tests?: boolean;
1817
+ } | undefined;
1818
+ };
1819
+ /**
1820
+ * Configure [idempotency behaviour](https://www.stainless.com/docs/configure/client#idempotency-key)
1821
+ */
1822
+ idempotency?: {
1823
+ /**
1824
+ * Header to send the idempotency token in
1825
+ */
1826
+ header: string;
1827
+ };
1828
+ /**
1829
+ * Headers sent with every API request
1830
+ */
1831
+ default_headers?: {
1832
+ [k: string]: string | undefined;
1833
+ };
1834
+ /**
1835
+ * Configure the [default timeout for client calls](https://www.stainless.com/docs/configure/client#timeouts), in milliseconds or ISO 8601 (default is 60 seconds)
1836
+ */
1837
+ default_timeout?: number | string;
1838
+ /**
1839
+ * Default [retry settings](https://www.stainless.com/docs/configure/client#retries) for all endpoints.
1840
+ */
1841
+ default_retries?: {
1842
+ /**
1843
+ * Maximum number of times to retry for all endpoints. Use 0 to disable retries.
1844
+ */
1845
+ max_retries: number;
1846
+ /**
1847
+ * Seconds to wait before the first retry.
1848
+ */
1849
+ initial_delay_seconds: number;
1850
+ /**
1851
+ * We increase the retry time with exponential backoff, each retry taking twice as long as the last, until this value of max seconds to retry.
1852
+ */
1853
+ max_delay_seconds: number;
1854
+ };
1855
+ };
1856
+ /**
1857
+ * Defines pagination schemes for pagination helpers and auto-pagination in the SDKs.
1858
+ */
1859
+ pagination?: {
1860
+ description?: string;
1861
+ type: "cursor" | "cursor_id" | "cursor_url" | "fake_page" | "offset" | "page_number";
1862
+ request: {
1863
+ [k: string]: unknown | undefined;
1864
+ };
1865
+ response: {
1866
+ [k: string]: unknown | undefined;
1867
+ };
1868
+ param_location?: "query" | "body";
1869
+ /**
1870
+ * If set to true, the auto pagination helpers will continue to fetch pages even if there are no items returned, and will only stop when it is impossible to fetch another page
1871
+ */
1872
+ continue_on_empty_items?: boolean;
1873
+ } | {
1874
+ name: string;
1875
+ description?: string;
1876
+ type: "cursor" | "cursor_id" | "cursor_url" | "fake_page" | "offset" | "page_number";
1877
+ request: {
1878
+ [k: string]: unknown | undefined;
1879
+ };
1880
+ response: {
1881
+ [k: string]: unknown | undefined;
1882
+ };
1883
+ param_location?: "query" | "body";
1884
+ /**
1885
+ * If set to true, the auto pagination helpers will continue to fetch pages even if there are no items returned, and will only stop when it is impossible to fetch another page
1886
+ */
1887
+ continue_on_empty_items?: boolean;
1888
+ }[];
1889
+ /**
1890
+ * List of endpoints to explicitly ignore, such as `["post /internal_endpoint", "get /redundant_endpoint"]`
1891
+ */
1892
+ unspecified_endpoints?: string[];
1893
+ /**
1894
+ * Configures various codeflow (automated releases to package managers) options.
1895
+ */
1896
+ codeflow?: {
1897
+ /**
1898
+ * GitHub environment to run the release workflow in.
1899
+ */
1900
+ release_environment?: string;
1901
+ /**
1902
+ * Whether publishing to package managers should be included in GitHub automations.
1903
+ */
1904
+ publish_packages?: boolean;
1905
+ /**
1906
+ * List of default reviewers to assign to a customer release PR
1907
+ */
1908
+ reviewers?: string[];
1909
+ /**
1910
+ * Github CODEOWNERS file content to add to SDK repositories
1911
+ *
1912
+ * Example:
1913
+ *
1914
+ * code_owners:
1915
+ * '*': ['@acme/sdk-team-1']
1916
+ * 'src/**': ['@acme/sdk-team-2']
1917
+ */
1918
+ code_owners?: {
1919
+ [k: string]: string[] | undefined;
1920
+ };
1921
+ };
1922
+ /**
1923
+ * Defines how phrases are rendered in different SDKs. Can be either an 'initialism' which tells the generator to treat the word as an abbreviation like 'API' or 'CPU', or a more powerful `CasingConfig` which can specify how that word is represented in the different casing formats. In rare cases where customization of pluralization is required, you can also specify singular/plural versions of the word.
1924
+ */
1925
+ custom_casings?: {
1926
+ [k: string]: ({
1927
+ /**
1928
+ * If set to true, the term is used as an initialism: treated as an abbreviation of initial letters (for example, "CPU" and "API").
1929
+ * If set to false, the term is removed from the set of initialisms.
1930
+ *
1931
+ * By default we use `[3ds, ach, acl, ai, api, ats, cpu, crm, db, dns, e2e, eeoc, gb, gpu, hd, hris, html, http, https, id, ip, iso, jsonl, kb, kyb, kyc, lfs, mb, mp3, mp4, nft, saml, sdk, sku, sms, ss, ssh, sso, url]` as initialisms.
1932
+ */
1933
+ initialism: boolean;
1934
+ } | {
1935
+ /**
1936
+ * Term rendered with lowercase characters separated by underscores (for example, "payment_method").
1937
+ */
1938
+ snake: string;
1939
+ /**
1940
+ * Term rendered with the first character of each word capitalized and joined together (for example, "PaymentMethod").
1941
+ */
1942
+ pascal: string;
1943
+ /**
1944
+ * Term rendered with the first character of each word capitalized and separated by a space (for example, "Payment Method").
1945
+ */
1946
+ capital: string;
1947
+ /**
1948
+ * Term rendered with the first word in lowercase, followed by the first character of each subsequent word capitalized and joined together (for example, "paymentMethod").
1949
+ */
1950
+ camel: string;
1951
+ } | {
1952
+ singular: {
1953
+ /**
1954
+ * Term rendered with lowercase characters separated by underscores (for example, "payment_method").
1955
+ */
1956
+ snake: string;
1957
+ /**
1958
+ * Term rendered with the first character of each word capitalized and joined together (for example, "PaymentMethod").
1959
+ */
1960
+ pascal: string;
1961
+ /**
1962
+ * Term rendered with the first character of each word capitalized and separated by a space (for example, "Payment Method").
1963
+ */
1964
+ capital: string;
1965
+ /**
1966
+ * Term rendered with the first word in lowercase, followed by the first character of each subsequent word capitalized and joined together (for example, "paymentMethod").
1967
+ */
1968
+ camel: string;
1969
+ };
1970
+ plural: {
1971
+ /**
1972
+ * Term rendered with lowercase characters separated by underscores (for example, "payment_method").
1973
+ */
1974
+ snake: string;
1975
+ /**
1976
+ * Term rendered with the first character of each word capitalized and joined together (for example, "PaymentMethod").
1977
+ */
1978
+ pascal: string;
1979
+ /**
1980
+ * Term rendered with the first character of each word capitalized and separated by a space (for example, "Payment Method").
1981
+ */
1982
+ capital: string;
1983
+ /**
1984
+ * Term rendered with the first word in lowercase, followed by the first character of each subsequent word capitalized and joined together (for example, "paymentMethod").
1985
+ */
1986
+ camel: string;
1987
+ };
1988
+ }) | undefined;
1989
+ };
1990
+ /**
1991
+ * Describes changes to the input OpenAPI spec and also whether or not to add code samples to the output OpenAPI spec.
1992
+ */
1993
+ openapi?: {
1994
+ /**
1995
+ * List of transforms to apply to the OpenAPI spec before SDK generation. See the transforms reference for available commands.
1996
+ */
1997
+ transforms?: ({
1998
+ command: "update";
1999
+ reason: string;
2000
+ /**
2001
+ * Replace values at existing paths. Fails if path doesn't exist.
2002
+ *
2003
+ * Supports `{{value}}` templating for string manipulation. Supports `matches_schema` for finding duplicate schemas.
2004
+ *
2005
+ * Examples:
2006
+ * ~~~yaml
2007
+ * # Fix incorrect type with filter
2008
+ * - command: update
2009
+ * reason: "Account IDs are strings"
2010
+ * args:
2011
+ * target: '$.paths..parameters[?(@.name == "account_id")].schema.type'
2012
+ * value: "string"
2013
+ *
2014
+ * # String templating: append text
2015
+ * - command: update
2016
+ * reason: "Add deprecation notice"
2017
+ * args:
2018
+ * target: "$.components.schemas.LegacyUser.description"
2019
+ * value: "{{value}}\n\nDEPRECATED: Use NewUser instead"
2020
+ * template: true
2021
+ *
2022
+ * # Schema matching: replace duplicates
2023
+ * - command: update
2024
+ * reason: "Replace duplicate error schemas with $ref"
2025
+ * args:
2026
+ * target:
2027
+ * - matches_schema: $.components.schemas.ErrorTemplate
2028
+ * ignore: $.components.schemas.ErrorTemplate
2029
+ * value:
2030
+ * $ref: "#/components/schemas/Error"
2031
+ * ~~~
2032
+ */
2033
+ args: {
2034
+ /**
2035
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to the value(s) to replace. Can be a string, array of strings, or array mixing strings with matches_schema queries.
2036
+ */
2037
+ target: string | (string | {
2038
+ /**
2039
+ * JSONPath to template schema. Finds all schemas that deep-equal this one.
2040
+ */
2041
+ matches_schema: string;
2042
+ /**
2043
+ * Path(s) to exclude from matching (e.g., the template itself).
2044
+ */
2045
+ ignore?: string | string[];
2046
+ })[];
2047
+ /**
2048
+ * The new value to set at the target location(s).
2049
+ */
2050
+ value: {
2051
+ [k: string]: unknown | undefined;
2052
+ };
2053
+ /**
2054
+ * If true, enables {{value}} substitution in string values. Use for appending/prepending to strings. Example: "{{value}}\nAdditional notes" or "[BETA] {{value}}". Requires value to contain {{value}} and target to be a string.
2055
+ */
2056
+ template?: boolean;
2057
+ };
2058
+ } | {
2059
+ command: "append";
2060
+ reason: string;
2061
+ /**
2062
+ * Add items to arrays or add new properties to objects. Attempting to add a property that already exists will fail. This alerts you when the spec is fixed.
2063
+ *
2064
+ * Use for temporary fixes. For intentional overrides, use merge.
2065
+ *
2066
+ * Examples:
2067
+ * ~~~yaml
2068
+ * # Add to array
2069
+ * - command: append
2070
+ * reason: "Add id to required fields"
2071
+ * args:
2072
+ * target: "$.components.schemas.User.required"
2073
+ * value: "id"
2074
+ *
2075
+ * # Add property (fails if exists)
2076
+ * - command: append
2077
+ * reason: "API spec missing id field, adding temporarily"
2078
+ * args:
2079
+ * target: "$.components.schemas.User.properties"
2080
+ * value:
2081
+ * id:
2082
+ * type: "string"
2083
+ * format: "uuid"
2084
+ * ~~~
2085
+ */
2086
+ args: {
2087
+ /**
2088
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to array(s) or object(s) to append to. Can be a string, array of strings, or array mixing strings with matches_schema queries.
2089
+ */
2090
+ target: string | (string | {
2091
+ /**
2092
+ * JSONPath to template schema. Finds all schemas that deep-equal this one.
2093
+ */
2094
+ matches_schema: string;
2095
+ /**
2096
+ * Path(s) to exclude from matching (e.g., the template itself).
2097
+ */
2098
+ ignore?: string | string[];
2099
+ })[];
2100
+ /**
2101
+ * For arrays: item(s) to push. For objects: properties to add (fails if property already exists).
2102
+ */
2103
+ value: {
2104
+ [k: string]: unknown | undefined;
2105
+ };
2106
+ };
2107
+ } | {
2108
+ command: "merge";
2109
+ reason: string;
2110
+ /**
2111
+ * Merge an object into targets. Overwrites existing properties. Uses deep merge, so nested objects are merged recursively.
2112
+ *
2113
+ * Use for permanent overrides like x-stainless-naming or x-stainless-skip. For temporary fixes, use append.
2114
+ *
2115
+ * Examples:
2116
+ * ~~~yaml
2117
+ * # Add x-stainless extension
2118
+ * - command: merge
2119
+ * reason: "Terraform doesn't need pagination params"
2120
+ * args:
2121
+ * target: '$..parameters[?(@.name == "limit")]'
2122
+ * value:
2123
+ * schema:
2124
+ * x-stainless-skip: ["terraform"]
2125
+ *
2126
+ * # Set language-specific naming
2127
+ * - command: merge
2128
+ * reason: "Avoid Python parameter conflict"
2129
+ * args:
2130
+ * target: "$.components.schemas.Request.properties.timeout"
2131
+ * value:
2132
+ * x-stainless-naming:
2133
+ * python:
2134
+ * method_argument: "api_timeout"
2135
+ * ~~~
2136
+ */
2137
+ args: {
2138
+ /**
2139
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to object(s) to merge into. Can be a string, array of strings, or array mixing strings with matches_schema queries.
2140
+ */
2141
+ target: string | (string | {
2142
+ /**
2143
+ * JSONPath to template schema. Finds all schemas that deep-equal this one.
2144
+ */
2145
+ matches_schema: string;
2146
+ /**
2147
+ * Path(s) to exclude from matching (e.g., the template itself).
2148
+ */
2149
+ ignore?: string | string[];
2150
+ })[];
2151
+ /**
2152
+ * The object to deep merge into the target location(s). Properties from this object will be merged into existing properties.
2153
+ */
2154
+ value: {
2155
+ [k: string]: unknown | undefined;
2156
+ };
2157
+ };
2158
+ } | {
2159
+ command: "remove";
2160
+ reason: string;
2161
+ /**
2162
+ * Delete nodes or specific keys from objects.
2163
+ *
2164
+ * Examples:
2165
+ * ~~~yaml
2166
+ * # Remove nodes
2167
+ * - command: remove
2168
+ * reason: "Remove problematic examples"
2169
+ * args:
2170
+ * target:
2171
+ * - "$.paths.*.*.examples"
2172
+ * - "$.components.schemas.*.example"
2173
+ *
2174
+ * # Remove specific keys
2175
+ * - command: remove
2176
+ * reason: "Remove incorrect default"
2177
+ * args:
2178
+ * target: "$.components.schemas.User.properties.role"
2179
+ * keys: ["default"]
2180
+ *
2181
+ * # Remove with filter
2182
+ * - command: remove
2183
+ * reason: "Remove deprecated parameters"
2184
+ * args:
2185
+ * target: '$.paths..parameters[?(@.deprecated == true)]'
2186
+ * ~~~
2187
+ */
2188
+ args: {
2189
+ /**
2190
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to the node(s) to remove. Can be a string, array of strings, or array mixing strings with matches_schema queries.
2191
+ */
2192
+ target: string | (string | {
2193
+ /**
2194
+ * JSONPath to template schema. Finds all schemas that deep-equal this one.
2195
+ */
2196
+ matches_schema: string;
2197
+ /**
2198
+ * Path(s) to exclude from matching (e.g., the template itself).
2199
+ */
2200
+ ignore?: string | string[];
2201
+ })[];
2202
+ /**
2203
+ * If target points to an object, remove these specific keys from the object. If not provided, removes the entire target node.
2204
+ */
2205
+ keys?: string[];
2206
+ };
2207
+ } | {
2208
+ command: "copy";
2209
+ reason: string;
2210
+ /**
2211
+ * Copy a value to one or more destinations. Creates destination if parent exists. The source value is deep cloned to each destination.
2212
+ *
2213
+ * Examples:
2214
+ * ~~~yaml
2215
+ * # Copy schema
2216
+ * - command: copy
2217
+ * reason: "Duplicate User schema"
2218
+ * args:
2219
+ * from: "$.components.schemas.User"
2220
+ * to: "$.components.schemas.Admin"
2221
+ *
2222
+ * # Copy to multiple destinations
2223
+ * - command: copy
2224
+ * reason: "Reuse error schema"
2225
+ * args:
2226
+ * from: "$.components.schemas.NotFoundError"
2227
+ * to:
2228
+ * - "$.paths./users/{id}.get.responses.404.content.application/json.schema"
2229
+ * - "$.paths./posts/{id}.get.responses.404.content.application/json.schema"
2230
+ * ~~~
2231
+ */
2232
+ args: {
2233
+ /**
2234
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to the source value to copy. Must match exactly one node.
2235
+ */
2236
+ from: string;
2237
+ /**
2238
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to the destination(s). Can be a string, array of strings, or array mixing strings with matches_schema queries. If destination doesn't exist, creates it (parent must exist).
2239
+ */
2240
+ to: string | (string | {
2241
+ /**
2242
+ * JSONPath to template schema. Finds all schemas that deep-equal this one.
2243
+ */
2244
+ matches_schema: string;
2245
+ /**
2246
+ * Path(s) to exclude from matching (e.g., the template itself).
2247
+ */
2248
+ ignore?: string | string[];
2249
+ })[];
2250
+ };
2251
+ } | {
2252
+ command: "move";
2253
+ reason: string;
2254
+ /**
2255
+ * Move or rename a value from one location to another.
2256
+ *
2257
+ * If `from` and `to` share the same parent the node will be renamed. Otherwise it will be relocated.
2258
+ * Only accept a single source and destination target.
2259
+ *
2260
+ * Examples:
2261
+ * ~~~yaml
2262
+ * # Rename a schema key
2263
+ * - command: move
2264
+ * reason: "Normalize schema name to PascalCase"
2265
+ * args:
2266
+ * from: "$.components.schemas.user_response"
2267
+ * to: "$.components.schemas.UserResponse"
2268
+ *
2269
+ * # Move property between schemas
2270
+ * - command: move
2271
+ * reason: "Relocate userId from Request to User schema"
2272
+ * args:
2273
+ * from: "$.components.schemas.Request.properties.userId"
2274
+ * to: "$.components.schemas.User.properties.id"
2275
+ * ~~~
2276
+ */
2277
+ args: {
2278
+ /**
2279
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to the source value to move. Must match exactly one node.
2280
+ */
2281
+ from: string;
2282
+ /**
2283
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to the destination. The parent of the target should exist.
2284
+ */
2285
+ to: string;
2286
+ };
2287
+ })[];
2288
+ /**
2289
+ * Deprecated: use `transforms` instead.
2290
+ */
2291
+ transformations?: ({
2292
+ command: "update";
2293
+ reason: string;
2294
+ /**
2295
+ * Replace values at existing paths. Fails if path doesn't exist.
2296
+ *
2297
+ * Supports `{{value}}` templating for string manipulation. Supports `matches_schema` for finding duplicate schemas.
2298
+ *
2299
+ * Examples:
2300
+ * ~~~yaml
2301
+ * # Fix incorrect type with filter
2302
+ * - command: update
2303
+ * reason: "Account IDs are strings"
2304
+ * args:
2305
+ * target: '$.paths..parameters[?(@.name == "account_id")].schema.type'
2306
+ * value: "string"
2307
+ *
2308
+ * # String templating: append text
2309
+ * - command: update
2310
+ * reason: "Add deprecation notice"
2311
+ * args:
2312
+ * target: "$.components.schemas.LegacyUser.description"
2313
+ * value: "{{value}}\n\nDEPRECATED: Use NewUser instead"
2314
+ * template: true
2315
+ *
2316
+ * # Schema matching: replace duplicates
2317
+ * - command: update
2318
+ * reason: "Replace duplicate error schemas with $ref"
2319
+ * args:
2320
+ * target:
2321
+ * - matches_schema: $.components.schemas.ErrorTemplate
2322
+ * ignore: $.components.schemas.ErrorTemplate
2323
+ * value:
2324
+ * $ref: "#/components/schemas/Error"
2325
+ * ~~~
2326
+ */
2327
+ args: {
2328
+ /**
2329
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to the value(s) to replace. Can be a string, array of strings, or array mixing strings with matches_schema queries.
2330
+ */
2331
+ target: string | (string | {
2332
+ /**
2333
+ * JSONPath to template schema. Finds all schemas that deep-equal this one.
2334
+ */
2335
+ matches_schema: string;
2336
+ /**
2337
+ * Path(s) to exclude from matching (e.g., the template itself).
2338
+ */
2339
+ ignore?: string | string[];
2340
+ })[];
2341
+ /**
2342
+ * The new value to set at the target location(s).
2343
+ */
2344
+ value: {
2345
+ [k: string]: unknown | undefined;
2346
+ };
2347
+ /**
2348
+ * If true, enables {{value}} substitution in string values. Use for appending/prepending to strings. Example: "{{value}}\nAdditional notes" or "[BETA] {{value}}". Requires value to contain {{value}} and target to be a string.
2349
+ */
2350
+ template?: boolean;
2351
+ };
2352
+ } | {
2353
+ command: "append";
2354
+ reason: string;
2355
+ /**
2356
+ * Add items to arrays or add new properties to objects. Attempting to add a property that already exists will fail. This alerts you when the spec is fixed.
2357
+ *
2358
+ * Use for temporary fixes. For intentional overrides, use merge.
2359
+ *
2360
+ * Examples:
2361
+ * ~~~yaml
2362
+ * # Add to array
2363
+ * - command: append
2364
+ * reason: "Add id to required fields"
2365
+ * args:
2366
+ * target: "$.components.schemas.User.required"
2367
+ * value: "id"
2368
+ *
2369
+ * # Add property (fails if exists)
2370
+ * - command: append
2371
+ * reason: "API spec missing id field, adding temporarily"
2372
+ * args:
2373
+ * target: "$.components.schemas.User.properties"
2374
+ * value:
2375
+ * id:
2376
+ * type: "string"
2377
+ * format: "uuid"
2378
+ * ~~~
2379
+ */
2380
+ args: {
2381
+ /**
2382
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to array(s) or object(s) to append to. Can be a string, array of strings, or array mixing strings with matches_schema queries.
2383
+ */
2384
+ target: string | (string | {
2385
+ /**
2386
+ * JSONPath to template schema. Finds all schemas that deep-equal this one.
2387
+ */
2388
+ matches_schema: string;
2389
+ /**
2390
+ * Path(s) to exclude from matching (e.g., the template itself).
2391
+ */
2392
+ ignore?: string | string[];
2393
+ })[];
2394
+ /**
2395
+ * For arrays: item(s) to push. For objects: properties to add (fails if property already exists).
2396
+ */
2397
+ value: {
2398
+ [k: string]: unknown | undefined;
2399
+ };
2400
+ };
2401
+ } | {
2402
+ command: "merge";
2403
+ reason: string;
2404
+ /**
2405
+ * Merge an object into targets. Overwrites existing properties. Uses deep merge, so nested objects are merged recursively.
2406
+ *
2407
+ * Use for permanent overrides like x-stainless-naming or x-stainless-skip. For temporary fixes, use append.
2408
+ *
2409
+ * Examples:
2410
+ * ~~~yaml
2411
+ * # Add x-stainless extension
2412
+ * - command: merge
2413
+ * reason: "Terraform doesn't need pagination params"
2414
+ * args:
2415
+ * target: '$..parameters[?(@.name == "limit")]'
2416
+ * value:
2417
+ * schema:
2418
+ * x-stainless-skip: ["terraform"]
2419
+ *
2420
+ * # Set language-specific naming
2421
+ * - command: merge
2422
+ * reason: "Avoid Python parameter conflict"
2423
+ * args:
2424
+ * target: "$.components.schemas.Request.properties.timeout"
2425
+ * value:
2426
+ * x-stainless-naming:
2427
+ * python:
2428
+ * method_argument: "api_timeout"
2429
+ * ~~~
2430
+ */
2431
+ args: {
2432
+ /**
2433
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to object(s) to merge into. Can be a string, array of strings, or array mixing strings with matches_schema queries.
2434
+ */
2435
+ target: string | (string | {
2436
+ /**
2437
+ * JSONPath to template schema. Finds all schemas that deep-equal this one.
2438
+ */
2439
+ matches_schema: string;
2440
+ /**
2441
+ * Path(s) to exclude from matching (e.g., the template itself).
2442
+ */
2443
+ ignore?: string | string[];
2444
+ })[];
2445
+ /**
2446
+ * The object to deep merge into the target location(s). Properties from this object will be merged into existing properties.
2447
+ */
2448
+ value: {
2449
+ [k: string]: unknown | undefined;
2450
+ };
2451
+ };
2452
+ } | {
2453
+ command: "remove";
2454
+ reason: string;
2455
+ /**
2456
+ * Delete nodes or specific keys from objects.
2457
+ *
2458
+ * Examples:
2459
+ * ~~~yaml
2460
+ * # Remove nodes
2461
+ * - command: remove
2462
+ * reason: "Remove problematic examples"
2463
+ * args:
2464
+ * target:
2465
+ * - "$.paths.*.*.examples"
2466
+ * - "$.components.schemas.*.example"
2467
+ *
2468
+ * # Remove specific keys
2469
+ * - command: remove
2470
+ * reason: "Remove incorrect default"
2471
+ * args:
2472
+ * target: "$.components.schemas.User.properties.role"
2473
+ * keys: ["default"]
2474
+ *
2475
+ * # Remove with filter
2476
+ * - command: remove
2477
+ * reason: "Remove deprecated parameters"
2478
+ * args:
2479
+ * target: '$.paths..parameters[?(@.deprecated == true)]'
2480
+ * ~~~
2481
+ */
2482
+ args: {
2483
+ /**
2484
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to the node(s) to remove. Can be a string, array of strings, or array mixing strings with matches_schema queries.
2485
+ */
2486
+ target: string | (string | {
2487
+ /**
2488
+ * JSONPath to template schema. Finds all schemas that deep-equal this one.
2489
+ */
2490
+ matches_schema: string;
2491
+ /**
2492
+ * Path(s) to exclude from matching (e.g., the template itself).
2493
+ */
2494
+ ignore?: string | string[];
2495
+ })[];
2496
+ /**
2497
+ * If target points to an object, remove these specific keys from the object. If not provided, removes the entire target node.
2498
+ */
2499
+ keys?: string[];
2500
+ };
2501
+ } | {
2502
+ command: "copy";
2503
+ reason: string;
2504
+ /**
2505
+ * Copy a value to one or more destinations. Creates destination if parent exists. The source value is deep cloned to each destination.
2506
+ *
2507
+ * Examples:
2508
+ * ~~~yaml
2509
+ * # Copy schema
2510
+ * - command: copy
2511
+ * reason: "Duplicate User schema"
2512
+ * args:
2513
+ * from: "$.components.schemas.User"
2514
+ * to: "$.components.schemas.Admin"
2515
+ *
2516
+ * # Copy to multiple destinations
2517
+ * - command: copy
2518
+ * reason: "Reuse error schema"
2519
+ * args:
2520
+ * from: "$.components.schemas.NotFoundError"
2521
+ * to:
2522
+ * - "$.paths./users/{id}.get.responses.404.content.application/json.schema"
2523
+ * - "$.paths./posts/{id}.get.responses.404.content.application/json.schema"
2524
+ * ~~~
2525
+ */
2526
+ args: {
2527
+ /**
2528
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to the source value to copy. Must match exactly one node.
2529
+ */
2530
+ from: string;
2531
+ /**
2532
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to the destination(s). Can be a string, array of strings, or array mixing strings with matches_schema queries. If destination doesn't exist, creates it (parent must exist).
2533
+ */
2534
+ to: string | (string | {
2535
+ /**
2536
+ * JSONPath to template schema. Finds all schemas that deep-equal this one.
2537
+ */
2538
+ matches_schema: string;
2539
+ /**
2540
+ * Path(s) to exclude from matching (e.g., the template itself).
2541
+ */
2542
+ ignore?: string | string[];
2543
+ })[];
2544
+ };
2545
+ } | {
2546
+ command: "move";
2547
+ reason: string;
2548
+ /**
2549
+ * Move or rename a value from one location to another.
2550
+ *
2551
+ * If `from` and `to` share the same parent the node will be renamed. Otherwise it will be relocated.
2552
+ * Only accept a single source and destination target.
2553
+ *
2554
+ * Examples:
2555
+ * ~~~yaml
2556
+ * # Rename a schema key
2557
+ * - command: move
2558
+ * reason: "Normalize schema name to PascalCase"
2559
+ * args:
2560
+ * from: "$.components.schemas.user_response"
2561
+ * to: "$.components.schemas.UserResponse"
2562
+ *
2563
+ * # Move property between schemas
2564
+ * - command: move
2565
+ * reason: "Relocate userId from Request to User schema"
2566
+ * args:
2567
+ * from: "$.components.schemas.Request.properties.userId"
2568
+ * to: "$.components.schemas.User.properties.id"
2569
+ * ~~~
2570
+ */
2571
+ args: {
2572
+ /**
2573
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to the source value to move. Must match exactly one node.
2574
+ */
2575
+ from: string;
2576
+ /**
2577
+ * A [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) query pointing to the destination. The parent of the target should exist.
2578
+ */
2579
+ to: string;
2580
+ };
2581
+ })[];
2582
+ /**
2583
+ * Defines automatic snippet generation directly into your OpenAPI spec.
2584
+ *
2585
+ * Supported providers:
2586
+ * - [readme](https://readme.com/)
2587
+ * - [x-codeSamples](https://redocly.com/docs/api-reference-docs/specification-extensions/x-code-samples/)
2588
+ * - [bump.sh](https://bump.sh/), alias for `x-codeSamples`
2589
+ * - [gitbook](https://www.gitbook.com/), alias for `x-codeSamples`
2590
+ * - [redocly](https://redocly.com/), alias for `x-codeSamples`
2591
+ * - [mintlify](https://mintlify.com/), alias for `x-codeSamples`
2592
+ * - stainless, adds `x-stainless-snippets`
2593
+ */
2594
+ code_samples?: {
2595
+ /**
2596
+ * adds `x-readme.samples-languages`
2597
+ */
2598
+ readme?: boolean;
2599
+ /**
2600
+ * alias for `x-codeSamples`
2601
+ */
2602
+ redocly?: boolean;
2603
+ /**
2604
+ * alias for `x-codeSamples`
2605
+ */
2606
+ mintlify?: boolean;
2607
+ /**
2608
+ * alias for `x-codeSamples`
2609
+ */
2610
+ "bump.sh"?: boolean;
2611
+ /**
2612
+ * alias for `x-codeSamples`
2613
+ */
2614
+ gitbook?: boolean;
2615
+ /**
2616
+ * alias for `x-codeSamples`
2617
+ */
2618
+ "x-codeSamples"?: boolean;
2619
+ /**
2620
+ * adds `x-stainless-snippets`
2621
+ */
2622
+ stainless?: boolean;
2623
+ } | ("readme" | "redocly" | "mintlify" | "bump.sh" | "gitbook" | "x-codeSamples" | "stainless");
2624
+ /**
2625
+ * Controls which languages to include in generated code samples.
2626
+ *
2627
+ * By default, all languages configured in `targets` are enabled, and curl, powershell are disabled.
2628
+ */
2629
+ code_sample_languages?: {
2630
+ [k: string]: boolean | undefined;
2631
+ };
2632
+ };
2633
+ /**
2634
+ * Configures diagnostics that appear in builds and the Studio.
2635
+ */
2636
+ diagnostics?: {
2637
+ /**
2638
+ * Diagnostic types to ignore.
2639
+ */
2640
+ ignored: {
2641
+ [k: string]: (true | (string | {
2642
+ location: string;
2643
+ reason: string;
2644
+ } | {
2645
+ target: "node" | "typescript" | "python" | "go" | "java" | "kotlin" | "ruby" | "terraform" | "cli" | "php" | "csharp" | "sql" | "http" | "openapi";
2646
+ reason: string;
2647
+ })[]) | undefined;
2648
+ };
2649
+ };
2650
+ }
2651
+ interface ResourceConfig {
2652
+ /**
2653
+ * Set `custom: true` to use `customer_code` content for the resource instead of generated code
2654
+ */
2655
+ custom?: boolean;
2656
+ /**
2657
+ * Configure the models--named types--defined in the resource.
2658
+ *
2659
+ * Each key in the object is the name of the model and the value
2660
+ * is either the name of a schema in `#/components/schemas` or an object with more detail.
2661
+ */
2662
+ models?: {
2663
+ /**
2664
+ * The name of a schema in `#/components/schemas/` in your OpenAPI spec
2665
+ */
2666
+ [k: string]: (string | ({
2667
+ type?: "model";
2668
+ /**
2669
+ * `openapi_uri` is a reference to the OpenAPI definition of the schema, e.g. `#/components/schemas/Card` or `#/components/schemas/CardList/items`.
2670
+ *
2671
+ * All `$ref` and indirect references to the schema this path points to will have the same canonical name and share a type definition.
2672
+ *
2673
+ * For schemas under `#/components/schemas/*`, you can specify just the last path segment instead of the full JSON path (e.g. `Card` instead of `#/components/schemas/Card`).
2674
+ *
2675
+ * If you need a more powerful way to match a schema, `openapi_uri` can also be a [JMESPath](https://jmespath.org/) or a [JSONPath-plus](https://jsonpath-plus.github.io/JSONPath/docs/ts/) query. This query should match exactly one schema, and not mutate or create new references.
2676
+ */
2677
+ openapi_uri: string;
2678
+ /**
2679
+ * Skip SDK generation for a resource by specifying `skip: true`. Skip SDK generation for a resource per language by specifying the languages to skip (for example, `skip: [go, node]`). Skipping generation can aid in debugging code generation errors.
2680
+ */
2681
+ skip?: boolean | ("node" | "typescript" | "python" | "go" | "java" | "kotlin" | "ruby" | "terraform" | "cli" | "php" | "csharp" | "sql" | "http" | "openapi")[];
2682
+ /**
2683
+ * Opposite of `skip`; if set, SDK generation is only performed for this resource.
2684
+ */
2685
+ only?: ("node" | "typescript" | "python" | "go" | "java" | "kotlin" | "ruby" | "terraform" | "cli" | "php" | "csharp" | "sql" | "http" | "openapi")[];
2686
+ } | {
2687
+ type: "alias";
2688
+ /**
2689
+ * Name of the model this alias should point to. Aliases must point to a model within the same resource.
2690
+ */
2691
+ to: string;
2692
+ /**
2693
+ * Set the deprecation message for this model
2694
+ */
2695
+ deprecated?: string | {
2696
+ [k: string]: string | undefined;
2697
+ };
2698
+ /**
2699
+ * Skip SDK generation for a resource by specifying `skip: true`. Skip SDK generation for a resource per language by specifying the languages to skip (for example, `skip: [go, node]`). Skipping generation can aid in debugging code generation errors.
2700
+ */
2701
+ skip?: boolean | ("node" | "typescript" | "python" | "go" | "java" | "kotlin" | "ruby" | "terraform" | "cli" | "php" | "csharp" | "sql" | "http" | "openapi")[];
2702
+ /**
2703
+ * Opposite of `skip`; if set, SDK generation is only performed for this resource.
2704
+ */
2705
+ only?: ("node" | "typescript" | "python" | "go" | "java" | "kotlin" | "ruby" | "terraform" | "cli" | "php" | "csharp" | "sql" | "http" | "openapi")[];
2706
+ })) | undefined;
2707
+ };
2708
+ /**
2709
+ * Configure the methods defined in this resource.
2710
+ *
2711
+ * Each key in the object is the name of the method and the value
2712
+ * is either an endpoint (for example, `get /foo`) or an object with more detail.
2713
+ */
2714
+ methods?: {
2715
+ [k: string]: (string | ({
2716
+ /**
2717
+ * Describes a method for a standard http endpoint.
2718
+ */
2719
+ type?: "http";
2720
+ /**
2721
+ * A pair of HTTP verb & path, e.g. `get /foo`, `post /transactions/{user_id}`
2722
+ */
2723
+ endpoint: string;
2724
+ /**
2725
+ * Response property to be unwrapped so users don't have to access it themselves
2726
+ */
2727
+ unwrap_response?: string | false;
2728
+ /**
2729
+ * Provide `paginated: true` for methods whose responses are paginated. Or provide a string naming the page whose pagination should be matched.
2730
+ * If omitted, pagination configuration is automatically determined using matching pages in the configuration.
2731
+ *
2732
+ * Learn more: https://www.stainless.com/docs/configure/pagination
2733
+ */
2734
+ paginated?: boolean | string;
2735
+ /**
2736
+ * Skip the generated unit test in all languages / particular languages with a given a reason
2737
+ */
2738
+ skip_test_reason?: string | {
2739
+ [k: string]: string | undefined;
2740
+ };
2741
+ /**
2742
+ * Parameter name to be used for the request parameters argument. Required when the request body is not an object (for example, an array).
2743
+ */
2744
+ body_param_name?: string;
2745
+ /**
2746
+ * When specified, this overrides the default behavior (to use the *last* path parameter as a positional parameter).
2747
+ *
2748
+ * If a parameter is in this list, it is generated as a positional parameter in the given order.
2749
+ * If a parameter is not in this list, it is generated as a structured/named parameter.
2750
+ */
2751
+ positional_params?: string[];
2752
+ /**
2753
+ * Configure the default request options for an individual method
2754
+ */
2755
+ default_request_options?: {
2756
+ timeout?: (number | string) | null;
2757
+ /**
2758
+ * The default number of times to retry a failing request
2759
+ */
2760
+ max_retries?: number;
2761
+ };
2762
+ docs?: {
2763
+ /**
2764
+ * Specify the response property to reference in example snippets. Set to 'false' to disable property references, e.g. for logging the entire response.
2765
+ */
2766
+ response_property?: false | string;
2767
+ };
2768
+ terraform?: {
2769
+ /**
2770
+ * Define the type of method this endpoint represents.
2771
+ * - create: handles creation of the resource. Must be a POST
2772
+ * - read: handles reading of the resource. Must be a GET
2773
+ * - list: handles listing of the resource. Must be a GET
2774
+ * - update: handles updating of the resource. Must be a PUT or PATCH
2775
+ * - delete: handles deleting the resource. Must be a DELETE
2776
+ * - upsert: handles both updating and creating of the resource. Can be PUT or PATCH
2777
+ * - skip: don't include this method in generation
2778
+ */
2779
+ method?: "create" | "read" | "list" | "upsert" | "update" | "delete" | "skip";
2780
+ /**
2781
+ * Defined the name of the path param that is used as the ID of the resource.
2782
+ */
2783
+ id_path_param?: string;
2784
+ /**
2785
+ * Define the name of the property that represents the ID for the resource. It may exist as a path, body, or response parameter.
2786
+ */
2787
+ id_property?: string;
2788
+ /**
2789
+ * Specify how the update method on the resource should encode the request body.
2790
+ * - put: The entire resource is replaced with the new resource.
2791
+ * - json_merge_patch: The resource is updated as a JSON Merge Patch, only providing changed fields.
2792
+ *
2793
+ * If null, then json_merge_patch will be used for PATCH endpoints, and put otherwise.
2794
+ */
2795
+ update_behavior?: "put" | "json_merge_patch";
2796
+ /**
2797
+ * Timeout for the entire Terraform operation in milliseconds or ISO8601.
2798
+ *
2799
+ * This doesn't affect the request-level timeout.
2800
+ */
2801
+ default_timeout?: number | string;
2802
+ };
2803
+ /**
2804
+ * whether to generate MCP Server tools for this endpoint
2805
+ */
2806
+ mcp?: boolean | {
2807
+ /**
2808
+ * A list of tags that end-users can use to filter which resources and endpoints to include
2809
+ */
2810
+ tags?: string[];
2811
+ /**
2812
+ * Override the tool name for this endpoint
2813
+ */
2814
+ tool_name?: string;
2815
+ /**
2816
+ * Override the description for this endpoint
2817
+ */
2818
+ description?: string;
2819
+ };
2820
+ cli?: {
2821
+ /**
2822
+ * Whether or not to generate this method as a CLI command.
2823
+ */
2824
+ enabled?: boolean;
2825
+ /**
2826
+ * The GJSON filter to use to filter response data into a more manageable
2827
+ * format. This can be overridden with the `--filter` flag.
2828
+ *
2829
+ * For GJSON syntax, see: https://github.com/tidwall/gjson/blob/master/SYNTAX.md
2830
+ */
2831
+ filter?: string;
2832
+ /**
2833
+ * The default output format for this endpoint. This can be overridden with
2834
+ * the `--format` flag when running the command.
2835
+ */
2836
+ format?: "auto" | "explore" | "json" | "pretty" | "raw" | "yaml";
2837
+ };
2838
+ /**
2839
+ * Skip SDK generation for a resource by specifying `skip: true`. Skip SDK generation for a resource per language by specifying the languages to skip (for example, `skip: [go, node]`). Skipping generation can aid in debugging code generation errors.
2840
+ */
2841
+ skip?: boolean | ("node" | "typescript" | "python" | "go" | "java" | "kotlin" | "ruby" | "terraform" | "cli" | "php" | "csharp" | "sql" | "http" | "openapi")[];
2842
+ /**
2843
+ * Opposite of `skip`; if set, SDK generation is only performed for this resource.
2844
+ */
2845
+ only?: ("node" | "typescript" | "python" | "go" | "java" | "kotlin" | "ruby" | "terraform" | "cli" | "php" | "csharp" | "sql" | "http" | "openapi")[];
2846
+ /**
2847
+ * Set the deprecation message for this method
2848
+ */
2849
+ deprecated?: string | {
2850
+ [k: string]: string | undefined;
2851
+ };
2852
+ } | {
2853
+ type: "webhook_unwrap";
2854
+ /**
2855
+ * Map of webhook event types in the format [event_name]: event operation in OAS spec. If empty, it will infer the names and use all operations.
2856
+ */
2857
+ event_types?: {
2858
+ [k: string]: string | undefined;
2859
+ };
2860
+ /**
2861
+ * The name of the client option that stores the webhook key used for verifying webhooks (or null to skip verification checks).
2862
+ */
2863
+ webhook_key_opt?: string | null;
2864
+ description?: string;
2865
+ summary?: string;
2866
+ discriminator?: unknown;
2867
+ /**
2868
+ * Skip SDK generation for a resource by specifying `skip: true`. Skip SDK generation for a resource per language by specifying the languages to skip (for example, `skip: [go, node]`). Skipping generation can aid in debugging code generation errors.
2869
+ */
2870
+ skip?: boolean | ("node" | "typescript" | "python" | "go" | "java" | "kotlin" | "ruby" | "terraform" | "cli" | "php" | "csharp" | "sql" | "http" | "openapi")[];
2871
+ /**
2872
+ * Opposite of `skip`; if set, SDK generation is only performed for this resource.
2873
+ */
2874
+ only?: ("node" | "typescript" | "python" | "go" | "java" | "kotlin" | "ruby" | "terraform" | "cli" | "php" | "csharp" | "sql" | "http" | "openapi")[];
2875
+ /**
2876
+ * Set the deprecation message for this method
2877
+ */
2878
+ deprecated?: string | {
2879
+ [k: string]: string | undefined;
2880
+ };
2881
+ } | {
2882
+ /**
2883
+ * Describes an 'alias' to a method in the same resource. Used mainly for renaming a method and maintaining backwards compatibility.
2884
+ */
2885
+ type: "alias";
2886
+ /**
2887
+ * The name of the method that this alias should point to.
2888
+ *
2889
+ * This currently only supports aliasing HTTP methods within the same resource.
2890
+ */
2891
+ to: string;
2892
+ /**
2893
+ * Skip SDK generation for a resource by specifying `skip: true`. Skip SDK generation for a resource per language by specifying the languages to skip (for example, `skip: [go, node]`). Skipping generation can aid in debugging code generation errors.
2894
+ */
2895
+ skip?: boolean | ("node" | "typescript" | "python" | "go" | "java" | "kotlin" | "ruby" | "terraform" | "cli" | "php" | "csharp" | "sql" | "http" | "openapi")[];
2896
+ /**
2897
+ * Opposite of `skip`; if set, SDK generation is only performed for this resource.
2898
+ */
2899
+ only?: ("node" | "typescript" | "python" | "go" | "java" | "kotlin" | "ruby" | "terraform" | "cli" | "php" | "csharp" | "sql" | "http" | "openapi")[];
2900
+ /**
2901
+ * Set the deprecation message for this method
2902
+ */
2903
+ deprecated?: string | {
2904
+ [k: string]: string | undefined;
2905
+ };
2906
+ })) | undefined;
2907
+ };
2908
+ /**
2909
+ * Add a docstring for the resource.
2910
+ */
2911
+ description?: string;
2912
+ /**
2913
+ * Terraform configuration options for this resource.
2914
+ */
2915
+ terraform?: boolean | {
2916
+ /**
2917
+ * The name of the Terraform resource (prefixed by your organization name)
2918
+ */
2919
+ name?: string;
2920
+ /**
2921
+ * whether to enable a timeout property
2922
+ */
2923
+ timeouts?: boolean | {
2924
+ /**
2925
+ * Attribute name for timeout parameter
2926
+ */
2927
+ name?: string;
2928
+ /**
2929
+ * Default timeout for the resource and subresources' Terraform operations in milliseconds or ISO8601.
2930
+ *
2931
+ * You can override this in subresources or individual methods.
2932
+ *
2933
+ * This doesn't affect the request-level timeout.
2934
+ */
2935
+ default?: number | string;
2936
+ };
2937
+ /**
2938
+ * Whether to generate Terraform resource
2939
+ */
2940
+ resource?: boolean;
2941
+ /**
2942
+ * Whether to generate Terraform data sources
2943
+ */
2944
+ data_source?: boolean;
2945
+ /**
2946
+ * Configures whether a warning message is shown to users when they attempt to delete a resource that
2947
+ * does not have a delete endpoint.
2948
+ *
2949
+ * - warning: Does nothing upon delete, but generates a warning message before the user attempts to create or delete the resource.
2950
+ *
2951
+ * - no_warning: Does nothing upon delete, and does not generate a warning message.
2952
+ */
2953
+ unsupported_delete_behavior?: "warning" | "no_warning";
2954
+ /**
2955
+ * Skip tests and provide a reason
2956
+ */
2957
+ skip_tests_reason?: string;
2958
+ /**
2959
+ * The schema version for this resource. This is used by Terraform to track schema changes
2960
+ * and perform state migrations when the schema evolves over time.
2961
+ *
2962
+ * Only valid for resources, not data sources. Typically incremented by 1 for each
2963
+ * breaking schema change.
2964
+ */
2965
+ version?: number;
2966
+ };
2967
+ /**
2968
+ * Define nested namespaces for accessing models and methods.
2969
+ *
2970
+ * For example, with a "cards" resource containing a "transactions" subresource, the
2971
+ * generated Python method invocation is `client.cards.transactions.retrieve()`.
2972
+ */
2973
+ subresources?: {
2974
+ [k: string]: ResourceConfig | undefined;
2975
+ };
2976
+ /**
2977
+ * Set the deprecation message for this resource
2978
+ */
2979
+ deprecated?: string | {
2980
+ [k: string]: string | undefined;
2981
+ };
2982
+ /**
2983
+ * whether to generate MCP Server tools for this resource
2984
+ */
2985
+ mcp?: boolean | {
2986
+ /**
2987
+ * A list of tags that end-users can use to filter which resources and endpoints to include
2988
+ */
2989
+ tags?: string[];
2990
+ };
2991
+ /**
2992
+ * Skip SDK generation for a resource by specifying `skip: true`. Skip SDK generation for a resource per language by specifying the languages to skip (for example, `skip: [go, node]`). Skipping generation can aid in debugging code generation errors.
2993
+ */
2994
+ skip?: boolean | ("node" | "typescript" | "python" | "go" | "java" | "kotlin" | "ruby" | "terraform" | "cli" | "php" | "csharp" | "sql" | "http" | "openapi")[];
2995
+ /**
2996
+ * Opposite of `skip`; if set, SDK generation is only performed for this resource.
2997
+ */
2998
+ only?: ("node" | "typescript" | "python" | "go" | "java" | "kotlin" | "ruby" | "terraform" | "cli" | "php" | "csharp" | "sql" | "http" | "openapi")[];
2999
+ }
3000
+
3001
+ type ApiResourceConfig = OmitStrict<ResourceConfig, 'models' | 'methods' | 'subresources'>;
3002
+ type ApiResource<T extends Record<string, Contract> = Record<string, Contract>> = {
3003
+ name: string;
3004
+ endpoints: T;
3005
+ config?: ApiResourceConfig;
3006
+ };
3007
+ interface LazyResource<T extends Record<string, AnyProcedure> = Record<string, AnyProcedure>> {
3008
+ endpointRoutes: Record<keyof T, HTTPEndpoint>;
3009
+ loader: () => Promise<ApiResource<T>>;
3010
+ }
3011
+ type Resource = ApiResource | LazyResource;
3012
+ type ImplementedApiResource = ApiResource<Record<string, AnyProcedure>>;
3013
+ type ImplementedResource<T extends AnyProcedure = AnyProcedure> = ApiResource<Record<string, T>> | LazyResource<Record<string, T>>;
3014
+ type InferResourceContext<T extends ImplementedResource> = [
3015
+ T
3016
+ ] extends [ImplementedResource<AnyProcedure<infer TContext>>] ? TContext : never;
3017
+ declare function apiResource<T extends Record<string, Contract>>(name: string, config: ApiResourceConfig & {
3018
+ endpoints: T;
3019
+ }): ApiResource<T>;
3020
+ declare function lazyResource<T extends Record<string, AnyProcedure> = Record<string, AnyProcedure>>(loader: () => Promise<ApiResource<T>>, endpointRoutes: Record<keyof T, HTTPEndpoint>): LazyResource<T>;
3021
+ declare function isLazyResource(resource: Resource): resource is LazyResource;
3022
+ declare function unlazyResources(resources: Resource[]): Promise<ApiResource[]>;
3023
+ declare function validateLazyLoadedResource(lazyResource: LazyResource, loadedResource: ApiResource): void;
3024
+
3025
+ export { NotAcceptableError as $, unlazyResources as D, validateLazyLoadedResource as F, mergeContext as G, getEndpointId as K, ValidationError as O, ApiError as T, BadRequestError as U, UnauthorizedError as X, ForbiddenError as Y, NotFoundError as Z, MethodNotAllowedError as _, RequestTimeoutError as a0, ConflictError as a1, PreconditionFailedError as a2, ContentTooLargeError as a3, UnsupportedMediaTypeError as a4, UnprocessableContentError as a5, TooManyRequestsError as a6, InternalServerError as a7, NotImplementedError as a8, BadGatewayError as a9, ServiceUnavailableError as aa, GatewayTimeoutError as ab, isApiErrorStatus as ac, toApiError as ad, encodeError as ae, mergeMeta as af, middlewareOutputFn as ak, initialSchemas as au, Procedure as i, Contract as k, apiResource as x, lazyResource as y, isLazyResource as z };
3026
+ export type { AnySchema as A, BaseDef as B, Context as C, EndpointSchema as E, PathSchemaIfPlaceholders as H, ImplementedResource as I, Endpoint as J, LazyResource as L, Meta as M, ValidationErrorOptions as N, ProcedureHandlerOptions as P, ApiErrorStatic as Q, Resource as R, Schemable as S, ValidatedAuthContext as V, WrapShapes as W, InferResourceContext as a, MiddlewareResult as ag, MiddlewareNextFn as ah, MiddlewareOutputFn as ai, MiddlewareOptions as aj, ContractDef as al, AnyContractDef as am, ProcedureDef as an, AnyProcedure as ao, UnionToIntersection as ap, WrapShape as aq, InferSchemaInput as ar, InferHandlerInputs as as, TypeRest as at, InitialSchemas as av, Middleware as b, MapInputMiddleware as c, CompatibleContext as d, MergedContext as e, Schemas as f, ContractOpts as g, ProcedureHandler as h, AnyShape as j, ErrorMap as l, AuthConfig as m, BuildContextWithAuth as n, Schema as o, AnyMiddleware as p, InferProcedureClientInputs as q, InferSchemaOutput as r, SchemaIssue as s, StainlessConfig as t, ApiResourceConfig as u, ApiResource as v, ImplementedApiResource as w };