@delopay/sdk 0.63.0 → 0.65.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/{chunk-JCO4CHY7.js → chunk-2DNFEA5T.js} +46 -5
- package/dist/chunk-2DNFEA5T.js.map +1 -0
- package/dist/index.cjs +45 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +122 -6
- package/dist/index.d.ts +122 -6
- package/dist/index.js +1 -1
- package/dist/internal.cjs +45 -4
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-JCO4CHY7.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -950,11 +950,34 @@ interface PaymentLinkBackgroundImageConfig {
|
|
|
950
950
|
position?: 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | null;
|
|
951
951
|
size?: 'cover' | 'contain' | 'auto' | null;
|
|
952
952
|
}
|
|
953
|
+
/** Revenue taken in one currency. Amounts are in that currency's minor units. */
|
|
954
|
+
interface CurrencyRevenue {
|
|
955
|
+
/** ISO 4217 code, e.g. `EUR`. */
|
|
956
|
+
currency: string;
|
|
957
|
+
amount_minor: number;
|
|
958
|
+
orders: number;
|
|
959
|
+
}
|
|
953
960
|
interface ShopStats {
|
|
954
961
|
shop_id: string;
|
|
955
962
|
shop_name: string;
|
|
963
|
+
/** Project the shop is grouped under, or `null` when unassigned. */
|
|
964
|
+
project_id: string | null;
|
|
956
965
|
orders: number;
|
|
966
|
+
/**
|
|
967
|
+
* @deprecated Raw sum of minor units across every currency, with no FX
|
|
968
|
+
* conversion — meaningless for a multi-currency shop. Use `revenue_usd`
|
|
969
|
+
* (FX-converted, USD **major** units) or `revenue_by_currency`.
|
|
970
|
+
*/
|
|
957
971
|
revenue: number;
|
|
972
|
+
/** FX-converted revenue in USD major units. Excludes `unconverted_orders`. */
|
|
973
|
+
revenue_usd: number;
|
|
974
|
+
/** Revenue split by the currency it was taken in, sorted by currency code. */
|
|
975
|
+
revenue_by_currency: CurrencyRevenue[];
|
|
976
|
+
/**
|
|
977
|
+
* Orders left out of `revenue_usd` because their currency had no fresh USD
|
|
978
|
+
* rate. Non-zero means the USD figure understates reality.
|
|
979
|
+
*/
|
|
980
|
+
unconverted_orders: number;
|
|
958
981
|
}
|
|
959
982
|
interface GatewayConnectRequest {
|
|
960
983
|
connector_type: ConnectorType;
|
|
@@ -1334,15 +1357,41 @@ interface ProjectStats {
|
|
|
1334
1357
|
project_id: string;
|
|
1335
1358
|
project_name: string;
|
|
1336
1359
|
orders: number;
|
|
1360
|
+
/** @deprecated Cross-currency raw sum. Use `revenue_usd` / `revenue_by_currency`. */
|
|
1337
1361
|
revenue: number;
|
|
1362
|
+
revenue_usd: number;
|
|
1363
|
+
revenue_by_currency: CurrencyRevenue[];
|
|
1364
|
+
unconverted_orders: number;
|
|
1338
1365
|
shops: ShopStats[];
|
|
1339
1366
|
}
|
|
1340
1367
|
interface ProjectStatsResponse {
|
|
1341
1368
|
projects: ProjectStats[];
|
|
1369
|
+
/**
|
|
1370
|
+
* Every shop of the merchant, including shops that belong to no project —
|
|
1371
|
+
* those never appear under `projects[].shops[]`, since projects are an
|
|
1372
|
+
* optional grouping layer. Look a single shop up here rather than walking
|
|
1373
|
+
* the project tree.
|
|
1374
|
+
*/
|
|
1375
|
+
shops: ShopStats[];
|
|
1342
1376
|
total_orders: number;
|
|
1377
|
+
/** @deprecated Cross-currency raw sum. Use `total_revenue_usd`. */
|
|
1343
1378
|
total_revenue: number;
|
|
1344
|
-
|
|
1379
|
+
total_revenue_usd: number;
|
|
1380
|
+
total_revenue_by_currency: CurrencyRevenue[];
|
|
1381
|
+
unconverted_orders: number;
|
|
1382
|
+
/** Window the figures cover, in days. `null` when `period: 'all'` was asked for. */
|
|
1383
|
+
period_days: number | null;
|
|
1384
|
+
}
|
|
1385
|
+
/** Stats for one shop, addressed by shop id. Loadable by a shop-scoped user. */
|
|
1386
|
+
interface ShopStatsResponse extends ShopStats {
|
|
1387
|
+
/** Window the figures cover, in days. `null` for an all-time total. */
|
|
1388
|
+
period_days: number | null;
|
|
1345
1389
|
}
|
|
1390
|
+
/**
|
|
1391
|
+
* Window for a stats query: a number of days (clamped 1..=365 server-side) or
|
|
1392
|
+
* `'all'` for an all-time total. Omitted means the server default, 30 days.
|
|
1393
|
+
*/
|
|
1394
|
+
type StatsPeriod = number | 'all';
|
|
1346
1395
|
interface MerchantOverviewStat {
|
|
1347
1396
|
label: string;
|
|
1348
1397
|
value: number;
|
|
@@ -1988,6 +2037,38 @@ interface UserSessionListResponse {
|
|
|
1988
2037
|
interface UserSessionRevokeResponse {
|
|
1989
2038
|
revoked: boolean;
|
|
1990
2039
|
}
|
|
2040
|
+
/** Optional query params for `GET /user/employees/list`. */
|
|
2041
|
+
interface ListUsersInLineageParams {
|
|
2042
|
+
/**
|
|
2043
|
+
* Lineage level to list members of: `'tenant'`, `'organization'`,
|
|
2044
|
+
* `'merchant'` or `'profile'`. Defaults to the widest level your role can
|
|
2045
|
+
* see.
|
|
2046
|
+
*/
|
|
2047
|
+
entity_type?: string;
|
|
2048
|
+
/**
|
|
2049
|
+
* Shop to list members of. Only meaningful together with
|
|
2050
|
+
* `entity_type: 'profile'`, and ignored otherwise. Send it when managing a
|
|
2051
|
+
* shop's team as a merchant-scoped admin: your token points at your own
|
|
2052
|
+
* shop, not the one you are viewing. Defaults to your own shop.
|
|
2053
|
+
*/
|
|
2054
|
+
profile_id?: string;
|
|
2055
|
+
}
|
|
2056
|
+
/** A role a member holds, as returned by `GET /user/employees/list`. */
|
|
2057
|
+
interface MinimalRoleInfo {
|
|
2058
|
+
role_id: string;
|
|
2059
|
+
role_name: string;
|
|
2060
|
+
}
|
|
2061
|
+
/** One member of the current lineage. `GET /user/employees/list` */
|
|
2062
|
+
interface UserInLineage {
|
|
2063
|
+
/**
|
|
2064
|
+
* Stable identifier of the member. Use it to target them specifically — for
|
|
2065
|
+
* a per-user operation-limit override, or to resolve a user id stamped on
|
|
2066
|
+
* another resource (such as a refund's `initiated_by`) back to a person.
|
|
2067
|
+
*/
|
|
2068
|
+
user_id: string;
|
|
2069
|
+
email: string;
|
|
2070
|
+
roles: MinimalRoleInfo[];
|
|
2071
|
+
}
|
|
1991
2072
|
/** Optional query params for `GET /user/role/list/invite`. */
|
|
1992
2073
|
interface ListInvitableRolesParams {
|
|
1993
2074
|
/**
|
|
@@ -3941,10 +4022,23 @@ declare class Projects {
|
|
|
3941
4022
|
/**
|
|
3942
4023
|
* Get aggregate payment statistics across all projects for a merchant.
|
|
3943
4024
|
*
|
|
4025
|
+
* The response's flat `shops[]` array holds every shop, including shops that
|
|
4026
|
+
* belong to no project — those are absent from `projects[].shops[]`, so look
|
|
4027
|
+
* a single shop up in `shops[]`. Requires `MerchantAccountRead`; a
|
|
4028
|
+
* shop-scoped user should call {@link Shops.stats} instead.
|
|
4029
|
+
*
|
|
3944
4030
|
* @param merchantId - The merchant account ID.
|
|
4031
|
+
* @param period - Window in days, or `'all'` for an all-time total.
|
|
4032
|
+
* Omitted means the server default of 30 days.
|
|
3945
4033
|
* @returns Project statistics.
|
|
4034
|
+
*
|
|
4035
|
+
* @example
|
|
4036
|
+
* ```typescript
|
|
4037
|
+
* const stats = await delopay.projects.stats('merch_123', 'all');
|
|
4038
|
+
* const shop = stats.shops.find((s) => s.shop_id === 'pro_1');
|
|
4039
|
+
* ```
|
|
3946
4040
|
*/
|
|
3947
|
-
stats(merchantId: string): Promise<ProjectStatsResponse>;
|
|
4041
|
+
stats(merchantId: string, period?: StatsPeriod): Promise<ProjectStatsResponse>;
|
|
3948
4042
|
/**
|
|
3949
4043
|
* Get a high-level overview (volume, counts, top connectors) for a merchant.
|
|
3950
4044
|
*
|
|
@@ -4331,6 +4425,30 @@ declare class Shops {
|
|
|
4331
4425
|
* @returns Array of shops.
|
|
4332
4426
|
*/
|
|
4333
4427
|
list(merchantId: string): Promise<ShopResponse[]>;
|
|
4428
|
+
/**
|
|
4429
|
+
* Successful-order count and revenue for one shop.
|
|
4430
|
+
*
|
|
4431
|
+
* Unlike `projects.stats()` this needs only `ProfileAccountRead`, so a
|
|
4432
|
+
* shop-scoped user can load it for their own shop; merchant-level users can
|
|
4433
|
+
* load any shop of their merchant.
|
|
4434
|
+
*
|
|
4435
|
+
* Revenue comes back FX-converted as `revenue_usd` (USD major units) plus a
|
|
4436
|
+
* `revenue_by_currency` breakdown. The legacy `revenue` field is a raw
|
|
4437
|
+
* cross-currency minor-unit sum and should not be displayed.
|
|
4438
|
+
*
|
|
4439
|
+
* @param merchantId - The merchant account ID.
|
|
4440
|
+
* @param shopId - The shop (business profile) ID.
|
|
4441
|
+
* @param period - Window in days, or `'all'` for an all-time total.
|
|
4442
|
+
* Omitted means the server default of 30 days.
|
|
4443
|
+
* @returns The shop's stats over the requested window.
|
|
4444
|
+
*
|
|
4445
|
+
* @example
|
|
4446
|
+
* ```typescript
|
|
4447
|
+
* const stats = await delopay.shops.stats('merch_123', 'pro_1', 'all');
|
|
4448
|
+
* console.log(stats.orders, stats.revenue_usd);
|
|
4449
|
+
* ```
|
|
4450
|
+
*/
|
|
4451
|
+
stats(merchantId: string, shopId: string, period?: StatsPeriod): Promise<ShopStatsResponse>;
|
|
4334
4452
|
/**
|
|
4335
4453
|
* Upload a logo file for a shop. The file is stored in Delopay's configured
|
|
4336
4454
|
* object store and a public HTTPS URL is returned. This method does NOT write
|
|
@@ -4585,9 +4703,7 @@ declare class Users {
|
|
|
4585
4703
|
/** Select auth method. `POST /user/auth/select` */
|
|
4586
4704
|
selectAuth(params: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
4587
4705
|
/** List users in lineage. `GET /user/employees/list` */
|
|
4588
|
-
listUsersInLineage(params?:
|
|
4589
|
-
entity_type?: string;
|
|
4590
|
-
}): Promise<Record<string, unknown>[]>;
|
|
4706
|
+
listUsersInLineage(params?: ListUsersInLineageParams): Promise<UserInLineage[]>;
|
|
4591
4707
|
/** Resend invite. `POST /user/resend-invite` */
|
|
4592
4708
|
resendInvite(params: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
4593
4709
|
/**
|
|
@@ -5467,4 +5583,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
|
|
|
5467
5583
|
declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
|
|
5468
5584
|
declare function shadowFor(style: SurfaceStyle): string;
|
|
5469
5585
|
|
|
5470
|
-
export { type AddUserRequest, type AddUserResponse, type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorSelection, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EuclidComparison, type EuclidComparisonType, type EuclidIfStatement, type EuclidValue, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, FeeProgramBuilder, type FeeRuleConditions, type FeeRuleInput, type FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type MethodSurcharge, type NonPillRadius, type OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentIdFormatConfig, type PaymentIdStyle, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PerMethodSurchargeItem, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PlatformFeeKind, type PlatformFeeOutput, type PlatformFeeProgram, type PlatformFeeRule, type PlatformFeeRuleInput, type PlatformFeeRuleOutput, type PlatformFeeRuleRecord, type PlatformFeeRuleRequest, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileDeniedConnectorsResponse, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProgramConnectorSelection, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, type RuleConnectorSelection, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurchargeRuleRequest, type SurchargeRuleResponse, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UpdateUserRoleRequest, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
|
|
5586
|
+
export { type AddUserRequest, type AddUserResponse, type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorSelection, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CurrencyRevenue, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EuclidComparison, type EuclidComparisonType, type EuclidIfStatement, type EuclidValue, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, FeeProgramBuilder, type FeeRuleConditions, type FeeRuleInput, type FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type ListUsersInLineageParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type MethodSurcharge, type MinimalRoleInfo, type NonPillRadius, type OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentIdFormatConfig, type PaymentIdStyle, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PerMethodSurchargeItem, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PlatformFeeKind, type PlatformFeeOutput, type PlatformFeeProgram, type PlatformFeeRule, type PlatformFeeRuleInput, type PlatformFeeRuleOutput, type PlatformFeeRuleRecord, type PlatformFeeRuleRequest, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileDeniedConnectorsResponse, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProgramConnectorSelection, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, type RuleConnectorSelection, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopStatsResponse, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StatsPeriod, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurchargeRuleRequest, type SurchargeRuleResponse, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UpdateUserRoleRequest, type UserInLineage, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -950,11 +950,34 @@ interface PaymentLinkBackgroundImageConfig {
|
|
|
950
950
|
position?: 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | null;
|
|
951
951
|
size?: 'cover' | 'contain' | 'auto' | null;
|
|
952
952
|
}
|
|
953
|
+
/** Revenue taken in one currency. Amounts are in that currency's minor units. */
|
|
954
|
+
interface CurrencyRevenue {
|
|
955
|
+
/** ISO 4217 code, e.g. `EUR`. */
|
|
956
|
+
currency: string;
|
|
957
|
+
amount_minor: number;
|
|
958
|
+
orders: number;
|
|
959
|
+
}
|
|
953
960
|
interface ShopStats {
|
|
954
961
|
shop_id: string;
|
|
955
962
|
shop_name: string;
|
|
963
|
+
/** Project the shop is grouped under, or `null` when unassigned. */
|
|
964
|
+
project_id: string | null;
|
|
956
965
|
orders: number;
|
|
966
|
+
/**
|
|
967
|
+
* @deprecated Raw sum of minor units across every currency, with no FX
|
|
968
|
+
* conversion — meaningless for a multi-currency shop. Use `revenue_usd`
|
|
969
|
+
* (FX-converted, USD **major** units) or `revenue_by_currency`.
|
|
970
|
+
*/
|
|
957
971
|
revenue: number;
|
|
972
|
+
/** FX-converted revenue in USD major units. Excludes `unconverted_orders`. */
|
|
973
|
+
revenue_usd: number;
|
|
974
|
+
/** Revenue split by the currency it was taken in, sorted by currency code. */
|
|
975
|
+
revenue_by_currency: CurrencyRevenue[];
|
|
976
|
+
/**
|
|
977
|
+
* Orders left out of `revenue_usd` because their currency had no fresh USD
|
|
978
|
+
* rate. Non-zero means the USD figure understates reality.
|
|
979
|
+
*/
|
|
980
|
+
unconverted_orders: number;
|
|
958
981
|
}
|
|
959
982
|
interface GatewayConnectRequest {
|
|
960
983
|
connector_type: ConnectorType;
|
|
@@ -1334,15 +1357,41 @@ interface ProjectStats {
|
|
|
1334
1357
|
project_id: string;
|
|
1335
1358
|
project_name: string;
|
|
1336
1359
|
orders: number;
|
|
1360
|
+
/** @deprecated Cross-currency raw sum. Use `revenue_usd` / `revenue_by_currency`. */
|
|
1337
1361
|
revenue: number;
|
|
1362
|
+
revenue_usd: number;
|
|
1363
|
+
revenue_by_currency: CurrencyRevenue[];
|
|
1364
|
+
unconverted_orders: number;
|
|
1338
1365
|
shops: ShopStats[];
|
|
1339
1366
|
}
|
|
1340
1367
|
interface ProjectStatsResponse {
|
|
1341
1368
|
projects: ProjectStats[];
|
|
1369
|
+
/**
|
|
1370
|
+
* Every shop of the merchant, including shops that belong to no project —
|
|
1371
|
+
* those never appear under `projects[].shops[]`, since projects are an
|
|
1372
|
+
* optional grouping layer. Look a single shop up here rather than walking
|
|
1373
|
+
* the project tree.
|
|
1374
|
+
*/
|
|
1375
|
+
shops: ShopStats[];
|
|
1342
1376
|
total_orders: number;
|
|
1377
|
+
/** @deprecated Cross-currency raw sum. Use `total_revenue_usd`. */
|
|
1343
1378
|
total_revenue: number;
|
|
1344
|
-
|
|
1379
|
+
total_revenue_usd: number;
|
|
1380
|
+
total_revenue_by_currency: CurrencyRevenue[];
|
|
1381
|
+
unconverted_orders: number;
|
|
1382
|
+
/** Window the figures cover, in days. `null` when `period: 'all'` was asked for. */
|
|
1383
|
+
period_days: number | null;
|
|
1384
|
+
}
|
|
1385
|
+
/** Stats for one shop, addressed by shop id. Loadable by a shop-scoped user. */
|
|
1386
|
+
interface ShopStatsResponse extends ShopStats {
|
|
1387
|
+
/** Window the figures cover, in days. `null` for an all-time total. */
|
|
1388
|
+
period_days: number | null;
|
|
1345
1389
|
}
|
|
1390
|
+
/**
|
|
1391
|
+
* Window for a stats query: a number of days (clamped 1..=365 server-side) or
|
|
1392
|
+
* `'all'` for an all-time total. Omitted means the server default, 30 days.
|
|
1393
|
+
*/
|
|
1394
|
+
type StatsPeriod = number | 'all';
|
|
1346
1395
|
interface MerchantOverviewStat {
|
|
1347
1396
|
label: string;
|
|
1348
1397
|
value: number;
|
|
@@ -1988,6 +2037,38 @@ interface UserSessionListResponse {
|
|
|
1988
2037
|
interface UserSessionRevokeResponse {
|
|
1989
2038
|
revoked: boolean;
|
|
1990
2039
|
}
|
|
2040
|
+
/** Optional query params for `GET /user/employees/list`. */
|
|
2041
|
+
interface ListUsersInLineageParams {
|
|
2042
|
+
/**
|
|
2043
|
+
* Lineage level to list members of: `'tenant'`, `'organization'`,
|
|
2044
|
+
* `'merchant'` or `'profile'`. Defaults to the widest level your role can
|
|
2045
|
+
* see.
|
|
2046
|
+
*/
|
|
2047
|
+
entity_type?: string;
|
|
2048
|
+
/**
|
|
2049
|
+
* Shop to list members of. Only meaningful together with
|
|
2050
|
+
* `entity_type: 'profile'`, and ignored otherwise. Send it when managing a
|
|
2051
|
+
* shop's team as a merchant-scoped admin: your token points at your own
|
|
2052
|
+
* shop, not the one you are viewing. Defaults to your own shop.
|
|
2053
|
+
*/
|
|
2054
|
+
profile_id?: string;
|
|
2055
|
+
}
|
|
2056
|
+
/** A role a member holds, as returned by `GET /user/employees/list`. */
|
|
2057
|
+
interface MinimalRoleInfo {
|
|
2058
|
+
role_id: string;
|
|
2059
|
+
role_name: string;
|
|
2060
|
+
}
|
|
2061
|
+
/** One member of the current lineage. `GET /user/employees/list` */
|
|
2062
|
+
interface UserInLineage {
|
|
2063
|
+
/**
|
|
2064
|
+
* Stable identifier of the member. Use it to target them specifically — for
|
|
2065
|
+
* a per-user operation-limit override, or to resolve a user id stamped on
|
|
2066
|
+
* another resource (such as a refund's `initiated_by`) back to a person.
|
|
2067
|
+
*/
|
|
2068
|
+
user_id: string;
|
|
2069
|
+
email: string;
|
|
2070
|
+
roles: MinimalRoleInfo[];
|
|
2071
|
+
}
|
|
1991
2072
|
/** Optional query params for `GET /user/role/list/invite`. */
|
|
1992
2073
|
interface ListInvitableRolesParams {
|
|
1993
2074
|
/**
|
|
@@ -3941,10 +4022,23 @@ declare class Projects {
|
|
|
3941
4022
|
/**
|
|
3942
4023
|
* Get aggregate payment statistics across all projects for a merchant.
|
|
3943
4024
|
*
|
|
4025
|
+
* The response's flat `shops[]` array holds every shop, including shops that
|
|
4026
|
+
* belong to no project — those are absent from `projects[].shops[]`, so look
|
|
4027
|
+
* a single shop up in `shops[]`. Requires `MerchantAccountRead`; a
|
|
4028
|
+
* shop-scoped user should call {@link Shops.stats} instead.
|
|
4029
|
+
*
|
|
3944
4030
|
* @param merchantId - The merchant account ID.
|
|
4031
|
+
* @param period - Window in days, or `'all'` for an all-time total.
|
|
4032
|
+
* Omitted means the server default of 30 days.
|
|
3945
4033
|
* @returns Project statistics.
|
|
4034
|
+
*
|
|
4035
|
+
* @example
|
|
4036
|
+
* ```typescript
|
|
4037
|
+
* const stats = await delopay.projects.stats('merch_123', 'all');
|
|
4038
|
+
* const shop = stats.shops.find((s) => s.shop_id === 'pro_1');
|
|
4039
|
+
* ```
|
|
3946
4040
|
*/
|
|
3947
|
-
stats(merchantId: string): Promise<ProjectStatsResponse>;
|
|
4041
|
+
stats(merchantId: string, period?: StatsPeriod): Promise<ProjectStatsResponse>;
|
|
3948
4042
|
/**
|
|
3949
4043
|
* Get a high-level overview (volume, counts, top connectors) for a merchant.
|
|
3950
4044
|
*
|
|
@@ -4331,6 +4425,30 @@ declare class Shops {
|
|
|
4331
4425
|
* @returns Array of shops.
|
|
4332
4426
|
*/
|
|
4333
4427
|
list(merchantId: string): Promise<ShopResponse[]>;
|
|
4428
|
+
/**
|
|
4429
|
+
* Successful-order count and revenue for one shop.
|
|
4430
|
+
*
|
|
4431
|
+
* Unlike `projects.stats()` this needs only `ProfileAccountRead`, so a
|
|
4432
|
+
* shop-scoped user can load it for their own shop; merchant-level users can
|
|
4433
|
+
* load any shop of their merchant.
|
|
4434
|
+
*
|
|
4435
|
+
* Revenue comes back FX-converted as `revenue_usd` (USD major units) plus a
|
|
4436
|
+
* `revenue_by_currency` breakdown. The legacy `revenue` field is a raw
|
|
4437
|
+
* cross-currency minor-unit sum and should not be displayed.
|
|
4438
|
+
*
|
|
4439
|
+
* @param merchantId - The merchant account ID.
|
|
4440
|
+
* @param shopId - The shop (business profile) ID.
|
|
4441
|
+
* @param period - Window in days, or `'all'` for an all-time total.
|
|
4442
|
+
* Omitted means the server default of 30 days.
|
|
4443
|
+
* @returns The shop's stats over the requested window.
|
|
4444
|
+
*
|
|
4445
|
+
* @example
|
|
4446
|
+
* ```typescript
|
|
4447
|
+
* const stats = await delopay.shops.stats('merch_123', 'pro_1', 'all');
|
|
4448
|
+
* console.log(stats.orders, stats.revenue_usd);
|
|
4449
|
+
* ```
|
|
4450
|
+
*/
|
|
4451
|
+
stats(merchantId: string, shopId: string, period?: StatsPeriod): Promise<ShopStatsResponse>;
|
|
4334
4452
|
/**
|
|
4335
4453
|
* Upload a logo file for a shop. The file is stored in Delopay's configured
|
|
4336
4454
|
* object store and a public HTTPS URL is returned. This method does NOT write
|
|
@@ -4585,9 +4703,7 @@ declare class Users {
|
|
|
4585
4703
|
/** Select auth method. `POST /user/auth/select` */
|
|
4586
4704
|
selectAuth(params: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
4587
4705
|
/** List users in lineage. `GET /user/employees/list` */
|
|
4588
|
-
listUsersInLineage(params?:
|
|
4589
|
-
entity_type?: string;
|
|
4590
|
-
}): Promise<Record<string, unknown>[]>;
|
|
4706
|
+
listUsersInLineage(params?: ListUsersInLineageParams): Promise<UserInLineage[]>;
|
|
4591
4707
|
/** Resend invite. `POST /user/resend-invite` */
|
|
4592
4708
|
resendInvite(params: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
4593
4709
|
/**
|
|
@@ -5467,4 +5583,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
|
|
|
5467
5583
|
declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
|
|
5468
5584
|
declare function shadowFor(style: SurfaceStyle): string;
|
|
5469
5585
|
|
|
5470
|
-
export { type AddUserRequest, type AddUserResponse, type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorSelection, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EuclidComparison, type EuclidComparisonType, type EuclidIfStatement, type EuclidValue, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, FeeProgramBuilder, type FeeRuleConditions, type FeeRuleInput, type FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type MethodSurcharge, type NonPillRadius, type OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentIdFormatConfig, type PaymentIdStyle, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PerMethodSurchargeItem, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PlatformFeeKind, type PlatformFeeOutput, type PlatformFeeProgram, type PlatformFeeRule, type PlatformFeeRuleInput, type PlatformFeeRuleOutput, type PlatformFeeRuleRecord, type PlatformFeeRuleRequest, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileDeniedConnectorsResponse, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProgramConnectorSelection, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, type RuleConnectorSelection, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurchargeRuleRequest, type SurchargeRuleResponse, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UpdateUserRoleRequest, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
|
|
5586
|
+
export { type AddUserRequest, type AddUserResponse, type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorSelection, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CurrencyRevenue, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EuclidComparison, type EuclidComparisonType, type EuclidIfStatement, type EuclidValue, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, FeeProgramBuilder, type FeeRuleConditions, type FeeRuleInput, type FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type ListUsersInLineageParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type MethodSurcharge, type MinimalRoleInfo, type NonPillRadius, type OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentIdFormatConfig, type PaymentIdStyle, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PerMethodSurchargeItem, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PlatformFeeKind, type PlatformFeeOutput, type PlatformFeeProgram, type PlatformFeeRule, type PlatformFeeRuleInput, type PlatformFeeRuleOutput, type PlatformFeeRuleRecord, type PlatformFeeRuleRequest, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileDeniedConnectorsResponse, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProgramConnectorSelection, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, type RuleConnectorSelection, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopStatsResponse, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StatsPeriod, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurchargeRuleRequest, type SurchargeRuleResponse, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UpdateUserRoleRequest, type UserInLineage, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
|
package/dist/index.js
CHANGED
package/dist/internal.cjs
CHANGED
|
@@ -1757,13 +1757,26 @@ var Projects = class {
|
|
|
1757
1757
|
/**
|
|
1758
1758
|
* Get aggregate payment statistics across all projects for a merchant.
|
|
1759
1759
|
*
|
|
1760
|
+
* The response's flat `shops[]` array holds every shop, including shops that
|
|
1761
|
+
* belong to no project — those are absent from `projects[].shops[]`, so look
|
|
1762
|
+
* a single shop up in `shops[]`. Requires `MerchantAccountRead`; a
|
|
1763
|
+
* shop-scoped user should call {@link Shops.stats} instead.
|
|
1764
|
+
*
|
|
1760
1765
|
* @param merchantId - The merchant account ID.
|
|
1766
|
+
* @param period - Window in days, or `'all'` for an all-time total.
|
|
1767
|
+
* Omitted means the server default of 30 days.
|
|
1761
1768
|
* @returns Project statistics.
|
|
1769
|
+
*
|
|
1770
|
+
* @example
|
|
1771
|
+
* ```typescript
|
|
1772
|
+
* const stats = await delopay.projects.stats('merch_123', 'all');
|
|
1773
|
+
* const shop = stats.shops.find((s) => s.shop_id === 'pro_1');
|
|
1774
|
+
* ```
|
|
1762
1775
|
*/
|
|
1763
|
-
async stats(merchantId) {
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
});
|
|
1776
|
+
async stats(merchantId, period) {
|
|
1777
|
+
const query = { merchant_id: merchantId };
|
|
1778
|
+
if (period !== void 0) query["period"] = String(period);
|
|
1779
|
+
return this.request("GET", "/projects/stats", { query });
|
|
1767
1780
|
}
|
|
1768
1781
|
/**
|
|
1769
1782
|
* Get a high-level overview (volume, counts, top connectors) for a merchant.
|
|
@@ -2247,6 +2260,34 @@ var Shops = class {
|
|
|
2247
2260
|
async list(merchantId) {
|
|
2248
2261
|
return this.request("GET", `/shops/${encodeURIComponent(merchantId)}`);
|
|
2249
2262
|
}
|
|
2263
|
+
/**
|
|
2264
|
+
* Successful-order count and revenue for one shop.
|
|
2265
|
+
*
|
|
2266
|
+
* Unlike `projects.stats()` this needs only `ProfileAccountRead`, so a
|
|
2267
|
+
* shop-scoped user can load it for their own shop; merchant-level users can
|
|
2268
|
+
* load any shop of their merchant.
|
|
2269
|
+
*
|
|
2270
|
+
* Revenue comes back FX-converted as `revenue_usd` (USD major units) plus a
|
|
2271
|
+
* `revenue_by_currency` breakdown. The legacy `revenue` field is a raw
|
|
2272
|
+
* cross-currency minor-unit sum and should not be displayed.
|
|
2273
|
+
*
|
|
2274
|
+
* @param merchantId - The merchant account ID.
|
|
2275
|
+
* @param shopId - The shop (business profile) ID.
|
|
2276
|
+
* @param period - Window in days, or `'all'` for an all-time total.
|
|
2277
|
+
* Omitted means the server default of 30 days.
|
|
2278
|
+
* @returns The shop's stats over the requested window.
|
|
2279
|
+
*
|
|
2280
|
+
* @example
|
|
2281
|
+
* ```typescript
|
|
2282
|
+
* const stats = await delopay.shops.stats('merch_123', 'pro_1', 'all');
|
|
2283
|
+
* console.log(stats.orders, stats.revenue_usd);
|
|
2284
|
+
* ```
|
|
2285
|
+
*/
|
|
2286
|
+
async stats(merchantId, shopId, period) {
|
|
2287
|
+
const path = `/shops/${encodeURIComponent(merchantId)}/${encodeURIComponent(shopId)}/stats`;
|
|
2288
|
+
if (period === void 0) return this.request("GET", path);
|
|
2289
|
+
return this.request("GET", path, { query: { period: String(period) } });
|
|
2290
|
+
}
|
|
2250
2291
|
/**
|
|
2251
2292
|
* Upload a logo file for a shop. The file is stored in Delopay's configured
|
|
2252
2293
|
* object store and a public HTTPS URL is returned. This method does NOT write
|