@fern-api/venus-api-sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/core.d.ts +3 -0
  2. package/dist/browser/cjs/core.js +4286 -0
  3. package/dist/browser/cjs/index.js +6332 -0
  4. package/dist/browser/cjs/serialization.js +5852 -0
  5. package/dist/browser/esm/core.js +4280 -0
  6. package/dist/browser/esm/index.js +6328 -0
  7. package/dist/browser/esm/serialization.js +5864 -0
  8. package/dist/node/core.js +12643 -0
  9. package/dist/node/index.js +14715 -0
  10. package/dist/node/serialization.js +14721 -0
  11. package/package.json +57 -0
  12. package/serialization.d.ts +3 -0
  13. package/types/Client.d.ts +21 -0
  14. package/types/api/index.d.ts +1 -0
  15. package/types/api/resources/commons/index.d.ts +1 -0
  16. package/types/api/resources/commons/types/OrganizationId.d.ts +8 -0
  17. package/types/api/resources/commons/types/UserId.d.ts +8 -0
  18. package/types/api/resources/commons/types/index.d.ts +2 -0
  19. package/types/api/resources/index.d.ts +11 -0
  20. package/types/api/resources/organization/client/Client.d.ts +24 -0
  21. package/types/api/resources/organization/client/addUser.d.ts +33 -0
  22. package/types/api/resources/organization/client/create.d.ts +33 -0
  23. package/types/api/resources/organization/client/get.d.ts +28 -0
  24. package/types/api/resources/organization/client/getMyOrganizationFromScopedToken.d.ts +28 -0
  25. package/types/api/resources/organization/client/index.d.ts +7 -0
  26. package/types/api/resources/organization/client/isMember.d.ts +23 -0
  27. package/types/api/resources/organization/client/requests/AddUserToOrgRequest.d.ts +8 -0
  28. package/types/api/resources/organization/client/requests/CreateOrganizationRequest.d.ts +8 -0
  29. package/types/api/resources/organization/client/requests/UpdateOrganizationRequest.d.ts +6 -0
  30. package/types/api/resources/organization/client/requests/index.d.ts +3 -0
  31. package/types/api/resources/organization/client/update.d.ts +28 -0
  32. package/types/api/resources/organization/index.d.ts +2 -0
  33. package/types/api/resources/organization/types/Organization.d.ts +8 -0
  34. package/types/api/resources/organization/types/index.d.ts +1 -0
  35. package/types/api/resources/registry/client/Client.d.ts +18 -0
  36. package/types/api/resources/registry/client/generateRegistryTokens.d.ts +33 -0
  37. package/types/api/resources/registry/client/hasRegistryPermission.d.ts +33 -0
  38. package/types/api/resources/registry/client/index.d.ts +4 -0
  39. package/types/api/resources/registry/client/requests/CheckRegistryPermissionRequest.d.ts +8 -0
  40. package/types/api/resources/registry/client/requests/GenerateRegistryTokensRequest.d.ts +7 -0
  41. package/types/api/resources/registry/client/requests/RevokeTokenRequest.d.ts +8 -0
  42. package/types/api/resources/registry/client/requests/index.d.ts +3 -0
  43. package/types/api/resources/registry/client/revokeToken.d.ts +33 -0
  44. package/types/api/resources/registry/index.d.ts +2 -0
  45. package/types/api/resources/registry/types/MavenRegistryToken.d.ts +7 -0
  46. package/types/api/resources/registry/types/NpmRegistryToken.d.ts +6 -0
  47. package/types/api/resources/registry/types/RegistryToken.d.ts +34 -0
  48. package/types/api/resources/registry/types/RegistryTokens.d.ts +8 -0
  49. package/types/api/resources/registry/types/index.d.ts +4 -0
  50. package/types/api/resources/user/client/Client.d.ts +17 -0
  51. package/types/api/resources/user/client/getMyOrganizations.d.ts +23 -0
  52. package/types/api/resources/user/client/getMyself.d.ts +23 -0
  53. package/types/api/resources/user/client/index.d.ts +3 -0
  54. package/types/api/resources/user/client/requests/GetUserOrganizationsRequest.d.ts +6 -0
  55. package/types/api/resources/user/client/requests/index.d.ts +1 -0
  56. package/types/api/resources/user/index.d.ts +2 -0
  57. package/types/api/resources/user/types/OrganizationsPage.d.ts +8 -0
  58. package/types/api/resources/user/types/User.d.ts +10 -0
  59. package/types/api/resources/user/types/index.d.ts +2 -0
  60. package/types/core/auth/BasicAuth.d.ts +8 -0
  61. package/types/core/auth/BearerToken.d.ts +5 -0
  62. package/types/core/auth/index.d.ts +2 -0
  63. package/types/core/fetcher/APIResponse.d.ts +9 -0
  64. package/types/core/fetcher/Fetcher.d.ts +35 -0
  65. package/types/core/fetcher/Supplier.d.ts +4 -0
  66. package/types/core/fetcher/index.d.ts +3 -0
  67. package/types/core/index.d.ts +3 -0
  68. package/types/core/schemas/Schema.d.ts +18 -0
  69. package/types/core/schemas/builders/date/date.d.ts +2 -0
  70. package/types/core/schemas/builders/date/index.d.ts +1 -0
  71. package/types/core/schemas/builders/enum/enum.d.ts +2 -0
  72. package/types/core/schemas/builders/enum/index.d.ts +1 -0
  73. package/types/core/schemas/builders/identity/createIdentitySchemaCreator.d.ts +2 -0
  74. package/types/core/schemas/builders/identity/identity.d.ts +2 -0
  75. package/types/core/schemas/builders/identity/index.d.ts +2 -0
  76. package/types/core/schemas/builders/index.d.ts +13 -0
  77. package/types/core/schemas/builders/lazy/index.d.ts +2 -0
  78. package/types/core/schemas/builders/lazy/lazy.d.ts +5 -0
  79. package/types/core/schemas/builders/lazy/lazyObject.d.ts +3 -0
  80. package/types/core/schemas/builders/list/index.d.ts +1 -0
  81. package/types/core/schemas/builders/list/list.d.ts +2 -0
  82. package/types/core/schemas/builders/literals/index.d.ts +1 -0
  83. package/types/core/schemas/builders/literals/stringLiteral.d.ts +2 -0
  84. package/types/core/schemas/builders/object/index.d.ts +3 -0
  85. package/types/core/schemas/builders/object/object.d.ts +3 -0
  86. package/types/core/schemas/builders/object/property.d.ts +8 -0
  87. package/types/core/schemas/builders/object/types.d.ts +25 -0
  88. package/types/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +8 -0
  89. package/types/core/schemas/builders/object-like/index.d.ts +2 -0
  90. package/types/core/schemas/builders/object-like/types.d.ts +13 -0
  91. package/types/core/schemas/builders/primitives/any.d.ts +1 -0
  92. package/types/core/schemas/builders/primitives/boolean.d.ts +1 -0
  93. package/types/core/schemas/builders/primitives/index.d.ts +5 -0
  94. package/types/core/schemas/builders/primitives/number.d.ts +1 -0
  95. package/types/core/schemas/builders/primitives/string.d.ts +1 -0
  96. package/types/core/schemas/builders/primitives/unknown.d.ts +1 -0
  97. package/types/core/schemas/builders/record/index.d.ts +1 -0
  98. package/types/core/schemas/builders/record/record.d.ts +2 -0
  99. package/types/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +12 -0
  100. package/types/core/schemas/builders/schema-utils/index.d.ts +2 -0
  101. package/types/core/schemas/builders/schema-utils/types.d.ts +7 -0
  102. package/types/core/schemas/builders/set/index.d.ts +1 -0
  103. package/types/core/schemas/builders/set/set.d.ts +2 -0
  104. package/types/core/schemas/builders/union/discriminant.d.ts +5 -0
  105. package/types/core/schemas/builders/union/index.d.ts +3 -0
  106. package/types/core/schemas/builders/union/types.d.ts +13 -0
  107. package/types/core/schemas/builders/union/union.d.ts +4 -0
  108. package/types/core/schemas/index.d.ts +2 -0
  109. package/types/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +9 -0
  110. package/types/core/schemas/utils/entries.d.ts +1 -0
  111. package/types/core/schemas/utils/filterObject.d.ts +1 -0
  112. package/types/core/schemas/utils/keys.d.ts +1 -0
  113. package/types/core/schemas/utils/partition.d.ts +1 -0
  114. package/types/index.d.ts +2 -0
  115. package/types/serialization/index.d.ts +1 -0
  116. package/types/serialization/resources/commons/index.d.ts +1 -0
  117. package/types/serialization/resources/commons/types/OrganizationId.d.ts +10 -0
  118. package/types/serialization/resources/commons/types/UserId.d.ts +10 -0
  119. package/types/serialization/resources/commons/types/index.d.ts +2 -0
  120. package/types/serialization/resources/index.d.ts +8 -0
  121. package/types/serialization/resources/organization/client/addUser.d.ts +23 -0
  122. package/types/serialization/resources/organization/client/create.d.ts +23 -0
  123. package/types/serialization/resources/organization/client/get.d.ts +17 -0
  124. package/types/serialization/resources/organization/client/getMyOrganizationFromScopedToken.d.ts +17 -0
  125. package/types/serialization/resources/organization/client/index.d.ts +6 -0
  126. package/types/serialization/resources/organization/client/isMember.d.ts +9 -0
  127. package/types/serialization/resources/organization/client/update.d.ts +19 -0
  128. package/types/serialization/resources/organization/index.d.ts +2 -0
  129. package/types/serialization/resources/organization/types/Organization.d.ts +13 -0
  130. package/types/serialization/resources/organization/types/index.d.ts +1 -0
  131. package/types/serialization/resources/registry/client/generateRegistryTokens.d.ts +26 -0
  132. package/types/serialization/resources/registry/client/hasRegistryPermission.d.ts +27 -0
  133. package/types/serialization/resources/registry/client/index.d.ts +3 -0
  134. package/types/serialization/resources/registry/client/revokeToken.d.ts +23 -0
  135. package/types/serialization/resources/registry/index.d.ts +2 -0
  136. package/types/serialization/resources/registry/types/MavenRegistryToken.d.ts +13 -0
  137. package/types/serialization/resources/registry/types/NpmRegistryToken.d.ts +12 -0
  138. package/types/serialization/resources/registry/types/RegistryToken.d.ts +16 -0
  139. package/types/serialization/resources/registry/types/RegistryTokens.d.ts +13 -0
  140. package/types/serialization/resources/registry/types/index.d.ts +4 -0
  141. package/types/serialization/resources/user/client/getMyOrganizations.d.ts +10 -0
  142. package/types/serialization/resources/user/client/getMyself.d.ts +10 -0
  143. package/types/serialization/resources/user/client/index.d.ts +2 -0
  144. package/types/serialization/resources/user/index.d.ts +2 -0
  145. package/types/serialization/resources/user/types/OrganizationsPage.d.ts +13 -0
  146. package/types/serialization/resources/user/types/User.d.ts +15 -0
  147. package/types/serialization/resources/user/types/index.d.ts +2 -0
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../core";
5
+ import { FernVenusApi } from "../../../..";
6
+ export declare namespace Client {
7
+ interface Options {
8
+ environment: string;
9
+ token?: core.Supplier<core.BearerToken>;
10
+ }
11
+ }
12
+ export declare class Client {
13
+ private readonly options;
14
+ constructor(options: Client.Options);
15
+ getMyself(): Promise<FernVenusApi.user.getMyself.Response>;
16
+ getMyOrganizations(request: FernVenusApi.GetUserOrganizationsRequest): Promise<FernVenusApi.user.getMyOrganizations.Response>;
17
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import { FernVenusApi } from "../../../..";
5
+ import * as core from "../../../../core";
6
+ export declare type Response = core.APIResponse<FernVenusApi.OrganizationsPage, FernVenusApi.user.getMyOrganizations.Error>;
7
+ export declare type Error = FernVenusApi.user.getMyOrganizations.Error._Unknown;
8
+ export declare namespace Error {
9
+ interface _Unknown extends _Utils {
10
+ error: void;
11
+ content: core.Fetcher.Error;
12
+ }
13
+ interface _Utils {
14
+ _visit: <_Result>(visitor: FernVenusApi.user.getMyOrganizations.Error._Visitor<_Result>) => _Result;
15
+ }
16
+ interface _Visitor<_Result> {
17
+ _other: (value: core.Fetcher.Error) => _Result;
18
+ }
19
+ }
20
+ export declare const Error: {
21
+ readonly _unknown: (fetcherError: core.Fetcher.Error) => FernVenusApi.user.getMyOrganizations.Error._Unknown;
22
+ readonly _visit: <_Result>(value: FernVenusApi.user.getMyOrganizations.Error, visitor: FernVenusApi.user.getMyOrganizations.Error._Visitor<_Result>) => _Result;
23
+ };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import { FernVenusApi } from "../../../..";
5
+ import * as core from "../../../../core";
6
+ export declare type Response = core.APIResponse<FernVenusApi.User, FernVenusApi.user.getMyself.Error>;
7
+ export declare type Error = FernVenusApi.user.getMyself.Error._Unknown;
8
+ export declare namespace Error {
9
+ interface _Unknown extends _Utils {
10
+ error: void;
11
+ content: core.Fetcher.Error;
12
+ }
13
+ interface _Utils {
14
+ _visit: <_Result>(visitor: FernVenusApi.user.getMyself.Error._Visitor<_Result>) => _Result;
15
+ }
16
+ interface _Visitor<_Result> {
17
+ _other: (value: core.Fetcher.Error) => _Result;
18
+ }
19
+ }
20
+ export declare const Error: {
21
+ readonly _unknown: (fetcherError: core.Fetcher.Error) => FernVenusApi.user.getMyself.Error._Unknown;
22
+ readonly _visit: <_Result>(value: FernVenusApi.user.getMyself.Error, visitor: FernVenusApi.user.getMyself.Error._Visitor<_Result>) => _Result;
23
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./requests";
2
+ export * as getMyself from "./getMyself";
3
+ export * as getMyOrganizations from "./getMyOrganizations";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface GetUserOrganizationsRequest {
5
+ pageId: number;
6
+ }
@@ -0,0 +1 @@
1
+ export { GetUserOrganizationsRequest } from "./GetUserOrganizationsRequest";
@@ -0,0 +1,2 @@
1
+ export * from "./types";
2
+ export * from "./client";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import { FernVenusApi } from "../../../..";
5
+ export interface OrganizationsPage {
6
+ organizations: FernVenusApi.OrganizationId[];
7
+ nextPage?: number;
8
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import { FernVenusApi } from "../../../..";
5
+ export interface User {
6
+ userId: FernVenusApi.UserId;
7
+ username: string;
8
+ email?: string;
9
+ createdAt?: Date;
10
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./User";
2
+ export * from "./OrganizationsPage";
@@ -0,0 +1,8 @@
1
+ export interface BasicAuth {
2
+ username: string;
3
+ password: string;
4
+ }
5
+ export declare const BasicAuth: {
6
+ toAuthorizationHeader: (basicAuth: BasicAuth | undefined) => string | undefined;
7
+ fromAuthorizationHeader: (header: string) => BasicAuth;
8
+ };
@@ -0,0 +1,5 @@
1
+ export declare type BearerToken = string;
2
+ export declare const BearerToken: {
3
+ toAuthorizationHeader: (token: BearerToken | undefined) => string | undefined;
4
+ fromAuthorizationHeader: (header: string) => BearerToken;
5
+ };
@@ -0,0 +1,2 @@
1
+ export { BasicAuth } from "./BasicAuth";
2
+ export { BearerToken } from "./BearerToken";
@@ -0,0 +1,9 @@
1
+ export declare type APIResponse<Success, Failure> = SuccessfulResponse<Success> | FailedResponse<Failure>;
2
+ export interface SuccessfulResponse<T> {
3
+ ok: true;
4
+ body: T;
5
+ }
6
+ export interface FailedResponse<T> {
7
+ ok: false;
8
+ error: T;
9
+ }
@@ -0,0 +1,35 @@
1
+ import { APIResponse } from "./APIResponse";
2
+ export interface Fetcher {
3
+ fetch: FetchFunction;
4
+ }
5
+ export declare type FetchFunction = (args: Fetcher.Args) => Promise<APIResponse<unknown, Fetcher.Error>>;
6
+ export declare namespace Fetcher {
7
+ interface Args {
8
+ url: string;
9
+ method: string;
10
+ headers?: Record<string, string | undefined>;
11
+ queryParameters?: URLSearchParams;
12
+ body?: unknown;
13
+ timeoutMs?: number;
14
+ }
15
+ type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
16
+ interface FailedStatusCodeError {
17
+ reason: "status-code";
18
+ statusCode: number;
19
+ rawBody: string | undefined;
20
+ body: unknown;
21
+ }
22
+ interface NonJsonError {
23
+ reason: "non-json";
24
+ statusCode: number;
25
+ rawBody: string;
26
+ }
27
+ interface TimeoutError {
28
+ reason: "timeout";
29
+ }
30
+ interface UnknownError {
31
+ reason: "unknown";
32
+ errorMessage: string;
33
+ }
34
+ }
35
+ export declare const fetcher: FetchFunction;
@@ -0,0 +1,4 @@
1
+ export declare type Supplier<T> = T | Promise<T> | (() => T | Promise<T>);
2
+ export declare const Supplier: {
3
+ get: <T>(supplier: Supplier<T>) => Promise<T>;
4
+ };
@@ -0,0 +1,3 @@
1
+ export { type APIResponse } from "./APIResponse";
2
+ export { fetcher, type Fetcher, type FetchFunction } from "./Fetcher";
3
+ export { Supplier } from "./Supplier";
@@ -0,0 +1,3 @@
1
+ export * as serialization from "./schemas";
2
+ export * from "./auth";
3
+ export * from "./fetcher";
@@ -0,0 +1,18 @@
1
+ import { SchemaUtils } from "./builders";
2
+ export declare type Schema<Raw = unknown, Parsed = unknown> = BaseSchema<Raw, Parsed> & SchemaUtils<Raw, Parsed>;
3
+ export declare type inferRaw<S extends Schema> = S extends Schema<infer Raw, any> ? Raw : never;
4
+ export declare type inferParsed<S extends Schema> = S extends Schema<any, infer Parsed> ? Parsed : never;
5
+ export interface BaseSchema<Raw, Parsed> {
6
+ parse: (raw: Raw, opts?: SchemaOptions) => Parsed | Promise<Parsed>;
7
+ json: (parsed: Parsed, opts?: SchemaOptions) => Raw | Promise<Raw>;
8
+ }
9
+ export interface SchemaOptions {
10
+ /**
11
+ * @default false
12
+ */
13
+ skipUnknownKeysOnParse?: boolean;
14
+ /**
15
+ * @default false
16
+ */
17
+ includeUnknownKeysOnJson?: boolean;
18
+ }
@@ -0,0 +1,2 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare function date(): Schema<string, Date>;
@@ -0,0 +1 @@
1
+ export { date } from "./date";
@@ -0,0 +1,2 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare function enum_<U extends string, E extends Readonly<[U, ...U[]]>>(_values: E): Schema<E[number], E[number]>;
@@ -0,0 +1 @@
1
+ export { enum_ } from "./enum";
@@ -0,0 +1,2 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare function createIdentitySchemaCreator<T>(): () => Schema<T, T>;
@@ -0,0 +1,2 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare function identity<T>(): Schema<T, T>;
@@ -0,0 +1,2 @@
1
+ export { createIdentitySchemaCreator } from "./createIdentitySchemaCreator";
2
+ export { identity } from "./identity";
@@ -0,0 +1,13 @@
1
+ export * from "./date";
2
+ export * from "./enum";
3
+ export * from "./identity";
4
+ export * from "./lazy";
5
+ export * from "./list";
6
+ export * from "./literals";
7
+ export * from "./object";
8
+ export * from "./object-like";
9
+ export * from "./primitives";
10
+ export * from "./record";
11
+ export * from "./schema-utils";
12
+ export * from "./set";
13
+ export * from "./union";
@@ -0,0 +1,2 @@
1
+ export { lazy, type SchemaGetter } from "./lazy";
2
+ export { lazyObject } from "./lazyObject";
@@ -0,0 +1,5 @@
1
+ import { BaseSchema, Schema } from "../../Schema";
2
+ export declare type SchemaGetter<SchemaType extends Schema<any, any>> = () => SchemaType | Promise<SchemaType>;
3
+ export declare function lazy<Raw, Parsed>(getter: SchemaGetter<Schema<Raw, Parsed>>): Schema<Raw, Parsed>;
4
+ export declare function constructLazyBaseSchema<Raw, Parsed>(getter: SchemaGetter<Schema<Raw, Parsed>>): BaseSchema<Raw, Parsed>;
5
+ export declare function getMemoizedSchema<SchemaType extends Schema<any, any>>(getter: SchemaGetter<SchemaType>): Promise<SchemaType>;
@@ -0,0 +1,3 @@
1
+ import { ObjectSchema } from "../object/types";
2
+ import { SchemaGetter } from "./lazy";
3
+ export declare function lazyObject<Raw, Parsed>(getter: SchemaGetter<ObjectSchema<Raw, Parsed>>): ObjectSchema<Raw, Parsed>;
@@ -0,0 +1 @@
1
+ export { list } from "./list";
@@ -0,0 +1,2 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare function list<Raw, Parsed>(schema: Schema<Raw, Parsed>): Schema<Raw[], Parsed[]>;
@@ -0,0 +1 @@
1
+ export { stringLiteral } from "./stringLiteral";
@@ -0,0 +1,2 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare function stringLiteral<V extends string>(_value: V): Schema<V, V>;
@@ -0,0 +1,3 @@
1
+ export { getObjectUtils, object } from "./object";
2
+ export { isProperty, property, type Property } from "./property";
3
+ export { type BaseObjectSchema, type inferObjectSchemaFromPropertySchemas, type inferParsedObject, type inferParsedObjectFromPropertySchemas, type inferParsedPropertySchema, type inferRawKey, type inferRawObject, type inferRawObjectFromPropertySchemas, type inferRawPropertySchema, type ObjectSchema, type ObjectUtils, type PropertySchemas, } from "./types";
@@ -0,0 +1,3 @@
1
+ import { BaseObjectSchema, inferObjectSchemaFromPropertySchemas, ObjectUtils, PropertySchemas } from "./types";
2
+ export declare function object<ParsedKeys extends string, T extends PropertySchemas<ParsedKeys>>(schemas: T): inferObjectSchemaFromPropertySchemas<T>;
3
+ export declare function getObjectUtils<Raw, Parsed>(schema: BaseObjectSchema<Raw, Parsed>): ObjectUtils<Raw, Parsed>;
@@ -0,0 +1,8 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare function property<RawKey extends string, RawValue, ParsedValue>(rawKey: RawKey, valueSchema: Schema<RawValue, ParsedValue>): Property<RawKey, RawValue, ParsedValue>;
3
+ export interface Property<RawKey extends string, RawValue, ParsedValue> {
4
+ rawKey: RawKey;
5
+ valueSchema: Schema<RawValue, ParsedValue>;
6
+ isProperty: true;
7
+ }
8
+ export declare function isProperty<O extends Property<any, any, any>>(maybeProperty: unknown): maybeProperty is O;
@@ -0,0 +1,25 @@
1
+ import { inferParsed, inferRaw, Schema } from "../../Schema";
2
+ import { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties";
3
+ import { BaseObjectLikeSchema, ObjectLikeSchema } from "../object-like";
4
+ import { Property } from "./property";
5
+ export declare type ObjectSchema<Raw, Parsed> = BaseObjectSchema<Raw, Parsed> & ObjectLikeSchema<Raw, Parsed> & ObjectUtils<Raw, Parsed>;
6
+ export interface BaseObjectSchema<Raw, Parsed> extends BaseObjectLikeSchema<Raw, Parsed> {
7
+ _getRawProperties: () => Promise<(keyof Raw)[]>;
8
+ _getParsedProperties: () => Promise<(keyof Parsed)[]>;
9
+ }
10
+ export interface ObjectUtils<Raw, Parsed> {
11
+ extend: <RawExtension, ParsedExtension>(schemas: ObjectSchema<RawExtension, ParsedExtension>) => ObjectSchema<Raw & RawExtension, Parsed & ParsedExtension>;
12
+ }
13
+ export declare type inferRawObject<O extends ObjectSchema<any, any>> = O extends ObjectSchema<infer Raw, any> ? Raw : never;
14
+ export declare type inferParsedObject<O extends ObjectSchema<any, any>> = O extends ObjectSchema<any, infer Parsed> ? Parsed : never;
15
+ export declare type inferObjectSchemaFromPropertySchemas<T extends PropertySchemas<keyof T>> = ObjectSchema<inferRawObjectFromPropertySchemas<T>, inferParsedObjectFromPropertySchemas<T>>;
16
+ export declare type inferRawObjectFromPropertySchemas<T extends PropertySchemas<keyof T>> = addQuestionMarksToNullableProperties<{
17
+ [ParsedKey in keyof T as inferRawKey<ParsedKey, T[ParsedKey]>]: inferRawPropertySchema<T[ParsedKey]>;
18
+ }>;
19
+ export declare type inferParsedObjectFromPropertySchemas<T extends PropertySchemas<keyof T>> = addQuestionMarksToNullableProperties<{
20
+ [K in keyof T]: inferParsedPropertySchema<T[K]>;
21
+ }>;
22
+ export declare type PropertySchemas<ParsedKeys extends string | number | symbol> = Record<ParsedKeys, Property<any, any, any> | Schema<any, any>>;
23
+ export declare type inferRawPropertySchema<P extends Property<any, any, any> | Schema<any, any>> = P extends Property<any, infer Raw, any> ? Raw : P extends Schema<any, any> ? inferRaw<P> : never;
24
+ export declare type inferParsedPropertySchema<P extends Property<any, any, any> | Schema<any, any>> = P extends Property<any, any, infer Parsed> ? Parsed : P extends Schema<any, any> ? inferParsed<P> : never;
25
+ export declare type inferRawKey<ParsedKey extends string | number | symbol, P extends Property<any, any, any> | Schema<any, any>> = P extends Property<infer Raw, any, any> ? Raw : ParsedKey;
@@ -0,0 +1,8 @@
1
+ import { BaseObjectLikeSchema, ObjectLikeSchema, ObjectLikeUtils } from "./types";
2
+ export declare function getObjectLikeUtils<Raw, Parsed>(schema: BaseObjectLikeSchema<Raw, Parsed>): ObjectLikeUtils<Raw, Parsed>;
3
+ /**
4
+ * object-like utils are defined in one file to resolve issues with circular imports
5
+ */
6
+ export declare function withProperties<RawObjectShape, ParsedObjectShape, Properties>(objectLike: BaseObjectLikeSchema<RawObjectShape, ParsedObjectShape>, properties: {
7
+ [K in keyof Properties]: Properties[K] | ((parsed: ParsedObjectShape) => Properties[K]);
8
+ }): ObjectLikeSchema<RawObjectShape, ParsedObjectShape & Properties>;
@@ -0,0 +1,2 @@
1
+ export { getObjectLikeUtils, withProperties } from "./getObjectLikeUtils";
2
+ export { OBJECT_LIKE_BRAND, type BaseObjectLikeSchema, type ObjectLikeSchema, type ObjectLikeUtils } from "./types";
@@ -0,0 +1,13 @@
1
+ import { BaseSchema, Schema } from "../../Schema";
2
+ export declare type ObjectLikeSchema<Raw, Parsed> = Schema<Raw, Parsed> & BaseObjectLikeSchema<Raw, Parsed> & ObjectLikeUtils<Raw, Parsed>;
3
+ export declare type BaseObjectLikeSchema<Raw, Parsed> = BaseSchema<Raw, Parsed> & {
4
+ _objectLike: void;
5
+ };
6
+ export interface ObjectLikeUtils<Raw, Parsed> {
7
+ withProperties: <T extends Record<string, any>>(properties: {
8
+ [K in keyof T]: T[K] | ((parsed: Parsed) => T[K]);
9
+ }) => ObjectLikeSchema<Raw, Parsed & T>;
10
+ }
11
+ export declare const OBJECT_LIKE_BRAND: {
12
+ _objectLike: void;
13
+ };
@@ -0,0 +1 @@
1
+ export declare const any: () => import("../..").Schema<any, any>;
@@ -0,0 +1 @@
1
+ export declare const boolean: () => import("../..").Schema<boolean, boolean>;
@@ -0,0 +1,5 @@
1
+ export { any } from "./any";
2
+ export { boolean } from "./boolean";
3
+ export { number } from "./number";
4
+ export { string } from "./string";
5
+ export { unknown } from "./unknown";
@@ -0,0 +1 @@
1
+ export declare const number: () => import("../..").Schema<number, number>;
@@ -0,0 +1 @@
1
+ export declare const string: () => import("../..").Schema<string, string>;
@@ -0,0 +1 @@
1
+ export declare const unknown: () => import("../..").Schema<unknown, unknown>;
@@ -0,0 +1 @@
1
+ export { record } from "./record";
@@ -0,0 +1,2 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare function record<RawKey extends string | number, ParsedKey extends string | number, RawValue, ParsedValue>(keySchema: Schema<RawKey, ParsedKey>, valueSchema: Schema<RawValue, ParsedValue>): Schema<Record<RawKey, RawValue>, Record<ParsedKey, ParsedValue>>;
@@ -0,0 +1,12 @@
1
+ import { BaseSchema, Schema } from "../../Schema";
2
+ import { OptionalSchema } from "./types";
3
+ export interface SchemaUtils<Raw, Parsed> {
4
+ optional: () => OptionalSchema<Raw, Parsed>;
5
+ transform: <PostTransform>(transformer: BaseSchema<Parsed, PostTransform>) => Schema<Raw, PostTransform>;
6
+ }
7
+ export declare function getSchemaUtils<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): SchemaUtils<Raw, Parsed>;
8
+ /**
9
+ * schema utils are defined in one file to resolve issues with circular imports
10
+ */
11
+ export declare function optional<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): OptionalSchema<Raw, Parsed>;
12
+ export declare function transform<PreTransformRaw, PreTransformParsed, PostTransform>(schema: BaseSchema<PreTransformRaw, PreTransformParsed>, transformer: BaseSchema<PreTransformParsed, PostTransform>): Schema<PreTransformRaw, PostTransform>;
@@ -0,0 +1,2 @@
1
+ export { getSchemaUtils, optional, transform, type SchemaUtils } from "./getSchemaUtils";
2
+ export { OPTIONAL_BRAND, type OptionalSchema } from "./types";
@@ -0,0 +1,7 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare const OPTIONAL_BRAND: {
3
+ _isOptional: void;
4
+ };
5
+ export declare type OptionalSchema<Raw, Parsed> = Schema<Raw | null | undefined, Parsed | undefined> & {
6
+ _isOptional: void;
7
+ };
@@ -0,0 +1 @@
1
+ export { set } from "./set";
@@ -0,0 +1,2 @@
1
+ import { Schema } from "../../Schema";
2
+ export declare function set<Raw, Parsed>(schema: Schema<Raw, Parsed>): Schema<Raw[], Set<Parsed>>;
@@ -0,0 +1,5 @@
1
+ export declare function discriminant<RawDiscriminant extends string, ParsedDiscriminant extends string>(parsedDiscriminant: ParsedDiscriminant, rawDiscriminant: RawDiscriminant): Discriminant<RawDiscriminant, ParsedDiscriminant>;
2
+ export interface Discriminant<RawDiscriminant extends string, ParsedDiscriminant extends string> {
3
+ parsedDiscriminant: ParsedDiscriminant;
4
+ rawDiscriminant: RawDiscriminant;
5
+ }
@@ -0,0 +1,3 @@
1
+ export { discriminant, type Discriminant } from "./discriminant";
2
+ export { type inferParsedDiscriminant, type inferParsedUnion, type inferRawDiscriminant, type inferRawUnion, type UnionSubtypes, } from "./types";
3
+ export { union } from "./union";
@@ -0,0 +1,13 @@
1
+ import { inferParsedObject, inferRawObject, ObjectSchema } from "../object";
2
+ import { Discriminant } from "./discriminant";
3
+ export declare type UnionSubtypes<DiscriminantValues extends string | number | symbol> = {
4
+ [K in DiscriminantValues]: ObjectSchema<any, any>;
5
+ };
6
+ export declare type inferRawUnion<D extends string | Discriminant<any, any>, U extends UnionSubtypes<keyof U>> = {
7
+ [K in keyof U]: Record<inferRawDiscriminant<D>, K> & inferRawObject<U[K]>;
8
+ }[keyof U];
9
+ export declare type inferParsedUnion<D extends string | Discriminant<any, any>, U extends UnionSubtypes<keyof U>> = {
10
+ [K in keyof U]: Record<inferParsedDiscriminant<D>, K> & inferParsedObject<U[K]>;
11
+ }[keyof U];
12
+ export declare type inferRawDiscriminant<D extends string | Discriminant<any, any>> = D extends string ? D : D extends Discriminant<infer Raw, any> ? Raw : never;
13
+ export declare type inferParsedDiscriminant<D extends string | Discriminant<any, any>> = D extends string ? D : D extends Discriminant<any, infer Parsed> ? Parsed : never;
@@ -0,0 +1,4 @@
1
+ import { ObjectLikeSchema } from "../object-like";
2
+ import { Discriminant } from "./discriminant";
3
+ import { inferParsedUnion, inferRawUnion, UnionSubtypes } from "./types";
4
+ export declare function union<D extends string | Discriminant<any, any>, U extends UnionSubtypes<any>>(discriminant: D, union: U): ObjectLikeSchema<inferRawUnion<D, U>, inferParsedUnion<D, U>>;
@@ -0,0 +1,2 @@
1
+ export * from "./builders";
2
+ export { type inferParsed, type inferRaw, type Schema, type SchemaOptions } from "./Schema";
@@ -0,0 +1,9 @@
1
+ export declare type addQuestionMarksToNullableProperties<T> = {
2
+ [K in OptionalKeys<T>]?: undefined extends T[K] ? T[K] : never;
3
+ } & Pick<T, RequiredKeys<T>>;
4
+ export declare type OptionalKeys<T> = {
5
+ [K in keyof T]: undefined extends T[K] ? K : never;
6
+ }[keyof T];
7
+ export declare type RequiredKeys<T> = {
8
+ [K in keyof T]: undefined extends T[K] ? never : K;
9
+ }[keyof T];
@@ -0,0 +1 @@
1
+ export declare function entries<T>(object: T): [keyof T, T[keyof T]][];
@@ -0,0 +1 @@
1
+ export declare function filterObject<T, K extends keyof T>(obj: T, keysToInclude: K[]): Pick<T, K>;
@@ -0,0 +1 @@
1
+ export declare function keys<T>(object: T): (keyof T)[];
@@ -0,0 +1 @@
1
+ export declare function partition<T>(items: readonly T[], predicate: (item: T) => boolean): [T[], T[]];
@@ -0,0 +1,2 @@
1
+ export * as FernVenusApi from "./api";
2
+ export { FernVenusApiClient } from "./Client";
@@ -0,0 +1 @@
1
+ export * from "./resources";
@@ -0,0 +1 @@
1
+ export * from "./types";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../..";
5
+ import { FernVenusApi } from "../../../..";
6
+ import * as core from "../../../../core";
7
+ export declare const OrganizationId: core.serialization.Schema<serializers.OrganizationId.Raw, FernVenusApi.OrganizationId>;
8
+ export declare namespace OrganizationId {
9
+ type Raw = string;
10
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../..";
5
+ import { FernVenusApi } from "../../../..";
6
+ import * as core from "../../../../core";
7
+ export declare const UserId: core.serialization.Schema<serializers.UserId.Raw, FernVenusApi.UserId>;
8
+ export declare namespace UserId {
9
+ type Raw = string;
10
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./OrganizationId";
2
+ export * from "./UserId";
@@ -0,0 +1,8 @@
1
+ export * as commons from "./commons";
2
+ export * from "./commons/types";
3
+ export * as organization from "./organization";
4
+ export * from "./organization/types";
5
+ export * as registry from "./registry";
6
+ export * from "./registry/types";
7
+ export * as user from "./user";
8
+ export * from "./user/types";
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../..";
5
+ import { FernVenusApi } from "../../../..";
6
+ import * as core from "../../../../core";
7
+ export declare const Request: core.serialization.Schema<serializers.organization.addUser.Request.Raw, FernVenusApi.AddUserToOrgRequest>;
8
+ export declare namespace Request {
9
+ interface Raw {
10
+ userId: serializers.UserId.Raw;
11
+ orgId: serializers.OrganizationId.Raw;
12
+ }
13
+ }
14
+ export declare const Error: core.serialization.Schema<serializers.organization.addUser.Error.Raw, FernVenusApi.organization.addUser.Error>;
15
+ export declare namespace Error {
16
+ type Raw = Error.UnauthorizedError | Error.UserIdDoesNotExistError;
17
+ interface UnauthorizedError {
18
+ error: "UnauthorizedError";
19
+ }
20
+ interface UserIdDoesNotExistError {
21
+ error: "UserIdDoesNotExistError";
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../..";
5
+ import { FernVenusApi } from "../../../..";
6
+ import * as core from "../../../../core";
7
+ export declare const Request: core.serialization.Schema<serializers.organization.create.Request.Raw, FernVenusApi.CreateOrganizationRequest>;
8
+ export declare namespace Request {
9
+ interface Raw {
10
+ organizationId: serializers.OrganizationId.Raw;
11
+ artifactReadRequiresToken?: boolean | null;
12
+ }
13
+ }
14
+ export declare const Error: core.serialization.Schema<serializers.organization.create.Error.Raw, FernVenusApi.organization.create.Error>;
15
+ export declare namespace Error {
16
+ type Raw = Error.UnauthorizedError | Error.OrganizationAlreadyExistsError;
17
+ interface UnauthorizedError {
18
+ error: "UnauthorizedError";
19
+ }
20
+ interface OrganizationAlreadyExistsError {
21
+ error: "OrganizationAlreadyExistsError";
22
+ }
23
+ }