@openrails/billing-ui 0.270.1 → 0.271.1

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.
Files changed (29) hide show
  1. package/dist/admin/lib/api/import-endpoints.d.ts +0 -1
  2. package/dist/admin/messages.d.ts +7 -7
  3. package/dist/admin/pages/imports/shared.d.ts +1 -1
  4. package/dist/{admin-detail-Ceod8AXy.js → admin-detail-3wFIDPNB.js} +106 -111
  5. package/dist/admin-detail-3wFIDPNB.js.map +1 -0
  6. package/dist/admin-imports-CgZB5JAV.js +261 -0
  7. package/dist/admin-imports-CgZB5JAV.js.map +1 -0
  8. package/dist/{admin-map-dialog-DpGaIq52.js → admin-map-dialog-DS2Wz6G3.js} +2 -2
  9. package/dist/{admin-map-dialog-DpGaIq52.js.map → admin-map-dialog-DS2Wz6G3.js.map} +1 -1
  10. package/dist/{admin-parked-7HL8mOjw.js → admin-parked-B8xHkV2e.js} +6 -6
  11. package/dist/admin-parked-B8xHkV2e.js.map +1 -0
  12. package/dist/{admin-proposals-dtgijWKz.js → admin-proposals-Cuj7tvaM.js} +2 -2
  13. package/dist/{admin-proposals-dtgijWKz.js.map → admin-proposals-Cuj7tvaM.js.map} +1 -1
  14. package/dist/{admin-provider-prices-ChuponcZ.js → admin-provider-prices-B6vwnVPi.js} +3 -3
  15. package/dist/{admin-provider-prices-ChuponcZ.js.map → admin-provider-prices-B6vwnVPi.js.map} +1 -1
  16. package/dist/{admin-records-CUHUOXAU.js → admin-records-H0MlhEVY.js} +2 -2
  17. package/dist/{admin-records-CUHUOXAU.js.map → admin-records-H0MlhEVY.js.map} +1 -1
  18. package/dist/{admin-shared-CzG8Pan3.js → admin-shared-lfIUEbPY.js} +9 -9
  19. package/dist/admin-shared-lfIUEbPY.js.map +1 -0
  20. package/dist/admin-utils-B9eEBNsR.js.map +1 -1
  21. package/dist/admin.js +13 -13
  22. package/dist/admin.js.map +1 -1
  23. package/dist/client/generated/wire.d.ts +0 -1
  24. package/package.json +1 -1
  25. package/dist/admin-detail-Ceod8AXy.js.map +0 -1
  26. package/dist/admin-imports-TCOljTgw.js +0 -269
  27. package/dist/admin-imports-TCOljTgw.js.map +0 -1
  28. package/dist/admin-parked-7HL8mOjw.js.map +0 -1
  29. package/dist/admin-shared-CzG8Pan3.js.map +0 -1
@@ -2,7 +2,6 @@ import { AdminClient, PageRequest } from './client';
2
2
  import { CreatePSPImportParams, CreateProviderPriceParams, Customer, Finding, LinkPSPImportParams, ListPage, PSPImport, PSPImportMapping, PSPImportMappingsResult, PSPImportRecord, ParkedSubscription, Price, ProposalResults, ProviderCatalogObject } from '../../../client/generated/wire';
3
3
  export interface PSPImportFilters {
4
4
  psp?: string;
5
- origin?: PSPImport["origin"];
6
5
  }
7
6
  export interface PSPImportRecordFilters {
8
7
  state?: PSPImportRecord["state"];
@@ -232,11 +232,10 @@ export declare const billingAdminMessages: {
232
232
  readonly "Re-link an import to apply them:": "Re-link an import to apply them:";
233
233
  readonly "Re-link requested": "Re-link requested";
234
234
  readonly "Reading catalog and roster": "Reading catalog and roster";
235
- readonly "Reads the PSP's catalog, customers, subscriptions and history again, read-only. Nothing lands before you apply it.": "Reads the PSP's catalog, customers, subscriptions and history again, read-only. Nothing lands before you apply it.";
236
- readonly Reconcile: "Reconcile";
237
- readonly "Reconcile PSP": "Reconcile PSP";
238
- readonly "Reconcile a PSP": "Reconcile a PSP";
239
- readonly "Reconcile started": "Reconcile started";
235
+ readonly "Reads the PSP's catalog, customers, subscriptions and history, read-only. Nothing lands before you apply it.": "Reads the PSP's catalog, customers, subscriptions and history, read-only. Nothing lands before you apply it.";
236
+ readonly "Pull PSP": "Pull PSP";
237
+ readonly "Pull a PSP": "Pull a PSP";
238
+ readonly "Pull started": "Pull started";
240
239
  readonly "Record state": "Record state";
241
240
  readonly Records: "Records";
242
241
  readonly Reload: "Reload";
@@ -578,8 +577,9 @@ export declare const billingAdminMessages: {
578
577
  readonly "Devnet: Solana's development network": "Devnet: Solana's development network";
579
578
  readonly "Testnet: Solana's test network": "Testnet: Solana's test network";
580
579
  readonly "The customer holds this product already: cancel one at the provider.": "The customer holds this product already: cancel one at the provider.";
581
- readonly "The provider listed far fewer live subscriptions than OpenRails holds, so nothing was proposed. Check the PSP's account and reconcile again.": "The provider listed far fewer live subscriptions than OpenRails holds, so nothing was proposed. Check the PSP's account and reconcile again.";
582
- readonly "The provider refused this PSP's credentials. A new pull starts when they change in ": "The provider refused this PSP's credentials. A new pull starts when they change in ";
580
+ readonly "The provider listed far fewer live subscriptions than OpenRails holds, so nothing was proposed. Check the PSP's account and pull again.": "The provider listed far fewer live subscriptions than OpenRails holds, so nothing was proposed. Check the PSP's account and pull again.";
581
+ readonly "The provider refused this PSP's credentials. Correct them in ": "The provider refused this PSP's credentials. Correct them in ";
582
+ readonly ", then pull again.": ", then pull again.";
583
583
  readonly "The provider retired it: it keeps billing its subscriptions and is never sold.": "The provider retired it: it keeps billing its subscriptions and is never sold.";
584
584
  readonly "This PSP cannot be read: it is gone, or a credential the pull needs is not declared.": "This PSP cannot be read: it is gone, or a credential the pull needs is not declared.";
585
585
  readonly Treasury: "Treasury";
@@ -11,7 +11,7 @@ export declare function termsText(terms: ProviderCatalogTerms | null, rail?: str
11
11
  export declare function ProgressText({ imp }: {
12
12
  imp: PSPImport;
13
13
  }): React.JSX.Element;
14
- export declare function ReconcileDialog({ psp: initial, onClose, }: {
14
+ export declare function PullDialog({ psp: initial, onClose, }: {
15
15
  psp?: string;
16
16
  onClose: () => void;
17
17
  }): React.JSX.Element;
@@ -3,21 +3,20 @@ import { t as o } from "./admin-button-CrcYk5r0.js";
3
3
  import { d as s, l as c } from "./admin-capabilities-BDcZeHL_.js";
4
4
  import { o as l, u } from "./admin-format-DoohJ7Fg.js";
5
5
  import { a as d, n as f, o as p, r as m, s as h, t as g } from "./admin-table-BU6Tie69.js";
6
- import { t as _ } from "./admin-badge-pgG6D9-a.js";
7
- import { t as v } from "./admin-status-badge-0-K37EfN.js";
8
- import { a as y, o as b, r as x, t as S } from "./admin-card-DvTMc5Se.js";
9
- import { t as C } from "./admin-typed-confirm-dialog-Bk6XxmPb.js";
10
- import { a as w, c as T, d as E, l as D, r as O, s as k, t as A, u as j } from "./admin-shared-CzG8Pan3.js";
11
- import { n as M, r as N } from "./admin-map-dialog-DpGaIq52.js";
12
- import * as P from "react";
13
- import { useMutation as F, useQuery as I, useQueryClient as L } from "@tanstack/react-query";
14
- import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
6
+ import { t as _ } from "./admin-status-badge-0-K37EfN.js";
7
+ import { a as v, o as y, r as b, t as x } from "./admin-card-DvTMc5Se.js";
8
+ import { t as S } from "./admin-typed-confirm-dialog-Bk6XxmPb.js";
9
+ import { a as C, c as w, d as T, l as E, r as D, s as O, t as k, u as A } from "./admin-shared-lfIUEbPY.js";
10
+ import { n as j, r as M } from "./admin-map-dialog-DS2Wz6G3.js";
11
+ import * as N from "react";
12
+ import { useMutation as P, useQuery as F, useQueryClient as I } from "@tanstack/react-query";
13
+ import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
15
14
  //#region src/admin/pages/imports/detail.tsx
16
- var V = [
15
+ var B = [
17
16
  "customer",
18
17
  "subscription",
19
18
  "transaction"
20
- ], H = [
19
+ ], V = [
21
20
  "unmatched",
22
21
  "conflict",
23
22
  "linked",
@@ -25,113 +24,109 @@ var V = [
25
24
  "held",
26
25
  "imported"
27
26
  ];
28
- function U() {
29
- return c() ? /* @__PURE__ */ z(W, {}) : null;
27
+ function H() {
28
+ return c() ? /* @__PURE__ */ R(U, {}) : null;
30
29
  }
31
- function W() {
32
- let { text: r } = e(), { id: o = "" } = n(), { importQueries: s } = i(), c = T(), { data: u, error: C } = I(s.detail(o)), k = D(u);
33
- if (C) return /* @__PURE__ */ z("p", {
30
+ function U() {
31
+ let { text: r } = e(), { id: o = "" } = n(), { importQueries: s } = i(), c = w(), { data: u, error: S } = F(s.detail(o)), O = E(u);
32
+ if (S) return /* @__PURE__ */ R("p", {
34
33
  role: "alert",
35
34
  className: "text-destructive",
36
- children: C.message
35
+ children: S.message
37
36
  });
38
- if (!u) return /* @__PURE__ */ z("p", {
37
+ if (!u) return /* @__PURE__ */ R("p", {
39
38
  role: "status",
40
- children: /* @__PURE__ */ z(t, { id: "Loading…" })
39
+ children: /* @__PURE__ */ R(t, { id: "Loading…" })
41
40
  });
42
- let A = c.byId.get(u.psp);
43
- return /* @__PURE__ */ B("div", {
41
+ let k = c.byId.get(u.psp);
42
+ return /* @__PURE__ */ z("div", {
44
43
  className: "flex flex-col gap-5",
45
44
  children: [
46
- /* @__PURE__ */ B("div", {
45
+ /* @__PURE__ */ z("div", {
47
46
  className: "flex flex-wrap items-start justify-between gap-3",
48
- children: [/* @__PURE__ */ B("div", {
47
+ children: [/* @__PURE__ */ z("div", {
49
48
  className: "flex flex-col gap-1",
50
- children: [/* @__PURE__ */ B("h1", {
49
+ children: [/* @__PURE__ */ z("h1", {
51
50
  className: "flex items-center gap-2 text-xl font-semibold",
52
51
  children: [
53
52
  r("Import of "),
54
- A?.key ?? u.psp,
55
- /* @__PURE__ */ z(_, {
56
- variant: "secondary",
57
- children: u.origin
58
- }),
59
- /* @__PURE__ */ z(v, { status: u.status })
53
+ k?.key ?? u.psp,
54
+ /* @__PURE__ */ R(_, { status: u.status })
60
55
  ]
61
- }), /* @__PURE__ */ B("p", {
56
+ }), /* @__PURE__ */ z("p", {
62
57
  className: "text-sm text-muted-foreground",
63
58
  children: [
64
59
  r("Started "),
65
60
  l(u.created_at),
66
- u.applied_at && /* @__PURE__ */ B(R, { children: [r(" · applied "), l(u.applied_at)] })
61
+ u.applied_at && /* @__PURE__ */ z(L, { children: [r(" · applied "), l(u.applied_at)] })
67
62
  ]
68
63
  })]
69
- }), /* @__PURE__ */ z(J, {
64
+ }), /* @__PURE__ */ R(q, {
70
65
  imp: u,
71
- psp: A,
72
- superseded: !!k
66
+ psp: k,
67
+ superseded: !!O
73
68
  })]
74
69
  }),
75
- k && /* @__PURE__ */ z(O, { by: k }),
76
- /* @__PURE__ */ z(G, { imp: u }),
77
- /* @__PURE__ */ B(S, { children: [/* @__PURE__ */ z(y, { children: /* @__PURE__ */ z(b, {
70
+ O && /* @__PURE__ */ R(D, { by: O }),
71
+ /* @__PURE__ */ R(W, { imp: u }),
72
+ /* @__PURE__ */ z(x, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ R(y, {
78
73
  className: "text-base",
79
- children: /* @__PURE__ */ z(t, { id: "Records" })
80
- }) }), /* @__PURE__ */ B(x, {
74
+ children: /* @__PURE__ */ R(t, { id: "Records" })
75
+ }) }), /* @__PURE__ */ z(b, {
81
76
  className: "overflow-x-auto",
82
- children: [/* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(p, { children: /* @__PURE__ */ B(h, {
77
+ children: [/* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(p, { children: /* @__PURE__ */ z(h, {
83
78
  className: "hover:bg-transparent",
84
- children: [/* @__PURE__ */ z(d, {}), H.map((e) => /* @__PURE__ */ z(d, {
79
+ children: [/* @__PURE__ */ R(d, {}), V.map((e) => /* @__PURE__ */ R(d, {
85
80
  className: "text-muted-foreground",
86
81
  children: r(e)
87
82
  }, e))]
88
- }) }), /* @__PURE__ */ z(f, { children: V.map((e) => /* @__PURE__ */ B(h, {
83
+ }) }), /* @__PURE__ */ R(f, { children: B.map((e) => /* @__PURE__ */ z(h, {
89
84
  "data-kind": e,
90
- children: [/* @__PURE__ */ z(m, {
85
+ children: [/* @__PURE__ */ R(m, {
91
86
  className: "font-medium",
92
87
  children: r(e)
93
- }), H.map((t) => {
94
- let n = E(u, t, e);
95
- return /* @__PURE__ */ z(m, {
88
+ }), V.map((t) => {
89
+ let n = T(u, t, e);
90
+ return /* @__PURE__ */ R(m, {
96
91
  "data-state": t,
97
- children: n ? /* @__PURE__ */ z(a, {
92
+ children: n ? /* @__PURE__ */ R(a, {
98
93
  className: "underline",
99
94
  to: `/ops/imports/${u.id}/records?state=${t}&kind=${e}`,
100
95
  children: n
101
96
  }) : "0"
102
97
  }, t);
103
98
  })]
104
- }, e)) })] }), /* @__PURE__ */ z(a, {
99
+ }, e)) })] }), /* @__PURE__ */ R(a, {
105
100
  className: "mt-3 inline-block text-sm underline",
106
101
  to: `/ops/imports/${u.id}/records`,
107
- children: /* @__PURE__ */ z(t, { id: "Review records" })
102
+ children: /* @__PURE__ */ R(t, { id: "Review records" })
108
103
  })]
109
104
  })] }),
110
- /* @__PURE__ */ z(K, { imp: u }),
111
- A && /* @__PURE__ */ z(q, {
105
+ /* @__PURE__ */ R(G, { imp: u }),
106
+ k && /* @__PURE__ */ R(K, {
112
107
  imp: u,
113
- psp: A
108
+ psp: k
114
109
  }),
115
- /* @__PURE__ */ B(S, { children: [/* @__PURE__ */ z(y, { children: /* @__PURE__ */ z(b, {
110
+ /* @__PURE__ */ z(x, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ R(y, {
116
111
  className: "text-base",
117
- children: /* @__PURE__ */ z(t, { id: "Linking rules" })
118
- }) }), /* @__PURE__ */ B(x, { children: [/* @__PURE__ */ z("ol", {
112
+ children: /* @__PURE__ */ R(t, { id: "Linking rules" })
113
+ }) }), /* @__PURE__ */ z(b, { children: [/* @__PURE__ */ R("ol", {
119
114
  className: "list-decimal pl-5 text-sm",
120
- children: u.rules.map((e, t) => /* @__PURE__ */ z("li", { children: w(e) }, t))
121
- }), /* @__PURE__ */ z("p", {
115
+ children: u.rules.map((e, t) => /* @__PURE__ */ R("li", { children: C(e) }, t))
116
+ }), /* @__PURE__ */ R("p", {
122
117
  className: "mt-2 text-xs text-muted-foreground",
123
- children: /* @__PURE__ */ z(t, { id: "A manual link wins over every rule." })
118
+ children: /* @__PURE__ */ R(t, { id: "A manual link wins over every rule." })
124
119
  })] })] })
125
120
  ]
126
121
  });
127
122
  }
128
- function G({ imp: e }) {
129
- let n = j(e);
130
- return e.status === "failed" ? /* @__PURE__ */ B("div", {
123
+ function W({ imp: e }) {
124
+ let n = A(e);
125
+ return e.status === "failed" ? /* @__PURE__ */ z("div", {
131
126
  role: "alert",
132
127
  className: "rounded-md border border-destructive/40 p-3 text-sm",
133
128
  children: [
134
- /* @__PURE__ */ B("p", {
129
+ /* @__PURE__ */ z("p", {
135
130
  className: "font-medium text-destructive",
136
131
  children: [
137
132
  e.error_code ?? "failed",
@@ -139,56 +134,56 @@ function G({ imp: e }) {
139
134
  e.error
140
135
  ]
141
136
  }),
142
- e.error_code === "psp_credentials_rejected" && /* @__PURE__ */ B("p", {
137
+ e.error_code === "psp_credentials_rejected" && /* @__PURE__ */ z("p", {
143
138
  className: "mt-1",
144
139
  children: [
145
- /* @__PURE__ */ z(t, { id: "The provider refused this PSP's credentials. A new pull starts when they change in " }),
146
- /* @__PURE__ */ z(a, {
140
+ /* @__PURE__ */ R(t, { id: "The provider refused this PSP's credentials. Correct them in " }),
141
+ /* @__PURE__ */ R(a, {
147
142
  className: "underline",
148
143
  to: "/settings?tab=psps",
149
- children: /* @__PURE__ */ z(t, { id: "Settings › PSPs" })
144
+ children: /* @__PURE__ */ R(t, { id: "Settings › PSPs" })
150
145
  }),
151
- "."
146
+ /* @__PURE__ */ R(t, { id: ", then pull again." })
152
147
  ]
153
148
  }),
154
- e.error_code === "pull_roster_implausible" && /* @__PURE__ */ z("p", {
149
+ e.error_code === "pull_roster_implausible" && /* @__PURE__ */ R("p", {
155
150
  className: "mt-1",
156
- children: /* @__PURE__ */ z(t, { id: "The provider listed far fewer live subscriptions than OpenRails holds, so nothing was proposed. Check the PSP's account and reconcile again." })
151
+ children: /* @__PURE__ */ R(t, { id: "The provider listed far fewer live subscriptions than OpenRails holds, so nothing was proposed. Check the PSP's account and pull again." })
157
152
  }),
158
- e.error_code === "psp_not_readable" && /* @__PURE__ */ z("p", {
153
+ e.error_code === "psp_not_readable" && /* @__PURE__ */ R("p", {
159
154
  className: "mt-1",
160
- children: /* @__PURE__ */ z(t, { id: "This PSP cannot be read: it is gone, or a credential the pull needs is not declared." })
155
+ children: /* @__PURE__ */ R(t, { id: "This PSP cannot be read: it is gone, or a credential the pull needs is not declared." })
161
156
  })
162
157
  ]
163
- }) : /* @__PURE__ */ B("div", {
158
+ }) : /* @__PURE__ */ z("div", {
164
159
  className: "flex flex-col gap-1",
165
160
  "data-testid": "import-progress",
166
- children: [/* @__PURE__ */ z("p", {
161
+ children: [/* @__PURE__ */ R("p", {
167
162
  className: "text-sm",
168
- children: /* @__PURE__ */ z(A, { imp: e })
169
- }), n.phase === "history" && n.percent !== void 0 && /* @__PURE__ */ z("div", {
163
+ children: /* @__PURE__ */ R(k, { imp: e })
164
+ }), n.phase === "history" && n.percent !== void 0 && /* @__PURE__ */ R("div", {
170
165
  className: "h-1.5 w-full max-w-md rounded bg-muted",
171
- children: /* @__PURE__ */ z("div", {
166
+ children: /* @__PURE__ */ R("div", {
172
167
  className: "h-1.5 rounded bg-primary",
173
168
  style: { width: `${n.percent}%` }
174
169
  })
175
170
  })]
176
171
  });
177
172
  }
178
- function K({ imp: t }) {
173
+ function G({ imp: t }) {
179
174
  let { text: n } = e(), r = t.proposals;
180
- return !r.open && !r.approved && !r.dismissed && !r.superseded ? null : /* @__PURE__ */ B("p", {
175
+ return !r.open && !r.approved && !r.dismissed && !r.superseded ? null : /* @__PURE__ */ z("p", {
181
176
  className: "text-sm",
182
177
  "data-testid": "import-proposals",
183
- children: [/* @__PURE__ */ B(a, {
178
+ children: [/* @__PURE__ */ z(a, {
184
179
  className: "underline",
185
180
  to: `/ops/proposals?pull_id=${t.id}`,
186
181
  children: [r.open, n(" open proposals")]
187
182
  }), ` (${r.corrections}${n(" corrections Apply approves")}) · ${r.approved}${n(" approved")} · ${r.dismissed}${n(" dismissed")} · ${r.superseded}${n(" superseded")}`]
188
183
  });
189
184
  }
190
- function q({ imp: n, psp: r }) {
191
- let { text: o } = e(), { importQueries: c } = i(), l = s(), [_, v] = P.useState(), C = r.rail === "nmi" || r.rail === "stripe", { data: w } = I({
185
+ function K({ imp: n, psp: r }) {
186
+ let { text: o } = e(), { importQueries: c } = i(), l = s(), [_, S] = N.useState(), C = r.rail === "nmi" || r.rail === "stripe", { data: w } = F({
192
187
  ...c.providerCatalog({
193
188
  psp: r.id,
194
189
  kind: "price",
@@ -196,14 +191,14 @@ function q({ imp: n, psp: r }) {
196
191
  }, 500),
197
192
  enabled: C && !!n.pulled_at
198
193
  });
199
- return C ? /* @__PURE__ */ B(S, { children: [
200
- /* @__PURE__ */ z(y, { children: /* @__PURE__ */ z(b, {
194
+ return C ? /* @__PURE__ */ z(x, { children: [
195
+ /* @__PURE__ */ R(v, { children: /* @__PURE__ */ R(y, {
201
196
  className: "text-base",
202
- children: /* @__PURE__ */ z(t, { id: "Plans its subscriptions name" })
197
+ children: /* @__PURE__ */ R(t, { id: "Plans its subscriptions name" })
203
198
  }) }),
204
- /* @__PURE__ */ z(x, {
199
+ /* @__PURE__ */ R(b, {
205
200
  className: "overflow-x-auto",
206
- children: w?.data.length ? /* @__PURE__ */ B(g, { children: [/* @__PURE__ */ z(p, { children: /* @__PURE__ */ z(h, {
201
+ children: w?.data.length ? /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(p, { children: /* @__PURE__ */ R(h, {
207
202
  className: "hover:bg-transparent",
208
203
  children: [
209
204
  "Plan",
@@ -212,50 +207,50 @@ function q({ imp: n, psp: r }) {
212
207
  "Subscriptions",
213
208
  "Mapped to",
214
209
  ""
215
- ].map((e, t) => /* @__PURE__ */ z(d, {
210
+ ].map((e, t) => /* @__PURE__ */ R(d, {
216
211
  className: "text-muted-foreground",
217
212
  children: e && o(e)
218
213
  }, t))
219
- }) }), /* @__PURE__ */ z(f, { children: w.data.map((e) => /* @__PURE__ */ B(h, {
214
+ }) }), /* @__PURE__ */ R(f, { children: w.data.map((e) => /* @__PURE__ */ z(h, {
220
215
  "data-ref": e.ref,
221
216
  children: [
222
- /* @__PURE__ */ z(m, {
217
+ /* @__PURE__ */ R(m, {
223
218
  className: "font-mono text-xs",
224
219
  children: e.ref
225
220
  }),
226
- /* @__PURE__ */ z(m, { children: e.name ?? "—" }),
227
- /* @__PURE__ */ z(m, { children: k(e.terms, r.rail) }),
228
- /* @__PURE__ */ z(m, { children: e.subscriptions ?? "—" }),
229
- /* @__PURE__ */ z(m, { children: e.price ? /* @__PURE__ */ z(a, {
221
+ /* @__PURE__ */ R(m, { children: e.name ?? "—" }),
222
+ /* @__PURE__ */ R(m, { children: O(e.terms, r.rail) }),
223
+ /* @__PURE__ */ R(m, { children: e.subscriptions ?? "—" }),
224
+ /* @__PURE__ */ R(m, { children: e.price ? /* @__PURE__ */ R(a, {
230
225
  className: "underline",
231
226
  to: `/catalog/prices/${e.price}`,
232
227
  children: u(e.price, 14)
233
- }) : /* @__PURE__ */ z(t, { id: "Unmapped" }) }),
234
- /* @__PURE__ */ z(m, {
228
+ }) : /* @__PURE__ */ R(t, { id: "Unmapped" }) }),
229
+ /* @__PURE__ */ R(m, {
235
230
  className: "text-right",
236
- children: l && !e.price && /* @__PURE__ */ z(M, { onClick: () => v(e.ref) })
231
+ children: l && !e.price && /* @__PURE__ */ R(j, { onClick: () => S(e.ref) })
237
232
  })
238
233
  ]
239
- }, e.ref)) })] }) : /* @__PURE__ */ z("p", {
234
+ }, e.ref)) })] }) : /* @__PURE__ */ R("p", {
240
235
  className: "text-sm text-muted-foreground",
241
- children: /* @__PURE__ */ z(t, { id: "No staged subscription names a plan." })
236
+ children: /* @__PURE__ */ R(t, { id: "No staged subscription names a plan." })
242
237
  })
243
238
  }),
244
- _ && /* @__PURE__ */ z(N, {
239
+ _ && /* @__PURE__ */ R(M, {
245
240
  psp: r,
246
241
  priceRef: _,
247
- onClose: () => v(void 0)
242
+ onClose: () => S(void 0)
248
243
  })
249
244
  ] }) : null;
250
245
  }
251
- function J({ imp: n, psp: a, superseded: c }) {
252
- let { text: l } = e(), { importMutations: u, toast: d, toastApiError: f } = i(), p = L(), m = s(), h = F(u.link(p)), g = F(u.apply(p)), [_, v] = P.useState(!1);
246
+ function q({ imp: n, psp: a, superseded: c }) {
247
+ let { text: l } = e(), { importMutations: u, toast: d, toastApiError: f } = i(), p = I(), m = s(), h = P(u.link(p)), g = P(u.apply(p)), [_, v] = N.useState(!1);
253
248
  if (!m) return null;
254
249
  let y = !c && (n.status === "pulled" || n.status === "applied"), b = n.status === "applied", x = a?.key ?? n.psp;
255
- return /* @__PURE__ */ B("div", {
250
+ return /* @__PURE__ */ z("div", {
256
251
  className: "flex gap-2",
257
252
  children: [
258
- /* @__PURE__ */ z(o, {
253
+ /* @__PURE__ */ R(o, {
259
254
  variant: "outline",
260
255
  disabled: !y || h.isPending || r(n.status),
261
256
  onClick: async () => {
@@ -268,18 +263,18 @@ function J({ imp: n, psp: a, superseded: c }) {
268
263
  f(e, l("Re-link"));
269
264
  }
270
265
  },
271
- children: /* @__PURE__ */ z(t, { id: "Re-link" })
266
+ children: /* @__PURE__ */ R(t, { id: "Re-link" })
272
267
  }),
273
- /* @__PURE__ */ z(o, {
268
+ /* @__PURE__ */ R(o, {
274
269
  disabled: !y || g.isPending,
275
270
  onClick: () => v(!0),
276
271
  children: l(b ? "Apply again" : "Apply")
277
272
  }),
278
- /* @__PURE__ */ z(C, {
273
+ /* @__PURE__ */ R(S, {
279
274
  open: _,
280
275
  onOpenChange: v,
281
276
  title: l(b ? "Apply again" : "Apply import"),
282
- description: `${l("Lands the linked records as billing. ")}${E(n, "linked")}${l(" linked; ")}${E(n, "blocked")}${l(" blocked and ")}${E(n, "unmatched") + E(n, "conflict")}${l(" unmatched or conflicting stay staged.")}`,
277
+ description: `${l("Lands the linked records as billing. ")}${T(n, "linked")}${l(" linked; ")}${T(n, "blocked")}${l(" blocked and ")}${T(n, "unmatched") + T(n, "conflict")}${l(" unmatched or conflicting stay staged.")}`,
283
278
  confirmationWord: x,
284
279
  actionLabel: l(b ? "Apply again" : "Apply"),
285
280
  onConfirm: async () => {
@@ -294,6 +289,6 @@ function J({ imp: n, psp: a, superseded: c }) {
294
289
  });
295
290
  }
296
291
  //#endregion
297
- export { U as ImportDetailPage };
292
+ export { H as ImportDetailPage };
298
293
 
299
- //# sourceMappingURL=admin-detail-Ceod8AXy.js.map
294
+ //# sourceMappingURL=admin-detail-3wFIDPNB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-detail-3wFIDPNB.js","names":[],"sources":["../src/admin/pages/imports/detail.tsx"],"sourcesContent":["import { AdminMessage, useAdminUI } from \"#orck/admin/ui-context\"\nimport { useAdminServices } from \"#orck/admin/context\"\nimport * as React from \"react\"\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\"\nimport { Link, useParams } from \"#orck/admin/router\"\n\nimport { StatusBadge } from \"#orck/admin/components/status-badge\"\nimport { TypedConfirmDialog } from \"#orck/admin/components/typed-confirm-dialog\"\nimport { Button } from \"#orck/admin/components/ui/button\"\nimport {\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n} from \"#orck/admin/components/ui/card\"\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from \"#orck/admin/components/ui/table\"\nimport {\n useMerchantConfig,\n useMerchantConfigUpdates,\n} from \"#orck/admin/lib/capabilities\"\nimport { importBusy } from \"#orck/admin/lib/import-queries\"\nimport { formatDate, shortId } from \"#orck/admin/lib/format\"\nimport type { PSP, PSPImport } from \"#orck/client/generated/wire\"\nimport {\n MapButton,\n MapPriceDialog,\n} from \"#orck/admin/pages/provider-prices/map-dialog\"\nimport { importProgress, recordCount } from \"./progress\"\nimport {\n ProgressText,\n Superseded,\n ruleText,\n termsText,\n usePSPs,\n useSuccessor,\n} from \"./shared\"\n\nconst KINDS = [\"customer\", \"subscription\", \"transaction\"] as const\nconst STATES = [\n \"unmatched\",\n \"conflict\",\n \"linked\",\n \"blocked\",\n \"held\",\n \"imported\",\n] as const\n\nexport function ImportDetailPage() {\n return useMerchantConfig() ? <ImportDetail /> : null\n}\n\nfunction ImportDetail() {\n const { text } = useAdminUI()\n const { id = \"\" } = useParams<\"id\">()\n const { importQueries } = useAdminServices()\n const psps = usePSPs()\n const { data: imp, error } = useQuery(importQueries.detail(id))\n const newer = useSuccessor(imp)\n if (error)\n return (\n <p role=\"alert\" className=\"text-destructive\">\n {error.message}\n </p>\n )\n if (!imp)\n return (\n <p role=\"status\">\n <AdminMessage id=\"Loading…\" />\n </p>\n )\n const psp = psps.byId.get(imp.psp)\n return (\n <div className=\"flex flex-col gap-5\">\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <div className=\"flex flex-col gap-1\">\n <h1 className=\"flex items-center gap-2 text-xl font-semibold\">\n {text(\"Import of \")}\n {psp?.key ?? imp.psp}\n <StatusBadge status={imp.status} />\n </h1>\n <p className=\"text-sm text-muted-foreground\">\n {text(\"Started \")}\n {formatDate(imp.created_at)}\n {imp.applied_at && (\n <>\n {text(\" · applied \")}\n {formatDate(imp.applied_at)}\n </>\n )}\n </p>\n </div>\n <ImportActions imp={imp} psp={psp} superseded={Boolean(newer)} />\n </div>\n {newer && <Superseded by={newer} />}\n <Progress imp={imp} />\n <Card>\n <CardHeader>\n <CardTitle className=\"text-base\">\n <AdminMessage id=\"Records\" />\n </CardTitle>\n </CardHeader>\n <CardContent className=\"overflow-x-auto\">\n <Table>\n <TableHeader>\n <TableRow className=\"hover:bg-transparent\">\n <TableHead />\n {STATES.map((s) => (\n <TableHead key={s} className=\"text-muted-foreground\">\n {text(s)}\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody>\n {KINDS.map((kind) => (\n <TableRow key={kind} data-kind={kind}>\n <TableCell className=\"font-medium\">{text(kind)}</TableCell>\n {STATES.map((state) => {\n const n = recordCount(imp, state, kind)\n return (\n <TableCell key={state} data-state={state}>\n {n ? (\n <Link\n className=\"underline\"\n to={`/ops/imports/${imp.id}/records?state=${state}&kind=${kind}`}\n >\n {n}\n </Link>\n ) : (\n \"0\"\n )}\n </TableCell>\n )\n })}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Link\n className=\"mt-3 inline-block text-sm underline\"\n to={`/ops/imports/${imp.id}/records`}\n >\n <AdminMessage id=\"Review records\" />\n </Link>\n </CardContent>\n </Card>\n <ProposalCounts imp={imp} />\n {psp && <Plans imp={imp} psp={psp} />}\n <Card>\n <CardHeader>\n <CardTitle className=\"text-base\">\n <AdminMessage id=\"Linking rules\" />\n </CardTitle>\n </CardHeader>\n <CardContent>\n <ol className=\"list-decimal pl-5 text-sm\">\n {imp.rules.map((rule, i) => (\n <li key={i}>{ruleText(rule)}</li>\n ))}\n </ol>\n <p className=\"mt-2 text-xs text-muted-foreground\">\n <AdminMessage id=\"A manual link wins over every rule.\" />\n </p>\n </CardContent>\n </Card>\n </div>\n )\n}\n\nfunction Progress({ imp }: { imp: PSPImport }) {\n const p = importProgress(imp)\n if (imp.status === \"failed\")\n return (\n <div\n role=\"alert\"\n className=\"rounded-md border border-destructive/40 p-3 text-sm\"\n >\n <p className=\"font-medium text-destructive\">\n {imp.error_code ?? \"failed\"}: {imp.error}\n </p>\n {imp.error_code === \"psp_credentials_rejected\" && (\n <p className=\"mt-1\">\n <AdminMessage id=\"The provider refused this PSP's credentials. Correct them in \" />\n <Link className=\"underline\" to=\"/settings?tab=psps\">\n <AdminMessage id=\"Settings › PSPs\" />\n </Link>\n <AdminMessage id=\", then pull again.\" />\n </p>\n )}\n {imp.error_code === \"pull_roster_implausible\" && (\n <p className=\"mt-1\">\n <AdminMessage id=\"The provider listed far fewer live subscriptions than OpenRails holds, so nothing was proposed. Check the PSP's account and pull again.\" />\n </p>\n )}\n {imp.error_code === \"psp_not_readable\" && (\n <p className=\"mt-1\">\n <AdminMessage id=\"This PSP cannot be read: it is gone, or a credential the pull needs is not declared.\" />\n </p>\n )}\n </div>\n )\n return (\n <div className=\"flex flex-col gap-1\" data-testid=\"import-progress\">\n <p className=\"text-sm\">\n <ProgressText imp={imp} />\n </p>\n {p.phase === \"history\" && p.percent !== undefined && (\n <div className=\"h-1.5 w-full max-w-md rounded bg-muted\">\n <div\n className=\"h-1.5 rounded bg-primary\"\n style={{ width: `${p.percent}%` }}\n />\n </div>\n )}\n </div>\n )\n}\n\n// ProposalCounts are the differences the pull found in what OpenRails holds:\n// Apply approves the corrections; the rest wait in the inbox.\nfunction ProposalCounts({ imp }: { imp: PSPImport }) {\n const { text } = useAdminUI()\n const p = imp.proposals\n if (!p.open && !p.approved && !p.dismissed && !p.superseded) return null\n return (\n <p className=\"text-sm\" data-testid=\"import-proposals\">\n <Link className=\"underline\" to={`/ops/proposals?pull_id=${imp.id}`}>\n {p.open}\n {text(\" open proposals\")}\n </Link>\n {` (${p.corrections}${text(\" corrections Apply approves\")}) · ${p.approved}${text(\" approved\")} · ${p.dismissed}${text(\" dismissed\")} · ${p.superseded}${text(\" superseded\")}`}\n </p>\n )\n}\n\n// Plans are the provider prices the import's subscriptions name: each must\n// map to a product before its subscriptions land.\nfunction Plans({ imp, psp }: { imp: PSPImport; psp: PSP }) {\n const { text } = useAdminUI()\n const { importQueries } = useAdminServices()\n const canUpdate = useMerchantConfigUpdates()\n const [mapping, setMapping] = React.useState<string>()\n const observed = psp.rail === \"nmi\" || psp.rail === \"stripe\"\n const { data } = useQuery({\n ...importQueries.providerCatalog(\n { psp: psp.id, kind: \"price\", import: imp.id },\n 500\n ),\n enabled: observed && Boolean(imp.pulled_at),\n })\n if (!observed) return null\n return (\n <Card>\n <CardHeader>\n <CardTitle className=\"text-base\">\n <AdminMessage id=\"Plans its subscriptions name\" />\n </CardTitle>\n </CardHeader>\n <CardContent className=\"overflow-x-auto\">\n {!data?.data.length ? (\n <p className=\"text-sm text-muted-foreground\">\n <AdminMessage id=\"No staged subscription names a plan.\" />\n </p>\n ) : (\n <Table>\n <TableHeader>\n <TableRow className=\"hover:bg-transparent\">\n {[\n \"Plan\",\n \"Name\",\n \"Terms\",\n \"Subscriptions\",\n \"Mapped to\",\n \"\",\n ].map((h, i) => (\n <TableHead key={i} className=\"text-muted-foreground\">\n {h && text(h)}\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.data.map((o) => (\n <TableRow key={o.ref} data-ref={o.ref}>\n <TableCell className=\"font-mono text-xs\">{o.ref}</TableCell>\n <TableCell>{o.name ?? \"—\"}</TableCell>\n <TableCell>{termsText(o.terms, psp.rail)}</TableCell>\n <TableCell>{o.subscriptions ?? \"—\"}</TableCell>\n <TableCell>\n {o.price ? (\n <Link\n className=\"underline\"\n to={`/catalog/prices/${o.price}`}\n >\n {shortId(o.price, 14)}\n </Link>\n ) : (\n <AdminMessage id=\"Unmapped\" />\n )}\n </TableCell>\n <TableCell className=\"text-right\">\n {canUpdate && !o.price && (\n <MapButton onClick={() => setMapping(o.ref)} />\n )}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n )}\n </CardContent>\n {mapping && (\n <MapPriceDialog\n psp={psp}\n priceRef={mapping}\n onClose={() => setMapping(undefined)}\n />\n )}\n </Card>\n )\n}\n\n// ImportActions re-links (after mappings or a mapped plan) and applies. Apply\n// lands only linked records and is refused while the import's job runs.\nfunction ImportActions({\n imp,\n psp,\n superseded,\n}: {\n imp: PSPImport\n psp?: PSP\n superseded: boolean\n}) {\n const { text } = useAdminUI()\n const { importMutations, toast, toastApiError } = useAdminServices()\n const queryClient = useQueryClient()\n const canUpdate = useMerchantConfigUpdates()\n const relink = useMutation(importMutations.link(queryClient))\n const apply = useMutation(importMutations.apply(queryClient))\n const [confirming, setConfirming] = React.useState(false)\n if (!canUpdate) return null\n const ready =\n !superseded && (imp.status === \"pulled\" || imp.status === \"applied\")\n const again = imp.status === \"applied\"\n const word = psp?.key ?? imp.psp\n return (\n <div className=\"flex gap-2\">\n <Button\n variant=\"outline\"\n disabled={!ready || relink.isPending || importBusy(imp.status)}\n onClick={async () => {\n try {\n await relink.mutateAsync({ id: imp.id, params: {} })\n toast.success(text(\"Re-link requested\"))\n } catch (err) {\n toastApiError(err, text(\"Re-link\"))\n }\n }}\n >\n <AdminMessage id=\"Re-link\" />\n </Button>\n <Button\n disabled={!ready || apply.isPending}\n onClick={() => setConfirming(true)}\n >\n {again ? text(\"Apply again\") : text(\"Apply\")}\n </Button>\n <TypedConfirmDialog\n open={confirming}\n onOpenChange={setConfirming}\n title={again ? text(\"Apply again\") : text(\"Apply import\")}\n description={`${text(\"Lands the linked records as billing. \")}${recordCount(imp, \"linked\")}${text(\" linked; \")}${recordCount(imp, \"blocked\")}${text(\" blocked and \")}${recordCount(imp, \"unmatched\") + recordCount(imp, \"conflict\")}${text(\" unmatched or conflicting stay staged.\")}`}\n confirmationWord={word}\n actionLabel={again ? text(\"Apply again\") : text(\"Apply\")}\n onConfirm={async () => {\n try {\n await apply.mutateAsync(imp.id)\n toast.success(text(\"Apply queued\"))\n } catch (err) {\n toastApiError(err, text(\"Apply import\"))\n }\n }}\n />\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AA4CA,IAAM,IAAQ;CAAC;CAAY;CAAgB;AAAa,GAClD,IAAS;CACb;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAAgB,IAAmB;CACjC,OAAO,EAAkB,IAAI,kBAAC,GAAD,CAAe,CAAA,IAAI;AAClD;AAEA,SAAS,IAAe;CACtB,IAAM,EAAE,YAAS,EAAW,GACtB,EAAE,QAAK,OAAO,EAAgB,GAC9B,EAAE,qBAAkB,EAAiB,GACrC,IAAO,EAAQ,GACf,EAAE,MAAM,GAAK,aAAU,EAAS,EAAc,OAAO,CAAE,CAAC,GACxD,IAAQ,EAAa,CAAG;CAC9B,IAAI,GACF,OACE,kBAAC,KAAD;EAAG,MAAK;EAAQ,WAAU;EACvB,UAAA,EAAM;CACN,CAAA;CAEP,IAAI,CAAC,GACH,OACE,kBAAC,KAAD;EAAG,MAAK;EACN,UAAA,kBAAC,GAAD,EAAc,IAAG,WAAY,CAAA;CAC5B,CAAA;CAEP,IAAM,IAAM,EAAK,KAAK,IAAI,EAAI,GAAG;CACjC,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,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