|
| 1 | +import {runStandardActionDocs, StandardActionDocsConfig} from "../../../src/standardActionDocs" |
| 2 | +import {loadAllDefinitions} from "../src/helpers"; |
| 3 | + |
| 4 | +export function createGlsDocsConfig(): StandardActionDocsConfig { |
| 5 | + return { |
| 6 | + actionName: "GLS", |
| 7 | + typePrefix: "GLS_", |
| 8 | + typesOutputPath: "../../docs/Actions/GLS/types.mdx", |
| 9 | + functionsOutputPath: "../../docs/Actions/GLS/functions.mdx", |
| 10 | + loadAllDefinitions, |
| 11 | + typeLinkOverrides: { |
| 12 | + GLS_SHIPMENT_UNIT_SERVICE: "GLS_SHIPMENT_UNIT$Service", |
| 13 | + }, |
| 14 | + typesCopy: { |
| 15 | + title: "Datatypes", |
| 16 | + description: "All data types registered by the GLS Action.", |
| 17 | + heading: "GLS Action Types", |
| 18 | + intro: `The GLS Action registers the following data types with the Hercules platform. These types are used as inputs and outputs of the GLS functions and can be referenced in your flows.`, |
| 19 | + }, |
| 20 | + functionsCopy: { |
| 21 | + title: "Functions", |
| 22 | + description: "All functions registered by the GLS Action.", |
| 23 | + intro: `The GLS Action exposes functions grouped into three categories: |
| 24 | +
|
| 25 | +- **Builder functions** — Construct data objects (no API call) |
| 26 | +- **Shipment functions** — Create different types of GLS shipments (calls GLS API) |
| 27 | +- **API functions** — Query or modify shipments (calls GLS API)`, |
| 28 | + }, |
| 29 | + functionGroups: [ |
| 30 | + { |
| 31 | + heading: "Builder functions", |
| 32 | + modules: import.meta.glob("../src/functions/utils/*.ts"), |
| 33 | + }, |
| 34 | + { |
| 35 | + heading: "Shipment functions", |
| 36 | + intro: `All shipment functions accept a common set of parameters in addition to their type-specific parameters. They call the GLS ShipIT API (\`POST /rs/shipments\`) and return a \`GLS_CREATE_PARCELS_RESPONSE\`. |
| 37 | +
|
| 38 | +**Common parameters for all shipment functions:** |
| 39 | +
|
| 40 | +| Parameter | Type | Required | Description | |
| 41 | +|-------------------|-------------------------------|----------|----------------------------------------------------| |
| 42 | +| \`shipment\` | GLS_SHIPMENT_WITHOUT_SERVICES | **Yes** | Shipment data (consignee, shipper, units, product) | |
| 43 | +| \`printingOptions\` | GLS_PRINTING_OPTIONS | **Yes** | Label format settings | |
| 44 | +| \`returnOptions\` | GLS_RETURN_OPTIONS | No | Whether to return print data and routing info | |
| 45 | +| \`customContent\` | GLS_CUSTOM_CONTENT | No | Custom logo and barcode settings | |
| 46 | +
|
| 47 | +---`, |
| 48 | + modules: import.meta.glob("../src/functions/services/*.ts"), |
| 49 | + }, |
| 50 | + { |
| 51 | + heading: "API functions", |
| 52 | + modules: import.meta.glob("../src/functions/*.ts"), |
| 53 | + }, |
| 54 | + ], |
| 55 | + } |
| 56 | +} |
| 57 | + |
| 58 | +await runStandardActionDocs(createGlsDocsConfig()) |
0 commit comments