Skip to content

Commit 8568057

Browse files
authored
Merge pull request #24 from code0-tech/feat/#21
Shopify action
2 parents a280e92 + 8e6304d commit 8568057

30 files changed

Lines changed: 4443 additions & 10 deletions

.gitlab-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ include:
2121

2222
.node-actions:
2323
- gls-action
24+
- shopify-action
2425

2526
test-node:
2627
image: node:24.10.0

actions/gls-action/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

actions/gls-action/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"start": "node dist/index.js"
1313
},
1414
"dependencies": {
15-
"@code0-tech/hercules": "^1.0.2",
15+
"@code0-tech/hercules": "^1.0.3",
1616
"axios": "^1.7.7"
1717
},
1818
"devDependencies": {

actions/gls-action/src/data_types/glsCustomContent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules";
22
import { z } from "zod";
33

44
export const CustomContentSchema = z.object({
5-
CustomerLogo: z.string(),
6-
BarcodeContentType: z.enum(["TRACK_ID", "GLS_SHIPMENT_REFERENCE"]),
5+
CustomerLogo: z.string().nullish(),
6+
BarcodeContentType: z.enum(["TRACK_ID", "GLS_SHIPMENT_REFERENCE"]).nullish(),
77
Barcode: z.string().nullish(),
88
BarcodeType: z.enum(["EAN_128", "CODE_39"]).nullish(),
99
HideShipperAddress: z.boolean().nullish(),

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

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

1313
@Identifier("createCustomContent")
14-
@Signature("(barcodeContentType: \"TRACK_ID\"|\"GLS_SHIPMENT_REFERENCE\", customerLogo: string, hideShipperAddress?: boolean, barcodeType?: \"EAN_128\"|\"CODE_39\", barcode?: string): GLS_CUSTOM_CONTENT")
14+
@Signature("(barcodeContentType?: \"TRACK_ID\"|\"GLS_SHIPMENT_REFERENCE\", customerLogo?: string, hideShipperAddress?: boolean, barcodeType?: \"EAN_128\"|\"CODE_39\", barcode?: string): GLS_CUSTOM_CONTENT")
1515
@Name({code: "en-US", content: "Create GLS custom label content"})
1616
@DisplayIcon("codezero:gls")
1717
@DisplayMessage({code: "en-US", content: "Create GLS custom label content"})
@@ -25,6 +25,7 @@ import {CustomContent} from "../../data_types/glsCustomContent.js";
2525
})
2626
@Parameter({
2727
runtimeName: "barcodeContentType",
28+
optional: true,
2829
name: [{code: "en-US", content: "Barcode content type"}],
2930
description: [{
3031
code: "en-US",
@@ -33,29 +34,33 @@ import {CustomContent} from "../../data_types/glsCustomContent.js";
3334
})
3435
@Parameter({
3536
runtimeName: "customerLogo",
37+
optional: true,
3638
name: [{code: "en-US", content: "Customer logo"}],
3739
description: [{code: "en-US", content: "Base64-encoded customer logo to print on the label."}],
3840
})
3941
@Parameter({
4042
runtimeName: "hideShipperAddress",
43+
optional: true,
4144
name: [{code: "en-US", content: "Hide shipper address"}],
4245
description: [{code: "en-US", content: "Whether to hide the shipper address on the label."}],
4346
})
4447
@Parameter({
4548
runtimeName: "barcodeType",
49+
optional: true,
4650
name: [{code: "en-US", content: "Barcode type"}],
4751
description: [{code: "en-US", content: "Type of barcode to use (EAN_128 or CODE_39)."}],
4852
})
4953
@Parameter({
5054
runtimeName: "barcode",
55+
optional: true,
5156
name: [{code: "en-US", content: "Barcode"}],
5257
description: [{code: "en-US", content: "Barcode value to print on the label."}],
5358
})
5459
export class CreateCustomContentFunction {
5560
run(
5661
_context: unknown,
57-
barcodeContentType: CustomContent["BarcodeContentType"],
58-
customerLogo: string,
62+
barcodeContentType?: CustomContent["BarcodeContentType"],
63+
customerLogo?: string,
5964
hideShipperAddress?: boolean,
6065
barcodeType?: CustomContent["BarcodeType"],
6166
barcode?: string

actions/shopify-action/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.env
2+
node_modules/
3+
dist/

actions/shopify-action/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:24-alpine
2+
3+
WORKDIR /app
4+
5+
COPY package.json package-lock.json* ./
6+
7+
RUN npm install
8+
9+
COPY . .
10+
11+
RUN npm run build
12+
13+
CMD ["npm", "run", "start"]

actions/shopify-action/README.md

Whitespace-only changes.

0 commit comments

Comments
 (0)