lemma-sdk 0.2.32 → 0.2.34
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/README.md +190 -54
- package/dist/browser/lemma-client.js +84 -14
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -1
- package/dist/namespaces/desks.d.ts +5 -2
- package/dist/namespaces/desks.js +5 -2
- package/dist/namespaces/files.d.ts +11 -0
- package/dist/namespaces/files.js +12 -0
- package/dist/namespaces/pod-surfaces.js +1 -1
- package/dist/namespaces/workflows.d.ts +1 -1
- package/dist/openapi_client/index.d.ts +50 -12
- package/dist/openapi_client/index.js +10 -2
- package/dist/openapi_client/models/AdminConsentInfoResponse.d.ts +6 -0
- package/dist/openapi_client/models/AssistantSurfaceResponse.d.ts +16 -1
- package/dist/openapi_client/models/AssistantSurfaceStatus.d.ts +5 -0
- package/dist/openapi_client/models/AssistantSurfaceStatus.js +10 -0
- package/dist/openapi_client/models/ConversationMessageResponse.d.ts +4 -0
- package/dist/openapi_client/models/ConversationResponse.d.ts +3 -0
- package/dist/openapi_client/models/ConversationType.d.ts +8 -0
- package/dist/openapi_client/models/ConversationType.js +13 -0
- package/dist/openapi_client/models/CreateSurfaceRequest.d.ts +16 -5
- package/dist/openapi_client/models/{DataStoreFlowStart.d.ts → DataStoreFlowStartInput.d.ts} +1 -1
- package/dist/openapi_client/models/DataStoreFlowStartOutput.d.ts +11 -0
- package/dist/openapi_client/models/DataStoreWorkflowStartInput.d.ts +11 -0
- package/dist/openapi_client/models/DataStoreWorkflowStartOutput.d.ts +11 -0
- package/dist/openapi_client/models/DeskBundleUploadRequest.d.ts +1 -1
- package/dist/openapi_client/models/{EventFlowStart.d.ts → EventFlowStartInput.d.ts} +1 -1
- package/dist/openapi_client/models/EventFlowStartOutput.d.ts +19 -0
- package/dist/openapi_client/models/EventWorkflowStartInput.d.ts +11 -0
- package/dist/openapi_client/models/EventWorkflowStartOutput.d.ts +11 -0
- package/dist/openapi_client/models/FlowInstallResponse.d.ts +15 -0
- package/dist/openapi_client/models/FlowResponse.d.ts +5 -2
- package/dist/openapi_client/models/GmailSurfaceConfig.d.ts +7 -0
- package/dist/openapi_client/models/GmailSurfaceConfig.js +1 -0
- package/dist/openapi_client/models/GmailSurfaceConfigInput.d.ts +4 -0
- package/dist/openapi_client/models/GmailSurfaceConfigInput.js +1 -0
- package/dist/openapi_client/models/GrantPermissionRequest.d.ts +6 -0
- package/dist/openapi_client/models/GrantPermissionRequest.js +1 -0
- package/dist/openapi_client/models/ManualWorkflowStartInput.d.ts +10 -0
- package/dist/openapi_client/models/ManualWorkflowStartInput.js +1 -0
- package/dist/openapi_client/models/ManualWorkflowStartOutput.d.ts +10 -0
- package/dist/openapi_client/models/ManualWorkflowStartOutput.js +1 -0
- package/dist/openapi_client/models/OrganizationInvitationRequest.d.ts +2 -0
- package/dist/openapi_client/models/OrganizationInvitationResponse.d.ts +2 -0
- package/dist/openapi_client/models/OutlookSurfaceConfig.d.ts +7 -0
- package/dist/openapi_client/models/OutlookSurfaceConfig.js +1 -0
- package/dist/openapi_client/models/OutlookSurfaceConfigInput.d.ts +4 -0
- package/dist/openapi_client/models/OutlookSurfaceConfigInput.js +1 -0
- package/dist/openapi_client/models/ResourcePermissionListResponse.d.ts +4 -0
- package/dist/openapi_client/models/ResourcePermissionListResponse.js +1 -0
- package/dist/openapi_client/models/ResourcePermissionResponse.d.ts +12 -0
- package/dist/openapi_client/models/ResourcePermissionResponse.js +1 -0
- package/dist/openapi_client/models/{ScheduledFlowStart.d.ts → ScheduledFlowStartInput.d.ts} +1 -1
- package/dist/openapi_client/models/ScheduledFlowStartInput.js +1 -0
- package/dist/openapi_client/models/ScheduledFlowStartOutput.d.ts +7 -0
- package/dist/openapi_client/models/ScheduledFlowStartOutput.js +1 -0
- package/dist/openapi_client/models/ScheduledWorkflowStartInput.d.ts +11 -0
- package/dist/openapi_client/models/ScheduledWorkflowStartInput.js +1 -0
- package/dist/openapi_client/models/ScheduledWorkflowStartOutput.d.ts +11 -0
- package/dist/openapi_client/models/ScheduledWorkflowStartOutput.js +1 -0
- package/dist/openapi_client/models/SetVisibilityRequest.d.ts +3 -0
- package/dist/openapi_client/models/SetVisibilityRequest.js +1 -0
- package/dist/openapi_client/models/SlackCredentialsInput.d.ts +5 -0
- package/dist/openapi_client/models/SlackCredentialsInput.js +1 -0
- package/dist/openapi_client/models/SlackSurfaceConfig.d.ts +10 -0
- package/dist/openapi_client/models/SlackSurfaceConfig.js +1 -0
- package/dist/openapi_client/models/{SlackSurfaceConfigCreate.d.ts → SlackSurfaceConfigInput.d.ts} +1 -1
- package/dist/openapi_client/models/SlackSurfaceConfigInput.js +1 -0
- package/dist/openapi_client/models/SurfaceCredentialMode.d.ts +4 -0
- package/dist/openapi_client/models/SurfaceCredentialMode.js +9 -0
- package/dist/openapi_client/models/SurfaceIntegrationSetupGuide.d.ts +13 -0
- package/dist/openapi_client/models/SurfaceIntegrationSetupGuide.js +1 -0
- package/dist/openapi_client/models/SurfacePlatform.d.ts +8 -0
- package/dist/openapi_client/models/SurfacePlatform.js +13 -0
- package/dist/openapi_client/models/SurfacePlatformSetupGuideResponse.d.ts +9 -0
- package/dist/openapi_client/models/SurfacePlatformSetupGuideResponse.js +1 -0
- package/dist/openapi_client/models/SurfaceRoutingScope.d.ts +4 -0
- package/dist/openapi_client/models/SurfaceRoutingScope.js +9 -0
- package/dist/openapi_client/models/SurfaceSetupField.d.ts +10 -0
- package/dist/openapi_client/models/SurfaceSetupField.js +1 -0
- package/dist/openapi_client/models/SurfaceSetupFieldSource.d.ts +4 -0
- package/dist/openapi_client/models/SurfaceSetupFieldSource.js +9 -0
- package/dist/openapi_client/models/SurfaceSetupMode.d.ts +5 -0
- package/dist/openapi_client/models/SurfaceSetupMode.js +10 -0
- package/dist/openapi_client/models/SurfaceSetupPhase.d.ts +6 -0
- package/dist/openapi_client/models/SurfaceSetupPhase.js +11 -0
- package/dist/openapi_client/models/SurfaceSetupStep.d.ts +6 -0
- package/dist/openapi_client/models/SurfaceSetupStep.js +1 -0
- package/dist/openapi_client/models/SurfaceWebhookMode.d.ts +4 -0
- package/dist/openapi_client/models/SurfaceWebhookMode.js +9 -0
- package/dist/openapi_client/models/TeamsCredentialsInput.d.ts +6 -0
- package/dist/openapi_client/models/TeamsCredentialsInput.js +1 -0
- package/dist/openapi_client/models/TeamsSurfaceConfig.d.ts +9 -0
- package/dist/openapi_client/models/TeamsSurfaceConfig.js +1 -0
- package/dist/openapi_client/models/{TeamsSurfaceConfigCreate.d.ts → TeamsSurfaceConfigInput.d.ts} +1 -1
- package/dist/openapi_client/models/TeamsSurfaceConfigInput.js +1 -0
- package/dist/openapi_client/models/TelegramCredentialsInput.d.ts +5 -0
- package/dist/openapi_client/models/TelegramCredentialsInput.js +1 -0
- package/dist/openapi_client/models/TelegramSurfaceConfig.d.ts +6 -0
- package/dist/openapi_client/models/TelegramSurfaceConfig.js +1 -0
- package/dist/openapi_client/models/TelegramSurfaceConfigInput.d.ts +6 -0
- package/dist/openapi_client/models/TelegramSurfaceConfigInput.js +1 -0
- package/dist/openapi_client/models/UpdateSurfaceRequest.d.ts +17 -5
- package/dist/openapi_client/models/WhatsAppCredentialsInput.d.ts +8 -0
- package/dist/openapi_client/models/WhatsAppCredentialsInput.js +1 -0
- package/dist/openapi_client/models/WhatsAppSurfaceConfig.d.ts +6 -0
- package/dist/openapi_client/models/WhatsAppSurfaceConfig.js +1 -0
- package/dist/openapi_client/models/WhatsAppSurfaceConfigInput.d.ts +6 -0
- package/dist/openapi_client/models/WhatsAppSurfaceConfigInput.js +1 -0
- package/dist/openapi_client/models/WorkflowCreateRequest.d.ts +5 -2
- package/dist/openapi_client/models/WorkflowGraphUpdateRequest.d.ts +5 -2
- package/dist/openapi_client/models/WorkflowUpdateRequest.d.ts +5 -2
- package/dist/openapi_client/services/AssistantSurfacesIngressService.d.ts +51 -0
- package/dist/openapi_client/services/AssistantSurfacesIngressService.js +111 -0
- package/dist/openapi_client/services/AssistantSurfacesService.d.ts +27 -6
- package/dist/openapi_client/services/AssistantSurfacesService.js +62 -7
- package/dist/openapi_client/services/AuthorizationService.d.ts +47 -0
- package/dist/openapi_client/services/AuthorizationService.js +100 -0
- package/dist/openapi_client/services/DesksService.d.ts +2 -2
- package/dist/openapi_client/services/DesksService.js +3 -3
- package/dist/openapi_client/services/WorkflowsService.d.ts +3 -3
- package/dist/openapi_client/services/WorkflowsService.js +1 -1
- package/dist/react/index.d.ts +16 -0
- package/dist/react/index.js +8 -0
- package/dist/react/useAddPodMember.d.ts +22 -0
- package/dist/react/useAddPodMember.js +51 -0
- package/dist/react/useAssistantController.js +82 -37
- package/dist/react/useAssistantRuntime.js +8 -4
- package/dist/react/useAssistantSession.js +44 -2
- package/dist/react/useConversationMessages.js +19 -2
- package/dist/react/useFile.d.ts +18 -0
- package/dist/react/useFile.js +58 -0
- package/dist/react/useFilePreview.d.ts +23 -0
- package/dist/react/useFilePreview.js +76 -0
- package/dist/react/useFileSearch.d.ts +26 -0
- package/dist/react/useFileSearch.js +64 -0
- package/dist/react/useFileTree.d.ts +21 -0
- package/dist/react/useFileTree.js +59 -0
- package/dist/react/useFiles.d.ts +29 -0
- package/dist/react/useFiles.js +90 -0
- package/dist/react/useRecords.js +8 -5
- package/dist/react/useRemovePodMember.d.ts +19 -0
- package/dist/react/useRemovePodMember.js +50 -0
- package/dist/react/useUpdatePodMemberRole.d.ts +20 -0
- package/dist/react/useUpdatePodMemberRole.js +50 -0
- package/dist/react/useWorkflowStart.d.ts +2 -2
- package/dist/record-display.d.ts +20 -0
- package/dist/record-display.js +78 -0
- package/dist/record-form.d.ts +4 -0
- package/dist/record-form.js +16 -0
- package/dist/types.d.ts +8 -1
- package/package.json +2 -1
- package/dist/openapi_client/models/EmailSurfaceConfigCreate.d.ts +0 -5
- package/dist/openapi_client/models/FlowInstallEntity.d.ts +0 -16
- package/dist/openapi_client/models/FlowStartType.d.ts +0 -6
- package/dist/openapi_client/models/FlowStartType.js +0 -11
- package/dist/openapi_client/models/FlowStart_Input.d.ts +0 -14
- package/dist/openapi_client/models/FlowStart_Output.d.ts +0 -14
- package/dist/openapi_client/models/WhatsAppSurfaceConfigCreate.d.ts +0 -5
- package/dist/openapi_client/services/PublicDesksService.d.ts +0 -10
- package/dist/openapi_client/services/PublicDesksService.js +0 -22
- /package/dist/openapi_client/models/{DataStoreFlowStart.js → AdminConsentInfoResponse.js} +0 -0
- /package/dist/openapi_client/models/{EmailSurfaceConfigCreate.js → DataStoreFlowStartInput.js} +0 -0
- /package/dist/openapi_client/models/{EventFlowStart.js → DataStoreFlowStartOutput.js} +0 -0
- /package/dist/openapi_client/models/{FlowInstallEntity.js → DataStoreWorkflowStartInput.js} +0 -0
- /package/dist/openapi_client/models/{FlowStart_Input.js → DataStoreWorkflowStartOutput.js} +0 -0
- /package/dist/openapi_client/models/{FlowStart_Output.js → EventFlowStartInput.js} +0 -0
- /package/dist/openapi_client/models/{ScheduledFlowStart.js → EventFlowStartOutput.js} +0 -0
- /package/dist/openapi_client/models/{SlackSurfaceConfigCreate.js → EventWorkflowStartInput.js} +0 -0
- /package/dist/openapi_client/models/{TeamsSurfaceConfigCreate.js → EventWorkflowStartOutput.js} +0 -0
- /package/dist/openapi_client/models/{WhatsAppSurfaceConfigCreate.js → FlowInstallResponse.js} +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { OpenAPI } from '../core/OpenAPI.js';
|
|
2
|
+
import { request as __request } from '../core/request.js';
|
|
3
|
+
export class AssistantSurfacesIngressService {
|
|
4
|
+
/**
|
|
5
|
+
* Teams Admin Consent Callback
|
|
6
|
+
* @param tenant
|
|
7
|
+
* @param adminConsent
|
|
8
|
+
* @param state
|
|
9
|
+
* @param error
|
|
10
|
+
* @param errorDescription
|
|
11
|
+
* @returns any Successful Response
|
|
12
|
+
* @throws ApiError
|
|
13
|
+
*/
|
|
14
|
+
static assistantSurfaceTeamsAdminConsentCallback(tenant, adminConsent, state, error, errorDescription) {
|
|
15
|
+
return __request(OpenAPI, {
|
|
16
|
+
method: 'GET',
|
|
17
|
+
url: '/surfaces/teams/admin-consent/callback',
|
|
18
|
+
query: {
|
|
19
|
+
'tenant': tenant,
|
|
20
|
+
'admin_consent': adminConsent,
|
|
21
|
+
'state': state,
|
|
22
|
+
'error': error,
|
|
23
|
+
'error_description': errorDescription,
|
|
24
|
+
},
|
|
25
|
+
errors: {
|
|
26
|
+
422: `Validation Error`,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Handle per-surface webhook verification
|
|
32
|
+
* @param surfaceId
|
|
33
|
+
* @returns any Successful Response
|
|
34
|
+
* @throws ApiError
|
|
35
|
+
*/
|
|
36
|
+
static surfaceWebhookHandleSurfaceVerify(surfaceId) {
|
|
37
|
+
return __request(OpenAPI, {
|
|
38
|
+
method: 'GET',
|
|
39
|
+
url: '/surfaces/webhooks/surface/{surface_id}',
|
|
40
|
+
path: {
|
|
41
|
+
'surface_id': surfaceId,
|
|
42
|
+
},
|
|
43
|
+
errors: {
|
|
44
|
+
422: `Validation Error`,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Handle per-surface webhook
|
|
50
|
+
* Handle webhooks directed at a specific surface.
|
|
51
|
+
*
|
|
52
|
+
* Per-surface webhooks (e.g. /surfaces/webhooks/surface/{uuid}) are used
|
|
53
|
+
* when users provide their own bot credentials (USER_PROVIDED credential mode).
|
|
54
|
+
* @param surfaceId
|
|
55
|
+
* @returns any Successful Response
|
|
56
|
+
* @throws ApiError
|
|
57
|
+
*/
|
|
58
|
+
static surfaceWebhookHandleSurface(surfaceId) {
|
|
59
|
+
return __request(OpenAPI, {
|
|
60
|
+
method: 'POST',
|
|
61
|
+
url: '/surfaces/webhooks/surface/{surface_id}',
|
|
62
|
+
path: {
|
|
63
|
+
'surface_id': surfaceId,
|
|
64
|
+
},
|
|
65
|
+
errors: {
|
|
66
|
+
422: `Validation Error`,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Verify surface webhook using the platform callback URL
|
|
72
|
+
* Webhook verification endpoint for platforms that require it.
|
|
73
|
+
* @param platform
|
|
74
|
+
* @returns any Successful Response
|
|
75
|
+
* @throws ApiError
|
|
76
|
+
*/
|
|
77
|
+
static surfaceWebhookVerify(platform) {
|
|
78
|
+
return __request(OpenAPI, {
|
|
79
|
+
method: 'GET',
|
|
80
|
+
url: '/surfaces/webhooks/{platform}',
|
|
81
|
+
path: {
|
|
82
|
+
'platform': platform,
|
|
83
|
+
},
|
|
84
|
+
errors: {
|
|
85
|
+
422: `Validation Error`,
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Handle platform-level surface webhook
|
|
91
|
+
* Handle webhooks from platform-level native integration URLs.
|
|
92
|
+
*
|
|
93
|
+
* Platform webhooks (e.g. /surfaces/webhooks/slack) are used when
|
|
94
|
+
* Lemma's own app handles the integration (NATIVE credential mode).
|
|
95
|
+
* @param platform
|
|
96
|
+
* @returns any Successful Response
|
|
97
|
+
* @throws ApiError
|
|
98
|
+
*/
|
|
99
|
+
static surfaceWebhookHandlePlatform(platform) {
|
|
100
|
+
return __request(OpenAPI, {
|
|
101
|
+
method: 'POST',
|
|
102
|
+
url: '/surfaces/webhooks/{platform}',
|
|
103
|
+
path: {
|
|
104
|
+
'platform': platform,
|
|
105
|
+
},
|
|
106
|
+
errors: {
|
|
107
|
+
422: `Validation Error`,
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import type { AdminConsentInfoResponse } from '../models/AdminConsentInfoResponse.js';
|
|
1
2
|
import type { AssistantSurfaceListResponse } from '../models/AssistantSurfaceListResponse.js';
|
|
2
3
|
import type { CreateSurfaceRequest } from '../models/CreateSurfaceRequest.js';
|
|
4
|
+
import type { SurfacePlatformSetupGuideResponse } from '../models/SurfacePlatformSetupGuideResponse.js';
|
|
3
5
|
import type { ToggleSurfaceRequest } from '../models/ToggleSurfaceRequest.js';
|
|
4
6
|
import type { UpdateSurfaceRequest } from '../models/UpdateSurfaceRequest.js';
|
|
5
7
|
import type { CancelablePromise } from '../core/CancelablePromise.js';
|
|
6
8
|
export declare class AssistantSurfacesService {
|
|
7
9
|
/**
|
|
8
10
|
* List Surfaces
|
|
9
|
-
* List configured surfaces in a pod.
|
|
10
11
|
* @param podId
|
|
11
12
|
* @param limit
|
|
12
13
|
* @param pageToken
|
|
@@ -16,16 +17,22 @@ export declare class AssistantSurfacesService {
|
|
|
16
17
|
static assistantSurfaceList(podId: string, limit?: number, pageToken?: (string | null)): CancelablePromise<AssistantSurfaceListResponse>;
|
|
17
18
|
/**
|
|
18
19
|
* Create Surface
|
|
19
|
-
* Create a new surface for an assistant.
|
|
20
20
|
* @param podId
|
|
21
21
|
* @param requestBody
|
|
22
22
|
* @returns any Successful Response
|
|
23
23
|
* @throws ApiError
|
|
24
24
|
*/
|
|
25
25
|
static assistantSurfaceCreate(podId: string, requestBody: CreateSurfaceRequest): CancelablePromise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* Get Surface Platform Checklist
|
|
28
|
+
* @param podId
|
|
29
|
+
* @param platform
|
|
30
|
+
* @returns SurfacePlatformSetupGuideResponse Successful Response
|
|
31
|
+
* @throws ApiError
|
|
32
|
+
*/
|
|
33
|
+
static assistantSurfacePlatformChecklist(podId: string, platform: string): CancelablePromise<SurfacePlatformSetupGuideResponse>;
|
|
26
34
|
/**
|
|
27
35
|
* Get Surface
|
|
28
|
-
* Get a specific surface configuration.
|
|
29
36
|
* @param podId
|
|
30
37
|
* @param surfaceId
|
|
31
38
|
* @returns any Successful Response
|
|
@@ -34,17 +41,23 @@ export declare class AssistantSurfacesService {
|
|
|
34
41
|
static assistantSurfaceGet(podId: string, surfaceId: string): CancelablePromise<any>;
|
|
35
42
|
/**
|
|
36
43
|
* Update Surface
|
|
37
|
-
* Update a surface configuration.
|
|
38
44
|
* @param podId
|
|
39
45
|
* @param surfaceId
|
|
40
46
|
* @param requestBody
|
|
41
47
|
* @returns any Successful Response
|
|
42
48
|
* @throws ApiError
|
|
43
49
|
*/
|
|
44
|
-
static
|
|
50
|
+
static assistantSurfaceUpdate(podId: string, surfaceId: string, requestBody: UpdateSurfaceRequest): CancelablePromise<any>;
|
|
51
|
+
/**
|
|
52
|
+
* Get Admin Consent Info
|
|
53
|
+
* @param podId
|
|
54
|
+
* @param surfaceId
|
|
55
|
+
* @returns AdminConsentInfoResponse Successful Response
|
|
56
|
+
* @throws ApiError
|
|
57
|
+
*/
|
|
58
|
+
static assistantSurfaceAdminConsentInfo(podId: string, surfaceId: string): CancelablePromise<AdminConsentInfoResponse>;
|
|
45
59
|
/**
|
|
46
60
|
* Toggle Surface
|
|
47
|
-
* Toggle a surface active state.
|
|
48
61
|
* @param podId
|
|
49
62
|
* @param surfaceId
|
|
50
63
|
* @param requestBody
|
|
@@ -52,4 +65,12 @@ export declare class AssistantSurfacesService {
|
|
|
52
65
|
* @throws ApiError
|
|
53
66
|
*/
|
|
54
67
|
static assistantSurfaceToggle(podId: string, surfaceId: string, requestBody: ToggleSurfaceRequest): CancelablePromise<any>;
|
|
68
|
+
/**
|
|
69
|
+
* Get Webhook Url
|
|
70
|
+
* @param podId
|
|
71
|
+
* @param surfaceId
|
|
72
|
+
* @returns any Successful Response
|
|
73
|
+
* @throws ApiError
|
|
74
|
+
*/
|
|
75
|
+
static assistantSurfaceWebhookUrl(podId: string, surfaceId: string): CancelablePromise<any>;
|
|
55
76
|
}
|
|
@@ -3,7 +3,6 @@ import { request as __request } from '../core/request.js';
|
|
|
3
3
|
export class AssistantSurfacesService {
|
|
4
4
|
/**
|
|
5
5
|
* List Surfaces
|
|
6
|
-
* List configured surfaces in a pod.
|
|
7
6
|
* @param podId
|
|
8
7
|
* @param limit
|
|
9
8
|
* @param pageToken
|
|
@@ -28,7 +27,6 @@ export class AssistantSurfacesService {
|
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
29
|
* Create Surface
|
|
31
|
-
* Create a new surface for an assistant.
|
|
32
30
|
* @param podId
|
|
33
31
|
* @param requestBody
|
|
34
32
|
* @returns any Successful Response
|
|
@@ -48,9 +46,28 @@ export class AssistantSurfacesService {
|
|
|
48
46
|
},
|
|
49
47
|
});
|
|
50
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Get Surface Platform Checklist
|
|
51
|
+
* @param podId
|
|
52
|
+
* @param platform
|
|
53
|
+
* @returns SurfacePlatformSetupGuideResponse Successful Response
|
|
54
|
+
* @throws ApiError
|
|
55
|
+
*/
|
|
56
|
+
static assistantSurfacePlatformChecklist(podId, platform) {
|
|
57
|
+
return __request(OpenAPI, {
|
|
58
|
+
method: 'GET',
|
|
59
|
+
url: '/pods/{pod_id}/surfaces/platforms/{platform}/checklist',
|
|
60
|
+
path: {
|
|
61
|
+
'pod_id': podId,
|
|
62
|
+
'platform': platform,
|
|
63
|
+
},
|
|
64
|
+
errors: {
|
|
65
|
+
422: `Validation Error`,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
}
|
|
51
69
|
/**
|
|
52
70
|
* Get Surface
|
|
53
|
-
* Get a specific surface configuration.
|
|
54
71
|
* @param podId
|
|
55
72
|
* @param surfaceId
|
|
56
73
|
* @returns any Successful Response
|
|
@@ -71,17 +88,16 @@ export class AssistantSurfacesService {
|
|
|
71
88
|
}
|
|
72
89
|
/**
|
|
73
90
|
* Update Surface
|
|
74
|
-
* Update a surface configuration.
|
|
75
91
|
* @param podId
|
|
76
92
|
* @param surfaceId
|
|
77
93
|
* @param requestBody
|
|
78
94
|
* @returns any Successful Response
|
|
79
95
|
* @throws ApiError
|
|
80
96
|
*/
|
|
81
|
-
static
|
|
97
|
+
static assistantSurfaceUpdate(podId, surfaceId, requestBody) {
|
|
82
98
|
return __request(OpenAPI, {
|
|
83
99
|
method: 'PATCH',
|
|
84
|
-
url: '/pods/{pod_id}/surfaces/{surface_id}
|
|
100
|
+
url: '/pods/{pod_id}/surfaces/{surface_id}',
|
|
85
101
|
path: {
|
|
86
102
|
'pod_id': podId,
|
|
87
103
|
'surface_id': surfaceId,
|
|
@@ -93,9 +109,28 @@ export class AssistantSurfacesService {
|
|
|
93
109
|
},
|
|
94
110
|
});
|
|
95
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Get Admin Consent Info
|
|
114
|
+
* @param podId
|
|
115
|
+
* @param surfaceId
|
|
116
|
+
* @returns AdminConsentInfoResponse Successful Response
|
|
117
|
+
* @throws ApiError
|
|
118
|
+
*/
|
|
119
|
+
static assistantSurfaceAdminConsentInfo(podId, surfaceId) {
|
|
120
|
+
return __request(OpenAPI, {
|
|
121
|
+
method: 'GET',
|
|
122
|
+
url: '/pods/{pod_id}/surfaces/{surface_id}/admin-consent',
|
|
123
|
+
path: {
|
|
124
|
+
'pod_id': podId,
|
|
125
|
+
'surface_id': surfaceId,
|
|
126
|
+
},
|
|
127
|
+
errors: {
|
|
128
|
+
422: `Validation Error`,
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
}
|
|
96
132
|
/**
|
|
97
133
|
* Toggle Surface
|
|
98
|
-
* Toggle a surface active state.
|
|
99
134
|
* @param podId
|
|
100
135
|
* @param surfaceId
|
|
101
136
|
* @param requestBody
|
|
@@ -117,4 +152,24 @@ export class AssistantSurfacesService {
|
|
|
117
152
|
},
|
|
118
153
|
});
|
|
119
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Get Webhook Url
|
|
157
|
+
* @param podId
|
|
158
|
+
* @param surfaceId
|
|
159
|
+
* @returns any Successful Response
|
|
160
|
+
* @throws ApiError
|
|
161
|
+
*/
|
|
162
|
+
static assistantSurfaceWebhookUrl(podId, surfaceId) {
|
|
163
|
+
return __request(OpenAPI, {
|
|
164
|
+
method: 'GET',
|
|
165
|
+
url: '/pods/{pod_id}/surfaces/{surface_id}/webhook-url',
|
|
166
|
+
path: {
|
|
167
|
+
'pod_id': podId,
|
|
168
|
+
'surface_id': surfaceId,
|
|
169
|
+
},
|
|
170
|
+
errors: {
|
|
171
|
+
422: `Validation Error`,
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
}
|
|
120
175
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import type { GrantPermissionRequest } from '../models/GrantPermissionRequest.js';
|
|
1
2
|
import type { PodPermissionsResponse } from '../models/PodPermissionsResponse.js';
|
|
3
|
+
import type { ResourcePermissionListResponse } from '../models/ResourcePermissionListResponse.js';
|
|
4
|
+
import type { ResourcePermissionResponse } from '../models/ResourcePermissionResponse.js';
|
|
5
|
+
import type { SetVisibilityRequest } from '../models/SetVisibilityRequest.js';
|
|
2
6
|
import type { CancelablePromise } from '../core/CancelablePromise.js';
|
|
3
7
|
export declare class AuthorizationService {
|
|
4
8
|
/**
|
|
@@ -8,4 +12,47 @@ export declare class AuthorizationService {
|
|
|
8
12
|
* @throws ApiError
|
|
9
13
|
*/
|
|
10
14
|
static podPermissionsMe(podId: string): CancelablePromise<PodPermissionsResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* List Resource Permissions
|
|
17
|
+
* List all ACL entries for a resource. Requires POD_ADMIN or being the resource creator.
|
|
18
|
+
* @param podId
|
|
19
|
+
* @param resourceType
|
|
20
|
+
* @param resourceId
|
|
21
|
+
* @returns ResourcePermissionListResponse Successful Response
|
|
22
|
+
* @throws ApiError
|
|
23
|
+
*/
|
|
24
|
+
static resourcePermissionsList(podId: string, resourceType: string, resourceId: string): CancelablePromise<ResourcePermissionListResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Grant Resource Permission
|
|
27
|
+
* Add an ACL entry granting a user or role access to a resource.
|
|
28
|
+
* @param podId
|
|
29
|
+
* @param resourceType
|
|
30
|
+
* @param resourceId
|
|
31
|
+
* @param requestBody
|
|
32
|
+
* @returns ResourcePermissionResponse Successful Response
|
|
33
|
+
* @throws ApiError
|
|
34
|
+
*/
|
|
35
|
+
static resourcePermissionsGrant(podId: string, resourceType: string, resourceId: string, requestBody: GrantPermissionRequest): CancelablePromise<ResourcePermissionResponse>;
|
|
36
|
+
/**
|
|
37
|
+
* Revoke Resource Permission
|
|
38
|
+
* Remove an ACL entry for a resource.
|
|
39
|
+
* @param podId
|
|
40
|
+
* @param resourceType
|
|
41
|
+
* @param resourceId
|
|
42
|
+
* @param permissionId
|
|
43
|
+
* @returns void
|
|
44
|
+
* @throws ApiError
|
|
45
|
+
*/
|
|
46
|
+
static resourcePermissionsRevoke(podId: string, resourceType: string, resourceId: string, permissionId: string): CancelablePromise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Set Resource Visibility
|
|
49
|
+
* Update visibility for a resource (OWNER | RESTRICTED | POD). Requires POD_ADMIN or being the resource creator.
|
|
50
|
+
* @param podId
|
|
51
|
+
* @param resourceType
|
|
52
|
+
* @param resourceId
|
|
53
|
+
* @param requestBody
|
|
54
|
+
* @returns void
|
|
55
|
+
* @throws ApiError
|
|
56
|
+
*/
|
|
57
|
+
static resourceVisibilitySet(podId: string, resourceType: string, resourceId: string, requestBody: SetVisibilityRequest): CancelablePromise<void>;
|
|
11
58
|
}
|
|
@@ -19,4 +19,104 @@ export class AuthorizationService {
|
|
|
19
19
|
},
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* List Resource Permissions
|
|
24
|
+
* List all ACL entries for a resource. Requires POD_ADMIN or being the resource creator.
|
|
25
|
+
* @param podId
|
|
26
|
+
* @param resourceType
|
|
27
|
+
* @param resourceId
|
|
28
|
+
* @returns ResourcePermissionListResponse Successful Response
|
|
29
|
+
* @throws ApiError
|
|
30
|
+
*/
|
|
31
|
+
static resourcePermissionsList(podId, resourceType, resourceId) {
|
|
32
|
+
return __request(OpenAPI, {
|
|
33
|
+
method: 'GET',
|
|
34
|
+
url: '/pods/{pod_id}/resources/{resource_type}/{resource_id}/permissions',
|
|
35
|
+
path: {
|
|
36
|
+
'pod_id': podId,
|
|
37
|
+
'resource_type': resourceType,
|
|
38
|
+
'resource_id': resourceId,
|
|
39
|
+
},
|
|
40
|
+
errors: {
|
|
41
|
+
422: `Validation Error`,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Grant Resource Permission
|
|
47
|
+
* Add an ACL entry granting a user or role access to a resource.
|
|
48
|
+
* @param podId
|
|
49
|
+
* @param resourceType
|
|
50
|
+
* @param resourceId
|
|
51
|
+
* @param requestBody
|
|
52
|
+
* @returns ResourcePermissionResponse Successful Response
|
|
53
|
+
* @throws ApiError
|
|
54
|
+
*/
|
|
55
|
+
static resourcePermissionsGrant(podId, resourceType, resourceId, requestBody) {
|
|
56
|
+
return __request(OpenAPI, {
|
|
57
|
+
method: 'POST',
|
|
58
|
+
url: '/pods/{pod_id}/resources/{resource_type}/{resource_id}/permissions',
|
|
59
|
+
path: {
|
|
60
|
+
'pod_id': podId,
|
|
61
|
+
'resource_type': resourceType,
|
|
62
|
+
'resource_id': resourceId,
|
|
63
|
+
},
|
|
64
|
+
body: requestBody,
|
|
65
|
+
mediaType: 'application/json',
|
|
66
|
+
errors: {
|
|
67
|
+
422: `Validation Error`,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Revoke Resource Permission
|
|
73
|
+
* Remove an ACL entry for a resource.
|
|
74
|
+
* @param podId
|
|
75
|
+
* @param resourceType
|
|
76
|
+
* @param resourceId
|
|
77
|
+
* @param permissionId
|
|
78
|
+
* @returns void
|
|
79
|
+
* @throws ApiError
|
|
80
|
+
*/
|
|
81
|
+
static resourcePermissionsRevoke(podId, resourceType, resourceId, permissionId) {
|
|
82
|
+
return __request(OpenAPI, {
|
|
83
|
+
method: 'DELETE',
|
|
84
|
+
url: '/pods/{pod_id}/resources/{resource_type}/{resource_id}/permissions/{permission_id}',
|
|
85
|
+
path: {
|
|
86
|
+
'pod_id': podId,
|
|
87
|
+
'resource_type': resourceType,
|
|
88
|
+
'resource_id': resourceId,
|
|
89
|
+
'permission_id': permissionId,
|
|
90
|
+
},
|
|
91
|
+
errors: {
|
|
92
|
+
422: `Validation Error`,
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Set Resource Visibility
|
|
98
|
+
* Update visibility for a resource (OWNER | RESTRICTED | POD). Requires POD_ADMIN or being the resource creator.
|
|
99
|
+
* @param podId
|
|
100
|
+
* @param resourceType
|
|
101
|
+
* @param resourceId
|
|
102
|
+
* @param requestBody
|
|
103
|
+
* @returns void
|
|
104
|
+
* @throws ApiError
|
|
105
|
+
*/
|
|
106
|
+
static resourceVisibilitySet(podId, resourceType, resourceId, requestBody) {
|
|
107
|
+
return __request(OpenAPI, {
|
|
108
|
+
method: 'PATCH',
|
|
109
|
+
url: '/pods/{pod_id}/resources/{resource_type}/{resource_id}/visibility',
|
|
110
|
+
path: {
|
|
111
|
+
'pod_id': podId,
|
|
112
|
+
'resource_type': resourceType,
|
|
113
|
+
'resource_id': resourceId,
|
|
114
|
+
},
|
|
115
|
+
body: requestBody,
|
|
116
|
+
mediaType: 'application/json',
|
|
117
|
+
errors: {
|
|
118
|
+
422: `Validation Error`,
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
}
|
|
22
122
|
}
|
|
@@ -59,13 +59,13 @@ export declare class DesksService {
|
|
|
59
59
|
*/
|
|
60
60
|
static deskBundleUpload(podId: string, deskName: string, formData?: DeskBundleUploadRequest): CancelablePromise<DeskBundleUploadResponse>;
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
62
|
+
* Download Desk Dist Archive
|
|
63
63
|
* @param podId
|
|
64
64
|
* @param deskName
|
|
65
65
|
* @returns any Successful Response
|
|
66
66
|
* @throws ApiError
|
|
67
67
|
*/
|
|
68
|
-
static
|
|
68
|
+
static deskDistArchiveGet(podId: string, deskName: string): CancelablePromise<any>;
|
|
69
69
|
/**
|
|
70
70
|
* Download Desk Source Archive
|
|
71
71
|
* @param podId
|
|
@@ -133,16 +133,16 @@ export class DesksService {
|
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
136
|
-
*
|
|
136
|
+
* Download Desk Dist Archive
|
|
137
137
|
* @param podId
|
|
138
138
|
* @param deskName
|
|
139
139
|
* @returns any Successful Response
|
|
140
140
|
* @throws ApiError
|
|
141
141
|
*/
|
|
142
|
-
static
|
|
142
|
+
static deskDistArchiveGet(podId, deskName) {
|
|
143
143
|
return __request(OpenAPI, {
|
|
144
144
|
method: 'GET',
|
|
145
|
-
url: '/pods/{pod_id}/desks/{desk_name}/
|
|
145
|
+
url: '/pods/{pod_id}/desks/{desk_name}/dist/archive',
|
|
146
146
|
path: {
|
|
147
147
|
'pod_id': podId,
|
|
148
148
|
'desk_name': deskName,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FlowInstallResponse } from '../models/FlowInstallResponse.js';
|
|
2
2
|
import type { FlowResponse } from '../models/FlowResponse.js';
|
|
3
3
|
import type { FlowRunEntity } from '../models/FlowRunEntity.js';
|
|
4
4
|
import type { WorkflowCreateRequest } from '../models/WorkflowCreateRequest.js';
|
|
@@ -111,10 +111,10 @@ export declare class WorkflowsService {
|
|
|
111
111
|
* @param podId
|
|
112
112
|
* @param workflowName
|
|
113
113
|
* @param requestBody
|
|
114
|
-
* @returns
|
|
114
|
+
* @returns FlowInstallResponse Successful Response
|
|
115
115
|
* @throws ApiError
|
|
116
116
|
*/
|
|
117
|
-
static workflowInstallCreate(podId: string, workflowName: string, requestBody: WorkflowInstallRequest): CancelablePromise<
|
|
117
|
+
static workflowInstallCreate(podId: string, workflowName: string, requestBody: WorkflowInstallRequest): CancelablePromise<FlowInstallResponse>;
|
|
118
118
|
/**
|
|
119
119
|
* Uninstall Workflow
|
|
120
120
|
* Remove a previously created workflow installation binding.
|
|
@@ -237,7 +237,7 @@ export class WorkflowsService {
|
|
|
237
237
|
* @param podId
|
|
238
238
|
* @param workflowName
|
|
239
239
|
* @param requestBody
|
|
240
|
-
* @returns
|
|
240
|
+
* @returns FlowInstallResponse Successful Response
|
|
241
241
|
* @throws ApiError
|
|
242
242
|
*/
|
|
243
243
|
static workflowInstallCreate(podId, workflowName, requestBody) {
|
package/dist/react/index.d.ts
CHANGED
|
@@ -22,12 +22,28 @@ export { useAssistantRuntime } from "./useAssistantRuntime.js";
|
|
|
22
22
|
export type { UseAssistantRuntimeOptions, UseAssistantRuntimeResult, } from "./useAssistantRuntime.js";
|
|
23
23
|
export { useMembers } from "./useMembers.js";
|
|
24
24
|
export type { UseMembersOptions, UseMembersResult } from "./useMembers.js";
|
|
25
|
+
export { useAddPodMember } from "./useAddPodMember.js";
|
|
26
|
+
export type { AddPodMemberInput, UseAddPodMemberOptions, UseAddPodMemberResult } from "./useAddPodMember.js";
|
|
27
|
+
export { useUpdatePodMemberRole } from "./useUpdatePodMemberRole.js";
|
|
28
|
+
export type { UseUpdatePodMemberRoleOptions, UseUpdatePodMemberRoleResult, } from "./useUpdatePodMemberRole.js";
|
|
29
|
+
export { useRemovePodMember } from "./useRemovePodMember.js";
|
|
30
|
+
export type { UseRemovePodMemberOptions, UseRemovePodMemberResult, } from "./useRemovePodMember.js";
|
|
25
31
|
export { useOrganizationMembers } from "./useOrganizationMembers.js";
|
|
26
32
|
export type { UseOrganizationMembersOptions, UseOrganizationMembersResult, } from "./useOrganizationMembers.js";
|
|
27
33
|
export { useCurrentUser } from "./useCurrentUser.js";
|
|
28
34
|
export type { UseCurrentUserOptions, UseCurrentUserResult } from "./useCurrentUser.js";
|
|
29
35
|
export { usePodAccess } from "./usePodAccess.js";
|
|
30
36
|
export type { PodAccessStatus, UsePodAccessOptions, UsePodAccessResult, } from "./usePodAccess.js";
|
|
37
|
+
export { useFiles } from "./useFiles.js";
|
|
38
|
+
export type { UseFilesOptions, UseFilesResult } from "./useFiles.js";
|
|
39
|
+
export { useFile } from "./useFile.js";
|
|
40
|
+
export type { UseFileOptions, UseFileResult } from "./useFile.js";
|
|
41
|
+
export { useFileSearch } from "./useFileSearch.js";
|
|
42
|
+
export type { UseFileSearchOptions, UseFileSearchResult } from "./useFileSearch.js";
|
|
43
|
+
export { useFileTree } from "./useFileTree.js";
|
|
44
|
+
export type { UseFileTreeOptions, UseFileTreeResult } from "./useFileTree.js";
|
|
45
|
+
export { useFilePreview } from "./useFilePreview.js";
|
|
46
|
+
export type { FilePreviewMode, UseFilePreviewOptions, UseFilePreviewResult, } from "./useFilePreview.js";
|
|
31
47
|
export { useTables } from "./useTables.js";
|
|
32
48
|
export type { UseTablesOptions, UseTablesResult } from "./useTables.js";
|
|
33
49
|
export { useTable } from "./useTable.js";
|
package/dist/react/index.js
CHANGED
|
@@ -10,9 +10,17 @@ export { useAgentInputSchema } from "./useAgentInputSchema.js";
|
|
|
10
10
|
export { useAssistantSession } from "./useAssistantSession.js";
|
|
11
11
|
export { useAssistantRuntime } from "./useAssistantRuntime.js";
|
|
12
12
|
export { useMembers } from "./useMembers.js";
|
|
13
|
+
export { useAddPodMember } from "./useAddPodMember.js";
|
|
14
|
+
export { useUpdatePodMemberRole } from "./useUpdatePodMemberRole.js";
|
|
15
|
+
export { useRemovePodMember } from "./useRemovePodMember.js";
|
|
13
16
|
export { useOrganizationMembers } from "./useOrganizationMembers.js";
|
|
14
17
|
export { useCurrentUser } from "./useCurrentUser.js";
|
|
15
18
|
export { usePodAccess } from "./usePodAccess.js";
|
|
19
|
+
export { useFiles } from "./useFiles.js";
|
|
20
|
+
export { useFile } from "./useFile.js";
|
|
21
|
+
export { useFileSearch } from "./useFileSearch.js";
|
|
22
|
+
export { useFileTree } from "./useFileTree.js";
|
|
23
|
+
export { useFilePreview } from "./useFilePreview.js";
|
|
16
24
|
export { useTables } from "./useTables.js";
|
|
17
25
|
export { useTable } from "./useTable.js";
|
|
18
26
|
export { useRecords } from "./useRecords.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { LemmaClient } from "../client.js";
|
|
2
|
+
import { PodRole, type PodMember } from "../types.js";
|
|
3
|
+
export interface AddPodMemberInput {
|
|
4
|
+
organizationMemberId: string;
|
|
5
|
+
role?: PodRole;
|
|
6
|
+
}
|
|
7
|
+
export interface UseAddPodMemberOptions {
|
|
8
|
+
client: LemmaClient;
|
|
9
|
+
podId?: string;
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
defaultRole?: PodRole;
|
|
12
|
+
onSuccess?: (member: PodMember) => void;
|
|
13
|
+
onError?: (error: unknown) => void;
|
|
14
|
+
}
|
|
15
|
+
export interface UseAddPodMemberResult {
|
|
16
|
+
addedMember: PodMember | null;
|
|
17
|
+
isSubmitting: boolean;
|
|
18
|
+
error: Error | null;
|
|
19
|
+
add: (input: AddPodMemberInput) => Promise<PodMember | null>;
|
|
20
|
+
reset: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function useAddPodMember({ client, podId, enabled, defaultRole, onSuccess, onError, }: UseAddPodMemberOptions): UseAddPodMemberResult;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { PodRole } from "../types.js";
|
|
3
|
+
import { normalizeError, resolvePodId } from "./utils.js";
|
|
4
|
+
export function useAddPodMember({ client, podId, enabled = true, defaultRole = PodRole.POD_USER, onSuccess, onError, }) {
|
|
5
|
+
const [addedMember, setAddedMember] = useState(null);
|
|
6
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
7
|
+
const [error, setError] = useState(null);
|
|
8
|
+
const onSuccessRef = useRef(onSuccess);
|
|
9
|
+
const onErrorRef = useRef(onError);
|
|
10
|
+
useEffect(() => { onSuccessRef.current = onSuccess; }, [onSuccess]);
|
|
11
|
+
useEffect(() => { onErrorRef.current = onError; }, [onError]);
|
|
12
|
+
const add = useCallback(async (input) => {
|
|
13
|
+
const organizationMemberId = input.organizationMemberId.trim();
|
|
14
|
+
if (!enabled || organizationMemberId.length === 0) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
setIsSubmitting(true);
|
|
18
|
+
setError(null);
|
|
19
|
+
try {
|
|
20
|
+
const resolvedPodId = resolvePodId(client, podId);
|
|
21
|
+
const nextMember = await client.podMembers.add(resolvedPodId, {
|
|
22
|
+
organization_member_id: organizationMemberId,
|
|
23
|
+
role: input.role ?? defaultRole,
|
|
24
|
+
});
|
|
25
|
+
setAddedMember(nextMember);
|
|
26
|
+
onSuccessRef.current?.(nextMember);
|
|
27
|
+
return nextMember;
|
|
28
|
+
}
|
|
29
|
+
catch (mutationError) {
|
|
30
|
+
const normalized = normalizeError(mutationError, "Failed to add pod member.");
|
|
31
|
+
setError(normalized);
|
|
32
|
+
onErrorRef.current?.(mutationError);
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
finally {
|
|
36
|
+
setIsSubmitting(false);
|
|
37
|
+
}
|
|
38
|
+
}, [client, defaultRole, enabled, podId]);
|
|
39
|
+
const reset = useCallback(() => {
|
|
40
|
+
setAddedMember(null);
|
|
41
|
+
setError(null);
|
|
42
|
+
setIsSubmitting(false);
|
|
43
|
+
}, []);
|
|
44
|
+
return useMemo(() => ({
|
|
45
|
+
addedMember,
|
|
46
|
+
isSubmitting,
|
|
47
|
+
error,
|
|
48
|
+
add,
|
|
49
|
+
reset,
|
|
50
|
+
}), [add, addedMember, error, isSubmitting, reset]);
|
|
51
|
+
}
|