@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,179 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: c35894cf389e
4
+ */
5
+
6
+ import * as z from "zod/v4-mini";
7
+ import { FankareSDKCore } from "../core.js";
8
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
9
+ import { matchStatusCode } from "../lib/http.js";
10
+ import * as M from "../lib/matchers.js";
11
+ import { compactMap } from "../lib/primitives.js";
12
+ import { safeParse } from "../lib/schemas.js";
13
+ import { RequestOptions } from "../lib/sdks.js";
14
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
15
+ import { pathToFunc } from "../lib/url.js";
16
+ import { FankareSDKError } from "../models/errors/fankare-sdk-error.js";
17
+ import {
18
+ ConnectionError,
19
+ InvalidRequestError,
20
+ RequestAbortedError,
21
+ RequestTimeoutError,
22
+ UnexpectedClientError,
23
+ } from "../models/errors/http-client-errors.js";
24
+ import { ResponseValidationError } from "../models/errors/response-validation-error.js";
25
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
26
+ import * as models from "../models/index.js";
27
+ import * as operations from "../models/operations/index.js";
28
+ import { APICall, APIPromise } from "../types/async.js";
29
+ import { Result } from "../types/fp.js";
30
+
31
+ /**
32
+ * Publish or update a post
33
+ *
34
+ * @remarks
35
+ * 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.
36
+ */
37
+ export function postsUpdatePost(
38
+ client: FankareSDKCore,
39
+ postId: number,
40
+ body: models.UpdatePostRequest,
41
+ options?: RequestOptions,
42
+ ): APIPromise<
43
+ Result<
44
+ models.Post,
45
+ | FankareSDKError
46
+ | ResponseValidationError
47
+ | ConnectionError
48
+ | RequestAbortedError
49
+ | RequestTimeoutError
50
+ | InvalidRequestError
51
+ | UnexpectedClientError
52
+ | SDKValidationError
53
+ >
54
+ > {
55
+ return new APIPromise($do(
56
+ client,
57
+ postId,
58
+ body,
59
+ options,
60
+ ));
61
+ }
62
+
63
+ async function $do(
64
+ client: FankareSDKCore,
65
+ postId: number,
66
+ body: models.UpdatePostRequest,
67
+ options?: RequestOptions,
68
+ ): Promise<
69
+ [
70
+ Result<
71
+ models.Post,
72
+ | FankareSDKError
73
+ | ResponseValidationError
74
+ | ConnectionError
75
+ | RequestAbortedError
76
+ | RequestTimeoutError
77
+ | InvalidRequestError
78
+ | UnexpectedClientError
79
+ | SDKValidationError
80
+ >,
81
+ APICall,
82
+ ]
83
+ > {
84
+ const input: operations.UpdatePostRequest = {
85
+ postId: postId,
86
+ body: body,
87
+ };
88
+
89
+ const parsed = safeParse(
90
+ input,
91
+ (value) => z.parse(operations.UpdatePostRequest$outboundSchema, value),
92
+ "Input validation failed",
93
+ );
94
+ if (!parsed.ok) {
95
+ return [parsed, { status: "invalid" }];
96
+ }
97
+ const payload = parsed.value;
98
+ const body$ = encodeJSON("body", payload.body, { explode: true });
99
+
100
+ const pathParams = {
101
+ postId: encodeSimple("postId", payload.postId, {
102
+ explode: false,
103
+ charEncoding: "percent",
104
+ }),
105
+ };
106
+ const path = pathToFunc("/posts/{postId}")(pathParams);
107
+
108
+ const headers = new Headers(compactMap({
109
+ "Content-Type": "application/json",
110
+ Accept: "application/json",
111
+ }));
112
+
113
+ const secConfig = await extractSecurity(client._options.bearerAuth);
114
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
115
+ const requestSecurity = resolveGlobalSecurity(securityInput);
116
+
117
+ const context = {
118
+ options: client._options,
119
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
120
+ operationID: "updatePost",
121
+ oAuth2Scopes: null,
122
+
123
+ resolvedSecurity: requestSecurity,
124
+
125
+ securitySource: client._options.bearerAuth,
126
+ retryConfig: options?.retries
127
+ || client._options.retryConfig
128
+ || { strategy: "none" },
129
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
130
+ };
131
+
132
+ const requestRes = client._createRequest(context, {
133
+ security: requestSecurity,
134
+ method: "PATCH",
135
+ baseURL: options?.serverURL,
136
+ path: path,
137
+ headers: headers,
138
+ body: body$,
139
+ userAgent: client._options.userAgent,
140
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
141
+ }, options);
142
+ if (!requestRes.ok) {
143
+ return [requestRes, { status: "invalid" }];
144
+ }
145
+ const req = requestRes.value;
146
+
147
+ const doResult = await client._do(req, {
148
+ context,
149
+ isErrorStatusCode: (statusCode: number) =>
150
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
151
+ retryConfig: context.retryConfig,
152
+ retryCodes: context.retryCodes,
153
+ });
154
+ if (!doResult.ok) {
155
+ return [doResult, { status: "request-error", request: req }];
156
+ }
157
+ const response = doResult.value;
158
+
159
+ const [result] = await M.match<
160
+ models.Post,
161
+ | FankareSDKError
162
+ | ResponseValidationError
163
+ | ConnectionError
164
+ | RequestAbortedError
165
+ | RequestTimeoutError
166
+ | InvalidRequestError
167
+ | UnexpectedClientError
168
+ | SDKValidationError
169
+ >(
170
+ M.json(200, models.Post$inboundSchema),
171
+ M.fail([400, 401, 403, 404, "4XX"]),
172
+ M.fail("5XX"),
173
+ )(response, req);
174
+ if (!result.ok) {
175
+ return [result, { status: "complete", request: req, response }];
176
+ }
177
+
178
+ return [result, { status: "complete", request: req, response }];
179
+ }
package/src/lib/config.ts CHANGED
@@ -61,8 +61,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
61
61
 
62
62
  export const SDK_METADATA = {
63
63
  language: "typescript",
64
- openapiDocVersion: "1.0.0",
65
- sdkVersion: "0.0.4",
64
+ openapiDocVersion: "1.1.0",
65
+ sdkVersion: "0.1.0",
66
66
  genVersion: "2.911.0",
67
- userAgent: "speakeasy-sdk/typescript 0.0.4 2.911.0 1.0.0 openapi",
67
+ userAgent: "speakeasy-sdk/typescript 0.1.0 2.911.0 1.1.0 openapi",
68
68
  } as const;
@@ -0,0 +1,84 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 382ff0659e0a
4
+ */
5
+
6
+ import * as z from "zod/v4-mini";
7
+ import { ClosedEnum } from "../types/enums.js";
8
+
9
+ /**
10
+ * Logical media category used to route the Celery processing task.
11
+ */
12
+ export const AssetDeclarationMediaType = {
13
+ Image: "IMAGE",
14
+ Video: "VIDEO",
15
+ } as const;
16
+ /**
17
+ * Logical media category used to route the Celery processing task.
18
+ */
19
+ export type AssetDeclarationMediaType = ClosedEnum<
20
+ typeof AssetDeclarationMediaType
21
+ >;
22
+
23
+ /**
24
+ * MIME type of the file to be uploaded. Must match the mediaType category.
25
+ */
26
+ export const AssetDeclarationContentType = {
27
+ ImageJpeg: "image/jpeg",
28
+ ImagePng: "image/png",
29
+ ImageWebp: "image/webp",
30
+ ImageGif: "image/gif",
31
+ VideoMp4: "video/mp4",
32
+ VideoQuicktime: "video/quicktime",
33
+ VideoXMatroska: "video/x-matroska",
34
+ } as const;
35
+ /**
36
+ * MIME type of the file to be uploaded. Must match the mediaType category.
37
+ */
38
+ export type AssetDeclarationContentType = ClosedEnum<
39
+ typeof AssetDeclarationContentType
40
+ >;
41
+
42
+ export type AssetDeclaration = {
43
+ /**
44
+ * Logical media category used to route the Celery processing task.
45
+ */
46
+ mediaType: AssetDeclarationMediaType;
47
+ /**
48
+ * MIME type of the file to be uploaded. Must match the mediaType category.
49
+ */
50
+ contentType: AssetDeclarationContentType;
51
+ };
52
+
53
+ /** @internal */
54
+ export const AssetDeclarationMediaType$outboundSchema: z.ZodMiniEnum<
55
+ typeof AssetDeclarationMediaType
56
+ > = z.enum(AssetDeclarationMediaType);
57
+
58
+ /** @internal */
59
+ export const AssetDeclarationContentType$outboundSchema: z.ZodMiniEnum<
60
+ typeof AssetDeclarationContentType
61
+ > = z.enum(AssetDeclarationContentType);
62
+
63
+ /** @internal */
64
+ export type AssetDeclaration$Outbound = {
65
+ mediaType: string;
66
+ contentType: string;
67
+ };
68
+
69
+ /** @internal */
70
+ export const AssetDeclaration$outboundSchema: z.ZodMiniType<
71
+ AssetDeclaration$Outbound,
72
+ AssetDeclaration
73
+ > = z.object({
74
+ mediaType: AssetDeclarationMediaType$outboundSchema,
75
+ contentType: AssetDeclarationContentType$outboundSchema,
76
+ });
77
+
78
+ export function assetDeclarationToJSON(
79
+ assetDeclaration: AssetDeclaration,
80
+ ): string {
81
+ return JSON.stringify(
82
+ AssetDeclaration$outboundSchema.parse(assetDeclaration),
83
+ );
84
+ }
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: b75d6ac67429
4
+ */
5
+
6
+ import * as z from "zod/v4-mini";
7
+ import { ClosedEnum } from "../types/enums.js";
8
+
9
+ /**
10
+ * The terminal processing outcome reported by the Celery worker.
11
+ */
12
+ export const AssetProcessingCallbackRequestStatus = {
13
+ Ready: "READY",
14
+ Failed: "FAILED",
15
+ } as const;
16
+ /**
17
+ * The terminal processing outcome reported by the Celery worker.
18
+ */
19
+ export type AssetProcessingCallbackRequestStatus = ClosedEnum<
20
+ typeof AssetProcessingCallbackRequestStatus
21
+ >;
22
+
23
+ export type AssetProcessingCallbackRequest = {
24
+ /**
25
+ * The terminal processing outcome reported by the Celery worker.
26
+ */
27
+ status: AssetProcessingCallbackRequestStatus;
28
+ /**
29
+ * The canonical SeaweedFS path of the transcoded/optimised output file. Required when status is READY. The gateway overwrites post_assets.media_key with this value so that mediaUrl is derived from the processed file, not the raw upload.
30
+ */
31
+ finalMediaKey?: string | null | undefined;
32
+ /**
33
+ * Human-readable failure reason for logging and observability. Only meaningful when status is FAILED.
34
+ */
35
+ errorReason?: string | null | undefined;
36
+ };
37
+
38
+ /** @internal */
39
+ export const AssetProcessingCallbackRequestStatus$outboundSchema: z.ZodMiniEnum<
40
+ typeof AssetProcessingCallbackRequestStatus
41
+ > = z.enum(AssetProcessingCallbackRequestStatus);
42
+
43
+ /** @internal */
44
+ export type AssetProcessingCallbackRequest$Outbound = {
45
+ status: string;
46
+ finalMediaKey?: string | null | undefined;
47
+ errorReason?: string | null | undefined;
48
+ };
49
+
50
+ /** @internal */
51
+ export const AssetProcessingCallbackRequest$outboundSchema: z.ZodMiniType<
52
+ AssetProcessingCallbackRequest$Outbound,
53
+ AssetProcessingCallbackRequest
54
+ > = z.object({
55
+ status: AssetProcessingCallbackRequestStatus$outboundSchema,
56
+ finalMediaKey: z.optional(z.nullable(z.string())),
57
+ errorReason: z.optional(z.nullable(z.string())),
58
+ });
59
+
60
+ export function assetProcessingCallbackRequestToJSON(
61
+ assetProcessingCallbackRequest: AssetProcessingCallbackRequest,
62
+ ): string {
63
+ return JSON.stringify(
64
+ AssetProcessingCallbackRequest$outboundSchema.parse(
65
+ assetProcessingCallbackRequest,
66
+ ),
67
+ );
68
+ }
@@ -4,49 +4,27 @@
4
4
  */
5
5
 
6
6
  import * as z from "zod/v4-mini";
7
- import { ClosedEnum } from "../types/enums.js";
8
-
9
- export const CreatePostRequestMediaType = {
10
- Image: "IMAGE",
11
- Video: "VIDEO",
12
- } as const;
13
- export type CreatePostRequestMediaType = ClosedEnum<
14
- typeof CreatePostRequestMediaType
15
- >;
16
-
17
- export type Asset = {
18
- mediaType: CreatePostRequestMediaType;
19
- };
7
+ import {
8
+ AssetDeclaration,
9
+ AssetDeclaration$Outbound,
10
+ AssetDeclaration$outboundSchema,
11
+ } from "./asset-declaration.js";
20
12
 
21
13
  export type CreatePostRequest = {
22
- caption: string;
23
- assets: Array<Asset>;
24
- };
25
-
26
- /** @internal */
27
- export const CreatePostRequestMediaType$outboundSchema: z.ZodMiniEnum<
28
- typeof CreatePostRequestMediaType
29
- > = z.enum(CreatePostRequestMediaType);
30
-
31
- /** @internal */
32
- export type Asset$Outbound = {
33
- mediaType: string;
14
+ /**
15
+ * Optional caption for the post. May be set now or supplied later via PATCH.
16
+ */
17
+ caption?: string | null | undefined;
18
+ /**
19
+ * Ordered list of media assets to attach to this post. The array index determines sort_order.
20
+ */
21
+ assets: Array<AssetDeclaration>;
34
22
  };
35
23
 
36
- /** @internal */
37
- export const Asset$outboundSchema: z.ZodMiniType<Asset$Outbound, Asset> = z
38
- .object({
39
- mediaType: CreatePostRequestMediaType$outboundSchema,
40
- });
41
-
42
- export function assetToJSON(asset: Asset): string {
43
- return JSON.stringify(Asset$outboundSchema.parse(asset));
44
- }
45
-
46
24
  /** @internal */
47
25
  export type CreatePostRequest$Outbound = {
48
- caption: string;
49
- assets: Array<Asset$Outbound>;
26
+ caption?: string | null | undefined;
27
+ assets: Array<AssetDeclaration$Outbound>;
50
28
  };
51
29
 
52
30
  /** @internal */
@@ -54,8 +32,8 @@ export const CreatePostRequest$outboundSchema: z.ZodMiniType<
54
32
  CreatePostRequest$Outbound,
55
33
  CreatePostRequest
56
34
  > = z.object({
57
- caption: z.string(),
58
- assets: z.array(z.lazy(() => Asset$outboundSchema)),
35
+ caption: z.optional(z.nullable(z.string())),
36
+ assets: z.array(AssetDeclaration$outboundSchema),
59
37
  });
60
38
 
61
39
  export function createPostRequestToJSON(
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: dd751a66d133
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
+ import { UploadSlot, UploadSlot$inboundSchema } from "./upload-slot.js";
12
+
13
+ export type CreatePostResponse = {
14
+ /**
15
+ * ID of the newly created DRAFT post.
16
+ */
17
+ postId?: number | undefined;
18
+ /**
19
+ * One entry per declared asset, in the same order as the request.
20
+ */
21
+ uploadSlots?: Array<UploadSlot> | undefined;
22
+ };
23
+
24
+ /** @internal */
25
+ export const CreatePostResponse$inboundSchema: z.ZodMiniType<
26
+ CreatePostResponse,
27
+ unknown
28
+ > = z.object({
29
+ postId: types.optional(types.number()),
30
+ uploadSlots: types.optional(z.array(UploadSlot$inboundSchema)),
31
+ });
32
+
33
+ export function createPostResponseFromJSON(
34
+ jsonString: string,
35
+ ): SafeParseResult<CreatePostResponse, SDKValidationError> {
36
+ return safeParse(
37
+ jsonString,
38
+ (x) => CreatePostResponse$inboundSchema.parse(JSON.parse(x)),
39
+ `Failed to parse 'CreatePostResponse' from JSON`,
40
+ );
41
+ }
@@ -3,16 +3,25 @@
3
3
  * @generated-id: f93644b0f37e
4
4
  */
5
5
 
6
+ export * from "./asset-declaration.js";
7
+ export * from "./asset-processing-callback-request.js";
6
8
  export * from "./collection.js";
7
9
  export * from "./conversation.js";
8
10
  export * from "./create-post-request.js";
11
+ export * from "./create-post-response.js";
9
12
  export * from "./login-request.js";
10
13
  export * from "./media-asset.js";
11
14
  export * from "./message.js";
12
15
  export * from "./paginated-posts-response.js";
13
16
  export * from "./post.js";
17
+ export * from "./profile-media-confirm-request.js";
18
+ export * from "./profile-media-upload-request.js";
19
+ export * from "./profile-media-upload-response.js";
14
20
  export * from "./register-request.js";
15
21
  export * from "./security.js";
16
22
  export * from "./send-message-request.js";
23
+ export * from "./update-post-request.js";
24
+ export * from "./update-profile-request.js";
25
+ export * from "./upload-slot.js";
17
26
  export * from "./user-profile.js";
18
27
  export * from "./user.js";
@@ -17,18 +17,24 @@ export const MediaAssetMediaType = {
17
17
  } as const;
18
18
  export type MediaAssetMediaType = OpenEnum<typeof MediaAssetMediaType>;
19
19
 
20
- export const Status = {
20
+ export const MediaAssetStatus = {
21
21
  Processing: "PROCESSING",
22
22
  Ready: "READY",
23
23
  Failed: "FAILED",
24
24
  } as const;
25
- export type Status = OpenEnum<typeof Status>;
25
+ export type MediaAssetStatus = OpenEnum<typeof MediaAssetStatus>;
26
26
 
27
27
  export type MediaAsset = {
28
28
  id?: number | undefined;
29
- mediaUrl?: string | undefined;
29
+ /**
30
+ * Fully qualified URL to the processed output file in SeaweedFS. Null while the asset is still PROCESSING.
31
+ */
32
+ mediaUrl?: string | null | undefined;
30
33
  mediaType?: MediaAssetMediaType | undefined;
31
- status?: Status | undefined;
34
+ status?: MediaAssetStatus | undefined;
35
+ /**
36
+ * Zero-based display order of the asset within the post carousel.
37
+ */
32
38
  sortOrder?: number | undefined;
33
39
  };
34
40
 
@@ -39,16 +45,18 @@ export const MediaAssetMediaType$inboundSchema: z.ZodMiniType<
39
45
  > = openEnums.inboundSchema(MediaAssetMediaType);
40
46
 
41
47
  /** @internal */
42
- export const Status$inboundSchema: z.ZodMiniType<Status, unknown> = openEnums
43
- .inboundSchema(Status);
48
+ export const MediaAssetStatus$inboundSchema: z.ZodMiniType<
49
+ MediaAssetStatus,
50
+ unknown
51
+ > = openEnums.inboundSchema(MediaAssetStatus);
44
52
 
45
53
  /** @internal */
46
54
  export const MediaAsset$inboundSchema: z.ZodMiniType<MediaAsset, unknown> = z
47
55
  .object({
48
56
  id: types.optional(types.number()),
49
- mediaUrl: types.optional(types.string()),
57
+ mediaUrl: z.optional(z.nullable(types.string())),
50
58
  mediaType: types.optional(MediaAssetMediaType$inboundSchema),
51
- status: types.optional(Status$inboundSchema),
59
+ status: types.optional(MediaAssetStatus$inboundSchema),
52
60
  sortOrder: types.optional(types.number()),
53
61
  });
54
62
 
@@ -0,0 +1,40 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: f56cb37b1a71
4
+ */
5
+
6
+ import * as z from "zod/v4-mini";
7
+ import * as models from "../index.js";
8
+
9
+ export type AssetProcessingCallbackRequest = {
10
+ postId: number;
11
+ assetId: number;
12
+ body: models.AssetProcessingCallbackRequest;
13
+ };
14
+
15
+ /** @internal */
16
+ export type AssetProcessingCallbackRequest$Outbound = {
17
+ postId: number;
18
+ assetId: number;
19
+ body: models.AssetProcessingCallbackRequest$Outbound;
20
+ };
21
+
22
+ /** @internal */
23
+ export const AssetProcessingCallbackRequest$outboundSchema: z.ZodMiniType<
24
+ AssetProcessingCallbackRequest$Outbound,
25
+ AssetProcessingCallbackRequest
26
+ > = z.object({
27
+ postId: z.int(),
28
+ assetId: z.int(),
29
+ body: models.AssetProcessingCallbackRequest$outboundSchema,
30
+ });
31
+
32
+ export function assetProcessingCallbackRequestToJSON(
33
+ assetProcessingCallbackRequest: AssetProcessingCallbackRequest,
34
+ ): string {
35
+ return JSON.stringify(
36
+ AssetProcessingCallbackRequest$outboundSchema.parse(
37
+ assetProcessingCallbackRequest,
38
+ ),
39
+ );
40
+ }
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 2d3c4c4d46f8
4
+ */
5
+
6
+ import * as z from "zod/v4-mini";
7
+
8
+ export type DeletePostRequest = {
9
+ postId: number;
10
+ };
11
+
12
+ /** @internal */
13
+ export type DeletePostRequest$Outbound = {
14
+ postId: number;
15
+ };
16
+
17
+ /** @internal */
18
+ export const DeletePostRequest$outboundSchema: z.ZodMiniType<
19
+ DeletePostRequest$Outbound,
20
+ DeletePostRequest
21
+ > = z.object({
22
+ postId: z.int(),
23
+ });
24
+
25
+ export function deletePostRequestToJSON(
26
+ deletePostRequest: DeletePostRequest,
27
+ ): string {
28
+ return JSON.stringify(
29
+ DeletePostRequest$outboundSchema.parse(deletePostRequest),
30
+ );
31
+ }
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: e9168f4e2a0d
4
+ */
5
+
6
+ import * as z from "zod/v4-mini";
7
+
8
+ export type GetPostRequest = {
9
+ postId: number;
10
+ };
11
+
12
+ /** @internal */
13
+ export type GetPostRequest$Outbound = {
14
+ postId: number;
15
+ };
16
+
17
+ /** @internal */
18
+ export const GetPostRequest$outboundSchema: z.ZodMiniType<
19
+ GetPostRequest$Outbound,
20
+ GetPostRequest
21
+ > = z.object({
22
+ postId: z.int(),
23
+ });
24
+
25
+ export function getPostRequestToJSON(getPostRequest: GetPostRequest): string {
26
+ return JSON.stringify(GetPostRequest$outboundSchema.parse(getPostRequest));
27
+ }
@@ -4,13 +4,15 @@
4
4
  */
5
5
 
6
6
  export * from "./add-collection-member.js";
7
+ export * from "./asset-processing-callback.js";
7
8
  export * from "./create-collection.js";
8
- export * from "./create-post.js";
9
+ export * from "./delete-post.js";
9
10
  export * from "./get-collection-feed.js";
10
11
  export * from "./get-collection-members.js";
11
12
  export * from "./get-creator-posts.js";
12
13
  export * from "./get-feed.js";
13
14
  export * from "./get-message-history.js";
15
+ export * from "./get-post.js";
14
16
  export * from "./get-user-profile.js";
15
17
  export * from "./login-user.js";
16
18
  export * from "./remove-collection-member.js";
@@ -18,3 +20,4 @@ export * from "./search-users.js";
18
20
  export * from "./send-message.js";
19
21
  export * from "./subscribe-to-user.js";
20
22
  export * from "./unsubscribe-from-user.js";
23
+ export * from "./update-post.js";