@objectstack/client 4.0.4 → 4.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/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { FilterCondition, QueryAST, SortNode, AggregationNode } from '@objectstack/spec/data';
2
- import { MetadataEvent, DataEvent, ApiRoutes, GetDiscoveryResponse, 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, AiSuggestRequest, AiSuggestResponse, AiInsightsRequest, AiInsightsResponse, GetLocalesResponse, GetTranslationsResponse, GetFieldLabelsResponse, GetFeedResponse, CreateFeedItemResponse, UpdateFeedItemResponse, DeleteFeedItemResponse, AddReactionResponse, RemoveReactionResponse, PinFeedItemResponse, UnpinFeedItemResponse, StarFeedItemResponse, UnstarFeedItemResponse, SearchFeedResponse, GetChangelogResponse, SubscribeResponse, UnsubscribeResponse, BatchUpdateRequest, BatchUpdateResponse, BatchOptions, StandardErrorCode, ErrorCategory } from '@objectstack/spec/api';
2
+ import { MetadataEvent, DataEvent, ApiRoutes, GetDiscoveryResponse, WellKnownCapabilities, GetMetaTypesResponse, GetMetaItemsResponse, MetadataCacheRequest, MetadataCacheResponse, BatchUpdateRequest, BatchUpdateResponse, BatchOptions, 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, AiSuggestRequest, AiSuggestResponse, AiInsightsRequest, AiInsightsResponse, GetLocalesResponse, GetTranslationsResponse, GetFieldLabelsResponse, GetFeedResponse, CreateFeedItemResponse, UpdateFeedItemResponse, DeleteFeedItemResponse, AddReactionResponse, RemoveReactionResponse, PinFeedItemResponse, UnpinFeedItemResponse, StarFeedItemResponse, UnstarFeedItemResponse, SearchFeedResponse, GetChangelogResponse, SubscribeResponse, UnsubscribeResponse, StandardErrorCode, ErrorCategory } from '@objectstack/spec/api';
3
3
  export { AddReactionResponse, AiInsightsRequest, AiInsightsResponse, AiNlqRequest, AiNlqResponse, AiSuggestRequest, AiSuggestResponse, AuthFeaturesConfig, AuthProviderInfo, BatchOperationResult, BatchOptions, BatchRecord, BatchUpdateRequest, BatchUpdateResponse, CheckPermissionRequest, CheckPermissionResponse, CreateFeedItemResponse, CreateViewResponse, DeleteFeedItemResponse, DeleteManyRequest, DeleteViewResponse, EmailPasswordConfigPublic, ErrorCategory, GetAuthConfigResponse, 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
- import { Logger } from '@objectstack/core';
4
+ import { Logger } from '@objectstack/core/logger';
5
5
  import { RealtimeEventPayload } from '@objectstack/spec/contracts';
6
6
 
7
7
  /**
@@ -263,6 +263,14 @@ interface ClientConfig {
263
263
  * Enable debug logging
264
264
  */
265
265
  debug?: boolean;
266
+ /**
267
+ * Active project id (UUID of `sys_project`). When present, the
268
+ * client injects an `X-Project-Id` header on every request so the
269
+ * server's tenant router can resolve the physical data-plane database.
270
+ *
271
+ * @see docs/adr/0002-project-database-isolation.md
272
+ */
273
+ projectId?: string;
266
274
  }
267
275
  /**
268
276
  * Discovery Result
@@ -366,6 +374,7 @@ interface StandardError {
366
374
  declare class ObjectStackClient {
367
375
  private baseUrl;
368
376
  private token?;
377
+ private projectId?;
369
378
  private fetchImpl;
370
379
  private discoveryInfo?;
371
380
  private logger;
@@ -377,7 +386,7 @@ declare class ObjectStackClient {
377
386
  connect(): Promise<{
378
387
  version: string;
379
388
  name?: string | undefined;
380
- environment?: "development" | "production" | "sandbox" | undefined;
389
+ environment?: "production" | "sandbox" | "development" | undefined;
381
390
  routes?: {
382
391
  data: string;
383
392
  metadata: string;
@@ -403,7 +412,7 @@ declare class ObjectStackClient {
403
412
  } | undefined;
404
413
  services?: Record<string, {
405
414
  enabled: boolean;
406
- status: "degraded" | "stub" | "available" | "registered" | "unavailable";
415
+ status: "available" | "registered" | "unavailable" | "degraded" | "stub";
407
416
  handlerReady?: boolean | undefined;
408
417
  route?: string | undefined;
409
418
  provider?: string | undefined;
@@ -564,6 +573,653 @@ declare class ObjectStackClient {
564
573
  message?: string;
565
574
  }>;
566
575
  };
576
+ /**
577
+ * Environment Management Services
578
+ *
579
+ * Environments are the v4.1+ isolation primitive — each project owns a
580
+ * physically separate data-plane database. All Studio-level switching goes
581
+ * through this API.
582
+ *
583
+ * Endpoints:
584
+ * - GET /api/v1/cloud/projects → list environments
585
+ * - GET /api/v1/cloud/projects/:id → get one (with database info)
586
+ * - POST /api/v1/cloud/projects → provision a new project
587
+ * - PATCH /api/v1/cloud/projects/:id → update (displayName, plan, status, …)
588
+ * - POST /api/v1/cloud/projects/:id/activate → set as session's active project
589
+ * - POST /api/v1/cloud/projects/:id/credentials/rotate → rotate credential
590
+ *
591
+ * @see docs/adr/0002-project-database-isolation.md
592
+ */
593
+ projects: {
594
+ /**
595
+ * List environments visible to the current session. Optionally filter
596
+ * by organization (control-plane query — not routed through a data-plane DB).
597
+ */
598
+ list: (filters?: {
599
+ organization_id?: string;
600
+ env_type?: string;
601
+ status?: string;
602
+ }) => Promise<{
603
+ projects: any[];
604
+ total: number;
605
+ }>;
606
+ /**
607
+ * Get a single project (joined with its database and membership row).
608
+ */
609
+ get: (id: string) => Promise<{
610
+ project: any;
611
+ database?: any;
612
+ credential?: any;
613
+ membership?: any;
614
+ organization?: any;
615
+ }>;
616
+ /**
617
+ * Provision a new project. Delegates to
618
+ * `ProjectProvisioningService.provisionProject` on the server.
619
+ */
620
+ create: (req: {
621
+ organization_id: string;
622
+ slug?: string;
623
+ display_name: string;
624
+ env_type?: string;
625
+ project_type?: string;
626
+ plan?: string;
627
+ region?: string;
628
+ driver?: string;
629
+ is_default?: boolean;
630
+ is_system?: boolean;
631
+ storage_limit_mb?: number;
632
+ clone_from_project_id?: string;
633
+ template_id?: string;
634
+ metadata?: Record<string, unknown>;
635
+ }) => Promise<{
636
+ project: any;
637
+ database: any;
638
+ }>;
639
+ /**
640
+ * Update a project (display_name, plan, status, is_default, metadata).
641
+ */
642
+ update: (id: string, patch: Record<string, unknown>) => Promise<{
643
+ project: any;
644
+ }>;
645
+ /**
646
+ * Cascade-delete a project: cleans up credential/member/package_installation
647
+ * rows, releases the physical database via the provisioning adapter, and
648
+ * removes the `sys_project` row. Default projects require `force: true`.
649
+ */
650
+ delete: (id: string, opts?: {
651
+ force?: boolean;
652
+ }) => Promise<{
653
+ deleted: boolean;
654
+ projectId: string;
655
+ warnings: string[];
656
+ }>;
657
+ /**
658
+ * Activate this project for the current session. The server writes
659
+ * `active_environment_id` on the better-auth session; subsequent requests
660
+ * are routed to this project's database.
661
+ */
662
+ activate: (id: string) => Promise<{
663
+ project: any;
664
+ sessionUpdated: boolean;
665
+ }>;
666
+ /**
667
+ * Rotate the active database credential for this project.
668
+ */
669
+ rotateCredential: (id: string, plaintext: string) => Promise<{
670
+ credential: any;
671
+ }>;
672
+ /**
673
+ * Update the hostname bound to this project. Validates format and
674
+ * uniqueness server-side; invalidates the dispatcher's routing cache.
675
+ */
676
+ updateHostname: (id: string, hostname: string) => Promise<{
677
+ project: any;
678
+ }>;
679
+ /**
680
+ * Update the visibility of this project ('private' | 'public').
681
+ * `private` (default) hides the project from /pub/v1 enumeration but
682
+ * still allows anonymous artifact downloads when the URL includes an
683
+ * exact `?commit=<id>` (share-by-link). `public` lists the project and
684
+ * freely exposes all revisions.
685
+ */
686
+ updateVisibility: (id: string, visibility: "private" | "public") => Promise<{
687
+ project: any;
688
+ }>;
689
+ /**
690
+ * List published artifact revisions for a project. Each revision has
691
+ * an immutable commitId (content-addressable) and storage_key.
692
+ * Optional `branch` filter narrows to a single logical branch
693
+ * (default branch `main` also matches rows with NULL `branch`).
694
+ */
695
+ listRevisions: (id: string, opts?: {
696
+ limit?: number;
697
+ cursor?: string;
698
+ branch?: string;
699
+ }) => Promise<{
700
+ items: Array<{
701
+ commitId: string;
702
+ checksum: string;
703
+ storageKey: string;
704
+ sizeBytes: number;
705
+ builtAt: string;
706
+ publishedAt: string;
707
+ publishedBy: string | null;
708
+ note: string | null;
709
+ isCurrent: boolean;
710
+ branch: string;
711
+ isBranchHead: boolean;
712
+ }>;
713
+ nextCursor: string | null;
714
+ branch: string | null;
715
+ }>;
716
+ /**
717
+ * List logical branches for a project. Each branch has a head commit
718
+ * (latest published revision on that branch) and a count of revisions.
719
+ * Branches without a head row (e.g. all rows demoted) are omitted.
720
+ */
721
+ listBranches: (id: string) => Promise<{
722
+ projectId: string;
723
+ branches: Array<{
724
+ branch: string;
725
+ headCommitId: string;
726
+ headRevisionId: string;
727
+ revisionCount: number;
728
+ headPublishedAt: string | null;
729
+ headNote: string | null;
730
+ isCurrent: boolean;
731
+ }>;
732
+ }>;
733
+ /**
734
+ * Rename a branch. Updates every revision row in `from` to `to`.
735
+ * 409 if `to` already has rows.
736
+ */
737
+ renameBranch: (id: string, from: string, to: string) => Promise<{
738
+ projectId: string;
739
+ from: string;
740
+ to: string;
741
+ renamed: number;
742
+ }>;
743
+ /**
744
+ * Delete (demote) a branch. Soft-removal — clears `is_branch_head` on
745
+ * every row in this branch; the revisions themselves remain. The
746
+ * `main` branch and any branch carrying the active revision cannot be
747
+ * deleted.
748
+ */
749
+ deleteBranch: (id: string, name: string) => Promise<{
750
+ projectId: string;
751
+ branch: string;
752
+ demoted: number;
753
+ totalRevisions: number;
754
+ }>;
755
+ /**
756
+ * Activate (rollback to) a previously-published revision by commit id.
757
+ * Marks the target revision is_current=true and demotes the prior one.
758
+ */
759
+ activateRevision: (id: string, commitId: string) => Promise<{
760
+ projectId: string;
761
+ commitId: string;
762
+ activated: boolean;
763
+ previousCommitId: string | null;
764
+ }>;
765
+ /**
766
+ * Retry provisioning for a project stuck in `failed` (or
767
+ * `provisioning`) state. The server re-runs the driver handshake; on
768
+ * success the project flips to `active`, on failure it stays
769
+ * `failed` with `metadata.provisioningError` updated.
770
+ */
771
+ retryProvisioning: (id: string) => Promise<{
772
+ project: any;
773
+ }>;
774
+ /**
775
+ * List members of a project (per-project RBAC).
776
+ */
777
+ listMembers: (id: string) => Promise<{
778
+ members: any[];
779
+ }>;
780
+ /**
781
+ * Invite a member to a project. Caller must be `owner` or `admin`.
782
+ * Pass either `email` (resolved against the user table) or `user_id`.
783
+ * Returns `{ member, alreadyMember }` — `alreadyMember=true` means the
784
+ * row already existed; the call is idempotent.
785
+ */
786
+ addMember: (id: string, payload: {
787
+ email?: string;
788
+ user_id?: string;
789
+ role?: "owner" | "admin" | "member" | "viewer";
790
+ }) => Promise<{
791
+ member: any;
792
+ alreadyMember: boolean;
793
+ }>;
794
+ /**
795
+ * Update a member's role. Caller must be `owner` or `admin`. Demoting
796
+ * the last `owner` returns 409.
797
+ */
798
+ updateMemberRole: (id: string, memberId: string, role: "owner" | "admin" | "member" | "viewer") => Promise<{
799
+ member: any;
800
+ }>;
801
+ /**
802
+ * Remove a member. Owners/admins may remove anyone; non-privileged
803
+ * users may only remove themselves. Removing the last `owner` returns 409.
804
+ */
805
+ removeMember: (id: string, memberId: string) => Promise<{
806
+ removed: boolean;
807
+ memberId: string;
808
+ }>;
809
+ /**
810
+ * List ObjectQL drivers registered on the server. Useful for populating a
811
+ * driver selector when provisioning a new project (memory / turso /
812
+ * future sql drivers). Returned `name` is the short alias (e.g. `memory`,
813
+ * `turso`); `driverId` is the full FQN (e.g. `com.objectstack.driver.memory`).
814
+ */
815
+ listDrivers: () => Promise<{
816
+ drivers: Array<{
817
+ name: string;
818
+ driverId: string;
819
+ }>;
820
+ total: number;
821
+ }>;
822
+ /**
823
+ * List available project templates. Templates are seeded into the project
824
+ * database once at provisioning time when `template_id` is supplied.
825
+ */
826
+ listTemplates: () => Promise<{
827
+ templates: Array<{
828
+ id: string;
829
+ label: string;
830
+ description: string;
831
+ category?: string;
832
+ }>;
833
+ total: number;
834
+ }>;
835
+ /**
836
+ * Per-project package installation management (Power Apps "solution" model).
837
+ * Install records are stored in the environment's own database.
838
+ */
839
+ packages: {
840
+ /** List all packages installed in a specific project. */
841
+ list: (envId: string) => Promise<{
842
+ packages: any[];
843
+ total: number;
844
+ }>;
845
+ /** Install a package into the project. */
846
+ install: (envId: string, body: {
847
+ packageId: string;
848
+ version?: string;
849
+ settings?: Record<string, unknown>;
850
+ enableOnInstall?: boolean;
851
+ }) => Promise<{
852
+ package: any;
853
+ }>;
854
+ /** Get a single installation record. */
855
+ get: (envId: string, pkgId: string) => Promise<{
856
+ package: any;
857
+ }>;
858
+ /** Enable a previously disabled package. */
859
+ enable: (envId: string, pkgId: string) => Promise<{
860
+ package: any;
861
+ }>;
862
+ /** Disable an installed package (metadata will not be loaded). */
863
+ disable: (envId: string, pkgId: string) => Promise<{
864
+ package: any;
865
+ }>;
866
+ /** Uninstall a package from the project. Forbidden for scope=platform packages. */
867
+ uninstall: (envId: string, pkgId: string) => Promise<{
868
+ id: string;
869
+ success: boolean;
870
+ }>;
871
+ /** Upgrade an installed package to a newer version. */
872
+ upgrade: (envId: string, pkgId: string, targetVersion?: string) => Promise<{
873
+ package: any;
874
+ }>;
875
+ };
876
+ };
877
+ /**
878
+ * Project-scoped client factory.
879
+ *
880
+ * Returns a thin wrapper around the data / meta / packages namespaces that
881
+ * prefixes every request with `/api/v1/projects/:projectId/...`. Use this
882
+ * when the server has `enableProjectScoping: true` in its REST API config.
883
+ *
884
+ * Backward compatibility: `client.data.*`, `client.meta.*`, and
885
+ * `client.packages.*` continue to work unchanged; they hit unscoped routes
886
+ * and rely on hostname / `X-Project-Id` header / session resolution.
887
+ *
888
+ * @example
889
+ * ```ts
890
+ * const scoped = client.project('00000000-0000-0000-0000-000000000001');
891
+ * const tasks = await scoped.data.find('task', { top: 10 });
892
+ * const objects = await scoped.meta.getItems('object');
893
+ * ```
894
+ */
895
+ project(projectId: string): ScopedProjectClient;
896
+ /** @internal */
897
+ _baseUrl(): string;
898
+ /** @internal */
899
+ _fetch(url: string, init?: RequestInit): Promise<Response>;
900
+ /** @internal */
901
+ _unwrap<T>(res: Response): Promise<T>;
902
+ /** @internal */
903
+ _isFilterAST(v: unknown): boolean;
904
+ /**
905
+ * Organization Services
906
+ *
907
+ * Thin wrapper around better-auth's organization plugin endpoints, which
908
+ * are mounted under `/api/v1/auth/organization/**`. Used by the Studio
909
+ * OrganizationSwitcher and the /orgs management routes.
910
+ */
911
+ organizations: {
912
+ /**
913
+ * List organizations the current user belongs to.
914
+ * GET /api/v1/auth/organization/list
915
+ */
916
+ list: () => Promise<{
917
+ organizations: Array<{
918
+ id: string;
919
+ name: string;
920
+ slug?: string;
921
+ logo?: string;
922
+ metadata?: any;
923
+ }>;
924
+ }>;
925
+ /**
926
+ * Create a new organization.
927
+ * POST /api/v1/auth/organization/create
928
+ */
929
+ create: (req: {
930
+ name: string;
931
+ slug?: string;
932
+ logo?: string;
933
+ metadata?: Record<string, unknown>;
934
+ }) => Promise<any>;
935
+ /**
936
+ * Update an existing organization.
937
+ * POST /api/v1/auth/organization/update
938
+ *
939
+ * better-auth requires the caller to be an owner/admin (server-side
940
+ * enforcement); the body shape is `{ organizationId, data: {...} }`.
941
+ */
942
+ update: (organizationId: string, data: {
943
+ name?: string;
944
+ slug?: string;
945
+ logo?: string;
946
+ metadata?: Record<string, unknown>;
947
+ }) => Promise<any>;
948
+ /**
949
+ * Set the active organization on the current session. The server writes
950
+ * `activeOrganizationId` on the better-auth session, which downstream
951
+ * handlers (e.g. `EnvironmentProvisioningService`) consult.
952
+ *
953
+ * POST /api/v1/auth/organization/set-active
954
+ */
955
+ setActive: (organizationId: string) => Promise<any>;
956
+ /**
957
+ * Get full organization detail (members, invitations, teams).
958
+ * GET /api/v1/auth/organization/get-full-organization?organizationId=...
959
+ */
960
+ get: (organizationId: string) => Promise<any>;
961
+ /**
962
+ * List members of an organization.
963
+ */
964
+ listMembers: (organizationId: string) => Promise<any>;
965
+ /**
966
+ * Invite a user to the organization.
967
+ */
968
+ invite: (req: {
969
+ email: string;
970
+ role?: string;
971
+ organizationId?: string;
972
+ }) => Promise<any>;
973
+ /**
974
+ * Leave the given organization.
975
+ */
976
+ leave: (organizationId: string) => Promise<any>;
977
+ /**
978
+ * Delete an organization via better-auth's organization plugin.
979
+ *
980
+ * POST /api/v1/auth/organization/delete
981
+ *
982
+ * better-auth removes the organization row, all members, and all
983
+ * pending invitations. Project teardown (per-project DBs, etc.) is
984
+ * handled server-side by hooks attached to the organization plugin.
985
+ */
986
+ delete: (organizationId: string) => Promise<any>;
987
+ /**
988
+ * Remove a member from an organization.
989
+ *
990
+ * better-auth: POST /organization/remove-member
991
+ * Body: `{ memberIdOrEmail, organizationId? }` — note the parameter is the
992
+ * **member id** (the row id from `member` table) or the user's email; it
993
+ * is *not* the bare `userId`. Server enforces owner/admin permission.
994
+ */
995
+ removeMember: (organizationId: string, params: {
996
+ memberIdOrEmail: string;
997
+ }) => Promise<any>;
998
+ /**
999
+ * Change a member's role in an organization (owner/admin only).
1000
+ *
1001
+ * better-auth: POST /organization/update-member-role
1002
+ * Body: `{ memberId, role, organizationId? }`. The `memberId` is the
1003
+ * `member` table row id (not user id). `role` is one of the configured
1004
+ * organisation roles (default: `owner | admin | member`).
1005
+ */
1006
+ updateMemberRole: (organizationId: string, params: {
1007
+ memberId: string;
1008
+ role: string;
1009
+ }) => Promise<any>;
1010
+ /**
1011
+ * Look up the calling user's membership row in the given organisation.
1012
+ * Useful for permission checks on the client without having to scan the
1013
+ * full member list.
1014
+ *
1015
+ * better-auth: GET /organization/get-active-member?organizationId=…
1016
+ */
1017
+ getActiveMember: (organizationId: string) => Promise<any>;
1018
+ /**
1019
+ * Invitation lifecycle — wraps better-auth's organization-plugin
1020
+ * invitation endpoints. Always go through here instead of writing to
1021
+ * `sys_invitation` via the data API: the better-auth writers handle
1022
+ * status transitions, expiry, dedupe, and the `sendInvitationEmail`
1023
+ * side-effect that the auth-manager wires up.
1024
+ */
1025
+ invitations: {
1026
+ /**
1027
+ * List pending/accepted/canceled invitations for an organization.
1028
+ * Requires owner/admin role on that org.
1029
+ *
1030
+ * better-auth: GET /organization/list-invitations?organizationId=…
1031
+ */
1032
+ list: (organizationId: string) => Promise<{
1033
+ invitations: Array<{
1034
+ id: string;
1035
+ email: string;
1036
+ role: string;
1037
+ status: "pending" | "accepted" | "rejected" | "canceled";
1038
+ organizationId: string;
1039
+ inviterId: string;
1040
+ expiresAt: string;
1041
+ teamId?: string | null;
1042
+ }>;
1043
+ }>;
1044
+ /**
1045
+ * List the **current user's** incoming invitations across every
1046
+ * organisation. Used by the per-user "Invitations" inbox page.
1047
+ *
1048
+ * better-auth: GET /organization/list-user-invitations
1049
+ */
1050
+ listMine: () => Promise<{
1051
+ invitations: Array<{
1052
+ id: string;
1053
+ email: string;
1054
+ role: string;
1055
+ status: string;
1056
+ organizationId: string;
1057
+ inviterId: string;
1058
+ expiresAt: string;
1059
+ }>;
1060
+ }>;
1061
+ /** better-auth: POST /organization/cancel-invitation */
1062
+ cancel: (invitationId: string) => Promise<any>;
1063
+ /** better-auth: POST /organization/accept-invitation */
1064
+ accept: (invitationId: string) => Promise<any>;
1065
+ /** better-auth: POST /organization/reject-invitation */
1066
+ reject: (invitationId: string) => Promise<any>;
1067
+ /**
1068
+ * "Resend" an invitation. better-auth has no first-class resend
1069
+ * endpoint, so we implement it as cancel-then-invite: cancel the old
1070
+ * row (so its status flips to `canceled` and audit hooks fire), then
1071
+ * issue a fresh invite. The new invite re-runs `sendInvitationEmail`
1072
+ * on the server, so the recipient gets a brand-new accept URL.
1073
+ *
1074
+ * If `cancel()` fails (e.g. invite already accepted) the error is
1075
+ * re-thrown without re-inviting.
1076
+ */
1077
+ resend: (invitation: {
1078
+ id?: string;
1079
+ email: string;
1080
+ role?: string;
1081
+ organizationId: string;
1082
+ teamId?: string | null;
1083
+ }) => Promise<any>;
1084
+ };
1085
+ /**
1086
+ * Team management — only available when the organisation plugin is
1087
+ * configured with `teams: { enabled: true }` on the server. Calls return
1088
+ * a 4xx if teams aren't enabled; UI should hide the section in that case.
1089
+ */
1090
+ teams: {
1091
+ /** better-auth: GET /organization/list-teams?organizationId=… */
1092
+ list: (organizationId: string) => Promise<{
1093
+ teams: Array<{
1094
+ id: string;
1095
+ name: string;
1096
+ organizationId: string;
1097
+ createdAt?: string;
1098
+ }>;
1099
+ }>;
1100
+ /** better-auth: POST /organization/create-team */
1101
+ create: (req: {
1102
+ name: string;
1103
+ organizationId: string;
1104
+ }) => Promise<any>;
1105
+ /** better-auth: POST /organization/update-team */
1106
+ update: (params: {
1107
+ teamId: string;
1108
+ data: {
1109
+ name?: string;
1110
+ };
1111
+ }) => Promise<any>;
1112
+ /** better-auth: POST /organization/remove-team */
1113
+ delete: (params: {
1114
+ teamId: string;
1115
+ organizationId?: string;
1116
+ }) => Promise<any>;
1117
+ /** better-auth: GET /organization/list-team-members?teamId=… */
1118
+ listMembers: (teamId: string) => Promise<{
1119
+ members: Array<{
1120
+ id: string;
1121
+ teamId: string;
1122
+ userId: string;
1123
+ }>;
1124
+ }>;
1125
+ /** better-auth: POST /organization/add-team-member */
1126
+ addMember: (params: {
1127
+ teamId: string;
1128
+ userId: string;
1129
+ }) => Promise<any>;
1130
+ /** better-auth: POST /organization/remove-team-member */
1131
+ removeMember: (params: {
1132
+ teamId: string;
1133
+ userId: string;
1134
+ }) => Promise<any>;
1135
+ };
1136
+ };
1137
+ /**
1138
+ * OAuth / OpenID Connect Provider — admin endpoints exposed by
1139
+ * `@better-auth/oauth-provider` (when enabled on the server). Lets users
1140
+ * register their own OAuth client applications, list them, and revoke them.
1141
+ *
1142
+ * All endpoints are mounted under the auth route, e.g. `/api/v1/auth/oauth2/*`.
1143
+ */
1144
+ oauth: {
1145
+ applications: {
1146
+ /**
1147
+ * Register a new OAuth client application.
1148
+ * POST /api/v1/auth/oauth2/create-client (authenticated)
1149
+ *
1150
+ * Returns the freshly-issued `client_id` and `client_secret`.
1151
+ * The secret is only returned at creation time — store it securely.
1152
+ */
1153
+ register: (req: {
1154
+ client_name?: string;
1155
+ name?: string;
1156
+ redirect_uris: string[];
1157
+ token_endpoint_auth_method?: "none" | "client_secret_basic" | "client_secret_post";
1158
+ grant_types?: string[];
1159
+ response_types?: string[];
1160
+ client_uri?: string;
1161
+ logo_uri?: string;
1162
+ scope?: string;
1163
+ scopes?: string[];
1164
+ contacts?: string[];
1165
+ tos_uri?: string;
1166
+ policy_uri?: string;
1167
+ metadata?: Record<string, unknown>;
1168
+ }) => Promise<any>;
1169
+ /**
1170
+ * Get a single OAuth application by its `client_id`.
1171
+ * GET /api/v1/auth/oauth2/get-client?client_id=...
1172
+ */
1173
+ get: (clientId: string) => Promise<any>;
1174
+ /**
1175
+ * Get a single OAuth application's public fields (no auth required
1176
+ * once the user has signed in). Used by the consent screen.
1177
+ * GET /api/v1/auth/oauth2/public-client?client_id=...
1178
+ */
1179
+ getPublic: (clientId: string) => Promise<any>;
1180
+ /**
1181
+ * List OAuth applications visible to the current user.
1182
+ *
1183
+ * Uses `@better-auth/oauth-provider`'s `/oauth2/get-clients` endpoint
1184
+ * which returns clients owned by the current user (and their
1185
+ * organization, if applicable).
1186
+ */
1187
+ list: () => Promise<{
1188
+ applications: Array<Record<string, any>>;
1189
+ }>;
1190
+ /**
1191
+ * Delete an OAuth application by its `client_id`.
1192
+ * POST /api/v1/auth/oauth2/delete-client
1193
+ *
1194
+ * Tokens and consents referencing the client cascade-delete via the
1195
+ * better-auth schema's `onDelete: cascade` foreign keys.
1196
+ */
1197
+ delete: (clientId: string) => Promise<any>;
1198
+ };
1199
+ /**
1200
+ * Submit the user's decision to a pending consent request.
1201
+ * POST /api/v1/auth/oauth2/consent
1202
+ *
1203
+ * Called by the consent screen after the user accepts or denies. The
1204
+ * `oauth_query` is the raw query string of the consent page URL — it
1205
+ * carries the signed authorization request that the consent endpoint
1206
+ * verifies before issuing the authorization code.
1207
+ */
1208
+ consent: (req: {
1209
+ accept: boolean;
1210
+ scope?: string;
1211
+ oauth_query?: string;
1212
+ }) => Promise<any>;
1213
+ };
1214
+ /**
1215
+ * Update the active project id used for subsequent requests.
1216
+ * Pass `undefined` to clear (falls back to the session default).
1217
+ */
1218
+ setProjectId(projectId: string | undefined): void;
1219
+ /**
1220
+ * Current active project id (if set).
1221
+ */
1222
+ getProjectId(): string | undefined;
567
1223
  /**
568
1224
  * Authentication Services
569
1225
  */
@@ -593,12 +1249,212 @@ declare class ObjectStackClient {
593
1249
  * Uses better-auth endpoint: POST /sign-up/email
594
1250
  */
595
1251
  register: (request: RegisterRequest) => Promise<SessionResponse>;
1252
+ /**
1253
+ * Initiate OAuth sign-in via a social or OIDC provider.
1254
+ *
1255
+ * - Social providers (Google, GitHub, etc.): calls POST /sign-in/social with `{ provider }`.
1256
+ * - OIDC/enterprise providers: calls POST /sign-in/oauth2 with `{ providerId }`.
1257
+ *
1258
+ * After the provider callback better-auth sets the session cookie and redirects to `callbackURL`.
1259
+ */
1260
+ signInWithProvider: (provider: string, opts?: {
1261
+ callbackURL?: string;
1262
+ errorCallbackURL?: string;
1263
+ type?: "social" | "oidc";
1264
+ }) => Promise<void>;
596
1265
  /**
597
1266
  * Refresh an authentication token
598
1267
  * Note: better-auth handles token refresh automatically via /get-session
599
1268
  * @param _refreshToken - Not used (better-auth handles refresh automatically)
600
1269
  */
601
1270
  refreshToken: (_refreshToken: string) => Promise<SessionResponse>;
1271
+ /**
1272
+ * Probe the framework-only `/auth/bootstrap-status` endpoint to determine
1273
+ * whether the very first owner has been provisioned. The Account portal's
1274
+ * `/setup` route uses this to decide whether to render the bootstrap form
1275
+ * or bounce the user straight to `/login`.
1276
+ */
1277
+ bootstrapStatus: () => Promise<{
1278
+ hasOwner: boolean;
1279
+ }>;
1280
+ /**
1281
+ * Update the current user's profile.
1282
+ *
1283
+ * better-auth: POST /update-user — accepts `{ name?, image?, ... }`
1284
+ * (any custom user fields configured on the server). Returns the
1285
+ * updated user.
1286
+ */
1287
+ updateUser: (data: {
1288
+ name?: string;
1289
+ image?: string | null;
1290
+ [key: string]: unknown;
1291
+ }) => Promise<any>;
1292
+ /**
1293
+ * Change the current user's password (email/password accounts only).
1294
+ *
1295
+ * better-auth: POST /change-password.
1296
+ * Set `revokeOtherSessions: true` to invalidate every other session
1297
+ * after the change.
1298
+ */
1299
+ changePassword: (req: {
1300
+ currentPassword: string;
1301
+ newPassword: string;
1302
+ revokeOtherSessions?: boolean;
1303
+ }) => Promise<any>;
1304
+ /**
1305
+ * Begin a change-email flow. better-auth sends a verification mail to
1306
+ * the new address; the change only takes effect after the user clicks
1307
+ * the link.
1308
+ *
1309
+ * better-auth: POST /change-email — `{ newEmail, callbackURL? }`.
1310
+ */
1311
+ changeEmail: (req: {
1312
+ newEmail: string;
1313
+ callbackURL?: string;
1314
+ }) => Promise<any>;
1315
+ /**
1316
+ * Re-send the email-verification link to the current user (or any
1317
+ * address when called as an admin). better-auth: POST /send-verification-email.
1318
+ */
1319
+ sendVerificationEmail: (req: {
1320
+ email: string;
1321
+ callbackURL?: string;
1322
+ }) => Promise<any>;
1323
+ /**
1324
+ * Verify an email-verification token (the link target).
1325
+ *
1326
+ * better-auth: GET /verify-email?token=…&callbackURL=…
1327
+ */
1328
+ verifyEmail: (params: {
1329
+ token: string;
1330
+ callbackURL?: string;
1331
+ }) => Promise<any>;
1332
+ /**
1333
+ * Permanently delete the current user. better-auth supports two flows:
1334
+ *
1335
+ * 1. With a fresh-session password challenge: POST `{ password }`.
1336
+ * 2. With an emailed deletion-confirmation token: POST `{ token }`,
1337
+ * typically following an out-of-band confirmation step.
1338
+ *
1339
+ * Server policy decides which is required; pass whichever you have.
1340
+ */
1341
+ deleteUser: (req: {
1342
+ password?: string;
1343
+ token?: string;
1344
+ callbackURL?: string;
1345
+ }) => Promise<any>;
1346
+ /**
1347
+ * Active-session management. Wraps better-auth's session endpoints so
1348
+ * the Account portal's `/account/sessions` page can list every device
1349
+ * the user is signed in from and revoke them individually or in bulk.
1350
+ */
1351
+ sessions: {
1352
+ /** better-auth: GET /list-sessions — returns the current user's sessions. */
1353
+ list: () => Promise<{
1354
+ sessions: Array<{
1355
+ id: string;
1356
+ token: string;
1357
+ userId: string;
1358
+ userAgent?: string;
1359
+ ipAddress?: string;
1360
+ createdAt: string;
1361
+ expiresAt: string;
1362
+ }>;
1363
+ }>;
1364
+ /** better-auth: POST /revoke-session — revoke a single session by token. */
1365
+ revoke: (token: string) => Promise<any>;
1366
+ /** better-auth: POST /revoke-other-sessions — keep current, kill the rest. */
1367
+ revokeOthers: () => Promise<any>;
1368
+ /** better-auth: POST /revoke-sessions — kill every session for this user. */
1369
+ revokeAll: () => Promise<any>;
1370
+ };
1371
+ /**
1372
+ * Two-factor authentication (TOTP + backup codes). Requires the
1373
+ * `twoFactor` plugin to be enabled on the server (see
1374
+ * `plugin-auth` config). Endpoints live under `/two-factor/*`.
1375
+ */
1376
+ twoFactor: {
1377
+ /**
1378
+ * Start enrolment. Server returns a TOTP URI (`otpauth://...`) which
1379
+ * the UI renders as a QR code; the user then calls `verifyTotp` to
1380
+ * confirm and finish enabling.
1381
+ */
1382
+ enable: (req: {
1383
+ password: string;
1384
+ }) => Promise<{
1385
+ totpURI?: string;
1386
+ backupCodes?: string[];
1387
+ }>;
1388
+ /**
1389
+ * Confirm a TOTP code — used to finalise enrolment after `enable()`
1390
+ * or to step up an existing 2FA-enabled session. `trustDevice` (when
1391
+ * supported by the server config) suppresses the 2FA challenge on
1392
+ * this browser for the configured trust period.
1393
+ */
1394
+ verifyTotp: (req: {
1395
+ code: string;
1396
+ trustDevice?: boolean;
1397
+ }) => Promise<any>;
1398
+ /** Disable 2FA for the current user. Requires the password again. */
1399
+ disable: (req: {
1400
+ password: string;
1401
+ }) => Promise<any>;
1402
+ /**
1403
+ * Issue a fresh set of backup codes (invalidating any previous set).
1404
+ * Display them once — the server only stores hashes.
1405
+ */
1406
+ generateBackupCodes: (req: {
1407
+ password: string;
1408
+ }) => Promise<{
1409
+ backupCodes: string[];
1410
+ }>;
1411
+ /**
1412
+ * Verify a 2FA backup code in lieu of a TOTP. Useful as a recovery
1413
+ * affordance when the user has lost their authenticator app.
1414
+ */
1415
+ verifyBackupCode: (req: {
1416
+ code: string;
1417
+ }) => Promise<any>;
1418
+ };
1419
+ /**
1420
+ * Linked credentials — i.e. the rows in better-auth's `account` table
1421
+ * (one per provider × user). Lets the user see and unlink their social
1422
+ * / OIDC connections from the Account portal.
1423
+ */
1424
+ accounts: {
1425
+ /** better-auth: GET /list-accounts */
1426
+ list: () => Promise<{
1427
+ accounts: Array<{
1428
+ id: string;
1429
+ providerId: string;
1430
+ accountId: string;
1431
+ createdAt?: string;
1432
+ updatedAt?: string;
1433
+ }>;
1434
+ }>;
1435
+ /**
1436
+ * Unlink a provider connection.
1437
+ * better-auth: POST /unlink-account — `{ providerId, accountId? }`.
1438
+ * `accountId` is required when the user has more than one account
1439
+ * for the same provider.
1440
+ */
1441
+ unlink: (req: {
1442
+ providerId: string;
1443
+ accountId?: string;
1444
+ }) => Promise<any>;
1445
+ /**
1446
+ * Link an additional social provider to the current user.
1447
+ * better-auth: POST /link-social — `{ provider, callbackURL }`. The
1448
+ * server returns a redirect URL; the caller should `window.location`
1449
+ * to it (mirroring `signInWithProvider`).
1450
+ */
1451
+ linkSocial: (req: {
1452
+ provider: string;
1453
+ callbackURL?: string;
1454
+ }) => Promise<{
1455
+ url?: string;
1456
+ }>;
1457
+ };
602
1458
  };
603
1459
  /**
604
1460
  * Storage Services
@@ -689,6 +1545,22 @@ declare class ObjectStackClient {
689
1545
  */
690
1546
  get: (flowName: string, runId: string) => Promise<any>;
691
1547
  };
1548
+ /**
1549
+ * Flat aliases mirroring the ScopedProjectClient.automation surface so
1550
+ * Studio (and other consumers) can use the same call shape regardless of
1551
+ * whether they hold a scoped or unscoped client.
1552
+ */
1553
+ /** Alias for `automation.get` — fetch a flow definition by name. */
1554
+ getFlow: <T = any>(name: string) => Promise<T>;
1555
+ /** Execute (trigger) a flow with an execution context. */
1556
+ execute: <T = any>(name: string, ctx?: Record<string, any>) => Promise<T>;
1557
+ /** Alias for `automation.runs.list`. */
1558
+ listRuns: <T = any>(flowName: string, opts?: {
1559
+ limit?: number;
1560
+ cursor?: string;
1561
+ }) => Promise<T>;
1562
+ /** Alias for `automation.runs.get`. */
1563
+ getRun: <T = any>(flowName: string, runId: string) => Promise<T>;
692
1564
  };
693
1565
  /**
694
1566
  * Event Subscription API
@@ -1018,5 +1890,107 @@ declare class ObjectStackClient {
1018
1890
  */
1019
1891
  private getRoute;
1020
1892
  }
1893
+ /**
1894
+ * Project-scoped sub-client.
1895
+ *
1896
+ * Wraps an {@link ObjectStackClient} and prefixes every request with
1897
+ * `/api/v1/projects/:projectId/...` so a single client instance can talk to
1898
+ * multiple projects without mutating global state.
1899
+ *
1900
+ * The scoped client exposes the same shape as the `data`, `meta`, `batch`,
1901
+ * and `packages` namespaces on `ObjectStackClient` — only the URL prefix
1902
+ * differs. The server-side dual-mode route registration (see
1903
+ * `packages/rest/src/rest-server.ts`) accepts both shapes when
1904
+ * `projectResolution` is `'auto'` or `'optional'`.
1905
+ */
1906
+ declare class ScopedProjectClient {
1907
+ private readonly parent;
1908
+ private readonly projectId;
1909
+ constructor(parent: ObjectStackClient, projectId: string);
1910
+ /** The projectId this client is scoped to. */
1911
+ getProjectId(): string;
1912
+ /** Prefix segment inserted between the baseUrl and the resource path. */
1913
+ private scope;
1914
+ private url;
1915
+ /**
1916
+ * Metadata operations scoped to this project.
1917
+ */
1918
+ meta: {
1919
+ getTypes: () => Promise<GetMetaTypesResponse>;
1920
+ getItems: (type: string, options?: {
1921
+ packageId?: string;
1922
+ }) => Promise<GetMetaItemsResponse>;
1923
+ getItem: (type: string, name: string, options?: {
1924
+ packageId?: string;
1925
+ }) => Promise<unknown>;
1926
+ saveItem: (type: string, name: string, item: any) => Promise<unknown>;
1927
+ deleteItem: (type: string, name: string) => Promise<{
1928
+ type: string;
1929
+ name: string;
1930
+ deleted: boolean;
1931
+ }>;
1932
+ };
1933
+ /**
1934
+ * Data operations scoped to this project.
1935
+ *
1936
+ * Mirrors the query / find / get / create / update / delete / batch
1937
+ * surface on {@link ObjectStackClient}. URL construction differs only
1938
+ * in the prefix — query parameter serialization is identical.
1939
+ */
1940
+ data: {
1941
+ query: <T = any>(object: string, query: Partial<QueryAST>) => Promise<PaginatedResult<T>>;
1942
+ find: <T = any>(object: string, options?: QueryOptions | QueryOptionsV2) => Promise<PaginatedResult<T>>;
1943
+ get: <T = any>(object: string, id: string) => Promise<GetDataResult<T>>;
1944
+ create: <T = any>(object: string, data: Partial<T>) => Promise<CreateDataResult<T>>;
1945
+ createMany: <T = any>(object: string, data: Partial<T>[]) => Promise<T[]>;
1946
+ update: <T = any>(object: string, id: string, data: Partial<T>) => Promise<UpdateDataResult<T>>;
1947
+ batch: (object: string, request: BatchUpdateRequest) => Promise<BatchUpdateResponse>;
1948
+ updateMany: <T = any>(object: string, records: Array<{
1949
+ id: string;
1950
+ data: Partial<T>;
1951
+ }>, options?: BatchOptions) => Promise<BatchUpdateResponse>;
1952
+ delete: (object: string, id: string) => Promise<DeleteDataResult>;
1953
+ deleteMany: (object: string, ids: string[], options?: BatchOptions) => Promise<BatchUpdateResponse>;
1954
+ };
1955
+ /**
1956
+ * Package management scoped to this project.
1957
+ * Only the read-path is exposed here — publish / delete remain on the
1958
+ * global `client.packages` namespace for now, pending dedicated per-project
1959
+ * package tests.
1960
+ */
1961
+ packages: {
1962
+ list: () => Promise<{
1963
+ packages: any[];
1964
+ total: number;
1965
+ }>;
1966
+ get: (id: string, version?: string) => Promise<{
1967
+ package: any;
1968
+ }>;
1969
+ };
1970
+ /**
1971
+ * Automation (Flow) operations scoped to this project.
1972
+ *
1973
+ * Thin wrapper around the dispatcher's automation routes, mounted under
1974
+ * `/api/v1/projects/:projectId/automation/...`. Surface mirrors the methods
1975
+ * needed by Studio's Flow viewer: read flow definition, execute (trigger),
1976
+ * list runs, fetch a single run.
1977
+ */
1978
+ automation: {
1979
+ /** Fetch a flow definition by name. */
1980
+ getFlow: <T = any>(name: string) => Promise<T>;
1981
+ /**
1982
+ * Execute (trigger) a flow by name. The request body is forwarded as the
1983
+ * automation execution context (e.g. `{ params, trigger }`).
1984
+ */
1985
+ execute: <T = any>(name: string, ctx?: Record<string, any>) => Promise<T>;
1986
+ /** List recent runs for a flow. */
1987
+ listRuns: <T = any>(flowName: string, opts?: {
1988
+ limit?: number;
1989
+ cursor?: string;
1990
+ }) => Promise<T>;
1991
+ /** Fetch a single run (with step log) for a flow. */
1992
+ getRun: <T = any>(flowName: string, runId: string) => Promise<T>;
1993
+ };
1994
+ }
1021
1995
 
1022
- export { type ApiRouteType, type ClientConfig, type CreateDataResult, type DeleteDataResult, type DiscoveryResult, FilterBuilder, type GetDataResult, ObjectStackClient, type PaginatedResult, QueryBuilder, type QueryOptions, type QueryOptionsV2, RealtimeAPI, type RealtimeEventHandler, type RealtimeSubscriptionFilter, type StandardError, type UpdateDataResult, createFilter, createQuery };
1996
+ export { type ApiRouteType, type ClientConfig, type CreateDataResult, type DeleteDataResult, type DiscoveryResult, FilterBuilder, type GetDataResult, ObjectStackClient, type PaginatedResult, QueryBuilder, type QueryOptions, type QueryOptionsV2, RealtimeAPI, type RealtimeEventHandler, type RealtimeSubscriptionFilter, ScopedProjectClient, type StandardError, type UpdateDataResult, createFilter, createQuery };