btrz-api-client 8.34.0 → 8.36.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.
Files changed (99) hide show
  1. package/lib/client-standalone-min.js +3 -3
  2. package/lib/client.js +4 -0
  3. package/lib/endpoints/inventory/banks.js +39 -21
  4. package/lib/endpoints/inventory/change-requests.js +59 -31
  5. package/lib/endpoints/inventory/control-classes.js +39 -20
  6. package/lib/endpoints/inventory/countries.js +25 -9
  7. package/lib/endpoints/inventory/custom-content.js +38 -21
  8. package/lib/endpoints/inventory/custom-fields.js +25 -17
  9. package/lib/endpoints/inventory/document-types.js +33 -42
  10. package/lib/endpoints/inventory/external-wallets.js +26 -20
  11. package/lib/endpoints/inventory/fees.js +24 -17
  12. package/lib/endpoints/inventory/filtered-trips.js +34 -8
  13. package/lib/endpoints/inventory/financing-costs.js +19 -14
  14. package/lib/endpoints/inventory/garages.js +19 -14
  15. package/lib/endpoints/inventory/getnet-terminals.js +20 -15
  16. package/lib/endpoints/inventory/gift-certificate-definitions.js +10 -5
  17. package/lib/endpoints/inventory/holidays.js +158 -0
  18. package/lib/endpoints/inventory/insurances.js +17 -13
  19. package/lib/endpoints/inventory/items.js +13 -9
  20. package/lib/endpoints/inventory/labels.js +16 -11
  21. package/lib/endpoints/inventory/marital-status.js +16 -11
  22. package/lib/endpoints/inventory/marketplace-modifiers.js +16 -11
  23. package/lib/endpoints/inventory/mit-terminal-settings.js +15 -10
  24. package/lib/endpoints/inventory/mit-terminals.js +16 -11
  25. package/lib/endpoints/inventory/operation-messages.js +18 -12
  26. package/lib/endpoints/inventory/operation-reasons.js +15 -10
  27. package/lib/endpoints/inventory/pay-on-accounts.js +5 -4
  28. package/lib/endpoints/inventory/payment-terminals.js +15 -10
  29. package/lib/endpoints/inventory/products.js +22 -10
  30. package/lib/endpoints/inventory/promos.js +27 -18
  31. package/lib/endpoints/inventory/station-groups.js +2 -4
  32. package/lib/endpoints/inventory/taxes.js +11 -2
  33. package/lib/endpoints/inventory/traveller-card-providers-types.js +6 -6
  34. package/lib/endpoints/inventory/vehicle-types.js +2 -5
  35. package/lib/endpoints/inventory/vehicles.js +4 -2
  36. package/lib/endpoints/notifications/customers.js +1 -1
  37. package/lib/endpoints/notifications/external-customers.js +54 -0
  38. package/lib/endpoints/notifications/pdfs.js +0 -3
  39. package/lib/endpoints/operations/accounting_items.js +7 -1
  40. package/lib/endpoints/operations/flexpasses.js +9 -7
  41. package/lib/endpoints/operations/gift-certificates.js +53 -0
  42. package/lib/endpoints/operations/loans.js +16 -10
  43. package/lib/endpoints/operations/movements.js +17 -6
  44. package/lib/endpoints/operations/pago-express.js +96 -0
  45. package/lib/endpoints/operations/parcels.js +11 -11
  46. package/lib/endpoints/operations/parcels_manifests.js +7 -4
  47. package/package.json +1 -1
  48. package/src/client.js +4 -0
  49. package/src/endpoints/inventory/banks.js +39 -21
  50. package/src/endpoints/inventory/change-requests.js +59 -31
  51. package/src/endpoints/inventory/control-classes.js +39 -20
  52. package/src/endpoints/inventory/countries.js +25 -10
  53. package/src/endpoints/inventory/custom-content.js +38 -22
  54. package/src/endpoints/inventory/custom-fields.js +25 -19
  55. package/src/endpoints/inventory/document-types.js +34 -33
  56. package/src/endpoints/inventory/external-wallets.js +25 -20
  57. package/src/endpoints/inventory/fees.js +24 -18
  58. package/src/endpoints/inventory/filtered-trips.js +29 -8
  59. package/src/endpoints/inventory/financing-costs.js +19 -14
  60. package/src/endpoints/inventory/garages.js +19 -14
  61. package/src/endpoints/inventory/getnet-terminals.js +20 -15
  62. package/src/endpoints/inventory/gift-certificate-definitions.js +10 -5
  63. package/src/endpoints/inventory/holidays.js +121 -0
  64. package/src/endpoints/inventory/insurances.js +17 -13
  65. package/src/endpoints/inventory/items.js +13 -9
  66. package/src/endpoints/inventory/labels.js +16 -11
  67. package/src/endpoints/inventory/marital-status.js +16 -11
  68. package/src/endpoints/inventory/marketplace-modifiers.js +16 -11
  69. package/src/endpoints/inventory/mit-terminal-settings.js +15 -10
  70. package/src/endpoints/inventory/mit-terminals.js +16 -11
  71. package/src/endpoints/inventory/operation-messages.js +18 -12
  72. package/src/endpoints/inventory/operation-reasons.js +15 -10
  73. package/src/endpoints/inventory/pay-on-accounts.js +5 -4
  74. package/src/endpoints/inventory/payment-terminals.js +15 -10
  75. package/src/endpoints/inventory/products.js +22 -10
  76. package/src/endpoints/inventory/promos.js +27 -18
  77. package/src/endpoints/inventory/station-groups.js +2 -4
  78. package/src/endpoints/inventory/taxes.js +11 -2
  79. package/src/endpoints/inventory/traveller-card-providers-types.js +6 -5
  80. package/src/endpoints/inventory/vehicle-types.js +3 -4
  81. package/src/endpoints/inventory/vehicles.js +4 -3
  82. package/src/endpoints/notifications/customers.js +1 -1
  83. package/src/endpoints/notifications/external-customers.js +41 -0
  84. package/src/endpoints/notifications/pdfs.js +0 -3
  85. package/src/endpoints/operations/accounting_items.js +7 -2
  86. package/src/endpoints/operations/flexpasses.js +9 -7
  87. package/src/endpoints/operations/gift-certificates.js +39 -0
  88. package/src/endpoints/operations/loans.js +16 -11
  89. package/src/endpoints/operations/movements.js +17 -6
  90. package/src/endpoints/operations/pago-express.js +73 -0
  91. package/src/endpoints/operations/parcels.js +11 -11
  92. package/src/endpoints/operations/parcels_manifests.js +7 -5
  93. package/test/endpoints/inventory/banks.test.js +8 -10
  94. package/test/endpoints/inventory/filtered-trips.test.js +6 -0
  95. package/test/endpoints/inventory/holidays.test.js +52 -0
  96. package/test/endpoints/inventory/traveller-card-providers-types.test.js +3 -2
  97. package/test/endpoints/notifications/external-customers.test.js +30 -0
  98. package/test/endpoints/operations/gift_certificates.test.js +37 -0
  99. package/test/endpoints/operations/operations.test.js +30 -0
@@ -16,13 +16,14 @@ const {authorizationHeaders} = require("../endpoints_helpers.js");
16
16
  */
17
17
  function labelsFactory({client, internalAuthTokenProvider}) {
18
18
  /**
19
- * GET /labels - list labels.
19
+ * GET /labels - list labels (paginated).
20
20
  * @param {Object} opts
21
21
  * @param {string} [opts.token] - API key
22
22
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
23
23
  * @param {LabelsQuery} [opts.query] - Query params (name, page)
24
24
  * @param {Object} [opts.headers] - Optional headers
25
- * @returns {Promise<import("axios").AxiosResponse>}
25
+ * @returns {Promise<import("axios").AxiosResponse<{ labels: Object[], count: number, next?: string, previous?: string }>>}
26
+ * @throws 401; 500.
26
27
  */
27
28
  function all({token, jwtToken, query = {}, headers}) {
28
29
  return client.get("/labels", {
@@ -36,9 +37,10 @@ function labelsFactory({client, internalAuthTokenProvider}) {
36
37
  * @param {Object} opts
37
38
  * @param {string} [opts.token] - API key
38
39
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
39
- * @param {string} opts.labelId - Label id (ObjectId format)
40
+ * @param {string} opts.labelId - Label id (24 hex characters)
40
41
  * @param {Object} [opts.headers] - Optional headers
41
- * @returns {Promise<import("axios").AxiosResponse>}
42
+ * @returns {Promise<import("axios").AxiosResponse<{ label: Object }>>}
43
+ * @throws 400 WRONG_DATA, INVALID_LABEL_ID; 401; 404 LABEL_NOT_FOUND; 500.
42
44
  */
43
45
  function get({labelId, token, jwtToken, query = {}, headers}) {
44
46
  return client.get(`/labels/${labelId}`, {
@@ -52,9 +54,10 @@ function labelsFactory({client, internalAuthTokenProvider}) {
52
54
  * @param {Object} opts
53
55
  * @param {string} [opts.token] - API key
54
56
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
55
- * @param {Object} opts.label - Label payload
57
+ * @param {Object} opts.label - Label payload (name, description, color required; type: ticket|manifest)
56
58
  * @param {Object} [opts.headers] - Optional headers
57
- * @returns {Promise<import("axios").AxiosResponse>}
59
+ * @returns {Promise<import("axios").AxiosResponse<{ label: Object }>>}
60
+ * @throws 400 WRONG_DATA (name/description/color required), INVALID_TYPE; 401; 500.
58
61
  */
59
62
  function create({jwtToken, label, token, headers}) {
60
63
  return client({
@@ -70,10 +73,11 @@ function labelsFactory({client, internalAuthTokenProvider}) {
70
73
  * @param {Object} opts
71
74
  * @param {string} [opts.token] - API key
72
75
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
73
- * @param {string} opts.labelId - Label id
74
- * @param {Object} opts.label - Label payload
76
+ * @param {string} opts.labelId - Label id (24 hex characters)
77
+ * @param {Object} opts.label - Label payload (LabelData)
75
78
  * @param {Object} [opts.headers] - Optional headers
76
- * @returns {Promise<import("axios").AxiosResponse>}
79
+ * @returns {Promise<import("axios").AxiosResponse<{ label: Object }>>}
80
+ * @throws 400 WRONG_DATA, INVALID_TYPE, LABEL_ALREADY_USED; 401; 404 LABEL_NOT_FOUND; 500.
77
81
  */
78
82
  function update({jwtToken, token, labelId, label, headers}) {
79
83
  return client({
@@ -90,9 +94,10 @@ function labelsFactory({client, internalAuthTokenProvider}) {
90
94
  * @param {Object} opts
91
95
  * @param {string} [opts.token] - API key
92
96
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
93
- * @param {string} opts.labelId - Label id
97
+ * @param {string} opts.labelId - Label id (24 hex characters)
94
98
  * @param {Object} [opts.headers] - Optional headers
95
- * @returns {Promise<import("axios").AxiosResponse>}
99
+ * @returns {Promise<import("axios").AxiosResponse<{ labelId: string }>>}
100
+ * @throws 400 LABEL_ID (invalid format), LABEL_ALREADY_USED; 401; 404 LABEL_NOT_FOUND; 500.
96
101
  */
97
102
  function remove({jwtToken, token, labelId, headers}) {
98
103
  return client({
@@ -15,13 +15,14 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
15
15
  */
16
16
  function maritalStatusFactory({client, internalAuthTokenProvider}) {
17
17
  /**
18
- * GET /marital-status - list marital statuses.
18
+ * GET /marital-status - list marital statuses (paginated).
19
19
  * @param {Object} opts
20
20
  * @param {string} [opts.token] - API key
21
21
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
22
22
  * @param {MaritalStatusListQuery} [opts.query] - Query params (providerIds)
23
23
  * @param {Object} [opts.headers] - Optional headers
24
- * @returns {Promise<import("axios").AxiosResponse>}
24
+ * @returns {Promise<import("axios").AxiosResponse<{ maritalstatus: Object[], next?: string, previous?: string, count: number }>>}
25
+ * @throws 401; 500.
25
26
  */
26
27
  function all({token, jwtToken, query = {}, headers}) {
27
28
  return client({
@@ -37,9 +38,10 @@ function maritalStatusFactory({client, internalAuthTokenProvider}) {
37
38
  * @param {Object} opts
38
39
  * @param {string} [opts.token] - API key
39
40
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
40
- * @param {string} opts.id - Marital status id
41
+ * @param {string} opts.id - Marital status id (24 hex characters)
41
42
  * @param {Object} [opts.headers] - Optional headers
42
- * @returns {Promise<import("axios").AxiosResponse>}
43
+ * @returns {Promise<import("axios").AxiosResponse<{ maritalstatus: Object }>>}
44
+ * @throws 400 WRONG_DATA, INVALID_MARITALSTATUS_ID; 401; 404 MARITALSTATUS_NOT_FOUND; 500.
43
45
  */
44
46
  function get({token, jwtToken, id, query = {}, headers}) {
45
47
  return client({
@@ -55,10 +57,11 @@ function maritalStatusFactory({client, internalAuthTokenProvider}) {
55
57
  * @param {Object} opts
56
58
  * @param {string} [opts.token] - API key
57
59
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
58
- * @param {string} opts.id - Marital status id
59
- * @param {Object} opts.data - Request body
60
+ * @param {string} opts.id - Marital status id (24 hex characters)
61
+ * @param {Object} opts.data - Request body (MaritalStatusPutData: name, ord, lexiconKeys)
60
62
  * @param {Object} [opts.headers] - Optional headers
61
- * @returns {Promise<import("axios").AxiosResponse>}
63
+ * @returns {Promise<import("axios").AxiosResponse<{ maritalstatus: Object }>>}
64
+ * @throws 400 WRONG_DATA; 401; 404 MARITALSTATUS_NOT_FOUND; 409 CANNOT_UPDATE_LEXICON_ENTRIES; 500.
62
65
  */
63
66
  function update({token, jwtToken, id, data, query = {}, headers}) {
64
67
  return client({
@@ -75,9 +78,10 @@ function maritalStatusFactory({client, internalAuthTokenProvider}) {
75
78
  * @param {Object} opts
76
79
  * @param {string} [opts.token] - API key
77
80
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
78
- * @param {string} opts.id - Marital status id
81
+ * @param {string} opts.id - Marital status id (24 hex characters)
79
82
  * @param {Object} [opts.headers] - Optional headers
80
- * @returns {Promise<import("axios").AxiosResponse>}
83
+ * @returns {Promise<import("axios").AxiosResponse<{ maritalstatusId: string }>>}
84
+ * @throws 400 WRONG_DATA, INVALID_MARITALSTATUS_ID; 401; 404 MARITALSTATUS_NOT_FOUND; 500.
81
85
  */
82
86
  function remove({token, jwtToken, id, query = {}, headers}) {
83
87
  return client({
@@ -93,9 +97,10 @@ function maritalStatusFactory({client, internalAuthTokenProvider}) {
93
97
  * @param {Object} opts
94
98
  * @param {string} [opts.token] - API key
95
99
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
96
- * @param {Object} opts.data - Request body
100
+ * @param {Object} opts.data - Request body (MaritalStatusPostData: name, ord, lexiconKeys required)
97
101
  * @param {Object} [opts.headers] - Optional headers
98
- * @returns {Promise<import("axios").AxiosResponse>}
102
+ * @returns {Promise<import("axios").AxiosResponse<{ maritalstatus: Object }>>}
103
+ * @throws 400 WRONG_DATA (maritalstatus/name/ord/lexiconKeys required); 401; 409 CANNOT_CREATE_LEXICON_ENTRIES; 500.
99
104
  */
100
105
  function create({token, jwtToken, data, query = {}, headers}) {
101
106
  return client({
@@ -25,12 +25,13 @@ const {
25
25
  */
26
26
  function marketplaceModifierFactory({client, internalAuthTokenProvider}) {
27
27
  /**
28
- * GET /marketplace-modifiers - list marketplace modifiers.
28
+ * GET /marketplace-modifiers - list marketplace modifiers (paginated).
29
29
  * @param {Object} opts
30
30
  * @param {string} [opts.token] - API key
31
31
  * @param {MarketplaceModifiersListQuery} [opts.query] - Query params
32
32
  * @param {Object} [opts.headers] - Optional headers
33
- * @returns {Promise<import("axios").AxiosResponse>}
33
+ * @returns {Promise<import("axios").AxiosResponse<{ marketplaceModifiers: Object[], next?: string, previous?: string, count: number }>>}
34
+ * @throws 401; 500 MISSING_ACCOUNT.
34
35
  */
35
36
  function all({
36
37
  token,
@@ -46,10 +47,11 @@ function marketplaceModifierFactory({client, internalAuthTokenProvider}) {
46
47
  /**
47
48
  * GET /marketplace-modifiers/:marketplaceModifierId - get marketplace modifier by id. API does not accept query params.
48
49
  * @param {Object} opts
49
- * @param {string} opts.marketplaceModifierId - Marketplace modifier id
50
+ * @param {string} opts.marketplaceModifierId - Marketplace modifier id (24 hex characters)
50
51
  * @param {string} [opts.token] - API key
51
52
  * @param {Object} [opts.headers] - Optional headers
52
- * @returns {Promise<import("axios").AxiosResponse>}
53
+ * @returns {Promise<import("axios").AxiosResponse<{ marketplaceModifier: Object }>>}
54
+ * @throws 400 WRONG_DATA, INVALID_MARKETPLACEMODIFIER_ID; 401; 404 MARKETPLACE_MODIFIER_NOT_FOUND; 500.
53
55
  */
54
56
  function get({marketplaceModifierId, token, headers}) {
55
57
  return client.get(`/marketplace-modifiers/${marketplaceModifierId}`, {
@@ -62,9 +64,10 @@ function marketplaceModifierFactory({client, internalAuthTokenProvider}) {
62
64
  * @param {Object} opts
63
65
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
64
66
  * @param {string} [opts.token] - API key
65
- * @param {Object} opts.marketplaceModifier - Marketplace modifier payload
67
+ * @param {Object} opts.marketplaceModifier - Marketplace modifier payload (MarketplaceModifierPostData)
66
68
  * @param {Object} [opts.headers] - Optional headers
67
- * @returns {Promise<import("axios").AxiosResponse>}
69
+ * @returns {Promise<import("axios").AxiosResponse<{ marketplaceModifier: Object }>>}
70
+ * @throws 400 WRONG_DATA, *_NOT_FOUND, INVALID_*, MODIFIER_*, OANDDS_STATION_NOT_FOUND; 401; 404; 500.
68
71
  */
69
72
  function create({jwtToken, token, marketplaceModifier, headers}) {
70
73
  return client({
@@ -81,10 +84,11 @@ function marketplaceModifierFactory({client, internalAuthTokenProvider}) {
81
84
  * DELETE /marketplace-modifiers/:marketplaceModifierId - remove marketplace modifier. API does not accept query params.
82
85
  * @param {Object} opts
83
86
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
84
- * @param {string} opts.marketplaceModifierId - Marketplace modifier id
87
+ * @param {string} opts.marketplaceModifierId - Marketplace modifier id (24 hex characters)
85
88
  * @param {string} [opts.token] - API key
86
89
  * @param {Object} [opts.headers] - Optional headers
87
- * @returns {Promise<import("axios").AxiosResponse>}
90
+ * @returns {Promise<import("axios").AxiosResponse<{ marketplaceModifierId: string }>>}
91
+ * @throws 400 MARKETPLACE_MODIFIER_ID (invalid format); 401; 404 MARKETPLACE_MODIFIER_NOT_FOUND; 500.
88
92
  */
89
93
  function remove({jwtToken, marketplaceModifierId, token, headers}) {
90
94
  return client({
@@ -99,10 +103,11 @@ function marketplaceModifierFactory({client, internalAuthTokenProvider}) {
99
103
  * @param {Object} opts
100
104
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
101
105
  * @param {string} [opts.token] - API key
102
- * @param {string} opts.marketplaceModifierId - Marketplace modifier id
103
- * @param {Object} opts.marketplaceModifier - Marketplace modifier payload
106
+ * @param {string} opts.marketplaceModifierId - Marketplace modifier id (24 hex characters)
107
+ * @param {Object} opts.marketplaceModifier - Marketplace modifier payload (MarketplaceModifierPutData)
104
108
  * @param {Object} [opts.headers] - Optional headers
105
- * @returns {Promise<import("axios").AxiosResponse>}
109
+ * @returns {Promise<import("axios").AxiosResponse<{ marketplaceModifier: Object }>>}
110
+ * @throws 400 WRONG_DATA, INVALID_MARKETPLACEMODIFIER_ID, *_NOT_FOUND, INVALID_*, MODIFIER_*; 401; 404; 500.
106
111
  */
107
112
  function update({jwtToken, token, marketplaceModifierId, marketplaceModifier, headers}) {
108
113
  return client({
@@ -16,7 +16,8 @@ function mitTerminalFactory({client, internalAuthTokenProvider}) {
16
16
  * @param {string} [opts.token] - API key
17
17
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
18
18
  * @param {Object} [opts.headers] - Optional headers
19
- * @returns {Promise<import("axios").AxiosResponse>}
19
+ * @returns {Promise<import("axios").AxiosResponse<{ mitTerminalsSettings: Object[], next?: string, previous?: string, count: number }>>}
20
+ * @throws When the request fails (e.g. 401 Unauthorized, 500 Internal Server Error)
20
21
  */
21
22
  function all({
22
23
  token,
@@ -35,9 +36,10 @@ function mitTerminalFactory({client, internalAuthTokenProvider}) {
35
36
  * @param {Object} opts
36
37
  * @param {string} [opts.token] - API key
37
38
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
38
- * @param {string} opts.id - MIT terminal setting id
39
+ * @param {string} opts.id - MIT terminal setting id (24-char hex ObjectId)
39
40
  * @param {Object} [opts.headers] - Optional headers
40
- * @returns {Promise<import("axios").AxiosResponse>}
41
+ * @returns {Promise<import("axios").AxiosResponse<{ mitTerminalSettings: Object }>>}
42
+ * @throws When the request fails (e.g. 400 INVALID_ID, 401 Unauthorized, 404 MITTERMINALSETTING_NOT_FOUND, 500 Internal Server Error)
41
43
  */
42
44
  function get({id, token, jwtToken, headers}) {
43
45
  return client.get(`/mit-terminals-settings/${id}`, {
@@ -50,9 +52,10 @@ function mitTerminalFactory({client, internalAuthTokenProvider}) {
50
52
  * @param {Object} opts
51
53
  * @param {string} [opts.token] - API key
52
54
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
53
- * @param {Object} opts.mitTerminalSettings - MIT terminal settings payload
55
+ * @param {Object} opts.mitTerminalSettings - MIT terminal settings payload (name, operatingCompanyId, shiftLocationId, user, password)
54
56
  * @param {Object} [opts.headers] - Optional headers
55
- * @returns {Promise<import("axios").AxiosResponse>}
57
+ * @returns {Promise<import("axios").AxiosResponse<{ mitTerminalSettings: Object }>>}
58
+ * @throws When the request fails (e.g. 400 WRONG_DATA, 401 Unauthorized, 500 Internal Server Error)
56
59
  */
57
60
  function create({jwtToken, token, mitTerminalSettings, headers}) {
58
61
  return client({
@@ -70,9 +73,10 @@ function mitTerminalFactory({client, internalAuthTokenProvider}) {
70
73
  * @param {Object} opts
71
74
  * @param {string} [opts.token] - API key
72
75
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
73
- * @param {string} opts.id - MIT terminal setting id
76
+ * @param {string} opts.id - MIT terminal setting id (24-char hex ObjectId)
74
77
  * @param {Object} [opts.headers] - Optional headers
75
- * @returns {Promise<import("axios").AxiosResponse>}
78
+ * @returns {Promise<import("axios").AxiosResponse<{ mitterminalsettingId: string }>>}
79
+ * @throws When the request fails (e.g. 400 INVALID_ID, 401 Unauthorized, 404 MITTERMINALSETTING_NOT_FOUND, 500 Internal Server Error)
76
80
  */
77
81
  function remove({jwtToken, id, token, headers}) {
78
82
  return client({
@@ -87,10 +91,11 @@ function mitTerminalFactory({client, internalAuthTokenProvider}) {
87
91
  * @param {Object} opts
88
92
  * @param {string} [opts.token] - API key
89
93
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
90
- * @param {string} opts.id - MIT terminal setting id
91
- * @param {Object} opts.mitTerminalSettings - MIT terminal settings payload
94
+ * @param {string} opts.id - MIT terminal setting id (24-char hex ObjectId)
95
+ * @param {Object} opts.mitTerminalSettings - MIT terminal settings payload (name, operatingCompanyId, shiftLocationId, user, password)
92
96
  * @param {Object} [opts.headers] - Optional headers
93
- * @returns {Promise<import("axios").AxiosResponse>}
97
+ * @returns {Promise<import("axios").AxiosResponse<{ mitTerminalSettings: Object }>>}
98
+ * @throws When the request fails (e.g. 400 WRONG_DATA/INVALID_ID, 401, 404 MITTERMINALSETTING_NOT_FOUND, 500)
94
99
  */
95
100
  function update({jwtToken, token, id, mitTerminalSettings, headers}) {
96
101
  return client({
@@ -11,12 +11,13 @@ const {
11
11
  */
12
12
  function mitTerminalFactory({client, internalAuthTokenProvider}) {
13
13
  /**
14
- * GET /mit-terminals - list MIT terminals. API does not accept query params.
14
+ * GET /mit-terminals - list MIT terminals (paginated). API does not accept query params.
15
15
  * @param {Object} opts
16
16
  * @param {string} [opts.token] - API key
17
17
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
18
18
  * @param {Object} [opts.headers] - Optional headers
19
- * @returns {Promise<import("axios").AxiosResponse>}
19
+ * @returns {Promise<import("axios").AxiosResponse<{ mitTerminals: Object[], next?: string, previous?: string, count: number }>>}
20
+ * @throws 401; 500.
20
21
  */
21
22
  function all({
22
23
  token,
@@ -34,9 +35,10 @@ function mitTerminalFactory({client, internalAuthTokenProvider}) {
34
35
  * @param {Object} opts
35
36
  * @param {string} [opts.token] - API key
36
37
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
37
- * @param {string} opts.mitTerminalId - MIT terminal id
38
+ * @param {string} opts.mitTerminalId - MIT terminal id (24 hex characters)
38
39
  * @param {Object} [opts.headers] - Optional headers
39
- * @returns {Promise<import("axios").AxiosResponse>}
40
+ * @returns {Promise<import("axios").AxiosResponse<{ mitTerminal: Object }>>}
41
+ * @throws 400 INVALID_MIT_TERMINAL_ID; 401; 404 MIT_TERMINAL_NOT_FOUND; 500.
40
42
  */
41
43
  function get({mitTerminalId, token, headers}) {
42
44
  return client.get(`/mit-terminals/${mitTerminalId}`, {
@@ -49,9 +51,10 @@ function mitTerminalFactory({client, internalAuthTokenProvider}) {
49
51
  * @param {Object} opts
50
52
  * @param {string} [opts.token] - API key
51
53
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
52
- * @param {Object} opts.mitTerminal - MIT terminal payload
54
+ * @param {Object} opts.mitTerminal - MIT terminal payload (name, serialNumber required; user, password per API)
53
55
  * @param {Object} [opts.headers] - Optional headers
54
- * @returns {Promise<import("axios").AxiosResponse>}
56
+ * @returns {Promise<import("axios").AxiosResponse<{ mitTerminal: Object }>>}
57
+ * @throws 400 WRONG_DATA (mitTerminal, name, serialNumber, user, password); 401; 404 MIT_TERMINAL_NOT_FOUND; 500.
55
58
  */
56
59
  function create({jwtToken, token, mitTerminal, headers}) {
57
60
  return client({
@@ -69,9 +72,10 @@ function mitTerminalFactory({client, internalAuthTokenProvider}) {
69
72
  * @param {Object} opts
70
73
  * @param {string} [opts.token] - API key
71
74
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
72
- * @param {string} opts.mitTerminalId - MIT terminal id
75
+ * @param {string} opts.mitTerminalId - MIT terminal id (24 hex characters)
73
76
  * @param {Object} [opts.headers] - Optional headers
74
- * @returns {Promise<import("axios").AxiosResponse>}
77
+ * @returns {Promise<import("axios").AxiosResponse<{ mitTerminalId: string }>>}
78
+ * @throws 400 INVALID_MIT_TERMINAL_ID; 401; 404 MIT_TERMINAL_NOT_FOUND; 500.
75
79
  */
76
80
  function remove({jwtToken, mitTerminalId, token, headers}) {
77
81
  return client({
@@ -86,10 +90,11 @@ function mitTerminalFactory({client, internalAuthTokenProvider}) {
86
90
  * @param {Object} opts
87
91
  * @param {string} [opts.token] - API key
88
92
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
89
- * @param {string} opts.mitTerminalId - MIT terminal id
90
- * @param {Object} opts.mitTerminal - MIT terminal payload
93
+ * @param {string} opts.mitTerminalId - MIT terminal id (24 hex characters)
94
+ * @param {Object} opts.mitTerminal - MIT terminal payload (MitTerminalPost)
91
95
  * @param {Object} [opts.headers] - Optional headers
92
- * @returns {Promise<import("axios").AxiosResponse>}
96
+ * @returns {Promise<import("axios").AxiosResponse<{ mitTerminal: Object }>>}
97
+ * @throws 400 WRONG_DATA; 401; 404 MIT_TERMINAL_NOT_FOUND; 500.
93
98
  */
94
99
  function update({jwtToken, token, mitTerminalId, mitTerminal, headers}) {
95
100
  return client({
@@ -28,7 +28,8 @@ function operationMessagesFactory({client, internalAuthTokenProvider}) {
28
28
  * @param {string} [opts.token] - API key
29
29
  * @param {OperationMessagesListQuery} [opts.query] - Query params
30
30
  * @param {Object} [opts.headers] - Optional headers
31
- * @returns {Promise<import("axios").AxiosResponse>}
31
+ * @returns {Promise<import("axios").AxiosResponse<{ operationMessages: Object[], count?: number, next?: string, previous?: string }>>}
32
+ * @throws When the request fails (e.g. 401 Unauthorized, 500 Internal Server Error)
32
33
  */
33
34
  function all({token, query = {}, headers}) {
34
35
  return client({
@@ -44,9 +45,10 @@ function operationMessagesFactory({client, internalAuthTokenProvider}) {
44
45
  * @param {Object} opts
45
46
  * @param {string} [opts.token] - API key
46
47
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
47
- * @param {Object} opts.opMsgData - Operation message payload
48
+ * @param {Object} opts.opMsgData - Operation message payload (message, name, type, effectiveDateTimeStart/End, etc.)
48
49
  * @param {Object} [opts.headers] - Optional headers
49
- * @returns {Promise<import("axios").AxiosResponse>}
50
+ * @returns {Promise<import("axios").AxiosResponse<Object>>} Created OperationMessage
51
+ * @throws When the request fails (400, 401, 409 duplicate key, 500)
50
52
  */
51
53
  function create({token, jwtToken, opMsgData, headers}) {
52
54
  return client({
@@ -62,10 +64,11 @@ function operationMessagesFactory({client, internalAuthTokenProvider}) {
62
64
  * @param {Object} opts
63
65
  * @param {string} [opts.token] - API key
64
66
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
65
- * @param {string} opts.operationMessageId - Operation message id
66
- * @param {Object} opts.opMsgData - Operation message payload
67
+ * @param {string} opts.operationMessageId - Operation message id (24-char hex ObjectId)
68
+ * @param {Object} opts.opMsgData - Operation message payload (message, name, type, etc.)
67
69
  * @param {Object} [opts.headers] - Optional headers
68
- * @returns {Promise<import("axios").AxiosResponse>}
70
+ * @returns {Promise<import("axios").AxiosResponse<Object>>} Updated OperationMessage
71
+ * @throws When the request fails (400, 401, 404 NOT_FOUND, 500)
69
72
  */
70
73
  function update({token, jwtToken, operationMessageId, opMsgData, headers}) {
71
74
  return client({
@@ -80,9 +83,10 @@ function operationMessagesFactory({client, internalAuthTokenProvider}) {
80
83
  * GET /operation-messages/:operationMessageId - get operation message by id. API does not accept query params.
81
84
  * @param {Object} opts
82
85
  * @param {string} [opts.token] - API key
83
- * @param {string} opts.operationMessageId - Operation message id
86
+ * @param {string} opts.operationMessageId - Operation message id (24-char hex ObjectId)
84
87
  * @param {Object} [opts.headers] - Optional headers
85
- * @returns {Promise<import("axios").AxiosResponse>}
88
+ * @returns {Promise<import("axios").AxiosResponse<Object>>} Response body is the OperationMessage
89
+ * @throws When the request fails (e.g. 401 Unauthorized, 404 NOT_FOUND, 500 Internal Server Error)
86
90
  */
87
91
  function get({token, operationMessageId, headers}) {
88
92
  return client({
@@ -96,10 +100,11 @@ function operationMessagesFactory({client, internalAuthTokenProvider}) {
96
100
  * DELETE /operation-messages/:operationMessageId - remove operation message. API does not accept query params.
97
101
  * @param {Object} opts
98
102
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
99
- * @param {string} opts.operationMessageId - Operation message id
103
+ * @param {string} opts.operationMessageId - Operation message id (24-char hex ObjectId)
100
104
  * @param {string} [opts.token] - API key
101
105
  * @param {Object} [opts.headers] - Optional headers
102
- * @returns {Promise<import("axios").AxiosResponse>}
106
+ * @returns {Promise<import("axios").AxiosResponse<void>>} 204 No Content on success
107
+ * @throws When the request fails (e.g. 401 Unauthorized, 404 NOT_FOUND, 500 Internal Server Error)
103
108
  */
104
109
  function remove({jwtToken, operationMessageId, token, headers}) {
105
110
  return client({
@@ -114,9 +119,10 @@ function operationMessagesFactory({client, internalAuthTokenProvider}) {
114
119
  * @param {Object} opts
115
120
  * @param {string} [opts.token] - API key
116
121
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
117
- * @param {Object} opts.opMsgData - Request body (station criteria)
122
+ * @param {Object} opts.opMsgData - Request body (OperationMessagesStationsQuery: station criteria and dates)
118
123
  * @param {Object} [opts.headers] - Optional headers
119
- * @returns {Promise<import("axios").AxiosResponse>}
124
+ * @returns {Promise<import("axios").AxiosResponse<Object>>} Response body matches OperationMessagesStations schema
125
+ * @throws When the request fails (e.g. 400 INVALID_DATE_RANGE/INVALID_STATION, 401, 500)
120
126
  */
121
127
  function getByStation({token, jwtToken, opMsgData, headers}) {
122
128
  return client({
@@ -21,7 +21,8 @@ function operationReasonFactory({client, internalAuthTokenProvider}) {
21
21
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
22
22
  * @param {OperationReasonsListQuery} [opts.query] - Query params (page)
23
23
  * @param {Object} [opts.headers] - Optional headers
24
- * @returns {Promise<import("axios").AxiosResponse>}
24
+ * @returns {Promise<import("axios").AxiosResponse<{ operationReasons: Object[], next?: string, previous?: string, count: number }>>}
25
+ * @throws When the request fails (e.g. 400 INVALID_PAGE, 401 Unauthorized, 500)
25
26
  */
26
27
  function all({token, jwtToken, query = {}, headers}) {
27
28
  return client({
@@ -37,9 +38,10 @@ function operationReasonFactory({client, internalAuthTokenProvider}) {
37
38
  * @param {Object} opts
38
39
  * @param {string} [opts.token] - API key
39
40
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
40
- * @param {string} opts.id - Operation reason id
41
+ * @param {string} opts.id - Operation reason id (24-char hex ObjectId)
41
42
  * @param {Object} [opts.headers] - Optional headers
42
- * @returns {Promise<import("axios").AxiosResponse>}
43
+ * @returns {Promise<import("axios").AxiosResponse<{ operationReason: Object }>>}
44
+ * @throws When the request fails (400 INVALID_OPERATION_REASON_ID, 401, 404 OPERATION_REASON_NOT_FOUND, 500)
43
45
  */
44
46
  function get({token, jwtToken, id, query = {}, headers}) {
45
47
  return client({
@@ -55,10 +57,11 @@ function operationReasonFactory({client, internalAuthTokenProvider}) {
55
57
  * @param {Object} opts
56
58
  * @param {string} [opts.token] - API key
57
59
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
58
- * @param {string} opts.id - Operation reason id
59
- * @param {Object} opts.operationReason - Operation reason payload
60
+ * @param {string} opts.id - Operation reason id (24-char hex ObjectId)
61
+ * @param {Object} opts.operationReason - Operation reason payload (name, type, lexiconKeys, etc.)
60
62
  * @param {Object} [opts.headers] - Optional headers
61
- * @returns {Promise<import("axios").AxiosResponse>}
63
+ * @returns {Promise<import("axios").AxiosResponse<{ operationReason: Object }>>}
64
+ * @throws When the request fails (400 WRONG_DATA/INVALID_OPERATION_REASON_ID, 401, 404, 500)
62
65
  */
63
66
  function update({token, jwtToken, id, operationReason, query = {}, headers}) {
64
67
  return client({
@@ -75,9 +78,10 @@ function operationReasonFactory({client, internalAuthTokenProvider}) {
75
78
  * @param {Object} opts
76
79
  * @param {string} [opts.token] - API key
77
80
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
78
- * @param {string} opts.id - Operation reason id
81
+ * @param {string} opts.id - Operation reason id (24-char hex ObjectId)
79
82
  * @param {Object} [opts.headers] - Optional headers
80
- * @returns {Promise<import("axios").AxiosResponse>}
83
+ * @returns {Promise<import("axios").AxiosResponse<{ _id: string }>>}
84
+ * @throws When the request fails (400 INVALID_OPERATION_REASON_ID, 401, 404 OPERATION_REASON_NOT_FOUND, 500)
81
85
  */
82
86
  function remove({token, jwtToken, id, query = {}, headers}) {
83
87
  return client({
@@ -93,9 +97,10 @@ function operationReasonFactory({client, internalAuthTokenProvider}) {
93
97
  * @param {Object} opts
94
98
  * @param {string} [opts.token] - API key
95
99
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
96
- * @param {Object} opts.operationReason - Operation reason payload
100
+ * @param {Object} opts.operationReason - Operation reason payload (name, type, lexiconKeys required)
97
101
  * @param {Object} [opts.headers] - Optional headers
98
- * @returns {Promise<import("axios").AxiosResponse>}
102
+ * @returns {Promise<import("axios").AxiosResponse<{ operationReason: Object }>>}
103
+ * @throws When the request fails (400 WRONG_DATA, 401, 409 CANNOT_CREATE_LEXICON_ENTRIES, 500)
99
104
  */
100
105
  function create({token, jwtToken, operationReason, query = {}, headers}) {
101
106
  return client({
@@ -20,14 +20,15 @@ const {authorizationHeaders} = require("../endpoints_helpers.js");
20
20
  */
21
21
  function payOnAccountsFactory({client, internalAuthTokenProvider}) {
22
22
  /**
23
- * GET /pay-on-accounts - list pay-on accounts.
23
+ * GET /pay-on-accounts - list pay-on accounts. When format=csv returns CSV (text/csv); otherwise JSON with pagination.
24
24
  * @param {Object} opts
25
25
  * @param {string} [opts.token] - API key
26
26
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
27
- * @param {PayOnAccountsListQuery} [opts.query] - Query params
28
- * @param {string} [opts.responseType] - Response type (e.g. json)
27
+ * @param {PayOnAccountsListQuery} [opts.query] - Query params (page, format, disabled, term, fareIds, providerId)
28
+ * @param {string} [opts.responseType] - Response type (e.g. json); use for CSV when format=csv
29
29
  * @param {Object} [opts.headers] - Optional headers
30
- * @returns {Promise<import("axios").AxiosResponse>}
30
+ * @returns {Promise<import("axios").AxiosResponse<{ payOnAccounts: Object[], next?: string, previous?: string, count: number }|string>>}
31
+ * @throws When the request fails (400 INVALID_PAGE/INVALID_FARE_IDS/INVALID_PROVIDER_ID/INVALID_SEARCH_TERM, 401, 500)
31
32
  */
32
33
  function all({token, jwtToken, query = {}, responseType = "json", headers}) {
33
34
  return client.get("/pay-on-accounts", {
@@ -15,7 +15,8 @@ function paymentTerminalFactory({client, internalAuthTokenProvider}) {
15
15
  * @param {Object} opts
16
16
  * @param {string} [opts.token] - API key
17
17
  * @param {Object} [opts.headers] - Optional headers
18
- * @returns {Promise<import("axios").AxiosResponse>}
18
+ * @returns {Promise<import("axios").AxiosResponse<{ paymentTerminals: Object[], next?: string, previous?: string, count: number }>>}
19
+ * @throws When the request fails (401 Unauthorized, 500 Internal Server Error)
19
20
  */
20
21
  function all({
21
22
  token,
@@ -31,10 +32,11 @@ function paymentTerminalFactory({client, internalAuthTokenProvider}) {
31
32
  /**
32
33
  * GET /payment-terminals/:paymentTerminalId - get payment terminal by id. API does not accept query params.
33
34
  * @param {Object} opts
34
- * @param {string} opts.paymentTerminalId - Payment terminal id
35
+ * @param {string} opts.paymentTerminalId - Payment terminal id (24-char hex ObjectId)
35
36
  * @param {string} [opts.token] - API key
36
37
  * @param {Object} [opts.headers] - Optional headers
37
- * @returns {Promise<import("axios").AxiosResponse>}
38
+ * @returns {Promise<import("axios").AxiosResponse<{ paymentTerminal: Object }>>}
39
+ * @throws When the request fails (400 INVALID_PAYMENT_TERMINAL_ID, 401, 404 PAYMENT_TERMINAL_NOT_FOUND, 500)
38
40
  */
39
41
  function get({paymentTerminalId, token, headers}) {
40
42
  return client.get(`/payment-terminals/${paymentTerminalId}`, {
@@ -47,9 +49,10 @@ function paymentTerminalFactory({client, internalAuthTokenProvider}) {
47
49
  * @param {Object} opts
48
50
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
49
51
  * @param {string} [opts.token] - API key
50
- * @param {Object} opts.paymentTerminal - Payment terminal payload
52
+ * @param {Object} opts.paymentTerminal - Payment terminal payload (name, protocol, ip, locationId, partNumber, serialNumber)
51
53
  * @param {Object} [opts.headers] - Optional headers
52
- * @returns {Promise<import("axios").AxiosResponse>}
54
+ * @returns {Promise<import("axios").AxiosResponse<{ paymentTerminal: Object }>>}
55
+ * @throws When the request fails (400 WRONG_DATA, 401, 500)
53
56
  */
54
57
  function create({jwtToken, token, paymentTerminal, headers}) {
55
58
  return client({
@@ -66,10 +69,11 @@ function paymentTerminalFactory({client, internalAuthTokenProvider}) {
66
69
  * DELETE /payment-terminals/:paymentTerminalId - remove payment terminal. API does not accept query params.
67
70
  * @param {Object} opts
68
71
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
69
- * @param {string} opts.paymentTerminalId - Payment terminal id
72
+ * @param {string} opts.paymentTerminalId - Payment terminal id (24-char hex ObjectId)
70
73
  * @param {string} [opts.token] - API key
71
74
  * @param {Object} [opts.headers] - Optional headers
72
- * @returns {Promise<import("axios").AxiosResponse>}
75
+ * @returns {Promise<import("axios").AxiosResponse<{ paymentTerminalId: string }>>}
76
+ * @throws When the request fails (400 INVALID_PAYMENT_TERMINAL_ID, 401, 404 PAYMENT_TERMINAL_NOT_FOUND, 500)
73
77
  */
74
78
  function remove({jwtToken, paymentTerminalId, token, headers}) {
75
79
  return client({
@@ -84,10 +88,11 @@ function paymentTerminalFactory({client, internalAuthTokenProvider}) {
84
88
  * @param {Object} opts
85
89
  * @param {string} [opts.jwtToken] - JWT or internal auth symbol
86
90
  * @param {string} [opts.token] - API key
87
- * @param {string} opts.paymentTerminalId - Payment terminal id
88
- * @param {Object} opts.paymentTerminal - Payment terminal payload
91
+ * @param {string} opts.paymentTerminalId - Payment terminal id (24-char hex ObjectId)
92
+ * @param {Object} opts.paymentTerminal - Payment terminal payload (name, protocol, ip, locationId, partNumber, serialNumber)
89
93
  * @param {Object} [opts.headers] - Optional headers
90
- * @returns {Promise<import("axios").AxiosResponse>}
94
+ * @returns {Promise<import("axios").AxiosResponse<{ paymentTerminal: Object }>>}
95
+ * @throws When the request fails (400 WRONG_DATA, 401, 404 PAYMENT_TERMINAL_NOT_FOUND, 500)
91
96
  */
92
97
  function update({jwtToken, token, paymentTerminalId, paymentTerminal, headers}) {
93
98
  return client({