@aurora-interactive/fankare-api-sdk 0.0.5 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FUNCTIONS.md +0 -1
- package/README.md +28 -8
- package/esm/funcs/internal-asset-processing-callback.d.ts +17 -0
- package/esm/funcs/internal-asset-processing-callback.d.ts.map +1 -0
- package/esm/funcs/internal-asset-processing-callback.js +96 -0
- package/esm/funcs/internal-asset-processing-callback.js.map +1 -0
- package/esm/funcs/me-confirm-avatar-upload.d.ts +14 -0
- package/esm/funcs/me-confirm-avatar-upload.d.ts.map +1 -0
- package/esm/funcs/me-confirm-avatar-upload.js +78 -0
- package/esm/funcs/me-confirm-avatar-upload.js.map +1 -0
- package/esm/funcs/me-confirm-banner-upload.d.ts +14 -0
- package/esm/funcs/me-confirm-banner-upload.d.ts.map +1 -0
- package/esm/funcs/me-confirm-banner-upload.js +78 -0
- package/esm/funcs/me-confirm-banner-upload.js.map +1 -0
- package/esm/funcs/me-get-me.d.ts +14 -0
- package/esm/funcs/me-get-me.d.ts.map +1 -0
- package/esm/funcs/me-get-me.js +67 -0
- package/esm/funcs/me-get-me.js.map +1 -0
- package/esm/funcs/me-request-avatar-upload-url.d.ts +14 -0
- package/esm/funcs/me-request-avatar-upload-url.d.ts.map +1 -0
- package/esm/funcs/me-request-avatar-upload-url.js +78 -0
- package/esm/funcs/me-request-avatar-upload-url.js.map +1 -0
- package/esm/funcs/me-request-banner-upload-url.d.ts +14 -0
- package/esm/funcs/me-request-banner-upload-url.d.ts.map +1 -0
- package/esm/funcs/me-request-banner-upload-url.js +78 -0
- package/esm/funcs/me-request-banner-upload-url.js.map +1 -0
- package/esm/funcs/me-update-me.d.ts +14 -0
- package/esm/funcs/me-update-me.d.ts.map +1 -0
- package/esm/funcs/me-update-me.js +78 -0
- package/esm/funcs/me-update-me.js.map +1 -0
- package/esm/funcs/posts-create-post.d.ts +5 -3
- package/esm/funcs/posts-create-post.d.ts.map +1 -1
- package/esm/funcs/posts-create-post.js +5 -3
- package/esm/funcs/posts-create-post.js.map +1 -1
- package/esm/funcs/posts-delete-post.d.ts +13 -0
- package/esm/funcs/posts-delete-post.d.ts.map +1 -0
- package/esm/funcs/posts-delete-post.js +86 -0
- package/esm/funcs/posts-delete-post.js.map +1 -0
- package/esm/funcs/posts-get-post.d.ts +14 -0
- package/esm/funcs/posts-get-post.d.ts.map +1 -0
- package/esm/funcs/posts-get-post.js +87 -0
- package/esm/funcs/posts-get-post.js.map +1 -0
- package/esm/funcs/posts-update-post.d.ts +17 -0
- package/esm/funcs/posts-update-post.d.ts.map +1 -0
- package/esm/funcs/posts-update-post.js +92 -0
- package/esm/funcs/posts-update-post.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/asset-declaration.d.ts +52 -0
- package/esm/models/asset-declaration.d.ts.map +1 -0
- package/esm/models/asset-declaration.js +37 -0
- package/esm/models/asset-declaration.js.map +1 -0
- package/esm/models/asset-processing-callback-request.d.ts +39 -0
- package/esm/models/asset-processing-callback-request.d.ts.map +1 -0
- package/esm/models/asset-processing-callback-request.js +24 -0
- package/esm/models/asset-processing-callback-request.js.map +1 -0
- package/esm/models/create-post-request.d.ts +11 -22
- package/esm/models/create-post-request.d.ts.map +1 -1
- package/esm/models/create-post-request.js +3 -16
- package/esm/models/create-post-request.js.map +1 -1
- package/esm/models/create-post-response.d.ts +18 -0
- package/esm/models/create-post-response.d.ts.map +1 -0
- package/esm/models/create-post-response.js +17 -0
- package/esm/models/create-post-response.js.map +1 -0
- package/esm/models/index.d.ts +9 -0
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +9 -0
- package/esm/models/index.js.map +1 -1
- package/esm/models/media-asset.d.ts +11 -5
- package/esm/models/media-asset.d.ts.map +1 -1
- package/esm/models/media-asset.js +4 -5
- package/esm/models/media-asset.js.map +1 -1
- package/esm/models/operations/asset-processing-callback.d.ts +17 -0
- package/esm/models/operations/asset-processing-callback.d.ts.map +1 -0
- package/esm/models/operations/asset-processing-callback.js +16 -0
- package/esm/models/operations/asset-processing-callback.js.map +1 -0
- package/esm/models/operations/delete-post.d.ts +12 -0
- package/esm/models/operations/delete-post.d.ts.map +1 -0
- package/esm/models/operations/delete-post.js +13 -0
- package/esm/models/operations/delete-post.js.map +1 -0
- package/esm/models/operations/get-post.d.ts +12 -0
- package/esm/models/operations/get-post.d.ts.map +1 -0
- package/esm/models/operations/get-post.js +13 -0
- package/esm/models/operations/get-post.js.map +1 -0
- package/esm/models/operations/index.d.ts +4 -1
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +4 -1
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/update-post.d.ts +15 -0
- package/esm/models/operations/update-post.d.ts.map +1 -0
- package/esm/models/operations/update-post.js +15 -0
- package/esm/models/operations/update-post.js.map +1 -0
- package/esm/models/post.d.ts +20 -1
- package/esm/models/post.d.ts.map +1 -1
- package/esm/models/post.js +13 -1
- package/esm/models/post.js.map +1 -1
- package/esm/models/profile-media-confirm-request.d.ts +15 -0
- package/esm/models/profile-media-confirm-request.d.ts.map +1 -0
- package/esm/models/profile-media-confirm-request.js +13 -0
- package/esm/models/profile-media-confirm-request.js.map +1 -0
- package/esm/models/profile-media-upload-request.d.ts +30 -0
- package/esm/models/profile-media-upload-request.d.ts.map +1 -0
- package/esm/models/profile-media-upload-request.js +23 -0
- package/esm/models/profile-media-upload-request.js.map +1 -0
- package/esm/models/profile-media-upload-response.d.ts +21 -0
- package/esm/models/profile-media-upload-response.d.ts.map +1 -0
- package/esm/models/profile-media-upload-response.js +17 -0
- package/esm/models/profile-media-upload-response.js.map +1 -0
- package/esm/models/register-request.d.ts +2 -2
- package/esm/models/register-request.d.ts.map +1 -1
- package/esm/models/register-request.js +1 -1
- package/esm/models/register-request.js.map +1 -1
- package/esm/models/update-post-request.d.ts +30 -0
- package/esm/models/update-post-request.d.ts.map +1 -0
- package/esm/models/update-post-request.js +22 -0
- package/esm/models/update-post-request.js.map +1 -0
- package/esm/models/update-profile-request.d.ts +17 -0
- package/esm/models/update-profile-request.d.ts.map +1 -0
- package/esm/models/update-profile-request.js +14 -0
- package/esm/models/update-profile-request.js.map +1 -0
- package/esm/models/upload-slot.d.ts +29 -0
- package/esm/models/upload-slot.d.ts.map +1 -0
- package/esm/models/upload-slot.js +20 -0
- package/esm/models/upload-slot.js.map +1 -0
- package/esm/sdk/internal.d.ts +12 -0
- package/esm/sdk/internal.d.ts.map +1 -0
- package/esm/sdk/internal.js +19 -0
- package/esm/sdk/internal.js.map +1 -0
- package/esm/sdk/me.d.ts +29 -0
- package/esm/sdk/me.d.ts.map +1 -0
- package/esm/sdk/me.js +51 -0
- package/esm/sdk/me.js.map +1 -0
- package/esm/sdk/posts.d.ts +20 -3
- package/esm/sdk/posts.d.ts.map +1 -1
- package/esm/sdk/posts.js +28 -1
- package/esm/sdk/posts.js.map +1 -1
- package/esm/sdk/sdk.d.ts +6 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +10 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/examples/authenticationRegisterUser.example.ts +0 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/internal-asset-processing-callback.ts +190 -0
- package/src/funcs/me-confirm-avatar-upload.ts +161 -0
- package/src/funcs/me-confirm-banner-upload.ts +161 -0
- package/src/funcs/me-get-me.ts +142 -0
- package/src/funcs/me-request-avatar-upload-url.ts +161 -0
- package/src/funcs/me-request-banner-upload-url.ts +161 -0
- package/src/funcs/me-update-me.ts +161 -0
- package/src/funcs/posts-create-post.ts +9 -7
- package/src/funcs/posts-delete-post.ts +170 -0
- package/src/funcs/posts-get-post.ts +171 -0
- package/src/funcs/posts-update-post.ts +179 -0
- package/src/lib/config.ts +3 -3
- package/src/models/asset-declaration.ts +84 -0
- package/src/models/asset-processing-callback-request.ts +68 -0
- package/src/models/create-post-request.ts +17 -39
- package/src/models/create-post-response.ts +41 -0
- package/src/models/index.ts +9 -0
- package/src/models/media-asset.ts +16 -8
- package/src/models/operations/asset-processing-callback.ts +40 -0
- package/src/models/operations/delete-post.ts +31 -0
- package/src/models/operations/get-post.ts +27 -0
- package/src/models/operations/index.ts +4 -1
- package/src/models/operations/update-post.ts +35 -0
- package/src/models/post.ts +27 -2
- package/src/models/profile-media-confirm-request.ts +34 -0
- package/src/models/profile-media-upload-request.ts +55 -0
- package/src/models/profile-media-upload-response.ts +45 -0
- package/src/models/register-request.ts +3 -3
- package/src/models/update-post-request.ts +56 -0
- package/src/models/update-profile-request.ts +37 -0
- package/src/models/upload-slot.ts +53 -0
- package/src/sdk/internal.ts +32 -0
- package/src/sdk/me.ts +98 -0
- package/src/sdk/posts.ts +55 -3
- package/src/sdk/sdk.ts +12 -0
- package/src/models/operations/create-post.ts +0 -62
package/FUNCTIONS.md
CHANGED
package/README.md
CHANGED
|
@@ -99,7 +99,6 @@ async function run() {
|
|
|
99
99
|
email: "Erick_McClure81@hotmail.com",
|
|
100
100
|
password: "4rmpu4fcbiqyYPN",
|
|
101
101
|
displayName: "Abbey80",
|
|
102
|
-
bio: "<value>",
|
|
103
102
|
});
|
|
104
103
|
|
|
105
104
|
console.log(result);
|
|
@@ -135,7 +134,6 @@ async function run() {
|
|
|
135
134
|
email: "Erick_McClure81@hotmail.com",
|
|
136
135
|
password: "4rmpu4fcbiqyYPN",
|
|
137
136
|
displayName: "Abbey80",
|
|
138
|
-
bio: "<value>",
|
|
139
137
|
});
|
|
140
138
|
|
|
141
139
|
console.log(result);
|
|
@@ -175,10 +173,26 @@ run();
|
|
|
175
173
|
* [getMessageHistory](docs/sdks/directmessaging/README.md#getmessagehistory) - Load message history with a specific user with pagination
|
|
176
174
|
* [sendMessage](docs/sdks/directmessaging/README.md#sendmessage) - Send a direct text message
|
|
177
175
|
|
|
176
|
+
### [Internal](docs/sdks/internal/README.md)
|
|
177
|
+
|
|
178
|
+
* [assetProcessingCallback](docs/sdks/internal/README.md#assetprocessingcallback) - [Internal] Celery worker callback to update the processing status of a single post asset
|
|
179
|
+
|
|
180
|
+
### [Me](docs/sdks/me/README.md)
|
|
181
|
+
|
|
182
|
+
* [getMe](docs/sdks/me/README.md#getme) - Get the authenticated user's own profile
|
|
183
|
+
* [updateMe](docs/sdks/me/README.md#updateme) - Update the authenticated user's profile text fields
|
|
184
|
+
* [requestAvatarUploadUrl](docs/sdks/me/README.md#requestavataruploadurl) - Request a presigned URL to upload or replace the authenticated user's avatar image
|
|
185
|
+
* [confirmAvatarUpload](docs/sdks/me/README.md#confirmavatarupload) - Confirm a completed avatar upload and atomically update the user record
|
|
186
|
+
* [requestBannerUploadUrl](docs/sdks/me/README.md#requestbanneruploadurl) - Request a presigned URL to upload or replace the authenticated user's profile banner image
|
|
187
|
+
* [confirmBannerUpload](docs/sdks/me/README.md#confirmbannerupload) - Confirm a completed banner upload and atomically update the user record
|
|
188
|
+
|
|
178
189
|
### [Posts](docs/sdks/posts/README.md)
|
|
179
190
|
|
|
180
191
|
* [getFeed](docs/sdks/posts/README.md#getfeed) - Get the consolidated timeline feed with pagination
|
|
181
|
-
* [createPost](docs/sdks/posts/README.md#createpost) -
|
|
192
|
+
* [createPost](docs/sdks/posts/README.md#createpost) - Initiate a new post: reserve asset slots and receive presigned upload URLs
|
|
193
|
+
* [getPost](docs/sdks/posts/README.md#getpost) - Fetch a single post by ID, including all asset statuses
|
|
194
|
+
* [updatePost](docs/sdks/posts/README.md#updatepost) - Publish or update a post
|
|
195
|
+
* [deletePost](docs/sdks/posts/README.md#deletepost) - Delete a post and cascade-delete all associated assets from object storage
|
|
182
196
|
* [getCollectionFeed](docs/sdks/posts/README.md#getcollectionfeed) - Get a timeline filtered strictly by members of this collection with pagination
|
|
183
197
|
|
|
184
198
|
### [Subscriptions](docs/sdks/subscriptions/README.md)
|
|
@@ -221,9 +235,19 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
|
221
235
|
- [`directMessagingGetConversations`](docs/sdks/directmessaging/README.md#getconversations) - Fetch active DM threads
|
|
222
236
|
- [`directMessagingGetMessageHistory`](docs/sdks/directmessaging/README.md#getmessagehistory) - Load message history with a specific user with pagination
|
|
223
237
|
- [`directMessagingSendMessage`](docs/sdks/directmessaging/README.md#sendmessage) - Send a direct text message
|
|
224
|
-
- [`
|
|
238
|
+
- [`internalAssetProcessingCallback`](docs/sdks/internal/README.md#assetprocessingcallback) - [Internal] Celery worker callback to update the processing status of a single post asset
|
|
239
|
+
- [`meConfirmAvatarUpload`](docs/sdks/me/README.md#confirmavatarupload) - Confirm a completed avatar upload and atomically update the user record
|
|
240
|
+
- [`meConfirmBannerUpload`](docs/sdks/me/README.md#confirmbannerupload) - Confirm a completed banner upload and atomically update the user record
|
|
241
|
+
- [`meGetMe`](docs/sdks/me/README.md#getme) - Get the authenticated user's own profile
|
|
242
|
+
- [`meRequestAvatarUploadUrl`](docs/sdks/me/README.md#requestavataruploadurl) - Request a presigned URL to upload or replace the authenticated user's avatar image
|
|
243
|
+
- [`meRequestBannerUploadUrl`](docs/sdks/me/README.md#requestbanneruploadurl) - Request a presigned URL to upload or replace the authenticated user's profile banner image
|
|
244
|
+
- [`meUpdateMe`](docs/sdks/me/README.md#updateme) - Update the authenticated user's profile text fields
|
|
245
|
+
- [`postsCreatePost`](docs/sdks/posts/README.md#createpost) - Initiate a new post: reserve asset slots and receive presigned upload URLs
|
|
246
|
+
- [`postsDeletePost`](docs/sdks/posts/README.md#deletepost) - Delete a post and cascade-delete all associated assets from object storage
|
|
225
247
|
- [`postsGetCollectionFeed`](docs/sdks/posts/README.md#getcollectionfeed) - Get a timeline filtered strictly by members of this collection with pagination
|
|
226
248
|
- [`postsGetFeed`](docs/sdks/posts/README.md#getfeed) - Get the consolidated timeline feed with pagination
|
|
249
|
+
- [`postsGetPost`](docs/sdks/posts/README.md#getpost) - Fetch a single post by ID, including all asset statuses
|
|
250
|
+
- [`postsUpdatePost`](docs/sdks/posts/README.md#updatepost) - Publish or update a post
|
|
227
251
|
- [`subscriptionsSubscribeToUser`](docs/sdks/subscriptions/README.md#subscribetouser) - Subscribe to a user's feed
|
|
228
252
|
- [`subscriptionsUnsubscribeFromUser`](docs/sdks/subscriptions/README.md#unsubscribefromuser) - Unsubscribe from a user's feed
|
|
229
253
|
- [`userDiscoveryGetFollowing`](docs/sdks/userdiscovery/README.md#getfollowing) - Get subscriptions list
|
|
@@ -252,7 +276,6 @@ async function run() {
|
|
|
252
276
|
email: "Erick_McClure81@hotmail.com",
|
|
253
277
|
password: "4rmpu4fcbiqyYPN",
|
|
254
278
|
displayName: "Abbey80",
|
|
255
|
-
bio: "<value>",
|
|
256
279
|
}, {
|
|
257
280
|
retries: {
|
|
258
281
|
strategy: "backoff",
|
|
@@ -297,7 +320,6 @@ async function run() {
|
|
|
297
320
|
email: "Erick_McClure81@hotmail.com",
|
|
298
321
|
password: "4rmpu4fcbiqyYPN",
|
|
299
322
|
displayName: "Abbey80",
|
|
300
|
-
bio: "<value>",
|
|
301
323
|
});
|
|
302
324
|
|
|
303
325
|
console.log(result);
|
|
@@ -337,7 +359,6 @@ async function run() {
|
|
|
337
359
|
email: "Erick_McClure81@hotmail.com",
|
|
338
360
|
password: "4rmpu4fcbiqyYPN",
|
|
339
361
|
displayName: "Abbey80",
|
|
340
|
-
bio: "<value>",
|
|
341
362
|
});
|
|
342
363
|
|
|
343
364
|
console.log(result);
|
|
@@ -397,7 +418,6 @@ async function run() {
|
|
|
397
418
|
email: "Erick_McClure81@hotmail.com",
|
|
398
419
|
password: "4rmpu4fcbiqyYPN",
|
|
399
420
|
displayName: "Abbey80",
|
|
400
|
-
bio: "<value>",
|
|
401
421
|
});
|
|
402
422
|
|
|
403
423
|
console.log(result);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FankareSDKCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { FankareSDKError } from "../models/errors/fankare-sdk-error.js";
|
|
4
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/http-client-errors.js";
|
|
5
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
6
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
7
|
+
import * as models from "../models/index.js";
|
|
8
|
+
import { APIPromise } from "../types/async.js";
|
|
9
|
+
import { Result } from "../types/fp.js";
|
|
10
|
+
/**
|
|
11
|
+
* [Internal] Celery worker callback to update the processing status of a single post asset
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* 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.
|
|
15
|
+
*/
|
|
16
|
+
export declare function internalAssetProcessingCallback(client: FankareSDKCore, postId: number, assetId: number, body: models.AssetProcessingCallbackRequest, options?: RequestOptions): APIPromise<Result<void, FankareSDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
17
|
+
//# sourceMappingURL=internal-asset-processing-callback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-asset-processing-callback.d.ts","sourceRoot":"","sources":["../../src/funcs/internal-asset-processing-callback.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAM5C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,CAAC,8BAA8B,EAC3C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,IAAI,EACF,eAAe,GACf,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAQA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 2b910a41e2fc
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as operations from "../models/operations/index.js";
|
|
14
|
+
import { APIPromise } from "../types/async.js";
|
|
15
|
+
/**
|
|
16
|
+
* [Internal] Celery worker callback to update the processing status of a single post asset
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* 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.
|
|
20
|
+
*/
|
|
21
|
+
export function internalAssetProcessingCallback(client, postId, assetId, body, options) {
|
|
22
|
+
return new APIPromise($do(client, postId, assetId, body, options));
|
|
23
|
+
}
|
|
24
|
+
async function $do(client, postId, assetId, body, options) {
|
|
25
|
+
const input = {
|
|
26
|
+
postId: postId,
|
|
27
|
+
assetId: assetId,
|
|
28
|
+
body: body,
|
|
29
|
+
};
|
|
30
|
+
const parsed = safeParse(input, (value) => z.parse(operations.AssetProcessingCallbackRequest$outboundSchema, value), "Input validation failed");
|
|
31
|
+
if (!parsed.ok) {
|
|
32
|
+
return [parsed, { status: "invalid" }];
|
|
33
|
+
}
|
|
34
|
+
const payload = parsed.value;
|
|
35
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
36
|
+
const pathParams = {
|
|
37
|
+
assetId: encodeSimple("assetId", payload.assetId, {
|
|
38
|
+
explode: false,
|
|
39
|
+
charEncoding: "percent",
|
|
40
|
+
}),
|
|
41
|
+
postId: encodeSimple("postId", payload.postId, {
|
|
42
|
+
explode: false,
|
|
43
|
+
charEncoding: "percent",
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
const path = pathToFunc("/posts/{postId}/assets/{assetId}/processing-callback")(pathParams);
|
|
47
|
+
const headers = new Headers(compactMap({
|
|
48
|
+
"Content-Type": "application/json",
|
|
49
|
+
Accept: "*/*",
|
|
50
|
+
}));
|
|
51
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
52
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
53
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
54
|
+
const context = {
|
|
55
|
+
options: client._options,
|
|
56
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
57
|
+
operationID: "assetProcessingCallback",
|
|
58
|
+
oAuth2Scopes: null,
|
|
59
|
+
resolvedSecurity: requestSecurity,
|
|
60
|
+
securitySource: client._options.bearerAuth,
|
|
61
|
+
retryConfig: options?.retries
|
|
62
|
+
|| client._options.retryConfig
|
|
63
|
+
|| { strategy: "none" },
|
|
64
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
65
|
+
};
|
|
66
|
+
const requestRes = client._createRequest(context, {
|
|
67
|
+
security: requestSecurity,
|
|
68
|
+
method: "POST",
|
|
69
|
+
baseURL: options?.serverURL,
|
|
70
|
+
path: path,
|
|
71
|
+
headers: headers,
|
|
72
|
+
body: body$,
|
|
73
|
+
userAgent: client._options.userAgent,
|
|
74
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
75
|
+
}, options);
|
|
76
|
+
if (!requestRes.ok) {
|
|
77
|
+
return [requestRes, { status: "invalid" }];
|
|
78
|
+
}
|
|
79
|
+
const req = requestRes.value;
|
|
80
|
+
const doResult = await client._do(req, {
|
|
81
|
+
context,
|
|
82
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
83
|
+
retryConfig: context.retryConfig,
|
|
84
|
+
retryCodes: context.retryCodes,
|
|
85
|
+
});
|
|
86
|
+
if (!doResult.ok) {
|
|
87
|
+
return [doResult, { status: "request-error", request: req }];
|
|
88
|
+
}
|
|
89
|
+
const response = doResult.value;
|
|
90
|
+
const [result] = await M.match(M.nil(204, z.void()), M.fail([401, 404, "4XX"]), M.fail("5XX"))(response, req);
|
|
91
|
+
if (!result.ok) {
|
|
92
|
+
return [result, { status: "complete", request: req, response }];
|
|
93
|
+
}
|
|
94
|
+
return [result, { status: "complete", request: req, response }];
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=internal-asset-processing-callback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-asset-processing-callback.js","sourceRoot":"","sources":["../../src/funcs/internal-asset-processing-callback.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAY3C,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGxD;;;;;GAKG;AACH,MAAM,UAAU,+BAA+B,CAC7C,MAAsB,EACtB,MAAc,EACd,OAAe,EACf,IAA2C,EAC3C,OAAwB,EAaxB;IACA,OAAO,IAAI,UAAU,CAAC,GAAG,CACvB,MAAM,EACN,MAAM,EACN,OAAO,EACP,IAAI,EACJ,OAAO,CACR,CAAC,CAAC;AAAA,CACJ;AAED,KAAK,UAAU,GAAG,CAChB,MAAsB,EACtB,MAAc,EACd,OAAe,EACf,IAA2C,EAC3C,OAAwB,EAgBxB;IACA,MAAM,KAAK,GAA8C;QACvD,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,IAAI;KACX,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CACtB,KAAK,EACL,CAAC,KAAK,EAAE,EAAE,CACR,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,6CAA6C,EAAE,KAAK,CAAC,EAC1E,yBAAyB,CAC1B,CAAC;IACF,IAAI,CAAC,MAA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,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAC/D,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEhC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAW5B,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,EACpB,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,EACzB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACjB,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAAA,CACjE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FankareSDKCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { FankareSDKError } from "../models/errors/fankare-sdk-error.js";
|
|
4
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/http-client-errors.js";
|
|
5
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
6
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
7
|
+
import * as models from "../models/index.js";
|
|
8
|
+
import { APIPromise } from "../types/async.js";
|
|
9
|
+
import { Result } from "../types/fp.js";
|
|
10
|
+
/**
|
|
11
|
+
* Confirm a completed avatar upload and atomically update the user record
|
|
12
|
+
*/
|
|
13
|
+
export declare function meConfirmAvatarUpload(client: FankareSDKCore, request: models.ProfileMediaConfirmRequest, options?: RequestOptions): APIPromise<Result<models.User, FankareSDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
14
|
+
//# sourceMappingURL=me-confirm-avatar-upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"me-confirm-avatar-upload.d.ts","sourceRoot":"","sources":["../../src/funcs/me-confirm-avatar-upload.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAM5C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,MAAM,CAAC,0BAA0B,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,MAAM,CAAC,IAAI,EACT,eAAe,GACf,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 0c0e8b01ea36
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as models from "../models/index.js";
|
|
14
|
+
import { APIPromise } from "../types/async.js";
|
|
15
|
+
/**
|
|
16
|
+
* Confirm a completed avatar upload and atomically update the user record
|
|
17
|
+
*/
|
|
18
|
+
export function meConfirmAvatarUpload(client, request, options) {
|
|
19
|
+
return new APIPromise($do(client, request, options));
|
|
20
|
+
}
|
|
21
|
+
async function $do(client, request, options) {
|
|
22
|
+
const parsed = safeParse(request, (value) => z.parse(models.ProfileMediaConfirmRequest$outboundSchema, value), "Input validation failed");
|
|
23
|
+
if (!parsed.ok) {
|
|
24
|
+
return [parsed, { status: "invalid" }];
|
|
25
|
+
}
|
|
26
|
+
const payload = parsed.value;
|
|
27
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
28
|
+
const path = pathToFunc("/users/me/avatar/confirm")();
|
|
29
|
+
const headers = new Headers(compactMap({
|
|
30
|
+
"Content-Type": "application/json",
|
|
31
|
+
Accept: "application/json",
|
|
32
|
+
}));
|
|
33
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
34
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
35
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
36
|
+
const context = {
|
|
37
|
+
options: client._options,
|
|
38
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
39
|
+
operationID: "confirmAvatarUpload",
|
|
40
|
+
oAuth2Scopes: null,
|
|
41
|
+
resolvedSecurity: requestSecurity,
|
|
42
|
+
securitySource: client._options.bearerAuth,
|
|
43
|
+
retryConfig: options?.retries
|
|
44
|
+
|| client._options.retryConfig
|
|
45
|
+
|| { strategy: "none" },
|
|
46
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
47
|
+
};
|
|
48
|
+
const requestRes = client._createRequest(context, {
|
|
49
|
+
security: requestSecurity,
|
|
50
|
+
method: "POST",
|
|
51
|
+
baseURL: options?.serverURL,
|
|
52
|
+
path: path,
|
|
53
|
+
headers: headers,
|
|
54
|
+
body: body,
|
|
55
|
+
userAgent: client._options.userAgent,
|
|
56
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
57
|
+
}, options);
|
|
58
|
+
if (!requestRes.ok) {
|
|
59
|
+
return [requestRes, { status: "invalid" }];
|
|
60
|
+
}
|
|
61
|
+
const req = requestRes.value;
|
|
62
|
+
const doResult = await client._do(req, {
|
|
63
|
+
context,
|
|
64
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
65
|
+
retryConfig: context.retryConfig,
|
|
66
|
+
retryCodes: context.retryCodes,
|
|
67
|
+
});
|
|
68
|
+
if (!doResult.ok) {
|
|
69
|
+
return [doResult, { status: "request-error", request: req }];
|
|
70
|
+
}
|
|
71
|
+
const response = doResult.value;
|
|
72
|
+
const [result] = await M.match(M.json(200, models.User$inboundSchema), M.fail([400, 401, "4XX"]), M.fail("5XX"))(response, req);
|
|
73
|
+
if (!result.ok) {
|
|
74
|
+
return [result, { status: "complete", request: req, response }];
|
|
75
|
+
}
|
|
76
|
+
return [result, { status: "complete", request: req, response }];
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=me-confirm-avatar-upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"me-confirm-avatar-upload.js","sourceRoot":"","sources":["../../src/func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,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAAA,CACjE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FankareSDKCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { FankareSDKError } from "../models/errors/fankare-sdk-error.js";
|
|
4
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/http-client-errors.js";
|
|
5
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
6
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
7
|
+
import * as models from "../models/index.js";
|
|
8
|
+
import { APIPromise } from "../types/async.js";
|
|
9
|
+
import { Result } from "../types/fp.js";
|
|
10
|
+
/**
|
|
11
|
+
* Confirm a completed banner upload and atomically update the user record
|
|
12
|
+
*/
|
|
13
|
+
export declare function meConfirmBannerUpload(client: FankareSDKCore, request: models.ProfileMediaConfirmRequest, options?: RequestOptions): APIPromise<Result<models.User, FankareSDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
14
|
+
//# sourceMappingURL=me-confirm-banner-upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"me-confirm-banner-upload.d.ts","sourceRoot":"","sources":["../../src/funcs/me-confirm-banner-upload.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAM5C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,MAAM,CAAC,0BAA0B,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,MAAM,CAAC,IAAI,EACT,eAAe,GACf,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 826dbe96c9a0
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as models from "../models/index.js";
|
|
14
|
+
import { APIPromise } from "../types/async.js";
|
|
15
|
+
/**
|
|
16
|
+
* Confirm a completed banner upload and atomically update the user record
|
|
17
|
+
*/
|
|
18
|
+
export function meConfirmBannerUpload(client, request, options) {
|
|
19
|
+
return new APIPromise($do(client, request, options));
|
|
20
|
+
}
|
|
21
|
+
async function $do(client, request, options) {
|
|
22
|
+
const parsed = safeParse(request, (value) => z.parse(models.ProfileMediaConfirmRequest$outboundSchema, value), "Input validation failed");
|
|
23
|
+
if (!parsed.ok) {
|
|
24
|
+
return [parsed, { status: "invalid" }];
|
|
25
|
+
}
|
|
26
|
+
const payload = parsed.value;
|
|
27
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
28
|
+
const path = pathToFunc("/users/me/banner/confirm")();
|
|
29
|
+
const headers = new Headers(compactMap({
|
|
30
|
+
"Content-Type": "application/json",
|
|
31
|
+
Accept: "application/json",
|
|
32
|
+
}));
|
|
33
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
34
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
35
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
36
|
+
const context = {
|
|
37
|
+
options: client._options,
|
|
38
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
39
|
+
operationID: "confirmBannerUpload",
|
|
40
|
+
oAuth2Scopes: null,
|
|
41
|
+
resolvedSecurity: requestSecurity,
|
|
42
|
+
securitySource: client._options.bearerAuth,
|
|
43
|
+
retryConfig: options?.retries
|
|
44
|
+
|| client._options.retryConfig
|
|
45
|
+
|| { strategy: "none" },
|
|
46
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
47
|
+
};
|
|
48
|
+
const requestRes = client._createRequest(context, {
|
|
49
|
+
security: requestSecurity,
|
|
50
|
+
method: "POST",
|
|
51
|
+
baseURL: options?.serverURL,
|
|
52
|
+
path: path,
|
|
53
|
+
headers: headers,
|
|
54
|
+
body: body,
|
|
55
|
+
userAgent: client._options.userAgent,
|
|
56
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
57
|
+
}, options);
|
|
58
|
+
if (!requestRes.ok) {
|
|
59
|
+
return [requestRes, { status: "invalid" }];
|
|
60
|
+
}
|
|
61
|
+
const req = requestRes.value;
|
|
62
|
+
const doResult = await client._do(req, {
|
|
63
|
+
context,
|
|
64
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
65
|
+
retryConfig: context.retryConfig,
|
|
66
|
+
retryCodes: context.retryCodes,
|
|
67
|
+
});
|
|
68
|
+
if (!doResult.ok) {
|
|
69
|
+
return [doResult, { status: "request-error", request: req }];
|
|
70
|
+
}
|
|
71
|
+
const response = doResult.value;
|
|
72
|
+
const [result] = await M.match(M.json(200, models.User$inboundSchema), M.fail([400, 401, "4XX"]), M.fail("5XX"))(response, req);
|
|
73
|
+
if (!result.ok) {
|
|
74
|
+
return [result, { status: "complete", request: req, response }];
|
|
75
|
+
}
|
|
76
|
+
return [result, { status: "complete", request: req, response }];
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=me-confirm-banner-upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"me-confirm-banner-upload.js","sourceRoot":"","sources":["../../src/funcs/me-confirm-banner-upload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAW3C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;A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O,CAAC,WAAW;QAChC,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAC/D,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEhC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAW5B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,kBAAkB,CAAC,EACtC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,EACzB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACjB,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAAA,CACjE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FankareSDKCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { FankareSDKError } from "../models/errors/fankare-sdk-error.js";
|
|
4
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/http-client-errors.js";
|
|
5
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
6
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
7
|
+
import * as models from "../models/index.js";
|
|
8
|
+
import { APIPromise } from "../types/async.js";
|
|
9
|
+
import { Result } from "../types/fp.js";
|
|
10
|
+
/**
|
|
11
|
+
* Get the authenticated user's own profile
|
|
12
|
+
*/
|
|
13
|
+
export declare function meGetMe(client: FankareSDKCore, options?: RequestOptions): APIPromise<Result<models.User, FankareSDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
14
|
+
//# sourceMappingURL=me-get-me.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"me-get-me.d.ts","sourceRoot":"","sources":["../../src/funcs/me-get-me.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAI5C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,MAAM,CAAC,IAAI,EACT,eAAe,GACf,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAKA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 3aaadd6972a6
|
|
4
|
+
*/
|
|
5
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
6
|
+
import * as M from "../lib/matchers.js";
|
|
7
|
+
import { compactMap } from "../lib/primitives.js";
|
|
8
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
9
|
+
import { pathToFunc } from "../lib/url.js";
|
|
10
|
+
import * as models from "../models/index.js";
|
|
11
|
+
import { APIPromise } from "../types/async.js";
|
|
12
|
+
/**
|
|
13
|
+
* Get the authenticated user's own profile
|
|
14
|
+
*/
|
|
15
|
+
export function meGetMe(client, options) {
|
|
16
|
+
return new APIPromise($do(client, options));
|
|
17
|
+
}
|
|
18
|
+
async function $do(client, options) {
|
|
19
|
+
const path = pathToFunc("/users/me")();
|
|
20
|
+
const headers = new Headers(compactMap({
|
|
21
|
+
Accept: "application/json",
|
|
22
|
+
}));
|
|
23
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
24
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
25
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
26
|
+
const context = {
|
|
27
|
+
options: client._options,
|
|
28
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
29
|
+
operationID: "getMe",
|
|
30
|
+
oAuth2Scopes: null,
|
|
31
|
+
resolvedSecurity: requestSecurity,
|
|
32
|
+
securitySource: client._options.bearerAuth,
|
|
33
|
+
retryConfig: options?.retries
|
|
34
|
+
|| client._options.retryConfig
|
|
35
|
+
|| { strategy: "none" },
|
|
36
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
37
|
+
};
|
|
38
|
+
const requestRes = client._createRequest(context, {
|
|
39
|
+
security: requestSecurity,
|
|
40
|
+
method: "GET",
|
|
41
|
+
baseURL: options?.serverURL,
|
|
42
|
+
path: path,
|
|
43
|
+
headers: headers,
|
|
44
|
+
userAgent: client._options.userAgent,
|
|
45
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
46
|
+
}, options);
|
|
47
|
+
if (!requestRes.ok) {
|
|
48
|
+
return [requestRes, { status: "invalid" }];
|
|
49
|
+
}
|
|
50
|
+
const req = requestRes.value;
|
|
51
|
+
const doResult = await client._do(req, {
|
|
52
|
+
context,
|
|
53
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
54
|
+
retryConfig: context.retryConfig,
|
|
55
|
+
retryCodes: context.retryCodes,
|
|
56
|
+
});
|
|
57
|
+
if (!doResult.ok) {
|
|
58
|
+
return [doResult, { status: "request-error", request: req }];
|
|
59
|
+
}
|
|
60
|
+
const response = doResult.value;
|
|
61
|
+
const [result] = await M.match(M.json(200, models.User$inboundSchema), M.fail([401, "4XX"]), M.fail("5XX"))(response, req);
|
|
62
|
+
if (!result.ok) {
|
|
63
|
+
return [result, { status: "complete", request: req, response }];
|
|
64
|
+
}
|
|
65
|
+
return [result, { status: "complete", request: req, response }];
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=me-get-me.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"me-get-me.js","sourceRoot":"","sources":["../../src/funcs/me-get-me.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAW3C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG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AAC,CAAC;IACjB,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAAA,CACjE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FankareSDKCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { FankareSDKError } from "../models/errors/fankare-sdk-error.js";
|
|
4
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/http-client-errors.js";
|
|
5
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
6
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
7
|
+
import * as models from "../models/index.js";
|
|
8
|
+
import { APIPromise } from "../types/async.js";
|
|
9
|
+
import { Result } from "../types/fp.js";
|
|
10
|
+
/**
|
|
11
|
+
* Request a presigned URL to upload or replace the authenticated user's avatar image
|
|
12
|
+
*/
|
|
13
|
+
export declare function meRequestAvatarUploadUrl(client: FankareSDKCore, request: models.ProfileMediaUploadRequest, options?: RequestOptions): APIPromise<Result<models.ProfileMediaUploadResponse, FankareSDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
14
|
+
//# sourceMappingURL=me-request-avatar-upload-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"me-request-avatar-upload-url.d.ts","sourceRoot":"","sources":["../../src/funcs/me-request-avatar-upload-url.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAM5C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,MAAM,CAAC,yBAAyB,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,MAAM,CAAC,0BAA0B,EAC/B,eAAe,GACf,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|