@fern-api/venus-api-sdk 0.0.18 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core.d.ts +1 -0
- package/dist/browser/cjs/core.js +702 -167
- package/dist/browser/cjs/index.js +996 -391
- package/dist/browser/cjs/serialization.js +930 -329
- package/dist/browser/esm/core.js +702 -167
- package/dist/browser/esm/index.js +996 -391
- package/dist/browser/esm/serialization.js +936 -329
- package/dist/node/core.js +702 -167
- package/dist/node/index.js +996 -391
- package/dist/node/serialization.js +1002 -391
- package/package.json +2 -2
- package/serialization.d.ts +1 -0
- package/types/api/resources/organization/client/Client.d.ts +6 -6
- package/types/api/resources/organization/client/addUser.d.ts +0 -1
- package/types/api/resources/organization/client/create.d.ts +0 -1
- package/types/api/resources/organization/client/get.d.ts +0 -1
- package/types/api/resources/organization/client/getMyOrganizationFromScopedToken.d.ts +0 -1
- package/types/api/resources/organization/client/isMember.d.ts +0 -1
- package/types/api/resources/organization/client/update.d.ts +0 -1
- package/types/api/resources/registry/client/Client.d.ts +3 -3
- package/types/api/resources/registry/client/generateRegistryTokens.d.ts +0 -1
- package/types/api/resources/registry/client/hasRegistryPermission.d.ts +0 -1
- package/types/api/resources/registry/client/revokeToken.d.ts +0 -1
- package/types/api/resources/user/client/Client.d.ts +2 -2
- package/types/api/resources/user/client/getMyOrganizations.d.ts +0 -1
- package/types/api/resources/user/client/getMyself.d.ts +0 -1
- package/types/core/fetcher/Fetcher.d.ts +1 -1
- package/types/core/schemas/Schema.d.ts +35 -7
- package/types/core/schemas/builders/enum/enum.d.ts +1 -1
- package/types/core/schemas/builders/index.d.ts +0 -1
- package/types/core/schemas/builders/literals/stringLiteral.d.ts +1 -1
- package/types/core/schemas/builders/object/types.d.ts +5 -4
- package/types/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +4 -3
- package/types/core/schemas/builders/object-like/index.d.ts +2 -2
- package/types/core/schemas/builders/object-like/types.d.ts +2 -8
- package/types/core/schemas/builders/primitives/any.d.ts +1 -1
- package/types/core/schemas/builders/primitives/boolean.d.ts +1 -1
- package/types/core/schemas/builders/primitives/number.d.ts +1 -1
- package/types/core/schemas/builders/primitives/string.d.ts +1 -1
- package/types/core/schemas/builders/primitives/unknown.d.ts +1 -1
- package/types/core/schemas/builders/record/index.d.ts +1 -0
- package/types/core/schemas/builders/record/record.d.ts +2 -1
- package/types/core/schemas/builders/record/types.d.ts +5 -0
- package/types/core/schemas/builders/schema-utils/JsonError.d.ts +5 -0
- package/types/core/schemas/builders/schema-utils/ParseError.d.ts +5 -0
- package/types/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +11 -6
- package/types/core/schemas/builders/schema-utils/index.d.ts +2 -1
- package/types/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts +2 -0
- package/types/core/schemas/utils/MaybePromise.d.ts +1 -0
- package/types/core/schemas/utils/OptionalRecord.d.ts +1 -0
- package/types/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +3 -3
- package/types/core/schemas/utils/createIdentitySchemaCreator.d.ts +2 -0
- package/types/core/schemas/utils/isPlainObject.d.ts +2 -0
- package/types/serialization/resources/index.d.ts +2 -0
- package/types/serialization/resources/organization/client/addUser.d.ts +0 -7
- package/types/serialization/resources/organization/client/create.d.ts +0 -7
- package/types/serialization/resources/organization/client/get.d.ts +0 -4
- package/types/serialization/resources/organization/client/getMyOrganizationFromScopedToken.d.ts +0 -4
- package/types/serialization/resources/organization/client/index.d.ts +1 -0
- package/types/serialization/resources/organization/client/requests/AddUserToOrgRequest.d.ts +13 -0
- package/types/serialization/resources/organization/client/requests/CreateOrganizationRequest.d.ts +13 -0
- package/types/serialization/resources/organization/client/requests/UpdateOrganizationRequest.d.ts +12 -0
- package/types/serialization/resources/organization/client/requests/index.d.ts +3 -0
- package/types/serialization/resources/organization/client/update.d.ts +0 -6
- package/types/serialization/resources/registry/client/generateRegistryTokens.d.ts +0 -10
- package/types/serialization/resources/registry/client/hasRegistryPermission.d.ts +1 -8
- package/types/serialization/resources/registry/client/index.d.ts +1 -0
- package/types/serialization/resources/registry/client/requests/CheckRegistryPermissionRequest.d.ts +13 -0
- package/types/serialization/resources/registry/client/requests/GenerateRegistryTokensRequest.d.ts +12 -0
- package/types/serialization/resources/registry/client/requests/RevokeTokenRequest.d.ts +13 -0
- package/types/serialization/resources/registry/client/requests/index.d.ts +3 -0
- package/types/serialization/resources/registry/client/revokeToken.d.ts +0 -7
- package/types/serialization/resources/user/index.d.ts +0 -1
- package/types/core/schemas/builders/identity/createIdentitySchemaCreator.d.ts +0 -2
- package/types/core/schemas/builders/identity/identity.d.ts +0 -2
- package/types/core/schemas/builders/identity/index.d.ts +0 -2
- package/types/core/schemas/builders/schema-utils/types.d.ts +0 -7
- package/types/serialization/resources/user/client/getMyOrganizations.d.ts +0 -10
- package/types/serialization/resources/user/client/getMyself.d.ts +0 -10
- package/types/serialization/resources/user/client/index.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fern-api/venus-api-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"types",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@types/node": "17.0.33",
|
|
51
51
|
"esbuild": "0.16.15",
|
|
52
52
|
"prettier": "2.7.1",
|
|
53
|
-
"tsc-alias": "
|
|
53
|
+
"tsc-alias": "1.7.1",
|
|
54
54
|
"typescript": "4.6.4"
|
|
55
55
|
},
|
|
56
56
|
"packageManager": "yarn@3.2.4"
|
package/serialization.d.ts
CHANGED
|
@@ -12,13 +12,13 @@ export declare namespace Client {
|
|
|
12
12
|
export declare class Client {
|
|
13
13
|
private readonly options;
|
|
14
14
|
constructor(options: Client.Options);
|
|
15
|
-
create(request: FernVenusApi.CreateOrganizationRequest): Promise<FernVenusApi.organization.create.
|
|
16
|
-
update(orgId: FernVenusApi.OrganizationId, request: FernVenusApi.UpdateOrganizationRequest): Promise<FernVenusApi.organization.update.
|
|
17
|
-
get(orgId: FernVenusApi.OrganizationId): Promise<FernVenusApi.organization.get.
|
|
18
|
-
isMember(organizationId: FernVenusApi.OrganizationId): Promise<FernVenusApi.organization.isMember.
|
|
15
|
+
create(request: FernVenusApi.CreateOrganizationRequest): Promise<core.APIResponse<void, FernVenusApi.organization.create.Error>>;
|
|
16
|
+
update(orgId: FernVenusApi.OrganizationId, request: FernVenusApi.UpdateOrganizationRequest): Promise<core.APIResponse<void, FernVenusApi.organization.update.Error>>;
|
|
17
|
+
get(orgId: FernVenusApi.OrganizationId): Promise<core.APIResponse<FernVenusApi.Organization, FernVenusApi.organization.get.Error>>;
|
|
18
|
+
isMember(organizationId: FernVenusApi.OrganizationId): Promise<core.APIResponse<boolean, FernVenusApi.organization.isMember.Error>>;
|
|
19
19
|
/**
|
|
20
20
|
* Returns the org for a scoped token. The token is limited to one organization.
|
|
21
21
|
*/
|
|
22
|
-
getMyOrganizationFromScopedToken(): Promise<FernVenusApi.organization.getMyOrganizationFromScopedToken.
|
|
23
|
-
addUser(request: FernVenusApi.AddUserToOrgRequest): Promise<FernVenusApi.organization.addUser.
|
|
22
|
+
getMyOrganizationFromScopedToken(): Promise<core.APIResponse<FernVenusApi.Organization, FernVenusApi.organization.getMyOrganizationFromScopedToken.Error>>;
|
|
23
|
+
addUser(request: FernVenusApi.AddUserToOrgRequest): Promise<core.APIResponse<void, FernVenusApi.organization.addUser.Error>>;
|
|
24
24
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { FernVenusApi } from "../../../..";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
export declare type Response = core.APIResponse<void, FernVenusApi.organization.addUser.Error>;
|
|
7
6
|
export declare type Error = FernVenusApi.organization.addUser.Error.UnauthorizedError | FernVenusApi.organization.addUser.Error.UserIdDoesNotExistError | FernVenusApi.organization.addUser.Error._Unknown;
|
|
8
7
|
export declare namespace Error {
|
|
9
8
|
interface UnauthorizedError extends _Utils {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { FernVenusApi } from "../../../..";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
export declare type Response = core.APIResponse<void, FernVenusApi.organization.create.Error>;
|
|
7
6
|
export declare type Error = FernVenusApi.organization.create.Error.UnauthorizedError | FernVenusApi.organization.create.Error.OrganizationAlreadyExistsError | FernVenusApi.organization.create.Error._Unknown;
|
|
8
7
|
export declare namespace Error {
|
|
9
8
|
interface UnauthorizedError extends _Utils {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { FernVenusApi } from "../../../..";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
export declare type Response = core.APIResponse<FernVenusApi.Organization, FernVenusApi.organization.get.Error>;
|
|
7
6
|
export declare type Error = FernVenusApi.organization.get.Error.UnauthorizedError | FernVenusApi.organization.get.Error._Unknown;
|
|
8
7
|
export declare namespace Error {
|
|
9
8
|
interface UnauthorizedError extends _Utils {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { FernVenusApi } from "../../../..";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
export declare type Response = core.APIResponse<FernVenusApi.Organization, FernVenusApi.organization.getMyOrganizationFromScopedToken.Error>;
|
|
7
6
|
export declare type Error = FernVenusApi.organization.getMyOrganizationFromScopedToken.Error.UnauthorizedError | FernVenusApi.organization.getMyOrganizationFromScopedToken.Error._Unknown;
|
|
8
7
|
export declare namespace Error {
|
|
9
8
|
interface UnauthorizedError extends _Utils {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { FernVenusApi } from "../../../..";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
export declare type Response = core.APIResponse<boolean, FernVenusApi.organization.isMember.Error>;
|
|
7
6
|
export declare type Error = FernVenusApi.organization.isMember.Error._Unknown;
|
|
8
7
|
export declare namespace Error {
|
|
9
8
|
interface _Unknown extends _Utils {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { FernVenusApi } from "../../../..";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
export declare type Response = core.APIResponse<void, FernVenusApi.organization.update.Error>;
|
|
7
6
|
export declare type Error = FernVenusApi.organization.update.Error.UnauthorizedError | FernVenusApi.organization.update.Error._Unknown;
|
|
8
7
|
export declare namespace Error {
|
|
9
8
|
interface UnauthorizedError extends _Utils {
|
|
@@ -12,7 +12,7 @@ export declare namespace Client {
|
|
|
12
12
|
export declare class Client {
|
|
13
13
|
private readonly options;
|
|
14
14
|
constructor(options: Client.Options);
|
|
15
|
-
generateRegistryTokens(request: FernVenusApi.GenerateRegistryTokensRequest): Promise<FernVenusApi.registry.generateRegistryTokens.
|
|
16
|
-
hasRegistryPermission(request: FernVenusApi.CheckRegistryPermissionRequest): Promise<FernVenusApi.registry.hasRegistryPermission.
|
|
17
|
-
revokeToken(request: FernVenusApi.RevokeTokenRequest): Promise<FernVenusApi.registry.revokeToken.
|
|
15
|
+
generateRegistryTokens(request: FernVenusApi.GenerateRegistryTokensRequest): Promise<core.APIResponse<FernVenusApi.RegistryTokens, FernVenusApi.registry.generateRegistryTokens.Error>>;
|
|
16
|
+
hasRegistryPermission(request: FernVenusApi.CheckRegistryPermissionRequest): Promise<core.APIResponse<boolean, FernVenusApi.registry.hasRegistryPermission.Error>>;
|
|
17
|
+
revokeToken(request: FernVenusApi.RevokeTokenRequest): Promise<core.APIResponse<void, FernVenusApi.registry.revokeToken.Error>>;
|
|
18
18
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { FernVenusApi } from "../../../..";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
export declare type Response = core.APIResponse<FernVenusApi.RegistryTokens, FernVenusApi.registry.generateRegistryTokens.Error>;
|
|
7
6
|
export declare type Error = FernVenusApi.registry.generateRegistryTokens.Error.UnauthorizedError | FernVenusApi.registry.generateRegistryTokens.Error.OrganizationNotFoundError | FernVenusApi.registry.generateRegistryTokens.Error._Unknown;
|
|
8
7
|
export declare namespace Error {
|
|
9
8
|
interface UnauthorizedError extends _Utils {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { FernVenusApi } from "../../../..";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
export declare type Response = core.APIResponse<boolean, FernVenusApi.registry.hasRegistryPermission.Error>;
|
|
7
6
|
export declare type Error = FernVenusApi.registry.hasRegistryPermission.Error.UnauthorizedError | FernVenusApi.registry.hasRegistryPermission.Error.OrganizationNotFoundError | FernVenusApi.registry.hasRegistryPermission.Error._Unknown;
|
|
8
7
|
export declare namespace Error {
|
|
9
8
|
interface UnauthorizedError extends _Utils {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { FernVenusApi } from "../../../..";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
export declare type Response = core.APIResponse<void, FernVenusApi.registry.revokeToken.Error>;
|
|
7
6
|
export declare type Error = FernVenusApi.registry.revokeToken.Error.UnauthorizedError | FernVenusApi.registry.revokeToken.Error.OrganizationNotFoundError | FernVenusApi.registry.revokeToken.Error._Unknown;
|
|
8
7
|
export declare namespace Error {
|
|
9
8
|
interface UnauthorizedError extends _Utils {
|
|
@@ -12,6 +12,6 @@ export declare namespace Client {
|
|
|
12
12
|
export declare class Client {
|
|
13
13
|
private readonly options;
|
|
14
14
|
constructor(options: Client.Options);
|
|
15
|
-
getMyself(): Promise<FernVenusApi.user.getMyself.
|
|
16
|
-
getMyOrganizations(request: FernVenusApi.GetUserOrganizationsRequest): Promise<FernVenusApi.user.getMyOrganizations.
|
|
15
|
+
getMyself(): Promise<core.APIResponse<FernVenusApi.User, FernVenusApi.user.getMyself.Error>>;
|
|
16
|
+
getMyOrganizations(request: FernVenusApi.GetUserOrganizationsRequest): Promise<core.APIResponse<FernVenusApi.OrganizationsPage, FernVenusApi.user.getMyOrganizations.Error>>;
|
|
17
17
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { FernVenusApi } from "../../../..";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
export declare type Response = core.APIResponse<FernVenusApi.OrganizationsPage, FernVenusApi.user.getMyOrganizations.Error>;
|
|
7
6
|
export declare type Error = FernVenusApi.user.getMyOrganizations.Error._Unknown;
|
|
8
7
|
export declare namespace Error {
|
|
9
8
|
interface _Unknown extends _Utils {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { FernVenusApi } from "../../../..";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
|
-
export declare type Response = core.APIResponse<FernVenusApi.User, FernVenusApi.user.getMyself.Error>;
|
|
7
6
|
export declare type Error = FernVenusApi.user.getMyself.Error._Unknown;
|
|
8
7
|
export declare namespace Error {
|
|
9
8
|
interface _Unknown extends _Utils {
|
|
@@ -11,12 +11,12 @@ export declare namespace Fetcher {
|
|
|
11
11
|
queryParameters?: URLSearchParams;
|
|
12
12
|
body?: unknown;
|
|
13
13
|
timeoutMs?: number;
|
|
14
|
+
withCredentials?: boolean;
|
|
14
15
|
}
|
|
15
16
|
type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
|
|
16
17
|
interface FailedStatusCodeError {
|
|
17
18
|
reason: "status-code";
|
|
18
19
|
statusCode: number;
|
|
19
|
-
rawBody: string | undefined;
|
|
20
20
|
body: unknown;
|
|
21
21
|
}
|
|
22
22
|
interface NonJsonError {
|
|
@@ -1,18 +1,46 @@
|
|
|
1
1
|
import { SchemaUtils } from "./builders";
|
|
2
|
+
import { MaybePromise } from "./utils/MaybePromise";
|
|
2
3
|
export declare type Schema<Raw = unknown, Parsed = unknown> = BaseSchema<Raw, Parsed> & SchemaUtils<Raw, Parsed>;
|
|
3
4
|
export declare type inferRaw<S extends Schema> = S extends Schema<infer Raw, any> ? Raw : never;
|
|
4
5
|
export declare type inferParsed<S extends Schema> = S extends Schema<any, infer Parsed> ? Parsed : never;
|
|
5
6
|
export interface BaseSchema<Raw, Parsed> {
|
|
6
|
-
parse: (raw:
|
|
7
|
-
json: (parsed:
|
|
7
|
+
parse: (raw: unknown, opts?: SchemaOptions) => MaybePromise<MaybeValid<Parsed>>;
|
|
8
|
+
json: (parsed: unknown, opts?: SchemaOptions) => MaybePromise<MaybeValid<Raw>>;
|
|
9
|
+
getType: () => SchemaType | Promise<SchemaType>;
|
|
10
|
+
}
|
|
11
|
+
export declare const SchemaType: {
|
|
12
|
+
readonly DATE: "date";
|
|
13
|
+
readonly ENUM: "enum";
|
|
14
|
+
readonly LIST: "list";
|
|
15
|
+
readonly STRING_LITERAL: "stringLiteral";
|
|
16
|
+
readonly OBJECT: "object";
|
|
17
|
+
readonly ANY: "any";
|
|
18
|
+
readonly BOOLEAN: "boolean";
|
|
19
|
+
readonly NUMBER: "number";
|
|
20
|
+
readonly STRING: "string";
|
|
21
|
+
readonly UNKNOWN: "unknown";
|
|
22
|
+
readonly RECORD: "record";
|
|
23
|
+
readonly SET: "set";
|
|
24
|
+
readonly UNION: "union";
|
|
25
|
+
readonly OPTIONAL: "optional";
|
|
26
|
+
};
|
|
27
|
+
export declare type SchemaType = typeof SchemaType[keyof typeof SchemaType];
|
|
28
|
+
export declare type MaybeValid<T> = Valid<T> | Invalid;
|
|
29
|
+
export interface Valid<T> {
|
|
30
|
+
ok: true;
|
|
31
|
+
value: T;
|
|
32
|
+
}
|
|
33
|
+
export interface Invalid {
|
|
34
|
+
ok: false;
|
|
35
|
+
errors: ValidationError[];
|
|
36
|
+
}
|
|
37
|
+
export interface ValidationError {
|
|
38
|
+
path: string[];
|
|
39
|
+
message: string;
|
|
8
40
|
}
|
|
9
41
|
export interface SchemaOptions {
|
|
10
42
|
/**
|
|
11
43
|
* @default false
|
|
12
44
|
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @default false
|
|
16
|
-
*/
|
|
17
|
-
includeUnknownKeysOnJson?: boolean;
|
|
45
|
+
allowUnknownKeys?: boolean;
|
|
18
46
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Schema } from "../../Schema";
|
|
2
|
-
export declare function enum_<U extends string, E extends
|
|
2
|
+
export declare function enum_<U extends string, E extends U[]>(values: E): Schema<E[number], E[number]>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Schema } from "../../Schema";
|
|
2
|
-
export declare function stringLiteral<V extends string>(
|
|
2
|
+
export declare function stringLiteral<V extends string>(literal: V): Schema<V, V>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { inferParsed, inferRaw, Schema } from "../../Schema";
|
|
1
|
+
import { BaseSchema, inferParsed, inferRaw, Schema } from "../../Schema";
|
|
2
2
|
import { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties";
|
|
3
|
-
import {
|
|
3
|
+
import { ObjectLikeUtils } from "../object-like";
|
|
4
|
+
import { SchemaUtils } from "../schema-utils";
|
|
4
5
|
import { Property } from "./property";
|
|
5
|
-
export declare type ObjectSchema<Raw, Parsed> = BaseObjectSchema<Raw, Parsed> &
|
|
6
|
-
export interface BaseObjectSchema<Raw, Parsed> extends
|
|
6
|
+
export declare type ObjectSchema<Raw, Parsed> = BaseObjectSchema<Raw, Parsed> & ObjectLikeUtils<Raw, Parsed> & ObjectUtils<Raw, Parsed> & SchemaUtils<Raw, Parsed>;
|
|
7
|
+
export interface BaseObjectSchema<Raw, Parsed> extends BaseSchema<Raw, Parsed> {
|
|
7
8
|
_getRawProperties: () => Promise<(keyof Raw)[]>;
|
|
8
9
|
_getParsedProperties: () => Promise<(keyof Parsed)[]>;
|
|
9
10
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { BaseSchema } from "../../Schema";
|
|
2
|
+
import { ObjectLikeSchema, ObjectLikeUtils } from "./types";
|
|
3
|
+
export declare function getObjectLikeUtils<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): ObjectLikeUtils<Raw, Parsed>;
|
|
3
4
|
/**
|
|
4
5
|
* object-like utils are defined in one file to resolve issues with circular imports
|
|
5
6
|
*/
|
|
6
|
-
export declare function
|
|
7
|
+
export declare function withParsedProperties<RawObjectShape, ParsedObjectShape, Properties>(objectLike: BaseSchema<RawObjectShape, ParsedObjectShape>, properties: {
|
|
7
8
|
[K in keyof Properties]: Properties[K] | ((parsed: ParsedObjectShape) => Properties[K]);
|
|
8
9
|
}): ObjectLikeSchema<RawObjectShape, ParsedObjectShape & Properties>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { getObjectLikeUtils,
|
|
2
|
-
export {
|
|
1
|
+
export { getObjectLikeUtils, withParsedProperties } from "./getObjectLikeUtils";
|
|
2
|
+
export { type ObjectLikeSchema, type ObjectLikeUtils } from "./types";
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { BaseSchema, Schema } from "../../Schema";
|
|
2
|
-
export declare type ObjectLikeSchema<Raw, Parsed> = Schema<Raw, Parsed> &
|
|
3
|
-
export declare type BaseObjectLikeSchema<Raw, Parsed> = BaseSchema<Raw, Parsed> & {
|
|
4
|
-
_objectLike: void;
|
|
5
|
-
};
|
|
2
|
+
export declare type ObjectLikeSchema<Raw, Parsed> = Schema<Raw, Parsed> & BaseSchema<Raw, Parsed> & ObjectLikeUtils<Raw, Parsed>;
|
|
6
3
|
export interface ObjectLikeUtils<Raw, Parsed> {
|
|
7
|
-
|
|
4
|
+
withParsedProperties: <T extends Record<string, any>>(properties: {
|
|
8
5
|
[K in keyof T]: T[K] | ((parsed: Parsed) => T[K]);
|
|
9
6
|
}) => ObjectLikeSchema<Raw, Parsed & T>;
|
|
10
7
|
}
|
|
11
|
-
export declare const OBJECT_LIKE_BRAND: {
|
|
12
|
-
_objectLike: void;
|
|
13
|
-
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const any: () => import("
|
|
1
|
+
export declare const any: () => import("../../Schema").Schema<any, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const boolean: () => import("
|
|
1
|
+
export declare const boolean: () => import("../../Schema").Schema<boolean, boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const number: () => import("
|
|
1
|
+
export declare const number: () => import("../../Schema").Schema<number, number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const string: () => import("
|
|
1
|
+
export declare const string: () => import("../../Schema").Schema<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const unknown: () => import("
|
|
1
|
+
export declare const unknown: () => import("../../Schema").Schema<unknown, unknown>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Schema } from "../../Schema";
|
|
2
|
-
|
|
2
|
+
import { RecordSchema } from "./types";
|
|
3
|
+
export declare function record<RawKey extends string | number, RawValue, ParsedValue, ParsedKey extends string | number>(keySchema: Schema<RawKey, ParsedKey>, valueSchema: Schema<RawValue, ParsedValue>): RecordSchema<RawKey, RawValue, ParsedKey, ParsedValue>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BaseSchema } from "../../Schema";
|
|
2
|
+
import { OptionalRecord } from "../../utils/OptionalRecord";
|
|
3
|
+
import { SchemaUtils } from "../schema-utils";
|
|
4
|
+
export declare type RecordSchema<RawKey extends string | number, RawValue, ParsedKey extends string | number, ParsedValue> = BaseRecordSchema<RawKey, RawValue, ParsedKey, ParsedValue> & SchemaUtils<OptionalRecord<RawKey, RawValue>, OptionalRecord<ParsedKey, ParsedValue>>;
|
|
5
|
+
export declare type BaseRecordSchema<RawKey extends string | number, RawValue, ParsedKey extends string | number, ParsedValue> = BaseSchema<OptionalRecord<RawKey, RawValue>, OptionalRecord<ParsedKey, ParsedValue>>;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { BaseSchema, Schema } from "../../Schema";
|
|
2
|
-
import { OptionalSchema } from "./types";
|
|
1
|
+
import { BaseSchema, Schema, SchemaOptions } from "../../Schema";
|
|
3
2
|
export interface SchemaUtils<Raw, Parsed> {
|
|
4
|
-
optional: () =>
|
|
5
|
-
transform: <
|
|
3
|
+
optional: () => Schema<Raw | null | undefined, Parsed | undefined>;
|
|
4
|
+
transform: <Transformed>(transformer: SchemaTransformer<Parsed, Transformed>) => Schema<Raw, Transformed>;
|
|
5
|
+
parseOrThrow: (raw: unknown, opts?: SchemaOptions) => Promise<Parsed>;
|
|
6
|
+
jsonOrThrow: (raw: unknown, opts?: SchemaOptions) => Promise<Raw>;
|
|
7
|
+
}
|
|
8
|
+
export interface SchemaTransformer<Parsed, Transformed> {
|
|
9
|
+
transform: (parsed: Parsed) => Transformed;
|
|
10
|
+
untransform: (transformed: any) => Parsed;
|
|
6
11
|
}
|
|
7
12
|
export declare function getSchemaUtils<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): SchemaUtils<Raw, Parsed>;
|
|
8
13
|
/**
|
|
9
14
|
* schema utils are defined in one file to resolve issues with circular imports
|
|
10
15
|
*/
|
|
11
|
-
export declare function optional<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>):
|
|
12
|
-
export declare function transform<
|
|
16
|
+
export declare function optional<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): Schema<Raw | null | undefined, Parsed | undefined>;
|
|
17
|
+
export declare function transform<Raw, Parsed, Transformed>(schema: BaseSchema<Raw, Parsed>, transformer: SchemaTransformer<Parsed, Transformed>): Schema<Raw, Transformed>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type MaybePromise<T> = T | Promise<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type OptionalRecord<K extends string | number, V> = Record<K, V | undefined>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare type addQuestionMarksToNullableProperties<T> = {
|
|
2
|
-
[K in OptionalKeys<T>]?:
|
|
2
|
+
[K in OptionalKeys<T>]?: T[K];
|
|
3
3
|
} & Pick<T, RequiredKeys<T>>;
|
|
4
4
|
export declare type OptionalKeys<T> = {
|
|
5
|
-
[K in keyof T]: undefined extends T[K] ? K : never;
|
|
5
|
+
[K in keyof T]: undefined extends T[K] ? K : null extends T[K] ? K : never;
|
|
6
6
|
}[keyof T];
|
|
7
7
|
export declare type RequiredKeys<T> = {
|
|
8
|
-
[K in keyof T]: undefined extends T[K] ? never : K;
|
|
8
|
+
[K in keyof T]: undefined extends T[K] ? never : null extends T[K] ? never : K;
|
|
9
9
|
}[keyof T];
|
|
@@ -4,13 +4,6 @@
|
|
|
4
4
|
import * as serializers from "../../..";
|
|
5
5
|
import { FernVenusApi } from "../../../..";
|
|
6
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
7
|
export declare const Error: core.serialization.Schema<serializers.organization.addUser.Error.Raw, FernVenusApi.organization.addUser.Error>;
|
|
15
8
|
export declare namespace Error {
|
|
16
9
|
type Raw = Error.UnauthorizedError | Error.UserIdDoesNotExistError;
|
|
@@ -4,13 +4,6 @@
|
|
|
4
4
|
import * as serializers from "../../..";
|
|
5
5
|
import { FernVenusApi } from "../../../..";
|
|
6
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
7
|
export declare const Error: core.serialization.Schema<serializers.organization.create.Error.Raw, FernVenusApi.organization.create.Error>;
|
|
15
8
|
export declare namespace Error {
|
|
16
9
|
type Raw = Error.UnauthorizedError | Error.OrganizationAlreadyExistsError;
|
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
import * as serializers from "../../..";
|
|
5
5
|
import { FernVenusApi } from "../../../..";
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
|
-
export declare const Response: core.serialization.Schema<serializers.organization.get.Response.Raw, FernVenusApi.Organization>;
|
|
8
|
-
export declare namespace Response {
|
|
9
|
-
type Raw = serializers.Organization.Raw;
|
|
10
|
-
}
|
|
11
7
|
export declare const Error: core.serialization.Schema<serializers.organization.get.Error.Raw, FernVenusApi.organization.get.Error>;
|
|
12
8
|
export declare namespace Error {
|
|
13
9
|
type Raw = Error.UnauthorizedError;
|
package/types/serialization/resources/organization/client/getMyOrganizationFromScopedToken.d.ts
CHANGED
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
import * as serializers from "../../..";
|
|
5
5
|
import { FernVenusApi } from "../../../..";
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
|
-
export declare const Response: core.serialization.Schema<serializers.organization.getMyOrganizationFromScopedToken.Response.Raw, FernVenusApi.Organization>;
|
|
8
|
-
export declare namespace Response {
|
|
9
|
-
type Raw = serializers.Organization.Raw;
|
|
10
|
-
}
|
|
11
7
|
export declare const Error: core.serialization.Schema<serializers.organization.getMyOrganizationFromScopedToken.Error.Raw, FernVenusApi.organization.getMyOrganizationFromScopedToken.Error>;
|
|
12
8
|
export declare namespace Error {
|
|
13
9
|
type Raw = Error.UnauthorizedError;
|
|
@@ -0,0 +1,13 @@
|
|
|
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 AddUserToOrgRequest: core.serialization.Schema<serializers.AddUserToOrgRequest.Raw, FernVenusApi.AddUserToOrgRequest>;
|
|
8
|
+
export declare namespace AddUserToOrgRequest {
|
|
9
|
+
interface Raw {
|
|
10
|
+
userId: serializers.UserId.Raw;
|
|
11
|
+
orgId: serializers.OrganizationId.Raw;
|
|
12
|
+
}
|
|
13
|
+
}
|
package/types/serialization/resources/organization/client/requests/CreateOrganizationRequest.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
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 CreateOrganizationRequest: core.serialization.Schema<serializers.CreateOrganizationRequest.Raw, FernVenusApi.CreateOrganizationRequest>;
|
|
8
|
+
export declare namespace CreateOrganizationRequest {
|
|
9
|
+
interface Raw {
|
|
10
|
+
organizationId: serializers.OrganizationId.Raw;
|
|
11
|
+
artifactReadRequiresToken?: boolean | null;
|
|
12
|
+
}
|
|
13
|
+
}
|
package/types/serialization/resources/organization/client/requests/UpdateOrganizationRequest.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
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 UpdateOrganizationRequest: core.serialization.Schema<serializers.UpdateOrganizationRequest.Raw, FernVenusApi.UpdateOrganizationRequest>;
|
|
8
|
+
export declare namespace UpdateOrganizationRequest {
|
|
9
|
+
interface Raw {
|
|
10
|
+
artifactReadRequiresToken: boolean;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -4,12 +4,6 @@
|
|
|
4
4
|
import * as serializers from "../../..";
|
|
5
5
|
import { FernVenusApi } from "../../../..";
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
|
-
export declare const Request: core.serialization.Schema<serializers.organization.update.Request.Raw, FernVenusApi.UpdateOrganizationRequest>;
|
|
8
|
-
export declare namespace Request {
|
|
9
|
-
interface Raw {
|
|
10
|
-
artifactReadRequiresToken: boolean;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
7
|
export declare const Error: core.serialization.Schema<serializers.organization.update.Error.Raw, FernVenusApi.organization.update.Error>;
|
|
14
8
|
export declare namespace Error {
|
|
15
9
|
type Raw = Error.UnauthorizedError;
|
|
@@ -4,16 +4,6 @@
|
|
|
4
4
|
import * as serializers from "../../..";
|
|
5
5
|
import { FernVenusApi } from "../../../..";
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
|
-
export declare const Request: core.serialization.Schema<serializers.registry.generateRegistryTokens.Request.Raw, FernVenusApi.GenerateRegistryTokensRequest>;
|
|
8
|
-
export declare namespace Request {
|
|
9
|
-
interface Raw {
|
|
10
|
-
organizationId: serializers.OrganizationId.Raw;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export declare const Response: core.serialization.Schema<serializers.registry.generateRegistryTokens.Response.Raw, FernVenusApi.RegistryTokens>;
|
|
14
|
-
export declare namespace Response {
|
|
15
|
-
type Raw = serializers.RegistryTokens.Raw;
|
|
16
|
-
}
|
|
17
7
|
export declare const Error: core.serialization.Schema<serializers.registry.generateRegistryTokens.Error.Raw, FernVenusApi.registry.generateRegistryTokens.Error>;
|
|
18
8
|
export declare namespace Error {
|
|
19
9
|
type Raw = Error.UnauthorizedError | Error.OrganizationNotFoundError;
|
|
@@ -2,15 +2,8 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as serializers from "../../..";
|
|
5
|
-
import { FernVenusApi } from "../../../..";
|
|
6
5
|
import * as core from "../../../../core";
|
|
7
|
-
|
|
8
|
-
export declare namespace Request {
|
|
9
|
-
interface Raw {
|
|
10
|
-
organizationId: serializers.OrganizationId.Raw;
|
|
11
|
-
token?: serializers.RegistryToken.Raw | null;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
6
|
+
import { FernVenusApi } from "../../../..";
|
|
14
7
|
export declare const Response: core.serialization.Schema<serializers.registry.hasRegistryPermission.Response.Raw, boolean>;
|
|
15
8
|
export declare namespace Response {
|
|
16
9
|
type Raw = boolean;
|