Skip to content

Commit 2a8cfb0

Browse files
committed
feat: update GLS function identifiers and display messages for consistency and clarity
1 parent 12a75a0 commit 2a8cfb0

7 files changed

Lines changed: 58 additions & 50 deletions

actions/gls-action/src/functions/utils/createAddressFunction.ts

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,95 @@
11
import {
2-
Description, DisplayIcon,
2+
Description,
3+
DisplayIcon,
34
DisplayMessage,
45
Documentation,
56
Identifier,
67
Name,
78
Parameter,
89
Signature,
910
} from "@code0-tech/hercules";
10-
import { Address } from "../../data_types/glsAddress.js";
11+
import {Address} from "../../data_types/glsAddress.js";
1112

1213
@Identifier("createAddress")
1314
@Signature("(Name1: string, CountryCode: string, City: string, Street: string, ZIPCode: string, Name2?: string, Name3?: string, Province?: string, StreetNumber?: string, ContactPerson?: string, FixedLinePhonenumber?: string, MobilePhoneNumber?: string, Email?: string): GLS_ADDRESS")
14-
@Name({ code: "en-US", content: "Create address" })
15-
@DisplayIcon("tabler:truck-delivery")
16-
@DisplayMessage({ code: "en-US", content: "Create address for ${Name1}" })
15+
@Name({code: "en-US", content: "Create GLS address object"})
16+
@DisplayIcon("codezero:gls")
17+
@DisplayMessage({code: "en-US", content: "Create GLS address object for ${Name1}"})
1718
@Documentation({
1819
code: "en-US",
1920
content: "Creates a GLS address object (`GLS_ADDRESS`) for use in shipments as consignee, shipper, or return address.",
2021
})
21-
@Description({ code: "en-US", content: "Creates a GLS address object which can be used for shipments." })
22+
@Description({code: "en-US", content: "Creates a GLS address object which can be used for shipments."})
2223
@Parameter({
2324
runtimeName: "Name1",
24-
name: [{ code: "en-US", content: "Name 1" }],
25-
description: [{ code: "en-US", content: "The name of the recipient or company. Max length is 40 characters." }],
25+
name: [{code: "en-US", content: "Name 1"}],
26+
description: [{code: "en-US", content: "The name of the recipient or company. Max length is 40 characters."}],
2627
})
2728
@Parameter({
2829
runtimeName: "CountryCode",
29-
name: [{ code: "en-US", content: "Country code" }],
30-
description: [{ code: "en-US", content: "The ISO alpha-2 country code. For example, DE for Germany or FR for France." }],
30+
name: [{code: "en-US", content: "Country code"}],
31+
description: [{
32+
code: "en-US",
33+
content: "The ISO alpha-2 country code. For example, DE for Germany or FR for France."
34+
}],
3135
})
3236
@Parameter({
3337
runtimeName: "City",
34-
name: [{ code: "en-US", content: "City" }],
35-
description: [{ code: "en-US", content: "The city of the address. Max length is 40 characters." }],
38+
name: [{code: "en-US", content: "City"}],
39+
description: [{code: "en-US", content: "The city of the address. Max length is 40 characters."}],
3640
})
3741
@Parameter({
3842
runtimeName: "Street",
39-
name: [{ code: "en-US", content: "Street" }],
40-
description: [{ code: "en-US", content: "The street name of the address. Min length is 4 characters." }],
43+
name: [{code: "en-US", content: "Street"}],
44+
description: [{code: "en-US", content: "The street name of the address. Min length is 4 characters."}],
4145
})
4246
@Parameter({
4347
runtimeName: "ZIPCode",
44-
name: [{ code: "en-US", content: "ZIP code" }],
45-
description: [{ code: "en-US", content: "The ZIP code of the address. Max length is 10 characters." }],
48+
name: [{code: "en-US", content: "ZIP code"}],
49+
description: [{code: "en-US", content: "The ZIP code of the address. Max length is 10 characters."}],
4650
})
4751
@Parameter({
4852
runtimeName: "Name2",
49-
name: [{ code: "en-US", content: "Name 2" }],
50-
description: [{ code: "en-US", content: "Additional name information. Max length is 40 characters." }],
53+
name: [{code: "en-US", content: "Name 2"}],
54+
description: [{code: "en-US", content: "Additional name information. Max length is 40 characters."}],
5155
})
5256
@Parameter({
5357
runtimeName: "Name3",
54-
name: [{ code: "en-US", content: "Name 3" }],
55-
description: [{ code: "en-US", content: "Additional name information. Max length is 40 characters." }],
58+
name: [{code: "en-US", content: "Name 3"}],
59+
description: [{code: "en-US", content: "Additional name information. Max length is 40 characters."}],
5660
})
5761
@Parameter({
5862
runtimeName: "Province",
59-
name: [{ code: "en-US", content: "Province/State" }],
60-
description: [{ code: "en-US", content: "The province or state of the address. Max length is 40 characters." }],
63+
name: [{code: "en-US", content: "Province/State"}],
64+
description: [{code: "en-US", content: "The province or state of the address. Max length is 40 characters."}],
6165
})
6266
@Parameter({
6367
runtimeName: "StreetNumber",
64-
name: [{ code: "en-US", content: "Street number" }],
65-
description: [{ code: "en-US", content: "The street number of the address. Max length is 40 characters." }],
68+
name: [{code: "en-US", content: "Street number"}],
69+
description: [{code: "en-US", content: "The street number of the address. Max length is 40 characters."}],
6670
})
6771
@Parameter({
6872
runtimeName: "ContactPerson",
69-
name: [{ code: "en-US", content: "Contact person" }],
70-
description: [{ code: "en-US", content: "The contact person for the address. Max length is 40 characters." }],
73+
name: [{code: "en-US", content: "Contact person"}],
74+
description: [{code: "en-US", content: "The contact person for the address. Max length is 40 characters."}],
7175
})
7276
@Parameter({
7377
runtimeName: "FixedLinePhonenumber",
74-
name: [{ code: "en-US", content: "Fixed line phone number" }],
75-
description: [{ code: "en-US", content: "The fixed line phone number for the address. Max length is 35 characters." }],
78+
name: [{code: "en-US", content: "Fixed line phone number"}],
79+
description: [{
80+
code: "en-US",
81+
content: "The fixed line phone number for the address. Max length is 35 characters."
82+
}],
7683
})
7784
@Parameter({
7885
runtimeName: "MobilePhoneNumber",
79-
name: [{ code: "en-US", content: "Mobile phone number" }],
80-
description: [{ code: "en-US", content: "The mobile phone number for the address. Max length is 35 characters." }],
86+
name: [{code: "en-US", content: "Mobile phone number"}],
87+
description: [{code: "en-US", content: "The mobile phone number for the address. Max length is 35 characters."}],
8188
})
8289
@Parameter({
8390
runtimeName: "Email",
84-
name: [{ code: "en-US", content: "Email" }],
85-
description: [{ code: "en-US", content: "The email address for the address. Max length is 80 characters." }],
91+
name: [{code: "en-US", content: "Email"}],
92+
description: [{code: "en-US", content: "The email address for the address. Max length is 80 characters."}],
8693
})
8794
export class CreateAddressFunction {
8895
run(

actions/gls-action/src/functions/utils/createConsigneeFunction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import {Consignee} from "../../data_types/glsConsignee.js";
1313

1414
@Identifier("createConsignee")
1515
@Signature("(Address: GLS_ADDRESS, ConsigneeID?: string, CostCenter?: string, Category?: \"BUSINESS\"|\"PRIVATE\"): GLS_CONSIGNEE")
16-
@Name({code: "en-US", content: "Create consignee for shipment"})
17-
@DisplayIcon("tabler:truck-delivery")
18-
@DisplayMessage({code: "en-US", content: "Create consignee for shipment"})
16+
@Name({code: "en-US", content: "Create GLS consignee object"})
17+
@DisplayIcon("codezero:gls")
18+
@DisplayMessage({code: "en-US", content: "Create GLS consignee object with address ${Address}"})
1919
@Documentation({
2020
code: "en-US",
2121
content: "Creates a GLS consignee (recipient) object for use in shipments.",

actions/gls-action/src/functions/utils/createCustomContentFunction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import {CustomContent} from "../../data_types/glsCustomContent.js";
1212

1313
@Identifier("createCustomContent")
1414
@Signature("(barcodeContentType: \"TRACK_ID\"|\"GLS_SHIPMENT_REFERENCE\", customerLogo: string, hideShipperAddress?: boolean, barcodeType?: \"EAN_128\"|\"CODE_39\", barcode?: string): GLS_CUSTOM_CONTENT")
15-
@Name({code: "en-US", content: "Create custom content"})
16-
@DisplayIcon("tabler:truck-delivery")
17-
@DisplayMessage({code: "en-US", content: "Create custom content"})
15+
@Name({code: "en-US", content: "Create GLS custom label content"})
16+
@DisplayIcon("codezero:gls")
17+
@DisplayMessage({code: "en-US", content: "Create GLS custom label content"})
1818
@Documentation({
1919
code: "en-US",
2020
content: "Creates custom content settings for GLS labels, including logos and barcodes.",

actions/gls-action/src/functions/utils/createPrintingOptionsFunction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import {PrintingOptions} from "../../data_types/glsPrintingOptions.js";
1212

1313
@Identifier("createPrintingOptions")
1414
@Signature("(TemplateSet?: \"NONE\"|\"D_200\"|\"PF_4_I\"|\"PF_4_I_200\"|\"PF_4_I_300\"|\"PF_8_D_200\"|\"T_200_BF\"|\"T_300_BF\"|\"ZPL_200\"|\"ZPL_200_TRACKID_EAN_128\"|\"ZPL_200_TRACKID_CODE_39\"|\"ZPL_200_REFNO_EAN_128\"|\"ZPL_200_REFNO_CODE_39\"|\"ZPL_300\"|\"ZPL_300_TRACKID_EAN_128\"|\"ZPL_300_TRACKID_CODE_39\"|\"ZPL_300_REFNO_EAN_128\"|\"ZPL_300_REFNO_CODE_39\", LabelFormat?: \"PDF\"|\"ZEBRA\"|\"INTERMEC\"|\"DATAMAX\"|\"TOSHIBA\"|\"PNG\", UseDefault?: string, LabelPrinter?: string, DocumentPrinter?: string): GLS_PRINTING_OPTIONS")
15-
@Name({code: "en-US", content: "Create printing options"})
16-
@DisplayIcon("tabler:truck-delivery")
17-
@DisplayMessage({code: "en-US", content: "Create printing settings in format {TemplateSet} as {LabelFormat}"})
15+
@Name({code: "en-US", content: "Create GLS printing settings"})
16+
@DisplayIcon("codezero:gls")
17+
@DisplayMessage({code: "en-US", content: "Create GLS printing settings in format ${TemplateSet} as ${LabelFormat}"})
1818
@Documentation({
1919
code: "en-US",
2020
content: "Creates a GLS printing options object that controls how shipment labels are generated and printed.",

actions/gls-action/src/functions/utils/createShipmentFunction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import {ShipmentWithoutServices} from "../../data_types/glsShipment.js";
1515

1616
@Identifier("createShipment")
1717
@Signature("(Consignee: GLS_CONSIGNEE, ShipmentUnit: GLS_SHIPMENT_UNIT, Product?: \"PARCEL\"|\"EXPRESS\", ShipmentReference?: string, ShippingDate?: string, IncotermCode?: number, Identifier?: string, ExpressAltDeliveryAllowed?: boolean, Shipper?: GLS_SHIPPER, Carrier?: \"ROYALMAIL\", Return?: GLS_ADDRESS): GLS_SHIPMENT_WITHOUT_SERVICES")
18-
@Name({code: "en-US", content: "Create parcel shipment"})
19-
@DisplayIcon("tabler:truck-delivery")
20-
@DisplayMessage({code: "en-US", content: "Create parcel shipment"})
18+
@Name({code: "en-US", content: "Create GLS shipment object"})
19+
@DisplayIcon("codezero:gls")
20+
@DisplayMessage({code: "en-US", content: "Create GLS shipment to consignee ${Consignee}"})
2121
@Documentation({
2222
code: "en-US",
2323
content: "Creates a GLS shipment object without services for use with the create shipment functions.",

actions/gls-action/src/functions/utils/createShipmentUnitFunction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import {ShipmentUnit} from "../../data_types/glsShipmentUnit.js";
1313

1414
@Identifier("createShipmentUnit")
1515
@Signature("(weight: number, shipmentUnitReference?: string, partnerParcelNumber?: string, note1?: string, note2?: string, shipmentUnitService?: GLS_UNIT_SERVICE): GLS_SHIPMENT_UNIT")
16-
@Name({code: "en-US", content: "Create parcel shipment unit"})
17-
@DisplayIcon("tabler:truck-delivery")
18-
@DisplayMessage({code: "en-US", content: "Create parcel shipment unit"})
16+
@Name({code: "en-US", content: "Create GLS shipment unit object"})
17+
@DisplayIcon("codezero:gls")
18+
@DisplayMessage({code: "en-US", content: "Create GLS shipment unit object of weight ${weight}"})
1919
@Documentation({
2020
code: "en-US",
2121
content: "Creates a GLS shipment unit (an individual parcel within a shipment).",

actions/gls-action/src/functions/utils/createShipperFunction.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ import {
1010
} from "@code0-tech/hercules";
1111
import {Address} from "../../data_types/glsAddress.js";
1212
import {ShipperSchemaType} from "../../data_types/glsShipper.js";
13+
//TODO missing possibility to add contactId
1314

1415
@Identifier("createShipper")
1516
@Signature("(Address?: GLS_ADDRESS, AlternativeShipperAddress?: GLS_ADDRESS): GLS_SHIPPER")
16-
@Name({code: "en-US", content: "Create shipper for shipment"})
17-
@DisplayIcon("tabler:truck-delivery")
18-
@DisplayMessage({code: "en-US", content: "Create shipper for shipment"})
17+
@Name({code: "en-US", content: "Create GLS shipper object"})
18+
@DisplayIcon("codezero:gls")
19+
@DisplayMessage({code: "en-US", content: "Create GLS shipper object"})
1920
@Documentation({
2021
code: "en-US",
2122
content: "Creates a GLS shipper object for use in shipments.",

0 commit comments

Comments
 (0)