@delopay/sdk 0.137.0 → 0.139.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/internal.cjs CHANGED
@@ -67,6 +67,7 @@ __export(internal_exports, {
67
67
  DelopayAuthenticationError: () => DelopayAuthenticationError,
68
68
  DelopayError: () => DelopayError,
69
69
  DelopayInternal: () => DelopayInternal,
70
+ Diagnostic: () => Diagnostic,
70
71
  Export: () => Export,
71
72
  FeatureMatrix: () => FeatureMatrix,
72
73
  FeeProgramBuilder: () => FeeProgramBuilder,
@@ -8784,6 +8785,210 @@ var ConnectorRestrictions = class {
8784
8785
  }
8785
8786
  };
8786
8787
 
8788
+ // src/internal/resources/diagnostic.ts
8789
+ var Diagnostic = class {
8790
+ constructor(request) {
8791
+ this.request = request;
8792
+ }
8793
+ /**
8794
+ * The ranked attention board — the page's landing state, with nothing typed.
8795
+ *
8796
+ * Always carries `checks_run` and `vitals`, so an empty `items` reads as
8797
+ * "checked these things at 14:02, all clear" rather than as a panel that
8798
+ * failed to load. A check that could not run is **absent** from `checks_run`
8799
+ * rather than silently counted as clear.
8800
+ */
8801
+ async attention(body) {
8802
+ return this.request("POST", "/admin-portal/diagnostic/attention", { body: body ?? {} });
8803
+ }
8804
+ /**
8805
+ * Provider webhooks received, across every merchant.
8806
+ *
8807
+ * `source_verified: false` selects rows that failed verification **or** never
8808
+ * reached it — the deliveries that failed before verification was attempted
8809
+ * are exactly the ones an operator opens this tab for.
8810
+ */
8811
+ async listIncomingWebhooks(body) {
8812
+ return this.request("POST", "/admin-portal/diagnostic/webhooks/incoming", {
8813
+ body: body ?? {}
8814
+ });
8815
+ }
8816
+ /**
8817
+ * One delivery in full: masked headers and body, the verification verdict,
8818
+ * and the router log lines for its request id.
8819
+ *
8820
+ * `router_logs` is `null` — not `[]` — when the log store is unreachable, and
8821
+ * `router_logs_unavailable` then says why. Render the first as *unavailable*,
8822
+ * never as "the router logged nothing".
8823
+ */
8824
+ async getIncomingWebhook(eventId) {
8825
+ return this.request(
8826
+ "GET",
8827
+ `/admin-portal/diagnostic/webhooks/incoming/${encodeURIComponent(eventId)}`
8828
+ );
8829
+ }
8830
+ /** Shop webhooks sent, across every merchant, with each event's attempts folded in. */
8831
+ async listOutgoingWebhooks(body) {
8832
+ return this.request("POST", "/admin-portal/diagnostic/webhooks/outgoing", {
8833
+ body: body ?? {}
8834
+ });
8835
+ }
8836
+ /**
8837
+ * The four tiles above the shop-webhooks table.
8838
+ *
8839
+ * Counted under the same window and environment as the table but **without**
8840
+ * its delivery filter — the tiles say what the window holds, and applying the
8841
+ * filter would make every tile agree with whichever one is selected.
8842
+ */
8843
+ async outgoingWebhookSummary(body) {
8844
+ return this.request("POST", "/admin-portal/diagnostic/webhooks/outgoing/summary", {
8845
+ body: body ?? {}
8846
+ });
8847
+ }
8848
+ /**
8849
+ * Connector calls the router made.
8850
+ *
8851
+ * List rows carry no payload. Fetch one with {@link getConnectorCall} for the
8852
+ * masked request and response.
8853
+ */
8854
+ async listConnectorCalls(body) {
8855
+ return this.request("POST", "/admin-portal/diagnostic/connector-calls", { body: body ?? {} });
8856
+ }
8857
+ /** One connector call, with its masked payloads. */
8858
+ async getConnectorCall(id) {
8859
+ return this.request(
8860
+ "GET",
8861
+ `/admin-portal/diagnostic/connector-calls/${encodeURIComponent(id)}`
8862
+ );
8863
+ }
8864
+ /**
8865
+ * Router logs, proxied from the deployment's log store.
8866
+ *
8867
+ * Answers a {@link DiagnosticPanel}. Check `status` before reading `data`:
8868
+ * `'unavailable'` means the store did not answer, which is the opposite of
8869
+ * "there were no errors" and must be rendered as such.
8870
+ */
8871
+ async routerLogs(body) {
8872
+ return this.request("POST", "/admin-portal/diagnostic/logs", { body: body ?? {} });
8873
+ }
8874
+ /**
8875
+ * Payments that are stuck or failed.
8876
+ *
8877
+ * Stuck means non-terminal for longer than `stuck_minutes`; failed means it
8878
+ * ended without succeeding inside the window. Omitting `stuck_minutes` turns
8879
+ * the first arm off rather than widening it.
8880
+ */
8881
+ async listPayments(body) {
8882
+ return this.request("POST", "/admin-portal/diagnostic/payments", { body: body ?? {} });
8883
+ }
8884
+ /**
8885
+ * The error codes in this window, each with its count in the previous window
8886
+ * of equal length.
8887
+ *
8888
+ * `previous_count: null` means the code did not appear before — render it as
8889
+ * "new" rather than as a fall to zero.
8890
+ */
8891
+ async paymentErrorCodes(body) {
8892
+ return this.request("POST", "/admin-portal/diagnostic/payments/error-codes", {
8893
+ body: body ?? {}
8894
+ });
8895
+ }
8896
+ /**
8897
+ * Everything about one payment, in one call: the payment, its attempts, its
8898
+ * status history, its client context, and what it produced — connector calls,
8899
+ * webhooks both ways, and scheduler jobs.
8900
+ *
8901
+ * Read `diagnostic_capture` before rendering an empty section. A payment with
8902
+ * no connector calls and a deployment that never recorded any are different
8903
+ * facts, and the second must not read as the first.
8904
+ *
8905
+ * Typed loosely on purpose: the payment, attempts, status-history and
8906
+ * client-context halves are the merchant-facing shapes this package already
8907
+ * exports, and re-declaring them here would give consumers two names for one
8908
+ * thing that could then drift apart.
8909
+ */
8910
+ async getPayment(paymentId) {
8911
+ return this.request(
8912
+ "GET",
8913
+ `/admin-portal/diagnostic/payments/${encodeURIComponent(paymentId)}`
8914
+ );
8915
+ }
8916
+ /** Scheduler tasks, most overdue first. */
8917
+ async listQueues(body) {
8918
+ return this.request("POST", "/admin-portal/diagnostic/queues", { body: body ?? {} });
8919
+ }
8920
+ /**
8921
+ * The four tiles above the queues table, plus the approvals count.
8922
+ *
8923
+ * `pending_approvals` is a **different** queue from `pending_count`: a stalled
8924
+ * scheduler needs a consumer, a full approvals queue needs a person, and
8925
+ * folding them into one number would point an operator at the wrong fix.
8926
+ */
8927
+ async queueSummary() {
8928
+ return this.request("GET", "/admin-portal/diagnostic/queues/summary");
8929
+ }
8930
+ /**
8931
+ * Replicas and their dependencies.
8932
+ *
8933
+ * `build_mismatch` is computed server-side rather than left for a caller to
8934
+ * notice by comparing strings: one replica in four answering differently
8935
+ * explains a whole class of "it only fails sometimes" incident, and is
8936
+ * invisible unless something says it out loud.
8937
+ */
8938
+ async infrastructure() {
8939
+ return this.request("GET", "/admin-portal/diagnostic/infrastructure");
8940
+ }
8941
+ /**
8942
+ * Firing alerts, proxied from Alertmanager.
8943
+ *
8944
+ * Answers a {@link DiagnosticPanel} for the same reason {@link routerLogs}
8945
+ * does: a strip that renders empty because Alertmanager is down says "nothing
8946
+ * is firing", which is the most dangerous sentence this page could print.
8947
+ */
8948
+ async alerts() {
8949
+ return this.request("GET", "/admin-portal/diagnostic/alerts");
8950
+ }
8951
+ /** Config edits and admin actions inside the window. */
8952
+ async listChanges(body) {
8953
+ return this.request("POST", "/admin-portal/diagnostic/changes", { body: body ?? {} });
8954
+ }
8955
+ /**
8956
+ * What a pasted id is, and whether we hold it.
8957
+ *
8958
+ * `kind` and `found` are separate answers on purpose. A well-shaped id that
8959
+ * matches nothing comes back `found: false` with the three `reasons` and
8960
+ * their fixes — render that, never an empty table, which reads as "no such
8961
+ * payment" when the real answer is "outside the window" or "it is a test
8962
+ * payment".
8963
+ */
8964
+ async resolveId(id) {
8965
+ return this.request("GET", `/admin-portal/diagnostic/resolve/${encodeURIComponent(id)}`);
8966
+ }
8967
+ /**
8968
+ * One id across every source, as an ordered span list.
8969
+ *
8970
+ * Accepts a payment, attempt, event or request id. Sources that could not be
8971
+ * read are named in `unavailable_sources` rather than left out: a waterfall
8972
+ * with an unexplained gap reads as a period when nothing happened.
8973
+ */
8974
+ async trace(id) {
8975
+ return this.request("GET", `/admin-portal/diagnostic/trace/${encodeURIComponent(id)}`);
8976
+ }
8977
+ /**
8978
+ * Unmask one field of one object.
8979
+ *
8980
+ * **Writes an audit row** naming the operator, the field and the object,
8981
+ * before the value is returned — a reveal that could not be audited does not
8982
+ * happen. Needs a dashboard JWT holding `DiagnosticReveal`; an admin API key
8983
+ * cannot call it, because an API key names no person.
8984
+ *
8985
+ * `reason` is required and is stored verbatim.
8986
+ */
8987
+ async reveal(body) {
8988
+ return this.request("POST", "/admin-portal/diagnostic/reveal", { body });
8989
+ }
8990
+ };
8991
+
8787
8992
  // src/internal/resources/gsm.ts
8788
8993
  var Gsm = class {
8789
8994
  constructor(request) {
@@ -9072,6 +9277,7 @@ var DelopayInternal = class extends Delopay {
9072
9277
  this.configs = new Configs(request);
9073
9278
  this.connectorRestrictions = new ConnectorRestrictions(request);
9074
9279
  this.connectorRestrictionRules = new ConnectorRestrictionRules(request);
9280
+ this.diagnostic = new Diagnostic(request);
9075
9281
  this.gsm = new Gsm(request);
9076
9282
  this.platformBilling = new PlatformBilling(request);
9077
9283
  this.platformFees = new PlatformFees(request);
@@ -9126,6 +9332,7 @@ var DelopayInternal = class extends Delopay {
9126
9332
  DelopayAuthenticationError,
9127
9333
  DelopayError,
9128
9334
  DelopayInternal,
9335
+ Diagnostic,
9129
9336
  Export,
9130
9337
  FeatureMatrix,
9131
9338
  FeeProgramBuilder,