@delopay/sdk 0.136.0 → 0.138.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.js CHANGED
@@ -1,4 +1,14 @@
1
1
  import {
2
+ AIRWALLEX_AUTOFILL_TREATMENTS,
3
+ AIRWALLEX_CARD_LAYOUTS,
4
+ AIRWALLEX_CARD_PRESETS,
5
+ AIRWALLEX_CARD_PRESET_FALLBACK,
6
+ AIRWALLEX_FIELD_CHROMES,
7
+ AIRWALLEX_FIELD_FONT_SIZES,
8
+ AIRWALLEX_FIELD_WEIGHTS,
9
+ AIRWALLEX_FOCUS_RINGS,
10
+ AIRWALLEX_LABEL_STYLES,
11
+ AIRWALLEX_NETWORK_MARKS,
2
12
  ALL_CUSTOM_FIELD_CONDITION_SOURCES,
3
13
  ALL_CUSTOM_FIELD_OPERATORS,
4
14
  ALL_CUSTOM_FIELD_TYPES,
@@ -69,9 +79,15 @@ import {
69
79
  WCAG_AA_TEXT,
70
80
  WCAG_AA_UI,
71
81
  Webhooks,
82
+ airwallexCardLayout,
83
+ airwallexCardLayoutIsCoherent,
84
+ airwallexCellWeight,
85
+ airwallexFieldFontPx,
86
+ airwallexFieldWeightValue,
72
87
  allOf,
73
88
  anyOf,
74
89
  applyBrandingVariables,
90
+ asAirwallexCardPreset,
75
91
  buildBrandingExport,
76
92
  buttonPadValue,
77
93
  canonicalSectionId,
@@ -135,6 +151,8 @@ import {
135
151
  programToTree,
136
152
  radiusValue,
137
153
  readableInkOn,
154
+ resolveAirwallexCardPreset,
155
+ resolveAirwallexLabelStyle,
138
156
  ruleMatchToTree,
139
157
  sanitizeCustomCss,
140
158
  sectionLabel,
@@ -149,7 +167,7 @@ import {
149
167
  validatePanes,
150
168
  verticalGapValue,
151
169
  visibleCustomFields
152
- } from "./chunk-GGXTGWV5.js";
170
+ } from "./chunk-OMJ6MVD4.js";
153
171
 
154
172
  // src/internal/resources/admin.ts
155
173
  var Admin = class {
@@ -845,6 +863,210 @@ var ConnectorRestrictions = class {
845
863
  }
846
864
  };
847
865
 
866
+ // src/internal/resources/diagnostic.ts
867
+ var Diagnostic = class {
868
+ constructor(request) {
869
+ this.request = request;
870
+ }
871
+ /**
872
+ * The ranked attention board — the page's landing state, with nothing typed.
873
+ *
874
+ * Always carries `checks_run` and `vitals`, so an empty `items` reads as
875
+ * "checked these things at 14:02, all clear" rather than as a panel that
876
+ * failed to load. A check that could not run is **absent** from `checks_run`
877
+ * rather than silently counted as clear.
878
+ */
879
+ async attention(body) {
880
+ return this.request("POST", "/admin-portal/diagnostic/attention", { body: body ?? {} });
881
+ }
882
+ /**
883
+ * Provider webhooks received, across every merchant.
884
+ *
885
+ * `source_verified: false` selects rows that failed verification **or** never
886
+ * reached it — the deliveries that failed before verification was attempted
887
+ * are exactly the ones an operator opens this tab for.
888
+ */
889
+ async listIncomingWebhooks(body) {
890
+ return this.request("POST", "/admin-portal/diagnostic/webhooks/incoming", {
891
+ body: body ?? {}
892
+ });
893
+ }
894
+ /**
895
+ * One delivery in full: masked headers and body, the verification verdict,
896
+ * and the router log lines for its request id.
897
+ *
898
+ * `router_logs` is `null` — not `[]` — when the log store is unreachable, and
899
+ * `router_logs_unavailable` then says why. Render the first as *unavailable*,
900
+ * never as "the router logged nothing".
901
+ */
902
+ async getIncomingWebhook(eventId) {
903
+ return this.request(
904
+ "GET",
905
+ `/admin-portal/diagnostic/webhooks/incoming/${encodeURIComponent(eventId)}`
906
+ );
907
+ }
908
+ /** Shop webhooks sent, across every merchant, with each event's attempts folded in. */
909
+ async listOutgoingWebhooks(body) {
910
+ return this.request("POST", "/admin-portal/diagnostic/webhooks/outgoing", {
911
+ body: body ?? {}
912
+ });
913
+ }
914
+ /**
915
+ * The four tiles above the shop-webhooks table.
916
+ *
917
+ * Counted under the same window and environment as the table but **without**
918
+ * its delivery filter — the tiles say what the window holds, and applying the
919
+ * filter would make every tile agree with whichever one is selected.
920
+ */
921
+ async outgoingWebhookSummary(body) {
922
+ return this.request("POST", "/admin-portal/diagnostic/webhooks/outgoing/summary", {
923
+ body: body ?? {}
924
+ });
925
+ }
926
+ /**
927
+ * Connector calls the router made.
928
+ *
929
+ * List rows carry no payload. Fetch one with {@link getConnectorCall} for the
930
+ * masked request and response.
931
+ */
932
+ async listConnectorCalls(body) {
933
+ return this.request("POST", "/admin-portal/diagnostic/connector-calls", { body: body ?? {} });
934
+ }
935
+ /** One connector call, with its masked payloads. */
936
+ async getConnectorCall(id) {
937
+ return this.request(
938
+ "GET",
939
+ `/admin-portal/diagnostic/connector-calls/${encodeURIComponent(id)}`
940
+ );
941
+ }
942
+ /**
943
+ * Router logs, proxied from the deployment's log store.
944
+ *
945
+ * Answers a {@link DiagnosticPanel}. Check `status` before reading `data`:
946
+ * `'unavailable'` means the store did not answer, which is the opposite of
947
+ * "there were no errors" and must be rendered as such.
948
+ */
949
+ async routerLogs(body) {
950
+ return this.request("POST", "/admin-portal/diagnostic/logs", { body: body ?? {} });
951
+ }
952
+ /**
953
+ * Payments that are stuck or failed.
954
+ *
955
+ * Stuck means non-terminal for longer than `stuck_minutes`; failed means it
956
+ * ended without succeeding inside the window. Omitting `stuck_minutes` turns
957
+ * the first arm off rather than widening it.
958
+ */
959
+ async listPayments(body) {
960
+ return this.request("POST", "/admin-portal/diagnostic/payments", { body: body ?? {} });
961
+ }
962
+ /**
963
+ * The error codes in this window, each with its count in the previous window
964
+ * of equal length.
965
+ *
966
+ * `previous_count: null` means the code did not appear before — render it as
967
+ * "new" rather than as a fall to zero.
968
+ */
969
+ async paymentErrorCodes(body) {
970
+ return this.request("POST", "/admin-portal/diagnostic/payments/error-codes", {
971
+ body: body ?? {}
972
+ });
973
+ }
974
+ /**
975
+ * Everything about one payment, in one call: the payment, its attempts, its
976
+ * status history, its client context, and what it produced — connector calls,
977
+ * webhooks both ways, and scheduler jobs.
978
+ *
979
+ * Read `diagnostic_capture` before rendering an empty section. A payment with
980
+ * no connector calls and a deployment that never recorded any are different
981
+ * facts, and the second must not read as the first.
982
+ *
983
+ * Typed loosely on purpose: the payment, attempts, status-history and
984
+ * client-context halves are the merchant-facing shapes this package already
985
+ * exports, and re-declaring them here would give consumers two names for one
986
+ * thing that could then drift apart.
987
+ */
988
+ async getPayment(paymentId) {
989
+ return this.request(
990
+ "GET",
991
+ `/admin-portal/diagnostic/payments/${encodeURIComponent(paymentId)}`
992
+ );
993
+ }
994
+ /** Scheduler tasks, most overdue first. */
995
+ async listQueues(body) {
996
+ return this.request("POST", "/admin-portal/diagnostic/queues", { body: body ?? {} });
997
+ }
998
+ /**
999
+ * The four tiles above the queues table, plus the approvals count.
1000
+ *
1001
+ * `pending_approvals` is a **different** queue from `pending_count`: a stalled
1002
+ * scheduler needs a consumer, a full approvals queue needs a person, and
1003
+ * folding them into one number would point an operator at the wrong fix.
1004
+ */
1005
+ async queueSummary() {
1006
+ return this.request("GET", "/admin-portal/diagnostic/queues/summary");
1007
+ }
1008
+ /**
1009
+ * Replicas and their dependencies.
1010
+ *
1011
+ * `build_mismatch` is computed server-side rather than left for a caller to
1012
+ * notice by comparing strings: one replica in four answering differently
1013
+ * explains a whole class of "it only fails sometimes" incident, and is
1014
+ * invisible unless something says it out loud.
1015
+ */
1016
+ async infrastructure() {
1017
+ return this.request("GET", "/admin-portal/diagnostic/infrastructure");
1018
+ }
1019
+ /**
1020
+ * Firing alerts, proxied from Alertmanager.
1021
+ *
1022
+ * Answers a {@link DiagnosticPanel} for the same reason {@link routerLogs}
1023
+ * does: a strip that renders empty because Alertmanager is down says "nothing
1024
+ * is firing", which is the most dangerous sentence this page could print.
1025
+ */
1026
+ async alerts() {
1027
+ return this.request("GET", "/admin-portal/diagnostic/alerts");
1028
+ }
1029
+ /** Config edits and admin actions inside the window. */
1030
+ async listChanges(body) {
1031
+ return this.request("POST", "/admin-portal/diagnostic/changes", { body: body ?? {} });
1032
+ }
1033
+ /**
1034
+ * What a pasted id is, and whether we hold it.
1035
+ *
1036
+ * `kind` and `found` are separate answers on purpose. A well-shaped id that
1037
+ * matches nothing comes back `found: false` with the three `reasons` and
1038
+ * their fixes — render that, never an empty table, which reads as "no such
1039
+ * payment" when the real answer is "outside the window" or "it is a test
1040
+ * payment".
1041
+ */
1042
+ async resolveId(id) {
1043
+ return this.request("GET", `/admin-portal/diagnostic/resolve/${encodeURIComponent(id)}`);
1044
+ }
1045
+ /**
1046
+ * One id across every source, as an ordered span list.
1047
+ *
1048
+ * Accepts a payment, attempt, event or request id. Sources that could not be
1049
+ * read are named in `unavailable_sources` rather than left out: a waterfall
1050
+ * with an unexplained gap reads as a period when nothing happened.
1051
+ */
1052
+ async trace(id) {
1053
+ return this.request("GET", `/admin-portal/diagnostic/trace/${encodeURIComponent(id)}`);
1054
+ }
1055
+ /**
1056
+ * Unmask one field of one object.
1057
+ *
1058
+ * **Writes an audit row** naming the operator, the field and the object,
1059
+ * before the value is returned — a reveal that could not be audited does not
1060
+ * happen. Needs a dashboard JWT holding `DiagnosticReveal`; an admin API key
1061
+ * cannot call it, because an API key names no person.
1062
+ *
1063
+ * `reason` is required and is stored verbatim.
1064
+ */
1065
+ async reveal(body) {
1066
+ return this.request("POST", "/admin-portal/diagnostic/reveal", { body });
1067
+ }
1068
+ };
1069
+
848
1070
  // src/internal/resources/gsm.ts
849
1071
  var Gsm = class {
850
1072
  constructor(request) {
@@ -1133,12 +1355,23 @@ var DelopayInternal = class extends Delopay {
1133
1355
  this.configs = new Configs(request);
1134
1356
  this.connectorRestrictions = new ConnectorRestrictions(request);
1135
1357
  this.connectorRestrictionRules = new ConnectorRestrictionRules(request);
1358
+ this.diagnostic = new Diagnostic(request);
1136
1359
  this.gsm = new Gsm(request);
1137
1360
  this.platformBilling = new PlatformBilling(request);
1138
1361
  this.platformFees = new PlatformFees(request);
1139
1362
  }
1140
1363
  };
1141
1364
  export {
1365
+ AIRWALLEX_AUTOFILL_TREATMENTS,
1366
+ AIRWALLEX_CARD_LAYOUTS,
1367
+ AIRWALLEX_CARD_PRESETS,
1368
+ AIRWALLEX_CARD_PRESET_FALLBACK,
1369
+ AIRWALLEX_FIELD_CHROMES,
1370
+ AIRWALLEX_FIELD_FONT_SIZES,
1371
+ AIRWALLEX_FIELD_WEIGHTS,
1372
+ AIRWALLEX_FOCUS_RINGS,
1373
+ AIRWALLEX_LABEL_STYLES,
1374
+ AIRWALLEX_NETWORK_MARKS,
1142
1375
  ALL_CUSTOM_FIELD_CONDITION_SOURCES,
1143
1376
  ALL_CUSTOM_FIELD_OPERATORS,
1144
1377
  ALL_CUSTOM_FIELD_TYPES,
@@ -1176,6 +1409,7 @@ export {
1176
1409
  DelopayAuthenticationError,
1177
1410
  DelopayError,
1178
1411
  DelopayInternal,
1412
+ Diagnostic,
1179
1413
  Export,
1180
1414
  FeatureMatrix,
1181
1415
  FeeProgramBuilder,
@@ -1221,9 +1455,15 @@ export {
1221
1455
  WCAG_AA_TEXT,
1222
1456
  WCAG_AA_UI,
1223
1457
  Webhooks,
1458
+ airwallexCardLayout,
1459
+ airwallexCardLayoutIsCoherent,
1460
+ airwallexCellWeight,
1461
+ airwallexFieldFontPx,
1462
+ airwallexFieldWeightValue,
1224
1463
  allOf,
1225
1464
  anyOf,
1226
1465
  applyBrandingVariables,
1466
+ asAirwallexCardPreset,
1227
1467
  buildBrandingExport,
1228
1468
  buttonPadValue,
1229
1469
  canonicalSectionId,
@@ -1287,6 +1527,8 @@ export {
1287
1527
  programToTree,
1288
1528
  radiusValue,
1289
1529
  readableInkOn,
1530
+ resolveAirwallexCardPreset,
1531
+ resolveAirwallexLabelStyle,
1290
1532
  ruleMatchToTree,
1291
1533
  sanitizeCustomCss,
1292
1534
  sectionLabel,