@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
package/esm/sdk/me.js ADDED
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: eeeab1031f91
4
+ */
5
+ import { meConfirmAvatarUpload } from "../funcs/me-confirm-avatar-upload.js";
6
+ import { meConfirmBannerUpload } from "../funcs/me-confirm-banner-upload.js";
7
+ import { meGetMe } from "../funcs/me-get-me.js";
8
+ import { meRequestAvatarUploadUrl } from "../funcs/me-request-avatar-upload-url.js";
9
+ import { meRequestBannerUploadUrl } from "../funcs/me-request-banner-upload-url.js";
10
+ import { meUpdateMe } from "../funcs/me-update-me.js";
11
+ import { ClientSDK } from "../lib/sdks.js";
12
+ import { unwrapAsync } from "../types/fp.js";
13
+ export class Me extends ClientSDK {
14
+ /**
15
+ * Get the authenticated user's own profile
16
+ */
17
+ async getMe(options) {
18
+ return unwrapAsync(meGetMe(this, options));
19
+ }
20
+ /**
21
+ * Update the authenticated user's profile text fields
22
+ */
23
+ async updateMe(request, options) {
24
+ return unwrapAsync(meUpdateMe(this, request, options));
25
+ }
26
+ /**
27
+ * Request a presigned URL to upload or replace the authenticated user's avatar image
28
+ */
29
+ async requestAvatarUploadUrl(request, options) {
30
+ return unwrapAsync(meRequestAvatarUploadUrl(this, request, options));
31
+ }
32
+ /**
33
+ * Confirm a completed avatar upload and atomically update the user record
34
+ */
35
+ async confirmAvatarUpload(request, options) {
36
+ return unwrapAsync(meConfirmAvatarUpload(this, request, options));
37
+ }
38
+ /**
39
+ * Request a presigned URL to upload or replace the authenticated user's profile banner image
40
+ */
41
+ async requestBannerUploadUrl(request, options) {
42
+ return unwrapAsync(meRequestBannerUploadUrl(this, request, options));
43
+ }
44
+ /**
45
+ * Confirm a completed banner upload and atomically update the user record
46
+ */
47
+ async confirmBannerUpload(request, options) {
48
+ return unwrapAsync(meConfirmBannerUpload(this, request, options));
49
+ }
50
+ }
51
+ //# sourceMappingURL=me.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"me.js","sourceRoot":"","sources":["../../src/sdk/me.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAA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../lib/sdks.js";
2
2
  import * as models from "../models/index.js";
3
- import * as operations from "../models/operations/index.js";
4
3
  export declare class Posts extends ClientSDK {
5
4
  /**
6
5
  * Get the consolidated timeline feed with pagination
7
6
  */
8
7
  getFeed(limit?: number | undefined, cursor?: string | undefined, options?: RequestOptions): Promise<models.PaginatedPostsResponse>;
9
8
  /**
10
- * Create a post blueprint requesting batch upload slots
9
+ * Initiate a new post: reserve asset slots and receive presigned upload URLs
10
+ *
11
+ * @remarks
12
+ * 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.
11
13
  */
12
- createPost(request: models.CreatePostRequest, options?: RequestOptions): Promise<operations.CreatePostResponse>;
14
+ createPost(request: models.CreatePostRequest, options?: RequestOptions): Promise<models.CreatePostResponse>;
15
+ /**
16
+ * Fetch a single post by ID, including all asset statuses
17
+ */
18
+ getPost(postId: number, options?: RequestOptions): Promise<models.Post>;
19
+ /**
20
+ * Publish or update a post
21
+ *
22
+ * @remarks
23
+ * 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.
24
+ */
25
+ updatePost(postId: number, body: models.UpdatePostRequest, options?: RequestOptions): Promise<models.Post>;
26
+ /**
27
+ * Delete a post and cascade-delete all associated assets from object storage
28
+ */
29
+ deletePost(postId: number, options?: RequestOptions): Promise<void>;
13
30
  /**
14
31
  * Get a timeline filtered strictly by members of this collection with pagination
15
32
  */
@@ -1 +1 @@
1
- {"version":3,"file":"posts.d.ts","sourceRoot":"","sources":["../../src/sdk/posts.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC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AAM,EACd,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAMtB;IAED;;;;;OAKG;IACG,UAAU,CACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,CAAC,iBAAiB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAOtB;IAED;;OAEG;IACG,UAAU,CACd,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC,CAMf;IAED;;OAEG;IACG,iBAAiB,CACrB,YAAY,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,EAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAQxC;CACF"}
package/esm/sdk/posts.js CHANGED
@@ -3,8 +3,11 @@
3
3
  * @generated-id: 6787631da7f6
4
4
  */
5
5
  import { postsCreatePost } from "../funcs/posts-create-post.js";
6
+ import { postsDeletePost } from "../funcs/posts-delete-post.js";
6
7
  import { postsGetCollectionFeed } from "../funcs/posts-get-collection-feed.js";
7
8
  import { postsGetFeed } from "../funcs/posts-get-feed.js";
9
+ import { postsGetPost } from "../funcs/posts-get-post.js";
10
+ import { postsUpdatePost } from "../funcs/posts-update-post.js";
8
11
  import { ClientSDK } from "../lib/sdks.js";
9
12
  import { unwrapAsync } from "../types/fp.js";
10
13
  export class Posts extends ClientSDK {
@@ -15,11 +18,35 @@ export class Posts extends ClientSDK {
15
18
  return unwrapAsync(postsGetFeed(this, limit, cursor, options));
16
19
  }
17
20
  /**
18
- * Create a post blueprint requesting batch upload slots
21
+ * Initiate a new post: reserve asset slots and receive presigned upload URLs
22
+ *
23
+ * @remarks
24
+ * 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.
19
25
  */
20
26
  async createPost(request, options) {
21
27
  return unwrapAsync(postsCreatePost(this, request, options));
22
28
  }
29
+ /**
30
+ * Fetch a single post by ID, including all asset statuses
31
+ */
32
+ async getPost(postId, options) {
33
+ return unwrapAsync(postsGetPost(this, postId, options));
34
+ }
35
+ /**
36
+ * Publish or update a post
37
+ *
38
+ * @remarks
39
+ * 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.
40
+ */
41
+ async updatePost(postId, body, options) {
42
+ return unwrapAsync(postsUpdatePost(this, postId, body, options));
43
+ }
44
+ /**
45
+ * Delete a post and cascade-delete all associated assets from object storage
46
+ */
47
+ async deletePost(postId, options) {
48
+ return unwrapAsync(postsDeletePost(this, postId, options));
49
+ }
23
50
  /**
24
51
  * Get a timeline filtered strictly by members of this collection with pagination
25
52
  */
@@ -1 +1 @@
1
- {"version":3,"file":"posts.js","sourceRoot":"","sources":["../../src/sdk/posts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,KAAM,SAAQ,SAAS;IAClC;;OAEG;IACH,KAAK,CAAC,OAAO,CACX,KAA0B,EAC1B,MAA2B,EAC3B,OAAwB,EACgB;QACxC,OAAO,WAAW,CAAC,YAAY,CAC7B,IAAI,EACJ,KAAK,EACL,MAAM,EACN,OAAO,C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Ae,CAChC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IAAA,CACJ;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CACX,MAAc,EACd,OAAwB,EACF;QACtB,OAAO,WAAW,CAAC,YAAY,CAC7B,IAAI,EACJ,MAAM,EACN,OAAO,CACR,CAAC,CAAC;IAAA,CACJ;IAED;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CACd,MAAc,EACd,IAA8B,EAC9B,OAAwB,EACF;QACtB,OAAO,WAAW,CAAC,eAAe,CAChC,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,OAAO,CACR,CAAC,CAAC;IAAA,CACJ;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CACd,MAAc,EACd,OAAwB,EACT;QACf,OAAO,WAAW,CAAC,eAAe,CAChC,IAAI,EACJ,MAAM,EACN,OAAO,CACR,CAAC,CAAC;IAAA,CACJ;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB,CACrB,YAAoB,EACpB,KAA0B,EAC1B,MAA2B,EAC3B,OAAwB,EACgB;QACxC,OAAO,WAAW,CAAC,sBAAsB,CACvC,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,MAAM,EACN,OAAO,CACR,CAAC,CAAC;IAAA,CACJ;CACF"}
package/esm/sdk/sdk.d.ts CHANGED
@@ -3,12 +3,16 @@ import { Authentication } from "./authentication.js";
3
3
  import { CreatorTimelines } from "./creator-timelines.js";
4
4
  import { CustomCollections } from "./custom-collections.js";
5
5
  import { DirectMessaging } from "./direct-messaging.js";
6
+ import { Internal } from "./internal.js";
7
+ import { Me } from "./me.js";
6
8
  import { Posts } from "./posts.js";
7
9
  import { Subscriptions } from "./subscriptions.js";
8
10
  import { UserDiscovery } from "./user-discovery.js";
9
11
  export declare class FankareSDK extends ClientSDK {
10
12
  private _authentication?;
11
13
  get authentication(): Authentication;
14
+ private _me?;
15
+ get me(): Me;
12
16
  private _userDiscovery?;
13
17
  get userDiscovery(): UserDiscovery;
14
18
  private _subscriptions?;
@@ -17,6 +21,8 @@ export declare class FankareSDK extends ClientSDK {
17
21
  get creatorTimelines(): CreatorTimelines;
18
22
  private _posts?;
19
23
  get posts(): Posts;
24
+ private _internal?;
25
+ get internal(): Internal;
20
26
  private _directMessaging?;
21
27
  get directMessaging(): DirectMessaging;
22
28
  private _customCollections?;
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk/sdk.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,qBAAa,UAAW,SAAQ,SAAS;IACvC,OAAO,CAAC,eAAe,CAAC,CAAiB;IACzC,IAAI,cAAc,IAAI,cAAc,CAEnC;IAED,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,IAAI,aAAa,IAAI,aAAa,CAEjC;IAED,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,IAAI,aAAa,IAAI,aAAa,CAEjC;IAED,OAAO,CAAC,iBAAiB,CAAC,CAAmB;IAC7C,IAAI,gBAAgB,IAAI,gBAAgB,CAEvC;IAED,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED,OAAO,CAAC,gBAAgB,CAAC,CAAkB;IAC3C,IAAI,eAAe,IAAI,eAAe,CAErC;IAED,OAAO,CAAC,kBAAkB,CAAC,CA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kB;IAC3C,IAAI,eAAe,IAAI,eAAe,CAErC;IAED,OAAO,CAAC,kBAAkB,CAAC,CAAoB;IAC/C,IAAI,iBAAiB,IAAI,iBAAiB,CAEzC;CACF"}
package/esm/sdk/sdk.js CHANGED
@@ -7,6 +7,8 @@ import { Authentication } from "./authentication.js";
7
7
  import { CreatorTimelines } from "./creator-timelines.js";
8
8
  import { CustomCollections } from "./custom-collections.js";
9
9
  import { DirectMessaging } from "./direct-messaging.js";
10
+ import { Internal } from "./internal.js";
11
+ import { Me } from "./me.js";
10
12
  import { Posts } from "./posts.js";
11
13
  import { Subscriptions } from "./subscriptions.js";
12
14
  import { UserDiscovery } from "./user-discovery.js";
@@ -15,6 +17,10 @@ export class FankareSDK extends ClientSDK {
15
17
  get authentication() {
16
18
  return (this._authentication ?? (this._authentication = new Authentication(this._options)));
17
19
  }
20
+ _me;
21
+ get me() {
22
+ return (this._me ?? (this._me = new Me(this._options)));
23
+ }
18
24
  _userDiscovery;
19
25
  get userDiscovery() {
20
26
  return (this._userDiscovery ?? (this._userDiscovery = new UserDiscovery(this._options)));
@@ -31,6 +37,10 @@ export class FankareSDK extends ClientSDK {
31
37
  get posts() {
32
38
  return (this._posts ?? (this._posts = new Posts(this._options)));
33
39
  }
40
+ _internal;
41
+ get internal() {
42
+ return (this._internal ?? (this._internal = new Internal(this._options)));
43
+ }
34
44
  _directMessaging;
35
45
  get directMessaging() {
36
46
  return (this._directMessaging ?? (this._directMessaging = new DirectMessaging(this._options)));
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk/sdk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC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kBAAkB,KAAvB,IAAI,CAAC,kBAAkB,GAAK,IAAI,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAAA,CAC3E;CACF"}
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@aurora-interactive/fankare-api-sdk",
5
- "version": "0.0.4",
5
+ "version": "0.1.0",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurora-interactive/fankare-api-sdk",
3
- "version": "0.0.4",
3
+ "version": "0.1.0",
4
4
  "author": "Aurora Interactive",
5
5
  "type": "module",
6
6
  "main": "./esm/index.js",
@@ -0,0 +1,190 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 2b910a41e2fc
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
+ * [Internal] Celery worker callback to update the processing status of a single post asset
33
+ *
34
+ * @remarks
35
+ * 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.
36
+ */
37
+ export function internalAssetProcessingCallback(
38
+ client: FankareSDKCore,
39
+ postId: number,
40
+ assetId: number,
41
+ body: models.AssetProcessingCallbackRequest,
42
+ options?: RequestOptions,
43
+ ): APIPromise<
44
+ Result<
45
+ void,
46
+ | FankareSDKError
47
+ | ResponseValidationError
48
+ | ConnectionError
49
+ | RequestAbortedError
50
+ | RequestTimeoutError
51
+ | InvalidRequestError
52
+ | UnexpectedClientError
53
+ | SDKValidationError
54
+ >
55
+ > {
56
+ return new APIPromise($do(
57
+ client,
58
+ postId,
59
+ assetId,
60
+ body,
61
+ options,
62
+ ));
63
+ }
64
+
65
+ async function $do(
66
+ client: FankareSDKCore,
67
+ postId: number,
68
+ assetId: number,
69
+ body: models.AssetProcessingCallbackRequest,
70
+ options?: RequestOptions,
71
+ ): Promise<
72
+ [
73
+ Result<
74
+ void,
75
+ | FankareSDKError
76
+ | ResponseValidationError
77
+ | ConnectionError
78
+ | RequestAbortedError
79
+ | RequestTimeoutError
80
+ | InvalidRequestError
81
+ | UnexpectedClientError
82
+ | SDKValidationError
83
+ >,
84
+ APICall,
85
+ ]
86
+ > {
87
+ const input: operations.AssetProcessingCallbackRequest = {
88
+ postId: postId,
89
+ assetId: assetId,
90
+ body: body,
91
+ };
92
+
93
+ const parsed = safeParse(
94
+ input,
95
+ (value) =>
96
+ z.parse(operations.AssetProcessingCallbackRequest$outboundSchema, value),
97
+ "Input validation failed",
98
+ );
99
+ if (!parsed.ok) {
100
+ return [parsed, { status: "invalid" }];
101
+ }
102
+ const payload = parsed.value;
103
+ const body$ = encodeJSON("body", payload.body, { explode: true });
104
+
105
+ const pathParams = {
106
+ assetId: encodeSimple("assetId", payload.assetId, {
107
+ explode: false,
108
+ charEncoding: "percent",
109
+ }),
110
+ postId: encodeSimple("postId", payload.postId, {
111
+ explode: false,
112
+ charEncoding: "percent",
113
+ }),
114
+ };
115
+ const path = pathToFunc(
116
+ "/posts/{postId}/assets/{assetId}/processing-callback",
117
+ )(pathParams);
118
+
119
+ const headers = new Headers(compactMap({
120
+ "Content-Type": "application/json",
121
+ Accept: "*/*",
122
+ }));
123
+
124
+ const secConfig = await extractSecurity(client._options.bearerAuth);
125
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
126
+ const requestSecurity = resolveGlobalSecurity(securityInput);
127
+
128
+ const context = {
129
+ options: client._options,
130
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
131
+ operationID: "assetProcessingCallback",
132
+ oAuth2Scopes: null,
133
+
134
+ resolvedSecurity: requestSecurity,
135
+
136
+ securitySource: client._options.bearerAuth,
137
+ retryConfig: options?.retries
138
+ || client._options.retryConfig
139
+ || { strategy: "none" },
140
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
141
+ };
142
+
143
+ const requestRes = client._createRequest(context, {
144
+ security: requestSecurity,
145
+ method: "POST",
146
+ baseURL: options?.serverURL,
147
+ path: path,
148
+ headers: headers,
149
+ body: body$,
150
+ userAgent: client._options.userAgent,
151
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
152
+ }, options);
153
+ if (!requestRes.ok) {
154
+ return [requestRes, { status: "invalid" }];
155
+ }
156
+ const req = requestRes.value;
157
+
158
+ const doResult = await client._do(req, {
159
+ context,
160
+ isErrorStatusCode: (statusCode: number) =>
161
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
162
+ retryConfig: context.retryConfig,
163
+ retryCodes: context.retryCodes,
164
+ });
165
+ if (!doResult.ok) {
166
+ return [doResult, { status: "request-error", request: req }];
167
+ }
168
+ const response = doResult.value;
169
+
170
+ const [result] = await M.match<
171
+ void,
172
+ | FankareSDKError
173
+ | ResponseValidationError
174
+ | ConnectionError
175
+ | RequestAbortedError
176
+ | RequestTimeoutError
177
+ | InvalidRequestError
178
+ | UnexpectedClientError
179
+ | SDKValidationError
180
+ >(
181
+ M.nil(204, z.void()),
182
+ M.fail([401, 404, "4XX"]),
183
+ M.fail("5XX"),
184
+ )(response, req);
185
+ if (!result.ok) {
186
+ return [result, { status: "complete", request: req, response }];
187
+ }
188
+
189
+ return [result, { status: "complete", request: req, response }];
190
+ }
@@ -0,0 +1,161 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 0c0e8b01ea36
4
+ */
5
+
6
+ import * as z from "zod/v4-mini";
7
+ import { FankareSDKCore } from "../core.js";
8
+ import { encodeJSON } 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 { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * Confirm a completed avatar upload and atomically update the user record
32
+ */
33
+ export function meConfirmAvatarUpload(
34
+ client: FankareSDKCore,
35
+ request: models.ProfileMediaConfirmRequest,
36
+ options?: RequestOptions,
37
+ ): APIPromise<
38
+ Result<
39
+ models.User,
40
+ | FankareSDKError
41
+ | ResponseValidationError
42
+ | ConnectionError
43
+ | RequestAbortedError
44
+ | RequestTimeoutError
45
+ | InvalidRequestError
46
+ | UnexpectedClientError
47
+ | SDKValidationError
48
+ >
49
+ > {
50
+ return new APIPromise($do(
51
+ client,
52
+ request,
53
+ options,
54
+ ));
55
+ }
56
+
57
+ async function $do(
58
+ client: FankareSDKCore,
59
+ request: models.ProfileMediaConfirmRequest,
60
+ options?: RequestOptions,
61
+ ): Promise<
62
+ [
63
+ Result<
64
+ models.User,
65
+ | FankareSDKError
66
+ | ResponseValidationError
67
+ | ConnectionError
68
+ | RequestAbortedError
69
+ | RequestTimeoutError
70
+ | InvalidRequestError
71
+ | UnexpectedClientError
72
+ | SDKValidationError
73
+ >,
74
+ APICall,
75
+ ]
76
+ > {
77
+ const parsed = safeParse(
78
+ request,
79
+ (value) => z.parse(models.ProfileMediaConfirmRequest$outboundSchema, value),
80
+ "Input validation failed",
81
+ );
82
+ if (!parsed.ok) {
83
+ return [parsed, { status: "invalid" }];
84
+ }
85
+ const payload = parsed.value;
86
+ const body = encodeJSON("body", payload, { explode: true });
87
+
88
+ const path = pathToFunc("/users/me/avatar/confirm")();
89
+
90
+ const headers = new Headers(compactMap({
91
+ "Content-Type": "application/json",
92
+ Accept: "application/json",
93
+ }));
94
+
95
+ const secConfig = await extractSecurity(client._options.bearerAuth);
96
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
97
+ const requestSecurity = resolveGlobalSecurity(securityInput);
98
+
99
+ const context = {
100
+ options: client._options,
101
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
102
+ operationID: "confirmAvatarUpload",
103
+ oAuth2Scopes: null,
104
+
105
+ resolvedSecurity: requestSecurity,
106
+
107
+ securitySource: client._options.bearerAuth,
108
+ retryConfig: options?.retries
109
+ || client._options.retryConfig
110
+ || { strategy: "none" },
111
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
112
+ };
113
+
114
+ const requestRes = client._createRequest(context, {
115
+ security: requestSecurity,
116
+ method: "POST",
117
+ baseURL: options?.serverURL,
118
+ path: path,
119
+ headers: headers,
120
+ body: body,
121
+ userAgent: client._options.userAgent,
122
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
123
+ }, options);
124
+ if (!requestRes.ok) {
125
+ return [requestRes, { status: "invalid" }];
126
+ }
127
+ const req = requestRes.value;
128
+
129
+ const doResult = await client._do(req, {
130
+ context,
131
+ isErrorStatusCode: (statusCode: number) =>
132
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
133
+ retryConfig: context.retryConfig,
134
+ retryCodes: context.retryCodes,
135
+ });
136
+ if (!doResult.ok) {
137
+ return [doResult, { status: "request-error", request: req }];
138
+ }
139
+ const response = doResult.value;
140
+
141
+ const [result] = await M.match<
142
+ models.User,
143
+ | FankareSDKError
144
+ | ResponseValidationError
145
+ | ConnectionError
146
+ | RequestAbortedError
147
+ | RequestTimeoutError
148
+ | InvalidRequestError
149
+ | UnexpectedClientError
150
+ | SDKValidationError
151
+ >(
152
+ M.json(200, models.User$inboundSchema),
153
+ M.fail([400, 401, "4XX"]),
154
+ M.fail("5XX"),
155
+ )(response, req);
156
+ if (!result.ok) {
157
+ return [result, { status: "complete", request: req, response }];
158
+ }
159
+
160
+ return [result, { status: "complete", request: req, response }];
161
+ }