-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateCustomContentFunction.ts
More file actions
76 lines (75 loc) · 2.55 KB
/
Copy pathcreateCustomContentFunction.ts
File metadata and controls
76 lines (75 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import {
Description,
DisplayIcon,
DisplayMessage,
Documentation,
Identifier,
Name,
Parameter,
Signature,
} from "@code0-tech/hercules";
import {CustomContent} from "../../data_types/glsCustomContent.js";
@Identifier("createCustomContent")
@Signature("(barcodeContentType?: \"TRACK_ID\"|\"GLS_SHIPMENT_REFERENCE\", customerLogo?: string, hideShipperAddress?: boolean, barcodeType?: \"EAN_128\"|\"CODE_39\", barcode?: string): GLS_CUSTOM_CONTENT")
@Name({code: "en-US", content: "Create GLS custom label content"})
@DisplayIcon("codezero:gls")
@DisplayMessage({code: "en-US", content: "Create GLS custom label content"})
@Documentation({
code: "en-US",
content: "Creates custom content settings for GLS labels, including logos and barcodes.",
})
@Description({
code: "en-US",
content: "Creates a GLS custom content object for shipment labels.",
})
@Parameter({
runtimeName: "barcodeContentType",
optional: true,
name: [{code: "en-US", content: "Barcode content type"}],
description: [{
code: "en-US",
content: "Type of content encoded in the barcode (TRACK_ID or GLS_SHIPMENT_REFERENCE)."
}],
})
@Parameter({
runtimeName: "customerLogo",
optional: true,
name: [{code: "en-US", content: "Customer logo"}],
description: [{code: "en-US", content: "Base64-encoded customer logo to print on the label."}],
})
@Parameter({
runtimeName: "hideShipperAddress",
optional: true,
name: [{code: "en-US", content: "Hide shipper address"}],
description: [{code: "en-US", content: "Whether to hide the shipper address on the label."}],
})
@Parameter({
runtimeName: "barcodeType",
optional: true,
name: [{code: "en-US", content: "Barcode type"}],
description: [{code: "en-US", content: "Type of barcode to use (EAN_128 or CODE_39)."}],
})
@Parameter({
runtimeName: "barcode",
optional: true,
name: [{code: "en-US", content: "Barcode"}],
description: [{code: "en-US", content: "Barcode value to print on the label."}],
})
export class CreateCustomContentFunction {
run(
_context: unknown,
barcodeContentType?: CustomContent["BarcodeContentType"],
customerLogo?: string,
hideShipperAddress?: boolean,
barcodeType?: CustomContent["BarcodeType"],
barcode?: string
): CustomContent {
return {
Barcode: barcode,
BarcodeContentType: barcodeContentType,
BarcodeType: barcodeType,
CustomerLogo: customerLogo,
HideShipperAddress: hideShipperAddress,
};
}
}