@gr4vy/sdk 0.17.2 → 0.17.3

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 (49) hide show
  1. package/bin/mcp-server.js +102 -24
  2. package/bin/mcp-server.js.map +11 -11
  3. package/docs/sdks/giftcards/README.md +9 -5
  4. package/docs/sdks/transactions/README.md +9 -5
  5. package/funcs/giftCardsList.d.ts +5 -2
  6. package/funcs/giftCardsList.d.ts.map +1 -1
  7. package/funcs/giftCardsList.js +27 -7
  8. package/funcs/giftCardsList.js.map +1 -1
  9. package/funcs/transactionsList.d.ts +4 -2
  10. package/funcs/transactionsList.d.ts.map +1 -1
  11. package/funcs/transactionsList.js +30 -7
  12. package/funcs/transactionsList.js.map +1 -1
  13. package/jsr.json +1 -1
  14. package/lib/config.d.ts +3 -3
  15. package/lib/config.js +3 -3
  16. package/mcp-server/mcp-server.js +1 -1
  17. package/mcp-server/server.js +1 -1
  18. package/mcp-server/tools/giftCardsList.js +1 -1
  19. package/mcp-server/tools/giftCardsList.js.map +1 -1
  20. package/mcp-server/tools/transactionsList.js +1 -1
  21. package/mcp-server/tools/transactionsList.js.map +1 -1
  22. package/models/operations/listgiftcards.d.ts +26 -0
  23. package/models/operations/listgiftcards.d.ts.map +1 -1
  24. package/models/operations/listgiftcards.js +37 -1
  25. package/models/operations/listgiftcards.js.map +1 -1
  26. package/models/operations/listtransactions.d.ts +25 -0
  27. package/models/operations/listtransactions.d.ts.map +1 -1
  28. package/models/operations/listtransactions.js +36 -1
  29. package/models/operations/listtransactions.js.map +1 -1
  30. package/package.json +5 -1
  31. package/sdk/giftcards.d.ts +5 -1
  32. package/sdk/giftcards.d.ts.map +1 -1
  33. package/sdk/giftcards.js +2 -1
  34. package/sdk/giftcards.js.map +1 -1
  35. package/sdk/transactions.d.ts +4 -1
  36. package/sdk/transactions.d.ts.map +1 -1
  37. package/sdk/transactions.js +2 -1
  38. package/sdk/transactions.js.map +1 -1
  39. package/src/funcs/giftCardsList.ts +121 -51
  40. package/src/funcs/transactionsList.ts +116 -46
  41. package/src/lib/config.ts +3 -3
  42. package/src/mcp-server/mcp-server.ts +1 -1
  43. package/src/mcp-server/server.ts +1 -1
  44. package/src/mcp-server/tools/giftCardsList.ts +1 -1
  45. package/src/mcp-server/tools/transactionsList.ts +1 -1
  46. package/src/models/operations/listgiftcards.ts +67 -0
  47. package/src/models/operations/listtransactions.ts +66 -0
  48. package/src/sdk/giftcards.ts +6 -2
  49. package/src/sdk/transactions.ts +5 -2
package/bin/mcp-server.js CHANGED
@@ -4026,9 +4026,9 @@ var init_config = __esm(() => {
4026
4026
  SDK_METADATA = {
4027
4027
  language: "typescript",
4028
4028
  openapiDocVersion: "1.0.0",
4029
- sdkVersion: "0.17.2",
4030
- genVersion: "2.588.4",
4031
- userAgent: "speakeasy-sdk/typescript 0.17.2 2.588.4 1.0.0 @gr4vy/sdk"
4029
+ sdkVersion: "0.17.3",
4030
+ genVersion: "2.591.1",
4031
+ userAgent: "speakeasy-sdk/typescript 0.17.3 2.591.1 1.0.0 @gr4vy/sdk"
4032
4032
  };
4033
4033
  });
4034
4034
 
@@ -45621,10 +45621,11 @@ var init_listgiftcardbalances2 = __esm(() => {
45621
45621
  });
45622
45622
 
45623
45623
  // src/models/operations/listgiftcards.ts
45624
- var ListGiftCardsRequest$inboundSchema, ListGiftCardsRequest$outboundSchema, ListGiftCardsRequest$;
45624
+ var ListGiftCardsRequest$inboundSchema, ListGiftCardsRequest$outboundSchema, ListGiftCardsRequest$, ListGiftCardsResponse$inboundSchema, ListGiftCardsResponse$outboundSchema, ListGiftCardsResponse$;
45625
45625
  var init_listgiftcards2 = __esm(() => {
45626
45626
  init_lib();
45627
45627
  init_primitives();
45628
+ init_components();
45628
45629
  ListGiftCardsRequest$inboundSchema = objectType({
45629
45630
  buyer_external_identifier: nullableType(stringType()).optional(),
45630
45631
  buyer_id: nullableType(stringType()).optional(),
@@ -45651,6 +45652,24 @@ var init_listgiftcards2 = __esm(() => {
45651
45652
  ListGiftCardsRequest$.inboundSchema = ListGiftCardsRequest$inboundSchema;
45652
45653
  ListGiftCardsRequest$.outboundSchema = ListGiftCardsRequest$outboundSchema;
45653
45654
  })(ListGiftCardsRequest$ ||= {});
45655
+ ListGiftCardsResponse$inboundSchema = objectType({
45656
+ Result: CollectionGiftCard$inboundSchema
45657
+ }).transform((v2) => {
45658
+ return remap(v2, {
45659
+ Result: "result"
45660
+ });
45661
+ });
45662
+ ListGiftCardsResponse$outboundSchema = objectType({
45663
+ result: CollectionGiftCard$outboundSchema
45664
+ }).transform((v2) => {
45665
+ return remap(v2, {
45666
+ result: "Result"
45667
+ });
45668
+ });
45669
+ ((ListGiftCardsResponse$) => {
45670
+ ListGiftCardsResponse$.inboundSchema = ListGiftCardsResponse$inboundSchema;
45671
+ ListGiftCardsResponse$.outboundSchema = ListGiftCardsResponse$outboundSchema;
45672
+ })(ListGiftCardsResponse$ ||= {});
45654
45673
  });
45655
45674
 
45656
45675
  // src/models/operations/listpaymentmethodnetworktokens.ts
@@ -45829,7 +45848,7 @@ var init_listtransactionrefunds2 = __esm(() => {
45829
45848
  });
45830
45849
 
45831
45850
  // src/models/operations/listtransactions.ts
45832
- var ListTransactionsRequest$inboundSchema, ListTransactionsRequest$outboundSchema, ListTransactionsRequest$;
45851
+ var ListTransactionsRequest$inboundSchema, ListTransactionsRequest$outboundSchema, ListTransactionsRequest$, ListTransactionsResponse$inboundSchema, ListTransactionsResponse$outboundSchema, ListTransactionsResponse$;
45833
45852
  var init_listtransactions2 = __esm(() => {
45834
45853
  init_lib();
45835
45854
  init_primitives();
@@ -45980,6 +45999,24 @@ var init_listtransactions2 = __esm(() => {
45980
45999
  ListTransactionsRequest$.inboundSchema = ListTransactionsRequest$inboundSchema;
45981
46000
  ListTransactionsRequest$.outboundSchema = ListTransactionsRequest$outboundSchema;
45982
46001
  })(ListTransactionsRequest$ ||= {});
46002
+ ListTransactionsResponse$inboundSchema = objectType({
46003
+ Result: CollectionTransactionSummary$inboundSchema
46004
+ }).transform((v2) => {
46005
+ return remap(v2, {
46006
+ Result: "result"
46007
+ });
46008
+ });
46009
+ ListTransactionsResponse$outboundSchema = objectType({
46010
+ result: CollectionTransactionSummary$outboundSchema
46011
+ }).transform((v2) => {
46012
+ return remap(v2, {
46013
+ result: "Result"
46014
+ });
46015
+ });
46016
+ ((ListTransactionsResponse$) => {
46017
+ ListTransactionsResponse$.inboundSchema = ListTransactionsResponse$inboundSchema;
46018
+ ListTransactionsResponse$.outboundSchema = ListTransactionsResponse$outboundSchema;
46019
+ })(ListTransactionsResponse$ ||= {});
45983
46020
  });
45984
46021
 
45985
46022
  // src/models/operations/registerdigitalwalletdomain.ts
@@ -50782,7 +50819,7 @@ async function $do34(client, buyerExternalIdentifier, buyerId, cursor, limit, op
50782
50819
  };
50783
50820
  const parsed = safeParse(input, (value) => ListGiftCardsRequest$outboundSchema.optional().parse(value), "Input validation failed");
50784
50821
  if (!parsed.ok) {
50785
- return [parsed, { status: "invalid" }];
50822
+ return [haltIterator(parsed), { status: "invalid" }];
50786
50823
  }
50787
50824
  const payload = parsed.value;
50788
50825
  const body = null;
@@ -50828,7 +50865,7 @@ async function $do34(client, buyerExternalIdentifier, buyerId, cursor, limit, op
50828
50865
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
50829
50866
  }, options);
50830
50867
  if (!requestRes.ok) {
50831
- return [requestRes, { status: "invalid" }];
50868
+ return [haltIterator(requestRes), { status: "invalid" }];
50832
50869
  }
50833
50870
  const req = requestRes.value;
50834
50871
  const doResult = await client._do(req, {
@@ -50853,17 +50890,36 @@ async function $do34(client, buyerExternalIdentifier, buyerId, cursor, limit, op
50853
50890
  retryCodes: context.retryCodes
50854
50891
  });
50855
50892
  if (!doResult.ok) {
50856
- return [doResult, { status: "request-error", request: req }];
50893
+ return [haltIterator(doResult), { status: "request-error", request: req }];
50857
50894
  }
50858
50895
  const response = doResult.value;
50859
50896
  const responseFields = {
50860
50897
  HttpMeta: { Response: response, Request: req }
50861
50898
  };
50862
- const [result] = await match(json(200, CollectionGiftCard$inboundSchema), jsonErr(400, Error400$inboundSchema), jsonErr(401, Error401$inboundSchema), jsonErr(403, ListGiftCardsResponse403ListGiftCards$inboundSchema), jsonErr(404, Error404$inboundSchema), jsonErr(405, Error405$inboundSchema), jsonErr(409, Error409$inboundSchema), jsonErr(422, HTTPValidationError$inboundSchema), jsonErr(425, Error425$inboundSchema), jsonErr(429, Error429$inboundSchema), jsonErr(500, Error500$inboundSchema), jsonErr(502, Error502$inboundSchema), jsonErr(504, Error504$inboundSchema), fail("4XX"), fail("5XX"))(response, { extraFields: responseFields });
50899
+ const [result, raw] = await match(json(200, ListGiftCardsResponse$inboundSchema, {
50900
+ key: "Result"
50901
+ }), jsonErr(400, Error400$inboundSchema), jsonErr(401, Error401$inboundSchema), jsonErr(403, ListGiftCardsResponse403ListGiftCards$inboundSchema), jsonErr(404, Error404$inboundSchema), jsonErr(405, Error405$inboundSchema), jsonErr(409, Error409$inboundSchema), jsonErr(422, HTTPValidationError$inboundSchema), jsonErr(425, Error425$inboundSchema), jsonErr(429, Error429$inboundSchema), jsonErr(500, Error500$inboundSchema), jsonErr(502, Error502$inboundSchema), jsonErr(504, Error504$inboundSchema), fail("4XX"), fail("5XX"))(response, { extraFields: responseFields });
50863
50902
  if (!result.ok) {
50864
- return [result, { status: "complete", request: req, response }];
50903
+ return [haltIterator(result), {
50904
+ status: "complete",
50905
+ request: req,
50906
+ response
50907
+ }];
50865
50908
  }
50866
- return [result, { status: "complete", request: req, response }];
50909
+ const nextFunc = (responseData) => {
50910
+ const nextCursor = dlv(responseData, "next_cursor");
50911
+ if (typeof nextCursor !== "string") {
50912
+ return { next: () => null };
50913
+ }
50914
+ const nextVal = () => giftCardsList(client, buyerExternalIdentifier, buyerId, nextCursor, limit, options);
50915
+ return { next: nextVal, "~next": { cursor: nextCursor } };
50916
+ };
50917
+ const page = { ...result, ...nextFunc(raw) };
50918
+ return [{ ...page, ...createPageIterator(page, (v2) => !v2.ok) }, {
50919
+ status: "complete",
50920
+ request: req,
50921
+ response
50922
+ }];
50867
50923
  }
50868
50924
  var init_giftCardsList = __esm(() => {
50869
50925
  init_encodings();
@@ -50872,10 +50928,10 @@ var init_giftCardsList = __esm(() => {
50872
50928
  init_schemas();
50873
50929
  init_security();
50874
50930
  init_url();
50875
- init_components();
50876
50931
  init_errors();
50877
50932
  init_operations();
50878
50933
  init_async();
50934
+ init_operations2();
50879
50935
  });
50880
50936
 
50881
50937
  // src/mcp-server/tools/giftCardsList.ts
@@ -50904,7 +50960,7 @@ Browser all gift cards.`,
50904
50960
  isError: true
50905
50961
  };
50906
50962
  }
50907
- const value = result.value;
50963
+ const value = result.value.result;
50908
50964
  return formatResult(value, apiCall);
50909
50965
  }
50910
50966
  };
@@ -53981,7 +54037,7 @@ function transactionsList(client, request, options) {
53981
54037
  async function $do58(client, request, options) {
53982
54038
  const parsed = safeParse(request, (value) => ListTransactionsRequest$outboundSchema.optional().parse(value), "Input validation failed");
53983
54039
  if (!parsed.ok) {
53984
- return [parsed, { status: "invalid" }];
54040
+ return [haltIterator(parsed), { status: "invalid" }];
53985
54041
  }
53986
54042
  const payload = parsed.value;
53987
54043
  const body = null;
@@ -54060,7 +54116,7 @@ async function $do58(client, request, options) {
54060
54116
  timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
54061
54117
  }, options);
54062
54118
  if (!requestRes.ok) {
54063
- return [requestRes, { status: "invalid" }];
54119
+ return [haltIterator(requestRes), { status: "invalid" }];
54064
54120
  }
54065
54121
  const req = requestRes.value;
54066
54122
  const doResult = await client._do(req, {
@@ -54085,17 +54141,39 @@ async function $do58(client, request, options) {
54085
54141
  retryCodes: context.retryCodes
54086
54142
  });
54087
54143
  if (!doResult.ok) {
54088
- return [doResult, { status: "request-error", request: req }];
54144
+ return [haltIterator(doResult), { status: "request-error", request: req }];
54089
54145
  }
54090
54146
  const response = doResult.value;
54091
54147
  const responseFields = {
54092
54148
  HttpMeta: { Response: response, Request: req }
54093
54149
  };
54094
- const [result] = await match(json(200, CollectionTransactionSummary$inboundSchema), jsonErr(400, Error400$inboundSchema), jsonErr(401, Error401$inboundSchema), jsonErr(403, ListTransactionsResponse403ListTransactions$inboundSchema), jsonErr(404, Error404$inboundSchema), jsonErr(405, Error405$inboundSchema), jsonErr(409, Error409$inboundSchema), jsonErr(422, HTTPValidationError$inboundSchema), jsonErr(425, Error425$inboundSchema), jsonErr(429, Error429$inboundSchema), jsonErr(500, Error500$inboundSchema), jsonErr(502, Error502$inboundSchema), jsonErr(504, Error504$inboundSchema), fail("4XX"), fail("5XX"))(response, { extraFields: responseFields });
54150
+ const [result, raw] = await match(json(200, ListTransactionsResponse$inboundSchema, {
54151
+ key: "Result"
54152
+ }), jsonErr(400, Error400$inboundSchema), jsonErr(401, Error401$inboundSchema), jsonErr(403, ListTransactionsResponse403ListTransactions$inboundSchema), jsonErr(404, Error404$inboundSchema), jsonErr(405, Error405$inboundSchema), jsonErr(409, Error409$inboundSchema), jsonErr(422, HTTPValidationError$inboundSchema), jsonErr(425, Error425$inboundSchema), jsonErr(429, Error429$inboundSchema), jsonErr(500, Error500$inboundSchema), jsonErr(502, Error502$inboundSchema), jsonErr(504, Error504$inboundSchema), fail("4XX"), fail("5XX"))(response, { extraFields: responseFields });
54095
54153
  if (!result.ok) {
54096
- return [result, { status: "complete", request: req, response }];
54154
+ return [haltIterator(result), {
54155
+ status: "complete",
54156
+ request: req,
54157
+ response
54158
+ }];
54097
54159
  }
54098
- return [result, { status: "complete", request: req, response }];
54160
+ const nextFunc = (responseData) => {
54161
+ const nextCursor = dlv(responseData, "next_cursor");
54162
+ if (typeof nextCursor !== "string") {
54163
+ return { next: () => null };
54164
+ }
54165
+ const nextVal = () => transactionsList(client, {
54166
+ ...request,
54167
+ cursor: nextCursor
54168
+ }, options);
54169
+ return { next: nextVal, "~next": { cursor: nextCursor } };
54170
+ };
54171
+ const page = { ...result, ...nextFunc(raw) };
54172
+ return [{ ...page, ...createPageIterator(page, (v2) => !v2.ok) }, {
54173
+ status: "complete",
54174
+ request: req,
54175
+ response
54176
+ }];
54099
54177
  }
54100
54178
  var init_transactionsList = __esm(() => {
54101
54179
  init_encodings();
@@ -54104,10 +54182,10 @@ var init_transactionsList = __esm(() => {
54104
54182
  init_schemas();
54105
54183
  init_security();
54106
54184
  init_url();
54107
- init_components();
54108
54185
  init_errors();
54109
54186
  init_operations();
54110
54187
  init_async();
54188
+ init_operations2();
54111
54189
  });
54112
54190
 
54113
54191
  // src/mcp-server/tools/transactionsList.ts
@@ -54133,7 +54211,7 @@ List all transactions.`,
54133
54211
  isError: true
54134
54212
  };
54135
54213
  }
54136
- const value = result.value;
54214
+ const value = result.value.result;
54137
54215
  return formatResult(value, apiCall);
54138
54216
  }
54139
54217
  };
@@ -54813,7 +54891,7 @@ Void an authorized transaction.`,
54813
54891
  function createMCPServer(deps) {
54814
54892
  const server = new McpServer({
54815
54893
  name: "Gr4vy",
54816
- version: "0.17.2"
54894
+ version: "0.17.3"
54817
54895
  });
54818
54896
  const client = new Gr4vyCore({
54819
54897
  bearerAuth: deps.bearerAuth,
@@ -56160,7 +56238,7 @@ var routes = an({
56160
56238
  var app = He(routes, {
56161
56239
  name: "mcp",
56162
56240
  versionInfo: {
56163
- currentVersion: "0.17.2"
56241
+ currentVersion: "0.17.3"
56164
56242
  }
56165
56243
  });
56166
56244
  zt(app, process3.argv.slice(2), buildContext(process3));
@@ -56168,5 +56246,5 @@ export {
56168
56246
  app
56169
56247
  };
56170
56248
 
56171
- //# debugId=B66B12C99B78070C64756E2164756E21
56249
+ //# debugId=BC1E53D70A0F192E64756E2164756E21
56172
56250
  //# sourceMappingURL=mcp-server.js.map