@shipengine/connect-carrier-api 2.1.18 → 2.1.22

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 (205) hide show
  1. package/lib/app/carrier-app-definition.d.ts +12 -2
  2. package/lib/app/carrier-app.js +79 -53
  3. package/lib/app/carrier-app.js.map +1 -1
  4. package/lib/app/constants.d.ts +14 -0
  5. package/lib/app/constants.js +19 -0
  6. package/lib/app/constants.js.map +1 -0
  7. package/lib/app/internal/route.d.ts +1 -0
  8. package/lib/models/authorization.d.ts +4 -0
  9. package/lib/models/authorization.js +7 -0
  10. package/lib/models/authorization.js.map +1 -0
  11. package/lib/models/billing/billing-categories.d.ts +2 -0
  12. package/lib/models/billing/billing-categories.js +4 -1
  13. package/lib/models/billing/billing-categories.js.map +1 -1
  14. package/lib/models/billing/billing-line-item.d.ts +2 -0
  15. package/lib/models/billing/billing-line-item.js +12 -1
  16. package/lib/models/billing/billing-line-item.js.map +1 -1
  17. package/lib/models/currency.d.ts +2 -0
  18. package/lib/models/currency.js +7 -1
  19. package/lib/models/currency.js.map +1 -1
  20. package/lib/models/documents/document-type.d.ts +2 -0
  21. package/lib/models/documents/document-type.js +4 -1
  22. package/lib/models/documents/document-type.js.map +1 -1
  23. package/lib/models/documents/document.d.ts +2 -0
  24. package/lib/models/documents/document.js +10 -1
  25. package/lib/models/documents/document.js.map +1 -1
  26. package/lib/models/identifier.d.ts +2 -0
  27. package/lib/models/identifier.js +7 -1
  28. package/lib/models/identifier.js.map +1 -1
  29. package/lib/models/inbound-content-types.d.ts +7 -0
  30. package/lib/models/inbound-content-types.js +13 -0
  31. package/lib/models/inbound-content-types.js.map +1 -0
  32. package/lib/models/index.d.ts +2 -0
  33. package/lib/models/index.js +2 -0
  34. package/lib/models/index.js.map +1 -1
  35. package/lib/models/labels/document-formats.d.ts +2 -0
  36. package/lib/models/labels/document-formats.js +4 -1
  37. package/lib/models/labels/document-formats.js.map +1 -1
  38. package/lib/models/labels/form-download.d.ts +2 -0
  39. package/lib/models/labels/form-download.js +6 -1
  40. package/lib/models/labels/form-download.js.map +1 -1
  41. package/lib/models/labels/label-download.d.ts +2 -0
  42. package/lib/models/labels/label-download.js +6 -1
  43. package/lib/models/labels/label-download.js.map +1 -1
  44. package/lib/models/labels/label-package.d.ts +2 -0
  45. package/lib/models/labels/label-package.js +10 -1
  46. package/lib/models/labels/label-package.js.map +1 -1
  47. package/lib/models/labels/void-response.d.ts +5 -0
  48. package/lib/models/labels/void-response.js +10 -1
  49. package/lib/models/labels/void-response.js.map +1 -1
  50. package/lib/models/manifests/manifest.d.ts +2 -0
  51. package/lib/models/manifests/manifest.js +10 -1
  52. package/lib/models/manifests/manifest.js.map +1 -1
  53. package/lib/models/pickup/pickup-confirmation.d.ts +2 -0
  54. package/lib/models/pickup/pickup-confirmation.js +10 -1
  55. package/lib/models/pickup/pickup-confirmation.js.map +1 -1
  56. package/lib/models/pickup/pickup-window.d.ts +2 -0
  57. package/lib/models/pickup/pickup-window.js +9 -1
  58. package/lib/models/pickup/pickup-window.js.map +1 -1
  59. package/lib/models/pickup/shipment-identifier.d.ts +2 -0
  60. package/lib/models/pickup/shipment-identifier.js +8 -1
  61. package/lib/models/pickup/shipment-identifier.js.map +1 -1
  62. package/lib/models/rates/rate.d.ts +2 -0
  63. package/lib/models/rates/rate.js +18 -1
  64. package/lib/models/rates/rate.js.map +1 -1
  65. package/lib/models/registration/credentials.d.ts +2 -0
  66. package/lib/models/registration/credentials.js +7 -1
  67. package/lib/models/registration/credentials.js.map +1 -1
  68. package/lib/models/resource-download.d.ts +2 -0
  69. package/lib/models/resource-download.js +7 -1
  70. package/lib/models/resource-download.js.map +1 -1
  71. package/lib/models/time-window.d.ts +2 -0
  72. package/lib/models/time-window.js +8 -1
  73. package/lib/models/time-window.js.map +1 -1
  74. package/lib/models/tracking/index.d.ts +1 -0
  75. package/lib/models/tracking/index.js +1 -0
  76. package/lib/models/tracking/index.js.map +1 -1
  77. package/lib/models/tracking/lat-long.d.ts +2 -0
  78. package/lib/models/tracking/lat-long.js +7 -1
  79. package/lib/models/tracking/lat-long.js.map +1 -1
  80. package/lib/models/tracking/service.d.ts +2 -0
  81. package/lib/models/tracking/service.js +7 -1
  82. package/lib/models/tracking/service.js.map +1 -1
  83. package/lib/models/tracking/standardized-status-codes.d.ts +2 -0
  84. package/lib/models/tracking/standardized-status-codes.js +4 -1
  85. package/lib/models/tracking/standardized-status-codes.js.map +1 -1
  86. package/lib/models/tracking/track-event.d.ts +2 -0
  87. package/lib/models/tracking/track-event.js +18 -1
  88. package/lib/models/tracking/track-event.js.map +1 -1
  89. package/lib/models/tracking/tracking-info.d.ts +2 -0
  90. package/lib/models/tracking/tracking-info.js +27 -1
  91. package/lib/models/tracking/tracking-info.js.map +1 -1
  92. package/lib/models/tracking/update-method.d.ts +9 -0
  93. package/lib/models/tracking/update-method.js +15 -0
  94. package/lib/models/tracking/update-method.js.map +1 -0
  95. package/lib/models/units/dimensions.d.ts +2 -0
  96. package/lib/models/units/dimensions.js +8 -1
  97. package/lib/models/units/dimensions.js.map +1 -1
  98. package/lib/requests/base-request.d.ts +2 -0
  99. package/lib/requests/base-request.js.map +1 -1
  100. package/lib/requests/index.d.ts +2 -0
  101. package/lib/requests/index.js +2 -0
  102. package/lib/requests/index.js.map +1 -1
  103. package/lib/requests/normalize-tracking-data-request.d.ts +8 -0
  104. package/lib/requests/normalize-tracking-data-request.js +3 -0
  105. package/lib/requests/normalize-tracking-data-request.js.map +1 -0
  106. package/lib/requests/validate-inbound-data-request.d.ts +8 -0
  107. package/lib/requests/validate-inbound-data-request.js +3 -0
  108. package/lib/requests/validate-inbound-data-request.js.map +1 -0
  109. package/lib/responses/base-response.d.ts +2 -0
  110. package/lib/responses/base-response.js +6 -1
  111. package/lib/responses/base-response.js.map +1 -1
  112. package/lib/responses/cancel-notification-response.d.ts +2 -0
  113. package/lib/responses/cancel-notification-response.js +7 -1
  114. package/lib/responses/cancel-notification-response.js.map +1 -1
  115. package/lib/responses/cancel-pickup-response.d.ts +2 -0
  116. package/lib/responses/cancel-pickup-response.js +9 -1
  117. package/lib/responses/cancel-pickup-response.js.map +1 -1
  118. package/lib/responses/create-label-response.d.ts +2 -0
  119. package/lib/responses/create-label-response.js +19 -1
  120. package/lib/responses/create-label-response.js.map +1 -1
  121. package/lib/responses/create-manifest-response.d.ts +2 -0
  122. package/lib/responses/create-manifest-response.js +8 -1
  123. package/lib/responses/create-manifest-response.js.map +1 -1
  124. package/lib/responses/create-notification-response.d.ts +2 -0
  125. package/lib/responses/create-notification-response.js +6 -1
  126. package/lib/responses/create-notification-response.js.map +1 -1
  127. package/lib/responses/get-rates-response.d.ts +2 -0
  128. package/lib/responses/get-rates-response.js +7 -1
  129. package/lib/responses/get-rates-response.js.map +1 -1
  130. package/lib/responses/index.d.ts +2 -0
  131. package/lib/responses/index.js +2 -0
  132. package/lib/responses/index.js.map +1 -1
  133. package/lib/responses/normalize-tracking-data-response.d.ts +14 -0
  134. package/lib/responses/normalize-tracking-data-response.js +16 -0
  135. package/lib/responses/normalize-tracking-data-response.js.map +1 -0
  136. package/lib/responses/register-response.d.ts +2 -0
  137. package/lib/responses/register-response.js +8 -1
  138. package/lib/responses/register-response.js.map +1 -1
  139. package/lib/responses/schedule-pickup-response.d.ts +2 -0
  140. package/lib/responses/schedule-pickup-response.js +11 -1
  141. package/lib/responses/schedule-pickup-response.js.map +1 -1
  142. package/lib/responses/tracking-response.d.ts +1 -0
  143. package/lib/responses/tracking-response.js +5 -1
  144. package/lib/responses/tracking-response.js.map +1 -1
  145. package/lib/responses/validate-inbound-data-response.d.ts +9 -0
  146. package/lib/responses/validate-inbound-data-response.js +15 -0
  147. package/lib/responses/validate-inbound-data-response.js.map +1 -0
  148. package/lib/responses/void-labels-response.d.ts +2 -0
  149. package/lib/responses/void-labels-response.js +7 -1
  150. package/lib/responses/void-labels-response.js.map +1 -1
  151. package/package.json +2 -2
  152. package/spec.json +31 -1
  153. package/src/app/carrier-app-definition.ts +18 -0
  154. package/src/app/carrier-app.ts +107 -55
  155. package/src/app/constants.ts +14 -0
  156. package/src/app/internal/route.ts +1 -0
  157. package/src/models/authorization.ts +4 -0
  158. package/src/models/billing/billing-categories.ts +6 -0
  159. package/src/models/billing/billing-line-item.ts +14 -2
  160. package/src/models/currency.ts +7 -0
  161. package/src/models/documents/document-type.ts +6 -0
  162. package/src/models/documents/document.ts +11 -2
  163. package/src/models/identifier.ts +7 -0
  164. package/src/models/inbound-content-types.ts +10 -0
  165. package/src/models/index.ts +2 -0
  166. package/src/models/labels/document-formats.ts +5 -0
  167. package/src/models/labels/form-download.ts +6 -1
  168. package/src/models/labels/label-download.ts +6 -1
  169. package/src/models/labels/label-package.ts +9 -2
  170. package/src/models/labels/void-response.ts +11 -0
  171. package/src/models/manifests/manifest.ts +9 -1
  172. package/src/models/pickup/pickup-confirmation.ts +11 -2
  173. package/src/models/pickup/pickup-window.ts +8 -0
  174. package/src/models/pickup/shipment-identifier.ts +7 -1
  175. package/src/models/rates/rate.ts +20 -2
  176. package/src/models/registration/credentials.ts +7 -0
  177. package/src/models/resource-download.ts +7 -0
  178. package/src/models/time-window.ts +8 -0
  179. package/src/models/tracking/index.ts +1 -0
  180. package/src/models/tracking/lat-long.ts +7 -0
  181. package/src/models/tracking/service.ts +6 -0
  182. package/src/models/tracking/standardized-status-codes.ts +6 -0
  183. package/src/models/tracking/track-event.ts +16 -0
  184. package/src/models/tracking/tracking-info.ts +29 -4
  185. package/src/models/tracking/update-method.ts +13 -0
  186. package/src/models/units/dimensions.ts +7 -0
  187. package/src/requests/base-request.ts +3 -0
  188. package/src/requests/index.ts +2 -0
  189. package/src/requests/normalize-tracking-data-request.ts +9 -0
  190. package/src/requests/validate-inbound-data-request.ts +9 -0
  191. package/src/responses/base-response.ts +6 -0
  192. package/src/responses/cancel-notification-response.ts +7 -1
  193. package/src/responses/cancel-pickup-response.ts +9 -1
  194. package/src/responses/create-label-response.ts +25 -1
  195. package/src/responses/create-manifest-response.ts +8 -2
  196. package/src/responses/create-notification-response.ts +6 -1
  197. package/src/responses/get-rates-response.ts +7 -2
  198. package/src/responses/index.ts +2 -0
  199. package/src/responses/normalize-tracking-data-response.ts +24 -0
  200. package/src/responses/register-response.ts +6 -1
  201. package/src/responses/schedule-pickup-response.ts +18 -2
  202. package/src/responses/tracking-response.ts +6 -2
  203. package/src/responses/validate-inbound-data-response.ts +16 -0
  204. package/src/responses/void-labels-response.ts +7 -2
  205. package/tsconfig.tsbuildinfo +1 -1
@@ -1,5 +1,5 @@
1
- import { RegisterRequest, CreateLabelRequest, VoidLabelsRequest, CreateManifestRequest, SchedulePickupRequest, CancelPickupRequest, GetRatesRequest, TrackingRequest, CancelNotificationRequest, CreateNotificationRequest } from '../requests';
2
- import { RegisterResponse, CreateLabelResponse, VoidLabelsResponse, CreateManifestResponse, SchedulePickupResponse, CancelPickupResponse, GetRatesResponse, TrackingResponse, CancelNotificationResponse, CreateNotificationResponse } from '../responses';
1
+ import { RegisterRequest, CreateLabelRequest, VoidLabelsRequest, CreateManifestRequest, SchedulePickupRequest, CancelPickupRequest, GetRatesRequest, TrackingRequest, CancelNotificationRequest, CreateNotificationRequest, ValidateInboundDataRequest, NormalizeTrackingDataRequest } from '../requests';
2
+ import { RegisterResponse, CreateLabelResponse, VoidLabelsResponse, CreateManifestResponse, SchedulePickupResponse, CancelPickupResponse, GetRatesResponse, TrackingResponse, CancelNotificationResponse, CreateNotificationResponse, ValidateInboundDataResponse, NormalizeTrackingDataResponse } from '../responses';
3
3
  import { CarrierAppMetadata } from './metadata/carrier-app-metadata';
4
4
  /**
5
5
  * @description This defines a connect carrier app
@@ -56,4 +56,14 @@ export interface CarrierAppDefinition {
56
56
  * @param request Data needed by the provider to inform them of the cancellation
57
57
  */
58
58
  CancelNotification?: (request: CancelNotificationRequest) => CancelNotificationResponse | Promise<CancelNotificationResponse>;
59
+ /**
60
+ * @description This endpoint is used to validate inbound data and determine the type of data included in the inbound message
61
+ * @param request Data received from the provider via an inbound method, such as a webhook
62
+ */
63
+ ValidateInboundData?: (request: ValidateInboundDataRequest) => ValidateInboundDataResponse | Promise<ValidateInboundDataRequest>;
64
+ /**
65
+ * @description This endpoint is used to normalize inbound tracking data and determine the type of data
66
+ * @param request Tracking data received from the provider via an inbound method, such as a webhook
67
+ */
68
+ NormalizeTrackingData?: (request: NormalizeTrackingDataRequest) => NormalizeTrackingDataResponse | Promise<NormalizeTrackingDataResponse>;
59
69
  }
@@ -2,10 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CarrierApp = void 0;
4
4
  const internal_1 = require("./internal");
5
+ const constants_1 = require("./constants");
5
6
  const path_1 = require("path");
6
7
  const fs_1 = require("fs");
7
8
  const metadata_1 = require("./internal/metadata");
8
9
  const metadata_2 = require("./metadata");
10
+ const responses_1 = require("../responses");
9
11
  const handleRequest = (implementation) => {
10
12
  if (implementation) {
11
13
  return (request) => {
@@ -13,62 +15,9 @@ const handleRequest = (implementation) => {
13
15
  };
14
16
  }
15
17
  };
16
- const registerRoutes = (routes, definition) => {
17
- routes.push({
18
- method: internal_1.Method.POST,
19
- path: '/Register',
20
- handler: handleRequest(definition.Register),
21
- });
22
- routes.push({
23
- method: internal_1.Method.POST,
24
- path: '/CreateLabel',
25
- handler: handleRequest(definition.CreateLabel),
26
- });
27
- routes.push({
28
- method: internal_1.Method.POST,
29
- path: '/VoidLabels',
30
- handler: handleRequest(definition.VoidLabels),
31
- });
32
- routes.push({
33
- method: internal_1.Method.POST,
34
- path: '/GetRates',
35
- handler: handleRequest(definition.GetRates),
36
- });
37
- routes.push({
38
- method: internal_1.Method.POST,
39
- path: '/CreateManifest',
40
- handler: handleRequest(definition.CreateManifest),
41
- });
42
- routes.push({
43
- method: internal_1.Method.POST,
44
- path: '/SchedulePickup',
45
- handler: handleRequest(definition.SchedulePickup),
46
- });
47
- routes.push({
48
- method: internal_1.Method.POST,
49
- path: '/CancelPickup',
50
- handler: handleRequest(definition.CancelPickup),
51
- });
52
- routes.push({
53
- method: internal_1.Method.POST,
54
- path: '/Track',
55
- handler: handleRequest(definition.Track),
56
- });
57
- routes.push({
58
- method: internal_1.Method.POST,
59
- path: '/CreateNotification',
60
- handler: handleRequest(definition.CreateNotification),
61
- });
62
- routes.push({
63
- method: internal_1.Method.POST,
64
- path: '/CancelNotification',
65
- handler: handleRequest(definition.CancelNotification),
66
- });
67
- };
68
18
  class CarrierApp {
69
19
  constructor(definition) {
70
20
  this.routes = [];
71
- registerRoutes(this.routes, definition);
72
21
  this.validate = () => {
73
22
  const results = metadata_2.CarrierAppMetadataSchema.validate(definition.Metadata, {
74
23
  allowUnknown: true,
@@ -78,6 +27,83 @@ class CarrierApp {
78
27
  return results.error.details.map((detail) => `${detail.message}`);
79
28
  }
80
29
  };
30
+ new Array([
31
+ internal_1.Method.POST,
32
+ constants_1.ApiEndpoints.CancelNotification,
33
+ definition.CancelNotification,
34
+ responses_1.CancelNotificationResponseSchema,
35
+ ], [
36
+ internal_1.Method.POST,
37
+ constants_1.ApiEndpoints.CancelPickup,
38
+ definition.CancelPickup,
39
+ responses_1.CancelPickupResponseSchema,
40
+ ], [
41
+ internal_1.Method.POST,
42
+ constants_1.ApiEndpoints.CreateLabel,
43
+ definition.CreateLabel,
44
+ responses_1.CreateLabelResponseSchema,
45
+ ], [
46
+ internal_1.Method.POST,
47
+ constants_1.ApiEndpoints.CreateManifest,
48
+ definition.CreateManifest,
49
+ responses_1.CreateManifestResponseSchema,
50
+ ], [
51
+ internal_1.Method.POST,
52
+ constants_1.ApiEndpoints.CreateNotification,
53
+ definition.CreateNotification,
54
+ responses_1.CreateNotificationResponseSchema,
55
+ ], [
56
+ internal_1.Method.POST,
57
+ constants_1.ApiEndpoints.GetRates,
58
+ definition.GetRates,
59
+ responses_1.GetRatesResponseSchema,
60
+ ], [
61
+ internal_1.Method.POST,
62
+ constants_1.ApiEndpoints.NormalizeTrackingData,
63
+ definition.NormalizeTrackingData,
64
+ responses_1.NormalizeTrackingDataResponseSchema,
65
+ ], [
66
+ internal_1.Method.POST,
67
+ constants_1.ApiEndpoints.Register,
68
+ definition.Register,
69
+ responses_1.RegisterResponseSchema,
70
+ ], [
71
+ internal_1.Method.POST,
72
+ constants_1.ApiEndpoints.SchedulePickup,
73
+ definition.SchedulePickup,
74
+ responses_1.SchedulePickupResponseSchema,
75
+ ], [
76
+ internal_1.Method.POST,
77
+ constants_1.ApiEndpoints.Track,
78
+ definition.Track,
79
+ responses_1.TrackingResponseSchema,
80
+ ], [
81
+ internal_1.Method.POST,
82
+ constants_1.ApiEndpoints.ValidateInboundData,
83
+ definition.ValidateInboundData,
84
+ responses_1.ValidateInboundDataResponseSchema,
85
+ ], [
86
+ internal_1.Method.POST,
87
+ constants_1.ApiEndpoints.VoidLabels,
88
+ definition.VoidLabels,
89
+ responses_1.VoidLabelsResponseSchema,
90
+ ]).forEach(([method, path, implementation, schema]) => {
91
+ if (implementation) {
92
+ this.routes.push({
93
+ method,
94
+ path,
95
+ handler: handleRequest(implementation),
96
+ validateResponse: (result) => {
97
+ var _a, _b;
98
+ const validationResults = schema.validate(result, {
99
+ abortEarly: false,
100
+ });
101
+ const errors = (_b = (_a = validationResults === null || validationResults === void 0 ? void 0 : validationResults.error) === null || _a === void 0 ? void 0 : _a.details) === null || _b === void 0 ? void 0 : _b.map((detail) => detail.message);
102
+ return errors;
103
+ },
104
+ });
105
+ }
106
+ });
81
107
  this.data = new metadata_1.Metadata(definition);
82
108
  const jsonSpecPath = path_1.resolve(__dirname, '../../spec.json');
83
109
  const yamlSpecPath = path_1.resolve(__dirname, '../../spec.yaml');
@@ -1 +1 @@
1
- {"version":3,"file":"carrier-app.js","sourceRoot":"","sources":["../../src/app/carrier-app.ts"],"names":[],"mappings":";;;AACA,yCAA6E;AAE7E,+BAA+B;AAC/B,2BAA8C;AAE9C,kDAA+C;AAE/C,yCAAsD;AAEtD,MAAM,aAAa,GAAG,CAAC,cAAyB,EAAO,EAAE;IACvD,IAAI,cAAc,EAAE;Q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5B,IAAI,CAAC,KAAK,GAAG,iBAAY,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;SACpD;aAAM,IAAI,eAAU,CAAC,YAAY,CAAC,EAAE;YACnC,IAAI,CAAC,KAAK,GAAG,iBAAY,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;SACpD;IACH,CAAC;IACD,SAAS;QACP,MAAM,gBAAgB,GAAG,CAAC,OAA6B,EAAiB,EAAE;YACxE,OAAO;gBACL,EAAE,EAAE,OAAO,CAAC,EAAE;gBACd,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO;gBAC5B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO;aAC7B,CAAC;QACJ,CAAC,CAAC;QACF,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClD,CAAC;CACF;AA9HD,gCA8HC"}
@@ -0,0 +1,14 @@
1
+ export declare enum ApiEndpoints {
2
+ Register = "/Register",
3
+ CreateLabel = "/CreateLabel",
4
+ VoidLabels = "/VoidLabels",
5
+ GetRates = "/GetRates",
6
+ CreateManifest = "/CreateManifest",
7
+ SchedulePickup = "/SchedulePickup",
8
+ CancelPickup = "/CancelPickup",
9
+ Track = "/Track",
10
+ CreateNotification = "/CreateNotification",
11
+ CancelNotification = "/CancelNotification",
12
+ ValidateInboundData = "/ValidateInboundData",
13
+ NormalizeTrackingData = "/NormalizeTrackingData"
14
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiEndpoints = void 0;
4
+ var ApiEndpoints;
5
+ (function (ApiEndpoints) {
6
+ ApiEndpoints["Register"] = "/Register";
7
+ ApiEndpoints["CreateLabel"] = "/CreateLabel";
8
+ ApiEndpoints["VoidLabels"] = "/VoidLabels";
9
+ ApiEndpoints["GetRates"] = "/GetRates";
10
+ ApiEndpoints["CreateManifest"] = "/CreateManifest";
11
+ ApiEndpoints["SchedulePickup"] = "/SchedulePickup";
12
+ ApiEndpoints["CancelPickup"] = "/CancelPickup";
13
+ ApiEndpoints["Track"] = "/Track";
14
+ ApiEndpoints["CreateNotification"] = "/CreateNotification";
15
+ ApiEndpoints["CancelNotification"] = "/CancelNotification";
16
+ ApiEndpoints["ValidateInboundData"] = "/ValidateInboundData";
17
+ ApiEndpoints["NormalizeTrackingData"] = "/NormalizeTrackingData";
18
+ })(ApiEndpoints = exports.ApiEndpoints || (exports.ApiEndpoints = {}));
19
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/app/constants.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAaX;AAbD,WAAY,YAAY;IACtB,sCAAsB,CAAA;IACtB,4CAA4B,CAAA;IAC5B,0CAA0B,CAAA;IAC1B,sCAAsB,CAAA;IACtB,kDAAkC,CAAA;IAClC,kDAAkC,CAAA;IAClC,8CAA8B,CAAA;IAC9B,gCAAgB,CAAA;IAChB,0DAA0C,CAAA;IAC1C,0DAA0C,CAAA;IAC1C,4DAA4C,CAAA;IAC5C,gEAAgD,CAAA;AAClD,CAAC,EAbW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAavB"}
@@ -9,4 +9,5 @@ export interface Route {
9
9
  path: string;
10
10
  method: Method;
11
11
  handler?: (req: any) => any | Promise<any>;
12
+ validateResponse?: (response: any) => string[] | undefined;
12
13
  }
@@ -0,0 +1,4 @@
1
+ export declare class Authorization {
2
+ access_token?: string;
3
+ connection_context?: any;
4
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Authorization = void 0;
4
+ class Authorization {
5
+ }
6
+ exports.Authorization = Authorization;
7
+ //# sourceMappingURL=authorization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorization.js","sourceRoot":"","sources":["../../src/models/authorization.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAa;CAGzB;AAHD,sCAGC"}
@@ -1,3 +1,4 @@
1
+ import Joi from 'joi';
1
2
  /** @description Category for a billing line item */
2
3
  export declare enum BillingCategories {
3
4
  Uncategorized = "uncategorized",
@@ -23,3 +24,4 @@ export declare enum BillingCategories {
23
24
  /** @description Amount to be paid to the driver, used for local delivery and courier services. */
24
25
  Tip = "tip"
25
26
  }
27
+ export declare const BillingCategoriesSchema: Joi.StringSchema;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BillingCategories = void 0;
3
+ exports.BillingCategoriesSchema = exports.BillingCategories = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const joi_1 = tslib_1.__importDefault(require("joi"));
4
6
  /** @description Category for a billing line item */
5
7
  var BillingCategories;
6
8
  (function (BillingCategories) {
@@ -27,4 +29,5 @@ var BillingCategories;
27
29
  /** @description Amount to be paid to the driver, used for local delivery and courier services. */
28
30
  BillingCategories["Tip"] = "tip";
29
31
  })(BillingCategories = exports.BillingCategories || (exports.BillingCategories = {}));
32
+ exports.BillingCategoriesSchema = joi_1.default.string().valid(...Object.values(BillingCategories));
30
33
  //# sourceMappingURL=billing-categories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"billing-categories.js","sourceRoot":"","sources":["../../../src/models/billing/billing-categories.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,IAAY,iBAuBX;AAvBD,WAAY,iBAAiB;IAC3B,oDAA+B,CAAA;IAC/B,0CAAqB,CAAA;IACrB,4CAAuB,CAAA;IACvB,oFAAoF;IACpF,wCAAmB,CAAA;IACnB,0CAAqB,CAAA;IACrB,+CAA0B,CAAA;IAC1B,uDAAkC,CAAA;IAClC,sCAAiB,CAAA;IACjB,gCAAW,CAAA;IACX,0CAAqB,CAAA;IACrB,0CAAqB,CAAA;IACrB,mDAA8B,CAAA;IAC9B,sCAAiB,CAAA;IACjB,wEAAwE;IACxE,iDAA4B,CAAA;IAC5B,iDAAiD;IACjD,0CAAqB,CAAA;IACrB,wCAAmB,CAAA;IACnB,oDAA+B,CAAA;IAC/B,kGAAkG;IAClG,gCAAW,CAAA;AACb,CAAC,EAvBW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAuB5B"}
1
+ {"version":3,"file":"billing-categories.js","sourceRoot":"","sources":["../../../src/models/billing/billing-categories.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AAEtB,oDAAoD;AACpD,IAAY,iBAuBX;AAvBD,WAAY,iBAAiB;IAC3B,oDAA+B,CAAA;IAC/B,0CAAqB,CAAA;IACrB,4CAAuB,CAAA;IACvB,oFAAoF;IACpF,wCAAmB,CAAA;IACnB,0CAAqB,CAAA;IACrB,+CAA0B,CAAA;IAC1B,uDAAkC,CAAA;IAClC,sCAAiB,CAAA;IACjB,gCAAW,CAAA;IACX,0CAAqB,CAAA;IACrB,0CAAqB,CAAA;IACrB,mDAA8B,CAAA;IAC9B,sCAAiB,CAAA;IACjB,wEAAwE;IACxE,iDAA4B,CAAA;IAC5B,iDAAiD;IACjD,0CAAqB,CAAA;IACrB,wCAAmB,CAAA;IACnB,oDAA+B,CAAA;IAC/B,kGAAkG;IAClG,gCAAW,CAAA;AACb,CAAC,EAvBW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAuB5B;AAEY,QAAA,uBAAuB,GAAG,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CACvD,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CACpC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { BillingCategories } from './billing-categories';
2
2
  import { Currency } from '../currency';
3
+ import Joi from 'joi';
3
4
  /** @description Basic structure of each charge or line item */
4
5
  export declare class BillingLineItem {
5
6
  billing_category: BillingCategories;
@@ -8,3 +9,4 @@ export declare class BillingLineItem {
8
9
  memo?: string;
9
10
  amount: Currency;
10
11
  }
12
+ export declare const BillingLineItemSchema: Joi.ObjectSchema<any>;
@@ -1,8 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BillingLineItem = void 0;
3
+ exports.BillingLineItemSchema = exports.BillingLineItem = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const billing_categories_1 = require("./billing-categories");
6
+ const currency_1 = require("../currency");
7
+ const joi_1 = tslib_1.__importDefault(require("joi"));
4
8
  /** @description Basic structure of each charge or line item */
5
9
  class BillingLineItem {
6
10
  }
7
11
  exports.BillingLineItem = BillingLineItem;
12
+ exports.BillingLineItemSchema = joi_1.default.object({
13
+ billing_category: billing_categories_1.BillingCategoriesSchema.required(),
14
+ carrier_description: joi_1.default.string().optional().empty(),
15
+ carrier_billing_code: joi_1.default.string().optional().empty(),
16
+ memo: joi_1.default.string().optional().empty(),
17
+ amount: currency_1.CurrencySchema.required(),
18
+ });
8
19
  //# sourceMappingURL=billing-line-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"billing-line-item.js","sourceRoot":"","sources":["../../../src/models/billing/billing-line-item.ts"],"names":[],"mappings":";;;AAGA,+DAA+D;AAC/D,MAAa,eAAe;CAM3B;AAND,0CAMC"}
1
+ {"version":3,"file":"billing-line-item.js","sourceRoot":"","sources":["../../../src/models/billing/billing-line-item.ts"],"names":[],"mappings":";;;;AAAA,6DAG8B;AAC9B,0CAAuD;AACvD,sDAAsB;AAEtB,+DAA+D;AAC/D,MAAa,eAAe;CAM3B;AAND,0CAMC;AAEY,QAAA,qBAAqB,GAAG,aAAG,CAAC,MAAM,CAAC;IAC9C,gBAAgB,EAAE,4CAAuB,CAAC,QAAQ,EAAE;IACpD,mBAAmB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IACpD,oBAAoB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IACrD,IAAI,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IACrC,MAAM,EAAE,yBAAc,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC"}
@@ -1,5 +1,7 @@
1
+ import Joi from 'joi';
1
2
  /** @description Basic structure for defining an amount of money and its currency */
2
3
  export declare class Currency {
3
4
  currency: string;
4
5
  amount: string;
5
6
  }
7
+ export declare const CurrencySchema: Joi.ObjectSchema<any>;
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Currency = void 0;
3
+ exports.CurrencySchema = exports.Currency = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const joi_1 = tslib_1.__importDefault(require("joi"));
4
6
  /** @description Basic structure for defining an amount of money and its currency */
5
7
  class Currency {
6
8
  }
7
9
  exports.Currency = Currency;
10
+ exports.CurrencySchema = joi_1.default.object({
11
+ currency: joi_1.default.string().required(),
12
+ amount: joi_1.default.string().required(),
13
+ });
8
14
  //# sourceMappingURL=currency.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"currency.js","sourceRoot":"","sources":["../../src/models/currency.ts"],"names":[],"mappings":";;;AAAA,oFAAoF;AACpF,MAAa,QAAQ;CAGpB;AAHD,4BAGC"}
1
+ {"version":3,"file":"currency.js","sourceRoot":"","sources":["../../src/models/currency.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AAEtB,oFAAoF;AACpF,MAAa,QAAQ;CAGpB;AAHD,4BAGC;AAEY,QAAA,cAAc,GAAG,aAAG,CAAC,MAAM,CAAC;IACvC,QAAQ,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,MAAM,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import Joi from 'joi';
1
2
  /** @description Types of documents */
2
3
  export declare enum DocumentType {
3
4
  Label = "label",
@@ -5,3 +6,4 @@ export declare enum DocumentType {
5
6
  CommercialInvoice = "commercial_invoice",
6
7
  BillOfLading = "bill_of_lading"
7
8
  }
9
+ export declare const DocumentTypeSchema: Joi.StringSchema;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DocumentType = void 0;
3
+ exports.DocumentTypeSchema = exports.DocumentType = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const joi_1 = tslib_1.__importDefault(require("joi"));
4
6
  /** @description Types of documents */
5
7
  var DocumentType;
6
8
  (function (DocumentType) {
@@ -9,4 +11,5 @@ var DocumentType;
9
11
  DocumentType["CommercialInvoice"] = "commercial_invoice";
10
12
  DocumentType["BillOfLading"] = "bill_of_lading";
11
13
  })(DocumentType = exports.DocumentType || (exports.DocumentType = {}));
14
+ exports.DocumentTypeSchema = joi_1.default.string().valid(...Object.values(DocumentType));
12
15
  //# sourceMappingURL=document-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"document-type.js","sourceRoot":"","sources":["../../../src/models/documents/document-type.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACtC,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,4CAA4B,CAAA;IAC5B,wDAAwC,CAAA;IACxC,+CAA+B,CAAA;AACjC,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB"}
1
+ {"version":3,"file":"document-type.js","sourceRoot":"","sources":["../../../src/models/documents/document-type.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AAEtB,sCAAsC;AACtC,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,4CAA4B,CAAA;IAC5B,wDAAwC,CAAA;IACxC,+CAA+B,CAAA;AACjC,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB;AAEY,QAAA,kBAAkB,GAAG,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAClD,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAC/B,CAAC"}
@@ -1,8 +1,10 @@
1
1
  import { DocumentType } from './document-type';
2
2
  import { DocumentFormat } from '../labels/document-formats';
3
+ import Joi from 'joi';
3
4
  /** @description Basic structure for a document */
4
5
  export declare class Document {
5
6
  type: DocumentType[];
6
7
  data: string;
7
8
  format: DocumentFormat;
8
9
  }
10
+ export declare const DocumentSchema: Joi.ObjectSchema<any>;
@@ -1,8 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Document = void 0;
3
+ exports.DocumentSchema = exports.Document = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const document_type_1 = require("./document-type");
6
+ const document_formats_1 = require("../labels/document-formats");
7
+ const joi_1 = tslib_1.__importDefault(require("joi"));
4
8
  /** @description Basic structure for a document */
5
9
  class Document {
6
10
  }
7
11
  exports.Document = Document;
12
+ exports.DocumentSchema = joi_1.default.object({
13
+ type: joi_1.default.array().required().min(1).items(document_type_1.DocumentTypeSchema),
14
+ data: joi_1.default.string().required(),
15
+ format: document_formats_1.DocumentFormatSchema.required(),
16
+ });
8
17
  //# sourceMappingURL=document.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"document.js","sourceRoot":"","sources":["../../../src/models/documents/document.ts"],"names":[],"mappings":";;;AAGA,kDAAkD;AAClD,MAAa,QAAQ;CAIpB;AAJD,4BAIC"}
1
+ {"version":3,"file":"document.js","sourceRoot":"","sources":["../../../src/models/documents/document.ts"],"names":[],"mappings":";;;;AAAA,mDAAmE;AACnE,iEAGoC;AACpC,sDAAsB;AAEtB,kDAAkD;AAClD,MAAa,QAAQ;CAIpB;AAJD,4BAIC;AACY,QAAA,cAAc,GAAG,aAAG,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,aAAG,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,kCAAkB,CAAC;IAC7D,IAAI,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,uCAAoB,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC"}
@@ -1,5 +1,7 @@
1
+ import Joi from 'joi';
1
2
  /** @description Key value pair to allow custom properties */
2
3
  export declare class Identifier {
3
4
  type: string;
4
5
  value: string;
5
6
  }
7
+ export declare const IdentifierSchema: Joi.ObjectSchema<any>;
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Identifier = void 0;
3
+ exports.IdentifierSchema = exports.Identifier = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const joi_1 = tslib_1.__importDefault(require("joi"));
4
6
  /** @description Key value pair to allow custom properties */
5
7
  class Identifier {
6
8
  }
7
9
  exports.Identifier = Identifier;
10
+ exports.IdentifierSchema = joi_1.default.object({
11
+ type: joi_1.default.string().required(),
12
+ value: joi_1.default.string().required(),
13
+ });
8
14
  //# sourceMappingURL=identifier.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"identifier.js","sourceRoot":"","sources":["../../src/models/identifier.ts"],"names":[],"mappings":";;;AAAA,6DAA6D;AAC7D,MAAa,UAAU;CAGtB;AAHD,gCAGC"}
1
+ {"version":3,"file":"identifier.js","sourceRoot":"","sources":["../../src/models/identifier.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AAEtB,6DAA6D;AAC7D,MAAa,UAAU;CAGtB;AAHD,gCAGC;AAEY,QAAA,gBAAgB,GAAG,aAAG,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import Joi from 'joi';
2
+ /** @description Types of inbound content */
3
+ export declare enum InboundDataContentTypes {
4
+ /** @description Tracking information */
5
+ Tracking = "tracking"
6
+ }
7
+ export declare const InboundDataContentTypesSchema: Joi.StringSchema;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InboundDataContentTypesSchema = exports.InboundDataContentTypes = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const joi_1 = tslib_1.__importDefault(require("joi"));
6
+ /** @description Types of inbound content */
7
+ var InboundDataContentTypes;
8
+ (function (InboundDataContentTypes) {
9
+ /** @description Tracking information */
10
+ InboundDataContentTypes["Tracking"] = "tracking";
11
+ })(InboundDataContentTypes = exports.InboundDataContentTypes || (exports.InboundDataContentTypes = {}));
12
+ exports.InboundDataContentTypesSchema = joi_1.default.string().valid(...Object.values(InboundDataContentTypes));
13
+ //# sourceMappingURL=inbound-content-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inbound-content-types.js","sourceRoot":"","sources":["../../src/models/inbound-content-types.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AAEtB,4CAA4C;AAC5C,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,wCAAwC;IACxC,gDAAqB,CAAA;AACvB,CAAC,EAHW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAGlC;AACY,QAAA,6BAA6B,GAAG,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAC7D,GAAG,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAC1C,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './addresses';
2
+ export * from './authorization';
2
3
  export * from './billing';
3
4
  export * from './customs';
4
5
  export * from './errors';
@@ -20,3 +21,4 @@ export * from './resource-download';
20
21
  export * from './taxes';
21
22
  export * from './documents';
22
23
  export * from './time-window';
24
+ export * from './inbound-content-types';
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./addresses"), exports);
5
+ tslib_1.__exportStar(require("./authorization"), exports);
5
6
  tslib_1.__exportStar(require("./billing"), exports);
6
7
  tslib_1.__exportStar(require("./customs"), exports);
7
8
  tslib_1.__exportStar(require("./errors"), exports);
@@ -23,4 +24,5 @@ tslib_1.__exportStar(require("./resource-download"), exports);
23
24
  tslib_1.__exportStar(require("./taxes"), exports);
24
25
  tslib_1.__exportStar(require("./documents"), exports);
25
26
  tslib_1.__exportStar(require("./time-window"), exports);
27
+ tslib_1.__exportStar(require("./inbound-content-types"), exports);
26
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,oDAA0B;AAC1B,oDAA0B;AAC1B,mDAAyB;AACzB,8DAAoC;AACpC,mDAAyB;AACzB,sDAA4B;AAC5B,mDAAyB;AACzB,kDAAwB;AACxB,yDAA+B;AAC/B,qDAA2B;AAC3B,kDAAwB;AACxB,6DAAmC;AACnC,+DAAqC;AACrC,qDAA2B;AAC3B,uDAA6B;AAC7B,gEAAsC;AACtC,oDAA0B;AAC1B,8DAAoC;AACpC,kDAAwB;AACxB,sDAA4B;AAC5B,wDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,0DAAgC;AAChC,oDAA0B;AAC1B,oDAA0B;AAC1B,mDAAyB;AACzB,8DAAoC;AACpC,mDAAyB;AACzB,sDAA4B;AAC5B,mDAAyB;AACzB,kDAAwB;AACxB,yDAA+B;AAC/B,qDAA2B;AAC3B,kDAAwB;AACxB,6DAAmC;AACnC,+DAAqC;AACrC,qDAA2B;AAC3B,uDAA6B;AAC7B,gEAAsC;AACtC,oDAA0B;AAC1B,8DAAoC;AACpC,kDAAwB;AACxB,sDAA4B;AAC5B,wDAA8B;AAC9B,kEAAwC"}
@@ -1,6 +1,8 @@
1
+ import Joi from 'joi';
1
2
  /** @description Label data type */
2
3
  export declare enum DocumentFormat {
3
4
  Pdf = "PDF",
4
5
  Zpl = "ZPL",
5
6
  Png = "PNG"
6
7
  }
8
+ export declare const DocumentFormatSchema: Joi.StringSchema;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DocumentFormat = void 0;
3
+ exports.DocumentFormatSchema = exports.DocumentFormat = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const joi_1 = tslib_1.__importDefault(require("joi"));
4
6
  /** @description Label data type */
5
7
  var DocumentFormat;
6
8
  (function (DocumentFormat) {
@@ -8,4 +10,5 @@ var DocumentFormat;
8
10
  DocumentFormat["Zpl"] = "ZPL";
9
11
  DocumentFormat["Png"] = "PNG";
10
12
  })(DocumentFormat = exports.DocumentFormat || (exports.DocumentFormat = {}));
13
+ exports.DocumentFormatSchema = joi_1.default.string().valid(...Object.values(DocumentFormat));
11
14
  //# sourceMappingURL=document-formats.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"document-formats.js","sourceRoot":"","sources":["../../../src/models/labels/document-formats.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,6BAAW,CAAA;IACX,6BAAW,CAAA;AACb,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB"}
1
+ {"version":3,"file":"document-formats.js","sourceRoot":"","sources":["../../../src/models/labels/document-formats.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AAEtB,mCAAmC;AACnC,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,6BAAW,CAAA;IACX,6BAAW,CAAA;AACb,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB;AACY,QAAA,oBAAoB,GAAG,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CACpD,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CACjC,CAAC"}
@@ -1,4 +1,6 @@
1
+ import Joi from 'joi';
1
2
  import { ResourceDownload } from '../resource-download';
2
3
  export declare class FormDownload extends ResourceDownload {
3
4
  form_data?: string;
4
5
  }
6
+ export declare const FormDownloadSchema: Joi.ObjectSchema<any>;
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FormDownload = void 0;
3
+ exports.FormDownloadSchema = exports.FormDownload = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const joi_1 = tslib_1.__importDefault(require("joi"));
4
6
  const resource_download_1 = require("../resource-download");
5
7
  class FormDownload extends resource_download_1.ResourceDownload {
6
8
  }
7
9
  exports.FormDownload = FormDownload;
10
+ exports.FormDownloadSchema = resource_download_1.ResourceDownloadSchema.keys({
11
+ form_data: joi_1.default.string().optional().empty(),
12
+ });
8
13
  //# sourceMappingURL=form-download.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-download.js","sourceRoot":"","sources":["../../../src/models/labels/form-download.ts"],"names":[],"mappings":";;;AAAA,4DAAwD;AAExD,MAAa,YAAa,SAAQ,oCAAgB;CAEjD;AAFD,oCAEC"}
1
+ {"version":3,"file":"form-download.js","sourceRoot":"","sources":["../../../src/models/labels/form-download.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AACtB,4DAAgF;AAEhF,MAAa,YAAa,SAAQ,oCAAgB;CAEjD;AAFD,oCAEC;AAEY,QAAA,kBAAkB,GAAG,0CAAsB,CAAC,IAAI,CAAC;IAC5D,SAAS,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;CAC3C,CAAC,CAAC"}
@@ -1,4 +1,6 @@
1
+ import Joi from 'joi';
1
2
  import { ResourceDownload } from '../resource-download';
2
3
  export declare class LabelDownload extends ResourceDownload {
3
4
  label_data?: string;
4
5
  }
6
+ export declare const LabelDownloadSchema: Joi.ObjectSchema<any>;
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LabelDownload = void 0;
3
+ exports.LabelDownloadSchema = exports.LabelDownload = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const joi_1 = tslib_1.__importDefault(require("joi"));
4
6
  const resource_download_1 = require("../resource-download");
5
7
  class LabelDownload extends resource_download_1.ResourceDownload {
6
8
  }
7
9
  exports.LabelDownload = LabelDownload;
10
+ exports.LabelDownloadSchema = resource_download_1.ResourceDownloadSchema.keys({
11
+ label_data: joi_1.default.string().optional().empty(),
12
+ });
8
13
  //# sourceMappingURL=label-download.js.map