@moovio/sdk 25.8.7 → 25.9.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 (267) hide show
  1. package/README.md +112 -80
  2. package/bin/mcp-server.js +604 -324
  3. package/bin/mcp-server.js.map +59 -59
  4. package/funcs/accountsCreate.d.ts +8 -10
  5. package/funcs/accountsCreate.d.ts.map +1 -1
  6. package/funcs/accountsCreate.js +8 -10
  7. package/funcs/accountsCreate.js.map +1 -1
  8. package/funcs/capabilitiesDisable.d.ts +1 -1
  9. package/funcs/capabilitiesDisable.js +1 -1
  10. package/funcs/capabilitiesGet.d.ts +1 -1
  11. package/funcs/capabilitiesGet.js +1 -1
  12. package/funcs/capabilitiesList.d.ts +1 -1
  13. package/funcs/capabilitiesList.js +1 -1
  14. package/funcs/capabilitiesRequest.d.ts +1 -1
  15. package/funcs/capabilitiesRequest.js +1 -1
  16. package/funcs/cardIssuingGet.js +1 -1
  17. package/funcs/cardIssuingGet.js.map +1 -1
  18. package/funcs/cardIssuingGetFull.js +1 -1
  19. package/funcs/cardIssuingGetFull.js.map +1 -1
  20. package/funcs/cardIssuingList.js +1 -1
  21. package/funcs/cardIssuingList.js.map +1 -1
  22. package/funcs/cardIssuingRequest.js +1 -1
  23. package/funcs/cardIssuingRequest.js.map +1 -1
  24. package/funcs/cardIssuingUpdate.js +1 -1
  25. package/funcs/cardIssuingUpdate.js.map +1 -1
  26. package/funcs/transfersListCancellations.d.ts +17 -0
  27. package/funcs/transfersListCancellations.d.ts.map +1 -0
  28. package/funcs/transfersListCancellations.js +129 -0
  29. package/funcs/transfersListCancellations.js.map +1 -0
  30. package/hooks/access-token-hook.d.ts +25 -0
  31. package/hooks/access-token-hook.d.ts.map +1 -0
  32. package/hooks/access-token-hook.js +60 -0
  33. package/hooks/access-token-hook.js.map +1 -0
  34. package/hooks/registration.d.ts.map +1 -1
  35. package/hooks/registration.js +4 -0
  36. package/hooks/registration.js.map +1 -1
  37. package/hooks/types.d.ts +1 -0
  38. package/hooks/types.d.ts.map +1 -1
  39. package/jsr.json +1 -1
  40. package/lib/config.d.ts +7 -3
  41. package/lib/config.d.ts.map +1 -1
  42. package/lib/config.js +3 -3
  43. package/lib/config.js.map +1 -1
  44. package/lib/encodings.js +12 -12
  45. package/lib/encodings.js.map +1 -1
  46. package/lib/matchers.js +3 -3
  47. package/lib/matchers.js.map +1 -1
  48. package/lib/primitives.d.ts +1 -0
  49. package/lib/primitives.d.ts.map +1 -1
  50. package/lib/primitives.js +18 -0
  51. package/lib/primitives.js.map +1 -1
  52. package/lib/retries.js +7 -0
  53. package/lib/retries.js.map +1 -1
  54. package/lib/sdks.d.ts.map +1 -1
  55. package/lib/sdks.js +50 -16
  56. package/lib/sdks.js.map +1 -1
  57. package/mcp-server/cli/start/command.d.ts.map +1 -1
  58. package/mcp-server/cli/start/command.js +8 -0
  59. package/mcp-server/cli/start/command.js.map +1 -1
  60. package/mcp-server/cli/start/impl.d.ts +1 -0
  61. package/mcp-server/cli/start/impl.d.ts.map +1 -1
  62. package/mcp-server/cli/start/impl.js +2 -0
  63. package/mcp-server/cli/start/impl.js.map +1 -1
  64. package/mcp-server/mcp-server.js +1 -1
  65. package/mcp-server/server.d.ts +1 -0
  66. package/mcp-server/server.d.ts.map +1 -1
  67. package/mcp-server/server.js +4 -1
  68. package/mcp-server/server.js.map +1 -1
  69. package/mcp-server/tools/accountsCreate.d.ts.map +1 -1
  70. package/mcp-server/tools/accountsCreate.js +8 -10
  71. package/mcp-server/tools/accountsCreate.js.map +1 -1
  72. package/mcp-server/tools/capabilitiesDisable.js +1 -1
  73. package/mcp-server/tools/capabilitiesGet.js +1 -1
  74. package/mcp-server/tools/capabilitiesList.js +1 -1
  75. package/mcp-server/tools/capabilitiesRequest.js +1 -1
  76. package/mcp-server/tools/transfersListCancellations.d.ts +8 -0
  77. package/mcp-server/tools/transfersListCancellations.d.ts.map +1 -0
  78. package/{models/components/authorizeduser.js → mcp-server/tools/transfersListCancellations.js} +27 -22
  79. package/mcp-server/tools/transfersListCancellations.js.map +1 -0
  80. package/models/components/addcapabilities.d.ts +9 -0
  81. package/models/components/addcapabilities.d.ts.map +1 -1
  82. package/models/components/addcapabilities.js.map +1 -1
  83. package/models/components/capability.d.ts +7 -1
  84. package/models/components/capability.d.ts.map +1 -1
  85. package/models/components/capability.js.map +1 -1
  86. package/models/components/capabilityid.d.ts +14 -2
  87. package/models/components/capabilityid.d.ts.map +1 -1
  88. package/models/components/capabilityid.js +7 -1
  89. package/models/components/capabilityid.js.map +1 -1
  90. package/models/components/createaccount.d.ts +9 -0
  91. package/models/components/createaccount.d.ts.map +1 -1
  92. package/models/components/createaccount.js.map +1 -1
  93. package/models/components/createpaymentlink.d.ts +3 -3
  94. package/models/components/fullissuedcard.d.ts +25 -9
  95. package/models/components/fullissuedcard.d.ts.map +1 -1
  96. package/models/components/fullissuedcard.js +11 -5
  97. package/models/components/fullissuedcard.js.map +1 -1
  98. package/models/components/index.d.ts +1 -4
  99. package/models/components/index.d.ts.map +1 -1
  100. package/models/components/index.js +1 -4
  101. package/models/components/index.js.map +1 -1
  102. package/models/components/issuedcard.d.ts +25 -9
  103. package/models/components/issuedcard.d.ts.map +1 -1
  104. package/models/components/issuedcard.js +11 -5
  105. package/models/components/issuedcard.js.map +1 -1
  106. package/models/components/onboardinginvite.d.ts +1 -1
  107. package/models/components/onboardinginviterequest.d.ts +1 -1
  108. package/models/components/paymentlink.d.ts +2 -2
  109. package/models/components/requestcard.d.ts +14 -17
  110. package/models/components/requestcard.d.ts.map +1 -1
  111. package/models/components/requestcard.js +9 -10
  112. package/models/components/requestcard.js.map +1 -1
  113. package/models/components/updateissuedcard.d.ts +33 -8
  114. package/models/components/updateissuedcard.d.ts.map +1 -1
  115. package/models/components/updateissuedcard.js +35 -6
  116. package/models/components/updateissuedcard.js.map +1 -1
  117. package/models/components/webhookdata.d.ts +3 -2
  118. package/models/components/webhookdata.d.ts.map +1 -1
  119. package/models/components/webhookdata.js +7 -4
  120. package/models/components/webhookdata.js.map +1 -1
  121. package/models/components/webhookdataauthorizationexpiring.d.ts +23 -0
  122. package/models/components/webhookdataauthorizationexpiring.d.ts.map +1 -0
  123. package/models/components/{createauthorizedusererror.js → webhookdataauthorizationexpiring.js} +18 -17
  124. package/models/components/webhookdataauthorizationexpiring.js.map +1 -0
  125. package/models/components/webhookdatacapabilityrequested.d.ts +7 -1
  126. package/models/components/webhookdatacapabilityrequested.d.ts.map +1 -1
  127. package/models/components/webhookdatacapabilityrequested.js.map +1 -1
  128. package/models/components/webhookdatacapabilityupdated.d.ts +7 -1
  129. package/models/components/webhookdatacapabilityupdated.d.ts.map +1 -1
  130. package/models/components/webhookdatacapabilityupdated.js.map +1 -1
  131. package/models/components/webhookdatasweepcreated.d.ts +5 -0
  132. package/models/components/webhookdatasweepcreated.d.ts.map +1 -1
  133. package/models/components/webhookdatasweepcreated.js +2 -0
  134. package/models/components/webhookdatasweepcreated.js.map +1 -1
  135. package/models/components/webhookdatasweepupdated.d.ts +5 -0
  136. package/models/components/webhookdatasweepupdated.d.ts.map +1 -1
  137. package/models/components/webhookdatasweepupdated.js +2 -0
  138. package/models/components/webhookdatasweepupdated.js.map +1 -1
  139. package/models/components/webhookeventtype.d.ts +1 -0
  140. package/models/components/webhookeventtype.d.ts.map +1 -1
  141. package/models/components/webhookeventtype.js +1 -0
  142. package/models/components/webhookeventtype.js.map +1 -1
  143. package/models/errors/requestcarderror.d.ts +12 -12
  144. package/models/errors/requestcarderror.d.ts.map +1 -1
  145. package/models/errors/requestcarderror.js +17 -17
  146. package/models/errors/requestcarderror.js.map +1 -1
  147. package/models/errors/updateissuedcarderror.d.ts +9 -6
  148. package/models/errors/updateissuedcarderror.d.ts.map +1 -1
  149. package/models/errors/updateissuedcarderror.js +12 -9
  150. package/models/errors/updateissuedcarderror.js.map +1 -1
  151. package/models/operations/disablecapability.d.ts +7 -1
  152. package/models/operations/disablecapability.d.ts.map +1 -1
  153. package/models/operations/disablecapability.js.map +1 -1
  154. package/models/operations/getcapability.d.ts +7 -1
  155. package/models/operations/getcapability.d.ts.map +1 -1
  156. package/models/operations/getcapability.js.map +1 -1
  157. package/models/operations/index.d.ts +1 -0
  158. package/models/operations/index.d.ts.map +1 -1
  159. package/models/operations/index.js +1 -0
  160. package/models/operations/index.js.map +1 -1
  161. package/models/operations/listcancellations.d.ts +45 -0
  162. package/models/operations/listcancellations.d.ts.map +1 -0
  163. package/models/operations/listcancellations.js +90 -0
  164. package/models/operations/listcancellations.js.map +1 -0
  165. package/package.json +1 -1
  166. package/sdk/accounts.d.ts +8 -10
  167. package/sdk/accounts.d.ts.map +1 -1
  168. package/sdk/accounts.js +8 -10
  169. package/sdk/accounts.js.map +1 -1
  170. package/sdk/capabilities.d.ts +4 -4
  171. package/sdk/capabilities.js +4 -4
  172. package/sdk/transfers.d.ts +7 -0
  173. package/sdk/transfers.d.ts.map +1 -1
  174. package/sdk/transfers.js +10 -0
  175. package/sdk/transfers.js.map +1 -1
  176. package/src/funcs/accountsCreate.ts +8 -10
  177. package/src/funcs/capabilitiesDisable.ts +1 -1
  178. package/src/funcs/capabilitiesGet.ts +1 -1
  179. package/src/funcs/capabilitiesList.ts +1 -1
  180. package/src/funcs/capabilitiesRequest.ts +1 -1
  181. package/src/funcs/cardIssuingGet.ts +1 -1
  182. package/src/funcs/cardIssuingGetFull.ts +3 -3
  183. package/src/funcs/cardIssuingList.ts +1 -1
  184. package/src/funcs/cardIssuingRequest.ts +1 -1
  185. package/src/funcs/cardIssuingUpdate.ts +1 -1
  186. package/src/funcs/transfersListCancellations.ts +181 -0
  187. package/src/hooks/access-token-hook.ts +73 -0
  188. package/src/hooks/registration.ts +5 -0
  189. package/src/hooks/types.ts +1 -0
  190. package/src/lib/config.ts +8 -3
  191. package/src/lib/encodings.ts +1 -1
  192. package/src/lib/matchers.ts +1 -1
  193. package/src/lib/primitives.ts +16 -0
  194. package/src/lib/retries.ts +8 -0
  195. package/src/lib/sdks.ts +54 -17
  196. package/src/mcp-server/cli/start/command.ts +9 -0
  197. package/src/mcp-server/cli/start/impl.ts +3 -0
  198. package/src/mcp-server/mcp-server.ts +1 -1
  199. package/src/mcp-server/server.ts +5 -1
  200. package/src/mcp-server/tools/accountsCreate.ts +8 -10
  201. package/src/mcp-server/tools/capabilitiesDisable.ts +1 -1
  202. package/src/mcp-server/tools/capabilitiesGet.ts +1 -1
  203. package/src/mcp-server/tools/capabilitiesList.ts +1 -1
  204. package/src/mcp-server/tools/capabilitiesRequest.ts +1 -1
  205. package/src/mcp-server/tools/transfersListCancellations.ts +38 -0
  206. package/src/models/components/addcapabilities.ts +9 -0
  207. package/src/models/components/capability.ts +7 -1
  208. package/src/models/components/capabilityid.ts +14 -2
  209. package/src/models/components/createaccount.ts +9 -0
  210. package/src/models/components/createpaymentlink.ts +3 -3
  211. package/src/models/components/fullissuedcard.ts +35 -17
  212. package/src/models/components/index.ts +1 -4
  213. package/src/models/components/issuedcard.ts +35 -17
  214. package/src/models/components/onboardinginvite.ts +1 -1
  215. package/src/models/components/onboardinginviterequest.ts +1 -1
  216. package/src/models/components/paymentlink.ts +2 -2
  217. package/src/models/components/requestcard.ts +23 -34
  218. package/src/models/components/updateissuedcard.ts +73 -17
  219. package/src/models/components/webhookdata.ts +18 -8
  220. package/src/models/components/webhookdataauthorizationexpiring.ts +65 -0
  221. package/src/models/components/webhookdatacapabilityrequested.ts +7 -1
  222. package/src/models/components/webhookdatacapabilityupdated.ts +7 -1
  223. package/src/models/components/webhookdatasweepcreated.ts +7 -0
  224. package/src/models/components/webhookdatasweepupdated.ts +7 -0
  225. package/src/models/components/webhookeventtype.ts +1 -0
  226. package/src/models/errors/requestcarderror.ts +26 -25
  227. package/src/models/errors/updateissuedcarderror.ts +18 -13
  228. package/src/models/operations/disablecapability.ts +7 -1
  229. package/src/models/operations/getcapability.ts +7 -1
  230. package/src/models/operations/index.ts +1 -0
  231. package/src/models/operations/listcancellations.ts +120 -0
  232. package/src/sdk/accounts.ts +8 -10
  233. package/src/sdk/capabilities.ts +4 -4
  234. package/src/sdk/transfers.ts +18 -0
  235. package/src/types/async.ts +8 -7
  236. package/test/tests/accessToken.test.ts +86 -0
  237. package/types/async.d.ts.map +1 -1
  238. package/types/async.js +8 -7
  239. package/types/async.js.map +1 -1
  240. package/lib/dlv.d.ts +0 -14
  241. package/lib/dlv.d.ts.map +0 -1
  242. package/lib/dlv.js +0 -49
  243. package/lib/dlv.js.map +0 -1
  244. package/lib/is-plain-object.d.ts +0 -2
  245. package/lib/is-plain-object.d.ts.map +0 -1
  246. package/lib/is-plain-object.js +0 -41
  247. package/lib/is-plain-object.js.map +0 -1
  248. package/models/components/authorizeduser.d.ts +0 -22
  249. package/models/components/authorizeduser.d.ts.map +0 -1
  250. package/models/components/authorizeduser.js.map +0 -1
  251. package/models/components/createauthorizeduser.d.ts +0 -25
  252. package/models/components/createauthorizeduser.d.ts.map +0 -1
  253. package/models/components/createauthorizeduser.js +0 -63
  254. package/models/components/createauthorizeduser.js.map +0 -1
  255. package/models/components/createauthorizedusererror.d.ts +0 -22
  256. package/models/components/createauthorizedusererror.d.ts.map +0 -1
  257. package/models/components/createauthorizedusererror.js.map +0 -1
  258. package/models/components/createauthorizeduserupdate.d.ts +0 -25
  259. package/models/components/createauthorizeduserupdate.d.ts.map +0 -1
  260. package/models/components/createauthorizeduserupdate.js +0 -63
  261. package/models/components/createauthorizeduserupdate.js.map +0 -1
  262. package/src/lib/dlv.ts +0 -53
  263. package/src/lib/is-plain-object.ts +0 -43
  264. package/src/models/components/authorizeduser.ts +0 -54
  265. package/src/models/components/createauthorizeduser.ts +0 -68
  266. package/src/models/components/createauthorizedusererror.ts +0 -65
  267. package/src/models/components/createauthorizeduserupdate.ts +0 -68
@@ -7,19 +7,19 @@ import * as components from "../components/index.js";
7
7
  import { MoovError } from "./mooverror.js";
8
8
 
9
9
  export type RequestCardErrorData = {
10
- fundingWalletID?: string | undefined;
11
- formFactor?: string | undefined;
12
- authorizedUser?: components.CreateAuthorizedUserError | undefined;
13
- memo?: string | undefined;
10
+ authorizedUserAccountID?: string | undefined;
11
+ nickname?: string | undefined;
12
+ metadata?: string | undefined;
13
+ billingAddress?: components.AddressError | undefined;
14
14
  expiration?: components.CardExpirationError | undefined;
15
15
  controls?: components.IssuingControlsError | undefined;
16
16
  };
17
17
 
18
18
  export class RequestCardError extends MoovError {
19
- fundingWalletID?: string | undefined;
20
- formFactor?: string | undefined;
21
- authorizedUser?: components.CreateAuthorizedUserError | undefined;
22
- memo?: string | undefined;
19
+ authorizedUserAccountID?: string | undefined;
20
+ nickname?: string | undefined;
21
+ metadata?: string | undefined;
22
+ billingAddress?: components.AddressError | undefined;
23
23
  expiration?: components.CardExpirationError | undefined;
24
24
  controls?: components.IssuingControlsError | undefined;
25
25
 
@@ -35,10 +35,12 @@ export class RequestCardError extends MoovError {
35
35
  : `API error occurred: ${JSON.stringify(err)}`;
36
36
  super(message, httpMeta);
37
37
  this.data$ = err;
38
- if (err.fundingWalletID != null) this.fundingWalletID = err.fundingWalletID;
39
- if (err.formFactor != null) this.formFactor = err.formFactor;
40
- if (err.authorizedUser != null) this.authorizedUser = err.authorizedUser;
41
- if (err.memo != null) this.memo = err.memo;
38
+ if (err.authorizedUserAccountID != null) {
39
+ this.authorizedUserAccountID = err.authorizedUserAccountID;
40
+ }
41
+ if (err.nickname != null) this.nickname = err.nickname;
42
+ if (err.metadata != null) this.metadata = err.metadata;
43
+ if (err.billingAddress != null) this.billingAddress = err.billingAddress;
42
44
  if (err.expiration != null) this.expiration = err.expiration;
43
45
  if (err.controls != null) this.controls = err.controls;
44
46
 
@@ -52,10 +54,10 @@ export const RequestCardError$inboundSchema: z.ZodType<
52
54
  z.ZodTypeDef,
53
55
  unknown
54
56
  > = z.object({
55
- fundingWalletID: z.string().optional(),
56
- formFactor: z.string().optional(),
57
- authorizedUser: components.CreateAuthorizedUserError$inboundSchema.optional(),
58
- memo: z.string().optional(),
57
+ authorizedUserAccountID: z.string().optional(),
58
+ nickname: z.string().optional(),
59
+ metadata: z.string().optional(),
60
+ billingAddress: components.AddressError$inboundSchema.optional(),
59
61
  expiration: components.CardExpirationError$inboundSchema.optional(),
60
62
  controls: components.IssuingControlsError$inboundSchema.optional(),
61
63
  request$: z.instanceof(Request),
@@ -72,10 +74,10 @@ export const RequestCardError$inboundSchema: z.ZodType<
72
74
 
73
75
  /** @internal */
74
76
  export type RequestCardError$Outbound = {
75
- fundingWalletID?: string | undefined;
76
- formFactor?: string | undefined;
77
- authorizedUser?: components.CreateAuthorizedUserError$Outbound | undefined;
78
- memo?: string | undefined;
77
+ authorizedUserAccountID?: string | undefined;
78
+ nickname?: string | undefined;
79
+ metadata?: string | undefined;
80
+ billingAddress?: components.AddressError$Outbound | undefined;
79
81
  expiration?: components.CardExpirationError$Outbound | undefined;
80
82
  controls?: components.IssuingControlsError$Outbound | undefined;
81
83
  };
@@ -88,11 +90,10 @@ export const RequestCardError$outboundSchema: z.ZodType<
88
90
  > = z.instanceof(RequestCardError)
89
91
  .transform(v => v.data$)
90
92
  .pipe(z.object({
91
- fundingWalletID: z.string().optional(),
92
- formFactor: z.string().optional(),
93
- authorizedUser: components.CreateAuthorizedUserError$outboundSchema
94
- .optional(),
95
- memo: z.string().optional(),
93
+ authorizedUserAccountID: z.string().optional(),
94
+ nickname: z.string().optional(),
95
+ metadata: z.string().optional(),
96
+ billingAddress: components.AddressError$outboundSchema.optional(),
96
97
  expiration: components.CardExpirationError$outboundSchema.optional(),
97
98
  controls: components.IssuingControlsError$outboundSchema.optional(),
98
99
  }));
@@ -8,14 +8,16 @@ import { MoovError } from "./mooverror.js";
8
8
 
9
9
  export type UpdateIssuedCardErrorData = {
10
10
  state?: string | undefined;
11
- memo?: string | undefined;
12
- authorizedUser?: components.CreateAuthorizedUserError | undefined;
11
+ nickname?: string | undefined;
12
+ metadata?: string | undefined;
13
+ billingAddress?: components.AddressError | undefined;
13
14
  };
14
15
 
15
16
  export class UpdateIssuedCardError extends MoovError {
16
17
  state?: string | undefined;
17
- memo?: string | undefined;
18
- authorizedUser?: components.CreateAuthorizedUserError | undefined;
18
+ nickname?: string | undefined;
19
+ metadata?: string | undefined;
20
+ billingAddress?: components.AddressError | undefined;
19
21
 
20
22
  /** The original data that was passed to this error instance. */
21
23
  data$: UpdateIssuedCardErrorData;
@@ -30,8 +32,9 @@ export class UpdateIssuedCardError extends MoovError {
30
32
  super(message, httpMeta);
31
33
  this.data$ = err;
32
34
  if (err.state != null) this.state = err.state;
33
- if (err.memo != null) this.memo = err.memo;
34
- if (err.authorizedUser != null) this.authorizedUser = err.authorizedUser;
35
+ if (err.nickname != null) this.nickname = err.nickname;
36
+ if (err.metadata != null) this.metadata = err.metadata;
37
+ if (err.billingAddress != null) this.billingAddress = err.billingAddress;
35
38
 
36
39
  this.name = "UpdateIssuedCardError";
37
40
  }
@@ -44,8 +47,9 @@ export const UpdateIssuedCardError$inboundSchema: z.ZodType<
44
47
  unknown
45
48
  > = z.object({
46
49
  state: z.string().optional(),
47
- memo: z.string().optional(),
48
- authorizedUser: components.CreateAuthorizedUserError$inboundSchema.optional(),
50
+ nickname: z.string().optional(),
51
+ metadata: z.string().optional(),
52
+ billingAddress: components.AddressError$inboundSchema.optional(),
49
53
  request$: z.instanceof(Request),
50
54
  response$: z.instanceof(Response),
51
55
  body$: z.string(),
@@ -61,8 +65,9 @@ export const UpdateIssuedCardError$inboundSchema: z.ZodType<
61
65
  /** @internal */
62
66
  export type UpdateIssuedCardError$Outbound = {
63
67
  state?: string | undefined;
64
- memo?: string | undefined;
65
- authorizedUser?: components.CreateAuthorizedUserError$Outbound | undefined;
68
+ nickname?: string | undefined;
69
+ metadata?: string | undefined;
70
+ billingAddress?: components.AddressError$Outbound | undefined;
66
71
  };
67
72
 
68
73
  /** @internal */
@@ -74,7 +79,7 @@ export const UpdateIssuedCardError$outboundSchema: z.ZodType<
74
79
  .transform(v => v.data$)
75
80
  .pipe(z.object({
76
81
  state: z.string().optional(),
77
- memo: z.string().optional(),
78
- authorizedUser: components.CreateAuthorizedUserError$outboundSchema
79
- .optional(),
82
+ nickname: z.string().optional(),
83
+ metadata: z.string().optional(),
84
+ billingAddress: components.AddressError$outboundSchema.optional(),
80
85
  }));
@@ -16,7 +16,13 @@ export type DisableCapabilityRequest = {
16
16
  *
17
17
  * @remarks
18
18
  *
19
- * The `production-app`, `platform.production-app`, and / or `platform.wallet-transfers` capabilities might appear in your list. These are read-only capabilities that Moov requests and uses for account verification purposes. These capabilities remains active with your account and require no additional action.
19
+ * **Deprecated capabilities**
20
+ *
21
+ * The `send-funds`, `collect-funds`, and `wallet` capability IDs are deprecated. Request granular capabilities instead (for example, `send-funds.ach`, `collect-funds.card-payments`, or `wallet.balance`). Deprecated values will be removed in a future API version.
22
+ *
23
+ * Read our [capabilities reference](https://docs.moov.io/guides/accounts/capabilities/reference/) to choose the right capabilities for your integration.
24
+ *
25
+ * The `production-app`, `platform.production-app`, and / or `platform.wallet-transfers` capabilities might appear in the list for your Partner account. These are read-only capabilities that Moov requests. These capabilities remain active with your account and require no additional action.
20
26
  */
21
27
  capabilityID: components.CapabilityID;
22
28
  };
@@ -16,7 +16,13 @@ export type GetCapabilityRequest = {
16
16
  *
17
17
  * @remarks
18
18
  *
19
- * The `production-app`, `platform.production-app`, and / or `platform.wallet-transfers` capabilities might appear in your list. These are read-only capabilities that Moov requests and uses for account verification purposes. These capabilities remains active with your account and require no additional action.
19
+ * **Deprecated capabilities**
20
+ *
21
+ * The `send-funds`, `collect-funds`, and `wallet` capability IDs are deprecated. Request granular capabilities instead (for example, `send-funds.ach`, `collect-funds.card-payments`, or `wallet.balance`). Deprecated values will be removed in a future API version.
22
+ *
23
+ * Read our [capabilities reference](https://docs.moov.io/guides/accounts/capabilities/reference/) to choose the right capabilities for your integration.
24
+ *
25
+ * The `production-app`, `platform.production-app`, and / or `platform.wallet-transfers` capabilities might appear in the list for your Partner account. These are read-only capabilities that Moov requests. These capabilities remain active with your account and require no additional action.
20
26
  */
21
27
  capabilityID: components.CapabilityID;
22
28
  };
@@ -101,6 +101,7 @@ export * from "./listaccounts.js";
101
101
  export * from "./listaccountterminalapplications.js";
102
102
  export * from "./listadjustments.js";
103
103
  export * from "./listbankaccounts.js";
104
+ export * from "./listcancellations.js";
104
105
  export * from "./listcapabilities.js";
105
106
  export * from "./listcards.js";
106
107
  export * from "./listconnectedaccountsforaccount.js";
@@ -0,0 +1,120 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type ListCancellationsRequest = {
13
+ /**
14
+ * Moov account ID of the partner or transfer's source or destination.
15
+ */
16
+ accountID: string;
17
+ /**
18
+ * Identifier for the transfer.
19
+ */
20
+ transferID: string;
21
+ };
22
+
23
+ export type ListCancellationsResponse = {
24
+ headers: { [k: string]: Array<string> };
25
+ result: Array<components.Cancellation>;
26
+ };
27
+
28
+ /** @internal */
29
+ export const ListCancellationsRequest$inboundSchema: z.ZodType<
30
+ ListCancellationsRequest,
31
+ z.ZodTypeDef,
32
+ unknown
33
+ > = z.object({
34
+ accountID: z.string(),
35
+ transferID: z.string(),
36
+ });
37
+ /** @internal */
38
+ export type ListCancellationsRequest$Outbound = {
39
+ accountID: string;
40
+ transferID: string;
41
+ };
42
+
43
+ /** @internal */
44
+ export const ListCancellationsRequest$outboundSchema: z.ZodType<
45
+ ListCancellationsRequest$Outbound,
46
+ z.ZodTypeDef,
47
+ ListCancellationsRequest
48
+ > = z.object({
49
+ accountID: z.string(),
50
+ transferID: z.string(),
51
+ });
52
+
53
+ export function listCancellationsRequestToJSON(
54
+ listCancellationsRequest: ListCancellationsRequest,
55
+ ): string {
56
+ return JSON.stringify(
57
+ ListCancellationsRequest$outboundSchema.parse(listCancellationsRequest),
58
+ );
59
+ }
60
+ export function listCancellationsRequestFromJSON(
61
+ jsonString: string,
62
+ ): SafeParseResult<ListCancellationsRequest, SDKValidationError> {
63
+ return safeParse(
64
+ jsonString,
65
+ (x) => ListCancellationsRequest$inboundSchema.parse(JSON.parse(x)),
66
+ `Failed to parse 'ListCancellationsRequest' from JSON`,
67
+ );
68
+ }
69
+
70
+ /** @internal */
71
+ export const ListCancellationsResponse$inboundSchema: z.ZodType<
72
+ ListCancellationsResponse,
73
+ z.ZodTypeDef,
74
+ unknown
75
+ > = z.object({
76
+ Headers: z.record(z.array(z.string())).default({}),
77
+ Result: z.array(components.Cancellation$inboundSchema),
78
+ }).transform((v) => {
79
+ return remap$(v, {
80
+ "Headers": "headers",
81
+ "Result": "result",
82
+ });
83
+ });
84
+ /** @internal */
85
+ export type ListCancellationsResponse$Outbound = {
86
+ Headers: { [k: string]: Array<string> };
87
+ Result: Array<components.Cancellation$Outbound>;
88
+ };
89
+
90
+ /** @internal */
91
+ export const ListCancellationsResponse$outboundSchema: z.ZodType<
92
+ ListCancellationsResponse$Outbound,
93
+ z.ZodTypeDef,
94
+ ListCancellationsResponse
95
+ > = z.object({
96
+ headers: z.record(z.array(z.string())),
97
+ result: z.array(components.Cancellation$outboundSchema),
98
+ }).transform((v) => {
99
+ return remap$(v, {
100
+ headers: "Headers",
101
+ result: "Result",
102
+ });
103
+ });
104
+
105
+ export function listCancellationsResponseToJSON(
106
+ listCancellationsResponse: ListCancellationsResponse,
107
+ ): string {
108
+ return JSON.stringify(
109
+ ListCancellationsResponse$outboundSchema.parse(listCancellationsResponse),
110
+ );
111
+ }
112
+ export function listCancellationsResponseFromJSON(
113
+ jsonString: string,
114
+ ): SafeParseResult<ListCancellationsResponse, SDKValidationError> {
115
+ return safeParse(
116
+ jsonString,
117
+ (x) => ListCancellationsResponse$inboundSchema.parse(JSON.parse(x)),
118
+ `Failed to parse 'ListCancellationsResponse' from JSON`,
119
+ );
120
+ }
@@ -20,21 +20,19 @@ import { unwrapAsync } from "../types/fp.js";
20
20
 
21
21
  export class Accounts extends ClientSDK {
22
22
  /**
23
- * You can create **business** or **individual** accounts for your users (i.e., customers, merchants) by passing the required
24
- * information to Moov. Requirements differ per account type and requested [capabilities](https://docs.moov.io/guides/accounts/capabilities/requirements/).
23
+ * You can create business or individual accounts for your users (i.e., customers, merchants) by passing the required information to Moov. Requirements differ per account type and requested [capabilities](https://docs.moov.io/guides/accounts/capabilities/reference/).
25
24
  *
26
- * If you're requesting the `wallet`, `send-funds`, `collect-funds`, or `card-issuing` capabilities, you'll need to:
27
- * + Send Moov the user [platform terms of service agreement](https://docs.moov.io/guides/accounts/requirements/platform-agreement/) acceptance.
28
- * This can be done upon account creation, or by [patching](https://docs.moov.io/api/moov-accounts/accounts/patch/) the account using the `termsOfService` field.
29
- * If you're creating a business account with the business type `llc`, `partnership`, or `privateCorporation`, you'll need to:
25
+ * The `transfers` capability is automatically requested for every account. If you request any capability beyond `transfers` (for example, `send-funds.ach`, `collect-funds.card-payments`), you'll need to:
26
+ * + Send Moov the user's [platform terms of service agreement](https://docs.moov.io/guides/accounts/requirements/platform-agreement/) acceptance. This can be done at account creation, or by [patching](https://docs.moov.io/api/moov-accounts/accounts/patch/) the account using the `termsOfService` field.
27
+ * + Fulfill the [verification and underwriting requirements](https://docs.moov.io/guides/accounts/requirements/) for each requested capability. A capability isn't enabled until its requirements pass — check the capability's status to see what's still outstanding.
28
+ *
29
+ * If you're creating a business account, depending on the business type, you'll also need to:
30
30
  * + Provide [business representatives](https://docs.moov.io/api/moov-accounts/representatives/) after creating the account.
31
31
  * + [Patch](https://docs.moov.io/api/moov-accounts/accounts/patch/) the account to indicate that business representative ownership information is complete.
32
32
  *
33
- * Visit our documentation to read more about [creating accounts](https://docs.moov.io/guides/accounts/create-accounts/) and [verification requirements](https://docs.moov.io/guides/accounts/requirements/identity-verification/).
34
- * Note that the `mode` field (for production or sandbox) is only required when creating a _facilitator_ account. All non-facilitator account requests will ignore the mode field and be set to the calling facilitator's mode.
33
+ * Visit our documentation to read more about [creating accounts](https://docs.moov.io/guides/accounts/create-accounts/) and [verification requirements](https://docs.moov.io/guides/accounts/requirements/identity-verification/). Note that the `mode` field (for production or sandbox) is only required when creating a Partner account. All other account requests will ignore the mode field and be set to the calling Partner account's mode.
35
34
  *
36
- * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
37
- * to specify the `/accounts.write` scope.
35
+ * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need to specify the `/accounts.write` scope.
38
36
  */
39
37
  async create(
40
38
  request: components.CreateAccount,
@@ -14,7 +14,7 @@ export class Capabilities extends ClientSDK {
14
14
  /**
15
15
  * Retrieve all the capabilities an account has requested.
16
16
  *
17
- * Read our [capabilities guide](https://docs.moov.io/guides/accounts/capabilities/) to learn more.
17
+ * Read our [capabilities reference](https://docs.moov.io/guides/accounts/capabilities/reference/) to learn more.
18
18
  *
19
19
  * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
20
20
  * you'll need to specify the `/accounts/{accountID}/capabilities.read` scope.
@@ -31,7 +31,7 @@ export class Capabilities extends ClientSDK {
31
31
  }
32
32
 
33
33
  /**
34
- * Request capabilities for a specific account. Read our [capabilities guide](https://docs.moov.io/guides/accounts/capabilities/) to learn more.
34
+ * Request capabilities for a specific account. Read our [capabilities reference](https://docs.moov.io/guides/accounts/capabilities/reference/) to learn more.
35
35
  *
36
36
  * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
37
37
  * you'll need to specify the `/accounts/{accountID}/capabilities.write` scope.
@@ -48,7 +48,7 @@ export class Capabilities extends ClientSDK {
48
48
  }
49
49
 
50
50
  /**
51
- * Retrieve a specific capability that an account has requested. Read our [capabilities guide](https://docs.moov.io/guides/accounts/capabilities/) to learn more.
51
+ * Retrieve a specific capability that an account has requested. Read our [capabilities reference](https://docs.moov.io/guides/accounts/capabilities/reference/) to learn more.
52
52
  *
53
53
  * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
54
54
  * you'll need to specify the `/accounts/{accountID}/capabilities.read` scope.
@@ -65,7 +65,7 @@ export class Capabilities extends ClientSDK {
65
65
  }
66
66
 
67
67
  /**
68
- * Disable a specific capability that an account has requested. Read our [capabilities guide](https://docs.moov.io/guides/accounts/capabilities/) to learn more.
68
+ * Disable a specific capability that an account has requested. Read our [capabilities reference](https://docs.moov.io/guides/accounts/capabilities/reference/) to learn more.
69
69
  *
70
70
  * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
71
71
  * you'll need to specify the `/accounts/{accountID}/capabilities.write` scope.
@@ -12,6 +12,7 @@ import { transfersGetCancellation } from "../funcs/transfersGetCancellation.js";
12
12
  import { transfersGetRefund } from "../funcs/transfersGetRefund.js";
13
13
  import { transfersInitiateRefund } from "../funcs/transfersInitiateRefund.js";
14
14
  import { transfersList } from "../funcs/transfersList.js";
15
+ import { transfersListCancellations } from "../funcs/transfersListCancellations.js";
15
16
  import { transfersListRefunds } from "../funcs/transfersListRefunds.js";
16
17
  import { transfersUpdate } from "../funcs/transfersUpdate.js";
17
18
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
@@ -161,6 +162,23 @@ export class Transfers extends ClientSDK {
161
162
  ));
162
163
  }
163
164
 
165
+ /**
166
+ * Get a list of cancellations for a transfer.
167
+ *
168
+ * To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
169
+ * to specify the `/accounts/{accountID}/transfers.read` scope.
170
+ */
171
+ async listCancellations(
172
+ request: operations.ListCancellationsRequest,
173
+ options?: RequestOptions,
174
+ ): Promise<operations.ListCancellationsResponse> {
175
+ return unwrapAsync(transfersListCancellations(
176
+ this,
177
+ request,
178
+ options,
179
+ ));
180
+ }
181
+
164
182
  /**
165
183
  * Get details of a cancellation for a transfer.
166
184
  *
@@ -21,16 +21,17 @@ export type APICall =
21
21
 
22
22
  export class APIPromise<T> implements Promise<T> {
23
23
  readonly #promise: Promise<[T, APICall]>;
24
- readonly #unwrapped: Promise<T>;
24
+ #unwrapped: Promise<T> | null;
25
25
 
26
26
  readonly [Symbol.toStringTag] = "APIPromise";
27
27
 
28
28
  constructor(p: [T, APICall] | Promise<[T, APICall]>) {
29
29
  this.#promise = p instanceof Promise ? p : Promise.resolve(p);
30
- this.#unwrapped =
31
- p instanceof Promise
32
- ? this.#promise.then(([value]) => value)
33
- : Promise.resolve(p[0]);
30
+ this.#unwrapped = p instanceof Promise ? null : Promise.resolve(p[0]);
31
+ }
32
+
33
+ #getUnwrapped(): Promise<T> {
34
+ return (this.#unwrapped ??= this.#promise.then(([value]) => value));
34
35
  }
35
36
 
36
37
  then<TResult1 = T, TResult2 = never>(
@@ -55,11 +56,11 @@ export class APIPromise<T> implements Promise<T> {
55
56
  | null
56
57
  | undefined,
57
58
  ): Promise<T | TResult> {
58
- return this.#unwrapped.catch(onrejected);
59
+ return this.#getUnwrapped().catch(onrejected);
59
60
  }
60
61
 
61
62
  finally(onfinally?: (() => void) | null | undefined): Promise<T> {
62
- return this.#unwrapped.finally(onfinally);
63
+ return this.#getUnwrapped().finally(onfinally);
63
64
  }
64
65
 
65
66
  $inspect(): Promise<[T, APICall]> {
@@ -0,0 +1,86 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { HTTPClient, Moov } from "@moovio/sdk";
3
+
4
+ /**
5
+ * Builds a Moov SDK instance whose HTTPClient captures every outgoing
6
+ * Request without hitting the network. The captured Request can then be
7
+ * inspected for headers, URL, etc.
8
+ */
9
+ function captureRequests(opts: ConstructorParameters<typeof Moov>[0]) {
10
+ const requests: Request[] = [];
11
+ const httpClient = new HTTPClient({
12
+ fetcher: async (input, init) => {
13
+ const req = input instanceof Request ? input : new Request(input, init);
14
+ requests.push(req.clone());
15
+ return new Response(null, { status: 200 });
16
+ },
17
+ });
18
+
19
+ const moov = new Moov({ ...opts, httpClient });
20
+ return { moov, requests };
21
+ }
22
+
23
+ describe("accessToken option", () => {
24
+ test("sets Authorization: Bearer header on outgoing requests", async () => {
25
+ const { moov, requests } = captureRequests({
26
+ accessToken: "test-access-token-123",
27
+ });
28
+
29
+ await moov.ping.ping();
30
+
31
+ expect(requests.length).toBe(1);
32
+ expect(requests[0].headers.get("Authorization")).toBe(
33
+ "Bearer test-access-token-123",
34
+ );
35
+ });
36
+
37
+ test("applies bearer auth on every request, not just the first", async () => {
38
+ const { moov, requests } = captureRequests({
39
+ accessToken: "another-token",
40
+ });
41
+
42
+ await moov.ping.ping();
43
+ await moov.ping.ping();
44
+ await moov.ping.ping();
45
+
46
+ expect(requests.length).toBe(3);
47
+ for (const req of requests) {
48
+ expect(req.headers.get("Authorization")).toBe("Bearer another-token");
49
+ }
50
+ });
51
+
52
+ test("HTTP Basic auth still works when accessToken is not set", async () => {
53
+ const { moov, requests } = captureRequests({
54
+ security: { username: "my-public-key", password: "my-secret-key" },
55
+ });
56
+
57
+ await moov.ping.ping();
58
+
59
+ expect(requests.length).toBe(1);
60
+ const auth = requests[0].headers.get("Authorization");
61
+ expect(auth).toMatch(/^Basic /);
62
+
63
+ // Decode the base64 portion and confirm the credentials round-trip.
64
+ const encoded = auth!.slice("Basic ".length);
65
+ const decoded = Buffer.from(encoded, "base64").toString("utf8");
66
+ expect(decoded).toBe("my-public-key:my-secret-key");
67
+ });
68
+
69
+ test("no Authorization header is sent when neither auth mode is configured", async () => {
70
+ const { moov, requests } = captureRequests({});
71
+
72
+ await moov.ping.ping();
73
+
74
+ expect(requests.length).toBe(1);
75
+ expect(requests[0].headers.get("Authorization")).toBeNull();
76
+ });
77
+
78
+ test("throws at construction when both accessToken and Basic creds are set", () => {
79
+ expect(() =>
80
+ new Moov({
81
+ accessToken: "some-token",
82
+ security: { username: "u", password: "p" },
83
+ })
84
+ ).toThrow(/cannot both be set/i);
85
+ });
86
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../src/types/async.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,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O,CAAC,CAAC,GACjD,IAAI,GACJ,SAAS,GACZ,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC;IAIvB,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhE,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;CAGlC"}
package/types/async.js CHANGED
@@ -13,32 +13,33 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
13
13
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14
14
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
15
  };
16
- var _APIPromise_promise, _APIPromise_unwrapped, _a;
16
+ var _APIPromise_instances, _APIPromise_promise, _APIPromise_unwrapped, _APIPromise_getUnwrapped, _a;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.APIPromise = void 0;
19
19
  class APIPromise {
20
20
  constructor(p) {
21
+ _APIPromise_instances.add(this);
21
22
  _APIPromise_promise.set(this, void 0);
22
23
  _APIPromise_unwrapped.set(this, void 0);
23
24
  this[_a] = "APIPromise";
24
25
  __classPrivateFieldSet(this, _APIPromise_promise, p instanceof Promise ? p : Promise.resolve(p), "f");
25
- __classPrivateFieldSet(this, _APIPromise_unwrapped, p instanceof Promise
26
- ? __classPrivateFieldGet(this, _APIPromise_promise, "f").then(([value]) => value)
27
- : Promise.resolve(p[0]), "f");
26
+ __classPrivateFieldSet(this, _APIPromise_unwrapped, p instanceof Promise ? null : Promise.resolve(p[0]), "f");
28
27
  }
29
28
  then(onfulfilled, onrejected) {
30
29
  return __classPrivateFieldGet(this, _APIPromise_promise, "f").then(onfulfilled ? ([value]) => onfulfilled(value) : void 0, onrejected);
31
30
  }
32
31
  catch(onrejected) {
33
- return __classPrivateFieldGet(this, _APIPromise_unwrapped, "f").catch(onrejected);
32
+ return __classPrivateFieldGet(this, _APIPromise_instances, "m", _APIPromise_getUnwrapped).call(this).catch(onrejected);
34
33
  }
35
34
  finally(onfinally) {
36
- return __classPrivateFieldGet(this, _APIPromise_unwrapped, "f").finally(onfinally);
35
+ return __classPrivateFieldGet(this, _APIPromise_instances, "m", _APIPromise_getUnwrapped).call(this).finally(onfinally);
37
36
  }
38
37
  $inspect() {
39
38
  return __classPrivateFieldGet(this, _APIPromise_promise, "f");
40
39
  }
41
40
  }
42
41
  exports.APIPromise = APIPromise;
43
- _APIPromise_promise = new WeakMap(), _APIPromise_unwrapped = new WeakMap(), _a = Symbol.toStringTag;
42
+ _APIPromise_promise = new WeakMap(), _APIPromise_unwrapped = new WeakMap(), _APIPromise_instances = new WeakSet(), _a = Symbol.toStringTag, _APIPromise_getUnwrapped = function _APIPromise_getUnwrapped() {
43
+ return (__classPrivateFieldSet(this, _APIPromise_unwrapped, __classPrivateFieldGet(this, _APIPromise_unwrapped, "f") ?? __classPrivateFieldGet(this, _APIPromise_promise, "f").then(([value]) => value), "f"));
44
+ };
44
45
  //# sourceMappingURL=async.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"async.js","sourceRoot":"","sources":["../src/types/async.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;AAmBH,MAAa,UAAU;IAMrB,YAAY,CAAuC;QAL1C,sCAAgC;QAChC,wCAAuB;QAEvB,QAAoB,GAAG,YAAY,CAAC;QAG3C,uBAAA,IAAI,uBAAY,CAAC,YAAY,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,MAAA,CAAC;QAC9D,uBAAA,IAAI,yBACF,CAAC,YAAY,OAAO;YAClB,CAAC,CAAC,uBAAA,IAAI,2BAAS,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC;YACxC,CAAC,CAAC,OA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AC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EACtD,UAAU,CACX,CAAC;IACJ,CAAC;IAED,KAAK,CACH,UAGa;QAEb,OAAO,uBAAA,IAAI,uDAAc,MAAlB,IAAI,CAAgB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,CAAC,SAA2C;QACjD,OAAO,uBAAA,IAAI,uDAAc,MAAlB,IAAI,CAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACjD,CAAC;IAED,QAAQ;QACN,OAAO,uBAAA,IAAI,2BAAS,CAAC;IACvB,CAAC;CACF;AA/CD,gCA+CC;wHA3CW,MAAM,CAAC,WAAW;IAQ1B,OAAO,CAAC,gHAAoB,uBAAA,IAAI,2BAAS,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,MAAA,CAAC,CAAC;AACtE,CAAC"}
package/lib/dlv.d.ts DELETED
@@ -1,14 +0,0 @@
1
- /**
2
- * @param obj The object to walk
3
- * @param key The key path to walk the object with
4
- * @param def A default value to return if the result is undefined
5
- *
6
- * @example
7
- * dlv(obj, "a.b.c.d")
8
- * @example
9
- * dlv(object, ["a", "b", "c", "d"])
10
- * @example
11
- * dlv(object, "foo.bar.baz", "Hello, default value!")
12
- */
13
- export declare function dlv<T = any>(obj: any, key: string | string[], def?: T, p?: number, undef?: never): T | undefined;
14
- //# sourceMappingURL=dlv.d.ts.map
package/lib/dlv.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"dlv.d.ts","sourceRoot":"","sources":["../src/lib/dlv.ts"],"names":[],"mappings":"AA2BA;;;;;;;;;;;GAWG;AACH,wBAAgB,GAAG,CAAC,CAAC,GAAG,GAAG,EACzB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,EACtB,GAAG,CAAC,EAAE,CAAC,EACP,CAAC,CAAC,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,KAAK,GACZ,CAAC,GAAG,SAAS,CAOf"}