@delopay/sdk 0.38.0 → 0.40.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.
@@ -483,6 +483,57 @@ interface ConnectorRestrictionResponse {
483
483
  /** ISO 8601 datetime. */
484
484
  modified_at: string;
485
485
  }
486
+ /** Which level a restriction rule targets: a shop (business profile, the
487
+ * `scope_id` is a `profile_id`) or a project (a `project_id` grouping of
488
+ * shops, the `scope_id` is a `project_id`). */
489
+ type ConnectorRestrictionScope = 'profile' | 'project';
490
+ /** Whether a rule permits (whitelist) or forbids a connector for its scope.
491
+ * A `deny` is never routed even if the connector is attached and enabled;
492
+ * once a scope has any `allow` it becomes a whitelist. */
493
+ type ConnectorRestrictionRuleAction = 'allow' | 'deny';
494
+ /** Body for `POST /admin/connector-restriction-rules`. */
495
+ interface CreateConnectorRestrictionRuleRequest {
496
+ /** Merchant the rule belongs to. */
497
+ merchant_id: string;
498
+ /** Whether `scope_id` is a `profile_id` (shop) or a `project_id`. */
499
+ scope: ConnectorRestrictionScope;
500
+ /** The `profile_id` or `project_id` the rule targets. */
501
+ scope_id: string;
502
+ /** Connector name (snake_case, e.g. `'stripe'`). */
503
+ connector: string;
504
+ /** Permit (whitelist) or forbid this connector for the scope. */
505
+ action: ConnectorRestrictionRuleAction;
506
+ /** Optional audit note. */
507
+ reason?: string | null;
508
+ }
509
+ /** Body for `PATCH /admin/connector-restriction-rules/{id}`. Omitted fields
510
+ * are left unchanged. */
511
+ interface UpdateConnectorRestrictionRuleRequest {
512
+ action?: ConnectorRestrictionRuleAction;
513
+ reason?: string | null;
514
+ }
515
+ /** Query for `GET /admin/connector-restriction-rules`. Provide **either**
516
+ * `scope` + `scope_id` (one shop/project) **or** `merchant_id` (every rule
517
+ * for a merchant). */
518
+ interface ListConnectorRestrictionRulesQuery {
519
+ scope?: ConnectorRestrictionScope;
520
+ scope_id?: string;
521
+ merchant_id?: string;
522
+ }
523
+ /** One persisted per-shop/project connector restriction rule. */
524
+ interface ConnectorRestrictionRuleResponse {
525
+ id: string;
526
+ merchant_id: string;
527
+ scope: ConnectorRestrictionScope;
528
+ scope_id: string;
529
+ connector: string;
530
+ action: ConnectorRestrictionRuleAction;
531
+ reason: string | null;
532
+ /** ISO 8601 datetime. */
533
+ created_at: string;
534
+ /** ISO 8601 datetime. */
535
+ modified_at: string;
536
+ }
486
537
 
487
538
  declare class Admin {
488
539
  private readonly request;
@@ -613,6 +664,42 @@ declare class Configs {
613
664
  delete(key: string): Promise<Record<string, unknown>>;
614
665
  }
615
666
 
667
+ /**
668
+ * Per-shop / per-project connector restriction rules (epic #251).
669
+ *
670
+ * Distinct from `connectorRestrictions` (the merchant-tier attach gate):
671
+ * these rules allow/deny a connector for one shop (`scope: 'profile'`) or
672
+ * project (`scope: 'project'`) at routing time. A `deny` is never routed even
673
+ * when the connector is attached and enabled; once a scope has any `allow` it
674
+ * becomes a whitelist, and the project scope takes precedence over the shop
675
+ * scope. Admin-only, under `/admin/connector-restriction-rules`; exposed only
676
+ * via `'@delopay/sdk/internal'`.
677
+ */
678
+ declare class ConnectorRestrictionRules {
679
+ private readonly request;
680
+ constructor(request: RequestFn);
681
+ /**
682
+ * Create one allow/deny rule. A duplicate
683
+ * `(merchant_id, scope, scope_id, connector)` is rejected — update or delete
684
+ * the existing rule instead.
685
+ */
686
+ create(body: CreateConnectorRestrictionRuleRequest): Promise<ConnectorRestrictionRuleResponse>;
687
+ /**
688
+ * List rules for one scope (`scope` + `scope_id`) or a whole merchant
689
+ * (`merchant_id`). Pass exactly one selector.
690
+ */
691
+ list(query: ListConnectorRestrictionRulesQuery): Promise<ConnectorRestrictionRuleResponse[]>;
692
+ /** Retrieve a single rule by ID. */
693
+ retrieve(id: string): Promise<ConnectorRestrictionRuleResponse>;
694
+ /** Update a rule's action and/or reason. */
695
+ update(id: string, body: UpdateConnectorRestrictionRuleRequest): Promise<ConnectorRestrictionRuleResponse>;
696
+ /** Delete a rule by ID. */
697
+ delete(id: string): Promise<{
698
+ id: string;
699
+ deleted: boolean;
700
+ }>;
701
+ }
702
+
616
703
  /**
617
704
  * Admin-only allowlist for phased connector rollouts.
618
705
  *
@@ -729,19 +816,27 @@ declare class PlatformFees {
729
816
  delete(feeId: string): Promise<FeeScheduleResponse>;
730
817
  }
731
818
  /**
732
- * Manages a merchant's platform-owned Euclid fee-rule program (admin surface).
733
- * Build the `algorithm` with `feeProgram()`. The SDK injects
734
- * `fee_owner: 'platform'`.
819
+ * Manages a merchant's platform-owned Euclid fee-rule programs (admin surface),
820
+ * merchant-wide or per-shop (one active program per scope; a shop-scoped
821
+ * program wins for its shop, else the merchant-wide one applies). Build the
822
+ * `algorithm` with `feeProgram()`. The SDK injects `fee_owner: 'platform'`; set
823
+ * `profile_id` on the input to scope a program to a shop.
735
824
  */
736
825
  declare class PlatformFeeRulesManager {
737
826
  private readonly request;
738
827
  constructor(request: RequestFn);
739
828
  /** Create or replace the platform fee-rule program for a merchant. */
740
829
  upsert(params: PlatformFeeRuleInput, merchantId: string): Promise<PlatformFeeRuleRecord>;
741
- /** Retrieve the active platform fee-rule program for a merchant, or `null`. */
742
- retrieve(merchantId: string): Promise<PlatformFeeRuleRecord | null>;
743
- /** Deactivate the platform fee-rule program for a merchant. Idempotent. */
744
- delete(merchantId: string): Promise<void>;
830
+ /**
831
+ * Retrieve the active platform fee-rule program for a scope, or `null`.
832
+ * `profileId` omitted = merchant-wide program; set = that shop's program.
833
+ */
834
+ retrieve(merchantId: string, profileId?: string): Promise<PlatformFeeRuleRecord | null>;
835
+ /**
836
+ * Deactivate a platform fee-rule program. Idempotent. `profileId` omitted
837
+ * targets the merchant-wide program; set targets only that shop's program.
838
+ */
839
+ delete(merchantId: string, profileId?: string): Promise<void>;
745
840
  }
746
841
 
747
842
  /**
@@ -769,6 +864,8 @@ declare class DelopayInternal extends Delopay {
769
864
  readonly configs: Configs;
770
865
  /** Per-merchant connector allowlist for phased rollouts. */
771
866
  readonly connectorRestrictions: ConnectorRestrictions;
867
+ /** Per-shop / per-project connector allow-deny rules (routing-time). */
868
+ readonly connectorRestrictionRules: ConnectorRestrictionRules;
772
869
  /** GSM (Gateway Status Mapping) routing rules. */
773
870
  readonly gsm: Gsm;
774
871
  /** Admin-only ledger credits/debits against a merchant's balance. */
@@ -778,4 +875,4 @@ declare class DelopayInternal extends Delopay {
778
875
  constructor(...args: ConstructorParameters<typeof Delopay>);
779
876
  }
780
877
 
781
- export { Admin, type AdminAdjustmentRequest, type AdminAdjustmentResponse, type AdminAnalyticsRequest, type AdminCreateUserForMerchantRequest, type AdminCustomerDetail, type AdminCustomerListParams, type AdminCustomerListResponse, type AdminLedgerAnalyticsRequest, type AdminLedgerAnalyticsResponse, AdminPortal, type AdminSetTrustedRequest, type AdminSignInRequest, type AdminSuspendRequest, type AdminTransactionListParams, type AdminTransactionListResponse, type AdminUnsuspendRequest, type AdminUpdateUserRequest, type AdminUserResponse, AnalyticsScopeRequest, AnalyticsScopeResponse, type AuditLogListParams, type AuditLogListResponse, type AuditLogResponse, AuditLogs, AuthResponse, type AuthorizeResponse, BillingProfileResponse, Cache, type CardIssuerCreateRequest, type CardIssuerListResponse, type CardIssuerResponse, type CardIssuerUpdateRequest, CardIssuers, Configs, type ConnectorRestrictionResponse, ConnectorRestrictions, type ConnectorVisibility, type CreateInternalUserRequest, type CreateTenantUserRequest, type CustomerSummary, type CustomerUser, Delopay, DelopayInternal, FeeScheduleCreateRequest, FeeScheduleResponse, FeeScheduleUpdateRequest, Gsm, type GsmDecision, type GsmRuleCreateRequest, type GsmRuleResponse, type GsmRuleUpdateRequest, type LedgerDayBucket, type LedgerMerchant, MerchantAccountResponse, MerchantAccountUpdateRequest, type OnboardMerchantRequest, type OnboardMerchantResponse, type OverviewStat, type OverviewStatsResponse, type PaymentAnalyticsRequest, type PaymentAnalyticsResponse, type PaymentPeriodStats, PaymentResponse, type PlatformAnalyticsResponse, PlatformBilling, PlatformFeeRuleInput, PlatformFeeRuleRecord, PlatformFees, ProfileResponse, ProjectResponse, RequestFn, ShopResponse, SignUpWithMerchantIdRequest, type SignupToggleRequest, type SignupToggleResponse, type UpsertConnectorRestrictionRequest };
878
+ export { Admin, type AdminAdjustmentRequest, type AdminAdjustmentResponse, type AdminAnalyticsRequest, type AdminCreateUserForMerchantRequest, type AdminCustomerDetail, type AdminCustomerListParams, type AdminCustomerListResponse, type AdminLedgerAnalyticsRequest, type AdminLedgerAnalyticsResponse, AdminPortal, type AdminSetTrustedRequest, type AdminSignInRequest, type AdminSuspendRequest, type AdminTransactionListParams, type AdminTransactionListResponse, type AdminUnsuspendRequest, type AdminUpdateUserRequest, type AdminUserResponse, AnalyticsScopeRequest, AnalyticsScopeResponse, type AuditLogListParams, type AuditLogListResponse, type AuditLogResponse, AuditLogs, AuthResponse, type AuthorizeResponse, BillingProfileResponse, Cache, type CardIssuerCreateRequest, type CardIssuerListResponse, type CardIssuerResponse, type CardIssuerUpdateRequest, CardIssuers, Configs, type ConnectorRestrictionResponse, type ConnectorRestrictionRuleAction, type ConnectorRestrictionRuleResponse, ConnectorRestrictionRules, type ConnectorRestrictionScope, ConnectorRestrictions, type ConnectorVisibility, type CreateConnectorRestrictionRuleRequest, type CreateInternalUserRequest, type CreateTenantUserRequest, type CustomerSummary, type CustomerUser, Delopay, DelopayInternal, FeeScheduleCreateRequest, FeeScheduleResponse, FeeScheduleUpdateRequest, Gsm, type GsmDecision, type GsmRuleCreateRequest, type GsmRuleResponse, type GsmRuleUpdateRequest, type LedgerDayBucket, type LedgerMerchant, type ListConnectorRestrictionRulesQuery, MerchantAccountResponse, MerchantAccountUpdateRequest, type OnboardMerchantRequest, type OnboardMerchantResponse, type OverviewStat, type OverviewStatsResponse, type PaymentAnalyticsRequest, type PaymentAnalyticsResponse, type PaymentPeriodStats, PaymentResponse, type PlatformAnalyticsResponse, PlatformBilling, PlatformFeeRuleInput, PlatformFeeRuleRecord, PlatformFees, ProfileResponse, ProjectResponse, RequestFn, ShopResponse, SignUpWithMerchantIdRequest, type SignupToggleRequest, type SignupToggleResponse, type UpdateConnectorRestrictionRuleRequest, type UpsertConnectorRestrictionRequest };
@@ -483,6 +483,57 @@ interface ConnectorRestrictionResponse {
483
483
  /** ISO 8601 datetime. */
484
484
  modified_at: string;
485
485
  }
486
+ /** Which level a restriction rule targets: a shop (business profile, the
487
+ * `scope_id` is a `profile_id`) or a project (a `project_id` grouping of
488
+ * shops, the `scope_id` is a `project_id`). */
489
+ type ConnectorRestrictionScope = 'profile' | 'project';
490
+ /** Whether a rule permits (whitelist) or forbids a connector for its scope.
491
+ * A `deny` is never routed even if the connector is attached and enabled;
492
+ * once a scope has any `allow` it becomes a whitelist. */
493
+ type ConnectorRestrictionRuleAction = 'allow' | 'deny';
494
+ /** Body for `POST /admin/connector-restriction-rules`. */
495
+ interface CreateConnectorRestrictionRuleRequest {
496
+ /** Merchant the rule belongs to. */
497
+ merchant_id: string;
498
+ /** Whether `scope_id` is a `profile_id` (shop) or a `project_id`. */
499
+ scope: ConnectorRestrictionScope;
500
+ /** The `profile_id` or `project_id` the rule targets. */
501
+ scope_id: string;
502
+ /** Connector name (snake_case, e.g. `'stripe'`). */
503
+ connector: string;
504
+ /** Permit (whitelist) or forbid this connector for the scope. */
505
+ action: ConnectorRestrictionRuleAction;
506
+ /** Optional audit note. */
507
+ reason?: string | null;
508
+ }
509
+ /** Body for `PATCH /admin/connector-restriction-rules/{id}`. Omitted fields
510
+ * are left unchanged. */
511
+ interface UpdateConnectorRestrictionRuleRequest {
512
+ action?: ConnectorRestrictionRuleAction;
513
+ reason?: string | null;
514
+ }
515
+ /** Query for `GET /admin/connector-restriction-rules`. Provide **either**
516
+ * `scope` + `scope_id` (one shop/project) **or** `merchant_id` (every rule
517
+ * for a merchant). */
518
+ interface ListConnectorRestrictionRulesQuery {
519
+ scope?: ConnectorRestrictionScope;
520
+ scope_id?: string;
521
+ merchant_id?: string;
522
+ }
523
+ /** One persisted per-shop/project connector restriction rule. */
524
+ interface ConnectorRestrictionRuleResponse {
525
+ id: string;
526
+ merchant_id: string;
527
+ scope: ConnectorRestrictionScope;
528
+ scope_id: string;
529
+ connector: string;
530
+ action: ConnectorRestrictionRuleAction;
531
+ reason: string | null;
532
+ /** ISO 8601 datetime. */
533
+ created_at: string;
534
+ /** ISO 8601 datetime. */
535
+ modified_at: string;
536
+ }
486
537
 
487
538
  declare class Admin {
488
539
  private readonly request;
@@ -613,6 +664,42 @@ declare class Configs {
613
664
  delete(key: string): Promise<Record<string, unknown>>;
614
665
  }
615
666
 
667
+ /**
668
+ * Per-shop / per-project connector restriction rules (epic #251).
669
+ *
670
+ * Distinct from `connectorRestrictions` (the merchant-tier attach gate):
671
+ * these rules allow/deny a connector for one shop (`scope: 'profile'`) or
672
+ * project (`scope: 'project'`) at routing time. A `deny` is never routed even
673
+ * when the connector is attached and enabled; once a scope has any `allow` it
674
+ * becomes a whitelist, and the project scope takes precedence over the shop
675
+ * scope. Admin-only, under `/admin/connector-restriction-rules`; exposed only
676
+ * via `'@delopay/sdk/internal'`.
677
+ */
678
+ declare class ConnectorRestrictionRules {
679
+ private readonly request;
680
+ constructor(request: RequestFn);
681
+ /**
682
+ * Create one allow/deny rule. A duplicate
683
+ * `(merchant_id, scope, scope_id, connector)` is rejected — update or delete
684
+ * the existing rule instead.
685
+ */
686
+ create(body: CreateConnectorRestrictionRuleRequest): Promise<ConnectorRestrictionRuleResponse>;
687
+ /**
688
+ * List rules for one scope (`scope` + `scope_id`) or a whole merchant
689
+ * (`merchant_id`). Pass exactly one selector.
690
+ */
691
+ list(query: ListConnectorRestrictionRulesQuery): Promise<ConnectorRestrictionRuleResponse[]>;
692
+ /** Retrieve a single rule by ID. */
693
+ retrieve(id: string): Promise<ConnectorRestrictionRuleResponse>;
694
+ /** Update a rule's action and/or reason. */
695
+ update(id: string, body: UpdateConnectorRestrictionRuleRequest): Promise<ConnectorRestrictionRuleResponse>;
696
+ /** Delete a rule by ID. */
697
+ delete(id: string): Promise<{
698
+ id: string;
699
+ deleted: boolean;
700
+ }>;
701
+ }
702
+
616
703
  /**
617
704
  * Admin-only allowlist for phased connector rollouts.
618
705
  *
@@ -729,19 +816,27 @@ declare class PlatformFees {
729
816
  delete(feeId: string): Promise<FeeScheduleResponse>;
730
817
  }
731
818
  /**
732
- * Manages a merchant's platform-owned Euclid fee-rule program (admin surface).
733
- * Build the `algorithm` with `feeProgram()`. The SDK injects
734
- * `fee_owner: 'platform'`.
819
+ * Manages a merchant's platform-owned Euclid fee-rule programs (admin surface),
820
+ * merchant-wide or per-shop (one active program per scope; a shop-scoped
821
+ * program wins for its shop, else the merchant-wide one applies). Build the
822
+ * `algorithm` with `feeProgram()`. The SDK injects `fee_owner: 'platform'`; set
823
+ * `profile_id` on the input to scope a program to a shop.
735
824
  */
736
825
  declare class PlatformFeeRulesManager {
737
826
  private readonly request;
738
827
  constructor(request: RequestFn);
739
828
  /** Create or replace the platform fee-rule program for a merchant. */
740
829
  upsert(params: PlatformFeeRuleInput, merchantId: string): Promise<PlatformFeeRuleRecord>;
741
- /** Retrieve the active platform fee-rule program for a merchant, or `null`. */
742
- retrieve(merchantId: string): Promise<PlatformFeeRuleRecord | null>;
743
- /** Deactivate the platform fee-rule program for a merchant. Idempotent. */
744
- delete(merchantId: string): Promise<void>;
830
+ /**
831
+ * Retrieve the active platform fee-rule program for a scope, or `null`.
832
+ * `profileId` omitted = merchant-wide program; set = that shop's program.
833
+ */
834
+ retrieve(merchantId: string, profileId?: string): Promise<PlatformFeeRuleRecord | null>;
835
+ /**
836
+ * Deactivate a platform fee-rule program. Idempotent. `profileId` omitted
837
+ * targets the merchant-wide program; set targets only that shop's program.
838
+ */
839
+ delete(merchantId: string, profileId?: string): Promise<void>;
745
840
  }
746
841
 
747
842
  /**
@@ -769,6 +864,8 @@ declare class DelopayInternal extends Delopay {
769
864
  readonly configs: Configs;
770
865
  /** Per-merchant connector allowlist for phased rollouts. */
771
866
  readonly connectorRestrictions: ConnectorRestrictions;
867
+ /** Per-shop / per-project connector allow-deny rules (routing-time). */
868
+ readonly connectorRestrictionRules: ConnectorRestrictionRules;
772
869
  /** GSM (Gateway Status Mapping) routing rules. */
773
870
  readonly gsm: Gsm;
774
871
  /** Admin-only ledger credits/debits against a merchant's balance. */
@@ -778,4 +875,4 @@ declare class DelopayInternal extends Delopay {
778
875
  constructor(...args: ConstructorParameters<typeof Delopay>);
779
876
  }
780
877
 
781
- export { Admin, type AdminAdjustmentRequest, type AdminAdjustmentResponse, type AdminAnalyticsRequest, type AdminCreateUserForMerchantRequest, type AdminCustomerDetail, type AdminCustomerListParams, type AdminCustomerListResponse, type AdminLedgerAnalyticsRequest, type AdminLedgerAnalyticsResponse, AdminPortal, type AdminSetTrustedRequest, type AdminSignInRequest, type AdminSuspendRequest, type AdminTransactionListParams, type AdminTransactionListResponse, type AdminUnsuspendRequest, type AdminUpdateUserRequest, type AdminUserResponse, AnalyticsScopeRequest, AnalyticsScopeResponse, type AuditLogListParams, type AuditLogListResponse, type AuditLogResponse, AuditLogs, AuthResponse, type AuthorizeResponse, BillingProfileResponse, Cache, type CardIssuerCreateRequest, type CardIssuerListResponse, type CardIssuerResponse, type CardIssuerUpdateRequest, CardIssuers, Configs, type ConnectorRestrictionResponse, ConnectorRestrictions, type ConnectorVisibility, type CreateInternalUserRequest, type CreateTenantUserRequest, type CustomerSummary, type CustomerUser, Delopay, DelopayInternal, FeeScheduleCreateRequest, FeeScheduleResponse, FeeScheduleUpdateRequest, Gsm, type GsmDecision, type GsmRuleCreateRequest, type GsmRuleResponse, type GsmRuleUpdateRequest, type LedgerDayBucket, type LedgerMerchant, MerchantAccountResponse, MerchantAccountUpdateRequest, type OnboardMerchantRequest, type OnboardMerchantResponse, type OverviewStat, type OverviewStatsResponse, type PaymentAnalyticsRequest, type PaymentAnalyticsResponse, type PaymentPeriodStats, PaymentResponse, type PlatformAnalyticsResponse, PlatformBilling, PlatformFeeRuleInput, PlatformFeeRuleRecord, PlatformFees, ProfileResponse, ProjectResponse, RequestFn, ShopResponse, SignUpWithMerchantIdRequest, type SignupToggleRequest, type SignupToggleResponse, type UpsertConnectorRestrictionRequest };
878
+ export { Admin, type AdminAdjustmentRequest, type AdminAdjustmentResponse, type AdminAnalyticsRequest, type AdminCreateUserForMerchantRequest, type AdminCustomerDetail, type AdminCustomerListParams, type AdminCustomerListResponse, type AdminLedgerAnalyticsRequest, type AdminLedgerAnalyticsResponse, AdminPortal, type AdminSetTrustedRequest, type AdminSignInRequest, type AdminSuspendRequest, type AdminTransactionListParams, type AdminTransactionListResponse, type AdminUnsuspendRequest, type AdminUpdateUserRequest, type AdminUserResponse, AnalyticsScopeRequest, AnalyticsScopeResponse, type AuditLogListParams, type AuditLogListResponse, type AuditLogResponse, AuditLogs, AuthResponse, type AuthorizeResponse, BillingProfileResponse, Cache, type CardIssuerCreateRequest, type CardIssuerListResponse, type CardIssuerResponse, type CardIssuerUpdateRequest, CardIssuers, Configs, type ConnectorRestrictionResponse, type ConnectorRestrictionRuleAction, type ConnectorRestrictionRuleResponse, ConnectorRestrictionRules, type ConnectorRestrictionScope, ConnectorRestrictions, type ConnectorVisibility, type CreateConnectorRestrictionRuleRequest, type CreateInternalUserRequest, type CreateTenantUserRequest, type CustomerSummary, type CustomerUser, Delopay, DelopayInternal, FeeScheduleCreateRequest, FeeScheduleResponse, FeeScheduleUpdateRequest, Gsm, type GsmDecision, type GsmRuleCreateRequest, type GsmRuleResponse, type GsmRuleUpdateRequest, type LedgerDayBucket, type LedgerMerchant, type ListConnectorRestrictionRulesQuery, MerchantAccountResponse, MerchantAccountUpdateRequest, type OnboardMerchantRequest, type OnboardMerchantResponse, type OverviewStat, type OverviewStatsResponse, type PaymentAnalyticsRequest, type PaymentAnalyticsResponse, type PaymentPeriodStats, PaymentResponse, type PlatformAnalyticsResponse, PlatformBilling, PlatformFeeRuleInput, PlatformFeeRuleRecord, PlatformFees, ProfileResponse, ProjectResponse, RequestFn, ShopResponse, SignUpWithMerchantIdRequest, type SignupToggleRequest, type SignupToggleResponse, type UpdateConnectorRestrictionRuleRequest, type UpsertConnectorRestrictionRequest };
package/dist/internal.js CHANGED
@@ -43,7 +43,7 @@ import {
43
43
  shadowFor,
44
44
  surfacePadValue,
45
45
  verticalGapValue
46
- } from "./chunk-IQKFNKHU.js";
46
+ } from "./chunk-JAO3KHIM.js";
47
47
 
48
48
  // src/internal/resources/admin.ts
49
49
  var Admin = class {
@@ -272,6 +272,41 @@ var Configs = class {
272
272
  }
273
273
  };
274
274
 
275
+ // src/internal/resources/connectorRestrictionRules.ts
276
+ var BASE = "/admin/connector-restriction-rules";
277
+ var ConnectorRestrictionRules = class {
278
+ constructor(request) {
279
+ this.request = request;
280
+ }
281
+ /**
282
+ * Create one allow/deny rule. A duplicate
283
+ * `(merchant_id, scope, scope_id, connector)` is rejected — update or delete
284
+ * the existing rule instead.
285
+ */
286
+ async create(body) {
287
+ return this.request("POST", BASE, { body });
288
+ }
289
+ /**
290
+ * List rules for one scope (`scope` + `scope_id`) or a whole merchant
291
+ * (`merchant_id`). Pass exactly one selector.
292
+ */
293
+ async list(query) {
294
+ return this.request("GET", BASE, { query: { ...query } });
295
+ }
296
+ /** Retrieve a single rule by ID. */
297
+ async retrieve(id) {
298
+ return this.request("GET", `${BASE}/${encodeURIComponent(id)}`);
299
+ }
300
+ /** Update a rule's action and/or reason. */
301
+ async update(id, body) {
302
+ return this.request("PATCH", `${BASE}/${encodeURIComponent(id)}`, { body });
303
+ }
304
+ /** Delete a rule by ID. */
305
+ async delete(id) {
306
+ return this.request("DELETE", `${BASE}/${encodeURIComponent(id)}`);
307
+ }
308
+ };
309
+
275
310
  // src/internal/resources/connectorRestrictions.ts
276
311
  var ConnectorRestrictions = class {
277
312
  constructor(request) {
@@ -438,16 +473,22 @@ var PlatformFeeRulesManager = class {
438
473
  query: { merchant_id: merchantId }
439
474
  });
440
475
  }
441
- /** Retrieve the active platform fee-rule program for a merchant, or `null`. */
442
- async retrieve(merchantId) {
476
+ /**
477
+ * Retrieve the active platform fee-rule program for a scope, or `null`.
478
+ * `profileId` omitted = merchant-wide program; set = that shop's program.
479
+ */
480
+ async retrieve(merchantId, profileId) {
443
481
  return this.request("GET", "/admin/fees/rules", {
444
- query: { merchant_id: merchantId }
482
+ query: { merchant_id: merchantId, profile_id: profileId }
445
483
  });
446
484
  }
447
- /** Deactivate the platform fee-rule program for a merchant. Idempotent. */
448
- async delete(merchantId) {
485
+ /**
486
+ * Deactivate a platform fee-rule program. Idempotent. `profileId` omitted
487
+ * targets the merchant-wide program; set targets only that shop's program.
488
+ */
489
+ async delete(merchantId, profileId) {
449
490
  await this.request("DELETE", "/admin/fees/rules", {
450
- query: { merchant_id: merchantId }
491
+ query: { merchant_id: merchantId, profile_id: profileId }
451
492
  });
452
493
  }
453
494
  };
@@ -464,6 +505,7 @@ var DelopayInternal = class extends Delopay {
464
505
  this.cardIssuers = new CardIssuers(request);
465
506
  this.configs = new Configs(request);
466
507
  this.connectorRestrictions = new ConnectorRestrictions(request);
508
+ this.connectorRestrictionRules = new ConnectorRestrictionRules(request);
467
509
  this.gsm = new Gsm(request);
468
510
  this.platformBilling = new PlatformBilling(request);
469
511
  this.platformFees = new PlatformFees(request);
@@ -482,6 +524,7 @@ export {
482
524
  CardIssuers,
483
525
  Cards,
484
526
  Configs,
527
+ ConnectorRestrictionRules,
485
528
  ConnectorRestrictions,
486
529
  DEFAULT_BADGES,
487
530
  DEFAULT_BADGES_DARK,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/internal/resources/admin.ts","../src/internal/resources/adminPortal.ts","../src/internal/resources/auditLogs.ts","../src/internal/resources/cache.ts","../src/internal/resources/cardIssuers.ts","../src/internal/resources/configs.ts","../src/internal/resources/connectorRestrictions.ts","../src/internal/resources/gsm.ts","../src/internal/resources/platformBilling.ts","../src/internal/resources/platformFees.ts","../src/internal/client.ts"],"sourcesContent":["import type { AuthResponse, SignUpWithMerchantIdRequest } from '../../types';\nimport type {\n AdminSignInRequest,\n AuthorizeResponse,\n CreateInternalUserRequest,\n CreateTenantUserRequest,\n OnboardMerchantRequest,\n OnboardMerchantResponse,\n SignupToggleRequest,\n SignupToggleResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class Admin {\n constructor(private readonly request: RequestFn) {}\n\n async signIn(params: AdminSignInRequest): Promise<AuthResponse> {\n return this.request('POST', '/admin/signin', { body: params });\n }\n\n async createInternalUser(params: CreateInternalUserRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/internal-signup', { body: params });\n }\n\n async createTenant(params: CreateTenantUserRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/tenant-signup', { body: params });\n }\n\n /**\n * Create a new merchant admin user and merchant account atomically.\n *\n * This is the correct endpoint for bootstrapping the first admin user in a\n * fresh deployment — `internal-signup`/`tenant-signup` both require\n * pre-existing merchant records that don't exist on a clean database.\n *\n * `POST /admin/signup-with-merchant-id`\n */\n async signupWithMerchantId(params: SignUpWithMerchantIdRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/signup-with-merchant-id', { body: params });\n }\n\n /** Toggle public signup on/off. `POST /admin/settings/signup` */\n async setSignupSettings(params: SignupToggleRequest): Promise<SignupToggleResponse> {\n return this.request('POST', '/admin/settings/signup', { body: params });\n }\n\n /** Read current public-signup status. `GET /admin/settings/signup` */\n async getSignupSettings(): Promise<SignupToggleResponse> {\n return this.request('GET', '/admin/settings/signup');\n }\n\n /** Full merchant bootstrap — user + merchant + project + profile + keys. `POST /admin/onboard-merchant` */\n async onboardMerchant(params: OnboardMerchantRequest): Promise<OnboardMerchantResponse> {\n return this.request('POST', '/admin/onboard-merchant', { body: params });\n }\n}\n","import type {\n MerchantAccountResponse,\n MerchantAccountUpdateRequest,\n ProfileResponse,\n} from '../../types';\nimport type {\n AdminCustomerListParams,\n AdminCustomerListResponse,\n AdminCustomerDetail,\n AdminTransactionListParams,\n AdminTransactionListResponse,\n AdminAnalyticsRequest,\n PlatformAnalyticsResponse,\n OverviewStatsResponse,\n PaymentAnalyticsRequest,\n PaymentAnalyticsResponse,\n AnalyticsScopeRequest,\n AnalyticsScopeResponse,\n AdminLedgerAnalyticsRequest,\n AdminLedgerAnalyticsResponse,\n AdminCreateUserForMerchantRequest,\n AdminUpdateUserRequest,\n AdminUserResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class AdminPortal {\n constructor(private readonly request: RequestFn) {}\n\n async listCustomers(params?: AdminCustomerListParams): Promise<AdminCustomerListResponse> {\n return this.request('GET', '/admin-portal/customers', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async getCustomer(customerId: string): Promise<AdminCustomerDetail> {\n return this.request('GET', `/admin-portal/customers/${encodeURIComponent(customerId)}`);\n }\n\n async listTransactions(\n params?: AdminTransactionListParams,\n ): Promise<AdminTransactionListResponse> {\n return this.request('GET', '/admin-portal/transactions', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async analytics(params: AdminAnalyticsRequest): Promise<PlatformAnalyticsResponse> {\n return this.request('GET', '/admin-portal/analytics', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async overviewStats(): Promise<OverviewStatsResponse> {\n return this.request('GET', '/admin-portal/overview-stats');\n }\n\n async paymentAnalytics(params: PaymentAnalyticsRequest): Promise<PaymentAnalyticsResponse> {\n return this.request('GET', '/admin-portal/payment-analytics', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * One drill level of the analytics dashboard: the scope's daily series +\n * processor mix and its direct children's series. Range / metric / donut\n * toggles apply client-side; only a drill (passing merchant_id / project_id\n * / shop_id) fetches the next level.\n */\n async analyticsScope(params?: AnalyticsScopeRequest): Promise<AnalyticsScopeResponse> {\n return this.request('GET', '/admin-portal/analytics/scope', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Platform billing dashboard: total balance across all ledger accounts (+\n * the net change), top-ups, fees collected, and the day-by-day ledger flow.\n * All amounts are in USD minor units.\n */\n async ledgerAnalytics(\n params?: AdminLedgerAnalyticsRequest,\n ): Promise<AdminLedgerAnalyticsResponse> {\n return this.request('GET', '/admin-portal/ledger-analytics', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Retrieve a merchant account via the admin portal. Unlike\n * `merchantAccounts.retrieve`, this route accepts an admin JWT (or admin API\n * key) and does not require the JWT to be scoped to the target merchant.\n */\n async retrieveAccount(merchantId: string): Promise<MerchantAccountResponse> {\n return this.request('GET', `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);\n }\n\n /**\n * Update a merchant account via the admin portal. Authenticated via admin JWT\n * or admin API key.\n */\n async updateAccount(\n merchantId: string,\n params: MerchantAccountUpdateRequest,\n ): Promise<MerchantAccountResponse> {\n return this.request('POST', `/admin-portal/accounts/${encodeURIComponent(merchantId)}`, {\n body: params,\n });\n }\n\n /**\n * Delete a merchant account via the admin portal. Authenticated via admin JWT\n * or admin API key.\n */\n async deleteAccount(merchantId: string): Promise<MerchantAccountResponse> {\n return this.request('DELETE', `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);\n }\n\n /**\n * Create a brand-new user attached to the given merchant. The user is\n * marked `is_verified = true` so the admin can hand off credentials\n * immediately — no email round-trip is sent.\n */\n async createUserForMerchant(\n customerId: string,\n body: AdminCreateUserForMerchantRequest,\n ): Promise<AdminUserResponse> {\n return this.request('POST', `/admin-portal/customers/${encodeURIComponent(customerId)}/users`, {\n body,\n });\n }\n\n /**\n * Edit a user record. Any subset of fields may be supplied. `role_id`\n * requires `merchant_id`. `password` triggers a password reset (validated\n * against signup policy + JWT blacklist). `reset_2fa` clears TOTP state\n * so the user re-enrolls on next login. `is_active` supports both\n * directions: false soft-disables, true reactivates a soft-disabled user.\n */\n async updateUser(userId: string, body: AdminUpdateUserRequest): Promise<AdminUserResponse> {\n return this.request('PATCH', `/admin-portal/users/${encodeURIComponent(userId)}`, { body });\n }\n\n /**\n * Soft-delete a user globally: deactivates the row, blacklists existing\n * JWTs, and wipes credentials. Distinct from `deleteUserRole`, which\n * removes a single role binding while leaving the user signed-in elsewhere.\n */\n async deleteUser(userId: string): Promise<void> {\n return this.request('DELETE', `/admin-portal/users/${encodeURIComponent(userId)}`);\n }\n\n /**\n * Set a target merchant's shop iframe-allowed origins. Internal-admin\n * route — accepts an admin JWT or admin API key without requiring the\n * caller to be scoped to the target merchant. Pass `null` (or an empty\n * array) to clear the allowlist back to same-origin only.\n *\n * Server validates each origin: full origin (scheme + host[:port]),\n * no path/query/fragment, no wildcards.\n */\n async updateShopIframeOrigins(\n merchantId: string,\n profileId: string,\n origins: string[] | null,\n ): Promise<ProfileResponse> {\n return this.request(\n 'POST',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/business_profile/${encodeURIComponent(profileId)}/iframe-origins`,\n { body: { iframe_allowed_origins: origins } },\n );\n }\n}\n","import type { AuditLogListParams, AuditLogListResponse, AuditLogResponse } from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class AuditLogs {\n constructor(private readonly request: RequestFn) {}\n\n async list(params?: AuditLogListParams): Promise<AuditLogListResponse> {\n return this.request('GET', '/admin-portal/audit', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async retrieve(logId: string): Promise<AuditLogResponse> {\n return this.request('GET', `/admin-portal/audit/${encodeURIComponent(logId)}`);\n }\n}\n","import type { RequestFn } from '../../client';\n\nexport class Cache {\n constructor(private readonly request: RequestFn) {}\n\n /** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */\n async invalidate(key: string): Promise<Record<string, unknown>> {\n return this.request('POST', `/cache/invalidate/${encodeURIComponent(key)}`);\n }\n}\n","import type {\n CardIssuerCreateRequest,\n CardIssuerResponse,\n CardIssuerUpdateRequest,\n CardIssuerListResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class CardIssuers {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: CardIssuerCreateRequest): Promise<CardIssuerResponse> {\n return this.request('POST', '/card-issuers', { body: params });\n }\n\n async update(issuerId: string, params: CardIssuerUpdateRequest): Promise<CardIssuerResponse> {\n return this.request('PUT', `/card-issuers/${encodeURIComponent(issuerId)}`, { body: params });\n }\n\n async list(): Promise<CardIssuerListResponse> {\n return this.request('GET', '/card-issuers');\n }\n}\n","import type { RequestFn } from '../../client';\n\nexport class Configs {\n constructor(private readonly request: RequestFn) {}\n\n /** Create a config. `POST /configs` */\n async create(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/configs', { body: params });\n }\n\n /** Retrieve a config by key. `GET /configs/{key}` */\n async retrieve(key: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/configs/${encodeURIComponent(key)}`);\n }\n\n /** Update a config. `PUT /configs/{key}` */\n async update(key: string, params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('PUT', `/configs/${encodeURIComponent(key)}`, { body: params });\n }\n\n /** Delete a config. `DELETE /configs/{key}` */\n async delete(key: string): Promise<Record<string, unknown>> {\n return this.request('DELETE', `/configs/${encodeURIComponent(key)}`);\n }\n}\n","import type { ConnectorRestrictionResponse, UpsertConnectorRestrictionRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Admin-only allowlist for phased connector rollouts.\n *\n * Default-open semantics: a connector with no restriction row is\n * usable by every merchant (current behavior). A connector with a\n * row is gated — only merchants in `allowed_merchant_ids` can attach\n * a connector account. Enforced server-side at MCA-create time.\n */\nexport class ConnectorRestrictions {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Idempotent upsert. If a row exists for `connector_name`, its\n * allowlist + reason are replaced. To open the connector to\n * everyone again, call `delete()`.\n */\n async upsert(body: UpsertConnectorRestrictionRequest): Promise<ConnectorRestrictionResponse> {\n return this.request('POST', '/admin/connector-restrictions', { body });\n }\n\n async list(): Promise<ConnectorRestrictionResponse[]> {\n return this.request('GET', '/admin/connector-restrictions');\n }\n\n async retrieve(connectorName: string): Promise<ConnectorRestrictionResponse> {\n return this.request(\n 'GET',\n `/admin/connector-restrictions/${encodeURIComponent(connectorName)}`,\n );\n }\n\n /** Removing the row makes the connector public again. */\n async delete(connectorName: string): Promise<{ connector_name: string; deleted: boolean }> {\n return this.request(\n 'DELETE',\n `/admin/connector-restrictions/${encodeURIComponent(connectorName)}`,\n );\n }\n}\n","import type { GsmRuleCreateRequest, GsmRuleResponse, GsmRuleUpdateRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class Gsm {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: GsmRuleCreateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm', { body: params });\n }\n\n async retrieve(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/get', { body: params });\n }\n\n async update(params: GsmRuleUpdateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/update', { body: params });\n }\n\n async delete(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/delete', { body: params });\n }\n}\n","import type {\n AdminAdjustmentRequest,\n AdminAdjustmentResponse,\n AdminSuspendRequest,\n AdminUnsuspendRequest,\n AdminSetTrustedRequest,\n} from '../types';\nimport type { BillingProfileResponse } from '../../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Platform-level ledger adjustments on a merchant's balance. Admin-only\n * routes under `/billing/{merchantId}/admin/credit|debit`. Exposed only\n * via `'@delopay/sdk/internal'` so the public merchant SDK doesn't\n * advertise the admin adjustment path in autocomplete.\n */\nexport class PlatformBilling {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Manually credit a merchant's balance (e.g. promotional credit,\n * dispute reversal, manual correction).\n *\n * @param merchantId - The merchant account ID.\n * @param params - Credit amount and reason.\n */\n async credit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/credit`, {\n body: params,\n });\n }\n\n /**\n * Manually debit a merchant's balance.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Debit amount and reason.\n */\n async debit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/debit`, {\n body: params,\n });\n }\n\n /**\n * Manually suspend a merchant (e.g. confirmed fraud or ToS violation),\n * independent of balance. A `reason` is required for audit. Throws 412 if\n * the merchant is trusted (clear the flag first) or already suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Suspension reason.\n * @returns The updated billing profile.\n */\n async suspend(merchantId: string, params: AdminSuspendRequest): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/suspend`, {\n body: params,\n });\n }\n\n /**\n * Lift a suspension. Restores the merchant to `active` (or `delinquent` if\n * the balance is at/below the hard floor) and resets the recharge-failure\n * counter. Throws 412 if the merchant is not suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional audit note.\n * @returns The updated billing profile.\n */\n async unsuspend(\n merchantId: string,\n params: AdminUnsuspendRequest = {},\n ): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/unsuspend`, {\n body: params,\n });\n }\n\n /**\n * Set or clear the trusted (suspension-exempt) flag. Trusted merchants\n * cannot be suspended automatically or manually. Does not lift an existing\n * suspension — use {@link PlatformBilling.unsuspend} for that.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The desired trusted state.\n * @returns The updated billing profile.\n */\n async setTrusted(\n merchantId: string,\n params: AdminSetTrustedRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/trusted`, {\n body: params,\n });\n }\n}\n","import type {\n FeeScheduleCreateRequest,\n FeeScheduleResponse,\n FeeScheduleUpdateRequest,\n PlatformFeeRuleInput,\n PlatformFeeRuleRecord,\n PlatformFeeRuleRequest,\n} from '../../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Platform-wide fee schedule management. Admin-only routes under\n * `/admin/fees/*`. Exposed only via `'@delopay/sdk/internal'`.\n *\n * `platformFees.rules` manages the platform-owned Euclid fee-rule program per\n * merchant, which takes precedence over the flat platform schedules. Build the\n * program with `feeProgram()`.\n */\nexport class PlatformFees {\n /** Platform-owned Euclid fee-rule program (`/admin/fees/rules`). */\n readonly rules: PlatformFeeRulesManager;\n\n constructor(private readonly request: RequestFn) {\n this.rules = new PlatformFeeRulesManager(request);\n }\n\n /** Create a platform fee schedule for a specific merchant. */\n async create(params: FeeScheduleCreateRequest, merchantId: string): Promise<FeeScheduleResponse> {\n return this.request('POST', '/admin/fees', {\n body: params,\n query: { merchant_id: merchantId },\n });\n }\n\n /** List every platform fee schedule assigned to a merchant. */\n async list(merchantId: string): Promise<FeeScheduleResponse[]> {\n return this.request('GET', '/admin/fees/list', {\n query: { merchant_id: merchantId },\n });\n }\n\n /** Retrieve a single platform fee schedule by ID. */\n async retrieve(feeId: string): Promise<FeeScheduleResponse> {\n return this.request('GET', `/admin/fees/${encodeURIComponent(feeId)}`);\n }\n\n /** Update a platform fee schedule. */\n async update(feeId: string, params: FeeScheduleUpdateRequest): Promise<FeeScheduleResponse> {\n return this.request('PUT', `/admin/fees/${encodeURIComponent(feeId)}`, { body: params });\n }\n\n /** Delete a platform fee schedule. */\n async delete(feeId: string): Promise<FeeScheduleResponse> {\n return this.request('DELETE', `/admin/fees/${encodeURIComponent(feeId)}`);\n }\n}\n\n/**\n * Manages a merchant's platform-owned Euclid fee-rule program (admin surface).\n * Build the `algorithm` with `feeProgram()`. The SDK injects\n * `fee_owner: 'platform'`.\n */\nexport class PlatformFeeRulesManager {\n constructor(private readonly request: RequestFn) {}\n\n /** Create or replace the platform fee-rule program for a merchant. */\n async upsert(params: PlatformFeeRuleInput, merchantId: string): Promise<PlatformFeeRuleRecord> {\n const body: PlatformFeeRuleRequest = { ...params, fee_owner: 'platform' };\n return this.request('PUT', '/admin/fees/rules', {\n body,\n query: { merchant_id: merchantId },\n });\n }\n\n /** Retrieve the active platform fee-rule program for a merchant, or `null`. */\n async retrieve(merchantId: string): Promise<PlatformFeeRuleRecord | null> {\n return this.request('GET', '/admin/fees/rules', {\n query: { merchant_id: merchantId },\n });\n }\n\n /** Deactivate the platform fee-rule program for a merchant. Idempotent. */\n async delete(merchantId: string): Promise<void> {\n await this.request('DELETE', '/admin/fees/rules', {\n query: { merchant_id: merchantId },\n });\n }\n}\n","import type { RequestFn } from '../client';\nimport { Delopay } from '../client';\nimport { Admin } from './resources/admin';\nimport { AdminPortal } from './resources/adminPortal';\nimport { AuditLogs } from './resources/auditLogs';\nimport { Cache } from './resources/cache';\nimport { CardIssuers } from './resources/cardIssuers';\nimport { Configs } from './resources/configs';\nimport { ConnectorRestrictions } from './resources/connectorRestrictions';\nimport { Gsm } from './resources/gsm';\nimport { PlatformBilling } from './resources/platformBilling';\nimport { PlatformFees } from './resources/platformFees';\n\n/**\n * Internal-only Delopay client for DeloPay staff tooling (the admin\n * control-center, audit UIs, etc.). Extends the public `Delopay` surface\n * with admin-plane resources that must **not** be discoverable from the\n * merchant-facing package entry.\n *\n * Import path: `import { DelopayInternal } from '@delopay/sdk/internal'`.\n * The merchant-facing `import { Delopay } from '@delopay/sdk'` never\n * surfaces these.\n */\nexport class DelopayInternal extends Delopay {\n /** Bootstrap admin endpoints — signup, signin, onboarding. */\n readonly admin: Admin;\n /** Platform-wide customer, transaction, analytics, merchant-account ops. */\n readonly adminPortal: AdminPortal;\n /** Audit log reads. */\n readonly auditLogs: AuditLogs;\n /** Backend cache invalidation. */\n readonly cache: Cache;\n /** Platform card-issuer program management. */\n readonly cardIssuers: CardIssuers;\n /** Generic platform config store. */\n readonly configs: Configs;\n /** Per-merchant connector allowlist for phased rollouts. */\n readonly connectorRestrictions: ConnectorRestrictions;\n /** GSM (Gateway Status Mapping) routing rules. */\n readonly gsm: Gsm;\n /** Admin-only ledger credits/debits against a merchant's balance. */\n readonly platformBilling: PlatformBilling;\n /** Platform-wide fee schedules assigned to merchants. */\n readonly platformFees: PlatformFees;\n\n constructor(...args: ConstructorParameters<typeof Delopay>) {\n super(...args);\n const request = this.request.bind(this) as RequestFn;\n this.admin = new Admin(request);\n this.adminPortal = new AdminPortal(request);\n this.auditLogs = new AuditLogs(request);\n this.cache = new Cache(request);\n this.cardIssuers = new CardIssuers(request);\n this.configs = new Configs(request);\n this.connectorRestrictions = new ConnectorRestrictions(request);\n this.gsm = new Gsm(request);\n this.platformBilling = new PlatformBilling(request);\n this.platformFees = new PlatformFees(request);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,IAAM,QAAN,MAAY;AAAA,EACjB,YAA6B,SAAoB;AAApB;AAAA,EAAqB;AAAA,EAElD,MAAM,OAAO,QAAmD;AAC9D,WAAO,KAAK,QAAQ,QAAQ,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAAA,EAC/D;AAAA,EAEA,MAAM,mBAAmB,QAA+D;AACtF,WAAO,KAAK,QAAQ,QAAQ,0BAA0B,EAAE,MAAM,OAAO,CAAC;AAAA,EACxE;AAAA,EAEA,MAAM,aAAa,QAA6D;AAC9E,WAAO,KAAK,QAAQ,QAAQ,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,qBAAqB,QAAiE;AAC1F,WAAO,KAAK,QAAQ,QAAQ,kCAAkC,EAAE,MAAM,OAAO,CAAC;AAAA,EAChF;AAAA;AAAA,EAGA,MAAM,kBAAkB,QAA4D;AAClF,WAAO,KAAK,QAAQ,QAAQ,0BAA0B,EAAE,MAAM,OAAO,CAAC;AAAA,EACxE;AAAA;AAAA,EAGA,MAAM,oBAAmD;AACvD,WAAO,KAAK,QAAQ,OAAO,wBAAwB;AAAA,EACrD;AAAA;AAAA,EAGA,MAAM,gBAAgB,QAAkE;AACtF,WAAO,KAAK,QAAQ,QAAQ,2BAA2B,EAAE,MAAM,OAAO,CAAC;AAAA,EACzE;AACF;;;AC7BO,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B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YAAY,OAAO;AAC1C,SAAK,YAAY,IAAI,UAAU,OAAO;AACtC,SAAK,QAAQ,IAAI,MAAM,OAAO;AAC9B,SAAK,cAAc,IAAI,YAAY,OAAO;AAC1C,SAAK,UAAU,IAAI,QAAQ,OAAO;AAClC,SAAK,wBAAwB,IAAI,sBAAsB,OAAO;AAC9D,SAAK,MAAM,IAAI,IAAI,OAAO;AAC1B,SAAK,kBAAkB,IAAI,gBAAgB,OAAO;AAClD,SAAK,eAAe,IAAI,aAAa,OAAO;AAAA,EAC9C;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/internal/resources/admin.ts","../src/internal/resources/adminPortal.ts","../src/internal/resources/auditLogs.ts","../src/internal/resources/cache.ts","../src/internal/resources/cardIssuers.ts","../src/internal/resources/configs.ts","../src/internal/resources/connectorRestrictionRules.ts","../src/internal/resources/connectorRestrictions.ts","../src/internal/resources/gsm.ts","../src/internal/resources/platformBilling.ts","../src/internal/resources/platformFees.ts","../src/internal/client.ts"],"sourcesContent":["import type { AuthResponse, SignUpWithMerchantIdRequest } from '../../types';\nimport type {\n AdminSignInRequest,\n AuthorizeResponse,\n CreateInternalUserRequest,\n CreateTenantUserRequest,\n OnboardMerchantRequest,\n OnboardMerchantResponse,\n SignupToggleRequest,\n SignupToggleResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class Admin {\n constructor(private readonly request: RequestFn) {}\n\n async signIn(params: AdminSignInRequest): Promise<AuthResponse> {\n return this.request('POST', '/admin/signin', { body: params });\n }\n\n async createInternalUser(params: CreateInternalUserRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/internal-signup', { body: params });\n }\n\n async createTenant(params: CreateTenantUserRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/tenant-signup', { body: params });\n }\n\n /**\n * Create a new merchant admin user and merchant account atomically.\n *\n * This is the correct endpoint for bootstrapping the first admin user in a\n * fresh deployment — `internal-signup`/`tenant-signup` both require\n * pre-existing merchant records that don't exist on a clean database.\n *\n * `POST /admin/signup-with-merchant-id`\n */\n async signupWithMerchantId(params: SignUpWithMerchantIdRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/signup-with-merchant-id', { body: params });\n }\n\n /** Toggle public signup on/off. `POST /admin/settings/signup` */\n async setSignupSettings(params: SignupToggleRequest): Promise<SignupToggleResponse> {\n return this.request('POST', '/admin/settings/signup', { body: params });\n }\n\n /** Read current public-signup status. `GET /admin/settings/signup` */\n async getSignupSettings(): Promise<SignupToggleResponse> {\n return this.request('GET', '/admin/settings/signup');\n }\n\n /** Full merchant bootstrap — user + merchant + project + profile + keys. `POST /admin/onboard-merchant` */\n async onboardMerchant(params: OnboardMerchantRequest): Promise<OnboardMerchantResponse> {\n return this.request('POST', '/admin/onboard-merchant', { body: params });\n }\n}\n","import type {\n MerchantAccountResponse,\n MerchantAccountUpdateRequest,\n ProfileResponse,\n} from '../../types';\nimport type {\n AdminCustomerListParams,\n AdminCustomerListResponse,\n AdminCustomerDetail,\n AdminTransactionListParams,\n AdminTransactionListResponse,\n AdminAnalyticsRequest,\n PlatformAnalyticsResponse,\n OverviewStatsResponse,\n PaymentAnalyticsRequest,\n PaymentAnalyticsResponse,\n AnalyticsScopeRequest,\n AnalyticsScopeResponse,\n AdminLedgerAnalyticsRequest,\n AdminLedgerAnalyticsResponse,\n AdminCreateUserForMerchantRequest,\n AdminUpdateUserRequest,\n AdminUserResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class AdminPortal {\n constructor(private readonly request: RequestFn) {}\n\n async listCustomers(params?: AdminCustomerListParams): Promise<AdminCustomerListResponse> {\n return this.request('GET', '/admin-portal/customers', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async getCustomer(customerId: string): Promise<AdminCustomerDetail> {\n return this.request('GET', `/admin-portal/customers/${encodeURIComponent(customerId)}`);\n }\n\n async listTransactions(\n params?: AdminTransactionListParams,\n ): Promise<AdminTransactionListResponse> {\n return this.request('GET', '/admin-portal/transactions', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async analytics(params: AdminAnalyticsRequest): Promise<PlatformAnalyticsResponse> {\n return this.request('GET', '/admin-portal/analytics', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async overviewStats(): Promise<OverviewStatsResponse> {\n return this.request('GET', '/admin-portal/overview-stats');\n }\n\n async paymentAnalytics(params: PaymentAnalyticsRequest): Promise<PaymentAnalyticsResponse> {\n return this.request('GET', '/admin-portal/payment-analytics', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * One drill level of the analytics dashboard: the scope's daily series +\n * processor mix and its direct children's series. Range / metric / donut\n * toggles apply client-side; only a drill (passing merchant_id / project_id\n * / shop_id) fetches the next level.\n */\n async analyticsScope(params?: AnalyticsScopeRequest): Promise<AnalyticsScopeResponse> {\n return this.request('GET', '/admin-portal/analytics/scope', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Platform billing dashboard: total balance across all ledger accounts (+\n * the net change), top-ups, fees collected, and the day-by-day ledger flow.\n * All amounts are in USD minor units.\n */\n async ledgerAnalytics(\n params?: AdminLedgerAnalyticsRequest,\n ): Promise<AdminLedgerAnalyticsResponse> {\n return this.request('GET', '/admin-portal/ledger-analytics', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Retrieve a merchant account via the admin portal. Unlike\n * `merchantAccounts.retrieve`, this route accepts an admin JWT (or admin API\n * key) and does not require the JWT to be scoped to the target merchant.\n */\n async retrieveAccount(merchantId: string): Promise<MerchantAccountResponse> {\n return this.request('GET', `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);\n }\n\n /**\n * Update a merchant account via the admin portal. Authenticated via admin JWT\n * or admin API key.\n */\n async updateAccount(\n merchantId: string,\n params: MerchantAccountUpdateRequest,\n ): Promise<MerchantAccountResponse> {\n return this.request('POST', `/admin-portal/accounts/${encodeURIComponent(merchantId)}`, {\n body: params,\n });\n }\n\n /**\n * Delete a merchant account via the admin portal. Authenticated via admin JWT\n * or admin API key.\n */\n async deleteAccount(merchantId: string): Promise<MerchantAccountResponse> {\n return this.request('DELETE', `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);\n }\n\n /**\n * Create a brand-new user attached to the given merchant. The user is\n * marked `is_verified = true` so the admin can hand off credentials\n * immediately — no email round-trip is sent.\n */\n async createUserForMerchant(\n customerId: string,\n body: AdminCreateUserForMerchantRequest,\n ): Promise<AdminUserResponse> {\n return this.request('POST', `/admin-portal/customers/${encodeURIComponent(customerId)}/users`, {\n body,\n });\n }\n\n /**\n * Edit a user record. Any subset of fields may be supplied. `role_id`\n * requires `merchant_id`. `password` triggers a password reset (validated\n * against signup policy + JWT blacklist). `reset_2fa` clears TOTP state\n * so the user re-enrolls on next login. `is_active` supports both\n * directions: false soft-disables, true reactivates a soft-disabled user.\n */\n async updateUser(userId: string, body: AdminUpdateUserRequest): Promise<AdminUserResponse> {\n return this.request('PATCH', `/admin-portal/users/${encodeURIComponent(userId)}`, { body });\n }\n\n /**\n * Soft-delete a user globally: deactivates the row, blacklists existing\n * JWTs, and wipes credentials. Distinct from `deleteUserRole`, which\n * removes a single role binding while leaving the user signed-in elsewhere.\n */\n async deleteUser(userId: string): Promise<void> {\n return this.request('DELETE', `/admin-portal/users/${encodeURIComponent(userId)}`);\n }\n\n /**\n * Set a target merchant's shop iframe-allowed origins. Internal-admin\n * route — accepts an admin JWT or admin API key without requiring the\n * caller to be scoped to the target merchant. Pass `null` (or an empty\n * array) to clear the allowlist back to same-origin only.\n *\n * Server validates each origin: full origin (scheme + host[:port]),\n * no path/query/fragment, no wildcards.\n */\n async updateShopIframeOrigins(\n merchantId: string,\n profileId: string,\n origins: string[] | null,\n ): Promise<ProfileResponse> {\n return this.request(\n 'POST',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/business_profile/${encodeURIComponent(profileId)}/iframe-origins`,\n { body: { iframe_allowed_origins: origins } },\n );\n }\n}\n","import type { AuditLogListParams, AuditLogListResponse, AuditLogResponse } from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class AuditLogs {\n constructor(private readonly request: RequestFn) {}\n\n async list(params?: AuditLogListParams): Promise<AuditLogListResponse> {\n return this.request('GET', '/admin-portal/audit', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async retrieve(logId: string): Promise<AuditLogResponse> {\n return this.request('GET', `/admin-portal/audit/${encodeURIComponent(logId)}`);\n }\n}\n","import type { RequestFn } from '../../client';\n\nexport class Cache {\n constructor(private readonly request: RequestFn) {}\n\n /** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */\n async invalidate(key: string): Promise<Record<string, unknown>> {\n return this.request('POST', `/cache/invalidate/${encodeURIComponent(key)}`);\n }\n}\n","import type {\n CardIssuerCreateRequest,\n CardIssuerResponse,\n CardIssuerUpdateRequest,\n CardIssuerListResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class CardIssuers {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: CardIssuerCreateRequest): Promise<CardIssuerResponse> {\n return this.request('POST', '/card-issuers', { body: params });\n }\n\n async update(issuerId: string, params: CardIssuerUpdateRequest): Promise<CardIssuerResponse> {\n return this.request('PUT', `/card-issuers/${encodeURIComponent(issuerId)}`, { body: params });\n }\n\n async list(): Promise<CardIssuerListResponse> {\n return this.request('GET', '/card-issuers');\n }\n}\n","import type { RequestFn } from '../../client';\n\nexport class Configs {\n constructor(private readonly request: RequestFn) {}\n\n /** Create a config. `POST /configs` */\n async create(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/configs', { body: params });\n }\n\n /** Retrieve a config by key. `GET /configs/{key}` */\n async retrieve(key: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/configs/${encodeURIComponent(key)}`);\n }\n\n /** Update a config. `PUT /configs/{key}` */\n async update(key: string, params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('PUT', `/configs/${encodeURIComponent(key)}`, { body: params });\n }\n\n /** Delete a config. `DELETE /configs/{key}` */\n async delete(key: string): Promise<Record<string, unknown>> {\n return this.request('DELETE', `/configs/${encodeURIComponent(key)}`);\n }\n}\n","import type {\n ConnectorRestrictionRuleResponse,\n CreateConnectorRestrictionRuleRequest,\n ListConnectorRestrictionRulesQuery,\n UpdateConnectorRestrictionRuleRequest,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nconst BASE = '/admin/connector-restriction-rules';\n\n/**\n * Per-shop / per-project connector restriction rules (epic #251).\n *\n * Distinct from `connectorRestrictions` (the merchant-tier attach gate):\n * these rules allow/deny a connector for one shop (`scope: 'profile'`) or\n * project (`scope: 'project'`) at routing time. A `deny` is never routed even\n * when the connector is attached and enabled; once a scope has any `allow` it\n * becomes a whitelist, and the project scope takes precedence over the shop\n * scope. Admin-only, under `/admin/connector-restriction-rules`; exposed only\n * via `'@delopay/sdk/internal'`.\n */\nexport class ConnectorRestrictionRules {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create one allow/deny rule. A duplicate\n * `(merchant_id, scope, scope_id, connector)` is rejected — update or delete\n * the existing rule instead.\n */\n async create(\n body: CreateConnectorRestrictionRuleRequest,\n ): Promise<ConnectorRestrictionRuleResponse> {\n return this.request('POST', BASE, { body });\n }\n\n /**\n * List rules for one scope (`scope` + `scope_id`) or a whole merchant\n * (`merchant_id`). Pass exactly one selector.\n */\n async list(\n query: ListConnectorRestrictionRulesQuery,\n ): Promise<ConnectorRestrictionRuleResponse[]> {\n // Spread into a fresh object literal so the typed query satisfies the\n // request layer's `Record<string, …>` index signature. `undefined` values\n // are dropped by `request()`.\n return this.request('GET', BASE, { query: { ...query } });\n }\n\n /** Retrieve a single rule by ID. */\n async retrieve(id: string): Promise<ConnectorRestrictionRuleResponse> {\n return this.request('GET', `${BASE}/${encodeURIComponent(id)}`);\n }\n\n /** Update a rule's action and/or reason. */\n async update(\n id: string,\n body: UpdateConnectorRestrictionRuleRequest,\n ): Promise<ConnectorRestrictionRuleResponse> {\n return this.request('PATCH', `${BASE}/${encodeURIComponent(id)}`, { body });\n }\n\n /** Delete a rule by ID. */\n async delete(id: string): Promise<{ id: string; deleted: boolean }> {\n return this.request('DELETE', `${BASE}/${encodeURIComponent(id)}`);\n }\n}\n","import type { ConnectorRestrictionResponse, UpsertConnectorRestrictionRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Admin-only allowlist for phased connector rollouts.\n *\n * Default-open semantics: a connector with no restriction row is\n * usable by every merchant (current behavior). A connector with a\n * row is gated — only merchants in `allowed_merchant_ids` can attach\n * a connector account. Enforced server-side at MCA-create time.\n */\nexport class ConnectorRestrictions {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Idempotent upsert. If a row exists for `connector_name`, its\n * allowlist + reason are replaced. To open the connector to\n * everyone again, call `delete()`.\n */\n async upsert(body: UpsertConnectorRestrictionRequest): Promise<ConnectorRestrictionResponse> {\n return this.request('POST', '/admin/connector-restrictions', { body });\n }\n\n async list(): Promise<ConnectorRestrictionResponse[]> {\n return this.request('GET', '/admin/connector-restrictions');\n }\n\n async retrieve(connectorName: string): Promise<ConnectorRestrictionResponse> {\n return this.request(\n 'GET',\n `/admin/connector-restrictions/${encodeURIComponent(connectorName)}`,\n );\n }\n\n /** Removing the row makes the connector public again. */\n async delete(connectorName: string): Promise<{ connector_name: string; deleted: boolean }> {\n return this.request(\n 'DELETE',\n `/admin/connector-restrictions/${encodeURIComponent(connectorName)}`,\n );\n }\n}\n","import type { GsmRuleCreateRequest, GsmRuleResponse, GsmRuleUpdateRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class Gsm {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: GsmRuleCreateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm', { body: params });\n }\n\n async retrieve(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/get', { body: params });\n }\n\n async update(params: GsmRuleUpdateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/update', { body: params });\n }\n\n async delete(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/delete', { body: params });\n }\n}\n","import type {\n AdminAdjustmentRequest,\n AdminAdjustmentResponse,\n AdminSuspendRequest,\n AdminUnsuspendRequest,\n AdminSetTrustedRequest,\n} from '../types';\nimport type { BillingProfileResponse } from '../../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Platform-level ledger adjustments on a merchant's balance. Admin-only\n * routes under `/billing/{merchantId}/admin/credit|debit`. Exposed only\n * via `'@delopay/sdk/internal'` so the public merchant SDK doesn't\n * advertise the admin adjustment path in autocomplete.\n */\nexport class PlatformBilling {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Manually credit a merchant's balance (e.g. promotional credit,\n * dispute reversal, manual correction).\n *\n * @param merchantId - The merchant account ID.\n * @param params - Credit amount and reason.\n */\n async credit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/credit`, {\n body: params,\n });\n }\n\n /**\n * Manually debit a merchant's balance.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Debit amount and reason.\n */\n async debit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/debit`, {\n body: params,\n });\n }\n\n /**\n * Manually suspend a merchant (e.g. confirmed fraud or ToS violation),\n * independent of balance. A `reason` is required for audit. Throws 412 if\n * the merchant is trusted (clear the flag first) or already suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Suspension reason.\n * @returns The updated billing profile.\n */\n async suspend(merchantId: string, params: AdminSuspendRequest): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/suspend`, {\n body: params,\n });\n }\n\n /**\n * Lift a suspension. Restores the merchant to `active` (or `delinquent` if\n * the balance is at/below the hard floor) and resets the recharge-failure\n * counter. Throws 412 if the merchant is not suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional audit note.\n * @returns The updated billing profile.\n */\n async unsuspend(\n merchantId: string,\n params: AdminUnsuspendRequest = {},\n ): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/unsuspend`, {\n body: params,\n });\n }\n\n /**\n * Set or clear the trusted (suspension-exempt) flag. Trusted merchants\n * cannot be suspended automatically or manually. Does not lift an existing\n * suspension — use {@link PlatformBilling.unsuspend} for that.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The desired trusted state.\n * @returns The updated billing profile.\n */\n async setTrusted(\n merchantId: string,\n params: AdminSetTrustedRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/trusted`, {\n body: params,\n });\n }\n}\n","import type {\n FeeScheduleCreateRequest,\n FeeScheduleResponse,\n FeeScheduleUpdateRequest,\n PlatformFeeRuleInput,\n PlatformFeeRuleRecord,\n PlatformFeeRuleRequest,\n} from '../../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Platform-wide fee schedule management. Admin-only routes under\n * `/admin/fees/*`. Exposed only via `'@delopay/sdk/internal'`.\n *\n * `platformFees.rules` manages the platform-owned Euclid fee-rule program per\n * merchant, which takes precedence over the flat platform schedules. Build the\n * program with `feeProgram()`.\n */\nexport class PlatformFees {\n /** Platform-owned Euclid fee-rule program (`/admin/fees/rules`). */\n readonly rules: PlatformFeeRulesManager;\n\n constructor(private readonly request: RequestFn) {\n this.rules = new PlatformFeeRulesManager(request);\n }\n\n /** Create a platform fee schedule for a specific merchant. */\n async create(params: FeeScheduleCreateRequest, merchantId: string): Promise<FeeScheduleResponse> {\n return this.request('POST', '/admin/fees', {\n body: params,\n query: { merchant_id: merchantId },\n });\n }\n\n /** List every platform fee schedule assigned to a merchant. */\n async list(merchantId: string): Promise<FeeScheduleResponse[]> {\n return this.request('GET', '/admin/fees/list', {\n query: { merchant_id: merchantId },\n });\n }\n\n /** Retrieve a single platform fee schedule by ID. */\n async retrieve(feeId: string): Promise<FeeScheduleResponse> {\n return this.request('GET', `/admin/fees/${encodeURIComponent(feeId)}`);\n }\n\n /** Update a platform fee schedule. */\n async update(feeId: string, params: FeeScheduleUpdateRequest): Promise<FeeScheduleResponse> {\n return this.request('PUT', `/admin/fees/${encodeURIComponent(feeId)}`, { body: params });\n }\n\n /** Delete a platform fee schedule. */\n async delete(feeId: string): Promise<FeeScheduleResponse> {\n return this.request('DELETE', `/admin/fees/${encodeURIComponent(feeId)}`);\n }\n}\n\n/**\n * Manages a merchant's platform-owned Euclid fee-rule programs (admin surface),\n * merchant-wide or per-shop (one active program per scope; a shop-scoped\n * program wins for its shop, else the merchant-wide one applies). Build the\n * `algorithm` with `feeProgram()`. The SDK injects `fee_owner: 'platform'`; set\n * `profile_id` on the input to scope a program to a shop.\n */\nexport class PlatformFeeRulesManager {\n constructor(private readonly request: RequestFn) {}\n\n /** Create or replace the platform fee-rule program for a merchant. */\n async upsert(params: PlatformFeeRuleInput, merchantId: string): Promise<PlatformFeeRuleRecord> {\n const body: PlatformFeeRuleRequest = { ...params, fee_owner: 'platform' };\n return this.request('PUT', '/admin/fees/rules', {\n body,\n query: { merchant_id: merchantId },\n });\n }\n\n /**\n * Retrieve the active platform fee-rule program for a scope, or `null`.\n * `profileId` omitted = merchant-wide program; set = that shop's program.\n */\n async retrieve(\n merchantId: string,\n profileId?: string,\n ): Promise<PlatformFeeRuleRecord | null> {\n return this.request('GET', '/admin/fees/rules', {\n query: { merchant_id: merchantId, profile_id: profileId },\n });\n }\n\n /**\n * Deactivate a platform fee-rule program. Idempotent. `profileId` omitted\n * targets the merchant-wide program; set targets only that shop's program.\n */\n async delete(merchantId: string, profileId?: string): Promise<void> {\n await this.request('DELETE', '/admin/fees/rules', {\n query: { merchant_id: merchantId, profile_id: profileId },\n });\n }\n}\n","import type { RequestFn } from '../client';\nimport { Delopay } from '../client';\nimport { Admin } from './resources/admin';\nimport { AdminPortal } from './resources/adminPortal';\nimport { AuditLogs } from './resources/auditLogs';\nimport { Cache } from './resources/cache';\nimport { CardIssuers } from './resources/cardIssuers';\nimport { Configs } from './resources/configs';\nimport { ConnectorRestrictionRules } from './resources/connectorRestrictionRules';\nimport { ConnectorRestrictions } from './resources/connectorRestrictions';\nimport { Gsm } from './resources/gsm';\nimport { PlatformBilling } from './resources/platformBilling';\nimport { PlatformFees } from './resources/platformFees';\n\n/**\n * Internal-only Delopay client for DeloPay staff tooling (the admin\n * control-center, audit UIs, etc.). Extends the public `Delopay` surface\n * with admin-plane resources that must **not** be discoverable from the\n * merchant-facing package entry.\n *\n * Import path: `import { DelopayInternal } from '@delopay/sdk/internal'`.\n * The merchant-facing `import { Delopay } from '@delopay/sdk'` never\n * surfaces these.\n */\nexport class DelopayInternal extends Delopay {\n /** Bootstrap admin endpoints — signup, signin, onboarding. */\n readonly admin: Admin;\n /** Platform-wide customer, transaction, analytics, merchant-account ops. */\n readonly adminPortal: AdminPortal;\n /** Audit log reads. */\n readonly auditLogs: AuditLogs;\n /** Backend cache invalidation. */\n readonly cache: Cache;\n /** Platform card-issuer program management. */\n readonly cardIssuers: CardIssuers;\n /** Generic platform config store. */\n readonly configs: Configs;\n /** Per-merchant connector allowlist for phased rollouts. */\n readonly connectorRestrictions: ConnectorRestrictions;\n /** Per-shop / per-project connector allow-deny rules (routing-time). */\n readonly connectorRestrictionRules: ConnectorRestrictionRules;\n /** GSM (Gateway Status Mapping) routing rules. */\n readonly gsm: Gsm;\n /** Admin-only ledger credits/debits against a merchant's balance. */\n readonly platformBilling: PlatformBilling;\n /** Platform-wide fee schedules assigned to merchants. */\n readonly platformFees: PlatformFees;\n\n constructor(...args: ConstructorParameters<typeof Delopay>) {\n super(...args);\n const request = this.request.bind(this) as RequestFn;\n this.admin = new Admin(request);\n this.adminPortal = new AdminPortal(request);\n this.auditLogs = new AuditLogs(request);\n this.cache = new Cache(request);\n this.cardIssuers = new CardIssuers(request);\n this.configs = new Configs(request);\n this.connectorRestrictions = new ConnectorRestrictions(request);\n this.connectorRestrictionRules = new ConnectorRestrictionRules(request);\n this.gsm = new Gsm(request);\n this.platformBilling = new PlatformBilling(request);\n this.platformFees = new PlatformFees(request);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,IAAM,QAAN,MAAY;AAAA,EACjB,YAA6B,SAAoB;AAApB;AAAA,EAAqB;AAAA,EAElD,MAAM,OAAO,QAAmD;AAC9D,WAAO,KAAK,QAAQ,QAAQ,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAAA,EAC/D;AAAA,EAEA,MAAM,mBAAmB,QAA+D;AACtF,WAAO,KAAK,QAAQ,QAAQ,0BAA0B,EAAE,MAAM,OAAO,CAAC;AAAA,EACxE;AAAA,EAEA,MAAM,aAAa,QAA6D;AAC9E,WAAO,KAAK,QAAQ,QAAQ,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,qBAAqB,QAAiE;AAC1F,WAAO,KAAK,QAAQ,QAAQ,kCAAkC,EAAE,MAAM,OAAO,CAAC;AAAA,EAChF;AAAA;AAAA,EAGA,MAAM,kBAAkB,QAA4D;AAClF,WAAO,KAAK,QAAQ,QAAQ,0BAA0B,EAAE,MAAM,OAAO,CAAC;AAAA,EACxE;AAAA;AAAA,EAGA,MAAM,oBAAmD;AACvD,WAAO,KAAK,QAAQ,OAAO,wBAAwB;AAAA,EACrD;AAAA;AAAA,EAGA,MAAM,gBAAgB,QAAkE;AACtF,WAAO,KAAK,QAAQ,QAAQ,2BAA2B,EAAE,MAAM,OAAO,CAAC;AAAA,EACzE;AACF;;;AC7BO,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,SAAoB;AAApB;AAAA,EAAqB;AAAA,EAElD,MAAM,cAAc,QAAsE;AACxF,WAAO,KAAK,QAAQ,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.0",
3
+ "version": "0.40.0",
4
4
  "description": "Official Delopay TypeScript SDK",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -32,20 +32,6 @@
32
32
  "files": [
33
33
  "dist"
34
34
  ],
35
- "scripts": {
36
- "build": "tsup",
37
- "prepublishOnly": "tsup",
38
- "test": "vitest run",
39
- "test:watch": "vitest",
40
- "typecheck": "tsc --noEmit",
41
- "lint": "oxlint && eslint .",
42
- "lint:fix": "oxlint --fix && eslint . --fix",
43
- "format": "prettier --write .",
44
- "format:check": "prettier --check .",
45
- "check": "pnpm typecheck && pnpm lint && pnpm format:check && pnpm test && pnpm check:parity",
46
- "check:parity": "node scripts/parity-check.mjs",
47
- "validate:types": "npx tsx scripts/validate-types.ts"
48
- },
49
35
  "devDependencies": {
50
36
  "@eslint/js": "^10.0.1",
51
37
  "@types/node": "^25.6.0",
@@ -60,5 +46,18 @@
60
46
  "engines": {
61
47
  "node": ">=18.0.0"
62
48
  },
63
- "license": "MIT"
64
- }
49
+ "license": "MIT",
50
+ "scripts": {
51
+ "build": "tsup",
52
+ "test": "vitest run",
53
+ "test:watch": "vitest",
54
+ "typecheck": "tsc --noEmit",
55
+ "lint": "oxlint && eslint .",
56
+ "lint:fix": "oxlint --fix && eslint . --fix",
57
+ "format": "prettier --write .",
58
+ "format:check": "prettier --check .",
59
+ "check": "pnpm typecheck && pnpm lint && pnpm format:check && pnpm test && pnpm check:parity",
60
+ "check:parity": "node scripts/parity-check.mjs",
61
+ "validate:types": "npx tsx scripts/validate-types.ts"
62
+ }
63
+ }