@objectstack/client 3.0.7 → 3.0.9
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +16 -0
- package/dist/index.d.mts +197 -2
- package/dist/index.d.ts +197 -2
- package/dist/index.js +330 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +330 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
- package/src/client.feed.test.ts +273 -0
- package/src/client.test.ts +179 -0
- package/src/index.ts +406 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @objectstack/client@3.0.
|
|
2
|
+
> @objectstack/client@3.0.9 build /home/runner/work/spec/spec/packages/client
|
|
3
3
|
> tsup --config ../../tsup.config.ts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m51.81 KB[39m
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m103.43 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 66ms
|
|
16
|
+
[32mCJS[39m [1mdist/index.js [22m[32m52.96 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m103.49 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 66ms
|
|
19
19
|
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
|
21
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
22
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
20
|
+
[32mDTS[39m ⚡️ Build success in 5282ms
|
|
21
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m30.42 KB[39m
|
|
22
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m30.42 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @objectstack/client
|
|
2
2
|
|
|
3
|
+
## 3.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [15e0df6]
|
|
8
|
+
- @objectstack/spec@3.0.9
|
|
9
|
+
- @objectstack/core@3.0.9
|
|
10
|
+
|
|
11
|
+
## 3.0.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [5a968a2]
|
|
16
|
+
- @objectstack/spec@3.0.8
|
|
17
|
+
- @objectstack/core@3.0.8
|
|
18
|
+
|
|
3
19
|
## 3.0.7
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FilterCondition, QueryAST, SortNode, AggregationNode } from '@objectstack/spec/data';
|
|
2
|
-
import { GetDiscoveryResponse, StandardErrorCode, ErrorCategory, GetMetaTypesResponse, GetMetaItemsResponse, MetadataCacheRequest, MetadataCacheResponse, LoginRequest, SessionResponse, RegisterRequest, FileUploadResponse, CheckPermissionRequest, CheckPermissionResponse, GetObjectPermissionsResponse, GetEffectivePermissionsResponse, RealtimeConnectRequest, RealtimeConnectResponse, RealtimeSubscribeRequest, RealtimeSubscribeResponse, SetPresenceRequest, GetPresenceResponse, GetWorkflowConfigResponse, GetWorkflowStateResponse, WorkflowTransitionRequest, WorkflowTransitionResponse, WorkflowApproveRequest, WorkflowApproveResponse, WorkflowRejectRequest, WorkflowRejectResponse, ListViewsResponse, GetViewResponse, CreateViewRequest, CreateViewResponse, UpdateViewRequest, UpdateViewResponse, DeleteViewResponse, RegisterDeviceRequest, RegisterDeviceResponse, UnregisterDeviceResponse, GetNotificationPreferencesResponse, UpdateNotificationPreferencesRequest, UpdateNotificationPreferencesResponse, ListNotificationsResponse, MarkNotificationsReadResponse, MarkAllNotificationsReadResponse, AiNlqRequest, AiNlqResponse, AiChatRequest, AiChatResponse, AiSuggestRequest, AiSuggestResponse, AiInsightsRequest, AiInsightsResponse, GetLocalesResponse, GetTranslationsResponse, GetFieldLabelsResponse, BatchUpdateRequest, BatchUpdateResponse, BatchOptions } from '@objectstack/spec/api';
|
|
3
|
-
export { AiChatRequest, AiChatResponse, AiInsightsRequest, AiInsightsResponse, AiNlqRequest, AiNlqResponse, AiSuggestRequest, AiSuggestResponse, BatchOperationResult, BatchOptions, BatchRecord, BatchUpdateRequest, BatchUpdateResponse, CheckPermissionRequest, CheckPermissionResponse, CreateViewResponse, DeleteManyRequest, DeleteViewResponse, ErrorCategory, GetDiscoveryResponse, GetEffectivePermissionsResponse, GetFieldLabelsResponse, GetLocalesResponse, GetMetaItemsResponse, GetMetaTypesResponse, GetObjectPermissionsResponse, GetPresenceResponse, GetTranslationsResponse, GetViewResponse, GetWorkflowConfigResponse, GetWorkflowStateResponse, ListNotificationsResponse, ListViewsResponse, MetadataCacheRequest, MetadataCacheResponse, RealtimeConnectRequest, RealtimeConnectResponse, RealtimeSubscribeRequest, RealtimeSubscribeResponse, RefreshTokenRequest, RegisterDeviceRequest, RegisterDeviceResponse, RegisterRequest, StandardErrorCode, UpdateManyRequest, UpdateViewResponse, WorkflowApproveRequest, WorkflowApproveResponse, WorkflowRejectRequest, WorkflowRejectResponse, WorkflowTransitionRequest, WorkflowTransitionResponse } from '@objectstack/spec/api';
|
|
2
|
+
import { GetDiscoveryResponse, StandardErrorCode, ErrorCategory, WellKnownCapabilities, GetMetaTypesResponse, GetMetaItemsResponse, MetadataCacheRequest, MetadataCacheResponse, LoginRequest, SessionResponse, RegisterRequest, FileUploadResponse, GetPresignedUrlRequest, PresignedUrlResponse, InitiateChunkedUploadRequest, InitiateChunkedUploadResponse, UploadChunkResponse, CompleteChunkedUploadRequest, CompleteChunkedUploadResponse, CheckPermissionRequest, CheckPermissionResponse, GetObjectPermissionsResponse, GetEffectivePermissionsResponse, RealtimeConnectRequest, RealtimeConnectResponse, RealtimeSubscribeRequest, RealtimeSubscribeResponse, SetPresenceRequest, GetPresenceResponse, GetWorkflowConfigResponse, GetWorkflowStateResponse, WorkflowTransitionRequest, WorkflowTransitionResponse, WorkflowApproveRequest, WorkflowApproveResponse, WorkflowRejectRequest, WorkflowRejectResponse, ListViewsResponse, GetViewResponse, CreateViewRequest, CreateViewResponse, UpdateViewRequest, UpdateViewResponse, DeleteViewResponse, RegisterDeviceRequest, RegisterDeviceResponse, UnregisterDeviceResponse, GetNotificationPreferencesResponse, UpdateNotificationPreferencesRequest, UpdateNotificationPreferencesResponse, ListNotificationsResponse, MarkNotificationsReadResponse, MarkAllNotificationsReadResponse, AiNlqRequest, AiNlqResponse, AiChatRequest, AiChatResponse, AiSuggestRequest, AiSuggestResponse, AiInsightsRequest, AiInsightsResponse, GetLocalesResponse, GetTranslationsResponse, GetFieldLabelsResponse, GetFeedResponse, CreateFeedItemResponse, UpdateFeedItemResponse, DeleteFeedItemResponse, AddReactionResponse, RemoveReactionResponse, PinFeedItemResponse, UnpinFeedItemResponse, StarFeedItemResponse, UnstarFeedItemResponse, SearchFeedResponse, GetChangelogResponse, SubscribeResponse, UnsubscribeResponse, BatchUpdateRequest, BatchUpdateResponse, BatchOptions } from '@objectstack/spec/api';
|
|
3
|
+
export { AddReactionResponse, AiChatRequest, AiChatResponse, AiInsightsRequest, AiInsightsResponse, AiNlqRequest, AiNlqResponse, AiSuggestRequest, AiSuggestResponse, BatchOperationResult, BatchOptions, BatchRecord, BatchUpdateRequest, BatchUpdateResponse, CheckPermissionRequest, CheckPermissionResponse, CreateFeedItemResponse, CreateViewResponse, DeleteFeedItemResponse, DeleteManyRequest, DeleteViewResponse, ErrorCategory, GetChangelogResponse, GetDiscoveryResponse, GetEffectivePermissionsResponse, GetFeedResponse, GetFieldLabelsResponse, GetLocalesResponse, GetMetaItemsResponse, GetMetaTypesResponse, GetObjectPermissionsResponse, GetPresenceResponse, GetTranslationsResponse, GetViewResponse, GetWorkflowConfigResponse, GetWorkflowStateResponse, ListNotificationsResponse, ListViewsResponse, MetadataCacheRequest, MetadataCacheResponse, PinFeedItemResponse, RealtimeConnectRequest, RealtimeConnectResponse, RealtimeSubscribeRequest, RealtimeSubscribeResponse, RefreshTokenRequest, RegisterDeviceRequest, RegisterDeviceResponse, RegisterRequest, RemoveReactionResponse, SearchFeedResponse, StandardErrorCode, StarFeedItemResponse, SubscribeResponse, UnpinFeedItemResponse, UnstarFeedItemResponse, UnsubscribeResponse, UpdateFeedItemResponse, UpdateManyRequest, UpdateViewResponse, WellKnownCapabilities, WorkflowApproveRequest, WorkflowApproveResponse, WorkflowRejectRequest, WorkflowRejectResponse, WorkflowTransitionRequest, WorkflowTransitionResponse } from '@objectstack/spec/api';
|
|
4
4
|
import { Logger } from '@objectstack/core';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -273,9 +273,31 @@ declare class ObjectStackClient {
|
|
|
273
273
|
status: "degraded" | "stub" | "available" | "unavailable";
|
|
274
274
|
route?: string | undefined;
|
|
275
275
|
provider?: string | undefined;
|
|
276
|
+
version?: string | undefined;
|
|
276
277
|
message?: string | undefined;
|
|
278
|
+
rateLimit?: {
|
|
279
|
+
requestsPerMinute?: number | undefined;
|
|
280
|
+
requestsPerHour?: number | undefined;
|
|
281
|
+
burstLimit?: number | undefined;
|
|
282
|
+
retryAfterMs?: number | undefined;
|
|
283
|
+
} | undefined;
|
|
277
284
|
}> | undefined;
|
|
285
|
+
capabilities?: {
|
|
286
|
+
feed: boolean;
|
|
287
|
+
comments: boolean;
|
|
288
|
+
automation: boolean;
|
|
289
|
+
cron: boolean;
|
|
290
|
+
search: boolean;
|
|
291
|
+
export: boolean;
|
|
292
|
+
chunkedUpload: boolean;
|
|
293
|
+
} | undefined;
|
|
278
294
|
}>;
|
|
295
|
+
/**
|
|
296
|
+
* Well-known capability flags discovered from the server.
|
|
297
|
+
* Returns undefined if the client has not yet connected or the server
|
|
298
|
+
* did not include capabilities in its discovery response.
|
|
299
|
+
*/
|
|
300
|
+
get capabilities(): WellKnownCapabilities | undefined;
|
|
279
301
|
/**
|
|
280
302
|
* Metadata Operations
|
|
281
303
|
*/
|
|
@@ -425,12 +447,89 @@ declare class ObjectStackClient {
|
|
|
425
447
|
storage: {
|
|
426
448
|
upload: (file: any, scope?: string) => Promise<FileUploadResponse>;
|
|
427
449
|
getDownloadUrl: (fileId: string) => Promise<string>;
|
|
450
|
+
/**
|
|
451
|
+
* Get a presigned URL for direct-to-cloud upload
|
|
452
|
+
*/
|
|
453
|
+
getPresignedUrl: (req: GetPresignedUrlRequest) => Promise<PresignedUrlResponse>;
|
|
454
|
+
/**
|
|
455
|
+
* Initiate a chunked (multipart) upload session
|
|
456
|
+
*/
|
|
457
|
+
initChunkedUpload: (req: InitiateChunkedUploadRequest) => Promise<InitiateChunkedUploadResponse>;
|
|
458
|
+
/**
|
|
459
|
+
* Upload a single chunk/part of a multipart upload
|
|
460
|
+
*/
|
|
461
|
+
uploadPart: (uploadId: string, chunkIndex: number, resumeToken: string, data: Blob | Buffer) => Promise<UploadChunkResponse>;
|
|
462
|
+
/**
|
|
463
|
+
* Complete a chunked upload by assembling all parts
|
|
464
|
+
*/
|
|
465
|
+
completeChunkedUpload: (req: CompleteChunkedUploadRequest) => Promise<CompleteChunkedUploadResponse>;
|
|
466
|
+
/**
|
|
467
|
+
* Resume an interrupted chunked upload.
|
|
468
|
+
* Fetches current progress, then uploads remaining chunks and completes.
|
|
469
|
+
*/
|
|
470
|
+
resumeUpload: (uploadId: string, file: Blob | ArrayBuffer, chunkSize: number, resumeToken: string) => Promise<CompleteChunkedUploadResponse>;
|
|
428
471
|
};
|
|
429
472
|
/**
|
|
430
473
|
* Automation Services
|
|
431
474
|
*/
|
|
432
475
|
automation: {
|
|
476
|
+
/**
|
|
477
|
+
* Trigger a named automation flow (legacy endpoint)
|
|
478
|
+
*/
|
|
433
479
|
trigger: (triggerName: string, payload: any) => Promise<any>;
|
|
480
|
+
/**
|
|
481
|
+
* List all registered automation flows
|
|
482
|
+
*/
|
|
483
|
+
list: () => Promise<{
|
|
484
|
+
flows: string[];
|
|
485
|
+
total: number;
|
|
486
|
+
hasMore: boolean;
|
|
487
|
+
}>;
|
|
488
|
+
/**
|
|
489
|
+
* Get a flow definition by name
|
|
490
|
+
*/
|
|
491
|
+
get: (name: string) => Promise<any>;
|
|
492
|
+
/**
|
|
493
|
+
* Create (register) a new flow
|
|
494
|
+
*/
|
|
495
|
+
create: (name: string, definition: any) => Promise<any>;
|
|
496
|
+
/**
|
|
497
|
+
* Update an existing flow
|
|
498
|
+
*/
|
|
499
|
+
update: (name: string, definition: any) => Promise<any>;
|
|
500
|
+
/**
|
|
501
|
+
* Delete (unregister) a flow
|
|
502
|
+
*/
|
|
503
|
+
delete: (name: string) => Promise<{
|
|
504
|
+
name: string;
|
|
505
|
+
deleted: boolean;
|
|
506
|
+
}>;
|
|
507
|
+
/**
|
|
508
|
+
* Enable or disable a flow
|
|
509
|
+
*/
|
|
510
|
+
toggle: (name: string, enabled: boolean) => Promise<{
|
|
511
|
+
name: string;
|
|
512
|
+
enabled: boolean;
|
|
513
|
+
}>;
|
|
514
|
+
/**
|
|
515
|
+
* Execution run history
|
|
516
|
+
*/
|
|
517
|
+
runs: {
|
|
518
|
+
/**
|
|
519
|
+
* List execution runs for a flow
|
|
520
|
+
*/
|
|
521
|
+
list: (flowName: string, options?: {
|
|
522
|
+
limit?: number;
|
|
523
|
+
cursor?: string;
|
|
524
|
+
}) => Promise<{
|
|
525
|
+
runs: any[];
|
|
526
|
+
hasMore: boolean;
|
|
527
|
+
}>;
|
|
528
|
+
/**
|
|
529
|
+
* Get a single execution run
|
|
530
|
+
*/
|
|
531
|
+
get: (flowName: string, runId: string) => Promise<any>;
|
|
532
|
+
};
|
|
434
533
|
};
|
|
435
534
|
/**
|
|
436
535
|
* Permissions Services
|
|
@@ -607,6 +706,102 @@ declare class ObjectStackClient {
|
|
|
607
706
|
*/
|
|
608
707
|
getFieldLabels: (object: string, locale: string) => Promise<GetFieldLabelsResponse>;
|
|
609
708
|
};
|
|
709
|
+
/**
|
|
710
|
+
* Feed / Chatter Services
|
|
711
|
+
*
|
|
712
|
+
* Provides access to the activity timeline (comments, field changes, tasks),
|
|
713
|
+
* emoji reactions, pin/star, search, changelog, and record subscriptions.
|
|
714
|
+
* Base path: /api/data/{object}/{recordId}/feed
|
|
715
|
+
*/
|
|
716
|
+
feed: {
|
|
717
|
+
/**
|
|
718
|
+
* List feed items for a record
|
|
719
|
+
*/
|
|
720
|
+
list: (object: string, recordId: string, options?: {
|
|
721
|
+
type?: string;
|
|
722
|
+
limit?: number;
|
|
723
|
+
cursor?: string;
|
|
724
|
+
}) => Promise<GetFeedResponse>;
|
|
725
|
+
/**
|
|
726
|
+
* Create a new feed item (comment, note, task, etc.)
|
|
727
|
+
*/
|
|
728
|
+
create: (object: string, recordId: string, data: {
|
|
729
|
+
type: string;
|
|
730
|
+
body?: string;
|
|
731
|
+
mentions?: any[];
|
|
732
|
+
parentId?: string;
|
|
733
|
+
visibility?: string;
|
|
734
|
+
}) => Promise<CreateFeedItemResponse>;
|
|
735
|
+
/**
|
|
736
|
+
* Update an existing feed item
|
|
737
|
+
*/
|
|
738
|
+
update: (object: string, recordId: string, feedId: string, data: {
|
|
739
|
+
body?: string;
|
|
740
|
+
mentions?: any[];
|
|
741
|
+
visibility?: string;
|
|
742
|
+
}) => Promise<UpdateFeedItemResponse>;
|
|
743
|
+
/**
|
|
744
|
+
* Delete a feed item
|
|
745
|
+
*/
|
|
746
|
+
delete: (object: string, recordId: string, feedId: string) => Promise<DeleteFeedItemResponse>;
|
|
747
|
+
/**
|
|
748
|
+
* Add an emoji reaction to a feed item
|
|
749
|
+
*/
|
|
750
|
+
addReaction: (object: string, recordId: string, feedId: string, emoji: string) => Promise<AddReactionResponse>;
|
|
751
|
+
/**
|
|
752
|
+
* Remove an emoji reaction from a feed item
|
|
753
|
+
*/
|
|
754
|
+
removeReaction: (object: string, recordId: string, feedId: string, emoji: string) => Promise<RemoveReactionResponse>;
|
|
755
|
+
/**
|
|
756
|
+
* Pin a feed item to the top of the timeline
|
|
757
|
+
*/
|
|
758
|
+
pin: (object: string, recordId: string, feedId: string) => Promise<PinFeedItemResponse>;
|
|
759
|
+
/**
|
|
760
|
+
* Unpin a feed item
|
|
761
|
+
*/
|
|
762
|
+
unpin: (object: string, recordId: string, feedId: string) => Promise<UnpinFeedItemResponse>;
|
|
763
|
+
/**
|
|
764
|
+
* Star (bookmark) a feed item
|
|
765
|
+
*/
|
|
766
|
+
star: (object: string, recordId: string, feedId: string) => Promise<StarFeedItemResponse>;
|
|
767
|
+
/**
|
|
768
|
+
* Unstar a feed item
|
|
769
|
+
*/
|
|
770
|
+
unstar: (object: string, recordId: string, feedId: string) => Promise<UnstarFeedItemResponse>;
|
|
771
|
+
/**
|
|
772
|
+
* Search feed items
|
|
773
|
+
*/
|
|
774
|
+
search: (object: string, recordId: string, query: string, options?: {
|
|
775
|
+
type?: string;
|
|
776
|
+
actorId?: string;
|
|
777
|
+
dateFrom?: string;
|
|
778
|
+
dateTo?: string;
|
|
779
|
+
limit?: number;
|
|
780
|
+
cursor?: string;
|
|
781
|
+
}) => Promise<SearchFeedResponse>;
|
|
782
|
+
/**
|
|
783
|
+
* Get field-level changelog for a record
|
|
784
|
+
*/
|
|
785
|
+
getChangelog: (object: string, recordId: string, options?: {
|
|
786
|
+
field?: string;
|
|
787
|
+
actorId?: string;
|
|
788
|
+
dateFrom?: string;
|
|
789
|
+
dateTo?: string;
|
|
790
|
+
limit?: number;
|
|
791
|
+
cursor?: string;
|
|
792
|
+
}) => Promise<GetChangelogResponse>;
|
|
793
|
+
/**
|
|
794
|
+
* Subscribe to record notifications
|
|
795
|
+
*/
|
|
796
|
+
subscribe: (object: string, recordId: string, options?: {
|
|
797
|
+
events?: string[];
|
|
798
|
+
channels?: string[];
|
|
799
|
+
}) => Promise<SubscribeResponse>;
|
|
800
|
+
/**
|
|
801
|
+
* Unsubscribe from record notifications
|
|
802
|
+
*/
|
|
803
|
+
unsubscribe: (object: string, recordId: string) => Promise<UnsubscribeResponse>;
|
|
804
|
+
};
|
|
610
805
|
/**
|
|
611
806
|
* Data Operations
|
|
612
807
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FilterCondition, QueryAST, SortNode, AggregationNode } from '@objectstack/spec/data';
|
|
2
|
-
import { GetDiscoveryResponse, StandardErrorCode, ErrorCategory, GetMetaTypesResponse, GetMetaItemsResponse, MetadataCacheRequest, MetadataCacheResponse, LoginRequest, SessionResponse, RegisterRequest, FileUploadResponse, CheckPermissionRequest, CheckPermissionResponse, GetObjectPermissionsResponse, GetEffectivePermissionsResponse, RealtimeConnectRequest, RealtimeConnectResponse, RealtimeSubscribeRequest, RealtimeSubscribeResponse, SetPresenceRequest, GetPresenceResponse, GetWorkflowConfigResponse, GetWorkflowStateResponse, WorkflowTransitionRequest, WorkflowTransitionResponse, WorkflowApproveRequest, WorkflowApproveResponse, WorkflowRejectRequest, WorkflowRejectResponse, ListViewsResponse, GetViewResponse, CreateViewRequest, CreateViewResponse, UpdateViewRequest, UpdateViewResponse, DeleteViewResponse, RegisterDeviceRequest, RegisterDeviceResponse, UnregisterDeviceResponse, GetNotificationPreferencesResponse, UpdateNotificationPreferencesRequest, UpdateNotificationPreferencesResponse, ListNotificationsResponse, MarkNotificationsReadResponse, MarkAllNotificationsReadResponse, AiNlqRequest, AiNlqResponse, AiChatRequest, AiChatResponse, AiSuggestRequest, AiSuggestResponse, AiInsightsRequest, AiInsightsResponse, GetLocalesResponse, GetTranslationsResponse, GetFieldLabelsResponse, BatchUpdateRequest, BatchUpdateResponse, BatchOptions } from '@objectstack/spec/api';
|
|
3
|
-
export { AiChatRequest, AiChatResponse, AiInsightsRequest, AiInsightsResponse, AiNlqRequest, AiNlqResponse, AiSuggestRequest, AiSuggestResponse, BatchOperationResult, BatchOptions, BatchRecord, BatchUpdateRequest, BatchUpdateResponse, CheckPermissionRequest, CheckPermissionResponse, CreateViewResponse, DeleteManyRequest, DeleteViewResponse, ErrorCategory, GetDiscoveryResponse, GetEffectivePermissionsResponse, GetFieldLabelsResponse, GetLocalesResponse, GetMetaItemsResponse, GetMetaTypesResponse, GetObjectPermissionsResponse, GetPresenceResponse, GetTranslationsResponse, GetViewResponse, GetWorkflowConfigResponse, GetWorkflowStateResponse, ListNotificationsResponse, ListViewsResponse, MetadataCacheRequest, MetadataCacheResponse, RealtimeConnectRequest, RealtimeConnectResponse, RealtimeSubscribeRequest, RealtimeSubscribeResponse, RefreshTokenRequest, RegisterDeviceRequest, RegisterDeviceResponse, RegisterRequest, StandardErrorCode, UpdateManyRequest, UpdateViewResponse, WorkflowApproveRequest, WorkflowApproveResponse, WorkflowRejectRequest, WorkflowRejectResponse, WorkflowTransitionRequest, WorkflowTransitionResponse } from '@objectstack/spec/api';
|
|
2
|
+
import { GetDiscoveryResponse, StandardErrorCode, ErrorCategory, WellKnownCapabilities, GetMetaTypesResponse, GetMetaItemsResponse, MetadataCacheRequest, MetadataCacheResponse, LoginRequest, SessionResponse, RegisterRequest, FileUploadResponse, GetPresignedUrlRequest, PresignedUrlResponse, InitiateChunkedUploadRequest, InitiateChunkedUploadResponse, UploadChunkResponse, CompleteChunkedUploadRequest, CompleteChunkedUploadResponse, CheckPermissionRequest, CheckPermissionResponse, GetObjectPermissionsResponse, GetEffectivePermissionsResponse, RealtimeConnectRequest, RealtimeConnectResponse, RealtimeSubscribeRequest, RealtimeSubscribeResponse, SetPresenceRequest, GetPresenceResponse, GetWorkflowConfigResponse, GetWorkflowStateResponse, WorkflowTransitionRequest, WorkflowTransitionResponse, WorkflowApproveRequest, WorkflowApproveResponse, WorkflowRejectRequest, WorkflowRejectResponse, ListViewsResponse, GetViewResponse, CreateViewRequest, CreateViewResponse, UpdateViewRequest, UpdateViewResponse, DeleteViewResponse, RegisterDeviceRequest, RegisterDeviceResponse, UnregisterDeviceResponse, GetNotificationPreferencesResponse, UpdateNotificationPreferencesRequest, UpdateNotificationPreferencesResponse, ListNotificationsResponse, MarkNotificationsReadResponse, MarkAllNotificationsReadResponse, AiNlqRequest, AiNlqResponse, AiChatRequest, AiChatResponse, AiSuggestRequest, AiSuggestResponse, AiInsightsRequest, AiInsightsResponse, GetLocalesResponse, GetTranslationsResponse, GetFieldLabelsResponse, GetFeedResponse, CreateFeedItemResponse, UpdateFeedItemResponse, DeleteFeedItemResponse, AddReactionResponse, RemoveReactionResponse, PinFeedItemResponse, UnpinFeedItemResponse, StarFeedItemResponse, UnstarFeedItemResponse, SearchFeedResponse, GetChangelogResponse, SubscribeResponse, UnsubscribeResponse, BatchUpdateRequest, BatchUpdateResponse, BatchOptions } from '@objectstack/spec/api';
|
|
3
|
+
export { AddReactionResponse, AiChatRequest, AiChatResponse, AiInsightsRequest, AiInsightsResponse, AiNlqRequest, AiNlqResponse, AiSuggestRequest, AiSuggestResponse, BatchOperationResult, BatchOptions, BatchRecord, BatchUpdateRequest, BatchUpdateResponse, CheckPermissionRequest, CheckPermissionResponse, CreateFeedItemResponse, CreateViewResponse, DeleteFeedItemResponse, DeleteManyRequest, DeleteViewResponse, ErrorCategory, GetChangelogResponse, GetDiscoveryResponse, GetEffectivePermissionsResponse, GetFeedResponse, GetFieldLabelsResponse, GetLocalesResponse, GetMetaItemsResponse, GetMetaTypesResponse, GetObjectPermissionsResponse, GetPresenceResponse, GetTranslationsResponse, GetViewResponse, GetWorkflowConfigResponse, GetWorkflowStateResponse, ListNotificationsResponse, ListViewsResponse, MetadataCacheRequest, MetadataCacheResponse, PinFeedItemResponse, RealtimeConnectRequest, RealtimeConnectResponse, RealtimeSubscribeRequest, RealtimeSubscribeResponse, RefreshTokenRequest, RegisterDeviceRequest, RegisterDeviceResponse, RegisterRequest, RemoveReactionResponse, SearchFeedResponse, StandardErrorCode, StarFeedItemResponse, SubscribeResponse, UnpinFeedItemResponse, UnstarFeedItemResponse, UnsubscribeResponse, UpdateFeedItemResponse, UpdateManyRequest, UpdateViewResponse, WellKnownCapabilities, WorkflowApproveRequest, WorkflowApproveResponse, WorkflowRejectRequest, WorkflowRejectResponse, WorkflowTransitionRequest, WorkflowTransitionResponse } from '@objectstack/spec/api';
|
|
4
4
|
import { Logger } from '@objectstack/core';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -273,9 +273,31 @@ declare class ObjectStackClient {
|
|
|
273
273
|
status: "degraded" | "stub" | "available" | "unavailable";
|
|
274
274
|
route?: string | undefined;
|
|
275
275
|
provider?: string | undefined;
|
|
276
|
+
version?: string | undefined;
|
|
276
277
|
message?: string | undefined;
|
|
278
|
+
rateLimit?: {
|
|
279
|
+
requestsPerMinute?: number | undefined;
|
|
280
|
+
requestsPerHour?: number | undefined;
|
|
281
|
+
burstLimit?: number | undefined;
|
|
282
|
+
retryAfterMs?: number | undefined;
|
|
283
|
+
} | undefined;
|
|
277
284
|
}> | undefined;
|
|
285
|
+
capabilities?: {
|
|
286
|
+
feed: boolean;
|
|
287
|
+
comments: boolean;
|
|
288
|
+
automation: boolean;
|
|
289
|
+
cron: boolean;
|
|
290
|
+
search: boolean;
|
|
291
|
+
export: boolean;
|
|
292
|
+
chunkedUpload: boolean;
|
|
293
|
+
} | undefined;
|
|
278
294
|
}>;
|
|
295
|
+
/**
|
|
296
|
+
* Well-known capability flags discovered from the server.
|
|
297
|
+
* Returns undefined if the client has not yet connected or the server
|
|
298
|
+
* did not include capabilities in its discovery response.
|
|
299
|
+
*/
|
|
300
|
+
get capabilities(): WellKnownCapabilities | undefined;
|
|
279
301
|
/**
|
|
280
302
|
* Metadata Operations
|
|
281
303
|
*/
|
|
@@ -425,12 +447,89 @@ declare class ObjectStackClient {
|
|
|
425
447
|
storage: {
|
|
426
448
|
upload: (file: any, scope?: string) => Promise<FileUploadResponse>;
|
|
427
449
|
getDownloadUrl: (fileId: string) => Promise<string>;
|
|
450
|
+
/**
|
|
451
|
+
* Get a presigned URL for direct-to-cloud upload
|
|
452
|
+
*/
|
|
453
|
+
getPresignedUrl: (req: GetPresignedUrlRequest) => Promise<PresignedUrlResponse>;
|
|
454
|
+
/**
|
|
455
|
+
* Initiate a chunked (multipart) upload session
|
|
456
|
+
*/
|
|
457
|
+
initChunkedUpload: (req: InitiateChunkedUploadRequest) => Promise<InitiateChunkedUploadResponse>;
|
|
458
|
+
/**
|
|
459
|
+
* Upload a single chunk/part of a multipart upload
|
|
460
|
+
*/
|
|
461
|
+
uploadPart: (uploadId: string, chunkIndex: number, resumeToken: string, data: Blob | Buffer) => Promise<UploadChunkResponse>;
|
|
462
|
+
/**
|
|
463
|
+
* Complete a chunked upload by assembling all parts
|
|
464
|
+
*/
|
|
465
|
+
completeChunkedUpload: (req: CompleteChunkedUploadRequest) => Promise<CompleteChunkedUploadResponse>;
|
|
466
|
+
/**
|
|
467
|
+
* Resume an interrupted chunked upload.
|
|
468
|
+
* Fetches current progress, then uploads remaining chunks and completes.
|
|
469
|
+
*/
|
|
470
|
+
resumeUpload: (uploadId: string, file: Blob | ArrayBuffer, chunkSize: number, resumeToken: string) => Promise<CompleteChunkedUploadResponse>;
|
|
428
471
|
};
|
|
429
472
|
/**
|
|
430
473
|
* Automation Services
|
|
431
474
|
*/
|
|
432
475
|
automation: {
|
|
476
|
+
/**
|
|
477
|
+
* Trigger a named automation flow (legacy endpoint)
|
|
478
|
+
*/
|
|
433
479
|
trigger: (triggerName: string, payload: any) => Promise<any>;
|
|
480
|
+
/**
|
|
481
|
+
* List all registered automation flows
|
|
482
|
+
*/
|
|
483
|
+
list: () => Promise<{
|
|
484
|
+
flows: string[];
|
|
485
|
+
total: number;
|
|
486
|
+
hasMore: boolean;
|
|
487
|
+
}>;
|
|
488
|
+
/**
|
|
489
|
+
* Get a flow definition by name
|
|
490
|
+
*/
|
|
491
|
+
get: (name: string) => Promise<any>;
|
|
492
|
+
/**
|
|
493
|
+
* Create (register) a new flow
|
|
494
|
+
*/
|
|
495
|
+
create: (name: string, definition: any) => Promise<any>;
|
|
496
|
+
/**
|
|
497
|
+
* Update an existing flow
|
|
498
|
+
*/
|
|
499
|
+
update: (name: string, definition: any) => Promise<any>;
|
|
500
|
+
/**
|
|
501
|
+
* Delete (unregister) a flow
|
|
502
|
+
*/
|
|
503
|
+
delete: (name: string) => Promise<{
|
|
504
|
+
name: string;
|
|
505
|
+
deleted: boolean;
|
|
506
|
+
}>;
|
|
507
|
+
/**
|
|
508
|
+
* Enable or disable a flow
|
|
509
|
+
*/
|
|
510
|
+
toggle: (name: string, enabled: boolean) => Promise<{
|
|
511
|
+
name: string;
|
|
512
|
+
enabled: boolean;
|
|
513
|
+
}>;
|
|
514
|
+
/**
|
|
515
|
+
* Execution run history
|
|
516
|
+
*/
|
|
517
|
+
runs: {
|
|
518
|
+
/**
|
|
519
|
+
* List execution runs for a flow
|
|
520
|
+
*/
|
|
521
|
+
list: (flowName: string, options?: {
|
|
522
|
+
limit?: number;
|
|
523
|
+
cursor?: string;
|
|
524
|
+
}) => Promise<{
|
|
525
|
+
runs: any[];
|
|
526
|
+
hasMore: boolean;
|
|
527
|
+
}>;
|
|
528
|
+
/**
|
|
529
|
+
* Get a single execution run
|
|
530
|
+
*/
|
|
531
|
+
get: (flowName: string, runId: string) => Promise<any>;
|
|
532
|
+
};
|
|
434
533
|
};
|
|
435
534
|
/**
|
|
436
535
|
* Permissions Services
|
|
@@ -607,6 +706,102 @@ declare class ObjectStackClient {
|
|
|
607
706
|
*/
|
|
608
707
|
getFieldLabels: (object: string, locale: string) => Promise<GetFieldLabelsResponse>;
|
|
609
708
|
};
|
|
709
|
+
/**
|
|
710
|
+
* Feed / Chatter Services
|
|
711
|
+
*
|
|
712
|
+
* Provides access to the activity timeline (comments, field changes, tasks),
|
|
713
|
+
* emoji reactions, pin/star, search, changelog, and record subscriptions.
|
|
714
|
+
* Base path: /api/data/{object}/{recordId}/feed
|
|
715
|
+
*/
|
|
716
|
+
feed: {
|
|
717
|
+
/**
|
|
718
|
+
* List feed items for a record
|
|
719
|
+
*/
|
|
720
|
+
list: (object: string, recordId: string, options?: {
|
|
721
|
+
type?: string;
|
|
722
|
+
limit?: number;
|
|
723
|
+
cursor?: string;
|
|
724
|
+
}) => Promise<GetFeedResponse>;
|
|
725
|
+
/**
|
|
726
|
+
* Create a new feed item (comment, note, task, etc.)
|
|
727
|
+
*/
|
|
728
|
+
create: (object: string, recordId: string, data: {
|
|
729
|
+
type: string;
|
|
730
|
+
body?: string;
|
|
731
|
+
mentions?: any[];
|
|
732
|
+
parentId?: string;
|
|
733
|
+
visibility?: string;
|
|
734
|
+
}) => Promise<CreateFeedItemResponse>;
|
|
735
|
+
/**
|
|
736
|
+
* Update an existing feed item
|
|
737
|
+
*/
|
|
738
|
+
update: (object: string, recordId: string, feedId: string, data: {
|
|
739
|
+
body?: string;
|
|
740
|
+
mentions?: any[];
|
|
741
|
+
visibility?: string;
|
|
742
|
+
}) => Promise<UpdateFeedItemResponse>;
|
|
743
|
+
/**
|
|
744
|
+
* Delete a feed item
|
|
745
|
+
*/
|
|
746
|
+
delete: (object: string, recordId: string, feedId: string) => Promise<DeleteFeedItemResponse>;
|
|
747
|
+
/**
|
|
748
|
+
* Add an emoji reaction to a feed item
|
|
749
|
+
*/
|
|
750
|
+
addReaction: (object: string, recordId: string, feedId: string, emoji: string) => Promise<AddReactionResponse>;
|
|
751
|
+
/**
|
|
752
|
+
* Remove an emoji reaction from a feed item
|
|
753
|
+
*/
|
|
754
|
+
removeReaction: (object: string, recordId: string, feedId: string, emoji: string) => Promise<RemoveReactionResponse>;
|
|
755
|
+
/**
|
|
756
|
+
* Pin a feed item to the top of the timeline
|
|
757
|
+
*/
|
|
758
|
+
pin: (object: string, recordId: string, feedId: string) => Promise<PinFeedItemResponse>;
|
|
759
|
+
/**
|
|
760
|
+
* Unpin a feed item
|
|
761
|
+
*/
|
|
762
|
+
unpin: (object: string, recordId: string, feedId: string) => Promise<UnpinFeedItemResponse>;
|
|
763
|
+
/**
|
|
764
|
+
* Star (bookmark) a feed item
|
|
765
|
+
*/
|
|
766
|
+
star: (object: string, recordId: string, feedId: string) => Promise<StarFeedItemResponse>;
|
|
767
|
+
/**
|
|
768
|
+
* Unstar a feed item
|
|
769
|
+
*/
|
|
770
|
+
unstar: (object: string, recordId: string, feedId: string) => Promise<UnstarFeedItemResponse>;
|
|
771
|
+
/**
|
|
772
|
+
* Search feed items
|
|
773
|
+
*/
|
|
774
|
+
search: (object: string, recordId: string, query: string, options?: {
|
|
775
|
+
type?: string;
|
|
776
|
+
actorId?: string;
|
|
777
|
+
dateFrom?: string;
|
|
778
|
+
dateTo?: string;
|
|
779
|
+
limit?: number;
|
|
780
|
+
cursor?: string;
|
|
781
|
+
}) => Promise<SearchFeedResponse>;
|
|
782
|
+
/**
|
|
783
|
+
* Get field-level changelog for a record
|
|
784
|
+
*/
|
|
785
|
+
getChangelog: (object: string, recordId: string, options?: {
|
|
786
|
+
field?: string;
|
|
787
|
+
actorId?: string;
|
|
788
|
+
dateFrom?: string;
|
|
789
|
+
dateTo?: string;
|
|
790
|
+
limit?: number;
|
|
791
|
+
cursor?: string;
|
|
792
|
+
}) => Promise<GetChangelogResponse>;
|
|
793
|
+
/**
|
|
794
|
+
* Subscribe to record notifications
|
|
795
|
+
*/
|
|
796
|
+
subscribe: (object: string, recordId: string, options?: {
|
|
797
|
+
events?: string[];
|
|
798
|
+
channels?: string[];
|
|
799
|
+
}) => Promise<SubscribeResponse>;
|
|
800
|
+
/**
|
|
801
|
+
* Unsubscribe from record notifications
|
|
802
|
+
*/
|
|
803
|
+
unsubscribe: (object: string, recordId: string) => Promise<UnsubscribeResponse>;
|
|
804
|
+
};
|
|
610
805
|
/**
|
|
611
806
|
* Data Operations
|
|
612
807
|
*/
|