@shipengine/connect-carrier-api 4.1.2 → 4.1.4-beta
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/metadata/carrier.d.ts +3 -0
- package/lib/app/metadata/carrier.js +2 -0
- package/lib/app/metadata/carrier.js.map +1 -1
- package/lib/app/metadata/native-rating-configuration.d.ts +1 -1
- package/lib/app/metadata/native-rating-configuration.js +1 -1
- package/lib/app/metadata/zone.d.ts +11 -0
- package/lib/app/metadata/zone.js +12 -0
- package/lib/app/metadata/zone.js.map +1 -0
- package/lib/models/dangerous-good/dangerous-goods.d.ts +2 -1
- package/lib/models/dangerous-good/dangerous-goods.js.map +1 -1
- package/lib/models/dangerous-good/transport-mean-types.d.ts +2 -2
- package/lib/models/dangerous-good/transport-mean-types.js +2 -2
- package/lib/models/dangerous-good/transport-mean-types.js.map +1 -1
- package/lib/models/dangerous-good/weight-details.d.ts +7 -0
- package/lib/models/dangerous-good/weight-details.js +12 -0
- package/lib/models/dangerous-good/weight-details.js.map +1 -0
- package/package.json +1 -1
- package/spec.json +21 -5
- package/src/app/metadata/carrier.ts +4 -0
- package/src/app/metadata/native-rating-configuration.ts +2 -2
- package/src/app/metadata/zone.ts +18 -0
- package/src/models/dangerous-good/dangerous-goods.ts +2 -1
- package/src/models/dangerous-good/transport-mean-types.ts +2 -2
- package/src/models/dangerous-good/weight-details.ts +7 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -9,6 +9,7 @@ import { LabelSizesEnum } from './label-sizes';
|
|
|
9
9
|
import { ConfirmationDictionary } from './confirmation-type';
|
|
10
10
|
import Joi from 'joi';
|
|
11
11
|
import { NativeRatingConfiguration } from './native-rating-configuration';
|
|
12
|
+
import { Zone } from './zone';
|
|
12
13
|
/** @description Basic structure for each carrier */
|
|
13
14
|
export interface Carrier {
|
|
14
15
|
/** @description Defines UI Modals for connecting and updating settings */
|
|
@@ -52,5 +53,7 @@ export interface Carrier {
|
|
|
52
53
|
NativeRating?: NativeRatingConfiguration;
|
|
53
54
|
/** @description This is the file path to the documents template, which is used by Rendering Service. Optional. If it's filled and template file provided, ApiCode must be filled. ApiCode will be used to identify the file in Rendering Service.*/
|
|
54
55
|
DocumentTemplate?: string;
|
|
56
|
+
/** @description List of possible zones used by the carrier. */
|
|
57
|
+
Zones?: Zone;
|
|
55
58
|
}
|
|
56
59
|
export declare const CarrierSchema: Joi.ObjectSchema<any>;
|
|
@@ -14,6 +14,7 @@ const confirmation_type_1 = require("./confirmation-type");
|
|
|
14
14
|
const joi_1 = tslib_1.__importDefault(require("joi"));
|
|
15
15
|
const native_rating_configuration_1 = require("./native-rating-configuration");
|
|
16
16
|
const file_exists_1 = require("./custom-validators/file-exists");
|
|
17
|
+
const zone_1 = require("./zone");
|
|
17
18
|
const connect_runtime_1 = require("@shipengine/connect-runtime");
|
|
18
19
|
exports.CarrierSchema = joi_1.default.object({
|
|
19
20
|
AccountModals: account_modals_1.AccountModalsSchema.required(),
|
|
@@ -56,5 +57,6 @@ exports.CarrierSchema = joi_1.default.object({
|
|
|
56
57
|
.custom(file_exists_1.fileExists, 'template exists')
|
|
57
58
|
.pattern(new RegExp('^.*.carrier$'))
|
|
58
59
|
.message('Template file must have .carrier extension.'),
|
|
60
|
+
Zones: joi_1.default.array().optional().items(zone_1.ZoneSchema).unique('ApiCode'),
|
|
59
61
|
}).with('DocumentTemplate', 'ApiCode');
|
|
60
62
|
//# sourceMappingURL=carrier.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carrier.js","sourceRoot":"","sources":["../../../src/app/metadata/carrier.ts"],"names":[],"mappings":";;;;AAAA,qDAAsE;AACtE,iDAAgE;AAChE,yDAA4E;AAC5E,uDAA6F;AAC7F,+DAAqF;AACrF,6DAAwF;AACxF,mDAA2E;AAC3E,+CAAqE;AACrE,2DAA2F;AAC3F,sDAAsB;AACtB,+EAGuC;AACvC,iEAA6D;
|
|
1
|
+
{"version":3,"file":"carrier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AI,MAAM,CAAC,cAAc,CAAC,CAAC;SACnC,OAAO,CAAC,6CAA6C,CAAC;IACzD,KAAK,EAAE,aAAG,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,iBAAU,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;CAClE,CAAC,CAAC,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { RateCard } from './rate-card';
|
|
|
3
3
|
/** Configuration for attaching Native Rating to a carrier */
|
|
4
4
|
export interface NativeRatingConfiguration {
|
|
5
5
|
/** @description Default rate card to use for rating */
|
|
6
|
-
DefaultRateCardId
|
|
6
|
+
DefaultRateCardId?: string;
|
|
7
7
|
/** Path to rating logic and rate card data for this carrier */
|
|
8
8
|
Path?: string;
|
|
9
9
|
/** Array of rate cards for the carrier */
|
|
@@ -6,7 +6,7 @@ const joi_1 = tslib_1.__importDefault(require("joi"));
|
|
|
6
6
|
const file_exists_1 = require("./custom-validators/file-exists");
|
|
7
7
|
const rate_card_1 = require("./rate-card");
|
|
8
8
|
exports.NativeRatingConfigurationSchema = joi_1.default.object({
|
|
9
|
-
DefaultRateCardId: joi_1.default.string().
|
|
9
|
+
DefaultRateCardId: joi_1.default.string().optional(),
|
|
10
10
|
Path: joi_1.default.string().optional().custom(file_exists_1.fileExists, 'implementation path exists'),
|
|
11
11
|
RateCards: joi_1.default.array().optional().items(rate_card_1.RateCardSchema).unique('Id'),
|
|
12
12
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
/** @description Basic details about a carrier zone */
|
|
3
|
+
export interface Zone {
|
|
4
|
+
/** @description The name of this zone ex: '1' or 'EU-3' */
|
|
5
|
+
Name: string;
|
|
6
|
+
/** @description This is a human readable description about what the zone is */
|
|
7
|
+
Description?: string;
|
|
8
|
+
/** @description The identifier for this zone that could be used for rating keys. Must be snake cased and unique */
|
|
9
|
+
ApiCode: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const ZoneSchema: Joi.ObjectSchema<any>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZoneSchema = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const joi_1 = tslib_1.__importDefault(require("joi"));
|
|
6
|
+
const connect_runtime_1 = require("@shipengine/connect-runtime");
|
|
7
|
+
exports.ZoneSchema = joi_1.default.object({
|
|
8
|
+
Name: joi_1.default.string().required().max(50),
|
|
9
|
+
Description: joi_1.default.string().optional().max(500),
|
|
10
|
+
ApiCode: joi_1.default.string().optional().pattern(connect_runtime_1.ApiCodeRegex, connect_runtime_1.ApiCodeValidationMessage),
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=zone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zone.js","sourceRoot":"","sources":["../../../src/app/metadata/zone.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AACtB,iEAAqF;AAYxE,QAAA,UAAU,GAAG,aAAG,CAAC,MAAM,CAAC;IACnC,IAAI,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;IACrC,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC;IAC7C,OAAO,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,8BAAY,EAAE,0CAAwB,CAAC;CACjF,CAAC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { PackageInstructionSectionTypes } from './package-instruction-section-ty
|
|
|
2
2
|
import { PackagingGroupTypes } from './packaging-group-types';
|
|
3
3
|
import { RegulationLevelTypes } from './regulation-level-types';
|
|
4
4
|
import { TransportMeanTypes } from './transport-mean-types';
|
|
5
|
+
import { DangerousAmountDetails } from './weight-details';
|
|
5
6
|
/** @description Basic structure for a dangerous goods */
|
|
6
7
|
export declare class DangerousGoods {
|
|
7
8
|
/** @description UN number to identify the dangerous goods */
|
|
@@ -17,7 +18,7 @@ export declare class DangerousGoods {
|
|
|
17
18
|
/** @description This indicates the packaging group based on the degree of danger */
|
|
18
19
|
packaging_group?: PackagingGroupTypes;
|
|
19
20
|
/** @description The amount of the dangerous goods */
|
|
20
|
-
dangerous_amount?:
|
|
21
|
+
dangerous_amount?: DangerousAmountDetails;
|
|
21
22
|
/** @description Quantity of dangerous goods */
|
|
22
23
|
quantity?: number;
|
|
23
24
|
/** @description The specific standardized packaging instructions from the relevant regulatory agency that have been applied to the parcel/container */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dangerous-goods.js","sourceRoot":"","sources":["../../../src/models/dangerous-good/dangerous-goods.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"dangerous-goods.js","sourceRoot":"","sources":["../../../src/models/dangerous-good/dangerous-goods.ts"],"names":[],"mappings":";;;AAMA,yDAAyD;AACzD,MAAa,cAAc;IACzB,6DAA6D;IAC7D,SAAS,CAAU;IACnB,4DAA4D;IAC5D,aAAa,CAAU;IACvB,4EAA4E;IAC5E,cAAc,CAAU;IACxB,qEAAqE;IACrE,aAAa,CAAU;IACvB,0GAA0G;IAC1G,wBAAwB,CAAU;IAClC,oFAAoF;IACpF,eAAe,CAAuB;IACtC,qDAAqD;IACrD,gBAAgB,CAA0B;IAC1C,+CAA+C;IAC/C,QAAQ,CAAU;IAClB,uJAAuJ;IACvJ,qBAAqB,CAAU;IAC/B,sGAAsG;IACtG,6BAA6B,CAAkC;IAC/D,qFAAqF;IACrF,cAAc,CAAU;IACxB,0FAA0F;IAC1F,cAAc,CAAsB;IACpC,0FAA0F;IAC1F,kBAAkB,CAAU;IAC5B,oDAAoD;IACpD,oBAAoB,CAAU;IAC9B,2DAA2D;IAC3D,gBAAgB,CAAwB;IACxC,8DAA8D;IAC9D,WAAW,CAAW;IACtB,kHAAkH;IAClH,mBAAmB,CAAW;IAC9B,wFAAwF;IACxF,WAAW,CAAU;IACrB,sKAAsK;IACtK,sBAAsB,CAAU;CACjC;AAvCD,wCAuCC"}
|
|
@@ -5,7 +5,7 @@ export declare enum TransportMeanTypes {
|
|
|
5
5
|
/** @description water transport */
|
|
6
6
|
Water = "water",
|
|
7
7
|
/** @description cargo aircraft only transport */
|
|
8
|
-
|
|
8
|
+
Cargo_Aircraft_Only = "cargo_aircraft_only",
|
|
9
9
|
/** @description passenger aircraft transport */
|
|
10
|
-
|
|
10
|
+
Passenger_Aircraft = "passenger_aircraft"
|
|
11
11
|
}
|
|
@@ -9,8 +9,8 @@ var TransportMeanTypes;
|
|
|
9
9
|
/** @description water transport */
|
|
10
10
|
TransportMeanTypes["Water"] = "water";
|
|
11
11
|
/** @description cargo aircraft only transport */
|
|
12
|
-
TransportMeanTypes["
|
|
12
|
+
TransportMeanTypes["Cargo_Aircraft_Only"] = "cargo_aircraft_only";
|
|
13
13
|
/** @description passenger aircraft transport */
|
|
14
|
-
TransportMeanTypes["
|
|
14
|
+
TransportMeanTypes["Passenger_Aircraft"] = "passenger_aircraft";
|
|
15
15
|
})(TransportMeanTypes = exports.TransportMeanTypes || (exports.TransportMeanTypes = {}));
|
|
16
16
|
//# sourceMappingURL=transport-mean-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport-mean-types.js","sourceRoot":"","sources":["../../../src/models/dangerous-good/transport-mean-types.ts"],"names":[],"mappings":";;;AAAA,8DAA8D;AAC9D,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,oCAAoC;IACpC,uCAAiB,CAAA;IACjB,mCAAmC;IACnC,qCAAe,CAAA;IACf,iDAAiD;IACjD,
|
|
1
|
+
{"version":3,"file":"transport-mean-types.js","sourceRoot":"","sources":["../../../src/models/dangerous-good/transport-mean-types.ts"],"names":[],"mappings":";;;AAAA,8DAA8D;AAC9D,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,oCAAoC;IACpC,uCAAiB,CAAA;IACjB,mCAAmC;IACnC,qCAAe,CAAA;IACf,iDAAiD;IACjD,iEAA2C,CAAA;IAC3C,gDAAgD;IAChD,+DAAyC,CAAA;AAC3C,CAAC,EATW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAS7B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DangerousAmountDetails = void 0;
|
|
4
|
+
/** @description This model represents the amount of the dangerous goods */
|
|
5
|
+
class DangerousAmountDetails {
|
|
6
|
+
/** @description The amount of dangerous goods */
|
|
7
|
+
amount;
|
|
8
|
+
/** @description The unit of dangerous goods */
|
|
9
|
+
unit;
|
|
10
|
+
}
|
|
11
|
+
exports.DangerousAmountDetails = DangerousAmountDetails;
|
|
12
|
+
//# sourceMappingURL=weight-details.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weight-details.js","sourceRoot":"","sources":["../../../src/models/dangerous-good/weight-details.ts"],"names":[],"mappings":";;;AAAA,2EAA2E;AAC3E,MAAa,sBAAsB;IACjC,iDAAiD;IACjD,MAAM,CAAU;IAChB,+CAA+C;IAC/C,IAAI,CAAU;CACf;AALD,wDAKC"}
|
package/package.json
CHANGED
package/spec.json
CHANGED
|
@@ -1200,8 +1200,8 @@
|
|
|
1200
1200
|
"enum": [
|
|
1201
1201
|
"ground",
|
|
1202
1202
|
"water",
|
|
1203
|
-
"
|
|
1204
|
-
"
|
|
1203
|
+
"cargo_aircraft_only",
|
|
1204
|
+
"passenger_aircraft"
|
|
1205
1205
|
],
|
|
1206
1206
|
"type": "string",
|
|
1207
1207
|
"description": "An enumeration for transport means for dangerous goods."
|
|
@@ -1875,6 +1875,24 @@
|
|
|
1875
1875
|
"type": "string",
|
|
1876
1876
|
"description": "What to do if the shipment is undeliverable."
|
|
1877
1877
|
},
|
|
1878
|
+
"DangerousAmountDetails": {
|
|
1879
|
+
"type": "object",
|
|
1880
|
+
"properties": {
|
|
1881
|
+
"amount": {
|
|
1882
|
+
"type": "number",
|
|
1883
|
+
"description": "The amount of dangerous goods.",
|
|
1884
|
+
"format": "double",
|
|
1885
|
+
"nullable": true
|
|
1886
|
+
},
|
|
1887
|
+
"unit": {
|
|
1888
|
+
"type": "string",
|
|
1889
|
+
"description": "The unit of dangerous goods.",
|
|
1890
|
+
"nullable": true
|
|
1891
|
+
}
|
|
1892
|
+
},
|
|
1893
|
+
"additionalProperties": false,
|
|
1894
|
+
"description": "This model represents the amount of the dangerous goods."
|
|
1895
|
+
},
|
|
1878
1896
|
"DimensionDetails": {
|
|
1879
1897
|
"type": "object",
|
|
1880
1898
|
"properties": {
|
|
@@ -2845,9 +2863,7 @@
|
|
|
2845
2863
|
"$ref": "#/components/schemas/PackagingGroupTypes"
|
|
2846
2864
|
},
|
|
2847
2865
|
"dangerous_amount": {
|
|
2848
|
-
"
|
|
2849
|
-
"description": "The amount of the dangerous goods.",
|
|
2850
|
-
"nullable": true
|
|
2866
|
+
"$ref": "#/components/schemas/DangerousAmountDetails"
|
|
2851
2867
|
},
|
|
2852
2868
|
"quantity": {
|
|
2853
2869
|
"type": "number",
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
NativeRatingConfigurationSchema,
|
|
14
14
|
} from './native-rating-configuration';
|
|
15
15
|
import { fileExists } from './custom-validators/file-exists';
|
|
16
|
+
import { Zone, ZoneSchema } from './zone';
|
|
16
17
|
|
|
17
18
|
import { ApiCodeRegex, ApiCodeValidationMessage } from '@shipengine/connect-runtime';
|
|
18
19
|
|
|
@@ -59,6 +60,8 @@ export interface Carrier {
|
|
|
59
60
|
NativeRating?: NativeRatingConfiguration;
|
|
60
61
|
/** @description This is the file path to the documents template, which is used by Rendering Service. Optional. If it's filled and template file provided, ApiCode must be filled. ApiCode will be used to identify the file in Rendering Service.*/
|
|
61
62
|
DocumentTemplate?: string;
|
|
63
|
+
/** @description List of possible zones used by the carrier. */
|
|
64
|
+
Zones?: Zone;
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
export const CarrierSchema = Joi.object({
|
|
@@ -106,4 +109,5 @@ export const CarrierSchema = Joi.object({
|
|
|
106
109
|
.custom(fileExists, 'template exists')
|
|
107
110
|
.pattern(new RegExp('^.*.carrier$'))
|
|
108
111
|
.message('Template file must have .carrier extension.'),
|
|
112
|
+
Zones: Joi.array().optional().items(ZoneSchema).unique('ApiCode'),
|
|
109
113
|
}).with('DocumentTemplate', 'ApiCode');
|
|
@@ -5,7 +5,7 @@ import { RateCard, RateCardSchema } from './rate-card';
|
|
|
5
5
|
/** Configuration for attaching Native Rating to a carrier */
|
|
6
6
|
export interface NativeRatingConfiguration {
|
|
7
7
|
/** @description Default rate card to use for rating */
|
|
8
|
-
DefaultRateCardId
|
|
8
|
+
DefaultRateCardId?: string;
|
|
9
9
|
/** Path to rating logic and rate card data for this carrier */
|
|
10
10
|
Path?: string;
|
|
11
11
|
/** Array of rate cards for the carrier */
|
|
@@ -13,7 +13,7 @@ export interface NativeRatingConfiguration {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export const NativeRatingConfigurationSchema = Joi.object({
|
|
16
|
-
DefaultRateCardId: Joi.string().
|
|
16
|
+
DefaultRateCardId: Joi.string().optional(),
|
|
17
17
|
Path: Joi.string().optional().custom(fileExists, 'implementation path exists'),
|
|
18
18
|
RateCards: Joi.array().optional().items(RateCardSchema).unique('Id'),
|
|
19
19
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
import { ApiCodeRegex, ApiCodeValidationMessage } from '@shipengine/connect-runtime';
|
|
3
|
+
|
|
4
|
+
/** @description Basic details about a carrier zone */
|
|
5
|
+
export interface Zone {
|
|
6
|
+
/** @description The name of this zone ex: '1' or 'EU-3' */
|
|
7
|
+
Name: string;
|
|
8
|
+
/** @description This is a human readable description about what the zone is */
|
|
9
|
+
Description?: string;
|
|
10
|
+
/** @description The identifier for this zone that could be used for rating keys. Must be snake cased and unique */
|
|
11
|
+
ApiCode: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const ZoneSchema = Joi.object({
|
|
15
|
+
Name: Joi.string().required().max(50),
|
|
16
|
+
Description: Joi.string().optional().max(500),
|
|
17
|
+
ApiCode: Joi.string().optional().pattern(ApiCodeRegex, ApiCodeValidationMessage),
|
|
18
|
+
});
|
|
@@ -2,6 +2,7 @@ import { PackageInstructionSectionTypes } from './package-instruction-section-ty
|
|
|
2
2
|
import { PackagingGroupTypes } from './packaging-group-types';
|
|
3
3
|
import { RegulationLevelTypes } from './regulation-level-types';
|
|
4
4
|
import { TransportMeanTypes } from './transport-mean-types';
|
|
5
|
+
import { DangerousAmountDetails } from './weight-details';
|
|
5
6
|
|
|
6
7
|
/** @description Basic structure for a dangerous goods */
|
|
7
8
|
export class DangerousGoods {
|
|
@@ -18,7 +19,7 @@ export class DangerousGoods {
|
|
|
18
19
|
/** @description This indicates the packaging group based on the degree of danger */
|
|
19
20
|
packaging_group?: PackagingGroupTypes;
|
|
20
21
|
/** @description The amount of the dangerous goods */
|
|
21
|
-
dangerous_amount?:
|
|
22
|
+
dangerous_amount?: DangerousAmountDetails;
|
|
22
23
|
/** @description Quantity of dangerous goods */
|
|
23
24
|
quantity?: number;
|
|
24
25
|
/** @description The specific standardized packaging instructions from the relevant regulatory agency that have been applied to the parcel/container */
|
|
@@ -5,7 +5,7 @@ export enum TransportMeanTypes {
|
|
|
5
5
|
/** @description water transport */
|
|
6
6
|
Water = 'water',
|
|
7
7
|
/** @description cargo aircraft only transport */
|
|
8
|
-
|
|
8
|
+
Cargo_Aircraft_Only = 'cargo_aircraft_only',
|
|
9
9
|
/** @description passenger aircraft transport */
|
|
10
|
-
|
|
10
|
+
Passenger_Aircraft = 'passenger_aircraft',
|
|
11
11
|
}
|