Skip to content

Commit

Permalink
refresh outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
inkognitro committed Oct 9, 2024
1 parent b0607e8 commit 0e84cc7
Show file tree
Hide file tree
Showing 580 changed files with 131,587 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example-outputs/petstore1-with-zod/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ export type ContentsObject = {
contents?: ContentsObject[];
};

// @ts-ignore - due to schema recursion
export const z_ContentsObject = z.object({
// @ts-ignore - due to ZodSchema recursion it is required to force the type like so
export const z_ContentsObject: z.ZodType<ContentsObject> = z.object({
name: z.string(),
id: z.string().optional(),
drs_uri: z.array(z.string()).optional(),
Expand Down Expand Up @@ -173,7 +173,7 @@ export const z_DrsObject = z.object({
mime_type: z.string().optional(),
checksums: z.array(z_Checksum).min(1),
access_methods: z.array(z_AccessMethod).min(1).optional(),
contents: z.array(z.lazy(() => z_ContentsObject)).optional(),
contents: z.array(z_ContentsObject).optional(),
description: z.string().optional(),
aliases: z.array(z.string()).optional(),
});
Expand Down
29 changes: 29 additions & 0 deletions example-outputs/stripe-with-zod/apps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {
Secret_service_resource_scope,
z_Secret_service_resource_scope,
} from '@example-outputs/stripe-with-zod';
import {z} from 'zod';

export type Apps_Secret = {
created: number; // int
deleted?: boolean;
expires_at?: null | number; // int
id: string;
livemode: boolean;
name: string;
object: 'apps.secret';
payload?: string | null;
scope: Secret_service_resource_scope;
};

export const z_Apps_Secret = z.object({
created: z.number().int().safe().finite(),
deleted: z.boolean().optional(),
expires_at: z.number().int().safe().finite().nullable().optional(),
id: z.string(),
livemode: z.boolean(),
name: z.string(),
object: z.enum(['apps.secret']),
payload: z.string().nullable().optional(),
scope: z_Secret_service_resource_scope,
});
136 changes: 136 additions & 0 deletions example-outputs/stripe-with-zod/billing.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
import {
Thresholds_resource_alert_filter,
Thresholds_resource_usage_threshold_config,
Billing_meter_resource_customer_mapping_settings,
Billing_meter_resource_aggregation_settings,
Billing_meter_resource_billing_meter_status_transitions,
Billing_meter_resource_billing_meter_value,
z_Billing_meter_resource_customer_mapping_settings,
z_Billing_meter_resource_aggregation_settings,
z_Billing_meter_resource_billing_meter_status_transitions,
z_Billing_meter_resource_billing_meter_value,
z_Thresholds_resource_alert_filter,
z_Thresholds_resource_usage_threshold_config,
Billing_meter_resource_billing_meter_event_adjustment_cancel,
z_Billing_meter_resource_billing_meter_event_adjustment_cancel,
} from '@example-outputs/stripe-with-zod';
import {z} from 'zod';

export type Billing_Meter = {
created: number; // int
customer_mapping: Billing_meter_resource_customer_mapping_settings;
default_aggregation: Billing_meter_resource_aggregation_settings;
display_name: string;
event_name: string;
event_time_window?: 'day' | 'hour' | null;
id: string;
livemode: boolean;
object: 'billing.meter';
status: 'active' | 'inactive';
status_transitions: Billing_meter_resource_billing_meter_status_transitions;
updated: number; // int
value_settings: Billing_meter_resource_billing_meter_value;
};

export const z_Billing_Meter = z.object({
created: z.number().int().safe().finite(),
customer_mapping: z_Billing_meter_resource_customer_mapping_settings,
default_aggregation: z_Billing_meter_resource_aggregation_settings,
display_name: z.string(),
event_name: z.string(),
event_time_window: z.enum(['day', 'hour']).nullable().optional(),
id: z.string(),
livemode: z.boolean(),
object: z.enum(['billing.meter']),
status: z.enum(['active', 'inactive']),
status_transitions: z_Billing_meter_resource_billing_meter_status_transitions,
updated: z.number().int().safe().finite(),
value_settings: z_Billing_meter_resource_billing_meter_value,
});

export type Billing_Alert = {
alert_type: 'usage_threshold';
filter?: Thresholds_resource_alert_filter &
Partial<Thresholds_resource_alert_filter>;
id: string;
livemode: boolean;
object: 'billing.alert';
status?: 'active' | 'archived' | 'inactive' | null;
title: string;
usage_threshold_config?: Thresholds_resource_usage_threshold_config &
Partial<Thresholds_resource_usage_threshold_config>;
};

export const z_Billing_Alert = z.object({
alert_type: z.enum(['usage_threshold']),
filter: z_Thresholds_resource_alert_filter.optional(),
id: z.string(),
livemode: z.boolean(),
object: z.enum(['billing.alert']),
status: z.enum(['active', 'archived', 'inactive']).nullable().optional(),
title: z.string(),
usage_threshold_config:
z_Thresholds_resource_usage_threshold_config.optional(),
});

export type Billing_Meter_event_adjustment = {
cancel?: Billing_meter_resource_billing_meter_event_adjustment_cancel &
Partial<Billing_meter_resource_billing_meter_event_adjustment_cancel>;
event_name: string;
livemode: boolean;
object: 'billing.meter_event_adjustment';
status: 'complete' | 'pending';
type: 'cancel';
};

export const z_Billing_Meter_event_adjustment = z.object({
cancel:
z_Billing_meter_resource_billing_meter_event_adjustment_cancel.optional(),
event_name: z.string(),
livemode: z.boolean(),
object: z.enum(['billing.meter_event_adjustment']),
status: z.enum(['complete', 'pending']),
type: z.enum(['cancel']),
});

export type Billing_Meter_event = {
created: number; // int
event_name: string;
identifier: string;
livemode: boolean;
object: 'billing.meter_event';
payload: {
[key: string]: string;
};
timestamp: number; // int
};

export const z_Billing_Meter_event = z.object({
created: z.number().int().safe().finite(),
event_name: z.string(),
identifier: z.string(),
livemode: z.boolean(),
object: z.enum(['billing.meter_event']),
payload: z.record(z.string()),
timestamp: z.number().int().safe().finite(),
});

export type Billing_Meter_event_summary = {
aggregated_value: number;
end_time: number; // int
id: string;
livemode: boolean;
meter: string;
object: 'billing.meter_event_summary';
start_time: number; // int
};

export const z_Billing_Meter_event_summary = z.object({
aggregated_value: z.number().safe().finite(),
end_time: z.number().int().safe().finite(),
id: z.string(),
livemode: z.boolean(),
meter: z.string(),
object: z.enum(['billing.meter_event_summary']),
start_time: z.number().int().safe().finite(),
});
180 changes: 180 additions & 0 deletions example-outputs/stripe-with-zod/billing_portal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
import {
Application,
Deleted_application,
Portal_business_profile,
Portal_features,
Portal_login_page,
z_Application,
z_Deleted_application,
z_Portal_business_profile,
z_Portal_features,
z_Portal_login_page,
Portal_flows_flow,
z_Portal_flows_flow,
} from '@example-outputs/stripe-with-zod';
import {z} from 'zod';

export type Billing_portal_Configuration = {
active: boolean;
application?: (string | Application | Deleted_application) &
(Partial<Application> & Partial<Deleted_application>);
business_profile: Portal_business_profile;
created: number; // int
default_return_url?: string | null;
features: Portal_features;
id: string;
is_default: boolean;
livemode: boolean;
login_page: Portal_login_page;
metadata?: {
[key: string]: string;
} | null;
object: 'billing_portal.configuration';
updated: number; // int
};

export const z_Billing_portal_Configuration = z.object({
active: z.boolean(),
application: z
.union([z.string(), z_Application, z_Deleted_application])
.optional(),
business_profile: z_Portal_business_profile,
created: z.number().int().safe().finite(),
default_return_url: z.string().nullable().optional(),
features: z_Portal_features,
id: z.string(),
is_default: z.boolean(),
livemode: z.boolean(),
login_page: z_Portal_login_page,
metadata: z.record(z.string()).nullable().optional(),
object: z.enum(['billing_portal.configuration']),
updated: z.number().int().safe().finite(),
});

export type Billing_portal_Session = {
configuration: (string | Billing_portal_Configuration) &
Partial<Billing_portal_Configuration>;
created: number; // int
customer: string;
flow?: Portal_flows_flow & Partial<Portal_flows_flow>;
id: string;
livemode: boolean;
locale?:
| 'auto'
| 'bg'
| 'cs'
| 'da'
| 'de'
| 'el'
| 'en'
| 'en-AU'
| 'en-CA'
| 'en-GB'
| 'en-IE'
| 'en-IN'
| 'en-NZ'
| 'en-SG'
| 'es'
| 'es-419'
| 'et'
| 'fi'
| 'fil'
| 'fr'
| 'fr-CA'
| 'hr'
| 'hu'
| 'id'
| 'it'
| 'ja'
| 'ko'
| 'lt'
| 'lv'
| 'ms'
| 'mt'
| 'nb'
| 'nl'
| 'pl'
| 'pt'
| 'pt-BR'
| 'ro'
| 'ru'
| 'sk'
| 'sl'
| 'sv'
| 'th'
| 'tr'
| 'vi'
| 'zh'
| 'zh-HK'
| 'zh-TW'
| null;
object: 'billing_portal.session';
on_behalf_of?: string | null;
return_url?: string | null;
url: string;
};

export const z_Billing_portal_Session = z.object({
configuration: z.union([z.string(), z_Billing_portal_Configuration]),
created: z.number().int().safe().finite(),
customer: z.string(),
flow: z_Portal_flows_flow.optional(),
id: z.string(),
livemode: z.boolean(),
locale: z
.enum([
'auto',
'bg',
'cs',
'da',
'de',
'el',
'en',
'en-AU',
'en-CA',
'en-GB',
'en-IE',
'en-IN',
'en-NZ',
'en-SG',
'es',
'es-419',
'et',
'fi',
'fil',
'fr',
'fr-CA',
'hr',
'hu',
'id',
'it',
'ja',
'ko',
'lt',
'lv',
'ms',
'mt',
'nb',
'nl',
'pl',
'pt',
'pt-BR',
'ro',
'ru',
'sk',
'sl',
'sv',
'th',
'tr',
'vi',
'zh',
'zh-HK',
'zh-TW',
])
.nullable()
.optional(),
object: z.enum(['billing_portal.session']),
on_behalf_of: z.string().nullable().optional(),
return_url: z.string().nullable().optional(),
url: z.string(),
});
Loading

0 comments on commit 0e84cc7

Please sign in to comment.