@aurora-interactive/fankare-api-sdk 0.0.5 → 0.1.0
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/FUNCTIONS.md +0 -1
- package/README.md +28 -8
- package/esm/funcs/internal-asset-processing-callback.d.ts +17 -0
- package/esm/funcs/internal-asset-processing-callback.d.ts.map +1 -0
- package/esm/funcs/internal-asset-processing-callback.js +96 -0
- package/esm/funcs/internal-asset-processing-callback.js.map +1 -0
- package/esm/funcs/me-confirm-avatar-upload.d.ts +14 -0
- package/esm/funcs/me-confirm-avatar-upload.d.ts.map +1 -0
- package/esm/funcs/me-confirm-avatar-upload.js +78 -0
- package/esm/funcs/me-confirm-avatar-upload.js.map +1 -0
- package/esm/funcs/me-confirm-banner-upload.d.ts +14 -0
- package/esm/funcs/me-confirm-banner-upload.d.ts.map +1 -0
- package/esm/funcs/me-confirm-banner-upload.js +78 -0
- package/esm/funcs/me-confirm-banner-upload.js.map +1 -0
- package/esm/funcs/me-get-me.d.ts +14 -0
- package/esm/funcs/me-get-me.d.ts.map +1 -0
- package/esm/funcs/me-get-me.js +67 -0
- package/esm/funcs/me-get-me.js.map +1 -0
- package/esm/funcs/me-request-avatar-upload-url.d.ts +14 -0
- package/esm/funcs/me-request-avatar-upload-url.d.ts.map +1 -0
- package/esm/funcs/me-request-avatar-upload-url.js +78 -0
- package/esm/funcs/me-request-avatar-upload-url.js.map +1 -0
- package/esm/funcs/me-request-banner-upload-url.d.ts +14 -0
- package/esm/funcs/me-request-banner-upload-url.d.ts.map +1 -0
- package/esm/funcs/me-request-banner-upload-url.js +78 -0
- package/esm/funcs/me-request-banner-upload-url.js.map +1 -0
- package/esm/funcs/me-update-me.d.ts +14 -0
- package/esm/funcs/me-update-me.d.ts.map +1 -0
- package/esm/funcs/me-update-me.js +78 -0
- package/esm/funcs/me-update-me.js.map +1 -0
- package/esm/funcs/posts-create-post.d.ts +5 -3
- package/esm/funcs/posts-create-post.d.ts.map +1 -1
- package/esm/funcs/posts-create-post.js +5 -3
- package/esm/funcs/posts-create-post.js.map +1 -1
- package/esm/funcs/posts-delete-post.d.ts +13 -0
- package/esm/funcs/posts-delete-post.d.ts.map +1 -0
- package/esm/funcs/posts-delete-post.js +86 -0
- package/esm/funcs/posts-delete-post.js.map +1 -0
- package/esm/funcs/posts-get-post.d.ts +14 -0
- package/esm/funcs/posts-get-post.d.ts.map +1 -0
- package/esm/funcs/posts-get-post.js +87 -0
- package/esm/funcs/posts-get-post.js.map +1 -0
- package/esm/funcs/posts-update-post.d.ts +17 -0
- package/esm/funcs/posts-update-post.d.ts.map +1 -0
- package/esm/funcs/posts-update-post.js +92 -0
- package/esm/funcs/posts-update-post.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/asset-declaration.d.ts +52 -0
- package/esm/models/asset-declaration.d.ts.map +1 -0
- package/esm/models/asset-declaration.js +37 -0
- package/esm/models/asset-declaration.js.map +1 -0
- package/esm/models/asset-processing-callback-request.d.ts +39 -0
- package/esm/models/asset-processing-callback-request.d.ts.map +1 -0
- package/esm/models/asset-processing-callback-request.js +24 -0
- package/esm/models/asset-processing-callback-request.js.map +1 -0
- package/esm/models/create-post-request.d.ts +11 -22
- package/esm/models/create-post-request.d.ts.map +1 -1
- package/esm/models/create-post-request.js +3 -16
- package/esm/models/create-post-request.js.map +1 -1
- package/esm/models/create-post-response.d.ts +18 -0
- package/esm/models/create-post-response.d.ts.map +1 -0
- package/esm/models/create-post-response.js +17 -0
- package/esm/models/create-post-response.js.map +1 -0
- package/esm/models/index.d.ts +9 -0
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +9 -0
- package/esm/models/index.js.map +1 -1
- package/esm/models/media-asset.d.ts +11 -5
- package/esm/models/media-asset.d.ts.map +1 -1
- package/esm/models/media-asset.js +4 -5
- package/esm/models/media-asset.js.map +1 -1
- package/esm/models/operations/asset-processing-callback.d.ts +17 -0
- package/esm/models/operations/asset-processing-callback.d.ts.map +1 -0
- package/esm/models/operations/asset-processing-callback.js +16 -0
- package/esm/models/operations/asset-processing-callback.js.map +1 -0
- package/esm/models/operations/delete-post.d.ts +12 -0
- package/esm/models/operations/delete-post.d.ts.map +1 -0
- package/esm/models/operations/delete-post.js +13 -0
- package/esm/models/operations/delete-post.js.map +1 -0
- package/esm/models/operations/get-post.d.ts +12 -0
- package/esm/models/operations/get-post.d.ts.map +1 -0
- package/esm/models/operations/get-post.js +13 -0
- package/esm/models/operations/get-post.js.map +1 -0
- package/esm/models/operations/index.d.ts +4 -1
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +4 -1
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/update-post.d.ts +15 -0
- package/esm/models/operations/update-post.d.ts.map +1 -0
- package/esm/models/operations/update-post.js +15 -0
- package/esm/models/operations/update-post.js.map +1 -0
- package/esm/models/post.d.ts +20 -1
- package/esm/models/post.d.ts.map +1 -1
- package/esm/models/post.js +13 -1
- package/esm/models/post.js.map +1 -1
- package/esm/models/profile-media-confirm-request.d.ts +15 -0
- package/esm/models/profile-media-confirm-request.d.ts.map +1 -0
- package/esm/models/profile-media-confirm-request.js +13 -0
- package/esm/models/profile-media-confirm-request.js.map +1 -0
- package/esm/models/profile-media-upload-request.d.ts +30 -0
- package/esm/models/profile-media-upload-request.d.ts.map +1 -0
- package/esm/models/profile-media-upload-request.js +23 -0
- package/esm/models/profile-media-upload-request.js.map +1 -0
- package/esm/models/profile-media-upload-response.d.ts +21 -0
- package/esm/models/profile-media-upload-response.d.ts.map +1 -0
- package/esm/models/profile-media-upload-response.js +17 -0
- package/esm/models/profile-media-upload-response.js.map +1 -0
- package/esm/models/register-request.d.ts +2 -2
- package/esm/models/register-request.d.ts.map +1 -1
- package/esm/models/register-request.js +1 -1
- package/esm/models/register-request.js.map +1 -1
- package/esm/models/update-post-request.d.ts +30 -0
- package/esm/models/update-post-request.d.ts.map +1 -0
- package/esm/models/update-post-request.js +22 -0
- package/esm/models/update-post-request.js.map +1 -0
- package/esm/models/update-profile-request.d.ts +17 -0
- package/esm/models/update-profile-request.d.ts.map +1 -0
- package/esm/models/update-profile-request.js +14 -0
- package/esm/models/update-profile-request.js.map +1 -0
- package/esm/models/upload-slot.d.ts +29 -0
- package/esm/models/upload-slot.d.ts.map +1 -0
- package/esm/models/upload-slot.js +20 -0
- package/esm/models/upload-slot.js.map +1 -0
- package/esm/sdk/internal.d.ts +12 -0
- package/esm/sdk/internal.d.ts.map +1 -0
- package/esm/sdk/internal.js +19 -0
- package/esm/sdk/internal.js.map +1 -0
- package/esm/sdk/me.d.ts +29 -0
- package/esm/sdk/me.d.ts.map +1 -0
- package/esm/sdk/me.js +51 -0
- package/esm/sdk/me.js.map +1 -0
- package/esm/sdk/posts.d.ts +20 -3
- package/esm/sdk/posts.d.ts.map +1 -1
- package/esm/sdk/posts.js +28 -1
- package/esm/sdk/posts.js.map +1 -1
- package/esm/sdk/sdk.d.ts +6 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +10 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/examples/authenticationRegisterUser.example.ts +0 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/internal-asset-processing-callback.ts +190 -0
- package/src/funcs/me-confirm-avatar-upload.ts +161 -0
- package/src/funcs/me-confirm-banner-upload.ts +161 -0
- package/src/funcs/me-get-me.ts +142 -0
- package/src/funcs/me-request-avatar-upload-url.ts +161 -0
- package/src/funcs/me-request-banner-upload-url.ts +161 -0
- package/src/funcs/me-update-me.ts +161 -0
- package/src/funcs/posts-create-post.ts +9 -7
- package/src/funcs/posts-delete-post.ts +170 -0
- package/src/funcs/posts-get-post.ts +171 -0
- package/src/funcs/posts-update-post.ts +179 -0
- package/src/lib/config.ts +3 -3
- package/src/models/asset-declaration.ts +84 -0
- package/src/models/asset-processing-callback-request.ts +68 -0
- package/src/models/create-post-request.ts +17 -39
- package/src/models/create-post-response.ts +41 -0
- package/src/models/index.ts +9 -0
- package/src/models/media-asset.ts +16 -8
- package/src/models/operations/asset-processing-callback.ts +40 -0
- package/src/models/operations/delete-post.ts +31 -0
- package/src/models/operations/get-post.ts +27 -0
- package/src/models/operations/index.ts +4 -1
- package/src/models/operations/update-post.ts +35 -0
- package/src/models/post.ts +27 -2
- package/src/models/profile-media-confirm-request.ts +34 -0
- package/src/models/profile-media-upload-request.ts +55 -0
- package/src/models/profile-media-upload-response.ts +45 -0
- package/src/models/register-request.ts +3 -3
- package/src/models/update-post-request.ts +56 -0
- package/src/models/update-profile-request.ts +37 -0
- package/src/models/upload-slot.ts +53 -0
- package/src/sdk/internal.ts +32 -0
- package/src/sdk/me.ts +98 -0
- package/src/sdk/posts.ts +55 -3
- package/src/sdk/sdk.ts +12 -0
- package/src/models/operations/create-post.ts +0 -62
package/src/sdk/me.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: eeeab1031f91
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { meConfirmAvatarUpload } from "../funcs/me-confirm-avatar-upload.js";
|
|
7
|
+
import { meConfirmBannerUpload } from "../funcs/me-confirm-banner-upload.js";
|
|
8
|
+
import { meGetMe } from "../funcs/me-get-me.js";
|
|
9
|
+
import { meRequestAvatarUploadUrl } from "../funcs/me-request-avatar-upload-url.js";
|
|
10
|
+
import { meRequestBannerUploadUrl } from "../funcs/me-request-banner-upload-url.js";
|
|
11
|
+
import { meUpdateMe } from "../funcs/me-update-me.js";
|
|
12
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import * as models from "../models/index.js";
|
|
14
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
15
|
+
|
|
16
|
+
export class Me extends ClientSDK {
|
|
17
|
+
/**
|
|
18
|
+
* Get the authenticated user's own profile
|
|
19
|
+
*/
|
|
20
|
+
async getMe(
|
|
21
|
+
options?: RequestOptions,
|
|
22
|
+
): Promise<models.User> {
|
|
23
|
+
return unwrapAsync(meGetMe(
|
|
24
|
+
this,
|
|
25
|
+
options,
|
|
26
|
+
));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Update the authenticated user's profile text fields
|
|
31
|
+
*/
|
|
32
|
+
async updateMe(
|
|
33
|
+
request: models.UpdateProfileRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): Promise<models.User> {
|
|
36
|
+
return unwrapAsync(meUpdateMe(
|
|
37
|
+
this,
|
|
38
|
+
request,
|
|
39
|
+
options,
|
|
40
|
+
));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Request a presigned URL to upload or replace the authenticated user's avatar image
|
|
45
|
+
*/
|
|
46
|
+
async requestAvatarUploadUrl(
|
|
47
|
+
request: models.ProfileMediaUploadRequest,
|
|
48
|
+
options?: RequestOptions,
|
|
49
|
+
): Promise<models.ProfileMediaUploadResponse> {
|
|
50
|
+
return unwrapAsync(meRequestAvatarUploadUrl(
|
|
51
|
+
this,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Confirm a completed avatar upload and atomically update the user record
|
|
59
|
+
*/
|
|
60
|
+
async confirmAvatarUpload(
|
|
61
|
+
request: models.ProfileMediaConfirmRequest,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<models.User> {
|
|
64
|
+
return unwrapAsync(meConfirmAvatarUpload(
|
|
65
|
+
this,
|
|
66
|
+
request,
|
|
67
|
+
options,
|
|
68
|
+
));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Request a presigned URL to upload or replace the authenticated user's profile banner image
|
|
73
|
+
*/
|
|
74
|
+
async requestBannerUploadUrl(
|
|
75
|
+
request: models.ProfileMediaUploadRequest,
|
|
76
|
+
options?: RequestOptions,
|
|
77
|
+
): Promise<models.ProfileMediaUploadResponse> {
|
|
78
|
+
return unwrapAsync(meRequestBannerUploadUrl(
|
|
79
|
+
this,
|
|
80
|
+
request,
|
|
81
|
+
options,
|
|
82
|
+
));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Confirm a completed banner upload and atomically update the user record
|
|
87
|
+
*/
|
|
88
|
+
async confirmBannerUpload(
|
|
89
|
+
request: models.ProfileMediaConfirmRequest,
|
|
90
|
+
options?: RequestOptions,
|
|
91
|
+
): Promise<models.User> {
|
|
92
|
+
return unwrapAsync(meConfirmBannerUpload(
|
|
93
|
+
this,
|
|
94
|
+
request,
|
|
95
|
+
options,
|
|
96
|
+
));
|
|
97
|
+
}
|
|
98
|
+
}
|
package/src/sdk/posts.ts
CHANGED
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { postsCreatePost } from "../funcs/posts-create-post.js";
|
|
7
|
+
import { postsDeletePost } from "../funcs/posts-delete-post.js";
|
|
7
8
|
import { postsGetCollectionFeed } from "../funcs/posts-get-collection-feed.js";
|
|
8
9
|
import { postsGetFeed } from "../funcs/posts-get-feed.js";
|
|
10
|
+
import { postsGetPost } from "../funcs/posts-get-post.js";
|
|
11
|
+
import { postsUpdatePost } from "../funcs/posts-update-post.js";
|
|
9
12
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
10
13
|
import * as models from "../models/index.js";
|
|
11
|
-
import * as operations from "../models/operations/index.js";
|
|
12
14
|
import { unwrapAsync } from "../types/fp.js";
|
|
13
15
|
|
|
14
16
|
export class Posts extends ClientSDK {
|
|
@@ -29,12 +31,15 @@ export class Posts extends ClientSDK {
|
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
/**
|
|
32
|
-
*
|
|
34
|
+
* Initiate a new post: reserve asset slots and receive presigned upload URLs
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* Creates a post record in DRAFT status and reserves one upload slot per declared asset, returning a presigned PUT URL for each. The client uploads each file directly to SeaweedFS using the provided URL. After all uploads are complete the client calls PATCH /posts/{postId} to publish the post. The post is not visible in any feed until it reaches the PUBLISHED status.
|
|
33
38
|
*/
|
|
34
39
|
async createPost(
|
|
35
40
|
request: models.CreatePostRequest,
|
|
36
41
|
options?: RequestOptions,
|
|
37
|
-
): Promise<
|
|
42
|
+
): Promise<models.CreatePostResponse> {
|
|
38
43
|
return unwrapAsync(postsCreatePost(
|
|
39
44
|
this,
|
|
40
45
|
request,
|
|
@@ -42,6 +47,53 @@ export class Posts extends ClientSDK {
|
|
|
42
47
|
));
|
|
43
48
|
}
|
|
44
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Fetch a single post by ID, including all asset statuses
|
|
52
|
+
*/
|
|
53
|
+
async getPost(
|
|
54
|
+
postId: number,
|
|
55
|
+
options?: RequestOptions,
|
|
56
|
+
): Promise<models.Post> {
|
|
57
|
+
return unwrapAsync(postsGetPost(
|
|
58
|
+
this,
|
|
59
|
+
postId,
|
|
60
|
+
options,
|
|
61
|
+
));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Publish or update a post
|
|
66
|
+
*
|
|
67
|
+
* @remarks
|
|
68
|
+
* Used to publish a DRAFT post once all asset uploads are complete, or to update the caption of an already-published post. Setting status to PUBLISHED triggers a server-side check that all required assets have been received by the object store before making the post visible in feeds. A post with assets still in PROCESSING state cannot be published.
|
|
69
|
+
*/
|
|
70
|
+
async updatePost(
|
|
71
|
+
postId: number,
|
|
72
|
+
body: models.UpdatePostRequest,
|
|
73
|
+
options?: RequestOptions,
|
|
74
|
+
): Promise<models.Post> {
|
|
75
|
+
return unwrapAsync(postsUpdatePost(
|
|
76
|
+
this,
|
|
77
|
+
postId,
|
|
78
|
+
body,
|
|
79
|
+
options,
|
|
80
|
+
));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Delete a post and cascade-delete all associated assets from object storage
|
|
85
|
+
*/
|
|
86
|
+
async deletePost(
|
|
87
|
+
postId: number,
|
|
88
|
+
options?: RequestOptions,
|
|
89
|
+
): Promise<void> {
|
|
90
|
+
return unwrapAsync(postsDeletePost(
|
|
91
|
+
this,
|
|
92
|
+
postId,
|
|
93
|
+
options,
|
|
94
|
+
));
|
|
95
|
+
}
|
|
96
|
+
|
|
45
97
|
/**
|
|
46
98
|
* Get a timeline filtered strictly by members of this collection with pagination
|
|
47
99
|
*/
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -8,6 +8,8 @@ import { Authentication } from "./authentication.js";
|
|
|
8
8
|
import { CreatorTimelines } from "./creator-timelines.js";
|
|
9
9
|
import { CustomCollections } from "./custom-collections.js";
|
|
10
10
|
import { DirectMessaging } from "./direct-messaging.js";
|
|
11
|
+
import { Internal } from "./internal.js";
|
|
12
|
+
import { Me } from "./me.js";
|
|
11
13
|
import { Posts } from "./posts.js";
|
|
12
14
|
import { Subscriptions } from "./subscriptions.js";
|
|
13
15
|
import { UserDiscovery } from "./user-discovery.js";
|
|
@@ -18,6 +20,11 @@ export class FankareSDK extends ClientSDK {
|
|
|
18
20
|
return (this._authentication ??= new Authentication(this._options));
|
|
19
21
|
}
|
|
20
22
|
|
|
23
|
+
private _me?: Me;
|
|
24
|
+
get me(): Me {
|
|
25
|
+
return (this._me ??= new Me(this._options));
|
|
26
|
+
}
|
|
27
|
+
|
|
21
28
|
private _userDiscovery?: UserDiscovery;
|
|
22
29
|
get userDiscovery(): UserDiscovery {
|
|
23
30
|
return (this._userDiscovery ??= new UserDiscovery(this._options));
|
|
@@ -38,6 +45,11 @@ export class FankareSDK extends ClientSDK {
|
|
|
38
45
|
return (this._posts ??= new Posts(this._options));
|
|
39
46
|
}
|
|
40
47
|
|
|
48
|
+
private _internal?: Internal;
|
|
49
|
+
get internal(): Internal {
|
|
50
|
+
return (this._internal ??= new Internal(this._options));
|
|
51
|
+
}
|
|
52
|
+
|
|
41
53
|
private _directMessaging?: DirectMessaging;
|
|
42
54
|
get directMessaging(): DirectMessaging {
|
|
43
55
|
return (this._directMessaging ??= new DirectMessaging(this._options));
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 3a70fdfe59ab
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import * as z from "zod/v4-mini";
|
|
7
|
-
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
-
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
-
import * as types from "../../types/primitives.js";
|
|
10
|
-
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
11
|
-
|
|
12
|
-
export type UploadSlot = {
|
|
13
|
-
assetId?: number | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Target S3 file bucket reference pointer link generated for direct routing push.
|
|
16
|
-
*/
|
|
17
|
-
uploadUrl?: string | undefined;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Post metadata accepted. Collection upload instructions map generated.
|
|
22
|
-
*/
|
|
23
|
-
export type CreatePostResponse = {
|
|
24
|
-
postId?: number | undefined;
|
|
25
|
-
uploadSlots?: Array<UploadSlot> | undefined;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/** @internal */
|
|
29
|
-
export const UploadSlot$inboundSchema: z.ZodMiniType<UploadSlot, unknown> = z
|
|
30
|
-
.object({
|
|
31
|
-
assetId: types.optional(types.number()),
|
|
32
|
-
uploadUrl: types.optional(types.string()),
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export function uploadSlotFromJSON(
|
|
36
|
-
jsonString: string,
|
|
37
|
-
): SafeParseResult<UploadSlot, SDKValidationError> {
|
|
38
|
-
return safeParse(
|
|
39
|
-
jsonString,
|
|
40
|
-
(x) => UploadSlot$inboundSchema.parse(JSON.parse(x)),
|
|
41
|
-
`Failed to parse 'UploadSlot' from JSON`,
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/** @internal */
|
|
46
|
-
export const CreatePostResponse$inboundSchema: z.ZodMiniType<
|
|
47
|
-
CreatePostResponse,
|
|
48
|
-
unknown
|
|
49
|
-
> = z.object({
|
|
50
|
-
postId: types.optional(types.number()),
|
|
51
|
-
uploadSlots: types.optional(z.array(z.lazy(() => UploadSlot$inboundSchema))),
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
export function createPostResponseFromJSON(
|
|
55
|
-
jsonString: string,
|
|
56
|
-
): SafeParseResult<CreatePostResponse, SDKValidationError> {
|
|
57
|
-
return safeParse(
|
|
58
|
-
jsonString,
|
|
59
|
-
(x) => CreatePostResponse$inboundSchema.parse(JSON.parse(x)),
|
|
60
|
-
`Failed to parse 'CreatePostResponse' from JSON`,
|
|
61
|
-
);
|
|
62
|
-
}
|