@aurora-interactive/fankare-api-sdk 0.0.4 → 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.
Files changed (177) hide show
  1. package/README.md +28 -2
  2. package/esm/funcs/internal-asset-processing-callback.d.ts +17 -0
  3. package/esm/funcs/internal-asset-processing-callback.d.ts.map +1 -0
  4. package/esm/funcs/internal-asset-processing-callback.js +96 -0
  5. package/esm/funcs/internal-asset-processing-callback.js.map +1 -0
  6. package/esm/funcs/me-confirm-avatar-upload.d.ts +14 -0
  7. package/esm/funcs/me-confirm-avatar-upload.d.ts.map +1 -0
  8. package/esm/funcs/me-confirm-avatar-upload.js +78 -0
  9. package/esm/funcs/me-confirm-avatar-upload.js.map +1 -0
  10. package/esm/funcs/me-confirm-banner-upload.d.ts +14 -0
  11. package/esm/funcs/me-confirm-banner-upload.d.ts.map +1 -0
  12. package/esm/funcs/me-confirm-banner-upload.js +78 -0
  13. package/esm/funcs/me-confirm-banner-upload.js.map +1 -0
  14. package/esm/funcs/me-get-me.d.ts +14 -0
  15. package/esm/funcs/me-get-me.d.ts.map +1 -0
  16. package/esm/funcs/me-get-me.js +67 -0
  17. package/esm/funcs/me-get-me.js.map +1 -0
  18. package/esm/funcs/me-request-avatar-upload-url.d.ts +14 -0
  19. package/esm/funcs/me-request-avatar-upload-url.d.ts.map +1 -0
  20. package/esm/funcs/me-request-avatar-upload-url.js +78 -0
  21. package/esm/funcs/me-request-avatar-upload-url.js.map +1 -0
  22. package/esm/funcs/me-request-banner-upload-url.d.ts +14 -0
  23. package/esm/funcs/me-request-banner-upload-url.d.ts.map +1 -0
  24. package/esm/funcs/me-request-banner-upload-url.js +78 -0
  25. package/esm/funcs/me-request-banner-upload-url.js.map +1 -0
  26. package/esm/funcs/me-update-me.d.ts +14 -0
  27. package/esm/funcs/me-update-me.d.ts.map +1 -0
  28. package/esm/funcs/me-update-me.js +78 -0
  29. package/esm/funcs/me-update-me.js.map +1 -0
  30. package/esm/funcs/posts-create-post.d.ts +5 -3
  31. package/esm/funcs/posts-create-post.d.ts.map +1 -1
  32. package/esm/funcs/posts-create-post.js +5 -3
  33. package/esm/funcs/posts-create-post.js.map +1 -1
  34. package/esm/funcs/posts-delete-post.d.ts +13 -0
  35. package/esm/funcs/posts-delete-post.d.ts.map +1 -0
  36. package/esm/funcs/posts-delete-post.js +86 -0
  37. package/esm/funcs/posts-delete-post.js.map +1 -0
  38. package/esm/funcs/posts-get-post.d.ts +14 -0
  39. package/esm/funcs/posts-get-post.d.ts.map +1 -0
  40. package/esm/funcs/posts-get-post.js +87 -0
  41. package/esm/funcs/posts-get-post.js.map +1 -0
  42. package/esm/funcs/posts-update-post.d.ts +17 -0
  43. package/esm/funcs/posts-update-post.d.ts.map +1 -0
  44. package/esm/funcs/posts-update-post.js +92 -0
  45. package/esm/funcs/posts-update-post.js.map +1 -0
  46. package/esm/lib/config.d.ts +3 -3
  47. package/esm/lib/config.js +3 -3
  48. package/esm/models/asset-declaration.d.ts +52 -0
  49. package/esm/models/asset-declaration.d.ts.map +1 -0
  50. package/esm/models/asset-declaration.js +37 -0
  51. package/esm/models/asset-declaration.js.map +1 -0
  52. package/esm/models/asset-processing-callback-request.d.ts +39 -0
  53. package/esm/models/asset-processing-callback-request.d.ts.map +1 -0
  54. package/esm/models/asset-processing-callback-request.js +24 -0
  55. package/esm/models/asset-processing-callback-request.js.map +1 -0
  56. package/esm/models/create-post-request.d.ts +11 -22
  57. package/esm/models/create-post-request.d.ts.map +1 -1
  58. package/esm/models/create-post-request.js +3 -16
  59. package/esm/models/create-post-request.js.map +1 -1
  60. package/esm/models/create-post-response.d.ts +18 -0
  61. package/esm/models/create-post-response.d.ts.map +1 -0
  62. package/esm/models/create-post-response.js +17 -0
  63. package/esm/models/create-post-response.js.map +1 -0
  64. package/esm/models/index.d.ts +9 -0
  65. package/esm/models/index.d.ts.map +1 -1
  66. package/esm/models/index.js +9 -0
  67. package/esm/models/index.js.map +1 -1
  68. package/esm/models/media-asset.d.ts +11 -5
  69. package/esm/models/media-asset.d.ts.map +1 -1
  70. package/esm/models/media-asset.js +4 -5
  71. package/esm/models/media-asset.js.map +1 -1
  72. package/esm/models/operations/asset-processing-callback.d.ts +17 -0
  73. package/esm/models/operations/asset-processing-callback.d.ts.map +1 -0
  74. package/esm/models/operations/asset-processing-callback.js +16 -0
  75. package/esm/models/operations/asset-processing-callback.js.map +1 -0
  76. package/esm/models/operations/delete-post.d.ts +12 -0
  77. package/esm/models/operations/delete-post.d.ts.map +1 -0
  78. package/esm/models/operations/delete-post.js +13 -0
  79. package/esm/models/operations/delete-post.js.map +1 -0
  80. package/esm/models/operations/get-post.d.ts +12 -0
  81. package/esm/models/operations/get-post.d.ts.map +1 -0
  82. package/esm/models/operations/get-post.js +13 -0
  83. package/esm/models/operations/get-post.js.map +1 -0
  84. package/esm/models/operations/index.d.ts +4 -1
  85. package/esm/models/operations/index.d.ts.map +1 -1
  86. package/esm/models/operations/index.js +4 -1
  87. package/esm/models/operations/index.js.map +1 -1
  88. package/esm/models/operations/update-post.d.ts +15 -0
  89. package/esm/models/operations/update-post.d.ts.map +1 -0
  90. package/esm/models/operations/update-post.js +15 -0
  91. package/esm/models/operations/update-post.js.map +1 -0
  92. package/esm/models/post.d.ts +20 -1
  93. package/esm/models/post.d.ts.map +1 -1
  94. package/esm/models/post.js +13 -1
  95. package/esm/models/post.js.map +1 -1
  96. package/esm/models/profile-media-confirm-request.d.ts +15 -0
  97. package/esm/models/profile-media-confirm-request.d.ts.map +1 -0
  98. package/esm/models/profile-media-confirm-request.js +13 -0
  99. package/esm/models/profile-media-confirm-request.js.map +1 -0
  100. package/esm/models/profile-media-upload-request.d.ts +30 -0
  101. package/esm/models/profile-media-upload-request.d.ts.map +1 -0
  102. package/esm/models/profile-media-upload-request.js +23 -0
  103. package/esm/models/profile-media-upload-request.js.map +1 -0
  104. package/esm/models/profile-media-upload-response.d.ts +21 -0
  105. package/esm/models/profile-media-upload-response.d.ts.map +1 -0
  106. package/esm/models/profile-media-upload-response.js +17 -0
  107. package/esm/models/profile-media-upload-response.js.map +1 -0
  108. package/esm/models/register-request.d.ts +2 -0
  109. package/esm/models/register-request.d.ts.map +1 -1
  110. package/esm/models/register-request.js +1 -0
  111. package/esm/models/register-request.js.map +1 -1
  112. package/esm/models/update-post-request.d.ts +30 -0
  113. package/esm/models/update-post-request.d.ts.map +1 -0
  114. package/esm/models/update-post-request.js +22 -0
  115. package/esm/models/update-post-request.js.map +1 -0
  116. package/esm/models/update-profile-request.d.ts +17 -0
  117. package/esm/models/update-profile-request.d.ts.map +1 -0
  118. package/esm/models/update-profile-request.js +14 -0
  119. package/esm/models/update-profile-request.js.map +1 -0
  120. package/esm/models/upload-slot.d.ts +29 -0
  121. package/esm/models/upload-slot.d.ts.map +1 -0
  122. package/esm/models/upload-slot.js +20 -0
  123. package/esm/models/upload-slot.js.map +1 -0
  124. package/esm/sdk/internal.d.ts +12 -0
  125. package/esm/sdk/internal.d.ts.map +1 -0
  126. package/esm/sdk/internal.js +19 -0
  127. package/esm/sdk/internal.js.map +1 -0
  128. package/esm/sdk/me.d.ts +29 -0
  129. package/esm/sdk/me.d.ts.map +1 -0
  130. package/esm/sdk/me.js +51 -0
  131. package/esm/sdk/me.js.map +1 -0
  132. package/esm/sdk/posts.d.ts +20 -3
  133. package/esm/sdk/posts.d.ts.map +1 -1
  134. package/esm/sdk/posts.js +28 -1
  135. package/esm/sdk/posts.js.map +1 -1
  136. package/esm/sdk/sdk.d.ts +6 -0
  137. package/esm/sdk/sdk.d.ts.map +1 -1
  138. package/esm/sdk/sdk.js +10 -0
  139. package/esm/sdk/sdk.js.map +1 -1
  140. package/jsr.json +1 -1
  141. package/package.json +1 -1
  142. package/src/funcs/internal-asset-processing-callback.ts +190 -0
  143. package/src/funcs/me-confirm-avatar-upload.ts +161 -0
  144. package/src/funcs/me-confirm-banner-upload.ts +161 -0
  145. package/src/funcs/me-get-me.ts +142 -0
  146. package/src/funcs/me-request-avatar-upload-url.ts +161 -0
  147. package/src/funcs/me-request-banner-upload-url.ts +161 -0
  148. package/src/funcs/me-update-me.ts +161 -0
  149. package/src/funcs/posts-create-post.ts +9 -7
  150. package/src/funcs/posts-delete-post.ts +170 -0
  151. package/src/funcs/posts-get-post.ts +171 -0
  152. package/src/funcs/posts-update-post.ts +179 -0
  153. package/src/lib/config.ts +3 -3
  154. package/src/models/asset-declaration.ts +84 -0
  155. package/src/models/asset-processing-callback-request.ts +68 -0
  156. package/src/models/create-post-request.ts +17 -39
  157. package/src/models/create-post-response.ts +41 -0
  158. package/src/models/index.ts +9 -0
  159. package/src/models/media-asset.ts +16 -8
  160. package/src/models/operations/asset-processing-callback.ts +40 -0
  161. package/src/models/operations/delete-post.ts +31 -0
  162. package/src/models/operations/get-post.ts +27 -0
  163. package/src/models/operations/index.ts +4 -1
  164. package/src/models/operations/update-post.ts +35 -0
  165. package/src/models/post.ts +27 -2
  166. package/src/models/profile-media-confirm-request.ts +34 -0
  167. package/src/models/profile-media-upload-request.ts +55 -0
  168. package/src/models/profile-media-upload-response.ts +45 -0
  169. package/src/models/register-request.ts +3 -0
  170. package/src/models/update-post-request.ts +56 -0
  171. package/src/models/update-profile-request.ts +37 -0
  172. package/src/models/upload-slot.ts +53 -0
  173. package/src/sdk/internal.ts +32 -0
  174. package/src/sdk/me.ts +98 -0
  175. package/src/sdk/posts.ts +55 -3
  176. package/src/sdk/sdk.ts +12 -0
  177. package/src/models/operations/create-post.ts +0 -62
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: ca5a5edf4af7
4
+ */
5
+
6
+ import * as z from "zod/v4-mini";
7
+ import * as models from "../index.js";
8
+
9
+ export type UpdatePostRequest = {
10
+ postId: number;
11
+ body: models.UpdatePostRequest;
12
+ };
13
+
14
+ /** @internal */
15
+ export type UpdatePostRequest$Outbound = {
16
+ postId: number;
17
+ body: models.UpdatePostRequest$Outbound;
18
+ };
19
+
20
+ /** @internal */
21
+ export const UpdatePostRequest$outboundSchema: z.ZodMiniType<
22
+ UpdatePostRequest$Outbound,
23
+ UpdatePostRequest
24
+ > = z.object({
25
+ postId: z.int(),
26
+ body: models.UpdatePostRequest$outboundSchema,
27
+ });
28
+
29
+ export function updatePostRequestToJSON(
30
+ updatePostRequest: UpdatePostRequest,
31
+ ): string {
32
+ return JSON.stringify(
33
+ UpdatePostRequest$outboundSchema.parse(updatePostRequest),
34
+ );
35
+ }
@@ -5,26 +5,51 @@
5
5
 
6
6
  import * as z from "zod/v4-mini";
7
7
  import { safeParse } from "../lib/schemas.js";
8
+ import * as openEnums from "../types/enums.js";
9
+ import { OpenEnum } from "../types/enums.js";
8
10
  import { Result as SafeParseResult } from "../types/fp.js";
9
11
  import * as types from "../types/primitives.js";
10
12
  import { SDKValidationError } from "./errors/sdk-validation-error.js";
11
13
  import { MediaAsset, MediaAsset$inboundSchema } from "./media-asset.js";
12
14
 
15
+ /**
16
+ * DRAFT posts are only visible to the owning creator. PUBLISHED posts appear in subscriber feeds.
17
+ */
18
+ export const PostStatus = {
19
+ Draft: "DRAFT",
20
+ Published: "PUBLISHED",
21
+ } as const;
22
+ /**
23
+ * DRAFT posts are only visible to the owning creator. PUBLISHED posts appear in subscriber feeds.
24
+ */
25
+ export type PostStatus = OpenEnum<typeof PostStatus>;
26
+
13
27
  export type Post = {
14
28
  id?: number | undefined;
15
29
  userId?: number | undefined;
16
- caption?: string | undefined;
30
+ caption?: string | null | undefined;
31
+ /**
32
+ * DRAFT posts are only visible to the owning creator. PUBLISHED posts appear in subscriber feeds.
33
+ */
34
+ status?: PostStatus | undefined;
17
35
  assets?: Array<MediaAsset> | undefined;
18
36
  createdAt?: Date | undefined;
37
+ updatedAt?: Date | undefined;
19
38
  };
20
39
 
40
+ /** @internal */
41
+ export const PostStatus$inboundSchema: z.ZodMiniType<PostStatus, unknown> =
42
+ openEnums.inboundSchema(PostStatus);
43
+
21
44
  /** @internal */
22
45
  export const Post$inboundSchema: z.ZodMiniType<Post, unknown> = z.object({
23
46
  id: types.optional(types.number()),
24
47
  userId: types.optional(types.number()),
25
- caption: types.optional(types.string()),
48
+ caption: z.optional(z.nullable(types.string())),
49
+ status: types.optional(PostStatus$inboundSchema),
26
50
  assets: types.optional(z.array(MediaAsset$inboundSchema)),
27
51
  createdAt: types.optional(types.date()),
52
+ updatedAt: types.optional(types.date()),
28
53
  });
29
54
 
30
55
  export function postFromJSON(
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 798bece0ede8
4
+ */
5
+
6
+ import * as z from "zod/v4-mini";
7
+
8
+ export type ProfileMediaConfirmRequest = {
9
+ /**
10
+ * The mediaKey value returned by the corresponding upload-url response. The gateway verifies a HMAC signature embedded in the key to prevent clients from supplying arbitrary paths.
11
+ */
12
+ mediaKey: string;
13
+ };
14
+
15
+ /** @internal */
16
+ export type ProfileMediaConfirmRequest$Outbound = {
17
+ mediaKey: string;
18
+ };
19
+
20
+ /** @internal */
21
+ export const ProfileMediaConfirmRequest$outboundSchema: z.ZodMiniType<
22
+ ProfileMediaConfirmRequest$Outbound,
23
+ ProfileMediaConfirmRequest
24
+ > = z.object({
25
+ mediaKey: z.string(),
26
+ });
27
+
28
+ export function profileMediaConfirmRequestToJSON(
29
+ profileMediaConfirmRequest: ProfileMediaConfirmRequest,
30
+ ): string {
31
+ return JSON.stringify(
32
+ ProfileMediaConfirmRequest$outboundSchema.parse(profileMediaConfirmRequest),
33
+ );
34
+ }
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: a4c6edf5ee58
4
+ */
5
+
6
+ import * as z from "zod/v4-mini";
7
+ import { ClosedEnum } from "../types/enums.js";
8
+
9
+ /**
10
+ * MIME type of the file to be uploaded. Must be an accepted image type.
11
+ */
12
+ export const ProfileMediaUploadRequestContentType = {
13
+ ImageJpeg: "image/jpeg",
14
+ ImagePng: "image/png",
15
+ ImageWebp: "image/webp",
16
+ } as const;
17
+ /**
18
+ * MIME type of the file to be uploaded. Must be an accepted image type.
19
+ */
20
+ export type ProfileMediaUploadRequestContentType = ClosedEnum<
21
+ typeof ProfileMediaUploadRequestContentType
22
+ >;
23
+
24
+ export type ProfileMediaUploadRequest = {
25
+ /**
26
+ * MIME type of the file to be uploaded. Must be an accepted image type.
27
+ */
28
+ contentType: ProfileMediaUploadRequestContentType;
29
+ };
30
+
31
+ /** @internal */
32
+ export const ProfileMediaUploadRequestContentType$outboundSchema: z.ZodMiniEnum<
33
+ typeof ProfileMediaUploadRequestContentType
34
+ > = z.enum(ProfileMediaUploadRequestContentType);
35
+
36
+ /** @internal */
37
+ export type ProfileMediaUploadRequest$Outbound = {
38
+ contentType: string;
39
+ };
40
+
41
+ /** @internal */
42
+ export const ProfileMediaUploadRequest$outboundSchema: z.ZodMiniType<
43
+ ProfileMediaUploadRequest$Outbound,
44
+ ProfileMediaUploadRequest
45
+ > = z.object({
46
+ contentType: ProfileMediaUploadRequestContentType$outboundSchema,
47
+ });
48
+
49
+ export function profileMediaUploadRequestToJSON(
50
+ profileMediaUploadRequest: ProfileMediaUploadRequest,
51
+ ): string {
52
+ return JSON.stringify(
53
+ ProfileMediaUploadRequest$outboundSchema.parse(profileMediaUploadRequest),
54
+ );
55
+ }
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 1829b849d292
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 ProfileMediaUploadResponse = {
13
+ /**
14
+ * Presigned HTTP PUT URL targeting the SeaweedFS volume. The client must issue a single PUT request with the binary file body and the matching Content-Type header. The URL is valid for the duration indicated by expiresInSeconds.
15
+ */
16
+ uploadUrl?: string | undefined;
17
+ /**
18
+ * The canonical SeaweedFS object key that will be persisted to the user record upon confirm. The client does not need to parse or store this value; it is echoed back in the confirm request body.
19
+ */
20
+ mediaKey?: string | undefined;
21
+ /**
22
+ * Number of seconds from now until the presigned URL expires.
23
+ */
24
+ expiresInSeconds?: number | undefined;
25
+ };
26
+
27
+ /** @internal */
28
+ export const ProfileMediaUploadResponse$inboundSchema: z.ZodMiniType<
29
+ ProfileMediaUploadResponse,
30
+ unknown
31
+ > = z.object({
32
+ uploadUrl: types.optional(types.string()),
33
+ mediaKey: types.optional(types.string()),
34
+ expiresInSeconds: types.optional(types.number()),
35
+ });
36
+
37
+ export function profileMediaUploadResponseFromJSON(
38
+ jsonString: string,
39
+ ): SafeParseResult<ProfileMediaUploadResponse, SDKValidationError> {
40
+ return safeParse(
41
+ jsonString,
42
+ (x) => ProfileMediaUploadResponse$inboundSchema.parse(JSON.parse(x)),
43
+ `Failed to parse 'ProfileMediaUploadResponse' from JSON`,
44
+ );
45
+ }
@@ -10,6 +10,7 @@ export type RegisterRequest = {
10
10
  email: string;
11
11
  password: string;
12
12
  displayName: string;
13
+ bio?: string | null | undefined;
13
14
  };
14
15
 
15
16
  /** @internal */
@@ -18,6 +19,7 @@ export type RegisterRequest$Outbound = {
18
19
  email: string;
19
20
  password: string;
20
21
  displayName: string;
22
+ bio?: string | null | undefined;
21
23
  };
22
24
 
23
25
  /** @internal */
@@ -29,6 +31,7 @@ export const RegisterRequest$outboundSchema: z.ZodMiniType<
29
31
  email: z.string(),
30
32
  password: z.string(),
31
33
  displayName: z.string(),
34
+ bio: z.optional(z.nullable(z.string())),
32
35
  });
33
36
 
34
37
  export function registerRequestToJSON(
@@ -0,0 +1,56 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 718707107a86
4
+ */
5
+
6
+ import * as z from "zod/v4-mini";
7
+ import { ClosedEnum } from "../types/enums.js";
8
+
9
+ /**
10
+ * Set to PUBLISHED to make the post visible to subscribers. The server validates that all asset slots are in READY status before allowing the transition. Cannot be used to revert a published post to DRAFT.
11
+ */
12
+ export const UpdatePostRequestStatus = {
13
+ Published: "PUBLISHED",
14
+ } as const;
15
+ /**
16
+ * Set to PUBLISHED to make the post visible to subscribers. The server validates that all asset slots are in READY status before allowing the transition. Cannot be used to revert a published post to DRAFT.
17
+ */
18
+ export type UpdatePostRequestStatus = ClosedEnum<
19
+ typeof UpdatePostRequestStatus
20
+ >;
21
+
22
+ export type UpdatePostRequest = {
23
+ caption?: string | null | undefined;
24
+ /**
25
+ * Set to PUBLISHED to make the post visible to subscribers. The server validates that all asset slots are in READY status before allowing the transition. Cannot be used to revert a published post to DRAFT.
26
+ */
27
+ status?: UpdatePostRequestStatus | undefined;
28
+ };
29
+
30
+ /** @internal */
31
+ export const UpdatePostRequestStatus$outboundSchema: z.ZodMiniEnum<
32
+ typeof UpdatePostRequestStatus
33
+ > = z.enum(UpdatePostRequestStatus);
34
+
35
+ /** @internal */
36
+ export type UpdatePostRequest$Outbound = {
37
+ caption?: string | null | undefined;
38
+ status?: string | undefined;
39
+ };
40
+
41
+ /** @internal */
42
+ export const UpdatePostRequest$outboundSchema: z.ZodMiniType<
43
+ UpdatePostRequest$Outbound,
44
+ UpdatePostRequest
45
+ > = z.object({
46
+ caption: z.optional(z.nullable(z.string())),
47
+ status: z.optional(UpdatePostRequestStatus$outboundSchema),
48
+ });
49
+
50
+ export function updatePostRequestToJSON(
51
+ updatePostRequest: UpdatePostRequest,
52
+ ): string {
53
+ return JSON.stringify(
54
+ UpdatePostRequest$outboundSchema.parse(updatePostRequest),
55
+ );
56
+ }
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 689ebe29e921
4
+ */
5
+
6
+ import * as z from "zod/v4-mini";
7
+
8
+ /**
9
+ * All fields are optional; only supplied fields are updated.
10
+ */
11
+ export type UpdateProfileRequest = {
12
+ displayName?: string | undefined;
13
+ bio?: string | null | undefined;
14
+ };
15
+
16
+ /** @internal */
17
+ export type UpdateProfileRequest$Outbound = {
18
+ displayName?: string | undefined;
19
+ bio?: string | null | undefined;
20
+ };
21
+
22
+ /** @internal */
23
+ export const UpdateProfileRequest$outboundSchema: z.ZodMiniType<
24
+ UpdateProfileRequest$Outbound,
25
+ UpdateProfileRequest
26
+ > = z.object({
27
+ displayName: z.optional(z.string()),
28
+ bio: z.optional(z.nullable(z.string())),
29
+ });
30
+
31
+ export function updateProfileRequestToJSON(
32
+ updateProfileRequest: UpdateProfileRequest,
33
+ ): string {
34
+ return JSON.stringify(
35
+ UpdateProfileRequest$outboundSchema.parse(updateProfileRequest),
36
+ );
37
+ }
@@ -0,0 +1,53 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: e1f3fc29096e
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
+ /**
14
+ * ID of the post_assets row created for this slot.
15
+ */
16
+ assetId?: number | undefined;
17
+ /**
18
+ * Zero-based index matching the position in the original assets array.
19
+ */
20
+ sortOrder?: number | undefined;
21
+ /**
22
+ * Presigned HTTP PUT URL pointing directly at a SeaweedFS volume node. The client must PUT the raw binary file body with the Content-Type header matching the declared contentType. No additional form fields are required.
23
+ */
24
+ uploadUrl?: string | undefined;
25
+ /**
26
+ * The SeaweedFS object key pre-allocated for this asset (e.g. posts/42/0_a1b2c3.jpg). Stored in post_assets.media_key immediately; Celery uses this as the source path.
27
+ */
28
+ mediaKey?: string | undefined;
29
+ /**
30
+ * UTC datetime after which the presigned URL is no longer valid. Typically 15 minutes from issuance.
31
+ */
32
+ expiresAt?: Date | undefined;
33
+ };
34
+
35
+ /** @internal */
36
+ export const UploadSlot$inboundSchema: z.ZodMiniType<UploadSlot, unknown> = z
37
+ .object({
38
+ assetId: types.optional(types.number()),
39
+ sortOrder: types.optional(types.number()),
40
+ uploadUrl: types.optional(types.string()),
41
+ mediaKey: types.optional(types.string()),
42
+ expiresAt: types.optional(types.date()),
43
+ });
44
+
45
+ export function uploadSlotFromJSON(
46
+ jsonString: string,
47
+ ): SafeParseResult<UploadSlot, SDKValidationError> {
48
+ return safeParse(
49
+ jsonString,
50
+ (x) => UploadSlot$inboundSchema.parse(JSON.parse(x)),
51
+ `Failed to parse 'UploadSlot' from JSON`,
52
+ );
53
+ }
@@ -0,0 +1,32 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 479f87bfe8ae
4
+ */
5
+
6
+ import { internalAssetProcessingCallback } from "../funcs/internal-asset-processing-callback.js";
7
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
8
+ import * as models from "../models/index.js";
9
+ import { unwrapAsync } from "../types/fp.js";
10
+
11
+ export class Internal extends ClientSDK {
12
+ /**
13
+ * [Internal] Celery worker callback to update the processing status of a single post asset
14
+ *
15
+ * @remarks
16
+ * This endpoint is called exclusively by the internal Python/Celery media processing service after a transcoding or image optimisation job completes or fails. It is not intended to be called by external clients. The endpoint MUST be protected by a shared-secret header (X-Internal-Token) validated against an environment variable. On a READY transition the worker also supplies the finalised media_key (the canonical SeaweedFS path of the processed output file). On FAILED the worker may optionally supply a human-readable error reason for observability logging.
17
+ */
18
+ async assetProcessingCallback(
19
+ postId: number,
20
+ assetId: number,
21
+ body: models.AssetProcessingCallbackRequest,
22
+ options?: RequestOptions,
23
+ ): Promise<void> {
24
+ return unwrapAsync(internalAssetProcessingCallback(
25
+ this,
26
+ postId,
27
+ assetId,
28
+ body,
29
+ options,
30
+ ));
31
+ }
32
+ }
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
- * Create a post blueprint requesting batch upload slots
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<operations.CreatePostResponse> {
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));