@shipengine/connect-carrier-api 2.1.21 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/carrier-app-definition.d.ts +1 -1
- package/lib/app/carrier-app.d.ts +1 -0
- package/lib/app/carrier-app.js +91 -63
- package/lib/app/carrier-app.js.map +1 -1
- package/lib/app/constants.d.ts +14 -0
- package/lib/app/constants.js +19 -0
- package/lib/app/constants.js.map +1 -0
- package/lib/app/internal/{carrier-app-specificaion.d.ts → carrier-app-specification.d.ts} +4 -1
- package/lib/app/internal/{carrier-app-specificaion.js → carrier-app-specification.js} +1 -1
- package/lib/app/internal/carrier-app-specification.js.map +1 -0
- package/lib/app/internal/{carrier-specificaion.d.ts → carrier-specification.d.ts} +0 -0
- package/lib/app/internal/{carrier-specificaion.js → carrier-specification.js} +1 -1
- package/lib/app/internal/carrier-specification.js.map +1 -0
- package/lib/app/internal/metadata.d.ts +4 -2
- package/lib/app/internal/metadata.js +6 -2
- package/lib/app/internal/metadata.js.map +1 -1
- package/lib/app/internal/route.d.ts +1 -0
- package/lib/app/metadata/auth-identifier.d.ts +10 -0
- package/lib/app/metadata/auth-identifier.js +18 -0
- package/lib/app/metadata/auth-identifier.js.map +1 -0
- package/lib/app/metadata/auth-specification.d.ts +19 -0
- package/lib/app/metadata/auth-specification.js +20 -0
- package/lib/app/metadata/auth-specification.js.map +1 -0
- package/lib/app/metadata/carrier-app-metadata.d.ts +3 -1
- package/lib/app/metadata/carrier-app-metadata.js +3 -2
- package/lib/app/metadata/carrier-app-metadata.js.map +1 -1
- package/lib/app/metadata/index.d.ts +4 -1
- package/lib/app/metadata/index.js +4 -1
- package/lib/app/metadata/index.js.map +1 -1
- package/lib/app/metadata/monoauth.d.ts +102 -0
- package/lib/app/metadata/monoauth.js +82 -0
- package/lib/app/metadata/monoauth.js.map +1 -0
- package/lib/models/addresses/address-base.d.ts +2 -0
- package/lib/models/addresses/address-base.js.map +1 -1
- package/lib/models/billing/billing-categories.d.ts +2 -0
- package/lib/models/billing/billing-categories.js +4 -1
- package/lib/models/billing/billing-categories.js.map +1 -1
- package/lib/models/billing/billing-line-item.d.ts +2 -0
- package/lib/models/billing/billing-line-item.js +12 -1
- package/lib/models/billing/billing-line-item.js.map +1 -1
- package/lib/models/currency.d.ts +2 -0
- package/lib/models/currency.js +7 -1
- package/lib/models/currency.js.map +1 -1
- package/lib/models/documents/document-type.d.ts +2 -0
- package/lib/models/documents/document-type.js +4 -1
- package/lib/models/documents/document-type.js.map +1 -1
- package/lib/models/documents/document.d.ts +2 -0
- package/lib/models/documents/document.js +10 -1
- package/lib/models/documents/document.js.map +1 -1
- package/lib/models/identifier.d.ts +2 -0
- package/lib/models/identifier.js +7 -1
- package/lib/models/identifier.js.map +1 -1
- package/lib/models/inbound-content-types.d.ts +2 -0
- package/lib/models/inbound-content-types.js +4 -1
- package/lib/models/inbound-content-types.js.map +1 -1
- package/lib/models/labels/document-formats.d.ts +2 -0
- package/lib/models/labels/document-formats.js +4 -1
- package/lib/models/labels/document-formats.js.map +1 -1
- package/lib/models/labels/form-download.d.ts +2 -0
- package/lib/models/labels/form-download.js +6 -1
- package/lib/models/labels/form-download.js.map +1 -1
- package/lib/models/labels/label-download.d.ts +2 -0
- package/lib/models/labels/label-download.js +6 -1
- package/lib/models/labels/label-download.js.map +1 -1
- package/lib/models/labels/label-package.d.ts +2 -0
- package/lib/models/labels/label-package.js +10 -1
- package/lib/models/labels/label-package.js.map +1 -1
- package/lib/models/labels/void-response.d.ts +3 -1
- package/lib/models/labels/void-response.js +10 -1
- package/lib/models/labels/void-response.js.map +1 -1
- package/lib/models/manifests/manifest.d.ts +2 -0
- package/lib/models/manifests/manifest.js +10 -1
- package/lib/models/manifests/manifest.js.map +1 -1
- package/lib/models/pickup/pickup-confirmation.d.ts +2 -0
- package/lib/models/pickup/pickup-confirmation.js +10 -1
- package/lib/models/pickup/pickup-confirmation.js.map +1 -1
- package/lib/models/pickup/pickup-window.d.ts +2 -0
- package/lib/models/pickup/pickup-window.js +9 -1
- package/lib/models/pickup/pickup-window.js.map +1 -1
- package/lib/models/pickup/shipment-identifier.d.ts +2 -0
- package/lib/models/pickup/shipment-identifier.js +8 -1
- package/lib/models/pickup/shipment-identifier.js.map +1 -1
- package/lib/models/rates/rate.d.ts +2 -0
- package/lib/models/rates/rate.js +18 -1
- package/lib/models/rates/rate.js.map +1 -1
- package/lib/models/registration/credentials.d.ts +2 -0
- package/lib/models/registration/credentials.js +7 -1
- package/lib/models/registration/credentials.js.map +1 -1
- package/lib/models/resource-download.d.ts +2 -0
- package/lib/models/resource-download.js +7 -1
- package/lib/models/resource-download.js.map +1 -1
- package/lib/models/time-window.d.ts +2 -0
- package/lib/models/time-window.js +8 -1
- package/lib/models/time-window.js.map +1 -1
- package/lib/models/tracking/lat-long.d.ts +2 -0
- package/lib/models/tracking/lat-long.js +7 -1
- package/lib/models/tracking/lat-long.js.map +1 -1
- package/lib/models/tracking/service.d.ts +2 -0
- package/lib/models/tracking/service.js +7 -1
- package/lib/models/tracking/service.js.map +1 -1
- package/lib/models/tracking/standardized-status-codes.d.ts +2 -0
- package/lib/models/tracking/standardized-status-codes.js +4 -1
- package/lib/models/tracking/standardized-status-codes.js.map +1 -1
- package/lib/models/tracking/track-event.d.ts +2 -0
- package/lib/models/tracking/track-event.js +18 -1
- package/lib/models/tracking/track-event.js.map +1 -1
- package/lib/models/tracking/tracking-info.d.ts +2 -0
- package/lib/models/tracking/tracking-info.js +27 -1
- package/lib/models/tracking/tracking-info.js.map +1 -1
- package/lib/models/tracking/update-method.d.ts +2 -0
- package/lib/models/tracking/update-method.js +4 -1
- package/lib/models/tracking/update-method.js.map +1 -1
- package/lib/models/units/dimensions.d.ts +2 -0
- package/lib/models/units/dimensions.js +8 -1
- package/lib/models/units/dimensions.js.map +1 -1
- package/lib/responses/base-response.d.ts +2 -0
- package/lib/responses/base-response.js +6 -1
- package/lib/responses/base-response.js.map +1 -1
- package/lib/responses/cancel-notification-response.d.ts +2 -0
- package/lib/responses/cancel-notification-response.js +7 -1
- package/lib/responses/cancel-notification-response.js.map +1 -1
- package/lib/responses/cancel-pickup-response.d.ts +2 -0
- package/lib/responses/cancel-pickup-response.js +9 -1
- package/lib/responses/cancel-pickup-response.js.map +1 -1
- package/lib/responses/create-label-response.d.ts +2 -0
- package/lib/responses/create-label-response.js +19 -1
- package/lib/responses/create-label-response.js.map +1 -1
- package/lib/responses/create-manifest-response.d.ts +2 -0
- package/lib/responses/create-manifest-response.js +8 -1
- package/lib/responses/create-manifest-response.js.map +1 -1
- package/lib/responses/create-notification-response.d.ts +2 -0
- package/lib/responses/create-notification-response.js +6 -1
- package/lib/responses/create-notification-response.js.map +1 -1
- package/lib/responses/get-rates-response.d.ts +2 -0
- package/lib/responses/get-rates-response.js +7 -1
- package/lib/responses/get-rates-response.js.map +1 -1
- package/lib/responses/normalize-tracking-data-response.d.ts +3 -1
- package/lib/responses/normalize-tracking-data-response.js +13 -0
- package/lib/responses/normalize-tracking-data-response.js.map +1 -1
- package/lib/responses/register-response.d.ts +2 -0
- package/lib/responses/register-response.js +8 -1
- package/lib/responses/register-response.js.map +1 -1
- package/lib/responses/schedule-pickup-response.d.ts +2 -0
- package/lib/responses/schedule-pickup-response.js +11 -1
- package/lib/responses/schedule-pickup-response.js.map +1 -1
- package/lib/responses/tracking-response.d.ts +1 -0
- package/lib/responses/tracking-response.js +5 -1
- package/lib/responses/tracking-response.js.map +1 -1
- package/lib/responses/validate-inbound-data-response.d.ts +3 -1
- package/lib/responses/validate-inbound-data-response.js +12 -0
- package/lib/responses/validate-inbound-data-response.js.map +1 -1
- package/lib/responses/void-labels-response.d.ts +2 -0
- package/lib/responses/void-labels-response.js +7 -1
- package/lib/responses/void-labels-response.js.map +1 -1
- package/package.json +1 -1
- package/src/app/carrier-app-definition.ts +1 -1
- package/src/app/carrier-app.ts +126 -66
- package/src/app/constants.ts +14 -0
- package/src/app/internal/{carrier-app-specificaion.ts → carrier-app-specification.ts} +4 -1
- package/src/app/internal/{carrier-specificaion.ts → carrier-specification.ts} +0 -0
- package/src/app/internal/metadata.ts +8 -2
- package/src/app/internal/route.ts +1 -0
- package/src/app/metadata/auth-identifier.ts +17 -0
- package/src/app/metadata/auth-specification.ts +39 -0
- package/src/app/metadata/carrier-app-metadata.ts +9 -1
- package/src/app/metadata/index.ts +4 -1
- package/src/app/metadata/monoauth.ts +171 -0
- package/src/models/addresses/address-base.ts +2 -0
- package/src/models/billing/billing-categories.ts +6 -0
- package/src/models/billing/billing-line-item.ts +14 -2
- package/src/models/currency.ts +7 -0
- package/src/models/documents/document-type.ts +6 -0
- package/src/models/documents/document.ts +11 -2
- package/src/models/identifier.ts +7 -0
- package/src/models/inbound-content-types.ts +5 -0
- package/src/models/labels/document-formats.ts +5 -0
- package/src/models/labels/form-download.ts +6 -1
- package/src/models/labels/label-download.ts +6 -1
- package/src/models/labels/label-package.ts +9 -2
- package/src/models/labels/void-response.ts +9 -2
- package/src/models/manifests/manifest.ts +9 -1
- package/src/models/pickup/pickup-confirmation.ts +11 -2
- package/src/models/pickup/pickup-window.ts +8 -0
- package/src/models/pickup/shipment-identifier.ts +7 -1
- package/src/models/rates/rate.ts +20 -2
- package/src/models/registration/credentials.ts +7 -0
- package/src/models/resource-download.ts +7 -0
- package/src/models/time-window.ts +8 -0
- package/src/models/tracking/lat-long.ts +7 -0
- package/src/models/tracking/service.ts +6 -0
- package/src/models/tracking/standardized-status-codes.ts +6 -0
- package/src/models/tracking/track-event.ts +16 -0
- package/src/models/tracking/tracking-info.ts +29 -4
- package/src/models/tracking/update-method.ts +6 -0
- package/src/models/units/dimensions.ts +7 -0
- package/src/responses/base-response.ts +6 -0
- package/src/responses/cancel-notification-response.ts +7 -1
- package/src/responses/cancel-pickup-response.ts +9 -1
- package/src/responses/create-label-response.ts +25 -1
- package/src/responses/create-manifest-response.ts +8 -2
- package/src/responses/create-notification-response.ts +6 -1
- package/src/responses/get-rates-response.ts +7 -2
- package/src/responses/normalize-tracking-data-response.ts +16 -5
- package/src/responses/register-response.ts +6 -1
- package/src/responses/schedule-pickup-response.ts +18 -2
- package/src/responses/tracking-response.ts +6 -2
- package/src/responses/validate-inbound-data-response.ts +12 -4
- package/src/responses/void-labels-response.ts +7 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/app/internal/carrier-app-specificaion.js.map +0 -1
- package/lib/app/internal/carrier-specificaion.js.map +0 -1
|
@@ -60,7 +60,7 @@ export interface CarrierAppDefinition {
|
|
|
60
60
|
* @description This endpoint is used to validate inbound data and determine the type of data included in the inbound message
|
|
61
61
|
* @param request Data received from the provider via an inbound method, such as a webhook
|
|
62
62
|
*/
|
|
63
|
-
ValidateInboundData?: (request: ValidateInboundDataRequest) => ValidateInboundDataResponse | Promise<
|
|
63
|
+
ValidateInboundData?: (request: ValidateInboundDataRequest) => ValidateInboundDataResponse | Promise<ValidateInboundDataResponse>;
|
|
64
64
|
/**
|
|
65
65
|
* @description This endpoint is used to normalize inbound tracking data and determine the type of data
|
|
66
66
|
* @param request Tracking data received from the provider via an inbound method, such as a webhook
|
package/lib/app/carrier-app.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare class CarrierApp implements ConnectRuntimeApp {
|
|
|
6
6
|
data: Metadata;
|
|
7
7
|
redoc?: string;
|
|
8
8
|
validate: () => string[] | undefined;
|
|
9
|
+
getSupportedCountries: () => string[] | undefined;
|
|
9
10
|
constructor(definition: CarrierAppDefinition);
|
|
10
11
|
getImages(): BrandedImages[];
|
|
11
12
|
}
|
package/lib/app/carrier-app.js
CHANGED
|
@@ -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,72 +15,21 @@ 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
|
-
routes.push({
|
|
68
|
-
method: internal_1.Method.POST,
|
|
69
|
-
path: '/ValidateInboundData',
|
|
70
|
-
handler: handleRequest(definition.ValidateInboundData),
|
|
71
|
-
});
|
|
72
|
-
routes.push({
|
|
73
|
-
method: internal_1.Method.POST,
|
|
74
|
-
path: '/NormalizeTrackingData',
|
|
75
|
-
handler: handleRequest(definition.NormalizeTrackingData),
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
18
|
class CarrierApp {
|
|
79
19
|
constructor(definition) {
|
|
80
20
|
this.routes = [];
|
|
81
|
-
|
|
21
|
+
this.getSupportedCountries = () => {
|
|
22
|
+
const countries = [];
|
|
23
|
+
const rootCountries = definition.Metadata.Carriers.flatMap((c) => { var _a; return (_a = c.DefaultSupportedCountries) === null || _a === void 0 ? void 0 : _a.flatMap((sc) => sc.FromCountry); });
|
|
24
|
+
const serviceCountries = definition.Metadata.Carriers.flatMap((c) => {
|
|
25
|
+
var _a;
|
|
26
|
+
return (_a = c.ShippingServices) === null || _a === void 0 ? void 0 : _a.flatMap((s) => s.SupportedCountries).flatMap((sc) => sc === null || sc === void 0 ? void 0 : sc.FromCountry);
|
|
27
|
+
});
|
|
28
|
+
countries.push(...rootCountries);
|
|
29
|
+
countries.push(...serviceCountries);
|
|
30
|
+
const uniqueCountries = [...new Set(countries)].filter((c) => c !== undefined);
|
|
31
|
+
return uniqueCountries;
|
|
32
|
+
};
|
|
82
33
|
this.validate = () => {
|
|
83
34
|
const results = metadata_2.CarrierAppMetadataSchema.validate(definition.Metadata, {
|
|
84
35
|
allowUnknown: true,
|
|
@@ -88,6 +39,83 @@ class CarrierApp {
|
|
|
88
39
|
return results.error.details.map((detail) => `${detail.message}`);
|
|
89
40
|
}
|
|
90
41
|
};
|
|
42
|
+
new Array([
|
|
43
|
+
internal_1.Method.POST,
|
|
44
|
+
constants_1.ApiEndpoints.CancelNotification,
|
|
45
|
+
definition.CancelNotification,
|
|
46
|
+
responses_1.CancelNotificationResponseSchema,
|
|
47
|
+
], [
|
|
48
|
+
internal_1.Method.POST,
|
|
49
|
+
constants_1.ApiEndpoints.CancelPickup,
|
|
50
|
+
definition.CancelPickup,
|
|
51
|
+
responses_1.CancelPickupResponseSchema,
|
|
52
|
+
], [
|
|
53
|
+
internal_1.Method.POST,
|
|
54
|
+
constants_1.ApiEndpoints.CreateLabel,
|
|
55
|
+
definition.CreateLabel,
|
|
56
|
+
responses_1.CreateLabelResponseSchema,
|
|
57
|
+
], [
|
|
58
|
+
internal_1.Method.POST,
|
|
59
|
+
constants_1.ApiEndpoints.CreateManifest,
|
|
60
|
+
definition.CreateManifest,
|
|
61
|
+
responses_1.CreateManifestResponseSchema,
|
|
62
|
+
], [
|
|
63
|
+
internal_1.Method.POST,
|
|
64
|
+
constants_1.ApiEndpoints.CreateNotification,
|
|
65
|
+
definition.CreateNotification,
|
|
66
|
+
responses_1.CreateNotificationResponseSchema,
|
|
67
|
+
], [
|
|
68
|
+
internal_1.Method.POST,
|
|
69
|
+
constants_1.ApiEndpoints.GetRates,
|
|
70
|
+
definition.GetRates,
|
|
71
|
+
responses_1.GetRatesResponseSchema,
|
|
72
|
+
], [
|
|
73
|
+
internal_1.Method.POST,
|
|
74
|
+
constants_1.ApiEndpoints.NormalizeTrackingData,
|
|
75
|
+
definition.NormalizeTrackingData,
|
|
76
|
+
responses_1.NormalizeTrackingDataResponseSchema,
|
|
77
|
+
], [
|
|
78
|
+
internal_1.Method.POST,
|
|
79
|
+
constants_1.ApiEndpoints.Register,
|
|
80
|
+
definition.Register,
|
|
81
|
+
responses_1.RegisterResponseSchema,
|
|
82
|
+
], [
|
|
83
|
+
internal_1.Method.POST,
|
|
84
|
+
constants_1.ApiEndpoints.SchedulePickup,
|
|
85
|
+
definition.SchedulePickup,
|
|
86
|
+
responses_1.SchedulePickupResponseSchema,
|
|
87
|
+
], [
|
|
88
|
+
internal_1.Method.POST,
|
|
89
|
+
constants_1.ApiEndpoints.Track,
|
|
90
|
+
definition.Track,
|
|
91
|
+
responses_1.TrackingResponseSchema,
|
|
92
|
+
], [
|
|
93
|
+
internal_1.Method.POST,
|
|
94
|
+
constants_1.ApiEndpoints.ValidateInboundData,
|
|
95
|
+
definition.ValidateInboundData,
|
|
96
|
+
responses_1.ValidateInboundDataResponseSchema,
|
|
97
|
+
], [
|
|
98
|
+
internal_1.Method.POST,
|
|
99
|
+
constants_1.ApiEndpoints.VoidLabels,
|
|
100
|
+
definition.VoidLabels,
|
|
101
|
+
responses_1.VoidLabelsResponseSchema,
|
|
102
|
+
]).forEach(([method, path, implementation, schema]) => {
|
|
103
|
+
if (implementation) {
|
|
104
|
+
this.routes.push({
|
|
105
|
+
method,
|
|
106
|
+
path,
|
|
107
|
+
handler: handleRequest(implementation),
|
|
108
|
+
validateResponse: (result) => {
|
|
109
|
+
var _a, _b;
|
|
110
|
+
const validationResults = schema.validate(result, {
|
|
111
|
+
abortEarly: false,
|
|
112
|
+
});
|
|
113
|
+
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);
|
|
114
|
+
return errors;
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
});
|
|
91
119
|
this.data = new metadata_1.Metadata(definition);
|
|
92
120
|
const jsonSpecPath = path_1.resolve(__dirname, '../../spec.json');
|
|
93
121
|
const yamlSpecPath = path_1.resolve(__dirname, '../../spec.yaml');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carrier-app.js","sourceRoot":"","sources":["../../src/app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ACH,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,IAAI,mBAAQ,CAAC,UAAU,CAAC,CAAC;QAErC,MAAM,YAAY,GAAG,cAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;QAC3D,MAAM,YAAY,GAAG,cAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;QAC3D,IAAI,eAAU,CAAC,YAAY,CAAC,EAAE;YAC5B,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;AAhJD,gCAgJC"}
|
|
@@ -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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { AuthSpecification } from '../metadata/auth-specification';
|
|
1
2
|
import { ShippingProviderConnector } from '../metadata/shipping-provider-connector';
|
|
2
|
-
import { CarrierSpecification } from './carrier-
|
|
3
|
+
import { CarrierSpecification } from './carrier-specification';
|
|
3
4
|
/** @description This represents a single integration which may contain multiple carrier sources */
|
|
4
5
|
export interface CarrierAppSpecification {
|
|
5
6
|
/** @description The id for this integration */
|
|
@@ -8,6 +9,8 @@ export interface CarrierAppSpecification {
|
|
|
8
9
|
Name: string;
|
|
9
10
|
/** @description Information about the connector */
|
|
10
11
|
Connector: ShippingProviderConnector;
|
|
12
|
+
/** @description The specification for authorizing with this carrier */
|
|
13
|
+
AuthProcess?: AuthSpecification;
|
|
11
14
|
/** @description A list of carrier sources associated with this integration */
|
|
12
15
|
Carriers: CarrierSpecification[];
|
|
13
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carrier-app-specification.js","sourceRoot":"","sources":["../../../src/app/internal/carrier-app-specification.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carrier-specification.js","sourceRoot":"","sources":["../../../src/app/internal/carrier-specification.ts"],"names":[],"mappings":";;;AAoBO,MAAM,kBAAkB,GAAG,CAChC,OAAkC,EACJ,EAAE;IAChC,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,SAAS,CAAC;KAClB;IACD,MAAM,GAAG,GAAqB,EAAE,CAAC;IACjC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAW,EAAE,EAAE;QAC3C,MAAM,IAAI,GAAG,GAAyB,CAAC;QACvC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,OAAO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AAkB,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;QACtE,IAAI,CAAC,yBAAyB,GAAG,UAAU,CAAC,yBAAyB,CAAC;QACtE,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC;QACtD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QAC5C,IAAI,CAAC,wBAAwB,GAAG,4BAAoB,CAClD,UAAU,CAAC,wBAAwB,CACpC,CAAC;QACF,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC;QACtD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;IAC5C,CAAC;CACF;AA1CD,oDA0CC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { CarrierAppDefinition } from '../carrier-app-definition';
|
|
2
2
|
import { ShippingProviderConnector } from '../metadata/shipping-provider-connector';
|
|
3
|
-
import { CarrierAppSpecification } from './carrier-app-
|
|
4
|
-
import { CarrierSpecification } from './carrier-
|
|
3
|
+
import { CarrierAppSpecification } from './carrier-app-specification';
|
|
4
|
+
import { CarrierSpecification } from './carrier-specification';
|
|
5
|
+
import { AuthSpecification } from '../metadata/auth-specification';
|
|
5
6
|
export declare class Metadata implements CarrierAppSpecification {
|
|
6
7
|
Id: string;
|
|
7
8
|
Name: string;
|
|
8
9
|
Connector: ShippingProviderConnector;
|
|
10
|
+
AuthProcess?: AuthSpecification;
|
|
9
11
|
Carriers: CarrierSpecification[];
|
|
10
12
|
constructor(app: CarrierAppDefinition);
|
|
11
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Metadata = void 0;
|
|
4
|
-
const
|
|
4
|
+
const carrier_specification_1 = require("./carrier-specification");
|
|
5
5
|
const fn = (name) => ({
|
|
6
6
|
Name: name,
|
|
7
7
|
IsSandboxed: false,
|
|
@@ -38,7 +38,11 @@ class Metadata {
|
|
|
38
38
|
constructor(app) {
|
|
39
39
|
this.Id = app.Metadata.Id;
|
|
40
40
|
this.Name = app.Metadata.Name;
|
|
41
|
-
this.
|
|
41
|
+
this.AuthProcess = app.Metadata.AuthProcess;
|
|
42
|
+
if (this.AuthProcess) {
|
|
43
|
+
this.AuthProcess.Identifier.Version = '2.0';
|
|
44
|
+
}
|
|
45
|
+
this.Carriers = app.Metadata.Carriers.map((c) => new carrier_specification_1.CarrierSpecification(c));
|
|
42
46
|
this.Connector = {
|
|
43
47
|
DiagnosticRoutes: {
|
|
44
48
|
Liveness: '/diagnostics/liveness',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../src/app/internal/metadata.ts"],"names":[],"mappings":";;;AAKA,
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../src/app/internal/metadata.ts"],"names":[],"mappings":";;;AAKA,mEAA+D;AAG/D,MAAM,EAAE,GAAG,CAAC,IAAY,EAAyB,EAAE,CAAC,CAAC;IACnD,IAAI,EAAE,IAAI;IACV,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,CAAC,GAAyB,EAA2B,EAAE;IAC1E,MAAM,GAAG,GAA4B,EAAE,CAAC;IAExC,IAAI,GAAG,CAAC,QAAQ,EAAE;QAChB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;KAC1B;IAED,IAAI,GAAG,CAAC,WAAW,EAAE;QACnB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;KAC7B;IAED,IAAI,GAAG,CAAC,UAAU,EAAE;QAClB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC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EAAE,sBAAsB;aAChC;YACD,UAAU,EAAE,OAAO;YACnB,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC;SAC7B,CAAC;IACJ,CAAC;CACF;AA5BD,4BA4BC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
export declare enum AuthenticationType {
|
|
3
|
+
OAuth = "oauth"
|
|
4
|
+
}
|
|
5
|
+
export declare class AuthIdentifier {
|
|
6
|
+
AuthenticationType: AuthenticationType;
|
|
7
|
+
Version?: string;
|
|
8
|
+
IsSandbox?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const AuthIdentifierSchema: Joi.ObjectSchema<any>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthIdentifierSchema = exports.AuthIdentifier = exports.AuthenticationType = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const joi_1 = tslib_1.__importDefault(require("joi"));
|
|
6
|
+
var AuthenticationType;
|
|
7
|
+
(function (AuthenticationType) {
|
|
8
|
+
AuthenticationType["OAuth"] = "oauth";
|
|
9
|
+
})(AuthenticationType = exports.AuthenticationType || (exports.AuthenticationType = {}));
|
|
10
|
+
class AuthIdentifier {
|
|
11
|
+
}
|
|
12
|
+
exports.AuthIdentifier = AuthIdentifier;
|
|
13
|
+
exports.AuthIdentifierSchema = joi_1.default.object({
|
|
14
|
+
AuthenticationType: joi_1.default.string().required().valid('oauth'),
|
|
15
|
+
Version: joi_1.default.string().optional(),
|
|
16
|
+
IsSandbox: joi_1.default.bool().optional(),
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=auth-identifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-identifier.js","sourceRoot":"","sources":["../../../src/app/metadata/auth-identifier.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AAEtB,IAAY,kBAEX;AAFD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;AACjB,CAAC,EAFW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAE7B;AAED,MAAa,cAAc;CAI1B;AAJD,wCAIC;AAEY,QAAA,oBAAoB,GAAG,aAAG,CAAC,MAAM,CAAC;IAC7C,kBAAkB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;IAC1D,OAAO,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,aAAG,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AuthIdentifier } from './auth-identifier';
|
|
2
|
+
import { AccessToken, AuthorizationConfiguration, Parameter, RefreshTokenConfiguration, RequestTokenConfiguration } from './monoauth';
|
|
3
|
+
import Joi from 'joi';
|
|
4
|
+
/** @description Used to specify information about an integrations authentication */
|
|
5
|
+
export declare class AuthSpecification {
|
|
6
|
+
/** @description Identify the type of Auth being used by the integration */
|
|
7
|
+
Identifier: AuthIdentifier;
|
|
8
|
+
/** @description Added to allow oauth 1.0 to work. */
|
|
9
|
+
access_token?: AccessToken;
|
|
10
|
+
/** @description Authorization: the beginning of an OAuth2.0 flow that ensures the user is logged in and approves access to the Resource. */
|
|
11
|
+
authorization?: AuthorizationConfiguration;
|
|
12
|
+
/** @description Request Token: server-server code for token exchange */
|
|
13
|
+
request_token?: RequestTokenConfiguration;
|
|
14
|
+
/** @description Refresh Token: server-server refresh token exchange for access token **NOTE: sometimes a new RT is also created** */
|
|
15
|
+
refresh_token?: RefreshTokenConfiguration;
|
|
16
|
+
/** @description Advanced configurations used for oauth 1.0 */
|
|
17
|
+
advanced_configuration?: Parameter[];
|
|
18
|
+
}
|
|
19
|
+
export declare const AuthSpecificationSchema: Joi.ObjectSchema<any>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthSpecificationSchema = exports.AuthSpecification = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const auth_identifier_1 = require("./auth-identifier");
|
|
6
|
+
const monoauth_1 = require("./monoauth");
|
|
7
|
+
const joi_1 = tslib_1.__importDefault(require("joi"));
|
|
8
|
+
/** @description Used to specify information about an integrations authentication */
|
|
9
|
+
class AuthSpecification {
|
|
10
|
+
}
|
|
11
|
+
exports.AuthSpecification = AuthSpecification;
|
|
12
|
+
exports.AuthSpecificationSchema = joi_1.default.object({
|
|
13
|
+
Identifier: auth_identifier_1.AuthIdentifierSchema,
|
|
14
|
+
access_token: monoauth_1.AccessTokenSchema.optional(),
|
|
15
|
+
authorization: monoauth_1.AuthorizationConfigurationSchema.optional(),
|
|
16
|
+
request_token: monoauth_1.RequestTokenConfigurationSchema.optional(),
|
|
17
|
+
refresh_token: monoauth_1.RefreshTokenConfigurationSchema.optional(),
|
|
18
|
+
advanced_configuration: joi_1.default.array().optional().items(monoauth_1.ParameterSchema),
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=auth-specification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-specification.js","sourceRoot":"","sources":["../../../src/app/metadata/auth-specification.ts"],"names":[],"mappings":";;;;AAAA,uDAAyE;AACzE,yCAWoB;AACpB,sDAAsB;AAEtB,oFAAoF;AACpF,MAAa,iBAAiB;CAa7B;AAbD,8CAaC;AAEY,QAAA,uBAAuB,GAAG,aAAG,CAAC,MAAM,CAAC;IAChD,UAAU,EAAE,sCAAoB;IAChC,YAAY,EAAE,4BAAiB,CAAC,QAAQ,EAAE;IAC1C,aAAa,EAAE,2CAAgC,CAAC,QAAQ,EAAE;IAC1D,aAAa,EAAE,0CAA+B,CAAC,QAAQ,EAAE;IACzD,aAAa,EAAE,0CAA+B,CAAC,QAAQ,EAAE;IACzD,sBAAsB,EAAE,aAAG,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,0BAAe,CAAC;CACtE,CAAC,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
|
-
import { Carrier } from '
|
|
2
|
+
import { AuthSpecification, Carrier } from '.';
|
|
3
3
|
export interface CarrierAppMetadata {
|
|
4
4
|
/** @description Id of the carrier app */
|
|
5
5
|
Id: string;
|
|
6
6
|
/** @description Name of the carrier */
|
|
7
7
|
Name: string;
|
|
8
|
+
/** @description The specification for authorizing with this order source */
|
|
9
|
+
AuthProcess?: AuthSpecification;
|
|
8
10
|
/** @description List of carriers for the app */
|
|
9
11
|
Carriers: Carrier[];
|
|
10
12
|
}
|
|
@@ -3,17 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CarrierAppMetadataSchema = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const joi_1 = tslib_1.__importDefault(require("joi"));
|
|
6
|
-
const
|
|
6
|
+
const _1 = require(".");
|
|
7
7
|
exports.CarrierAppMetadataSchema = joi_1.default.object({
|
|
8
8
|
Id: joi_1.default.string()
|
|
9
9
|
.uuid({ version: ['uuidv4'] })
|
|
10
10
|
.required(),
|
|
11
11
|
Name: joi_1.default.string().required(),
|
|
12
|
+
AuthProcess: _1.AuthSpecificationSchema.optional(),
|
|
12
13
|
Carriers: joi_1.default.array()
|
|
13
14
|
.unique('Id')
|
|
14
15
|
.required()
|
|
15
16
|
.min(1)
|
|
16
17
|
.message('There must be at least 1 Carrier defined')
|
|
17
|
-
.items(
|
|
18
|
+
.items(_1.CarrierSchema),
|
|
18
19
|
});
|
|
19
20
|
//# sourceMappingURL=carrier-app-metadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carrier-app-metadata.js","sourceRoot":"","sources":["../../../src/app/metadata/carrier-app-metadata.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AACtB,
|
|
1
|
+
{"version":3,"file":"carrier-app-metadata.js","sourceRoot":"","sources":["../../../src/app/metadata/carrier-app-metadata.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AACtB,wBAKW;AAaE,QAAA,wBAAwB,GAAG,aAAG,CAAC,MAAM,CAAC;IACjD,EAAE,EAAE,aAAG,CAAC,MAAM,EAAE;SACb,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;SAC7B,QAAQ,EAAE;IACb,IAAI,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,WAAW,EAAE,0BAAuB,CAAC,QAAQ,EAAE;IAC/C,QAAQ,EAAE,aAAG,CAAC,KAAK,EAAE;SAClB,MAAM,CAAC,IAAI,CAAC;SACZ,QAAQ,EAAE;SACV,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,CAAC,0CAA0C,CAAC;SACnD,KAAK,CAAC,gBAAa,CAAC;CACxB,CAAC,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './account-modals';
|
|
2
|
+
export * from './auth-identifier';
|
|
3
|
+
export * from './auth-specification';
|
|
4
|
+
export * from './carrier';
|
|
2
5
|
export * from './carrier-app-metadata';
|
|
3
6
|
export * from './carrier-attributes';
|
|
4
|
-
export * from './carrier';
|
|
5
7
|
export * from './confirmation-type';
|
|
6
8
|
export * from './country-association';
|
|
7
9
|
export * from './diagnostic-routes';
|
|
@@ -9,6 +11,7 @@ export * from './enums';
|
|
|
9
11
|
export * from './function';
|
|
10
12
|
export * from './label-formats';
|
|
11
13
|
export * from './label-sizes';
|
|
14
|
+
export * from './monoauth';
|
|
12
15
|
export * from './package-type';
|
|
13
16
|
export * from './service-class';
|
|
14
17
|
export * from './service-grade';
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./account-modals"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./auth-identifier"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./auth-specification"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./carrier"), exports);
|
|
5
8
|
tslib_1.__exportStar(require("./carrier-app-metadata"), exports);
|
|
6
9
|
tslib_1.__exportStar(require("./carrier-attributes"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./carrier"), exports);
|
|
8
10
|
tslib_1.__exportStar(require("./confirmation-type"), exports);
|
|
9
11
|
tslib_1.__exportStar(require("./country-association"), exports);
|
|
10
12
|
tslib_1.__exportStar(require("./diagnostic-routes"), exports);
|
|
@@ -12,6 +14,7 @@ tslib_1.__exportStar(require("./enums"), exports);
|
|
|
12
14
|
tslib_1.__exportStar(require("./function"), exports);
|
|
13
15
|
tslib_1.__exportStar(require("./label-formats"), exports);
|
|
14
16
|
tslib_1.__exportStar(require("./label-sizes"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./monoauth"), exports);
|
|
15
18
|
tslib_1.__exportStar(require("./package-type"), exports);
|
|
16
19
|
tslib_1.__exportStar(require("./service-class"), exports);
|
|
17
20
|
tslib_1.__exportStar(require("./service-grade"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app/metadata/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app/metadata/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,4DAAkC;AAClC,+DAAqC;AACrC,oDAA0B;AAC1B,iEAAuC;AACvC,+DAAqC;AACrC,8DAAoC;AACpC,gEAAsC;AACtC,8DAAoC;AACpC,kDAAwB;AACxB,qDAA2B;AAC3B,0DAAgC;AAChC,wDAA8B;AAC9B,qDAA2B;AAC3B,yDAA+B;AAC/B,0DAAgC;AAChC,0DAAgC;AAChC,wEAA8C;AAC9C,gEAAsC;AACtC,4DAAkC;AAClC,wEAA8C;AAC9C,6DAAmC"}
|