@streamoid/settings 0.16.1 → 0.17.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 +27 -2
- package/dist/index.d.ts +27 -2
- package/dist/index.js +33 -12
- package/dist/index.mjs +33 -12
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1094,6 +1094,16 @@ interface SettingsApiAdapter {
|
|
|
1094
1094
|
invitationId?: string;
|
|
1095
1095
|
}) => Promise<void>;
|
|
1096
1096
|
resendInvite: (invitationId: string) => Promise<void>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Change a pending invitation's role and access. They are granted when the
|
|
1099
|
+
* invite is accepted; the invite link and its expiry stay as they were.
|
|
1100
|
+
* Admin only. Omit it and pending invites stay read-only (cancel / resend).
|
|
1101
|
+
* Also needs `getServices`: without the workspace's services there is no
|
|
1102
|
+
* way to turn the app switches into `serviceIds`, so editing stays off.
|
|
1103
|
+
*/
|
|
1104
|
+
updateInvite?: (input: {
|
|
1105
|
+
invitationId: string;
|
|
1106
|
+
} & MemberPermissionsPayload) => Promise<void>;
|
|
1097
1107
|
/**
|
|
1098
1108
|
* @deprecated No longer called: `updateMemberRole` makes a member an admin by
|
|
1099
1109
|
* itself, and promoting first made that request fail. Kept so existing
|
|
@@ -1748,6 +1758,14 @@ declare function memberRoleUpdate(current: {
|
|
|
1748
1758
|
}, permissions: UserPermissions, services: ServiceItem[]): ({
|
|
1749
1759
|
userId: string;
|
|
1750
1760
|
} & MemberPermissionsPayload) | null;
|
|
1761
|
+
/**
|
|
1762
|
+
* The `updateInvite` request that saving a pending invite sends. Same shape as
|
|
1763
|
+
* an invite: an admin invite carries no app or store grants (admins hold every
|
|
1764
|
+
* app), a member invite carries exactly the apps switched on.
|
|
1765
|
+
*/
|
|
1766
|
+
declare function inviteUpdate(invitationId: string, permissions: UserPermissions, services: ServiceItem[]): {
|
|
1767
|
+
invitationId: string;
|
|
1768
|
+
} & MemberPermissionsPayload;
|
|
1751
1769
|
declare function TeamsContent({ embedded, onInviteOpen, onInviteOpenChange, onCanInviteChange, inviteRequested, onInviteRequestHandled, workspaceName, workspaceImageUrl, organizationName, hiddenApps, }?: {
|
|
1752
1770
|
embedded?: boolean;
|
|
1753
1771
|
onInviteOpen?: boolean;
|
|
@@ -2160,6 +2178,13 @@ interface InviteUpdateModalProps {
|
|
|
2160
2178
|
*/
|
|
2161
2179
|
hiddenApps?: readonly AppKey[];
|
|
2162
2180
|
allowSubmitWithoutChanges?: boolean;
|
|
2181
|
+
/**
|
|
2182
|
+
* Update mode: whose permissions are being edited. `"invite"` edits a
|
|
2183
|
+
* pending invitation — the dialog says so, its remove button cancels the
|
|
2184
|
+
* invite, and, like the invite form, a member must keep at least one app.
|
|
2185
|
+
* Defaults to `"member"`.
|
|
2186
|
+
*/
|
|
2187
|
+
subject?: "member" | "invite";
|
|
2163
2188
|
initialPermissions?: UserPermissions;
|
|
2164
2189
|
onClose: () => void;
|
|
2165
2190
|
onSave?: (permissions: UserPermissions) => void;
|
|
@@ -2216,7 +2241,7 @@ interface InviteUpdateModalProps {
|
|
|
2216
2241
|
*/
|
|
2217
2242
|
onInvite?: (permissions: UserPermissions, email: string, organizationStanding?: OrganizationStanding) => void;
|
|
2218
2243
|
}
|
|
2219
|
-
declare function InviteUpdateModal({ open, mode, userEmail, stores, hiddenApps, allowSubmitWithoutChanges, initialPermissions, onClose, onSave, onRemove, canRemove, showOrganizationStanding, organizationName, allowGuestStanding, initialOrganizationStanding, organizationDomain: _organizationDomain, allowAdminRole, onInvite, onInviteMany, }: InviteUpdateModalProps): react.JSX.Element | null;
|
|
2244
|
+
declare function InviteUpdateModal({ open, mode, userEmail, stores, hiddenApps, allowSubmitWithoutChanges, subject, initialPermissions, onClose, onSave, onRemove, canRemove, showOrganizationStanding, organizationName, allowGuestStanding, initialOrganizationStanding, organizationDomain: _organizationDomain, allowAdminRole, onInvite, onInviteMany, }: InviteUpdateModalProps): react.JSX.Element | null;
|
|
2220
2245
|
|
|
2221
2246
|
interface ExportDateModalProps {
|
|
2222
2247
|
title: string;
|
|
@@ -2714,4 +2739,4 @@ interface AppSettingsRowProps {
|
|
|
2714
2739
|
}
|
|
2715
2740
|
declare function AppSettingsRow({ title, description, summary, href, onClick, disabled, disabledReason, ariaLabel, trailing }: AppSettingsRowProps): react.JSX.Element;
|
|
2716
2741
|
|
|
2717
|
-
export { APP_KEYS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, InviteUpdateModal, type InvoicePdfResponse, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralTab, RemovePoolMemberModal, type RemovePoolMemberModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, belowUsageReason, canShowSharedCredits, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatCreditLimit, formatCredits, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, joinMembersWithLimits, lastUsedLabel, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, parseInviteEmails, pausedOwnCreditsText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolWorkspaceName, productsForCountry, readSettingsCaller, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sponsoredCreditsText, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
|
|
2742
|
+
export { APP_KEYS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, InviteUpdateModal, type InvoicePdfResponse, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralTab, RemovePoolMemberModal, type RemovePoolMemberModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, belowUsageReason, canShowSharedCredits, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatCreditLimit, formatCredits, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, inviteUpdate, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, joinMembersWithLimits, lastUsedLabel, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, parseInviteEmails, pausedOwnCreditsText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolWorkspaceName, productsForCountry, readSettingsCaller, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sponsoredCreditsText, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -1094,6 +1094,16 @@ interface SettingsApiAdapter {
|
|
|
1094
1094
|
invitationId?: string;
|
|
1095
1095
|
}) => Promise<void>;
|
|
1096
1096
|
resendInvite: (invitationId: string) => Promise<void>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Change a pending invitation's role and access. They are granted when the
|
|
1099
|
+
* invite is accepted; the invite link and its expiry stay as they were.
|
|
1100
|
+
* Admin only. Omit it and pending invites stay read-only (cancel / resend).
|
|
1101
|
+
* Also needs `getServices`: without the workspace's services there is no
|
|
1102
|
+
* way to turn the app switches into `serviceIds`, so editing stays off.
|
|
1103
|
+
*/
|
|
1104
|
+
updateInvite?: (input: {
|
|
1105
|
+
invitationId: string;
|
|
1106
|
+
} & MemberPermissionsPayload) => Promise<void>;
|
|
1097
1107
|
/**
|
|
1098
1108
|
* @deprecated No longer called: `updateMemberRole` makes a member an admin by
|
|
1099
1109
|
* itself, and promoting first made that request fail. Kept so existing
|
|
@@ -1748,6 +1758,14 @@ declare function memberRoleUpdate(current: {
|
|
|
1748
1758
|
}, permissions: UserPermissions, services: ServiceItem[]): ({
|
|
1749
1759
|
userId: string;
|
|
1750
1760
|
} & MemberPermissionsPayload) | null;
|
|
1761
|
+
/**
|
|
1762
|
+
* The `updateInvite` request that saving a pending invite sends. Same shape as
|
|
1763
|
+
* an invite: an admin invite carries no app or store grants (admins hold every
|
|
1764
|
+
* app), a member invite carries exactly the apps switched on.
|
|
1765
|
+
*/
|
|
1766
|
+
declare function inviteUpdate(invitationId: string, permissions: UserPermissions, services: ServiceItem[]): {
|
|
1767
|
+
invitationId: string;
|
|
1768
|
+
} & MemberPermissionsPayload;
|
|
1751
1769
|
declare function TeamsContent({ embedded, onInviteOpen, onInviteOpenChange, onCanInviteChange, inviteRequested, onInviteRequestHandled, workspaceName, workspaceImageUrl, organizationName, hiddenApps, }?: {
|
|
1752
1770
|
embedded?: boolean;
|
|
1753
1771
|
onInviteOpen?: boolean;
|
|
@@ -2160,6 +2178,13 @@ interface InviteUpdateModalProps {
|
|
|
2160
2178
|
*/
|
|
2161
2179
|
hiddenApps?: readonly AppKey[];
|
|
2162
2180
|
allowSubmitWithoutChanges?: boolean;
|
|
2181
|
+
/**
|
|
2182
|
+
* Update mode: whose permissions are being edited. `"invite"` edits a
|
|
2183
|
+
* pending invitation — the dialog says so, its remove button cancels the
|
|
2184
|
+
* invite, and, like the invite form, a member must keep at least one app.
|
|
2185
|
+
* Defaults to `"member"`.
|
|
2186
|
+
*/
|
|
2187
|
+
subject?: "member" | "invite";
|
|
2163
2188
|
initialPermissions?: UserPermissions;
|
|
2164
2189
|
onClose: () => void;
|
|
2165
2190
|
onSave?: (permissions: UserPermissions) => void;
|
|
@@ -2216,7 +2241,7 @@ interface InviteUpdateModalProps {
|
|
|
2216
2241
|
*/
|
|
2217
2242
|
onInvite?: (permissions: UserPermissions, email: string, organizationStanding?: OrganizationStanding) => void;
|
|
2218
2243
|
}
|
|
2219
|
-
declare function InviteUpdateModal({ open, mode, userEmail, stores, hiddenApps, allowSubmitWithoutChanges, initialPermissions, onClose, onSave, onRemove, canRemove, showOrganizationStanding, organizationName, allowGuestStanding, initialOrganizationStanding, organizationDomain: _organizationDomain, allowAdminRole, onInvite, onInviteMany, }: InviteUpdateModalProps): react.JSX.Element | null;
|
|
2244
|
+
declare function InviteUpdateModal({ open, mode, userEmail, stores, hiddenApps, allowSubmitWithoutChanges, subject, initialPermissions, onClose, onSave, onRemove, canRemove, showOrganizationStanding, organizationName, allowGuestStanding, initialOrganizationStanding, organizationDomain: _organizationDomain, allowAdminRole, onInvite, onInviteMany, }: InviteUpdateModalProps): react.JSX.Element | null;
|
|
2220
2245
|
|
|
2221
2246
|
interface ExportDateModalProps {
|
|
2222
2247
|
title: string;
|
|
@@ -2714,4 +2739,4 @@ interface AppSettingsRowProps {
|
|
|
2714
2739
|
}
|
|
2715
2740
|
declare function AppSettingsRow({ title, description, summary, href, onClick, disabled, disabledReason, ariaLabel, trailing }: AppSettingsRowProps): react.JSX.Element;
|
|
2716
2741
|
|
|
2717
|
-
export { APP_KEYS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, InviteUpdateModal, type InvoicePdfResponse, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralTab, RemovePoolMemberModal, type RemovePoolMemberModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, belowUsageReason, canShowSharedCredits, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatCreditLimit, formatCredits, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, joinMembersWithLimits, lastUsedLabel, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, parseInviteEmails, pausedOwnCreditsText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolWorkspaceName, productsForCountry, readSettingsCaller, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sponsoredCreditsText, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
|
|
2742
|
+
export { APP_KEYS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, InviteUpdateModal, type InvoicePdfResponse, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralTab, RemovePoolMemberModal, type RemovePoolMemberModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, belowUsageReason, canShowSharedCredits, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatCreditLimit, formatCredits, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, inviteUpdate, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, joinMembersWithLimits, lastUsedLabel, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, parseInviteEmails, pausedOwnCreditsText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolWorkspaceName, productsForCountry, readSettingsCaller, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sponsoredCreditsText, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
|
package/dist/index.js
CHANGED
|
@@ -108,6 +108,7 @@ __export(index_exports, {
|
|
|
108
108
|
formatPoolSplit: () => formatPoolSplit,
|
|
109
109
|
groupWorkspaceList: () => groupWorkspaceList,
|
|
110
110
|
hasPaidFeatures: () => hasPaidFeatures,
|
|
111
|
+
inviteUpdate: () => inviteUpdate,
|
|
111
112
|
isLimitBelowUsage: () => isLimitBelowUsage,
|
|
112
113
|
isPaidPlan: () => isPaidPlan,
|
|
113
114
|
isSponsoredEntitlement: () => isSponsoredEntitlement,
|
|
@@ -3291,6 +3292,7 @@ function InviteUpdateModal({
|
|
|
3291
3292
|
stores = [],
|
|
3292
3293
|
hiddenApps = [],
|
|
3293
3294
|
allowSubmitWithoutChanges = false,
|
|
3295
|
+
subject = "member",
|
|
3294
3296
|
initialPermissions,
|
|
3295
3297
|
onClose,
|
|
3296
3298
|
onSave,
|
|
@@ -3396,7 +3398,8 @@ function InviteUpdateModal({
|
|
|
3396
3398
|
const notLastShown = (key) => shownApps[shownApps.length - 1] !== key;
|
|
3397
3399
|
const appValue = (key) => role === "admin" || showsApp(key) ? appToggles[key] : false;
|
|
3398
3400
|
const grantsNoApp = role === "member" && shownApps.length > 0 && !shownApps.some((key) => appToggles[key]);
|
|
3399
|
-
const
|
|
3401
|
+
const editsInvite = !isInvite && subject === "invite";
|
|
3402
|
+
const isSubmitDisabled = isInvite ? !hasEmail || grantsNoApp || submitting : editsInvite ? !hasChanges || grantsNoApp : !(allowSubmitWithoutChanges || hasChanges);
|
|
3400
3403
|
function toggleStore(storeId) {
|
|
3401
3404
|
setSelectedStores((prev) => {
|
|
3402
3405
|
const next = new Set(prev);
|
|
@@ -3452,7 +3455,7 @@ function InviteUpdateModal({
|
|
|
3452
3455
|
fontWeight: 600,
|
|
3453
3456
|
lineHeight: T6.lhLg
|
|
3454
3457
|
},
|
|
3455
|
-
children: isInvite ? "Invite" : "Update user"
|
|
3458
|
+
children: isInvite ? "Invite" : editsInvite ? "Edit invitation" : "Update user"
|
|
3456
3459
|
}
|
|
3457
3460
|
),
|
|
3458
3461
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", "aria-label": "Close invite dialog", disabled: submitting, className: "shrink-0 cursor-pointer disabled:cursor-wait", onClick: requestClose, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons5.SiconClose, { className: "w-6 h-6", color: T6.primary }) })
|
|
@@ -4558,7 +4561,7 @@ function InviteUpdateModal({
|
|
|
4558
4561
|
!isInvite && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4559
4562
|
import_ui4.ScButton,
|
|
4560
4563
|
{
|
|
4561
|
-
text: "Remove user",
|
|
4564
|
+
text: editsInvite ? "Cancel invitation" : "Remove user",
|
|
4562
4565
|
variant: "error",
|
|
4563
4566
|
size: "md",
|
|
4564
4567
|
state: canRemove ? "default" : "disabled",
|
|
@@ -4568,7 +4571,7 @@ function InviteUpdateModal({
|
|
|
4568
4571
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4569
4572
|
import_ui4.ScButton,
|
|
4570
4573
|
{
|
|
4571
|
-
text: isInvite ? "Invite User" : allowSubmitWithoutChanges ? "Resend invite" : "Save changes",
|
|
4574
|
+
text: isInvite ? "Invite User" : !editsInvite && allowSubmitWithoutChanges ? "Resend invite" : "Save changes",
|
|
4572
4575
|
variant: "primary",
|
|
4573
4576
|
size: "md",
|
|
4574
4577
|
state: isSubmitDisabled ? "disabled" : "default",
|
|
@@ -4886,6 +4889,17 @@ function memberRoleUpdate(current, permissions, services) {
|
|
|
4886
4889
|
storeIds: permissions.catalogixStores || []
|
|
4887
4890
|
};
|
|
4888
4891
|
}
|
|
4892
|
+
function inviteUpdate(invitationId, permissions, services) {
|
|
4893
|
+
const isAdmin = permissions.role === "admin";
|
|
4894
|
+
return {
|
|
4895
|
+
invitationId,
|
|
4896
|
+
role: permissions.role,
|
|
4897
|
+
creditAccess: permissions.canUseCredits,
|
|
4898
|
+
inviteAccess: permissions.canInviteUser,
|
|
4899
|
+
serviceIds: isAdmin ? [] : permissionServiceIds(services, permissions),
|
|
4900
|
+
storeIds: isAdmin ? [] : permissions.catalogixStores || []
|
|
4901
|
+
};
|
|
4902
|
+
}
|
|
4889
4903
|
function uniqueNonEmpty(values) {
|
|
4890
4904
|
return Array.from(new Set(values.map((v) => v.trim()).filter(Boolean)));
|
|
4891
4905
|
}
|
|
@@ -5534,6 +5548,7 @@ function TeamsContent({
|
|
|
5534
5548
|
setModal({ open: false, mode: "invite" });
|
|
5535
5549
|
};
|
|
5536
5550
|
const currentMemberPermissions = modal.target?.permissions;
|
|
5551
|
+
const canEditInvites = highestRole === "admin" && api.updateInvite !== void 0 && allServices.length > 0;
|
|
5537
5552
|
const handleSave = async (permissions) => {
|
|
5538
5553
|
if (!modal.target) {
|
|
5539
5554
|
closeModal();
|
|
@@ -5544,16 +5559,22 @@ function TeamsContent({
|
|
|
5544
5559
|
closeModal();
|
|
5545
5560
|
return;
|
|
5546
5561
|
}
|
|
5547
|
-
if (modal.target.kind === "invite"
|
|
5562
|
+
if (modal.target.kind === "invite") {
|
|
5563
|
+
if (!modal.target.invitationId || !api.updateInvite) {
|
|
5564
|
+
closeModal();
|
|
5565
|
+
return;
|
|
5566
|
+
}
|
|
5548
5567
|
try {
|
|
5549
|
-
await api.
|
|
5550
|
-
|
|
5551
|
-
|
|
5568
|
+
await api.updateInvite(
|
|
5569
|
+
inviteUpdate(modal.target.invitationId, permissions, allServices)
|
|
5570
|
+
);
|
|
5571
|
+
toast.success("Invitation updated");
|
|
5552
5572
|
} catch (err) {
|
|
5553
|
-
|
|
5554
|
-
|
|
5573
|
+
toast.error(errorMessage(err, { method: "PUT" }));
|
|
5574
|
+
return;
|
|
5555
5575
|
}
|
|
5556
5576
|
closeModal();
|
|
5577
|
+
await fetchData();
|
|
5557
5578
|
return;
|
|
5558
5579
|
}
|
|
5559
5580
|
if (modal.target.kind !== "member" || !modal.target.userId) {
|
|
@@ -5813,7 +5834,7 @@ function TeamsContent({
|
|
|
5813
5834
|
{
|
|
5814
5835
|
member,
|
|
5815
5836
|
variant: activeTab,
|
|
5816
|
-
onClick: activeTab === "active" ? () => openUpdateModal(member) : void 0,
|
|
5837
|
+
onClick: activeTab === "active" || canEditInvites ? () => openUpdateModal(member) : void 0,
|
|
5817
5838
|
onCancelInvite: () => void handleCancelPendingInvite(member),
|
|
5818
5839
|
onResendInvite: () => void handleResendPendingInvite(member)
|
|
5819
5840
|
},
|
|
@@ -5831,7 +5852,7 @@ function TeamsContent({
|
|
|
5831
5852
|
userEmail: modal.target?.userEmail,
|
|
5832
5853
|
stores: allStores,
|
|
5833
5854
|
hiddenApps,
|
|
5834
|
-
|
|
5855
|
+
subject: modal.target?.kind === "invite" ? "invite" : "member",
|
|
5835
5856
|
initialPermissions: currentMemberPermissions,
|
|
5836
5857
|
onClose: closeModal,
|
|
5837
5858
|
onSave: handleSave,
|
package/dist/index.mjs
CHANGED
|
@@ -3176,6 +3176,7 @@ function InviteUpdateModal({
|
|
|
3176
3176
|
stores = [],
|
|
3177
3177
|
hiddenApps = [],
|
|
3178
3178
|
allowSubmitWithoutChanges = false,
|
|
3179
|
+
subject = "member",
|
|
3179
3180
|
initialPermissions,
|
|
3180
3181
|
onClose,
|
|
3181
3182
|
onSave,
|
|
@@ -3281,7 +3282,8 @@ function InviteUpdateModal({
|
|
|
3281
3282
|
const notLastShown = (key) => shownApps[shownApps.length - 1] !== key;
|
|
3282
3283
|
const appValue = (key) => role === "admin" || showsApp(key) ? appToggles[key] : false;
|
|
3283
3284
|
const grantsNoApp = role === "member" && shownApps.length > 0 && !shownApps.some((key) => appToggles[key]);
|
|
3284
|
-
const
|
|
3285
|
+
const editsInvite = !isInvite && subject === "invite";
|
|
3286
|
+
const isSubmitDisabled = isInvite ? !hasEmail || grantsNoApp || submitting : editsInvite ? !hasChanges || grantsNoApp : !(allowSubmitWithoutChanges || hasChanges);
|
|
3285
3287
|
function toggleStore(storeId) {
|
|
3286
3288
|
setSelectedStores((prev) => {
|
|
3287
3289
|
const next = new Set(prev);
|
|
@@ -3337,7 +3339,7 @@ function InviteUpdateModal({
|
|
|
3337
3339
|
fontWeight: 600,
|
|
3338
3340
|
lineHeight: T6.lhLg
|
|
3339
3341
|
},
|
|
3340
|
-
children: isInvite ? "Invite" : "Update user"
|
|
3342
|
+
children: isInvite ? "Invite" : editsInvite ? "Edit invitation" : "Update user"
|
|
3341
3343
|
}
|
|
3342
3344
|
),
|
|
3343
3345
|
/* @__PURE__ */ jsx14("button", { type: "button", "aria-label": "Close invite dialog", disabled: submitting, className: "shrink-0 cursor-pointer disabled:cursor-wait", onClick: requestClose, children: /* @__PURE__ */ jsx14(SiconClose2, { className: "w-6 h-6", color: T6.primary }) })
|
|
@@ -4443,7 +4445,7 @@ function InviteUpdateModal({
|
|
|
4443
4445
|
!isInvite && /* @__PURE__ */ jsx14(
|
|
4444
4446
|
ScButton3,
|
|
4445
4447
|
{
|
|
4446
|
-
text: "Remove user",
|
|
4448
|
+
text: editsInvite ? "Cancel invitation" : "Remove user",
|
|
4447
4449
|
variant: "error",
|
|
4448
4450
|
size: "md",
|
|
4449
4451
|
state: canRemove ? "default" : "disabled",
|
|
@@ -4453,7 +4455,7 @@ function InviteUpdateModal({
|
|
|
4453
4455
|
/* @__PURE__ */ jsx14(
|
|
4454
4456
|
ScButton3,
|
|
4455
4457
|
{
|
|
4456
|
-
text: isInvite ? "Invite User" : allowSubmitWithoutChanges ? "Resend invite" : "Save changes",
|
|
4458
|
+
text: isInvite ? "Invite User" : !editsInvite && allowSubmitWithoutChanges ? "Resend invite" : "Save changes",
|
|
4457
4459
|
variant: "primary",
|
|
4458
4460
|
size: "md",
|
|
4459
4461
|
state: isSubmitDisabled ? "disabled" : "default",
|
|
@@ -4771,6 +4773,17 @@ function memberRoleUpdate(current, permissions, services) {
|
|
|
4771
4773
|
storeIds: permissions.catalogixStores || []
|
|
4772
4774
|
};
|
|
4773
4775
|
}
|
|
4776
|
+
function inviteUpdate(invitationId, permissions, services) {
|
|
4777
|
+
const isAdmin = permissions.role === "admin";
|
|
4778
|
+
return {
|
|
4779
|
+
invitationId,
|
|
4780
|
+
role: permissions.role,
|
|
4781
|
+
creditAccess: permissions.canUseCredits,
|
|
4782
|
+
inviteAccess: permissions.canInviteUser,
|
|
4783
|
+
serviceIds: isAdmin ? [] : permissionServiceIds(services, permissions),
|
|
4784
|
+
storeIds: isAdmin ? [] : permissions.catalogixStores || []
|
|
4785
|
+
};
|
|
4786
|
+
}
|
|
4774
4787
|
function uniqueNonEmpty(values) {
|
|
4775
4788
|
return Array.from(new Set(values.map((v) => v.trim()).filter(Boolean)));
|
|
4776
4789
|
}
|
|
@@ -5419,6 +5432,7 @@ function TeamsContent({
|
|
|
5419
5432
|
setModal({ open: false, mode: "invite" });
|
|
5420
5433
|
};
|
|
5421
5434
|
const currentMemberPermissions = modal.target?.permissions;
|
|
5435
|
+
const canEditInvites = highestRole === "admin" && api.updateInvite !== void 0 && allServices.length > 0;
|
|
5422
5436
|
const handleSave = async (permissions) => {
|
|
5423
5437
|
if (!modal.target) {
|
|
5424
5438
|
closeModal();
|
|
@@ -5429,16 +5443,22 @@ function TeamsContent({
|
|
|
5429
5443
|
closeModal();
|
|
5430
5444
|
return;
|
|
5431
5445
|
}
|
|
5432
|
-
if (modal.target.kind === "invite"
|
|
5446
|
+
if (modal.target.kind === "invite") {
|
|
5447
|
+
if (!modal.target.invitationId || !api.updateInvite) {
|
|
5448
|
+
closeModal();
|
|
5449
|
+
return;
|
|
5450
|
+
}
|
|
5433
5451
|
try {
|
|
5434
|
-
await api.
|
|
5435
|
-
|
|
5436
|
-
|
|
5452
|
+
await api.updateInvite(
|
|
5453
|
+
inviteUpdate(modal.target.invitationId, permissions, allServices)
|
|
5454
|
+
);
|
|
5455
|
+
toast.success("Invitation updated");
|
|
5437
5456
|
} catch (err) {
|
|
5438
|
-
|
|
5439
|
-
|
|
5457
|
+
toast.error(errorMessage(err, { method: "PUT" }));
|
|
5458
|
+
return;
|
|
5440
5459
|
}
|
|
5441
5460
|
closeModal();
|
|
5461
|
+
await fetchData();
|
|
5442
5462
|
return;
|
|
5443
5463
|
}
|
|
5444
5464
|
if (modal.target.kind !== "member" || !modal.target.userId) {
|
|
@@ -5698,7 +5718,7 @@ function TeamsContent({
|
|
|
5698
5718
|
{
|
|
5699
5719
|
member,
|
|
5700
5720
|
variant: activeTab,
|
|
5701
|
-
onClick: activeTab === "active" ? () => openUpdateModal(member) : void 0,
|
|
5721
|
+
onClick: activeTab === "active" || canEditInvites ? () => openUpdateModal(member) : void 0,
|
|
5702
5722
|
onCancelInvite: () => void handleCancelPendingInvite(member),
|
|
5703
5723
|
onResendInvite: () => void handleResendPendingInvite(member)
|
|
5704
5724
|
},
|
|
@@ -5716,7 +5736,7 @@ function TeamsContent({
|
|
|
5716
5736
|
userEmail: modal.target?.userEmail,
|
|
5717
5737
|
stores: allStores,
|
|
5718
5738
|
hiddenApps,
|
|
5719
|
-
|
|
5739
|
+
subject: modal.target?.kind === "invite" ? "invite" : "member",
|
|
5720
5740
|
initialPermissions: currentMemberPermissions,
|
|
5721
5741
|
onClose: closeModal,
|
|
5722
5742
|
onSave: handleSave,
|
|
@@ -17780,6 +17800,7 @@ export {
|
|
|
17780
17800
|
formatPoolSplit,
|
|
17781
17801
|
groupWorkspaceList,
|
|
17782
17802
|
hasPaidFeatures,
|
|
17803
|
+
inviteUpdate,
|
|
17783
17804
|
isLimitBelowUsage,
|
|
17784
17805
|
isPaidPlan,
|
|
17785
17806
|
isSponsoredEntitlement,
|