@fonderie/client 1.5.0 → 1.7.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/brain/signatures.md +79 -1
- package/dist/index.cjs +70 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +106 -2
- package/dist/index.d.ts +106 -2
- package/dist/index.js +70 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -506,6 +506,60 @@ interface IAdminIssueTokenInput {
|
|
|
506
506
|
interface IAdminIssuedToken extends IAdminTokenRecord {
|
|
507
507
|
token: string;
|
|
508
508
|
}
|
|
509
|
+
interface IAdminOperator {
|
|
510
|
+
id: string;
|
|
511
|
+
email: string;
|
|
512
|
+
name: string | null;
|
|
513
|
+
scopes: AdminScope[];
|
|
514
|
+
enrolled: boolean;
|
|
515
|
+
backupCodesLeft: number;
|
|
516
|
+
locked: boolean;
|
|
517
|
+
createdBy: string;
|
|
518
|
+
createdAt: string;
|
|
519
|
+
lastLoginAt: string | null;
|
|
520
|
+
disabledAt: string | null;
|
|
521
|
+
}
|
|
522
|
+
interface IAdminOperatorLink {
|
|
523
|
+
id: string;
|
|
524
|
+
kind: 'invite' | 'recovery';
|
|
525
|
+
email: string;
|
|
526
|
+
scopes: AdminScope[];
|
|
527
|
+
createdBy: string;
|
|
528
|
+
createdAt: string;
|
|
529
|
+
expiresAt: string;
|
|
530
|
+
}
|
|
531
|
+
interface IAdminOperatorsReport {
|
|
532
|
+
operators: IAdminOperator[];
|
|
533
|
+
links: IAdminOperatorLink[];
|
|
534
|
+
}
|
|
535
|
+
interface IAdminCreatedLink {
|
|
536
|
+
id: string;
|
|
537
|
+
email: string;
|
|
538
|
+
scopes?: AdminScope[];
|
|
539
|
+
expiresAt: string;
|
|
540
|
+
token: string;
|
|
541
|
+
url: string;
|
|
542
|
+
}
|
|
543
|
+
type AdminSessionState = 'signed-out' | 'needs-2fa' | 'needs-enrollment' | 'signed-in';
|
|
544
|
+
interface IAdminSession {
|
|
545
|
+
state: AdminSessionState;
|
|
546
|
+
operator: IAdminOperator | null;
|
|
547
|
+
claimable?: boolean;
|
|
548
|
+
stepUpFresh?: boolean;
|
|
549
|
+
backupCodes?: string[];
|
|
550
|
+
backupCodesLeft?: number;
|
|
551
|
+
}
|
|
552
|
+
interface IAdminEnrollment {
|
|
553
|
+
secret: string;
|
|
554
|
+
uri: string;
|
|
555
|
+
account: string;
|
|
556
|
+
issuer: string;
|
|
557
|
+
}
|
|
558
|
+
type IAdminSecondFactor = {
|
|
559
|
+
code: string;
|
|
560
|
+
} | {
|
|
561
|
+
backupCode: string;
|
|
562
|
+
};
|
|
509
563
|
interface IAdminLogEntry {
|
|
510
564
|
id: string;
|
|
511
565
|
at: string;
|
|
@@ -1447,7 +1501,7 @@ declare class ConfigAdminClient {
|
|
|
1447
1501
|
|
|
1448
1502
|
interface IAdminClientOptions {
|
|
1449
1503
|
baseUrl: string;
|
|
1450
|
-
adminToken
|
|
1504
|
+
adminToken?: string;
|
|
1451
1505
|
prefix?: string;
|
|
1452
1506
|
actor?: string;
|
|
1453
1507
|
}
|
|
@@ -1482,6 +1536,55 @@ declare class AdminClient {
|
|
|
1482
1536
|
* module is behind, and 422 when any pending file deletes data.
|
|
1483
1537
|
*/
|
|
1484
1538
|
applyMigrations(module: string, expect: readonly string[]): Promise<IApiResponse<IAdminMigrationModule>>;
|
|
1539
|
+
/** Who is signed in, and whether the console can still be claimed. */
|
|
1540
|
+
session(): Promise<IApiResponse<IAdminSession>>;
|
|
1541
|
+
/** The one-time claim. Needs the ROOT token as this client's adminToken. */
|
|
1542
|
+
claim(input: {
|
|
1543
|
+
email: string;
|
|
1544
|
+
password: string;
|
|
1545
|
+
name?: string;
|
|
1546
|
+
}): Promise<IApiResponse<IAdminSession>>;
|
|
1547
|
+
login(input: {
|
|
1548
|
+
email: string;
|
|
1549
|
+
password: string;
|
|
1550
|
+
}): Promise<IApiResponse<IAdminSession>>;
|
|
1551
|
+
/** The authenticator secret and otpauth URI to scan while enrolling. */
|
|
1552
|
+
enrollment(): Promise<IApiResponse<IAdminEnrollment>>;
|
|
1553
|
+
/** Confirms the first code. The response carries the backup codes, once. */
|
|
1554
|
+
confirmEnrollment(code: string): Promise<IApiResponse<IAdminSession>>;
|
|
1555
|
+
/** The second factor after the password: an authenticator code or a backup code. */
|
|
1556
|
+
verify(factor: IAdminSecondFactor): Promise<IApiResponse<IAdminSession>>;
|
|
1557
|
+
/** A fresh code for the next five minutes of dangerous actions. */
|
|
1558
|
+
stepUp(factor: IAdminSecondFactor): Promise<IApiResponse<{
|
|
1559
|
+
stepUpFresh: boolean;
|
|
1560
|
+
backupCodesLeft?: number;
|
|
1561
|
+
}>>;
|
|
1562
|
+
logout(): Promise<IApiResponse<undefined>>;
|
|
1563
|
+
/** What an invite or recovery link is for, before setting a password. */
|
|
1564
|
+
inspectLink(token: string): Promise<IApiResponse<{
|
|
1565
|
+
kind: "invite" | "recovery";
|
|
1566
|
+
email: string;
|
|
1567
|
+
}>>;
|
|
1568
|
+
redeemLink(input: {
|
|
1569
|
+
token: string;
|
|
1570
|
+
password: string;
|
|
1571
|
+
name?: string;
|
|
1572
|
+
}): Promise<IApiResponse<IAdminSession>>;
|
|
1573
|
+
operators(): Promise<IApiResponse<IAdminOperatorsReport>>;
|
|
1574
|
+
/** An invite link, shown once. Needs the highest scope and a fresh code. */
|
|
1575
|
+
inviteOperator(input: {
|
|
1576
|
+
email: string;
|
|
1577
|
+
scopes: AdminScope[];
|
|
1578
|
+
expiresInHours?: number;
|
|
1579
|
+
}): Promise<IApiResponse<IAdminCreatedLink>>;
|
|
1580
|
+
/** Lost password or authenticator: a single-use link; signs them out everywhere. */
|
|
1581
|
+
recoverOperator(id: string): Promise<IApiResponse<IAdminCreatedLink>>;
|
|
1582
|
+
updateOperator(id: string, input: {
|
|
1583
|
+
scopes?: AdminScope[];
|
|
1584
|
+
name?: string;
|
|
1585
|
+
disabled?: boolean;
|
|
1586
|
+
}): Promise<IApiResponse<IAdminOperator>>;
|
|
1587
|
+
revokeOperatorLink(id: string): Promise<IApiResponse<undefined>>;
|
|
1485
1588
|
}
|
|
1486
1589
|
|
|
1487
1590
|
interface IAuthAdminClientOptions {
|
|
@@ -1497,6 +1600,7 @@ interface IAdminLoginHistoryQuery {
|
|
|
1497
1600
|
interface IAdminUsersQuery {
|
|
1498
1601
|
limit?: number;
|
|
1499
1602
|
cursor?: string;
|
|
1603
|
+
deleted?: boolean;
|
|
1500
1604
|
}
|
|
1501
1605
|
declare class AuthAdminClient {
|
|
1502
1606
|
private http;
|
|
@@ -1667,4 +1771,4 @@ declare function configValueLabel(value: unknown): string;
|
|
|
1667
1771
|
*/
|
|
1668
1772
|
declare function inferConfigValue(raw: string): IInferredConfigValue;
|
|
1669
1773
|
|
|
1670
|
-
export { AdminClient, type AdminRouteGuard, type AdminScope, AuditAdminClient, AuditClient, AuthAdminClient, AuthClient, BillingAdminClient, BillingClient, CONFIG_KEY_PATTERN, CONFIG_VALUE_TYPES, type CastResult, ConfigAdminClient, ConfigClient, type ConfigValueType, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, FonderieApiError, FonderieClient, type IAcceptInvitationResult, type IAddAddressInput, type IAddEmailInput, type IAddPhoneInput, type IAddRelationshipInput, type IAddressDTO, type IAdminAttention, type IAdminAttentionItem, type IAdminAuditQuery, type IAdminCatalog, type IAdminCheckResult, type IAdminClientOptions, type IAdminDoctorReport, type IAdminEnvironmentReport, type IAdminGrantInput, type IAdminIssueTokenInput, type IAdminIssuedToken, type IAdminLedgerQuery, type IAdminLogEntry, type IAdminLogPage, type IAdminLogQuery, type IAdminLoginHistoryQuery, type IAdminManifest, type IAdminMigrationModule, type IAdminMigrationsReport, type IAdminModuleEntry, type IAdminPendingMigration, type IAdminPlanInput, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminSubscriptionDTO, type IAdminSubscriptionPage, type IAdminSubscriptionsQuery, type IAdminTokenRecord, type IAdminTokensReport, type IAdminUserDTO, type IAdminUserPageResult, type IAdminUsersQuery, type IAdminWalletDTO, type IAdminWalletLedgerPage, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditAdminClientOptions, type IAuditEventDTO, type IAuditPageResult, type IAuthAdminClientOptions, type IBillingAdminClientOptions, type IBlacklistCustomerInput, type ICache, type ICancelSubscriptionInput, type IChangePasswordInput, type ICheckoutInput, type ICheckoutUrlResult, type IClientAuthConfig, type IConfigAdminClientOptions, type IConfigEntry, type IConfigRevision, type ICourierAdminClientOptions, type ICreateCustomerInput, type ICreatePlanInput, type ICreateRoleInput, type ICreateWebhookEndpointInput, type ICreateWorkspaceInput, type ICustomerAddressDTO, type ICustomerAddressListResult, type ICustomerAddressResult, type ICustomerDTO, type ICustomerDetailD2DTO, type ICustomerDetailDTO, type ICustomerEmailDTO, type ICustomerEmailListResult, type ICustomerEmailResult, type ICustomerLabelDTO, type ICustomerLabelListResult, type ICustomerListResult, type ICustomerNoteDTO, type ICustomerNoteListResult, type ICustomerNoteResult, type ICustomerPhoneDTO, type ICustomerPhoneListResult, type ICustomerPhoneResult, type ICustomerRelationshipDTO, type ICustomerRelationshipExpandedD2DTO, type ICustomerRelationshipExpandedDTO, type ICustomerRelationshipListResult, type ICustomerRelationshipResult, type ICustomerResult, type ICustomerShallowDTO, type ICustomerTagListResult, type IFonderieClientOptions, type IGetCustomerInput, type IGetLoginHistoryInput, type IInferredConfigValue, type IInvitationDTO, type IInvitationListResult, type IInviteEntry, type IInviteResult, type IInvoiceDTO, type IInvoicesResult, type IListAuditEventsInput, type IListCustomersInput, type ILoginEventDTO, type ILoginHistoryPageResult, type ILoginInput, type ILoginResult, type IMeResult, type IMediaAssetDTO, type IMediaAssetResult, type IMemberDTO, type IMemberListResult, type IMemoryCacheOptions, type IMfaEnabledResult, type IMfaRequiredResult, type IMfaSetupResult, type IPaymentMethodDTO, type IPaymentMethodResult, type IPlanDTO, type IPlanFeature, type IPlanListResult, type IPlanResult, type IPortalUrlResult, type IPreviewTemplateInput, type IReadOptions, type IRecordUsageInput, type IRefreshResult, type IRegisterInput, type IRegisterResult, type IRemoteConfigState, type IRenderedTemplateResult, type IRequestConfig, type IRequestLocationDTO, type IResendVerificationResult, type IResetPasswordInput, type IRevealSecretResult, type IRoleDTO, type IRoleListResult, type IRolePermission, type IRolePermissionInput, type IRolePermissionsResult, type IRoleResult, type IRollbackInput, type IRollbackTemplateInput, type ISecretEntry, type ISecretRevision, type ISessionDTO, type ISessionsResult, type ISetConfigInput, type ISetSecretInput, type ISetTemplateInput, type ISubscriptionChangeResult, type ISubscriptionDTO, type ISubscriptionResult, type ITemplateEntry, type ITemplateRevision, type ITestWebhookResult, type ITokens, type IUpdateCustomerInput, type IUpdatePlanInput, type IUpdatePreferencesInput, type IUpdateProfileInput, type IUpdateRoleInput, type IUpdateSettingsInput, type IUpdateWebhookEndpointInput, type IUpdateWorkspaceInput, type IUploadMediaInput, type IUsageResult, type IUserDTO, type IUserPreferences, type IVerifyEmailResult, type IWalletCheckoutInput, type IWalletDTO, type IWalletPreferencesInput, type IWalletPurchaseInput, type IWalletPurchaseResult, type IWalletResult, type IWalletTransactionDTO, type IWalletTransactionsResult, type IWebhookDeliveryDTO, type IWebhookDeliveryListResult, type IWebhookEndpointCreatedDTO, type IWebhookEndpointDTO, type IWebhookEndpointListResult, type IWorkspaceAddressDTO, type IWorkspaceDTO, type IWorkspaceListResult, type IWorkspaceResult, type IWorkspaceSettingsDTO, type IWorkspaceSettingsResult, MediaClient, type MigrationImpact, type SubscriberType, WebhooksClient, WorkspacesClient, castConfigValue, configKeyProblem, configValueLabel, configValueType, createMemoryCache, describeLocation, formatConfigValue, inferConfigValue, isMfaRequired };
|
|
1774
|
+
export { AdminClient, type AdminRouteGuard, type AdminScope, type AdminSessionState, AuditAdminClient, AuditClient, AuthAdminClient, AuthClient, BillingAdminClient, BillingClient, CONFIG_KEY_PATTERN, CONFIG_VALUE_TYPES, type CastResult, ConfigAdminClient, ConfigClient, type ConfigValueType, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, FonderieApiError, FonderieClient, type IAcceptInvitationResult, type IAddAddressInput, type IAddEmailInput, type IAddPhoneInput, type IAddRelationshipInput, type IAddressDTO, type IAdminAttention, type IAdminAttentionItem, type IAdminAuditQuery, type IAdminCatalog, type IAdminCheckResult, type IAdminClientOptions, type IAdminCreatedLink, type IAdminDoctorReport, type IAdminEnrollment, type IAdminEnvironmentReport, type IAdminGrantInput, type IAdminIssueTokenInput, type IAdminIssuedToken, type IAdminLedgerQuery, type IAdminLogEntry, type IAdminLogPage, type IAdminLogQuery, type IAdminLoginHistoryQuery, type IAdminManifest, type IAdminMigrationModule, type IAdminMigrationsReport, type IAdminModuleEntry, type IAdminOperator, type IAdminOperatorLink, type IAdminOperatorsReport, type IAdminPendingMigration, type IAdminPlanInput, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminSecondFactor, type IAdminSession, type IAdminSubscriptionDTO, type IAdminSubscriptionPage, type IAdminSubscriptionsQuery, type IAdminTokenRecord, type IAdminTokensReport, type IAdminUserDTO, type IAdminUserPageResult, type IAdminUsersQuery, type IAdminWalletDTO, type IAdminWalletLedgerPage, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditAdminClientOptions, type IAuditEventDTO, type IAuditPageResult, type IAuthAdminClientOptions, type IBillingAdminClientOptions, type IBlacklistCustomerInput, type ICache, type ICancelSubscriptionInput, type IChangePasswordInput, type ICheckoutInput, type ICheckoutUrlResult, type IClientAuthConfig, type IConfigAdminClientOptions, type IConfigEntry, type IConfigRevision, type ICourierAdminClientOptions, type ICreateCustomerInput, type ICreatePlanInput, type ICreateRoleInput, type ICreateWebhookEndpointInput, type ICreateWorkspaceInput, type ICustomerAddressDTO, type ICustomerAddressListResult, type ICustomerAddressResult, type ICustomerDTO, type ICustomerDetailD2DTO, type ICustomerDetailDTO, type ICustomerEmailDTO, type ICustomerEmailListResult, type ICustomerEmailResult, type ICustomerLabelDTO, type ICustomerLabelListResult, type ICustomerListResult, type ICustomerNoteDTO, type ICustomerNoteListResult, type ICustomerNoteResult, type ICustomerPhoneDTO, type ICustomerPhoneListResult, type ICustomerPhoneResult, type ICustomerRelationshipDTO, type ICustomerRelationshipExpandedD2DTO, type ICustomerRelationshipExpandedDTO, type ICustomerRelationshipListResult, type ICustomerRelationshipResult, type ICustomerResult, type ICustomerShallowDTO, type ICustomerTagListResult, type IFonderieClientOptions, type IGetCustomerInput, type IGetLoginHistoryInput, type IInferredConfigValue, type IInvitationDTO, type IInvitationListResult, type IInviteEntry, type IInviteResult, type IInvoiceDTO, type IInvoicesResult, type IListAuditEventsInput, type IListCustomersInput, type ILoginEventDTO, type ILoginHistoryPageResult, type ILoginInput, type ILoginResult, type IMeResult, type IMediaAssetDTO, type IMediaAssetResult, type IMemberDTO, type IMemberListResult, type IMemoryCacheOptions, type IMfaEnabledResult, type IMfaRequiredResult, type IMfaSetupResult, type IPaymentMethodDTO, type IPaymentMethodResult, type IPlanDTO, type IPlanFeature, type IPlanListResult, type IPlanResult, type IPortalUrlResult, type IPreviewTemplateInput, type IReadOptions, type IRecordUsageInput, type IRefreshResult, type IRegisterInput, type IRegisterResult, type IRemoteConfigState, type IRenderedTemplateResult, type IRequestConfig, type IRequestLocationDTO, type IResendVerificationResult, type IResetPasswordInput, type IRevealSecretResult, type IRoleDTO, type IRoleListResult, type IRolePermission, type IRolePermissionInput, type IRolePermissionsResult, type IRoleResult, type IRollbackInput, type IRollbackTemplateInput, type ISecretEntry, type ISecretRevision, type ISessionDTO, type ISessionsResult, type ISetConfigInput, type ISetSecretInput, type ISetTemplateInput, type ISubscriptionChangeResult, type ISubscriptionDTO, type ISubscriptionResult, type ITemplateEntry, type ITemplateRevision, type ITestWebhookResult, type ITokens, type IUpdateCustomerInput, type IUpdatePlanInput, type IUpdatePreferencesInput, type IUpdateProfileInput, type IUpdateRoleInput, type IUpdateSettingsInput, type IUpdateWebhookEndpointInput, type IUpdateWorkspaceInput, type IUploadMediaInput, type IUsageResult, type IUserDTO, type IUserPreferences, type IVerifyEmailResult, type IWalletCheckoutInput, type IWalletDTO, type IWalletPreferencesInput, type IWalletPurchaseInput, type IWalletPurchaseResult, type IWalletResult, type IWalletTransactionDTO, type IWalletTransactionsResult, type IWebhookDeliveryDTO, type IWebhookDeliveryListResult, type IWebhookEndpointCreatedDTO, type IWebhookEndpointDTO, type IWebhookEndpointListResult, type IWorkspaceAddressDTO, type IWorkspaceDTO, type IWorkspaceListResult, type IWorkspaceResult, type IWorkspaceSettingsDTO, type IWorkspaceSettingsResult, MediaClient, type MigrationImpact, type SubscriberType, WebhooksClient, WorkspacesClient, castConfigValue, configKeyProblem, configValueLabel, configValueType, createMemoryCache, describeLocation, formatConfigValue, inferConfigValue, isMfaRequired };
|
package/dist/index.d.ts
CHANGED
|
@@ -506,6 +506,60 @@ interface IAdminIssueTokenInput {
|
|
|
506
506
|
interface IAdminIssuedToken extends IAdminTokenRecord {
|
|
507
507
|
token: string;
|
|
508
508
|
}
|
|
509
|
+
interface IAdminOperator {
|
|
510
|
+
id: string;
|
|
511
|
+
email: string;
|
|
512
|
+
name: string | null;
|
|
513
|
+
scopes: AdminScope[];
|
|
514
|
+
enrolled: boolean;
|
|
515
|
+
backupCodesLeft: number;
|
|
516
|
+
locked: boolean;
|
|
517
|
+
createdBy: string;
|
|
518
|
+
createdAt: string;
|
|
519
|
+
lastLoginAt: string | null;
|
|
520
|
+
disabledAt: string | null;
|
|
521
|
+
}
|
|
522
|
+
interface IAdminOperatorLink {
|
|
523
|
+
id: string;
|
|
524
|
+
kind: 'invite' | 'recovery';
|
|
525
|
+
email: string;
|
|
526
|
+
scopes: AdminScope[];
|
|
527
|
+
createdBy: string;
|
|
528
|
+
createdAt: string;
|
|
529
|
+
expiresAt: string;
|
|
530
|
+
}
|
|
531
|
+
interface IAdminOperatorsReport {
|
|
532
|
+
operators: IAdminOperator[];
|
|
533
|
+
links: IAdminOperatorLink[];
|
|
534
|
+
}
|
|
535
|
+
interface IAdminCreatedLink {
|
|
536
|
+
id: string;
|
|
537
|
+
email: string;
|
|
538
|
+
scopes?: AdminScope[];
|
|
539
|
+
expiresAt: string;
|
|
540
|
+
token: string;
|
|
541
|
+
url: string;
|
|
542
|
+
}
|
|
543
|
+
type AdminSessionState = 'signed-out' | 'needs-2fa' | 'needs-enrollment' | 'signed-in';
|
|
544
|
+
interface IAdminSession {
|
|
545
|
+
state: AdminSessionState;
|
|
546
|
+
operator: IAdminOperator | null;
|
|
547
|
+
claimable?: boolean;
|
|
548
|
+
stepUpFresh?: boolean;
|
|
549
|
+
backupCodes?: string[];
|
|
550
|
+
backupCodesLeft?: number;
|
|
551
|
+
}
|
|
552
|
+
interface IAdminEnrollment {
|
|
553
|
+
secret: string;
|
|
554
|
+
uri: string;
|
|
555
|
+
account: string;
|
|
556
|
+
issuer: string;
|
|
557
|
+
}
|
|
558
|
+
type IAdminSecondFactor = {
|
|
559
|
+
code: string;
|
|
560
|
+
} | {
|
|
561
|
+
backupCode: string;
|
|
562
|
+
};
|
|
509
563
|
interface IAdminLogEntry {
|
|
510
564
|
id: string;
|
|
511
565
|
at: string;
|
|
@@ -1447,7 +1501,7 @@ declare class ConfigAdminClient {
|
|
|
1447
1501
|
|
|
1448
1502
|
interface IAdminClientOptions {
|
|
1449
1503
|
baseUrl: string;
|
|
1450
|
-
adminToken
|
|
1504
|
+
adminToken?: string;
|
|
1451
1505
|
prefix?: string;
|
|
1452
1506
|
actor?: string;
|
|
1453
1507
|
}
|
|
@@ -1482,6 +1536,55 @@ declare class AdminClient {
|
|
|
1482
1536
|
* module is behind, and 422 when any pending file deletes data.
|
|
1483
1537
|
*/
|
|
1484
1538
|
applyMigrations(module: string, expect: readonly string[]): Promise<IApiResponse<IAdminMigrationModule>>;
|
|
1539
|
+
/** Who is signed in, and whether the console can still be claimed. */
|
|
1540
|
+
session(): Promise<IApiResponse<IAdminSession>>;
|
|
1541
|
+
/** The one-time claim. Needs the ROOT token as this client's adminToken. */
|
|
1542
|
+
claim(input: {
|
|
1543
|
+
email: string;
|
|
1544
|
+
password: string;
|
|
1545
|
+
name?: string;
|
|
1546
|
+
}): Promise<IApiResponse<IAdminSession>>;
|
|
1547
|
+
login(input: {
|
|
1548
|
+
email: string;
|
|
1549
|
+
password: string;
|
|
1550
|
+
}): Promise<IApiResponse<IAdminSession>>;
|
|
1551
|
+
/** The authenticator secret and otpauth URI to scan while enrolling. */
|
|
1552
|
+
enrollment(): Promise<IApiResponse<IAdminEnrollment>>;
|
|
1553
|
+
/** Confirms the first code. The response carries the backup codes, once. */
|
|
1554
|
+
confirmEnrollment(code: string): Promise<IApiResponse<IAdminSession>>;
|
|
1555
|
+
/** The second factor after the password: an authenticator code or a backup code. */
|
|
1556
|
+
verify(factor: IAdminSecondFactor): Promise<IApiResponse<IAdminSession>>;
|
|
1557
|
+
/** A fresh code for the next five minutes of dangerous actions. */
|
|
1558
|
+
stepUp(factor: IAdminSecondFactor): Promise<IApiResponse<{
|
|
1559
|
+
stepUpFresh: boolean;
|
|
1560
|
+
backupCodesLeft?: number;
|
|
1561
|
+
}>>;
|
|
1562
|
+
logout(): Promise<IApiResponse<undefined>>;
|
|
1563
|
+
/** What an invite or recovery link is for, before setting a password. */
|
|
1564
|
+
inspectLink(token: string): Promise<IApiResponse<{
|
|
1565
|
+
kind: "invite" | "recovery";
|
|
1566
|
+
email: string;
|
|
1567
|
+
}>>;
|
|
1568
|
+
redeemLink(input: {
|
|
1569
|
+
token: string;
|
|
1570
|
+
password: string;
|
|
1571
|
+
name?: string;
|
|
1572
|
+
}): Promise<IApiResponse<IAdminSession>>;
|
|
1573
|
+
operators(): Promise<IApiResponse<IAdminOperatorsReport>>;
|
|
1574
|
+
/** An invite link, shown once. Needs the highest scope and a fresh code. */
|
|
1575
|
+
inviteOperator(input: {
|
|
1576
|
+
email: string;
|
|
1577
|
+
scopes: AdminScope[];
|
|
1578
|
+
expiresInHours?: number;
|
|
1579
|
+
}): Promise<IApiResponse<IAdminCreatedLink>>;
|
|
1580
|
+
/** Lost password or authenticator: a single-use link; signs them out everywhere. */
|
|
1581
|
+
recoverOperator(id: string): Promise<IApiResponse<IAdminCreatedLink>>;
|
|
1582
|
+
updateOperator(id: string, input: {
|
|
1583
|
+
scopes?: AdminScope[];
|
|
1584
|
+
name?: string;
|
|
1585
|
+
disabled?: boolean;
|
|
1586
|
+
}): Promise<IApiResponse<IAdminOperator>>;
|
|
1587
|
+
revokeOperatorLink(id: string): Promise<IApiResponse<undefined>>;
|
|
1485
1588
|
}
|
|
1486
1589
|
|
|
1487
1590
|
interface IAuthAdminClientOptions {
|
|
@@ -1497,6 +1600,7 @@ interface IAdminLoginHistoryQuery {
|
|
|
1497
1600
|
interface IAdminUsersQuery {
|
|
1498
1601
|
limit?: number;
|
|
1499
1602
|
cursor?: string;
|
|
1603
|
+
deleted?: boolean;
|
|
1500
1604
|
}
|
|
1501
1605
|
declare class AuthAdminClient {
|
|
1502
1606
|
private http;
|
|
@@ -1667,4 +1771,4 @@ declare function configValueLabel(value: unknown): string;
|
|
|
1667
1771
|
*/
|
|
1668
1772
|
declare function inferConfigValue(raw: string): IInferredConfigValue;
|
|
1669
1773
|
|
|
1670
|
-
export { AdminClient, type AdminRouteGuard, type AdminScope, AuditAdminClient, AuditClient, AuthAdminClient, AuthClient, BillingAdminClient, BillingClient, CONFIG_KEY_PATTERN, CONFIG_VALUE_TYPES, type CastResult, ConfigAdminClient, ConfigClient, type ConfigValueType, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, FonderieApiError, FonderieClient, type IAcceptInvitationResult, type IAddAddressInput, type IAddEmailInput, type IAddPhoneInput, type IAddRelationshipInput, type IAddressDTO, type IAdminAttention, type IAdminAttentionItem, type IAdminAuditQuery, type IAdminCatalog, type IAdminCheckResult, type IAdminClientOptions, type IAdminDoctorReport, type IAdminEnvironmentReport, type IAdminGrantInput, type IAdminIssueTokenInput, type IAdminIssuedToken, type IAdminLedgerQuery, type IAdminLogEntry, type IAdminLogPage, type IAdminLogQuery, type IAdminLoginHistoryQuery, type IAdminManifest, type IAdminMigrationModule, type IAdminMigrationsReport, type IAdminModuleEntry, type IAdminPendingMigration, type IAdminPlanInput, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminSubscriptionDTO, type IAdminSubscriptionPage, type IAdminSubscriptionsQuery, type IAdminTokenRecord, type IAdminTokensReport, type IAdminUserDTO, type IAdminUserPageResult, type IAdminUsersQuery, type IAdminWalletDTO, type IAdminWalletLedgerPage, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditAdminClientOptions, type IAuditEventDTO, type IAuditPageResult, type IAuthAdminClientOptions, type IBillingAdminClientOptions, type IBlacklistCustomerInput, type ICache, type ICancelSubscriptionInput, type IChangePasswordInput, type ICheckoutInput, type ICheckoutUrlResult, type IClientAuthConfig, type IConfigAdminClientOptions, type IConfigEntry, type IConfigRevision, type ICourierAdminClientOptions, type ICreateCustomerInput, type ICreatePlanInput, type ICreateRoleInput, type ICreateWebhookEndpointInput, type ICreateWorkspaceInput, type ICustomerAddressDTO, type ICustomerAddressListResult, type ICustomerAddressResult, type ICustomerDTO, type ICustomerDetailD2DTO, type ICustomerDetailDTO, type ICustomerEmailDTO, type ICustomerEmailListResult, type ICustomerEmailResult, type ICustomerLabelDTO, type ICustomerLabelListResult, type ICustomerListResult, type ICustomerNoteDTO, type ICustomerNoteListResult, type ICustomerNoteResult, type ICustomerPhoneDTO, type ICustomerPhoneListResult, type ICustomerPhoneResult, type ICustomerRelationshipDTO, type ICustomerRelationshipExpandedD2DTO, type ICustomerRelationshipExpandedDTO, type ICustomerRelationshipListResult, type ICustomerRelationshipResult, type ICustomerResult, type ICustomerShallowDTO, type ICustomerTagListResult, type IFonderieClientOptions, type IGetCustomerInput, type IGetLoginHistoryInput, type IInferredConfigValue, type IInvitationDTO, type IInvitationListResult, type IInviteEntry, type IInviteResult, type IInvoiceDTO, type IInvoicesResult, type IListAuditEventsInput, type IListCustomersInput, type ILoginEventDTO, type ILoginHistoryPageResult, type ILoginInput, type ILoginResult, type IMeResult, type IMediaAssetDTO, type IMediaAssetResult, type IMemberDTO, type IMemberListResult, type IMemoryCacheOptions, type IMfaEnabledResult, type IMfaRequiredResult, type IMfaSetupResult, type IPaymentMethodDTO, type IPaymentMethodResult, type IPlanDTO, type IPlanFeature, type IPlanListResult, type IPlanResult, type IPortalUrlResult, type IPreviewTemplateInput, type IReadOptions, type IRecordUsageInput, type IRefreshResult, type IRegisterInput, type IRegisterResult, type IRemoteConfigState, type IRenderedTemplateResult, type IRequestConfig, type IRequestLocationDTO, type IResendVerificationResult, type IResetPasswordInput, type IRevealSecretResult, type IRoleDTO, type IRoleListResult, type IRolePermission, type IRolePermissionInput, type IRolePermissionsResult, type IRoleResult, type IRollbackInput, type IRollbackTemplateInput, type ISecretEntry, type ISecretRevision, type ISessionDTO, type ISessionsResult, type ISetConfigInput, type ISetSecretInput, type ISetTemplateInput, type ISubscriptionChangeResult, type ISubscriptionDTO, type ISubscriptionResult, type ITemplateEntry, type ITemplateRevision, type ITestWebhookResult, type ITokens, type IUpdateCustomerInput, type IUpdatePlanInput, type IUpdatePreferencesInput, type IUpdateProfileInput, type IUpdateRoleInput, type IUpdateSettingsInput, type IUpdateWebhookEndpointInput, type IUpdateWorkspaceInput, type IUploadMediaInput, type IUsageResult, type IUserDTO, type IUserPreferences, type IVerifyEmailResult, type IWalletCheckoutInput, type IWalletDTO, type IWalletPreferencesInput, type IWalletPurchaseInput, type IWalletPurchaseResult, type IWalletResult, type IWalletTransactionDTO, type IWalletTransactionsResult, type IWebhookDeliveryDTO, type IWebhookDeliveryListResult, type IWebhookEndpointCreatedDTO, type IWebhookEndpointDTO, type IWebhookEndpointListResult, type IWorkspaceAddressDTO, type IWorkspaceDTO, type IWorkspaceListResult, type IWorkspaceResult, type IWorkspaceSettingsDTO, type IWorkspaceSettingsResult, MediaClient, type MigrationImpact, type SubscriberType, WebhooksClient, WorkspacesClient, castConfigValue, configKeyProblem, configValueLabel, configValueType, createMemoryCache, describeLocation, formatConfigValue, inferConfigValue, isMfaRequired };
|
|
1774
|
+
export { AdminClient, type AdminRouteGuard, type AdminScope, type AdminSessionState, AuditAdminClient, AuditClient, AuthAdminClient, AuthClient, BillingAdminClient, BillingClient, CONFIG_KEY_PATTERN, CONFIG_VALUE_TYPES, type CastResult, ConfigAdminClient, ConfigClient, type ConfigValueType, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, FonderieApiError, FonderieClient, type IAcceptInvitationResult, type IAddAddressInput, type IAddEmailInput, type IAddPhoneInput, type IAddRelationshipInput, type IAddressDTO, type IAdminAttention, type IAdminAttentionItem, type IAdminAuditQuery, type IAdminCatalog, type IAdminCheckResult, type IAdminClientOptions, type IAdminCreatedLink, type IAdminDoctorReport, type IAdminEnrollment, type IAdminEnvironmentReport, type IAdminGrantInput, type IAdminIssueTokenInput, type IAdminIssuedToken, type IAdminLedgerQuery, type IAdminLogEntry, type IAdminLogPage, type IAdminLogQuery, type IAdminLoginHistoryQuery, type IAdminManifest, type IAdminMigrationModule, type IAdminMigrationsReport, type IAdminModuleEntry, type IAdminOperator, type IAdminOperatorLink, type IAdminOperatorsReport, type IAdminPendingMigration, type IAdminPlanInput, type IAdminReadiness, type IAdminReadinessProblem, type IAdminRouteEntry, type IAdminRoutesReport, type IAdminSecondFactor, type IAdminSession, type IAdminSubscriptionDTO, type IAdminSubscriptionPage, type IAdminSubscriptionsQuery, type IAdminTokenRecord, type IAdminTokensReport, type IAdminUserDTO, type IAdminUserPageResult, type IAdminUsersQuery, type IAdminWalletDTO, type IAdminWalletLedgerPage, type IApiError, type IApiResponse, type IAppleNativeInput, type IAuditAdminClientOptions, type IAuditEventDTO, type IAuditPageResult, type IAuthAdminClientOptions, type IBillingAdminClientOptions, type IBlacklistCustomerInput, type ICache, type ICancelSubscriptionInput, type IChangePasswordInput, type ICheckoutInput, type ICheckoutUrlResult, type IClientAuthConfig, type IConfigAdminClientOptions, type IConfigEntry, type IConfigRevision, type ICourierAdminClientOptions, type ICreateCustomerInput, type ICreatePlanInput, type ICreateRoleInput, type ICreateWebhookEndpointInput, type ICreateWorkspaceInput, type ICustomerAddressDTO, type ICustomerAddressListResult, type ICustomerAddressResult, type ICustomerDTO, type ICustomerDetailD2DTO, type ICustomerDetailDTO, type ICustomerEmailDTO, type ICustomerEmailListResult, type ICustomerEmailResult, type ICustomerLabelDTO, type ICustomerLabelListResult, type ICustomerListResult, type ICustomerNoteDTO, type ICustomerNoteListResult, type ICustomerNoteResult, type ICustomerPhoneDTO, type ICustomerPhoneListResult, type ICustomerPhoneResult, type ICustomerRelationshipDTO, type ICustomerRelationshipExpandedD2DTO, type ICustomerRelationshipExpandedDTO, type ICustomerRelationshipListResult, type ICustomerRelationshipResult, type ICustomerResult, type ICustomerShallowDTO, type ICustomerTagListResult, type IFonderieClientOptions, type IGetCustomerInput, type IGetLoginHistoryInput, type IInferredConfigValue, type IInvitationDTO, type IInvitationListResult, type IInviteEntry, type IInviteResult, type IInvoiceDTO, type IInvoicesResult, type IListAuditEventsInput, type IListCustomersInput, type ILoginEventDTO, type ILoginHistoryPageResult, type ILoginInput, type ILoginResult, type IMeResult, type IMediaAssetDTO, type IMediaAssetResult, type IMemberDTO, type IMemberListResult, type IMemoryCacheOptions, type IMfaEnabledResult, type IMfaRequiredResult, type IMfaSetupResult, type IPaymentMethodDTO, type IPaymentMethodResult, type IPlanDTO, type IPlanFeature, type IPlanListResult, type IPlanResult, type IPortalUrlResult, type IPreviewTemplateInput, type IReadOptions, type IRecordUsageInput, type IRefreshResult, type IRegisterInput, type IRegisterResult, type IRemoteConfigState, type IRenderedTemplateResult, type IRequestConfig, type IRequestLocationDTO, type IResendVerificationResult, type IResetPasswordInput, type IRevealSecretResult, type IRoleDTO, type IRoleListResult, type IRolePermission, type IRolePermissionInput, type IRolePermissionsResult, type IRoleResult, type IRollbackInput, type IRollbackTemplateInput, type ISecretEntry, type ISecretRevision, type ISessionDTO, type ISessionsResult, type ISetConfigInput, type ISetSecretInput, type ISetTemplateInput, type ISubscriptionChangeResult, type ISubscriptionDTO, type ISubscriptionResult, type ITemplateEntry, type ITemplateRevision, type ITestWebhookResult, type ITokens, type IUpdateCustomerInput, type IUpdatePlanInput, type IUpdatePreferencesInput, type IUpdateProfileInput, type IUpdateRoleInput, type IUpdateSettingsInput, type IUpdateWebhookEndpointInput, type IUpdateWorkspaceInput, type IUploadMediaInput, type IUsageResult, type IUserDTO, type IUserPreferences, type IVerifyEmailResult, type IWalletCheckoutInput, type IWalletDTO, type IWalletPreferencesInput, type IWalletPurchaseInput, type IWalletPurchaseResult, type IWalletResult, type IWalletTransactionDTO, type IWalletTransactionsResult, type IWebhookDeliveryDTO, type IWebhookDeliveryListResult, type IWebhookEndpointCreatedDTO, type IWebhookEndpointDTO, type IWebhookEndpointListResult, type IWorkspaceAddressDTO, type IWorkspaceDTO, type IWorkspaceListResult, type IWorkspaceResult, type IWorkspaceSettingsDTO, type IWorkspaceSettingsResult, MediaClient, type MigrationImpact, type SubscriberType, WebhooksClient, WorkspacesClient, castConfigValue, configKeyProblem, configValueLabel, configValueType, createMemoryCache, describeLocation, formatConfigValue, inferConfigValue, isMfaRequired };
|
package/dist/index.js
CHANGED
|
@@ -1865,6 +1865,75 @@ var AdminClient = class {
|
|
|
1865
1865
|
{ expect }
|
|
1866
1866
|
);
|
|
1867
1867
|
}
|
|
1868
|
+
// ── operator sign-in (the served console's gate) ──────────────────────
|
|
1869
|
+
// Cookie-based: the server sets an HttpOnly session cookie; nothing here
|
|
1870
|
+
// ever holds it. Omit adminToken on this client — except for claim().
|
|
1871
|
+
/** Who is signed in, and whether the console can still be claimed. */
|
|
1872
|
+
session() {
|
|
1873
|
+
return this.get("/session");
|
|
1874
|
+
}
|
|
1875
|
+
/** The one-time claim. Needs the ROOT token as this client's adminToken. */
|
|
1876
|
+
claim(input) {
|
|
1877
|
+
return this.call("POST", "/session/claim", input);
|
|
1878
|
+
}
|
|
1879
|
+
login(input) {
|
|
1880
|
+
return this.call("POST", "/session/login", input);
|
|
1881
|
+
}
|
|
1882
|
+
/** The authenticator secret and otpauth URI to scan while enrolling. */
|
|
1883
|
+
enrollment() {
|
|
1884
|
+
return this.get("/session/enrollment");
|
|
1885
|
+
}
|
|
1886
|
+
/** Confirms the first code. The response carries the backup codes, once. */
|
|
1887
|
+
confirmEnrollment(code) {
|
|
1888
|
+
return this.call("POST", "/session/enrollment", { code });
|
|
1889
|
+
}
|
|
1890
|
+
/** The second factor after the password: an authenticator code or a backup code. */
|
|
1891
|
+
verify(factor) {
|
|
1892
|
+
return this.call("POST", "/session/verify", factor);
|
|
1893
|
+
}
|
|
1894
|
+
/** A fresh code for the next five minutes of dangerous actions. */
|
|
1895
|
+
stepUp(factor) {
|
|
1896
|
+
return this.call(
|
|
1897
|
+
"POST",
|
|
1898
|
+
"/session/step-up",
|
|
1899
|
+
factor
|
|
1900
|
+
);
|
|
1901
|
+
}
|
|
1902
|
+
logout() {
|
|
1903
|
+
return this.call("DELETE", "/session");
|
|
1904
|
+
}
|
|
1905
|
+
/** What an invite or recovery link is for, before setting a password. */
|
|
1906
|
+
inspectLink(token) {
|
|
1907
|
+
return this.call(
|
|
1908
|
+
"POST",
|
|
1909
|
+
"/session/link/inspect",
|
|
1910
|
+
{ token }
|
|
1911
|
+
);
|
|
1912
|
+
}
|
|
1913
|
+
redeemLink(input) {
|
|
1914
|
+
return this.call("POST", "/session/link", input);
|
|
1915
|
+
}
|
|
1916
|
+
// ── managing operators ─────────────────────────────────────────────────
|
|
1917
|
+
operators() {
|
|
1918
|
+
return this.get("/access/operators");
|
|
1919
|
+
}
|
|
1920
|
+
/** An invite link, shown once. Needs the highest scope and a fresh code. */
|
|
1921
|
+
inviteOperator(input) {
|
|
1922
|
+
return this.call("POST", "/access/operators/invites", input);
|
|
1923
|
+
}
|
|
1924
|
+
/** Lost password or authenticator: a single-use link; signs them out everywhere. */
|
|
1925
|
+
recoverOperator(id) {
|
|
1926
|
+
return this.call(
|
|
1927
|
+
"POST",
|
|
1928
|
+
`/access/operators/${encodeURIComponent(id)}/recovery`
|
|
1929
|
+
);
|
|
1930
|
+
}
|
|
1931
|
+
updateOperator(id, input) {
|
|
1932
|
+
return this.call("PUT", `/access/operators/${encodeURIComponent(id)}`, input);
|
|
1933
|
+
}
|
|
1934
|
+
revokeOperatorLink(id) {
|
|
1935
|
+
return this.call("DELETE", `/access/operators/links/${encodeURIComponent(id)}`);
|
|
1936
|
+
}
|
|
1868
1937
|
};
|
|
1869
1938
|
|
|
1870
1939
|
// src/modules/auth-admin.ts
|
|
@@ -1893,6 +1962,7 @@ var AuthAdminClient = class {
|
|
|
1893
1962
|
const q = new URLSearchParams();
|
|
1894
1963
|
if (query.limit) q.set("limit", String(query.limit));
|
|
1895
1964
|
if (query.cursor) q.set("cursor", query.cursor);
|
|
1965
|
+
if (query.deleted) q.set("deleted", "1");
|
|
1896
1966
|
const qs = q.toString();
|
|
1897
1967
|
return this.call("GET", qs ? `?${qs}` : "");
|
|
1898
1968
|
}
|