@openrails/billing-ui 0.257.1 → 0.257.2

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.
@@ -295,17 +295,17 @@ export declare function createAdminServices(options: AdminClientOptions): {
295
295
  queryFn?: import('@tanstack/react-query').QueryFunction<import('../client/generated/wire').Payment, readonly [...string[], "payments", string], never> | undefined;
296
296
  } & import('@tanstack/react-query').QueryKeyWithDataTag<readonly [...string[], "payments", string], import('../client/generated/wire').Payment, Error>;
297
297
  attempts: (filters: import('./lib/api/endpoints').AttemptFilters, limit: number, cursor?: string) => import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<import('./lib/api/credit-types').ListPage<import('../client/generated/wire').PaymentAttempt>, Error, import('./lib/api/credit-types').ListPage<import('../client/generated/wire').PaymentAttempt>, (string | {
298
- filters: Partial<Record<"psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "customer_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
298
+ filters: Partial<Record<"customer_id" | "psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
299
299
  limit: number;
300
300
  cursor: string | undefined;
301
301
  })[]>, "queryFn"> & {
302
302
  queryFn?: import('@tanstack/react-query').QueryFunction<import('./lib/api/credit-types').ListPage<import('../client/generated/wire').PaymentAttempt>, (string | {
303
- filters: Partial<Record<"psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "customer_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
303
+ filters: Partial<Record<"customer_id" | "psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
304
304
  limit: number;
305
305
  cursor: string | undefined;
306
306
  })[], never> | undefined;
307
307
  } & import('@tanstack/react-query').QueryKeyWithDataTag<(string | {
308
- filters: Partial<Record<"psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "customer_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
308
+ filters: Partial<Record<"customer_id" | "psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
309
309
  limit: number;
310
310
  cursor: string | undefined;
311
311
  })[], import('./lib/api/credit-types').ListPage<import('../client/generated/wire').PaymentAttempt>, Error>;
@@ -895,17 +895,17 @@ export declare const useAdminServices: () => {
895
895
  queryFn?: import('@tanstack/react-query').QueryFunction<import('../client/generated/wire').Payment, readonly [...string[], "payments", string], never> | undefined;
896
896
  } & import('@tanstack/react-query').QueryKeyWithDataTag<readonly [...string[], "payments", string], import('../client/generated/wire').Payment, Error>;
897
897
  attempts: (filters: import('./lib/api/endpoints').AttemptFilters, limit: number, cursor?: string) => import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<import('./lib/api/credit-types').ListPage<import('../client/generated/wire').PaymentAttempt>, Error, import('./lib/api/credit-types').ListPage<import('../client/generated/wire').PaymentAttempt>, (string | {
898
- filters: Partial<Record<"psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "customer_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
898
+ filters: Partial<Record<"customer_id" | "psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
899
899
  limit: number;
900
900
  cursor: string | undefined;
901
901
  })[]>, "queryFn"> & {
902
902
  queryFn?: import('@tanstack/react-query').QueryFunction<import('./lib/api/credit-types').ListPage<import('../client/generated/wire').PaymentAttempt>, (string | {
903
- filters: Partial<Record<"psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "customer_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
903
+ filters: Partial<Record<"customer_id" | "psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
904
904
  limit: number;
905
905
  cursor: string | undefined;
906
906
  })[], never> | undefined;
907
907
  } & import('@tanstack/react-query').QueryKeyWithDataTag<(string | {
908
- filters: Partial<Record<"psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "customer_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
908
+ filters: Partial<Record<"customer_id" | "psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
909
909
  limit: number;
910
910
  cursor: string | undefined;
911
911
  })[], import('./lib/api/credit-types').ListPage<import('../client/generated/wire').PaymentAttempt>, Error>;
@@ -168,17 +168,17 @@ export declare function createQueries(client: AdminClient, api: AdminAPI): {
168
168
  queryFn?: import('@tanstack/react-query').QueryFunction<import('../../client/generated/wire').Payment, readonly [...string[], "payments", string], never> | undefined;
169
169
  } & import('@tanstack/react-query').QueryKeyWithDataTag<readonly [...string[], "payments", string], import('../../client/generated/wire').Payment, Error>;
170
170
  attempts: (filters: AttemptFilters, limit: number, cursor?: string) => import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<ListPage<import('../../client/generated/wire').PaymentAttempt>, Error, ListPage<import('../../client/generated/wire').PaymentAttempt>, (string | {
171
- filters: Partial<Record<"psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "customer_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
171
+ filters: Partial<Record<"customer_id" | "psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
172
172
  limit: number;
173
173
  cursor: string | undefined;
174
174
  })[]>, "queryFn"> & {
175
175
  queryFn?: import('@tanstack/react-query').QueryFunction<ListPage<import('../../client/generated/wire').PaymentAttempt>, (string | {
176
- filters: Partial<Record<"psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "customer_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
176
+ filters: Partial<Record<"customer_id" | "psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
177
177
  limit: number;
178
178
  cursor: string | undefined;
179
179
  })[], never> | undefined;
180
180
  } & import('@tanstack/react-query').QueryKeyWithDataTag<(string | {
181
- filters: Partial<Record<"psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "customer_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
181
+ filters: Partial<Record<"customer_id" | "psp_id" | "source" | "order_id" | "reason" | "subscription_id" | "kind" | "payment_id" | "owner" | "category" | "response_code" | "card_entry" | "observed_via" | "avs_result" | "cvv_result" | "cycle_id" | "since" | "until", string>>;
182
182
  limit: number;
183
183
  cursor: string | undefined;
184
184
  })[], ListPage<import('../../client/generated/wire').PaymentAttempt>, Error>;
@@ -2091,6 +2091,159 @@ export declare const OPENRAILS_ROUTES: readonly [{
2091
2091
  };
2092
2092
  readonly errors: readonly ["as_of_required", "invalid_param", "invalid_psp_reference", "resource_conflict"];
2093
2093
  readonly errorSets: readonly ["tier:merchant", "request"];
2094
+ }, {
2095
+ readonly method: "POST";
2096
+ readonly path: "/v1/merchant/psp-imports";
2097
+ readonly group: "merchant_config";
2098
+ readonly auth: "merchant";
2099
+ readonly permission: {
2100
+ readonly merchant: "merchant:config:manage";
2101
+ readonly root: "root:config:manage";
2102
+ };
2103
+ readonly sensitive: false;
2104
+ readonly mountedWhen: null;
2105
+ readonly request: "CreatePSPImportParams";
2106
+ readonly responses: {
2107
+ readonly 202: "PSPImport";
2108
+ };
2109
+ readonly errors: readonly ["invalid_param", "psp_not_found", "service_unavailable"];
2110
+ readonly errorSets: readonly ["tier:merchant", "request"];
2111
+ }, {
2112
+ readonly method: "GET";
2113
+ readonly path: "/v1/merchant/psp-imports";
2114
+ readonly group: "merchant_config";
2115
+ readonly auth: "merchant";
2116
+ readonly permission: {
2117
+ readonly merchant: "merchant:config:read";
2118
+ readonly root: "root:config:read";
2119
+ };
2120
+ readonly sensitive: false;
2121
+ readonly mountedWhen: null;
2122
+ readonly request: null;
2123
+ readonly responses: {
2124
+ readonly 200: "ListPage<PSPImport>";
2125
+ };
2126
+ readonly errors: readonly ["invalid_cursor", "invalid_query", "service_unavailable"];
2127
+ readonly errorSets: readonly ["tier:merchant", "request"];
2128
+ }, {
2129
+ readonly method: "GET";
2130
+ readonly path: "/v1/merchant/psp-imports/{id}";
2131
+ readonly group: "merchant_config";
2132
+ readonly auth: "merchant";
2133
+ readonly permission: {
2134
+ readonly merchant: "merchant:config:read";
2135
+ readonly root: "root:config:read";
2136
+ };
2137
+ readonly sensitive: false;
2138
+ readonly mountedWhen: null;
2139
+ readonly request: null;
2140
+ readonly responses: {
2141
+ readonly 200: "PSPImport";
2142
+ };
2143
+ readonly errors: readonly ["invalid_param", "resource_not_found", "service_unavailable"];
2144
+ readonly errorSets: readonly ["tier:merchant"];
2145
+ }, {
2146
+ readonly method: "PATCH";
2147
+ readonly path: "/v1/merchant/psp-imports/{id}";
2148
+ readonly group: "merchant_config";
2149
+ readonly auth: "merchant";
2150
+ readonly permission: {
2151
+ readonly merchant: "merchant:config:manage";
2152
+ readonly root: "root:config:manage";
2153
+ };
2154
+ readonly sensitive: false;
2155
+ readonly mountedWhen: null;
2156
+ readonly request: "UpdatePSPImportParams";
2157
+ readonly responses: {
2158
+ readonly 200: "PSPImport";
2159
+ };
2160
+ readonly errors: readonly ["invalid_param", "resource_not_found", "service_unavailable"];
2161
+ readonly errorSets: readonly ["tier:merchant", "request"];
2162
+ }, {
2163
+ readonly method: "DELETE";
2164
+ readonly path: "/v1/merchant/psp-imports/{id}";
2165
+ readonly group: "merchant_config";
2166
+ readonly auth: "merchant";
2167
+ readonly permission: {
2168
+ readonly merchant: "merchant:config:manage";
2169
+ readonly root: "root:config:manage";
2170
+ };
2171
+ readonly sensitive: false;
2172
+ readonly mountedWhen: null;
2173
+ readonly request: null;
2174
+ readonly responses: {
2175
+ readonly 204: null;
2176
+ };
2177
+ readonly errors: readonly ["invalid_param", "resource_conflict", "resource_not_found", "service_unavailable"];
2178
+ readonly errorSets: readonly ["tier:merchant"];
2179
+ }, {
2180
+ readonly method: "GET";
2181
+ readonly path: "/v1/merchant/psp-imports/{id}/records";
2182
+ readonly group: "merchant_config";
2183
+ readonly auth: "merchant";
2184
+ readonly permission: {
2185
+ readonly merchant: "merchant:config:read";
2186
+ readonly root: "root:config:read";
2187
+ };
2188
+ readonly sensitive: false;
2189
+ readonly mountedWhen: null;
2190
+ readonly request: null;
2191
+ readonly responses: {
2192
+ readonly 200: "ListPage<PSPImportRecord>";
2193
+ };
2194
+ readonly errors: readonly ["invalid_cursor", "invalid_param", "invalid_query", "resource_not_found", "service_unavailable"];
2195
+ readonly errorSets: readonly ["tier:merchant", "request"];
2196
+ }, {
2197
+ readonly method: "POST";
2198
+ readonly path: "/v1/merchant/psp-imports/{id}/link";
2199
+ readonly group: "merchant_config";
2200
+ readonly auth: "merchant";
2201
+ readonly permission: {
2202
+ readonly merchant: "merchant:config:manage";
2203
+ readonly root: "root:config:manage";
2204
+ };
2205
+ readonly sensitive: false;
2206
+ readonly mountedWhen: null;
2207
+ readonly request: "LinkPSPImportParams";
2208
+ readonly responses: {
2209
+ readonly 200: "PSPImport";
2210
+ };
2211
+ readonly errors: readonly ["invalid_param", "resource_conflict", "resource_not_found", "service_unavailable"];
2212
+ readonly errorSets: readonly ["tier:merchant", "request"];
2213
+ }, {
2214
+ readonly method: "POST";
2215
+ readonly path: "/v1/merchant/psp-imports/{id}/apply";
2216
+ readonly group: "merchant_config";
2217
+ readonly auth: "merchant";
2218
+ readonly permission: {
2219
+ readonly merchant: "merchant:config:manage";
2220
+ readonly root: "root:config:manage";
2221
+ };
2222
+ readonly sensitive: false;
2223
+ readonly mountedWhen: null;
2224
+ readonly request: null;
2225
+ readonly responses: {
2226
+ readonly 202: "PSPImport";
2227
+ };
2228
+ readonly errors: readonly ["invalid_param", "product_not_found", "provider_price_unreadable", "resource_conflict", "resource_not_found", "service_unavailable"];
2229
+ readonly errorSets: readonly ["tier:merchant"];
2230
+ }, {
2231
+ readonly method: "POST";
2232
+ readonly path: "/v1/merchant/psp-import-mappings";
2233
+ readonly group: "merchant_config";
2234
+ readonly auth: "merchant";
2235
+ readonly permission: {
2236
+ readonly merchant: "merchant:config:manage";
2237
+ readonly root: "root:config:manage";
2238
+ };
2239
+ readonly sensitive: false;
2240
+ readonly mountedWhen: null;
2241
+ readonly request: "SetPSPImportMappingsParams";
2242
+ readonly responses: {
2243
+ readonly 200: "PSPImportMappingsResult";
2244
+ };
2245
+ readonly errors: readonly ["invalid_param", "service_unavailable"];
2246
+ readonly errorSets: readonly ["tier:merchant", "request"];
2094
2247
  }, {
2095
2248
  readonly method: "GET";
2096
2249
  readonly path: "/v1/merchant/destructive-holds";
@@ -479,6 +479,12 @@ export type CreateOrderParams = {
479
479
  expires_at?: string;
480
480
  pay_url?: OrderPayURLParams;
481
481
  };
482
+ export type CreatePSPImportParams = {
483
+ psp?: PSPRef;
484
+ history_since?: string;
485
+ rules?: PSPImportRule[];
486
+ products?: PSPImportProduct[];
487
+ };
482
488
  export type CreatePSPParams = {
483
489
  key?: string;
484
490
  rail?: "ccbill" | "nmi" | "solana" | "stripe";
@@ -1029,6 +1035,9 @@ export type InvoiceProfile = {
1029
1035
  billing_contacts: InvoiceContact[];
1030
1036
  memo: string;
1031
1037
  };
1038
+ export type LinkPSPImportParams = {
1039
+ links?: PSPImportLink[];
1040
+ };
1032
1041
  export type LowBalanceLine = {
1033
1042
  currency: string;
1034
1043
  amount: string | null;
@@ -1420,6 +1429,70 @@ export type PSPCredential = {
1420
1429
  configured: boolean;
1421
1430
  validated_at: string | null;
1422
1431
  };
1432
+ export type PSPImport = {
1433
+ id: string;
1434
+ psp: string;
1435
+ rail: string;
1436
+ status: "applied" | "applying" | "failed" | "pulled" | "pulling";
1437
+ history_since: string | null;
1438
+ history_through: string | null;
1439
+ pulled_at: string | null;
1440
+ applied_at: string | null;
1441
+ error: string | null;
1442
+ rules: PSPImportRule[];
1443
+ products: PSPImportProduct[];
1444
+ counts: PSPImportCount[];
1445
+ created_at: string;
1446
+ updated_at: string;
1447
+ };
1448
+ export type PSPImportCount = {
1449
+ kind: "customer" | "subscription" | "transaction";
1450
+ state: "blocked" | "conflict" | "imported" | "linked" | "unmatched";
1451
+ records: number;
1452
+ };
1453
+ export type PSPImportFact = {
1454
+ name: string;
1455
+ value: string;
1456
+ };
1457
+ export type PSPImportLink = {
1458
+ record?: string;
1459
+ customer?: string | null;
1460
+ };
1461
+ export type PSPImportMapping = {
1462
+ mapping?: string;
1463
+ key?: string;
1464
+ customer?: string | null;
1465
+ };
1466
+ export type PSPImportMappingsResult = {
1467
+ set: number;
1468
+ deleted: number;
1469
+ };
1470
+ export type PSPImportProduct = {
1471
+ plan?: string;
1472
+ product: string;
1473
+ price?: string;
1474
+ };
1475
+ export type PSPImportRecord = {
1476
+ id: string;
1477
+ import: string;
1478
+ kind: "customer" | "subscription" | "transaction";
1479
+ ref: string;
1480
+ customer_ref: string | null;
1481
+ subscription_ref: string | null;
1482
+ occurred_at: string | null;
1483
+ facts: PSPImportFact[];
1484
+ state: "blocked" | "conflict" | "imported" | "linked" | "unmatched";
1485
+ customer: string | null;
1486
+ linked_via: string | null;
1487
+ reason: string | null;
1488
+ updated_at: string;
1489
+ };
1490
+ export type PSPImportRule = {
1491
+ fact: string;
1492
+ pattern?: string;
1493
+ via: "customer_id" | "directory" | "mapping";
1494
+ mapping?: string;
1495
+ };
1423
1496
  export type PSPPaymentConfig = {
1424
1497
  psp_id: string;
1425
1498
  key: string;
@@ -1938,6 +2011,9 @@ export type SetMeterParams = {
1938
2011
  rate_card?: MeterRateCardParams | null;
1939
2012
  expected_revision?: number;
1940
2013
  };
2014
+ export type SetPSPImportMappingsParams = {
2015
+ mappings?: PSPImportMapping[];
2016
+ };
1941
2017
  export type SetSubscriptionPaymentMethodParams = {
1942
2018
  payment_method_id?: string | null;
1943
2019
  };
@@ -2117,6 +2193,10 @@ export type UpdateMerchantConfigurationParams = {
2117
2193
  billing_policy_bindings?: BillingPolicyBinding[];
2118
2194
  delegated_invoker_wasted_spend_limits?: BudgetWindow[];
2119
2195
  };
2196
+ export type UpdatePSPImportParams = {
2197
+ rules?: PSPImportRule[];
2198
+ products?: PSPImportProduct[];
2199
+ };
2120
2200
  export type UpdatePSPParams = {
2121
2201
  expected_revision?: number | null;
2122
2202
  tokenization_key?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrails/billing-ui",
3
- "version": "0.257.1",
3
+ "version": "0.257.2",
4
4
  "description": "Embeddable OpenRails purchase and account-billing UI: client, React hooks and styled components.",
5
5
  "type": "module",
6
6
  "license": "MIT",